// Javascript Fehler unterdruecken
/*
onerror = stopError;
function stopError() {
return true;
}
*/

function setSonstige() {
    document.sp.spendentyp[1].checked = true;
}

function checkFields() {
    if (document.sp.spendentyp[0].checked == true) {
        return true;
    }
    else if (document.sp.spendentyp[1].checked == true) {
        StrLen=document.sp.sonstigespende.value.length;
        if (StrLen<3) {
            alert ('Bitte geben Sie eine Organisation ein.');
            return false;
        }
        else {
            return true;
        }
    }
    else {
        // alert ('Bitte wählen Sie eine Organisation aus.');
        return false;
    }
}

function setNameField(ceoname,div,ceo) {
    document.getElementById('setusername').innerHTML = ceoname;
    hideLayer ('divuserinput');
    hideLayer ('divuservalue');
    showLayer (div);
    if (ceo!='') {
    document.f.userhidden.value = ceo;
    }
}

function setName(ceoname,div) {
    document.getElementById('setusername').innerHTML = ceoname;
    hideLayer ('divuserinput');
    hideLayer ('divuservalue');
    showLayer (div);
}

function setField(ceo) {
    if (ceo!='') {
    document.f.userhidden.value = ceo;
    }
}

function goToTop(){
scroll(0, 0);
}


function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}


function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}


function hideLayer (setDiv) {
	MM_changeProp(setDiv,'','style.display','none','DIV');
}


function showLayer (setDiv) {
	MM_changeProp(setDiv,'','style.display','block','DIV');
}

// Topnavi Impressum...
function showDiv (setDiv) {
    // Mainlayer
    hideLayer ('content750');
    hideLayer ('flash100prozent');
    showLayer ('contenttopnavi');
    showLayer ('top');

    // Layer
    hideLayer ('personal');
    hideLayer ('impressum');
    hideLayer ('rechtlichehinweise');
    showLayer (setDiv);
}

// Layer ein/aus bei 2 Flash nebeneinander
function showFlashDiv (setDiv) {
    hideLayer ('contenttopnavi');
    hideLayer ('flash100prozent');
    hideLayer ('contentstandard');
    showLayer (setDiv);
}

// Layer ein/aus Header
function showLayerHeader (setDiv) {
    hideLayer ('headerfinance');
    hideLayer ('headergrc');
    hideLayer ('headermergeracquisitions');
    hideLayer ('headerunternehmenssteuer');
    showLayer (setDiv);
}

// zeigt Flash in einem Layer an
// ACHTUNG ohne wmode sonst werden @ nicht angezeigt!!!
function wFlashLayer(flashmovie,layername,flashheight,flashwidth,divheaderpic) {
    // zuerst DIV einblenden
    showDiv('top');
    showFlashDiv('content750');
    var inhalt;
    var flashvars='';
    var bgcolor='#ffffff';
    var menu=false;
    var quality="high";
    closeTags = "</" + "embed></" + "object>";
    inhalt = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="' + flashwidth + '" height="' + flashheight + '" title=""><param name="movie" value="' + flashmovie + flashvars + '"><param name="quality" value="' + quality + '"><param name="bgcolor" value="' + bgcolor + '" /><param name="menu" value="' + menu + '"><param name="play" value="true"><embed src="' + flashmovie + flashvars + '" quality="' + quality + '" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" bgcolor="' + bgcolor + '" width="' + flashwidth + '" height="' + flashheight + '" menu="' + menu + '" play="true">'+closeTags;
	document.getElementById(layername).innerHTML = inhalt;
    showLayer ('logo');
    showLayer ('topnavi');
    showLayerHeader (divheaderpic);
    scroll(0, 0);
}


// zeigt Flash in einem Layer an
// ACHTUNG mit wmode
function wFlashLayer100(flashmovie,layername,flashheight) {
    // zuerst DIV einblenden
    showFlashDiv('flash100prozent');
    var inhalt;
    var flashvars='';
    var bgcolor='#ffffff';
    var menu=false;
    var quality="high";
    closeTags = "</" + "embed></" + "object>";
    inhalt = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="100%" height="' + flashheight + '" title=""><param name="movie" value="' + flashmovie + flashvars + '"><param name="quality" value="' + quality + '"><param name="bgcolor" value="' + bgcolor + '" /><param name="wmode" value="transparent"><param name="menu" value="' + menu + '"><param name="play" value="true"><embed src="' + flashmovie + flashvars + '" quality="' + quality + '" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" bgcolor="' + bgcolor + '" width="100%" height="' + flashheight + '" menu="' + menu + '" play="true" wmode="transparent">'+closeTags;
    document.write(inhalt);
}


// zeigt Flash Merkliste direkt an
function showFlash(src, width, height, quality, menu, bgcolor, flashvars) {
	closeTags = "</" + "embed></" + "object>";
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="' + width + '" height="' + height + '" title=""><param name="movie" value="' + src + flashvars + '"><param name="quality" value="' + quality + '"><param name="bgcolor" value="' + bgcolor + '" /><param name="wmode" value="transparent"><param name="menu" value="' + menu + '"><param name="play" value="true"><embed src="' + src + flashvars + '" quality="' + quality + '" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" bgcolor="' + bgcolor + '" width="' + width + '" height="' + height + '" menu="' + menu + '" play="true" wmode="transparent">'+closeTags);
	// alert("showFlash() flashvars="+flashvars + " => " + src);
}


// oeffnet Popup wird für popup-Modul benötigt
function openPopup(URL,popname,W,H,scroll,rezisable,X,Y) {
	var URL,popname,W,H,scroll,rezisable,X,Y;
	if (!popname) { popname='popup'; }
	if (!W) { W=520; }
	if (!H) { H=460; }
	if (!scroll) { scroll=0; }
	if (!rezisable) { rezisable=0; }
	if (!X) { X=screen.width/2-(W/2); }
	if (!Y) { Y=screen.height/2-(H/2)-20; }
	properties = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+scroll+",resizable="+rezisable+",";
	properties += "width="+W+",height="+H+",left="+X+",top="+Y;
	popwin=window.open(URL,popname,properties);
	popwin.focus();
}


