document.title = "³Ø½¼ ¹öºíÆÄÀÌÅÍ";

/**********************************************************
Top Menu Height
***********************************************************/
var topGNBoff = '';
function topGNBOn(GNBHeight) {
	//alert(GNBHeight);
	document.getElementById('topGNB').style.height= GNBHeight;
 //var topGNB = document.getElementById('topGNB').style.height= GNBHeight;

 //alert(topGNB.style.height);
 //if(topGNBoff != topGNB) {
  //if(topGNBoff != '') topGNBoff.style.height = '103px';
  //topGNB.style.height = '210px';
  //topGNBoff = topGNB;
 //} else {
  //topGNB.style.height = '103px';
  //topGNBoff = '';
 //}
}

/**********************************************************
* Image Roll over, Roll out
***********************************************************/


function mOver(imgEl){
	 if(imgEl.className!="onpage") {
		imgEl.src = imgEl.src.replace(".gif", "_on.gif");
	}
}
function mOut(imgEl){

		if(imgEl.className!="onpage") { 
			imgEl.src = imgEl.src.replace("_on.gif", ".gif");
		}
	
}

////////////////////////////////////////////////////////////////////////////////////
// flash ¿¬µ¿ °ü·Ã function
////////////////////////////////////////////////////////////////////////////////////
//
// Flash Grid Component µ¿ÀÛ °³°ý
//
// 1. flash°¡ ·ÎµùÀÌ ¿Ï·áµÇ¸é flash ==> script dataGridLoadOk() È£Ãâ
// 2. ·Îµù Á÷ÈÄ Object ÅÂ±×ÀÇ param¿¡¼­ flashVars¼Ó¼ºÀÇ requestUrlÀÌ Á¸ÀçÇÏ¸é flash ==> script flash_enc() È£Ãâ
// 3. ·Îµù Á÷ÈÄ Object ÅÂ±×ÀÇ param¿¡¼­ flashVars¼Ó¼ºÀÇ requestUrlÀÌ Á¸ÀçÇÏÁö ¾ÊÀ¸¸é ¸ØÃã
// 4. Àü¼Û ¹öÆ°À» Å¬¸¯ ½Ã¿¡ flashDataGridSend()¸¦ È£ÃâÇÏ¸é flash ==> script flash_enc() È£Ãâ
////////////////////////////////////////////////////////////////////////////////////

// Flash Grid load ¿Ï·á ¿©ºÎ
var isFlashGridLoadOk = false;

// Flash Grid ÀÛ¾÷Áß ¿©ºÎ
var isFlashGridWorkingOk = false;

// flashLoad(ÆÄÀÏ°æ·Î, °¡·Î, ¼¼·Î, ¾ÆÀÌµð, ¹è°æ»ö, º¯¼ö, À©µµ¿ì¸ðµå)
function flashLoad(url,w,h,id,bg,vars,win) {

	var win = "transparent";

	// ÇÃ·¡½Ã ÄÚµå Á¤ÀÇ
	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+"' 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='quality' value='high' />"+
	"<param name='bgcolor' value='"+bg+"' />"+
	"<param name='base' value='.'>"+
	"<embed src='"+url+"' FlashVars='"+vars+"' wmode='"+win+"' menu='false' quality='high' base='.' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	"</object>";

	// ÇÃ·¡½Ã ÄÚµå Ãâ·Â
	document.write(flashStr);
	
	//FlashÀÇ ExternalInterface°¡ Form Tag³»¿¡¼­ ¿À·ù³ª´Â ¹ö±×¸¦ ÇØ°áÇÏ´Â ÄÚµå     
	eval("window." + id + " = document.getElementById('" + id + "');");

}


