// 플래시
function getflash(url,wid,hei,mode,tl,scale) //Flash8
{
	document.writeln('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+ wid +'" height="'+ hei +'">');//IE,Op
	document.writeln('<param name="movie" value="'+ url +'" />');
	document.writeln('<param name="quality" value="high" />');
	document.writeln('<param name="wmode" value="'+ mode +'" />');
	document.writeln('<param name="salign" value="'+ tl +'" />');
	document.writeln('<param name="scale" value="' + scale + '" />');
	document.writeln('<!--[if !IE]> <-->');
	document.writeln('<object type="application/x-shockwave-flash" data="'+ url +'" width="'+ wid +'" height="'+ hei +'">');//FF
	document.writeln('<param name="movie" value="'+ url +'" />');
	document.writeln('<param name="quality" value="high" />');
	document.writeln('<param name="wmode" value="'+ mode +'" />');
	document.writeln('<param name="salign" value="'+ tl +'" />');
	document.writeln('<param name="scale" value="' + scale + '" />');
	document.writeln('<div>이 콘텐츠는 Flash로 제작되었습니다.<br />이 콘텐츠를 보려면 <a tabindex="0" href="http://www.adobe.com/kr/products/flashplayer/">Flash Player</a>(무료)가 필요합니다.</div>');
	document.writeln('</object>');
	document.writeln('<!--> <![endif]-->');
	document.writeln('</object>');
}
//플래시대체콘텐츠.20071005
function flashAlt(eid,altid) {
	var objAlt = document.getElementById(eid).getElementsByTagName("div")[0];
	var altContents = document.getElementById(altid);
	objAlt.innerHTML = altContents.innerHTML;
	altContents.innerHTML="";
}


/***************************************************************************************************/

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];}
}




//컨텐츠탭4차메뉴보기
//ex) initContentTabMenu(4차인덱스);
function initContentTabMenu(d)
{
	var obj = document.getElementById("contenttabmenu").getElementsByTagName("li");
	for (i=0; i<obj.length; i++) {
	ctab4Menu = document.getElementById("ctab4m"+(i+1));
	ctab4MenuA = ctab4Menu.getElementsByTagName("a")[0];
	ctab4MenuImg = ctab4Menu.getElementsByTagName("img")[0];
		if(ctab4Menu){ ctab4Menu.className="";
			if(ctab4MenuImg){ ctab4MenuImg.src = ctab4MenuImg.src.replace("on.gif", ".gif");	}
		}
	}
	ctab4MenuCurr = document.getElementById("ctab4m" + d);
	ctab4MenuCurrA = ctab4MenuCurr.getElementsByTagName("a")[0];
	ctab4MenuCurrImg = ctab4MenuCurr.getElementsByTagName("img")[0];
	if(ctab4MenuCurr){ ctab4MenuCurr.className="on";
		if(ctab4MenuCurrImg){ ctab4MenuCurrImg.src = ctab4MenuCurrImg.src.replace(".gif", "on.gif");	}
	}
}




//컨텐츠메뉴보기
//ex) initContentMenu(4차인덱스);
function initContentMenu(d)
{
	var obj = document.getElementById("contentmenu").getElementsByTagName("li");
	for (i=0; i<obj.length; i++) {
		c4Menu = obj[i];
		c4MenuA = c4Menu.getElementsByTagName("a")[0];
		if(c4Menu){ c4MenuA.style.color="#666"; c4MenuA.style.fontWeight="normal"; }
	}
	c4MenuCurr = obj[d-1];
	c4MenuCurrA = c4MenuCurr.getElementsByTagName("a")[0];
	if(c4MenuCurr){ c4MenuCurrA.style.color="#000"; c4MenuCurrA.style.fontWeight="bold";	}
}


//바로가기
function goUri(uri,target) { 
	if(uri!="") { window.open(uri,target); }
}
//목록상자바로가기
function goSelect(form,target) {
	var myindex=form.uri.selectedIndex
	myUri = form.uri.options[myindex].value;
	if(myUri!="") { window.open(myUri,target); }
}


// 마우스오버아웃
function imgOver(imgEl) { imgEl.src = imgEl.src.replace(".gif", "on.gif"); }
function imgOut(imgEl) { imgEl.src = imgEl.src.replace("on.gif", ".gif"); }
function menuOver() { this.src = this.src.replace(".gif", "on.gif"); }
function menuOut() { this.src = this.src.replace("on.gif", ".gif"); }

//이미지롤오버함수할당
//ex) initImgRoll("containerId");
function initImgRoll(containerId) { 
 	imgEl = document.getElementById(containerId).getElementsByTagName("img");
	for (i=0; i<imgEl.length; i++) {
		var menuImg = imgEl[i]
		var where = menuImg.src.indexOf("on.gif",0)
		if (where==-1) {
				menuImg.onmouseover = menuOver;
				menuImg.onmouseout = menuOut;
		}
	}
}





