﻿$(document).ready(function() {
	$('#pauseButton').click(function() {
		
		$("#pauseButton").toggleClass('pause');
		
		if( $("#pauseButton").is('.pause') ) {
			$('#ProjectSlideShow').cycle('pause');
		}
		else {
			$('#ProjectSlideShow').cycle('resume');
		}
	});
	
	$("a.switch_thumb").toggle(function(){
	  $(this).addClass("swap"); 
	  $("ul.display").fadeOut("fast", function() {
		$(this).fadeIn("fast").addClass("thumb_view"); 
		 });
	  }, function () {
	  $(this).removeClass("swap");
	  $("ul.display").fadeOut("fast", function() {
		$(this).fadeIn("fast").removeClass("thumb_view");
		});
	});
	
	$("#toggle").click(function() { $("#login-form, #recover-password").toggle(); });	
	
	// jQuery.Accordion
	$("#accordion div").hide();

	$("#accordion h4").toggle(function(){
		$(this).addClass("active"); 
		}, function () {
		$(this).removeClass("active");
	});
	
	$("#accordion h4").click(function(){
		$(this).next("div").slideToggle("slow,");
	});
	
	// Form Toggles
	$('#TrainedTrue').click(function(){
		$("#TrainedTrueBox").removeClass('hidden').addClass('clearfix');
		$("#TrainedTrueBox input, #TrainedTrueBox select").removeAttr("disabled");
	});
	$('#TrainedFalse').click(function(){
		$("#TrainedTrueBox").addClass('hidden').removeClass('clearfix');
		$("#TrainedTrueBox input, #TrainedTrueBox select").attr("disabled","disabled");
	});
	// validate the comment form when it is submitted
	$("#registration").validate();
	$(".cancel").click(function() {
		validator.resetForm();
	});
	// Sets jQuery Slider
	$("#project-slider").easySlider({
		auto: true, 
		continuous: true
	});
	// Sets jQuery Fancybox
	$("a.fancybox").fancybox({
		'zoomOpacity'			: true,
		'overlayShow'			: false,
		'zoomSpeedIn'			: 500,
		'zoomSpeedOut'			: 500
	});
	// Sets jQuery Flowplayer
	$("huluPlayer", "/media/flowplayer-3.1.0.swf", {
	
		clip: {
			baseUrl: '<%= ApplicationUrl %>media/film'
		},
		
		// disable default controls 
		plugins: {controls: null},
		
		// custom labels on the play button 
		play: {  
			replayLabel: 'Tekrar Oynat' 
		}
		
	// use playlist plugin to enable playlist items work as movie clips
	});
	
});

$(function() {         
         
    // initialize scrollable  
    $("div.scrollable").scrollable({ 
             
        // items are auto-scrolled in 2 secnod interval 
        interval: 6000, 
         
        // when last item is encountered go back to first item 
        loop: true,  
         
        // make animation a little slower than the default 
        speed: 600, 
         
        // when seek starts make items little transparent 
        onBeforeSeek: function() { 
            this.getItems().fadeTo(300, 0.2);         
        }, 
         
        // when seek ends resume items to full transparency 
        onSeek: function() { 
            this.getItems().fadeTo(300, 1); 
        } 
    });     
     
}); 
