// JavaScript Document
$(document).ready(function(){


		
					imgW = 1440;
				imgH = 920;
				oran = imgW/imgH 


	var Wt = $(window).width();
	var Wh = $(window).height();
				
	$('#iframe').css({"left":(Wt-$("#iframe").width())/2+"px","bottom":-500+"px"});
	$('#footer').css({"left":(Wt-$("#footer").width())/2+"px"});
	$("#header").animate({"top":-3+"px"},"slow");
	$("#footer").animate({"bottom":"0px"},"slow");
	
	$("#DilContainer a").click(function(){
		window.location.href='?lng='+$(this).attr("id");
	});
	
	$(window).resize(function(){
		var Wt = $(window).width();
		var Wh = $(window).height();

		$('#footer').css({"left":(Wt-$("#footer").width())/2+"px"});
		$('#iframe').css({"left":(Wt-$("#iframe").width())/2+"px","bottom":33+"px"});

				$('#bresim').attr('width',$(window).width());
				$('#bresim').attr('height',1/oran*$('#bresim').width());
				
				if ($('#bresim').height()<$(window).height()){
					$('#bresim').attr('height',$(window).height());	
					$('#bresim').attr('width',oran*$('#bresim').height());
				}
						
		if ($("#resim_galeri").width() > 5 ){
			$("#resim_galeri").css({"width":Wt,"height":Wh});
		}
	});
	

	$("#footer").animate({"opacity":"1"}, 1000,function() {
			Ajx('bgjx','bg.asp','ID=');
		});
});
var df = 0;

function gitDetay1(ne){
		var Wt = $(window).width();
		var Wh = $(window).height();
				Ajx('popup','galeri.asp','gD=1&ID='+ne);

			}

			
function CreatePage(url,tip){
	var Wt = $(window).width();
	var Wh = $(window).height();
		$("#iframe").animate({'opacity':0,"bottom":-500+"px"}, 1000,function() {

			$("#bgjx").animate({'opacity':0}, 400,function() {$("#bgjx").html("")});
			df = url;
			Ajx('iframe','page.asp','pg='+url+'&tip='+tip);
			$('#iframe').css({"left":(Wt-$("#iframe").width())/2+"px","bottom":-500+"px"});
			$("#iframe").animate({"bottom":-500+"px",'opacity':0}, 500,function() {
				$("#bgjx").animate({'opacity':1}, "fast",function() {
						Ajx('bgjx','bg.asp','ID='+url);
					});
				$("#iframe").animate({"bottom":33+"px",'opacity':1}, 1000);
			});
		});

}

function CreatePageX(tip,dtip){
	var Wt = $(window).width();
	var Wh = $(window).height();
		$("#iframe").animate({'opacity':0,"bottom":-500+"px"}, 1000,function() {
			Ajx('iframe','page.asp','tip='+tip+'&dtip='+dtip);
			$('#iframe').css({"left":(Wt-$("#iframe").width())/2+"px","bottom":-500+"px"});
			$("#iframe").animate({"bottom":-500+"px",'opacity':0}, 500,function() {
				$("#iframe").animate({"bottom":33+"px",'opacity':100}, 1000);
			});
		});

}
function Ajx(eleman,sayfa,parametre){
//				$('#'+eleman).html('<div align="center"><img src="ctrl.gif"></div>');
				$.ajax({
				   type: 'GET',
				   url: sayfa,
				   cache: false,
				   data: parametre,
				   success: function(sonuc) {
						$('#'+eleman).html(sonuc);
					}
				});
			}


