self.onerror=function () { return true; }


if(document.location.hostname=='directemployers.com'){
	document.location='http://www.directemployers.com';
}

function deselect(varSelect) {	
	for (var y=0;y<varSelect.options.length;y++){
		if (varSelect.options[y].value == '') {
			varSelect.options[y].selected = false;			
		}
	}
}
function unselect(varSelect) {
	for (var y=0;y<varSelect.options.length;y++){		
			varSelect.options[y].selected = false;		
	}
}
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) { //v3.0
  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); 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 submitform(straction)
{
	document.theform.submitaction.value=straction
	document.searchform.submit()
}

function changeloc(intCID)
{
	document.locations.continentid.value = intCID;
	// document.locations.save.value = "Save";
	document.locations.submit();
}

function testloclist()
{
	return confirm(document.resume.dbloclist.length);
}
function addLocation()
{
	var heading = '';
	var msg = '';
	var flag;
	var arrnew = new Array();

	with (document.resume){
		//Add it to userloclist
		msg = '';
		for(var x=0;x<dbloclist.length;x++){
			var opt = dbloclist.options[x];
			if (opt.selected){
				flag = 1;
				//if more then 25 then alert and exit.
				if (userloclist.length > 24){
					alert("You are only allowed 25 locations.");
					break;	
				}
				//check if option exists if not add it
				for (var y=0;y<userloclist.length;y++){
					var myopt = userloclist.options[y];
					if (myopt.value == opt.value){	
						flag = 0;
					}
				}
				if (flag){
					//This is not a duplicate so add it to the select box.
					userloclist.options[userloclist.options.length] = new Option(opt.text, opt.value, 0, 0);
				}
			}
		}
		//Fill hidden field with new values
		for (var y=0;y<userloclist.length;y++){
			arrnew[y] = userloclist.options[y].value
		}
		newUserLoc.value = arrnew.join();
	}
}

function removeLocation()
{
	var arrnew = new Array();

	with (document.resume){
		//Delete it from my locations
		for(var x=userloclist.length-1;x>=0;x--){
			var opt = userloclist.options[x];
			if (opt.selected){									
				//Remove it from the select box
				userloclist.options[x] = null;
			}
		}		

		//Fill hidden field with new values
		for (var y=0;y<userloclist.length;y++){
			arrnew[y] = userloclist.options[y].value
		}			
		newUserLoc.value = arrnew.join();
	}
}


function InitLoc(){
	var arrnew = new Array();
	with (document.locations){
		//Clear first line of mylocations (Netscape)
		if (mylocations.options[0].value == 0){
			mylocations.options[0] = null;	
		}
		
		//Fill hidden field with new values
		for (var y=0;y<mylocations.length;y++){
			arrnew[y] = mylocations.options[y].value
		}			
		newUserLoc.value = arrnew.join();

	}
	return 1;
}
var mywindow;
function gopage(pge,frm){
	var f=document.forms[frm];
	f.page.value=pge;
	f.submit();
	return false;
}
function orderpage(pge,frm){
	var f=document.forms[frm];
	f.cord.value=pge;
	//alert(pge);
	f.submit();
	return false;
}

