window.addEvent('domready', initPage);

function initPage() {
    try {
        $('target_content').set('load', { method: 'get' });
        $('target_content').set('morph', { duration: 400, transition: Fx.Transitions.Sine.easeOut });
    }
    catch (e) { }
    var subnav = $$('div.subro');
    var subdds = $$('div.subdd');
    subnav.each(function(el, i)
    {
        subdds[i].set('slide',{duration: 350, transition: Fx.Transitions.Sine.easeOut }).slide('hide');
        el.addEvent('mouseenter',function(e)
        {
            subdds[i].slide('in');
            e.stop();
        });
        el.addEvent('mouseleave',function(e)
        {
            subdds[i].slide('out');
            e.stop();
        });
    });
}

function loadPage(theURL) {
    showOverlay();
    if (window.pageTracker) pageTracker._trackPageview(theURL);
    $('target_content').load(theURL + '?r=' + Math.random());
}

function showOverlay() {
    $('target_content').setStyle('display', 'block');
    $('target_content').morph({'opacity':1});
}
function hideOverlay() {
    $('target_content').morph({ 'opacity': 0 });
    (function() {
        $('target_content').setStyle('display', 'none');
        $('target_content').set('html', '');
    }).delay(400);
}




