var divSayi;
var browserVersiyon = jQuery.browser.version.substring(0,1);
var browersiyon = false;
if(browserVersiyon == "6"){browersiyon = true;}

$(document).ready(function(){

//sayfa ilk yuklendıgınde urunlerın sekıller1 id sinin update edılmesı (scroll un yarıda kalma problemı)
		$('div.secenekResim').hide();
		$('div.secenekIcon').show();
		if(browersiyon){
			$('div.secenekYazi').show().width(258);
		}else{
			$('div.secenekYazi').show().width(260);
		}
		$('div.secenekMadde').width(353).height(57);
		$('#secenekler').jScrollPane({showArrows:true});
		$('.jScrollArrowUp').css('width','14px');
		$('.jScrollArrowDown').css('width','14px');

//son
	if(browersiyon){
		$('div.secenekYazi').show().width(250);
	}
	karart(1);
	$('#sekiller1').click(function(){
		karart(1);
		$('div.secenekResim').hide();
		$('div.secenekIcon').show();
		if(browersiyon){
			$('div.secenekYazi').show().width(258);
		}else{
			$('div.secenekYazi').show().width(260);
		}
		$('div.secenekMadde').width(353).height(57);
		$('#secenekler').jScrollPane({showArrows:true});
		$('.jScrollArrowUp').css('width','14px');
		$('.jScrollArrowDown').css('width','14px');
	});
	
	$('#sekiller2').click(function(){
		karart(2);
		$('div.secenekYazi').show().width(353);
		$('div.secenekResim').hide();
		$('div.secenekIcon').hide();
		$('div.secenekMadde').width(353).height(45);
		$('#secenekler').jScrollPane({showArrows:true});
		$('.jScrollArrowUp').css('width','14px');
		$('.jScrollArrowDown').css('width','14px');
	});
	
	$('#sekiller3').click(function(){
		karart(3);
		$('div.secenekResim').show();
		$('div.secenekIcon').hide();
		$('div.secenekYazi').show().width(170);
		$('div.secenekMadde').width(170).height(165);
		$('.secenekMadde:even').css("clear","left");
		$('#secenekler').jScrollPane({showArrows:true});
		$('.jScrollArrowUp').css('width','14px');
		$('.jScrollArrowDown').css('width','14px');
	});
	
	$('#acik1').show(1000);
	divSayi = $('div.kapaliDiv').length + 1 ;
	
	
});




function karart(id){
		for(i=1;i<4;i++)
		{
			$('span#sekiller'+i).children("img").css("opacity",.5);
		}
		$('span#sekiller'+id).children("img").css("opacity",1);
	}

function tabDegis(id){
		$('.ortaUst>h1').removeClass("secili");
		$('#'+id).addClass("secili");
		$('div#tablar>div').hide();
		$('div#'+id+'Div').show();
	}
aciksayi = 1;
function slide(id){
		$('#kapali'+id).hide().css("position","absolute").css("left","-145px");//bu işlemle 2 div none 1 div block onu bulup animasyon uygulayacağız
		for(i=1;i<divSayi;i++){
			if(document.getElementById('kapali'+i).style.display !='none'){
				var left = document.getElementById('kapali'+i).style.left;
				if(left == "0px" || left == ''){
					$('div#kapali'+i).animate({"left": "+=135px"}, 500);
				}else{
					$('div#kapali'+i).css("left","135px");
				}
			}
		}
//		$('.kapaliDiv').css("left","135px");
		$('#kapali'+aciksayi).show().css("position","absolute").animate({"left": "+=145px"}, 500);
		$('#acik'+id).fadeIn("fast");
		$('#acik'+aciksayi).hide();
	aciksayi = id;
	}
	
/*	
function tlBoxbaslat(linki){
	
		tlBoxCagir(linki);
			$("body")
				.append('<div class="overlay"></div><div class="container"><img src="a.gif" /></div>')
				.css({"overflow-y":"hidden"});
				$(".overlay").animate({"opacity":"0.6"}, 400, "linear");
				
	}	
	
	
	$.ajaxSetup({
		
		type: 'GET',
		success: function(ajaxCevap){
			var h = $(document).height();
			var w = $(document).width();
			var sol = (parseInt(w-800)/2);
			var ust = (parseInt(h-400)/2);
			$('div.container')
			.css("opacity","0.3")
			.animate({"width":"800px"}, 15, "linear")
			.animate({"height":"400px"}, 15, "linear")
			.animate({"opacity":"1"}, 10, "linear")
			.css({
				"top": (ust),
				"left":(sol),
				"border":"solid 1px #f00",
				"background":"#fff",
				"overflow":"auto"
			})
			.empty()
			.append('<div id="pane1" class="scroll-pane">'+ajaxCevap+'</div>');
			lbSil();
		}
	});	
	
	function tlBoxCagir(linki)
	{
		$.ajax({ url: linki });
		return false;
	}

	$().ajaxComplete(function(){
		$('#pane1').jScrollPane();
		//alert("tamam");
	});
	function lbSil() {
// allow users to be able to close the lightbox
	$(".overlay").click(function(){
		$(".container, .overlay").animate({"opacity":"0"}, 200, "linear", function(){
			$(".container, .overlay").remove();	
		});
	});
}
*/