
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// namespace_ad_start
// "ad" manage all the users ads on the site

var ad = {

	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

	counter: 0,

	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

	/*

	The function loads an ad by 4 varios params.

	(1) div_style: style of the div. (empty param is a deafult value and loads as relative position style)

	(2) ad_size: 4 size of ad:
		
		TOP(184x90) price: +30
		RCT(300x60) price: +20
		RCTS(144x106) price: +10
		VER(160x100) price: +0
		
		eBoutique: TOP / RCTS / VER
		Poll: RCT / VER

	(3,4) ad_key & ad_value: there 3 options to load an ad:
	{
		- by location (default):
			key="location" val="HOME_PAGE_TOP_1"
			
		- by id (to post an ad):
			key="id" val="334"
		
		- by content (no need a DB select):
			eBoutique type case:
			key="content" val="<data><ad type='eBoutique' uid='$uid' nickname='$nickname'></ad></data>"
			
			poll type case:
			key="content" val="<data><ad type='poll' id='$pollId' uid='$uid' nickname='$nickname'><![CDATA[$pollTitle]]></ad></data>"
	}

	*/

	load: function (div_style, ad_size, ad_key, ad_val)
	{
		// set params values //
		
		// set the position of the ad
		div_style = (div_style)? "div_style" : "";
		
		// set the size of the ad
		ad_size = (ad_size)? ad_size : "184x90";
		w_size = ad_size.split("x")[0];
		h_size = ad_size.split("x")[1];
		
		// set the key
		ad_key = (ad_key)? ad_key : "location";
		
		// set the value
		ad_val = (ad_val)? ad_val : "GS_HOME_TOP_1";
		
		
		// counter of all ads on the page
		ad.counter++;
		
		// load the banner
		var divId = "GSAdDivId_" + ad.counter;
		var swfId = "GSAdSwfId_" + ad.counter;
		//var swfSrc = "/premium/adPlace/ad12";
		//var swfSrc = "/premium/adPlace/adNew2";
		var swfSrc = "/premium/adPlace/genericAdBadge3";
		var params="size="+ad_size+"&key="+ad_key+"&val="+ad_val;
		
		//alert(params)	
		//document.write("<div id='"+divId+"' style='"+div_style+"'>"); 
		
		AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
			'width', w_size,
			'height', h_size,
			'src', swfSrc,
			'quality', 'high',
			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			'align', 'middle',
			'play', 'true',
			'loop', 'true',
			'scale', 'noscale',
			'wmode', 'transparent',
			'devicefont', 'false',
			'id', swfId,
			'bgcolor', '#ffffff',
			'name', swfId,
			'menu', 'true',
			'allowFullScreen', 'false',
			'allowScriptAccess','sameDomain',
			'movie', swfSrc,
			'salign', 'TL',
			'flashvars',  params
		); //end AC code

		//document.write("</div>"); 
	}

	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

} // namespace_ad_end

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function popupDieHard(url)
{
	//alert(url);
	window.open(url);
}


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


