//Flash Activate JS code
function GnxFlashActivate( strFlashUrl , n4Witdh , n4Height , strWmode , strId , strClassName , strFlashvar, strFullScreen ){
	//width,height ¿©ºÎ & ¹­À½ (width,height°¡ ¾øÀ»¶§´Â 0 À¸·Î ¼±¾ð)
	if (n4Witdh != 0) {
		objSize_attribute = " width='"+ n4Witdh +"' height='"+ n4Height +"'";
	} else {
		objSize_attribute = "";
	}
	//id ¿©ºÎ (ID ¼¿·º·ºÅÍ°¡ ¾øÀ»°æ¿ì 0À¸·Î¼±¾ð)
	if (strId != 0) {
		objId_attribute = " id='" + strId + "'";
		objId_IE_attribute = " id='" + strId + "'";
	} else {
		objId_attribute = "";
		objId_IE_attribute = "";
	}
	//class ¿©ºÎ (class°¡ ¾øÀ»¶§´Â 0 À¸·Î ¼±¾ð)
	if (strClassName != 0) {
		className_attribute = " class='" + strClassName + "'";
	} else {
		className_attribute = "";
	}
	//wmode ¿©ºÎ (wmode°¡ ¾øÀ»¶§´Â 0 À¸·Î ¼±¾ð)
	if (strWmode != 0) {
		wmode_param = "<param name='wmode' value='" + strWmode + "' />";
		wmode_attribute = " wmode='" + strWmode + "'";
	} else {
		wmode_param = "";
		wmode_attribute = "";
	}
	//Flashvar ¿©ºÎ (wmode°¡ ¾øÀ»¶§´Â 0 À¸·Î ¼±¾ð)
	if (strFlashvar != 0) {
		Flashvar_param = "<param name='flashvars' value='" + strFlashvar + "' />";
		Flashvar_attribute = " Flashvars='" + strFlashvar + "'";
	} else {
		Flashvar_param = "";
		Flashvar_attribute = "";
	}
	// allowFullScreen ¿©ºÎ 
	if (strFullScreen != undefined){
		FullScreen_param = "<param name='allowFullScreen' value='" + strFullScreen + "' />";
		FullScreen_attribute = " allowFullScreen='" + strFullScreen + "'";
	}else{
		FullScreen_param = "";
		FullScreen_attribute = "";
	}
	document.writeln( "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,42,34' " + objSize_attribute + objId_IE_attribute + className_attribute + ">" );
	document.writeln( "<param name='movie' value='"+ strFlashUrl +"' />" );
	document.writeln( "<param name='quality' value='high' />" );
	document.writeln( "<param name='menu' value='0' />" );
	document.writeln( "<param name='allowScriptAccess' value='always' />" );
	document.writeln( "<param name='scale' value='noscale' />" );
	document.writeln( "<param name='salign' value='t' />" );
	document.writeln( wmode_param );
	document.writeln( Flashvar_param );
	document.writeln( FullScreen_param );
	document.writeln( "<!-- Hixie method -->" );
	document.writeln( "<!--[if !IE]> <-->" );
	document.writeln( "<object type='application/x-shockwave-flash' showLiveConnect='true' allowScriptAccess='always' data='"+ strFlashUrl +"'" + Flashvar_attribute + objSize_attribute + objId_attribute + wmode_attribute + className_attribute + FullScreen_attribute + "></object>" );
	document.writeln( "<!--> <![endif]-->" );
	document.writeln( "</object>" );
}

/* »ç¿ë¹ý
<script type="text/javascript" language="JavaScript">
// <![CDATA[
	GnxFlashActivate('./sub_nav.swf',890,175,'opaque','TopNavi','TopNavi','Flashvars');
// ]]>
</script>
*/


