function show(menu) {
    document.getElementById(menu).style.visibility = 'visible';
    if ((document.getElementById('active').value != '') && (document.getElementById('active').value != menu)) {
       hide(document.getElementById('active').value)
    }
    document.getElementById('active').value = menu
  }

  function hide(menu) {
    document.getElementById(menu).style.visibility = 'hidden';
  }

function getPage(thePage,wt,ht){ 
leftPos= (screen.width-wt)/2 
topPos = (screen.height-ht)/2 
newWin1 = window.open(thePage,'aWin','toolbars=no,resizable=no,scrollbars=no,left='+leftPos+',top='+topPos+',width='+wt+',height='+ht) 
} 

function komentaras_show()
{
	document.getElementById('komentaras').style.display = "block";
}

function komentaras_hide()
{
	document.getElementById('komentaras').style.display = "none";
}


function komentaras_show_(number)
{
	if (document.getElementById('komentaras').style.display == 'none')
	{
		document.getElementById('komentaras').style.display = "block";
		star(number);
		star_clean_triger = true;
	}
	else
	{
		document.getElementById('komentaras').style.display = "none";
		star_clean();
		star_clean_triger = false;		
	}
}


function star(number)
{
	for (var i=1;i<=5;i++)
	{
		document.getElementById('star_'+i).src='../img/star_0.gif';
	}
	for (var i=1;i<=number;i++)
	{
		document.getElementById('star_'+i).src='../img/star_1.gif';
	}
}


function star_clean(number)
{	
	if (number)
	{
		for (var i=1;i<=number;i++)
		{
			document.getElementById('star_'+i).src='../img/star_1.gif';
		}
		
		for (var i=number+1;i<=5;i++)
		{
			document.getElementById('star_'+i).src='../img/star_0.gif';
		}		
	}
	else
	{	
		for (var i=1;i<=5;i++)
		{
			document.getElementById('star_'+i).src='../img/star_0.gif';
		}
	}
	
	
}

function voter(vote)
{
	document.vote_form.vote.value = vote;
	document.vote_form.submit();
}


function valid_form(thisform)
{	
  if(!thisform.email.value.match(/^(\S+)@(\S+)\.(\S+)/))
  {
    thisform.email.focus();
    alert('Prašome įvesti teisingą el. paštą.');
    return false;
  } 
  if(!thisform.text.value)
  {
    thisform.text.focus();
    alert('Prašome įvesti komentarą ar klausimą.');
    return false;
  } 
  return true;
}

function pren_color_change()
{
	if (document.getElementById('pren_img').src == 'http://www.jg-group.lt/img/rss1.jpg')
	{
		document.getElementById('pren_img').src='img/rss2.jpg';	
		document.getElementById('pren_text').style.color='#EB7947';
	}
	else
	{
		document.getElementById('pren_img').src='img/rss1.jpg';	
		document.getElementById('pren_text').style.color='#666666';	
	}
}








