function sh()
{
	var h=document.getElementById("fheight");
	h=parseInt(h.innerHTML);
	if(window.parent.document.getElementById('rhs'))window.parent.document.getElementById('rhs').style.height=h;
}
function op(u,h,w)
{	
	var w=window.open(u,'','scrollbars=yes,width='+w+',height='+h+',resizable=yes');
	w.focus();
}
function otp(t)
{
	if(window.parent.document.getElementById('rhs'))window.parent.document.getElementById('rhs').style.height=0;		
	top.body.main.document.location = 'TradingPostMain.aspx?mode='+t;	
}
function of(t)
{
	if(window.parent.document.getElementById('rhs'))window.parent.document.getElementById('rhs').style.height=0;		
	top.body.main.document.location = 'TradingPostMain.aspx?F=true&mode='+t;	
}
function om(t)
{	
	if(window.parent.document.getElementById('rhs'))window.parent.document.getElementById('rhs').style.height=0;		
	openmain(t);	
	var m = window.parent.document.getElementById('page_mode').innerHTML;
	var w = gw(m);
	var pa = window.parent.document.getElementById('Prices');
	var a = window.parent.document.getElementById('lblTogglePrices');
	var b = window.parent.document.getElementById('lblToggleHeader');
	var im = window.parent.document.getElementById('imgDropDown');
	var date = new Date();
	if(m=='hom')
	{
		b.innerHTML = 'Show Current Minor Metals Prices';
		b.title = 'Click to show current minor metals prices';
		a.innerHTML = 'Show';
		a.title = 'Click to show current minor metals prices';
	}
	else
	{	
		b.innerHTML = 'Show Current '+ w +' prices';
		b.title = 'Click to show current '+ w +' prices';
		a.innerHTML = 'Show';
		a.title = 'Click to show current '+ w +' prices';		
	}
	im.src = 'img/DDsm.png';
	pa.style.display ='none';
	date.setTime(date.getTime()+(365*24*60*60*1000));
	var datestring = date.toGMTString();
	document.cookie = 'mm_prc=false; expires='+date+'; path=/';
}

function openmain(t)
{
	top.body.main.document.location = t;	
}

function gw(t)
{
	var Ms = new Array(
			      'hom',
			      'sb',
			      'bi',
			      'cd',
			      'co',
			      'cr',
			      'ga',
			      'ge',
			      'in',
			      'mg',
			      'mn',
			      'hg',
			      'mo',
			      're',
			      'se',
			      'si',
			      'ti',
			      'w',
			      'v'
				);
	var Ws = new Array(
			      'Minor Metas',
			      'Antimony',
			      'Bismuth',
			      'Cadmium',
			      'Cobalt',
			      'Chrome',
			      'Gallium',
			      'Germanium',
			      'Indium',
			      'Magnesium',
			      'Manganese',
			      'Mercury',
			      'Molybdenum',
			      'Rhenium',
			      'Selenium',
			      'Silicon',
			      'Titanium',
			      'Tungsten',
			      'Vanadium'
				);
	for(var i=0;i<19;i++)
	{
		if (t==Ms[i])
		{
			return(Ws[i]);
		}
	}
	return '***';
}
