<!--
///this function will be used to validate email id
function isValidEmail(str) {
   return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
}


function in_array( needle, haystack )
{
	for ( i=0; i < haystack.length; i++ )
		if ( haystack[i] == needle ) return true
	return false
}

function inputFocus( elmnt, msg )
{
	if ( elmnt.value == msg ) elmnt.value = ''
}

function inputBlur( elmnt, msg )
{
	if ( elmnt.value == '' ) elmnt.value = msg
}

function setDisplay( id , val )
{
	document.getElementById(id).style.display = val;
}



function profileFrmCheck() 
{
	var x = document.profileFrm;
	for (var i=0; i<x.length; i++)
	{
		if ( x[i].name != '' && x[i].name != 'website' )
		if ( x[i].value == '' ) {
			alert( 'All required fields must be filled' );
			x[i].focus();
			return false;		
		}
	}
	
	if ( !isValidEmail( x['email'].value ) )  {
		alert( 'Please check your email address' );
		x['email'].focus();
		return false;		
	}
	
	if ( x.email.value != x.emailConfirm.value ) 
	{
		alert( 'Please check your email address. Values are not equal' );
		x['email'].focus();
		return false;		
	}
	
	if ( x.password.value != x.passwordConfirm.value ) 
	{
		alert( 'Please check your password. Values are not equal' );
		x['password'].focus();
		return false;		
	}
	
	return true;
}

function editProfileFrmCheck() 
{
	var x = document.profileFrm;
	for (var i=0; i<x.length; i++)
	{
		if ( x[i].name != '' && x[i].name != 'fax' && x[i].name != 'website' )
		if ( x[i].value == '' ) {
			alert( 'All required fields must be filled' );
			x[i].focus();
			return false;		
		}
	}
	
	if ( !CheckEmail( x['email'] ) )  return false 
	
	return true;
}


function FrmCheck( ff ) 
{
	var x = document[ff];
	for (var i=0; i<x.length; i++)
	{
		if ( x[i].name != '' )
		if ( x[i].value == '' ) {
			alert( 'All required fields must be filled' );
			x[i].focus();
			return false;		
		}
	}	
	if ( !CheckEmail( x['email'] ) )  return false 
	
	return true;
}


//-->