

function setFocusKeyword()
	{
	try
	{
		document.getElementById("txtKeywords").focus();
	}
	catch(error)
		{}
	}

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_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_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];}
}
function ChangeImage(linkName)
{
	var imgTagIndex = linkName.indexOf("lnkViewDetail");
	var imgTag = linkName.substring(0, imgTagIndex);
	var imgName = imgTag + "imgViewDetails";
	MM_swapImage(imgName,'','images/Arrow-DarkBlue.gif',1)
}

function setCopyrightYear()
{
	var currDate = new Date();
	var dtYr = currDate.getFullYear();
	document.getElementById("cpYear").innerHTML = dtYr;
}

function setHeight()
{
	if(!document.all)
	{ 
		if((navigator.userAgent).indexOf("Netscape6/6.0") != -1)
		{ 
			
			document.getElementById("tblExpand").style.height = window.innerHeight-285;
			document.getElementById("tdExpand").style.height = window.innerHeight-285;
		}
		else
		{
			
			document.getElementById("tblExpand").style.height = window.innerHeight-285;
			document.getElementById("tdExpand").style.height = window.innerHeight-285;
		}	
	}
	else {  // If IE
		var heightcheck = window.screen.height;
		document.getElementById("tdExpand").style.height = heightcheck-450;
		document.getElementById("tblExpand").style.height = heightcheck-450;
	}
}

function setInnerHeight()
{
	if(!document.all)
	{
		if((navigator.userAgent).indexOf("Netscape6/6.0") != -1)
		{
		//	document.getElementById("tblExpand").style.height = window.innerHeight-240;
			document.getElementById("tdExpand").style.height = window.innerHeight-250;
		}
		else
		{
		//	document.getElementById("tblExpand").style.height = window.innerHeight-250;
			document.getElementById("tdExpand").style.height = window.innerHeight-250;
		}	
	}
	else {  // If IE
		var heightcheck = window.screen.height;
		document.getElementById("tdExpand").style.height = heightcheck-400;
		document.getElementById("tblExpand").style.height = heightcheck-400;
	}
	
		searchImg()
	
}


function searchImg(){
	var pagePath = window.location.href
	pagePath = pagePath.toLowerCase()
	try{
		if ((pagePath.indexOf("frompage=search") != -1) || (document.getElementById("hdnSearch").value == "search")){
		//if ((document.getElementById("hdnSearch").value) == "search"){
			document.getElementById("imgTemplateLeft").src="images/Text-SearchResults.gif"
			document.getElementById("imgTemplateLeft").alt="Search Results"
		//}
		}
	}
	catch(err){
	}
}

// FUNCTION TO CHANGE COLOUR ON MOUSEOVER
function SwapLinkText_over(lkStrName)
 {
	var strVal = "" + lkStrName
	document.getElementById(strVal).style.color="#05417D";
}

// FUNCTION TO CHANGE COLOUR ON MOUSEOUT
function SwapLinkText_out(lkStrName) 
{
	var strVal = "" + lkStrName
	document.getElementById(strVal ).style.color="#A7A7A7";
}

// FUNCTION CALLED ON CLICKING OF SUBMIT BUTTON
function clientSubmit()
	{
		if(document.all)
		{
			for (sums = 0; sums < Page_ValidationSummaries.length; sums++) 
			{
				summary = Page_ValidationSummaries[sums];
				summary.style.visibility = "visible"
			}
		}
		document.getElementById("btnSubmit").click();
	}

//FUNCTION TO OPEN A POP UP WINDOW 
function popUp(url) 
	{
	var top,left
	top = (screen.height-450)/2;
	left = (screen.width-717)/2;
	sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=717,height=450,left=' + left + ',top=' + top);self.name = "mainWin"; 
	}
function openSearch()
{

	var keyword = escape(document.getElementById("txtKeywords").value.trim())
	var Industry = document.getElementById("ddIndustryList").value
	//document.getElementById("hdnSearch").value) = "search";
	window.location.href="jobListing.aspx?keywords="+keyword+"&AreaOfWorkID="+Industry+"&fromPage=search"

	
}	

String.prototype.trim = function()
{
  return this.replace(/^\s+/,'').replace(/\s+$/,'');
}
