﻿function CallPrint(strid) {
    var prtContent = document.getElementById(strid);
    var WinPrint = window.open('', '', 'letf=1,top=1,width=0,height=0,toolbar=0,scrollbars=0,status=0');
    var css =
                "<style type='text/css'>" +
                "#realityDetail {border-color: #dededd;	border-width: 2px; border-style: solid;	margin: 0;	padding: 0; width: 700px; font-family: Tahoma;  }" +
                "#realityDetail legend { background-color:#3FCAE3; color:Black; font-size: small; padding: 3px; margin-left: 15px; }" +
                "#realityDetail #images { text-align: center; width: 300px; float: left; margin-top: 15px;	padding: 5px; margin-bottom: 5px; }" +
                "#realityDetail .imagesSeparator { background:transparent; border-top:1px solid #dededd; width:240px; margin: 10px; }" +
                "#realityDetail #images img { width: 260px; height: 170px; border-color: #dededd; border-width: 2px;	border-style: solid;  } " +
                "#realityDetail #images .smallImage { width: 83px; height: 52px; cursor: pointer; } " +
                "#realityDetail #text { float: left; display: inline; margin-top: 15px; margin-left: 5px; }" +
                "#realityDetail #text h3 { text-align: left; color: #629F15; }" +
                "#realityDetail #text td { padding-top: 5px; font-size: x-small; } " +
                "#realityDetail #bottom { clear: both; border-top:solid 1px #dededd; }" +
                "#realityDetail #bottom .kontakt { text-align: left; float: left; width: 650px; margin-left: 10px; margin-right: 10px; margin-top: 10px; padding-bottom: 10px; font-size: x-small; }" +
                "#realityDetail #bottom .print { text-align: right; margin-top: 30px; padding-right: 10px; }" +
                "#realityDetail #bottom a { cursor: pointer; }" +
                "#realityDetail #bottom .companyName { font-weight: bold; font-size: medium; }" +
                "#realityDetail .property {	font-weight: bolder; }" +
                ".property { font-weight: bolder; }" +
                ".print{display: none;}" +
                "</style>";
    WinPrint.document.write(css + prtContent.innerHTML);
    WinPrint.document.close();
    WinPrint.focus();
    WinPrint.print();

    if (/Opera[\/\s](\d+\.\d+)/.test(navigator.userAgent) == false) {
        WinPrint.close();
    }
    else {
        WinPrint.alert("Pre vytlačenie stlačte CTRL + P ");
    }
}

function CallChangeImage(strid) {
    var firstImage = $("#firstImage");
    firstImage.attr("src", strid);
}
