var state = 0;

function show(name,img){

if(state == 0){
  document.getElementById(name).style.display='block';
  document.images[img].src='ressource/design/image/moins.jpg';
}

if(state == 1){
  document.getElementById(name).style.display='none';
  document.images[img].src='ressource/design/image/plus.jpg';
}

state = ((state+1) %2);
}

function reader(file){
  document.write("<a href=\"#\" onClick=\"javascript:ouvrirFenetre('kineocam-reader.php?file="+file+"','450','650')\" class=\"demo\" ><img src=\"ressource/contenu/demo/"+file+".jpg\" width=\"180\" class=\"demo\" \></a>");
}

function downloader(file){
 document.write("");
 }

function ouvrirFenetre(file,width,height){
  window.open(file,"_blank","width="+width+",height="+height+",toolbar=no,menubar=no,location=no,scrollbars=yes,resize=no");
}

function randomCode(){
  var x = Math.round(Math.random()*1000);
  var chaine = x+"&8,";
  return hex_md5(chaine);
}

function MM_openBrWindow(videoName,width,Height)
{ //v2.0
  
	if (navigator.appVersion.indexOf("Win")!=-1) OSName="Windows";
	if (navigator.appVersion.indexOf("Mac")!=-1) OSName="MacOS";
	if (navigator.appVersion.indexOf("X11")!=-1) OSName="UNIX";
	if (navigator.appVersion.indexOf("Linux")!=-1) OSName="Linux";
  
  var windowWidth= width+30;
 	var windowHeight = Height+50;
 	
  var features = 'width='+windowWidth+',height='+windowHeight;  
 
  if(OSName!="Windows"){
  fileName = theURL.substring(0,videoName.indexOf('.'));
  fileName = 'http://perso.wanadoo.fr/kineocam/videos/'+fileName+'k.mpg';
  //alert(fileName);
  test = window.open(fileName,winName,'');
 }
 else{
 	
 	var fileName = './kineocam-wmv-reader.php?filename='+videoName+'&width='+width+'&height='+Height;
 	myVideoName = 'KineoVideo'+String(videoName).substr(0,3);
 	test = window.open(fileName,myVideoName,features);  
}
}
  


