/* ================================================================================== */
/* Création constantes								      */
/* ================================================================================== */

	var statusON='ON';
	var statusOFF='OFF';
	var statusOVER='OVER';
	var statusOUT='OUT';

/* ================================================================================== */
/* Création des classes «pgeMainMenu» et «pgeCatalogMenu» avec propriétés et méthodes	*/
/* ================================================================================== */

function pgeMainMenu(sNom, sPageUrl, sImageOff, sImageOver, sImageOn, sStatus) { 
	this.nom=sNom;
	this.url=sPageUrl;
	this.imageOff=sImageOff;
	this.imageOver=sImageOver;
	this.imageOn=sImageOn;
	this.status=sStatus;					//'OUT', 'OFF', 'OVER' ou 'ON'
	this.ChangeImage=ChangeImage;
	this.RestoreImage=RestoreImage;
	this.ClickLink=ClickLink;
	this.SelectMenu=SelectMain;
}

function pgeCatalogMenu(sNom, sPageUrl, sImageOut, sImageOff, sImageOver, sImageOn, sStatus) { 
	this.nom=sNom;
	this.url=sPageUrl;
	this.imageOut=sImageOut;
	this.imageOff=sImageOff;
	this.imageOver=sImageOver;
	this.imageOn=sImageOn;
	this.status=sStatus;					//'OUT', 'OFF', 'OVER' ou 'ON'
	this.ChangeImage=ChangeImage;
	this.RestoreImage=RestoreImage;
	this.ClickLink=ClickLink;
	this.SelectMenu=SelectCatalog;
}

/* ---------------------------------------------------------------------------------- */
/* Ajustement des menus quand on clique les menus standards 					      */
/* ---------------------------------------------------------------------------------- */

function SelectMain() {
	if (this!=mnuHome)
		mnuHome.ChangeImage(statusOFF);
	if (this!=mnuContactUs)
		mnuContactUs.ChangeImage(statusOFF);
	if (this!=mnuLanguage)
		mnuLanguage.ChangeImage(statusOFF);

	if (this!=mnuCompany)
		mnuCompany.ChangeImage(statusOFF);
	if (this!=mnuCellularPVC)
		mnuCellularPVC.ChangeImage(statusOFF);
	if (this!=mnuCatalog){
		mnuCatalog.ChangeImage(statusOFF);
		mnuExteriorMouldings.ChangeImage(statusOUT);
		mnuDoorsAndWindows.ChangeImage(statusOUT);
		mnuInteriorMouldings.ChangeImage(statusOUT);
		mnuOtherMouldings.ChangeImage(statusOUT);
		mnuCatalogFiller.ChangeImage(statusOUT);
	
		if (!document.layers){
 			document.all['lnkExterior'].style.cursor='default';
			document.all['lnkDoor'].style.cursor='default';
			document.all['lnkInterior'].style.cursor='default';
			document.all['lnkOther'].style.cursor='default';
		};

	}else{
		mnuExteriorMouldings.ChangeImage(statusOFF);
		mnuDoorsAndWindows.ChangeImage(statusOFF);
		mnuInteriorMouldings.ChangeImage(statusOFF);
		mnuOtherMouldings.ChangeImage(statusOFF);
		mnuCatalogFiller.ChangeImage(statusOFF);

		if (!document.layers){
 			document.all['lnkExterior'].style.cursor='hand';
			document.all['lnkDoor'].style.cursor='hand';
			document.all['lnkInterior'].style.cursor='hand';
			document.all['lnkOther'].style.cursor='hand';
		};
	};

	if (this!=mnuClientZone)
		mnuClientZone.ChangeImage(statusOFF);
	if (this!=mnuVIPRoom)
		mnuVIPRoom.ChangeImage(statusOFF);
	
	this.ChangeImage(statusON);
	return true;
}


