function resetInput(obj, default_txt) {
    if(obj.value == "") {
        obj.value = default_txt;
    }
}

function _System() {
    String.prototype.Trim = function() {
        return this.replace(/^\s+|\s+$/g,"");
    }

    String.prototype.LTrim = function() {
        return this.replace(/^\s+/,"");
    }

    String.prototype.RTrim = function() {
        return this.replace(/\s+$/,"");
    }

    String.prototype.Contains = function(somestring)
    {
        return (this.indexOf(somestring) != -1 ? true : false);
    }

    String.prototype.Trunc = function(len)
    {
        return this.substring(0, len) + (this.length > len ? "..." : "");
    }
}

function _XML() {
    this.selectSingleNode = function (XmlDocument, Xpath)
    {
        if (System.OS.Browser == BT_IE)
        {
            return XmlDocument.selectSingleNode(Xpath);
        } else {
            try
            {
                var XResult = XmlDocument.evaluate(Xpath, XmlDocument, null, XPathResult.ANY_TYPE, null);
                var result = XResult.iterateNext();
                result.text = result.textContent;
                return result;
            }
            catch (e)
            {
                return null;
            }
        }
    }

    this.selectNodes = function(XmlDocument, Xpath)
    {
        if (System.OS.Browser == BT_IE)
        {
            return XmlDocument.selectNodes(Xpath);
        } else {
            try
            {
                var XResult = XmlDocument.evaluate(Xpath, XmlDocument, null, XPathResult.ANY_TYPE, null);
                if (XResult != null)
                {
                    var result = new Array();
                    var item = XResult.iterateNext();

                    while(item != null)
                    {
                        item.text = item.textContent;
                        result.push(item);
                        item = XResult.iterateNext();
                    }
                    return result;
                } else return null;
            }
            catch (e)
            {
                return null;
            }
        }
    }

    this.HttpRequest = function()
    {
        var request = null;
        if (System.OS.Browser == BT_IE)
        {
            request = new ActiveXObject("Microsoft.XMLHTTP");
        } else {
            request = new XMLHttpRequest();
        }
        return request;
    }

    this.LoadXml = function(request, filename, readystatefunc)
    {
        //var request = this.HttpRequest();
        request.onreadystatechange = readystatefunc;
        request.open("GET", filename, true);
        request.send(null);
    }
}


System = new _System();
_System.prototype.Xml = new _XML();



// /js/namespaces/dom.js
/**************************
** System.DOM namespace
**
** Rev Date: 27 Nov 2007
** Prog: Gabriel Nica
**************************/
_System.prototype.DOM = new function()
{
    /*
    Generic HELPER functions
    */
    // Return DOM element using a string ID
    this.ObjPointer = function (Obj) {
        if (typeof Obj == "object")
        {
            return Obj;
        } else return document.getElementById(Obj);
    }

    // Generate a unique ID string used to create elements at runtime
    // Parameter is optional. If not provided, returns "objXXX", XXX number

    this.uniqueID = function(optionalBaseString) {
        var base = "";
        var uidcounter = 0;

        if (typeof optionalBaseString != "undefined")
        {
            base = optionalBaseString;
        } else base = "obj";

        var uidcounter=0;

        while (document.getElementById(base + uidcounter) != null) uidcounter++;

        return (base + uidcounter);
    }

    this.findPosX = function(obj) {
        var curleft = 0;
        if (obj.offsetParent) {
            while (1) {
                curleft+=obj.offsetLeft;
                if (!obj.offsetParent) {
                    break;
                }
                obj=obj.offsetParent;
            }
        } else if (obj.x) {
            curleft+=obj.x;
        }
        return curleft;
    }

    this.findPosY = function(obj) {
        var curtop = 0;
        if (obj.offsetParent) {
            while (1) {
                curtop+=obj.offsetTop;
                if (!obj.offsetParent) {
                    break;
                }
                obj=obj.offsetParent;
            }
        } else if (obj.y) {
            curtop+=obj.y;
        }
        return curtop;
    }

    this.getAbsoluteDivs = function()
    {
        var arr = new Array();
        var all_divs = document.body.getElementsByTagName("DIV");
        var j = 0;

        for (i = 0; i < all_divs.length; i++)
            if (all_divs.item(i).style.position=='absolute')
            {
                arr[j] = all_divs.item(i);
                j++;
            }

        return arr;
    }

    this.bringToFront = function(obj)
    {
        var divs = System.DOM.getAbsoluteDivs();
        var max_index = 0;
        var cur_index;

        // Compute the maximal z-index of
        // other absolute-positioned divs
        for (i = 0; i < divs.length; i++)
        {
            var item = divs[i];
            if (item == obj ||
                item.style.zIndex == '')
                continue;

            cur_index = parseInt(item.style.zIndex);
            if (max_index < cur_index)
            {
                max_index = cur_index;
            }
        }

        obj.style.zIndex = max_index + 1;
    }


    /*
    CLASS Handling functions
    */
    this.AddClass = function (Obj, NewClassName)
    {
        Obj = System.DOM.ObjPointer(Obj);
        sClass = Obj.className;
        if (!sClass.Contains(NewClassName))
        {
            sClass = sClass.RTrim() + " " + NewClassName;
            Obj.className = sClass;
            return true;
        } else return false;
    }

    this.RemoveClass = function (Obj, OldClassName)
    {
        Obj = System.DOM.ObjPointer(Obj);
        sClass = Obj.className;
        if (sClass.Contains(OldClassName))
        {
            var regExp = new RegExp(OldClassName + "\s*", "gi");
            sClass = sClass.replace(regExp, "").Trim();
            Obj.className = sClass;
            return true;
        } else return false;
    }

    this.ToggleClass = function(Obj, ClassName)
    {
        Obj = System.DOM.ObjPointer(Obj);
        sClass = Obj.className;
        if (sClass.Contains(ClassName))
        {
            return System.DOM.RemoveClass(Obj, ClassName);
        } else return System.DOM.AddClass(Obj, ClassName);
    }

    this.ReplaceClass = function(Obj, ClassName, NewClassName)
    {
        Obj = System.DOM.ObjPointer(Obj);
        sClass = Obj.className;
        if (sClass.Contains(ClassName))
        {
            if (System.DOM.RemoveClass(Obj, ClassName))
                return System.DOM.AddClass(Obj, NewClassName);
        } else return false;
    }


    /*
    --- END --- CLASS Handling functions
    */


    /*

    STYLE Handling functions

    */

    this.AddStyle = function (Obj, NewStyleName)
    {
        Obj = System.DOM.ObjPointer(Obj);
        NewStyleName = NewStyleName.toUpperCase();
        sStyle = Obj.style.cssText.toUpperCase();
        if (!sStyle.Contains(NewStyleName))
        {
            sStyle = sStyle.RTrim() + "; " + NewStyleName;
            Obj.style.cssText = sStyle;
            return true;
        } else return false;
    }

    this.RemoveStyle = function (Obj, OldStyleName)
    {
        Obj = System.DOM.ObjPointer(Obj);
        OldStyleName = OldStyleName.toUpperCase();
        sStyle = Obj.style.cssText.toUpperCase();
        if (sStyle.Contains(OldStyleName))
        {
            var regExp = new RegExp(OldStyleName + "\s*", "gi");
            sStyle = sStyle.replace(regExp, "").Trim();
            Obj.style.cssText = sStyle;
            return true;
        } else return false;
    }

    this.ToggleStyle = function(Obj, StyleName)
    {
        StyleName = StyleName.toUpperCase();
        Obj = System.DOM.ObjPointer(Obj);
        sStyle = Obj.style.cssText.toUpperCase();
        if (sStyle.Contains(StyleName))
        {
            return System.DOM.RemoveStyle(Obj, StyleName);
        } else return System.DOM.AddStyle(Obj, StyleName);
    }

    this.ReplaceStyle = function(Obj, StyleName, NewStyleName)
    {
        NewStyleName = NewStyleName.toUpperCase();
        StyleName = StyleName.toUpperCase();
        Obj = System.DOM.ObjPointer(Obj);
        sStyle = Obj.style.cssText.toUpperCase();
        if (sStyle.Contains(StyleName))
        {
            if (System.DOM.RemoveStyle(Obj, StyleName))
                return System.DOM.AddStyle(Obj, NewStyleName);
        } else return false;
    }


    /*

    --- END --- CLASS Handling functions

    */

}

