
function selectfont()

{

    thefont = document.fontselect.font.value;
    thesize = document.fontselect.size.value;

	while (document.fontselect.size.options.length) {
	document.fontselect.size.options[0] = null;}

if ( thefont == "tfbitmap/") {

	document.fontselect.size.options[0]= new Option("tamaņo","-");
	document.fontselect.size.options[1]= new Option("unico","29/");

//	} else if ( thefont == "bmachines/") {

//	document.fontselect.size.options[0]= new Option("tamaņo","-");
//	document.fontselect.size.options[1]= new Option("chico","10/");
//	document.fontselect.size.options[2]= new Option("grande","20/");

	} else {alert("esta fuente no esta disponible para ver aun."); clform() }

}

function alerts()

{

  if (document.fontselect.font.value == "-") {alert("debes seleccionar una fuente."); return;}
  if (document.fontselect.size.value == "-") {alert("debes seleccionar un tamaņo."); return;}
  if (document.fontselect.color.value == "-") {alert("debes seleccionar un color."); return;}


if ((( event.keyCode >= '48' ) && ( event.keyCode <= '57' )) || (( event.keyCode >= '65' ) && ( event.keyCode <= '90' )) || (( event.keyCode >= '97' ) && ( event.keyCode <= '122' )) || ( event.keyCode == '32' ) || ( event.keyCode == '13' ))

	{    writer();

	}    else

alert("los unicos caracteres permitidos son numeros y letras sin contar la ņ, la barra de espacio y enter tambien funcionaran,pero nada mas.");

}

function writer()

{
    thekey = event.keyCode;
    thefont = document.fontselect.font.value;
    thecolor = document.fontselect.color.value;
    thesize = document.fontselect.size.value;

   msg=open("","fontview","toolbar=no,directories=no,menubar=no");
   msg.document.write("<HEAD><TITLE></TITLE><link rel=\"stylesheet\" type=\"text/css\" href=\"fontview.css\"></HEAD>");

	if(event.type == 'keypress' && event.keyCode != 13)
	{
   msg.document.write("<img src=\"http://i194.photobucket.com/albums/z20/tfperu/fonts/" + thefont + thesize + thekey + thecolor + ".gif\">");
	}	

	else if(event.type == 'keypress' && event.keyCode == 13)
	{
   msg.document.writeln("<br>");
	}	
}

function clform()
  {
  if (document.fontselect.font.value != "-") {document.fontselect.font.selectedIndex = "-";}
  if (document.fontselect.color.value != "-") {document.fontselect.color.selectedIndex = "-";}
  if (document.fontselect.size.value != "-") {document.fontselect.size.selectedIndex = "-";}
  }