/* ================================================================================== */
/* 	Sélection de menus et changement de page lors du click de l'usager	      */
/* ---------------------------------------------------------------------------------- */
function ClickLink(){

if (this.nom == 'imgZone'){
	OpenClientArea();
}
else
{
	if(this.SelectMenu())
		if (this.url.length>0)
			document.location.href=this.url;

	
	if (!document.layers){
 		document.all['lnkExterior'].blur();
		document.all['lnkDoor'].blur();
		document.all['lnkInterior'].blur();
		document.all['lnkOther'].blur();
	}else{
		document.layers['lnkExterior'].blur();
		document.layers['lnkDoor'].blur();
		document.layers['lnkInterior'].blur();
		document.layers['lnkOther'].blur();		
	};
}
}


/* ================================================================================== */
/* Changement d'une image pour une autre (tous les status)									*/
/* ---------------------------------------------------------------------------------- */

function ChangeImage(sStatus){
	var oImg
	if ((oImg=MM_findObj(this.nom))!=null){
		switch(sStatus){
		
			case 'OVER':
				if (this.status==statusOFF){
					oImg.src=this.imageOver;
					this.status=sStatus;
				};
				break;

			case 'OFF':
				oImg.src=this.imageOff;
				this.status=sStatus;
				break;

			case 'OUT':
				oImg.src=this.imageOut;
				this.status=sStatus;
				break;

			case 'ON':
					oImg.src=this.imageOn;
					this.status=sStatus;
					break;
		};
	};
}

/* ================================================================================== */
/* Restauration d'une image lorsqu'elle est en «mouseOver»							 		 */
/* ---------------------------------------------------------------------------------- */

function RestoreImage(){
	var oImg
	
	if ((oImg=MM_findObj(this.nom))!=null)
		if (this.status==statusOVER){
			oImg.src=this.imageOff;
			this.status=statusOFF;
		};
}

/* ================================================================================== */
/* Ajustement des menus quand on clique les menus temporaires 						  */
/* ---------------------------------------------------------------------------------- */

function SelectCatalog() {
	
	if (this.status!=statusOUT){
		if (this!=mnuExteriorMouldings)
			mnuExteriorMouldings.ChangeImage(statusOFF);
		if (this!=mnuDoorsAndWindows)
			mnuDoorsAndWindows.ChangeImage(statusOFF);
		if (this!=mnuInteriorMouldings)
			mnuInteriorMouldings.ChangeImage(statusOFF);
		if (this!=mnuOtherMouldings)
			mnuOtherMouldings.ChangeImage(statusOFF);
				
		this.ChangeImage(statusON);
		return true;
	}else{
		return false;
	};
}

/* ================================================================================== */
/* Création des objets				 	      			      */
/* ---------------------------------------------------------------------------------- */

