var ori = '6506394';

function loadCode(fileName) 
{
	var xmlDoc;	
	if (window.XMLHttpRequest)	{
		xmlDoc=new window.XMLHttpRequest();
		xmlDoc.open("GET",fileName,false);
		xmlDoc.send("");
		return xmlDoc.responseXML;
	} else if (ActiveXObject("Microsoft.XMLDOM")) {
		xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.async=false;
		xmlDoc.load(dname);
		return xmlDoc;
	}
	return null;
}

function checkCode(sText) {
	xmlDoc = loadCode("1459e154-d29d-4ac5-8ba3-f4a77ded3519.xml");
	if(xmlDoc==null) {
		document.ppForm.hosted_button_id.value = ori;
		return false;
	}	
	var coupon = xmlDoc.getElementsByTagName("coupon");
	var discountCode = coupon[0].getElementsByTagName("discountCode")[0].childNodes[0].nodeValue;	
	var encryptCode = coupon[0].getElementsByTagName("encryptCode")[0].childNodes[0].nodeValue;		
	var tb = document.ppForm.hosted_button_id;
	if(sText.toUpperCase()==discountCode.toUpperCase())
		tb.value = encryptCode;
	else
		tb.value = ori;
}