window.onload=function(){Fat.fade_all();};if(!Array.indexOf){Array.prototype.indexOf=function(b){for(var a=0;a<this.length;a++){if(this[a]==b){return a;}}return -1;};}function getStyle(a){if(a.currentStyle){return a.currentStyle.backgroundColor;}if(document.defaultView){return document.defaultView.getComputedStyle(a,"").getPropertyValue("background-color");}return null;}var is_chrome=navigator.userAgent.toLowerCase().indexOf("chrome")>-1;if(is_chrome){var cssNode=document.createElement("link");cssNode.type="text/css";cssNode.rel="stylesheet";cssNode.href="/css/chrome.css";cssNode.media="screen";cssNode.title="dynamicLoadedSheet";document.getElementsByTagName("head")[0].appendChild(cssNode);}function changeClient(a,e){var c=a.split(",");var d=c[0];var b=c[1];location.replace("/admin/changeClient.aspx?ID="+d+"&name="+e+"&al="+b);}function clientSwitcher(a){$("#clientName").toggle();$("#clientDropDown").toggle();loadChangeClient(a);return false;}function loadChangeClient(a){$.ajax({url:"/pageElements/clientDropDown.aspx?clientName="+a,type:"GET",success:function(b){$("#clientDropDown").replaceWith(b);}});}function hidePaymentDetails(){$("#ccForm").hide();$("#ccDetails").show();$("#saveButton").hide();$("#updateButton").show();}function updatePaymentDetails(){$("#ccDetails").hide();$("#ccForm").show();$("#updateButton").hide();$("#saveButton").show();}function submitForm(a){return $(a).submit();}function checkSendingCampaigns(){var a=true;for(i=0;i<sendingCampaigns.length;i++){if(sendingCampaigns[i]!=""){checkSendingCampaign(sendingCampaigns[i],i,false);a=false;}}for(abi=0;abi<sendingABCampaigns.length;abi++){if(sendingABCampaigns[abi]!=""){checkSendingCampaign(sendingABCampaigns[abi],abi,true);a=false;}}if(!a){setTimeout("checkSendingCampaigns()",5000);}}function checkSendingCampaign(e,b,c){var d;var a="";if(c){d="absending"+b;a="&ab=true";}else{d="sending"+b;}$("#"+d).load("/reports/pageElements/checkSendingCampaign.aspx?ID="+e+"&n="+b+"&overview=true"+a,null,function(f){checkLoadSentCampaign(f,e,b,c);});}function checkLoadSentCampaign(b,d,a,c){if(b.indexOf("deliverPercent")<0){if(c){sendingABCampaigns[a]="";}else{sendingCampaigns[a]="";}}}function checkUnschedule(b){var a="Are you sure you want to move this campaign back to drafts?";if(confirm(a)){location.replace("default.aspx?cID="+b+"&action=unschedule");}return false;}function hideDelete(a){$("#"+a+"_delete").hide();}function hideit(a){$("#"+a).hide();}function showit(a){$("#"+a).show();}function showDelete(a){$("#"+a+"_delete").show();}var newwindow;function launchHelp(a){newwindow=window.open("/help/popup.aspx?t="+a,"name","height=600,width=800,resizable=yes,scrollbars=yes");if(window.focus){newwindow.focus();}return false;}function launchPreview(a){newwindow=window.open(a,"preview","height=500,width=700,resizable=yes,scrollbars=yes");if(window.focus){newwindow.focus();}return false;}function launchPreviewB(a){newwindow=window.open(a,"previewB","height=500,width=700,resizable=yes,scrollbars=yes");if(window.focus){newwindow.focus();}return false;}function clearSearchBox(a){if(a=="Summarize your question/problem in one sentence"){$("#search").val("");}}function showSearchText(a){if(a==""){$("#search").val("Summarize your question/problem in one sentence");}}function ajax(d,c,b,a,h,f,g){if(!g){g="html";}if(h){var e=$("#"+h).serialize();}else{var e="";}$.ajax({url:d,type:c,data:e,dataType:g,beforeSend:function(){if(f){f();}},success:function(j){if(b){$("#"+b).html(j);}if(a){a(j);}}});}var Fat={make_hex:function(e,d,f){e=e.toString(16);if(e.length==1){e="0"+e;}d=d.toString(16);if(d.length==1){d="0"+d;}f=f.toString(16);if(f.length==1){f="0"+f;}return"#"+e+d+f;},fade_all:function(){for(var f=document.getElementsByTagName("*"),e=0;e<f.length;e++){var g=f[e],h=/fade-?(\w{3,6})?/.exec(g.className);if(h){h[1]||(h[1]="");g.id&&Fat.fade_element(g.id,null,null,"#"+h[1]);}}},fade_element:function(x,w,y,z,A){w||(w=30);y||(y=800);if(!z||z=="#"){z="#ffff33";}A||(A=this.get_bgcolor(x));w=Math.round(w*(y/1000));var D=y=y/w,B=0;if(z.length<7){z+=z.substr(1,3);}if(A.length<7){A+=A.substr(1,3);}var r=parseInt(z.substr(1,2),16),s=parseInt(z.substr(3,2),16);z=parseInt(z.substr(5,2),16);for(var t=parseInt(A.substr(1,2),16),u=parseInt(A.substr(3,2),16),v=parseInt(A.substr(5,2),16),C,p,q;B<w;){C=Math.floor(r*((w-B)/w)+t*(B/w));p=Math.floor(s*((w-B)/w)+u*(B/w));q=Math.floor(z*((w-B)/w)+v*(B/w));C=this.make_hex(C,p,q);setTimeout("Fat.set_bgcolor('"+x+"','"+C+"')",D);B++;D=y*B;}setTimeout("Fat.set_bgcolor('"+x+"','"+A+"')",D);},set_bgcolor:function(d,c){document.getElementById(d).style.backgroundColor=c;},get_bgcolor:function(e){for(e=document.getElementById(e);e;){var d,f=getStyle(e);if(f!=null&&!f.match(/rgba\s*\(0\s*,\s*0\s*,\s*0\s*,\s*0\)/)){d=f;}if(e.currentStyle){d=e.currentStyle.backgroundColor;}if(d!=""&&d!="transparent"&&d!==undefined||e.tagName=="BODY"){break;}e=e.parentNode;}if(d==undefined||d==""||d=="transparent"){d="#FFFFFF";}if(e=d.match(/rgb\s*\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/)){d=this.make_hex(parseInt(e[1]),parseInt(e[2]),parseInt(e[3]));}else{if(e=d.match(/rgba\s*\((\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\)/)){d=this.make_hex(parseInt(e[1]),parseInt(e[2]),parseInt(e[3]));}}return d;}};if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(m,b,n,o,f,g,d,e,k,l){if(!document.getElementById){return;}this.DETECT_KEY=l?l:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(m){this.setAttribute("swf",m);}if(b){this.setAttribute("id",b);}if(n){this.setAttribute("width",n);}if(o){this.setAttribute("height",o);}if(f){this.setAttribute("version",new deconcept.PlayerVersion(f.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(g){this.addParam("bgcolor",g);}var j=d?d:"high";this.addParam("quality",j);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var a=(e)?e:window.location;this.setAttribute("xiRedirectUrl",a);this.setAttribute("redirectUrl","");if(k){this.setAttribute("redirectUrl",k);}};deconcept.SWFObject.prototype={useExpressInstall:function(a){this.xiSWFPath=!a?"expressinstall.swf":a;this.setAttribute("useExpressInstall",true);},setAttribute:function(b,a){this.attributes[b]=a;},getAttribute:function(a){return this.attributes[a];},addParam:function(a,b){this.params[a]=b;},getParams:function(){return this.params;},addVariable:function(a,b){this.variables[a]=b;},getVariable:function(a){return this.variables[a];},getVariables:function(){return this.variables;},getVariablePairs:function(){var a=new Array();var b;var c=this.getVariables();for(b in c){a[a.length]=b+"="+c[b];}return a;},getSWFHTML:function(){var f="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}f='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'"';f+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';var e=this.getParams();for(var a in e){f+=[a]+'="'+e[a]+'" ';}var b=this.getVariablePairs().join("&");if(b.length>0){f+='flashvars="'+b+'"';}f+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}f='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'">';f+='<param name="movie" value="'+this.getAttribute("swf")+'" />';var c=this.getParams();for(var a in c){f+='<param name="'+a+'" value="'+c[a]+'" />';}var d=this.getVariablePairs().join("&");if(d.length>0){f+='<param name="flashvars" value="'+d+'" />';}f+="</object>";}return f;},write:function(b){if(this.getAttribute("useExpressInstall")){var c=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(c)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",encodeURIComponent(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var a=(typeof b=="string")?document.getElementById(b):b;a.innerHTML=this.getSWFHTML();if(!(navigator.plugins&&navigator.mimeTypes.length)){window[this.getAttribute("id")]=document.getElementById(this.getAttribute("id"));}return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var b=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var d=navigator.plugins["Shockwave Flash"];if(d&&d.description){b=new deconcept.PlayerVersion(d.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var f=1;var a=3;while(f){try{a++;f=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+a);b=new deconcept.PlayerVersion([a,0,0]);}catch(c){f=null;}}}else{try{var f=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(c){try{var f=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");b=new deconcept.PlayerVersion([6,0,21]);f.AllowScriptAccess="always";}catch(c){if(b.major==6){return b;}}try{f=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(c){}}if(f!=null){b=new deconcept.PlayerVersion(f.GetVariable("$version").split(" ")[1].split(","));}}}return b;};deconcept.PlayerVersion=function(a){this.major=a[0]!=null?parseInt(a[0]):0;this.minor=a[1]!=null?parseInt(a[1]):0;this.rev=a[2]!=null?parseInt(a[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(a){if(this.major<a.major){return false;}if(this.major>a.major){return true;}if(this.minor<a.minor){return false;}if(this.minor>a.minor){return true;}if(this.rev<a.rev){return false;}return true;};deconcept.util={getRequestParameter:function(c){var d=document.location.search||document.location.hash;if(c==null){return d;}if(d){var a=d.substring(1).split("&");for(var b=0;b<a.length;b++){if(a[b].substring(0,a[b].indexOf("="))==c){return a[b].substring((a[b].indexOf("=")+1));}}}return"";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var c=document.getElementsByTagName("OBJECT");for(var b=c.length-1;b>=0;b--){c[b].style.display="none";for(var a in c[b]){if(typeof c[b][a]=="function"){c[b][a]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(a){return document.all[a];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;var lastJson=null;hideMessages=function(a){if(lastJson===null){return;}function b(e,g){jQuery(e.elementID).hide();if(g){for(var f in g){if(g[f]&&typeof(g[f])==="string"){var d=jQuery("#"+g[f]);var h=d.attr(e.classAttr)===""?e.defaultClass:d.attr("errorClass");d.removeClass(h);}}}}function c(d,e){if(e){a.hide(d,e.Fields);}}var a=jQuery.extend(true,{hide:b,errorSetup:{elementID:"#errorDiv",classAttr:"errorClass",defaultClass:"clearfixError"},successSetup:{elementID:"#successDiv"}},a);lastJson.each(function(){c(a.errorSetup,this.Errors);c(a.successSetup,this.SuccessMessages);});lastJson=null;};jQuery.fn.parseJson=function(a){var c=function(e){window.location.replace(e);};var b=function(e,f){if(f&&f!==null&&f.Messages.length>0){e.renderer(f.Messages,f.Fields);}};var d=function(k,g){var f='<div id="'+this.titleID+'" '+this.titleAttrs+">\n<h3>"+this.title+"</h3>\n</div>\n";f+='<div class="'+this.messagesID+'">\n<ol>\n';for(var h in k){if(k[h]&&typeof(k[h])==="string"){f+="<li>"+k[h]+"</li>";}}f+="</ol>\n</div>";jQuery(this.elementID).html(f);jQuery(this.elementID).show();for(var h in g){if(g[h]&&typeof(g[h])==="string"){var e=jQuery("#"+g[h]);var j=e.attr(this.classAttr)===undefined?this.defaultClass:e.attr("errorClass");e.addClass(j);}}};var a=jQuery.extend(true,{onSuccess:function(){},onError:function(){},onRedirect:c,errorSetup:{elementID:"#errorDiv",titleID:"failure",titleAttrs:'class="fade-f8acac"',messagesID:"failureMessage",title:"Sorry, we couldn't import your campaign because...",classAttr:"errorClass",defaultClass:"clearfixError",renderer:d}},a);this.each(function(){b(a.errorSetup,this.Errors);b(a.warningSetup,this.Warnings);b(a.successSetup,this.SuccessMessages);switch(this.Status){case"Error":a.onError(this);break;case"Success":a.onSuccess(this);break;case"Redirect":a.onRedirect(this.RedirectUrl.replace(/&amp;/g,"&"));break;}});lastJson=this;};jQuery.fn.ajaxUpload=function(settings){var settings=jQuery.extend({loading:function(){},onComplete:function(){},onStart:function(){},type:"json"},settings);var _this=this;return this.each(function(){jQuery(this).submit(function(){settings.onStart(this);var iframeId="upload_"+Math.round(Math.random()*1000000);var iframe=jQuery('<iframe style="display:none" name="'+iframeId+'" id="'+iframeId+'"></iframe>');jQuery(document.body).append(iframe);jQuery(this).attr("target",iframeId);settings.loading();$("#"+iframeId).load(function(){var html=jQuery(this).contents().find("body").html();switch(settings.type){case"json":var data;try{data=eval("("+html+")");}catch(e){data={Status:"Error",Errors:{Messages:["You must upload valid files, the value you have entered is not valid"]}};}settings.onComplete(data);break;}setTimeout(function(){jQuery("#"+iframeId).remove();},200);});});});};