var dossier0="http://son.memovs.ch/";
var num=2;
if(undefined===window.page_multi){page_multi = "";}

svbg=""
function chng(obj,i) {
if(i==0) obj.setAttribute("BGCOLOR", "#A6A6E3", false)
if(i==1)
if(obj==svbg) obj.setAttribute("BGCOLOR", "#BBCEE3", false)
else obj.setAttribute("BGCOLOR", "#C3BDF1", false)
if(i==2) {
if(svbg!="") svbg.setAttribute("BGCOLOR", "#C3BDF1", false)
svbg=obj
obj.setAttribute("BGCOLOR", "#BBCEE3", false)
}
}

String.prototype.trim = function()
{
return this.replace(/(^\s*)|(\s*$)/g,'');
}

function fon_banniere(){window.location="http://xml.memovs.ch/s024-"+fichierson+".xml";

document.write('<fieldset style="font-size:12"><table cellpadding="0" cellspacing="0" cellpadding="0" border="0" valign="top" width="100%" BGCOLOR="#7575C0" style="font-size:16">');
document.write('<tbody>');
document.write('<tr>');
document.write('<td valign="center" align="left" colspan="1">');
document.write('<a target="_blank" href="http://www.rsr.ch"><img src="'+dossier0+'images/rsr1.jpg" alt="RSR" border="0"></a></td>');
document.write('<td valign="center" align="center" width="50%">');
document.write('<a target="_blank" href="http://son.memovs.ch/S024/doc/page_patois.htm"><FONT SIZE="2" STYLE="VERDANA" color="#ffffff"><BR><b>ARCHIVES DES PARLERS PATOIS DE LA SUISSE ROMANDE ET DES REGIONS VOISINES<b><BR><BR></FONT></a></td>');
document.write('<td valign="center" align="left">');
document.write('<a target="_blank" href="http://www.memoriav.ch"><img src="'+dossier0+'images/memoriav.gif" alt="MEMORIAV" border="0"></a></td>');
document.write('<td valign="center" align="center">');
document.write('<img src="'+dossier0+'images/logo1.jpg" alt=""></td>');
document.write('<td valign="center" align="right">');
document.write('<a target="_blank" href="http://www.mediatheque.ch/menu/menu.asp?source=%2E%2E%2Ffra%2Fmartigny%2Ehtm&idLangue=fra&noNoeud=0_1_3"><img src="'+dossier0+'images/logo2.jpg" alt="Médiathèque Valais - Martigny" BORDER="0"></A></td>');
document.write('</tr>');
document.write('</tbody>');
document.write('</table></fieldset>');
}


