var height;
var width;
var detect = navigator.userAgent.toLowerCase();
var IE4 = checkIt('msie');

function checkIt(string){
	place = detect.indexOf(string) + 1;
	thestring = string;
	return (place != 0);
}

function rollover(t){
	if (IE4){
		if (t.style.filter != '')
			t.style.filter='';
		else
			t.style.filter="progid:DXImageTransform.Microsoft.Glow(color='630063', Strength='7')";
	} else {
		if (t.style.color != 'rgb(255, 255, 255)')
			t.style.color='rgb(255, 255, 255)';
		else
			t.style.color='rgb(14,243,57)';
	}
}

function rolloverFM(t){
	
	if (IE4){
		if (t.style.filter != "progid:DXImageTransform.Microsoft.Glow(color='#14F357', Strength='10')")
			t.style.filter="progid:DXImageTransform.Microsoft.Glow(color='#14F357', Strength='10')";
		else
			t.style.filter="progid:DXImageTransform.Microsoft.Glow(color='#FEFDBF', Strength='10')";
	} else {
		if (t.style.color != 'rgb(0, 0, 255)')
			t.style.color = 'rgb(0, 0, 255)';
		else
			t.style.color = 'rgb(20, 243, 87)';
	}
}

function golocation(t){
	document.location=t;
}

function ResizeMenu(name){
	var objimg = document.getElementById(name);

	height = document.body.clientHeight;
	width = (document.body.clientHeight+120)/3;
					
	objimg.height=height
	objimg.width=width;
	
	setAreaCoords("intro",0,60,300,170);
	
	setTextCoords("introduction",40,200,40);
	setTextCoords("reglement",30,300,40);
	setTextCoords("exiger",30,450,40);
	setTextCoords("cours",40,650,40);
	setTextCoords("cout",80,750,40);
	setTextCoords("inscription",40,840,40);
	setTextCoords("ecrire",30,935,40);
	setTextCoords("eCom",75,1010,40);
	setTextCoords("compteur",75,1270,0);
}

function setAreaCoords(AreaID, xa, ya, xb, yb){
	var objAera;
	var txa,tya,txb,tyb;
	objAera = document.getElementById(AreaID);
	
	txa = width*xa/400;
	txb = width*xb/400;
	tya = height*ya/1200;
	tyb = height*yb/1200;
	objAera.coords = txa+","+tya+","+txb+","+tyb;
}

function setTextCoords(TextID, left, top, txtsize){
	var objText;
	var xleft, xtop, xsize;
	objText = document.getElementById(TextID);
	xleft = width*left/400;
	xtop = height*top/1200;
	xsize = width*txtsize/400;
	objText.style.left = xleft+"px";
	objText.style.top = xtop+"px";
	objText.style.fontSize = xsize;
}

function ResizeBG(){
	var ScrnSize;
	var img = new Image();
	ScrnSize = screen.width + "";
	switch(ScrnSize) {
	case "640": 
	case "800":
	case "1024":
	case "1152":
	case "1280":
	case "1600":
	case "1920":
	case "2048":
		img.src="BG/bg_"+ScrnSize+".jpg";
		document.body.background = img.src;
		break;
	default: 
		break;
	}			
}

function preSelect(TextID){
	var objText = document.getElementById(TextID);
	objText.onmouseover="";
	objText.onmouseout="";
	rollover(objText);
}

