 function SetVote(vote, inputName, numInput) {
    itemVote = 0;
	var frm;
	frm = findElementById(inputName);
	itemVote = vote;
	frm.value = vote;
	baseName = "vote" + numInput;
	for (i = 1; i <= itemVote; ++i)
		findElementById(baseName + i).src="img/ico_voto_on.gif";

	for (i = itemVote + 1; i <= 5; ++i)
		findElementById(baseName + i).src="img/ico_voto_off.gif";
	
	return true;
}


function VoteEnter(vote, inputName, numInput) {
    var frm;
	frm = findElementById(inputName);
	baseName = "vote" + numInput;
	if (frm.value < vote) {
	
		var i;
	
		for (i = 1; i <= vote; ++i)
			findElementById(baseName + i).src="img/ico_voto_on.gif";
	}
}

function VoteLeave(vote, inputName, numInput) {
	var frm;
	frm = findElementById(inputName);
	baseName = "vote" + numInput;
	if (frm.value < vote) {
	
		var i;

		for (i = vote; i > frm.value; --i)
			findElementById(baseName + i).src="img/ico_voto_off.gif";
	}
}

		
function EmailCheck(str) {

		var at="@";
		var dot=".";
		var lat=str.indexOf(at);
		var lstr=str.length;
		var ldot=str.indexOf(dot);
		if (str.indexOf(at)==-1){
		   return false;
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   return false;
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    return false;
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    return false;
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    return false;
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    return false;
		 }
		
		 if (str.indexOf(" ")!=-1){
		    return false;
		 }

 		 return true;				
	}

function CheckCoomentLenght(sender, args)
  {
    if (args.Value.length > 2000)
        args.IsValid = false;
    else        
        args.IsValid = true;
  }
  function findElementById( elementId )
{
	var theElement = null;
	try
	{
		if( document.getElementById )
			theElement = document.getElementById( elementId );
		else
			theElement = document.all[ elementId ];
	}
	catch( e )
	{
		theElement = null;
	}
	return theElement;
}


function showTab(id)
{
	findElementById("box_" + id).style.display = "block";
	findElementById("tab_" + id).className = ( id == "comment" ? "on last" : "on" );
	findElementById("tab_" + id).blur();
}

function hideTab(id)
{
	findElementById("box_" + id).style.display = "none";
	findElementById("tab_" + id).className = ( id == "comment" ? "off last" : "off" );
}
