function viewScheme(url, title) {
    var iw, ih;
    var myImage = new Image();
    myImage.name = 'img' + Math.random();
    myImage.onload = function() {
        ih = this.height;
        iw = this.width;
        iw += 20;
        ih += 20;
        var w=(window.screen.availWidth - iw) / 2;
        var h=(window.screen.availHeight - ih) / 2;
        var config;
        var w_badb=window.open('#', 'Image', config='scrollbars =1,height='+ih+',width='+iw+',menubar=0,left='+w+',top='+h);
        w_badb.document.open();
        w_badb.document.write('<html><head><title>' + title + '</title></head><body  leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0"><img src="'+url+'" width="'+(iw-20)+'" height="'+(ih-20)+'" alt="'+url+'" border="0" onclick="window.close();"></body></html>');
        w_badb.document.close();
    };
    myImage.src = url;

    return false;
}

jQuery(document).ready(function(){
    jQuery(document).pngFix();

    jQuery('#query').click(function() {
        jQuery(this).val('');
    });

    jQuery('#query').blur(function() {
        if (jQuery(this).val() == '')
            jQuery(this).val('поиск');
    });
});

function showPrint(orderCode) {
    var win = window.open('/order/print/' + orderCode, 'Print order', "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
    win.focus();
}
