// nCode Image Resizer for vBulletin 3.6.0
// (c) 2007 nCode


NcodeImageResizer.IMAGE_ID_BASE = 'ncode_imageresizer_container_';
NcodeImageResizer.WARNING_ID_BASE = 'ncode_imageresizer_warning_';
NcodeImageResizer.scheduledResizes = [];

function NcodeImageResizer(id, img) {
	this.id = id;
	this.img = img;
	this.originalWidth = 0;
	this.originalHeight = 0;
	this.warning = null;
	this.warningTextNode = null;
	this.originalWidth = img.originalWidth;
	this.originalHeight = img.originalHeight;
	
	img.id = NcodeImageResizer.IMAGE_ID_BASE+id;
}

NcodeImageResizer.executeOnload = function() {
	var rss = NcodeImageResizer.scheduledResizes;
	for(var i = 0; i  < rss.length; i++) {
		NcodeImageResizer.createOn(rss[i], true);
	}
}

NcodeImageResizer.schedule = function(img) {
	if(NcodeImageResizer.scheduledResizes.length == 0) {
		if(window.addEventListener) {
			window.addEventListener('load', NcodeImageResizer.executeOnload, false);
		} else if(window.attachEvent) {
			window.attachEvent('onload', NcodeImageResizer.executeOnload);
		}
	}
	NcodeImageResizer.scheduledResizes.push(img);
}

NcodeImageResizer.getNextId = function() {
	var id = 1;
	while(document.getElementById(NcodeImageResizer.IMAGE_ID_BASE+id) != null) {
		id++;
	}
	return id;
}

NcodeImageResizer.createOnId = function(id) {
	return NcodeImageResizer.createOn(document.getElementById(id));
}

NcodeImageResizer.createOn = function(img, isSchedule) {
	if(typeof isSchedule == 'undefined') isSchedule = false;
	
	if(!img || !img.tagName || img.tagName.toLowerCase() != 'img') {
		alert(img+' is not an image ('+img.tagName.toLowerCase()+')');
	}
	
	if(img.width == 0 || img.height == 0) {
		if(!isSchedule)
			NcodeImageResizer.schedule(img);
		return;
	}
	
	if(!img.originalWidth) img.originalWidth = img.width;
	if(!img.originalHeight) img.originalHeight = img.height;
	
	if((NcodeImageResizer.MAXWIDTH > 0 && img.originalWidth > NcodeImageResizer.MAXWIDTH) || (NcodeImageResizer.MAXHEIGHT > 0 && img.originalHeight > NcodeImageResizer.MAXHEIGHT)) {
		var isRecovery = false; // if this is a recovery from QuickEdit, which only restores the HTML, not the OO structure
		var newid, resizer;
		if(img.id && img.id.indexOf(NcodeImageResizer.IMAGE_ID_BASE) == 0) {
			newid = img.id.substr(NcodeImageResizer.IMAGE_ID_BASE.length);
			if(document.getElementById(NcodeImageResizer.WARNING_ID_BASE+newid) != null) {
				resizer = new NcodeImageResizer(newid, img);
				isRecovery = true;
				resizer.restoreImage();
			}
		} else {
			newid = NcodeImageResizer.getNextId();
			resizer = new NcodeImageResizer(newid, img);
		}
		
		if(isRecovery) {
			resizer.reclaimWarning(newid);
		} else {
			resizer.createWarning();
		}
		resizer.scale();
	}
}

NcodeImageResizer.prototype.restoreImage = function() {
	newimg = document.createElement('IMG');
	newimg.src = this.img.src;
	this.img.width = newimg.width;
	this.img.height = newimg.height;
}

NcodeImageResizer.prototype.reclaimWarning = function(id) {
	this.warning = document.getElementById(NcodeImageResizer.WARNING_ID_BASE+id);
	this.warningTextNode = this.warning.firstChild.firstChild.childNodes[1].firstChild;
	this.warning.resize = this;
	
	this.scale();
}

NcodeImageResizer.prototype.createWarning = function() {
	var mtable = document.createElement('TABLE');
	var mtbody = document.createElement('TBODY');
	var mtr = document.createElement('TR');
	var mtd1 = document.createElement('TD');
	var mtd2 = document.createElement('TD');
	var mimg = document.createElement('IMG');
	var mtext = document.createTextNode('');
	
	mimg.src = NcodeImageResizer.BBURL+'/images/statusicon/wol_error.gif';
	mimg.width = 16;
	mimg.height = 16;
	mimg.alt = '';
	mimg.border = 0;
	
	mtd1.width = 20;
	mtd1.className = 'td1';
	
	mtd2.unselectable = 'on';
	mtd2.className = 'td2';
	
	mtable.className = 'ncode_imageresizer_warning';
	mtable.textNode = mtext;
	mtable.resize = this;
	mtable.id = NcodeImageResizer.WARNING_ID_BASE+this.id;
	
	mtd1.appendChild(mimg);
	mtd2.appendChild(mtext);
	
	mtr.appendChild(mtd1);
	mtr.appendChild(mtd2);
	
	mtbody.appendChild(mtr);
	
	mtable.appendChild(mtbody);
	
	this.img.parentNode.insertBefore(mtable, this.img);
	
	this.warning = mtable;
	this.warningTextNode = mtext;
}

NcodeImageResizer.prototype.setText = function(text) {
	var newnode = document.createTextNode(text);
	this.warningTextNode.parentNode.replaceChild(newnode, this.warningTextNode);
	this.warningTextNode = newnode;
}

NcodeImageResizer.prototype.scale = function() {
	this.img.height = this.originalHeight;
	this.img.width = this.originalWidth;
	
	if(NcodeImageResizer.MAXWIDTH > 0 && this.img.width > NcodeImageResizer.MAXWIDTH) {
		this.img.height = (NcodeImageResizer.MAXWIDTH / this.img.width) * this.img.height;
		this.img.width = NcodeImageResizer.MAXWIDTH;
	}
	
	if(NcodeImageResizer.MAXHEIGHT > 0 && this.img.height > NcodeImageResizer.MAXHEIGHT) {
		this.img.width = (NcodeImageResizer.MAXHEIGHT / this.img.height) * this.img.width;
		this.img.height = NcodeImageResizer.MAXHEIGHT;
	}
	
	this.warning.width = this.img.width;
	this.warning.onclick = function() { return this.resize.unScale(); }
	
	if(this.img.width < 450) {
		this.setText(vbphrase['ncode_imageresizer_warning_small']);
	} else if(this.img.fileSize && this.img.fileSize > 0) {
		this.setText(vbphrase['ncode_imageresizer_warning_filesize'].replace('%1$s', this.originalWidth).replace('%2$s', this.originalHeight).replace('%3$s', Math.round(this.img.fileSize/1024)));
	} else {
		this.setText(vbphrase['ncode_imageresizer_warning_no_filesize'].replace('%1$s', this.originalWidth).replace('%2$s', this.originalHeight));
	}
	
	return false;
}

NcodeImageResizer.prototype.unScale = function() {
	switch(NcodeImageResizer.MODE) {
		case 'samewindow':
			window.open(this.img.src, '_self');
			break;
		case 'newwindow':
			window.open(this.img.src, '_blank');
			break;
		case 'enlarge':
		default:
			this.img.width = this.originalWidth;
			this.img.height = this.originalHeight;
			this.img.className = 'ncode_imageresizer_original';
			if(this.warning != null) {
				this.setText(vbphrase['ncode_imageresizer_warning_fullsize']);
				this.warning.width = this.img.width;
				this.warning.onclick = function() { return this.resize.scale() };
			}
			break;
	}
	
	return false;
}

























































