
var _deBug=false;
var UserAgentName=navigator.userAgent.toLowerCase();
var isIE=(navigator.appName.indexOf("Microsoft Internet Explorer")==0);
var isIE7d=isIE;
if(isIE7d){
isIE7d=UserAgentName.indexOf("msie ")+5;
isIE7d=UserAgentName.substring(isIE7d,isIE7d+1);
isIE7d=(isNaN(isIE7d))?false:parseFloat(isIE7d)<7;
}
var isFF=(UserAgentName.indexOf("firefox")!=-1);
var isOP=(UserAgentName.indexOf("opera")!=-1);

if(isIE)document.execCommand('BackgroundImageCache',false,true);

var isWindowLoaded=false;
var fnReadyFunc=new Array();
var _SiteURL='';
var _Now='';

function $(p){return (typeof p=='object')?p:(p?document.getElementById(p):null)}
function $w(f){(!isWindowLoaded)?fnReadyFunc.push(f):f()}
function $s(){$x(arguments,function(p){p.style.display=''})}
function $h(){$x(arguments,function(p){p.style.display='none'})}
function $z(p){p=$(p);return(p)?(p.style.display!='none'):0}
function $a(){$x(arguments,function(p){$z(p)?$h(p):$s(p)})}
function $x(a,f){if(a&&a.length){for(var i=0;i<a.length;i++){if(!a[i])continue;var b=$(a[i]);if(b&&f)f(b)}}}
function $c(p,s){p=$(p);return (p&&p.className.indexOf(s)>-1)}
function $p(p,n){var t=0;if(!n)n=1;else t=(typeof n=='string');if(t)n=n.toLowerCase();if(!t){for(var i=0;i<n;i++)p=p.parentNode}else{while(p=p.parentNode)if(p.nodeType==1&&p.nodeName.toLowerCase()==n)break;}return p}
function $i(){if(arguments[0]){var p=arguments[0];delete arguments[0];$x(arguments,function(p1){p.nextSibling?$p(p).insertBefore(p1,p.nextSibling):$p(p).appendChild(p1)})}}
function $n(s,o,s1){var p=document.createElement(s);if(typeof o=='string')p.innerHTML=o;else for(var z in o)p[z]=o[z];if(s){if(typeof s1=='string')p.style.cssText=s1;else for(var z in s1)p.style[z]=s1[z]}return p}
function $t(s,p,f){if(!p)p=document;var a=p.getElementsByTagName(s);if(f)for(var i=0;i<a.length;i++)f(a[i],i);return a}
function $g(){var cn=arguments[0];delete arguments[0];$x(arguments,function(p){if(p.__bcn==undefined)p.__bcn=p.className;p.className=p.__bcn+' '+cn})}
function $m(p,n){var t=$o(p);if(!n)n=0;document.documentElement.scrollTop=t.t+n}
function $o(p){p=$(p);if(!p)return {t:0,l:0};var mt=p.offsetTop,ml=p.offsetLeft,mp=p.offsetParent;while(mp&&mp.nodeType==1){mt+=mp.offsetTop;ml+=mp.offsetLeft;mp=mp.offsetParent}return{t:mt,l:ml}}
function $k(sn,sv,n,sp){document.cookie=sn+'='+sv+(n?'; Max-Age='+n:'')+(sp?'; path='.sp:'')}
function $l(p,f,s){var r=[];p=$(p);if(!p)return r;if(s)s=s.toLowerCase();for(var i=0;i<p.childNodes.length;i++){if(p.childNodes[i].nodeType!=1)continue;if(!s||(s&&p.childNodes[i].tagName.toLowerCase()==s)){r.push(p.childNodes[i]);if(f)f(p.childNodes[i])}}return r}
function $e(p,n,son,soff,pp){if(!son)son='on';if(!soff)soff='off';var i=0,f=function(t){if(pp)t=$p(t,pp);$g((n==i?' '+son:' '+soff),t);i++};$l(p,f)}
function $r(p,sp,pn){p.insertAdjacentElement(sp,pn);}
function $ih(a,htm){
	if(a&&htm){		
		a=$(a);
		var h=$(htm);
		if(a){
			if(isIE&&a.tagName.toLowerCase()=='tbody'){
				while(a.rows.length>0)a.deleteRow(0);
				var tmp=document.createElement('div');
				$h(tmp);
				document.body.appendChild(tmp);
				tmp.innerHTML='<table id="temp_div_table_q">'+(h?h.innerHTML:htm)+'</table>';
				
				var tt=$('temp_div_table_q');
				for(var i=0;i<tt.rows.length;i++)
					a.appendChild(tt.rows[i].cloneNode(true));
				

				var w=new Array();
				$$('select',function(v){w.push(v.selectedIndex)},tt);

				var m=0;
				$$('select',function(v){v.selectedIndex=w[m];m++;},a);

				tmp.parentNode.removeChild(tmp);
			}
			else a.innerHTML=(h?h.innerHTML:htm);	
		}
		$t('script',a,function(x){eval(x.innerHTML);});
	
	}
}
function $b(n){if(n&&!n.id)n.id='ITIDS_'+$q();return n.id;}
function $q(n){if(!n)n=1000000;return Math.round(Math.random()*n);}

