function postemHelp(url){
	var nWidth = 575;
	var nHeight = 500;
	var 
pop=window.open(url,"pHelp","left=15,top=15,width="+nWidth+",height="+nHeight+",directories=no,toolbar=no,status=yes,copyhistory=no,resizable=yes,menubar=no,scrollbars=yes");
	if (!pop.opener) pop.opener = self;
	pop.focus();
}

function vaidatePostemForm(){
	  f=document.PostemForm;
	  if(f.nName.value.trim()==''){alert("Sorry, You must enter your name.");f.nName.focus();return false;}
	  if(f.nEmail.value.trim()==''){alert("Sorry, You must enter an email addres.");f.nEmail.focus();return false;}
	  if(bad_email(f.nEmail.value)){alert("Sorry, You entered an invalid email address.");f.nEmail.focus();return false;}
	  if(f.nNote.value.trim()==''){alert("Sorry, You must enter a note.");f.nNote.focus();return false;}
	  if(f.nPasswd.value.trim()==''){alert("Sorry, You must enter a password.");f.nPasswd.focus();return false;}
	  f.hv.value='OK';
	  return true;
}

var bDebug=false;

function toggleObject(s){
	if (isEmpty(s)) return false;
	s = ("document.getElementById('" + s + "')");
	var o = eval(s);
	if (isEmpty(o))return false;
	if(o.style.display == "none"){
		o.style.display = "";
	} else {
		o.style.display = "none";
	}
}

function hideObject(s){
if (isEmpty(s)) return false;
s = ("document.getElementById('" + s + "')");
var o = eval(s);
if (isEmpty(o))return false;
o.style.display = "none";
}

function isEmpty(s) {
return (s == null || s.length == 0 || s == "")
}

function showObject(s){
//send only object name. not form.[whatever]. using document.all, and it only needs a name.
if (bDebug == true) alert( "function showObject\n"+ "s\n" + s );
if (isEmpty(s)) return false;

s = ("document.getElementById('" + s + "')");
var o = eval(s);

if (isEmpty(o))
{
if (bDebug == true) alert( "function showObject\n"+ "Unable to get object\n" + s );
return false;
}
o.style.display = "";
return true;
}

function limitText(limitField, limitCount, limitNum) {
	if (limitField.value.length > limitNum) {
		limitField.value = limitField.value.substring(0, limitNum);
	} else {
		limitCount.value = limitNum - limitField.value.length;
	}
}

function bad_email(emailaddr){
var emailFilter=/^.+@.+\..{2,3}$/;
if (!(emailFilter.test(emailaddr))) {
       return true;
}
var illegalChars= /[\(\)\<\>\,\;\:\\\/\"\[\]]/
if (emailaddr.match(illegalChars)) {
      return true;
}
return false;
}

String.prototype.trim = function () { return this.ltrim().rtrim() }
String.prototype.ltrim = function () { return this.replace(/^\s+/g, "") }
String.prototype.rtrim = function () { return this.replace(/\s+$/g, "") }

function pMail(theURL) {
var nWidth = 550;
var nHeight =330;
var nXpos = (screen.availWidth - nWidth) / 2;
var nYpos = (screen.availHeight - nHeight) / 2;
var 
newWin=window.open(theURL,'popup',"left="+nXpos+",top="+nYpos+",width="+nWidth+",height="+nHeight+",directories=no,toolbar=no,status=yes,copyhistory=no,resizable=yes,menubar=no,scrollbars=yes");
if (!newWin.opener) newWin.opener = self;
newWin.focus();
}
