// JavaScript Document
function chkSigninForm()
{
	 var error="";
	
	/*if (!document.form2.terms.checked)
	{
		alert('Accept terms and condition to contine!');
		//document.form2.txtEmail.focus();
		return false;
	}*/
	if (document.form2.txtEmail.value=="")
	{	
	   	error="\n Enter Email";
		alert(error);
		
	}

	if (document.form2.txtCity.value=='')
	{	
	   	error=error + "\nEnter City";
		//alert(error);
	}

	if (document.form2.txtConfirmEmail.value=='')
	{
	   	error=error + "\nEnter ConfirmEmail";
		//alert(error);
	}
	
	if (document.form2.txtEmail.value!=document.form2.txtConfirmEmail.value)
	{
		error=error + "\nEmail and confirm email mismatch";
		//alert(error);
	}

	if (document.form2.txtpws1.value=='')
	{
		error=error + "\nEnter Password";
		//alert(error);
	}

	if (document.form2.txtcpws1.value=='')
	{
		 	error=error + "\nEnter Comfirm password!";
			//alert(error);		
	}
	if (document.form2.txtpws1.value!=document.form2.txtcpws1.value)
	{
		 error=error + "\nPassword mis match!";
		 //alert(error);
	
	}

	if (document.form2.txtFName.value=='')
	{
		error=error + "\nEnter first name!";
		//alert(error);
	/*	alert('Enter first name!');
		document.form2.txtFName.focus();
		return false;*/
	}

	if (document.form2.txtLName.value=='')
	{
		 error=error + "\nEnter Last name!";
		/*alert('Enter last name!');
		document.form2.txtLName.value="";
		document.form2.txtLName.focus();
		return false;*/
		//alert(error);
	}

	if (document.form2.cmbReligion.value==0)
	{
		error=error + "\nSelect Religion!";
		/*alert('Select Religion');
		document.form2.cmbReligion.focus();
		return false;*/
		//alert(error);
	}
	
	if(error !="")
	{
	alert(error);
	return false;
	}else 
	{return true;}
}

function checkMail(field)
{		
	var x = field.value;
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;

	if (!filter.test(x))
		alert('Incorrect email address! ');	
}

/****************************  Mubashar *******************************/
var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) 
		popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}


function hideDiv(pass) 
{
	var divs = document.getElementsbyTagName('pass');
	//for(i=0;i<divs.length;i++)
	{
		if(divs[i].id.match(pass))
		{//if they are 'see' divs
			if (document.getElementbyId) // DOM3 = IE5, NS6
				divs[i].style.visibility="hidden";// show/hide
			else
				if (document.layers) // Netscape 4
					document.layers[divs[i]].display = 'hidden';
				else // IE 4
					document.all.hideshow.divs[i].visibility = 'hidden';
		}
	}
}

function showDiv(pass) 
{
	var divs = document.getElementsbyTagName('pass');
	//for(i=0;i<divs.length;i++)
	{
		if(divs[i].id.match(pass))
		{
			if (document.getElementbyId)
				divs[i].style.visibility="visible";
			else
				if (document.layers) // Netscape 4
					document.layers[divs[i]].display = 'visible';
				else // IE 4
					document.all.hideshow.divs[i].visibility = 'visible';
		}
	}
}

