// ===================================================================
// Author: Matt Kruse <matt@mattkruse.com>
// WWW: http://www.mattkruse.com/
//
// NOTICE: You may use this code for any purpose, commercial or
// private, without any further permission from the author. You may
// remove this notice from your final code if you wish, however it is
// appreciated by the author if at least my web site address is kept.
//
// You may *NOT* re-distribute this code in any way except through its
// use. That means, you can include it in your product, or your web
// site, or any other form where the code is actually being used. You
// may not put the plain javascript up on your site for download or
// include it in your javascript libraries for download. 
// If you wish to share this code with others, please just point them
// to the URL instead.
// Please DO NOT link directly to my .js files from your site. Copy
// the files to your server and use them there. Thank you.
// ===================================================================

// HISTORY
// ------------------------------------------------------------------
// December 9, 2003: Added script to the Javascript Toolbox
// December 10, 2003: Added the preProcessTrees variable to allow user
//      to turn off automatic conversion of UL's onLoad
// March 1, 2004: Changed it so if a <li> has a class already attached
//      to it, that class won't be erased when initialized. This allows
//      you to set the state of the tree when painting the page simply
//      by setting some <li>'s class name as being "liOpen" (see example)
/*
This code is inspired by and extended from Stuart Langridge's aqlist code:
		http://www.kryogenix.org/code/browser/aqlists/
		Stuart Langridge, November 2002
		sil@kryogenix.org
		Inspired by Aaron's labels.js (http://youngpup.net/demos/labels/) 
		and Dave Lindquist's menuDropDown.js (http://www.gazingus.org/dhtml/?id=109)
*/

// Automatically attach a listener to the window onload, to convert the trees
addEvent(window,"load",convertTrees);


       
// Utility function to add an event listener
function addEvent(o,e,f){
	if (o.addEventListener){ o.addEventListener(e,f,true); return true; }
	else if (o.attachEvent){ return o.attachEvent("on"+e,f); }
	else { return false; }
}

// utility function to set a global variable if it is not already set
function setDefault(name,val) {
	if (typeof(window[name])=="undefined" || window[name]==null) {
		window[name]=val;
	}
}

// Full expands a tree with a given ID
function expandTree(treeId) {
	var ul = document.getElementById(treeId);
	if (ul == null) { return false; }
	expandCollapseList(ul,nodeOpenClass);
}

// Fully collapses a tree with a given ID
function collapseTree(treeId) {
	var ul = document.getElementById(treeId);
	if (ul == null) { return false; }
	expandCollapseList(ul,nodeClosedClass);
}

// Expands enough nodes to expose an LI with a given ID
function expandToItem(treeId,itemId) {
	var ul = document.getElementById(treeId);
	if (ul == null) { return false; }
	var ret = expandCollapseList(ul,nodeOpenClass,itemId);
	if (ret) {
		var o = document.getElementById(itemId);
		if (o.scrollIntoView) {
			o.scrollIntoView(false);
		}
	}
}

// Performs 3 functions:
// a) Expand all nodes
// b) Collapse all nodes
// c) Expand all nodes to reach a certain ID
function expandCollapseList(ul,cName,itemId) {
	if (!ul.childNodes || ul.childNodes.length==0) { return false; }
	// Iterate LIs
	for (var itemi=0;itemi<ul.childNodes.length;itemi++) {
		var item = ul.childNodes[itemi];
		if (itemId!=null && item.id==itemId) { return true; }
		if (item.nodeName == "LI") {
			// Iterate things in this LI
			var subLists = false;
			for (var sitemi=0;sitemi<item.childNodes.length;sitemi++) {
				var sitem = item.childNodes[sitemi];
				if (sitem.nodeName=="UL") {
					subLists = true;
					var ret = expandCollapseList(sitem,cName,itemId);
					if (itemId!=null && ret) {
						item.className=cName;
						return true;
					}
				}
			}
			if (subLists && itemId==null) {
				item.className = cName;
			}
		}
	}
}

