<!--

 function submitUserRegistration() {

  var loginIdStr = document.forms[0].loginId.value;
	
  loginIdStr = trim(loginIdStr);
	
  if (loginIdStr.length == 0) {
    alert('Login id missing. Enter your valid email id. ');
    document.forms[0].loginId = "";
    document.forms[0].loginId.focus();
    return;
  }

  if (! isEmail(loginIdStr)) {
    alert('Login id should be a valid email id.');
    document.forms[0].loginId.focus();
    return;
  }

  document.forms[0].hiddenAction.value = "registerNewUser";
  document.forms[0].submit();
}



function submitUserLogin() {

  var loginId = document.forms[0].loginId;
  var password = document.forms[0].password;
	
  var loginIdStr = loginId.value;
  var passwordStr = password.value;	
	
  loginIdStr = trim(loginIdStr);
  passwordStr = trim(passwordStr);


  if (loginIdStr.length == 0) {
    alert('Login id missing. Enter your valid email id. ');
    loginId.focus();
    return;
  }

  if (! isEmail(loginIdStr)) {
    alert('Login id should be a valid email id.');
    document.forms[0].loginId.focus();
    return;
  }


  if (passwordStr.length == 0) {
    alert('Password missing');
    password.focus();
    return;
  }

  document.forms[0].hiddenAction.value = "userLogin";
  document.forms[0].submit();

}


function submitForgotPassword() {


  var loginId = document.forms[0].forgotPasswordLoginId;
  var loginIdStr = trim(loginId.value);

  if (loginIdStr.length == 0) {
    alert('Login id missing. Enter your valid email id. ');
    loginId.focus();
    return;
  }

  if (! isEmail(loginIdStr)) {
    alert('Login id should be a valid email id.');
    loginId.focus();
    return;
  }

  document.forms[0].hiddenAction.value = "forgotPassword";
  document.forms[0].submit();

}


function submitChangePassword() {

  currPass = document.forms[0].currPass;
  newPass1 = document.forms[0].newPass1;
  newPass2 = document.forms[0].newPass2;

  if (currPass.value.length == 0) {
    alert('Current password missing. ');
    currPass.focus();
    return;
  }

  if (newPass1.value.length == 0) {
    alert('New password missing');
    newPass1.focus();
    return;
  }

  if (newPass2.value.length == 0) {
    alert('Confirm new password missing');
    newPass2.focus();
    return;
  }

  if (newPass1.value != newPass2.value) {
    alert('New password and Confirm password are not same');
    newPass2.focus();
    return;
  }

  document.forms[0].hiddenAction.value = "changePassword";
  document.forms[0].submit();

}

function userLogout() {
  document.forms[0].hiddenAction.value = "userLogout";
  document.forms[0].submit();
}

function submitPersonnalInfoForm() {
  thisForm = document.forms[0];
	
  var otherInfo = trim(document.forms[0].otherInfo.value);
	
  if (otherInfo.length > 250)	{
    alert("About Myself should be less than 250 chars");
    document.forms[0].otherInfo.focus();
    return;
  }

  thisForm.createPersonnalInfo.value = "submitted";

  thisForm.submit();

}


function submitContactInfoForm() {
  thisForm = document.forms[0];
	
  thisForm.createContactInfo.value = "submitted";

  thisForm.submit();

}


function submitPartnerInfoForm() {
  thisForm = document.forms[0];
	
  thisForm.createPartnerInfo.value = "submitted";

  thisForm.submit();

}

function popupMemberDetails(memberId) {
  memberDetailWindow = window.open("MemberDetailsPopup.php?id=" + memberId, "", 'width=600,height=600,resizable=yes,scrollbars=yes');
  memberDetailWindow.focus();
}


function popupMemberContact(memberId) {
  memberContactWindow = window.open("MemberContactPopup.php?id=" + memberId, "", 'width=400,height=500,resizable=yes,scrollbars=yes');
  memberContactWindow.focus();
}



function closeWindow () {
  window.close();
  window.opener.focus();
}


function showPhoto(idStr, totalPhotos) {
  var url = "MemberPhoto.php?id=" + idStr + "&photos=" + totalPhotos;
  photoWindow = window.open(url, 'AllIndiaMarriage', 
			    'width=400,height=450,resizable=yes,scrollbars=yes,location=no,status=no,menubar=no');	
  photoWindow.focus();
}


function submitPaging(searchTypeStr) {
  document.forms[0].pageIdHidden.value = document.forms[0].paging.value;
  submitSearch(searchTypeStr);
}


