﻿/* Lacaze & Carnier 2011 */
/* www.lacaze.carnier.com */
/* info@lacaze-carnier.com */

function CounterOutput(){
	$('#LnC_Counter').empty();
	$('#LnC_Counter').append(Counter);
	
	if (Counter>DaysLeft){
		Counter--;
		setTimeout("CounterOutput();",50);
	};
}

function LnC_vCore(e){
	//TIMER
	if (document.getElementById("LnC_Counter")) {
		Today = new Date();
		FinalDay = new Date("February 28, 2012");
		msPerDay = 24 * 60 * 60 * 1000;
		TimeLeft = (FinalDay.getTime() - Today.getTime());
		e_DaysLeft = TimeLeft / msPerDay;
		DaysLeft = Math.floor(e_DaysLeft);
		Counter = 300;
		
		if (CounterActive == 0) {
			if (($(window).height() - 50) > document.getElementById('LnC_Counter').offsetTop) {
				CounterActive = 1;
				setTimeout("CounterOutput();",5000);
			}
			$(window).scroll(function () {
				if (($(window).scrollTop() - 50) > document.getElementById('LnC_Counter').offsetTop) {
					CounterActive = 1;
					setTimeout("CounterOutput();",5000);
				}
			})
		}
	}

	//GALLERY
	if (document.getElementById("LnC_Gallery")) {
		$('#LnC_Gallery').height(($(window).height()-250 + 'px'))
	}

	//MINIGALLERY
	if (document.getElementById("LnC_MiniGallery")) {
		$("#LnC_MiniGalleryImageTabs").tabs("#LnC_MiniGalleryImage > div", {
			effect: 'fade',
			fadeInSpeed: 1000,
			fadeOutSpeed: 1000,
			rotate: true
		}).slideshow({autoplay: false, autopause: false, interval: 5000});
	}

	$('#Scrolling').jScrollPane(
		{
			verticalDragMinHeight: 96,
			verticalDragMaxHeight: 96,
			verticalGutter: 10
		}
	);

}


function PreLoadSlideShow(){
	$(".IllustrationImageTabs").tabs("#LnC_IllustrationImage > div", {
		effect: 'fade',
		fadeInSpeed: 2000,
		fadeOutSpeed: 2000,
		rotate: true
	}).slideshow({autoplay: true, autopause: true, interval: 6500});
	$('#LnC_IllustrationOverlay_Preload').animate({ opacity: 0 }, 3000, function() {
		$('#LnC_IllustrationOverlay_Preload').css('display','none');
	});
}



// GOOGLE MAP
function initialize() {
	var latlng = new google.maps.LatLng(52.534482,13.40599);
	var myOptions = {
		zoom: 18,
		center: latlng,
		mapTypeId: google.maps.MapTypeId.ROADMAP,

		mapTypeControl: false,
	    navigationControl: true,
	    navigationControlOptions: {
	        style: google.maps.NavigationControlStyle.ANDROID,
	        position: google.maps.ControlPosition.BOTTOM
	    },
	    scaleControl: true,
	    scaleControlOptions: {
	        position: google.maps.ControlPosition.TOP
	    }     
	};
	var map = new google.maps.Map(document.getElementById("LnC_GoogleMap"), myOptions);

	var image = 'http://www.k6364.de/LNC/fileadmin/k6364/image/MapIcon.png';
	var marker = new google.maps.Marker({
		position: latlng,
		icon: image
	});
  
	marker.setMap(map); 
}

function PreLoadMap(){
	$('#LnC_IllustrationOverlay_Preload').animate({ opacity: 0 }, 3000, function() {
		$('#LnC_IllustrationOverlay_Preload').css('display','none');
		$('#LnC_IllustrationOverlay_Preload').animate({ opacity: 0 }, 3000, function() {
			$('#LnC_IllustrationImage_1').animate({ opacity: 0 }, 1000, function() {
				$('#LnC_IllustrationImage_1').css('display','none');
			});
		});
	});
}