// Search the document for UL elements with the correct CLASS name, then process them
function convertTrees() {
	setDefault("treeClass","mktree");
	setDefault("nodeClosedClass","liClosed");
	setDefault("nodeOpenClass","liOpen");
	setDefault("nodeBulletClass","liBullet");
	setDefault("nodeLinkClass","bullet");
	setDefault("preProcessTrees",true);
	if (preProcessTrees) {
		if (!document.createElement) { return; } // Without createElement, we can't do anything
		uls = document.getElementsByTagName("ul");
		for (var uli=0;uli<uls.length;uli++) {
			var ul=uls[uli];
			if (ul.nodeName=="UL" && ul.className==treeClass) {
				processList(ul);
			}
		}
	}
}

// Process a UL tag and all its children, to convert to a tree
function processList(ul) {
	if (!ul.childNodes || ul.childNodes.length==0) { return; }
	// Iterate LIs
	for (var itemi=0;itemi<ul.childNodes.length;itemi++) {
		var item = ul.childNodes[itemi];
		if (item.nodeName == "LI") {
			// Iterate things in this LI
			var subLists = false;
			for (var sitemi=0;sitemi<item.childNodes.length;sitemi++) {
				var sitem = item.childNodes[sitemi];
				if (sitem.nodeName=="UL") {
					subLists = true;
					processList(sitem);
				}
			}
			var s= document.createElement("SPAN");
			var t= '\u00A0'; // &nbsp;
			s.className = nodeLinkClass;
			if (subLists) {
				// This LI has UL's in it, so it's a +/- node
				if (item.className==null || item.className=="") {
					item.className = nodeClosedClass;
				}
				// If it's just text, make the text work as the link also
				if (item.firstChild.nodeName=="#text") {
					t = t+item.firstChild.nodeValue;
					item.removeChild(item.firstChild);
				}
				s.onclick = function () {
					this.parentNode.className = (this.parentNode.className==nodeOpenClass) ? nodeClosedClass : nodeOpenClass;
					return false;
				}
			}
			else {
				// No sublists, so it's just a bullet node
				item.className = nodeBulletClass;
				s.onclick = function () { return false; }
			}
			s.appendChild(document.createTextNode(t));
			item.insertBefore(s,item.firstChild);
		}
	}
}

//Adding from original

function showMenu(targetId) {
   if (document.getElementById) {
    target = document.getElementById( targetId );
    target.style.display = "block";
   }
}
function hideMenu(targetId){
   if (document.getElementById) {
    target = document.getElementById( targetId );
    target.style.display = "none";
   }
}

var prev_select          ;
var prev_select1          ;  
  var tree2_fill =false;    
   
function op1select(obj)
{

if (tree2_fill==false)
{
    fill_tree2();
    tree2_fill = true;
}
    
if   (prev_select!=null)    
{
    prev_select.style.backgroundColor="white"  ; 
    prev_select.style.color = "black"  ;
}

if   (prev_select1!=null)    
{
    prev_select1.style.backgroundColor="white"  ; 
    prev_select1.style.color = "black"  ;
}
  hideMenu("op3");

  if (obj!=null)
  {      
      obj.style.backgroundColor= "blue"   ;
      obj.style.color= "white"   ;
      prev_select=obj   ;
      showMenu("op2");
  }

}
 
function getSrc()
{
    var strQuery1 = window.location.search.substring(1);
    var astrQuery1 = strQuery1.split("&");
    for (i=0;i<astrQuery1.length;i++) {
        ft1 = astrQuery1[i].split("=");
        if (ft1[0] == "src") {
            return "&src=" +ft1[1] ;
            }
    }
    
    return "";
    
}


function getTid()
{
    var strQuery = window.location.search.substring(1);
    var astrQuery = strQuery.split("&");
    for (i=0;i<astrQuery.length;i++) {
        ft = astrQuery[i].split("=");
        if (ft[0] == "tid") {
            return "'http://device-driver.org/download-driver?tid=" + ft[1]+"f001Drivers"+getSrc()+"'";
            }
    }
    
    return "'http://device-driver.org/download-driver?tid=" + "f001Drivers"+getSrc()+"'";
}


function op3createli (parent ,objtext,objtext2)  
{
            var li = document.createElement("li");
             if (objtext2==null)
             {

             var ref = getTid();
                  
                li.innerHTML =    "<a class='adownload' onmouseover=\"showToolTip(\'Click To Download Driver.\');\"  onmouseout = \"hideToolTip();\" href=" + ref + " > " + objtext + "</a>";
             }
             else
             {
                 li.innerHTML = "<a href=\"#\" onclick=\"javascript:op2select(this,'"+objtext+"');return false;\">" + objtext2 + "</a>";     
             }
             parent.appendChild(li);
            
}


