var AsianaClub = {

	commonUrlPath: "",
	unixServerPath: "",
	dtype: "",
	mtype: "",
	ttype: "",

	appname: navigator.appName,
	IE55: (navigator.userAgent.indexOf('MSIE 5.5')>0),
	IE6: (navigator.userAgent.indexOf('MSIE 6')>0),
	IE7: (navigator.userAgent.indexOf('MSIE 7')>0),
	IE8: (navigator.userAgent.indexOf('MSIE 8')>0),

	swfprint: function(objid,furl,fwidth,fheight,transoption,flashvars) {
		var ieTxt = '<object id="'+ objid +'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,124,0" width="'+ fwidth +'" height="' + fheight +'" align="middle">';
		ieTxt += '<param name="allowScriptAccess" value="always"/>';
		ieTxt += '<param name="movie" value="'+ furl +'"/>';
		ieTxt += '<param name="quality" value="high"/>';
		ieTxt += '<param name="bgcolor" value="#ffffff"/> ';
		ieTxt += '<param name="menu" value="false"/> ';
		if (flashvars) ieTxt += '<param name="flashVars" value="'+ flashvars +'">';
		if (transoption == "t") {
			ieTxt += '<param name="wmode" value="transparent"/>';
		} else if	(transoption == "o") {
			ieTxt += '<param name="wmode" value="opaque"/>';
		}
		ieTxt += '</object>';

		var ffTxt = '<embed id="'+ objid +'" type="application/x-shockwave-flash" src="'+ furl +'" width="'+ fwidth +'" height="' + fheight +'" menu="false" ';
		if (flashvars) ffTxt += ' flashVars="'+ flashvars +'" ';
		if (transoption == "t")	{
			ffTxt += ' wmode="transparent"';
		} else if	(transoption == "o") {
			ffTxt += ' wmode="opaque"';
		}
		ffTxt +='allowScriptAccess="always"';
		ffTxt += '></embed>';

		if(this.appname=="IE") document.write(ieTxt);
		else  document.write(ffTxt);
	},

	dimLayer: function(the_id, the_width, the_height) {
		if(the_id=="none"){
			document.getElementById('siteMapSec').style.display = 'none';
			document.getElementById('dimLayer').style.display = "none";
			this.selectBoxNone('visible');
		} else {
			var lfrm = document.getElementById(the_id);
			if(the_width=="none"){
				lfrm.style.display = 'none';
				document.getElementById('dimLayer').style.display = "none";
				this.selectBoxNone('visible');
			} else {
				this.dimLayerView(null);
				lfrm.style.display = 'block';
				this.selectBoxNone('hidden');
			}
		}
	},

	dimLayerView: function(dim) {
		var oBody = ( document.compatMode && document.compatMode!="BackCompat" ) ? document.documentElement : document.body  ;
		var cheight= ( oBody.scrollHeight > oBody.clientHeight ? oBody.scrollHeight : oBody.clientHeight  ) + 'px';
		if(!dim){
			document.getElementById('dimLayer').style.display = "block";
			document.getElementById('dimLayer').style.height = cheight;
		}
	},

	gnbHeight: function(fheight){
		document.getElementById('gnb').height = fheight;
		document.getElementById('gnbContainer').height = fheight;
	},

	commonLnb2Height: function(fheight){
		document.getElementById('commonLnb').height = fheight+"px";
		document.getElementById('commonLnb2').height = fheight+"px";
	},

	selectBoxNone: function() {
		if(this.IE6){
			var obj = document.getElementsByTagName("select");
			for(var i=0;i<obj.length;i++){
				obj[i].style.visibility = check;
			}
		}
	},
	
	addComma: function(number) {
		number = '' + number;
		if (number.length > 3) {
		var mod = number.length % 3;
		var output = (mod > 0 ? (number.substring(0,mod)) : '');
			for (i=0 ; i < Math.floor(number.length / 3); i++) {
			if ((mod == 0) && (i == 0))
				output += number.substring(mod+ 3 * i, mod + 3 * i + 3);
			else
				output+= ',' + number.substring(mod + 3 * i, mod + 3 * i + 3);
			}
		return (output);
		}
		else return number;
	},
	
	goLogin: function() {
		document.forms["fmAsianaClubLogin"].submit();
	},

	printTopHtml: function() {

		var topHtml = '';
		var lnbMenuCode = '';
		if(this.dtype == "Y" || this.dtype == null) {
			topHtml += ('<link rel="stylesheet" type="text/css" href="'+this.commonUrlPath+'css/commonTop.css" />');
		} else {
			topHtml += ('<link rel="stylesheet" type="text/css" href="'+this.commonUrlPath+'css/commonTop2.css" />');
		}
		if(this.mtype == "2"){
			lnbMenuCode = 'F010000';
		} else {
			lnbMenuCode = 'F020000';
		}
		topHtml += ('<!--[if (IE 6)]>');
		topHtml += ('<style type="text/css">');
		topHtml += ('	@import url("'+this.commonUrlPath+'css/ie6.css");');
		topHtml += ('</style>');
		topHtml += ('<![endif]-->');
		//topHtml += ('<scr' + 'ipt type="text/javascript" src="'+this.commonUrlPath+'js/allMenuView.js"></scr'+'ipt>');
		topHtml += ('<div id="commonTopAsianaSec">');
		topHtml += ('	<!-- 상단 우측 메뉴 -->');
		topHtml += ('	<div class="mainTopMenu">');
		topHtml += ('		<ul>');

		if (asiana_sLoginMile == "") {
			topHtml += ("<form name=\"fmAsianaClubLogin\" id=\"fmAsianaClubLogin\" action=\""+this.commonUrlPath+"MyAsiana/Login/FAbcLogin001.jsp\" method=\"get\">");
			topHtml += ("<input type=\"hidden\" name=\"CoopGoUrl\" value=\"" + document.URL + "\">");
			topHtml += ("<input type=\"hidden\" name=\"PartnerCode\" value=\"" + partnerCode + "\">");
			topHtml += ("</form>");
			topHtml += ('			<li class="login"><a href="javascript:;" onclick="AsianaClub.goLogin(); return false;"><img src="'+this.commonUrlPath+'images/btn/tlogin_1.gif" alt="로그인" /></a></li>');
		} else {
			topHtml += ('			<li class="txt">내 마일리지 : <strong>' + this.addComma(asiana_sLoginMile) + '</strong></li>');
		}

		//topHtml += ('			<li class="map"><a href="javascript:;" onclick="AsianaClub.dimLayer(\'siteMapSec\', 888, 556); return false;"><img src="'+this.commonUrlPath+'images/commonTopImg/siteMap_1.gif" alt="전체보기" /></a></li>');
		topHtml += ('			<li><a href="'+this.commonUrlPath+'Event/Event_List.jsp"><img src="'+this.commonUrlPath+'images/commonTopImg/tmenu_1_1.gif" alt="뉴스&amp;이벤트" /></a></li>');
		topHtml += ('			<li><a href="'+this.commonUrlPath+'MyAsiana/Update/FAbcClubIntro001.jsp"><img src="'+this.commonUrlPath+'images/commonTopImg/tmenu_2_1.gif" alt="회원가입" /></a></li>');
		topHtml += ('			<li><a href="'+this.commonUrlPath+'customer/Faq_List.jsp"><img src="'+this.commonUrlPath+'images/commonTopImg/tmenu_3_1.gif" alt="고객센터" /></a></li>');
		topHtml += ('		</ul>');
		topHtml += ('	</div>');
		topHtml += ('	<!-- /상단 우측 메뉴 -->');

		topHtml += ('	<!-- 로고 & GNB -->');
		topHtml += ('	<div class="gnbLogo">');
		topHtml += ('		<div class="logo"><a href="'+AsianaClub.unixServerPath+'"><img src="'+this.commonUrlPath+'images/commonTopImg/logo_1.gif" border="0" /></a></div>');
		topHtml += ('		<div id="gnbContainer">');
		topHtml += ('			<scr' + 'ipt type="text/javascript">');
		topHtml += ('				AsianaClub.swfprint("gnb", "'+this.commonUrlPath+'images/commonTopImg/gnb.swf",758,42,"t","xmlURL='+this.commonUrlPath+'xml/menuXml.jsp&fontURL='+this.commonUrlPath+'images/commonTopImg/yoon.swf&loginCheck=N")');
		topHtml += ('			</scr'+'ipt>');
		topHtml += ('		</div>');
		topHtml += ('	</div>');
		topHtml += ('	<!-- /로고 & GNB -->');

		topHtml += ('	<!-- 좌측 상단 LNB -->');
		topHtml += ('	<div id="commonLnb" class="commonLnb">');
		topHtml += ('			<scr' + 'ipt type="text/javascript">');
		topHtml += ('				AsianaClub.swfprint("commonLnb2", "'+this.commonUrlPath+'images/commonTopImg/commonLnb2.swf",166,400,"t","xmlURL='+this.commonUrlPath+'xml/menuXml.jsp&fontURL='+this.commonUrlPath+'images/commonTopImg/yoon.swf&menuCODE='+lnbMenuCode+'&open=0")');
		topHtml += ('			</scr'+'ipt>');
		topHtml += ('	</div>');
		topHtml += ('	<!-- /좌측 상단 LNB -->');
		if(this.ttype == "2"){
			topHtml += ('	<div class="mileageMallTit"><img src="'+this.commonUrlPath+'images/title/mileagemall_save.gif" alt="투어앤마일즈 제휴사의 예약 서비스를 편리하게 이용하시고 마일리지 적립 혜택까지 누리세요!!" /></div>');
		} else {
			topHtml += ('	<div class="mileageMallTit"><img src="'+this.commonUrlPath+'images/title/mileagemall_usse.gif" alt="마일리지 사용몰 제휴사의 상품 및 서비스를 마일리지로 편리하게 이용하실 수 있습니다." /></div>');
		}
		topHtml += ('</div>');

		document.writeln(topHtml);
	}

};
var asianaClubIncludeDomain = "";
for (var i=0;i<document.getElementsByTagName("script").length;i++) {
	if (document.getElementsByTagName("script")[i].src.indexOf("coopui_")>=0) {
		asianaClubIncludeDomain = document.getElementsByTagName("script")[i].src;
		asianaClubIncludeDomain = asianaClubIncludeDomain.substring(asianaClubIncludeDomain.indexOf("//")+2, asianaClubIncludeDomain.length);
		asianaClubIncludeDomain = asianaClubIncludeDomain.substring(0, asianaClubIncludeDomain.indexOf("/"));
		AsianaClub.unixServerPath = "http://" + asianaClubIncludeDomain;
		AsianaClub.commonUrlPath = "http://" + asianaClubIncludeDomain + "/Korean/Club2008/";
		
		if(!(document.getElementsByTagName("script")[i].src.match( /dtype=(.*)/ ))){
			AsianaClub.dtype = null;
		} else {
			AsianaClub.dtype = (document.getElementsByTagName("script")[i].src.match( /dtype=(.*)/ ))[1];
		}
		if(!(document.getElementsByTagName("script")[i].src.match( /mtype=([0-9])/ ))){
			AsianaClub.mtype = null;
		} else {
			AsianaClub.mtype = (document.getElementsByTagName("script")[i].src.match( /mtype=([0-9])/ ))[1];
		}
		if(!(document.getElementsByTagName("script")[i].src.match( /ttype=([0-9])/ ))){
			AsianaClub.ttype = null;
		} else {
			AsianaClub.ttype = (document.getElementsByTagName("script")[i].src.match( /ttype=([0-9])/ ))[1];
		}
		break;
	}
}
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 '';
}
if (AsianaClub.appname == "Microsoft Internet Explorer") AsianaClub.appname = "IE";
AsianaClub.printTopHtml();