// /js/namespaces/os.js
// Constants
BT_MAJOR_VERSION = 0;
BT_COMPLETE_VERSION = 1;

BT_IE = new CBrowserType("Internet Explorer");
BT_FIREFOX = new CBrowserType("Firefox");
BT_OPERA = new CBrowserType("Opera");
BT_SAFARI = new CBrowserType("Safari");
BT_OTHER = new CBrowserType("Other");


// Objects

_System.prototype.OS = new function()
{
    this.Browser = (new CBrowserType()).Detect();
    this.Browser.Analyze(BT_COMPLETE_VERSION);
}

function CBrowserType(SID)
{
    if (arguments.length == 0)
    {
        this.Detect = function() {

            var ieVersion;
            /*@cc_on
               /*@if (@_jscript_version == 5.7)
                    ieVersion = 7;
                @elif (@_jscript_version == 5.6)
                    ieVersion = 6;
                @elif (@_jscript_version == 5.5)
                    ieVersion = 5.5;
                @elif (@_jscript_version == 5.1)
                    ieVersion = 5.1;
                @elif (@_jscript_version == 5)
                    ieVersion = 5;
                @elif (@_jscript_version == 4)
                    ieVersion = 4;
                @else @*/
                  ieVersion = 0;
               /*@end
            @*/
            BT_IE.Version = ieVersion;
            return (ieVersion > 0 ? BT_IE : (typeof document.all == "object" ? BT_OPERA : (document.getElementById ? (document.implementation.createDocument.prototype ? BT_FIREFOX : BT_SAFARI) : BT_OTHER)));
        }
    } else {

        // Protected
        this.SID = SID;

        // Public
        this.toString = function() { return this.SID; };
        this.Analyze = function(versionType) {

            // Get Version

            // Internet Explorer

            if (typeof this.Version == "undefined")
            {
                if (this == BT_OPERA)
                {
                    if(window.opera) {
                        if(window.opera.version) {
                            this.Version = window.opera.version();
                        } else {
                            this.Version = navigator.userAgent.substring(navigator.userAgent.indexOf("Opera/")+6, navigator.userAgent.indexOf(" ("));
                        }
                    }
                } else if (this == BT_FIREFOX)
                {
                    this.Version = navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox/")+8);
                } else if (this == BT_SAFARI)
                {
                    this.Version = navigator.userAgent.substring(navigator.userAgent.indexOf("Version/")+8, navigator.userAgent.indexOf("Safari"));

                } else this.Version = "Unknown";

                if (versionType == BT_MAJOR_VERSION)
                {
                    if (this.Version.indexOf(".") != -1 && this.Version.lastIndexOf(".") != -1)
                    {
                        if (this.Version.indexOf(".") != this.Version.lastIndexOf("."))
                        {
                            this.Version = this.Version.substring(0, this.Version.indexOf(".")+2) * 1;
                        }
                    }
                }
            }

        }
    }
}// /js/namespaces/nsmonster.js
function CMonsterComponents()
{

}

function CjsUI()
{
    this.Components = new CMonsterComponents();
}

function CMonster()
{
    this.jsUI = new CjsUI();
}

Monster = new CMonster();
// /js/namespaces/components/basic.js

/* Function to mimic inheritance */

function IContainer(Caller)
{
    Caller.ContentHolder = null;
    Caller.Container = null;


    Caller.Skin = null;
    Caller.Parameters = new Array();

    Caller.AddParameter = function(TopObject)
    {
        return function(ParamName, ParamValue) {
            TopObject.Parameters.push(new Parameter(ParamName, ParamValue));
        }
    } (Caller);


    Caller.GetParameter = function(TopObject)
    {
        return function(ParamName) {
            TopObject.Parameters.push(new Parameter(ParamName, ParamValue));
        }
    } (Caller);

}// /js/namespaces/components/combobox.js
function ComboGlobals()
{


    this.MCCImagesPath = "http://media.monster.com/mm/cup/";


}

var MCCGlobals = new ComboGlobals();

function locationsVisible()
{
    return this.DropDownContent.style.visibility == "hidden" ? false : true;
}




var MCC__SELECTANDGO = 0;
var MCC__SELECTANDSTOP = 1;

