<!--

//opens a new popup window containing the page from parameter "url":
var initialtab=[1, "sc1"];
var newWin;
function WinOpen(url,title,w,h){
	w=parseInt(w);
	h=parseInt(h);
	if (new String(newWin)!="undefined" && newWin!=null) if (!newWin.closed) newWin.close();
	newWin=window.open(url,title,"width="+w+",height="+h+",top=0,left=0,location=no,directories=no,hotkeys=no,copyhistory=no,resizable=yes,menubar=no,status=no,toolbar=no,scrollbars=yes,z-lock=yes");
	newWin.focus();
}
var newWin1;
function WinOpen1(url,title){
	if (new String(newWin)!="undefined" && newWin!=null) if (!newWin.closed) newWin.close();
	newWin1=window.open(url,title,"width=600,height=600,top=0,left=0,location=no,directories=no,hotkeys=no,copyhistory=no,resizable=yes,menubar=no,status=no,toolbar=no,scrollbars=yes,z-lock=yes");
	newWin1.focus();
}
//opens a new popup window containing the image from parameter:
function ImageViewer(picFileName, subDir){
	if (picFileName!=""){
		if (ns)	var viewWin = window.open("","imgWin","statusbar=0,resizable=no");
		else var viewWin = window.open("","imgWin","width=160,height=160,statusbar=no,resizable=no,scrollbars=no,top=50,left=50");
		viewWin.document.open();
		viewWin.document.write("<HTML><HEAD><TITLE>Vizualizare Imagine</TITLE><LINK rel='stylesheet' href='styles.css'></HEAD><BODY bgcolor=#ffffff marginwidth=0 marginheight=0 topmargin=0 leftmargin=0 onload='self.resizeTo((document.images[\"img1\"].width + 5),(document.images[\"img1\"].height+90))'>");
		viewWin.document.write("<CENTER><IMG name=img1 src='images/" + subDir + "/" + picFileName + "'><BR><BR><A href='javascript:self.close()' class='lnk'><B>Inchide</B></A></CENTER>");
		viewWin.document.write("</BODY></HTML>");
		viewWin.document.close();
		viewWin.focus();
	}
}
//opens a new popup window containing the image from parameter:
function ImageViewer1(picFileName){
	if (picFileName!=""){
		if (ns)	var viewWin = window.open("","imgWin","statusbar=0,resizable=no");
		else var viewWin = window.open("","imgWin","width=160,height=160,statusbar=no,resizable=no,scrollbars=no,top=50,left=50");
		viewWin.document.open();
		viewWin.document.write("<HTML><HEAD><TITLE>Vizualizare Imagine</TITLE><LINK rel='stylesheet' href='style.css'></HEAD><BODY bgcolor=#ffffff marginwidth=0 marginheight=0 topmargin=0 leftmargin=0 onload='self.resizeTo((document.images[\"img1\"].width + 5),(document.images[\"img1\"].height+100))'>");
		viewWin.document.write("<CENTER><A href='javascript:self.close()' class='lnk'><IMG name=img1 src='" + picFileName + "' border=0></a><BR><A href='javascript:self.close()' class='lnk'><B>Inchide</B></A></CENTER>");
		viewWin.document.write("</BODY></HTML>");
		viewWin.document.close();
		viewWin.focus();
	}
}

//used for paging:
function GoToPageNo(page){
	document.frmPaging.page.value=page;
	document.frmPaging.submit();
}

//used for paging:
function GoToRecNo(start){
	document.frmMain.start.value=start;
	document.frmMain.submit();
}

function AddToPortfolio(jobid,vac) {
	self.location.href=site_sslpath+"candidate_addport.asp?jobid="+jobid
}

function ApplyJob(jobid,vac) {
	self.location.href="candidates_apply.asp?jobid="+jobid
	//document.frmApply.submit();
}

function SubmitSearchJobs(){
	document.frmSearch.submit();
}

// Trims the leading and trailing blanks from a given string:
function Trim(strToTrim) {
	while(strToTrim.charAt(0)==' '){strToTrim = strToTrim.substring(1,strToTrim.length);}
	while(strToTrim.charAt(strToTrim.length-1)==' '){strToTrim = strToTrim.substring(0,strToTrim.length-1);}
	return strToTrim;
}

// Validate an e-mail address:
function ValidateEmail(str){
	if (str.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1) return true;
	else return false; 
}

