// Å¸ÀÌÆ²---------
document.title="Ä«¿îÅÍ-½ºÆ®¶óÀÌÅ© ¿Â¶óÀÎ";
// ---------Å¸ÀÌÆ²
document.write("<script type='text/javascript' src='../../js/global_url.js'></script>");
document.write("<script type='text/javascript' src='../../js/global_dev.js'></script>");
document.write("<script type='text/javascript' src='../../js/WindowsMediaPlayer.js'></script>");


var IE = (navigator.appName.indexOf("Microsoft")>-1);
var IE6 = (navigator.appName.indexOf("Microsoft")>-1)&&(navigator.userAgent.indexOf("MSIE 6")>-1);
var IE7 = (navigator.appName.indexOf("Microsoft")>-1)&&(navigator.userAgent.indexOf("MSIE 7")>-1);


/*ActiveX ÇÃ·¡½¬*/
// id: flash id
// url: source url
// w: source width
// h: source height
// t: wmode (window/transparent/opaque)
function Flash(id,url,w,h,bg,t){
document.write("\
	<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width="+w+" height="+h+" id="+id+">\
	<param name='movie' value="+url+" />\
	<param name='wmode' value="+t+" />\
	<param name='bgcolor' value="+bg+" />\
	<param name='allowScriptAccess' value='always' />\
	<param name='quality' value='high' />\
	<param name='menu' value='false' />\
	<embed src="+url+" width="+w+" height="+h+" wmode="+t+" name="+id+" bgcolor="+bg+" allowScriptAccess='always' quality='high' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />\
	</object>\
");
}

function MainBannerFlash(id,url,w,h,bg,t,fv){
document.write("\
	<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width="+w+" height="+h+" id="+id+">\
	<param name='movie' value="+url+" />\
	<param name='wmode' value="+t+" />\
	<param name='FlashVars' value="+fv+" />\
	<param name='bgcolor' value="+bg+" />\
	<param name='allowScriptAccess' value='always' />\
	<param name='quality' value='high' />\
	<param name='menu' value='false' />\
	<embed src="+url+" width="+w+" height="+h+" wmode="+t+" name="+id+" bgcolor="+bg+" allowScriptAccess='always' quality='high' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />\
	</object>\
");
}

//function Flash(id,url,w,h,bg,t){
//document.write("\
	//<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width="+w+" height="+h+" id="+id+">\
	//<param name='movie' value="+url+" />\
	//<param name='wmode' value="+t+" />\
	//<param name='bgcolor' value="+bg+" />\
	//<param name='allowScriptAccess' value='always' />\
	//<param name='quality' value='high' />\
	//<param name='menu' value='false' />\
	//<param name='base' value='.' />\
	//<embed base="." src="+url+" width="+w+" height="+h+" wmode="+t+" name="+id+" bgcolor="+bg+" allowScriptAccess='always' quality='high' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />\
	//</object>\
//");
//}



//-------- »ó´Ü ³×ºñ°ÔÀÌ¼Ç
/* -- 1024 º¸´Ù ÀÛÀ»½Ã ½ºÅ©·Ñ¹Ù ³ªÅ¸³²
var sc = document.getElementsByTagName('html')[0];
function window.onresize() {
if (sc.offsetWidth<1000){
	sc.style.overflowX="auto";
	}
else {
	sc.style.overflowX="hidden";
	}
}

function scrollSwitch() {
if (sc.offsetWidth<996){
		sc.style.overflowX="auto";
	}
else {
	sc.style.overflowX="hidden";
	}
}
scrollSwitch();

*/
var globalHn="";
var globalSn="";
var globalCn="";


// »ó´Ü³×ºñ---------
var hn="0",sn="0",cn="0",tn="0",globalId="0",flaFarm="0";
function Mnav(){
	try{
		var Depth = arguments.length;
		var DepthName = new Array("hn","sn","cn","tn");
		for(i=0;i<Depth;i++){
			if(i==0) hn =  arguments[i];if(i==1) sn =  arguments[i];if(i==2) cn =  arguments[i];if(i==3) tn =  arguments[i];
			globalId = (i==0) ? arguments[i] : globalId+"_"+arguments[i] ;
			flaFarm = (i==0) ?  DepthName[i]+"="+arguments[i] : flaFarm+"&"+DepthName[i]+"="+arguments[i] ;
		}
		Flash('top_nav','../../s4/top_navi.swf?'+flaFarm,'980','61','#ffffff','transparent');
	}catch(e){}
	//document.write("<img src='../../s4/fla_nav.jpg' alt="+flaFarm+" /><br />");
} 


