function abono_li()  {
	document.writeln( "<LI>", this.nombre,": <a href=", this.fichero_tecnica,">Ficha técnica</A> - " );
	document.writeln( "<a href=", this.fichero_seguridad,">Ficha de seguridad</A></LI>" );
}

function abono_tr( _color )  {
  if ( _color && this.color==_color ) {
		document.writeln( "<TR><TD align=center width=50% bgColor=",_color,"><B>", this.nombre,"</B></TD>" );
		//document.writeln( "<TD class='formulario' align=center width=25%><a href=", this.fichero_tecnica,"><input type=button value='Ficha técnica'></A></TD>" );
		//document.writeln( "<TD class='formulario' align=center width=25%><a href=", this.fichero_seguridad,"><input type=button value='Ficha de seguridad'></A></TD>" );
		document.writeln( "<TD class='formulario' align=center width=25%><input type=button value='Ficha técnica' onClick=location.href='", this.fichero_tecnica,"'></TD>" );
		document.writeln( "<TD class='formulario' align=center width=25%><input type=button value='Ficha de seguridad' onClick=location.href='", this.fichero_seguridad,"'></TD>" );
		document.writeln( "</TR>" );
	}
}

function abono_option() {
	document.writeln( "<OPTION VALUE=", this.num, ">",this.nombre,"</OPTION>" );
}
// COLORES
var CAZUL="#5555ff";
//var CCIRUELA="#993366";
var CCIRUELA="#BB4488";
var CCELESTE="#99ccff";
var CNARANJA="#ff9900";
var CAMARILLO="#ffff00";
var CROJO="#ff0000";
var CTURQUESA="#00ffff";
var CVERDE="#00ff00";
var CLAVANDA="#9933FF";
var COTRO="#ffffff";
function Abono ( _num, _nombre, _fichero, _color ) {
	this.num=_num;
	this.nombre=_nombre;
	this.fichero=_fichero;
	this.color=(_color)?_color:COTRO;
	this.fichero_tecnica="./fichas_abonos/ficha_tecnica_"+_fichero;
	this.fichero_seguridad="./fichas_abonos/ficha_de_seguridad_"+_fichero;
	this.li=abono_li;
	this.tr=abono_tr;
	this.option=abono_option;
}

