function creatHTTPreq()
{
	var xmlhttp = false;
	//Check if we are using IE.
	try 
	{	xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); //If the Javascript version is greater than 5.	
	} 
	catch (e) 
	{	//If not, then use the older active x object.
		try 
		{	xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); //If we are using Internet Explorer.
		} 
		catch (E) 
		{	xmlhttp = false; //Else we must be using a non-IE browser.
		}
	} //If we are using a non-IE browser, create a javascript instance of the object.
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') 
	{	xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}
function hidediv(id) 
{
	if (document.getElementById) 
	{ // DOM3 = IE5, NS6
		if(document.getElementById(id))
			document.getElementById(id).style.visibility = 'hidden';
			document.getElementById(id).style.display = 'none';
	}
	else 
	{
		if (document.layers) 
		{ // Netscape 4
			if(document.id)
				document.id.visibility = 'hidden';
				document.id.display = 'none';
		}
		else 
		{ // IE 4
			if(document.all.id)
				document.all.id.style.visibility = 'hidden';
				document.all.id.style.display = 'none';
		}
	}
}

function showdiv(id) 
{
	//alert(screen.width);
	if (document.getElementById) 
	{ // DOM3 = IE5, NS6
		if(document.getElementById(id))
			document.getElementById(id).style.visibility = 'visible';
			document.getElementById(id).style.display = 'block';
	}
	else 
	{
		if (document.layers) 
		{ // Netscape 4
			if(document.id)
				document.id.visibility = 'visible';
				document.id.display = 'block';
		}
		else 
		{ // IE 4
			if(document.all.id)
				document.all.id.style.visibility = 'visible';
				document.all.id.style.display = 'block';
		}
	}
}
function mkhash( )
{
	var ret = new Object( );
	for (var i = 0; i < arguments.length; ++i )
	{
		ret[arguments[i][0]] = arguments[i][1];
	}
	return ret;
}
function formatCurrency(num) 
{	//alert(num);
num = num.toString().replace(/\$|\,/g,'');
if(isNaN(num))
num = "0";
sign = (num == (num = Math.abs(num)));
num = Math.floor(num*100+0.50000000001);
num = Math.floor(num/100).toString();
for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
num = num.substring(0,num.length-(4*i+3))+','+num.substring(num.length-(4*i+3));
return (((sign)?'':'-') + num);
}
