function stopError() {
return true;
}
window.onerror = stopError;

function CheckTitle()
{
if (document.forms[2].Title.value == 'Enter Title here' )
	{
	(document.forms[2].Title.value = '' )	
	}
}

function CheckURL()
{
if (document.forms[2].URL.value == 'Enter URL here' )
	{
	(document.forms[2].URL.value = 'http://' );
	(document.forms[2].URL.select())
	}
else if (document.forms[2].URL.value == 'http://' )
	{
	(document.forms[2].URL.value = '' )	
	}
}

function CheckDescription()
{
if (document.forms[2].Description.value == 'Enter Description here' )
	{
	(document.forms[2].Description.value = '' )	
	}
}

function CheckAuthor()
{
if (document.forms[2].Author.value == 'Enter Author or Owner here' )
	{
	(document.forms[2].Author.value = '' )	
	}
}

function CheckEmail()
{
if (document.forms[2].Email.value == 'Enter E-mail here' )
	{
	(document.forms[2].Email.value = '' )	
	}
}

function CheckYear()
{
if (document.forms[2].Year.value == 'Enter Year here' )
	{
	(document.forms[2].Year.value = '' )	
	}
if (document.forms[2].Year.value == 'Enter ISBN here' )
	{
	(document.forms[2].Year.value = '' )	
	}
}

function CheckLanguage()
{
if (document.forms[2].Language.value == 'English' )
	{
	(document.forms[2].Lang_switch.value = '' )
	}
else if (document.forms[2].Language.value == 'Nederlands' )
	{
	(document.forms[2].Lang_switch.value = 'nl' )	
	}
else if (document.forms[2].Language.value == 'Deutsch' )
	{
	(document.forms[2].Lang_switch.value = 'de' )	
	}
else if (document.forms[2].Language.value == 'Français' )
	{
	(document.forms[2].Lang_switch.value = 'fr' )	
	}
else if (document.forms[2].Language.value == 'Italiano' )
	{
	(document.forms[2].Lang_switch.value = 'it' )	
	}
else if (document.forms[2].Language.value == 'Español' )
	{
	(document.forms[2].Lang_switch.value = 'es' )	
	}
else (document.forms[2].Lang_switch.value = '' )
}

function CheckSearch()
{
if (document.forms[3].keyword.value == 'Type a word or a phrase' )
	{
	(document.forms[3].keyword.value = '' )	
	}
}

function CheckSearch2()
{
if (document.forms[3].keyword.value == '' )
	{
	(document.forms[3].keyword.value = 'Type a word or a phrase' )	
	}
}

function CheckGoogle()
{
if (document.forms[2].q.value == 'Type one or more words or a phrase' )
	{
	(document.forms[2].q.value = 'bicycle travel ' );
	(document.forms[2].q.select())
	}
}

function CheckUsername()
{
if (document.forms[2].userid.value == 'Enter username here' )
	{
	(document.forms[2].userid.value = '' )	
	}
if (document.forms[3].userid.value == 'Enter username here' )
	{
	(document.forms[3].userid.value = '' )	
	}
}

//Mask the DOM
if(document.layers){
pre = 'document.';
post = '';
}
if(document.getElementById){
pre = 'document.getElementById("';
post = '").style';
}
if(document.all){
pre = 'document.all.';
post = '.style';
}

//Visibility code
var currentLayer = 'InitialState';
function showLayer(lyr){
	hideLayer(currentLayer);
	eval(pre + lyr + post).visibility = 'visible';
	currentLayer = lyr;
}

function hideLayer(lyr){
	eval(pre + lyr + post).visibility = 'hidden';
}

function xClientHeight() {
  var h = 0;
  if (window.innerHeight) {
    h = window.innerHeight;
    if (!window.opera && document.width > window.innerWidth) h -= 16;
  }
  else if (document.body) {
    if (document.body.clientHeight) h = document.body.clientHeight;
  }  
  return h;
}

var LastPosY = 0;

function move_DIV() {
	if ((ns_pos)?window.pageYOffset:document.body.scrollTop > 0) {
	eval(pre + "TopBtn" + post).visibility = 'visible';
	}
	else {
	eval(pre + "TopBtn" + post).visibility = 'hidden';
	}
	var y = (ns_pos)?window.pageYOffset:document.body.scrollTop;
	y+=xClientHeight()-35;
	if (y!=LastPosY) {
		if (window.opera) {
			document.getElementById('TopBtn').style.pixelTop=y;
		}
		else if (document.layers) {
			document.layers['TopBtn'].top=y;
		}
		else if (document.getElementById) {
			document.getElementById('TopBtn').style.top=y+'px';
		}
		else if (document.all) {
			document.all['TopBtn'].style.pixelTop=y;
		}
		LastPosY=y;
	}
	if (TimeScroll)	window.setTimeout('move_DIV()',50);
}

var TimeScroll = true;

function Init() {
	ns_pos = (typeof window.pageYOffset!='undefined');
	ie_pos = (document.body && typeof document.body.scrollTop!='undefined');
	window.onscroll=function(){window.onscroll=move_DIV;TimeScroll=false;};
	if (ns_pos||ie_pos) move_DIV();
}

function firstFocus()
{
   if (document.forms.length > 0)
   {
      var TForm = document.forms[0];
      for (i=0;i<TForm.length;i++)
      {
         if ((TForm.elements[i].type=="text")||
           (TForm.elements[i].type=="textarea")||
           (TForm.elements[i].type.toString().charAt(0)=="s"))
         {
            document.forms[0].elements[i].focus();
            break;
         }
      }
   }
}

i_SSN=new Image;
i_SSN.src="/ttth/images/ssn0.gif";
a_SSN=new Image;
a_SSN.src="/ttth/images/ssn1.gif";

function Banner(Inactief,Actief) {
document.images[Inactief].src = eval(Actief + '.src');
}

var ZoekBoxHasFocus = false;
function SetZoekBoxFocus(Bool)
{ 
ZoekBoxHasFocus = Bool 
}
function TextBoxWaarde(ZoekTekst)
{ 
if (ZoekBoxHasFocus != true) 
document.TextBoxForm.TextBox.value = ZoekTekst; 
}
function TextBoxLeeg()
{
}
