
		var curwin;
		var mapcenter   = new VELatLong(36.7830, 14.5545);
		var mapzoom     = 14;
		var map;

		var fl2d  = null;
			
		var curshape    = null;
		var curtimer    = null;
		var curcat	= -1;
		var animStep	= 0;

		var icon1 ="<div style='width:26px;height:26px;'><div style='margin:9px;background:red;   width:8px;height:8px;'></div></div>";
		var icon2 ="<div style='width:26px;height:26px;'><div style='margin:9px;background:black; width:8px;height:8px;'></div></div>";
		var icon3 ="<div style='width:26px;height:26px;'><div style='margin:9px;background:blue;  width:8px;height:8px;'></div></div>";
		
		function CreateBookmarkLink()
		{
			var title = "Marina di Ragusa";
			var url = "http://www.marinadiragusa.info";
	
			if (window.sidebar)
			{ // Mozilla Firefox Bookmark
				window.sidebar.addPanel(title, url,"");
			}
			else if(window.external)
			{ // IE Favorite
				window.external.AddFavorite( url, title);
			}
			else if(window.opera && window.print)
			{ // Opera Hotlist
				return true;
			}
		}


		function dummy( j )
      		{
      		}

		function openmapinfo()
      		{
			if ( curwin != null ) 
				curwin.close();

			curwin = dhtmlwindow.open('divbox', 'div', 'mapinfodiv', 'Marina di Ragusa', 'width=450px,height=350px,left=200px,top=150px,resize=1,scrolling=1', 'recal');
      		}

      		function GetRMap()
      		{
         		map = new VEMap( 'myMap' );
			map.HideDashboard();

			map.onLoadMap = onLoadMap;
         		map.LoadMap( mapcenter, mapzoom ,'r' , false );
	     	}   

      		function onLoadMap()
      		{
	 		map.SetScaleBarDistanceUnit( VEDistanceUnit.Kilometers );
	        	map.SetShapesAccuracy( VEShapeAccuracy.None );

	     			   
	        	fl2d = new VEShapeLayer();
	        	var ls2d = new VEShapeSourceSpecification( VEDataType.GeoRSS, 'http://www.marinadiragusa.info/reqfeed.aspx?l=' + FLANG + '&f=' + FNAME, fl2d );
			
	        	map.ImportShapeLayerData( ls2d, onFeedLoad2d, false );
			map.AttachEvent( 'onchangeview', mapchangeview );

      		}

	    	function onFeedLoad2d( layer )
	    	{
	        	var numShapes = fl2d.GetShapeCount();
			var txt;
			var p;
	
	        	for( var i=0; i < numShapes; ++i )
	        	{
	            		var s = fl2d.GetShapeByIndex(i);
				txt = "<br>" + s.GetDescription();
				s.SetDescription( txt );


				if ( i == 0 )
				{
					s.SetCustomIcon( icon3 );
					p = s.GetPoints();
					map.SetCenter( p[0] );
					
				}
				else
				{
					s.SetCustomIcon( icon1 ); 
					s.Hide();
				}
	       	 	}

	    	}

      		function mapchangeview( e )
		{	
			if ( e.mapStyle == 'r' )
            		{
				if ( curshape == null )
					return;

				setTimeout( "animShape()", 500 );
				return;
			}
 
			
			if ( !map.IsBirdseyeAvailable())
            		{
				document.getElementById( 'myMap' ).style.display = 'none';
				setTimeout("rotate()", 500);
             		}
			else
           		{
				document.getElementById( 'myMap' ).style.display = 'block';
             		}
		
		}

      		function ResetMap()
      		{
			document.getElementById("sBack").style.visibility = "hidden";
			document.getElementById("sRotate").style.visibility = "hidden";
			
         		map.SetMapStyle( VEMapStyle.Road );
			map.SetCenterAndZoom( mapcenter, mapzoom ); 	       
	     	}   	         

		function closecat( i )
      		{
			var obj;
			var obj2;

			obj = document.getElementById( 'cat' + i );
			obj.style.display = 'none';

			for ( i = 0; i < obj.childNodes.length; i++ ) 
			{
				var j = 0;
				var p;
					
				j = parseInt( obj.childNodes[i].childNodes[0].attributes["pos"].value );					
				p = fl2d.GetShapeByIndex( j );
				p.Hide();
			}

		}

		function showcat( i )
      		{
			if ( ( curcat != -1 ) && 
			     ( curcat != i ) )
			{
				closecat( curcat );
			}
			
			var obj2;
			var obj;
			
			obj = document.getElementById( 'cat' + i );

			if ( obj.style.display == 'none' )
			{
				obj.style.display = 'block';
				curcat = i;
			}
			else
			{
				obj.style.display = 'none';
				curcat = -1;
			}
			

			for ( i = 0; i < obj.childNodes.length; i++ ) 
			{
				var j = 0;
				var p;
					
				j = parseInt( obj.childNodes[i].childNodes[0].attributes["pos"].value );					
				p = fl2d.GetShapeByIndex( j );

 				if ( curcat == -1 )
				{
					p.Hide();
				}
				else
				{
					p.Show();
				}
			}

		}

      		function show( i )
      		{	
			if ( curshape )
      			{
				clearTimeout( curtimer );
				curshape.SetCustomIcon( icon1 );
	     		}

			if ( map.GetMapStyle() != VEMapStyle.Road )
      			{
				document.getElementById("sBack").style.visibility = "hidden";
				document.getElementById("sRotate").style.visibility = "hidden";

         			map.SetMapStyle( VEMapStyle.Road );
	     		}   	         

	            	curshape = fl2d.GetShapeByIndex( i );
	            	var p = curshape.GetPoints();

			map.DeleteRoute();			
			map.HideInfoBox();
			map.SetCenter( p[0] );
      		}


      		function animShape()
      		{
			if ( animStep % 2 == 0 )
      			{
				curshape.SetCustomIcon( icon1 );				
      			}
			else
      			{
				curshape.SetCustomIcon( icon2 );
      			}

			if ( ++animStep == 7 )
      			{
				map.ShowInfoBox( curshape );
				curshape = null;
				animStep = 0;
      			}
			else
      			{
				curtimer = setTimeout( "animShape()", 500 );
      			}	
      		}

      		function zoomin()
      		{
			map.ZoomIn();
      		}

      		function zoomout()
      		{
			map.ZoomOut();
      		}
