// img preload 
var myimages=new Array()
function preloadimages(){
for (i=0;i<preloadimages.arguments.length;i++){
myimages[i]=new Image()
myimages[i].src=preloadimages.arguments[i]
}
}
// img list
preloadimages("img/shim.gif","img/f_right.gif","img/pointHoriz.gif","img/bottom_shadow_left.jpg","img/dashed_bottom.gif","img/bottom_shadow_right.jpg","img/corner_bottom_shadow_left.jpg","img/shadow_bottom.jpg","img/corner_bottom_shadow_right.jpg","img/shadow_left.jpg","img/txt_bg2.jpg","img/shadow_right.jpg")
//
//
function nav(currentClick) {
        if (currentClick=='soon') {
        alert ('Prochainement');
        }
        if (currentClick=='events') {
                window.location='events.asp';
		//alert ('Prochainement');
        }
        if (currentClick=='presentation') {
                window.location='presentation.asp';
        }
        if (currentClick=='infrastructures') {
                window.location='congres_et_seminaires.asp';
        }
        if (currentClick=='agenda') {
                window.location='agenda_culturel.asp';
        }
        if (currentClick=='contacts') {
                window.location='contacts.asp';
        }
        if (currentClick=='intro') {
                window.location='../fr/index.asp';
        }
}
function popup(photospopup) {
        if (photospopup=='ok') {
                winl = (screen.width - 485) / 2;
                wint = (screen.height - 480) / 2;
                window.open('popup_photos.asp','popup','toolbar=0,location=0,directories=0,status=0,scrollbars=0,resizable=0,menuBar=0,top='+wint+',left='+winl+',width=485,height=480')
        }
}


function map(nom,adresse) {
                if (nom=='printmap') {
                winl = (screen.width - 690) / 2;
                wint = (screen.height - 500) / 2;
                window.open(adresse,'printmap','toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=0,menuBar=0,top='+wint+',left='+winl+',width=690,height=500')
        }
}

function agenda_culturel_infos(nom,adresse) {
                if (nom=='agenda_culturel_infos_1') {
                winl = (screen.width - 550) / 2;
                wint = (screen.height - 500) / 2;
                window.open(adresse,'agenda_culturel_infos_1','toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=0,menuBar=0,top='+wint+',left='+winl+',width=550,height=500')
        }
		        if (nom=='agenda_culturel_infos_2') {
                winl = (screen.width - 550) / 2;
                wint = (screen.height - 500) / 2;
                window.open(adresse,'agenda_culturel_infos_2','toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=0,menuBar=0,top='+wint+',left='+winl+',width=550,height=500')
        }
		        if (nom=='agenda_culturel_infos_3') {
                winl = (screen.width - 550) / 2;
                wint = (screen.height - 500) / 2;
                window.open(adresse,'agenda_culturel_infos_3','toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=0,menuBar=0,top='+wint+',left='+winl+',width=550,height=500')
        }
		        if (nom=='agenda_culturel_infos_4') {
                winl = (screen.width - 550) / 2;
                wint = (screen.height - 500) / 2;
                window.open(adresse,'agenda_culturel_infos_4','toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=0,menuBar=0,top='+wint+',left='+winl+',width=550,height=500')
        }
}
function agenda_culturel_photos_sup(nom,adresse) {
                if (nom=='agenda_culturel_photos_sup') {
                winl = (screen.width - 500) / 2;
                wint = (screen.height - 500) / 2;
                window.open(adresse,'agenda_culturel_photos_sup','toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=0,menuBar=0,top='+wint+',left='+winl+',width=500,height=500')
        }
}
// fonctions checkmailform

function testEmail(src) {
     var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
     var regex = new RegExp(emailReg);
     return regex.test(src);
  }

var errfound = false;

function error(elem, text) {
if (errfound) return;
window.alert(text);
elem.select();
elem.focus();
errfound = true;
}

function checkmailform(f) {

errfound = false;

if (f.nom.value == "")
error(f.nom,"Entrez votre nom svp");

if (f.prenom.value == "")
error(f.prenom,"Entrez un prénom svp");

if (f.email.value =="" || !testEmail(f.email.value))
error(f.email,"Entrez une adresse e-mail correcte svp");

if (f.commentaires.value == "")
error(f.commentaires,"Entrez un commentaire svp");

return ! errfound;
}

// fonctions checkagendaform

function testEmail(src) {
     var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
     var regex = new RegExp(emailReg);
     return regex.test(src);
  }

function verifNombre (nb) 
{
   if ( isNaN (nb) ){
     return false;
   }else{ 
     return true;
	 }
}

var errfound = false;

function error(elem, text) {
if (errfound) return;
window.alert(text);
elem.select();
elem.focus();
errfound = true;
}

