/* ºê¶ó¿ìÁ® Á¤º¸¸¦ °¡Á®¿É´Ï´Ù.
getBrowserInfo(_returnType:Number) : String
- _returnType : 2 ÀÌ»óÀÌ¸é ºê¶ó¿ìÁ® ÀÌ¸§°ú ¹öÁ¯Á¤º¸¸¦, 1 ÀÌ¸é ºê¶ó¿ìÁ® ¹öÁ¯Á¤º¸¸¦ °¡Á®¿É´Ï´Ù. ±âº»À¸·Î ºê¶ó¿ìÁ® ÀÌ¸§¸¸ °¡Á®¿É´Ï´Ù.
________________________________________________________________________________________________*/
function getBrowserInfo(_returnType) {
	var browserName = window.navigator.appName
	var browserVersion ;
	if (parseInt(_returnType) > 0) {
		if (browserName == "Microsoft Internet Explorer") {
			browserVersion = window.navigator.appVersion.split("; ")[1].split("MSIE ")[1] ;
		} else {
			browserVersion = window.navigator.appVersion.substring(0, window.navigator.appVersion.indexOf(" ")) ;
		}
		return (parseInt(_returnType) == 1) ? browserVersion : browserName+";"+browserVersion ;
	} else {
		return browserName ;
	}
}

/* ÄíÆù ¸®½ºÆ®¸¦ º¸¿©ÁÝ´Ï´Ù.
__________________________________________________*/
var couponListObject ;
function couponListDisp(text,value,_index) {
	if (!couponListObject) couponListObject = document.getElementById("couponListObject") ;
	var titleObject = couponListObject.getElementsByTagName("div")[0] ;
	var listObject = couponListObject.getElementsByTagName("ul")[0] ;
	var dataObject = couponListObject.getElementsByTagName("input")[0] ;
	if (parseInt(_index) >= 0) {
		titleObject.innerHTML = listObject.getElementsByTagName("li")[_index].innerHTML ;
		dataObject.value = text;//_index ;
	}
	listObject.style.display = (listObject.style.display == "block") ? "none" : "block" ;
}

/* ÆË¾÷ »çÀÌÁî¸¦ Á¶ÀýÇÕ´Ï´Ù.
__________________________________________________*/
function resizePopup() {
	var nextWidth = 20 ;
	var nextHeight = 55 ;
	if (getBrowserInfo() == "Microsoft Internet Explorer") {
		switch(getBrowserInfo(2)) {
			case "Microsoft Internet Explorer;6.0" :
				nextHeight = 35 ; break ;
			case "Microsoft Internet Explorer;7.0" :
				nextHeight = 85 ; break ;
		}
		window.resizeTo(document.body.clientWidth + nextWidth, document.body.clientHeight + nextHeight) ;
	} else {
		window.resizeTo(document.documentElement.scrollWidth + nextWidth, document.documentElement.scrollHeight + nextHeight) ;
	}
}

/*********** °³¹ßÀÚ Ãß°¡***************/


// *****±¸¸Å ¼±¹° °ü·Ã
function cboCoupon_onChange(obj)
{
	
	//alert(obj.value);
	if(obj.value==-1 || obj.value==-2)
		CouponInit("");
	else
		CouponInit(obj.value);
	
	if(obj.value==-1 || obj.value==-2)
		SetCoupon(-1);
	else
		SetCoupon(1);
		
}

function couponListDisp_Item(text,value,index)
{
	CouponInit();
	couponListDisp(text,value,index);	
	SetCoupon(index);
}
//ÃßÈÄ ºê¶ó¿ìÀú¿¡ µû¸¥ Å©±â Á¶Á¤
function WindowResize(w,h)
{
	window.resizeTo(w,h)
}

//bp ¿¡¼­ ¿Ã ¶§ ºÎ¸ðÃ¢ gxg ·Î ÀÌµ¿
function GoGXG()
{
	//opener.document.location.href="http://www.gxg.com";
	//window.close();
	window.open("http://www.gxg.com");
}

// GXG È¸¿ø°¡ÀÔ
function JoinGXG()
{
	opener.document.location.href="/Members/memberJoin.aspx";
	window.close();
}

//GXG ·Î±×ÀÎ
function LoginGXG()
{
	opener.document.location.href="/Members/Login.aspx";
	window.close();
}

//GXG ¸¶ÀÌÁ¸
function GoMyzone()
{
	opener.top.document.location.href="/myZone/MyGXG.aspx";
	window.close();
}

//***** ÃæÀü °ü·Ã

//ÈÞ´ëÆù ÀÎÁõ ¸Þ½ÃÁö
function askPhoneAuth()
{
	ask=confirm("ÈÞ´ëÆù ÀÎÁõÀ» ÇÏ½Ã°Ú½À´Ï±î?")
	if(ask)
	{
		location.href="../../Members/MobilePhoneAuthPopup.aspx"
	}
	else
		history.back();
}

function Recharge_Impossible(grade)
{
	//alert("ÈÞ´ëÆù ÀÎÁõÀ» ÇÏÁö ¾Ê¾Ò½À´Ï´Ù.");
	//history.back();
	location.href = "http://www.gxg.com/Common/ErrorMessage.aspx?sType=simple&code=0013&msg=";
}

function LogMsg(msg)
{
	alert(msg);
	//window.close();
}

//ÃæÀü ¿Ï·á(¼º°ø)
function Completion(msg)
{
	alert(msg)
	//window.close();
}
//ÃæÀü ½ÇÆÐ(½ÇÆÐ)
function RechargeFail(msg)
{
	alert(msg);
	//window.close();
}

//alert
function AlertMsg(msg)
{
	alert(msg);				
	//window.close();
}

//¿¬µ¿ ¸Þ½ÃÁö
function AltMsg(msg)
{
	alert(msg);
}

function go_opener(url)
{						
	if(opener==undefined || opener.closed){
		window.open(url, "openWin");
		self.close();
	}
	else{
		opener.location.href = url;
		opener.focus();
		//self.close();
	}
}

//»õ·Î°íÄ§¹æÁö
function noEvent() 
{
	if (event.keyCode == 116) 
	{
		event.keyCode= 2;
		return false;
	}
	else if(event.ctrlKey && (event.keyCode==78 || event.keyCode == 82 || event.keyCode == 114))
	{
		return false;
	}
}
document.onkeydown = noEvent;


function click()
{
	if (event.button != 1)
	{
		alert('¸¶¿ì½º ¿À¸¥ÂÊ ¸Þ´º »ç¿ë±ÝÁö!!!');
		return false;
	}
}
document.onmousedown=click;