function CComboBox(DropDownButton, ContentDiv, ComboFaceDiv, ComboCaptionText, GETVariableName, GETVariableINPUTID, AnchorName, Behaviour)
{
    this.hasEvent = false;
    this.AnchorName = AnchorName;

    this.DropDownBtn = document.getElementById(DropDownButton);
    this.DropDownContent = document.getElementById(ContentDiv);
    this.ComboFace = document.getElementById(ComboFaceDiv);
    this.ComboFace.parentNode.style.position = "absolute";
    this.ComboCaption = document.getElementById(ComboCaptionText);
    this.VariableName = GETVariableName;
    this.InputId = GETVariableINPUTID;

    this.LocationsVisible = locationsVisible;

    this.BtnMouseOver = function (CallerObject)
                        {
                            return function ()
                            {
                                CallerObject.DropDownBtn.src = MCCGlobals.MCCImagesPath + "xpbtn_o.gif";
                                CallerObject.DropDownBtn.parentNode.parentNode.className = "xpborder-focus combowidth comboline";
                            }
                        } (this);

    this.BtnMouseOut = function (CallerObject)
                        {
                            return function ()
                            {
                                CallerObject.DropDownBtn.src = MCCGlobals.MCCImagesPath + "xpbtn_n.gif";
                                CallerObject.DropDownBtn.parentNode.parentNode.className = "xpborder combowidth comboline";
                            }
                        } (this);

    this.BtnMouseDown = function (CallerObject)
                        {
                            return function ()
                            {
                                CallerObject.DropDownBtn.src = MCCGlobals.MCCImagesPath + "xpbtn_p.gif";
                            }
                        } (this);

    this.BtnMouseUp = function (CallerObject)
                        {
                            return function (e)
                            {
                                CallerObject.DropDownBtn.src = MCCGlobals.MCCImagesPath + "xpbtn_o.gif";

                                if (System.OS.Browser == BT_IE)
                                {
                                    window.event.cancelBubble = true;
                                    if (CallerObject.hasEvent)
                                    {
                                        document.body.detachEvent("onclick", CallerObject.ClickHandler);
                                    } else document.body.attachEvent("onclick", CallerObject.ClickHandler);
                                } else {
                                    if (CallerObject.hasEvent)
                                    {
                                        document.body.removeEventListener("click", CallerObject.ClickHandler, false);
                                    } else document.body.addEventListener("click", CallerObject.ClickHandler, false);
                                    e.stopPropagation();
                                }

                                CallerObject.hasEvent = !CallerObject.hasEvent;

                                if (CallerObject.LocationsVisible())
                                {
                                    CallerObject.DropDownContent.style.display = "none";

                                    CallerObject.DropDownContent.style.visibility = "hidden";
                                    CallerObject.DropDownContent.style.overflow = "hidden";
                                } else {
                                    CallerObject.DropDownContent.style.visibility = "visible";
                                    CallerObject.DropDownContent.style.overflow = "auto";
                                    CallerObject.DropDownContent.style.display = "block";
                                }
                            }
                        } (this);

    this.ClickHandler = function (CallerObject)
                        {
                            return function(mevent)
                            {
                                src = System.OS.Browser == BT_IE ? window.event.srcElement : mevent.srcElement;
                                if (!src) src = System.OS.Browser == BT_IE ? window.event.target : mevent.target;

                                inside = false;
                                while (src.nodeName != "BODY")
                                {
                                    if (src.id.indexOf("MCC__") > -1)
                                    {
                                        inside = true;
                                        break;
                                    }
                                    src = src.parentNode;
                                }

                                if (!inside)
                                {

                                    CallerObject.MCCOpen();
                                }
                            }

                        } (this);


    this.MCCOpen = function(CallerObject)
                    {
                        return function (e)
                        {
                            if (System.OS.Browser == BT_IE)
                            {
                                window.event.cancelBubble = true;
                                if (CallerObject.hasEvent)
                                {
                                    document.body.detachEvent("onclick", CallerObject.ClickHandler);
                                } else document.body.attachEvent("onclick", CallerObject.ClickHandler);
                            } else {
                                if (CallerObject.hasEvent)
                                {
                                    document.body.removeEventListener("click", CallerObject.ClickHandler, false);
                                } else document.body.addEventListener("click", CallerObject.ClickHandler, false);
                                if (e) e.stopPropagation();
                            }

                            CallerObject.hasEvent = !CallerObject.hasEvent;



                            if (CallerObject.LocationsVisible())
                            {
                                CallerObject.DropDownContent.style.display = "none";

                                CallerObject.DropDownContent.style.visibility = "hidden";
                                CallerObject.DropDownContent.style.overflow = "hidden";
                            } else {
                                CallerObject.DropDownContent.style.visibility = "visible";
                                CallerObject.DropDownContent.style.overflow = "auto";
                                CallerObject.DropDownContent.style.display = "block";
                            }


                        }
                } (this);






    this.LineMouseOver = function ()
                        {
                            if (this.style.backgroundColor != "#669999")
                            {
                                this.style.backgroundColor = "#316ac5";
                                this.childNodes[0].className = this.childNodes[0].className.replace("combotext", "combotexthover" )

                            }
                        }

    this.LineMouseOut = function ()
                        {
                            if (this.style.backgroundColor != "#669999")
                            {
                                this.style.backgroundColor = "#ffffff";
                                this.childNodes[0].className = this.childNodes[0].className.replace("combotexthover", "combotext")
                            }
                        }

    this.LineClick = function(CallerObject)
                    {
                        return function ()
                        {
                            Href = this.childNodes[0].href;
                            this.childNodes[0].href = "#" + CallerObject.AnchorName;
                            CallerObject.ComboCaption.innerHTML = this.innerHTML;
                            ttle = CallerObject.ComboCaption.childNodes[0];
                            ttle.onmouseover = null;
                            ttle.onmouseout = null;
                            ttle.onclick = CallerObject.MCCOpen;

                            ttle.style.backgroundColor = "#ffffff";
                            ttle.style.color = "#333333";

                            if (System.OS.Browser == BT_IE)
                            {

                                if (CallerObject.hasEvent)
                                {
                                    document.body.detachEvent("onclick", CallerObject.ClickHandler);
                                } else document.body.attachEvent("onclick", CallerObject.ClickHandler);
                            } else {
                                if (CallerObject.hasEvent)
                                {
                                    document.body.removeEventListener("click", CallerObject.ClickHandler, false);
                                } else document.body.addEventListener("click", CallerObject.ClickHandler, false);
                            }

                            CallerObject.hasEvent = !CallerObject.hasEvent;

                            if (CallerObject.LocationsVisible())
                            {
                                CallerObject.DropDownContent.style.display = "none";

                                CallerObject.DropDownContent.style.visibility = "hidden";
                                CallerObject.DropDownContent.style.overflow = "hidden";
                            } else {
                                CallerObject.DropDownContent.style.visibility = "visible";
                                CallerObject.DropDownContent.style.overflow = "auto";
                                CallerObject.DropDownContent.style.display = "block";
                            }

                            document.getElementById(CallerObject.InputId).value = Href;

                        }
                    } (this);

    this.LineClickGo = function ()
    {
        Href = this.childNodes[0].href;
        window.location.assign(Href);
    }




    this.DropDownBtn.onmouseover = this.BtnMouseOver;
    this.DropDownBtn.onmouseout = this.BtnMouseOut;
    this.DropDownBtn.onmousedown = this.BtnMouseDown;


    this.ComboFace.onmouseover = this.BtnMouseOver;
    this.ComboFace.onmouseout = this.BtnMouseOut;


    this.ComboCaption.onmouseover = this.BtnMouseOver;
    this.ComboCaption.onmouseout = this.BtnMouseOut;

    this.ComboFace.onclick = this.MCCOpen;
    this.ComboCaption.onclick = this.MCCOpen;
    this.DropDownBtn.onclick = this.BtnMouseUp;

    this.DropDownBtn.style.cursor = "pointer";
    this.DropDownContent.style.visibility = "hidden";
    this.DropDownContent.style.overflow = "hidden";
    this.DropDownContent.style.display = "none";
    //this.DropDownContent.onscroll = MCCOnComboScroll;

    divs = this.DropDownContent.getElementsByTagName("div");

    for (i=0; i<divs.length; i++)
    {
        if (divs[i].className == "comboline linewidth combotext")
        {
            if (divs[i].childNodes[0].href.indexOf("#") == -1)
            {
                divs[i].style.cursor = "pointer";
                divs[i].style.width = "183px";
                divs[i].onmouseover = this.LineMouseOver;
                divs[i].onmouseout = this.LineMouseOut;
                if (Behaviour == MCC__SELECTANDGO)
                {
                    divs[i].onclick = this.LineClickGo;
                } else divs[i].onclick = this.LineClick;
                divs[i].onmouseover();
                divs[i].onmouseout();
            } else divs[i].childNodes[0].style.cursor = "default"
        }
    }

    input = document.createElement("INPUT");
    input.setAttribute('type', 'hidden');
    input.setAttribute('id', this.InputId);
    input.setAttribute('name', this.VariableName);
    this.DropDownContent.appendChild(input);

}




////////////////
// This function scrolls exactly one item up or down
// so that the last item in the list is not partially shown
// - Buggy on IE
///////////////
function MCCOnComboScroll()
{
    var x = this.scrollTop;
    var y = 17;

    fpart = Math.round(((x / 17) * 10) % 10);
    ipart = Math.floor(x/17);

    if (fpart >= 5)
    {
        this.scrollTop = 17 * (ipart+1);
    } else this.scrollTop = 17 * ipart;
}
// /js/namespaces/components/jcombobox.js
var ComboBoxSkins = {
    XPRoyale : {
        Border: "1px solid #7f9db9",
        BorderOver: "1px solid #335ea8",
        ButtonOver: "http://media.monster.com/mm/homepage/qs/xpbtn_o.gif",
        ButtonNormal: "http://media.monster.com/mm/homepage/qs/xpbtn_n.gif",
        ButtonPressed: "http://media.monster.com/mm/homepage/qs/xpbtn_p.gif",
        ssWidth: "9px",
        ssHeight: "9px",
        isWidth: 9,
        isHeight: 9,
        FaceBackgroundColor: "white",
        ContentBackgroundColor: "white",
        Cursor: "pointer",
        FontFamily: "Verdana",
        FontSize: "11px",
        FontColor: "#333333"
    },
    AlphaChannel: "http://media.monster.com/mm/homepage/qs/spacer.png",
    MaxHeight : 17,
    HolderHeight: 120,
    ApplyIEFilter: function (El)
    {
        El.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + El.src + "', sizingMethod='image')";
        El.src = this.AlphaChannel;
    }
}; // ComboBoxSkins class