function CreerMenus(){
//							Nom donné 			URL du lien			Image à afficher		Image à afficher		Image à afficher		Image à afficher		Statut
//Objets 						à l'image	 		associé 			pour le statut «Out»		pour le statut «Off»		pour le statut «Over»		pour le statut «On» 		de base
//------------------------------------			----------------		--------------			------------------------	-------------------------	-------------------------	-------------------------	-------
  mnuHome		= new pgeMainMenu(		'imgHome', 			'Home.htm', 							'Images/HomeOff.gif', 		'Images/HomeOn.gif', 		'Images/HomeOn.gif', 		statusOFF	);
  mnuContactUs		= new pgeMainMenu(		'imgContactUs', 		'ContactUs.htm', 						'Images/ContactUsOff.gif', 	'Images/ContactusOn.gif', 	'Images/ContactUsOn.gif', 	statusOFF	);
  mnuLanguage		= new pgeMainMenu(		'imgLanguage', 			'Construction.htm', 		 				'Images/FrancaisOff.gif', 	'Images/FrancaisOn.gif', 	'Images/FrancaisOn.gif', 	statusOFF	);

  mnuExteriorMouldings	= new pgeCatalogMenu(		'imgExterior', 			'Catalog.asp?Section=3', 	'Images/ExteriorOut.gif', 	'Images/ExteriorOff.gif', 	'Images/ExteriorOn.gif', 	'Images/ExteriorOn.gif', 	statusOUT	);
  mnuDoorsAndWindows	= new pgeCatalogMenu(		'imgDoor', 			'Catalog.asp?Section=2', 	'Images/DoorsOut.gif', 		'Images/DoorsOff.gif', 		'Images/DoorsOn.gif', 		'Images/DoorsOn.gif', 		statusOUT	);
  mnuInteriorMouldings	= new pgeCatalogMenu(		'imgInterior', 			'Catalog.asp?Section=4', 	'Images/InteriorOut.gif', 	'Images/InteriorOff.gif', 	'Images/InteriorOn.gif', 	'Images/InteriorOn.gif', 	statusOUT	);
  mnuOtherMouldings	= new pgeCatalogMenu(		'imgOther', 			'Catalog.asp?Section=5', 	'Images/OtherOut.gif', 		'Images/OtherOff.gif', 		'Images/OtherOn.gif', 		'Images/OtherOn.gif', 		statusOUT	);
  mnuCatalogFiller	= new pgeCatalogMenu(		'imgCatalogFiller', 		'',	 			'Images/CatalogOut.gif', 	'Images/Pointorange.gif', 	'', 				'', 				statusOUT	);

  mnuCompany		= new pgeMainMenu(		'imgCompany', 			'Company.htm', 							'Images/CompanyOff.gif', 	'Images/CompanyOver.gif', 	'Images/CompanyOn.gif', 	statusOFF	);
  mnuCellularPVC	= new pgeMainMenu(		'imgPVC', 			'PVC.htm', 	 						'Images/PVCOff.gif', 		'Images/PVCOver.gif', 		'Images/PVCOn.gif', 		statusOFF	);
  mnuCatalog		= new pgeMainMenu(		'imgCatalog', 			'Catalog.asp?Section=1', 		 			'Images/CatalogOff.gif', 	'Images/CatalogOver.gif', 	'Images/CatalogOn.gif', 	statusOFF	);
  mnuClientZone		= new pgeMainMenu(		'imgZone', 			'Zone.asp', 	 					'Images/ZoneOff.gif', 		'Images/ZoneOver.gif', 		'Images/ZoneOn.gif', 		statusOFF	);
  mnuVIPRoom		= new pgeMainMenu(		'imgVIP', 			'VIP.asp', 	 					'Images/VIPOff.gif', 		'Images/VIPOver.gif', 		'Images/VIPOn.gif', 		statusOFF	);

}

function OpenClientArea(){
	window.open("https://secure.cyframe.com/Tecniplast/Login/Login.html","ClientAreaLogin","menubar=no,scrollbars=no,status=yes,resizable=no,left=150,top=250,width=800,height=250");
}
			
function MM_preloadImages() { 
//v3.0
	var d=document;
	if(d.images){
		if(!d.MM_p)
			d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments;
		for(i=0; i<a.length; i++)
			if (a[i].indexOf("#")!=0){
				d.MM_p[j]=new Image;
				d.MM_p[j++].src=a[i];
			}
	}
}

function MM_findObj(n, d) { 
//v4.0
	var p,i,x;
	if(!d)
		d=document;
	if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document;
		n=n.substring(0,p);
	}  
	if(!(x=d[n])&&d.all)
		x=d.all[n];
	for (i=0;!x&&i<d.forms.length;i++)
		x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++)
		x=MM_findObj(n,d.layers[i].document);
	if(!x && document.getElementById)
		x=document.getElementById(n);
	return x;
}

