var printDoc ="";
var strLocation = "";
var strDomain = "";
var imgPath="http://mediatheque.cite-musique.fr/mediacomposite/images/";

function initDocument(){

    //var strLocation = "";
    strLocation += document.location;
  //alert(strLocation);
    
    //var strDomain = "";
    strDomain += document.domain;
	//alert(strDomain);
    try{
    
    var pos = strLocation.lastIndexOf(strDomain);
    pageName = strLocation.substring(pos+1, strLocation.length-5);
    var pos2 = strLocation.indexOf(".fr") + 3;
    printDoc = strLocation.substring(pos2, strLocation.length);
       
    /* active les liens de la liste */
    var Elems = document.getElementsByTagName("a");//.parentNode.className=="listActive"; 
	var str = "";
	var nbElems = Elems.length; 
	for(i = 0; i < nbElems; i++)	{
	str += " - " + Elems[i].parentNode.className;
	}
	//alert(str);
	//alert(Elems);
    //var nbElems = Elems.length; 
    //alert(nbElems);
    var strHref = "";
 
   

    for(i=0; i<nbElems; i++){
		strHref += Elems[i].href;
		//alert(strHref);
		//alert(strLocation.indexOf(strHref));
		//alert(Elems[i].parentNode.parentNode.id);
		if(strLocation.lastIndexOf(strHref)>-1){
			var menutrois = Elems[i].parentNode.parentNode.parentNode.parentNode.id
			if(Elems[i].parentNode.parentNode.parentNode.parentNode.id = menutrois){
			ShowHideListMenu(Elems[i].parentNode.parentNode.parentNode.parentNode.id);
			ShowHideListMenu(Elems[i].parentNode.parentNode.id);
			Elems[i].parentNode.className = "current";
			}
			else{
			ShowHideListMenu(Elems[i].parentNode.parentNode.id);
			Elems[i].parentNode.className = "current";
			}
		}
        strHref = "";
		}
    }catch(e){
    }
    
    /*deploiement des sections CIM */
    
    //var strLocation ="";
    
    var topLocation = "";
    topLocation += top.location;
    
    var docLocation = "";
    docLocation += document.location;
     
    if (topLocation.indexOf("#")>-1){
        strLocation = topLocation;
    }
    
    if(docLocation.indexOf("#")>-1){
        strLocation = docLocation;
    }
    
    
    
   //alert(document.domain +"\n" + document.location + "\n" + document.URL + "\n");
    
    
    
    
    try{
        var posSection = strLocation.lastIndexOf("#");
        if(posSection > -1){
            //alert(posSection);
            sectionID=strLocation.substring(posSection, strLocation.length);
            document.getElementById(sectionID).style.display = "block";
        }
        
    }catch(e){
    }
    
    try{
        document.getElementById('urlNotice').value = strLocation;
    }catch(e){
    }
    
    try{
        document.getElementById('url').value = strLocation;
    }catch(e){
    }
    

    goToFrameset();
    writeShareBox(strLocation);
}

function sendToAFriend() {
    //alert("send");
    //document.getElementById('sendForm').style.display = "block";
    location = document.location;
    sender = document.getElementById('Sender').value;
    emailSender = document.getElementById('EmailSender').value;
    emailDest = document.getElementById('EmailDest').value;
    urlNotice = document.getElementById('urlNotice').value;
    message = document.getElementById('Message').value;
    url = "/common/sendMail.asp?Sender=" + sender + "&EmailSender=" + emailSender + "&EmailDest=" + emailDest + "&Message=" + message + "&URL=" + urlNotice;

    callHttpRequest(url);
    hideForm('blocForm');
}

function showForm(formId) {
    document.getElementById(formId).style.display = "block";
}

function hideForm(formId) {
    document.getElementById(formId).style.display = "none";
}

function printThis(url) {
    var pos = url.indexOf(".fr") + 3;
    printDoc = url.substring(pos, strLocation.length);
   
    printWindow=window.open('/common/print.asp?url='+printDoc,'print','width=550,height=400')
    //printWindow.document.write("<p>This is 'myWindow'</p>")
    printWindow.focus()
}