// Validate date in "mm/dd/yyyy", "m/d/yyyy" format:
function ValidateUSDate(str){
	if (str.search(/((^(10|12|0?[13578])([/])(3[01]|[12][0-9]|0?[1-9])([/])((1[8-9]\d{2})|([2-9]\d{3}))$)|(^(11|0?[469])([/])(30|[12][0-9]|0?[1-9])([/])((1[8-9]\d{2})|([2-9]\d{3}))$)|(^(0?2)([/])(2[0-8]|1[0-9]|0?[1-9])([/])((1[8-9]\d{2})|([2-9]\d{3}))$)|(^(0?2)([/])(29)([/])([2468][048]00)$)|(^(0?2)([/])(29)([/])([3579][26]00)$)|(^(0?2)([/])(29)([/])([1][89][0][48])$)|(^(0?2)([/])(29)([/])([2-9][0-9][0][48])$)|(^(0?2)([/])(29)([/])([1][89][2468][048])$)|(^(0?2)([/])(29)([/])([2-9][0-9][2468][048])$)|(^(0?2)([/])(29)([/])([1][89][13579][26])$)|(^(0?2)([/])(29)([/])([2-9][0-9][13579][26])$))/) != -1) return true;
	else return false; 
}

// Allows only letters, numbers and underscore:
function ChkIllegalChars(str){
	var illegalChars = /\W/;
	if (illegalChars.test(str)) return false;
	else return true;
}
//validate email address
function emailAddressIsValid(str){
	var emailAddressFormat = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,3}$/;
	if (!(emailAddressFormat.test(str))){
		return false;
	}
	return true;
}
// TOP MENU
	
	//Set tab to intially be selected when page loads:
	//[which tab (1=first tab), ID of tab content to display (or "" if no corresponding tab content)]:
	
	//Turn menu into single level image tabs (completely hides 2nd level)?
	var turntosingle=0 //0 for no (default), 1 for yes
	
	//Disable hyperlinks in 1st level tab images?
	var disabletablinks=0 //0 for no (default), 1 for yes
	
	
	////////Stop editting////////////////
	
	var previoustab=""
	
	if (turntosingle==1)
	document.write('<style type="text/css">\n#tabcontentcontainer{display: none;}\n</style>')
	
	function expandcontent(cid, aobject){
	if (disabletablinks==1)
	aobject.onclick=new Function("return false")
	if (document.getElementById && turntosingle==0){
	highlighttab(aobject)
	if (previoustab!="")
	document.getElementById(previoustab).style.display="none"
	if (cid!=""){
	document.getElementById(cid).style.display="block"
	previoustab=cid
	}
	}
	}
	
	function highlighttab(aobject){
	if (typeof tabobjlinks=="undefined")
	collectddimagetabs()
	for (i=0; i<tabobjlinks.length; i++)
	tabobjlinks[i].className=""
	aobject.className="current"
	}
	
	function collectddimagetabs(){
	var tabobj=document.getElementById("ddimagetabs")
	tabobjlinks=tabobj.getElementsByTagName("A")
	}
	
	function do_onload(){
	collectddimagetabs()
	expandcontent(initialtab[1], tabobjlinks[initialtab[0]-1])
	}
	
	if (window.addEventListener)
	window.addEventListener("load", do_onload, false)
	else if (window.attachEvent)
	window.attachEvent("onload", do_onload)
	else if (document.getElementById)
	window.onload=do_onload
	
	// end TOP MENU
	
	

	 
		
	function goBack(){
	history.go(-1);
	}
	
//Set tab to intially be selected when page loads:
	//[which tab (1=first tab), ID of tab content to display (or "" if no corresponding tab content)]:
	var initialtab1=[12, "sctoate"]
	
	//Turn menu into single level image tabs (completely hides 2nd level)?
	var turntosingle1=0 //0 for no (default), 1 for yes
	
	//Disable hyperlinks in 1st level tab images?
	var disabletablinks1=0 //0 for no (default), 1 for yes
	
	
	////////Stop editting////////////////
	
	var previoustab1=""
	
	if (turntosingle1==1)
	document.write('<style type="text/css">\n#tabcontentcontainer1{display: none;float:left;}\n</style>')
	
	function expandcontent1(cid, aobject){
	if (disabletablinks1==1)
	aobject.onclick=new Function("return false")
	if (document.getElementById && turntosingle1==0){
	highlighttab1(aobject)
	if (previoustab1!="")
	document.getElementById(previoustab1).style.display="none"
	if (cid!=""){
	document.getElementById(cid).style.display="block"
	previoustab1=cid
	}
	}
	}
	
	function highlighttab1(aobject){
	if (typeof tabobjlinks=="undefined")
	collectddimagetabs1()
	for (i=0; i<tabobjlinks1.length; i++)
	tabobjlinks1[i].className=""
	aobject.className="current"
	}
	
	function collectddimagetabs1(){
	var tabobj=document.getElementById("ddimagetabs1")
	tabobjlinks1=tabobj.getElementsByTagName("A")
	}
	
	function do_onload(){
	collectddimagetabs1()
	expandcontent1(initialtab1[1], tabobjlinks1[initialtab1[0]-1])
	}
	
	if (window.addEventListener)
	window.addEventListener("load", do_onload, false)
	else if (window.attachEvent)
	window.attachEvent("onload", do_onload)
	else if (document.getElementById)
	window.onload=do_onload
	
	
//-->


