function closeWindow() {
	parent.window.opener.window.focus();
	parent.window.close();
}

function printWindow() {
	window.print();
}



function ChkUserRegn(){
	
	document.userreg.first_name.value = trimSpaces(document.userreg.first_name.value);
	if(document.userreg.first_name.value.length <= 0) {
		alert("Please enter your first name");
		document.userreg.first_name.focus();
		return false;
	}
	document.userreg.last_name.value = trimSpaces(document.userreg.last_name.value);
	if(document.userreg.last_name.value.length <= 0) {
		alert("Please enter your last name");
		document.userreg.last_name.focus();
		return false;
	}
	document.userreg.email.value = trimSpaces(document.userreg.email.value);
	if(!checkEmail(document.userreg.email.value)) {
		document.userreg.email.focus();
		return false;
	}
	
	document.userreg.city.value = trimSpaces(document.userreg.city.value);
	if(document.userreg.city.value.length <= 0) {
		alert("Please enter your city");
		document.userreg.city.focus();
		return false;
	}
	
	if(trimSpaces(document.userreg.birth_year.options[document.userreg.birth_year.selectedIndex].value).length <= 0) 
	{
		alert("Please select the birth year");
		document.userreg.birth_year.focus();
		return false;
	}
	
	if(trimSpaces(document.userreg.birth_mon.options[document.userreg.birth_mon.selectedIndex].value).length <= 0) 
	{
		alert("Please select the birth month");
		document.userreg.birth_mon.focus();
		return false;
	}	

	document.userreg.frmAction.value = "join";
	document.userreg.submit();
}
function checkContactus() {
	document.feedback.firstname.value = trimSpaces(document.feedback.firstname.value);
	if(document.feedback.firstname.value.length <= 0) {
		alert("Please enter your first name");
		document.feedback.firstname.focus();
		return false;
	}
	document.feedback.lastname.value = trimSpaces(document.feedback.lastname.value);
	if(document.feedback.lastname.value.length <= 0) {
		alert("Please enter your last name");
		document.feedback.lastname.focus();
		return false;
	}

	document.feedback.email.value = trimSpaces(document.feedback.email.value);
	if(document.feedback.email.value.length <= 0) {
		alert("Please enter your email address");
		document.feedback.email.focus();
		return false;
	}
	if(!checkEmail(document.feedback.email.value)) {
		document.feedback.email.focus();
		document.feedback.email.select();
		return false;
	}
	document.feedback.frmAction.value = "update";
}

function checkCommentForm() {
	document.forms[0].user_name.value = trimSpaces(document.forms[0].user_name.value);
	if(document.forms[0].user_name.value.length <= 0) {
		alert("Please enter your name");
		document.forms[0].user_name.focus();
		return false;
	}
	document.forms[0].politician_name.value = trimSpaces(document.forms[0].politician_name.value);
	if(document.forms[0].politician_name.value.length <= 0) {
		alert("Please enter your politician name");
		document.forms[0].politician_name.focus();
		return false;
	}
	document.forms[0].email.value = trimSpaces(document.forms[0].email.value);
	if(document.forms[0].email.value.length <= 0) {
		alert("Please enter your email address");
		document.forms[0].email.focus();
		return false;
	}
	if(!checkEmail(document.forms[0].email.value)) {
		document.forms[0].email.focus();
		document.forms[0].email.select();
		return false;
	}
	document.forms[0].comment.value = trimSpaces(document.forms[0].comment.value);
	if(document.forms[0].comment.value.length <= 0) {
		alert("Please enter your comments");
		document.forms[0].comment.focus();
		return false;
	}
	document.forms[0].frmAction.value = "update";
}
function ChkActivateEmail(f)
{
	if(trimSpaces(f.email.value).length <= 0) 
	{
		alert("Please enter your email");
		f.email.focus();
		return false;
	}
f.frmAction.value = "activate";	
}


