// Sang Thai web scripts
// Script copyright (C) 2011 http://www.sangthai.se

var pictData = new Array(
  "STfood1.jpg",
  "STfood2.jpg",
  "STfood3.jpg",
  "STfood4.jpg",
  "STfood5.jpg",
  "STfood6.jpg",
  "STfood7.jpg",
  "STfood8.jpg"
);

var maxPict;
var nextPict;

// Text that changes automatically...
// var textData = new Array(
//   "Lunch M&aring;ndag - Fredag  10:00 - 14:00",
//   "Take Away Torsdag - L&ouml;rdag  15:00 - 19:00",
//   "Take Away - Ring 08 7610333",
//   "Catering"
// );

var maxText;
var nextText;

function initVars()
{
    nextPict = 0;
    maxPict = pictData.length - 1;

    //    maxText = textData.length - 1;
    //    nextText = 0;
}

function setinfo(infotext)
{
    document.getElementById("infodiv").innerHTML = "<B>" + infotext + "</B>";
}

function setBrowserInfo(infotext)
{
    document.getElementById("browserinfodiv").innerHTML = "<B>" + infotext + "</B>";
}

function setPict(pictfile)
{
    var inner;

    inner = "<img src=\"" + pictfile + "\"/>";
    document.getElementById("pictdiv").innerHTML = inner;
}

function updateInfo()
{
//    setPict( pictData[nextPict] );
    FadeInImage("leftpict", pictData[nextPict], "pictdiv");
    nextPict++;
    if (nextPict > maxPict)
	nextPict = 0;

// Text that changes automatically...
//    setinfo( textData[nextText] );
//    nextText++;
//    if (nextText > maxText)
//	nextText = 0;

    setTimeout("updateInfo()", 4000);
}

function loadFunc()
{
    initVars();

//    setBrowserInfo("Browsing from: " + navigator.platform + " "
//		   + navigator.appName + " " + navigator.appVersion + " "
//		   + "<br>Screen: " + screen.width + "*" + screen.height);

    // updateInfo();
    setTimeout("updateInfo()", 4000);
}

