﻿// flash
function flash_obj(obj,width,height) { 
	htmlstr="<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\""+width+"\" height=\""+height+"\">";
	htmlstr+="<param name=\"movie\" value=\""+obj+"\">";
	htmlstr+="<param name=\"quality\" value=\"high\">";
	htmlstr+="<param name=\"wmode\" value=\"transparent\">";
	htmlstr+="<embed src=\""+obj+"\" quality=\"high\" wmode=\"transparent\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\""+width+"\" height=\""+height+"\"></embed>";
	htmlstr+="</object>";
    document.write(htmlstr);
} //-->

//vr
function _ws_(id)
{
        var _object = document.getElementById(id).innerHTML; 
        _object = _object.replace("<!--", "");
        _object = _object.replace("-->" , "");
        document.write(_object); id.id="";
} 


//window center
function fn_01(url,w,h,tb,st,di,mb,sb,re)
{
 var position ="width="+w+",height="+h+",left=" + ((screen.width-w)/2) + ",top=" + ((screen.height-h)/2) + ",toolbar="+tb+",directories="+di+",status="+st+",menubar="+mb+",scrollbars="+sb+",resizable="+re+"";
 window.open( url, '', position);
}
//->


//popupzone layer
function view_menu(val)
 {
  for (i=1; i<=6 ;i++)
  {
   if (i == val)
   {
    document.all("layer_menu"+i).style.display = 'block';
   }
   else
   {
    document.all("layer_menu"+i).style.display = 'none';
   }   
  }
 }
//->

//medical tab
function medical_tab(val)
 {
  for (i=1; i<=7 ;i++)
  {
   if (i == val)
   {
    document.all("medical_menu"+i).style.display = 'block';
   }
   else
   {
    document.all("medical_menu"+i).style.display = 'none';
   }   
  }
 }
//->


//tour tab
function tour_tab(val)
 {
  for (i=1; i<=5 ;i++)
  {
   if (i == val)
   {
    document.all("tour_menu"+i).style.display = 'block';
   }
   else
   {
    document.all("tour_menu"+i).style.display = 'none';
   }   
  }
 }
//->

// left menu height control
window.onload = function adjustLayout() {
 if (document.getElementById("left_menu") && document.getElementById("dmts")) {
  if (document.getElementById("left_menu").offsetHeight > document.getElementById("dmts").offsetHeight) {   
   document.getElementById("dmts").style.height = document.getElementById("left_menu").offsetHeight + "px";
  }
 }
}


//rollover menu//
<!--
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_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_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];}
}
//->


//TOP Navi
function menuBlock(number) {
	// top menu 수만큼 루프 (메뉴수 변경시 수정요)
	for(i=1; i<=4; i++) {
		document.getElementById('sub-'+i).style.display='none'; // SubMenu 모두 숨김
		var top1 = document.getElementById("menu-"+i+"s");
		top1.src = "../images/menu-"+i+".gif";
	}
	var top1Menu = document.getElementById("menu-"+number+"s");
	if (top1Menu){
		top1Menu.src = "../images/menu-"+number+"_ov.gif";
		document.getElementById("sub-"+number).style.display='block'; //해당 ID만 보임
	}
}

function initTopNavigation(){
}

function initLocation(){
	if (document.getElementById("location")) {

		var menuName = document.getElementById("location").innerHTML;

		if (menuName == "의료")			menuBlock(1);
		else if (menuName == "관광")	menuBlock(2);
		else if (menuName == "의료관광도우미")	menuBlock(3);
		else if (menuName == "커뮤니티")	menuBlock(4);
	}
}






// LeftMenu Image Rollover
actor = "";
old_actor = "";

function img_act(imgName) {
        if (((init=="net")&&(browserVer >= 3)) || ((init == "ie") && (browserVer >= 4)))
        {
        imgOn = eval(imgName + "on.src");
        document [imgName].src = imgOn;
        }
}
function img_inact(imgName) {
 if(actor != imgName) {
        if (((init=="net")&&(browserVer >= 3)) || ((init == "ie") && (browserVer >= 4)))
        {
        imgOff = eval(imgName + "off.src");
        document [imgName].src = imgOff;
        }
    }
}
function img_onact(imgName) {
 if (actor == "") {
  old_actor = imgName; 
  actor = imgName;
 }else {
  old_actor = actor;
  actor = imgName;
  img_inact(old_actor);
 }
 
 img_act(actor);
}

// LeftMenu Hide
var old_menu = ''; 
var old_cell = ''; 

function menuclick( submenu ,cellbar) { 

        if( old_menu != submenu ) { 

                if( old_menu !='' ) { 
                        old_menu.style.display = 'none'; 
                } 

                submenu.style.display = 'block'; 
                old_menu = submenu; 
                old_cell = cellbar; 

        } else { 
                submenu.style.display = 'none'; 
                old_menu = ''; 
                old_cell = ''; 
        } 
} 


