function BrowserDetect() {
	var platform = navigator.platform													// variable for computer platform
	if (platform=="Win32") this.platform = "win"										// set parameters for Windows 32 bit
	else if (platform=="MacPPC") this.platform = "mac"								// set parameters for Power Macintosh
	this.win = (this.platform=="win")													// set for Windows
	this.mac = (this.platform=="mac")													// set for Machintosh
	//*********************************************************************************************************************
	var browser = navigator.appName														// variable for browser
	if (browser=="Microsoft Internet Explorer") this.browser = "ie"			// set parameters for Internet Explorer
	else if (browser=="Netscape") this.browser = "ns"								// set parameters for Netscape Navigator
	else if (browser=="WebTV") this.browser = "webtv"								// set parameters for WebTV
	else this.browser = browser															// set parameters for all other browsers
	//*********************************************************************************************************************
	this.webtv = (this.browser=="webtv")												// set WebTV
	this.webtv = (navigator.userAgent.indexOf('WebTV') > 0)						// set WebTV version
	this.ie = (this.browser=="ie")														// set Internet Explorer
	this.ie4 = (navigator.userAgent.indexOf('MSIE 4') > 0)						// set first version for Internet Explorer
	this.ie5 = (navigator.userAgent.indexOf('MSIE 5') > 0)	
	this.ie5above = (((parseInt(navigator.appVersion.substr(navigator.appVersion.indexOf('MSIE') + 4)) >= 5)) && (this.ie))	// set second version for Internet Explorer
	this.ver = parseInt(navigator.appVersion)											// set Netscape Navigator version
	this.ns = (this.browser=="ns")														// set Netscape Navigator
	this.ns4 = (this.browser=="ns" && this.ver == 4)								// set first version for Netscape Navigator
	this.ns6 = (this.browser=="ns" && this.ver != 4)								// set second version for Netscape Navigator
}

//*********************************************************************************************************************
var myWin=null;
function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width-w) / 2;
var wint = (screen.height-h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable,location,menubars,toolbar'
//win = window.open(mypage, myname, winprops)
if (!myWin || myWin.closed ) {
			myWin = window.open(mypage, myname, winprops);
			myWin.focus()
			} else{
					myWin=window.open(mypage, myname, winprops);
			 		myWin.focus();
			}
}
//END NEW WINDOW POP-UP

//START POP-DOWN MENU
//determines browser versions
var bV=parseInt(navigator.appVersion);
var ns4 = (document.layers);
var ie4 = (document.all && !document.getElementById);
var ie5 = (document.all && document.getElementById);
var ns6 = (!document.all && document.getElementById);
var opera = navigator.userAgent.indexOf("Opera") > -1;
// newline only wants one menu to be open at a time.
// this is a global variable that simply holds the category id of the last open menu
var openStatus = null;

// write css acording to browser.
// this is also done in javascript so if a user has javascript turned off there is no problems
// their menu will simply show expanded
if (bV >= 4 && !opera) {
         with (document) { //writes css acording to Browser
             write("<STYLE TYPE='text/css'>");
			// NS4 is stupid
			// we need classes for the parent category, child of the parent and everything AFTER the menu
			// this is so that each element can be stcaked on top of each other with floating layers
             if (ns4) {
                 write(".parent {position:absolute;; visibility:visible; left: -200;}");
// child elements are rendered at first so that a scrolbar of sufficient size is rendered
				 write(".child {position:absolute; visibility:hidden; left: -200;}");
				 write(".rest {position:absolute; visibility:visible; left: -200;}");
             }

             else if(ie4 || ie5 || ns6) {
				 // for the smart browsers we simply 'hide' the child element useing a css property
                 write(".child {display:none}")
             }
             write("</STYLE>");
         }
     }
// ns4 is stupid so we need the INDEX of a layer not it's ID.
// ns4 stores an array of all the elements by type
     function getIndex(el) {
         ind = null;
         for (i=0; i<document.layers.length; i++)
		  {
             whatEl = document.layers[i];
             if (whatEl.id == el) {
                 ind = i;
               break;
             }
          } //end of for
         return ind;
     }


// ns4 is stupid so we need to calculate the height and stack all the visable layers on top of each other
function arrange() { //re-aranges emelements on page in proper order for Netscape
if (ns4) {
	if ('newline' == 'wbshop') document.layers[firstInd].pageX = window.innerWidth - 145;
        var nextY = document.layers[firstInd].pageY + document.layers[firstInd].document.height;
	  for (i=firstInd+1; i<document.layers.length; i++)
		{
		    whichEl = document.layers[i];
	        if (whichEl.visibility != "hide") {
                whichEl.pageY = nextY;
                nextY += whichEl.document.height;
				whichEl.pageX = document.layers[firstInd].pageX;
			}
		 }
     }
}