//글자크기 
//ex) onclick="setFontSize(+1);"	 onclick="setFontSize(-1);"
function setFontSize(a) {
	var defaultFontSize = 1;//em
	var minFontSize = 1;//em
	var maxFontSize = 2;//em
	obj = document.getElementById("body_content");//확대축소영역
	var objFontSize = obj.style.fontSize;
	if (!objFontSize) { objFontSize = parseFloat(defaultFontSize)+"em"; }
	var checkFontSize = (Math.round(12*parseFloat(objFontSize))+(a*2))/12;
	if (checkFontSize >= maxFontSize) { checkFontSize = maxFontSize; obj.style.fontSize = checkFontSize+"em"; alert("더이상 늘릴 수 없습니다."); }
	else if (checkFontSize <= minFontSize) { checkFontSize = minFontSize; obj.style.fontSize = checkFontSize+"em"; alert("더이상 줄일 수 없습니다."); }
	else { obj.style.fontSize = checkFontSize+"em"; }
//	alert(checkFontSize);
}

function setFontSize_index(a) {
	var defaultFontSize = 1;//em
	var minFontSize = 1;//em
	var maxFontSize = 2;//em
	obj = document.getElementById("main_contents");//확대축소영역
	var objFontSize = obj.style.fontSize;
	if (!objFontSize) { objFontSize = parseFloat(defaultFontSize)+"em"; }
	var checkFontSize = (Math.round(12*parseFloat(objFontSize))+(a*2))/12;
	if (checkFontSize >= maxFontSize) { checkFontSize = maxFontSize; obj.style.fontSize = checkFontSize+"em"; alert("더이상 늘릴 수 없습니다."); }
	else if (checkFontSize <= minFontSize) { checkFontSize = minFontSize; obj.style.fontSize = checkFontSize+"em"; alert("더이상 줄일 수 없습니다."); }
	else { obj.style.fontSize = checkFontSize+"em"; }
//	alert(checkFontSize);
}



//글자크기_영문
//ex) onclick="setFontSize(+1);"	 onclick="setFontSize(-1);"
function setFontSize_eng(a) {
	var defaultFontSize = 1;//em
	var minFontSize = 1;//em
	var maxFontSize = 2;//em
	obj = document.getElementById("body_content");//확대축소영역
	var objFontSize = obj.style.fontSize;
	if (!objFontSize) { objFontSize = parseFloat(defaultFontSize)+"em"; }
	var checkFontSize = (Math.round(12*parseFloat(objFontSize))+(a*2))/12;
	if (checkFontSize >= maxFontSize) { checkFontSize = maxFontSize; obj.style.fontSize = checkFontSize+"em"; alert("You cannot enlarge the image any further."); }
	else if (checkFontSize <= minFontSize) { checkFontSize = minFontSize; obj.style.fontSize = checkFontSize+"em"; alert("You cannot reduce the image any further ."); }
	else { obj.style.fontSize = checkFontSize+"em"; }
//	alert(checkFontSize);
}

function setFontSize_index_eng(a) {
	var defaultFontSize = 1;//em
	var minFontSize = 1;//em
	var maxFontSize = 2;//em
	obj = document.getElementById("main_contents");//확대축소영역
	var objFontSize = obj.style.fontSize;
	if (!objFontSize) { objFontSize = parseFloat(defaultFontSize)+"em"; }
	var checkFontSize = (Math.round(12*parseFloat(objFontSize))+(a*2))/12;
	if (checkFontSize >= maxFontSize) { checkFontSize = maxFontSize; obj.style.fontSize = checkFontSize+"em"; alert("You cannot enlarge the image any further."); }
	else if (checkFontSize <= minFontSize) { checkFontSize = minFontSize; obj.style.fontSize = checkFontSize+"em"; alert("You cannot reduce the image any further ."); }
	else { obj.style.fontSize = checkFontSize+"em"; }
//	alert(checkFontSize);
}


//글자크기_일문
//ex) onclick="setFontSize(+1);"	 onclick="setFontSize(-1);"
function setFontSize_jap(a) {
	var defaultFontSize = 1;//em
	var minFontSize = 1;//em
	var maxFontSize = 2;//em
	obj = document.getElementById("body_content");//확대축소영역
	var objFontSize = obj.style.fontSize;
	if (!objFontSize) { objFontSize = parseFloat(defaultFontSize)+"em"; }
	var checkFontSize = (Math.round(12*parseFloat(objFontSize))+(a*2))/12;
	if (checkFontSize >= maxFontSize) { checkFontSize = maxFontSize; obj.style.fontSize = checkFontSize+"em"; alert("これ以上大きくできません。"); }
	else if (checkFontSize <= minFontSize) { checkFontSize = minFontSize; obj.style.fontSize = checkFontSize+"em"; alert("これ以上小さくできません。"); }
	else { obj.style.fontSize = checkFontSize+"em"; }
//	alert(checkFontSize);
}

