// JavaScript Document
var newWin = null;
function closeWin(){
	if (newWin != null){
		if(!newWin.closed)
			newWin.close();
	}
}

function popUp(strURL,strType) {
var strOptions="";
if (strType=="console") strOptions="resizable";
if (strType=="fixed") strOptions="status";
if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,resizable,location";
var newWin=window.open(strURL, strOptions);
newWin.document.close;
newWin.blur();
}

function Test(){
  var age = document.ajout.age;
  
  if(age.checked){
    return true;

  }//fin premier if
  else{
	  alerte="Vous ne pouvez pas ajouter d'annonce si vous n'&ecirc;tes pas majeur !";
    alert(alerte);
    return false;
    
  }
}//fin fonction test



function popUp(strURL,strType,strHeight,strWidth) {
closeWin();
var strOptions="";
if (strType=="console") strOptions="resizable,height="+strHeight+",width="+strWidth;
if (strType=="fixed") strOptions="status,height="+strHeight+",width="+strWidth;
if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,resizable,location,height="+strHeight+",width="+strWidth;
newWin = window.open(strURL, 'newWin', strOptions);
newWin.focus();
}

function addmess(id)
     {
     document.getElementById('option').innerHTML = "<div style='padding:3px;background:#dfedfb'><center><br /><a href='/inscription.html'>Vous devez &ecirc;tre inscript pour envoyer un message<br /> Pour vous incrire Cliquez ici.</a><br /></div>";
     }
	 
function addmessm(id,idm)
     {
     document.getElementById('option').innerHTML = "<div style='padding:3px;background:#dfedfb'><form action='#' name='ajout' method='post'><input type='hidden' name='add' value='addmess'/><input type='hidden' name='emet' value='"+idm+"'/><input type='hidden' name='dest' value='"+id+"'/><table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td><strong>Message :</strong></td></tr><tr><td valign='top' align='center'><textarea name='message' cols='45' rows='5'></textarea></td></tr></table><br /><center><input type='submit' name='button' value='Envoyer' /><center></form></div>";
     }
	 
function reco(id)
     {
     document.getElementById('option').innerHTML = "<div style='padding:3px;background:#dfedfb'><form action='#' name='reco' method='post'><input type='hidden' name='add' value='reco'/><input type='hidden' name='dest' value='"+id+"'/><table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td><strong>Email du destinataire :</strong></td><td><strong>Message ( optionel ):</strong></td></tr><tr><td valign='top'><input type='text' name='email' /><br /><strong>Votre nom :</strong><br /><input type='text' name='nom' /></td><td valign='top'><textarea name='message' cols='40' rows='5'></textarea></td></tr></table><br /><center><input type='submit' name='button' value='Envoyer' /><center></form></div>";     }
/*
function alertp(val)
{
		var valu = val.options[val.selectedIndex].value;
		if(valu == 3)
		{
			document.getElementById('alerta').innerHTML = "attention";	
		}
		else if(valu == 6)
		{
			document.getElementById('alerta').innerHTML = "attention";	
		}else
		{
			document.getElementById('alerta').innerHTML = "";	
		}
}

function reco(id)
     {
     document.getElementById('option').innerHTML = "<div style='padding:3px;background:#dfedfb'><form action='#' name='ajout' method='post'><input type='hidden' name='add' value='reco'/><input type='hidden' name='dest' value='"+id+"'/><table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td><strong>Email du destinataire :</strong></td><td><strong>Message ( optionel ):</strong></td></tr><tr><td valign='top'><input type='text' name='email' /></td><td valign='top'><textarea name='message' cols='40' rows='5'></textarea></td></tr></table><br /><center><input type='submit' name='button' value='Envoyer' /><center></form></div>";     }
	 
function disabled(na)
{
	if(na == 'fichier')
	{
		
			document.addpict.image.value="tesq";
		
	}
}

function mouseMove (evt)    {   
    var x = 0; var y = 0; var plusX = 0; var plusY = 0;   
    if (document.layers)                { x = evt.x;            y = evt.y;          plusX = window.pageXOffset;         plusY = window.pageYOffset;         }    
    else if (document.all)              { x = event.clientX;    y = event.clientY;  plusX = document.body.scrollLeft;   plusY = document.body.scrollTop;    }    
    else if (document.getElementById)   { x = evt.clientX;      y = evt.clientY;    plusX = window.pageXOffset;         plusY = window.pageYOffset;         }   
    document.getElementById("popBox").style.left    = (x+plusX+15)+"px";   
    document.getElementById("popBox").style.top     = (y+plusY+5)+"px";   
}    
if (document.layers)                    document.captureEvents(Event.MOUSEMOVE);    
if (document.layers || document.all)    document.onmousemove = mouseMove;    
if (document.addEventListener)          document.addEventListener('mousemove', mouseMove, true);   
  
function montre(id) {   
    var elt = document.getElementById('popBox');   
    elt.style.display = "block";   
    elt.innerHTML = document.getElementById(id).innerHTML;   
}   
  
function cache()    {   
    var elt = document.getElementById('popBox');   
    elt.style.display = "none";   
} */ 

function conf()
{
	if(confirm("Etes-vous sur de vouloir Supprimer ?"))
	{
		return true;
	}else
	{
		return false;
	}
	
}
