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.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

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);


function MM_showHideLayers() { //v3.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; }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

// gallery
/**
 * ÀÌ¹ÌÁö ¸®»çÀÌÁî
 */
function resizeImage(image, size){
    if (image.width > size ) {
        image.width = size
    }
}

/**
 * ÀÌ¹ÌÁö ºä¾î
 */
function imageView(what) {
        var imgwin = window.open("",'PFImageViewer','scrollbars=yes,status=no,toolbar=no,resizable=yes,location=no,menu=no,width=10,height=10');
        imgwin.focus();
        imgwin.document.open();
        imgwin.document.write("<html>\n");
        imgwin.document.write("<html>\n");
        imgwin.document.write("<head>\n");
        imgwin.document.write("<title>µ¿¹°±¸Á¶ÇùÈ¸ - ImageViewer</title>\n");
        imgwin.document.write("<sc"+"ript language='javascript'>\n");
        imgwin.document.write("    function resize() {\n");
        imgwin.document.write("        pic = document.image;\n");
        imgwin.document.write("        if (eval(pic).height) {\n");
        imgwin.document.write("            var name = navigator.appName;\n");
        imgwin.document.write("            if (name == 'Microsoft Internet Explorer') {\n");
        imgwin.document.write("                myHeight = eval(pic).height + 30;\n");
        imgwin.document.write("                myWidth = eval(pic).width+ 10;\n");
        imgwin.document.write("            } else {\n");
        imgwin.document.write("                myHeight = eval(pic).height + 9;\n");
        imgwin.document.write("                myWidth = eval(pic).width;\n");
        imgwin.document.write("            }\n");
        imgwin.document.write("            var heightPic = pic.height;\n");
        imgwin.document.write("            var widthPic = pic.width;\n");
        imgwin.document.write("            if (widthPic <= 1024 && heightPic <= 768){\n");
        imgwin.document.write("                self.resizeTo(myWidth, myHeight);\n");
        imgwin.document.write("                self.moveTo(80,80);\n");
        imgwin.document.write("                document.body.style.overflow='hidden';\n");
        imgwin.document.write("            } else {\n");
        imgwin.document.write("                if (widthPic > 1024 && heightPic <= 768) {\n");
        imgwin.document.write("                    self.resizeTo(1024, myHeight+20);\n");
        imgwin.document.write("                    self.moveTo(80,80);\n");
        imgwin.document.write("                } else if (widthPic <= 1024 && heightPic > 768) {\n");
        imgwin.document.write("                    self.resizeTo(myWidth+20, 768);\n");
        imgwin.document.write("                    self.moveTo(80,80);\n");
        imgwin.document.write("                } else {\n");
        imgwin.document.write("                    self.resizeTo(1024, 768);\n");
        imgwin.document.write("                    self.moveTo(80,80);\n");
        imgwin.document.write("                }\n");
        imgwin.document.write("            }\n");
        imgwin.document.write("        } else setTimeOut(resize(), 100);\n");
        imgwin.document.write("}\n");
        imgwin.document.write("</sc"+"ript>\n");
        imgwin.document.write("</head>\n");
        imgwin.document.write("<body bgcolor='#FFFFFF' style='margin:0'>\n");
        imgwin.document.write("<div align='center' valign='middle'><a href='javascript:self.close()' onfocus='this.blur()'><img border='0' src='"+what+"' xwidth='10' xheight='9' name='image' onload='resize();'></a></div>\n");
        imgwin.document.write("</body>\n");
        imgwin.document.write("</html>\n");
        imgwin.document.close();
}


var omitformtags=["input", "textarea", "select"]

omitformtags=omitformtags.join("|")

function disableselect(e){
if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
return false
}

function reEnable(){
return true
}

if (typeof document.onselectstart!="undefined")
document.onselectstart=new Function ("return false")
else{
document.onmousedown=disableselect
document.onmouseup=reEnable
}




function swfinc(p,w,h){
	document.write(" <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='"+w+"' height='"+h+"'> ");
	document.write(" <param name='movie' value='"+p+"'> ");
	document.write(" <param name='quality' value='high'> ");
	document.write(" <embed src='"+p+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+w+"' height='"+h+"'></embed> ");
	document.write(" </object> ");
}


