function doMouseOvr(obj,color){
	if(obj){
		obj.bgColor=color;
	}
}
function doMouseOut(obj,color){
	if(obj){
		obj.bgColor=color;
	}
}

function setAction(a1, a2, a3) {
  window.document.frm_main.a1.value = a1;
  window.document.frm_main.a2.value = a2;
  window.document.frm_main.a3.value = a3;
  window.document.frm_main.submit(true);
}

function setAction(a1,a2,a3){
if(document.getElementById('a1')){document.getElementById('a1').value = a1};
if(document.getElementById('a2')){document.getElementById('a2').value = a2};
if(document.getElementById('a3')){document.getElementById('a3').value = a3};
//alert(a1 + ' ' + a2 + ' ' + a3);
window.document.frm_main.submit(true);
}

function returnInt(val){
if(val==true){return 1;}else{return 0;}
}

function confDelete(){
if(confirm('Are you sure you wish to delete this record?')){return true;}
}

var dialogArguments;
function uploadForm(field) {

  dialogArguments1 = field;
  var posY, posX;
  posY = 0; posX = 0;

  posY = (screen.availHeight / 2);
  posX = (screen.availWidth / 2) - (250 / 2);

  nw=window.open('uploadFile.php','ss','toolbar=no; top='+posX+'; left='+posX+'; width=250px; height=240px');
  nw.focus;
}

function setDate(sControl,sObj){
var dtsep="/";
	var dd = document.getElementById(sObj+'dayfld').value;
    var mm = document.getElementById(sObj+'monthfld').value;
    var yy = document.getElementById(sObj+'yearfld').value;
    //var hh = document.getElementById('hourfld').value;
    //var nn = document.getElementById('minutefld').value;
    //var ss = document.getElementById('secondfld').value;

    theDate = yy + dtsep + mm + dtsep + dd; //+ ' ' + hh + tmsep + nn + tmsep + ss
    document.getElementById(sControl).value = theDate;
}

function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}

function checkrequiredall(which) 
{ 
var pass=true;
var msg=''; 
var shortFieldName;

if (document.images) 
{
for (i=0;i<which.length;i++) 
 {
  var tempobj=which.elements[i]; 
  if (tempobj.name.substring(0,21)=='oFeedback$txtrequired'||tempobj.name.substring(0,11)=='oFeedback$cborequired'||tempobj.name.substring(0,11)=='oFeedback$calrequired') 

  {
   if (tempobj.type=='text'||tempobj.type=='textarea'||tempobj.type=='file'||tempobj.type=='select-one') 
    { 
     if (tempobj.value==''||tempobj.selectedIndex==0||tempobj.selectedValue==''||tempobj.value==' '||tempobj.value=='Select Date') 
     { 
      pass=false;
      shortFieldName=tempobj.name.substring(21,50).toUpperCase();
      msg+='Please make sure the '+shortFieldName+' field was completed.\n'; 
     } 
    } 
   } 
  } 
 } 
if (!pass) 
 {
  shortFieldName=tempobj.name.substring(11,30).toUpperCase(); 
  alert(msg);
  return false; 
 } 
 
 if (pass) 
 {
  shortFieldName=tempobj.name.substring(11,30).toUpperCase(); 
  return true; 
 } 
}
//================================