function CjComboBox(Skin)
{
    IContainer(this); // Inherit IContainer

    this.Skin = Skin;
    this.hasEvent = false; // Has the outside click event handler = false

    this.Width = 200; //default width

    this.getWidth = function() { return this.Width; }
    this.setWidth = function(w) { this.Width = w; this.setContentWidth(w) }

    this.ContentWidth = this.Width; //defualt to size of parent
    this.ContentHeight = ComboBoxSkins.HolderHeight; //default width
    this.getHeight = function() { return this.ContentHeight; }
    this.setHeight = function(h) { this.ContentHeight = h; }


    this.setContentWidth = function(w) { this.ContentWidth = w;}
    this.Float = "left";

    this.CloseBoxes = new Array();

    this.closeOnOpen = function(boxes)
    {
        this.CloseBoxes = boxes;
    }

    this.setFloat = function(f)
    {
        this.Float = f;
    }

    this.Caption = "";
    this.FirstCaption = "";
    this.setCaption = function(newText) {
        this.Caption = newText;
        if (this.ComboCaption)
        {
            this.ComboCaption.innerHTML = this.Caption;
        }

        if (this.FirstCaption == "")
        {
            this.FirstCaption = this.Caption;
        }
    }

    this.AttachTo = function (Container)
    {
        this.Container = Container;
        // override default AttachTo
        if (typeof this.Container == "string")
        {
            System.DOM.ObjPointer(this.Container).appendChild(this.ComboFace);
            System.DOM.ObjPointer(this.Container).appendChild(this.ContentHolder);
        }
    }





    this.RepositionHolder = function()
    {
        //this.ContentHolder.style.top = (System.DOM.findPosY(this.ComboFace) + ComboBoxSkins.MaxHeight + 1) + "px";
        //this.ContentHolder.style.left = System.DOM.findPosX(this.ComboFace) + "px";
        //if (System.OS.Browser != BT_IE) this.ContentHolder.style.top = "21px"
        //this.ContentHolder.style.zIndex = "1000000";
    }

    this.Create = function()
    {
        this.ComboFace = document.createElement("div");
        this.ComboFace.id = System.DOM.uniqueID("CjComboBox");
        this.ComboFace.style.width = this.Width + "px";
        this.ComboFace.style.height = ComboBoxSkins.MaxHeight + "px";
        this.ComboFace.style.border = this.Skin.Border;
        this.ComboFace.style.lineHeight = ComboBoxSkins.MaxHeight + "px";
        this.ComboFace.style.backgroundColor = this.Skin.FaceBackgroundColor;
        this.ComboFace.style.cursor = this.Skin.Cursor;
        this.ComboFace.style.zIndex = 10000;
        this.ComboFace.style.styleFloat = this.Float;
        this.ComboFace.style.cssFloat = this.Float;



        // Create Caption bar
        this.ComboCaption = document.createElement("div");
        this.ComboCaption.id = System.DOM.uniqueID("jComboCaption");
        this.ComboCaption.style.FontFamily = this.Skin.FontFamily;
        this.ComboCaption.style.FontSize = this.Skin.FontSize;
        this.ComboCaption.style.FontColor = this.Skin.FontColor;
        this.ComboCaption.style.styleFloat = "left";
        this.ComboCaption.style.cssFloat = "left";
        this.ComboCaption.style.backgroundColor = this.Skin.FaceBackgroundColor;
        this.ComboCaption.style.cursor = this.Skin.Cursor;
        this.ComboCaption.style.lineHeight = ComboBoxSkins.MaxHeight + "px";
        this.ComboCaption.style.paddingLeft = "2px";
        this.setCaption(this.Caption);

        // Create Button Holder
        this.ComboButtonHolder = document.createElement("div");
        this.ComboButtonHolder.style.styleFloat = "right";
        this.ComboButtonHolder.style.cssFloat = "right";
        this.ComboButtonHolder.style.width = ComboBoxSkins.MaxHeight + "px";
        this.ComboButtonHolder.style.height = ComboBoxSkins.MaxHeight + "px";

        // Create Button
        this.ComboButton = document.createElement("img");
        this.ComboButton.alt = this.Caption;
        this.ComboButton.id = System.DOM.uniqueID("jComboButton");
        this.ComboButton.src = this.Skin.ButtonNormal;

        var brclr = document.createElement("br");
            brclr.style.clear = "both";
            brclr.style.cssFloat = "none";
            brclr.style.styleFloat = "none";

        this.ContentHolder = document.createElement("div");
        this.ContentHolder.style.height = this.ContentHeight + "px";
        this.ContentHolder.style.width = this.ContentWidth + "px";
        this.ContentHolder.style.backgroundColor = this.Skin.ContentBackgroundColor;
        this.ContentHolder.style.border = this.Skin.Border;
        this.ContentHolder.style.position = "absolute";
        this.ContentHolder.style.overflow = "hidden";
        this.ContentHolder.style.overflowX = "hidden";
        this.ContentHolder.style.display = "none";
        this.ContentHolder.style.zIndex = this.ComboFace.style.zIndex - 1;
        this.ContentHolder.style.clear = "both";
        this.ContentHolder.id = System.DOM.uniqueID("jComboContentHolder");



        this.ComboFace.appendChild(this.ComboCaption);
        this.ComboButtonHolder.appendChild(this.ComboButton);

        this.ComboFace.appendChild(this.ComboButtonHolder);
        this.ComboFace.appendChild(brclr);
        //var markerid=System.DOM.uniqueID("marker");
        //document.write("<span id='" + markerid + "' style='display: none'></span>");

        //System.DOM.ObjPointer(markerid).parentNode.appendChild(this.ComboFace);
        document.body.appendChild(this.ComboFace);

        this.RepositionHolder();
        document.body.appendChild(this.ContentHolder);
        System.DOM.bringToFront(this.ComboFace);
        //document.body.removeChild(this.ComboFace);
        //document.body.appendChild(this.ComboFace);




        // Adding Events
        this.ComboButton.onmouseover = this.BtnMouseOver;
        this.ComboButton.onmouseout = this.BtnMouseOut;
        this.ComboButton.onmousedown = this.BtnMouseDown;
        this.ComboButton.onclick = this.BtnMouseUp;

        this.ComboFace.onmouseover = this.BtnMouseOver;
        this.ComboFace.onmouseout = this.BtnMouseOut;
        this.ComboFace.onclick = this.MCCOpen;

        this.ComboCaption.onmouseover = this.BtnMouseOver;
        this.ComboCaption.onmouseout = this.BtnMouseOut;
        this.ComboCaption.onclick = this.MCCOpen;

    }

    this.ContentVisible = function() { return this.ContentHolder.style.display == "none" ? false : true; }
    this.ShowContent = function() { this.RepositionHolder(); this.ContentHolder.style.display = "block"; }
    this.HideContent = function() { this.ContentHolder.style.display = "none"; }

    this.BtnMouseOver = function (CallerObject)
                        {
                            return function ()
                            {
                                CallerObject.ComboButton.src = CallerObject.Skin.ButtonOver;
                                CallerObject.ComboFace.style.border = CallerObject.Skin.BorderOver;
                            }
                        } (this);

    this.BtnMouseOut = function (CallerObject)
                        {
                            return function ()
                            {
                                CallerObject.ComboButton.src = CallerObject.Skin.ButtonNormal;
                                CallerObject.ComboFace.style.border = CallerObject.Skin.Border;
                            }
                        } (this);

    this.BtnMouseDown = function (CallerObject)
                        {
                            return function ()
                            {
                                CallerObject.ComboButton.src = CallerObject.Skin.ButtonPressed;
                            }
                        } (this);

    this.BtnMouseUp = function (CallerObject)
                        {
                            return function (e)
                            {
                                for (i=0; i<CallerObject.CloseBoxes.length; i++)
                                {
                                    if (CallerObject.CloseBoxes[i].ContentVisible()) {
                                        CallerObject.CloseBoxes[i].MCCOpen();
                                    }
                                }

                                CallerObject.ComboButton.src = CallerObject.Skin.ButtonOver;

                                if (System.OS.Browser == BT_IE)
                                {
                                    window.event.cancelBubble = true;
                                    if (CallerObject.hasEvent)
                                    {
                                        document.body.detachEvent("onclick", CallerObject.ClickHandler);
                                    } else document.body.attachEvent("onclick", CallerObject.ClickHandler);
                                } else {
                                    if (CallerObject.hasEvent)
                                    {
                                        document.body.removeEventListener("click", CallerObject.ClickHandler, false);
                                    } else document.body.addEventListener("click", CallerObject.ClickHandler, false);
                                    e.stopPropagation();
                                }

                                CallerObject.hasEvent = !CallerObject.hasEvent;

                                if (CallerObject.ContentVisible())
                                {
                                    CallerObject.HideContent();
                                } else {
                                    CallerObject.ShowContent();
                                }
                            }
                        } (this);

    this.ClickHandler = function (CallerObject)
                        {
                            return function(mevent)
                            {
                                src = System.OS.Browser == BT_IE ? window.event.srcElement : mevent.srcElement;
                                if (!src) src = System.OS.Browser == BT_IE ? window.event.target : mevent.target;

                                inside = false;
                                while (src.nodeName != "BODY")
                                {
                                    if (src.id.indexOf("jCombo") > -1 )
                                    {
                                        inside = true;
                                        break;
                                    }
                                    src = src.parentNode;
                                }

                                if (!inside)
                                {

                                    CallerObject.MCCOpen();
                                }
                            }

                        } (this);


    this.MCCOpen = function(CallerObject)
                    {
                        return function (e)
                        {
                            for (i=0; i<CallerObject.CloseBoxes.length; i++)
                                {
                                    if (CallerObject.CloseBoxes[i].ContentVisible()) {
                                        CallerObject.CloseBoxes[i].MCCOpen();
                                    }
                            }

                            if (System.OS.Browser == BT_IE)
                            {
                                window.event.cancelBubble = true;
                                if (CallerObject.hasEvent)
                                {
                                    document.body.detachEvent("onclick", CallerObject.ClickHandler);
                                } else document.body.attachEvent("onclick", CallerObject.ClickHandler);
                            } else {
                                if (CallerObject.hasEvent)
                                {
                                    document.body.removeEventListener("click", CallerObject.ClickHandler, false);
                                } else document.body.addEventListener("click", CallerObject.ClickHandler, false);
                                if (e) e.stopPropagation();
                            }

                            CallerObject.hasEvent = !CallerObject.hasEvent;



                            if (CallerObject.ContentVisible())
                            {
                                CallerObject.HideContent();

                            } else {
                                CallerObject.ShowContent();
                            }


                        }
                } (this);

}// /js/namespaces/components/treeview.js
var TreeViewSkins = {
    XPRoyale : {
        Collapsed: "http://media.monster.com/mm/homepage/qs/xproyale/treeview-collapsed-sign.png",
        Expanded: "http://media.monster.com/mm/homepage/qs/xproyale/treeview-expanded-sign.png",
        Normal: "http://media.monster.com/mm/homepage/qs/xproyale/radio-unselected.png",
        NormalHover: "http://media.monster.com/mm/homepage/qs/xproyale/radio-over.png",
        NormalPressed: "http://media.monster.com/mm/homepage/qs/xproyale/radio-unselected-pressed.png",
        Selected: "http://media.monster.com/mm/homepage/qs/xproyale/radio-selected.png",
        SelectedHover: "http://media.monster.com/mm/homepage/qs/xproyale/radio-selected-over.png",
        SelectedPressed: "http://media.monster.com/mm/homepage/qs/xproyale/radio-selected-pressed.png",
        Disabled: "http://media.monster.com/mm/homepage/qs/xproyale/radio-disabled.png",
        ssWidth: "9px",
        ssHeight: "9px",
        isWidth: 9,
        isHeight: 9,
        ContentBackgroundColor: "white",
        Cursor: "pointer",
        FontFamily: "Verdana",
        FontSize: "11px",
        FontColor: "#333333"
    },

    VistaAero : {
        Collapsed: "http://media.monster.com/mm/homepage/qs/vista/treeview-collapsed-sign.png",
        Expanded: "http://media.monster.com/mm/homepage/qs/vista/treeview-expanded-sign.png",
        Normal: "http://media.monster.com/mm/homepage/qs/vista/radio-unselected.png",
        NormalHover: "http://media.monster.com/mm/homepage/qs/vista/radio-over.png",
        NormalPressed: "http://media.monster.com/mm/homepage/qs/vista/radio-over.png",
        Selected: "http://media.monster.com/mm/homepage/qs/vista/radio-selected.png",
        SelectedHover: "http://media.monster.com/mm/homepage/qs/vista/radio-unselected-pressed.png",
        SelectedPressed: "http://media.monster.com/mm/homepage/qs/vista/radio-selected.png",
        Disabled: "http://media.monster.com/mm/homepage/qs/xproyale/radio-disabled.png",
        ssWidth: "9px",
        ssHeight: "9px",
        isWidth: 9,
        isHeight: 9
    },

    AlphaChannel: "http://media.monster.com/mm/homepage/qs/spacer.png",
    MaxHeight : 17,
    ApplyIEFilter: function (El)
    {
        El.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + El.src + "', sizingMethod='image')";
        El.src = this.AlphaChannel;
    }
}; // TreeViewSkins class

