function numbersonly(myfield, e, dec)
{
	var key;
	var keychar;

	if (window.event)
	   key = window.event.keyCode;
	else if (e)
	   key = e.which;
	else
	   return true;
	keychar = String.fromCharCode(key);

	// control keys
	if ((key==null) || (key==0) || (key==8) ||
	    (key==9) || (key==13) || (key==27) )
	   return true;

	// numbers
	else if ((("0123456789").indexOf(keychar) > -1))
	   return true;

	// decimal point jump
	else if (dec && (keychar == "."))
	{
		myfield.form.elements[dec].focus();
		return false;
	}
	else
	   return false;
}

/* this function will rewrite the dom to change the homepage.htm to homepage.htm?pnr=pCode */
var newPnr;
function changeHome(pCode){
	var links,i;
	var path = location.protocol+'//'+location.host+'/';
	links=document.getElementsByTagName('A');
	//alert(links.length);
	for(i=0;i<links.length;i++)
	{
		var atts,j;
		atts=links[i].attributes;
		for( j=0;j<atts.length;j++) {
			if( atts[j].nodeName.toLowerCase() == 'href'){
				if(navigator.appName=="Microsoft Internet Explorer"){
					if(atts[j].nodeValue==path+'homepage.htm'||path+'homepage.htm?pnr='+newPnr){
						links[i].setAttribute('href','http://www.skymall.com/shopping/homepage.htm?pnr='+pCode);
					}
				}else{
					if(atts[j].nodeValue=='homepage.htm'||atts[j].nodeValue.substring(0,17)=='homepage.htm?pnr='){
						links[i].setAttribute('href','http://www.skymall.com/shopping/homepage.htm?pnr='+pCode);
					}
				}
			}
		}newPnr=pCode;
	}			
}