/*
Profile Views
Version 1.1

Copyright 2006-2008 Bradley Nelson a.k.a CCWorld
All Rights Reserved

For use on Proboards Boards only.
This Header must remain intact at all times.
Do not re-post without permission.
*/

var usnOVP;
var usnOVB;

function doProLoad(){
	location.href.match(/http\:\/\/(www\.)?([a-z0-9]+?)\.proboa/i);
	usnOVB = RegExp.$2
	if (location.href.match(/user=([a-z0-9]+)/i)){
		usnOVP = RegExp.$1;
	}
	else if (pb_username != "Guest"){
		usnOVP = pb_username;
	}
	else {
		return false;
	}
	newChd = document.createElement("script");
	newChd.type = "text/javascript";
	newChd.src = "http://pb.ccsr.us/views/l.php?u="+usnOVP+"&b="+usnOVB;
	document.getElementsByTagName("head").item(0).appendChild(newChd);
}

if (location.href.match(/tion=viewprofile/i)){
	doProLoad();
}

function doProViews(viewNum){
	var tds = document.getElementsByTagName("td");
	var i;

	for (i=0; i<tds.length; i++){
		if (tds.item(i).className.match(/titlebg/i) && tds.item(i).innerHTML.match(/view profile/i)){
		tds.item(i).firstChild.appendChild(document.createTextNode(" (profile views: "+viewNum+")"));
		break;
		}
	}
}