(function ($) {
    
    worklife(0);
    
    $('.questionContainer').click(function(){
        if($(this).children('.questionListAnswer').css('display') == "none"){
            $(this).children('.questionListAnswer').slideDown('fast');
        }else{
            $(this).children('.questionListAnswer').slideUp('fast');
        }
    });
    
    $('#pricingCont').click(function(){
        if($('#paymentCont').css("display") == "none"){
            $('#paymentCont').slideDown('slow');
        }else{
            $('#paymentCont').slideUp('slow');
        }
    });
    
    $('.closeIcon').click(function(){
        if($('#paymentCont').css("display") == "block"){
            $('#paymentCont').slideUp('slow');
        }
    });
    
})(jQuery);

function controlForm(){
    var ADI             = $('input[name=ADI]').val();
    var BASLIK          = $('input[name=BASLIK]').val();
    var MESAJ           = $('input[name=MESAJ]').val();
    var security_code   = $('input[name=security_code]').val();
    
    if(ADI == "" || BASLIK == "" || MESAJ == "" || security_code == ""){
        alert('Lütfen * olan alanları doldurunuz.');
        return false;
    }
}

function worklife(id){
    
    if(id > 10){id = 1;}
    
    if($('.'+id).length > 0){
        
        $('.'+id).fadeIn('fast');
        
        before = id - 1;
        if(before < 1)before = 10;
        
        $('.'+before).fadeOut('fast');
        $('.'+before).css('display','none');
        
    }
    
    setTimeout('worklife('+(id + 1)+')',3000);

}
