function showFlash(flaFile, widths, heights, btrans) { 
  var strings = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="' + widths + '"  height="' + heights + '"><param name="movie" value="' + flaFile + '"> <param name="quality" value="high"> '; 
  if (btrans == 'y') { 
    strings += '<param name="wmode" value="transparent">'; 
  } 
  strings += '<embed src="' + flaFile + '" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="' + widths + '" height="' + heights + '"> </embed> </object>'; 
  document.write(strings); 
  return; 
} 


function getObject(objectId) {
	if(document.getElementById && document.getElementById(objectId)) {	
		return document.getElementById(objectId); // check W3C DOM
	}
	else if (document.all && document.all(objectID)) {	
		return document.all(objectID); // IE4
	}
	else if (document.layers && document.layers[objectID]) {	
		return document.layer[objectID]; // NN4
	}
	else {
		return false;
	}
}

function divCls(comeon)
{
	
	if(comeon == 'close') {
		getObject('message').style.display="none";
	}
}  

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

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 menuclick(srcID, pos, totalCnt) {	
	for(i=0; i<totalCnt; i++) {
   		// Tab ¸Þ´º ¼±ÅÃ Ç¥½Ã
   		var sub_srcID = srcID + i;

	   	if (i == pos) {
				getObject(sub_srcID).style.display = "block";
	    } else {
				getObject(sub_srcID).style.display = "none";
	    }
	}
}


/* ¹æ »ó¼¼Á¤º¸ */
function win_roomInfo(URL) {
  downwin=window.open(URL,'win_roomInfo','scrollbars=yes,width=800,height=600')
  downwin.focus();
}


//°ø¹éÃ¼Å©(null, space)
function isEmpty(str) {
	for (var i=0; i<str.length; i++) {
		if (str.substring(i, i+1) != " ") return false;
	}

	return true;
}


//±ÛÀÚÅ©±â º¯°æ
var zoomRate = 10;  // È®´ë/Ãà¼Ò½Ã Áõ°¨·ü
var maxRate = 150;  //ÃÖ´ëÈ®´ë·ü
var minRate = 70;  //ÃÖ¼ÒÃà¼Ò·ü

function zoomIn(contentid, how) {
    if(GetCookie("zoomVal") != null && GetCookie("zoomVal") != ""){
        document.all[contentid].style.zoom = GetCookie("zoomVal");
        currZoom=GetCookie("zoomVal");
    } else {
        document.all[contentid].style.zoom = '100%'; 
        currZoom = '100%';
    }

    if (((how == "in") && (parseInt(currZoom) >= maxRate)) || ((how == "out") && (parseInt(currZoom) <= minRate)) ) {
        return; 
    }

    if (how == "in") {
        document.all[contentid].style.zoom = parseInt(document.all[contentid].style.zoom)+zoomRate+'%'
    } else {
        document.all[contentid].style.zoom = parseInt(document.all[contentid].style.zoom)-zoomRate+'%'
    }

    SetCookie("zoomVal",document.all[contentid].style.zoom);
}

function zoomOut(contentid, how) {
    if (GetCookie("zoomVal") != null && GetCookie("zoomVal") != "") {
        document.all[contentid].style.zoom = GetCookie("zoomVal");
        currZoom=GetCookie("zoomVal");
    } else {
        document.all[contentid].style.zoom = '100%'; 
        currZoom = '100%';
    }

    if (((how == "in") && (parseInt(currZoom) >= maxRate)) || ((how == "out") && (parseInt(currZoom) <= minRate)) ) {
        return; 
    }

    if (how == "in") {
        document.all[contentid].style.zoom = parseInt(document.all[contentid].style.zoom)+zoomRate+'%'
    } else {
        document.all[contentid].style.zoom = parseInt(document.all[contentid].style.zoom)-zoomRate+'%'
    }

    SetCookie("zoomVal",document.all[contentid].style.zoom);
}

function zoomReset(contentid, how) {
    document.all[contentid].style.zoom = '100%'; 
    currZoom = '100%';
    SetCookie("zoomVal",document.all[contentid].style.zoom);
}

function SetCookie(name,value){
  document.cookie = name + "=" + escape (value)+";domain=forest.go.kr";
 }

function SetCookie(name,value){
    document.cookie = name + "=" + escape (value)+";domain=forest.go.kr";
}

function GetCookie(name){
    if (document.cookie != "") {
        zoomc = document.cookie.split("; ");

        for (var i=0; i < zoomc.length; i++) {
            zoomv = zoomc[i].split("="); 

            if (zoomv[0] == name) {
                return  unescape(zoomv[1]);
            }
        }        
    } else {
        return "";
    }
}

function GoZoom(contentid){
    if (GetCookie("zoomVal") != null && GetCookie("zoomVal") != "") {
        document.all[contentid].style.zoom = GetCookie("zoomVal");
        currZoom=GetCookie("zoomVal");
    } else {
        document.all[contentid].style.zoom = '100%'; 
        currZoom = '100%';
    }
}


/**
 * ÇÁ¸°ÅÍ Ã³¸®.
 */
function contentPrint() {
    var windowLeft = (screen.width-640)/2;
	var windowTop = (screen.height-480)/2;

    var printURL = "/wcoweb/forPrint.jsp";

    window.open(printURL,"print",'width=720, height=550, menubar=no, scrollbars=yes,status=no,resizable=yes,top=' + windowTop + ',left=' + windowLeft + '');
}