//=================================================================================
//	101 Media Ltd - SmartWebb V4.0
//	(c) 2004 101 Media Ltd
//	http://www.101media.co.uk
//=================================================================================

// Determine browser.
isMinNS6 = (navigator.appName.indexOf("Netscape") >= 0 && parseFloat(navigator.appVersion) >= 5) ? 1 : 0;
isMinNS4 = (navigator.appName.indexOf("Netscape") >= 0 && parseFloat(navigator.appVersion) >= 4 && parseFloat(navigator.appVersion) < 5) ? 1 : 0;
isMinIE4 = ((document.all) && !isMinNS6) ? 1 : 0;
isMinIE5 = (isMinIE4 && navigator.appVersion.indexOf("5.") >= 0) ? 1 : 0;

function initialCaps(strText)
{
	var strPunc = ",.?!:;('-";
	strPunc += '"';
	var arrSplit = strText.split(" ");
	var strFinal = "";

	var lngPos = 0;
	var lngPunc = 0;

	var strWord = "";
	var strLetter = "";
	var strPre = "";
	var strTemp = "";
	var strCmp = "";

	for (var lngEl = 0; lngEl < arrSplit.length; lngEl++)
	{
		arrSplit[lngEl] += " ";
		arrSplit[lngEl] = arrSplit[lngEl].toLowerCase();
		strTemp = "";
		while ((arrSplit[lngEl].length > 0) && (arrSplit[lngEl].indexOf(" ") > -1))
		{
			lngPos = arrSplit[lngEl].indexOf(" ");
			strWord = arrSplit[lngEl].substring(0, lngPos);
			strPre = "";
			if (strPunc.indexOf(strWord.substring(0, 1)) > -1)
			{
				strPre = strWord.substring(0, 1);
				strWord = strWord.substring(1, strWord.length);
			}
			strCmp = " " + strWord + " ";
			for (var i = 0; i < 9; i++)
			{
				lngPunc = strWord.indexOf(strPunc.substring(i, i + 1));
				if (lngPunc == strWord.length - 1)
				{
					strCmp = " " + strWord.substring(0, strWord.length - 1) + " ";
					i = 9;
				}
			}
			
			if (strCmp.indexOf(strCmp) <= 0)
			{
				strLetter = strWord.substring(0, 1);
				strLetter = strLetter.toUpperCase();
				strWord = strLetter + strWord.substring(1, strWord.length);
			}
			strTemp += strPre + strWord + " "; 
			arrSplit[lngEl] = arrSplit[lngEl].substring((lngPos + 1), 
			arrSplit[lngEl].length);
		}
		strLetter = strTemp.substring(0, 1);
		strLetter = strLetter.toUpperCase();
		if (strLetter != " ")
		{
			strFinal += strLetter + strTemp.substring(1, strTemp.length - 1) + " ";
		}
	}
	return strFinal;
}

function showScrollPage(strURL, lngHeight, lngWidth)
{
	window.focus();
	if (!window.objWnd == null && !window.objWnd.closed)
	{
		window.objWnd.close();
	}
	// Load detail in a new window
	var lngWidthX = ((screen.width - lngWidth) / 2);
	var lngHeightY = ((screen.height - lngHeight) / 2);
	var strSettings = "left=" + lngWidthX + ",top=" + lngHeightY + ",resizable,scrollbars,height=" + lngHeight + ",width=" + lngWidth;
	// return opened window object
	window.objWnd = window.open(strURL, 's4_pop', strSettings);
	window.objWnd.focus();
	return window.objWnd;
}

function domRollover() {
	if (navigator.userAgent.match(/Opera (\S+)/)) {
		var operaVersion = parseInt(navigator.userAgent.match(/Opera (\S+)/)[1]);
	}
	if (!document.getElementById||operaVersion <7) return;
	var imgarr=document.getElementsByTagName('img');
	var imgPreload=new Array();
	var imgSrc=new Array();
	var imgClass=new Array();
	for (i=0;i<imgarr.length;i++){
		if (imgarr[i].className.indexOf('domroll')!=-1){
			imgSrc[i]=imgarr[i].getAttribute('src');
			imgClass[i]=imgarr[i].className;
			imgPreload[i]=new Image();
			if (imgClass[i].match(/domroll (\S+)/)) {
				imgPreload[i].src = imgClass[i].match(/domroll (\S+)/)[1]
			}
			imgarr[i].setAttribute('xsrc', imgSrc[i]);
			imgarr[i].onmouseover=function(){
				this.setAttribute('src',this.className.match(/domroll (\S+)/)[1])
			}
			imgarr[i].onmouseout=function(){
				this.setAttribute('src',this.getAttribute('xsrc'))
			}
		}
	}
}
domRollover();