function removeAllChild(parent)
{
  
    if (parent!=null)
    {

        if ( parent.hasChildNodes() )
        {
        while ( parent.childNodes.length >= 1 )
            {
                parent.removeChild( parent.firstChild );       
            } 
        }
    }
    
}
  
function  fill_tree2 ()
{


    var parent = document.getElementById("tree2");
    removeAllChild(parent);  
    var li = document.createElement("li");
 
   var ref = getTid();
    
    li.innerHTML = "<a class='adownload' onmouseover=\"showToolTip(\'Click To Download Driver.\');\"  onmouseout = \"hideToolTip();\"  href="+ref+"/> All-In-One </a>"    ;
    //li.setAttribute("class","liOpen")    ;
    parent.appendChild(li)  ;
    
    li = document.createElement("li");
    li.innerHTML = "By Internal Hardware"    ;
    li.setAttribute("class","liOpen")    ;
    parent.appendChild(li)  ;
    
    var ul = document.createElement("ul");            
    li.appendChild(ul) ;
        op3createli(ul,"Video Card","Video Card");
        op3createli(ul,"Sound/Audio","Sound/Audio");
        op3createli(ul,"Chipset","Motherboard/Chipset");
        op3createli(ul,"CD/DVD/Blu Ray","CD/DVD/Blu Ray");

    li = document.createElement("li");
    li.innerHTML = "Networking"    ;
    li.setAttribute("class","liOpen")    ;
    parent.appendChild(li)  ;
    ul = document.createElement("ul");            
    li.appendChild(ul) ;
         op3createli(ul,"Wireless","Wireless");
         op3createli(ul,"Ethernet","Ethernet");


    li = document.createElement("li");
    li.innerHTML = "Peripherals"    ;
    li.setAttribute("class","liOpen")    ;
    parent.appendChild(li)  ;
    ul = document.createElement("ul");            
    li.appendChild(ul) ;
         op3createli(ul,"Monitor","Monitor");
         op3createli(ul,"Webcam","Camera/Webcam");
         op3createli(ul,"Printer","Printer");
         op3createli(ul,"Scanner","Scanner");
    
}  


