/*// JavaScript Document
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 MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
<!--
/**********************************************************************************   
FoldoutMenu2 
*   Copyright (C) 2001 <a href="/dhtmlcentral/thomas_brattli.asp">Thomas Brattli</a>
*   This script was released at DHTMLCentral.com
*   Visit for more great scripts!
*   This may be used and changed freely as long as this msg is intact!
*   We will also appreciate any links you could give us.
*
*   Made by <a href="<b>/dhtmlcentral/thomas_brattli.asp</b>">Thomas Brattli</a> 
*********************************************************************************/
/*
function lib_bwcheck(){ //Browsercheck (needed)
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.opera5=this.agent.indexOf("Opera 5")>-1
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie7=(this.ver.indexOf("MSIE 7")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
	this.mac=this.agent.indexOf("Mac")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie7 || this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
	return this
}
var bw=new lib_bwcheck()




if(document.layers){ //NS4 resize fix...
	scrX= innerWidth; scrY= innerHeight;
	onresize= function(){if(scrX!= innerWidth || scrY!= innerHeight){history.go(0)} }
}

if(navigator.userAgent.indexOf('Opera')>-1 && document.getElementById){ //Opera 5 resize fix.
	scrX= innerWidth; scrY= innerHeight;
	document.onmousemove= function(){
		if(scrX<innerWidth-10 || scrY<innerHeight-10 || scrX>innerWidth+10 || scrY>innerHeight+10){
			scrX = innerWidth;
			scrY = innerHeight;
			foldInit();
		}
	};
}
/************************************************************************************
This is the new foldoutmenu, with more levels!
This is in some ways a rather advanced menu so please read every
note in this script and in the comments in the page to understand how
it works.

NOTE: if you change the position of divFoldCont from absolute to relative, 
you can put the menu in a table. HOWEVER it will no longer work in netscape 4.
If you wish to support netscape 4, you have to use absolute positioning.
************************************************************************************/

