function	trim(stringToTrim) 
{
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}

function	ltrim(stringToTrim) 
{
	return stringToTrim.replace(/^\s+/,"");
}

function	rtrim(stringToTrim) 
{
	return stringToTrim.replace(/\s+$/,"");
}

function	CheckAscII(stringToCheck)
{
	for(var i=0;i< stringToCheck.length; i++)
    { 
		if(stringToCheck.charCodeAt(i)>127 || stringToCheck.charCodeAt(i)<32)
		{
			return	false;
		}
    } 
	return	true;
}

function	CheckRegForm(company)
{
	var	EBox	=	document.getElementById('ErrorBox');
	var	EMess	=	document.getElementById('EMes');
	if(trim(document.getElementById('firstname').value)=="" ||  trim(document.getElementById('lastname').value)== "")
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"You must supply valid first and last names.";
		return;	
	}
	if(document.getElementById('security_code').value=="")
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"You must enter the security code as displayed.";		
		return;
	}
	if(	CheckAscII(trim(document.getElementById('organization').value))==false ||
		CheckAscII(trim(document.getElementById('firstname').value))==false ||
		CheckAscII(trim(document.getElementById('lastname').value))==false ||
		CheckAscII(trim(document.getElementById('email').value))==false ||
		CheckAscII(trim(document.getElementById('pass').value))==false)		
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"Please use English letters or numbers only.";	
		return;
	}	

	var apos	=	document.getElementById('email').value.indexOf("@");
	var	dotpos	=	document.getElementById('email').value.lastIndexOf(".");
	if (apos<1||dotpos-apos<2)
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"You must supply a valid email address.";
		return;	
	}
	if(trim(document.getElementById('pass').value).length<8 || trim(document.getElementById('pass').value).length>16)
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"Your password must be between 8 and 16 letters.";
		return;	
	}
	if(trim(document.getElementById('pass').value) != trim(document.getElementById('passconf').value))	
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"Your passwords do not match.";
		return;	
	}
	if(document.getElementById('agreed').checked==false)
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"You must agree to the "+company+" Usage Agreement.";
		return;
	}
	
		document.getElementById('regform').submit();
	EBox.style.display	=	"none";
}

function	checkLogForm()
{
	var	EBox	=	document.getElementById('ErrorBox');
	var	EMess	=	document.getElementById('EMes');
	if(trim(document.getElementById('email').value)=='')
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"You must enter your email address.";
		return;
	} 
	var apos	=	document.getElementById('email').value.indexOf("@");
	var	dotpos	=	document.getElementById('email').value.lastIndexOf(".");
	if (apos<1||dotpos-apos<2)
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"You must supply a valid email address.";
		return;	
	}
	if(trim(document.getElementById('pass').value)=='')
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"You must enter your password.";
		return;
	}		
	document.getElementById('logform').submit();
	EBox.style.display	=	"none";
}
var	BrowserSpace	= 0;

function	getBrowser()
{
	var browserName=navigator.appName;	
	if (navigator.userAgent.indexOf("Firefox")!=-1)	
	{
		BrowserSpace	=	0;
	}
	else if (browserName=="Netscape")
	{
		BrowserSpace=2;	
	}
	else if (browserName=="Microsoft Internet Explorer")
	{
		BrowserSpace=0;	
	}
	else if (browserName=="Safari")
	{
		BrowserSpace	=	2;
	}
	else if(window.opera)
	{
		BrowserSpace	=	1;
	}
}		
getBrowser();

var	Delay	=	9;
function	redirect()
{
	Delay--;
	if(Delay<=0)
	{
		window.location="/members/home";
	}
	else
	{
		document.getElementById('timer').innerHTML = "<strong>"+Delay+"</strong>";
	}
}

function	checksupForm()
{
	var	EBox	=	document.getElementById('ErrorBox');
	var	EMess	=	document.getElementById('EMes');
	if(trim(document.getElementById('subject').value)=='')
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"You must enter a subject for your support request.";
		return;
	} 
	if(trim(document.getElementById('text').value)=='')
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"You must enter some details for your support request.";
		return;
	} 
	document.getElementById('supform').submit();
	EBox.style.display	=	"none";
}

