function goMerchant(){
	if (document.merchlist.MID.options[document.merchlist.MID.selectedIndex].value != "") {
		if (document.merchlist.MID.options[document.merchlist.MID.selectedIndex].value == "all") {
			window.location.href = "/eva/category.jsp?category=all";
			return false;
		}else{
			window.location.href = document.merchlist.MID.options[document.merchlist.MID.selectedIndex].value;
			return false;
		}
	}
}


var xmlDoc;
var browser=navigator.appName;

if (browser!="Microsoft Internet Explorer"){
	xmlDoc=new window.XMLHttpRequest();
  	xmlDoc.open("GET","/eva/merchants.xml",false);
  	xmlDoc.send("");
  	xmlDoc=xmlDoc.responseXML;
}else{
	xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
  	xmlDoc.async=false;
  	xmlDoc.load("/eva/merchants.xml");
}

var x=xmlDoc.getElementsByTagName("merchant");
for (i=0;i<x.length;i++)
{ 
	var optionValue=x[i].getElementsByTagName("option")[0].childNodes[0].nodeValue;
	var path=x[i].getElementsByTagName("option")[0].getAttribute("path");
	var expiry_date=x[i].getElementsByTagName("expires")[0].childNodes[0].nodeValue;
	expiry_date = expiry_date.split("/")
	
	var the_date = new Date(expiry_date[2],expiry_date[1]-1,expiry_date[0],23,59,59 );
	var current_date = new Date();
	
	var merchant=optionValue
		
	if(the_date >= current_date){
		if (merchant == cur_merchant){
  			document.write("<option value=\"/eva/offer/"+path+"/\" selected='selected'>"+optionValue+"</option>");
		}else if (path == "")  {
			document.write("<option value=\"\">"+optionValue+"</option>");
		}else {
			document.write("<option value=\"/eva/offer/"+path+"/\">"+optionValue+"</option>");
		}
	}
}