function setFontSize_index_jap(a) {
	var defaultFontSize = 1;//em
	var minFontSize = 1;//em
	var maxFontSize = 2;//em
	obj = document.getElementById("main_contents");//확대축소영역
	var objFontSize = obj.style.fontSize;
	if (!objFontSize) { objFontSize = parseFloat(defaultFontSize)+"em"; }
	var checkFontSize = (Math.round(12*parseFloat(objFontSize))+(a*2))/12;
	if (checkFontSize >= maxFontSize) { checkFontSize = maxFontSize; obj.style.fontSize = checkFontSize+"em"; alert("これ以上大きくできません。"); }
	else if (checkFontSize <= minFontSize) { checkFontSize = minFontSize; obj.style.fontSize = checkFontSize+"em"; alert("これ以上小さくできません。"); }
	else { obj.style.fontSize = checkFontSize+"em"; }
//	alert(checkFontSize);
}


//글자크기_중문
//ex) onclick="setFontSize(+1);"	 onclick="setFontSize(-1);"
function setFontSize_chi(a) {
	var defaultFontSize = 1;//em
	var minFontSize = 1;//em
	var maxFontSize = 2;//em
	obj = document.getElementById("body_content");//확대축소영역
	var objFontSize = obj.style.fontSize;
	if (!objFontSize) { objFontSize = parseFloat(defaultFontSize)+"em"; }
	var checkFontSize = (Math.round(12*parseFloat(objFontSize))+(a*2))/12;
	if (checkFontSize >= maxFontSize) { checkFontSize = maxFontSize; obj.style.fontSize = checkFontSize+"em"; alert("无法再扩大。"); }
	else if (checkFontSize <= minFontSize) { checkFontSize = minFontSize; obj.style.fontSize = checkFontSize+"em"; alert("无法再缩小。"); }
	else { obj.style.fontSize = checkFontSize+"em"; }
//	alert(checkFontSize);
}

function setFontSize_index_chi(a) {
	var defaultFontSize = 1;//em
	var minFontSize = 1;//em
	var maxFontSize = 2;//em
	obj = document.getElementById("main_contents");//확대축소영역
	var objFontSize = obj.style.fontSize;
	if (!objFontSize) { objFontSize = parseFloat(defaultFontSize)+"em"; }
	var checkFontSize = (Math.round(12*parseFloat(objFontSize))+(a*2))/12;
	if (checkFontSize >= maxFontSize) { checkFontSize = maxFontSize; obj.style.fontSize = checkFontSize+"em"; alert("无法再扩大。"); }
	else if (checkFontSize <= minFontSize) { checkFontSize = minFontSize; obj.style.fontSize = checkFontSize+"em"; alert("无法再缩小。"); }
	else { obj.style.fontSize = checkFontSize+"em"; }
//	alert(checkFontSize);
}

//글자크기_작가갤러리
function setFontSize_gallery(a) {
	var defaultFontSize = 1;//em
	var minFontSize = 1;//em
	var maxFontSize = 2;//em
	obj = document.getElementById("gallery_contents");//확대축소영역
	var objFontSize = obj.style.fontSize;
	if (!objFontSize) { objFontSize = parseFloat(defaultFontSize)+"em"; }
	var checkFontSize = (Math.round(12*parseFloat(objFontSize))+(a*2))/12;
	if (checkFontSize >= maxFontSize) { checkFontSize = maxFontSize; obj.style.fontSize = checkFontSize+"em"; alert("더이상 늘릴 수 없습니다."); }
	else if (checkFontSize <= minFontSize) { checkFontSize = minFontSize; obj.style.fontSize = checkFontSize+"em"; alert("더이상 줄일 수 없습니다."); }
	else { obj.style.fontSize = checkFontSize+"em"; }
//	alert(checkFontSize);
}


//input 버튼 
function MM_jumpMenu00(targ,selObj,restore){ //v3.0
                                    win = window.open(selObj.options[selObj.selectedIndex].value, targ);
                                    if (restore) selObj.selectedIndex=0;
                                  }
                                  	function goSelect(form,target) {
	var myindex=form.uri.selectedIndex
	myUri = form.uri.options[myindex].value;
	if(myUri!="") { window.open(myUri,target); }
}
                                  function go_select_person(person_value)
                                  {
                                    location.href = person_value;
                                  }
								  function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

var num=0;
var value=false;

function checkbox_go(){
 num++;
  value = false;
 for(i=0; i<mymenu.length; i++){
  mymenu[i].checked = value;
 }
}

