function installTagCloud() {
    try {
        if(Behaviour && document.getElementById("TagCloud")) {
             Behaviour.apply({ 
                "#Area-Navigation div.level1": function(nav) {
                    // nav.style.display = "none";
                    var div = "";
                    var list = nav.getElementsByTagName("li");
                    
                    for(var i = 0; i != list.length; i++) {
                        var li = list[i];
                        if(li) {
                            var link = li.firstChild;
                            var re = /.*? (.*?)\s*\((\d+)\)/;
                            var text = link.innerHTML;
                            var matches = re.exec(text);
                            if(matches != null && matches.length == 3 && matches[1] != 'Alle') {
                                text = matches[1];
                                li.style.display='none';
                                var size = matches[2];
                                size = Math.log(size, 10) * 2 + 8;
                                div += ('<a href="' + link.href + '" style="font-size:' + size + 'px;" class="tag-' + link.className +'">' + text + "</a> ");
                            } else {
                                li.style.display='block';
                            }
                        }
                    }
                    document.getElementById("TagCloud").innerHTML = div;
                },
                "" : function (e) {
                }
            });
        }
    } catch(e) {}
}

// .ClipOverview {
//	opacity: 0.5;
// }
function installFade() {
    Behaviour.register({
        ".ClipOverview" : function(e) {
            e.anim = new Animator().addSubject(new CSSStyleSubject(e, "background-color: #F39"));
            e.anim = new Animator().addSubject(new CSSStyleSubject(e, "opacity: 1"));
            e.onmouseover = function() {e.anim.play();};
            e.onmouseout = function() {e.anim.reverse()};
            e.onclick = function(x) {
                // alert(e);
            }
        }
    });
}
function reorderMenues() {
  reorderMenuesGlobal();
	var TopMenu = document.getElementById('TopMenu');
	var SideMenu = document.getElementById('SideMenu');
	var SiteNavigation = document.getElementById('SiteNavigation');
	var ServiceNavigation = document.getElementById('ServiceNavigation');
	var Content = document.getElementById('Content');

    var ShopCartNavigationItemSubMenu = document.getElementById('ShopCartNavigationItemSubMenu');
    if(ShopCartNavigationItemSubMenu) {
	    ShopCartNavigationItemSubMenu.parentNode.removeChild(ShopCartNavigationItemSubMenu);
 	    Content.insertBefore(ShopCartNavigationItemSubMenu, Content.firstChild);
 	    ShopCartNavigationItemSubMenu.style.display='block';
    }
}

function navigateRandom(){
 
 var link = new Array();
 link[0] = "HPCamAreaAllNavigationItem";
 link[1] = "HSCamAreaHQAllNavigationItem";
 link[2] = "HSCamAreaSMAllNavigationItem";
 link[3] = "HMovieAreaAllNavigationItem";
 link[4] = "HImageAreaAllNavigationItem";
 
 rnd = Math.random()*(link.length-1);
 index = Math.round(rnd);
 
 navigate(link[index]);
}

var portalTeasers = {
    "specialcams" : {
        width: 184, 
        height: 493, 
        defaultLink: 'javascript:jumpToSpecialCams()', 
        images: [
            {i:"http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/special_cams_1.jpg", l:'javascript:jumpToFetish()'},
            {i:"http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/special_cams_2.jpg", l:'javascript:jumpToSandy()'},
            {i:"http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/special_cams_3.jpg", l:'javascript:jumpToPragGirls()'},
            {i:"http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/special_cams_4.jpg", l:'javascript:jumpToHQCams()'},
            {i:"http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/special_cams_5.jpg", l:'javascript:jumpToSandy()'},
            {i:"http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/special_cams_6.jpg", l:'javascript:jumpToProCams()'}
        ]
    },
    "images" : {
        width: 183, 
        height: 240, 
        defaultLink: 'javascript:jumpToPhotos()', 
        images: [
            {i:"http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/images_11.jpg", l:'javascript:jumpToPhoto1()'},
            {i:"http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/images_12.jpg", l:'javascript:jumpToPhoto2()'},
            {i:"http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/images_13.jpg", l:'javascript:jumpToPhoto3()'},
            {i:"http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/images_14.jpg", l:'javascript:jumpToPhoto4()'},
            {i:"http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/images_15.jpg", l:'javascript:jumpToPhoto5()'},
            {i:"http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/images_16.jpg", l:'javascript:jumpToPhoto6()'}
        ]
    },
    "strip" : {
        width: 183, 
        height: 240, 
        defaultLink: 'javascript:jumpToStrip()', 
        images: [
            {i:"http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/strip_1.jpg", l:'javascript:jumpToStrip()'},
            {i:"http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/strip_2.jpg", l:'javascript:jumpToStrip()'},
            {i:"http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/strip_3.jpg", l:'javascript:jumpToStrip()'},
            {i:"http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/strip_4.jpg", l:'javascript:jumpToStrip()'},
            {i:"http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/strip_5.jpg", l:'javascript:jumpToStrip()'},
            {i:"http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/strip_6.jpg", l:'javascript:jumpToStrip()'}
        ]
    },
    "setcards" : {
        width: 183, 
        height: 240, 
        defaultLink: 'javascript:jumpToStrip()', 
        images: [
            {i:"http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/setcards_1.jpg", l:'javascript:jumpToSetcards()'},
            {i:"http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/setcards_2.jpg", l:'javascript:jumpToSetcards()'},
            {i:"http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/setcards_3.jpg", l:'javascript:jumpToSetcards()'},
            {i:"http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/setcards_4.jpg", l:'javascript:jumpToSetcards()'},
            {i:"http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/setcards_5.jpg", l:'javascript:jumpToSetcards()'},
            {i:"http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/setcards_6.jpg", l:'javascript:jumpToSetcards()'}
        ]
    },
    "movies" : {
        width: 183, 
        height: 240, 
        defaultLink: 'javascript:jumpToVideos()', 
        images: [
            {i:"http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/movies_1.jpg", l:'javascript:jumpToVideos()'},
            {i:"http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/movies_2.jpg", l:'javascript:jumpToVideos()'},
            {i:"http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/movies_3.jpg", l:'javascript:jumpToVideos()'},
            {i:"http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/movies_4.jpg", l:'javascript:jumpToVideos()'},
            {i:"http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/movies_5.jpg", l:'javascript:jumpToVideos()'},
            {i:"http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/movies_6.jpg", l:'javascript:jumpToVideos()'}
        ]
    },
    "amateurcams" : {
        width: 192, 
        height: 86, 
        defaultLink: 'javascript:jumpToAmateurCams()', 
        images: [
            {i:"http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/amateur_cams_1.jpg", l:'javascript:jumpToVoyeur()'},
            {i:"http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/amateur_cams_2.jpg", l:'javascript:jumpToTeenies()'},
            {i:"http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/amateur_cams_3.jpg", l:'javascript:jumpToBoobs()'},
            {i:"http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/amateur_cams_4.jpg", l:'javascript:jumpToBoys()'},
            {i:"http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/amateur_cams_5.jpg", l:'javascript:jumpToFetishSm()'},
            {i:"http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/amateur_cams_6.jpg", l:'javascript:jumpToLivetreff()'}
        ]
    }
};