function $csi(p,nm){return p.className.indexOf(nm)>-1;}
function $sat(x,nm,val){x.setAttribute(nm,val);}
function $atr(x,nm){return(x&&x.nodeType==1)?x.getAttribute(nm):null;}
function $ism(x,tn,cs,an){if(!x||x.nodeType!=1)return 0;if(tn){if(x&&x.nodeName){var xzz=x.nodeName;if(!xzz.toLowerCase().match('^'+tn+'$'))return 0;}}if(cs&&an){if(an=='class'||an=='classname'){if(!$csi(x,cs))return 0;}else if($atr(x,an)!=cs)return 0;}return 1;}
function $fnd(p,tn,cs,an){var f=[];an=(!an)?'class':an.toLowerCase();if(!p)p=document.childNodes;for(var i=0;i<p.length;i++){if($ism(p[i],tn,cs,an))f.push(p[i]);var x=$fnd(p[i].childNodes,tn,cs,an);if(x.length)f=f.concat(x);}return f;}
function $tn(tn,p){var af=[],an='class',zq;p=(!p)?document.childNodes:p;if(!tn){af.push(document);return af;}if(tn.charAt(0)=='#'){zq=tn.split('|');for(var i=0;i<zq.length;i++){var ze=$(zq[i].substr(1));if(ze)af.push(ze);}return af;}var cc=tn.indexOf('.'),cs=null;if(cc>-1){cs=tn.substr(cc+1);tn=tn.substr(0,cc);}else{cc=tn.indexOf('[');if(cc>-1){cs=tn.substring(cc+1,tn.length-1);tn=tn.substr(0,cc);cc=cs.split('=');an=cc[0].toLowerCase();cs=cc[1];}}return $fnd(p,tn,cs,an);}
function $$(a,f,p){var e=null;p=$(p);if(!a)return [];e=(p)?p.childNodes:document.body.childNodes;a=a.split(' ');for(var i=0;i<a.length;i++){if(!a[i])continue;e=$tn(a[i],e);if(!e.length)break;}if(f&&e.length)for(var i=0;i<e.length;i++){if(e[i])f(e[i]);}return e;}

function ResizeFrame(name){
	var fBody = document.frames(name).document.body;
	var fName = document.all(name);
	fName.style.height = fBody.scrollHeight + (fBody.offsetHeight - fBody.clientHeight);
	if(fName.style.height=='0px')fName.style.height = "300px";
}
function setDataInt(x){
	var a=parseFloat(x.replace(/[^0-9\-\.]/g,''));
	return (isNaN(a))?x:a;
}
function setMoneyType(v){
	if(!v)return '';
	v=v.toString();
	if(v.length>3){
		var mod=v.length%3;
		var retval=(mod>0?(v.substring(0,mod)):"");
		for (i=0;i<Math.floor(v.length/3);i++){
			if((mod==0)&&(i==0)){
				retval+=v.substring(mod+3*i,mod+3*i+3);
			}else{
				retval+=","+v.substring(mod+3*i,mod+3*i+3);
			}
		}
		return retval;
	}
	else return v;
}

function $sn(nm){
	var i=0;
	while(1){
		i++;
		if($(nm+i))$s(nm+i);
		else break;
	}
}
function $hn(nm,si){
	var i=(si?si:0);
	while(1){
		i++;
		if($(nm+i))$h(nm+i);
		else break;
	}
}


function $oData(fObj,bStr){var ret='';var setVal=function(nm,val){if(typeof val=='object'||typeof val=='array'){for(var kN in val)setVal((!nm)?kN:nm+'['+kN+']',val[kN])}else{ret+=bStr;ret+='Content-Disposition: form-data;name="'+nm+'"\r\n\r\n';ret+=val+'\r\n'}};setVal(null,fObj);return ret}
function $fData(fid,bStr,fnc){
	fid=$(fid);if(!fid)return 0;var ret='';var setVal=function(nm,val){if(!nm||nm[0]=='_')return 0;
	if(fnc){ret+=bStr+fnc(nm,val);return 1;}
	ret+=bStr;ret+='Content-Disposition: form-data; name="'+nm+'"\r\n\r\n';ret+=val+'\r\n';return 1;};
	for(var i=0;i<fid.elements.length;i++)with(fid.elements[i]){var anm=nodeName.toLowerCase();
	if(anm=='input'){var nmx=type.toLowerCase();if((nmx=='checkbox'||nmx=='radio')&&!checked)continue;
	setVal(name,value)}else if(anm=='textarea')setVal(name,value);else if(anm=='select'){
		if(type.toLowerCase()=='select-one'){var v='',o;if(selectedIndex>=0){o=options[selectedIndex];v=o.value;
		if(!v&&!('value'in o))v=o.text}setVal(name,v)}
		else{var v='';
		for(var x=0;x<length;x++){
			var o=options[x];
			var v=o.value;
			if(!o.selected)continue;
			if(!v&&!('value'in o))v=o.text;
			setVal(name+'[]',v)}}}}return ret;}

