﻿var menuover = 0;

function showDialog(url, width, height)
{
    var sFeatures;
    sFeatures="dialogWidth: "+width+"px; ";
    sFeatures+="dialogHeight: "+height+"px; ";
    sFeatures+="help: no; ";
    sFeatures+="resizable: no; ";
    sFeatures+="scroll: no; ";
    sFeatures+="status: no; ";
    sFeatures+="unadorned: no; ";

    var result;
    result = window.showModalDialog(url,url, sFeatures)
    return result;
}

function readCookie(name) 
{
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) 
    {
        var c = ca[i];
        while (c.charAt(0)==' ') c = c.substring(1,c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }
    return null;
}

function eraseCookie(name) 
{
    createCookie(name,"",-1);
}

function createCookie(name,value,days) 
{
    if (days) 
    {
        var date = new Date();
        date.setTime(date.getTime()+(days*24*60*60*1000));
        var expires = "; expires="+date.toGMTString();
    }
    else var expires = "";
    document.cookie = name+"="+value+expires+"; path=/";
}	


document.oncontextmenu = oncontextmenu;
function oncontextmenu()
{
    //return false;
}


/*
Autumn Fall Timeout JavaScript
*/

//Pre-loads your images below
//Configure below - change URL path to your images
/*

grphcs=new Array(8)
Image0=new Image();
Image0.src=grphcs[0]="images/snow.gif";
Image1=new Image();
Image1.src=grphcs[1]="images/plower1.gif"
Image2=new Image();
Image2.src=grphcs[2]="images/plower2.gif"
Image3=new Image();
Image3.src=grphcs[3]="images/snow.gif"
Image4=new Image();
Image4.src=grphcs[4]="images/plower.gif"
Image5=new Image();
Image5.src=grphcs[5]="images/plower2.gif"
Image6=new Image();
Image6.src=grphcs[6]="images/plower.gif"
Image7=new Image();
Image7.src=grphcs[7]="images/plower3.gif"

//Smoothness depends on image file size, 
//the smaller the size the more you can use!

// Configure below - change number of images to render
Amount=7; 

Ypos=new Array();
Xpos=new Array();
Speed=new Array();
Step=new Array();
Cstep=new Array();
ns=(document.layers)?1:0;
ns6=(document.getElementById&&!document.all)?1:0;
var Stop = false; 

if (ns){
for (i = 0; i < Amount; i++){
var P=Math.floor(Math.random()*grphcs.length);
rndPic=grphcs[P];
document.write("<LAYER NAME='sn"+i+"' LEFT=0 TOP=0><img src="+rndPic+"></LAYER>");
}
}
else{
document.write('<div style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i = 0; i < Amount; i++){
var P=Math.floor(Math.random()*grphcs.length);
rndPic=grphcs[P];
document.write('<img id="si'+i+'" src="'+rndPic+'" style="position:absolute;top:0px;left:0px">');
}
document.write('</div></div>');
}
WinHeight=(ns||ns6)?window.innerHeight:window.document.body.clientHeight;
WinWidth=(ns||ns6)?window.innerWidth-70:window.document.body.clientWidth;
for (i=0; i < Amount; i++){
Ypos[i] = Math.round(Math.random()*WinHeight);
Xpos[i] = Math.round(Math.random()*WinWidth);
Speed[i]= Math.random()*5+3;
Cstep[i]=0;
Step[i]=Math.random()*0.1+0.05;
}
function fall(){
if (Stop) { clearLeaves(); return; }

var WinHeight=(ns||ns6)?window.innerHeight:window.document.body.clientHeight;
var WinWidth=(ns||ns6)?window.innerWidth-70:window.document.body.clientWidth;
var hscrll=(ns||ns6)?window.pageYOffset:document.body.scrollTop;
var wscrll=(ns||ns6)?window.pageXOffset:document.body.scrollLeft;
for (i=0; i < Amount; i++){
sy = Speed[i]*Math.sin(90*Math.PI/180);
sx = Speed[i]*Math.cos(Cstep[i]);
Ypos[i]+=sy;
Xpos[i]+=sx;
if (Ypos[i] > WinHeight){
Ypos[i]=-60;
Xpos[i]=Math.round(Math.random()*WinWidth);
Speed[i]=Math.random()*5+3;
}
if (ns){
document.layers['sn'+i].left=Xpos[i];
document.layers['sn'+i].top=Ypos[i]+hscrll;
}
else if (ns6){
document.getElementById("si"+i).style.left=Math.min(WinWidth,Xpos[i]);
document.getElementById("si"+i).style.top=Ypos[i]+hscrll;
}
else{
eval("document.all.si"+i).style.left=Xpos[i];
eval("document.all.si"+i).style.top=Ypos[i]+hscrll;
}
Cstep[i]+=Step[i];
}
setTimeout('fall()',20);
}

fall();

//  *****  Delay FUNCTION HERE  *****

//setTimeout("Stop=true", 20000);  //  *****  Delay 1000 = 1 second  *****

function clearLeaves(){
for (i=0; i < Amount; i++){
if (ns){
document.layers['sn'+i].display='none';
}
else if (ns6){
document.getElementById("si"+i).style.display='none';
}
else{
eval("document.all.si"+i).style.display='none';
}
}
}

/*<div id="divAdRight1" align="right" style="LEFT: -110px; WIDTH: 110px; POSITION: absolute; TOP: 71px">
        <div id="Footer2_BannerChayDocPhai1_myPanel">
          <a target="_blank" href ='/vn/adv/263'><img src="images/tinhnguyen.jpg" border='0'/></a>
           </div>
    </div>
	
    <div id="divAdLeft" style="LEFT: -110px; WIDTH: 110px; POSITION: absolute; TOP: 71px">
	    <div id="Footer2_BannerChayDocTrai1_myPanel">
	        <a target="_blank" href ='/vn/adv/263'><img src="images/tinhnguyen.jpg" border='0'/></a>
        </div>
    </div>

	<script type="text/javascript" language="JavaScript">		
	function FloatTopDiv()
	{
		startX = document.body.clientWidth - 115, startY = 71;
		var ns = (navigator.appName.indexOf("Netscape") != -1);
		var d = document;
			
		if (document.body.clientWidth < 1200) startX = -110;

		
		function ml(id)
		{
			var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
			if(d.layers)el.style=el;
			el.sP=function(x,y){this.style.left=x;this.style.top=y;};
			el.x = startX;
			el.y = startY;
			return el;
		}
		
		window.stayTopLeft=function()
		{
		
			if (document.body.clientWidth < 1200)
			{
				ftlObj.x = - 115;ftlObj.y = 00;	ftlObj.sP(ftlObj.x, ftlObj.y);
			}
			
			else
			{
			if (document.documentElement && document.documentElement.scrollTop)
				var pY = ns ? pageYOffset : document.documentElement.scrollTop;
			else if (document.body)
				var pY = ns ? pageYOffset : document.body.scrollTop;

			if (document.body.scrollTop > 71){startY = 100} else {startY = 100};

			if (document.body.clientWidth >= 1024)
			{
				ftlObj.x = document.body.clientWidth - 120;ftlObj.y += (pY + startY - ftlObj.y)/32;ftlObj.sP(ftlObj.x, ftlObj.y);
			}
			else
			{
			
			
			ftlObj.x  = startX;
			ftlObj.y += (pY + startY - ftlObj.y)/32;
			ftlObj.sP(ftlObj.x, ftlObj.y);
			}
			}
			setTimeout("stayTopLeft()", 1);
		}
		
		ftlObj = ml("divAdRight1");
		stayTopLeft();
		
	}
	
    function FloatTopDiv2()
	{
		startX2 = document.body.clientWidth - 1004, startY2 = 71;
		var ns2 = (navigator.appName.indexOf("Netscape") != -1);
		var d2 = document;
			
		if (document.body.clientWidth < 1200) startX2 = -110;

		
		function ml2(id)
		{
			var el2=d2.getElementById?d2.getElementById(id):d2.all?d2.all[id]:d2.layers[id];
			if(d2.layers)el2.style=el2;
			el2.sP=function(x,y){this.style.left=x;this.style.top=y;};
			el2.x = startX2;
			el2.y = startY2;
			return el2;
		}
		
		window.stayTopLeft2=function()
		{
			if (document.body.clientWidth < 1200)
			{
				ftlObj2.x = - 115;ftlObj2.y = 0;	ftlObj2.sP(ftlObj2.x, ftlObj2.y);
			}
			else
			{
			if (document.documentElement && document.documentElement.scrollTop)
				var pY2 = ns2 ? pageYOffset : document.documentElement.scrollTop;
			else if (document.body)
				var pY2 = ns2 ? pageYOffset : document.body.scrollTop;

			if (document.body.scrollTop > 71){startY2 = 100} else {startY2 = 71};

			if (document.body.clientWidth >= 1024)
			{
				ftlObj2.x =  10; ftlObj2.y += (pY2 + startY2 - ftlObj2.y)/32;	ftlObj2.sP(ftlObj2.x, ftlObj2.y);
			}
			else
			{			
			

			
			ftlObj2.x  = startX2;
			ftlObj2.y += (pY2 + startY2 - ftlObj2.y)/32;
			ftlObj2.sP(ftlObj2.x, ftlObj2.y);
			}
			}
			setTimeout("stayTopLeft2()", 1);
		}
		
		ftlObj2 = ml2("divAdLeft");
		stayTopLeft2();
		
	}


	function ShowAdDiv()
	{
		var objAdDivLeft  = document.getElementById("divAdLeft");
		var objAdDivRight = document.getElementById("divAdRight1");
		if (document.body.clientWidth < 2024)
		{
			objAdDivLeft.style.left  = - 110;
			objAdDivRight.style.left = - 110;
		}
		
		else
		{
			objAdDivLeft.style.left  = 0;
			objAdDivRight.style.left = document.body.clientWidth - 110;
		}
		FloatTopDiv();
		FloatTopDiv2();
	}
	
	ShowAdDiv();
	
	</script>*/
