/* This source code is Copyright (c) Vibrant Media 2001-2008 and forms part of the patented Vibrant Media product "IntelliTXT" (sm). */
try {if('undefined'==typeof $iTXT) {var $iTXT={};}} catch(x) {dbM('<b style="color:red;">NAMESPACE INITIALISATION FAIL</b> '+x.message,1);} $iTXT.Element=function(d) {this.elem=null;this.events=null;this.mode=$iTXT.Element.MODE_ELEMENT;if('undefined'!=typeof $iTXT.tmpl&&'undefined'!=typeof $iTXT.tmpl.generic&&'undefined'!=typeof d) {dbM('<b style="color:blue;">New Render Mechanism:</b> Render Ad Type is '+d.adType,0);this.template=$iTXT.tmpl.generic;dbM('<b style="color:blue;">New Render Mechanism:</b> Getting generic template',0);if('undefined'!=typeof $iTXT.tmpl['type'+d.adType]) {dbM('<b style="color:blue;">New Render Mechanism:</b> Getting template for type '+d.adType,0);this.template=$iTXT.tmpl['type'+d.adType];} else {dbM('<b style="color:blue;">New Render Mechanism:</b> <b style="color:red;">UNABLE TO GET TEMPLATE</b> for type '+d.adType,0);} $iTXT.tglb={};if(this.template.globals) {for(var globName in this.template.globals) {$iTXT.tglb[globName]=this.template.globals[globName];}} if('undefined'!=typeof d.detailId) {this.id=d.detailId;if('undefined'!=typeof $cons) {gDI=this.id;}} if($iTXT.tglb.getALStub) {dbM('<b style="color:blue;">New Render Mechanism:</b> Getting stub URL for target.',0);d.target=eval($iTXT.tglb.getALStub);} if($iTXT.tglb.getAVStub) {dbM('<b style="color:blue;">New Render Mechanism:</b> Getting stub URL for adView.',0);d.adView=eval($iTXT.tglb.getAVStub);d.adView=$iTXT.func.appendToURL(d.adView,"idh="+d.idHash);} this.title=d.title;this.keyword=d.keyword;this.desc=d.desc;this.target=d.target;this.adView=d.adView;this.cta=d.cta;this.cts=d.cts;this.trackingImage=d.trackingImage;this.adType=d.adType;} try {if('undefined'==typeof this.id) {this.id=$iTXT.func.genUUID();}} catch(x) {this.id='';} this.data=d;};$iTXT.Element.prototype.getAdType=function() {return this.adType;};$iTXT.Element.prototype.getCTA=function() {return this.cta;};$iTXT.Element.prototype.setCTA=function(cta) {this.cta=cta;};$iTXT.Element.prototype.getCTS=function() {return this.cts;};$iTXT.Element.prototype.setCTS=function(cts) {this.cts=cts;};$iTXT.Element.prototype.getDesc=function() {return this.desc;};$iTXT.Element.prototype.setDesc=function(desc) {this.desc=desc;};$iTXT.Element.prototype.addEvent=function(event) {for(var prop in event) {this.events[prop]=event[prop];}};$iTXT.Element.prototype.getEvents=function() {return this.events;};$iTXT.Element.prototype.setEvents=function(events) {this.events=events;};$iTXT.Element.prototype.getId=function() {return this.id;};$iTXT.Element.prototype.getKeyword=function() {return this.keyword;};$iTXT.Element.prototype.setKeyword=function(keyword) {this.keyword=keyword;};$iTXT.Element.prototype.getMode=function() {return this.mode;};$iTXT.Element.prototype.setMode=function(mode) {if($iTXT.Element.MODE_STRING==mode||$iTXT.Element.MODE_ELEMENT==mode) {this.mode=mode;}};$iTXT.Element.prototype.getStyling=function() {return this.styling;};$iTXT.Element.prototype.setStyling=function(styling) {this.styling=styling;};$iTXT.Element.prototype.getTrackingImage=function() {return this.trackingImage;};$iTXT.Element.prototype.setTrackingImage=function(trkimg) {this.trackingImage=trkimg;};$iTXT.Element.prototype.getAdView=function() {return this.adView;};$iTXT.Element.prototype.setAdView=function(adView) {this.adVIew=adView;};$iTXT.Element.prototype.getTarget=function() {return this.target;};$iTXT.Element.prototype.setTarget=function(target) {this.target=target;};$iTXT.Element.prototype.getTitle=function() {return this.title;};$iTXT.Element.prototype.setTitle=function(title) {this.title=title;};$iTXT.Element.prototype.render=function() {dbM('<b style="color:blue;">New Render Mechanism:</b> Rendering elements in '+(($iTXT.Element.MODE_STRING==this.mode)?'string':'element')+' mode',0);var exclusive=false;if('undefined'!=typeof this.template&&'undefined'!=typeof this.template.members&&'undefined'!=typeof this.data) {if('undefined'!=typeof this.template.attachments) {$iTXT.glob.atts=this.template.attachments;} var cElem=_iterate(this.template,this.data,this.mode);this.elem=$iTXT.Element.convertElem(cElem,this.mode);if('undefined'!=typeof this.template.type&&'item'==this.template.type) {if($iTXT.Element.MODE_STRING==this.mode&&'string'==typeof this.elem) {this.elem='<tr class="vm_tr">'+cElem+'</tr>';} else {this.elem=document.createElement('tr');this.elem.className='vm_tr';this.elem.appendChild(cElem);}} else {this.elem=cElem;} return this.elem;} function _iterate(obj,d,m) {if(exclusive) {return null;} var iElem=null;if('undefined'!=typeof obj.type) {if('undefined'!=typeof obj.members) {if($iTXT.Element.MODE_STRING==m&&'string') {var wrapper=null;var outer=null;if('row'==obj.type) {wrapper='<tr class="vm_tr">';} else {wrapper='<td class="vm_td"><table cellpadding="0" cellspacing="0" border="0">';} var isChildren=false;for(var mem in obj.members) {var member=obj.members[mem];var mElem=_iterate(member,d,m);if(null!=mElem) {isChildren=true;wrapper+=mElem;}} if('row'==obj.type) {wrapper+='</tr>';} else {wrapper+='</table></td>';} if(isChildren) {iElem=wrapper;}} else {var wrapper=null;var outer=null;if('row'==obj.type) {wrapper=document.createElement('tr');wrapper.className=('vm_tr');} else {outer=document.createElement('td');outer.className=('vm_td');wrapper=document.createElement('table');wrapper.cellPadding=0;wrapper.cellSpacing=0;wrapper.border=0;outer.appendChild(wrapper);} for(var mem in obj.members) {var member=obj.members[mem];var mElem=_iterate(member,d,m);if(null!=mElem) {wrapper.appendChild(mElem);}} if(null!=wrapper.firstChild) {if(null!=outer) {iElem=outer;} else {iElem=wrapper;}}} if(null!=iElem) {iElem=$iTXT.Element.convertElem(iElem,m);iElem=$iTXT.Element.Styling.apply(iElem,obj.styling);iElem=$iTXT.Element.Events.apply(iElem,obj.events);}} else {var data={adType:d.adType};for(var prop in obj) {if('type'==prop||'members'==prop||'styling'==prop||'exclusive'==prop||'events'==prop||'wrapStyling'==prop||'wrapEvents'==prop||'attachments'==prop) {continue;} try {var val=eval('d.'+obj[prop]);if('undefined'==typeof val&&'undefined'!=typeof this[prop]) {val=this[prop];}} catch(x){} if('undefined'!=typeof val) {data[prop]=val;}} var mElem=null ; try {dbM('<b style="color:blue;">New Render Mechanism:</b> Considering creating new instance of class '+obj.type,0);mElem=new(eval(obj.type))(data);mElem.setMode(m);} catch(x) {dbM('<b style="color:red;">$iTXT.Element INSTANTIATION FAIL</b> '+x.message,1);} if(null!=mElem) {mElem.setStyling(obj.styling);mElem.setEvents(obj.events) ; mElem=mElem.render();if(null!=mElem) {dbM('<b style="color:blue;">New Render Mechanism:</b> New instance of class '+obj.type+' was created.',0);if($iTXT.Element.MODE_STRING==m) {iElem='<td class="vm_td">'+mElem+'</td>';} else {iElem=document.createElement('td');iElem.className='vm_td';iElem.appendChild(mElem);} if('undefined'!=typeof obj.wrapStyling) {iElem=$iTXT.Element.Styling.apply(iElem,obj.wrapStyling);} if('undefined'!=typeof obj.wrapEvents) {iElem=$iTXT.Element.Events.apply(iElem,obj.wrapEvents);} iElem=$iTXT.Element.convertElem(iElem,m);if('undefined'!=typeof obj.exclusive) {exclusive=obj.exclusive;}} else {dbM('<b style="color:blue;">New Render Mechanism:</b> Instance of class '+obj.type+' was NOT required.',0);}}}} return iElem;}};$iTXT.Element.Text=function(d) {if(null!=d&&'undefined'!=typeof d) {this.text=d.text;} else {this.text='';} $iTXT.Element.prototype.constructor.call(this);};$iTXT.Element.Text.prototype=new $iTXT.Element;$iTXT.Element.Text.prototype.constructor=$iTXT.Element.Text;$iTXT.Element.Text.prototype.getText=function() {return this.text;};$iTXT.Element.Text.prototype.setText=function(text) {this.text=text;};$iTXT.Element.Text.prototype.render=function() {if(null!=this.text&&'undefined'!=typeof this.text&&''!=this.text) {this.elem='<p>'+this.text+'</p>';} if(null!=this.elem) {this.elem=$iTXT.Element.convertElem(this.elem,this.mode);this.elem=$iTXT.Element.Events.apply(this.elem,this.events);this.elem=$iTXT.Element.Styling.apply(this.elem,this.styling);} return this.elem;};$iTXT.Element.Text.Link=function(d) {if(null!=d&&'undefined'!=typeof d) {this.text=d.text;this.src=d.src;this.target=d.target;} else {this.text='';this.src='';this.target='';} $iTXT.Element.Text.prototype.constructor.call(this);};$iTXT.Element.Text.Link.prototype=new $iTXT.Element.Text;$iTXT.Element.Text.Link.prototype.constructor=$iTXT.Element.Text.Link;$iTXT.Element.Text.Link.prototype.getSrc=function() {return this.src;};$iTXT.Element.Text.Link.prototype.setSrc=function(src) {this.src=src;};$iTXT.Element.Text.Link.prototype.getTarget=function() {return this.target;};$iTXT.Element.Text.Link.prototype.setTarget=function(target) {this.target=target;};$iTXT.Element.Text.Link.prototype.render=function() {if(null!=this.src&&'undefined'!=typeof this.src&&''!=this.src) {if(null==this.text||'undefined'==typeof this.text||''==this.text) {this.text=this.src;} this.elem=document.createElement('span');var node=document.createTextNode(this.text);this.elem.appendChild(node);} if(null!=this.elem) {this.elem=$iTXT.Element.convertElem(this.elem,this.mode);this.elem=$iTXT.Element.Events.apply(this.elem,this.events);this.elem=$iTXT.Element.Styling.apply(this.elem,this.styling);} return this.elem;};$iTXT.Element.Media=function(d) {$iTXT.Element.prototype.constructor.call(this);};$iTXT.Element.Media.prototype=new $iTXT.Element;$iTXT.Element.Media.prototype.constructor=$iTXT.Element.Media;$iTXT.Element.Media.prototype.getLink=function() {return this.link;};$iTXT.Element.Media.prototype.setLink=function(link) {if(link instanceof $iTXT.Element.Text.Link) {this.link=link;}};$iTXT.Element.Media.prototype.getSrc=function() {return this.src;};$iTXT.Element.Media.prototype.setSrc=function(src) {this.src=src;};$iTXT.Element.Media.prototype.getWidth=function() {return this.width;};$iTXT.Element.Media.prototype.setWidth=function(w) {this.width=w;};$iTXT.Element.Media.prototype.getHeight=function() {return this.height;};$iTXT.Element.Media.prototype.setHeight=function(h) {this.height=h;};$iTXT.Element.Media.Iframe=function(d) {if(null!=d&&'undefined'!=typeof d) {this.src=d.src||'';this.width=d.width||0;this.height=d.height||0;this.title=d.title||'';this.keyword=d.keyword||'';this.desc=d.desc||'';this.cta=d.cta||'';this.cts=d.cts||0;this.target=d.target||'';this.trackingImage=d.trackingImage||new Array('','','');this.adView=d.adView||'';this.adType=d.adType||-1;} else {this.src='';this.width=0;this.height=0;this.title='';this.keyword='';this.desc='';this.cta='';this.cts=0;this.target='';this.trackingImage=new Array('','','');this.adView='';this.adType=-1;} $iTXT.Element.Media.prototype.constructor.call(this);};$iTXT.Element.Media.Iframe.prototype=new $iTXT.Element.Media;$iTXT.Element.Media.Iframe.prototype.constructor=$iTXT.Element.Media.Iframe;$iTXT.Element.Media.Iframe.prototype.render=function() {if('undefined'!=typeof this.src&&''!=this.src&&this.src.match(/^<iframe/i)) {if('undefined'!=typeof $cons&&'undefined'!=typeof $cons.clicklogfdbk) {this.target=$iTXT.func.appendToURL(this.target,"demogen="+$cons.clicklogfdbk);} if('undefined'!=gTU) {this.src=this.src.replace(/_([A-Z_]+)_/g,'\${$1}');this.src=this.src.replace(/\$\{VM_CLICK\}/g,encodeURIComponent(gTU+'&redir='+encodeURIComponent(this.target))).replace(/_VM_UECLICK_/g,gTU+'&redir='+encodeURIComponent(this.target));this.src=this.src.replace(/\$\{VM_NRDCLICK\}/g,gTU+'&redir=');this.src=this.src.replace(/\$\{VM_ENRDCLICK\}/g,encodeURIComponent(gTU+'&redir='));this.src=this.src.replace(/\$\{KEYWORD\}/g,encodeURIComponent(this.keyword));this.src=this.src.replace(/\$\{TITLE\}/g,this.title.replace(/"/g,'&quot;').replace(/&/g,'%26'));this.src=this.src.replace(/\$\{DESCRIPTION\}/g,this.desc.replace(/"/g,'&quot;').replace(/&/g,'%26'));this.src=this.src.replace(/\$\{ENCODED_URL\}/g,encodeURIComponent(this.target));this.src=this.src.replace(/\$\{URL\}/g,this.target);this.src=this.src.replace(/\$\{CALL_TO_ACTION\}/g,encodeURIComponent(this.cta));this.src=this.src.replace(/\$\{CLICK_TO_SELF\}/g,encodeURIComponent(this.cts));this.src=this.src.replace(/\$\{TRACKING_IMAGE_2\}/g,encodeURIComponent(this.trackingImage[2]));this.src=this.src.replace(/\$\{TRACKING_IMAGE_1\}/g,encodeURIComponent(this.trackingImage[1]));this.src=this.src.replace(/\$\{TRACKING_IMAGE\}/g,encodeURIComponent(this.trackingImage[0]));this.src=this.src.replace(/\$\{ADVIEW\}/g,encodeURIComponent(this.adView));this.src=this.src.replace(/\$\{SERVER\}/g,encodeURIComponent(server));this.src=this.src.replace(/\$\{SEARCHTERMS\}/g,encodeURIComponent(gSEST));this.src=this.src.replace(/\$\{SEARCHENGINE\}/g,encodeURIComponent(gSEID));if(null!=$iTXT.tglb&&'undefined'!=typeof $iTXT.tglb&&'string'==typeof $iTXT.tglb.beaconFld&&null!=$iTXT.glob.beacons&&'string'==typeof $iTXT.glob.beacons['type'+this.adType]) {this.src=$iTXT.func.appendToEmbeddedURL(this.src,$iTXT.tglb.beaconFld+'='+encodeURIComponent($iTXT.glob.beacons['type'+this.adType]));} if(null!=$iTXT.tglb&&'undefined'!=typeof $iTXT.tglb&&'string'==typeof $iTXT.tglb.csParamsFld&&null!=$iTXT.glob.comScore&&$iTXT.func.isArray($iTXT.glob.comScore['type'+this.adType])) {var csParams=$iTXT.glob.comScore['type'+this.adType];dbM('<b style="color:blue;">New Render Mechanism:</b> Sending custom comScore params "'+csParams+'"',0);var paramStr='';for(var name in csParams) {if($iTXT.core.Util.isString(csParams[name])) {paramStr+=(''!=paramStr)?'&':'';paramStr+=name+'='+encodeURIComponent(csParams[name]);}} if(''!=paramStr) {this.src=$iTXT.func.appendToEmbeddedURL(this.src,$iTXT.tglb.csParamsFld+'='+encodeURIComponent(paramStr));}} if(null!=$iTXT.tglb&&'undefined'!=typeof $iTXT.tglb&&'string'==typeof $iTXT.tglb.moKwFld&&gMEKWT>0) {this.src=$iTXT.func.appendToEmbeddedURL(this.src,$iTXT.tglb.moKwFld+'='+gMEKWT);}} if(!this.src.match(/ id\=/)) {var uuid=$iTXT.func.genUUID();dbM('<b style="color:blue;">New Render Mechanism:</b> $iTXT.Element.Media.Iframe - assigning Iframe id '+uuid,0);this.src=this.src.replace(/^<iframe/i,'<iframe id="itxt-'+uuid+'"');} this.elem=document.createElement('div');this.elem.innerHTML=this.src;if(this.width>0) {elem.width=this.width;} if(this.height>0) {elem.width=this.height;}} if(null!=this.elem) {this.elem=$iTXT.Element.convertElem(this.elem,this.mode);this.elem=$iTXT.Element.Events.apply(this.elem,this.events);this.elem=$iTXT.Element.Styling.apply(this.elem,this.styling);} return this.elem;};$iTXT.Element.Media.Image=function(d) {if(null!=d&&'undefined'!=typeof d) {this.src=d.src;this.width=d.width;this.height=d.height;this.link=d.link;this.alt=d.alt;} else {this.src='';this.width=0;this.height=0;this.link=null;this.alt='';} $iTXT.Element.Media.prototype.constructor.call(this);};$iTXT.Element.Media.Image.prototype=new $iTXT.Element.Media;$iTXT.Element.Media.Image.prototype.constructor=$iTXT.Element.Media.Image;$iTXT.Element.Media.Image.prototype.getAlt=function() {return this.alt;};$iTXT.Element.Media.Image.prototype.setAlt=function(alt) {this.alt=alt;};$iTXT.Element.Media.Image.prototype.render=function() {if('undefined'!=typeof this.src&&''!=this.src&&this.src.match(/\.(gif|jpg|jpeg|png).?$/i)) {this.elem=document.createElement('img');this.elem.src=this.src;if(this.width>0) {this.elem.width=this.width;} if(this.height>0) {this.elem.height=this.height;} if('undefined'!==typeof this.alt&&''!=this.alt) {this.elem.alt=this.alt;}} if(null!=this.elem) {this.elem=$iTXT.Element.convertElem(this.elem,this.mode);this.elem=$iTXT.Element.Events.apply(this.elem,this.events);this.elem=$iTXT.Element.Styling.apply(this.elem,this.styling);} return this.elem;};$iTXT.Element.Media.Flash=function(d) {if(null!=d&&'undefined'!=typeof d) {this.src=d.src;this.width=d.width;this.height=d.height;this.link=d.link;this.expWidth=d.expWidth;this.expHeight=d.expHeight;this.alt=d.alt;this.version=d.ver;this.audio=d.audio;this.adType=d.adType;this.cts=d.cts||0;} else {this.src='';this.width=0;this.height=0;this.link=null;this.expWidth=0;this.expHeight=0;this.alt=null;this.version=6;this.audio=0;this.adType=null;this.cts=0;} $iTXT.Element.Media.prototype.constructor.call(this);};$iTXT.Element.Media.Flash.prototype=new $iTXT.Element.Media;$iTXT.Element.Media.Flash.prototype.constructor=$iTXT.Element.Media.Flash;$iTXT.Element.Media.Flash.prototype.getAlt=function() {return this.alt;};$iTXT.Element.Media.Flash.prototype.setAlt=function(alt) {if(alt instanceof $iTXT.Element.Media.Image) {this.alt=alt;}};$iTXT.Element.Media.Flash.prototype.getAudio=function() {return this.audio;};$iTXT.Element.Media.Flash.prototype.setAudio=function(audio) {if(!isNaN(audio)&&audio>=0&&audio<=1) {this.audio=audio;}};$iTXT.Element.Media.Flash.prototype.getExpWidth=function() {return this.width;};$iTXT.Element.Media.Flash.prototype.setExpWidth=function(w) {this.expWidth=w;};$iTXT.Element.Media.Flash.prototype.getExpHeight=function() {return this.expHeight;};$iTXT.Element.Media.Flash.prototype.setExpHeight=function(h) {this.expHeight=h;};$iTXT.Element.Media.Flash.prototype.getVersion=function() {return this.version;};$iTXT.Element.Media.Flash.prototype.setVersion=function(ver) {if(!isNaN(ver)&&ver>=6) {this.version=ver;}};$iTXT.Element.Media.Flash.prototype.render=function() {if('undefined'!=typeof this.src&&''!=this.src&&this.src.match(/^https?\:\/\/.*\/.*\.swf/i)) {this.elem=document.createElement('div');if(this.alt) {var d={src:this.alt,width:this.width,height:this.height};var aElem=new $iTXT.Element.Media.Image(d);aElem.setMode(this.mode);aElem.setEvents(this.events);if(null!=this.styling) {aElem.setStyling(new $iTXT.Element.Styling(null,this.styling.className));} aElem=aElem.render();this.events=null;if($iTXT.Element.MODE_STRING==this.mode) {this.elem.innerHTML=aElem;} else {this.elem.appendChild(aElem);}} if('undefined'!=typeof gMed) {gMed.fInit({adj:{w:0,h:0},au:this.audio,fv:this.version,url:this.src},{w1:this.width,w2:this.expWidth,h1:this.height,h2:this.expHeight},this.adType,this.cts);}} if(null!=this.elem) {this.elem=$iTXT.Element.convertElem(this.elem,this.mode);this.elem=$iTXT.Element.Events.apply(this.elem,this.events);this.elem=$iTXT.Element.Styling.apply(this.elem,this.styling);} return this.elem;};$iTXT.Element.Events={};$iTXT.Element.Events.apply=function(elem,events) {if('undefined'==typeof events||null==events) {return elem;} if('undefined'==typeof events.contextmenu) {events.contextmenu='return false;';} var mode=('string'==typeof elem)?$iTXT.Element.MODE_STRING:$iTXT.Element.MODE_ELEMENT;for(var eventName in events) {if($iTXT.Element.MODE_STRING==mode) {elem=$iTXT.func.addAttrToTag(elem,'on'+eventName,events[eventName]);} else {try {if(elem.attachEvent) {elem.attachEvent("on"+eventName,new Function(events[eventName]));} else {elem.addEventListener(eventName,new Function(events[eventName]),false);}} catch(x) {dbM('<b style="color:red;">$iTXT.Element.Events APPLICATION FAIL</b> '+x.message+' when trying to attach "'+events[eventName]+'" as the on'+eventName+' to element '+elem,1);}}} return elem;};$iTXT.Element.Styling=function(id,className,rules) {this.id=id;this.className=className;this.rules=rules;};$iTXT.Element.Styling.apply=function(elem,styling) {if(null==elem) {return elem;} if('undefined'==typeof styling) {styling={};} var mode=('string'==typeof elem)?$iTXT.Element.MODE_STRING:$iTXT.Element.MODE_ELEMENT;if($iTXT.Element.MODE_STRING==mode) {for(var prop in styling) {elem=$iTXT.func.addAttrToTag(elem,prop,styling[prop]);}} else {if(styling.id) {elem.id=styling.id;} if(styling.className) {if('undefined'!=typeof elem.className) {elem.className+=' '+styling.className;} else {elem.className=styling.className;}} if(styling.rules) {var rules=styling.rules.split(/;\s*/g);for(var i=0;i<rules.length;i++) {var rule=rules[i].split(/:\s*/g);try {elem.style[rule[0]]=rule[1];} catch(x) {dbM('<b style="color:red;">$iTXT.Element.Styling APPLICATION FAIL</b> '+x.message,1);}}}} return elem;};$iTXT.Element.MODE_ELEMENT=0;$iTXT.Element.MODE_STRING=1;$iTXT.Element.applyAttachments=function(data) {dbM('<b style="color:blue;">New Render Mechanism:</b> Applying attachments',0);if(null!=$iTXT.glob.atts&&'undefined'!=typeof $iTXT.glob.atts) {var atts=$iTXT.func.subst($iTXT.glob.atts,data,"'");for(var mem=0;mem<atts.length;mem++) {var thisMem=atts[mem];var elems=new Array();if('undefined'!=typeof thisMem.id) {var cand=document.getElementById(thisMem.id);if(null!=cand&&$iTXT.cnst.ELEMENT_NODE==cand.nodeType) {elems[elems.length]=cand;}} if('undefined'!=typeof thisMem.name) {var cands=document.getElementsByName(thisMem.name);if(null!=cands) {for(var cand in cands) {var thisCand=cands[cand];if('undefined'!=typeof thisCand&&$iTXT.cnst.ELEMENT_NODE==thisCand.nodeType) {elems[elems.length]=thisCand;}}}} if('undefined'!=typeof thisMem.className) {var className="",tagName="*";var specs=thisMem.className.split('.');if(null!=specs) {if(1==specs.length) {className=specs[0]} else {tagName=specs[0];className=specs[1];} var cands=document.getElementsByTagName(tagName);if(null!=cands) {for(var cand in cands) {var thisCand=cands[cand];if('undefined'!=typeof thisCand&&'undefined'!=typeof thisCand.className&&thisCand.className.indexOf(className)>-1&&$iTXT.cnst.ELEMENT_NODE==thisCand.nodeType) {elems[elems.length]=thisCand;}}}}} for(var elem=0;elem<elems.length;elem++) {var thisElem=elems[elem];if('undefined'!=typeof thisMem.styling) {thisElem=$iTXT.Element.Styling.apply(thisElem,thisMem.styling);} if('undefined'!=typeof thisMem.events) {thisElem=$iTXT.Element.Events.apply(thisElem,thisMem.events);}}}} else {dbM('<b style="color:red;">$iTXT.Element.applyAttachments APPLICATION FAIL</b> - no attachments found.',1);}};$iTXT.Element.convertElem=function(elem,mode) {if(null==elem||($iTXT.Element.MODE_ELEMENT!=mode&&$iTXT.Element.MODE_STRING!=mode)) {return($iTXT.Element.MODE_STRING==mode)?'':null;} var holder=document.createElement('div');if($iTXT.Element.MODE_STRING==mode&&'string'!=typeof elem) {holder.appendChild(elem);var HTML=holder.innerHTML;elem=HTML;} else if($iTXT.Element.MODE_ELEMENT==mode&&'string'==typeof elem) {holder.innerHTML=elem;elem=holder.firstChild;} holder=null;return elem;};$iTXT.Element.parseAd=function(a) {dbM('<b style="color:blue;">New Render Mechanism:</b> parsing ad.',0);var pAd={detailId:a.did,idHash:a.idh,adType:a.rat,title:a.t,desc:a.tt,logo:a.tl,keyword:a.k,cta:a.cta,cts:a.cts,trackingImage:a.trkimg,merchant:{text:a.a,src:a.c}};if(pAd.logo.match(/^https?\:\/\/.*\/.*\.swf/i)) {var lPts=pAd.logo.split('$$');pAd.flash={src:lPts[0],w:lPts[1],h:lPts[2],alt:lPts[3]};if('undefined'!=typeof lPts[4]) {pAd.flash.audio=lPts[4];} if('undefined'!=typeof a.FL&&'undefined'!=typeof a.FL.v) {pAd.flash.ver=a.FL.v;}} return pAd;}; ; 