// ****** Capa ******

var NS4=((parseInt(navigator.appVersion)>=4)&&(navigator.appName.indexOf("Netscape")!=-1));
var IE4=((parseInt(navigator.appVersion)>=4)&&(navigator.appName.indexOf("Explorer")!=-1));
var layerObj=(NS4)?'document':'document.all';
var styleObj=(NS4)?'':'.style';
var amagat=(NS4)?'hide':'hidden';
var es_visible=(NS4)?'show':'visible';


function activa(capa) {
	obj=eval(layerObj+'["'+capa+'"]'+styleObj);
	/*if (NS4) obj.top=window.pageYOffset+100;
	else obj.pixelTop=document.body.scrollTop+500;*/
	obj.visibility=es_visible;	}
	
function desactiva(capa) {
	obj=eval(layerObj+'["'+capa+'"]'+styleObj);
	obj.visibility=amagat;}
	
function comprobar0()
{
validado = true

if (document.formtest0.select1.value=="-1"){validado = false;}
if (document.formtest0.select2.value=="-1"){validado = false;}
if (document.formtest0.select3.value=="-1"){validado = false;}
if (document.formtest0.select4.value=="-1"){validado = false;}
if (document.formtest0.select5.value=="-1"){validado = false;}

if (validado)
	{
	total = 0
	total = total + parseInt(document.formtest0.select1.value);
	total = total + parseInt(document.formtest0.select2.value);
	total = total + parseInt(document.formtest0.select3.value);
	total = total + parseInt(document.formtest0.select4.value);
	total = total + parseInt(document.formtest0.select5.value);
	
	if (total <= 21) {document.formtest0.total.value = "Muestra signos de disfunción erectil.";
	activa('aviso');}	
	else
	{document.formtest0.total.value = "Su salud sexual es correcta";
	desactiva('aviso');}
	}
	else
	{document.formtest0.total.value = "";
	desactiva('aviso');}
}

function comprobar1()
{
validado = true

if (document.formtest1.select1.value=="-1"){validado = false;}
if (document.formtest1.select2.value=="-1"){validado = false;}
if (document.formtest1.select3.value=="-1"){validado = false;}
if (document.formtest1.select4.value=="-1"){validado = false;}
if (document.formtest1.select5.value=="-1"){validado = false;}
if (document.formtest1.select6.value=="-1"){validado = false;}
if (document.formtest1.select7.value=="-1"){validado = false;}

if (validado)
	{
	total = 0
	total = total + parseInt(document.formtest1.select1.value);
	total = total + parseInt(document.formtest1.select2.value);
	total = total + parseInt(document.formtest1.select3.value);
	total = total + parseInt(document.formtest1.select4.value);
	total = total + parseInt(document.formtest1.select5.value);
	total = total + parseInt(document.formtest1.select6.value);
	total = total + parseInt(document.formtest1.select7.value);
	
	if (total <= 7) {document.formtest1.total.value = "Valoración Normal";desactiva('aviso');}
	else{if ((total > 7) && (total <= 21)) {document.formtest1.total.value = "Síntomas moderados";desactiva('aviso');}}
	if (total > 21) {document.formtest1.total.value = "Síntomas Severos";activa('aviso');}
	
	}
	else
	{document.formtest1.total.value = "";desactiva('aviso');}
}

function comprobar2()
{
validado = true

if (document.formtest1.select1.value=="-1"){validado = false;}
if (document.formtest1.select2.value=="-1"){validado = false;}
if (document.formtest1.select3.value=="-1"){validado = false;}
if (document.formtest1.select4.value=="-1"){validado = false;}
if (document.formtest1.select5.value=="-1"){validado = false;}
if (document.formtest1.select6.value=="-1"){validado = false;}
if (document.formtest1.select7.value=="-1"){validado = false;}
if (document.formtest1.select8.value=="-1"){validado = false;}
if (document.formtest1.select9.value=="-1"){validado = false;}
if (document.formtest1.select10.value=="-1"){validado = false;}

if (validado)
	{
	total = 0
	total = total + parseInt(document.formtest1.select1.value);
	total = total + parseInt(document.formtest1.select2.value);
	total = total + parseInt(document.formtest1.select3.value);
	total = total + parseInt(document.formtest1.select4.value);
	total = total + parseInt(document.formtest1.select5.value);
	total = total + parseInt(document.formtest1.select6.value);
	total = total + parseInt(document.formtest1.select7.value);	
	total = total + parseInt(document.formtest1.select8.value);
	total = total + parseInt(document.formtest1.select9.value);
	total = total + parseInt(document.formtest1.select10.value);
	
	if (total <= 40) {document.formtest1.total.value = "Muestra Signos de disfunción Erectil";activa('aviso');}
	else
	{document.formtest1.total.value = "No muestra Signos de disfunción Erectil";desactiva('aviso');}
	}
	else
	{document.formtest1.total.value = "";desactiva('aviso');}
}

function comprobar22()
{
validado = true

if (document.formtest1.select11.value=="-1"){validado = false;}
if (document.formtest1.select12.value=="-1"){validado = false;}
if (document.formtest1.select13.value=="-1"){validado = false;}
if (document.formtest1.select14.value=="-1"){validado = false;}
if (document.formtest1.select15.value=="-1"){validado = false;}

if (validado)
	{
	total = 0
	total = total + parseInt(document.formtest1.select11.value);
	total = total + parseInt(document.formtest1.select12.value);
	total = total + parseInt(document.formtest1.select13.value);
	total = total + parseInt(document.formtest1.select14.value);
	total = total + parseInt(document.formtest1.select15.value);
	
	if (total <= 15) {document.formtest1.total2.value = "Muestra bajo deseo sexual";}
	else
	{document.formtest1.total2.value = "Muestra un deseo Sexual Normal";}
	}
	else
	{document.formtest1.total2.value = "";}
}

