<!--
function objWrite(obj){
	document.write(obj);
}

function FlashWrite(swflink,width,height){
  s = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ';
  s += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" ';
  s += 'width="'+width+'" height="'+height+'" align="middle"> ';
  s += '<param name="allowScriptAccess" value="sameDomain" /> ';
  s += '<param name="movie" value="'+swflink+'" /> ';
  s += '<param name="quality" value="high" /> ';
  s += '<param name=wmode value=transparent /> ';
  s += '<embed src="'+swflink+'" width="'+width+'" height="'+height+'" align="middle" quality="high" bgcolor="#ffffff" allowscriptaccess="sameDomain" ';
  s += ' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> ';
  s += '</object> ';
  document.write(s);
}

function FlashWriteOtherDomain(swflink,width,height){
  s = '<EMBED src="'+swflink+'" quality=high WIDTH="'+width+'" HEIGHT="'+height+'" ';
  s += 'TYPE="application/x-shockwave-flash" ';
  s += 'PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED> ';
  document.write(s);
}

// ÄíÅ° °ü·Ã ÇÔ¼ö
function setCookie( name, value, expiredays ) 
{ 
        var todayDate = new Date(); 
        todayDate.setDate( todayDate.getDate() + expiredays ); 
        temp = (expiredays==0  ?  ""  :  " expires=" + todayDate.toGMTString() + ";" );
        document.cookie = name + "=" + escape( value ) + "; path=/;" + temp;
} 