function changeKwa2(){
	var cKwa01Code2 = document.getElementById("cKwa01Code2");
	if (cKwa01Code2[cKwa01Code2.selectedIndex].value != "") {

	   window.open("/program/publicsil/default.asp?Kwa01Code=" + cKwa01Code2[cKwa01Code2.selectedIndex].value,"_blank" )

	}
}                              



// 플로터
//ex) JSFX_FloatDiv("wing",880,143).floatIt(); //플로터 객체 아래에 삽입
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
function JSFX_FloatDiv(id, sx, sy)
{
	var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
	var px = document.layers ? "" : "px";
	window[id + "_obj"] = el;
	if(d.layers)el.style=el;
	el.cx = el.sx = sx;el.cy = el.sy = sy;
	el.sP=function(x,y){this.style.left=x+px;this.style.top=y+px;};

	el.floatIt=function()
	{
		var pX, pY;
		pX = (this.sx >= 0) ? 0 : ns ? innerWidth : 
		document.documentElement && document.documentElement.clientWidth ? 
		document.documentElement.clientWidth : document.body.clientWidth;
		pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ? 
		document.documentElement.scrollTop : document.body.scrollTop;
		if(this.sy<0) 
		pY += ns ? innerHeight : document.documentElement && document.documentElement.clientHeight ? 
		document.documentElement.clientHeight : document.body.clientHeight;
		this.cx += (pX + this.sx - this.cx)/8;this.cy += (pY + this.sy - this.cy)/8;
		this.sP(this.cx, this.cy);
		setTimeout(this.id + "_obj.floatIt()", 40);
	}
	return el;
}


// 플로터 - 범위제한
//ex) initMoving("idname",884,500);
function initMoving(id,xleft,ytop) {
	target = document.getElementById(id);
	if (!target) return false;
	var obj = target;
	obj.initLeft = xleft;//절대좌표x
	obj.initTop = ytop;//절대좌표y
	obj.bottomLimit = document.documentElement.scrollHeight - 500;
	obj.topLimit = 160;

	obj.style.position = "absolute";
	obj.top = obj.initTop;
	obj.left = obj.initLeft;
	obj.style.top = obj.top + "px";
	obj.style.left = obj.left + "px";

	obj.getTop = function() {
		if (document.documentElement.scrollTop) {
			return document.documentElement.scrollTop;
		} else if (window.pageYOffset) {
			return window.pageYOffset;
		} else {
			return 0;
		}
	}
	obj.getHeight = function() {
		if (self.innerHeight) {
			return self.innerHeight;
		} else if(document.documentElement.clientHeight) {
			return document.documentElement.clientHeight;
		} else {
			return 0;
		}
	}
	obj.move = setInterval(function() {
		pos = obj.getTop() + obj.getHeight() / 2 - 15;

		if (pos > obj.bottomLimit)
			pos = obj.bottomLimit
		if (pos < obj.topLimit)
			pos = obj.topLimit

		interval = obj.top - pos;
		obj.top = obj.top - interval / 3;
		obj.style.top = obj.top + "px";
	}, 40)
}

// 고객센터 (FAQ메뉴부분)
function showBx(id)
{
    var bx = document.getElementById(id);
    if (bx.style.display == 'block')  //		|| bx.style.display == ''  <== 이걸 사용하는 대신 자스 이름 바꾸기
    {
        bx.style.display='none';
    }
    else
    {
        bx.style.display='block';
    }
}





//tab
var save_src = new Array;
function tab(id){	
	tab = jQuery("#"+id);	
	jQuery(tab).find(">li>div").hide();
	jQuery(tab).find(">li>div:eq(0)").show();
	jQuery(tab).find(">li>div").css({"position":"absolute","left":"0","top":"20px","width":"307px"});
	jQuery(tab).find(">li").css({"float":"left"});
	jQuery(tab).find(">li>a>img").attr("rel","ov");
	jQuery(tab).find(">li").hover(tab_show,tab_show);
	jQuery(tab).find(">li").hover(tab_img_ov,tab_img_ov);
	jQuery(tab).find(">li>a").each(function(n){
		jQuery(tab).find(">li>a")[n].onfocus = tab_img_ov_key;
		save_src[n] = jQuery(tab).find(">li>a>img")[n].src;
	});	
	tab_ov();
}

function tab_ov(){
	var ori_img = jQuery(tab).find(">li>a>img:eq(0)")[0].src;		
	var img_src = ori_img.split("/");
	var imgName = img_src[img_src.length-1];
	var imgName = imgName.split(".");
	var name = imgName[imgName.length-2];
	var type = imgName[imgName.length-1];
	name = name.replace("_ov","");
	var ov_img ='';
	
	for(i=0;i<img_src.length; i++)
	{2009-09-26
		if(i<(img_src.length-1)){ov_img += img_src[i]+"/";}		
	}	
	ov_img += name+"_ov."+ type;
	
	//이미지오버값
	jQuery(tab).find(">li>a>img:eq(0)")[0].src = ov_img;
}

