// JavaScript Document
$(document).ready(Firstly);

function Firstly(){
	$("#btnForms").animate({width:'100%', height:'1'}, 10);
	$("#btnForms").animate({width:'100%', height:'0'}, 10);
}

function openDiv($name, $w, $h){
	$("#"+$name).animate({width:$w, height:'0'}, 800);
	$("#"+$name).animate({width:$w, height:$h}, 800);
}

function closeDiv($name2, $w2, $h2){
	$("#"+$name2).animate({width:$w2, height:$h2}, 500);
}

var status=0;
function openClosePharmacy(){
		if(status==0){
			$("#allPharmacy").animate({height:150, width:263, padding:5}, 400);
			status=1;
		}else{
			$("#allPharmacy").animate({height:0, width:273, padding:0}, 400);
			status=0;
		}
	}

/*TUM ILANLAR BOX OPEN CLOSE DIVS*/
	$(document).ready(
			function(){
				$(".TIcontents1").animate({height:355, opacity:1}, 500);
				$(".TIcontents2").animate({height:0, opacity:0}, 10);
				$(".TIcontents3").animate({height:0, opacity:0}, 10);
				$(".TIcontents4").animate({height:0, opacity:0}, 10);
				}
			)
	
	function ilanBoxAcKapat(TIname, TIh){
			$(".TIcontents1").animate({height:0, opacity:0}, 500);
			$(".TIcontents2").animate({height:0, opacity:0}, 500);
			$(".TIcontents3").animate({height:0, opacity:0}, 500);
			$(".TIcontents4").animate({height:0, opacity:0}, 500);
			
			$("."+TIname).animate({height:TIh, opacity:1}, 500);
		}
		
/*EMLAK ILANLAR BOX OPEN CLOSE DIVS*/
	$(document).ready(
			function(){
				$(".EIcontents1").animate({height:440, opacity:1}, 500);
				$(".EIcontents2").animate({height:0, opacity:0}, 10);
				$(".EIcontents3").animate({height:0, opacity:0}, 10);
				$(".EIcontents4").animate({height:0, opacity:0}, 10);
				}
			)
	
	function emlakBoxAcKapat(EIname, EIh){
			$(".EIcontents1").animate({height:0, opacity:0}, 500);
			$(".EIcontents2").animate({height:0, opacity:0}, 500);
			$(".EIcontents3").animate({height:0, opacity:0}, 500);
			$(".EIcontents4").animate({height:0, opacity:0}, 500);
			
			$("."+EIname).animate({height:EIh, opacity:1}, 500);
		}


/*NEWS SLIDER FUNCTION*/
		
		var oldBtn='bt1';

		function newsSlider(slideNumber, whichBtn){
			$("."+oldBtn).css({color:'#ffffff'});
			oldBtn=whichBtn;
			$("."+whichBtn).css({color:'#ff0000'});
			$("#allNewsContainer").animate({marginLeft:slideNumber}, 1000);
		}


/*NEW COMPANIES AUTO SLIDER FUNCTION*/
		
		var startNum=-40;

		function companySlider(){
			if(startNum>-160){
				$("#newCompaniesSlider").animate({marginTop:startNum}, 500);
				startNum=startNum-40;
			}else if(startNum==-160){
				$("#newCompaniesSlider").animate({marginTop:0}, 900);
				startNum=-40;
			}
		}

		var swatch=setInterval(companySlider,4000);




