	function muestradivMapa(divNameMain,divMapa,idSubSeccion)
{
	if(document.getElementById(divNameMain).style.display=='none')
		{
		document.getElementById(divNameMain).style.display='';
		showGoogleMaps(divMapa,idSubSeccion);	
		}
	else document.getElementById(divNameMain).style.display='none';
	
	

}





function showGoogleMaps(divDestino, idSubSeccion){
	latitud=41.126816;
	longitud=1.243459;
	zoom=16;
	text="kkk";




      if (GBrowserIsCompatible()) {

		var map = new GMap2(document.getElementById(divDestino));

	

		//map.setCenter(new GLatLng(latitud, longitud), zoom);
		//if(text!="-1")map.openInfoWindow(map.getCenter(),text);		
		map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());	
		map.setMapType(G_HYBRID_MAP);

		function addtag(point, address) 
			{        
			var marker = new GMarker(point);        
			GEvent.addListener(marker, "click", function() {	marker.openInfoWindowHtml(address); } );        
			return marker;        
			}
			

		var point2 = new GLatLng( 41.115291,1.252153);
		var address = llamadaAJAX2("cargaMapa.asp?id="+idSubSeccion);
		var marker = addtag(point2, address);   	
		map.openInfoWindow(point2, address);
		map.addOverlay(marker);		

		

		
		var polyline = new GPolyline([  
			new GLatLng(41.126816,1.243459),  
			new GLatLng(41.116737,1.271313),  			
			new GLatLng(41.102439,1.262142),  
			new GLatLng(41.112557,1.234339),
			new GLatLng(41.126816,1.243459)], "#ff0000", 5);
		map.addOverlay(polyline);	
		
		
		map.setCenter(new GLatLng( 41.115291,1.252153), 14);

}
	

	
}


function InsertaFlash(id,nombre,ancho,alto,alineado,bgcolor,aleatorio){

	var r;
	if(aleatorio==1) r=Math.round(Math.random() * 99999);
	else r=0;
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+ancho+'" height="'+alto+'" id="'+id+'" align="'+alineado+'"') 
	document.write('<param name="allowScriptAccess" value="sameDomain"/>') 
	document.write('<param name="movie" value="'+nombre+'?r='+r+'"/>')
	document.write('<param name="quality" value="high">')
	document.write('<param name="scale" value="exactfit">')
	
if(bgcolor==-1) {
	document.write('<param name="wmode" value="transparent" />')
	document.write('<param name="bgcolor" value="#000000" />')
	}
else{
	document.write('<param name="bgcolor" value="'+bgcolor+'">')
	}
	
	document.write('<embed src="'+nombre+'?r='+r+'" quality="high" bgcolor="'+bgcolor+'" width="'+ancho+'" height="'+alto+'" name="'+id+'" align="'+alineado+'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />') 	
	document.write('</object>') 

}



 var win=null;
function NewWindow(myphoto,myname,w,h,pos,infocus)
	{
	if(pos=="center")
		{
		myleft=(screen.width)?(screen.width-w)/2:100;
		mytop=(screen.height)?(screen.height-h)/2:100;
		}
	else if((pos!='center' && pos!="random") || pos==null)
		{
		myleft=0;mytop=20
		}
		
	settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes";

	var features;
	features+="location=no,"
	features+="toolbar=no,"
	features+="directories=no,"
	features+="menubar=no,"
	features+="scrollbars=no,"
	features+="menubar=no,"
	features+="resizable=no,"
	features+="fullscreen=0,"
	features+="status=yes,"
	features+="channelmode=0,"
	features+="width="+w+","
	features+="height="+h+","
	features+="top="+mytop+","
	features+="left="+myleft+","
	features+="topmargin=0;"

	win=window.open("","",features);
	win.document.write("<html><head><title>"+myname+"</title></head>");
	win.document.write("<body topmargin=0 leftmargin=0>");
	win.document.write("<img src='" + myphoto + "'></html>");
	win.focus();

	}


	

var highlightbehavior="TD"
var ns6=document.getElementById&&!document.all
var ie=document.all

function changeto(e,highlightcolor)
	{
	source=ie? event.srcElement : e.target
	if (source.tagName=="TABLE")
	return
	while(source.tagName!=highlightbehavior && source.tagName!="HTML")
		source=ns6? source.parentNode : source.parentElement
	if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore")
		source.style.backgroundColor=highlightcolor
	}

function contains_ns6(master, slave) { 
	while (slave.parentNode)
	if ((slave = slave.parentNode) == master)
		return true;
	return false;
}

function changeback(e,originalcolor){
if (ie&&(event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore")||source.tagName=="TABLE")
return
else if (ns6&&(contains_ns6(source, e.relatedTarget)||source.id=="ignore"))
return
if (ie&&event.toElement!=source||ns6&&e.relatedTarget!=source)
source.style.backgroundColor=originalcolor
}
	