function $ajax(u,f,o,t)
{
var xr=false,q='',ku=u;
if($(u)){
	u=$(u);
	var s=u.nodeName.toLowerCase();
	if(s=='input'){
		s='form';
		u=u.form;
	}
	if(s=='form'){
		if(!o)o=u;
		u=u.action;
	}
	else if(s=='a')u=u.href;
	else if(s=='img')u=u.src;
	else return false;
}
if(!t)t=2;
if(window.ActiveXObject){
	try{
		xr=new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e){
		try{
			xr=new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(e2){xr=false;}
	}
}
else if(window.XMLHttpRequest)xr=new XMLHttpRequest();

if(!xr)return false;
if(o){
	var bStr='---------------------------MY01075830017',beStr='--'+bStr+'\r\n';
	o=$(o);
	var q=(o.elements&&o.elements.length)?$fData(o,beStr):$oData(o,beStr);
	if(q!='')q+='--'+bStr+'--\r\n';
}

xr.open(((q!='')?'post':'get'),u,true);
xr.onreadystatechange=function(){
	if(xr.readyState==4){
		if(xr.status==200){
			if(t==1){
				var xn=null;
				if(window.XMLHttpRequest)var xn=(!isIE)?xr.responseXML.childNodes.item(0):xr.responseXML.childNodes.item(1);
				else xn=xr.responseXML.childNodes.item(1);
				if(f)f(xn,1,xr.status,ku);
			}
			else if(t==2){
				if(f)f(xr.responseText,1,xr.status,ku);
			}
			else if(f)f(xr,1,xr.status,ku);
		}
		else if(f)f(xr,0,xr.status,ku);
	}
};
xr.setRequestHeader('Ajax-Type','text/javascript');
if(q!=''){
	xr.setRequestHeader('Content-Type','multipart/form-data; boundary='+bStr);
	xr.setRequestHeader('Content-Length',q.length);
	xr.setRequestHeader('Connection','Keep-Alive');
	xr.setRequestHeader('Cache-Control','no-cache');
	xr.send(q);
}
else xr.send(null);
return true;
}


function swf(src,w,h){
	html = '';
	html += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" id="param" width="'+w+'" height="'+h+'">';
	html += '<param name="movie" value="'+src+'">';
	html += '<param name="quality" value="high">';
	html += '<param name="wmode" value="transparent">';
	html += '<embed src="'+src+'" quality=high width="'+w+'" height="'+h+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"><\/embed>';
	html += '<\/object>';
	document.write(html);
}
function swfvod(src,w,h){
	html = '';
	html += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" id="param" width="'+w+'" height="'+h+'" align="">';
	html += '<param name="movie" value="'+src+'" />';
	html += '<param name="quality" value="high" />';
	html += '<param name="wmode" value="transparent" />';
	html += '<embed src="'+src+'" quality=high height="'+h+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" align=""><\/embed>';
	html += '<\/object>';
	document.write(html);
}


function MM_swapImgRestore(){
  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(){
  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){
  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(){
  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];}
}


var nowBoxSHOW=0;
var nowBoxButton=null;
var nowBoxBack=null;
var nowBoxSession=null;
var _R9EListen=new Array();

function _showBox(idt,clsnm,btn,dce){if(nowBoxSHOW)_hideBox();var xID=$('stOverPop'),rID=(isIE7d)?$('R9TargetBox'):null;if(xID){xID.apha=0;xID.className=(clsnm)?clsnm:'';$ih('stOverPopIn',idt);nowBoxBack=!btn;nowBoxButton=$(btn);if(nowBoxButton&&nowBoxButton.nodeType==1){if(!dce)setTimeout(function(){_addEvent(document,'click',_dohideChideBox);},200);$s(xID);}else{if(nowBoxBack){var tID=$('stOverBack');tID.onclick=(!dce)?function(e){_dohideChideBox(e);return 0;}:function(){return 0;};$s(tID);}$s(xID);}nowBoxSHOW=1;_resizeBox();}}
function _dohideChideBox(e){e=e||window.event;var o=(e.srcElement||e.target);var p=o;while(p&&p.nodeType==1){if(p.id=='stOverPop')return;p=p.offsetParent;}_hideBox();}
function _resizeBox(qp){var xID=$('stOverPop');
if(xID){var rID=(isIE7d)?$('R9TargetBox'):null;
xID.apha=100;
if(nowBoxButton&&nowBoxButton.nodeType==1){if(isIE)xID.style.filter='';
else xID.style.opacity='100';var r=$o(nowBoxButton);
setStyleBox(xID,r.t+nowBoxButton.offsetHeight+'px',r.l+'px');}
else{var tID=(nowBoxBack)?$('stOverBack'):null;
setPageCenter(xID,tID);


}


if(rID)setStyleBox(rID,xID.style.top,xID.style.left,xID.offsetWidth+'px',xID.offsetHeight+'px');
if(nowBoxSHOW)nowBoxSHOW=setTimeout(function(){_resizeBox(1);},530);}}


function _hideBox(){if(nowBoxSession){nowBoxSession();nowBoxSession=null;}if(nowBoxSHOW){clearTimeout(nowBoxSHOW);nowBoxSHOW=0;var xID=$('stOverPop'),tID=$('stOverBack'),rID=null;$ih('stOverPopIn','');if(isIE7d){rID=$('R9TargetBox');rID.src='about:blank';setStyleBox(rID,'0px','0px','0px','0px');}$h(xID,tID);setTimeout(function(){_delEvent(document,'click',_dohideChideBox);},200);nowBoxButton=null;nowBoxBack=null;}}
function setPageCenter(xID,bkID){var pd=getPageSize(),sd=getScrollXY(),aw=getMaxWidth(xID),ah=getMaxHeight(xID);if(bkID)setStyleBox(bkID,'0px','0px','100%',pd.ph+'px');xID.style.top=String(Math.round((pd.h/2)-(ah/2))+sd.y)+'px';xID.style.left=String(Math.round((pd.w/2)-(aw/2))+sd.x)+'px';}
function setStyleBox(i,t,l,w,h){i=$(i).style;i.position='absolute';if(l)i.left=l;if(t)i.top=t;if(w)i.width=w;if(h)i.height=h;}
function getMaxHeight(elm,mH){if(isIE) return elm.offsetHeight;if(!mH)mH=elm.offsetHeight;for(var i=0;i<elm.childNodes.length;i++){var a=elm.childNodes.item(i);if(a.nodeType==1&&a.offsetHeight&&mH<a.offsetHeight){mH=a.offsetHeight;if(a.length)mH=getMaxHeight(a,mH);}}return mH;}
function getMaxWidth(elm,mW){if(isIE)return elm.offsetWidth;if(!mW)mW=elm.offsetWidth;for(var i=0;i<elm.childNodes.length;i++){var a=elm.childNodes.item(i);if(a.nodeType==1&&a.offsetWidth&&mW<a.offsetWidth){mW=a.offsetWidth;if(a.length)mW=getMaxWidth(a,mW);}}return mW;}
function getScrollXY(){var de=document.documentElement,db=document.body;if(self&&self.pageYOffset)return{x:self.pageXOffset,y:self.pageYOffset};else if(!isIE&&window.pageYOffset)return{x:window.pageXOffset,y:window.pageYOffset};else if(!isIE&&window.scrollY)return{x:window.scrollX,y:window.scrollY};else if(de&&de.scrollTop)return{x:de.scrollLeft,y:de.scrollTop};else if(db.scrollTop)return{x:db.scrollLeft,y:db.scrollTop};return{x:0,y:0};}
function getPageSize(dx){if(!dx)dx=window;var x,y,w=0,h=0,py,px,db=dx.document.body,de=dx.document.documentElement;if(dx.innerHeight&&dx.scrollMaxY){x=db.scrollWidth;y=dx.innerHeight+dx.scrollMaxY;}else if(db.scrollHeight>db.offsetHeight){x=db.scrollWidth;y=db.scrollHeight;}else{x=db.offsetWidth;y=db.offsetHeight;}if(dx.innerHeight){w=dx.innerWidth;h=dx.innerHeight;}else if(de&&de.clientHeight){w=de.clientWidth;h=de.clientHeight;}else if(document.body){w=db.clientWidth;h=db.clientHeight;}var pw=(x<w)?w:x;var ph=(y<h)?h:y;return{pw:pw,ph:ph,w:w,h:h}}


function _addEvent(doc,evname,func){if(_fndEvent(doc,evname,func)!=null)return;_R9EListen.push([doc,evname,func]);if(isIE||isOP)doc.attachEvent("on"+evname,func);else doc.addEventListener(evname,func,true);}
function _fndEvent(doc,evname,func){for(var i in _R9EListen)if(_R9EListen[i][0]==doc&&_R9EListen[i][1]==evname&&_R9EListen[i][2]==func)return i;return null}
function _clrEvent(){for(var i=_R9EListen.length;i>0;i--)if(_R9EListen[i]!=undefined)_delEventIndex(i);_R9EListen=[]}
function _delEventIndex(i){if(isIE||isOP)_R9EListen[i][0].detachEvent("on"+_R9EListen[i][1],_R9EListen[i][2]);else _R9EListen[i][0].removeEventListener(_R9EListen[i][1],_R9EListen[i][2],true)}
function _delEvent(doc,evname,func){var fei=_fndEvent(doc,evname,func);if(fei==null)return;_delEventIndex(fei);delete _R9EListen[fei];}
function _addEvents(doc,evs,func){for(var i in evs)_addEvent(doc,evs[i],func);}
function _delEvents(doc,evs,func){for(var i in evs)_delEvent(doc,evs[i],func);}




function valAllCheckSelect(did)
{
	var aEle=$(did);
	if(!aEle)return true;
	var aEle=aEle.elements,aCnt=0;
	if(!aEle||!aEle.length){
		alert('¼±ÅÃÇÒ Ç×¸ñÀÌ Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù.');
		return false;
	}
	for(var i=0;i<aEle.length;i++){
		if(aEle[i]&&aEle[i].type)
			if(aEle[i].type=='checkbox'&&aEle[i].name.substr(0,1)=='c'){
				aEle[i].checked=(aEle[i].checked==false);
				aCnt++;
			}
	}
	if(aCnt==0){
		alert('¼±ÅÃÇÒ Ç×¸ñÀÌ ¾ø½À´Ï´Ù.');
		return false;
	}
	return true;
}
function valCheckAction(did,aName,aMode,aValue)
{
	var aFrm=$(did);
	if(!aFrm)return true;
	var aEle=aFrm.elements,aCnt=0;
	for (var i=0;i<aEle.length;i++) {
		if (aEle[i] != null)
			if (aEle[i].type=='checkbox'&&aEle[i].name.substr(0,1)=='c')
				if (aEle[i].checked)aCnt++;
	}
	if(aCnt>0){
		if(aName != ''){
			if(!confirm('[°æ°í (WARNING!!)]\n\nÁ¤¸» ¼±ÅÃÇÏ½Å Ç×¸ñµéÀ» '+aName+'ÇÏ½Ã°Ú½À´Ï±î ?\n\n¸¸¾à ¼±ÅÃµÈ Ç×¸ñ¿¡ ´ëÇÑ '+aName+'ÀÛ¾÷À» °è¼Ó ÇÒ °æ¿ì º¹±¸°¡ ºÒ°¡´ÉÇÕ´Ï´Ù.'))return false;
		}
		if(aMode&&aValue)aFrm.elements[aMode].value=aValue;
		return true;
	}
	alert('¸ÕÀú '+aName+'Ç×¸ñÀ» ¼±ÅÃÇÏ¿© ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù.');
	return false;
}
function valISChecked(did,aName)
{
	var aEle=$(did);
	if(!aEle)return false;
	var aEle=aEle.elements,aCnt=0;
	for (var i=0;i<=aEle.length-1;i++) {
		if (aEle[i]!=null)
			if (aEle[i].type=='checkbox'&&aEle[i].name.substr(0,1)=='c')
				if (aEle[i].checked)aCnt++;
	}
	if(aCnt <= 0){
		alert(aName+'ÇÏ½Ç Ç×¸ñÀ» ¼±ÅÃÇÏ¿© ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù.');
		return false;
	}
	return true;
}
function $vf(f){
	if(!f||!f.title)return true;
	var err=(!f.nodeName)?f.title+'À»(¸¦) ¼±ÅÃ ¶Ç´Â Ã¼Å©ÇÏ¼¼¿ä.':f.title+'À»(¸¦) ÀÔ·ÂÇÏ¼¼¿ä.';
	
	if(!f.nodeName&&typeof f=='object'){
		for(var i=0;i<f.length;i++){
			if(f[i].checked)return true;
		}
		alert(err);
		return false;
	}
	if(!f.value||f.value=='0'){
		alert(err);
		f.focus();
		return false;
	}
	return true;
}
function docSelSetValue(p,v){
	if(!p)return 0;
	for(var c=0;c<p.options.length;c++){
		if(v==p.options[c].value){
			p.options[c].selected=true;
			break;
		}
	}
}

String.prototype.cut=function(a,b){var s=(!a)?0:this.indexOf(a);if(s>-1)a=this.substr(s+a.length);else return '';var l=(!b)?a.length:a.indexOf(b);if(l<0)l=a.length;return(l>-1)?a.substring(l,0):'';}
String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"");}
String.prototype.int=function(){var a=parseFloat(this.replace(/[^0-9\-\.]/g,''));return (isNaN(a))?x:a;}

