var data="019876543210";
//bang 0 neu khong giai ma, bang 1 neu giai ma
var done=1;
var text="..:: Chào mừng quý khách đến với GOLICT ::.."
 function statusIn()
{
	decrypt(text,2,1);
}
function statusOut()
{
 self.status='';
 done=1;
}

 function decrypt(text, max, delay)
{
	 if (done)
	{
		done = 0;
		decrypt_helper(text, max, delay,  0, max);
	}
}
 function decrypt_helper(text, runs_left, delay, charvar, max)
{
	if (!done){
	runs_left = runs_left - 1;
	var status = text.substring(0,charvar);
	for(var current_char = charvar; current_char < text.length; current_char++)
	{
		status += data.charAt(Math.round(Math.random()*data.length));
    }
	window.status = status;
	var rerun = "decrypt_helper('" + text + "'," + runs_left + "," + delay + "," + charvar + "," + max + ");"
	var new_char = charvar + 1;
	var next_char = "decrypt_helper('" + text + "'," + max + "," + delay + "," + new_char + "," + max + ");"
	if(runs_left > 0)
	{
		setTimeout(rerun, delay);
	}
	else
	{
		if (charvar < text.length)
	   {
		setTimeout(next_char, Math.round(delay*(charvar+3)/(charvar+1)));
	   }
		else
	   {
		done = 1;
       }
	}
  }
}

function GetCounter(str)
{
var begin = "<img src=\"images/dg";
var middle = ".gif\" width=\"16\" height=\"21\" alt=\"";
var last = "\">";
    for(x = 0;x < str.length; x++) 
   {
    str1 = str.charAt(x);
    document.write(begin + str1 + middle + last)
   }
}



var dom = (document.getElementById) ? true : false;
var ns5 = ((navigator.userAgent.indexOf("Gecko")>-1) && dom) ? true: false;
var ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;
var ns4 = (document.layers && !dom) ? true : false;
var ie4 = (document.all && !dom) ? true : false;
var nodyn = (!ns5 && !ns4 && !ie4 && !ie5) ? true : false;

var origWidth, origHeight;
if (ns4) {
	origWidth = window.innerWidth; origHeight = window.innerHeight;
	window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
}

if (nodyn) { event = "nope" }

var tipFollowMouse= true;	
var tipWidth= 120;
var offX= 20;
var offY= 20; 
var tipFontFamily= "Verdana, arial, helvetica, sans-serif";
var tipFontSize= "8pt";
var tipFontColor= "#000000";
var tipBgColor= "#DDECFF"; 
var tipBorderColor= "#4791C5";
var tipBorderWidth= 5;
var tipBorderStyle= "solid";
var tipPadding= 0;

var startStr = '<table width="' + tipWidth + '" cellpadding=0 cellspacing=0>';
var startnewrow='<tr style="color:black; text-decoration:none; font-weight:bold ; font-size:12px"><td bgcolor="#F6F5F6" height="20">&nbsp;&nbsp;&nbsp;';
var endnewrow='</td></tr>';

var starttextnewrow='<tr style="color:black; text-decoration:none;font-size:12px"><td bgcolor="#F6F5F6" height="20">&nbsp;&nbsp;&nbsp;';
var endtextnewrow='</td></tr>';

var rowStr='<tr><td align="center" width="100%"><img  align=middle src="';
var midStr = '" border="0"></td></tr><tr><td valign="top" align="center">';
var endStr = '</td></tr></table>';

var tooltip, tipcss;
function initTip() {
	if (nodyn) return;
	tooltip = (ns4)? document.tipDiv.document: (ie4)? document.all['tipDiv']: (ie5||ns5)? document.getElementById('tipDiv'): null;
	tipcss = (ns4)? document.tipDiv: tooltip.style;
	if (ie4||ie5||ns5) {	
		tipcss.width = tipWidth+"px";
		tipcss.fontFamily = tipFontFamily;
		tipcss.fontSize = tipFontSize;
		tipcss.color = tipFontColor;
		tipcss.backgroundColor = tipBgColor;
		tipcss.borderColor = tipBorderColor;
		tipcss.borderWidth = tipBorderWidth+"px";
		tipcss.padding = tipPadding+"px";
		tipcss.borderStyle = tipBorderStyle;
	}
	if (tooltip&&tipFollowMouse) {
		if (ns4) document.captureEvents(Event.MOUSEMOVE);
		document.onmousemove = trackMouse;
	}
}

