function opencenter(winNM,width,height){
var sw=screen.availWidth;
var sh=screen.availHeight;

var px=(sw-width)/2;
var py=(sh-height)/2;

var set='top='+py+',left='+px;
set+=',width='+width+',height='+height+
',toobar=0,resizable=0,status=0,scrollbars=0';

window.open(winNM,'gymiden',set);
}

function go_url(ss)
{
	switch(ss)
	{
		case"01":
			location.replace('/introduction/introduction.php');
		break;
		case"01_01":
			location.replace('/introduction/introduction.php');
		break;
		case"01_02":
			location.replace('/introduction/history.php');
		break;
		case"01_03":
			location.replace('/introduction/ja.php');
		break;
		case"01_04":
			location.replace('/introduction/ci.php');
		break;
		case"01_05":
			location.replace('/introduction/qa.php');
		break;
		case"01_06":
			location.replace('/introduction/map.php');
		break;



		case"02":
			location.replace('/program_page/gpp.php');
		break;
		case"02_01":
			location.replace('/program_page/gpp.php');
		break;
		case"02_02":
			location.replace('/program_page/program01.php');
		break;
		case"02_03":
			location.replace('/program_page/program02.php');
		break;
		case"02_04":
			location.replace('/program_page/program03.php');
		break;
		case"02_05":
		window.open('http://www.livect.co.kr/netcam/gymiden/','','resizable=no,width=560,height=320,scrollbars=no,left=0,top=0');
		//alert('현재 준비중인 페이지 입니다.');
		break;

		case"03":
			location.replace('/branch/branch01_2.php');
		break;
		case"03_01":
			location.replace('/branch/branch01_2.php');
		break;
		case"03_02":
			location.replace('/branch/branch02_2.php');
		break;
		case"03_03":
			location.replace('/branch/branch03_2.php');
		break;

		case"04":
			location.replace('/bbs/board.php?bo_table=cyber_01');
		break;
		case"04_01":
			location.replace('/bbs/board.php?bo_table=cyber_01');
		break;
		case"04_02":
			location.replace('/bbs/board.php?bo_table=cyber_02');
		break;
		case"04_03":
			location.replace('/bbs/board.php?bo_table=cyber_03');
		break;

		case"mov_zoom":
			window.open('/popmov.html','','resizable=no,width=640,height=480,scrollbars=no,left=0,top=0');
		break;

//압구정점 시설둘러보기
/*
1=인포테스크
2=LITTEZONE
3=체력측정실
4=시청각교육실
5=SOCCERZONE
6=BASKETZONE
7=사무실
8=PLAYZONE
9=남자화장실
10=유아화장실
11=여자화장실
*/
		case"view01_1":
			opencenter('/bbs/board.php?bo_table=branch_01_2&sca=2',740,370);
			//window.open('/bbs/board.php?bo_table=branch_01_2&sca=2','popgallery','resizable=no,width=551,height=382,scrollbars=no,left=0,top=0');
		break;
		case"view01_2":
			opencenter('/bbs/board.php?bo_table=branch_01_2&sca=5',740,370);
			//window.open('','popgallery','resizable=no,width=551,height=382,scrollbars=no,left=0,top=0');
		break;
		case"view01_3":
			opencenter('/bbs/board.php?bo_table=branch_01_2&sca=6',740,370);
			//window.open('','popgallery','resizable=no,width=551,height=382,scrollbars=no,left=0,top=0');
		break;
		case"view01_4":
			opencenter('/bbs/board.php?bo_table=branch_01_2&sca=3',740,370);
			//window.open('','popgallery','resizable=no,width=551,height=382,scrollbars=no,left=0,top=0');
		break;
		case"view01_5":
			opencenter('/bbs/board.php?bo_table=branch_01_2&sca=1',740,370);
			//window.open('','popgallery','resizable=no,width=551,height=382,scrollbars=no,left=0,top=0');
		break;
		case"view01_6":
			opencenter('/bbs/board.php?bo_table=branch_01_2&sca=7',740,370);
			//window.open('','popgallery','resizable=no,width=551,height=382,scrollbars=no,left=0,top=0');
		break;
		case"view01_7":
			opencenter('/bbs/board.php?bo_table=branch_01_2&sca=8',740,370);
			//window.open('','popgallery','resizable=no,width=551,height=382,scrollbars=no,left=0,top=0');
		break;
		case"view01_8":
			opencenter('/bbs/board.php?bo_table=branch_01_2&sca=4',740,370);
			//window.open('','popgallery','resizable=no,width=551,height=382,scrollbars=no,left=0,top=0');
		break;
		case"view01_9":
			opencenter('/bbs/board.php?bo_table=branch_01_2&sca=9',740,370);
			//window.open('','popgallery','resizable=no,width=551,height=382,scrollbars=no,left=0,top=0');
		break;
		case"view01_10":
			opencenter('/bbs/board.php?bo_table=branch_01_2&sca=10',740,370);
			//window.open('','popgallery','resizable=no,width=551,height=382,scrollbars=no,left=0,top=0');
		break;
		case"view01_11":
			opencenter('/bbs/board.php?bo_table=branch_01_2&sca=11',740,370);
			//window.open('','popgallery','resizable=no,width=551,height=382,scrollbars=no,left=0,top=0');
		break;

//서초점 시설둘러보기
/*
1=인포데스크
2=교구실
3=BASKETZONE
4=SOCCERZONE
5=사무실
6=회의실
7=제1관람실
8=제2관람실
9=남자화장실
10=여자화장실
*/
		case"view02_1":
			opencenter('/bbs/board.php?bo_table=branch_02_2&sca=2',740,370);
			//window.open('','popgallery','resizable=no,width=551,height=382,scrollbars=no,left=0,top=0');
		break;
		case"view02_2":
			opencenter('/bbs/board.php?bo_table=branch_02_2&sca=3',740,370);
			//window.open('','popgallery','resizable=no,width=551,height=382,scrollbars=no,left=0,top=0');
		break;
		case"view02_3":
			opencenter('/bbs/board.php?bo_table=branch_02_2&sca=4',740,370);
		//	window.open('','popgallery','resizable=no,width=551,height=382,scrollbars=no,left=0,top=0');
		break;
		case"view02_4":
			opencenter('/bbs/board.php?bo_table=branch_02_2&sca=5',740,370);
			//window.open('','popgallery','resizable=no,width=551,height=382,scrollbars=no,left=0,top=0');
		break;
		case"view02_5":
			opencenter('/bbs/board.php?bo_table=branch_02_2&sca=6',740,370);
			//window.open('','popgallery','resizable=no,width=551,height=382,scrollbars=no,left=0,top=0');
		break;
		case"view02_6":
			opencenter('/bbs/board.php?bo_table=branch_02_2&sca=9',740,370);
			//window.open('','popgallery','resizable=no,width=551,height=382,scrollbars=no,left=0,top=0');
		break;
		case"view02_7":
			opencenter('/bbs/board.php?bo_table=branch_02_2&sca=10',740,370);
			//window.open('','popgallery','resizable=no,width=551,height=382,scrollbars=no,left=0,top=0');
		break;
		case"view02_8":
			opencenter('/bbs/board.php?bo_table=branch_02_2&sca=1',740,370);
			//window.open('','popgallery','resizable=no,width=551,height=382,scrollbars=no,left=0,top=0');
		break;
		case"n02_1":
			opencenter('/bbs/board.php?bo_table=branch_02_2&sca=7',740,370);
			//window.open('','popgallery','resizable=no,width=551,height=382,scrollbars=no,left=0,top=0');
		break;
		case"n02_2":
			opencenter('/bbs/board.php?bo_table=branch_02_2&sca=8',740,370);
			//window.open('','popgallery','resizable=no,width=551,height=382,scrollbars=no,left=0,top=0');
		break;

//분당점 시설둘러보기
/*
1=복도
2=상담실
3=사무실
4=싸커존B-1
5=블루존
6=그린존
7=복도
8=싸커존4
9=멀티A
10=멀티B
*/
		case"view03_1":
			opencenter('/bbs/board.php?bo_table=branch_03_2&sca=6',740,370);
			//window.open('','popgallery','resizable=no,width=551,height=382,scrollbars=no,left=0,top=0');
		break;
		case"view03_2":
			opencenter('/bbs/board.php?bo_table=branch_03_2&sca=5',740,370);
			//window.open('','popgallery','resizable=no,width=551,height=382,scrollbars=no,left=0,top=0');
		break;
		case"view03_3":
			opencenter('/bbs/board.php?bo_table=branch_03_2&sca=4',740,370);
			//window.open('','popgallery','resizable=no,width=551,height=382,scrollbars=no,left=0,top=0');
		break;
		case"view03_4":
			opencenter('/bbs/board.php?bo_table=branch_03_2&sca=3',740,370);
			//window.open('','popgallery','resizable=no,width=551,height=382,scrollbars=no,left=0,top=0');
		break;
		case"view03_5":
			opencenter('/bbs/board.php?bo_table=branch_03_2&sca=2',740,370);
			//window.open('','popgallery','resizable=no,width=551,height=382,scrollbars=no,left=0,top=0');
		break;
//		case"view03_6":
//			window.open('/bbs/board.php?bo_table=branch_03_2&sca=1','','resizable=no,width=800,height=500,scrollbars=no,left=0,top=0');
//		break;
		case"view03_1_1":
			opencenter('/bbs/board.php?bo_table=branch_03_2&sca=9',740,370);
			//window.open('','popgallery','resizable=no,width=551,height=382,scrollbars=no,left=0,top=0');
		break;
		case"view03_1_2":
			opencenter('/bbs/board.php?bo_table=branch_03_2&sca=10',740,370);
			//window.open('','popgallery','resizable=no,width=551,height=382,scrollbars=no,left=0,top=0');
		break;
		case"view03_1_3":
			opencenter('/bbs/board.php?bo_table=branch_03_2&sca=8',740,370);
			//window.open('','popgallery','resizable=no,width=551,height=382,scrollbars=no,left=0,top=0');
		break;
//		case"view03_1_4":
//			window.open('/bbs/board.php?bo_table=branch_03_2&sca=7','','resizable=no,width=800,height=500,scrollbars=no,left=0,top=0');
//		break;
	}
}




