//<![CDATA[
/* Réalisation CD SOFT */
var map;
var periode=20;
var deltaTime="";
var endPollTimer=false;
var pics = new Array();
var lastTab=1;
var noTab=1;
var videoOn=0;
var svideo=0;
var pe;
var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();
function is_lessIe6()
{
	result=false;
	if (is_ie())
	{
		if (BrowserDetect.version<6)
		{
			window.alert('ATTENTION !!! Votre version de navigateur Internet Explorer est trop ancienne (Inférieure à 6) pour utiliser les services de notre site internet. Veuillez procéder à la mise à jour de votre version de navigateur.');
		}
	}
	
}
function is_ie()
{
	var ie=false;
	if (BrowserDetect.browser=='Explorer')
	{
			ie=true;
	}
	return(ie);
}
function is_ie6()
{
	var ie6=false;
	if (BrowserDetect.browser=='Explorer')
	{
		if (BrowserDetect.version<7)
		{
			ie6=true;
		}
	}
	return(ie6);
}
function init_fader() {
  if (document.images) {
    var w = 246, h = 251; // width and height
    var fadeables = $('fadeables').getElementsByTagName('img');
    var nodes = $A(fadeables);
    nodes.each(function(node){
      // stuff the path to each image into pics:
      img_buf = new Image(w, h);
      img_buf.src = node.getAttribute("src");
      pics.push( img_buf );
    });
  }
}
function onAppear(first_image, second_image){   
  // swap the images so that the one that has been faded in is in the outer div
  // and the next one to be faded in is waiting in the invisible inner div...
  document.getElementById("outer-appear").style.background = 'url('+first_image+')';
  document.getElementById("appear-div").style.display = 'none';
  document.getElementById("appear-div").style.background = 'url('+second_image+')';
}

function Appear(pic_one_id, pic_two_id){
  var one_id, two_id;

  // initial fade-in
  new Effect.Appear('appear-div');

  // pic one becomes pic two, the one that has been morphed to...
  one_id = pic_two_id;

  // if we have come to end of pics[], restart from the beginning...
  if(pic_two_id == pics.length-1)
    two_id = 0;
  else
    two_id = pic_two_id+1;

  // get the pics to pass to onAppear...
  pic_one = pics[one_id];
  pic_two = pics[two_id];

  setTimeout("onAppear('"+pic_one.src+"', '"+pic_two.src+"')", 3000);
  setTimeout("Appear("+one_id+", "+two_id+")", 4000);   
}

function getInfoServer()
{
	
	var url='../../files/include/poll_info_server.php';
	var aRequest= new Ajax.Request(url,{onSuccess:getInfoServerComplete});

}
function getInfoServerComplete(xhr)
{
	var resultat="["+xhr.responseText+"]";
	var json = resultat.evalJSON();
	json.each
	(
	function (tab)
	{
		var serverTime = tab.datetime;
		var currentDate = new Date();
		var clientTime=currentDate.getTime();
		var clientTime=clientTime/1000;
		var clientTime=Math.floor(clientTime);
		deltaTime=serverTime-clientTime;
		endPollTimer=true;		
	}
	)
}
function fastAuction()
{
	showAuction(2);
	setValueNextAuction();
	showConfirme(2); 
}
function barreOk(lot)
{
	var ligne='ligne_lot_'+lot;
	$(ligne).setStyle({border:"1px solid #FFD700"});
}
function barreNo(lot)
{
	var ligne='ligne_lot_'+lot;
	$(ligne).setStyle({border:"1px solid #FFFFFF"});

}
function trim_x (myString)
{
return myString.replace(/^\s+/g,'').replace(/\s+$/g,'')
}  
function setValueNext()
{
	var valeur=trim_x($('a_montant_next').innerHTML);
	Form.Element.setValue('ban_auction_oa',valeur);	
}
function setValueNextAuction()
{
	var valeur=trim_x($('a_montant_next').innerHTML);
	Form.Element.setValue('ban_auction',valeur);	
}

function updateData(oa)
{	
	var oa = (oa == null) ? 0 : oa;
	var showListe=0;
	var url='../../files/include/update_template.php';
	var page_name=$('page_name').innerHTML;
	if (page_name=='voir-detail.php')
	{	
		if (!($('list_survey_bis').style.display == 'none'))
		{
			showListe=1;
		}	
	}
	var aRequest= new Ajax.Request(url,{method:'get',parameters:{page_name:page_name,showListe:showListe,oa:oa},onSuccess:onSuccessUpdateTemplate});	
}
function onSuccessUpdateTemplate(xhr)
{
	var resultat="["+xhr.responseText+"]";
	var json = resultat.evalJSON();
	json.each
	(
	function (tab)
	{
		if (tab.error==0)
		{									
			
			$('z_nbselected').update(tab.nb_selected);
			$('z_nblots').update(tab.nb);
			$('z_nbmoa').update(tab.nbmoa);
			$('z_nbveh').update(tab.nbveh);
			$('z_nbpro').update(tab.nbpro);						
			$('z_moa').update(tab.moa);
			$('z_veh').update(tab.veh);
			$('z_pro').update(tab.pro);
			$('i_nb_panier').update(tab.nb_panier);
			// index.php
			if (tab.page_name=='index.php')
			{
				$('i_next_autions_salle').update(tab.salle);
				$('i_next_autions').update(tab.liste_vente);
				$('i_next_autions_future').update(tab.liste_vente_next);
				$('cat_moa_data').update(tab.moa_all);
				$('cat_veh_data').update(tab.veh_all);
				$('cat_pro_data').update(tab.pro_all);
				$('entete_enligne_value').update(tab.nb_online_total);				
				$('entete_ensalle_value').update(tab.liste_lot_salle_all);				
			}	
			if (tab.page_name=='liste-lot.php')
			{
				$('i_liste_lot').update(tab.liste_lot);
				$('z_nbselected_a').update(tab.nb_online);
				$('z_nbselected_b').update(tab.nb_online);				
				$('z_nbselected_salle_a').update(tab.liste_lot_salle);
				$('z_nbselected_salle_b').update(tab.liste_lot_salle);								
			}
			if (tab.page_name=='voir-detail.php')
			{
				//window.alert('1');
				$('a_joker').innerHTML=tab.joker;
				$('a_joker_text').innerHTML=tab.joker_text;	
				$('a_montant').innerHTML=tab.montant;
				$('a_montant_next').innerHTML=tab.montant_next;				
				$('a_montant_next_text_2').innerHTML=tab.montant_next_text;	
				$('a_oa').innerHTML=tab.oa;
				$('ban_oa_text').innerHTML=tab.oa_text;	
				if (!($('ban_auction_4').style.display == 'none'))
				{
					$('i_histo').innerHTML=tab.histo;
				}
				$('haut_details_bande').innerHTML=tab.haut_details_bande;
				if (!($('list_survey_bis').style.display == 'none'))
				{
					if (!(tab.liste_lot==''))
					{
						$('list_survey').innerHTML=tab.liste_lot;
					}
				}
				//window.alert('2');
			}
		}
	}
	)
	if (is_ie6())
	{
		for(var i=0; i<document.images.length; i++)
		{
	      var img = document.images[i]
	      var imgName = img.src.toUpperCase()
	      if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
	      {
	         var imgID = (img.id) ? "id='" + img.id + "' " : ""
	         var imgClass = (img.className) ? "class='" + img.className + "' " : ""
	         var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
	         var imgStyle = "display:inline-block;" + img.style.cssText 
	         if (img.align == "left") imgStyle = "float:left;" + imgStyle
	         if (img.align == "right") imgStyle = "float:right;" + imgStyle
	         if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
	         var strNewHTML = "<span " + imgID + imgClass + imgTitle
	         + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
	         + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
	         + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
	         img.outerHTML = strNewHTML
	         i = i-1
	      }
		}
	}	
}

