function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


function ViewMap(){
	var winpops=window.open("images/MapLarge.gif","","width=458,height=557,scrollbars,resizable")
}

function ViewAGMMap(){
	var winpops=window.open("images/MapAGMLarge.gif","","width=458,height=557,scrollbars,resizable")
}

function fieldError(control){
	document.getElementById(control).style.backgroundColor = '#F85757';
	document.getElementById(control).focus();
}

function fieldActive(control){
	document.getElementById(control).style.backgroundColor = '#7CD182';
}

function fieldOK(control){
	document.getElementById(control).style.backgroundColor = '#FFFFFF';
}
function msg(msg){
	//alert(msg)
}

function CheckEmail(who) {
	/* With RegExp */
	var email=/^[A-Za-z0-9]+([_\.-][A-Za-z0-9]+)*@[A-Za-z0-9]+([_\.-][A-Za-z0-9]+)*\.([A-Za-z]){2,4}$/i;
	return(email.test(who));
}


//******************************************************
//
//	Check Login Form 
//
//******************************************************


function CheckLiteratureRequestForm(){

if(document.getElementById('txtForename').value == ""){

	fieldError('txtForename')
	msg('Required Field: Forename')
	return false;
}

if(document.getElementById('txtsurname').value == ""){

	fieldError('txtSurname')
	msg('Required Field: Surname')
	return false
}
if(document.getElementById('txtEmailAddress').value == ""){

	fieldError('txtEmailAddress')
	msg('Required Field: Email')
	return false
}

//check the validity of the email address
if(!(CheckEmail(document.getElementById('txtEmailAddress').value))){
	fieldError('txtEmailAddress')
	alert('Please enter a valid email address')
	return false;
}

if(document.getElementById('txtSubject').value == ""){

	fieldError('txtSubject')
	msg('Required Field: Subject')
	return false
}
return true;
}


function getCalendarDate()
{

   var weekday=new Array(7)
   weekday[0]="Sunday"
   weekday[1]="Monday"
   weekday[2]="Tuesday"
   weekday[3]="Wednesday"
   weekday[4]="Thursday"
   weekday[5]="Friday"
   weekday[6]="Saturday"

   var months = new Array(13);
   months[0]  = "January";
   months[1]  = "February";
   months[2]  = "March";
   months[3]  = "April";
   months[4]  = "May";
   months[5]  = "June";
   months[6]  = "July";
   months[7]  = "August";
   months[8]  = "September";
   months[9]  = "October";
   months[10] = "November";
   months[11] = "December";
   var now         = new Date();
   var monthnumber = now.getMonth();
   var monthname   = months[monthnumber];
   var daynumber     = now.getDay();
   var dayname     = weekday[daynumber];
   var monthday    = now.getDate();
   var year        = now.getYear();
   if(year < 2000) { year = year + 1900; }
   var dateString = '&#32;&#32;' +  '&#32;' + 
		    monthday +
                    '&#32;' +
                    monthname +
                    ' ' +
                    year;
   return dateString;
} // function getCalendarDate()

function getClockTime()
{
   var now    = new Date();
   var hour   = now.getHours();
   var minute = now.getMinutes();
   var second = now.getSeconds();
   var ap = "am";
   if (hour   > 11) { ap = "pm";             }
   if (hour   > 12) { hour = hour - 12;      }
   if (hour   == 0) { hour = 12;             }
//no leading 0 for hour
//   if (hour   < 10) { hour   = " + hour;   }
//   if (hour   < 10) { hour   = "0" + hour;   }
   if (minute < 10) { minute = "0" + minute; }
   if (second < 10) { second = "0" + second; }
   var timeString = hour + '.' +  minute; //+ ap;
   return timeString;
} // function getClockTime()


function DateTime(){
	
	document.getElementById('DateTimeHolder').innerHTML = "<b>" +  getClockTime() + "</b>&nbsp " +  getCalendarDate() ;
}


function samplegraph(){
	hideLayer('scrollingContent');
	hideLayer('SectionImage');
	showLayer('SampleGraph');
}