/**********************************************************
* ¹Ìµð¾î ÆÄÀÏ ÇÃ·¹ÀÌ
***********************************************************/
function moviePlayer(objID, objSource, objWidth, objHeight, objStyle)
{
	var objID = document.getElementById(objID); 
	document.write('<embed src="' + objSource + '" width="' + objWidth + '" height="' + objHeight + '" id="' + objID + '" type="application/x-mplayer2" ShowTracker="false" ShowControls="false" ShowGotoBar="false" ShowDisplay="false" ShowStatusBar="false" EnableContextMenu="0" ></embed>');
}
function Wmv_View(url,mvid,sizex,sizey)	{
	document.write('<object id="'+mvid+'" classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" standby="Loading Microsoft?Windows?Media Player components..." type="application/x-oleobject"  width="'+sizex+'" height="'+sizey+'"  >');
		document.write('	<param name="transparentAtStart" value="True" />'	);
		document.write('	<param name="transparentAtStop" value="True" />'	);
		document.write('	<param name="AnimationAtStart" value="False" />'	);
		document.write('	<param name="AutoStart" value="False" />'	);
		document.write('	<param name="AutoRewind" value="true" />'	);
		document.write('	<param name="DisplaySize" value="0" />'	);
		document.write('	<param name="AutoSize" value="false" />'	);
		document.write('	<param name="ShowDisplay" value="false" />'	);
		document.write('	<param name="ShowStatusBar" value="false" />'	);
		document.write('	<param name="ShowControls" value="false" />'	);
		document.write('	<param name="EnableContextMenu" value="False" />'	);
		document.write('	<param name="FileName" value="'+url+'" />'	);
		document.write('	<param name="Volume" value="0" />'	);
		document.write('	<param name="TransparentAtStart" value="true"/>'	);
		document.write('	<embed src="'+url+'"  displaysize=0 showcontrols=0 autostart=0  width="'+sizex+'" height="'+sizey+'" name="'+mvid+'" type="application/x-mplayer2" pluginspage = "http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/" />'   );
		document.write('	</embed></object>	'	);
	}
function playMovie(idName){
	document.getElementById(idName).value = "on";
	document.getElementById(idName).play();
}
function stopMovie(idName){
	document.getElementById(idName).stop();
}
function pauseIt(idName){
	if ((navigator.userAgent.indexOf('IE') > -1) && (navigator.platform == "Win32")) {			
		document.getElementById(idName).Pause();
	} 
}


		   


/**********************************************************
* ÆË¾÷ È­¸é Áß¾Ó¿¡ ¶ç¿ì±â - Win_pop();
***********************************************************/

function Win_pop(newwin,w,h,s) { // newwin:url, w:°¡·Î»çÀÌÁî, h:¼¼·Î»çÀÌÁî, s:½ºÅ©·Ñ ¿©ºÎ(yes or no)
  var winl = (screen.width - w) / 2;
  var wint = (screen.height - h) / 2;
  winprops = 'width='+w+',height='+h+',top='+wint+',left='+winl+',resizable=no,scrollbars='+s+',toolbars=no,status=no,menu=no';
  win = window.open(newwin, "new1", winprops)
  if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}


function Win_pop2(newwin,newwinname,w,h,s) { // newwin:url, w:°¡·Î»çÀÌÁî, h:¼¼·Î»çÀÌÁî, s:½ºÅ©·Ñ ¿©ºÎ(yes or no)
  var winl = (screen.width - w) / 2;
  var wint = (screen.height - h) / 2;
  winprops = 'width='+w+',height='+h+',top='+wint+',left='+winl+',resizable=no,scrollbars='+s+',toolbars=no,status=no,menu=no';
  win = window.open(newwin, newwinname, winprops)
  if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}


/**********************************************************
* ÀÌ¹ÌÁö·Î ¹Ù·Î ÆË¾÷¶ç¿ì±â - displayImage(); / view(what)
***********************************************************/

function displayImage(picName, windowName, windowWidth, windowHeight){
	var winHandle = window.open("" ,windowName,"toolbar=no,scrollbars=no,resizable=no,width=" + windowWidth + ",height=" + windowHeight);
	if(winHandle != null){
		var htmlString = "<html><head><title>HILLSTATE SALE</title></head>";
		htmlString += "<body style='margin:0'>";
		htmlString += "<a href=javascript:window.close()><img src=" + picName + " border=0 alt=´Ý±â></a>";
		htmlString += "</body></html>";
		winHandle.document.open();
		winHandle.document.write(htmlString);
		winHandle.document.close();
	} 
	if(winHandle != null) winHandle.focus();
	return winHandle;
}

