/*
getContentLocation.js

selectfield and handlers for content locator

created 06-09-2004 oBu
last edited 10-02-2005 js
*/


function contentPicker(chosen) {
	if (chosen!="") {
		page=""+pathPre+"main/cont_loc_"+chosen+"_fr.html";
		
		cookieName="SiBinterestGroup";
		cookieValue=chosen;
		days=365;
		today = new Date();
		
		year=today.getYear();
		if (year<2003) {
			year=2005;
		}
		todays_date = new Date(year,today.getMonth(),today.getDate(),0,0,0);
		expires_date = new Date(todays_date.getTime() + (days * 86400000));
		dExpires=expires_date;
		path="/";
		
		writeCookie(cookieName, cookieValue, dExpires, path, '', '');
		
		document.location.href=page;
	}
}

helper=document.location.href;
helper=helper.split("cont_loc_");

if (helper.length>1) {
	helper=helper[1].split("_fr.html");
	helper=helper[0];
} else {
	helper="index";
}


clsString=""+

"<form name=\"cont_loc\">"+
"<select name=\"topic\" class=\"contentlocator\" onChange=\"contentPicker(document.cont_loc.topic.value)\">"+
"<option value=\"\">choisissez votre profil</option>"+

"<option value=\"general_public\"";
if (helper=="general_public") {
	clsString+=" selected";
}
clsString+=">Grand public</option>"+

"<option value=\"scientist\"";
if (helper=="scientist") {
	clsString+=" selected";
}
clsString+=">Scientifiques</option>"+
"<option value=\"teacher_student\"";
if (helper=="teacher_student") {
	clsString+=" selected";
}
clsString+=">Enseignants/Etudiants</option>"+
"<option value=\"ngo\"";
if (helper=="ngo") {
	clsString+=" selected";
}
clsString+=">ONG</option>"+
"<option value=\"journalist\"";
if (helper=="journalist") {
	clsString+=" selected";
}
clsString+=">Journalistes</option>"+
"<option value=\"consumer_ass\"";
if (helper=="consumer_ass") {
	clsString+=" selected";
}
clsString+=">Associations de consommateurs</option>"+
"<option value=\"retailers\"";
if (helper=="retailers") {
	clsString+=" selected";
}
clsString+=">D&eacute;taillants</option>"+
"<option value=\"policy_makers\"";
if (helper=="policy_makers") {
	clsString+=" selected";
}
clsString+=">D&eacute;cideurs</option>"+
"</select>"+
"</form>"+
"";
document.write(clsString);