//=================================================================================
//	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;

// Date arrays.
var arrMonth = new Array();
arrMonth[0] = "January";
arrMonth[1] = "February";
arrMonth[2] = "March";
arrMonth[3] = "April";
arrMonth[4] = "May";
arrMonth[5] = "June";
arrMonth[6] = "July";
arrMonth[7] = "August";
arrMonth[8] = "September";
arrMonth[9] = "October";
arrMonth[10] = "November";
arrMonth[11] = "December";
				
var arrDay = new Array();
arrDay[0] = "Sunday";
arrDay[1] = "Monday";
arrDay[2] = "Tuesday";
arrDay[3] = "Wednesday";
arrDay[4] = "Thursday";
arrDay[5] = "Friday";
arrDay[6] = "Saturday";

var objWnd = null;

//-----------------------------------------------------------------------------
// Standard functions.
//-----------------------------------------------------------------------------

function showPage(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,height=" + lngHeight + ",width=" + lngWidth;
	// return opened window object
	window.objWnd = window.open(strURL, 's4_pop', strSettings);
	window.objWnd.focus();
	return window.objWnd;
}

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 showFullPage(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 + ",toolbar,menubar,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 ShowWDetail(url, height, width)
{
	// Load detail in a new window
	var widthX = ((screen.width-width)/2);
	var heightY = ((screen.height-height)/2);
	var settings="left="+widthX+",top="+heightY+",resizable,scrollbars,height=" + height + ",width=" + width;
	window.open(url,'_blank',settings);
	return false;
}

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();