function getMyElement(id) {
	if (document.getElementById)
		return document.getElementById(id);
	else if (document.all)
		return eval("document.all."+id);
	else
		return null;
}

/* pop-up simple */
function popUp(href,title,top,left,width,height) {
	pop=window.open(href,title,"top="+top+",left="+left+",width="+width+",height="+height+",toolbar=0,location=0,menubar=0,status=0,scrollbars=1,resizable=1");
	if(pop.window.focus){pop.window.focus();}
}

/* pop-up pour images */
function middlePop(href,title,width,height) {
	var screen_width=screen.width;
	var screen_height=screen.height;

	var new_width=width+40;
	var new_height=height+40;

	var left=Math.round((screen_width/2)-(new_width/2));
	var top=Math.round((screen_height/2)-(new_height/2));

	pop=window.open(href,title,"top="+top+",left="+left+",width="+new_width+",height="+new_height+",toolbar=0,location=0,menubar=0,status=0,scrollbars=1,resizable=1");
	if(pop.window.focus){pop.window.focus();}
}

/* rollover home */
function setBackground(id) {
	getMyElement(id).style.backgroundImage="url(../images/home_"+id+".jpg)";
	return true;
}

function clearBackground(id) {
	getMyElement(id).style.background="none";
	return true;
}

/* preload */

var myImages=new Array();

myImages[0]="../images/home_menu1.jpg";
myImages[1]="../images/home_menu2.jpg";
myImages[2]="../images/home_menu3.jpg";
myImages[3]="../images/home_menu4.jpg";

function preLoadImages() {
	for (i=0;i<myImages.length;i++) {
		myImages[i]=new Image();
		myImages[i].src=myImages[i];
	}
	return true;
}
