var _defaultColor = GetQueryStringVal("v");
var _defaultFont = GetQueryStringVal("f");

function changeColor(color)
{
	if (color!='')	
		_defaultColor=color;
	
	if (_defaultColor == "")
		_defaultColor='br';
		
	document.getElementById("imgbhg").src = "images/boxStrokedta_"+ _defaultColor +".gif"; 
	document.getElementById("imgbbg").src = "images/boxStrokedBa_"+ _defaultColor +".gif"; 
	document.getElementById("imgbdeau").src="images/bandeau_haut_savernat_"+ _defaultColor +".gif";
    
	document.getElementById("tdh").setAttribute("class", "boxStrokedT_"+ _defaultColor,0);
	document.getElementById("tdL").setAttribute("class", "boxStrokedML_"+ _defaultColor,0 );
	document.getElementById("tdM").setAttribute("class", "boxStrokedM_"+ _defaultColor +" Catch Light",0);
	document.getElementById("tdb").setAttribute("class", "boxStrokedB_"+ _defaultColor,0);

	document.getElementById("tdh").setAttribute("className", "boxStrokedT_"+ _defaultColor,0);
	document.getElementById("tdL").setAttribute("className", "boxStrokedML_"+ _defaultColor,0 );
	document.getElementById("tdM").setAttribute("className", "boxStrokedM_"+ _defaultColor +" Catch Light",0);
	document.getElementById("tdb").setAttribute("className", "boxStrokedB_"+ _defaultColor,0);
	
	if (document.getElementById("content")!=null)
	    document.getElementById("content").setAttribute("className", "withScroll_"+ _defaultColor,0);

	for(i=0;i<document.getElementsByTagName("p").length;i++)
	{ 
		document.getElementsByTagName("p").item(i).setAttribute("className", "p_"+ _defaultColor);	
		document.getElementsByTagName("p").item(i).setAttribute("class", "p_"+ _defaultColor);	
			
	}
		
}

function changeFont(font)
{
	if (font!='')	
		_defaultFont=font;
	
	if (_defaultFont == "")
		_defaultFont='small';
		
	if (document.getElementById("tblText")!=null){
	document.getElementById("tblText").setAttribute("class", _defaultFont,0);
	
	document.getElementById("tblText").setAttribute("className",  _defaultFont,0);
	}
		
}

function GetQueryStringVal(lQuery)
{
var lDoc=String(document.location); 
var lSignet = ""; 
var n1 = lDoc.indexOf("?"); 
if (n1 > 0) 
{ 
  var n2 = lDoc.indexOf("?" + lQuery + "=",n1); 
  if (n2 < n1) 
    n2 = lDoc.indexOf("&" + lQuery + "=",n1); 
  if (n2 >= n1) 
  { 
    n2 = n2 + ("?" + lQuery + "=").length; 
    var n3 = lDoc.indexOf("&",n2+1); 
    if (n3 > n2) 
      lSignet = lDoc.substring(n2, n3); 
    else 
      lSignet = lDoc.substring(n2); 
  } 
}
return (lSignet)

}

function rediriger (page)
{
	document.location.href=  page + "?v=" + _defaultColor + "&f=" + _defaultFont;	
}

function redirigerLien (url)
{
    window.open (url);
    
}

