/****************************	VIEW CONTROLLERS   *****************************/
function goToCountryPage(obj) {
	if ( obj.options[obj.selectedIndex].value != '' )
		document.countryFRM.submit()
}
function goToSubjectPage(id) {
	if ( id != '' ) {
		document.subjectFRM.subject.value = id;
		document.subjectFRM.submit();
	}
}
function goToProfile(aid,tid) {
	xGetElementById("aid").value = aid;
	xGetElementById("tid").value = tid;
	document.tFRM.submit();
}
function goToInstitution(iid) {
	xGetElementById("iid").value = iid;
	document.iFRM.submit();
}
function goToProject(pid) {
	xGetElementById("pid").value = pid;
	document.pFRM.submit();
}
function goToCountry(id) {
	var _obj = document.countryFRM.country;
	for ( i = 0; i < _obj.options.length; i++ ) {
		if ( _obj.options[i].value == id ) {
			_obj.selectedIndex = i;
			goToCountryPage(_obj);
		}
	}
}
/******************************	 DATA RETRIEVAL   ******************************/
function loadCloud(lang) {
	var loader = new net.ContentLoader("/ajax/portal.cfm?lang=" + lang + "&req=SUBJECT_CLOUD",onLoadCloudResult,onLoadCloudError,"GET","");
}
function onLoadCloudResult() {
	response = net.CleanResponse(this.req.responseText);
	xGetElementById("tag").innerHTML = response;
}
function onLoadCloudError() {
	response = net.CleanResponse(this.req.responseText);
	xGetElementById("error").innerHTML = response;
}
function loadToday(lang) {
	var loader = new net.ContentLoader("/ajax/portal.cfm?lang=" + lang + "&req=LOAD_TODAY_INFO",onLoadTodayResult,onLoadTodayError,"GET","");
}
function onLoadTodayResult() {
	response = net.CleanResponse(this.req.responseText);
	xGetElementById("today_s").innerHTML = response;
}
function onLoadTodayError() {
	response = net.CleanResponse(this.req.responseText);
	xGetElementById("error").innerHTML = response;
}