// Generates correct url for transfer
function GoToNextPage(sFile) {
	var MyDDL = MM_findObj("ddlstStates");
	//alert("Selected State: " + MyDDL.options[MyDDL.selectedIndex].value);
	var MySelectedState = MyDDL.options[MyDDL.selectedIndex].value;
	var MyState;
	if (MySelectedState == undefined)
		MyState = "ST=ZZ";
	else
		MyState = "ST=" + MySelectedState;
		location.href = sFile + "?" + MyState;
}

function GotoPageHighDWS(sFile) {
	var theDDL = MM_findObj("ddlStatesHighDWS");
	//alert("Selected State: " + theDDL.options[theDDL.selectedIndex].value);
	var theSelectedState = theDDL.options[theDDL.selectedIndex].value;
	var theState;
	if (theSelectedState == undefined)
		theState = "STdws=ZZ";
	else
		theState = "STdws=" + theSelectedState;
		location.href = sFile + theSelectedState + ".aspx?" + theState;
}


// Gets the Value of a Key passed via url
function GetQueryVariable(theVar) {
	var query = window.location.search.substring(1);
	var vars = query.split("&");
	for (var i=0;i<vars.length;i++) {
		var pair = vars[i].split("=");
		if (pair[0] == theVar) {
			//alert("pair[1]=" + pair[1]);
			if (pair[1] == undefined)
				return "ZZ";
			else
				return pair[1];
		}
	} 
	//alert('Query Variable ' + theVar + ' not found');
}


