﻿$(document).ready(function () {

    //** main menu **//
    $('#nav li').hover(
        function () {
            if ($('.nav-sub', this).is(':hidden')) {
                $('.nav-sub', this).show();
            }
        },

        function () {
            if ($('.nav-sub', this).is(':visible')) {
                $('.nav-sub', this).hide();
            }
        }
    );


    //** light box**//

    $("a[rel='imagepop']").colorbox({ slideshow: true, slideshowSpeed: 5000 });
    $("a[rel='photo']").colorbox({ slideshow: true, slideshowSpeed: 5000 });
    $("a.imagepop").colorbox({});
    $("a.iframepop").colorbox({ iframe: true, width: "70%", height: "70%" });
    $("a.videopop").colorbox({ iframe: true, innerWidth: 608, innerHeight: 342, arrowKey: false });

    $("a#popme").colorbox({ open: true, inline: true, href: "#popup" });
    $("a#fullmap").colorbox({ iframe: true, width: "90%", height: "90%" });

    //** toggle **//
    $('a.toggle').click(function () {
        var toggleelement = this
        var toggleid = $(toggleelement).attr('name');
        $('#' + toggleid).toggle(300);
        //$('html,body').animate({ scrollTop: $("#tavsiye").offset().top }, 'slow');
        return false;
    });


    //equalHeight($("#content-left,#content-right"));



});    //**ready son **//


function equalHeight(group) {
    var tallest = 0;
    group.each(function () {
        var thisHeight = $(this).height();
        if (thisHeight > tallest) {
            tallest = thisHeight;
        }
    });
    group.height(tallest);
};


function Refresh() {
    location.reload();
};