function init(currentPage){

	if(currentPage != 'AboutUs'){
		document.getElementById('Menu_AboutUs').onmouseover = function () { document.getElementById('Menu_AboutUs').src='images/Menu_AboutUs_On.gif'};
		document.getElementById('Menu_AboutUs').onmouseout = function () { document.getElementById('Menu_AboutUs').src='images/Menu_AboutUs.gif'};
		document.getElementById('Menu_AboutUs').onclick = function () { NavigateTo('AboutUs.aspx')};						
	}else{
		document.getElementById('Menu_AboutUs').src='images/Menu_AboutUs_On.gif';
		document.getElementById('SubMenu_AboutUs').style.display='block';
		document.getElementById('Menu_AboutUs').onclick = function () { NavigateTo('AboutUs.aspx')};	
				
	}

	if(currentPage != 'News'){
		document.getElementById('Menu_News').onmouseover = function () { document.getElementById('Menu_News').src='images/Menu_News_On.gif'};
		document.getElementById('Menu_News').onmouseout = function () { document.getElementById('Menu_News').src='images/Menu_News.gif'};
		document.getElementById('Menu_News').onclick = function () { NavigateTo('News.aspx')};						
	}else{
		document.getElementById('Menu_News').src='images/Menu_News_On.gif'
		document.getElementById('SectionInfoHolder_Block').style.background='#897F7F';
		document.getElementById('Menu_News').onclick = function () { NavigateTo('News.aspx')};						
	}

	if(currentPage != 'People'){
		document.getElementById('Menu_People').onmouseover = function () { document.getElementById('Menu_People').src='images/Menu_People_On.gif'};
		document.getElementById('Menu_People').onmouseout = function () { document.getElementById('Menu_People').src='images/Menu_People.gif'};
		document.getElementById('Menu_People').onclick = function () { NavigateTo('People.aspx')};						
	}else{
		document.getElementById('Menu_People').src='images/Menu_People_On.gif'
		document.getElementById('SectionInfoHolder_Block').style.background='#7D7D51';
		document.getElementById('Menu_People').onclick = function () { NavigateTo('People.aspx')};						
	}

	

	if(currentPage != 'GleacherPartners'){
		document.getElementById('Menu_GleacherPartners').onmouseover = function () { document.getElementById('Menu_GleacherPartners').src='images/Menu_GleacherPartners_On.gif'};
		document.getElementById('Menu_GleacherPartners').onmouseout = function () { document.getElementById('Menu_GleacherPartners').src='images/Menu_GleacherPartners.gif'};
		document.getElementById('Menu_GleacherPartners').onclick = function () { NavigateTo('BroadpointGleacher.aspx')};						
	}else{
		document.getElementById('Menu_GleacherPartners').src='images/Menu_GleacherPartners_On.gif'
		document.getElementById('SectionInfoHolder_Block').style.background='#5F1A32';
		document.getElementById('Menu_GleacherPartners').onclick = function () { NavigateTo('BroadpointGleacher.aspx')};						
	}

	if(currentPage != 'Contact'){
		document.getElementById('Menu_Contact').onmouseover = function () { document.getElementById('Menu_Contact').src='images/Menu_Contact_On.gif'};
		document.getElementById('Menu_Contact').onmouseout = function () { document.getElementById('Menu_contact').src='images/Menu_Contact.gif'};
		document.getElementById('Menu_Contact').onclick = function () { NavigateTo('Contact.aspx')};						
	}else{
		document.getElementById('Menu_Contact').src='images/Menu_Contact_On.gif';
		document.getElementById('SectionInfoHolder_Block').style.background='#60768C';
		document.getElementById('Menu_Contact').onclick = function () { NavigateTo('Contact.aspx')};						
	
	}



	if(currentPage != 'Transactions'){
		document.getElementById('Menu_Transactions').onmouseover = function () { document.getElementById('Menu_Transactions').src='images/Menu_Transactions_On.gif'};
		document.getElementById('Menu_Transactions').onmouseout = function () { document.getElementById('Menu_Transactions').src='images/Menu_Transactions.gif'};
		document.getElementById('Menu_Transactions').onclick = function () { NavigateTo('Transactions.aspx')};						
	}else{
		document.getElementById('Menu_Transactions').src='images/Menu_Transactions_On.gif'
		document.getElementById('SectionInfoHolder_Block').style.background='#85673F';
		document.getElementById('Menu_Transactions').onclick = function () { NavigateTo('Transactions.aspx')};						
	}
	


	
}


