function readCookie(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length)}return null}function unixTime(){a=new Date();var d=Number(Date.UTC(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),0));return d/1000}function isLoggedIn(){var expires=readCookie('ae');if(null==expires){return false}if(parseInt(expires)<unixTime()){return false}return true}function onImgErrorSmall(source){source.src="/images/default_pic_112x93.gif";source.onerror="";return true}function onImgError150(source){source.src="/images/default_pic.gif";source.style.width="140px";source.style.height="105px";source.onerror="";return true}function nl2br(str,is_xhtml){breakTag='<br />';if(typeof is_xhtml!='undefined'&&!is_xhtml){breakTag='<br/>'}return(str+'').replace(/([^>]?)\n/g,'$1'+breakTag+'\n')}function urlencode(str){var histogram={},histogram_r={},code=0,tmp_arr=[];var ret=str.toString();var replacer=function(search,replace,str){var tmp_arr=[];tmp_arr=str.split(search);return tmp_arr.join(replace)};histogram['!']='%21';histogram['%20']='+';ret=encodeURIComponent(ret);for(search in histogram){replace=histogram[search];ret=replacer(search,replace,ret)}return ret.replace(/(\%([a-z0-9]{2}))/g,function(full,m1,m2){return"%"+m2.toUpperCase()});return ret}function stristr(haystack,needle,bool){var pos=0;haystack+='';pos=haystack.toLowerCase().indexOf((needle+'').toLowerCase());if(pos==-1){return false}else{if(bool){return haystack.substr(0,pos)}else{return haystack.slice(pos)}}}function explode(delimiter,string,limit){var emptyArray={0:''};if(arguments.length<2||typeof arguments[0]=='undefined'||typeof arguments[1]=='undefined'){return null}if(delimiter===''||delimiter===false||delimiter===null){return false}if(typeof delimiter=='function'||typeof delimiter=='object'||typeof string=='function'||typeof string=='object'){return emptyArray}if(delimiter===true){delimiter='1'}if(!limit){return string.toString().split(delimiter.toString())}else{var splitted=string.toString().split(delimiter.toString());var partA=splitted.splice(0,limit-1);var partB=splitted.join(delimiter.toString());partA.push(partB);return partA}}function urlencode(str){var histogram={},histogram_r={},code=0,tmp_arr=[];var ret=str.toString();var replacer=function(search,replace,str){var tmp_arr=[];tmp_arr=str.split(search);return tmp_arr.join(replace)};histogram['!']='%21';histogram['%20']='+';ret=encodeURIComponent(ret);for(search in histogram){replace=histogram[search];ret=replacer(search,replace,ret)}return ret.replace(/(\%([a-z0-9]{2}))/g,function(full,m1,m2){return"%"+m2.toUpperCase()});return ret}function carouselTimer(encodedcid,nextpage,type,topcat,sindex){$('#myleftcarousel').hide();$("#loading-left").show();$.ajax({url:'/left_scroller.php?r='+unixTime()+'&a=carousel&type='+type+'&cid='+encodedcid+'&topcat='+topcat+'&sindex='+sindex+'&page='+nextpage,cache:false,success:function(html){$("#carouselwrapper").html(html);$('#myleftcarousel').css("display","none");setTimeout("$('#myleftcarousel').fadeIn(300);",250);$("#loading-left").hide()}})}String.prototype.br2nl=function(){return this.replace(/<br\s*\/?>/mg,"\n")};var jQuery=$;