<!--

var sendit;

// ?? ??
function _copy(theField) { 
	var temptxt = eval("document.all."+theField);
	var txt=document.body.createTextRange();
	txt.moveToElementText(temptxt);
	txt.select();
	txt.execCommand("copy");
	document.selection.empty();
}

//=================================================================================================================================
// ??? ??? ???
//=================================================================================================================================
function connecting(){
	alert("???? ??? ???. ??? ??? ???");
}

//show, hide ???
function showLayer(LayerNM) {
	document.getElementById(LayerNM).style.display='block';
}
function hideLayer(LayerNM) {
	document.getElementById(LayerNM).style.display='none';
}


//?? ??? - ????? ? ??, ???

function rollover(over){
	document.getElementById(over).style.border='3px solid #74ac0a';
}

function rollout(out){
	document.getElementById(out).style.border='0px solid #000000';
}

function rollover01(over){
	document.getElementById(over).style.border='5px solid #74ac0a';
}

function rollout01(out){
	document.getElementById(out).style.border='0px solid #000000';
}

function rollover02(over){
	document.getElementById(over).style.border='2px solid #74ac0a';
}

function rollout02(out){
	document.getElementById(out).style.border='0px solid #000000';
}

//????(???,???,???)
function tab(tab_name,max,tab_num) {
	for( i = 1; i <= max; i++){
		if (i == tab_num) { document.getElementById(tab_name+i).style.display = 'block'; }
		else { document.getElementById(tab_name+i).style.display = 'none'; }
	}
}

//FAQ
function faq(layername,max,j) {
	for(i=1;i<=max;i++){
			document.getElementById(layername + i).style.display = 'none';
	}
	document.getElementById(layername + j).style.display = 'block';
}

/* definition list toggle */
function initToggle(tabContainer) {
	triggers = tabContainer.getElementsByTagName("a");

	for(i = 0; i < triggers.length; i++) {
		if (triggers.item(i).href.split("#")[1])
			triggers.item(i).targetEl = document.getElementById(triggers.item(i).href.split("#")[1]);

		if (!triggers.item(i).targetEl)
			continue;

		triggers.item(i).targetEl.style.display = "none";
		triggers.item(i).onclick = function () {
			if (tabContainer.current == this) {
				this.targetEl.style.display = "none";
				tabContainer.current = null;
			} else {
				if (tabContainer.current) {
					tabContainer.current.targetEl.style.display = "none";
				}
				this.targetEl.style.display = "block";
				tabContainer.current = this;
			}
			return false;
		}
	}
}

// Tab Content
function initTabMenu(tabContainerID) {
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("a");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {
		if (tabAnchor.item(i).className == "tab")
			thismenu = tabAnchor.item(i);
		else
			continue;

		thismenu.container = tabContainer;
		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
		thismenu.targetEl.style.display = "none";
		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);
		thismenu.onclick = function tabMenuClick() {
			currentmenu = this.container.current;
			if (currentmenu == this)
				return false;

			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				if (currentmenu.imgEl) {
					currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_on.gif", ".gif");
				} else {
					currentmenu.className = currentmenu.className.replace(" on", "");
				}
			}
			this.targetEl.style.display = "";
			if (this.imgEl) {
				this.imgEl.src = this.imgEl.src.replace(".gif", "_on.gif");
			} else {
				this.className += " on";
			}
			this.container.current = this;

			return false;
		};

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	if (tabContainer.first)
		tabContainer.first.onclick();
}

// ???
function printWindow(){
	browserVersion = parseInt(navigator.appVersion)
		if (browserVersion >= 4) window.print()
}

// ??? ??
function layerView(obj){
	var obj = document.getElementById(obj);
	obj.style.display = "";
}

function layerHidden(obj){
	var obj = document.getElementById(obj);
	obj.style.display = "none";
}


// ??? ?? ?? 
// flashWrite(????, ??, ??, ???, ???, ??, ?????) 
function GetMPlayer(x,y,fn) {
	EmbedStr = "<OBJECT id='MPlayer' classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95' width='" + x + "' height='" + y + "' TYPE='application/x-oleobject' VIEWASTEXT >";
	if(fn)
		EmbedStr += "<param name='FileName' value='" + fn + "'>";
	EmbedStr += "<param name='ShowControls' value='0'>";
	EmbedStr += "<param name='autoStart' value='true'>";
	EmbedStr += "<param name='windowlessVideo' value='false'>";
	EmbedStr += "<param name='uiMode' value='none'>";
	EmbedStr += "<param name='volume' value='100'>";
	EmbedStr += "<param name='stretchToFit' value='true'>";
	EmbedStr += "<param name='autoRewind' value='false'>";
	EmbedStr += "<param name='transparentAtStart' value='true'>";
	EmbedStr += "<param name='enableContextMenu' value='false'>";
	EmbedStr += "</OBJECT>";
	document.write(EmbedStr);
	return;
}

function GetFlash(url,x,y,fn) { 
var EmbedStr;
	EmbedStr = "<object id='" + fn + "' name='" + fn + "' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='" + x + "' height='" + y + "'>";
	EmbedStr += "<param name='allowScriptAccess' value='always' />";
	EmbedStr += "<param name='movie' value='" + url + "' />";
	EmbedStr += "<param name='quality' value='high' />";
	EmbedStr += "<param name='bgcolor' value='#ffffff' />";
	EmbedStr += "<param name='menu' value='false' />";
	EmbedStr += "<param name='wmode' value='transparent' />";
	EmbedStr += "<param name='allowFullScreen' value='true' />";
	EmbedStr += "<embed id='" + fn + "' name='" + fn + "' src='" + url + "' quality='high' menu='false' wmode='transparent' bgcolor='#ffffff' width='" + x + "' height='" + y + "' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />";
	EmbedStr += "</object>";
	
	document.write(EmbedStr);
	return;
}

function flashWrite(url,w,h,id,bg,vars,win){ 
	var flashStr= 
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' name='"+id+"' align='middle'>"+ 
	"<param name='allowScriptAccess' value='always' />"+ 
	"<param name='movie' value='"+url+"' />"+ 
	"<param name='FlashVars' value='"+vars+"' />"+ 
	"<param name='wmode' value='"+win+"' />"+ 
	"<param name='menu' value='false' />"+
	"<param name='scaleMode' value='noScale' />"+
	"<param name='showMenu' value='false' />"+
	"<param name='align' value='CT' />"+ 
	"<param name='quality' value='high' />"+ 
	"<param name='bgcolor' value='"+bg+"' />"+ 
	"<embed src='"+url+"' FlashVars='"+vars+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' id='"+id+"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+ 
	"</object>"; 
	document.write(flashStr); 
} 


