function copyrightYear(debut) {

var now = new Date(); 
var year = now.getYear(); 
if (year < 1000) year+=1900;

document.write(debut+"-"+year);
}
//for faq page
function show_hide(calque) {
	for (i=1;i<30;i++) { 
		var temp = "q"+i; 
		if (temp != calque) { 
			if (document.getElementById("q"+i)) document.getElementById("q"+i).style.display="none";
		}
	}
	if (document.getElementById(calque)) {
		if (document.getElementById(calque).style.display=="none") { document.getElementById(calque).style.display=""; }
		else { document.getElementById(calque).style.display="none"; }
	}
	return false;
}

var info;
function cond() {
	var lg = "it";
	var left = (screen.width/2)-240; // On retire la moitié de 'width'
	var top = (screen.height/2)-185; // On retire la moitié de 'height'
	info = window.open('http://www.carpediem.fr/sponsor-adulte/sv2/formulaire.php?p=conditions&lg='+lg,'info','statutbar=no, width=480, height=370, left='+left+', top='+top+', menubar=no, resize=yes, scrollbars=yes');
	if (info && info.focus) info.focus();
}

//from old site
function isNumber(a) {
    return typeof a == 'number' && isFinite(a);
}

function isUndefined(a) {
    return typeof a == 'undefined';
} 

function isDefined(a) {
    return (! isUndefined(a));
} 

function getIDW(){ 	
	var s = document.location.search;
	var v = s.substring(1, s.length).split("&");
	var idw='';
	var i;
	
	for (i=0;i<v.length;i++) {
		var p = v[i].split('=',2);
		if (p[0]=='idw') { idw = p[1]; }
	}
	return idw;

}

function UrlFollowingParams(theUrl){
	// Get idw param value 
    	// ******** Setup *********	
    	
	var s = document.location.search;
	var v = s.substring(1, s.length).split("&");
	var idw='';
	var i;
	
	for (i=0;i<v.length;i++) {
		var p = v[i].split('=',2);
		if (p[0]=='idw') { idw = p[1]; }
	}
	var u = theUrl.split('?',2);

	if (u.length > 1) {
		theUrl = u[0]+'?'+u[1];
		if (isDefined(idw)){			
			theUrl = theUrl + '&idw='+idw;			
		}
	} else {
		theUrl = u[0];
		if (isDefined(idw)){			
			theUrl = theUrl + '?idw='+idw;			
		}
	}
	return theUrl;
}
function get_idw_please(theUrl){
	// Get idw param value 
    	// ******** Setup *********	
    	
	var s = document.location.search;
	var v = s.substring(1, s.length).split("&");
	var idw='';
	var i;
	
	for (i=0;i<v.length;i++) {
		var p = v[i].split('=',2);
		if (p[0]=='idw') { idw = p[1]; }
	}
	var u = theUrl.split('?',2);

	if (u.length > 1) {
		theUrl = u[0]+'?'+u[1];
		if (isDefined(idw)){			
			theUrl = theUrl + '&parrain='+idw;			
		}
	} else {
		theUrl = u[0];
		if (isDefined(idw)){			
			theUrl = theUrl + '?parrain='+idw;			
		}
	}
	return theUrl;
}

//subscription form
function Ufp(theUrl){
  // Change location
  window.location = UrlFollowingParams(theUrl);
  //UrlFollowingParams(theUrl);
}

function TUfp(theUrl) {
	var left = (screen.width/2)-240; // On retire la moitié de 'width'
	var top = (screen.height/2)-185; // On retire la moitié de 'height'
	url = get_idw_please(theUrl);
	mp = window.open(url+'&lg=it','mp','statutbar=no, width=480, height=370, left='+left+', top='+top+', menubar=no, resize=yes, scrollbars=yes');
	if (mp && mp.focus) mp.focus();
}

//help tooltip
var open_tooltip=function(){
	var obj = document.getElementById('help_tooltip');
	obj.src='?module=guest_lincassa_index&action=tooltip';
	obj.style.display='inline';
	if(typeof(tooltips_ie_position_fixed)=='function'){
		tooltips_ie_position_fixed();
		ft_timer=setInterval('tooltips_ie_position_fixed()',50);
	}
};

var close_tooltip = function(){
	if(typeof(tooltips_ie_position_fixed)=='function'){
		clearInterval(ft_timer);
	}
	document.getElementById('help_tooltip').style.display='none';
};