// JavaScript Document
//<![CDATA[
var accordionAcik = false;
$(document).ready(function() {
    $('div.accordionContent').hide();
    $('div.accordionButton').click(function(event) {
        $(this).prev('div').slideToggle(200);
        if(accordionAcik) {
            $(this).html('More');
            accordionAcik = false;
        }
        else {
            $(this).html('Less');
            accordionAcik = true;
        }
        return false;
    });

    // Language Menu
    $('.nav-right').hover(
    function() {
        $('.language-links').css('display', 'block');
    },
    function() {
        $('.language-links').css('display', 'none');
    });

    $('.communitymenu').hover(
    function() {
        $('.community-links').css('display', 'block');
    },
    function() {
        $('.community-links').css('display', 'none');
    });

    $('.profilemenu').hover(
    function() {
        $('.profile-links').css('display', 'block');
    },
    function() {
        $('.profile-links').css('display', 'none');
    });

    //Media Rollover
    $(document).ready(function() {
        $('.box').hover(function() {
            $(this).find('.bottom-img-bar').slideToggle();
        });
    });
    //Carousel Lite
    $(function() {
        $(".wallpapersClass").jCarouselLite({
            btnNext: ".next",
            btnPrev: ".prev"
        });
    });
    // Fancybox
    $("a.group").fancybox({
        'opacity': false,
        'padding': 0,
        'titleShow': false,
        'overlayShow': true
    });
    //Left Menu
    function initMenu() {
        $('#menu ul').hide();

        $('#menu li a').click(
        function() {

            var checkElement = $(this).next();

            if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
                return false;
            }

            if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
                $('#menu ul:visible').slideUp('normal');

                $('#'+selected).prev().removeClass('menu-selected');
                $(this).addClass('menu-selected');
                selected = $(this).next().attr('id');

                checkElement.slideDown('normal');
                return false;
            }

            return true;
        });
    }

    initMenu();

    $("a.iframe").fancybox({
        'overlayColor' : '#000000',
        'overlayOpacity' : '0.7',
        'scrolling' : 'no',
        'type':'iframe',
        'titleShow': false,
        'width':620,
        'height':261,
        'margin': 0,
        'padding': 0
    });

    $("a.iframe-invite").fancybox({
         'overlayColor' : '#000000',
         'overlayOpacity' : '0.7',
         'scrolling' : 'no',
         'type':'iframe',
         'titleShow': false,
         'width':590,
         'height':355,
         'margin': 0,
         'padding': 0
     });
     //teaser-area
     function teaserArea() {
       $('.teaser-area .info').hide();
       $('.teaser-area div').hover(function() {
         // Stuff to do when the mouse enters the element;
         $(this).find('.info').slideToggle();
         $(this).find('a').addClass('selected');
       }, function() {
         $(this).find('.info').slideToggle();
         $(this).find('a').removeClass('selected');         
       });
     }
     teaserArea();
     
});

function bultenKayit() {
    if($('#e-posta').val() != '') {
        $.get('/_post.php?cmd=ajaxBultenKayit', {email: $('#e-posta').val()}, function(data) {
            alert(data);
        });
    }
    else {
        alert("Lütfen eposta adresinizi giriniz.");
    }
}

//]]>

function uyariGoster(flash){
    $('#hata').html(flash);
    $('#hata').fadeIn();
    setTimeout('uyariGizle()', 15000);
}

function uyariGizle(){
    $('#hata').fadeOut();
}

