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_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_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];}}
}

//Rotating Testimonials
var pausecontent=new Array()
pausecontent[0]='"Barbachano International has savvy HR recruitment professionals with great coaching skills, responsive, responsible, and great knowledge of the marketplace. During the recruitment process, they supported closely both the company and myself, acting as a real partner. They are the best Recruitment professionals I have been in touch with."<br><br><b><font color=steelblue>Regional HR Manager - LatAm<br>Epson</font></b><p>'
pausecontent[1]='"We have has benefited from the services of Barbachano International in focused searches for high level leadership. They have consistently been highly professional, extremely thorough and very responsive."<br><br><b><font color=steelblue>Corp. HR Director<br>Suntron</font></b><p>'
pausecontent[2]='"BIP has been key in helping us assemble an extraordinary management team that has transformed our company into a recognized world class organization."<p><b><font color=steelblue>Pres. Mexico Operations<br>Plantronics, Inc.</font></b><p>'
pausecontent[3]='"Since 1995, I have depended on the high quality services Barbachano offers to enhance our organization. There is great value in their recruitment solutions, HR advice, and outplacement services."<p><b><font color=steelblue>General Manager<br>Emerson Network Power</font></b><p>'
pausecontent[4]='"I have found Barbachano International to be one of the most thorough recruitment and screening agencies, one which is extremely well connected in Mexico and the maquiladora arena."<p><b><font color=steelblue>V.P. - Operations<br>ACCO Brands, Inc.</font></b><p>'
pausecontent[5]='"Our experience utilizing Barbachano Int`l has been extremely positive. We recently acquired a business in Mexico and used Barbachano to search for two executive positions. Barbachano provided excellent candidates."<p><b><font color=steelblue>CFO<br>Oberg Industries</font></b><p>'
pausecontent[6]='"Best Service I have received! Barbachano International is extremely professional."<p><b><font color=steelblue>Corp. HR Manager<br>Plexus Corp</font></b><p>'
pausecontent[7]='"Since 2002, we have been working with Barbachano International with great success.  They have identified the market`s top talent for us and helped us build a high performing management group. Their recruiting team is one of the most professional and effective in Mexico I have had the pleasure to work with."<p><b><font color=steelblue>VP of Mexico Operations<br>Newell Rubbermaid</font></b><p>'
pausecontent[8]='"I would like to thank Barbachano and the recruiting team for their excellent work in completing the search for the Operations Manager. We are amazed at the quality contributions by the candidate in such a short time frame. The candidate has integrated well with our team and he is very professional, committed and possess a great team attitude. Thank you again!"<br><br><b><font color=steelblue>Dir. of Operations Mexico<br>Medical Products Company</font></b><p>'
pausecontent[9]='"The recruiting team at Barbachano was extremely knowledgeable, and effective. The quality of candidates presented for the controller assignment were better than expected and we could`ve made the offer to several of them. We will certainly rely on your expertise as we continue to grow our Mexico operations and into South America"<br><br><b><font color=steelblue>Director of Operations<br>Major Aerospace Supplier</font></b><p>'


