/*¼¿·ºÆ®¸µÅ© ½ºÅ©¸³Æ®
<form action="javascript:selectlink(this);">
<select onchange='select_change(this);'>
*/
function selectlink(){
	if(hiddenvalue){
	location.href=hiddenvalue;
	}else{
	window.alert('¼±ÅÃÇÏ¼¼¿ä');
	}
}
function selectlink2(form){
	if(hiddenvalue){
		//window.open(hiddenvalue);
		form.action=hiddenvalue;
	}else{
		window.alert('¼±ÅÃÇÏ¼¼¿ä');
	}
}
function select_change(obj) {
	var myindex=obj.selectedIndex;
	hiddenvalue = obj.options[myindex].value;
}
//ÆË¾÷
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


//À¾¸éÈ¨ÆäÀÌÁö ¸ÞÀÎ °øÁö»çÇ×
			function notice_sel(val){
				for(i=1;i<=2;i++){
					ttab = eval("document.getElementById('notice_tab"+ i +"')");
					timg = eval("document.getElementById('notice_btn"+ i +"_img')");
				
					if(val == i){
						timg.src="/town/images/main/notice/board_"+i+"on.gif";
						ttab.style.display = "";
					}else{
						timg.src="/town/images/main/notice/board_"+i+".gif";					
						ttab.style.display = "none";															
					}				
					
				}
			}

//À¾¸éÈ¨ÆäÀÌÁö ¸Þ´º
function top_menu(val){
	all_menu = eval("document.getElementById('top_menu').getElementsByTagName('ul')");
	sel_menu = eval("document.getElementById('sub_ul"+ val +"')");
	for(i=1;i<all_menu.length;i++){
		tmp_menu = eval("document.getElementById('sub_ul"+ i +"')");
		tmp_menu.style.display="none";
	}
	if(val != ""){
		sel_menu.style.display="inline";
	}
	
	//all_view = eval("document.getElementById('rank_result').getElementsByTagName('div')");
}

// À¾¸é ¸Þ´º Åõ¸í
function setOpacity(obj, opacity)
{
    var f_opacity = (opacity <= 0)? 0 : opacity/100;

    if(typeof obj.style.MozOpacity == "string") // firefox
    {
        obj.style.MozOpacity = f_opacity;
    }
    else if(typeof obj.style.KhtmlOpacity == "string") // safari
    {
        obj.style.KhtmlOpacity = f_opacity;
    }
    else if(typeof obj.style.filter == "string") // ie
    {
        obj.style.filter = "Alpha(opacity="+parseInt(100*f_opacity)+")";
    }
    else // other
    {
        obj.style.opacity = f_opacity;
    }
}

//¿Â·Îµå
function onloadfunction(){
MM_showHideLayers('top_menu_item1','','hide','top_menu_item2','','hide','top_menu_item3','','hide','top_menu_item5','','hide','top_menu_item6','','hide')
}

