function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


var isDOM = (document.getElementById ? true : false); 
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);

function getRef(id) {
	if (isDOM) return document.getElementById(id);
	if (isIE4) return document.all[id];
	if (isNS4) return document.layers[id];
}

var isNS = navigator.appName == "Netscape";
function moveRightEdge() {
	var yMenuFrom, yMenuTo, yOffset, timeoutNextCheck;

	if (isNS4) {
		yMenuFrom   = divMenu.top;
		yMenuTo     = windows.pageYOffset + 100;   // À§ÂÊ À§Ä¡
	} else if (isDOM) {
		yMenuFrom   = parseInt (divMenu.style.top, 10);
		yMenuTo     = (isNS ? window.pageYOffset : document.body.scrollTop) + 34; // À§ÂÊ À§Ä¡
	}
	timeoutNextCheck = 100;

	if (yMenuFrom != yMenuTo) {
		yOffset = Math.ceil(Math.abs(yMenuTo - yMenuFrom) / 50);
		if (yMenuTo < yMenuFrom)
			yOffset = -yOffset;
		if (isNS4)
			divMenu.top += yOffset;
		else if (isDOM)
			divMenu.style.top = parseInt (divMenu.style.top, 10) + yOffset;
			timeoutNextCheck = 20;
	}
	setTimeout ("moveRightEdge()", timeoutNextCheck);
}

function bannerScroll() {
	if (isNS4) {
		var divMenu = document["divMenu"];
		divMenu.top = top.pageYOffset + 50;
		divMenu.visibility = "visible";
		moveRightEdge();
	} else if (isDOM) {
		var divMenu = getRef('divMenu');
		divMenu.style.top = (isNS ? window.pageYOffset : document.body.scrollTop) + 50;
		divMenu.style.visibility = "visible";
		moveRightEdge();
	}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
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];}
}

function na_open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
  toolbar_str = toolbar ? 'yes' : 'no';
  menubar_str = menubar ? 'yes' : 'no';
  statusbar_str = statusbar ? 'yes' : 'no';
  scrollbar_str = scrollbar ? 'yes' : 'no';
  resizable_str = resizable ? 'yes' : 'no';
 window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}


function OpenWindow() {
	window.open('sub04_1.html', 'new1', 'width=385, height=450');
}
function OpenWindow2() {
	window.open('sub04_2.html', 'new2', 'width=385, height=450');
}
function OpenWindow3() {
	window.open('sub04_3.html', 'new3', 'width=385, height=450');
}
function OpenWindow4() {
	na_open_window('win', 'sub04_4.html', 0, 0, 385, 450, 0, 0, 0, 1, 0)
	//window.open('sub04_4.html', 'new4', 'width=385, height=450', 'scrollbars=yes');
}
function OpenWindow5() {
	na_open_window('win', 'sub04_5.html', 0, 0, 385, 450, 0, 0, 0, 1, 0)
	//window.open('sub04_5.html', 'new5', 'width=385, height=450');
}
function OpenWindow6() {
	na_open_window('win', 'sub04_6.html', 0, 0, 385, 450, 0, 0, 0, 1, 0)
	//window.open('sub04_6.html', 'new6', 'width=385, height=450');
}
function OpenWindow7() {
	na_open_window('win', 'sub04_7.html', 0, 0, 385, 450, 0, 0, 0, 1, 0)
	//window.open('sub04_7.html', 'new7', 'width=385, height=450');
}

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 openWin(theURL, name, width, height)
{
    window.open(theURL,name,'width='+width+', height='+height+', scrollbars=yes');
}

var overdiv = 0;

function ShowLayer(szString)
{
	var szShowStr = szString;
	var x = event.clientX + document.body.scrollLeft;
	var y = event.clientY + document.body.scrollTop;

	divObj.innerHTML=szShowStr;
	divObj.style.pixelLeft=x;
	divObj.style.pixelTop=y+2;
}

function HideLayer()
{
	if (overdiv == '0') {
		divObj.innerHTML='';
	}
}

var isDOM = (document.getElementById ? true : false); 
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);

function getRef(id) {
    if (isDOM) return document.getElementById(id);
    if (isIE4) return document.all[id];
    if (isNS4) return document.layers[id];
}

var isNS = navigator.appName == "Netscape";
function moveRightEdge() {
    var yMenuFrom, yMenuTo, yOffset, timeoutNextCheck;

    if (isNS4) {
        yMenuFrom   = divMenu.top;
        yMenuTo     = windows.pageYOffset + 0;   // À§ÂÊ À§Ä¡
    } else if (isDOM) {
        yMenuFrom   = parseInt (divMenu.style.top, 10);
        yMenuTo     = (isNS ? window.pageYOffset : document.body.scrollTop) + 0; // À§ÂÊ À§Ä¡
    }
    timeoutNextCheck = 0;

    if (yMenuFrom != yMenuTo) {
        yOffset = Math.ceil(Math.abs(yMenuTo - yMenuFrom) / 50);
        if (yMenuTo < yMenuFrom)
            yOffset = -yOffset;
        if (isNS4)
            divMenu.top += yOffset;
        else if (isDOM)
            divMenu.style.top = parseInt (divMenu.style.top, 10) + yOffset;
            timeoutNextCheck = 0;
    }
    setTimeout ("moveRightEdge()", timeoutNextCheck);
}

