/* Menu par Jean Claude BERGEVIN (10-10-06) */

/* Scrollbar pour page classique */
function move01()  {
  chk = document.body.clientWidth + 2;
  if(window.event.x > chk) //
     {
    document.body.style.scrollbarFaceColor = "ebe9c3";//Curseur ouvert
    document.body.style.scrollbarShadowColor = "999999";//Liseret droit et bas
    document.body.style.scrollbarHighlightColor = "999999";//Liseret gauche et haut
    document.body.style.scrollbarTrackColor = "ffffcc";//Fond flèche
    document.body.style.scrollbarArrowColor = "ffffcc";//scrollbar-flèche
    }
  else
   {
    document.body.style.scrollbarFaceColor = "ffffcc";//Curseur fermé
    document.body.style.scrollbarShadowColor = "cc6600";//Liseret droit et bas
    document.body.style.scrollbarHighlightColor = "cc6600";//Liseret gauche et haut
    document.body.style.scrollbarTrackColor = "ffffcc";//Fond flèche
    document.body.style.scrollbarArrowColor = "ae8300";//scrollbar-flèche
    }
 } 
 
 /* Scrollbar pour page Galerie photos */
 function move02()
 {
  chk = document.body.clientWidth + 2;
  if(window.event.x > chk) //
     {
    document.body.style.scrollbarFaceColor = "006600";//Curseur ouvert
    document.body.style.scrollbarShadowColor = "ccffcc";//Liseret droit et bas
    document.body.style.scrollbarHighlightColor = "ccffcc";//Liseret gauche et haut
    document.body.style.scrollbarTrackColor = "003300";//Fond flèche
    document.body.style.scrollbarArrowColor = "ccffcc";//scrollbar-flèche
    }
  else //
   {
    document.body.style.scrollbarFaceColor = "ccffcc";//Curseur fermé
    document.body.style.scrollbarShadowColor = "ccffcc";//Liseret droit et bas
    document.body.style.scrollbarHighlightColor = "ccffcc";//Liseret gauche et haut
    document.body.style.scrollbarTrackColor = "003300";//Fond flèche
    document.body.style.scrollbarArrowColor = "003300";//scrollbar-flèche
    }
 } 
 
 /* Scrollbar pour fenetre information*/
 function move04()
 {
  chk = document.body.clientWidth + 2;
  if(window.event.x > chk) //
     {
    document.body.style.scrollbarFaceColor = "ccffcc";//Curseur ouvert
    document.body.style.scrollbarShadowColor = "ccffcc";//Liseret droit et bas
    document.body.style.scrollbarHighlightColor = "ccffcc";//Liseret gauche et haut
    document.body.style.scrollbarTrackColor = "ccff99";//Fond
    document.body.style.scrollbarArrowColor = "339966";//scrollbar-flèche
   }
  else //
   {
    document.body.style.scrollbarFaceColor = "ccff99";//Curseur fermé
    document.body.style.scrollbarShadowColor = "339966";//Liseret droit et bas
    document.body.style.scrollbarHighlightColor = "339966";//Liseret gauche et haut
    document.body.style.scrollbarTrackColor = "ccff99";//Fond
    document.body.style.scrollbarArrowColor = "339966";//Flèche
   }
 }
   
/* Ouvre image dans fenêtre Windows */ 

function PopImg1(adresse,nomFenetre, largeur, hauteur, scroll) 
  {
var text = nomFenetre.toString() ;
var maReg = new RegExp( "_", "gi") ;
var nom_image = nomFenetre.replace( maReg, " " ) ;
var hauteur=hauteur+100;
var largeur=largeur+70;

var largeurEcran = (screen.width - largeur) / 2;
var hauteurEcran = (screen.height - hauteur) / 2;
w=open(adresse, nomFenetre, 'height=' + hauteur + ', width=' + largeur + ', top=' + hauteurEcran + ', left=' + largeurEcran + ', scrollbars=' + scroll + ', resizable')
w.document.write("<HTML><head><title>"+nom_image+"</title></head>");
w.document.write("<BODY leftMargin=20 topMargin=20 marginwidth=20 marginheight=20>");
w.document.write("<TABLE width='100%' border='5' cellspacing='5' cellpadding='5' height='100%'><TR>");
w.document.write("<TD valign='middle' align='center'><IMG src='"+adresse+"' border=0 alt='Photos GTO'>"); 
w.document.write("</TD></TR></TABLE>");
w.document.write("</BODY></HTML>"); 
w.document.close();
  }