function writeShareBox() {
    //http://mediatheque.cite-musique.fr/common/print.asp?url=/MediaComposite/CIM/10_Enseignement_de_la_musique/10_ens/10_conservatoires_musique.htm
    strShare = document.getElementById('footer').innerHTML;
    strShare += "<div style=\"text-align:right; margin:0 0px 0 0;\">";
    strShare += "<a href=\"#\" onclick=\"printThis(strLocation)\"><img class=\"ico\" src=\"/mediacomposite/images/icones/print.gif\" border=\"0\" alt=\"Imprimer la page\" title=\"Imprimer la page\"/></a>";
    strShare += "<a href=\"#\" onclick=\"showForm('blocForm')\"><img class=\"ico\" src=\"/mediacomposite/images/icones/envoyer.gif\" border=\"0\" alt=\"Envoyer à un ami\" title=\"Envoyer à un ami\"/></a>";
    strShare += "<a href=\"#\" onclick=\"showForm('blocPermalien')\"><img class=\"ico\" src=\"/mediacomposite/images/icones/permalien.gif\" border=\"0\" alt=\"Permalien\" title=\"Permalien\"/></a>";
    strShare += "<a href=\"javascript:window.open('http://www.myspace.com/Modules/PostTo/Pages/?c="+ strLocation +"', 'myspace', 'toolbar=0,status=0,height=436,width=646,scrollbars=yes,resizable=yes');void(0);\" rel=\"nofollow\"><img class=\"ico\" src=\"/mediacomposite/images/icones/myspace.gif\" border=\"0\" alt=\"Partagez sur MySpace\" title=\"Partagez sur MySpace\"/></a>";
    strShare += "<a href=\"javascript:window.open('http://www.facebook.com/sharer.php?u="+ strLocation +"', 'facebook', 'toolbar=0,status=0,height=436,width=646,scrollbars=yes,resizable=yes');void(0);\" rel=\"nofollow\"><img class=\"ico\" src=\"/mediacomposite/images/icones/facebook.gif\" border=\"0\" alt=\"Partagez sur Facebook\" title=\"Partagez sur Facebook\"/></a>";
    strShare += "<a href=\"javascript:window.open('http://digg.com/submit?phase=2&amp;url="+ strLocation +"', 'Digg', 'toolbar=0,status=0,height=436,width=646,scrollbars=yes,resizable=yes');void(0);\" rel=\"nofollow\"><img class=\"ico\" src=\"/mediacomposite/images/icones/digg.png\" border=\"0\" alt=\"Partagez sur Digg\" title=\"Partagez sur Digg\"/></a>";
    strShare += "<a href=\"javascript:window.open('http://twitter.com/home?status=Titre, mediatheque.cite-musique.fr, "+ strLocation +"', 'twitter', 'toolbar=0,status=0,height=436,width=646,scrollbars=yes,resizable=yes');void(0);\" rel=\"nofollow\"><img class=\"ico\" src=\"/mediacomposite/images/icones/twitter.png\" border=\"0\" alt=\"Partagez sur Twitter\" title=\"Partagez sur Twitter\"/></a>";
    strShare += "<a href=\"javascript:window.open('http://del.icio.us/post?url="+ strLocation +"', 'delicious', 'toolbar=0,status=0,height=450,width=700,scrollbars=yes,resizable=yes');void(0);\" rel=\"nofollow\"><img class=\"ico\" src=\"/mediacomposite/images/icones/delicious.png\" border=\"0\" alt=\"Partagez sur del.icio.us\" title=\"Partagez sur del.icio.us\"/></a>";
    strShare += "<a href=\"javascript:window.open('http://www.linkedin.com/shareArticle?mini=true&amp;url="+ strLocation +"&amp;title=Médiathèque de la Cité de la musique&amp;summary=', 'linkedin', 'toolbar=0,status=0,height=450,width=700,scrollbars=yes,resizable=yes');void(0);\" rel=\"nofollow\"><img class=\"ico\" src=\"/mediacomposite/images/icones/linkedIn.gif\" border=\"0\" alt=\"Partagez sur linkedIn\" title=\"Partagez sur LinkedIn\"/></a>";
    strShare += "</div>";
    
    
//    var share = document.createElement("div");
//    var textShare = document.createTextNode("<a href=\"#\" onclick=\"showForm('blocForm')\"><img class=\"ico\" src=\"/mediacomposite/images/icones/envoyer.gif\" border=\"0\" alt=\"Envoyer à un ami\" title=\"Envoyer à un ami\"/></a>");
//    share.appendChild(textShare);
//    document.getElementByTagName("body").insertBefore(share, 'footer');
//    
    
    document.getElementById('footer').innerHTML = strShare;
    //<a href="#" onclick="showForm('blocForm')"><img class="ico" src="/mediacomposite/images/icones/envoyer.gif" border="0" alt="Envoyer à un ami" title="Envoyer à un ami"/></a><a href="#" onclick="showForm('blocPermalien')"><img class="ico" src="/mediacomposite/images/icones/permalien.gif" border="0" alt="Permalien" title="Permalien"/></a><a href="javascript:window.open('http://www.myspace.com/Modules/PostTo/Pages/?c=http://mediatheque.cite-musique.fr/masc/play.asp?ID=0766767', 'myspace', 'toolbar=0,status=0,height=436,width=646,scrollbars=yes,resizable=yes');void(0);" rel="nofollow"><img class="ico" src="/mediacomposite/images/icones/myspace.gif" border="0" alt="Partagez sur MySpace" title="Partagez sur MySpace"/></a><a href="javascript:window.open('http://www.facebook.com/sharer.php?u=http://mediatheque.cite-musique.fr/masc/play.asp?ID=0766767', 'facebook', 'toolbar=0,status=0,height=436,width=646,scrollbars=yes,resizable=yes');void(0);" rel="nofollow"><img class="ico" src="/mediacomposite/images/icones/facebook.gif" border="0" alt="Partagez sur Facebook" title="Partagez sur Facebook"/></a><a href="javascript:window.open('http://digg.com/submit?phase=2&amp;url=http://mediatheque.cite-musique.fr/masc/play.asp?ID=0766767', 'Digg', 'toolbar=0,status=0,height=436,width=646,scrollbars=yes,resizable=yes');void(0);" rel="nofollow"><img class="ico" src="/mediacomposite/images/icones/digg.png" border="0" alt="Partagez sur Digg" title="Partagez sur Digg"/></a><a href="javascript:window.open('http://twitter.com/home?status=Titre, mediatheque.cite-musique.fr, http://mediatheque.cite-musique.fr/masc/play.asp?ID=0766767', 'twitter', 'toolbar=0,status=0,height=436,width=646,scrollbars=yes,resizable=yes');void(0);" rel="nofollow"><img class="ico" src="/mediacomposite/images/icones/twitter.png" border="0" alt="Partagez sur Twitter" title="Partagez sur Twitter"/></a><a href="javascript:window.open('http://del.icio.us/post?url=http://mediatheque.cite-musique.fr/masc/play.asp?ID=0766767', 'delicious', 'toolbar=0,status=0,height=450,width=700,scrollbars=yes,resizable=yes');void(0);" rel="nofollow"><img class="ico" src="/mediacomposite/images/icones/delicious.png" border="0" alt="Partagez sur del.icio.us" title="Partagez sur del.icio.us"/></a><a href="javascript:window.open('http://www.linkedin.com/shareArticle?mini=true&amp;url=http://mediatheque.cite-musique.fr/masc/play.asp?ID=0766767&amp;title=Médiathèque de la Cité de la musique&amp;summary=', 'linkedin', 'toolbar=0,status=0,height=450,width=700,scrollbars=yes,resizable=yes');void(0);" rel="nofollow"><img class="ico" src="/mediacomposite/images/icones/linkedIn.gif" border="0" alt="Partagez sur linkedIn" title="Partagez sur LinkedIn"/></a>
}




