<!--
	var url_ajax = "/ajax.php";
	var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i

	$().ajaxStart(function(){ $.blockUI('...',{"border":"0px"});});
	$().ajaxStop(function(){ $.unblockUI()})

	function changeMainPhoto(img,img2,need_remove_bg){
		var div= $("#images_porte");
		var imageMain = $("#imageMain");
		var imageMainSRC = $("#imageMainSRC");
		
		if (need_remove_bg!='yes'){
			imageMain.css("background","none");
			imageMain.css("border","0");
			//imageMainSRC.css("border","1px solid #ccc");
		}else{
			imageMain.css("background","#FFFFFF");
			imageMain.css("border","1px solid #ccc");
		}
		
		if (imageMain.css('display')=='none'){
			div.fadeOut('fast',function(){
										div.remove()
										imageMainSRC.attr("src",img)
										imageMain.fadeIn("fast");
									});
		}else{
			imageMain.fadeOut("fast",function (){
												imageMainSRC.attr("src",img);
												imageMain.fadeIn("fast");
											   });
				
		}
		
	$('A.jqzoom').attr('href',img2); 
	}

	/**
	*	Check format
	**/
	function checkFormat(e,type,not_empty){
		var id = e.id;
		var value
		switch (type){
			case 'int':
				value = Math.abs(parseInt(e.value))

				var re = /^([\d])*$/;
				if (!re.test(value)) { 
					if (not_empty)	{value=1}
					else			{value=''}
				}

			break;
		}
		
		e.value = value;
	}

	/**
	*	go to a specified URL
	**/
	function go2url(url){
		window.location = url;
	}
	
	function ChangeAdresse(type,id_adresse){
		var to_change = $("#for_change_"+id_adresse).val()
		var vars = to_change.split('|')
		
		$("#adresse_"+type+" :text").each(function(){
									   	$(this).val('')
									   })
		
		for (i=0;i<vars.length;i++){
			var tmp = vars[i].split('=')
			if (tmp[0]!=''){
				var toChange = tmp[1]
				$("#adresse_"+type+" #"+tmp[0]).val(toChange)
			}
		}
	}
	
	function Popup(url,w,h){
		window.open(url,'','width='+w+',height='+h+', resizable=no, scrollbars=yes,toolbar=no,directories=no,status=no,menubar=no, location=no');
		
	}
	
	function CheckStock(message){
		var qte = $("#qte").val()
		var instock = parseInt($("#stock").html());
		if (typeof instock == "undefined" || qte>instock){
			alert(message);
		}
	}
	function PopupNews(id,height){
		var w = 480, h = 340;
		var lng = $("#lng").val();
		
		if(jQuery.browser.msie){
			
				w = document.documentElement.offsetWidth,
				h = document.documentElement.offsetHeight
			
		}else{
			w = window.innerWidth;
			h = window.innerHeight
		}
		var popW = 750, popH = height+50;
		
		var leftPos = (w-popW)/2, topPos = (h-popH)/2+30;
		
		window.open('/'+ lng + '/popup/news/'+id+'/','popup','width=' + popW + ',height='+popH+',top='+topPos+',left='+leftPos);
		
	}
	
	/**
	*
	**/
	function onSelectChange(){
		if (this.value>0) {
		$('#stock').html(this.value)
		} else {
		html = $('#alertnostock').html()
		$('#stock').html(html)
		}		
	}
	
	function getValue(){
		var selected = $("#td option:selected");       
		return selected.text();
	}
	
	function PreviewOrder(id,lng){
		window.open("/"+lng+"/popup/orders/"+id+'/','','channelmode=no, fullscreen=no, width=600, height=700, scrollbars=yes, left=300, top=200')
	}

	function changeOptions(value){
		var e = $("#price_pro");
		if (value=='pro')	{e.attr("checked","checked")}
		else				{e.attr("checked","")}
		
	}
	
	function validate(){
		var count = $("#coll input:checked").size()
		
		if (!count){alert($("#no_coll").val()); return false;}
	}

	function add2cart(id_product,qte){
		$("#topcart").load(url_ajax,
		  {
			  action 	: 'add2cart',
			  id_product: id_product,
			  qte		: qte
		  },
		  function() {
			$("#modal_added").fadeIn("fast",function(){
			  setTimeout('$("#modal_added").fadeOut()',1500);
			});

		  }
		);		
	}

-->