function pollTimer()
{
	var csChaine;
	var nJour, nMois, nAnnee, nHeures , nMinutes, nSecondes;
	var dtJour;
	if (deltaTime=="")
	{
		getInfoServer();
	}
	csChaine = " ";
	dtJour = new Date();
	dtJour.setTime(dtJour.getTime() + deltaTime*1000);
	nJour = dtJour.getDate();
	if ( nJour < 10 ) csChaine += "0";
	csChaine += nJour;
	nMois = dtJour.getMonth() + 1;
	if (nMois == 1) csChaine += "/01";
	else if (nMois == 2) csChaine += "/02";
	else if (nMois == 3) csChaine += "/03";
	else if (nMois == 4) csChaine += "/04";
	else if (nMois == 5) csChaine += "/05";
	else if (nMois == 6) csChaine += "/06";
	else if (nMois == 7) csChaine += "/07";
	else if (nMois == 8) csChaine += "/08";
	else if (nMois == 9) csChaine += "/09";
	else if (nMois == 10) csChaine += "/10";
	else if (nMois == 11) csChaine += "/11";
	else if (nMois == 12) csChaine += "/12";
	csChaine += "/";
	nAnnee = dtJour.getFullYear();
	csChaine += nAnnee + " ";
	nHeures = dtJour.getHours();
	if (nHeures < 10) csChaine += "0";
	csChaine += nHeures + ":";
	nMinutes = dtJour.getMinutes();
	if (nMinutes < 10) csChaine += "0";
	csChaine += nMinutes + ":";
	nSecondes = dtJour.getSeconds();
	if (nSecondes < 10) csChaine += "0";
	csChaine += nSecondes;
	if (endPollTimer==true)
	{	
		$('heure_serveur').update('<strong>Heure OEP</strong>: '+csChaine);
	}
}

function showListeVenteSalle(venteSalle,indiceSalle)
{
	clearFilter();
	if (is_ie6())
	{
		var url='../../files/include/nothing_5.php';		
		var aRequest= new Ajax.Request(url,{method:'get',parameters:{venteSalle:venteSalle,indiceSalle:indiceSalle},onSuccess:onSuccessNothing_5});
	}
	else
	{
		window.location = '../pages-oep/vente_'+venteSalle+'_indice_'+indiceSalle+'.html';
	}
}

function clearFilter()
{
	Form.Element.setValue('rec_libel',"");
	Form.Element.setValue('rec_cat',"-");
	Form.Element.setValue('rec_sub_cat',"-");
	Form.Element.setValue('rec_clot',"-");
	Form.Element.setValue('rec_vente',"-");
	Form.Element.setValue('rec_lot',"");
	Form.Element.setValue('rec_prix_sup',"");
	Form.Element.setValue('rec_nb_enc_maxi',"");
	Form.Element.setValue('rec_nb_enc_mini',"");
	Form.Element.setValue('rec_prix_inf',"");
	Form.Element.setValue('rec_enc',"0");
}
function updateSubCat()
{
	var rec_cat=$F('rec_cat');
	var url='../../files/include/update_sub_cat.php';
	var aRequest= new Ajax.Request(url,{method:'get',parameters:{rec_cat:rec_cat},onSuccess:onSuccessUpdateSubCat});
}
function onSuccessUpdateSubCat(xhr)
{
	var resultat="["+xhr.responseText+"]";
	var json = resultat.evalJSON();
	json.each
	(
	function (tab)
	{
		$('i_rec_sub_cat').innerHTML=tab.result;
	}
	)
}

function updateSubResCat()
{
	var res_cat=$F('res_cat');
	var url='../../files/include/update_sub_res_cat.php';
	var aRequest= new Ajax.Request(url,{method:'get',parameters:{res_cat:res_cat},onSuccess:onSuccessUpdateSubResCat});
}
function onSuccessUpdateSubResCat(xhr)
{
	var resultat="["+xhr.responseText+"]";
	var json = resultat.evalJSON();
	json.each
	(
	function (tab)
	{
		$('i_res_sub_cat').innerHTML=tab.result;
	}
	)
}



function applyFilter(online)
{			
	var online = (online == null) ? 0 : online;
	var rec_libel="";
	var rec_cat="-";
	var rec_sub_cat="-";
	var rec_methode="-";
	var rec_clot="-";
	var rec_vente="-";
	var rec_lot="";
	var rec_prix_sup="";
	var rec_nb_enc_mini="";
	var rec_nb_enc_maxi="";
	var rec_prix_inf="";
	var rec_enc="";		
	rec_libel=($F('rec_libel'));
	rec_cat=($F('rec_cat'));
	rec_sub_cat=($F('rec_sub_cat'));
	rec_clot=($F('rec_clot'));
	rec_vente=($F('rec_vente'));
	//rec_methode=($F('rec_methode'));
	rec_lot=($F('rec_lot'));
	rec_prix_sup=($F('rec_prix_sup'));
	rec_nb_enc_maxi=($F('rec_nb_enc_maxi'));
	rec_nb_enc_mini=($F('rec_nb_enc_mini'));
	rec_prix_inf=($F('rec_prix_inf'));	
	rec_enc=($F('rec_enc'));	
	var url='../../files/include/apply_filter.php';
	var aRequest= new Ajax.Request(url,{method:'get',parameters:{online:online,rec_libel:rec_libel,rec_cat:rec_cat,rec_sub_cat:rec_sub_cat,rec_clot:rec_clot,rec_vente:rec_vente,rec_lot:rec_lot,rec_nb_enc_mini:rec_nb_enc_mini,rec_nb_enc_maxi:rec_nb_enc_maxi,rec_prix_sup:rec_prix_sup,rec_prix_inf:rec_prix_inf,rec_enc:rec_enc},onSuccess:onSuccessApplyFilter});			
}
function onSuccessApplyFilter(xhr)
{
	var resultat="["+xhr.responseText+"]";
	var json = resultat.evalJSON();
	json.each
	(
	function (tab)
	{
		window.location = "../pages-oep/liste-lot.php?pagecurr=1&pagecurrsalle=1";						
	}
	)
}
function applyFilterForce(rec_sub_cat)
{			
	var online = 0;
	var rec_libel="";
	var rec_cat="-";	
	var rec_methode="-";
	var rec_clot="-";
	var rec_vente="-";
	var rec_lot="";
	var rec_prix_sup="";
	var rec_nb_enc_mini="";
	var rec_nb_enc_maxi="";
	var rec_prix_inf="";
	var rec_enc="";		
	rec_libel=($F('rec_libel'));
	rec_cat=($F('rec_cat'));	
	rec_clot=($F('rec_clot'));
	rec_vente=($F('rec_vente'));
	rec_lot=($F('rec_lot'));
	rec_prix_sup=($F('rec_prix_sup'));
	rec_nb_enc_maxi=($F('rec_nb_enc_maxi'));
	rec_nb_enc_mini=($F('rec_nb_enc_mini'));
	rec_prix_inf=($F('rec_prix_inf'));	
	rec_enc=($F('rec_enc'));		
	var url='../../files/include/apply_filter_force.php';
	var aRequest= new Ajax.Request(url,{method:'get',parameters:{online:online,rec_libel:rec_libel,rec_cat:rec_cat,rec_sub_cat:rec_sub_cat,rec_clot:rec_clot,rec_vente:rec_vente,rec_lot:rec_lot,rec_nb_enc_mini:rec_nb_enc_mini,rec_nb_enc_maxi:rec_nb_enc_maxi,rec_prix_sup:rec_prix_sup,rec_prix_inf:rec_prix_inf,rec_enc:rec_enc},onSuccess:onSuccessApplyFilterForce});			
}
function onSuccessApplyFilterForce(xhr)
{
	var resultat="["+xhr.responseText+"]";
	var json = resultat.evalJSON();
	json.each
	(
	function (tab)
	{
		window.location = "../pages-oep/liste-lot.php?pagecurr=1&pagecurrsalle=1";		
	}
	)
}
function showAuction(i)
{
	$('ban_auction_confirme').hide();
	$('ban_auction_confirme_oa').hide();
	$('ban_auction_valide').hide();
	$('ban_auction_wait').hide();
	$('ban_auction_erreur').hide();
	Form.Element.setValue('ban_auction','');
	Form.Element.setValue('ban_auction_oa','');
	$('montant_ajuste').innerHTML='';
	if (i==1)
	{
		lastTab=1;
		$('ban_auction_1').show();
		$('ban_auction_3').hide();
		$('ban_auction_4').hide();
	}
	if (i==2)
	{
		lastTab=2;
		$('ban_auction_1').show();
		$('ban_auction_3').hide();
		$('ban_auction_4').hide();
	}
	if (i==3)
	{
		lastTab=3;
		$('ban_auction_1').hide();
		$('ban_auction_3').show();
		$('ban_auction_4').hide();
	}
	if (i==4)
	{
		lastTab=4;
		$('ban_auction_1').hide();
		$('ban_auction_3').hide();
		updateData(0);
		$('ban_auction_4').show();
	}	
}
function goPict()
{
	showListeDetail(0);
	window.location.href="#pictures";
}
function hideMiniZoom()
{
	$('mini_zoom').hide();	
}
function showMiniZoom(lot)
{
	var fav='mini_zoom_'+lot;
	var elt=$(fav);
	var eltMain=$('anchor_scroll');
	var tablo= new Array(2); 
	var delta= new Array(2);
	var deltaMain= new Array(2);
	tablo=Position.cumulativeOffset(elt);
	delta=Position.realOffset(elt);
	deltaMain=Position.realOffset(eltMain);
	x=tablo[0];
	y=tablo[1];
	var deltaX=delta[0];
	var deltaY=delta[1];	
	var deltaMainX=deltaMain[0];
	var deltaMainY=deltaMain[1];		
	var xx=x+20-deltaX+deltaMainX;
	var yy=y+20-deltaY+deltaMainY;
	yy=yy+'px';		
	xx=xx+'px';
	$('mini_zoom').setStyle({top:yy});
	$('mini_zoom').setStyle({left:xx});
	var mini='mini_zoom_pict_'+lot;
	$('mini_zoom').innerHTML=$(mini).innerHTML;	
	$('mini_zoom').show();
}
function hideShowListeLot()
{
	if (!($('list_survey_bis').style.display == 'none'))	
	{
		$('list_survey_bis').hide();		
		$('list_alternate').show();
		$('onglets_fav').show();
		$('onglets_desc').hide();
		setCookie('oeponline_showliste',0);		
	}
	else
	{
		$('list_alternate').hide();	
		$('list_survey_bis').show();		
		$('onglets_fav').hide();
		$('onglets_desc').show();		
		setCookie('oeponline_showliste',1);
	}
}
function showListeDetail(i)
{
	if (i==0)
	{
		$('list_survey_bis').hide();		
		$('list_alternate').show();				
		$('onglets_fav').show();
		$('onglets_desc').hide();		
		setCookie('oeponline_showliste',0);		
	}
	else
	{
		$('list_alternate').hide();	
		$('list_survey_bis').show();		
		$('onglets_fav').hide();
		$('onglets_desc').show();				
		setCookie('oeponline_showliste',1);
	}
}
function toggleFilter()
{
	if ($('filter').style.display == 'none')
	{
		$('filter').show();
		setCookie('oeponline_filter',1);	
	}
	else
	{
		$('filter').hide();
		setCookie('oeponline_filter',0);	
	}
}
function setMiniOut(i)
{
	$('min_'+i).setStyle({backgroundColor:"#FFFFFF"});
}
function setMiniIn(i)
{
	$('min_'+i).setStyle({backgroundColor:"#CCCCCC"});
}

