
function test() {
   alert("Funktion ausgeführt");
}

function openLink(link,target) {
  window.location=link;
}

function laufschriftSatusbar(seed,msg) {
           var out = "";  var j;  var cmd;
           if (seed > 100) { seed = 100; }
           if (seed > 0) {// seed Leerzeichen vor den Text schreiben:
                          for (j = 0; j < seed; j++) { out += " "; }
                          out += msg;
                          // Leerzeichen + Text in die Status-Zeile schreiben:
                          window.status = out;
                          // Funktion laufschrift mit seed-1 zeitverzoegert aufrufen:
                          seed=seed-1;
                          cmd= "laufschriftSatusbar(" + seed + ",'" + msg + "')";
                          window.setTimeout(cmd, 150);
                         }
           else {        if (-seed < msg.length) {
                            // Text vorne abschneiden:
                            out = msg.substring(-seed,msg.length);
                            window.status = out;
                            seed=seed-1;
                            cmd = "laufschriftSatusbar(" + seed + ",'" + msg + "')";
                            window.setTimeout(cmd,150);
                                                 }
                         else {
                            window.status = " ";
                            window.setTimeout("laufschriftSatusbar(100,'" + msg + "')",150);
                              }
                }
}

var ie = ((document.all) && (window.offscreenBuffering)) ? true : false; // IE >= 4.x
var ns = ((document.captureEvents) && (!document.getElementById)) ? true : false; // NN4.x
var mz = ((document.getElementById) && (!document.all) && (document.documentElement)) ? true : false; // NN6/MZ

if (ie || ns || mz)
{
	function init() {
		if(ns) { txtBreite=innerWidth/20; tempo=100; }
		if(ie) { txtBreite=document.body.offsetWidth/20; tempo=140; }
		if(mz) { txtBreite=window.innerWidth/20; tempo=140; }
	    tick(txt0,0);
	}

	function wandleSpaces(c) {
		if(c.indexOf(' ')!=-1) {
			cneu=c.substring(0,c.indexOf(' '))+'&nbsp;'+c.substring(c.indexOf(' ')+1,c.length);
			if(cneu.indexOf(' ')!=-1) wandleSpaces(cneu);
			return cneu;
			}
		else return c;
	}

	function tick(text,pos) {
		var c1=text.substring(pos, pos+1);
		var c2=text.substring(pos+1, pos+txtBreite-1);
		var c3=text.substring(pos+txtBreite-1, pos+txtBreite);
		if(c1==' ') c1='&nbsp;';
		if(c3==' ') c3='&nbsp;';
		c2=wandleSpaces(c2);
		var schrift='<span class="tickertext"><font class="tickertextOut">'+c1+'</font>'+c2+'<font class="tickertextOut">'+c3+'</font></span>';
        // Farbe festlegen, ===>  dort hinten                                                                 ^^^^                   ^^^^                                    ^^^^^
		if(ns){
			document.ticker.document.open()
			document.ticker.document.write(schrift);
    	    document.ticker.document.close();
			}
		if (ie) ticker.innerHTML = schrift;
    	if (mz) document.getElementById("ticker").innerHTML = schrift;
		pos+=1;
		if(pos<text.length)	setTimeout('tick("'+text+'",'+pos+')', tempo);
		else tick(txt0,0);
	}
}




function displayItem(key)
{
    if(queryString(key)=='false')
    {
    	alert("you didn't enter a ?name=value querystring item.");
    }else{
    	return (queryString(key));
    }
}

//functions for Querystrings
function PageQuery(q)
{
    if(q.length > 1) this.q = q.substring(1, q.length);
    else this.q = null;
    this.keyValuePairs = new Array();
    if(q) {
        for(var i=0; i < this.q.split("&").length; i++) {
        	this.keyValuePairs[i] = this.q.split("&")[i];
        }
    }
    this.getKeyValuePairs = function() { return this.keyValuePairs; }
    this.getValue = function(s) {
    for(var j=0; j < this.keyValuePairs.length; j++) {
        if(this.keyValuePairs[j].split("=")[0] == s)
       	   return this.keyValuePairs[j].split("=")[1];
    }
    return false;
    }
    this.getParameters = function() {
        var a = new Array(this.getLength());
        for(var j=0; j < this.keyValuePairs.length; j++) {
            a[j] = this.keyValuePairs[j].split("=")[0];
        }
        return a;
    }
    this.getLength = function() { return this.keyValuePairs.length; }
}

function queryString(key)
{
    var page = new PageQuery(window.location.search);
    return unescape(page.getValue(key));
}
//end functions for Querystrings

