/*
 * Core script for art-businessgroup.com
 */
 
var on_sub = false;
var show_speed = 'fast';
var hide_speed = 100;

images = new Array();
images[0]="m-3pl.jpg"
images[1]="m-customs.jpg"
images[2]="m-oversized.jpg"
images[3]="m-road.jpg"
images[4]="m-air.jpg"
images[5]="m-exhibition.jpg"
images[6]="m-rail.jpg"
images[7]="m-sea.jpg"
imageObj = new Image();

for(i=0; i<=7; i++) {
     imageObj.src="../images/"+images[i];
}
     
$(document).ready(function(){
	$("#ourServices, #ourOffices, #FraOffice, #usefulInformation, #ourCompany, #lanSecondary").hide().css('visibility', 'visible');
	
	$(".services")
	.mouseenter(function(){
		$("#ourServices").show(show_speed);
	})
	.mouseleave(function(){
		$("#ourServices").hide(hide_speed);
	});
	
	$(".offices")
	.mouseenter(function(){
		$("#ourOffices").show(show_speed);
	})
	.mouseleave(function(){
		$("#ourOffices").hide(hide_speed);
	});
	
	$(".frankfurt")
	.mouseenter(function(){
		$("#FraOffice").show(show_speed);
	})
	.mouseleave(function(){
		$("#FraOffice").hide(hide_speed);
	});
	
	$(".useful-information")
	.mouseenter(function(){
		$("#usefulInformation").show(show_speed);
	})
	.mouseleave(function(){
		$("#usefulInformation").hide(hide_speed);
	});


	$(".our-company")
	.mouseenter(function(){
		$("#ourCompany").show(show_speed);
	})
	.mouseleave(function(){
		$("#ourCompany").hide(hide_speed);
	});


	$(".language")
	.mouseenter(function(){
		$("#lanSecondary").show(show_speed);
	})
	.mouseleave(function(){
		$("#lanSecondary").hide(hide_speed);
	});	
	
	// google maps initialization

	// kazakhstan map
	if (document.getElementById("map1") != null) {
		if (GBrowserIsCompatible()) {
			var map1 = new GMap2(document.getElementById("map1"));
			var latlng = new GLatLng(43.230068,76.945307);
			var marker = new GMarker(latlng);
			map1.setCenter(latlng, 15);
			map1.setUIToDefault();
		     map1.addOverlay(marker);
		     
			GEvent.addListener(marker, "click", function() {
				marker.openInfoWindowHtml("Office in Kazakhstan:<br />");
			});
                 }
         }

	// lithuania map
	if (document.getElementById("map2") != null) {
		if (GBrowserIsCompatible()) {
			var map2 = new GMap2(document.getElementById("map2"));
			var latlng2 = new GLatLng(54.677243,25.254747);
			var marker2 = new GMarker(latlng2);
			map2.setCenter(latlng2, 15);
			map2.setUIToDefault();
		     map2.addOverlay(marker2);
		     
			GEvent.addListener(marker2, "click", function() {
				marker2.openInfoWindowHtml("Office in Lithuania:<br />");
			});
                 }
         }

	// switzerland map
	if (document.getElementById("map3") != null) {
		if (GBrowserIsCompatible()) {
			var map3 = new GMap2(document.getElementById("map3"));
			var latlng3 = new GLatLng(47.383693,8.545018);
			var marker3 = new GMarker(latlng3);
			map3.setCenter(latlng3, 15);
			map3.setUIToDefault();
		     map3.addOverlay(marker3);
		     
			GEvent.addListener(marker3, "click", function() {
				marker3.openInfoWindowHtml("Office in Switzerland:<br />");
			});
                 }
         }

	// hong kong map
	if (document.getElementById("map4") != null) {
		if (GBrowserIsCompatible()) {
			var map4 = new GMap2(document.getElementById("map4"));
			var latlng4 = new GLatLng(22.285633,114.15827);
			var marker4 = new GMarker(latlng4);
			map4.setCenter(latlng4, 15);
			map4.setUIToDefault();
		     map4.addOverlay(marker4);
		     
			GEvent.addListener(marker4, "click", function() {
				marker4.openInfoWindowHtml("Office in Hong Kong:<br />");
			});
                 }
         }

	// frankfurt map
	if (document.getElementById("map5") != null) {
		if (GBrowserIsCompatible()) { 
			var map5 = new GMap2(document.getElementById("map5"));
			var latlng5 = new GLatLng(50.077656,8.625702);
			var marker5 = new GMarker(latlng5);
			map5.setCenter(latlng5, 15);
			map5.setUIToDefault();
		     map5.addOverlay(marker5);
		     
			GEvent.addListener(marker5, "click", function() {
				marker5.openInfoWindowHtml("Office in Frankfurt:<br />" +
					"<a href=\"http://www.art-businessgroup.com/frankfurt\">http://www.art-businessgroup.com/frankfurt</a>");
			});
		}
	}
});