function setcookie(n,v,es,p){var t=new Date();if(!es)es=86400;if(!p)p='/';if(!v)v='';t.setTime(t.getTime()+(1000*es));document.cookie=n+'='+v+'; path='+p+'; expires='+t.toGMTString()+';';}
function getcookie(n){var a=document.cookie;return a.cut(n+'=',';');}

function docSetFFKFix(p){
	if(!isFF)return 0;
	p=$(p);
	if(!p)return 0;
	p._t=0;
	p._v='';
	_addEvent(p,'focus',function(){
		if(p._t)clearInterval(p._t);
		p._t=setInterval(function(){
			if(p._v!=p.value){
				p._v=p.value;
				if(document.createEvent){
					var e;
					if(window.KeyEvent){
						e=document.createEvent('KeyEvents');
						e.initKeyEvent('keyup',true,true,window,false,false,false,false,65,0);
					}
					else{
						e=document.createEvent('UIEvents');
						e.initUIEvent('keyup',true,true,window,1);
						e.keyCode=65;
					}
					p.dispatchEvent(e);
				}
				else{
					var e=document.createEventObject();
					e.keyCode=65;
					p.fireEvent('onkeyup',e);
				}
			}
		},50);
	});
	_addEvent(p,'blur',function(){if(p._t)clearInterval(p._t);p._t=0;});
	return 1;	
}
function docSetSeujest(p,url)
{
	if(!p.id)setID(p);
	p.playurl=url;

	p.bx=$n('div',{className:'Sujest','innerHTML':'<div id="'+p.id+'Sujest" class="SujestIn">ÇØ´çÇÏ´Â °Ë»ö¾î¿¡ ´ëÇÑ Á¦¾ÈÀÌ ¾ø½À´Ï´Ù.</div><p id="'+p.id+'Button" class="option"></p>'});
	p.fx=$n('iframe',{className:'SujestFrame','width':'0','height':'0','src':'about:blank','name':p.id+'Frame'});
	p.ux=$n('div',{className:'SujestArrow'});

	if(isFF)p.fx.style.opacity='0';
	else p.fx.style.filter='alpha(opacity=0)';
	
	$h(p.bx,p.fx);
	$i(p,p.bx,p.fx,p.ux);
	p.bf=$(p.id+'Sujest');
	p.ot=$(p.id+'Button');
	$p(p).className+=' SujestMain';

	p.autocomplete='off';
	p._cvl='';
	p._ply=0;
	p._myd=[];
	p._nsj=null;
	p._ops={
		'snuj':['±â´É',function(pp,v,f){pp._nsj=v;if(!f){if(!v)pp.onkeyup(1);else pp.setHiding();}}],
		'snsl':['½ºÅ©·Ñ',function(pp,v,f){pp.bx.className=(!v)?'Sujest SujestScroll':'Sujest';if(!f)pp.setShowing();}]
	};
	p.bf.setUlmove=function(e,ei){
		var ex=[],dxd;
		var pov=-1;
		$t('p',p.bf,function(ql,r){
			if(!$c(ql,'item'))return 0;
			ex.push(ql);
			if(ql.itsOver)pov=ex.length-1;
			ql.itsOver=0;
			ql.className=ql.className.replace(/offitem|onitem/i,'');
			return 1;
		});
		if(ex.length){
			if(!$z(p.bx))p.setShowing();
			if(e==1||!e){
				pov=(!e)?pov+1:pov-1;
				if(!ex[pov]){
					if(pov<0){
						p.value=p._cvl;
						p._v=p._cvl;
						p.setHiding();
						return 0;
					}
					else pov=ex.length-1;
				}
				e=ex[pov];
				if(p._myd[p._cvl]){
					dxd=p._myd[p._cvl][2][pov];
					dxd=dxd.split(',');
					p.value=dxd[1];
				}
				else p.value=e.innerText;
				p._v=p.value;
				var d1=e.offsetTop;
				var d2=d1+e.offsetHeight;
				var dMn=$p(e).scrollTop;
				var dMx=dMn+$p(e).offsetHeight;
				if(d1<dMn)$p(e).scrollTop=$p(e).scrollTop-e.offsetHeight;
				else if(d2>dMx)$p(e).scrollTop=$p(e).scrollTop+e.offsetHeight;
			}
			e.itsOver=1;
			e.className+=' onitem';
		}
		return 1;
	};
	p.bf.setMyValue=function(e,i){
		var sch;
		if(p._myd[p._cvl]){
			sch=p._myd[p._cvl][2][i].split(',');
			sch=sch[1];
		}
		if(!sch)sch=e.innerText;
		p.value=sch;
		p._v=sch;
		p.form.submit();
	};
	p.setHiding=function(){
		$h(p.bx,p.fx);
		p.ux.className='SujestArrow SujestUP';
	};
	p.outOPS=function(){
		var cdx='';
		for(var dx in p._ops){
			var dv=p[dx+'ck']?null:1;
			cdx+='<span onclick="$p(this,2).setOPS(\''+dx+'\','+dv+');" class="optBtn optBtn'+dx+' opt'+dx+(dv?'Off':'On')+'">'+p._ops[dx][0]+(dv?'²ô±â':'ÄÑ±â')+'</span>';
		}	
		p.ot.innerHTML=cdx;
	};
	p.outLooping=function(c){
		var lst=p._myd[c][2],sm2=[],q,o,lc,cs,cm,wd=0;
		cm={};
		for(var i=0;i<lst.length;i++)
		{
			cs='item n'+i;
			q=lst[i].toLowerCase().split(',');
			o=q[0];
			q=q[1];
			cs+=' opt'+o;
			if(!cm[o]){
				cm[o]=1;
				sm2[wd]='';
				wd++;
				cs+=' '+o+'first';
			}
			if(i==0)cs+=' first';
			if(i==lst.length-1)cs+=' last';

			if(o=='l'&&q.indexOf(c)==0)q='<em>'+c+'</em>'+q.substring(c.length,q.length);
			else if(o=='r'){
				lc=q.length-c.length;
				if(q.lastIndexOf(c)==lc)q=q.substring(0,lc)+'<em>'+c+'</em>';
			}
			sm2[wd-1]+='<p class="'+cs+'" onclick="$p(this,2).setMyValue(this,'+i+');" onmouseover="$p(this,2).setUlmove(this,'+i+');">'+q+'</p>';
		}
		return sm2.join('<p class="split"></p>');
	}
	p.setShowing=function(){
		var sm2='';
		var c=String(p.value); //.trim();
		p.outOPS();
		if(p._nsj)sm2='°Ë»ö ÀÚµ¿¿Ï¼º ±â´ÉÀ» »ç¿ëÇÏÁö ¾Ê°í ÀÖ½À´Ï´Ù.';
		else if(!c)sm2='°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.';
		else if(!p._myd[c]||p._myd[c][1]<=0)sm2='ÇöÀç Ã£Àº °Ë»ö¾î°¡ ¾ø½À´Ï´Ù.';
		if(sm2)p.bf.innerHTML='<p class="nuseMsg">'+sm2+'</p>';
		else if(p._cvl!=c)p.bf.innerHTML='<div class="items">'+p.outLooping(c)+'</div>';
		p._cvl=c;
		p.ux.className='SujestArrow SujestDown';
		$s(p.bx,p.fx);

		setStyleBox(p.bx,p.offsetTop+p.offsetHeight+'px',p.offsetLeft+'px',(p.offsetWidth-8)+'px');
		setStyleBox(p.ux,p.offsetTop+'px',(p.offsetLeft+p.offsetWidth-25)+'px',p.offsetHeight+'px',p.offsetHeight+'px');
		setStyleBox(p.fx,p.bx.style.top,p.bx.style.left,p.bx.offsetWidth+'px',p.bx.offsetHeight+'px');
	};
	if(isFF)docSetFFKFix(p);
	p.onkeyup=function(e){
		if(p._nsj)return 0;
		var key;
		if(e!=1){
			e=e||window.event;
			key=(e)?e.keyCode:65;
			var keyA={17:1,18:1,37:1,116:1};
			if(keyA[key])return 0;
		}
		else key=1;
		if(key==27)p.setUxOnOff();
		else if(key==38)p.bf.setUlmove(1);
		else if(key==40)p.bf.setUlmove(0);
		else{
			var c=String(p.value); //.trim();
			if(p._ply){
				setTimeout(function(){p.onkeyup(1);},100);
				return 0;
			}
			p._ply=0;
			if(!c){p.setHiding();return 0;}
			p._cvl='';
			if(p._myd[c]){if(p._myd[c][1]>0)p.setShowing();else p.setHiding();}
			else{
				p._ply=1;
				$ajax(p.playurl,function(dt){
					var d=dt.split('^');
					var e=d[0].split(',');
					p._myd[c]={0:e[0],1:e[1],2:d[1].split('|')};
					(e[1]>0)?p.setShowing():p.setHiding();
					p._ply=0;
				},{query:c},2);
			}
		}
		return 1;
	};
	p.setUxOnOff=function(){$z(p.bx)?p.setHiding():p.setShowing();};
	p.bx.setOPS=function(t,v){
		if(!p._ops[t])return 0;
		var f=(v==3);
		if(f)v=getcookie(t+'ck');
		if(!f&&v==p[t+'ck'])return 0;
		setcookie(t+'ck',v);
		p[t+'ck']=v;
		if(p._ops[t][1])p._ops[t][1](p,v,f);
	};
	p.ux.onclick=p.setUxOnOff;
	for(var dx in p._ops)p.bx.setOPS(dx,3);

	setStyleBox(p.ux,p.offsetTop+'px',(p.offsetLeft+p.offsetWidth-25)+'px',p.offsetHeight+'px',p.offsetHeight+'px');
}


