/* Variable zur Zwischenspeicherung der Seitenbreite */ 
var prevWidth = 0;

/* IMAGEMAPS */
var T; // holds the timeout for imagemaps;
var activeCountry = ''; // holds id of visible Country for imagemaps



/* Seitenbreite für den Druck im IE auf auto setzen */ 
function removeWidth() {
  pm = document.getElementById("page-margins");
  prevWidth = pm.style.width;
  pm.style.width = "auto";
}

/* Seitenbreite zurücksetzen */ 
function restoreWidth() {
  pm = document.getElementById("page-margins");
  pm.style.width = prevWidth;
}

/* Event listener im IE registrieren */ 
window.onbeforeprint=removeWidth;
window.onafterprint=restoreWidth;



/* open url */
function openUrl ( url ) {
  if (url)
    window.location.href = url;
}

/* set classname of object O to toggle (mainly for IE's pseudohover) */
function toggleClass ( O, toggle, statusline ) {
  if ( O ) {
    O.className = toggle;
  }
  if (statusline) {
    window.status = statusline;
  }
}

/* restore the default value of an input field */ 
function removeDefault( O, text ) {
  if ( O.value == text )
    O.value = "";
  else if ( O.value == 0 ) // for konquerer+safari
    O.value = "";
}

/* set a default value for an input field */ 
function setDefault( O, text ) {
  if ( O != null && O.value == "" )
    O.value = text;
}

/* Preview Image functions */
function toggleImgS(id) {
	var El;
	if ( El = document.getElementById(id+"s") )
		El.style.display = 'none';
	if ( El = document.getElementById(id+"l") )
		El.style.display = 'inline';
}

function toggleImgL(id) {
	var El;
	if ( El = document.getElementById(id+"l") )
		El.style.display = 'none';
	if ( El = document.getElementById(id+"s") )
		El.style.display = 'inline';
}

//=====================================================
// IMAGEMAP
// show country-information
// country ...  selector for ids
//=====================================================

function showMore ( country ) {
//	document.getElementById('body').style.backgroundColor = 'red';
	if ( activeCountry != '' ) {
		hideMore ( activeCountry );
	}
	if ( document.getElementById( country ) ) {
		document.getElementById( country ).style.display = 'block';
	}
	activeCountry = country;
}

//=====================================================
// hide country-information
// country ...  selector for ids
//=====================================================

function hideMore ( country ) {
	if ( document.getElementById( country ) ) {
		activeCountry = '';
		document.getElementById( country ).style.display = 'none';
	}
}