/********/

function register_position(){
	mouse_x = 0;
	mouse_y = 0;
	document.onmousemove = position;
}
function position(evt){
	if(!evt) evt = window.event;	
	mouse_x = evt.clientX;
	mouse_y = evt.clientY;
	//window.status = "X : "+mouse_x+" ; Y : "+mouse_y;
   //document.getElementById("coordonnees").innerHTML = "X : "+mouse_x+" ; Y : "+mouse_y;
   //alert("X : "+mouse_x+" ; Y : "+mouse_y);
}
/******/




 // pop-up glossaire (centre)
function glossaire(maPage, maHauteur, maLargeur) {
var winl = (screen.width - 450) / 2;
var wint = (screen.height - 350) / 2;
winprops = 'height='+maHauteur+',width='+maLargeur+',top='+wint+',left='+winl+',scrollbars=yes,resizable=no'
win = window.open(maPage, 'gloss', winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function facteur(mypage) {
var winl = (screen.width - 15) / 2;
var wint = (screen.height - 550) / 2;
winprops = 'height=350,width=470,top='+wint+',left='+winl+',scrollbars=yes,resizable=no'
win = window.open(mypage, 'fact', winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

//Ajout - Denocq 20050621 - Uniformisation des dossiers
function popup(maPage, maHauteur, maLargeur) {
    //alert(screen.width + "," + screen.height + "," + maHauteur + "," + maLargeur);
    var winl = (screen.width - parseInt(maHauteur) - 10) / 2;
    var wint = (screen.height - parseInt(maLargeur) - 10) / 2;
    //alert(winl + "," + wint);
	//alert(gloss.width + ':' + maPage.height);
	winprops = 'height='+maHauteur+',width='+maLargeur+',top='+wint+',left='+winl+',scrollbars=yes,resizable=no,status=no';
	//winprops = 'top='+wint+',left='+winl+',scrollbars=yes,resizable=no,status=no';
	
	win = window.open(maPage, 'gloss', winprops);
	win.resizeTo(parseInt(maLargeur)+13, parseInt(maHauteur)+13)

	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
//  Fin pop-up glossaire -->


//Ajout - Denocq 20050824 - popup notices fiches domaines
function popupNotice(maPage){
	var maHauteur = 450;
	var maLargeur = 350;
	var winl = (screen.width - 450) / 2;
	var wint = (screen.height - 350) / 2;
	winprops = 'height='+maHauteur+',width='+maLargeur+',top='+wint+',left='+winl+',scrollbars=yes,resizable=no';
	win = window.open(maPage, 'notice', winprops);
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}


function ShowHideListMenu(eSrc) {
	
	eSrc = document.getElementById(eSrc);
	eSrc.style.display = ("block" == eSrc.style.display ? "none" : "block");
	//document.getElementById(eSrc.id).src = (imgPath+"plus.gif" == document.getElementById(eSrc.id).src ? imgPath+"moins.gif" : imgPath+"plus.gif");
	//document.getElementById(eSrc.id).src = (imgPath+"plus.gif" == document.getElementById(eSrc.id).src ? imgPath+"moins.gif" : imgPath+"plus.gif");
	if(document.getElementById(eSrc.id).src == imgPath+"moins.gif"){
		document.getElementById(eSrc.id).src = imgPath+"plus.gif";
	}
	else{
		document.getElementById(eSrc.id).src = imgPath+"moins.gif";
	}
	//alert(document.getElementById(eSrc.id).src);
	
}


function showHideModalPopup(popup, event){
	x=event.x;
	y=event.y;
	
	mouse_x = event.clientX;
	mouse_y = event.clientY;

	var xOffset = 130;
	var yOffset = 117;
	
	//alert(popup +"\n"+document.getElementById(popup).style.left + ":" + document.getElementById(popup).style.left);
	
	document.getElementById(popup).style.left = mouse_x + xOffset + "px";
	document.getElementById(popup).style.top = mouse_y + xOffset  + "px";
		
	document.getElementById(popup).style.visibility = 'visible';
	document.getElementById(popup).style.display = 'block';
	
	

	
	/*if(document.getElementById('canvas').style.opacity){
		document.getElementById('canvas').style.opacity = '0.1';
	}
	if(document.getElementById('canvas').style.filter){
		document.getElementById('canvas').style.filter = 'alpha(opacity=10)';
	}*/
	/*	opacity : 0.5; 
    filter : alpha(opacity=50); */
}

function showHideModalPopup(popup){
	var xOffset = 130;
	var yOffset = 117;
	
	//alert(popup +"\n"+document.getElementById(popup).style.left + ":" + document.getElementById(popup).style.left);
	
	document.getElementById(popup).style.left = "0px";
	document.getElementById(popup).style.top = "0px";
		
	document.getElementById(popup).style.visibility = 'visible';
	document.getElementById(popup).style.display = 'block';
	
	

	
	/*if(document.getElementById('canvas').style.opacity){
		document.getElementById('canvas').style.opacity = '0.1';
	}
	if(document.getElementById('canvas').style.filter){
		document.getElementById('canvas').style.filter = 'alpha(opacity=10)';
	}*/
	/*	opacity : 0.5; 
    filter : alpha(opacity=50); */
}



function closeModalPopup(obj){
	document.getElementById(obj.id).style.visibility = 'hidden';
	document.getElementById(obj.id).style.display = 'none';
}




/*function showDfn(id, event){
    
    //alert(event.x + ";" + event.y + "\n" + event.clientX + " ; " + event.clientY  + "\n" + event.screenX + " ; " + event.screenY);
    //x = event.x;
	//y = event.y;
	//x = event.screenX;
	//y = event.screenY;
    //x = event.clientX;
	//y = event.clientY;

	//var xOffset = -100;
	//var yOffset = 0;
    //var xOffset = 10;
	//var yOffset = 10;
	



	//try{
	//	strContent = document.getElementById(id).innerHTML;
	//	strContent = strContent.substring(2, strContent.length-1);
	
	//	document.getElementById('dfnPopup').innerHTML = strContent;
		
		//document.getElementById('dfnPopup').style.left = x + xOffset + ((document.body.scrollLeft)?document.body.scrollLeft:0) + "px";
		//document.getElementById('dfnPopup').style.top = y + xOffset  + ((document.body.scrollTop)?document.body.scrollTop:0) + "px";
		
	//	document.getElementById('dfnPopup').style.left = x + xOffset + document.body.scrollLeft + "px";
	//	document.getElementById('dfnPopup').style.top = y + yOffset + document.body.scrollTop + "px";
		
		
	//	document.getElementById('dfnPopup').style.visibility = 'visible';
	//	document.getElementById('dfnPopup').style.display = 'block';
	}//
	//catch(e)
	//{
		//alert('e');
	//}
}
*/


function showDfn(id,event) {
    // navigateurs Gecko ou IE
    gk = window.Event ? 1 : 0;


    docElement = !document.documentElement.clientWidth ? document.body : document.documentElement;
    //scrollX = gk ? pageXOffset : docElement.scrollLeft;
    //scrollY = gk ? pageYOffset : docElement.scrollTop;

    scrollX = docElement.scrollLeft;
    scrollY = docElement.scrollTop;


//    x = gk ? event.pageX : event.clientX + scrollX;
//    y = gk ? event.pageY : event.clientY + scrollY;

        x = event.clientX + scrollX;
        y = event.clientY + scrollY;

    
    try{
        strContent = document.getElementById(id).innerHTML;
        //strContent = strContent.substring(2, strContent.length-1);
        strContent = strContent.substring(strContent.indexOf("(")+1, strContent.lastIndexOf(")"));
        var dfnPopup;  
        dfnPopup = document.getElementById('dfnPopup');
        dfnPopup.innerHTML = strContent;

        dfnPopup.style.left = x + "px";
        dfnPopup.style.top = y + "px";

        dfnPopup.style.visibility = 'visible';
        dfnPopup.style.display = 'block';
    }
    catch(e)
	{
		alert('e');
	}
}

function showCit(id,event) {
    // navigateurs Gecko ou IE
    gk = window.Event ? 1 : 0;


    docElement = !document.documentElement.clientWidth ? document.body : document.documentElement;
    scrollX = gk ? pageXOffset : docElement.scrollLeft;
    scrollY = gk ? pageYOffset : docElement.scrollTop;

    x = gk ? event.pageX : event.clientX + scrollX;
    y = gk ? event.pageY : event.clientY + scrollY;
    
    try{
        strContent = document.getElementById(id).innerHTML;
        //strContent = strContent.substring(2, strContent.length-1);
        strContent = strContent.substring(strContent.indexOf("(")+1, strContent.lastIndexOf(")"));
        var dfnPopup;  
        dfnPopup = document.getElementById('citPopup');
        dfnPopup.innerHTML = strContent;

        dfnPopup.style.left = x + "px";
        dfnPopup.style.top = y + "px";

        dfnPopup.style.visibility = 'visible';
        dfnPopup.style.display = 'block';
    }
    catch(e)
	{
		alert('e');
	}
}


function hideDfn(){
	document.getElementById('dfnPopup').style.visibility = 'hidden';
	document.getElementById('dfnPopup').style.display = 'none';
}

function hideCit(){
	document.getElementById('citPopup').style.visibility = 'hidden';
	document.getElementById('citPopup').style.display = 'none';
}

//Ajout - Denocq 20050707 - SousMenu Jazz
function genSousMenu(str){
	var cElems = document.all.tags('div');
	var iNumElems = cElems.length;
	str=String(str);
	var currentId = str.substr(str.length-6,2);
	for (var i=1;i<iNumElems;i++){
		if(cElems[i].id==("sousmenu"+currentId)){
			document.getElementById(cElems[i].id).style.visibility = 'visible';
		}

	}
}

//Fin SousMenu Jazz

function ecouter(lien)
{
	window.opener.src=lien;
	window.opener.focus();
	//window.close();
	//parent.parent.document.getElementById('frame_streamer').src = "/portail/passerelle.asp?EID=" + strEid;
}

function changerOpener(lien) {
if (window.opener &&!window.opener.closed) {
window.opener.refreshPage(lien);
//window.opener.focus();
//window.close;
window.focus();
}
}

function refreshPage(lien){
//document.location.reload();
document.location = lien
}

//function changeFrameSet(couleurbandeau)
//{
//    alert(parent.document.getElementById('frame_banner'));
//    alert(parent.document.getElementById('frame_banner').document);
//    banner = parent.document.getElementById('frame_banner').document;

//    alert(top.name);
//    alert(top.frames['frame_banner'].getElementById('bandeau').src);

//    alert(banner.getElementById("bandeau").src);
    
    //alert(parent.document.getElementById('frame_banner').getElementById('bandeau').src);
    //alert(window.top.frames['frame_banner'].getElementById('bandeau').src);
    
   
    //banner = parent.document.getElementById('frame_banner').src;
    //alert(banner.document.getElementById('bandeau').src);
	    //alert(top);
//    	if(self == top) { //window.location = 'frameset.htm'
//	    	return false;
//	    } else {
	    /*try{
	        alert(top.length + '\n' + top.frames.length);
	    }catch(e){
	        alert(e);
	    }
	    
	    try{    
	        alert(frames.length);
	    }catch (e){
	        alert(e);
	    }*/
//	        alert(top.frames['frame_banner'].getElementById('bandeau').src);
		    
		    //parent.frame_banner.getElementById('bandeau').src= "/skins/CITEMUSIQUE/images/integration/accueil/bandeau_" + couleurbandeau + ".gif";
		    //window.top.frames['frame_banner'].getElementById('bandeau').src= "/skins/CITEMUSIQUE/images/integration/accueil/bandeau_" + couleurbandeau + ".gif";
		    //alert(top.frames['frame_banner'].getElementById('bandeau').src);
		    //top.frames['frame_banner'].getElementById('bandeau').src= "/skins/CITEMUSIQUE/images/integration/accueil/bandeau_" + couleurbandeau + ".gif";
//	    }
//}

function changeFrameSet(couleurbandeau)
{
	//parent.document.getElementById('frame_banner').src=bandeau;
	//parent.parent.frame_banner.getElementById('bandeau').src= "/skins/CITEMUSIQUE/images/integration/accueil/bandeau_" + couleurbandeau + ".gif";
	//window.top.frames['frame_banner'].getElementById('bandeau').src= "/skins/CITEMUSIQUE/images/integration/accueil/bandeau_" + couleurbandeau + ".gif";
	imgPath = top.frames['frame_banner'].document.getElementById('bandeau').src;
	pos = imgPath.indexOf('_');
	imgPath.substring(0, pos);
	//alert(imgPath);
	top.frames['frame_banner'].document.getElementById('bandeau').src = imgPath.substring(0, pos) + "_" + couleurbandeau + ".gif";	
}

//Ajout - Denocq 20050829 - re-integration dans le frameset
function goToFrameset(){
	var sPath = window.location.pathname;
	var query = window.location.search;
	//alert(window.name);
	//var sPage = sPath.substring(sPath.lastIndexOf('\\') + 1);
	var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
	//alert(sPage);


	//Pour détécter et rediriger :
	//alert(top.frames.length);
	//for(i=0;i<top.frames.length;i++){
	//	alert(top.frames[i].name);
	//}
	try{
	if(window.name != "notice"){
		if(top.frames.length <= 0){
		//top.frames.location = "http://mediatheque.cite-musique.fr/masc/default.asp?INSTANCE=CITEMUSIQUE";
		//alert(sPath);
			top.frames.location= "/masc/?INSTANCE=CITEMUSIQUE&URL=" + sPath + escape(query);
		}
	}
	}catch(e){
	}
}

//Special FSFiche.asp domaine
function goToFSFiche(){
	var sPath = window.location.pathname;
	//var sPath = window.location;
	//var sPage = sPath.substring(sPath.lastIndexOf('\\') + 1);
	var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
	//alert(sPage);
	alert(sPath);
	//alert(window.location);


	//Pour détécter et rediriger :
	//alert('FSFiche');
	//alert(top.frames.length);
	//for(i=0;i<top.frames.length;i++){
	//	alert(top.frames[i].name);
	//}

	if(top.frames.length <= 2){
		//top.frames.location = "http://mediatheque.cite-musique.fr/masc/default.asp?INSTANCE=CITEMUSIQUE";
		//alert(sPath);
		//top.frames.location= "http://mediatheque.cite-musique.fr/masc/?URL=" + sPath;
		top.frames.location= "http://mediatheque.cite-musique.fr/masc/?URL=" + window.location
	}
}

//Ouverture des guides d'écoute
//Test de la resolution,


function lienResol(url){
	//alert(screen.width + "x" + screen.height);
	if (screen.width >= 1280 && screen.height >= 1024) {
			location=url;
	} else {
		win = window.open(url,'MetaScore','Fullscreen')
	}
}

function openGuide(url){
	//alert(screen.width + "x" + screen.height);
	winprops = 'height=768,width=1024,top=0,left=0,scrollbars=no,resizable=no,status=no';
	win = window.open(url, 'MetaScore', winprops);
	if (parseInt(navigator.appVersion) >= 4) {
	    win.window.focus();
	}
}

function checkResol(){
	//alert(this.window.location);
	//alert(objWindow.location);
	//alert(window.name);
	if(window.name != 'MetaScore'){
		if (screen.width >= 1280 && screen.height >= 1024) {
			window.name='MetaScore';
			location=objWindow.location;
		} else {
			location="/mediacompositedev/cmda/resolution.asp";
			win = window.open(objWindow.location,'MetaScore','Fullscreen')
		}
	}
}

function test(){
	alert('ok');
}


//Code Macromedia...
// menus "chapitres"
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_setTextOfTextfield(objName,x,newText) { //v3.0
  var obj = MM_findObj(objName); if (obj) obj.value = newText;
}

// show & hide menus d&eacute;roulant
function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

// pour les balises div
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

//images swap on roll over / roll out
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


//cim popup
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


//-->


function callHttpRequest(url) {
    //alert("call");
    if (window.XMLHttpRequest) {
        req = new XMLHttpRequest();
        req.onreadystatechange = processReqChange;
        req.open("GET", url, true);
        req.send(null);
        // branch for IE/Windows ActiveX version
    } else if (window.ActiveXObject) {
        isIE = true;
        req = new ActiveXObject("Microsoft.XMLHTTP");
        if (req) {
            req.onreadystatechange = processReqChange;
            req.open("GET", url, true);
            req.send();
        }
    }
}

function processReqChange() {
    // only if req shows "loaded"
    if (req.readyState == 4) {
        // only if "OK"
        if (req.status == 200) {
            //displayXMLData();
            hideForm();
        } else {
            alert("There was a problem retrieving the XML data:\n" + req.statusText);
        }
    }
}

