/**
 * @project: Seigneur
 * @location: Wax Interactive - www.wax.be
 * @date: 02.03.2010
 * @author: Jan De Wilde
 * @description: Core logic
 */

if(typeof $.SEIGNEUR == "undefined") {
	$.SEIGNEUR = Object;
}

/**
 * Font replacement.
 */
$.SEIGNEUR.cufon = {
	
	activate	:	function() {
		Cufon.replace('.cufon,#right h1,#right h2,#right h3,#right h4');
	}

}

/**
 * Cycle header
 */
$.SEIGNEUR.cycle = {
	
	activate	:	function() {
		$('#cycle').cycle({
			fx: 'fade'
		});
	}

}

/**
 * Logic that handles Google Maps.
 */
$.SEIGNEUR.maps = {

	initialize	:	function() {
		var latlng = new google.maps.LatLng(50.852043,3.30505);
		var center = new google.maps.LatLng(50.853543,3.30505);
		
		var myOptions = {
			zoom: 16,
			center: center,
			mapTypeId: google.maps.MapTypeId.ROADMAP
		};
		
		var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
		
		var marker = new google.maps.Marker({
			position: latlng, 
			map: map,
			title:"Bouwonderneming Seigneur NV"
		});
		
		var contentString = '<div style="color:#999; font-size:12px; line-height:12px;"><strong>Bouwonderneming Seigneur NV</strong><br />Kortrijksesteenweg 240<br />8530 Harelbeke</div>';
		
		var infowindow = new google.maps.InfoWindow({
			content: contentString
		});
		
		infowindow.open(map,marker);
	}

}

$.SEIGNEUR.lightbox = {

	initialize	: function(){
		$('A[rel^="lightbox"]').lightBox({
			overlayBgColor: "#000",
			overlayOpacity: 0.6,
			imageLoading: "/public/images/lightbox/loading.gif",
			imageBtnClose: "/public/images/lightbox/close.gif",
			imageBtnPrev: "/public/images/lightbox/prev.gif",
			imageBtnNext: "/public/images/lightbox/next.gif",
			imageBlank: "/public/images/lightbox/blank.gif", 
			containerResizeSpeed: 350,
			txtImage: "",
			txtOf: "of"
		});
	}
	
}

/**
 * @description: Initialise website
 */
 
$.SEIGNEUR.cufon.activate();
$.SEIGNEUR.cycle.activate();

$(document).ready(function(){
	$.SEIGNEUR.lightbox.initialize();
	if($('#map_canvas').length) {
		$.SEIGNEUR.maps.initialize();
	}
});
