/* ´ë»§±î¸® °³¹ß */
var comment_cnt = "false";


function orange1 () {
document.all["FloatLayer1"].style.display="none";
//document.all["FloatLayer2"].style.display="inline";
}

/*
function ifrm_reload() {
	var chk = document.getElementsByName('ifrm');

	if(comment_cnt == "false") {
		for(var i = 0; i < chk.length; i++)
		{
			frames.item(i).location.reload();
		}
	}
}
*/
function ifrm_reload_20070220(){
	var list = new Array();
	list = new Array("top", "topright", "center", "boardfloating", "top_ex", "topright_ex", "center_ex");

	if(comment_cnt == "false") {
		for(i=0;i<list.length;i++) {
			try {
				var f = document.frames["ifrm"+list[i]];
				f.location.reload();
			}
			catch(e) {}
		}
	}
}

function adbanner(id, width, height) {
	var banner = "<div id='ad"+id+"'><iframe name=\"ifrm"+id+"\" src='http://adserver.thisisgame.com/new_script.php?id="+id+"&width="+width+"&height="+height+"' width="+width+" height="+height+" border=0 frameborder=0 framemargin=0 leftmargin=0 margin=0 SCROLLING=no></iframe></div>";
	document.writeln(banner);
}

function adbanner_new(ifrmname, path, width, height) {
//if(width == 210 && height == 155)
//	return;
	var banner = "<iframe name='ifrm" + ifrmname + "' src='http://ad.thisisgame.com:8080/NetInsight/html" + path + "?rolling=60' width=" + width + " height=" + height + " border=0 frameborder=0 framemargin=0 leftmargin=0 margin=0 SCROLLING=no></iframe>";
	document.writeln(banner);
}

function adbanner_new1(ifrmname, path, width, height) {
	var banner = "<iframe name='ifrm" + ifrmname + "' src='http://ad.thisisgame.com:8080/NetInsight/html" + path + "' width=" + width + " height=" + height + " border=0 frameborder=0 framemargin=0 leftmargin=0 margin=0 SCROLLING=no></iframe>";
	alert(banner);
	document.writeln(banner);
}

function adbanner_new2(ifrmname, path, width, height) {
	var banner = "<iframe name='ifrm" + ifrmname + "' src='http://ad.thisisgame.com:8080/NetInsight/html" + path + "?rolling=30' width=" + width + " height=" + height + " border=0 frameborder=0 framemargin=0 leftmargin=0 margin=0 SCROLLING=no></iframe>";
	alert(banner);
	document.writeln(banner);
}

/*·Ñ¿À¹ö*/

function Roll(num,tog){eval("document.m"+num+".src=m"+num+"_"+tog+".src");}

function pre_image_tig() {
for(a=1;a<=9;a++){
	eval('m'+a+'_on = new Image()');
	eval('m'+a+'_off = new Image()');
	eval('m'+a+'_on.src = \"http://file.thisisgame.com/img/common/menu/menu0'+a+'_o.gif\"');
	eval('m'+a+'_off.src = \"http://file.thisisgame.com/img/common/menu/menu0'+a+'.gif\"');
	}
}
/*Äü¸Þ´º ·Ñ¿À¹ö*/
function Roll2(num,tog){eval("document.qm"+num+".src=qm"+num+"_"+tog+".src");}

function pre_image_tig2() {
for(a=1;a<=6;a++){
	eval('qm'+a+'_on = new Image()');
	eval('qm'+a+'_off = new Image()');
	eval('qm'+a+'_on.src = \"http://file.thisisgame.com/img/common/qmenu'+a+'_o.gif\"');
	eval('qm'+a+'_off.src = \"http://file.thisisgame.com/img/common/qmenu'+a+'.gif\"');
	}
}

function Roll3(num,tog){eval("document.sqm"+num+".src=sqm"+num+"_"+tog+".src");}

