<!--
function process_frmSearch(frm) {
	// get value and remove whitespace
	var searchtxt = frm.searchtxt.value.trim();
	frm.searchtxt.value = searchtxt;
	var msg = document.getElementById("search_msg"); 
	if (searchtxt=='') {
		msg.innerHTML = "Enter search text!";
		return false;	
	}
	else {
		msg.innerHTML = "";
		return true;
	}
}

function addBookmark() {
	var url	= "http://www.perfectcharm.co.uk";
	var title	= "PerfectCharm.co.uk ... the gift for every occasion"; 

	var ua 	= navigator.userAgent.toLowerCase();
	var isKonq	= (ua.indexOf('konqueror') != -1);
	var isSafari= (ua.indexOf('webkit') != -1);
	var isMac	= (ua.indexOf('mac') != -1);
	var btnStr	= (isMac) ? 'Command/Cmd' : 'CTRL';

	if (window.external && (!document.createTextNode || (typeof(window.external.AddFavorite)=='unknown'))) {
		window.external.AddFavorite(url, title); // IE/Win
	} 
	else if(isKonq) {
		alert('Press CTRL + B to bookmark our site.');
	} 
	else if(window.opera) {
		alert('To bookmark this site you will \nneed to do so manually through your browser.');
	} 
	else if(window.home || isSafari) { // Firefox, Netscape, Safari, iCab
		alert('Press ' + btnStr + ' + D to bookmark our site.');
	} 
	else if(!window.print || isMac) { // IE5/Mac and Safari 1.0
		alert('Press Command/Cmd + D to bookmark our site.');    
	} 
	else {
		alert('To bookmark this site you will \nneed to do so manually through your browser.');
	}
	return false;
}

// extend String object to provide regular expression matching against defined patterns:
var INT 		= /^-{0,1}\d+$/
var POS_INT 	= /^\d*$/;
var NEG_INT 	= /^-\d+$/;
var NONZERO_INT 	= /^[1-9]+\d*$/;
var NUMBER 		= /^-{0,1}\d*\.{0,1}\d+$/;
var POS_NUMBER 	= /^\d*\.{0,1}\d+$/;
var NEG_NUMBER 	= /^-\d*\.{0,1}\d+$/;
var ALPHA		= /^[A-Z]+$/i;
var ALPHPASPACE	= /^[A-Z ]+$/i;
var ALPHANUM	= /^[A-Z0-9]+$/i;
var ALPHANUMSPACE = /^[A-Z0-9 ]+$/i;
var EMAIL		= /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i;
var NAME		= /^[A-Z .'-]+$/i;

String.prototype.isType = function(regex) {
	if (this.match(regex)) {
		return true;
	}
	else {
		return false;
	}
}

// extend String object to provide function to trim whitespace
String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}

// extend String object to provide function to trim whitespace
// and convert inner whitespace sequences to single spaces
String.prototype.trimAndCompact = function() {
	return this.replace(/^\s+|\s+$/g,"").replace(/\s+/g, ' ');
}

//-->

