var main = new Object();
main.init = function() {
	//this.flashDetect();
}
main.onload = (window.onload) ? window.onload : function() {};
window.onload = function() {main.onload(); main.init()};
main.popup = function(name, lang) {
	var page = name.replace(/menu-/, "");
	var url = "popup/" + page + ".php5?lang=" + lang;
	switch (page) {
		case "mentions-legales":
			var features = "width=760,height=500,resizable,scrollbars";
			break;
		case "email":
			var features = "width=640,height=400,resizable,scrollbars";
			break;
		case "contact":
			var features = "width=620,height=440,resizable,scrollbars";
			break;
		case "inscription":
			var features = "width=620,height=440,resizable,scrollbars";
			break;
		case "coteluxe":
			var url = "http://www.cote-luxe.com";
			var features = "";
			break;
		default :
			var features = "width=600,height=400,resizable,scrollbars";
	}
	if (features) var newWindow = window.open(url, page.replace(/-/, ""), features);
	else var newWindow = window.open(url, page.replace(/-/, ""), features);
	var width = parseInt (features.replace(/.*width=/, ""));
	var height = parseInt (features.replace(/.*height=/, ""));
	if (width && height) {
		try {newWindow.resizeTo (width, height)} catch (e) {};
		try {newWindow.moveTo(0,0)} catch (e) {};
	}
	newWindow.focus();
}
main.flashDetect = function() {
	this.flashInstalled = 1;
	this.flashVersion = 1;
	this.flashActiveX = false;
	if (navigator.plugins && navigator.plugins.length) {
		var x = navigator.plugins["Shockwave Flash"];
		if (x) {
			this.flashInstalled = 2;
			if (x.description) {
				var y = x.description;
				this.flashVersion = parseInt(y.charAt(y.indexOf('.') - 1));
			}
		} else this.flashInstalled = 0;
		if (navigator.plugins["Shockwave Flash 2.0"]) {
			this.flashInstalled = 2;
			this.flashVersion = 2;
		}
	} else if (navigator.mimeTypes && navigator.mimeTypes.length) {
		var x = navigator.mimeTypes["application/x-shockwave-flash"];
		if (x && x.enabledPlugin) this.flashInstalled = 2;
		else this.flashInstalled = 0;
	} else {
		/*@cc_on 
			@if (@_jscript_version >= 5)
				for (var i = 7; i > 0; i--) {
					this.flashVersion = 0;
					try {
						var flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i);
						this.flashInstalled = 2;
						this.flashVersion = i;
						this.flashActiveX = true;
						break;
					} catch (e) {
					}
				}
			@end
		@*/
	}
	return this.flashVersion;
}