function opentypewindow(url,type,hitkey,coname,rid){
	var winheight=screen.availHeight-150;
	var winwidth=screen.availWidth;
	var pag='/no';
	if(rid){
		pag='/job';
	}
	if(winwidth>800){
		winwidth=790;
	}else{
		winwidth=winwidth-20;
	}


	if (mywindow && !mywindow.closed) {
		mywindow.location.href = URL;
	} else {
  
		if(document.all){
			var mywindow = window.open(pag+'frame.asp?url=' + escape(url) + '&hk=' + escape(hitkey) + "&type=" + type + '&coname=' + escape(coname),"offsite","height="+winheight+",width="+winwidth+",scrollbars=yes,resizable=yes,menubar=yes,status=yes,toolbar=yes,location=yes,top=0,left=0");
		}else{
			var mywindow = window.open(pag+'frame.asp?url=' + escape(url) + '&hk=' + escape(hitkey) + "&type=" + type + '&coname=' + escape(coname),"offsite","height="+winheight+",width="+winwidth+",scrollbars=yes,resizable=yes,menubar=yes,status=yes,toolbar=yes,location=yes,screenX=0,screenY=0");
		}
	}
	
}
function openhelpwindow(doc,formnum,height){
	if(!formnum){
		formnum='-1';
	}
	if(!height){
		height=300;
	}
	if(document.all){
		var mywindow = window.open("/help/"+doc+"?fn="+formnum,"help","height="+height+",width=400,scrollbars=yes,resizable=no,menubar=no,status=no,toolbar=no,location=no,top=0,left=0");
	}else{
		var mywindow = window.open("/help/"+doc+"?fn="+formnum,"help","height="+height+",width=400,scrollbars=no,resizable=no,menubar=no,status=no,toolbar=no,location=no,screenX=0,screenY=0");
	}
	
}
function pickdirection(f,l,o,n,g,u,p,r){	
	var v=document.forms[f].view;
	if(v){		
		for(j=0;j<v.length;j++){
			if(v[j].checked==true){
				d=v[j].value;
			}
		}
	}
	if(d=='sites'){
		opentypewindow(unescape(u.replace(/&url=/,'')),2,'',unescape(n.replace(/&comp=/,'')),r);
	}else{		
		if(p.indexOf('steppages')==1){
			d='locs';
		}		
		if(d=='jobs'){			
			if((document.getElementById)&&(document.all)){
				document.location='/results.asp?'+l+o+n+g+'&url='+escape(u.replace(/&url=/,''));
			}else{
				document.location='/results.asp?'+l+o+n+g+u;
			}
		} else if (d=='dwjobs'){	
			if((document.getElementById)&&(document.all)){
				document.location='/dw/results.asp?'+l+o+n+g+'&url='+escape(u.replace(/&url=/,''));
			}else{
				document.location='/dw/results.asp?'+l+o+n+g+u;
			}
		}else{			
			document.location=p;
		}
	}	
}
function iscategory(frm,kwords){	
	var holdcat='';	
	kwords=' '+kwords.toLowerCase()+' ';
	kwords=kwords.replace(/[\(\)]/g,'');
	if((kwords.indexOf('recruit')>=0)&&(kwords.indexOf('not recruit')==-1)&&(kwords.indexOf('! recruit')==-1)) {
		holdcat='rec';	
	}
	if (((kwords.indexOf('workforce')>=0)&&(kwords.indexOf('not workforce')==-1)&&(kwords.indexOf('! workforce')==-1))||((kwords.indexOf('staffing')>=0)&&(kwords.indexOf('not staffing')==-1)&&(kwords.indexOf('! staffing')==-1))||((kwords.indexOf(' hr ')>=0)&&(kwords.indexOf('not hr ')==-1)&&(kwords.indexOf('! hr ')==-1))||((kwords.indexOf('human resource')>=0)&&(kwords.indexOf('not human resource')==-1)&&(kwords.indexOf('! human resource')==-1))||((kwords.indexOf('employ')>=0)&&(kwords.indexOf('not employ')==-1)&&(kwords.indexOf('! employ')==-1))||((kwords.indexOf('compen')>=0)&&(kwords.indexOf('not compen')==-1)&&(kwords.indexOf('! compen')==-1))||((kwords.indexOf('benefits')>=0)&&(kwords.indexOf('not benefits')==-1)&&(kwords.indexOf('! benefits')==-1))||((kwords.indexOf('organiza')>=0)&&(kwords.indexOf('not organiza')==-1)&&(kwords.indexOf('! organiza')==-1))) {
		holdcat='hr';
	}
	if((kwords.indexOf('director')>=0)&&(kwords.indexOf('not director')==-1)&&(kwords.indexOf('! director')==-1)) {
		if((kwords.indexOf(' art ')==-1)&&(kwords.indexOf(' film ')==-1)&&(kwords.indexOf(' macromedia ')==-1)&&(kwords.indexOf(' dialog ')==-1)&&(kwords.indexOf(' virtual ')==-1)&&(kwords.indexOf(' funeral ')==-1)&&(kwords.indexOf(' band ')==-1)&&(kwords.indexOf(' sports ')==-1)&&(kwords.indexOf(' portfolio ')==-1)&&(kwords.indexOf(' cruise ')==-1)&&(kwords.indexOf(' flight ')==-1)&&(kwords.indexOf(' movie ')==-1)&&(kwords.indexOf(' activit')==-1)){
			holdcat+='dir';	
		}
	}
	if ((((kwords.indexOf('vice')>=0)&&(kwords.indexOf('not vice')==-1)&&(kwords.indexOf('! vice')==-1))&&(kwords.indexOf('president')>=0))||((kwords.indexOf('v.p.')>=0)&&(kwords.indexOf('not v.p.')==-1)&&(kwords.indexOf('! v.p.')==-1))||((kwords.indexOf(' vp ')>=0)&&(kwords.indexOf('not vp')==-1)&&(kwords.indexOf('! vp')==-1))) {
		holdcat+='vp';
	}
	if (((kwords.indexOf(' ceo ')>=0)&&(kwords.indexOf('not ceo')==-1)&&(kwords.indexOf('! ceo')==-1))||((kwords.indexOf(' cfo ')>=0)&&(kwords.indexOf('not cfo')==-1)&&(kwords.indexOf('! cfo')==-1))||((kwords.indexOf(' cio ')>=0)&&(kwords.indexOf('not cio')==-1)&&(kwords.indexOf('! cio')==-1))||((kwords.indexOf(' coo ')>=0)&&(kwords.indexOf('not coo')==-1)&&(kwords.indexOf('! coo')==-1))||((kwords.indexOf(' cto ')>=0)&&(kwords.indexOf('not cto')==-1)&&(kwords.indexOf('! cto')==-1))||((kwords.indexOf('chairman')>=0)&&(kwords.indexOf('not chairman')==-1)&&(kwords.indexOf('! chairman')==-1))||((kwords.indexOf('chief')>=0)&&(kwords.indexOf('not chief')==-1)&&(kwords.indexOf('! chief')==-1))) {
		holdcat+='pres';
	}else{			
		if((kwords.indexOf('president')>=0)&&(kwords.indexOf('not president')==-1)&&(kwords.indexOf('! president')==-1)) {
			if((kwords.indexOf('vice president')==-1)||(kwords.indexOf('not vice')>=0)||(kwords.indexOf('! vice')>=0)) {
				holdcat+='pres';
			}else{
				if(kwords.indexOf('president')!=kwords.lastIndexOf('president')) {	
					holdcat+='pres';
				}	
			}
		}
	}
	frm.cat.value=holdcat;	
}

function newindustry(p,k,i,e,l,v){
	var ss='';
	ss=p+'?kw='+escape(k)+'&ind='+i+'&letter='+l;
	if(e){
		for(j=0;j<e.length;j++){
			if(e[j].checked==true){
				ss+='&i='+e[j].value;
			}
		}
	}
	if(v){		
		for(j=0;j<v.length;j++){
			if(v[j].checked==true){
				ss+='&view='+v[j].value;
			}
		}
	}
	//alert(ss);
	document.location=ss+'&m='+escape(Math.random());
}
	