function valAddProfile()
{
	pcat_id = trimSpaces(document.profForm.pcat_id.value);
	if(pcat_id.length <= 0) 
	{
		alert("Please select the category");
		document.profForm.pcat_id.focus();
		return false;
	}
	prof_name = trimSpaces(document.profForm.prof_name.value);
	if(prof_name.length <= 0) 
	{
		alert("Please enter the name");
		profForm.prof_name.focus();
		return false;
	}
	if(trimSpaces(document.profForm.email.value)){
		if(!checkEmail(document.profForm.email.value)) 
		{
			document.profForm.email.focus();
			return false;
		}
	}
	dob = trimSpaces(document.profForm.dob.value);
	if(dob.length <= 0) 
	{
		alert("Please enter the date of birth");
		profForm.dob.focus();
		return false;
	}

	contents = trimSpaces(getEditorValue('prof_desc'));
	
	if(contents.length <= 0) 
	{
			alert("please enter the description");
			return false;
	}
	
document.profForm.frmAction.value = "update";
}

function showProfilePhoto(id) {
	sWidth = screen.availWidth;
	sHeight = screen.availHeight;
	
	winWidth = 450;
	winHeight = 400;
	
	sLeft = (sWidth - winWidth) / 2;
	sTop = (sHeight - winHeight) / 2;
	
	window.open("showPhoto.php?id=" + id,"photoCategory","width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=1,resizable=0");
}


function deletePhoto(photoName)
{
	if(confirm('Do you really want to delete Photo ?')) 
	{
	document.profForm.photoName.value = photoName;
	document.profForm.frmAction.value ='delphoto';
	document.profForm.submit();
	}	
}

function delProfile(profile_id)
{
	if(confirm('Do you really want to delete this profile ?')) 
	{
	document.profForm.frmAction.value ='delProf';
	document.profForm.profile_id.value =profile_id;
	document.profForm.submit();
	}	
}
function chkEditAccount(f)
{
		f.firstname.value = trimSpaces(f.firstname.value);
		if(f.firstname.value.length <= 0) {
			alert("Please enter your first name");
			f.firstname.focus();
			return false;
		}
		
		f.lastname.value = trimSpaces(f.lastname.value);
		if(f.lastname.value.length <= 0) {
			alert("Please enter your last name");
			f.lastname.focus();
			return false;
		}
		document.account.frmAction.value = "update";
}
function checkPassword()
{
	document.changePassword.password.value = trimSpaces(document.changePassword.password.value);
	if(document.changePassword.password.value.length <= 0){
		alert("Please enter the current password");
		document.changePassword.password.focus();
		return false;
	}
	document.changePassword.newPassword.value = trimSpaces(document.changePassword.newPassword.value);
	if(document.changePassword.newPassword.value.length <= 0){
		alert("Please enter the new password");
		document.changePassword.newPassword.focus();
		return false;
	}
	document.changePassword.retypePassword.value = trimSpaces(document.changePassword.retypePassword.value);
	if(document.changePassword.newPassword.value != document.changePassword.retypePassword.value){
		alert("Passwords does not match");
		document.changePassword.retypePassword.focus();
		return false;
	}
}

function valAddPhotos()
{
	document.photoForm.frmAction.value = 'update';
}


function valDelGalPic()
{
		rowSelected = false;
		if(document.forms[0].elements["delid[]"].length > 0) {
			for(itemCount = 0; itemCount < document.forms[0].elements["delid[]"].length; itemCount++) {
				if(document.forms[0].elements["delid[]"][itemCount].checked) {
					rowSelected = true;
				}
			}
		}
		else {
			if(document.forms[0].elements["delid[]"].checked) {
				rowSelected = true;
			}
		}
		if(!rowSelected) {
			alert("No item selected for deletion");
			return false;
		}
		else {
			if(!confirm("Do you really want to delete these photo(s)?")) {
				return false;
			}
			document.forms[0].frmAction.value = 'delPic';
			document.forms[0].submit();
		}
	}
	