function showZoom(i,filename)
{	
	
	var url='../../files/include/upd_detail.php';
	$('min_'+i).setStyle({backgroundColor:"#CCCCCC"});
	if (is_ie6())
	{
		var aRequest= new Ajax.Request(url,{method:'get',parameters:{filename:filename},onSuccess:onSuccessShowZoom});	
	}
	else
	{
		var result='<img  src="'+filename+'" alt="" />';		
		$('box_band_maxi_pict').innerHTML=result;			
		$('box_band_maxi_pict').show();			
	}
}
function onSuccessShowZoom(xhr)
{
	var resultat="["+xhr.responseText+"]";
	var json = resultat.evalJSON();
	json.each
	(
	function (tab)
	{		
		var result='<img  src="'+tab.maxipict+'" alt="" />';
		$('box_band_maxi_pict').hide();
		$('box_band_maxi_pict').innerHTML=result;			
		$('box_band_maxi_pict').show();			
	}
	)
}
function showConfirme(i)
{
	noTab=i;
	var url='../../files/include/update_auction_amount.php';
	if (i==2)
	{
		var valeur=$F('ban_auction');	
	}
	if (i==1)
	{
		//var valeur=$F('ban_auction_oa');	
		var valeur=$('montant_ajuste').innerHTML;	
	}	
	if (i==3)
	{
		var valeur=$('a_joker').innerHTML;
	}	
	var aRequest= new Ajax.Request(url,{method:'get',parameters:{i:i,valeur:valeur},onSuccess:onSuccessUpdateAmountAuction});	
}
function returnAuction()
{
	Form.Element.setValue('ban_auction_pwd','');
	Form.Element.setValue('ban_auction_pwd_oa','');
	showAuction(lastTab);
}
function onSuccessUpdateAmountAuction(xhr)
{
	var resultat="["+xhr.responseText+"]";
	var json = resultat.evalJSON();
	if ((noTab==1)||((noTab==2)))
	{
		$('ban_auction_1').hide();
	}
	else
	{
		$('ban_auction_3').hide();
	}
	json.each
	(
	function (tab)
	{		
		if (tab.message=='')
		{
			$('i_montant_ttc').innerHTML=tab.valeur_ttc;
			$('i_montant').innerHTML=tab.valeur;
			if ((noTab==2)||(noTab==3))
			{
				$('i_montant_ttc_format').innerHTML=tab.valeur_format_ttc;
				$('i_montant_ttc_format2').innerHTML=tab.valeur_format_ttc;
				$('i_montant_format').innerHTML=tab.valeur_format;
				$('ban_auction_confirme').show();
			}
			else
			{
				$('i_montant_ttc_format_oa').innerHTML=tab.valeur_format_ttc;
				$('i_montant_ttc_format2_oa').innerHTML=tab.valeur_format_ttc;
				$('i_montant_format_oa').innerHTML=tab.valeur_format;
				$('ban_auction_confirme_oa').show();		
			}
		}
		else
		{
			$('ban_auction_erreur').show();
			$('auction_erreur').innerHTML=tab.message;								
		}
	}
	)
}
function makeAuction(pwd)
{
	var url='../../files/include/make_auction.php';	
	reInitPe();
	$('ban_auction_wait').show();
	var ut_chrono=$('ut_chrono').innerHTML;
	var lo_chrono=$('lo_chrono').innerHTML;
	var valeur=$('i_montant').innerHTML;
	var aRequest= new Ajax.Request(url,{method:'get',parameters:{userpwd:pwd,ut_chrono:ut_chrono,lo_chrono:lo_chrono,valeur:valeur,noTab:noTab},onSuccess:onSuccessMakeAuction});		
}
function makeOa(pwd)
{
	var url='../../files/include/make_oa.php';
	reInitPe();
	$('ban_auction_wait').show();
	var ut_chrono=$('ut_chrono').innerHTML;
	var lo_chrono=$('lo_chrono').innerHTML;
	var valeur=$('i_montant').innerHTML;
	var aRequest= new Ajax.Request(url,{method:'get',parameters:{userpwd:pwd,ut_chrono:ut_chrono,lo_chrono:lo_chrono,valeur:valeur,noTab:noTab},onSuccess:onSuccessMakeOa});		
}

function onSuccessMakeAuction(xhr)
{
	var resultat="["+xhr.responseText+"]";
	var json = resultat.evalJSON();
	json.each
	(
	function (tab)
	{				
		$('ban_auction_wait').hide();
		var result=tab.result;		
		if (result==0)
		{
			$('ban_auction_valide').show();
			lastTab=2;
			updateData();			
		}
		else
		{
			
			$('ban_auction_erreur').show();
			$('auction_erreur').innerHTML=tab.message;								
		}
	}
	)
}

