<!--
function searchRegions(sID){//select region
	var curr_town;
	var region_variables = new String('');
	for (var i=0; i < document.info.regions.length; i++){
		if (document.info.regions[i].value == sID){
			document.info.regions[i].selected='true';
			//load the towns
			populateTown(document.info.regions);
			break;
		} else {
				
			curr_town = document.info.regions[i].value;
			region_variables = new String(eval(curr_town));
				
			if (region_variables.indexOf(sID) != -1){
				document.info.regions[i].selected='true';
				//load the towns
				populateTown(document.info.regions);
				selectTown(sID);
				updateRegion()
			}
					
		}
	}
}

function populateTown(object){
	document.info.region.value = object.options[object.selectedIndex].value;
	var strTown = new String(eval(object[object.selectedIndex].value));
	var id;
	var name;
	var myNewOption;
	var x=0;

	if (object.selectedIndex == 0){
		disableselect = 0;
		document.info.town.options.length=1;
		document.info.town.disabled =true;
		document.info.town.options[0] = new Option( "Please select region first" );
	} else {
		document.info.town.disabled =false;
		while(strTown!='')
		{
			id = strTown.substr(0,strTown.indexOf("|",0))
			strTown = strTown.substr(strTown.indexOf("|",0)+1);
			name = strTown.substr(0,strTown.indexOf("|",0))
			strTown = strTown.substr(strTown.indexOf("|",0)+1);
			
			myNewOption = new Option(name,id);
			document.info.town.options.length = x+1;
			document.info.town.options[x] = myNewOption;
			
			x = x + 1;

		}
	}
	document.info.town.options[0].selected = true;
}


function selectTown(tID){//select town
	for (var i=0; i < document.info.town.length; i++){
		if (document.info.town[i].value == tID){
			document.info.town[i].selected='true';
			break;
		} 
	}
}

function updateRegion(){
	document.info.region.value = document.info.town[document.info.town.selectedIndex].value;
}

function doCourseSearch(eSrc)	{
	var urlLocation = eSrc;
	var eRegions = document.info.regions[document.info.regions.selectedIndex].value;
	var eTown = document.info.town[document.info.town.selectedIndex].value;
	if (eRegions != '')	{
		urlLocation = urlLocation + "&amp;regions=" + eRegions;
	}
	if (eTown != '')	{
		urlLocation = urlLocation + "&amp;town=" + eTown;
		urlLocation = urlLocation + "&amp;region=" + eTown;
	}
	location.href = urlLocation;
}
		
function submitPost16(workbased){
if(workbased!='true'){
	var oSelect = document.info.qual_31;
	var x = 0;
	while(oSelect.options.length-1 >= x){
		if(oSelect.options[x].value != '')
			oSelect.options[x].selected = true;
		else
			oSelect.options[x].selected = false;
		x++;
		}
	oSelect = document.info.qual_35;
	x = 0;
	while(oSelect.options.length-1 >= x){
		if(oSelect.options[x].value != '')
			oSelect.options[x].selected = true;
		else
			oSelect.options[x].selected = false;
		x++;
		}
	oSelect = document.info.qual_32;
	x = 0;
	while(oSelect.options.length-1 >= x){
		if(oSelect.options[x].value != '')
			oSelect.options[x].selected = true;
		else
			oSelect.options[x].selected = false;
		x++;
		}
	oSelect = document.info.qual_1004;
	x = 0;
	while(oSelect.options.length-1 >= x){
		if(oSelect.options[x].value != '')
			oSelect.options[x].selected = true;
		else
			oSelect.options[x].selected = false;
		x++;
		}
}else if(workbased=='true'){
	oSelect = document.info.lcdsl_3;
	x = 0;
	while(oSelect.options.length-1 >= x){
		if(oSelect.options[x].value != '')
			oSelect.options[x].selected = true;
		else
			oSelect.options[x].selected = false;
		x++;
		}
}
document.info.submit();
}
		
function RemoveItem(selFrom){
var selectedItem = eval('document.info.'+ selFrom).selectedIndex;
var oSelectFrom;
var x;
if (selectedItem != -1)	{
	oSelectFrom = eval('document.info.'+ selFrom);
	if (oSelectFrom.options[selectedItem].value != ''){
		x = selectedItem;
		while(oSelectFrom.options.length-1 > x){
			oSelectFrom.options[x].value = oSelectFrom.options[x+1].value;
			oSelectFrom.options[x].text = oSelectFrom.options[x+1].text;
			x++;
		}
		oSelectFrom.options.length = oSelectFrom.options.length -1;
		}
	}	
}
		
function MoveItem(selFrom, selTo)	{
var selectedItem = eval('document.info.'+ selFrom).selectedIndex;
var oSelectFrom;
var oSelectTo;
var x;
var added = false;
//If there is something selected in the list box
//1. Get the Option object
//2. Remove it from the from box and add it to the new one
if (selectedItem != -1)	{
	oSelectFrom = eval('document.info.'+ selFrom);
	if (oSelectFrom.options[selectedItem].value != ''){	
		oSelectTo = eval('document.info.'+ selTo);
		x = 0;
		while((oSelectTo.options.length > x)&&(!added)){
			if(oSelectFrom.options[selectedItem].value == oSelectTo.options[x].value){
				added = true;
			}
			x ++;
		}
		if(!added){
			myNewOption = new Option(oSelectFrom.options[selectedItem].value,oSelectFrom.options[selectedItem].value);
			x = oSelectTo.options.length;
			oSelectTo.options.length = x+1;
			oSelectTo.options[x].value =  oSelectTo.options[x-1].value
			oSelectTo.options[x].text =  oSelectTo.options[x-1].text
			oSelectTo.options[x-1] = myNewOption;
		}
	}
}
}

function changeLocation(){
	if(locationChange.value=='provider'){
		getNewObject('provider')
	}else{	
		document.location = locationChange.value;
	}
}		
		
function popup(URL){
	window.open(URL,'image','scrollbars=yes,width=620,height=500,toolbar=no,personalbar=no,location=no,directories=no,statusbar=no,menubar=no,status=no,resizable=no,left=60,screenX=60,top=30,screenY=30');
	window.name="main";
}
function searchpop(URL){
	window.open(URL,'sms_call_popup','scrollbars=yes,width=450,height=400,toolbar=no,personalbar=no,location=no,directories=no,statusbar=no,menubar=no,status=no,resizable=yes,left=60,screenX=60,top=30,screenY=30');
	window.name="main";
}
function menupop(URL){
	window.open(URL,'sms_call_popup','scrollbars=yes,width=450,height=400,toolbar=no,personalbar=no,location=no,directories=no,statusbar=no,menubar=yes,status=no,resizable=yes,left=60,screenX=60,top=30,screenY=30');
	window.name="main";
}
function newWindow(sURL, iWidth, iHeight){
	window.open(sURL, '_blank','scrollbars=yes,width='+iWidth+',height='+iHeight+',toolbar=no,personalbar=no,location=no,directories=no,statusbar=no,menubar=no,status=no,resizable=yes,left=60,screenX=60,top=30,screenY=30')
}
function writeCookie(name, value){
	//check for overwrite?
	document.cookie = name + "=" + value + ";";
}

//-->
