﻿// JScript File
function ShowDisplay(s)
{
	if(document.getElementById(s).style.display == "none")
	{
		document.getElementById(s).style.display = "block";			
	}
	else
	{
		document.getElementById(s).style.display = "none";
	}
}

function KeepStatusDataList()
{
	var vars = [], hash;
	var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
	for (var i = 0; i < hashes.length; i++)
	{
		hash = hashes[i].split('=');
		//vars.push(hash[0]);
		//vars[hash[0]] = hash[1];
	}
	var p = hashes[0].split('=');
	if(p[1] == "nsp" || p[1] == "ctsp")
	{
		var s = hashes[1].split('=');
		if(s[0] == "cid")
			document.getElementById('show'+s[1]).style.display = "block";
	}
}

function thunho(s,hqc,yqc,mt)
{    
    var h;
    var y;
    var t;
    
    eval("h = " + hqc +";");
    eval("y = " + yqc +";");
    eval("t  = " + mt + ";");
    if (h>50)
    {
        h = h - 10;
        y = y - 5;
        t = t + 5;
        
        eval(hqc + " = h" +";");        
        eval(yqc + " = y" + ";");
        eval(mt + " = t" + ";");    
        
        var height;   
        var py;    
        var pmt;
        height = h + "px";       
        py = y + "px";
        pmt = t + "px";    
        document.getElementById(s).style.height = height;
        document.getElementById(s).style.backgroundPositionY = py;
        //document.getElementById(s).style.marginTop = pmt;
        eval ("setTimeout(\"thunho('" + s + "', '" + hqc + "', '" + yqc + "', '" + mt + "')\",50);");        
    }
}

function phongto(s,hqc,yqc,mt)
{
    var h;
    var y;
    var t;
    
    eval("h = " + hqc +";");
    eval("y = " + yqc +";");
    eval("t  = " + mt + ";");
    if (h<150)
    {
        h = h + 10;
        y = y + 5;
        t = t - 5;
        
        eval(hqc + " = h" +";");        
        eval(yqc + " = y" + ";");
        eval(mt + " = t" + ";");    
        
        var height;   
        var py;    
        var pmt;
        height = h + "px";       
        py = y + "px";
        pmt = t + "px";    
        document.getElementById(s).style.height = height;
        document.getElementById(s).style.backgroundPositionY = py;
        //document.getElementById(s).style.marginTop = pmt;
        eval ("setTimeout(\"phongto('" + s + "', '" + hqc + "', '" + yqc + "', '" + mt + "')\",50);"); 
    }  
}