//Do you want images (if not set to 0 and remove the images from the body)?
/*
foldImg=0

//Here are the images for the top links.
foldinImg=new Image(); foldinImg.src="gcsportal/images/foldoutmenu2_arrow.gif"		//The image for the closed state.
foldoutImg=new Image(); foldoutImg.src="gcsportal/images/foldoutmenu2_arrow_open.gif"	//The image for the open state.
//Here are the images for the sub links.
foldsubinImg=new Image(); foldsubinImg.src="gcsportal/images/foldoutmenu2_arrow.gif"		//The image for the "in" state.
foldsuboutImg=new Image(); foldsuboutImg.src="gcsportal/images/foldoutmenu2_arrow_open.gif"	//The image for the "out" state.
//If you change the images above please remember to change the images in the actual page as well.

mainmenus=4 //How many main menus do you have?

//How many submenus do you have beneath each main level.
//The arrays below are as follows(HR/Benefits, Business Units, DOL, eforms, bear4you, aboutBS)
submenus=new Array(0,0,2,0)
//In this example I have 10 submenus in the first top menu,
//3, in the second, 2 submenus in the third top menu and 3 in the forth.
//It's really important that these numbers are correct.

//pxbetweenmain = 15 //How much space should there be between the main menus
pxbetweenmain = 10 //How much space should there be between the main menus
pxbetweensub = 8 //How much space should there be between the sub menus

mainstayfolded = false //Should the main menus stay folded?
substayfolded = false  //Should the sub menus stay folded?  Play with these 2 variables.


/************************************************************************************
Making cross-browser objects
************************************************************************************/
/*
function makeMenu(obj,nest){
	nest=(!nest) ? "":'document.'+nest+'.';
   	this.css= bw.dom? document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+"document.layers." +obj):0;
	this.elm= bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;
	this.ref= bw.dom || bw.ie4? document:bw.ns4?eval(nest+"document.layers." +obj+".document"):0;
	this.x= bw.ns4?this.css.left:bw.opera5?this.css.pixelLeft:this.elm.offsetLeft;
	this.y= bw.ns4?this.css.top:bw.opera5?this.css.pixelTop:this.elm.offsetTop;
	this.height= bw.ns4?this.ref.height:bw.opera5?this.css.pixelHeight:this.elm.offsetHeight;
	this.hideIt= b_hideIt;
	this.showIt= b_showIt;
	this.moveIt= b_moveIt;
	this.status= 0;
	return this;
}

// A unit of measure that will be added when setting the position of a layer.
var px = bw.ns4||window.opera?"":"px";

function b_showIt(){this.css.visibility="visible"; this.status=1}
function b_hideIt(){this.css.visibility="hidden"; this.status=0}
function b_moveIt(x,y){this.x=x; this.y=y; /*this.css.left=this.x+px; *//*this.css.top=this.y+px;}*/
/************************************************************************************
Initiating the page and making the menu
************************************************************************************//*
function foldInit(){
	//Fixing the browsercheck for opera... this can be removed if the browsercheck has been updated!!
	bw.opera5 = (navigator.userAgent.indexOf("Opera")>-1 && document.getElementById)?true:false
	if (bw.opera5) bw.ns6 = 0
	
	//Creating the foldoutmenu
	oFold = new Array();
	y = 0;
	for (var i=0; i<mainmenus; i++){
		oFold[i] = new makeMenu('divFold'+i,'divFoldCont');
		oFold[i].moveIt(0,y);
		oFold[i].size = oFold[i].height;
		y += oFold[i].height+pxbetweenmain;
		if (bw.ns4) oFold[i].css.clip.bottom = 500;
		oFold[i].sub = new Array();
		oFold[i].subs = top_subs;
		suby = oFold[i].height+pxbetweensub;
		for (var j=0; j<submenus[i]; j++){
			oFold[i].sub[j] = new makeMenu('divFoldSub'+i+'_'+j,'divFoldCont.document.divFold'+i);
			oFold[i].sub[j].sub = new makeMenu('divFoldSub'+i+'_'+j+'_0','divFoldCont.document.divFold'+i+'.document.divFoldSub'+i+'_'+j);
			oFold[i].sub[j].hideIt();
			oFold[i].sub[j].sub.hideIt();
			oFold[i].sub[j].moveIt(10,suby);
			suby += oFold[i].sub[j].height+pxbetweensub;
		}
	}
  	oFoldCont = new makeMenu('divFoldCont');
	if (bw.ns4) oFoldCont.css.clip.bottom = 800;
  	oFoldCont.showIt(); //Showing the menu when the menu have been "created"
}*/
/************************************************************************************
Object function to the top of the menus.
************************************************************************************/
/*
function top_subs(show, num){
	for (var j=0; j<this.sub.length; j++){
		if (show){
			this.sub[j].showIt()
			if (foldImg) this.ref["imgFold"+num].src = foldoutImg.src
			if (substayfolded){if(this.sub[j].sub.status) this.sub[j].sub.showIt()
			}else{
				if (foldImg) this.sub[j].ref["imgFold"+num+"Sub"+j].src = foldsubinImg.src
				this.sub[j].sub.hideIt()
			}
		}else{
			this.sub[j].hideIt()
			if (foldImg) this.ref["imgFold"+num].src = foldinImg.src
			if (!substayfolded) this.sub[j].sub.hideIt()
			else if (substayfolded) this.sub[j].sub.css.visibility="hidden"
		}
	}
}
/************************************************************************************
Checking height of the menus, and moves them to the correct position.
************************************************************************************/
/*function checkheight(org){
	if(mainstayfolded) istart=org; else istart=0
	for(i=istart;i<oFold.length;i++){
		oFold[i].size=oFold[i].height
		for(j=0;j<oFold[i].sub.length;j++){
			oFold[i].sub[j].size=oFold[i].sub[j].height+pxbetweensub
			if(oFold[i].sub[j].status){
				oFold[i].size+=oFold[i].sub[j].size
				if(oFold[i].sub[j].sub.status){
					oFold[i].size+=oFold[i].sub[j].sub.height+pxbetweensub
					oFold[i].sub[j].size+=oFold[i].sub[j].sub.height+pxbetweensub
				}
			}
			if(j!=0) oFold[i].sub[j].moveIt(10,oFold[i].sub[j-1].y+oFold[i].sub[j-1].size)
		}
		if(i!=0) oFold[i].moveIt(0,oFold[i-1].y+oFold[i-1].size+pxbetweenmain)
	}
}
/************************************************************************************
Fold in and out the submenus.
************************************************************************************/
/*function subfoldmenu(main,sub){
	if (!substayfolded){
		for (var i=0; i<oFold[main].sub.length; i++){
			if (i!=sub){
				oFold[main].sub[i].sub.hideIt();
				if (foldImg) oFold[main].sub[i].ref["imgFold"+main+"Sub"+i].src = foldsubinImg.src
			}
		}
	}
	if (!oFold[main].sub[sub].sub.status){
		oFold[main].sub[sub].sub.showIt()
		if(foldImg) oFold[main].sub[sub].ref["imgFold"+main+"Sub"+sub].src = foldsuboutImg.src
	}
	else{
		oFold[main].sub[sub].sub.hideIt()
		if(foldImg) oFold[main].sub[sub].ref["imgFold"+main+"Sub"+sub].src = foldsubinImg.src
	}
	checkheight(main)
}


*/
/************************************************************************************
Fold in and out the mainmenus
************************************************************************************/
function foldmenu(num){
	
	if (!mainstayfolded){
		for(var i=0; i<oFold.length; i++){
			if(i!=num) oFold[i].subs(0,i)
		}
	}
	if (!oFold[num].sub[0].status) {
		if(document.layers){
			document.height=800;
			document.width = 186;
		}
		oFold[num].subs(1,num)
	}else {
		oFold[num].subs(0,num)
		if (document.layers){
			document.height=window.innerHeight;
			document.width = window.innerWidth;
//			location.reload()
		}
	}
	checkheight(num)
//	alert("Status of scrollbars: " + window.scrollbars.visible);
}

