$(document).ready(function(){if((window.bannerFormat!=null&&window.data!=null)||banner){var advSpace=new showCase(window.bannerFormat,window.data);advSpace.run()}});showBanner=function(){doClick()};var i=0;doClick=function(){var ab=arrBanner[bannerFormat];if(i>ab.length-1){return defaultBanner()}$("#adv_"+bannerFormat).html('<a href="'+ab[i].url+'"  ><img id="bannadv" align="bottom" width="728" hspace="1" height="90" src="'+ab[i].img+'" border="0"/></a>');$("#placeHolder").attr("src",ab[i].url);i++;setTimeout(doClick,cycle_time)};defaultBanner=function(){var ab=defaultarrBanner[bannerFormat];$("#adv_"+bannerFormat).html('<a href="'+ab[0].url+'"  ><img id="bannadv" align="bottom" width="728" hspace="1" height="90" src="'+ab[0].img+'" border="0"/></a>');$("#placeHolder").attr("src","")};Array.prototype.random=function(fn){var l=this.length;if(l==0)throw"The array cannot be empty";if(!fn)return this[Math.floor(Math.random()*l-1)];var rnd;do{rnd=Math.floor(l*(Math.random()%1))}while(Math.random()>fn(this[rnd])){return this[rnd]}throw"Unexpected error";};String.prototype.format=function(){var txt=this;for(var i=0;i<arguments.length;i++){var exp=new RegExp('\\{'+(i)+'\\}','gm');txt=txt.replace(exp,arguments[i])}return txt};var ennunci=function(){};function showCase(format,data){if(!format)throw"format cannot be empty";this.format=format;this.data=data};showCase.prototype.prob=function(item){return item.prob};showCase.prototype.checkCookie=function(){var cookies=document.cookie.split("; ");for(var i=0;i<cookies.length;i++){var cookie=cookies[i].split("=");if(nameCookie==cookie[0]){return true}}var date=new Date();date.setTime(date.getTime()+(days_of_cookie*24*60*60*1000));var expires="expires="+date.toGMTString();document.cookie=nameCookie+"=1; "+expires+"; path=/";return false};showCase.prototype.run=function(){if(!this.checkCookie()){return showBanner()}else if(banner){return defaultBanner()}this.campaign=Campaign.random(this.prob);if(typeof this.campaign.src!="function")throw"Campaign source not recognized";return this.campaign.src.apply(this,new Array(this.data,this.format,this.campaign["campaignid"]))};