
// Determine browser.
var isMinNS4 = document.layers
var ie=document.all&&navigator.userAgent.indexOf("Opera")==-1
var dom=document.getElementById&&!ie&&navigator.userAgent.indexOf("Opera")==-1

var message="(c) Ale Inhalte sind Copyright geschützt";
function click(e) {
if (document.all) {
if (event.button==2||event.button==3) {
alert(message);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;


function popupprint(bericht_id) {
  popupWin = window.open("printform.php?bericht_id="+bericht_id,'printform','width=600,height=570,scrollbars=yes,toolbars=no,menubar=no,resizable=no');
}

function popupsendtofriend(bericht_id) {
  popupWin = window.open("sendtofriend.php?bericht_id="+bericht_id,'sendtofriend','width=400,height=340,scrollbars=no,toolbars=no,menubar=no,resizable=no');
}
function ShowPic(pfad, bildid) {
 Fenster = window.open("ecard.php?pfad="+pfad+"&bildid="+bildid, "ECard", "width=700,height=400,scrollbars");
 Fenster.focus();
}
function goselect() {
  document.location.href='events.php?s_evgrid=' + document.Search.s_evgrid.options[document.Search.s_evgrid.selectedIndex].value;
}

function openpopup(myurl) {
  popupWin = window.open(myurl,'Popup','width=700,height=450,scrollbars=no,toolbars=no,menubar=no,resizable=no');
}


//-----------------------------------------------------------------------------
// Layer visibility.
//-----------------------------------------------------------------------------

function hideLayer(layer) {

  if (isMinNS4)
    layer.visibility = "hide";
  if (ie||dom)
    layer.style.visibility = "hidden";
}

function showLayer(layer) {

  if (isMinNS4)
    layer.visibility = "show";
  if (ie||dom)
    layer.style.visibility = "visible";
}

function inheritLayer(layer) {

  if (isMinNS4)
    layer.visibility = "inherit";
  if (ie||dom)
    layer.style.visibility = "inherit";
}

function getVisibility(layer) {

  if (isMinNS4) {

    if (layer.visibility == "show")
      return "visible";
    if (layer.visibility == "hide")
      return "hidden";
    return layer.visibility;
  }
  if (ie||dom)
    return layer.style.visibility;
  return "";
}

function isVisible(layer) {

  if (isMinNS4 && layer.visibility == "show")
    return(true);
  if (ie||dom && layer.style.visibility == "visible")
    return(true);

  return(false);
}

//-----------------------------------------------------------------------------
// Scroller Funktionen beginnen hier
//-----------------------------------------------------------------------------

function locateObject(n, d) { //v3.0
  var p,i,x;
  if(!d) d=document;
  if((p=n.indexOf("?"))>0&&parent.frames.length)
  {
    d=parent.frames[n.substring(p+1)].document;
    n=n.substring(0,p);
    }
  if(!(x=d[n])&&d.all) x=d.all[n];
  
  for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=locateObject(n,d.layers[i].document);
  return x;
}

function moveVTextFirstBlock(whichdiv)
{

if (document.all)
{
	tdiv=eval(whichdiv)

	if (tdiv.style.pixelTop>0&&tdiv.style.pixelTop<=5)
	{
		tdiv.style.pixelTop=0
		setTimeout("moveVTextFirstBlock(tdiv)",pausebetweenimages)
		setTimeout("moveVTextSecondBlock('vTextSecond')",pausebetweenimages)
		return
	}
	if (tdiv.style.pixelTop>=tdiv.offsetHeight*-1)
	{
		tdiv.style.pixelTop-=5
		setTimeout("moveVTextFirstBlock(tdiv)",10)
	}
	else
{
		tdiv.style.pixelTop=scrollerheight+5
window.status=tdiv.style.pixelTop;
	tdiv.innerHTML=vSlideContent[i]
	if (i==vSlideContent.length-1)
	i=0
else
	i++
}
}
else
{
tlayer=eval(whichdiv)
if (tlayer.top>0&&tlayer.top<=5)
{
tlayer.top=0
setTimeout("moveVTextFirstBlock(tlayer)",pausebetweenimages)
setTimeout("moveVTextSecondBlock(locateObject('vTextSecond'))",pausebetweenimages)
return
}
if (tlayer.top>=tlayer.document.height*-1)
{
tlayer.top-=5
setTimeout("moveVTextFirstBlock(tlayer)",10)
}
else
{
tlayer.top=scrollerheight+5
tlayer.document.write(vSlideContent[i])
tlayer.document.close()
if (i==vSlideContent.length-1)
i=0
else
i++
}
}
}

function moveVTextSecondBlock(whichdiv)
{
if (document.all)
{
tdiv2=eval(whichdiv)

if (tdiv2.style.pixelTop>0&&tdiv2.style.pixelTop<=5)
{
	tdiv2.style.pixelTop=0
	setTimeout("moveVTextSecondBlock(tdiv2)",pausebetweenimages)
	setTimeout("moveVTextFirstBlock('vTextFirst')",pausebetweenimages)
	return
}
window.status=tdiv2.offsetHeight;
if (tdiv2.style.pixelTop>=tdiv2.offsetHeight*-1){
	tdiv2.style.pixelTop-=5
	setTimeout("moveVTextSecondBlock('vTextSecond')",10)
}
else
{
	tdiv2.style.pixelTop=scrollerheight+5
window.status=tdiv2.style.pixelTop
	tdiv2.innerHTML=vSlideContent[i]
	if (i==vSlideContent.length-1)
	i=0
else
	i++
}
}
else if (document.layers)
{
tlayer2=eval(whichdiv)

if (tlayer2.top>0&&tlayer2.top<=5)
{
tlayer2.top=0
setTimeout("moveVTextSecondBlock(tlayer2)",pausebetweenimages)
setTimeout("moveVTextFirstBlock(locateObject('vTextMain').document.layers['vTextFirst'])",pausebetweenimages)
return
}
if (tlayer2.top>=tlayer2.document.height*-1)
{
tlayer2.top-=5
setTimeout("moveVTextSecondBlock(tlayer2)",10)
}
else
{
tlayer2.top=scrollerheight+5
tlayer2.document.write(vSlideContent[i])
tlayer2.document.close()
if (i==vSlideContent.length-1)
i=0
else
i++
}
}
}

function startVTextScroll(){
if (document.all)
{
	locateObject('vTextSecond').style.top=scrollerheight+5
	locateObject('vTextFirst').visibility='visible';
	locateObject('vTextSecond').visibility='visible';
	moveVTextFirstBlock(locateObject("vTextFirst"))
}
else if (document.layers)
{
	locateObject('vTextMain').visibility='show'
	locateObject('vTextFirst').visibility='show'
	locateObject('vTextSecond').top=scrollerheight+5
	locateObject('vTextSecond').visibility='show'
	moveVTextFirstBlock(locateObject('vTextMain').document.layers['vTextFirst'])
}
}

