
$(document).ready(function () {
    if ($.browser.msie) {
        $("#myFrame").parents().find(".detailText").css("overflow", "hidden");
    };

    $("ul.headerMainMenu > li:first").addClass("first");
    $("ul.headerMainMenu > li:last, ul.footerNav li:last").addClass("last");


    $("div.listArea ul.list li:nth-child(3n+1)").addClass("noPB");

    /* HEADERMENU */


    $("ul.headerMainMenu li").hover(function () {

        $(this).find("> div.subMenu").show().end().find("> a").addClass("selected");

    }, function () {

        $(this).find("> div.subMenu").hide().end().find("> a").removeClass("selected");
    });

    $("div.statisticsTable table tbody tr:last").addClass("last").find("td:first").addClass("left").end().find("td:last").addClass("right");
    $("div.statisticsTable table tbody tr:even").addClass("even");


    /* TOOLTIP */

    $("span.tooltiphover").hover(function () {
        $(this).next().show();
    }, function () {
        $(this).next().hide();
    })

    /* SIDEBAR ACCORDION */

    var slideBom = function (target) {

        $("ul.sidebarNav2 li a.selected").next("ul").show();

        $(target + " li a").bind("click", function () {

            var targetLink = $(this);
            var object = targetLink.next();

            targetLink.parent().parent().find("li ul").slideUp();

            if (targetLink.hasClass("selected")) {
                object.slideUp();
                targetLink.removeClass("selected");
            }
            else {
                object.slideDown();
                targetLink.parent().parent().find("a").removeClass("selected");
                targetLink.addClass("selected");
            }

        })
    }

    slideBom("ul.sidebarNav2");

    $("table.tableType1 > tbody, table.tableType2 > tbody").each(function () {

        $(this).find("tr:last").addClass("last");

        $(this).find("tr").each(function () {
            $(this).find("td:last").addClass("last");
        });
    })


    /* CUSTOM SELECTBOX */

    $('div.customSelectbox select').selectmenu({
        style: 'dropdown',
        maxHeight: 150
    });

    /* MAP TOOLTIP */
    if ($('map#turkiyeMap').length > 0) {
        var areaName = $('map#turkiyeMap area[alt]');
        areaName.qtip({
            content: {
                attr: 'alt' // Use the ALT attribute of the area map for the content
            },
            position: {
                my: 'bottom left', // Use the corner...
                at: 'top center' // ...and opposite corner
            }
        })
    }

    if ($(".scroll-pane").length > 0) {
        $('.scroll-pane').jScrollPane();
    }

    if ($(".areaCode").length > 0) {
        $(".areaCode").mask("0(999)");
    }

    if ($(".phoneNumber").length > 0) {
        $(".phoneNumber").mask("999-99-99");
    }

    if ($("input[type='radio']").length > 0) {
        $("input[type='radio']").ezMark();
    }


})

function UpdatePanelTrigger(){

    $("input[type='radio']").ezMark();
	$(".ui-selectmenu-menu,.ui-selectmenu").remove();
	$('div.customSelectbox select').selectmenu({
        style: 'dropdown',
        maxHeight: 150
    });
    $(".areaCode").mask("0(999)");
    $(".phoneNumber").mask("999-99-99");
	
}

/*Cufon.replace('ul.headerRightMenu li a, h2.detailHead',{ fontFamily: 'OmnesMedium'});
Cufon.replace('ul.sidebarNav li a, ul.sidebarNav2 > li > a',{ fontFamily: 'OmnesTRUMedium'});*/
Cufon.replace('div.contentBoxHizmet h3.head', { fontFamily: 'OmnesTRURegular' });


//Yatımcı ilişkileri sayfası//

function getPage(pageNo) {
    $.ajax({
        type: 'GET',
        url: 'yatirimci-iliskileri.ashx',
        data: 'P=' + pageNo,
        cache: false,
        datatype: 'html',
        success: function (response) {
            //alert(response);
            
            $('#linkListContent').html(response);
//            $('.pagerList a').removeClass('selected');
//            $('#passive' + pageNo).addClass('selected');
        },
        error: function (xhr, ajaxOptions, thrownError) {
            alert(xhr.status);
            alert(thrownError);
        }
    });
}

//Yatırımc ilişkileri sayfas bitiş //