function valPeopleSearch()
{
	pcat_id = document.searchFrm.pcat_id.options[document.searchFrm.pcat_id.selectedIndex].value;
	if (pcat_id == "")
	{
		alert("Please select a category");
		document.searchFrm.pcat_id.focus();
		return false;
	}
	
	document.searchFrm.frmAction.value = "search"
}
function openNewWindow(pagepath) {
	sWidth = screen.availWidth;
	sHeight = screen.availHeight;
	
	winWidth = 500;
	winHeight = 400;
	
	sLeft = (sWidth - winWidth) / 2;
	sTop = (sHeight - winHeight) / 2;
	window.open(pagepath,"Details","width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=1,resizable=0");
}
function chkSendComments()
{
	name = trimSpaces(document.sendcomments.name.value);
	if(name.length <= 0) 
	{
		alert("Please enter the name");
		sendcomments.name.focus();
		return false;
	}
	if(trimSpaces(sendcomments.email.value).length <= 0) 
	{
		alert("Please enter your email");
		sendcomments.email.focus();
		return false;
	}
	if(!checkEmail(document.sendcomments.email.value)){
		document.sendcomments.email.focus();
		 return false;
	    }
	thecode = trimSpaces(document.sendcomments.thecode.value);
	if(thecode.length <= 0) 
	{
		alert("Please enter the number");
		sendcomments.thecode.focus();
		return false;
	}	
		
	document.sendcomments.frmAction.value = "update";	
}


function checkGuestBook() {
	document.gfrm.name.value = trimSpaces(document.gfrm.name.value);
	if(document.gfrm.name.value.length <= 0) {
		alert("Please enter your name");
		document.gfrm.name.focus();
		return false;
	}
	document.gfrm.email.value = trimSpaces(document.gfrm.email.value);
	if(document.gfrm.email.value.length <= 0) {
		alert("Please enter your email address");
		document.gfrm.email.focus();
		return false;
	}
	if(!checkEmail(document.gfrm.email.value)) {
		document.gfrm.email.focus();
		document.gfrm.email.select();
		return false;
	}
	document.gfrm.comments.value = trimSpaces(document.gfrm.comments.value);
	if(document.gfrm.comments.value.length <= 0) {
		alert("Please enter your comments");
		document.gfrm.comments.focus();
		return false;
	}
	thecode = trimSpaces(document.gfrm.thecode.value);
	if(thecode.length <= 0) 
	{
		alert("Please enter the number");
		gfrm.thecode.focus();
		return false;
	}	
	document.gfrm.frmAction.value = "update";
}


