/*
 * Modul: default.js
 * Datum: 28.12.2005
 *
 * Copyright © TENSQUARE gmbh (www.tensquare.de)
 */


function showHideNavigation()
{
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("navall");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}



function onDefLoad()
{
	//setPrefStyle();
	showHideNavigation();	
}



/*********************************************
 * Funktionen für Eingabefelder (focus/blur) *
 *********************************************/
function setFocus(field)
{
	if (isDefined(field.className))
		field.className += ' focus' ;
}

function unsetFocus(field)
{
	if (isDefined(field.className))
		field.className = field.className.replace(field.className == 'focus'?/focus/:/\sfocus/, '');
}

function initFieldsFocus(fields, focusField)
{
	var field;
	
	if (!document.getElementById)
	  return;
	
	for (var i=0; i<fields.length; i++)
	{
		var field = document.getElementById(fields[i]);
		if (!field) continue;
		field.onfocus = new Function("setFocus(this);");
		field.onblur = new Function("unsetFocus(this);");
		if (fields[i] == focusField)
	 	  field.focus();
	}
}

function OpenImgPp(chnelid, contentid, title)
{	
	window.open("ppimg.php?chid=" + chnelid + "&coid=" + contentid + "&title=" + title, title,"width=500,height=550,left=200,top=50,locationbar=no,menubar=no,scrollbars=yes,resizable=yes");	
	return;
}

function OpenPrintImg(nr) 
{	
	window.open("pp_print.php?nr=" + nr,"Printmotive","width=500,height=550,left=200,top=50,locationbar=no,menubar=no,scrollbars=yes,resizable=yes");	
	return;
}

function OpenRouteBigImg() 
{	
	window.open("043_skizze.php","karte","width=500,height=550,left=200,top=50,locationbar=no,menubar=no,scrollbars=yes,resizable=yes");	
	return;
}

function OpenSchnupperpaket(url)
{	
	window.open(url, 'Schnupperpaket', 'HEIGHT=626,resizable=yes,scrollbars=yes,WIDTH=693');	
	return;
}

//Hides the div
function hide(div,nest){
        obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0;
        obj.visibility='hidden'
}
//Shows the div
function show(div,nest){
        obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0;
        obj.visibility='visible'
}

//Default browsercheck, added to all scripts!
function checkBrowser(){
        this.ver=navigator.appVersion
        this.dom=document.getElementById?1:0
        this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
        this.ie4=(document.all && !this.dom)?1:0;
        this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
        this.ns4=(document.layers && !this.dom)?1:0;
        this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
        return this
}
bw=new checkBrowser()