//var $ = jQuery.noConflict();
var tiklama = 1;
$(document).ready(function() {
	
	 $(document).keydown(function (event) { if (event.keyCode == 27) { popuphide(); } });

    $(".close_btn").click(function () {
        popuphide();
    });

     setTimeout('news_slider(1)', 1000);

	/*$("#feedback").click(function () {
        popupshow();
    });*/
	
$('.tipsy a').tipsy({gravity: $.fn.tipsy.autoNS});

// Prettyphoto init
$("a[rel^='prettyPhoto']").prettyPhoto({animationSpeed:'fast',theme:'dark_rounded',slideshow:10000, autoplay_slideshow: false});

$(".prettygallery img, .image img, .main-post-image img, ul.bottom-social li a").fadeTo("slow", 1); // This sets the opacity of the thumbs to fade down to 60% when the page loads

$(".prettygallery img, .image img, .main-post-image img, ul.bottom-social li a").hover(function(){
	$(this).fadeTo("slow", 0.6); // This should set the opacity to 100% on hover
},function(){
	$(this).fadeTo("slow", 1); // This should set the opacity back to 60% on mouseout
});
		
//Hide (Collapse) the toggle containers on load
$(".toggle_container").hide();

//Switch the "Open" and "Close" state per click then slide up/down (depending on open/close state)
$("h2.trigger").click(function(){	$(this).toggleClass("active").next().toggle(); });
$('.box-content ul > li > ul').parent().addClass('has-sub-menu');

//Go to top
$('a.go_top').click(function(){$('html, body').animate({scrollTop: '0px'}, 300);return false;});

//No margin - featured box
$(".featured-area-content .featured-box:nth-child(4n), .horizontal-widgets-holder .box:nth-child(4n)").addClass("last-featured");

//No background - menu
$(".main-menu li:last-child, .tour-holder ul.simpleTabsNavigation li:last, ol.commentlist li:last-child").addClass("last");

<!-- Div clear after boxes (added on 10.02.2011) -->
$('div.horizontal-widgets-holder .box:nth-child(4n)').after('<div class="clear"></div>');

$(".box-content ul li a, .tour-holder ul.simpleTabsNavigation li a").hover(function(){
	$(this).stop().animate({ paddingLeft: '9px'}, 300);	
}, function() {
	$(this).stop().animate({ paddingLeft: '0px'}, 300);
});

$(".box ul.social li a").hover(function(){
	$(this).stop().animate({ paddingLeft: '60px'}, 300);	
}, function() {
	$(this).stop().animate({ paddingLeft: '42px'}, 300);
});

});

var i=1;
function popupshow() {
    $("#screenBack").fadeTo(200, 0.5, function () { $("#popup").fadeTo(200, 1); if(i==1) { coca(); } });
}

function popuphide() {
    $("#popup").fadeOut(200, function () { $("#screenBack").fadeOut(200); });
}

function coca()
{
$("#coda-slider-1").codaSlider({
            autoSlide: false,
            autoSlideInterval: 5000,
            autoSlideStopWhenClicked: true,
            dynamicArrows: true,
            autoHeight: false,
            dynamicTabsPosition: "bottom"
        });
		i++;
}


function news_slider(sira) {
            var toplam_banner = $("#news").children().length;
            if (toplam_banner > sira) {
                $(".motto-title").fadeOut(500);
                $(".motto-title").eq(parseInt(sira)).delay(500).fadeIn(500);
                sira++;
            } else {
                sira = 0;
            }
            setTimeout("news_slider(" + sira + ")", 3500);
    }