//Rotating Placements
var pauseplacements=new Array()
pauseplacements[0]='Country Manager<br><b><font color=steelblue>Mexico City</font></b><br>Materials Manager<br><b><font color=steelblue>Cd. Juarez, Mexico</font></b><br>VP of Manufacturing<br><b><font color=steelblue>Guadalajara, Mexico</font></b>'
pauseplacements[1]='Account Manager<br><b><font color=steelblue>Buenos Aires, Argentina</font></b><br>Sales Manager<br><b><font color=steelblue>Lima, Peru</font></b><br>Controller<br><b><font color=steelblue>Monterrey, Mexico</font></b>'
pauseplacements[2]='General Manager<br><b><font color=steelblue>Reynosa, Mexico</font></b><br>ERP Project Manager<br><b><font color=steelblue>Mexico City</font></b><br>Quality Director<br><b><font color=steelblue>Queretaro, Mexico</font></b>'
pauseplacements[3]='Sales Director<br><b><font color=steelblue>Miami, Florida</font></b><br>Finance Director<br><b><font color=steelblue>Sao Paulo, Brazil</font></b><br>Quality Engineer - Microbiology<br><b><font color=steelblue>Ciudad Juarez, Mexico</font></b>'
pauseplacements[4]='Human Resource Generalist<br><b><font color=steelblue>San Diego, CA</font></b><br>General Manager - Mfg<br><b><font color=steelblue>Juarez, Mexico</font></b><br>Doc. Control Qty Mgr - Medical<br><b><font color=steelblue>Nogales, Mexico</font></b>'
pauseplacements[5]='District Sales Manager - Hardware<br><b><font color=steelblue>Mexico City</font></b><br>Sr. Program Manager<br><b><font color=steelblue>Tijuana, Mexico</font></b><br>Regional IT Director - Latin America<br><b><font color=steelblue>Mexico City</font></b>'
pauseplacements[6]='Project Engineering Manager<br><b><font color=steelblue>Mexicali, Mexico</font></b><br>Quality Manager - Medical Devices<br><b><font color=steelblue>Nogales, Mexico</font></b><br>Controller<br><b><font color=steelblue>Monterrey, Mexico</font></b>'
pauseplacements[7]='Senior Automation Engineer<br><b><font color=steelblue>Tijuana, Mexico</font></b><br>Human Resources Manager<br><b><font color=steelblue>Aguascalientes, Mexico</font></b><br>Maintenance Manager<br><b><font color=steelblue>Guadalajara, Mexico</font></b>'
pauseplacements[8]='Senior Process RF Engineer<br><b><font color=steelblue>Mexicali, Mexico</font></b><br>Production Manager<br><b><font color=steelblue>Chihuahua, Mexico</font></b><br>Operations Manager<br><b><font color=steelblue>Reynosa, Mexico</font></b>'
pauseplacements[9]='Purchasing Manager<br><b><font color=steelblue>Nogales, Mexico</font></b><br>Director of Manufacturing<br><b><font color=steelblue>Tijuana, Mexico</font></b><br>Director of Finance<br><b><font color=steelblue>Los Angeles, CA</font></b>'
pauseplacements[10]='Bus. Development Mgr. - Americas<br><b><font color=steelblue>Mexico</font></b><br>Director of Operations<br><b><font color=steelblue>Monterrey, Mexico</font></b><br>Supply Chain Director<br><b><font color=steelblue>El Paso / Juarez, Mexico</font></b>'

pauseplacements[11]='Regional HR Dir - CPG<br><b><font color=steelblue>Mexico City, Mexico</font></b><br>Business Dev Director<br><b><font color=steelblue>Mexico / LatAm</font></b><br>Sales Rep - Oil & Gas<br><b><font color=steelblue>Villahermosa, Mexico</font></b>'

pauseplacements[12]='Sales Manager - Oil & Gas<br><b><font color=steelblue>Brazil</font></b><br>Dir of Finance - CPG<br><b><font color=steelblue>Queretaro, Mexico</font></b><br>Senior Buyer - Plastics<br><b><font color=steelblue>Nogales, Mexico</font></b>'

pauseplacements[13]='Quality Manager<br><b><font color=steelblue>Honduras</font></b><br>Sales Dir - Produce<br><b><font color=steelblue>Los Angeles, CA</font></b><br>Microbiology Supervisor<br><b><font color=steelblue>Mexico</font></b>'

pauseplacements[14]='HR Manager<br><b><font color=steelblue>Aguascalientes, Mexico</font></b><br>Sr Program Mgr - Med Devices<br><b><font color=steelblue>Tijuana, Mexico</font></b><br>Supply Chain Manager<br><b><font color=steelblue>Guadalajara, Mexico</font></b>'

pauseplacements[15]='Business Dev Director<br><b><font color=steelblue>Monterrey, Mexico</font></b>'

