var isMSIE = /*@cc_on!@*/false;
var IE6=(navigator.userAgent.toLowerCase().indexOf('msie 6') != -1)
var IE7=(navigator.userAgent.toLowerCase().indexOf('msie 7') != -1)

$(function() {
  
  $('#banner').cycle({ 
    timeout: 6000,
    prev: '#banner-nav-left',
    next: '#banner-nav-right' 
  });
 

});

$(function(){   
   $(".rma").hover(function(){  
        $(this).addClass("hoverRM");  
		$('.rma .dd').show();
    },
	function(){    
        $(this).removeClass("hoverRM");  
		$('.rma .dd').hide();
    });
    
});

//menu dropdown
$(function(){   
   $("ul.dropdown li").hover(function(){    
        $(this).addClass("hover");
        $('div:first',this).css('visibility', 'visible');    
    },
	function(){    
        $(this).removeClass("hover");
        $('div:first',this).css('visibility', 'hidden');    
    });
    
});

$(function(){   
   $("ul.sub_menu li").hover(function(){  
		$(this).removeClass("hover");
        $(this).addClass("hoverS");  
    },
	function(){    
        $(this).removeClass("hoverS");  
    });
    
});

////tables///

//menu dropdown
$(function(){  
	 $('#tarife table').each(function(index,item) {
		$('table').addClass("table")
		$(item).addClass('tabel_'+index);
		$(item).find('tr').first().addClass('firstTr');
		$('#tarife tbody > tr:odd').addClass('rowOdd');
		$('#tarife tbody > tr:even').addClass('rowEven');
		$('#tarife tbody > tr > td:odd').addClass('tdOdd');
		$('#tarife tbody > tr > td:even').addClass('tdEven');
	})    
});

//calcul

function calcBmi() {
var w = document.bmi.weight.value * 1;
var HeightMeterInt = document.bmi.htm.value * 1;
var HeightCentimeterInt = document.bmi.htcm.value * 1;
HeightMeterConvert = HeightMeterInt * 100;
h = HeightMeterConvert + HeightCentimeterInt;
displaybmi = (Math.round((w * 10000) / (h * h)));
var rvalue = true;
if ( (w <= 17) || (w >= 250)  || (h <= 120) || (h >= 240) ) {
alert ("Date nevalide.  Va rugam verificati si reintroduceti!");
rvalue = false;
}
if (rvalue) {
if (HeightCentimeterInt > 99) {
remindercentimeter = mod(HeightCentimeterInt,100);
document.bmi.htcm.value = remindercentimeter;
document.bmi.htm.value = HeightMeterInt + 
((HeightCentimeterInt - remindercentimeter)/100);
document.bmi.answer.value = displaybmi;
}
if (displaybmi <19) 
document.bmi.comment.value = "Subponderal(a)";
if (displaybmi >=19 && displaybmi <=25) 
document.bmi.comment.value = "Normal(a)";
if (displaybmi >=26 && displaybmi <=29) 
document.bmi.comment.value = "Predispus(a) la riscuri de sanatate";
if (displaybmi >=30 && displaybmi <=40) 
document.bmi.comment.value = "Obez(a)";
if (displaybmi >40) 
document.bmi.comment.value = "Obezitate extrema";
document.bmi.answer.value = displaybmi; }
return rvalue;
}


