

colflag = new Array(1,1,0);
marea = new Array();

var imoff=new Image(7,7);
imoff.src="/assets/a3r.gif";
var imon=new Image(7,7);
imon.src="/assets/a3d.gif";

function printPage(pageurl){
	var w=window.open(pageurl,"image","width=650,height=410, toolbar=yes, scrollbars=yes, location=no, menubar=yes, status=no");
}

function callPrinter(){
window.print();
}

function changeMe(im){
	/*var id = im.id;
	var nu = id.substring(4);
	nu--;
	var img=document.getElementById(id);
	if(!colflag[nu]){
		img.src=imoff.src;
	} else{
		img.src=imon.src;
	}
	sitr();
	//alert(colflag[nu]);
	if(im.id=="arrr1"){
		arrr1on ? im.src=imoff.src : im.src=imon.src;
		arrr1on = false;
	}
	if(im.id=="arrr2"){
		arrr2on ? im.src=imoff.src : im.src=imon.src;
		arrr2on = false;
	}
	alert(im.id);
	if(im.src==imon.src)
		im.src=imoff.src;
	else if(im.src==imoff.src)
		im.src=imon.src;
		*/
}

function sitr(){
for(var i=0; i<100; i++){
	if(i==90)
		break;
}
}

function tcol(ce,f,mf){
	if(mf==1){
	  if(f){
		ce.className="mo1";
		ce.firstChild.className="mlinkon1";
	  }else{
		ce.className="mn1";
		ce.firstChild.className="mlink1";
	  }
	} else if(mf==2) {
	  if(f){
		ce.className="mo2";
		ce.firstChild.className="mlinkon2";
	  }else{
		ce.className="mn2";
		ce.firstChild.className="mlink2";
	  }
	}
}

function wspopup(imageurl){
	var w = window.open(imageurl,"image","width=550,height=510");
}
function opennewwindow(url,name,parameters){
	window.open(url,name,parameters);
}

if(window.event + "" == "undefined") event = null;
function HM_f_PopUp(){return false};
function popUp(){return false};
function popDown(){return false};
function HM_f_PopDown(){return false};
popUp = HM_f_PopUp;
popDown = HM_f_PopDown;

HM_PG_MenuWidth = 150;
HM_PG_FontFamily = "Verdana";
HM_PG_FontSize = 8;
HM_PG_FontBold = 0;
HM_PG_FontItalic = 0;
HM_PG_FontColor = "blue";
HM_PG_FontColorOver = "blue";
HM_PG_BGColor = "#ffff33";
HM_PG_BGColorOver = "#e7e7aa";

HM_PG_BorderColor = "black";
HM_PG_BorderStyle = "solid";
HM_PG_SeparatorSize = 1;
HM_PG_SeparatorColor = "#d0ff00";

HM_PG_ImageSrc = "a4r.gif";
HM_PG_ImageSrcLeft = "a4r.gif";
HM_PG_ImageSrcOver = "a4r.gif";
HM_PG_ImageSrcLeftOver = "a4r.gif";
HM_PG_ImageHorizSpace = 3;
HM_PG_ImageVertSpace = "middle";

HM_PG_KeepHilite = 1; 
HM_PG_ClickStart = 0;
HM_PG_ChildOverlap = 1;
HM_PG_ChildOffset = 0;
HM_PG_ChildPerCentOver = null;
HM_PG_TopSecondsVisible = .5;
HM_PG_UponDisplay = null;
HM_PG_UponHide = null;
HM_PG_RightToLeft = 0;

HM_PG_ShowLinkCursor = 1;
HM_PG_NSFontOver = true;

HM_PG_ScrollBarColor = "lightgrey";
HM_PG_ScrollImgSrcTop = "HM_More_black_top.gif";
HM_PG_ScrollImgSrcBot = "HM_More_black_bot.gif";
HM_PG_ScrollImgWidth = 7;
HM_PG_ScrollImgHeight = 7;