function pre_image_soccer() {
for(a=1;a<=7;a++){
	eval('sqm'+a+'_on = new Image()');
	eval('sqm'+a+'_off = new Image()');
	eval('sqm'+a+'_on.src = \"/soccer/img/menu2/0'+a+'o.jpg\"');
	eval('sqm'+a+'_off.src = \"/soccer/img/menu2/0'+a+'n.jpg\"');
	}
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

/*·¹ÀÌ¾î ¿ÀÇÂ*/
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function Show() { //v3.0
  var i,p,v,obj,args=Show.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
	if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
	obj.visibility=v; }
}

function ChangeLayer(id)
{
    if (document.getElementById(id).style.display == "")
	    document.getElementById(id).style.display = "none";
	else
		document.getElementById(id).style.display = "";
}

function ChangeLayerValue(id, value)
{
	document.getElementById(id).style.display = value;
}

function ChangeSound(f, img)
{
    //var f = document.wmplay;
    //var img = document.soundcontrolimg;

    if (f.mute)
    {
         f.mute = false;
         img.src = 'http://file.thisisgame.com/img/casual/btn_soundoff.gif';
    }
    else
    {
         f.mute = true;
         img.src = 'http://file.thisisgame.com/img/casual/btn_soundon.gif';
    }

    return false;
}

function CheckTopSearchForm(f)
{
  if (!f.search.value)
  {
    alert('°Ë»öÇÒ ³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä');
    f.search.focus();
    return false;
  }

  return true;
}

function toclip(s)
{
  var clip = document.body.createTextRange();
  clip.moveToElementText(document.all(s));
  clip.select();
  clip.execCommand('copy');

  if(s != "content_layer")
	  alert('ÁÖ¼Ò¸¦ º¹»çÇÏ¿´½À´Ï´Ù.');
}

function toclip2(s)
{
  var clip = document.body.createTextRange();
  clip.moveToElementText(document.getElementById(s));
  clip.select();
  clip.execCommand('copy');
}

function open_win(url, target, wid, hei, scroll) {
	winWid= (document.body.clientWidth - wid) / 2 ;
	winHgt = (document.body.clientHeight - hei) / 2 ;
	window.open(url, target, "left="+winWid+",top="+winHgt+",width="+wid+",height="+hei+", statusbar=no, scrollbars="+scroll);
}

function openWindow(url, target, wid, hei, scroll, xPos, yPos) {
	winWid = xPos ? xPos : (window.screen.width/2 - wid/2);
	winHgt = yPos ? yPos : (window.screen.height/2 - hei/2 - 50);
	scroll = scroll ? scroll : "no";
	window.open(url, target, "'left="+winWid+",top="+winHgt+",width="+wid+",height="+hei+", statusbar=no, scrollbars="+scroll);
}


function open_nowin(url) {
	window.open(url);
}

function go_view(id, category, subcategory) {
	eval("document.location='/board/view.php?id="+id+"&category="+category+"&subcategory="+subcategory+"'");
}

function go_page(url) {
	document.location = url;
}

function popup_getCookie(name) {
        var nameStr = name + "=" ;
        var nameLen = nameStr.length;
        var cookieLen = document.cookie.length;

        var i = 0;
        while( i < cookieLen ) {
                var j = i + nameLen;
                if ( document.cookie.substring(i, j) == nameStr ) {
                        var end = document.cookie.indexOf(";", j);
                        if( end == -1) end = document.cookie.length;
                        return unescape( document.cookie.substring(j, end) );
                }
                i = document.cookie.indexOf(" ", i) + 1;
                if ( i == 0) {
                        break;
                }
        }
}

function script_viewimage(src, link)
{
	document.write('<a href="' + link + '">' + '<img src="' + src + '">' + '</a>');
}

function fn_fav(murl, site) {
	if ( navigator.appName != 'Microsoft Internet Explorer' )
	{
		window.sidebar.addPanel(site,murl,"");
	}else {
		window.external.AddFavorite(murl,site);
	}
}

