function dosearch() {
  var sf=document.searchform;
  var search = sf.search.value;
  search = escape(search);
  search = search.replace(/\+/gi, "%2B");
  var submitto = sf.sengines.options[sf.sengines.selectedIndex].value + search;
  window.location.href = submitto;
  return false;
}


function PrinterFriendlyVersion(Title) {
    var pp = window.open();
    pp.document.writeln(document.getElementById(Title).innerHTML);
    pp.print();
}
var ImageWindow
function popup1(image, target) {
var ImageWindow = window.open("", target, 'toolbar=0,scrollbars=yes,resizable=yes,menubar=no');
  ImageWindow.document.write("<html>\n<head>\n</head>"); 
  ImageWindow.document.write("\n<body>\n<center>\n<IMG border=0 SRC='" + image + "' BORDER=0 name='" + target + "'>"); 
  ImageWindow.document.write("\n<br><A href='javascript: self.close ()'>Close Window</A>\n</center>\n</body>\n</html>");
  ImageWindow.document.close();
  ImageWindow.focus();
  return false;
}


function mypopup(image) {
 ImageWindow=window.open(image, "Item","toolbar=0,scrollbars=yes,resizable=yes,menubar=no,width=300,height=250");
 ImageWindow.document.write("<CENTER><IMG border=0 SRC='" + image + "' BORDER=0 name='" + image + "'>"); 
 ImageWindow.document.write("<br><A href='javascript: self.close ()'>Close Window</A></CENTER>");
 ImageWindow.document.close();
} 


function popup2(image) {
 ImageWindow=window.open("", "Item","toolbar=0,scrollbars=yes,resizable=yes,menubar=no,width=300,height=250");
 ImageWindow.document.write("<CENTER><IMG border=0 SRC='" + image + "' BORDER=0 name='" + image + "'>"); 
 ImageWindow.document.write("<br><A href='javascript: self.close ()'>Close Window</A></CENTER>");
 ImageWindow.document.close();
} 

function toggleTRColor(field, color) { 
  P1 = field.parentNode; 
  P2 = P1.parentNode; 
  if (field.checked == true) { 
    P2.style.backgroundColor = color; 
  } else { 
    P2.style.backgroundColor = ''; 
  } 
}

function togglechecked(field, color) {
  icount = 0;
  itotal = 0;
  form = field.form;
  for (i = 0; i < form.length; i++)
    if (form.elements[i].name == field.name) 
      if (form.elements[i].type == 'checkbox')
        if (form.elements[i].value != '') {
          itotal++
		  if (form.elements[i].checked)
		    icount++
	    }
   for (i = 0; i < form.length; i++)
     if (form.elements[i].name == field.name) 
       if (form.elements[i].type == 'checkbox')
         if (field.value == '') {
           form[i].checked = field.checked? true:false
		   toggleTRColor(form[i], color)
         } else {
		   if (form.elements[i].value == '')
             form[i].checked = (itotal == icount)
			 toggleTRColor(form[i], color)
         }
}


self.focus();
//self.resizeTo(100,200);
function refreshParent2() {
  if (window.opener.location != '') {
    window.opener.location.href = window.opener.location.href;
    if (window.opener.progressWindow) {
      window.opener.progressWindow.close()
    }
    window.close();
  }
}


  function refreshParent() {
    if (window.opener!=undefined) {
      window.opener.location.href = window.opener.location.href;
      if (window.opener.progressWindow) {
	    window.opener.progressWindow.close()
      }
	}
  }



function mypopup2(strurl) {
  myWindow = window.open(strurl, "tinyWindow") 
  //myWindow.document.bgColor="lightblue"
  myWindow.document.close() 
}


function TACounter(obj) {
  if (obj.getAttribute) {
    var mlength=obj.getAttribute ? parseInt(obj.getAttribute("maxlength")) : "";
    var TACounter = document.getElementById( obj.name + "Counter" );
    if (mlength > 0) {
      window.status = obj.getAttribute("maxlength") + ' ' + obj.value.length;
      var iLength = obj.value.length;
      //obj.value=obj.value.substring(0,mlength)
	  if ( iLength == mlength ) {
	    TACounter.innerHTML = "<font color='black'>No more </font> characters remaining";
	  } else if ( (iLength + 1) == mlength ) {
	    TACounter.innerHTML = "<font color='black'>" + (mlength - iLength) + "</font> character remaining";
	  } else if ( iLength < mlength ) {
	    TACounter.innerHTML = "<font color='black'>" + (mlength - iLength) + "</font> characters remaining";
	  } else {
	    TACounter.innerHTML = "<font color='red'>" + (mlength - iLength) + "</font> Too many characters";
      }
	}
  } else {
    TACounter.innerHTML = "";
  }
}