function view(what) { 
  var imgwin = window.open("",'WIN','scrollbars=no,status=no,toolbar=no,resizable=0,location=no,menu=no,width=10,height=10'); 
  imgwin.focus(); 
  imgwin.document.open(); 
  imgwin.document.write("<html>\n"); 
  imgwin.document.write("<head>\n"); 
  imgwin.document.write("<title>IMAGE VIEW</title>\n"); 

  imgwin.document.write("<sc"+"ript>\n"); 
  imgwin.document.write("function resize() {\n"); 
  imgwin.document.write("pic = document.il;\n"); 

  imgwin.document.write(" var imgw = eval(pic).width; ");
  imgwin.document.write("  if (eval(pic).width > 800){ eval(pic).width = 800\n "); //800pxº¸´ÙÅ©¸é 800À¸·Î
  imgwin.document.write(" } else if(eval(pic).width < 800){ eval(pic).width = eval(pic).width\n} "); //800pxº¸´ÙÀÛÀ¸¸é ¿ø·¡Å©±â·Î

  imgwin.document.write(" if (eval(pic).height) { var name = navigator.appName\n"); 
  imgwin.document.write("  if (name == 'Microsoft Internet Explorer') { myHeight = eval(pic).height + 40; myWidth = eval(pic).width + 10;\n"); 
  imgwin.document.write("  } else { myHeight = eval(pic).height + 9; myWidth = eval(pic).width; }\n"); 
  imgwin.document.write("  clearTimeout();\n"); 
  imgwin.document.write("  var height = screen.height;\n"); 
  imgwin.document.write("  var width = screen.width;\n"); 
  imgwin.document.write("  var leftpos = width / 2 - myWidth / 2;\n"); 
  imgwin.document.write("  var toppos = height / 2 - myHeight / 2; \n"); 
  imgwin.document.write("  self.moveTo(leftpos, toppos);\n");
  imgwin.document.write("  if (myWidth > width) { myWidth = width; }\n");
  imgwin.document.write("  self.resizeTo(myWidth, myHeight+10);\n"); 
  imgwin.document.write("}else setTimeOut(resize(), 100);}\n"); 
  imgwin.document.write("</sc"+"ript>\n"); 

  imgwin.document.write("</head>\n"); 
  imgwin.document.write('<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="#FFFFFF">\n'); 

  imgwin.document.write("<img border=\"0\" src=\""+what+"\" name=il onload='resize();' style='cursor:pointer' onclick='window.close();'>\n"); 

  imgwin.document.write("</body>\n");
  imgwin.document.close(); 
}

/**********************************************************
* png
***********************************************************/
function setPng24(obj) {
	obj.width=obj.height=1;
	obj.className=obj.className.replace(/\bpng24\b/i,'');
	obj.style.filter =
	"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"
	obj.src='';
	return '';
}

/**********************************************************
* Charactor View
***********************************************************/
function characInfoView(objState){
	document.getElementById("charactorInfo").style.display = objState;
}


