// JavaScript Document

function GoSearch()
{
    var suchtext = document.getElementById('txtbox').value
    var v_url =  'default.aspx?searchstr=' + suchtext;
    document.location.href = v_url;
}

//COOKIE SETZEN UND LESEN
function Schreiben(n,w,e)
{
 var a = new Date();
 a = new Date(a.getTime() +e);
 document.cookie = n+'='+w+'; expires='+a.toGMTString()+';';
}

function Lesen(n)
{
 a = document.cookie;
 res = '';
 while(a != '')
 {
  while(a.substr(0,1) == ' '){a = a.substr(1,a.length);}
  cookiename = a.substring(0,a.indexOf('='));
  if(a.indexOf(';') != -1)
  {cookiewert = a.substring(a.indexOf('=')+1,a.indexOf(';'));}
  else{cookiewert = a.substr(a.indexOf('=')+1,a.length);}
  if(n == cookiename){res = cookiewert;}
  i = a.indexOf(';')+1;
  if(i == 0){i = a.length}
  a = a.substring(i,a.length);
 }
return(res)
}

function Loeschen(n)
{
 document.cookie = n+'=; expires=Thu, 01-Jan-70 00:00:01 GMT;';
} 

function NameHolen()    {
    if(document.cookie)
    {
        Posi = Lesen('Pos');
    }
    else
    {
    Posi = 0;
    }
} 

function resizeDiv () {
    //alert(document.cookie);
    NameHolen();
    window.scrollTo(0, Posi);
    Loeschen('Pos');
	var hoch = document.getElementById('Middle').offsetHeight;
	var hoehe2 = document.getElementById('SubNav').offsetHeight;
	var hoeheCon = document.getElementById('Content').offsetHeight;
	var hoeheInf = document.getElementById('Info').offsetHeight;
	var diff = hoch - hoehe2;
	if (hoch != 0) {
		if (diff > 96) {
		    document.getElementById('SubNav').style.height = hoch + 'px';
		    document.getElementById('Info').style.height = hoch + 'px';
	    }
	    else {
   		    document.getElementById('SubNav').style.height = hoch + 106 +'px';
		    document.getElementById('Info').style.height = hoch + 106 + 'px';
        }
    }
    else
    {
        if (hoeheCon > hoeheInf) {
            document.getElementById('SubNav').style.height = hoeheCon + 'px';
		    document.getElementById('Info').style.height = hoeheCon + 'px';
        }    
        else {
           document.getElementById('SubNav').style.height = hoeheinf + 'px';
        }      
    }	
	document.getElementById('Adress').style.visibility = 'visible';
}

function act (name) { 
	name.style.backgroundColor = '#F5F5F5';
}

function out (name) { 
	name.style.backgroundColor = '#FFFFFF';
}

function OpenVideoWindow(url)
{
var width = 640;
var height = 486;
var iLeft = 0;
var iTop  = 0 ;
var sOptions = "toolbar=no,status=no,resizable=no,dependent=no,scrollbars=no,menubar=no,location=no" ;
sOptions += ",width=" + width ;
sOptions += ",height=" + height ;
sOptions += ",left=" + iLeft ;
sOptions += ",top=" + iTop ;
var PopUpFenster = window.open(url, 'URLWindow', sOptions ) ;
PopUpFenster.opener = self;
}

function OpenGalleryWindow(url)
{
var width = 464;
var height = 550;
var iLeft = 0;
var iTop  = 0 ;
var sOptions = "toolbar=no,status=no,resizable=no,dependent=no,scrollbars=no,menubar=no,location=no" ;
sOptions += ",width=" + width ;
sOptions += ",height=" + height ;
sOptions += ",left=" + iLeft ;
sOptions += ",top=" + iTop ;
var PopUpFenster = window.open(url, 'URLWindow', sOptions ) ;
PopUpFenster.opener = self;
}

function Position() {
   var docEl = (
                 typeof document.compatMode != "undefined" && 
                 document.compatMode        != "BackCompat"
                )? "documentElement" : "body";
    yPos = document[docEl].scrollTop;
    Schreiben('Pos',yPos,1000*60*60*24);
}


