

$(document).ready(function() {

//[ANKET OYLAMA]
    
$("#AnketOyla").click(function() {
    
var Secili=false;

$(".anket-radio").each(function() {

if($(this).is(":checked")) {
Secili=true;    
}else{}
});


if(Secili) {
XJFormSubmit.FormId="AnketForm";
XJFormSubmit.ProcessPage=XJJS.Dizin+"/index.php";
XJFormSubmit.AddVariable='';   
XJFormSubmit.ProcessType='AnketOyla';
XJFormSubmit.AnswerDivId='Anket_answer_layer';
XJFormSubmit.AnswerName='Anket'; 
XJFormSubmit.TotalAnswer=1;
XJFormSubmit.LoaderStartFunction="$('#poll_loader').show();$('#AnketOyla').attr('disabled',true)";
XJFormSubmit.LoaderFinishFunction="$('#poll_loader').hide();$('#Anket_answer_layer1').slideUp(0).slideDown(500);$('.poll_answer:odd').css({ 'background-color' : '#cc0000' });$('#poll_table  tr:nth-child(3n+3) div').css({ 'background-color' : '#00ff00' }); ";  
XJFormSubmit.Run();    
}
else {
alert("Lütfen Seçim Yapın");
}
return false;
});
   

$(".poll_answer:odd").css({ "background-color" : "#cc0000" });
$("#poll_table  tr:nth-child(3n+3) div").css({ "background-color" : "#00ff00" }); 


//[ANKET OYLAMA SONU]    
 //------------------------------------------------------------------//


//[MENÜ NAVİGASYON]
var MENU_URL=document.URL;
var MENU_URLParcala=MENU_URL.split("/");
var MENU_URLAl=MENU_URLParcala[MENU_URLParcala.length-1];
var MENU_URLAl2=MENU_URLAl.split("&");    

MENU_URLAl2[0]=(MENU_URLAl2[0]=="index.php" || MENU_URLAl2[0]=="") ? "index" : MENU_URLAl2[0];
MENU_URLAl2[0]=(MENU_URLParcala[MENU_URLParcala.length-2]=="Blog") ? "Blog" : MENU_URLAl2[0];
MENU_URLAl2[0]=(MENU_URLParcala[MENU_URLParcala.length-2]=="ReferansGoruntule") ? "Referanslar" : MENU_URLAl2[0];
MENU_URLAl2[0]=(MENU_URLParcala[MENU_URLParcala.length-2]=="ZiyaretciDefteri") ? "ZiyaretciDefteri" : MENU_URLAl2[0];
MENU_URLAl2[0]=(MENU_URLParcala[MENU_URLParcala.length-2]=="Referanslar") ? "Referanslar" : MENU_URLAl2[0];    
MENU_URLAl2[0]=(MENU_URLParcala[MENU_URLParcala.length-2]=="Ik") ? "Ik" : MENU_URLAl2[0];  
MENU_URLAl2[0]=(MENU_URLParcala[MENU_URLParcala.length-2]=="Iletisim") ? "Iletisim" : MENU_URLAl2[0];  
MENU_URLAl2[0]=(MENU_URLParcala[MENU_URLParcala.length-2]=="Haberler") ? "Haberler" : MENU_URLAl2[0];
MENU_URLAl2[0]=(MENU_URLParcala[MENU_URLParcala.length-2]=="HaberGoruntule") ? "Haberler" : MENU_URLAl2[0];

try{$("#"+MENU_URLAl2[0]).addClass("active");}catch(hata){}  


//[MENÜ NAVİGASYON SONU]


//[ZİYARETÇİ DEFTERİ]--------------------------------------------------//   

  
$("#AddVisitorNotebook").click(function() {

var form_elemanlar=$(".require,#VisitorNotebook textarea");
var bos=0;
for(var x=0;x<form_elemanlar.length;x++) {
if(form_elemanlar[x].value=="") {
bos++;
} 
}

if(bos) {
$("#Comment_answer_layer1").empty().append('<p class="notification"><strong>Lütfen Boş Alanları Doldurun!</strong></p>').slideUp(0).slideDown(500);
return false;    
}
else {

XJFormSubmit.FormId="VisitorNotebook";
XJFormSubmit.ProcessPage=XJJS.Dizin+"/Run.php";
XJFormSubmit.AddVariable='&Sayfa=ZiyaretciDefteri&';   
XJFormSubmit.ProcessType='AddVisitorNotebook';
XJFormSubmit.AnswerDivId='Comment_answer_layer';
XJFormSubmit.AnswerName='Comment'; 
XJFormSubmit.TotalAnswer=1;
XJFormSubmit.LoaderStartFunction="$('.comment_loader').show();$('#AddVisitorNotebook').attr({disabled:true});$('#AddVisitorNotebook').fadeOut()";
XJFormSubmit.LoaderFinishFunction="$('.comment_loader').hide();$('#Comment_answer_layer1').slideUp(0).slideDown(500);$('#AddVisitorNotebook').attr({disabled:false});$('#AddVisitorNotebook').fadeIn()";  
XJFormSubmit.Run(); 
$("#VisitorNotebook input:text,#VisitorNotebook textarea").val("");
return false;      
}
});    
    
    
//[ARAMA FORM KONTROL]-----------------------------------------------------//

 $('form#searchform').submit(function() {
       
       $('form#searchform .error').remove();
        var hasError = false;
        
        $('.search-input').each(function() {
            if(jQuery.trim($(this).val()) == '') {
                
               $(this).val("Kelime Girin");
                hasError = true;
            }
           else if(jQuery.trim($(this).val())=="Ara") {
           $(this).val("Kelime Girin");
           hasError = true;    
           }
           else if(jQuery.trim($(this).val())=="Kelime Girin") {
           $(this).val("Kelime Girin");
           hasError = true;    
           }
        });
        
        
        
        if(!hasError) {
        return true;  
        }
        else {
        return false; 
        }
      
      return false;    

    });
//[ARAMA FORM KONTROL SONU]------------------------------------------------//     
    
//[KAYAN YAZI]------------------------------------------------------------//



  $(function () {
        // basic version is: $('div.demo marquee').marquee() - but we're doing some sexy extras
        
        $('marquee').marquee('pointer').mouseover(function () {
            $(this).trigger('stop');
        }).mouseout(function () {
            $(this).trigger('start');
        }).mousemove(function (event) {
            if ($(this).data('drag') == true) {
                this.scrollLeft = $(this).data('scrollX') + ($(this).data('x') - event.clientX);
            }
        }).mousedown(function (event) {
            $(this).data('drag', true).data('x', event.clientX).data('scrollX', this.scrollLeft);
        }).mouseup(function () {
            $(this).data('drag', false);
        });
    });
  
 $('marquee').marquee();  
//[KAYAN YAZI SONU]------------------------------------------------------------//      

//[FİLE GÖZAT STYLE]-------------------------------------------------------------//
if(!XJReturnBrowser("Opera")) {
SI.Files.stylizeAll();
}

//--------------------------------------------------------------------------------//




 });


 
