jQuery.fn.extend({everyTime:function(a,b,c,d){return this.each(function(){jQuery.timer.add(this,a,b,c,d)})},oneTime:function(a,b,c){return this.each(function(){jQuery.timer.add(this,a,b,c,1)})},stopTime:function(a,b){return this.each(function(){jQuery.timer.remove(this,a,b)})}});jQuery.extend({timer:{global:[],guid:1,dataKey:"jQuery.timer",regex:/^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/,powers:{ms:1,cs:10,ds:100,s:1000,das:10000,hs:100000,ks:1000000},timeParse:function(c){if(c==undefined||c==null){return null}var a=this.regex.exec(jQuery.trim(c.toString()));if(a[2]){var b=parseFloat(a[1]);var d=this.powers[a[2]]||1;return b*d}else{return c}},add:function(d,b,c,f,h){var a=0;if(jQuery.isFunction(c)){if(!h){h=f}f=c;c=b}b=jQuery.timer.timeParse(b);if(typeof b!="number"||isNaN(b)||b<0){return}if(typeof h!="number"||isNaN(h)||h<0){h=0}h=h||0;var g=jQuery.data(d,this.dataKey)||jQuery.data(d,this.dataKey,{});if(!g[c]){g[c]={}}f.timerID=f.timerID||this.guid++;var e=function(){if((++a>h&&h!==0)||f.call(d,a)===false){jQuery.timer.remove(d,c,f)}};e.timerID=f.timerID;if(!g[c][f.timerID]){g[c][f.timerID]=window.setInterval(e,b)}this.global.push(d)},remove:function(c,b,d){var e=jQuery.data(c,this.dataKey),a;if(e){if(!b){for(b in e){this.remove(c,b,d)}}else{if(e[b]){if(d){if(d.timerID){window.clearInterval(e[b][d.timerID]);delete e[b][d.timerID]}}else{for(var d in e[b]){window.clearInterval(e[b][d]);delete e[b][d]}}for(a in e[b]){break}if(!a){a=null;delete e[b]}}}for(a in e){break}if(!a){jQuery.removeData(c,this.dataKey)}}}}});jQuery(window).bind("unload",function(){jQuery.each(jQuery.timer.global,function(a,b){jQuery.timer.remove(b)})});function repo(a,c){var b=$(a).val();b=b.replace(/\n/g,"<br />").replace(/\n\n+/g,"<br /><br />");if(c=="#href"){$("#adtitle").attr("href","http://"+b)}else{$(c).text(b)}}function mono(b,a){$("#"+b).change(function(){repo(this,"#"+a)})}function mono2(b,a){repo("#"+b,"#"+a)}function rad_save(){var b={};b.h=$("#rad_title").attr("value");b.l=$("#rad_line").attr("value");b.d=$("#rad_display_url").attr("value");b.u=$("#rad_url").attr("value");b.e=$("#rad_email").attr("value");b.q=$("#rad_quantity").attr("value");var a=b.q||1;var c;if($("input[name=rad_type]:checked").val()=="text"){c=50;$("#paypal_name").attr("value","Ads By Faxo - "+a+" Text Ad Slot(s)");b.t="t"}else{c=250;$("#paypal_name").attr("value","Ads By Faxo - "+a+" Banner Ad Slot(s)");b.t="b"}$.cookie("rad",JSON.stringify(b),{path:"/",expires:1000});if(typeof(af_imp)!="undefined"&&af_imp>0){$("#rad_im").html("<b style=color:blue;>"+af_imp+" Million</b> <b>Ad Impressions Per Month, Current Effective CPM = </b><b style=color:blue;>$"+af_cpm+"</b>")}$("#rad_total").html(a+" x $"+c+" per month = $"+C(a*c)+".00 per month.<br><br>");$("#paypal_total").attr("value",a*c)}function rad_get(){var a=$.cookie("rad");if(a){var b=JSON.parse(a);if(b.h){$("#rad_title").val(b.h)}if(b.l){$("#rad_line").val(b.l)}if(b.d){$("#rad_display_url").val(b.d)}if(b.u){$("#rad_url").val(b.u)}if(b.e){$("#rad_email").val(b.e)}if(b.q){$("#rad_quantity").val(b.q)}}}function rad_upload(){$("#loading").show();var d=$("#file").attr("value");var e=d.lastIndexOf("\\");if(e<0){e=d.lastIndexOf("/")}var g=d.substring(e+1);var c=+new Date();var b="uploads/rad_ads."+c+"@"+(Math.floor(Math.random()*1000000))+".";var f=b+"${filename}";var a="";a+='<input type="hidden" name="key" id=uf value="'+f+'">';a+='<input type="hidden" name="AWSAccessKeyId" value="1QPAQK2YVHC52R5XSM02">';a+='<input type="hidden" name="acl" value="public-read">';a+='<input type="hidden" name="success_action_redirect" value="http://localhost/">';a+='<input type="hidden" name="policy" value="eyJleHBpcmF0aW9uIjogIjIwMTktMDEtMDFUMDA6MDA6MDBaIiwKICAiY29uZGl0aW9ucyI6IFsgCiAgICB7ImJ1Y2tldCI6ICJzLnV1bnUuY29tIn0sIAogICAgWyJzdGFydHMtd2l0aCIsICIka2V5IiwgInVwbG9hZHMvIl0sCiAgICB7ImFjbCI6ICJwdWJsaWMtcmVhZCJ9LAogICAgeyJzdWNjZXNzX2FjdGlvbl9yZWRpcmVjdCI6ICJodHRwOi8vbG9jYWxob3N0LyJ9LAogICAgWyJzdGFydHMtd2l0aCIsICIkQ29udGVudC1UeXBlIiwgIiJdLAogICAgWyJjb250ZW50LWxlbmd0aC1yYW5nZSIsIDAsIDEwNDg1NzZdCiAgXQp9Cg==">';a+='<input type="hidden" name="signature" value="3JLzyiB9rhuhM4JGn5f5X4K4W74=">';a+='<input type="hidden" name="Content-Type" value="image/jpeg">';$.ajaxFileUpload({url:"http://s.uunu.com/",secureuri:false,extra:a,fileElementId:"file",dataType:"html",beforeSend:function(){$("#loading").show()},complete:function(){$("#loading").hide();$("#rad_banner_preview").html('<img src="http://s.uunu.com/'+b+g+'" width=160>')},success:function(i,h){if(typeof(i.error)!="undefined"){if(i.error!=""){alert(i.error)}else{alert(i.msg)}}},error:function(i,h,j){alert(j)}});return false}$(function(){Z();$(".rad_text").show();$(".rad_banner").hide();$("input[name=rad_type]").change(function(){if($("input[name=rad_type]:checked").val()=="text"){$(".rad_text").show();$(".rad_banner").hide();$("#paypal_name").attr("value","Ads By Faxo - Text Ad")}else{$(".rad_text").hide();$(".rad_banner").show();$("#paypal_name").attr("value","Ads By Faxo - Banner Ad")}});rad_get();$("#ad_buy").click(function(){var a=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;if(!a.test($("#rad_email").val())){alert("Please enter a valid email address");return false}if($("#rad_terms:checked").val()==null){alert("Please Agree to the Terms");return false}rad_save();return true});rad_save();$(this).everyTime(2000,function(a){mono2("rad_title","adtitle");mono2("rad_line","ad_line");mono2("rad_display_url","adurl");mono2("rad_url","href");rad_save()},0)});function post_form(d,c){var b=g_rl;recap("rcd");$("#rcw").show();if(!b){return false}$("#wait").show();var a={};$("#"+d+" :input").each(function(f){var e=$(this);a[e.attr("name")]=e.attr("value")});$("input+span").html("");if(g_c){a.g_c=JSON.stringify(g_c)}$.ajax({type:"POST",url:document.path,data:a,dataType:"json",success:function(e){if(e.e){$.each(e.e,function(g,f){$("#"+g+"+span").html('<br><span style="color:red;">'+f+"</span>")});flash_now("There were errors in your input.");$("#wait").hide();return}flash();$("#theme_url+span").html("");$("#"+d+' :input[name^=""]').attr("value","");$("#wait").hide();$("#rcw").hide();if(c){c()}Recaptcha.reload()},error:function(g,f,e){alert(g.responseText)}});return false}jQuery.extend({createUploadIframe:function(d,b){var a="jUploadFrame"+d;if(window.ActiveXObject){var c=document.createElement('<iframe id="'+a+'" name="'+a+'" />');if(typeof b=="boolean"){c.src="javascript:false"}else{if(typeof b=="string"){c.src=b}}}else{var c=document.createElement("iframe");c.id=a;c.name=a}c.style.position="absolute";c.style.top="-1000px";c.style.left="-1000px";document.body.appendChild(c);return c},createUploadForm:function(h,c,a){var f="jUploadForm"+h;var b="jUploadFile"+h;var e=jQuery('<form  action="" method="POST" name="'+f+'" id="'+f+'" enctype="multipart/form-data">'+a+"</form>");var d=jQuery("#"+c);var g=jQuery(d).clone();jQuery(d).attr("id",b);jQuery(d).before(g);jQuery(d).appendTo(e);jQuery(e).css("position","absolute");jQuery(e).css("top","-1200px");jQuery(e).css("left","-1200px");jQuery(e).appendTo("body");return e},ajaxFileUpload:function(k){k=jQuery.extend({},jQuery.ajaxSettings,k);var a=new Date().getTime();var b=jQuery.createUploadForm(a,k.fileElementId,k.extra);var i=jQuery.createUploadIframe(a,k.secureuri);var h="jUploadFrame"+a;var j="jUploadForm"+a;if(k.global&&!jQuery.active++){jQuery.event.trigger("ajaxStart")}var c=false;var f={};if(k.global){jQuery.event.trigger("ajaxSend",[f,k])}var d=function(l){var p=document.getElementById(h);try{if(p.contentWindow){f.responseText=p.contentWindow.document.body?p.contentWindow.document.body.innerHTML:null;f.responseXML=p.contentWindow.document.XMLDocument?p.contentWindow.document.XMLDocument:p.contentWindow.document}else{if(p.contentDocument){f.responseText=p.contentDocument.document.body?p.contentDocument.document.body.innerHTML:null;f.responseXML=p.contentDocument.document.XMLDocument?p.contentDocument.document.XMLDocument:p.contentDocument.document}}}catch(o){}if(f||l=="timeout"){c=true;var m;try{m=l!="timeout"?"success":"error";if(m!="error"){var n=jQuery.uploadHttpData(f,k.dataType);if(k.success){k.success(n,m)}if(k.global){jQuery.event.trigger("ajaxSuccess",[f,k])}}else{jQuery.handleError(k,f,m)}}catch(o){m="error";jQuery.handleError(k,f,m,o)}if(k.global){jQuery.event.trigger("ajaxComplete",[f,k])}if(k.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop")}if(k.complete){k.complete(f,m)}jQuery(p).unbind();setTimeout(function(){try{jQuery(p).remove();jQuery(b).remove();jQuery("#"+k.fileElementId).val("")}catch(q){jQuery.handleError(k,f,null,q)}},100);f=null}};if(k.timeout>0){setTimeout(function(){if(!c){d("timeout")}},k.timeout)}try{var b=jQuery("#"+j);jQuery(b).attr("action",k.url);jQuery(b).attr("method","POST");jQuery(b).attr("target",h);if(b.encoding){b.encoding="multipart/form-data"}else{b.enctype="multipart/form-data"}jQuery(b).submit()}catch(g){jQuery.handleError(k,f,null,g)}if(window.attachEvent){document.getElementById(h).attachEvent("onload",d)}else{document.getElementById(h).addEventListener("load",d,false)}return{abort:function(){}}},uploadHttpData:function(r,type){try{var data=!type;data=type=="xml"||data?r.responseXML:r.responseText;if(type=="script"){jQuery.globalEval(data)}if(type=="json"){eval("data = "+data)}if(type=="html"){jQuery("<div>").html(data).evalScripts()}return data}catch(e){}return""}});