<!-- slideshow from: http://www.ricocheting.com/js/
var x = 0;

function rotate(num,theform,imagereference,theimagesrc){


  
x=num % theform.slide.length;
if(x<0)
{
    x=theform.slide.length-1
};
theform.show.src= theform.slide.options[x].value;

if (theimagesrc)
    theimagesrc.href=imagereference[x];

theform.slide.selectedIndex=x;
}

var theformtouse;
function apRotatex(theform) {
    theformtouse  = theform;
    apRotate();
}
    
function apRotate() {
if(theformtouse.slidebutton.value == "Stop"){
rotate(theformtouse,++x);window.setTimeout("apRotate()", 5000);}
}

//end slideshow script-->

<!-- Dreamweaver script for mouse over images
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;   
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function SwitchMenu(obj)
{
   if(document.getElementById)
   {
      if (document.getElementById(obj))
      {
         var el = document.getElementById(obj);
         var ar = document.getElementById('masterdiv').getElementsByTagName('div');
         if(el.style.display != 'block')
         {
            for (var i=0; i<ar.length; i++)
            {
               if (ar[i].className=='sub')
               ar[i].style.display = 'none';
            }
            el.style.display = 'block';
         }else
         {
           el.style.display = 'none';
         }
      }
   }
}

// end dreamweaver mouseover script//-->

// toggle layer script//-->

