<!--
//--## OPEN A CENTERED POPUP ################################################################--//
//--## Code source from Dynek (www.swissgeeks.com) ##########################################--//

function new_window(mypage,myname,w,h,features)
{
  if (screen.width) {
    var winl = (screen.width-w)/3;
    var wint = (screen.height-h)/3;  
  }
  else {winl = 0;wint = 0;}
  if (winl < 0) winl = 0;
  if (wint < 0) wint = 0;
  var settings = 'height=' + h + ',';
  settings += 'width=' + w;
  //settings += 'top=' + wint + ',';
  //settings += 'left=' + winl + ',';
  if (features) settings += ',' + features;

  win = window.open(mypage,"",settings);
  win.window.focus();
}
//--## FIN - OPEN A CENTERED POPUP ##########################################################--//

function showDetails(i, href)
{
  var titleObj = (document.getElementById) ? document.getElementById('ihtr' + i) : eval("document.all['ihtr" + i + "']");
  var frameObj = (document.getElementById) ? document.getElementById('ihif' + i) : eval("document.all['ihif" + i + "']");
  var imgArrow = (document.getElementById) ? document.getElementById('img' + i) : eval("document.all['img" + i + "']");
  if (titleObj != null) {
    if (titleObj.style.display=="none") {
      titleObj.style.display="";
      imgArrow.src = "images/panel_arrow_down.png";
      imgArrow.alt = "Cliquez pour masquer les détails";
    }
    else {
      titleObj.style.display="none";
      imgArrow.src = "images/panel_arrow_right.png";
      imgArrow.alt = "Cliquez pour afficher les détails";      
    }
  }
}

  //http://isohunt.com Interface Javascript
  //by Gary Fung - email: gary{REPLACE_WITH_THE_AT_SIGN}isohunt.com
  var smooth_timer;
  function smoothHeight(id, curH, targetH, stepH, mode) {
    diff = targetH - curH;
    if (diff != 0) {
      newH = (diff > 0) ? curH + stepH : curH - stepH;
      ((document.getElementById) ? document.getElementById(id) : eval("document.all['" + id + "']")).style.height = newH + "px";
      if (smooth_timer) window.clearTimeout(smooth_timer);
      smooth_timer = window.setTimeout( "smoothHeight('" + id + "'," + newH + "," + targetH + "," + stepH + ",'" + mode + "')", 20 );
    }
    else if (mode != "o") ((document.getElementById) ? document.getElementById(mode) : eval("document.all['" + mode + "']")).style.display="none";
  }
  function servOC(i, href, nColor) {
    nColor = "";
    var trObj = (document.getElementById) ? document.getElementById('ihtr' + i) : eval("document.all['ihtr" + i + "']");
    var nameObj = (document.getElementById) ? document.getElementById('name' + i) : eval("document.all['name" + i + "']");
    var ifObj = (document.getElementById) ? document.getElementById('ihif' + i) : eval("document.all['ihif" + i + "']");
    if (trObj != null) {
      if (trObj.style.display=="none") {
        trObj.style.display="";
//        nameObj.style.background=nColor;
        if (!ifObj.src) ifObj.src = href;
        smoothHeight('ihif' + i, 0, 210, 15, 'o');
      }
      else {
//        nameObj.style.background=""; //nColor
        smoothHeight('ihif' + i, 210, 0, 15, 'ihtr' + i);
      }
    }
  }

//--## SHOW PREVIEW IMAGE ###################################################################--//
//--## Author: Glorfindel ###################################################################--//
function showPreview(imageCat, imageFile, relPathToTemplates)
{
  if ( imageCat != "crt" && imageCat != "lieu" ) {
    alert ("Erreur, aucun catégorie");
  }
  else {
    //if (imageCat == "crt")  var imagePath = '<? echo "../".$img_cat_array[$img_cat_nb['crt']]['image_dir']; ?>';
    if (imageCat == "crt") var imagePath = 'images/concerts/';
    //if (imageCat == "lieu") var imagePath = '<? echo "../".$img_cat_array[$img_cat_nb['lieu']]['image_dir']; ?>';
    if (imageCat == "lieu") var imagePath = 'images/lieux/';    
  }
  var imageFullRel = imagePath + imageFile;
  var imageFull = "../" + imageFullRel;
  var image = new Image();
  image.src = imageFullRel;
  var height = image.height;
  var width = image.width;
  imageScriptPath = relPathToTemplates + "templates/image.php?img=" + imageFull + "&alt=" + imageFile;

  new_window(imageScriptPath,'Fêtes Musicales de Savoie',width,height,'');
}
//--## FIN - SHOW PREVIEW IMAGE ##############################################################-//        
  
  
-->
