function ow(largeurX,hauteurY,file,nom) {
	var floater = null;
	var chaine = 'width='+largeurX+',height='+hauteurY+',toolbars=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=yes';
	floater=window.open(file,nom,chaine);
//	floater.moveTo(((screen.width / 2) - (largeurX / 2)), ((screen.height / 2) - (hauteurY / 2)));
}

function areyousure(){
	if (confirm("Attention!\nSuivant le nombre d'e-mail stockés, le temps d'envoi peut être extrêmement long.\nContinuer ?")){return true}
	else {return false}
}

/*******************************************************************/
/*       ATTENTION LE TABLEAU ELEMENTS PEUT ETRE DANGEREUX		   */
/*       LE FAIT DE RAJOUTER UN CHAMP AVANT LES EVENEMENTS         */
/*       FAIT CHANGER LES INDICES DES MENUS DEROULANTS !!!         */
/*        													       */
/* val1  = MARQUES   										       */
/* val2  = TITRES	   										       */
/*******************************************************************/

function quelrub_marques(formule_createcar){
	var val1 = '';
	var val2 = '';

	var chp1 = '&rub_marques=1';
	var chp2 = '&rub_tit=1';

	var page   = document.formule_createcar.titre_marques.selectedIndex;
	id_marques = document.formule_createcar.titre_marques.options[page].value;

	var page1 = document.formule_createcar.titre_marques.selectedIndex;
	var val1  = document.formule_createcar.titre_marques.options[page1].value;

	if (id_marques == "autre"){
		//window.open('?createcar=2&val1='+val1+chp1+'&Sex='+cyrius,Longhorn);
		window.open('?createcar=2&val1='+val1+'&val2='+val2+chp1+chp2+'&Sex='+cyrius,Longhorn);
	}else{
		chp1 = '';
		chp2 = '';
		window.open('?createcar=2&val1='+val1+chp1+'&id_marques='+id_marques+'&val2='+val2+chp2+'&Sex='+cyrius,Longhorn);
	}
}


function quelrub_tit(formule_createcar){
	var val1 = '';
	var val2 = '';

	var chp1 = '';
	var chp2 = '&rub_tit=1';

	var page   = document.formule_createcar.titre_tit.selectedIndex;
	id_tit = document.formule_createcar.titre_tit.options[page].value;

	var page1 = document.formule_createcar.titre_marques.selectedIndex;
	var val1  = document.formule_createcar.titre_marques.options[page1].value;

	var page2 = document.formule_createcar.titre_tit.selectedIndex;
	var val2  = document.formule_createcar.titre_tit.options[page2].value;



	if (id_tit == "autre"){
		window.open('?createcar=2&val1='+val1+'&val2='+val2+chp1+chp2+'&Sex='+cyrius,Longhorn);
	}else{
//		chp1 = '';
//		chp2 = '';
//		//window.open('?createcar=2&val1='+val1+chp1+'&id_marques='+id_marques+'&val2='+val2+chp2+'&Sex='+cyrius,Longhorn);
//		window.open('?createcar=2&val1='+val1+chp1+'&val2='+val2+chp2+'&Sex='+cyrius,Longhorn);
	}
}


/*******************************************************************/
/*       ATTENTION LE TABLEAU ELEMENTS PEUT ETRE DANGEREUX		   */
/*       LE FAIT DE RAJOUTER UN CHAMP AVANT LES EVENEMENTS		   */
/*       FAIT CHANGER LES INDICES DES MENUS DEROULANTS !!!		   */
/*        														   */
/* val1  = CARNET    											   */
/* val2  = ADRESSE   											   */
/* val3  = NATURE   											   */
/*******************************************************************/

function quelrub_carnet(formule_notepad){
	var val1 = '';
	var val2 = '';
	var val3 = '';

	var chp1 = '&rub_carnet=1';
	var chp2 = '&rub_add=1';
	var chp3 = '';

	var page  = document.formule_notepad.titre_carnet.selectedIndex;
	id_carnet = document.formule_notepad.titre_carnet.options[page].value;

	var page1 = document.formule_notepad.titre_carnet.selectedIndex;
	var val1  = document.formule_notepad.titre_carnet.options[page1].value;


	if(document.formule_notepad.elements[4].name != 'rubrique_nat'){
		var page3 = document.formule_notepad.titre_nat.selectedIndex;
		var val3  = document.formule_notepad.titre_nat.options[page3].value;
	}else{
		chp3='&rub_nat=1';
	}


	if (id_carnet == "autre"){
		window.open('?notepad=3&val1='+val1+'&val2='+val2+'&val3='+val3+chp1+chp2+chp3+'&Sex='+cyrius,Longhorn);
	}else{
		chp1 = '';
		chp2 = '';
		window.open('?notepad=3&val1='+val1+'&val2='+val2+'&val3='+val3+chp1+chp2+chp3+'&id_carnet='+id_carnet+'&id_nat='+id_nat+'&Sex='+cyrius,Longhorn);
	}
}

