﻿startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}
window.onload = function() {
	startList();
}

// bascule de visibilité p.353 et s. dans book Jeffrey Zeldman "Design web : utiliser les standards"
function toggle( targetId ) {
	if (document.getElementById){
		target = document.getElementById( targetId );
			if (target.style.display == "none"){
				target.style.display = "";
			} else {
				target.style.display = "none";
			}
	}
}


var xhr = null;

function faire_selection(ann, url)
{ 
//alert(ann);
    if ( window.XMLHttpRequest ){
		    xhr = new XMLHttpRequest();
	    } else if ( window.ActiveXObject ){
		    xhr = new ActiveXObject( 'Microsoft.XMLHTTP' );
	    } else {	
		    alert( 'Votre navigateur ne supporte pas les objets XMLHTTPRequest...' );
		    return;
	    }

	xhr.open( 'GET', url + "/pages/ajoutselection.aspx?n=" + ann, true );
	xhr.onreadystatechange = xmlhttpreponse;
	xhr.send( null );
 
}
function xmlhttpreponse(){

 if ( xhr.readyState == 4 ) {
 		//alert(xhr.responseText);
 		xhr = null;
 		document.location.reload();
  }	 
}

//var WMP7;

//function isWMP7()
//{
//    if(window.ActiveXObject)
//    {
//        WMP7 = new ActiveXObject("WMPlayer.OCX.7");
//    }
//    else if (window.GeckoActiveXObject)
//    {
//         WMP7 = new GeckoActiveXObject("WMPlayer.OCX.7");
//    }
//    return WMP7;
//}

function Video(_url)
{
   window.open(_url + "&wmp7=true", "Video", "width=500, height=350, status=yes,toolbar=no");
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


var type = null;
var sec = null;
var surf = null;

function submitRecherche()
{
    type = document.getElementById("type") 
    //sec = document.getElementById("sec") 
    //surf = document.getElementById("surf") 
    surf = document.getElementById("divsurf").childNodes[0] ;
    
    // Type d'acqusition
    /*if (document.getElementById("loc_nantes").checked) {
        if (document.getElementById("acquisit_nantes").checked){
            type.value = "3";
        } else {
            type.value = "1";
        }
    } else {
         if (document.getElementById("acquisit_nantes").checked){
            type.value = "2";
        } else {
             type.value = "0";
        }
    }*/
       
    // Surface
    str = "";
    if (document.getElementById("sup_inf_200").checked ){ str = "1_";}
    if (document.getElementById("sup_200_500").checked ){ str = str + "2_";}
    if (document.getElementById("sup_500_1000").checked ){ str = str + "3_";}
    if (document.getElementById("sup_sup_1000").checked ){ str = str + "4";}
    surf.value = str;
        
    // Secteurs
//    str = "";
//    if (document.getElementById("NantesCentre").checked) { str = "2_"; }
//    if (document.getElementById("NantesEst").checked) { str = str + "3_"; }
//    if (document.getElementById("NantesOuest").checked) { str = str + "5_"; }
//    if (document.getElementById("NantesSud").checked) { str = str + "8_"; }
//    if (document.getElementById("tous").checked) { str = ""; }
//    sec.value = str;
  
    //document.rech_fast_form.submit();
    document.form1.submit();
}

function submitRechMin()
{
    if(document.getElementById("divsurf")!=null)
    {
        surf = document.getElementById("divsurf").childNodes[0] ;
        // Surface
        str = "";
        if (document.getElementById("sup_inf_200").checked ){ str = "1_";}
        if (document.getElementById("sup_200_500").checked ){ str = str + "2_";}
        if (document.getElementById("sup_500_1000").checked ){ str = str + "3_";}
        if (document.getElementById("sup_sup_1000").checked ){ str = str + "4";}
        surf.value = str;
      
        //document.rech_fast_form.submit();
        //document.form1.submit();

    }
}
