// ouverture de fenetre 
// P=url de la page
// T=nom ou titre de la fenetre
// W=width H=height
// S= 0 ou 1 pour scrollbars actifs
// R= 0 ou 1 pour fenetre resizable
function OpenW(P,T,W,H,S,R)
{
	window.open(P,T,'toolbar=0,location=0,directories=0,menuBar=0,statusBar=0,scrollbars=' + S + ',resizable=' + R + ',width=' + W + ',height=' + H +',screenX=250,screenY=150,left=150,top=50,statusBar=no');
}

function countpath ( obj ) {

        var name = obj.name ;
	c = obj.value.substr ( obj.value.length - 1, 1 );
        if ( obj.name == "CODE" ) {                         		//CODE
		obj.value = obj.value.toUpperCase() ;
                //if ( obj.value.length == 15 ) position ( "PASSWORD" ) ;                   
        } else if ( obj.name == "OPCODE" ) {                       //OPCODE
		obj.value = obj.value.toUpperCase() ;
                if ( obj.value.length == 30 ) Envoi() ;                   
        } else if ( obj.name == "PASSWORD" ) {                       //PASSWORD
		obj.value = obj.value.toUpperCase() ;
                if ( obj.value.length == 30 ) Envoi() ;                   
        }
}

// Affichage des mentions legales
function afficheChoix( ID , operation)
{
	//operation = cacher / afficher
	if ( operation == 'afficher')
		{window.document.getElementById(ID).style.display= 'block';}
	else
		{window.document.getElementById(ID).style.display= 'none';}
}
// Affichage des informations
function InfosAccueil(Id) 
{       
	if (!Id==0){
	var Pg = "infos.aspx?F=haccueil.xml&id="+Id;         
        OpenW(Pg, 'info', 300, 200,1 ,1);
	}
}

// Affichage animation flash
function ShowAnimFlash()
{
	var Pg = "../images/accueil/animation/loader.htm";
	OpenW(Pg, 'animation', 750, 400,0 ,0);
}

// Ecran production  detail contrat
function ShowProd(Idc,Type)
{
var repertoire;
 switch(Type)
 {
  case("MOTO"):
    repertoire="../produits/moto/pages/";
  break;
  case("AUTO"):
    repertoire="../produits/auto/pages/";
  break;
  case("CYCLO"):
    repertoire="../produits/cyclo/pages/";
  break;
  case("MRH"):
    repertoire="../produits/mrh/pages/";
  break;
  default:
    repertoire="../produits/mrh/pages/";
  break; 
 }   
	var page = repertoire + "ecprod.aspx?e=c&idc=" + Idc;
	OpenW(page,"autoprod",800,650,1);
}