/*
 * Fonctions utiles en javascript
 * Cree par Joel Gaujard le 20/02/2007
*/
var tmp = 'defaultDiv';
var tmp_introduction='introduction_div';
var temp_base_id='';
function toggle_wine(showId, elt)
{
  Element.toggle(tmp);
  Effect.BlindDown(showId);
  tmp = showId;

  if ($(elt) != 'cabernet_link')   $('cabernet_link').className = "disabled";
  if ($(elt) != 'cinsault_link')   $('cinsault_link').className = "disabled";
  if ($(elt) != 'merlot_link')     $('merlot_link').className = "disabled";
  if ($(elt) != 'sauvignon_link')  $('sauvignon_link').className = "disabled";
  if ($(elt) != 'grenache_link')  $('grenache_link').className = "disabled";
  $(elt).className = "active";
}

function toggle_bib(showId, elt,base_id)
{/*
  if(temp_base_id!=""){
    temp_base_id=base_id;
  }else{
    
  }*/
  Element.toggle(tmp);
  $(showId).style.display="block";
  Effect.BlindDown(showId);
  tmp = showId;
/*  if(){}*/
  if (elt != 'cabernet_link')
  {
    $('cabernet_link').style.background="url(/images/bib_cabernet3.jpg) no-repeat 0px -511px";
  }else{
    $('cabernet_link').style.background="url(/images/bib_cabernet2.jpg) no-repeat 0px -251px";
  }
  if (elt != 'cinsault_link')
  {
    $('cinsault_link').style.background="url(/images/bib_cinsault2.jpg) no-repeat 0px -502px";
  }else{
    $('cinsault_link').style.background="url(/images/bib_cinsault2.jpg) no-repeat 0px -251px";
  }
  if (elt != 'merlot_link')
  {
    $('merlot_link').style.background="url(/images/bib_merlot3.jpg) no-repeat 0px -502px";
  }else{
    $('merlot_link').style.background="url(/images/bib_merlot3.jpg) no-repeat 0px -251px";
  }
  if (elt != 'sauvignon_link')
  {
	$('sauvignon_link').style.background="url(/images/bib_sauvignon.jpg) no-repeat 0px -502px";
  }else{
    $('sauvignon_link').style.background="url(/images/bib_sauvignon.jpg) no-repeat 0px -251px";
  }
  if (elt != 'grenache_link')
  {
	$('grenache_link').style.background="url(/images/bib_grenache.jpg) no-repeat 0px -502px";
  }else{
    $('grenache_link').style.background="url(/images/bib_grenache.jpg) no-repeat 0px -251px";
  }
}

function toggle_bib_2(showId, elt,base_id)
{
  //right_panel
  if(temp_base_id!=""){
    $("right_panel").removeChild($(temp_base_id+"DivDisplay"));
    temp_base_id=base_id;
  }else{
    Element.toggle(tmp_introduction);
    temp_base_id=base_id;
  }
  var DisplayNode=$(temp_base_id+"Div").cloneNode(1);
  $("right_panel").appendChild(DisplayNode);
  DisplayNode.id=temp_base_id+"DivDisplay";
  tmp = showId;
  
  if (elt != 'cabernet_link')
  {
    $('cabernet_link').style.background="url(/images/bib_cabernet2.jpg) no-repeat 0px -532px";
  }else{
    $('cabernet_link').style.background="url(/images/bib_cabernet2.jpg) no-repeat 0px -267px";
  }
  if (elt != 'cinsault_link')
  {
    $('cinsault_link').style.background="url(/images/bib_cinsault2.jpg) no-repeat 0px -502px";
  }else{
    $('cinsault_link').style.background="url(/images/bib_cinsault2.jpg) no-repeat 0px -251px";
  }
  if (elt != 'merlot_link')
  {
    $('merlot_link').style.background="url(/images/bib_merlot2.jpg) no-repeat 0px -502px";
  }else{
    $('merlot_link').style.background="url(/images/bib_merlot2.jpg) no-repeat 0px -251px";
  }
  if (elt != 'sauvignon_link')
  {
	$('sauvignon_link').style.background="url(/images/bib_sauvignon.jpg) no-repeat 0px -500px";
  }else{
    $('sauvignon_link').style.background="url(/images/bib_sauvignon.jpg) no-repeat 0px 0px";
  }
  if (elt != 'grenache_link')
  {
	$('grenache_link').style.background="url(/images/bib_grenache.jpg) no-repeat 0px -502px";
  }else{
    $('grenache_link').style.background="url(/images/bib_grenache.jpg) no-repeat 0px 0px";
  }
}