function quelrub_add(formule_notepad){
	var val1 = '';
	var val2 = '';
	var val3 = '';

	var chp1 = '';
	var chp2 = '&rub_add=1';
	var chp3 = '';

	var page = document.formule_notepad.titre_add.selectedIndex;
	id_add   = document.formule_notepad.titre_add.options[page].value;

	var page1 = document.formule_notepad.titre_carnet.selectedIndex;
	var val1  = document.formule_notepad.titre_carnet.options[page1].value;

	var page2 = document.formule_notepad.titre_add.selectedIndex;
	var val2  = document.formule_notepad.titre_add.options[page2].value;



	if(document.formule_notepad.elements[4].name != 'rubrique_nat'){
		var page3 = document.formule_notepad.titre_nat.selectedIndex;
		var val3  = document.formule_notepad.titre_nat.options[page3].value;
	}else{
		chp3='&rub_nat=1';
	}

	if (id_add == "autre"){
		window.open('?notepad=3&val1='+val1+'&val2='+val2+'&val3='+val3+chp1+chp2+chp3+'&Sex='+cyrius,Longhorn);
	}
}


function quelrub_nat(formule_notepad){
	var val1 = '';
	var val2 = '';
	var val3 = '';


	var chp1 = '';
	var chp2 = '';
	var chp3 = '&rub_nat=1';


	var page = document.formule_notepad.titre_nat.selectedIndex;
	id_nat   = document.formule_notepad.titre_nat.options[page].value;

	var page3 = document.formule_notepad.titre_nat.selectedIndex;
	var val3  = document.formule_notepad.titre_nat.options[page3].value;



	if(document.formule_notepad.elements[2].name!='rubrique_carnet'){
		var page1 = document.formule_notepad.titre_carnet.selectedIndex;
		var val1  = document.formule_notepad.titre_carnet.options[page1].value;
	}else{
		chp1='&rub_carnet=1';
	}


	if(document.formule_notepad.elements[3].name!='rubrique_add'){
		var page2 = document.formule_notepad.titre_add.selectedIndex;
		var val2  = document.formule_notepad.titre_add.options[page2].value;
	}else{
		chp2='&rub_add=1';
	}


	if (id_nat == "autre"){
		window.open('?notepad=3&val1='+val1+'&val2='+val2+'&val3='+val3+chp1+chp2+chp3+'&Sex='+cyrius,Longhorn);
	}else{
		chp3 = '';
		window.open('?notepad=3&val1='+val1+'&val2='+val2+'&val3='+val3+chp1+chp2+chp3+'&id_carnet='+id_carnet+'&id_nat='+id_nat+'&Sex='+cyrius,Longhorn);
	}
}

/****************************************************************************/
/*                        FONCTION SCROLLING TEXT                           */
/****************************************************************************/

timerID = null;

function ScrollUp(speed){
	if(document.getElementById){
		if(parseInt(txt.style.top) < 0){
			txt.style.top = parseInt(txt.style.top) + speed + "px";
		}
		timerID = setTimeout("ScrollUp("+speed+")",30)
	}
}

function ScrollDown(speed){
	if(document.getElementById){
		if(parseInt(txt.style.top) > cnt.offsetHeight - txt.offsetHeight){
			txt.style.top = parseInt(txt.style.top) - speed + "px";
		}
		timerID = setTimeout("ScrollDown("+speed+")",30)
	}
}

function ScrollStop(){
	if(document.getElementById){
		clearTimeout(timerID);
	}
}

function ScrollInit() {
	if (document.getElementById) {
		cnt = document.getElementById("cont");
		txt = document.getElementById("text");
		txt.style.top = 0;
	}
}

function ScrollInit2() {
	if (document.getElementById) {
		cnt = document.getElementById("cont2");
		txt = document.getElementById("text2");
		txt.style.top = 0;
	}
}


/****************************************************************************/
/*                          FONCTION STARTANIM                              */
/****************************************************************************/

imgPath = new Array;
SiClickGoTo = new Array;
version = navigator.appVersion.substring(0,1);
a = 0;

if (version >= 3){
	i0 = new Image;
	i0.src = './up/fiche_auto_Img1_id1.jpg';
	SiClickGoTo[0] = "#";
	imgPath[0] = i0.src;

	i1 = new Image;
	i1.src = './up/fiche_auto_Img1_id2.jpg';
	SiClickGoTo[1] = "#";
	imgPath[1] = i1.src;
}

