	
	function setHeightBox()
	{
		 var heightmax ="0";
		 var boxh="";
		 $.each($('.art-item'), function(index,value){	    
			 boxh = $(this).height();		
			 if (heightmax <= boxh ) { heightmax=boxh; }	
		 });
		 $('.art-item .ui-widget-content').height(heightmax);	 
	}
	
	function setHeightCol()
	{
		var center='0';	
		var left='0';	
		 center = $('.content').height();
		 left = $('.col_left').height();
		 if (center >= left)
		 {	$('.col_left').height(center);	} else { $('.content').height(left); };	
		 
		 right = $('.col_right').height();
		 if (center >= right)
		 {	$('.col_right').height(center);	} else { $('.content').height(right); $('.col_left').height(right); };		 
	}
	function setButton()
	{
		$("button").button();
		$("button.see_more").button({icons:{primary:'ui-icon-arrowthick-1-e'}});	
		$("button.cart").button({icons:{primary:'ui-icon-cart'}});	
		$("button.disk").button({icons:{primary:'ui-icon-disk'}});
		$("button.locked").button({icons:{primary:'ui-icon-locked'}});
		$("button.add").button({icons:{primary:'ui-icon-circle-plus'}});
		$("input.submit").button();
		
	}
	function ajax_charge(lien)
	{
		$.ajax({
				   type: "GET",
				   url: lien,				
				   error:function(msg){
					 alert( "Error !: " + msg );
				   },
				   beforeSend:function(){
					 $('#content').hide();  
					 $('#loading').show(); 
				   },
				   complete:function(){		
				       $('#loading').hide(); 
				   	   $('#content').show(); 					   
					   setHeightBox();
					   setHeightCol();	
					   setButton();					   
				   },
				   success:function(data){				   
					$('#content').html(data);						
				   }
				});
	}
	
	function goUrl(url) {
		window.location.replace(url);	
	}	
	
	function mypop(who){
		$('#infos').load("index.php?a=rep_dep&act=departement&dep=" + who);
		return false;
	}
	
	function confirmRedirection(url,txt,titre)
	{	
		$('span.message_confirm').html(txt);
		
		$("#dialog-confirm").dialog({
			title:titre,
			resizable: false,
			modal: true,
			buttons: {
				'Oui': function() {
					$(this).dialog('close');
					goUrl(url);
				},
				'Non': function() {
					$(this).dialog('close');
				}
			}
		});	
	}
	

function submitForm(formulaire) {
	$(formulaire).submit();
}	
