function nomselected()
{
	window.document.PlaisirForm.txtNomHD.value = window.document.PlaisirForm.txtNom.value
}

function catselected()
{
	window.document.PlaisirForm.txtCategoryHD.value = window.document.PlaisirForm.txtCategory.selectedIndex
}

function regionselected()
{
	window.document.PlaisirForm.txtRegionHD.value = window.document.PlaisirForm.txtRegion.selectedIndex
}



function resetselect()
{
	nomselected()
	catselected()
	regionselected()
}

function resetAll(){
window.document.PlaisirForm.txtNom.value = '';
window.document.PlaisirForm.txtCategory.selectedIndex = 0;
window.document.PlaisirForm.txtRegion.selectedIndex = 0;
window.location.href = 'mainap.asp?sAction=&banseqid=1#searchtop'
resetselect();
}

function removeNull(pValue)
{
	var tempString;
	tempString = pValue;
	if (pValue == null)
	{
		tempString = "";
	}
	return tempString;
}

function getWidth(){
	var tempString;
	return screen.availWidth;
};


function resetNom()
{
	window.document.PlaisirForm.txtNom.value = '';
	nomselected();
}

function resetCategory()
{
	window.document.PlaisirForm.txtCategory.selectedIndex = 0;
	catselected();
}

function resetRegion()
{
	window.document.PlaisirForm.txtRegion.selectedIndex = 0;
	regionselected();
}


function ValidatePlaisir(){

var bCatEntered;
var bNomTextEntered;
var bRegionEntered;

var sCat;
var sNom;
var sRegion;


	sNom = window.document.PlaisirForm.txtNom.value;
	if (sNom == null){
		sNom = ''; 
	}
	
	if  (sNom.length > 0) {
		bNomTextEntered = true;
	}


	if  (sNom.length > 2) {
		return true;
	}

	sCat = window.document.PlaisirForm.txtCategory.value;
	sRegion = window.document.PlaisirForm.txtRegion.value;
		
		if (sRegion != ""){
			return true;
		}
		else
			bCatEntered = true;

		if (bCatEntered)
		{
			return true;
		}
		else
			bCatEntered = true;

	if (bNomTextEntered) {
		alert("S.V.P. précisez au moins trois caractères pour votre recherche par nom.");
		window.document.PlaisirForm.txtNom.focus();
	}
	else if (!bCatEntered){
		alert("S.V.P. précisez une catégorie ou.");
		window.document.PlaisirForm.txtCategory.focus();
	}
	
	return false;

}	
// extract front part of string prior to searchString
function getFront(mainStr,searchStr){
	foundOffset = mainStr.indexOf(searchStr)
	if (foundOffset == -1) {
		return null
	}
	return mainStr.substring(0,foundOffset)
}

// extract back end of string after searchString
function getEnd(mainStr,searchStr) {
	foundOffset = mainStr.indexOf(searchStr)
	if (foundOffset == -1) {
		return null
	}
	return mainStr.substring(foundOffset+searchStr.length,mainStr.length)
}

// insert insertString immediately before searchString
function insertString(mainStr,searchStr,insertStr) {
	var front = getFront(mainStr,searchStr)
	var end = getEnd(mainStr,searchStr)
	if (front != null && end != null) {
		return front + insertStr + searchStr + end
	}
	return null
}

// remove deleteString
function deleteString(mainStr,deleteStr) {
	return replaceString(mainStr,deleteStr,"")
}

// replace searchString with replaceString
function replaceString(mainStr,searchStr,replaceStr) {
	var front = getFront(mainStr,searchStr)
	var end = getEnd(mainStr,searchStr)
	if (front != null && end != null) {
		return front + replaceStr + end
	}
	return null
}

function popUpSpirit(pValue){

var tempString;
//tempString = '';
//window.open(theURL, wname, 'toolbar=1,location=0,directories=0,status=0,menubar=0,scrollbars=-1,resizable=0,left=0,top=0,screenX=0,screenY=0'+ s, true);
window.open('../../ficheimage/fichespirit.asp?Code=' + pValue, 'fichetech', 'toolbar=1,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,left=30,top=30,screenX=0,screenY=0,width=700', true);
}

function popUpEtablissement(pValue){

window.open('../../ficheap/ficheap.asp?Code=' + pValue, 'fichetech', 'toolbar=1,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,left=30,top=30,screenX=0,screenY=0,width=700', true);
}

function popUpVin(pValue){

var tempString;
//tempString = '';
//window.open(theURL, wname, 'toolbar=1,location=0,directories=0,status=0,menubar=0,scrollbars=-1,resizable=0,left=0,top=0,screenX=0,screenY=0'+ s, true);
window.open('../../ficheimage/fichevin.asp?Code=' + pValue, 'fichetech', 'toolbar=1,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,left=30,top=30,screenX=0,screenY=0,width=700', true);
}

function popUpBeer(pValue){

var tempString;
//tempString = '';
//window.open(theURL, wname, 'toolbar=1,location=0,directories=0,status=0,menubar=0,scrollbars=-1,resizable=0,left=0,top=0,screenX=0,screenY=0'+ s, true);
//alert('../../ficheimage/fichebiere.asp?Code=' + pValue)window.open('../../fichebr/fichebiere.asp?Code=' + pValue, 'fichetech', 'toolbar=1,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,left=30,top=30,screenX=0,screenY=0,width=700', true);
}
function popGuide(){

//var tempString;
//tempString = '';
//window.open(theURL, wname, 'toolbar=1,location=0,directories=0,status=0,menubar=0,scrollbars=-1,resizable=0,left=0,top=0,screenX=0,screenY=0'+ s, true);
//alert('../../ficheimage/fichebiere.asp?Code=' + pValue)window.open('../../guide/guibrsaucisse.asp', 'guide', 'toolbar=1,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,left=30,top=0,screenX=0,screenY=0,width=700,height=500', true);
}

var base= "../../images/header/";
var publibase= "../../";