function onSuccessMakeOa(xhr)
{
	var resultat="["+xhr.responseText+"]";
	var json = resultat.evalJSON();
	json.each
	(
	function (tab)
	{				
		$('ban_auction_wait').hide();
		var result=tab.result;		
		if (result==0)
		{
			$('ban_auction_valide').show();
			lastTab=1;
			updateData(1);			
		}
		else
		{
			
			$('ban_auction_erreur').show();
			$('auction_erreur').innerHTML=tab.message;								
		}
	}
	)
}

function showValide()
{	
	if ((noTab==2)||(noTab==3))
	{
		$('ban_auction_confirme').hide();
		var pwd=$F('ban_auction_pwd');
	}
	else
	{
		$('ban_auction_confirme_oa').hide();
		var pwd=$F('ban_auction_pwd_oa');
	}	
	var key=$('i_random_key').innerHTML;
	key=getNumberFromString(key);	
	var tmp=hex_sha1(pwd)+'|'+key;
	pwd=hex_sha1(tmp);	
	Form.Element.setValue('ban_auction_pwd','');
	Form.Element.setValue('ban_auction_pwd_oa','');
	if ((noTab==2)||(noTab==3))
	{
		makeAuction(pwd);
	}
	else	
	{
		makeOa(pwd);
	}
}
function getNumberFromString(sString)
{
	var result='';
	var caractere='';
	for (var i = 0; i < sString.length; i++)
	{ 
		caractere=sString.substring(i,i+1);
		if ((caractere=='0')||(caractere=='1')||(caractere=='2')||(caractere=='3')||(caractere=='4')||(caractere=='5')||(caractere=='6')||(caractere=='7')||(caractere=='8')||(caractere=='9'))
		{
			result+=caractere;
		}
	}
	return(result);
}
function reInitPe()
{
	try
	{
		pe.stop();	
	}
	catch(e)
	{
	}
	pe=new PeriodicalExecuter(updateData,periode);	
}
function showDetail(lo_chrono)
{
	if (is_ie6())
	{
		var url='../../files/include/nothing.php';		
		var aRequest= new Ajax.Request(url,{method:'get',parameters:{lo_chrono:lo_chrono},onSuccess:onSuccessNothing_4});
	}
	else
	{
		window.location = "../pages-oep/voir-detail.php?lot="+lo_chrono;
	}
}
function playVideo(filename,show)
{
	var xx;
	var yy;
	var show = (show == null) ? 0 : show;
	if (videoOn==0)
	{
		videoOn=1;
		var fav='video_show';
		var elt=$(fav);
		var tablo= new Array(2) 
		tablo=Position.cumulativeOffset(elt);
		x=tablo[0];
		y=tablo[1];
		if (show==1)
		{
			xx=x-450;
			yy=y+10;
		}
		else
		{
			xx=x+115;
			yy=y-20;
		}
		yy=yy+'px';		
		xx=xx+'px';
		$('box_video').setStyle({top:yy});
		$('box_video').setStyle({left:xx});				
		setVideoOn(filename);
		$('box_video').setStyle({paddingTop:'0px'});
		$('box_video').setStyle({height:'286px'});
		$('box_video').show();
	}
	else
	{				
		$('box_video').hide();
		setVideoOff();		
		videoOn=0;
	}
}
function closeVideo()
{
	$('box_video').hide();
	setVideoOff();		
	videoOn=0;
}
function setVideoOn(filename)
{
	if (svideo==0)
	{
		svideo = new SWFObject("../../multimedia/swf/mediaplayer.swf","mpl","432","250","7");
		svideo.addParam("allowfullscreen","true");
		svideo.addVariable("height","250");
		svideo.addVariable("width","432");
		svideo.addVariable("logo","../../images/logo_video.png");
		svideo.addVariable("autostart","true");
		svideo.addVariable("displayheight","250");
		svideo.addVariable("displaywidth","432");
		svideo.addVariable("file",filename);					
		svideo.addVariable("backcolor","0x333333");
		svideo.addVariable("frontcolor","0xCCCCCC");
		svideo.addVariable("lightcolor","0xFFFFFF");		
		svideo.addVariable("javascriptid","mpl");		
		svideo.write("intro2");	
	}
	return false
}

function setVideoOff()
{	
	var s2 = new SWFObject("../../multimedia/swf/mediaplayer.swf","mpl","432","250","7");
	s2.addParam("allowfullscreen","true");
	s2.addVariable("height","250");
	s2.addVariable("width","432");
	s2.addVariable("logo","../../images/logo_video.png");
	s2.addVariable("autostart","true");
	s2.addVariable("displayheight","250");
	s2.addVariable("displaywidth","432");
	s2.addVariable("file","");					
	s2.addVariable("backcolor","0x333333");
	s2.addVariable("frontcolor","0xCCCCCC");
	s2.addVariable("lightcolor","0xFFFFFF");		
	s2.addVariable("javascriptid","mpl");		
	s2.write("intro2");	
	svideo=0;
	return false
}
function loadFam(sousCat)
{
	clearFilter();
	//Form.Element.setValue('rec_sub_cat',sousCat);
	applyFilterForce(sousCat);
}
function setCookieDays(name,value,days)
{
	var date_exp = new Date();
	date_exp.setTime(date_exp.getTime()+(days*24*3600*1000));
	setCookie(name,value,date_exp);
}
function showVente(no)
{
	clearFilter();
	Form.Element.setValue('rec_vente',no);
	applyFilter(1);	
}
function setNbLotsPage(value,vente_salle,indice_salle)
{
	setCookieDays("oeponline_nblotspage",value,365);		
	if (is_ie6())
	{
		var url='../../files/include/nothing.php';		
		var aRequest= new Ajax.Request(url,{method:'get',parameters:{vente_salle:vente_salle,indice_salle:indice_salle},onSuccess:onSuccessNothing_1});
	}
	else
	{
		if (vente_salle=='0')
		{
			window.location = "../pages-oep/liste-lot.php?pagecurr=1&pagecurrsalle=1";
		}
		else
		{
			window.location = "../pages-oep/liste-lot.php?pagecurr=1&pagecurrsalle=1"+"&vente="+vente_salle+"&indice="+indice_salle;
		}
	}
}
function onSuccessNothing_1(xhr)
{
	var resultat="["+xhr.responseText+"]";
	var json = resultat.evalJSON();
	json.each
	(
	function (tab)
	{
		vente_salle=tab.vente_salle;
		indice_salle=tab.indice_salle;
		if (vente_salle=='0')
		{
			window.location = "../pages-oep/liste-lot.php?pagecurr=1&pagecurrsalle=1";
		}
		else
		{
			window.location = "../pages-oep/liste-lot.php?pagecurr=1&pagecurrsalle=1"+"&vente="+vente_salle+"&indice="+indice_salle;
		}
	}
	)
}
function onSuccessNothing(xhr)
{
	var resultat="["+xhr.responseText+"]";
	var json = resultat.evalJSON();
	json.each
	(
	function (tab)
	{
		
	}
	)
}
function setSortBis(value,lot)
{
	setCookieDays("oeponline_sort",value,365);		
	if (is_ie6())
	{
		var url='../../files/include/nothing.php';		
		var aRequest= new Ajax.Request(url,{method:'get',onSuccess:onSuccessNothing_4});
	}
	else
	{
		window.location = "../pages-oep/voir-detail.php?lot="+lot;
	}
}
function setNbLotsPageBis(value,lot)
{
	setCookieDays("oeponline_nblotspage",value,365);		
	if (is_ie6())
	{
		var url='../../files/include/nothing.php';		
		var aRequest= new Ajax.Request(url,{method:'get',onSuccess:onSuccessNothing_4});
	}
	else
	{
		window.location = "../pages-oep/voir-detail.php?lot="+lot;
	}
}

