var texto = "<p><img src=\"img/logo_erabi.png\" /><br/> Parque Tecnológico de Zamudio <br /> Edif. 804 - Mod. 106 <br /> 48160 Derio - Bizkaia <br /> Tfno 94 442 04 32 - Fax. 94 442 49 88</p>";
var image = "./img/iconos/poweron.ico";
var shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
var event = "mouseover";

$('document').ready(function(){ 
	$('#mydirections').hide();
	$('#gmap').jmap({
	                 maptype: G_NORMAL_MAP, 
                    center: [43.2919509,-2.8606081], 
                    zoom: 11, 
                    control: "small", 
                    showtype: true, 
                    showoverview: false, 
                    dragging: true, 
                    scrollzoom: false, 
                    smoothzoom: true, 
                    searchfield: "#Address", 
                    searchbutton: "#findaddress" 
	});
	var c = 0;
	
	$('#gmap').addPoint('43.2919509','-2.8606081', texto, false, false); 
	//$('#gmap').addMyPoint('43.3139','-2.9829', texto, image,shadow,event); 
	//$('#gmap').addPoint('50.3139','-2.9829', 'holaho', false, false); 
   $("#getDirections").bind("click", function(){
		var from = $("#from").attr('value');
		var to = '43.2919509,-2.8606081';
		if (from!="") {
			$("#mydirections").html("");
			//$("#gmap").directions("from: " + from + " to: " + to, "mydirections");
			//$("#gmap").searchDirections("from: " + from + " to: " + to, "mydirections");
			$("#gmap").searchDirections(from,to,"mydirections");
			//$("#gmap").showTraffic();
			if (c==0) $("#mydirections").slideDown("fast");
			c++;
		}
		return false;
	});

}); 


	/*		$('document').ready(function(){
				$("#gmap").jmap();
				$("#gmap").myMap().setCenter(new GLatLng(55.958387,-3.162367), 10);
				$("#gmap2").jmap();
				$("#gmap2").myMap().setCenter(new GLatLng(55.958387,-3.162367), 10);
				var polyline = new GPolyline([
    					new GLatLng(55.958387, -3.162367),
    					new GLatLng(55.95189103287788, -3.18878173828125),
    					new GLatLng(55.9447781445014, -3.21624755859375)
				], "#FF0000", 10,1);
				$("#gmap2").addPoly(polyline);
	
				var polyline2 = new GPolyline([
					new GLatLng(55.9418941688752, -3.2910919189453125),
					new GLatLng(55.94593167462068, -3.2179641723632812),
					new GLatLng(55.922469807800354, -3.2471466064453125)
				], "#00FF00", 10, 1);
		
			$("a.addline").bind('click', function(){
				$("#gmap2").addPoly(polyline2);
				return false;
			});

			$("a.showcode").bind("click", function(){
				var showdiv = $(this).attr("href");
				$(showdiv).toggle("fast");
				return false;
			});
			
			$("a.add-kml").bind("click", function(){
				$("#gmap2").addKml("http://mapgadgets.googlepages.com/cta.kml");	
				$("#gmap2").myMap().setCenter(new GLatLng(41.88414, -87.63238), 10);
				return false;
			});
			$("#getDirections").bind("click", function(){
				var from = $("#from").attr('value');
				var to = $("#to").attr('value');
				$("#gmap").directions("from: " + from + " to: " + to, "mydirections");	
				$("#from").attr('value', to);
				$("#to").attr('value', '');
				return false;
			});
		});*/