function Print()
{
	var theLink = document.location.href;
	if(theLink.indexOf('#') != '-1'){
		var tableau=theLink.split('#');
		theLink = tableau[0];
	}
	if(theLink.indexOf('?') == '-1'){
		theLink = theLink+'?print=on';
	}else{
		theLink = theLink+'&print=on';
	}	
	window.open(theLink,'popUpImpression','scrollbars=yes,width=785,height=500'); return false;
}

function PrintCareers()
{
	var theLink = document.location.href;
	if(theLink.indexOf('#') != '-1'){
		var tableau=theLink.split('#');
		theLink = tableau[0];
	}
	if(theLink.indexOf('?') == '-1'){
		theLink = theLink+'?print=on';
	}else{
		theLink = theLink+'&print=on';
	}	
	window.open(theLink,'popUpImpression','scrollbars=yes,width=925,height=500'); return false;
}


function PopupLink(theLink, title, params)
{

	if(theLink.indexOf('#') != '-1'){
		var tableau=theLink.split('#');
		theLink = tableau[0];
	}
	
	if(theLink.indexOf('?') == '-1'){
		theLink = theLink+'?print=on';
	}else{
		theLink = theLink+'&print=on';
	}
	
	window.open(theLink,title,params); return false;
}

function AddToFavoris(){
	
var chr = 'CTRL-D';
var agt=navigator.userAgent.toLowerCase();
if(agt.substr(agt.indexOf('opera')+6,1) < 9) chr = 'CTRL-T';

if ( navigator.appName != 'Microsoft Internet Explorer' ) 
{ window.sidebar.addPanel(document.title, self.location,""); } 
else {
		window.external.AddFavorite(self.location, document.title); 
}
}

//foncions propores à tinymce
function writeFlash(p) {
	writeEmbed(
		'D27CDB6E-AE6D-11cf-96B8-444553540000',
		'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
		'application/x-shockwave-flash',
		p
	);
}

function writeAudio(p) {
	writeFlash(p);
}

function writeShockWave(p) {
	writeEmbed(
	'166B1BCA-3F9C-11CF-8075-444553540000',
	'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0',
	'application/x-director',
		p
	);
}

function writeQuickTime(p) {
	writeEmbed(
		'02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',
		'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0',
		'video/quicktime',
		p
	);
}

function writeRealMedia(p) {
	writeEmbed(
		'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA',
		'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
		'audio/x-pn-realaudio-plugin',
		p
	);
}

function writeWindowsMedia(p) {
	p.url = p.src;
	writeEmbed(
		'6BF52A52-394A-11D3-B153-00C04F79FAA6',
		'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701',
		'application/x-mplayer2',
		p
	);
}

function writeEmbed(cls, cb, mt, p) {
	
	var h = '', n;

	h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"';
	h += typeof(p.id) != "undefined" ? 'id="' + p.id + '"' : '';
	h += typeof(p.name) != "undefined" ? 'name="' + p.name + '"' : '';
	h += typeof(p.width) != "undefined" ? 'width="' + p.width + '"' : '';
	h += typeof(p.height) != "undefined" ? 'height="' + p.height + '"' : '';
	h += typeof(p.align) != "undefined" ? 'align="' + p.align + '"' : '';
	h += '>';

	for (n in p)
		h += '<param name="' + n + '" value="' + p[n] + '">';

	h += '<embed type="' + mt + '"';

	for (n in p)
		h += n + '="' + p[n] + '" ';

	h += '></embed></object>';

	document.write(h);
}


/* efface les scripts ce qui force a la non regénération du script 
	Julien Houvion le 13/10/2008 */
$(document).ready( 
	function () {
		$('.media_script').each(
			function() {
				this.parentNode.removeChild(this);
			}
		);
	}
);
function getURLParam(strParamName){
  var strReturn = "";
  var strHref = window.location.href;
  if ( strHref.indexOf(strParamName) > -1 ){//si le param existe
	  if ( strHref.indexOf("?") > -1 ){//cas url avec ?
	    var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
	    var aQueryString = strQueryString.split("&");
	    for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
	      if (
	aQueryString[iParam].indexOf(strParamName.toLowerCase() + "=") > -1 ){
	        var aParam = aQueryString[iParam].split("=");
	        strReturn = aParam[1];
	        break;
	      }
	    }
	  }else{//cas url récrite
	  	var strQueryString = strHref.substr(strHref.indexOf(strParamName)).toLowerCase();
	    strQueryString = strQueryString.substr(0,strQueryString.indexOf("/"))
		strReturn  = strQueryString.replace(strParamName.toLowerCase(),"");
	  }
  }
  return unescape(strReturn);
}


function openPopUpTranscript(Href,popUpTitle,scrollbars,width,height){
	if(getURLParam('cid')!=""){
		Href = Href + "&pid=1&cid=" +getURLParam('cid');
	}else if(getURLParam('pid')!=""){
		Href = Href + "&pid=" +getURLParam('pid')+ "&cid=" +getURLParam('cid');
	}
	window.open(Href,popUpTitle,scrollbars,width,height);
	return false;
}
////