function searchtips(url){
	if (url == null) {
		var ht = screen.height; var wdth = screen.width; var newWidth = 450; var newHeight = 270; var lft = (wdth / 2) - (newWidth / 2); var tp = (ht / 2) - (newHeight / 2);
   		win = window.open("../searchtips.jsp","newWin", "toolbar=no,location=no,directories=no,status=no, menubar=no,scrollbars=yes,resizable=no,copyhistory=no,left=" + lft + ",top=" + tp + ",width=" + newWidth + ",height=" + newHeight);
	}
	else {
		var ht = screen.height; var wdth = screen.width; var newWidth = 450; var newHeight = 270; var lft = (wdth / 2) - (newWidth / 2); var tp = (ht / 2) - (newHeight / 2);
   		win = window.open(url,"newWin", "toolbar=no,location=no,directories=no,status=no, menubar=no,scrollbars=yes,resizable=no,copyhistory=no,left=" + lft + ",top=" + tp + ",width=" + newWidth + ",height=" + newHeight);
	}
}


///// common popup window help document //////
var popUpWin=0;
function popUpWindow(parram)
{
  	if(popUpWin)
  	{
    	if(!popUpWin.closed) popUpWin.close();
  	}
	var ht = screen.height;
	var wdth = screen.width;
	var newWidth = 450;
	var newHeight = 350;
	var lft = (wdth / 2) - (newWidth / 2);
	var tp = (ht / 2) - (newHeight / 2)-30;

  	popUpWin = open("../help/employer/vacancydetailhelp.jsp?id="+parram, "win", "toolbar=no, location=yes, directories=no,status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=no, left=" + lft + ",top=" + tp + ",width=" + newWidth + ",height=" + newHeight);
}


function openSizeWindowSDB(url,width,height,win){
	var ht = screen.height;
	var wdth = screen.width;
	var newWidth = width;
	var newHeight = height;
	var lft = (wdth / 2) - (newWidth / 2);
	var tp = (ht / 2) - (newHeight / 2);
	var w = window.open (url, win, "location=no,screen x=200,screen y=200,toolbar=no,directories=no,status=no, menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,left="+ lft + ",top="+ tp +",width="+ newWidth  +",height="+ newHeight);
}//Opens

function openPopupWindow(url,width,height,win)
{
	var ht = screen.height;
	var wdth = screen.width;
	var newWidth = width;
	var newHeight = height;
	var lft = (wdth / 2) - (newWidth / 2);
	var tp = (ht / 2) - (newHeight / 2);
	var w = window.open (url, win, "location=no,screen x=200,screen y=200,toolbar=no,directories=no,status=no, menubar=no,scrollbars=yes,resizable=no,copyhistory=no,left="+ lft + ",top="+ tp +",width="+ newWidth  +",height="+ newHeight);
}


/* fuctions for check all clear all and highlight current row */

function DataTableCheckBox_Click()
{
	var chkLength = document.getElementsByName("chkSelect").length;
	var selChkLen = 0;
	if (chkLength==undefined)
	{ 
		if (document.getElementsByName("chkSelect").checked) 
		{
			selChkLen = 1;
		} 
	} 
	else 
	{
		for (var i=0; i < chkLength; i++)
		{
			if (document.getElementsByName("chkSelect")[i].checked)
			{	
				selChkLen++;
			}
		}
	}
	if(selChkLen==0)
	{
		document.getElementById('selCheckBox').innerHTML="";
	}
	else
	{
		document.getElementById('selCheckBox').innerHTML="You have selected <strong>"+selChkLen+"</strong> Row(s).";
	}
	
	// Uncheck the check box for all page result, if avilable
	var  select_all_pages = document.getElementsByName("select_all_pages");
	if(select_all_pages!=null)
	{
		for(var j=0;j<select_all_pages.length;j++)
		{
			select_all_pages[j].checked = false;	
		}
	}	
	
	var oTR=this.parentNode.parentNode;
	if(this.checked)
	{
		g_oDataTable.CheckBoxes.NumberChecked++;
	}
	else 
	{
		g_oDataTable.CheckBoxes.NumberChecked--;
	}
	g_oDataTable.SelectAllRows.checked=(g_oDataTable.CheckBoxes.NumberChecked==g_oDataTable.CheckBoxes.length)?true:false;
}


