// JavaScript Document
// JavaScript Document

function makeImage(nombre){
	
		var fDiv = document.createElement("div");
		
		var fId = document.createAttribute("id");
		fId.nodeValue = "fly";
		fDiv.setAttributeNode(fId);
		
		var hh = document.createElement("h2");
		hh.innerHTML = nombre[0];
		fDiv.appendChild(hh);
		
		var a = document.createElement("a");
		a.innerHTML = "X";
		var hRef = document.createAttribute("href");
		hRef.nodeValue = "javascript:closeWindow()";
		a.setAttributeNode(hRef);
		
		
		fDiv.appendChild(a);
		
		var hhh = document.createElement("h4");
		hhh.innerHTML = nombre[1];

		fDiv.appendChild(hhh);
		
		var img = document.createElement("img");
		
		var imgSrc = document.createAttribute("src");
		imgSrc.nodeValue = nombre[2];
		
		var imgW = document.createAttribute("width");
		imgW.nodeValue = "145";
		
		var imgH = document.createAttribute("height");
		imgH.nodeValue = "80";
		
		img.setAttributeNode(imgSrc);
		img.setAttributeNode(imgW);
		img.setAttributeNode(imgH);
		
		fDiv.appendChild(img);
		
		var p = document.createElement("p");
		
		var ap = document.createElement("a");
		ap.innerHTML = "Web: "+nombre[3];
		
		var hRefap = document.createAttribute("href");
		hRefap.nodeValue = "http://"+nombre[3];
		var targ = document.createAttribute("target");
		targ.nodeValue = "_blank";
		
		ap.setAttributeNode(hRefap);
		ap.setAttributeNode(targ);
		
		p.appendChild(ap);
		
		fDiv.appendChild(p);
		
		var pp = document.createElement("p");
		pp.innerHTML = "Mail: "+nombre[4];
		fDiv.appendChild(pp);
		
		var ppp = document.createElement("p");
		ppp.innerHTML = "Sucursales: "+nombre[5];
		fDiv.appendChild(ppp);
		
		var pppp = document.createElement("p");
		pppp.innerHTML = "Tel: "+nombre[6];
		fDiv.appendChild(pppp);
		
		var ppppp = document.createElement("p");
		ppppp.innerHTML = "Bases y condiciones: "+nombre[7];
		fDiv.appendChild(ppppp);
		
		//estilos
		fDiv.style.backgroundColor = "#FFFFFF";
		fDiv.style.width = "360px";
		fDiv.style.height = "480px";
		fDiv.style.border = "thin solid #BABABA";
		fDiv.style.color = "#444444";
		fDiv.style.zIndex = "100000";
		fDiv.style.position = "absolute";
		fDiv.style.top = "50%";
		fDiv.style.bottom = "50%";		
		fDiv.style.left = "30%";
		
		a.style.color = ap.style.color = "#444444";
		a.style.font = "bold 12px Verdana, Arial, Helvetica, sans-serif";
		a.style.position = "absolute";
		a.style.top = "15px";
		a.style.left = "335px";
		a.style.display = "block";
		
		img.style.margin = "10px 0px 0px 20px";
		
		hh.style.font = "bold 12px Verdana, Arial, Helvetica, sans-serif";
		hh.style.margin = "0px 0px 0px 20px";
		hh.style.paddingTop = "15px";
		
		hhh.style.font = "bold 10px Verdana, Arial, Helvetica, sans-serif";
		hhh.style.margin = "0px 0px 0px 20px";
		
		p.style.font = pp.style.font = ppp.style.font = pppp.style.font = ppppp.style.font = "normal 10px Verdana, Arial, Helvetica, sans-serif";
		p.style.textAlign = pp.style.textAlign = ppp.style.textAlign = ppp.style.textAlign = "left";
		p.style.paddingTop = "3px";
		p.style.margin = pp.style.margin = ppp.style.margin = pppp.style.margin = ppppp.style.margin = "0px 0px 0px 20px";
		p.style.width = pp.style.width = ppp.style.width = pppp.style.width = ppppp.style.width = "320px";
		p.style.paddingTop = pp.style.paddingTop = ppp.style.paddingTop = pppp.style.paddingTop = ppppp.style.paddingTop = "5px";
		
		var ubicacion =  document.getElementById("central");
		ubicacion.appendChild(fDiv);

		}
		
function closeWindow(){
			var ubicacion = document.getElementById("central");
			var ubicacion2 = document.getElementById("fly");
			ubicacion.removeChild(ubicacion2);
			}							
