$(document).ready(function() {

// ARAMA
$('.input, #login input, #s')
		.focus(function(){
			if( $(this).attr('value') == $(this).attr('title') ) {
				$(this).attr({ 'value': '' });
			}
		})
		.blur(function(){
			if( $(this).attr('value') == '' ) {
				$(this).attr({ 'value': $(this).attr('title') })
			}
		});	


//	 kategori MENU
$('ul li a').hover(
	function () {
		//show its submenu
		$(this).animate({backgroundPosition:"8px"}, 300 );

	}, 
	function () {
		//hide its submenu
		$(this).animate({backgroundPosition:"0px"}, 300 );			
	}
);


// alert
$('#alert').fadeIn().delay(3000).fadeOut();

// tab buttonlarrrrrrrrrrrr
						$(".tabContentDiv").hide(); //tab contentleri gizle
						$("#tabButton span:first").addClass("active").show(); //ilk tabi aktif et
						$("#tabContent .tabContentDiv:first").show(); //ilk tab contenti aktif et
						
						//On Click Event
						$("#tabButton span").click(function() {
							$("#tabButton span").removeClass("active"); 
							$(this).addClass("active"); 
							$("#tabContent .tabContentDiv").hide(); 
							var activeTab = $(this).attr("title"); 
							$(activeTab).fadeIn(); 
							//return false;
						});



// galeri
        $(".galeri img").hover(function() {
            // hover in
            $(this).css("z-index", 1);
            $(this).animate({
               height: "150",
               width: "150",
               marginLeft: "-=10",
               marginTop: "-=10"
            }, "fast");
        }, function() {
            // hover out
            $(this).css("z-index", 0);
            $(this).animate({
                height: "125",
                width: "125",
                marginLeft: "+=10",
                marginTop: "+=10"
            }, "fast");
        });
	
//////// newsletter
  function newsKontrol(){
    
	var dirtyStrPassword= String(document.newsletter.haber_input.value);
	var len  = dirtyStrPassword.length;
        if (len == 0)
        {  
           alert("Lütfen e-posta adresinizi giriniz!");
           document.newsletter.haber_input.focus();
           return false;
        }
		
    	for (var i = 0; i < len; i++){
        var validChars = "@";
        var validCharsnokta = ".";
		var chr = dirtyStrPassword.charAt(i);
		if (validChars.indexOf(chr) != -1){
       		var atvar = 1
			}
		if (validCharsnokta.indexOf(chr) != -1){
       		var atvarnokta = 1
			}
	    }
        if (atvar != 1 || atvarnokta != 1) {
			alert("Lütfen Geçerli bir e-posta adresi giriniz @!!!!!!")
            return false
			}

			document.habersubmit.submit();	
return true;
} 	
	
});