function SelectAllRows_Click()
{
	// Uncheck the check box for all page result, if avilable
	if(this.id!='clearall') 
	{
		var  select_all_pages = document.getElementsByName("select_all_pages");
		if(select_all_pages!=null)
		{
			for(var j=0;j<select_all_pages.length;j++)
			{
				select_all_pages[j].checked = false;	
			}
		}		
	}	
	if(typeof g_oDataTable=='undefined'||!g_oDataTable)
	{
		return;
	}
	var aCheckBoxes=g_oDataTable.CheckBoxes;
	var bChecked=g_oDataTable.SelectAllRows.checked;
	if(this.id=='clearall'||this.id=='checkall')
	{
		bChecked=(this.id=='clearall')?false:true;g_oDataTable.SelectAllRows.checked=bChecked;
	}

	var aRows=g_oDataTable.tBodies[0].rows;
	var nRows=aRows.length-1;
	if(bChecked) 
	{ 
		for(var i=nRows;i>=0;i--) 
		{
			aCheckBoxes[i].checked=bChecked;
		}
		document.getElementById('selCheckBox').innerHTML="You have selected <strong>"+aRows.length+"</strong> Row(s).";
    } 
	else 
	{
		for(var i=nRows;i>=0;i--) 
		{
			aCheckBoxes[i].checked=bChecked;
  		}  
		document.getElementById('selCheckBox').innerHTML="";
	}
	g_oDataTable.CheckBoxes.NumberChecked=(bChecked)?g_oDataTable.CheckBoxes.length:0;
}


function DataTable_Init() 
{
	g_oDataTable=document.getElementById("listtable");
	if(g_oDataTable) 
	{
		try {
		g_oDataTable.SelectAllRows=document.getElementById("selectallrows");
		var checkBoxName = document.getElementById("chkName").value
		var aCheckBoxes=document.getElementsByName(checkBoxName);
		var aRows=g_oDataTable.tBodies[0].rows;
		var nRows=aRows.length-1;
		for(var i=nRows;i>=0;i--)
		{
			aCheckBoxes[i].onclick=DataTableCheckBox_Click;
		}
		g_oDataTable.SelectAllRows.onclick=SelectAllRows_Click;
		document.getElementById("checkall").onclick=SelectAllRows_Click;
		document.getElementById("clearall").onclick=SelectAllRows_Click;

		g_oDataTable.CheckBoxes=aCheckBoxes;
		g_oDataTable.CheckBoxes.NumberChecked=0;
		} catch (err) {}
	}
	else 
		return false;
} 


function selectrow(thisRow) 
{
	// get the current row
	var newRowID = thisRow.id;
	// get the value of previous row if available
	var currentRowID = document.getElementById("selectdRow").value

	if(newRowID!=currentRowID)
	{
		// color the current row
		thisRow.className='rowColor';
		// reset the color of this row
		if(currentRowID!="")
		{
			document.getElementById(currentRowID).className = 'rowColorReset'
		}
		// set the row id to cash
		document.getElementById("selectdRow").value = newRowID;
  	}
}


/* End fuctions for check all clear all and highlight current row */
/* Fuctions for email confirmation */
function noSelectText(element)
{
	if (typeof element.onselectstart!="undefined") 
	{
		element.onselectstart=function(){return false}
	} 
	else if (typeof element.style.MozUserSelect!="undefined") 
	{
		element.style.MozUserSelect="none"
		element.style.cursor = "default"
	}
}


/* Functions for dropdown button menue */
function getposOffset(what, offsettype)
{
	var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
	var parentEl=what.offsetParent;
	while (parentEl!=null)
	{
		totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
		parentEl=parentEl.offsetParent;
	}
	return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth)
{
	if (ie4||ns6)
		dropmenuobj.style.left=dropmenuobj.style.top="-500px"
	if (menuwidth!="")
	{
		dropmenuobj.widthobj=dropmenuobj.style
		dropmenuobj.widthobj.width=menuwidth
	}
	if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
		obj.visibility=visible
	else if (e.type=="click")
		obj.visibility=hidden
}


function iecompattest()
{
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}


function clearbrowseredge(obj, whichedge)
{
	var edgeoffset=0
	if (whichedge=="rightedge")
	{
		var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
		dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
		if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
			edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
	}
	else
	{
		var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
		var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
		dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
		if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
		{ //move up?
			edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
			if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
				edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
		}
	}
	return edgeoffset
}


