

//1. menu rollover
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_swapImage1() { //v3.0
  var i,j=0,x,a=MM_swapImage1.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 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_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 MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}



//2. hidden layer
function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
	if ((obj=MM_findObj(args[i]))!=null) { 
		v=args[i+2];
		if (obj.style) { 
			obj=obj.style; 
			v=(v=='show')?'visible':(v=='hide')?'hidden':v; 
		}
		obj.visibility=v; 
	}

}





//3. dotline delete
function bluring(){ 
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus(); 
} 
document.onfocusin=bluring; 






//4. image width resize

fix_w = 600; // 고정할 크기 (픽셀 단위)
function resize(i) {
        if (i.width > fix_w) {
                i.width = fix_w;
                i.style.cursor = "pointer";
        }
}






//5. flash_menu
function flashmenu(file,width,height,bgcolor,name,salign) {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+width+'" height="'+height+'" id="'+name+'">'
	+ '<param name="movie" value="'+file+'" />'
	+ '<param name="quality" value="best" />'
	+ '<param name="wmode" value="transparent" />'
    + '<PARAM NAME="SCALE" VALUE="noscale" />'
	+ '<param name="bgcolor" value="'+bgcolor+'" />'
	+ '<PARAM NAME="salign" VALUE="'+salign+'"/ >'
	+ '<param name="menu" value="false" />'
	+ '<param name="AllowScriptAccess" value="always" />'
	+ '<embed src="'+file+'" quality="high" wmode="transparent" bgcolor="'+bgcolor+'" SCALE="noscale" width="'+width+'" height="'+height+'" name="'+name+'" menu="false" AllowScriptAccess="always" type="application/x-shockwave-flash" salign="'+salign+'" pluginspage="http://www.macromedia.com/go/getflashplayer" />'
	+ '</object>');
}


function avimenu(file, width , start) {
	document.write('<embed src="'+file+'" width="'+width+'" autostart="'+start+'" /></embed>');
}




//6. png transparent

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 ''; 
} 


//7. resize
/*
function reSize() {
	try{
	var objBody = ifrm.document.body;
	var objFrame = document.all["ifrm"];
	ifrmHeight = objBody.scrollHeight + (objBody.offsetHeight - objBody.clientHeight);
	
	if (ifrmHeight > 10) {
			objFrame.style.height = ifrmHeight
	}else{
			objFrame.style.height = 10;
	}
	objFrame.style.width = '100%'
	}catch(e){}
}
*/


function getDocHeight(doc)
{
  var docHt = 0, sh, oh;
  if (doc.height)
  {
    docHt = doc.height;
  }
  else if (doc.body)
  {
    if (doc.body.scrollHeight) docHt = sh = doc.body.scrollHeight;
    if (doc.body.offsetHeight) docHt = oh = doc.body.offsetHeight;
    if (sh && oh) docHt = Math.max(sh, oh);
  }
  return docHt;
}

function reSize()
{
	try{
	  var iframeWin = window.frames['ifrm'];

	  var iframeEl = window.document.getElementById? window.document.getElementById('ifrm'): document.all? document.all['ifrm']: null;

	  if ( iframeEl && iframeWin )
	  {
		var docHt = getDocHeight(iframeWin.document);

		if (docHt != iframeEl.style.height) iframeEl.style.height = docHt + 'px';
	  }
	  else
	  { // firefox
		var docHt = window.document.getElementById('ifrm').contentDocument.height;
		window.document.getElementById('ifrm').style.height = docHt + 'px';
	  }

  }catch(e){}

}


function init_iframe() {
        reSize();
        setTimeout('init_iframe()',0)
}

//init_iframe();
if ( window.addEventListener ) { window.addEventListener("load" , init_iframe ,false); }
else if ( window.attachEvent ) { window.attachEvent("onload"    , init_iframe);        }



function reSize2() {
        try{
        var objBody = main_iframe.document.body;
        var objFrame = document.all["main_iframe"];
        ifrmHeight = objBody.scrollHeight + (objBody.offsetHeight - objBody.clientHeight);
        
        if (ifrmHeight > 10) {
                objFrame.style.height = ifrmHeight
        }else{
                objFrame.style.height = 10;
        }
        objFrame.style.width = '100%'
        }catch(e){}
}
function init_iframe2() {
        reSize2();
        setTimeout('init_iframe2()',0)
}
init_iframe2();



function fnLayerShow(){
    var objLayer = document.getElementById("notice");
    var objLayerContents = document.getElementById("Layer-Contents");
    objLayer.style.display = "block";

 

    //ie6에서 셀렉트 박스 위로 보이기
    if(navigator.userAgent.indexOf("MSIE 6")>-1 && navigator.userAgent.indexOf("MSIE 7")<0){
        if (!document.getElementById("IE6Iframe")){
            var ie6_ifm = document.createElement("iframe"); //iframe 생성
            ie6_ifm.setAttribute("id","IE6Iframe"); //id값 부여
            ie6_ifm.style.position = "absolute";
            ie6_ifm.style.opacity = "0"; //투명도 0
            ie6_ifm.style.filter = "alpha(opacity=0)"; //투명도 0
            ie6_ifm.style.zindex = "-1";
            ie6_ifm.style.left = "0";
            ie6_ifm.style.top = "0";
            ie6_ifm.style.width = objLayerContents.offsetWidth; //레이어 너비
            ie6_ifm.style.height = objLayerContents.offsetHeight; //레이어 높이
            objLayer.appendChild(ie6_ifm); //Layer 오브젝트에 iframe 삽입
        }
    }
}

 

function fnLayerClose(){
    var objLayer = document.getElementById("Layer");
    objLayer.style.display = "none";
}


function dayClose(){
	var form = document.forms['popClose'];
	var no_count = 0;
	for(i=0; i < form.elements.length; i++){
		if(form.elements[i].name == "popcheck[]"){
			if(form.elements[i].checked == true){
				no_count++;
			}
		}
	}

	if(no_count == 0){
		//alert('선택된 항목이 없습니다');
		document.getElementById("notice").style.display='none'		// close
		return;
	}else{
		
		var expdate = new Date();
		expdate.setTime(expdate.getTime() + 1000 * 3600 * 24 * 1);	// expire 1 day
		setCookie2("notice", "1", expdate);

		document.getElementById("notice").style.display='none'		// cookie & close
	}

}








//레이어팝업
function setcookie( name, value, expirehours ) {
var todayDate = new Date();
todayDate.setHours( todayDate.getHours() + expirehours );
document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}

function closeWin() {
if ( document.notice_form.chkbox.checked ){
setcookie( "maindiv", "done" , 24 );
}

document.all['event'].style.display = "none";

}

