// JavaScript Document
function exportaExcelPR(){
	switch (document.getElementById("selTipo2").value){
		 case "DG" : var tblListaMateriales = document.getElementById("ListaMaterialesDG");
					//alert(tblListaMateriales.rows.length);
					var vLong = document.getElementById("pLongDG");
					var vAlt = document.getElementById("pAlturaDG");
					var vPue = document.getElementById("pPuertasDG");
					var vVen = document.getElementById("pVentanasDG");
		            break;
		 case "PB" : var tblListaMateriales = document.getElementById("ListaMaterialesPB");
					//alert(tblListaMateriales.rows.length);
					var vLong = document.getElementById("pLongPB");
					var vAlt = document.getElementById("pAlturaPB");
					var vPue = document.getElementById("pPuertasPB");
					var vVen = document.getElementById("pVentanasPB");
					break;		
		default :  exit();
		            break; 		
	}

    var vTipo = document.getElementById("hidTipoCalculo");
	var vslash= /\\/gi;
	var path = window.location.pathname.split("html\\")[0].replace(vslash,"\\\\")+"imagenes\\\\";
	var Excel, Book;	
	var vRen =0;
	path = unescape(path.replace(/\+/g,  " "));
	
	// Create the Excel application object.
	Excel = new ActiveXObject("Excel.Application");	
	// Make Excel visible.
	Excel.Visible = true;	
	// Create a new work book.
	Book = Excel.Workbooks.Add();
	//Named
	Book.ActiveSheet.Name = "Lista Materiales";
	// Place some text in the first cell of the sheet.
	//Book.ActiveSheet.Cells(1,1).Value = tblListaMateriales.innerHTML;
	
	//ancho columna
	Book.ActiveSheet.Columns("B:B").ColumnWidth = 10;
	Book.ActiveSheet.Columns("C:C").ColumnWidth = 3;
	Book.ActiveSheet.Columns("E:E").ColumnWidth = 3;
	
	//inserto logo
	Book.ActiveSheet.Range("D1").Select;
	Book.ActiveSheet.Pictures.Insert(path+"logoPR.jpg");
	
	//inserto titulo de resultados
	Book.ActiveSheet.Range("A4").Select;
	Book.ActiveSheet.Pictures.Insert(path+getImgTitulo(vTipo.value));
	
	//seleccion para formato letra
	Book.ActiveSheet.Range("A7:G11").Select;
    Book.ActiveSheet.Range("A7:G11").Font.ColorIndex = 16;
	Book.ActiveSheet.Range("A7:G11").Font.Name="Verdana";
	Book.ActiveSheet.Range("A7:G11").Font.Size="8";
	
	Book.ActiveSheet.Range("B7:B11").HorizontalAlignment = -4152;
	Book.ActiveSheet.Range("B7:B11").VerticalAlignment = -4107;
	
	
	//pongo Datos
	if (vTipo.value=="PR"){
		Book.ActiveSheet.Cells(7,2).Value = "Tipo :";
		if(document.getElementById("selTipo2").value=="DG"){
				Book.ActiveSheet.Cells(7,4).Value = document.getElementById("pTipoPanelDG").innerText;
				nomImagen = "infoplafonr61-61.png";
		}else{
			    Book.ActiveSheet.Cells(7,4).Value = document.getElementById("pTipoPanelPB").innerText;
				nomImagen = "infoplafonr61-122.png";
		}		
	}
	
	Book.ActiveSheet.Cells(8,2).Value = "Longuitud :";
	Book.ActiveSheet.Cells(8,4).Value = vLong.innerText;
	Book.ActiveSheet.Cells(8,5).Value = "m";
	
	Book.ActiveSheet.Cells(9,2).Value = "Ancho :";
	Book.ActiveSheet.Cells(9,4).Value = vAlt.innerText;
	Book.ActiveSheet.Cells(9,5).Value = "m";
	
	//inserto imagen
	Book.ActiveSheet.Range("A11").Select;
	Book.ActiveSheet.Pictures.Insert(path+nomImagen);
	
	//pongo imagen resultados
	Book.ActiveSheet.Range("A22").Select;
	Book.ActiveSheet.Pictures.Insert(path+"tres.gif");
	
    //Renglones
	
		Book.ActiveSheet.Range("A25:D25").Select;
		Book.ActiveSheet.Range("A25:D50").HorizontalAlignment = -4131;
		Book.ActiveSheet.Range("A25:D50").VerticalAlignment = -4107;
		Book.ActiveSheet.Range("A25:D50").WrapText = "True";
		Book.ActiveSheet.Range("A25:D50").Orientation = 0;
		Book.ActiveSheet.Range("A25:D50").AddIndent = "False";
		Book.ActiveSheet.Range("A25:D50").ShrinkToFit = "False";
		Book.ActiveSheet.Range("A25:G50").Font.ColorIndex = 16;
	    Book.ActiveSheet.Range("A25:G50").Font.Name="Verdana";
	    Book.ActiveSheet.Range("A25:G50").Font.Size="8";		
		Book.ActiveSheet.Range("A25:G50").Interior.Pattern = 1;
		Book.ActiveSheet.Range("A25:G50").Interior.PatternColorIndex = -4105;
		
		if (document.getElementById("selTipo2").value=="DG"){
			Book.ActiveSheet.Range("A25:D25").MergeCells = "True";
			Book.ActiveSheet.Range("A25:G25").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(25,1).Value = "Área";
			Book.ActiveSheet.Cells(25,6).Value = document.getElementById("pAreaTotalDG").innerText;
			Book.ActiveSheet.Cells(25,7).Value = "m2";
			Book.ActiveSheet.Range("A26:D26").MergeCells = "True";
			Book.ActiveSheet.Range("A26:G26").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(26,1).Value = "Plafones Registrable de 0.61m x 0.61m:";
			Book.ActiveSheet.Cells(26,6).Value = document.getElementById("pNumPanelesDG").innerText;
			Book.ActiveSheet.Cells(26,7).Value = "pzas.";
			Book.ActiveSheet.Range("A29:D29").MergeCells = "True";
			Book.ActiveSheet.Range("A29:G29").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(29,1).Value = "T Pincipal Armstrong de 3.66m:";
			Book.ActiveSheet.Cells(29,6).Value = document.getElementById("pNumPostesDG").innerText;
			Book.ActiveSheet.Cells(29,7).Value = "pzas.";
			Book.ActiveSheet.Range("A30:D30").MergeCells = "True";
			Book.ActiveSheet.Range("A30:G30").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(30,1).Value = "T Secundaria Armstrong de 1.22m:";
			Book.ActiveSheet.Cells(30,6).Value = document.getElementById("pNumCanalesDG").innerText;
			Book.ActiveSheet.Cells(30,7).Value = "pzas.";
			Book.ActiveSheet.Range("A31:D31").MergeCells = "True";
			Book.ActiveSheet.Range("A31:G31").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(31,1).Value = "T Secundaria Armstrong de 0.61m:";
			Book.ActiveSheet.Cells(31,6).Value = document.getElementById("pNumEsquinerosDG").innerText;
			Book.ActiveSheet.Cells(31,7).Value = "pzas.";
			Book.ActiveSheet.Range("A32:D32").MergeCells = "True";
			Book.ActiveSheet.Range("A32:G32").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(32,1).Value = "Angulo de Amarre de 3.05m:";
			Book.ActiveSheet.Cells(32,6).Value = document.getElementById("pNumTorPosDG").innerText;
			Book.ActiveSheet.Cells(32,7).Value = "pzas.";
			Book.ActiveSheet.Range("A33:D33").MergeCells = "True";
			Book.ActiveSheet.Range("A33:G33").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(33,1).Value = "Tornillo para Angulo Perimetral:";
			Book.ActiveSheet.Cells(33,6).Value = document.getElementById("pNumTorForDG").innerText;
			Book.ActiveSheet.Cells(33,7).Value = "pzas.";
			Book.ActiveSheet.Range("A34:D34").MergeCells = "True";
			Book.ActiveSheet.Range("A34:G34").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(34,1).Value = "Angulo Premontado p/ Clavo de 1 1/4:";
			Book.ActiveSheet.Cells(34,6).Value = document.getElementById("pNumTaquetesDG").innerText;
			Book.ActiveSheet.Cells(34,7).Value = "pzas.";
			Book.ActiveSheet.Range("A35:D35").MergeCells = "True";
			Book.ActiveSheet.Range("A35:G35").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(35,1).Value = "Alambre Galvanizado Cal 12:";
			Book.ActiveSheet.Cells(35,6).Value = document.getElementById("pNumRolCintaDG").innerText;
			Book.ActiveSheet.Cells(35,7).Value = "KG";
			//--- Leyenda
			Book.ActiveSheet.Range("A38:G38").MergeCells = "True";
			Book.ActiveSheet.Range("A38:G38").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(38,1).Value = "* Los resultados son aproximaciones";
						
		}else{
			Book.ActiveSheet.Range("A25:D25").MergeCells = "True";
			Book.ActiveSheet.Range("A25:G25").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(25,1).Value = "Área";
			Book.ActiveSheet.Cells(25,6).Value = document.getElementById("pAreaTotalPB").innerText;
			Book.ActiveSheet.Cells(25,7).Value = "m2";
			Book.ActiveSheet.Range("A26:D26").MergeCells = "True";
			Book.ActiveSheet.Range("A26:G26").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(26,1).Value = "Plafones Registrable de 0.61m x 1.22m :";
			Book.ActiveSheet.Cells(26,6).Value = document.getElementById("pNumPanelesPB").innerText;
			Book.ActiveSheet.Cells(26,7).Value = "pzas.";
			Book.ActiveSheet.Range("A27:D27").MergeCells = "True";
			Book.ActiveSheet.Range("A27:G27").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(27,1).Value = "T Principal Armstrong de 3.66m:";
			Book.ActiveSheet.Cells(27,6).Value = document.getElementById("pNumPostesPB").innerText;
			Book.ActiveSheet.Cells(27,7).Value = "pzas.";
			Book.ActiveSheet.Range("A28:D28").MergeCells = "True";
			Book.ActiveSheet.Range("A28:G28").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(28,1).Value = "T Secundaria Armstrong de 1.22m :";
			Book.ActiveSheet.Cells(28,6).Value = document.getElementById("pNumCanalesPB").innerText;
			Book.ActiveSheet.Cells(28,7).Value = "pzas.";
			Book.ActiveSheet.Range("A29:D29").MergeCells = "True";
			Book.ActiveSheet.Range("A29:G29").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(29,1).Value = "Angulo de Amarre de 3.05m:";
			Book.ActiveSheet.Cells(29,6).Value = document.getElementById("pNumEsquinerosPB").innerText;
			Book.ActiveSheet.Cells(29,7).Value = "pzas.";
			Book.ActiveSheet.Range("A30:D30").MergeCells = "True";
			Book.ActiveSheet.Range("A30:G30").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(30,1).Value = "Tornillo para Angulo Perimetral:";
			Book.ActiveSheet.Cells(30,6).Value = document.getElementById("pNumTorPosPB").innerText;
			Book.ActiveSheet.Cells(30,7).Value = "pzas.";
			Book.ActiveSheet.Range("A31:D31").MergeCells = "True";
			Book.ActiveSheet.Range("A31:G31").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(31,1).Value = "Angulo Premontado p/ Clavo de 1 1/4:";
			Book.ActiveSheet.Cells(31,6).Value = document.getElementById("pNumTorForPB").innerText;
			Book.ActiveSheet.Cells(31,7).Value = "pzas.";
			Book.ActiveSheet.Range("A32:D32").MergeCells = "True";
			Book.ActiveSheet.Range("A32:G32").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(32,1).Value = "Alambre Galvanizado Cal 12:";
			Book.ActiveSheet.Cells(32,6).Value = document.getElementById("pNumRolCintaPB").innerText;
			Book.ActiveSheet.Cells(32,7).Value = "KG";
			//--- Leyenda
			Book.ActiveSheet.Range("A35:G35").MergeCells = "True";
			Book.ActiveSheet.Range("A35:G35").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(35,1).Value = "* Los resultados son aproximaciones";
			
		 }
	
	// Save the sheet.
    var today = new Date();
    var month = today.getMonth()+1;
    var day = today.getDate();
    var year = today.getFullYear();
	var hour = today.getHours();
	var minu = today.getMinutes();
	var sec = today.getSeconds();


	nom="ListaMateriales_"+vTipo.value+"_"+year+month+day+hour+minu+sec+".xls";
	Book.SaveAs("C:\\"+nom);
	
	// Close Excel with the Quit method on the Application object.
	//Excel.Application.Quit();
	alert("Se ha creado el archivo excel en C:\\"+nom);


}

function exportaExcelPC(){
	var opener = window.dialogArguments;
    var tblListaMateriales = document.getElementById("ListaMateriales");
	//alert(tblListaMateriales.rows.length);
	var vLong = document.getElementById("pLong");
	var vAlt = document.getElementById("pAltura");
	var vPue = document.getElementById("pPuertas");
	var vVen = document.getElementById("pVentanas");	
	var vpTipo = document.getElementById("pTipo");
	var vTipo = document.getElementById("hidTipoCalculo");
	var vslash= /\\/gi;
	var path = window.location.pathname.split("html\\")[0].replace(vslash,"\\\\")+"imagenes\\\\";
	var Excel, Book;	
	var vRen =0;
	
	path = unescape(path.replace(/\+/g,  " "));
	
	// Create the Excel application object.
	Excel = new ActiveXObject("Excel.Application");	
	// Make Excel visible.
	Excel.Visible = true;	
	// Create a new work book.
	Book = Excel.Workbooks.Add();
	//Named
	Book.ActiveSheet.Name = "Lista Materiales";
	// Place some text in the first cell of the sheet.
	//Book.ActiveSheet.Cells(1,1).Value = tblListaMateriales.innerHTML;
	
	//ancho columna
	Book.ActiveSheet.Columns("B:B").ColumnWidth = 10;
	Book.ActiveSheet.Columns("C:C").ColumnWidth = 3;
	Book.ActiveSheet.Columns("E:E").ColumnWidth = 3;
	
	//inserto logo
	Book.ActiveSheet.Range("D1").Select;
	Book.ActiveSheet.Pictures.Insert(path+"logoPR.jpg");
	
	//inserto titulo de resultados
	Book.ActiveSheet.Range("A4").Select;
	Book.ActiveSheet.Pictures.Insert(path+getImgTitulo(vTipo.value));
	
	//seleccion para formato letra
	Book.ActiveSheet.Range("A7:G11").Select;
    Book.ActiveSheet.Range("A7:G11").Font.ColorIndex = 16;
	Book.ActiveSheet.Range("A7:G11").Font.Name="Verdana";
	Book.ActiveSheet.Range("A7:G11").Font.Size="8";
	
	Book.ActiveSheet.Range("B7:B11").HorizontalAlignment = -4152;
	Book.ActiveSheet.Range("B7:B11").VerticalAlignment = -4107;
	
	//pongo Datos
	if ((vTipo.value=="MF")||(vTipo.value=="PR")){
		Book.ActiveSheet.Cells(7,2).Value = "Tipo :";
		Book.ActiveSheet.Cells(7,4).Value = vpTipo.innerText;
	}
	
	Book.ActiveSheet.Cells(8,2).Value = "Longuitud :";
	Book.ActiveSheet.Cells(8,4).Value = vLong.innerText;
	Book.ActiveSheet.Cells(8,5).Value = "m";
	
	Book.ActiveSheet.Cells(9,2).Value = "Ancho :";
	Book.ActiveSheet.Cells(9,4).Value = vAlt.innerText;
	Book.ActiveSheet.Cells(9,5).Value = "m";
	
	//inserto imagen
	Book.ActiveSheet.Range("A11").Select;
	Book.ActiveSheet.Pictures.Insert(path+"infoplafonc.png");
	//pongo imagen resultados
	Book.ActiveSheet.Range("A22").Select;
	Book.ActiveSheet.Pictures.Insert(path+"tres.gif");
	
    //Renglones
	
		Book.ActiveSheet.Range("A25:D25").Select;
		Book.ActiveSheet.Range("A25:D50").HorizontalAlignment = -4131;
		Book.ActiveSheet.Range("A25:D50").VerticalAlignment = -4107;
		Book.ActiveSheet.Range("A25:D50").WrapText = "True";
		Book.ActiveSheet.Range("A25:D50").Orientation = 0;
		Book.ActiveSheet.Range("A25:D50").AddIndent = "False";
		Book.ActiveSheet.Range("A25:D50").ShrinkToFit = "False";
		Book.ActiveSheet.Range("A25:G50").Font.ColorIndex = 16;
	    Book.ActiveSheet.Range("A25:G50").Font.Name="Verdana";
	    Book.ActiveSheet.Range("A25:G50").Font.Size="8";		
		Book.ActiveSheet.Range("A25:G50").Interior.Pattern = 1;
		Book.ActiveSheet.Range("A25:G50").Interior.PatternColorIndex = -4105;
		
		if (vTipo.value=="PC"){
			Book.ActiveSheet.Range("A25:D25").MergeCells = "True";
			Book.ActiveSheet.Range("A25:G25").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(25,1).Value = "Área";
			Book.ActiveSheet.Cells(25,6).Value = document.getElementById("pAreaTotal").innerText;
			Book.ActiveSheet.Cells(25,7).Value = "m2";
			Book.ActiveSheet.Range("A26:D26").MergeCells = "True";
			Book.ActiveSheet.Range("A26:G26").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(26,1).Value = "Páneles de Yeso de 1.22 X 2.44m:";
			Book.ActiveSheet.Cells(26,6).Value = document.getElementById("pNumPaneles").innerText;
			Book.ActiveSheet.Cells(26,7).Value = "pzas.";
			Book.ActiveSheet.Range("A27:D27").MergeCells = "True";
			Book.ActiveSheet.Range("A27:G27").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(27,1).Value = "Canaleta  de Carga Cal. 22 de 3.96 m:";
			Book.ActiveSheet.Cells(27,6).Value = document.getElementById("pNumCanaleta").innerText;
			Book.ActiveSheet.Cells(27,7).Value = "pzas.";
			Book.ActiveSheet.Range("A28:D28").MergeCells = "True";
			Book.ActiveSheet.Range("A28:G28").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(28,1).Value = "Canal Liston Cal. 26 de 3.96:";
			Book.ActiveSheet.Cells(28,6).Value = document.getElementById("pNumListon").innerText;
			Book.ActiveSheet.Cells(28,7).Value = "pzas.";
			Book.ActiveSheet.Range("A29:D29").MergeCells = "True";
			Book.ActiveSheet.Range("A29:G29").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(29,1).Value = "Angulo de Amarre de 3.05m:";
			Book.ActiveSheet.Cells(29,6).Value = document.getElementById("pNumAngPeri").innerText;
			Book.ActiveSheet.Cells(29,7).Value = "pzas.";
			Book.ActiveSheet.Range("A30:D30").MergeCells = "True";
			Book.ActiveSheet.Range("A30:G30").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(30,1).Value = "Taquetes o Fijadores:";
			Book.ActiveSheet.Cells(30,6).Value = document.getElementById("pNumTaquetes").innerText;
			Book.ActiveSheet.Cells(30,7).Value = "pzas.";
			Book.ActiveSheet.Range("A31:D31").MergeCells = "True";
			Book.ActiveSheet.Range("A31:G31").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(31,1).Value = "Tornillos p/Forro 6 X 1 1/8 “:";
			Book.ActiveSheet.Cells(31,6).Value = document.getElementById("pNumTorFor").innerText;
			Book.ActiveSheet.Cells(31,7).Value = "pzas.";
			Book.ActiveSheet.Range("A32:D32").MergeCells = "True";
			Book.ActiveSheet.Range("A32:G32").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(32,1).Value = "Angulo Premontado:";
			Book.ActiveSheet.Cells(32,6).Value = document.getElementById("pNumFijador").innerText;
			Book.ActiveSheet.Cells(32,7).Value = "pzas.";
			Book.ActiveSheet.Range("A33:D33").MergeCells = "True";
			Book.ActiveSheet.Range("A33:G33").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(33,1).Value = "Cinta de Papel p/ Juntas de 76.25m";
			Book.ActiveSheet.Cells(33,6).Value = document.getElementById("pNumRolCinta").innerText;
			Book.ActiveSheet.Cells(33,7).Value = "rollo (s)";
			Book.ActiveSheet.Range("A34:D34").MergeCells = "True";
			Book.ActiveSheet.Range("A34:G34").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(34,1).Value = "Compuesto p/ Junta Panel Rey de 21.8KG:";
			Book.ActiveSheet.Cells(34,6).Value = document.getElementById("pNumCompuesto").innerText;
			Book.ActiveSheet.Cells(34,7).Value = "caja (s)";
			Book.ActiveSheet.Range("A35:D35").MergeCells = "True";
			Book.ActiveSheet.Range("A35:G35").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(35,1).Value = "Alambre Galvanizado Cal. 12:";
			Book.ActiveSheet.Cells(35,6).Value = document.getElementById("pNumAla12").innerText;
			Book.ActiveSheet.Cells(35,7).Value = "KG";
			Book.ActiveSheet.Range("A36:D36").MergeCells = "True";
			Book.ActiveSheet.Range("A36:G36").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(36,1).Value = "Alambre Galvanizado Cal. 18:";
			Book.ActiveSheet.Cells(36,6).Value = document.getElementById("pNumAla18").innerText;
			Book.ActiveSheet.Cells(36,7).Value = "KG";
			Book.ActiveSheet.Range("A37:D37").MergeCells = "True";
			Book.ActiveSheet.Range("A37:G37").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(37,1).Value = "Aislamiento de Fibra de Vidrio:";
			Book.ActiveSheet.Cells(37,6).Value = document.getElementById("pFibVid").innerText;
			Book.ActiveSheet.Cells(37,7).Value = "m2";
			//--- Leyenda
			Book.ActiveSheet.Range("A40:G40").MergeCells = "True";
			Book.ActiveSheet.Range("A40:G40").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(40,1).Value = "* Los resultados son aproximaciones";
		}
		
	
	// Save the sheet.
    var today = new Date();
    var month = today.getMonth()+1;
    var day = today.getDate();
    var year = today.getFullYear();
	var hour = today.getHours();
	var minu = today.getMinutes();
	var sec = today.getSeconds();


	nom="ListaMateriales_"+vTipo.value+"_"+year+month+day+hour+minu+sec+".xls";
	Book.SaveAs("C:\\"+nom);
	
	// Close Excel with the Quit method on the Application object.
	//Excel.Application.Quit();
	alert("Se ha creado el archivo excel en C:\\"+nom);


}



