<!--

function showMenu(id){
if (document.getElementById(id).style.visibility == "hidden") {
document.getElementById(id).style.visibility = "visible";
} else {
document.getElementById(id).style.visibility = "hidden";
}
if (document.getElementById(id).style.display == "none") {
document.getElementById(id).style.display= "block";
} else {
document.getElementById(id).style.display= "none";
}
}
function showCapas(){
document.getElementById("segonfons").style.visibility="visible";
document.getElementById("agendagran").style.visibility="visible";
}
function loadAgenda(any,mes,aula){
try 
{ 
xmlhttp = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) { 
} 
xmlhttp.onreadystatechange = sicanvia;
xmlhttp.open("GET", "../commons/agenda_main.php?any="+any+"&mes="+mes+"&aula="+aula,"true");
xmlhttp.send(null);
}

function unLoadAgenda(){
document.getElementById("segonfons").style.visibility="hidden";
document.getElementById("agendagran").style.visibility="hidden";
}
function sicanvia(){
if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200)) {
document.getElementById("agendamain").innerHTML = xmlhttp.responseText;
}
}
function getActes(any,mes,dia,aula){
try 
{ 
xmlhttp = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) { 
} 
xmlhttp.onreadystatechange = canviag;
xmlhttp.open("GET", "../commons/listactes_agenda.php?any="+any+"&mes="+mes+"&dia="+dia+"&aula="+aula,"true");
xmlhttp.send(null);
}
function canviag(){
if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200)) {
document.getElementById("listagenda").innerHTML = xmlhttp.responseText;
}
}
function gotoAula(laula){
	if (laula == "sa0") {
		location.href = "http://www.obsym.org/";
	} else {
		var site = "http://www.universidadpacientes.org/";
location.href = site+"aula-"+laula+"/";
}}
function loadContent(id){
valorid = id;
try 
{ 
xmlhttp = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) { 
} 
xmlhttp.onreadystatechange = sicanviac;
xmlhttp.open("GET", "../../commons/ficha.php?id="+encodeURI(valorid),"true");
xmlhttp.send(null);
}
function sicanviac(){
if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200)) {
document.getElementById(valorid).innerHTML = xmlhttp.responseText;
}
}
function unLoad(valorid){
document.getElementById(valorid).innerHTML = "<a href=\"#\" onClick=\"loadContent('"+eval(valorid)+"'); return false;\">Ficha</a>";
}
function checkForm(){
	document.getElementById("nomwarning").style.visibility = "hidden";
		document.getElementById("nomwarning").style.display = "none";
		document.getElementById("mailwarning").style.visibility = "hidden";
		document.getElementById("mailwarning").style.display = "none";
	var checkform = true;
	var nom = document.getElementById("nom").value;
	if (nom == "") {
		document.getElementById("nomwarning").style.visibility = "visible";
		document.getElementById("nomwarning").style.display = "block";
		checkform = false;
	}
var correu=document.getElementById("correu").value;
var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if (filter.test(correu))
checkform=true;
else{
document.getElementById("mailwarning").style.visibility = "visible";
		document.getElementById("mailwarning").style.display = "block";
checkform=false;
}
return checkform;
}
function showImgBook(arxiu){
	document.getElementById("containerimg").innerHTML = "<img src='img/"+arxiu+".gif' class='quadre' style='padding: 4px;'>";
}
function loadVideo(file){
try 
{ 
xmlhttp = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) { 
} 
xmlhttp.onreadystatechange = sicanviad;
xmlhttp.open("GET", "videoview.php?file="+encodeURI(file),"true");
xmlhttp.send(null);
}
function sicanviad(){
if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200)) {
document.getElementById("thePlayer").innerHTML = xmlhttp.responseText;
}
}
//-->