// flashWrite(ÆÄÀÏ°æ·Î, °¡·Î, ¼¼·Î[, º¯¼ö][,¹è°æ»ö][,À©µµ¿ì¸ðµå])
function flashWrite(url,w,h,vars,bg,win,id){
	var id=url.split("/")[url.split("/").length-1].split(".")[0]; //id´Â ÆÄÀÏ¸íÀ¸·Î ¼³Á¤
	if(vars==null) vars='';
	if(bg==null) bg='#FFFFFF';
	if(win==null) win='transparent';


	// ÇÃ·¡½Ã ÄÚµå Á¤ÀÇ
	var flashStr= "	<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'";
		flashStr+="			codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0'";
		flashStr+="			width='"+w+"'";
		flashStr+="			height='"+h+"'";
		flashStr+="			id='"+id+"'";
		flashStr+="			align='middle'>";

		flashStr+="		<param name='allowScriptAccess' value='always' />";
		flashStr+="		<param name='movie' value='"+url+"' />";
		flashStr+="		<param name='FlashVars' value='"+vars+"' />";
		flashStr+="		<param name='wmode' value='"+win+"' />";
		flashStr+="		<param name='menu' value='false' />";
		flashStr+="		<param name='quality' value='high' />";
		flashStr+="		<param name='bgcolor' value='"+bg+"' />";


		flashStr+="		<embed src='"+url+"'";
		flashStr+="		       flashVars='"+vars+"'";
		flashStr+="		       wmode='"+win+"'";
		flashStr+="		       menu='false'";
		flashStr+="		       quality='high'";
		flashStr+="		       bgcolor='"+bg+"'";
		flashStr+="		       width='"+w+"'";
		flashStr+="		       height='"+h+"'";
		flashStr+="		       name='"+id+"'";
		flashStr+="		       align='middle'";
		flashStr+="		       allowScriptAccess='always'";
		flashStr+="			   swLiveConnect='true'";
		flashStr+="		       type='application/x-shockwave-flash'";
		flashStr+="		       pluginspage='http://www.macromedia.com/go/getflashplayer' />";
		flashStr+=" </object>";

	// ÇÃ·¡½Ã ÄÚµå Ãâ·Â
	document.write(flashStr);
}


function  viewMediaPlayer(sURL, sName, sFeatures){

 //¹Ìµð¾î ÇÃ·¹ÀÌ¾î ¿ÀºêÁ§Æ®¸¦ »Ñ·ÁÁÝ´Ï´Ù.
 //¹Ìµð¾î ÇÃ·¹ÀÌ¾î ¹öÀüÀº 7~10 ¹öÀü¿¡ È£È¯µÇ´Â ¿ÀºêÁ§Æ®ID¸¦ »ç¿ëÇÕ´Ï´Ù.
 var WMPCID = "CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6";

 var sFeature;
 var sWidth  = "100%";
 var sHeight  = "100%";
 var pmBoolean;
 var sTempArray;
 var sParamTag = "";

 sFeature = sFeatures.split(/\s*,\s*/);
 for (var i=0; i< sFeature.length ; i++)
 {
  sTempArray = sFeature[i].split(/\s*=\s*/);
  if (sTempArray[0].toLowerCase() == "width"){
  //³ÐÀÌ
  sWidth = sTempArray[1];
  }else if (sTempArray[0].toLowerCase() == "height"){
  //³ôÀÌ
  sHeight = sTempArray[1];
  }else{
  //±âÅ¸ ÆÄ¶ó¸ÞÅÍ Ã³¸®
  if (sTempArray[1].toLowerCase() == "yes" || sTempArray[1] == "1" || sTempArray[1].toLowerCase() == "true"){
    pmBoolean = "true";
  }else if (sTempArray[1].toLowerCase() == "no" || sTempArray[1] == "0" || sTempArray[1].toLowerCase() == "false"){
    pmBoolean = "false";
  }else{
    pmBoolean = sTempArray[1];
  }
  sParamTag = "<PARAM NAME='"+sTempArray[0]+"'VALUE='" + pmBoolean + "'>\n"+sParamTag;
  }
 }

 document.write("<OBJECT ID='"+sName+"' NAME='"+sName+"' CLASSID='"+WMPCID+"' WIDTH='"+sWidth+"' HEIGHT='"+sHeight+"' >");
 document.write("<PARAM NAME='URL'VALUE='" + sURL + "'>");
 document.write(sParamTag);
 document.write("</OBJECT>");
}