function exportaExcelML(){
	var opener = window.dialogArguments;
    var tblListaMateriales = document.getElementById("ListaMateriales");
	//alert(tblListaMateriales.rows.length);
	var vLong = document.getElementById("pLong");
	var vAlt = document.getElementById("pAltura");
	var vPue = document.getElementById("pPuertas");
	var vVen = document.getElementById("pVentanas");	
	var vEsq = document.getElementById("pEsquinas");	
	var vpTipo = document.getElementById("pTipo");
	var vTipo = document.getElementById("hidTipoCalculo");
	var vslash= /\\/gi;
	var path = window.location.pathname.split("html\\")[0].replace(vslash,"\\\\")+"imagenes\\\\";
	var Excel, Book;	
	var vRen =0;
	
	path = unescape(path.replace(/\+/g,  " "));
	
	// Create the Excel application object.
	Excel = new ActiveXObject("Excel.Application");	
	// Make Excel visible.
	Excel.Visible = true;	
	// Create a new work book.
	Book = Excel.Workbooks.Add();
	//Named
	Book.ActiveSheet.Name = "Lista Materiales";
	// Place some text in the first cell of the sheet.
	//Book.ActiveSheet.Cells(1,1).Value = tblListaMateriales.innerHTML;
	
	//ancho columna
	Book.ActiveSheet.Columns("B:B").ColumnWidth = 10;
	Book.ActiveSheet.Columns("C:C").ColumnWidth = 3;
	Book.ActiveSheet.Columns("E:E").ColumnWidth = 3;
	
	//inserto logo
	Book.ActiveSheet.Range("D1").Select;
	Book.ActiveSheet.Pictures.Insert(path+"logoPR.jpg");
	
	//inserto titulo de resultados
	Book.ActiveSheet.Range("A4").Select;
	Book.ActiveSheet.Pictures.Insert(path+getImgTitulo(vTipo.value));
	
	//seleccion para formato letra
	Book.ActiveSheet.Range("A7:G12").Select;
    Book.ActiveSheet.Range("A7:G12").Font.ColorIndex = 16;
	Book.ActiveSheet.Range("A7:G12").Font.Name="Verdana";
	Book.ActiveSheet.Range("A7:G12").Font.Size="8";
	
	Book.ActiveSheet.Range("B7:B12").HorizontalAlignment = -4152;
	Book.ActiveSheet.Range("B7:B12").VerticalAlignment = -4107;
	
	//pongo Datos
	if ((vTipo.value=="MF")||(vTipo.value=="PR")){
		Book.ActiveSheet.Cells(7,2).Value = "Tipo :";
		Book.ActiveSheet.Cells(7,4).Value = vpTipo.innerText;
	}
	
	Book.ActiveSheet.Cells(8,2).Value = "Longuitud :";
	Book.ActiveSheet.Cells(8,4).Value = vLong.innerText;
	Book.ActiveSheet.Cells(8,5).Value = "m";
	
	Book.ActiveSheet.Cells(9,2).Value = "Altura :";
	Book.ActiveSheet.Cells(9,4).Value = vAlt.innerText;
	Book.ActiveSheet.Cells(9,5).Value = "m";
	
	Book.ActiveSheet.Cells(10,2).Value = "Puertas :";
	Book.ActiveSheet.Cells(10,4).Value = vPue.innerText;

	Book.ActiveSheet.Cells(11,2).Value = "Ventanas :";
	Book.ActiveSheet.Cells(11,4).Value = vVen.innerText;
	
	Book.ActiveSheet.Cells(12,2).Value = "Esquinas :";
	Book.ActiveSheet.Cells(12,4).Value = vEsq.innerText;
	
	//inserto imagen
	Book.ActiveSheet.Range("A13").Select;
	Book.ActiveSheet.Pictures.Insert(path+"infomuroL.png");
	
	//pongo imagen resultados
	Book.ActiveSheet.Range("A23").Select;
	Book.ActiveSheet.Pictures.Insert(path+"tres.gif");
	
    //Renglones
	
		Book.ActiveSheet.Range("A26:D26").Select;
		Book.ActiveSheet.Range("A26:D50").HorizontalAlignment = -4131;
		Book.ActiveSheet.Range("A26:D50").VerticalAlignment = -4107;
		Book.ActiveSheet.Range("A26:D50").WrapText = "True";
		Book.ActiveSheet.Range("A26:D50").Orientation = 0;
		Book.ActiveSheet.Range("A26:D50").AddIndent = "False";
		Book.ActiveSheet.Range("A26:D50").ShrinkToFit = "False";
		Book.ActiveSheet.Range("A26:G50").Font.ColorIndex = 16;
	    Book.ActiveSheet.Range("A26:G50").Font.Name="Verdana";
	    Book.ActiveSheet.Range("A26:G50").Font.Size="8";		
		Book.ActiveSheet.Range("A26:G50").Interior.Pattern = 1;
		Book.ActiveSheet.Range("A26:G50").Interior.PatternColorIndex = -4105;
		
		if (vTipo.value=="ML"){
			Book.ActiveSheet.Range("A26:D26").MergeCells = "True";
			Book.ActiveSheet.Range("A26:G26").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(26,1).Value = "Área";
			Book.ActiveSheet.Cells(26,6).Value = document.getElementById("pAreaTotal").innerText;
			Book.ActiveSheet.Cells(26,7).Value = "m2";
			Book.ActiveSheet.Range("A27:D27").MergeCells = "True";
			Book.ActiveSheet.Range("A27:G27").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(27,1).Value = "Páneles de Yeso de 1.22 X 2.44m:";
			Book.ActiveSheet.Cells(27,6).Value = document.getElementById("pNumPaneles").innerText;
			Book.ActiveSheet.Cells(27,7).Value = "pzas.";
			Book.ActiveSheet.Range("A28:D28").MergeCells = "True";
			Book.ActiveSheet.Range("A28:G28").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(28,1).Value = "Postes Metálicos de "+document.getElementById("pTipoPostes").innerText+"m:";
			Book.ActiveSheet.Cells(28,6).Value = document.getElementById("pNumPostes").innerText;
			Book.ActiveSheet.Cells(28,7).Value = "pzas.";
			Book.ActiveSheet.Range("A29:D29").MergeCells = "True";
			Book.ActiveSheet.Range("A29:G29").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(29,1).Value = "Canales de Amarre de 3.05m:";
			Book.ActiveSheet.Cells(29,6).Value = document.getElementById("pNumCanales").innerText;
			Book.ActiveSheet.Cells(29,7).Value = "pzas.";
			Book.ActiveSheet.Range("A30:D30").MergeCells = "True";
			Book.ActiveSheet.Range("A30:G30").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(30,1).Value = "Esquineros de 2.44m:";
			Book.ActiveSheet.Cells(30,6).Value = document.getElementById("pNumEsquineros").innerText;
			Book.ActiveSheet.Cells(30,7).Value = "pzas.";
			Book.ActiveSheet.Range("A31:D31").MergeCells = "True";
			Book.ActiveSheet.Range("A31:G31").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(31,1).Value = "Tornillos Metal – Metal 7 x 7/16”:";
			Book.ActiveSheet.Cells(31,6).Value = document.getElementById("pNumTorPos").innerText;
			Book.ActiveSheet.Cells(31,7).Value = "pzas.";
			Book.ActiveSheet.Range("A32:D32").MergeCells = "True";
			Book.ActiveSheet.Range("A32:G32").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(32,1).Value = "Tornillos p/Forro 6 X 1 1/8 “:";
			Book.ActiveSheet.Cells(32,6).Value = document.getElementById("pNumTorFor").innerText;
			Book.ActiveSheet.Cells(32,7).Value = "pzas.";
			Book.ActiveSheet.Range("A33:D33").MergeCells = "True";
			Book.ActiveSheet.Range("A33:G33").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(33,1).Value = "Taquetes o Fijadores:";
			Book.ActiveSheet.Cells(33,6).Value = document.getElementById("pNumTaquetes").innerText;
			Book.ActiveSheet.Cells(33,7).Value = "pzas.";
			Book.ActiveSheet.Range("A34:D34").MergeCells = "True";
			Book.ActiveSheet.Range("A34:G34").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(34,1).Value = "Cinta de Papel p/ Juntas de 76.25m:";
			Book.ActiveSheet.Cells(34,6).Value = document.getElementById("pNumRolCinta").innerText;
			Book.ActiveSheet.Cells(34,7).Value = "rollo(s)";
			Book.ActiveSheet.Range("A35:D35").MergeCells = "True";
			Book.ActiveSheet.Range("A35:G35").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(35,1).Value = "Compuesto p/ Junta Panel Rey de 21.8KG:";
			Book.ActiveSheet.Cells(35,6).Value = document.getElementById("pNumCompuesto").innerText;
			Book.ActiveSheet.Cells(35,7).Value = "caja (s)";
			Book.ActiveSheet.Range("A36:D36").MergeCells = "True";
			Book.ActiveSheet.Range("A36:G36").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(36,1).Value = "Aislamiento de Fibra de Vidrio:";
			Book.ActiveSheet.Cells(36,6).Value = document.getElementById("pFibVid").innerText;
			Book.ActiveSheet.Cells(36,7).Value = "m2";
			//--- Leyenda
			Book.ActiveSheet.Range("A38:G38").MergeCells = "True";
			Book.ActiveSheet.Range("A38:G38").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(38,1).Value = "* Los resultados son aproximaciones";
		}
	
	// Save the sheet.
    var today = new Date();
    var month = today.getMonth()+1;
    var day = today.getDate();
    var year = today.getFullYear();
	var hour = today.getHours();
	var minu = today.getMinutes();
	var sec = today.getSeconds();


	nom="ListaMateriales_"+vTipo.value+"_"+year+month+day+hour+minu+sec+".xls";
	Book.SaveAs("C:\\"+nom);
	
	// Close Excel with the Quit method on the Application object.
	//Excel.Application.Quit();
	alert("Se ha creado el archivo excel en C:\\"+nom);


}



function exportaExcel(){
	var opener = window.dialogArguments;
    var tblListaMateriales = document.getElementById("ListaMateriales");
	//alert(tblListaMateriales.rows.length);
	var vLong = document.getElementById("pLong");
	var vAlt = document.getElementById("pAltura");
	var vPue = document.getElementById("pPuertas");
	var vVen = document.getElementById("pVentanas");
	var vEsq = document.getElementById("pEsquinas");		
	var vpTipo = document.getElementById("pTipo");
	var vTipo = document.getElementById("hidTipoCalculo");
	var vslash= /\\/gi;
	var path = window.location.pathname.split("html\\")[0].replace(vslash,"\\\\")+"imagenes\\\\";
	var Excel, Book;	
	var vRen =0;
	
	path = unescape(path.replace(/\+/g,  " "));
	
	// Create the Excel application object.
	Excel = new ActiveXObject("Excel.Application");	
	// Make Excel visible.
	Excel.Visible = true;	
	// Create a new work book.
	Book = Excel.Workbooks.Add();
	//Named
	Book.ActiveSheet.Name = "Lista Materiales";
	// Place some text in the first cell of the sheet.
	//Book.ActiveSheet.Cells(1,1).Value = tblListaMateriales.innerHTML;
	
	//ancho columna
	Book.ActiveSheet.Columns("B:B").ColumnWidth = 10;
	Book.ActiveSheet.Columns("C:C").ColumnWidth = 3;
	Book.ActiveSheet.Columns("E:E").ColumnWidth = 3;
	
	//inserto logo
	Book.ActiveSheet.Range("D1").Select;
	Book.ActiveSheet.Pictures.Insert(path+"logoPR.jpg");
	
	//inserto titulo de resultados
	Book.ActiveSheet.Range("A4").Select;
	Book.ActiveSheet.Pictures.Insert(path+getImgTitulo(vTipo.value));
	
	//seleccion para formato letra
	Book.ActiveSheet.Range("A7:G12").Select;
    Book.ActiveSheet.Range("A7:G12").Font.ColorIndex = 16;
	Book.ActiveSheet.Range("A7:G12").Font.Name="Verdana";
	Book.ActiveSheet.Range("A7:G12").Font.Size="8";
	
	Book.ActiveSheet.Range("B7:B12").HorizontalAlignment = -4152;
	Book.ActiveSheet.Range("B7:B12").VerticalAlignment = -4107;
	
	//pongo Datos
	if ((vTipo.value=="MF")||(vTipo.value=="PR")){
		Book.ActiveSheet.Cells(7,2).Value = "Tipo :";
		Book.ActiveSheet.Cells(7,4).Value = vpTipo.innerText;
	}
	
	Book.ActiveSheet.Cells(8,2).Value = "Longuitud :";
	Book.ActiveSheet.Cells(8,4).Value = vLong.innerText;
	Book.ActiveSheet.Cells(8,5).Value = "m";
	
	Book.ActiveSheet.Cells(9,2).Value = "Altura :";
	Book.ActiveSheet.Cells(9,4).Value = vAlt.innerText;
	Book.ActiveSheet.Cells(9,5).Value = "m";
	
	Book.ActiveSheet.Cells(10,2).Value = "Puertas :";
	Book.ActiveSheet.Cells(10,4).Value = vPue.innerText;

	Book.ActiveSheet.Cells(11,2).Value = "Ventanas :";
	Book.ActiveSheet.Cells(11,4).Value = vVen.innerText;
	
	Book.ActiveSheet.Cells(12,2).Value = "Esquinas :";
	Book.ActiveSheet.Cells(12,4).Value = vEsq.innerText;
	
	//inserto imagen
	Book.ActiveSheet.Range("A13").Select;
	Book.ActiveSheet.Pictures.Insert(path+"infomuroD.png");
	
	//pongo imagen resultados
	Book.ActiveSheet.Range("A23").Select;
	Book.ActiveSheet.Pictures.Insert(path+"tres.gif");
	
    //Renglones
	
		Book.ActiveSheet.Range("A26:D26").Select;
		Book.ActiveSheet.Range("A26:D50").HorizontalAlignment = -4131;
		Book.ActiveSheet.Range("A26:D50").VerticalAlignment = -4107;
		Book.ActiveSheet.Range("A26:D50").WrapText = "True";
		Book.ActiveSheet.Range("A26:D50").Orientation = 0;
		Book.ActiveSheet.Range("A26:D50").AddIndent = "False";
		Book.ActiveSheet.Range("A26:D50").ShrinkToFit = "False";
		Book.ActiveSheet.Range("A26:G50").Font.ColorIndex = 16;
	    Book.ActiveSheet.Range("A26:G50").Font.Name="Verdana";
	    Book.ActiveSheet.Range("A26:G50").Font.Size="8";		
		Book.ActiveSheet.Range("A26:G50").Interior.Pattern = 1;
		Book.ActiveSheet.Range("A26:G50").Interior.PatternColorIndex = -4105;
		
		if (vTipo.value=="MD"){
			Book.ActiveSheet.Range("A26:D26").MergeCells = "True";
			Book.ActiveSheet.Range("A26:G26").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(26,1).Value = "Área";
			Book.ActiveSheet.Cells(26,6).Value = document.getElementById("pAreaTotal").innerText;
			Book.ActiveSheet.Cells(26,7).Value = "m2";
			Book.ActiveSheet.Range("A27:D27").MergeCells = "True";
			Book.ActiveSheet.Range("A27:G27").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(27,1).Value = "Páneles de Yeso de 1.22 X 2.44m:";
			Book.ActiveSheet.Cells(27,6).Value = document.getElementById("pNumPaneles").innerText;
			Book.ActiveSheet.Cells(27,7).Value = "pzas.";
			Book.ActiveSheet.Range("A28:D28").MergeCells = "True";
			Book.ActiveSheet.Range("A28:G28").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(28,1).Value = "Postes Metálicos de "+document.getElementById("pTipoPostes").innerText+"m:";
			Book.ActiveSheet.Cells(28,6).Value = document.getElementById("pNumPostes").innerText;
			Book.ActiveSheet.Cells(28,7).Value = "pzas.";
			Book.ActiveSheet.Range("A29:D29").MergeCells = "True";
			Book.ActiveSheet.Range("A29:G29").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(29,1).Value = "Canales de Amarre de 3.05m:";
			Book.ActiveSheet.Cells(29,6).Value = document.getElementById("pNumCanales").innerText;
			Book.ActiveSheet.Cells(29,7).Value = "pzas.";
			Book.ActiveSheet.Range("A30:D30").MergeCells = "True";
			Book.ActiveSheet.Range("A30:G30").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(30,1).Value = "Esquineros de 2.44m:";
			Book.ActiveSheet.Cells(30,6).Value = document.getElementById("pNumEsquineros").innerText;
			Book.ActiveSheet.Cells(30,7).Value = "pzas.";
			Book.ActiveSheet.Range("A31:D31").MergeCells = "True";
			Book.ActiveSheet.Range("A31:G31").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(31,1).Value = "Tornillos Metal – Metal 7 x 7/16”:";
			Book.ActiveSheet.Cells(31,6).Value = document.getElementById("pNumTorPos").innerText;
			Book.ActiveSheet.Cells(31,7).Value = "pzas.";
			Book.ActiveSheet.Range("A32:D32").MergeCells = "True";
			Book.ActiveSheet.Range("A32:G32").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(32,1).Value = "Tornillos p/Forro 6 X 1 1/8 “:";
			Book.ActiveSheet.Cells(32,6).Value = document.getElementById("pNumTorFor").innerText;
			Book.ActiveSheet.Cells(32,7).Value = "pzas.";
			Book.ActiveSheet.Range("A33:D33").MergeCells = "True";
			Book.ActiveSheet.Range("A33:G33").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(33,1).Value = "Taquetes o Fijadores:";
			Book.ActiveSheet.Cells(33,6).Value = document.getElementById("pNumTaquetes").innerText;
			Book.ActiveSheet.Cells(33,7).Value = "pzas.";
			Book.ActiveSheet.Range("A34:D34").MergeCells = "True";
			Book.ActiveSheet.Range("A34:G34").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(34,1).Value = "Cinta de Papel p/ Juntas de 76.25m:";
			Book.ActiveSheet.Cells(34,6).Value = document.getElementById("pNumRolCinta").innerText;
			Book.ActiveSheet.Cells(34,7).Value = "rollo(s)";
			Book.ActiveSheet.Range("A35:D35").MergeCells = "True";
			Book.ActiveSheet.Range("A35:G35").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(35,1).Value = "Compuesto p/ Junta Panel Rey de 21.8KG:";
			Book.ActiveSheet.Cells(35,6).Value = document.getElementById("pNumCompuesto").innerText;
			Book.ActiveSheet.Cells(35,7).Value = "caja (s)";
			Book.ActiveSheet.Range("A36:D36").MergeCells = "True";
			Book.ActiveSheet.Range("A36:G36").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(36,1).Value = "Aislamiento de Fibra de Vidrio:";
			Book.ActiveSheet.Cells(36,6).Value = document.getElementById("pFibVid").innerText;
			Book.ActiveSheet.Cells(36,7).Value = "m2";
			//--- Leyenda
			Book.ActiveSheet.Range("A38:G38").MergeCells = "True";
			Book.ActiveSheet.Range("A38:G38").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(38,1).Value = "* Los resultados son aproximaciones";
		}
	
	// Save the sheet.
    var today = new Date();
    var month = today.getMonth()+1;
    var day = today.getDate();
    var year = today.getFullYear();
	var hour = today.getHours();
	var minu = today.getMinutes();
	var sec = today.getSeconds();


	nom="ListaMateriales_"+vTipo.value+"_"+year+month+day+hour+minu+sec+".xls";
	Book.SaveAs("C:\\"+nom);
	
	// Close Excel with the Quit method on the Application object.
	//Excel.Application.Quit();
	alert("Se ha creado el archivo excel en C:\\"+nom);


}


