/* Scripts generales */
function mOvr(src,clrOver) {
//	src.style.cursor = 'pointer';
	src.bgColor = clrOver;
}

function mOut(src,clrIn) {
//	src.style.cursor = 'default';
	src.bgColor = clrIn;
}

function mClk(src) {
	src.children.tags('A')[0].click();
}

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) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}

function select_all(check) {
	formulario=check.form;
	for (i=0; i < formulario.elements.length; i++)
		if(formulario.elements[i].type == "checkbox")
			formulario.elements[i].checked=check.checked;
}

function show_hide(elemID, textElem) {
	elem = document.getElementById(elemID);
	if(elem.style.display == 'none') {
		elem.style.display = 'block';
		textElem.innerHTML = 'ocultar';
	} else {
		elem.style.display = 'none';
		textElem.innerHTML = 'ver';
	}
}

function loadPopup(){
	var popupHeight=document.getElementById("popup").offsetHeight + 80;
	var popupWidth=document.getElementById("popup_width").offsetWidth + 50;
	if(popupWidth == 0){
		if( typeof( window.innerWidth ) == 'number' ) {
			//Non-IE
			popupWidth = window.innerWidth;
		} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			//IE 6+ in 'standards compliant mode'
			popupWidth = document.documentElement.clientWidth;
		} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			//IE 4 compatible
			popupWidth = document.body.clientWidth;
		}
        popupWidth=popupWidth - 26;
	}
    window.resizeTo(popupWidth-26,popupHeight);
}

