// JavaScript Document
//*************************************  _onefiles/library/webber.js *******************************
function ColorSectionTab(tabId,color)
{
	MM_preloadImages() 
	document.getElementById(tabId + "left").style.backgroundImage = "url('_onefiles/style/" + color + "Tab_LeftCorner.gif')";
	document.getElementById(tabId + "mid").style.backgroundImage = "url('_onefiles/style/" + color + "Tab_Middle.gif')";
	document.getElementById(tabId + "right").style.backgroundImage = "url('_onefiles/style/" + color + "Tab_RightCorner.gif')";	
}
//*************************************  Library/tools-swapimage.js  *******************************
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//*************************************  Library/tools.js *******************************
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;		
}
// 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();}
}