<!--

function checkall($string, $formname)
{
   var $el = eval("document.forms."+$formname)

	for (var $i = 0; $i < $el.length; $i++)
	{
	   if ($el.elements[$i].name.match($string) && $el.elements[$i].type=='checkbox' && !$el.elements[$i].disabled)
	   {
			if ($el.elements[$i].checked)
			{
            $el.elements[$i].checked = false
         } else {
            $el.elements[$i].checked = true;
         }
	   }
	}
}

function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function swapImage()
{
   var i,j=0,x,a=swapImage.arguments;
   document.MM_sr=new Array;
   for(i=0; i<(a.length-2); i+=3)
   {
      if ((x=MM_findObj(a[i])) != null)
      {
         if (a[i+2])
         {
            document.MM_sr[j++]=x;
            if (!x.oSrc) x.oSrc=x.src;
            x.src=a[i+2];
         }
      }
   }
}

function popUpWindowaddr(URLStr, width, height)
{
   var left = (screen.width - width) / 2;
   var top = (screen.height - height) / 2;
   popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=yes,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function popUpImage(URLStr, width, height)
{
   var imageFile = document.images['pictures'].src;
   imageFile = imageFile.substring(imageFile.lastIndexOf("\/")+1,imageFile.length);
   URLStr = URLStr + imageFile;
   var left = (screen.width - width) / 2;
   var top = (screen.height - height) / 2;
   popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbars=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function textCounter(field, countfield, maxlimit)
{
   if (field.value.length > maxlimit)
   {
      field.value = field.value.substring(0, maxlimit);
   } else {
      countfield.value = maxlimit - field.value.length;
   }
}

function verify_pw()
{
   if (document.myForm.u_password_one.value=="")
   {
      alert("Please enter password");
      return false;
   }

   if (document.myForm.u_password_two.value=="")
   {
      alert("Please confirm password");
      return false;
   }

   if (document.myForm.u_password_one.value.length < 6)
   {
      alert("Password must be at least 6 characters long and no longer then 20 characters");
      return false;
   }
}

function fixElement(element, message) {
alert(message);
element.focus();
}

function isFormReady(form) 
{
   var passed=false;
   if (form.keywords.value == "") 
   {
      fixElement(form.keywords, "Please enter something to search for!");
   }else {
      passed=true;
   }
   return passed;
}

function ViewCrossReference (selSelectObject)
{
if(selSelectObject.options[selSelectObject.selectedIndex].value != "")
{
location.href=selSelectObject.options[selSelectObject.selectedIndex].value
}
}

var popUpWin=0;
function popUpWindow(URLStr, width, height)
{
   var left = (screen.width - width) / 2;
   var top = (screen.height - height) / 2;
   popUpWin = open(URLStr, 'popUpWin','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top+'');
}

var submitcount=0;

function checkClicks()
{
   if (submitcount == 0)
   {
      submitcount++;
      return true;
   } else {
      return false;
   }
}
// End -->