function exportaExcelMF(){
	//alert(document.getElementById("selTipo2").value);
	switch (document.getElementById("selTipo2").value){//document.getElementById("selTipo2").value
		 case "DG" : var tblListaMateriales = document.getElementById("ListaMaterialesDG");
					//alert(tblListaMateriales.rows.length);
					var vLong = document.getElementById("pLongDG");
					var vAlt = document.getElementById("pAlturaDG");
					var vPue = document.getElementById("pPuertasDG");
					var vVen = document.getElementById("pVentanasDG");
					var vEsq = document.getElementById("pEsquinasDG");
		            break;
		 case "DGN" : var tblListaMateriales = document.getElementById("ListaMaterialesDGN");
					//alert(tblListaMateriales.rows.length);
					var vLong = document.getElementById("pLongDGN");
					var vAlt = document.getElementById("pAlturaDGN");
					var vPue = document.getElementById("pPuertasDGN");
					var vVen = document.getElementById("pVentanasDGN");
					var vEsq = document.getElementById("pEsquinasDGN");
		            break;
		 case "PB" : var tblListaMateriales = document.getElementById("ListaMaterialesPB");
					//alert(tblListaMateriales.rows.length);
					var vLong = document.getElementById("pLongPB");
					var vAlt = document.getElementById("pAlturaPB");
					var vPue = document.getElementById("pPuertasPB");
					var vVen = document.getElementById("pVentanasPB");
					var vEsq = document.getElementById("pEsquinasPB");
		break;		
		default :  exit();
		            break; 		
	}

    var vTipo = document.getElementById("hidTipoCalculo");
	var vslash= /\\/gi;
	var path = window.location.pathname.split("html\\")[0].replace(vslash,"\\\\")+"imagenes\\\\";
	var Excel, Book;	
	var vRen =0;
	
	path = unescape(path.replace(/\+/g,  " "));
	
	// Create the Excel application object.
	Excel = new ActiveXObject("Excel.Application");	
	// Make Excel visible.
	Excel.Visible = true;	
	// Create a new work book.
	Book = Excel.Workbooks.Add();
	//Named
	Book.ActiveSheet.Name = "Lista Materiales";
	// Place some text in the first cell of the sheet.
	//Book.ActiveSheet.Cells(1,1).Value = tblListaMateriales.innerHTML;
	
	//ancho columna
	Book.ActiveSheet.Columns("B:B").ColumnWidth = 10;
	Book.ActiveSheet.Columns("C:C").ColumnWidth = 3;
	Book.ActiveSheet.Columns("E:E").ColumnWidth = 3;
	
	//inserto logo
	Book.ActiveSheet.Range("D1").Select;
	Book.ActiveSheet.Pictures.Insert(path+"logoPR.jpg");
	
	//inserto titulo de resultados
	Book.ActiveSheet.Range("A4").Select;
	Book.ActiveSheet.Pictures.Insert(path+getImgTitulo(vTipo.value));
	
	//seleccion para formato letra
	Book.ActiveSheet.Range("A7:G12").Select;
    Book.ActiveSheet.Range("A7:G12").Font.ColorIndex = 16;
	Book.ActiveSheet.Range("A7:G12").Font.Name="Verdana";
	Book.ActiveSheet.Range("A7:G12").Font.Size="8";
	
	Book.ActiveSheet.Range("B7:B12").HorizontalAlignment = -4152;
	Book.ActiveSheet.Range("B7:B12").VerticalAlignment = -4107;
	
	
	//pongo Datos
	if (vTipo.value=="MF"){
		Book.ActiveSheet.Cells(7,2).Value = "Tipo :";
		if(document.getElementById("selTipo2").value=="DG"){//cambie todos los selTipo2 por selTipo
				Book.ActiveSheet.Cells(7,4).Value = document.getElementById("pTipoPanelDG").innerText;
				nomImagen = "infomuroFD.png";
		}else{
			if(document.getElementById("selTipo2").value=="DGN"){
				Book.ActiveSheet.Cells(7,4).Value = document.getElementById("pTipoPanelDGN").innerText;
				nomImagen = "infomuroFD.png";
			}else{
			    Book.ActiveSheet.Cells(7,4).Value = document.getElementById("pTipoPanelPB").innerText;
				nomImagen = "infomuroFP.png";
			}
		}		
	}
	
	Book.ActiveSheet.Cells(8,2).Value = "Longuitud :";
	Book.ActiveSheet.Cells(8,4).Value = vLong.innerText;
	Book.ActiveSheet.Cells(8,5).Value = "m";
	
	Book.ActiveSheet.Cells(9,2).Value = "Altura :";
	Book.ActiveSheet.Cells(9,4).Value = vAlt.innerText;
	Book.ActiveSheet.Cells(9,5).Value = "m";
	
	Book.ActiveSheet.Cells(10,2).Value = "Puertas :";
	Book.ActiveSheet.Cells(10,4).Value = vPue.innerText;

	Book.ActiveSheet.Cells(11,2).Value = "Ventanas :";
	Book.ActiveSheet.Cells(11,4).Value = vVen.innerText;

	Book.ActiveSheet.Cells(12,2).Value = "Esquinas :";
	Book.ActiveSheet.Cells(12,4).Value = vEsq.innerText;
	
	//inserto imagen
	Book.ActiveSheet.Range("A13").Select;
	Book.ActiveSheet.Pictures.Insert(path+nomImagen);
	
	//pongo imagen resultados
	Book.ActiveSheet.Range("A23").Select;
	Book.ActiveSheet.Pictures.Insert(path+"tres.gif");
	
    //Renglones
	
		Book.ActiveSheet.Range("A26:D26").Select;
		Book.ActiveSheet.Range("A26:D50").HorizontalAlignment = -4131;
		Book.ActiveSheet.Range("A26:D50").VerticalAlignment = -4107;
		Book.ActiveSheet.Range("A26:D50").WrapText = "True";
		Book.ActiveSheet.Range("A26:D50").Orientation = 0;
		Book.ActiveSheet.Range("A26:D50").AddIndent = "False";
		Book.ActiveSheet.Range("A26:D50").ShrinkToFit = "False";
		Book.ActiveSheet.Range("A26:G50").Font.ColorIndex = 16;
	    Book.ActiveSheet.Range("A26:G50").Font.Name="Verdana";
	    Book.ActiveSheet.Range("A26:G50").Font.Size="8";		
		Book.ActiveSheet.Range("A26:G50").Interior.Pattern = 1;
		Book.ActiveSheet.Range("A26:G50").Interior.PatternColorIndex = -4105;
		
		if (document.getElementById("selTipo").value=="DG"){
			Book.ActiveSheet.Range("A26:D26").MergeCells = "True";
			Book.ActiveSheet.Range("A26:G26").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(26,1).Value = "Área";
			Book.ActiveSheet.Cells(26,6).Value = document.getElementById("pAreaTotalDG").innerText;
			Book.ActiveSheet.Cells(26,7).Value = "m2";
			Book.ActiveSheet.Range("A27:D27").MergeCells = "True";
			Book.ActiveSheet.Range("A27:G27").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(27,1).Value = "Páneles Denss Glass de 1.22 X 2.44m:";
			Book.ActiveSheet.Cells(27,6).Value = document.getElementById("pNumPanelesDG").innerText;
			Book.ActiveSheet.Cells(27,7).Value = "pzas.";
			Book.ActiveSheet.Range("A28:D28").MergeCells = "True";
			Book.ActiveSheet.Range("A28:G28").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(28,1).Value = "Poste Viga Cal. 22 de 3.05m:";
			Book.ActiveSheet.Cells(28,6).Value = document.getElementById("pNumPostesDG").innerText;
			Book.ActiveSheet.Cells(28,7).Value = "pzas.";
			Book.ActiveSheet.Range("A29:D29").MergeCells = "True";
			Book.ActiveSheet.Range("A29:G29").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(29,1).Value = "Canales CC Cal. 22 de 3.96m:";
			Book.ActiveSheet.Cells(29,6).Value = document.getElementById("pNumCanalesDG").innerText;
			Book.ActiveSheet.Cells(29,7).Value = "pzas.";
			Book.ActiveSheet.Range("A30:D30").MergeCells = "True";
			Book.ActiveSheet.Range("A30:G30").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(30,1).Value = "Esquineros de 2.44m:";
			Book.ActiveSheet.Cells(30,6).Value = document.getElementById("pNumEsquinerosDG").innerText;
			Book.ActiveSheet.Cells(30,7).Value = "pzas.";
			Book.ActiveSheet.Range("A31:D31").MergeCells = "True";
			Book.ActiveSheet.Range("A31:G31").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(31,1).Value = "Tornillos Metal – Metal 7 x 7/16”:";
			Book.ActiveSheet.Cells(31,6).Value = document.getElementById("pNumTorPosDG").innerText;
			Book.ActiveSheet.Cells(31,7).Value = "pzas.";
			Book.ActiveSheet.Range("A32:D32").MergeCells = "True";
			Book.ActiveSheet.Range("A32:G32").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(32,1).Value = "Tornillos p/Forro 6 X 1 1/8 “:";
			Book.ActiveSheet.Cells(32,6).Value = document.getElementById("pNumTorForDG").innerText;
			Book.ActiveSheet.Cells(32,7).Value = "pzas.";
			Book.ActiveSheet.Range("A33:D33").MergeCells = "True";
			Book.ActiveSheet.Range("A33:G33").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(33,1).Value = "Taquetes o Fijadores:";
			Book.ActiveSheet.Cells(33,6).Value = document.getElementById("pNumTaquetesDG").innerText;
			Book.ActiveSheet.Cells(33,7).Value = "pzas.";
			Book.ActiveSheet.Range("A34:D34").MergeCells = "True";
			Book.ActiveSheet.Range("A34:G34").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(34,1).Value = "Cinta de Papel p/ Juntas de 76.25m:";
			Book.ActiveSheet.Cells(34,6).Value = document.getElementById("pNumRolCintaDG").innerText;
			Book.ActiveSheet.Cells(34,7).Value = "rollo(s)";
			Book.ActiveSheet.Range("A35:D35").MergeCells = "True";
			Book.ActiveSheet.Range("A35:G35").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(35,1).Value = "Recubrimiento Base Panel Rey de 21.8KG:";
			Book.ActiveSheet.Cells(35,6).Value = document.getElementById("pNumRecubrimientoDG").innerText;
			Book.ActiveSheet.Cells(35,7).Value = "caja (s)";
			Book.ActiveSheet.Range("A36:D36").MergeCells = "True";
			Book.ActiveSheet.Range("A36:G36").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(36,1).Value = "Aislamiento de Fibra de Vidrio:";
			Book.ActiveSheet.Cells(36,6).Value = document.getElementById("pFibVidDG").innerText;
			Book.ActiveSheet.Cells(36,7).Value = "m2";
			Book.ActiveSheet.Range("A37:D37").MergeCells = "True";
			Book.ActiveSheet.Range("A37:G37").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(37,1).Value = "Malla de Fibra de Vidro:";
			Book.ActiveSheet.Cells(37,6).Value = document.getElementById("pFibVidDGM").innerText;
			Book.ActiveSheet.Cells(37,7).Value = "m2";
			Book.ActiveSheet.Range("A38:D38").MergeCells = "True";
			Book.ActiveSheet.Range("A38:G38").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(38,1).Value = "Paneles de Yeso Standar:";
			Book.ActiveSheet.Cells(38,6).Value = document.getElementById("pNumPanelesStdDG").innerText;
			Book.ActiveSheet.Cells(38,7).Value = "pzas.";
			Book.ActiveSheet.Range("A39:D39").MergeCells = "True";
			Book.ActiveSheet.Range("A39:G39").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(39,1).Value = "Cinta de Fibra de Vidro:";
			Book.ActiveSheet.Cells(39,6).Value = document.getElementById("pCintaFibVidDG").innerText;
			Book.ActiveSheet.Cells(39,7).Value = "rollo (s)";
			Book.ActiveSheet.Range("A40:D40").MergeCells = "True";
			Book.ActiveSheet.Range("A40:G40").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(40,1).Value = "Compuesto Base:";
			Book.ActiveSheet.Cells(40,6).Value = document.getElementById("pCompuestoDG").innerText;
			Book.ActiveSheet.Cells(40,7).Value = "caja (s)";
			Book.ActiveSheet.Range("A41:D41").MergeCells = "True";
			Book.ActiveSheet.Range("A41:G41").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(41,1).Value = "Reborde J:";
			Book.ActiveSheet.Cells(41,6).Value = document.getElementById("pRebordeDG").innerText;
			Book.ActiveSheet.Cells(41,7).Value = "caja (s)";
			//--- Leyenda
			Book.ActiveSheet.Range("A43:G43").MergeCells = "True";
			Book.ActiveSheet.Range("A43:G43").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(43,1).Value = "* Los resultados son aproximaciones";
		}else{
			if (document.getElementById("selTipo").value=="DGN"){
			Book.ActiveSheet.Range("A26:D26").MergeCells = "True";
			Book.ActiveSheet.Range("A26:G26").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(26,1).Value = "Área";
			Book.ActiveSheet.Cells(26,6).Value = document.getElementById("pAreaTotalDGN").innerText;
			Book.ActiveSheet.Cells(26,7).Value = "m2";
			Book.ActiveSheet.Range("A27:D27").MergeCells = "True";
			Book.ActiveSheet.Range("A27:G27").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(27,1).Value = "Páneles Denss Glass de 1.22 X 2.44:";
			Book.ActiveSheet.Cells(27,6).Value = document.getElementById("pNumPanelesDGN").innerText;
			Book.ActiveSheet.Cells(27,7).Value = "pzas.";
			Book.ActiveSheet.Range("A28:D28").MergeCells = "True";
			Book.ActiveSheet.Range("A28:G28").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(28,1).Value = "Poste Viga Calibre 22:";
			Book.ActiveSheet.Cells(28,6).Value = document.getElementById("pNumPostesDGN").innerText;
			Book.ActiveSheet.Cells(28,7).Value = "pzas.";
			Book.ActiveSheet.Range("A29:D29").MergeCells = "True";
			Book.ActiveSheet.Range("A29:G29").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(29,1).Value = "Canales CC Calibre 22 de 3.96m:";
			Book.ActiveSheet.Cells(29,6).Value = document.getElementById("pNumCanalesDGN").innerText;
			Book.ActiveSheet.Cells(29,7).Value = "pzas.";
			Book.ActiveSheet.Range("A30:D30").MergeCells = "True";
			Book.ActiveSheet.Range("A30:G30").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(30,1).Value = "Esquineros de 2.44:";
			Book.ActiveSheet.Cells(30,6).Value = document.getElementById("pNumEsquinerosDGN").innerText;
			Book.ActiveSheet.Cells(30,7).Value = "pzas.";
			Book.ActiveSheet.Range("A31:D31").MergeCells = "True";
			Book.ActiveSheet.Range("A31:G31").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(31,1).Value = "Tornillos Metal – Metal 7 x 7/16”:";
			Book.ActiveSheet.Cells(31,6).Value = document.getElementById("pNumTorPosDGN").innerText;
			Book.ActiveSheet.Cells(31,7).Value = "pzas.";
			Book.ActiveSheet.Range("A32:D32").MergeCells = "True";
			Book.ActiveSheet.Range("A32:G32").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(32,1).Value = "Tornillos p/Forro 6 X 1 1/8 “:";
			Book.ActiveSheet.Cells(32,6).Value = document.getElementById("pNumTorForDGN").innerText;
			Book.ActiveSheet.Cells(32,7).Value = "pzas.";
			Book.ActiveSheet.Range("A33:D33").MergeCells = "True";
			Book.ActiveSheet.Range("A33:G33").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(33,1).Value = "Taquetes o Fijadores:";
			Book.ActiveSheet.Cells(33,6).Value = document.getElementById("pNumTaquetesDGN").innerText;
			Book.ActiveSheet.Cells(33,7).Value = "pzas.";
			Book.ActiveSheet.Range("A34:D34").MergeCells = "True";
			Book.ActiveSheet.Range("A34:G34").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(34,1).Value = "Cinta de papel para juntas:";
			Book.ActiveSheet.Cells(34,6).Value = document.getElementById("pNumRolCintaDGN").innerText;
			Book.ActiveSheet.Cells(34,7).Value = "rollo(s)";
			Book.ActiveSheet.Range("A35:D35").MergeCells = "True";
			Book.ActiveSheet.Range("A35:G35").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(35,1).Value = "Recubrimiento Base:";
			Book.ActiveSheet.Cells(35,6).Value = document.getElementById("pNumRecubrimientoDGN").innerText;
			Book.ActiveSheet.Cells(35,7).Value = "caja (s)";
			Book.ActiveSheet.Range("A36:D36").MergeCells = "True";
			Book.ActiveSheet.Range("A36:G36").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(36,1).Value = "Aislamiento de Fibra de Vidrio:";
			Book.ActiveSheet.Cells(36,6).Value = document.getElementById("pFibVidDGN").innerText;
			Book.ActiveSheet.Cells(36,7).Value = "m2";
			Book.ActiveSheet.Range("A37:D37").MergeCells = "True";
			Book.ActiveSheet.Range("A37:G37").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(37,1).Value = "Malla de Fibra de Vidro:";
			Book.ActiveSheet.Cells(37,6).Value = document.getElementById("pFibVidDGNM").innerText;
			Book.ActiveSheet.Cells(37,7).Value = "m2";
			Book.ActiveSheet.Range("A38:D38").MergeCells = "True";
			Book.ActiveSheet.Range("A38:G38").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(38,1).Value = "Paneles de Yeso Standar:";
			Book.ActiveSheet.Cells(38,6).Value = document.getElementById("pNumPanelesStdDGN").innerText;
			Book.ActiveSheet.Cells(38,7).Value = "pzas.";
			Book.ActiveSheet.Range("A39:D39").MergeCells = "True";
			Book.ActiveSheet.Range("A39:G39").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(39,1).Value = "Cinta de Fibra de Vidro:";
			Book.ActiveSheet.Cells(39,6).Value = document.getElementById("pCintaFibVidDGN").innerText;
			Book.ActiveSheet.Cells(39,7).Value = "rollo (s)";
			Book.ActiveSheet.Range("A40:D40").MergeCells = "True";
			Book.ActiveSheet.Range("A40:G40").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(40,1).Value = "Compuesto Base:";
			Book.ActiveSheet.Cells(40,6).Value = document.getElementById("pCompuestoDGN").innerText;
			Book.ActiveSheet.Cells(40,7).Value = "caja (s)";
			Book.ActiveSheet.Range("A41:D41").MergeCells = "True";
			Book.ActiveSheet.Range("A41:G41").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(41,1).Value = "Reborde J:";
			Book.ActiveSheet.Cells(41,6).Value = document.getElementById("pRebordeDGN").innerText;
			Book.ActiveSheet.Cells(41,7).Value = "caja (s)";
			//--- Leyenda
			Book.ActiveSheet.Range("A43:G43").MergeCells = "True";
			Book.ActiveSheet.Range("A43:G43").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(43,1).Value = "* Los resultados son aproximaciones";
		}else{
			Book.ActiveSheet.Range("A26:D26").MergeCells = "True";
			Book.ActiveSheet.Range("A26:G26").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(26,1).Value = "Área";
			Book.ActiveSheet.Cells(26,6).Value = document.getElementById("pAreaTotalPB").innerText;
			Book.ActiveSheet.Cells(26,7).Value = "m2";
			Book.ActiveSheet.Range("A27:D27").MergeCells = "True";
			Book.ActiveSheet.Range("A27:G27").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(27,1).Value = "Páneles Denss Glass de 1.22 X 2.44:";
			Book.ActiveSheet.Cells(27,6).Value = document.getElementById("pNumPanelesPB").innerText;
			Book.ActiveSheet.Cells(27,7).Value = "pzas.";
			Book.ActiveSheet.Range("A28:D28").MergeCells = "True";
			Book.ActiveSheet.Range("A28:G28").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(28,1).Value = "Poste Viga Calibre 20:";
			Book.ActiveSheet.Cells(28,6).Value = document.getElementById("pNumPostesPB").innerText;
			Book.ActiveSheet.Cells(28,7).Value = "pzas.";
			Book.ActiveSheet.Range("A29:D29").MergeCells = "True";
			Book.ActiveSheet.Range("A29:G29").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(29,1).Value = "Canales CC Calibre 22 de 3.96m:";
			Book.ActiveSheet.Cells(29,6).Value = document.getElementById("pNumCanalesPB").innerText;
			Book.ActiveSheet.Cells(29,7).Value = "pzas.";
			Book.ActiveSheet.Range("A30:D30").MergeCells = "True";
			Book.ActiveSheet.Range("A30:G30").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(30,1).Value = "Esquineros de 2.44:";
			Book.ActiveSheet.Cells(30,6).Value = document.getElementById("pNumEsquinerosPB").innerText;
			Book.ActiveSheet.Cells(30,7).Value = "pzas.";
			Book.ActiveSheet.Range("A31:D31").MergeCells = "True";
			Book.ActiveSheet.Range("A31:G31").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(31,1).Value = "Tornillos Metal – Metal 7 x 7/16”:";
			Book.ActiveSheet.Cells(31,6).Value = document.getElementById("pNumTorPosDGN").innerText;
			Book.ActiveSheet.Cells(31,7).Value = "pzas.";
			Book.ActiveSheet.Range("A32:D32").MergeCells = "True";
			Book.ActiveSheet.Range("A32:G32").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(32,1).Value = "Tornillos p/Forro 6 X 1 1/8 :";
			Book.ActiveSheet.Cells(32,6).Value = document.getElementById("pNumTorForPB").innerText;
			Book.ActiveSheet.Cells(32,7).Value = "pzas.";
			Book.ActiveSheet.Range("A33:D33").MergeCells = "True";
			Book.ActiveSheet.Range("A33:G33").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(33,1).Value = "Taquetes o Fijadores:";
			Book.ActiveSheet.Cells(33,6).Value = document.getElementById("pNumTaquetesPB").innerText;
			Book.ActiveSheet.Cells(33,7).Value = "pzas.";
			Book.ActiveSheet.Range("A34:D34").MergeCells = "True";
			Book.ActiveSheet.Range("A34:G34").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(34,1).Value = "Cinta de papel para juntas:";
			Book.ActiveSheet.Cells(34,6).Value = document.getElementById("pNumRolCintaPB").innerText;
			Book.ActiveSheet.Cells(34,7).Value = "rollo(s)";
			Book.ActiveSheet.Range("A35:D35").MergeCells = "True";
			Book.ActiveSheet.Range("A35:G35").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(35,1).Value = "Recubrimiento Base:";
			Book.ActiveSheet.Cells(35,6).Value = document.getElementById("pNumRecubrimientoPB").innerText;
			Book.ActiveSheet.Cells(35,7).Value = "caja (s)";
			Book.ActiveSheet.Range("A36:D36").MergeCells = "True";
			Book.ActiveSheet.Range("A36:G36").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(36,1).Value = "Aislamiento de Fibra de Vidrio:";
			Book.ActiveSheet.Cells(36,6).Value = document.getElementById("pFibVidPB").innerText;
			Book.ActiveSheet.Cells(36,7).Value = "m2";
			Book.ActiveSheet.Range("A37:D37").MergeCells = "True";
			Book.ActiveSheet.Range("A37:G37").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(37,1).Value = "Malla de Fibra de Vidro:";
			Book.ActiveSheet.Cells(37,6).Value = document.getElementById("pFibVidPBM").innerText;
			Book.ActiveSheet.Cells(37,7).Value = "m2";
			Book.ActiveSheet.Range("A38:D38").MergeCells = "True";
			Book.ActiveSheet.Range("A38:G38").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(38,1).Value = "Paneles de Yeso de 1.22 X 2.44m:";
			Book.ActiveSheet.Cells(38,6).Value = document.getElementById("pNumPanelesStdPB").innerText;
			Book.ActiveSheet.Cells(38,7).Value = "pzas.";
			Book.ActiveSheet.Range("A39:D39").MergeCells = "True";
			Book.ActiveSheet.Range("A39:G39").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(39,1).Value = "Cinta de Fibra de Vidrio de 3“ x 45m:";
			Book.ActiveSheet.Cells(39,6).Value = document.getElementById("pCintaFibVidPB").innerText;
			Book.ActiveSheet.Cells(39,7).Value = "rollo (s)";
			Book.ActiveSheet.Range("A40:D40").MergeCells = "True";
			Book.ActiveSheet.Range("A40:G40").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(40,1).Value = "Compuesto p/ Junta Panel Rey de 21.8KG:";
			Book.ActiveSheet.Cells(40,6).Value = document.getElementById("pNumCompuestoPB").innerText;
			Book.ActiveSheet.Cells(40,7).Value = "caja (s)";
			Book.ActiveSheet.Range("A41:D41").MergeCells = "True";
			Book.ActiveSheet.Range("A41:G41").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(41,1).Value = "Reborde J de 3.05m:";
			Book.ActiveSheet.Cells(41,6).Value = document.getElementById("pRebordePB").innerText;
			Book.ActiveSheet.Cells(41,7).Value = "caja (s)";
			Book.ActiveSheet.Range("A42:D42").MergeCells = "True";
			Book.ActiveSheet.Range("A42:G42").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(42,1).Value = "Tornillo p/ Forro p/ Permabase:";
			Book.ActiveSheet.Cells(42,6).Value = document.getElementById("pNumTorForroPermaPB").innerText;
			Book.ActiveSheet.Cells(42,7).Value = "caja (s)";
			Book.ActiveSheet.Range("A43:D43").MergeCells = "True";
			Book.ActiveSheet.Range("A43:G43").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(43,1).Value = "Tyvek Barrera de Vapor:";
			Book.ActiveSheet.Cells(43,6).Value = document.getElementById("pTyvekPB").innerText;
			Book.ActiveSheet.Cells(43,7).Value = "m2.";
			//--- Leyenda
			Book.ActiveSheet.Range("A45:G45").MergeCells = "True";
			Book.ActiveSheet.Range("A45:G45").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(45,1).Value = "* Los resultados son aproximaciones";
		 }
		}
	
	// Save the sheet.
    var today = new Date();
    var month = today.getMonth()+1;
    var day = today.getDate();
    var year = today.getFullYear();
	var hour = today.getHours();
	var minu = today.getMinutes();
	var sec = today.getSeconds();


	nom="ListaMateriales_"+vTipo.value+"_"+year+month+day+hour+minu+sec+".xls";
	Book.SaveAs("C:\\"+nom);
	
	// Close Excel with the Quit method on the Application object.
	//Excel.Application.Quit();
	alert("Se ha creado el archivo excel en C:\\"+nom);


}


