﻿$(document).ready(function() {
    $("input.OnlyNumber").keypress(function(e) {
        if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {
            return false;
        }
    });

    if ($('#dialog').length) {
        var titles = Array("", "Bilgi", "Uyarı", "Hata Oluştu", "İşlem Başarılı");
        var title = titles[$('#dialog').attr("title")];

        $('#dialog').dialog({
            autoOpen: true,
            width: 400,
            zIndex: 10000,
            title: "<span class='" + $('#dialog').attr("class") + "'>" + $('#dialog').attr("title") + "</span>",
            modal: false,
            buttons: {
                "Tamam": function() {
                    $(this).dialog("close");
                }
            }
        });
    }

    $('.tip').tooltip({
        track: true,
        delay: 0,
        showURL: false,
        showBody: " - ",
        fade: 250
    });

    $("#siteBody a[href$='.txt']").addClass("txt");
    $("#siteBody a[href$='.pdf']").addClass("pdf");
    $("#siteBody a[href$='.xls'],#siteBody a[href$='.xlsx']").addClass("xls");
    $("#siteBody a[href$='.doc'],#siteBody a[href$='.docx'],#siteBody a[href$='.rft']").addClass("doc");
    $("#siteBody a[href$='.jpg'],#siteBody a[href$='.gif'],#siteBody a[href$='.png']").addClass("jpg");
    $("#siteBody a[href$='.ppt'],#siteBody a[href$='.pptx'],#siteBody a[href$='.pps']").addClass("ppt");
    $("#siteBody a[href$='.zip'],#siteBody a[href$='.rar']").addClass("zip");
    $("#siteBody a[href$='.avi'],#siteBody a[href$='.wmv']").addClass("avi");
    $("#siteBody a[href$='.rss.ashx'],#siteBody a[href$='.xml']").addClass("rss");
    $("#siteBody a[href$='.html'],#siteBody a[href$='.htm'],#siteBody a[href$='.asp'],#siteBody a[href$='.asp'],#siteBody a[href$='.aspx'],#siteBody a[href$='.jsp'],#siteBody a[href$='.php']").addClass("html");
    $("#siteBody a[href^='mailto:']").addClass("email");
    $('#siteBody a').filter(function() {
        return this.hostname && this.hostname !== location.hostname;
    }).addClass("ext");


    $(".tbl_bottom tr:even").addClass("tekTR")
    $(".tbl_bottom tr:odd").addClass("ciftTR")

    $(".TakvimGoster").mask("99.99.9999");
    $(".TakvimGoster").datepicker({ changeMonth: true,
        changeYear: true,
        clearText: 'Temizle',
        closeText: 'Kapat',
        prevText: '&#x3c;Geri',
        nextText: 'İleri&#x3e;',
        currentText: 'Bugün',
        monthNames: ['Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran', 'Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım', 'Aralık'],
        monthNamesShort: ['Oca', 'Şub', 'Mar', 'Nis', 'May', 'Haz', 'Tem', 'Ağu', 'Eyl', 'Eki', 'Kas', 'Ara'],
        dayNames: ['Pazar', 'Pazartesi', 'Salı', 'Çarşamba', 'Perşembe', 'Cuma', 'Cumartesi'],
        dayNamesShort: ['Pz', 'Pt', 'Sa', 'Ça', 'Pe', 'Cu', 'Ct'],
        dayNamesMin: ['Pz', 'Pt', 'Sa', 'Ça', 'Pe', 'Cu', 'Ct'],
        dateFormat: 'dd.mm.yy', firstDay: 1,
        isRTL: false,
        onSelect: function(selectedDate) { }
    });

    //foto galeri
    $(function() {
        $('#gallery a').lightBox();

    });
    //foto galeri

    /*videolar*/


   $.fn.media.defaults.flvPlayer = 'http://mis.ipa.gov.tr/MoEF_IPAProjectsWEB/JS/player.swf';
    $(".media").media({ params: { allowfullscreen: 'true'} });
  //$(".sf_listItemBody").hide();
  $(".sf_listItemBody").show();
$("h3.sf_listItemTitle").click(function(e) {
    $(this).next().toggle("slow");
        }).css("cursor", "pointer").css("color", "#065F5D");



   /* ---videolar*/
 

    // Lütfen bekleyin....
    $(".LutfenBekleyin").click(function(event) {
        try {
            if (Page_ClientValidate() == false) {
                event.preventDefault();
                return;
            }
        }
        catch (err) { }
        $.modal("<div style=\"display: block; height: 80px; vertical-align: middle; text-align: center;border: 8px solid #444;\"><br /><img src=\"/App_Themes/Wizard/images/loading.gif\" /><br />Lütfen Bekleyin...</div>", { containerCss: { height: '96', border: '0' }, close: false });
    });

    // Dropdownlar için...
    $(".Yukleniyor").change(function(event) {
        $.modal("<div style=\"display: block; height: 80px; vertical-align: middle; text-align: center;border: 8px solid #444;\"><br /><img src=\"/App_Themes/Wizard/images/loading.gif\" /><br />Lütfen Bekleyin...</div>", { containerCss: { height: '96', border: '0' }, close: false });
    });

    $(".telefon").mask("(999) 999 99 99");

    $('.para').blur(function() {
        $('.para').formatCurrency();
    });









});
