function windowopenkurse(formular_name)
{
        // Dax-Grafik wird von GIS geliefert. Es wird KEIN Formularname geliefert. Daher Vorbelegung.
        // Eigene Formulare zur Kursabfrage uebergeben Formularname.
        if (!formular_name) {
                formular_name = 'kurse';
        }
        var formular = document.forms[formular_name];
        kurseurl='http://' + window.location.host + '/service/boerseninfo/suche/begriff/' + formular.aktie.value;
        kursefenster=open(kurseurl, 'Boersenkurse','height=800,width=1040,resizable=yes,locationbar=no,menubar=yes,status=no,scrollbars=yes,toolbar=yes');
}


function openBanking(url)
{
	if (screen.availWidth >= "996") {
		win = window.open(url,
		"spardabanking",
		"left=0" +
		",top=0" +
		",height=860" +
		",width=1030" +
		",location=yes,menubar=no,resizable=yes,status=yes,scrollbars=yes");
		} else {
		var windowHeight = (screen.availHeight * 0.85);
		var windowWidth = (screen.availWidth * 0.90);
		var leftX = (screen.availWidth / 2)  - (windowWidth / 2);
		var topY = (screen.availHeight / 2) - (windowHeight / 2);
		win = window.open(url,
		"spardabanking",
		"left=" + leftX +
		",top=" + topY +
		",height=" + windowHeight +
		",width=" + windowWidth +
		",location=yes,menubar=no,resizable=yes,status=yes,scrollbars=yes");
	}
}

function openSicherheitstour(url)
{
    if (screen.availWidth >= "996") {
        win = window.open(url,
        "Sicherheitstour",
        "left=0" +
        ",top=0" +
        ",height=530" +
        ",width=725" +
        ",location=yes,menubar=no,resizable=no,status=yes,scrollbars=no");
        } else {
        var windowHeight = (screen.availHeight * 0.85);
        var windowWidth = (screen.availWidth * 0.90);
        var leftX = (screen.availWidth / 2)  - (windowWidth / 2);
        var topY = (screen.availHeight / 2) - (windowHeight / 2);
        win = window.open(url,
        "Sicherheitstour",
        "left=" + leftX +
        ",top=" + topY +
        ",height=" + windowHeight +
        ",width=" + windowWidth +
        ",location=yes,menubar=no,resizable=no,status=yes,scrollbars=no");
    }
}


function openCardPreview()
{

	win = window.open(
				"/konto_und_depot/kartenvorschau",
				"kartenvorschau",
				"left=100" +
				",top=180" +
				",height=340" +
				",width=800" +
				",location=no,menubar=no,resizable=yes,status=yes,scrollbars=yes"
	);

}

function openImmoWindow()
{
	window = window.open(
			'http://' + window.location.host + '/kredite/immobilienfinanzierung/erlaeuterungen',
			"erlaeuterungen",
			"left=100" +
			",top=100" +
			",height=500" +
			",width=800" +
			",location=no,menubar=no,resizable=yes,status=yes,scrollbars=yes"
	);
}

function openwindow()
{

 	window = window.open('https://www.sparda-giro.de/formular_kunde.php?et_cid=2&et_lid=34&et_sub=sparda-hh','kampagne','width=900,height=700,left=200,top=200,resizable=1');
}

function printpage()
{
	var disp_setting="toolbar=yes,location=no,directories=yes,menubar=yes,";
      disp_setting+="scrollbars=yes,width=800, height=600, left=100, top=25";
	var content_col3 = document.getElementById("col3").innerHTML;
	var head = document.getElementsByTagName("head")[0];
	//var content_head = '<title>Sparda-Bank Hamburg eG</title><link href="/css/print/print.css" rel="stylesheet" type="text/css">';
	var content_head = '<title>Sparda-Bank Hamburg eG</title><link href="/css/content.css" rel="stylesheet" type="text/css"><link href="/css/print/content.css" rel="stylesheet" type="text/css">';

	var docprint=window.open("","",disp_setting);
	docprint.document.open();
	docprint.document.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n \"http://www.w3.org/TR/html4/loose.dtd\">\n<head>");
	docprint.document.write(content_head);
	docprint.document.write('<\/head><body onload="self.print()">');
	docprint.document.write(content_col3);
	docprint.document.write('<\/body><\/html>');
	docprint.document.close();
	docprint.focus();
}

