
function ChangeImg(object,normalImg){
	object.src = normalImg;
}

function ToggleDiv(obj,img){
	try{
		if(obj.style.visibility == "hidden"){
			obj.style.visibility ="visible";
			obj.style.position = "static";
			img.src = "../imagen/menos.gif";
		}else{
			obj.style.visibility ="hidden";
			obj.style.position = "absolute";
			img.src = "../imagen/mas.gif";	
		}
	}catch(e){
	}
}

function ToggleDiv(obj){
	try{

		if(obj.style.visibility == "hidden"){
			obj.style.visibility ="visible";
			obj.style.position = "static";
		}else{
			obj.style.visibility ="hidden";
			obj.style.position = "absolute";
		}
	}catch(e){
	}
}

function SetVisibleDiv(obj){
    childs = obj.childNodes;
    for(i = 0; i < childs.length;i++){
        if(childs[i].tagName == 'DIV'){
            if(childs[i].getAttribute("setVisible") != null){
                if(childs[i].style.visibility ="visible"){
                    childs[i].style.visibility ="visible";
                    childs[i].style.position = "static";
                    childs[i].removeAttribute("setVisible");
                }
            }
        }
    }
    obj.style.visibility ="visible";
	obj.style.position = "static";
}

function SetHiddenDiv(obj){
    childs = obj.childNodes;
    for(i = 0; i < childs.length;i++){
        if(childs[i].tagName == 'DIV'){
            if(childs[i].style.visibility == "visible"){
                childs[i].style.visibility ="hidden";
                childs[i].style.position = "absolute";
                childs[i].setAttribute("setVisible","1");
            }
        }
    }
    obj.removeAttribute("setVisible");
	obj.style.visibility ="hidden";
	obj.style.position = "absolute";
}

function FillObject(obj,Values){
	NewOption = new Option("[SELECCIONE EL TRAMITE]", "-1","","");
	
	for(i = 0;i <= obj.options.length;i++){ obj.options.remove(0);}
	NewOption = new Option("[SELECCIONE EL TRAMITE]", "-1","","");
	NewOption.setAttribute("message",'SELECCIONE EL TRAMITE QUE VA A REALIZAR');
	obj.options[0] = NewOption;		
	for(i = 1;i <= Values.length;i++){
	    arrValues = Values[i-1].split("|");
		NewOption = new Option(arrValues[1], arrValues[0],"","");
		NewOption.setAttribute("message",arrValues[2]);
		obj.options[i] = NewOption;
	}
}

function DisplayMsg(obj,lbl){
    try{
        if(obj.options[obj.selectedIndex].getAttribute("message") == null)
            lbl.value = "";
        else
            lbl.value = obj.options[obj.selectedIndex].getAttribute("message");
    }catch(e){}
}
