monMenu = new TheMenu('monMenu');
monMenu.base = '';
couleurligne = "#ffffff";
couleurbase  = "#cccccc";

var framelong;
var gauche = largeur;
var nbmenu = 5;

if (bw.ns6) {
	var enhaut = 145;
	document.write('<style type="text/css">');
	document.write('A.ejsmenu:hover {color: #ff0000; text-decoration: none; font-family: Arial}');
	document.write('A.ejsmenu {color: #000000; text-decoration: none; font-family: Arial}');
	document.write('.divmenu {height: '+hauteur+'px; width: '+largeur+'px; border: 1px solid #5E3E33}');
	document.write('</style>');
	temp = 200;
	gauche += 3;
	framelong = window.innerWidth;
	longueur = (framelong / 2) < (nbmenu / 2) * gauche ? 0 : (framelong / 2) - ((nbmenu / 2) * gauche);
	window.onload = init;
}

if (bw.ie) {
	var enhaut = 145;
	document.write('<style type="text/css">');
	document.write('A.ejsmenu:hover {color: #ff0000; text-decoration: none; font-family: Arial; font-size: 10}');
	document.write('A.ejsmenu {color: #000000; text-decoration: none; font-family: Arial; font-size: 10}');
	document.write('.divmenu {z-index: 5; position: absolute; height: '+hauteur+'px; width: '+largeur+'px; border: 1px solid #5E3E33}');
	document.write('</style>');
	temp = 250;
	framelong = document.body.clientWidth;
	longueur = (framelong / 2) < (nbmenu / 2) * gauche ? 0 : (framelong / 2) - ((nbmenu / 2) * gauche);
	init();
}

if (bw.ns4) {
	var enhaut = 145;
	temp = 200;
	framelong = window.innerWidth;
	longueur = (framelong / 2) < (nbmenu / 2) * gauche ? 0 : (framelong / 2) - ((nbmenu / 2) * gauche);
	longueur -= 8;
	window.onload = init;
}

// Exemple complet de fabrication du menu
// monMenu.makeMenu('nom brique','nom éventuel père','lien relatif ou complet','étiquette','cible',positionnement X,positionnement Y,premier ou non);
function init() {
	monMenu.makeMenu('menu0','','index.php','&nbsp;<b>ACCUEIL</b>','_self',longueur,enhaut,1);

	monMenu.makeMenu('menu1','','','&nbsp;COLINE','',longueur + 1* gauche,enhaut,1);
		monMenu.makeMenu('menu12','menu1','societe.php','&nbsp;Qui sommes nous ?','_self');
		monMenu.makeMenu('menu13','menu1','situ-produits.php','&nbsp;Où trouver nos produits ?','_self');



	monMenu.makeMenu('menu2','','produits.php','&nbsp;COLLECTIONS','_self',longueur + 2* gauche,enhaut,1);
			//monMenu.makeMenu('menu211','menu21','collection-femmes.htm','&nbsp;Aperçu de la collection','_self');

		monMenu.makeMenu('menu22','menu2','produits1.php?cat=pareosetsarong','&nbsp;PAREOS & SARONGS','_self');
		monMenu.makeMenu('menu220','menu2','produits1.php?cat=Destockage','&nbsp;Destockage','_self');
		monMenu.makeMenu('menu221','menu2','produits1.php?cat=accessoires','&nbsp;ACCESSOIRES','_self');
		monMenu.makeMenu('menu222','menu2','produits1.php?cat=hamacs','&nbsp;HIVER 2008','_self');
	    monMenu.makeMenu('menu223','menu2','produits1.php?cat=nouveautes','&nbsp;ETE 2008','_self');
	        monMenu.makeMenu('menu224','menu2','produits1.php?cat=promotions','&nbsp;PROMOTIONS','_self');

	monMenu.makeMenu('menu3','','','&nbsp;CONTACT','',longueur + 3* gauche,enhaut,1);
		monMenu.makeMenu('menu32','menu3','contacts.php','&nbsp;TOUS NOS CONTACTS','_self');
		//monMenu.makeMenu('menu33','menu3','contacts.htm','&nbsp;PAR TEL & FAX','_self');


	monMenu.makeMenu('menu5','','tarifs.php','&nbsp;TARIFS PRO','_self',longueur + 4* gauche,enhaut,1);
}

function resize() {
	if (bw.ns4) {
		location.reload();
	}
	if (bw.ie) {
		framelong = document.body.clientWidth;
		depart  = (framelong / 2) < (nbmenu / 2) * gauche ? 0 : (framelong / 2) - ((nbmenu / 2) * gauche);
		monMenu.moveMenu(depart - longueur);
		longueur = depart;
	}
	if (bw.ns6) {
		framelong = window.innerWidth;
		depart = (framelong / 2) < (nbmenu / 2) * gauche ? 0 : (framelong / 2) - ((nbmenu / 2) * gauche);
		monMenu.moveMenu(depart - longueur);
		longueur = depart;
	}
}

if (bw.ns6 || bw.ie) window.onresize = resize;

setInterval("mafonc()",temp);

function mafonc() {
	monMenu.dessus();
	if (bw.ns4) {
		newframelong = window.innerWidth;
		if (framelong != newframelong) {
			framelong = newframelong;
			resize();
		}
	}
}

function scrollBar(face,face2) {
	with (document.body.style) {
		scrollbarDarkShadowColor=face2;
		scrollbar3dLightColor=face2;
		scrollbarArrowColor=face2;
		scrollbarBaseColor=face;
		scrollbarFaceColor=face;
		scrollbarHighlightColor=face;
		scrollbarShadowColor=face;
		scrollbarTrackColor="#F3F3F3";
	}
}

function colorBar(){
	var w = document.body.clientWidth;
	var h = document.body.clientHeight;
	var x = event.clientX;
	var y = event.clientY;
	if(x>w || y>h) scrollBar(couleurligne,couleurbase);
	else scrollBar(couleurbase,couleurligne);
}

if (bw.ie) {
	scrollBar(couleurbase,couleurligne);
	document.onmousemove = colorBar;
}