// ----------------- ¸ÞÀÎ visual ----------------- //
function Main_visual(){
	//document.write("<img src='../../s4/img_main.jpg' alt='' />");
	Flash('main_visual','../../s4/main.swf','980','290','#ffffff','transparent');
	}


// ----------------- ¸ÞÀÎ Game Download ----------------- //
function Gamedown(){
Flash('gamedown_main','../../s4/gamedown_main.swf','150','28','#ffffff','transparent');
}


// ----------------- ¸ÞÀÎ start ----------------- //
function Gamestart_main(){
Flash('gamestart_main','../../s4/gamestart_main.swf','550','200','#ffffff','transparent');
}



// ----------------- ¼­ºê³×ºñ(2008.02.04) ----------------- //
function snav(){ 
 var h = new Array(179,309,180,180,232,234,180,179); // 205 -> 180·Î º¯°æ 2009-03-13
 Flash('TnavCon','../../s4/left_navi'+hn+'.swf?'+flaFarm,'220',h[hn-1],'#ffffff','none')
}

// ----------------- Game Start button ----------------- //
function GameStart(){
//document.write("<img src='../../s4/tmp_support.jpg','730','84'>");
Flash('start_button','../../s4/startbt.swf','202','78','#ffffff','transparent');
}

function GameStartEvent(){
//document.write("<img src='../../s4/tmp_support.jpg','730','84'>");
Flash('start_button','../../s4/startbtevent.swf','202','78','#ffffff','transparent');
}


// ----------------- ¼­ºê news ----------------- //
function Sub_news(){
document.write("<img src='../../s4/tmp_news.jpg','730','84'>");
//Flash('sub_key','../../s4/sub_key.swf','750','170','#ffffff','transparent');
}


// ----------------- ¼­ºê Game Info ----------------- //
function Sub_gameinfo(){
document.write("<img src='../../s4/tmp_gameinfo.jpg','730','84'>");
//Flash('sub_key','../../s4/sub_key.swf','750','170','#ffffff','transparent');
}

// ----------------- ¼­ºê Ranking ----------------- //
function Sub_ranking(){
document.write("<img src='../../s4/tmp_ranking.jpg','730','84'>");
//Flash('sub_key','../../s4/sub_key.swf','750','170','#ffffff','transparent');
}

// ----------------- ¼­ºê Clan ----------------- //
function Sub_Clan(){
document.write("<img src='../../s4/tmp_clan.jpg','730','84'>");
//Flash('sub_key','../../s4/sub_key.swf','750','170','#ffffff','transparent');
}

// ----------------- ¼­ºê Community ----------------- //
function Sub_Community(){
document.write("<img src='../../s4/tmp_community.jpg','730','84'>");
//Flash('sub_key','../../s4/sub_key.swf','750','170','#ffffff','transparent');
}

// ----------------- ¼­ºê support ----------------- //
function Sub_Support(){
document.write("<img src='../../s4/tmp_support.jpg','730','84'>");
//Flash('sub_key','../../s4/sub_key.swf','750','170','#ffffff','transparent');
}

// ----------------- ¼­ºê League(080526 Ãß°¡.°øÀÎ½Ä) ----------------- //
function Sub_League(){
document.write("<img src='../../s4/tmp_league.jpg','730','84'>");
//Flash('sub_key','/flash/sub_key.swf','750','170','#ffffff','transparent');
}

// ----------------- ¼­ºê Event.2008-10-29 Ãß°¡.Á»ºñ¸ðµå ¾ÆÀÌµð¾î °Ô½ÃÆÇ ----------------- //
function Sub_Event(){
document.write("<img src='../../s4/tmp_event.jpg','730','84'>");
//Flash('sub_key','../../s4/sub_key.swf','750','170','#ffffff','transparent');
}


