/*
 * DIGITAL TREND CREATIVE
 * 
 * Produit par : Ludovic LANDIER
 * Contact     : landier@dtcreative.net
 * 
 */
var loopme=0;

function mclassid(EID,newClass)
{
  var num=1;
  while(document.getElementById(EID+'_'+num))
  {
    document.getElementById(EID+'_'+num).className=newClass;
    num++;
  }
}


function classid(EID,newClass)
{
  if(document.getElementById(EID))
  {
    document.getElementById(EID).className=newClass;
  }
}

function hiddenmail(EID,ADDR)
{
  if(document.getElementById(EID))
  {
    ADDR=ADDR.replace(/\+/,'@');
    ADDR=ADDR.replace(/!/,'.');
    if(document.all)
    {
      document.all[EID].innerHTML='<a href="mailto:'+ADDR+'">'+ADDR+'</a>';
    }
    else
    {
      document.getElementById(EID).innerHTML='<a href="mailto:'+ADDR+'">'+ADDR+'</a>';
    }
  }
}

function enlarge(IMG,WIDTH,HEIGHT)
{
  
  var overlayer='';
  var showsheet='';
  var ssPos='';
  var IMGSIZE_W=WIDTH+10;
  var IMGSIZE_H=HEIGHT+27;
  
  if(document.all)
  {
    if(document.all['overlay'])
    {
      overlayer=document.all['overlay'];
      overlayer.style.display='block';
      overlayer.style.height='100%';
      overlayer.style.width='100%';
      overlayer.style.background='url(img_ovl_bg.gif)';
      overlayer.innerHTML='<div id="show" onclick="javascript:document.getElementById(\'overlay\').style.display=\'none\';">'+CLOSE_IMG+'<div style="width:'+WIDTH+'px;height:'+HEIGHT+'px;background:url(\''+IMG+'\');"></div></div>';
      
      ssPos=midscreen(IMGSIZE_W,IMGSIZE_H);
      showsheet=document.all['show'];
      showsheet.style.width=WIDTH+'px';
      showsheet.style.height=HEIGHT+'px';
      showsheet.style.top=ssPos['Y']+'px';
      showsheet.style.left=ssPos['X']+'px';
    }
  }
  else if (document.getElementById)
  {
    if(document.getElementById('overlay'))
    {
      overlayer=document.getElementById('overlay');
      overlayer.style.display='block';
      overlayer.style.height='100%';
      overlayer.style.width='100%';
      overlayer.style.background='url(img_ovl_bg.gif)';
      overlayer.innerHTML='<div id="show" onclick="javascript:document.getElementById(\'overlay\').style.display=\'none\';">'+CLOSE_IMG+'<div style="width:'+WIDTH+'px;height:'+HEIGHT+'px;background:url(\''+IMG+'\');"></div></div>';
      
      ssPos=midscreen(IMGSIZE_W,IMGSIZE_H);
      showsheet=document.getElementById('show');
      showsheet.style.width=WIDTH+'px';
      showsheet.style.height=HEIGHT+'px';
      showsheet.style.top=ssPos['Y']+'px';
      showsheet.style.left=ssPos['X']+'px';
    }
  }
}


function midscreen(objw,objh)
{
  var midscr=new Array();
  if( typeof( window.innerWidth ) == 'number' )
  {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  }
  else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
  {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  }
  else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
  {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  
  midscr['X']=Math.round((myWidth-objw)/2);
  midscr['Y']=Math.round((myHeight-objh)/2);

  return midscr;
}