function basketChange (x)
{ /*
* Sets the hidden input basketHasChanged to x.
* Tested with IE6, Opera7, Mozilla5.
* (c) Björn Törnroth 2004-09-25.
*/
var oE = document.getElementById("tiboform"); //var f = document.forms["tiboform"];
oE.basketHasChanged.value = "x";
return;
}


function checkForBasketChange (l)
{ /*
* Sets the hidden input basketHasChanged to x.
* Tested with IE6, Opera7, Mozilla5.
* (c) Björn Törnroth 2004-09-25.
*/
var oE = document.getElementById("tiboform"); //var f = document.forms["tiboform"];
if ( oE.basketHasChanged.value == "1" ) {
    switch (l) {
      case "sv":
        alert ("Ursäkta, men du glömde klicka på Godkänn ändringar/Ok efter att du ändrade i din köpkorg. Vänligen gå tillbaka till föregående sida och upprepa ändringarna och klicka sedan på Godkänn ändringar/Ok.");
        break;
      case "fi":
        alert ("Anteeksi, mutta unohdit klikata Hyväksy muutokset/Ok muutettuasi ostoskorisi. Ystävällisesti palaa edelliselle sivulle ja toista muutokset ja klikkaa sen jälkeen Hyväksy muutokset/Ok.");
        break;
      default:
        alert ("Sorry, but you forgot to click on Accept changes/Ok after you changed your shopping basket contents. Please return to the previous page and repeat your changes and then click on Accept changes/Ok.");
    }
    //alert("checkForBasketChange(" + l + ") = " + f.basketHasChanged.value);
    //popupHelp ("submitForgotten", l, 300, 400); // Doesn't work in Opera7, Mozilla5.
}
return;
}


function popup ( id , l , list )
{ /*
* Opens a popup window to display detailed book info.
* Tested with IE6, Opera7, Mozilla5.
* (c) Björn Törnroth 2004-09-25.
*/
var strUrl = "bookinfo.x?id=" + id + "&l=" + l + "&list=" + list;
var strWinOptions = "toolbar=no,location=no,directories=no,status=no," +
					"menubar=no" +
					",scrollbars=yes,resizable=yes,location=no" +
					",width=500,height=400" +
					",top=10,left=10";
var oPopup = window.open ( strUrl , "wEbbaPopup" , strWinOptions );
oPopup.focus();
return false; // Prevents link from working.
}


function popupHelp(file,l,x,y)
{ /*
* Opens a popup window to display help.
* Tested with IE6, Opera7, Mozilla5.
* (c) Björn Törnroth 2004-09-25.
*/
var strUrl = "help.x?file=" + file + "&l=" + l;
var strWinOptions = "toolbar=no,location=no,directories=no,status=no," +
					"menubar=no" +
					",scrollbars=yes,resizable=yes,location=no" +
					",width=" + x + ",height=" + y +
					",top=0,left=0";
var oPopup = window.open(strUrl, "", strWinOptions);
oPopup.focus();
return false; // Prevents link from working.
}


function clearSearchForm ()
{ /*
* Empties the search form and submits form.
* Tested with IE6, Opera7, Mozilla5.
* (c) Björn Törnroth 2004-09-25.
*/
var oE = document.getElementById("upphovsman2elements");
oE.innerHTML = "";
oE = document.getElementById("bookSearchResults");
oE.innerHTML = "";

oE = document.getElementById("tiboform"); //var f = document.forms["tiboform"];
oE.upphovsman.value = "";
oE.upphovsman2.value = "";
oE.titel.value = "";
oE.titelExakt[0].checked = true;
oE.isbn.value = "";
oE.amnesord.value = "";
oE.ar1.value = "";
oE.ar2.value = "";
oE.submit();
return;
}


function hopToParent (ID)
{ /*
* Navigates from popup to parent closing the popup.
* Tested with IE6, Opera7, Mozilla5.
* (c) Björn Törnroth 2004-09-25.
*/
opener.location.href = "index.x?p=pages/booklists&amp;list=" + ID;
self.close();
return false;
}


function changePage() {
if (self.parent.frames.length != 0) {
    alert('This page is not intended to be in a frameset!');
    self.parent.location=document.location;
}
}


function ClipBoard() 
{ /*
* Copies some text to the clipboard. Internal tool.
* Works with IE only.
* (c) Björn Törnroth 2004-09-25.
*/
tiboform.holdtext.innerText = copytext.innerText;
Copied = tiboform.holdtext.createTextRange();
Copied.execCommand("Copy");
}


setTimeout ('changePage()', 1000);