<!-- // Hide 
//<![CDATA[
var myform
  function popupform(url, windowname) {
    var feature = ''
	//, width, height
    //feature += 'width=' + width + ',' + 'height=' + height 
    feature += 'toolbar=no, status=no, filemenu=no, resizable=yes, scrollbars=yes'

    myform = window.open(url, windowname, feature);
    if (myform) 
      myform.focus();
    return false;
  }
 //]]>
//--> Show

var mypopupImage = null   
//*************************************************************
function popupImage(picURL, picTitle) {
//*************************************************************
  var cssMargin = 0
  
  //*** preload image files
  var picName = new Image()
  picName.src = picURL

  var xSize = picName.width  + cssMargin * 2 + 4
  var ySize = picName.height + cssMargin * 2 + 19 + 4 + 50

  var iLeft = parseInt((window.screen.width  / 2) - (xSize / 2))
  var iTop  = parseInt((window.screen.height / 2) - (ySize / 2))

  mypopupImage = window.open(picURL, 'mypopupImage', 'toolbar=no, resizable=yes, width=' + xSize + ', height=' + ySize + ', left=' + iLeft + ', top=' + iTop + '')

  mypopupImage.focus()

  //*** Build Content
  var html = ""

  html += '<html>\n<head>\n<title>' + picTitle + '<\/title>'

  html += '\n<scr' + 'ipt language="Javascr' + 'ipt">'

  html += '\nvar NS = (navigator.appName == "Netscape") ? true : false;'
  html += '\nfunction FitPic(id) {'
  html += '\n  iWidth   = (NS) ? window.innerWidth  : document.body.clientWidth;'
  html += '\n  iHeight  = (NS) ? window.innerHeight : document.body.clientHeight;'

  html += '\n  var obj  = document.getElementById(id)'
  html += '\n  idWidth  = obj.offsetWidth'
  html += '\n  idHeight = obj.offsetHeight;'

  html += '\n  iWidth   = idWidth  - iWidth;'
  html += '\n  iHeight  = idHeight - iHeight;'

  html += '\n  window.resizeBy(iWidth, iHeight);'
  html += '\n  self.focus();'
  html += '\n};'

  html += '\nfunction getWidth(id) {'
  html += '\n  var obj = document.getElementById(id)'
  html += '\n  alert(obj.offsetWidth + ", " + obj.offsetHeight);'
  html += '\n}'

  html += '\n</scr' + 'ipt>'


  html += '\n<style>'
  html += '\nbody {margin:' + cssMargin + '}'
  html += '\n</style>'
  
  html += '\n</head>\n<body>'
  html += '\n<div id="image">'
  html += '\n<img src="' + picURL + '">'
  html += '\n<center>\n<a href="javascript:self.close()">Close Window</a>\n</center>'
  html += '\n</div>'
  //*** Custom Update ***
  //html += '<scr' + 'ipt>' + 'FitPic(\'image\');' + '</scr' + 'ipt>'
  html += '\n</body>'
  html += '\n</html>'
 
  mypopupImage.document.write(html)
  mypopupImage.document.close

  //mypopupImage.resizeTo(xSize, ySize)

  
  return false
} 

//*************************************************************
function keyNumber() {
//*************************************************************
var evt = event
var keyCode = (evt.which) ? evt.which : event.keyCode
var keyChar = String.fromCharCode(keyCode); 
var re = /^[0-9]*$/;
if (!re.test(keyChar))
  return false;
return true;
}

//*************************************************************
function keyFloat() {
//*************************************************************
var evt = event
var keyCode = (evt.which) ? evt.which : event.keyCode
var keyChar = String.fromCharCode(keyCode); 
var re = /^[0-9-'.']*$/;
if (!re.test(keyChar))
  return false;
return true;
}

