// printview-styleswitch
var url = document.location.href;
var params = url.match(/\?[^\?]*$/);
var is_printview = ( params && url.match(/printview=true/) ) ? true : false;
if ( is_printview ) {
    document.write('<link rel="stylesheet" type="text/css" href="/reddot.css" />');
    document.write('<form name="drucken" method="post" action="javascript:window.print()"><br><p align="right"><input type="submit" value="Drucken">&nbsp;&nbsp;</p></form>');
}

// printview
function printview() {
    var param = (is_printview) ? '' : 'printview=true';
    var param = (params) ? '&' + param : '?' + param;
    openWin(document.location.href+param, 'print');
}

// window-opener
function openWin(url, typ) {

    switch (typ) {

        case 'artikelempfehlung':
        var w = 339; var h = 470;
        var t = (screen.height/2)-(h/2);
        var l = (screen.width/2)-(w/2);
        window.open(url, typ, 'width='+w+',height='+h+',top='+t+',left='+l+',toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=0');
        break;

        case 'lieferbedingungen':
        var w = 339; var h = 470;
        var t = (screen.height/2)-(h/2);
        var l = (screen.width/2)-(w/2);
        window.open(url, typ, 'width='+w+',height='+h+',top='+t+',left='+l+',toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=0');
        break;

        case 'print':
        var w = 550; var h = 600;
        var t = (screen.height/2)-(h/2);
        var l = (screen.width/2)-(w/2);
        window.open(url, typ, 'width='+w+',height='+h+',top='+t+',left='+l+',toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=0');
        break;

        case 'agb_seminare':
        var w = 339; var h = 470;
        var t = (screen.height/2)-(h/2);
        var l = (screen.width/2)-(w/2);
        window.open(url, typ, 'width='+w+',height='+h+',top='+t+',left='+l+',toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=0');
        break;

    }
}