function fon_suequence(){

document.write('<fieldset style="font-size:12; color:#000000"><legend><FONT COLOR="#000000"><B>Séquences</B></FONT></legend>');
document.write('<table cellpadding="0" cellspacing="2" border="0" style="font-size:14" ALIGN="center" WIDTH="100%">');
document.write('<tr BGCOLOR="#7575C0">');
document.write('<td ALIGN="center" WIDTH="4%"><b>D&eacute;but</b></td>');
document.write('<td ALIGN="center" WIDTH="4%"><b>Dur&eacute;e</b></td>');
document.write('<td ALIGN="center"><b>Contenu</b></td>');
document.write('<td ALIGN="center"><b>Genre</b></td>');
document.write('<td ALIGN="center"><b>Auteur</b></td>');
document.write('<td ALIGN="center"><b>Locuteur</b></td>');
document.write('<td ALIGN="center"><b>de</b></td>');
document.write('<td ALIGN="center"><b>Document</b></td>');
document.write('<td ALIGN="center"><b>Annexe</b></td>');
document.write('</tr>');

for(i=0; i < sequence.length; i++){

if (sequence[i][0].length < 1) { sequence[i][0] = "0"; }
if (sequence[i][1].length < 1) { sequence[i][1] = "&nbsp;"; }

if (sequence[i][1] != "Fin") {

// Si le temps est sur 5 chiffres
if (sequence[i][0].length == 5) {
min = ((sequence[i][0].substr(0, 2))*60);
sec = sequence[i][0].substr((sequence[i][0].length-2));
temps = parseInt(min) + parseInt(sec);
// On sort le temps de la suequence suivante
min2 = ((sequence[i+1][0].substr(0, 2))*60);
sec2 = sequence[i+1][0].substr((sequence[i][0].length-2));
temps2 = parseInt(min2) + parseInt(sec2) - temps;
// On transforme la duree
dmin = parseInt(temps2/60);
dsec = (temps2 - parseInt(temps2/60)*60);
if (dsec < 10) { dsec= "0"+dsec; }
if (dmin < 10) { dmin= "0"+dmin; }
duree = dmin +":"+ dsec;}

// Si le temps est sur 8 chiffres
if (sequence[i][0].length == 8) {
heur= ((sequence[i][0].substr(0, 2))*60)*60;
min = ((sequence[i][0].substr(3, 2))*60);
sec = sequence[i][0].substr((sequence[i][0].length-2));
temps = parseInt(heur) + parseInt(min) + parseInt(sec);
// On sort le temps de la suequence suivante
heur2  = ((sequence[i+1][0].substr(0, 2))*60)*60;
min2   = ((sequence[i+1][0].substr(3, 2))*60);
sec2   = sequence[i+1][0].substr((sequence[i][0].length-2));
temps2 = parseInt(heur2) + parseInt(min2) + parseInt(sec2) - temps;
// On transforme la duree
dheur = parseInt(temps2/3600);
dmin  = parseInt((temps2 - parseInt(temps2/3600)*3600)/60);
dsec  = temps2 - (dheur*3600) - (dmin*60);
if (dsec < 10) { dsec= "0"+dsec; }
if (dmin < 10) { dmin= "0"+dmin; }
if (dheur < 10) { dheur= "0"+dheur; }
duree = dheur +":"+ dmin +":"+ dsec;}

document.write("<tr BGCOLOR=\"#C3BDF1\"><td>"+sequence[i][0]+"</td><td>"+duree+"</td>");
document.write("<td onMouseOver=\"chng(this,0); this.style.cursor='pointer'; this.style.color='#4537AC';\" onMouseOut=\"chng(this,1); this.style.color='#000000';\" LANGUAGE = \"JScript\" onClick = \"chng(this,2);MediaPlayer1.controls.currentPosition = '"+temps+"';\">"+sequence[i][1]+"</td>");
document.write("<td>"+sequence[i][2]+"</td>");

nom_auteur=sequence[i][3].split(";");
lien_auteur=sequence[i][4].split(";");

if (sequence[i][4] ==""){
document.write("<td>"+sequence[i][3]+"</td>");
} else {

document.write("<td>");
for(y=0;y<nom_auteur.length;y++){
document.write("<a href='"+lien_auteur[y]+"' TARGET='parent'>"+nom_auteur[y]+"</A>;&nbsp;");}
}
document.write("</td>");

nom_locuteur=sequence[i][5].split(";");
lien_locuteur=sequence[i][6].split(";");

if (sequence[i][6] ==""){
document.write("<td>"+sequence[i][5]+"</td>");
} else {

document.write("<td>");
for(y=0;y<nom_locuteur.length;y++){
document.write("<a href='"+lien_locuteur[y]+"' TARGET='parent'>"+nom_locuteur[y]+"</A>;&nbsp;");}
}
document.write("</td>");

document.write("<td>"+sequence[i][7]+"</td>");

document.write("<td>");

if (sequence[i][8].length > 2) {

document.write("<A HREF=\"txt"+fichierson+".html#"+(num-1)+"\" TARGET='parent'>"+sequence[i][8]+"</A>");
num++;

} else { num++; }

document.write("</td>");

if (sequence[i][10] !=""){
document.write("<td><a href='"+sequence[i][10]+"' TARGET='parent'>"+sequence[i][9]+"</A></td>");
} else {document.write("<td>"+sequence[i][9]+"</td>");}

document.write("</tr>");


} else { document.write("<tr BGCOLOR=\"#C3BDF1\">");
document.write("<td>"+sequence[i][0]+"</td>");
document.write("<td></td>");
document.write("<td>"+sequence[i][1]+"</td>");
document.write("<td></td>");
document.write("<td></td>");
document.write("<td></td>");
document.write("<td></td>");
document.write("<td></td>");
document.write("<td></td>");
document.write("<td></td>");
document.write("<td></td>");
document.write("<td></td>");
document.write("</tr>");
}}

document.write('</script>');
document.write('</table></fieldset>');

}

