var flashvars = {};
var params = {};
var attributes = {};

/**
 * DOM ready function (general)
 */
$(document).ready(function() {
    $('div.top').find('a').hover(
        function() { $(this).parents().map(function() { if ($(this).hasClass('top')) $(this).addClass("active"); }); },
        function() { $(this).parents().map(function() { if ($(this).hasClass('top')) $(this).removeClass("active"); }); }    
    );
    $('a.modul-300-190-imagelink').hover(
        function() { $('div.top', $(this).parent().parent()).addClass("active"); }, 
        function() { $('div.top', $(this).parent().parent()).removeClass("active"); }
    );

});


/**
 * DOM ready function for homepage only 
 */
$('body#home', document).ready(function() {

    // Prepare dropdown navigation
    $('#jumptolinks').selectbox();
    //$('#jumptolinks').change(function() {surfTo(this)});
    
    // Prepare flash
    params.wmode = "transparent";
    params.quality = "high";
    params.allowscriptaccess = "sameDomain";
    flashvars.inifile = "/homepage_flash.xml";
/*
    var flashNavigation = $('#start-flash #navi');
    var flashNavigationActive = 'strategy-on';
    $('a', flashNavigation).click(function()
    {
        document.location.href = 'http://ecomplexx.com/strategie-design-technologie-marketing-service.aspx';
        // Set flash navigation highlight
        $('a.' + flashNavigationActive, flashNavigation).attr('class', flashNavigationActive.replace(/-on/, ''));        
        
        // Flash/Fallback dynamisch austauschen
        $('#flash-box').html(eval(this.className + 'Fallback'));
        if (eval(this.className + 'Flash') != '') swfobject.embedSWF(eval(this.className + 'Flash'), "flash-box", "620", "280", "8.0.0", false, flashvars, params, attributes);
                
        this.className = this.className + '-on';
        flashNavigationActive = this.className;
    });
*/
});


/**
 * Navigates to Page selected in a dropdown,
 * Default entry value is "#"
 */
function surfTo(selectBox)
{
    if (selectBox.options[selectBox.selectedIndex].value != "#") document.location = selectBox.options[selectBox.selectedIndex].value;
}