function onSuccessNothing_4(xhr)
{
	var resultat="["+xhr.responseText+"]";
	var json = resultat.evalJSON();
	json.each
	(
	function (tab)
	{
		var lot=tab.lot;
		window.location = "../pages-oep/voir-detail.php?lot="+lot;
	}
	)
}
function onSuccessNothing_5(xhr)
{
	var resultat="["+xhr.responseText+"]";
	var json = resultat.evalJSON();
	json.each
	(
	function (tab)
	{
		var venteSalle=tab.venteSalle;
		var indiceSalle=tab.indiceSalle;
		window.location = '../pages-oep/vente_'+venteSalle+'_indice_'+indiceSalle+'.html';
	}
	)
}

function setSort(value)
{
	setCookieDays("oeponline_sort",value,365);		
	if (is_ie6())
	{
		var url='../../files/include/nothing.php';		
		var aRequest= new Ajax.Request(url,{method:'get',onSuccess:onSuccessNothing_3});
	}
	else
	{
		window.location = "../pages-oep/liste-lot.php?pagecurr=1&pagecurrsalle=1";
	}
}
function onSuccessNothing_3(xhr)
{
	var resultat="["+xhr.responseText+"]";
	var json = resultat.evalJSON();
	json.each
	(
	function (tab)
	{
		window.location = "../pages-oep/liste-lot-act.php?pagecurr=1&pagecurrsalle=1";	
	}
	)
}
function selectMenu(i)
{
	clearFilter();
	if (i==3)
	{
		Form.Element.setValue('rec_cat',"MOA");
	}	
	if (i==4)
	{
		Form.Element.setValue('rec_cat',"VEH");
	}	
	if (i==5)
	{
		Form.Element.setValue('rec_cat',"PRO");
	}		
	if (i==6)
	{
		Form.Element.setValue('rec_enc',"3");
	}			
	if (i==7)
	{
		Form.Element.setValue('rec_clot',"3");
	}
	applyFilter();
}
function hideShowCgv()
{
	$('i_cgv').toggle();
}
function retourErreur()
{
	$('ident_oep').show();
	$('wait_oep').hide();
	$('valide_oep').hide();	
	$('error_oep').hide();
}
function subscribe(connected)
{
	var message='';
	var ut_ident='';
	var ut_ident2='';				
	var ut_pwd_1='';
	var ut_pwd_2='';	
	var ut_email='';
	var ut_email2='';	
	if (connected==0)
	{
		ut_pwd_1=$F('ut_pwd_1');
		ut_pwd_2=$F('ut_pwd_2');
		ut_email=$F('ut_email');
		ut_email2=$F('ut_email2');		
		ut_ident=$F('ut_ident');
		ut_ident2=$F('ut_ident2');						
		if (ut_pwd_1=='')
		{
			message+='<p>- Le mot de passe est vide.</p>';
		}
		else
		{
			if (!(ut_pwd_1==ut_pwd_2))
			{
				message+='<p>- Les deux mots de passe sont diff\351rents</p>';
			}
			else
			{
				if (ut_pwd_1.length<6)
				{
					message+='<p>- Le mot de passe doit faire au moins 6 caract\350res</p>';
				}
				if (ut_pwd_1.length>20)
				{
					message+='<p>- Le mot de passe doit faire moins de 20 caract\351res</p>';
				}
			}
		}
		if ($('cgv').checked==false)
		{
			message+='<p>- Vous n\u0027avez pas accept\351 les conditions g\351n\351rales de vente</p>';
		}
	}
	if (message=="")
	{
		$('ident_oep').hide();
		scroll(0,0);
		$('wait_oep').show();
		var ut_pwd_enc=ut_pwd_1;
		if (connected==0)
		{
			ut_pwd_enc=ut_pwd_1;		
		}
		var ut_nom=$F('ut_nom');
		var i_day=$F('i_day');
		var i_month=$F('i_month');
		var i_year=$F('i_year');
		var ut_adr1=$F('ut_adr1');
		var ut_adr2=$F('ut_adr2');
		var ut_cp=$F('ut_cp');
		var ut_ville=$F('ut_ville');
		var ut_telephone=$F('ut_telephone');
		var ut_prof=$F('ut_prof');
		var ut_raison_sociale=$F('ut_raison_sociale');
		var ut_intra=$F('ut_intra');
		var ut_titre=$F('ut_titre');
		var ut_prenom=$F('ut_prenom');
		var ut_pays=$F('ut_pays');
		var ut_telecopie=$F('ut_telecopie');
		var ut_emaildebut=$F('ut_emaildebut');
		var ut_emailenc=$F('ut_emailenc');
		var url='../../files/include/check_sub.php';
		var aRequest= new Ajax.Request(url,{method:'get',parameters:{ut_intra:ut_intra,ut_ident:ut_ident,ut_ident2:ut_ident2,ut_pwd:ut_pwd_enc,ut_email:ut_email,ut_email2:ut_email2,ut_nom:ut_nom,i_day:i_day,i_month:i_month,i_year:i_year,ut_adr1:ut_adr1,ut_telephone:ut_telephone,ut_cp:ut_cp,ut_ville:ut_ville,ut_prof:ut_prof,ut_raison_sociale:ut_raison_sociale,ut_titre:ut_titre,ut_adr2:ut_adr2,ut_pays:ut_pays,ut_telecopie:ut_telecopie,ut_emaildebut:ut_emaildebut,ut_emailenc:ut_emailenc,ut_prenom:ut_prenom},onSuccess:onSuccessSubscribe});			
	}
	else
	{
		$('ident_oep').hide();
		$('error_msg').innerHTML=message;
		scroll(0,0);
		$('error_oep').show();		
	}
}

function onSuccessSubscribe(xhr)
{
	var resultat="["+xhr.responseText+"]";
	var json = resultat.evalJSON();
	json.each
	(
	function (tab)
	{
		if (tab.error==0)
		{			
			$('wait_oep').hide();
			$('valide_oep').show();	
		}
		else
		{
			$('error_msg').innerHTML=tab.message;
			$('wait_oep').hide();
			$('error_oep').show();	
		}		
	}
	)
}
function checkLogin()
{
	var url='../../files/include/check_login.php';	
	var user=$F('login_name');
	var pwd=$F('login_pwd');
	var key=$('i_random_key').innerHTML;
	key=getNumberFromString(key);	
	var tmp=hex_sha1(pwd)+'|'+key;
	pwd=hex_sha1(tmp);
	$('ident_oep').hide();
	$('wait_oep').show();
	var aRequest= new Ajax.Request(url,{method:'get',parameters:{username:user,userpwd:pwd},onSuccess:onSuccessCheckLogin});
}
function onSuccessCheckLogin(xhr)
{
	var resultat="["+xhr.responseText+"]";
	var json = resultat.evalJSON();
	json.each
	(
	function (tab)
	{		
		result=tab.result;
		$('wait_oep').hide();
		if (result==0) // Bad login
		{
			$('ident_oep').show();
			$('login_name').value='Erreur !';
			$('login_pwd').clear();
			$('login_name').activate();
		}
		else if (result==1) // Success
		{
			$('login_name').clear();
			$('login_pwd').clear();
			$('ident_oep').hide();			
			window.location = "../pages-oep/login-ok.php"						
		}
		else if (result==2) // New user
		{
			$('login_name').clear();
			$('login_pwd').clear();
			window.location = "../pages-oep/cle-de-securite.php"			
		}
		else if (result==3) // Forgot pwd
		{
			$('login_name').clear();
			$('login_pwd').clear();
			window.location = "../pages-oep/oubli-nouveau-mot-de-passe.php"
		}
		else if (result==5) //too much error
		{
			$('login_name').value='Erreur !';
			$('login_pwd').clear();
			$('ident_oep').hide();
			$('toomuch_oep').show();			
		}		
	}
	)
}
function newLogin()
{	
	var new_login1=$F('login_1');
	var new_login2=$F('login_2');
	message='';
	if (new_login1=='')
	{
		message+='<p>- Votre pseudonyme est vide.</p>';
	}
	else
	{
		if (!(new_login1==new_login2))
		{
			message+='<p>- Les deux pseudonymes sont diff\351rents</p>';
		}
	}
	if (message=='')
	{				
		$('ident_oep').hide();
		$('wait_oep').show();
		var url='../../files/include/new_login.php';
		var aRequest= new Ajax.Request(url,{method:'get',parameters:{new_login:new_login1},onSuccess:onSuccessNewLogin});	
	}
	else
	{
		$('error_msg').innerHTML=message;
		$('ident_oep').hide();
		$('error_oep').show();	
	}
}

