// JavaScript Document
maxTabs 		= 2;
tabPrefix 		= "tableTab";

function showHideTabs(tableToshow){
	for(var iterator = 1; iterator<=maxTabs ; iterator++){
		document.getElementById(tabPrefix+iterator).style.display = "none";
	}
	document.getElementById(tabPrefix+tableToshow).style.display = "block";
}
function valid(){
	//name
	var name=document.form.name.value;
	if(name==""){	
		alert("Please enter your name");
		document.form.name.focus();
		return false;
	}
	//designation
	var name=document.form.designation.value;
	if(name==""){	
		alert("Please enter your designation");
		document.form.designation.focus();
		return false;
	}
	//organisation
	var name=document.form.organisation.value;
	if(name==""){	
		alert("Please enter your organisation");
		document.form.organisation.focus();
		return false;
	}
	//city	
	var name=document.form.city.value;
	if(name==""){	
		alert("Please enter your city");
		document.form.city.focus();
		return false;
	}

	//email
	if(document.form.email.value==""){
		alert("Please Enter Your Email..!!");
		document.form.email.focus();
		return false;
	}
 
	validChars = "1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM.-_";
	emailvalid = true;
	foundat = false;
	for(i=0; i < document.form.email.value.length ;i++){
		if(validChars.indexOf(document.form.email.value.charAt(i))<0){ 
			if ((document.form.email.value.charAt(i) == "@") && (!foundat)) {
				foundat = true;
			} else {
				emailvalid = false;
			}
		}
	}
 
	if (!foundat) {
		emailvalid = false;
	}
	if (document.form.email.length < 5){
		emailvalid = false;
	}
	if (document.form.email.value.charAt(0) =="@") {
		emailvalid = false;
	}
	if (document.form.email.value.charAt(document.form.email.value.length - 1) =="@") {
		emailvalid = false;
	}
	if (!emailvalid) {
		alert("Your email address does not appear valid");
		document.form.email.focus();
		return false;
	}
}
function valid1(){
	//email
	//alert('here');
	
	if(document.form.email1.value==""){
		alert("Please Enter Your Email..!!");
		document.form.email1.focus();
		return false;
	}
	
	validChars = "1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM.-_";
	emailvalid = true;
	foundat = false;
	for(i=0; i < document.form.email1.value.length ;i++){
		if(validChars.indexOf(document.form.email1.value.charAt(i))<0){ 
			if ((document.form.email1.value.charAt(i) == "@") && (!foundat)) {
				foundat = true;
			} else {
				emailvalid = false;
			}
		}
	}
	
	if (!foundat) {
		emailvalid = false;
	}
	if (document.form.email1.length < 5){
		emailvalid = false;
	}
	if (document.form.email1.value.charAt(0) =="@") {
		emailvalid = false;
	}
	if (document.form.email1.value.charAt(document.form.email1.value.length - 1) =="@") {
		emailvalid = false;
	}
	if (!emailvalid) {
		alert("Your email address does not appear valid");
		document.form.email1.focus();
		return false;
	}
	
}


