var OS = 'Win';
var version = "n";
var isNS = (navigator.appName == "Netscape");
var isMAC = (navigator.platform.indexOf('Mac') != -1);

browserVer=navigator.appVersion;
App = navigator.appName;
var Version=browserVer.substring(0,1);
var posOS = navigator.appVersion.indexOf('Mac');
var posOS2 = navigator.appVersion.indexOf('Win');
if (posOS >= 0) OS = 'Mac';
if ((posOS < 0) && (posOS2 >= 0)) OS = 'Win';
if (App == "Netscape" && Version >= 3) version = "n3";

//var message="";
//function clickIE() {if (document.all) {(message);return false;}}
//function clickNS(e) {if 
//(document.layers||(document.getElementById&&!document.all)) {
//if (e.which==2||e.which==3) {(message);return false;}}}
//if (document.layers) 
//{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
//else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

function openwin(name,myname,mywidth,myheight,mytool,mydir,mystatus,myscroll,myresize,mymenu) {
	mytop=Math.floor((screen.height/2) - (myheight/2));
	myleft=Math.floor((screen.width/2) - (mywidth/2));
	if (version != "n3" && OS != 'Mac') debute = window.open(name,myname,"toolbar="+mytool+",width="+mywidth+",height="+myheight+",directories="+mydir+",status="+mystatus+",scrollbars="+myscroll+",top="+mytop+",left="+myleft+",resizable="+myresize+",menubar="+mymenu)
	if (OS == 'Mac') debute = window.open(name,myname,"toolbar="+mytool+",width="+mywidth+",height="+myheight+",directories="+mydir+",status="+mystatus+",scrollbars="+myscroll+",top="+mytop+",left="+myleft+",resizable="+myresize+",menubar="+mymenu)
	if (version == "n3") {
		debute = window.open(name,myname,"toolbar="+mytool+",width="+mywidth+",height="+myheight+",directories="+mydir+",status="+mystatus+",scrollbars="+myscroll+",top="+mytop+",left="+myleft+",resizable="+myresize+",menubar="+mymenu)
		debute.focus();
	}
}

function openwintopleft(name,myname,mywidth,myheight,mytool,mydir,mystatus,myscroll,myresize,mymenu) {
	mytop=10;
	myleft=10;
	if (version != "n3" && OS != 'Mac') debute = window.open(name,myname,"toolbar="+mytool+",width="+mywidth+",height="+myheight+",directories="+mydir+",status="+mystatus+",scrollbars="+myscroll+",top="+mytop+",left="+myleft+",resizable="+myresize+",menubar="+mymenu)
	if (OS == 'Mac') debute = window.open(name,myname,"toolbar="+mytool+",width="+mywidth+",height="+myheight+",directories="+mydir+",status="+mystatus+",scrollbars="+myscroll+",top="+mytop+",left="+myleft+",resizable="+myresize+",menubar="+mymenu)
	if (version == "n3") {
		debute = window.open(name,myname,"toolbar="+mytool+",width="+mywidth+",height="+myheight+",directories="+mydir+",status="+mystatus+",scrollbars="+myscroll+",top="+mytop+",left="+myleft+",resizable="+myresize+",menubar="+mymenu)
		debute.focus();
	}
}

function openwin_popup(myurl,mywidth,myheight) {
	openwin(myurl,"newpopup",mywidth,myheight,0,0,0,0,0,0);
}

function openwin_docked(myurl) {
	debute = window.open(myurl,"newwin","location=1,toolbar=1,directories=1,status=1,scrollbars=1,resizable=1,menubar=1");
}

function openwin_fixedsize(myurl,mywidth,myheight) {
	debute = window.open(myurl,"newwin","width="+mywidth+",height="+myheight+",location=1,toolbar=1,directories=1,status=1,scrollbars=1,resizable=1,menubar=1");
}

function openwin_fullscreen(name,myname) {
	debute = window.open(name,myname,"fullscreen=1,toolbar=1,directories=1");
}

function fermer() {
	parent.close();
}

function checkForm() {
	warning="";
	if(document.identification.login.value=="") {
		warning+="- Login\n";
	}
	if(document.identification.password.value=="") {
		warning+="- Password\n";
	}
  	if(warning!="") {
		alert("Les champs suivants ne sont pas remplis correctement:\n"+warning);
	} else  {
		document.identification.submit();
	}
}

function reglement() {
	openwin("/html/reglement.htm","reglement",620,480,0,0,0,1,0,0);
}
function contacts() {
	openwin("/html/contacts.htm","contacts",600,300,0,0,0,0,0,0);
}

