// This document is included in every page of the site

// preload images ------------------------------------------------
var img1 = new Image().src = "/images/stars/stars-1-0.gif"
var img2 = new Image().src = "/images/stars/stars-2-0.gif"
var img3 = new Image().src = "/images/stars/stars-3-0.gif"
var img4 = new Image().src = "/images/stars/stars-4-0.gif"
var img5 = new Image().src = "/images/stars/stars-5-0.gif"
 function go()
{
	box = document.forms['frmState'].navi;
	destination = box.options[box.selectedIndex].value;
	if (destination) location.href = destination;
}
 function goCat()
{
	box = document.forms['frmStore'].navi;
	destination = box.options[box.selectedIndex].value;
	if (destination) location.href = destination;
}
 function swapSearch()
{
	var kword, frm, sType;
	frm		=	document.frmQsearch; 
	kword	=	document.frmQsearch.qry.value;
	if(document.frmQsearch.sdir.item(0).checked == true) {
		sType   =   "STORE";
	}
	else {
		sType   =   "PROD";
	}
	if (kword == "")	{
		alert("Please enter keyword to search");
		return false;
	}
	else	{
		if (sType=="STORE") {
			frm.action = "/simple_search.html";
		}
		else {
			frm.action = "/simple_search_store.html";
		}
		frm.submit();
		return true;
	}
}
function bookmarksite(title, url){
	if (document.all)
		window.external.AddFavorite(url, title);
	else if (window.sidebar)
		window.sidebar.addPanel(title, url, "")
}
function sendToClipboard(what){
	if( window.clipboardData && clipboardData.setData )	{
		window.clipboardData.setData('Text',what.value);
	} else {
		alert("Internet Explorer required - Copy Code Manually");
	}
}

function setImage(imageSelect) {
 theImageIndex = imageSelect.options[imageSelect.selectedIndex].value;
 if (document.images)
     document.images['tRate'].src = eval("img" + theImageIndex);
  }
