	var ContentForPrint = null;
	var LinkForPrint = null;
	var HeaderForPrint = null;
	var classFix = (document.all)?"className":"class";
	function printversion(){
		var NoPrintContent = document.getElementById("NoPrintContent");
		var PrintContent = document.getElementById("PrintContent");
		if(ContentForPrint==null){
			NoPrintContent.style.display = "none";

			LinkForPrint = document.createElement("div");
			LinkForPrint.innerHTML = "<small><a href='javascript:printversion();'>Версия для печати<br>Print Version</a></small>"; 
			LinkForPrint.setAttribute("align", "right");
			document.body.appendChild(LinkForPrint);

			HeaderForPrint = document.createElement("div");
			HeaderForPrint.innerHTML = document.title; 
			HeaderForPrint.setAttribute("id", "HeaderForPrint");
			document.body.appendChild(HeaderForPrint);
	
			ContentForPrint = PrintContent.cloneNode(true);
			ContentForPrint.setAttribute("id", "ContentForPrint");
			document.body.appendChild(ContentForPrint);
			clearElementStyle(ContentForPrint);
		}else{
			NoPrintContent.style.display = "block";

			document.body.removeChild(LinkForPrint);
			document.body.removeChild(HeaderForPrint);
			document.body.removeChild(ContentForPrint);

			ContentForPrint = null;
		}
	}
	
	function clearElementStyle(obj){
		if(obj.all){
			obj.removeAttribute(classFix);
			for(var i=0;i<obj.all.length;i++){
				obj.all[i].setAttribute(classFix,"ContentForPrint");
			}
		}
	}
