var AsianaClub = {

	commonUrlPath: "",
	unixServerPath: "",
	dtype: "",

	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();
	}

};
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];
		}
		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 '';
}

