﻿function lolgamebanner(myurl, mywidth, myheight, isscroll) {
	//alert("mywidth="+mywidth+"- myheight="+myheight+"- isscroll="+isscroll+"- myurl="+myurl);
	if(mywidth == "0" && myheight == "0") {
		if(isscroll == "0" ) {
			document.location.href= myurl;
		} else {
			window.open(myurl,"_blank");
		}
	} else {
		open_popup(myurl,mywidth,myheight,isscroll,"lolgamebanner" );
	}
}
/* Flash Banner & XML
-------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Flash Banner & XML
-------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/*
objID			: 플래시 아이디
objSource		: 플래시 파일 이름 및 경로
objXML			: 플래시에 입력될 xml 파일 이름
objWidth		: 플래시 가로 사이즈
objHeight		: 플래시 세로 사이즈
objQuality	: 플래시 무비 퀄러티
objWmode	: 플래시 Wmode
objBgcolor	: 플래시 배경색
*/
function flashBannerObject(objID, objSource, objXML, objWidth, objHeight, objQuality, objWmode, objBgcolor)
{
	var cntT;
	var xmlDoc;
	var bannerPriorityCnstT = 0;
	
	try
	{
		if (window.ActiveXObject)
		{
			xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
			xmlDoc.async=false;
			xmlDoc.load(objXML);
		}
		else
		{
			var xmlHttp = false;
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			xmlHttp.open("get", objXML, false);
			xmlHttp.send(null);

			xmlDoc = xmlHttp.responseXML;
		}

		if (window.ActiveXObject)
		{
			cntT = xmlDoc.getElementsByTagName("dataInfo")[0].childNodes.length;
		}
		else
		{
			var cntW = xmlDoc.getElementsByTagName("dataInfo")[0].childNodes.length;
			cntT = (cntW-1) / 2;
		}

		for (i=0; i<cntT; i++)
		{
			bannerPriorityCnstT = eval(bannerPriorityCnstT) + eval(xmlDoc.getElementsByTagName("thumNum")[i].childNodes[0].nodeValue);
		}

		var focusItemCnst = Math.random();
		focusItemCnst = parseInt(focusItemCnst * bannerPriorityCnstT);

		bannerPriorityCnstT = 0;
		var chkMovie =  0;
		for (i=0; i<cntT; i++)
		{
			bannerPriorityCnstT = eval(bannerPriorityCnstT) + eval(xmlDoc.getElementsByTagName("thumNum")[i].childNodes[0].nodeValue);
			if (focusItemCnst < bannerPriorityCnstT)
			{
				chkMovie = i;
				break;
			}
		}
	}
	catch (e)
	{
		chkMovie =  0;
	}
	
	//page url
	var pageUrl=self.window.location.href;
	if(pageUrl.substring(0,5)=="https") swfUrl="https";
	else swfUrl="http";
	//default value setting
	if (objID=="") objID="ShockwaveFlash1";
	if (objWidth=="") objWidth="0";
	if (objHeight=="") objHeight="0";
	if (objQuality=="") objQuality="high";
	if (objWmode=="") objWmode="transparent";

	if (objSource.match(/=/))
	{
		objSource = objSource + "&server=" +  objXML + "&chkMovie=" + chkMovie;
	}
	else
	{
		objSource = objSource + "?server=" +  objXML + "&chkMovie=" + chkMovie;
	}
	document.writeln('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+swfUrl+'://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,124,0" width="'+objWidth+'" height="'+objHeight+'" id="'+objID+'" align="middle">');
	document.writeln('<param name="movie" value="'+objSource+'" />');
	document.writeln('<param name="allowScriptAccess" value="SameDomain" />');
	document.writeln('<param name="menu" value="false" />');
	document.writeln('<param name="quality" value="high" />');
	document.writeln('<param name="bgcolor" value="'+objBgcolor+'" />');
	document.writeln('<param name="wmode" value="'+objWmode+'" />');
	document.writeln('<embed src="'+objSource+'" allowScriptAccess="always" menu="false" quality="high" bgcolor="'+objBgcolor+'" wmode="'+objWmode+'" width="'+objWidth+'" height="'+objHeight+'" name="'+objID+'" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.writeln('</object>');
}