function gup(B){B=B.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var A="[\\?&]"+B+"=([^&#]*)";var D=new RegExp(A);var C=D.exec(window.location.href);if(C==null){return""}else{return C[1]}}var sm_hash;try{var tid=gup("tagid"),turl=gup("tagurl"),d=document,b=d.body;if(tid!=""&&typeof (sm_hash)=="undefined"){var uturl=unescape(turl);if((uturl.indexOf("http://amconf.videoegg.com/")==0)||(uturl.indexOf("http://ads.saymedia.com/")==0)||(uturl.indexOf("http://core.videoegg.com/")==0)||(uturl.indexOf("http://core.saymedia.com/")==0)||(uturl.indexOf("http://stage.ads.saymedia.com/")==0)||(uturl.indexOf("http://www.vesqa.com/")==0)||(uturl.indexOf("http://vesqa.com/")==0)){d.write('<div id="ve_iframeBusterDiv"></div>');d.write("<script src='"+uturl+"'><\/script>")}else{if(console){console.log("Attempt to load ad tag from unapproved domain.")}var seed=new Date().getTime().toString(16),remaining=32-seed.length;for(var i=0;i<remaining;i++){seed+=Math.floor(Math.random()*16).toString(16)}var i=document.createElement("img"),s="http://beacon.videoegg.com/exception?ecode=xs&curtime="+new Date().getTime()+"&rid="+seed+"&tid="+tid+"&url="+escape(window.location);i.src=s}}else{var config={};var am;var hash=sm_hash||window.location.hash;if(hash!=null){var str=unescape(unescape(hash));str=str.substring(2);str=str.substring(0,str.length-2);str=str.replace(/['"]/g,"");var values=str.split(",");var l=values.length;for(var i=0;i<l;i++){var kvp=values[i].split(":");config[kvp[0]]=kvp.splice(1,kvp.length-1).join("");if(config[kvp[0]].substr(0,4)=="http"){config[kvp[0]]=config[kvp[0]].substr(0,4)+":"+config[kvp[0]].substr(4,config[kvp[0]].length)}}var EAP_VERSION=config.ev;document.write('<div id="ad" style="top:0;left:0;position:absolute;"></div>');document.write('<script type="text/javascript" src="http://core.videoegg.com/eap/'+EAP_VERSION+'/html/js/iframe_ad.js"><\/script>')}else{var msg=d.createElement("div");msg.innerHTML="Missing tagid and tagurl";b.insertBefore(msg,b.childNodes[0])}}}catch(e){};
