function getFlashVer(){
var i,a,o,p,s="Shockwave",f="Flash",t=" 2.0",u=s+" "+f,v=s+f+".",rSW=RegExp("^"+u+" (\\d+)");
if((o=navigator.plugins)&&(p=o[u]||o[u+t])&&(a=p.description.match(rSW)))return a[1];
else if(!!(window.ActiveXObject))for(i=10;i>0;i--)try{if(!!(new ActiveXObject(v+v+i)))return i}catch(e){}
return 0;
}

function _getPix(args){(new Image()).src=args;}

function li_ib(ib){
var host="http://"+(ib.host?ib.host:"adcentre.magnetisemedia.com");
var swf="http://cloud.leadintelligence.co.uk/inbanner-148.swf";
swf+="?ad="+ib.ad+"&site="+ib.site+"&w="+ib.width+"&h="+ib.height;
var minversion=0;
var wmode="transparent";
var bgcolor="#FFFF00";
var allowscriptaccess = "sameDomain";
var paf=host+"/flash/address.jsp";
var form=host+(ib.site==16?"/inbanner/leads.jsp":"/leads");
var action=host+(ib.site==16?"/inbanner/leads.jsp":"/action");
var event=host+(ib.site==16?"/inbanner/leads.jsp":"/li/event");
//var data="http://img.leadintelligence.co.uk/livead/AD_ID.xml";
var data=ib.data?ib.data:"http://img.leadintelligence.co.uk/livead/in-banner/LAYOUT_ID.xml";
if (ib.nocache) data+="?"+new Date().getTime();
var track=host+"/track";
var trackclick="http://formregistration.com/trackclick";
var l,h=window.location.href,c=h?h.length:0;while(h&&(c=h.lastIndexOf(',',c-1))+1){l=h.substring(c+1);if(l.substr(0,4)=='http')break;}l=l?l:(h?h:'');l=l.replace(/</g,"&lt;").replace(/>/g,"&gt;");
if (minversion<=getFlashVer())  {
var _l=0;var _t=0;

try{
function _ao(e){do{_l+=e.offsetLeft-e.scrollLeft;_t+=e.offsetTop-e.scrollTop;}while(e=e.offsetParent);}
function _pe(w){if(w&&w.parent){var fs=w.parent.document.getElementsByTagName("iframe");for(var i=0;i<fs.length;i++)if(fs[i].contentWindow==w)return fs[i];}return null;}
var id="_ib"+new Date().getTime();
document.write('<span id="'+id+'"></span>');
var w=window;
var e=document.getElementById(id);
var _el=e;
while(1){_ao(e);if(w==w.top)break;e=_pe(w);w=w.parent;}
_el.parentNode.removeChild(_el);
}catch(e){}


var xml='<banner width="'+ib.width+'" height="'+ib.height+'">' + (ib.ad?"<ad>"+ ib.ad +"</ad>":"") + "<site>"+ ib.site +"</site>"+(ib.layout?"<layout>"+ib.layout+"</layout>":"")+(ib.source?"<source>"+ ib.source +"</source>":"")+(ib.sourceData?"<sourceData>"+ ib.sourceData +"</sourceData>":"")+"<host>"+host+"</host><paf>"+paf+"</paf><form>"+form+"</form><action>"+action+"</action><event>"+event+"</event>"+ (ib.lead?"<lead>"+ ib.lead +"</lead>":"")+(ib.click?"<click>"+ ib.click +"</click>":"") +"<data>"+data+"</data><track>"+track+"</track><trackclick>"+trackclick+"</trackclick><referer>"+l+"</referer>"+(_l?"<pagex>"+_l+"</pagex>":"")+(_t?"<pagey>"+_t+"</pagey>":_t)+"</banner>";
var flashvars="xml="+ escape(xml);
if(ib.page) flashvars+="&page="+ib.page;


adcode = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+
' width="'+ib.width+'px" height="'+ib.height+'px">'+
'<PARAM NAME="movie" VALUE="'+swf+'"/><PARAM NAME="quality" VALUE="high"/><PARAM NAME="bgcolor" VALUE="'+bgcolor+'"/><PARAM NAME="wmode" VALUE="'+wmode+'"/><PARAM NAME="AllowScriptAccess" VALUE="'+allowscriptaccess+'"/><PARAM NAME="flashvars" VALUE="'+flashvars+'"/>'+
'<EMBED src="'+swf+'" quality=high wmode='+wmode+
' swLiveConnect=TRUE WIDTH="'+ib.width+'" HEIGHT="'+ib.height+'" bgcolor='+bgcolor+' flashvars="'+flashvars+'"'+
' TYPE="application/x-shockwave-flash" AllowScriptAccess="'+allowscriptaccess+'"></EMBED></OBJECT>';
document.write(adcode);
} else {
var link=host+"/redirect_tracking/"+ib.ad+"/2/"+ib.site;
document.write('<A TARGET="_top" HREF="'+link+'"><IMG SRC="'+ib.gif+'" alt="" BORDER=0></A>');
}
}
li_ib(_ib);

