/*******************************************************************************/
/* Copyright ©2007, Dennis Teunissen - Filmhuis Hoorn: www.filmhuishoorn.nl    */
/* JAVASRIPTFILE FOR THE WEBSITE OF FILMHUIS HOORN                             */
/* SCRIPT: GENERAL                                                             */
/*******************************************************************************/

// open a new centered window
function openCenteredWindow(file, name, wWidth, wHeight){
	var leftVal = (screen.width - wWidth) / 2;
    var topVal  = (screen.height - wHeight) / 2;

    window.open(file, name, 'width='+wWidth+', height='+wHeight+' left='+leftVal+', top='+topVal);
}

// function to zoom in and out on the map
function zoomMap(){
	var zoom = document.getElementById('zoom').innerHTML;
	if(zoom == "ZOOM IN"){
		document.getElementById('zoom').innerHTML = "ZOOM UIT";
		document.getElementById('map').innerHTML = "<img src='img/map_detail.gif'>";
	}else{
		document.getElementById('zoom').innerHTML = "ZOOM IN";
		document.getElementById('map').innerHTML = "<img src='img/map.gif'>";
	}
}

// function to show the title in a table
function showTitle(title, place){
	if(title.length > 27){
	  document.getElementById("title"+place).innerHTML = title.substring(0,27)+"...";
	}else{
	  document.getElementById("title"+place).innerHTML = title;
	}
}

// function to hide the title in a table
function hideTitle(place){
	document.getElementById("title"+place).innerHTML = "&nbsp;";
}

// function which opens the movie.php file in the content frame
function gotoMovie(id){
	location.href='movie.php?movie='+id;
}

// function to hide light stars on rating
function starLight(num){
	var i;
	var stars = "";
	for(i=1; i<=num; i++){
		stars = stars+"<img src='img/starON.gif' class='hand' onclick='starLight("+i+");'>";
	}
	for(y=i; y<=10; y++){
		stars = stars+"<img src='img/starOFF.gif' class='hand' onclick='starLight("+y+");'>";
	}
	document.getElementById("stars").innerHTML = stars+ "("+(i-1)+"/10)";
	document.castVoteForm.vote.value = (i-1);
}
