﻿$(function(){
$("//a[@rel='external']").attr("target","_blank");
$("#content").hide().fadeIn(1500);

$(window).load(function(){
    if(($('#wrapper').height()/$('#wrapper').width()) > ($('#wrapper img').height()/$('#wrapper img').width())){
        $('#wrapper img').height('100%').width('auto');
    } else {
        $('#wrapper img').height('auto').width('100%');
    }
});
$(window).resize(function(){
    if(($('#wrapper').height()/$('#wrapper').width()) > ($('#wrapper img').height()/$('#wrapper img').width())){
        $('#wrapper img').height('100%').width('auto');
    } else {
        $('#wrapper img').height('auto').width('100%');
    }
});

$('#send .btnSend').hover(
    function() {
        $(this).addClass('hover');
    },
    function() {
        $(this).removeClass('hover');
    }
);

$('#send .fup').change(function() {
    $('#styledFup' + $(this).get(0).id.charAt(4) + ' input').val($(this).val());
});

$('#send .fup').click(function() {
    if (!$.browser.msie)
        $('#styledFup' + $(this).get(0).id.charAt(4) + ' input').focus();
});

$('#send .fup').hover(
    function() {
        $('#styledFup' + $(this).get(0).id.charAt(4) + ' .btnBrowse').addClass('hover');
    },
    function() {
       $('#styledFup' + $(this).get(0).id.charAt(4) + ' .btnBrowse').removeClass('hover');
    }
);

if ($.browser.msie && ($.browser.version == 6))
    $(document).pngFix();

if ($.browser.safari) {
    $('.styled').hide();
    $('.fup').css({opacity:'100',marginLeft:'0',width:'220px'});
    $('.message').css('height','148px');
}

$('#send .sendTo').focus();

});

function doPopup( w, h, winurl ){
    var w = window.open( winurl, "windowName", "status=0, height="+w+", width="+h+", resizable=0, scrollbars=no" );
    if(!w){alert('popup blocker');}
}