function GnxMovieActivate ( strMovieUrl , n4Width , n4Height , strId , n4AutoStart , n4ShowControls ) {
	//width,height ¿©ºÎ & ¹­À½ (width,height°¡ ¾øÀ»¶§´Â 0 À¸·Î ¼±¾ð)
	if (n4Width != 0) {
		if (n4ShowControls == 0) {
			Realn4Height = n4Height;	
		} else {
			Realn4Height = n4Height + 45;
		}
		objSize_attribute = " width='"+ n4Width +"' height='"+ Realn4Height +"'";
	} else {
		objSize_attribute = "";
	}
	//id ¿©ºÎ (ID ¼¿·ºÅÍ°¡ ¾øÀ»°æ¿ì 0À¸·Î ¼±¾ð ¹Ýµå½Ã ¼±¾ðµÇ¾î¾ßÇÔ)
	if (strId != 0) {
		objId_attribute = " id='" + strId + "'";
		objId_IE_attribute = " id='" + strId + "IE'";
	} else {
		objId_attribute = "";
		objId_IE_attribute = "";
	}

	//ShowControls ¿©ºÎ (ÄÁÆ®·ÑÈ­¸éÀ»°¡¸®°í ½ÍÀ»¶§´Â 0, º¸ÀÌ°í ½ÍÀ»¶§´Â 1)
	if (n4ShowControls == 0) {
		ShowControls_param = "<param name='showcontrols' value='false' />";
		ShowControls_attribute = " showcontrols='0'";
	} else if (n4ShowControls == 1){
		ShowControls_param = "<param name='showcontrols' value='true' />";
		ShowControls_attribute = " showcontrols='1'";
	}

	//AutoStart ¿©ºÎ (ÄÁÆ®·ÑÈ­¸éÀ»°¡¸®°í ½ÍÀ»¶§´Â 0, º¸ÀÌ°í ½ÍÀ»¶§´Â 1)
	if (n4AutoStart == 0) {
		AutoStart_param = "<param name='autostart' value='false' />";
		AutoStart_attribute = " autostart='0'";
	} else if (n4AutoStart == 1){
		AutoStart_param = "<param name='autostart' value='true' />";
		AutoStart_attribute = " autostart='1'";
	}

	document.writeln( "<object id='objWMPlayer' name='objWMPlayer' classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95'" + objId_IE_attribute + objSize_attribute +" codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'>");
	document.writeln( "	<param name='AudioStream' value='-1' />");
	document.writeln( "	<param name='AutoSize' value='false' />");
	document.writeln( "	<param name='AnimationAtStart' value='true' />");
	document.writeln( "	<param name='AllowChangeDisplaySize' value='true' />");
	document.writeln( "	<param name='BufferingTime' value='5' />");
	document.writeln( "	<param name='Enabled' value='true' />");
	document.writeln( "	<param name='EnableContextMenu' value='true' />");
	document.writeln( "	<param name='EnableTracker' value='true' />");
	document.writeln( "	<param name='PlayCount' value='1' />");
	document.writeln( "	<param name='Rate' value='1' />");

	document.writeln( "	<param name='ShowCaptioning' value='false' /> <!-- ÀÚ¸· -->");
	document.writeln( "	<param name='ShowAudioControls' value='true' /> <!-- º¼·ýÁ¶Àý -->");
	document.writeln( "	<param name='ShowDisplay' value='false' /> <!-- ¹Ìµð¾îÁ¤º¸ -->");
	document.writeln( "	<param name='ShowPositionControls' value='true' /> <!-- Forward,Rewind -->");
	document.writeln( "	<param name='ShowStatusBar' value='false' /> <!-- »óÅÂ¹Ù -->");
	document.writeln( "	<param name='ShowTracker' value='true' /> <!-- Å½»ö¹Ù -->");
	
	document.writeln( "	<param name='Mute' value='false' />");
	document.writeln( AutoStart_param );
	document.writeln( ShowControls_param );
	document.writeln( "	<param name='FileName' value='" + strMovieUrl + "'>");

	document.writeln( "	<!-- Hixie method -->");
	document.writeln( "	<!--[if !IE]> <-->");
	document.writeln( "		<object id='objWMPlayer' name='objWMPlayer' type='application/x-mplayer2' pluginspage='http://www.microsoft.com/Windows/MediaPlayer/' data='" + strMovieUrl + "' " + objSize_attribute + objId_attribute + AutoStart_attribute + ShowControls_attribute + ">");
	document.writeln( "	<!--> <![endif]-->");

	document.writeln( "</object>");

}

