// JavaScript Document

function SwapMyClass(myId)
{
//	if(myId=='recrID')
//	{
//		alert(myId);
//		document.getElementById(myId).className='recr_pageHover';
//	}
//	else
//	{	
		my_control = document.getElementById(myId);
		my_control.className='guest_pageHover';
		my_control.previousSibling.className = 'guest_l_hover';
		my_control.nextSibling.className = 'guest_r_hover';
		document.getElementById(myId).className='guest_pageHover';
//	}
}
function RestoreMyClass(myId)
{
//	if(myId=='recrID')
//	{
//		alert(myId);
//		document.getElementById(myId).className='recr_page';
//	}
//	else
//	{
		my_control = document.getElementById(myId);
		my_control.className='guest_page';
		my_control.previousSibling.className = 'guest_l';
		my_control.nextSibling.className = 'guest_r';
		document.getElementById(myId).className='guest_page';
//	}
}
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 LTrim(str){
        if (str==null){return null;}
        for(var i=0;str.charAt(i)==" ";i++);
        return str.substring(i,str.length);
}

function RTrim(str){
        if (str==null){return null;}
        for(var i=str.length-1;str.charAt(i)==" ";i--);
        return str.substring(0,i+1);
}

function Trim(str){return LTrim(RTrim(str));}

function Authorize(my_width, my_height){
        x = window.open("auth.php", "winz", "width=" + my_width + ",height=" + my_height + ",toolbar=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,top="+(screen.availHeight - my_height)/2+",left="+(screen.availWidth - my_width)/2);
        x.focus();
}

function validRecr(){
        if(Trim(document.frmRecr.fname.value).length<2){
                alert("Please enter your first name.");
                document.frmRecr.fname.focus();
                document.frmRecr.fname.select();
                return false;
        }
        if(Trim(document.frmRecr.lname.value).length<2){
                alert("Please enter your last name.");
                document.frmRecr.lname.focus();
                document.frmRecr.lname.select();
                return false;
        }
        if(Trim(document.frmRecr.address.value).length<2){
                alert("Please enter your address.");
                document.frmRecr.address.focus();
                document.frmRecr.address.select();
                return false;
        }
        if(Trim(document.frmRecr.city.value).length<2){
                alert("Please enter your city.");
                document.frmRecr.city.focus();
                document.frmRecr.city.select();
                return false;
        }
		/*
        if(Trim(document.frmRecr.zip.value).length<2){
                alert("Please enter your ZIP/Postal code.");
                document.frmRecr.zip.focus();
                document.frmRecr.zip.select();
                return false;
        }
		*/
        if(document.frmRecr.country.value=='none'){
                alert("Please choose your country.");
                document.frmRecr.country.focus();
                return false;
        }
        if(Trim(document.frmRecr.phone_h.value).length<5){
                alert("Please enter your home phone number.");
                document.frmRecr.phone_h.focus();
                document.frmRecr.phone_h.select();
                return false;
        }
		/*
        if(Trim(document.frmRecr.phone_c.value).length<5){
                alert("Please enter your cellular phone number.");
                document.frmRecr.phone_c.focus();
                document.frmRecr.phone_c.select();
                return false;
        }
		*/
    if(Trim(document.frmRecr.email.value).length < 8 || document.frmRecr.email.value.indexOf('@') < 2 || document.frmRecr.email.value.indexOf('@') == -1 || document.frmRecr.email.value.indexOf('.') == -1){
                alert("Please enter correct email address.");
                document.frmRecr.email.focus();
                document.frmRecr.email.select();
                return false;
        }
        if(document.frmRecr.lang1a.value=="none"){
                alert("Please enter at least your primary language pair.");
                document.frmRecr.lang1a.focus();
                return false;
        }
        if(document.frmRecr.lang1b.value=="none"){
                alert("Please enter at least your primary language pair.");
                document.frmRecr.lang1b.focus();
                return false;
        }
        if(Trim(document.frmRecr.pass.value).length < 6){
                alert("Please enter your password for future editing of your information (at least 6 characters).");
                document.frmRecr.pass.focus();
                document.frmRecr.pass.select();
                return false;
        }
        return true;
}