//SHOW/HIDE·¹ÀÌ¾î
function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3)
  with (document) if (getElementById && ((obj=getElementById(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_showHideLayers2() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers2.arguments;
  for (i=0; i<(args.length-2); i+=3)
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'inline':(v=='hide')?'none':v; }
    obj.display=v; }
}
//Á¶Á÷µµ SHOW/HIDE
var ltLayer = "";
function showLayer(name){
	if(document.all[name].style.display != "none"){
		document.all[name].style.display = "none"
	}
	else{
		document.all[name].style.display = "inline"
		if(ltLayer != "" && name != ltLayer){
			document.all[ltLayer].style.display = "none";
		}
		ltLayer = name;
	}
}

//·Ñ¿À¹ö
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 initMoving(target, position, topLimit, btmLimit) {
	if (!target)
		return false;

	var obj = target;
	obj.initTop = position;
	obj.topLimit = topLimit;
	obj.bottomLimit = document.documentElement.scrollHeight - btmLimit;

	obj.style.position = "absolute";
	obj.top = obj.initTop;
	obj.left = obj.initLeft;

	if (typeof(window.pageYOffset) == "number") {
		obj.getTop = function() {
			return window.pageYOffset;
		}
	} else if (typeof(document.documentElement.scrollTop) == "number") {
		obj.getTop = function() {
			return document.documentElement.scrollTop;
		}
	} else {
		obj.getTop = function() {
			return 0;
		}
	}

	if (self.innerHeight) {
		obj.getHeight = function() {
			return self.innerHeight;
		}
	} else if(document.documentElement.clientHeight) {
		obj.getHeight = function() {
			return document.documentElement.clientHeight;
		}
	} else {
		obj.getHeight = function() {
			return 500;
		}
	}

	obj.move = setInterval(function() {
		if (obj.initTop > 0) {
			pos = obj.getTop() + obj.initTop;
		} else {
			pos = obj.getTop() + obj.getHeight() + obj.initTop;
			//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";
	}, 30)
}

//simple_flash
function swf(src,width,height){
    object = '';
    object += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="param" width="'+width+'" height="'+height+'">';
    object += '<param name="movie" value="'+src+'">';
    object += '<param name="wmode" value="transparent">';
    object += '<embed src="'+src+'" quality="high" wmode="transparent" menu="false" width="'+width+'" height="'+height+'" swliveconnect="true" id="param" name="param" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"><\/embed>';
    object += '<\/object>';
    document.write(object);
}

//
function post_check(){
		window.open('/login/member_addr_check2.jsp',"","width=390,height=250,scrollbars=yes");
		return;
}
function post_check_last(inputName1,inputName2){
		window.open('/login/member_addr_check_last.jsp?inputName1='+inputName1+'&inputName2='+inputName2,"","width=390,height=250,scrollbars=yes");
		return;
}
function post_check_tour(){
		window.open('/login/member_addr_check2_1.jsp',"","width=390,height=250,scrollbars=yes");
		return;
}
function post_check2(key){
		window.open('/g_board/map/map.jsp?key='+key,"","width=390,height=250,scrollbars=yes");
		return;
}



function viewOrg(mVal){
	htmlCont="<html><head><meta http-equiv=Content-Type content=text/html; charset=euc-kr /><style>body{margin:0px;}</style></head><body><img name='nowImg' src='"+mVal+"' border='0' style='cursor:pointer;' onClick='self.close();' onload='if(parseInt(this.width)>800){this.width=800;this.height=600;self.resizeTo(800,630);}else{self.resizeTo(parseInt(nowImg.width),parseInt(nowImg.height+30))}'></body></html>";
	childWin=window.open("about:blank","mainImg","width=0,height=0,scrollbars=no,top=0,left=0");
	if(childWin){
		childWin.close();
		childWin=window.open("javascript:document.write('"+htmlCont+"')","mainImg","width=0,height=0,scrollbars=no,top=0,left=0");
	}
}
function showImage(mVal){
	MM_openBrWindow('/g_board/popImg.html?img='+mVal,'image','width=100,height=100,top=0,left=0');
}
function showImage2(mVal){
	MM_openBrWindow('/town/town_board/popImg.html?img='+mVal,'image','width=100,height=100,top=0,left=0');
}


 function encodeURL(str){
     var s0, i, s, u;
     s0 = "";                // encoded str
     for (i = 0; i < str.length; i++){   // scan the source
         s = str.charAt(i);
         u = str.charCodeAt(i);          // get unicode of the char
         if (s == " "){s0 += "+";}       // SP should be converted to "+"
         else {
             if ( u == 0x2a || u == 0x2d || u == 0x2e || u == 0x5f || ((u >= 0x30) && (u <= 0x39)) || ((u >= 0x41) && (u <= 0x5a)) || ((u >= 0x61) && (u <= 0x7a))){       // check for escape
                 s0 = s0 + s;            // don't escape
             }
             else {                  // escape
                 if ((u >= 0x0) && (u <= 0x7f)){     // single byte format
                     s = "0"+u.toString(16);
                     s0 += "%"+ s.substr(s.length-2);
                 }
                 else if (u > 0x1fffff){     // quaternary byte format (extended)
                     s0 += "%" + (oxf0 + ((u & 0x1c0000) >> 18)).toString(16);
                     s0 += "%" + (0x80 + ((u & 0x3f000) >> 12)).toString(16);
                     s0 += "%" + (0x80 + ((u & 0xfc0) >> 6)).toString(16);
                     s0 += "%" + (0x80 + (u & 0x3f)).toString(16);
                 }
                 else if (u > 0x7ff){        // triple byte format
                     s0 += "%" + (0xe0 + ((u & 0xf000) >> 12)).toString(16);
                     s0 += "%" + (0x80 + ((u & 0xfc0) >> 6)).toString(16);
                     s0 += "%" + (0x80 + (u & 0x3f)).toString(16);
                 }
                 else {                      // double byte format
                     s0 += "%" + (0xc0 + ((u & 0x7c0) >> 6)).toString(16);
                     s0 += "%" + (0x80 + (u & 0x3f)).toString(16);
                 }
             }
         }
     }
     return s0;
 }


function set_star2(get_it1, get_it2) {
 var fm = document.eval_;
 var pt = fm.reple.value;

 var url =get_it1;
 var page=get_it2;
  for(i=0;i<5;i++){
   if(fm.helpcheck[i].checked==true){
   var s_val = fm.helpcheck[i].value;
   location.href='/eval_point/set_eval_point.jsp?url='+url+'&amp;mark='+s_val+'&amp;reple='+pt+'&amp;pagename='+page+''
    return true
   }
  }
  alert('¸¸Á·µµ¸¦ ¼±ÅÃÇÏ¼¼¿ä');

}