var bo_ns_id = 0;

function startIeFix(){if(isIE()){document.write('<div id="bo_ns_id_' + bo_ns_id + '"><!-- ');}}

function endIeFix(){
  if(isIE()){
    document.write('</div>');
    var theObject = document.getElementById("bo_ns_id_" + bo_ns_id++);
    var theCode = theObject.innerHTML;
    theCode = theCode.substring(4 ,9+theCode.indexOf("</object>"))
    document.write(theCode);
  }
}

function isIE(){
  // only for Win IE 6+
  // But not in Windows 98, Me, NT 4.0, 2000
  var strBrwsr= navigator.userAgent.toLowerCase();
  if(strBrwsr.indexOf("msie") > -1 && strBrwsr.indexOf("mac") < 0){
    if(parseInt(strBrwsr.charAt(strBrwsr.indexOf("msie")+5)) < 6){
      return false;
    }
    if(strBrwsr.indexOf("win98") > -1 ||
       strBrwsr.indexOf("win 9x 4.90") > -1 ||
       strBrwsr.indexOf("winnt4.0") > -1 ||
       strBrwsr.indexOf("windows nt 5.0") > -1)
    {
      return false;
    }
    return true;
  }else{
    return false;
  }
}

function bookmarks() {
 titolo = "RomaTiburtina.it - il portale del V Municipio di Roma";
  //  Blogger - Replace with <$BlogItemTitle$>
  // MovableType - Replace with <$MTEntryTitle$>
  url = "http://www.romatiburtina.it";
  // Blogger - Replace with <$BlogItemPermalinkURL$>
  // MovableType - Replace with <$MTEntryPermalink$>
  //  WordPress - <?php bloginfo('url'); ?>
    if (window.sidebar) { //  Mozilla Firefox Bookmark
        window.sidebar.addPanel(titolo, url, "");
    } else if( window.external ) { // IE Favorite
        window.external.AddFavorite(url, titolo);
	} else if(window.opera){ //Opera
		alert("Attenzione: il tuo browser non supporta questo script. Per aggiungere RomaTiburtina.it ai tuoi preferiti premi 'Ctrl+D'")
	   	var a = document.createElement("A");
     	a.rel = "sidebar";
    	a.target = "_search";
    	a.title = titolo;
    	a.href = url;
    	a.click();
 	} else {alert("Attenzione: il tuo browser non supporta questo script. Per aggiungere RomaTiburtina.it ai tuoi preferiti premi 'Ctrl+D' o 'Mela+D' (Mac).")}
}

function homepage() {
if (window.sidebar) {
	alert("Siamo spiacenti, ma il tuo browser non supporta questa funzione. Imposta manualmente RomaTiburtina.it come home page del tuo browser. Clicca su 'strumenti' poi su 'opzioni' e riporta la URL di Roma Tiburtina: http://www.romatiburtina.it.")
}
else if(window.external) {
document.body.style.behavior='url(#default#homepage)';
document.body.setHomePage('http://www.romatiburtina.it');
}
}
