function validateForm(form,fields){
	
	var form;
	var err = "";
	var fields = fields.split(",");
	
	for(i=0;i<fields.length;i++){
		fieldName = fields[i];
		value = form.elements[fieldName].value;
		name  = form.elements[fieldName].id;
		if(value.length<1){err += "" + name + " is required. \n";}
	}
	if(err.length>0){alert(err);return false;}else{return true;}
}

function windowPop(fileSource) {
 	popWin=window.open(fileSource, "popUp","width=512,height=384,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0");
	popWin.focus();
}

function windowPopSize(fileSource, width, height) {
    cw = Math.floor(((screen.availWidth-width)/2)-100);
    ch = Math.floor(((screen.availHeight-height)/2)-200);
 	popWin=window.open(fileSource, "popUp","width="+width+",height="+height+",toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=1,top="+ch+",left="+cw+"");
	popWin.focus();
}

function focusField(fieldName){
	document.forms['f'].elements[fieldName].focus();
}

function switchParent(obj,page){
	var loc = page + obj.options[obj.selectedIndex].value;
	document.location.href=loc;
}

function swapClass(obj,css){
	obj.className = css;
}

function xstandardHandler(numHandlers){
	for(i=1;i<=numHandlers;i++){
		eval('xstandardHandler' + i + '()');
	}
}

function confirmDelete() {
	var agree=confirm("Are you sure you wish to delete?\rThis operation can not be undone");
	if (agree)
		return true ;
	else
		return false ;
}

function focusField(fieldName){
	document.forms['f'].elements[fieldName].focus();
}

function windowPop(fileSource) {
 	popWin=window.open(fileSource, "popUp","width=560,height=520,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1");
	popWin.focus();
}

function windowPopSize(fileSource, width, height) {
    cw = Math.floor(((screen.availWidth-width)/2)-100);
    ch = Math.floor(((screen.availHeight-height)/2)-200);
 	popWin=window.open(fileSource, "popUp","width="+width+",height="+height+",toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=1,top="+ch+",left="+cw+"");
	popWin.focus();
}

function sendToPrinter(text){
	text=document
	print(text)
}


