$(function() {

	var w = 184+$('.v-p-mn ul li:first a').outerWidth();
	$('.v-p-mn ul li:first ul, .v-p-mn ul li:first ul li').width(w);
	$('.v-p-mn ul li:first').mouseenter(function(){
		$(this).addClass('hover');
		$('.v-p-mn ul li:first ul').show();
	}).mouseleave(function(){
		$(this).removeClass('hover');
		$('.v-p-mn ul li:first ul').hide();
	});
	
	$('.v-p-mn ul li.kat, #kateg').mouseenter(function(){
		$('.v-p-mn ul li.kat').addClass('hover');
		$('#kateg').show();
	}).mouseleave(function(){
		$('.v-p-mn ul li.kat').removeClass('hover');
		$('#kateg').hide();
	});

	$('.v-p-mn ul li.zen, #zenkl').mouseenter(function(){
		$('.v-p-mn ul li.zen').addClass('hover');
		$('#zenkl').show();
	}).mouseleave(function(){
		$('.v-p-mn ul li.zen').removeClass('hover');
		$('#zenkl').hide();
	});
	
	//katalogas
	var maxH = 0;
    $('div.kata-prek dl').each(function(){
        if (maxH < $(this).height()) {maxH = $(this).height()}
    });
    $('div.kata-prek dl').each(function(){
        $(this).height(maxH);
    });
	
	//rekomenduojamos
	var maxH = 0;
    $('div.rek-prek-sar dl').each(function(){
        if (maxH < $(this).height()) {maxH = $(this).height()}
    });
    $('div.rek-prek-sar dl').each(function(){
        $(this).height(maxH);
    });
});
/* --- */
function showhide(id) {
	if (document.getElementById(id).style.display=="none") {document.getElementById(id).style.display="block";}
	else {document.getElementById(id).style.display="none";}
}
function show(id) {
	if (document.getElementById(id).style.display=="none") {document.getElementById(id).style.display="block";} 
}
function hide(id) {
	if (document.getElementById(id).style.display=="block") {document.getElementById(id).style.display="none";} 
}
/* --- */
function moveto(inputEl, selStart, selEnd) {  
if (inputEl.setSelectionRange) {   
inputEl.focus();   
inputEl.setSelectionRange(selStart, selEnd);  } 
else if (inputEl.createTextRange) {   
var range = inputEl.createTextRange();   
range.collapse(true);   
range.moveEnd('character', selEnd);   
range.moveStart('character', selStart);   
range.select();  } }

