
function preload() {
  if (!document.images) return;
  var wl = new Array();
  var arguments = preload.arguments;
  for (var i = 0; i < arguments.length; i++) {
    wl[i] = new Image();
    wl[i].src = arguments[i];
  }
}
/*
preload('Image/global/preload.gif',
        'Image/offerte/offerta_01.jpg',
        'Image/offerte/offerta_02.jpg',
        'Image/offerte/offerta_03.jpg',
        'Image/offerte/offerta_04.jpg');
*/
function OpenContent(pagina){

  var win = new Window({className: "alphacube",
                        zIndex: 161,
                        width:400,
                        height:400,
                        showEffectOptions: {duration:0.5},
                        destroyOnClose: true
                       })
  win.setURL(pagina);
  win.showCenter(true);
}


function OpenImage(pagina){
  
  var win = new Window({className: "alphacube",
                        zIndex: 161,
                        width:400,
                        height:400,
                        showEffectOptions: {duration:0.5},
                        destroyOnClose: true
                       })
  var img = "<img src='"+pagina+"' alt='' title='' />";
  win.setHTMLContent(img);
  win.showCenter(true);               
}


window.onload=function(){
   

}


function search_focus_value(){
  if(document.getElementById("search").value == 'Cerca un prodotto...'){
    document.getElementById("search").value = '';
  }
}
function search_blur_value(){
  if(document.getElementById("search").value == ''){
    document.getElementById("search").value = 'Cerca un prodotto...';
  }
}


function compose_city(url,id,id2){
  // This is too bad, there's better!
  var pagina = url+"&id_stato="+id;
  new Ajax.Request(pagina, {
    onSuccess:function(){
     // $(id2).innerHTML = "loading... <img src='Image/global/preload.gif' />";
     $("load_"+id2).style.display = "block";
    },
    onComplete: function(transport) {
      if (200 == transport.status)
        $("load_"+id2).style.display = "none";
        $(id2).innerHTML = transport.responseText;
    }
  });
}

function popUp2(pag,nome,ll,hh) {
  window.open(pag,nome,"width="+ll+"px,height="+hh+"px,scrollbars=yes");
}