function toggleLayer(whichLayer, show)
{
	if (document.getElementById)
	{
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
		if(show)
		    style2.display = "";
		 else
		    style2.display ="none";
		//style2.display = style2.display? "":"none";
	}
	else if (document.all)
	{
		// this is the way old msie versions work
		var style2 = document.all[whichLayer].style;
		//style2.display = style2.display? "":"none";
		if(show)
		    style2.display = "";
		 else
		    style2.display ="none";

	}
	else if (document.layers)
	{
		// this is the way nn4 works
		var style2 = document.layers[whichLayer].style;
		//style2.display = style2.display? "":"none";
		if(show)
		    style2.display = "";
		 else
		    style2.display ="none";

	}
}

	/* Function to manually fire the 'change' event (for DOM2 browsers) or 'onchange' event (for IE 5.5+) */
	function fireChangeEvent(sourceObjectId) {
		var fireOnThis = document.getElementById(sourceObjectId);
		if( document.createEvent ) {
		  var evObj = document.createEvent('HTMLEvents');
		  evObj.initEvent( 'change', true, false );
		  fireOnThis.dispatchEvent(evObj);
		} else if( document.createEventObject ) {
		  fireOnThis.fireEvent('onchange');
		}
	}

	/* Function to auto-tab to the next field when the Enter (or CR/LF) characters are pressed, 
	   used on the barcode field - Enter is sent automatically as a terminator by some Barcode readers 
	   also restricts the field to numeric values only.
	   Not to be used in conjunction with the autotab() funtion or you get a double tab event.
	   */
	function enterToTabNumericOnly(input, e) {
		var keynum;
		var keychar;
		var numcheck;

		if(window.event) // IE
		{
			keynum = e.keyCode;
		}
		else if(e.which) // Netscape/Firefox/Opera
		{
			keynum = e.which;
		}
		//alert(keynum);
		var evtobj=window.event? event : e
		
		if (evtobj.ctrlKey || keynum==8 || keynum==127) { //Allow Backspace or Del or Ctrl-anything
			return true;
		} else if (keynum > 8 && keynum < 14 )  { //Tab,CR,LF,Enter
			input.form[(getIndex(input)+1) % input.form.length].focus(); //auto-tab to next field
			return false;
		} else {
			return !(keynum<48||keynum>57) //else allow only numbers
		}
	}
	
	function getIndex(input) {
	    var index = -1, i = 0, found = false;
	    while (i < input.form.length && index == -1)
	    if (input.form[i] == input)index = i;
	    else i++;
	    return index;
	  } 
	  
	/*
	//See http://www.soxiam.com/Code/JavascriptAutoTab
	var isNN = (navigator.appName.indexOf("Netscape")!=-1);
	function autoTab(input,len, e) {
	  var keyCode = (isNN) ? e.which : e.keyCode; 
	  var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
	  if(input.value.length >= len && !containsElement(filter,keyCode)) {
	    input.value = input.value.slice(0, len);
	    input.form[(getIndex(input)+1) % input.form.length].focus();
	  }
	
	  function containsElement(arr, ele) {
	    var found = false, index = 0;
	    while(!found && index < arr.length)
	    if(arr[index] == ele)
	    found = true;
	    else
	    index++;
	    return found;
	  }
	  return true;
	}
	*/

	/* Function used by the commercialProduct autocomplete textboxes, to strip off the ManufacturerName*/
	function stripManufacturerName(fullString) {
		var retVal = "";
		if (fullString != null) {
			//the separator " - (" is defined in CommercialProduct.getAutoCompleteDescription()
			var separatorRegExp = / - \(/; 
			var separatorPos = fullString.search(separatorRegExp);
			if (separatorPos > 0) {
				retVal =  fullString.substring(0,separatorPos);
			}			
		}
		return retVal;
	}
	
		
	function trim(str) {
		return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
	}
	
	function displayPageHelp(helpId) {
		window.open(helpId, "_helpWindow","left=100,top=100,height=500,width=900,toolbar=no,location=no,menubar=no,status=no,scrollbars=yes");
	}
	
	
/**

   Created by: Michael Synovic;

   on: 01/12/2003

   This is a Javascript implementation of the Java Hashtable object.

Copyright (C) 2003  Michael Synovic

This library is free software; you can redistribute it and/or

modify it under the terms of the GNU Lesser General Public

License as published by the Free Software Foundation; either

version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,

but WITHOUT ANY WARRANTY; without even the implied warranty of

MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU

Lesser General Public License for more details.

   Contructor(s):

    Hashtable()

             Creates a new, empty hashtable

   Method(s):

    void clear()

             Clears this hashtable so that it contains no keys.

    boolean containsKey(String key)

             Tests if the specified object is a key in this hashtable.

    boolean containsValue(Object value)

             Returns true if this Hashtable maps one or more keys to this value.

    Object get(String key)

             Returns the value to which the specified key is mapped in this hashtable.

    boolean isEmpty()

             Tests if this hashtable maps no keys to values.

    Array keys()

             Returns an array of the keys in this hashtable.

    void put(String key, Object value)

             Maps the specified key to the specified value in this hashtable. A NullPointerException is thrown is the key or value is null.

    Object remove(String key)

             Removes the key (and its corresponding value) from this hashtable. Returns the value of the key that was removed

    int size()

             Returns the number of keys in this hashtable.

    String toString()

             Returns a string representation of this Hashtable object in the form of a set of entries, enclosed in braces and separated by the ASCII characters ", " (comma and space).

    Array values()

             Returns a array view of the values contained in this Hashtable.

    Array entrySet()

             Returns a reference to the internal object that stores the data. The object is backed by the Hashtable, so changes to the Hashtable are reflected in the object, and vice-versa.

*/

function Hashtable(){

   this.hashtable = new Object();

}

/* privileged functions */

Hashtable.prototype.clear = function(){

   this.hashtable = new Object();

}              

Hashtable.prototype.containsKey = function(key){

   var exists = false;

   for (var i in this.hashtable) {

       if (i == key && this.hashtable[i] != null) {

           exists = true;

           break;

       }    

   }

   return exists;

}

Hashtable.prototype.containsValue = function(value){

   var contains = false;

   if (value != null) {

       for (var i in this.hashtable) {

           if (this.hashtable[i] == value) {

               contains = true;

               break;

           }

       }

   }        

   return contains;

}

Hashtable.prototype.get = function(key){

   return this.hashtable[key];

}

Hashtable.prototype.isEmpty = function(){

   return (parseInt(this.size()) == 0) ? true : false;

}

Hashtable.prototype.keys = function(){

   var keys = new Array();

   for (var i in this.hashtable) {

       if (this.hashtable[i] != null)

           keys.push(i);

   }

   return keys;

}

Hashtable.prototype.put = function(key, value){

   if (key == null || value == null) {

       throw "NullPointerException {" + key + "},{" + value + "}";

   }else{

       this.hashtable[key] = value;

   }

}

Hashtable.prototype.remove = function(key){

   var rtn = this.hashtable[key];

   this.hashtable[key] = null;

   return rtn;

}    

Hashtable.prototype.size = function(){

   var size = 0;

   for (var i in this.hashtable) {

       if (this.hashtable[i] != null)

           size ++;

   }

   return size;

}

Hashtable.prototype.toString = function(){

   var result = "";

   for (var i in this.hashtable)

   {    

       if (this.hashtable[i] != null)

           result += "{" + i + "},{" + this.hashtable[i] + "}\n";  

   }

   return result;

}                                  

Hashtable.prototype.values = function(){

   var values = new Array();

   for (var i in this.hashtable) {

       if (this.hashtable[i] != null)

           values.push(this.hashtable[i]);

   }

   return values;

}                                  

Hashtable.prototype.entrySet = function(){

   return this.hashtable;

}