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(a){this.forumid=a}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+"securitytoken="+SECURITYTOKEN+"&do=markread&forumid="+this.forumid)};vB_AJAX_ReadMarker.prototype.handle_ajax_error=function(a){vBulletin_AJAX_Error_Handler(a)};vB_AJAX_ReadMarker.prototype.handle_ajax_request=function(d){var e=fetch_tags(d.responseXML,"forum");for(var a=0;a<e.length;a++){var c=e[a].firstChild.nodeValue;this.update_forum_status(c);var b=fetch_object("threadbits_forum_"+c);if(b){this.handle_threadbits(b)}}};vB_AJAX_ReadMarker.prototype.update_forum_status=function(b){var a=fetch_object(vB_ReadMarker.forum_statusicon_prefix+b);if(a){a.style.cursor="default";a.title=a.otitle;a.src=this.fetch_old_src(a.src,"forum")}};vB_AJAX_ReadMarker.prototype.handle_threadbits=function(b){var a=fetch_tags(b,"a");for(var c=0;c<a.length;c++){if(a[c].id&&a[c].id.substr(0,vB_ReadMarker.thread_gotonew_prefix.length)==vB_ReadMarker.thread_gotonew_prefix){this.update_thread_status(a[c].id.substr(vB_ReadMarker.thread_gotonew_prefix.length))}}};vB_AJAX_ReadMarker.prototype.update_thread_status=function(b){var c=fetch_object(vB_ReadMarker.thread_statusicon_prefix+b);if(c){c.src=this.fetch_old_src(c.src,"thread")}var d=fetch_object(vB_ReadMarker.thread_gotonew_prefix+b);if(d){d.parentNode.removeChild(d)}var a=fetch_object(vB_ReadMarker.thread_title_prefix+b);if(a){a.style.fontWeight="normal"}};vB_AJAX_ReadMarker.prototype.fetch_old_src=function(c,a){var b=c.replace(/_(new)([\._])(.+)$/i,(a=="thread"?"$2$3":"_old$2$3"));return b};function mark_forum_read(a){if(AJAX_Compatible){vB_ReadMarker[a]=new vB_AJAX_ReadMarker(a);vB_ReadMarker[a].mark_read()}else{window.location="forumdisplay.php?"+SESSIONURL+"do=markread&forumid="+a}return false}function init_forum_readmarker_icon(a){mark_forum_read(this.id.substr(vB_ReadMarker.forum_statusicon_prefix.length))}function init_forum_readmarker_system(){var a=fetch_tags(document,"img");for(var b=0;b<a.length;b++){if(a[b].id&&a[b].id.substr(0,vB_ReadMarker.forum_statusicon_prefix.length)==vB_ReadMarker.forum_statusicon_prefix){if(a[b].src.search(/\/([^\/]+)(new)(_lock)?\.([a-z0-9]+)$/i)!=-1){img_alt_2_title(a[b]);a[b].otitle=a[b].title;a[b].title=vbphrase.doubleclick_forum_markread;a[b].style.cursor=pointer_cursor;a[b].ondblclick=init_forum_readmarker_icon}}}};
