All pastes #569653 Raw Edit

Anonymous

public javascript v1 · immutable
·published 2007-06-16 10:19 UTC
rendered paste body
// ==UserScript==// @name          WLR for IE & Opera// @namespace     http://forums.whirlpool.net.au// @version		  0.1// @description   A port to IE & Opera of Meat Sack's WLR script// @include       http://forums.whirlpool.net.au/*// @exclude		  http://forums.whirlpool.net.au/forum-replies.cfm?*p=-2*// ==/UserScript==/**important to do**///set up otions page to turn on/off features//put the smack-down on Bravo/**not important to do**///add wiki autolinks//contact is now online//common phrases//delicious tagger?/*function bugga(bugsName,bugsValue){	if($('#hideShow')[0] === undefined){			$('body').prepend('<button id="hideShow" style="float:right;">Hide/Show Bugga</button><div style="position:absolute;display:none;width:700px;height:600px;border:2px red solid;overflow:scroll;background-color:white;color:#4A4A4A" id="debugDiv"><h3>Bugga:</h3><br /></div>');	}	var tempHoldDebug = $('#debugDiv').html();	$('#debugDiv').html(tempHoldDebug+"<p style='color:green;font-weight:bold;'>----------------------------------</p><p>"+"<span style='color:#008000;'>"+bugsName+":</span>&nbsp;&nbsp;"+bugsValue+"</p>");	$('#hideShow').unbind();	$('#hideShow').mouseup( function(){$('#debugDiv').toggle();});}*/	/***Meat Sack's Smilies***/		var smlHappy = '<img src ="http://img.photobucket.com/albums/v215/thegooddale/smlHappy.gif" align ="baseline" border="none" />';		var smlFrown = '<img src ="http://img.photobucket.com/albums/v215/thegooddale/smlFrown.gif" align="baseline" border="none" />';		var smlRazz = '<img src ="http://img.photobucket.com/albums/v215/thegooddale/smlRazz.gif" align="baseline" border="none" />';		var smlGrin ='<img src ="http://img.photobucket.com/albums/v215/thegooddale/smlGrin.gif" align="baseline" border="none" />';		var smlNtl ='<img src ="http://img.photobucket.com/albums/v215/thegooddale/smlNtl.gif" align="baseline" border="none" />';		var smlWink ='<img src ="http://img.photobucket.com/albums/v215/thegooddale/smlWink.gif" align="baseline" border="none" />';		var smlRoll ='<img src ="http://img.photobucket.com/albums/v215/thegooddale/smlRoll.gif" align="baseline" border="none" />';		var smlShock ='<img src ="http://img.photobucket.com/albums/v215/thegooddale/smlShock.gif" align="baseline" border="none" />';		var smlEvil ='<img src ="http://img.photobucket.com/albums/v215/thegooddale/smlEvil.gif" align="baseline" border="none" />';		var imgStar ='<img src ="http://img.photobucket.com/albums/v215/thegooddale/imgStar.gif" align="baseline" border="none" />';		var imgGUWPCT ='<img src ="http://img.photobucket.com/albums/v215/thegooddale/smileyG.png" align="baseline" border="none" />';				smileys = {			"&gt;:\\)"  : smlEvil,		":\\)"		: smlHappy,		":-\\)"		: smlHappy,		":\\("		: smlFrown,		":-\\("		: smlFrown,		":D"  		: smlGrin,		":-D"  		: smlGrin,		":\\|"		: smlNtl,		":-\\|"		: smlNtl,		":P"		: smlRazz,		":-P"		: smlRazz,		";\\)"		: smlWink,		";-\\)"		: smlWink,		"rolls eyes": smlRoll,		":o" 		: smlShock,		":-o" 		: smlShock,		"GUWPCT" 	: imgGUWPCT,		"gold star" : imgStar	};		regex = {};	for (key in smileys) {		regex[key] = new RegExp(key, 'g');	}		$('.bodytext').each(function(){		for (key in smileys) {			var smilRep = $(this).html().replace(regex[key], smileys[key]);			$(this).html(smilRep);		}	});/*******whirlcode********/var whirlCode = { 	                					wc_whirlBold :			{ encloseLeft : "[*", encloseRight  : "*]"},					wc_whirlItalic :		{ encloseLeft : "[/", encloseRight  : "/]"},					wc_whirlSingleQuote :	{ encloseLeft : "['", encloseRight  : "']"},					wc_whirlDoubleQuote :	{ encloseLeft : "[\"", encloseRight  : "\"]"},					wc_whirlQuote :			{ encloseLeft : "[+", encloseRight  : "+]"},					wc_whirlSuperscript :	{ encloseLeft : "[^", encloseRight  : "^]"},					wc_whirlSubscript :		{ encloseLeft : "[\\", encloseRight  : "\\]"},					wc_whirlStrike :		{ encloseLeft : "[-", encloseRight  : "-]"},					wc_whirlCourier :		{ encloseLeft : "[#", encloseRight  : "#]"},					wc_whirlSmall :			{ encloseLeft : "[(", encloseRight  : ")]"},					wc_whirlGrey :			{ encloseLeft : "[`", encloseRight  : "`]"},					wc_whirlSerif :			{ encloseLeft : "[~", encloseRight  : "~]"},					wc_whirlGoogle :		{ encloseLeft : "[?", encloseRight  : "?]"},					wc_whirlEscape :		{ encloseLeft : "[.", encloseRight  : ".]"},					wc_whirlWiki :			{ encloseLeft : "[[", encloseRight  : "]]"}			   }; /********whirlcode buttons*********/var wcButtons = '<div id="buttonsDiv">' +			'<button class="wcodeButtons" title="Bold WhirlCode" accesskey="b" id="wc_whirlBold" >Bold</button>' +			'<button class="wcodeButtons" title="Italic WhirlCode" accesskey="i" id="wc_whirlItalic" >Italic</button>' +			'<button class="wcodeButtons" title="SingleQuote WhirlCode" accesskey="t" id="wc_whirlSingleQuote" >\'quote\'</button>' +			'<button class="wcodeButtons" title="DoubleQuote WhirlCode" accesskey="q" id="wc_whirlDoubleQuote" >"quote"</button>' +			'<button class="wcodeButtons" title="Quote WhirlCode" accesskey="h" id="wc_whirlQuote" >who</button>' +			'<button class="wcodeButtons" title="Superscript WhirlCode" accesskey="p" id="wc_whirlSuperscript" >Super</button>' +			'<button class="wcodeButtons" title="Subscript WhirlCode" accesskey="\\" id="wc_whirlSubscript" >Sub</button>' +			'<button class="wcodeButtons" title="Strike WhirlCode" accesskey="k" id="wc_whirlStrike" >Strike</button>' +			'<button class="wcodeButtons" title="Courier WhirlCode" accesskey="c" id="wc_whirlCourier" >Courier</button>' +			'<button class="wcodeButtons" title="Small WhirlCode" accesskey="m" id="wc_whirlSmall" >Small</button>' +			'<button class="wcodeButtons" title="Grey WhirlCode" accesskey="r" id="wc_whirlGrey" >Grey</button>' +			'<button class="wcodeButtons" title="Serif WhirlCode" accesskey="s" id="wc_whirlSerif" >Serif</button>' +			'<button class="wcodeButtons" title="Google WhirlCode" accesskey="g" id="wc_whirlGoogle" >Google</button>' +			'<button class="wcodeButtons" title="Escape WhirlCode" accesskey="e" id="wc_whirlEscape" >Esc</button>' +			'<button class="wcodeButtons" title="Wiki WhirlCode" accesskey="w" id="wc_whirlWiki" >Wiki</button>' +			'<button class="wcodeButtons" title="URL Link" accesskey="u" id="wc_whirlurl" >URL</button>' +			'</div>';/*******whirlcode buttons event handler********/					   function doStuffToTheText(theTextBox){				   	$('.wcodeButtons').mouseup(function(){		var buttonID = $(this).attr('id');													var currentValue = theTextBox.value;		var theSelection = document.selection.createRange().text;		theTextBox.focus();		if(theSelection === ""){			if(buttonID == "wc_whirlurl"){								document.selection.createRange().text = '&<#^&#';								$('body').prepend('<div id="modal" style="width:300px;height:80px;position:fixed;padding:15px'+								  'z-index:50;top:50%;left:40%;opacity:1;background-color:#DBC0A2;">'+								  '<p>Enter link <b>address</b>:</p><input type="text" id="urlAddress">'+								  '</input>&nbsp;<button class="cancel">Cancel</button>&nbsp;<button id="ok">OK</button></div>');								  				$('body').prepend('<div id="modal2" style="width:300px;height:80px;position:fixed;padding:15px'+								  'z-index:49;top:50%;left:40%;opacity:1;background-color:#DBC0A2;">'+								  '<p>Enter link <b>title</b>:</p><input type="text" id="urlName">'+								  '</input>&nbsp;<button class="cancel">Cancel</button>&nbsp;<button id="ok2">OK</button></div>');								  								$('.cancel').mouseup(function(){					$('#modal,#modal2').remove();					$('#body')[0].value = $('#body')[0].value.replace("&<#^&#","");					theTextBox.focus();				});								setTimeout("$('#urlAddress').focus();", 5);								var urlAdd;								$('#ok')[0].onmouseup = firstOK;								$('#urlAddress')[0].onkeyup = function (evt) {					if (!evt) {						evt = window.event;					}					if(evt.keyCode == 13){						firstOK();					}				}; 								function firstOK(){					if ($('#urlAddress')[0].value !== ""){											urlAdd = $('#urlAddress')[0].value;												$('#modal').remove();						setTimeout("$('#urlName').focus();", 5);					}										}																	$('#ok2')[0].onmouseup = secondOk;				$('#urlName')[0].onkeyup = function (evt) {					if (!evt) {						evt = window.event;					}					if(evt.keyCode == 13){						secondOk();					}				}; 								function secondOk(){									if ($('#urlName')[0].value !== ""){											var urlN = $('#urlName')[0].value;							$('#modal2').remove();												if(urlAdd.indexOf('http') < 0){							$('#body')[0].value = $('#body')[0].value.replace('&<#^&#','<a href="http://'+urlAdd+'">'+urlN+'</a>');						}						else{							$('#body')[0].value = $('#body')[0].value.replace('&<#^&#','<a href="'+urlAdd+'">'+urlN+'</a>');													}										}				}								}								else if(((currentValue.split(whirlCode[buttonID].encloseLeft).length+currentValue.split(whirlCode[buttonID].encloseRight).length)  % 2) === 0){				document.selection.createRange().text = whirlCode[buttonID].encloseLeft;				}			else{				document.selection.createRange().text = whirlCode[buttonID].encloseRight;				}					}		else if((theSelection !== "") && (buttonID != 'wc_whirlurl')){				document.selection.createRange().text = whirlCode[buttonID].encloseLeft + theSelection + whirlCode[buttonID].encloseRight;		}		theTextBox.focus();		theSelection = '';	});	}var lrl;if(document.cookie.indexOf('wlrcookie') > -1){	var docCookArray = document.cookie.split('; ');	var wlrCookArray = [];			for(ca=0;ca<docCookArray.length;ca++){			if(docCookArray[ca].indexOf('wlrcookie') > -1){					var cookieSplit = docCookArray[ca].split('wlrcookie=')[1];			wlrCookArray.unshift(cookieSplit); //so oldest cookie is at end		}	}	var wlrCookArrayString = wlrCookArray.toString().replace(/,/,"");	var arr;		var regexCheat = wlrCookArrayString+"t%3D";		}	/*******run on forum-threads.cfm page********/	/****Cookies & Last Read Function on forum-threads.cfm page*****/if((document.URL.indexOf('threads') > -1) || (document.URL.indexOf('user') > -1)){	$('td[@width=23] a').each(function(){			var bottomLinkParent = $(this).parent();		var cutHref = this.href.slice(this.href.indexOf('t=')+2,this.href.indexOf('&p=-1#bottom'));		if(wlrCookArrayString.indexOf(cutHref) > -1){			bottomLinkParent.clone().css({opacity: "0.4"}).insertAfter(bottomLinkParent);			var getLastRead = regexCheat.slice(regexCheat.indexOf(cutHref), regexCheat.indexOf('t%3D', regexCheat.indexOf(cutHref)));			this.href = this.href.replace("&p=-1#bottom","").replace(""+cutHref+"", ""+decodeURIComponent(getLastRead)+"");			//bugga('this.href.replace("&p=-1#bottom","").replace(""+cutHref+"", ""+decodeURIComponent(getLastRead)+"");  ',this.href.replace("&p=-1#bottom","").replace(""+cutHref+"", ""+decodeURIComponent(getLastRead)+""));			bottomLinkParent.css({background:"#DDDDDD url(http://img.photobucket.com/albums/v215/thegooddale/red-ltgrey.gif) repeat scroll 0%"});			$(this).children('img').attr('alt','Jump to last read post in thread');		}	});	}	///end Cookies & Last Read Function on forum-threads.cfm page/*******run on forum-replies page********/if (document.URL.indexOf('replies') > -1) {		var threadNoCheck = $('a').contains('First post')[0].href.replace("&p=-1","");	var threadNumberWc;	if (threadNoCheck.indexOf('#') > -1){			threadNumberWc = threadNoCheck.slice(threadNoCheck.indexOf('t=')+2, threadNoCheck.indexOf('#'));	}		else{			threadNumberWc = threadNoCheck.split('t=')[1];	}		var replyLink = $('.breadtask a:first')[0].href;		/****Avatars*****/		var lnk = document.createElement('LINK');	lnk.rel = 'stylesheet';	lnk.type = 'text/css';	lnk.href = 'http://ideatriage.com/wlr/avatar/avatar.css';	document.getElementsByTagName( 'HEAD' )[0].appendChild( lnk );			$("td[@class^=bodyuser]").each(function(){			$(this).children('a:first').wrap('<div></div>'); //temp fix so the div:first-child in the WLR CSS works				var tempLinkuserId = $(this).children('div:eq(2)').children('a:first')[0].href;		var prunedId = tempLinkuserId.slice(tempLinkuserId.indexOf('id=')+3);		$(this).parent().addClass('wlr_'+prunedId);		});		if (replyLink.indexOf("print") === -1){ 	//check if thread is closed		$('.greylink:even').after('&nbsp;<span class="bar">| </span><a class="qquoteie greylink" href="">q-quote</a>');				/*******insert the quick quote text box********/		$('#replies').after('<div align="center" id="quoteDiv">' +				'<form action="'+replyLink+'" method="post">' +				wcButtons+				'<input class="" name="form" value="too right" type="hidden">' +								'<input name="modewc" id="modewc" value="true" checked="checked" type="hidden">' +				'<input name="modeht" id="modeht" value="true" checked="checked" type="hidden">' +				'<input name="modebr" id="modebr" value="true" checked="checked" type="hidden">' +				'<input name="modewl" id="modewl" value="true" checked="checked" type="hidden">' +							'<input name="modesp" id="modesp" value="true" checked="checked" type="hidden">' +				'<textarea name="body" id="body" class="textCSS" cols="100" rows="12"></textarea>' +				'<br/>' +				'<input type="submit" id="prev" value="Show Preview" accesskey="v"/>&nbsp' +				'<input type="reset" id="clearText" value="Clear" accesskey="x"/>' +				'</form>' +				'</div>');				/***event handlers for Preview & Clear Buttons***/			var getOnce = $('#body');			var theTextBox = getOnce[0];				$('#prev').mouseup(function(){			this.value = 'Please wait...';			return true;		});			$('#clearText').mouseup(function(){			theTextBox.value = "";			theTextBox.focus();			return false;		});			/***quick quote function***/		$('.qquoteie').click(function(){			var theClick  = $(this);			var txt = document.selection.createRange().text;			var getLink = theClick.prev().prev().attr("href");			var getPostId = getLink.slice(getLink.indexOf("r=")+2, getLink.indexOf("&tp"));			var getUserName = theClick.parent().parent().prev().prev().find('.bu_name').text();			var writesID = "[+"+getPostId+" "+getUserName+" writes... +]\n";			var writesText = '["'+txt+'"]\n\n';			var anyTextInBox = theTextBox.value;			if (anyTextInBox !== ""){				theTextBox.value = anyTextInBox+"\n"+writesID+writesText;			}			else{				theTextBox.value = writesID+writesText;			}			window.scrollBy(0, 999999999);			theTextBox.focus();			return false;		});			getOnce.css("width","70%");	doStuffToTheText(theTextBox);	}		/****Cookies & Last Read Function on forum-replies page*****/	var anchorAray = []; 		var hrefArray = [];				function getY( element, linkHref ){			var iReturnValue = 0;				iReturnValue += element.offsetTop;		element = element.offsetParent;				iReturnValue += element.offsetTop;		anchorAray.push(iReturnValue);				hrefArray.push(linkHref);			}		$('a[@title$=specific post]').each(function(){			getY(this, this.href);				});			var largestScrollY = 1;		window.onscroll = function() {			if (document.documentElement.scrollTop > largestScrollY){ //change to window.pageYOffset if need to get it to work in FF						largestScrollY = document.documentElement.scrollTop;					}	};					function writeToCookie(lrl){		function putStringArrayBackToCookie(lrl ,arr) {				var w = 0;				var wlrCookArrayFinal = [];								for(i=0;i<arr.length;i++) {					if(wlrCookArrayFinal[w] === undefined) {												wlrCookArrayFinal[w] = "t%3D"+arr[i];					}					else if(wlrCookArrayFinal[w].length < 4000){						wlrCookArrayFinal[w] = "t%3D"+arr[i]+wlrCookArrayFinal[w];					}										else{						w++;					}					}						for (wca=0;wca<wlrCookArray.length;wca++){					var cookName = wca+'wlrcookie';					document.cookie = cookName+'='+lrl+wlrCookArrayFinal[wca]+';expires=Fri, 17 Dec 2009 10:00:00 GMT';				}			}				if(document.cookie.indexOf('wlrcookie') < 0){					document.cookie = '0wlrcookie='+lrl+';expires=Fri, 17 Dec 2009 10:00:00 GMT';		}		//gotta test this bit		else if((wlrCookArray[0].length >= 4000) && ( document.cookie.split('; ').length < 19)){ //if current cookie's length is greater than or equal to 4000 (about 4K in size) & there are less than 19 cookies, create a new cookie			var x = document.cookie.charAt(document.cookie.lastIndexOf('wlrcookie')-1);	//the last index of wlrcookie should be the most recent cookie			var xIncrement = x++;			document.cookie = xIncrement+'wlrcookie='+lrl+';expires=Fri, 17 Dec 2009 10:00:00 GMT';					}						else if(wlrCookArrayString.indexOf(threadNumberWc) < 0){ //if the thread number is not in any cookie, 			if( document.cookie.split('; ').length < 18){				var arrSplit = wlrCookArrayString.split( "t%3D" );				arrSplit.shift();				arr = arrSplit.reverse(); //split it then reverse it so when allocate back to cookies, the first item(which will be the oldest anchor) will be allocated to the oldest cookie first - which will then be at the end of the cookie's value				putStringArrayBackToCookie(lrl, arr);													}			else{				var arrSplit = wlrCookArrayString.split( "t%3D" );				arrSplit.shift();				arr = arrSplit.reverse(); //split it then reverse it so when allocate back to cookies, the first item(which will be the oldest anchor) will be allocated to the oldest cookie first - which will then be at the end of the cookie's value				arr.pop();				putStringArrayBackToCookie(lrl, arr);					}								}		else if((wlrCookArrayString.indexOf(threadNumberWc) > -1) && (Number(regexCheat.slice(regexCheat.indexOf('%23r', regexCheat.indexOf(threadNumberWc))+4, regexCheat.indexOf('t%3D', regexCheat.indexOf(threadNumberWc)))) < Number(lrl.split('%23r')[1]))){  //if they move down an already tracked page - should save new anchor (if it's higher) and delete old one - 			var toSearchFor = regexCheat.slice(regexCheat.indexOf(threadNumberWc)-4, regexCheat.indexOf('t%3D', regexCheat.indexOf(threadNumberWc))); //search & remove			if( document.cookie.split('; ').length < 18){								var repTosear = wlrCookArrayString.replace(""+toSearchFor+"", "");				if(repTosear.length === 0){					document.cookie = '0wlrcookie='+lrl+';expires=Fri, 17 Dec 2009 10:00:00 GMT';				}				else{					var arrSplit = repTosear.split( "t%3D" );					arrSplit.shift(); //remove first empty split on left					arr = arrSplit.reverse(); //split it then reverse it so when allocate back to cookies, the first item(which will be the oldest anchor) will be allocated to the oldest cookie first - which will then be at the end of the cookie's value					putStringArrayBackToCookie(lrl, arr);					}							}			else{				if(wlrCookArray[wlrCookArray.length-1].slice(wlrCookArray[wlrCookArray.length-1].lastIndexOf("t%3D")).indexOf(threadNumberWc) > -1){ 					var arrSplit = wlrCookArrayString.split("t%3D");					arrSplit.shift();	//remove first empty split on left						arr.pop();	//remove anchor from the end beacuse it contains the anchor we want to replace anyway									arr.pop();	//remove anchor from the end so enough room to put another one in cookie	 					arr = arrSplit.reverse(); //split it then reverse it so when allocate back to cookies, the first item(which will be the oldest anchor) will be allocated to the oldest cookie first - which will then be at the end of the cookie's value					putStringArrayBackToCookie(lrl, arr);				}				else{					wlrCookArrayString = wlrCookArrayString.replace(""+toSearchFor+"", "");										var arrSplit = wlrCookArrayString.split( "t%3D" );					arrSplit.shift();	//remove first empty split on left						arr.pop();			//remove anchor from the end so enough room to put another one in cookie						arr = arrSplit.reverse(); //split it then reverse it so when allocate back to cookies, the first item(which will be the oldest anchor) will be allocated to the oldest cookie first - which will then be at the end of the cookie's value										putStringArrayBackToCookie(lrl, arr);				}						}					}	}			function readFromCookieOnThread(){		if(document.cookie.indexOf('wlrcookie') > -1){			if(wlrCookArrayString.indexOf(threadNumberWc) > -1) {				var anchorfromCookie = regexCheat.slice(regexCheat.indexOf('%23r', regexCheat.indexOf(threadNumberWc))+4, regexCheat.indexOf('t%3D', regexCheat.indexOf(threadNumberWc)));				var getAnchorNumber;				for(h=0;h<hrefArray.length;h++){					getAnchorNumber = Number(hrefArray[h].split('#r')[1]);					if(getAnchorNumber < anchorfromCookie){												//make this better?						$('.bodypost a[@href$=#r'+getAnchorNumber+']').parent().css({background:"#DDDDDD url(http://img.photobucket.com/albums/v215/thegooddale/red-ltgrey.gif) repeat scroll 0%"});											}					if((getAnchorNumber == anchorfromCookie) && (document.URL.indexOf('bottom') < 0 ) && (document.URL.split('#r')[1] < getAnchorNumber)){						window.location = "#"+getAnchorNumber;																	}				}									/*if((document.URL.indexOf('#') < 0) && (anchorString.indexOf(anchorInPage) > -1)){ 					alert("(document.URL.indexOf('#') < 0) && (anchorString.indexOf(anchorInPage) > -1)"+(document.URL.indexOf('#') < 0) && (anchorString.indexOf(anchorInPage) > -1));					window.location = anchorInPage;									}	*/				}		}	}		function findMin(numArrayLength, tempAnchorAray){ 		var tempHoldMeh;				for(j=0;j<numArrayLength;j++){					if((tempAnchorAray[j] > 0) && ((tempAnchorAray[j] < tempHoldMeh) || (tempHoldMeh === undefined))){				tempHoldMeh = tempAnchorAray[j];								lrl = encodeURIComponent(hrefArray[j].substr(hrefArray[j].indexOf('?')+1));			}		}		writeToCookie(lrl);		} 		function saveTheCookieSaveTheWorld(){		if(document.URL.indexOf('bottom') > -1){			lrl = encodeURIComponent(hrefArray[hrefArray.length-1].substr(hrefArray[hrefArray.length-1].indexOf('?')+1));			writeToCookie(lrl);					}		else{			var numArrayLength = anchorAray.length;			var tempAnchorAray = [];							for(i=0;i<numArrayLength;i++){					var tempHoldSingle = (anchorAray[i] - largestScrollY);				tempAnchorAray.push(tempHoldSingle);			}			findMin(numArrayLength, tempAnchorAray);				}		}		window.onclose = saveTheCookieSaveTheWorld;			window.onunload = saveTheCookieSaveTheWorld;		readFromCookieOnThread();	/****End of Cookies & Last Read Function on forum-replies page*****/	$('.bodytext').each(function(){		for (key in smileys) {			var smilRep = $(this).html().replace(regex[key], smileys[key]);			$(this).html(smilRep);		}	});	/****Inline Images*****/	$("a[@target=_blank]").each(function(){			if(this.href.toLowerCase().lastIndexOf('.jpg') > -1){			$(this).children('img:last').after('<br /><img width="400px" style="border:none;" src="'+this.href+'" />');		}		else if(this.href.toLowerCase().lastIndexOf('.jpeg') > -1){			$(this).children('img:last').after('<br /><img width="400px" style="border:none;" src="'+this.href+'" />');		}		else if(this.href.toLowerCase().lastIndexOf('.bmp') > -1){			$(this).children('img:last').after('<br /><img width="400px" style="border:none;" src="'+this.href+'" />');		}		else if(this.href.toLowerCase().lastIndexOf('.png') > -1){			$(this).children('img:last').after('<br /><img width="400px" style="border:none;" src="'+this.href+'" />');		}		else if(this.href.toLowerCase().lastIndexOf('.gif') > -1){			$(this).children('img:last').after('<br /><img width="400px" style="border:none;" src="'+this.href+'" />');		}	});	}//end of run on forum-replies page/***run on wiki pages****/else if(document.URL.indexOf('wiki') > -1){ 			var theTextBox = $('#f_body')[0];		$('#f_body').after(wcButtons);				doStuffToTheText(theTextBox);								}/***run on whim read****/else if(document.URL.indexOf("whim-read")>-1){ 		for (key in smileys) {		var smilRep = $('#replies').html().replace(regex[key], smileys[key]);		$('#replies').html(smilRep);	}}/***run on whim send****/else if(document.URL.indexOf("whim-send")>-1){ 		var theTextBox = $('#body')[0];	$('#body').css({width:'600px'}).before(wcButtons);	$('#buttonsDiv').css({fontSize: '80%', textAlign: 'center', marginTop: '5px', marginBottom: '5px', width:'600px'});	doStuffToTheText(theTextBox);		for (key in smileys) {		var smilRep = $('td[@bgcolor="#c3c9de"]').html().replace(regex[key], smileys[key]);		$('td[@bgcolor="#c3c9de"]').html(smilRep);	}}/***run on preview page****/else if(document.URL.indexOf("reply")>-1){ 		var theTextBox = $('#body')[0];	$('#body').css({width:'600px',marginTop: '10px'}).before(wcButtons).parent().css('width','600px');	doStuffToTheText(theTextBox);		for (key in smileys) {		var smilRep = $('.bodytext:last').html().replace(regex[key], smileys[key]);		$('.bodytext:last').html(smilRep);	}}/***run on user page****/else if(document.URL.indexOf("forum-user.cfm")>-1){ 	var theTextBox = $('#body')[0];	$('#body').before(wcButtons);	$('#buttonsDiv').css({fontSize: '80%', textAlign: 'center', marginTop: '5px', marginBottom: '5px'}).parent().css("width","410px").parent().parent().css("width","410px");			doStuffToTheText(theTextBox);	document.forms[ 1 ].elements.namedItem( 'body' ).style.width = "400px";	document.forms[ 1 ].elements.namedItem( 'body' ).setAttribute( "rows", "10");	document.forms[ 1 ].elements.namedItem( 'subject' ).style.width = "400px";	document.forms[ 1 ].elements.namedItem( 'subject' ).style.marginBottom = "20px";		if(document.URL.indexOf($(".nav_item_name > a > span").text().split('user ')[1]) > -1){		var aboutTr = $('tr[@valign=bottom]:first');				aboutTr.css({cursor:'pointer'}).children('td').css("opacity","0.5").end().next().attr('id','hider');				aboutTr.hover(function(){				$(this).children('td').css("opacity","1");			},function(){				if(trHide.css('display') == 'none'){					$(this).children('td').css("opacity","0.5");				}				else{					$(this).children('td').css("opacity","0.9");				}		});				var trHide = $('#hider');				trHide.hide();				aboutTr.toggle(function(){			trHide.css('display','block');		   $(this).children('td').css('opacity','0.9');		 },function(){			trHide.css('display','none');		   $(this).children('td').css('opacity','0.5');		 });	}	}/***run on thread search page***/else if((document.URL.indexOf("search")>-1) && (document.URL.indexOf("head") < 0)){		function mywrite(s) {			$("form[@action*=forum-search]").next().after('<div id="swikSearch" style="width:500px;margin:0 0 -20px 20px;">'+s+'</div>');		}		var mysheet=document.styleSheets[1];		document.write = mywrite; //the Bravo magic			mysheet.addRule("#swickiForm ", "padding:0;margin:0;");	mysheet.addRule("#swickiSearch ", "background-color:#EEEEEE;font-family:Arial;font-size:10px;height:auto;padding:5px;");	mysheet.addRule("#w ", "width:100%;"); 	mysheet.addRule(".communitypowered ", "width:66%;color:#F05C25;font-size:9px;line-height:10px;padding:2px;");	mysheet.addRule("#headertitle ", "float:left;font-size:13px;font-family:Arial;color:#666666;white-space:nowrap;text-transform:uppercase;");	mysheet.addRule("#cloudheader ", "-moz-box-sizing: border-box;padding:5px 10px 2px 10px;text-align:left;height:22px;overflow:hidden;background:#EEEEEE;"); 	mysheet.addRule(".hotcloud ", "padding:10px;background:#EEEEEE;font-family:Georgia;line-height:1.1;overflow:hidden;border-top:1px solid #FFFFFF;"); 	mysheet.addRule(".clouditem a ", "text-decoration:none;color:#F26721;");	mysheet.addRule(".clouditem a:hover ", "text-decoration:none;background:#f6f6f6; color:#F26721;");	mysheet.addRule(".dellink ", "visibility:hidden;position:relative;top:-12px;left:-8px;background:#EEEEEE;font-size:10px;font-weight:bold;color:#F05C25;"); 	mysheet.addRule(".link ", "font-size:11px;color:#F26721;text-decoration:none;");	mysheet.addRule(".link:hover ", "text-decoration:underline;background:#f6f6f6;"); 	mysheet.addRule(".clouditem a.recent_search ", "color: red;");	mysheet.addRule("#cloudfooter ", "margin-top:5px;padding:5px;height:10px;"); 	mysheet.addRule("#cloudmore ", "color:#F26721;float:right;"); 	mysheet.addRule("#cloudquestionl ", "float:left;"); 	mysheet.addRule("#cloudquestionr ", "float:right;"); 	mysheet.addRule("#cloudanswer ", "display:none;padding:5px;font-family:Arial;font-size:11px;color:#000;text-align:left;"); 	mysheet.addRule("#cloudanswer a ", "text-decoration:underline;"); 				script = document.createElement('script'); 	script.charset="UTF-8";	script.type = 'text/javascript'; 	script.src = "http://swicki.eurekster.com/sidebar?groupkey=4c78bb27-79f3-4878-a1bb-93e62086793a&target=_self&numresults=20&format=js"; 	$("head").append(script);	}var mysheet=document.styleSheets[1];/***Style Buttons****/	mysheet.addRule("#prev", "border:0px solid gray; color:black; background:#FFDCBF; width:150px; font:16px Arial;margin:2px 10px 0 0;"); mysheet.addRule("#clearText", "border:0px solid gray; color:black; background:#DAF2B3; width:150px; font:16px Arial;margin:2px 0 0 10px;"); mysheet.addRule(".wcodeButtons", "color:black;font:11px Tahoma");      /***JB's Nav (the quarter)***/  mysheet.addRule("#nav-container","position: fixed;left:132px;top: 24px;font-size:11px;font-family:Arial,sans-serif;z-index:1000;margin:25px 0 50px 15px;height:16px;overflow:hidden;");mysheet.addRule("#nav-container:hover","height:235px;overflow: visible;cursor:pointer;");mysheet.addRule("#nav-container img","border:none;margin-bottom:-3px;background-color: transparent;width: 16px;height: 16px;padding-right:20px;padding-bottom:2px;");mysheet.addRule("#nav-container ul","padding:0;margin:0;list-style-type:none;width:130px;border-bottom: 1px solid #444;");mysheet.addRule("#nav-container li","position:relative;background: rgb(58, 67, 123);height:23px;");mysheet.addRule("#nav-container table","position:absolute; border-collapse:collapse; top:0; left:0; z-index:100; font-size:1em;");mysheet.addRule("#nav-container a","display:block;text-decoration:none;height:22px;line-height:22px;width:129px;color:#FFF;text-indent:10px;border: 1px solid #444; border-width:1px 1px 0;");mysheet.addRule("#nav-container a:hover","color:#fff; background: orange;");mysheet.addRule("#nav-container :hover > a","color:#fff;background: orange;");mysheet.addRule("#nav-container ul ul","visibility:hidden;position:absolute;top:0;left:130px;border-bottom: 1px solid #444;");mysheet.addRule("#nav-container ul li:hover ul","visibility:visible;");mysheet.addRule("#nav-container ul a:hover ul","visibility:visible;");mysheet.addRule("#nav-container li","float:left;");mysheet.addRule("#nav-container .righty li","background: rgb(97, 108, 163);");var userNumber = $(".nav_item_name > a > span").text(); var removeText = new Array();removeText = userNumber.split(' ');		$("body").prepend('<div id="nav-container"> ' +					'<img src="http://img.photobucket.com/albums/v215/thegooddale/index.png"> ' +										'<div class="menu"> ' +					'<ul> ' +					'<li><a href="#">WP User<!--[if IE 7]><!--></a><!--<![endif]--> ' +					'<!--[if lte IE 6]><table><tr><td><![endif]--> ' +					'<ul class="righty"> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-user.cfm?id='+removeText[1]+'">Contributed Threads</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-user-online.cfm">People Online</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/whim.cfm?show=inbox">Inbox</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/whim.cfm?show=outbox">Outbox</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/whim-contacts.cfm">Contacts</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-subs.cfm">Subscriptions</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-search.cfm">Thread Search</a></li> ' +					'<li><a href="http://whirlpool.net.au/user.cfm">Your Settings</a></li> ' +					'<li><a href="http://whirlpool.net.au/login.cfm?logout='+removeText[1]+'">Log out</a></li> ' +					'</ul> ' +					'<!--[if lte IE 6]></td></tr></table></a><![endif]--> ' +					'</li> ' +					'<li><a href="#">- Technology<!--[if IE 7]><!--></a><!--<![endif]--> ' +					'<!--[if lte IE 6]><table><tr><td><![endif]--> ' +					'<ul class="righty"> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=100">Broadband General</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=82">DSL Hardware</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=9">Networking</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=63">Coding &amp; Web</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=116">Web Hosting</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=80">IT &amp; Telco</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=87">Peer to peer</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=91">On the internet</a></li> ' +					'</ul> ' +					'<!--[if lte IE 6]></td></tr></table></a><![endif]--> ' +					'</li> ' +					'<li><a href="#">- Voice<!--[if IE 7]><!--></a><!--<![endif]--> ' +					'<!--[if lte IE 6]><table><tr><td><![endif]--> ' +					'<ul class="righty"> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=107">Voice over IP</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=114">Phones</a></li> ' +					'</ul> ' +					'<!--[if lte IE 6]></td></tr></table></a><![endif]--> ' +					'</li> ' +					'<li><a href="#">- Computers<!--[if IE 7]><!--></a><!--<![endif]--> ' +					'<!--[if lte IE 6]><table><tr><td><![endif]--> ' +					'<ul class="righty"> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=7">PC Hardware</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=10">Windows</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=38">Apple</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=39">Linux/BSD</a></li> ' +					'</ul> ' +					'<!--[if lte IE 6]></td></tr></table></a><![endif]--> ' +					'</li> ' +					'<li><a href="#">- Lounges<!--[if IE 7]><!--></a><!--<![endif]--> ' +					'<!--[if lte IE 6]><table><tr><td><![endif]--> ' +					'<ul class="righty"> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=112">Music Lounge</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=8">Gaming Lounge</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=83">Gadget Lounge</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=58">Movie Lounge</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=106">TV Lounge</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=71">Lifestyle Lounge</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=118">Sports Lounge</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=85">In the News</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=117">The Pool Room</a></li> ' +										'</ul> ' +					'<!--[if lte IE 6]></td></tr></table></a><![endif]--> ' +					'</li> ' +					'<li><a href="#">- Whirlpool<!--[if IE 7]><!--></a><!--<![endif]--> ' +					'<!--[if lte IE 6]><table><tr><td><![endif]--> ' +					'<ul class="righty"> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=35">Forum feedback</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=92">Choosing an ISP</a></li> ' +					'</ul> ' +					'<!--[if lte IE 6]></td></tr></table></a><![endif]--> ' +					'</li> ' +					'<li><a href="#">- Companies<!--[if IE 7]><!--></a><!--<![endif]--> ' +					'<!--[if lte IE 6]><table><tr><td><![endif]--> ' +					'<ul class="righty"> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=14">BigPond</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=15">OptusNet</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=68">Internode</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=72">iiNet - OzEmail</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=69">Netspace</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=94">Westnet</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=90">TPG</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=95">People Telecom</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=102">aaNet</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=105">Exetel</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=109">Adam</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=115">Wild I&amp;T</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=119">AAPT</a></li> ' +										'</ul> ' +					'<!--[if lte IE 6]></td></tr></table></a><![endif]--> ' +					'</li> ' +					'<li><a href="#">- Connections<!--[if IE 7]><!--></a><!--<![endif]--> ' +					'<!--[if lte IE 6]><table><tr><td><![endif]--> ' +					'<ul class="righty"> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=67">Regional, Satellite</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=31">Other broadband</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=18">Wireless ISPs</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=99">ISDN, DoV</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=5">Dial-up internet</a></li> ' +					'<li><a href="http://forums.whirlpool.net.au/forum-threads.cfm?f=97">Peering</a></li> ' +					'</ul> ' +					'<!--[if lte IE 6]></td></tr></table></a><![endif]--> ' +					'</li> ' +					'</ul> ' +					'</div> ' +					'</div>');