// expands or contracts the menu item
// rolls over arrow image
// sets global openStatus toggle
function expandIt(el) { //hides, unhides menu images (needs arrange to look proper)
	 	if (bV < 4) return;
		// we need to know what design we're in to do different things
		var design = 'wbshop';
		// different browsers support different ways of grabbing elements
		// the most popular current way is by the element id
         if(ie5 || ns6) {
			 // this function is only passed a number, but the ids have names associated with them so this pieces the name with the number
			 // in newlines case this number is the category id.
             whichEl = "menuChild" + el;
			 whichIm = "menuArrow" + el;
			 if (document.getElementById(whichEl).style.display == "block") {// if the child element is visible
                 document.getElementById(whichEl).style.display = "none";// make it hidden
                 //document.getElementById(whichIm).src = "/kernel/images/" + design + "_arrow.gif";// roll over the arrow image into it's neutral state
				 openStatus=null;
             } // end of if
             else { // otherwise the state of the display property is none therfore we want to actually open it
				collapse(design); // this will close whatever category is currently opened
                  document.getElementById(whichEl).style.display = "block"; // back the child element show
				  //document.getElementById(whichIm).src = "/kernel/images/" + design + "_arrowdown.gif"; // change the parent category ids arrow image to the down (open) state
				  openStatus = el; // set the global open Status variable to the category id we just openend.
             } // end of else
         }// end of if
		 // the next two blocks, in essance, do the same as the one above except for how the elements are referenced so I won't bother documenting it
         else if (ie4) {
             whichEl = eval("menuChild" + el);
			 whichIm = eval("menuArrow" + el);
			  if (whichEl.style.display == "block") {
                 whichEl.style.display = "none";
				// whichIm.src = "/kernel/images/" + design + "_arrow.gif";
				 openStatus=null;
             } // end of if
             else {
				 collapse(design);
                 whichEl.style.display = "block";
				// whichIm.src = "/kernel/images/" + design + "_arrowdown.gif";
				 openStatus = el;
             } // end of else
         }// end of if
         else if(ns4){
             whichEl = eval("document." + "menuChild" + el);
             if (whichEl.visibility == "show") {
                whichEl.visibility = "hide";
				openStatus=null;
             }// end of if
             else {
				collapse(design);
                whichEl.visibility = "show";
				openStatus = el;
             } // end of else
			 arrange();
        } // end of else
} // end of function

// we only want one menu item openStatus at a time.
// uses global openStatus togle to see whats openStatus
// this function kind of does what the above function does but in reverse.
// set's the openStatus global variable to none.
// of course I should just make the function above support this
function collapse(design) { // collapse the entire tree
	if (bV < 4) return;
	if (openStatus == null) return;
	if (ns4) {
			whichOEl = eval("document." + "menuChild" + openStatus);
			whichOEl.visibility = "hide";
	}
	else if (ie4){
             whichOEl = eval("menuChild" + openStatus);
			 whichOIm = eval("menuArrow" + openStatus);
			 whichOEl.style.display = "none";
			// whichOIm.src = "/kernel/images/" + design + "_arrow.gif";
	}
	else if (ie5 || ns6) {
             whichOEl = "menuChild" + openStatus;
			 whichOIm = "menuArrow" + openStatus;
				document.getElementById(whichOEl).style.display = "none";
			// document.getElementById(whichOIm).src = "/kernel/images/" + design + "_arrow.gif";
	}
	openStatus = null;
} //end of function
//END POP-DOWN MENU
function show(){
		if(ie5 || ns6) {
			document.getElementById("menuChild102").style.display == "block";
			 if (document.getElementById("mc01").style.display == "block") {
                 document.getElementById("mc01").style.display = "none";
             } else { 
				  document.getElementById("mc01").style.display = "block"; 
             } 
         }else if (ie4) {
			  if (mc01.style.display == "block") {
                 mc01.style.display = "none";
             } 
             else {
                 mc01.style.display = "block";
             }
         }
         else if(ns4){
             if (document.mc01.visibility == "show") {
                document.mc01.visibility = "hide";
             }
             else {
                document.mc01.visibility = "show";
             } 
        } 
}