

document.write('<style type="text/css">' +'/* text */\n.menuItem, .menuItemOpen, .menuSubItem {\n    font-family:verdana,geneva,arial,helvetica ! important;\n    font-size:11px ! important;\n    font-weight:normal ! important;\n    line-height:115% ! important;\n    display: block ! important;\n    text-decoration: none ! important;\n}.menuItem, .menuItemOpen {\n    color: #FFFFFF ! important;\n}/* menu */\nA.menuItem,A.menuItemOpen,A.menuSubItem {\n      padding-left:19px;\n      padding-top:3px;border-bottom: 1px #FFFFFF solid;\n      height:18px;\n      width: 111px;\n      text-decoration: none ! important;\n}\n\nA.menuItem {\n      background:url(http://common.tv2.dk/img/menu/vejret/arrow.gif)\n        no-repeat\n        center\n        left;background-color: #76BA7F;\n      text-decoration: none ! important;\n}\n\nA.menuItemSelected, A.menuItem:hover, A.menuItemOpen:hover {color: #FFFFFF ! important;\nbackground-color: #4E9657 ! important;\n    text-decoration: none ! important;\n}/* text */\n.menuSubItem {\n    color: #6E6E6E ! important;\n}/* menu */\nA.menuItemOpen {\n      background:\n        url(http://common.tv2.dk/img/menu/vejret/arrow_open.gif)\n        no-repeat\n        center\n        left;background-color: #76BA7F;\n      text-decoration: none ! important;\n}     \n\n/* submenu */\nA.menuSubItem {background-color: #F1F7E9;\n      text-decoration: none ! important;\n}\n\nA.menuSubItemSelected, A.menuSubItem:hover {color: #6E6E6E ! important;\nbackground-color: #CCE5C9;\n    text-decoration: none ! important;\n}'+ '</style>');


