TimerIDCur = "";
function ShowCurrencyInfo(){
	var CurrencyInfo = getFrmObj('CurrencyInfo')
	OpenPanelCurrencyInfo()
	CurrencyInfo.innerHTML = "<table border=0 style='border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;' bgcolor='" + strPageBKColor + "' width=300 height=250><tr><td align=center valign=middle onmouseover='OpenPanelCurrencyInfo()' onmouseout='MouseOutPanelCur()'><img src='/w/images/29.gif' border=0></td></tr></table>"
	RoundCornerCur()
	httpRequest('GetCurrencyInfo.asp', DisplayCurrencyInfo, "data");
	
}

function RoundCornerCur(){
	if(!NiftyCheck()){
		return;
	}

	Rounded("div#CurrencyInfo","top","transparent",strPageBKColor,"border #C0C0C0");
	Rounded("div#CurrencyInfo","bottom","transparent",strPageBKColor,"border #C0C0C0");
}

function OpenPanelCurrencyInfo(stockid){
	clearTimeout(TimerIDCur);
	var StockDetails = getFrmObj('CurrencyInfo')
	StockDetails.style.visibility = "visible"
	StockDetails.style.zIndex = "300"
	StockDetails.style.height = "350"
	StockDetails.style.width = "305"
	var c = getAnchorPosition("AnCurrencyInfo");
	StockDetails.style.left = c.x + "px"
	//alert(getScrollYPosition())
	//alert(parseInt(c.y) + ", " + parseInt(c.y) + parseInt(20))
	StockDetails.style.top = (parseInt(c.y) + 20) + "px";
}

function DisplayCurrencyInfo(data){
	var StockDetails = getFrmObj('CurrencyInfo')
	StockDetails.innerHTML = "<table border=0 style='border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;' width=300 bgcolor='" + strPageBKColor + "' cellpadding=10><tr><td valign=top onmouseover='OpenPanelCurrencyInfo()' onmouseout='MouseOutPanelCur()'>" + data + "</td></tr></table>"
	RoundCornerCur()
}

function MouseOutPanelCur(){
	clearTimeout(TimerIDCur);
    	TimerIDCur = setTimeout('ClosePanelCur()', 1000)
}

function ClosePanelCur(){
	var StockDetails = getFrmObj('CurrencyInfo')
	StockDetails.style.visibility = "hidden"
	StockDetails.style.zIndex = "0"
	StockDetails.style.height = "0"
	StockDetails.style.width = "0"
	StockDetails.style.left = "-100px";
	StockDetails.style.top = "-100px";
}

function ChangeCurrency(){
	var UserCurrencyChoice = getFrmObj('UserCurrencyID')
	Set_Cookie( 'curSelectValue', UserCurrencyChoice.value, '360', '/', '', '' );
	window.location.reload()
}

function Set_Cookie( name, value, expires, path, domain, secure ){
	// set time, it's in milliseconds
	var today = new Date();
	today.setTime( today.getTime() );

	/*
	if the expires variable is set, make the correct 
	expires time, the current script below will set 
	it for x number of days, to make it for hours, 
	delete * 24, for minutes, delete * 60 * 24
	*/
	if ( expires ){
		expires = expires * 1000 * 60 * 60 * 24;
	}
	var expires_date = new Date( today.getTime() + (expires) );

	document.cookie = name + "=" +escape( value ) +
	( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
	( ( path ) ? ";path=" + path : "" ) + 
	( ( domain ) ? ";domain=" + domain : "" ) +
	( ( secure ) ? ";secure" : "" );
}

