
function NewWindow(mypage,myname,w,h,scroll,locat,direct,stat,men,tool,res,pos) {
var win=null;
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location='+locat+',directories='+direct+',status='+stat+',menubar='+men+',toolbar='+tool+',resizable='+res+'';
win=window.open(mypage,myname,settings);
win.focus();
}


function field_check(names, fieldlabels) {
   var fields = new Array();
   var k = 0;
   for (i=0; i<names.length; i++) {
      if (document.form1.elements[names[i]].value == "") {
	     fields[k] = fieldlabels[i];
		 k++;
	  }
   }
   if (fields.length>0) {
	  var result = "The field(s) '" + fields.join(", ") + "' should be is filled !!";
      alert(result);
      return false;
   }
   return true;
}