function onSuccessNewLogin(xhr)
{
	var resultat="["+xhr.responseText+"]";
	var json = resultat.evalJSON();
	json.each
	(
	function (tab)
	{
		if (tab.error==0)
		{			
			$('wait_oep').hide();
			$('valide_oep').show();	
		}
		else
		{
			$('error_msg').innerHTML=tab.message;
			$('wait_oep').hide();
			$('error_oep').show();	
		}
	}
	)
}
function newPwd()
{	
	var new_pwd1=$F('pwd_1');
	var new_pwd2=$F('pwd_2');
	Form.Element.setValue('pwd_1',"");
	Form.Element.setValue('pwd_2',"");
	message='';
	if (new_pwd1=='')
	{
		message+='<p>- Le mot de passe est vide.</p>';
	}
	else
	{
		if (!(new_pwd1==new_pwd2))
		{
			message+='<p>- Les deux mots de passe sont diff\351rents</p>';
		}
		else
		{
			if (new_pwd1.length<6)
			{
				message+='<p>- Le mot de passe doit faire au moins 6 caract\350res</p>';
			}
			if (new_pwd1.length>20)
			{
				message+='<p>- Le mot de passe doit faire moins de 20 caract\351res</p>';
			}
		}
	}
	if (message=='')
	{				
		$('ident_oep').hide();
		$('wait_oep').show();
		var url='../../files/include/new_pwd.php';
		var new_pwd_enc=new_pwd1;
		var aRequest= new Ajax.Request(url,{method:'get',parameters:{new_pwd:new_pwd_enc},onSuccess:onSuccessNewPwd});	
	}
	else
	{
		$('error_msg').innerHTML=message;
		$('ident_oep').hide();
		$('error_oep').show();	
	}
}
function onSuccessNewPwd(xhr)
{
	var resultat="["+xhr.responseText+"]";
	var json = resultat.evalJSON();
	json.each
	(
	function (tab)
	{
		if (tab.error==0)
		{			
			$('wait_oep').hide();
			$('valide_oep').show();	
		}
		else
		{
			$('error_msg').innerHTML=tab.message;
			$('wait_oep').hide();
			$('error_oep').show();	
		}
	}
	)
}
function enableNewEmail()
{
	var url='../../files/include/enable_new_email.php';
	$('ident_oep').hide();
	$('wait_oep').show();	
	var aRequest= new Ajax.Request(url,{method:'get',onSuccess:onSuccessEnableNewEmail});	
}
function onSuccessEnableNewEmail(xhr)
{
	var resultat="["+xhr.responseText+"]";
	var json = resultat.evalJSON();
	json.each
	(
	function (tab)
	{
		if (tab.error==0)
		{			
			$('wait_oep').hide();
			$('valide_oep').show();	
		}
		else
		{
			$('error_msg').innerHTML=tab.message;
			$('wait_oep').hide();
			$('error_oep').show();	
		}
	}
	)
}
function newEmail()
{	
	var new_email1=$F('email_1');
	var new_email2=$F('email_2');
	message='';
	if (new_email1=='')
	{
		message+='<p>- Votre adresse email est vide.</p>';
	}
	else
	{
		if (!(new_email1==new_email2))
		{
			message+='<p>- Les deux adresses emails sont diff\351rentes</p>';
		}
	}
	if (message=='')
	{				
		$('ident_oep').hide();
		$('wait_oep').show();
		var url='../../files/include/new_email.php';
		var aRequest= new Ajax.Request(url,{method:'get',parameters:{new_email:new_email1},onSuccess:onSuccessNewEmail});	
	}
	else
	{
		$('error_msg').innerHTML=message;
		$('ident_oep').hide();
		$('error_oep').show();	
	}
}

function onSuccessNewEmail(xhr)
{
	var resultat="["+xhr.responseText+"]";
	var json = resultat.evalJSON();
	json.each
	(
	function (tab)
	{
		if (tab.error==0)
		{			
			$('wait_oep').hide();
			$('valide_oep').show();	
		}
		else
		{
			$('error_msg').innerHTML=tab.message;
			$('wait_oep').hide();
			$('error_oep').show();	
		}
	}
	)
}
function updateDateFact()
{
	date_min=($F('date_min'));
	date_max=($F('date_max'));
	var url='../../files/include/set_date.php';
	var aRequest= new Ajax.Request(url,{method:'get',parameters:{date_min:date_min,date_max:date_max},onSuccess:onSuccessSetDateFact});			
	
}
function onSuccessSetDateFact(xhr)
{
	var resultat="["+xhr.responseText+"]";
	var json = resultat.evalJSON();
	json.each
	(
	function (tab)
	{
		window.location = "../pages-oep/achat.php";	
	}
	)
}
function applyFilterAmount()
{
	var url='../../files/include/apply_filter_amount.php';
	clearFilter();
	var aRequest= new Ajax.Request(url,{method:'get',onSuccess:onSuccessApplyFilterAmount});			
}
function onSuccessApplyFilterAmount(xhr)
{
	var resultat="["+xhr.responseText+"]";
	var json = resultat.evalJSON();
	json.each
	(
	function (tab)
	{
		window.location = "../pages-oep/liste-lot.php?pagecurr=1";						
	}
	)
}
function applyFilterEnc()
{
	clearFilter();
	Form.Element.setValue('rec_enc',"5");
	applyFilter(1);
}
function applyFilterTrack()
{
	var url='../../files/include/apply_filter_track.php';
	clearFilter();
	var aRequest= new Ajax.Request(url,{method:'get',onSuccess:onSuccessApplyFilterTrack});			
}
function onSuccessApplyFilterTrack(xhr)
{
	var resultat="["+xhr.responseText+"]";
	var json = resultat.evalJSON();
	json.each
	(
	function (tab)
	{
		window.location = "../pages-oep/liste-lot.php?pagecurr=1";						
	}
	)
}
function updateSuivi(i)
{
	var url='../../files/include/update_suivi.php';	
	var name1='lot_check_suivi_'+i;
	var name2='fav_off_'+i;
	var name3='fav_on_'+i;
	try 
	{
		if ($(name1).checked==false)
		{
			$(name2).show();
			$(name3).hide();
		}
		else
		{
			$(name2).hide();
			$(name3).show();
		}
	}
	catch(e)
	{
		// nothing
	}	
	var aRequest= new Ajax.Request(url,{method:'get',parameters:{lo_chrono:i},onSuccess:onSuccessUpdateSuivi});
}
function updateSuiviDetails(i)
{
	var url='../../files/include/update_suivi.php';	
	var name1='lot_check_suivi';
	var name2='fav_off';
	var name3='fav_on';
	if ($(name1).checked==false)
	{
		$(name2).show();
		$(name3).hide();
	}
	else
	{
		$(name2).hide();
		$(name3).show();
	}
	var aRequest= new Ajax.Request(url,{method:'get',parameters:{lo_chrono:i},onSuccess:onSuccessUpdateSuivi});
}
function onSuccessUpdateSuivi(xhr)
{
	var resultat="["+xhr.responseText+"]";
	var json = resultat.evalJSON();
	json.each
	(
	function (tab)
	{
		$('i_nb_panier').innerHTML=tab.nb_panier;
		$('list_survey').innerHTML=tab.liste_lot;
	if (is_ie6())
	{
	
	}

	}
	)
}
function contact()
{
	var url='../../files/include/contact.php';
	$('error_msg').innerHTML="";
	var c_subject=$F('c_subject');
	var c_email=$F('c_email');
	var c_pseudo=$F('c_pseudo');
	var c_lot=$F('c_lot');
	var c_message=$F('c_message');	
	$('ident_oep').hide();
	$('wait_oep').show();	
	var aRequest= new Ajax.Request(url,{method:'get',parameters:{c_subject:c_subject,c_email:c_email,c_pseudo:c_pseudo,c_lot:c_lot,c_message:c_message},onSuccess:onSuccessContact});
}
function onSuccessContact(xhr)
{
	var resultat="["+xhr.responseText+"]";
	var json = resultat.evalJSON();
	json.each
	(
	function (tab)
	{
		var error=tab.error;
		$('wait_oep').hide();
		if (error==1)
		{
			$('error_msg').innerHTML=tab.message;
			$('error_oep').show();
		}
		else
		{
			$('valide_oep').show();
		}
	}
	)
}
function popup(f,nom, w, h) 
{
	var top=0;
	var left=0;
	if (self.screen) left=(screen.width-(w+((screen.width*1)/100)));
	myWin = window.open(f, nom, 'resizable,screenX=0,screenY=0,scrollbars=yes,menubar=yes,top='+top+',left='+left +',width=' + w + ',height=' + h );
	myWin.focus();
}
function sendIdent()
{
	var url='../../files/include/send_ident.php';
	var email=$F('email');
	$('ident_oep').hide();
	$('wait_oep').show();	
	var aRequest= new Ajax.Request(url,{method:'get',parameters:{email:email},onSuccess:onSuccessSendIdent});
}
function onSuccessSendIdent(xhr)
{
	var resultat="["+xhr.responseText+"]";
	var json = resultat.evalJSON();
	json.each
	(
	function (tab)
	{
		var error=tab.error;
		$('wait_oep').hide();
		if (error==1)
		{
			$('error_oep').show();
		}
		else
		{
			$('valide_oep').show();
		}
	}
	)
}
function sendPwd()
{
	var url='../../files/include/send_pwd.php';
	var ident=$F('login_name');
	$('ident_oep').hide();
	$('wait_oep').show();	
	var aRequest= new Ajax.Request(url,{method:'get',parameters:{ident:ident},onSuccess:onSuccessSendPwd});
}
function onSuccessSendPwd(xhr)
{
	var resultat="["+xhr.responseText+"]";
	var json = resultat.evalJSON();
	json.each
	(
	function (tab)
	{
		var error=tab.error;
		$('wait_oep').hide();
		if (error==1)
		{
			$('error_oep').show();
		}
		else
		{
			$('valide_oep').show();
		}
	}
	)
}
function showStep()
{
	var valeur=$F('ban_auction_oa');
	var url='../../files/include/show_step.php';
	var aRequest= new Ajax.Request(url,{method:'get',parameters:{valeur:valeur},onSuccess:onSuccessShowStep});		
}
function onSuccessShowStep(xhr)
{
	var resultat="["+xhr.responseText+"]";
	var json = resultat.evalJSON();
	json.each
	(
	function (tab)
	{
		$('montant_ajuste').innerHTML=tab.montant_ajuste;			
	}
	)
}