function initTransactionsSubMenu(currentPage){
	if(currentPage != 'Transactions'){
		document.getElementById('SubMenu_Transactions').onmouseover = function () { document.getElementById('SubMenu_Transactions').src='images/SubMenu_Transactions_On.gif'};
		document.getElementById('SubMenu_Transactions').onmouseout = function () { document.getElementById('SubMenu_Transactions').src='images/SubMenu_Transactions.gif'};
		document.getElementById('SubMenu_Transactions').onclick = function () { NavigateTo('Transactions.aspx')};						
	}else{
		document.getElementById('SubMenu_Transactions').src='images/SubMenu_Transactions_On.gif'
		document.getElementById('SectionInfoHolder_Block').style.background='#85673F';
	}


	if(currentPage != 'TrackRecord'){
		document.getElementById('SubMenu_TrackRecord').onmouseover = function () { document.getElementById('SubMenu_TrackRecord').src='images/SubMenu_TrackRecord_On.gif'};
		document.getElementById('SubMenu_TrackRecord').onmouseout = function () { document.getElementById('SubMenu_TrackRecord').src='images/SubMenu_TrackRecord.gif'};
		document.getElementById('SubMenu_TrackRecord').onclick = function () { NavigateTo('TrackRecord.aspx')};						
	}else{
		document.getElementById('SubMenu_TrackRecord').src='images/SubMenu_TrackRecord_On.gif'
		document.getElementById('SectionInfoHolder_Block').style.background='#85673F';
	}

	if(currentPage != 'CaseStudies'){
	
		document.getElementById('SubMenu_CaseStudies').onmouseover = function () { document.getElementById('SubMenu_CaseStudies').src='images/SubMenu_CaseStudies_On.gif'};
		document.getElementById('SubMenu_CaseStudies').onmouseout = function () { document.getElementById('SubMenu_CaseStudies').src='images/SubMenu_CaseStudies.gif'};
		document.getElementById('SubMenu_CaseStudies').onclick = function () { NavigateTo('CaseStudies.aspx')};							
	
	}else{
		document.getElementById('SubMenu_CaseStudies').src='images/SubMenu_CaseStudies_On.gif'
		document.getElementById('SectionInfoHolder_Block').style.background='#85673F';
	}
}

function initCaseStudies(){
	document.getElementById('SectionInfoHolder_Block').style.background='#85673F';
}

function initAboutUsSubMenu(currentPage){

	if(currentPage != 'DF'){
		document.getElementById('SubMenu_DF').onmouseover = function () { document.getElementById('SubMenu_DF').src='images/SubMenu_DF_On.gif'};
		document.getElementById('SubMenu_DF').onmouseout = function () { document.getElementById('SubMenu_DF').src='images/SubMenu_DF.gif'};
		document.getElementById('SubMenu_DF').onclick = function () { NavigateTo('DF')};						
	}else{
		document.getElementById('SubMenu_DF').src='images/SubMenu_DF_On.gif';
		document.getElementById('SubMenu_DF').style.display='block';
	}

	if(currentPage != 'OB'){
		document.getElementById('SubMenu_OB').onmouseover = function () { document.getElementById('SubMenu_OB').src='images/SubMenu_OB_On.gif'};
		document.getElementById('SubMenu_OB').onmouseout = function () { document.getElementById('SubMenu_OB').src='images/SubMenu_OB.gif'};
		document.getElementById('SubMenu_OB').onclick = function () { NavigateTo('OB')};						
	}else{
		document.getElementById('SubMenu_OB').src='images/SubMenu_OB_On.gif';
		document.getElementById('SubMenu_OB').style.display='block';
	}

}

