
function slideUpAllBut(objname){
	var the_div_list='company_info,maintenance_services,contract_management,hardware,data_center_reloc,disaster_recovery,sysadmin_services'
	var the_div_list_array=the_div_list.split(',');
	for (var i = 0; i < the_div_list_array.length; i++) { 
		if (the_div_list_array[i]!=objname&&the_div_list_array[i]!='<%=pagename%>'){
			//alert(the_div_list_array[i])
			
			slideup(the_div_list_array[i]);
		}
	}
}

function changelink_switch(){
            document.all._switch.style.color='#FF9933'; 
            document.all._switch.style.textDecoration='none';
            document.all._blue.style.color='#00479C'; 
            document.all._blue.style.textDecoration='none';
}

function changeback_switch(){
            document.all._switch.style.color=''; 
            document.all._switch.style.textDecoration='none';
            document.all._blue.style.color=''; 
            document.all._blue.style.textDecoration='none';
}

function changelink_blue(){
            document.all._blue.style.color='#00479C'; 
            document.all._blue.style.textDecoration='none';
            document.all._switch.style.color='#FF9933'; 
            document.all._switch.style.textDecoration='none';
}

function changeback_blue(){
            document.all._blue.style.color=''; 
            document.all._blue.style.textDecoration='none';
            document.all._switch.style.color=''; 
            document.all._switch.style.textDecoration='none';
}

function clearUsername(the_btn){
if (document.getElementById('username').value==' user ID'){
		document.getElementById('username').value = ''
	}
}
		
function clearPassword(the_btn){
document.getElementById('password_input').style.display = 'none'
document.getElementById('password').style.display = ''
document.getElementById('password').focus();
}


function clearUsername2(the_btn){
			if (document.getElementById('username2').value==' user ID'){
				document.getElementById('username2').value = ''
			
			}
}
		
function clearPassword2(the_btn){

document.getElementById('password_input2').style.display = 'none'
document.getElementById('password2').style.display = ''
document.getElementById('password2').focus();	
}



	function slideupRelocate(margin_num){
		if(document.getElementById('text_content').style.marginTop!='0px'){
		document.getElementById('text_content').style.marginTop=margin_num + 'px'
		if(margin_num!=0){
			margin_num = margin_num-2;
			setTimeout("slideupRelocate("+margin_num+")",1)
			
		}
		}
	
	}
	
	
	
	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. Format should be name@site.com")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail. Format should be name@site.com")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail. Format should be name@site.com")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail. Format should be name@site.com")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail. Format should be name@site.com")
		    return false
		 }
		
		 if (str.indexOf(dot)==(lstr-1)){
		    alert("Invalid E-mail. Format should be name@site.com")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail. Format should be name@site.com")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail. Format should be name@site.com")
		    return false
		 }

 		 return true		
		 
	}



			function checkvars(the_form){
				var emailID =the_form.email
			
				if (the_form.first_name.value == ""  ) {
					alert("You must enter a first name");
					return false;
				}	
				if (the_form.last_name.value == ""  ) {
					alert("You must enter a last name");
					return false;
				}	
				if (the_form.phone.value == ""  ) {
					alert("You must enter a phone number");
					return false;
				}	

				var numval = new String(document.getElementById('phone').value);
			 	var regex = new RegExp('^[0-9]{3}-[0-9]{3}-[0-9]{4}$','');
				stringmatch = regex.test(numval);
		
				if (stringmatch==false ) {
				alert("Phone number must be in the format xxx-xxx-xxxx");
				return false;
				}
				
				if (the_form.resume.value == ""  ) {
					alert("You must attach your resume");
					return false;
				}	
				if ((emailID.value==null)||(emailID.value=="")){
					alert("Please Enter your Email")
					emailID.focus()
					return false
				}
				if (echeck(emailID.value)==false){
						emailID.focus()
						return false
				}
				
					
			}
