	try {
  document.execCommand("BackgroundImageCache", false, true);
} catch(err) {}

function getElementsByClass(searchClass,node,tag) {

	var classElements = new Array();
	if ( node == null )
		node = document;
	if ( tag == null )
		tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			//alert(els[i].tagName);
			
			els[i].style.display='none';
			els[i].parentNode.childNodes[0].style.fontWeight='normal';
			els[i].parentNode.childNodes[0].style.backgroundImage="url('imagenes/fl_verde.gif')";
			j++;
		}
	}
	return classElements;
}



function ListadoDespegable(t,c_over,c_out){

this.flecha="";
if(c_over==""){
	c_over="#EFF4D9";
}
if(c_out==""){
	c_over="#DAE5CD";
}

this.nodos=document.getElementById(t).getElementsByTagName("li");

	for(i=0;i<this.nodos.length;i++){
	
		
		this.nodos[i].onmouseover=function(){
		
		this.contador=0;
		this.p_;	
		while(this.p_!=true){
			if(this.childNodes[this.contador].tagName=="DIV"){
				//alert("bbb")
				this.p_=true;
				if(this.childNodes[this.contador].style.display=='block'){
					
					this.style.backgroundColor=c_out;
					
					
				
				}
				else{
					
					this.style.backgroundColor=c_over;
								}
				}
			else{
			this.contador++;
			}
		}
		}
	
				this.nodos[i].onmouseout=function(){
			this.p_=false;
			this.style.backgroundColor=c_out;
		}
		
		

	
	
	this.nodos[i].onclick=function(){
		
		this.contador=0;
		this.p_="";
		
		
		
			
		while(this.p_!=true){
			if(this.childNodes[this.contador].tagName=="DIV"){
				
				this.p_=true;
				if(this.childNodes[this.contador].style.display=='block'){
					
					this.flecha.style.fontWeight='normal';
					this.flecha.style.backgroundImage="url('imagenes/fl_verde.gif')";
					this.childNodes[this.contador].style.display='none';
					
				}
				else{
					getElementsByClass('invisible',this.parentNode);

				
	
					
					this.childNodes[0].style.backgroundImage="url('imagenes/fl_verde2.gif')";
					this.childNodes[this.contador].style.display='block';
					this.childNodes[0].style.fontWeight='bold';
					this.flecha=this.childNodes[0];
					
					
					
				}
			}
			else{
			this.contador++;
		}
		}}}
}


function ListadoRollover(t,color_over,color_out){
var nodos;
nodos=document.getElementById(t).getElementsByTagName("li");

	for(i=0;i<nodos.length;i++){
	
		
		nodos[i].onmouseover=function(){
			
			this.style.backgroundColor=color_over;
				}
				nodos[i].onmouseout=function(){
			
			this.style.backgroundColor=color_out;
		}
}



}
function TablaRollover(t,color_over,color_out){
var nodos;
nodos=document.getElementById(t).getElementsByTagName("tr");

	for(i=0;i<nodos.length;i++){
	
		
		nodos[i].onmouseover=function(){
			
			this.style.backgroundColor=color_over;
			this.style.cursor="pointer";
				}
				nodos[i].onmouseout=function(){
			
			this.style.backgroundColor=color_out;
		}
}



}
function TablaNameRollover(t,color_over,color_out){
var nodos1;
nodos1=document.getElementsByName(t);

for(x=0;x<nodos1.length;x++){
	nodos=nodos1[x].getElementsByTagName("tr")


	for(i=0;i<nodos.length;i++){
	
		
		nodos[i].onmouseover=function(){
			
			this.style.backgroundColor=color_over;
			this.style.cursor="pointer";
				}
				nodos[i].onmouseout=function(){
			
			this.style.backgroundColor=color_out;
		}
}

}

}

function enviaForm(f){
document.getElementById(f).submit();
}

function buscador(){

	v="Delineante...";
	
	var caja="";

	if(document.getElementById){
		
		caja=document.getElementById("buscador");
		if(caja.value==""){
			caja.style.color='#666666';
		caja.value=v;
		}
	
	}
	
		if(caja.value==""){
			caja.style.color='#666666';
			caja.value=v;
		}
	
	caja.onfocus=function(){
	
		if(caja.value==v){
			caja.value="";
			caja.style.color='#000000';
		}
	
	}

	caja.onblur=function(){
	
		if(caja.value==""){
			caja.style.color='#666666';
			caja.value=v;
	
		}
	
	}
	
}