function slideMove(p,nx,px,py,spd){
p=$(p);
if(!spd)spd=0.2;
p.spd=spd;
if(!p.nwno)p.nwno=0;
if(!p.spdslide)
{
	$p(p).style.position='relative';
	$p(p).style.overflow='hidden';
	p.x=0;
	p.y=0;
	p.nwno=0;
	p.mxno=0;
	if(px)p.mxno=Math.round($p(p).scrollWidth/px)-1;
	if(py)p.mxno=Math.round($p(p).scrollHeight/py)-1;

	p.px=px;
	p.py=py;
	p.spdslide=function(n){
		p.setpos(n);
		p.playing=true;
		p.tid=setInterval(function(){p.setplay()},20);
	};
	p.setplay=function(){
		p.x+=(p.x2-p.x)*p.spd;
		p.y+=(p.y2-p.y)*p.spd;
		
		p.setp(p.x,p.y);
		if(Math.round(p.x)==p.x2&&Math.round(p.y)==p.y2){
			p.x=Math.round(p.x);
			p.y=Math.round(p.y);
			p.setp(p.x,p.y);
			p.playing=false;
			clearInterval(p.tid);
		}
	};
	p.setpos=function(n){p.x2=p.px*n;p.y2=p.py*n;};
	p.setp=function(x,y){
		// p.style.filter='alpha(opacity='+((Math.abs(p.x2-x)/200)*100)+')';

		p.style.position='absolute';
		p.style.left=x+'px';p.style.top=y+'px';
	};
}
p.nwno=p.nwno+nx;
if(p.nwno>p.mxno)p.nwno=0;
if(p.nwno<0)p.nwno=p.mxno;
p.spdslide(p.nwno-(p.nwno*2));
}