function StartAnim(){
	if (version >= 3){
		document.write('<a href="#" onClick="ImgDest();return(false)"><img src="./up/fiche_auto_Img1_id1.jpg" width="146" border="0" alt="Menu" name="defil"></a>');
		defilimg()
	}else{
		document.write('<a href="#"><img src="./up/fiche_auto_Img1_id1.jpg" border="0"></a>')
	}
}

function ImgDest(){
	document.location.href = SiClickGoTo[a-1];
}

function defilimg(){
	if (a == 2){
		a = 0;
	}
	if (version >= 3){
		document.defil.src = imgPath[a];
		tempo3 = setTimeout("defilimg()",2000);
		a++;
	}
}

/****************************************************************************/
/*                         FONCTION STARTSCROLL                             */
/****************************************************************************/


//configurer les 3 variables suivantes pour la hauteur, la largeur et le fond de la zone défilante.
var scrollerwidth=146
var scrollerheight=150
var scrollerbgcolor='Grey'

//configurer les variables suivantes pour le contenu de vos messages.
var messages=new Array()
//messages[0]='<a href="#"><img src="./up/fiche_auto_Img1_id1.jpg" border="0" width="146"></a>'
//messages[1]='<a href="#"><img src="./up/fiche_auto_Img1_id2.jpg" border="0" width="146"></a>'
//messages[2]='<a href="#"><img src="./up/fiche_auto_Img1_id3.jpg" border="0" width="146"></a>'
//messages[3]='<a href="#"><img src="./up/fiche_auto_Img1_id4.jpg" border="0" width="146"></a>'
//messages[4]='<a href="#"><img src="./up/fiche_auto_Img1_id5.jpg" border="0" width="146"></a>'



//if (messages.length>1)
//	i=2
//else
//	i=0
if (messages.length>1)i=messages.length
else i=0

/*
function move1(whichlayer){
	tlayer=eval(whichlayer)
	if (tlayer.top>0&&tlayer.top<=5){
		tlayer.top=0
		setTimeout("move1(tlayer)",3000)
		setTimeout("move2(document.main.document.second)",3000)
		return
	}
	if (tlayer.top>=tlayer.document.height*-1){
		tlayer.top-=5
		setTimeout("move1(tlayer)",100)
	}else{
		tlayer.top=scrollerheight
		tlayer.document.write(messages[i])
		tlayer.document.close()
		if (i==messages.length-1)
			i=0
		else
			i++
	}
}

function move2(whichlayer){
	tlayer2=eval(whichlayer)
	if (tlayer2.top>0&&tlayer2.top<=5){
		tlayer2.top=0
		setTimeout("move2(tlayer2)",3000)
		setTimeout("move1(document.main.document.first)",3000)
		return
	}
	if (tlayer2.top>=tlayer2.document.height*-1){
		tlayer2.top-=5
		setTimeout("move2(tlayer2)",100)
	}else{
		tlayer2.top=scrollerheight
		tlayer2.document.write(messages[i])
		tlayer2.document.close()
		if (i==messages.length-1)
			i=0
		else
			i++
	}
}
*/
function move3(whichdiv){
	tdiv=eval(whichdiv)
	if (tdiv.style.pixelTop>0&&tdiv.style.pixelTop<=5){
		tdiv.style.pixelTop=0
		setTimeout("move3(tdiv)",3000)
		setTimeout("move4(second2)",3000)
		return
	}
	if (tdiv.style.pixelTop>=tdiv.offsetHeight*-1){
		tdiv.style.pixelTop-=5
		setTimeout("move3(tdiv)",100)
	}else{
		tdiv.style.pixelTop=scrollerheight
		tdiv.innerHTML=messages[i]
		if (i==messages.length-1)
			i=0
		else
			i++
	}
}

function move4(whichdiv){
	tdiv2=eval(whichdiv)
	if (tdiv2.style.pixelTop>0&&tdiv2.style.pixelTop<=5){
		tdiv2.style.pixelTop=0
		setTimeout("move4(tdiv2)",3000)
		setTimeout("move3(first2)",3000)
		return
	}
	if (tdiv2.style.pixelTop>=tdiv2.offsetHeight*-1){
	tdiv2.style.pixelTop-=5
	setTimeout("move4(second2)",100)
	}else{
		tdiv2.style.pixelTop=scrollerheight
		tdiv2.innerHTML=messages[i]
		if (i==messages.length-1)
			i=0
		else
			i++
	}
}

function startscroll(){
	if (document.all){
		move3(first2)
		//move1(document.main.document.first)
		second2.style.top=scrollerheight
	}else if (document.layers){
//		move1(document.main.document.first)
//		document.main.document.second.top=scrollerheight+5
//		document.main.document.second.visibility='show'
	}
}

/****************************************************************************/
/*                           FONCTION OPENFRAME                             */
/****************************************************************************/

function openframe(page){
	document.all.bas.src=page;
}




