//SHOW/HIDE UNIVERSAL 
function showhide(id){
   el = document.getElementById(id);
   el.style.visibility = (el.style.visibility != 'visible')? 'visible' : 'hidden';
}


//SHOW/HIDE CAMPOS DEL FORMULARIO DE #FORM-INSCRIPCION
function showhide_camposEmpresa(id){
	el = document.getElementById(id);
	if (document.getElementById('tipoUso').options[document.getElementById('tipoUso').selectedIndex].value =="Particular") {
		el.style.display = 'none';
	}else{
		el.style.display = 'block';
	}
}

function winopen(url,features)
{	
	window.open(url,'ventana','toolbar=yes,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=640,height=500,left=0,top=0','');
}

//PARA RESALTAR LAS FILAS DE LA TABLA AL HACER MOUSEOVER, 02.html, 13.html
//http://www.webdeveloper.com/forum/archive/index.php/t-17045.html
//http://www.zigma.host.sk/test.html
function highlight_on (thisobj,color)
{
	thisobj.style.backgroundColor= color;
}

function highlight_off (thisobj,color)
{
	thisobj.style.backgroundColor= color;
}

window.onload = function()
{
	var all_tables = document.getElementsByTagName("table");
	for (var i = 0; i < all_tables.length; i++) {
		if (all_tables[i].className == "listadoEmpresas"){
			init_table_list (all_tables[i]);
		}
	}
}

function init_table_list (tableid) {
	//var tb = document.getElementById(tableid);
	var tbid = tableid.getElementsByTagName("tr");
	//for (var i in tbid) {
	for (var i = 0; i < tbid.length; i++) {
		tbid[i].onmouseover = function() {highlight_on(this,'#FFE3BB')}
		tbid[i].onmouseout = function() {highlight_off(this,'')}
	}
} 

/*//ANALYTICS
if ( typeof gaJsHost == 'undefined' ){ 
	var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
	document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
	document.write(unescape('%3Cscript type="text/javascript"%3E try{var pageTracker = _gat._getTracker("UA-153659-14");pageTracker._trackPageview();} catch(err) {}%3C/script%3E'));
}*/
