function BrowserCheck() {
	var b = navigator.appName;
	if (b == "Netscape") this.b = "NS";
	else if (b == "Microsoft Internet Explorer") this.b = "IE";
	else this.b = b;
	this.v = parseInt(navigator.appVersion);
	this.NS = (this.b == "NS" && this.v>=4);
	this.NS4 = (this.b == "NS" && this.v == 4);
	this.NS5 = (this.b == "NS" && this.v == 5);
	this.IE = (this.b == "IE" && this.v>=4);
	this.IE4 = (navigator.userAgent.indexOf('MSIE 4')>0);
	this.IE5 = (navigator.userAgent.indexOf('MSIE 5')>0);
	if (this.IE5 || this.NS5) this.VER5 = true;
	if (this.IE4 || this.NS4) this.VER4 = true;
	this.OLD = (! this.VER5 && ! this.VER4) ? true : false;
	this.min = (this.NS||this.IE);
}
is = new BrowserCheck();

function zoomInBig(s, n, t) {
  d = (is.VER5) ? document.getElementById(n).style : (is.NS) ? document.layers[n] : document.all[n].style;
  d.left = getImgXPos(s);
  if (t==1)
    d.top  = getImgYPos(s)-100;  
  else
    d.top  = getImgYPos(s);  
  d.visibility = 'visible';
}

function goIdent() {
  f = document.forms['cart'];
  f.a.value = 'ident';
  f.submit();
}

function goDeliveryForm() {
  f = document.forms['cart'];
  f.a.value = 'delf';
  f.action  = '/delivery.html';
  f.submit();
}

function setDeliveryDate(day, month, year) {
  f = document.forms['orderForm'];
  f.r.value   = 'cart';
  f.a.value   = 'deld';
  f.del_day.value   = day;
  f.del_month.value = month;
  f.del_year.value  = year;
  f.action  = '/delivery-date.html';
  f.submit();
}

function isPositiveInteger(s) 
{
	return s.match(/^\d+$/);
}

function checkQte(f) {
  var v = f.value;
  if (!isPositiveInteger(v)) {
     alert('Quantité invalide!');
     f.value='1';
  }     
}

function checkPostCode(f) {
  var v = f.value;
  if (!isPositiveInteger(v)) {
     alert('Code postal invalide!');
     f.value='';
  }     
}

function popup(u) {
   window.open(u, '_blank', 'width=400, height=280, location=0, resizable=1, menubar=0, scrollbars=0');
}

function submitSearchForm() {
  var f = document.sch;
  var q = document.sch.q.value;
  var reg=new RegExp(" ", "g");
  f.action = '/fleur/' + q.replace(reg, "-") + '.html';
}

function showMenu(n) {
  var c = document.getElementById('menuCat');
  var o = document.getElementById('menuEvent');
  var p = document.getElementById('menuPri');

  if (n=='menuCat') {
		c.style.display='block';
		o.style.display='block';
		p.style.display='none';
  } else {
		c.style.display='none';
		o.style.display='none';
		p.style.display='block';
  }
}

function showMore() {
  var d = document.getElementById('crumbTxt');
  if (d.style.display=='block') {
		d.style.display='none';
  } else {
		d.style.display='block';
  }
}

function setMessage(s) {
  var t = document.getElementById('txtMsg');
  t.value = s.value;
}

function openWindow(l,h,u){
	var top=(screen.height-h)/2;
	var left=(screen.width-l)/2;
	window.open(""+u+"", "_blank", "toolbar=no,location=no,directories=no,status=no,scrollbars=1,resizable=no,copyhistory=0,menubar=0,width="+l+",height="+h+",top="+top+",left="+left+"");
}

function loadMenu() {
	var md =document.getElementById('ifm');
	if (md!=null) {
		md.src='http://www.foliflora.com/left-menu.php';
	}	
}

