  // ---------------------------------- STAZIONE EDITORIALE E ARTICOLI ---------------------------------------------

  function openWin(url, name, scrollbar, w, h) {
    popupWin = window.open(url, name, 'resizable=1,scrollbars=' + scrollbar + ',width=' + w + ',height=' + h + '');
    // focus window (only for Navigator >= 3.0)
    if ( (navigator.appName != "Microsoft Internet Explorer") && (navigator.appVersion.substring(0,1) == "3") )
    popupWin.focus();
  }

  // Aggiunge la pagina ai preferiti
  function addbookmark(pagina,titolo){
    window.external.AddFavorite(pagina,titolo);
  }

  // Fa del sito la home page di default
  function principale(modulo) {
    if (isIE4){
      modulo.style.behavior='url(#default#homepage)';
      modulo.setHomePage("http://www.donnamoderna.com/");
    }
  }

  // stampa...
  function stampa() {
    self.print();
  }

  // per photogallery
  function doLoadSecNextPage(s, max) {
   // the timeout value should be the same as in the "refresh" meta-tag

    // max is the number of pages
    var tempo;
    tempo = 1000 * s;
    //setTimeout("refresh(" + max + ")", tempo);
    setTimeout("refreshNextPage(" + max + ")", tempo);
  }

  // refresh automatico per gallery
  function refreshNextPage(max) {
    var count = 0;
                                          var base = "";
                                          var temp = window.location.href;
                                          var u = temp.slice(-6,-5);
                                          var a = temp.slice(-5,-4);
                                          var d = temp.slice(-7,-6);
                                          var f = temp.slice(-2,-1);
                                          if (u != '_') {
                                                  if (d != '_')  //sono alla prima pagina
                                                  {
                                                  if (f != 'i') {
                                                  count = 2;
                                                  base = temp.slice(0,-4) + '_' + count;
                                                  }
                                  else {
                                                  count = 2;
                                  base = temp.slice(0,-16) + '_' + count;
                                                  }
                                                  }
                                                  else  {
                                                          // sono a pagina 11
                                                  u = temp.slice(-7,-6);
                                                  a = temp.slice(-6,-4)
                                                  count = (Number(a) + 1);
                                                  if (max >= count) {
                                                  base = temp.slice(0,-7) + '_' + count;
                                                  }
                                                  else {
                                                  base = temp.slice(0,-7)
                                                  }
                                                          }
                                          }
                                                  else  {
                                                  count = temp.slice(-6,-4);
                                                  count = (Number(a) + 1);
                                                  if (max >= count) {
                                                  base = temp.slice(0,-6) + '_' + count;
                                                  }
                                                  else {
                                                  base = temp.slice(0,-6)
                                                  }
                                                  }
                                          window.location.href = base + '.art';
  }

  function chiudi(){

      window.close() ;

  }

  // Javascript per la verifica di form //
  function verifica(form) {
    if (form.globale.value == "") {
      alert("scrivi una marca o un modello");
      return false;
    }
  }

  // Javascript per ora internet //
  function orainternet(BrowserTime) {
    var thisT;
    var thisM;
    var thisS;
    var iT;
    thisT = BrowserTime.getHours();
    thisM = BrowserTime.getMinutes();
    thisS = BrowserTime.getSeconds();
    iT = (thisT*3600 + thisM*60 +thisS)*10/864;
    return iT;
  }

  //--------------------------------- POP UP SITO ESTERNO -----------------------------------
  function popUpSitoEsterno(pPage) {
  var winOpts = 'directories=yes,location=yes,menubar=yes,scrollbars=yes,status=yes,toolbar=yes,resizable=yes,width=600,height=400';
  popUpWinSitiEsterni = window.open(pPage,'popWin',winOpts);
  }

  //--------------------------------- FUNZIONI DA VERIFICARE --------------------------------
  function MM_openBrWindow(theURL,winName,features) { //v2.0
    window.open(theURL,winName,features);
  }


  function getUrlPerLivello(url,livello){
    var pos = 0;
    var i;
    if (url.charAt(0)=='/') url = url.substring(1);
    var sezioni = url.split("/");
    var newurl = "";
    for (i=0; (i <= eval(livello)) && (sezioni[i]!=null) && (sezioni[i]!="index.hp"); i++){
      newurl = newurl + "/" + sezioni[i] ;
    }
    newurl = newurl + "/index.hp";
    return newurl;
  }


  function addLink(name,url,style){
    document.write("<a class=\""+style+"\" href=\""+url+"\">"+name+"</a>");
  }


  //This script detects the following:
  //Flash
  //Windows Media Player
  //Java
  //Shockwave
  //RealPlayer
  //QuickTime
  //Acrobat Reader
  //SVG Viewer
  var agt=navigator.userAgent.toLowerCase();

  var ie  = (agt.indexOf("msie") != -1);

  var ns  = (navigator.appName.indexOf("Netscape") != -1);

  var win = ((agt.indexOf("win")!=-1) || (agt.indexOf("32bit")!=-1));

  var mac = (agt.indexOf("mac")!=-1);


  if (ie && win) {
    pluginlist = detectIE("Adobe.SVGCtl","SVG Viewer") + detectIE("SWCtl.SWCtl.1","Shockwave Director") + detectIE("ShockwaveFlash.ShockwaveFlash.1","Shockwave Flash") + detectIE("rmocx.RealPlayer G2 Control.1","RealPlayer") + detectIE("QuickTimeCheckObject.QuickTimeCheck.1","QuickTime") + detectIE("MediaPlayer.MediaPlayer.1","Windows Media Player") + detectIE("PDF.PdfCtrl.5","Acrobat Reader");
  }

  if (ns || !win) {
    nse = ""; for (var i=0;i<navigator.mimeTypes.length;i++) nse += navigator.mimeTypes[i].type.toLowerCase();
    pluginlist = detectNS("image/svg-xml","SVG Viewer") + detectNS("application/x-director","Shockwave Director") + detectNS("application/x-shockwave-flash","Shockwave Flash") + detectNS("audio/x-pn-realaudio-plugin","RealPlayer") + detectNS("video/quicktime","QuickTime") + detectNS("application/x-mplayer2","Windows Media Player") + detectNS("application/pdf","Acrobat Reader");
  }

  function detectIE(ClassID,name) {
    result = false; document.write('<SCRIPT LANGUAGE=VBScript>\n on error resume next \n result = IsObject(CreateObject("' + ClassID + '"))</SCRIPT>\n'); if (result) return name+','; else return '';
  }

  function detectNS(ClassID,name) {
    n = ""; if (nse.indexOf(ClassID) != -1) if (navigator.mimeTypes[ClassID].enabledPlugin != null) n = name+","; return n;
  }

  pluginlist += navigator.javaEnabled() ? "Java," : "";
  if (pluginlist.length > 0) pluginlist = pluginlist.substring(0,pluginlist.length-1);


  function positionit(){
    //define universal reference to "staticcontent"
    var crossobj=document.all? document.all.staticcontent : document.getElementById("staticcontent")
    //define reference to the body object in IE
    var iebody=(document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body
    //define universal dsoc left point
    var dsocleft=document.all? iebody.scrollLeft : pageXOffset
    //define universal dsoc top point
    var dsoctop=document.all? iebody.scrollTop : pageYOffset
    //if the user is using IE 4+ or Firefox/ NS6+
    if (document.all||document.getElementById) {
      crossobj.style.left=783+"px"
      crossobj.style.top=dsoctop+5+"px"
    }
  }

