﻿// OPEN POPUP WINDOW
function openPopupWin(u,w,h,s,r){pW=window.open(u,'popupWin','width='+w+',height='+h+',left='+((screen.width-w)/2)+',top='+((screen.height-h)/2)+',status=yes,toolbar=no,menubar=no,scrollbars='+s+',resizable='+r);if(!pW.opener){pW.opener=self;}}
// GENERIC PRINT PAGE
function printPage(){window.print?window.print():alert('Your browser does not support this function.\nPlease use the browsers print button.');return false; }
// CROSS BROWSER ADD TO FAVOURITES
function addToFavourites(){if(window.sidebar){window.sidebar.addPanel(document.title,document.location.href,'');}else if(window.external){window.external.AddFavorite(document.location.href,document.title);}else{alert('Your browser does not support this function.\nPlease use the browsers favourite button.');}return false;}
// SOCIAL BOOKMARKS
function socialBookmark(u){u=u.replace('TITLE',encodeURIComponent(document.title));u=u.replace('URL',encodeURIComponent(document.location.href));openPopupWin(u,740,620,'yes','yes');return false;}
//DISABLE ENTER BUTTON ON INPUTBOXES
/***********************************************
* Disable "Enter" key in Form script- By Nurul Fadilah(nurul@REMOVETHISvolmedia.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/               
function handleEnter (field, event) {
		var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
		if (keyCode == 13) {
			var i;
			for (i = 0; i < field.form.elements.length; i++)
				if (field == field.form.elements[i])
					break;
			i = (i + 1) % field.form.elements.length;
			field.form.elements[i].focus();
			return false;
		} 
		else
		return true;
	}      