// #### overlib.js
var olLoaded=0;var pmStart=10000000;var pmUpper=10001000;var pmCount=pmStart+1;var pmt="";var pms=new Array();var olInfo=new Info("4.21",1);var FREPLACE=0;var FBEFORE=1;var FAFTER=2;var FALTERNATE=3;var FCHAIN=4;var olHideForm=0;var olHautoFlag=0;var olVautoFlag=0;var hookPts=new Array(),postParse=new Array(),cmdLine=new Array(),runTime=new Array();registerCommands("donothing,inarray,caparray,sticky,background,noclose,caption,left,right,center,offsetx,offsety,fgcolor,bgcolor,textcolor,capcolor,closecolor,width,border,cellpad,status,autostatus,autostatuscap,height,closetext,snapx,snapy,fixx,fixy,relx,rely,fgbackground,bgbackground,padx,pady,fullhtml,above,below,capicon,textfont,captionfont,closefont,textsize,captionsize,closesize,timeout,function,delay,hauto,vauto,closeclick,wrap,followmouse,mouseoff,closetitle,cssoff,compatmode,cssclass,fgclass,bgclass,textfontclass,captionfontclass,closefontclass");if(typeof ol_fgcolor=="undefined"){var ol_fgcolor="#CCCCFF"}if(typeof ol_bgcolor=="undefined"){var ol_bgcolor="#333399"}if(typeof ol_textcolor=="undefined"){var ol_textcolor="#000000"}if(typeof ol_capcolor=="undefined"){var ol_capcolor="#FFFFFF"}if(typeof ol_closecolor=="undefined"){var ol_closecolor="#9999FF"}if(typeof ol_textfont=="undefined"){var ol_textfont="Verdana,Arial,Helvetica"}if(typeof ol_captionfont=="undefined"){var ol_captionfont="Verdana,Arial,Helvetica"}if(typeof ol_closefont=="undefined"){var ol_closefont="Verdana,Arial,Helvetica"}if(typeof ol_textsize=="undefined"){var ol_textsize="1"}if(typeof ol_captionsize=="undefined"){var ol_captionsize="1"}if(typeof ol_closesize=="undefined"){var ol_closesize="1"}if(typeof ol_width=="undefined"){var ol_width="200"}if(typeof ol_border=="undefined"){var ol_border="1"}if(typeof ol_cellpad=="undefined"){var ol_cellpad=2}if(typeof ol_offsetx=="undefined"){var ol_offsetx=10}if(typeof ol_offsety=="undefined"){var ol_offsety=10}if(typeof ol_text=="undefined"){var ol_text="Default Text"}if(typeof ol_cap=="undefined"){var ol_cap=""}if(typeof ol_sticky=="undefined"){var ol_sticky=0}if(typeof ol_background=="undefined"){var ol_background=""}if(typeof ol_close=="undefined"){var ol_close="Close"}if(typeof ol_hpos=="undefined"){var ol_hpos=RIGHT}if(typeof ol_status=="undefined"){var ol_status=""}if(typeof ol_autostatus=="undefined"){var ol_autostatus=0}if(typeof ol_height=="undefined"){var ol_height=-1}if(typeof ol_snapx=="undefined"){var ol_snapx=0}if(typeof ol_snapy=="undefined"){var ol_snapy=0}if(typeof ol_fixx=="undefined"){var ol_fixx=-1}if(typeof ol_fixy=="undefined"){var ol_fixy=-1}if(typeof ol_relx=="undefined"){var ol_relx=null}if(typeof ol_rely=="undefined"){var ol_rely=null}if(typeof ol_fgbackground=="undefined"){var ol_fgbackground=""}if(typeof ol_bgbackground=="undefined"){var ol_bgbackground=""}if(typeof ol_padxl=="undefined"){var ol_padxl=1}if(typeof ol_padxr=="undefined"){var ol_padxr=1}if(typeof ol_padyt=="undefined"){var ol_padyt=1}if(typeof ol_padyb=="undefined"){var ol_padyb=1}if(typeof ol_fullhtml=="undefined"){var ol_fullhtml=0}if(typeof ol_vpos=="undefined"){var ol_vpos=BELOW}if(typeof ol_aboveheight=="undefined"){var ol_aboveheight=0}if(typeof ol_capicon=="undefined"){var ol_capicon=""}if(typeof ol_frame=="undefined"){var ol_frame=self}if(typeof ol_timeout=="undefined"){var ol_timeout=0}if(typeof ol_function=="undefined"){var ol_function=null}if(typeof ol_delay=="undefined"){var ol_delay=0}if(typeof ol_hauto=="undefined"){var ol_hauto=0}if(typeof ol_vauto=="undefined"){var ol_vauto=0}if(typeof ol_closeclick=="undefined"){var ol_closeclick=0}if(typeof ol_wrap=="undefined"){var ol_wrap=0}if(typeof ol_followmouse=="undefined"){var ol_followmouse=1}if(typeof ol_mouseoff=="undefined"){var ol_mouseoff=0}if(typeof ol_closetitle=="undefined"){var ol_closetitle="Close"}if(typeof ol_compatmode=="undefined"){var ol_compatmode=0}if(typeof ol_css=="undefined"){var ol_css=CSSOFF}if(typeof ol_fgclass=="undefined"){var ol_fgclass=""}if(typeof ol_bgclass=="undefined"){var ol_bgclass=""}if(typeof ol_textfontclass=="undefined"){var ol_textfontclass=""}if(typeof ol_captionfontclass=="undefined"){var ol_captionfontclass=""}if(typeof ol_closefontclass=="undefined"){var ol_closefontclass=""}if(typeof ol_texts=="undefined"){var ol_texts=new Array("Text 0","Text 1")}if(typeof ol_caps=="undefined"){var ol_caps=new Array("Caption 0","Caption 1")}var o3_text="";var o3_cap="";var o3_sticky=0;var o3_background="";var o3_close="Close";var o3_hpos=RIGHT;var o3_offsetx=2;var o3_offsety=2;var o3_fgcolor="";var o3_bgcolor="";var o3_textcolor="";var o3_capcolor="";var o3_closecolor="";var o3_width=100;var o3_border=1;var o3_cellpad=2;var o3_status="";var o3_autostatus=0;var o3_height=-1;var o3_snapx=0;var o3_snapy=0;var o3_fixx=-1;var o3_fixy=-1;var o3_relx=null;var o3_rely=null;var o3_fgbackground="";var o3_bgbackground="";var o3_padxl=0;var o3_padxr=0;var o3_padyt=0;var o3_padyb=0;var o3_fullhtml=0;var o3_vpos=BELOW;var o3_aboveheight=0;var o3_capicon="";var o3_textfont="Verdana,Arial,Helvetica";var o3_captionfont="Verdana,Arial,Helvetica";var o3_closefont="Verdana,Arial,Helvetica";var o3_textsize="1";var o3_captionsize="1";var o3_closesize="1";var o3_frame=self;var o3_timeout=0;var o3_timerid=0;var o3_allowmove=0;var o3_function=null;var o3_delay=0;var o3_delayid=0;var o3_hauto=0;var o3_vauto=0;var o3_closeclick=0;var o3_wrap=0;var o3_followmouse=1;var o3_mouseoff=0;var o3_closetitle="";var o3_compatmode=0;var o3_css=CSSOFF;var o3_fgclass="";var o3_bgclass="";var o3_textfontclass="";var o3_captionfontclass="";var o3_closefontclass="";var o3_x=0;var o3_y=0;var o3_showingsticky=0;var o3_removecounter=0;var over=null;var fnRef,hoveringSwitch=false;var olHideDelay;var isMac=(navigator.userAgent.indexOf("Mac")!=-1);var olOp=(navigator.userAgent.toLowerCase().indexOf("opera")>-1&&document.createTextNode);var olNs4=(navigator.appName=="Netscape"&&parseInt(navigator.appVersion)==4);var olNs6=(document.getElementById)?true:false;var olKq=(olNs6&&/konqueror/i.test(navigator.userAgent));var olIe4=(document.all)?true:false;var olIe5=false;var olIe55=false;var docRoot="document.body";if(olNs4){var oW=window.innerWidth;var oH=window.innerHeight;window.onresize=function(){if(oW!=window.innerWidth||oH!=window.innerHeight){location.reload()}}}if(olIe4){var agent=navigator.userAgent;if(/MSIE/.test(agent)){var versNum=parseFloat(agent.match(/MSIE[ ](\d\.\d+)\.*/i)[1]);if(versNum>=5){olIe5=true;olIe55=(versNum>=5.5&&!olOp)?true:false;if(olNs6){olNs6=false}}}if(olNs6){olIe4=false}}if(document.compatMode&&document.compatMode=="CSS1Compat"){docRoot=((olIe4&&!olOp)?"document.documentElement":docRoot)}if(window.addEventListener){window.addEventListener("load",OLonLoad_handler,false)}else{if(window.attachEvent){window.attachEvent("onload",OLonLoad_handler)}}var capExtent;function overlib(){if(!olLoaded||isExclusive(overlib.arguments)){return true}if(olCheckMouseCapture){olMouseCapture()}if(over){over=(typeof over.id!="string")?o3_frame.document.all.overDiv:over;cClick()}olHideDelay=0;o3_text=ol_text;o3_cap=ol_cap;o3_sticky=ol_sticky;o3_background=ol_background;o3_close=ol_close;o3_hpos=ol_hpos;o3_offsetx=ol_offsetx;o3_offsety=ol_offsety;o3_fgcolor=ol_fgcolor;o3_bgcolor=ol_bgcolor;o3_textcolor=ol_textcolor;o3_capcolor=ol_capcolor;o3_closecolor=ol_closecolor;o3_width=ol_width;o3_border=ol_border;o3_cellpad=ol_cellpad;o3_status=ol_status;o3_autostatus=ol_autostatus;o3_height=ol_height;o3_snapx=ol_snapx;o3_snapy=ol_snapy;o3_fixx=ol_fixx;o3_fixy=ol_fixy;o3_relx=ol_relx;o3_rely=ol_rely;o3_fgbackground=ol_fgbackground;o3_bgbackground=ol_bgbackground;o3_padxl=ol_padxl;o3_padxr=ol_padxr;o3_padyt=ol_padyt;o3_padyb=ol_padyb;o3_fullhtml=ol_fullhtml;o3_vpos=ol_vpos;o3_aboveheight=ol_aboveheight;o3_capicon=ol_capicon;o3_textfont=ol_textfont;o3_captionfont=ol_captionfont;o3_closefont=ol_closefont;o3_textsize=ol_textsize;o3_captionsize=ol_captionsize;o3_closesize=ol_closesize;o3_timeout=ol_timeout;o3_function=ol_function;o3_delay=ol_delay;o3_hauto=ol_hauto;o3_vauto=ol_vauto;o3_closeclick=ol_closeclick;o3_wrap=ol_wrap;o3_followmouse=ol_followmouse;o3_mouseoff=ol_mouseoff;o3_closetitle=ol_closetitle;o3_css=ol_css;o3_compatmode=ol_compatmode;o3_fgclass=ol_fgclass;o3_bgclass=ol_bgclass;o3_textfontclass=ol_textfontclass;o3_captionfontclass=ol_captionfontclass;o3_closefontclass=ol_closefontclass;setRunTimeVariables();fnRef="";o3_frame=ol_frame;if(!(over=createDivContainer())){return false}parseTokens("o3_",overlib.arguments);if(!postParseChecks()){return false}if(o3_delay==0){return runHook("olMain",FREPLACE)}else{o3_delayid=setTimeout("runHook('olMain', FREPLACE)",o3_delay);return false}}function nd(A){if(olLoaded&&!isExclusive()){hideDelay(A);if(o3_removecounter>=1){o3_showingsticky=0}if(o3_showingsticky==0){o3_allowmove=0;if(over!=null&&o3_timerid==0){runHook("hideObject",FREPLACE,over)}}else{o3_removecounter++}}return true}function cClick(){if(olLoaded){runHook("hideObject",FREPLACE,over);o3_showingsticky=0}return false}function overlib_pagedefaults(){parseTokens("ol_",overlib_pagedefaults.arguments)}function olMain(){var B,A;runHook("olMain",FBEFORE);if(o3_background!=""||o3_fullhtml){B=runHook("ol_content_background",FALTERNATE,o3_css,o3_text,o3_background,o3_fullhtml)}else{A=(pms[o3_css-1-pmStart]=="cssoff"||pms[o3_css-1-pmStart]=="cssclass");if(o3_fgbackground!=""){o3_fgbackground='background="'+o3_fgbackground+'"'}if(o3_bgbackground!=""){o3_bgbackground=(A?'background="'+o3_bgbackground+'"':o3_bgbackground)}if(o3_fgcolor!=""){o3_fgcolor=(A?'bgcolor="'+o3_fgcolor+'"':o3_fgcolor)}if(o3_bgcolor!=""){o3_bgcolor=(A?'bgcolor="'+o3_bgcolor+'"':o3_bgcolor)}if(o3_height>0){o3_height=(A?'height="'+o3_height+'"':o3_height)}else{o3_height=""}if(o3_cap==""){B=runHook("ol_content_simple",FALTERNATE,o3_css,o3_text)}else{if(o3_sticky){B=runHook("ol_content_caption",FALTERNATE,o3_css,o3_text,o3_cap,o3_close)}else{B=runHook("ol_content_caption",FALTERNATE,o3_css,o3_text,o3_cap,"")}}}if(o3_sticky){if(o3_timerid>0){clearTimeout(o3_timerid);o3_timerid=0}o3_showingsticky=1;o3_removecounter=0}if(!runHook("createPopup",FREPLACE,B)){return false}if(o3_autostatus>0){o3_status=o3_text;if(o3_autostatus>1){o3_status=o3_cap}}o3_allowmove=0;if(o3_timeout>0){if(o3_timerid>0){clearTimeout(o3_timerid)}o3_timerid=setTimeout("cClick()",o3_timeout)}runHook("disp",FREPLACE,o3_status);runHook("olMain",FAFTER);return(olOp&&event&&event.type=="mouseover"&&!o3_status)?"":(o3_status!="")}function ol_content_simple(C){var B=/,/.test(o3_cellpad);var A='<table width="'+o3_width+'" border="0" cellpadding="'+o3_border+'" cellspacing="0" '+(o3_bgclass?'class="'+o3_bgclass+'"':o3_bgcolor+" "+o3_height)+'><tr><td><table width="100%" border="0" '+((olNs4||!B)?'cellpadding="'+o3_cellpad+'" ':"")+'cellspacing="0" '+(o3_fgclass?'class="'+o3_fgclass+'"':o3_fgcolor+" "+o3_fgbackground+" "+o3_height)+'><tr><td valign="TOP"'+(o3_textfontclass?' class="'+o3_textfontclass+'">':((!olNs4&&B)?' style="'+setCellPadStr(o3_cellpad)+'">':">"))+(o3_textfontclass?"":wrapStr(0,o3_textsize,"text"))+C+(o3_textfontclass?"":wrapStr(1,o3_textsize))+"</td></tr></table></td></tr></table>";set_background("");return A}function ol_content_caption(H,G,F){var E,B,D=/,/.test(o3_cellpad);var C,A;C="";A="onmouseover";if(o3_closeclick==1){A=(o3_closetitle?"title='"+o3_closetitle+"'":"")+" onclick"}if(o3_capicon!=""){E=' hspace = "5" align = "middle" alt = ""';if(typeof o3_dragimg!="undefined"&&o3_dragimg){E=' hspace="5" name="'+o3_dragimg+'" id="'+o3_dragimg+'" align="middle" alt="Drag Enabled" title="Drag Enabled"'}o3_capicon='<img src="'+o3_capicon+'"'+E+" />"}if(F!=""){C="<td "+(!o3_compatmode&&o3_closefontclass?'class="'+o3_closefontclass:'align="RIGHT')+'"><a href="javascript:return '+fnRef+'cClick();"'+((o3_compatmode&&o3_closefontclass)?' class="'+o3_closefontclass+'" ':" ")+A+'="return '+fnRef+'cClick();">'+(o3_closefontclass?"":wrapStr(0,o3_closesize,"close"))+F+(o3_closefontclass?"":wrapStr(1,o3_closesize,"close"))+"</a></td>"}B='<table width="'+o3_width+'" border="0" cellpadding="'+o3_border+'" cellspacing="0" '+(o3_bgclass?'class="'+o3_bgclass+'"':o3_bgcolor+" "+o3_bgbackground+" "+o3_height)+'><tr><td><table width="100%" border="0" cellpadding="2" cellspacing="0"><tr><td'+(o3_captionfontclass?' class="'+o3_captionfontclass+'">':">")+(o3_captionfontclass?"":"<b>"+wrapStr(0,o3_captionsize,"caption"))+o3_capicon+G+(o3_captionfontclass?"":wrapStr(1,o3_captionsize)+"</b>")+"</td>"+C+'</tr></table><table width="100%" border="0" '+((olNs4||!D)?'cellpadding="'+o3_cellpad+'" ':"")+'cellspacing="0" '+(o3_fgclass?'class="'+o3_fgclass+'"':o3_fgcolor+" "+o3_fgbackground+" "+o3_height)+'><tr><td valign="TOP"'+(o3_textfontclass?' class="'+o3_textfontclass+'">':((!olNs4&&D)?' style="'+setCellPadStr(o3_cellpad)+'">':">"))+(o3_textfontclass?"":wrapStr(0,o3_textsize,"text"))+H+(o3_textfontclass?"":wrapStr(1,o3_textsize))+"</td></tr></table></td></tr></table>";set_background("");return B}function ol_content_background(C,B,A){if(A){txt=C}else{txt='<table width="'+o3_width+'" border="0" cellpadding="0" cellspacing="0" height="'+o3_height+'"><tr><td colspan="3" height="'+o3_padyt+'"></td></tr><tr><td width="'+o3_padxl+'"></td><td valign="TOP" width="'+(o3_width-o3_padxl-o3_padxr)+(o3_textfontclass?'" class="'+o3_textfontclass:"")+'">'+(o3_textfontclass?"":wrapStr(0,o3_textsize,"text"))+C+(o3_textfontclass?"":wrapStr(1,o3_textsize))+'</td><td width="'+o3_padxr+'"></td></tr><tr><td colspan="3" height="'+o3_padyb+'"></td></tr></table>'}set_background(B);return txt}function set_background(A){if(A==""){if(olNs4){over.background.src=null}else{if(over.style){over.style.backgroundImage="none"}}}else{if(olNs4){over.background.src=A}else{if(over.style){over.style.width=o3_width+"px";over.style.backgroundImage="url("+A+")"}}}}var olShowId=-1;function disp(A){runHook("disp",FBEFORE);if(o3_allowmove==0){runHook("placeLayer",FREPLACE);(olNs6&&olShowId<0)?olShowId=setTimeout("runHook('showObject', FREPLACE, over)",1):runHook("showObject",FREPLACE,over);o3_allowmove=(o3_sticky||o3_followmouse==0)?0:1}runHook("disp",FAFTER);if(A!=""){self.status=A}}function createPopup(A){runHook("createPopup",FBEFORE);if(o3_wrap){var C,D,B=(olNs4?over:over.style);B.top=B.left=((olIe4&&!olOp)?0:-10000)+(!olNs4?"px":0);layerWrite(A);C=(olNs4?over.clip.width:over.offsetWidth);if(C>(D=windowWidth())){A=A.replace(/\&nbsp;/g," ");o3_width=D;o3_wrap=0}}layerWrite(A);if(o3_wrap){o3_width=(olNs4?over.clip.width:over.offsetWidth)}runHook("createPopup",FAFTER,A);return true}function placeLayer(){var placeX,placeY,widthFix=0;if(o3_frame.innerWidth){widthFix=18}iwidth=windowWidth();winoffset=(olIe4)?eval("o3_frame."+docRoot+".scrollLeft"):o3_frame.pageXOffset;placeX=runHook("horizontalPlacement",FCHAIN,iwidth,winoffset,widthFix);if(o3_frame.innerHeight){iheight=o3_frame.innerHeight}else{if(eval("o3_frame."+docRoot)&&eval("typeof o3_frame."+docRoot+".clientHeight=='number'")&&eval("o3_frame."+docRoot+".clientHeight")){iheight=eval("o3_frame."+docRoot+".clientHeight")}}scrolloffset=(olIe4)?eval("o3_frame."+docRoot+".scrollTop"):o3_frame.pageYOffset;placeY=runHook("verticalPlacement",FCHAIN,iheight,scrolloffset);repositionTo(over,placeX,placeY)}function olMouseMove(e){var e=(e)?e:event;if(e.pageX){o3_x=e.pageX;o3_y=e.pageY}else{if(e.clientX){o3_x=eval("e.clientX+o3_frame."+docRoot+".scrollLeft");o3_y=eval("e.clientY+o3_frame."+docRoot+".scrollTop")}}if(o3_allowmove==1){runHook("placeLayer",FREPLACE)}if(hoveringSwitch&&!olNs4&&runHook("cursorOff",FREPLACE)){(olHideDelay?hideDelay(olHideDelay):cClick());hoveringSwitch=!hoveringSwitch}}function no_overlib(){return ver3fix}function olMouseCapture(){capExtent=document;var fN,str="",l,k,f,wMv,sS,mseHandler=olMouseMove;var re=/function[ ]*(\w*)\(/;wMv=(!olIe4&&window.onmousemove);if(document.onmousemove||wMv){if(wMv){capExtent=window}f=capExtent.onmousemove.toString();fN=f.match(re);if(fN==null){str=f+"(e); "}else{if(fN[1]=="anonymous"||fN[1]=="olMouseMove"||(wMv&&fN[1]=="onmousemove")){if(!olOp&&wMv){l=f.indexOf("{")+1;k=f.lastIndexOf("}");sS=f.substring(l,k);if((l=sS.indexOf("("))!=-1){sS=sS.substring(0,l).replace(/^\s+/,"").replace(/\s+$/,"");if(eval("typeof "+sS+" == 'undefined'")){window.onmousemove=null}else{str=sS+"(e);"}}}if(!str){olCheckMouseCapture=false;return }}else{if(fN[1]){str=fN[1]+"(e); "}else{l=f.indexOf("{")+1;k=f.lastIndexOf("}");str=f.substring(l,k)+"\n"}}}str+="olMouseMove(e); ";mseHandler=new Function("e",str)}capExtent.onmousemove=mseHandler;if(olNs4){capExtent.captureEvents(Event.MOUSEMOVE)}}function parseTokens(pf,ar){var v,i,mode=-1,par=(pf!="ol_");var fnMark=(par&&!ar.length?1:0);for(i=0;i<ar.length;i++){if(mode<0){if(typeof ar[i]=="number"&&ar[i]>pmStart&&ar[i]<pmUpper){fnMark=(par?1:0);i--}else{switch(pf){case"ol_":ol_text=ar[i].toString();break;default:o3_text=ar[i].toString()}}mode=0}else{if(ar[i]>=pmCount||ar[i]==DONOTHING){continue}if(ar[i]==INARRAY){fnMark=0;eval(pf+"text=ol_texts["+ar[++i]+"].toString()");continue}if(ar[i]==CAPARRAY){eval(pf+"cap=ol_caps["+ar[++i]+"].toString()");continue}if(ar[i]==STICKY){if(pf!="ol_"){eval(pf+"sticky=1")}continue}if(ar[i]==BACKGROUND){eval(pf+'background="'+ar[++i]+'"');continue}if(ar[i]==NOCLOSE){if(pf!="ol_"){opt_NOCLOSE()}continue}if(ar[i]==CAPTION){eval(pf+"cap='"+escSglQuote(ar[++i])+"'");continue}if(ar[i]==CENTER||ar[i]==LEFT||ar[i]==RIGHT){eval(pf+"hpos="+ar[i]);if(pf!="ol_"){olHautoFlag=1}continue}if(ar[i]==OFFSETX){eval(pf+"offsetx="+ar[++i]);continue}if(ar[i]==OFFSETY){eval(pf+"offsety="+ar[++i]);continue}if(ar[i]==FGCOLOR){eval(pf+'fgcolor="'+ar[++i]+'"');continue}if(ar[i]==BGCOLOR){eval(pf+'bgcolor="'+ar[++i]+'"');continue}if(ar[i]==TEXTCOLOR){eval(pf+'textcolor="'+ar[++i]+'"');continue}if(ar[i]==CAPCOLOR){eval(pf+'capcolor="'+ar[++i]+'"');continue}if(ar[i]==CLOSECOLOR){eval(pf+'closecolor="'+ar[++i]+'"');continue}if(ar[i]==WIDTH){eval(pf+"width="+ar[++i]);continue}if(ar[i]==BORDER){eval(pf+"border="+ar[++i]);continue}if(ar[i]==CELLPAD){i=opt_MULTIPLEARGS(++i,ar,(pf+"cellpad"));continue}if(ar[i]==STATUS){eval(pf+"status='"+escSglQuote(ar[++i])+"'");continue}if(ar[i]==AUTOSTATUS){eval(pf+"autostatus=("+pf+"autostatus == 1) ? 0 : 1");continue}if(ar[i]==AUTOSTATUSCAP){eval(pf+"autostatus=("+pf+"autostatus == 2) ? 0 : 2");continue}if(ar[i]==HEIGHT){eval(pf+"height="+pf+"aboveheight="+ar[++i]);continue}if(ar[i]==CLOSETEXT){eval(pf+"close='"+escSglQuote(ar[++i])+"'");continue}if(ar[i]==SNAPX){eval(pf+"snapx="+ar[++i]);continue}if(ar[i]==SNAPY){eval(pf+"snapy="+ar[++i]);continue}if(ar[i]==FIXX){eval(pf+"fixx="+ar[++i]);continue}if(ar[i]==FIXY){eval(pf+"fixy="+ar[++i]);continue}if(ar[i]==RELX){eval(pf+"relx="+ar[++i]);continue}if(ar[i]==RELY){eval(pf+"rely="+ar[++i]);continue}if(ar[i]==FGBACKGROUND){eval(pf+'fgbackground="'+ar[++i]+'"');continue}if(ar[i]==BGBACKGROUND){eval(pf+'bgbackground="'+ar[++i]+'"');continue}if(ar[i]==PADX){eval(pf+"padxl="+ar[++i]);eval(pf+"padxr="+ar[++i]);continue}if(ar[i]==PADY){eval(pf+"padyt="+ar[++i]);eval(pf+"padyb="+ar[++i]);continue}if(ar[i]==FULLHTML){if(pf!="ol_"){eval(pf+"fullhtml=1")}continue}if(ar[i]==BELOW||ar[i]==ABOVE){eval(pf+"vpos="+ar[i]);if(pf!="ol_"){olVautoFlag=1}continue}if(ar[i]==CAPICON){eval(pf+'capicon="'+ar[++i]+'"');continue}if(ar[i]==TEXTFONT){eval(pf+"textfont='"+escSglQuote(ar[++i])+"'");continue}if(ar[i]==CAPTIONFONT){eval(pf+"captionfont='"+escSglQuote(ar[++i])+"'");continue}if(ar[i]==CLOSEFONT){eval(pf+"closefont='"+escSglQuote(ar[++i])+"'");continue}if(ar[i]==TEXTSIZE){eval(pf+'textsize="'+ar[++i]+'"');continue}if(ar[i]==CAPTIONSIZE){eval(pf+'captionsize="'+ar[++i]+'"');continue}if(ar[i]==CLOSESIZE){eval(pf+'closesize="'+ar[++i]+'"');continue}if(ar[i]==TIMEOUT){eval(pf+"timeout="+ar[++i]);continue}if(ar[i]==FUNCTION){if(pf=="ol_"){if(typeof ar[i+1]!="number"){v=ar[++i];ol_function=(typeof v=="function"?v:null)}}else{fnMark=0;v=null;if(typeof ar[i+1]!="number"){v=ar[++i]}opt_FUNCTION(v)}continue}if(ar[i]==DELAY){eval(pf+"delay="+ar[++i]);continue}if(ar[i]==HAUTO){eval(pf+"hauto=("+pf+"hauto == 0) ? 1 : 0");continue}if(ar[i]==VAUTO){eval(pf+"vauto=("+pf+"vauto == 0) ? 1 : 0");continue}if(ar[i]==CLOSECLICK){eval(pf+"closeclick=("+pf+"closeclick == 0) ? 1 : 0");continue}if(ar[i]==WRAP){eval(pf+"wrap=("+pf+"wrap == 0) ? 1 : 0");continue}if(ar[i]==FOLLOWMOUSE){eval(pf+"followmouse=("+pf+"followmouse == 1) ? 0 : 1");continue}if(ar[i]==MOUSEOFF){eval(pf+"mouseoff=("+pf+"mouseoff==0) ? 1 : 0");v=ar[i+1];if(pf!="ol_"&&eval(pf+"mouseoff")&&typeof v=="number"&&(v<pmStart||v>pmUpper)){olHideDelay=ar[++i]}continue}if(ar[i]==CLOSETITLE){eval(pf+"closetitle='"+escSglQuote(ar[++i])+"'");continue}if(ar[i]==CSSOFF||ar[i]==CSSCLASS){eval(pf+"css="+ar[i]);continue}if(ar[i]==COMPATMODE){eval(pf+"compatmode=("+pf+"compatmode==0) ? 1 : 0");continue}if(ar[i]==FGCLASS){eval(pf+'fgclass="'+ar[++i]+'"');continue}if(ar[i]==BGCLASS){eval(pf+'bgclass="'+ar[++i]+'"');continue}if(ar[i]==TEXTFONTCLASS){eval(pf+'textfontclass="'+ar[++i]+'"');continue}if(ar[i]==CAPTIONFONTCLASS){eval(pf+'captionfontclass="'+ar[++i]+'"');continue}if(ar[i]==CLOSEFONTCLASS){eval(pf+'closefontclass="'+ar[++i]+'"');continue}i=parseCmdLine(pf,i,ar)}}if(fnMark&&o3_function){o3_text=o3_function()}if((pf=="o3_")&&o3_wrap){o3_width=0;var tReg=/<.*\n*>/ig;if(!tReg.test(o3_text)){o3_text=o3_text.replace(/[ ]+/g,"&nbsp;")}if(!tReg.test(o3_cap)){o3_cap=o3_cap.replace(/[ ]+/g,"&nbsp;")}}if((pf=="o3_")&&o3_sticky){if(!o3_close&&(o3_frame!=ol_frame)){o3_close=ol_close}if(o3_mouseoff&&(o3_frame==ol_frame)){opt_NOCLOSE(" ")}}}function layerWrite(A){A+="\n";if(olNs4){var B=o3_frame.document.layers.overDiv.document;B.write(A);B.close()}else{if(typeof over.innerHTML!="undefined"){if(olIe5&&isMac){over.innerHTML=""}over.innerHTML=A}else{range=o3_frame.document.createRange();range.setStartAfter(over);domfrag=range.createContextualFragment(A);while(over.hasChildNodes()){over.removeChild(over.lastChild)}over.appendChild(domfrag)}}}function showObject(B){runHook("showObject",FBEFORE);var A=(olNs4?B:B.style);A.visibility="visible";runHook("showObject",FAFTER)}function hideObject(B){runHook("hideObject",FBEFORE);var A=(olNs4?B:B.style);if(olNs6&&olShowId>0){clearTimeout(olShowId);olShowId=0}A.visibility="hidden";A.top=A.left=((olIe4&&!olOp)?0:-10000)+(!olNs4?"px":0);if(o3_timerid>0){clearTimeout(o3_timerid)}if(o3_delayid>0){clearTimeout(o3_delayid)}o3_timerid=0;o3_delayid=0;self.status="";if(B.onmouseout||B.onmouseover){if(olNs4){B.releaseEvents(Event.MOUSEOUT||Event.MOUSEOVER)}B.onmouseout=B.onmouseover=null}runHook("hideObject",FAFTER)}function repositionTo(C,D,A){var B=(olNs4?C:C.style);B.left=D+(!olNs4?"px":0);B.top=A+(!olNs4?"px":0)}function cursorOff(){var D=parseInt(over.style.left);var C=parseInt(over.style.top);var B=D+(over.offsetWidth>=parseInt(o3_width)?over.offsetWidth:parseInt(o3_width));var A=C+(over.offsetHeight>=o3_aboveheight?over.offsetHeight:o3_aboveheight);if(o3_x<D||o3_x>B||o3_y<C||o3_y>A){return true}return false}function opt_FUNCTION(callme){o3_text=(callme?(typeof callme=="string"?(/.+\(.*\)/.test(callme)?eval(callme):callme):callme()):(o3_function?o3_function():"No Function"));return 0}function opt_NOCLOSE(A){if(!A){o3_close=""}if(olNs4){over.captureEvents(Event.MOUSEOUT||Event.MOUSEOVER);over.onmouseover=function(){if(o3_timerid>0){clearTimeout(o3_timerid);o3_timerid=0}};over.onmouseout=function(B){if(olHideDelay){hideDelay(olHideDelay)}else{cClick(B)}}}else{over.onmouseover=function(){hoveringSwitch=true;if(o3_timerid>0){clearTimeout(o3_timerid);o3_timerid=0}}}return 0}function opt_MULTIPLEARGS(i,args,parameter){var k=i,re,pV,str="";for(k=i;k<args.length;k++){if(typeof args[k]=="number"&&args[k]>pmStart){break}str+=args[k]+","}if(str){str=str.substring(0,--str.length)}k--;pV=(olNs4&&/cellpad/i.test(parameter))?str.split(",")[0]:str;eval(parameter+'="'+pV+'"');return k}function nbspCleanup(){if(o3_wrap){o3_text=o3_text.replace(/\&nbsp;/g," ");o3_cap=o3_cap.replace(/\&nbsp;/g," ")}}function escSglQuote(A){return A.toString().replace(/'/g,"\\'")}function OLonLoad_handler(e){var re=/\w+\(.*\)[;\s]+/g,olre=/overlib\(|nd\(|cClick\(/,fn,l,i;if(!olLoaded){olLoaded=1}if(window.removeEventListener&&e.eventPhase==3){window.removeEventListener("load",OLonLoad_handler,false)}else{if(window.detachEvent){window.detachEvent("onload",OLonLoad_handler);var fN=document.body.getAttribute("onload");if(fN){fN=fN.toString().match(re);if(fN&&fN.length){for(i=0;i<fN.length;i++){if(/anonymous/.test(fN[i])){continue}while((l=fN[i].search(/\)[;\s]+/))!=-1){fn=fN[i].substring(0,l+1);fN[i]=fN[i].substring(l+2);if(olre.test(fn)){eval(fn)}}}}}}}}function wrapStr(endWrap,fontSizeStr,whichString){var fontStr,fontColor,isClose=((whichString=="close")?1:0),hasDims=/[%\-a-z]+$/.test(fontSizeStr);fontSizeStr=(olNs4)?(!hasDims?fontSizeStr:"1"):fontSizeStr;if(endWrap){return(hasDims&&!olNs4)?(isClose?"</span>":"</div>"):"</font>"}else{fontStr="o3_"+whichString+"font";fontColor="o3_"+((whichString=="caption")?"cap":whichString)+"color";return(hasDims&&!olNs4)?(isClose?'<span style="font-family: '+quoteMultiNameFonts(eval(fontStr))+"; color: "+eval(fontColor)+"; font-size: "+fontSizeStr+';">':'<div style="font-family: '+quoteMultiNameFonts(eval(fontStr))+"; color: "+eval(fontColor)+"; font-size: "+fontSizeStr+';">'):'<font face="'+eval(fontStr)+'" color="'+eval(fontColor)+'" size="'+(parseInt(fontSizeStr)>7?"7":fontSizeStr)+'">'}}function quoteMultiNameFonts(D){var A,B=D.split(",");for(var C=0;C<B.length;C++){A=B[C];A=A.replace(/^\s+/,"").replace(/\s+$/,"");if(/\s/.test(A)&&!/['"]/.test(A)){A="'"+A+"'";B[C]=A}}return B.join()}function isExclusive(A){return false}function setCellPadStr(H){var E="",B=0,D=new Array(),G,A,F,C;E+="padding: ";D=H.replace(/\s+/g,"").split(",");switch(D.length){case 2:G=A=D[B];F=C=D[++B];break;case 3:G=D[B];F=C=D[++B];A=D[++B];break;case 4:G=D[B];C=D[++B];A=D[++B];F=D[++B];break}E+=((D.length==1)?D[0]+"px;":G+"px "+C+"px "+A+"px "+F+"px;");return E}function hideDelay(A){if(A&&!o3_delay){if(o3_timerid>0){clearTimeout(o3_timerid)}o3_timerid=setTimeout("cClick()",(o3_timeout=A))}}function horizontalPlacement(G,H,D){var F,B=G,C=H;var A=parseInt(o3_width);if(o3_fixx>-1||o3_relx!=null){F=(o3_relx!=null?(o3_relx<0?C+o3_relx+B-A-D:C+o3_relx):o3_fixx)}else{if(o3_hauto==1){if((o3_x-C)>(B/2)){o3_hpos=LEFT}else{o3_hpos=RIGHT}}if(o3_hpos==CENTER){F=o3_x+o3_offsetx-(A/2);if(F<C){F=C}}if(o3_hpos==RIGHT){F=o3_x+o3_offsetx;if((F+A)>(C+B-D)){F=B+C-A-D;if(F<0){F=0}}}if(o3_hpos==LEFT){F=o3_x-o3_offsetx-A;if(F<C){F=C}}if(o3_snapx>1){var E=F%o3_snapx;if(o3_hpos==LEFT){F=F-(o3_snapx+E)}else{F=F+(o3_snapx-E)}if(F<C){F=C}}}return F}function verticalPlacement(B,A){var F,G=B,C=A;var E=(o3_aboveheight?parseInt(o3_aboveheight):(olNs4?over.clip.height:over.offsetHeight));if(o3_fixy>-1||o3_rely!=null){F=(o3_rely!=null?(o3_rely<0?C+o3_rely+G-E:C+o3_rely):o3_fixy)}else{if(o3_vauto==1){if((o3_y-C)>(G/2)&&o3_vpos==BELOW&&(o3_y+E+o3_offsety-(C+G)>0)){o3_vpos=ABOVE}else{if(o3_vpos==ABOVE&&(o3_y-(E+o3_offsety)-C<0)){o3_vpos=BELOW}}}if(o3_vpos==ABOVE){if(o3_aboveheight==0){o3_aboveheight=E}F=o3_y-(o3_aboveheight+o3_offsety);if(F<C){F=C}}else{F=o3_y+o3_offsety}if(o3_snapy>1){var D=F%o3_snapy;if(o3_aboveheight>0&&o3_vpos==ABOVE){F=F-(o3_snapy+D)}else{F=F+(o3_snapy-D)}if(F<C){F=C}}}return F}function checkPositionFlags(){if(olHautoFlag){olHautoFlag=o3_hauto=0}if(olVautoFlag){olVautoFlag=o3_vauto=0}return true}function windowWidth(){var w;if(o3_frame.innerWidth){w=o3_frame.innerWidth}else{if(eval("o3_frame."+docRoot)&&eval("typeof o3_frame."+docRoot+".clientWidth=='number'")&&eval("o3_frame."+docRoot+".clientWidth")){w=eval("o3_frame."+docRoot+".clientWidth")}}return w}function createDivContainer(F,D,C){F=(F||"overDiv"),D=(D||o3_frame),C=(C||1000);var E,B=layerReference(F);if(B==null){if(olNs4){B=D.document.layers[F]=new Layer(window.innerWidth,D);E=B}else{var A=(olIe4?D.document.all.tags("BODY")[0]:D.document.getElementsByTagName("BODY")[0]);if(olIe4&&!document.getElementById){A.insertAdjacentHTML("beforeEnd",'<div id="'+F+'"></div>');B=layerReference(F)}else{B=D.document.createElement("DIV");B.id=F;A.appendChild(B)}E=B.style}E.position="absolute";E.visibility="hidden";E.zIndex=C;if(olIe4&&!olOp){E.left=E.top="0px"}else{E.left=E.top=-10000+(!olNs4?"px":0)}}return B}function layerReference(A){return(olNs4?o3_frame.document.layers[A]:(document.all?o3_frame.document.all[A]:o3_frame.document.getElementById(A)))}function isFunction(C){var B=true;if(typeof C=="object"){for(var A=0;A<C.length;A++){if(typeof C[A]=="function"){continue}B=false;break}}else{if(typeof C!="function"){B=false}}return B}function argToString(G,B,F){var E=B,A="",D=G;F=(F?F:"ar");if(D.length>E){for(var C=E;C<D.length;C++){A+=F+"["+C+"], "}A=A.substring(0,A.length-2)}return A}function reOrder(B,G,A){var C=new Array(),E,F,D;if(!A||typeof A=="undefined"||typeof A=="number"){return B}if(typeof A=="function"){if(typeof G=="object"){C=C.concat(G)}else{C[C.length++]=G}for(F=0;F<B.length;F++){E=false;if(typeof G=="function"&&B[F]==G){continue}else{for(D=0;D<G.length;D++){if(B[F]==G[D]){E=true;break}}}if(!E){C[C.length++]=B[F]}}C[C.length++]=A}else{if(typeof A=="object"){if(typeof G=="object"){C=C.concat(G)}else{C[C.length++]=G}for(D=0;D<B.length;D++){E=false;if(typeof G=="function"&&B[D]==G){continue}else{for(F=0;F<G.length;F++){if(B[D]==G[F]){E=true;break}}}if(!E){C[C.length++]=B[D]}}for(F=0;F<C.length;F++){B[F]=C[F]}C.length=0;for(D=0;D<B.length;D++){E=false;for(F=0;F<A.length;F++){if(B[D]==A[F]){E=true;break}}if(!E){C[C.length++]=B[D]}}C=C.concat(A)}}B=C;return B}function setRunTimeVariables(){if(typeof runTime!="undefined"&&runTime.length){for(var A=0;A<runTime.length;A++){runTime[A]()}}}function parseCmdLine(A,E,D){if(typeof cmdLine!="undefined"&&cmdLine.length){for(var B=0;B<cmdLine.length;B++){var C=cmdLine[B](A,E,D);if(C>-1){E=C;break}}}return E}function postParseChecks(A,C){if(typeof postParse!="undefined"&&postParse.length){for(var B=0;B<postParse.length;B++){if(postParse[B](A,C)){continue}return false}}return true}function registerCommands(cmdStr){if(typeof cmdStr!="string"){return }var pM=cmdStr.split(",");pms=pms.concat(pM);for(var i=0;i<pM.length;i++){eval(pM[i].toUpperCase()+"="+pmCount++)}}function registerNoParameterCommands(A){if(!A&&typeof A!="string"){return }pmt=(!pmt)?A:pmt+","+A}function registerHook(F,E,D,B){var A,C=typeof B;if(F=="plgIn"||F=="postParse"){return }if(typeof hookPts[F]=="undefined"){hookPts[F]=new FunctionReference()}A=hookPts[F];if(D!=null){if(D==FREPLACE){A.ovload=E;if(F.indexOf("ol_content_")>-1){A.alt[pms[CSSOFF-1-pmStart]]=E}}else{if(D==FBEFORE||D==FAFTER){var A=(D==1?A.before:A.after);if(typeof E=="object"){A=A.concat(E)}else{A[A.length++]=E}if(B){A=reOrder(A,E,B)}}else{if(D==FALTERNATE){if(C=="number"){A.alt[pms[B-1-pmStart]]=E}}else{if(D==FCHAIN){A=A.chain;if(typeof E=="object"){A=A.concat(E)}else{A[A.length++]=E}}}}}return }}function registerRunTimeFunction(A){if(isFunction(A)){if(typeof A=="object"){runTime=runTime.concat(A)}else{runTime[runTime.length++]=A}}}function registerCmdLineFunction(A){if(isFunction(A)){if(typeof A=="object"){cmdLine=cmdLine.concat(A)}else{cmdLine[cmdLine.length++]=A}}}function registerPostParseFunction(A){if(isFunction(A)){if(typeof A=="object"){postParse=postParse.concat(A)}else{postParse[postParse.length++]=A}}}function runHook(fnHookTo,hookType){var l=hookPts[fnHookTo],k,rtnVal=null,optPm,arS,ar=runHook.arguments;if(hookType==FREPLACE){arS=argToString(ar,2);if(typeof l=="undefined"||!(l=l.ovload)){rtnVal=eval(fnHookTo+"("+arS+")")}else{rtnVal=eval("l("+arS+")")}}else{if(hookType==FBEFORE||hookType==FAFTER){if(typeof l!="undefined"){l=(hookType==1?l.before:l.after);if(l.length){arS=argToString(ar,2);for(var k=0;k<l.length;k++){eval("l[k]("+arS+")")}}}}else{if(hookType==FALTERNATE){optPm=ar[2];arS=argToString(ar,3);if(typeof l=="undefined"||(l=l.alt[pms[optPm-1-pmStart]])=="undefined"){rtnVal=eval(fnHookTo+"("+arS+")")}else{rtnVal=eval("l("+arS+")")}}else{if(hookType==FCHAIN){arS=argToString(ar,2);l=l.chain;for(k=l.length;k>0;k--){if((rtnVal=eval("l[k-1]("+arS+")"))!=void (0)){break}}}}}}return rtnVal}function FunctionReference(){this.ovload=null;this.before=new Array();this.after=new Array();this.alt=new Array();this.chain=new Array()}function Info(A,B){this.version=A;this.prerelease=B;this.simpleversion=Math.round(this.version*100);this.major=parseInt(this.simpleversion/100);this.minor=parseInt(this.simpleversion/10)-this.major*10;this.revision=parseInt(this.simpleversion)-this.major*100-this.minor*10;this.meets=meets}function meets(A){return(!A)?false:this.simpleversion>=Math.round(100*parseFloat(A))}registerHook("ol_content_simple",ol_content_simple,FALTERNATE,CSSOFF);registerHook("ol_content_caption",ol_content_caption,FALTERNATE,CSSOFF);registerHook("ol_content_background",ol_content_background,FALTERNATE,CSSOFF);registerHook("ol_content_simple",ol_content_simple,FALTERNATE,CSSCLASS);registerHook("ol_content_caption",ol_content_caption,FALTERNATE,CSSCLASS);registerHook("ol_content_background",ol_content_background,FALTERNATE,CSSCLASS);registerPostParseFunction(checkPositionFlags);registerHook("hideObject",nbspCleanup,FAFTER);registerHook("horizontalPlacement",horizontalPlacement,FCHAIN);registerHook("verticalPlacement",verticalPlacement,FCHAIN);if(olNs4||(olIe5&&isMac)||olKq){olLoaded=1}registerNoParameterCommands("sticky,autostatus,autostatuscap,fullhtml,hauto,vauto,closeclick,wrap,followmouse,mouseoff,compatmode");var olCheckMouseCapture=true;if((olNs4||olNs6||olIe4)){olMouseCapture()}else{overlib=no_overlib;nd=no_overlib;ver3fix=true};
// #### vbulletin_global.js
if(!window.console||!console.firebug){window.console={};var names=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];for(var i=0;i<names.length;++i){window.console[names[i]]=function(){}}}var SESSIONURL=(typeof (SESSIONURL)=="undefined"?"":SESSIONURL);var SECURITYTOKEN=(typeof (SECURITYTOKEN)=="undefined"?"":SECURITYTOKEN);var vbphrase=(typeof (vbphrase)=="undefined"?new Array():vbphrase);var vB_Editor=new Array();var ignorequotechars=false;var pagenavcounter=0;var is_regexp=(window.RegExp)?true:false;var AJAX_Compatible=false;var pointer_cursor=(is_ie?"hand":"pointer");var viewport_info=null;var vB_Default_Timeout=15000;var userAgent=navigator.userAgent.toLowerCase();var is_opera=((userAgent.indexOf("opera")!=-1)||(typeof (window.opera)!="undefined"));var is_saf=((userAgent.indexOf("applewebkit")!=-1)||(navigator.vendor=="Apple Computer, Inc."));var is_webtv=(userAgent.indexOf("webtv")!=-1);var is_ie=((userAgent.indexOf("msie")!=-1)&&(!is_opera)&&(!is_saf)&&(!is_webtv));var is_ie4=((is_ie)&&(userAgent.indexOf("msie 4.")!=-1));var is_ie7=((is_ie)&&(userAgent.indexOf("msie 7.")!=-1));var is_ps3=(userAgent.indexOf("playstation 3")!=-1);var is_moz=((navigator.product=="Gecko")&&(!is_saf));var is_kon=(userAgent.indexOf("konqueror")!=-1);var is_ns=((userAgent.indexOf("compatible")==-1)&&(userAgent.indexOf("mozilla")!=-1)&&(!is_opera)&&(!is_webtv)&&(!is_saf));var is_ns4=((is_ns)&&(parseInt(navigator.appVersion)==4));var is_mac=(userAgent.indexOf("mac")!=-1);String.prototype.vBlength=function(){return(is_ie&&this.indexOf("\n")!=-1)?this.replace(/\r?\n/g,"_").length:this.length};if("1234".substr(-2,2)=="12"){String.prototype.substr_orig=String.prototype.substr;String.prototype.substr=function(B,A){if(typeof (A)=="undefined"){return this.substr_orig((B<0?this.length+B:B))}else{return this.substr_orig((B<0?this.length+B:B),A)}}}if(typeof Array.prototype.shift==="undefined"){Array.prototype.shift=function(){for(var C=0,A=this[0],B=this.length-1;C<B;C++){this[C]=this[C+1]}this.length--;return A}}function fetch_object(A){if(document.getElementById){return document.getElementById(A)}else{if(document.all){return document.all[A]}else{if(document.layers){return document.layers[A]}else{return null}}}}function fetch_tags(B,A){if(B==null){return new Array()}else{if(typeof B.getElementsByTagName!="undefined"){return B.getElementsByTagName(A)}else{if(B.all&&B.all.tags){return B.all.tags(A)}else{return new Array()}}}}function fetch_tag_count(B,A){return fetch_tags(B,A).length}function do_an_e(A){if(!A||is_ie){window.event.returnValue=false;window.event.cancelBubble=true;return window.event}else{A.stopPropagation();A.preventDefault();return A}}function e_by_gum(A){if(!A||is_ie){window.event.cancelBubble=true;return window.event}else{if(A.target.type=="submit"){A.target.form.submit()}A.stopPropagation();return A}}function validatemessage(B,D,A){if(is_kon||is_saf||is_webtv){return true}else{if(D.length<1){alert(vbphrase.must_enter_subject);return false}else{var C=PHP.trim(stripcode(B,false,ignorequotechars));if(C.length<A){alert(construct_phrase(vbphrase.message_too_short,A));return false}else{if(typeof (document.forms.vbform)!="undefined"&&typeof (document.forms.vbform.imagestamp)!="undefined"){document.forms.vbform.imagestamp.failed=false;if(document.forms.vbform.imagestamp.value.length!=6){alert(vbphrase.complete_image_verification);document.forms.vbform.imagestamp.failed=true;document.forms.vbform.imagestamp.focus();return false}else{return true}}else{return true}}}}}function stripcode(F,G,B){if(!is_regexp){return F}if(B){var C=new Date().getTime();while((startindex=PHP.stripos(F,"[quote"))!==false){if(new Date().getTime()-C>2000){break}if((stopindex=PHP.stripos(F,"[/quote]"))!==false){fragment=F.substr(startindex,stopindex-startindex+8);F=F.replace(fragment,"")}else{break}F=PHP.trim(F)}}if(G){F=F.replace(/<img[^>]+src="([^"]+)"[^>]*>/gi,"$1");var H=new RegExp("<(\\w+)[^>]*>","gi");var E=new RegExp("<\\/\\w+>","gi");F=F.replace(H,"");F=F.replace(E,"");var D=new RegExp("(&nbsp;)","gi");F=F.replace(D," ")}else{var A=new RegExp("\\[(\\w+)(=[^\\]]*)?\\]","gi");var I=new RegExp("\\[\\/(\\w+)\\]","gi");F=F.replace(A,"");F=F.replace(I,"")}return F}function vB_PHP_Emulator(){}vB_PHP_Emulator.prototype.stripos=function(A,B,C){if(typeof C=="undefined"){C=0}index=A.toLowerCase().indexOf(B.toLowerCase(),C);return(index==-1?false:index)};vB_PHP_Emulator.prototype.ltrim=function(A){return A.replace(/^\s+/g,"")};vB_PHP_Emulator.prototype.rtrim=function(A){return A.replace(/(\s+)$/g,"")};vB_PHP_Emulator.prototype.trim=function(A){return this.ltrim(this.rtrim(A))};vB_PHP_Emulator.prototype.preg_quote=function(A){return A.replace(/(\+|\{|\}|\(|\)|\[|\]|\||\/|\?|\^|\$|\\|\.|\=|\!|\<|\>|\:|\*)/g,"\\$1")};vB_PHP_Emulator.prototype.match_all=function(C,E){var A=C.match(RegExp(E,"gim"));if(A){var F=new Array();var B=new RegExp(E,"im");for(var D=0;D<A.length;D++){F[F.length]=A[D].match(B)}return F}else{return false}};vB_PHP_Emulator.prototype.unhtmlspecialchars=function(D){var C=new Array(/&lt;/g,/&gt;/g,/&quot;/g,/&amp;/g);var B=new Array("<",">",'"',"&");for(var A in C){if(YAHOO.lang.hasOwnProperty(C,A)){D=D.replace(C[A],B[A])}}return D};vB_PHP_Emulator.prototype.unescape_cdata=function(C){var B=/<\=\!\=\[\=C\=D\=A\=T\=A\=\[/g;var A=/\]\=\]\=>/g;return C.replace(B,"<![CDATA[").replace(A,"]]>")};vB_PHP_Emulator.prototype.htmlspecialchars=function(D){var C=new Array((is_mac&&is_ie?new RegExp("&","g"):new RegExp("&(?!#[0-9]+;)","g")),new RegExp("<","g"),new RegExp(">","g"),new RegExp('"',"g"));var B=new Array("&amp;","&lt;","&gt;","&quot;");for(var A=0;A<C.length;A++){D=D.replace(C[A],B[A])}return D};vB_PHP_Emulator.prototype.in_array=function(D,C,B){var E=new String(D);var A;if(B){E=E.toLowerCase();for(A in C){if(YAHOO.lang.hasOwnProperty(C,A)){if(C[A].toLowerCase()==E){return A}}}}else{for(A in C){if(YAHOO.lang.hasOwnProperty(C,A)){if(C[A]==E){return A}}}}return -1};vB_PHP_Emulator.prototype.str_pad=function(C,A,B){C=new String(C);B=new String(B);if(C.length<A){padtext=new String(B);while(padtext.length<(A-C.length)){padtext+=B}C=padtext.substr(0,(A-C.length))+C}return C};vB_PHP_Emulator.prototype.urlencode=function(D){D=escape(D.toString()).replace(/\+/g,"%2B");var B=D.match(/(%([0-9A-F]{2}))/gi);if(B){for(var C=0;C<B.length;C++){var A=B[C].substring(1,3);if(parseInt(A,16)>=128){D=D.replace(B[C],"%u00"+A)}}}D=D.replace("%25","%u0025");return D};vB_PHP_Emulator.prototype.ucfirst=function(D,A){if(typeof A!="undefined"){var B=D.indexOf(A);if(B>0){D=D.substr(0,B)}}D=D.split(" ");for(var C=0;C<D.length;C++){D[C]=D[C].substr(0,1).toUpperCase()+D[C].substr(1)}return D.join(" ")};function vB_AJAX_Handler(A){this.async=A?true:false;this.conn=null}vB_AJAX_Handler.prototype.init=function(){return AJAX_Compatible};vB_AJAX_Handler.is_compatible=function(){return AJAX_Compatible};vB_AJAX_Handler.prototype.onreadystatechange=function(A){this.callback=A};vB_AJAX_Handler.prototype.fetch_data=function(A){console.warn('vB_AJAX_Handler.prototype.fetch_data() is deprecated.\nUse responseXML.getElementsByTagName("x")[i].firstChild.nodeValue instead.');if(A&&A.firstChild&&A.firstChild.nodeValue){return PHP.unescape_cdata(A.firstChild.nodeValue)}else{return""}};vB_AJAX_Handler.prototype.send=function(A,B){this.conn=YAHOO.util.Connect.asyncRequest("POST",A,{success:this.callback},B+"&securitytoken="+SECURITYTOKEN+"&s="+fetch_sessionhash());this.handler=this.conn.conn};function is_ajax_compatible(){if(typeof vb_disable_ajax!="undefined"&&vb_disable_ajax==2){return false}else{if(is_ie&&!is_ie4){return true}else{if(window.XMLHttpRequest){try{var A=new XMLHttpRequest();return A.setRequestHeader?true:false}catch(B){return false}}else{return false}}}}AJAX_Compatible=is_ajax_compatible();console.info("This browser is%s AJAX compatible",AJAX_Compatible?"":" NOT");function vBulletin_AJAX_Error_Handler(A){console.warn("AJAX Error: Status = %s: %s",A.status,A.statusText)}function vB_Hidden_Form(A){this.action=A;this.variables=new Array()}vB_Hidden_Form.prototype.add_variable=function(A,B){this.variables[this.variables.length]=new Array(A,B);console.log("vB_Hidden_Form :: add_variable(%s)",A)};vB_Hidden_Form.prototype.add_variables_from_object=function(F){if(!F){return }console.info("vB_Hidden_Form :: add_variables_from_object(%s)",F.id);var B=fetch_tags(F,"input");var E;for(E=0;E<B.length;E++){switch(B[E].type){case"checkbox":case"radio":if(B[E].checked){this.add_variable(B[E].name,B[E].value)}break;case"text":case"hidden":case"password":this.add_variable(B[E].name,B[E].value);break;default:continue}}var A=fetch_tags(F,"textarea");for(E=0;E<A.length;E++){this.add_variable(A[E].name,A[E].value)}var D=fetch_tags(F,"select");for(E=0;E<D.length;E++){if(D[E].multiple){for(var C=0;C<D[E].options.length;C++){if(D[E].options[C].selected){this.add_variable(D[E].name,D[E].options[C].value)}}}else{this.add_variable(D[E].name,D[E].options[D[E].selectedIndex].value)}}};vB_Hidden_Form.prototype.fetch_variable=function(A){for(var B=0;B<this.variables.length;B++){if(this.variables[B][0]==A){return this.variables[B][1]}}return null};vB_Hidden_Form.prototype.submit_form=function(){this.form=document.createElement("form");this.form.method="post";this.form.action=this.action;for(var A=0;A<this.variables.length;A++){var B=document.createElement("input");B.type="hidden";B.name=this.variables[A][0];B.value=this.variables[A][1];this.form.appendChild(B)}console.info("vB_Hidden_Form :: submit_form() -> %s",this.action);document.body.appendChild(this.form).submit()};vB_Hidden_Form.prototype.build_query_string=function(){var B="";for(var A=0;A<this.variables.length;A++){B+=this.variables[A][0]+"="+PHP.urlencode(this.variables[A][1])+"&"}console.info("vB_Hidden_Form :: Query String = %s",B);return B};vB_Hidden_Form.prototype.add_input=vB_Hidden_Form.prototype.add_variable;vB_Hidden_Form.prototype.add_inputs_from_object=vB_Hidden_Form.prototype.add_variables_from_object;function vB_Select_Overlay_Handler(A){this.browser_affected=(is_ie&&!is_ie7);if(this.browser_affected){this.overlay=YAHOO.util.Dom.get(A);this.hidden_selects=new Array();console.log("Initializing <select> overlay handler for '%s'.",this.overlay.id)}}vB_Select_Overlay_Handler.prototype.hide=function(){if(this.browser_affected){var C=YAHOO.util.Dom.getRegion(this.overlay);var B=document.getElementsByTagName("select");for(var A=0;A<B.length;A++){if(region_intersects(B[A],C)){if(YAHOO.util.Dom.isAncestor(this.overlay,B[A])){continue}else{YAHOO.util.Dom.setStyle(B[A],"visibility","hidden");this.hidden_selects.push(YAHOO.util.Dom.generateId(B[A]))}}}}};vB_Select_Overlay_Handler.prototype.show=function(){if(this.browser_affected){var A;while(A=this.hidden_selects.pop()){YAHOO.util.Dom.setStyle(A,"visibility","visible")}}};function openWindow(C,D,B,A){return window.open(C,(typeof A=="undefined"?"vBPopup":A),"statusbar=no,menubar=no,toolbar=no,scrollbars=yes,resizable=yes"+(typeof D!="undefined"?(",width="+D):"")+(typeof B!="undefined"?(",height="+B):""))}function js_open_help(B,C,A){return openWindow("help.php?s="+SESSIONHASH+"&do=answer&page="+B+"&pageaction="+C+"&option="+A,600,450,"helpwindow")}function attachments(A){return openWindow("misc.php?"+SESSIONURL+"do=showattachments&t="+A,480,300)}function who(A){return openWindow("misc.php?"+SESSIONURL+"do=whoposted&t="+A,230,300)}function imwindow(D,B,C,A){return openWindow("sendmessage.php?"+SESSIONURL+"do=im&type="+D+"&u="+B,C,A)}function SendMSNMessage(A){if(!is_ie){alert(vbphrase.msn_functions_only_work_in_ie);return false}else{MsgrObj.InstantMessage(A);return false}}function AddMSNContact(A){if(!is_ie){alert(vbphrase.msn_functions_only_work_in_ie);return false}else{MsgrObj.AddContact(0,A);return false}}function detect_caps_lock(D){D=(D?D:window.event);var A=(D.which?D.which:(D.keyCode?D.keyCode:(D.charCode?D.charCode:0)));var C=(D.shiftKey||(D.modifiers&&(D.modifiers&4)));var B=(D.ctrlKey||(D.modifiers&&(D.modifiers&2)));return(A>=65&&A<=90&&!C&&!B)||(A>=97&&A<=122&&C)}function log_out(B){var A=document.getElementsByTagName("html")[0];A.style.filter="progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";if(confirm(B)){return true}else{A.style.filter="";return false}}function set_cookie(B,C,A){console.log("Set Cookie :: %s = '%s'",B,C);document.cookie=B+"="+escape(C)+"; path=/"+(typeof A!="undefined"?"; expires="+A.toGMTString():"")}function delete_cookie(A){console.log("Delete Cookie :: %s",A);document.cookie=A+"=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/"}function fetch_cookie(A){cookie_name=A+"=";cookie_length=document.cookie.length;cookie_begin=0;while(cookie_begin<cookie_length){value_begin=cookie_begin+cookie_name.length;if(document.cookie.substring(cookie_begin,value_begin)==cookie_name){var C=document.cookie.indexOf(";",value_begin);if(C==-1){C=cookie_length}var B=unescape(document.cookie.substring(value_begin,C));console.log("Fetch Cookie :: %s = '%s'",A,B);return B}cookie_begin=document.cookie.indexOf(" ",cookie_begin)+1;if(cookie_begin==0){break}}console.log("Fetch Cookie :: %s (null)",A);return null}function js_toggle_all(D,E,C,A,G){for(var B=0;B<D.elements.length;B++){var F=D.elements[B];if(F.type==E&&PHP.in_array(F.name,A,false)==-1){switch(E){case"radio":if(F.value==C){F.checked=G}break;case"select-one":F.selectedIndex=G;break;default:F.checked=G;break}}}}function js_select_all(A){exclude=new Array();exclude[0]="selectall";js_toggle_all(A,"select-one","",exclude,A.selectall.selectedIndex)}function js_check_all(A){exclude=new Array();exclude[0]="keepattachments";exclude[1]="allbox";exclude[2]="removeall";js_toggle_all(A,"checkbox","",exclude,A.allbox.checked)}function js_check_all_option(B,A){exclude=new Array();exclude[0]="useusergroup";js_toggle_all(B,"radio",A,exclude,true)}function checkall(A){js_check_all(A)}function checkall_option(B,A){js_check_all_option(B,A)}function resize_textarea(C,B){var A=fetch_object(B);A.style.width=parseInt(A.offsetWidth)+(C<0?-100:100)+"px";A.style.height=parseInt(A.offsetHeight)+(C<0?-100:100)+"px";return false}function region_intersects(B,A){B=typeof (B.left)=="undefined"?YAHOO.util.Dom.getRegion(B):B;A=typeof (A.left)=="undefined"?YAHOO.util.Dom.getRegion(A):A;return(B.left>A.right||B.right<A.left||B.top>A.bottom||B.bottom<A.top)?false:true}function fetch_viewport_info(){if(viewport_info==null){viewport_info={x:YAHOO.util.Dom.getDocumentScrollLeft(),y:YAHOO.util.Dom.getDocumentScrollTop(),w:YAHOO.util.Dom.getViewportWidth(),h:YAHOO.util.Dom.getViewportHeight()};console.info("Viewport Info: Size = %dx%d, Position = %d,%d",viewport_info.w,viewport_info.h,viewport_info.x,viewport_info.y)}return viewport_info}function clear_viewport_info(){viewport_info=null}function center_element(A){viewport_info=fetch_viewport_info();YAHOO.util.Dom.setXY(A,[viewport_info.w/2+viewport_info.x-A.clientWidth/2,viewport_info.h/2+viewport_info.y-A.clientHeight/2])}function fetch_all_stylesheets(D){var G=new Array(),B=0,A=null,E=0,F=0;for(B=0;B<document.styleSheets.length;B++){A=document.styleSheets[B];G.push(A);try{if(A.cssRules){for(E=0;E<A.cssRules.length;E++){if(A.cssRules[E].styleSheet){G.push(A.cssRules[E].styleSheet)}}}else{if(A.imports){for(F=0;F<A.imports.length;F++){G.push(A.imports[F])}}}}catch(C){G.pop();continue}}return G}function highlight_login_box(){var E=fetch_object("navbar_username");var A="inlinemod";var B,C=1600,D=200;if(E){E.focus();E.select();for(B=0;B<C;B+=2*D){window.setTimeout(function(){YAHOO.util.Dom.addClass(E,A)},B);window.setTimeout(function(){YAHOO.util.Dom.removeClass(E,A)},B+D)}}return false}function toggle_collapse(B){if(!is_regexp){return false}var D=fetch_object("collapseobj_"+B);var A=fetch_object("collapseimg_"+B);var C=fetch_object("collapsecel_"+B);if(!D){if(A){A.style.display="none"}return false}if(D.style.display=="none"){D.style.display="";save_collapsed(B,false);if(A){img_re=new RegExp("_collapsed\\.gif$");A.src=A.src.replace(img_re,".gif")}if(C){cel_re=new RegExp("^(thead|tcat)(_collapsed)$");C.className=C.className.replace(cel_re,"$1")}}else{D.style.display="none";save_collapsed(B,true);if(A){img_re=new RegExp("\\.gif$");A.src=A.src.replace(img_re,"_collapsed.gif")}if(C){cel_re=new RegExp("^(thead|tcat)$");C.className=C.className.replace(cel_re,"$1_collapsed")}}return false}function save_collapsed(A,E){var D=fetch_cookie("vbulletin_collapse");var C=new Array();if(D!=null){D=D.split("\n");for(var B in D){if(YAHOO.lang.hasOwnProperty(D,B)&&D[B]!=A&&D[B]!=""){C[C.length]=D[B]}}}if(E){C[C.length]=A}expires=new Date();expires.setTime(expires.getTime()+(1000*86400*365));set_cookie("vbulletin_collapse",C.join("\n"),expires)}function vBpagenav(){}vBpagenav.prototype.controlobj_onclick=function(C){this._onclick(C);var A=fetch_tags(this.menu.menuobj,"input");for(var B=0;B<A.length;B++){if(A[B].type=="text"){A[B].focus();break}}};vBpagenav.prototype.form_gotopage=function(A){if((pagenum=parseInt(fetch_object("pagenav_itxt").value,10))>0){window.location=vBmenu.menus[vBmenu.activemenu].addr+"&page="+pagenum}return false};vBpagenav.prototype.ibtn_onclick=function(A){return this.form.gotopage()};vBpagenav.prototype.itxt_onkeypress=function(A){return((A?A:window.event).keyCode==13?this.form.gotopage():true)};function vbmenu_register(B,A,C){if(typeof (vBmenu)=="object"){return vBmenu.register(B,A)}else{return false}}function string_to_node(B){var A=document.createElement("div");A.innerHTML=B;var C=A.firstChild;while(C&&C.nodeType!=1){C=C.nextSibling}if(!C){return A.firstChild.cloneNode(true)}else{return C.cloneNode(true)}}function set_unselectable(B){B=YAHOO.util.Dom.get(B);if(!is_ie4&&typeof B.tagName!="undefined"){if(B.hasChildNodes()){for(var A=0;A<B.childNodes.length;A++){set_unselectable(B.childNodes[A])}}B.unselectable="on"}}function fetch_sessionhash(){return(SESSIONURL==""?"":SESSIONURL.substr(2,32))}function construct_phrase(){if(!arguments||arguments.length<1||!is_regexp){return false}var A=arguments;var D=A[0];var C;for(var B=1;B<A.length;B++){C=new RegExp("%"+B+"\\$s","gi");D=D.replace(C,A[B])}return D}function switch_id(C,E){var F=C.options[C.selectedIndex].value;if(F==""){return }var B=new String(window.location);var A=new String("");B=B.split("#");if(B[1]){A="#"+B[1]}B=B[0];if(B.indexOf(E+"id=")!=-1&&is_regexp){var D=new RegExp(E+"id=\\d+&?");B=B.replace(D,"")}if(B.indexOf("?")==-1){B+="?"}else{lastchar=B.substr(B.length-1);if(lastchar!="&"&&lastchar!="?"){B+="&"}}window.location=B+E+"id="+F+A}function child_img_alt_2_title(A){var C=A.getElementsByTagName("img");for(var B=0;B<C.length;B++){img_alt_2_title(C[B])}}function img_alt_2_title(A){if(!A.title&&A.alt!=""){A.title=A.alt}}function Comment_Init(B){if(typeof B.id=="undefined"){return }var C=B.id;if(isNaN(C)){var A=null;if(A=C.match(/(\d+)/)){C=A[0]}}if(typeof inlineMod_comment!="undefined"){im_init(B,inlineMod_comment)}if(typeof vB_QuickEditor_Factory!="undefined"){if(typeof vB_QuickEditor_Factory.controls[C]=="undefined"){vB_QuickEditor_Factory.controls[C]=new vB_QuickEditor(C,vB_QuickEditor_Factory)}else{vB_QuickEditor_Factory.controls[C].init()}}if(typeof vB_QuickLoader_Factory!="undefined"){vB_QuickLoader_Factory.controls[C]=new vB_QuickLoader(C,vB_QuickLoader_Factory)}child_img_alt_2_title(B)}function PostBit_Init(C,D){console.log("PostBit Init: %d",D);if(typeof vBmenu!="undefined"){var B=fetch_tags(C,"div");for(var A=0;A<B.length;A++){if(B[A].id&&B[A].id.substr(0,9)=="postmenu_"){vBmenu.register(B[A].id,true)}}}if(typeof vB_QuickEditor!="undefined"){vB_AJAX_QuickEdit_Init(C)}if(typeof vB_QuickReply!="undefined"){qr_init_buttons(C)}if(typeof mq_init!="undefined"){mq_init(C)}if(typeof vBrep!="undefined"){if(typeof D!="undefined"&&typeof D!="null"){vbrep_register(D)}}if(typeof inlineMod!="undefined"){im_init(C)}if(typeof vB_Lightbox!="undefined"){init_postbit_lightbox(C)}child_img_alt_2_title(C)}function vBulletin_init(){if(is_webtv){return false}child_img_alt_2_title(document);if(typeof vBmenu=="object"){if(typeof (YAHOO)!="undefined"){YAHOO.util.Event.on(document,"click",vbmenu_hide);YAHOO.util.Event.on(window,"resize",vbmenu_hide)}else{if(window.attachEvent&&!is_saf){document.attachEvent("onclick",vbmenu_hide);window.attachEvent("onresize",vbmenu_hide)}else{if(document.addEventListener&&!is_saf){document.addEventListener("click",vbmenu_hide,false);window.addEventListener("resize",vbmenu_hide,false)}else{window.onclick=vbmenu_hide;window.onresize=vbmenu_hide}}}var B=fetch_tags(document,"td");for(var D=0;D<B.length;D++){if(B[D].hasChildNodes()&&B[D].firstChild.name&&B[D].firstChild.name.indexOf("PageNav")!=-1){var C=B[D].title;B[D].title="";B[D].innerHTML="";B[D].id="pagenav."+D;var A=vBmenu.register(B[D].id);A.addr=C;if(is_saf){A.controlobj._onclick=A.controlobj.onclick;A.controlobj.onclick=vBpagenav.prototype.controlobj_onclick}}}if(typeof C!="undefined"){fetch_object("pagenav_form").gotopage=vBpagenav.prototype.form_gotopage;fetch_object("pagenav_ibtn").onclick=vBpagenav.prototype.ibtn_onclick;fetch_object("pagenav_itxt").onkeypress=vBpagenav.prototype.itxt_onkeypress}vBmenu.activate(true)}vBulletin.init();return true}function vBulletin_Framework(){this.elements=new Array();this.ajaxurls=new Array();this.events=new Array();this.time=new Date();this.add_event("systemInit")}vBulletin_Framework.prototype.init=function(){console.info("Firing System Init");this.events.systemInit.fire()};vBulletin_Framework.prototype.extend=function(C,A){function B(){}B.prototype=A.prototype;C.prototype=new B();C.prototype.constructor=C;C.baseConstructor=A;C.superClass=A.prototype};vBulletin_Framework.prototype.register_control=function(B,E){var C=new Array();for(var D=1;D<arguments.length;D++){C.push(arguments[D])}if(!this.elements[B]){console.info('Creating array vBulletin.elements["%s"]',B);this.elements[B]=new Array()}var A=this.elements[B].push(C);console.log('vBulletin.elements["%s"][%d] = %s',B,A-1,C.join(", "))};vBulletin_Framework.prototype.register_ajax_urls=function(B,C,D){B=B.split("?");B[1]=SESSIONURL+"securitytoken="+SECURITYTOKEN+"&ajax=1&"+B[1].replace(/\{(\d+)(:\w+)?\}/gi,"%$1$s");C=C.split("?");C[1]=SESSIONURL+"securitytoken="+SECURITYTOKEN+"&ajax=1&"+C[1].replace(/\{(\d+)(:\w+)?\}/gi,"%$1$s");console.log("Register AJAX URLs for %s",D);for(var A=0;A<D.length;A++){this.ajaxurls[D[A]]=new Array(B,C)}};vBulletin_Framework.prototype.add_event=function(A){this.events[A]=new YAHOO.util.CustomEvent(A)};vBulletin_Framework.prototype.console=function(){if(window.console||console.firebug){var args=new Array();for(var i=0;i<arguments.length;i++){args[args.length]=arguments[i]}try{eval("console.log('"+args.join("','")+"');")}catch(e){}}};var PHP=new vB_PHP_Emulator();var vBulletin=new vBulletin_Framework();vBulletin.events.systemInit.subscribe(function(){YAHOO.util.Event.on(window,"resize",clear_viewport_info);YAHOO.util.Event.on(window,"scroll",clear_viewport_info)});
// #### vbulletin_menu.js
vBulletin.add_event("vBmenuShow");vBulletin.add_event("vBmenuHide");function vB_Popup_Handler(){this.open_steps=10;this.open_fade=false;this.active=false;this.menus=new Array();this.activemenu=null}vB_Popup_Handler.prototype.activate=function(A){this.active=A;console.log("vBmenu :: System Activated")};vB_Popup_Handler.prototype.register=function(D,A,C){this.menus[D]=new vB_Popup_Menu(D,A,C);var B=YAHOO.util.Dom.get("usercss");if(B&&YAHOO.util.Dom.isAncestor(B,D)){this.menus[D].imgsrc=IMGDIR_MISC+"/menu_open_usercss.gif"}this.menus[D].startup();return this.menus[D]};vB_Popup_Handler.prototype.hide=function(){if(this.activemenu!=null){this.menus[this.activemenu].hide()}};var vBmenu=new vB_Popup_Handler();function vbmenu_hide(A){if(A&&A.button&&A.button!=1&&A.type=="click"){return true}else{vBmenu.hide()}}function vB_Popup_Menu(C,A,B){this.controlkey=C;this.noimage=A;this.noslide=B;this.menuname=this.controlkey.split(".")[0]+"_menu";this.imgsrc=IMGDIR_MISC+"/menu_open.gif"}vB_Popup_Menu.prototype.startup=function(){this.init_control(this.noimage);if(fetch_object(this.menuname)){this.init_menu()}this.slide_open=(this.noslide?false:true);this.open_steps=vBmenu.open_steps;vBulletin.add_event("vBmenuShow_"+this.controlkey);vBulletin.add_event("vBmenuHide_"+this.controlkey)};vB_Popup_Menu.prototype.init_control=function(A){this.controlobj=fetch_object(this.controlkey);this.controlobj.state=false;if(this.controlobj.firstChild&&(this.controlobj.firstChild.tagName=="TEXTAREA"||this.controlobj.firstChild.tagName=="INPUT")){}else{if(!A&&!(is_mac&&is_ie)){var C=document.createTextNode(" ");this.controlobj.appendChild(C);var B=document.createElement("img");B.src=this.imgsrc;B.border=0;B.title="";B.alt="";this.img=this.controlobj.appendChild(B)}this.controlobj.unselectable=true;if(!A){this.controlobj.style.cursor=pointer_cursor}this.controlobj.onclick=vB_Popup_Events.prototype.controlobj_onclick;this.controlobj.onmouseover=vB_Popup_Events.prototype.controlobj_onmouseover}};vB_Popup_Menu.prototype.init_menu=function(){this.menuobj=fetch_object(this.menuname);this.select_handler=new vB_Select_Overlay_Handler(this.menuobj);if(this.menuobj&&!this.menuobj.initialized){this.menuobj.initialized=true;this.menuobj.onclick=e_by_gum;this.menuobj.style.position="absolute";this.menuobj.style.zIndex=50;if(is_ie&&!is_mac){if(!is_ie7){this.menuobj.style.filter+="alpha(enabled=1,opacity=100)"}else{this.menuobj.style.minHeight="1%"}}this.init_menu_contents()}};vB_Popup_Menu.prototype.init_menu_contents=function(){var E=new Array("td","li");for(var D=0;D<E.length;D++){var H=fetch_tags(this.menuobj,E[D]);for(var F=0;F<H.length;F++){if(H[F].className=="vbmenu_option"){if(H[F].title&&H[F].title=="nohilite"){H[F].title=""}else{H[F].controlkey=this.controlkey;H[F].onmouseover=vB_Popup_Events.prototype.menuoption_onmouseover;H[F].onmouseout=vB_Popup_Events.prototype.menuoption_onmouseout;var C=fetch_tags(H[F],"a");if(C.length==1){H[F].className=H[F].className+" vbmenu_option_alink";H[F].islink=true;var B=C[0];var A=false;H[F].target=B.getAttribute("target");if(typeof B.onclick=="function"){H[F].ofunc=B.onclick;H[F].onclick=vB_Popup_Events.prototype.menuoption_onclick_function;A=true}else{if(typeof H[F].onclick=="function"){H[F].ofunc=H[F].onclick;H[F].onclick=vB_Popup_Events.prototype.menuoption_onclick_function;A=true}else{H[F].href=B.href;H[F].onclick=vB_Popup_Events.prototype.menuoption_onclick_link}}if(A){var G=document.createElement("a");G.innerHTML=B.innerHTML;G.href="#";G.onclick=function(I){I=I?I:window.event;I.returnValue=false;return false};H[F].insertBefore(G,B);H[F].removeChild(B)}}else{if(typeof H[F].onclick=="function"){H[F].ofunc=H[F].onclick;H[F].onclick=vB_Popup_Events.prototype.menuoption_onclick_function}}}}}}};vB_Popup_Menu.prototype.show=function(B,A){if(!vBmenu.active){return false}else{if(!this.menuobj){this.init_menu()}}if(!this.menuobj||vBmenu.activemenu==this.controlkey){return false}console.log("vBmenu :: Show '%s'",this.controlkey);if(vBmenu.activemenu!=null&&vBmenu.activemenu!=this.controlkey){vBmenu.menus[vBmenu.activemenu].hide()}vBmenu.activemenu=this.controlkey;this.menuobj.style.display="";if(this.slide_open){this.menuobj.style.clip="rect(auto, 0px, 0px, auto)"}this.set_menu_position(B);if(!A&&this.slide_open){this.intervalX=Math.ceil(this.menuobj.offsetWidth/this.open_steps);this.intervalY=Math.ceil(this.menuobj.offsetHeight/this.open_steps);this.slide((this.direction=="left"?0:this.menuobj.offsetWidth),0,0)}else{if(this.menuobj.style.clip&&this.slide_open){this.menuobj.style.clip="rect(auto, auto, auto, auto)"}}this.select_handler.hide();if(this.controlobj.editorid){this.controlobj.state=true;vB_Editor[this.controlobj.editorid].menu_context(this.controlobj,"mousedown")}vBulletin.events["vBmenuShow_"+this.controlkey].fire(this.controlkey);vBulletin.events.vBmenuShow.fire(this.controlkey)};vB_Popup_Menu.prototype.set_menu_position=function(A){this.pos=this.fetch_offset(A);this.leftpx=this.pos.left;this.toppx=this.pos.top+A.offsetHeight;if((this.leftpx+this.menuobj.offsetWidth)>=document.body.clientWidth&&(this.leftpx+A.offsetWidth-this.menuobj.offsetWidth)>0){this.leftpx=this.leftpx+A.offsetWidth-this.menuobj.offsetWidth;this.direction="right"}else{this.direction="left"}if(this.controlkey.match(/^pagenav\.\d+$/)){A.appendChild(this.menuobj)}this.menuobj.style.left=this.leftpx+"px";this.menuobj.style.top=this.toppx+"px"};vB_Popup_Menu.prototype.hide=function(A){if(A&&A.button&&A.button!=1){return true}console.log("vBmenu :: Hide '%s'",this.controlkey);this.stop_slide();this.menuobj.style.display="none";this.select_handler.show();if(this.controlobj.editorid){this.controlobj.state=false;vB_Editor[this.controlobj.editorid].menu_context(this.controlobj,"mouseout")}vBmenu.activemenu=null;vBulletin.events["vBmenuHide_"+this.controlkey].fire(this.controlkey);vBulletin.events.vBmenuHide.fire(this.controlkey)};vB_Popup_Menu.prototype.hover=function(A){if(vBmenu.activemenu!=null){if(vBmenu.menus[vBmenu.activemenu].controlkey!=this.id){this.show(A,true)}}};vB_Popup_Menu.prototype.slide=function(C,B,A){if(this.direction=="left"&&(C<this.menuobj.offsetWidth||B<this.menuobj.offsetHeight)){C+=this.intervalX;B+=this.intervalY;this.menuobj.style.clip="rect(auto, "+C+"px, "+B+"px, auto)";this.slidetimer=setTimeout("vBmenu.menus[vBmenu.activemenu].slide("+C+", "+B+", "+A+");",0)}else{if(this.direction=="right"&&(C>0||B<this.menuobj.offsetHeight)){C-=this.intervalX;B+=this.intervalY;this.menuobj.style.clip="rect(auto, "+this.menuobj.offsetWidth+"px, "+B+"px, "+C+"px)";this.slidetimer=setTimeout("vBmenu.menus[vBmenu.activemenu].slide("+C+", "+B+", "+A+");",0)}else{this.stop_slide()}}};vB_Popup_Menu.prototype.stop_slide=function(){clearTimeout(this.slidetimer);this.menuobj.style.clip="rect(auto, auto, auto, auto)"};vB_Popup_Menu.prototype.fetch_offset=function(E){if(E.getBoundingClientRect){var C=E.getBoundingClientRect();var D=Math.max(document.documentElement.scrollTop,document.body.scrollTop);var F=Math.max(document.documentElement.scrollLeft,document.body.scrollLeft);if(document.documentElement.dir=="rtl"){F=F+document.documentElement.clientWidth-document.documentElement.scrollWidth}return{left:C.left+F,top:C.top+D}}var B=E.offsetLeft;var A=E.offsetTop;while((E=E.offsetParent)!=null){B+=E.offsetLeft;A+=E.offsetTop}return{left:B,top:A}};function vB_Popup_Events(){}vB_Popup_Events.prototype.controlobj_onclick=function(A){if(typeof do_an_e=="function"){do_an_e(A);if(vBmenu.activemenu==null||vBmenu.menus[vBmenu.activemenu].controlkey!=this.id){vBmenu.menus[this.id].show(this)}else{vBmenu.menus[this.id].hide()}}};vB_Popup_Events.prototype.controlobj_onmouseover=function(A){if(typeof do_an_e=="function"){do_an_e(A);vBmenu.menus[this.id].hover(this)}};vB_Popup_Events.prototype.menuoption_onclick_function=function(A){this.ofunc(A);vBmenu.menus[this.controlkey].hide()};vB_Popup_Events.prototype.menuoption_onclick_link=function(A){A=A?A:window.event;if(A.shiftKey||(this.target!=null&&this.target!=""&&this.target.toLowerCase()!="_self")){if(this.target!=null&&this.target.charAt(0)!="_"){window.open(this.href,this.target)}else{window.open(this.href)}}else{window.location=this.href;return false}A.cancelBubble=true;if(A.stopPropagation){A.stopPropagation()}if(A.preventDefault){A.preventDefault()}vBmenu.menus[this.controlkey].hide();return false};vB_Popup_Events.prototype.menuoption_onmouseover=function(A){this.className="vbmenu_hilite"+(this.islink?" vbmenu_hilite_alink":"");this.style.cursor=pointer_cursor};vB_Popup_Events.prototype.menuoption_onmouseout=function(A){this.className="vbmenu_option"+(this.islink?" vbmenu_option_alink":"");this.style.cursor="default"};
// #### vbulletin_read_marker.js
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(C){var B=fetch_tags(C.responseXML,"forum");for(var A=0;A<B.length;A++){var D=B[A].firstChild.nodeValue;this.update_forum_status(D);var E=fetch_object("threadbits_forum_"+D);if(E){this.handle_threadbits(E)}}};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(C){var A=fetch_tags(C,"a");for(var B=0;B<A.length;B++){if(A[B].id&&A[B].id.substr(0,vB_ReadMarker.thread_gotonew_prefix.length)==vB_ReadMarker.thread_gotonew_prefix){this.update_thread_status(A[B].id.substr(vB_ReadMarker.thread_gotonew_prefix.length))}}};vB_AJAX_ReadMarker.prototype.update_thread_status=function(D){var C=fetch_object(vB_ReadMarker.thread_statusicon_prefix+D);if(C){C.src=this.fetch_old_src(C.src,"thread")}var B=fetch_object(vB_ReadMarker.thread_gotonew_prefix+D);if(B){B.parentNode.removeChild(B)}var A=fetch_object(vB_ReadMarker.thread_title_prefix+D);if(A){A.style.fontWeight="normal"}};vB_AJAX_ReadMarker.prototype.fetch_old_src=function(B,A){var C=B.replace(/_(new)([\._])(.+)$/i,(A=="thread"?"$2$3":"_old$2$3"));return C};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}}}};
// #### vbulletin_ajax_threadslist.js
var vB_ThreadTitle_Editor=null;function vB_AJAX_Threadlist_Init(F){if(AJAX_Compatible&&(typeof vb_disable_ajax=="undefined"||vb_disable_ajax<2)){var D=fetch_tags(fetch_object(F),"td");for(var C=0;C<D.length;C++){if(D[C].hasChildNodes()&&D[C].id&&D[C].id.substr(0,3)=="td_"){var E=fetch_tags(D[C],"a");for(var A=0;A<E.length;A++){if(E[A].rel&&E[A].rel.indexOf("vB::AJAX")!=-1){var B=D[C].id.split("_");switch(B[1]){case"threadtitle":if(typeof vb_disable_ajax=="undefined"||vb_disable_ajax==0){D[C].style.cursor="default";D[C].ondblclick=vB_AJAX_ThreadList_Events.prototype.threadtitle_doubleclick}break;case"threadstatusicon":D[C].style.cursor=pointer_cursor;D[C].ondblclick=vB_AJAX_ThreadList_Events.prototype.threadicon_doubleclick;break}break}}}}}}function vB_AJAX_OpenClose(A){this.obj=A;this.threadid=this.obj.id.substr(this.obj.id.lastIndexOf("_")+1);this.imgobj=fetch_object("thread_statusicon_"+this.threadid);this.toggle=function(){YAHOO.util.Connect.asyncRequest("POST","ajax.php?do=updatethreadopen&t="+this.threadid,{success:this.handle_ajax_response,failure:vBulletin_AJAX_Error_Handler,timeout:vB_Default_Timeout,scope:this},SESSIONURL+"securitytoken="+SECURITYTOKEN+"&do=updatethreadopen&t="+this.threadid+"&src="+PHP.urlencode(this.imgobj.src))};this.handle_ajax_response=function(B){if(B.responseXML){this.imgobj.src=B.responseXML.getElementsByTagName("imagesrc")[0].firstChild.nodeValue;if(iobj=fetch_object("tlist_"+this.threadid)){if(this.imgobj.src.indexOf("_lock")!=-1){iobj.value=iobj.value|1}else{iobj.value=iobj.value&~1}}}};this.toggle()}function vB_AJAX_TitleEdit(A){this.obj=A;this.threadid=this.obj.id.substr(this.obj.id.lastIndexOf("_")+1);this.linkobj=fetch_object("thread_title_"+this.threadid);this.container=this.linkobj.parentNode;this.editobj=null;this.xml_sender=null;this.origtitle="";this.editstate=false;this.edit=function(){if(this.editstate==false){this.inputobj=document.createElement("input");this.inputobj.type="text";this.inputobj.size=50;this.inputobj.maxLength=((typeof (titlemaxchars)=="number"&&titlemaxchars>0)?titlemaxchars:85);this.inputobj.style.width=Math.max(this.linkobj.offsetWidth,250)+"px";this.inputobj.className="bginput";this.inputobj.value=PHP.unhtmlspecialchars(this.linkobj.innerHTML);this.inputobj.title=this.inputobj.value;this.inputobj.onblur=vB_AJAX_ThreadList_Events.prototype.titleinput_onblur;this.inputobj.onkeypress=vB_AJAX_ThreadList_Events.prototype.titleinput_onkeypress;this.editobj=this.container.insertBefore(this.inputobj,this.linkobj);this.editobj.select();this.origtitle=this.linkobj.innerHTML;this.linkobj.style.display="none";this.editstate=true}};this.restore=function(){if(this.editstate==true){if(this.editobj.value!=this.origtitle){this.linkobj.innerHTML=PHP.htmlspecialchars(this.editobj.value);this.save(this.editobj.value)}else{this.linkobj.innerHTML=this.editobj.value}this.container.removeChild(this.editobj);this.linkobj.style.display="";this.editstate=false;this.obj=null}};this.save=function(B){YAHOO.util.Connect.asyncRequest("POST","ajax.php?do=updatethreadtitle&t="+this.threadid,{success:this.handle_ajax_response,timeout:vB_Default_Timeout,scope:this},SESSIONURL+"securitytoken="+SECURITYTOKEN+"&do=updatethreadtitle&t="+this.threadid+"&title="+PHP.urlencode(B))};this.handle_ajax_response=function(B){if(B.responseXML){this.linkobj.innerHTML=B.responseXML.getElementsByTagName("linkhtml")[0].firstChild.nodeValue}vB_ThreadTitle_Editor.obj=null};this.edit()}function vB_AJAX_ThreadList_Events(){}vB_AJAX_ThreadList_Events.prototype.threadtitle_doubleclick=function(A){if(vB_ThreadTitle_Editor&&vB_ThreadTitle_Editor.obj==this){return false}else{try{vB_ThreadTitle_Editor.restore()}catch(A){}vB_ThreadTitle_Editor=new vB_AJAX_TitleEdit(this)}};vB_AJAX_ThreadList_Events.prototype.threadicon_doubleclick=function(A){openclose=new vB_AJAX_OpenClose(this)};vB_AJAX_ThreadList_Events.prototype.titleinput_onblur=function(A){vB_ThreadTitle_Editor.restore()};vB_AJAX_ThreadList_Events.prototype.titleinput_onkeypress=function(A){A=A?A:window.event;switch(A.keyCode){case 13:vB_ThreadTitle_Editor.inputobj.blur();return false;case 27:vB_ThreadTitle_Editor.inputobj.value=vB_ThreadTitle_Editor.origtitle;vB_ThreadTitle_Editor.inputobj.blur();return true}};
// #### vbulletin_post_loader.js
function display_post(A){if(AJAX_Compatible){vB_PostLoader[A]=new vB_AJAX_PostLoader(A);vB_PostLoader[A].init()}else{pc_obj=fetch_object("postcount"+this.postid);openWindow("showpost.php?"+(SESSIONURL?"s="+SESSIONURL:"")+(pc_obj!=null?"&postcount="+PHP.urlencode(pc_obj.name):"")+"&p="+A)}return false}var vB_PostLoader=new Array();function vB_AJAX_PostLoader(A){this.postid=A;this.container=fetch_object("edit"+this.postid)}vB_AJAX_PostLoader.prototype.init=function(){if(this.container){postid=this.postid;pc_obj=fetch_object("postcount"+this.postid);YAHOO.util.Connect.asyncRequest("POST","showpost.php?p="+this.postid,{success:this.display,failure:this.handle_ajax_error,timeout:vB_Default_Timeout,scope:this},SESSIONURL+"securitytoken="+SECURITYTOKEN+"&ajax=1&postid="+this.postid+(pc_obj!=null?"&postcount="+PHP.urlencode(pc_obj.name):""))}};vB_AJAX_PostLoader.prototype.handle_ajax_error=function(A){vBulletin_AJAX_Error_Handler(A)};vB_AJAX_PostLoader.prototype.display=function(A){if(A.responseXML){var B=A.responseXML.getElementsByTagName("postbit");if(B.length){this.container.innerHTML=B[0].firstChild.nodeValue;PostBit_Init(fetch_object("post"+this.postid),this.postid)}else{openWindow("showpost.php?"+(SESSIONURL?"s="+SESSIONURL:"")+(pc_obj!=null?"&postcount="+PHP.urlencode(pc_obj.name):"")+"&p="+this.postid)}}};
// #### vbulletin_ajax_reputation.js
function vbrep_register(A){if(typeof vBrep=="object"&&typeof A!="undefined"){return vBrep.register(A)}}function vB_Reputation_Handler(){this.reps=new Array();this.ajax=new Array()}vB_Reputation_Handler.prototype.register=function(B){if(AJAX_Compatible&&(typeof vb_disable_ajax=="undefined"||vb_disable_ajax<2)){this.reps[B]=new vB_Reputation_Object(B);var A;if(A=fetch_object("reputation_"+B)){A.onclick=vB_Reputation_Object.prototype.reputation_click;return this.reps[B]}}};vBrep=new vB_Reputation_Handler();function vB_Reputation_Object(A){this.postid=A;this.divname="reputationmenu_"+A+"_menu";this.divobj=null;this.postobj=fetch_object("post"+A);this.vbmenuname="reputationmenu_"+A;this.vbmenu=null;this.xml_sender_populate=null;this.xml_sender_submit=null}vB_Reputation_Object.prototype.onreadystatechange_submit=function(I){if(I.responseXML){if(!this.vbmenu){this.vbmenu=vbmenu_register(this.vbmenuname,true);fetch_object(this.vbmenu.controlkey).onmouseover="";fetch_object(this.vbmenu.controlkey).onclick=""}var H=I.responseXML.getElementsByTagName("error");if(H.length){this.vbmenu.hide(fetch_object(this.vbmenuname));alert(H[0].firstChild.nodeValue)}else{this.vbmenu.hide(fetch_object(this.vbmenuname));var B=I.responseXML.getElementsByTagName("reputation")[0];var A=B.getAttribute("repdisplay");var G=B.getAttribute("reppower");var D=B.getAttribute("userid");var F=fetch_tags(document,"span");var E=null;for(var C=0;C<F.length;C++){if(E=F[C].id.match(/^reppower_(\d+)_(\d+)$/)){if(E[2]==D){F[C].innerHTML=G}}else{if(E=F[C].id.match(/^repdisplay_(\d+)_(\d+)$/)){if(E[2]==D){F[C].innerHTML=A}}}}alert(B.firstChild.nodeValue)}}};vB_Reputation_Object.prototype.onreadystatechange_populate=function(E){if(E.responseXML){var B=E.responseXML.getElementsByTagName("error");if(B.length){alert(B[0].firstChild.nodeValue)}else{if(!this.divobj){this.divobj=document.createElement("div");this.divobj.id=this.divname;this.divobj.style.display="none";this.divobj.onkeypress=vB_Reputation_Object.prototype.repinput_onkeypress;this.postobj.parentNode.appendChild(this.divobj);this.vbmenu=vbmenu_register(this.vbmenuname,true);fetch_object(this.vbmenu.controlkey).onmouseover="";fetch_object(this.vbmenu.controlkey).onclick=""}this.divobj.innerHTML=E.responseXML.getElementsByTagName("reputationbit")[0].firstChild.nodeValue;var A=fetch_tags(this.divobj,"input");for(var D=0;D<A.length;D++){if(A[D].type=="submit"){var F=A[D];var C=document.createElement("input");C.type="button";C.className=F.className;C.value=F.value;C.onclick=vB_Reputation_Object.prototype.submit_onclick;F.parentNode.insertBefore(C,F);F.parentNode.removeChild(F);C.name=F.name;C.id=F.name+"_"+this.postid}}this.vbmenu.show(fetch_object(this.vbmenuname))}}};vB_Reputation_Object.prototype.reputation_click=function(B){B=B?B:window.event;do_an_e(B);var C=this.id.substr(this.id.lastIndexOf("_")+1);var A=vBrep.reps[C];if(A.vbmenu==null){A.populate()}else{if(vBmenu.activemenu!=A.vbmenuname){A.vbmenu.show(fetch_object(A.vbmenuname))}else{A.vbmenu.hide()}}return true};vB_Reputation_Object.prototype.submit_onclick=function(B){B=B?B:window.event;do_an_e(B);var C=this.id.substr(this.id.lastIndexOf("_")+1);var A=vBrep.reps[C];A.submit();return false};vB_Reputation_Object.prototype.repinput_onkeypress=function(A){A=A?A:window.event;switch(A.keyCode){case 13:vBrep.reps[this.id.split(/_/)[1]].submit();return false;default:return true}};vB_Reputation_Object.prototype.populate=function(){YAHOO.util.Connect.asyncRequest("POST","reputation.php?p="+this.postid,{success:this.onreadystatechange_populate,failure:this.handle_ajax_error,timeout:vB_Default_Timeout,scope:this},SESSIONURL+"securitytoken="+SECURITYTOKEN+"&p="+this.postid+"&ajax=1")};vB_Reputation_Object.prototype.handle_ajax_error=function(A){vBulletin_AJAX_Error_Handler(A)};vB_Reputation_Object.prototype.submit=function(){this.psuedoform=new vB_Hidden_Form("reputation.php");this.psuedoform.add_variable("ajax",1);this.psuedoform.add_variables_from_object(this.divobj);YAHOO.util.Connect.asyncRequest("POST","reputation.php?do=addreputation&p="+this.psuedoform.fetch_variable("p"),{success:this.onreadystatechange_submit,failure:vBulletin_AJAX_Error_Handler,timeout:vB_Default_Timeout,scope:this},SESSIONURL+"securitytoken="+SECURITYTOKEN+"&"+this.psuedoform.build_query_string())};
// #### vbulletin_textedit.js
function vB_Text_Editor(editorid,mode,parsetype,parsesmilies,initial_text,ajax_extra){this.editorid=editorid;this.wysiwyg_mode=parseInt(mode,10)?1:0;this.initialized=false;this.parsetype=(typeof parsetype=="undefined"?"nonforum":parsetype);this.ajax_extra=(typeof parsetype=="undefined"?"":ajax_extra);this.parsesmilies=(typeof parsesmilies=="undefined"?1:parsesmilies);this.popupmode=(typeof vBmenu=="undefined"?false:true);this.controlbar=fetch_object(this.editorid+"_controls");this.textobj=fetch_object(this.editorid+"_textarea");this.buttons=new Array();this.popups=new Array();this.prompt_popup=null;this.fontstate=null;this.sizestate=null;this.colorstate=null;this.clipboard="";this.disabled=false;this.history=new vB_History();this.influx=0;this.allowbasicbbcode=((typeof allowbasicbbcode!="undefined"&&allowbasicbbcode)?true:false);this.init=function(){if(this.initialized){return }this.textobj.disabled=false;if(this.tempiframe){this.tempiframe.parentNode.removeChild(this.tempiframe)}this.set_editor_contents(initial_text);this.set_editor_functions();this.init_controls();this.init_smilies(fetch_object(this.editorid+"_smiliebox"));if(typeof smilie_window!="undefined"&&!smilie_window.closed){this.init_smilies(smilie_window.document.getElementById("smilietable"))}this.captcha=document.getElementById("imagestamp");if(this.captcha!=null){this.captcha.setAttribute("tabIndex",1)}this.initialized=true};this.check_focus=function(){if(!this.editwin.hasfocus||(is_moz&&is_mac)){this.editwin.focus();if(is_opera){this.editwin.focus()}}};this.init_controls=function(){var controls=new Array();var i,j,buttons,imgs,control;if(this.controlbar==null){return }buttons=fetch_tags(this.controlbar,"div");for(i=0;i<buttons.length;i++){if(buttons[i].className=="imagebutton"&&buttons[i].id){controls[controls.length]=buttons[i].id;if(is_ie){imgs=buttons[i].getElementsByTagName("img");for(j=0;j<imgs.length;j++){if(imgs[j].alt==""){imgs[j].title=buttons[i].title}}}}}for(i=0;i<controls.length;i++){control=fetch_object(controls[i]);if(control.id.indexOf(this.editorid+"_cmd_")!=-1){this.init_command_button(control)}else{if(control.id.indexOf(this.editorid+"_popup_")!=-1){this.init_popup_button(control)}}}set_unselectable(this.controlbar)};this.init_smilies=function(smilie_container){if(smilie_container!=null){var smilies=fetch_tags(smilie_container,"img");for(var i=0;i<smilies.length;i++){if(smilies[i].id&&smilies[i].id.indexOf("_smilie_")!=false){smilies[i].style.cursor=pointer_cursor;smilies[i].editorid=this.editorid;smilies[i].onclick=vB_Text_Editor_Events.prototype.smilie_onclick;smilies[i].unselectable="on"}}}};this.init_command_button=function(obj){obj.cmd=obj.id.substr(obj.id.indexOf("_cmd_")+5);obj.editorid=this.editorid;this.buttons[obj.cmd]=obj;if(obj.cmd=="switchmode"){if(AJAX_Compatible){obj.state=this.wysiwyg_mode?true:false;this.set_control_style(obj,"button",this.wysiwyg_mode?"selected":"normal")}else{obj.parentNode.removeChild(obj)}}else{obj.state=false;obj.mode="normal";if(obj.cmd=="bold"||obj.cmd=="italic"||obj.cmd=="underline"){this.allowbasicbbcode=true}}obj.onclick=obj.onmousedown=obj.onmouseover=obj.onmouseout=vB_Text_Editor_Events.prototype.command_button_onmouseevent};this.init_popup_button=function(obj){obj.cmd=obj.id.substr(obj.id.indexOf("_popup_")+7);if(this.popupmode){vBmenu.register(obj.id,true);vBmenu.menus[obj.id].open_steps=5;obj.editorid=this.editorid;obj.state=false;this.buttons[obj.cmd]=obj;var option,div;if(obj.cmd=="fontname"){this.fontout=fetch_object(this.editorid+"_font_out");this.fontout.innerHTML=obj.title;this.fontoptions={"":this.fontout};for(option in fontoptions){if(YAHOO.lang.hasOwnProperty(fontoptions,option)){div=document.createElement("div");div.id=this.editorid+"_fontoption_"+fontoptions[option];div.style.width=this.fontout.style.width;div.style.display="none";div.innerHTML=fontoptions[option];this.fontoptions[fontoptions[option]]=this.fontout.parentNode.appendChild(div)}}}else{if(obj.cmd=="fontsize"){this.sizeout=fetch_object(this.editorid+"_size_out");this.sizeout.innerHTML=obj.title;this.sizeoptions={"":this.sizeout};for(option in sizeoptions){if(YAHOO.lang.hasOwnProperty(sizeoptions,option)){div=document.createElement("div");div.id=this.editorid+"_sizeoption_"+sizeoptions[option];div.style.width=this.sizeout.style.width;div.style.display="none";div.innerHTML=sizeoptions[option];this.sizeoptions[sizeoptions[option]]=this.sizeout.parentNode.appendChild(div)}}}}obj._onmouseover=obj.onmouseover;obj._onclick=obj.onclick;obj.onmouseover=obj.onmouseout=obj.onclick=vB_Text_Editor_Events.prototype.popup_button_onmouseevent;vBmenu.menus[obj.id]._show=vBmenu.menus[obj.id].show;vBmenu.menus[obj.id].show=vB_Text_Editor_Events.prototype.popup_button_show}else{this.build_select(obj)}};this.build_select=function(obj){var sel=document.createElement("select");sel.id=this.editorid+"_select_"+obj.cmd;sel.editorid=this.editorid;sel.cmd=obj.cmd;var opt=document.createElement("option");opt.value="";opt.text=obj.title;sel.add(opt,is_ie?sel.options.length:null);opt=document.createElement("option");opt.value="";opt.text=" ";sel.add(opt,is_ie?sel.options.length:null);var i;switch(obj.cmd){case"fontname":for(i=0;i<fontoptions.length;i++){opt=document.createElement("option");opt.value=fontoptions[i];opt.text=(fontoptions[i].length>10?(fontoptions[i].substr(0,10)+"..."):fontoptions[i]);sel.add(opt,is_ie?sel.options.length:null)}sel.onchange=vB_Text_Editor_Events.prototype.formatting_select_onchange;break;case"fontsize":for(i=0;i<sizeoptions.length;i++){opt=document.createElement("option");opt.value=sizeoptions[i];opt.text=sizeoptions[i];sel.add(opt,is_ie?sel.options.length:null)}sel.onchange=vB_Text_Editor_Events.prototype.formatting_select_onchange;break;case"forecolor":for(i in coloroptions){if(YAHOO.lang.hasOwnProperty(coloroptions,i)){opt=document.createElement("option");opt.value=coloroptions[i];opt.text=PHP.trim((coloroptions[i].length>5?(coloroptions[i].substr(0,5)+"..."):coloroptions[i]).replace(new RegExp("([A-Z])","g")," $1"));opt.style.backgroundColor=i;sel.add(opt,is_ie?sel.options.length:null)}}sel.onchange=vB_Text_Editor_Events.prototype.formatting_select_onchange;break;case"smilie":for(var cat in smilieoptions){if(!YAHOO.lang.hasOwnProperty(smilieoptions,cat)){continue}for(var smilieid in smilieoptions[cat]){if(!YAHOO.lang.hasOwnProperty(smilieoptions[cat],smilieid)){continue}if(smilieid!="more"){opt=document.createElement("option");opt.value=smilieoptions[cat][smilieid][1];opt.text=smilieoptions[cat][smilieid][1];opt.smilieid=smilieid;opt.smiliepath=smilieoptions[cat][smilieid][0];opt.smilietitle=smilieoptions[cat][smilieid][2];sel.add(opt,is_ie?sel.options.length:null)}}}sel.onchange=vB_Text_Editor_Events.prototype.smilieselect_onchange;break;case"attach":sel.onmouseover=vB_Text_Editor_Events.prototype.attachselect_onmouseover;sel.onchange=vB_Text_Editor_Events.prototype.attachselect_onchange;break}while(obj.hasChildNodes()){obj.removeChild(obj.firstChild)}this.buttons[obj.cmd]=obj.appendChild(sel)};this.init_popup_menu=function(obj){if(this.disabled){return false}var menu;switch(obj.cmd){case"fontname":menu=this.init_menu_container("fontname","200px","250px","auto");this.build_fontname_popup(obj,menu);break;case"fontsize":menu=this.init_menu_container("fontsize","auto","auto","visible");this.build_fontsize_popup(obj,menu);break;case"forecolor":menu=this.init_menu_container("forecolor","auto","auto","visible");this.build_forecolor_popup(obj,menu);break;case"smilie":menu=this.init_menu_container("smilie","175px","250px","auto");this.build_smilie_popup(obj,menu);break;case"attach":if(typeof vB_Attachments!="undefined"&&vB_Attachments.has_attachments()){menu=this.init_menu_container("attach","auto","auto","visible");this.build_attachments_popup(menu,obj)}else{fetch_object("manage_attachments_button").onclick();return false}}this.popups[obj.cmd]=this.controlbar.appendChild(menu);set_unselectable(menu);return true};this.init_menu_container=function(cmd,width,height,overflow){var menu=document.createElement("div");menu.id=this.editorid+"_popup_"+cmd+"_menu";menu.className="vbmenu_popup";menu.style.display="none";menu.style.cursor="default";menu.style.padding="3px";menu.style.width=width;menu.style.height=height;menu.style.overflow=overflow;return menu};this.build_fontname_popup=function(obj,menu){for(var n in fontoptions){if(YAHOO.lang.hasOwnProperty(fontoptions,n)){var option=document.createElement("div");option.innerHTML='<font face="'+fontoptions[n]+'">'+fontoptions[n]+"</font>";option.className="ofont";option.style.textAlign="left";option.title=fontoptions[n];option.cmd=obj.cmd;option.controlkey=obj.id;option.editorid=this.editorid;option.onmouseover=option.onmouseout=option.onmouseup=option.onmousedown=vB_Text_Editor_Events.prototype.menuoption_onmouseevent;option.onclick=vB_Text_Editor_Events.prototype.formatting_option_onclick;menu.appendChild(option)}}};this.build_fontsize_popup=function(obj,menu){for(var n in sizeoptions){if(YAHOO.lang.hasOwnProperty(sizeoptions,n)){var option=document.createElement("div");option.innerHTML='<font size="'+sizeoptions[n]+'">'+sizeoptions[n]+"</font>";option.className="osize";option.style.textAlign="center";option.title=sizeoptions[n];option.cmd=obj.cmd;option.controlkey=obj.id;option.editorid=this.editorid;option.onmouseover=option.onmouseout=option.onmouseup=option.onmousedown=vB_Text_Editor_Events.prototype.menuoption_onmouseevent;option.onclick=vB_Text_Editor_Events.prototype.formatting_option_onclick;menu.appendChild(option)}}};this.build_forecolor_popup=function(obj,menu){var colorout=fetch_object(this.editorid+"_color_out");colorout.editorid=this.editorid;colorout.onclick=vB_Text_Editor_Events.prototype.colorout_onclick;var table=document.createElement("table");table.cellPadding=0;table.cellSpacing=0;table.border=0;var i=0;for(var hex in coloroptions){if(!YAHOO.lang.hasOwnProperty(coloroptions,hex)){continue}if(i%8==0){var tr=table.insertRow(-1)}i++;var div=document.createElement("div");div.style.backgroundColor=coloroptions[hex];var option=tr.insertCell(-1);option.style.textAlign="center";option.className="ocolor";option.appendChild(div);option.cmd=obj.cmd;option.editorid=this.editorid;option.controlkey=obj.id;option.colorname=coloroptions[hex];option.id=this.editorid+"_color_"+coloroptions[hex];option.onmouseover=option.onmouseout=option.onmouseup=option.onmousedown=vB_Text_Editor_Events.prototype.menuoption_onmouseevent;option.onclick=vB_Text_Editor_Events.prototype.coloroption_onclick}menu.appendChild(table)};this.build_smilie_popup=function(obj,menu){for(var cat in smilieoptions){if(!YAHOO.lang.hasOwnProperty(smilieoptions,cat)){continue}var option;var category=document.createElement("div");category.className="thead";category.innerHTML=cat;menu.appendChild(category);for(var smilieid in smilieoptions[cat]){if(!YAHOO.lang.hasOwnProperty(smilieoptions[cat],smilieid)){continue}if(smilieid=="more"){option=document.createElement("div");option.className="thead";option.innerHTML=smilieoptions[cat][smilieid];option.style.cursor=pointer_cursor;option.editorid=this.editorid;option.controlkey=obj.id;option.onclick=vB_Text_Editor_Events.prototype.smiliemore_onclick}else{option=document.createElement("div");option.editorid=this.editorid;option.controlkey=obj.id;option.smilieid=smilieid;option.smilietext=smilieoptions[cat][smilieid][1];option.smilietitle=smilieoptions[cat][smilieid][2];option.className="osmilie";option.innerHTML='<img src="'+smilieoptions[cat][smilieid][0]+'" alt="'+smilieoptions[cat][smilieid][2]+'" /> '+smilieoptions[cat][smilieid][2];option.onmouseover=option.onmouseout=option.onmousedown=option.onmouseup=vB_Text_Editor_Events.prototype.menuoption_onmouseevent;option.onclick=vB_Text_Editor_Events.prototype.smilieoption_onclick}menu.appendChild(option)}}};this.build_attachments_popup=function(menu,obj){var id,div;if(this.popupmode){while(menu.hasChildNodes()){menu.removeChild(menu.firstChild)}div=document.createElement("div");div.editorid=this.editorid;div.controlkey=obj.id;div.className="thead";div.style.cursor=pointer_cursor;div.style.whiteSpace="nowrap";div.innerHTML=fetch_object("manage_attachments_button").value;div.title=fetch_object("manage_attachments_button").title;div.onclick=vB_Text_Editor_Events.prototype.attachmanage_onclick;menu.appendChild(div);var attach_count=0;for(id in vB_Attachments.attachments){if(!YAHOO.lang.hasOwnProperty(vB_Attachments.attachments,id)){continue}div=document.createElement("div");div.editorid=this.editorid;div.controlkey=obj.id;div.className="osmilie";div.attachmentid=id;div.style.whiteSpace="nowrap";div.innerHTML='<img src="'+vB_Attachments.attachments[id]["imgpath"]+'" alt="" /> '+vB_Attachments.attachments[id]["filename"];div.onmouseover=div.onmouseout=div.onmousedown=div.onmouseup=vB_Text_Editor_Events.prototype.menuoption_onmouseevent;div.onclick=vB_Text_Editor_Events.prototype.attachoption_onclick;menu.appendChild(div);attach_count++}if(attach_count>1){div=document.createElement("div");div.editorid=this.editorid;div.controlkey=obj.id;div.className="osmilie";div.style.fontWeight="bold";div.style.paddingLeft="25px";div.style.whiteSpace="nowrap";div.innerHTML=vbphrase.insert_all;div.onmouseover=div.onmouseout=div.onmousedown=div.onmouseup=vB_Text_Editor_Events.prototype.menuoption_onmouseevent;div.onclick=vB_Text_Editor_Events.prototype.attachinsertall_onclick;menu.appendChild(div)}}else{while(menu.options.length>2){menu.remove(menu.options.length-1)}for(id in vB_Attachments.attachments){if(!YAHOO.lang.hasOwnProperty(vB_Attachments.attachments,id)){continue}var opt=document.createElement("option");opt.value=id;opt.text=vB_Attachments.attachments[id]["filename"];menu.add(opt,is_ie?menu.options.length:null)}}set_unselectable(menu)};this.menu_context=function(obj,state){if(this.disabled){return }switch(obj.state){case true:this.set_control_style(obj,"button","down");break;default:switch(state){case"mouseout":this.set_control_style(obj,"button","normal");break;case"mousedown":this.set_control_style(obj,"popup","down");break;case"mouseup":case"mouseover":this.set_control_style(obj,"button","hover");break}}};this.button_context=function(obj,state,controltype){if(this.disabled){return }if(typeof controltype=="undefined"){controltype="button"}switch(obj.state){case true:switch(state){case"mouseover":case"mousedown":case"mouseup":this.set_control_style(obj,controltype,"down");break;case"mouseout":this.set_control_style(obj,controltype,"selected");break}break;default:switch(state){case"mouseover":case"mouseup":this.set_control_style(obj,controltype,"hover");break;case"mousedown":this.set_control_style(obj,controltype,"down");break;case"mouseout":this.set_control_style(obj,controltype,"normal");break}break}};this.set_control_style=function(obj,controltype,mode){if(obj.mode!=mode){obj.mode=mode;istyle="pi_"+controltype+"_"+obj.mode;if(typeof istyles!="undefined"&&typeof istyles[istyle]!="undefined"){obj.style.background=istyles[istyle][0];obj.style.color=istyles[istyle][1];if(controltype!="menu"){obj.style.padding=istyles[istyle][2]}obj.style.border=istyles[istyle][3];var tds=fetch_tags(obj,"td");for(var i=0;i<tds.length;i++){switch(tds[i].className){case"popup_feedback":tds[i].style.borderRight=(mode=="normal"?istyles.pi_menu_normal[3]:istyles[istyle][3]);break;case"popup_pickbutton":tds[i].style.borderColor=(mode=="normal"?istyles.pi_menu_normal[0]:istyles[istyle][0]);break;case"alt_pickbutton":if(obj.state){tds[i].style.paddingLeft=istyles.pi_button_normal[2];tds[i].style.borderLeft=istyles.pi_button_normal[3]}else{tds[i].style.paddingLeft=istyles[istyle][2];tds[i].style.borderLeft=istyles[istyle][3]}}}}}};this.format=function(e,cmd,arg){e=do_an_e(e);if(this.disabled){return false}if(cmd!="redo"){this.history.add_snapshot(this.get_editor_contents())}if(cmd=="switchmode"){switch_editor_mode(this.editorid);return }else{if(cmd.substr(0,6)=="resize"){var size_change=parseInt(cmd.substr(9),10);var change_direction=parseInt(cmd.substr(7,1),10)=="1"?1:-1;this.resize_editor(size_change*change_direction);return }}this.check_focus();var ret;if(cmd.substr(0,4)=="wrap"){ret=this.wrap_tags(cmd.substr(6),(cmd.substr(4,1)=="1"?true:false))}else{if(this[cmd]){ret=this[cmd](e)}else{try{ret=this.apply_format(cmd,false,(typeof arg=="undefined"?true:arg))}catch(e){this.handle_error(cmd,e);ret=false}}}if(cmd!="undo"){this.history.add_snapshot(this.get_editor_contents())}this.set_context(cmd);this.check_focus();return ret};this.insertimage=function(e,img){if(typeof img=="undefined"){img=this.show_prompt(vbphrase.enter_image_url,"http://",true)}if(img=this.verify_prompt(img)){return this.apply_format("insertimage",false,img)}else{return false}};this.wrap_tags=function(tagname,useoption,selection){tagname=tagname.toUpperCase();switch(tagname){case"CODE":case"HTML":case"PHP":this.apply_format("removeformat");break}if(typeof selection=="undefined"){selection=this.get_selection();if(selection===false){selection=""}else{selection=new String(selection)}}var opentag;if(useoption===true){var option=this.show_prompt(construct_phrase(vbphrase.enter_tag_option,("["+tagname+"]")),"",false);if(option=this.verify_prompt(option)){opentag="["+tagname+'="'+option+'"]'}else{return false}}else{if(useoption!==false){opentag="["+tagname+'="'+useoption+'"]'}else{opentag="["+tagname+"]"}}var closetag="[/"+tagname+"]";var text=opentag+selection+closetag;this.insert_text(text,opentag.vBlength(),closetag.vBlength());return false};this.spelling=function(){if(is_ie){try{eval("new ActiveXObject('ieSpell.ieSpellExtension').CheckDocumentNode(this.spellobj);")}catch(e){if(e.number==-2146827859&&confirm(vbphrase.iespell_not_installed)){window.open("http://www.iespell.com/download.php")}}}else{if(is_moz){}}};this.handle_error=function(cmd,e){};this.show_prompt=function(dialogtxt,defaultval,forceltr){var returnvalue;if(is_ie7){var base_tag=fetch_tags(document,"base");var modal_prefix;if(base_tag&&base_tag[0]&&base_tag[0].href){modal_prefix=base_tag[0].href}else{modal_prefix=""}returnvalue=window.showModalDialog(modal_prefix+"clientscript/ieprompt.html?",{value:defaultval,label:dialogtxt,dir:document.dir,title:document.title,forceltr:(typeof (forceltr)!="undefined"?forceltr:false)},"dialogWidth:320px; dialogHeight:150px; dialogTop:"+(parseInt(window.screenTop)+parseInt(window.event.clientY)+parseInt(document.body.scrollTop)-100)+"px; dialogLeft:"+(parseInt(window.screenLeft)+parseInt(window.event.clientX)+parseInt(document.body.scrollLeft)-160)+"px; resizable: No;")}else{returnvalue=prompt(dialogtxt,defaultval)}if(typeof (returnvalue)=="undefined"){return false}else{if(returnvalue==false||returnvalue==null){return returnvalue}else{return PHP.trim(new String(returnvalue))}}};this.verify_prompt=function(str){switch(str){case"http://":case"null":case"undefined":case"false":case"":case null:case false:return false;default:return str}};this.open_smilie_window=function(width,height){smilie_window=openWindow("misc.php?"+SESSIONURL+"do=getsmilies&editorid="+this.editorid,width,height,"smilie_window");window.onunload=vB_Text_Editor_Events.prototype.smiliewindow_onunload};this.resize_editor=function(change){var newheight=parseInt(this.editbox.style.height,10)+change;if(newheight>=60){this.editbox.style.height=newheight+"px"}};this.destroy_popup=function(popupname){this.popups[popupname].parentNode.removeChild(this.popups[popupname]);this.popups[popupname]=null};this.destroy=function(){var i;for(i in this.buttons){if(YAHOO.lang.hasOwnProperty(this.buttons,i)){this.set_control_style(this.buttons[i],"button","normal")}}for(var menu in this.popups){if(YAHOO.lang.hasOwnProperty(this.popups,menu)){this.destroy_popup(menu)}}if(this.fontoptions){for(i in this.fontoptions){if(YAHOO.lang.hasOwnProperty(this.fontoptions,i)&&i!=""){this.fontoptions[i].parentNode.removeChild(this.fontoptions[i])}}this.fontoptions[""].style.display=""}if(this.sizeoptions){for(i in this.sizeoptions){if(YAHOO.lang.hasOwnProperty(this.sizeoptions,i)&&i!=""){this.sizeoptions[i].parentNode.removeChild(this.sizeoptions[i])}}this.sizeoptions[""].style.display=""}};this.collapse_selection_end=function(){var range;if(this.editdoc.selection){range=this.editdoc.selection.createRange();eval("range.move('character', -1);");range.collapse(false);range.select()}else{if(document.selection&&document.selection.createRange){range=document.selection.createRange();range.collapse(false);range.select()}else{if(typeof (this.editdoc.selectionStart)!="undefined"){var sel_text=this.editdoc.value.substr(this.editdoc.selectionStart,this.editdoc.selectionEnd-this.editdoc.selectionStart);this.editdoc.selectionStart=this.editdoc.selectionStart+sel_text.vBlength()}else{if(window.getSelection){}}}}};if(this.wysiwyg_mode){this.disable_editor=function(text){if(!this.disabled){this.disabled=true;var hider=fetch_object(this.editorid+"_hider");if(hider){hider.parentNode.removeChild(hider)}var div=document.createElement("div");div.id=this.editorid+"_hider";div.className="wysiwyg";div.style.border="2px inset";div.style.margin="0px";div.style.padding="0px";div.style.width=this.editbox.style.width;div.style.height=this.editbox.style.height;var childdiv=document.createElement("div");childdiv.style.margin="8px";childdiv.innerHTML=text;div.appendChild(childdiv);this.editbox.parentNode.appendChild(div);this.editbox.style.width="0px";this.editbox.style.height="0px";this.editbox.style.border="none"}};this.enable_editor=function(text){if(typeof text!="undefined"){this.set_editor_contents(text)}var hider=fetch_object(this.editorid+"_hider");if(hider){hider.parentNode.removeChild(hider)}this.disabled=false};this.write_editor_contents=function(text,doinit){if(text==""){if(is_ie){text="<p></p>"}else{if(is_moz){text="<br />"}}}if(this.editdoc&&this.editdoc.initialized){this.editdoc.body.innerHTML=text}else{if(doinit&&typeof Array.prototype.map=="undefined"){this.editdoc.designMode="on"}this.editdoc=this.editwin.document;this.editdoc.open("text/html","replace");this.editdoc.write(text);this.editdoc.close();if(doinit){this.editdoc.body.contentEditable=true;if(typeof Array.prototype.map!="undefined"){this.editdoc.designMode="on"}}this.editdoc.body.spellcheck=true;this.editdoc.initialized=true;this.set_editor_style()}this.set_direction()};this.set_editor_contents=function(initial_text){if(fetch_object(this.editorid+"_iframe")){this.editbox=fetch_object(this.editorid+"_iframe")}else{var iframe=document.createElement("iframe");if(is_ie&&window.location.protocol=="https:"){iframe.src="clientscript/index.html"}this.editbox=this.textobj.parentNode.appendChild(iframe);this.editbox.id=this.editorid+"_iframe";this.editbox.tabIndex=1}if(!is_ie){this.editbox.style.border="2px inset"}this.set_editor_width(typeof (this.textobj.style.oWidth)!="undefined"?this.textobj.style.oWidth:this.textobj.style.width);this.editbox.style.height=this.textobj.style.height;this.textobj.style.display="none";this.editwin=this.editbox.contentWindow;this.editdoc=this.editwin.document;this.write_editor_contents((typeof initial_text=="undefined"?this.textobj.value:initial_text),true);if(this.editdoc.dir=="rtl"){}this.spellobj=this.editdoc.body;this.editdoc.editorid=this.editorid;this.editwin.editorid=this.editorid};this.set_editor_width=function(width,overwrite_original){this.editbox.style.width=width};this.set_direction=function(){this.editdoc.dir=this.textobj.dir};this.set_editor_style=function(){var wysiwyg_csstext="";var have_usercss=false;var all_stylesheets=fetch_all_stylesheets(document.styleSheets);for(var ss=0;ss<all_stylesheets.length;ss++){try{var rules=(all_stylesheets[ss].cssRules?all_stylesheets[ss].cssRules:all_stylesheets[ss].rules);if(rules.length<=0){continue}}catch(e){continue}for(var i=0;i<rules.length;i++){if(!rules[i].selectorText){continue}var process=false;var selectors=new Array();if(rules[i].selectorText.indexOf(".wysiwyg")>=0){var split_selectors=rules[i].selectorText.split(",");for(var selid=0;selid<split_selectors.length;selid++){if(split_selectors[selid].indexOf(".wysiwyg")>=0){selectors.push(split_selectors[selid])}if(split_selectors[selid].indexOf("#usercss")>=0){have_usercss=true}}process=true}if(process){var css_rules="{ "+rules[i].style.cssText+" }";if(is_moz){css_rules=css_rules.replace(/; /g," !important; ")}wysiwyg_csstext+=selectors.join(", ")+" "+css_rules+"\n"}}}wysiwyg_csstext+=" p { margin: 0px; } .inlineimg { vertical-align: middle; }";if(is_ie){this.editdoc.createStyleSheet().cssText=wysiwyg_csstext}else{var newss=this.editdoc.createElement("style");newss.type="text/css";newss.innerHTML=wysiwyg_csstext;this.editdoc.documentElement.childNodes[0].appendChild(newss)}if(have_usercss){this.editdoc.body.parentNode.id="usercss"}this.editdoc.body.className="wysiwyg"};this.set_editor_functions=function(){this.editdoc.onmouseup=vB_Text_Editor_Events.prototype.editdoc_onmouseup;this.editdoc.onkeyup=vB_Text_Editor_Events.prototype.editdoc_onkeyup;if(this.editdoc.attachEvent){this.editdoc.body.attachEvent("onresizestart",vB_Text_Editor_Events.prototype.editdoc_onresizestart)}this.editwin.onfocus=vB_Text_Editor_Events.prototype.editwin_onfocus;this.editwin.onblur=vB_Text_Editor_Events.prototype.editwin_onblur};this.set_context=function(cmd){for(var i in contextcontrols){if(!YAHOO.lang.hasOwnProperty(contextcontrols,i)){continue}var obj=fetch_object(this.editorid+"_cmd_"+contextcontrols[i]);if(obj!=null){var state=this.editdoc.queryCommandState(contextcontrols[i]);if(obj.state!=state){obj.state=state;this.button_context(obj,(obj.cmd==cmd?"mouseover":"mouseout"))}}}this.set_font_context();this.set_size_context();this.set_color_context()};this.set_font_context=function(fontstate){if(this.buttons.fontname){if(typeof fontstate=="undefined"){fontstate=this.editdoc.queryCommandValue("fontname")}switch(fontstate){case"":if(!is_ie&&window.getComputedStyle){fontstate=this.editdoc.body.style.fontFamily}break;case null:fontstate="";break}if(fontstate!=this.fontstate){this.fontstate=fontstate;var thingy=PHP.ucfirst(this.fontstate,",");var i;if(this.popupmode){for(i in this.fontoptions){if(YAHOO.lang.hasOwnProperty(this.fontoptions,i)){this.fontoptions[i].style.display=(i==thingy?"":"none")}}}else{for(i=0;i<this.buttons.fontname.options.length;i++){if(this.buttons.fontname.options[i].value==thingy){this.buttons.fontname.selectedIndex=i;break}}}}}};this.set_size_context=function(sizestate){if(this.buttons.fontsize){if(typeof sizestate=="undefined"){sizestate=this.editdoc.queryCommandValue("fontsize")}switch(sizestate){case null:case"":if(is_moz){sizestate=this.translate_fontsize(this.editdoc.body.style.fontSize)}break}if(sizestate!=this.sizestate){this.sizestate=sizestate;var i;if(this.popupmode){for(i in this.sizeoptions){if(YAHOO.lang.hasOwnProperty(this.sizeoptions,i)){this.sizeoptions[i].style.display=(i==this.sizestate?"":"none")}}}else{for(i=0;i<this.buttons.fontsize.options.length;i++){if(this.buttons.fontsize.options[i].value==this.sizestate){this.buttons.fontsize.selectedIndex=i;break}}}}}};this.set_color_context=function(colorstate){if(this.buttons.forecolor){if(typeof colorstate=="undefined"){colorstate=this.editdoc.queryCommandValue("forecolor")}if(colorstate!=this.colorstate){if(this.popupmode){var obj=fetch_object(this.editorid+"_color_"+this.translate_color_commandvalue(this.colorstate));if(obj!=null){obj.state=false;this.button_context(obj,"mouseout","menu")}this.colorstate=colorstate;elmid=this.editorid+"_color_"+this.translate_color_commandvalue(colorstate);obj=fetch_object(elmid);if(obj!=null){obj.state=true;this.button_context(obj,"mouseout","menu")}}else{this.colorstate=colorstate;colorstate=this.translate_color_commandvalue(this.colorstate);for(var i=0;i<this.buttons.forecolor.options.length;i++){if(this.buttons.forecolor.options[i].value==colorstate){this.buttons.forecolor.selectedIndex=i;break}}}}}};this.translate_color_commandvalue=function(forecolor){return this.translate_silly_hex((forecolor&255).toString(16),((forecolor>>8)&255).toString(16),((forecolor>>16)&255).toString(16))};this.translate_silly_hex=function(r,g,b){return coloroptions["#"+(PHP.str_pad(r,2,0)+PHP.str_pad(g,2,0)+PHP.str_pad(b,2,0)).toUpperCase()]};this.apply_format=function(cmd,dialog,argument){this.editdoc.execCommand(cmd,(typeof dialog=="undefined"?false:dialog),(typeof argument=="undefined"?true:argument));return false};this.createlink=function(e,url){return this.apply_format("createlink",is_ie,(typeof url=="undefined"?true:url))};this.email=function(e,email){if(typeof email=="undefined"){email=this.show_prompt(vbphrase.enter_email_link,"",true)}email=this.verify_prompt(email);if(email===false){return this.apply_format("unlink")}else{var selection=this.get_selection();return this.insert_text('<a href="mailto:'+email+'">'+(selection?selection:email)+"</a>",(selection?true:false))}};this.insert_smilie=function(e,smilietext,smiliepath,smilieid){this.check_focus();return this.insert_text('<img src="'+smiliepath+'" border="0" class="inlineimg" alt="0" smilieid="'+smilieid+'" />',false)};this.get_editor_contents=function(){return this.editdoc.body.innerHTML};this.get_selection=function(){var range=this.editdoc.selection.createRange();if(range.htmlText&&range.text){return range.htmlText}else{var do_not_steal_this_code_html="";for(var i=0;i<range.length;i++){do_not_steal_this_code_html+=range.item(i).outerHTML}return do_not_steal_this_code_html}};this.insert_text=function(text,movestart,moveend){this.check_focus();if(typeof (this.editdoc.selection)!="undefined"&&this.editdoc.selection.type!="Text"&&this.editdoc.selection.type!="None"){movestart=false;this.editdoc.selection.clear()}var sel=this.editdoc.selection.createRange();sel.pasteHTML(text);if(text.indexOf("\n")==-1){if(movestart===false){}else{if(typeof movestart!="undefined"){sel.moveStart("character",-text.vBlength()+movestart);sel.moveEnd("character",-moveend)}else{sel.moveStart("character",-text.vBlength())}}sel.select()}};this.prepare_submit=function(subjecttext,minchars){this.textobj.value=this.get_editor_contents();var returnvalue=validatemessage(stripcode(this.textobj.value,true),subjecttext,minchars);if(returnvalue){return returnvalue}else{if(this.captcha!=null&&this.captcha.failed){return false}else{this.check_focus();return false}}};if(is_moz){this._set_editor_contents=this.set_editor_contents;this.set_editor_contents=function(initial_text){this._set_editor_contents(initial_text);this.editdoc.addEventListener("keypress",vB_Text_Editor_Events.prototype.editdoc_onkeypress,true)};this.translate_color_commandvalue=function(forecolor){if(forecolor==""||forecolor==null){forecolor=window.getComputedStyle(this.editdoc.body,null).getPropertyValue("color")}if(forecolor.toLowerCase().indexOf("rgb")==0){var matches=forecolor.match(/^rgb\s*\(([0-9]+),\s*([0-9]+),\s*([0-9]+)\)$/);if(matches){return this.translate_silly_hex((matches[1]&255).toString(16),(matches[2]&255).toString(16),(matches[3]&255).toString(16))}else{return this.translate_color_commandvalue(null)}}else{return forecolor}};this.translate_fontsize=function(csssize){switch(csssize){case"7.5pt":case"10px":return 1;case"10pt":return 2;case"12pt":return 3;case"14pt":return 4;case"18pt":return 5;case"24pt":return 6;case"36pt":return 7;default:return""}};this._apply_format=this.apply_format;this.apply_format=function(cmd,dialog,arg){this.editdoc.execCommand("useCSS",false,true);return this._apply_format(cmd,dialog,arg)};this._createlink=this.createlink;this.createlink=function(e,url){if(typeof url=="undefined"){url=this.show_prompt(vbphrase.enter_link_url,"http://",true)}if((url=this.verify_prompt(url))!==false){if(this.get_selection()){this.apply_format("unlink");this._createlink(e,url)}else{this.insert_text('<a href="'+url+'">'+url+"</a>")}}return true};this.insert_smilie=function(e,smilietext,smiliepath,smilieid){this.check_focus();try{this.apply_format("InsertImage",false,smiliepath);var smilies=fetch_tags(this.editdoc.body,"img");for(var i=0;i<smilies.length;i++){if(smilies[i].src==smiliepath){smilies[i].className="inlineimg";if(smilies[i].getAttribute("smilieid")<1){smilies[i].setAttribute("smilieid",smilieid);smilies[i].setAttribute("border","0")}}}}catch(e){}};this.get_selection=function(){selection=this.editwin.getSelection();this.check_focus();var range=selection?selection.getRangeAt(0):this.editdoc.createRange();return this.read_nodes(range.cloneContents(),false)};this.insert_text=function(str){this.editdoc.execCommand("insertHTML",false,str)};this.set_editor_functions=function(){this.editdoc.addEventListener("mouseup",vB_Text_Editor_Events.prototype.editdoc_onmouseup,true);this.editdoc.addEventListener("keyup",vB_Text_Editor_Events.prototype.editdoc_onkeyup,true);this.editwin.addEventListener("focus",vB_Text_Editor_Events.prototype.editwin_onfocus,true);this.editwin.addEventListener("blur",vB_Text_Editor_Events.prototype.editwin_onblur,true)};this.add_range=function(node){this.check_focus();var sel=this.editwin.getSelection();var range=this.editdoc.createRange();range.selectNodeContents(node);sel.removeAllRanges();sel.addRange(range)};this.read_nodes=function(root,toptag){var html="";var moz_check=/_moz/i;switch(root.nodeType){case Node.ELEMENT_NODE:case Node.DOCUMENT_FRAGMENT_NODE:var closed;var i;if(toptag){closed=!root.hasChildNodes();html="<"+root.tagName.toLowerCase();var attr=root.attributes;for(i=0;i<attr.length;++i){var a=attr.item(i);if(!a.specified||a.name.match(moz_check)||a.value.match(moz_check)){continue}html+=" "+a.name.toLowerCase()+'="'+a.value+'"'}html+=closed?" />":">"}for(i=root.firstChild;i;i=i.nextSibling){html+=this.read_nodes(i,true)}if(toptag&&!closed){html+="</"+root.tagName.toLowerCase()+">"}break;case Node.TEXT_NODE:html=PHP.htmlspecialchars(root.data);break}return html};this.insert_node_at_selection=function(text){this.check_focus();var sel=this.editwin.getSelection();var range=sel?sel.getRangeAt(0):this.editdoc.createRange();sel.removeAllRanges();range.deleteContents();var node=range.startContainer;var pos=range.startOffset;switch(node.nodeType){case Node.ELEMENT_NODE:if(text.nodeType==Node.DOCUMENT_FRAGMENT_NODE){selNode=text.firstChild}else{selNode=text}node.insertBefore(text,node.childNodes[pos]);this.add_range(selNode);break;case Node.TEXT_NODE:if(text.nodeType==Node.TEXT_NODE){var text_length=pos+text.length;node.insertData(pos,text.data);range=this.editdoc.createRange();range.setEnd(node,text_length);range.setStart(node,text_length);sel.addRange(range)}else{node=node.splitText(pos);var selNode;if(text.nodeType==Node.DOCUMENT_FRAGMENT_NODE){selNode=text.firstChild}else{selNode=text}node.parentNode.insertBefore(text,node);this.add_range(selNode)}break}}}else{if(is_opera){this._createlink=this.createlink;this.createlink=function(e,url){if(typeof url=="undefined"){url=this.show_prompt(vbphrase.enter_link_url,"http://",true)}if((url=this.verify_prompt(url))!==false){if(this.get_selection()){this.apply_format("unlink");this._createlink(e,url)}else{this.insert_text('<a href="'+url+'">'+url+"</a>")}}return true};this.insert_smilie=function(e,smilietext,smiliepath,smilieid){this.check_focus();try{this.apply_format("InsertImage",false,smiliepath);var smilies=fetch_tags(this.editdoc.body,"img");for(var i=0;i<smilies.length;i++){if(smilies[i].src==smiliepath){smilies[i].className="inlineimg";if(smilies[i].getAttribute("smilieid")<1){smilies[i].setAttribute("smilieid",smilieid);smilies[i].setAttribute("border","0")}}}}catch(e){}};this.get_selection=function(){selection=this.editwin.getSelection();this.check_focus();range=selection?selection.getRangeAt(0):this.editdoc.createRange();var lsserializer=document.implementation.createLSSerializer();return lsserializer.writeToString(range.cloneContents())};this.insert_text=function(str){this.editdoc.execCommand("insertHTML",false,str)}}}}else{this.disable_editor=function(text){if(!this.disabled){this.disabled=true;if(typeof text!="undefined"){this.editbox.value=text}this.editbox.disabled=true}};this.enable_editor=function(text){if(typeof text!="undefined"){this.editbox.value=text}this.editbox.disabled=false;this.disabled=false};this.write_editor_contents=function(text){this.textobj.value=text};this.set_editor_contents=function(initial_text){var iframe=this.textobj.parentNode.getElementsByTagName("iframe")[0];if(iframe){this.textobj.style.display="";this.textobj.style.width=iframe.style.width;this.textobj.style.height=iframe.style.height;iframe.style.width="0px";iframe.style.height="0px";iframe.style.border="none"}this.editwin=this.textobj;this.editdoc=this.textobj;this.editbox=this.textobj;this.spellobj=this.textobj;this.set_editor_width(this.textobj.style.width);if(typeof initial_text!="undefined"){this.write_editor_contents(initial_text)}this.editdoc.editorid=this.editorid;this.editwin.editorid=this.editorid;this.history.add_snapshot(this.get_editor_contents())};this.set_editor_width=function(width,overwrite_original){if(typeof (this.textobj.style.oWidth)=="undefined"||overwrite_original){this.textobj.style.oWidth=width}if(is_ie){this.textobj.style.width=this.textobj.style.oWidth;var orig_offset=this.textobj.offsetWidth;if(orig_offset>0){this.textobj.style.width=orig_offset+"px";this.textobj.style.width=(orig_offset+orig_offset-this.textobj.offsetWidth)+"px"}}else{this.textobj.style.width=width}};this.set_editor_style=function(){};this.set_editor_functions=function(){if(this.editdoc.addEventListener){this.editdoc.addEventListener("keypress",vB_Text_Editor_Events.prototype.editdoc_onkeypress,false)}else{if(is_ie){this.editdoc.onkeydown=vB_Text_Editor_Events.prototype.editdoc_onkeypress}}this.editwin.onfocus=vB_Text_Editor_Events.prototype.editwin_onfocus;this.editwin.onblur=vB_Text_Editor_Events.prototype.editwin_onblur};this.set_context=function(){};this.apply_format=function(cmd,dialog,argument){switch(cmd){case"bold":case"italic":case"underline":this.wrap_tags(cmd.substr(0,1),false);return ;case"justifyleft":case"justifycenter":case"justifyright":this.wrap_tags(cmd.substr(7),false);return ;case"indent":this.wrap_tags(cmd,false);return ;case"fontname":this.wrap_tags("font",argument);return ;case"fontsize":this.wrap_tags("size",argument);return ;case"forecolor":this.wrap_tags("color",argument);return ;case"createlink":var sel=this.get_selection();if(sel){this.wrap_tags("url",argument)}else{this.wrap_tags("url",argument,argument)}return ;case"insertimage":this.wrap_tags("img",false,argument);return ;case"removeformat":return }};this.undo=function(){this.history.add_snapshot(this.get_editor_contents());this.history.move_cursor(-1);var str;if((str=this.history.get_snapshot())!==false){this.editdoc.value=str}};this.redo=function(){this.history.move_cursor(1);var str;if((str=this.history.get_snapshot())!==false){this.editdoc.value=str}};this.strip_simple=function(tag,str,iterations){var opentag="["+tag+"]";var closetag="[/"+tag+"]";if(typeof iterations=="undefined"){iterations=-1}while((startindex=PHP.stripos(str,opentag))!==false&&iterations!=0){iterations--;if((stopindex=PHP.stripos(str,closetag))!==false){var text=str.substr(startindex+opentag.length,stopindex-startindex-opentag.length);str=str.substr(0,startindex)+text+str.substr(stopindex+closetag.length)}else{break}}return str};this.strip_complex=function(tag,str,iterations){var opentag="["+tag+"=";var closetag="[/"+tag+"]";if(typeof iterations=="undefined"){iterations=-1}while((startindex=PHP.stripos(str,opentag))!==false&&iterations!=0){iterations--;if((stopindex=PHP.stripos(str,closetag))!==false){var openend=PHP.stripos(str,"]",startindex);if(openend!==false&&openend>startindex&&openend<stopindex){var text=str.substr(openend+1,stopindex-openend-1);str=str.substr(0,startindex)+text+str.substr(stopindex+closetag.length)}else{break}}else{break}}return str};this.removeformat=function(e){var simplestrip=new Array("b","i","u");var complexstrip=new Array("font","color","size");var str=this.get_selection();if(str===false){return }var tag;for(tag in simplestrip){if(YAHOO.lang.hasOwnProperty(simplestrip,tag)){str=this.strip_simple(simplestrip[tag],str)}}for(tag in complexstrip){if(YAHOO.lang.hasOwnProperty(complexstrip,tag)){str=this.strip_complex(complexstrip[tag],str)}}this.insert_text(str)};this.createlink=function(e,url){this.prompt_link("url",url,vbphrase.enter_link_url,"http://")};this.unlink=function(e){var sel=this.get_selection();sel=this.strip_simple("url",sel);sel=this.strip_complex("url",sel);this.insert_text(sel)};this.email=function(e,email){this.prompt_link("email",email,vbphrase.enter_email_link,"")};this.insert_smilie=function(e,smilietext){this.check_focus();return this.insert_text(smilietext,smilietext.length,0)};this.prompt_link=function(tagname,value,phrase,iprompt){if(typeof value=="undefined"){value=this.show_prompt(phrase,iprompt,true)}if((value=this.verify_prompt(value))!==false){if(this.get_selection()){this.apply_format("unlink");this.wrap_tags(tagname,value)}else{this.wrap_tags(tagname,value,value)}}return true};this.insertorderedlist=function(e){this.insertlist(vbphrase.insert_ordered_list,"1")};this.insertunorderedlist=function(e){this.insertlist(vbphrase.insert_unordered_list,"")};this.insertlist=function(phrase,listtype){var opentag="[LIST"+(listtype?("="+listtype):"")+"]\n";var closetag="[/LIST]";var txt;if(txt=this.get_selection()){var regex=new RegExp("([\r\n]+|^[\r\n]*)(?!\\[\\*\\]|\\[\\/?list)(?=[^\r\n])","gi");txt=opentag+PHP.trim(txt).replace(regex,"$1[*]")+"\n"+closetag;this.insert_text(txt,txt.vBlength(),0)}else{this.insert_text(opentag+closetag,opentag.length,closetag.length);if(is_ie7){var base_tag=fetch_tags(document,"base");var modal_prefix;if(base_tag&&base_tag[0]&&base_tag[0].href){modal_prefix=base_tag[0].href}else{modal_prefix=""}var listvalue=window.showModalDialog(modal_prefix+"clientscript/ieprompt.html?",{value:"",label:vbphrase.enter_list_item,dir:document.dir,title:document.title,listtype:listtype},"dialogWidth:320px; dialogHeight:232px; dialogTop:"+(parseInt(window.screenTop)+parseInt(window.event.clientY)+parseInt(document.body.scrollTop)-100)+"px; dialogLeft:"+(parseInt(window.screenLeft)+parseInt(window.event.clientX)+parseInt(document.body.scrollLeft)-160)+"px; resizable: No;");if(this.verify_prompt(listvalue)){this.insert_text(listvalue,listvalue.vBlength(),0)}}else{while(listvalue=this.show_prompt(vbphrase.enter_list_item,"",false)){listvalue="[*]"+listvalue+"\n";this.insert_text(listvalue,listvalue.vBlength(),0)}}}};this.outdent=function(e){var sel=this.get_selection();sel=this.strip_simple("indent",sel,1);this.insert_text(sel)};this.get_editor_contents=function(){return this.editdoc.value};this.get_selection=function(){if(typeof (this.editdoc.selectionStart)!="undefined"){return this.editdoc.value.substr(this.editdoc.selectionStart,this.editdoc.selectionEnd-this.editdoc.selectionStart)}else{if(document.selection&&document.selection.createRange){return document.selection.createRange().text}else{if(window.getSelection){return window.getSelection()+""}else{return false}}}};this.insert_text=function(text,movestart,moveend){this.check_focus();if(document.selection&&document.selection.createRange){var sel=document.selection.createRange();sel.text=text.replace(/\r?\n/g,"\r\n");if(movestart===false){}else{if(typeof movestart!="undefined"){sel.moveStart("character",-text.vBlength()+movestart);sel.moveEnd("character",-moveend)}else{sel.moveStart("character",-text.vBlength())}}sel.select()}else{if(typeof (this.editdoc.selectionStart)!="undefined"){var opn=this.editdoc.selectionStart+0;var scrollpos=this.editdoc.scrollTop;this.editdoc.value=this.editdoc.value.substr(0,this.editdoc.selectionStart)+text+this.editdoc.value.substr(this.editdoc.selectionEnd);if(movestart===false){}else{if(typeof movestart!="undefined"){this.editdoc.selectionStart=opn+movestart;this.editdoc.selectionEnd=opn+text.vBlength()-moveend}else{this.editdoc.selectionStart=opn;this.editdoc.selectionEnd=opn+text.vBlength()}}this.editdoc.scrollTop=scrollpos}else{this.editdoc.value+=text}}};this.prepare_submit=function(subjecttext,minchars){var returnvalue=validatemessage(this.textobj.value,subjecttext,minchars);if(returnvalue){return returnvalue}else{if(this.captcha!=null&&this.captcha.failed){return returnvalue}else{this.check_focus();return false}}};if(is_saf||(is_opera&&(!opera.version||opera.version()<8))){this.insertlist=function(phrase,listtype){var opentag="[LIST"+(listtype?("="+listtype):"")+"]\n";var closetag="[/LIST]";var txt;if(txt=this.get_selection()){var regex=new RegExp("([\r\n]+|^[\r\n]*)(?!\\[\\*\\]|\\[\\/?list)(?=[^\r\n])","gi");txt=opentag+PHP.trim(txt).replace(regex,"$1[*]")+"\n"+closetag;this.insert_text(txt,txt.vBlength(),0)}else{this.insert_text(opentag,opentag.length,0);while(listvalue=prompt(vbphrase.enter_list_item,"")){listvalue="[*]"+listvalue+"\n";this.insert_text(listvalue,listvalue.vBlength(),0)}this.insert_text(closetag,closetag.length,0)}}}}this.init()}function vB_Text_Editor_Events(){}vB_Text_Editor_Events.prototype.smilie_onclick=function(A){vB_Editor[this.editorid].insert_smilie(A,this.alt,this.src,this.id.substr(this.id.lastIndexOf("_")+1));if(typeof smilie_window!="undefined"&&!smilie_window.closed){smilie_window.focus()}return false};vB_Text_Editor_Events.prototype.command_button_onmouseevent=function(A){A=do_an_e(A);if(A.type=="click"){vB_Editor[this.editorid].format(A,this.cmd,false,true)}vB_Editor[this.editorid].button_context(this,A.type)};vB_Text_Editor_Events.prototype.popup_button_onmouseevent=function(A){A=do_an_e(A);if(A.type=="click"){this._onclick(A);vB_Editor[this.editorid].menu_context(this,"mouseover")}else{vB_Editor[this.editorid].menu_context(this,A.type)}};vB_Text_Editor_Events.prototype.popup_button_show=function(C,B){var A=true;if(typeof vB_Editor[C.editorid].popups[C.cmd]=="undefined"||vB_Editor[C.editorid].popups[C.cmd]==null){A=vB_Editor[C.editorid].init_popup_menu(C)}else{if(C.cmd=="attach"&&(typeof vB_Attachments=="undefined"||!vB_Attachments.has_attachments())){fetch_object("manage_attachments_button").onclick();return }}if(A){this._show(C,B)}};vB_Text_Editor_Events.prototype.formatting_select_onchange=function(B){var A=this.options[this.selectedIndex].value;if(A!=""){vB_Editor[this.editorid].format(B,this.cmd,A)}this.selectedIndex=0};vB_Text_Editor_Events.prototype.smilieselect_onchange=function(A){if(this.options[this.selectedIndex].value!=""){vB_Editor[this.editorid].insert_smilie(A,this.options[this.selectedIndex].value,this.options[this.selectedIndex].smiliepath,this.options[this.selectedIndex].smilieid)}this.selectedIndex=0};vB_Text_Editor_Events.prototype.attachselect_onchange=function(B){var A=this.options[this.selectedIndex].value;if(A!=""){vB_Editor[this.editorid].wrap_tags("attach",false,A)}this.selectedIndex=0