function checkSecureKey()
{
	var secure=$F('secure_key_1')+'-'+$F('secure_key_2')+'-'+$F('secure_key_3')+'-'+$F('secure_key_4')+'-'+$F('secure_key_5')+'-'+$F('secure_key_6')+'-'+$F('secure_key_7')+'-'+$F('secure_key_8');
	var url='../../files/include/check_secure_key.php';
	$('ident_oep').hide();
	$('wait_oep').show();	
	var aRequest= new Ajax.Request(url,{method:'get',parameters:{key:secure},onSuccess:onSuccessSecureKey});		
}
function onSuccessSecureKey(xhr)
{
	var resultat="["+xhr.responseText+"]";
	var json = resultat.evalJSON();
	json.each
	(
	function (tab)
	{
		if (tab.error==0)
		{			
			$('wait_oep').hide();			
			$('login_oep').show();	
		}
		else
		{
			$('error_msg').innerHTML=tab.message;
			$('wait_oep').hide();
			$('error_oep').show();
			//i=5;
		}
	}
	)
}
function retourErreurSecure()
{
	$('ident_oep').show();
	$('wait_oep').hide();
	$('login_oep').hide();	
	$('error_oep').hide();
}

function showLot(i)
{
	if (i==1)
	{
		$('onglets_online').show();
		$('onglets_salle').hide();
	}
	else
	{
		$('onglets_online').hide();
		$('onglets_salle').show();	
	}
	var url='../../files/include/inout.php';
	var aRequest= new Ajax.Request(url,{method:'get',parameters:{en_ligne:i},onSuccess:onSuccessNothing});		
}
function onSuccessinOut(xhr)
{
	var resultat="["+xhr.responseText+"]";
	var json = resultat.evalJSON();
	json.each
	(
	function (tab)
	{
		if (tab.error==0)
		{			
			$('wait_oep').hide();
			setCadreLogin(tab.nom,tab.prenom);			
			$('login_oep').show();	
		}
		else
		{
			$('error_msg').innerHTML=tab.message;
			$('wait_oep').hide();
			$('error_oep').show();	
		}
	}
	)
}

function abon()
{
	email=$F('email_abo');
	if ((!(email==''))&&(!(email=='Email vide !')))
	{
		window.location = "../pages-oep/abonnement.php?email="+email;	
	}
	else
	{
		$('email_abo').value='Email vide !';
	}
}
function resultatVenteSalle(annee)
{
	window.location = '../pages-oep/resultat-annee_'+annee+'.html';	
}
function resultatParCriteres()
{
	var res_libel=$F('se_libel');
	var res_cat=$F('res_cat');	
	var res_sub_cat=$F('res_sub_cat');	
	var res_prix_mini='';
	var res_prix_maxi='';
	try
	{
		res_prix_mini=$F('se_prix_mini');
		res_prix_maxi=$F('se_prix_maxi');
	}
	catch(e)
	{
	}
	var res_date_mini=$F('se_date_mini');
	var res_date_maxi=$F('se_date_maxi');
	var url='../../files/include/set_criteres_vente.php';
	var aRequest= new Ajax.Request(url,{method:'get',parameters:{res_libel:res_libel,res_cat:res_cat,res_sub_cat:res_sub_cat,res_prix_mini:res_prix_mini,res_prix_maxi:res_prix_maxi,res_date_mini:res_date_mini,res_date_maxi:res_date_maxi},onSuccess:onSuccessSetCriteres});			
}

