//turn form validation off- other pages might turn it on later
var validate=0;

//capture mouse events
if(document.captureEvents) {document.captureEvents(Event.MOUSEMOVE);}


////////////////detect browser/////////////////////////////////////////

var ie, ns, ver, br;

if (navigator.appName == "Netscape") {
   br="ns";ns =1;
} else {
   br="ie";ie=1;
}
ver = navigator.appVersion.substring(0,1);


////////////////Generic image swapping functions///////////////////////

document.lastImgs = new Array;

function PreloadImages() { 
  images = new Array;
  for (x=0; x<PreloadImages.arguments.length; x++) {
  	images[x]=new Image;
  	images[x].src=PreloadImages.arguments[x];
  	}
}

function SwapImage () {
  if (document.images) {
   if (document.lastImgs.length) {
      RestoreImage();
   }
   a = SwapImage.arguments;
   inum = 0;
   for (x = 0; x < a.length; x+=2) {
      oldimg = a[x];
      newimg = a[x+1];
         
      document.images[oldimg].oldsrc = document.images[oldimg].src;
      document.images[oldimg].src=newimg;
      
      document.lastImgs[inum] = oldimg;
      inum++;
   
    }
  }
}

function RestoreImage () {
  if (document.images) {
   for (x = 0; x < document.lastImgs.length; x++) {
      img = document.lastImgs[x];
      document.images[img].src=document.images[img].oldsrc;
   }
   document.lastImgs = new Array;
  }
}

function newWindow(url, height, width, nameW, scrollbars) {
    if (nameW==""){nameW='popup';}
    if (scrollbars == "") {scrollbars = 0;}
 if (navigator.appVersion >= 4) {
 // Vars for centering the new window on Version 4 Browsers
 xTop = screen.width/2 - (width/2);
 yTop = screen.height/2 - (height/2);
 p = window.open(url, nameW, 'height='+height+',width='+width+',scrollbars='+scrollbars+',resizable=0,menubar=0,toolbar=0,status=0,location=0,directories=0,left=' + xTop + ',top=' + yTop + '');
 } else {
 p = window.open(url, nameW, 'height='+height+',width='+width+',scrollbars='+scrollbars+',resizable=0,menubar=0,toolbar=0,status=0,location=0,directories=0,left=150,top=200');
 }
 p.focus();
}

function submitenter(myfield,e,action)
{
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;

if (keycode == 13)
   {
   eval(action);
   return false;
   }
else
   return true;
}