//Initiating the menus onload, if the browser is ok.
//if(bw.bw) onload = foldInit;

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function formHandler(form) {
var windowprops = "height=600,width=800,location=yes,"
+ "scrollbars=yes,menubar=yes,toolbar=yes,resizable=yes,status=yes";

	if (form.site.selectedIndex == 0){
		return false;
	}else{
		var URL = form.site.options[form.site.selectedIndex].value;
		popup = window.open(URL,"MenuPopup",windowprops);
	}
}


function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

var firstErrorArray = new Array();

function resetErrorFields(arrayCheck) {
	// this will changes all fields if they were red back to white
	firstErrorArray = new Array();
	 for (i = 0; i < arrayCheck.length; i++) {
	 	divError(arrayCheck[i], 1);
 	}
}


function divError(divID, returnState) {
	// this function will change the field to a red color to show an error	
  if (document.getElementById(divID)) {
	if (returnState) {
		document.getElementById(divID).style.background = "#FFFFFF"
	} else {
		firstErrorArray.push(divID);
		document.getElementById(divID).style.background = "#FFCCFF"
	}
  }
}

function findPosY(obj) {
    var curtop = 0;
   if(!obj) {
	 return 0
   } else {
    if(obj.offsetParent)
        while(1)
        {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.y)
        curtop += obj.y;
	if (curtop) {
   	 return curtop-50;
	} else {
	 return curtop;
	} 	
  }
}

