var time_variable;function getXMLObject(){var xmlHttp=false;try{xmlHttp=new ActiveXObject('Msxml2.XMLHTTP')}catch(e){try{xmlHttp=new ActiveXObject('Microsoft.XMLHTTP')}catch(e){xmlHttp=false}}if(!xmlHttp&&typeof XMLHttpRequest!='undefined'){xmlHttp=new XMLHttpRequest();if(xmlHttp.overrideMimeType){xmlHttp.overrideMimeType('text/xml');}}return xmlHttp;}var xmlhttp=new getXMLObject();function toggle_display(id){if(document.getElementById(id).style.display=='none'){document.getElementById(id).style.display='block';}else{document.getElementById(id).style.display='none';}}var rating_definition=new Array('1/10: Worst Ever','2/10: Bad','3/10: Weak','4/10: Below Average','5/10: Average','6/10: Decent','7/10: Good','8/10: Very Good','9/10: Excellent','10/10: Masterpiece');function show_rating_no(no){document.getElementById('rating_term').innerHTML=rating_definition[no-1];document.getElementById('rating_bg').style.backgroundImage="url('/images/rating.gif')";document.getElementById('rating_bg').style.backgroundPosition='0 -'+((no*16)-16)+'px';document.getElementById('rating_bg').style.backgroundRepeat='no-repeat';}function clear_rating(x,y,term){document.getElementById('rating_term').innerHTML='Average Rating: '+term;document.getElementById('rating_bg').style.backgroundImage="url('/images/avg_rating.gif')";document.getElementById('rating_bg').style.backgroundPosition='-'+x+'px -'+y+'px';document.getElementById('rating_bg').style.backgroundRepeat='no-repeat';}function rate_series(sid,rating){var getdate=new Date();document.getElementById('avg_rating').innerHTML='<div id="rating_loader"></div>';if(xmlhttp){var url='/requests.php';var query='?action=rate&sid='+sid+'&rating='+rating+'&ms='+getdate.getTime();xmlhttp.open('GET',url+query,true);xmlhttp.onreadystatechange=function(){handle_rating(rating)};xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send(null);}}function handle_rating(rating){if(xmlhttp.readyState==4){if(xmlhttp.status==200){document.getElementById('rating_bg').innerHTML='';document.getElementById('avg_rating').innerHTML=xmlhttp.responseText;document.getElementById('rating_bg').style.height='12px';document.getElementById('rating_bg').style.backgroundImage="url('/images/rating.gif')";document.getElementById('rating_bg').style.backgroundPosition='0 -'+((rating*16)-16)+'px';document.getElementById('rating_bg').style.backgroundRepeat='no-repeat';document.getElementById('rating_term').innerHTML=rating_definition[rating-1];}else{alert('There was an error in rating this series. Please refresh your browser and try again.');}}}function recommend_series(sid,rid){if(rid==0){return false}var getdate=new Date();document.getElementById('recommendations').innerHTML='<div id="rating_loader"></div>';if(xmlhttp){var url='/requests.php';var query='?action=rec&sid='+sid+'&rid='+rid+'&ms='+getdate.getTime();xmlhttp.open('GET',url+query,true);xmlhttp.onreadystatechange=function(){handle_recommendation()};xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send(null);}}function handle_recommendation(){if(xmlhttp.readyState==4){if(xmlhttp.status==200){document.getElementById('recommendations').innerHTML=xmlhttp.responseText;document.getElementById('submit_recommendation').disabled=true;}else{alert('There was an error in recommending this series. Please refresh your browser and try again.');}}}function pagination(v,pages,page){var getdate=new Date();document.getElementById('table_content').innerHTML='<div id="rating_loader"></div>';if(xmlhttp){var url='/requests.php';var query='?action='+v+'&page='+page+'&pages='+pages+'&ms='+getdate.getTime();xmlhttp.open('GET',url+query,true);xmlhttp.onreadystatechange=function(){handle_page()};xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send(null);}}function handle_page(){if(xmlhttp.readyState==4){if(xmlhttp.status==200){document.getElementById('table_content').innerHTML=xmlhttp.responseText;}else{alert('An error has occured, please refresh your browser and try again.');}}}function mark_dead(eid){var answer=confirm('Before reporting try:\n1. Refreshing the browser\n2. Click the get flash player button to ensure you have the latest flash players\n\nOtherwise if the video is not working click OK to report the video.');if(answer){document.getElementById('video_status').innerHTML='<div id="video_report_loader"></div>';if(xmlhttp){var url='/requests.php';var query='?action=report&episode_id='+eid;xmlhttp.open('GET',url+query,true);xmlhttp.onreadystatechange=handle_video;xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send(null);}}else{return false;}}function handle_video(){if(xmlhttp.readyState==4){if(xmlhttp.status==200){document.getElementById('video_status').innerHTML='<div id="video_reported" title="This video is under review. Thank you for reporting"></div>';}else{alert('There was an error in reporting the video. Please refresh your browser and try again.');}}}function must_watch_count(eid){var getdate=new Date();document.getElementById('must_watch').innerHTML='<div id="must_watch_loader"></div>';if(xmlhttp){var url='/requests.php';var query='?action=mw&episode_id='+eid+'&ms='+getdate.getTime();xmlhttp.open("GET",url+query,true);xmlhttp.onreadystatechange=handle_mw_count;xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send(null);}}function handle_mw_count(){if(xmlhttp.readyState==4){if(xmlhttp.status==200){document.getElementById('must_watch').innerHTML=xmlhttp.responseText;}else{alert('There was an error in reporting the video. Please refresh your browser and try again.');}}}function setcookie(name,value,exp){var expdate=new Date();expdate.setDate(expdate.getDate()+exp);document.cookie=name+'='+value+';expires='+expdate.toGMTString()+';path=/';}function set_lw(sid,eno,cc,ow,reset){if(reset==0){if(cc<20||ow==1){setcookie('LW_'+sid,eno,365);document.getElementById('last_watched').innerHTML='<div id="lw_marked"><a href="#" onclick="set_lw('+sid+',\''+eno+'\','+cc+','+ow+',1);return false"></a></div>';}else{alert('Oops, you have already created the maximum amount of last watch markers. In order to set this episode as last watched for this series you need to remove a marker from another series. Last watched episodes can be removed by clicking the circular icon found on main episode listings of each series.');}}else{remove_lw(sid);document.getElementById('last_watched').innerHTML='<a href="#" onclick="set_lw('+sid+',\''+eno+'\','+cc+','+ow+',0);return false"></a>';}}function remove_lw(sid){setcookie('LW_'+sid,'none',-1);alert('Last watched episode for this series has been removed.');}function get_rec_sid(sid){document.getElementById('rid').value=sid;document.getElementById('series_thumb').src='http://static.animeseason.com/images/thumbs/50x50/'+sid+'.jpg';}function show_player(player){v=document.getElementById('veoh_tab');i=document.getElementById('imeem_tab');s=document.getElementById('myspace_tab');m=document.getElementById('megavideo_tab');o=document.getElementById('other_tab');if(v){document.getElementById('veoh').style.display=((player=='veoh')?'block':'none')}if(s){document.getElementById('myspace').style.display=((player=='myspace')?'block':'none')}if(m){document.getElementById('megavideo').style.display=((player=='megavideo')?'block':'none')}if(i){document.getElementById('imeem').style.display=((player=='imeem')?'block':'none')}if(o){document.getElementById('other').style.display=((player=='other')?'block':'none')}if(v){v.style.backgroundColor=((player=='veoh')?'#505050':'#393939')}if(s){s.style.backgroundColor=((player=='myspace')?'#505050':'#393939')}if(m){m.style.backgroundColor=((player=='megavideo')?'#505050':'#393939')}if(i){i.style.backgroundColor=((player=='imeem')?'#505050':'#393939')}if(o){o.style.backgroundColor=((player=='other')?'#505050':'#393939')}}function show_feature(feature){a=document.getElementById('ratings_tab');b=document.getElementById('recommendations_tab');c=document.getElementById('relations_tab');document.getElementById('ratings').style.display=((feature=='r1')?'block':'none');document.getElementById('recommendations').style.display=((feature=='r2')?'block':'none');if(c){document.getElementById('relations').style.display=((feature=='r3')?'block':'none')}a.style.backgroundColor=((feature=='r1')?'#505050':'#393939');b.style.backgroundColor=((feature=='r2')?'#505050':'#393939');if(c){c.style.backgroundColor=((feature=='r3')?'#505050':'#393939')}}