function tab_show(){
	jQuery(tab).find(">li>div").hide();
	jQuery(this)[jQuery(this).find(">div:hidden").show()];		
}

function tab_img_ov() {	
	//alert(jQuery(this)[0].tagName);
	jQuery(tab).find(">li>a>img").not("rel*=no_ov").removeAttr("rel");				
	jQuery(this)[jQuery(this).find(">a>img").attr("rel","ov")];		
	
	var menu_length = jQuery(tab).find(">li>a>img").length;
	var ori_img = jQuery(tab).find(">li>a>img[rel*=ov]")[0].src;				
	var img_src = ori_img.split("/");
	var imgName = img_src[img_src.length-1];
	var imgName = imgName.split(".");
	var name = imgName[imgName.length-2];
	var type = imgName[imgName.length-1];
	name = name.replace("_ov","");
	var ov_img ='';
	
	for(s=0;s<menu_length; s++){jQuery(tab).find(">li>a>img")[s].src = save_src[s];}
	for(i=0;i<img_src.length; i++){if(i<(img_src.length-1)){ov_img += img_src[i]+"/";}}	
		
	ov_img += name+"_ov."+ type;
	//이미지오버값
	jQuery(this).find(">a>img").not("rel*=no_ov")[0].src = ov_img;
}

function tab_img_ov_key() {	
	jQuery(tab).find(">li>div").hide();
	jQuery(this).parent()[jQuery(this).parent().find(">div:hidden").show()];
		
			
	jQuery(tab).find(">li>a>img").not("rel*=no_ov").removeAttr("rel");				
	jQuery(this)[jQuery(this).find(">img").attr("rel","ov")];		
	
	var menu_length = jQuery(tab).find(">li>a>img").length;
	var ori_img = jQuery(tab).find(">li>a>img[rel*=ov]")[0].src;				
	var img_src = ori_img.split("/");
	var imgName = img_src[img_src.length-1];
	var imgName = imgName.split(".");
	var name = imgName[imgName.length-2];
	var type = imgName[imgName.length-1];
	name = name.replace("_ov","");
	var ov_img ='';
	
	for(s=0;s<menu_length; s++){jQuery(tab).find(">li>a>img")[s].src = save_src[s];}
	for(i=0;i<img_src.length; i++){if(i<(img_src.length-1)){ov_img += img_src[i]+"/";}}	
		
	ov_img += name+"_ov."+ type;
	
	//이미지오버값	
	jQuery(this).find(">img").not("rel*=no_ov")[0].src = ov_img;
}


/* 이미지갤러리 */
function showPic(whichpic) {
  if (!document.getElementById("placeholder")) return true;
  var source = whichpic.getAttribute("href");
  var placeholder = document.getElementById("placeholder");
  placeholder.setAttribute("src",source);
  return false;
}

