function ConfirmNavigate(message,url)
{
	if (confirm(message))
	{
		document.location = url;
	}
}

function filterComboByText(comboid,textid)
{
	var text=document.getElementById(textid).value.toUpperCase();
	var combo_element=document.getElementById(comboid);
	var combo_length=combo_element.length;
	var i;
	for (i=0;i<combo_length;i++)
	{
		var el=combo_element.options[i].text.toUpperCase();
		//alert(el);
		if(el.indexOf(text)==-1)
		{
			combo_element.options[i].disabled="disabled";
		}
	}
}

function GetXmlHttpObject()
{
	if (window.XMLHttpRequest)
  	{
  		// code for IE7+, Firefox, Chrome, Opera, Safari
  		return new XMLHttpRequest();
  	}
	if (window.ActiveXObject)
  	{
  		// code for IE6, IE5
  		return new ActiveXObject("Microsoft.XMLHTTP");
  	}
	return null;
}

function PopUpWindow(wname,url,params) 
{
	var newwindow=window.open(url,wname,params);
	if (window.focus) newwindow.focus();
	return false;
}

function ToggleHidden(id)
{
	if(document.getElementById(id).style.display=='none')
		document.getElementById(id).style.display='block';
	else		
		document.getElementById(id).style.display='none';
}

function SetResolutionCookie()
{
	var today = new Date();
	var the_date = new Date("December 31, 2099");
	var the_cookie_date = the_date.toGMTString();
	var the_cookie = "screen_resolution="+ screen.width +"x"+ screen.height;
	var the_cookie = the_cookie + ";expires=" + the_cookie_date;
	document.cookie=the_cookie;	
}

