document.onmousedown = rtclicknocopy

<!-- window.defaultStatus ="Welcome to holygardens.com - your global access to a group of nationwide memorial parks in the Philippines" 
msg = "                                                                                                    Holy Gardens Memorial Park (HGMP) ... Helping in the Grief of Many People                                                                                                                               We are not the biggest but our services are one of the best...excellent customer services that even the biggest memorial parks can not match.                                                                                              "
//-->
msg = "                                                                                                    Holy Gardens Memorial Park (HGMP) ... Helping in the Grief of Many People                                                                                                                               Holy Gardens Memorial Park (HGMP) ... Setting the Standards in Interment Service                                                                                              "
i = 0

function scrollMsg() {
	window.status = msg.substring(i,msg.length) + msg.substring(0,i-1)
	if (i < msg.length) {i++} else {i=0}
	setTimeout("scrollMsg()",100)
}

if (document.images) {
	navproducts 		= new Image
	navbereaved  		= new Image
	navowners    		= new Image
	navagents    		= new Image
	navinvestors 		= new Image
	navmarketplace  	= new Image
	navprofile   		= new Image
	navproductsmenu 	= new Image
	navbereavedmenu 	= new Image
	navownersmenu    	= new Image
	navagentsmenu    	= new Image
	navinvestorsmenu 	= new Image
	navmarketplacemenu  = new Image
	navprofilemenu   	= new Image

	navproducts2 		= new Image
	navbereaved2  		= new Image
	navowners2    		= new Image
	navagents2    		= new Image
	navinvestors2 		= new Image
	navmarketplace2  	= new Image
	navprofile2   		= new Image
	navproductsmenu2 	= new Image
	navbereavedmenu2 	= new Image
	navownersmenu2    	= new Image
	navagentsmenu2    	= new Image
	navinvestorsmenu2 	= new Image
	navmarketplacemenu2 = new Image
	navprofilemenu2   	= new Image

	navproducts.src  		= "visuals/navproducts.gif"
	navbereaved.src  		= "visuals/navbereaved.gif"
	navowners.src    		= "visuals/navowners.gif"
	navagents.src    		= "visuals/navagents.gif"
	navinvestors.src 		= "visuals/navinvestors.gif"
	navmarketplace.src  	= "visuals/navmarketplace.gif"
	navprofile.src   		= "visuals/navprofile.gif"
	navproductsmenu.src 	= "visuals/navproductsmenu.gif"
	navbereavedmenu.src 	= "visuals/navbereavedmenu.gif"
	navownersmenu.src   	= "visuals/navownersmenu.gif"
	navagentsmenu.src   	= "visuals/navagentsmenu.gif"
	navinvestorsmenu.src	= "visuals/navinvestorsmenu.gif"
	navmarketplacemenu.src  = "visuals/navmarketplacemenu.gif"
	navprofilemenu.src  	= "visuals/navprofilemenu.gif"

	navproducts2.src  		= "../visuals/navproducts.gif"
	navbereaved2.src  		= "../visuals/navbereaved.gif"
	navowners2.src    		= "../visuals/navowners.gif"
	navagents2.src    		= "../visuals/navagents.gif"
	navinvestors2.src 		= "../visuals/navinvestors.gif"
	navmarketplace2.src  	= "../visuals/navmarketplace.gif"
	navprofile2.src   		= "../visuals/navprofile.gif"
	navproductsmenu2.src 	= "../visuals/navproductsmenu.gif"
	navbereavedmenu2.src 	= "../visuals/navbereavedmenu.gif"
	navownersmenu2.src   	= "../visuals/navownersmenu.gif"
	navagentsmenu2.src   	= "../visuals/navagentsmenu.gif"
	navinvestorsmenu2.src	= "../visuals/navinvestorsmenu.gif"
	navmarketplacemenu2.src = "../visuals/navmarketplacemenu.gif"
	navprofilemenu2.src  	= "../visuals/navprofilemenu.gif"
}

