<!--

var secs
var timerID = null
var timerRunning = false
var delay = 1000

var browserName=navigator.appName; 
if (browserName=="Netscape") { 

function close_window() 
{ 
window.open('','_parent',''); 
window.close();} 
} 
else { 
if (browserName=="Microsoft Internet Explorer") 
{ 
function close_window() 
{ 
window.opener = "whocares"; 
window.close(); 
} 
} 
} 

function fix_png()
{
	var arVersion = navigator.appVersion.split("MSIE")
	var version = parseFloat(arVersion[1])

	if ((version >= 5.5) && (document.body.filters)) 
	{
		document.getElementById('header').innerHTML = '<span id="header" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader (src=\'images/header2.png\', sizingMethod=\'scale\');"></span>'
	}
	else
	{
		document.getElementById('header').innerHTML = '<img src="images/header.png" />';
	}
}

function load()
{
	set_header();
	if(document.getElementById('submenu'))
	{
		document.getElementById('submenu').style.display = 'none';
	}
}

function set_header()
{
	var width = document.body.clientWidth;
	document.getElementById('header').innerHTML = '<img src="images/header2.png" width="' + width + '" border="0">';
}

function submenu_on()
{
	var x = document.getElementById("mainmenu").offsetLeft;
	secs = 1;
	clearTimeout(timerID);
	//document.getElementById("mainmenu").offsetLeft
	document.getElementById('submenu').style.display = 'block';
	//document.getElementById('submenu').style.marginLeft = x + (x/15);
	//alert(x);
}

function submenu_off()
{
	document.getElementById('submenu').style.display = 'none';
}

function InitializeTimer()
{
    secs = 1
    StopTheClock()
    StartTheTimer()
}

function StopTheClock()
{
    if(timerRunning)
        clearTimeout(timerID)
    timerRunning = false
}

function StartTheTimer()
{
    if (secs==0)
    {
        StopTheClock()
		submenu_off();
	}
    else
    {
        timerRunning = true
		secs--;
        timerID = self.setTimeout("StartTheTimer()", delay)
    }
}

// foto script
var current = 0;

function next(){ // forward one image
if(document.formname.slide[current+1]){
document.images.show.src = document.formname.slide[current+1].value;
document.formname.slide.selectedIndex = ++current;}
else{first();}}

function previous(){ // back on image
if((current-1) >= 0){
document.images.show.src = document.formname.slide[current-1].value;
document.formname.slide.selectedIndex= --current;}
else{last();}}

function first(){ // jump to first image
current=0;
document.images.show.src = document.formname.slide[0].value;
document.formname.slide.selectedIndex=0;}

function last(){ // this is jump to last image
current=(document.formname.slide.length-1);
document.images.show.src = document.formname.slide[current].value;
document.formname.slide.selectedIndex=current;}

function ap(text){ // this controls the auto-play and/or auto-stop
document.formname.slidebutton.value=(text == "Stop") ? "Start" : "Stop";
rotate();}

function change(){ // this is for the pulldown menu
current=document.formname.slide.selectedIndex;
document.images.show.src = document.formname.slide[current].value;}

function rotate() {
if (document.formname.slidebutton.value == "Stop") {
current = (current == document.formname.slide.length-1) ? 0 : current+1;
document.images.show.src = document.formname.slide[current].value;
document.formname.slide.selectedIndex = current;
window.setTimeout("rotate()", 5000);}}

//-->