var TextNodeSkins = {
    XPRoyale : {
        ContentBackgroundColor: "white",
        Cursor: "pointer",
        FontFamily: "Verdana",
        FontSize: "11px",
        FontColor: "#333333",
        Height: 17,
        Padding: "0px 0px 0px 3px",
        OnOverStyle: "text-decoration: none",
        OnOutStyle: "text-decoration: none"
    },

    VistaAero : {
        ContentBackgroundColor: "white",
        Cursor: "pointer",
        FontFamily: "Verdana",
        FontSize: "11px",
        FontColor: "#333333",
        Height: 17,
        Padding: "0px 0px 0px 3px",
        OnOverStyle: "text-decoration: none",
        OnOutStyle: "text-decoration: none"
    },

    AlphaChannel: "http://media.monster.com/mm/homepage/qs/spacer.png",
    MaxHeight : 17,
    ApplyIEFilter: function (El)
    {
        El.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + El.src + "', sizingMethod='image')";
        El.src = this.AlphaChannel;
    }
}; // TextNodeSkins class

var TVCheckBoxMenuSkins = {
    XPRoyale : {
        ContentBackgroundColor: "#AEC350",
        Cursor: "pointer",
        FontFamily: "Verdana",
        FontSize: "11px",
        FontColor: "#4B590E",
        Height: 17,
        Padding: "0px 3px 0px 3px",
        OnOverStyle: "text-decoration: none",
        OnOutStyle: "text-decoration: none"
    },

    VistaAero : {
        ContentBackgroundColor: "white",
        Cursor: "pointer",
        FontFamily: "Verdana",
        FontSize: "11px",
        FontColor: "#333333",
        Height: 17,
        Padding: "0px 3px 0px 3px",
        OnOverStyle: "text-decoration: none",
        OnOutStyle: "text-decoration: none"
    },

    AlphaChannel: "http://media.monster.com/mm/homepage/qs/spacer.png",
    MaxHeight : 17,
    ApplyIEFilter: function (El)
    {
        El.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + El.src + "', sizingMethod='image')";
        El.src = this.AlphaChannel;
    }
}; // TVCheckBoxMenuSkins class

