function alconf(u,s,ps,ts) {
	this.univ=u;
	this.site=s;
	this.prodserver=ps;
	this.testserver=ts;
}

var ALMACONF=new Array();
ALMACONF[ALMACONF.length] = new alconf("70000","demo","demo.almalaurea.it","demo-al.pp.cineca.it");
ALMACONF[ALMACONF.length] = new alconf("70014","unime","jobplacement-unime.almalaurea.it","jobplacement-unime-al.pp.cineca.it");
ALMACONF[ALMACONF.length] = new alconf("70058","iulm","iulm.almalaurea.it","iulm-al.pp.cineca.it");
ALMACONF[ALMACONF.length] = new alconf("70099","unistrapg","placement-unistrapg.almalaurea.it","placement-unistrapg-al.pp.cineca.it");
ALMACONF[ALMACONF.length] = new alconf("70135","uninsubria","uninsubria.almalaurea.it","uninsubria-al.pp.cineca.it");
ALMACONF[ALMACONF.length] = new alconf("70050","liuc","liuc.almalaurea.it","liuc-al.pp.cineca.it");
ALMACONF[ALMACONF.length] = new alconf("70047","unirc","unirc.almalaurea.it","unirc-al.pp.cineca.it");
ALMACONF[ALMACONF.length] = new alconf("70029","uniss","uniss.almalaurea.it","uniss-al.pp.cineca.it");
ALMACONF[ALMACONF.length] = new alconf("70118","unite","unite.almalaurea.it","unite-al.pp.cineca.it");
ALMACONF[ALMACONF.length] = new alconf("70005","unical","placement.unical.it","unical-al.pp.cineca.it");
ALMACONF[ALMACONF.length] = new alconf("70110","unicampus","unicampus.almalaurea.it","unicampus-al.pp.cineca.it");
ALMACONF[ALMACONF.length] = new alconf("70055","univaq","univaq.almalaurea.it","univaq-al.pp.cineca.it");
ALMACONF[ALMACONF.length] = new alconf("70009","unife","jobcentre.unife.it","jobcentre-unife-al.pp.cineca.it");
ALMACONF[ALMACONF.length] = new alconf("70017","unimore","placement.unimore.it","placement-unimore-al.pp.cineca.it");
ALMACONF[ALMACONF.length] = new alconf("70042","unior","placement-unior.almalaurea.it","placement-unior-al.pp.cineca.it");
ALMACONF[ALMACONF.length] = new alconf("70130","unibz","unibz.almalaurea.it","unibz-al.pp.cineca.it");
ALMACONF[ALMACONF.length] = new alconf("70145","unisg","unisg.almalaurea.it","unisg-al.pp.cineca.it");
ALMACONF[ALMACONF.length] = new alconf("70010","unifi","placement.unifi.it","placement-unifi-al.pp.cineca.it");
ALMACONF[ALMACONF.length] = new alconf("70097","unistrasi","placement.unistrasi.it","placement-unistrasi-al.pp.cineca.it");

function almago(azione, popup, query, ateneo, lang, test) {
	var server="";
	var site;
	var univ;
	
	for (var i=0;i<ALMACONF.length;i++) {
		if ((ALMACONF[i].univ==ateneo)||(ALMACONF[i].site==ateneo)) {
			server = (test)?ALMACONF[i].testserver:ALMACONF[i].prodserver;
			site=ALMACONF[i].site;
			univ=ALMACONF[i].univ;
			break;	
		}		 	
	}
	if (server == "") {
		return false;
	}
	switch (azione) {
		case "registrazione":
			url ="https://" + server + "/cgi-bin/aziende/registra_ins_s0.pm?LANG="+lang;
			break;
		case "ricerca":
			url = "https://" + server + "/cgi-bin/aziende/almascelta/almascelta_index.pm?LANG="+lang;
			break;
		case "ricerca_anonima":
			url = "https://" + server + "/cgi-bin/pub/frame.pm?REQUEST_URL=https://www2.almalaurea.it/cgi-asp/collegatoLavoro/Default.aspx&PARAMS=basegeo%3D"+univ+"&AREA=aziende&FRAME_WIDTH=800";
			break;
		case "aiuto":
			url = "https://" + server + "/info/contattaci/contattaci_az.shtml";
			break;
		case "bacheca":
			url = "http://" + server + "/cgi-bin/lau/cercaofferta/search_bo.pm?LANG="+lang;
			break;
		case "cv":
			url = (test)?"http://al.pp.cineca.it/lau/laureati/curriculum/":"http://www.almalaurea.it/lau/laureati/curriculum/";
			break;			
		case "staff":
			url ="https://" + server + "/cgi-bin/vendita/gestione_utenti/search_user.pm?LANG="+lang;
			break;
		case "almaorientati":
			url = "http://orientamento.almalaurea.it/cgi-bin/info/servizi/orientamento/orientamento.pl?PAGE=intro.shtml";
			if (site) url += "&SITE=" + site;
			if (univ) url += "&ATENEO=" + univ;	
			break;
		case "server":
			return server;	
		case "test":
			return true;
		default:
			return false;
	}
	if (query) url += '?'+query;
	if (popup) window.open(url);
	else document.location.href= url;	
}


	
