var rollovers = new Array();var ScrollSpeed = 250;var ScrollChars = 1
var theMenu = "Home,FAQ,Contact,Disclaimer".split(","); 
var mainMenu="SelectService,About,Register,Publications,Shopping,News,Currencyconverter,Links".split(",");
var buttons = "buttonGo,buttonGoS,buttonGoC,compareGo,drilGo".split(",")
var tableButtons = "buttonNext,buttonTable,buttonPrevious".split(",");
for (var i = 0; i < theMenu.length;i++)
	{rollovers[theMenu[i]] = new Image();rollovers[theMenu[i]].src = "Images/Navigation/topbar"+ theMenu[i] + ".gif"
	 rollovers[theMenu[i]+"R"] = new Image();rollovers[theMenu[i]+"R"].src = "Images/Navigation/topbar"+ theMenu[i] + "R.gif"
	}
for (var i = 0; i < mainMenu.length;i++)
	{rollovers[mainMenu[i]] = new Image();rollovers[mainMenu[i]].src = "Images/Navigation/nav"+ mainMenu[i] + ".gif"
	 rollovers[mainMenu[i]+"R"] = new Image();rollovers[mainMenu[i]+"R"].src = "Images/Navigation/nav"+ mainMenu[i] + "R.gif"
	}	
for (var i = 0; i < buttons.length;i++)
	{rollovers[buttons[i]] = new Image();rollovers[buttons[i]].src = "Images/Home/"+ buttons[i] + ".gif"
	 rollovers[buttons[i]+"R"] = new Image();rollovers[buttons[i]+"R"].src = "Images/Home/"+ buttons[i] + "R.gif"
	}
for (var i = 0; i < tableButtons.length;i++)
	{rollovers[tableButtons[i]] = new Image();rollovers[tableButtons[i]].src = "Images/searchDetail/"+ tableButtons[i] + ".gif"
	 rollovers[tableButtons[i]+"R"] = new Image();rollovers[tableButtons[i]+"R"].src = "Images/searchDetail/"+ tableButtons[i] + "R.gif"
	}
 rollovers["pubArchive"] = new Image();rollovers["pubArchive"].src = "Images/Publications/publicationsArchive.gif";
 rollovers["pubArchiveR"] = new Image();rollovers["pubArchiveR"].src = "Images/Publications/publicationsArchiveR.gif";
 rollovers["newsArchive"] = new Image();rollovers["newsArchive"].src = "Images/News/newsArchive.gif";
 rollovers["newsArchiveR"] = new Image();rollovers["newsArchiveR"].src = "Images/News/newsArchiveR.gif";
 rollovers["compareCostsGo"] = new Image();rollovers["compareCostsGo"].src = "Images/CompareCosts/compareCostsGo.gif";
 rollovers["compareCostsGoR"] = new Image();rollovers["compareCostsGoR"].src = "Images/CompareCosts/compareCostsGoR.gif";
 rollovers["drilMmBack"] = new Image();rollovers["drilMmBack"].src = "Images/Dril/drilMmBack.gif";
 rollovers["drilMmBackR"] = new Image();rollovers["drilMmBackR"].src = "Images/Dril/drilMmBackR.gif";
 rollovers["drilSearchGo"] = new Image();rollovers["drilSearchGo"].src = "Images/Dril/drilSearchGo.gif";
 rollovers["drilSearchGoR"] = new Image();rollovers["drilSearchGoR"].src = "Images/Dril/drilSearchGoR.gif";