/*
*
*/
function getImgTitulo(tipo){
	var sCompleto =" ";
	
	switch (tipo){
		 case "MD" : return "tmd.gif";
		            break;
		 case "MF" : return "tmf.gif";
		            break;
		 case "ML" : return "tml.gif";
		            break;
		 case "PR" : return "tpr.gif";
		            break;
		 case "PC" : return "tpc.gif";
		            break;
		default :  return " ";
		            break; 
		
	}
     
}




/**********************/
function exportaExcelPR261(){
		 var tblListaMateriales = document.getElementById("ListaMateriales61");
					//alert(tblListaMateriales.rows.length);
					var vLong = document.getElementById("pLong61");
					var vAlt = document.getElementById("pAltura61");
					var vPue = document.getElementById("pPuertas61");
					var vVen = document.getElementById("pVentanas61");
		

    var vTipo = document.getElementById("hidTipoCalculo");
	var vslash= /\\/gi;
	var path = window.location.pathname.split("html\\")[0].replace(vslash,"\\\\")+"imagenes\\\\";
	var Excel, Book;	
	var vRen =0;
	
	path = unescape(path.replace(/\+/g,  " "));
	
	// Create the Excel application object.
	Excel = new ActiveXObject("Excel.Application");	
	// Make Excel visible.
	Excel.Visible = true;	
	// Create a new work book.
	Book = Excel.Workbooks.Add();
	//Named
	Book.ActiveSheet.Name = "Lista Materiales";
	// Place some text in the first cell of the sheet.
	//Book.ActiveSheet.Cells(1,1).Value = tblListaMateriales.innerHTML;
	
	//ancho columna
	Book.ActiveSheet.Columns("B:B").ColumnWidth = 10;
	Book.ActiveSheet.Columns("C:C").ColumnWidth = 3;
	Book.ActiveSheet.Columns("E:E").ColumnWidth = 3;
	
	//inserto logo
	Book.ActiveSheet.Range("D1").Select;
	Book.ActiveSheet.Pictures.Insert(path+"logoPR.jpg");
	
	//inserto titulo de resultados
	Book.ActiveSheet.Range("A4").Select;
	Book.ActiveSheet.Pictures.Insert(path+getImgTitulo("PR"));
	
	//seleccion para formato letra
	Book.ActiveSheet.Range("A7:G11").Select;
    Book.ActiveSheet.Range("A7:G11").Font.ColorIndex = 16;
	Book.ActiveSheet.Range("A7:G11").Font.Name="Verdana";
	Book.ActiveSheet.Range("A7:G11").Font.Size="8";
	
	Book.ActiveSheet.Range("B7:B11").HorizontalAlignment = -4152;
	Book.ActiveSheet.Range("B7:B11").VerticalAlignment = -4107;
	
	
				Book.ActiveSheet.Cells(7,2).Value = "Tipo Medida:";
				Book.ActiveSheet.Cells(7,4).Value = document.getElementById("pTipoPanel61").innerText;
			
	Book.ActiveSheet.Cells(8,2).Value = "Longuitud :";
	Book.ActiveSheet.Cells(8,4).Value = vLong.innerText;
	Book.ActiveSheet.Cells(8,5).Value = "m";
	
	Book.ActiveSheet.Cells(9,2).Value = "Ancho :";
	Book.ActiveSheet.Cells(9,4).Value = vAlt.innerText;
	Book.ActiveSheet.Cells(9,5).Value = "m";
	
	//inserto imagen
	Book.ActiveSheet.Range("A11").Select;
	Book.ActiveSheet.Pictures.Insert(path+"infoplafonr61-61.png");
	
	//pongo imagen resultados
	Book.ActiveSheet.Range("A22").Select;
	Book.ActiveSheet.Pictures.Insert(path+"tres.gif");
	
    //Renglones
	
		Book.ActiveSheet.Range("A22:D22").Select;
		Book.ActiveSheet.Range("A22:D50").HorizontalAlignment = -4131;
		Book.ActiveSheet.Range("A22:D50").VerticalAlignment = -4107;
		Book.ActiveSheet.Range("A22:D50").WrapText = "True";
		Book.ActiveSheet.Range("A22:D50").Orientation = 0;
		Book.ActiveSheet.Range("A22:D50").AddIndent = "False";
		Book.ActiveSheet.Range("A22:D50").ShrinkToFit = "False";
		Book.ActiveSheet.Range("A22:G50").Font.ColorIndex = 16;
	    Book.ActiveSheet.Range("A22:G50").Font.Name="Verdana";
	    Book.ActiveSheet.Range("A22:G50").Font.Size="8";		
		Book.ActiveSheet.Range("A22:G50").Interior.Pattern = 1;
		Book.ActiveSheet.Range("A22:G50").Interior.PatternColorIndex = -4105;
		
		
			Book.ActiveSheet.Range("A25:D25").MergeCells = "True";
			Book.ActiveSheet.Range("A25:G25").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(25,1).Value = "Área";
			Book.ActiveSheet.Cells(25,6).Value = document.getElementById("pAreaTotal61").innerText;
			Book.ActiveSheet.Cells(25,7).Value = "m2";
			Book.ActiveSheet.Range("A26:D26").MergeCells = "True";
			Book.ActiveSheet.Range("A26:G26").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(26,1).Value = "Plafones Registrable de 0.61m x 0.61m:";
			Book.ActiveSheet.Cells(26,6).Value = document.getElementById("pNumPaneles61").innerText;
			Book.ActiveSheet.Cells(26,7).Value = "pzas.";
			Book.ActiveSheet.Range("A27:D27").MergeCells = "True";
			Book.ActiveSheet.Range("A27:G27").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(27,1).Value = "T Pincipal Armstrong de 3.66m:";
			Book.ActiveSheet.Cells(27,6).Value = document.getElementById("pNumPostes61").innerText;
			Book.ActiveSheet.Cells(27,7).Value = "pzas.";
			Book.ActiveSheet.Range("A28:D28").MergeCells = "True";
			Book.ActiveSheet.Range("A28:G28").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(28,1).Value = "T Secundaria Armstrong de 1.22m:";
			Book.ActiveSheet.Cells(28,6).Value = document.getElementById("pNumCanales61").innerText;
			Book.ActiveSheet.Cells(28,7).Value = "pzas.";
			Book.ActiveSheet.Range("A29:D29").MergeCells = "True";
			Book.ActiveSheet.Range("A29:G29").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(29,1).Value = "T Secundaria Armstrong de 0.61m:";
			Book.ActiveSheet.Cells(29,6).Value = document.getElementById("pNumEsquineros61").innerText;
			Book.ActiveSheet.Cells(29,7).Value = "pzas.";
			Book.ActiveSheet.Range("A30:D30").MergeCells = "True";
			Book.ActiveSheet.Range("A30:G30").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(30,1).Value = "Angulo de Amarre de 3.05m:";
			Book.ActiveSheet.Cells(30,6).Value = document.getElementById("pNumTorPos61").innerText;
			Book.ActiveSheet.Cells(30,7).Value = "pzas.";
			Book.ActiveSheet.Range("A31:D31").MergeCells = "True";
			Book.ActiveSheet.Range("A31:G31").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(31,1).Value = "Tornillo para Angulo Perimetral:";
			Book.ActiveSheet.Cells(31,6).Value = document.getElementById("pNumTorFor61").innerText;
			Book.ActiveSheet.Cells(31,7).Value = "pzas.";
			Book.ActiveSheet.Range("A32:D32").MergeCells = "True";
			Book.ActiveSheet.Range("A32:G32").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(32,1).Value = "Angulo Premontado p/ Clavo de 1 1/4:";
			Book.ActiveSheet.Cells(32,6).Value = document.getElementById("pNumTaquetes61").innerText;
			Book.ActiveSheet.Cells(32,7).Value = "pzas.";
			Book.ActiveSheet.Range("A33:D33").MergeCells = "True";
			Book.ActiveSheet.Range("A33:G33").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(33,1).Value = "Alambre Galvanizado Cal 12:";
			Book.ActiveSheet.Cells(33,6).Value = document.getElementById("pNumRolCinta61").innerText;
			Book.ActiveSheet.Cells(33,7).Value = "KG";
			//--- Leyenda
			Book.ActiveSheet.Range("A36:G36").MergeCells = "True";
			Book.ActiveSheet.Range("A36:G36").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(36,1).Value = "* Los resultados son aproximaciones";
			
		
	// Save the sheet.
    var today = new Date();
    var month = today.getMonth()+1;
    var day = today.getDate();
    var year = today.getFullYear();
	var hour = today.getHours();
	var minu = today.getMinutes();
	var sec = today.getSeconds();


	nom="ListaMateriales_"+vTipo.value+"_"+year+month+day+hour+minu+sec+".xls";
	Book.SaveAs("C:\\"+nom);
	
	// Close Excel with the Quit method on the Application object.
	//Excel.Application.Quit();
	alert("Se ha creado el archivo excel en C:\\"+nom);


}

function exportaExcelPR2122(){
	 var tblListaMateriales = document.getElementById("ListaMateriales122");
					//alert(tblListaMateriales.rows.length);
					var vLong = document.getElementById("pLong122");
					var vAlt = document.getElementById("pAltura122");
					var vPue = document.getElementById("pPuertas122");
					var vVen = document.getElementById("pVentanas122");

var vTipo = document.getElementById("hidTipoCalculo");
	var vslash= /\\/gi;
	var path = window.location.pathname.split("html\\")[0].replace(vslash,"\\\\")+"imagenes\\\\";
	var Excel, Book;	
	var vRen =0;
	
	path = unescape(path.replace(/\+/g,  " "));
	
	// Create the Excel application object.
	Excel = new ActiveXObject("Excel.Application");	
	// Make Excel visible.
	Excel.Visible = true;	
	// Create a new work book.
	Book = Excel.Workbooks.Add();
	//Named
	Book.ActiveSheet.Name = "Lista Materiales";
	// Place some text in the first cell of the sheet.
	//Book.ActiveSheet.Cells(1,1).Value = tblListaMateriales.innerHTML;
	
	//ancho columna
	Book.ActiveSheet.Columns("B:B").ColumnWidth = 10;
	Book.ActiveSheet.Columns("C:C").ColumnWidth = 3;
	Book.ActiveSheet.Columns("E:E").ColumnWidth = 3;
	
	//inserto logo
	Book.ActiveSheet.Range("D1").Select;
	Book.ActiveSheet.Pictures.Insert(path+"logoPR.jpg");
	
	//inserto titulo de resultados
	Book.ActiveSheet.Range("A4").Select;
	Book.ActiveSheet.Pictures.Insert(path+getImgTitulo("PR"));
	
	//seleccion para formato letra
	Book.ActiveSheet.Range("A7:G11").Select;
    Book.ActiveSheet.Range("A7:G11").Font.ColorIndex = 16;
	Book.ActiveSheet.Range("A7:G11").Font.Name="Verdana";
	Book.ActiveSheet.Range("A7:G11").Font.Size="8";
	
	Book.ActiveSheet.Range("B7:B11").HorizontalAlignment = -4152;
	Book.ActiveSheet.Range("B7:B11").VerticalAlignment = -4107;
	
	
				Book.ActiveSheet.Cells(7,2).Value = "Tipo Medida:";
			    Book.ActiveSheet.Cells(7,4).Value = document.getElementById("pTipoPanel122").innerText;
	
	Book.ActiveSheet.Cells(8,2).Value = "Longuitud :";
	Book.ActiveSheet.Cells(8,4).Value = vLong.innerText;
	Book.ActiveSheet.Cells(8,5).Value = "m";
	
	Book.ActiveSheet.Cells(9,2).Value = "Ancho :";
	Book.ActiveSheet.Cells(9,4).Value = vAlt.innerText;
	Book.ActiveSheet.Cells(9,5).Value = "m";
	
	//inserto imagen
	Book.ActiveSheet.Range("A11").Select;
	Book.ActiveSheet.Pictures.Insert(path+"infoplafonr61-122.png");
	
	//pongo imagen resultados
	Book.ActiveSheet.Range("A22").Select;
	Book.ActiveSheet.Pictures.Insert(path+"tres.gif");
	
    //Renglones
	
		Book.ActiveSheet.Range("A25:D25").Select;
		Book.ActiveSheet.Range("A25:D50").HorizontalAlignment = -4131;
		Book.ActiveSheet.Range("A25:D50").VerticalAlignment = -4107;
		Book.ActiveSheet.Range("A25:D50").WrapText = "True";
		Book.ActiveSheet.Range("A25:D50").Orientation = 0;
		Book.ActiveSheet.Range("A25:D50").AddIndent = "False";
		Book.ActiveSheet.Range("A25:D50").ShrinkToFit = "False";
		Book.ActiveSheet.Range("A25:G50").Font.ColorIndex = 16;
	    Book.ActiveSheet.Range("A25:G50").Font.Name="Verdana";
	    Book.ActiveSheet.Range("A25:G50").Font.Size="8";		
		Book.ActiveSheet.Range("A25:G50").Interior.Pattern = 1;
		Book.ActiveSheet.Range("A25:G50").Interior.PatternColorIndex = -4105;
		
		
			Book.ActiveSheet.Range("A26:D26").MergeCells = "True";
			Book.ActiveSheet.Range("A26:G26").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(26,1).Value = "Área";
			Book.ActiveSheet.Cells(26,6).Value = document.getElementById("pAreaTotal122").innerText;
			Book.ActiveSheet.Cells(26,7).Value = "m2";
			Book.ActiveSheet.Range("A27:D27").MergeCells = "True";
			Book.ActiveSheet.Range("A27:G27").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(27,1).Value = "Plafones Registrable de 0.61m x 1.22m :";
			Book.ActiveSheet.Cells(27,6).Value = document.getElementById("pNumPaneles122").innerText;
			Book.ActiveSheet.Cells(27,7).Value = "pzas.";
			Book.ActiveSheet.Range("A28:D28").MergeCells = "True";
			Book.ActiveSheet.Range("A28:G28").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(28,1).Value = "T Principal Armstrong de 3.66m:";
			Book.ActiveSheet.Cells(28,6).Value = document.getElementById("pNumPostes122").innerText;
			Book.ActiveSheet.Cells(28,7).Value = "pzas.";
			Book.ActiveSheet.Range("A29:D29").MergeCells = "True";
			Book.ActiveSheet.Range("A29:G29").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(29,1).Value = "T Secundaria Armstrong de 1.22m :";
			Book.ActiveSheet.Cells(29,6).Value = document.getElementById("pNumCanales122").innerText;
			Book.ActiveSheet.Cells(29,7).Value = "pzas.";
			Book.ActiveSheet.Range("A30:D30").MergeCells = "True";
			Book.ActiveSheet.Range("A30:G30").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(30,1).Value = "Angulo de Amarre de 3.05m:";
			Book.ActiveSheet.Cells(30,6).Value = document.getElementById("pNumEsquineros122").innerText;
			Book.ActiveSheet.Cells(30,7).Value = "pzas.";
			Book.ActiveSheet.Range("A31:D31").MergeCells = "True";
			Book.ActiveSheet.Range("A31:G31").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(31,1).Value = "Tornillo para Angulo Perimetral:";
			Book.ActiveSheet.Cells(31,6).Value = document.getElementById("pNumTorPos122").innerText;
			Book.ActiveSheet.Cells(31,7).Value = "pzas.";
			Book.ActiveSheet.Range("A32:D32").MergeCells = "True";
			Book.ActiveSheet.Range("A32:G32").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(32,1).Value = "Angulo Premontado para Clavo de 1 1/4:";
			Book.ActiveSheet.Cells(32,6).Value = document.getElementById("pNumTorFor122").innerText;
			Book.ActiveSheet.Cells(32,7).Value = "pzas.";
			Book.ActiveSheet.Range("A33:D33").MergeCells = "True";
			Book.ActiveSheet.Range("A33:G33").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(33,1).Value = "Alambre Galvanizado Cal 12:";
			Book.ActiveSheet.Cells(33,6).Value = document.getElementById("pNumRolCinta122").innerText;
			Book.ActiveSheet.Cells(33,7).Value = "KG";
			//--- Leyenda
			Book.ActiveSheet.Range("A36:G36").MergeCells = "True";
			Book.ActiveSheet.Range("A36:G36").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(36,1).Value = "* Los resultados son aproximaciones";
			
	
	// Save the sheet.
    var today = new Date();
    var month = today.getMonth()+1;
    var day = today.getDate();
    var year = today.getFullYear();
	var hour = today.getHours();
	var minu = today.getMinutes();
	var sec = today.getSeconds();


	nom="ListaMateriales_"+vTipo.value+"_"+year+month+day+hour+minu+sec+".xls";
	Book.SaveAs("C:\\"+nom);
	
	// Close Excel with the Quit method on the Application object.
	//Excel.Application.Quit();
	alert("Se ha creado el archivo excel en C:\\"+nom);


}