function prepareGallery() {
  if (!document.getElementsByTagName) return false;
  if (!document.getElementById) return false;
  if (!document.getElementById("imagegallery")) return false;
  var gallery = document.getElementById("imagegallery");
  var links = gallery.getElementsByTagName("a");
  for ( var i=0; i < links.length; i++) {
    links[i].onclick = function() {
      return showPic(this);
	}
    links[i].onkeypress = links[i].onclick;
  }
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

addLoadEvent(prepareGallery);



/* 편의시설,대관안내 */
var main_sub_box1_photo_num = 0;
function main_sub_box1(){
	jQuery(".main_sub_box1_photo > img").hide();
	jQuery(".main_sub_box1_photo > img").eq(0).show();
	jQuery('<div class="main_sub_count">(<strong>1</strong>/'+jQuery(".main_sub_box1_photo > img").length+')</div>').insertAfter(jQuery(".main_sub_box2"));
	jQuery(".main_sub_box2 > div").hide();
	jQuery(".main_sub_box2 > div").eq(0).show();
	
	
	jQuery(".main_sub_box1 > a").eq(0).click(function() {main_sub_box1_show(1); return false;});
	jQuery(".main_sub_box1 > a").eq(1).click(function() {main_sub_box1_show(2); return false;});
			
	jQuery(".main_sub_box3 > a").eq(0).click(function() {main_sub_box3_move(1); return false;});
	jQuery(".main_sub_box3 > a").eq(1).click(function() {main_sub_box3_move(2); return false;});
	
	
	jQuery(".main_sub_box3_photo_move > a > img").eq(0).css({"width":"59px","height":"48","border":"3px solid #ff750f"});	
}
function main_sub_box1_show(data){
	var list_tot = jQuery(".main_sub_box1_photo > img").length;
	
	if(data == 1){
		if(main_sub_box1_photo_num < 0 || main_sub_box1_photo_num == 0){
			
		} else {
			main_sub_box1_photo_num--;
			main_sub_box3_move(2);
		}
	} else if(data == 2) {
		if(main_sub_box1_photo_num > list_tot-2){
				
		} else {
			main_sub_box1_photo_num++;
			main_sub_box3_move(1);
		}
	}
	jQuery(".main_sub_box1_photo > img").hide();
	jQuery(".main_sub_box1_photo > img").eq(main_sub_box1_photo_num).fadeIn(1000);
	jQuery(".main_sub_box2 > div").hide();
	jQuery(".main_sub_box2 > div").eq(main_sub_box1_photo_num).fadeIn(1000);
	jQuery(".main_sub_box3_photo_move > a > img").css({"width":"65px","height":"54","border":"none"});
	jQuery(".main_sub_box3_photo_move > a > img").eq(main_sub_box1_photo_num).css({"width":"59px","height":"48","border":"3px solid #ff750f"});	
	jQuery(".main_sub_count").html('(<strong>'+(main_sub_box1_photo_num+1)+'</strong>/'+jQuery(".main_sub_box1_photo > img").length+')');
}
var main_sub_box3_photo_num=0;
function main_sub_box3_move(data){
	var tot = jQuery(".main_sub_box3_photo_move a > img").length * 68;
	tot2 = (tot - 544)*-1;
	if(tot2 < 0)
	{
	if(data == 1){
		if(jQuery(".main_sub_box3_photo_move").position().left > tot2)
		{
			main_sub_box3_photo_num -=68;
		} else {			
			main_sub_box3_photo_num = tot2;
		}		
	} else if(data == 2) {
		if(jQuery(".main_sub_box3_photo_move").position().left < 0)
		{
			main_sub_box3_photo_num +=68;
		} else {			
			main_sub_box3_photo_num = 0;	
		}
	}
	
	jQuery(".main_sub_box3_photo_move").animate(
	{
		left:main_sub_box3_photo_num
	},200
	);
	}
			
}

function main_sub_box3_show(data){
	main_sub_box1_photo_num = data-1;
	jQuery(".main_sub_box1_photo > img").hide();
	jQuery(".main_sub_box1_photo > img").eq(main_sub_box1_photo_num).fadeIn(1000);
	jQuery(".main_sub_box2 > div").hide();
	jQuery(".main_sub_box2 > div").eq(main_sub_box1_photo_num).fadeIn(1000);
	
	jQuery(".main_sub_count").html('(<strong>'+(main_sub_box1_photo_num+1)+'</strong>/'+jQuery(".main_sub_box1_photo > img").length+')');
	jQuery(".main_sub_box3_photo_move > a > img").css({"width":"65px","height":"54","border":"none"});
	jQuery(".main_sub_box3_photo_move > a > img").eq(main_sub_box1_photo_num).css({"width":"59px","height":"48","border":"3px solid #ff750f"});
}


function openwin(code,linkurl,width,height,scroll)
{		
	/*** 팝업 창 화면 중앙에 오픈시키기**/
	
	if ( getCookie(code) != "done" )	{
	    var str;
	    
	    str = "height=" + height + ",innerHeight=" + height;
	    str += ",width=" + width + ",innerWidth=" + width;
	    if(scroll==1) str += ",scrollbars=yes";
	
	    if (window.screen) {
	        var ah = screen.availHeight - 30;
	        var aw = screen.availWidth - 10;
	        var xc = (aw - width) / 2;
	        var yc = (ah - height) / 2;
	
	        str += ",left=" + xc + ",screenX=" + xc;
	        str += ",top=" + yc + ",screenY=" + yc;

	    }
		//팝업이 없을시 아래 2줄 앞부분을 "//"으로 가려줌
	    noticeWindow = window.open(linkurl, code , str);
	    //noticeWindow.opener = self;
	    noticeWindow.focus();
	}
}

function openwin1(code,linkurl,width,height,scroll)
{		
	/*** 팝업 창 화면 중앙에 오픈시키기**/
	
	if ( getCookie(code) != "done" )	{
	    var str;
	    
	    str = "height=" + height + ",innerHeight=" + height;
	    str += ",width=" + width + ",innerWidth=" + width;
	    if(scroll==1) str += ",scrollbars=yes";
	
	    if (window.screen) {
	        var ah = screen.availHeight - 30;
	        var aw = screen.availWidth - 10;
	        var xc = (aw - width) / 2;
	        var yc = (ah - height) / 2;
	
	        str += ",left=" + xc + ",screenX=" + xc;
	        str += ",top=" + yc + ",screenY=" + yc;

	    }
		//팝업이 없을시 아래 2줄 앞부분을 "//"으로 가려줌
	    noticeWindow = window.open(linkurl, code , str);
	    //noticeWindow.opener = self;
	    noticeWindow.focus();
	}
}


function openwin2(code,linkurl,width,height,top,left,scroll)
{		

	if ( getCookie(code) != "done" )
	{
		 //팝업이 없을시 아래 2줄 앞부분을 "//"으로 가려줌
		
		str = "scrollbars=yes,width=" + width +", height="+ height +", top="+ top +", left=" + left;
		
		if(scroll==1) str += ",scrollbars=yes";
		else  str += ",scrollbars=no";
		noticeWindow = window.open(linkurl, code , str);
		
		//noticeWindow.opener = self;
	}
}



/*** 팝업 창 화면 닫기**/
function notice_setCookie(name, value, expiredays){
  var todayDate = new Date();
  todayDate.setDate(todayDate.getDate() + expiredays);
  document.cookie = name + "=" + escape(value) + "; path=/; expires = " + todayDate.toGMTString() + ";"
 }
function notice_closeWin(){
	notice_setCookie("netsoft","done",1);
	window.close(this);
}

// Tab Content
	function initTabMenu(tabContainerID) {
		var tabContainer = document.getElementById(tabContainerID);
		var tabAnchor = tabContainer.getElementsByTagName("a");
		var i = 0;
	
		for(i=0; i<tabAnchor.length; i++) {
			if (tabAnchor.item(i).className == "tabbtn")
				thismenu = tabAnchor.item(i);
			else
				continue;
	
			thismenu.container = tabContainer;
			thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
			thismenu.targetEl.style.display = "none";
			thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);
			thismenu.onclick = function tabMenuClick() {
				currentmenu = this.container.current;
				if (currentmenu == this)
					return false;
	
				if (currentmenu) {
					currentmenu.targetEl.style.display = "none";
					if (currentmenu.imgEl) {
						currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_on.gif", "_off.gif");						
					} else {
						currentmenu.className = currentmenu.className.replace(" on", "");						
					}
				}
				this.targetEl.style.display = "block";
				if (this.imgEl) {
					this.imgEl.src = this.imgEl.src.replace("_off.gif", "_on.gif");					
				} else {
					this.className += " on";					
				}
				this.container.current = this;
	
				return false;
			};
	
			if (!thismenu.container.first)
				thismenu.container.first = thismenu;
		}
		if (tabContainer.first)
			tabContainer.first.onclick();
}