function Parameter(paramName, paramValue)
{
    this.Name = paramName;
    this.Value = paramValue;
}



function CTextNode(Skin, Caption, Variable, TreeView)
{
    this.Caption = "";
    this.Element = null;
    this.Skin = Skin;
    this.Value = "";
    this.TreeView = TreeView;
    this.Variable = Variable;

    this.setCaption = function (caption)
    {
        this.Caption = caption;
        if (this.Element != null)
        {
            this.Element.innerHTML = this.Caption;
            this.Element.title = this.Caption;
        }
    }

    this.setValue = function(newValue)
    {
        this.Value = newValue;
        //this.Checkbox.value = this.Value;
    }

    this.Create = function()
    {
        this.Element = document.createElement("div");
        this.Element.style.padding = this.Skin.Padding;
        this.Element.style.styleFloat = "left";
        this.Element.style.cssFloat = "left";
        //this.Element.style.height = this.Skin.Height + "px";
        this.Element.style.height = "auto";
        this.Element.style.width = this.TreeView.Container.ContentWidth - 50 + "px";
        this.Element.style.fontFamily = this.Skin.FontFamily;
        this.Element.style.fontSize = this.Skin.FontSize;
        this.Element.style.color = this.Skin.FontColor;
        this.Element.style.cursor = this.Skin.Cursor;
        this.Element.style.lineHeight = this.Skin.Height + "px";
        this.Element.innerHTML = this.Caption;
        this.Element.title = this.Caption;
        this.Element.style.overflow = "hidden";


        // Events
        this.Element.onmouseover = function(Caller) { return function() { System.DOM.AddStyle(Caller.Element, Caller.Skin.OnOverStyle); } } (this)
        this.Element.onmouseout = function(Caller) { return function() { System.DOM.ReplaceStyle(Caller.Element, Caller.Skin.OnOverStyle, Caller.Skin.OnOutStyle); } } (this)

    }

    if (typeof Caption != "undefined")
    {
        this.Caption = Caption;
        this.Create();
    }
}

function CCheckBoxTextNode(Skin, Caption, Variable, TreeView)
{
    this.Caption = "";
    this.Element = null;
    this.Skin = Skin;
    this.Value = "";
    this.TreeView = TreeView;
    this.Checkbox = null;
    this.Variable = Variable;

    this.FirstCaption = "";
    this.setCaption = function (caption)
    {
        this.Caption = caption;
        if (this.Element != null)
        {
            this.Element.innerHTML = this.Caption;
        }
        if (this.FirstCaption == "")
        {
            this.FirstCaption = this.Caption;
        }
    }

    this.setValue = function(newValue)
    {
        this.Value = newValue;
        this.Checkbox.value = this.Value;
    }

    this.Create = function()
    {
        this.Element = document.createElement("div");
        this.Element.style.padding = this.Skin.Padding;
        this.Element.style.styleFloat = "left";
        this.Element.style.cssFloat = "left";
        //this.Element.style.height = this.Skin.Height + "px";
        this.Element.style.height = "auto";
        this.Element.style.fontFamily = this.Skin.FontFamily;
        this.Element.style.fontSize = this.Skin.FontSize;
        this.Element.style.color = this.Skin.FontColor;
        this.Element.style.cursor = this.Skin.Cursor;
        this.Element.style.lineHeight = this.Skin.Height + "px";
        this.Element.style.width = this.TreeView.Container.ContentWidth - 40 + "px";
        this.Element.style.overflow = "hidden";

        this.Checkbox = document.createElement("input");
        this.Checkbox.type = "checkbox";
        this.Checkbox.style.styleFloat = "left";
        this.Checkbox.style.cssFloat = "left";
        this.Checkbox.style.lineHeight = this.Skin.Height + "px";
        this.Checkbox.value = this.Value;
        this.Checkbox.name = this.Variable;

        this.TextNode = document.createElement("div");
        this.TextNode.style.padding = this.Skin.Padding;
        this.TextNode.style.styleFloat = "left";
        this.TextNode.style.cssFloat = "left";
        //this.TextNode.style.height = this.Skin.Height + "px";
        this.TextNode.style.height = "auto";
        this.TextNode.style.fontFamily = this.Skin.FontFamily;
        this.TextNode.style.fontSize = this.Skin.FontSize;
        this.TextNode.style.color = this.Skin.FontColor;
        this.TextNode.style.cursor = this.Skin.Cursor;
        this.TextNode.style.lineHeight = this.Skin.Height + "px";
        this.TextNode.style.width = this.TreeView.Container.ContentWidth - 65 + "px";
        this.TextNode.innerHTML = this.Caption;
        this.TextNode.title = this.Caption;

        this.Element.appendChild(this.Checkbox);
        this.Element.appendChild(this.TextNode);



        // Events
        this.TextNode.onmouseover = function(Caller) { return function() { System.DOM.AddStyle(Caller.TextNode, Caller.Skin.OnOverStyle); } } (this);
        this.TextNode.onmouseout = function(Caller) { return function() { System.DOM.ReplaceStyle(Caller.TextNode, Caller.Skin.OnOverStyle, Caller.Skin.OnOutStyle); } } (this);
        this.TextNode.onclick = function(Caller) { return function() {
            Caller.Checkbox.checked = !Caller.Checkbox.checked;

            Caller.Checkbox.onclick();

            } } (this);

        this.Checkbox.onclick = function(Caller) { return function() {
            var inc = (Caller.Checkbox.checked ? 1 : (Caller.TreeView.Tag == 0 ? 0 : -1));
            if (Caller.TreeView.Tag == "")
            {
                Caller.TreeView.Tag = 0;
            }
            Caller.TreeView.Tag += inc;
            if (Caller.TreeView.Tag < 21)
            {
                if (Caller.TreeView.Tag == 0)
                {
                    Caller.TreeView.Container.setCaption(Caller.TreeView.Container.FirstCaption);
                } else Caller.TreeView.Container.setCaption(Caller.TreeView.Tag + Caller.TreeView.SelectionChange);
            } else
            {
                Caller.TreeView.Container.setCaption(Caller.TreeView.MaximumSelection);
                Caller.Checkbox.checked = false;
                Caller.TreeView.Tag--;
            }
            } } (this);

    }

    if (typeof Caption != "undefined")
    {
        this.Caption = Caption;
        this.Create();
    }
}

