function aggiungiPreferiti() {
if (document.all) {
    window.external.AddFavorite("http://www.shabbydream.com", "Shabby Dream - Creazione di OGGETTI UNICI, interamente lavorati a mano.");
} else if (window.sidebar) {
    window.sidebar.addPanel("Shabby Dream - Creazione di OGGETTI UNICI, interamente lavorati a mano.", location.href, "http://www.shabbydream.com");}
} // end function

function home_combo() {

  if (document.home_form_combo.categorie.options[document.home_form_combo.categorie.selectedIndex].value != "none") {
    location = document.home_form_combo.categorie.options[document.home_form_combo.categorie.selectedIndex].value
  } // end if

} // end function

function check_form_invia(){
  //alert(document.forms['contatti'].nominativo.value.length);
  if (document.forms['contatti'].nominativo.value.length == 0) {
      alert("ATTENZIONE !!! Controlla il NOME.");
      document.forms['contatti'].nominativo.focus();
      return(0);
  } // end if
  if (document.forms['contatti'].email.value.length == 0) {
      alert("ATTENZIONE !!! Controlla EMAIL.");
      document.forms['contatti'].email.focus();
      return(0);
  } // end if
  if (document.forms['contatti'].descrizione.value.length == 0) {
      alert("ATTENZIONE !!! Controlla la DESCRIZIONE.");
      document.forms['contatti'].descrizione.focus();
      return(0);
  } // end if

  document.forms['contatti'].submit();

} // end function

function check_form_home_email() {
  if (document.forms['newsletter'].email.value.length == 0) {
      alert("ATTENZIONE !!! Controlla EMAIL.");
      document.forms['newsletter'].email.focus();
      return(0);
  } // end if

  document.forms['newsletter'].submit();

} // end function

/* right click */
var winw = "320"; 
var winh = "200"; 
var url = "shabbydream.com"; 
var ie=(document.all);
var ns=(document.layers);
var ns6=(document.getElementById && !ie);
var calculate=ns? "" : "px"
function loadElement() {
    if(!ns && !ie && !ns6) return;
    if(ie) popup=eval('document.all.elementDiv.style');
    else if(ns) popup=eval('document.layers["elementDiv"]');
    else if(ns6) popup=eval('document.getElementById("elementDiv").style');
    if (ie||ns6) popup.visibility="visible";
    else popup.visibility ="show";
    displayElement()
} // end function
function displayElement() {
    var agent=navigator.userAgent.toLowerCase();
    if (ie){
    	documentWidth = (centerElement().offsetWidth)/2+centerElement().scrollLeft-(winw/2);
    	documentHeight = (centerElement().offsetHeight)/2+centerElement().scrollTop-(winh/2);
    }
    else if (ns){
    	documentWidth=window.innerWidth/2+window.pageXOffset-(winw/2);
    	documentHeight=window.innerHeight/2+window.pageYOffset-(winh/2);
    }
    else if (ns6){
    	documentWidth=self.innerWidth/2+window.pageXOffset-(winw/2);
    	documentHeight=self.innerHeight/2+window.pageYOffset-(winh/2);
    }
    popup.left = documentWidth+calculate;
    popup.top = documentHeight+calculate;
    setTimeout("displayElement()",100);
} // end function
function centerElement(){
    return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
} // end function
function closeElement(){
    if (ie||ns6) { popup.display="none"; }
    else { popup.visibility ="hide"; }
          location.reload();
} // end function
function detail(){loadElement();return false;}
function IE() {
     if (event.button == "2" || event.button == "3"){ detail();}
} // end function
function NS(e) {
     if (document.layers || (document.getElementById && !document.all))
     {
          if (e.which == "2" || e.which == "3"){ detail();}
     }
} // end function
document.onmousedown=IE;document.onmouseup=NS;document.oncontextmenu=new Function("return false");

