$(function(){
	
	/*
	
	When a header link is rolled over move the bg of the .parent().parent() element
	
	*/
	
	$(".header_btn_1, .header_btn_2, .feature_panel_header_1, .feature_panel_header_2, .feature_panel_header_3").bind("mouseover", function(){
		h = $(this).height() * -1 + "px"
		
		$(this).css({
			backgroundPosition: "left " +h,
			cursor: "pointer"
		})
		$(this).children().children().css({
			color: "#FFF"
		})
	})
	
	$(".header_btn_1, .header_btn_2, .feature_panel_header_1, .feature_panel_header_2, .feature_panel_header_3").bind("mouseout", function(){
		$(this).css({
			backgroundPosition: "left top"
		})
		$(this).children().children().css({
			color: "#666"
		})
	})
	
	
	//Substitute a click event
	$(".header_btn_1, .header_btn_2, .feature_panel_header_1, .feature_panel_header_2, .feature_panel_header_3").bind("click", function(){
		url = $(this).children().children().attr("href")
		window.location = url
	})
	
	
	/*Home page slides for inside sayfa*/
	$('.slide').hide()
	$('.slide:first').show().addClass("current_slide")
	
	count = 1
	
	$('#marketing_right').click(function(){
		if(count == $('.slide').length){
			count = 1
		}
		else{
			count ++
		}
		
		do_slide()
		
		return false
		
	})
	
	$('#marketing_left').click(function(){
		if(count == 1){
			count = $('.slide').length
		}
		else{
			count = count-1
		}
		
		do_slide()
		
		return false
		
	})
	
	function do_slide(){
		$('.current_slide').fadeOut(function(){
			$('.current_slide').removeClass("current_slide")
			$('.slide:nth-child('+count+')').fadeIn().addClass("current_slide");
		})
	}
	
	
})
