// JScript File
function tryReady(time_elapsed){
	if(typeof jQuery == "undefined"){
		if (time_elapsed <= 5000) {
			setTimeout("tryReady(" + (time_elapsed + 200) + ")", 200);
		} else {alert("Timed out while loading jQuery.");}
	} else {
		jQuery("#ServerTime").load("http://"+location.href.split("/")[2]+"/ServerTime.aspx #Time");
		jQuery("#gameImg").bind("mouseover",function(){jQuery("#Games").css("display","inline");});
		jQuery("#Games").bind("mouseout",function(){jQuery(this).css("display","none");});
		jQuery("#Games").bind("mouseover",function(){jQuery(this).css("display","inline");});
		setInterval(function(){jQuery("#ServerTime").load("http://"+location.href.split("/")[2]+"/ServerTime.aspx #Time");},60000);
		bpLoad();
	}
}
function loadScript(){
	var script = document.createElement('script')
	script.setAttribute("type","text/javascript")
	script.setAttribute("src", "http://ajax.microsoft.com/ajax/jquery/jquery-1.3.2.min.js")
	if (typeof script!="undefined")
		document.getElementsByTagName("head")[0].appendChild(script)
}
var url = window.location.href.toLowerCase();
var indexOfMaple = url.indexOf('maplestory.nexon.net');
var site = url.split("/")[2].split(".")[0];
var m = {marginLeft: "", top: "0px"};
function getMargin(w){
	var ret = "0px";
	if(site=="forum"||site =="forums"||site=="maplestory"||site=="maple"){
		ret = (800-w)/2 +10 + "px";
	}
	else {
		ret = jQuery(window).width() > 950 ? Math.floor((jQuery(window).width() - w)/2) + "px" : "0px";
		jQuery(window).live("resize", function(){
			if (jQuery(window).width() > 950){
				jQuery("#bpTrailer").css({marginLeft: Math.floor((jQuery(window).width() - w)/2)+"px"});
			}
		});
		if (site=="passport" && jQuery.browser.msie){jQuery("#bpTeaser").css("display","inline");}
	}
	return ret;
}
var bpObj = {
	html: true,
	reveal: function(){
		m.marginLeft = getMargin(800);
		jQuery("#bpTeaser").css(m);
		if(this.html){
			jQuery("#bpTeaser").html(this.slideshow);
		} else {
			this.slideshow;
		}
	},
	remove: function(){
		m.marginLeft = getMargin(200);
		jQuery("#bpTeaser").css(m);	
		if(this.html){
			jQuery("#bpTeaser").html(this.teaser);
		} else {
			this.teaser;
		}
	},
	teaser: "",
	slideshow: ""
};
function bpLoad(){
	if (url.indexOf("maplestory.nexon.net/intro/") > -1 ||
		url.indexOf("mabinogi.nexon.net/intro/") > -1 ||	
		url.indexOf("mabinogi.nexon.net/preview/intro.htm") > -1 ||	
		url.indexOf("combatarms.nexon.net/intro.aspx") > -1 ||	
		url.indexOf("dungeonfighter.nexon.net/intro/") > -1
	){return;}
	if (typeof jQuery.flash == "object" ){
		bpObj.teaser = jQuery.flash.create({
				swf:"http://nxcache.nexon.net/blockparty/teardown/BP_Teaser.swf",
				width:200,
				height:31,
				params:{
					wmode:"transparent", 
					bgcolor:"#FFFFFF", 
					allowScriptAccess:"always"
				}
			});
		bpObj.slideshow = jQuery.flash.create({
				swf:"http://nxcache.nexon.net/blockparty/teardown/BP_Slideshow.swf",
				width:800,
				height:600,
				params:{
					wmode:"transparent", 
					bgcolor:"#FFFFFF", 
					allowScriptAccess:"always"
				}
			});
	}
	else if (typeof jQuery.swfobject == "function" ){
		bpObj.teaser = jQuery.swfobject.embedSWF("http://nxcache.nexon.net/blockparty/teardown/BP_Teaser.swf","bp_swf","200","31", "9.0.0", false, false, {wmode:"transparent", bgcolor:"#FFFFFF", allowScriptAccess:"always"});
		bpObj.slideshow = jQuery.swfobject.embedSWF("http://nxcache.nexon.net/blockparty/teardown/BP_Slideshow.swf","bp_swf","800","600", "9.0.0", false, false, {wmode:"transparent", bgcolor:"#FFFFFF", allowScriptAccess:"always"});
		bpObj.html = false;
	} else {
		bpObj.teaser = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\"200\" height=\"31\" VIEWASTEXT>\r";
		bpObj.teaser += "\t<param name=\"movie\" value=\"http://nxcache.nexon.net/blockparty/teardown/BP_Teaser.swf\">\r";
		bpObj.teaser += "\t<param name=\"quality\" value=\"high\">\r";
		bpObj.teaser += "\t<param name=\"wmode\" value=\"transparent\">\r";
		bpObj.teaser += "\t<param name=\"menu\" value=\"false\">\r";
		bpObj.teaser += "\t<param name=\"allowScriptAccess\" value=\"always\">\r";
		bpObj.teaser += "\t<embed src=\"http://nxcache.nexon.net/blockparty/teardown/BP_Teaser.swf\" allowScriptAccess=\"always\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"200\" height=\"31\" wmode=\"transparent\" menu=\"false\" ></embed>\r";
		bpObj.teaser += "</object>";
		bpObj.slideshow = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\"800\" height=\"600\" VIEWASTEXT>\r";
		bpObj.slideshow += "\t<param name=\"movie\" value=\"http://nxcache.nexon.net/blockparty/teardown/BP_Slideshow.swf\">\r";
		bpObj.slideshow += "\t<param name=\"quality\" value=\"high\">\r";
		bpObj.slideshow += "\t<param name=\"wmode\" value=\"transparent\">\r";
		bpObj.slideshow += "\t<param name=\"menu\" value=\"false\">\r";
		bpObj.slideshow += "\t<param name=\"allowScriptAccess\" value=\"always\">\r";
		bpObj.slideshow += "\t<embed src=\"http://nxcache.nexon.net/blockparty/teardown/BP_Slideshow.swf\" allowScriptAccess=\"always\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"800\" height=\"600\" wmode=\"transparent\" menu=\"false\" ></embed>\r";
		bpObj.slideshow += "</object>";
	}
	bpObj.remove();
	jQuery("#bpTeaser").css(m);
}
function trackCloseSlideshow(){
	if (typeof pageTracker != "undefined")
		pageTracker._trackEvent("bpTeaser", "CloseSlideshow");
}
function trackReplaySlideshow(){
	if (typeof pageTracker != "undefined")
		pageTracker._trackEvent("bpTeaser", "ReplaySlideshow");
}
function revealTeardown(){
	if (typeof pageTracker != "undefined")
		pageTracker._trackEvent("bpTeaser", "OpenSlideshow");
	bpObj.reveal();
}
function removeTeardown(){
	if (typeof pageTracker != "undefined")
		pageTracker._trackEvent("bpTeaser","CloseBomber");
	bpObj.remove();
}
var htmlStr = "";
htmlStr +="<style type=\"text/css\"><!--\r";
htmlStr +="#GNB{margin:0;padding:0;z-index:4;font-family: Arial,Helvetica,sans-serif;font-size: 10px;color: #666666;height:31px;width:100%;";
htmlStr +="background:#ffffff url(http://nxcache.nexon.net/nx/global/gnb/white/gnb_white_background.jpg);position:absolute;left:0;top:0;text-decoration:none;}\r";
htmlStr +="#GNB img{border:none;}\r";
htmlStr +="#GNB a, a.visited{text-decoration:none;font-size: 10px;color: #666666;}\r";
htmlStr +="#GNB a:hover, a:hover *, a.visited:hover {color:#ff6600;text-decoration:none;}\r";
htmlStr +="#GNB .logo{position:absolute;left:13px;top:0;}\r";
htmlStr +="#GnbMenus{float:right;padding-right:128px;position:relative;}\r";
htmlStr +="#Games{position:absolute;left:234px;top:0;text-transform:uppercase;z-index:3;}\r";
htmlStr +="#GnbMenus ul{cursor:pointer;width:121px;list-style:none; margin:0;border-right:solid 1px #000000; border-left:solid 1px #000000; ";
htmlStr +="background: #ffffff url(http://nxcache.nexon.net/nx/global/gnb/white/gnb_dropdown_background.gif) no-repeat -1px 0; line-height:22px; padding:0 2px 0 4px;}\r";
htmlStr +="#GnbMenus li{cursor:pointer;background:url(http://nxcache.nexon.net/nx/global/gnb/white/gnb_white_dropdown_arrow.gif) no-repeat 0 7px;width:103px;";
htmlStr +="padding-left:13px;vertical-align:text-top; border-bottom:1px #8F8F8F dotted;font-weight:bold;}\r";
htmlStr +="#GnbMenus li.no_border{border-bottom:none;}\r";
htmlStr +="#GnbListBottom{background:url(http://nxcache.nexon.net/nx/global/gnb/white/gnb_list_bottom.gif) no-repeat top ;width:129px;height:4px;}\r";
htmlStr +=".dfo{line-height:10px;padding-top:6px;padding-bottom:6px;position:relative;}\r";
htmlStr +=".dfo img{position:absolute;left:58px;top:18px;}\r";
htmlStr +="#GnbMenus li.itcg{border-bottom:none;text-transform:none;}\r";
htmlStr +=".itcg_new{margin-left:5px;}\r";
htmlStr +="#ServerTime{background:url(http://nxcache.nexon.net/nx/global/gnb/white/server_time_background.gif) no-repeat;width:59px;height:20px;";
htmlStr +="position:absolute;right:13px;top:5px;color:#ccff00;padding:3px 0 0 80px;z-index:1;}\r";
htmlStr +="--></style>\r";
if(indexOfMaple <0 || indexOfMaple ==""){ 
	htmlStr +="\r<!--[if IE]><style type=\"text/css\">#GnbMenus ul{padding-right:1px;margin-top:-4px;}#Games{width:121px;}</style><![endif]-->\r";
}
else{
	htmlStr +="\r<!--[if IE]><style type=\"text/css\">div#GnbMenus ul{width:121px;margin-top:-4px;}div#GnbMenus ul li{width:103px; margin-right:1px;}div#GnbListBottom{margin-left:0px;}#Games{width:121px;}</style><![endif]-->\r";
}
htmlStr +="<div id=\"bpTeaser\" style=\"position:absolute;z-index:2000\"><div id=\"bp_swf\"></div></div>\r";
htmlStr +="<div id=\"GNB\">\r";
htmlStr +="\t<a href=\"http://www.nexon.net\"><img alt=\"Nexon America\" src=\"http://nxcache.nexon.net/nx/global/gnb/white/gnb_nx_logo.gif\" class=\"logo\" id=\"Nexon\" /></a>\r";
htmlStr +="\t<div id=\"GnbMenus\">\r";
htmlStr +="\t\t<a href=\"http://passport.nexon.net/WZ.ASPX?PART=/MyMaple/AccountConfirmForm\"><img alt=\"\" src=\"http://nxcache.nexon.net/nx/global/gnb/white/gnb_menu_account.jpg\" /></a>\r";
htmlStr +="\t\t<a href=\"http://billing.nexon.net/WZ.ASPX?PART=/Purchasing/Account\"><img alt=\"\" src=\"http://nxcache.nexon.net/nx/global/gnb/white/gnb_menu_charge.jpg\" /></a>\r";
htmlStr +="\t\t<a href=\"http://www.nexon.net/Support/CustomerSupport.aspx\"><img alt=\"\" src=\"http://nxcache.nexon.net/nx/global/gnb/white/gnb_menu_support.jpg\" /></a>\r";
htmlStr +="\t\t<img alt=\"\" src=\"http://nxcache.nexon.net/nx/global/gnb/white/gnb_menu_games.jpg\" id=\"gameImg\" />\r";
htmlStr +="\t\t<div style=\"display: none;\" id=\"Games\">\r";
htmlStr +="\t\t\t<img alt=\"view games\" src=\"http://nxcache.nexon.net/nx/global/gnb/white/gnb_menu_games_hover.jpg\" />\r";
htmlStr +="\t\t\t<ul>\r";
htmlStr +="\t\t\t\t<li><a href=\"http://maplestory.nexon.net\">MapleStory</a></li>\r";
htmlStr +="\t\t\t\t<li><a href=\"http://mabinogi.nexon.net\">Mabinogi</a></li>\r"
htmlStr +="\t\t\t\t<li><a href=\"http://combatarms.nexon.net\">Combat Arms</a></li>\r";
htmlStr +="\t\t\t\t<li class=\"dfo\"><a href=\"http://dungeonfighter.nexon.net\">Dungeon Fighter Online</a><img src=\"http://nxcache.nexon.net/nx/global/gnb/white/tab_new.gif\" alt=\"New!\" /></li>\r";
htmlStr +="\t\t\t\t<li class=\"itcg\"><a href=\"http://itcg.nexon.net\">iTCG ONLINE</a></li>\r";
htmlStr +="\t\t\t</ul>\r";
htmlStr +="\t\t\t<div id=\"GnbListBottom\"/></div>\r";
htmlStr +="\t\t</div>\r";
htmlStr +="\t\t<div id=\"ServerTime\"></div>\r";
htmlStr +="\t</div>\r";
htmlStr +="</div>\r";
if (typeof jQuery != "undefined" && jQuery.browser.version == "6.0")
	htmlStr = htmlStr.replace(/\t|\r/g, "");
document.write(htmlStr);
if(typeof jQuery == "undefined"){
	loadScript();
	tryReady(0);
} else {
	jQuery("#ServerTime").load("http://"+location.href.split("/")[2]+"/ServerTime.aspx #Time");
	jQuery("#gameImg").bind("mouseover",function(){jQuery("#Games").css("display","inline");});
	jQuery("#Games").bind("mouseout",function(){jQuery(this).css("display","none");});
	jQuery("#Games").bind("mouseover",function(){jQuery(this).css("display","inline");});
	setInterval(function(){jQuery("#ServerTime").load("http://"+location.href.split("/")[2]+"/ServerTime.aspx #Time");},60000);
	bpLoad();
}