/***********************************************
* Pausing up-down scroller- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

function pausescroller(content, divId, divClass, delay){
this.content=content //message array content
this.tickerid=divId //ID of ticker div to display information
this.delay=delay //Delay between msg change, in miliseconds.
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over scroller (and pause it if it is)
this.hiddendivpointer=1 //index of message array for hidden div
document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1">'+content[0]+'</div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="'+divId+'2">'+content[1]+'</div></div>')
var scrollerinstance=this
if (window.addEventListener) //run onload in DOM2 browsers
window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
else if (window.attachEvent) //run onload in IE5.5+
window.attachEvent("onload", function(){scrollerinstance.initialize()})
else if (document.getElementById) //if legacy DOM browsers, just start scroller after 0.5 sec
setTimeout(function(){scrollerinstance.initialize()}, 500)
}

// -------------------------------------------------------------------
// initialize()- Initialize scroller method.
// -Get div objects, set initial positions, start up down animation
// -------------------------------------------------------------------

pausescroller.prototype.initialize=function(){
this.tickerdiv=document.getElementById(this.tickerid)
this.visiblediv=document.getElementById(this.tickerid+"1")
this.hiddendiv=document.getElementById(this.tickerid+"2")
this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv))
//set width of inner DIVs to outer DIV's width minus padding (padding assumed to be top padding x 2)
this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
this.getinline(this.visiblediv, this.hiddendiv)
this.hiddendiv.style.visibility="visible"
var scrollerinstance=this
document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}
if (window.attachEvent) //Clean up loose references in IE
window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
setTimeout(function(){scrollerinstance.animateup()}, this.delay)
}


// -------------------------------------------------------------------
// animateup()- Move the two inner divs of the scroller up and in sync
// -------------------------------------------------------------------

pausescroller.prototype.animateup=function(){
var scrollerinstance=this
if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px"
this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px"
setTimeout(function(){scrollerinstance.animateup()}, 80)
}
else{
this.getinline(this.hiddendiv, this.visiblediv)
this.swapdivs()
setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
}
}

// -------------------------------------------------------------------
// swapdivs()- Swap between which is the visible and which is the hidden div
// -------------------------------------------------------------------

pausescroller.prototype.swapdivs=function(){
var tempcontainer=this.visiblediv
this.visiblediv=this.hiddendiv
this.hiddendiv=tempcontainer
}

pausescroller.prototype.getinline=function(div1, div2){
div1.style.top=this.visibledivtop+"px"
div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px"
}

// -------------------------------------------------------------------
// setmessage()- Populate the hidden div with the next message before it's visible
// -------------------------------------------------------------------

pausescroller.prototype.setmessage=function(){
var scrollerinstance=this
if (this.mouseoverBol==1) //if mouse is currently over scoller, do nothing (pause it)
setTimeout(function(){scrollerinstance.setmessage()}, 100)
else{
var i=this.hiddendivpointer
var ceiling=this.content.length
this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]
this.animateup()
}
}

pausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
if (tickerobj.currentStyle)
return tickerobj.currentStyle["paddingTop"]
else if (window.getComputedStyle) //if DOM2
return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
else
return 0
}

/*** Candidate Registration validation ***/
function echeck(str) 
{
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid e-mail address")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid e-mail address")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid e-mail address")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid e-mail address")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid e-mail address")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid e-mail address")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid e-mail address")
		    return false
		 }

 		 return true					
	}
	
 function ValidateForm()
 {
	var emailID=document.mailform["fields_email"].value
	
	if (document.mailform["fields_fn"].value == "") {
    document.mailform["fields_fn"].focus();
    alert("Please enter your first name");
    return false;
  }
  if (document.mailform["fields_ln"].value == "") {
    document.mailform["fields_ln"].focus();
    alert("Please enter your last name");
    return false;
  }
	
	if ((document.mailform["fields_email"].value==null)||(document.mailform["fields_email"].value=="")){
		alert("Please enter your email address")
		document.mailform["fields_email"].focus()
		return false
	}
	if (echeck(document.mailform["fields_email"].value)==false){
		document.mailform["fields_email"].value=""
		document.mailform["fields_email"].focus()
		return false
	}
	if (document.mailform["fields_subj"].value == "") {
    document.mailform["fields_subj"].focus();
    alert("Please enter a subject");
    return false;
  }
	if (document.mailform["EmailText"].value == "") {
    document.mailform["EmailText"].focus();
    alert("Please tell us how we can assist you");
    return false;
  }
    if (document.mailform["blob"].value == "") {
    document.mailform["blob"].focus();
    alert("Please attach your resume in word format");
    return false;
  }
	return true
 }
 