var mymessage = "PLEASE RESPECT INTELLECTUAL PROPERTY. The contents of this site, including the scripts, written materials, graphics and audio files, are COPYRIGHT PROTECTED. Please do not copy and post its contents, in part or in whole, on ANY commercial, non-profit, or personal website and other similar media. Thank you.";

function rtclicknocopy(keyp){
  if (navigator.appName == "Netscape" && keyp.which == 3) {
    alert(mymessage);
    return false;
  }

  if (navigator.appVersion.indexOf("MSIE") != -1 && event.button == 2) {
    alert(mymessage);
    return false;
  }
}

// Functions to change the color of the td in a table onmouseover and mouseout
function mOvr(src,clrOver) {
   if (!src.contains(event.fromElement))
     {src.style.cursor = 'hand'; src.bgColor = clrOver;}
}
   
function mOut(src,clrIn) {
   if (!src.contains(event.toElement))
   {
   src.style.cursor = 'default';
   src.bgColor = clrIn;
   }
}


// pop-up window for article
function openNewWindow4Web(pagefile) {
	navWindow = window.open(pagefile, 'nav', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,top=40px,left=85px,width=700,height=475')
	navWindow.focus()
}			


// pop-up window for article
function openNewWindow4Article(pagefile) {
	navWindow = window.open(pagefile, 'nav', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,top=40px,left=85px,width=900,height=1050')
	navWindow.focus()
}			


// pop-up window for site map
function updateParentWin(newURL) {
	window.opener.open(newURL,'_parent');
}

// pop-up window for printing 
function openNewWindow(URL,winName,features) {
  window.open(URL,winName,features);
}

function statusMsg(type) {
  switch (type) 
    {
    /* shopper options */
	case "Company" :
         window.status="Manage company information, including testimonials, promos, news and calendar..." 
  	     break
	case "Products" :
         window.status="Manage sections, facilities, e-condolences, e-prayers and e-cards..." 
  	     break
	case "Parks" :
         window.status="Manage parks and lots..." 
  	     break
	case "Obituaries" :
         window.status="Manage obituaries and interments..." 
  	     break
	case "Agents" :
         window.status="Manage agents, announcements/broadcasts and price inquiries..." 
	     break
	case "Sales" :
         window.status="Manage sales, owners, payments and payment due alerts..." 
	     break
	case "Ads" :
         window.status="Manage ads for currently-owned lots..." 
	     break
	case "Users" :
         window.status="Activate accounts and manage site users and e-privileges..." 
	     break
	case "Site" :
         window.status="Go back to the Holy Gardens Memorial Park site..." 
	     break
	case "Products Menu" :
         window.status="Go on a garden tour, examine the lot types and facilities, inquire about prices and even order the lot online!" 
  	     break
	case "Bereaved Menu" :
         window.status="For the bereaved friends and family, extend your condolences, read the obituaries and know the interment details..." 
  	     break
	case "Owners Menu" :
         window.status="For the lot owners, track payments and outstanding balances, monitor lot usage and learn about your online privileges..." 
  	     break
	case "Agents Menu" :
         window.status="For authorized agents, download prices, list price inquiries and clients, read announcements and send messages..." 
  	     break
	case "Investors Menu" :
         window.status="For authorized investors, have access to confidential financial reports and send messages to the company..." 
  	     break
	case "Marketplace Menu" :
         window.status="For lot owners, advertise lots for sale while those interested to buy, post buy ads..." 
  	     break
	case "Profile Menu" :
         window.status="All the relevant information on the company..." 
  	     break
    default:
         window.status="Kindly click to avail of more information"
    }
	return true
}

function conRemove(msg,id) 
	{return window.confirm("Sure To Delete "+msg+id+"?");}

function conCancel(msg,id) 
	{return window.confirm("Sure To Cancel "+msg+id+"?");}

/*-------------------------------------------------------------------*/              
//function to validate numeric entry
function validNum(item,label,max,min,sint) {

   if (isNaN(item.value)) 
      {errorAlert(item,"INVALID: "+label+" Must Be Numeric"); }

   if (item.value > max) 
      {errorAlert(item,"INVALID: "+label+" Exceeds Maximum Allowable Value"); }
 
   if (item.value < min) 
      {errorAlert(item,"INVALID: "+label+" Is Below Minimum Allowable Value"); }

   if (sint=="yes") {
      // convert to integer
      item.value=Math.round(item.value); 
   }
} 

//function to validate credit card entry
function validCard(item,label,max,min) {
   msgError = " Is Not A Valid Card Number";

   if (isNaN(item.value)) 
      {errorAlert(item,"INVALID: "+label+msgError); }

   if (item.value > max) 
      {errorAlert(item,"INVALID: "+label+msgError); }
 
   if (item.value < min) 
      {errorAlert(item,"INVALID: "+label+msgError); }
} 


//function to validate date using select data entry
function validDate2(month,day,year,msg) {
   var invalid = 'n'; 

   if (((month==4 || month==6 || month==9 || month==11) && day>30)) 
      {invalid = 'y';}
   else
      {if (day>31) invalid='y';}
   
   if ((month==2 && (year/4)==0 && day>29) || (month==2 && (year/4)!=0 && day>28)) 
      invalid = 'y'; 
   
   if (invalid=='y')
      errorAlert2("INVALID: "+msg);
}


//function to validate blank entry
function validBlank(item) {
   return (item.length > 0);
}

//function to compare values
function validPassword(pass1,pass2) {
   return (pass1 == pass2);
}

//function to validate an email address
function validEmail(item) {
   var wAt=item.indexOf ('@')
   // if without @ or at start
   if (wAt== -1 || wAt== 0) return false;
   return true;
}

//function to validate radio buttons
function validRadio(item) {
   var wChk = -1
   for (i=0; i<item.length;i++) {
		if (item[i].checked) {
			wChk = i
	    }
   }
   if (wChk==-1) return false;
   return true;
}

//function to determine checked radio button
function chkRadio(item) {
   var wChk = -1
   for (i=0; i<item.length;i++) {
		if (item[i].checked) {
			wChk = i
	    }
   }
   return wChk;
}

//function to un-check radio buttons
function unchkRadio(item) {
   for (i=0; i<item.length;i++) {
		if (item[i].checked) {
			item[i].checked=false
	    }
   }
}

// display an error alert and return to erroneous data
function errorAlert(elem, text) {
   // abort if we already found an error, one error handling at a time
   if (errFound) return;
   window.alert(text);
   elem.select();
   elem.focus();

   errFound = true;
}

// display an error alert for radio buttons
function errorAlert2(text) {
   // abort if we already found an error, one error handling at a time
   if (errFound) return;
   window.alert(text);

   errFound = true;
}

//global variable for error flag
var errFound = false;

// main validation function

// login form
function validLogIn() {
   errFound = false;
   // blank
   if (!validBlank(document.loginForm.username.value))
      errorAlert(document.loginForm.username,"INVALID: Username Must Be Specified");
   if (!validBlank(document.loginForm.password.value))
      errorAlert(document.loginForm.password,"INVALID: Password Must Be Specified");
   return !errFound; /* true if there are no errors */
}

function validProfileForm() {
	errFound = false;
	// blank
	if (!validBlank(document.profileForm.user_username.value))
		errorAlert(document.profileForm.user_username,"INVALID: Username Must Be Specified");
	if (document.profileForm.user_username.value.length<6)
		errorAlert(document.profileForm.user_username,"INVALID: Username Must Be More Than 6 Characters");
	if (!validBlank(document.profileForm.user_password.value))
 		errorAlert(document.profileForm.user_password,"INVALID: Password Must Be Specified");
 	if (document.profileForm.user_password.value.length<6)
		errorAlert(document.profileForm.user_password,"INVALID: Password Must Be More Than 6 Characters");
	if (!validBlank(document.profileForm.user_password2.value))
		errorAlert(document.profileForm.user_password2,"INVALID: Password Must Be Confirmed. Please Enter Again");
	if (document.profileForm.user_password.value!=document.profileForm.user_password2.value)
		errorAlert(document.profileForm.user_password,"INVALID: Passwords Are Not Identical. Please Enter Again");
	if (document.profileForm.user_username.value==document.profileForm.user_password.value)
		errorAlert(document.profileForm.user_password,"INVALID: Username and Password Must Not Be Identical");

	if (!validBlank(document.profileForm.user_question.value))
		errorAlert(document.profileForm.user_question,"INVALID: Personal Question Must Be Specified");
	if (!validBlank(document.profileForm.user_answer.value))
		errorAlert(document.profileForm.user_answer,"INVALID: Personal Answer Must Be Specified");
	if (!validBlank(document.profileForm.user_firstname.value))
		errorAlert(document.profileForm.user_firstname,"INVALID: First Name Must Be Specified");
	if (!validBlank(document.profileForm.user_lastname.value))
		errorAlert(document.profileForm.user_lastname,"INVALID: Last Name Must Be Specified");
	if (!validEmail(document.profileForm.user_email.value)) 
		errorAlert(document.profileForm.user_email,"Sorry, invalid E-Mail Address");
	return !errFound; /* true if there are no errors */
}

function validAppliForm() {
	errFound = false;
	// blank
	if (!validBlank(document.appliForm.appli_firstname.value))
		errorAlert(document.appliForm.appli_firstname,"INVALID: First Name Must Be Specified");
	if (!validBlank(document.appliForm.appli_lastname.value))
		errorAlert(document.appliForm.appli_lastname,"INVALID: Last Name Must Be Specified");
	if (!validEmail(document.appliForm.appli_email.value)) 
		errorAlert(document.appliForm.appli_email,"Sorry, invalid E-Mail Address");
	return !errFound; /* true if there are no errors */
}

function validAdsForm() {
	errFound = false;
	if (!validBlank(document.adsForm.blockno.value))
		errorAlert(document.adsForm.blockno,"Please specify exact Block No.");
	if (!validBlank(document.adsForm.lotno.value))
		errorAlert(document.adsForm.lotno,"Please specify exact Lot No.");
	return !errFound; /* true if there are no errors */
}



function validCompanyForm() {
   errFound = false;
   if (!validBlank(document.companyForm.co_name.value))
      errorAlert(document.companyForm.co_name,"INVALID: Company Name Must Be Specified");
   return !errFound; /* true if there are no errors */
}

function validSwearForm() {
   errFound = false;
   if (!validBlank(document.swearForm.swear_by.value))
      errorAlert(document.swearForm.swear_by,"INVALID: Testimonial By Must Be Specified");
   return !errFound; /* true if there are no errors */
}

function validPromoForm() {
   errFound = false;
   if (!validBlank(document.promoForm.promo_teaser.value))
      errorAlert(document.promoForm.promo_teaser,"INVALID: Promo Teaser Must Be Specified");
   return !errFound; /* true if there are no errors */
}

function validNewsForm() {
   errFound = false;
   if (!validBlank(document.newsForm.news_teaser.value))
      errorAlert(document.newsForm.news_teaser,"INVALID: News Teaser Must Be Specified");
   return !errFound; /* true if there are no errors */
}

function validCalendarForm() {
   errFound = false;
   if (!validBlank(document.calendarForm.event_desc.value))
      errorAlert(document.calendarForm.event_desc,"INVALID: Event Description Must Be Specified");
   return !errFound; /* true if there are no errors */
}

function validISOForm() {
   errFound = false;
   if (!validBlank(document.ISOForm.iso_name.value))
      errorAlert(document.ISOForm.iso_name,"INVALID: Name Must Be Specified");
   return !errFound; /* true if there are no errors */
}

function validSectionForm() {
   errFound = false;
   if (!validBlank(document.sectionForm.sect_name.value))
      errorAlert(document.sectionForm.sect_name,"INVALID: Name Must Be Specified");
   return !errFound; /* true if there are no errors */
}

function validAmenityForm() {
   errFound = false;
   if (!validBlank(document.amenityForm.ame_name.value))
      errorAlert(document.amenityForm.ame_name,"INVALID: Name Must Be Specified");
   if (!validBlank(document.amenityForm.ame_pic.value))
      errorAlert(document.amenityForm.ame_pic,"INVALID: Photo Must Be Existing");
   return !errFound; /* true if there are no errors */
}

function validParkForm() {
   errFound = false;
   if (!validBlank(document.parkForm.park_name.value))
      errorAlert(document.parkForm.park_name,"INVALID: Park Name Must Be Specified");
   if (!validBlank(document.parkForm.park_abbrev.value))
      errorAlert(document.parkForm.park_abbrev,"INVALID: Park Abbreviation Must Be Specified");
   return !errFound; /* true if there are no errors */
}

function validLotForm() {
   errFound = false;
   if (!validBlank(document.lotForm.lot_blockno.value))
      errorAlert(document.lotForm.lot_blockno,"INVALID: Block No. Must Be Specified");
   if (!validBlank(document.lotForm.lot_lotno.value))
      errorAlert(document.lotForm.lot_lotno,"INVALID: Lot No. Must Be Specified");
   return !errFound; /* true if there are no errors */
}

function validObitForm() {
   errFound = false;
   if (!validBlank(document.obitForm.obit_firstname.value))
      errorAlert(document.obitForm.obit_firstname,"INVALID: First Name Must Be Specified");
   if (!validBlank(document.obitForm.obit_lastname.value))
      errorAlert(document.obitForm.obit_lastname,"INVALID: Last Name Must Be Specified");
   return !errFound; /* true if there are no errors */
}

function validEPrayerForm() {
   errFound = false;
   if (!validBlank(document.eprayerForm.epray_desc.value))
      errorAlert(document.eprayerForm.epray_desc,"INVALID: Description Must Be Specified");
   return !errFound; /* true if there are no errors */
}

function validECardForm() {
   errFound = false;
   if (!validBlank(document.ecardForm.ecard_desc.value))
      errorAlert(document.ecardForm.ecard_desc,"INVALID: Description Must Be Specified");
   return !errFound; /* true if there are no errors */
}

function validAgentForm() {
	errFound = false;
	if (!validBlank(document.agentForm.agent_firstname.value))
		errorAlert(document.agentForm.agent_firstname,"INVALID: First Name Must Be Specified");
	if (!validBlank(document.agentForm.agent_lastname.value))
		errorAlert(document.agentForm.agent_lastname,"INVALID: Last Name Must Be Specified");
	return !errFound; /* true if there are no errors */
}

function validOwnerForm() {
	errFound = false;
	if (!validBlank(document.ownerForm.owner_firstname.value))
		errorAlert(document.ownerForm.owner_firstname,"INVALID: First Name Must Be Specified");
	if (!validBlank(document.ownerForm.owner_lastname.value))
		errorAlert(document.ownerForm.owner_lastname,"INVALID: Last Name Must Be Specified");
	if (document.ownerForm.owner_email.value!='') {
		if (!validEmail(document.ownerForm.owner_email.value)) 
			errorAlert(document.ownerForm.owner_email,"Sorry, invalid E-Mail Address");
	}
	return !errFound; /* true if there are no errors */
}

function validPAForm() {
	errFound = false;
	if (!validBlank(document.PAForm.pa_contractno.value))
		errorAlert(document.PAForm.pa_contractno,"INVALID: Contract No. Must Be Specified");
	if (!validBlank(document.PAForm.pa_date.value))
		errorAlert(document.PAForm.pa_date,"INVALID: P/A Date Must Be Specified");
	if (!validBlank(document.PAForm.pa_blockno.value))
		errorAlert(document.PAForm.pa_blockno,"INVALID: Block No. Must Be Specified");
	if (!validBlank(document.PAForm.pa_lotno.value))
		errorAlert(document.PAForm.pa_lotno,"INVALID: Lot No. Must Be Specified");
	validNum(document.PAForm.pa_lotprice,'Lot Price',9999999.99,.01,'no')
	validNum(document.PAForm.pa_careprice,'Perpetual Care Price',9999999.99,0,'no')
	validNum(document.PAForm.pa_down,'Down Payment',9999999.99,.0,'no')
	validNum(document.PAForm.pa_ipa,'IPA',9999999.99,.0,'no')
	validNum(document.PAForm.pa_termyrs,'Term (in years)',99,0,'yes')
	validNum(document.PAForm.pa_ratepercent,'Rate (%)',99.99,0,'no')
	validNum(document.PAForm.pa_monthlyinstal,'Monthly Installment',9999999.99,0,'no')
	return !errFound; /* true if there are no errors */
}

function validPayForm() {
	errFound = false;
	if (!validBlank(document.payForm.pay_prorno.value))
		errorAlert(document.payForm.pay_prorno,"INVALID: PR/OR No. Must Be Specified");
	if (!validBlank(document.payForm.pay_date.value))
		errorAlert(document.payForm.pay_date,"INVALID: P/A Date Must Be Specified");
	validNum(document.payForm.pay_amount,'Amount',9999999.99,.01,'no')
	return !errFound; /* true if there are no errors */
}

function validUserForm() {
	errFound = false;
	if (!validBlank(document.userForm.user_username.value))
		errorAlert(document.userForm.user_username,"INVALID: Username Must Be Specified");
	if (document.userForm.user_username.value.length<6)
		errorAlert(document.userForm.user_username,"INVALID: Username Must Be More Than 6 Characters");
	if (!validBlank(document.userForm.user_password.value))
 		errorAlert(document.userForm.user_password,"INVALID: Password Must Be Specified");
 	if (document.userForm.user_password.value.length<6)
		errorAlert(document.userForm.user_password,"INVALID: Password Must Be More Than 6 Characters");
	if (!validBlank(document.userForm.user_password2.value))
		errorAlert(document.userForm.user_password2,"INVALID: Password Must Be Confirmed. Please Enter Again");
	if (document.userForm.user_password.value!=document.userForm.user_password2.value)
		errorAlert(document.userForm.user_password,"INVALID: Passwords Are Not Identical. Please Enter Again");
	if (document.userForm.user_username.value==document.userForm.user_password.value)
		errorAlert(document.userForm.user_password,"INVALID: Username and Password Must Not Be Identical");
	if (!validBlank(document.userForm.user_firstname.value))
		errorAlert(document.userForm.user_firstname,"INVALID: First Name Must Be Specified");
	if (!validBlank(document.userForm.user_lastname.value))
		errorAlert(document.userForm.user_lastname,"INVALID: Last Name Must Be Specified");
	return !errFound; /* true if there are no errors */
}

function validInvestorForm() {
	errFound = false;
	if (!validBlank(document.investorForm.investor_firstname.value))
		errorAlert(document.investorForm.investor_firstname,"INVALID: First Name Must Be Specified");
	if (!validBlank(document.investorForm.investor_lastname.value))
		errorAlert(document.investorForm.investor_lastname,"INVALID: Last Name Must Be Specified");
	return !errFound; /* true if there are no errors */
}

function validMailForm() {
	errFound = false;
	if (!validBlank(document.mailForm.mail_subject.value))
		errorAlert(document.mailForm.mail_subject,"INVALID: Subject Must Be Specified");
	if (!validBlank(document.mailForm.mail_message.value))
		errorAlert(document.mailForm.mail_message,"INVALID: Message Must Be Specified");
	return !errFound; /* true if there are no errors */
}