function languages ()
{
	var thisObj = this;
	var strlang = ".bra";
	
	// main function
	this.changelang = function(newlang)
	{
		if (newlang && newlang!="")
			strlang = newlang;

		thisObj.changedoc(window.document);		
		thisObj.changeframes (frames);
	}
	
	
	this.getlang = function()
	{
		return strlang;
	}
	
	
	// local
	this.changedoc = function(doc)
	{
		if (!document.styleSheets) return;
		var theStyles = new Array();
		var theRules = new Array();
		var selector = "";

		theStyles = doc.styleSheets;

		var i = 0;
		var j = 0;
		for (i = 0; i < theStyles.length; i++)
		{
			if (doc.styleSheets[i].cssRules)
				theRules = doc.styleSheets[i].cssRules;
			else if (doc.styleSheets[i].rules)
				theRules = doc.styleSheets[i].rules;
			else return;
			
			for (j = 0; j < theRules.length; j++)
			{
				selector = theRules[j].selectorText;
				if (selector == strlang)
					theRules[j].style.display = "inline";
				else if ( (selector == ".bra") || (selector == ".eua") || (selector == ".spa") )
					theRules[j].style.display = "none";				
			}		
		}

	}
	
	
	// inner
	this.changeframes = function (theFrames)
	{
		var f = 0;
		for (f = 0; f < theFrames.length; f++)
		{
			thisObj.changedoc(theFrames[f].document);		
			if (theFrames[f].frames.length > 0)
				thisObj.changeframes(theFrames[f].frames);
		}
	}	
	
}
