var win = null;
function NewWindow(mypage,myname,w,h,scroll){
  LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
  TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
  settings =
  'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',status=0,toolbar=1,resizable=1'
  win = window.open(mypage,myname,settings)
}

function hideshow(obj) { 
  if (parseInt(navigator.appVersion) >= 5 || navigator.appVersion.indexOf["MSIE 5"] != -1) {
    if (obj.style.display=="none") 
      obj.style.display="";
    else
      obj.style.display="none";
  }
}

function chpage(url, tar) {
  var tmprnd = Math.round(Math.random()*1000000); 
  if (tar == "1") {
    NewWindow(url,tmprnd,'800','600','yes')
  }
  else {
    top.location.href = url;
  }
}

function cclass(divid, thecl, dl) {
  if (dl > 0) {
    setTimeout("document.getElementById('"+divid+"').className='"+thecl+"'", dl);
  }
  else {
    document.getElementById(divid).className=thecl;
  }
}

function shsubm(id, nbid) {
  var i=0;
  if (document.getElementById("sub_"+id).style.display == "") {
    var closesm = true;
  }
  while (i<nbid) {
    i++;
    document.getElementById("sub_"+i).style.display="none";
  }
  if (closesm != true) {
    document.getElementById("sub_"+id).style.display="";
  }
}

function chpics(pg) {
  jx('?c=1&p='+pg, '/photos.php', 'contenu', 0);
  return false;
}