function clip(s){
	var x=window.clipboardData;
	if(!x)return alert('Å¬¸³º¸µå¸¦ Áö¿øÇÏÁö ¾Ê´Â ºê¶ó¿ìÁ®ÀÔ´Ï´Ù.');
	if(s){
		x.setData('Text',s);
		alert('Å¬¸³º¸µå¿¡ ÀúÀåÇÏ¿´½À´Ï´Ù. (Ctrl+V·Î ºÙ¿©³Ö±â ÇÏ¼¼¿ä ^^)');
	}
	else return x.getData('Text');
}

// IE Begining Here !!
function _windowStart()
{
var s=(!isIE)?'opacity:0;':'filter:alpha(opacity=0);';
var a='position:absolute;left:0px;top:0px;';
document.write('<div id="stOverBack"></div>');
document.write('<iframe width="0" height="0" style="'+s+a+'" src="about:blank" name="R9TargetBox" id="R9TargetBox"></iframe>');
document.write('<div id="stOverPop" style="display:none;"><a name="popBoxHere" id="stOverPopClose" href="click:hide box" onclick="_hideBox();return false;"><img src="../inc/img/close.gif" border="0" /></a><div id="stOverPopBack"><div id="stOverPopIn"></div></div></div>');

try{

	var a=document.images;
	for(var i=0;i<a.length;i++){
		var d=a[i].nodeName.toLowerCase();
		if(d=='img'){
			if($atr(a[i],'ci'))	{
				a[i].myImg=a[i].src;
				if('hitMenu_'+$p(a[i]).id.substr(2,3)!=$p(a[i],3).className){
					a[i].onmouseover=function(){this.src=this.myImg.substr(0,this.myImg.length-4)+'on.gif';}
					a[i].onmouseout=function(){this.src=this.myImg;}
				}else{
					a[i].src=a[i].myImg.substr(0,a[i].myImg.length-4)+'on.gif';
				}
			}
		}
	}
}catch(e){}
}