var	LastLeaf	=	null;
function	OpenLeaf(thatLeaf)
{ 
		var	NewLeaf	=	document.getElementById(thatLeaf);
		if(LastLeaf!=null)
		{
			if(LastLeaf==NewLeaf)
			{
				NewLeaf.style.display	=	'none';
				LastLeaf				=	null;
			}
			else
			{
				LastLeaf.style.display	=	'none';
				NewLeaf.style.display	=	'block';
				LastLeaf				=	NewLeaf;
			}
		}
		else
		{
			NewLeaf.style.display	=	'block';
			LastLeaf				=	NewLeaf;
		}
}
var	LastPage	=	null;
function	OpenPage(thatPage)
{ 
		var	NewPage	=	document.getElementById(thatPage);
		if(LastPage!=null)
		{
			LastPage.style.display	=	'none';
		}
		else
		{
			document.getElementById('Page0').style.display	=	'none';
		}
		NewPage.style.display	=	'block';
		LastPage				=	NewPage;
}

function	CheckpassForm()
{
	var	EBox =	document.getElementById('ErrorBox');
	var	EMess=	document.getElementById('EMes');
	if(document.getElementById('passconf').value=="" || document.getElementById('pass').value=="")
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"You must enter both passwords.";		
		return;
	}
	if(document.getElementById('security_code').value=="")
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"You must enter the security code as displayed.";		
		return;
	}
	
	if(trim(document.getElementById('pass').value).length<8 || trim(document.getElementById('pass').value).length>16)
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"Your password must be between 8 and 16 letters.";
		return;	
	}
	if(trim(document.getElementById('pass').value) != trim(document.getElementById('passconf').value))	
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"Your passwords do not match.";
		return;	
	}	
	document.getElementById('passform').submit();
	EBox.style.display	=	"none";
}
function	checkBetaForm()
{
	var apos	=	document.getElementById('email').value.indexOf("@");
	var	dotpos	=	document.getElementById('email').value.lastIndexOf(".");
	if (apos<1||dotpos-apos<2)
	{
		return;
	}
	document.getElementById('betaform').submit();
}


function	CheckBetaRegForm()
{
	var	EBox	=	document.getElementById('ErrorBox');
	var	EMess	=	document.getElementById('EMes');
	if(trim(document.getElementById('firstname').value)=="" ||  trim(document.getElementById('lastname').value)== "")
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"You must supply valid first and last names.";
		return;	
	}
	if(document.getElementById('security_code').value=="")
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"You must enter the security code as displayed.";		
		return;
	}
	var apos	=	document.getElementById('email').value.indexOf("@");
	var	dotpos	=	document.getElementById('email').value.lastIndexOf(".");
	if (apos<1||dotpos-apos<2)
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"You must supply a valid email address.";
		return;	
	}
	if(trim(document.getElementById('pass').value).length<8 || trim(document.getElementById('pass').value).length>16)
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"Your password must be between 8 and 16 letters.";
		return;	
	}
	if(trim(document.getElementById('pass').value) != trim(document.getElementById('passconf').value))	
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"Your passwords do not match.";
		return;	
	}
	document.getElementById('betaRegform').submit();
	EBox.style.display	=	"none";
}

function	CheckBetaLogForm()
{
	var	EBox	=	document.getElementById('ErrorBox');
	var	EMess	=	document.getElementById('EMes');
	var apos	=	document.getElementById('email').value.indexOf("@");
	var	dotpos	=	document.getElementById('email').value.lastIndexOf(".");
	if (apos<1||dotpos-apos<2)
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"You must supply a valid email address.";
		return;	
	}
	if(trim(document.getElementById('pass').value).length<8 || trim(document.getElementById('pass').value).length>16)
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"Your password must be between 8 and 16 letters.";
		return;	
	}
	document.getElementById('betaRegform').submit();
	EBox.style.display	=	"none";
}

