var vB_ReadMarker=new Array();
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(_1){
this.forumid=_1;
};
vB_AJAX_ReadMarker.prototype.mark_read=function(){
forumid=this.forumid;
this.ajax=new vB_AJAX_Handler(true);
this.ajax.onreadystatechange(vB_ReadMarker[forumid].ajax_check);
this.ajax.send("ajax.php?do=markread&f="+this.forumid,"do=markread&forumid="+this.forumid);
};
vB_AJAX_ReadMarker.prototype.ajax_check=function(){
var _2=vB_ReadMarker[forumid].ajax.handler;
if(_2.readyState==4&&_2.status==200){
if(_2.responseXML){
vB_ReadMarker[forumid].handle_forums_xml(_2.responseXML);
}
if(is_ie){
_2.abort();
}
}
return false;
};
vB_AJAX_ReadMarker.prototype.handle_forums_xml=function(_3){
var _4=fetch_tags(_3,"forum");
for(var i=0;i<_4.length;i++){
var _6=this.ajax.fetch_data(_4[i]);
this.update_forum_status(_6);
var _7=fetch_object("threadbits_forum_"+_6);
if(_7){
this.handle_threadbits(_7);
}
}
};
vB_AJAX_ReadMarker.prototype.update_forum_status=function(_8){
var _9=fetch_object(vB_ReadMarker["forum_statusicon_prefix"]+_8);
if(_9){
_9.style.cursor="default";
_9.title=_9.otitle;
_9.src=this.fetch_old_src(_9.src,"forum");
}
};
vB_AJAX_ReadMarker.prototype.handle_threadbits=function(_a){
var _b=fetch_tags(_a,"a");
for(var i=0;i<_b.length;i++){
if(_b[i].id&&_b[i].id.substr(0,vB_ReadMarker["thread_gotonew_prefix"].length)==vB_ReadMarker["thread_gotonew_prefix"]){
this.update_thread_status(_b[i].id.substr(vB_ReadMarker["thread_gotonew_prefix"].length));
}
}
};
vB_AJAX_ReadMarker.prototype.update_thread_status=function(_d){
var _e=fetch_object(vB_ReadMarker["thread_statusicon_prefix"]+_d);
if(_e){
_e.src=this.fetch_old_src(_e.src,"thread");
}
var _f=fetch_object(vB_ReadMarker["thread_gotonew_prefix"]+_d);
if(_f){
_f.parentNode.removeChild(_f);
}
var _10=fetch_object(vB_ReadMarker["thread_title_prefix"]+_d);
if(_10){
_10.style.fontWeight="normal";
}
};
vB_AJAX_ReadMarker.prototype.fetch_old_src=function(_11,_12){
var foo=_11.replace(/_(new)([\._])(.+)$/i,(_12=="thread"?"$2$3":"_old$2$3"));
return foo;
};
function mark_forum_read(_14){
if(AJAX_Compatible){
vB_ReadMarker[_14]=new vB_AJAX_ReadMarker(_14);
vB_ReadMarker[_14].mark_read();
}else{
window.location="forumdisplay.php?"+SESSIONURL+"do=markread&forumid="+_14;
}
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 _16=fetch_tags(document,"img");
for(var i=0;i<_16.length;i++){
if(_16[i].id&&_16[i].id.substr(0,vB_ReadMarker["forum_statusicon_prefix"].length)==vB_ReadMarker["forum_statusicon_prefix"]){
if(_16[i].src.search(/\/([^\/]+)(new)(_lock)?\.([a-z0-9]+)$/i)!=-1){
img_alt_2_title(_16[i]);
_16[i].otitle=_16[i].title;
_16[i].title=vbphrase["doubleclick_forum_markread"];
_16[i].style.cursor=pointer_cursor;
_16[i].ondblclick=init_forum_readmarker_icon;
}
}
}
};


