var popWindow = null;

function popwindow(url,width,height) {
	var midX = (screen.width/2)-(width/2);
	var midY = (screen.height/2)-(height/2);
	popWindow = window.open (''+[url]+'','popwin', "width="+[width]+",height="+[height]+",toolbar=no,menubar=no,scrollbars=yes,resizable=yes,top="+midY+",left="+midX+",screenX="+midX+",screenY="+midY+"");
	popWindow.focus();

}



var mImgList = new Array("home","about-us","products","locations","resources","contact-us","order");
var mOutImg = new Array();
var mOverImg = new Array();
var mSelImg = new Array();
var i,j;

//load images
for(i=0;i<mImgList.length;i++) {
	mOutImg[mImgList[i]] = new Image();
	mOutImg[mImgList[i]].src = "/images/menubar_"+mImgList[i]+".gif";
	mOverImg[mImgList[i]] = new Image();
	mOverImg[mImgList[i]].src = "/images/menubar_hover_"+mImgList[i]+".gif";
	mSelImg[mImgList[i]] = new Image();
	mSelImg[mImgList[i]].src = "/images/menubar_active_"+mImgList[i]+".gif";
}

function SetImg() {
        for(i=0;i<mImgList.length;i++) {
	        if(mImgList[i]==currentPage) {
			    document.images[mImgList[i]].src = mSelImg[mImgList[i]].src;
		    } else {
			    document.images[mImgList[i]].src = mOutImg[mImgList[i]].src;
		    }
		    //if(document.images[1].filters) { document.images[1].filters.blendTrans.play(); }
		}
}


function mOvr(img) {
	if(document.images && document.images[img]) {
		if(img==currentPage) {
			document.images[img].src = mSelImg[img].src;
		} else {
			document.images[img].src = mOverImg[img].src;
		}
		//if(document.images["home"].filters) { document.images["home"].filters.blendTrans.play(); }		
	}

}

function mOut(img) {
	if(document.images && document.images[img]) {
		if(img==currentPage) {
			document.images[img].src = mSelImg[img].src;
		} else {
			document.images[img].src = mOutImg[img].src;
		}
		//if(document.images["home"].filters) { document.images["home"].filters.blendTrans.play(); }
	}
}


function Initialize(){

	if(eval(document.search_functions2)){
		if(eval(document.search_functions2.findretailer)){
			fillZipCode();
		}
	}
}

function fillZipCode(){
	if(document.all){
		if(document.all("findretailer").value == ""){
			document.all("findretailer").value="Enter your zip code";
			document.all("findretailer").style.color="#ABABAB";
		}
	}
	else{
		if(document.getElementById("findretailer").value == ""){
		    document.getElementById("findretailer").value="Enter your zip code";
			document.getElementById("findretailer").style.color="#ABABAB";
		}
	}
}

function clearZipCode(){
	if(document.all){
		if(document.all("findretailer").value == "Enter your zip code"){
			document.all("findretailer").value="";
			document.all("findretailer").style.color="#000000";
		}
	}
	else{
		if(document.getElementById("findretailer").value == "Enter your zip code"){
			document.getElementById("findretailer").value="";
			document.getElementById("findretailer").style.color="#000000";
		}
	}
}



function checkform1 ( form )
{

  // ** START **
  if (form.keywords.value == "") {
    form.keywords.focus();
    return false ;
  }
  // ** END **
  return true ;
}



function checkform2 ( form )
{

  // ** START **
  if (form.zipcode.value == "" || form.zipcode.value == "Enter your zip code" ) {
    form.zipcode.focus();
    return false ;
  }
  // ** END **
  return true ;
}

