// js extras script

$(document).ready(function () {
    $("input#letteremail").click(function () { 
		if ($(this).val() == "Email address in here...") {
      		$(this).val("");
		}
    });
	 $("input#term").click(function () { 
      if ($(this).val() == "Search entire store here...") {
      		$(this).val("");
		} 
    });
	 
	if ($("#adminhome").length > 0) {
		
		$("#information").css("display","none");
		
		//alert("only admin");
		//var aDivs = ["leftcont","header","horiznav"];
		
		//for (var i = 0; i < aDivs.length; i++) {
			//
		  // $("#"+aDivs[i]).append('<div id="'+aDivs[i]+'cover">&nbsp;</div>');
		  // $("#"+aDivs[i]).css("position","relative");
		  // var heightElem = document.getElementById(aDivs[i]).offsetHeight;
		  // $("#"+aDivs[i]+"cover").css("position","absolute")
		 				//.css("top","0")
						//.css("left","0")
						//.css("width","100%")
						//.css("height",""+heightElem+"px")
						//.css("opacity","0.8")
						//.css("background","#000");
			//} 
	}
	
	if ($("#subtotal").length > 0) {
			
			$("#baskettotal").html($("#subtotal").html());
			
			var items = 0;
			if ($(".amount").length > 0) {
				
				$(".amount").each(function (i) {
					
					items = items+parseInt($(this).val());
					
				  });
			}
			
			if (items == 0) {						
			$("#basketitems").html("no items");
			}
			else if (items == 1) {						
			$("#basketitems").html("1 item");
			}
			else {
				$("#basketitems").html(items+" items");	
			}
			
		
	}
	if ($("#breadcrumbs").length > 0) {
		
		//$("#breadcrumbs").css("display","none");
		//setTimeout( function()
		  //{
			// $("#breadcrumbs").toggle(1000);
		  //}, 10);		
		
	}

	//subnav flyout
	$(".subnav").css("display","none");
	$(".subnav").parent().mouseover(function(){							
		
			$(this).children("ul").css("display","block");			
									
	});
	$(".subnav").parent().mouseout(function(){							
		
			$(this).children("ul").css("display","none");			
									
	});
	
	
	 
	 
});
