﻿$(document).ready(function () {

    //** main menu **//


    $('#nav li').hover(
			function () {


			    if ($('ul', this).is(':hidden')) {
			        $('ul', this).show(400);
			    }
			},

			function () {

			    if ($('ul', this).is(':visible')) {
			        $('ul', this).hide();
			    }
			}

			);



    $('#l-marka').hover(
			function () {
			    if ($('#o-marka').is(':hidden')) {
			        $('#o-marka').show();
			    }
			},

			function () {

			    if ($('#o-marka').is(':visible')) {
			        $('#o-marka').hide();
			    }
			}

			);

			$('#l-patent').hover(
			function () {
			    if ($('#o-patent').is(':hidden')) {
			        $('#o-patent').show();
			    }
			},

			function () {

			    if ($('#o-patent').is(':visible')) {
			        $('#o-patent').hide();
			    }
			}

			);


			$('#l-tasarim').hover(
			function () {
			    if ($('#o-tasarim').is(':hidden')) {
			        $('#o-tasarim').show();
			    }
			},

			function () {

			    if ($('#o-tasarim').is(':visible')) {
			        $('#o-tasarim').hide();
			    }
			}

			);

			$('#l-hukuk').hover(
			function () {
			    if ($('#o-hukuk').is(':hidden')) {
			        $('#o-hukuk').show();
			    }
			},

			function () {

			    if ($('#o-hukuk').is(':visible')) {
			        $('#o-hukuk').hide();
			    }
			}

			);

    //** acilir kapanir **//

    $('a#toggle').click(function () {
        var toggleelement = this
        var toggleid = $(toggleelement).attr('name');

        $('#' + toggleid).toggle(300);
        //location.href = "#tavsiye";
        $('html,body').animate({ scrollTop: $("#tavsiye").offset().top }, 'slow');


        return false;
    });



    //** light box**//

    $("a[rel='photo']").colorbox({ slideshow: true, slideshowSpeed: 5000 });
    $(".thickbox").colorbox({ iframe: true, innerWidth: 608, innerHeight: 342 });
    $("#popme").colorbox({ open: true, inline: true, href: "#popup" });
    $("#fullmap").colorbox({ iframe: true, width: "90%", height: "90%" });
});	

