function preloadImg(imgName)
{
    <!--
    if (document.images)
    {
      var pic1;
      pic1= new Image(1,1); 
      pic1.src=imgName; 
    }
    //-->

}

function pngBack(el,img)
{
    var arVer = navigator.appVersion.split("MSIE")
var ver = parseFloat(arVer[1])
    var table;
    table = document.getElementById(el);
    if (ver < 7)
    {
        table.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" +img + "',sizingMethod='scale'); ";
        //table.style = "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" +img + "',sizingMethod='scale'); ";
        // do the filter hack here
    }
    else
    {
        // we can just make the png the background
        //alert("in the else");
        //table.background = img;
        table.style.background = "url(" + img + ")";
    }
    
}

/*
sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	
	for (var i=0; i < sfEls.length; i++) {
		sfEls[i].onmouseover = function() {
			this.className+=" sfhover"; }
		
		sfEls[i].onmouseout = function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), ""); }
	}
}

if (window.attachEvent) window.attachEvent("onload", sfHover);
*/

/* hidden product color selector */
function selectColor(controlID, newValue){
	elem = document.getElementById(controlID);
	elem.value = newValue;

    window.document.movie.SetVariable("product_color", newValue);

}

/* contact us form validation */
function sendMsg() {
	var msg;
	msg = "";
	
	if ( document.forms.sendMessage.name.value == ''){
		msg = msg + "Please enter your name.\n";
	};

	if ( document.forms.sendMessage.email.value == ''){
		msg = msg + "Please enter your email.\n";
	};

	if ( document.forms.sendMessage.message.value == ''){
		msg = msg + "Please enter a message.\n";
	};

	if ( document.forms.sendMessage.product_id.value == ''){
		msg = msg + "Please choose a product.\n";
	};
	
	if ((document.forms.sendMessage.product_id_sel.value != '') && (document.forms.sendMessage.product_sku.value != ''))
	{
	 msg = msg + "Please only select a product from the drop down or enter a product into the text area.\n";
	};
	
	
	
	if (msg == "") {
		document.forms.sendMessage.submit();
	} else {
		alert(msg);
	}
	
};
	
	
/* feedback form validation */
function addfeedback() {
	var msg;
	msg = "";
	
	if ( document.forms.addFeedback.name.value == ''){
		msg = msg + "Please enter your name.\n";
	};

	if ( document.forms.addFeedback.email.value == ''){
		msg = msg + "Please enter your email.\n";
	};

	if ( document.forms.addFeedback.state.value == ''){
		msg = msg + "Please enter your state.\n";
	};

	if ( document.forms.addFeedback.comments.value == ''){
		msg = msg + "Please leave some feedback.\n";
	};

	if (msg == "") {
		document.forms.addFeedback.submit();
	} else {
		alert(msg);
		return false;
	}
	
	
};
	
	
/* switchin' blueswitch logo */
function changelink_switch(){
	document.all._switch.style.color='#FF9933'; 
	document.all._blue.style.color='#00479C'; 
}

function changeback_switch(){
	document.all._switch.style.color='#666666'; 
	document.all._blue.style.color='#666666'; 
}

function changelink_blue(){
	document.all._blue.style.color='#00479C'; 
	document.all._switch.style.color='#FF9933'; 
}

function changeback_blue(){
	document.all._blue.style.color='#666666'; 
	document.all._switch.style.color='#666666'; 
}


/* REMOVE GOOGLE TOOLBAR FORMATTING */
  if(window.attachEvent)
    window.attachEvent("onload",setListeners);

  function setListeners(){
    inputList = document.getElementsByTagName("INPUT");
    for(i=0;i<inputList.length;i++){
      inputList[i].attachEvent("onpropertychange",restoreStyles);
      inputList[i].style.backgroundColor = "";
    }
    selectList = document.getElementsByTagName("SELECT");
    for(i=0;i<selectList.length;i++){
      selectList[i].attachEvent("onpropertychange",restoreStyles);
      selectList[i].style.backgroundColor = "";
    }
  }

  function restoreStyles(){
    if(event.srcElement.style.backgroundColor != "")
      event.srcElement.style.backgroundColor = "";
  }//-->
  /* END REMOVE GOOGLE TOOLBAR FORMATTING */