function valide_form_recherche_rapide(theform)
{
	var mots = theform.elements['_Mots'];
	var typerech = theform.elements['_TypeCode'];

	if (mots.value=="")
	{
		alert('Vous devez indiquer un ou plusieurs mots');
		mots.focus();
		return false;
	}
	theform.submit();

	return false;
}

function load_body_action()
{
	MM_preloadImages('images/bt_rech-av-over.gif','images/head_monpanier-on.gif','images/head_consult-on.gif','images/head_suivi-on.gif','images/tabs1on.gif','images/tabs2on.gif','images/tabs3on.gif','images/tabs4on.gif','images/tabs5on.gif','images/tabs6on.gif','images/tabs7on.gif');
	MM_preloadImages('images/b_hg.gif','images/b_h.gif','images/b_hd.gif','images/b_g.gif','images/b_d.gif','images/b_bg.gif','images/b_b.gif','images/b_bd.gif');
}

function page_popup(type)
{
	var top=(screen.height-400)/2;
	var left=(screen.width-660)/2;
	var thelink = '/page.php?_Pop=1&_Type='+type;
	if (url_param != '')
		thelink += '&' + url_param;

	var thestyle='status=no,location=no,directorie=no,resizable=yes,scrollbars=yes,menubar=no,toolbar=no,top='+top+',left='+left+',width=660,height=400';
	var w_page_popup = window.open(thelink,'LGDJLIB',thestyle);
	w_page_popup.focus();
}

function panier(num_ouvrage)
{
	if (lstPanierOuv.indexOf("¤"+num_ouvrage+"¤") != -1)
	{
		alert("Cet ouvrage est déjà présent dans votre panier.\nVous pouvez modifier la quantité souhaitée de cet ouvrage à la première étape de votre processus de commande.");
	}
	else
	{
		var thelink = '/panier.php?'+url_param;
		if (num_ouvrage != null && num_ouvrage != '')
		{
			if (url_param != '')
				thelink += '&_Ouvrage=' + num_ouvrage;
			else
				thelink += '_Ouvrage=' + num_ouvrage;
		}

		if (type_ouv_panier)
		{
			var width=Math.min(800,screen.width-100);
			var height=Math.min(600,screen.height-100);
			var left=(screen.width-width)/2;
			var top=(screen.height-height)/2;
			var w_panier = window.open(thelink,'panier_lgdjlib','resizable=yes,scrollbars=yes,top='+top+',left='+left+',width='+width+',height='+height);
			w_panier.focus();
		}
		else
		{
			window.location.replace(thelink);
		}
	}
}

function souscription(id)
{
	var top=(screen.height-400)/2;
	var left=(screen.width-950)/2;
	var thelink = '/page.php?_Type='+id+'&_Pop=1';
	if (url_param != '')
		thelink += '&' + url_param + '#souscrire';
	else
		thelink += '#souscrire';

	var thestyle='status=no,location=no,directorie=no,resizable=yes,scrollbars=yes,menubar=no,toolbar=no,top='+top+',left='+left+',width=950),height=400';
	var w_page_popup = window.open(thelink,'LGDJLIB',thestyle);
	w_page_popup.focus();
}

function rech_collection(coll)
{
	var thelink = '/rech_avancee.php?_EdColSscol='+coll;
	if (url_param != '')
		thelink += '&' + url_param;

	window.location.replace(thelink);
}

function detect_cookie(code_page)
{
	var tmpcookie = new Date();
	var chkcookie = (tmpcookie.getTime()+'');

	document.cookie = "chkcookie="+chkcookie+";path=/";

	if (document.cookie.indexOf(chkcookie,0) < 0)
	{
		var top=(screen.height-400)/2;
		var left=(screen.width-500)/2;
		var thelink = '/page.php?_Pop=1&_Type='+code_page;
		if (url_param != '')
			thelink += '&' + url_param;

		var w_page_popup = window.open(thelink,'LGDJLIB','status=no,location=no,directorie=no,resizable=yes,scrollbars=yes,menubar=no,toolbar=no,top='+top+',left='+left+',width=500,height=400');
		w_page_popup.focus();
	}
}

function haut_page()
{
	try
	{
		if (_detect_navigator() != "IE7" && _detect_navigator() != "MOZILLA5")
		{
			window.parent.lgdj_action.location = url_aff+'/lgdj_haut_page.htm';
		}
		else
		{
			location.hash = '#lgdj_toppage';
			document.getElementById('acclien1').firstChild.nodeValue = "";
			document.getElementById('acclien2').firstChild.nodeValue = "";
		}
	}
	catch(e)
	{
	}
}

function accueil()
{
	try
	{
		if (_detect_navigator() != "IE7" && _detect_navigator() != "MOZILLA5")
			window.parent.lgdj_action.location = url_aff+'/lgdj_accueil.htm';
	}
	catch(e)
	{
	}
}

function _detect_navigator()
{
	var ver = navigator.appVersion;
	var agent = navigator.userAgent;
	var dom = document.getElementById?1:0;
	var opera5 = agent.indexOf("Opera 5")>-1;
	var retour = "";

	if (agent.indexOf("Mozilla/5.0")>-1)
		retour = "MOZILLA5";
	else if ((ver.indexOf("MSIE 7")>-1 && dom && !opera5)?1:0)
		retour = "IE7";

	return retour;
}