function bannerScroll() {
    if (isNS4) {
        var divMenu = document["divMenu"];
        divMenu.top = top.pageYOffset + 10;
        divMenu.visibility = "visible";
        moveRightEdge();
    } else if (isDOM) {
        var divMenu = getRef('divMenu');
        divMenu.style.top = (isNS ? window.pageYOffset : document.body.scrollTop) + 10;
        divMenu.style.visibility = "visible";
        moveRightEdge();
    }
}

function show (layer)
{
    layer.style.visibility = "visible";
}

function hide (layer)
{
    layer.style.visibility = "hidden";
}

function OpenLinkSite() {
    var szObj = document.frmLink;
    var szLink = szObj.cboLinkSite.value;

    window.open(szLink,'','');
}

function goWebmail()
{
	location.href = '/Webmail/index.html';
}

function goIntranet()
{
	location.href = '/Intranet/html/Login.html';
}

function goCommunity()
{
	location.href = 'http://skytyper.juins.com/Shop/bbs/_module_skin/_shop/_clc_b_gray/boardlist.php?code=media&userid=admin&skin_dir=_shop&user_dir=_clc_b_gray';
}


function gotoURL(n)
{
    switch (n)
    {
    case 0:
        self.location.href = "/Main/";
        break;
    case 1:
        self.location.href = "/Company/Introduce.html";
        break;
    case 2:
        self.location.href = "/Business/Business.html";
        break;
    case 3:
        self.location.href = "/Product/MainProduct.html";
        break;
    case 4:
        self.location.href = "/Customer/support.html";
        break;
    case 5:
        self.location.href = "/User/Login.php";
        break;
    case 6:
        window.open("/Mail/FormMail.php","","width=430,height=350");//Æû¸ÞÀÏ
        break;
    case 7:
        self.location.href = "/News/Notice.html";
        break;
    case 8:
        self.location.href = "/News/News.html";
        break;
    case 9:
        self.location.href = "/Etc/Sitemap.html";
        break;
    case 10:
        self.location.href = "/english/Main/";
        break;
    case 11:
        self.location.href = "/Company/Introduce.html";
        break;
    case 12:
        self.location.href = "/Company/History.html";
        break;
    case 13:
        self.location.href = "/Company/Company.html";
        break;
    case 14:
        self.location.href = "/Company/ks.html";
        break;
    case 15:
        self.location.href = "/Company/Company.html";
        break;
    case 16:
        self.location.href = "/Company/Map.html";
        break;
    case 31:
        self.location.href = "/Product/ProductSub.html?nCategoryID=6";
        break;
    case 32:
        self.location.href = "/Product/ProductSub.html?nCategoryID=7";
        break;
    case 33:
        self.location.href = "/Product/ProductSub.html?nCategoryID=8";
        break;
    case 34:
        self.location.href = "/Product/ProductSub.html?nCategoryID=9";
        break;
    case 35:
        self.location.href = "/Product/ProductSub.html?nCategoryID=10";
        break;
    case 36:
        self.location.href = "/Product/ProductSub.html?nCategoryID=11";
        break;
    case 37:
        self.location.href = "/Product/ProductSub.html?nCategoryID=12";
        break;
	 case 38:
        self.location.href = "/Product/ProductSub.html?nCategoryID=13";
        break;
   case 39:
        self.location.href = "/Product/ProductSub.html?nCategoryID=22";
        break;        
    case 41:
        self.location.href = "/Customer/support.html";
        break;
    case 42:
        self.location.href = "/Customer/qna.html";
		break;
	case 43:
        self.location.href = "/Product/ProductSub.html?nCategoryID=25";
		break;
    case 44:
        self.location.href = "/Product/ProductSub.html?nCategoryID=27";		
        break;
    case 111:
        self.location.href = "/User/Register.php";
        break;
    case 112:
        self.location.href = "/User/Modify.php";
        break;
    case 113:
        self.location.href = "/english/Main/index.html";
        break;
    }
}

function menu(link)
{
    if (link) {
        location = link;
    }
}





function na_restore_img_src(name, nsdoc)
{
	var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
	if (name == '')
		return;
	if (img && img.altsrc)
	{
		img.src    = img.altsrc;
		img.altsrc = null;
	} 
}

function na_preload_img()
{ 
	var img_list = na_preload_img.arguments;
	if (document.preloadlist == null) 
		document.preloadlist = new Array();
	var top = document.preloadlist.length;
	for (var i=0; i < img_list.length; i++) 
	{
		document.preloadlist[top+i]     = new Image;
		document.preloadlist[top+i].src = img_list[i+1];
	} 
}

function na_change_img_src(name, nsdoc, rpath, preload)
{ 
	var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
	if (name == '')
		return;
	if (img)
	{
		img.altsrc = img.src;
		img.src    = rpath;
	} 
}

