<script type="text/javascript" language="javascript">

var nameArray=new Array();
var pathArray=new Array();
var sizeArray=new Array();
var md5Array=new Array();
var downloadsArray=new Array();

function detailsswitch(off,prod,rep,version,lang){
//      lang=$("input[name=language]:checked").val();
      if (($("#details-"+prod+"-"+rep+"-"+version).text() == "Più dettagli...") && (!off)) {
//      alert(prod+"-"+rep+"-"+version);
         $("#details-data-"+prod+"-"+rep+"-"+version).text("");
         if (rep == "snapshot") { 
            $("#details-data-"+prod+"-"+rep+"-"+version).load("/pub/openmamba/devel/media/"+prod+"/"+lang+"/buildinfo.inc.html");
	 } else {
            $("#details-data-"+prod+"-"+rep+"-"+version).load("/pub/openmamba/"+rep+"/media/"+prod+"/"+lang+"/buildinfo.inc.html");
         }	 
         $("#details-"+prod+"-"+rep+"-"+version).text("Meno dettagli");
      } else {
         $("#details-data-"+prod+"-"+rep+"-"+version).text("");
         $("#details-"+prod+"-"+rep+"-"+version).text("Più dettagli...");
      }
};

function selectlang(plat,lang) {
   plat=plat+'-';
   var i = 0;
   var i2 = 0;
   var section = "";
   while (i >= 0 ) {
      i=plat.indexOf("-",i+1);
      i2=plat.indexOf("-",i+1);
      i3=plat.indexOf("-",i2+1);
      if (i >= 0 && i2 >= 0 && i3 >= 0) {
         prod=plat.substr(0,i);
         rep=plat.substr(i+1,i2-i-1);
         version=plat.substr(i2+1,i3-i2-1)
      }
   }
   document.getElementById(plat+'spanl').innerHTML =
'File: '+nameArray[plat+lang]+
'<br>Dimensione: '+sizeArray[plat+lang]+
'<br>Architettura: Personal Computer standard (i586 compatibile)'+
'<br>MD5: '+md5Array[plat+lang]+
'<br>Scaricamenti: '+downloadsArray[prod+'-'+rep+'-'+lang];
   document.getElementById(plat+'spanr').innerHTML =
'<div id=\"button\"><a href=\"'+pathArray[plat+lang]+nameArray[plat+lang]+
'\"><span>Scarica openmamba '+plat.substr(0,plat.indexOf("-"))+
' ('+lang+')</span></a></div>'+
'<br><a href=\"/distribution/media/'+prod+'.html\">Cos\'è?</a> | '+
'<a href=\"'+pathArray[plat+lang]+nameArray[plat+lang]+'.torrent\" target=_new>Link Torrent</a> | '+
'<a href="javascript:void" id="details-'+prod+'-'+rep+'-'+version+'">Più dettagli...</a>';
   $("#details-"+prod+"-"+rep+"-"+version).click(function(event) { 
     s=$(this).attr("id").replace("details-","").split("-");
     //alert(s);
     detailsswitch(0,s[0],s[1],s[2],lang);
     return false;
   });
}

//$(document).ready(function(){
//   detailsswitch(0,"livedvd","milestone2","2.0pre1");
//  $("#details").click(function(event) { detailsswitch(0); });
//});
</script>
