/*
   script for:	www.hundeinberlin.de
   copyright:	Guido Zörner; webmaster@hundeinberlin.de
 */


var commentTextAreaMaxLength = 1500;
var commentTextAreaContent = "";

function initDoc() {
	// Seitenanzeige in Frames möglichst verhindern
	if (top != self) {
		if (window.opera) { // Hack für Opera-Browser
			var newoppara = document.createElement ('p');
			var newopanchor = document.createElement ('a');
			var newopanchorref = document.createAttribute ('href');
			var newopanchorname = document.createAttribute ('name');
			var newopanchortarget = document.createAttribute ('target');
			var newoptext = document.createTextNode (' ');
			newopanchorref.nodeValue = 'javascript:self.location.href(self.location.href)';
			newopanchorname.nodeValue = 'freelink';
			newopanchortarget.nodeValue = '_top';
			newopanchor.setAttributeNode (newopanchorref);
			newopanchor.setAttributeNode (newopanchorname);
			newopanchor.setAttributeNode (ndwopanchortarget);
			newopanchor.appendChild (newoptext);
			newoppara.appendChild (newopanchor);
			document.getElementById('header').appendChild (newoppara);
			document.links["freelink"].click();
		} else {
			top.location = self.location;
		}
	}
	
	// Dokument nach Änderung neu laden
	if (self.location.pathname == "?reload") {
		self.location.reload (true);
		self.location.stop();
	}
	
	return 1;
}

function loadSearchResultBox() {
	// nop
	return 1;
}

function checkSearchForm() {
	// nop
	return 1;
}

function showContents() {
	// nop
	return 1;
}

function showTag() {
	// nop
	return 1;
}

function showDocBox() {
	// nop
	return 1;
}

function countTextArea() { alert("Wegen Wartungsarbeiten steht die Kommentarfunktion zur Zeit leider nicht zur Verfügung.");
	var commentTextAreaLength = document.getElementById("intext").value.length;
	if (commentTextAreaLength > 1500) {
		document.getElementById("intext").value = commentTextAreaContent;
		return;
	} else {
		commentTextAreaContent = document.getElementById("intext").value;
		var commentTextAreaRestLength = commentTextAreaMaxLength - commentTextAreaLength;
		document.getElementById("maxcommenttext").firstChild.nodeValue = "(Noch " + commentTextAreaRestLength + " Zeichen!)";
		return;
	}
}