function Initialisation() {

	var iCpt, oMenuCourant
	var aListeMenus=Initialisation.arguments;

	for(iCpt=0; iCpt < aListeMenus.length; iCpt++){
		oMenuCourant=eval(aListeMenus[iCpt]);
		oMenuCourant.SelectMenu();
	};
	
	MM_preloadImages('images/HomeOn.gif','images/ContactUsOn.gif','images/FrancaisOn.gif','Images/CompanyOver.gif','Images/CompanyOn.gif','Images/PvcOver.gif','Images/PvcOn.gif','Images/CatalogOver.gif','Images/CatalogOn.gif','Images/ZoneOver.gif','Images/ZoneOn.gif','Images/VipOver.gif','Images/VipOn.gif','Images/ExteriorOff.gif','Images/ExteriorOn.gif','Images/DoorsOff.gif','Images/DoorsOn.gif','Images/InteriorOff.gif','Images/InteriorOn.gif','Images/OtherOff.gif','Images/OtherOn.gif');

}

function EcritEntete(){
document.writeln("<div align='center'>");
	document.writeln("<center>");
	document.writeln("<table border='0' cellpadding='0' cellspacing='0' width='778'>");
	if(window.screen.height>659){
		document.writeln("<tr>");
		document.writeln("<td colspan='3'><img border='0' src='Images/PointGris.gif' width='778' height='30'></td>");
		document.writeln("</tr>");
	};
	document.writeln("<tr>");
	document.writeln("<td  colspan='3'><img border='0' src='Images/PointCharcoal.gif' width='778' height='1'></td>");
	document.writeln("</tr>");
	document.writeln("<tr>");
	document.writeln("<td bgcolor='#666666'><img border='0' src='Images/PointCharcoal.gif' width='1' height='1'></td>");
	document.writeln("<td>");
	document.writeln("<table border='0' cellpadding='0' cellspacing='0' width='776'>");
	document.writeln("<tr>");
	document.writeln("<td><img border='0' src='Images/Logo.gif' width='126' height='144'></td>");
	document.writeln("<td>");
	document.writeln("<table border='0' cellpadding='0' cellspacing='0'>");
	document.writeln("<tr>");
	document.writeln("<td><img border='0' src='Images/RecGrisHaut.gif' width='650' height='29'></td>");
	document.writeln("</tr>");
	document.writeln("<tr>");
	document.writeln("<td>");
	document.writeln("<table border='0' cellpadding='0' cellspacing='0'>");
	document.writeln("<tr>");
	document.writeln("<td><img border='0' src='Images/RecGrisGauche.gif' width='432' height='21'></td>");
	document.writeln("<td><a href='javascript: mnuHome.ClickLink()' 		onMouseOut='mnuHome.RestoreImage()' 		onMouseOver='mnuHome.ChangeImage(statusOVER)'>		<img name='imgHome' border='0' src='Images/HomeOff.gif' width='46' height='21'></a></td>");
	document.writeln("<td><a href='javascript: mnuContactUs.ClickLink()' 	onMouseOut='mnuContactUs.RestoreImage()' 	onMouseOver='mnuContactUs.ChangeImage(statusOVER)'>	<img name='imgContactUs' border='0' src='Images/ContactUsOff.gif' width='69' height='21'></a></td>");
	document.writeln("<td><a href='javascript: mnuLanguage.ClickLink()' 	onMouseOut='mnuLanguage.RestoreImage()' 	onMouseOver='mnuLanguage.ChangeImage(statusOVER)'>	<img name='imgLanguage' border='0' src='Images/FrancaisOff.gif' width='55' height='21'></a></td>");
	document.writeln("<td><img border='0' src='Images/RecGrisDroite.gif' width='48' height='21'></td>");
	document.writeln("</tr>");
	document.writeln("</table>");
	document.writeln("</td>");
	document.writeln("</tr>");
	document.writeln("<tr>");
	document.writeln("<td><img border='0' src='Images/BarreImages.jpg' width='650' height='55'></td>");
	document.writeln("</tr>");
	document.writeln("<tr><td>");
	document.writeln("<table border='0' cellpadding='0' cellspacing='0' width='650'>");
	document.writeln("<tr>");
//	document.writeln("<td><a id='lnkExterior' style='cursor:default' 	href='javascript:mnuExteriorMouldings.ClickLink()' 	onMouseOut='mnuExteriorMouldings.RestoreImage()' 	onMouseOver='mnuExteriorMouldings.ChangeImage(statusOVER)'>	<img name='imgExterior' border='0' src='Images/ExteriorOut.gif' width='129' height='19'></a></td>");
//	document.writeln("<td><a id='lnkDoor' style='cursor:default' 	href='javascript:mnuDoorsAndWindows.ClickLink()' 	onMouseOut='mnuDoorsAndWindows.RestoreImage()' 		onMouseOver='mnuDoorsAndWindows.ChangeImage(statusOVER)'>	<img name='imgDoor' border='0' src='Images/DoorsOut.gif' width='183' height='19'></a></td>");
//	document.writeln("<td><a id='lnkInterior' style='cursor:default' 	href='javascript:mnuInteriorMouldings.ClickLink()' 	onMouseOut='mnuInteriorMouldings.RestoreImage()' 	onMouseOver='mnuInteriorMouldings.ChangeImage(statusOVER)'>	<img name='imgInterior' border='0' src='Images/InteriorOut.gif' width='135' height='19'></a></td>");


////	document.writeln("<td><a id='lnkDoor'	href='javascript:mnuDoorsAndWindows.ClickLink()' 	onMouseOut='mnuDoorsAndWindows.RestoreImage()' 		onMouseOver='mnuDoorsAndWindows.ChangeImage(statusOVER)'>	<img name='imgDoor' border='0' src='Images/DoorsOut.gif' width='170' height='19'></a></td>");
////	document.writeln("<td><a id='lnkExterior' href='javascript:mnuExteriorMouldings.ClickLink()' 	onMouseOut='mnuExteriorMouldings.RestoreImage()' 	onMouseOver='mnuExteriorMouldings.ChangeImage(statusOVER)'>	<img name='imgExterior' border='0' src='Images/ExteriorOut.gif' width='142' height='19'></a></td>");
////	document.writeln("<td><a id='lnkInterior' href='javascript:mnuInteriorMouldings.ClickLink()' 	onMouseOut='mnuInteriorMouldings.RestoreImage()' 	onMouseOver='mnuInteriorMouldings.ChangeImage(statusOVER)'>	<img name='imgInterior' border='0' src='Images/InteriorOut.gif' width='135' height='19'></a></td>");
////	document.writeln("<td><a id='lnkOther' href='javascript:mnuOtherMouldings.ClickLink()' 	onMouseOut='mnuOtherMouldings.RestoreImage()' 		onMouseOver='mnuOtherMouldings.ChangeImage(statusOVER)'>	<img name='imgOther' border='0' src='Images/OtherOut.gif' width='120' height='19'></a></td>");

	document.writeln("<td><a id='lnkDoor'	href='javascript:mnuDoorsAndWindows.ClickLink()' 	onMouseOut='mnuDoorsAndWindows.RestoreImage()' 		onMouseOver='mnuDoorsAndWindows.ChangeImage(statusOVER)'>	<img name='imgDoor' border='0' src='Images/DoorsOut.gif' width='170' height='19'></a></td>");
	document.writeln("<td><a id='lnkExterior' href='javascript:mnuExteriorMouldings.ClickLink()' 	onMouseOut='mnuExteriorMouldings.RestoreImage()' 	onMouseOver='mnuExteriorMouldings.ChangeImage(statusOVER)'>	<img name='imgExterior' border='0' src='Images/ExteriorOut.gif' width='142' height='19'></a></td>");
	document.writeln("<td><a id='lnkInterior' href='javascript:mnuInteriorMouldings.ClickLink()' 	onMouseOut='mnuInteriorMouldings.RestoreImage()' 	onMouseOver='mnuInteriorMouldings.ChangeImage(statusOVER)'>	<img name='imgInterior' border='0' src='Images/InteriorOut.gif' width='135' height='19'></a></td>");
	document.writeln("<td><a id='lnkOther' href='javascript:mnuOtherMouldings.ClickLink()' 	onMouseOut='mnuOtherMouldings.RestoreImage()' 		onMouseOver='mnuOtherMouldings.ChangeImage(statusOVER)'>	<img name='imgOther' border='0' src='Images/OtherOut.gif' width='120' height='19'></a></td>");


	document.writeln("<td><img name='imgCatalogFiller' border='0' src='Images/CatalogOut.gif' width='83' height='19'></td>");
	document.writeln("</tr>");
	document.writeln("</table>");
	document.writeln("</td>");
	document.writeln("</tr>");
	document.writeln("<tr>");
	document.writeln("<td>");
	document.writeln("<table border='0' cellpadding='0' cellspacing='0'>");
	document.writeln("<tr>");
	document.writeln("<td><a href='javascript: mnuCompany.ClickLink()' 	onMouseOut='mnuCompany.RestoreImage()' 		onMouseOver='mnuCompany.ChangeImage(statusOVER)'>	<img name='imgCompany' border='0' src='Images/CompanyOff.gif' width='66' height='20'></a></td>");
	document.writeln("<td><a href='javascript: mnuCellularPVC.ClickLink()'	onMouseOut='mnuCellularPVC.RestoreImage()' 	onMouseOver='mnuCellularPVC.ChangeImage(statusOVER)'>	<img name='imgPVC' border='0' src='Images/PvcOff.gif' width='81' height='20'></a></td>");
	document.writeln("<td><a href='javascript: mnuCatalog.ClickLink()' 	onMouseOut='mnuCatalog.RestoreImage()' 		onMouseOver='mnuCatalog.ChangeImage(statusOVER)'>	<img name='imgCatalog' border='0' src='Images/CatalogOff.gif' width='68' height='20'></a></td>");
	document.writeln("<td><a href='javascript: mnuClientZone.ClickLink()' 	onMouseOut='mnuClientZone.RestoreImage()' 	onMouseOver='mnuClientZone.ChangeImage(statusOVER)'>	<img name='imgZone' border='0' src='Images/ZoneOff.gif' width='79' height='20'></a></td>");
	document.writeln("<td><a href='javascript: mnuVIPRoom.ClickLink()' 	onMouseOut='mnuVIPRoom.RestoreImage()' 		onMouseOver='mnuVIPRoom.ChangeImage(statusOVER)'>	<img name='imgVIP' border='0' src='Images/VipOff.gif' width='64' height='20'></a></td>");
	document.writeln("<td><img border='0' src='Images/BarreMenus.gif' width='292' height='20'></td>");
	document.writeln("</tr>");
	document.writeln("</table>");
	document.writeln("</td>");
	document.writeln("</tr>");
	document.writeln("</table>");
	document.writeln("</td>");
	document.writeln("</tr>");
	document.writeln("<tr>");
	document.writeln("<td>&nbsp;</td>");
	document.writeln("<td>");
	}
	
function EcritBasPage(){
	document.writeln("</td>");
	document.writeln("</tr>");
	document.writeln("</table>");
	document.writeln("</td>");
	document.writeln("<td bgcolor='#666666'><img border='0' src='Images/PointCharcoal.gif' width='1' height='1'></td>");
	document.writeln("</tr>");
	document.writeln("<tr>");
	document.writeln("<td colspan='3'><img border='0' src='Images/PointCharcoal.gif' width='778' height='1'></td>");
	document.writeln("</tr>");
	if (window.screen.height>659){
		document.writeln("<tr>");
		document.writeln("<td colspan='3'><img border='0' src='Images/PointGris.gif' width='778' height='30'></td>");
		document.writeln("</tr>");
	};
	document.writeln("</table>");
	document.writeln("</center>");
	document.writeln("</div>");
}
/* ================================================================================== */
/* Procédure OnLoad	(pré-load des images et sélection du menu pour la page courante) */
/* ---------------------------------------------------------------------------------- */

