function gopage(url)
{
temp=document.getElementById('mot').value;
if(url=="rechercher.php")
	window.location=url+"?mot="+temp;
else window.location=url+"&mot="+temp;
}

function affiche(temp)
{
if((temp=="email")&&(document.formid.email.value==''))
	document.formid.email.value=temp;	
else if((temp=="password")&&(document.formid.pwd.value==''))
		document.formid.pwd.value=temp;	
}

function efface(temp)
{
if((temp=="email")&&(document.formid.email.value==temp))
	document.formid.email.value='';	
else if((temp=="password")&&(document.formid.pwd.value==temp))
		document.formid.pwd.value='';	
}

function montre(id) {
	var d = document.getElementById(id);
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
	}
	if (d) {d.style.display='block';}
}

function montre2(id) {
	var d = document.getElementById(id);
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('ssmenu'+i)) {document.getElementById('ssmenu'+i).style.display='none';}
	}
	if (d) {d.style.display='block';}
}

var i;
var picfiles; var pictime;
function preload_pic(){
    picfiles=preload_pic.arguments;
    pictime=new Array();
    for (i=0; i<picfiles.length; i++) {
          pictime[i]=new Image;
          pictime[i].src=picfiles[i];}
}
function changeIm(ref){
	document.getElementById('imageG').src='photo/grande/'+ref+'.jpg';
}
function show_time() {
   var mydate=new Date();
   var hh= mydate.getHours();
         if (hh<10) {phh='<img src='+picfiles[0]+' height=24px><img src='+picfiles[hh]+' height=24px>';}
         if (hh>9) {
             hh=hh.toString();
             phh='<img src='+picfiles[(hh.substr(0,1))]+' height=24px><img src='+picfiles[(hh.substr(1))]+' height=24px>';}
   var mm= mydate.getMinutes();
         if (mm<10) {pmm='<img src='+picfiles[0]+' height=24px><img src='+picfiles[mm]+' height=24px>';}
         if (mm>9) {
             mm=mm.toString();
             pmm='<img src='+picfiles[(mm.substr(0,1))]+' height=24px><img src='+picfiles[(mm.substr(1))]+' height=24px>';}
   var ss= mydate.getSeconds();
         if (ss<10) {pss='<img src='+picfiles[0]+' height=24px><img src='+picfiles[ss]+' height=24px>';}
         if (ss>9) {
             ss=ss.toString();
             pss='<img src='+picfiles[(ss.substr(0,1))]+' height=24px><img src='+picfiles[(ss.substr(1))]+' height=24px>';}
document.getElementById("clock").innerHTML=phh+'<img src='+picfiles[10]+'  height=24px>'+pmm+'<img src='+picfiles[10]+'  height=24px>'+pss;
}
function goforit() {
    setInterval("show_time()",1000);
}
function verifcheck(){
	if((document.getElementById('nom').value=="")||(document.getElementById('pnom').value=="")||
	(document.getElementById('cpwd').value=="")||(document.getElementById('pwd2').value=="")||
	(document.getElementById('mail').value=="")||(document.getElementById('adr').value=="")||
	(document.getElementById('telephone').value=="")||(document.getElementById('cp').value=="")||
	(document.getElementById('ville').value==""))
		{alert("Vous n'avez pas rempli tous les champs * !!!");return false;}
	if(document.getElementById('cbcgv').checked==false)
		{alert("Vous n'avez pas accepté les conditions générales de ventes");return false;}
	return true;
}

function goscript(page){
	
	if((verifcheck())){
		document.form1.action=page;
		document.form1.submit();
	}
}


function demarage(){
	//montre('');
	//montre2('');
	goforit();
	preload_pic("images/0.jpg","images/1.jpg","images/2.jpg","images/3.jpg","images/4.jpg","images/5.jpg","images/6.jpg","images/7.jpg","images/8.jpg","images/9.jpg","images/point.jpg");
}

window.onload=demarage;