function linkHandler(imageHref, swapHref, imageDescription){
	//var openURL = "popup.asp?ImageOff="+imageHref+"&ImageOn="+swapHref+"&Description="+imageDescription;
	var openURL = "popup.asp?ImageOff="+imageHref+"&Description="+imageDescription;
	MM_openBrWindow(openURL,"zoom","width=800,height=800,scrollbars=yes,resizable=yes");
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
  
function changePrimaryImageRoomshot(primaryImageId,imageName,largeImageName){
	document.getElementById(primaryImageId).src = "SupplyImages/" + imageName;
	document.getElementById("zoomer").href = "SupplyImages/" + largeImageName;	
	
	var lareimgpath = "SupplyImages/" + largeImageName;
	//var mainimage = document.getElementById(primaryImageId).src //= "SupplyImages/" + imageName;
	var mainimage  = "test";
	
	
	document.getElementById("zoomer").onclick = function(){linkHandler(lareimgpath,mainimage,altwebdesc)};
	
}


function gup( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}

var checkedForZip = false;
function checkForInvalidZip(){
	if(checkedForZip == false){
		var url = document.location.href;
		var invalidlocation = url.indexOf("zip=invalid");
		if(invalidlocation != -1 && invalidlocation != ''){
			alert("Please enter a valid zip code.");
		}
		checkedForZip = true;
	}
}
 
 window.onload = checkForInvalidZip;

