<!-- Hide script from browsers using comment tags



/* Functions in this file includes:-

** 0) popupwindow_netrust() - to verify secure.hlf.com.sg certificate

** 1) doingprint - to create a printer friendly page

** 2) leapto(form) - to do URL jump for drop down box

** 3) jumpPage(url) - to jump to another URL web page

** 4) popupwindow_enqfeedback - Hyperlink to the application form as a pop-up customised window

** 5) popupwindow_newcarloan - Hyperlink to the application form as a pop-up customised window

** 6) popupwindow_usedcarloan - Hyperlink to the application form as a pop-up customised window

** 7) popupwindow_cplusimmediate - Hyperlink to the application form as a pop-up customised window

** 8) popupwindow_cplus - Hyperlink to the application form as a pop-up customised window

** 9) popupwindow_eslimmediate - Hyperlink to the application form as a pop-up customised window

**10) popupwindow_esl - Hyperlink to the application form as a pop-up customised window

**11) popupwindow_housingloan - Hyperlink to the application form as a pop-up customised window

**12) popupwindow_hdbhomeloan - Hyperlink to the application form as a pop-up customised window

**13) popupwindow_sme - Hyperlink to the application form as a pop-up customised window

**14) popupwindow_rates - Hyperlink to the rates list as a pop-up customised 

**15) safemail(name) - This function will not have email addresses shown, intact, anywhere in html code so that the spiders cannot find them

**16) highlightWord(node,word) - Hyperlink to the application form as a pop-up customised 

**17) googleSearchHighlight - Hyperlink to the application form as a pop-up customised 

**18) CHK_num(field, argument[1]) - to check that the field only contains numbers.
**                                - to suppress error message, set argument[1]="NO".

**19) popupwindow_ipo - Hyperlink to the application form as a pop-up customised window

**20) createNotes - Hyperlink to the application form as a pop-up customised window

**21) popupwindow_cccenq - Hyperlink to the application form as a pop-up customised window

**22) popupwindow_hpcsenq - Hyperlink to the application form as a pop-up customised window

**23) popupwindow_branchenq - Hyperlink to the application form as a pop-up customised window

*/



<!-- Begin declarations for day and date //-->