function checkagendaform(f) {

errfound = false;

if (f.date_et_heure.value == "")
error(f.date_et_heure,"Veuillez choisir une date svp");
// a modifier
//if (f.TARIF_A.value <=0 || !verifNombre(f.TARIF_A.value))
//error(f.TARIF_A,"Veuillez choisir une(des) place(s) dans la(les) catégorie(s) svp");
//
if (f.nom.value == "")
error(f.nom,"Entrez votre nom svp");

if (f.prenom.value == "")
error(f.prenom,"Entrez un prénom svp");

if (f.email.value =="" || !testEmail(f.email.value))
error(f.email,"Entrez une adresse e-mail correcte svp");

if (f.telephone.value == "")
error(f.telephone,"Entrez un numero de téléphone correct svp");

return ! errfound;
}

// ANTI EMAIL SPAM ;)

function nospamer(qui){
	var first = 'ma';
	var second = 'il';
	var third = 'to:';
	// staff aulamagna
	var nom1 = 'rinus.vanelslander';
	var nom2 = 'patrick.de.longree';
	var nom3 = 'stephan.laloux';
	var nom4 = 'jeanchristophe.leurquin';
	var nom5 = 'christine.haas';
	var nom6 = 'jeanloup.vanagt';
	var nom7 = 'quentin.huwaert';
	var nom8 = 'resa';
	var nom9 = 'vip';
	var nomdefaut = 'info';
	var domain = 'aulamagna';
	var ext = 'be';
if (qui==1) {

	document.write('<a class="linkStandard" href="'+first+second+third+nom1+'@'+domain+'.'+ext+'"><img src="img/f_right.gif" width="6" height="12" border="0">'+nom1+'&#64'+domain+'.'+ext+'</a>');
}
else if (qui==2) {

	document.write('<a class="linkStandard" href="'+first+second+third+nom2+'@'+domain+'.'+ext+'"><img src="img/f_right.gif" width="6" height="12" border="0">'+nom2+'@'+domain+'.'+ext+'</a>');
}
else if (qui==3) {

	document.write('<a class="linkStandard" href="'+first+second+third+nom3+'@'+domain+'.'+ext+'"><img src="img/f_right.gif" width="6" height="12" border="0">'+nom3+'@'+domain+'.'+ext+'</a>');
}
else if (qui==4) {

	document.write('<a class="linkStandard" href="'+first+second+third+nom4+'@'+domain+'.'+ext+'"><img src="img/f_right.gif" width="6" height="12" border="0">'+nom4+'@'+domain+'.'+ext+'</a>');
}
else if (qui==5) {

	document.write('<a class="linkStandard" href="'+first+second+third+nom5+'@'+domain+'.'+ext+'"><img src="img/f_right.gif" width="6" height="12" border="0">'+nom5+'@'+domain+'.'+ext+'</a>');
}
else if (qui==6) {

	document.write('<a class="linkStandard" href="'+first+second+third+nom6+'@'+domain+'.'+ext+'"><img src="img/f_right.gif" width="6" height="12" border="0">'+nom6+'@'+domain+'.'+ext+'</a>');
}
else if (qui==7) {

	document.write('<a class="linkStandard" href="'+first+second+third+nom7+'@'+domain+'.'+ext+'"><img src="img/f_right.gif" width="6" height="12" border="0">'+nom7+'@'+domain+'.'+ext+'</a>');
}
else if (qui==8) {

	document.write('<a class="linkStandard" href="'+first+second+third+nom8+'@'+domain+'.'+ext+'"><img src="img/f_right.gif" width="6" height="12" border="0">'+nom8+'@'+domain+'.'+ext+'</a>');
}
else if (qui==9) {

	document.write('<a class="linkStandard" href="'+first+second+third+nom9+'@'+domain+'.'+ext+'"><img src="img/f_right.gif" width="6" height="12" border="0">'+nom9+'@'+domain+'.'+ext+'</a>');
}
else{

	document.write('<a class="linkStandard" href="'+first+second+third+nomdefaut+'@'+domain+'.'+ext+'"><img src="img/f_right.gif" width="6" height="12" border="0">'+nomdefaut+'@'+domain+'.'+ext+'</a>');
}
}

// fonction ROLLOVER - INFRASTRUCTURE - PLAN TOP (COUPE)  
if (document.images) {

	aOff = new Image(440,214);
	aOff.src = "img/coupe_0.gif";
	a1On = new Image(440,214);
	a1On.src = "img/coupe_1.gif";
	a2On = new Image(440,214);
	a2On.src = "img/coupe_2.gif";
	a3On = new Image(440,214);
	a3On.src = "img/coupe_3.gif";
	a4On = new Image(440,214);
	a4On.src = "img/coupe_4.gif";
	a5On = new Image(440,214);
	a5On.src = "img/coupe_5.gif";
	a6On = new Image(440,214);
	a6On.src = "img/coupe_6.gif";
	a7On = new Image(440,214);
	a7On.src = "img/coupe_7.gif";
	a8On = new Image(440,214);
	a8On.src = "img/coupe_8.gif";
	a9On = new Image(440,214);
	a9On.src = "img/coupe_9.gif";
}

