function ShowMenu(themenu){
	var el = document.getElementById(themenu);
	
	if (el){
		el.style.visibility = 'visible';
	}
}

function HideMenu(themenu){
	var el = document.getElementById(themenu);
	
	if (el){
		el.style.visibility = 'hidden';
	}
}

function showEnlarged(theImage){
	var xpos = 0;
	var ypos = 0;
	var width=550;
	var height=480;
	winOptions = 'toolbar=0,location=0,menubar=0,directories=0,screenx=' +  xpos + ',screeny='+ ypos + ',top='+ ypos +',left=' + xpos + ',status=0,menubar=0,scrollbars=0,resizable=0,width=' + width + ',height=' + height;
	
	var temp = window.open('/products/product_enlarged.php?image=' + theImage, '', winOptions);
	temp.focus();
}

function clearText(field){
    if (field.defaultValue == field.value) field.value = '';
    else if (field.value == '') field.value = field.defaultValue;
}

$(document).ready(function(){
	
	$("a.part_detail").colorbox({current:"",opacity:.8, onComplete:
		function(){ 
			
			 var href = $.colorbox.element().attr("href");
   			 
   			 if (href) {
        		_gaq.push(["_trackPageview", href]);
    		 }
 		}	
	});

});


function getModels(){
	$.getScript("/includes/_parts_search_sku_select.php?product_type=" + $('#product_type').val(), function() {
  		getParts();
	});
}	

function getSeries(){
	$.getScript("/includes/_parts_search_series_select.php?model_number=" + $('#model_number').val() , function() {
  		getParts();
	});
}

function getParts(){
	$.getScript("/includes/_parts_search_parts_select.php?model_number=" + $('#model_number').val() + "&series_code=" + $('#series_code').val(), function() {
  		// no callback for now
	});
}

function howtofind(){
	$.fn.colorbox({href:"/images/HB_Product_Label.png" });
}

function adjustCombinedShipping(){
	$("#shipments_summary > span").html( (  parseFloat($("#ship_62_" +  $("input[id='ship_62']:checked").val()).html()) +  parseFloat($("#ship_64_" +  $("input[id='ship_64']:checked").val()).html())).toFixed(2) );
}

function sendAFriend(){
	var xpos = 0;
	var ypos = 0;
	var width=400;
	var height=700;
	winOptions = 'toolbar=0,location=0,menubar=0,directories=0,screenx=' +  xpos + ',screeny='+ ypos + ',top='+ ypos +',left=' + xpos + ',status=0,menubar=0,scrollbars=0,resizable=0,width=' + width + ',height=' + height;
	
	var temp = window.open('/send-a-friend.php?link=' + document.location.pathname , '', winOptions);
	temp.focus();
}