function fon_son(){document.write('<TABLE>');
document.write('<TR>');
document.write('<TD WIDTH="7%" ALIGN="center">');
document.write('</TD>');
document.write('<td ALIGN="left" COLSPAN="2">');
document.write('<object id="MediaPlayer1" width="300" height="60" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">');
document.write('<param name="URL" value="'+dossier0+dossier+fichierson+'.wma">');
document.write('<param name="rate" value="1"><param name="balance" value="0">');
document.write('<param name="currentPosition" value="0">');
document.write('<param name="defaultFrame" value>');
document.write('<param name="playCount" value="1">');
document.write('<param name="autoStart" value="-1">');
document.write('<param name="currentMarker" value="0">');
document.write('<param name="invokeURLs" value="-1">');
document.write('<param name="baseURL" value>');
document.write('<param name="volume" value="50">');
document.write('<param name="mute" value="0">');
document.write('<param name="uiMode" value="full">');
document.write('<param name="stretchToFit" value="0">');
document.write('<param name="windowlessVideo" value="0">');
document.write('<param name="enabled" value="-1">');
document.write('<param name="enableContextMenu" value="-1">');
document.write('<param name="fullScreen" value="0">');
document.write('<param name="SAMIStyle" value>');
document.write('<param name="SAMILang" value>');
document.write('<param name="SAMIFilename" value>');
document.write('<param name="captioningID" value>');
document.write('<param name="enableErrorDialogs" value="0">');
document.write('<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="'+dossier0+dossier+fichierson+'.wma" name="MediaPlayer1" width="300" height="60" showcontrols="1" autosize="0" autostart="1" showpositioncontrols="1" showstatusbar="1" showtracker="1"></object>');
document.write('</td>');
document.write('</TR>');
}

function af_copy(){
document.write('<TABLE WIDTH="100%" style="font-size:14" HEIGHT=60 ALIGN="center">');
document.write('<TR>');
document.write('<TD ALIGN="center">');
document.write('<center><a target="_blank" href="http://www.rsr.ch/">');
document.write('<font size="2">© RSR tous droits d\'utilisation réservés<BR>Toute utilisation est soumise à l\'autorisation de la Radio suisse romande</B></font></a>');
document.write('</TD>');
document.write('<TR>');
document.write('</TABLE>');
}

function af_info(){
document.write('<TR>');
document.write('<TD ALIGN="center" WIDTH="20%">');
document.write('<IMG SRC="'+dossier0+'images/win_media.gif">');
document.write('</TD>');
document.write('<td COLSPAN=2>');
document.write('<small><i>Streaming optimis&eacute; pour Windows Media</i></small>');
document.write('<br>');
document.write('<small><i>Choisissez la séquence voulue dans le tableau ci-dessous.</i></small>');
document.write('</td>');
document.write('</tr>');
document.write('</table>');
document.write('</TD>');
document.write('</TR>');
document.write('</table>');
}

function af_prof(){

if (document.getElementById('prof').style.display == '') {
document.getElementById('prof').style.display='none';
document.getElementById('prof2').style.display='';} else {document.getElementById('prof').style.display='';
document.getElementById('prof2').style.display='none';}


}