function initContactSubMenu(currentPage){

	if(currentPage != 'Contact'){
		document.getElementById('SubMenu_Contact').onmouseover = function () { document.getElementById('SubMenu_Contact').src='images/SubMenu_Contact_On.gif'};
		document.getElementById('SubMenu_Contact').onmouseout = function () { document.getElementById('SubMenu_Contact').src='images/SubMenu_Contact.gif'};
		document.getElementById('SubMenu_Contact').onclick = function () { NavigateTo('Contact.aspx')};						
	}else{
		document.getElementById('SubMenu_Contact').src='images/SubMenu_Contact_On.gif';
		document.getElementById('SubMenu_Contact').style.display='block';
	}

if(currentPage != 'LateralRecruitment'){
		document.getElementById('SubMenu_LateralRecruitment').onmouseover = function () { document.getElementById('SubMenu_LateralRecruitment').src='images/SubMenu_LateralRecruitment_On.gif'};
		document.getElementById('SubMenu_LateralRecruitment').onmouseout = function () { document.getElementById('SubMenu_LateralRecruitment').src='images/SubMenu_LateralRecruitment.gif'};
		document.getElementById('SubMenu_LateralRecruitment').onclick = function () { NavigateTo('LateralRecruitment.aspx')};						
	}else{
		document.getElementById('SubMenu_LateralRecruitment').src='images/SubMenu_LateralRecruitment_On.gif';
		document.getElementById('SubMenu_LateralRecruitment').style.display='block';
	}

if(currentPage != 'GraduateRecruitment'){
		document.getElementById('SubMenu_GraduateRecruitment').onmouseover = function () { document.getElementById('SubMenu_GraduateRecruitment').src='images/SubMenu_GraduateRecruitment_On.gif'};
		document.getElementById('SubMenu_GraduateRecruitment').onmouseout = function () { document.getElementById('SubMenu_GraduateRecruitment').src='images/SubMenu_GraduateRecruitment.gif'};
		document.getElementById('SubMenu_GraduateRecruitment').onclick = function () { NavigateTo('GraduateRecruitment.aspx')};						
	}else{
		document.getElementById('SubMenu_GraduateRecruitment').src='images/SubMenu_GraduateRecruitment_On.gif';
		document.getElementById('SubMenu_GraduateRecruitment').style.display='block';
	}

	if(currentPage != 'Careers'){
		document.getElementById('SubMenu_Careers').onmouseover = function () { document.getElementById('SubMenu_Careers').src='images/SubMenu_Careers_On.gif'};
		document.getElementById('SubMenu_Careers').onmouseout = function () { document.getElementById('SubMenu_Careers').src='images/SubMenu_Careers.gif'};
		document.getElementById('SubMenu_Careers').onclick = function () { NavigateTo('Careers.aspx')};						
	}else{
		document.getElementById('SubMenu_Careers').src='images/SubMenu_Careers_On.gif';
		document.getElementById('SubMenu_Careers').style.display='block';
	}
}

function initNewsSubMenu(currentPage){

	if(currentPage != 'LN'){
		document.getElementById('SubMenu_LN').onmouseover = function () { document.getElementById('SubMenu_LN').src='images/SubMenu_LN_On.gif'};
		document.getElementById('SubMenu_LN').onmouseout = function () { document.getElementById('SubMenu_LN').src='images/SubMenu_LN.gif'};
		document.getElementById('SubMenu_LN').onclick = function () { NavigateTo('LN.aspx')};						
	}else{
		document.getElementById('SubMenu_LN').src='images/SubMenu_LN_On.gif';
		document.getElementById('SubMenu_LN').style.display='block';
	}

	if(currentPage != 'AN'){
		document.getElementById('SubMenu_AN').onmouseover = function () { document.getElementById('SubMenu_AN').src='images/SubMenu_AN_On.gif'};
		document.getElementById('SubMenu_AN').onmouseout = function () { document.getElementById('SubMenu_AN').src='images/SubMenu_AN.gif'};
		document.getElementById('SubMenu_AN').onclick = function () { NavigateTo('AN.aspx')};						
	}else{
		document.getElementById('SubMenu_AN').src='images/SubMenu_AN_On.gif';
		document.getElementById('SubMenu_AN').style.display='block';
	}
}


function hideSubMenu(){
	hideLayer('SubMenuHolder');	
}

function hideLayer(layerToHide){
	document.getElementById(layerToHide).style.visibility = 'hidden';
}
function showLayer(layerToShow){
	document.getElementById(layerToShow).style.visibility = 'visible';
}

function NavigateTo(page){
	document.location.href= page;
}




function Map() { 

var txt='<img src=images/map_Large.gif>';


winStats='toolbar=no,location=no,directories=no,menubar=no,'
   winStats+='scrollbars=yes,width=520,height=690'
   if (navigator.appName.indexOf("Microsoft")>=0) {
      winStats+=',left=10,top=25'
    }else{
      winStats+=',screenX=10,screenY=25'
    }
   floater=window.open("","",winStats)    
   
   floater.document.open();
   floater.document.write(txt);
  
}  
