var win = null;

function abrirPopup(url, w, h){
//	if (win != null && win.open) win.close();
	win=window.open(url,'popup','toolbar=0,location=0,status=0,menubar=0,resizable=yes,scrollbars=yes,width='+w+',height='+h);
	if(window.focus) win.focus();
}

function verGeoRef(getVars){
	var geoh = 650;
	var geow = 764;

	if (win != null && win.open) win.close();
	url="loc_map.asp?"+getVars+"&lingua=0";
	win=window.open(url,'popup','toolbar=0,location=0,status=0,menubar=0,resizable=no,width='+geow+',height='+geoh+'');
	if(window.focus) win.focus();
}


function gotFocus(elem, text){
	if(elem.value == text) elem.value = ''
}

function lostFocus(elem, text){
	if(elem.value == '') elem.value = text
}

function limpaEstilos(frm, classe){
	for(var i = 0; i < frm.length; i++){
//		alert(frm.elements[i].name + "|" +frm.elements[i].type);
		if(frm.elements[i].type == "text" || frm.elements[i].type == "select-one" || frm.elements[i].type == "textarea")
    		frm.elements[i].className = classe
	}
}

function getElementsByClassName(clsName) { 
	var arr = new Array(); 
	var elems = document.getElementsByTagName("*");
	for ( var cls, i = 0; ( elem = elems[i] ); i++ ) {
		if (elem.className.search(clsName) != -1)
	arr[arr.length] = elem;
	}
	return arr;
}