abonos=new Array;
abonos[abonos.length]=new Abono( abonos.length, "35-5-5+2MgO ","35_5_5_2MgO.pdf",CAZUL );
abonos[abonos.length]=new Abono( abonos.length, "5-0-51 ","5_0_51.pdf",CAZUL );
abonos[abonos.length]=new Abono( abonos.length, "7-12-40 ","7_12_40.pdf",CAZUL );
abonos[abonos.length]=new Abono( abonos.length, "ALGABOR ","ALGABOR.pdf",CCIRUELA );
abonos[abonos.length]=new Abono( abonos.length, "COBRE 50WG GRANULOS","COBRE_50WG.pdf",CCELESTE );
abonos[abonos.length]=new Abono( abonos.length, "COBRE 50WP INCOLORO ","COBRE_50WP_INCOLORO.pdf",CCELESTE );
abonos[abonos.length]=new Abono( abonos.length, "COBRE 50WP ","COBRE_50WP.pdf",CCELESTE );
abonos[abonos.length]=new Abono( abonos.length, "COBRE 50WP PREMIUM ","COBRE_50WP_PREMIUM.pdf",CCELESTE );
abonos[abonos.length]=new Abono( abonos.length, "COBRE BORDELES WP20 ","COBRE_BORDELES_WP20.pdf",CCELESTE );
abonos[abonos.length]=new Abono( abonos.length, "COBRE FLOW 52% Cu METAL ","COBRE_FLOW_52__Cu_METAL.doc", CTURQUESA );
abonos[abonos.length]=new Abono( abonos.length, "COBRE FLOW 52% OXICLORURO ","COBRE_FLOW_52__OXICLORURO.doc", CTURQUESA );
abonos[abonos.length]=new Abono( abonos.length, "COBRE OXIDO NARANJA 75WP ","COBRE_OXIDO_NARANJA_75WP.pdf", CROJO );
abonos[abonos.length]=new Abono( abonos.length, "ESTESAN 11-5-37+2BORO ","ESTESAN_11_5_37_2_B.pdf",CAZUL );
abonos[abonos.length]=new Abono( abonos.length, "ESTESAN 7-5-40+2BORO ","ESTESAN_7_5_40_2_B.pdf",CAZUL );
abonos[abonos.length]=new Abono( abonos.length, "ESTESAN 8% ZN + 8% MN + LIGNOSULFONATO ","ESTESAN_8__ZN___8__MN___LIGNOSULFONATO.doc",CNARANJA );
abonos[abonos.length]=new Abono( abonos.length, "ESTESAN CALCIO ","ESTESAN_CALCIO.pdf",CNARANJA );
abonos[abonos.length]=new Abono( abonos.length, "ESTESAN COMPLETO ","ESTESAN_COMPLETO.pdf",CVERDE );
abonos[abonos.length]=new Abono( abonos.length, "ESTESAN EQUILIBRADO ","ESTESAN_EQUILIBRADO.pdf",CVERDE );
abonos[abonos.length]=new Abono( abonos.length, "ESTESAN MICRO-L ","ESTESAN_MICRO_L.pdf",CNARANJA );
abonos[abonos.length]=new Abono( abonos.length, "ESTESAN NITROGENADO ","ESTESAN_NITROGENADO.pdf",CVERDE  );
abonos[abonos.length]=new Abono( abonos.length, "ESTESAN ORGANICO ","ESTESAN_ORGANICO.pdf",CLAVANDA );
abonos[abonos.length]=new Abono( abonos.length, "ESTESAN POTASIO ","ESTESAN_POTASIO.pdf",CVERDE );
abonos[abonos.length]=new Abono( abonos.length, "MAGNESAN ","MAGNESAN.pdf",CNARANJA );
abonos[abonos.length]=new Abono( abonos.length, "MESVERD ","MESVERD.pdf",CAMARILLO );
abonos[abonos.length]=new Abono( abonos.length, "MESVERD REVITALIZADOR ","MESVERD_REVITALIZADOR.pdf",CAMARILLO );

function abonos_li() {
	document.writeln( "<UL>" );
	for( var i=0; i<abonos.length; ++i ) {
		abonos[i].li();
	}
	document.writeln( "</UL>" );
}

function abonos_table( _color ) {
	document.writeln( "<TABLE WIDTH=90% class='formulario' align='center'>" );
	//document.writeln( "<TR><TH COLSPAN=3>Denominación del abono</TH></TR>" );
	for( var i=0; i<abonos.length; ++i ) {
		abonos[i].tr( _color );
	}
	document.writeln( "</TABLE><BR><BR>" );
}

function abre_ficha_tecnica() {
	location.href=abonos[document.form_abonos.select_abonos.value].fichero_tecnica;
}

function abre_ficha_seguridad() {
	location.href=abonos[document.form_abonos.select_abonos.value].fichero_seguridad;
}

function abonos_select() {
	document.writeln( "<form name='form_abonos'>" );
	document.writeln( "<P>Seleccione el abono: " );
	document.writeln( "<select name='select_abonos'>" );
	for( var i=0; i<abonos.length; ++i ) {
		abonos[i].option();
	}
	document.writeln( "</Select>" );
	document.writeln( "<BR><BR>Ver: <input type='button' onClick='abre_ficha_tecnica()' value='Ficha técnica'> " );
	document.writeln( "<input type='button' onClick='abre_ficha_seguridad()' value='Ficha de seguridad'> " );
	//document.writeln( "<A HREF='javascript:abre_ficha_tecnica()'>Ver ficha técnica</A> - " );
	//document.writeln( "<A HREF='javascript:abre_ficha_seguridad()'>Ver ficha de seguridad</A>" );
	document.writeln( "</P></FORM>" );
}