// JavaScript Document
(function (jQuery) {
		jQuery.fn.zemoSlider = function(){
			var $$ = jQuery(this);
			var current = 0;
			var autoPlay = true;
			var len = $$.find("ul li").length;
			
			var play = function(){
			$$.find("ul li").eq(current).fadeIn(1000).siblings().hide(); 	
				
			};
			var delay = 15000;
			sliderIntervalID = setInterval(function(){
													if(current>=len-1)
												   		{
													  		 current = 0;
												  		 } else {
													 		  current++;
												  		 }
												   		play();
																							 
													 }, delay);
			$$.find("#slider-prev").click(function(){
										if(current<1)
										{
											current = len-1;
										} else {
											current--;
										}	
										if(autoPlay)
										{
										 autoPlay = false;	
										 clearInterval(sliderIntervalID);
										 $$.find("#slider-play").css("background-position","left bottom");
										}										
										 play();
										}
										  );
			$$.find("#slider-next").click(function(){
												   if(current>=len-1)
												   {
													   current = 0;
												   } else {
													   current++;
												   }
										if(autoPlay)
										{
										 autoPlay = false;	
										 clearInterval(sliderIntervalID);
										 $$.find("#slider-play").css("background-position","left bottom");
										}										
												   
												   play();

												   });
		  $$.find("#slider-play").click(function(){
												 if(autoPlay)
												 {
													 autoPlay = false;
												 } else {
													 autoPlay = true;
												 }
												 if(autoPlay)
												 {
													 jQuery(this).css("background-position","left top");
													 sliderIntervalID = setInterval(function(){												   														if(current>=len-1)
												   		{
													  		 current = 0;
												  		 } else {
													 		  current++;
												  		 }
												   		play();
																							 
													 }, delay);
												 }else{
													 jQuery(this).css("background-position","left bottom");
													 clearInterval(sliderIntervalID);
												 }
												 
												 });	
		}
})(jQuery);

jQuery(function($){
				
				jQuery("img[src$='png']").pngfix();
				jQuery("input#query").focus(
										function(){											
											if(jQuery(this).val()=="search case types"){jQuery(this).val("");}
										}
										);
				jQuery("input#query").blur(
										function(){
											if(jQuery(this).val()==""){jQuery(this).val("search case types");}
										}
										);
				jQuery("#ads").zemoSlider();
				jQuery("#nav li").hover(function(){jQuery(this).children("ul").unbind( "hover" ).fadeTo(500,0.96); },
										function(){jQuery(this).children("ul").unbind( "hover" ).hide(); }
												 );
				if(jQuery("#sidebar").height()< jQuery("#yui-main").height()){jQuery("#sidebar").height(jQuery("#yui-main").height())}
				jQuery("table.formRows tr input,table.formRows tr textarea").focus(
					function(){
						jQuery(this).parents("tr").addClass("focus");
														   
				}).blur(
					function(){
						jQuery(this).parents("tr").removeClass("focus");
					}
				);
				
				
				});

jQuery(document).ready(function() {
    jQuery("#read_more_about").hide();
	jQuery("#read-more").click(function(event) {
		jQuery("#read_more_about").show();
		event.preventDefault();
	});
});