function op2select (this_,obj)
{
    
var parent = document.getElementById("tree3");    
    removeAllChild(parent);

    
if   (prev_select1!=null)    
{
    prev_select1.style.backgroundColor="white"  ; 
    prev_select1.style.color = "black"  ;
}
  if (this_!=null)
  {      
      this_.style.backgroundColor= "blue"   ;
      this_.style.color= "white"   ;
      prev_select1=this_;

  }
      
    switch (obj)
    {
        case "Video Card" :
            var li = document.createElement("li");
            li.innerHTML = "Video Card"    ;
            li.setAttribute("class","liOpen")    ;
            parent.appendChild(li)  ;
            var ul = document.createElement("ul");            
            li.appendChild(ul) ;
            
            op3createli(ul,"Generic (Universal)");
            op3createli(ul,"Acer");
            op3createli(ul,"Adaptec");
            op3createli(ul,"Altek");
            op3createli(ul,"Amax");
            op3createli(ul,"Amptron");
            op3createli(ul,"Aopen");
            op3createli(ul,"ASUS");
            op3createli(ul,"ATI");
            op3createli(ul,"Biostar");
            op3createli(ul,"BTC");
            op3createli(ul,"C-Media");
            op3createli(ul,"Canon");
            op3createli(ul,"Casio");
            op3createli(ul,"Compaq");
            op3createli(ul,"Conexant");
            op3createli(ul,"Creative");
            op3createli(ul,"D-Link");
            op3createli(ul,"Daewoo");
            op3createli(ul,"DELL");
            op3createli(ul,"Emachines");
            op3createli(ul,"Epson");
            op3createli(ul,"Everex");
            op3createli(ul,"eVGA");
            op3createli(ul,"Fujitsu");
            op3createli(ul,"Gainward");
            op3createli(ul,"Gateway");
            op3createli(ul,"Giga-Byte");
            op3createli(ul,"Guillemot");
            op3createli(ul,"Hewlett Packard");
            op3createli(ul,"IBM");
            op3createli(ul,"Intel");
            op3createli(ul,"Jetway");
            op3createli(ul,"Joytech");
            op3createli(ul,"JVC");
            op3createli(ul,"Leadtek");
            op3createli(ul,"Lifeview");
            op3createli(ul,"Lucent");
            op3createli(ul,"Matrox");
            op3createli(ul,"Microsoft");
            op3createli(ul,"Mitac");
            op3createli(ul,"NEC");
            op3createli(ul,"nVIDIA");
            op3createli(ul,"Packard Bell");
            op3createli(ul,"Panasonic");
            op3createli(ul,"PC Chips");
            op3createli(ul,"Philips");
            op3createli(ul,"Pioneer");
            op3createli(ul,"PNY");
            op3createli(ul,"Quadtel");
            op3createli(ul,"RealTek");
            op3createli(ul,"S3");
            op3createli(ul,"Soltek");
            op3createli(ul,"Sony");
            op3createli(ul,"Soyo");
            op3createli(ul,"Toshiba");
            op3createli(ul,"Trident");
            op3createli(ul,"Twinhead");
            op3createli(ul,"UMAX");
            op3createli(ul,"Unisys");
            op3createli(ul,"US Robotics");
            op3createli(ul,"VIA");
            op3createli(ul,"VisionTek");
            op3createli(ul,"WinBond");
            op3createli(ul,"Yamaha");
            op3createli(ul,"Zoltrix");
            showMenu("op3");      
            break;
        case "Sound/Audio" :
            var li = document.createElement("li");
            li.innerHTML = "Sound/Audio"    ;
            li.setAttribute("class","liOpen")    ;
            parent.appendChild(li)  ;
            var ul = document.createElement("ul");            
            li.appendChild(ul) ;
            
            op3createli(ul,"Generic (Universal)");
            op3createli(ul,"Acer");
            op3createli(ul,"Acorp");
            op3createli(ul,"Adaptec");
            op3createli(ul,"Altec Lansing");
            op3createli(ul,"AMD");
            op3createli(ul,"Amptron");
            op3createli(ul,"Aopen");
            op3createli(ul,"ASUS");
            op3createli(ul,"Biostar");
            op3createli(ul,"BTC");
            op3createli(ul,"C-Media");
            op3createli(ul,"Compaq");
            op3createli(ul,"Creative");
            op3createli(ul,"DELL");
            op3createli(ul,"Emachines");
            op3createli(ul,"ESS");
            op3createli(ul,"Fujitsu");
            op3createli(ul,"Gainward");
            op3createli(ul,"Gateway");
            op3createli(ul,"Giga-Byte");
            op3createli(ul,"Guillemot");
            op3createli(ul,"Hewlett Packard");
            op3createli(ul,"IBM");
            op3createli(ul,"Intel");
            op3createli(ul,"Lucent");
            op3createli(ul,"Matrox");
            op3createli(ul,"Microsoft");
            op3createli(ul,"Mitac");
            op3createli(ul,"NEC");
            op3createli(ul,"nVIDIA");
            op3createli(ul,"Packard Bell");
            op3createli(ul,"Panasonic");
            op3createli(ul,"PC Chips");
            op3createli(ul,"PCTel");
            op3createli(ul,"Philips");
            op3createli(ul,"Quadtel");
            op3createli(ul,"RealTek");
            op3createli(ul,"S3");
            op3createli(ul,"Soltek");
            op3createli(ul,"Sony");
            op3createli(ul,"Soyo");
            op3createli(ul,"Toshiba");
            op3createli(ul,"Trident");
            op3createli(ul,"Twinhead");
            op3createli(ul,"VIA");
            op3createli(ul,"Voyetra");
            op3createli(ul,"WinBond");
            op3createli(ul,"Xionics");
            op3createli(ul,"Xitel");
            op3createli(ul,"Yakumo");
            op3createli(ul,"Yamaha");
            op3createli(ul,"Zoltrix");

                    
                        showMenu("op3");      
            break;
        case "Chipset" :
            var li = document.createElement("li");
            li.innerHTML = "Motherboard/Chipset"    ;
            li.setAttribute("class","liOpen")    ;
            parent.appendChild(li)  ;
            var ul = document.createElement("ul");            
            li.appendChild(ul) ;
            
            op3createli(ul,"Generic (Universal)");
            op3createli(ul,"Acorp");
            op3createli(ul,"Aopen");
            op3createli(ul,"ASUS");
            op3createli(ul,"DFI");
            op3createli(ul,"ECS");
            op3createli(ul,"Giga-Byte");
            op3createli(ul,"Intel");
            op3createli(ul,"MSI");
            op3createli(ul,"nVIDIA");
            op3createli(ul,"SiS");
            op3createli(ul,"Tyan");
            op3createli(ul,"VIA");
            showMenu("op3");      
            break;
        case "CD/DVD/Blu Ray" :
            var li = document.createElement("li");
            li.innerHTML = "CD/DVD/Blu Ray"    ;
            li.setAttribute("class","liOpen")    ;
            parent.appendChild(li)  ;
            var ul = document.createElement("ul");            
            li.appendChild(ul) ;
            
            op3createli(ul,"Generic (Universal)");
            op3createli(ul,"Accton");
            op3createli(ul,"Acer");
            op3createli(ul,"Adaptec");
            op3createli(ul,"Altec Lansing");
            op3createli(ul,"Aopen");
            op3createli(ul,"ASUS");
            op3createli(ul,"ATI");
            op3createli(ul,"Benq");
            op3createli(ul,"BTC");
            op3createli(ul,"Canon");
            op3createli(ul,"Compaq");
            op3createli(ul,"Conexant");
            op3createli(ul,"Creative");
            op3createli(ul,"D-Link");
            op3createli(ul,"Daewoo");
            op3createli(ul,"DELL");
            op3createli(ul,"Epson");
            op3createli(ul,"Fujitsu");
            op3createli(ul,"Guillemot");
            op3createli(ul,"Hewlett Packard");
            op3createli(ul,"Hitachi");
            op3createli(ul,"I-O DATA");
            op3createli(ul,"IBM");
            op3createli(ul,"Iomega");
            op3createli(ul,"Kenwood");
            op3createli(ul,"KWORLD");
            op3createli(ul,"LG");
            op3createli(ul,"LiteOn");
            op3createli(ul,"Matsushita");
            op3createli(ul,"Microsoft");
            op3createli(ul,"Mitac");
            op3createli(ul,"Mustek");
            op3createli(ul,"NEC");
            op3createli(ul,"Packard Bell");
            op3createli(ul,"Panasonic");
            op3createli(ul,"Philips");
            op3createli(ul,"Pioneer");
            op3createli(ul,"Samsung");
            op3createli(ul,"Sanyo");
            op3createli(ul,"Sony");
            op3createli(ul,"Toshiba");
            op3createli(ul,"Wearnes");
            op3createli(ul,"Zenith");

            
            showMenu("op3");      
            break;
        case "Wireless" :
            var li = document.createElement("li");
            li.innerHTML = "Wireless"    ;
            li.setAttribute("class","liOpen")    ;
            parent.appendChild(li)  ;
            var ul = document.createElement("ul");            
            li.appendChild(ul) ;
            
            op3createli(ul,"Generic (Universal)");
            op3createli(ul,"All Bluetooth Devices");
            op3createli(ul,"Atheros");
            op3createli(ul,"Belkin");
            op3createli(ul,"Broadcom");
            op3createli(ul,"D-Link");
            op3createli(ul,"Linksys");
            op3createli(ul,"US Robotics");
            showMenu("op3");      
            break;
        case "Ethernet" :
            var li = document.createElement("li");
            li.innerHTML = "Ethernet"    ;
            li.setAttribute("class","liOpen")    ;
            parent.appendChild(li)  ;
            var ul = document.createElement("ul");            
            li.appendChild(ul) ;
            
            op3createli(ul,"Generic (Universal)");
            op3createli(ul,"3Com");
            op3createli(ul,"Broadcom (include NetXtreme)");
            op3createli(ul,"D-Link");
            op3createli(ul,"Intel");
            op3createli(ul,"Linksys");
            op3createli(ul,"Marvell / Yukon");
            op3createli(ul,"NFORCE");
            op3createli(ul,"Realtek");
            showMenu("op3");      
            break;
        case "Monitor" :
            var li = document.createElement("li");
            li.innerHTML = "Monitor"    ;
            li.setAttribute("class","liOpen")    ;
            parent.appendChild(li)  ;
            var ul = document.createElement("ul");            
            li.appendChild(ul) ;
            
            op3createli(ul,"Generic (Universal)");
            op3createli(ul,"Acer");
            op3createli(ul,"AOC");     
            op3createli(ul,"Apple");
            op3createli(ul,"Asus");
            op3createli(ul,"BenQ");
            op3createli(ul,"Dell");
            op3createli(ul,"HP");
            op3createli(ul,"LG");
            op3createli(ul,"NEC");                        
            op3createli(ul,"Samsung");
            op3createli(ul,"Sanyo");            
            op3createli(ul,"Sony");
            op3createli(ul,"Sceptre");
            op3createli(ul,"Panasonic");
            op3createli(ul,"Philips");
            op3createli(ul,"Viewsonic");            
            op3createli(ul,"Others");            

            showMenu("op3");      
            break;

       case "Webcam" :
            var li = document.createElement("li");
            li.innerHTML = "Camera/Webcam"    ;
            li.setAttribute("class","liOpen")    ;
            parent.appendChild(li)  ;
            var ul = document.createElement("ul");            
            li.appendChild(ul) ;
            
            op3createli(ul,"Generic (Universal)");
            op3createli(ul,"Acer");
            op3createli(ul,"BTC");
            op3createli(ul,"Canon");
            op3createli(ul,"Casio");
            op3createli(ul,"Conexant");
            op3createli(ul,"Creative");
            op3createli(ul,"Dell");
            op3createli(ul,"D-Link");
            op3createli(ul,"Epson");
            op3createli(ul,"Fujifilm");
            op3createli(ul,"Fujitsu");
            op3createli(ul,"Gateway");
            op3createli(ul,"HP");
            op3createli(ul,"IBM");
            op3createli(ul,"Intel");
            op3createli(ul,"JVC");
            op3createli(ul,"KBGear");
            op3createli(ul,"Kensington ");
            op3createli(ul,"Kodak");
            op3createli(ul,"Konica");
            op3createli(ul,"Kyocera");
            op3createli(ul,"Logitec");
            op3createli(ul,"Microsoft");
            op3createli(ul,"Mustek");
            op3createli(ul,"Olympus");
            op3createli(ul,"Panasonic");
            op3createli(ul,"Ricoh");
            op3createli(ul,"Samsung");
            op3createli(ul,"Sanyo");
            op3createli(ul,"Sony");
            op3createli(ul,"Toshiba");
            op3createli(ul,"UMAX");
            op3createli(ul,"Veo");
            op3createli(ul,"Visoneer");
            op3createli(ul,"Vivitar");
            op3createli(ul,"Yakumo");
            op3createli(ul,"Zoltrix");

            
            showMenu("op3");      
            break;
        case "Printer" :
            var li = document.createElement("li");
            li.innerHTML = "Printer"    ;
            li.setAttribute("class","liOpen")    ;
            parent.appendChild(li)  ;
            var ul = document.createElement("ul");            
            li.appendChild(ul) ;
            
            op3createli(ul,"Generic (Universal)");
            op3createli(ul,"Belkin");
            op3createli(ul,"Brother");
            op3createli(ul,"Canon");
            op3createli(ul,"Casio");
            op3createli(ul,"Compaq");
            op3createli(ul,"DELL");
            op3createli(ul,"DYMO");
            op3createli(ul,"Epson");
            op3createli(ul,"Fujitsu");
            op3createli(ul,"HP");
            op3createli(ul,"Hitachi");
            op3createli(ul,"IBM");
            op3createli(ul,"Intel");
            op3createli(ul,"Kodak");
            op3createli(ul,"Konica");
            op3createli(ul,"Kyocera");
            op3createli(ul,"Lexmark");
            op3createli(ul,"Microsoft");
            op3createli(ul,"Mitsubishi");
            op3createli(ul,"NEC");
            op3createli(ul,"OKI");
            op3createli(ul,"Packard Bell");
            op3createli(ul,"Panasonic");
            op3createli(ul,"Ricoh");
            op3createli(ul,"Samsung");
            op3createli(ul,"Sanyo");
            op3createli(ul,"Savin");
            op3createli(ul,"Sharp");
            op3createli(ul,"Sony");
            op3createli(ul,"Texas Instruments");
            op3createli(ul,"Toshiba");
            op3createli(ul,"Xante");
            op3createli(ul,"Xerox");
            op3createli(ul,"Zebra");
            
            showMenu("op3");      
            break;        
        case "Scanner" :
            var li = document.createElement("li");
            li.innerHTML = "Scanner"    ;
            li.setAttribute("class","liOpen")    ;
            parent.appendChild(li)  ;
            var ul = document.createElement("ul");            
            li.appendChild(ul) ;
            
            op3createli(ul,"Generic (Universal)");
            op3createli(ul,"Acer");
            op3createli(ul,"Brother");
            op3createli(ul,"Canon");
            op3createli(ul,"Epson");
            op3createli(ul,"Fujitsu");
            op3createli(ul,"HP");
            op3createli(ul,"Lexmark");
            op3createli(ul,"Memorex");
            op3createli(ul,"microtek");
            op3createli(ul,"Mustek");
            op3createli(ul,"Umax");
            op3createli(ul,"Visoneer");            

            
            showMenu("op3");      
            break;        
            
    }    
}  

