﻿// JScript File
var PageHost = 'http://vnexpress.net';
var fDSp;

function Trim(iStr)
{
	while (iStr.charCodeAt(0) <= 32)
	{
		iStr=iStr.substr(1);
	}

	while (iStr.charCodeAt(iStr.length - 1) <= 32)
	{
		iStr=iStr.substr(0, iStr.length - 1);
	}

	return iStr;
}

        
function AddHeader(Name, Header, Buttons, Symbol, AddChildTable)
{
    document.writeln('<table width="100%" border=0 cellspacing=0 cellpadding=1 bgcolor="#1E5C99"><tr><td>');

    if (Header!='')
    {
        document.writeln('<table width="100%" border=0 cellspacing=0 cellpadding=0>');
        document.writeln('<tr>');

        if (typeof(Symbol)!='undefined')
        {
	        document.writeln('<td height=16 class=BoxHeader><img src="', Symbol, '" border=0></td>');
        }

        document.writeln('<td height=16 width="100%" align=left class=BoxHeader>&nbsp;', Header, '</td>');

        if ((Buttons & 1) && fDSp)
        {
	        document.write('<td width=15 align=right>');
	        document.write('<a href="JavaScript:ItemMinimize(\x27', Name, '\x27)">');
	        document.write('<img src="http://vnexpress.net/Images/min.gif" name="IDI_', Name, '" border=0 alt="Minimize | Maximize">');
	        document.write('</a></td>');
        }

        document.writeln('</tr></table>');
    }

    document.writeln('<table width="100%" border=0 cellspacing=0 cellpadding=0><tr><td id="IDM_', Name, '">');
    if (typeof(AddChildTable)=='undefined')
    {
        document.writeln('<table align=center width="100%" cellspacing=0 cellpadding=0 border=1>');
        LastChild = 1;
    }
    else
    {
        LastChild = 0;
    }
    return true;
}

function AddFooter()
{
    if (LastChild)
    {
        document.writeln('</table></td></tr></table></td></tr></table>');
    }
    else
    {
        document.writeln('</td></tr></table></td></tr></table>');
    }
}

// ngocta Fri, 03/11/2006 15:54:48
function SetFont()
{
	if (fBrw)
	{
		rs=window.showModalDialog('/SetFont.htm', '', 'dialogHeight:215px;dialogWidth:385px;status:no;help:no');
		if (typeof(rs)!='undefined')
		{
			if (rs)
			{
				location.reload(true);
			}
		}
	}
	else
	{
		open('/SetFont.htm', 'SetFont', 'toolbar=no,height=185,width=370,top='.concat((screen.height - 185)/2).concat(',left=').concat((screen.width - 370)/2));
	}
}

function setCookie(Name, Path, Expires, Value)
{
	var cstr = Name.concat('=').concat(Value);
	
	if (Path=='')
		path='/';

	cstr=cstr.concat(';path=').concat(Path);


	if (Expires=='')
		Expires=(new Date(2020, 11, 14)).toGMTString();

	document.cookie=cstr.concat(';expires=').concat(Expires);
}
