
/*
ENTRA.JS V1.04 (6.9.2009)

1.04 ele_show _hide
     servicebox (6.9.2009)

1.03 usa innerHTML se possibile (3.1.2008)

1.02 abolita visibility che da errori su IE grave e su FF (28.1.2007)

1.01 se testo nullo scompare tmessage (18.11.2006)

1.00 (9.3.2006)

FUNCTIONS

ele(id)
ele_show(id)
ele_hide(id)

tmessage(testo)
tmessagecheck(prompt) trasparente al valore del prompt, se ho annullato fa scomparire tmessage

service_display(id)
*/



/* COMMON */

function ele(id) {
  if (document.getElementById(id)) return document.getElementById(id);
  else return false;
}

function ele_show(id) {

 if (temp = ele(id))
  if (temp.style)
   if (temp.style.display)
    if (temp.style.display = 'block')
     return temp;

 return false;

}

function ele_hide(id) {

 if (temp = ele(id))
  if (temp.style)
   if (temp.style.display)
    if (temp.style.display = 'none')
     return temp;

 return false;

}




/* TMESSAGE */

function tmessage(testo) {

  if(document.getElementById('tmessagew').innerHTML) {
    document.getElementById('tmessagew').innerHTML = '<img src=\"../images/ico/ico_loading.gif\" align=absmiddle> ' + testo;
  } else if (document.getElementById('tmessage_testo')) {
    document.getElementById('tmessage_testo').value = testo;
  }

  if (document.getElementById('tmessagew')) {
    if (testo.length > 0) {
      //if (document.getElementById('tmessagew').style.display)
      document.getElementById('tmessagew').style.display = 'block';
    } else {
      document.getElementById('tmessagew').style.display = 'none';
    }
  }

}


function tmessagecheck(promptresult) {
  if (promptresult == 0) tmessage('');
  return promptresult;
}




/* SERVICEBOX */

function service_display(id) {
  if (id == '') return ele_hide('service_container');
  ele_show('service_container');
  ele_hide('service_iframe');
  ele_hide('service_div');
  return ele_show('service_' + id);
}