//var NpfBannerManager = new function __NpfBannerManager()

var MapleAdBannerManager = new function __MapleAdBannerManager()
{
	this.AddBanner = function ( divID, ID, width, height )
	{
		//NgbEVM.AddHandler( NgbEVM.k_nEventType_onPageEnd, new NgbEVMDelegator( NpfBannerManager.WriteBanner ), divID, ID, width, height );
		EVM.addHandler( EVM.k_nEventType_onPageEnd, EVM.k_nPriority_normal, new EVMDelegator( MapleAdBannerManager.WriteBanner ), divID, ID, width, height );
	}
	
	this.WriteBanner = function()
	{
		//alert( arguments );
		//alert( arguments.length );	
		//alert( arguments[ 1 ] );
		//alert( arguments[ 2 ] );
		//alert( arguments[ 3 ] );
		//alert( arguments[ 4 ] );
		

		var divID = arguments[ 1 ];
		//var divID = 'adR2';
		var ID = arguments[ 2 ];
		//var ID = 'ros_box@left';
		var width = arguments[ 3 ];
		//var width = 200;
		var height = arguments[ 4 ];
		//var height = 170;
		
		//new __NpfBanner( divID, ID, width, height ).Write();
		new __MapleAdBanner( divID, ID, width, height ).Write();
	}
}

function __MapleAdBanner( divID, ID, width, height )
{
	this.divID = divID;
	this.ID = ID;
	this.width = width;
	this.height = height;
	
	this.Write = function()
	{
		//alert( "¾Æ.. ¿Ö ¾È³ª¿Í?" );
		//alert(this.GetIframeString());
		document.getElementById( this.divID ).innerHTML = this.GetIframeString();		
	}

	this.GetIframeString = function()
	{
		return '<IFRAME tabindex=0 SRC="' + this.GetIframeSrc() + '" WIDTH=' + this.width + ' HEIGHT=' + this.height + ' NORESIZE SCROLLING="No" FRAMEBORDER="0" MARGINHEIGHT="0" MARGINWIDTH="0" allowTransparency="true"></IFRAME>';
	}
	
	this.GetIframeSrc = function()
	{
			//return 'http://ad.nexon.com/NetInsight/html/nexon/www.nexon.com/' + this.ID;
			return 'http://ad.nexon.com/NetInsight/html/nexon/maplestory.nexon.com/' + this.ID;
			
			
			//strURL = "http://ad.nexon.com/NetInsight/html/nexon/" + this.NXBanner_strAddr + "/" + this.NXBanner_strPage + "";
	}
}
