// la fonction qui charge la page des bijouxs
function charge_page(rang,bijoux) 
	{              
	if(window.XMLHttpRequest) 
		{                 
		xhr = new XMLHttpRequest(); 
		} 
	else if (window.ActiveXObject) 
		{
		xhr = new ActiveXObject("Microsoft.XMLHTTP");
		} 
    
	xhr.open('GET', 'includes/bijoux_include.php?rang='+rang+'&nom='+bijoux, true); 
	xhr.send(null); 
    
	xhr.onreadystatechange = function() 
		{          
		if(xhr.readyState == 4) 
			{                   
    		if (xhr.status == 200)                   
				document.getElementById('contenu_bijoux').innerHTML = xhr.responseText;
			else 
				return; 
			} 
		}
		
	parent.location.hash = "rang="+rang+"=nom="+bijoux;
	
	//Selection du rang par défaut si on accède par un lien
	var j=0;
	while(document.choix_bijoux.rang_bijoux.options[j]!=null)
		{
		if(document.choix_bijoux.rang_bijoux.options[j].value==rang)
			document.choix_bijoux.rang_bijoux.options[j].selected = true;
		  j++;
		} 
	
	//Selection des bijoux par défaut si on accède par un lien
	var i=0;
	while(document.choix_bijoux.type_bijoux.options[i]!=null)
		{
		if(document.choix_bijoux.type_bijoux.options[i].value==bijoux)
			document.choix_bijoux.type_bijoux.options[i].selected = true;
		  i++;
		} 
	} 

//Se lance au chargement de la page pour charger les objets par défaut où les objets indiqués par le lien
window.onload = function() 
	{        
	var hash = parent.location.hash;       
    
	if (hash != "") 
		{                 
		var bijoux=hash.split("=");
		charge_page(bijoux[1],bijoux[3]);   
		} 	
	else 
		{ 
		charge_page('tout','ring'); 
		} 
	}