dayName = new Array("", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun");

monName = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");

now = new Date;

<!-- End declarations for day and date //-->

// Hyperlink to the netrust as a pop-up customised window

function popupwindow_netrust()
{
window.open('https://ssl.netrust.net/ssl/servlet/CSRProcessor?action=verifySeal&NetID=20090129113658','netrustwindow','toolbar=no,location=no, directories=no,status=yes,menubar=no,resizable=no,copyhistory=no,scrollbars=yes,width=650,height=450');
}


function doingprint()
{  

  printopt = true;
  window.print();
  printopt = false;     
}

// for dropdown list in homepage
function leapto(form) {
  var newIndex = form.destination.selectedIndex;
  window.location = (form.destination.options[newIndex].value); 
}

// for dropdown list in homepage
function jumpPage (url) {
    window.location.href=url;
}

// Hyperlink to the application form as a pop-up customised window
function popupwindow_enqfeedback()
{
window.open('https://secure.hlf.com.sg/formenquiryfeedback.html','feedbackwindow','toolbar=no,location=no, directories=no,status=yes,menubar=no,resizable=no,copyhistory=no,scrollbars=yes,width=600,height=450');
}

// Hyperlink to the application form as a pop-up customised window
function popupwindow_insurance()
{
window.open('https://secure.hlf.com.sg/forminsurance.html','feedbackwindow','toolbar=no,location=no, directories=no,status=yes,menubar=no,resizable=no,copyhistory=no,scrollbars=yes,width=600,height=450');
}

// Hyperlink to the application form as a pop-up customised window
function popupwindow_newcarloan()
{
window.open('https://secure.hlf.com.sg/formnewcarloan.html','feedbackwindow','toolbar=no,location=no, directories=no,status=yes,menubar=no,resizable=no,copyhistory=no,scrollbars=yes,width=600,height=450');
}

// Hyperlink to the application form as a pop-up customised window
function popupwindow_usedcarloan()
{
window.open('https://secure.hlf.com.sg/formusedcarloan.html','feedbackwindow','toolbar=no,location=no, directories=no,status=yes,menubar=no,resizable=no,copyhistory=no,scrollbars=yes,width=600,height=450');
}

// Hyperlink to the application form as a pop-up customised window
function popupwindow_cplusimmediate()
{
window.open('https://secure.hlf.com.sg/formcplusimmediate.html','feedbackwindow','toolbar=no,location=no, directories=no,status=yes,menubar=no,resizable=no,copyhistory=no,scrollbars=yes,width=600,height=450');
}

// Hyperlink to the application form as a pop-up customised window
function popupwindow_cplus()
{
window.open('https://secure.hlf.com.sg/formcplus.html','feedbackwindow','toolbar=no,location=no, directories=no,status=yes,menubar=no,resizable=no,copyhistory=no,scrollbars=yes,width=600,height=450');
}

// Hyperlink to the application form as a pop-up customised window
function popupwindow_eslimmediate()
{
window.open('https://secure.hlf.com.sg/formeslimmediate.html','feedbackwindow','toolbar=no,location=no, directories=no,status=yes,menubar=no,resizable=no,copyhistory=no,scrollbars=yes,width=600,height=450');
}

// Hyperlink to the application form as a pop-up customised window
function popupwindow_esl()
{
window.open('https://secure.hlf.com.sg/formesl.html','feedbackwindow','toolbar=no,location=no, directories=no,status=yes,menubar=no,resizable=no,copyhistory=no,scrollbars=yes,width=600,height=450');
}

// Hyperlink to the application form as a pop-up customised window
function popupwindow_housingloan()
{
window.open('https://secure.hlf.com.sg/formhousingloan.html','feedbackwindow','toolbar=no,location=no, directories=no,status=yes,menubar=no,resizable=no,copyhistory=no,scrollbars=yes,width=600,height=450');
}

// Hyperlink to the application form as a pop-up customised window
function popupwindow_hdbhomeloan()
{
window.open('https://secure.hlf.com.sg/formhdbhomeloan.html','feedbackwindow','toolbar=no,location=no, directories=no,status=yes,menubar=no,resizable=no,copyhistory=no,scrollbars=yes,width=600,height=450');
}

// Hyperlink to the application form as a pop-up customised window
function popupwindow_sme()
{
window.open('https://secure.hlf.com.sg/formsme.html','feedbackwindow','toolbar=no,location=no, directories=no,status=yes,menubar=no,resizable=no,copyhistory=no,scrollbars=yes,width=600,height=450');
}

// Hyperlink to the application form as a pop-up customised window
function popupwindow_rates()
{  
window.open('http://www.hlf.com.sg/template/rates.html','rateswindow','toolbar=no,location=no, directories=no,status=yes,menubar=no,resizable=no,copyhistory=no,scrollbars=yes,width=600,height=450');
}

// This function will not have email addresses shown, intact, anywhere in
// html code so that the spiders cannot find them - 20040714

function safemail(name){

var domain="hlf.com.sg";

document.write('<a class="contentsmall" href=mailto:' + name + '@' + domain + '>' + name + '@' + domain + '</a>');

}// end of safemail

/* http://www.kryogenix.org/code/browser/searchhi/ */
/* Modified 20021006 to fix query string parsing and add case insensitivity */

function highlightWord(node,word) {

	// Iterate into this nodes childNodes

	if (node.hasChildNodes) {

		var hi_cn;

		for (hi_cn=0;hi_cn<node.childNodes.length;hi_cn++) {
			highlightWord(node.childNodes[hi_cn],word);
		}
	}

	// And do this node itself

	if (node.nodeType == 3) { // text node

		tempNodeVal = node.nodeValue.toLowerCase();
		tempWordVal = word.toLowerCase();

		if (tempNodeVal.indexOf(tempWordVal) != -1) {
			pn = node.parentNode;
			if (pn.className != "searchword") {
				// word has not already been highlighted!
				nv = node.nodeValue;
				ni = tempNodeVal.indexOf(tempWordVal);

				// Create a load of replacement nodes
				before = document.createTextNode(nv.substr(0,ni));
				docWordVal = nv.substr(ni,word.length);
				after = document.createTextNode(nv.substr(ni+word.length));
				hiwordtext = document.createTextNode(docWordVal);
				hiword = document.createElement("span");
				hiword.className = "searchword";
				hiword.appendChild(hiwordtext);
				pn.insertBefore(before,node);
				pn.insertBefore(hiword,node);
				pn.insertBefore(after,node);
				pn.removeChild(node);
			}
		}
	}
}


function googleSearchHighlight() {

	if (!document.createElement) return;
	ref = document.URL;
	qs = ref.substr(ref.indexOf('?')+1);
	qsa = qs.split('&');

	for (i=0;i<qsa.length;i++) {
		qsip = qsa[i].split('=');
		if (qsip.length == 1) continue;

		if (qsip[0] == 'q' || qsip[0] == 'p') { 
		// q= for Google, p= for Yahoo
			words = unescape(qsip[1].replace(/\+/g,' ')).split(/\s+/);

			for (w=0;w<words.length;w++) {
				highlightWord(document.getElementsByTagName("body")[0],words[w]);
			}
		}
	}
}


function CHK_num(field)
{
	var digits="0123456789";
	var temp;

	// Empty string
	if ((field.value=="") || (field.value==null))
	{
	   return true;
	}

	if (field.value==0)
	{
	      // to suppress error message
	      if (arguments[1]!="NO")
	      {
			 alert("Please enter a value.");
			 field.focus();
			 field.select();
	      }// end if
	      return false;
	}

	for (var i=0; i<field.value.length; i++)
	{
	   temp = field.value.substring(i,i+1);
	   if (digits.indexOf(temp)==-1)
	   {
	      // to suppress error message
	      if (arguments[1]!="NO")
	      {
			 alert("Please enter numbers only (no commas or other characters).");
			 field.focus();
			 field.select();
	      }// end if
	      return false;
	   }//end if 
	}//end for
	return true;
}//end of CHK_num

function popupwindow_ipo()
{
window.open('https://secure.hlf.com.sg/formipo.html','ipowindow','toolbar=no,location=no, directories=no,status=yes,menubar=no,resizable=no,copyhistory=no,scrollbars=yes,width=600,height=450');
}

// for pop-up information in the quick access block
function createNotes(){

	function showNote(e){

		// gets corresponding note element id

 		var id=this.id.replace(/a/,'note');
		note=document.getElementById(id);
		var ev=(!e)?window.event:e;
		var posx=0; var posy=0;
		var scrOfX = 0; var scrOfY = 0;

		if( typeof( window.pageYOffset ) == 'number' ) {//Moz compliant
			scrOfY = window.pageYOffset;
			scrOfX = window.pageXOffset;
		} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {//DOM compliant
			scrOfY = document.body.scrollTop;
			scrOfX = document.body.scrollLeft;
		} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {//IE6 standards compliant mode
			scrOfY = document.documentElement.scrollTop;
			scrOfX = document.documentElement.scrollLeft;
		}

		if (ev.pageX){//Moz
			posx = ev.pageX - 236;
			posy = ev.pageY + 16;
		}
		else if(ev.clientX){//IE
			posx = ev.clientX + scrOfX - 230;
			posy = ev.clientY + scrOfY + 12;
		}
		else{return false}//old browsers

		// makes note element visible
		note.style.visibility='visible';

		note.style.left = posx + 'px'; 
		note.style.top = posy + 'px'; 
	}



	function hideNote(){ 

		// gets corresponding id for note element
		var id=this.id.replace(/a/,'note');

		note=document.getElementById(id);

		// hides note element
		note.style.visibility='hidden';

	}

	// gets all <a> elements 
	as=document.getElementsByTagName('a');

	// iterates over all <a> elements
	for(i=0;i<as.length;i++){

		// assigns mouse event handlers to <a> elements with class name "special"
		if(/\bspecial\b/.test(as[i].className)){

			// shows note element when mouse is over 
			as[i].onmousemove=showNote;

			// hides note element when mouse is out
			as[i].onmouseout=hideNote;
		}
	}
}

// execute code once page is loaded
window.onload=createNotes;

// Hyperlink to the application form as a pop-up customised window
function popupwindow_cccenq()
{
window.open('https://secure.hlf.com.sg/formcccenquiry.html','feedbackwindow','toolbar=no,location=no, directories=no,status=yes,menubar=no,resizable=no,copyhistory=no,scrollbars=yes,width=600,height=450');
}

// Hyperlink to the application form as a pop-up customised window
function popupwindow_hpcsenq()
{
window.open('https://secure.hlf.com.sg/formhpcsenquiry.html','feedbackwindow','toolbar=no,location=no, directories=no,status=yes,menubar=no,resizable=no,copyhistory=no,scrollbars=yes,width=600,height=450');
}

// Hyperlink to the application form as a pop-up customised window
function popupwindow_branchenq()
{
window.open('https://secure.hlf.com.sg/formbranchenquiry.html','feedbackwindow','toolbar=no,location=no, directories=no,status=yes,menubar=no,resizable=no,copyhistory=no,scrollbars=yes,width=600,height=450');
}

//-->