var logindialog = {
    bgiframe: true,
    autoOpen: false,
    height: 200,
    width: 300,
    modal: true,
    buttons: {
        'Giriş': function (){
            $('#login_form').submit();
        }
    }
}

$(function(){
        $(document).pngFix();
        $("ul li a").mouseover( function(e){
            $(this).parent().addClass('hover');
        });
        $("ul li a").mouseout( function(e){
            //$(this).parent().removeClass('hover');
        });
        $("#login_modal").dialog(logindialog);
        var isCtrl;
        $(document).keyup(function (e) { 
                if(e.which == 18) isCtrl=false;
        }).keydown(function (e) {
                if(e.which == 18) isCtrl=true; 
                if(e.which == 76 && isCtrl) {
                    $("#login_modal").dialog('open');
                }
        });
        if ($('#user_message').length > 0){
            alert($('#user_message').text());
        }

});

function validateMail(mail) {
   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
   if(reg.test(mail) == false) {
      alert('Lütfen Geçerli Bir Mail Adresi Giriniz');
      return false;
   }
   return true;
}

