function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function validateForm() {var i,p,nm,test,args=validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) {nm=val.name; if ((val=val.value)!="") {
		if (test.charAt(0) == 'R') document.form1.elements[nm].style.background = '#FFF';
			if (test.indexOf('isEmail')!=-1) {
			  var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
			  if (filter.test(val)) {document.form1.elements[nm].style.background = '#FFF';} else {document.form1.elements[nm].style.background = '#FCC';}
			}
     	}
	 	else if (test.charAt(0) == 'R') document.form1.elements[nm].style.background = '#FCC'; 
	}
  } 
}
function openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function clearText(thefield){
	if (thefield.defaultValue==thefield.value) {
	thefield.value = '';
	}
}	

function openPopup(url, width, height, resizable, toolbar, menubar) {var args = new Array();
if (width){width = Math.min(width, screen.availWidth);args.push("width=" + width);args.push("left=" + (screen.width - width)/2);}
if (height){height = Math.min(height, screen.availHeight);args.push("height=" + height);args.push("top=" + (screen.height - height)/2);}
if (resizable){args.push("resizable=yes,scrollbars=yes");}if (toolbar){args.push("toolbar=yes");} if (menubar){args.push("menubar=yes");} window.status=args.join();window.open(url, '', args.join());return false;}

function generate_address(suffix, hostname, username) {var atsign = '&#64;';var addr = username + atsign + hostname + '.' + suffix;	document.write( '<' + 'a' + ' ' + 'href="' + 'mail' + 'to:' + addr + '">' + addr + '<\/a>');}
