/* scripts.js
*
* This script is for loading the other script when the page is ready.
*/

	// Get the name of the page (example: biografie of film)
	var pageload = window.location.href.split('/')[3];
	var page = pageload.split('.')[0];

// Function for adding javascripts to the page
function addJavascript(jsname,pos) {
	var th = document.getElementsByTagName(pos)[0];
	var s = document.createElement('script');
	s.setAttribute('type','text/javascript');
	s.setAttribute('src',jsname);
	th.appendChild(s);
}

// Load/Add the other scripts when the page is done loading.
$(document).ready(function(){
	// Add the script for the menu
	addJavascript('menuscript.js','head');
	
	// If the page is 'films', load the films-script, otherwise load the normal script
	if (page == 'films') {
		addJavascript('contentfilm.js','head');
		}
	else {
		addJavascript('contentaction.js','head');
		}
	
	// If the page is 'fotos', add the slideshow-script
	if (page == 'fotos') addJavascript('slideshow.js','head');
});