function lesezeichen()
{
        ls = document.getElementById("lesezeichen");
        if (!ls){return;}
        document.getElementById("lesezeichen").onclick = function lesezeichen_setzen()
        {

            var ie      = (!opera && navigator.userAgent.indexOf('MSIE') > -1);
            var opera   = window.opera;
            var safari  = (navigator.userAgent.indexOf('AppleWebKit') > -1);
            var gecko   = (!safari && navigator.userAgent.indexOf('Gecko') > -1);
            var version = parseInt(navigator.appVersion);
            var mac     = navigator.appVersion.indexOf('Mac') > -1;
            var win     = navigator.appVersion.indexOf('Win') > -1;

            apfeltaste  = ((mac) ? 'Apfel' : 'Strg');
            Macintosh   = 'Bitte ' + apfeltaste + '-D druecken, um ein Lesezeichen für diese Seite anzulegen.';
            Firefox     = 'Bitte ziehen Sie diesen Link auf Ihre Lesezeichenleiste.';

            link = 'http://www.sparda-bank-hamburg.de';

            if (ie && version >= 4 && !mac) {
                window.external.AddFavorite(link, 'Sparda-Bank Hamburg eG');
                return false;
            }
            else if (opera || gecko) {
                this.href = link;
                this.title = document.title;
                alert(Firefox);
            }
            else {
                this.href = link;
                alert(Macintosh);
            }
            return false;
        }
}

function updateButtons(){
    $$( 'div.moreButton a' ).each(function(item) {
        if(item.up().hasClassName("moreButtonPNG")){
            return;
        }
        if(Prototype.Browser.IE && parseInt(navigator.userAgent.substring (navigator.userAgent.indexOf("MSIE")+5))==6){
            return;
        }

        theCode = item.innerHTML;
        item.innerHTML = theCode;
        item.up().appendChild(new Element('span', {'class': 'OffsetPNG' }).update("&nbsp;"));
        item.up().addClassName("moreButtonPNG");

        pre = item.up();
        if(pre.hasClassName("moreButtonL")){
            pre.addClassName("moreButtonLPNG");
        }

        if(pre.hasClassName("moreButtonX")){
            pre.addClassName("moreButtonXPNG");
        }

        if(pre.hasClassName("moreButtonGreen")){
            pre.addClassName("moreButtonGreenPNG");
        }

    });

    $$( 'div.moreButtonBig a' ).each(function(item){
        if(item.up().hasClassName("moreButtonBigPNG")){
            return;
        }
        if(Prototype.Browser.IE && parseInt(navigator.userAgent.substring (navigator.userAgent.indexOf("MSIE")+5))==6){
            return;
        }
        theCode = item.innerHTML;
        item.innerHTML = theCode;
        item.up().appendChild(new Element('span', {'class': 'OffsetPNG' }).update("&nbsp;"));
        item.up().addClassName("moreButtonBigPNG");
    });
    $$( 'div.printButton a' ).each(function(item) {
        if(item.up().hasClassName("printButtonPNG")){
            return;
        }
        if(Prototype.Browser.IE && parseInt(navigator.userAgent.substring (navigator.userAgent.indexOf("MSIE")+5))==6){
            return;
        }
        theCode = item.innerHTML;
        item.innerHTML = theCode;
        item.up().appendChild(new Element('span', {'class': 'OffsetPNG' }).update("&nbsp;"));
        item.up().addClassName("printButtonPNG");
    });
    $$( 'div.details div.accordion-toggle' ).each(function(item){
        if(item.up().hasClassName("detailsPNG")){
            return;
        }
        if(Prototype.Browser.IE && parseInt(navigator.userAgent.substring (navigator.userAgent.indexOf("MSIE")+5))==6){
            return;
        }
        item.up().addClassName("detailsPNG");
    });
}



document.observe("dom:loaded", function(){
	if($$("body")){
        $$("body").each(function(item){
            item.addClassName("jsEnabled");
        });
    }

	updateButtons();
});