function checkGuestBookResponse() {
	document.gfrm.visitorName.value = trimSpaces(document.gfrm.visitorName.value);
	if(document.gfrm.visitorName.value.length <= 0) {
		alert("Please enter your name");
		document.gfrm.visitorName.focus();
		return false;
	}
	document.gfrm.emailAddress.value = trimSpaces(document.gfrm.emailAddress.value);
	if(document.gfrm.emailAddress.value.length <= 0) {
		alert("Please enter your email address");
		document.gfrm.emailAddress.focus();
		return false;
	}
	if(!checkEmail(document.gfrm.emailAddress.value)) {
		document.gfrm.emailAddress.focus();
		document.gfrm.emailAddress.select();
		return false;
	}
	document.gfrm.visitorComments.value = trimSpaces(document.gfrm.visitorComments.value);
	if(document.gfrm.visitorComments.value.length <= 0) {
		alert("Please enter your comments");
		document.gfrm.visitorComments.focus();
		return false;
	}
	document.gfrm.frmAction.value = "update";
}
function YpCheck(f)
{
		if(f.cat_id.options[f.cat_id.selectedIndex].value<=0){
			alert("Select category");
			f.cat_id.focus();
			return false;
		}
		if(trimSpaces(f.shop_name.value).length<=0){
			alert("Enter shop name");
			f.shop_name.focus();
			return false;
		}
			if(trimSpaces(f.address.value).length<=0){
			alert("Enter address");
			f.address.focus();
			return false;
		}
		if(trimSpaces(f.city.value).length<=0){
			alert("Enter city");
			f.city.focus();
			return false;
		}
		if(f.country.options[f.country.selectedIndex].value<=0){
			alert("Enter country");
			f.country.focus();
			return false;
		}
		if(trimSpaces(getEditorValue('description')) == "") {
			alert("Enter description");
			return false;
		}
		document.Ypcatfrm.frmAction.value = "update";
	}
	function showIcon(iconUrl) {
	sWidth = screen.availWidth;
	sHeight = screen.availHeight;
	
	winWidth = 300;
	winHeight = 300;
	
	sLeft = (sWidth - winWidth) / 2;
	sTop = (sHeight - winHeight) / 2;
	
	window.open("showIcon.php?iconUrl=" + iconUrl,"iconURL","width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=0,resizable=0");
}
function detePhoto(id)
{
	m='Do you really want to delete Photo ?'; 	
	if(!confirm(m)) 
	{
	}else {
	document.Ypcatfrm.id.value=id;	
	document.Ypcatfrm.frmAction.value='delphoto';
	document.Ypcatfrm.submit();
	}	
}
function chkUserLogin2()
{	
		if(document.memberlogin.email.value=="")
		{
		alert("Enter Email address");
		document.memberlogin.email.focus();
		return false;
		}
		if(!checkEmail(document.memberlogin.email.value)){
		document.memberlogin.email.focus();
		 return false;
	    }
	
		if(document.memberlogin.password.value=="")
		{
		alert("Enter password");
		document.memberlogin.password.focus();
		return false;
		
   		}
		
	document.memberlogin.frmAction.value = "login";
}
function deleteYpEntries(id)
{
	m='Do you really want to delete this record?'; 	
	if(!confirm(m)) 
	{
	}else {
	document.mYpent.id.value=id;	
	document.mYpent.frmAction.value='delYp';
	document.mYpent.submit();
	}	
}
function chkRecip()
{
   name=trimSpaces(document.addRecipe.contributor.value);
   email=trimSpaces(document.addRecipe.email.value);
   title=trimSpaces(document.addRecipe.title.value);
   if(name.length<=0)
    {
	 alert("Please enter the name");
	 document.addRecipe.contributor.focus();
	 return false;
	}
	if(email.length<=0)
    {
	 alert("Please enter the email"); 
	 document.addRecipe.email.focus();
	 return false;
	}
	if(title.length<=0)
    {
	 alert("Please enter the Recipe Title");
	 document.addRecipe.title.focus();
	 return false; 
	}
	if(document.addRecipe.category1.selectedIndex < 1)
	 {
	 alert("Please select the category");  
	 document.addRecipe.category1.focus();
	 return false;
	 }
document.addRecipe.frmAction.value="update";

}
function deteRecipesPhoto(id)
{
	m='Do you really want to delete Photo ?'; 	
	if(!confirm(m)) 
	{
	}else {
	document.addRecipe.id.value=id;	
	document.addRecipe.frmAction.value='delphoto';
	document.addRecipe.submit();
	}	
}
function showpicRecipe(id) 
{
	sWidth = screen.availWidth;
	sHeight = screen.availHeight;
	winWidth=500;
	winHeight=600;
	sLeft = (sWidth - winWidth) / 2;
	sTop = (sHeight - winHeight) / 2; 

	window.open("showRecipePhoto.php?id="+id, "Recipes", "width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=1,resizable=0");
	return;
} 
function rateIt(id) {
	sWidth = screen.availWidth;
	sHeight = screen.availHeight;
	winWidth=500;
	winHeight=500; 
	sLeft = (sWidth - winWidth) / 2;
	sTop = (sHeight - winHeight) / 2;

	window.open("../php/ratethisRecipe.php?id="+id, "recipes", "width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=1,resizable=0");
	return;
} 
function checkrecipeMail()
{ 
  uname=trimSpaces(document.emailRecipe.uname.value);
  umail=trimSpaces(document.emailRecipe.umail.value);
  rmail1=trimSpaces(document.emailRecipe.rmail1.value);
  rmail2=trimSpaces(document.emailRecipe.rmail2.value);
  rmail3=trimSpaces(document.emailRecipe.rmail3.value);
  rmail4=trimSpaces(document.emailRecipe.rmail4.value);
  comments=trimSpaces(document.emailRecipe.comments.value);
  if(uname.length<=0)
   {
    alert("Please enter your name");
	document.emailRecipe.uname.focus();
	return false;
   }
  if(umail.length<=0)
  {
     alert("Please enter your e-mail");
	  document.emailRecipe.umail.focus();
	return false;
  }
  else
  {
    if(!checkEmail(umail))
	  {
	   document.emailRecipe.umail.focus();
	   return false;
	  }
	 
  }
 if(rmail1.length>0 || rmail2.length>0 || rmail3.length>0 || rmail4.length>0) 
  {
  if(rmail1.length>0)
  {
    if(!checkEmail(rmail1))
	  {
	   document.emailRecipe.rmail1.focus();
	   return false;
	  }
  
  } 
  }
  else
  {
  alert("You have to enter atleast a recipient e-mail");
  return false;
  }
   if(comments.length<=0)
   {
    alert("Please enter your comments");
	document.emailRecipe.comments.focus();
	return false;
   }
  document.emailRecipe.frmAction.value="send";
  document.emailRecipe.submit(); 

}

