function xView(url,xName,xW,xH)
{
  var  xViewW = window.open(url,xName,'width='+xW+',height='+xH+',top=100,left=100,scrollbars=yes,resizable=yes');
  if (xViewW.opener == null)
 {
     xViewW.opener = self; 
 }
  xViewW.focus (); 
}

function xView1(url,xName,xW,xH)
{
  var  xViewW = window.open(url,xName,'width='+xW+',height='+xH+',top=100,left=150,scrollbars=no,resizable=no,location=no');
  if (xViewW.opener == null)
 {
     xViewW.opener = self; 
 }
  xViewW.focus (); 
}

function Visibile(layer) {

  var map = getThisMap();    
  var maplayer=map.getMapLayer("1860");
  maplayer.setVisibility(false)
  var maplayer=map.getMapLayer("1882");
  maplayer.setVisibility(false)
  var maplayer=map.getMapLayer("1891");
  maplayer.setVisibility(false)  
  var maplayer=map.getMapLayer(layer);
  maplayer.setVisibility(true)  
  map.refresh();

}

function stampa() {

    var map = getThisMap();    
    var pgSetup = map.getPageSetup();
    pgSetup.setInclude("mg_legend", false);
    pgSetup.setInclude("mg_scalebar", true);
    pgSetup.setInclude("mg_northarrow", false);
    pgSetup.setInclude("mg_url", false);
    pgSetup.setInclude("mg_timestamp", true);
    myscale = map.getScale();
    pgSetup.setPlotScale(myscale);
    pgSetup.setUsePlotScale(true);
    var titolo = "\n\nFacoltą di Scienze Politiche\nEstratto di mappa"; 
    pgSetup.setTitle(titolo);
    var attr = pgSetup.getTitleTextAttr(); 
        attr.setFontName("Arial"); 
        attr.setFontStyle("Bold"); 
        attr.setHeight(14.0, ""); 
        attr.setHorizAlign(1);

    map.pageSetupDlg();
    map.printDlg();

}


function getThisMap() 
{
 if (navigator.appName == "Netscape") {
    return parent.mappa.document.MyMap;
 }
 else {
    return parent.mappa.MyMap;
 }
}

function ChangeCursor(cellID,status) 
{
  if (document.all) {  
     if (status == 'On') {
        document.all(cellID).style.cursor = 'Hand';
     }
     if (status == 'Off') {
        document.all(cellID).style.cursor = 'Move';
     }
  } 
}



function ZoomToScale(scale) 
{
   var map = getThisMap();
   var corX=map.getLon();
   var corY=map.getLat();
   corX = parseInt(corX);
   corY = parseInt(corY);
   map.zoomScale(corY, corX, scale);
   map.refresh();
}


function zoom()
{

   var map = getThisMap();
   myscale = map.getScale();
   NewUrl = "zoom.htm?scala=" + myscale;
   var xViewW = window.open(NewUrl,'Zoom','height=120,width=230,top=200,left=200,scrollbars=no,status=no,toolbar=no,menubar=no,location=no');
   xViewW.focus ();
}

