
$(document).ready(function() {
	

	$("input[@type='checkbox'] + label", this)
		.each( function(){
			if ( $(this).prev()[0].checked )
				$(this).addClass("checked");
			else
				$(this).addClass("unchecked");
		})
		.hover( 
			function() { $(this).addClass("over"); },
			function() { $(this).removeClass("over"); }
		)
		.click( function() {
			$(this)
				.toggleClass("checked")
				.prev()[0].checked = !$(this).prev()[0].checked;
			$(this)
				.toggleClass("unchecked")
				.prev()[0].checked == $(this).prev()[0].checked;
		})
		.prev().hide();




	
	
if (document.getElementById("slideshowinside")) 	{
	
 $('#slideshowinside').before('<div id="slidenav" class="nav">').cycle({
        
        speed:  '3000',
        timeout: 4000,
        pager:  '#nav',
       before: function() { if (window.console) console.log(this.src); }
    });


}

if (document.getElementById("teamslideshow")) 	{
	
 $('#teamslideshow').cycle({
        
        speed:  '500',
        timeout: 4000,
     	nowrap: 1,
       before: function() { if (window.console) console.log(this.src); }
    });


}

//

//$("#subnav").hide();      
// $("a.activate").hover ( function() {         
// $("div.activediv").find("#subnav").show();        },
// function(){ 
//    }      ); 



//$("#subnav").mouseout(function(){$(this).hide(); }
// 
 
// )    

$("a.activate").hover(function(){
    	$("#subnav").stop(true, true);
		$("#subnav").show();
		
	},
		function(){$("#subnav").addClass("done");
	});
	
	
	$("#content").hover(function(){
    	$("#subnav").stop(true, true);
		$("#subnav").hide();
		

	});
	
	
	if (document.getElementById("slideshow")) {
	
	$('#slideshow').cycle({ 
  
    speed:  'fast', 
    timeout: 0, 
    pager:  '#nav', 
    pagerAnchorBuilder: function(idx, slide) { 
        // return selector string for existing anchor 
        return '#nav li:eq(' + idx + ') a'; 
    } 
});
	}
	
	
	if (document.getElementById("projectslideshow")) {
	
	$('#projectslideshow').cycle({ 
  
    speed:  'fast', 
    timeout: 5000, 
    pager:  '#projectnav', 
    pagerAnchorBuilder: function(idx, slide) { 
        // return selector string for existing anchor 
        return '#projectnav li:eq(' + idx + ') a'; 
    } 
});
	}
	
	
	if (document.getElementById("mainprojectslideshow")) {
	
	
	
	
	


var toggle = $('#pausebutton').click(function() {
		var paused = slideshow.is(':paused');
		slideshow.cycle(paused ? 'resume' : 'pause', true);
	});


var slideshow = $('#mainprojectslideshow').cycle({
		timeout: 5000,
		pause: true,
		paused: function(cont, opts, byHover) {
			
			
		},
		resumed: function(cont, opts, byHover) {
			
			
		},
		next:   '#next2', 
    prev:   '#prev2'
		
	});



	}
	
});



