//ÆË¾÷

function OpenWin(url,width,height,name,top,left,scroll,status,toolbar) 
{
	if (typeof(name)=="undefined") name ="";		
	if (typeof(scroll)=="undefined") scroll ="no";		
	if (typeof(top)=="undefined") top =(screen.availHeight/2-height/2);				
	if (typeof(left)=="undefined") left =(screen.availWidth/2-width/2);	
	if (typeof(status)=="undefined") status ="no";		
	if (typeof(toolbar)=="undefined") toolbar ="no";		
	window.open(url ,name, "width=" + width + ",height=" + height + ",top=" + top + ",left=" + left + ",scrollbars=" + scroll +",status=" + status + ",toolbar=" + toolbar);	
}

//ÄíÅ° ¼³Á¤
function setCookie( name, value, expiredays, path ) 
{
	var today = new Date();
	var expire = new Date();

	if (typeof(expiredays)=="undefined") expiredays =1;	
	if (typeof(path)=="undefined") path="/";

	expire.setTime(today.getTime() + 3600000*24*expiredays);

	document.cookie = name + "=" + value + "; path=" + path + ";expires=" + expire.toGMTString();
}


// ÄíÅ° ÀÐÀ½
function getCookie(cookieName) 
{
	var theCookie=""+document.cookie;
	var ind=theCookie.indexOf(cookieName);
	var ind1=theCookie.indexOf(';',ind);
	
	if (ind==-1 || cookieName=="") return ""; 	
	if (ind1==-1) ind1=theCookie.length; 
	
	return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}

// Top Menu Link Definition
function link(lParam, wParam)
{
	if (!lParam)
	{
		lParam = 1;
	}

	if (!wParam)
	{
		wParam = 1;
	}

	if (lParam == 1)
	{
		if (wParam == 1)
		{
			location.href ="/introduction/company.php";
		}
		else if (wParam == 2)
		{
			location.href ="/introduction/history.php";
		}
		else if (wParam == 3)
		{
			location.href ="/introduction/map.php";		
		}
	}
	else if (lParam == 2)
	{
		if (wParam == 1)
		{
			location.href ="/english/menu1.php";
		}
		else if (wParam == 2)
		{
			location.href ="/english/menu2.php";
		}
		else if (wParam == 3)
		{
			location.href ="/english/menu3.php";
		}
		else if (wParam == 4)
		{
			location.href ="/english/menu4.php";
		}
		else if (wParam == 5)
		{
			location.href ="/english/menu5.php";
		}
		else if (wParam == 6)
		{
			location.href ="/english/menu6.php";
		}
	}
	else if (lParam == 3)
	{
		if (wParam == 1)
		{
			location.href ="/japan/menu1.php";
		}
		else if (wParam == 2)
		{
			location.href ="/japan/menu2.php";
		}
		else if (wParam == 3)
		{
			location.href ="/japan/menu3.php";
		}
		else if (wParam == 4)
		{
			location.href ="/japan/menu4.php";
		}
		else if (wParam == 5)
		{
			location.href ="/japan/menu5.php";
		}
	}
	else if (lParam == 4)
	{
		if (wParam == 1)
		{
			location.href ="/lecture/menu1.php";
		}
	}
	else if (lParam == 5)
	{
		if (wParam == 1)
		{
			location.href ="/online/english.php";
		}
		else if (wParam == 2)
		{
			location.href ="/online/japan.php";
		}
	}
	else if (lParam == 6)
	{
		if (wParam == 1)
		{
			location.href ="http://www.globalgogo.co.kr/bbs/zboard.php?id=notice";
		}
		else if (wParam == 2)
		{
			location.href ="http://www.globalgogo.co.kr/bbs/zboard.php?id=board";
		}
	}
}

var OrgImg;
function img_act(imgName,imgPath)
{
	OrgImg = eval("document.all." +imgName+".src");

	document[imgName].src = imgPath
}
function img_inact(imgName)
{
	document[imgName].src = OrgImg; 
}

self.onError=null;
currentX = currentY = 0;
whichIt = null;
lastScrollX = 0; lastScrollY = 0;
NS = (document.layers) ? 1 : 0;
IE = (document.all) ? 1: 0;

function heartBeat() 
{
	if(IE) 
	{
		diffY = document.body.scrollTop;
		diffX = 0;
	 }
	if(NS) 
	{ 
		diffY = self.pageYOffset; diffX = self.pageXOffset; 
	}
	if(diffY != lastScrollY) 
	{
		percent = .1 * (diffY - lastScrollY);
		if(percent > 0) percent = Math.ceil(percent);
		else percent = Math.floor(percent);
		if(IE) document.all.branding.style.pixelTop += percent;
		if(NS) document.branding.top += percent;
		lastScrollY = lastScrollY + percent;
	 }
	if(diffX != lastScrollX) 
	{
		percent = .1 * (diffX - lastScrollX);
		if(percent > 0) percent = Math.ceil(percent);
		else percent = Math.floor(percent);
		if(IE) document.all.branding.style.pixelLeft += percent;
		if(NS) document.branding.top += percent;
		lastScrollY = lastScrollY + percent;
	}
}

if(NS || IE) action = window.setInterval("heartBeat()",1);

