/*
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+"_en.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("_en.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=\"\">For text version choose your profile here</option>"+

"<option value=\"general_public\"";
if (helper=="general_public") {
	clsString+=" selected";
}
clsString+=">General Public</option>"+

"<option value=\"scientist\"";
if (helper=="scientist") {
	clsString+=" selected";
}
clsString+=">Scientist</option>"+
"<option value=\"teacher_student\"";
if (helper=="teacher_student") {
	clsString+=" selected";
}
clsString+=">Teacher/Student</option>"+
"<option value=\"ngo\"";
if (helper=="ngo") {
	clsString+=" selected";
}
clsString+=">NGOs</option>"+
"<option value=\"journalist\"";
if (helper=="journalist") {
	clsString+=" selected";
}
clsString+=">Journalist</option>"+
"<option value=\"consumer_ass\"";
if (helper=="consumer_ass") {
	clsString+=" selected";
}
clsString+=">Consumer Association</option>"+
"<option value=\"retailers\"";
if (helper=="retailers") {
	clsString+=" selected";
}
clsString+=">Retailers</option>"+
"<option value=\"policy_makers\"";
if (helper=="policy_makers") {
	clsString+=" selected";
}
clsString+=">Policy makers</option>"+
"</select>"+
"</form>"+
"";
document.write(clsString);