// span_id - the id of the span to be shown
function showHideLayers(current,maxYpCatNo,span_id,cat_id,fromPg){
   maxYpCatNo = parseInt(maxYpCatNo);

// ** Start - Change the bg color of the link clicked   
 if (fromPg == 'home') 
 {
   red_bg = "url(images/bgg_red.gif)";
   yellow_bg = "url(images/bgg_yellow.gif)";
 }
 else
 {
   red_bg = "url(../images/bgg_red.gif)";
   yellow_bg = "url(../images/bgg_yellow.gif)";
 }
  for(var i = 1; i <= maxYpCatNo+2; i++){
      if(i == current){
         document.getElementById('td' + i).style.backgroundImage = red_bg;
      }
      else{
         document.getElementById('td' + i).style.backgroundImage = yellow_bg;
      }
   }
 // ** End
 
 // * Start - Change the search form   
 
  for(var j = 1; j <= 3; j++){
      if(j == span_id){
         document.getElementById('span' + j).style.display="block";
		 if (j == 3)
		 document.ypSrchFrm.ctid.value = cat_id;
      }
      else{
         document.getElementById('span' + j).style.display="none";
      }
	  
  }
 // * End 
 
}

function doSiteSearch(frm)
{
	if (trimSpaces(frm.txtKey.value) == '' )
	{
		alert("Please enter the search keyword");
		frm.txtKey.focus();
		return false;
	}
	frm.frmAction.value = "search";
}

function chkfashion(){
	
	if(document.frm.name.value=="")
	{
		alert("please enter name");
		document.frm.name.focus();
		return false;		
	}
	if(document.frm.address.value=="")
	{
		alert("please enter address");
		document.frm.address.focus();
		return false;		
	}
	if(document.frm.location.value=="Select Location")
	{
		alert("Please Select Location");
		document.frm.location.focus();
		return false;		
	}
	
	if(document.frm.phone.value=="")
	{
		alert("please enter phone");
		document.frm.phone.focus();
		return false;		
	}
	if(document.frm.email.value=="")
	{
		alert("please enter email");
		document.frm.email.focus();
		return false;		
	}
	
	document.frm.frmAction.value='add';
	
	
}

function chkprofessionals()
{ 
	if(document.frm.name.value=="")
	{
		alert("please enter name");
		document.frm.name.focus();
		return false;		
	}
	if(document.frm.address.value=="")
	{
		alert("please enter address");
		document.frm.address.focus();
		return false;		
	}
	
	if(document.frm.phone.value=="")
	{
		alert("please enter phone");
		document.frm.phone.focus();
		return false;		
	}
	if(document.frm.email.value=="")
	{
		alert("please enter email");
		document.frm.email.focus();
		return false;		
	}
	
	document.frm.frmAction.value='add';
	
}


function chkbotique()
{
if(document.frm.name.value=="")
	{
		alert("please enter name");
		document.frm.name.focus();
		return false;		
	}
	if(document.frm.address.value=="")
	{
		alert("please enter address");
		document.frm.address.focus();
		return false;		
	}
	
	if(document.frm.phone.value=="")
	{
		alert("please enter phone");
		document.frm.phone.focus();
		return false;		
	}
	if(document.frm.email.value=="")
	{
		alert("please enter email");
		document.frm.email.focus();
		return false;		
	}
	
	document.frm.frmAction.value='add';
	
}
function showModels(id) {
	sWidth = screen.availWidth;
	sHeight = screen.availHeight;
	
	winWidth = 450;
	winHeight = 400;
	
	sLeft = (sWidth - winWidth) / 2;
	sTop = (sHeight - winHeight) / 2;
	
	window.open("showEventphoto.php?id=" + id,"siteCategory","width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=1,resizable=0");
}
function doSubmit(v){
  document.frm.frmAction.value=v;
  document.frm.submit();
}
function checkVote2() {
	
	
	count = document.form3.poll_option_id.length;
	pollSelect = false;
	for(i = 0; i < count; ++i) {
		if(document.form3.poll_option_id[i].checked) {
			pollSelect = true;
			break;
		}
	}
	
	if(!pollSelect) {
		alert("Select an answer to vote");
		return false;
	}
	
	//document.form1.action ='php/displayPoll.php';
	document.form3.frmAction.value = 'Vote';

document.form3.submit();
}
/* disussion */


