function focus_author ( e )
{
	if ( e.value == "Twój podpis" )
	{
		e.value = '';
		return false;
	}
}
function focus_content ( e )
{
	if ( e.value == "Treść twojego listu..." )
	{
		e.value = '';
		return false;
	}
}
function show(id)
{
  for (var i = 1; i <= 8; i++)
  {
    document.getElementById('sub-'+i).style.display = "none";
  }
  document.getElementById(id).style.display = "block";
}
function checkform ( form )
{
  if (form.content.value == "") {
    alert( "Proszę podaj treść swojego listu!" );
    form.content.focus();
    return false ;
  }
  if (form.author.value == "") {
    alert( "Proszę podpisz się pod listem!" );
    form.author.focus();
    return false ;
  }
  return true ;
}

function starOn (star, movie)
{
  return '<a onclick="voteStar(' + star + ', ' + movie + ');" onmouseover="showStars(' + star + ', ' + movie + ');"><img src="/img/star-5.png" alt="" /></a>';
}

function starOff (star, movie)
{
  return '<a onmouseover="showStars(' + star + ', ' + movie + ');"><img src="/img/star-0.png" alt="" /></a>';
}

function showStars (star, movie)
{
  var stars = new Array();
  stars[1]  = starOn(1, movie)  + starOff(2, movie) + starOff(3, movie) + starOff(4, movie) + starOff(5, movie);
  stars[2]  = starOn(1, movie)  + starOn(2, movie)  + starOff(3, movie) + starOff(4, movie) + starOff(5, movie);
  stars[3]  = starOn(1, movie)  + starOn(2, movie)  + starOn(3, movie)  + starOff(4, movie) + starOff(5, movie);
  stars[4]  = starOn(1, movie)  + starOn(2, movie)  + starOn(3, movie)  + starOn(4, movie)  + starOff(5, movie);
  stars[5]  = starOn(1, movie)  + starOn(2, movie)  + starOn(3, movie)  + starOn(4, movie)  + starOn(5, movie) ;
  
  document.getElementById('stars').innerHTML = stars[star] + '<input type="hidden" name="vote" value="' + star + '" />';
}

function voteStar (vote, movie)
{
  alert(vote + ' na ' + movie);
}