function populatemenu(what)
{
	if (ie4||ns6)
		dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth)
{
	if (window.event) 
		event.cancelBubble=true
	else if (e.stopPropagation) 
		e.stopPropagation()
	clearhidemenu()
	dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
	populatemenu(menucontents)

	if (ie4||ns6)
	{
		showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
		dropmenuobj.x=getposOffset(obj, "left")
		dropmenuobj.y=getposOffset(obj, "top")
		dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
		dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
	}
	return clickreturnvalue()
}


function clickreturnvalue()
{
	if (ie4||ns6) return false
	else return true
}


function contains_ns6(a, b) 
{
	while (b.parentNode)
	if ((b = b.parentNode) == a)
	return true;
	return false;
}


function dynamichide(e)
{
	if (ie4&&!dropmenuobj.contains(e.toElement))
		delayhidemenu()
	else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
		delayhidemenu()
}


function hidemenu(e)
{
	if (typeof dropmenuobj!="undefined"){
	if (ie4||ns6)
	dropmenuobj.style.visibility="hidden"
	}
}


function delayhidemenu()
{
	if (ie4||ns6)
		delayhide=setTimeout("hidemenu()",disappeardelay)
}


function clearhidemenu()
{
	if (typeof delayhide!="undefined")
		clearTimeout(delayhide)
}


/* End functions for dropdown button menue */
function transInCompleteMsg() 
{
	alert("Please complete all mandatory fields and save the form prior to uploading documents.");
}


// calculate ranking sum
function getTotalPoints(totDisplayId,elementID)
{     
    var tBox;  
   	var sum = 0;
    tBox = document.getElementsByTagName("INPUT");    
	for(i = 0; i< (tBox.length - 1) ; i++)
	{                  
		if(tBox[i].type == "text" && tBox[i].id == elementID )
		{             		    
			var controlid = tBox[i].id;
			if (!controlid.match(totDisplayId))
			{
				if(isNaN(Number(tBox[i].value)) == false  )
				{				 
					sum += Number(tBox[i].value);    
				}  
				else 
				{
					tBox[i].value = 0
				}
			}
		}
	}      
	var elem = document.getElementById(totDisplayId);
	if (typeof elem.textContent != 'undefined')
		elem.textContent = sum;
	else
		elem.innerText = sum;         
}


function allowOnlyNumbers(evt)
{
	var e = event || evt; // for trans-browser compatibility
	var charCode = e.which || e.keyCode;

	if (charCode > 31 && (charCode < 48 || charCode > 57))
		return false;

	return true;

}
// end calculating ranking sum

//partner----2008/12/18

function dis_type(url)
{
	if (url == null) 
	{
		var ht = screen.height; var wdth = screen.width; var newWidth = 770; var newHeight = 450; var lft = (wdth / 2) - (newWidth / 2); var tp = (ht / 2) - (newHeight / 2);
   		win = window.open("Disability_type _sex.htm","newWin", "toolbar=no,location=no,directories=no,status=no, menubar=no,scrollbars=yes,resizable=no,copyhistory=no,left=" + lft + ",top=" + tp + ",width=" + newWidth + ",height=" + newHeight);
	}
	else 
	{
		var ht = screen.height; var wdth = screen.width; var newWidth = 770; var newHeight = 450; var lft = (wdth / 2) - (newWidth / 2); var tp = (ht / 2) - (newHeight / 2);
   		win = window.open(url,"newWin", "toolbar=no,location=no,directories=no,status=no, menubar=no,scrollbars=yes,resizable=no,copyhistory=no,left=" + lft + ",top=" + tp + ",width=" + newWidth + ",height=" + newHeight);
	}
}

function dis_dist(url)
{
	if (url == null) 
	{
		var ht = screen.height; var wdth = screen.width; var newWidth = 788; var newHeight = 450; var lft = (wdth / 2) - (newWidth / 2); var tp = (ht / 2) - (newHeight / 2);
   		win = window.open("disability_dist.htm","newWin", "toolbar=no,location=no,directories=no,status=no, menubar=no,scrollbars=yes,resizable=no,copyhistory=no,left=" + lft + ",top=" + tp + ",width=" + newWidth + ",height=" + newHeight);
	}
	else 
	{
		var ht = screen.height; var wdth = screen.width; var newWidth = 788; var newHeight = 450; var lft = (wdth / 2) - (newWidth / 2); var tp = (ht / 2) - (newHeight / 2);
   		win = window.open(url,"newWin", "toolbar=no,location=no,directories=no,status=no, menubar=no,scrollbars=yes,resizable=no,copyhistory=no,left=" + lft + ",top=" + tp + ",width=" + newWidth + ",height=" + newHeight);
	}
}