var ua = navigator.userAgent.toUpperCase();
if ( ua.indexOf('MAC') == -1 && document.compatMode != "CSS1Compat" ) {
    if ((ua.indexOf("MSIE 5.") != -1 || ua.indexOf("MSIE 6.") != -1) && (ua.indexOf("OPERA") == -1)) {
        document.write('<style type="text/css">' +'/* menu */\nA.menuItem,A.menuItemOpen,A.menuSubItem {\n  height: 22px;\n  width: 130px;\n  text-decoration: none ! important;\n}'+ '</style>');
    }
}
menuSections = [{'type':'menu','menuitems':{'Forside':'http://vejret.tv2.dk/','Danmark':'http://vejret.tv2.dk/danmark/','Vejret fra tv':'http://vejret.tv2.dk/video/','Isbj&oslash;rne TV':'http://vejret.tv2.dk/stv/','Trafikken':'http://vejret.tv2.dk/danmark/trafikken/','Rejsevejret':'http://vejret.tv2.dk/rejsevejret/','Sejlervejret':'http://vejret.tv2.dk/sejlervejr/','Vejr Nyt':'http://vejret.tv2.dk/nyt/','Nyhedsbrevet':'http://vejret.tv2.dk/nyhedsbrev/','Blogs':'http://vejret.tv2.dk/blogs.php/','Fotokonkurrence':'http://vejret.tv2.dk/billedkonkurrence/','Billed-upload':'http://vejret.tv2.dk/dinebilleder/','Video-upload':'http://vejret.tv2.dk/upload/','Billedgallerier':'http://vejret.tv2.dk/gallery/','Brugervideo':'http://vejret.tv2.dk/brugervideo/','Debat':'http://debat.tv2.dk/vejret/',toString:function(){var o=[];for(var p in this)if(typeof this[p]!="function")o[o.length]=p+":"+this[p];return "{"+o.join(",")+"}"},__serializeType: "__hash"},'submenuitems':{'Danmark':{'7-døgnsprognose':'http://vejret.tv2.dk/danmark/ugeprognose/','Solvarsel':'http://vejret.tv2.dk/danmark/solvarsel/','Pollental':'http://vejret.tv2.dk/danmark/pollental/','Havtemperaturer':'http://vejret.tv2.dk/danmark/havtemperaturer/','Trafikken':'http://vejret.tv2.dk/danmark/trafikken/','Satellit':'http://vejret.tv2.dk/danmark/satellit/','Webcams':'http://vejret.tv2.dk/danmark/webcams/',toString:function(){var o=[];for(var p in this)if(typeof this[p]!="function")o[o.length]=p+":"+this[p];return "{"+o.join(",")+"}"},__serializeType: "__hash"},'Trafikken':{'Jylland':'http://vejret.tv2.dk/danmark/trafikken/lokation.php/id-1004.html','Fyn og Øerne':'http://vejret.tv2.dk/danmark/trafikken/lokation.php/id-1002.html','Sjælland':'http://vejret.tv2.dk/danmark/trafikken/lokation.php/id-1005.html','Bornholm':'http://vejret.tv2.dk/danmark/trafikken/lokation.php/id-1001.html','Kommende':'http://vejret.tv2.dk/danmark/trafikken/kommende.php/','Webcams':'http://www.trafikken.dk/wimpdoclet.asp?page=document&objno=19859',toString:function(){var o=[];for(var p in this)if(typeof this[p]!="function")o[o.length]=p+":"+this[p];return "{"+o.join(",")+"}"},__serializeType: "__hash"},'Vejr Nyt':{'Orkaner':'http://vejret.tv2.dk/orkaner/','Statistik':'http://vejret.tv2.dk/nyt/statistik/','FAQ':'http://vejret.tv2.dk/nyt/faq/',toString:function(){var o=[];for(var p in this)if(typeof this[p]!="function")o[o.length]=p+":"+this[p];return "{"+o.join(",")+"}"},__serializeType: "__hash"},'Debat':{'Kun om vejret':'http://debat.tv2.dk/vejret/','Vejret hos dig':'http://debat.tv2.dk/vejret/hosdig/','Spørgsmål':'http://debat.tv2.dk/vejret/spoerg/','Løst og fast':'http://debat.tv2.dk/vejret/vejrfolket/','Klima':'http://debat.tv2.dk/vejret/klima/','Skivejret':'http://debat.tv2.dk/vejret/skivejret/',toString:function(){var o=[];for(var p in this)if(typeof this[p]!="function")o[o.length]=p+":"+this[p];return "{"+o.join(",")+"}"},__serializeType: "__hash"},toString:function(){var o=[];for(var p in this)if(typeof this[p]!="function")o[o.length]=p+":"+this[p];return "{"+o.join(",")+"}"},__serializeType: "__hash"},toString:function(){var o=[];for(var p in this)if(typeof this[p]!="function")o[o.length]=p+":"+this[p];return "{"+o.join(",")+"}"},__serializeType: "__hash"}];
    function getFormattedItem(className, name, url) {
        String.prototype.formatMenuStatstag=function(tag) {
            if (this.indexOf('javascript:')==-1) {
                var url=this;
                var exclude=new Array('folkeborsen.tv2.dk');
                for (var i=0;i<exclude.length;i++) if (url.indexOf(exclude[i])!=-1) return (url);
                return (url+((url.indexOf('?')!=-1)? '&amp;' : '?')+tag);
            }
            return this;
        }
        html  = '<div class="' + className + '">';
        html += '<a id="tv2_menu_id_' + name + '" class="' + className + '" href="' + url.formatMenuStatstag('menu') + '">';
        html += name;
        html += '</a>';
        html +=  '</div>';
        return html;
    }

    var curUrl = document.location.href;
    // strip out -dyn / -static
    var r = /^(http:\/\/[^.]+)-(dyn|static)(\.[^\/]*tv2.dk\/.*)$/.exec(curUrl);
    if (r) {
        curUrl = r[1]+r[3];
    }
    var bestMatch = 0;
    var selectedItem = selectedItemTitle = '';
    var selectedSubItem = selectedSubItemTitle = '';

    // Figure out which item is selected by going through all menus and submenus
    for (menuSectionNo in menuSections) {
        var menuSection = menuSections[menuSectionNo];
        if (menuSection['type'] == 'menu') {
            var menuItems = menuSection['menuitems'];
            for (menuItem in menuItems) {
                var itemUrl = menuItems[menuItem];
                if (typeof(itemUrl)=='string' && menuItem != '__serializeType') {
                    var tmpitemUrl = itemUrl.split('.html')[0];                     if ((itemUrl.length>=bestMatch) && (curUrl.indexOf(tmpitemUrl)!=-1)) {
                        bestMatch = tmpitemUrl.length;
                        selectedItem = itemUrl;
                        selectedItemTitle = menuItem;
                        selectedSubItem = '';
                    }
                    if (typeof(menuSection['submenuitems'])!='undefined') {
                        if (typeof(menuSection['submenuitems'][menuItem])!='undefined') {
                            for (subMenuItem in menuSection['submenuitems'][menuItem]) {
                                var itemSubUrl = menuSection['submenuitems'][menuItem][subMenuItem];
                                if (typeof(itemSubUrl)=='string' && subMenuItem != '__serializeType') {
                                    var tmpitemSubUrl = itemSubUrl.split('.html')[0];                                     if ((itemSubUrl.length>=bestMatch) && (curUrl.indexOf(tmpitemSubUrl)!=-1)) {
                                        bestMatch = tmpitemSubUrl.length;
                                        selectedItem = itemUrl;
                                        selectedItemTitle = menuItem;
                                        selectedSubItem = itemSubUrl;
                                        selectedSubItemTitle = subMenuItem;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    // We hopefully found it.
    html = '';
    for (menuSectionNo in menuSections) {
        var menuSection = menuSections[menuSectionNo];
        if (menuSection['type'] == 'menu') {
            var menuItems = menuSection['menuitems'];
            for (var menuItem in menuItems) {
                var itemUrl = menuItems[menuItem];
                if (typeof(itemUrl)=='string' && menuItem != '__serializeType') {
                    if (selectedItem == itemUrl) {
                        if ((typeof(menuSection['submenuitems'])=='undefined') ||
                                (typeof(menuSection['submenuitems'][menuItem])=='undefined')) {
                            className = 'menuItem menuItemSelected';
                        } else {
                            if (selectedSubItem == '') {
                                className = 'menuItemOpen menuItemSelected';
                            } else {
                                className = 'menuItemOpen';
                            }
                        }
                    } else {
                        className = 'menuItem';
                    }
                    html += getFormattedItem(className, menuItem, itemUrl);
                    if ((selectedItem == itemUrl) && (typeof(menuSection['submenuitems'])!='undefined') && (typeof(menuSection['submenuitems'][menuItem])!='undefined')) {
                        var subMenuSections = menuSection['submenuitems'][menuItem];
                        for (subMenuItem in subMenuSections) {
                            var itemSubUrl = subMenuSections[subMenuItem];
                            if (typeof(itemSubUrl)=='string' && subMenuItem != '__serializeType') {
                                if (selectedSubItem == itemSubUrl) {
                                    className = 'menuSubItem menuSubItemSelected';
                                } else {
                                    className = 'menuSubItem';
                                }
                                html += getFormattedItem(className, subMenuItem, itemSubUrl);
                            }
                        }
                    }
                }
            }
        } else if (menuSection['type'] == 'image') {
            html += '<img src="' + menuSection['src'] + '"'
                    + ' width="' + menuSection['width'] + '"'
                   + ' height="' + menuSection['height'] + '"'
                      + ' alt="' + menuSection['alt'] + '"'
                      + ' class="menuSection">';
        } else if (menuSection['type'] == 'header') {
            html += '<h1 class="tv2header">' + menuSection['text'] + '</h1>';
        } else if (menuSection['type'] == 'br') {
			html += '<br />';
	} else if (menuSection['type'] == 'div') {
			html += '<div class="menuSpacer"></div>';
		}

    }
    document.write(html);
    // fill the breadcrumb menu
        tv2navigation.addToBreadcrumb(new Array('vejret.tv2.dk','Vejret'));
        if (selectedItem!='' && selectedItem!='/' && selectedItem!='http://vejret.tv2.dk/' && selectedItem.indexOf('javascript')==-1) {
        tv2navigation.addToBreadcrumb(new Array(selectedItem,selectedItemTitle));
    }
    if (selectedSubItem!='' && selectedSubItem!='/' && selectedSubItem!='http://vejret.tv2.dk/' && selectedSubItem.indexOf('javascript')==-1) {
        tv2navigation.addToBreadcrumb(new Array(selectedSubItem,selectedSubItemTitle));
    }
    