function rollOver(elem,elemId)
{elem.src = rollovers[elemId + "R"].src;}
function rollOut(elem,elemId)
{elem.src = rollovers[elemId].src;}
function doOperator(n)
{window.location="operator.cfm?operatorIDX="+n.toString(10);}
function doCountry(n)
{if (n==0) return;
 window.location = "country.cfm?countryIDX="+n.toString(10)
}
function butRollOver(elem,n){if(n==0){elem.style.color="#ffffff";}else{elem.style.color="#05fbed";}}
function ScrollNews() {
window.setTimeout('ScrollNews()',ScrollSpeed);
var msg = document.getElementById("news1").value;
document.getElementById("news1").value = msg.substring(ScrollChars) + msg.substring(0,ScrollChars);
}
function _document_onclick(e)
{var event = e ? e : window.event;
 var target = e ? event.target : event.srcElement;
 document.forms.theData.action="compareCosts.cfm";
 switch(target.id)
 	{case "Home":
		window.location = "index.cfm";
		break;
	 case "buttonGo":
	 	var errMess = "";if(parseInt(document.getElementById("sCountry").options[document.getElementById("sCountry").selectedIndex].value,10) == 0){errMess += "You must select a Sending Country."}
		if(parseInt(document.getElementById("rCountry").options[document.getElementById("rCountry").selectedIndex].value,10) == 0){errMess += "\nYou must select a Destination Country."}
		if (errMess != ""){alert(errMess);return;}
		document.forms.theData.action = "searchResults.cfm";document.forms.theData.submit();
		break;
	 case "About":
	 	window.location = "aboutUs.cfm";
		break;
	 case "Register":
	 	window.location = "register.cfm"
		break;
	 case "Contact":
	 	window.location = "contactUs.cfm"
		break;
	 case "Disclaimer":
	 	window.location = "disclaimer.cfm"
		break;
	 case "FAQ":
	 	window.location = "faqS.cfm"
		break;
	 case "Links":
	 	window.location = "links.cfm"
		break;
	 case "SelectService":
	 	window.location = "services.cfm"
		break;
	 case "drilGo":
	 	window.location = "dril0.cfm"
		break;
	 case "drilMmBack":
	 	window.location = "dril0.cfm"
	 	break;
	 case "Currencyconverter":
	 	window.location = "currencyConverter.cfm"
		break;	 
	 case "Shopping":
	 	window.location = "mysteryShopping.cfm"
	 	break;
	 case "drilSearchGo":
	 	if(document.getElementById("searchString").value ==""){alert("You must enter some text to search for!");return;}
		window.location="drilResults.cfm?theMode=1&theString=" + escape(document.getElementById("searchString").value);
		break;
	 case "buttonR":
	 	document.forms.theData.action="register1.cfm";
	 	var errMess = "";var elem = document.forms.theData;var theICountry=new Array();var lCount = 0;
		if(elem.theName.value == ""){errMess += "You must enter your Name!\n";}
		if(elem.theMail.value == ""){errMess += "You must enter your EMail address!\n";}
		for(var i = 0;i < elem.theICountry.options.length;i++)
			{if(elem.theICountry.options[i].selected){theICountry[lCount] = elem.theICountry.options[i].value;lCount += 1;}}
		if (theICountry.length == 0){errMess += "You must select at least one country to receive information about!\n";}
		if (errMess != ""){alert(errMess);return;}
		elem.theICountries.value = theICountry.join(",");
		elem.submit();
		break;
	 case "buttonR1":
	 	document.forms.theData.action="contactUs1.cfm";
		var errMess = "";var elem = document.forms.theData;var theICountry=new Array();var lCount = 0;
		if(elem.theName.value == ""){errMess += "You must enter your Name!\n";}
		if(elem.theMail.value == ""){errMess += "You must enter your EMail address!\n";}
		if(elem.theQ.value == ""){errMess += "You must enter your question or comments!\n";}
		if(elem.toRegister.checked)
			{for(var i = 0;i < elem.theICountry.options.length;i++)
				{if(elem.theICountry.options[i].selected){theICountry[lCount] = elem.theICountry.options[i].value;lCount += 1;}}
			 if (theICountry.length == 0){errMess += "You must select at least one country to receive information about!\n";}else{elem.theICountries.value = theICountry.join(",");}
			}
		else {elem.theICountries.value = 0}
		if (errMess != ""){alert(errMess);return;}
		elem.submit();
		break;
	 case "buttonGoC":
	 	var errMess = "";var elem = document.forms.theData;
		if (elem.sCountry.selectedIndex == 0)errMess += "You must select a 'Sending Country'\n";
		if (elem.rCountry.selectedIndex == 0)errMess += "You must select a 'receiving Country'";
		if (errMess != ""){alert(errMess);return;}
		elem.action="compareCosts.cfm";elem.submit();
		break;
	 case "compareCostsGo":
	 	var errMess = "";var elem = document.forms.theData;
		if (elem.sCountry.selectedIndex == 0)errMess += "You must select a 'Sending Country'\n";
		if (elem.rCountry.selectedIndex == 0)errMess += "You must select a 'receiving Country'";
		if (errMess != ""){alert(errMess);return;}
		elem.action="compareCosts.cfm";elem.submit();
		break;
	 case "operator":
	 	var elem=document.forms.theData.sortIDX.value.toString(10);
		if(elem=="1"){document.forms.theData.sortDirection.value.toString(10)=="0" ? document.forms.theData.sortDirection.value=1 : document.forms.theData.sortDirection.value=0;}else {document.forms.theData.sortDirection.value=0;}
		document.forms.theData.sortIDX.value=1;document.forms.theData.submit();
		break;
	 case "Location":
	 	var elem=document.forms.theData.sortIDX.value.toString(10);
		if(elem=="2"){document.forms.theData.sortDirection.value.toString(10)=="0" ? document.forms.theData.sortDirection.value=1 : document.forms.theData.sortDirection.value=0;}else {document.forms.theData.sortDirection.value=0;}
		document.forms.theData.sortIDX.value=2;document.forms.theData.submit();
		break;
	 case "Fee":
	 	var elem=document.forms.theData.sortIDX.value.toString(10);
		if(elem=="3"){document.forms.theData.sortDirection.value.toString(10)=="0" ? document.forms.theData.sortDirection.value=1 : document.forms.theData.sortDirection.value=0;}else {document.forms.theData.sortDirection.value=0;}
		document.forms.theData.sortIDX.value=3;document.forms.theData.submit();
		break;
	 case "tCost":
	 	var elem=document.forms.theData.sortIDX.value.toString(10);
		if(elem=="4"){document.forms.theData.sortDirection.value.toString(10)=="0" ? document.forms.theData.sortDirection.value=1 : document.forms.theData.sortDirection.value=0;}else {document.forms.theData.sortDirection.value=0;}
		document.forms.theData.sortIDX.value=4;document.forms.theData.submit();
		break;
	 case "amntR":
	 	var elem=document.forms.theData.sortIDX.value.toString(10);
		if(elem=="5"){document.forms.theData.sortDirection.value.toString(10)=="0" ? document.forms.theData.sortDirection.value=1 : document.forms.theData.sortDirection.value=0;}else {document.forms.theData.sortDirection.value=1;}
		document.forms.theData.sortIDX.value=5;document.forms.theData.submit();
		break;
	 case "speed":
	 	var elem=document.forms.theData.sortIDX.value.toString(10);
		if(elem=="6"){document.forms.theData.sortDirection.value.toString(10)=="0" ? document.forms.theData.sortDirection.value=1 : document.forms.theData.sortDirection.value=0;}else {document.forms.theData.sortDirection.value=0;}
		document.forms.theData.sortIDX.value=6;document.forms.theData.submit();
		break;
	 case "Outlets":
	 	var elem=document.forms.theData.sortIDX.value.toString(10);
		if(elem=="7"){document.forms.theData.sortDirection.value.toString(10)=="0" ? document.forms.theData.sortDirection.value=1 : document.forms.theData.sortDirection.value=0;}else {document.forms.theData.sortDirection.value=0;}
		document.forms.theData.sortIDX.value=7;
		document.forms.theData.submit();
		break;
	 case "compareGo":
	 	var elem=document.getElementsByName("compare");var elem1 = new Array();
		for(var i = 0;i < elem.length;i++)
		{if (elem[i].checked){elem1[elem1.length]=elem[i].value;}}
		if (elem1.length != 2){alert("You must select 2 results to compare!");return;}
		document.forms.theData.theDealToCompare1.value = elem1[0];document.forms.theData.theDealToCompare2.value = elem1[1];document.forms.theData.action = "showComparison.cfm";
		document.forms.theData.submit();
		break;
	 case "buttonPrevious":
	 	var elem = document.forms.theData; var theADeals = elem.theDealList.value.split(",");var thisDeal = parseInt(elem.dealIDX.value,10);
		for(var i = 0; i < theADeals.length;i++)
			{if(parseInt(theADeals[i],10) == thisDeal) {break;}}
		i > 0 ? i -= 1 : i = i
		elem.dealIDX.value = theADeals[i];elem.action="singleResult.cfm";elem.submit();
		break;
	 case "buttonNext":
	 	var elem = document.forms.theData; var theADeals = elem.theDealList.value.split(",");var thisDeal = parseInt(elem.dealIDX.value,10);
		for(var i = 0; i < theADeals.length;i++)
			{if(parseInt(theADeals[i],10) == thisDeal) {break;}}
		i != (theADeals.length - 1) ? i += 1 : i = i
		elem.dealIDX.value = theADeals[i];elem.action="singleResult.cfm";elem.submit();
		break;
	 case "buttonTable":
	 	var elem = document.forms.theData;elem.action="compareCosts.cfm";elem.submit();
		break;
	 case "Publications":
	 	window.location="publications.cfm";
		break;
	 case "News":
	 	window.location="news.cfm";
		break;
	 case "pubArchive":
	 	var elem = document.forms.theData; parseInt(elem.theNumberOfResults.value,10)==0 ?elem.theNumberOfResults.value = 1:elem.theNumberOfResults.value = 0;
		elem.action = "publications.cfm";elem.submit();
		break;
	 case "newsArchive":
	 	var elem = document.forms.theData; parseInt(elem.theNumberOfResults.value,10)==0 ?elem.theNumberOfResults.value = 1:elem.theNumberOfResults.value = 0;
		elem.action = "news.cfm";elem.submit();
		break;
	}
	if(target.id.indexOf("deal_") != -1)
		{var elem=document.forms.theData;elem.dealIDX.value = target.id.split("_")[1];elem.action ="singleResult.cfm";elem.submit();}
	if(target.id.indexOf("k_") == 0)
		{window.location="drilResults.cfm?theMode=0&theString=" + escape(target.id.split("_")[1]);}
}

