var gAutoPrint = true; // Flag for whether or not to automatically call the print function

function printscreen()
{
	if (document.layers){
	//Netscape 4 specific code
		pre = 'document.';
		post1 = '';
	}
	if (document.getElementById){
		//Netscape 6 specific code
		pre = 'document.getElementById("';
		post1 = '")';
	}
	if (document.all){
		//IE4+ specific code
		pre = 'document.all.';
		post1 = '';		
	}

	var myLayer = eval(pre + 'contentdiv' + post1);
		
	var printWin = window.open("","printSpecial");
	printWin.document.open();
	printWin.document.write("<html><head><style type='text/css' src='../../../../big.css'></style> <style src='../../../../AnzeigenPortalWeb.css' type='text/css' ></style></head><body> " + myLayer.innerHTML + "<div style='font-family:verdana;font-size:10;'>www.gassner-treuhand.li</div></body></html>");
	printWin.document.close();
	if (gAutoPrint)
		printWin.print();
}


function setActiveStyleSheet(title, reset) {

    var i, a, main;
    for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
        if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
            a.disabled = true;
            if(a.getAttribute("title") == title){  a.disabled = false;}
        }
    }
    if (reset == 1) {
        createCookie("wstyle", title, 365);
        window.location.reload();
    }
}

function setStyle() {
    var style = readCookie("wstyle");
    if (style != null) {
        setActiveStyleSheet(style, 0);
    }
    else
		setActiveStyleSheet("Normal Text", 0);
}

function createCookie(name,value,days) {
    if (days) {
        var date = new Date();
        date.setTime(date.getTime()+(days*24*60*60*1000));
        var expires = "; expires="+date.toGMTString();
    }
    else expires = "";
    document.cookie = name+"="+value+expires+"; path=/;";
}

function readCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
        var c = ca[i];
        while (c.charAt(0)==' ') c = c.substring(1,c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }
    return null;
}

if (window.addEventListener) window.addEventListener("load",setStyle,false);
else if (window.attachEvent) window.attachEvent("onload",setStyle);