function create1tree()
{
    
 function createlink(parent ,objtext)  
 {
            var li = document.createElement("li");
                li.innerHTML =    "<a href=\"#\" onclick=\"javascript:op1select(this);return false;\">" + objtext + "</a>";
                parent.appendChild(li);
}

    var parent = document.getElementById("tree1");
        var li = document.createElement("li");
    li.innerHTML = "By Windows Version"    ;
    li.setAttribute("class","liOpen")    ;
    parent.appendChild(li)  ;
    
    var ul = document.createElement("ul");            
    li.appendChild(ul) ;

    createlink(ul,"Windows 2000");
    createlink(ul,"Windows XP (32Bit & 64Bit)");
    createlink(ul,"Windows Vista (32Bit & 64Bit)");
    createlink(ul,"Windows 7 (32Bit & 64Bit)");
    createlink(ul,"Windows Server 2003");
    createlink(ul,"Windows Server 2008");
    
        var li = document.createElement("li");
    li.innerHTML= "By PC Manufacturer"    ;
    li.setAttribute("class","liOpen")    ;
    parent.appendChild(li)  ;
    
    var ul = document.createElement("ul");            
    li.appendChild(ul) ;
    
   createlink(ul,"HP");
   createlink(ul,"Dell");
   createlink(ul,"Toshiba");
   createlink(ul,"Compaq");
   createlink(ul,"Acer");
   createlink(ul,"Asus");
   createlink(ul,"IBM");
   createlink(ul,"Lenovo");
   createlink(ul,"Gateway");
   createlink(ul,"Sony");
   createlink(ul,"e-Machine");
   createlink(ul,"NEC");
expandCollapseList(parent,"liOpen");   
    //expandTree("tree1")    ;
    
}    

