/* *** INFORMAÇÕES DE LICENCIAMENTO (LICENSE INFORMATION)  ***

   @author Nilson Pontello de Freitas <nilson@hostminas.com>
   @date 05/04/2007
	
   Version: HostMinas License 1.0

   O conteúdo desse arquivo está sujeito às regras da Licença de Software
   HostMinas, versão 1.0. Está proibido o uso dos códigos contidos neste arquivo
   por terceiros, bem sua cópia, no todo ou em parte, sem expressa autorização
   dos detententores da propriedade intelectual e dos direitos comerciais. Uma
   cópia da licença pode ser obtida em http://www.hostminas.com/license. A
   propriedade intelectual e comercial deste código pertence à HostMinas
   Internet Services Ltda.

   Copyright (c) 2007. Todos os direitos reservados.

   ----

   This paragraph is a free translation from Brazilian-Portuguese to
   American-English of the license information above, for better understanding
   purposes. Any intepretation of it must consider the original document. The
   contents of this file are subject to the HostMinas Software License, version
   1.0. It is forbidden the use of the codes included on this file, even
   partially, for third parties, such as its copy, without express
   authorization of the intelectual property and commercial rights owners. A
   copy of the license may be obtained at http://www.hostminas.com/license.
   The intelectual property and comercial rights of this file and codes belong
   to HostMinas Internet Services Ltd.

   Copyright (c) 2007. All rights reserved.

   *** FIM DAS INFORMAÇÕES DE LICENCIAMENTO (END OF LICENSE INFORMATION) ***
 */
	
	var OPACITY ={
		
		set: function(obj, value)
		{
			if(AC.Detector.isIE())
				obj.style.filter = 'alpha(Opacity = '+(value*100)+'); progid:DXImageTransform.Microsoft.Shadow(color=\'#7C7C94\', Direction=120, Strength=3)';
			else if(AC.Detector.isFirefox())
				obj.style.MozOpacity = value;
			else
				obj.style.opacity = value;				
		}
	}	
	
	function unescapeXML(string){
		
			string = string.replace(/&quot;/g,'"');
			string = string.replace(/&apos;/g,"'");
			string = string.replace(/&amp;/g,'&' );
			string = string.replace(/&lt;/g,'<'  );
			string = string.replace(/&gt;/g,'>'  );		
	
			return string;
	}
	
	function attribute(string) {
	
		string = string.replace(/[&]/,'&amp;');
		string = string.replace(/["]/,'&quot;');
		string = string.replace(/[<]/,'&lt;');
	
		return string;
	}
	
	function protectXML(string) {
	
		string = unescapeXML(string);
		string = string.replace(/[<]/g,'&lt;'  );	
		return string;
	}
	
	function $(id){
		return document.getElementById(id);
	}
	
	function get(id)
	{
		return 	$(id);
	}
	
	function openlink(href)
	{
		document.location = href;
	}
	
	 function encodeId(id)
	 {
		id = id.replace('#', '%23');
		id = id.replace(':', '%3A');
		
		return id;
	 }
	 
	 function count(vector)
	 {
		var count=0;
		
		for(var index in vector)
			if(vector[index] != null)
				count++;
				
		return count;	
	 }