function PopImg2(NomImg, titre,largeur,hauteur,legende)
{
var haut=hauteur+120;
var larg=largeur+120;
var v_left = (screen.width-larg)/2;
var v_top = (screen.height-haut)/2;
var parametre = "top="+v_top+",left="+v_left+",toolbar=no,scrollbars=no,resizable=no,screenX=1,width=" +larg+ ",height=" +haut;
fen= open("",titre,parametre);
fen.focus();
fen.document.write("<html>\r<title>\rZoom\r</title>\r<body leftmargin=0 marginheigth=0 marginwidth=0 topmargin=0 bgcolor=#003300>\r<table height=100% width=100%>\r<tr>\r<td valign=middle align=center style='color: white;font-size: 15px; font-style: normal; margin: 2px'>\r<a href='Javascript:window.close()'>\r<img border=5 style='border-color: #ffffff' src='"+NomImg+"'>\r</a>\r<br>"+legende+"</b></td>\r</tr>\r</table>\r</body>\r</html>");
}

function open_window(adresse,hauteur,largeur){
var v_width=hauteur;
var v_height=largeur;
var v_left = (screen.width-v_width)/40;
var v_top = (screen.height-v_height)/40;
var v_settings = 'width='+v_width+',height='+v_height+',top='+v_top+',left='+v_left+',scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';
auxi=window.open(adresse,"auxi",v_settings);
auxi.focus();
}

/* Impression */ 
function impression(){
var isNetscape = (navigator.appName == "Netscape");
var isMacIE = ( (navigator.userAgent.indexOf("IE 4")  > -1) && (navigator.userAgent.indexOf("Mac")  > -1) );
var layerRef = (isNetscape) ? "document" : "document.all";
var styleRef = (isNetscape) ? "" : ".style";
eval(layerRef + '["niv_4"]' + styleRef + '.overflow = "visible"');
print();
}



/* Copyright */ 
var clickmessage="Copyrigth © gtobeissance"

function disableclick(e) {
if (document.all) {
if (event.button==2||event.button==3) {
if (event.srcElement.tagName=="IMG"){
alert(clickmessage);
return false;
}
}
}
if (document.layers) {
if (e.which == 3) {
alert(clickmessage);
return false;
}
}
}

function associateimages(){
for(i=0;i<document.images.length;i++)
document.images[i].onmousedown=disableclick;
}

if (document.all)
document.onmousedown=disableclick
else if (document.layers)
associateimages()


/* Affiche le jour et l'heure */
function Zero(_nbr) { return (_nbr < 10) ? '0' + _nbr : _nbr; }

Date.prototype.Heure=function (_langage){
  var sHeures = Zero(this.getHours());
  var sMinutes = Zero(this.getMinutes());
  var sSecondes = Zero(this.getSeconds());
  var sTemp = "";
  switch (_langage.toLowerCase()) {
    case "fr" : sTemp = sHeures + ' h ' + sMinutes + ' : ' + sSecondes; break;
    case "es" : sTemp = sHeures + ' . ' + sMinutes + ' : ' + sSecondes; break;
    default : sTemp = sHeures + ' : ' + sMinutes + ' : ' + sSecondes;
  }
  return sTemp;
}

function AffHeure() {
	navvers = navigator.appVersion.substring(0,1);
	if (navvers > 3)
		navok = true;
	else
		navok = false;
  var dDate = new Date();
	var jour = dDate.getDay();
	var numero = dDate.getDate();
	if (numero<10)
		numero = "0"+numero;
		mois = dDate.getMonth();
	if (navok)
		annee = dDate.getFullYear();
	else
		annee = dDate.getYear();
	TabJour = new Array("Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi");
	TabMois = new Array("janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre");
	messageDate = TabJour[jour] + " " + numero + " " + TabMois[mois] + " " + annee;
  document.getElementById("date").innerHTML = messageDate + " &nbsp;&nbsp;&nbsp; " + dDate.Heure('fr');
  oDelais = setTimeout("AffHeure()",1000);
}

/* Fonctions pour menu horizontal*/
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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.01
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 && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->


function quickSearch(){
var strInput =window.document.QuickSearchForm.searchInput.value 
if (('mots clés, réf., marque...' != strInput) && ('' != strInput.replace(/ /g,'')))
{

window.document.QuickSearchForm.submit();
}
}


function NewWindow(mypage, myname, w, h, scroll) 
{
var winl = ((screen.width - w) / 2)-4;
var wint = ((screen.height - h) / 2)-13;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',status=no, directories=no, toolbar=no, location=no, menubar=no, scrollbars='+scroll+', resizable=no, Index'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.focus(); }
}

