function getQueryString(key)
{
query = parent.location.search;
//alert("Maintenance - query = "+ query + " query.length = "+ query.length);
if (query.length > 3)
	{		
		query = query.substring(1, query.length); 
		for(var i=0; i < query.split("&").length; i++)
		{
			subQuery = query.split("&")[i];
			subQueryKey = subQuery.split("=")[0];
			subQueryValue = subQuery.split("=")[1];
			if (subQueryKey.toLowerCase()==key.toLowerCase())
			{

				var result ; 
				//result =decodeURIComponent(subQueryValue);
				result = unescape(subQueryValue); 
				//result = decodeURI(subQueryValue); 
				return result;
			}
		}
	}
	else
	{
		return "";
	}
}


// replace a char or a group of char inside an expression recusively until it disappears...

function replaceAll(myStringToClean,myExpToRemove,myExpToReplaceTo)
{
	
	
		while(myStringToClean.indexOf(myExpToRemove)!=-1)
		{
			myStringToClean = myStringToClean.replace(myExpToRemove,myExpToReplaceTo);
		}
	
	
	return myStringToClean;			
	
}


// Ajouter aux favoris


function bookmark(url, sitename)
{
  ns="Merci, d'utiliser la combinaison de touches '[CTRL]'+ 'D' pour ajouter &agrave; vos favoris."
  if ((navigator.appName=='Microsoft Internet Explorer') &&
    (parseInt(navigator.appVersion)>=4))
  {
    window.external.AddFavorite(url, sitename);
  }
  else 
  {
    alert(ns);
  }
}

function AfficheHomePage()
	{
	if (document.all && document.getElementById )
		{
		document.write('&nbsp;<A HREF="#" onClick="HomePage(this);return(false);"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">Mettre en page daccueil</font></A>');
		}
	}
function HomePage(obj)
	{
	obj.style.behavior='url(#default#homepage)';
	obj.setHomePage('http://www.weboose.com');
	}

// Affiche la page sous forme de popup et focus dessus
function popitup(url,heightpopup,widthpopup)
{
	popitup(url,heightpopup,widthpopup,'no','yes','yes','name');
}	

function popitup(url, heightpopup, widthpopup, location, resizable, scrollbars, name) {	
	newwindow= window.open(url,name,'height='+heightpopup+',width='+widthpopup+',location ='+location+',resizable ='+resizable+',scrollbars='+scrollbars);
		 if (window.focus) {newwindow.focus();}
}
