function print_version() {
    var divs = getElementsByClassName("printable", "div");
	
    if (divs.length > 0) {
	//alert(divs.length);
        var now = new Date();

        newwindow = window.open('', 'print'+now.getTime(), '');
        newwindow.document.writeln('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
        newwindow.document.writeln('<html><head>');
		
        newwindow.document.writeln('<meta http-equiv="Content-Type" content="text/html; charset=windows-1251"></meta>');
        newwindow.document.writeln('<title>Версия для печати</title>');
        newwindow.document.writeln('<link href="/styles/print.css" rel="stylesheet" type="text/css" />');
		//newwindow.document.writeln('<script type="text/javascript" src="/js/print_xxx.js"></script>');
		//newwindow.document.writeln('<script type="text/javascript" src="/js/galery2.js"></script>');
		
		//newwindow.document.writeln('<script type="text/javascript" src="/js/base.js"></script>');
        //newwindow.document.writeln('<script type="text/javascript" src="/js/expand_photo.js"></script>');
		
		//alert('b');
		//newwindow.document.writeln('<script type="text/javascript" src="/js/unti_scroll.js"></script>');

		//newwindow.document.writeln('<style>#graphicsb0,#graphicsb1,#graphicsb2,#graphicsb3,#graphicsb4,#graphicsb5,#graphicsb6,#graphicsb7,#graphicsb8,#graphicsb9{overflow: visible;}');
		
		//newwindow.document.writeln('#cx100,#cx101,#cx102,#cx103,#cx104,#cx105,#cx106,#cx107,#cx108,#cx109{overflow: visible;}</style>');

        newwindow.document.writeln('</head>');
		newwindow.document.writeln('<body>');
		//alert(divs.length);
        for (var i=0; i<divs.length; i++) {
			//alert(divs[i].id);
            newwindow.document.writeln('<div id="'+divs[i].id+'">');
            newwindow.document.writeln(divs[i].innerHTML);
            newwindow.document.writeln('<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr valign="middle"><td width="155"><img src="/images/logo.jpg" alt="" width="139" border="0" height="42"></td><td><p><span class="RVTS211">ОФИС КОМПАНИИ "STUDIO CERAMICA"</span></p><p>107113 Москва, ул. Русаковская, д.25, стр.1, м. Сокольники</p><p><span class="RVTS211">Тел.:&nbsp;</span>(495) 780-33-34</p></td></tr></table>');
            newwindow.document.writeln('</div>');
        }
		//newwindow.document.writeln('<script type="text/javascript">window.onload=scrollRemove;</script>');
		newwindow.document.writeln('</body></html>');
		//newwindow.document.writeln('<script type="text/javascript">var yy=document.body.getElementsByTagName("DIV");var y;var z,zz;for(var i=0;i<yy.length;i++){y=yy[i];if(y.id.indexOf("graphicsb")>-1){z=y.id.substring(9,10);y.style.overflow="visible";zz=document.getElementById("cx10"+z);zz.style.overflow="visible";}}</script>');
		//newwindow.document.writeln('<script type="text/javascript" src="/js/print.js"></script>');
		//newwindow.document.writeln('<script type="text/javascript" src="/js/expand_photo.js"></script>');
		//newwindow.document.writeln('<script type="text/javascript" src="/js/print2.js"></script>');
		var txt='';
		txt='<script type="text/javascript">';
		txt+='var head = document.getElementsByTagName("head")[0];';
        txt+='script = document.createElement("script");';
        txt+='script.type = "text/javascript";';
        txt+='script.src = "/js/print2.js";';
        txt+='head.appendChild(script);';
        txt+='</script>';
        newwindow.document.writeln(txt);
		newwindow.document.close();
		//alert('close');
        if (window.focus) { newwindow.focus(); }
        return false;
    }
}
function scrollRemove()
{
	alert('a');
	var yy=document.getElementByTagName('DIV');
	var y;
	var z;
	for(var i=0;i<yy.length;i++)
	{
		y=yy[i];
		if(y.id.indexOf("graphicsb")>-1)
		{
			alert(y.id);
		}
	}
}
function init_printver() {
    if ($('print_version') && $('print_version').firstChild) {
        addEvent($('print_version').firstChild, 'click', print_version, false);
    }
}

addEvent(window, 'load', init_printver, false);