function validateTypes(formValue, vType, alertMessage) {
  var validReturn = 1;
  if (formValue) {
   if (formValue != "") {
	if (vType == "email") {
		var emailExp=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-zA-Z]{2,4}$");
		if(!emailExp.test(formValue)) {
	 		validReturn = 0;
		}
	} else if (vType == "number") {
		if(isNaN(formValue)){
			validReturn = 0;
		}
	} else if (vType == "zip") {
		// Check for correct zip code
		
		//sep = this.setArg( sep, "- " );
		//var regex = new RegExp( "^[0-9]{5}(|[" + sep.toPattern() + "][0-9]{4})?$" );

     	var reZip = new RegExp(/(^\d{5}$)|(^\d{5}-\d{4}$)/);
 		if(!reZip.test(formValue)) {
			validReturn = 0;
		}
	 } else if (vType == "phone") {
		var rePhone = new RegExp(/^\d{3}\-\d{3}\-\d{4}$/);
 		if(!rePhone.test(formValue)) {
			validReturn = 0;
		}		 
	 }
    }	
  }

  if (alertMessage) {
	  if (!validReturn) {
	  	alert(alertMessage);
	  }
  } else {
  	return validReturn;
  }
}

// upload file scripts
function checkUploadExist(arrayCheck) {
	// this will check if a file already exist
	var uploadArray = new Array();
	 for (i = 0; i < arrayCheck.length; i++) {
 		var name2Check = arrayCheck[i].value;
 		if (uploadArray[name2Check] == 1) {
			divError(arrayCheck[i].name);
			return true;
		} else if (name2Check != "" && name2Check != true) { 
			uploadArray[name2Check] = 1;
		}
 	}
 
 	return false;
}