function catalogue() {

document.write('<TABLE WIDTH="100%" BORDER="0" ALIGN="center" HEIGHT=220>');
document.write('<TR>');
document.write('<TD COLSPAN="4" HEIGHT="20%">');
document.write('</TD>');
document.write('</TR>');
document.write('<TR>');
document.write('<TD ALIGN="center" WIDTH="450" ROWSPAN="2" VALIGN="top"><fieldset style="font-size:12"><legend><FONT COLOR="#000000"><B>Fiche technique</B></FONT></legend>');
document.write('<table BORDER=0 WIDTH="100%" ALIGN="center" style="font-size:14"><tr BGCOLOR="#C3BDF1">');

if(emission==""){
}else{document.write('<TD width="38%"><b>Emission :</b></TD><TD>'+emission+'</td></TR>');}

if(ladate==""){
}else{document.write('<tr BGCOLOR="#C3BDF1"><TD><b>Date d\'enregistrement :</b></TD><TD>'+ladate+'</td></TR>');}

if(lieu==""){
}else{document.write('<tr BGCOLOR="#C3BDF1"><TD><b>Lieu d\'enregistrement :</b></TD><TD>'+lieu+'</td></TR>');}

if(titre==""){
}else{document.write('<tr BGCOLOR="#C3BDF1"><TD><b>Titre :</b></TD><TD>'+titre+'</td></TR>');}

if(diffusion==""){
}else{document.write('<tr BGCOLOR="#C3BDF1"><TD><b>Diffusion :</b></TD><TD>'+diffusion+'</td></TR>');}

if(rediffusion==""){
}else{document.write('<tr BGCOLOR="#C3BDF1"><TD><b>Rediffusion :</b></TD><TD>'+rediffusion+'</td></TR>');}

if(support==""){
}else{document.write('<tr BGCOLOR="#C3BDF1"><TD><b>Support :</b></TD><TD>'+support+'</td></TR>');}

page_multiple();

document.write('</TABLE>');
document.write('<DIV ID="prof" style="display:none">');
document.write('<TABLE WIDTH="100%" BORDER="0" ALIGN="center">');

document.write('<tr BGCOLOR="#7575C0" HEIGHT="2"><TD COLSPAN="2"></TD></TR>');

if(realisateur==""){
}else{document.write('<tr BGCOLOR="#C3BDF1"><TD width="38%"><b>Producteur :</b></TD><TD>'+realisateur+'</td></TR>');}

if(collection==""){
}else{document.write('<tr BGCOLOR="#C3BDF1"><TD width="38%"><b>Collection :</b></TD><TD>'+collection+'</td></TR>');}

if(collation==""){
}else{document.write('<tr BGCOLOR="#C3BDF1"><TD width="38%"><b>Collation :</b></TD><TD>'+collation+'</td></TR>');}

if(genre==""){
}else{document.write('<tr BGCOLOR="#C3BDF1"><TD width="38%"><b>Genre :</b></TD><TD>'+genre+'</td></TR>');}

if(notes==""){
}else{document.write('<tr BGCOLOR="#C3BDF1"><TD width="38%"><b>Notes :</b></TD><TD>'+notes+'</td></TR>');}

if(restrictions==""){
}else{document.write('<tr BGCOLOR="#C3BDF1"><TD width="38%"><b>Droits/© :</b></TD><TD>'+restrictions+'</td></TR>');}

if(vsavson==""){
}else{document.write('<tr BGCOLOR="#C3BDF1"><TD width="38%"><b>VSavson :</b></TD><TD>'+vsavson+'</td></TR>');}

if(vsavmat==""){
}else{document.write('<tr BGCOLOR="#C3BDF1"><TD width="38%"><b>VSavmat :</b></TD><TD>'+vsavmat+'</td></TR>');}

if(vsavgeo==""){
}else{document.write('<tr BGCOLOR="#C3BDF1"><TD width="38%"><b>VSavgeo :</b></TD><TD>'+vsavgeo+'</td></TR>');}

document.write('</TABLE>');
document.write('<TABLE  WIDTH="100%"><tr><TD ALIGN="right"><a href="#" onclick="af_prof()"><IMG SRC="'+dossier0+'images/red.gif" BORDER="0"></a></td></TR></TABLE></DIV>');
document.write('<DIV ID="prof2"><TABLE WIDTH="100%"><tr><TD ALIGN="right"><a href="#" onclick="af_prof()"><IMG SRC="'+dossier0+'images/dev.gif" BORDER="0"></a></td></TR></TABLE></DIV>');
document.write('</fieldset>');
document.write('</TD>');
document.write('</TR>');
document.write('<TR>');
document.write('<TD>');
}

function fon_tablemat(){

document.write('<TABLE WIDTH="100%" BORDER="0" ALIGN="center">');
document.write('<TR>');
document.write('<TD ALIGN="center" WIDTH="700" ROWSPAN="2"><fieldset style="font-size:12; color:#000000"><legend><FONT COLOR="#000000"><B>Table des matières</B></FONT></legend>');
document.write('<table cellpadding="0" cellspacing="2" border="0" style="font-size:14" ALIGN="center" WIDTH="100%">');

for(i=0; i < tablemat.length; i++){

if (tablemat[i][0] != "") {

document.write("<TR BGCOLOR='#C3BDF1'><TD>"+num+".</TD><td onMouseOver=\"chng(this,0); this.style.cursor='pointer'; this.style.color='#4537AC';\" onMouseOut=\"chng(this,1); this.style.color='#000000';\" LANGUAGE = \"JScript\" onClick =\"document.location='#"+num+"'\">"+tablemat[i][0]+"</td></TR>");
num++;

} else { document.write('"+tablemat[i][0]+"');
}
}
document.write('</TABLE>');
document.write('</FIELDSET>');
document.write('</TD>');
document.write('</TR>');
document.write('</TABLE>');
}

function page_multiple() {
if (page_multi.length > 1) {

document.write('<tr BGCOLOR="#C3BDF1"><td width="38%" nowrap><b>Documents&nbsp;liés</b></td><td><select onChange="lien=(\'../\'+this.options[this.selectedIndex].value+\'/\'+this.options[this.selectedIndex].value+\'.html\');window.location=lien;" style="background-color:#FDFDEE;font-size: 10px;color:#440000;">');

//scinder la variable
page_multi = page_multi.split('|r|n');

//boucle des pages multiples
for (m=0; m < page_multi.length;m++) {

//scinder le titre et le lien
page_ti = page_multi[m].split('¦');

document.write('<option ');


if (fichierson == page_ti[1]) { document.write(' selected'); }

document.write(' value="'+page_ti[1]+'">'+page_ti[0]+'</option>');

}
document.write('</select></td></tr>');
}
}