var c=$('div#current');
c.children('a').removeAttr('href');
if(navigator.userAgent.indexOf('MSIE 6')==-1){
    if(navigator.userAgent.indexOf('Opera')==-1)
        c.prepend($('<div id="shade"></div>').css('margin-left',-10).css('width',c.width()+20));
    else
        c.prepend($('<div id="shade"></div>').css('margin-left',50).css('width',c.width()+30))
}
$('div#welcome').dropShadow({left:3,top:2,blur:1});
$('div#welcometext').dropShadow({left:2,top:1,blur:1});
if(document.getElementById('partners')){
    var swf=new SWFObject('../images/partners.swf','prtnrs','160','46','8','#FFF');
    swf.addParam('menu','false');
    swf.addParam('wmode','transparent');
    swf.write('partners')
}
function setHorLines(element){
    element.each(function(){
        $(this).append($('<br />')).append($('<img alt="" class="hr" src="../images/seph.jpg" />').css('margin-left',($(this).width()-478)/2).css('margin-top',$(this).css('margin-bottom'))).css('margin-bottom',parseInt($(this).css('margin-bottom'))*2)})
}
$('a#langmenu').hover(function(){
    clearTimeout(lmtimeout);
    $('div#langwnd:not(:animated)').slideDown('slow')
},function(){
    lmtimeout=setTimeout(hideLangMenu,1000)
});
var lmtimeout;
$('div#langwnd').mouseout(function(e){
    if(e.pageX<$(this).offset().left||e.pageY<$(this).offset().top||e.pageX>$(this).offset().left+$(this).width()||e.pageY>$    (this).offset().top+$(this).height())
        lmtimeout=setTimeout(hideLangMenu,1000)
});
$('div#langwnd').mouseover(function(e){
    clearTimeout(lmtimeout);
    $(this).filter(':animated').slideDown('slow')
});
function hideLangMenu(){
    $('div#langwnd').slideUp('slow')
}
function changeLang(l){
    $('form').append($('<input type="hidden" id="nlang" name="nlang" />').attr('value',l)).append($('<input type="hidden" id="location" name="location" />').attr('value',location));
    document.forms[0].submit()
}
$.get('../content/langs.htm',function(data){
    $('div#langwnd').html(data);
    $('div#langwnd div img[src$="'+$('input#lang').attr('value')+'.png"]').parent().remove();
    var fix=(/MSIE ((5\.5)|6)/.test(navigator.userAgent)&&navigator.platform=="Win32");
    if(fix)
        $('img[src$=.png]').each(function(){
            fixPng(this)
        });
    function fixPng(png){
        var src=png.src;
        png.src='../images/trans.gif';
        png.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"',sizingMethod='scale')"
    }
})
$('a[href*="www.magicdesktop.com"]').each(function(){
    $(this).attr('href',$(this).attr('href')+'?lang='+$('input#lang').attr('value'))
});
