function get_date() {
	var months=new Array(13);
	months[1]="janvier";
	months[2]="f&eacute;vrier";
	months[3]="mars";
	months[4]="avril";
	months[5]="mai";
	months[6]="juin";
	months[7]="juillet";
	months[8]="ao&ucirc;t";
	months[9]="septembre";
	months[10]="octobre";
	months[11]="novembre";
	months[12]="d&eacute;cembre";
	
	var days=new Array(8);
	days[1]="dimanche";
	days[2]="lundi";
	days[3]="mardi";
	days[4]="mercredi";
	days[5]="jeudi";
	days[6]="vendredi";
	days[7]="samedi";
	
	the_time=new Date();
	lmonth=months[the_time.getMonth()+1];
	the_day=days[the_time.getDay()+1];
	the_date=the_time.getDate();
	year=the_time.getYear();
	hours=the_time.getHours();
	if (year<2000){   
	 	year=year+1900; 
	}
	return (the_day + ", " + the_date + " " +  lmonth + " " + year);
}


// parse searchargs
// http://www.cryer.co.uk/resources/javascript/script8.htm
function get_param(name) {
  var start=location.search.indexOf("?"+name+"=");
  if (start<0) start=location.search.indexOf("&"+name+"=");
  if (start<0) return '';
  start += name.length+2;
  var end=location.search.indexOf("&",start)-1;
  if (end<0)end=location.search.length;
  var result=location.search.substring(start,end);
  var result='';
  for(var i=start;i<=end;i++) {
    var c=location.search.charAt(i);
    result=result+(c=='+'?' ':c);
  }

return unescape(result);
// return CharacterEncodeString(unescape(result),'PARTIAL');
// return CharacterEncodeString(decodeURI(result),'PARTIAL');
}


// entification, used in entifiying strings passed via searchargs
function CharacterEncodeString(inputStr, encodingDegree) {
	var htmlEncoded         = "";
	var fullHtmlEncoded     = "";

	for (var i=0; i<inputStr.length; ++i) {
		var chrAtI      = inputStr.charAt(i);
		var chr         = inputStr.charCodeAt(i);

		if (isNaN(chr)) {
			fullHtmlEncoded += chrAtI;
			htmlEncoded += charAtI;
		}
		else {
			fullHtmlEncoded += "&#" + chr + ";";
			if (chrAtI.match(/[\w\s]/)) {
					htmlEncoded += chrAtI;
			}
			else {
					htmlEncoded += "&#" + chr + ";";
			}
		}
	}
	return (encodingDegree.toUpperCase() == "PARTIAL" ? htmlEncoded : fullHtmlEncoded);
} 


// confirm download
function confirm_dl (page_code,dl_size) {
	msg = "Are you sure you want to download the mp3 (zip) archive for this page (" + page_code + ", " + dl_size + " KB) ?";
	res = confirm (msg);
	
	return (res ? true : false);
}

function confirm_dl_zip (page_code,dl_size) {
	msg = "Are you sure you want to download the .zip archive: '" + page_code + "', " + dl_size + " MB ?";
	res = confirm (msg);
	
	return (res ? true : false);
}


// windows
// back to primary window
function main_win_open (the_url)   {
	window.opener.document.location = the_url;
	window.opener.focus();
}

function open_second_win(the_url,width,height,the_win,scroll,tool) {
	win2_params = "titlebar=0,scrollbars=" + scroll + ",toolbar=" + tool + ",resizable=yes,left=0,top=0,width=" + width + ",height=" + height;
	win2 = open (the_url,the_win,win2_params);
	win2.focus();
	if (win2.opener == null) {
		win2.opener = window;
	}
	win2.opener.name = "main_window";    
}

function open_second_win_submit(the_url,width,height,the_win,scroll,tool,form_name) {
	// form name
	the_form = eval('document.forms.' + form_name);
	
	// win2
	win2_params = "titlebar=0,scrollbars=" + scroll + ",toolbar=" + tool + ",resizable=yes,left=0,top=0,width=" + width + ",height=" + height;
	win2 = open (the_url,the_win,win2_params);
	win2.focus();
	if (win2.opener == null) {
		win2.opener = window;
	}
	win2.opener.name = "main_window"; 
	
	// target, submit
	the_form.target=the_win;
	the_form.submit();
}


function open_second_win_cen(the_url,width,height,the_win,scroll,tool) {
	// default
    x = ((1024 - width)/2) - 50;
    y = ((768 - height)/2) - 50;
    
    if (screen) {
        y = ((screen.availHeight - height)/2) - 50;
        x = ((screen.availWidth - width)/2) - 50;
    }
    
	win2_params = "titlebar=0,scrollbars=" + scroll + ",toolbar=" + tool + ",resizable=1,screenX=" + x + ",screenY=" + y +",left=" + x + ",top=" + y +",width=" + width + ",height=" + height;
	win2 = open (the_url,the_win,win2_params);
	win2.focus();
	if (win2.opener == null) {
		win2.opener = window;
	}
	win2.opener.name = "main_window";    
}

function openQTwin(the_url,width,height,the_win)   {
	win2_params = "resizable=1,scrollbars=0,left=0,top=0,width="+width+",height="+height;
	win2 = open (the_url,the_win,win2_params);
	win2.focus();
	win2.opener.name = "main_window";    
} 

function open_aud(base_url,m,mt,ti,st,width,height,thewin) {
	the_url = base_url + "?m=" + m + "&mt=" + mt + "&ti=" + escape(ti) + "&st=" + escape(st);
	win2params = "resizable=1,scrollbars=0,left=0,top=0,width="+width+",height="+height;
	win2 = open (the_url,thewin,win2params);
	win2.focus();
} 

function jump(targ,selObj,restore) {
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
}


// mm
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

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_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_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];}
}

//reloads the window if Nav4 resized
function MM_reloadPage(init) {  
  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);