// Variables

var statement = "";
var individual_statement = "";
var careers_quotes = new Array('&quot;They provide the experience and training required for a successful and enjoyable professional career.&quot;','&quot;They are an ever growing firm, which gives me and all the staff the ability and confidence to perform well in the construction industry.&quot; ','&quot;They have such a diverse range of Projects that one is constantly learning new skills and expertise from working underneath people who are both approachable for advice and good fun - never a dull moment!&quot;','&quot;If you are looking to start a successful career and at the same time join a friendly and lively company you need look no further. From the moment you cross the welcome mat, you are made a member of a select team, where your career will be nurtured and your social calendar filled.&quot;')

var careers_quotes_index = 0;
var timeout;

var careers_images = new Array('<img src="../images/careers/groupinparis2.jpg" />', '<img src="../images/careers/gokarting2.jpg" />', '<img src="../images/careers/Sharon&Rob.jpg" />')
var careers_images_index = 0;



// Script for Image Swapping

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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 MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}







// Script for Clearing "Enter Search Words" from input search box

function clearInitial(){
	statement = document.getElementById('search_entry').value;
	if(statement == "Enter search words"){
		document.getElementById('search_entry').value = "";
	}
}







// Script for Expandable DIVs


function expandDIV(num){
	statement = "document.getElementById('expandable_" + num + "').style.display = \"block\"";
	eval(statement);
	
	if(num==1){
		document.getElementById('expand_link_1').innerHTML = 'We believe in all our staff receiving the same <a href="javascript:collapseDIV(1);">benefits</a>';
	}
	
	if(num==2){
		document.getElementById('expand_link_2').innerHTML = 'We will help you attain your professional qualifications with the help of our <a href="javascript:collapseDIV(2);">comprehensive training programme</a>';
	}
}


function collapseDIV(num){
	statement = "document.getElementById('expandable_" + num + "').style.display = \"none\"";
	eval(statement);
	
	if(num==1){
		document.getElementById('expand_link_1').innerHTML = 'We believe in all our staff receiving the same <a href="javascript:expandDIV(1);">benefits</a>';
	}
	
	if(num==2){
		document.getElementById('expand_link_2').innerHTML = 'We will help you attain your professional qualifications with the help of our <a href="javascript:expandDIV(2);">comprehensive training programme</a>';
	}
}














// Rotation of Quotes on Careers Page

function rotateQuotes(num){
	document.getElementById('careers_quote').innerHTML = careers_quotes[num];
	careers_quotes_index++;
	
	if(careers_quotes_index == 4){
		careers_quotes_index = 0;
	}
	
	statement = "rotateQuotes(" + careers_quotes_index + ")";
	
	timeout = setTimeout(statement, 11000);
}

//rotation of images on Careers page
function rotateImages(num){
	document.getElementById('careers_image').innerHTML = careers_images[num];
	careers_images_index++;
	
	if(careers_images_index == 3){
		careers_images_index = 0;
	}
	
	statement = "rotateImages(" + careers_images_index + ")";
	
	timeout = setTimeout(statement, 11000);
}










// Hightlight of Appropriate Links on Project Profiles Index Page

function changeLinkClass(link_id){
	individual_statement = "document.getElementById('" + link_id + "').className = 'project_links_hover';";
	eval(individual_statement);
}

function revertLinkClass(link_id){
	individual_statement = "document.getElementById('" + link_id + "').className = 'project_links';";
	eval(individual_statement);
}