//
var basic_img = ""; 
function lock_menu(Menu) { 
if (Menu) { 
var target_menu = eval("document.all."+Menu); 
target_menu.src = "image/"+Menu+"_on.gif"; 
basic_img = Menu; 
} 
} 
function inact(imgName) 
    {   if (document.image && basic_img != imgName) 
        document[imgName].src = eval(imgName + '.src') 
     } 

function act(imgName) 
    {   if (document.image && basic_img != imgName) 
        document[imgName].src = eval(imgName + 'a.src') 
     } 

// --> 

// popup cookie
function getCookie(name) 
{
	var Found = false;
	var start,end;
	var i = 0;
	while (i <= document.cookie.length) 
	{
		start = i;
		end = start + name.length;
		if (document.cookie.substring(start,end) == name) 
		{
			Found = true;
			break;
		}
		i++;
	}
	if (Found) 
	{
		start = end + 1;
		end = document.cookie.indexOf(";",start);
		if (end < start) end = document.cookie.length;
		{
			return document.cookie.substring(start,end);
		}
	}
	return ;
}
// popup open
var farwindow = null;
function smartPopup(url,name,feature,number) 
{
	if ( getCookie('OpenPopup'+number+'Again') != 'no') 
	{
		farwindow = window.open(url,name,feature);
		if (farwindow != null) 
		{
			if (farwindow.opener == null) 
			{
				farwindow.opener = self;
			}
		}
	}
}
// select url go
function change_url(url)
{
	var cut_array = url.split('|');
	if(cut_array[1]=="1")
	{
		window.open(cut_array[0]);
	}	else	{
		location.replace(cut_array[0]);
	}
}


