
//document.write ("<iframe id='loaddata' name='loaddata' src='' border=1 width='0' height='0'></iframe>");
document.write ("<iframe id='Specials_City' name='Specials_City' src='' border=0 width='0' height='0'></iframe>");
document.write ("<iframe id='Specials_Country' name='Specials_Country' src='' border=0 width='0' height='0'></iframe>");
function loaddropdown(search_val, dest, loadtype)
{
        if (search_val != "" )
        {
		document.spsearch.elements["City_ID"].length = 1;
		document.spsearch.elements["City_ID"][0].selected = true;
		document.spsearch.elements["Slct_City_ID"].value = 0;
		if (dest == "Country_ID") {
			document.spsearch.elements["Country_ID"].length = 1;
			document.spsearch.elements["Country_ID"][0].selected = true;
			document.spsearch.elements["Slct_Country_ID"].value = 0;
		}

                tvlloader("http://www3.travel.com.au/everest/index.cgi?E=sloader&loadtype=" + loadtype +"&formname=spsearch&elementname=" + dest + "&search_val=" + search_val,loadtype);
        }
        else 
        {
                window.alert("Please select a specific destination from the dropdown list.");
                document.spsearch.elements[dest].length = 1;
		document.spsearch.elements["City_ID"].length = 1;
		document.spsearch.elements["Slct_City_ID"].value = 0;
        }
}
function tvlloader(url,loaddata)
{
        var element = (document.all)
                ? document.all[loaddata]
                : document.getElementById(loaddata);
        element.src = url;
}
function tvlpopulate (frm, arr, ele)
{
	arr.sort();
        frm.elements[ele].length = 1;
        for (var i = 0; i < arr.length; i++)
        {
                frm.elements[ele][frm.elements[ele].length] = new Option (arr[i][0], arr[i][1]);
        }
		var slct = parseFloat(frm.elements[('Slct_' + ele)].value);
	if (slct > 0)
		frm.elements[ele][slct].selected = true;
}

if (document.spsearch.Region_ID && (document.spsearch.Region_ID[document.spsearch.Region_ID.selectedIndex].value != "" ))
{

loaddropdown(document.spsearch.Region_ID.options[document.spsearch.Region_ID.selectedIndex].value,'Country_ID','Specials_Country');

var slct1 = parseFloat(document.spsearch.Slct_Country_ID.value);
if (slct1 > 0)
	document.spsearch.Country_ID[slct1].selected = true;
}


if (document.spsearch.Country_ID && (document.spsearch.Country_ID[document.spsearch.Country_ID.selectedIndex].value != "" ))
{

loaddropdown(document.spsearch.Country_ID.options[document.spsearch.Country_ID.selectedIndex].value,'City_ID','Specials_City');

var slct2 = parseFloat(document.spsearch.Slct_City_ID.value);
if (slct2 > 0)
	document.spsearch.City_ID[slct2].selected = true;
}


