
var currentBtn='buttonNewest';var browser=browserType();var ageconfirm=false;var addthis_delay=500;if(browser=='ie'){var winsize=973;var minsize=1258;}
else{var winsize=992;var minsize=1272;}
var skyscrapers=0;var kt=false;var vc=false;var lastajax=new Array(false,false);window.onresize=resize;window.onbeforeunload=terminate;function ajaxObject(url,callbackFunction,output,append,reposition,evaldiv){var that=this;this.updating=false;this.abort=function(){if(that.updating){that.updating=false;that.AJAX.abort();that.AJAX=null;}}
this.update=function(passData,postMethod){if(that.updating)return false;that.AJAX=null;if(window.XMLHttpRequest)
that.AJAX=new XMLHttpRequest();else if(window.ActiveXObject){try{that.AJAX=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){try{that.AJAX=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e){that.AJAX=null;}}}
if(that.AJAX===null){alert('we are very sorry but your browser is not supported our website');return false;}
else{that.AJAX.onreadystatechange=function(){if(that.AJAX.readyState==4){that.updating=false;if(output!==false)
that.callback(that.AJAX.responseText,that.AJAX.status,output,append,reposition,evaldiv);that.AJAX=null;}}
that.updating=new Date();if(postMethod=='POST'){that.AJAX.open("POST",urlCall,true);that.AJAX.setRequestHeader("Content-Type","application/x-www-form-urlencoded");that.AJAX.send(passData);}
else{that.AJAX.open("GET",urlCall+'?'+passData+'&timestamp='+(that.updating.getTime()),true);that.AJAX.send(null);}
return true;}}
var urlCall=url;this.callback=callbackFunction||function(){};}
function ajaxRead(url,params,method,output,append,reposition,evaldiv){var myRequest=new ajaxObject(url,handleAjaxResponse,output,append,reposition,evaldiv);lastajax[0]=url;if(params!==''){params=params+(readCookie('PHPSESSID')===null?'&sid='+sessionid:'');lastajax[1]=params;}
else{params=(readCookie('PHPSESSID')===null?'&sid='+sessionid:'');lastajax[1]=false;}
if(method=='post')
myRequest.update(params,'POST');else if(method=='get')
myRequest.update(params,'GET');}
function handleAjaxResponse(response,status,output,append,reposition,evaldiv){if(status==200&&response!==''){document.getElementById(output).innerHTML=(append===true?document.getElementById(output).innerHTML:'')+response;if(reposition===true)positionSkyscrapers();}
if(evaldiv!==false)execute(evaldiv+'_eval');}
function execute(obj){var current=document.getElementById(obj);if(current!==null){eval(current.innerHTML);current.innerHTML='';}}
function makeSpinner(spinnertype,elements,status){var pieces=elements.split("|");for(var i in pieces){var spinner=document.getElementById(pieces[i]);if(spinner===null)
continue;if(status=='on'){spinner.style.display='block';spinner.innerHTML='<img src="/images/wait'+spinnertype+'.gif">';}
else if(status=='off'){spinner.style.display='none';spinner.innerHTML='';}}}
function resize(){windowSize();positionSkyscrapers();}
function initAnalytics(id,input){try{pageTracker=_gat._getTracker(id);if(input===false)
pageTracker._trackPageview();else
pageTracker._trackPageview('/'+input);}
catch(err){}}
function trackPageview(url){if(window.pageTracker!==undefined)
pageTracker._trackPageview('/'+url);}
function ei(text){if(document.layers)
document.captureEvents(Event.MOUSEMOVE);if(document.layers||document.all)
document.onmousemove=getXY;if(document.addEventListener)
document.addEventListener('mousemove',getXY,true);var infofloat=document.getElementById('infoFloat');infofloat.innerHTML=text;infofloat.style.display='block';}
function vi(title,content,rating){var code='<div id="previewThumb"><img src="'+content+'" alt="" style="width:190px;height:142px"/></div>';if(rating!==false){code=code+'<div id="previewStars">';for(i=1;i<=5;i++){code=code+'<img src="/images/pstar_'+(i<=rating?'full':'empty')+'.gif"/>';}
code=code+'</div>';}
code=code+'<p'+(rating===false?' style="padding-top:3px"':'')+'>'+title+'</p>';ei(code)}
function di(){if(document.layers)
document.releaseEvents(Event.MOUSEMOVE);if(document.layers||document.all)
document.onmousemove=null;if(document.addEventListener)
document.removeEventListener('mousemove',getXY,true);var infofloat=document.getElementById('infoFloat');infofloat.style.display='none';infofloat.style.top='-300px';}
function getXY(e){if(!e)
var e=window.event;if(e.pageX||e.pageY){var x=e.pageX;var y=e.pageY;}
else{var x=event.clientX+(document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft);var y=event.clientY+(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop);}
var infofloat=document.getElementById('infoFloat');if(infofloat!==null){infofloat.style.top=(y+25)+'px';if((size[0]-x)>240)
infofloat.style.left=(x+5)+'px';else
infofloat.style.left=(x-200)+'px';}}
function urlencode(s){return encodeURIComponent(s).replace(/~/g,'%7E').replace(/%20/g,'+');}
function countDown(output,time,action){if(time==0)
eval(action);else{document.getElementById(output).innerHTML=time;setTimeout('countDown("'+output+'",('+(time-1)+'),"'+action+'");',1000);}}
function bookmark(title,url){if(document.all)
window.external.AddFavorite(url,title);else if(window.sidebar)
window.sidebar.addPanel(title,url,'')
else
alert('please press ctrl-d to add to your bookmarks.');}
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 createCookie(name,value,days){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString();}
else var expires="";document.cookie=name+"="+value+expires+"; path=/";}
function browserType(){if(navigator.userAgent.indexOf('Chrome')!=-1)
return'chrome';else if(navigator.userAgent.indexOf('Safari')!=-1)
return'safari';else if(navigator.appName=="Netscape")
return'netscape';else if(navigator.appName.indexOf("Microsoft")!=-1)
return'ie';else if(navigator.userAgent.indexOf("opera")==-1)
return'opera';else
return false;}
function objValue(obj){object=document.getElementById(obj);if(object!==null)
return object.value;else
return false;}
function objDisable(obj,state){object=document.getElementById(obj);if(object!==null)
object.disabled=state;}
function checkEnter(e,onenter){if(!e)
var e=window.event;if(e.keyCode==13)
eval(onenter);}
function handleScroll(state){var standardbody=(document.compatMode=="CSS1Compat")?document.documentElement:document.body;standardbody.style.overflow=state;}
function handleOpacity(object,opacity){var obj=document.getElementById(object);if(opacity==0){obj.style.display='none';return;}
else{obj.style.display='block';obj.style.opacity=opacity;obj.style.filter='alpha(opacity='+opacity*100+')';}}
function windowSize(){if(browser=='ie'){var standardbody=(document.documentElement?document.documentElement:document.body);size=[standardbody.offsetWidth,standardbody.offsetHeight];}
else
size=[window.innerWidth,window.innerHeight];}
function centerDiv(object,width,height){var obj=document.getElementById(object);obj.style.left=((size[0]/2)-(width/2))+'px';obj.style.top=((size[1]/2)-(height/2))+'px';}
function confirmAge(){createCookie('agecheck','1',365);handleOpacity('agewarning',0);if(document.getElementById('notAvailable')==null&&rewrite!=''){if(browser=='ie'||browser=='chrome'){var player=document.getElementById('player');if(player!==null)
setTimeout("player.sendEvent('PLAY','true');",500);else
ageconfirm=true;}
else if(browser=='netscape')
ageconfirm=true;}
handleOpacity('blackout',0);handleScroll('auto');scroll(0,1);scroll(0,0);}
function pl(videoid){hideAddthis();if(document.getElementById('videoAdvert')!==null)
videoAdvertStatus('hide');if(document.getElementById('videoplayer_favoritelink'))
document.getElementById('videoplayer_favoritelink').innerHTML='';if(document.getElementById('playerBox').innerHTML=='')
document.getElementById('playerBox').innerHTML='<div class="videoLoading"><table cellpadding="0" cellspacing="0" align="center"><tr><td><img src="/images/wait3.gif" alt=""/></td><td>your video is being loaded, please wait...</td></tr></table></div>';else
makeSpinner(2,'videoplayer_spinner','on');handleKeepalive(kt);ajaxRead('/videoPlayer.php','videoid='+videoid+'&autoplay=true','post','playerBox',false,true,'videoplayer');}
function hideVideo(){hideAddthis();document.getElementById('playerBox').innerHTML='';positionSkyscrapers();}
function updateVideoList(location,srch,perpage,page,screenshots,length,plugs,logsearch){if(srch!==false){var searchstrng=document.getElementById('searchstring');if(page==1)
page=false;if(searchstrng.value!=srch&&!srch.match(/CAT\|\|\|.*?/)&&!srch.match(/AUTOPLAY\|\|\|.*?/)&&!srch.match(/MATCH\|\|\|.*?/)){searchstrng.style.textAlign='left';searchstrng.value=srch;}}
var totalresults0=document.getElementById('totalResults0');var totalresults1=document.getElementById('totalResults1')
if(totalresults0!==null)
totalresults0.style.display='none';if(totalresults1!==null)
totalresults1.style.display='none';makeSpinner(1,'videolist_spinner0|videolist_spinner1','on');var i=0;var parts=new Array();if(srch!==false){parts[i]='search='+urlencode(srch);i++;}
if(perpage!==false){parts[i]='perpage='+perpage;i++;}
if(page!==false){parts[i]='page='+page;i++;}
if(screenshots!==false){parts[i]='screenshots='+screenshots;i++;}
if(length!==false){parts[i]='length='+length;i++;}
if(plugs!==false){parts[i]='plugs='+plugs;i++;}
if(parts.length!=0)
var final=parts.join('&');else
var final='';if(location!==false){var other=(location=='0'?'1':'0');try{document.getElementById('perpage'+other).selectedIndex=document.getElementById('perpage'+location).selectedIndex;document.getElementById('screenshots'+other).selectedIndex=document.getElementById('screenshots'+location).selectedIndex;document.getElementById('length'+other).selectedIndex=document.getElementById('length'+location).selectedIndex;document.getElementById('plugs'+other).selectedIndex=document.getElementById('plugs'+location).selectedIndex;}
catch(e){}}
handleKeepalive(kt);ajaxRead('/videoList.php',final,'post','videoList',false,true,'videolist');}
function positionVideolist(){if(document.getElementById('playerBox').innerHTML!='')
window.scroll(0,(document.getElementById('videoList').offsetTop-100));}
function initiateSearch(obj){if(obj.value!='search here')
return;obj.value='';obj.style.textAlign='left';}
function validateSearch(query){if(query.length<3||query.replace(' ','').length<3||query=='search here')
return'sorry, your search must be at least 3 characters long.';return false;}
function searchVideo(){var query=objValue('searchstring');var result=validateSearch(query);if(result!==false){alert(result);return;}
if(currentBtn!==null)
currentBtn.className='';objDisable('searchbutton',true);objDisable('luckybutton',true);updateVideoList(false,query,objValue('perpage1'),false,objValue('screenshots1'),objValue('length1'),objValue('plugs1'),true);positionVideolist();}
function lucky(){var query=objValue('searchstring');var result=validateSearch(query);if(result!=false){alert(result);return;}
document.getElementById(currentBtn).className='';objDisable('searchbutton',true);objDisable('luckybutton',true);updateVideoList(false,'AUTOPLAY|||'+query,objValue('perpage1'),false,objValue('screenshots1'),objValue('length1'),objValue('plugs1'),true);}
function handleButton(obj){var current=document.getElementById(currentBtn);if(current!==null)
current.className='';document.getElementById(obj).className='bright';currentBtn=obj;}
function pickCategory(obj,category,matchquery){handleButton(obj.id);updateVideoList(false,(matchquery===true?'MATCH|||':'')+category,objValue('perpage1'),false,objValue('screenshots1'),objValue('length1'),objValue('plugs1'),false);positionVideolist();}
function fullStar(e,reseting){var parts=e.split('|');for(i=1;i<=5;i++){var star=document.getElementById('star'+i);if(star!==null&&i<=parts[0])
star.src='/images/star_full.jpg';else if(star!==null)
star.src='/images/star_empty.jpg';}
var wording=document.getElementById('ratingWording');if(wording!==null){if(reseting===false){var phrases=['[ complete trash ]','[ not the best ]','[ its alright ]','[ not too bad ]','[ amazing! ]'];wording.innerHTML=phrases[(parts[0]-1)];}
else
wording.innerHTML='[ current rating: <strong>'+(parts[0]=='0.0'?'unrated - be the first to vote!</strong>':parts[0]+'</strong> - by <strong>'+parts[1]+'</strong> '+(parts[1]==1?'person':'people'))+' ]';}}
function emptyStar(e){e.src='/images/star_empty.jpg';document.getElementById('ratingWording').innerHTML='[ current rating: '+rating+' ]';}
function castVote(videoid,vote){document.getElementById('videoRating').onmouseout=null;for(i=1;i<=5;i++){var star=document.getElementById('star'+i);star.onclick=null;star.onmouseover=null;star.onmouseout=null;}
handleKeepalive(kt);var params='videoid='+videoid+'&vote='+vote;ajaxRead('/videoVote.php',params,'post','videoRating',false,false,false);}
function parseMeta(input){if(input.match(/META/)){var duration=/duration\:([0-9\.]+)/i.exec(input);if(duration!==null&&duration[1]!='0'){handleKeepalive(kt);ajaxRead('/videoLength.php','videoid='+vid+'&length='+parseInt(duration[1]),'post',false,false,false,false);}}}
function handleFavorite(action,videoid){handleKeepalive(kt);ajaxRead('/ajaxCommand.php','command=favorite&type='+action+'&videoid='+videoid,'post',false,false,false,false);var output=document.getElementById('videoplayer_favoritelink');if(action=='remove')
output.innerHTML='<img src="/images/heart_small.jpg"> <a href="javascript:void(0)" onClick="handleFavorite(\'add\','+videoid+')">add to favorites</a>';else if(action=='add')
output.innerHTML='<img src="/images/heart_small.jpg"> <a href="javascript:void(0)" onClick="handleFavorite(\'remove\','+videoid+')">remove favorite</a>';}
function embedCodeType(id){switch(id){case'0':document.getElementById('embedcode_html').style.display='block';document.getElementById('embedcode_bbcode').style.display='none';break;case'1':document.getElementById('embedcode_html').style.display='none';document.getElementById('embedcode_bbcode').style.display='block';break;}
document.getElementById('embedcode_'+(id==0?'html':'bbcode')).select();}
function handleContactType(type){var output=document.getElementById('info');switch(type){case'advertise':output.innerHTML=contacttext[0];break;case'dmca':output.innerHTML=contacttext[1];break;case'bug':output.innerHTML=contacttext[2];break;case'other':output.innerHTML=contacttext[3];break;case'2257':output.innerHTML=contacttext[4];break;case'trade':output.innerHTML=contacttext[5];break;}}
function contactUs(type){trackPageview('contactUs');scroll(0,0);ajaxRead('/contactUs.php','type='+type,'post','playerBox',false,true,'contactus');}
function sendContact(){var subject=document.getElementById('cu_subject').value;var name=document.getElementById('cu_name').value;var email=document.getElementById('cu_email').value;var comment=document.getElementById('cu_comment').value;if(name==''||email==''||comment==''||subject=='')
alert('sorry, all fields marked * must be filled before sending your request.');else{objDisable('contactbutton',true);objDisable('cancelbutton',true);var params='action=send&name='+urlencode(name)+'&email='+urlencode(email)+'&comment='+urlencode(comment)+'&type='+urlencode(subject);ajaxRead('/contactUs.php',params,'post','playerBox',false,true,'contactus');}}
function forgotForm(obj){trackPageview('forgotPassword');ajaxRead('/forgotPassword.php','','post','playerBox',false,true,false);}
function retrievePassword(){objDisable('forgotbutton',true);objDisable('cancelbutton',true);var email=document.getElementById('fp_email').value;var params='email='+urlencode(email);ajaxRead('/forgotPassword.php',params,'post','playerBox',false,true,false);}
function joinForm(obj){ajaxRead('/joinUs.php','','post','playerBox',false,true,'join');trackPageview('joinUs');}
function joinSite(){objDisable('joinbutton',true);objDisable('cancelbutton',true);var email=document.getElementById('jo_username').value;var emailconfirm=document.getElementById('jo_usernameconfirm').value;var nickname=document.getElementById('jo_nickname').value;var gender=document.getElementById('jo_gender').value;var password=document.getElementById('jo_password').value;var passwordconfirm=document.getElementById('jo_passwordconfirm').value;var captcha=document.getElementById('jo_captcha').value;var params='email='+urlencode(email)+'&emailconfirm='+urlencode(emailconfirm)+'&password='+urlencode(password)+'&passwordconfirm='+urlencode(passwordconfirm)+'&captcha='+urlencode(captcha)+'&nickname='+urlencode(nickname)+'&gender='+urlencode(gender);ajaxRead('/joinUs.php',params,'post','playerBox',false,true,'join');}
function login(){objDisable('lb_username',true);objDisable('lb_password',true);document.getElementById('playerBox').innerHTML='';var username=document.getElementById('lb_username').value;var password=document.getElementById('lb_password').value;var params='username='+urlencode(username)+'&password='+urlencode(password);ajaxRead('/login.php',params,'post','linkbar',false,true,'login');}
function logout(){document.getElementById('playerBox').innerHTML='';if(currentBtn=='buttonYourFavorites')
pickCategory(document.getElementById('buttonNewest'),'CAT|||NEWEST');ajaxRead('/login.php','logout=true','post','linkbar',false,true,'login');}
function terminate(){if(window.onbeforeunload!==null){window.onbeforeunload=null;window.onerror=null;ajaxRead('/ajaxCommand.php','command=terminate','get',false,false,false,false);}}
function resetLoginColors(){document.getElementById('lb_username').className='inputText';document.getElementById('lb_password').className='inputText';}
function createPwdbox(){document.getElementById('lb_pwdbox').innerHTML='<input type="password" id="lb_password" style="width:122px" onfocus="resetLoginColors()" onKeyUp="checkEnter(event,\'login()\')" class="inputText"/>';var password=document.getElementById('lb_password');password.focus();password.select();}
function positionSkyscrapers(){var left=document.getElementById('ssLeft');var right=document.getElementById('ssRight');if(left==null||right==null)
return;if(size[0]<minsize){left.style.display='none';right.style.display='none';document.getElementById('outerShell').style.width='976px';}
else{document.getElementById('outerShell').style.width='1250px';left.style.display='block';right.style.display='block';var offset=(document.getElementById('bottom').offsetTop>size[1]?document.getElementById('bottom').offsetTop:size[1]);left.style.height=offset+'px';right.style.height=offset+'px';handleSkyscrapers();}}
function advertPage(){handleButton('buttonAdpage');document.getElementById('playerBox').innerHTML='';handleKeepalive(kt);ajaxRead('/ajaxCommand.php','command=externalpage','post','videoList',false,true,false);trackPageview('advertPage');}
function videoAdvertStatus(status){var setting=(status=='hide'?'none':'block');document.getElementById('videoAdvert').style.display=setting;document.getElementById('videoOverlay').style.display=setting;}
function playerReady(obj){var player=document.getElementById('player');if(ageconfirm===true){player.sendEvent('PLAY','true');ageconfirm=false;}
player.addControllerListener('VOLUME','volumeListener');player.addControllerListener('MUTE','muteTracker');player.addModelListener('STATE','handleStateChange');player.addModelListener('ERROR','handlePlayerError');player.addViewListener('LINK','stopVideo');document.getElementById('videoplayer_spinner').innerHTML='';document.getElementById('videoplayer_favoritelink').style.display='block';}
function stopVideo(){try{var player=document.getElementById('player');player.sendEvent('STOP');}
catch(e){}}
function replayVideo(){document.getElementById('player').sendEvent('PREV');}
function volumeListener(obj){handleKeepalive(kt);ajaxRead('/ajaxCommand.php','command=volume&volume='+obj.percentage,'post',false,false,false,false);}
function muteTracker(obj){handleKeepalive(kt);ajaxRead('/ajaxCommand.php','command=mute','post',false,false,false,false);}
function handleStateChange(obj){if(obj.newstate=='PAUSED'||((obj.oldstate=='COMPLETED'||obj.oldstate=='IDLE')&&obj.newstate=='BUFFERING')){setVideoAdvertHeader(obj.newstate);videoAdvertStatus('show');}
if(obj.newstate=='COMPLETED'){handleKeepalive(kt);setVideoAdvertHeader(obj.newstate);videoAdvertStatus('show');}
else if(obj.newstate=='PLAYING'){if(vc===false){vc=true;}
videoAdvertStatus('hide');}}
function setVideoAdvertHeader(type){switch(type){case'BUFFERING':var pieces=new Array('<div style="float:left"><img src="/images/wait4.gif"/> buffering, please wait ...</div>','<div style="float:right"><a href="javascript:videoAdvertStatus(\'hide\')">X</a></div>');break;case'PAUSED':var pieces=new Array('<div style="float:left">paused</div>','<div style="float:right"><a href="javascript:void(0)" onclick="document.getElementById(\'player\').sendEvent(\'PLAY\',\'true\')">resume playing</a> | <a href="javascript:videoAdvertStatus(\'hide\')">X</a></div>');break;case'COMPLETED':var pieces=new Array('<div style="float:left">this video was brought to you by :</div>','<div style="float:right"><a href="javascript:void(0)" onclick="replayVideo();">replay</a> | <a href="javascript:videoAdvertStatus(\'hide\')">X</a></div>');break;case'ERROR':var pieces=new Array('<div style="float:left"><strong style="color:red">sorry, but this video is not available at this time</strong></div>','<div style="float:right"><a href="javascript:videoAdvertStatus(\'hide\')">X</a></div>');break;}
document.getElementById('videoAdvertHeader').innerHTML=pieces[0]+pieces[1];}
function handlePlayerError(obj){if(obj.message.indexOf('Video not found')!==-1){handleKeepalive(kt);trackPageview('broken-'+vid);ajaxRead('/ajaxCommand.php','command=brokenvideo&videoid='+vid+'&message='+urlencode(obj.message),'post',false,false,false,false);setVideoAdvertHeader('ERROR');videoAdvertStatus('show');}}
function maximizeWindow(){top.window.moveTo(0,0);if(document.all)
top.window.resizeTo(screen.availWidth,screen.availHeight);else if(document.layers||document.getElementById){if(top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){top.window.outerHeight=top.screen.availHeight;top.window.outerWidth=top.screen.availWidth;}}}
function entityDecode(strHTML){var tmpTextArea=document.createElement("textarea");tmpTextArea.innerHTML=strHTML.replace(/</g,"<").replace(/>/g,">");var decodedStr=tmpTextArea.value;return decodedStr;}
function loadPeel(code){var code=entityDecode(code);if(code!=''&&size[0]>=minsize)
document.write(code);}
function handleVideoStub(selection,videoid){hideAddthis();switch(selection){case'related':trackPageview('relatedVideos');handleKeepalive(kt);ajaxRead('/ajaxCommand.php','command=listrelated&videoid='+videoid,'post','related',false,false,false);break;case'comments':trackPageview('videoComments');handleKeepalive(kt);ajaxRead('/ajaxCommand.php','command=listvideocomments&videoid='+videoid,'post','comments',false,false,false);break;}
var elements=['info','related','comments'];for(var i in elements){document.getElementById(elements[i]).style.display='none';if(document.getElementById(elements[i]+'Link'))
document.getElementById(elements[i]+'Link').removeAttribute('class');}
document.getElementById(selection).style.display='block';document.getElementById(selection+'Link').setAttribute('class','bright');}
function handleSkyscrapers(){if(document.getElementById('screenshots0')){var thumbs=document.getElementById('screenshots0').value;if(thumbs=='small'){switch(document.getElementById('perpage0').value){case'40':loadSkyscrapers(3);return;break;case'80':loadSkyscrapers(4);return;break;case'160':loadSkyscrapers(6);return;break;}}
else if(thumbs=='big'){switch(document.getElementById('perpage0').value){case'40':loadSkyscrapers(5);return;break;case'80':loadSkyscrapers(8);return;break;}}}
else
loadSkyscrapers(3);}
function loadSkyscrapers(total){if(total>skyscrapers){var loadskyscrapers=total-skyscrapers;ajaxRead('/ajaxCommand.php','command=skyscrapers&total='+loadskyscrapers,'get','ssLeft',true,false,false);ajaxRead('/ajaxCommand.php','command=skyscrapers&total='+loadskyscrapers,'get','ssRight',true,false,false);skyscrapers=total;}}
function errorHandler(msg,url,line){if(typeof msg.indexOf=='function'&&msg.indexOf('toString')==-1)
ajaxRead('/ajaxCommand.php','command=jserror&url='+urlencode(url)+'&message='+urlencode(msg)+'&line='+line+'&width='+urlencode(size[0])+'&height='+urlencode(size[1])+'&lasturl='+(lastajax[0]===false?'false':urlencode(lastajax[0]))+'&lastparams='+(lastajax[1]===false?'false':urlencode(lastajax[1])),'post',false,false,false,false);}
function plugStats(hitsin,hitsout){ei('total in: '+hitsin+' | total out: '+hitsout);}
function showAddthis(element,url,title){if(typeof addthis_open=='function')
addthis_open(element,'',url,title);}
function hideAddthis(){if(typeof addthis_close=='function')
addthis_close();}
function handleMaxChars(maximum,input,displayelement){var element=document.getElementById(input);if(element.value.length>maximum)
element.value=element.value.substr(0,maximum);document.getElementById(displayelement).innerHTML=maximum-element.value.length;}
function postVideoComment(videoid){var comment=document.getElementById('commentText').value;if(comment.length<5)
alert('sorry, but your comment must be at least 5 letters long.');else{objDisable('videoCommentButton',true);handleKeepalive(kt);ajaxRead('/ajaxCommand.php','command=postvideocomment&videoid='+videoid+'&comment='+urlencode(comment),'post','comments',false,false,'comments');}}
function askJoin(text){if(confirm(text))
joinForm();}
function unRobot(){ajaxRead('/ajaxCommand.php','command=unrobot','post',false,false,false,false);}
function handleKeepalive(timer){return;if(kt===false){k=setInterval("ajaxRead('/ajaxCommand.php','command=keepalive','get',false,false,false,false)",timer*1000);kt=timer;}
else{window.clearInterval(k);k=setInterval("ajaxRead('/ajaxCommand.php','command=keepalive','get',false,false,false,false)",timer*1000);}}