
// ####### BEGIN get and split URL parameters #######
var args = new Array();
allargs = document.URL.split("?");
if(allargs[1])
{
	arg_pairs = allargs[1].split("&");

	for(var lupe=0; lupe<arg_pairs.length; lupe++)
	{
		tmp=arg_pairs[lupe].split("=");
	eval("args[\""+tmp[0]+"\"]=\""+tmp[1]+"\";");
	}
}
// ####### END get and split URL parameters #######

function jumpTo(optionObj)
{
	window.location.href = optionObj.options[optionObj.selectedIndex].value;
}

var scheme;

function startApp()
{

	if (args["scheme"])
	{
		scheme = unescape(args["scheme"]);
	}
	else
	{
		scheme = document.forms.le_front_form.scheme.value;	// COMMENT: this has to be in startapp because the form doesn't exist before the load is finished
	}

	if (scheme)
	{
		switchColor(scheme);
	}
	else
	{
		switchColor('amenities');
	}

}

function submitForm(address)
{
	document.forms.le_front_form.address.value = address;
 	document.forms.le_front_form.submit();
}

function switchColor(whichScheme)
{

	document.getElementById('tab_purple').className = "unselected";
	document.getElementById('tab_green').className = "unselected";
	document.getElementById('tab_blue').className = "unselected";
	document.getElementById('tab_red').className = "unselected";

	document.forms.le_front_form.scheme.value = whichScheme;

	switch(whichScheme)
	{

		case "amenities":
			document.getElementById('tab_purple').className = "selected";
			document.getElementById('le_front_goBtn').src='/wp-srv/local-explorer/images/le_front_go_purple.gif';
			document.getElementById('le_front_form').style.backgroundImage = "url(/wp-srv/local-explorer/images/le_front_searchPurple.gif)";
			document.getElementById('le_front_explanation').innerHTML = '<div class="test1"><img src="/wp-srv/local-explorer/images/le_front_pinPurple.gif" alt="" width="24" height="31" border="0" style="float:left;margin-right:6px;margin-bottom:12px;" /><h5>Explore Washington-area Communities</h5><p>Grocery and drug stores, restaurants, bars, hospitals and more, plus:</p><ul><li>Facts &amp; Figures</li><li>Local News from The Post</li><li>Community Resources</li><li>Classifieds</li></ul></div>';
			break;
		case "sales":
			document.getElementById('tab_green').className = "selected";
			document.getElementById('le_front_goBtn').src='/wp-srv/local-explorer/images/le_front_go_green.gif';
			document.getElementById('le_front_form').style.backgroundImage = "url(/wp-srv/local-explorer/images/le_front_searchGreen.gif)";
			document.getElementById('le_front_explanation').innerHTML = '<div class="test3"><img src="/wp-srv/local-explorer/images/le_front_pinGreen.gif" alt="" width="24" height="31" border="0" style="float:left;margin-right:6px;margin-bottom:12px;" /><h5>Track the Area\'s Housing Market</h5><p>Recent residential home sales, prices, sale dates and more, plus:</p><ul><li>Facts &amp; Figures</li><li>Local News from The Post</li><li>Community Resources</li><li>Classifieds</li></ul></div>';
			break;
		case "schools":
			document.getElementById('tab_blue').className = "selected";
			document.getElementById('le_front_goBtn').src='/wp-srv/local-explorer/images/le_front_go_blue.gif';
			document.getElementById('le_front_form').style.backgroundImage = "url(/wp-srv/local-explorer/images/le_front_searchBlue.gif)";
			document.getElementById('le_front_explanation').innerHTML = '<div class="test2"><img src="/wp-srv/local-explorer/images/le_front_pinBlue.gif" alt="" width="24" height="31" border="0" style="float:left;margin-right:6px;margin-bottom:12px;" /><h5>Research Schools in Your Community</h5><p>Nearby public and private schools, enrollment, scores and more, plus:</p><ul><li>Facts &amp; Figures</li><li>Local News from The Post</li><li>Community Resources</li><li>Classifieds</li></ul></div>';
			break;
		case "crime":
			document.getElementById('tab_red').className = "selected";
			document.getElementById('le_front_goBtn').src='/wp-srv/local-explorer/images/le_front_go_red.gif';
			document.getElementById('le_front_form').style.backgroundImage = "url(/wp-srv/local-explorer/images/le_front_searchRed.gif)";
			document.getElementById('le_front_explanation').innerHTML = '<div class="test4"><img src="/wp-srv/local-explorer/images/le_front_pinRed.gif" alt="" width="24" height="31" border="0" style="float:left;margin-right:6px;margin-bottom:12px;" /><h5>Keep Watch on Area Crime</h5><p>Research crime incidents in your community and beyond, plus:</p><ul><li>Facts &amp; Figures</li><li>Local News from The Post</li><li>Community Resources</li><li>Classifieds</li></ul></div>';
			break;

	}
}