$(document).ready(function(){
	
	$(document).pngFix();
	
	$('a.email').nospam({ replaceText: true, filterLevel: 'low' });
	
	if( document.getElementById('map') ){
		GoogleMaps.attachMap('map', {x:58.4135447,y:15.6144400});
	}
	
	if( $('.storytitle') ){
		//document.title = 'blah';
		//document.title = $('.storytitle').text() + ' ServDes.';	
	}
	
});

jQuery.fn.slideFadeToggle = function(speed, easing, callback) {
  return this.animate({opacity: 'toggle', height: 'toggle'}, speed, easing, callback);  
};

jQuery.fn.fadeToggle = function(speed, easing, callback) { 
   return this.animate({opacity: 'toggle'}, speed, easing, callback); 
};



/*
	GoogleMaps
--------------------------------------------------------------------- */
var GoogleMaps = {
	init: function(){
		// intentionally left blank
	},
	setLocation: function(){
		// the cordinates for the different locations
		// http://maps.google.com/maps/geo?q=YOUR+SEARCH+QUERY+HERE&output=csv&key=YOUR+API+KEY+HERE
		//http://maps.google.com/maps/geo?q=konsert+%26+kongress,+linköping&output=csv&key=ABQIAAAAuP24ujgl-btQs5TZRGCnZxR7nxYK00u1srgird7YU8OI_8PSDhQWS36Z7PDnr3j7oKxy3FHwWCb01w
	},
	attachMap: function(id, location){
		// the map
		if (GBrowserIsCompatible()){
			var map = new GMap2( document.getElementById(id));
				var coordinates = location;
				var latitudeLongitude = new GLatLng(coordinates.x,coordinates.y);
				map.setMapType(G_SATELLITE_MAP);
				map.setCenter(latitudeLongitude, 15);
				map.addControl(new GLargeMapControl());
				map.addControl(new GMapTypeControl());
			
				var iconConf = new GIcon();
				iconConf.image = "/wp/wp-content/themes/servdes/images/location.png";
				//iconConf.shadow = "images/location.png";
				iconConf.iconSize = new GSize(495, 101);
				iconConf.shadowSize = new GSize(0, 0);
				iconConf.iconAnchor = new GPoint(53, 101);
				iconConf.infoWindowAnchor = new GPoint(0, 0);
				iconConf.infoShadowAnchor = new GPoint(0, 0);
				markerOptions = { icon:iconConf };
			
				map.addOverlay(new GMarker(latitudeLongitude, markerOptions));
		}
	}
}