function extractFile(filer, showAlert) {
	if (filer.indexOf("/") != -1) {
		// needed for file uploads from Macs
		filer = filer.replace(/\//g, "\\");
	}
	if (!filer) return true;
	while (filer.indexOf("\\") != -1) {
		filer = filer.slice(filer.indexOf("\\") + 1);
		if (filer.indexOf("\\") == -1) {
			break;
		}	
	}

	//if (filer.indexOf(" ") != -1) {		
		//if (showAlert) {
			//divError(showAlert.name)
			//alert('File name must not contain spaces.  Please remove spaces from original file name and re-attach file.');
		//}
		//return false
	//} else {
		if (showAlert) {
			divError(showAlert.name, 1)
		}
		return filer;
	//}
}

function removeAllTabs() {
	for (var j=0; j<=document.form.length; j++) {
	  if (document.form[j]) {	
		if (document.form[j].value) {
			textString = document.form[j].value;
			if (textString.indexOf("\t") != -1) {
				textString = textString.replace(/\t/g, "    ");
				document.form[j].value = textString
			}
		}	
	 }
  }
}


// * This fucntion parses comma-separated name=value argument pairs from
// * the query string of the URL.  It stores the name=value pairs in
// * properties of an object anc returns that object.
// * Add var args = getArgs() and access named parameters with args.x
//
function getArgs(parentTrue, charPasser) {
	var args = new Object();
	if (parentTrue==1) {
		var query = parent.location.search.substring(1);
	} else {
		var query = location.search.substring(1);		
	}
	var pairs = new Array();
	//alert("query: " + query);
	
	if (!charPasser) {
		if (query.indexOf("%26") != -1) pairs = query.split("%26");
		else if (query.indexOf("&") != -1) pairs = query.split("&");
		else pairs[0] = query;		
	} else {
		if (query.indexOf(charPasser) != -1) pairs = query.split(charPasser);
	}	
	
	for (var i = 0; i < pairs.length; i++) {
		var pos = pairs[i].indexOf('=');
		if (pos == -1) 	continue;
		var argname = pairs[i].substring(0,pos);
		var value = pairs[i].substring(pos+1);
		args[argname] = unescape(value);
		// in javascript 1.5 use decodeURIComponent() instead of escape()
	}
	return args;
}
function openWindow(theURL, winName, features, thePDF) {
	if (features == "") features = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=650,height=600';
	var newWin;
	
	theURL = unescape(theURL);
	thePDF = unescape(thePDF);
	if (thePDF != "") {		
		// extract current location
		var currentLoc = location.href;
		for (var x=currentLoc.length; x > 1; x--) {
			if (currentLoc.substring(x,(x-1)) == "/") {
				var currentLoc = currentLoc.substring(x,0);
				break;
			}
		}
		thePDF = '../../pdfviewer.htm?redir=' + currentLoc + thePDF;
		newWin = window.open(thePDF,winName,features);
	} else {
		newWin = window.open(theURL,winName,features);
	}	
	newWin.focus();
}


function getArgs(charPasser) {
	var args = new Object();
	var query = location.search.substring(1);
	var pairs = new Array();
	//alert("query: " + query);
	
	if (!charPasser) {
		if (query.indexOf("%26") != -1) pairs = query.split("%26");
		else if (query.indexOf("&") != -1) pairs = query.split("&");
		else pairs[0] = query;		
	} else {
		if (query.indexOf(charPasser) != -1) pairs = query.split(charPasser);
	}	
	
	for (var i = 0; i < pairs.length; i++) {
		var pos = pairs[i].indexOf('=');
		if (pos == -1) 	continue;
		var argname = pairs[i].substring(0,pos);
		var value = pairs[i].substring(pos+1);
		args[argname] = unescape(value);
		// in javascript 1.5 use decodeURIComponent() instead of escape()
	}
	return args;
}

// to use function:  MM_showHideLayers('Layer1','','hide') or MM_showHideLayers('Layer1','','show')
function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function HideShow(y,x){
t=document.getElementById(x).style
t.visibility=(y=='on')?'visible':'hidden'
}

function figurefielda() {

//if(($('#00N80000004Ek5o').val() == "Retired") || ($('#00N80000004Ek5o').val() == "Between_Jobs") || ($('#00N80000004Ek5o').val() == "Self_Employed") || ($('#00N80000004Ek5o').val() == ''))
//{
//document.form.EmployedCompany.value = "None"

//if($('#00N80000004Ek5o').val() == '') {
//document.form.EmployedCompany.value = "None"
//}
//else {
//document.form.00N80000004Ek5o.value = document.form.00N80000004Ek5o.value
//}


	  //HideShow('off','layertohideshow_b');
	  //HideShow('off','textlayertohideshow_b');

	  
	  //}
	  //else {
      //HideShow('on','layertohideshow_b');
	  //HideShow('on','textlayertohideshow_b');
	  //$('#00N80000004Ek5o').val('');
	  //}

}

function figurefieldb() {




if(document.form.elements['00N80000004EmZH'].selectedIndex == 0) {





	  HideShow('off','layertohideshow_c');
	  HideShow('off','textlayertohideshow_c');
	   
	  HideShow('off','textlayertohideshow_d');
	  document.form.elements['00N80000004EkMe'].value = "None"

	  
	  }
	  else {


if(document.form.elements['00N80000004EmZH'].selectedIndex != 3) {

	  document.form.elements['00N80000004EkMe'].value = ""
      HideShow('on','layertohideshow_c');
	  HideShow('on','textlayertohideshow_c');
	 
	  HideShow('off','textlayertohideshow_d'); }
	  else {
	  
	  document.form.elements['00N80000004EkMe'].value = ""
    
	  HideShow('on','textlayertohideshow_d');
	  HideShow('on','layertohideshow_c');
	  HideShow('off','textlayertohideshow_c');
	  
	  }
	  
	  }

}

// ****************************************
// Products of Expertise dynamic table code
// ****************************************
	
	var products = new Object;
	var employers = new Object;
	
	function sizeOf(obj){
		var size = 0, key;
		for (key in obj) {
			if (obj.hasOwnProperty(key)) size++;
		}
		return size;
	}
	
function addProduct(markInvalid){
		$("#product").css('background-color', 'white');
		$("#relationship").css('background-color', 'white');
		if(trim($("#product").val()) == ''){
			if(markInvalid){
			alert("Product name cannot be empty.");
			$("#product").focus().css('background-color', '#FFCCFF');
			}
			return false;
		} else if(($("#relationship").val() || []).length < 1){
			if(markInvalid){
			alert("Please select at least one relationship for the Product of Expertise specified.");
			$("#relationship").focus().css('background-color', '#FFCCFF');
			}
			return false;
		} else {
			productObj = {"product": $("#product").val(), "relationships": $("#relationship").val() || []};
			var template = $(".template.poe").clone();
			template.find(".productCell").html(productObj.product);
			template.find(".relationshipCell").html(productObj.relationships.join(', '));
			
			template.find(".removeProductButton").attr("id", "removepoerow-" + sizeOf(products));
			template.find(".removeProductButton").click(function(){
				var row = this.id.replace("removepoerow-", "");
				delete products['' + row];
				$('#poerow-' + row).remove();
				updateData();
			});
			
			template.removeClass("template");
			template.attr("id", "poerow-" + sizeOf(products));
			$('.template.poe').before(template);
			template.show();
			products[sizeOf(products)] = productObj;
			updateData();
			$('.poe .input').val("");
		}
		return true;
	}
	
	function addEmployer(markInvalid){
		$("#position").css('background-color', 'white');
		$("#companyemp").css('background-color', 'white');

		if(trim($("#position").val()) == ''){
			if(markInvalid){
			alert("Employment Position cannot be empty.");
			$("#position").focus().css('background-color', '#FFCCFF');
			}
			return false;
		} else if(trim($("#companyemp").val()) == ''){
			if(markInvalid){
			alert("Employment Company cannot be empty.");
			$("#companyemp").focus().css('background-color', '#FFCCFF');
			}
			return false;
		} else {
			employerObj = {
				"position": $("#position").val(), 
				"company": $("#companyemp").val(), 
				"iniDate": $("#iniDateMonth").val() + '/' +$("#iniDateYear").val(),
				"endDate": getEndDate()
			};
			
			if(employerObj.endDate == "Today" && presentJobInserted()){
				alert("Present Job already inserted");
				return false;
			}
			if(employerObj.endDate == "Today"){
				$('#company').val(employerObj.company);
			}
			var template = $(".template.emp").clone();
			template.find(".positionCell").html(employerObj.position);
			template.find(".companyCell").html(employerObj.company);
			template.find(".iniDateCell").html(employerObj.iniDate);
			template.find(".endDateCell").html(employerObj.endDate);
			
			template.find(".removeEmployerButton").attr("id", "removeemprow-" + sizeOf(employers));
			template.find(".removeEmployerButton").click(function(){
				var row = this.id.replace("removeemprow-", "");
				
				if(employers['' + row].endDate == "Today"){
					$('#company').val('');
				}
				delete employers['' + row];
				
				$('#emprow-' + row).remove();
				updateEmpData();
			});
			
			template.removeClass("template");
			template.attr("id", "emprow-" + sizeOf(employers));
			$('.template.emp').before(template);
			template.show();
			employers[sizeOf(employers)] = employerObj;
			updateEmpData();
			$('.emp .input').val("");
		}
		return true;
	}

	
	function presentJobInserted(){
		ret = false;
		for(i = 0; i < sizeOf(employers); i++){
			if(employers[i].endDate == "Today"){
				ret = true;
				break;
			}
		}
		return ret;
	}
	
	function getEndDate(){
		var dteNow = new Date();
		if($("#endDateMonth").val() > 0){
			return $("#endDateMonth").val() + '/' + $("#endDateYear").val();
		} else {
			return "Today";
		}
	}
	
	function updateData(){
		var values = new Array();
		for(var i in products){
			values[values.length] = products[i].product + ":" + products[i].relationships.join(',');
		}
		$("#00N80000004bRkJ").val(values.join(";"));
	}
	
	function updateEmpData(){
		var values = new Array();
		for(var i in employers){
			values[values.length] = employers[i].position + ":" + employers[i].company + ":" + employers[i].iniDate + ":" + (employers[i].endDate == "Today" ? employers[i].endDate : employers[i].endDate);
		}
		$("#00N80000004bKnF").val(values.join(";"));
	}
	
	function trim (myString) {
		return myString.replace(/^\s+/g,'').replace(/\s+$/g,'')
	}