//HM_a_TreesToBuild = [2,3]





	
function SPINorderCheck(form)
{

		if (form.Title.selectedIndex == 0) {
			form.Title.focus();
			alert("Please select your title.");
			return false;
		}
		
		if (form.Firstname.value.length < 2) {
			alert("Please supply your first name.");
			form.Firstname.focus();
			return false;
		}
		
		if (form.Surname.value.length < 2) {
			alert("Please supply your surname.");
			form.Surname.focus();
			return false;
		}



		if (form.email.value.length < 5) {
			alert("Please supply a valid e-mail address.");
			form.email.focus();
			return false;
		}
		
		
		if (form.email.value.length >= 0) {
		anyspaces = form.email.value.indexOf(" ");
		dot = form.email.value.lastIndexOf(".");
		atsign = form.email.value.indexOf("@");


		}
		
		if ((atsign <= 0)||(dot <= (atsign + 1))||(anyspaces != -1)||(dot == form.email.value.length)){
			alert("The e-mail address given is invalid.");
			form.email.focus();
			return false;
		}

		if (form.Country.selectedIndex == 0) {
			alert("Please include your country.");
			form.Country.focus();
			return false;
		}
		
		if (form.Work_sector.selectedIndex == 0) {
			alert("Please include your work sector.");
			form.Work_sector.focus();
			return false;
		}
			
return true;
}



function WEBorderCheck(form)
{

		if (form.Title.selectedIndex == 0) {
			form.Title.focus();
			alert("Please select your title.");
			return false;
		}
		
		if (form.Firstname.value.length < 2) {
			alert("Please supply your first name.");
			form.Firstname.focus();
			return false;
		}
		
		if (form.Surname.value.length < 2) {
			alert("Please supply your surname.");
			form.Surname.focus();
			return false;
		}



		if (form.email.value.length < 5) {
			alert("Please supply a valid e-mail address.");
			form.email.focus();
			return false;
		}
		
		
		if (form.email.value.length >= 0) {
		anyspaces = form.email.value.indexOf(" ");
		dot = form.email.value.lastIndexOf(".");
		atsign = form.email.value.indexOf("@");


		}
		
		if ((atsign <= 0)||(dot <= (atsign + 1))||(anyspaces != -1)||(dot == form.email.value.length)){
			alert("The e-mail address given is invalid.");
			form.email.focus();
			return false;
		}

		if (form.Country.selectedIndex == 0) {
			alert("Please include your country.");
			form.Country.focus();
			return false;
		}
		
		if (form.Work_sector.selectedIndex == 0) {
			alert("Please include your work sector.");
			form.Work_sector.focus();
			return false;
		}
			
return true;
}


function feedbackCheck(form)
{


		if (form.person.value.length < 2) {
			alert("Please supply your name.");
			form.person.focus();
			return false;
		}


		if (form.email.value.length < 5) {
			alert("Please supply a valid e-mail address.");
			form.email.focus();
			return false;
		}
		
		
		if (form.email.value.length >= 0) {
		anyspaces = form.email.value.indexOf(" ");
		dot = form.email.value.lastIndexOf(".");
		atsign = form.email.value.indexOf("@");

		}
		
		if ((atsign <= 0)||(dot <= (atsign + 1))||(anyspaces != -1)||(dot == form.email.value.length)){
			alert("The e-mail address given is invalid.");
			form.email.focus();
			return false;
		}

		if (form.subject.value.length < 2) {
			alert("Please supply a subject.");
			form.subject.focus();
			return false;
		}

		if (form.feedback.value.length < 2) {
			alert("Please supply your feedback.");
			form.feedback.focus();
			return false;
		}

return true;

}


function checkSearch(form)
{


		if (form.search.value == "") {
			alert("Please enter a value.");
			form.search.focus();
			return false;
		}


return true;

}



function checkFeedback(form)
{
	var initVal	= ".";
	var errors		= false;
	var errorMsg 	= "Please complete the following required fields:\t\n\n";

	for (var i=0; i <form.elements.length; i++)
		{
			var formElement 	= form.elements[i].name;
			var formElementVal 	= form.elements[i].value;
			var isReq 			= formElement.indexOf("_req");

			if (isReq > 0 && (formElementVal == initVal || formElementVal == "")) 
				{
					formElement = formElement.substring(0, formElement.length-4);
					errorMsg	= errorMsg += "\t" + formElement + "\n";
					errors 		= true;
				}

		}

   	if (errors)
   		{
   			alert(errorMsg);
		 	return false;
   		}

}