function getCookie( name )
{
//alert(document.cookie);
       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 trim(str){
   str = str.replace(/^\\s*/,'').replace(/\\s*$/, ''); 
   return str;
} 

function removeSpecialChar(str) {
	var re = /\?\=\&\:/g;
	str = str.replace(re,"");
	str = trim(str);
	return str;
}

// ÆûÀÌ¸§ : searchAllForm
// °Ë»ö¿É¼Ç : searchoption (¿µÈ­ÀÚ¸·°Ë»ö,¿µÈ­Æ÷½ºÅÍ,ÅëÇÕ°Ë»ö)
// °Ë»ö¾î : searchquery
// °Ë»ö°ü·ÃµÈ ÀÚ¹Ù½ºÅ©¸³Æ® ÇÔ¼ö
function getAction( Tbl, subQstr ) {
	var TblFix = "Jamak";
	var ret = "/index_board.php?oAction=list&oMenu=Menu" + TblFix + ".htm&oSkin=Skin" + TblFix + ".htm&oTable=" + TblFix + subQstr;
	switch(php_self) {	
		case "/es.php" :
		case "/index.php" :
		case "/index_board.php" :
			ret = "/index_board.php?oAction=list&oMenu=Menu" + Tbl + ".htm&oSkin=Skin" + Tbl + ".htm&oTable=" + Tbl;
			ret += subQstr;
			return ret;
			break;
		default :
			return ret;
			break;
	}
	return ret;
}

function goSearch(query,firstCh) {
	try {
		oform = document.all.searchAllForm;
		oform.searchoption.value="¿µÈ­ÀÚ¸·°Ë»ö";
		query = removeSpecialChar(query);
		oform.searchquery.value=query;
		setCookie("SearchOption", "¿µÈ­ÀÚ¸·°Ë»ö",0);
		setCookie("SearchQuery", query,0);
		searchAll(oform, firstCh);
		/*
		if( searchAll(oform, firstCh) ) {
			// oform.submit(); // don't use post method
		}
		*/
	}
	catch(e) {
		try {
			var action = getAction("Jamak", "&oSearchMethod=subject&oFindText=" + query);
			if(firstCh.length>0) action += "&firstCh=" + firstCh;
			document.all.goJamakAnchorId.href = action;
			setCookie("SearchOption", "¿µÈ­ÀÚ¸·°Ë»ö",0);
			setCookie("SearchQuery", query,0);
			document.all.goJamakAnchorId.click();
		}
		catch(e) {
		};
	}
	return false;
}

function getFirstChar( h ) {
	h = h.substring(0,1);
	h = trim(h);
	var r = "No";
	if(h>="°¡"&&h<"³ª") r="°¡";
	if(h>="³ª"&&h<"´Ù") r="³ª";
	if(h>="´Ù"&&h<"¶ó") r="´Ù";
	if(h>="¶ó"&&h<"¸¶") r="¶ó";
	if(h>="¸¶"&&h<"¹Ù") r="¸¶";
	if(h>="¹Ù"&&h<"»ç") r="¹Ù";
	if(h>="»ç"&&h<"¾Æ") r="»ç";
	if(h>="¾Æ"&&h<"ÀÚ") r="¾Æ";
	if(h>="ÀÚ"&&h<"Â÷") r="ÀÚ";
	if(h>="Â÷"&&h<"Ä«") r="Â÷";
	if(h>="Ä«"&&h<"Å¸") r="Ä«";
	if(h>="Å¸"&&h<"ÆÄ") r="Å¸";
	if(h>="ÆÄ"&&h<"ÇÏ") r="ÆÄ";
	if(h>="ÇÏ"&&h<"ÆR") r="ÇÏ";
	//window.status = h + ' ' + r;
	//alert(h + ' ' + r);
	return r;
}

function trim (strSource) {
   re = /^\s+|\s+$/g;
   return strSource.replace(re, '');
}

var alreadySended = 0;
function setSendedState() {
	alreadySended = 1;
	try {
		searchingNoDiaplay.style.display = 'none';
		searchingDiaplay.style.display = '';
	}
	catch(e) { };
}

function searchClick(searchoptionval,sQueryval) {
        if(alreadySended) {
        	// alert('°Ë»öÁßÀÔ´Ï´Ù. Àá½Ã¸¸ ±â´Ù·Á ÁÖ¼¼¿ä.');
        	window.status = '°Ë»öÁßÀÔ´Ï´Ù. Àá½Ã¸¸ ±â´Ù·Á ÁÖ¼¼¿ä......';
        	return false;
        }
        
	sQueryval = trim(sQueryval);
	/*
	if(sQueryval.length<1) {
		alert('°Ë»ö¾î¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä');
		return false;
	}
	*/
	
	if(searchoptionval=="¹Ú½º°Ë»ö") {
		this.location = "/find.php?sQuery=" + sQueryval;	
		setSendedState(); return true;
	}
	if(searchoptionval=="¹«·áÄ¡·á") {
		this.location = "/findfreeclear.php?sQuery=" + sQueryval;
		setSendedState(); return true;
	}
	if(searchoptionval=="¿î¼¼") {
		this.location = "/findunse.php?sQuery=" + sQueryval;
		setSendedState(); return true;
	}
	if(searchoptionval=="°íÀü°ÔÀÓ") {
		this.location = "/findoldgame.php?sQuery=" + sQueryval;
		setSendedState(); return true;
	}
/*
//	if(searchoptionval=="UCCC") {
//		this.location = "/finducc.php?sQuery=" + sQueryval;
//+ "&firstCh=" + getFirstChar(sQueryval);
//		setSendedState(); return true;
//	}
	if(searchoptionval=="¿µÈ­ÀÚ¸·") {
		this.location = "/findmovie.php?sQuery=" + sQueryval;
// + "&firstCh=" + getFirstChar(sQueryval);
		setSendedState(); return true;
	}
	if(searchoptionval=="¿î¼¼") {
		this.location = "/findunse.php?sQuery=" + sQueryval;
//+ "&firstCh=" + getFirstChar(sQueryval);
		setSendedState(); return true;
	}
	if(searchoptionval=="°í¼Ó") {
		this.location = "/badaba.php?sQuery=" + sQueryval;
		setSendedState(); return true;
	}
	if(searchoptionval=="¿µÈ­Á¤º¸") {
		this.location = "/searchmovie.php?sQuery=" + sQueryval + "&firstCh=" + getFirstChar(sQueryval);
		setSendedState(); return true;
	}
*/

	// ÅëÇÕ°Ë»ö total
	// »çÀÌÆ® site
	// À¥ÆäÀÌÁö webpage
	// ´º½º news
	// ÀÌ¹ÌÁö image
	// Ä«Å×°í¸® category
	
	// ÅëÇÕ°Ë»ö total
	if(searchoptionval=="ÅëÇÕ°Ë»ö") {
		this.location = "/search.php?where=total&smn=1&sQuery=" + sQueryval;
		setSendedState(); return true;
	}
	// »çÀÌÆ® site
	if(searchoptionval=="»çÀÌÆ®") {
		this.location = "/search.php?where=site&smn=4&sQuery=" + sQueryval;
		setSendedState(); return true;
	}
	// À¥ÆäÀÌÁö webpage
	if(searchoptionval=="À¥ÆäÀÌÁö") {
		this.location = "/search.php?where=webpage&smn=5&sQuery=" + sQueryval;
		setSendedState(); return true;
	}
	// ´º½º news
	if(searchoptionval=="´º½º") {
		this.location = "/search.php?where=news&smn=6&sQuery=" + sQueryval;
		setSendedState(); return true;
	}
	// ÀÌ¹ÌÁö image
	if(searchoptionval=="ÀÌ¹ÌÁö") {
		this.location = "/search.php?where=image&smn=7&sQuery=" + sQueryval;
		setSendedState(); return true;
	}
	// Ä«Å×°í¸® category
	if(searchoptionval=="Ä«Å×°í¸®") {
		this.location = "/search.php?where=category&smn=8&sQuery=" + sQueryval;
		setSendedState(); return true;
	}
}

function searchEnter(searchoptionval,sQueryval) {
	if(event.keyCode!=13) return true;
	searchClick(searchoptionval,sQueryval);
}
//-->
