<!--
function totalChecked(field)
{
	if (field[0]!=null)
	{
		var count=0;
		for (i = 0; i < field.length; i++)
			if (field[i].checked)
				count++;
		return count;
	}
	else
	{
		return field.checked ? 1:0;
	}
}
function addOption(optionObj, value, text)
{
	optionObj.options[optionObj.length] = new Option(text, value);
}
function checkField(field, bool)
{
	if (field)
	{
		if (typeof(field.length)=='undefined')
			field.checked = bool;
		else			
			for (i = 0; i < field.length; i++)
				field[i].checked = bool;
	}
}

function popup1(pagename, pagewidth, pageheight, windowname)
{
	if (screen)
    {
    	var L = (screen.width - -300) / 2;
		var H = (screen.height - 200) / 2;
	}
	jmwindow = window.open(pagename, windowname,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width="
                                   + pagewidth + ",height=" + pageheight + ",left=" + L + ",top=" + H);
	jmwindow.focus();
}
function uncheck_all(field)
{
	if (typeof(field.length)=='undefined')
		field.checked = false ;
	else			
		for (i = 0; i < field.length; i++)
			field[i].checked = false ;
}
function check_all(field)
{
	if (typeof(field.length)=='undefined')
		field.checked = true ;
	else			
		for (i = 0; i < field.length; i++)
			field[i].checked = true ;
}

function EmailValid(EmailID)
{
	var ValidEmail = new RegExp("^(([a-z_0-9-']+)|([a-z_0-9-']+[\.]([a-z_0-9-']+[\.]){0,}[a-z_0-9-']{1,}))[@]((([a-z_0-9-']+)[\.]){1,})(([a-z_0-9-']+))$","ig");
	   		//var ValidEmail = /^([\w\.'-]+@)([\w\.'-]+)\.([\w\.'-]+)[^\.]$/ig;
	return ValidEmail.test(EmailID);
}

function trim(obj)
{
	obj.value = obj.value.replace (/^\s+/, '');
	obj.value = obj.value.replace (/\s+$/, '');
	return obj.value;
}

function jm_popup (url, title, w, h, t, l, s)
{
	var scroll = (typeof(s) == 'undefined') || !s ? 0 : 1;
	if (typeof(t) == 'undefined') t=10;
	if (typeof(l) == 'undefined') l=10;
	if (t==-1) t = (screen.height-h)/2;
	if (l==-1) l = (screen.width-w)/2;	

	title = title.replace("-", "");

	var x = window.open(url, title,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=" + scroll + ",resizable=1,width=" + w + ",height=" + h + ",top=" + t + ",left=" + l);

	x.focus();
	return x; 
}
function jm_help(page_id, section_id)
{
	var L = (screen.width-670);
	if (typeof(section_id) == 'undefined')
	{
		section_id='';
	} 
	else
	{
		section_id='#' + section_id;
	}
	m=window.open("/cgi-bin/help.pl?page_id=" + page_id + section_id,"Help","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=650,height=597,left="+L+",top=0"); 
	m.focus();
}
function copy_form_to_popup (w, f, method, action, enctype)
{
	w.document.write("<HTML><BODY><FORM method='" + method + "' action='" + action + "'");
	if (typeof(enctype) != 'undefined')
	{
		w.document.write(" enctype='" + enctype + "'");
	}
	w.document.write(">");
		
	for (var x=0; x<f.elements.length; x++)
	{
		var ok = true;
		if ((f.elements[x].type!='checkbox' && f.elements[x].type!='radio')
		|| f.elements[x].checked)
		{		
		 	w.document.write("<input type='hidden' name='" + f.elements[x].name + "' value='" + escape(f.elements[x].value) + "'>");
		}
	}
	w.document.write("</form></body></html>");
	w.document.close();
	w.document.forms[0].submit();
}
 
function getURL(urlstring)
{
	MM_goToURL('parent',urlstring);
	return document.MM_returnValue;
}
function MM_goToURL()
{
	var i, args=MM_goToURL.arguments;
	document.MM_returnValue = false;
	for (i=0; i<(args.length-1); i+=2)
		eval(args[i]+".location='"+args[i+1]+"'");
}
-->