// ----------------- ¼­ºê start ----------------- //
function Gamestart_sub(){
Flash('gamestart_sub','../../s4/gamestart_sub.swf','750','170','#ffffff','transparent');
}


// ----------------- °øÅë µ¿¿µ»ó ----------------- //
function Vod(){
	//document.write("<img src='http://s.nx.com/S2/game/cso/global/tmp_left03.gif' alt='' />");
	Flash('vod','../../s4/movie.swf','200','170','#ffffff','transparent');
	}


// ----------------- Data µ¿¿µ»ó ----------------- //
function Movie_vod(){
	//document.write("<img src='http://s.nx.com/S2/game/cso/global/tmp_left03.gif' alt='' />");
	Flash('movie_vod','../../s4/movie_vod_new.swf','480','360','#ffffff','transparent');
	}


// ----------------- Main banner(2008-10-30 ¼öÁ¤.ÇÁ·Î¸ð¼Ç ³ëÃâ °­È­) ----------------- //
function Main_banner(){
	MainBannerFlash('main_banner','../../s4/banner.swf','337','234','#ffffff','transparent','xml=/cso/CMS/MainBanner.aspx');
	}



// ----------------- Game Info(ÃÊº¸ÀÚ °¡ÀÌµå / ÀÎÅÍÆäÀÌ½º) ----------------- //
function Gameing_screen(){
	//document.write("<img src='http://s.nx.com/S2/game/cso/global/tmp_left03.gif' alt='' />");
	Flash('movie_vod','../../s4/Gameing_screen01.swf','680','510','#ffffff','transparent');
	}
function Situation_screen(){
	//document.write("<img src='http://s.nx.com/S2/game/cso/global/tmp_left03.gif' alt='' />");
	Flash('movie_vod','../../s4/Situation_screen01.swf','680','510','#ffffff','transparent');
	}

// ----------------- Ranking PC¹æ ¸Ê ----------------- //
function RankingMapS(){
	document.write("<img src='http://s.nx.com/S2/game/cso/ranking/img_rankingmap.gif' alt='' />");
	//Flash('movie_vod','../../s4/Situation_screen.swf','348','196','#ffffff','transparent');
	}
function RankingMapL(){
	document.write("<img src='http://s.nx.com/S2/game/cso/ranking/tmp_local.gif' alt='' />");
	//Flash('movie_vod','../../s4/Situation_screen.swf','690','226','#ffffff','transparent');
	}


// ----------------- ÇªÅÍ ----------------- //                                                
function Footer(){
document.write("<img src='http://s.nx.com/S2/game/cso/global/img_footer03.gif' usemap='#footer'>\
	<map name='footer'><area shape='rect' href='http://company.nexon.com/' target='_blank' coords='66,22,151,51' alt=''>\
	<area shape='rect' href='http://company.nexon.com/' target='_blank' coords='213,19,262,38' alt='È¸»ç¼Ò°³'>\
	<area shape='rect' href='http://career.nexon.com/' target='_blank' coords='269,19,318,40' alt='Ã¤¿ë¾È³»'>\
	<area shape='rect' href='http://www.nexon.com/join/page/nx.aspx?url=info/stipulation' target='_blank' coords='326,17,384,39' alt='ÀÌ¿ëÀÚ¾à°ü'>\
	<area shape='rect' href='javascript:popFoot02()' coords='394,17,479,40' alt='°ÔÀÓÀÌ¿ëµî±Þ¾È³»'>\
	<area shape='rect' href='http://www.nexon.com/join/page/nx.aspx?url=info/guideuserinfo' target='_blank' coords='487,16,577,42' alt='°³ÀÎÁ¤º¸Ãë±Þ¹æÄ§'>\
	<area shape='rect' href='http://www.nexon.com/join/page/nx.aspx?url=info/guidechildprotect' target='_blank' coords='588,16,663,42' alt='Ã»¼Ò³âº¸È£Á¤Ã¥'>\
	<area shape='rect' href='javascript:popFoot04()' coords='661,16,709,40' alt='¿î¿µÁ¤Ã¥'>\
	<area shape='rect' href='http://pcbang.nexon.com/?ST=nexon&PS=footer' target='_blank' coords='715,17,770,40' alt='³Ø½¼PC¹æ'></map>\
	<div class='copy'>Copyright ¨Ï 2007 NEXON Corporation & Valve Corporation. All rights reserved. <br />Valve, Counter-Strike and Counter-Strike Online are trademarks, registered trademarks, or applied trademarks of Valve Corporation.</div>\
	");
}



