$(window).load(function() {

$('#arama input').keypress(function(e){
      if(e.which == 13){
   var arama_input = $('#arama input').val();
if(arama_input.length>1 && arama_input.length<16)
window.location = 'http://www.2kadin.com/default.aspx?m=search&c='+arama_input;
else
alert('2-15 karakter arasinda bir arama metni giriniz.');
e.preventDefault();
}
});

    $('#slider').nivoSlider({
        effect:'fade', //Specify sets like: 'fold,fade,sliceDown'
        slices:20,
        animSpeed:500, //Slide transition speed
        pauseTime:3000,
        startSlide:0, //Set starting Slide (0 index)
        directionNav:true, //Next & Prev
        directionNavHide:true, //Only show on hover
        controlNav:true, //1,2,3...
        controlNavThumbs:false, //Use thumbnails for Control Nav
        controlNavThumbsFromRel:false, //Use image rel for thumbs
        controlNavThumbsSearch: '.jpg', //Replace this with...
        controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
        keyboardNav:true, //Use left & right arrows
        pauseOnHover:true, //Stop animation while hovering
        manualAdvance:false, //Force manual transitions        
        beforeChange: function(){},
        afterChange: function(){},
        slideshowEnd: function(){}, //Triggers after all slides have been shown
        lastSlide: function(){}, //Triggers when last slide is shown
        afterLoad: function(){} //Triggers when slider has loaded
    });
	
	$('#loopedslider').loopedSlider({
		autoHeight: true,
		containerClick: false
	});
	
	$("#astroloji_burclar div, #ana_menu div, #kayit_buton, #giris_buton").hover(
				function(){$(this).addClass("hover");},
				function(){$(this).removeClass("hover");}
		   );
	
	$("#ana_menu_ana_sayfa img, #ana_menu_ana_sayfa div").hover(
				function(){
					$(this).attr("src", "http://www.2kadin.com/theme/default/img/ana_menu_ana_sayfa_hover.png");
					$("#ana_menu_ana_sayfa div").show();
					},
				function(){
					$(this).attr("src", "http://www.2kadin.com/theme/default/img/ana_menu_ana_sayfa.png");
					$("#ana_menu_ana_sayfa div").hide();
					}
		   );   
		   
		$("#ana_menu_haber img, #ana_menu_haber div").hover(
				function(){
					$(this).attr("src", "http://www.2kadin.com/theme/default/img/ana_menu_haber_hover.png");
					$("#ana_menu_haber div").show();
					},
				function(){
					$(this).attr("src", "http://www.2kadin.com/theme/default/img/ana_menu_haber.png");
					$("#ana_menu_haber div").hide();
					}
		   );  
	   
	$("#ana_menu_moda img, #ana_menu_moda div").hover(
				function(){
					$(this).attr("src", "http://www.2kadin.com/theme/default/img/ana_menu_moda_hover.png");
					$("#ana_menu_moda div").show();
					},
				function(){
					$(this).attr("src", "http://www.2kadin.com/theme/default/img/ana_menu_moda.png");
					$("#ana_menu_moda div").hide();
					}
		   );		   
	   
	$("#ana_menu_iliski img, #ana_menu_iliski div").hover(
				function(){
					$(this).attr("src", "http://www.2kadin.com/theme/default/img/ana_menu_iliski_hover.png");
					$("#ana_menu_iliski div").show();
					},
				function(){
					$(this).attr("src", "http://www.2kadin.com/theme/default/img/ana_menu_iliski.png");
					$("#ana_menu_iliski div").hide();
					}
		   );
	   
	$("#ana_menu_guzellik img, #ana_menu_guzellik div").hover(
				function(){
					$(this).attr("src", "http://www.2kadin.com/theme/default/img/ana_menu_guzellik_hover.png");
					$("#ana_menu_guzellik div").show();
					},
				function(){
					$(this).attr("src", "http://www.2kadin.com/theme/default/img/ana_menu_guzellik.png");
					$("#ana_menu_guzellik div").hide();
					}
		   );
	   	
	   
	$("#ana_menu_astroloji img, #ana_menu_astroloji div").hover(
				function(){
					$(this).attr("src", "http://www.2kadin.com/theme/default/img/ana_menu_astroloji_hover.png");
					$("#ana_menu_astroloji div").show();
					},
				function(){
					$(this).attr("src", "http://www.2kadin.com/theme/default/img/ana_menu_astroloji.png");
					$("#ana_menu_astroloji div").hide();
					}
		   );
		  
		   
	$("#footer_sosyal_facebook img").hover(
				function(){$(this).attr("src", "http://www.2kadin.com/theme/default/img/footer_sosyal_facebook_hover.png");},
				function(){$(this).attr("src", "http://www.2kadin.com/theme/default/img/footer_sosyal_facebook.png");}
		   );
		   
	$("#footer_sosyal_twitter img").hover(
				function(){$(this).attr("src", "http://www.2kadin.com/theme/default/img/footer_sosyal_twitter_hover.png");},
				function(){$(this).attr("src", "http://www.2kadin.com/theme/default/img/footer_sosyal_twitter.png");}
		   );
	
	$("#footer_sosyal_rss img").hover(
				function(){$(this).attr("src", "http://www.2kadin.com/theme/default/img/footer_sosyal_rss_hover.png");},
				function(){$(this).attr("src", "http://www.2kadin.com/theme/default/img/footer_sosyal_rss.png");}
		   );
	
	$('#arama_buyutec').click(function() {		
	    var arama_input = $('#arama input').val();
		if(arama_input.length>1 && arama_input.length<16)
			window.location = 'http://www.2kadin.com/default.aspx?m=search&c='+arama_input;
		else
			alert('2-15 karakter arasinda bir arama metni giriniz.');
	});
});