function setEmbed() 
{ 
  var obj = new String; 
  var parameter = new String; 
  var embed = new String; 
  var html = new String; 
  var allParameter = new String; 
  var clsid = new String; 
  var codebase = new String; 
  var pluginspace = new String; 
  var embedType = new String; 
  var src = new String; 
  var width = new String; 
  var height = new String; 

    
  this.init = function( getType , s ,w , h ) { 
      
      if ( getType == "flash") 
      { 

        clsid = "D27CDB6E-AE6D-11cf-96B8-444553540000";        
        codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"; 
        pluginspage = "http://www.macromedia.com/go/getflashplayer"; 
        embedType = "application/x-shockwave-flash"; 
      } 
      /* type add
      else if ( ) 
      { 
      } 
      */ 
            
      parameter += "<param name='movie' value='"+ s + "'>\n";  
      parameter += "<param name='quality' value='high'>\n";    
      
      src = s; 
      width = w; 
      height = h; 
  } 
  
  this.parameter = function( parm , value ) {      
      parameter += "<param name='"+parm +"' value='"+ value + "'>\n";        
      allParameter += " "+parm + "='"+ value+"'"; 
  }  
  
  this.show = function() { 
      if ( clsid ) 
      { 
        obj = "<object classid=\"clsid:"+ clsid +"\" codebase=\""+ codebase +"\" width='"+ width +"' height='"+ height +"'>\n"; 
      } 
      
      embed = "<embed src='" + src + "' pluginspage='"+ pluginspage + "' type='"+ embedType + "' width='"+ width + "' height='"+ height +"'"+ allParameter +" wmode='transparent'></embed>\n"; 
      
      if ( obj ) 
      { 
        embed += "</object>\n"; 
      } 
      
      html = obj + parameter + embed; 
      
      document.write( html );  
  } 
  
} 