// Tab Content
	function initTabMenu2(tabContainerID) {
		var tabContainer = document.getElementById(tabContainerID);
		var tabAnchor = tabContainer.getElementsByTagName("a");
		var i = 0;
	
		for(i=0; i<tabAnchor.length; i++) {
			if (tabAnchor.item(i).className == "tabbtn")
				thismenu = tabAnchor.item(i);
			else
				continue;
	
			thismenu.container = tabContainer;
			thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
			thismenu.targetEl.style.display = "none";
			thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);
			thismenu.onclick = function tabMenuClick() {
				currentmenu = this.container.current;
				if (currentmenu == this)
					return false;
	
				if (currentmenu) {
					currentmenu.targetEl.style.display = "none";
					if (currentmenu.imgEl) {
						currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_on.gif", "_off.gif");						
					} else {
						currentmenu.className = currentmenu.className.replace(" on", "");						
					}
				}
				this.targetEl.style.display = "block";
				if (this.imgEl) {
					this.imgEl.src = this.imgEl.src.replace("_off.gif", "_on.gif");					
				} else {
					this.className += " on";					
				}
				this.container.current = this;
	
				return false;
			};
	
			if (!thismenu.container.first)
				thismenu.container.first = thismenu;
		}
		if (tabContainer.first)
			tabContainer.first.onclick();
}


// Tab Content
	function initTabMenu3(tabContainerID) {
		var tabContainer = document.getElementById(tabContainerID);
		var tabAnchor = tabContainer.getElementsByTagName("a");
		var i = 0;
	
		for(i=0; i<tabAnchor.length; i++) {
			if (tabAnchor.item(i).className == "tabbtn")
				thismenu = tabAnchor.item(i);
			else
				continue;
	
			thismenu.container = tabContainer;
			thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
			thismenu.targetEl.style.display = "none";
			thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);
			thismenu.onclick = function tabMenuClick() {
				currentmenu = this.container.current;
				if (currentmenu == this)
					return false;
	
				if (currentmenu) {
					currentmenu.targetEl.style.display = "none";
					if (currentmenu.imgEl) {
						currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_on.gif", "_off.gif");						
					} else {
						currentmenu.className = currentmenu.className.replace(" on", "");						
					}
				}
				this.targetEl.style.display = "block";
				if (this.imgEl) {
					this.imgEl.src = this.imgEl.src.replace("_off.gif", "_on.gif");					
				} else {
					this.className += " on";					
				}
				this.container.current = this;
	
				return false;
			};
	
			if (!thismenu.container.first)
				thismenu.container.first = thismenu;
		}
		if (tabContainer.first)
			tabContainer.first.onclick();
}





