///////////////////////////////////////////////////////////////////////////////
//                              JAVASCRIPT.JS                                //
//                                                                           //
//                           Updated: 2004.12.28                             //
//                         © www.keld-rasmussen.dk                           //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////
// GLOBAL VARIABLES:

// The gotoCounter counts the number of times, the user jumps to different
// locations in this file. The value of the gotoCounter is then used in the
// history.go() function. This ensures that the the user return to previous
// file, not to the previous location in THIS file.

var gotoCounter = -1;
var previousLoc = "dummy";


///////////////////////////////////////////////////////////////////////////////
// FUNCTION GoTo
// InputParams:
//      LOC : Location i HTML file.
// Returnvalue:
//      gotoCounter (a global variable): Used in "history.go()".
// Used in:
//      Tour description files.
//

function GoTo(Loc){

if (Loc != previousLoc){gotoCounter--;}

previousLoc = Loc;

location = Loc;
}

///////////////////////////////////////////////////////////////////////////////
// FUNCTION NewLoc
// InputParams:
//      FILE : Name of a HTML file.
// Used in:
//      All files with a menusystem.
// Description: 
//      Load the HTML-file specified i "FILE" into the browser.
//

function NewLoc(file) {
  document.location=file;
}

///////////////////////////////////////////////////////////////////////////////
// FUNCTION newPictureWindow
// InputParams
//      URL : Picture file name.
//      TEXT: Text string, description of picture.
// Returnvalue
//      None.
//

function newPictureWindow(url, text){
foto = window.open("", "fotowindow", "toolbar=no, width=800, height=530, menubar=yes, status=yes, scrollbars=yes, resizable=yes, left=80, top=80");

//Picture dimension: W/H 640 x 480

foto.document.clear()
foto.document.open()
foto.document.write('<HTML><HEAD><TITLE>Foto</TITLE>')
foto.document.write('<STYLE TYPE="text/css">');
foto.document.write('A:link {COLOR: #0000FF; TEXT-DECORATION: none}');
foto.document.write('A:visited {COLOR: #0000FF; TEXT-DECORATION: none}');
foto.document.write('A:active {COLOR: #0000FF; TEXT-DECORATION: underline}');
foto.document.write('A:hover {COLOR: #0000FF; TEXT-DECORATION: underline}');
foto.document.write('</STYLE>')
foto.document.write('</HEAD>')
foto.document.write('<BODY bgcolor="E0E0E0">')
foto.document.write('<IMG NAME="FotoImage" src="hppic/blank.gif">')
foto.document.images.FotoImage.src = url;
foto.document.write('<BR>','<font face="Verdana" size="2">', text, '</FONT>')
foto.document.write("&nbsp;&nbsp;&nbsp;")
foto.document.write('<A href="JavaScript:self.close()">')
foto.document.write('<Font face="Verdana" size="2" color="#0000FF">')
foto.document.write('<<&nbsp;Luk dette vindue</FONT></A>')
foto.document.write('</BODY></HTML>')
foto.document.close()
}

///////////////////////////////////////////////////////////////////////////////
// FUNCTION new_window
// InputParams
//      URL : Picture file name.
// Returnvalue
//      None.
// Description:
//      Open a window without at picture text.
//

function new_window(url) {
foto = window.open(url,"link","width=800,height=500,toolbar=yes,menubar=yes,status=yes,scrollbars=yes,resizable=yes,left=80,top=80");

foto.document.bgColor= '#E0E0E0';
}


///////////////////////////////////////////////////////////////////////////////
// FUNCTION new_browser
// InputParams
//      URL : Link to a website.
// Returnvalue
//      None.
// Description:
//      Opens a new browser window.
//

function new_browser(url) {
foto = window.open(url,"link","width=800,height=500,toolbar=yes,menubar=yes,location=yes,status=yes,scrollbars=yes,resizable=yes,left=80,top=80");
}

///////////////////////////////////////////////////////////////////////////////
// FUNCTION newPictureWindow
// InputParams
//      URL : Web site url.
// Returnvalue
//      None.
//

function new_window_link(url) {
foto = window.open(url,"displayWindow","width=850,height=500,toolbar=yes,menubar=yes,status=yes,scrollbars=yes,resizable=yes,left=70,top=40");
}
