<!--
// Global Variables
var useStandards=(document.getElementById);
var NS6=(document.getElementbyId && !document.all);
var IE=(document.all);
var NS=(navigator.appName=="Netscape" && navigator.appVersion.charAt(0)=='4');
var preloadFlag = false;
var  noIm=1; 
//----------------------------------------------------------------------------------
function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {	
				windowHeight = document.body.clientHeight;
			}
		}
	}
			return windowHeight;
}
//----------------------------------------------------------------------------------
function setcontentHeight() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		var topbarHeight = document.getElementById('topbar').offsetHeight;
		var bottombarHeight = document.getElementById('bottombar').offsetHeight;					
		document.getElementById('content').style.height  = (windowHeight - (bottombarHeight + topbarHeight) - 10) + 'px';;
	}
}
//----------------------------------------------------------------------------------
function GetNumber(myImage,imgName)
{
	myTImg=myImage.substring(myImage.lastIndexOf("/")+1,myImage.length);
	nStart=	imgName.lastIndexOf("/") +1 + myTImg.length;
	nEnd = imgName.lastIndexOf(".");
	tNum=imgName.substring(nStart,nEnd) * 1;
	return tNum;
}
//----------------------------------------------------------------------------------
function backImage(myImage,endNo,IdName,eXt) 
{
	imageList=new Array();
	for(var i=1;i<=endNo;i++)
	{
		imageList[i]=new Image();
		imageList[i].src="images/"+[myImage]+[i]+[eXt];
	}
	noIm=GetNumber(myImage,document.getElementById(IdName).src)-1;
	if(noIm<1)
	{
		{noIm=1};
	}
	document.getElementById(IdName).src=imageList[noIm].src;
	return false
}  	
//----------------------------------------------------------------------------------
function nextImage(myImage,endNo,IdName,eXt) 
{
	imageList=new Array();
	for(var i=1;i<=endNo;i++)
	{
		imageList[i]=new Image();
		imageList[i].src="images/"+[myImage]+[i]+[eXt];
	}
	noIm=GetNumber(myImage,document.getElementById(IdName).src)+1;
	if(noIm>endNo)
	{
		{noIm=endNo};
	}
	document.getElementById(IdName).src=imageList[noIm].src;
	return false
}
//----------------------------------------------------------------------------------
function popUp(MyPage,myWidth)
{
	try	{window.newwindow.close();}	catch(e){}	finally{}
	var thePage='';
	var myPageWidth='';
	thePage=MyPage;
	myPageWidth=myWidth;
	if (thePage.length>0)
	{
		var windowHeight = getWindowHeight();
		var TheOptions='height='+(window.screen.height-120)+',location=no,menubar=no,status=no,titlebar=no,width='+myPageWidth+',scrollbars=yes,top=20,left='+((screen.width/2)-(myPageWidth/2));
		newwindow=window.open('emailers/' + MyPage,'picpopup',TheOptions);
		if (window.focus) {newwindow.focus()};
	}
}
//----------------------------------------------------------------------------------
function backImageLet(myImage,endNo,IdName,eXt) 
{
	Messages=new Array();
		Messages[1]='Ergotherapy Solutions';
		Messages[2]='Ice Images';
		Messages[3]='Flight Share'
		Messages[4]='Red Cherry Training';
		Messages[5]='Red Cherry Recruitment';
	imageList=new Array();
	for(var i=1;i<=endNo;i++)
	{
		imageList[i]=new Image();
		imageList[i].src="images/"+[myImage]+[i]+[eXt];
	}
	noIm=GetNumber(myImage,document.getElementById(IdName).src)-1;
	if(noIm<1)
	{
		{noIm=1};
	}
	document.getElementById(IdName).src=imageList[noIm].src;
	document.getElementById('client').innerHTML=Messages[noIm];
	return false
}  	
//----------------------------------------------------------------------------------
function nextImageLet(myImage,endNo,IdName,eXt) 
{
	Messages=new Array();
		Messages[1]='Ergotherapy Solutions';
		Messages[2]='Ice Images';
		Messages[3]='Flight Share'
		Messages[4]='Red Cherry Training';
		Messages[5]='Red Cherry Recruitment';	
	imageList=new Array();
	for(var i=1;i<=endNo;i++)
	{
		imageList[i]=new Image();
		imageList[i].src="images/"+[myImage]+[i]+[eXt];
	}
	noIm=GetNumber(myImage,document.getElementById(IdName).src)+1;
	if(noIm>endNo)
	{
		{noIm=endNo};
	}
	document.getElementById(IdName).src=imageList[noIm].src;
	document.getElementById('client').innerHTML=Messages[noIm];
	return false
}
//----------------------------------------------------------------------------------
function CheckValidInfo(){
		var str=E_MailSubmission.ClientEMail.value
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if ((E_MailSubmission.ClientName.value.length>0) && 
			(E_MailSubmission.SecureNumber.value.length>0) && 
			(E_MailSubmission.ClientEMail.value.length>0))
			{	
				if (str.indexOf(at)==-1){
			   alert("Invalid E-mail Address")
			   return false
				}
				if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
			   alert("Invalid E-mail Address")
			   return false
				}
				if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
			    alert("Invalid E-mail Address")
			    return false
				}
				if (str.indexOf(at,(lat+1))!=-1){
			    alert("Invalid E-mail Address")
			    return false
				}
				if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
			    alert("Invalid E-mail Address")
			    return false
				}
				if (str.indexOf(dot,(lat+2))==-1){
			    alert("Invalid E-mail Address")
			    return false
				}
				if (str.indexOf(" ")!=-1){
			    alert("Invalid E-mail Address")
			    return false
				}
				if (E_MailSubmission.SecureNumber.value != "138795" ){
			    alert("Incorrect Security Number")
					return false
				}
			}
		else
			{
				alert('Please complete required fields');
				return false;
			}
}
//----------------------------------------------------------------------------------