function exportaExcelPC2(){
	var opener = window.dialogArguments;
    var tblListaMateriales = document.getElementById("ListaMateriales");
	//alert(tblListaMateriales.rows.length);
	var vLong = document.getElementById("pLongPC");
	var vAlt = document.getElementById("pAlturaPC");
	var vPue = document.getElementById("pPuertasPC");
	var vVen = document.getElementById("pVentanasPC");	
	var vpTipo = document.getElementById("pTipoPC");
	var vTipo = document.getElementById("hidTipoCalculo");
	var vslash= /\\/gi;
	var path = window.location.pathname.split("html\\")[0].replace(vslash,"\\\\")+"imagenes\\\\";
	var Excel, Book;	
	var vRen =0;
	
	path = unescape(path.replace(/\+/g,  " "));
	
	// Create the Excel application object.
	Excel = new ActiveXObject("Excel.Application");	
	// Make Excel visible.
	Excel.Visible = true;	
	// Create a new work book.
	Book = Excel.Workbooks.Add();
	//Named
	Book.ActiveSheet.Name = "Lista Materiales";
	// Place some text in the first cell of the sheet.
	//Book.ActiveSheet.Cells(1,1).Value = tblListaMateriales.innerHTML;
	
	//ancho columna
	Book.ActiveSheet.Columns("B:B").ColumnWidth = 10;
	Book.ActiveSheet.Columns("C:C").ColumnWidth = 3;
	Book.ActiveSheet.Columns("E:E").ColumnWidth = 3;
	
	//inserto logo
	Book.ActiveSheet.Range("D1").Select;
	Book.ActiveSheet.Pictures.Insert(path+"logoPR.jpg");
	
	//inserto titulo de resultados
	Book.ActiveSheet.Range("A4").Select;
	Book.ActiveSheet.Pictures.Insert(path+"tpc.gif");
	
	//seleccion para formato letra
	Book.ActiveSheet.Range("A7:G11").Select;
    Book.ActiveSheet.Range("A7:G11").Font.ColorIndex = 16;
	Book.ActiveSheet.Range("A7:G11").Font.Name="Verdana";
	Book.ActiveSheet.Range("A7:G11").Font.Size="8";
	
	Book.ActiveSheet.Range("B7:B11").HorizontalAlignment = -4152;
	Book.ActiveSheet.Range("B7:B11").VerticalAlignment = -4107;
	
	//pongo Datos
	/*if ((vTipo.value=="MF")||(vTipo.value=="PR")){
		Book.ActiveSheet.Cells(7,2).Value = "Tipo :";
		Book.ActiveSheet.Cells(7,4).Value = vpTipo.innerText;
	}*/
	
	Book.ActiveSheet.Cells(8,2).Value = "Longuitud :";
	Book.ActiveSheet.Cells(8,4).Value = vLong.innerText;
	Book.ActiveSheet.Cells(8,5).Value = "m";
	
	Book.ActiveSheet.Cells(9,2).Value = "Ancho :";
	Book.ActiveSheet.Cells(9,4).Value = vAlt.innerText;
	Book.ActiveSheet.Cells(9,5).Value = "m";
	
	//inserto imagen
	Book.ActiveSheet.Range("A11").Select;
	Book.ActiveSheet.Pictures.Insert(path+"infoplafonc.png");
	
	//pongo imagen resultados
	Book.ActiveSheet.Range("A22").Select;
	Book.ActiveSheet.Pictures.Insert(path+"tres.gif");
	
    //Renglones
	
		Book.ActiveSheet.Range("A26:D26").Select;
		Book.ActiveSheet.Range("A26:D50").HorizontalAlignment = -4131;
		Book.ActiveSheet.Range("A26:D50").VerticalAlignment = -4107;
		Book.ActiveSheet.Range("A26:D50").WrapText = "True";
		Book.ActiveSheet.Range("A26:D50").Orientation = 0;
		Book.ActiveSheet.Range("A26:D50").AddIndent = "False";
		Book.ActiveSheet.Range("A26:D50").ShrinkToFit = "False";
		Book.ActiveSheet.Range("A26:G50").Font.ColorIndex = 16;
	    Book.ActiveSheet.Range("A26:G50").Font.Name="Verdana";
	    Book.ActiveSheet.Range("A26:G50").Font.Size="8";		
		Book.ActiveSheet.Range("A26:G50").Interior.Pattern = 1;
		Book.ActiveSheet.Range("A26:G50").Interior.PatternColorIndex = -4105;
		

			Book.ActiveSheet.Range("A26:D26").MergeCells = "True";
			Book.ActiveSheet.Range("A26:G26").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(26,1).Value = "Área";
			Book.ActiveSheet.Cells(26,6).Value = document.getElementById("pAreaTotalPC").innerText;
			Book.ActiveSheet.Cells(26,7).Value = "m2";
			Book.ActiveSheet.Range("A27:D27").MergeCells = "True";
			Book.ActiveSheet.Range("A27:G27").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(27,1).Value = "Páneles de Yeso de 1.22 X 2.44:";
			Book.ActiveSheet.Cells(27,6).Value = document.getElementById("pNumPanelesPC").innerText;
			Book.ActiveSheet.Cells(27,7).Value = "pzas.";
			Book.ActiveSheet.Range("A28:D28").MergeCells = "True";
			Book.ActiveSheet.Range("A28:G28").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(28,1).Value = "Canaleta de Carga Cal. 22 de 3.96 m:";
			Book.ActiveSheet.Cells(28,6).Value = document.getElementById("pNumCanaletaPC").innerText;
			Book.ActiveSheet.Cells(28,7).Value = "pzas.";
			Book.ActiveSheet.Range("A29:D29").MergeCells = "True";
			Book.ActiveSheet.Range("A29:G29").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(29,1).Value = "Canal Liston Cal. 26 de 3.96m:";
			Book.ActiveSheet.Cells(29,6).Value = document.getElementById("pNumListonPC").innerText;
			Book.ActiveSheet.Cells(29,7).Value = "pzas.";
			Book.ActiveSheet.Range("A30:D30").MergeCells = "True";
			Book.ActiveSheet.Range("A30:G30").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(30,1).Value = "Angulo de Amarre de 3.05m:";
			Book.ActiveSheet.Cells(30,6).Value = document.getElementById("pNumAngPeriPC").innerText;
			Book.ActiveSheet.Cells(30,7).Value = "pzas.";
			Book.ActiveSheet.Range("A31:D31").MergeCells = "True";
			Book.ActiveSheet.Range("A31:G31").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(31,1).Value = "Taquetes o Fijadores:";
			Book.ActiveSheet.Cells(31,6).Value = document.getElementById("pNumTaquetesPC").innerText;
			Book.ActiveSheet.Cells(31,7).Value = "pzas.";
			Book.ActiveSheet.Range("A32:D32").MergeCells = "True";
			Book.ActiveSheet.Range("A32:G32").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(32,1).Value = "Tornillos p/Forro 6 X 1 1/8 “:";
			Book.ActiveSheet.Cells(32,6).Value = document.getElementById("pNumTorForPC").innerText;
			Book.ActiveSheet.Cells(32,7).Value = "pzas.";
			Book.ActiveSheet.Range("A33:D33").MergeCells = "True";
			Book.ActiveSheet.Range("A33:G33").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(33,1).Value = "Angulo Premontado:";
			Book.ActiveSheet.Cells(33,6).Value = document.getElementById("pNumFijadorPC").innerText;
			Book.ActiveSheet.Cells(33,7).Value = "pzas.";
			Book.ActiveSheet.Range("A34:D34").MergeCells = "True";
			Book.ActiveSheet.Range("A34:G34").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(34,1).Value = "Cinta de Papel p/ Juntas de 76.25m";
			Book.ActiveSheet.Cells(34,6).Value = document.getElementById("pNumRolCintaPC").innerText;
			Book.ActiveSheet.Cells(34,7).Value = "rollo (s)";
			Book.ActiveSheet.Range("A35:D35").MergeCells = "True";
			Book.ActiveSheet.Range("A35:G35").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(35,1).Value = "Compuesto p/ Junta Panel Rey de 21.8KG:";
			Book.ActiveSheet.Cells(35,6).Value = document.getElementById("pNumCompuestoPC").innerText;
			Book.ActiveSheet.Cells(35,7).Value = "caja (s)";
			Book.ActiveSheet.Range("A36:D36").MergeCells = "True";
			Book.ActiveSheet.Range("A36:G36").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(36,1).Value = "Alambre Galvanizado Cal. 12:";
			Book.ActiveSheet.Cells(36,6).Value = document.getElementById("pNumAla12PC").innerText;
			Book.ActiveSheet.Cells(36,7).Value = "KG";
			Book.ActiveSheet.Range("A37:D37").MergeCells = "True";
			Book.ActiveSheet.Range("A37:G37").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(37,1).Value = "Alambre Galvanizado Cal. 18:";
			Book.ActiveSheet.Cells(37,6).Value = document.getElementById("pNumAla18PC").innerText;
			Book.ActiveSheet.Cells(37,7).Value = "KG";
			Book.ActiveSheet.Range("A38:D38").MergeCells = "True";
			Book.ActiveSheet.Range("A38:G38").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(38,1).Value = "Aislamiento de Fibra de Vidrio:";
			Book.ActiveSheet.Cells(38,6).Value = document.getElementById("pFibVidPC").innerText;
			Book.ActiveSheet.Cells(38,7).Value = "m2";
			//--- Leyenda
			Book.ActiveSheet.Range("A40:G40").MergeCells = "True";
			Book.ActiveSheet.Range("A40:G40").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(40,1).Value = "* Los resultados son aproximaciones";

		
	
	// Save the sheet.
    var today = new Date();
    var month = today.getMonth()+1;
    var day = today.getDate();
    var year = today.getFullYear();
	var hour = today.getHours();
	var minu = today.getMinutes();
	var sec = today.getSeconds();


	nom="ListaMateriales_"+vTipo.value+"_"+year+month+day+hour+minu+sec+".xls";
	Book.SaveAs("C:\\"+nom);
	
	// Close Excel with the Quit method on the Application object.
	//Excel.Application.Quit();
	alert("Se ha creado el archivo excel en C:\\"+nom);


}



function exportaExcelML2(){
	var opener = window.dialogArguments;
    var tblListaMateriales = document.getElementById("ListaMateriales");
	//alert(tblListaMateriales.rows.length);
	var vLong = document.getElementById("pLongL");
	var vAlt = document.getElementById("pAlturaL");
	var vPue = document.getElementById("pPuertasL");
	var vVen = document.getElementById("pVentanasL");	
	var vEsq = document.getElementById("pEsquinasL");	
	var vpTipo = document.getElementById("pTipoL");
	var vTipo = document.getElementById("hidTipoCalculo");
	var vslash= /\\/gi;
	var path = window.location.pathname.split("html\\")[0].replace(vslash,"\\\\")+"imagenes\\\\";
	var Excel, Book;	
	var vRen =0;
	
	path = unescape(path.replace(/\+/g,  " "));
	
	// Create the Excel application object.
	Excel = new ActiveXObject("Excel.Application");	
	// Make Excel visible.
	Excel.Visible = true;	
	// Create a new work book.
	Book = Excel.Workbooks.Add();
	//Named
	Book.ActiveSheet.Name = "Lista Materiales";
	// Place some text in the first cell of the sheet.
	//Book.ActiveSheet.Cells(1,1).Value = tblListaMateriales.innerHTML;
	
	//ancho columna
	Book.ActiveSheet.Columns("B:B").ColumnWidth = 10;
	Book.ActiveSheet.Columns("C:C").ColumnWidth = 3;
	Book.ActiveSheet.Columns("E:E").ColumnWidth = 3;
	
	//inserto logo
	Book.ActiveSheet.Range("D1").Select;
	Book.ActiveSheet.Pictures.Insert(path+"logoPR.jpg");
	
	//inserto titulo de resultados
	Book.ActiveSheet.Range("A4").Select;
	Book.ActiveSheet.Pictures.Insert(path+getImgTitulo("ML"));
	
	//seleccion para formato letra
	Book.ActiveSheet.Range("A7:G12").Select;
    Book.ActiveSheet.Range("A7:G12").Font.ColorIndex = 16;
	Book.ActiveSheet.Range("A7:G12").Font.Name="Verdana";
	Book.ActiveSheet.Range("A7:G12").Font.Size="8";
	
	Book.ActiveSheet.Range("B7:B12").HorizontalAlignment = -4152;
	Book.ActiveSheet.Range("B7:B12").VerticalAlignment = -4107;
	
	//pongo Datos
	/*if ((vTipo.value=="MF")||(vTipo.value=="PR")){
		Book.ActiveSheet.Cells(7,2).Value = "Tipo :";
		Book.ActiveSheet.Cells(7,4).Value = vpTipo.innerText;
	}*/
	
	Book.ActiveSheet.Cells(8,2).Value = "Longuitud :";
	Book.ActiveSheet.Cells(8,4).Value = vLong.innerText;
	Book.ActiveSheet.Cells(8,5).Value = "m";
	
	Book.ActiveSheet.Cells(9,2).Value = "Altura :";
	Book.ActiveSheet.Cells(9,4).Value = vAlt.innerText;
	Book.ActiveSheet.Cells(9,5).Value = "m";
	
	Book.ActiveSheet.Cells(10,2).Value = "Puertas :";
	Book.ActiveSheet.Cells(10,4).Value = vPue.innerText;

	Book.ActiveSheet.Cells(11,2).Value = "Ventanas :";
	Book.ActiveSheet.Cells(11,4).Value = vVen.innerText;

	Book.ActiveSheet.Cells(12,2).Value = "Ventanas :";
	Book.ActiveSheet.Cells(12,4).Value = vVen.innerText;
	
	//inserto imagen
	Book.ActiveSheet.Range("A13").Select;
	Book.ActiveSheet.Pictures.Insert(path+"infomuroL.png");
	
	//pongo imagen resultados
	Book.ActiveSheet.Range("A123").Select;
	Book.ActiveSheet.Pictures.Insert(path+"tres.gif");
	
    //Renglones
	
		Book.ActiveSheet.Range("A26:D26").Select;
		Book.ActiveSheet.Range("A26:D50").HorizontalAlignment = -4131;
		Book.ActiveSheet.Range("A26:D50").VerticalAlignment = -4107;
		Book.ActiveSheet.Range("A26:D50").WrapText = "True";
		Book.ActiveSheet.Range("A26:D50").Orientation = 0;
		Book.ActiveSheet.Range("A26:D50").AddIndent = "False";
		Book.ActiveSheet.Range("A26:D50").ShrinkToFit = "False";
		Book.ActiveSheet.Range("A26:G50").Font.ColorIndex = 16;
	    Book.ActiveSheet.Range("A26:G50").Font.Name="Verdana";
	    Book.ActiveSheet.Range("A26:G50").Font.Size="8";		
		Book.ActiveSheet.Range("A26:G50").Interior.Pattern = 1;
		Book.ActiveSheet.Range("A26:G50").Interior.PatternColorIndex = -4105;
		

			Book.ActiveSheet.Range("A26:D26").MergeCells = "True";
			Book.ActiveSheet.Range("A26:G26").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(26,1).Value = "Área";
			Book.ActiveSheet.Cells(26,6).Value = document.getElementById("pAreaTotalL").innerText;
			Book.ActiveSheet.Cells(26,7).Value = "m2";
			Book.ActiveSheet.Range("A27:D27").MergeCells = "True";
			Book.ActiveSheet.Range("A27:G27").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(27,1).Value = "Páneles de Yeso de 1.22 X 2.44m:";
			Book.ActiveSheet.Cells(27,6).Value = document.getElementById("pNumPanelesL").innerText;
			Book.ActiveSheet.Cells(27,7).Value = "pzas.";
			Book.ActiveSheet.Range("A28:D28").MergeCells = "True";
			Book.ActiveSheet.Range("A28:G28").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(28,1).Value = "Postes Metálicos de "+document.getElementById("pTipoPostesL").innerText+"m:";
			Book.ActiveSheet.Cells(28,6).Value = document.getElementById("pNumPostesL").innerText;
			Book.ActiveSheet.Cells(28,7).Value = "pzas.";
			Book.ActiveSheet.Range("A29:D29").MergeCells = "True";
			Book.ActiveSheet.Range("A29:G29").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(29,1).Value = "Canales de Amarre de 3.05m:";
			Book.ActiveSheet.Cells(29,6).Value = document.getElementById("pNumCanalesL").innerText;
			Book.ActiveSheet.Cells(29,7).Value = "pzas.";
			Book.ActiveSheet.Range("A30:D30").MergeCells = "True";
			Book.ActiveSheet.Range("A30:G30").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(30,1).Value = "Esquineros de 2.44m:";
			Book.ActiveSheet.Cells(30,6).Value = document.getElementById("pNumEsquinerosL").innerText;
			Book.ActiveSheet.Cells(30,7).Value = "pzas.";
			Book.ActiveSheet.Range("A31:D31").MergeCells = "True";
			Book.ActiveSheet.Range("A31:G31").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(31,1).Value = "Tornillos Metal – Metal 7 x 7/16”:";
			Book.ActiveSheet.Cells(31,6).Value = document.getElementById("pNumTorPosL").innerText;
			Book.ActiveSheet.Cells(31,7).Value = "pzas.";
			Book.ActiveSheet.Range("A32:D32").MergeCells = "True";
			Book.ActiveSheet.Range("A32:G32").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(32,1).Value = "Tornillos p/Forro 6 X 1 1/8 “:";
			Book.ActiveSheet.Cells(32,6).Value = document.getElementById("pNumTorForL").innerText;
			Book.ActiveSheet.Cells(32,7).Value = "pzas.";
			Book.ActiveSheet.Range("A33:D33").MergeCells = "True";
			Book.ActiveSheet.Range("A33:G33").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(33,1).Value = "Taquetes o Fijadores:";
			Book.ActiveSheet.Cells(33,6).Value = document.getElementById("pNumTaquetesL").innerText;
			Book.ActiveSheet.Cells(33,7).Value = "pzas.";
			Book.ActiveSheet.Range("A34:D34").MergeCells = "True";
			Book.ActiveSheet.Range("A34:G34").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(34,1).Value = "Cinta de Papel p/ Juntas de 76.25m:";
			Book.ActiveSheet.Cells(34,6).Value = document.getElementById("pNumRolCintaL").innerText;
			Book.ActiveSheet.Cells(34,7).Value = "rollo(s)";
			Book.ActiveSheet.Range("A35:D35").MergeCells = "True";
			Book.ActiveSheet.Range("A35:G35").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(35,1).Value = "Compuesto p/ Junta Panel Rey de 21.8KG:";
			Book.ActiveSheet.Cells(35,6).Value = document.getElementById("pNumCompuestoL").innerText;
			Book.ActiveSheet.Cells(35,7).Value = "caja (s)";
			Book.ActiveSheet.Range("A36:D36").MergeCells = "True";
			Book.ActiveSheet.Range("A36:G36").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(36,1).Value = "Aislamiento de Fibra de Vidrio:";
			Book.ActiveSheet.Cells(36,6).Value = document.getElementById("pFibVidL").innerText;
			Book.ActiveSheet.Cells(36,7).Value = "m2";
			//--- Leyenda
			Book.ActiveSheet.Range("A38:G38").MergeCells = "True";
			Book.ActiveSheet.Range("A38:G38").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(38,1).Value = "* Los resultados son aproximaciones";

	
	// Save the sheet.
    var today = new Date();
    var month = today.getMonth()+1;
    var day = today.getDate();
    var year = today.getFullYear();
	var hour = today.getHours();
	var minu = today.getMinutes();
	var sec = today.getSeconds();


	nom="ListaMateriales_"+vTipo.value+"_"+year+month+day+hour+minu+sec+".xls";
	Book.SaveAs("C:\\"+nom);
	
	// Close Excel with the Quit method on the Application object.
	//Excel.Application.Quit();
	alert("Se ha creado el archivo excel en C:\\"+nom);


}



function exportaExcel2(){
	var opener = window.dialogArguments;
    var tblListaMateriales = document.getElementById("ListaMateriales");
	//alert(tblListaMateriales.rows.length);
	var vLong = document.getElementById("pLongD");
	var vAlt = document.getElementById("pAlturaD");
	var vPue = document.getElementById("pPuertasD");
	var vVen = document.getElementById("pVentanasD");	
	var vEsq = document.getElementById("pEsquinasD");
	var vpTipo = document.getElementById("pTipoD");
	var vTipo = document.getElementById("hidTipoCalculo");
	var vslash= /\\/gi;
	var path = window.location.pathname.split("html\\")[0].replace(vslash,"\\\\")+"imagenes\\\\";
	var Excel, Book;	
	var vRen =0;
	
	path = unescape(path.replace(/\+/g,  " "));
	
	// Create the Excel application object.
	Excel = new ActiveXObject("Excel.Application");	
	// Make Excel visible.
	Excel.Visible = true;	
	// Create a new work book.
	Book = Excel.Workbooks.Add();
	//Named
	Book.ActiveSheet.Name = "Lista Materiales";
	// Place some text in the first cell of the sheet.
	//Book.ActiveSheet.Cells(1,1).Value = tblListaMateriales.innerHTML;
	
	//ancho columna
	Book.ActiveSheet.Columns("B:B").ColumnWidth = 10;
	Book.ActiveSheet.Columns("C:C").ColumnWidth = 3;
	Book.ActiveSheet.Columns("E:E").ColumnWidth = 3;
	
	//inserto logo
	Book.ActiveSheet.Range("D1").Select;
	Book.ActiveSheet.Pictures.Insert(path+"logoPR.jpg");
	
	//inserto titulo de resultados
	Book.ActiveSheet.Range("A4").Select;
	Book.ActiveSheet.Pictures.Insert(path+getImgTitulo("MD"));
	
	//seleccion para formato letra
	Book.ActiveSheet.Range("A7:G12").Select;
    Book.ActiveSheet.Range("A7:G12").Font.ColorIndex = 16;
	Book.ActiveSheet.Range("A7:G12").Font.Name="Verdana";
	Book.ActiveSheet.Range("A7:G12").Font.Size="8";
	
	Book.ActiveSheet.Range("B7:B12").HorizontalAlignment = -4152;
	Book.ActiveSheet.Range("B7:B12").VerticalAlignment = -4107;
	
	//pongo Datos
	/*if ((vTipo.value=="MF")||(vTipo.value=="PR")){
		Book.ActiveSheet.Cells(7,2).Value = "Tipo :";
		Book.ActiveSheet.Cells(7,4).Value = vpTipo.innerText;
	}*/
	
	Book.ActiveSheet.Cells(8,2).Value = "Longuitud :";
	Book.ActiveSheet.Cells(8,4).Value = vLong.innerText;
	Book.ActiveSheet.Cells(8,5).Value = "m";
	
	Book.ActiveSheet.Cells(9,2).Value = "Altura :";
	Book.ActiveSheet.Cells(9,4).Value = vAlt.innerText;
	Book.ActiveSheet.Cells(9,5).Value = "m";
	
	Book.ActiveSheet.Cells(10,2).Value = "Puertas :";
	Book.ActiveSheet.Cells(10,4).Value = vPue.innerText;

	Book.ActiveSheet.Cells(11,2).Value = "Ventanas :";
	Book.ActiveSheet.Cells(11,4).Value = vVen.innerText;
	
	Book.ActiveSheet.Cells(12,2).Value = "Esquinas :";
	Book.ActiveSheet.Cells(12,4).Value = vEsq.innerText;
	
	//inserto imagen
	Book.ActiveSheet.Range("A13").Select;
	Book.ActiveSheet.Pictures.Insert(path+"infomuroD.png");
	
	//pongo imagen resultados
	Book.ActiveSheet.Range("A23").Select;
	Book.ActiveSheet.Pictures.Insert(path+"tres.gif");
	
    //Renglones
	
		Book.ActiveSheet.Range("A26:D26").Select;
		Book.ActiveSheet.Range("A26:D50").HorizontalAlignment = -4131;
		Book.ActiveSheet.Range("A26:D50").VerticalAlignment = -4107;
		Book.ActiveSheet.Range("A26:D50").WrapText = "True";
		Book.ActiveSheet.Range("A26:D50").Orientation = 0;
		Book.ActiveSheet.Range("A26:D50").AddIndent = "False";
		Book.ActiveSheet.Range("A26:D50").ShrinkToFit = "False";
		Book.ActiveSheet.Range("A26:G50").Font.ColorIndex = 16;
	    Book.ActiveSheet.Range("A26:G50").Font.Name="Verdana";
	    Book.ActiveSheet.Range("A26:G50").Font.Size="8";		
		Book.ActiveSheet.Range("A26:G50").Interior.Pattern = 1;
		Book.ActiveSheet.Range("A26:G50").Interior.PatternColorIndex = -4105;
		

			Book.ActiveSheet.Range("A26:D26").MergeCells = "True";
			Book.ActiveSheet.Range("A26:G26").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(26,1).Value = "Área";
			Book.ActiveSheet.Cells(26,6).Value = document.getElementById("pAreaTotalD").innerText;
			Book.ActiveSheet.Cells(26,7).Value = "m2";
			Book.ActiveSheet.Range("A27:D27").MergeCells = "True";
			Book.ActiveSheet.Range("A27:G27").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(27,1).Value = "Páneles de Yeso de 1.22 X 2.44m:";
			Book.ActiveSheet.Cells(27,6).Value = document.getElementById("pNumPanelesD").innerText;
			Book.ActiveSheet.Cells(27,7).Value = "pzas.";
			Book.ActiveSheet.Range("A28:D28").MergeCells = "True";
			Book.ActiveSheet.Range("A28:G28").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(28,1).Value = "Postes Metálicos de "+document.getElementById("pTipoPostesD").innerText+"m:";
			Book.ActiveSheet.Cells(28,6).Value = document.getElementById("pNumPostesD").innerText;
			Book.ActiveSheet.Cells(28,7).Value = "pzas.";
			Book.ActiveSheet.Range("A29:D29").MergeCells = "True";
			Book.ActiveSheet.Range("A29:G29").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(29,1).Value = "Canales de Amarre de 3.05m:";
			Book.ActiveSheet.Cells(29,6).Value = document.getElementById("pNumCanalesD").innerText;
			Book.ActiveSheet.Cells(29,7).Value = "pzas.";
			Book.ActiveSheet.Range("A30:D30").MergeCells = "True";
			Book.ActiveSheet.Range("A30:G30").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(30,1).Value = "Esquineros de 2.44m:";
			Book.ActiveSheet.Cells(30,6).Value = document.getElementById("pNumEsquinerosD").innerText;
			Book.ActiveSheet.Cells(30,7).Value = "pzas.";
			Book.ActiveSheet.Range("A31:D31").MergeCells = "True";
			Book.ActiveSheet.Range("A31:G31").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(31,1).Value = "Tornillos Metal – Metal 7 x 7/16”:";
			Book.ActiveSheet.Cells(31,6).Value = document.getElementById("pNumTorPosD").innerText;
			Book.ActiveSheet.Cells(31,7).Value = "pzas.";
			Book.ActiveSheet.Range("A32:D32").MergeCells = "True";
			Book.ActiveSheet.Range("A32:G32").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(32,1).Value = "Tornillos p/Forro 6 X 1 1/8 “:";
			Book.ActiveSheet.Cells(32,6).Value = document.getElementById("pNumTorForD").innerText;
			Book.ActiveSheet.Cells(32,7).Value = "pzas.";
			Book.ActiveSheet.Range("A33:D33").MergeCells = "True";
			Book.ActiveSheet.Range("A33:G33").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(33,1).Value = "Taquetes o Fijadores:";
			Book.ActiveSheet.Cells(33,6).Value = document.getElementById("pNumTaquetesD").innerText;
			Book.ActiveSheet.Cells(33,7).Value = "pzas.";
			Book.ActiveSheet.Range("A34:D34").MergeCells = "True";
			Book.ActiveSheet.Range("A34:G34").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(34,1).Value = "Cinta de Papel p/ Juntas de 76.25m:";
			Book.ActiveSheet.Cells(34,6).Value = document.getElementById("pNumRolCintaD").innerText;
			Book.ActiveSheet.Cells(34,7).Value = "rollo(s)";
			Book.ActiveSheet.Range("A35:D35").MergeCells = "True";
			Book.ActiveSheet.Range("A35:G35").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(35,1).Value = "Compuesto p/ Juntas Panel Rey de 21.8 KG:";
			Book.ActiveSheet.Cells(35,6).Value = document.getElementById("pNumCompuestoD").innerText;
			Book.ActiveSheet.Cells(35,7).Value = "caja (s)";
			Book.ActiveSheet.Range("A36:D36").MergeCells = "True";
			Book.ActiveSheet.Range("A36:G36").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(36,1).Value = "Aislamiento de Fibra de Vidrio:";
			Book.ActiveSheet.Cells(36,6).Value = document.getElementById("pFibVidD").innerText;
			Book.ActiveSheet.Cells(36,7).Value = "m2";
			//--- Leyenda
			Book.ActiveSheet.Range("A38:G38").MergeCells = "True";
			Book.ActiveSheet.Range("A38:G38").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(38,1).Value = "* Los resultados son aproximaciones";

	
	// Save the sheet.
    var today = new Date();
    var month = today.getMonth()+1;
    var day = today.getDate();
    var year = today.getFullYear();
	var hour = today.getHours();
	var minu = today.getMinutes();
	var sec = today.getSeconds();


	nom="ListaMateriales_"+vTipo.value+"_"+year+month+day+hour+minu+sec+".xls";
	Book.SaveAs("C:\\"+nom);
	
	// Close Excel with the Quit method on the Application object.
	//Excel.Application.Quit();
	alert("Se ha creado el archivo excel en C:\\"+nom);


}