window.onload = initTip;
var t1,t2;
var tipOn = false;
function doTooltip(evt,imgName,Code) {
	if (!tooltip) return;
	if (t1) clearTimeout(t1);	if (t2) clearTimeout(t2);
	tipOn = true;
	var curBgColor ="#FFFFFF";
	var curFontColor ="#000000";
	imgName='Image_Pro/'+ imgName;
	if (ie4||ie5||ns5) {
		var tip = startStr + startnewrow + Code + endnewrow + rowStr + imgName + midStr + '<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + curFontColor + ';"></span>' + endStr;
		tipcss.backgroundColor = curBgColor;
	 	tooltip.innerHTML = tip;
	}
	if (!tipFollowMouse) positionTip(evt);
	else t1=setTimeout("tipcss.visibility='visible'",100);
}

function doTooltip_Text(evt,text) {
	if (!tooltip) return;
	if (t1) clearTimeout(t1);	if (t2) clearTimeout(t2);
	tipOn = true;
	var curBgColor ="#FFFFFF";
	var curFontColor ="#000000";
	if (ie4||ie5||ns5) {
		var tip = startStr + starttextnewrow + text + endtextnewrow + endStr;
		tipcss.backgroundColor = curBgColor;
	 	tooltip.innerHTML = tip;
	}
	if (!tipFollowMouse) positionTip(evt);
	else t1=setTimeout("tipcss.visibility='visible'",100);
}



var mouseX, mouseY;
function trackMouse(evt) {
	mouseX = (ns4||ns5)? evt.pageX: window.event.clientX + document.body.scrollLeft;
	mouseY = (ns4||ns5)? evt.pageY: window.event.clientY + document.body.scrollTop;
	if (tipOn) positionTip(evt);
}

function positionTip(evt) {
	if (!tipFollowMouse) {
		mouseX = (ns4||ns5)? evt.pageX: window.event.clientX + document.body.scrollLeft;
		mouseY = (ns4||ns5)? evt.pageY: window.event.clientY + document.body.scrollTop;
	}

	var tpWd = (ns4)? tooltip.width: (ie4||ie5)? tooltip.clientWidth: tooltip.offsetWidth;
	var tpHt = (ns4)? tooltip.height: (ie4||ie5)? tooltip.clientHeight: tooltip.offsetHeight;

	var winWd = (ns4||ns5)? window.innerWidth-20+window.pageXOffset: document.body.clientWidth+document.body.scrollLeft;
	var winHt = (ns4||ns5)? window.innerHeight-20+window.pageYOffset: document.body.clientHeight+document.body.scrollTop;
	if ((mouseX+offX+tpWd)>winWd) 
		tipcss.left = (ns4)? mouseX-(tpWd+offX): mouseX-(tpWd+offX)+"px";
	else tipcss.left = (ns4)? mouseX+offX: mouseX+offX+"px";
	if ((mouseY+offY+tpHt)>winHt) 
		tipcss.top = (ns4)? winHt-(tpHt+offY): winHt-(tpHt+offY)+"px";
	else tipcss.top = (ns4)? mouseY+offY: mouseY+offY+"px";
	if (!tipFollowMouse) t1=setTimeout("tipcss.visibility='visible'",100);
}

function hideTip() {
	if (!tooltip) return;
	t2=setTimeout("tipcss.visibility='hidden'",100);
	tipOn = false;
}


function Moveovermain(that)
{
that.style.background='#2D78D7';
that.style.color='#FFFFFF';
that.style.fontWeight='bold';
}
function Moveoutmain(that)
{
that.style.background='#f6f5f6'; 
that.style.color='#000000';
that.style.fontWeight='bold';
}

function Moveoveredit(that)
{
that.style.background='#AEAE00';
that.style.color='#000000';
that.style.fontWeight='bold';
}
function Moveoutedit(that)
{
that.style.background='#E8E800'; 
that.style.color='#000000';
that.style.fontWeight='normal';
}

function Moveoversub(that)
{
that.style.background='#FFF9E0';
that.style.color='#000000';
that.style.fontWeight='normal';
}
function Moveoutsub(that)
{
that.style.background='#FBDD60'; 
that.style.color='#000000';
that.style.fontWeight='normal';
}
function mouseover(that)
{
that.style.color='cc0000';
that.style.fontSize='10px';
that.style.fontFamily='verdana';
that.style.fontWeight='bold';
}
function mouseout(that)
{
that.style.color='333333';
that.style.fontSize='9px';
that.style.fontFamily='verdana';
that.style.fontWeight='bold';
}





function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}




