function picswapbyid(objectID,newSource) 
{
  var query = window.location.href;
  window.document.getElementById(objectID).src = newSource.src;
}

function goToURL(destination) 
{
  window.location.href = destination;
}

function changeBG(elementid,newColor) 
{
  window.document.getElementById(elementid).style.background = newColor;
}

function changeBG_2(elementidA,elementidB,newColor) 
{
  window.document.getElementById(elementidA).style.background = newColor;
  window.document.getElementById(elementidB).style.background = newColor;
}

function hwechseln_ein_u_picswap(elementidA,farbe,textid,sichtbarkeit,textinhalt,titletextid,titlesichtbarkeit,titletextinhalt) 
{
  window.document.getElementById(elementidA).bgColor = farbe;
  window.document.getElementById(textid).innerText = textinhalt;
  window.document.getElementById(textid).textContent = textinhalt;
  window.document.getElementById(textid).style.visibility = sichtbarkeit;
  window.document.getElementById(textid).style.display = 'block';
  window.document.getElementById(titletextid).innerText = titletextinhalt;
  window.document.getElementById(titletextid).textContent = titletextinhalt;
  window.document.getElementById(titletextid).style.visibility = titlesichtbarkeit;
  window.document.getElementById(titletextid).style.display = 'block';
}

function hwechseln_zwei_u_picswap(elementidA,elementidB,farbe,textid,sichtbarkeit,textinhalt,titletextid,titlesichtbarkeit,titletextinhalt) 
{
  window.document.getElementById(elementidA).bgColor = farbe;
  window.document.getElementById(elementidB).bgColor = farbe;
  window.document.getElementById(textid).innerText = textinhalt;
  window.document.getElementById(textid).textContent = textinhalt;
  window.document.getElementById(textid).style.visibility = sichtbarkeit;
  window.document.getElementById(textid).style.display = 'block';
  window.document.getElementById(titletextid).innerText = titletextinhalt;
  window.document.getElementById(titletextid).textContent = titletextinhalt;
  window.document.getElementById(titletextid).style.visibility = titlesichtbarkeit;
  window.document.getElementById(titletextid).style.display = 'block';
}

function threeColPicSwap(elementidA,elementidB,elementidC,bgColor,original,newObj) 
{
  window.document.getElementById(elementidA).style.background = bgColor;
  window.document.getElementById(elementidB).style.background = bgColor;
  window.document.getElementById(elementidC).style.background = bgColor;
  picswapbyid(original,newObj);
}
function popupToURL_NoBars(destination,width,height) 
{
  var positionX = (screen.width-800)/2;
  var positionY = (screen.height-500)/2;
  theWindow = window.open(destination,'theWindow','width=' + width + ',height=' + height + ',scrollbars=0,location=no,resizable=no,left=' + positionX + ',top=' + positionY + ',toolbar=no');
  theWindow.focus();
}
function popupToURL(destination,width,height) 
{
  var positionX = (screen.width-800)/2;
  var positionY = (screen.height-500)/2;
  theWindow = window.open(destination,'theWindow','width=' + width + ',height=' + height + ',scrollbars=1,location=yes,resizable=yes,left=' + positionX + ',top=' + positionY + ',toolbar=yes');
  theWindow.focus();
}

function printWindow()
{
  window.print();
}

function do_print(url)
{
  var printURL = url + "_print";
  popupToURL(printURL,800,600);
}

function param_print(url, paramString)
{
  var printURL = url + "_print&" + paramString;
  popupToURL(printURL,800,600);
}

function url_print(url)
{
  var printURL = url;
  popupToURL(printURL,800,600);
}

function submitTo(destination)
{
  var theForm = document.searchForm;
  theForm.eID.value = "";
  theForm.method = "post";
  theForm.action = destination;
  theForm.submit();
}

function Left(str, n)
{
  if (n <= 0)
    return "";
  else if (n > String(str).length)
    return str;
  else
    return String(str).substring(0,n);
}
