if(self.opener)window.onload=opener.appSty;
function print_preview(){ newWin=window.open(this.location.href,''); }
function appSty(){
    if (typeof(newWin) != "undefined") {
        var win_style=newWin.document.createElement('link');
        win_style.href="/print-preview.css";
        win_style.rel="stylesheet";
        win_style.type="text/css";
        newWin.document.getElementsByTagName('head')[0].appendChild(win_style);
        newWin.focus();
        setTimeout(function(){newWin.print()},50)
    }
}