function onSuccessSetCriteres(xhr)
{
	var resultat="["+xhr.responseText+"]";
	var json = resultat.evalJSON();
	json.each
	(
	function (tab)
	{
		if (tab.error==0)
		{			
		}
		else
		{
			window.location = '../pages-oep/resultat-par-criteres.php';	
		}
	}
	)
}
function checkUnLoad()
{
	//window.alert('unload');
	GUnload();	
}
function addToMap(response)
{
      // Retrieve the object
      if (response.Status.code==200)
	  {
		  place = response.Placemark[0];
	      point = new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]);
	      map.setCenter(point, 13);
	      marker = new GMarker(point);
	      map.addOverlay(marker);
		  map.addControl(new GLargeMapControl());
	      marker.openInfoWindowHtml(place.address);
		  $('adresse').innerHTML='';
	  }
	  else
	  {
		$('adresse').innerHTML='D&eacute;sol&eacute; aucune correspondance g&eacute;ographique trouv&eacute;e.';
	  }
}
function initLoad()
{	
	new PeriodicalExecuter(pollTimer,1);
	var pageName=$('page_name').innerHTML;	
	if (getCookie('oeponline_filter')==1)
	{
		$('filter').show();
	}
	new Tip('tip_01', 'Vous inscrire vous permet de suivre les lots que vous aurez s&eacute;lectionn&eacute;s.<br/>Une fois inscrit, vous pourrez connaitre les r&eacute;sultats des ventes, valider votre abonnement bancaire et ainsi ench&eacute;rir sur les ventes online', {style: 'protoblue', stem: 'topLeft',title : 'Inscriptions'});		
	try
	{
		new Tip('tip_12', 'Afficher les lots avec ench&egrave;res gagnantes et non closes', {style: 'protoblue', stem: 'topLeft',title : 'Encours'});					
	}
	catch(e)
	{
	//nothing
	}	
	try
	{	
		new Tip('tip_02', 'Vous ne pourrez ench&eacute;rir qu\'en vous abonnant sur le site bancaire dont le lien est fourni ici.', {style: 'protoblue', stem: 'topLeft',title : 'Abonnement bancaire'});			
	}
	catch(e)
	{
	//nothing
	}		
	new Tip('tip_04', 'Recevoir par email les informations concernants les ventes de OUEST ENCHERES PUBLIQUES', {style: 'protoblue', stem: 'topLeft',title : 'Abonnement lettre d\'information'});		
	new Tip('tip_05', 'Supprime tous les crit&egrave;res de s&eacute;lection appliqu&eacute;s.', {style: 'protoblue', stem: 'topLeft',title : 'Annulation des crit&egrave;res de s&eacute;lection.'});		
	new Tip('tip_07', 'Valable uniquement pour les ventes en cours sur internet, et les ventes en salle pr&eacute;vues.<br/>Pour faire une recherche sur les ventes pass&eacute;es, choisir le menu RESULTATS DES VENTES.', {style: 'protoblue', stem: 'topLeft',title : 'Recherche'});		
	var pageName=$('page_name').innerHTML;		
	if (pageName=="cle-de-securite.php")
	{
		$('secure_key_1').focus();
	}
	else if (pageName=="mes-infos.php")
	{
		try
		{
			$('ut_ident').focus();
		}
		catch(e)
		{
			$('ut_titre').focus();
		}
	}	
	else if (pageName=="change-email.php")
	{
		try
		{
			$('email_1').focus();
		}
		catch(e)
		{
			//nothing
		}		
	}
	else if (pageName=="login.php")
	{
		$('login_name').focus();
	}
	else if (pageName=="change-pseudo.php")
	{
		$('login_1').focus();
	}	
	else if (pageName=="change-pwd.php")
	{
		$('pwd_1').focus();
	}		
	else if (pageName=="oubli-nouveau-mot-de-passe.php")
	{
		$('pwd_1').focus();
	}			
	else if (pageName=="rappel-mot-de-passe.php")
	{
		$('login_name').focus();
	}
	else if (pageName=="logout.php")
	{		
		setCookie('oeponline_showliste',0);	
	}
	else if (pageName=="rappel-identite.php")
	{
		$('email').focus();
	}				
	else if (pageName=="contact.php")
	{
		$('c_subject').focus();
		Form.Element.setValue('c_message','');
	}
	if (pageName=="localisation-vente.php")
	{
		if (GBrowserIsCompatible())
		{
			Event.observe(window, 'unload', checkUnLoad, false);
			map = new GMap2($("carto"));
			var address = $('carto_adresse').innerHTML;
			var geocoder = new GClientGeocoder();
			geocoder.getLocations(address, addToMap);
		}		
	}
	if ((pageName=="galerie.php")||(pageName=="galerie-mini.php"))
	{
		new Tip('tip_11', 'Faire un clic sur la photographie avec la souris pour afficher un agrandissement.<br/><br/>Pour faire d&eacute;filer les images aggrandies cliquer dans l\'image soit &agrave; droite (Avancer), soit &agrave; gauche (Reculer).<br/><br/>Pour obtenir un d&eacute;filement automatique des agrandissements (diaporama), cliquer sur [go], pour l\'arr&egrave;ter cliquer sur [stop], en bas &agrave gauche.', {style: 'protoblue', stem: 'topLeft',title : 'Affichage zoom et diaporama'});				
	}
	if (pageName=="voir-detail.php")
	{
		if (getCookie('oeponline_showliste')==1)
		{
			$('list_survey_bis').show();			
			$('list_alternate').hide();
		}
		else
		{
			$('list_survey_bis').hide();
			$('list_alternate').show();		
		}
		new Tip('tip_08', 'Sans nouvelle intervention de votre part, vos ench&egrave;res seront automatiquement port&eacute;es et plafonn&eacute;es au montant indiqu&eacute;. Equivaut &agrave; l\'ordre d\'achat en salle des ventes.<br/>NB : Si une ench&egrave;re a lieu 3 mn avant la fin de la vente, le temps restant est r&eacute;ajust&eacute; &agrave; 3 mn <br/>  afin de laisser la possibilit&eacute; aux autres ench&eacute;risseurs de sur-ench&eacute;rir.', {style: 'protoblue', stem: 'topLeft',title : 'Ench&egrave;re automatique'});	
		new Tip('tip_09', 'Une seule ench&egrave;re au montant indiqu&eacute;. Equivaut &agrave; l\'ench&egrave;re traditionnelle en salle des ventes.<br/>NB : Si une ench&egrave;re a lieu 3 mn avant la fin de la vente, le temps restant est r&eacute;ajust&eacute; &agrave; 3 mn <br/>  afin de laisser la possibilit&eacute; aux autres ench&eacute;risseurs de sur-ench&eacute;rir.', {style: 'protoblue', stem: 'topLeft',title : 'Ench&egrave;re simple'});				
		new Tip('tip_14', 'Le montant maximum de votre ench&egrave;re automatique est ajust&eacute; au pas des ench&egrave;res.<br/>Le montant des surench&egrave;res automatiques suivra le pas des ench&egrave;res', {style: 'protoblue', stem: 'topLeft',title : 'Gestion du pas d\'ench&egrave;re automatique'});				
		try
		{
			new Tip('tip_10', 'Identique &agrave; l\'ench&egrave;re simple, mais avec un montant impos&eacute;. De plus la dur&eacute;e de vente est r&eacute;duite &agrave; 10 mn (Sauf ench&egrave;res suppl&eacute;mentaires durant cette p&eacute;riode).<br/>NB : Si une ench&egrave;re a lieu 3 mn avant la fin de la vente, le temps restant est r&eacute;ajust&eacute; &agrave; 3 mn <br/>  afin de laisser la possibilit&eacute; aux autres ench&eacute;risseurs de sur-ench&eacute;rir.<br/> *** Si le montant d\'une ench&egrave;re automatique en cours d&eacute;passe le montant joker, le temps n\'est pas r&eacute;duit. ***', {style: 'protoblue', stem: 'topLeft',title : 'Ench&egrave;re joker'});		
		}
		catch(e)
		{
			// nothing
		}
		try
		{
			new Tip('tip_25', 'Le plafond de carte bancaire autoris&eacute; par OEP est d&eacute;pass&eacute;.<br/>Le gagnant devra r&eacute;gler par virement la diff&eacute;rence entre le plafond et le montant total avant de r&eacute;cup&eacute;rer son lot.<br/>Le montant et les coordonn&eacute;es bancaires du virement seront confirm&eacute;s sur l\'email exp&eacute;di&eacute; au gagnant.', {style: 'protoblue', stem: 'topLeft',title : 'Gestion plafond Carte Bancaire'});				
		}
		catch(e)
		{
			// nothing
		}		
		try
		{
			new Tip('tip_26', 'Le plafond de carte bancaire autoris&eacute; par OEP est d&eacute;pass&eacute;.<br/>Le gagnant devra r&eacute;gler par virement la diff&eacute;rence entre le plafond et le montant total avant de r&eacute;cup&eacute;rer son lot.<br/>Le montant et les coordonn&eacute;es bancaires du virement seront confirm&eacute;s sur l\'email exp&eacute;di&eacute; au gagnant.', {style: 'protoblue', stem: 'topLeft',title : 'Gestion plafond Carte Bancaire'});		
		}		
		catch(e)
		{
			// nothing
		}
		
	}
	
	if (is_ie6())
	{
		//nothing	
	}	
	pe=new PeriodicalExecuter(updateData,periode);
}
BrowserDetect.init();
is_lessIe6();
Event.observe(window, 'load', initLoad, false);
//]]>