// this script loads all scripts after loading of DOM was successful.
// -100% DOM-loading happened, for further manipulation 
// -if JS is disabled page is quicker loadable, because useless scripts are ignored (saves traffic)


var myScripts = new Array('toggle_check.js', 'default.js', 'ptt.js');   
function writeScriptTag(filename){	
	try { 
		script_tag = document.createElement('script');
		script_tag.src = '/javascripts/' + filename;		
		script_tag.type = 'text/javascript';
		head = document.getElementsByTagName("head")[0];
		head.appendChild(script_tag);
	}catch(e) {
		// inserting via DOM fails in Safari 2.0, so brute force approach
  		document.write('<script type="text/javascript" src="/javascripts/'+filename+'"></script>');		
	}
}

function loadScripts(){
   for(var i=0;i<myScripts.length;i++){ writeScriptTag(myScripts[i]); }
}


//prototype method. Appends the loading task to the already existing tasks
Event.observe(window, "load", loadScripts);