function portalLink(tag) {
    var section = portalTeasers[tag]; 
    var cnt = section['images'].length; 
    var index = Math.round(Math.random()*(cnt-1));
    var img = section['images'][index];
    var width = section['width'];
    var height = section['height'];
    var img = section['images'][index];
    var link = img['l'] ? img['l'] : section['defaultLink'];
    document.writeln("<a href='" + link +"'><img src='"+ img['i'] +"' alt='' border='0' width='" + width + "' height='" + height + "'></a>");
}

function portalImage(section, width, height) {
    index = Math.round(Math.random()*5)+1;
    document.writeln("<img src='http://www.sex-and-the-web.de/rsync/satw/img/portal/rotate/" +section + "_" + index + ".jpg' alt='' border='0' width='" + width + "' height='" + height + "'>");
}
function jumpToPhoto1() {
    jump({feature:'AllDeliverables',area:'HImageAreaAll',category:'soft', supplier:'blume',deliverable:'1100000470'});
}
function jumpToPhoto2() {
    jump({feature:'AllDeliverables',area:'HImageAreaAll',category:'soft', supplier:'blume',deliverable:'1100000860'});
}
function jumpToPhoto3() {
    jump({feature:'AllDeliverables',area:'HImageAreaAll',category:'soft', supplier:'safenet',deliverable:'100000072'});
}
function jumpToPhoto4() {
    jump({feature:'AllDeliverables',area:'HImageAreaAll',category:'soft', supplier:'aximus',deliverable:'1500000070'});
}
function jumpToPhoto5() {
    jump({feature:'AllDeliverables',area:'HImageAreaAll',category:'soft', supplier:'erme',deliverable:'140000152'});
}
function jumpToPhoto6() {
    jump({feature:'AllDeliverables',area:'HImageAreaAll',category:'soft', supplier:'erme',deliverable:'100000234'});
}
function jumpToSandy() {
    jump({area:'HSCamAreaAll',feature:'KiwiDeliverables'});
}
function jumpToSetcards() {
    action({setCard:'Jenna Jameson'});
}
function jumpToPragGirls() {
    jump({area:'HSCamAreaAll',supplier:'netmedia',deliverable:'eventshow'});
}
function jumpToProCams() {
    jump({area:'HSCamAreaAll',feature:'CamproviderDeliverables'});
}
function jumpToHQCams() {
    jump({area:'HSCamAreaAll',feature:'IntermaxDeliverables'});
}
function jumpToFetish() {
    jump({area:'HSCamAreaAll',feature:'DeelineDeliverables'});
}
function jumpToAmateurCams() {
    jump({feature:'TopDeliverables',area:'HPCamAreaAll'});
}
function jumpToBoys() {
    jump({feature:'OnlineDeliverables',area:'HPCamAreaAll',category:'boys'});
}  
function jumpToLiveTreff() {
    jump({feature:'OnlineDeliverables',area:'HPCamAreaAll',category:'livedates'});
}
function jumpToVoyeur() {
    jump({feature:'OnlineDeliverables',area:'HPCamAreaAll',category:'voyeur'});
}
function jumpToTeenies() {
    jump({feature:'OnlineDeliverables',area:'HPCamAreaAll',category:'teen'});
}
function jumpToBoobs() {
    jump({feature:'OnlineDeliverables',area:'HPCamAreaAll',category:'bigboobs'});
}
function jumpToFetishSm() {
    jump({feature:'OnlineDeliverables',area:'HPCamAreaAll',category:'fetishsm'});
}

function jumpToStrip() {
    jump({feature:'AllDeliverables',category:'3d',area:'H3dStrip',supplier:'drehmomente',deliverable:'iva_022'});
}
function jumpToVideos() {
    jump({feature:'AllDeliverables',category:'hetero',area:'HMovieAreaAll'});
}
function jumpToMangas() {
    jump({feature:'AllDeliverables',category:'manga',area:'HImageAreaAll'});
}
function jumpToGames() {
    jump({feature:'AllDeliverables',area:'HGameAreaAll',supplier:'trion',deliverable:'bloxxx'});
}

function jumpToDating() {
    jump({action:'goDating'});
}