function flashWrite2(url,w,h,id,bg,vars,win){ 
	var flashStr= 
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' name='"+id+"' align='middle' onblur='clearFocus2()'>"+ 
	"<param name='allowScriptAccess' value='always' />"+ 
	"<param name='movie' value='"+url+"' />"+ 
	"<param name='FlashVars' value='"+vars+"' />"+ 
	"<param name='wmode' value='"+win+"' />"+ 
	"<param name='menu' value='false' />"+
	"<param name='scaleMode' value='noScale' />"+
	"<param name='showMenu' value='false' />"+
	"<param name='align' value='CT' />"+ 
	"<param name='quality' value='high' />"+ 
	"<param name='bgcolor' value='"+bg+"' />"+ 
	"<embed src='"+url+"' FlashVars='"+vars+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' id='"+id+"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+ 
	"</object>"; 
	document.write(flashStr); 
} 


function showSelectBox(){
	var selects = document.getElementsByTagName("select");
	for (i = 0; i != selects.length; i++) {
		selects[i].style.visibility = "visible";
	}
}

// ---------------------------------------------------

function hideSelectBox(){
	var selects = document.getElementsByTagName("select");
	for (i = 0; i != selects.length; i++) {
		selects[i].style.visibility = "hidden";
	}
}


function goURL(url)
{

	location.href = url;
}


//=================================================================================================================================
// ??? ?? ??
//=================================================================================================================================

function getMousePosition(ev, returntype)
{
	ev = ev || window.event;

	if (ev.pageX || ev.pageY){
		if (returntype == "LEFT")
			return ev.pageX;
		else if (returntype == "TOP")
			return ev.pageY;
		else{
			alert('getMousePosition-??? ?? ?? : returntype - ' + returntype); return;
		}
	}
		if (returntype == "LEFT"){
		if (window.innerWidth)
		return ev.clientX + window.pageXOffset - document.body.clientLeft + 10;		
		else if (document.documentElement && document.documentElement.clientWidth){
			return ev.clientX + document.documentElement.scrollLeft - document.body.clientLeft + 10;
		}else if(document.body.clientWidth)
			return ev.clientX + document.body.scrollLeft - document.body.clientLeft + 10;
			
	}else if (returntype == "TOP"){

		if (window.innerWidth)
			return ev.clientY + window.pageYOffset - document.body.clientTop;
		else if (document.documentElement && document.documentElement.clientWidth)
			return ev.clientY + document.documentElement.scrollTop - document.body.clientTop;
		else if(document.body.clientWidth)
			return ev.clientY + document.body.scrollTop - document.body.clientTop;
			

	}else{
		alert('getMousePosition-??? ?? ?? : returntype - ' + returntype);
	}
}

//=================================================================================================================================
// Lay Display ?? ??
//=================================================================================================================================

function infoView(obj){
	obj.style.display = "";
}

function infoHidden(obj){
	obj.style.display = "none";
}

function infoshow(obj){
	if(obj.style.display == 'none')
		obj.style.display = "";
	else
		obj.style.display = "none";
}

//=================================================================================================================================
// ??? ??? ??
//=================================================================================================================================
function editCheck(obj)
{
	var oEditor;
	oEditor = FCKeditorAPI.GetInstance(obj) ;
	var div = document.createElement("DIV");
	div.innerHTML = oEditor.GetXHTML();
	checkstr = div.innerHTML.toString();
	checkstr = checkstr.replace("&nbsp;", " ");
	if(isNull( div.innerHTML ) || checkstr.trim() == "")
	{
		return false;
		div.innerHTML = "";
	}
	else
		return true;
}

function isNull( s ) 
{
	if( s == null ) return true; 
	var result = s.replace(/(^\s*)|(\s*$)/g, ""); 
	if(result == "<BR>") result = "";
	if( result )
		return false; 
	else 
		return true; 
}

//=================================================================================================================================
// ????? ??? ????
// Number Key Only
//=================================================================================================================================
function NKO(obj) {
	if($F(obj))
	{
		if(!$F(obj).isNum())
		{
			alert("??? ?? ?? ???.");
			$(obj).value = "";
			return false;
		}
	}
}

function onlyNumber(obj) {
	// obj : ??? (ex. document.form.title)
	var checkOK = "0123456789";
	var checkStr = obj;
	var allValid = true;
	var decPoints = 0;
	var allNum = "";
	for (i = 0;  i < checkStr.length;  i++){
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
		if (ch == checkOK.charAt(j))
		break;
		if (j == checkOK.length){
			allValid = false;
			break;
		}
		allNum += ch;
	}
	if (!allValid){
		return false;
	} else {
		return true;
	}
}

//=================================================================================================================================
// ??? ?? ??
//=================================================================================================================================

function focusMove(obj,len,nxtObj)
{
	if(obj.value.length >= len)
		$(nxtObj).focus();
}

function emailChg(obj)
{
	if(obj.value)
	{
		$("email2").value = obj.value;
		$("email3").value = obj.value;
		$("email2").disabled = true;
	}
	else
	{
		$("email3").value = "";
		$("email2").value = "";
		$("email2").disabled = false;
		$("email2").focus();
	}
}

function keyCheck()
{
	if(!$F("keyword"))
	{
		alert("???? ???? ???");
		$("keyword").focus();
		return false;
	}
}

//=================================================================================================================================
// ???? ???? ????
//=================================================================================================================================
function byte_check(obj,length_limit){
	var length = calculate_msglen(obj.value);
	if (length > length_limit) {
		alert("?? " + length_limit + "? ??? ??? ???? ???? ?????.");
		obj.value = obj.value.replace(/\r\n$/, "");
		obj.value = assert_msglen(obj.value, length_limit);
		if($("viewcount"))
			$("viewcount").update(calculate_msglen(obj.value));

		obj.focus();
	}
}

function calculate_msglen(message){
	var nbytes = 0;
	for (i=0; i<message.length; i++) {
		var ch = message.charAt(i);
		if(escape(ch).length > 4) {
			nbytes += 2;
		} else if (ch == '\n') {
			if (message.charAt(i-1) != '\r') {
				nbytes += 1;
			}
		} else if (ch == '<' || ch == '>') {
			nbytes += 4;
		} else {
			nbytes += 1;
		}
	}
	if($("viewcount"))
		$("viewcount").update(nbytes);
	return nbytes;
}

function assert_msglen(message, maximum){
	var inc = 0;
	var nbytes = 0;
	var msg = "";
	var msglen = message.length;

	for (i=0; i<msglen; i++) {
		var ch = message.charAt(i);
		if (escape(ch).length > 4) {
			inc = 2;
		} else if (ch == '\n') {
			if (message.charAt(i-1) != '\r') {
				inc = 1;
			}
		} else if (ch == '<' || ch == '>') {
			inc = 4;
		} else {
			inc = 1;
		}
		if ((nbytes + inc) > maximum) {
			break;
		}
		nbytes += inc;
		msg += ch;
	}
	return msg;
}


function enableID(obj) {
	// obj : ??? (ex. document.form.title)
	var checkOK = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_";
	var checkStr = obj;
	var allValid = true;
	var decPoints = 0;
	var allNum = "";
	for (i = 0;  i < checkStr.length;  i++){
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
		if (ch == checkOK.charAt(j))
		break;
		if (j == checkOK.length){
			allValid = false;
			break;
		}
		allNum += ch;
	}
	if (!allValid){
		return false;
	} else {
		return true;
	}
}

