	var elelen;
	var curstyles;
	if(document.all) {
		elelen = document.all.length;
		curstyles = new Array(elelen);
	}
	function fnSetTowns(src){
			defcountry = document.eventForm.country.value;
			setTimeout("tempfnSetTowns('"+src+"')",1); 
	}
	function tempfnSetTowns(src){
		gblSrc = src;
		var country = document.eventForm.country.value;
		var venue = document.eventForm.venue.value;
		var exhiName = document.getElementById("idTxtEditable_eventNameE").value;
		if (document.implementation && document.implementation.createDocument) {
			xmlDoc = document.implementation.createDocument("","",null);
			xmlDoc.load("../GetExhiTowns?country="+country+"&venueCode="+venue+"&src="+src+"&exhiName="+exhiName);
			xmlDoc.onload = setTowns;
		}
		else if (window.ActiveXObject) {
				xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
				xmlDoc.onreadystatechange = function(){
					if(xmlDoc.readyState == 4)setTowns();
				}
				xmlDoc.load("GetExhiTowns?country="+country+"&venueCode="+venue+"&src="+src+"&exhiName="+exhiName);
		} else {
				alert(jsBrowserRSValidation);
		}
	}
	function setTowns() {
		fnRemoveExhiTownValues();
		var x = xmlDoc.getElementsByTagName('exhiTown');
		for(i=0;i<x.length;i++){
			var objOption = document.createElement("option");
			objOption.value=x[i].childNodes[0].firstChild.nodeValue;
			objOption.text=x[i].childNodes[1].firstChild.nodeValue;
			try {
				document.eventForm.location.add(objOption);
			} catch( e ) {
				document.eventForm.location.add(objOption,null);
			}	
		}
		
		if(gblSrc == 'v')
		{
			alert(gblSrc);
			fnSetCountry(gblSrc)
			fnSetTown(gblSrc);
			fnSetVenues();
		}
		if(gblSrc == 'e')
		{
			fnSetTown(gblSrc);
		}
	}
		<!--Function to remove the values from the town select box-->
	function fnRemoveExhiTownValues(){
		while (document.eventForm.location.length>1){
			document.eventForm.location.remove(1);
		}
	}
function fnSetCountry(src)
{
			var x = xmlDoc.getElementsByTagName('selectedCountry');
			var venue = document.eventForm.venue.value;
			if(venue != "")
			{
				if(x.length > 0)
				{
				document.getElementById('country').value=x[0].firstChild.nodeValue;
				}
				else
				{
				document.getElementById('country').value="";
				}
			}	
			else
			{
				document.getElementById('country').value="";
			}
			
}
function fnSetTown(src)
{
			var x = xmlDoc.getElementsByTagName('selectedTown');
			var venue = document.eventForm.venue.value;
			if((venue != "" && src == "v") || (src == "e"))
			{
				if(x.length >0)
				{
					document.getElementById('idSltTowns').value=x[0].firstChild.nodeValue;
				}
				else
				{
					document.getElementById('idSltTowns').value="";
				}
			}	
			fnSetExhiVenue(src);
}
function fnSetExhiVenue(src)
{
			if(src == 'e')
			{
				var x = xmlDoc.getElementsByTagName('selectedVenue');
				if(x.length >0)
				{
					document.getElementById('idVenue').value=x[0].firstChild.nodeValue;
				}
				else
				{
					document.getElementById('idVenue').value="";
				}
			}
			if(src == "c" || src == "e" || src == "v")
			stopProcessingCursor();
}