// ----------------- gallery »ç¿ë ----------------- //
/*
function showPic(whichpic) {
  if (!document.getElementById("placeholder")) return true;
  var source = whichpic.getAttribute("href");
  var placeholder = document.getElementById("placeholder");
  placeholder.setAttribute("src",source);
  if (!document.getElementById("buttbtn")) return true;
  var source = whichpic.getAttribute("href");
  var buttbtn = document.getElementById("buttbtn");
  buttbtn.setAttribute("href",source);
  if (!document.getElementById("description")) return false;
  if (whichpic.getAttribute("title")) {
    var text = whichpic.getAttribute("title");
  } else {
    var text = "";
  }
  var description = document.getElementById("description");
  if (description.firstChild.nodeType == 3) {
    description.firstChild.nodeValue = text;
  }
  return false;
}

function prepareGallery() {
  if (!document.getElementsByTagName) return false;
  if (!document.getElementById) return false;
  if (!document.getElementById("imagegallery")) return false;
  var gallery = document.getElementById("imagegallery");
  var links = gallery.getElementsByTagName("a");
  for ( var i=0; i < links.length; i++) {
    links[i].onclick = function() {
      return showPic(this);
	}
    links[i].onkeypress = links[i].onclick;
  }
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

addLoadEvent(prepareGallery);

*/

// --------IE pngÆÄÀÏ »ç¿ë
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 ''; 
} 



function link(){
	var url = "";
	var depth = arguments.length;
	try {
		if(depth==0) return;
		else if(depth==1) url = eval("u"+arguments[0]+"[0]");
		else if(depth==2) url = eval("u"+arguments[0]+"_"+arguments[1]+"[0]");
		else if(depth==3) url = eval("u"+arguments[0]+"_"+arguments[1]+"_"+arguments[2]+"[0]");
		else if(depth==4) url = eval("u"+arguments[0]+"_"+arguments[1]+"_"+arguments[2]+"_"+arguments[3]+"[0]");
		else if(depth==5) url = eval("u"+arguments[0]+"_"+arguments[1]+"_"+arguments[2]+"_"+arguments[3]+"_"+arguments[4]+"[0]");
		if(url=="") alert("ÁØºñÁßÀÔ´Ï´Ù");
		
		else location.href = url;
	}catch(e) { alert("ÁØºñÁßÀÔ´Ï´Ù"); }

}


/*
function link(){
	var url = "";
	var depth = arguments.length;
	try {
		if(depth==0) return;
		else if(depth==1) url2 = "u"+arguments[0]+"[0]";
		else if(depth==2) url2 = "u"+arguments[0]+"_"+arguments[1]+"[0]";
		else if(depth==3) url2 = "u"+arguments[0]+"_"+arguments[1]+"_"+arguments[2]+"[0]";
		else if(depth==4) url2 = "u"+arguments[0]+"_"+arguments[1]+"_"+arguments[2]+"_"+arguments[3]+"[0]";
		else if(depth==5) url2 = "u"+arguments[0]+"_"+arguments[1]+"_"+arguments[2]+"_"+arguments[3]+"_"+arguments[4]+"[0]";
		else location.href = url;
alert(url2)
	}catch(e) { alert("ÁØºñÁßÀÔ´Ï´Ù.."); }
}
*/



function setString(node){
	var spStr = "" , last="";
	try{
		var url  = eval(node+"[0]");
		var name = eval(node+"[1]");
	}
	catch(e){
		document.write("¾ÆÀÌµð°¡ Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù : " + node);
	}
	var nodeId  = node;
	var spStr = " > ";
	if(node.lastIndexOf('_') != -1) setString(node.substring(0,node.lastIndexOf('_')));
	else lineMapStr += "<a href='"+eval("u0[0]")+"'>"+ eval("u0[1]")+"</a>" + spStr;
	if(currentPath != nodeId)
		lineMapStr += "<a href='"+url+"'>"+ name+"</a>" + spStr;
	else
		lineMapStr += "<b>"+ name +"</b>";
}
function Path(){ //ÆÄÀÏÆÐ½º
	try{
		lineMapStr = "";
		index = 0;
		currentPath="u"+globalId;
		setString("u"+globalId);
		document.write(lineMapStr);
	}catch(e){
		document.write("¿¹¿ÜÃ³¸® ¹ß»ý : " +  e);
	}
}



