///////////////////////////////////////////////////////////////////////////
//
// U L T I M A T E   W E B   M E N U   S Y S T E M
//
// UWMS Cross-browser Javascript Initialization Functions
// Shareware version
//
// Copyright 2000-2001 Tyler Webb, Capsheaf.com, UWMS.com
// All rights reserved.  
//
// Permission is granted to freely use, distribute, and resell this code 
// PROVIDED THE FOLLOWING CONDITIONS ARE MET:
//
//	 1. You register at http://uwms.com and are on our mailing list
//   2. You notify anyone you distribute code to that they must do the same
//	 3. Code is not modified and all copyright notices remain intact.
//
//
// For use with the Ultimate Web Menu System.
// Available for download at http://uwms.com
//
// This is the cross-browser initalization code for the basic 
// menu system.  It only provides one layer of menus.  For more layers of
// menus (drop downs, etc) see http://uwms.com for options.
//
///////////////////////////////////////////////////////////////////////////
//
//
// UWMS Version 0.5
//
// Feel free to modify the default menu button colors...  but nothing else.

var defNormalColor='#000000';
var defOverColor='#666600';

//
// The following shameless ADS MAY NOT BE REMOVED from the SHAREWARE
// version of the menu system.  Please visit the sponsor links to help
// support development of this code...
//


// For the Absolute Best Nutrition Products:
// 
// http://nutrientcentral.com
//


// Low-cost Advanced Web Hosting:
//
// http://capsheaf.com
//


// Free Domain Name Registration with DNS purchase:
//
// http://freedomainname.capsheaf.com
//

// Thank you for using UWMS!  Register or Upgrade Now at http://uwms.com































































///////////////////////////////////////////////////////////////////////////
//
// DO NOT MODIFY ANY OF THE CODE PAST THIS POINT!  This code is copyright
// (c)2000-2001 Tyler Webb and modification constitutes violation of the
// terms of use agreement above. If you need a modified version for use on
// your site, you must pay a modest registration fee of $10 
//
// Instructions for use are available at http://www.uwms.com
//
///////////////////////////////////////////////////////////////////////////

function UWMSFixAttrib(obj,attrib,defval) {
  if (!obj[attrib]) {
    obj[attrib] = defval;
	  for (var c=0; c<obj.attributes.length; c++) {
	    if (obj.attributes[c].nodeName == attrib) {
	      obj[attrib] = obj.attributes[c].nodeValue;
	    }
	  }
	}
}


function UWMSInit() {
	if (document.layers) {
	  var div;
	  for (var i=0; i<document.layers.length; i++) {
	    div = document.layers[i];
	    if (div.id.substr(0,4) == 'item') {
        // setup the colors;
        if (!div.normalColor) div.normalColor = defNormalColor;
        if (!div.overColor) div.overColor = defOverColor;
        div.bgColor = div.normalColor;

				div.onMouseOver = function (e) { e.target.bgColor = e.target.overColor; };
        div.onMouseOut = function (e) { e.target.bgColor = e.target.normalColor; };
        div.onMouseUp = function (e) {window.location = this.href;};
	      div.captureEvents(Event.MOUSEUP);
	    }
	  }
	} else {
	  var aDivs = document.body.getElementsByTagName('DIV');
	  for (var i=0; i<aDivs.length; i++) {
	    var obj = aDivs[i];
	    var div = obj.style;

	    if (obj.id == 'item') {
	    
	        if (!obj.href) {
	          obj.href = '';
		        for (var c=0; c<obj.attributes.length; c++) {
		          if (obj.attributes[c].nodeName == 'href') {
		            obj.href = obj.attributes[c].nodeValue;
		            break;
		          }
		        }
		      }

		      if (!obj.normalColor) {
	          obj.normalColor=defNormalColor;
		        for (var c=0; c<obj.attributes.length; c++) {
		          if (obj.attributes[c].nodeName == 'normalcolor') {
		            obj.normalColor = obj.attributes[c].nodeValue;
		            break;
		          }
		        }
		      }

		      if (!obj.overColor) {
	          obj.overColor=defOverColor;
		        for (var c=0; c<obj.attributes.length; c++) {
		          if (obj.attributes[c].nodeName == 'overcolor') {
		            obj.overColor = obj.attributes[c].nodeValue;
		            break;
		          }
		        }
		      }


	      obj.onclick = function () { window.location = this.href; };
	      obj.onmouseover = function () { this.style.backgroundColor = this.style.overColor; };
	      obj.onmouseout = function () { this.style.backgroundColor = this.style.normalColor; };

        // setup the colors
        div.normalColor = obj.normalColor;
        div.overColor = obj.overColor;
        div.backgroundColor = div.normalColor;

	    }
	  }
	}
}