function rolloverOn(imgName,imgTyp) {
	if (document.images) {
		document.images[imgName].src = eval(imgName+imgTyp+"On.src");
	}
}
function rolloverOff(imgName) {
	if (document.images) {
		document.images[imgName].src = eval(imgName+"Off.src");
	}
}

function popupPage(page,largeur,hauteur) {
  var top=(screen.height-hauteur)/2;
  var left=(screen.width-largeur)/2;
  w=open("","","top="+top+",left="+left+",width="+largeur+",height="+hauteur+",toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,menuBar=no");
	w.document.write("<HTML>\n<HEAD>\n<link href=\"css/styles.css\" rel=\"stylesheet\" type=\"text/css\">\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"><META HTTP-EQUIV=\"Refresh\" CONTENT=\"0;URL="+page+"\">\n<TITLE>Aula Magna</TITLE>\n</HEAD>\n");
	w.document.write("<body bgcolor=\"#FFFFFF\" leftMargin=\"20\" topMargin=\"20\" marginwidth=\"20\" marginheight=\"20\">\n");
	w.document.write("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n");
	w.document.write("<tr>\n");
	w.document.write("<td width=\"50%\" align=\"left\"><span class=\"txtStandardBlueBold\">Téléchargement:</span></td>\n");
	w.document.write("<td width=\"50%\" align=\"right\"><a href=\"javascript:javascript:window.close();\" class=\"linkStandard\"><img src=\"img/f_right.gif\" width=\"6\" height=\"12\" border=\"0\">Fermer la fenêtre</a></td>\n");
	w.document.write("</tr>\n");
	w.document.write("</table>\n");
	w.document.write("<table width=\"100%\" height=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"00\">\n");
	w.document.write("<tr>\n<td width=\"100%\" height=\"100%\" align=\"center\" valign=\"middle\">\n");
	w.document.write("<span class=\"txtStandard\">Si le téléchargement ne démarre pas automatiquement au bout de 10 secondes cliquez sur le lien ci-contre pour télécharger le fichier: <A class=\"linkStandard\" href="+page+" target=\"_self\"><img src=\"img/f_right.gif\" width=\"6\" height=\"12\" border=\"0\">Télécharger</A></span>");
	w.document.write("</td>\n</tr>\n</table>\n");
	w.document.write("</BODY>\n</HTML>");
	w.document.close();
}
// script temporaire pour demo

// page agenda_culturel_reservations_status.asp
function resaprintpage(nom,adresse) {
                if (nom=='print') {
                winl = (screen.width - 500) / 2;
                wint = (screen.height - 500) / 2;
                window.open(adresse,'agenda_culturel_print_status','toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=0,menuBar=0,top='+wint+',left='+winl+',width=500,height=500')
        }
}
function popup_formule_vip(adresse) {
                winl = (screen.width - 500) / 2;
                wint = (screen.height - 500) / 2;
                window.open(adresse,'popup_formule_vip','toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=0,menuBar=0,top='+wint+',left='+winl+',width=500,height=500')
}

function popupImage(page,largeur,hauteur) {
  var top=(screen.height-hauteur)/2;
  var left=(screen.width-largeur)/2;
  w=open("","","top="+top+",left="+left+",width="+largeur+",height="+hauteur+",toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,menuBar=no");
	w.document.write("<HTML>\n<HEAD>\n<TITLE>Aula Magna</TITLE>\n</HEAD>\n");
	w.document.write("<body bgcolor=\"#FFFFFF\" leftMargin=\"0\" topMargin=\"0\" marginwidth=\"0\" marginheight=\"0\">\n");
	w.document.write("<table width=\"100%\" height=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n");
	w.document.write("<tr>\n<td width=\"100%\" height=\"100%\" align=\"center\" valign=\"middle\">");
	w.document.write("<a href=\"javascript:window.close()\"><img src="+page+" border=\"0\" alt=\"Cliquez pour fermer\"></a>");
	w.document.write("</td>\n</tr>\n</table>\n");
	w.document.write("</BODY>\n</HTML>");
	w.document.close();
}
// BUG MAC (FONCTION PRINT) (:#)
function imprime() {
  if (navigator.appVersion.indexOf("Mac",0)>0) {
     alert("Utilisateurs Macintosh:\n\nImprimez cette page avec la combinaison des touches \"Pomme-P\"");
        }
else {
    window.print();
  }
}