// Custom class for checkbox menu
function CCheckBoxMenu(Skin, TreeView)
{
    this.Item1Caption = "Alle entfernen";
    this.Item2Caption = "Schliessen";
    this.Element = null;
    this.Skin = Skin;
    this.TreeView = TreeView;
    this.Skin.ContentBackgroundColor = '#82B5D2';
    this.Skin.FontColor = '#FFFFFF';


    this.Create = function()
    {
        this.Item1 = document.createElement("div");
        this.Item1.style.padding = this.Skin.Padding;
        this.Item1.style.styleFloat = "left";
        this.Item1.style.cssFloat = "left";
        this.Item1.style.height = this.Skin.Height + "px";
        this.Item1.style.fontFamily = this.Skin.FontFamily;
        this.Item1.style.fontSize = this.Skin.FontSize;
        this.Item1.style.color = this.Skin.FontColor;
        this.Item1.style.cursor = this.Skin.Cursor;
        this.Item1.style.lineHeight = this.Skin.Height + "px";
        this.Item1.style.backgroundColor = this.Skin.ContentBackgroundColor;
        this.Item1.innerHTML = this.Item1Caption;

        // Events
        this.Item1.onmouseover = function(Caller) { return function() { System.DOM.AddStyle(Caller.Item1, Caller.Skin.OnOverStyle); } } (this);
        this.Item1.onmouseout = function(Caller) { return function() { System.DOM.ReplaceStyle(Caller.Item1, Caller.Skin.OnOverStyle, Caller.Skin.OnOutStyle); } } (this);
        this.Item1.onclick = function(Caller) { return function() {
                for (var i=0; i<Caller.TreeView.rootNode.Count; i++)
                {
                    // 1 tier only - to edit in the future (recursive)
                    if (Caller.TreeView.rootNode.children[i].Count > 0)
                    {
                        for (var j=0; j<Caller.TreeView.rootNode.children[i].Count; j++)
                        {
                            Caller.TreeView.rootNode.children[i].children[j].nodeItem.Checkbox.checked = false;
                            Caller.TreeView.rootNode.children[i].children[j].nodeItem.Checkbox.onclick();
                        }

                    } else {
                        Caller.TreeView.rootNode.children[i].nodeItem.Checkbox.checked = false;
                        Caller.TreeView.rootNode.children[i].nodeItem.Checkbox.onclick();
                    }

                }
                Caller.TreeView.Container.setCaption(Caller.TreeView.Container.FirstCaption);
            } } (this);

        this.Item2 = document.createElement("div");
        this.Item2.style.padding = this.Skin.Padding;
        this.Item2.style.styleFloat = "right";
        this.Item2.style.cssFloat = "right";
        this.Item2.style.height = this.Skin.Height + "px";
        this.Item2.style.fontFamily = this.Skin.FontFamily;
        this.Item2.style.fontSize = this.Skin.FontSize;
        this.Item2.style.color = this.Skin.FontColor;
        this.Item2.style.cursor = this.Skin.Cursor;
        this.Item2.style.lineHeight = this.Skin.Height + "px";
        this.Item2.style.backgroundColor = this.Skin.ContentBackgroundColor;
        this.Item2.innerHTML = this.Item2Caption;


        // Events
        this.Item2.onmouseover = function(Caller) { return function() { System.DOM.AddStyle(Caller.Item2, Caller.Skin.OnOverStyle); } } (this)
        this.Item2.onmouseout = function(Caller) { return function() { System.DOM.ReplaceStyle(Caller.Item2, Caller.Skin.OnOverStyle, Caller.Skin.OnOutStyle); } } (this);
        this.Item2.onclick = function(Caller) { return function() { Caller.TreeView.Container.MCCOpen(); } } (this);

        this.Element = document.createElement("div");
        this.Element.style.width = "100%";
        this.Element.style.height = this.Skin.Height + "px";
        this.Element.style.backgroundColor = this.Skin.ContentBackgroundColor;

        this.Element.appendChild(this.Item1);
        this.Element.appendChild(this.Item2);
    }
}


function CTreeViewNode(nodeValue, nodeItem)
{
    this.nodeValue = (typeof nodeValue == "undefined" ? null : nodeValue);
    this.nodeItem = (typeof nodeItem == "undefined" ? null : nodeItem);

    if (this.nodeItem != null)
    {
        if (this.nodeItem.Value == "") // exists but not set
        {
            this.nodeItem.setValue(this.nodeValue);
        }
    }
    this.children = null;
    this.Count = 0; // children count
    this.nodeParent = null;

    this.AddNode = function(nodeValue, nodeItem)
    {
        var t = new CTreeViewNode(nodeValue, nodeItem);
        t.nodeParent = this;
        if (this.children == null)
        {
            this.children = new Array();
        }

        this.children.push(t);
        this.Count = this.children.length;
        return t;
    }


} // CTreeViewNode()