function topjobs_etd(url)
{
	if (url == null) 
	{
		var ht = screen.height; var wdth = screen.width; var newWidth = 810; var newHeight = 500; var lft = (wdth / 2) - (newWidth / 2); var tp = (ht / 2) - (newHeight / 2);
   		win = window.open("topjobs_etd.htm","newWin", "toolbar=no,location=no,directories=no,status=no, menubar=no,scrollbars=yes,resizable=no,copyhistory=no,left=" + lft + ",top=" + tp + ",width=" + newWidth + ",height=" + newHeight);
	}
	else 
	{
		var ht = screen.height; var wdth = screen.width; var newWidth = 810; var newHeight = 500; var lft = (wdth / 2) - (newWidth / 2); var tp = (ht / 2) - (newHeight / 2);
   		win = window.open(url,"newWin", "toolbar=no,location=no,directories=no,status=no, menubar=no,scrollbars=yes,resizable=no,copyhistory=no,left=" + lft + ",top=" + tp + ",width=" + newWidth + ",height=" + newHeight);
	}
}

function demo(url)
{
	if (url == null) 
	{
		var ht = screen.height; var wdth = screen.width; var newWidth = 750; var newHeight = 580; var lft = (wdth / 2) - (newWidth / 2); var tp = (ht / 2) - (newHeight / 2);
   		win = window.open("howto_register.htm","newWin", "toolbar=no,location=no,directories=no,status=no, menubar=no,scrollbars=no,resizable=no,copyhistory=no,left=" + lft + ",top=" + tp + ",width=" + newWidth + ",height=" + newHeight);
	}
	else 
	{
		var ht = screen.height; var wdth = screen.width; var newWidth = 750; var newHeight = 580; var lft = (wdth / 2) - (newWidth / 2); var tp = (ht / 2) - (newHeight / 2);
   		win = window.open(url,"newWin", "toolbar=no,location=no,directories=no,status=no, menubar=no,scrollbars=no,resizable=no,copyhistory=no,left=" + lft + ",top=" + tp + ",width=" + newWidth + ",height=" + newHeight);
	}
}

function openResizablePopUp(url,width,height){
		
		var ht = screen.height;
		var wdth = screen.width;
		//var newWidth = 550;
		//var newHeight = 600;
		var newWidth = width;
		var newHeight = height;
		var lft = (wdth / 2) - (newWidth / 2);
		var tp = (ht / 2) - (newHeight / 2);
		var w = window.open (url, 'win', "location=no,screen x=200,screen y=200,toolbar=no,directories=no,status=no, menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,left="+ lft + ",top="+ tp +",width="+ newWidth  +",height="+ newHeight);
}//Opens

function expandContent(param, stat) {

	param.style.display=(param.style.display=="none")?"":"none";
	
	if (stat != null) {
		switch (document.getElementById(stat).innerHTML) {
			case "[Show company pages]": document.getElementById(stat).firstChild.data = "[Hide company pages]"; break;
			case "[Hide company pages]": document.getElementById(stat).firstChild.data = "[Show company pages]"; break;
		}
	}
}
// CC2976 AP stop link blinking on mouseover --------------------------
var isblink = 1;
function blinkItem(name) {
	try {
		
		if (isblink==1) {
			obj = document.getElementById(name);
			
			if (!obj.style.visibility) obj.style.visibility = "visible";
			
			if(obj.style.visibility=="visible")
			{
				obj.style.visibility="hidden";
			}
			else
			{
				obj.style.visibility="visible";
			}
			
			window.setTimeout("blinkItem('"+name+"')",500);
		}
		
		obj.onmouseover = function(){
			isblink = 0;
		} 
		
		obj.onmouseout  = function(){
			isblink = 1;
			blinkItem(name);
		}
		
	} catch (err) {}
}
// CC2976 --------------------------