function	CheckLicenceForm()
{
	var	EBox	=	document.getElementById('ErrorBox');
	var	Licence	=	trim(document.getElementById('licence').value);
	var	Serial	=	trim(document.getElementById('serial').value);
	var	EMess	=	document.getElementById('EMes');
	if(Licence=="" || Serial=="")
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"You must enter your serial and licence codes.";
		return;	
	}
	var rexp = /^[A-Z0-9]{4}[-][A-Z0-9]{4}[-][A-Z0-9]{4}[-][A-Z0-9]{4}[-][A-Z0-9]{4}[-][A-Z0-9]{4}$/ 
	if(rexp.test(Serial)==false)
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"Invalid serial number.";
		return;
	} 
	if(rexp.test(Licence)==false)
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"Invalid licence codes.";
		return;
	}
	document.getElementById('LicenceForm').submit();	
}
function	CheckBulkForm()
{
	var	EBox	=	document.getElementById('ErrorBox');
	var	Licence	=	trim(document.getElementById('licence').value);
	var	Serial	=	trim(document.getElementById('rkpfile').value);
	var	EMess	=	document.getElementById('EMes');
	if(Licence=="")
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"You must enter your licence code.";
		return;	
	}
	if(Serial=="")
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"You must enter select your zipped .RKP files.";
		return;	
	}
	var rexp = /^[A-Z0-9]{4}[-][A-Z0-9]{4}[-][A-Z0-9]{4}[-][A-Z0-9]{4}[-][A-Z0-9]{4}[-][A-Z0-9]{4}$/ 
	if(rexp.test(Licence)==false)
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"Invalid licence codes.";
		return;
	}
	document.getElementById('uploadform').submit();	
}
function	CheckAddPageForm()
{
	var	EBox		=	document.getElementById('ErrorBox');
	var	EMess		=	document.getElementById('EMes');
	var	PageName	=	trim(document.getElementById('name').value);
	var	DisplayName	=	trim(document.getElementById('displayname').value);
	
	if(PageName=="")
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"You must enter a page name.";
		return;
	}
	if(DisplayName=="")
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"You must enter displayed name for the page.";
		return;
	}	
	var re = /^[A-Za-z0-9 ]+$/;
	if(re.test(PageName)==false)
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"No silly chars in the page name, just letters and numbers please.";
		return;
	}
	if(re.test(DisplayName)==false)
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"No silly chars in the displayed name, just letters and numbers please.";
		return;
	}
	document.getElementById('pageform').submit();
}

function	HoverOver(e)
{
	var	DivOver	=	document.getElementById('Hovered');
	DivOver.className	=	'HovererOn';
	
	if (!e) var e = window.event;
	
	var IE = document.all?true:false
	var	tempX;
	var	tempY;
	if(IE) 
	{	// grab the x-y pos.s if browser is IE
		DivOver.style.top	=	(event.clientY + document.body.scrollTop)-200;
		DivOver.style.left	=	(event.clientX + document.body.scrollLeft)-200;
	} 
	else
	{	// grab the x-y pos.s if browser is NS
	    tempX = parseInt(e.pageX)-200;
	    tempY = parseInt(e.pageY)-200;
		// catch possible negative values in NS4
		if (tempX < 0){tempX = 0}
		if (tempY < 0){tempY = 0}
		
		DivOver.style.top	=	tempY;
		DivOver.style.left	=	tempX;
	}  
}



function	HoverOverPlugin(e)
{
	var	DivOver	=	document.getElementById('HoveredPlug');
	DivOver.className	=	'HovererOn';
	
	if (!e) var e = window.event;
	
	var IE = document.all?true:false
	var	tempX;
	var	tempY;
	if(IE) 
	{	// grab the x-y pos.s if browser is IE
		DivOver.style.top	=	(event.clientY + document.body.scrollTop)-200;
		DivOver.style.left	=	(event.clientX + document.body.scrollLeft)-200;
	} 
	else
	{	// grab the x-y pos.s if browser is NS
	    tempX = parseInt(e.pageX)-200;
	    tempY = parseInt(e.pageY)-200;
		// catch possible negative values in NS4
		if (tempX < 0){tempX = 0}
		if (tempY < 0){tempY = 0}
		
		DivOver.style.top	=	tempY;
		DivOver.style.left	=	tempX;
	}  
}

function addCommas(nStr)
{
	nStr += '';
	x = nStr.split('.');
	x1 = x[0];
	x2 = x.length > 1 ? '.' + x[1] : '';
	var rgx = /(\d+)(\d{3})/;
	while (rgx.test(x1)) 
	{
		x1 = x1.replace(rgx, '$1' + ',' + '$2');
	}
	return x1 + x2;
}


function	submitPayStudentForm(PayingSystem)
{
	var	SeatsOrderd	=	document.getElementById('seats_orderd');
	var	AmountBilled	=	document.getElementById('amount_billed');

	AmountBilled.value		=	"67.50";
	SeatsOrderd.value		=	1;

	document.getElementById('system_used').value	=	PayingSystem;

	document.getElementById('purchaseform').submit();
}


