/**
 * @author Kovacs Gabriel
 */


$(document).ready(function(){
	
	/*
	if ($.browser.browser == "MSIE") {
				$("#product-filters").hide();
			} 
	*/
	
	//alert($.browser.version);
	
	$("#login form div").hide();
	$("#login ul").hide();
	
	 $('#login-needed-content-form p span').hide();
	
	$("#login-needed-content-form a[rel='login-needed']").hover(
		function () {
		$("#login form input").slideDown(500);
		$("#login ul").slideDown(500);
		$('#login-needed-content-form p span').slideDown(300);
	}, function () {
		$('#login-needed-content-form p span').slideUp(300);
	}); 
	
	$("#login form button").mouseover(
		function () {
		$(this).css( {"margin-left": "0"} );
		if ($.browser.name != "ie" || ($.browser.name == "ie" && $.browser.version != 6)) {
			$("#inner-wrapper").css("background","url(../hospitality/images/lamp_on.png) right top no-repeat");
		}
		$("#login form div").show(500);
		$("#login ul").show(500);
	});
	
	$("#login").hover(
      function () {
	  	if ($.browser.name != "ie" || ($.browser.name == "ie" && $.browser.version != 6)) {
			$("#inner-wrapper").css("background","url(../hospitality/images/lamp_on.png) right top no-repeat");
		}
      }, 
      function () {
	  	if ($.browser.name != "ie" || ($.browser.name == "ie" && $.browser.version != 6)) {
			$("#inner-wrapper").css("background","url(../hospitality/images/lamp_off.png) right top no-repeat");
		}
      }
	  
	 
	
    );
	
	
	

	$("#logout div").hide();
	
	$("#logout form button").mouseover(
		function () {
		$(this).css( {"margin-left": "0"} );
		if ($.browser.browser != "MSIE") {
			$("#inner-wrapper").css("background","url(../hospitality/images/lamp_on.png) right top no-repeat");
		}
		$("#logout div").show(500);
	});
	
	$("#logout").hover(
      function () {
	  	if ($.browser.browser != "MSIE") {
			$("#inner-wrapper").css("background","url(../hospitality/images/lamp_on.png) right top no-repeat");
		}
      }, 
      function () {
	  	if ($.browser.browser != "MSIE") {
			$("#inner-wrapper").css("background","url(../hospitality/images/lamp_off.png) right top no-repeat");
		}
      }
    );
	
	$("#checkAll").click(function(){
		/*
 var check_value = $(this).parent(0).text();
		 //alert($(this).parent(0).val());
		if(check_value=='Check All Options Above') {
		 	$(this).check_value.replaceWith('Uncheck All Options Above');
		 } else {
		 	$(this).check_value.replaceWith('Check All Options Above');
		 }
*/
		 
		 $(".columnRight").find("input[@name^='type']").each(function(){
                
				if (this.checked == false) {
					this.checked = true;
				} else {
					/*if(this.checked != true)*/
						this.checked = false;
				}
				
            });
	}
	);
	
	
	// Project Center - Add by SKU
	$("#add-by-sku").hide();
	$("#add-by-sku-toggle").click(function(){
		$("#add-by-sku").toggle();
		$("#add-by-sku").highlightFade({start:'#c31201', end:'#605d4e', speed:1000});
	});
	
	// Project Center - Textarea hide text when focused
	var textareaTXT = "Please enter any changes or customization features for this lamp or table";
	
	$(".prepopulated-textarea").focus(function(){
		if ($(this).val() == textareaTXT)
			//alert("yes");
			$(this).text("");
	});
	$(".prepopulated-textarea").blur(function(){
		//alert($(this).val());
		if (!$(this).text())
			//alert("yes");
			$(this).text(textareaTXT);
	});
	
});