function submitSearch(searchType) {

  form = document.forms[0];

  var gender1 = document.forms[0].gender[0].checked;
  var gender2 = document.forms[0].gender[1].checked;

  var fromAge1 = form.fromAge.value;
  var toAge1 = form.toAge.value;

  var msg = "";

  if ((!gender1) && (!gender2)) {
    msg += 'Gender missing\n';
  }

  if (form.fromAge.selectedIndex == 0)	{
    msg += "'Age From' missing\n";
  }

  if (form.toAge.selectedIndex == 0)	{
    msg += "'Age To' missing\n";
  }

  if (form.religion.selectedIndex == 0)	{
    msg += "Religion missing\n";
  }

  if ((!gender1) && (!gender2)) {
    document.forms[0].gender[0].focus();
  } else if (form.fromAge.selectedIndex == 0)	{
    form.fromAge.focus();
  } else if (form.toAge.selectedIndex == 0)	{
    form.toAge.focus();
  } else if (form.religion.selectedIndex == 0)	{
    form.religion.focus();
  }

  if (msg.length != 0) {
    alert(msg);
    return;
  }

  form.hiddenAction.value = searchType;
  form.submit();
}

function submitIdSearch() {
	theField = document.forms[0].profileId;
	theId = theField.value;

	theId = trim(theId);

	errorMsg = "";

	if (theId.length == 0 ) {
		errorMsg = "To search by profile id, please enter profile id";
	} else if (theId.length < 4 ) {
		errorMsg = "Invalid Id - The All India Marriage profile id  will be like 'AIM1234'";
	} else {
		theId = theId.toUpperCase();
		if (theId.indexOf("AIM") != 0) {
			errorMsg = "Invalid Id - The All India Marriage profile id should start with 'AIM'";
		} else {
			tempStr = theId.substr(3, theId.length);
			if (isNaN(tempStr)) {
				errorMsg = "Invalid Id - The All India Marriage profile id will be like 'AIM1234' ";
			}
		}
	}

	if (errorMsg.length == 0 ) {
		//document.forms[0].DoSearch.value = "DoIdSearch";
		document.forms[0].hiddenAction.value = "DoIdSearch";
		document.forms[0].submit();
	} else {
		alert(errorMsg);
		theField.focus();
	}
}



function writeMailId() {
  document.write("<a href='mai" + "lto:admin" + "@" +  "jsinfotec" + "h.com?subject=Regarding AllIndiaMarriage.com'>admin" + "@" + "jsinfo" + "tech.com</a>");
}

function trim(str) {
  return str.replace(/^\s*|\s*$/g, "");
}

function isEmail2(string) {

  if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1) {
    return true;
  } else {
    return false;
  }
}


function isEmail(string) {
  if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1) {
    return true;
  } else {
    return false;
  }
}

function submitSendEmail() {
  thisForm = document.forms[0];
  var msg = "";

  if (thisForm.emailSubject.value.length == 0) {
    msg += "Subject missing.\n";
  }

  if (thisForm.emailBody.value.length == 0) {
    msg += "Message missing.\n";
  }

  if (msg.length == 0) {
    if(confirm("IMPORTANT\nAny abuse or illegal message will cause severe prosecution.\n\nAre sure to send this message to the member?")) {

      thisForm.submit();
    }
  } else {
    alert(msg);

    if (thisForm.emailSubject.value == "") {
      thisForm.emailSubject.focus();
    } else if (thisForm.emailBody.value == "") {
      thisForm.emailBody.focus();
    }


    return;
  }

}


function popupLiveSupport() {
  supportWindow = window.open("http://www.jsinfotech.com/Support.php?d=aim", 'AllIndiaMarriage', 'width=450,height=455,resizable=no,scrollbars=yes');
  supportWindow.focus();
}


function submitPhotoUploadForm(profileCreated) {
	
  if (profileCreated != 'Y') {
    alert("Create your Personnal info before upload photos");
    return;
  }

  theForm = document.forms[0];




  theForm.hiddenAction.value = "UploadPhotos";
  theForm.submit();
}

function removeLoading() {
	var targelem = document.getElementById('loadContainer');
	targelem.style.display ='none';
	targelem.style.visibility ='hidden';
}

function popupSCSBanner() {
    scsBanner = window.open("http://www.SingaporeCarSales.com/SingaporeCarSales300x300.html", 'SingaporeCarSales', 'width=300,height=300,resizable=no,scrollbars=no,top=225,left=25');
}

function popupSJSBanner() {
    sjsBanner = window.open("http://www.SingaporeJobSearch.com/SingaporeJobSearch300x300.html", 'SingaporeJobSearch', 'width=300,height=300,resizable=no,scrollbars=no,top=225,left=400');
}


function submitIdSearchOnEnterKey(e) {

	var key;

	if (window.event) {
		key = e.keyCode; // for IE, e.keyCode or window.event.keyCode can be used
	} else if (e.which) {
		key = e.which; // netscape
	}

	if (key == 13) {
		this.submitIdSearch();
	} else {
		return;
	}
}


//->