function	submitPayForm(PayingSystem)
{
	if(document.getElementById('seats_orderd').value>0)
	{
		document.getElementById('system_used').value	=	PayingSystem;
		document.getElementById('purchaseform').submit();
	}
}

function	calculateTotalOrder()
{
	var	SeatsOrderd		=	document.getElementById('seats_orderd');
	var	AmountBilled	=	document.getElementById('amount_billed');
	var	NumSeats		=	document.getElementById('seats');
	var	LicenceCost		=	document.getElementById('licencecost');
	var	EBox			=	document.getElementById('ErrorBox');
	var	EMess			=	document.getElementById('EMes');
	var	paypalprice		=	document.getElementById('amount');
	var	submit			=	document.getElementById('googleformbutton');
	var	paypalsubmit	=	document.getElementById('paypalformbutton');
	var	GoogleButton	=	"/images/googlecheckout.png";
	var	PayPalButton	=	"/images/paypalbutton.png";
	var	UNIT_PRICE		=	90;
	var	DISCOUNT5		=	Math.floor(UNIT_PRICE*.95);
	var	DISCOUNT10		=	Math.floor(UNIT_PRICE*.90);
	var	DISCOUNT15		=	Math.floor(UNIT_PRICE*.85);
	var	DISCOUNT20		=	Math.floor(UNIT_PRICE*.80);
	var	DISCOUNT25		=	Math.floor(UNIT_PRICE*.75);

	
	if(isNaN(NumSeats.value)==true || NumSeats.value=="" || NumSeats.value<1)
	{
		if(isNaN(NumSeats.value)==true)
		{
			EBox.style.display		=	"inline";
			EMess.innerHTML			=	"Only number of seats allowed.";
		}
		LicenceCost.innerHTML	=	"&pound;&nbsp;0.00";
		submit.src				=	"/images/greygooglecheckout.png"
		paypalsubmit.src		=	"/images/greypaypalbutton.png";
		AmountBilled.value		=	"0.00";
		SeatsOrderd.value		=	0;
		submit.disabled			=	true;
		paypalsubmit.disabled	=	true;
		return;
	}
	else
	{		
		NumSeats.value = parseInt(NumSeats.value.replace(/^[0]+/g,""));
		if(NumSeats.value>=9999)
		{	
			EBox.style.display		=	"inline";
			EMess.innerHTML		=	"Too many seats, please contact support@roadkillpro.com.";
			LicenceCost.innerHTML	=	"&pound;&nbsp;0.00";		
			return;
		}
		EBox.style.display		=	"none";
		submit.src				=	"/images/googlecheckout.png"
		paypalsubmit.src		=	"/images/paypalbutton.png";
		SeatsOrderd.value		=	NumSeats.value;
		submit.disabled			=	false;
		paypalsubmit.disabled	=	false;
		if(NumSeats.value<10)
		{
			LicenceCost.innerHTML	=	"&pound;&nbsp;"+addCommas(NumSeats.value*UNIT_PRICE) + ".00";
			AmountBilled.value		=	NumSeats.value*UNIT_PRICE + ".00";		
		}
		else if(NumSeats.value<20)
		{
			LicenceCost.innerHTML	=	"&pound;&nbsp;"+addCommas(NumSeats.value*DISCOUNT5) + ".00";
			AmountBilled.value		=	NumSeats.value*DISCOUNT5 + ".00";	
		}
		else if(NumSeats.value<30)
		{
			LicenceCost.innerHTML	=	"&pound;&nbsp;"+addCommas(NumSeats.value*DISCOUNT10) + ".00";
			AmountBilled.value		=	NumSeats.value*DISCOUNT10 + ".00";
		}	
		else if(NumSeats.value<40)
		{
			LicenceCost.innerHTML	=	"&pound;&nbsp;"+addCommas(NumSeats.value*DISCOUNT15) + ".00";
			AmountBilled.value		=	NumSeats.value*DISCOUNT15 + ".00";
		}
		else if(NumSeats.value<50)
		{
			LicenceCost.innerHTML	=	"&pound;&nbsp;"+addCommas(NumSeats.value*DISCOUNT20) + ".00";
			AmountBilled.value		=	NumSeats.value*DISCOUNT20 + ".00";
		}
		else
		{
			LicenceCost.innerHTML	=	"&pound;&nbsp;"+addCommas(NumSeats.value*DISCOUNT25) + ".00";
			AmountBilled.value		=	NumSeats.value*DISCOUNT25 + ".00";
		}
	}
}
function	calculatePricing()
{
	var	NumSeats		=	document.getElementById('seats');
	var	LicenceCost		=	document.getElementById('licencecost');
	var	EBox			=	document.getElementById('ErrorBox');
	var	EMess			=	document.getElementById('EMes');
	var	UNIT_PRICE		=	90;
	var	DISCOUNT5		=	Math.floor(UNIT_PRICE*.95);
	var	DISCOUNT10		=	Math.floor(UNIT_PRICE*.90);
	var	DISCOUNT15		=	Math.floor(UNIT_PRICE*.85);
	var	DISCOUNT20		=	Math.floor(UNIT_PRICE*.80);
	var	DISCOUNT25		=	Math.floor(UNIT_PRICE*.75);

	
	if(isNaN(NumSeats.value)==true || NumSeats.value=="" || NumSeats.value<1)
	{
		if(isNaN(NumSeats.value)==true)
		{
			EBox.style.display		=	"inline";
			EMess.innerHTML			=	"Only number of seats allowed.";
		}
		LicenceCost.innerHTML	=	"&pound;&nbsp;0.00";		
		return;
	}
	else 
	{		
		NumSeats.value = parseInt(NumSeats.value.replace(/^[0]+/g,""));
		if(NumSeats.value>=9999)
		{	
			EBox.style.display		=	"inline";
			EMess.innerHTML		=	"Too many seats, please contact support@roadkillpro.com.";
			LicenceCost.innerHTML	=	"&pound;&nbsp;0.00";		
			return;
		}	
		EBox.style.display		=	"none";
		if(NumSeats.value<10)
		{
			LicenceCost.innerHTML	=	"&pound;&nbsp;"+addCommas(NumSeats.value*UNIT_PRICE) + ".00";
		}
		else if(NumSeats.value<20)
		{
			LicenceCost.innerHTML	=	"&pound;&nbsp;"+addCommas(NumSeats.value*DISCOUNT5) + ".00";
		}
		else if(NumSeats.value<30)
		{
			LicenceCost.innerHTML	=	"&pound;&nbsp;"+addCommas(NumSeats.value*DISCOUNT10) + ".00";
		}	
		else if(NumSeats.value<40)
		{
			LicenceCost.innerHTML	=	"&pound;&nbsp;"+addCommas(NumSeats.value*DISCOUNT15) + ".00";
		}
		else if(NumSeats.value<50)
		{
			LicenceCost.innerHTML	=	"&pound;&nbsp;"+addCommas(NumSeats.value*DISCOUNT20) + ".00";
		}
		else
		{
			LicenceCost.innerHTML	=	"&pound;&nbsp;"+addCommas(NumSeats.value*DISCOUNT25) + ".00";
		}
	}
}
function	CheckUploadform()
{
	var	EBox		=	document.getElementById('ErrorBox');
	var	File		=	trim(document.getElementById('uploadedfile').value);
	var	LinkText	=	trim(document.getElementById('linktext').value);	
	var	Group		=	document.getElementById('versions').value;	
	var	EMess		=	document.getElementById('EMes');
	if(File=="")
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"You must choose a file";
		return;	
	}
	if(LinkText=="")
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"You must give the link some text";
		return;	
	}
	if(Group==0)
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"You must choose a version so we can put it in the corect group";
		return;	
	}
	document.getElementById('uploadform').submit();
}

