
var RUTA = "http://www.fondemi.gob.ve/";
//var RUTA = "http://localhost/PropuestaWeb/";
var r = screen.width;
var w, h;

		if (navigator.appName == "Netscape")
		{	
			
		}else{
			   if(navigator.appName.indexOf("Explorer") != -1) 
			   {
					if(r == 1280)
					{
						w = 20; h = 60;
					}else{
							if(r == 1024)
							{
								w = 20; h = 60;
							}else{
									if(r == 800)
									{
									  w = 20; h = 60;
									}
								 }
						 }
			   }
			 }
		 
function ff(fuenteDatos, divID,tope, margen)
{
	var xmlHttp=null;
	if (window.ActiveXObject)
	{
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
 	 else 
		if (window.XMLHttpRequest)
		{ 
	 		xmlHttp = new XMLHttpRequest();
		}	
	if(xmlHttp)
	{
   	var obj = document.getElementById(divID);
	obj.style.top = tope;
	obj.style.left = margen;
	llamar = RUTA+fuenteDatos;
	//llamar = fuenteDatos;
   	xmlHttp.open("POST", llamar,true);
  	xmlHttp.onreadystatechange = function(){
  										  					if (xmlHttp.readyState == 4)
															{
        														obj.innerHTML = xmlHttp.responseText;
           												}
             										}
  	xmlHttp.send(null);
  }
}

function ffDos(fuenteDatos, divID)
{
	var tope = w;
	var margen = h;
	var xmlHttp=null;
	if (window.ActiveXObject)
	{
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
 	 else 
			if (window.XMLHttpRequest)
			{ 
	 			xmlHttp = new XMLHttpRequest();
			}	
	if(xmlHttp)
	{
   	var obj = document.getElementById(divID);
	obj.style.top = tope;
	obj.style.left = margen;
	llamar = RUTA+fuenteDatos;
	//llamar = fuenteDatos;
   	xmlHttp.open("POST", llamar,true);
  	xmlHttp.onreadystatechange = function(){
  										  					if (xmlHttp.readyState == 4)
															{
        														obj.innerHTML = xmlHttp.responseText;
           												}
             										}
  	xmlHttp.send(null);
    }
}

function pedirDatosUno(fuenteDatos, divID)
{
	var xmlHttp=null;
	if (window.ActiveXObject)
	{
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
 	 else 
			if (window.XMLHttpRequest)
			{ 
	 			xmlHttp = new XMLHttpRequest();
			}	
	if(xmlHttp)
	{
   	var obj = document.getElementById(divID);
	llamar = RUTA+fuenteDatos;
	//llamar = fuenteDatos;
   	xmlHttp.open("POST", llamar,true);
  	xmlHttp.onreadystatechange = function(){
  										  		if (xmlHttp.readyState == 4)
												{
        											obj.innerHTML = xmlHttp.responseText;
           										}
             							   }
  	xmlHttp.send(null);
  }
  
}

function pedirDatosDos(fuenteDatos1, divID1, fuenteDatos2, divID2)
{	
	if (navigator.appName == "Netscape" && fuenteDatos2 == "contactenos.html")
	{	
		fuenteDatos2 = "contactenos.html"
	}
	var xmlHttp1=null;
	var xmlHttp2=null;
	if (window.ActiveXObject)
	{//alert("explorer");
		xmlHttp1 = new ActiveXObject("Microsoft.XMLHTTP");
		xmlHttp2 = new ActiveXObject("Microsoft.XMLHTTP");
	}
 	 else 
			if (window.XMLHttpRequest)
			{ //alert();
	 			xmlHttp1 = new XMLHttpRequest();
				xmlHttp2 = new XMLHttpRequest();
			}	
	if(xmlHttp1)
	{   	
  		
		var objCarga = document.getElementById("cargando");
   		var obj1 = document.getElementById(divID1);
		llamar1 = RUTA+fuenteDatos1;
		//llamar1 = fuenteDatos1;
   		xmlHttp1.open("POST", llamar1,true);
  		xmlHttp1.onreadystatechange = function(){ var paso = false;
  										  						if (xmlHttp1.readyState == 4)
																{
																	objCarga.innerHTML = " ";             												
                 													obj1.innerHTML = xmlHttp1.responseText;
																}
																 else		 	
																	if(xmlHttp1.readyState < 4)
																			objCarga.innerHTML = "Cargando...";
             								   	}
  		xmlHttp1.send(null);
	}
	if(xmlHttp2)
	{
		   	
   	var obj2 = document.getElementById(divID2);
	llamar2 = RUTA+fuenteDatos2;
	//llamar2 = fuenteDatos2;
   	xmlHttp2.open("POST", llamar2,true);
  		xmlHttp2.onreadystatechange = function(){
  										  						if (xmlHttp2.readyState == 4)
																{
                 												obj2.innerHTML = xmlHttp2.responseText;
                											}
             								   		}
  	xmlHttp2.send(null);
	}
}
/*
function pedirDatosDos(fuenteDatos1, divID1, fuenteDatos2, divID2)
{	
	if (navigator.appName == "Netscape" && fuenteDatos2 == "contactenos.html")
	{	
		fuenteDatos2 = "contactenos_2.html"
	}
	var xmlHttp1=null;
	var xmlHttp2=null;
	var xmlHttp3=null;
	var xmlHttp4=null;
	if (window.ActiveXObject)
	{//alert("explorer");
		xmlHttp1 = new ActiveXObject("Microsoft.XMLHTTP");
		xmlHttp2 = new ActiveXObject("Microsoft.XMLHTTP");
		xmlHttp3 = new ActiveXObject("Microsoft.XMLHTTP");
		xmlHttp4 = new ActiveXObject("Microsoft.XMLHTTP");
	}
 	 else 
			if (window.XMLHttpRequest)
			{ //alert();
	 			xmlHttp1 = new XMLHttpRequest();
				xmlHttp2 = new XMLHttpRequest();
				xmlHttp3 = new XMLHttpRequest();
				xmlHttp4 = new XMLHttpRequest();
			}	
	if(xmlHttp1)
	{   	
  		
		var objCarga = document.getElementById("cargando");
   		var obj1 = document.getElementById(divID1);
		llamar1 = RUTA+fuenteDatos1;
		//llamar1 = fuenteDatos1;
   		xmlHttp1.open("POST", llamar1,true);
  		xmlHttp1.onreadystatechange = function(){ var paso = false;
  										  						if (xmlHttp1.readyState == 4)
																{
																	objCarga.innerHTML = " ";             												
                 													obj1.innerHTML = xmlHttp1.responseText;
																}
																 else		 	
																	if(xmlHttp1.readyState < 4)
																			objCarga.innerHTML = "Cargando...";
             								   	}
  		xmlHttp1.send(null);
	}
	if(xmlHttp2)
	{
		   	
   	var obj2 = document.getElementById(divID2);
	llamar2 = RUTA+fuenteDatos2;
	//llamar2 = fuenteDatos2;
   	xmlHttp2.open("POST", llamar2,true);
  		xmlHttp2.onreadystatechange = function(){
  										  						if (xmlHttp2.readyState == 4)
																{
                 												obj2.innerHTML = xmlHttp2.responseText;
                											}
             								   		}
  	xmlHttp2.send(null);
	}
	
	if(xmlHttp1)
	{   	
  		
		var objCarga = document.getElementById("cargando");
   		var obj1 = document.getElementById(divID1);
		llamar1 = RUTA+fuenteDatos1;
		//llamar1 = fuenteDatos1;
   		xmlHttp1.open("POST", llamar1,true);
  		xmlHttp1.onreadystatechange = function(){ var paso = false;
  										  						if (xmlHttp1.readyState == 4)
																{
																	objCarga.innerHTML = " ";             												
                 													obj1.innerHTML = xmlHttp1.responseText;
																}
																 else		 	
																	if(xmlHttp1.readyState < 4)
																			objCarga.innerHTML = "Cargando...";
             								   	}
  		xmlHttp1.send(null);
	}
	
	if(xmlHttp1)
	{   	
  		
		var objCarga = document.getElementById("cargando");
   		var obj1 = document.getElementById(divID1);
		llamar1 = RUTA+fuenteDatos1;
		//llamar1 = fuenteDatos1;
   		xmlHttp1.open("POST", llamar1,true);
  		xmlHttp1.onreadystatechange = function(){ var paso = false;
  										  						if (xmlHttp1.readyState == 4)
																{
																	objCarga.innerHTML = " ";             												
                 													obj1.innerHTML = xmlHttp1.responseText;
																}
																 else		 	
																	if(xmlHttp1.readyState < 4)
																			objCarga.innerHTML = "Cargando...";
             								   	}
  		xmlHttp1.send(null);
	}
}
*/
function mostrar(f)
{
	var img = f.estado.options[f.estado.selectedIndex].id;
	//alert(img);
	if(f==null)
		alert("f es nulo");
	else	
	if (f.estado.selectedIndex != 0)
	{
		ff(f.estado.options[f.estado.selectedIndex].value, 'contacto',w,h);
		(img == '1') ? mapa('imagen1','images/mapas/amazonas.png') : n = 0;
		(img == '2') ? mapa('imagen1','images/mapas/anzoategui.png') : n = 0;
		(img == '3') ? mapa('imagen1','images/mapas/apure.png') : n = 0;
		(img == '4') ? mapa('imagen1','images/mapas/aragua.png') : n = 0;
		(img == '5') ? mapa('imagen1','images/mapas/barinas.png') : n = 0;
		(img == '6') ? mapa('imagen1','images/mapas/bolivar.png') : n = 0;
		(img == '7') ? mapa('imagen1','images/mapas/carabobo.png') : n = 0;
		(img == '8') ? mapa('imagen1','images/mapas/cojedes.png') : n = 0;
		(img == '9') ? mapa('imagen1','images/mapas/delta.png') : n = 0;
		(img == '10') ? mapa('imagen1','images/mapas/dtto_capital.png') : n = 0;
		(img == '11') ? mapa('imagen1','images/mapas/falcon.png') : n = 0;
		(img == '12') ? mapa('imagen1','images/mapas/guarico.png') : n = 0;
		(img == '13') ? mapa('imagen1','images/mapas/lara.png') : n = 0;
		(img == '14') ? mapa('imagen1','images/mapas/merida.png') : n = 0;
		(img == '15') ? mapa('imagen1','images/mapas/miranda.png') : n = 0;
		(img == '16') ? mapa('imagen1','images/mapas/monagas.png') : n = 0;
		(img == '17') ? mapa('imagen1','images/mapas/nueva_esparta.png') : n = 0;
		(img == '18') ? mapa('imagen1','images/mapas/portuguesa.png') : n = 0;
		(img == '19') ? mapa('imagen1','images/mapas/sucre.png') : n = 0;
		(img == '20') ? mapa('imagen1','images/mapas/tachira.png') : n = 0;
		(img == '21') ? mapa('imagen1','images/mapas/trujillo.png') : n = 0;
		(img == '22') ? mapa('imagen1','images/mapas/vargas.png') : n = 0;
		(img == '23') ? mapa('imagen1','images/mapas/yaracuy.png') : n = 0;
		(img == '24') ? mapa('imagen1','images/mapas/zulia.png') : n = 0; 
	}
}

function mapa(nombreCapa,area)
	{ 
		a = document.getElementById(nombreCapa); 
		a.src=area;
	} 
function MM_swapImgRestore()
{
  var i,x,a=document.MM_sr; 
	for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
		x.src=x.oSrc;
}

function MM_preloadImages()
{
  var d=document; 
	if(d.images)
	{ 
		if(!d.MM_p) 
			d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; 
		for(i=0; i<a.length; i++)
    	if (a[i].indexOf("#")!=0)
			{ 
				d.MM_p[j]=new Image; 
				d.MM_p[j++].src=a[i];
			}
	}
}

function MM_findObj(n, d) 
{
  var p,i,x;  
	if(!d) 
		d=document; 
	if((p=n.indexOf("?"))>0&&parent.frames.length) 
	{
    	d=parent.frames[n.substring(p+1)].document; 
		n=n.substring(0,p);
	}
  if(!(x=d[n])&&d.all) 
		x=d.all[n]; 
	for (i=0;!x&&i<d.forms.length;i++) 
		x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) 
		x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) 
		x=d.getElementById(n); 
	return x;
}

function MM_swapImage() 
{
	var i,j=0,x,a=MM_swapImage.arguments; 
	document.MM_sr=new Array; 
	for(i=0;i<(a.length-2);i+=3)
		if ((x=MM_findObj(a[i]))!=null)
		{
			document.MM_sr[j++]=x; 
			if(!x.oSrc) 
				x.oSrc=x.src; 
				x.src=a[i+2];
		}
}

function insertarFila(tabla, boton, fila, texto) 
{
	var elmTBODY = document.getElementById(tabla);
 	var elmTR, elmTD, elmText;
 	elmTR = document.createElement('tr');
	boton.id = (boton.id == "Detalles") ? "Cerrar" : "Detalles";
    elmTD = document.createElement('td');
    elmText = document.createTextNode(texto);
    elmTD.appendChild(elmText);
    elmTR.appendChild(elmTD);
    elmTBODY.insertBefore(elmTR,elmTBODY.childNodes[fila])
}

function eliminarFila(tabla, boton, fila) 
{
 	var elmTBODY = document.getElementById(tabla);
 	elmTBODY.removeChild(elmTBODY.childNodes[fila]);
	boton.id = (boton.id == "Detalles") ? "Cerrar" : "Detalles";
}
function modificarCapa(tabla, boton, fila, texto)
{
	(boton.id == "Detalles") ? insertarFila(tabla, boton, fila, texto) : eliminarFila(tabla, boton, fila);
}
	
	
	/*------------------------------------------------
	| función para llamar a las marquesinas enlaces  |
	| 		--------------		--------------		 |
	-------------------------------------------------*/

	
function marquesina(links, capa)
{
	var xmlHttp=null;
	if (window.XMLHttpRequest)
	{
		xmlHttp = new XMLHttpRequest();
	}
 	 else 
			if (window.ActiveXObject)
			{ 
				xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			}	
	if(xmlHttp)
	{
   	 var obj = document.getElementById(capa);
	 llamar = RUTA+links;
	 //llamar = links;
   	 xmlHttp.open("POST", llamar,true);
  	 xmlHttp.onreadystatechange = function(){
												if (xmlHttp.readyState == 4)
												{
													obj.innerHTML = xmlHttp.responseText;
												}
    										}
  	xmlHttp.send(null);
  }
}

	/*---------------------------------------------------
	| funcion para abrir las fotos de la galeria
	----------------------------------------------------*/
	
function abreFoto(ruta)
{
   i1 = new Image;
   i1.src = ruta;
   html = '<html><head><title>Imagen</title></head>';
   html += '<body leftmargin=0 marginwidth=0 topmargin=0 marginheight=0>';
   html += '<center><img src="'+ruta+'" border=0 name="Foto" ';
   html += 'onLoad="window.resizeTo(document.Foto.width,document.Foto.height)">';
   html += '</center></body></html>';
   popupImage = window.open('','','toolbar=no, location=0, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, top=100, left=100');
   popupImage.document.open();
   popupImage.document.write(html);
   popupImage.document.close();
}

function clickImage(imagen)
{
		if(imagen == 'mapaSitio')
		{
			window.open(imagen+'.html','','toolbar=no,location=no,directories=no,status=no,			menubar=no,scrollbars=yes,resizable=no,width=550,height=800,top=100,left=100');
		}else{
				window.open(imagen+'.html','','toolbar=no,location=no,directories=no,status=no,			menubar=no,scrollbars=yes,resizable=no,width=400,height=478,top=0,left=0');
		     }
}