function over(id,src)
{
	document.getElementById(id).src='images/navigation/'+src+'-a.gif';
	if(document.getElementById('sub'+id) != null)
	{
		document.getElementById('sub'+id).style.display = 'block';
	}
}
function out(id,src,active)
{
	if(active != 1)
	{
		document.getElementById(id).src='images/navigation/'+src+'.gif';
	}
	if(document.getElementById('sub'+id) != null)
	{
		document.getElementById('sub'+id).style.display = 'none';
	}
}
function player_click(id)
{
	if(document.getElementById(id).style.display == 'block')
	{
		document.getElementById(id).style.display = 'none';
	}
	else
	{
		$(".tmplayer").css("display","none");
		if(document.getElementById(id).style.display == 'none')
		{
			document.getElementById(id).style.display = 'block';
		}
	}
}
function a_over(id)
{
	document.getElementById(id).style.textDecoration = 'underline';
}
function a_out(id)
{
	document.getElementById(id).style.textDecoration = 'none';
}
function next(array)
{
	var count = array.length;
	var img;
	var current = document.getElementById('powered').src;
	
	for(i=0;i<count;i++)
	{
		if(array[i] == current)
		{
			if(i == count-1)
			{
				img = array[0];
			}
			else
			{
				img = array[i+1];
			}
		}
	}
	document.getElementById('powered').src = img;
}
function previous(array)
{
	var count = array.length;
	var img;
	var current = document.getElementById('powered').src;
	
	for(i=0;i<count;i++)
	{
		if(array[i] == current)
		{
			if(i == 0)
			{
				img = array[count-1];
			}
			else
			{
				img = array[i-1];
			}
		}
	}
	document.getElementById('powered').src = img;
}
function open_comment()
{
	document.getElementById('comment-form').style.display='block';
	document.getElementById('new-comment').style.display='none';
}
function checkForm(formID)
{
	myForm = document.getElementById(formID);
	if (typeof(myForm) != "object") return false;
	myElements = myForm.elements;
	myError = new Array();
	for (f=0; f<myElements.length; f++){
		myElement = myElements[f];
		if (myElement.id.indexOf('_req') != -1){
			// REQUIRED FIELD
			if (myElement.value == "" || (myElement.type == "checkbox" && myElement.checked != true)) {
				myError.push(myElement);
			}
		}
	}
	if (myError.length > 0){
		alert("Bitte füllen Sie alle Pflichtfelder aus!");
		myError[0].focus();
		return false;
	} else { 
		return true;
	}
	return false;
}
function player_detail(id,action)
{
	if(action == 'over')
	{
		document.getElementById(id).style.display = 'block';
	}
	if(action == 'out')
	{
		document.getElementById(id).style.display = 'none';
	}
}
