function emptySearchBox() {
	document.all.searchProduit.value="";
	document.all.searchfournisseur.value="";
}

function detectQQch() {
	if (document.all.searchProduit.value=="" && document.all.searchfournisseur.value=="" && document.all.searchcategorie.value=="")
		{
		document.all.submitbtn.disabled=true;
		}
	else
		{
		document.all.submitbtn.disabled=false;
		}
}

function submitform() {
	if ((document.frmRechercheFournisseurs.searchProduit.value=="") && (document.frmRechercheFournisseurs.searchfournisseur.value=="") && (document.frmRechercheFournisseurs.CategorieID.value=="")) {
		alert("Aucun item inscrit ou sélectionné")
		return false;
	} else {
		return true;
		}
}
function refreshHaut(param) {
    if (document.images)
        window.parent.frames[0].location.replace("/publicites/publicite.asp?" + param);
    else
        window.parent.frames[0].location.href = "/publicites/publicite.asp?" + param;
}

function ChangeMenu(param) {
	window.parent.frames[0].location.href = "/publicites/publicite.asp" + param;
}

function WindowOpen(p_URL, p_Width, p_Heigth, p_WinOptions) {
	// Determinate client screen settings
	if (document.all || document.layers) {
		var w = screen.availWidth;
		var h = screen.availHeight;
	}

	// Determinate window position
	var popW = p_Width;
	var popH = p_Heigth;

	var leftPos = (w-popW)/2;
	var topPos  = (h-popH)/2;
	
	// Determinate if window is resizable
	var windowSettings = "";
	
	if (p_WinOptions == 1) {
		windowSettings = "location=yes,resizable=yes,scrollbars=yes,status=yes,toolbar=yes,";
	}

	// Open the popup window
	window.open(p_URL,'','width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos + windowSettings);
}

function GenerateFlashTag(FlashFile, Width, Height) {
	var str = "";
	
	//Validate values
	if (Width == '') {
		Width = 468;
	}
	
	if (Height == '') {
		Height = 60;
	}

	if (FlashFile != "") {
		str = str + "<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' ";
		str = str + "codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' ";
		str = str + "WIDTH='" + Width + "' HEIGHT='" + Height + "' ALIGN='absmiddle'> ";
		str = str + "<PARAM NAME='movie' VALUE='" + FlashFile + "'>";
		str = str + "<PARAM NAME=menu VALUE=false>";
		str = str + "<PARAM NAME=quality VALUE=best>";
		str = str + "<PARAM NAME=salign VALUE=M>";
		str = str + "<PARAM NAME=bgcolor VALUE=#FFFFFF>";
			  
        str = str + "<EMBED src='" + FlashFile + "' menu=false quality=best salign=M bgcolor=#FFFFFF  WIDTH='" + Width + "' HEIGHT='" + Height + "' ALIGN='absmiddle'";
		str = str + "TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'></EMBED> ";
		str = str + "</OBJECT>";
    }
    return(str);
}

function GenerateImageTag(ImageFile, Width, Height, Border, Alt) {
	var str = "";
	
	//Validate values
	if (Width == '') {
		Width = 468;
	}
	
	if (Height == '') {
		Height = 60;
	}

	if (Border == '') {
		Border = 0;
	}
	
	if (ImageFile != "") {
		str = str + "<img src='" + ImageFile + "' Width='" + Width + "' Height='" + Height + "' border='" + Border + "' title='" + Alt + "'>";
	}
	return(str);
}