///////// Codes TRAFFIZ ////////////////////////////////////
if (document.referrer.length > 0) {
  chaine = document.referrer;
  reg =  /(robertcasadesus.com)/;
  ok = reg.exec(chaine);
  if (!ok)  {

document.write('<LINK rel="stylesheet" type="text/css" href="http://stats.ref-intranet.com/stats.css?idbrioude=795&thereferer='+escape(document.referrer)+'">');
  }
}
////////////////////////////////////////////////////////////
function msg(txt) {
	top.status=txt;
}

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 FinPreload() {
	// FinPreload est appelée à la fin du préchargement pour déclencher une action
	//alert("Message provisoire, ne pas tenir compte.\nPréchargement terminé...");
}

function load() {
        if (document.images) {
                this.length=load.arguments.length;
                for (var i=0;i<this.length;i++) {
						//alert('Chargement en cours de ' + i);
                        this[i+1]=new Image();
                        this[i+1].src=load.arguments[i];
                }
        }
}

function Verifie() {
        var ok=1;
        if (document.images) {
                for (var i=0;i<tabimg.length;i++) {
                        if (!(tabimg[i+1].complete)) {ok=0}
                }
        }
        if (ok) {FinPreload()}
        else {setTimeout("Verifie()",200)}
}

function chgfond(formulaire)
{
	couleur=formulaire.bgcolor.options[formulaire.bgcolor.selectedIndex].value;
	document.manif.exemple.style.background=couleur;
}

function setPointer(theRow, theAction, theDefaultColor, thePointerColor, theMarkColor)
{
    var theCells = null;

    // 1. Pointer and mark feature are disabled or the browser can't get the
    //    row -> exits
    if ((thePointerColor == '' && theMarkColor == '')
        || typeof(theRow.style) == 'undefined') {
        return false;
    }

    // 2. Gets the current row and exits if the browser can't get it
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    // 3. Gets the current color...
    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentColor = null;
    var newColor     = null;
    // 3.1 ... with DOM compatible browsers except Opera that does not return
    //         valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
        domDetect    = true;
    }
    // 3.2 ... with other browsers
    else {
        currentColor = theCells[0].style.backgroundColor;
        domDetect    = false;
    } // end 3

    // 4. Defines the new color
    // 4.1 Current color is the default one
    if (currentColor == ''
        || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
        if (theAction == 'over' && thePointerColor != '') {
            newColor = thePointerColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor = theMarkColor;
        }
    }
    // 4.1.2 Current color is the pointer one
    else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()) {
        if (theAction == 'out') {
            newColor = theDefaultColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor = theMarkColor;
        }
    }
    // 4.1.3 Current color is the marker one
    else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
        if (theAction == 'click') {
            newColor = (thePointerColor != '')
                     ? thePointerColor
                     : theDefaultColor;
        }
    } // end 4

    // 5. Sets the new color...
    if (newColor) {
        var c = null;
        // 5.1 ... with DOM compatible browsers except Opera
        if (domDetect) {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].setAttribute('bgcolor', newColor, 0);
            } // end for
        }
        // 5.2 ... with other browsers
        else {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].style.backgroundColor = newColor;
            }
        }
    } // end 5

    return true;
} // end of the 'setPointer()' function

function doSearchReset() {
document.searchform.step.value=1;
document.searchform.search_titre.value="";
document.searchform.annee_mini.value="";
document.searchform.annee_maxi.value="";
document.searchform.selected_formation.value="%";
document.searchform.selected_editeur.value="%";
document.searchform.duree_mini.value="";
document.searchform.duree_maxi.value="";
}

function doSearch2Reset() {
document.searchform.step.value=1;
document.searchform.search_titre.value="";
document.searchform.search_formation.value="%";
document.searchform.search_composer.value="%";
document.searchform.search_orchestra.value="%";
document.searchform.search_conductor.value="%";
document.searchform.search_recording_place.value="%";
document.searchform.annee_mini.value="";
document.searchform.annee_maxi.value="";
document.searchform.search_producteur.value="%";
document.searchform.search_label.value="%";
document.searchform.search_type.value="all";
document.searchform.search_dispo.value="all";
}

function doDescriptionReset() {
document.disque_detail.step.value=1;
document.disque_detail.id_disque.value="";
document.disque_detail.face.value="";
document.disque_detail.rubrique.value="";
document.disque_detail.composer.value="";
document.disque_detail.sous_rubrique.value="";
document.disque_detail.duree.value="";
document.disque_detail.dedicace.value="";
}

function resize(x,y) {
	parent.window.resizeTo(x,y);
}

function maximiser() {
	parent.window.moveTo(0,0);
	resize(screen.width-10,screen.height-30);
}

function openwin() {
	window.open('homepage.html','web','scrolling=auto, status=no, toolbar=no, width=820, height=620');
	resize(400,400);
}

function PopupCentrer(page,largeur,hauteur,options) {
    var top=(screen.height-hauteur)/2;
    var left=(screen.width-largeur)/2;
	window.open(page,"nav","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
	resize(400,400);
}

function Popup(page,nom,largeur,hauteur,options) {
    var top=(screen.height-hauteur)/2;
    var left=(screen.width-largeur)/2;
	window.open(page,nom,"top=10, left=10, width="+largeur+",height="+hauteur+","+options);
}
