//InStr finds the first occurance of a string in a string
//this function is still very beta {not finished}
function inStr(strSearch, strSearchFor)
{
	var csf_len = strSearchFor.length;
	var cs_len = strSearch.length;
	var InStrStep = 0;
	
	//0 is first character;
	for (InStrStep=0; InStrStep < cs_len; InStrStep++)
	{
		//alert(cs_len+'&lt;='+(InStrStep+csf_len));
		if (strSearchFor == strSearch.substring(InStrStep,InStrStep+csf_len))
		{
			return InStrStep;
		}
	}
	return -1;
}

function youarehere()
{
	var sitestr = window.location.href;
	var menuobjref = '';
	
	if (inStr(sitestr.toLowerCase(), 'support.html') > 0)
	{
		//set the selected on menu (same as hover)
		menuobjref = document.getElementById('support_menu');
	}
	else if (inStr(sitestr.toLowerCase(), 'shoppingcart.asp') > 0)
	{
		//set the selected on menu (same as hover)
		menuobjref = document.getElementById('shoppingcart_menu');
	}
	else if (inStr(sitestr.toLowerCase(), 'myaccount.asp') > 0 | inStr(sitestr.toLowerCase(), 'login.asp') > 0)
	{
		//set the selected on menu (same as hover)
		menuobjref = document.getElementById('accountorder_menu');
	}
	else if (inStr(sitestr.toLowerCase(), 'help.asp') > 0)
	{
		//set the selected on menu (same as hover)
		menuobjref = document.getElementById('help_menu');
	}
	else if (inStr(sitestr.toLowerCase(), 'contact.html') > 0)
	{
		//set the selected on menu (same as hover)
		menuobjref = document.getElementById('contact_menu');
	}
	else //home
	{
		menuobjref = document.getElementById('home_menu');
	}
	
	menuobjref.className="current";
	menuobjref.parentNode.className="current";
	menuobjref.parentNode.parentNode.className="current";
}
youarehere();