function	CheckUpDateform()
{
	var	EBox		=	document.getElementById('ErrorBox');
	var	LinkText	=	trim(document.getElementById('linktext').value);	
	var	Group		=	document.getElementById('versions').value;	
	var	EMess		=	document.getElementById('EMes');	
	if(LinkText=="")
	{
		EBox.style.display	=	"inline";
		EMess.innerHTML		=	"You must give the link some text";
		return;	
	}
	
	document.getElementById('uploadform').submit();
}


var	ZoomWidth		=	0;
var	ZoomHeight		=	0;
var	ZoomFactor		=	0.0;
var	WindowWidth		=	0;
var	WindowHeight	=	0;
var	ImageCounts		=	0;
var	ImageNumber		=	0;
function	NextShot(Group,Max)
{
	var	NextFirst	=	"click for next image";
	if(ImageNumber<(Max-1))
	{
		ImageNumber++;
		if(ImageNumber==(Max-1))
		{
			NextFirst	=	"click for first image";	
		}
	}
	else
	{
		
		ImageNumber=0;
	}
	document.getElementById("ShotCount").innerHTML		=	"&nbsp;&nbsp;"+(ImageNumber+1)+" of "+Max+' <a href="#" onclick="NextShot('+Group+','+Max+')" alt="Next shot" title="Next shot" class="LinkOut" onmouseout="this.className='+"'LinkOut'"+';" onmouseover="this.className='+"'LinkOver'"+';">'+NextFirst+'</a>'; 
	document.getElementById("Thead").innerHTML			=	"<center>&nbsp;&nbsp;&nbsp;&nbsp;"+GroupHeading[Group][ImageNumber]+"</center";
	document.getElementById("shotImg").src				=	GroupFilenames[Group][ImageNumber];	
}
function	OpenShot(Group,GroupCount)
{	
	ImageNumber		=	0;
	ImageCounts		=	GroupCount;
	ZoomHeight		=	GroupHeight[Group][0];
	ZoomWidth		=	GroupWidth[Group][0];
	if (window.innerWidth) 
	{
		WindowWidth		=	window.innerWidth;
		WindowHeight	=	window.innerHeight
	}
	else
	{
		 var baseArray = document.getElementsByTagName("base");
		 if (baseArray.length == 0)
		 {
			 if (document.compatMode && document.compatMode.indexOf("CSS1") >= 0) 
			 {
				 WindowWidth	=	document.body.parentNode.clientWidth;
				 WindowHeight	=	document.body.parentNode.clientHeight;
			 }
			 else if (document.body && document.body.clientWidth) 
			 {
				 WindowWidth	=	document.body.clientWidth;
				 WindowHeight	=	document.body.clientHeight;
			 }
		 }
		 else
		 {
			 if (document.body && document.body.clientWidth) 
			 {
				 WindowWidth	=	document.body.clientWidth;
				 WindowHeight	=	document.body.clientHeight;
			 }
			 else if (document.compatMode && document.compatMode.indexOf("CSS1") >= 0) 
			 {
				 WindowWidth	=	document.body.parentNode.clientWidth;
				 WindowHeight	=	document.body.parentNode.clientHeight;
			 }
		 }
	}	
	if(GroupCount>1)
	{
		document.getElementById("ShotCount").innerHTML		=	"&nbsp;&nbsp;1 of "+GroupCount+' <a href="#" onclick="NextShot('+Group+','+GroupCount+')" alt="Next shot" title="Next shot" class="LinkOut" onmouseout="this.className='+"'LinkOut'"+';" onmouseover="this.className='+"'LinkOver'"+';">click for next image</a>';
	}
	else
	{
		document.getElementById("ShotCount").innerHTML		=	"";
		
	}
	document.getElementById("Thead").innerHTML			=	"<center>&nbsp;&nbsp;&nbsp;&nbsp;"+GroupHeading[Group][0]+"</center";
	document.getElementById("shotTxt").style.display	=	"none";
	document.getElementById("shotImg").src	=	GroupFilenames[Group][0];
	var	SFrame				=	document.getElementById("shotfrm");
	var	SImg				=	document.getElementById("shotImg");
	
	SImg.width				=	"15px";
	SImg.height				=	"15px";
	SFrame.style.top		=	(WindowHeight-15)/2;
	SFrame.style.left		=	(WindowWidth-15)/2;
	ZoomFactor				=	0.2;
	window.setTimeout(ZoomIn, 100);
}
function	ZoomIn()
{	
	var	SImg				=	document.getElementById("shotImg");
	var	SFrame				=	document.getElementById("shotfrm");	
	SImg.width				=	parseInt(ZoomWidth*ZoomFactor);
	SImg.height				=	parseInt(ZoomHeight*ZoomFactor);	
	
	SFrame.style.top		=	parseInt((WindowHeight-parseInt(SImg.height))/2);
	SFrame.style.left		=	parseInt(((WindowWidth)-parseInt(SImg.width))/2);
	SFrame.style.width		=	parseInt(SImg.width)+12;
	SFrame.style.height		=	parseInt(SImg.height)+34;	
	ZoomFactor	+=	0.1;
	if(ZoomFactor<1.0)
	{
		SFrame.style.display	=	"inline";
		window.setTimeout(ZoomIn, 10);
	}
	else
	{
		ZoomFactor				=	1.0;
		SImg.width				=	parseInt(ZoomWidth*ZoomFactor);
		SImg.height				=	parseInt(ZoomHeight*ZoomFactor);	
		SFrame.style.top		=	parseInt((WindowHeight-parseInt(SImg.height))/2);
		SFrame.style.left		=	parseInt(((WindowWidth)-parseInt(SImg.width))/2);
		SFrame.style.width		=	parseInt(SImg.width)+12;
		SFrame.style.height		=	parseInt(SImg.height)+34;	
		document.getElementById("shotTxt").style.display	=	"inline";
		document.getElementById("off").style.display		=	"inline";
		////SFrame.style.width		=	parseInt(SImg.width);
		document.getElementById("off").style.top			=	(parseInt(SFrame.style.top)+parseInt(SFrame.style.height))-36;
		document.getElementById("off").style.left			=	(parseInt(SFrame.style.left)+parseInt(SFrame.style.width))-36;
		
	}
}
function	CloseZoom()
{
	ZoomFactor	-=	0.1;
	var	SFrame				=	document.getElementById("shotfrm");	
	if(ZoomFactor>0.1)
	{
		var	SImg				=	document.getElementById("shotImg");		
		SImg.width				=	parseInt(ZoomWidth*ZoomFactor);
		SImg.height				=	parseInt(ZoomHeight*ZoomFactor);	
		SFrame.style.top		=	parseInt((WindowHeight-parseInt(SImg.height))/2);
		SFrame.style.left		=	parseInt(((WindowWidth)-parseInt(SImg.width))/2);
		SFrame.style.width		=	parseInt(SImg.width)+12;
		SFrame.style.height		=	parseInt(SImg.height);
		document.getElementById("shotTxt").style.display	=	"none";
		document.getElementById("off").style.display		=	"none";
		window.setTimeout(CloseZoom, 10);
	}
	else
	{	ZoomFactor>0.2
		SFrame.style.display	=	"none";	
	}
}
function	openreply()
{
	var	Bbox	=	document.getElementById('ButtonBox');
	var	Rbox	=	document.getElementById('ReplyBox');
	Rbox.style.display	=	"inline";
	Bbox.style.display	=	"none";	
}
function	OpenSingleShot(shot,desId,width,height,heading)
{
	
	ZoomHeight	=	height;
	ZoomWidth	=	width;
	if (window.innerWidth) 
	{
		WindowWidth		=	window.innerWidth;
		WindowHeight	=	window.innerHeight
	}
	else
	{
		 var baseArray = document.getElementsByTagName("base");
		 if (baseArray.length == 0)
		 {
			 if (document.compatMode && document.compatMode.indexOf("CSS1") >= 0) 
			 {
				 WindowWidth	=	document.body.parentNode.clientWidth;
				 WindowHeight	=	document.body.parentNode.clientHeight;
			 }
			 else if (document.body && document.body.clientWidth) 
			 {
				 WindowWidth	=	document.body.clientWidth;
				 WindowHeight	=	document.body.clientHeight;
			 }
		 }
		 else
		 {
			 if (document.body && document.body.clientWidth) 
			 {
				 WindowWidth	=	document.body.clientWidth;
				 WindowHeight	=	document.body.clientHeight;
			 }
			 else if (document.compatMode && document.compatMode.indexOf("CSS1") >= 0) 
			 {
				 WindowWidth	=	document.body.parentNode.clientWidth;
				 WindowHeight	=	document.body.parentNode.clientHeight;
			 }
		 }
	}	
	document.getElementById("Thead").innerHTML			=	heading;
	document.getElementById("Thtml").innerHTML			=	document.getElementById(desId).value;
	document.getElementById("shotTxt").style.display	=	"none";
	document.getElementById("shotImg").src				=	shot;
	var	SFrame				=	document.getElementById("shotfrm");
	var	SImg				=	document.getElementById("shotImg");
	SImg.width				=	"15px";
	SImg.height				=	"15px";
	SFrame.style.top		=	((WindowHeight-15)/2);
	SFrame.style.left		=	((WindowWidth-220)-15)/2;
	ZoomFactor				=	0.2;
	window.setTimeout(ZoomIn, 100);
}