// JavaScript Document

//#####################################################################     
//###############     CopyRight Granville Design      #################
//###############       http://www.granville.nl       #################
//#####################################################################
//# @GD 2009 														  #
//# property.script.js												  #
//#####################################################################

// jQuery
$(document).ready(function() {
	
	
	
	// FANCYBOX: runs the fancybox plugin
	// DEPENDABILITIES: jquery.easing.js
	$('.jFancybox').fancybox();	
		

	// MAP: initializes a simple google map object
	// DEPENDABILITIES: google maps api
	if (GBrowserIsCompatible()) {
		
		t = setTimeout(function() {     // timout gives other fuctions a chance to finish loading                                      
                         
			$('.jMap').each(function(i) {
				
				latlng = $(this).children('a:first').attr('rel').split(', ');
				id = $(this).attr('id');
				var mapTitle = $(this).children('a:first').attr('title');
				
				var map 	= new GMap2(document.getElementById(id));
				var point 	= new GLatLng(latlng[0],latlng[1]);
				map.setCenter(point, 12);
				map.setMapType(G_HYBRID_MAP);
				
				marker = new GMarker(point);
				map.addOverlay(marker);
				
				GEvent.addListener(marker, "click", function(event) {
					map.openInfoWindowHtml(point, document.createTextNode(mapTitle));
				});
				
				map.setUIToDefault();
				map.addControl(new GMapTypeControl());
				map.disableScrollWheelZoom();
		
			});
			
		}, 1500); // adjust your time here
	}
	
	
	// SCROOLPANE: runs the scrollpane plugin
	$('.jScrollpaneButtonUp').click(function() {
		$('.jScrollpane').scrollTo( {top:'-=70px', left:'-=0px'}, 800);
	});
	$('.jScrollpaneButtonDown').click(function() {
		$('.jScrollpane').scrollTo( {top:'+=70px', left:'-=0px'}, 800);
	});


});