/* ¡á¡à¡á¡à¡á¡à¡á¡à¡á¡à¡á¡à¡á¡à¡á¡à¡á¡à¡á¡à¡á¡à¡á¡à¡á¡à¡á¡à¡á¡à¡á¡à¡á¡à¡á¡à¡á¡à¡á¡à
	ÇÁ·Î±×·¥ : A2YSlide Ver 1.0
	°³ ¹ß ÀÚ : ¹Ú¹Î±Ç
	¼³    ¸í : ¿øÇÏ´Â ·¹ÀÌ¾î °´Ã¼¸¦ ¹®¼­ÀÇ »ó´ÜÀÌ³ª ÇÏ´Ü¿¡ ½½¶óÀÌµåµÇ¸ç À§Ä¡ÇÑ´Ù.
			   W3C ±ÔÁ¤À» ÁØ¼öÇÔ.
	ex)	var a2slide = new A2YSlide('a2slide','SMenu',0.2,10,0,50,300);
	Å¬·¡½º¸¦ ÅëÇÑ °´Ã¼»ý¼ºÀ» »ç¿ëÇÏ´Â °ÍÀÌ¹Ç·Î À§¿Í°°ÀÌ »ç¿ëÇÑ´Ù.
	´Ü, µðÀÚÀÌ³Ê°¡ »ç¿ë½Ã ºÒÆíÇÔÀÌ µû¸£¹Ç·Î A2Wzd_YSlide() ÇÔ¼ö¸¦ »ç¿ëÇÑ´Ù.
	
	A2YSlide(°´Ã¼¸ístr,·¹ÀÌ¾îstr,ÀÌµ¿°ª,ÀÌµ¿ÃÊint,»óÇÏ¹èÄ¡bool,»óÇÏÀ§Ä¡¿¡¼­ ¶³¾îÁú ¹üÀ§int)
	-> »óÇÏ¹èÄ¡(false) ? »ó : ÇÏ
	
	¡ØÁÖ ÀÇ : ºñÇ¥ÁØÀ¸·Î À¥À» °³¹ßÇÏ½Ã´Â ºÐÀº »ç¿ëÀ» ±ÝÇÕ´Ï´Ù.
			  xthml 1.0 dtd°¡ ¼±¾ðµÈ ¹®¼­¿¡¼­ Å×½ºÆ®ÇÏ¿´½À´Ï´Ù.
¡á¡à¡á¡à¡á¡à¡á¡à¡á¡à¡á¡à¡á¡à¡á¡à¡á¡à¡á¡à¡á¡à¡á¡à¡á¡à¡á¡à¡á¡à¡á¡à¡á¡à¡á¡à¡á¡à¡á¡à */

function A2YSlide(name,id,range,sec,tb,margin,marginBottom){ //°´Ã¼¸í,·¹ÀÌ¾îid,ÀÌµ¿°ª,ÀÌµ¿ÃÊ,»óÇÏÀ§Ä¡(false)?t:b,°è»êµÈ »óÇÏ À§Ä¡¿¡¼­ ¶³¾îÁú ¹üÀ§,ÇÏ´Ü¿©¹é
	//¼Ó¼º
	this.name = name;
	this.obj = document.getElementById(id);
	this.range = range;
	this.sec = sec;
	this.tb = tb;
	this.margin = margin;
	this.marginBottom = marginBottom;
	
	this.Timer();
}

/*¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬private ¸Þ¼Òµå ÇÔ¼ö ¼±¾ðºÎ¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬*/
A2YSlide.prototype.Move = function A2YSlide_Move(fix_y){
	objY = parseInt(this.obj.style.top);	
	if(objY != fix_y){
		this.obj.style.top = (objY + this.GetMoveValue(objY,fix_y)) + 'px';
	}
	this.Timer();
}

A2YSlide.prototype.GetMoveValue = function A2YSlide_GetMoveValue(start, end){ //ÇöÀç À§Ä¡¿Í ÀÌµ¿ÇÒ À§Ä¡¿¡ µû¸¥ ÀÌµ¿°Å¸®¸¦ ¸®ÅÏÇÑ´Ù.
	return (end - start) * this.range;
}

A2YSlide.prototype.GetDocTnB = function A2YSlide_GetDocTnB(bTB){ //¹®¼­ÀÇ »ó´ÜorÇÏ´Ü ÇÈ¼¿°ªÀ» ¹ÝÈ¯ÇÑ´Ù. (!bTB) ? Top : Bottom
	return ((bTB)?document.documentElement.clientHeight:0) + document.documentElement.scrollTop;
}

A2YSlide.prototype.Timer = function A2YSlide_Timer(){
	if(document.documentElement.clientHeight < (this.margin+30) || document.documentElement.clientHeight < (this.marginBottom+30))
		setTimeout(this.name + '.Move('+((document.documentElement.clientHeight/2)+document.documentElement.scrollTop)+')',this.sec);
	else if(document.documentElement.scrollTop > this.marginBottom)
		setTimeout(this.name + '.Move('+(this.GetDocTnB(!this.tb)-this.marginBottom)+')',this.sec);
	else
		setTimeout(this.name + '.Move('+(this.GetDocTnB(this.tb)+this.margin)+')',this.sec);
}


