function openImageNews(vLink, vHeight, vWidth)
{
	var sLink = (typeof(vLink.href) == 'undefined') ? vLink : vLink.href;

	if (sLink == '')
	{
		return false;
	}

	winDef = 'status=no,resizable=no,scrollbars=no,toolbar=no,location=no,fullscreen=no,titlebar=yes,height='.concat(vHeight).concat(',').concat('width=').concat(vWidth).concat(',');
	winDef = winDef.concat('top=').concat((screen.height - vHeight)/2).concat(',');
	winDef = winDef.concat('left=').concat((screen.width - vWidth)/2);
	newwin = open('', '_blank', winDef);

	newwin.document.writeln('<title></title><body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">');
	newwin.document.write('<a href="" onClick="window.close(); return false;"><img border=0 src=');
	newwin.document.write(sLink);
	newwin.document.write(' width=');
	newwin.document.write(vWidth);
	newwin.document.write(' height=');
	newwin.document.write(vHeight);
	newwin.document.write('></a>');
	newwin.document.write('</body>');

	if (typeof(vLink.href) != 'undefined')
	{
		return false;
	}
}

function showLayer(obj,obj1,subInRight,delta)
{
	var x = new getObj(obj1);
	x.style.visibility = 'visible';
	setLyr(obj,obj1,subInRight,delta);
}

function showLayer1(obj)
{
	var x = new getObj(obj);
	x.style.visibility = 'visible';
}

function hideLayer(obj)
{
	var x = new getObj(obj);
	x.style.visibility = 'hidden';
}

function setLyr(obj,lyr,subInRight,delta)
{
	var newX = findPosX(obj);
	var newY = findPosY(obj);
	var x = new getObj(lyr);
	if (subInRight==true)
		newX = newX + delta;
	else
		newY = newY + delta;		
	x.style.top = newY + 'px';
	x.style.left = newX + 'px';
}

function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	var printstring = '';
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			printstring += ' element ' + obj.tagName + ' has ' + obj.offsetTop;
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	window.status = printstring;
	return curtop;
}


function getObj(name)
{
 if (document.getElementById)
 {
	   this.obj = document.getElementById(name);
	   this.style = document.getElementById(name).style;
 }
 else if (document.all)
 {
	   this.obj = document.all[name];
	   this.style = document.all[name].style;
 }
 else if (document.layers)
 {
	   if (document.layers[name])
	   {
	   	this.obj = document.layers[name];
	   	this.style = document.layers[name];
	   }
 }
}

function ItemMinimize(Prefix,Name) {
 if (Name<=10) {
  for(i=1;i<=10;i++) {
	var MItem=document.all(Prefix.concat(i));	
	if (MItem!=null) {
	    if (i==Name){
			if (MItem.style.display=='') {
				MItem.style.display='none';			
			}
			else {
				MItem.style.display='';			
			}
	}
	else {
		MItem.style.display='none';
	}
  }
  }
 }
 else {
	var MItem=document.all(Prefix.concat(Name));	 
	if (MItem!=null) {
	if (MItem.style.display=='') {
		MItem.style.display='none';			
	}
	else {
		MItem.style.display='';			
	}
	} 
 }
}
function showDialog(url, width, height)
{
	return showWindow(url, false, false, false, false, false, false, true, true, width, height, 0, 0);
}

function showWindow(url, isStatus, isResizeable, isScrollbars, isToolbar, isLocation, isFullscreen, isTitlebar, isCentered, width, height, top, left)
{
	if (isCentered)
	{
		top = (screen.height - height) / 2;
		left = (screen.width - width) / 2;
	}

	open(url, '_blank', 'status=' + (isStatus ? 'yes' : 'no') + ','
	+ 'resizable=' + (isResizeable ? 'yes' : 'no') + ','
	+ 'scrollbars=' + (isScrollbars ? 'yes' : 'no') + ','
	+ 'toolbar=' + (isToolbar ? 'yes' : 'no') + ','
	+ 'location=' + (isLocation ? 'yes' : 'no') + ','
	+ 'fullscreen=' + (isFullscreen ? 'yes' : 'no') + ','
	+ 'titlebar=' + (isTitlebar ? 'yes' : 'no') + ','
	+ 'height=' + height + ',' + 'width=' + width + ','
	+ 'top=' + top + ',' + 'left=' + left);
}
function displayInfo(info)
{
	if (info == 'weather')
		showDialog('http://www.tienphongonline.com.vn/transweb/thoitiet.htm', 500, 450);
	if (info == 'forex')
		showDialog('http://www.tienphongonline.com.vn/transweb/tygia.htm', 550, 450);
	if (info == 'gold')
		showDialog('http://www.tienphongonline.com.vn/transweb/giavang.htm', 450, 195);
	if (info == 'tvguide')
		showWindow('http://www.tienphongonline.com.vn/transweb/truyenhinh.htm', false, false, true, false, false, false, true, true, 450, 350, 0, 0);
	if (info == 'stock')
		showDialog('http://www.tienphongonline.com.vn/transweb/chungkhoan.htm', 770, 750);
		if (info == 'hastc')
		showDialog('http://www.hastc.org.vn/InfoShow/OnlineShareContinuous.aspx', 770, 750);
		if (info == 'film')
		showDialog('http://www.vtc.vn/pages/services/servicephim.aspx', 770, 750);
		if (info == 'tv')
		showDialog('http://www.tuoitre.com.vn/Tianyon/Index.aspx?ChannelID=385', 770, 750);
	if (info == 'relax')
		showDialog('http://diendan.songhongcorp.vn/forums/9/ShowForum.aspx', 770, 750);
}