
function popupPage(l, t, w, h, URL, name) 
{
var windowprops = "location=no,scrollbars=no,menubars=no,toolbars=no,resizable=yes" + ",left=" + l + ",top=" + t + ",width=" + w + ",height=" + h;
popup = window.open(URL,name ,windowprops);

}


function popupPage_scroll(l, t, w, h, URL, name) 
{
var windowprops = "location=no,scrollbars=yes,menubars=no,toolbars=no,resizable=yes" + ",left=" + l + ",top=" + t + ",width=" + w + ",height=" + h;
popup = window.open(URL,name ,windowprops);

}


function popupPage_auto(l, t, w, h, URL, name) 
{
var windowprops = "location=no,scrollbars=auto,menubars=no,toolbars=no,resizable=yes" + ",left=" + l + ",top=" + t + ",width=" + w + ",height=" + h;
popup = window.open(URL,name ,windowprops);

}

function popupPage_centre(w, h, URL, name) 
{
var windowprops = "location=no,scrollbars=auto,menubars=no,toolbars=no,resizable=yes" + ",left=(screen.height-hauteur)/2,top=(screen.width-largeur)/2,width=" + w + ",height=" + h;
popup = window.open(URL,name ,windowprops);

}

/*
function flvPlayer(w,h,URL,thumb,autostart) 
{
/* hauteur du swf + barre du player-> +20 px */
/*
h=h+20;
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + w + '"  height="' + h + '">\n'); 
document.write(' <param name="movie" value="../../swf/flvplayer.swf?&file=../flv/' + URL + '&image=../../images/' + thumb + '&autostart=' + autostart + '&lightcolor=0xFF0000&showfsbutton=false&showdigits=false">\n');
document.write('<param name="wmode" value="transparent">\n'); 
document.write(' <param name="quality" value="high">\n'); 
document.write(' <embed src="../../swf/flvplayer.swf?&file=../flv/' + URL + '&image=../../images/' + thumb + '&autostart=' + autostart + '&lightcolor=0xFF0000&showfsbutton=false&showdigits=false" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + w + '"  height="' + h + '" wmode="transparent"></embed></object>\n');
document.write('</object>\n');
}*/

function parseQueryString (str)
{
	str = str ? str : location.search;
	var query = str.charAt(0) == '?' ? str.substring(1) : str;
	var args = new Object();
	if (query)
	{
		var fields = query.split('&');
		for (var f = 0; f < fields.length; f++)
		{
			var field = fields[f].split('=');
			args[unescape(field[0].replace(/\+/g, ' '))] = unescape(field[1].replace(/\+/g, ' '));
		}
	}
	return args;
}
function initHomePageDisplay(pLanguage)
{
	var dt = new Date();
	dt.setYear(dt.getYear()+1);
	setCookie("home_language", pLanguage, dt);
	if (pLanguage == "french")
	{
		document.getElementById('divFR').style.display = '';
		document.getElementById('divDE').style.display = 'none';
	}
	else
	{
		document.getElementById('divFR').style.display = 'none';
		document.getElementById('divDE').style.display = '';
	}
}
function initHomePage()
{
	var language = getCookie("home_language");
	if (language == null)
	{
		language = "french";
	}
	var args = parseQueryString ();
	if (args.length != 0)
	{
		var success = false;
		for (var arg in args)
		{
			if (arg == "lang")
			{
				initHomePageDisplay(args[arg]);
				success = true;
			}
		}
		if(!success)
			initHomePageDisplay(language);
	}
	else
	{
		initHomePageDisplay(language);
	}
}
