function openWindow(url, name, properties)
{
	if (properties == null)
	{
		var properties = "width=385,height=335,scrollbars=yes,resizable=yes"; 
	}
	var datevpop = window.open(url, name, properties);
	datevpop.focus();
}

function openWindowKontakt(url, thema, mailto, fromUrl, zielgruppe, linkposition)
{
	var properties = "width=780,height=640,scrollbars=yes,resizable=no"; 
	var eThema  = encodeURIComponent (thema);
	var eMailto = encodeURIComponent (mailto);
	var eFromUrl = encodeURIComponent (fromUrl);
	var eZielgruppe = encodeURIComponent (zielgruppe);
	var eLinkposition = encodeURIComponent (linkposition);
	var datevpop = window.open(url + "&zg=" + eZielgruppe + "&thema=" + eThema + "&mailto=" + eMailto + "&url=" + eFromUrl + "&linkpos=" + eLinkposition, 'Kontakt', properties);
	datevpop.focus();
}

function openWindowTalkandClick(domain, contextroot, seitentitel, mailto, telefon, fromUrl)
{
	var properties = "width=780,height=600,scrollbars=yes,resizable=no"; 
	var eSeitentitel  = escape (seitentitel);
	var eMailto = escape (mailto);
	var eFromUrl = escape (fromUrl);
	var url = "http://" + domain + "/" + contextroot + "/ShowTalkAndClick.do?anwendung=PORTALE&agentmail=" + eMailto + "&agentnr=" + telefon + "&thema=" + eSeitentitel + "&url=" + eFromUrl;
	var datevpop = window.open(url, 'Rueckruf', properties);
	datevpop.focus();
}

function openWindowSiteMap(domain, contextroot, pid, zg)
{
	var properties = "width=860,height=680,scrollbars=yes,resizable=no"; 
	var datevpop = window.open("http://" + domain + "/" + contextroot + "/ShowSiteMap.do?pid=" + pid + "&zg=" + zg, 'SiteMap', properties);
	datevpop.focus();
}

function openWindowHilfe(url)
{
	var properties = "width=780,height=600,scrollbars=yes,resizable=no"; 
	var datevpop = window.open(url, 'Hilfe', properties);
	datevpop.focus();
}

function openWindowRecommendation(url, thema, recUrl, zielgruppe, linkposition)
{
	var properties = "width=780,height=570,scrollbars=yes,resizable=no"; 
	var eThema  = encodeURIComponent (thema);
	var eRecUrl = encodeURIComponent (recUrl);
	var eZielgruppe = encodeURIComponent (zielgruppe);
	var eLinkposition = encodeURIComponent (linkposition);
	var datevpop = window.open(url + "&zg=" + eZielgruppe + "&thema=" + eThema + "&url=" + eRecUrl + "&linkpos=" + eLinkposition, 'Empfehlung', properties);
	datevpop.focus();
}

function openWindowPrintPreview(url)
{
	var properties = "width=650,height=681,scrollbars=yes,resizable=yes,toolbar=yes,status=yes,menubar=yes"; 
	var datevpop = window.open(url, 'datevpop', properties);
	datevpop.focus();
}

