
// --------------------
// Öffnet ein Popup-Fenster
//
// function openPopup
// param path : Pfad zur angezeigten Datei
// param popName : Name des Fensters
// param width : Breite des Fensters
// Param height : Höhe des Fensters
//
// return false bei erfolg um andernfalls den href des Links in neuem
//        normalem Browserfenster zu öffnen
//
function openpopup(path,popName,width,height,left,top,scrolling,resize)
{
    if (scrolling == "")
    {
        scrolling = "no";
    }
    if (top == "")
    {
        top = 10;
    }
    if (left == "")
    {
        left = 10;
    }
    if (resize == "")
    {
        resize = "yes";
    }
    resizable = ",resizeable=" + resize + "";
    settings = 'height=' + height + ', width=' + width + ', top=' + top + ',left=' + left + ',scrollbars=' + scrolling + ',resizable=' + resize;
    var newWin = window.open(path, popName, settings); 
    newWin.focus();
    return false;
}
function showObjTree(obj, objName){
var count = 0;
var result = ""
for(var i in obj){
result += objName + "." + i + " = " + obj[i] + "\n";
count++;
}
alert( result );
//document.writeln("<pre>");
//document.writeln(result);
//document.writeln("</pre>");
return result
}
function getElt(id, doc){
	if(cD.nav4){
		var currentLayer;
		var currentDoc;
		if(!doc){
			currentDoc = document;
		}
		else{
			currentDoc = doc;
		}
		currentLayer = currentDoc.layers[id];
		for(var i=0;!currentLayer && i < currentDoc.layers.length;i++){
			currentLayer = getElt(id, currentDoc.layers[i].document);
		}
		return currentLayer;
	}
	else if(cD.ie4up) {
		var elt = eval('document.all.' + id);
		return(elt);
	}
	else if(cD.nav6up) {
		var elt = document.getElementById(id);
		return(elt);
	}
	else if(cD.opera) {
		var elt = document.getElementById(id);
		return(elt);
	}
}

function clientDetection(){
	var agt = navigator.userAgent.toLowerCase();
	
	this.platform = navigator.platform.toLowerCase();
	this.name = agt;
	
	this.major = parseInt(navigator.appVersion);
	this.minor = parseFloat(navigator.appVersion);
	
	this.nav  = ((agt.indexOf('mozilla')!=-1) && ((agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1)));
	this.nav2 = (this.nav && (this.major == 2));
	this.nav3 = (this.nav && (this.major == 3));
	this.nav4 = (this.nav && (this.major == 4));
	this.nav6 = (this.nav && (this.major == 5));
	
	this.ie   = (agt.indexOf("msie") != -1);
	this.ie3  = (this.ie && (this.major == 2));
	this.ie4  = (this.ie && (this.major == 4));
	
	this.opera = (agt.indexOf("opera") != -1);
	this.nav6up = this.nav && (this.major >= 5);
	this.ie4up  = this.ie  && (this.major >= 4);
    
}
var cD = new clientDetection();

function changeButtonColor(eltName, mode)
{
    elt = getElt(eltName); 
    if (elt)
    {
        if (mode == "hi")
        {
            elt.style.backgroundColor = "#A70D01"; 
            elt.style.color = "#FFFFFF";
        }
        else
        {
            elt.style.backgroundColor = "#FFFFFF";
            elt.style.color = "#A70D01";
        }
    }
}
function emptyInput(name)
{
    var defaultvals = new Array();
    defaultvals["vorname"] = "Vorname";
    defaultvals["nachname"] = "Nachname";
    defaultvals["strasse"] = "Strasse/ Nr";
    defaultvals["plz"] = "PLZ";
    defaultvals["ort"] = "Wohnort";
    defaultvals["telefon"] = "Telefon";
    defaultvals["email"] = "E-Mail *";
    defaultvals["anfrage"] = "Ihre Nachricht *";
    
    for (var field in defaultvals)
    {
        if (field != name)
        {
            var aktInput = eval("document.forms[0]." + field);
            if (aktInput)
            {
                if (aktInput.value == "")
                {
                    aktInput.value = defaultvals[field];
                    aktInput.style.color = "#999999";
                }
            }
        }
    }
    
    var aktInput = eval("document.forms[0]." + name);
    if (aktInput)
    {
        if (aktInput.value == defaultvals[name])
        {
            aktInput.value = "";
          //  aktInput.style.color = "#000000";
        }
    }
}

//Shortcuticons
var shortcutimageurl = '/fileadmin/images/header/shortcuts/';
ci = new Array();
ci['scimgfraktion'] = new Array();
ci['scimgfraktion']['lo'] = new Image();
ci['scimgfraktion']['lo'].src = shortcutimageurl + 'sc_fraktion_lo.jpg';
ci['scimgfraktion']['hi'] = new Image();
ci['scimgfraktion']['hi'].src = shortcutimageurl + 'sc_fraktion_hi.jpg';

ci['scimgpresse'] = new Array();
ci['scimgpresse']['lo'] = new Image();
ci['scimgpresse']['lo'].src = shortcutimageurl + 'sc_presse_lo.jpg';
ci['scimgpresse']['hi'] = new Image();
ci['scimgpresse']['hi'].src = shortcutimageurl + 'sc_presse_hi.jpg';

ci['scimgunterbezirk'] = new Array();
ci['scimgunterbezirk']['lo'] = new Image();
ci['scimgunterbezirk']['lo'].src = shortcutimageurl + 'sc_unterbezirk_lo.jpg';
ci['scimgunterbezirk']['hi'] = new Image();
ci['scimgunterbezirk']['hi'].src = shortcutimageurl + 'sc_unterbezirk_hi.jpg';

ci['scimgintern'] = new Array();
ci['scimgintern']['lo'] = new Image();
ci['scimgintern']['lo'].src = shortcutimageurl + 'sc_intern_lo.jpg';
ci['scimgintern']['hi'] = new Image();
ci['scimgintern']['hi'].src = shortcutimageurl + 'sc_intern_hi.jpg';