function img_act(p) {
	if(isIE){
		if(!p.outImg){
			p.outImg=new Image();
			p.outImg.src=p.src;
			p.ovrImg=new Image();
			p.ovrImg.src=p.src.substring(0,p.src.length-4)+'on.gif';
		}
		p.filters[0].apply()
		p.src=p.ovrImg.src;
		p.filters[0].play()
	}	
}
function img_inact(p) {
	if(isIE){
		p.filters[0].apply()
		p.src=p.outImg.src;
		p.filters[0].play()
	}
}

function menu_layer(x){
	var i=0;
	while(1){
		i++;
		if(i==x)$s('menu'+i);
		else if($('menu'+i))$h('menu'+i);
		else break;
	}
}


function setRollImage(p,nms,fig,ival)
{
	p=$(p);
	if(!p)return false;
	p.bk=null;
	p.rollContinue=1;
	p.nimgchg=0;

	p.imgChange=function(n){
		if(!fig['i'+n])return false;
		if(isIE)p.filters.blendTrans.apply();
		$p(p).href=fig['i'+n][1];
		$p(p).target=fig['i'+n][2];
		p.src=fig['i'+n][0];
		if(isIE)p.filters.blendTrans.play();
		var e=$(nms+n);
		if(!e.scs)e.scs=e.src.substring(0,e.src.length-4);
		e.src=e.scs+'on.gif';	
		if(p.bk)p.bk.src=p.bk.scs+'.gif';
		p.bk=e;
	};
	
	var i=0;
	while(1){
		var q=$(nms+i);
		if(!q)break;
		q.mcCode=i;
		q.onmouseover=function(){
			p.rollContinue=0;
			p.imgChange(this.mcCode);
		};
		q.onmouseout=function(){p.rollContinue=1};
		i++;
	}

	setInterval(function(){
		if(p.rollContinue){
			if(p.nimgchg>=fig.length||!fig['i'+p.nimgchg])p.nimgchg=0;
			p.imgChange(p.nimgchg);
			p.nimgchg++;
		}	
	},ival);
}


function addNewValue(p,addId,maxAdd) {
	p=$(p);
	if($p(p).childNodes.length>maxAdd){
		alert('ÃÖ´ë '+maxAdd+' °³ ±îÁö¸¸ Ãß°¡ÇÒ ¼ö ÀÖ½À´Ï´Ù.');
		return false;
	}
	else{
		var e=$(addId).innerHTML.replace(/\[0\]/ig,'\['+$p(p).childNodes.length+'\]');
		$i(p,$n('p',e));
	}
}
function delNewValue(p) {
	p=$(p);
	if($p(p).childNodes.length>2)
		$p(p).removeChild($p(p).childNodes[1]);
	else alert('´õ ÀÌ»ó »èÁ¦ÇÒ ¼ö ¾ø½À´Ï´Ù.');
}

function moveStart(p,tm,bm,spd,spd2,mv)
{
	p=$(p);
	if(!p)return false;
	p.tm=(!tm)?118:tm;
	p.bm=(!bm)?118:bm;
	p.spd=(!spd)?10:spd;
	p.spd2=(!spd2)?2:spd2;
	p.mv=(!mv)?1:mv;
	p.mvspd=0;
	p.moving=function(){
		try{
			var db=document.body;

			p.spx=db.scrollTop;
			p.gtpos=p.spx;
			p.gbpos=p.spx;

			if(p.spx<p.tm){
				p.gtpos+=p.tm;
				p.gbpos+=p.tm;
			}
			else{
				p.gtpos+=10;
				p.gbpos+=10;
			}

			if(db.scrollHeight-p.bm>=p.offsetTop+p.offsetHeight){
				if(p.style.pixelTop<p.gtpos)p.style.pixelTop+=(p.gbpos-p.style.pixelTop)/p.spd;		
			}
			
			if(p.style.pixelTop>p.gtpos)p.style.pixelTop-=(p.style.pixelTop-p.gtpos)/p.spd;
			p.loop=setTimeout(function(){p.moving()},p.spd2);
		}catch(e){}
	}
	p.moving();
}



