
function showEnterSite(){
	$('#enterSite').show();
}


$(document).ready(function(){
	
	$('body').show();
	
	$(window).resize(function() {
		yOffset = ($(window).height() - 556) / 2;
		if (yOffset < 0){
			yOffset = 0;
		}
		$('#menu').css('marginTop', -593 + yOffset);
		//alert(posterShown);
		
	});
	
	

	var yOffset = ($(window).height() - 556) / 2;
	if (yOffset < 0){
		yOffset = 0;
	}
	

	$('#cloud1').css('left', 0);
	$('#cloud1').css('top', 0 + yOffset);
	
	$('#cloud2').css('left', (143/1000) * $(window).width());
	$('#cloud2').css('top', 141 + yOffset);
	
	$('#cloud3').css('left', (597/1000) * $(window).width());
	$('#cloud3').css('top', -150 + yOffset);
	
	$('#cloud4').css('left', (677/1000) * $(window).width());
	$('#cloud4').css('top', 127 + yOffset);
	
	$('#cloud5').css('left', (806/1000) * $(window).width());
	$('#cloud5').css('top', -60 + yOffset);
	
	$('#cloud6').css('left', (1036/1000) * $(window).width());
	$('#cloud6').css('top', 83 + yOffset);
	
	$('#cloud7').css('left', (1199/1000) * $(window).width());
	$('#cloud7').css('top', 220 + yOffset);
	
	$('#cloud8').css('left', (1260/1000) * $(window).width());
	$('#cloud8').css('top', -5 + yOffset);
	
	$('#cloud9').css('left', (1400/1000) * $(window).width());
	$('#cloud9').css('top', 155 + yOffset);
	
	$('#clouds .cloud').each(
		function (intIndex){
			$(this).children('img').width(230 + Math.floor(Math.random() * 45));
			$(this).children('img').height(160 + Math.floor(Math.random() * 45));
			//$(this).css('left', Math.floor(Math.random() * 1500));
			//$(this).css('top', Math.floor(-50 + Math.random() * 300));
			
			animate($(this));
			
		}
	);
	
	setTimeout("showEnterSite()", 3000);
	//showPoster();
	
	function animate(mc){
		mc.animate({
			left:-300
		}, (500 * mc.position().left / 25) * (275 / mc.children('img').width()) * (275 / mc.children('img').width()), "linear", function(){
			mc.css('left', 2500);
			animate(mc);
		});
	}
	//20000 * (275 / mc.children('img').width()) * (275 / mc.children('img').width())
	
	
	
	//CLOUDS
	/*$('#clouds .cloud').each(
		function (intIndex){
			$(this).children('img').width(200 + Math.floor(Math.random() * 75));
			$(this).children('img').height(130 + Math.floor(Math.random() * 75));
			$(this).css('left', Math.floor(Math.random() * 1500));
			$(this).css('top', Math.floor(-50 + Math.random() * 300));
			
			animate($(this));
			
		}
	);
	
	function animate(mc){
		mc.animate({
			left:-300,
		}, (1000 * mc.position().left / 25) * (275 / mc.children('img').width()) * (275 / mc.children('img').width()), "linear", function(){
			mc.css('left', 1500);
			animate(mc);
		});
	}*/
	
	
	
	$('#menu').css('marginLeft', 217);
	$('#menu').css('marginTop', -593 + yOffset);
	
	$('#menu #tagline').css('marginTop', 598);
	$('#menu #tagline').css('marginLeft', 54);
	
	
	$('#menu #menuItems #pembe').css('marginTop', 755);
	$('#menu #menuItems #pembe').css('marginLeft', 47);
	
	$('#menu #menuItems #sari').css('marginTop', 765);
	$('#menu #menuItems #sari').css('marginLeft', 138);
	
	$('#menu #menuItems #yesil').css('marginTop', 771);
	$('#menu #menuItems #yesil').css('marginLeft', 220);

	var stepPembe = 10;
	var stepSari = 0;
	var stepYesil = 10;
	
	setInterval(function() {
		
		$('#menu #menuItems #pembe img').css('marginLeft', - stepPembe * 184);
		stepPembe += 1;
		if (stepPembe == 20){
			stepPembe = 0;
		}
		
		$('#menu #menuItems #sari img').css('marginLeft', - stepSari * 184);
		stepSari += 1;
		if (stepSari == 20){
			stepSari = 0;
		}
		
		$('#menu #menuItems #yesil img').css('marginLeft', - stepYesil * 184);
		stepYesil += 1;
		if (stepYesil == 20){
			stepYesil = 0;
		}
	}, 200);
	
	$('#logo').css('marginTop', 920);
	$('#logo').css('marginLeft', 249);
	
	$('#kunye').css('marginTop', 1054);
	$('#kunye').css('marginLeft', 224);
	
	$('#mostLogo').css('marginTop', 1114);
	$('#mostLogo').css('marginLeft', 333);
	
	$('#imajLogo').css('marginTop', 1121);
	$('#imajLogo').css('marginLeft', 407);
	
	$('#date').css('marginTop', 1114);
	$('#date').css('marginLeft', 298);
	$('#date').hide();
	
	$('#enterSite').css('marginTop', 791);
	$('#enterSite').css('marginLeft', 350);
	$('#enterSite').hide();
	
	
	$(document).bgStretcher({
		images: ['images/bg.jpg'],
		imageWidth: 1000, imageHeight: 600, nextSlideDelay:10000, slideShowSpeed:500
	});
});
