(function($){
	$(document).ready(function() {
		$('.defaulttext').focus(function(srcc) {
			if ($(this).val() == $(this)[0].title) {
				//$(this).removeClass('defaulttext-active');
				$(this).val('');
			}
		});
	
		$('.defaulttext').blur(function() {
			if ($(this).val() == '') {
				//$(this).addClass('defaulttext-active');
				$(this).val($(this)[0].title);
			}
		});
	
		$('.defaulttext').blur();        
	
		$('div.map').each(function(index, mapElement) {
			if (GBrowserIsCompatible()) {
				var kml = $(mapElement).find('a').attr('href');
				if (kml) {
					$(mapElement).children().remove();
					$(mapElement).css('visibility', 'hidden');
					var map = new GMap2(mapElement);
					map.disableInfoWindow();
					map.setCenter(new GLatLng(89, 0), 13);
					map.setMapType(G_PHYSICAL_MAP);
					map.setUIToDefault();
					var path = new GGeoXml(kml);
					map.addOverlay(path);
					GEvent.addListener(path, 'load', function() {
						path.gotoDefaultViewport(map);
						$(mapElement).css('visibility', 'visible');
					});
				}
			}
		});
	});
})(jQuery);