function exportaExcelMF2DG(){
	var tblListaMateriales = document.getElementById("ListaMaterialesDG");
					//alert(tblListaMateriales.rows.length);
					var vLong = document.getElementById("pLongDG");
					var vAlt = document.getElementById("pAlturaDG");
					var vPue = document.getElementById("pPuertasDG");
					var vVen = document.getElementById("pVentanasDG");
					var vEsq = document.getElementById("pEsquinasDG");

		

    var vTipo = document.getElementById("hidTipoCalculo");
	var vslash= /\\/gi;
	var path = window.location.pathname.split("html\\")[0].replace(vslash,"\\\\")+"imagenes\\\\";
	var Excel, Book;	
	var vRen =0;
	
	path = unescape(path.replace(/\+/g,  " "));
	
	// Create the Excel application object.
	Excel = new ActiveXObject("Excel.Application");	
	// Make Excel visible.
	Excel.Visible = true;	
	// Create a new work book.
	Book = Excel.Workbooks.Add();
	//Named
	Book.ActiveSheet.Name = "Lista Materiales";
	// Place some text in the first cell of the sheet.
	//Book.ActiveSheet.Cells(1,1).Value = tblListaMateriales.innerHTML;
	
	//ancho columna
	Book.ActiveSheet.Columns("B:B").ColumnWidth = 10;
	Book.ActiveSheet.Columns("C:C").ColumnWidth = 3;
	Book.ActiveSheet.Columns("E:E").ColumnWidth = 3;
	
	//inserto logo
	Book.ActiveSheet.Range("D1").Select;
	Book.ActiveSheet.Pictures.Insert(path+"logoPR.jpg");
	
	//inserto titulo de resultados
	Book.ActiveSheet.Range("A4").Select;
	Book.ActiveSheet.Pictures.Insert(path+getImgTitulo("MF"));
	
	//seleccion para formato letra
	Book.ActiveSheet.Range("A7:G12").Select;
    Book.ActiveSheet.Range("A7:G12").Font.ColorIndex = 16;
	Book.ActiveSheet.Range("A7:G12").Font.Name="Verdana";
	Book.ActiveSheet.Range("A7:G12").Font.Size="8";
	
	Book.ActiveSheet.Range("B7:B12").HorizontalAlignment = -4152;
	Book.ActiveSheet.Range("B7:B12").VerticalAlignment = -4107;
	
	
	
		Book.ActiveSheet.Cells(7,2).Value = "Tipo :";
		
				Book.ActiveSheet.Cells(7,4).Value = document.getElementById("pTipoPanelDG").innerText;
		
	
	Book.ActiveSheet.Cells(8,2).Value = "Longuitud :";
	Book.ActiveSheet.Cells(8,4).Value = vLong.innerText;
	Book.ActiveSheet.Cells(8,5).Value = "m";
	
	Book.ActiveSheet.Cells(9,2).Value = "Altura :";
	Book.ActiveSheet.Cells(9,4).Value = vAlt.innerText;
	Book.ActiveSheet.Cells(9,5).Value = "m";
	
	Book.ActiveSheet.Cells(10,2).Value = "Puertas :";
	Book.ActiveSheet.Cells(10,4).Value = vPue.innerText;

	Book.ActiveSheet.Cells(11,2).Value = "Ventanas :";
	Book.ActiveSheet.Cells(11,4).Value = vVen.innerText;
	
	Book.ActiveSheet.Cells(12,2).Value = "Esquinas :";
	Book.ActiveSheet.Cells(12,4).Value = vEsq.innerText;
	
	//inserto imagen
	Book.ActiveSheet.Range("A13").Select;
	Book.ActiveSheet.Pictures.Insert(path+"infomuroFD.png");
	
	//pongo imagen resultados
	Book.ActiveSheet.Range("A23").Select;
	Book.ActiveSheet.Pictures.Insert(path+"tres.gif");
	
    //Renglones
	
		Book.ActiveSheet.Range("A26:D26").Select;
		Book.ActiveSheet.Range("A26:D50").HorizontalAlignment = -4131;
		Book.ActiveSheet.Range("A26:D50").VerticalAlignment = -4107;
		Book.ActiveSheet.Range("A26:D50").WrapText = "True";
		Book.ActiveSheet.Range("A26:D50").Orientation = 0;
		Book.ActiveSheet.Range("A26:D50").AddIndent = "False";
		Book.ActiveSheet.Range("A26:D50").ShrinkToFit = "False";
		Book.ActiveSheet.Range("A26:G50").Font.ColorIndex = 16;
	    Book.ActiveSheet.Range("A26:G50").Font.Name="Verdana";
	    Book.ActiveSheet.Range("A26:G50").Font.Size="8";		
		Book.ActiveSheet.Range("A26:G50").Interior.Pattern = 1;
		Book.ActiveSheet.Range("A26:G50").Interior.PatternColorIndex = -4105;
		

			Book.ActiveSheet.Range("A26:D26").MergeCells = "True";
			Book.ActiveSheet.Range("A26:G26").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(26,1).Value = "Área";
			Book.ActiveSheet.Cells(26,6).Value = document.getElementById("pAreaTotalDG").innerText;
			Book.ActiveSheet.Cells(26,7).Value = "m2";
			Book.ActiveSheet.Range("A27:D27").MergeCells = "True";
			Book.ActiveSheet.Range("A27:G27").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(27,1).Value = "Páneles Denss Glass de 1.22 X 2.44m:";
			Book.ActiveSheet.Cells(27,6).Value = document.getElementById("pNumPanelesDG").innerText;
			Book.ActiveSheet.Cells(27,7).Value = "pzas.";
			Book.ActiveSheet.Range("A28:D28").MergeCells = "True";
			Book.ActiveSheet.Range("A28:G28").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(28,1).Value = "Poste Viga Cal. 22 de 3.05m:";
			Book.ActiveSheet.Cells(28,6).Value = document.getElementById("pNumPostesDG").innerText;
			Book.ActiveSheet.Cells(28,7).Value = "pzas.";
			Book.ActiveSheet.Range("A29:D29").MergeCells = "True";
			Book.ActiveSheet.Range("A29:G29").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(29,1).Value = "Canales CC Cal. 22 de 3.96m:";
			Book.ActiveSheet.Cells(29,6).Value = document.getElementById("pNumCanalesDG").innerText;
			Book.ActiveSheet.Cells(29,7).Value = "pzas.";
			Book.ActiveSheet.Range("A30:D30").MergeCells = "True";
			Book.ActiveSheet.Range("A30:G30").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(30,1).Value = "Esquineros de 2.44m:";
			Book.ActiveSheet.Cells(30,6).Value = document.getElementById("pNumEsquinerosDG").innerText;
			Book.ActiveSheet.Cells(30,7).Value = "pzas.";
			Book.ActiveSheet.Range("A31:D31").MergeCells = "True";
			Book.ActiveSheet.Range("A31:G31").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(31,1).Value = "Tornillos Metal – Metal 7 x 7/16”:";
			Book.ActiveSheet.Cells(31,6).Value = document.getElementById("pNumTorPosDG").innerText;
			Book.ActiveSheet.Cells(31,7).Value = "pzas.";
			Book.ActiveSheet.Range("A32:D32").MergeCells = "True";
			Book.ActiveSheet.Range("A32:G32").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(32,1).Value = "Tornillos p/Forro 6 X 1 1/8 “:";
			Book.ActiveSheet.Cells(32,6).Value = document.getElementById("pNumTorForDG").innerText;
			Book.ActiveSheet.Cells(32,7).Value = "pzas.";
			Book.ActiveSheet.Range("A33:D33").MergeCells = "True";
			Book.ActiveSheet.Range("A33:G33").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(33,1).Value = "Taquetes o Fijadores:";
			Book.ActiveSheet.Cells(33,6).Value = document.getElementById("pNumTaquetesDG").innerText;
			Book.ActiveSheet.Cells(33,7).Value = "pzas.";
			Book.ActiveSheet.Range("A34:D34").MergeCells = "True";
			Book.ActiveSheet.Range("A34:G34").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(34,1).Value = "Cinta de Papel p/ Juntas de 76.25m:";
			Book.ActiveSheet.Cells(34,6).Value = document.getElementById("pNumRolCintaDG").innerText;
			Book.ActiveSheet.Cells(34,7).Value = "rollo(s)";
			Book.ActiveSheet.Range("A35:D35").MergeCells = "True";
			Book.ActiveSheet.Range("A35:G35").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(35,1).Value = "Recubrimiento Base Panel Rey de 22.7KG:";
			Book.ActiveSheet.Cells(35,6).Value = document.getElementById("pNumRecubrimientoDG").innerText;
			Book.ActiveSheet.Cells(35,7).Value = "caja (s)";
			Book.ActiveSheet.Range("A36:D36").MergeCells = "True";
			Book.ActiveSheet.Range("A36:G36").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(36,1).Value = "Aislamiento de Fibra de Vidrio:";
			Book.ActiveSheet.Cells(36,6).Value = document.getElementById("pFibVidDG").innerText;
			Book.ActiveSheet.Cells(36,7).Value = "m2";
			Book.ActiveSheet.Range("A37:D37").MergeCells = "True";
			Book.ActiveSheet.Range("A37:G37").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(37,1).Value = "Malla de Fibra de Vidro:";
			Book.ActiveSheet.Cells(37,6).Value = document.getElementById("pFibVidDGM").innerText;
			Book.ActiveSheet.Cells(37,7).Value = "m2";
			Book.ActiveSheet.Range("A38:D38").MergeCells = "True";
			Book.ActiveSheet.Range("A38:G38").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(38,1).Value = "Paneles de Yeso de 1.22 X 2.44m:";
			Book.ActiveSheet.Cells(38,6).Value = document.getElementById("pNumPanelesStdDG").innerText;
			Book.ActiveSheet.Cells(38,7).Value = "pzas.";
			Book.ActiveSheet.Range("A39:D39").MergeCells = "True";
			Book.ActiveSheet.Range("A39:G39").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(39,1).Value = "Cinta de Fibra de Vidro:";
			Book.ActiveSheet.Cells(39,6).Value = document.getElementById("pCintaFibVidDG").innerText;
			Book.ActiveSheet.Cells(39,7).Value = "rollo (s)";
			Book.ActiveSheet.Range("A40:D40").MergeCells = "True";
			Book.ActiveSheet.Range("A40:G40").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(40,1).Value = "Compuesto p/ Juntas Panel Rey de 21.8KG:";
			Book.ActiveSheet.Cells(40,6).Value = document.getElementById("pCompuestoDG").innerText;
			Book.ActiveSheet.Cells(40,7).Value = "caja (s)";
			Book.ActiveSheet.Range("A41:D41").MergeCells = "True";
			Book.ActiveSheet.Range("A41:G41").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(41,1).Value = "Reborde J de 3.05m:";
			Book.ActiveSheet.Cells(41,6).Value = document.getElementById("pRebordeDG").innerText;
			Book.ActiveSheet.Cells(41,7).Value = "caja (s)";
			//--- Leyenda
			Book.ActiveSheet.Range("A43:G43").MergeCells = "True";
			Book.ActiveSheet.Range("A43:G43").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(43,1).Value = "* Los resultados son aproximaciones";
		
	
	// Save the sheet.
    var today = new Date();
    var month = today.getMonth()+1;
    var day = today.getDate();
    var year = today.getFullYear();
	var hour = today.getHours();
	var minu = today.getMinutes();
	var sec = today.getSeconds();


	nom="ListaMateriales_"+vTipo.value+"_"+year+month+day+hour+minu+sec+".xls";
	Book.SaveAs("C:\\"+nom);
	
	// Close Excel with the Quit method on the Application object.
	//Excel.Application.Quit();
	alert("Se ha creado el archivo excel en C:\\"+nom);


}

function exportaExcelMF2DGN(){
	var tblListaMateriales = document.getElementById("ListaMaterialesDGN");
					//alert(tblListaMateriales.rows.length);
					var vLong = document.getElementById("pLongDGN");
					var vAlt = document.getElementById("pAlturaDGN");
					var vPue = document.getElementById("pPuertasDGN");
					var vVen = document.getElementById("pVentanasDGN");
					var vEsq = document.getElementById("pEsquinasDGN");

    var vTipo = document.getElementById("hidTipoCalculo");
	var vslash= /\\/gi;
	var path = window.location.pathname.split("html\\")[0].replace(vslash,"\\\\")+"imagenes\\\\";
	var Excel, Book;	
	var vRen =0;
	
	path = unescape(path.replace(/\+/g,  " "));
	
	// Create the Excel application object.
	Excel = new ActiveXObject("Excel.Application");	
	// Make Excel visible.
	Excel.Visible = true;	
	// Create a new work book.
	Book = Excel.Workbooks.Add();
	//Named
	Book.ActiveSheet.Name = "Lista Materiales";
	// Place some text in the first cell of the sheet.
	//Book.ActiveSheet.Cells(1,1).Value = tblListaMateriales.innerHTML;
	
	//ancho columna
	Book.ActiveSheet.Columns("B:B").ColumnWidth = 10;
	Book.ActiveSheet.Columns("C:C").ColumnWidth = 3;
	Book.ActiveSheet.Columns("E:E").ColumnWidth = 3;
	
	//inserto logo
	Book.ActiveSheet.Range("D1").Select;
	Book.ActiveSheet.Pictures.Insert(path+"logoPR.jpg");
	
	//inserto titulo de resultados
	Book.ActiveSheet.Range("A4").Select;
	Book.ActiveSheet.Pictures.Insert(path+getImgTitulo("MF"));
	
	//seleccion para formato letra
	Book.ActiveSheet.Range("A7:G12").Select;
    Book.ActiveSheet.Range("A7:G12").Font.ColorIndex = 16;
	Book.ActiveSheet.Range("A7:G12").Font.Name="Verdana";
	Book.ActiveSheet.Range("A7:G12").Font.Size="8";
	
	Book.ActiveSheet.Range("B7:B12").HorizontalAlignment = -4152;
	Book.ActiveSheet.Range("B7:B12").VerticalAlignment = -4107;
	
	
	
		Book.ActiveSheet.Cells(7,2).Value = "Tipo :";
		
				Book.ActiveSheet.Cells(7,4).Value = document.getElementById("pTipoPanelDGN").innerText;
		
	
	Book.ActiveSheet.Cells(8,2).Value = "Longuitud :";
	Book.ActiveSheet.Cells(8,4).Value = vLong.innerText;
	Book.ActiveSheet.Cells(8,5).Value = "m";
	
	Book.ActiveSheet.Cells(9,2).Value = "Altura :";
	Book.ActiveSheet.Cells(9,4).Value = vAlt.innerText;
	Book.ActiveSheet.Cells(9,5).Value = "m";
	
	Book.ActiveSheet.Cells(10,2).Value = "Puertas :";
	Book.ActiveSheet.Cells(10,4).Value = vPue.innerText;

	Book.ActiveSheet.Cells(11,2).Value = "Ventanas :";
	Book.ActiveSheet.Cells(11,4).Value = vVen.innerText;
	
	Book.ActiveSheet.Cells(12,2).Value = "Esquinas :";
	Book.ActiveSheet.Cells(12,4).Value = vEsq.innerText;
	
	//inserto imagen
	Book.ActiveSheet.Range("A13").Select;
	Book.ActiveSheet.Pictures.Insert(path+"infomuroFD.png");
	//pongo imagen resultados
	Book.ActiveSheet.Range("A23").Select;
	Book.ActiveSheet.Pictures.Insert(path+"tres.gif");
	
    //Renglones
	
		Book.ActiveSheet.Range("A26:D26").Select;
		Book.ActiveSheet.Range("A26:D50").HorizontalAlignment = -4131;
		Book.ActiveSheet.Range("A26:D50").VerticalAlignment = -4107;
		Book.ActiveSheet.Range("A26:D50").WrapText = "True";
		Book.ActiveSheet.Range("A26:D50").Orientation = 0;
		Book.ActiveSheet.Range("A26:D50").AddIndent = "False";
		Book.ActiveSheet.Range("A26:D50").ShrinkToFit = "False";
		Book.ActiveSheet.Range("A26:G50").Font.ColorIndex = 16;
	    Book.ActiveSheet.Range("A26:G50").Font.Name="Verdana";
	    Book.ActiveSheet.Range("A26:G50").Font.Size="8";		
		Book.ActiveSheet.Range("A26:G50").Interior.Pattern = 1;
		Book.ActiveSheet.Range("A26:G50").Interior.PatternColorIndex = -4105;
		

			Book.ActiveSheet.Range("A26:D26").MergeCells = "True";
			Book.ActiveSheet.Range("A26:G26").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(26,1).Value = "Área";
			Book.ActiveSheet.Cells(26,6).Value = document.getElementById("pAreaTotalDGN").innerText;
			Book.ActiveSheet.Cells(26,7).Value = "m2";
			Book.ActiveSheet.Range("A27:D27").MergeCells = "True";
			Book.ActiveSheet.Range("A27:G27").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(27,1).Value = "Páneles Denss Glass de 1.22 X 2.44m:";
			Book.ActiveSheet.Cells(27,6).Value = document.getElementById("pNumPanelesDGN").innerText;
			Book.ActiveSheet.Cells(27,7).Value = "pzas.";
			Book.ActiveSheet.Range("A28:D28").MergeCells = "True";
			Book.ActiveSheet.Range("A28:G28").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(28,1).Value = "Poste Viga Cal. 22 de 3.05m:";
			Book.ActiveSheet.Cells(28,6).Value = document.getElementById("pNumPostesDGN").innerText;
			Book.ActiveSheet.Cells(28,7).Value = "pzas.";
			Book.ActiveSheet.Range("A29:D29").MergeCells = "True";
			Book.ActiveSheet.Range("A29:G29").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(29,1).Value = "Canales CC Cal. 22 de 3.96m:";
			Book.ActiveSheet.Cells(29,6).Value = document.getElementById("pNumCanalesDGN").innerText;
			Book.ActiveSheet.Cells(29,7).Value = "pzas.";
			Book.ActiveSheet.Range("A30:D30").MergeCells = "True";
			Book.ActiveSheet.Range("A30:G30").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(30,1).Value = "Esquineros de 2.44m:";
			Book.ActiveSheet.Cells(30,6).Value = document.getElementById("pNumEsquinerosDGN").innerText;
			Book.ActiveSheet.Cells(30,7).Value = "pzas.";
			Book.ActiveSheet.Range("A31:D31").MergeCells = "True";
			Book.ActiveSheet.Range("A31:G31").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(31,1).Value = "Tornillos Metal – Metal 7 x 7/16”:";
			Book.ActiveSheet.Cells(31,6).Value = document.getElementById("pNumTorPosDGN").innerText;
			Book.ActiveSheet.Cells(31,7).Value = "pzas.";
			Book.ActiveSheet.Range("A32:D32").MergeCells = "True";
			Book.ActiveSheet.Range("A32:G32").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(32,1).Value = "Tornillos p/Forro 6 X 1 1/8 “:";
			Book.ActiveSheet.Cells(32,6).Value = document.getElementById("pNumTorForDGN").innerText;
			Book.ActiveSheet.Cells(32,7).Value = "pzas.";
			Book.ActiveSheet.Range("A33:D33").MergeCells = "True";
			Book.ActiveSheet.Range("A33:G33").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(33,1).Value = "Taquetes o Fijadores:";
			Book.ActiveSheet.Cells(33,6).Value = document.getElementById("pNumTaquetesDGN").innerText;
			Book.ActiveSheet.Cells(33,7).Value = "pzas.";
			Book.ActiveSheet.Range("A34:D34").MergeCells = "True";
			Book.ActiveSheet.Range("A34:G34").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(34,1).Value = "Cinta de Papel p/ Juntas de 76.25m:";
			Book.ActiveSheet.Cells(34,6).Value = document.getElementById("pNumRolCintaDGN").innerText;
			Book.ActiveSheet.Cells(34,7).Value = "rollo(s)";
			Book.ActiveSheet.Range("A35:D35").MergeCells = "True";
			Book.ActiveSheet.Range("A35:G35").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(35,1).Value = "Recubrimiento Base Panel Rey de 21.8KG:";
			Book.ActiveSheet.Cells(35,6).Value = document.getElementById("pNumRecubrimientoDGN").innerText;
			Book.ActiveSheet.Cells(35,7).Value = "caja (s)";
			Book.ActiveSheet.Range("A36:D36").MergeCells = "True";
			Book.ActiveSheet.Range("A36:G36").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(36,1).Value = "Aislamiento de Fibra de Vidrio:";
			Book.ActiveSheet.Cells(36,6).Value = document.getElementById("pFibVidDGN").innerText;
			Book.ActiveSheet.Cells(36,7).Value = "m2";
			Book.ActiveSheet.Range("A37:D37").MergeCells = "True";
			Book.ActiveSheet.Range("A37:G37").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(37,1).Value = "Malla de Fibra de Vidro:";
			Book.ActiveSheet.Cells(37,6).Value = document.getElementById("pFibVidDGNM").innerText;
			Book.ActiveSheet.Cells(37,7).Value = "m2";
			Book.ActiveSheet.Range("A38:D38").MergeCells = "True";
			Book.ActiveSheet.Range("A38:G38").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(38,1).Value = "Paneles de Yeso de 1.22 X 2.44m:";
			Book.ActiveSheet.Cells(38,6).Value = document.getElementById("pNumPanelesStdDGN").innerText;
			Book.ActiveSheet.Cells(38,7).Value = "pzas.";
			Book.ActiveSheet.Range("A39:D39").MergeCells = "True";
			Book.ActiveSheet.Range("A39:G39").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(39,1).Value = "Cinta de Fibra de Vidro:";
			Book.ActiveSheet.Cells(39,6).Value = document.getElementById("pCintaFibVidDGN").innerText;
			Book.ActiveSheet.Cells(39,7).Value = "rollo (s)";
			Book.ActiveSheet.Range("A40:D40").MergeCells = "True";
			Book.ActiveSheet.Range("A40:G40").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(40,1).Value = "Compuesto p/ Juntas Panel Rey de 21.8KG:";
			Book.ActiveSheet.Cells(40,6).Value = document.getElementById("pCompuestoDGN").innerText;
			Book.ActiveSheet.Cells(40,7).Value = "caja (s)";
			Book.ActiveSheet.Range("A41:D41").MergeCells = "True";
			Book.ActiveSheet.Range("A41:G41").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(41,1).Value = "Reborde J de 3.05m:";
			Book.ActiveSheet.Cells(41,6).Value = document.getElementById("pRebordeDGN").innerText;
			Book.ActiveSheet.Cells(41,7).Value = "caja (s)";
			//--- Leyenda
			Book.ActiveSheet.Range("A43:G43").MergeCells = "True";
			Book.ActiveSheet.Range("A43:G43").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(43,1).Value = "* Los resultados son aproximaciones";
		
	
	// Save the sheet.
    var today = new Date();
    var month = today.getMonth()+1;
    var day = today.getDate();
    var year = today.getFullYear();
	var hour = today.getHours();
	var minu = today.getMinutes();
	var sec = today.getSeconds();


	nom="ListaMateriales_"+vTipo.value+"_"+year+month+day+hour+minu+sec+".xls";
	Book.SaveAs("C:\\"+nom);
	
	// Close Excel with the Quit method on the Application object.
	//Excel.Application.Quit();
	alert("Se ha creado el archivo excel en C:\\"+nom);


}