/* »ç¿ë¹ý
<script type="text/javascript" language="JavaScript">
// <![CDATA[
	GnxMovieActivate ( 'http://party.paran.com/hp/wmv/[MV]20050511_Side-B_JustDoIt(500k).wmv' , 320 , 240 , 'movie01' , 1 , 1 )
// ]]>
</script>
*/

	// for ajax object
	function createRequest(){
		var request = null;
		try{
			request = new XMLHttpRequest();
		}catch(trymicrosoft){
			try{
				request = new ActiveXObject("Msxml2.XMLHTTP");
			}catch(othermicrosoft){
				try{
					request = new ActiveXObject("Microsoft.XMLHTTP");
				}catch(failed){
					request = null;
				}
			}
		} // microsoft
		if (request == null){
			alert('Create XMLObject fail.'); return null;
		}else{
			return request;
		}
	}

	function errMsg(thisfield, msg) {
		alert (msg);
		thisfield.focus();
	}


	function setCookie(name, value){
		var expire_date = new Date();
		expire_date.setDate(expire_date.getDate() + 100);
		expire_date.setHours(0,0,0,0);

		var cookieStr = name + "=" + escape(value) + ";ages = -1";
		cookieStr += "; expires=" + expire_date.toGMTString() +"; path=/; domain=" + document.location.hostname + ";";
		document.cookie = cookieStr;
	}

	function getCookieVal(offset){
		var endstr = document.cookie.indexOf(";", offset);
		if (endstr == -1)
		endstr = document.cookie.length;
		return unescape(document.cookie.substring(offset, endstr));
	}
	// ÇØ´ç ÄíÅ° º¯¼ö¿¡ ÇØ´çÇÏ´Â °ªÀ» getCookieVal¸¦ ÅëÇØ¼­ ¸®ÅÏÇÑ´Ù.

	function getCookie(sName){
		var aCookie = document.cookie.split("; ");
		for (var i=0; i < aCookie.length; i++){
			var aCrumb = aCookie[i].split("=");
			if (sName == aCrumb[0]){
				return unescape(aCrumb[1]);
			}
		}
		return null;
	}



	function addSelectOpt(objSel, txtValue, txtName){
		var objSelect = document.getElementById(objSel);
		var newOption = document.createElement("OPTION");
		newOption.value = txtValue;
		newOption.text = unescape(txtName);
		//objSelect.options[objSelect.options.length] = newOption;
		objSelect.options.add(newOption);
	}


	function resetSelectOpt(objSel, txtValue){
		var objSelect = document.getElementById(objSel);
		for(var i = objSelect.length -1 ; i > 0; i--){
			//if( i > 0){
			//	objSelect.remove(i);
			//}
			if(objSelect.options[i].value != ""){
				objSelect.remove(i);
			}
		}//end for
	}

	function blockMouse(e){
		try{
			if(isIE == false){
				if(e.which == 2 || e.which == 3) return false;
			}else{
				if (window.event.button==2 || window.event.button==3){
					alert('¸¶¿ì½º »ç¿ëÀÌ ±ÝÁöµÇ¾îÀÖ½À´Ï´Ù.');
					return false;
				}
			}
		}catch(e){
			//alert(e);
		}
	}

	function blockKeyCode() { 
		try {
			//BackSpace Key : event.keyCode==8
			var keyValue = window.event.keyCode;
			if(keyValue == 38 || keyValue == 40 || keyValue == 44 || keyValue == 112 || keyValue ==17 || keyValue == 18 || keyValue == 25 || keyValue == 122 || (window.event.ctrlKey==true && (keyValue==78 || keyValue==82))){ // keyValue == 78 ||
				window.event.keyCode = 0; 
				window.event.cancelBubble = true; 
				window.event.returnValue = false; 
			} 
		}catch(e){
			//alert(e);
		}
	}

	function createForm(fName, fMethod, fAction, fTarget){
		var objForm = document.createElement("form");
		objForm.name=fName;
		objForm.method=fMethod;
		objForm.action=fAction;
		objForm.target=fTarget;
		return objForm;
	}

	function addHidden(objF, iptName, iptValue){
		var objInput = document.createElement("input");
		objInput.type="hidden";
		objInput.name=iptName;
		objInput.value=iptValue;
		objF.insertBefore(objInput);
		return objF;
	}


	//·Î±×ÀÎÀÌ ÇÊ¿äÇÑ ¼­ºñ½º
	function goMemberLogin(){
		var strLoginID = document.getElementById("userLoginID");
		alert("·Î±×ÀÎÀÌ ÇÊ¿äÇÑ ¼­ºñ½º ÀÔ´Ï´Ù. ·Î±×ÀÎ ÈÄ ÀÌ¿ëÇØ ÁÖ¼¼¿ä.");
		if (strLoginID != undefined) {
			strLoginID.focus();
		}
		return false;
	}
	//·Î±×ÀÎÀÌ ÇÊ¿äÇÑ ¼­ºñ½º ÆË¾÷¿ë ·Î±×ÀÎ ¿µ¿ª Å¸°ÙÁöÁ¤
	function goMemberLoginP(){
		alert("·Î±×ÀÎÀÌ ÇÊ¿äÇÑ ¼­ºñ½º ÀÔ´Ï´Ù. ·Î±×ÀÎ ÈÄ ÀÌ¿ëÇØ ÁÖ¼¼¿ä.");
		window.close();
		opener.document.getElementById("userLoginID").focus();return false;
	}

	//´Ð³×ÀÓ ¼³Á¤ÇÏ±â(ÇÊ¿ä)
	function goMemberNick() {
		if (confirm("À¥´Ð³×ÀÓÀÌ ÇÊ¿äÇÑ ¼­ºñ½º ÀÔ´Ï´Ù. À¥´Ð³×ÀÓÀ» ¼³Á¤ÇÏ½Ã°Ú½À´Ï±î?") == true) {
			openNewWin('/member/member_make_nick.asp','setWebNickName','350','365');return false;
		} else {return false;}
	}

	function sndLoginForm(){
		var frm = document.frmMemLogin;
		var objUid = document.getElementById("userLoginID");
		var objPw = document.getElementById("userPassWd");
		if (objUid != 'undefined' && objPw != 'undefined'){
			if ( objUid.value.length < 2){
				errMsg(objUid, '·Î±×ÀÎ ¾ÆÀÌµð´Â 2±ÛÀÚ ÀÌ»ó ÀÔ·ÂÇØÁÖ¼¼¿ä'); return false;
			}
			if ( objPw.value.length < 2){
				errMsg(objUid, 'ºñ¹Ð¹øÈ£¸¦ 2±ÛÀÚ ÀÌ»ó ÀÔ·ÂÇØÁÖ¼¼¿ä'); return false;
			}
//			if (sndFlag == false){
				sndFlag = true;
				frm.target = 'fraAction';
				//SSL Àû¿ëÀÌ µÇµµ·Ï ¼öÁ¤ÇÔ. 20100202 by smalldevil
				if (document.location.hostname.indexOf('w.mirx.co.') > 0){
					frm.action = 'https://'+document.location.hostname+'/member/member_action.asp';
				}else{
					frm.action = '/member/member_action.asp';
				}
				frm.submit()
//			}else{
//				alert('µ¥ÀÌÅÍ¸¦ Àü¼Û ÁßÀÔ´Ï´Ù. Àá½Ã ±â´Ù·Á ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù.');
//			}
		}else{
			return false;
		}
	}


	// ·Î±×ÀÎ »óÅÂ·Î ¿ø½ºÅ¾ °¡±â
	function goOneStopSite(goURL){
		var OneStopURL = "http://onestop.wemade.com";
		if (goURL != undefined) {
			goURL = OneStopURL + goURL;
		}
		var frm = document.frmMemInfo;
		if ( frm != undefined && frm.txtEncUID != undefined ){
			if(frm.txtEncUID.value.length > 10){
				if (confirm('[¿ø½ºÅ¾] »çÀÌÆ®·Î ÀÌµ¿ ÇÏ½Ã°Ú½À´Ï±î?') == true){
					var winMirOnestop = window.open('about:blank', 'onestopLogin','');
					if( winMirOnestop != undefined ){
						frm.aUrl.value = escape(goURL);
						frm.action = goURL;
						frm.target = "onestopLogin";
						frm.submit();
						winMirOnestop.focus();
					}else{
						alert('ÆË¾÷ Â÷´ÜÀ» ÇØÁ¦ÇØ ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù.');
					}
				}
			} // len check
			else{
				window.open(goURL,'onestopLogin','');
			}
		}else{
			// ·Î±×ÀÎÀ» ÇÏÁö ¾Ê¾ÒÀ» °æ¿ì
			if (confirm('[¿ø½ºÅ¾] »çÀÌÆ®·Î ÀÌµ¿ ÇÏ½Ã°Ú½À´Ï±î?') == true){
				window.open(goURL,'onestopLogin','');
			}
		}
	}


	// È¯ ÃæÃµ/»ç¿ë³»¿ª
	function goHwanUseList(){
		var frm = document.frmMemInfo;
		if ( frm != undefined && frm.txtEncUID != undefined ){
			if(frm.txtEncUID.value.length > 10){
				if (confirm('[¿ø½ºÅ¾] »çÀÌÆ®·Î ÀÌµ¿ÇÏ¿© È¯ ÃæÃµ/»ç¿ë³»¿ªÀ» È®ÀÎ ÇÏ½Ã°Ú½À´Ï±î?') == true){
					var winMirOnestop = window.open('about:blank', 'onestopLogin','');
					if( winMirOnestop != undefined ){
						frm.aUrl.value = escape('/pay/main_price02.asp');
						frm.action = 'http://onestop.wemade.com/pay/login_area/common/account_login.asp';
						frm.target = "onestopLogin";
						frm.submit();
						winMirOnestop.focus();
					}else{
						alert('ÆË¾÷ Â÷´ÜÀ» ÇØÁ¦ÇØ ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù.');
					}
				}
			} // len check
			else{
				window.open('http://onestop.wemade.com/pay/main_price02.asp','onestopLogin','');
			}
		}else{
			// ·Î±×ÀÎÀ» ÇÏÁö ¾Ê¾ÒÀ» °æ¿ì
			if (confirm('[¿ø½ºÅ¾] »çÀÌÆ®·Î ÀÌµ¿ÇÏ¿© È¯ ÃæÃµ/»ç¿ë³»¿ªÀ» È®ÀÎ ÇÏ½Ã°Ú½À´Ï±î?\n\n»õ·Î¿î Ã¢¿¡¼­ ·Î±×ÀÎ ÇØÁÖ½Ã±â ¹Ù¶ø´Ï´Ù.') == true){
				window.open('http://onestop.wemade.com/pay/main_price02.asp','onestopLogin','');
			}
		}
	}


	// È¯ ÀÌ¿ëÁ¤Ã¥
	function openHwanWin(){
		var strPos = ',left='+(screenWidth-350)/2+',top='+(screenHeight-500)/2;
		//window.open('http://onestop.wemade.com/popup/hwan/itemshop_pop_hwan.asp','hwan_notice','width=350,height=500'+strPos);
		window.open('http://onestop.wemade.com/pay/main_price04.asp','onestopLogin','');   //¸µÅ© ¼öÁ¤(20100201 ¾çÁ¤È¿)
	}

	// ¾ÆÀÌÅÛ »ó¼¼º¸±â
	function showItemDetail(encIdx){
		if ( encIdx != undefined){
			var winUrl = '/itemshop/pop_item_view.asp?i='+encIdx;
			var strPos = ',left='+(screenWidth-360)/2+',top=50';
			winDetail = window.open(winUrl, 'itemview','width=350,height=500,toolbar=0,menubar=0,scrollbars=no,resizable=no'+strPos);
			if (winDetail != undefined) {
				winDetail.focus();
			}else{
				alert('Àá½Ã ÈÄ ´Ù½Ã ½ÃµµÇØ ÁÖ¼¼¿ä.');
			}
		}
	}


	function showEvtItemDetail(encIdx, encEvt){
		if ( encIdx != undefined && encEvt != undefined){
			var winUrl = '/itemshop/itemshop_detail.asp?e='+encEvt+'&i='+encIdx;
			//var strPos = ',left='+(screenWidth-360)/2+',top='+(screenHeight-500)/2;
			var strPos = ',left='+(screenWidth-360)/2+',top=100';
			winDetail = window.open(winUrl, 'itemDetail','width=360,height=500'+strPos);
			if (winDetail != undefined) winDetail.focus();
		}
	}


	// ¾ÆÀÌÅÛ¼¥ ÀÌ¿ë¾È³»
	function showItemShopGuide(){
		var winUrl = '/itemshop/itemshop_guide.asp';
		var strPos = ',left='+(screenWidth-610)/2+',top='+(screenHeight-735)/2;
		winGuide = window.open(winUrl, 'itemShopGuide','width=610,height=735'+strPos);
		if (winGuide != undefined ){
			winGuide.focus();
		}else{
			alert('ÆË¾÷ Â÷´ÜÀ» ÇØÁ¦ ÇÏ½Ã¸é [¾ÆÀÌÅÛ¼¥ ÀÌ¿ë¾È³»] ¸¦ º¸½Ç ¼ö ÀÖ½À´Ï´Ù.');
		}
	}


	// ¹öÆ° Å¬¸¯ ºñÈ°¼ºÈ­
	function bluring(){
		if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") 
			document.body.focus();
	}

	document.onfocusin=bluring;

	// È¸¿ø °¡ÀÔ
	function goMemberJoin(){
		var strPos = '';
		winJoin = window.open('http://onestop.wemade.com/account/join/membership_ruls.asp?ib='+getCookie("evtValue" ), 'memJoin',''+strPos);
		if( winJoin == undefined ){
			alert('ÆË¾÷ Â÷´ÜÀ» ÇØÁ¦ÇØ ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù.');
		}
	}
	
	// ¹è³Ê ·Î±× ÀúÀå¿ë È£Ãâ (·Î´õ¿ë)
	function setBannerLog(encSeq, encSSeq, strTarget, strLinkUrl, arrDepth){
		var folder = "";
		var frm = document.frmPageLog;
		if (frm !=undefined) {
			document.getElementById('intBmsSeq').value = encSSeq;
			document.getElementById('intBltSeq').value = encSeq;
			saveCurBannerLog();
		}

		if (strTarget == 'blank'){
			winBannerLoc = window.open('about:blank', 'winBanner','');
			if (winBannerLoc != undefined){
				winBannerLoc.location.href = strLinkUrl; return;
			}
			location.reload(); return;
		}else{
			if (strLinkUrl != '#'){
				location.href = strLinkUrl; return;
			}
		}
	}

	//¹è³Ê ·Î±× ÀúÀå¿ë È£Ãâ(by smalldevil  2007-12-04)
	function saveCurBannerLogAfter(myAjax) {}
	function saveCurBannerLog(){
		var strParams = ''; var arrBannerLog = document.getElementsByName('txtPageLogVal');
		for (var i = 0; i < arrBannerLog.length ; i++ ){if (arrBannerLog[i] != undefined){if (i > 0) strParams += '&';strParams += arrBannerLog[i].id + '=' + arrBannerLog[i].value;}}
		var myAjax = new net.ContentLoader('/sitelib/set_banner_log.asp', saveCurBannerLogAfter, null, 'POST', strParams);
	}

	
	// ¹è³Ê ·Î±× ÀúÀå¿ë È£Ãâ
	function insBannerLog(encSeq, url){
		var str_Url =  '/sitelib/set_bannerlog.asp?s=' + encSeq + '&url=' + url;
	}

	//ÆË¾÷Ã¢ »çÀÌÁî Á¶Àý
	function setWindowResize(){
		var thisX = parseInt(document.body.scrollWidth);
		var thisY = parseInt(document.body.scrollHeight);
		var maxThisX = screen.width - 50;
		var maxThisY = screen.height - 50;
		var marginY = 0;
		//alert(thisX + "===" + thisY);
		//alert("ÀÓ½Ã ºê¶ó¿ìÀú È®ÀÎ : " + navigator.userAgent);
		// ºê¶ó¿ìÀúº° ³ôÀÌ Á¶Àý. (Ç¥ÁØ Ã¢ ÇÏ¿¡¼­ Á¶ÀýÇØ ÁÖ½Ê½Ã¿À.)
		if (navigator.userAgent.indexOf("MSIE 6") > 0) marginY = 45;        // IE 6.x
		else if(navigator.userAgent.indexOf("MSIE 7") > 0) marginY = 80;    // IE 7.x
		else if(navigator.userAgent.indexOf("MSIE 8") > 0) marginY = 80;    // IE 8.x
		else if(navigator.userAgent.indexOf("Firefox") > 0) marginY = 82;   // FF
		else if(navigator.userAgent.indexOf("Opera") > 0) marginY = 30;     // Opera
		else if(navigator.userAgent.indexOf("Netscape") > 0) marginY = -2;  // Netscape

		if (thisX > maxThisX) {
			window.document.body.scroll = "yes";
			thisX = maxThisX;
		}
		if (thisY > maxThisY - marginY) {
			window.document.body.scroll = "yes";
			thisX += 19;
			thisY = maxThisY - marginY;
		}
		window.resizeTo(thisX+10, thisY+marginY);

		//var windowX = (screen.width - (thisX+10))/2;
		//var windowY = (screen.height - (thisY+marginY))/2 - 20;
		//window.moveTo(windowX,windowY);
	}

	// The right way to add load events. By Simon Willison
	function addLoadEvent(func) {
		var oldonload = window.onload;
		if (typeof window.onload != 'function') {
			window.onload = func;
		}else{
			window.onload = function() {
				oldonload();
				func();
			}
		}
	}

	//ÆË¾÷ ¶Ù¿ï ¶§ »ç¿ë
	function openNewWin(uVal,nVal,wVal,hVal){
		var strPos = ',left='+(screenWidth-wVal)/2+',top=50';
		nWin = window.open(uVal,nVal,"toolbar=0,menubar=0,scrollbars=no,resizable=no,width=" + wVal +",height=" + hVal + strPos);
		if (nWin != undefined){
			nWin.focus();
		}else{
			alert('ÆË¾÷ Â÷´ÜÀ» ÇØÁ¦ÇØ ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù.');
		}
	}


	//ÀÌº¥Æ® Á¾·á¾Ë¸²
	function alertEvtMsg() {
		alert("ÀÌº¥Æ®°¡ Á¾·áµÇ¾ú½À´Ï´Ù. °¨»çÇÕ´Ï´Ù.");return false;
	}


	// var for tab menu 
	var tmpTabMenuUrl = "";
	function chgTabMenu(objImg){
		if (objImg.src.substring(objImg.src.lastIndexOf('/')).indexOf('_off') > 0){
			tmpTabMenuUrl = objImg.src;
			objImg.src = objImg.src.replace(/_off/gi, '_on');
		}else{
			if (tmpTabMenuUrl.length > 5){
				objImg.src = tmpTabMenuUrl;
				tmpTabMenuUrl = "";
			}
		}
	}

	//png¹è°æÃ³¸®(css»ç¿ë)
	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='http://wemade-image.gscdn.com/null.gif';
		return '';
	}

	//go Top Start
	function goPageTop(){
		if (navigator.userAgent.indexOf("Chrome") > 0) {		//Å©·Ò¿¡¼± Àû¿ëµµÁö ¾ÊÀ½
			location.href = "#goTop";
		} else {
			document.documentElement.scrollTop=0;
		}
	}

	function getStyleAtt(obj,stylePrp){
		var att="";
		if(obj.currentStyle){
			stylePrp=stylePrp.replace(/\-(\w)/g,function(k,z){return z.toUpperCase();});
			att=obj.currentStyle[stylePrp];
		}else if(document.defaultView&&document.defaultView.getComputedStyle)att=document.defaultView.getComputedStyle(obj,null).getPropertyValue(stylePrp);
		return att;
	}

	function getScrollY(){
		var scrollY;
		if(document.documentElement.scrollTop) {
			scrollY=document.documentElement.scrollTop;
		} else if(document.body.scrollTop) {
			scrollY=document.body.scrollTop;
		} else if(window.pageYOffset) {
			scrollY=pageYOffset;
		} else {
			scrollY=0;
		}
		return scrollY;
	}

	function getUserWindowY() {
		var winY;
		if(window.innerHeight) {
		winY=window.innerHeight;
		} else if(document.documentElement.clientHeight) {
			winY=document.documentElement.clientHeight;
		} else if(document.body.clientHeight) {
			winY=document.body.clientHeight;
		}
		return winY;
	}

	function scrollingPageTop(obj,parent,offset){
		var k=0.1;
		var objH=parseInt(getStyleAtt(obj,"height"));
		if(isNaN(objH))return false;
		if(parent)var parentEl=document.getElementById(parent);

		setInterval(function() {
		var agentY=getUserWindowY();
		var scrollY=getScrollY();
		var objY=parseInt(getStyleAtt(obj,"top"));
		var targetY=agentY+scrollY-(objH+offset);
		var distanceY=objY-targetY;
		var steps=Math.abs(distanceY)*k;
		//ºê¶ó¿ìÀúº° À§Ä¡°ª Àû¿ëÇÏ±â
		var setAgentY = setBrowserPosition(93);
		if(objY<targetY){
			if(parent){
				if(parseInt(obj.style.top)<parentEl.clientHeight-obj.clientHeight-setAgentY)objY+=Math.ceil(steps);
			}
			else objY+=Math.ceil(steps);
		} else if(objY>targetY)objY-=Math.ceil(steps);
			obj.style.top=objY+"px";
		},1);
	}
	//go Top End

	//ºê¶ó¿ìÀúº° °ª Àû¿ëÇÏ±â ±âÁØ°ªÀº IE7.0
	function setBrowserPosition(offset) {
		var intPosition;
		if (navigator.userAgent.indexOf("MSIE 6") > 0) intPosition = -10;        // IE 6.x
		else if(navigator.userAgent.indexOf("MSIE 7") > 0) intPosition = 0;    // IE 7.x
		else if(navigator.userAgent.indexOf("Firefox") > 0) intPosition = -30;   // FF
		else if(navigator.userAgent.indexOf("Opera") > 0) intPosition = -42;     // Opera
		else if(navigator.userAgent.indexOf("Netscape") > 0) intPosition = -70;  // Netscape
		else if(navigator.userAgent.indexOf("Chrome") > 0) intPosition = -42;  // Chrome

		return offset + intPosition;
	}

	//ajaxÇüÅÂÀÇ ÆäÀÌÁö ·Î±×
	function saveCurPageLogAfter(myAjax) {}
	function saveCurPageLog(obj){
		var strParams = ''; var arrPageLog = document.getElementsByName('txtPageLogVal');
		if (obj != undefined)	{arrPageLog = document.getElementsByName('txtAjaxPageLogVal');	}
		var strLogTxt, arrLogTxt;
		for (var i = 0; i < arrPageLog.length ; i++ ){
			if (arrPageLog[i] != undefined){
				if (i > 0) strParams += '&'; strLogTxt = arrPageLog[i].value;
				if (strLogTxt.indexOf(',') >= 0) {arrLogTxt = strLogTxt.split(','); strLogTxt = arrLogTxt[0];}
				strParams += arrPageLog[i].id + '=' + strLogTxt;
			}
		}
		var myAjax = new net.ContentLoader('/sitelib/set_curpagelog.asp', saveCurPageLogAfter, null, 'POST', strParams);
	}


	//display »óÅÂ°ª º¯°æ
	function setObjStatus(obj, status) {
		if (obj != undefined) {
			var strObj = eval(document.getElementById(obj));
			if (strObj != undefined) {
				strObj.style.display = status;
			}
		}
	}

	// Àü¿ª º¯¼öÀÓ. Àý´ë »èÁ¦ÇÏ¸é ¾ÈµÊ.
	var sndFlag = false;

	var screenWidth = screen.availwidth;
	var screenHeight = screen.availheight;
	var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;    // true if Internet Explorer


		//¹ÌÅõµ¥ÀÌ·Î º¸³»±â
	function me2day_share() {
		var me2dayUrl = 'http://me2day.net/posts/new?new_post[body]=';
		var url = encodeURIComponent(document.location.href);
		var title = encodeURIComponent(document.title);

		window.open(me2dayUrl + '\"' + title + '\":' + url, 'ShareOnMe2Day','');
	}

	//ÆäÀÌ½ººÏÀ¸·Î º¸³»±â
	function facebook_share() {
		var url = encodeURIComponent(document.location.href);
		var title = encodeURIComponent(document.title);

		window.open('http://www.facebook.com/sharer.php?u=' + url + '&t=' + title, 'ShareOnFacebook','toolbar=0,status=0,width=626,height=436');
	}

	//Æ®À§ÅÍ·Î º¸³»±â
	function twitter_share() {
		var twitterUrl = 'http://twitter.com/home?status=';
		twitterUrl += encodeURIComponent(document.title) + ' ';
		twitterUrl += encodeURIComponent(document.location.href);

		window.open(twitterUrl, 'ShareOnTwitter', '');
	}


		function me2day_share_domain() {
		var me2dayUrl = 'http://me2day.net/posts/new?new_post[body]=';
		var domain = getDomian();
		var url = encodeURIComponent(domain);
		var title = encodeURIComponent(document.title);

		window.open(me2dayUrl + '\"' + title + '\":' + url, 'ShareOnMe2Day','');
	}


	function facebook_share_domain() {
		var domain = getDomian();
		var url = encodeURIComponent(domain);
		var title = encodeURIComponent(document.title);

		window.open('http://www.facebook.com/sharer.php?u=' + url + '&t=' + title, 'ShareOnFacebook','toolbar=0,status=0,width=626,height=436');
	}

	function twitter_share_domain() {
		var domain = getDomian();
		var twitterUrl = 'http://twitter.com/home?status=';
		twitterUrl += encodeURIComponent(document.title) + ' ';
		twitterUrl += encodeURIComponent(domain);

		window.open(twitterUrl, 'ShareOnTwitter', '');
	}


	function getDomian(){ 
	 var domain = location.href; 
	 domain = domain.split("//"); 
	 domain = "http://"+domain[1].substr(0,domain[1].indexOf("/")); 
	 return domain; 
	} 