

$(document).ready(function () {

	// map hover
	$('#landing a.hotel_pos').hover(function(){
		var rel = $(this).attr('rel');
		$('#landing .span_'+rel+'').fadeIn();
		$('#landing .box_'+rel+'').addClass('hover');
	},function(){
		var rel = $(this).attr('rel');
		$('#landing .span_'+rel+'').fadeOut();
		$('#landing .box_'+rel+'').removeClass('hover');
	});
	$('#landing .hotel .logo_box').hover(function(){
		
		var rel = $(this).parent().attr('rel');
	
		$('a.hotel_pos[rel='+rel+'] ').addClass('hover');
	},function(){
		var rel = $(this).parent().attr('rel');
		$('a.hotel_pos[rel='+rel+'] ').removeClass('hover');
	});
	// STYLE SELECT
	$('.my-dropdown').sSelect({ddMaxHeight: '100px'});

	// SLIDESHOW
	$("#slideshow").cycle({
		fx:     'fade', 
    speed:  'fast',
		timeout:0,
		next: '#next',
		prev: '#prev',
		circular: false
		/*onPrevNextEvent: function(isNext, zeroBasedSlideIndex, slideElement) {
			$("#gallery_wrap .list_box a.thumb").each(function(){$(this).removeClass('active'); });
			$("#gallery_wrap .list_box a.thumb[rel="+(zeroBasedSlideIndex+1)+"]").addClass('active');	
		} */
	});
	
	
		 

	
	//OFFERS POPUP
	$('a.fancy_popup').fancybox({
    "overlayColor": "#000",
    "showCloseButton": true,
    "padding": "0",
    "margin": "10",
    "centerOnScroll": true,
    'autoDimensions'	: false,
    'showNavArrows'	: false,
    'width'         		: 800,
		'height'        		: 'auto'
  });
	
	
	
	
	// GALLERY
	 $('a.fancy').fancybox({
		 'titlePosition' 		: 'over',
		 'padding': '0'
	 });

	// BOOKING FORM - IATA CODE
	$('#bf span#txt_accesscode').click(function(){
		$('#bf span#txt_accesscode').hide();
	});


	
}); // close document.ready


// GOOGLE MAP  48.861613, 2.365086

 function initialize() {

	var locations = [
		["<div id=\"gmap_infowindow\"><h3>My Hotel In France Le Marais </h3><br />2 rue Commines, 75003 Paris<br />Tel : +33 (0)1 40 29 01 33 <br />Fax : +33 (0)1 40 29 06 69<br /><a href=\"mailto:lemarais@my-hotel-in-france.com\">lemarais@my-hotel-in-france.com</a><br /><br /><a style=\"font-size:12px;font-weight:bold;color:#D03528;\" href=\"javascript:;\" onclick=\"hhotelSearch('FRMPHHTLDMarais', '', '', '', '', '', '&amp;FSTBKNGTrackLink=');\">Book Now!</a></div>", 48.861613, 2.365086 , 1],
	];

	var map = new google.maps.Map(document.getElementById('map_canvas'), {
		zoom: 13,
		center: new google.maps.LatLng(48.861613, 2.365086),
		mapTypeId: google.maps.MapTypeId.ROADMAP
	});

	var infowindow = new google.maps.InfoWindow({
		'maxWidth': 300
	});

	var marker, i;

	for (i = 0; i < locations.length; i++) {
		marker = new google.maps.Marker({
			position: new google.maps.LatLng(locations[i][1], locations[i][2]),
			map: map
		});

		google.maps.event.addListener(marker, 'click', (function(marker, i) {
			return function() {
				infowindow.setContent(locations[i][0]);
				infowindow.open(map, marker);
			}
		})(marker, i));
	};
}

$(window).load( function() {
	if($('#map_canvas').length > 0){
		initialize();
	}
}); // close window.load

