// JavaScript Document
var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
var ie4=document.all
var ns6=document.getElementById
//var tempobj=document.dynamicselector.dynamicselector2
if (ie4||ns6)
	//var contentobj = isInternetExplorer ? document.all.dynamic1 : document.dynamic1;
var contentobj=document.getElementById ? document.getElementById("dynamic1"): document.all.dynamic1
function generateimage(args){
if (ie4||ns6){
//dynamic1.innerHTML=args+' av <?php echo count(explode(",",$bilder))." bilder."; ?>'
document.getElementById("dynamic1").innerHTML=args
}
else if (document.layers){
document.dynamic1.document.write(args)
document.dynamic1.document.close()
}
else
alert('You need NS 4+ or IE 4+ to view the images!')
}
// Handle all the FSCommand messages in a Flash movie.
function custom_header_DoFSCommand(command, args) {
	var custom_headerObj = isInternetExplorer ? document.all.custom_header : document.custom_header;
	//
	if (command == "messagebox") {
	generateimage(args);
	}
	if (command == "messagebox2") {
	generateimage(args);
	}
	if (command == "messagebox3") {
	alert(args);
	}
	if (command == "messagebox4") {
	document.getElementById("dynamic2").innerHTML=args
	}
	if (command == "messagebox5") {
	document.getElementById("XMLtekst").innerHTML=args
	}
	//
}
// Hook for Internet Explorer.
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<script language=\"VBScript\"\>\n');
	document.write('On Error Resume Next\n');
	document.write('Sub custom_header_FSCommand(ByVal command, ByVal args)\n');
	document.write('	Call custom_header_DoFSCommand(command, args)\n');
	document.write('End Sub\n');
	document.write('</script\>\n');
}
function Starting() {
    document.getElementById("dynamic2").innerHTML='<a href=\"#\" onClick=\"callExternalInterface2()\">Start Slideshow</a>'
}
function callExternalInterface() {
    thisMovie("custom_header").goHome();
}
function callExternalInterface_neste() {
    thisMovie("custom_header").neste();
}
function callExternalInterface_forrige() {
    thisMovie("custom_header").forrige();
}
function callExternalInterface2() {
    thisMovie("custom_header").goSlideshow();
	// tilbakemelding fra Flash om at Slideshow er startet - og at den nå kan stoppes
	document.getElementById("dynamic2").innerHTML='<a href=\"#\" onClick=\"callExternalInterface3()\">Stopp Slideshow</a>'
}
function callExternalInterface3() {
    thisMovie("custom_header").stoppSlideshow();
	// tilbakemelding fra Flash om at Slideshow er stoppet - og at den nå kan startes
	document.getElementById("dynamic2").innerHTML='<a href=\"#\" onClick=\"callExternalInterface2()\">Start Slideshow</a>'
}

function thisMovie(movieName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[movieName]
    }
    else {
        return document[movieName]
    }
}

