<!--
function init(href){
	if (href.indexOf("?")==-1){ return }
	promocode=extractcode(href,"code");
	//alert(promocode);
	document.all.promocode.value=promocode;
	validate(promocode);
}

function validate(code) {
	if (code =="10off"){
		document.all.discount.innerHTML="&nbsp;-&nbsp;$10.00 &nbsp =&nbsp; <font color='#FF0000'><b>$29.95</b></font>";
		}
	else if (code=="") {
		document.all.discount.innerHTML="";
		}
	else if (code=="2-4-1") {
		document.all.discount.innerHTML="";
		alert("The 2-4-1 promotion has expired.");
		document.all.promocode.value="";
		//document.all.discount.innerHTML="&nbsp;-&nbsp;<font color='#FF0000'><b>Includes 1 free update.<br>    (Free update must be requested before August 23, 2008)</b></font>";
		}
	else if (code=="JUNESAVE") {
		document.all.discount.innerHTML="";
		alert("The JUNESAVE promotion has expired.");
		document.all.promocode.value="";
		}
	else {
		document.all.discount.innerHTML="";
		alert("This promotion has expired or code is invalid.");
	}

}

function extractcode(urlstring, varname){
if (urlstring.indexOf("?")==-1){ return }
var2=urlstring.split("?");
paramlist=var2[1];
params=paramlist.split("+");

if (params.lenth==0){
  param=params.split("=");
  codeval=param[1];
}
else{    
   for (var i=0; i < params.length; i++) {
     param=params[i].split("=");
     if (param[0]==varname)codeval=param[1];     
   }
}
return codeval;
}