function flash(s,w,h,type,wm,id,autostart) 
{ 
	  var obj = new String; 
	  var parameter = new String; 
	  var embed = new String; 
	  var html = new String; 
	  var allParameter = new String; 
	  var clsid = new String; 
	  var codebase = new String; 
	  var pluginspage = new String; 
	  var embedType = new String; 
	  var src = new String; 
	  var width = new String; 
	  var height = new String; 


	src = s;
	width = w;
	height = h;

	var typ = type ? type : "f";
	
	if(typ=="f")//flash
	{
		clsid = "D27CDB6E-AE6D-11cf-96B8-444553540000";        
		codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"; 
		pluginspage = "http://www.macromedia.com/go/getflashplayer"; 
		embedType = "application/x-shockwave-flash"; 
	}	else if(typ=="m")	{//media
		clsid="22D6F312-B0F6-11D0-94AB-0080C74C7E95";
		codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701";
		embedType="application/x-oleobject";
		parameter += "<param name='FileName' value='"+ src + "'>\n"; 
		var auto = autostart ? "1" : "0";
		parameter += "<param name='AutoStart' value='"+auto+"'>\n";  
	}
	parameter += "<param name='movie' value='"+ src + "'>\n";  
	parameter += "<param name='quality' value='high'>\n";

	if(wm)
	{
		parameter += "<param name='wmode' value='transparent'>\n";
	}
	if ( clsid ) 
	{ 
		obj = "<object classid=\"clsid:"+ clsid +"\" codebase=\""+ codebase +"\" width='"+ width +"' height='"+ height +"'>\n"; 
	} 
	embed = "<embed src='" + src + "' pluginspage='"+ pluginspage + "' type='"+ embedType + "' width='"+ width + "' height='"+ height +"'"+ allParameter +" wmode='transparent'></embed>\n"; 
	if ( obj ) 
	{ 
		embed += "</object>\n"; 
	} 
	html = obj + parameter + embed; 
	document.write( html );
}



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)) < 1) && (Math.floor(Math.abs(starty - oriy)) < 1)){
			clearTimeout(Timer);
			window.scroll(orix,oriy);
		}else if(posX != orix || posY != oriy){
			Timer = setTimeout("goTop("+orix+","+oriy+","+desx+","+desy+")",15);
		}else{
			clearTimeout(Timer);
		}
	}
function go_top()
{
	window.scrollTo(0,0);
}

function getReSize()
{
       try {
              var objFrame = document.getElementById("ifrm");
              var objBody = ifrm.document.body; 

              ifrmHeight = objBody.scrollHeight + (objBody.offsetHeight - objBody.clientHeight); 

              if (ifrmHeight > 300) { 
                     objFrame.style.height = ifrmHeight; 
              } else {
                     objFrame.style.height = 300;
              } 
              objFrame.style.width = '99%'
       } catch(e) {
       };
} 



//onfocus="this.blur()" ==> <body onload="allblur();">

function allblur() {
  for (i = 0; i < document.links.length; i++) {
    var obj = document.links[i];
    if(obj.addEventListener) obj.addEventListener("focus", oneblur, false);
    else if(obj.attachEvent) obj.attachEvent("onfocus", oneblur);
  }
}
 
function oneblur(e) {
  var evt = e ? e : window.event;

 

  if(evt.target) evt.target.blur();
  else if(evt.srcElement) evt.srcElement.blur();
}

function show(){
	window.open("/board/bbs/write.php?bo_table=receive_01","popup","width=600,height=450");
}

