var map = null;
var geocoder = null;

function initialize() {
	map = new GMap2(document.getElementById("map_canvas"));
	//map.setCenter(new GLatLng(34, 0), 1);
	geocoder = new GClientGeocoder();
	map.addControl(new GSmallMapControl());
	//map.addControl(new GMapTypeControl());
}

function showAddress(address) {
	if (geocoder) {
		geocoder.getLatLng(
			address,
			function(point) {
				if (!point) {
					alert(address + " not found");
				} else {
					map.setCenter(point, 15);
					var marker = new GMarker(point);
					map.addOverlay(marker);
					//marker.openInfoWindowHtml(address);
				}
			}
		);
	}
}

window.addEvent('domready', function() {

	// Animation frontpage
	if( $('slideshow') ) {
		var slideshow = new BarackSlideshow('menu', 'pictures', 'loading', {transition: 'fade', auto: true});
	}
	
	// Tabs main cat page
	if( $('companyCat') ) {
	 
		$('one').addEvent('click', function(){
			$('contenttwo').setStyle('display', 'none'); 
			$('contentone').setStyle('display', 'block');
			$('one').addClass('active');
			$('two').removeClass('active');
		});
		$('two').addEvent('click', function(){
			$('contenttwo').setStyle('display', 'block'); 
			$('contentone').setStyle('display', 'none');
			$('two').addClass('active');
			$('one').removeClass('active');
		});

	}

});