function isValid_passwd( str )
{
	var cnt = 0;

	if( str == ""){
		alert("????? ?????.");
		return false;
	}
	
	/* check whether input value is included space or not  */
	var retVal = checkSpace( str );
	if( retVal ) {
		alert("?????? ??? ??? ????.");
		return false;
	}
	if(str.length < 5)
	{
		alert("????? 5? ?? ???? ???");
		return false;
	}
	for( var i=0; i < str.length; ++i)
	{
		if( str.charAt(0) == str.substring( i, i+1 ) ) ++cnt;
	}
	
	if( cnt == str.length ) {
		alert("???? ??? ? ??? ??? ????? ???? ????.");
		return false;
	}
	
	var isOnlyNum = false ;
	var isOnlyEng = false ;
	var isOnlySpc = false ;
	var ispwChk = true ;

	var filterNum = /[0-9]/ ;				// ??? ????
	var filterEng = /[a-zA-Z]/;				// ??? ????
	var filterSpc = /[!@#$%^&*()\"_\/+=\-\[\]{}';:?<>.,~`|\\]/ ;  // ????? ???? 

	var isIncNum = filterNum.test(str);
	var isIncEng = filterEng.test(str);
	var isIncSpc = filterSpc.test(str);
	
	isOnlyNum = isIncNum && !isIncEng && !isIncSpc;
	isOnlyEng = !isIncNum && isIncEng && !isIncSpc;
	isOnlySpc = !isIncNum && !isIncEng && isIncSpc;

	var strMsg;
	if(isOnlyNum) { //??? ?????? //??
		strMsg = "????? ? ????? ??? ? ????. ??? ?????? ????.";  
		ispwChk = false ;
	}
	else if(isOnlyEng) { //??? ?????? //??
		strMsg = "????? ? ????? ??? ? ????. ??? ?????? ????.";  
		ispwChk = false ;
	}
	else if(isOnlySpc) { //????? ?????? //?? 
		strMsg = "????? ????? ??? ? ????.";  
		ispwChk = false ;
	}
	
	if (!ispwChk) {
		alert(strMsg);
		return false;
	}
	
	return true;
}

function isValid_pwdChk( str )
{
	var cnt = 0;
	if( str == ""){
		document.getElementById("PWText").innerHTML = "<span class='p_text01 Ctype_orang_n'>(????? ??? ????)</span>";
		return false;
	}

    /* check whether input value is included space or not  */
	var retVal = checkSpace( str );
	if( retVal ) {
		document.getElementById("PWText").innerHTML = "<span class='p_text01 Ctype_orang_n'>(?????? ??? ??? ????.)</span>";
		return false;
	}
	if(str.length < 5)
	{
		document.getElementById("PWText").innerHTML = "<span class='p_text01 Ctype_orang_n'>(??,??,???? ???? 5~12?? ??? ???.)</span>";
		return false;
	}

	for( var i=0; i < str.length; ++i)
	{
		if( str.charAt(0) == str.substring( i, i+1 ) ) ++cnt;
	}
	
	if( cnt == str.length ) {
		document.getElementById("PWText").innerHTML = "<span class='p_text01 Ctype_orang_n'>(???? ??? ? ??? ??? ????? ???? ????.)</span>";
		return false;
	}
	
	var isOnlyNum = false ;
	var isOnlyEng = false ;
	var isOnlySpc = false ;
	var ispwChk = true ;

	var filterNum = /[0-9]/ ;				// ??? ????
	var filterEng = /[a-zA-Z]/;				// ??? ????
	var filterSpc = /[!@#$%^&*()\"_\/+=\-\[\]{}';:?<>.,~`|\\]/ ;  // ????? ???? 

	var isIncNum = filterNum.test(str);
	var isIncEng = filterEng.test(str);
	var isIncSpc = filterSpc.test(str);
	
	isOnlyNum = isIncNum && !isIncEng && !isIncSpc;
	isOnlyEng = !isIncNum && isIncEng && !isIncSpc;
	isOnlySpc = !isIncNum && !isIncEng && isIncSpc;

	var strMsg;
	if(isOnlyNum) { //??? ?????? //??
		strMsg = "<span class='p_text01 Ctype_orang_n'>(????? ? ????? ??? ? ????. ??? ?????? ????.)</span>";  
		ispwChk = false ;
	}
	else if(isOnlyEng) { //??? ?????? //??
		strMsg = "<span class='p_text01 Ctype_orang_n'>(????? ? ????? ??? ? ????. ??? ?????? ????.)</span>";  
		ispwChk = false ;
	}
	else if(isOnlySpc) { //????? ?????? //?? 
		strMsg = "<span class='p_text01 Ctype_orang_n'>(????? ????? ??? ? ????.)</span>";  
		ispwChk = false ;
	}
	
	if (!ispwChk) {
		document.getElementById("PWText").innerHTML = strMsg;
		return false;
	}

	document.getElementById("PWText").innerHTML = "<span class='p_text01 Ctype_green_n'>(?? ? ? ?? ???????.)</span>";

	return true;
}

function isValid_nickChk( str )
{
	var cnt = 0;
	if( str == ""){
		document.getElementById("PWText").innerHTML = "<span class='p_text01 Ctype_orang_n'>(????? ??? ????)</span>";
		return false;
	}

    /* check whether input value is included space or not  */
	var retVal = checkSpace( str );
	if( retVal ) {
		document.getElementById("PWText").innerHTML = "<span class='p_text01 Ctype_orang_n'>(?????? ??? ??? ????.)</span>";
		return false;
	}
	if(str.length < 5)
	{
		document.getElementById("PWText").innerHTML = "<span class='p_text01 Ctype_orang_n'>(??,??,???? ???? 5~12?? ??? ???.)</span>";
		return false;
	}

	for( var i=0; i < str.length; ++i)
	{
		if( str.charAt(0) == str.substring( i, i+1 ) ) ++cnt;
	}
	
	if( cnt == str.length ) {
		document.getElementById("PWText").innerHTML = "<span class='p_text01 Ctype_orang_n'>(???? ??? ? ??? ??? ????? ???? ????.)</span>";
		return false;
	}
	
	var isOnlyNum = false ;
	var isOnlyEng = false ;
	var isOnlySpc = false ;
	var ispwChk = true ;

	var filterNum = /[0-9]/ ;				// ??? ????
	var filterEng = /[a-zA-Z]/;				// ??? ????
	var filterSpc = /[!@#$%^&*()\"_\/+=\-\[\]{}';:?<>.,~`|\\]/ ;  // ????? ???? 

	var isIncNum = filterNum.test(str);
	var isIncEng = filterEng.test(str);
	var isIncSpc = filterSpc.test(str);
	
	isOnlyNum = isIncNum && !isIncEng && !isIncSpc;
	isOnlyEng = !isIncNum && isIncEng && !isIncSpc;
	isOnlySpc = !isIncNum && !isIncEng && isIncSpc;

	var strMsg;
	if(isOnlyNum) { //??? ?????? //??
		strMsg = "<span class='p_text01 Ctype_orang_n'>(????? ? ????? ??? ? ????. ??? ?????? ????.)</span>";  
		ispwChk = false ;
	}
	else if(isOnlyEng) { //??? ?????? //??
		strMsg = "<span class='p_text01 Ctype_orang_n'>(????? ? ????? ??? ? ????. ??? ?????? ????.)</span>";  
		ispwChk = false ;
	}
	else if(isOnlySpc) { //????? ?????? //?? 
		strMsg = "<span class='p_text01 Ctype_orang_n'>(????? ????? ??? ? ????.)</span>";  
		ispwChk = false ;
	}
	
	if (!ispwChk) {
		document.getElementById("PWText").innerHTML = strMsg;
		return false;
	}

	document.getElementById("PWText").innerHTML = "<span class='p_text01 Ctype_green_n'>(?? ? ? ?? ???????.)</span>";

	return true;
}


function checkSpace( str )
{
     if(str.search(/\s/) != -1){
     	return true;
     } else {
        return false;
     }
}


function SetCookie( name, value, expiredays ){
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expiredays );
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}

//???

function GetCookie( name ){
	var nameOfCookie = name + "=";
	var x = 0;
	while ( x <= document.cookie.length ){
		var y = (x+nameOfCookie.length);
		if ( document.cookie.substring( x, y ) == nameOfCookie ) {
			if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
			endOfCookie = document.cookie.length;
			return unescape( document.cookie.substring( y, endOfCookie ) );
		}
		x = document.cookie.indexOf( " ", x ) + 1;
		if ( x == 0 )
		break;
	}
	return "";
}



function chkMoney(obj) {
	obj.style.textAlign = "right"
	if(!$(obj).value.isNum())
	{
		$(obj).value = $(obj).value.toNum();
	}
	$(obj).value = parseInt($(obj).value);
	$(obj).value = $(obj).value.toMoney();
}



//=================================================================================================================================
// iFrame ??? ?? ???, ????
//=================================================================================================================================
function IframeResize(id){
    var ifrm = $(id);
    var the_height = ifrm.contentWindow.document.body.scrollHeight;
	if(the_height < 1)
		time_id = window.setTimeout("IframeResize('"+id+"')",10);
    ifrm.height = the_height+15;
}

function soFrameSize(id){
    var ifrm = $(id);
    var the_height = ifrm.contentWindow.document.body.scrollHeight;
	if(the_height < 1)
		time_id = window.setTimeout("soFrameSize('"+id+"')",10);
    ifrm.height = the_height+15;
	if(ifrm.height < 500)
		ifrm.height = 500;
}



//=================================================================================================================================
// ??? Resize
//=================================================================================================================================

function imgResize(obj,maxWidth)
{
	var w = obj.width;
	var h = obj.height;
	if (w<=0) 
		window.setTimeout("imgResize('" + obj + "'," + maxWidth + ")",100);
	else 
	{
		if (w > maxWidth)
			obj.width = maxWidth;
	}
}

//=================================================================================================================================
// ??? ??
//=================================================================================================================================

function loginCheck()
{
	if(!confirm("??? ? ?? ?????\n\n??? ???? ?? ???????"))
		return false;
	document.footerLoginForm.submit();
}



function FormChecker(f)
{

	var fu = new FormUtil(f);
	if(!fu.success())
		return false;
	else
		return true;
}


function allcheck()
{
	if(document.all.chkbox)
	{
		if(document.all.chkbox.length)
		{
			for(i=0;i<document.all.chkbox.length;i++)
			{
				document.all.chkbox[i].checked = document.all.allchk.checked;
			}
		}
		else
		{
			document.all.chkbox.checked = document.all.allchk.checked;
		}
	}
}


function sCheck(f)
{
	if(!f.keyword.value || f.keyword.value.trim() == "")
	{
		alert("???? ???? ???!");
		f.keyword.value = "";
		f.keyword.focus();
		return false;
	}
	return true;
}

function ajaxLoad(ele)
{
	$(ele).startWaiting();
}


function ajaxLoadEnd(ele,n)
{
	$(ele).stopWaiting();
}

function idCheck(str)
{
	var pars = "mode=IDCHK&usr_id=" + encodeURIComponent(str);
//	$("IDText").update ("<span class='p_text01 Ctype_orang_n'>(??? ??????.)</span>");
	var ajax = new Ajax.Updater (
		"IDText",
		"/include/ajaxIDNICKUpdater.asp",
		{
			parameters : pars
		}
	);

	return false;
}

function nickCheck(str)
{
	var pars = "mode=NICKCHK&usr_nicknm=" + encodeURIComponent(str);
//	$("NICKText").update ("<span class='p_text01 Ctype_orang_n'>(??? ??????.)</span>");
	var ajax = new Ajax.Updater (
		"NICKText",
		"/include/ajaxIDNICKUpdater.asp",
		{
			parameters : pars
		}
	);

	return false;
}

function popZIPChk(frm)
{
	if($F("dong").length < 2)
	{
		alert("???? ???? ???? ???");
		$("dong").focus();
		return false;
	}
	var pars = "mode=ZIPCODE&dong=" + encodeURIComponent($F("dong"));
	$("zipcodeList").update ("<div align='center' style='padding:100 0 0 110'><img src='/images/etc/loading.gif'></div>");
	var ajax = new Ajax.Updater (
		"zipcodeList",
		"/include/ajaxZipUpdater.asp",
		{
			parameters : pars
		}
	);

	return false;
}

function zipCheckOK(a,b,c)
{
	document.frm.a1_21.value = a;
	document.frm.a1_22.value = b;
	document.frm.a1_23.value = c;
	hs.close();
	document.frm.a1_24.focus();
}


function popAREAChk(area1,sido,gugun,dong,ele)
{
	var area1;
	var area2;
	
	if (area1 == 'sido') {
		$("dongList").update ("");
		document.shopChkForm.shop_sido.value = sido;
		document.shopChkForm.shop_gugun.value = '';
		document.shopChkForm.shop_dong.value = '';

		var pars = "mode=SHOP_GUGUN&sido=" + encodeURIComponent(sido);
	
		$("gugunList").update ("<div align='center'><br />???</div>");

		var ajax = new Ajax.Request (
			"/include/ajaxAreaUpdater.asp",
			{
				parameters : pars,
				onLoading : ajaxLoad("gugunList"),
				onSuccess : function (req){
					$("gugunList").update (req.responseText);
				},
				onComplete : ajaxLoadEnd ("gugunList"),
				onFailure : function (req){
					alert (req.responseText);
				}
			}
		);

		if (ele >= 0) {
			for(i=0;i<idSido.length;i++)
			{
				idSido[i].className = "";
			}
			idSido[ele].className = "AreaCheck";
		} else {
			for(i=0;i<idSido.length;i++)
			{
				idSido[i].className = "";
			}
		}
	
	} else if (area1 == 'gugun') {
		document.shopChkForm.shop_gugun.value = gugun;
		document.shopChkForm.shop_dong.value = '';

		var pars = "mode=SHOP_DONG&sido=" + encodeURIComponent(sido) + "&gugun=" + encodeURIComponent(gugun);
	
		$("dongList").update ("<div align='center'><br />???</div>");
		var ajax = new Ajax.Updater (
			"dongList",
			"/include/ajaxAreaUpdater.asp",
			{
				parameters : pars
			}
		);

		if (ele >= 0) {
			for(i=0;i<idGugun.length;i++)
			{
				idGugun[i].className = "";
			}
			idGugun[ele].className = "AreaCheck";
		} else {
			if (idGugun) {
				for(i=0;i<idGugun.length;i++)
				{
					idGugun[i].className = "";
				}
			}
		}
	
	} else if (area1 == 'dong') {

		document.shopChkForm.shop_dong.value = dong;

		if (ele >= 0) {
			for(i=0;i<idDong.length;i++)
			{
				idDong[i].className = "";
			}
			idDong[ele].className = "AreaCheck";
		} else {
			for(i=0;i<idDong.length;i++)
			{
				idDong[i].className = "";
			}
		}
	
	}

	var pars_shop_sido;
	var pars_shop_gugun;
	var pars_shop_dong;
	var pars_sngflag;
	var pars_shop_nm;
	
	for(var i=0;i<document.shopChkForm.sngflag.length;i++){
		if(document.shopChkForm.sngflag[i].checked){
			pars_sngflag = document.shopChkForm.sngflag[i].value;
		}
	}

	pars_shop_sido = document.shopChkForm.shop_sido.value;
	pars_shop_gugun = document.shopChkForm.shop_gugun.value;
	pars_shop_dong = document.shopChkForm.shop_dong.value;
	pars_shop_nm = document.shopChkForm.shop_nm.value;

	var pars = "mode=SHOP_SEARCH&shop_nm=" + encodeURIComponent(pars_shop_nm) + "&sngflag=" + encodeURIComponent(pars_sngflag) + "&shop_sido=" + encodeURIComponent(pars_shop_sido) + "&shop_gugun=" + encodeURIComponent(pars_shop_gugun) + "&shop_dong=" + encodeURIComponent(pars_shop_dong);
	$("shopList").update ("<div align='center'><br /><img src='/images/common/loading.gif'></div>");
	var ajax = new Ajax.Updater (
		"shopList",
		"/include/ajaxAreaUpdater.asp",
		{
			parameters : pars
		}
	);

	return false;
}

function popGLFSHOPChk(area1,sido,gugun,dong,ele)
{
	var area1;
	var area2;
	
	if (area1 == 'sido') {
		$("dongList").update ("");
		document.shopChkForm.shop_sido.value = sido;
		document.shopChkForm.shop_gugun.value = '';
		document.shopChkForm.shop_dong.value = '';

		var pars = "mode=SHOP_GUGUN&sido=" + encodeURIComponent(sido);
	
		$("gugunList").update ("<div align='center'><br />???</div>");

		var ajax = new Ajax.Request (
			"/include/ajaxSHOPUpdater.asp",
			{
				parameters : pars,
				onLoading : ajaxLoad("gugunList"),
				onSuccess : function (req){
					$("gugunList").update (req.responseText);
				},
				onComplete : ajaxLoadEnd ("gugunList"),
				onFailure : function (req){
					alert (req.responseText);
				}
			}
		);

		if (ele >= 0) {
			for(i=0;i<idSido.length;i++)
			{
				idSido[i].className = "";
			}
			idSido[ele].className = "AreaCheck";
		} else {
			for(i=0;i<idSido.length;i++)
			{
				idSido[i].className = "";
			}
		}
	
	} else if (area1 == 'gugun') {
		document.shopChkForm.shop_gugun.value = gugun;
		document.shopChkForm.shop_dong.value = '';

		var pars = "mode=SHOP_DONG&sido=" + encodeURIComponent(sido) + "&gugun=" + encodeURIComponent(gugun);
	
		$("dongList").update ("<div align='center'><br />???</div>");
		var ajax = new Ajax.Updater (
			"dongList",
			"/include/ajaxSHOPUpdater.asp",
			{
				parameters : pars
			}
		);

		if (ele >= 0) {
			for(i=0;i<idGugun.length;i++)
			{
				idGugun[i].className = "";
			}
			idGugun[ele].className = "AreaCheck";
		} else {
			if (idGugun) {
				for(i=0;i<idGugun.length;i++)
				{
					idGugun[i].className = "";
				}
			}
		}
	
	} else if (area1 == 'dong') {

		document.shopChkForm.shop_dong.value = dong;

		if (ele >= 0) {
			for(i=0;i<idDong.length;i++)
			{
				idDong[i].className = "";
			}
			idDong[ele].className = "AreaCheck";
		} else {
			for(i=0;i<idDong.length;i++)
			{
				idDong[i].className = "";
			}
		}
	
	}

	var pars_shop_sido;
	var pars_shop_gugun;
	var pars_shop_dong;
	
	pars_shop_sido = document.shopChkForm.shop_sido.value;
	pars_shop_gugun = document.shopChkForm.shop_gugun.value;
	pars_shop_dong = document.shopChkForm.shop_dong.value;

	var pars = "mode=SHOP_SEARCH&shop_sido=" + encodeURIComponent(pars_shop_sido) + "&shop_gugun=" + encodeURIComponent(pars_shop_gugun) + "&shop_dong=" + encodeURIComponent(pars_shop_dong);
	$("shopList").update ("<select name='select_result' id='select_result' multiple='multiple' style='width:330;height:100;'><option>??? ??????. ??? ??????..</option></select>");
	var ajax = new Ajax.Updater (
		"shopList",
		"/include/ajaxSHOPUpdater.asp",
		{
			parameters : pars
		}
	);

	return false;
}


function popSHOPChk(frm)
{
	for(var i=0;i<frm.sngflag.length;i++){
		if(frm.sngflag[i].checked){
			sngflagvalue = frm.sngflag[i].value;
		}
	}

	if(!$F("shop_nm") && !$F("shop_sido"))
	{
		alert("????? ???? ????? ??? ??? ????.");
		return false;
	}
	var pars = "mode=SHOP_SEARCH&shop_nm=" + encodeURIComponent($F("shop_nm")) + "&sngflag=" + encodeURIComponent(sngflagvalue) + "&shop_sido=" + encodeURIComponent($F("shop_sido")) + "&shop_gugun=" + encodeURIComponent($F("shop_gugun")) + "&shop_dong=" + encodeURIComponent($F("shop_dong"));
	$("shopList").update ("<div align='center'><br /><img src='/images/common/loading.gif'></div>");
	var ajax = new Ajax.Updater (
		"shopList",
		"/include/ajaxAreaUpdater.asp",
		{
			parameters : pars
		}
	);

	return false;
}


function shopCheckOK(a,b)
{
	document.frm.rgn_nm.value = a;
	document.frm.mainuse_rgnno.value = b;
	hs.close();
}

function uploadCheck()
{
	var f = document.uploadForm;
	var fu = new FormUtil(f);
	if(fu.success())
	{
		$("upButton").update("??? ??? ???. ??? ??? ???");
		f.submit();
	}
}

function filedel(ele)
{
	$(ele).value = "";
	$(ele + "Info").update ("");
	$(ele + "but").show();
}


//??? ??? ???
function toggleSlow() {    
    if (isSlow) {
        closeSlow();        
    } else {
        openSlow();
    }                
}    


var isSlow = false;
function openSlow() {
    isSlow = true;    
    document.getElementById("Slow_Layer").style.display = "";   
    
}  

function closeSlow() { 
    isSlow = false;
    document.getElementById("Slow_Layer").style.display = "none";    
}  

function playSlow(rate,img) {
    closeSlow();
    WMPlay.stop();
    playRate(rate);
	if(img) $("spdimg").src = img;
}    

function playRate(rate) {     
    WMPlay.rate=rate;
    WMPlay.play();    
}



function toggleLinkCopy() {
    if (isLinkCopy) {
        closeLinkCopy();        
    } else {
        openLinkCopy();
    }                
}  


function addFriend(id)
{
	if(!confirm("??? ?? ???????"))
		return false;
	var pars = "ajaxMode=ADDFRD&addID=" + id;
	var ajax = new Ajax.Request (
		"/include/ajaxRequest.asp",
		{
			parameters	: pars,
			onSuccess	: function (req){
				alert(req.responseText);
				try{ afterAddFriend(); } catch(e){}
				hs.close();
			}
		}
	);
}


//=================================================================================================================================
// ?? ??? ???
//=================================================================================================================================
	var win = null;
	function NewWindow(mypage,myname,w,h,scroll){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
	win = window.open(mypage,myname,settings);
	win.focus();
	} 

//=================================================================================================================================
// Ajax Layer ???
//=================================================================================================================================
	var MiniTagActive = false;
	function viewAjaxLayer(targetObjId, responsePage, param, ajaxlr, ev)
	{
		pars = param;
		if(responsePage == "/include/MiniNameTag.asp" || responsePage == "/include/MiniNameTagGLT.asp")
			MiniTagActive = true;
		new Ajax.Updater(
			targetObjId,
			responsePage,
			{
				parameters : pars
			}
		);
		
		targetObj = $(targetObjId)
		targetObj.style.display = "none";
		
		if (ajaxlr == 'right') {
			targetObj.style.top = getMousePosition(ev, "TOP") - 30;
			targetObj.style.left = getMousePosition(ev, "LEFT") - 420;
		} else {
			targetObj.style.top = getMousePosition(ev, "TOP") - 30;
			targetObj.style.left = getMousePosition(ev, "LEFT") + 10;
		}

		targetObj.style.display = "block";
		targetObj.style.zIndex = 100;
	
	}

	function miniTagCheck()
	{
		if(MiniTagActive)
		{
			$("ajaxLayer").update("");
		}
	}

//=================================================================================================================================
// Ajax Layer ??? ?? ??
//=================================================================================================================================
	function viewAjaxLayer2(targetObjId, responsePage, param, ev)
	{
		pars = param;
		
		new Ajax.Updater(
			targetObjId,
			responsePage,
			{
				parameters : pars
			}
		);
		
		targetObj = $(targetObjId)
	
		targetObj.style.display = "none";
		targetObj.style.top = 70;
		targetObj.style.left = 0;
		targetObj.style.display = "block";
	
	}
// -->
 
function urNameTag(usid){
	var succ=function(o){
		var ur=Ext.get('urnametagL');
		ur.zIndex = 1000;
		ur.update(o.responseText);
		ur.show();
		ur.alignTo(document.body, 'b-c');
		afterAddFriend();
	}
	Ext.Ajax.request({
		url:'/nametex/nametex_you.asp?usid='+usid, success:succ
	});
}

function urNameTagMain(usid){
	hiddenfrm.location.href='/include/ajaxNameTagupdater.asp?usr_id=' + usid;

	var succ=function(o){
		var ur=Ext.get('urnametagL');
		ur.zIndex = 1000;
		ur.update(o.responseText);
		ur.show();
		ur.alignTo(document.body, 'b-c');
		afterAddFriend();
	}
	Ext.Ajax.request({
		url:'/nametex/nametex_you.asp?usid='+usid, success:succ
	});
}

var MiniNameTagOver = 0;

function miniNameTagClose ()
{
	if(MiniNameTagOver > 1)
	{
		hs.close();
		MiniNameTagOver = 0;
	}
	else
	{
		MiniNameTagOver++;
	}

}


///////////// ????
var initBody;

function beforePrint(){ 
	initBody = document.body.innerHTML; 
	document.body.innerHTML = prtContent.innerHTML; 
	} 
function afterPrint(){ 
	document.body.innerHTML = initBody; 
	} 
function printArea() { 
	window.onbeforeprint = beforePrint;  
	window.onafterprint = afterPrint; 
	window.print(); } 


function loginTimeOut()
{
	if(!confirm("??? ??? ???? ? ??? ? ???? ???.\n\n??? ???? ?? ???????"))
		return false;
	document.footerLoginForm.submit();
}


//=================================================================================================================================
// ?? ???? ??
//=================================================================================================================================

var logouttime = 0;
var sitv;

function timeInterval() {

	logouttime +=1;

	if (logouttime > 10800)	{	// ??? ?? ??
		if (document.getElementById("hiddenfrm")) {
			hiddenfrm.location.href="/member/timeOut.asp"
		}
		clearInterval(sitv);
	}
}

sitv = setInterval('timeInterval()',1000);

function goMyScore(game_no,usr_id,evt_no){
	NewWindow("/contestzon/popup_myscore.asp?game_no="+game_no+"&usr_id="+usr_id+"&evt_no="+evt_no,"score",800,730);

}

function goMyScoreMini(game_no,usr_id,evt_no){
	NewWindow("/contestzon/popup_myscore_mini.asp?game_no="+game_no+"&usr_id="+usr_id+"&evt_no="+evt_no,"score",800,730);

}


function imgResize3(img_id, wWindow, hWindow)
{
	var img = document.getElementById(img_id);
	var wImage = img.width;
	var hImage = img.height;

	if (wImage > wWindow || hImage > hWindow)
	{
			if (wImage*hWindow > wWindow*hImage)
			{
				wResult = wWindow
				hResult = hImage*wResult/wImage
			}
			else
			{
				hResult = hWindow
				wResult = wImage*hResult/hImage
			}
	}
	else {
		wResult = wImage;
		hResult = hImage;
	}
	img.width = wResult;
	img.height = hResult;

}

// quotation mark ??? ??, delay? 100??? ???.
function imgResize3Helper(img_id, wWindow, hWindow, delay)
{
	window.setTimeout("imgResize3(\"" + img_id + "\"," + wWindow + "," + hWindow + ")", delay);

}




//=================================================================================================================================
// ??? ??(??) - replace??
//=================================================================================================================================

String.prototype.swapchar = function (str, swapstr) {
	
}





//==================================================
// ??? Best???
//==================================================
	function setBest(obj, tablename, setmode, contidx, maxqty)
	{
		if (obj.checked)
			best_yn = "Y";
		else
			best_yn = "N";

		param = "tableName="+tablename+"&best_yn="+best_yn+"&bestType="+setmode+"&idx="+contidx+"&maxqty="+maxqty;
		
		new Ajax.Request(
			"/supervisor/include/AjaxSetBest.asp",
			{
				parameters : param,
				onSuccess : function (req){
					msg = req.responseText;
					eval(msg);
				},
				onFailure : function (req){
					msg = req.responseText;
					alert(msg)
				}
			}
		);
	}



function makeURICompParam(param)
{
	var tempArr1 = new Array();
	var returnStr = "";

	tempArr1 = param.split("&");

	for (i=0; i<tempArr1.length; i++)
	{
		if (i!=0)
			returnStr+="&"

		returnStr += tempArr1[i].split("=")[0] + "=" + encodeURIComponent(tempArr1[i].split("=")[1]);
	}

	return returnStr
}


//	refreshArea(??????id, ??????, ????)
function refreshArea(refreshArea, fileName, param)
{
	new Ajax.Request(
		fileName,
		{
			parameters : makeURICompParam(param),
			onSuccess : function (req){
				$(refreshArea).innerHTML = req.responseText;
				if (parent.$("setFrameSize")){
					parent.$("setFrameSize").click();
				}
			},
			onFailure : function (req){
				alert(req.responseText);
			}
		}
	);
}

function refreshAreaWithReply(refreshArea, fileName, param, idx, depth)
{
	if (!idx){idx = 1}

	new Ajax.Request(
		fileName,
		{
			parameters : makeURICompParam(param),
			onSuccess : function (req){
				$(refreshArea).innerHTML = req.responseText;
				zz = window.setTimeout('refreshArea("replyArea", "/ajaxForm/ajaxReply.asp", "depth='+depth+'&pidx='+idx+'")' , 100);
				setAjaxSltBox()
			},
			onFailure : function (req){
				alert(req.responseText);
			}
		}
	);
}

function loginCheckForm(obj, cookieID)
{
	if (!cookieID){
		$("logPop").click();
		obj.blur();
	}else{
		if (obj.value == obj.defaultValue){
			obj.value="";
		}
	}
}


/*?? ? ?? ??**************************************************************************/
//????, ??, ?????
function setReply(cookieID, pidx, idx, depth, mode, page)
{
	race = "";
	cmt = "";

	if (mode=="DEL" && !confirm("?? ?????????")){
		return false;
	}


	if (mode=="NEW"){
		obj = document.cheer;
		race = obj.replySelectBox[obj.replySelectBox.selectedIndex].value;
		cmt = obj.cmt.value;

		if (!cookieID){
			showHideLayers('log_box','','show');
		}

		if (!cmt || cmt == obj.cmt.defaultValue){
			alert("?? ??? ??? ???");
			obj.cmt.focus();
			return false;;
		}else if (obj.replySelectBox.selectedIndex==0){
			alert("??? ??? ???");
			return false;
		}
	}

	if (mode=="EDITSUBMIT"){
		cmt = $("editCmt").value;

		if (!cmt || cmt == $('editCmt').defaultValue){
			alert("?? ??? ??? ???");
			$('editCmt').focus();
			return false;
		}
	}

	param = 'mode='+mode+'&pidx='+pidx+'&idx='+idx+'&depth='+depth+'&cmt='+cmt+"&race="+race;

	if (mode!="DEL" && mode!="NEW"){
			param += "&page="+page;
	}

	refreshArea('replyArea', '/ajaxForm/ajaxReply.asp', param);

	return false;
}
/****************************************************************************************************************************/



//?? ?? ? length? ???? ?????? ?? ????? ??? ??
function checkLenNGo(obj, maxlen, targetObj)
{
	if (obj.value.length >= maxlen){
		if (targetObj.nodeType == 3 && $(targetObj)){
			$(targetObj).focus();
		}else if (targetObj.nodeType==1){
			targetObj.focus();
		}
	}
}


//???? ???(?????), ???(????)
	function setEmail(obj, targetobj)
	{
		if (obj.selectedIndex!=0){
			if (obj.selectedIndex == obj.options.length-1){
				targetobj.readOnly = false;
				targetobj.value="";
				targetobj.focus();
			}else{
				targetobj.readOnly = true;
				targetobj.value = obj[obj.selectedIndex].value;
			}
		}
	}


function goLogin()
{
	document.footerLoginForm.submit();
}





//****************************************************TagFree ???????************************************************************
//?????
function setTagEditer(width, height, defaultValue, objId)
{
	var clsid =  "154BFB55-C14A-49c3-BC94-887BDA7C2BEE";
	var version = "3,0,0,1035";
	var cab = "http://new.wjstars.com/webEditer/tweditor.cab";
	var env = "http://new.wjstars.com/webEditer/env.xml";
	var applyinitdata = 1;//apply:1
	var editmode = 0;//edit:0

	var key = "MDVGNDhGQThBQzc5MDlDMjFEMTVEQUNEQzBFMjBFMEI2MDhCMjczQTZCMkVDOTk0RTdEM0MxNDZDQzkzQUNFMzFEN0Y5MjUzRjFDQzZCMjk0MkI5MzhENDQwMDAxMjkyMjIwMzMxMUM0QjdGOEQzODFGQjI2Mjc0NkI0QzBGRjc1M0FCQzU0REVBRUJBNjgwMTdEM0FBQ0I3MjFDMTgxQTRCQjg4NEE5NTNFMEUyNTE2RTczNUUwMkQwQThBMjUwMDJDQjhGQzhENjQ2MzhFMzdGREQ5MUU2OTcwMEI1MEI2RjExQUQxNjEwRjNDMTNCMEIwRTBDNDJGNEZFNzZFQTNFQjM1NDZFQURDQzhEQzJBRUJFQ0FENjRGQkQ0MTVCNDdDRTk4NjBFRUNFQURCMUNFRTJCMzJDRUEzQzc2RkNBQjg4NzBCMzg3NzFDMTM0AA==";

	document.write('<object ID="'+objId+'" width="'+width+'" height="'+height+'" CLASSID="CLSID:'+clsid+'" CODEBASE="'+cab+'#version='+version+'" >');
	document.write('<PARAM name="InitFile" value="'+env+'"/>');
	document.write('<PARAM name="ApplyInitData" VALUE="'+applyinitdata+'"/>');
	document.write('<PARAM name="Mode" VALUE="'+editmode+'"/>');
	document.write('<PARAM name="LicenseKey" value="'+key+'">');
	document.write('</object>');
}

function setWebEditerInAjax(objId, width, height, defaultValue)
{
	setTagEditer('"'+width+'"', '"'+height+'"', '"'+defaultValue+'"', '"'+objId+'"');
	evalStr = "document."+formName+"."+objId+".HtmlValue = '"+defaultValue+"'"
	eval(evalStr);
}

function setContents(value)
{
	try{
		document.frm.contents.HtmlValue = value;
	}
	catch (err){
		setContetns_re = window.setTimeout("setContents('"+value+"')", 50);
	}
}


//?????
function makeContForm(strMIMEValue, txt)
{
    var form = document.frm;
    var tags;

	// ??? MIME ???? 100KB ??? ????
	// foContents?? ??? hidden ?? ? ??? ???? ??.
	// ?? ?(???? TWE_UPDATE.asp)??? 
	// ?? contents ? ???? ????? ???? ????? ??.

	if (txt.length > 0 ){
		while(strMIMEValue.length > 0)
		{
				tags = document.createElement("input");
				tags.setAttribute("type", "hidden");
				tags.name = "foContents";
				tags.value = strMIMEValue.substr(0, 102400);
				form.appendChild(tags);
				strMIMEValue = strMIMEValue.substr(102400);
		}
		return true;
	}else{
		return false;
	}
}


//********************************************************************************************************************************************************************************************


function file_image_inline(name,target,target_type,img,img_over,width,height) {
	var html = "";
	html += "<span style=\"position:relative;display:inline-block;\">";
	html += "<span style=\"position:absolute;bottom:0;right:0;display:inline;width:" + width + "px;height:" + height + "px;overflow:hidden;\">";
	html += "<input type=\"file\" name=\"" + name + "\" style=\"position:absolute;bottom:-10px;right:-10px;height:" + (height+20) + "px;font-size:" + width + "px;opacity:0;filter:alpha(opacity=0);\"";
	if(target)
		html += " onchange=\"document.getElementById('" + target + "')." + target_type + "=this.value;\"";
	if(img_over)
		html += " onmouseover=\"this.parentNode.nextSibling.src='" + img_over + "';\" onmouseout=\"this.parentNode.nextSibling.src='" + img + "';\"";
	html += " />";
	html += "</span>";
	html += "<img src=\"" + img + "\" alt=\"????\" border=\"0\" style=\"vertical-align:middle;\" />";
	html += "</span>";

	document.write(html);
}

function checkUserAuth(banLevel, pageMode)
{
	if (pageMode=="VIEW"){
		checkBanLevel = 2
	}else if (pageMode == "WRITE"){
		checkBanLevel = 3
	}

	if (banLevel >= checkBanLevel){
		alert("?? ???? ?? ???? ?????\n??? ? ???? ???? ??? ????? ????");
		return true;
	}
	return false;
}

function poll(){
	var w_width;
	var w_height;
	w_width = 537;//477;
	w_height = 380;//355;
	if (navigator.userAgent.indexOf('MSIE 7')>0){
		w_height = w_height;
	}else{
		w_height = w_height - 20;
	}
	w_left = screen.availWidth/2-w_width/2;
	w_top = screen.availHeight/2-w_height/2;
	window.open('/utility/research.rex','poll','status=no,toolbar=no,scrollbars=no,top=' + w_top + ',left=' + w_left + ',width=' + w_width + ',height=' + w_height + ',directories=no,menubar=no,screenX=10,screenY=20');
}

function isBlank(val) {
  if (val.split(" ").join("") == "") {
    return true;
  } else {
    return false;
  }
}

function chkNull(obj) {
	//try{
  switch (obj.type) {
    // text, password, file, textarea
    case "text" :
    case "password" :
    case "file" :
    case "textarea" :
    case "hidden" :

      if (isBlank(obj.value)) {
          return false;
      } else {
        return true;
      }
      break;
    // checkbox
    case "checkbox" :
      if (!obj.checked) {
          return false;
      } else {
        return true;
      }
      break;
    // radiobutton
    case "radio" :
      var obj_len = obj.length;

      for (i=0; i < obj_len; i++) {
        if (obj[i].checked == true)
          return false;
      }

      if (i == obj_len) {
        return true;
      }
      break;
  }

     // select list
  if (obj.type.indexOf("select") != -1) {
    if (obj.options[obj.selectedIndex].value == 0 || obj.options[obj.selectedIndex].value == ""){
      return false;
    }else{
      return true;
    }
  }

  return true;
    //}
    //catch(e)
    //{
    //    err_handle(e);
    //}
}

function nullChk(obj) {
	var str = obj.value; 
	str = str.replace(/^\s+|\s+$/,"");

	return str;
}

function isNumber(numval){
	for(i=0; i<numval.length; i++){
		str=numval.charCodeAt(i);
		if(str<48 || str>57)
			return false;
	}
	return true;
}	

function isEmail(str) {
	  // regular expression 
	  var supported = 0;
	  if (window.RegExp) {
		var tempStr = "a";
		var tempReg = new RegExp(tempStr);
		if (tempReg.test(tempStr)) supported = 1;
	  }
	  if (!supported) 
		return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
	  var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
	  var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
	  return (!r1.test(str) && r2.test(str));
}

function winOPC(url,popname,w,h) {
	window.open( url, popname, "width="+w+",height="+h+",left="+((screen.width - w)/2)+",top="+((screen.height - h)/2) + ",resizable=0, scrollbars=0");
}

function winOPCS(url,popname, w,h) {
	window.open( url, popname, "width="+w+",height="+h+",left="+((screen.width/2)-200)+",top="+((screen.height/2)-200) + ",resizable=0, scrollbars=1");
}

function winNOMAL(url,popname) {
	window.open( url, popname);
}

function alpha_chk(str) {
	var eval = "abcdefghijklmnopqrstuvwxyz0123456789";
	var chk_val;
	
	if (null_chk(str) == false) {return false;}
	else {
		for (var ii = 0 ; ii < str.length ; ii++) {
			chk_val = 0;
			for (var jj = 0 ; jj < eval.length ; jj++) {
				if (str.substring(ii,ii+1) == eval.substring(jj,jj+1)) {
					chk_val = 1;
					break;
				}
			}
			if (chk_val == 0) {
				return false;
			}
		}
	}
	return true;
}

function null_chk(str) {
	if (str.length == 0) {return false;}
	else {
		for (var ii=0 ; ii < str.length ; ii++) { 
			if (str.substring(ii, ii+1) == " ") {
				return false;
			}
		}
	}
	return true;
}
function submitForm(form_obj)
{
	if (form_obj.onsubmit()) {
		form_obj.submit();
	} else {
	//
	}
}
function onSubmitCheck(form_obj)
{
	if (form_obj.User.value == '')
	{
		alert('请输入用户名');
		form_obj.User.focus();
		return false;
	}
	if (form_obj.password.value == '')
	{
		alert('请输入密码');
		form_obj.password.focus();
		return false;
	}
	return true;
}