$(document).ready(function(){
	//Colorbox
	$("a[rel='image']").colorbox({width:"auto", height:"auto"});
	
	//Dropdown Menu
	$("ul.dropdown li").hover(function(){
        $(this).addClass("hover");
        $('ul:first',this).slideDown(250);
    }, function(){
        $(this).removeClass("hover");
        $('ul:first',this).slideUp(250);
    });
	
	//Textbox içeriğini silme
	$("#form input").mouseover(function (){
		var inputClass = $(this).attr("class");
		$('.'+inputClass).click(function (){
			$('.'+inputClass).val("");
		})
	})
	
	//Slayt Show
    $("#slideShow span").hide();
    $("#slideShow span:first").show();
    mPages();
    timer = setInterval(mChange,5000);
});

	/*#############################
	# JavaScript Kodları
	#############################*/
	var active = 1;
	var timer;
	function mChange(){
    	$("#slideShow span:nth-child("+active+")").hide();
    	active = (active + 1) % $("#slideShow span").length;
    	if(active == 0) active = $("#slideShow span").length;
    	$("#slideShow span:nth-child("+active+")").fadeIn(1000);
    }
    function mClick(deger){
		$("#slideShow span:nth-child("+active+")").hide();
		active = deger;
		$("#slideShow span:nth-child("+active+")").fadeIn(1000);
		clearInterval(timer);
		timer = setInterval(mChange,4000);
    }
    function mPages(){
		var pageNumber = "";
		for(var i = 1; i <= $("#slideShow span").length; i++)
		{
		pageNumber += "<li><a onclick=mClick("+i+")>"+i+"</a></li>"
		}
		$("#pageNumber").html(pageNumber);
  }
