//###legals popup function
if(typeof mentions_legales == 'undefined'){//every param and the func can be set outside this js
	function mentions_legales() {
		var legal=window.open(legals_link, 'legals_popup', 'top=100,left=100,width=600,height=375,location=0,resizable=1,status=0');
	}
}

//###different languages link texts
if(typeof legals_lg == 'undefined') legals_lg = 'fr';
//check the lg in allowed values
else{
	if(legals_lg == 'us') legals_lg = 'en';
	if(legals_lg != 'fr'
		&& legals_lg != 'en'
		&& legals_lg != 'es'
		&& legals_lg != 'it'
		&& legals_lg != 'de'){
	legals_lg = 'fr';
	}
}
//the link text
if(typeof legals_link_texts == 'undefined'){
	var legals_link_texts = {'fr':'Informations&nbsp;légales',
				'en':'Legal information',
				'es':'Información legal',
				'it':'Informazioni legali',
				'de':'Rechtliche informationen'};
}
var legals_link_text = eval('legals_link_texts.'+legals_lg);
//the popup window url
if(typeof legals_link == 'undefined'){
	if(typeof legals_url_live != 'undefined' && legals_url_live == 1){//some sites have special live legals page with other info
		var legals_link_urls = {'fr':'http://www.carpediem.fr/infos-legales/infos_legales_live_fr.html',
				'en':'http://www.carpediem.fr/infos-legales/infos_legales_live_uk.html',
				'es':'http://www.carpediem.fr/infos-legales/infos_legales_live_es.html',
				'it':'http://www.carpediem.fr/infos-legales/infos_legales_live_it.html',
				'de':'http://www.carpediem.fr/infos-legales/infos_legales_de.html'};//no live url given here for now
	}
	else{
		var legals_link_urls = {'fr':'http://www.carpediem.fr/infos-legales/infos_legales_fr.html',
				'en':'http://www.carpediem.fr/infos-legales/infos_legales_uk.html',
				'es':'http://www.carpediem.fr/infos-legales/infos_legales_es.html',
				'it':'http://www.carpediem.fr/infos-legales/infos_legales_it.html',
				'de':'http://www.carpediem.fr/infos-legales/infos_legales_de.html'};
	}
	var legals_link = eval('legals_link_urls.'+legals_lg);
}
//###custom params check
//color
if(typeof legals_color == 'undefined') legals_color = '#000000';
//link font size
if(typeof legals_link_font_size == 'undefined') legals_link_font_size = 12;

//popup dimensions overwrite
//...

//other window params
//...

//first use the style for the font size and other common params
document.write('<style>\
	#legals_link {\
		font-size:'+legals_link_font_size+'px;\
		font-family: Verdana;\
		color:'+legals_color+';\
		padding-top: 0px;\
	}\
</style>');
//then overwrite it if any new styles are set
	//custom_styles -- all design params can be passed as a CSS style
	//example: var custom_styles = '#legals_link {color: black; font-size:12px;text-decoration: none;}';
	//example: var custom_styles = '#legals_link font{color: red;}';
if(typeof legals_custom_styles != 'undefined'){
	document.write('<style>'+legals_custom_styles+'</style>');
}

if(typeof legals_test != 'undefined' && legals_test == 1){
	//may put other info here..
	alert('legals_link_text = ' + legals_link_text);
}

document.write('\
	<a href="javascript:void(0);" id="legals_link" name="legals_link" onclick="mentions_legales()" target="_self">'+legals_link_text+'</a>\
');
