jQuery(document).ready(function() {

	// mozilla (mac) positioning fix
	if(navigator.userAgent.indexOf('Mac') != -1){
		if (jQuery.browser.mozilla) {
			jQuery("#flash-ani").css("margin-top","101px"); //9px more than ff win
			jQuery("body#new-homes ul#links").css("margin-top","-1px");
			jQuery("body#home ul#links").css("margin-top","1px");
		}				  
	}
		
	jQuery("#tab-new-homes a").mouseover(function() {
		jQuery(this).parent().css("background-image","url(images/tab-new-homes-over.gif)").css("background-color","#877789");		
		jQuery(this).css("color","#ffffff");
	}).mouseout(function(){
		jQuery(this).parent().css("background-image", "url(images/tab-new-homes.gif)").css("background-color","#e1dde1");
		jQuery(this).css("color","#512764");
	});	
	
	jQuery("#tab-sales a").mouseover(function() {
		jQuery(this).parent().css("background-image","url(images/tab-sales-over.gif)").css("background-color","#877789");		
		jQuery(this).css("color","#ffffff");
	}).mouseout(function(){
		jQuery(this).parent().css("background-image", "url(images/tab-sales.gif)").css("background-color","#e1dde1");
		jQuery(this).css("color","#512764");
	});	
	
	jQuery("#tab-lets a").mouseover(function() {
		jQuery(this).parent().css("background-image","url(images/tab-lets-over.gif)").css("background-color","#877789");		
		jQuery(this).css("color","#ffffff");
	}).mouseout(function(){
		jQuery(this).parent().css("background-image", "url(images/tab-lets.gif)").css("background-color","#e1dde1");
		jQuery(this).css("color","#512764");
	});			
	
	
	//search rollover
	jQuery(".listsearch").mouseover(function() {								   
		jQuery(this).attr("src","/images/list-search-on.jpg");
	}).mouseout(function(){
		jQuery(this).attr("src","/images/list-search-off.jpg");
    });
    
    jQuery(".mapsearch").mouseover(function() {								   
		jQuery(this).attr("src","/images/map-search-on.jpg");
	}).mouseout(function(){
		jQuery(this).attr("src","/images/map-search-off.jpg");
    });

	
});

jQuery(document).ready(
		function(){
			// Slideshow Function
			if (jQuery.fn.innerfade) jQuery('#slideshow').innerfade({
				animationtype: 'fade',
				speed: 2000, //Fade out or slide speed
				timeout: 6000, //Image rotation speed
				type: 'random',
				containerheight: '577px'
			});
		}
);
// End of Slideshow function

var addOfficeMapIcon = function(onDraw) {
	var icon = new GIcon()
	icon.image = "/images/googleMap.png",
	icon.iconSize = new GSize(33, 38)
	icon.iconAnchor = new GPoint(16, 38)
	icon.infoWindowAnchor = new GPoint(33, 38)

	var latlng = new GLatLng(51.524908506009425, -0.08021280169487);
	var marker = new GMarker(latlng, {
		title: 'Bridge Estate Agents',  
		icon: icon
	});
	var contentString = '<div id="mapcontent">'+
	    '<div id="siteNotice">'+
		    '</div>'+
			    '<h1 id="firstHeading">Bridge Estate Agents</h1>'+
			    
				    '<div id="bodyContent">'+
				    	'<img src="/images/googleMapImg.jpg" alt="Bridge Estate Agents" />'+
					    '<p>98a Curtain Road, Greater London' +
					    '<br />EC2A 3AA' +
					    '<br /><strong>020 7749 1400</strong>'+
					    '<br />info@bridge.co.uk</p>'+
				    '</div>'+
	    '</div>';
	GEvent.addListener(marker, "click", function() {
		marker.openInfoWindowHtml(contentString);
	});
	map.addOverlay(marker);
};