/*¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¿ÜºÎ ¸¶¹ý»ç ÄÚµå¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬*/
function A2Wzd_YSlide(id,range,sec,tb,margin,marginBottom){ //A2YSlideÀÇ »ý¼ºÀ» µµ¿ÍÁØ´Ù.
	eval('C'+id+" = new A2YSlide('C"+id+"','"+id+"',"+range+","+sec+","+tb+","+margin+","+marginBottom+');');
	//½ÇÇà¿¹ - CSMenu = new A2YSlide('CSMenu','SMenu',0.2,10,0,50,300); => varÀ» »ç¿ëÇÏÁö ¾ÊÀº Àü¿ªº¯¼ö¸¦ »ý¼ºÇÑ´Ù.
}

/*¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬Top Link¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬*/
function OnTop(){
 scrollTo(0,0);
}

/**********************************************************
* PNG Transparent
***********************************************************/
function setPng24(obj) {
    obj.width=obj.height=1;
    obj.className=obj.className.replace(/\bpng24\b/i,'');

    obj.style.filter =

    "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"
    obj.src=''; 
    return '';
}

/**********************************************************
* ÀÛ¼ºÀÚ ·¹ÀÌ¾î
***********************************************************/
function showUserLayer(oAnchor, oidUser, strWriterName, event){
	var ctl = 'userdata';
	var clip =  document.getElementById(ctl);
	if( clip == null || typeof clip == 'undefined'){
		var clip = document.createElement("div");
		clip.id = ctl;
		clip.onclick= function(){toggleObj(ctl, 'none');}
		document.body.appendChild(clip);
	}
	
	var html = "<div class = 'quickSec' style = 'display:block;' id = 'myInfo' >";
	html += "		<dl class ='quickDl'>";
	html += "			<dt><img src='http://s.nx.com/S2/game/bf/bf_obt/common/guickMenuTit.gif'  usemap = '#guickClose' /></dt>";
	html += "			<dd class = 'con01'><a href ='#' onclick=\"Win_pop('http://bf.nexon.com/main/page/nx_pop.aspx?url=home/CharacterView&amp;oidUser=[oidUser]','400','365','no')\">Ä³¸¯ÅÍ Á¤º¸º¸±â</a></dd>";
	html += "			<dd class = 'con02'><a href ='#' onclick=\"NgbNote.OpenNoteSend(74255,'" + strWriterName + "');\">ÂÊÁöº¸³»±â</a></dd>";
	html += "		</dl>";
	html += "</div>";
	html += "<map name='guickClose'>";
	html += "	<area shape='rect' coords='104,2,118,19' href=\"javascript:toggleObj('userdata','none')\" target='' alt='' />";
	html += "</map>"

	clip.innerHTML = html.replace("[oidUser]",oidUser);
	
	
	if(oAnchor == null) return; 
	var position = getPointer(event);
	clip.style.position="absolute";
	clip.style.left = (position.x+30) + "px";
	clip.style.top = (position.y-5) + "px";
	toggleObj(ctl, 'block');
}

function getPointer(event){
	return {
		x: event.pageX || (event.clientX +
		  (document.documentElement.scrollLeft || document.body.scrollLeft)),
		y: event.pageY || (event.clientY +
		  (document.documentElement.scrollTop || document.body.scrollTop))
	  };
}

function toggleObj(id, display){
	try{
		document.getElementById(id).style.display = display;
	}catch(e){
	}
}

function CheckTitleLength(obj, maxLength)
{
	var str = obj.GetPostData();
	if ( str.length > maxLength ){
		event.returnValue = false;
		alert("ÇÑ±Û ±âÁØ " + maxLength + "ÀÚ ÀÌÇÏ±îÁö ÀÔ·Â °¡´ÉÇÕ´Ï´Ù");
		obj.SetPostData(str.substring(0,maxLength));
		return false;
	}
}