function docSetListAjax(p,q,fq)
{
	p=$(p);
	p.id=$b(p);
	if(!p)return;
	p.Qry=q;
	p.Qry.page=1;
	p.Fnd=fq;
	
	// page,sort,sortkey,key,value,type

	var di="$('"+p.id+"').";

	p.pageAllList=function(q){
		var d=[];
		if(q>1)d.push('<span class="pagePrev" style="cursor:pointer;" onclick="'+di+'pageAllList('+(q-10)+');"><span>[ÀÌÀü]</span></span>');
		for(var i=0;i<10;i++)d.push('<a style="cursor:pointer;'+(q-1==i?'font-weight:bold;color:#f20;':'')+'" class="pageno" onclick="'+di+'pageAllChange(this,'+(i+q)+');return false;" class="page cd'+i+'">'+(i+q)+'</a>');
		d.push('<span class="pageNext" style="cursor:pointer;" onclick="'+di+'pageAllList('+(q+10)+');"><span>[´ÙÀ½]</span></span>');
		$ih('pageAllList',d.join(' <strong>¡¤</strong> '));
	};

	p.pageAllChange=function(pp,np){
		$$('a.pageno',function(x){
			x.style.fontWeight='normal';
			x.style.color='#000000';
		},'pageAllList');
		pp.style.fontWeight='bold';
		pp.style.color='#ff2200';
		p.Qry.page=np;
		p.loadAjax(null,'paging');
	};

	p.ThName={};
	p.ThSorting=function(){
		$$('th',function(w){
			var n=$atr(w,'name');
			if(n){
				w.style.cursor='pointer';
				w.onclick=function(){
					$('sunWay').ThName[this.name]=($('sunWay').ThName[this.name]?0:1);
					this.asc=($('sunWay').ThName[this.name]?0:1);
					this.desc=($('sunWay').ThName[this.name]?1:0);
					p.loadAjax(this,'sort');
				};
			}
		},'sunWay');
	};

	p.loadAjax=function(f,mode,fnc,sf){
		var d=null;
		if(f&&mode=='search'){
			p.Qry.page=1;
			p.Qry.search=encodeURIComponent($fData(f,'&',function(n,v){return n+'='+v}));
		}
		else if(f&&mode=='sort'){
			p.Qry.page=1;
			p.Qry.sort=$atr(f,'name');
			p.Qry.sortkey=(f.desc?'desc':'asc');
			$$('th',function(r){$g((r==f?'on on'+p.Qry.sortkey:'off'),r)},p);
		}
		if(!sf&&p.Fnd)sf=p.Fnd;

		if(mode=='sort'||mode=='search'){
			if($('pageAllList')){
				$$('span.pageno',function(x){
					if(x.innerHTML==1){
						x.style.fontWeight='bold';
						x.style.color='#ff2200';
					}
					else{
						x.style.fontWeight='normal';
						x.style.color='#000000';
					}
				},'pageAllList');
			}
		}
		var er=[];
		var url=p.Qry.url+'?';
		if(mode)er.push('mode='+p.Qry.mode+'_'+mode);
		if(p.Qry.page)er.push('page='+p.Qry.page);
		if(p.Qry.sort)er.push('sort='+p.Qry.sort);
		if(p.Qry.sortkey)er.push('sortkey='+p.Qry.sortkey);
		if(p.Qry.search)er.push('search='+p.Qry.search);
		if(p.Qry.Q)er.push(p.Qry.Q);
	
		url+=er.join('&');
		$s('loadingBox');
		$ajax(url,function(dat){
			$ih('sunHere',dat);
			if(fnc)fnc();
			p.ThSorting();
			setTimeout(function(){
				$h('loadingBox');
				if($('sunHere'))$m('sunHere');
			},700);
			if($('sunWay').doEnder)$('sunWay').doEnder();
		},sf);
		return false;
	};

	if($('pageAllList'))p.pageAllList(1);
	p.ThSorting();
	if($('sunForm')){
		$('sunForm').onsubmit=function(){
			p.loadAjax(this,'chkmod',function(){alert('¼öÁ¤ÇÏ¿´½À´Ï´Ù.');},'sunForm');
			return false;
		};
	}
}

function autoSelall(p,da){
	var i=0,e='';
	p.dOvr=[];
	if(!p.doOvrColor){
		p.doOvrColor=function(r){
			p.dOvr[r].style.backgroundColor='#ff6600';
			p.dOvr[r].style.color='#ffffff';
			setTimeout(function(){
				p.dOvr[r].style.backgroundColor='#ffffff';
				p.dOvr[r].style.color='#000000';
			},1000);
		};
	}
	while(1){
		var d=$(da+i);
		if(!d||!d.nodeName)break;
		e=d.nodeName.toLowerCase();
		if(e=='select'){
			p.dOvr.push(d);
			p.doOvrColor(p.dOvr.length-1);
			for(var c=0;c<d.options.length;c++){
				if(c==p.selectedIndex){
					d.options[c].selected=true;
					break;
				}
			}
		}
		else if(e=='input'&&d.type.toLowerCase()=='text')d.value=p.value;
		else if(e=='input'&&d.type.toLowerCase()=='checkbox')d.checked=p.checked;
		else break;
		i++;
	}
}

function formAjaxModify(d,dd){
	if(!confirm('Á¤¸»·Î ¼öÁ¤ÇÏ½Ã°Ú½À´Ï±î ?'))return '';
	$ajax(d,function(e){
		if(e=='OK'){
			alert('¼öÁ¤ÇÏ¿´½À´Ï´Ù.');
			_hideBox();
			var ddd=$(dd);
			if(ddd&&ddd.loadAjax)ddd.loadAjax(null,'list');
		}
		else alert(e);
	});
	return false;
}

function $hgap(p){
	p=$(p);
	$s(p);
	p.aphk=100;
	var des=setInterval(function(){
		p.aphk-=5;
		if(isIE)p.style.filter='alpha(opacity='+p.aphk+')';
		if(p.aphk<10)$h(p);
	},100);
}

function autoBackColor(d,t){
	if(!t)t=500;
	d=$(d);
	if(!d)return false;
	d.oldBgcolor=d.style.backgroundColor;
	setInterval(function(){
		if(d.style.backgroundColor.toLowerCase()=='transparent'){
			d.style.backgroundColor=d.oldBgcolor;
		}else{
			d.style.backgroundColor='transparent';
		}
	},t);
}

function CatTCSel(f,v,m){
	if(!window[m+'_'+v])return '';
	var x=window[m+'_'+v];
	$s(f);
	if(f.options.length)
		for(var i=f.options.length-1;i>=0;i--)
			f.removeChild(f.options[i]);
	f.appendChild($n('option',{innerHTML:'ÇÏÀ§ Ç×¸ñÀ» ¼±ÅÃÇÏ¼¼¿ä.',value:''}));
	for(var t in x){
		f.appendChild($n('option',{innerHTML:x[t],value:t}));
	}
}