function exportaExcelMF2PB(){
	
		 var tblListaMateriales = document.getElementById("ListaMaterialesPB");
					//alert(tblListaMateriales.rows.length);
					var vLong = document.getElementById("pLongPB");
					var vAlt = document.getElementById("pAlturaPB");
					var vPue = document.getElementById("pPuertasPB");
					var vVen = document.getElementById("pVentanasPB");
					var vEsq = document.getElementById("pEsquinasPB");
		

    var vTipo = document.getElementById("hidTipoCalculo");
	var vslash= /\\/gi;
	var path = window.location.pathname.split("html\\")[0].replace(vslash,"\\\\")+"imagenes\\\\";
	var Excel, Book;	
	var vRen =0;
	
	path = unescape(path.replace(/\+/g,  " "));
	
	// Create the Excel application object.
	Excel = new ActiveXObject("Excel.Application");	
	// Make Excel visible.
	Excel.Visible = true;	
	// Create a new work book.
	Book = Excel.Workbooks.Add();
	//Named
	Book.ActiveSheet.Name = "Lista Materiales";
	// Place some text in the first cell of the sheet.
	//Book.ActiveSheet.Cells(1,1).Value = tblListaMateriales.innerHTML;
	
	//ancho columna
	Book.ActiveSheet.Columns("B:B").ColumnWidth = 10;
	Book.ActiveSheet.Columns("C:C").ColumnWidth = 3;
	Book.ActiveSheet.Columns("E:E").ColumnWidth = 3;
	
	//inserto logo
	Book.ActiveSheet.Range("D1").Select;
	Book.ActiveSheet.Pictures.Insert(path+"logoPR.jpg");
	
	
	//inserto titulo de resultados
	Book.ActiveSheet.Range("A4").Select;
	Book.ActiveSheet.Pictures.Insert(path+getImgTitulo("MF"));
	
	//seleccion para formato letra
	Book.ActiveSheet.Range("A7:G12").Select;
    Book.ActiveSheet.Range("A7:G12").Font.ColorIndex = 16;
	Book.ActiveSheet.Range("A7:G12").Font.Name="Verdana";
	Book.ActiveSheet.Range("A7:G12").Font.Size="8";
	
	Book.ActiveSheet.Range("B7:B12").HorizontalAlignment = -4152;
	Book.ActiveSheet.Range("B7:B12").VerticalAlignment = -4107;
	
	
	//pongo Datos
	
		Book.ActiveSheet.Cells(7,2).Value = "Tipo :";
		
			    Book.ActiveSheet.Cells(7,4).Value = document.getElementById("pTipoPanelPB").innerText;
		
	
	Book.ActiveSheet.Cells(8,2).Value = "Longuitud :";
	Book.ActiveSheet.Cells(8,4).Value = vLong.innerText;
	Book.ActiveSheet.Cells(8,5).Value = "m";
	
	Book.ActiveSheet.Cells(9,2).Value = "Altura :";
	Book.ActiveSheet.Cells(9,4).Value = vAlt.innerText;
	Book.ActiveSheet.Cells(9,5).Value = "m";
	
	Book.ActiveSheet.Cells(10,2).Value = "Puertas :";
	Book.ActiveSheet.Cells(10,4).Value = vPue.innerText;

	Book.ActiveSheet.Cells(11,2).Value = "Ventanas :";
	Book.ActiveSheet.Cells(11,4).Value = vVen.innerText;

	Book.ActiveSheet.Cells(12,2).Value = "Ventanas :";
	Book.ActiveSheet.Cells(12,4).Value = vVen.innerText;
	
	//inserto imagen
	Book.ActiveSheet.Range("A13").Select;
	Book.ActiveSheet.Pictures.Insert(path+"infomuroFP.png");
	
	
	//pongo imagen resultados
	Book.ActiveSheet.Range("A23").Select;
	Book.ActiveSheet.Pictures.Insert(path+"tres.gif");
	
    //Renglones
	
		Book.ActiveSheet.Range("A26:D26").Select;
		Book.ActiveSheet.Range("A26:D50").HorizontalAlignment = -4131;
		Book.ActiveSheet.Range("A26:D50").VerticalAlignment = -4107;
		Book.ActiveSheet.Range("A26:D50").WrapText = "True";
		Book.ActiveSheet.Range("A26:D50").Orientation = 0;
		Book.ActiveSheet.Range("A26:D50").AddIndent = "False";
		Book.ActiveSheet.Range("A26:D50").ShrinkToFit = "False";
		Book.ActiveSheet.Range("A26:G50").Font.ColorIndex = 16;
	    Book.ActiveSheet.Range("A26:G50").Font.Name="Verdana";
	    Book.ActiveSheet.Range("A26:G50").Font.Size="8";		
		Book.ActiveSheet.Range("A26:G50").Interior.Pattern = 1;
		Book.ActiveSheet.Range("A26:G50").Interior.PatternColorIndex = -4105;
		
		
			Book.ActiveSheet.Range("A26:D26").MergeCells = "True";
			Book.ActiveSheet.Range("A26:G26").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(26,1).Value = "Área";
			Book.ActiveSheet.Cells(26,6).Value = document.getElementById("pAreaTotalPB").innerText;
			Book.ActiveSheet.Cells(26,7).Value = "m2";
			Book.ActiveSheet.Range("A27:D27").MergeCells = "True";
			Book.ActiveSheet.Range("A27:G27").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(27,1).Value = "Páneles Permabase de 1.22 X 2.44m:";
			Book.ActiveSheet.Cells(27,6).Value = document.getElementById("pNumPanelesPB").innerText;
			Book.ActiveSheet.Cells(27,7).Value = "pzas.";
			Book.ActiveSheet.Range("A28:D28").MergeCells = "True";
			Book.ActiveSheet.Range("A28:G28").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(28,1).Value = "Poste Viga Cal. 20 de 3.05m:";
			Book.ActiveSheet.Cells(28,6).Value = document.getElementById("pNumPostesPB").innerText;
			Book.ActiveSheet.Cells(28,7).Value = "pzas.";
			Book.ActiveSheet.Range("A29:D29").MergeCells = "True";
			Book.ActiveSheet.Range("A29:G29").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(29,1).Value = "Canales CC Cal. 22 de 3.96m:";
			Book.ActiveSheet.Cells(29,6).Value = document.getElementById("pNumCanalesPB").innerText;
			Book.ActiveSheet.Cells(29,7).Value = "pzas.";
			Book.ActiveSheet.Range("A30:D30").MergeCells = "True";
			Book.ActiveSheet.Range("A30:G30").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(30,1).Value = "Esquineros de 2.44m:";
			Book.ActiveSheet.Cells(30,6).Value = document.getElementById("pNumEsquinerosPB").innerText;
			Book.ActiveSheet.Cells(30,7).Value = "pzas.";
			Book.ActiveSheet.Range("A31:D31").MergeCells = "True";
			Book.ActiveSheet.Range("A31:G31").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(31,1).Value = "Tornillos Metal – Metal 7 x 7/16”:";
			Book.ActiveSheet.Cells(31,6).Value = document.getElementById("pNumTorPosPB").innerText;
			Book.ActiveSheet.Cells(31,7).Value = "pzas.";
			Book.ActiveSheet.Range("A32:D32").MergeCells = "True";
			Book.ActiveSheet.Range("A32:G32").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(32,1).Value = "Tornillos p/Forro 6 X 1 1/8 “:";
			Book.ActiveSheet.Cells(32,6).Value = document.getElementById("pNumTorForPB").innerText;
			Book.ActiveSheet.Cells(32,7).Value = "pzas.";
			Book.ActiveSheet.Range("A33:D33").MergeCells = "True";
			Book.ActiveSheet.Range("A33:G33").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(33,1).Value = "Cinta de Papel p/ Juntas de 76.25m:";
			Book.ActiveSheet.Cells(33,6).Value = document.getElementById("pNumRolCintaPB").innerText;
			Book.ActiveSheet.Cells(33,7).Value = "rollo(s)";
			Book.ActiveSheet.Range("A34:D34").MergeCells = "True";
			Book.ActiveSheet.Range("A34:G34").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(34,1).Value = "Recubrimiento Base Panel Rey de 22.7KG:";
			Book.ActiveSheet.Cells(34,6).Value = document.getElementById("pNumRecubrimientoPB").innerText;
			Book.ActiveSheet.Cells(34,7).Value = "caja (s)";
			Book.ActiveSheet.Range("A35:D35").MergeCells = "True";
			Book.ActiveSheet.Range("A35:G35").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(35,1).Value = "Aislamiento de Fibra de Vidrio:";
			Book.ActiveSheet.Cells(35,6).Value = document.getElementById("pFibVidPB").innerText;
			Book.ActiveSheet.Cells(35,7).Value = "m2";
			Book.ActiveSheet.Range("A36:D36").MergeCells = "True";
			Book.ActiveSheet.Range("A36:G36").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(36,1).Value = "Taquetes o Fijadores:";
			Book.ActiveSheet.Cells(36,6).Value = document.getElementById("pNumTaquetesPB").innerText;
			Book.ActiveSheet.Cells(36,7).Value = "pzas.";
			Book.ActiveSheet.Range("A37:D37").MergeCells = "True";
			Book.ActiveSheet.Range("A37:G37").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(37,1).Value = "Malla de Fibra de Vidro:";
			Book.ActiveSheet.Cells(37,6).Value = document.getElementById("pFibVidPBM").innerText;
			Book.ActiveSheet.Cells(37,7).Value = "m2";
			Book.ActiveSheet.Range("A38:D38").MergeCells = "True";
			Book.ActiveSheet.Range("A38:G38").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(38,1).Value = "Paneles de Yeso de 1.22 X 2.44m:";
			Book.ActiveSheet.Cells(38,6).Value = document.getElementById("pNumPanelesStdPB").innerText;
			Book.ActiveSheet.Cells(38,7).Value = "pzas.";
			Book.ActiveSheet.Range("A39:D39").MergeCells = "True";
			Book.ActiveSheet.Range("A39:G39").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(39,1).Value = "Cinta de Fibra de Vidrio de 3“ x 45m:";
			Book.ActiveSheet.Cells(39,6).Value = document.getElementById("pCintaFibVidPB").innerText;
			Book.ActiveSheet.Cells(39,7).Value = "rollo (s)";
			Book.ActiveSheet.Range("A40:D40").MergeCells = "True";
			Book.ActiveSheet.Range("A40:G40").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(40,1).Value = "Compuesto p/ Juntas Panel Rey de 21.8KG:";
			Book.ActiveSheet.Cells(40,6).Value = document.getElementById("pNumCompuestoPB").innerText;
			Book.ActiveSheet.Cells(40,7).Value = "caja (s)";
			Book.ActiveSheet.Range("A41:D41").MergeCells = "True";
			Book.ActiveSheet.Range("A41:G41").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(41,1).Value = "Reborde J de 3.05m:";
			Book.ActiveSheet.Cells(41,6).Value = document.getElementById("pRebordePB").innerText;
			Book.ActiveSheet.Cells(41,7).Value = "caja (s)";
			Book.ActiveSheet.Range("A42:D42").MergeCells = "True";
			Book.ActiveSheet.Range("A42:G42").Interior.ColorIndex =37;
			Book.ActiveSheet.Cells(42,1).Value = "Tornillo p/ Forro p/ Permabase:";
			Book.ActiveSheet.Cells(42,6).Value = document.getElementById("pNumTorForroPermaPB").innerText;
			Book.ActiveSheet.Cells(42,7).Value = "caja (s)";
			Book.ActiveSheet.Range("A43:D43").MergeCells = "True";
			Book.ActiveSheet.Range("A43:G43").Interior.ColorIndex =0;
			Book.ActiveSheet.Cells(43,1).Value = "Tyvek Barrera de Vapor:";
			Book.ActiveSheet.Cells(43,6).Value = document.getElementById("pTyvekPB").innerText;
			Book.ActiveSheet.Cells(43,7).Value = "m2.";
			//--- Leyenda
			Book.ActiveSheet.Range("A45:G45").MergeCells = "True";
			Book.ActiveSheet.Range("A45:G45").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(45,1).Value = "* Los resultados son aproximaciones";
		
	
	// Save the sheet.
    var today = new Date();
    var month = today.getMonth()+1;
    var day = today.getDate();
    var year = today.getFullYear();
	var hour = today.getHours();
	var minu = today.getMinutes();
	var sec = today.getSeconds();


	nom="ListaMateriales_"+vTipo.value+"_"+year+month+day+hour+minu+sec+".xls";
	Book.SaveAs("C:\\"+nom);
	
	// Close Excel with the Quit method on the Application object.
	//Excel.Application.Quit();
	alert("Se ha creado el archivo excel en C:\\"+nom);


}

/********Detalles Arquitectonicos************/

/*
*
*/
function exportaExcelB(){
	
	var vslash= /\\/gi;
	var path = window.location.pathname.split("html\\")[0].replace(vslash,"\\\\")+"imagenes\\\\";
	var Excel, Book;	
	var vRen =0;
	
	path = unescape(path.replace(/\+/g,  " "));
	
	// Create the Excel application object.
	Excel = new ActiveXObject("Excel.Application");	
	// Make Excel visible.
	Excel.Visible = true;	
	// Create a new work book.
	Book = Excel.Workbooks.Add();
	//Named
	Book.ActiveSheet.Name = "Lista Materiales";
	// Place some text in the first cell of the sheet.
	//Book.ActiveSheet.Cells(1,1).Value = tblListaMateriales.innerHTML;
	
	//ancho columna
	Book.ActiveSheet.Columns("B:B").ColumnWidth = 10;
	Book.ActiveSheet.Columns("C:C").ColumnWidth = 3;
	Book.ActiveSheet.Columns("E:E").ColumnWidth = 3;
	
	//inserto logo
	Book.ActiveSheet.Range("D1").Select;
	Book.ActiveSheet.Pictures.Insert(path+"logoPR.jpg");
	
	//inserto titulo de resultados
	Book.ActiveSheet.Range("A4").Select;
	Book.ActiveSheet.Pictures.Insert(path+"dboveda.gif");
	
	//seleccion para formato letra
	Book.ActiveSheet.Range("A27:G29").Select;
    Book.ActiveSheet.Range("A27:G29").Font.ColorIndex = 2;
	Book.ActiveSheet.Range("A27:G29").Font.Name="Verdana";
	Book.ActiveSheet.Range("A27:G29").Font.Size="8";
	Book.ActiveSheet.Range("A27:G29").Interior.ColorIndex = 11;
	
	//Material
	Book.ActiveSheet.Cells(27,1).Value = "Material para Bóveda de 2m de diámetro x ";
	Book.ActiveSheet.Cells(28,1).Value = "1m de altura";

    //Renglones
	
		Book.ActiveSheet.Range("A30:G16").Select;
		Book.ActiveSheet.Range("A30:G39").HorizontalAlignment = -4131;
		Book.ActiveSheet.Range("A30:G39").VerticalAlignment = -4107;
		Book.ActiveSheet.Range("A30:G39").WrapText = "True";
		Book.ActiveSheet.Range("A30:G39").Orientation = 0;
		Book.ActiveSheet.Range("A30:G39").AddIndent = "False";
		Book.ActiveSheet.Range("A30:G39").ShrinkToFit = "False";
		Book.ActiveSheet.Range("A30:G39").Font.ColorIndex = 16;
	    Book.ActiveSheet.Range("A30:G39").Font.Name="Verdana";
	    Book.ActiveSheet.Range("A30:G39").Font.Size="8";		
		Book.ActiveSheet.Range("A30:G39").Interior.Pattern = 1;
		Book.ActiveSheet.Range("A30:G39").Interior.PatternColorIndex = -4105;
		
		
			Book.ActiveSheet.Range("A30:D30").MergeCells = "True";
			Book.ActiveSheet.Range("A30:G30").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(30,1).Value = "Páneles de Yeso de 1.22 X 2.44m:";
			Book.ActiveSheet.Cells(30,6).Value = "4";
			Book.ActiveSheet.Cells(30,7).Value = "pzas.";
			Book.ActiveSheet.Range("A31:D31").MergeCells = "True";
			Book.ActiveSheet.Range("A31:G31").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(31,1).Value = "Poste 635 PM 25 x 2.44m:";
			Book.ActiveSheet.Cells(31,6).Value = "4";
			Book.ActiveSheet.Cells(31,7).Value = "pzas.";
			Book.ActiveSheet.Range("A32:D32").MergeCells = "True";
			Book.ActiveSheet.Range("A32:G32").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(32,1).Value = "Compuesto p/ Juntas de 76.25m:";
			Book.ActiveSheet.Cells(32,6).Value = "1";
			Book.ActiveSheet.Cells(32,7).Value = "caja";
			Book.ActiveSheet.Range("A33:D33").MergeCells = "True";
			Book.ActiveSheet.Range("A33:G33").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(33,1).Value = "Cinta de Papel p/ Junta de 76.25m:";
			Book.ActiveSheet.Cells(33,6).Value = "4";
			Book.ActiveSheet.Cells(33,7).Value = "rollos";
			Book.ActiveSheet.Range("A34:D34").MergeCells = "True";
			Book.ActiveSheet.Range("A34:G34").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(34,1).Value = "Tornillos Framer 7 x 7/16:";
			Book.ActiveSheet.Cells(34,6).Value = "150";
			Book.ActiveSheet.Cells(34,7).Value = "pzas.";
			Book.ActiveSheet.Range("A35:D35").MergeCells = "True";
			Book.ActiveSheet.Range("A35:G35").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(35,1).Value = "Tornillo Std. Cuerda sencilla 8 x 1\":";
			Book.ActiveSheet.Cells(35,6).Value = "200";
			Book.ActiveSheet.Cells(35,7).Value = "pzas.";
			Book.ActiveSheet.Range("A36:D36").MergeCells = "True";
			Book.ActiveSheet.Range("A36:G36").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(36,1).Value = "Esquinero Metal-Papel de 2.44m:";
			Book.ActiveSheet.Cells(36,6).Value = "2";
			Book.ActiveSheet.Cells(36,7).Value = "pzas.";
			Book.ActiveSheet.Range("A37:D37").MergeCells = "True";
			Book.ActiveSheet.Range("A37:G37").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(37,1).Value = "Canaleta de Carga 4.10m x 3.96m:";
			Book.ActiveSheet.Cells(37,6).Value = "7";
			Book.ActiveSheet.Cells(37,7).Value = "pzas.";			
			//--- Leyenda
			Book.ActiveSheet.Range("A39:G39").MergeCells = "True";
			Book.ActiveSheet.Range("A39:G39").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(39,1).Value = "* Los resultados son aproximaciones";
						
		
	
	// Save the sheet.
    var today = new Date();
    var month = today.getMonth()+1;
    var day = today.getDate();
    var year = today.getFullYear();
	var hour = today.getHours();
	var minu = today.getMinutes();
	var sec = today.getSeconds();


	nom="ListaMateriales_Boveda_"+year+month+day+hour+minu+sec+".xls";
	Book.SaveAs("C:\\"+nom);
	
	// Close Excel with the Quit method on the Application object.
	//Excel.Application.Quit();
	alert("Se ha creado el archivo excel en C:\\"+nom);

}


