window.status = "Inscrivez-vous gratuitement à la newsletter Carkoo 'Entre-news'.";

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

function js_call2() { 
  var d=document; if(d.images){ if(!d.C_p) d.C_p=new Array();
    var i,j=d.C_p.length,a=js_call2.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.C_p[j]=new Image; d.C_p[j++].src=a[i];}}
}

function js_call3(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=js_call3(n,d.layers[i].document); return x;
}

function js_call4() { 
  var i,j=0,x,a=js_call4.arguments; document.C_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=js_call3(a[i]))!=null){document.C_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function js_sondage() {

	//if( (document.sondage.reponse[0].checked) || (document.sondage.reponse[1].checked) || (document.sondage.reponse[2].checked)) {	
	
		if (document.sondage.reponse[0].checked) {
			popupsondage = window.open("./html/sondages/vote.php?sondID=1&optionID=1","sondage","width=350,height=130,noscrollbars");
		} else if (document.sondage.reponse[1].checked) {
			popupsondage = window.open("./html/sondages/vote.php?sondID=1&optionID=2","sondage","width=350,height=130,noscrollbars");
		} else {
			popupsondage = window.open("./html/sondages/vote.php?sondID=1&optionID=3","sondage","width=350,height=130,noscrollbars");
		}
		
		popupsondage.focus(); 
		
	/*	
   	} else {
   		alert("Choisissez une réponse");
	}
	*/
}


function js_quizz() {
	
	if( !((document.quizz.reponse[0].checked) || (document.quizz.reponse[1].checked) || (document.quizz.reponse[2].checked))) {		
   		alert("Choisissez une réponse");
   		return;
	}
	
	document.quizz.submit();
	return;
}





function checkOnKeyPressNum(){
		if ( "1234567890".indexOf( String.fromCharCode(window.event.keyCode) ) == -1 ) {
					window.event.keyCode = null;
					return false;
				}

		return true;
	}
	
	
function js_dept( num ) {

	
	document.fiche.departementID.value = num;
	document.fiche.submit();
	return true;
}


function js_dept_liste(){
	var dept=document.fiche.listeID.options[document.fiche.listeID.options.selectedIndex].value;
	if (dept!=-1) {
		js_dept(dept);
	}
}	


function js_imprimer_bon( bonID ) {
	
	reduction = window.open("./html/formulaires/club/imprimerbon.php?bonID="+bonID,"Bon","width=470,height=400,noscrollbars");
	reduction.focus();
	
}



function js_en_eur()
{

if(document.fiche.prix_ff.value=="") 
{
	document.fiche.prix_eur.value="";
	return;
}
prix=parseFloat(document.fiche.prix_ff.value);
if(isNaN(prix)) return;	
document.fiche.prix_eur.value=Math.round(prix/6.55957);
}


function js_en_ff()
{
if(document.fiche.prix_eur.value=="") {
	document.fiche.prix_ff.value="";
	return;
}
prix=parseFloat(document.fiche.prix_eur.value);
if(isNaN(prix)) return;	
document.fiche.prix_ff.value=Math.round(prix*6.55957);
}



function js_lienutile( lien ) {
	
	popup_lienutile = window.open(lien,"lienutile","scrollbars=yes,width=800,height=500,menu=false");
	popup_lienutile.focus();
	
}


function js_envoipage()
{ window.open('./html/popup/envoipage?urlenvoi=' + this.location,'envoipage','scrollbars=no,width=500,height=450,toolbar=no,location=no,status=no,menubar=no,resizable=no');}


function js_envoipage2( lien )
{ 
	lien = String(lien);
  	//lien = lien.substring(11);
  	lien = lien.replace(/\&/g,"[AND]");   
  	//alert(lien);		
	window.open('./html/popup/envoipage.php?urlenvoi=' + lien,'envoipage','scrollbars=no,width=500,height=450,toolbar=no,location=no,status=no,menubar=no,resizable=no');
	return;
	}
	
function js_popup( lien, nom, params ) {
	popup_open = window.open(lien,nom,params);
	popup_open.focus();
}


function js_envoicards( lien )
{ 		
	window.open('http://www.carkoo.com/html/popup/envoicards.php?numcards=' + String(lien),'envoicards','scrollbars=yes,width=500,height=450,toolbar=no,location=no,status=no,menubar=no,resizable=no');
	return;
	}


var avantCol;
function js_sel(tr, type) {
		
	if (type == 0) {
		avantCol = tr.className;
		tr.className = 'trSelection';
	} else {
		tr.className = avantCol;
	}
}




function js_deletevoitures() {
	
	
	len = document.liste.elements.length;
	var nomelement;
	var listeelement = '';
	var i=0;
	for( i=0; i<len; i++) {
		nomelement = document.liste.elements[i].name;		
		if (document.liste.elements[i].type=='checkbox') {
			if (document.liste.elements[i].checked) {
				listeelement = listeelement + nomelement + ",";
			} 
		}
	}
	
	if (listeelement == '') {
		alert("Veuillez sélectionner au moins un véhicule.\n(cases à cocher sur la droite)");		
	}
	else {
		if (confirm("Etes vous sur de vouloir supprimer les véhicules sélectionnés ?")) {		
					
			listeelement=listeelement.substring(0,listeelement.length - 1);			
			document.liste.elements["listeV"].value = listeelement;
			document.liste.submit();
		
		}
	}
	
}		

