// JavaScript Document

$(document).ready(function() {
	 
	 // THIS FIXES ALL TANSPARENT PNS IMAGES
	 $(document).pngFix();
		
		
		$("#search > .selection > #vType").css({"display":"block", "opacity":"1"});
		
		$("#search > .selection > #batteryTypeSearch").css({"display":"block", "opacity":"1"});
		
		
		
		
		$("#search > .selection").hover(function() {
		$(this).addClass("trans");  
		  }, function() {
			  $(this).removeClass("trans");
    });

	$("#searchForm > .selection :input[@attr='inactive']").css({"opacity":".5"});  
	
	 //$("#search :input").css({"opacity":"0"});
	 //$("#search label").css({"opacity":"0"});
	 
	 
	 /*$(function()
   {
        $("#searchForm > .selection").hide(); //hide 
        $(this).children(':input').select(function(){  
            $("#searchForm > .selection").show(); //show
        });

  });*/
	 
	 
	 $("#search :input[attr=active]").css({"opacity":"1"});
	 $("#search label[attr=active]").css({"opacity":"1"});
	 
	 
	 $("#batteryTypeSearch label[attr=active]").css({"opacity":"1"});
	
	
	
	
	
	// THIS IS THE FADE TRANSITION FOR THE HOMEPAGE MAIN IMAGE
	$(function() {
		 $("#mainImage > #window").cycle();
		 $('#mainImageWrapper > #window').cycle('fade', 'slow');
	});
	
	
	
	 
	 
	 
	 // MAKES THE BACKGROUND IMAGE OF THE REPLACEMENT TAG TRANSPARENT AND ALLOWS LINKS TO WORK IN IE
	 $("#replacementWrapper > #fade").css({"position": "absolute",
												"bottom": "0",
												"left": "0",
												"opacity":".5"});
	  
	 
	 //FOOTER LINKS
	 $("#footer > ul > li > a").css({"color":"#B2FF3D", "text-decoration":"none"});
	 $("#footer > ul > li:last-child").css({"border-right":"none"});
			 
	 
	 $("#footer > ul > li > a").hover(function() {
		$(this).css({"color":"#fff"});
		  }, function() {
			  $(this).css({"color":"#B2FF3D", "text-decoration":"none"});
    });
	 
	 $("div.state:last-child").css({"border":"none"});
	 
	 /*$("div.state").click(function() {
				$(this).children("div.entry").slideDown(700);
				$(this).addClass("active");
							$("div.state.active").css({"opacity":".65"});
							$(this).children("span").addClass("active");
							
				$("div.state").not(this).children("div.entry").slideUp(500);
				$("div.state").not(this).removeClass("active");
					$("div.state").not(this).children("span").removeClass("active");
					
							$("div.state").not(this).css({"opacity":"1"});
						
	  });*/
	 
	 //
	 
	 	$("div.state").click(function() {
			$("div.state.active").css({"opacity":"1"});						  
			$(this).children(".entry").slideToggle(700);
			$(this).toggleClass("active");
			$("div.state").not(this).removeClass("active");
			$("div.state.active").css({"opacity":".65"});						  
			$(this).children("span").toggleClass("active");
			
			$("div.state").not(this).children("span.active").removeClass("active");
			$("div.state").not(this).children(".entry").slideUp(1000);
			  }, function() {
				 $(this).children(".entry").slideUp(700);
				 $("div.state").removeClass("active");
				  //$("div.state").(this).css({"opacity":"1"});
				  //$(this).children("span.dropSign").removeClass("dropSign");
				  $("div.state").not(this).children("span.active").removeClass("active");
	 });
	 //
	 
	 
	
});
