<!--
function MM_findObj(n, d) { //v4.01
  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=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_jumpMenu(targ,selObj,restore)
{ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

var browser;

function popupcentree(page,largeur,hauteur,options)
{
var top=(screen.height-hauteur)/2;
var left=(screen.width-largeur)/2;
window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}

function PopUp(src)
	{
	size=",width=500,height=700"
    	browser=window.open(src, "","scrollbars=no,resizable=yes,toolbar=no,status=no,menubar=no,location=no,directories=no"+size)
	}

function PopUpSpe(src,name,w,h)
	{
	size=",width="+w+",height="+h
	browser=window.open(src, name,"scrollbars=yes,resizable=yes,toolbar=no,status=no,menubar=no,location=no,directories=no"+size)
	}
	
function PopUpSpe2(src,name,w,h)
	{
	size=",width="+w+",height="+h
	browser=window.open(src, name,"scrollbars=yes,resizable=yes,toolbar=no,status=no,menubar=no,location=no,directories=no"+size)
	}
	
function PopupImage(img) {
	titre="AGRANDISSEMENT";
	w=open("",'image','width=400,height=400,toolbar=no,scrollbars=no,resizable=no');	
	w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE></HEAD>");
	w.document.write("<SCRIPT language=javascript>function checksize()  { if (document.images[0].complete) {  window.resizeTo(document.images[0].width+10,document.images[0].height+48); window.focus();} else { setTimeout('check()',250) } }</"+"SCRIPT>");
	w.document.write("<BODY onload='checksize()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0><IMG src='"+img+"' border=0>");
	w.document.write("");
	w.document.write("</BODY></HTML>");
	w.document.close();
}
function PopupImage2(img) {
	titre="AGRANDISSEMENT";
	w=open("",'image','width=400,height=400,toolbar=no,scrollbars=no,resizable=no');	
	w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE></HEAD>");
	w.document.write("<SCRIPT language=javascript>function checksize()  { if (document.images[0].complete) {  window.resizeTo(document.images[0].width+15,document.images[0].height+100); window.focus();} else { setTimeout('check()',250) } }</"+"SCRIPT>");
	w.document.write("<BODY onload='checksize()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0>");
	w.document.write("<link rel='stylesheet' href='../style.css' type='text/css'>");
	w.document.write("<Table><tr><td>");
	w.document.write("<IMG src='"+img+"' border=0>");
	w.document.write("</td></tr>");
	w.document.write("<tr><td align='right'>");
	w.document.write("<b>Définissez votre itinéraire avec mappy : <a href='http://www.mappy.fr' target='_blank'>www.mappy.fr</A></b>&nbsp;&nbsp;");
	w.document.write("</td></tr></Table>");
	w.document.write("</BODY></HTML>");
	w.document.close();
}
function PopupImage3(img) {
	titre="AGRANDISSEMENT";
	w=open("",'image','width=400,height=400,toolbar=no,scrollbars=no,resizable=no');	
	w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE></HEAD>");
	w.document.write("<SCRIPT language=javascript>function checksize()  { if (document.images[0].complete) {  window.resizeTo(document.images[0].width+15,document.images[0].height+100); window.focus();} else { setTimeout('check()',250) } }</"+"SCRIPT>");
	w.document.write("<BODY onload='checksize()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0>");
	w.document.write("<link rel='stylesheet' href='../style.css' type='text/css'>");
	w.document.write("<Table><tr><td>");
	w.document.write("<IMG src='"+img+"' border=0>");
	w.document.write("</td></tr>");
	w.document.write("<tr><td align='right'>");
	w.document.write("<b>Define your route with mappy : <a href='http://www14.mappy.com/?lang=en' target='_blank'>www.mappy.fr</A></b>&nbsp;&nbsp;");
	w.document.write("</td></tr></Table>");
	w.document.write("</BODY></HTML>");
	w.document.close();
}
function PopupImage4(img) {
	titre="AGRANDISSEMENT";
	w=open("",'image','width=400,height=400,toolbar=no,scrollbars=no,resizable=no');	
	w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE></HEAD>");
	w.document.write("<SCRIPT language=javascript>function checksize()  { if (document.images[0].complete) {  window.resizeTo(document.images[0].width+15,document.images[0].height+100); window.focus();} else { setTimeout('check()',250) } }</"+"SCRIPT>");
	w.document.write("<BODY onload='checksize()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0>");
	w.document.write("<link rel='stylesheet' href='../style.css' type='text/css'>");
	w.document.write("<Table><tr><td>");
	w.document.write("<IMG src='"+img+"' border=0>");
	w.document.write("</td></tr>");
	w.document.write("<tr><td align='right'>");
	w.document.write("<b>Defina su ruta con mappy : <a href='http://www14.mappy.com/?lang=es' target='_blank'>www.mappy.fr</A></b>&nbsp;&nbsp;");
	w.document.write("</td></tr></Table>");
	w.document.write("</BODY></HTML>");
	w.document.close();
}

function PopupImageSpe(img) {
	titre="AGRANDISSEMENT";
	w=open("",'image','width=250,height=187,toolbar=no,scrollbars=no,resizable=no');	
	w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE></HEAD>");
	w.document.write("<SCRIPT language=javascript>function checksize()  { if (document.images[0].complete) {  window.resizeTo(document.images[0].width+12,document.images[0].height+30); window.focus();} else { setTimeout('check()',250) } }</"+"SCRIPT>");
	w.document.write("<BODY onload='checksize()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0><IMG src='"+img+"' width='250' height='187' border=0>");
	w.document.write("");
	w.document.write("</BODY></HTML>");
	w.document.close();
}

var browser_type=navigator.appName
function Printbutton(message){
	if (browser_type=="Netscape"){
		window.print();
	}
else 
	if ( self.print ){
		self.print();
	}
else{
		alert(message);
	}
}


////////////////////////////////////////////////////////
// POPUP PERSONNALISE
////////////////////////////////////////////////////////
function popupperso(url,width,height,title,fermer)
{
	$('body').prepend('<div id="popuptoremove"><div id="cache2" style="filter: progid:DXImageTransform.Microsoft.alpha(opacity=70);"></div><div id="popup"><div class="titre_popup"></div><div class="fermer"><a href="javascript:;" onclick="popup_close()"></a></div><div class="txt_popup"></div></div></div>');
	
	$('#popup .txt_popup').html('<div class="loader"></div>');
	$('#popup .titre_popup').html(title);
	$('#cache2').fadeIn(400);
	$('#popup').fadeIn(400);
	
	if(width != null)
	{
		$('#popup').css(
		{
			'width' : width + 'px',
			'margin-left' : -(width/2) + 'px'
		});
		$('#popup .txt_popup').css(
		{
			'width' : (width-40) + 'px'
		});
	}
	if(height != null)
	{
		$('#popup').css(
		{
			'height' : height + 'px',
			'margin-top' : -(height/2) + 'px'
		});
		$('#popup .txt_popup').css(
		{
			'height' : (height-60) + 'px'
		});
	}
	
	if(fermer != false)
		$('#cache2').live('click',function(){popup_close()});
	else
		$('#popup .fermer').remove();
	
	$.get(url,{},function success(txt)
	{
		$('#popup .txt_popup').html(txt);		
	});
}
function popup_close()
{
	$('#cache2').fadeOut(400);
	$('#popup').fadeOut(400);
	setTimeout("$('#popuptoremove').remove()",500);
}

function envoiForm() 
{
	$('#decoteform').ajaxForm();
	
	urlaction=document.getElementById('decoteform').action;
	dataform=$('#decoteform').formSerialize();
	$('#popup .txt_popup').html('<div class="loader"></div>');
	
	var contenu = $.ajax({
		type: 'POST',
		url: urlaction,
		cache: false,
		dataType:"text",
		contentType: "application/x-www-form-urlencoded",
		data: dataform,
		async: false
	}).responseText;
	$('.txt_popup').html(contenu);
}
//-->
