


//-----------------------------------------------------------------------------------------------------
// creation d'un http object
//-----------------------------------------------------------------------------------------------------
function getHTTPObject() {
	var xmlhttp;
	/*@cc_on
	@if (@_jscript_version >= 5)
	try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {
	try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) {
	xmlhttp = false;
	}
	}
	@else
	xmlhttp = false;
	@end @*/
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
		try {
			xmlhttp = new XMLHttpRequest();
		} catch (e) {
			xmlhttp = false;
		}
	}
	return xmlhttp;
}


//-----------------------------------------------------------------------------------------------------
// remplace une chaine de caractere par une autre dans un texte
//-----------------------------------------------------------------------------------------------------
function str_replace(searchWord,replaceWord,chaine) {
	
	var recommence = 1;
	
	while (recommence==1) {
		if(chaine.search(searchWord)==-1) {
			recommence=0;
		} else {
			chaine = chaine.replace(searchWord,replaceWord);
		}
	}
	return chaine;
}


//-----------------------------------------------------------------------------------------------------
// met en forme une chaine de caracteres
//-----------------------------------------------------------------------------------------------------
String.prototype.toUcFirst = function () {
   var firstLetter = this.substr(0,1).toUpperCase()
   return this.substr(0,1).toUpperCase() + this.substr(1,this.length);
}
String.prototype.toUcWords = function(){
     return this.toLowerCase().replace(/\w+/g,function(s){
          return s.charAt(0).toUpperCase() + s.substr(1);
     })
}

function gId(id){
    return window.document.getElementById(id) ;
}

function load_sound(year,rep,file)  {
//vol.php
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="200" height="20" align="middle">\n'); 
document.write('<param name="movie" value="/img/flash/dewplayer.swf?mp3=/mp3/'+year+'/'+rep+'/'+file+'.mp3" />\n'); 
document.write('<param name="quality" value="high" />\n'); 
document.write('<param name="menu" value="false" />\n'); 
document.write('<param name="bgcolor" value="#FFFFFF" />\n'); 
document.write('<param name="wmode" value="transparent" />\n'); 
document.write('<embed swliveconnect="true" wmode="transparent" src="/img/flash/dewplayer.swf?mp3=/mp3/'+year+'/'+rep+'/'+file+'.mp3" quality=high bgcolor=#ffffff width=200  height=20  type="application/x-shockwave-flash"  flashvars="" pluginspage="http://www.macromedia.com/go/getflashplayer"  \n'); 
document.write('</embed>\n'); 
document.write('</object>\n'); 
}
