
function fnResizeImageHeight( oImage, nMaxHeight )
{
	if(oImage.height > nMaxHeight)
	{
		oImage.width = oImage.width - (oImage.height - nMaxHeight);
		oImage.height = nMaxHeight;
	}
}

function fnResizeImageWidth( oImage, nMaxWidth )
{
	if(oImage.width > nMaxWidth)
	{
		oImage.height = oImage.height - (oImage.width - nMaxWidth);
		oImage.width = nMaxWidth;
	}
}

function fnWriteEmail()
{
	var argv = fnWriteEmail.arguments;
	var argc = argv.length;
	var strName = "";
	var strDomain = "";
	var strText = "";

	if (argc > 0)
		strName = argv[0];
	if (argc > 1)
		strDomain = argv[1];
	if (argc > 2)
		strText = argv[2];
		
	if (strText == "")
		strText = strName + "@" + strDomain;
	document.write("<a href=\"mailto:" + strName + "@" + strDomain + "\">" + strText + "</a>");
}



var publishPathIdx = "/";
var publishNameIdx = "index.jsp";

function fnCheckParentFrame()
{
	try
	{
		var path = parent.frames["thecontent"].document.location.pathname;
	}
	catch( err )
	{
		var currUrl = document.location.pathname;
		document.location.replace( publishPathIdx+publishNameIdx+"?activePage="+currUrl+"&activeColumnUri=tcm:0-0-0");
		//document.location.replace( publishPathIdx+publishNameIdx+"?activePage="+currUrl);
	}
}

function fnOpenImpressumPage( strImpressumPage )
{
	var impressum=window.open(strImpressumPage ,'impressuminfo','height=580,width=940');
}

function fnOpenKontaktPage( strContactPage )
{
	var kontakt=window.open(strContactPage,'kontaktinfo','height=450,width=650');
}

function fnOpenXGeoPage( strXGeoPage )
{
	var xgeo=window.open(strXGeoPage, 'xgeo','height=560,width=350,alwaysRaised=1,titlebar=0,scrollbars=no,left=180,top=80');
}

function fnOpenLoginPage( strLoginPage )
{
	var login=window.open(strLoginPage);
}
			
function fnActivateTb( obj )
{
	var bNavigation = obj.id == "tb-navigation";
	var NavImg = top.document.getElementById("NavImg").src;
	var SearchImg = top.document.getElementById("SearchImg").src;
	var bIsNavDisplayed = top.document.getElementById("nav-tr").style.display == "";

	// Wenn tatsächlich umgeschaltet wird -> Images austauschen
	if ( bIsNavDisplayed != bNavigation )
	{
		top.document.getElementById("NavImg").src = SearchImg;
		top.document.getElementById("SearchImg").src = NavImg;
	}
	
	top.document.getElementById("nav-tr").style.display = bNavigation ? "" : "none";
	//top.document.getElementById("navtitle").style.display = bNavigation ? "block" : "none";
	//top.document.getElementById("rootNav").style.backgroundImage = bNavigation ? navigationBkImgSrc : "";
	top.document.getElementById("search-tr").style.display = bNavigation ? "none" : "";
	
	top.document.getElementById("tb-navigation").className = bNavigation ? "tb-active" : "tb-inactive";
	top.document.getElementById("tb-search").className = bNavigation ? "tb-inactive" : "tb-active";
}

function Agent()
{
	var agent = navigator.userAgent.toLowerCase();
	
	this.major = parseInt(navigator.appVersion);
	this.minor = parseFloat(navigator.appVersion);
		
	this.ns = ((agent.indexOf('mozilla')!= -1) && ((agent.indexOf('spoofer')== -1) && (agent.indexOf('compatible')== -1)));
	this.ns4 = (this.ns && (this.major == 4));
	this.ns6 = (this.ns && (this.major = 5) && (agent.indexOf("netscape6/6.") != -1));
	this.ns7 = (this.ns && (this.major = 5) && (agent.indexOf("netscape7/7.") != -1));
	this.ie = (agent.indexOf("msie")!= -1);
	this.ie4 = (this.ie && (this.major == 4) && (agent.indexOf("msie 4.")== -1));
	this.ie5 = (this.ie && (this.major >= 4) && (agent.indexOf("msie 5.") != -1));
	this.ie6 = (this.ie && (this.major >= 4) && (agent.indexOf("msie 6.") != -1));
}