function doFilter(m)
{document.forms.theData.action="compareCosts.cfm";document.forms.theData.filterTypeIDX.value=m;document.forms.theData.sortIDX.value=1;document.forms.theData.sortDirection.value=0;document.forms.theData.submit();}
function doNewAmount(m){document.forms.theData.action="compareCosts.cfm";document.forms.theData.amount2send.value=m;document.forms.theData.sortIDX.value=5;document.forms.theData.sortDirection.value=1;document.forms.theData.filterTypeIDX.value=0;document.forms.theData.submit();}
function getDocument(m,n)
{if(n != 2){window.open("../../Images/Documents/"+m,"newWin")}else{window.open("http://"+m,"newWin")}}
function doLink(theL)
{switch(theL)
	{case "vanilla":
		theL1 = "http://www.vanillaactive.com";
		break;
	 case "dma":
		theL1 = "http://www.dmassocs.com";
		break;
	 case "dfid":
	 	theL1 = "http://www.dfid.gov.uk";
		break;
	}
 window.open(theL1,"newWin")
}
function doDrilLink(theL)
{
 if(theL.indexOf("http") != 0){theL = "http://"+theL;};
 window.open(theL,"newWin")}
function doLinkL(theL)
{if(theL.indexOf("http") != 0){theL = "http://"+theL;};
 window.open(theL,"newWin")
}
if (document.layers) document.captureEvents(Event.ONCLICK);
	document.onclick = _document_onclick;