/*셀렉트링크 스크립트
<form action="javascript:selectlink(this);">
<select onchange='select_change(this);'>
*/
function selectlink(){
	if(hiddenvalue){
	location.href=hiddenvalue;
	}else{
	window.alert('선택하세요');
	}
}
function selectlink2(){
	if(hiddenvalue){
	window.open(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 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('/si_include/post.jsp',"","width=430,height=380,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 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('선택하세요');

}


function aa(mVal){
	MM_openBrWindow('/si_include/popImg.html?img='+mVal,'image','width=100,height=100,top=0,left=0');
}
function showImage(mVal){
	f_name =document.showimg;
	f_name.img.value=mVal;
	f_name.action='/si_include/popImg.html';
	f_name.target='image';
	MM_openBrWindow('','image','width=100,height=100,top=0,left=0');
	f_name.submit();
}




//	+, - 키를 입력하면 화면 확대, 축소를 한다.

var tgs = new Array( 'div','td','tr','a','h1','h2','h3','li','span','p','blockquote','legend','fieldset');
var tgs2 = new Array( 'div','td','tr','a');

var szs = new Array( '9','11','12','14','18','24','30');
var startSz = 2;

function ts( trgt,inc ) {
    if (!document.getElementById) return
    var d = document,cEl = null,sz = startSz,i,j,cTags;

    sz = parseInt(sz) + parseInt(inc);

    if ( sz < 1 ) sz = 1;
    if ( sz > 5 ) sz = 5;
    startSz = sz;

    if ( !( cEl = d.getElementById( trgt ) ) ) cEl = d.getElementsByTagName( trgt )[ 0 ];

    cEl.style.fontSize = szs[sz];

    for ( i = 0 ; i < tgs.length ; i++ ) {
        cTags = cEl.getElementsByTagName( tgs[ i ] );
//        for ( j = 0 ; j < cTags.length ; j++ ) cTags[ j ].style.fontSize = szs[ sz ];
        for ( j = 0 ; j < cTags.length ; j++ ){
			//k= cTags[ j ].style.fontSize;
			//cTags[ j ].style.fontSize = k + inc;
			cTags[ j ].style.fontSize = szs[ sz ]
		}
    }
}
function ts2( trgt2,inc ) {
    if (!document.getElementById) return
    var d = document,cEl = null,sz = startSz,i,j,cTags;

    sz = parseInt(sz) + parseInt(inc);

    if ( sz < 0 ) sz = 0;
    if ( sz > 6 ) sz = 6;
    startSz = sz;

    if ( !( cEl = d.getElementById( trgt2 ) ) ) cEl = d.getElementsByTagName( trgt2 )[ 0 ];

    cEl.style.fontSize = szs[sz];

    for ( i = 0 ; i < tgs.length ; i++ ) {
        cTags = cEl.getElementsByTagName( tgs[ i ] );
//        for ( j = 0 ; j < cTags.length ; j++ ) cTags[ j ].style.fontSize = szs[ sz ];
        for ( j = 0 ; j < cTags.length ; j++ ){
			//k= cTags[ j ].style.fontSize;
			//cTags[ j ].style.fontSize = k + inc;
			cTags[ j ].style.fontSize = szs[ sz ]
		}
    }
}

function print_it(page,css){
	var oWin = window.open("/child/common/print.jsp?page="+page+"&css="+css,"printWin","width=800,height=550, menubar=no, scrollbars=yes, resizable=no");
}
function print_council(page){
	var oWin = window.open("/si_include/print_council.jsp?page="+page,"printWin","width=800,height=550, menubar=no, scrollbars=yes, resizable=no");
}

function print(page){
	var oWin = window.open("/child/common/print.jsp?page="+page,"width=800,height=550, menubar=no, scrollbars=yes, resizable=no");
}

function print_it2(page){
	var oWin = window.open("/si_include/print.jsp?page="+page,"printWin","width=800,height=550, menubar=no, scrollbars=yes, resizable=no");
}
function print_it3(page){
	var oWin = window.open("/si_include/print.jsp?page="+page,"printWin","width=800,height=550, menubar=no, scrollbars=yes, resizable=no");
}
function print_etc(){
	window.print();
}


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='/si_include/eval_set_point.jsp?url='+url+'&amp;mark='+s_val+'&amp;reple='+pt+'&amp;pagename='+page+'' 
    return true 
   } 
  } 
  alert('만족도를 선택해주세요'); 
 
}


function do_down(id,file_name1){
	f_name =document.down;
	f_name.id.value=id;
	f_name.file_name1.value=file_name1;
	f_name.submit();
}


function error_report(url) {
	var oWin = window.open("/bbs/error_report.jsp?url="+url,"printWin","width=740,height=550, menubar=no, scrollbars=yes, resizable=no");
}


function search_form(mForm){
	if(mForm.QUERY.value==""){
		alert('검색어를 입력해 주세요.');
		mForm.QUERY.focus();
		return false;
	}else{
		var pop = window.open('','search','left=0,top=0,width=1000,height='+window.screen.availHeight+',resizable=no,scrollbars=yes');
		return true;
	}
}
var noticeTbl = 0;	//소식 관련
function scrolling_notice(list_num){ 
	list_num = list_num-0;

	for(i=1;i<=list_num;i++){
		eval("news_item"+i).style.display = 'none';
	}//for...
	
	if(noticeTbl == list_num){
		noticeTbl = 1;
	}else{
		noticeTbl = (noticeTbl+1);
	}//if...

	eval("news_item"+noticeTbl).style.display = 'inline';
	window.setTimeout("scrolling_notice("+list_num+")",6000);
}
var noticeTbl2 = 0;	//소식 관련 tourinfo_item1
function scrolling_notice2(list_num){ 
	list_num = list_num-0;

	for(i=1;i<=list_num;i++){
		eval("tourinfo_item"+i).style.display = 'none';
	}//for...
	
	if(noticeTbl2 == list_num){
		noticeTbl2 = 1;
	}else{
		noticeTbl2 = (noticeTbl2+1);
	}//if...

	eval("tourinfo_item"+noticeTbl2).style.display = 'inline';
	window.setTimeout("scrolling_notice2("+list_num+")",6000);
}


//팝업
function iam_popup(theURL,winName,wWidth,wHeight) { //v2.0
	wX = (window.screen.width - wWidth) / 2-100;
	wY = (window.screen.height - wHeight) / 2-100;
  window.open(theURL,winName,"directories=no,toolbar=no,left="+wX+",top="+wY+",width="+wWidth+",height="+wHeight);
}
//팝업
function iam_popup_move(theURL,winName,wWidth,wHeight) { //v2.0
	wX = (window.screen.width - wWidth) / 2;
	wY = (window.screen.height - wHeight) / 2;
	window.moveBy(0,-20);
  window.open(theURL,winName,"directories=no,toolbar=no,left="+wX+",top="+wY+",width="+wWidth+",height="+wHeight);
}