//브라우저 별 키값 검사 ** 오시는길 프린트버튼 **//
function validateKey(e) {
	var keynum;
	var ismouseClick = 1;

	if (window.event) { //IE & Safari
		keynum = e.keyCode;
		//Safari의 경우 마우스클릭은 keynum 0 이 넘어옴
		if (keynum == 0){
			ismouseClick = 0;
		}
	}
		else if ( e.which ){ // Netscape/Firefox/Opera
		keynum = e.which;

		if (keynum == 1) {
			ismouseClick = 0;
		}
	}
	//마우스 클릭이거나 엔터키를 누른경우 true값 반환
	if ( ismouseClick == 0 || keynum == 13 ) {
		return true;
	}
	else{
		return false;
	}
}



// 팝업창 리사이즈 스크롤 금지 ** 오시는길 프린트버튼 **//
function popWin1(uri, nm, w, h, bars){
	var width = w;
	var height =h;
	var strUri = uri;
	var x, y;
	var screen_width  = screen.width;
	var screen_height = screen.height;
	x = (screen_width  / 2) - (width  / 2);
	y = (screen_height / 2) - (height / 2);
	var owin = window.open ( strUri,nm,"width=" + width + ", height=" + height + ", left=" + x + ", top=" + y + ", toolbar=no, status=no, menubar=no, scrollbars=no, resizable=no");
	owin.focus();
}

function popWin(uri, nm, w, h, bars){
	var width = w;
	var height =h;
	var strUri = uri;
	var x, y;
	var screen_width  = screen.width;
	var screen_height = screen.height;
	x = (screen_width  / 2) - (width  / 2);
	y = (screen_height / 2) - (height / 2);
	var owin = window.open ( strUri,nm,"width=" + width + ", height=" + height + ", left=" + x + ", top=" + y + ", toolbar=no, status=no, menubar=no, scrollbars="+ bars +", resizable=yes");
	owin.focus();
}



function hideImage(whichid){
	var pix=document.getElementById(whichid).getElementsByTagName('img');

	for (i=0; i<pix.length; i++) {
		pix[i].style.display = "none";
	}
}


function jsIntroOffice(pUrl,ev){
			if(validateKey(ev)){
				var objPop = window.open(pUrl,"mapWin","width=640,height=600,scrollbars=yes")
				objPop.focus();

				return false;
			}
		}

		function jsViewMap(pUrl,ev){
			if(validateKey(ev)){
				var objPop = window.open(pUrl,"viewMap","width=640,height=600,scrollbars=yes")
				objPop.focus();

				return false;
			}
		}

		function viewMap(src, e){
			if(validateKey(e)){
				popWin(src, "map", 640, 600, "yes");
				return false;
			}
}


//작가갤러리 팝업
function jsIntroOffice2(pUrl,ev){
			if(validateKey(ev)){
				var objPop = window.open(pUrl,"mapWin2","width=488,height=320,scrollbars=yes")
				objPop.focus();

				return false;
			}
		}

		function jsViewMap2(pUrl,ev){
			if(validateKey(ev)){
				var objPop = window.open(pUrl,"viewMap2","width=488,height=320,scrollbars=no")
				objPop.focus();

				return false;
			}
		}

		function viewMap2(src, e){
			if(validateKey(e)){
				popWin(src, "map2", 488, 320, "no");
				return false;
			}
}



//토야애니메이션 팝업
function jsIntroOffice3(pUrl,ev){
			if(validateKey(ev)){
				var objPop = window.open(pUrl,"mapWin3","width=400,height=300,scrollbars=no")
				objPop.focus();

				return false;
			}
		}

		function jsViewMap3(pUrl,ev){
			if(validateKey(ev)){
				var objPop = window.open(pUrl,"viewMap3","width=400,height=300,scrollbars=no")
				objPop.focus();

				return false;
			}
		}

		function viewMap3(src, e){
			if(validateKey(e)){
				popWin(src, "map3", 400, 300, "no");
				return false;
			}
}




function setPng24(obj) { 
  obj.width=obj.height=1; 
  obj.className=obj.className.replace(/\bpng24\b/i,''); 
  obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');" 
  obj.src='';  
  return ''; 
}






//이미지롤오버함수할당
//ex) initImgRoll("containerId");
function initImgRoll(containerId) { 
 	imgEl = document.getElementById(containerId).getElementsByTagName("img");
	for (i=0; i<imgEl.length; i++) {
		var menuImg = imgEl[i]
		var where = menuImg.src.indexOf("on.gif",0)
		if (where==-1) {
				menuImg.onmouseover = menuOver;
				menuImg.onmouseout = menuOut;
		}
	}
}