function validateDiscussion()
{
name=trimSpaces(document.discForm.name.value);
if(name.length<=0)
{
  alert("Please enter your name");
  document.discForm.name.focus();
   return false;
}

email=trimSpaces(document.discForm.email.value);
if(email.length<=0)
 {
  alert("Please enter your email");
  document.discForm.email.focus();
  return false;
 }
 else
 {
	 if(email.length>0)
	 {
		 if(!checkEmail(email))
		 {
		  document.discForm.email.focus();
		  return false;
		 }
	 }
  }
  
if(document.discForm.description.value.length<=0)
{
  alert("Please Enter your comments");
  document.discForm.description.focus();
   return false;
}
document.discForm.frmAction.value = "discussion";  
return true;
}

function markAsObjecction(forum_id,linkid)
{
	if (!confirm("Do you really want to mark this entry \n as objectionable?"))
	return;
	else
	{
		window.location.href='showDiscussionComments.php?linkid='+linkid+'&forum_id='+forum_id+'&frmAction=objection';
	}
}
function ChkReg(f){
	
	userreg.first_name.value = trimSpaces(userreg.first_name.value);
	if(userreg.first_name.value.length <= 0) {
		alert("Please enter your first name");
		userreg.first_name.focus();
		return false;
	}
	userreg.last_name.value = trimSpaces(userreg.last_name.value);
	if(userreg.last_name.value.length <= 0) {
		alert("Please enter your last name");
		userreg.last_name.focus();
		return false;
	}
	userreg.email.value = trimSpaces(userreg.email.value);
	if(!checkEmail(userreg.email.value)) {
		userreg.email.focus();
		return false;
	}
	
	userreg.city.value = trimSpaces(userreg.city.value);
	if(userreg.city.value.length <= 0) {
		alert("Please enter your city");
		userreg.city.focus();
		return false;
	}
	if(trimSpaces(userreg.birth_mon.options[userreg.birth_mon.selectedIndex].value).length <= 0) 
	{
		alert("Please select the birth month");
		userreg.birth_mon.focus();
		return false;
	}	
	if(trimSpaces(userreg.birth_year.options[userreg.birth_year.selectedIndex].value).length <= 0) 
	{
		alert("Please select the birth year");
		userreg.birth_year.focus();
		return false;
	}

	document.userreg.frmAction.value = "register";
	document.userreg.submit();
}

function chkuserlogin(toDo,linkid,f)
{	
	switch(linkid){
	
		case 87:
			if(!validateDiscussion())
				return false;
			break;
	}

	if(toDo=="add")
	{	
		if(f.username.value=="")
		{
		alert("Enter Email address");
		f.username.focus();
		return false;
		}
	
		if(f.password.value=="")
		{
		alert("Enter password");
		f.password.focus();
		return false;
		
   		}
	}
	f.frmAction.value = "login";
	f.submit();	
}
	function checkGB(f) {
	f.visitorName.value = trimSpaces(f.visitorName.value);
	if(f.visitorName.value.length <= 0) {
		alert("Please enter your name");
		f.visitorName.focus();
		return false;
	}

	f.emailAddress.value = trimSpaces(f.emailAddress.value);
	if(f.emailAddress.value.length <= 0) {
		alert("Please enter your email address");
		f.emailAddress.focus();
		return false;
	}
	if(!checkEmail(f.emailAddress.value)) {
		f.emailAddress.select();
		return false;
	}

	f.visitorComments.value = trimSpaces(f.visitorComments.value);
	if(f.visitorComments.value.length <= 0) {
		alert("Please enter your comments");
		f.visitorComments.focus();
		return false;
	}
	
	if(f.thecode.value==""){
		alert("The verification number must be entered as in the above image");
		f.thecode.select();
		return false;
	}
	f.frmAction.value = "update";
	return true;
}
/* dicussion ends */