function openWindowSearch(portal, bereich, zielgruppe, suchausdruck)
{
	var baseUrl = "http://www2.datev.de/dpisearch/ShowExpertSearch.do?";
	
	if (suchausdruck && suchausdruck != "")
	{
		baseUrl = "http://www2.datev.de/dpisearch/Wait.do?";
	} 
	
	var url = baseUrl + "portal=" + portal + "&";
	
	var bereichskuerzel;
	var zgkuerzel;
	
	if (bereich && bereich != "")
	{
		bereichskuerzel = "bereich" + escape(bereich);
		bereichskuerzel = bereichskuerzel.replace(/\//g, "%2F");
		url += bereichskuerzel + "=on&bereichsgruppe=selected&";
	}
	if (zielgruppe && zielgruppe != "")
	{
		zgkuerzel = "zg" + escape(zielgruppe);
		zgkuerzel = zgkuerzel.replace(/\//g, "%2F");
		url += zgkuerzel + "=on&";
		url += "zg=" + zielgruppe + "&";
	}
	if (suchausdruck && suchausdruck != "")
	{
		// JS kann kein UTF-8 :-/ aber die Browser machen das schon!
		// "suchausdruck=" + escape(suchausdruck) + "&" +
		// siehe http://www.worldtimzone.com/res/encode/
		url +=
			"suchausdruck=" + encodeURIComponent(suchausdruck) + "&" +
			"tabe=treffer&" +
			"erstaufruf=off&" +
			"nichtoeffentlich=www2&" +
			"zusammenfassung=on";
	}
	var properties = "width=950,height=600,scrollbars=yes,resizable=yes"; 
	var datevpop = window.open(url, 'popsearch', properties);
	datevpop.focus();
}


function openWindowBasket()
{
	var properties = "width=600,height=456,scrollbars=yes,resizable=no"; 
	var datevpop = window.open('best_wk_popup.html', 'popbasket', properties);
	datevpop.focus();
}

function openWindowNotepad()
{
	var properties = "width=600,height=456,scrollbars=yes,resizable=no"; 
	var datevpop = window.open('best_wk_popup.html', 'popnotepad', properties);
	datevpop.focus();
}

function openWindowPriceinfo()
{
	var properties = "width=600,height=456,scrollbars=yes,resizable=no"; 
	var datevpop = window.open('preisinformation_popup.html', 'poppriceinfo', properties);
	datevpop.focus();
}


function openProduktsuche(portal, zielgruppe, strSuchbegriff)
{
	// Verwendung in der Produktsuche-Box
	top.window.location.href = "http://www.datev.de/portal/ShowPage.do?pid=" + portal + "&amp;zg=" + zielgruppe + "&amp;nal=pk_suche&amp;url=http%3A%2F%2Fwww.datev.de%2Fprodkat%2Fservlet%2Fde.datev.prodkat.PKContent%3Fx_sk%3Dsc%26amp%3Bpid%3D" + portal + "%26amp%3Bzg%3D" + zielgruppe + "%26amp%3Bx_sstr%3D" + strSuchbegriff;
}

function makeHomepage()
{

	if (navigator.appName.indexOf("Internet Explorer") > -1)
	{
		// für den Internet Explorer...

		parent.content.document.body.style.behavior='url(#default#homepage)';
		parent.content.document.body.setHomePage(JS_GLOBAL_VAR_RequestUrl);
	}
	else
	{
		// für die restlichen Browser...
		alert(unescape("Diese Funktion wird von Ihrem Webbrowser leider nicht unterst%FCtzt."));
	}

}

function makeFavorite()
{

	if (navigator.appName.indexOf("Internet Explorer") > -1)
	{
		// für den Internet Explorer...
		window.external.AddFavorite(JS_GLOBAL_VAR_FavoriteUrl, JS_GLOBAL_VAR_FavoriteTitle);
	}
	else
	{
		// für die restlichen Browser...
		alert(unescape("Diese Funktion wird von Ihrem Webbrowser leider nicht unterst%FCtzt."));
	}

}

function writeAdServerButton(Position, AdLink, AdLinkTarget, Bannername, AlternativText, LinkTyp)
{
	// writeAdServerButton(..) erzeugt einen Button für die rechte Spalte (max. Breite 188px)
	// Beispiel:
	// Position = Positionsname
	// AdLink = Link für href
	// AdLinkTarget = Target fuer href
	// Bannername = inkl. Pfad
	// Alternativtext = beliebig
	document.write('<table width="188" cellpadding="0" cellspacing="0" border="0">');
	document.write('<tr>');
	document.write('<td class="lineGrey4" colspan="3"><img src="'+JS_GLOBAL_VAR_PathImages+'/leer.gif" width="1" height="1" alt="" border="0"/></td>');
	document.write('</tr>');
	document.write('<tr>');
	document.write('<td class="boxInfoContGrey5" colspan="3"><img src="'+JS_GLOBAL_VAR_PathImagesModule+'/spacer_homenews.gif" alt=""/></td>');
	document.write('</tr>');
	document.write('<tr class="boxInfoContGrey5">');
	document.write('<td colspan="3" align="center">');
	document.write('<a href="'+AdLink+'" target="'+AdLinkTarget+'">');
	document.write('<img border="0" src="'+Bannername+'" alt="'+AlternativText+'"/>');
	document.write('</a>');
	document.write('</td>');
	document.write('</tr>');
	document.write('<tr>');
	document.write('<td class="boxInfoContGrey5" colspan="3"><img src="'+JS_GLOBAL_VAR_PathImagesModule+'/spacer_homenews.gif" alt=""/></td>');
	document.write('</tr>');
	document.write('</table>');
}

function writeAdServerBox(Position, AdLink, AdLinkTarget, Bannername, AlternativText, LinkTyp, BoxTitel, BoxText)
{
	/*
		Beispiel für die Anwendung im Ad-Server:

		Position = '%%POSITION%%';
		AdLink = '%%SERVER%%/RealMedia/ads/click_lx.ads/%%PAGE%%/%%RAND%%/%%POS%%/%%CAMP%%/%%IMAGE%%/%%USER%%';
		AdLinkTarget = '%%TARGET%%';
		Bannername = '%%SERVER%%/RealMedia/ads/Creatives/%%CAMP%%/button_anmelden_mit_rabatt.gif';
		AlternativText = '%%ALT%%';
		LinkTyp = 'mjx';
		BoxTitel = 'Anmeldung';
		BoxText = 'Nutzen Sie unser Formular und melden Sie sich jetzt zum DATEV-Kongress an!';

		writeAdServerBox(Position, AdLink, AdLinkTarget, Bannername, AlternativText, LinkTyp, BoxTitel, BoxText);
	*/

	document.write('<table width="188" cellpadding="0" cellspacing="0" border="0">');
		document.write('<tr class="boxInfoHeadGrey">');
			document.write('<td><img src="'+JS_GLOBAL_VAR_PathImages+'/leer.gif" width="8" height="1" alt="" border="0"/></td>');
			document.write('<td><img src="'+JS_GLOBAL_VAR_PathImages+'/leer.gif" width="7" height="1" alt="" border="0"/></td>');
			document.write('<td><img src="'+JS_GLOBAL_VAR_PathImages+'/leer.gif" width="13" height="1" alt="" border="0"/></td>');
			document.write('<td><img src="'+JS_GLOBAL_VAR_PathImages+'/leer.gif" width="152" height="1" alt="" border="0"/></td>');
			document.write('<td><img src="'+JS_GLOBAL_VAR_PathImages+'/leer.gif" width="8" height="1" alt="" border="0"/></td>');
		document.write('</tr>');

		document.write('<tr>');
			document.write('<td class="boxInfoHeadGrey" colspan="5"><img src="'+JS_GLOBAL_VAR_PathImages+'/leer.gif" width="1" height="1" alt="" border="0"/></td>');
		document.write('</tr>');

		document.write('<tr>');
			document.write('<td class="boxInfoHeadGrey"><img src="'+JS_GLOBAL_VAR_PathImages+'/leer.gif" width="1" height="1" alt="" border="0"/></td>');
			document.write('<td class="boxInfoHeadGrey" colspan="3">');
				document.write('<div class="infoSHead1">');
					document.write('<nobr>'+BoxTitel+'</nobr>');
				document.write('</div>');
			document.write('</td>');
			document.write('<td class="boxInfoHeadGrey"><img src="'+JS_GLOBAL_VAR_PathImages+'/leer.gif" width="1" height="1" alt="" border="0"/></td>');
		document.write('</tr>');

		document.write('<tr>');
			document.write('<td class="boxInfoHeadGrey" colspan="5"><img src="'+JS_GLOBAL_VAR_PathImages+'/leer.gif" width="1" height="2" alt="" border="0"/></td>');
		document.write('</tr>');

		document.write('<tr>');
			document.write('<td class="boxWhite" colspan="5"><img src="'+JS_GLOBAL_VAR_PathImages+'/leer.gif" width="1" height="1" alt="" border="0"/></td>');
		document.write('</tr>');

		document.write('<tr>');
			document.write('<td class="boxInfoContGrey5" colspan="5"><img src="'+JS_GLOBAL_VAR_PathImages+'/leer.gif" width="1" height="3" alt="" border="0"/></td>');
		document.write('</tr>');

		document.write('<tr>');
			document.write('<td class="boxInfoContGrey5"><img src="'+JS_GLOBAL_VAR_PathImages+'/leer.gif" width="1" height="1" alt="" border="0"/></td>');
			document.write('<td class="boxInfoContGrey5" colspan="3">');
				document.write('<div class="infoSText">'+BoxText+'</div>');
			document.write('</td>');
			document.write('<td class="boxInfoContGrey5"><img src="'+JS_GLOBAL_VAR_PathImages+'/leer.gif" width="1" height="1" alt="" border="0"/></td>');
		document.write('</tr>');

		document.write('<tr>');
			document.write('<td class="boxInfoContGrey5" colspan="5"><img src="'+JS_GLOBAL_VAR_PathImages+'/leer.gif" width="1" height="6" alt="" border="0"/></td>');
		document.write('</tr>');

		document.write('<tr>');
			document.write('<td class="boxInfoContGrey5"><img src="'+JS_GLOBAL_VAR_PathImages+'/leer.gif" width="1" height="1" alt="" border="0"/></td>');
			document.write('<td class="boxInfoContGrey5" colspan="3" align="center">');
				document.write('<a href="'+AdLink+'" target="'+AdLinkTarget+'">');
				document.write('<img border="0" src="'+Bannername+'" alt="'+AlternativText+'"/>');
				document.write('</a>');
			document.write('</td>');
			document.write('<td class="boxInfoContGrey5"><img src="'+JS_GLOBAL_VAR_PathImages+'/leer.gif" width="1" height="1" alt="" border="0"/></td>');
		document.write('</tr>');

		document.write('<tr>');
			document.write('<td class="boxInfoContGrey5" colspan="5"><img src="'+JS_GLOBAL_VAR_PathImages+'/leer.gif" width="1" height="12" alt="" border="0"/></td>');
		document.write('</tr>');

	document.write('</table>');
}

function writeAdServerTextImageBox(Position, AdLink, AdLinkTarget, Bannername, AlternativText, LinkTyp, BoxTitel, BoxText, GenerateTextLink, GenerateImageLink)
{
	/*
		Beispiel für die Anwendung im Ad-Server:

		Position = '%%POSITION%%';
		AdLink = '%%SERVER%%/RealMedia/ads/click_lx.ads/%%PAGE%%/%%RAND%%/%%POS%%/%%CAMP%%/%%IMAGE%%/%%USER%%';
		AdLinkTarget = '%%TARGET%%';
		Bannername = '%%SERVER%%/RealMedia/ads/Creatives/%%CAMP%%/button_anmelden_mit_rabatt.gif';
		AlternativText = '%%ALT%%';
		LinkTyp = 'mjx';
		BoxTitel = 'Anmeldung';
		BoxText = 'Nutzen Sie unser Formular und melden Sie sich jetzt zum DATEV-Kongress an!';
		GenerateTextLink = 'yes';
		GenerateImageLink = 'yes';
		
		writeAdServerTextImageBox(Position, AdLink, AdLinkTarget, Bannername, AlternativText, LinkTyp, BoxTitel, BoxText, GenerateTextLink, GenerateImageLink);
	*/

	document.write('<table width="188" cellpadding="0" cellspacing="0" border="0">');
		document.write('<tr class="boxInfoHeadGrey">');
			document.write('<td><img src="'+JS_GLOBAL_VAR_PathImages+'/leer.gif" width="8" height="1" alt="" border="0"/></td>');
			document.write('<td><img src="'+JS_GLOBAL_VAR_PathImages+'/leer.gif" width="7" height="1" alt="" border="0"/></td>');
			document.write('<td><img src="'+JS_GLOBAL_VAR_PathImages+'/leer.gif" width="13" height="1" alt="" border="0"/></td>');
			document.write('<td><img src="'+JS_GLOBAL_VAR_PathImages+'/leer.gif" width="152" height="1" alt="" border="0"/></td>');
			document.write('<td><img src="'+JS_GLOBAL_VAR_PathImages+'/leer.gif" width="8" height="1" alt="" border="0"/></td>');
		document.write('</tr>');

		document.write('<tr>');
			document.write('<td class="boxInfoHeadGrey" colspan="5"><img src="'+JS_GLOBAL_VAR_PathImages+'/leer.gif" width="1" height="1" alt="" border="0"/></td>');
		document.write('</tr>');

		document.write('<tr>');
			document.write('<td class="boxInfoHeadGrey"><img src="'+JS_GLOBAL_VAR_PathImages+'/leer.gif" width="1" height="1" alt="" border="0"/></td>');
			document.write('<td class="boxInfoHeadGrey" colspan="3">');
				document.write('<div class="infoSHead1">');
					document.write('<nobr>'+BoxTitel+'</nobr>');
				document.write('</div>');
			document.write('</td>');
			document.write('<td class="boxInfoHeadGrey"><img src="'+JS_GLOBAL_VAR_PathImages+'/leer.gif" width="1" height="1" alt="" border="0"/></td>');
		document.write('</tr>');

		document.write('<tr>');
			document.write('<td class="boxInfoHeadGrey" colspan="5"><img src="'+JS_GLOBAL_VAR_PathImages+'/leer.gif" width="1" height="2" alt="" border="0"/></td>');
		document.write('</tr>');

		document.write('<tr>');
			document.write('<td class="boxWhite" colspan="5"><img src="'+JS_GLOBAL_VAR_PathImages+'/leer.gif" width="1" height="1" alt="" border="0"/></td>');
		document.write('</tr>');

		document.write('<tr>');
			document.write('<td class="boxInfoContGrey5" colspan="5"><img src="'+JS_GLOBAL_VAR_PathImages+'/leer.gif" width="1" height="3" alt="" border="0"/></td>');
		document.write('</tr>');

		document.write('<tr>');
			document.write('<td class="boxInfoContGrey5"><img src="'+JS_GLOBAL_VAR_PathImages+'/leer.gif" width="1" height="1" alt="" border="0"/></td>');
			document.write('<td class="boxInfoContGrey5" colspan="3">');

				if (GenerateTextLink == 'yes')
				{
					document.write('<div class="infoSText">');
					document.write('<a class="infoSLink" href="'+AdLink+'" target="'+AdLinkTarget+'">'+BoxText+'</a>');
					document.write('</div>');
				}
				else
				{
					document.write('<div class="infoSText">'+BoxText+'</div>');
				}

			document.write('</td>');
			document.write('<td class="boxInfoContGrey5"><img src="'+JS_GLOBAL_VAR_PathImages+'/leer.gif" width="1" height="1" alt="" border="0"/></td>');
		document.write('</tr>');

		document.write('<tr>');
			document.write('<td class="boxInfoContGrey5" colspan="5"><img src="'+JS_GLOBAL_VAR_PathImages+'/leer.gif" width="1" height="6" alt="" border="0"/></td>');
		document.write('</tr>');

		document.write('<tr>');
			document.write('<td class="boxInfoContGrey5"><img src="'+JS_GLOBAL_VAR_PathImages+'/leer.gif" width="1" height="1" alt="" border="0"/></td>');
			document.write('<td class="boxInfoContGrey5" colspan="3" align="center">');

				if (GenerateImageLink == 'yes')
				{
					document.write('<a href="'+AdLink+'" target="'+AdLinkTarget+'">');
					document.write('<img border="0" src="'+Bannername+'" alt="'+AlternativText+'"/>');
					document.write('</a>');
				}
				else
				{
					document.write('<img border="0" src="'+Bannername+'" alt="'+AlternativText+'">');
				}

			document.write('</td>');
			document.write('<td class="boxInfoContGrey5"><img src="'+JS_GLOBAL_VAR_PathImages+'/leer.gif" width="1" height="1" alt="" border="0"/></td>');
		document.write('</tr>');

		document.write('<tr>');
			document.write('<td class="boxInfoContGrey5" colspan="5"><img src="'+JS_GLOBAL_VAR_PathImages+'/leer.gif" width="1" height="12" alt="" border="0"/></td>');
		document.write('</tr>');

	document.write('</table>');
}

function updateWMTT(e) 
{
	//falls IE dann document-all = true 
	x = (document.all) ? window.event.x + document.body.scrollLeft + 180: e.pageX + 180;
	y = (document.all) ? window.event.y : e.pageY;
	if (wmtt != null)
	{
		wmtt.style.left = (x + 20 - 180) + "px";
		wmtt.style.top 	= (y + 20) + "px";
	}
}

function showWMTT(id) 
{
	wmtt = document.getElementById(id);
	wmtt.style.display = "block";
}

function hideWMTT() 
{
	wmtt.style.display = "none";
}


function checkFrameset(url)
{
	if(top.frames.length == 0 && url != '')
	{
		// Frameset nachladen
		top.location.replace(url);
	}
}


