

var siteyap = {
	
	ara:function( form ){
		var url =form.action;
		var ara =form.ara.value;
		
		window.location.href = url+'/s,'+ara
		
		return false;
		
	}
	
}


jQuery(document).ready(function(){

        $("ul.subnav").parent().append("<span></span>"); 

        $("ul.topnav a").hover(function() { 

                $(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click

                $(this).parent().hover(function() {
                }, function(){
                        $(this).parent().find("ul.subnav").slideUp('slow'); 
                });

                //Following events are applied to the trigger (Hover events for the trigger)
                }).hover(function() {
                        $(this).addClass("subhover"); //On hover over, add class "subhover"
                }, function(){  //On Hover Out
                        $(this).removeClass("subhover"); //On hover out, remove class "subhover"
        });


        // site img resize ve fancybox
        var div_width = jQuery('.body-data').innerWidth();
        jQuery('.body-data img').each(function(){

            if(jQuery(this).innerWidth() > div_width){
                jQuery(this).attr('width',div_width);
            }

            jQuery(this).attr('border',0);
            
            var src = jQuery(this).attr('src');

            jQuery(this).wrap('<a rel="fancy-image"  href="'+src+'"></a>');
            
            
        });

        jQuery("a[rel=fancy-image]").fancybox({'autoScale': false});
        

});