function isEmail4(str) 
{
// are regular expressions supported?
if (-1 != str.indexOf("'")) return false;
var supported = 0;
if (window.RegExp) {
var tempStr = "a";
var tempReg = new RegExp(tempStr);
if (tempReg.test(tempStr)) supported = 1;
}
if (!supported)
return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
var r2 = new RegExp("^[^ ]+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
return ((!r1.test(str)) && r2.test(str));
}

function header_NewsReg(cid)
{		
email = ''+window.document.emailForm.header_email.value;
if (!isEmail4(email)) 
{
alert('e-mail non valide');
}
else
{

str = 'news_reg.asp?cid='+cid+'&email='+email+'&idNews=1'
NewWindow(str,'','200', '40', 'no');
}
}

function CheckForm()
{						
return treu;						
}

function submit()
{
window.document.Frm.submit();				
}	

function AddProd(formulaire)
{
var x=formulaire.quant.value
var anum=/(^\d+$)|(^\d+.\d+$)/
if (anum.test(x))
	{
		formulaire.submit();
	}
else{
	alert("Entrez un nombre valide")
	}
}

function gotoLink() 
{
goingTo = document.quickMenu.link.options[document.quickMenu.link.selectedIndex].value;
if (goingTo == "")
  { return; }
else
  { self.location = goingTo; }
}


function redirection(urlr)
{
document.location.href = urlr;
}

 /* Fonction clic droit */
function clicie() {
	// Fonction de détection pour Internet Explorer
	if ((event.button==2)||(event.button==3)) {
		alert("Copyrigth © GT  Obeissance");
	}
}
function clicns(e){
	// Fonction pour Netscape
	if(e.which==3){
		alert("Copyrigth © GT-Obeissance");
		return false;
	}
}


if (document.all) {	document.onmousedown=clicie;}
if (document.layers) {document.captureEvents(Event.MOUSEDOWN); document.onmousedown = clicns;}
if (window.sidebar) {document.captureEvents(Event.MOUSEDOWN); document.onmousedown = clicns;}

 /* Fonction pour bulle*/
var IB=new Object;
var posX=IB.posX;posY=IB.posY;
var xOffset=100;yOffset=30;

function AffBul(texte) {
  contenu="<TABLE border=0 cellspacing=0 cellpadding="+IB.EpaBor+"><TR bgcolor='"+IB.ColBor+"'><TD><TABLE border=0 cellpadding=2 cellspacing=0 bgcolor='"+IB.ColFon+"'><TR><TD><FONT size='-1' face='arial' color='"+IB.ColTex+"'>"+texte+"</FONT></TD></TR></TABLE></TD></TR></TABLE>&nbsp;";
  var finalPosX=posX-xOffset;
  if (finalPosX<0) finalPosX=0;
  if (document.layers) {
    document.layers["bulle"].document.write(contenu);
    document.layers["bulle"].document.close();
    document.layers["bulle"].top=posY+yOffset;
    document.layers["bulle"].left=finalPosX;
    document.layers["bulle"].visibility="show";}
  if (document.all) {
    bulle.innerHTML=contenu;
    document.all["bulle"].style.top=posY+yOffset;
    document.all["bulle"].style.left=finalPosX;//f.x-xOffset;
    document.all["bulle"].style.visibility="visible";
  }
  else if (document.getElementById) {
    document.getElementById("bulle").innerHTML=contenu;
    document.getElementById("bulle").style.top=posY+yOffset;
    document.getElementById("bulle").style.left=finalPosX;
    document.getElementById("bulle").style.visibility="visible";
  }
}
function getMousePos(e) {
  if (document.all) {
  posX=event.x+document.body.scrollLeft;
  posY=event.y+document.body.scrollTop;
  }
  else {
  posX=e.pageX; 
  posY=e.pageY; 
  }
}
function CacheBul() {
	if (document.layers) {document.layers["bulle"].visibility="hide";}
	if (document.all) {document.all["bulle"].style.visibility="hidden";}
	else if (document.getElementById){document.getElementById("bulle").style.visibility="hidden";}
}
function IniBul(ColTex,ColFon,ColBor,EpaBor,posiX,posiY) {
	IB.ColTex=ColTex;IB.ColFon=ColFon;IB.ColBor=ColBor;IB.EpaBor=EpaBor;IB.posX=posiX;IB.posY=posiY
	if (document.layers) {
		window.captureEvents(Event.MOUSEMOVE);window.onMouseMove=getMousePos;
		document.write("<LAYER name='bulle' top=0 left=0 visibility='hide'></LAYER>");
	}
	if (document.all) {
		document.write("<DIV id='bulle' style='position:absolute;top:0;left:0;visibility:hidden'></DIV>");
		document.onmousemove=getMousePos;
	}
	else if (document.getElementById) {
	        document.onmousemove=getMousePos;
	        document.write("<DIV id='bulle' style='position:absolute;top:0;left:0;visibility:hidden'></DIV>");
	}
}

 /* Fonction pour permutation d'images*/
function MM_findObj(n, d) { 
  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 && d.getElementById) x=d.getElementById(n); return x;
}

function swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