/*
*
*/
function exportaExcelN(){
	
	var vslash= /\\/gi;
	var path = window.location.pathname.split("html\\")[0].replace(vslash,"\\\\")+"imagenes\\\\";
	var Excel, Book;	
	var vRen =0;
	
	path = unescape(path.replace(/\+/g,  " "));
	
	// Create the Excel application object.
	Excel = new ActiveXObject("Excel.Application");	
	// Make Excel visible.
	Excel.Visible = true;	
	// Create a new work book.
	Book = Excel.Workbooks.Add();
	//Named
	Book.ActiveSheet.Name = "Lista Materiales";
	// Place some text in the first cell of the sheet.
	//Book.ActiveSheet.Cells(1,1).Value = tblListaMateriales.innerHTML;
	
	//ancho columna
	Book.ActiveSheet.Columns("B:B").ColumnWidth = 10;
	Book.ActiveSheet.Columns("C:C").ColumnWidth = 3;
	Book.ActiveSheet.Columns("E:E").ColumnWidth = 3;
	
	//inserto logo
	Book.ActiveSheet.Range("D1").Select;
	Book.ActiveSheet.Pictures.Insert(path+"logoPR.jpg");
	
	//inserto titulo de resultados
	Book.ActiveSheet.Range("A4").Select;
	Book.ActiveSheet.Pictures.Insert(path+"dnicho.gif");
	
	//seleccion para formato letra
	Book.ActiveSheet.Range("A27:G29").Select;
    Book.ActiveSheet.Range("A27:G29").Font.ColorIndex = 2;
	Book.ActiveSheet.Range("A27:G29").Font.Name="Verdana";
	Book.ActiveSheet.Range("A27:G29").Font.Size="8";
	Book.ActiveSheet.Range("A27:G29").Interior.ColorIndex = 11;
	
	//Material
	Book.ActiveSheet.Cells(27,1).Value = "Material para 1m de ancho X 1.5m de Alto ";
	Book.ActiveSheet.Cells(28,1).Value = "X 0.4m de fondo con .5m de diametro";

    //Renglones
	
		Book.ActiveSheet.Range("A30:G16").Select;
		Book.ActiveSheet.Range("A30:G39").HorizontalAlignment = -4131;
		Book.ActiveSheet.Range("A30:G39").VerticalAlignment = -4107;
		Book.ActiveSheet.Range("A30:G39").WrapText = "True";
		Book.ActiveSheet.Range("A30:G39").Orientation = 0;
		Book.ActiveSheet.Range("A30:G39").AddIndent = "False";
		Book.ActiveSheet.Range("A30:G39").ShrinkToFit = "False";
		Book.ActiveSheet.Range("A30:G39").Font.ColorIndex = 16;
	    Book.ActiveSheet.Range("A30:G39").Font.Name="Verdana";
	    Book.ActiveSheet.Range("A30:G39").Font.Size="8";		
		Book.ActiveSheet.Range("A30:G39").Interior.Pattern = 1;
		Book.ActiveSheet.Range("A30:G39").Interior.PatternColorIndex = -4105;
		
		
			Book.ActiveSheet.Range("A30:D30").MergeCells = "True";
			Book.ActiveSheet.Range("A30:G30").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(30,1).Value = "Páneles de Yeso de 1.22 X 2.44m:";
			Book.ActiveSheet.Cells(30,6).Value = "2";
			Book.ActiveSheet.Cells(30,7).Value = "pzas.";
			Book.ActiveSheet.Range("A31:D31").MergeCells = "True";
			Book.ActiveSheet.Range("A31:G31").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(31,1).Value = "Poste 635 PM 25 x 2.44m:";
			Book.ActiveSheet.Cells(31,6).Value = "7";
			Book.ActiveSheet.Cells(31,7).Value = "pzas.";
			Book.ActiveSheet.Range("A32:D32").MergeCells = "True";
			Book.ActiveSheet.Range("A32:G32").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(32,1).Value = "Compuesto p/ Juntas Panel Rey de 21.8 KG:";
			Book.ActiveSheet.Cells(32,6).Value = "0.5";
			Book.ActiveSheet.Cells(32,7).Value = "caja";
			Book.ActiveSheet.Range("A33:D33").MergeCells = "True";
			Book.ActiveSheet.Range("A33:G33").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(33,1).Value = "Cinta de Papel p/ Juntas de 76.25m:";
			Book.ActiveSheet.Cells(33,6).Value = "0.1";
			Book.ActiveSheet.Cells(33,7).Value = "rollo";
			Book.ActiveSheet.Range("A34:D34").MergeCells = "True";
			Book.ActiveSheet.Range("A34:G34").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(34,1).Value = "Tornillos Framer 7 x 7/16:";
			Book.ActiveSheet.Cells(34,6).Value = "150";
			Book.ActiveSheet.Cells(34,7).Value = "pzas.";
			Book.ActiveSheet.Range("A35:D35").MergeCells = "True";
			Book.ActiveSheet.Range("A35:G35").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(35,1).Value = "Tornillo Std. Cuerda sencilla 8 x 1\":";
			Book.ActiveSheet.Cells(35,6).Value = "200";
			Book.ActiveSheet.Cells(35,7).Value = "pzas.";
			Book.ActiveSheet.Range("A36:D36").MergeCells = "True";
			Book.ActiveSheet.Range("A36:G36").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(36,1).Value = "Esquinero Metal-Papel de 2.44m:";
			Book.ActiveSheet.Cells(36,6).Value = "2";
			Book.ActiveSheet.Cells(36,7).Value = "pzas.";
			//--- Leyenda
			Book.ActiveSheet.Range("A39:G39").MergeCells = "True";
			Book.ActiveSheet.Range("A39:G39").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(39,1).Value = "* Los resultados son aproximaciones";
							
		
	// Save the sheet.
    var today = new Date();
    var month = today.getMonth()+1;
    var day = today.getDate();
    var year = today.getFullYear();
	var hour = today.getHours();
	var minu = today.getMinutes();
	var sec = today.getSeconds();


	nom="ListaMateriales_Nicho_"+year+month+day+hour+minu+sec+".xls";
	Book.SaveAs("C:\\"+nom);
	
	// Close Excel with the Quit method on the Application object.
	//Excel.Application.Quit();
	alert("Se ha creado el archivo excel en C:\\"+nom);

}


/*
*
*/
function exportaExcelCj(){
	
	var vslash= /\\/gi;
	var path = window.location.pathname.split("html\\")[0].replace(vslash,"\\\\")+"imagenes\\\\";
	var Excel, Book;	
	var vRen =0;
	
	path = unescape(path.replace(/\+/g,  " "));
	
	// Create the Excel application object.
	Excel = new ActiveXObject("Excel.Application");	
	// Make Excel visible.
	Excel.Visible = true;	
	// Create a new work book.
	Book = Excel.Workbooks.Add();
	//Named
	Book.ActiveSheet.Name = "Lista Materiales";
	// Place some text in the first cell of the sheet.
	//Book.ActiveSheet.Cells(1,1).Value = tblListaMateriales.innerHTML;
	
	//ancho columna
	Book.ActiveSheet.Columns("B:B").ColumnWidth = 10;
	Book.ActiveSheet.Columns("C:C").ColumnWidth = 3;
	Book.ActiveSheet.Columns("E:E").ColumnWidth = 3;
	
	//inserto logo
	Book.ActiveSheet.Range("D1").Select;
	Book.ActiveSheet.Pictures.Insert(path+"logoPR.jpg");
	
	//inserto titulo de resultados
	Book.ActiveSheet.Range("A4").Select;
	Book.ActiveSheet.Pictures.Insert(path+"dcajillo.gif");
	
	//seleccion para formato letra
	Book.ActiveSheet.Range("A27:G29").Select;
    Book.ActiveSheet.Range("A27:G29").Font.ColorIndex = 2;
	Book.ActiveSheet.Range("A27:G29").Font.Name="Verdana";
	Book.ActiveSheet.Range("A27:G29").Font.Size="8";
	Book.ActiveSheet.Range("A27:G29").Interior.ColorIndex = 11;
	
	//Material
	Book.ActiveSheet.Cells(27,1).Value = "Material para 1m lineal de 0.40m de ancho x";
	Book.ActiveSheet.Cells(28,1).Value = "0.20m de altura";

    //Renglones
	
		Book.ActiveSheet.Range("A30:G16").Select;
		Book.ActiveSheet.Range("A30:G39").HorizontalAlignment = -4131;
		Book.ActiveSheet.Range("A30:G39").VerticalAlignment = -4107;
		Book.ActiveSheet.Range("A30:G39").WrapText = "True";
		Book.ActiveSheet.Range("A30:G39").Orientation = 0;
		Book.ActiveSheet.Range("A30:G39").AddIndent = "False";
		Book.ActiveSheet.Range("A30:G39").ShrinkToFit = "False";
		Book.ActiveSheet.Range("A30:G39").Font.ColorIndex = 16;
	    Book.ActiveSheet.Range("A30:G39").Font.Name="Verdana";
	    Book.ActiveSheet.Range("A30:G39").Font.Size="8";		
		Book.ActiveSheet.Range("A30:G39").Interior.Pattern = 1;
		Book.ActiveSheet.Range("A30:G39").Interior.PatternColorIndex = -4105;
		
		
			Book.ActiveSheet.Range("A30:D30").MergeCells = "True";
			Book.ActiveSheet.Range("A30:G30").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(30,1).Value = "Páneles de Yeso de 1.22 X 2.44m:";
			Book.ActiveSheet.Cells(30,6).Value = "1";
			Book.ActiveSheet.Cells(30,7).Value = "pzas.";
			Book.ActiveSheet.Range("A31:D31").MergeCells = "True";
			Book.ActiveSheet.Range("A31:G31").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(31,1).Value = "Poste  410 PM 25 x 2.44m:";
			Book.ActiveSheet.Cells(31,6).Value = "1";
			Book.ActiveSheet.Cells(31,7).Value = "pzas.";
			Book.ActiveSheet.Range("A32:D32").MergeCells = "True";
			Book.ActiveSheet.Range("A32:G32").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(32,1).Value = "Canal de Amarre 4.10 CA25 de 3.05m:";
			Book.ActiveSheet.Cells(32,6).Value = "2";
			Book.ActiveSheet.Cells(32,7).Value = "pzas.";
			Book.ActiveSheet.Range("A33:D33").MergeCells = "True";
			Book.ActiveSheet.Range("A33:G33").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(33,1).Value = "Compuesto p/ Junta Panel Rey de 21.8KG:";
			Book.ActiveSheet.Cells(33,6).Value = "0.25";
			Book.ActiveSheet.Cells(33,7).Value = "caja";
			Book.ActiveSheet.Range("A34:D34").MergeCells = "True";
			Book.ActiveSheet.Range("A34:G34").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(34,1).Value = "Cinta de Papel p/ Junta de 76.25m:";
			Book.ActiveSheet.Cells(34,6).Value = "0.1";
			Book.ActiveSheet.Cells(34,7).Value = "rollo";
			Book.ActiveSheet.Range("A35:D35").MergeCells = "True";
			Book.ActiveSheet.Range("A35:G35").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(35,1).Value = "Tornillos Framer 7 x 7/16:";
			Book.ActiveSheet.Cells(35,6).Value = "50";
			Book.ActiveSheet.Cells(35,7).Value = "pzas.";
			Book.ActiveSheet.Range("A36:D36").MergeCells = "True";
			Book.ActiveSheet.Range("A36:G36").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(36,1).Value = "Tornillo Std. Cuerda sencilla 8 x 1\":";
			Book.ActiveSheet.Cells(36,6).Value = "50";
			Book.ActiveSheet.Cells(36,7).Value = "pzas.";
			Book.ActiveSheet.Range("A37:D37").MergeCells = "True";
			Book.ActiveSheet.Range("A37:G37").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(37,1).Value = "Esquinero Metal-Papel de 2.44m:";
			Book.ActiveSheet.Cells(37,6).Value = "1";
			Book.ActiveSheet.Cells(37,7).Value = "pzas.";
			//--- Leyenda
			Book.ActiveSheet.Range("A39:G39").MergeCells = "True";
			Book.ActiveSheet.Range("A39:G39").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(39,1).Value = "* Los resultados son aproximaciones";
						
		
	
	// Save the sheet.
    var today = new Date();
    var month = today.getMonth()+1;
    var day = today.getDate();
    var year = today.getFullYear();
	var hour = today.getHours();
	var minu = today.getMinutes();
	var sec = today.getSeconds();


	nom="ListaMateriales_Cajillo_"+year+month+day+hour+minu+sec+".xls";
	Book.SaveAs("C:\\"+nom);
	
	// Close Excel with the Quit method on the Application object.
	//Excel.Application.Quit();
	alert("Se ha creado el archivo excel en C:\\"+nom);

}

/*
*
*/
function exportaExcelCn(){
	
	var vslash= /\\/gi;
	var path = window.location.pathname.split("html\\")[0].replace(vslash,"\\\\")+"imagenes\\\\";
	var Excel, Book;	
	var vRen =0;
	
	path = unescape(path.replace(/\+/g,  " "));
	
	// Create the Excel application object.
	Excel = new ActiveXObject("Excel.Application");	
	// Make Excel visible.
	Excel.Visible = true;	
	// Create a new work book.
	Book = Excel.Workbooks.Add();
	//Named
	Book.ActiveSheet.Name = "Lista Materiales";
	// Place some text in the first cell of the sheet.
	//Book.ActiveSheet.Cells(1,1).Value = tblListaMateriales.innerHTML;
	
	//ancho columna
	Book.ActiveSheet.Columns("B:B").ColumnWidth = 10;
	Book.ActiveSheet.Columns("C:C").ColumnWidth = 3;
	Book.ActiveSheet.Columns("E:E").ColumnWidth = 3;
	
	//inserto logo
	Book.ActiveSheet.Range("D1").Select;
	Book.ActiveSheet.Pictures.Insert(path+"logoPR.jpg");
	
	//inserto titulo de resultados
	Book.ActiveSheet.Range("A4").Select;
	Book.ActiveSheet.Pictures.Insert(path+"dcanon.gif");
	
	//seleccion para formato letra
	Book.ActiveSheet.Range("A27:G29").Select;
    Book.ActiveSheet.Range("A27:G29").Font.ColorIndex = 2;
	Book.ActiveSheet.Range("A27:G29").Font.Name="Verdana";
	Book.ActiveSheet.Range("A27:G29").Font.Size="8";
	Book.ActiveSheet.Range("A27:G29").Interior.ColorIndex = 11;
	
	//Material
	Book.ActiveSheet.Cells(27,1).Value = "Material para 1m lineal con un diametro de";
	Book.ActiveSheet.Cells(28,1).Value = "1.5m";

    //Renglones
	
		Book.ActiveSheet.Range("A30:G16").Select;
		Book.ActiveSheet.Range("A30:G39").HorizontalAlignment = -4131;
		Book.ActiveSheet.Range("A30:G39").VerticalAlignment = -4107;
		Book.ActiveSheet.Range("A30:G39").WrapText = "True";
		Book.ActiveSheet.Range("A30:G39").Orientation = 0;
		Book.ActiveSheet.Range("A30:G39").AddIndent = "False";
		Book.ActiveSheet.Range("A30:G39").ShrinkToFit = "False";
		Book.ActiveSheet.Range("A30:G39").Font.ColorIndex = 16;
	    Book.ActiveSheet.Range("A30:G39").Font.Name="Verdana";
	    Book.ActiveSheet.Range("A30:G39").Font.Size="8";		
		Book.ActiveSheet.Range("A30:G39").Interior.Pattern = 1;
		Book.ActiveSheet.Range("A30:G39").Interior.PatternColorIndex = -4105;
		
		
			Book.ActiveSheet.Range("A30:D30").MergeCells = "True";
			Book.ActiveSheet.Range("A30:G30").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(30,1).Value = "Páneles de Yeso de 1.22 X 2.44m:";
			Book.ActiveSheet.Cells(30,6).Value = "3";
			Book.ActiveSheet.Cells(30,7).Value = "pzas.";
			Book.ActiveSheet.Range("A31:D31").MergeCells = "True";
			Book.ActiveSheet.Range("A31:G31").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(31,1).Value = "Poste 635 PM 25 x 2.44m:";
			Book.ActiveSheet.Cells(31,6).Value = "10";
			Book.ActiveSheet.Cells(31,7).Value = "pzas.";
			Book.ActiveSheet.Range("A32:D32").MergeCells = "True";
			Book.ActiveSheet.Range("A32:G32").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(32,1).Value = "Canal 635 CA25 x 3.05m:";
			Book.ActiveSheet.Cells(32,6).Value = "7";
			Book.ActiveSheet.Cells(32,7).Value = "pzas.";
			Book.ActiveSheet.Range("A33:D33").MergeCells = "True";
			Book.ActiveSheet.Range("A33:G33").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(33,1).Value = "Compuesto p/ Junta Panel Rey de 21.8KG:";
			Book.ActiveSheet.Cells(33,6).Value = "0.5";
			Book.ActiveSheet.Cells(33,7).Value = "caja";
			Book.ActiveSheet.Range("A34:D34").MergeCells = "True";
			Book.ActiveSheet.Range("A34:G34").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(34,1).Value = "Cinta de Papel p/ Junta de 76.25m:";
			Book.ActiveSheet.Cells(34,6).Value = "1";
			Book.ActiveSheet.Cells(34,7).Value = "rollo";
			Book.ActiveSheet.Range("A35:D35").MergeCells = "True";
			Book.ActiveSheet.Range("A35:G35").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(35,1).Value = "Tornillos Framer 7 x 7/16:";
			Book.ActiveSheet.Cells(35,6).Value = "150";
			Book.ActiveSheet.Cells(35,7).Value = "pzas.";
			Book.ActiveSheet.Range("A36:D36").MergeCells = "True";
			Book.ActiveSheet.Range("A36:G36").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(36,1).Value = "Tornillo Std. Cuerda sencilla 8 x 1\":";
			Book.ActiveSheet.Cells(36,6).Value = "200";
			Book.ActiveSheet.Cells(36,7).Value = "pzas.";
			Book.ActiveSheet.Range("A37:D37").MergeCells = "True";
			Book.ActiveSheet.Range("A37:G37").Interior.ColorIndex = 0;
			Book.ActiveSheet.Cells(37,1).Value = "Esquinero Metal-Papel de 2.44m:";
			Book.ActiveSheet.Cells(37,6).Value = "1";
			Book.ActiveSheet.Cells(37,7).Value = "pzas.";
			//--- Leyenda
			Book.ActiveSheet.Range("A39:G39").MergeCells = "True";
			Book.ActiveSheet.Range("A39:G39").Interior.ColorIndex = 37;
			Book.ActiveSheet.Cells(39,1).Value = "* Los resultados son aproximaciones";
						
		
	
	// Save the sheet.
    var today = new Date();
    var month = today.getMonth()+1;
    var day = today.getDate();
    var year = today.getFullYear();
	var hour = today.getHours();
	var minu = today.getMinutes();
	var sec = today.getSeconds();


	nom="ListaMateriales_Canon_"+year+month+day+hour+minu+sec+".xls";
	Book.SaveAs("C:\\"+nom);
	
	// Close Excel with the Quit method on the Application object.
	//Excel.Application.Quit();
	alert("Se ha creado el archivo excel en C:\\"+nom);

}

/*
*
*/
function exportaExcel_OnLine(nom){
	var ventana = '../php/calExcel.php';	
	var aElement= document.createElement("<input type='hidden' id='hidTableExc'>");
	//alert(document.all(nom).innerHTML);
	aElement.value= document.all(nom).innerHTML;
    
    document.appendChild(aElement);
	document.frmCal.submit();

	//window.showModalDialog(ventana, document.all.divPrint.innerHTML,'height=10,width=10' );
	Miventana = window.open(ventana,'Excel');
	//Miventana.document.write("<table><tr><td>hola</td></tr></table>");
	//Miventana.document.close();
	//window.open ('prExtPedidosAut.php', 'mails','height=10,width=10,toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, directories=no, status=no')
}
