﻿if (self != top) {
top.location.href = self.location.href
}

// tu dong logout
startday = new Date();

clockStart = startday.getTime() + 600000;

function initStopwatch() { 
    var myTime = new Date(); 
    return((clockStart - myTime.getTime())/1000); 
}
function getSecs(urlpath) 
   { 
    var tSecs = Math.round(initStopwatch()); 
    var iSecs = tSecs % 60;
    var iMins = Math.round((tSecs-30)/60);   
    var sSecs ="" + ((iSecs > 9) ? iSecs : "0" + iSecs);
    var sMins ="" + ((iMins > 9) ? iMins : "0" + iMins);
    window.status = "Chương trình sẽ tự thoát trong : " + sMins+":"+sSecs +" phút.";
    window.setTimeout('getSecs(\'' + urlpath + '\')',1000);
    if(iSecs<=0 && iMins==1){
	    if(confirm("Có thể bạn không muốn thao tác trong hệ thống nữa.\nVì lý do bảo mật, chương trình sẽ tự thoát trong " + sMins+":"+sSecs + " phút. Bạn có muốn tiếp tục không?")){
		    window.location.reload(true);	
	    }else{
		    window.location.href = urlpath;
	    }
    }
}

    
   
  
function toggle(id)
{
	el = document.getElementById(id);
	
	if (el.style.display == 'none')
	{el.style.display = '';}
	else
	{el.style.display = 'none';}
}


// Begin Fix PNG for IE6
var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])

function fixPNG(myImage) 
{


    if ((version >= 5.5) && (version < 7) && (document.body.filters)) 
    {
       var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""
	   var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""
	   var imgTitle = (myImage.title) ? 
		             "title='" + myImage.title  + "' " : "title='" + myImage.alt + "' "
	   var imgStyle = "display:inline-block;" + myImage.style.cssText
	   var strNewHTML = "<span " + imgID + imgClass + imgTitle
                  + " style=\"" + "width:" + myImage.width 
                  + "px; height:" + myImage.height 
                  + "px;" + imgStyle + ";"
                  + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
                  + "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>"
	   myImage.outerHTML = strNewHTML	  
    }


}

// End Fix PNG for IE6