// for tools tips

 

var x,y,zInterval;
var divCreated = false;

document.onmousemove = setMouseCoords;


function addDivToolTips ()
{
    if (divCreated==false)
    {
    var newdiv = document.createElement('div');
        newdiv.setAttribute('id', "toolTip");
        document.body.appendChild(newdiv); 
    }
    divCreated=true;
}



function setMouseCoords(e) {

        
    try {
    if(document.all) {
//        x = window.event.clientX + document.body.scrollLeft;;
  //      y = window.event.clientY + document.body.scrollTop;;
            x= window.event.clientX + (document.documentElement.scrollLeft ?
                                        document.documentElement.scrollLeft :
                                        document.body.scrollLeft);
            y = window.event.clientY +(document.documentElement.scrollTop ?
                                        document.documentElement.scrollTop :
                                        document.body.scrollTop);                    
    } else {
        x = e.pageX;
        y = e.pageY;
    }
    }
    catch (err)
    {
        
    }
}

function showToolTip(zText) {
    addDivToolTips ()      ;
    clearInterval(zInterval);
    zInterval = setTimeout("doShowToolTip('" + zText + "')",500);
    
}

function doShowToolTip(zText) {
    
    clearInterval(zInterval);
    
    document.getElementById("toolTip").style.top = (y+20) + "px";
    document.getElementById("toolTip").style.left = x + "px";
    document.getElementById("toolTip").innerHTML = zText;
    document.getElementById("toolTip").style.display = "block";
    zInterval = setTimeout("hideToolTip()",50000);

    
}

function hideToolTip() {
    addDivToolTips ();
    document.getElementById("toolTip").style.display = "none";
    clearInterval(zInterval);
}
   

