$(document).ready(function()
		{
			tabsayar();
			footertabs();
			urunlersol();
			tools();
			haberler();
			$('#leftinner a:first').click();
			$('.colorbox').colorbox();
			
			$('#Map area').colorbox();
			
			$('#urunlersol a').click(function()
			{
				$.ajax({
					type:'GET',
					url:'urunler/'+$(this).attr('rel')+'.php',
					success:function(msg)
					{
						$('#urun').html(msg);
					}
				});
			});
			
			
			$('#tumurunler2 #Map area').each(function()
			{
				var coords=$(this).attr('coords');
				coords=coords.split(',');
				var pos=$('#tumurunler2 img').position();
				var l=pos.left;
				var t=pos.top;
				var x=(coords[0]/1)+l;
				var y=(coords[1]/1)+t;
				var w=coords[2]-coords[0];
				var h=coords[3]-coords[1];
				var href=$(this).attr('href');
				var src=$(this).attr('rel');
				$('#tumurunler2').append('<a href="'+href+'" style="top:'+y+'px;left: '+x+'px; width:'+w+'px; height:'+h+'px;"><img src="'+src+'"/></a>');
				$(this).remove();
			});
});
		
		function footertabs()
		{
			$('#footertabs a').hover(function()
			{
				var $img=$(this).find('img');
				$img.stop();
				$img.animate({
					top:'-10px'
				},'fast');
			},function()
			{
				var $img=$(this).find('img');
				$img.stop();
				$img.animate({
					top:'0px'
				},'fast');
			});
		}
		
		function tabsayar()
		{
			$('.tab:not(.tab:first)').css('display','none');
			$('#tabbtns a:first').addClass('active');
			$('#tabbtns a').click(function()
			{
				$('.tab').css('display','none');
				$('#'+$(this).attr('rel')).css('display','block');
				$('#tabbtns a').removeClass('active');
				$(this).addClass('active');
			});
		}
		
	function newsTo(eq)
	{
		$('#slidercerceve a.selected').removeClass('selected');
		$('#slider').scrollTo('div:eq('+eq+')',{duration:1500});
		$('#slidercerceve a:eq('+eq+')').addClass('selected');
	}
	
	function urunlersol()
	{
		$('#urunlersol ul li ul').css('display','none');
		
		$('#urunlersol ul li a').click(function()
		{
			if ($(this).parent().find('ul').css('display')=='none')
			{
				$(this).parent().find('ul:first').show('slow');
			}else
			{
				$(this).parent().find('ul').hide('slow');
			}
		});
		
		$('#urunlersol a:last').css('background-image','none').parent().parent().parent().find('a:first').css('background-image','none');
	}
	
	function tools()
	{
		if ($('#gazeteler').size()>0)
		{
			$('#gazeteler div').each(function()
			{
				$(this).hover(function()
				{
					$(this).find('.toolwrp').show('fast');
				},function()
				{
					$(this).find('.toolwrp').hide('fast');
				}
				
				);
			});
		}
	}
	
	function haberler()
	{
		$('#leftinner a.hnum').click(function()
		{
			var e=$(this).attr('rel')-1;
			$('#leftinner .active').removeClass('active');
			$(this).addClass('active');
			$('#leftpics img').css('display','none');
			$('#leftpics img').eq(e).css('display','block');
			$('#lefttitle div').css('display','none');
			$('#lefttitle div').eq(e).css('display','block');
		});
	}
