/*

Javascript document to direct the user to a country from
from the country drop down.

*/

function submitCountrySelect() {
	var sel = document.getElementById('countrySelector');
	var sid = sel.selectedIndex;     
	if (sid < 1) { 
		alert ('Please select a Country.');
		return; 
	}  


	window.location.href=sel[sid].value;  
} 

/*

Javascript to tag the country list for webtrends

*/


function setWebTrends(){

	var Index = document.getElementById("countrySelector").selectedIndex;
	var url = document.getElementById("countrySelector").options[Index].value;
	var countryName=document.getElementById("countrySelector").options[Index].text;

	var splitUrl = url.split("http://");
	var dcsDcssip= splitUrl[1].split("/");
	var wtTi = countryName + " Country Selector Link";


		//countries with no DCS.dcsuri
		if(dcsDcssip.length==1){
			var dcsDcsuri = "/";
			
		} else {
			dcsDcssip[0]= "";
			
			for (var i=0;i<(dcsDcssip.length);i++){
				var dcsDcsuri = dcsDcssip.join("/");
			}
			dcsDcssip= splitUrl[1].split("/");
		}


/*

DCS.dcssip = Target site domain
DCS.dcsuri = Target site path
WT.ti = Title or Description of Link

*/

dcsMultiTrack('DCS.dcssip',dcsDcssip[0],'DCS.dcsuri',dcsDcsuri,'WT.ti',wtTi);
	

submitCountrySelect();

}