if(typeof adsUniqId=="undefined")
{
	z=new Date();
	adsUniqId="uniqId-"+z.getMinutes()+""+z.getSeconds()+""+z.getMilliseconds();//Genera un Uniq Id
	}
(function(){
	var b,a;
	if(typeof(atm_opc_zone)=="undefined"||(typeof(atm_opc_zone)!="undefined"&&atm_opc_zone.replace(/\s*/ig,"")==""))
	{
		b=new Date();
		atm_opc_zone="g-"+b.getMinutes()+""+b.getSeconds()+""+b.getMilliseconds()//Genera otro UniqId
		}
	
	//Check the type of ads
	if(typeof(atm_req_type)=="undefined" || (atm_req_type!="text" && atm_req_type!='img' && atm_req_type!='random'))
	{
		atm_req_type="img";//Base Case
		}
	a=function(){
		var e,d,g,f,c;
		e=false;
		if(typeof(atm_req_format)!="undefined"&&atm_req_format.replace(/\s*/ig,"")!=""&&atm_req_format.search(/X/i)!=-1&&atm_req_format.replace(/X/i,"").search(/\D/i)==-1&&atm_req_format.search(/^\d.*\d$/i)!=-1)
		{
			atm_req_format=atm_req_format.toUpperCase();
			d=atm_req_format.split("X");//Lo divide en arreglo en cada aparicion de 'X'
			/*g="http://localhost/adtrafficmanager.com/ads/ads";*/
			g="http://www.adtrafficmanager.com/ads/ads";
			/*f=new Array();
			f.client=(typeof(atm_opc_client)!="undefined"?atm_opc_client:"");
			f.zone=(typeof(atm_opc_zone)!="undefined"?atm_opc_zone:"");
			f.format=atm_req_format;
			f.width=d[0];
			f.height=d[1];
			f.uid=adsUniqId;
			f.adtype=atm_req_type;
			f.href=location.href;
			g+="?";
			for(c in f){
				g+=c+"="+f[c]+"&";
				}*/
			//alert(g);
			if(typeof(atm_opc_client)=='undefined')
			{
				atm_opc_client='';
				}
			if(typeof(atm_opc_zone)=='undefined')
			{
				atm_opc_zone='';
				}
			
			//Construir el banner
			g+="?"+"client="+atm_opc_client+"&zone="+atm_opc_zone+"&format="+atm_req_format+"&width="+d[0]+"&height="+d[1]+"&uid="+adsUniqId+"&adtype="+atm_req_type+"&href="+location.href;
			
			//http://www.adtrafficmanager.com/ads/ads?client=&zone=g-4722715&format=160X600&width=160&height=600&uid=uniqId-4722715&adtype=img&href=http://www.freecandidate.com/&$family=[object
			
			e='<ins style="border: medium none ; margin: 0pt; padding: 0pt; display: inline-table; height: '+d[1]+"px; position: relative; visibility: visible; width: "+d[0]+'px;"><ins style="border: medium none ; margin: 0pt; padding: 0pt; display: block; height: '+d[1]+"px; position: relative; visibility: visible; width: "+d[0]+'px;"><iframe id="'+atm_opc_zone+'" scrolling="no" frameborder="0" vspace="0" style="left: 0pt; position: absolute; top: 0pt;width:'+d[0]+'px;height:'+d[1]+'px;" src="'+g+'" marginwidth="0" marginheight="0" hspace="0" allowtransparency="true"> </iframe></ins></ins>'}
			return e!==false?e:""};
			document.write(a());})();
