window.addEvent('domready', function() {
 
	/**
	 * That CSS selector will find all <a> elements with the
	 * class boxed
	 *
	 * The example loads the options from the rel attribute
	 */
	SqueezeBox.assign($$('a.boxed'), {
		parse: 'rel'
	});
 
});


function createSpecificActions(matricule){
  var url = "http://dial.academielouvain.be:8080/cgi-bin/identify/GetActions.cgi?users="+matricule;
  var http_request = getHTTPRequest();
  if(!http_request){ return false; }
  http_request.onreadystatechange = function(){
    if (http_request.readyState == 4  &&  http_request.status == 200){
      getListAction(http_request.responseXML);
    }
  }
  http_request.open('GET',url,true);
  http_request.send(null);
}
function getListAction(xmlDoc){
  var list = xmlDoc.getElementsByTagName("action");
  for(i=0 ; i<list.length ; i++){
     var name      = list[i].getElementsByTagName("name")[0].firstChild.nodeValue;
     var image_url = list[i].getElementsByTagName("image_url")[0].firstChild.nodeValue;
     var link      = list[i].getElementsByTagName("link")[0].firstChild.nodeValue;
     var target    = list[i].getElementsByTagName("target")[0].firstChild.nodeValue;
     var position  = list[i].getElementsByTagName("position")[0].firstChild.nodeValue;
     addAction(name,image_url,link,target,position);
  }
}
