//////////////////////////////////////////////////////////
//
// Copyright ©2006 Franck Priola
//
// -------------------------------------------------------
// Projet   : quizzyflash.net
// Source   : /js/functions.js
// Création : 29/12/2006
// Auteurs  : Franck Priola
// -------------------------------------------------------
//
// FONCTIONS "MAISON"
//
//////////////////////////////////////////////////////////



function getValueElement( elem )
{
  if( document.getElementById ) {
    if( document.getElementById(elem) != null ) return document.getElementById(elem).value;
  } else if( document.all ) {
    if( document.all[elem] != null ) return document.all[elem].value;
  }
  return null;
}

function setValueElement( elem, val )
{
  if( document.getElementById ) {
    if( document.getElementById(elem) != null ) document.getElementById(elem).value = val;
  } else if( document.all ) {
    if( document.all[elem] != null ) document.all[elem].value = val;
  }
}

function disableElement( elem )
{
  if( document.getElementById ) {
    if( document.getElementById(elem) != null ) document.getElementById(elem).disabled = true;
  } else if( document.all ) {
    if( document.all[elem] != null ) document.all[elem].disabled = true;
  }
}

var state = 'none';

function showhide( layer_ref )
{
  if( state == 'block' ) {
    state = 'none';
  } else {
    state = 'block';
  }

  if( document.all ) { //IS IE 4 or 5 (or 6 beta)
    eval( "document.all." + layer_ref + ".style.display = state");
  }
  if( document.layers ) { //IS NETSCAPE 4 or below
    document.layers[layer_ref].display = state;
  }

  if( document.getElementById && !document.all ) {
    hza = document.getElementById( layer_ref );
    hza.style.display = state;
  }
}
