// Create an array of images that you'd like to use
var welcome = ['Willkommen', 'Bienvenue', 'Welcome'];


$(document).ready(function(){

	$("#boxLeft").hide();
	$("#boxRight").hide();
			
	$(document).mousemove(function(e){
		if(e.pageX < ($(window).width() / 2)){
			$("#boxLeft").hide();
			$("#boxRight").show();
			
			$("#spalteLogoLeft img").remove();
			$('#spalteLogoLeft').append('<img src="themes/kernen/images/landingLogoKernen.png" />');
			$("#spalteLogoRight img").remove();
			$('#spalteLogoRight').append('<img src="themes/kernen/images/landingLogoAlpes_hover.png" />');
		}
		else{
			$("#boxLeft").show();
			$("#boxRight").hide();
			
			$("#spalteLogoLeft img").remove();
			$('#spalteLogoLeft').append('<img src="themes/kernen/images/landingLogoKernen_hover.png" />');
			$("#spalteLogoRight img").remove();
			$('#spalteLogoRight').append('<img src="themes/kernen/images/landingLogoAlpes.png" />');
		}
	  
	});
   
	$(document).click(function(e){
		if(e.pageX < ($(window).width() / 2)){
			window.location = 'http://hotel-kernen.ch/home-de-DE';
		}
		else {
			window.location = 'http://desalpes.ch/home-de-DE';
		}
	}); 
   
	$('body').find('#wrapperStart').css({
		left: ($(window).width() - $('body').find('#wrapperStart').width())/2 + "px"
	});
});
   

$(window).resize(function() {
    $('body').find('#wrapperStart').css({
		left: ($(window).width() - $('body').find('#wrapperStart').width())/2 + "px"
	});
});


$.each(welcome, function(j) {
    $("#startNav ul li a").eq(j).mouseover(function() {
        $('#welcomeLeft').append("<h1>" + welcome[j] + "</h1>");
    }).mouseout(function(){
        $("#welcomeLeft h1").remove();
    });
    
});

$.each(welcome, function(j) {
    $("#startNav ul li a").eq(j + 3).mouseover(function() {
        $('#welcomeRight').append("<h1>" + welcome[j] + "</h1>");
    }).mouseout(function(){
        $("#welcomeRight h1").remove();
    });
    
});


