function prdLeftNav()
{
	this.ID = Common.Register.length;
	this.selected = null;
	Common.Register[this.ID] = this;
	this.children = new Array;
	this.baseLocation = "";
	
	this.Add = function(opt)
	{
	    opt.menu = this;
	    opt.parent = this;
	    this.children[opt.ID] = opt;
	}
	this.Select = function(name)
	{
	    for(var i in this.children){
	        var opt = this.children[i];
            if ( opt.name == name ){
                opt.Click();
            }
            for(var j in opt.children){
                if (opt.children[j].name == name){
                    opt.children[j].Click();
                }
            }
        }
	}
	this.toString = function()
    {
        var str = "<div id=\"prdLeftNav"+this.ID+"\" class=\"leftNav\">";
        str += "<div style=\"height:6px;\"><img style=\"width:174px;\" src=\"" + document.location.protocol + "//static.packardbell.com/mkt/layout/2006/common/images/interface_v3/leftnavtop_v3.gif\" /></div>";
        for(var i in this.children){
            str += this.children[i];
        }
        str += "<div><img style=\"width:174px;\" src=\"" + document.location.protocol + "//static.packardbell.com/mkt/layout/2006/common/images/interface_v3/leftnavbottom_v3.gif\" /></div>";
        str += "</div>";
        return str;
    }
}

function prdLeftNavOpt(name,link,target)
{
  this.ID = Common.Register.length;
	Common.Register[this.ID] = this;
	this.children = new Array;
	this.menu = null;
	this.name = name;
	this.link = link;
	this.target = target;
	this.parent = null;
	this.isExpanded = false;
	
	this.Add = function(opt)
	{
	    opt.menu = this.menu;
	    opt.parent = this;
	    this.children[opt.ID] = opt;
	}
	this.Click = function()
	{
	    var optsdiv = document.getElementById("opts"+this.ID);
	    var btn = document.getElementById("opt"+this.ID+"btn");
	    var lnk = document.getElementById("opt"+this.ID+"lnk");
	    if (( btn != null ) && ( this.parent.ID == this.menu.ID ) && ( this.children.length > 0 ))
	    {
	        optsdiv.style.display = ( optsdiv.style.display == "block" ? "none" : "block" );
	        btn.src = document.location.protocol + "//static.packardbell.com/mkt/layout/2006/common/images/interface/leftnav"+(optsdiv.style.display == "block" ? "collapse" : "expand")+".gif";
	        this.isExpanded = ( optsdiv.style.display == "block" ? true : false );
	    }
	    if (( this.parent.ID != this.menu.ID ) && ( !this.parent.isExpanded ))
	    {
	        this.parent.Click();
	    }
	    lnk.className = (lnk.className == "b" ? "" : "b");
	}
	this.toString = function()
    {
        var str = "<div>";
        if ( this.parent.ID == this.menu.ID )
        {
            if ( this.children.length>0){
                str += "<img id=\"opt"+this.ID+"btn\" onclick=\"Common.Register["+this.ID+"].Click();\" class=\"btn\" src=\"" + document.location.protocol + "//static.packardbell.com/mkt/layout/2006/common/images/interface/leftnavexpand.gif\" />"; }
            else {
                str += "<img id=\"opt"+this.ID+"btn\" style=\"cursor:default;\" class=\"btn\" src=\"" + document.location.protocol + "//static.packardbell.com/mkt/layout/2006/common/images/interface/leftnavdot.gif\" />"; }

            str += "<a id=\"opt"+this.ID+"lnk\" href=\""+this.link+"\" target=\""+this.target+"\">"+this.name+"</a>";
            if ( this.children.length > 0 )
            {
                str += "<div style=\"display:none;\" id=\"opts"+this.ID+"\">";
                for(var i in this.children)
                {
                    str += this.children[i];
                }
                str += "</div>";
            }
        }
        else
        {
            str += "<a id=\"opt"+this.ID+"lnk\" href=\""+this.link+"\" target=\""+this.target+"\">> "+this.name+"</a>";
        }        
        
        str += "</div>";
        return str;
    }
}