
// function executée à l'ouverture de la page
function stdOnLoad() {
	removeLinkBox();
	preloadImages();
}

// remove link outline - removes link bounding boxes on <a> and <area> links in IE4+
function removeLinkBox() {
	if (document.all) {
		for (var i in document.links) {
			document.links[i].onfocus = document.links[i].blur;
		}
	}
}

// cache mouseover images
function preloadImages() {
	if (!parent.preloadComplete) {
		newImage('img/top.jpg');
		parent.preloadComplete = true;
	}
}

// create new images for cache
var imageCache = new Array;
function newImage(img) {
	var media = new Image;
	media.src = img;
	imageCache[imageCache.length] = media;
}

// change an image
function changeImages(id, url) {
	document.images[id].src = url;
}


// close pop-up image windows
function closeImageWindow() {
	if (ImageWindow != null && !ImageWindow.closed) ImageWindow.close();
}

// open a new, formatted image window
var ImageWindow = null;
function openImage(imageURL, imageTitle, imageWidth, imageHeight) {
	// check if window is open: then close
	closeImageWindow();

	// create an Image Window
	ImageWindow = openCenteredWindow('', 'ImageWindow' + imageWidth + '_' + imageHeight, imageWidth, imageHeight, 'no');
	// write to, and format, ImageWindow
	ImageWindow.document.open();
	ImageWindow.document.write('<html><head><title>' + imageTitle + '</title></head><body onclick="window.close();" style="margin: 0px; background-color: #000000;"><table cellspacing="0" cellpadding="0" style="width: 100%; height: 100%;"><tr><td style="text-align: center; vertical-align: middle;"><img src="' + imageURL + '" alt="" style="border: 0px;" /></td></tr></table></body></html>');
	ImageWindow.document.close();
}

// open a content window (with consideration for screen size)
function openCenteredWindow(contentURL, contentTitle, contentWidth, contentHeight, scrollBars) {
	// center window on screen
	var winLeft = (screen.width - 10 - contentWidth) / 2;
	var winTop = (screen.height - 10 - contentHeight) / 2;

	if (winLeft < 0) {
		scrollBars = 'yes';
		winLeft = 10;
		contentWidth = screen.width - 30;
	}
	if (winTop < 0) {
		scrollBars = 'yes';
		winTop = 10;
		contentHeight = screen.height - 100;
	}
	
	var NewWindow = window.open(contentURL, contentTitle, 'scrollbars=' + scrollBars + ', width=' + contentWidth + ', height=' + contentHeight + ', top=' + winTop + ', left=' + winLeft + ', screenX=' + winLeft + ', screenY=' + winTop);
	NewWindow.focus();
	return NewWindow;
}


// void function
function dummy() {}
