var xval, tval, bval, rval, lval;
function showLoading(loadingText) {
	if (loadingText == null || loadingText == "") {
		loadingText = 'Merci de patienter quelques secondes...';
	}
	xval=getBusyOverlay('viewport',{color:'#abab91', opacity:0.75, text:loadingText, style:'text-shadow: 0 0 2px black;font-size:15px;color:#24240f'},{color:'#00558D', size:120, type:'o'});
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function fillFields() {
	if (document.getElementById('header:nfform-connect-disconnect:login')) {
		document.getElementById('header:nfform-connect-disconnect:login').value = 'E-mail';
	}
	if (document.getElementById('header:nfform-connect-disconnect:password')) {
		document.getElementById('header:nfform-connect-disconnect:password').value = 'Mot de passe';
	}
	if (document.getElementById('header:nfform-searchProducts:searchString')) {
		document.getElementById('header:nfform-searchProducts:searchString').value = 'Mots-cl\351s';
	}
	if (document.getElementById('login:login')) {
		document.getElementById('login:login').value = 'E-mail';
	}
	if (document.getElementById('login:password')) {
		document.getElementById('login:password').value = 'Mot de passe';
	}
}

function onloadPage(aForm, para, value, defVal) {
	if (aForm != null) {
		a = '?'+para+'='+((value == '')?defVal:value);
		aForm.action+=a;
	}
}

function onloadShow(url) {
	if (url!='') {
		$.fn.colorbox({href:url,transition:"fade",width:"650px", height:"300px", scrolling:false});
	}
}

function zoomProduct(imageUrl) {
	$.fn.colorbox({href:imageUrl, photo:true});
	return false;
}

function onloadPopUpGoTo(parent, u) {
	if (u == 'close') {
  	parent.tb_remove();
  }
	else if (u != '') {
		parent.location.replace(u);
	}
}

function onLoadPage(aForm, para, value, defVal) {
	if (aForm != null) {
		a = '?'+para+'='+((value == '')?defVal:value);
		aForm.action+=a;
	}
}

function checkQuantity(field){
	if(field.value <= 0) {
		alert("La quantit\351 doit \352tre superieure \340 0");
		field.value = '1';
		field.focus();
		return false;
	}
	if (! checkNum(field.value)) {
		alert("La quantit\351 doit \352tre un nombre entier");
		field.value =Math.round(field.value);
		field.focus();
		return false;
	}
	return true;
}

function checkNum(x) {
if (!(/^\d+$/.test(x))){
	return false;
}
return true;
}
