<!--

var imgPath = "/res/img/";

function openBannerLink(linkPath,widthValue,heightValue, cssPath) {

	bannerPopup=window.open(linkPath, "bannerPopup", "height=" + heightValue + ",width=" + widthValue + ",  resizable=yes, scrollbars=no");
	bannerPopup.focus();
}

function openZoomImage(imgPath,widthValue,heightValue, cssPath, linkText) {

    openImagePopup(imgPath, widthValue, heightValue, cssPath, linkText);
}

function openImmoImage(imgPath,widthValue,heightValue, cssPath, linkText) {

    openImagePopup(imgPath, widthValue, heightValue, cssPath, linkText);
}

function openImagePopup(imgPath,widthValue,heightValue, cssPath, linkText) {

	var scrollBarsValue = "no";

	widthValue = parseInt(widthValue);
	heightValue  = parseInt(heightValue);

	var screenWidthValue = parseInt(screen.width);
	var screenHeightValue  = parseInt(screen.height);

	if (widthValue > (screenWidthValue - 200) || heightValue > (screenHeightValue - 200) ) {

		// check if popup window must be scaled
		if ( widthValue > (screenWidthValue - 200) ) {

			widthValue = screenWidthValue - 200;
		}

		if ( heightValue > (screenHeightValue - 200) ) {
			heightValue = screenHeightValue - 200;
		}

		// always add 18px on popup with scrollBars
		widthValue = widthValue + 18;
		heightValue = heightValue + 18;
		scrollBarsValue = "yes";
	}

	heightValue = parseInt(heightValue) + 24;
	popup=window.open(imgPath, "popup", "height=" + heightValue + ",width=" + widthValue + ",  resizable=yes, scrollbars=" + scrollBarsValue);

	popup.document.write ("<html><head><title>WGZ BANK</title>\n");
	popup.document.write ("<style type=\"text/css\" media=\"screen\">\n");
	popup.document.write ("	@import url(\"" + cssPath + "\");\n");
	popup.document.write ("</style>\n");
	popup.document.write ("</head>\n");
	popup.document.write ("<body>\n");
	
	popup.document.write ("<img alt=\"" + linkText + "\" src=\"");
	popup.document.write ( imgPath );
	popup.document.write ("\" onclick=\"window.close()\" />\n");
	popup.document.write ("<a title=\"" + linkText + "\" href=\"#\" onclick=\"window.close()\">" + linkText + "</a>\n");
	
	popup.document.write ("</body></html>\n");
	popup.document.close();
	popup.focus();
}

function getElementsByClassName(class_name) {
	var all_obj,ret_obj=new Array(),j=0,teststr;
	if(document.all)all_obj=document.all;
	else if(document.getElementsByTagName && !document.all)
	all_obj=document.getElementsByTagName("*");
	for(i=0;i<all_obj.length;i++) {
		if(all_obj[i].className && all_obj[i].className.indexOf(class_name)!=-1) {
			teststr=","+all_obj[i].className.split(" ").join(",")+",";
			if(teststr.indexOf(","+class_name+",")!=-1) {
				ret_obj[j]=all_obj[i];
				j++;
			}
		}
	}
	return ret_obj;
}
		
function turnOff() {
	var divTags = getElementsByClassName ("inner");
	for (i=0; i < divTags.length; i++) {
		document.getElementById(divTags[i].id).style.display = 'none';
	}
	var divTags = getElementsByClassName ("button");
	for (i=0; i < divTags.length; i++) {
		document.getElementById('on' + (i + 1)).style.background="url(" + imgPath + "linkicon_glossar.gif) no-repeat 0em 0.375em";
		document.getElementById('on' + (i + 1)).style.fontWeight="normal";
		document.getElementById('on' + (i + 1)).style.color="#666";
		document.getElementById('glossar' + (i + 1)).style.display="none";
	}
}

function buttons(div) {
	var divTags = getElementsByClassName ("button");
	
	var displayValue = document.getElementById('glossar' + div).style.display;
	
	turnOff();
	
	if (displayValue=="block") {	
		document.getElementById('on' + div).style.background="url(" + imgPath + "linkicon_glossar.gif) no-repeat 0em 0.375em";
		document.getElementById('on' + div).style.fontWeight="normal";
		document.getElementById('on' + div).style.color="#666";
		document.getElementById('glossar' + div).style.display="none";
		
	} else if (displayValue=="none") {
		document.getElementById('on' + div).style.background="url(" + imgPath + "arrow_bottom_orange.gif) no-repeat 0.425em 0.5em";
		document.getElementById('on' + div).style.fontWeight="normal";
		document.getElementById('on' + div).style.color="#0065B5";
		document.getElementById('glossar' + div).style.display="block";
		
	}
}

/**
 *
 * NedStat function used to generate countable PDF Links
 * 
 */
function getResLink(pdfPath, title, linkText) {

    var sitestatURL = "http://de.sitestat.com/wgz/wgzbank/s?";
    var pixelPath = "de.wgzbank.downloads";

    var lastSlashPos = pdfPath.lastIndexOf('/');
    if (lastSlashPos > 0) { 

        if (lastSlashPos < pdfPath.length) {
    
            var fileName = pdfPath.substring(pdfPath.lastIndexOf('/') + 1);
            pixelPath = pixelPath + "." + fileName;
        }
    }

    pdfPath = "http://" + window.location.host + pdfPath;

    var buf = "";
    buf += "<a title=\"";
    buf += title + "\" href=\"";
    buf += sitestatURL;
    buf += pixelPath + "&amp;ns_type=pdf&amp;ns_url=";
    buf += pdfPath;
    buf += "\">" + linkText + "</a>";
    
    return buf;
}

//-->