function find_html(html_name) {
 var elem = null; if( document.getElementById ) {
 // this is the way the standards work 
 elem = document.getElementById(html_name);
 } else if (document.all) { // this is the way old msie versions work
 elem = document.all[html_name];
 } else if(document.layers) {
 // this is the way nn4 works
 elem = document.layers[html_name];
 }
 return elem;
}

function show_html(html_name) {
 var html = find_html(html_name);
 if (html) {
 html.style.display = '';
 }
}

function hide_html(html_name) {
 var html = find_html(html_name);
 if (html) {
 html.style.display = 'none';
 }
}

function activa(html_name) {

 var html = find_html(html_name);
 if (html) {

 html.className = 'activa';
 }
}
function desactiva(html_name) {
 var html = find_html(html_name);
 if (html) {
 
 html.className = 'none';
 }
}
function tab(html1,html2,html3,html4)
{
hide_html(html2);
show_html(html1);
activa(html3);
desactiva(html4);
}


function width_star(html_name,cosica) {
 var html = find_html(html_name);
 if (html) {
 html.style.width = cosica+'%';
 }
}

function set_top(html_name,equis)
{
	var html = find_html(html_name);
 	if (html) {
 	html.style.top = equis+'px';
 	}
	
}

function set_left(html_name,equis)
{
	var html = find_html(html_name);
 	if (html) {
 	html.style.left = equis+'px';
 	}
	
}

function findPosX(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
do {
			curleft += obj.offsetLeft;
			
	} while (obj = obj.offsetParent);
	}
	return curleft;
}

function findPosY(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
do {
			
			curtop += obj.offsetTop;
	} while (obj = obj.offsetParent);
	}
	return curtop;
}

function error(status){
alert('Error:'+status);
}


function tuitpref(obj)
{
	
	
	offsetx=(940/2)-(164/2);
	offsety=(142/2)-(44/2);
	tipo_txt='';
	viva=find_html('tuespacio');
	set_top('actualizando',findPosY(viva)+offsety);
	set_left('actualizando',findPosX(viva)+offsetx);
	show_html('actualizando');


jx.load('/ajax/tuitpref.php?valor='+obj.checked,function(data){
hide_html('actualizando');

},'text','post');
	
	
	
}
