DefSts = '| VHS Henstedt-Ulzburg | ';
var data="0123456789";var done=1;

function rvsta(text) {decrypt(DefSts+' - '+text,1,1);}

function decrypt(text,max,delay) {if (done) {done = 0;decrypt_helper(text,max,delay,0,max); }}

function decrypt_helper(text,runs_left,delay,charvar,max) {if (!done) {runs_left=runs_left - 1;var status = text.substring(0, charvar); for (var current_char = charvar; current_char < text.length; current_char++) {status += data.charAt(Math.round(Math.random()*data.length));} window.status = status; var rerun = "decrypt_helper('" + text + "'," + runs_left + "," + delay + "," + charvar + ","+max+");";var new_char = charvar+1; var next_char = "decrypt_helper('"+text+"',"+max+","+delay+","+new_char+","+max+");";if(runs_left>0) {setTimeout(rerun,delay);} else {if(charvar<text.length) {setTimeout(next_char,Math.round(delay*(charvar+3)/(charvar+1)));} else {done=1;}}}}

function rvste(){self.status = DefSts;done = 1;}

function rvOpen(n,d,w,h){var l=screen.availWidth-w-10;n=window.open(d,n,"width="+w+",height="+h+",status=no,toolbar=no,menubar=no,scrollbars=1,resizable=0,top=0,left="+l);n.focus();}

function rvOpen2(n,d,w,h){
	alert('Diese Seite arbeitet in vielen Bereichen mit PopUp-Fenstern.\nSollten Sie einen PopUp-Stopper aktiviert haben, geben Sie diese WebSite bitte für neue PopUps frei.\nDie Registrierung öffnet sich nach Klick auf OK...');
	var l=screen.availWidth-w-10;n=window.open(d,n,"width="+w+",height="+h+",status=no,toolbar=no,menubar=no,scrollbars=1,resizable=0,top=0,left="+l);n.focus();
	}

function rvOpen3(n,d,w,h,x,y){
	var n=window.open(d,n,"width="+w+",height="+h+",status=no,toolbar=no,menubar=no,scrollbars=1,resizable=0,top="+x+",left="+y);n.focus();}

function rvWin(n,d,w,h){var l=screen.availWidth-w;n=window.open(d,n,"width="+w+",height="+h+",status=yes,toolbar=yes,menubar=yes,scrollbars=1,resizable=1,top=0,left="+l);n.focus();}

function rvPrint(n){var win=window.open(n,"PrintView","width=150,height=150,top=1,left=1,status=No,menubar=No,scrollbars=No, resizable=No,toolbar=No,alwaysLowered=Yes");}

var minrestore=0
var initialwidth,initialheight
var ie5=document.all&&document.getElementById
var ns6=document.getElementById&&!document.all

function iecompattest(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function loadwindow(url,width,height,wtop,wleft,whead,wframe) {
	if (!ie5&&!ns6) 
		rvOpen(url,whead,width,height)
	else {
		if (top==self) { var p = window; } else { var p = parent.frames[wframe];}
		p.document.getElementById("EditWindow").style.display=''
		p.document.getElementById("EditWindow").style.width=initialwidth=width+"px"
		p.document.getElementById("EditWindow").style.height=initialheight=height+"px"
		p.document.getElementById("EditWindow").style.left=wleft+"px"
		p.document.getElementById("EditWindow").style.left=wleft+"px"
		p.document.getElementById("EditWindow").style.top=ns6? window.pageYOffset*1+wtop+"px" : top.iecompattest().scrollTop*1+wtop+"px"
		p.document.getElementById("EditFrame").src=url
		p.scroll(0,0);}}
function closeit(wframe) {
	if (top==self) { var p = window; } else { var p = parent.frames[wframe];}
		p.document.getElementById("EditWindow").style.display="none";
		p.document.location.reload();
}

function AddBookmark(URL,TITLE){
	if (document.all)
		window.external.AddFavorite(URL,TITLE)
}


// Schriftgroessen anpassen

function RV_chgfont(_size, _targets, _exceptions) {
	this.size = _size || 11;
	this.min = 9;
	this.max = 16;
	this.targets = _targets || ['divDocument','RVtext',''];
	this.exceptions = _exceptions || 'RVnone#RVnicht#';
	this.lucky = this.checkBrowser();
}
RV_chgfont.prototype = {
larger : function() {
	(this.size < this.max) ? ++this.size : this.size;
	if (this.lucky) this.scale();
},
smaller : function() {
	(this.size > this.min) ? --this.size : this.size + 'px';    
	if (this.lucky) this.scale();
},
scale : function() {
	var oTarget = null;
	for (var k = 0; k < this.targets.length; k++) {
		oTarget = document.getElementById(this.targets[k]);
		if (oTarget) this.changeSize(oTarget);  
	}
},
changeSize : function(oo) {
	if (oo.style) {
		oo.style.fontSize = this.size + 'px';
		oo.style.lineHeight = '1.3em';
	}
	for (var k = 0; k < oo.childNodes.length; k++) if (this.exceptions.indexOf((oo.childNodes[k].id || '#') + '#') == -1) this.changeSize(oo.childNodes[k]);
},
checkBrowser : function() {
	if (document.all && document.getElementById) return true;
	if (navigator.userAgent.indexOf('Netscape6/') >= 0 || navigator.userAgent.indexOf('Gecko') >= 0) return true;
	return false;
},
inc : function(oo) {
	this.larger();
	if (oo) oo.blur();
	return false;	
},
dec : function(oo) {
	this.smaller();
	if (oo) oo.blur();
	return false;	
}
}
RVchgfont = new RV_chgfont();

// Schriftgroessen anpassen: ENDE


function highlightWord(node,word) {
	if (node.hasChildNodes) {
		var hi_cn;		
		for (hi_cn=0;hi_cn<node.childNodes.length;hi_cn++) {
			highlightWord(node.childNodes[hi_cn],word);
		}
	}
	// And do this node itself	
	if (node.nodeType == 3) { 
	// text node		
	tempNodeVal = node.nodeValue.toLowerCase();		
	tempWordVal = word.toLowerCase();		
	if (tempNodeVal.indexOf(tempWordVal) != -1) {
			pn = node.parentNode;
			if (pn.className != "highlight") {
				// word has not already been highlighted!
				nv = node.nodeValue;
				ni = tempNodeVal.indexOf(tempWordVal);
				// Create a load of replacement nodes
				before = document.createTextNode(nv.substr(0,ni));
				docWordVal = nv.substr(ni,word.length);
				after = document.createTextNode(nv.substr(ni+word.length));
				hiwordtext = document.createTextNode(docWordVal);
				hiword = document.createElement("span");
				hiword.className = "highlight";
				hiword.appendChild(hiwordtext);
				pn.insertBefore(before,node);
				pn.insertBefore(hiword,node);
				pn.insertBefore(after,node);
				pn.removeChild(node);
			}
		}
	}
}

function RVCopyLink(url) {
	if (url=='') {
	alert('Link ist leer....');
	} else {
		window.clipboardData.setData('Text',url);
	}
}

function galerie(id) {
	var fenster = window.open("http://www.schwarz-production.de/vhs/popup_galerie.php?GID=" + id + "","VHS","locationbar=no,status=no,resizable=no,toolbar=no,scrollbars=no,top=0,left=0,width=704,height=670");
}