function verifyRequired() {
    
  if (document.mailform["fields_fn"].value == "") {
    document.mailform["fields_fn"].focus();
    alert("Please enter your first name");
    return false;
  }
  if (document.mailform["fields_ln"].value == "") {
    document.mailform["fields_ln"].focus();
    alert("Please enter your last name");
    return false;
  }

  if (document.mailform["fields_email"].value == "") {
    document.mailform["fields_email"].focus();
    alert("Please enter your email");
    return false;
  }

  if (document.mailform["EmailText"].value == "") {
    document.mailform["EmailText"].focus();
    alert("Briefly tell us how we can assist you");
    return false;
  }
    if (document.mailform["blob"].value == "") {
    document.mailform["blob"].focus();
    alert("Please attach your resume");
    return false;
  }
    
return true;
}

function ValidateForm()
 {
	var emailID=document.mailform["fields_email"].value
	
	if (document.mailform["fields_fn"].value == "") {
    document.mailform["fields_fn"].focus();
    alert("Please enter your first name");
    return false;
  }
  if (document.mailform["fields_ln"].value == "") {
    document.mailform["fields_ln"].focus();
    alert("Please enter your last name");
    return false;
  }
	
	if ((document.mailform["fields_email"].value==null)||(document.mailform["fields_email"].value=="")){
		alert("Please enter your email address")
		document.mailform["fields_email"].focus()
		return false
	}
	if (echeck(document.mailform["fields_email"].value)==false){
		document.mailform["fields_email"].value=""
		document.mailform["fields_email"].focus()
		return false
	}
	if (document.mailform["fields_subj"].value == "") {
    document.mailform["fields_subj"].focus();
    alert("Please enter a subject");
    return false;
  }
	if (document.mailform["EmailText"].value == "") {
    document.mailform["EmailText"].focus();
    alert("Please tell us how we can assist you");
    return false;
  }
    if (document.mailform["blob"].value == "") {
    document.mailform["blob"].focus();
    alert("Please attach your resume in word format");
    return false;
  }
	return true
 }
 
function verifyRequiredPassword() {
    
  if (document.myform["newpassword"].value == "") {
    document.myform["newpassword"].focus();
    alert("New password cannot be blank");
    return false;
  }
  if (document.myform["confirm"].value == "") {
    document.myform["confirm"].focus();
    alert("Confirm password cannot be blank");
    return false;
  }

return true;
}

function echeck(str) 
{
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid e-mail address")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid e-mail address")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid e-mail address")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid e-mail address")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid e-mail address")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid e-mail address")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid e-mail address")
		    return false
		 }

 		 return true					
	}

function ValidateRegistrationForm()
{
	var emailID=document.myform.email
	
	if (document.myform.fName.value == "") {
    document.myform.fName.focus();
    alert("First name cannot be blank");
    return false;
  	}
	
	if (document.myform.lName.value == "") {
    document.myform.lName.focus();
    alert("Last name cannot be blank");
    return false;
  	}
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please enter your email address")
		emailID.focus()
		return false
	}
	
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	
	if (document.myform.pPhone.value == "") {
    document.myform.pPhone.focus();
    alert("Home phone number cannot be blank");
    return false;
  	}
	
	return true;
		alert("hola");
 }
 
 function howMany(selObj) {   
	 var totalChecked = 0;   
	 for (i = 0; i < selObj.options.length; i++) {      
		if (selObj.options[i].selected) {         
		totalChecked++;      
			if (totalChecked > 5) {      
				alert("You can't check more than 5 options"); 
				selObj.options[i].selected=false;  
			}
		}   
	}   
}

function howMany10(selObj) {   
	 var totalChecked = 0;   
	 for (i = 0; i < selObj.options.length; i++) {      
		if (selObj.options[i].selected) {         
		totalChecked++;      
			if (totalChecked > 10) {      
				alert("You can't check more than 10 options"); 
				selObj.options[i].selected=false;  
			}
		}   
	}   
}


