
var vB_ReadMarker={'forum_statusicon_prefix':'forum_statusicon_','thread_statusicon_prefix':'thread_statusicon_','thread_gotonew_prefix':'thread_gotonew_','thread_title_prefix':'thread_title_'};function vB_AJAX_ReadMarker(forumid)
{this.forumid=forumid;};vB_AJAX_ReadMarker.prototype.mark_read=function()
{YAHOO.util.Connect.asyncRequest("POST",'ajax.php?do=markread&f='+this.forumid,{success:this.handle_ajax_request,failure:this.handle_ajax_error,timeout:vB_Default_Timeout,scope:this},SESSIONURL+'do=markread&forumid='+this.forumid);};vB_AJAX_ReadMarker.prototype.handle_ajax_error=function(ajax)
{vBulletin_AJAX_Error_Handler(ajax);};vB_AJAX_ReadMarker.prototype.handle_ajax_request=function(ajax)
{var forum_nodes=fetch_tags(ajax.responseXML,'forum');for(var i=0;i<forum_nodes.length;i++)
{var forumid=forum_nodes[i].firstChild.nodeValue;this.update_forum_status(forumid);var threadbits_object=fetch_object('threadbits_forum_'+forumid);if(threadbits_object)
{this.handle_threadbits(threadbits_object);}}};vB_AJAX_ReadMarker.prototype.update_forum_status=function(forumid)
{var imageobj=fetch_object(vB_ReadMarker['forum_statusicon_prefix']+forumid);if(imageobj)
{imageobj.style.cursor='default';imageobj.title=imageobj.otitle;imageobj.src=this.fetch_old_src(imageobj.src,'forum');}};vB_AJAX_ReadMarker.prototype.handle_threadbits=function(threadbits_object)
{var links=fetch_tags(threadbits_object,'a');for(var i=0;i<links.length;i++)
{if(links[i].id&&links[i].id.substr(0,vB_ReadMarker['thread_gotonew_prefix'].length)==vB_ReadMarker['thread_gotonew_prefix'])
{this.update_thread_status(links[i].id.substr(vB_ReadMarker['thread_gotonew_prefix'].length));}}};vB_AJAX_ReadMarker.prototype.update_thread_status=function(threadid)
{var statusicon=fetch_object(vB_ReadMarker['thread_statusicon_prefix']+threadid);if(statusicon)
{statusicon.src=this.fetch_old_src(statusicon.src,'thread');}
var gotonew=fetch_object(vB_ReadMarker['thread_gotonew_prefix']+threadid);if(gotonew)
{gotonew.parentNode.removeChild(gotonew);}
var threadtitle=fetch_object(vB_ReadMarker['thread_title_prefix']+threadid);if(threadtitle)
{threadtitle.style.fontWeight='normal';}};vB_AJAX_ReadMarker.prototype.fetch_old_src=function(newsrc,type)
{var foo=newsrc.replace(/_(new)([\._])(.+)$/i,(type=='thread'?'$2$3':'_old$2$3'));return foo;};function mark_forum_read(forumid)
{if(AJAX_Compatible)
{vB_ReadMarker[forumid]=new vB_AJAX_ReadMarker(forumid);vB_ReadMarker[forumid].mark_read();}
else
{window.location='forumdisplay.php?'+SESSIONURL+'do=markread&forumid='+forumid;}
return false;};function init_forum_readmarker_icon(e)
{mark_forum_read(this.id.substr(vB_ReadMarker['forum_statusicon_prefix'].length));};function init_forum_readmarker_system()
{var images=fetch_tags(document,'img');for(var i=0;i<images.length;i++)
{if(images[i].id&&images[i].id.substr(0,vB_ReadMarker['forum_statusicon_prefix'].length)==vB_ReadMarker['forum_statusicon_prefix'])
{if(images[i].src.search(/\/([^\/]+)(new)(_lock)?\.([a-z0-9]+)$/i)!=-1)
{img_alt_2_title(images[i]);images[i].otitle=images[i].title;images[i].title=vbphrase['doubleclick_forum_markread'];images[i].style.cursor=pointer_cursor;images[i].ondblclick=init_forum_readmarker_icon;}}}};