
/***********************************************************************************************************/
/***    Coded and designed by "Cem ALTUN" --- jam_altun_23@hotmail.com      ***/
/***********************************************************************************************************/





/*REFERANS BUTONLARI ALT BUTONLARI GÖSTER GİZLE KODLARI*/
	
		$(document).ready(
			function(){
				for(i=0; i<=8; i++){
					$("#menu"+i).animate({height:0}, 10);
				}
				$("#menu1").animate({height:50},500);
			}
		);

		var selectedSpan=1;

		function subMenuAc(spanID){
			$("#menu"+spanID).animate({height:50}, 500);
			$("#menu"+selectedSpan).animate({height:0}, 500);
			selectedSpan=spanID;
		}




/*MAGAZALAR 3 KUCUK RESİM FADEIN FADEOUT EFFECTS*/
		$(document).ready(
			function(){
				$("#bigPict1").fadeIn("fast");
				$("#bigPict2").fadeOut("fast");
				$("#bigPict3").fadeOut("fast");
			}
		);

		oldDiv="bigPict1";

		function fadePictures(divName){
			$("#"+oldDiv).fadeOut("slow");
			$("#"+divName).fadeIn('slow');
			oldDiv=divName;
			

		}



/*URUN SAYFASI BILGI BARLARI SLIDER
		$(document).ready(
			function(){
				$("#1").animate({height:350}, 700);
				$("#2").animate({height:0}, 10);
				$("#3").animate({height:0}, 10);
				$("#4").animate({height:0}, 10);
				$("#5").animate({height:0}, 10);
			}
		);

		var oldDiv="1";
		function slideInfoBar(newDiv){
			if(oldDiv==newDiv){
			}
			else
			{
				$("#"+newDiv).animate({height:350}, 700);
				$("#"+oldDiv).animate({height:0}, 700);
				oldDiv=newDiv;
			}
		}

*/

/*HABERLER WIDGETS SLIDER*/

		var newsOneTick=-95;
		var totalHeight; // Bu değer haberler sayfası yüklendiğinde veritabanından alınıp dinamik olarak haber sayısına bağlı olarak yeniden JS ile atanıyor. Yani kayıt sayısına bağlı olarak 94 ile çarpılıp bundan 470 çıkarılarak elde edilen bir değer !

		function newsWidgetSlide(){
			if(newsOneTick>totalHeight){
				$("#newsWidgetsSlider").animate({marginTop:newsOneTick}, 700);
				newsOneTick-=95;
			}else if(newsOneTick<=totalHeight){
				$("#newsWidgetsSlider").animate({marginTop:0}, 1200);
				newsOneTick=-95;
			}
		}

		var newsWidgetTimer=setInterval(newsWidgetSlide,5000);



/*GALERI CATEGORY SELECTOR*/
		
		/*$(document).ready(
			function(){
				$("#futbolP").animate({height:0}, 10);
				$("#futbolP").animate({height:248}, 500);
				$("#futbolV").animate({height:0}, 10);
				$("#futbolV").animate({height:248}, 500);
			}
		);*/
		


		var oldFotoName="futbolP";
		var oldVideoName="futbolV";

		function openCloseFoto(fotoCatName, teamDir){
			$("#"+fotoCatName).html('<img src="loader.gif" style="margin:20px;">');
			$("#"+oldFotoName).animate({height:0}, 800);
			
				/*Loading page dynamically from host*/
				$("#"+fotoCatName).load('takePhotoOrVideo.php?content=foto&dir='+teamDir);				

			$("#"+fotoCatName).animate({height:380}, 800);
			oldFotoName=fotoCatName;
		}

		function openCloseVideo(videoCatName, teamDir){
			$("#"+videoCatName).html('<img src="loader.gif" style="margin:20px;">');
			$("#"+oldVideoName).animate({height:0}, 800);

				/*Loading page dynamically from host*/
				$("#"+videoCatName).load('takePhotoOrVideo.php?content=video&dir='+teamDir);
				
			$("#"+videoCatName).animate({height:380}, 800);
			oldVideoName=videoCatName;
		}