// input name
function Change (target,type) 
{  
       if ( target.value == target.defaultValue && type==0) target.value = ''; 
       if ( !target.value && type==1) target.value = target.defaultValue; 
} 


// image rollover
function menuOver() {
	this.src = this.src.replace(".gif", "_ov.gif");
}
function menuOut() {
	this.src = this.src.replace("_ov.gif", ".gif");
}

function imageOver(imgEl) {
	imgEl.src = imgEl.src.replace(".gif", "_ov.gif");
}
function imageOut(imgEl) {
	imgEl.src = imgEl.src.replace("_ov.gif", ".gif");
}


// Link Start
SiteUrl = '../'  

url_list = new Array();
newwin_list = new Array();
window_list = new Array()
fullwin_list = new Array()
//Medical
url_list[111] = '../medical/general_guide.jsp';//general
url_list[112] = '../medical/hair_guide.jsp';//hair
url_list[113] = '../medical/dental_guide.jsp';//dental
url_list[114] = '../medical/plastic_guide.jsp';//plastic
url_list[115] = '../medical/beauty_guide.jsp';//beauty
url_list[116] = '../medical/obstetrics_guide.jsp';//obstetrics
url_list[117] = '../medical/oriental_guide.jsp';//oriental
url_list[118] = '../medical/medicity.jsp';//oriental

//tour
url_list[211] = '../tour/package01.jsp';//package
url_list[212] = '../tour/experience01.jsp';//experience
url_list[213] = '../tour/theme_tour01.jsp';//theme
url_list[214] = '../tour/city_tour.jsp';//city tour
url_list[215] = '../tour/festival_list.jsp';//festival list
url_list[216] = '../tour/cyber_tour01.jsp';//cuber tour

//hospital list
url_list[311] = '../medical/general_hospital.jsp';//general
url_list[312] = '../medical/hair_hospital.jsp';//hair
url_list[313] = '../medical/dental_hospital.jsp';//dental
url_list[314] = '../medical/plastic_hospital.jsp';//plastic
url_list[315] = '../medical/beauty_hospital.jsp';//beauty
url_list[316] = '../medical/obstetrics_hospital.jsp';//obstetrics
url_list[317] = '../medical/oriental_hospital.jsp';//oriental

//package tour
url_list[411] = '../tour/package01.jsp';//2/3

//intro
url_list[412] = '../main/main.jsp';//kor
url_list[413] = '../../eng/main/main.jsp';//eng
url_list[414] = '../../chs/main/main.jsp';//chs
url_list[415] = '../../cht/main/main.jsp';//cht
url_list[416] = '../../jpn/main/main.jsp';//jpn



function go_site(num)
{
    self.status = num;
  if(url_list[num])
  {

//self
    if(newwin_list[num] != 'true' && fullwin_list[num] != 'true' && (window_list[num] == '' || window_list[num] == null))
    {

    	location=url_list[num];
    }

//blank
    if(window_list[num] != '' && window_list[num] != null)
    {
      window.open(url_list[num], 'new_win', window_list[num]);
    }

//blank
    if(newwin_list[num] == 'true')
    {
      window.open(url_list[num], '_blank', 'directories=yes, titlebar=yes, toolbar=yes, menubar=yes, statusbar=yes, scrollbars=yes, resizable=yes, location=yes, status=yes');
    }
  }
}



//FAQ onclick layer
var old_menu = '';
function setLayer(menu){
	if( old_menu != menu) {
		if( old_menu !='') { 
		old_menu.style.display = 'none';
	}
	menu.style.display = '';
	old_menu =menu;
	} else {
		menu.style.display = 'none';
		old_menu = '';
  }
}



//Quick
function goTop(orix,oriy,desx,desy) {
		var Timer;
		var winHeight = document.body.scrollTop;
		if(Timer) clearTimeout(Timer);
		startx = 0;
		starty = winHeight;
		if(!orix || orix < 0) orix = 0;
		if(!oriy || oriy < 0) oriy = 0;
		var speed = 7;
		if(!desx) desx = 0 + startx;
		if(!desy) desy = 0 + starty;
		desx += (orix - startx) / speed;
		if (desx < 0) desx = 0;
		desy += (oriy - starty) / speed;
		if (desy < 0) desy = 0;
		var posX = Math.ceil(desx);
		var posY = Math.ceil(desy);
		window.scrollTo(posX, posY);
		if((Math.floor(Math.abs(startx - orix)) < 2) && (Math.floor(Math.abs(starty - oriy)) < 2)){
			clearTimeout(Timer);
			window.scroll(orix,oriy);
		}else if(posX != orix || posY != oriy){
			Timer = setTimeout("goTop("+orix+","+oriy+","+desx+","+desy+")",15);
		}else{
			clearTimeout(Timer);
		}
}
