function hideBoxMain($id,$all){
	try{
		var $elem;
		$elem = document.getElementById($id);
		$elem.style.display = ($elem.style.display == '') ? 'none':'';
	}catch($err){
		$err  = '';	
	}	
}

function hideLoginBox(){
	try{
		var $elem;
		var $menu;
		$elem = document.getElementById('login');
		$menu = document.getElementById('menuGral');
		$elem.style.display = ($elem.style.display == '') ? 'none':'';
		$menu.style.display = ($menu.style.display == '') ? 'none':'';
	}catch($err){
		$err  = '';	
	}	
	
}

function closeBox($id){
	try{
		var $elem;
		$elem = document.getElementById($id);
		$elem.style.display = 'none';
	}catch($err){
		$err  = ''; 
	}	
}
 
function saveBoxes($box){
	try{
		var $xmlHttp;
		$xmlHttp = checkCapabilities();
		$xmlHttp.open("GET",baseURL+"saveBoxes.php?box="+$box,true);
		$xmlHttp.send(null);	 
	}catch(err){
		err = ''; 
	}
}

function showLeftBoxes(){
    var xmlHttp;
   
	xmlHttp = checkCapabilities();
		
	xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState < 4){
			document.getElementById("leftBoxes").innerHTML = $loadingImg;
		} 
		if(xmlHttp.readyState == 4){
			document.getElementById("leftBoxes").innerHTML = xmlHttp.responseText;
			init();
		}
	}
	xmlHttp.open("GET",baseURL+"siteColumnRightLogin2.php",true);   
	
	xmlHttp.send(null);	   
}


function changeFlechita($id,$color){
    var $img     = document.getElementById($id);
	if( $img ){
		var $state   = ( $img.src.search('abierta') > 0 ) ? 'cerrada' : 'abierta';
		$img.src = 'images/flecha/flecha_' + $color + '_' + $state + '.gif'; 
	}
}

