$(document).ready(function() {
	
	
	checkWin();
	$(window).resize(function() {
		checkWin();
	});
	
	
	$('#checker').val("EN");
	$('#on_off_on').attr('checked', true);

	$('#on_off_on').iphoneStyle({ checkedLabel: 'EN', uncheckedLabel: 'DE' });
	


	var checkbox = $('#on_off_on');
	
	$('#content').html('<img src="images/ajax-loader.gif" />');
	$.ajax({ 
		url : "content/start_en.php",
		success : function (data) {
		$("#content").html(data);
		}
	});
	
	// checked = eng. // unchecked = dt.
	
	checkbox.change(function(){
		if ($("#on_off_on").is(":checked")) {
			fillenglish();
		} else {
			fillgerman();
		}
	});
	
	$.ajax({ 
		url : "menu_en.php",
		success : function (data) {
				$("#menu").fadeOut(200, function(){
					$("#menu").html(data);
				});
				},
		complete: function () {
			$("#menu").delay(400).fadeIn();
		}
	});
	
	function comeup() {
		$('#curtain_logo').fadeOut(300);
	}
	
	$('#curtain_logo').click(function(){comeup();});
	
	$(".e1").fadeTo(1, 1); // This sets the opacity of the thumbs to fade down to 60% when the page loads

	$(".e1").hover(function(){
		// $(this).fadeTo(300, 1.0); // This should set the opacity to 100% on hover
		$(this).stop();
		$('.ajax').stop();
		$(this).animate({
			'left': '0px',
		}, 400);
		$('.ajax').animate({
			'left': '250px',
		}, 400);
	},function(){
		// $(this).fadeTo(300, 0.07); // This should set the opacity back to 60% on mouseout
		$(this).stop();
		$('.ajax').stop();
		$(this).animate({
			'left': '-190px',
		}, 400);
		$('.ajax').animate({
			'left': '60px',
		}, 400);
	});
	
});