/****************************************************************************/
/*                           FONCTION REDUCFLA                              */
/****************************************************************************/

function reducfla(hauteur){

	//alert(document.getElementById('creab_patriauto').height);
	document.getElementById('creab_patriauto').height=hauteur;
}


/****************************************************************************/
/*                           FONCTION IECOMPATTEST                          */
/****************************************************************************/


var persistclose=0			//set to 0 or 1. 1 means once the bar is manually closed, it will remain closed for browser session
var startX = 19   			//set x offset of bar in pixels
//var startY = 22    			//set y offset of bar in pixels
var startY = 0
var verticalpos="fromtop"	//enter "fromtop" or "frombottom"

function iecompattest(){
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}


/****************************************************************************/
/*                           FONCTION GET_COOKIE	                        */
/****************************************************************************/

function get_cookie(Name) {
	var search = Name + "="
	var returnvalue = "";
	if (document.cookie.length > 0) {
		offset = document.cookie.indexOf(search)
		if (offset != -1) {
			offset += search.length
			end = document.cookie.indexOf(";", offset);
			if (end == -1) end = document.cookie.length;
			returnvalue=unescape(document.cookie.substring(offset, end))
		}
	}
	return returnvalue;
}

/****************************************************************************/
/*                           FONCTION CLOSEBAR		                        */
/****************************************************************************/

function closebar(){
	if (persistclose)
	document.cookie="remainclosed=1"
	document.getElementById("topbar").style.visibility="hidden"
}

/****************************************************************************/
/*                           FONCTION STATICBAR		                        */
/****************************************************************************/

function staticbar(){
	barheight=document.getElementById("topbar").offsetHeight
	var ns = (navigator.appName.indexOf("Netscape") != -1) || window.opera;
	var d = document;
	function ml(id){
		var el=d.getElementById(id);
		if (!persistclose || persistclose && get_cookie("remainclosed")=="")
		el.style.visibility="visible"
		if(d.layers)el.style=el;
		el.sP=function(x,y){this.style.left=x+"px";this.style.top=y+"px";};
		el.x = startX;
		if (verticalpos=="fromtop")
		el.y = startY;
		else{
		el.y = ns ? pageYOffset + innerHeight : iecompattest().scrollTop + iecompattest().clientHeight;
		el.y -= startY;
		}
		return el;
	}
	window.stayTopLeft=function(){
		if (verticalpos=="fromtop"){
		var pY = ns ? pageYOffset : iecompattest().scrollTop;
		ftlObj.y += (pY + startY - ftlObj.y)/8;
		}
		else{
		var pY = ns ? pageYOffset + innerHeight - barheight: iecompattest().scrollTop + iecompattest().clientHeight - barheight;
		ftlObj.y += (pY - startY - ftlObj.y)/8;
		}
		ftlObj.sP(ftlObj.x, ftlObj.y);
		setTimeout("stayTopLeft()", 10);
	}
	ftlObj = ml("topbar");
	stayTopLeft();
}

/****************************************************************************/
/*                         FONCTION AFFICHERIMAGE                           */
/****************************************************************************/

var nb_ref = 1;
var Ref_img = [];

for(x=1;x<=nb_ref;x++){
	Ref_img[x] = [];
}

Ref_img[1][1]='';

function AfficherImage(img){
	Image1 = new Image();
	Image1.src=(img);
	Control(img);
}

function Control(img){
	if((Image1.width!=0)&&(Image1.height!=0)){
		VoirImage(img);
	}else{
	    fonction="Control('"+img+"')";
	    intervalle=setTimeout(fonction,20);
	}
}

function VoirImage(img){
	if (document.layers){
		largeur=Image1.width ;
	  	hauteur=Image1.height;
	}else if (document.getElementById && !document.all){
		largeur=Image1.width +8;
	  	hauteur=Image1.height+44;
	}else{
	  	largeur=Image1.width+5;
	  	hauteur=Image1.height+30;
	}

	proprietes="width="+ largeur +",height="+ hauteur + ",toolbars=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=no";

	win=window.open("","xcyrius",proprietes);
	win.document.write("<html>");
	win.document.write("<head><title>Patri-Auto</title></head>");
	win.document.write("<body topmargin='0' leftmargin='0' marginwidth='0' marginheight='0' align='center' valign='middle' bgcolor='#000000' oncontextmenu='return false'>");
	win.document.write("<table border='0' cellpadding='0' cellspacing='0' align='center' valign='middle'><tr><td align='center'>");
	win.document.write("<img src='"+img+"'></td></tr>");
	win.document.write("</table></body>");
	win.document.write("</html>");
	win.document.close();
	TaillePopup(largeur, hauteur);
}

function TaillePopup(largeur, hauteur){
	win.resizeTo(largeur, hauteur);
	win.focus();
}
