var email_regexp=/^(mailto:)*[-_.+*&~a-zA-Z0-9]+@[-_.+*&~a-zA-Z0-9]+[^.]*(\.[a-zA-Z0-9]{2,4})*$/;var posts=new Array();var postIndex=0;Array.prototype.clear=function(){while(this.length>0){this.pop()}};function log(a){if(typeof(console)!="undefined"){console.log(a)}}function isMail(a){return a.match(email_regexp)}function showObject(b){for(var a in b){if(typeof(b[a])=="object"||b[a] instanceof Array){log(a+"= ");showObject(b[a])}else{log(a+"= "+b[a])}}}function isXO(){var a=window.navigator.userAgent;return(a.indexOf("olpc")>=0)}function darkBGSetup(){$("#darkBG").css({width:"100%",height:"100%",position:"fixed",top:0,left:0})}function showDarkBG(){$("#darkBG").show()}function hideDarkBG(){$("#darkBG").hide()}function loadPosts(b,a){$.post("/locuras/"+b,null,function(d){posts.clear();for(var c in d){posts.unshift({id:d[c].id,title:d[c].title,text:d[c].text})}postIndex=-1;if(typeof(a)=="function"){a()}},"json")}function getPost(a){return posts[a]}function getNextPost(){postIndex++;if(postIndex>=posts.length){postIndex=0}return getPost(postIndex)}function getPrevPost(){postIndex--;if(postIndex<0){postIndex=posts.length-1}return getPost(postIndex)}function getRandomCrazyHTML(a,b){if(b==undefined){b=null}$.get("/tools/crazypost/",b,function(c){if(typeof(a)=="function"){a(c)}},"html")}function getRandomVideoHTML(a,b){if(b==undefined){b=null}$.get("/tools/randomvideo/",b,function(c){if(typeof(a)=="function"){a(c)}},"html")}function getRandomAdHTML(a,b){if(b==undefined){b=null}$.get("/banner/view/",b,function(c){if(typeof(a)=="function"){a(c)}},"html")}function getRandomSuperXoHTML(a,b){if(b==undefined){b=null}$.get("/tools/randomsuperxo/",b,function(c){if(typeof(a)=="function"){a(c)}},"html")};