// MemberInfo ·¹ÀÌ¾î 
function getposOffset(overlay, offsettype){
    var totaloffset=(offsettype=="left")? overlay.offsetLeft : overlay.offsetTop;
    var parentEl=overlay.offsetParent;
    while (parentEl!=null){
        totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
        parentEl=parentEl.offsetParent;
    }
    return totaloffset;
}

function overlay(curobj, subobjstr, opt_position){
    if (document.getElementById){
    var subobj=document.getElementById(subobjstr)
        subobj.style.display=(subobj.style.display!="block")? "block" : "none"
    var xpos=getposOffset(curobj, "left")+((typeof opt_position!="undefined" && opt_position.indexOf("right")!=-1)? -(subobj.offsetWidth-curobj.offsetWidth) : 0) 
    var ypos=getposOffset(curobj, "top")+((typeof opt_position!="undefined" && opt_position.indexOf("bottom")!=-1)? curobj.offsetHeight : 0)
        subobj.style.left=xpos+"px"
        subobj.style.top=ypos+"px"
    return false
    }
    else
return true
}

function overlayclose(subobj){
    document.getElementById(subobj).style.display="none"
}




function pop(url,name,w,h){ window.open(url,name,'width='+w+',height='+h+',scrollbars=no') } //Popup(½ºÅ©·Ñ¹Ù¾øÀ½)
function pops(url,name,w,h){ window.open(url,name,'width='+w+',height='+h+',scrollbars=yes') } //Popup(½ºÅ©·Ñ¹ÙÀÖÀ½)


function popFoot02(){ window.open('../Popup/pop_gamerank.html','°ÔÀÓÀÌ¿ëµî±Þ¾È³»','width=500,height=435','scrollbars=no') } //Ç²ÅÍ : °ÔÀÓÀÌ¿ëµî±Þ¾È³»
function popFoot04(){ window.open('../Popup/operation_rule_cso.html','¿î¿µÁ¤Ã¥','width=600,height=640','scrollbars=no') } //Ç²ÅÍ : ¿î¿µÁ¤Ã¥

function OpenPcroom() { window.open('http://pcbang.nexon.com/nexoncom/PCBANG_init.asp?ST=nexon&PS=footer' ,'PCBANG','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizeable=no, copyhistory=no, width=498, height=365'); return; }


// 080519 Ãß°¡.°øÀÎ½Ä : ÅÇ ÄÁÅÙÃ÷(´Ü¼øÁ¤º¸ ÆäÀÌÁöÀÇ ¼­ºê ÅÇ¸Þ´º ±¸Çö½Ã È°¿ë °¡´É,Àû¿ë´ë»ó ¿¤¸®¸ÕÆ® ÃÊ±âÈ­Çü)
// ÅÇ ÄÁÅÙÃ÷
function initTabMenu(tabContainerID) {
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("a");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {
		if (tabAnchor.item(i).className == "tab")
			thismenu = tabAnchor.item(i);
		else
			continue;

		thismenu.container = tabContainer;
		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
		thismenu.targetEl.style.display = "none";
		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);
		thismenu.onclick = function tabMenuClick() {
			currentmenu = this.container.current;
			if (currentmenu == this)
				return false;

			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				if (currentmenu.imgEl) {
					currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_on.gif", "_off.gif");
				} else {
					currentmenu.className = currentmenu.className.replace(" on", "");
				}
			}
			this.targetEl.style.display = "";
			if (this.imgEl) {
				this.imgEl.src = this.imgEl.src.replace("_off.gif", "_on.gif");
			} else {
				this.className += " on";
			}
			this.container.current = this;

			return false;
		};

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	if (tabContainer.first)
		tabContainer.first.onclick();
}
