// JQUERY

$(document).ready(function() {
	
	$("a[rel^='asjhgaskjasg']").prettyPhoto();
	
	//STARTNAV
		//startList();
		//startList replaced by jQuery and hoverIntent to provide
		//a dropdown delay.
		var config = {    
			 sensitivity: 3, 	// number = sensitivity threshold (must be 1 or higher)    
			 interval: 200, 	// number = milliseconds for onMouseOver polling interval    
			 over:	function(){
						$(this).addClass("over");
					}, 			// function = onMouseOver callback (REQUIRED)    
			 timeout: 1000, 	// number = milliseconds delay before onMouseOut    
			 out:	function(){
						$(this).removeClass("over");
					} 			// function = onMouseOut callback (REQUIRED)    
		};
		
		$("ul#nav li").hoverIntent(config);

	/*
		$("ul#nav li").hoverIntent(
			function(){
				$(this).addClass("over");
			}, 
			function(){
				$(this).removeClass("over");
			}
		);
	*/
	
	//ENDNAV
	
	$(".latest_img").fadeTo("slow", 0.5);
	
	$(".latest_img").hover(function(){
		$(this).fadeTo("slow", 1.0);
	
	}, function(){
		$(this).fadeTo("slow", 0.5);
	
	}); 
	
	
//	var pause = 5000; // define the pause for each tip (in milliseconds) 
//	var length = $("ul#WebCmeHomeNews li").length; 
//		//alert("length: " + length)
//	var showthis = 1;		
//	
//	show();
//	setInterval(show,pause); // continues to execute until told to stop - we don't ever tell it to stop :-)
//
//
//	function show(){
//	
//		$("ul#WebCmeHomeNews li").hide();	
//		$("ul#WebCmeHomeNews li:nth-child(" + showthis + ")").fadeIn("fast");		
//	
//		// increment
//		if (showthis >= length){
//			showthis = 1;
//			//alert("reset: \n" + showthis + "::" + length);
//		}else{
//			showthis = showthis + 1;
//			//alert("increment: \n" + showthis + "::" + length);
//		} 
//	}
	



});

randomtip = function(){

	var pause = 5000; // define the pause for each tip (in milliseconds) 
	var length = $("ul#WebCmeHomeNews li").length; 
		//alert("length: " + length)
	var showthis = 1;		
	
	show();
	setInterval(show,pause); // continues to execute until told to stop - we don't ever tell it to stop :-)


	function show(){
	
		$("ul#WebCmeHomeNews li").hide();	
		$("ul#WebCmeHomeNews li:nth-child(" + showthis + ")").fadeIn("fast");		
	
		// increment
		if (showthis >= length){
			showthis = 1;
			//alert("reset: \n" + showthis + "::" + length);
		}else{
			showthis = showthis + 1;
			//alert("increment: \n" + showthis + "::" + length);
		} 
	}			
}