function CTreeView(Skin)
{
    IContainer(this); //Inherit IContainer

    // CheckBox Specific
    this.ContentArea = null;
    this.Menu = null;
    //

    this.Skin = Skin;
    this.rootNode = null;
    this.Nodes = new Array();
    //temp
    this.Xpath = "";
    this.setXPath = function(s)
    {
        this.Xpath = s;
    }

    this.IdJoin = ".";
    this.setIdJoin = function(s)
    {
        this.IdJoin = s;
    }

    this.SelectionChange = " items selected";
    this.MaximumSelection = "Maximum items selected";

    //temp - may not be the best way
    this.Tag = ""; // all purpose variable

    this.AttachTo = function (Container)
    {
        this.Container = Container;
        //
    }

    this.Create = function()
    {
        this.Menu = new CCheckBoxMenu(TVCheckBoxMenuSkins.XPRoyale, this);
        this.Menu.Create();

        this.ContentArea = document.createElement("div");
        if (this.Container != null)
        {
            this.ContentArea.style.height = this.Container.ContentHeight  + "px";
        }
        this.ContentArea.style.width = "100%";
        this.ContentArea.style.backgroundColor = this.Skin.ContentBackgroundColor;

        this.ContentHolder = document.createElement("div");
        this.ContentHolder.style.height = (this.Container.ContentHeight-TVCheckBoxMenuSkins.XPRoyale.Height) + "px";
        this.ContentHolder.style.width = "100%";
        this.ContentHolder.style.backgroundColor = this.Skin.ContentBackgroundColor;
        this.ContentHolder.style.overflow = "scroll";
        this.ContentHolder.style.overflowX = "hidden";
        this.ContentHolder.style.overflowY = "scroll";

        this.ContentArea.appendChild(this.ContentHolder);
        this.ContentArea.appendChild(this.Menu.Element);

        this.Container.ContentHolder.appendChild(this.ContentArea);
        this.rootNode = new CTreeViewNode();

        this.CollapsedImg = document.createElement("img");
        this.CollapsedImg.style.width = this.Skin.ssWidth;
        this.CollapsedImg.style.height = this.Skin.ssHeight;
        this.CollapsedImg.style.verticalAlign = "middle";
        //this.CollapsedImg.style.position = "relative";
        //this.CollapsedImg.style.top = (System.OS.Browser == BT_IE ? "20%" : "25%");
        this.CollapsedImg.style.marginTop = "5px";
        //this.CollapsedImg.style.mar = "3px";
        this.CollapsedImg.src = this.Skin.Collapsed;


        this.ExpandedImg = document.createElement("img");
        this.ExpandedImg.style.width = this.Skin.isWidth;
        this.ExpandedImg.style.height = this.Skin.isHeight;
        this.ExpandedImg.style.verticalAlign = "middle";
        this.ExpandedImg.style.position = "relative";
        this.ExpandedImg.style.top = "25%";
        this.ExpandedImg.src = this.Skin.Expanded;

        this.Collapsed = document.createElement("div");
        //this.Collapsed.style.width = TreeViewSkins.MaxHeight + "px";
        this.Collapsed.style.height = TreeViewSkins.MaxHeight + "px";
        this.Collapsed.style.cssFloat = "left";
        this.Collapsed.style.styleFloat = "left";
        this.Collapsed.style.lineHeight = TreeViewSkins.MaxHeight + "px";
        this.Collapsed.style.margin = "0px 3px 0px 3px";
        this.Collapsed.appendChild(this.CollapsedImg.cloneNode(true));

        this.Expanded = document.createElement("div");
        this.Expanded.style.height = TreeViewSkins.MaxHeight + "px";
        this.Expanded.style.cssFloat = "left";
        this.Expanded.style.styleFloat = "left";
        this.Expanded.style.lineHeight = TreeViewSkins.MaxHeight + "px";
        this.Expanded.style.margin = "0px 3px 0px 3px";
        this.Expanded.appendChild(this.ExpandedImg.cloneNode(true));

    }

    this.PopulateFromXml = function(filename, variablename)
    {
        var request = System.Xml.HttpRequest();
        request.open("GET", filename, false);
        request.send(null);
        var xml = request.responseXML;
//      request.responseXML.setProperty("SelectionLanguage", "XPath");

        var TopNodes = System.Xml.selectNodes(xml, "//Items/Item");


        for (var i=0; i<TopNodes.length; i++)
        {
            var nodeTop = "";
            //alert(nodes[i].attributes[0].nodeValue);

            // title node
            var nodeVal;
            if (System.OS.Browser == BT_IE)
            {
                nodeVal = TopNodes[i].childNodes[0].nodeValue.Trim();
            } else {
                if (TopNodes[i].childNodes.length > 1)
                {
                    nodeVal = TopNodes[i].childNodes[1].nodeValue.Trim(); // skip one node
                } else {
                    nodeVal = TopNodes[i].childNodes[0].nodeValue.Trim(); // default to zero
                }

            }



            var SecNodes = System.Xml.selectNodes(xml, "//Items/Item[@id=" + TopNodes[i].attributes[0].nodeValue + "]/SubItem");

            if (SecNodes.length > 0)
            {

                nodeTop = this.rootNode.AddNode(TopNodes[i].attributes[0].nodeValue, new CTextNode(TextNodeSkins.XPRoyale, nodeVal, variablename, this));

                //k = 0;
                //alert(SecNodes.length);
                for (var k=0; k<SecNodes.length; k++)
                {
                    nodeTop.AddNode(TopNodes[i].attributes[0].nodeValue + this.IdJoin + SecNodes[k].attributes[0].nodeValue, new CCheckBoxTextNode(TextNodeSkins.XPRoyale, SecNodes[k].text, variablename, this));
                }


            } else {
                nodeTop = this.rootNode.AddNode(TopNodes[i].attributes[0].nodeValue, new CCheckBoxTextNode(TextNodeSkins.XPRoyale, nodeVal, variablename, this));

            }

        }



    }

    this.RenderDeep = function(dNode, level)
    {
        var divC = document.createElement("div");
        divC.style.width = "100%";
        divC.style.paddingLeft = (9 * 2) + "px";

        for (var i=0; i<dNode.Count; i++)
        {
            var brclr = document.createElement("br");
            brclr.style.clear = "both";
            brclr.style.cssFloat = "none";
            brclr.style.styleFloat = "none";

            var img = this.Collapsed.cloneNode(true);

            if (dNode.children[i].Count > 0)
            {
                divC.appendChild(img);
            }

            divC.appendChild(dNode.children[i].nodeItem.Element);

            if (i < dNode.Count || dNode.children[i].Count > 0)
            {
                divC.appendChild(brclr);
            }

            if (dNode.children[i].Count > 0)
            {
                var divDeeper = this.RenderDeep(dNode.children[i], level+1);
                divDeeper.style.display = "none";
                divC.appendChild(divDeeper);
                img.onclick = function (Caller) { return function() {
                    if (this.firstChild.src.indexOf(Caller.Skin.Expanded) > -1)
                    {
                        this.firstChild.src = Caller.Skin.Collapsed;
                        this.nextSibling.nextSibling.nextSibling.style.display = "none";
                    } else {
                        this.firstChild.src = Caller.Skin.Expanded;
                        this.nextSibling.nextSibling.nextSibling.style.display = "block";
                    }
                } } (this);
            }
            //this.ContentHolder.appendChild(dNode.children[i].nodeItem.Element);
        }

        return divC;
    }



    this.Render = function()
    {


        var divC = document.createElement("div");
        divC.style.width = "100%";
        divC.style.paddingLeft = "0px";
        divC.style.paddingTop = "3px";

        var i = 0;

        for (i=0; i<this.rootNode.Count; i++)
        {
            var brclr = document.createElement("br");
            brclr.style.clear = "both";
            brclr.style.cssFloat = "none";
            brclr.style.styleFloat = "none";

            var img = this.Collapsed.cloneNode(true);

            if (this.rootNode.children[i].Count > 0)
            {
                divC.appendChild(img);
            }

            divC.appendChild(this.rootNode.children[i].nodeItem.Element);
            if (i < this.rootNode.Count-1 || this.rootNode.children[i].Count > 0)
            {
                divC.appendChild(brclr);
            }
            if (this.rootNode.children[i].Count > 0)
            {
                var divDeeper = this.RenderDeep(this.rootNode.children[i], 1);
                divDeeper.style.display = "none";
                divC.appendChild(divDeeper);
                img.onclick = function (Caller) { return function() {
                    if (this.firstChild.src.indexOf(Caller.Skin.Expanded) > -1)
                    {
                        this.firstChild.src = Caller.Skin.Collapsed;
                        this.nextSibling.nextSibling.nextSibling.style.display = "none";
                    } else {
                        this.firstChild.src = Caller.Skin.Expanded;
                        this.nextSibling.nextSibling.nextSibling.style.display = "block";
                    }
                } } (this);
            }
        }

        this.ContentHolder.appendChild(divC);
    }


} // CTreeView()// /js/namespaces/components/components.js

//CMonsterComponents.prototype.RadioButton = CRadioButton;
//CMonsterComponents.prototype.RadioSet = CRadioSet;
CMonsterComponents.prototype.ComboBox = CComboBox;
//CMonsterComponents.prototype.TreeView = CTreeView;
//CMonsterComponents.prototype.TreeViewNode = CTreeViewNode;
CMonsterComponents.prototype.jComboBox = CjComboBox;
CMonsterComponents.prototype.TreeView = CTreeView;
CMonsterComponents.prototype.TreeViewNode = CTreeViewNode;

// /js/cookiereader.js

// this sets a cookie. simply here in this file to test
// the monster fla.
function createCookie(name,value,days) {
    if (days) {
        var date = new Date();
        date.setTime(date.getTime()+(days*24*60*60*1000));
        var expires = "; expires="+date.toGMTString();
    }
    else var expires = "";
    document.cookie = name+"="+value+expires+"; path=/";
}

//this reads the cookie. necessary (or similar replacement)
// to have getMName functioning
function readCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
        var c = ca[i];
        while (c.charAt(0)==' ') c = c.substring(1,c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }
    return null;
}

//just to erase for testing purposes
function eraseCookie(name) {
    createCookie(name,"",-1);
}


//gets cookie based on name (hard coded here)
//if finds cookie, looks for "fi=xxxx", returning
//xxxx as name, otherwise, null.
function getMName() {
    var cookieString = readCookie('AdCtx');

    if (cookieString) {
        var reg = /fi=([^&]*)\&/;
        var args = reg.exec(cookieString);
        firstName = args[1];

        if (firstName) {
            return decodeURI(firstName);
        } else {
            return null;
        }



    } else {

        return null;
    }




}
//cookie expected as:
//"AdCtx"  values are: at=0&dcpc=01460&ge=2&dcel=6&fi=Dana&moc=101400&dccl=12&mil=0&state=40&uid=19821705

