
function pub_add_fav( name, zone, id )
{
	
	stat = document.getElementById("sendStatus");
	stat.style.display = "block";
	
	if( stat.innerHTML.length < 100 ) {
		// Avoid flicker
		stat.innerHTML = "<center><img src='/images/ajax-loader.gif'/><br/><blink>... enviando datos, espera ...</blink></center><br/>";
	}

	var http = getHTTPObject(); 
	http.open("post", "/pub_add_fav", true ); 
	http.onreadystatechange = function() { 
		if (http.readyState == 4) { 
			document.getElementById("sendStatus").innerHTML = http.responseText; 
		} 
	} 

	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send("name=" + escape(name) + "&zone=" + zone + "&pub=" + id );

	return;
}

var lastIndex = 1;

function map_raise( type ) 
{
	layer = document.getElementById( "layer_" + type );
//	layer.style.zIndex = 1;
}

function map_open( type ) 
{
	if( !googlemap_loaded ) return;

	layer = document.getElementById( "layer_" + type );

	if( layer.style.visibility != "visible" ) {

		pt = Math.max( 0, Math.round( document.body.clientHeight/2 ) + document.body.scrollTop - 250 );
		pl = Math.round( document.body.clientWidth/2 ) + document.body.scrollLeft - 250;

		layer.style.top = pt + "px";
		layer.style.left = pl + "px";
		
		layer.style.backgroundColor = "#006CB1";
		layer.style.visibility = "visible";
		layer.style.display = "block";

		map_raise( type );
	} else {
		map_raise( type );
	}
}

function map_close( type )
{
	base = document.getElementById( "layer_" + type );

	if( base.style.visibility != "hidden" ) {
		base.style.visibility = "hidden";
		base.style.display = "none";
	}
}
