function getElementsByClass( searchClass, domNode, tagName) {
	if (domNode == null) domNode = document;
	if (tagName == null) tagName = '*';
	var el = new Array();
	var tags = domNode.getElementsByTagName(tagName);
	var tcl = " "+searchClass+" ";
	for(i=0,j=0; i<tags.length; i++) {
		var test = " " + tags[i].className + " ";
		if (test.indexOf(tcl) != -1)
			el[j++] = tags[i];
	}
	return el;
}

 


function showtab(tabname) 
{

	var tabs = getElementsByClass('content');
	for(i=0; i<tabs.length; i++)
		tabs[i].style.display = 'none';
	// hide every element with class 'content'	
	

	var tabs = getElementsByClass('sidebar2');
	for(i=0; i<tabs.length; i++)
		tabs[i].style.display = 'none';
	// hide every element with class 'sidebar2'
		
	document.getElementById('pajarita').style.display='block'; 
	document.getElementById('seccion').style.display='block'; 
	document.getElementById(tabname).style.display='block';
	// show element with given tabname
}


//---------------------------pop-up----------------------------//


function showpop(tabname) 
{
	// hide every element with class 'content' 
	var tabs = getElementsByClass('content');
	for(i=0; i<tabs.length; i++)
		tabs[i].style.display = 'none';
	// hide every element with class 'content'	
	
	// hide every element with class 'sidebar2' 
	var tabs = getElementsByClass('sidebar2');
	for(i=0; i<tabs.length; i++)
		tabs[i].style.display = 'none';
	// hide every element with class 'sidebar2'
	
	
	document.getElementById('pajarita').style.display='none'; 
	document.getElementById('inicio').style.display='block'; 
	document.getElementById(tabname).style.display='block'; 
	// show element with given tabname
}

//--------------------------- hide pop-up----------------------------//


function hidepop(tabname) 
{
	

	document.getElementById(tabname).style.display='none'; 
	// hide element with given tabname
}

//--------------------------- limpia formulario ----------------------------//

function ClearInput(value, id){ // This calls our function ClearInput, and the two variables we will need for it to function the original value and the id.
var input = document.getElementById(id); // Gets the input field based on its id.

if(value == input.value){ // If the default value is equal to the current value.
input.value = ''; // Empty It.
}else{ // Else the value is not equal to the current input field value.
input.value = input.value; // Leave it the same.
} // End Else.
} // Close Function.

