function showAllComments()
{
	document.getElementById("allComments").style.display = "block";
	document.getElementById("allCommentButton").style.display = "none";
}

function checkPassword(strValue)
{
  	var objRegExp  =  /[a-zA-Z0-9]/ ;
	for(x=0;x<strValue.length;x++)
	{
		if (!objRegExp.test(strValue.charAt(x))) {
			return false;
			break;
		}
	}
	return true;
}

function looseHeader()
{
    window.scrollTo(0,130)
}

    function loadImage(imageId,imageElement)
	{
 
    window.scrollTo(0,80)
	alert("updated")
    imageUrl = "ajaximage.php";
	var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();							
	if (x)
	{
		x.onreadystatechange = function()
			{
			if (x.readyState == 4 && x.status == 200)
				{
				el = document.getElementById(imageElement);
				    if(el)
				    {
				        responseStr = x.responseText;
					    el.innerHTML = responseStr;	
					    el.style.visibility = "visible";	
                    }
				}
			}
		x.open("GET", imageUrl , true);
		x.send(null);
	}
}

function showImage(imageId,compId,compRoundId)
{
	if(imageId != null)
	{
		var targetPage = "image.php?imageId="+imageId;
		if(compId != null)
		{
			targetPage += "&compId="+compId;
		}	
		if(compRoundId != null)
		{
			targetPage += "&compRoundId="+compRoundId;	
		}					
		document.location.href = targetPage;	
	}
	else
	{
		alert("error: image not found")
	}
}
 
 
 			var scoreArray = new Array();
				
			function makeScoreCard(arrayNum,sName,sTarget,sEle)
			{
				var sElement = sEle;
				var parent = document.getElementById(sTarget);
				var sCard = new scoreCard(arrayNum,parent,sName,sElement)
			}
			
			function scoreCard(arrayNum,sEle,sName,sElement)
			{
				
				scoreArray[arrayNum] = new Array(new scoreImage(1,sName))

				for(x=0;x<5;x++)
				{
					scoreArray[arrayNum][x] = new scoreImage(arrayNum,x,sName,sElement);
					sEle.appendChild(scoreArray[arrayNum][x].element)
				}
				//alert(sEle.innerHTML)
			}
			function scoreImage(arrayNum,num,sName,sElement)
			{
				this.arrayNum = arrayNum;
				this.sName = sName;
				this.activeElement = 0;
				this.num = (num+1);
				this.sElement = sElement;
				this.elementName = "/wps/vid/score_0_"+this.num+".gif";
				var imageEle = document.createElement("img");
				imageEle.src = "/wps/vid/score_0_"+this.num+".gif";
				imageEle.id = sName+"_"+num;				
				imageEle.onmouseover = function(){preEmptScore(arrayNum,num);}
				imageEle.onmouseout = function(){clearScore(arrayNum);}				
				imageEle.onmousedown = function(){setScore(arrayNum,num);}				
				this.element = imageEle;
				
				scoreImage.prototype.reset = function()
				{
					this.element.src = "/wps/vid/score_0_"+this.num+".gif";
				}	
				scoreImage.prototype.activate = function()
				{
					this.element.src = "/wps/vid/score_1_"+this.num+".gif";
					document.getElementById(this.sElement).value = this.activeElement;
				}					
				scoreImage.prototype.set = function()
				{
					this.element.src = "/wps/vid/score_1_"+this.num+".gif";
				}
			}
			function setScore(arrayNum,num)
			{

				for(x=0;x<5;x++)
				{
					scoreArray[arrayNum][x].activeElement = (num+1);
				}
				scoreArray[arrayNum][num].activate();						
			}
			function preEmptScore(arrayNum,num)
			{
				for(x=0;x<(num+1);x++)
				{
					scoreArray[arrayNum][x].set();
				}		
			}			
			function clearScore(arrayNum)
			{
				for(x=0;x<5;x++)
				{
					if(scoreArray[arrayNum][x].activeElement <= x)
						scoreArray[arrayNum][x].reset()
				}
			}   