/*
	Slimbox v1.63 - The ultimate lightweight Lightbox clone
	(c) 2007-2008 Christophe Beyls <http://www.digitalia.be>
	MIT-style license.
*/
var Slimbox;(function(){var G={},H=0,F,M,B,T,U,P,E,N,K=new Image(),L=new Image(),Y,b,Q,I,X,a,J,Z,C;window.addEvent("domready",function(){$(document.body).adopt($$([Y=new Element("div",{id:"lbOverlay"}).addEvent("click",O),b=new Element("div",{id:"lbCenter"}),a=new Element("div",{id:"lbBottomContainer"})]).setStyle("display","none"));Q=new Element("div",{id:"lbImage"}).injectInside(b).adopt(I=new Element("a",{id:"lbPrevLink",href:"#"}).addEvent("click",D),X=new Element("a",{id:"lbNextLink",href:"#"}).addEvent("click",S));J=new Element("div",{id:"lbBottom"}).injectInside(a).adopt(new Element("a",{id:"lbCloseLink",href:"#"}).addEvent("click",O),Z=new Element("div",{id:"lbCaption"}),C=new Element("div",{id:"lbNumber"}),new Element("div",{styles:{clear:"both"}}));E={overlay:new Fx.Tween(Y,{property:"opacity",duration:800}).set(0),image:new Fx.Tween(Q,{property:"opacity",duration:500,onComplete:A}),bottom:new Fx.Tween(J,{property:"margin-top",duration:400})}});Slimbox={open:function(f,e,d){F=$extend({loop:false,overlayOpacity:0.2,resizeDuration:400,resizeTransition:false,initialWidth:250,initialHeight:250,animateCaption:true,showCounter:true,counterText:"Фото {x} из {y}"},d||{});if(typeof f=="string"){f=[[f,e]];e=0}M=f;F.loop=F.loop&&(M.length>1);c();R(true);P=window.getScrollTop()+(window.getHeight()/15);E.resize=new Fx.Morph(b,$extend({duration:F.resizeDuration,onComplete:A},F.resizeTransition?{transition:F.resizeTransition}:{}));b.setStyles({top:P,width:F.initialWidth,height:F.initialHeight,marginLeft:-(F.initialWidth/2),display:""});E.overlay.start(F.overlayOpacity);H=1;return V(e)}};Element.implement({slimbox:function(d,e){$$(this).slimbox(d,e);return this}});Elements.implement({slimbox:function(d,g,f){g=g||function(h){return[h.href,h.title]};f=f||function(){return true};var e=this;e.removeEvents("click").addEvent("click",function(){var h=e.filter(f,this);return Slimbox.open(h.map(g),h.indexOf(this),d)});return e}});function c(){Y.setStyles({top:window.getScrollTop(),height:window.getHeight()})}function R(d){["object",window.ie?"select":"embed"].forEach(function(f){Array.forEach(document.getElementsByTagName(f),function(g){if(d){G[g]=g.style.visibility}g.style.visibility=d?"hidden":G[g]})});Y.style.display=d?"":"none";var e=d?"addEvent":"removeEvent";window[e]("scroll",c)[e]("resize",c);document[e]("keydown",W)}function W(d){switch(d.code){case 27:case 88:case 67:O();break;case 37:case 80:D();break;case 39:case 78:S()}return false}function D(){return V(T)}function S(){return V(U)}function V(d){if((H==1)&&(d>=0)){H=2;B=d;T=((B||!F.loop)?B:M.length)-1;U=B+1;if(U==M.length){U=F.loop?0:-1}$$(I,X,Q,a).setStyle("display","none");E.bottom.cancel().set(0);E.image.set(0);b.className="lbLoading";N=new Image();N.onload=A;N.src=M[d][0]}return false}function A(){switch(H++){case 2:b.className="";Q.setStyles({backgroundImage:"url("+M[B][0]+")",display:""});$$(Q,J).setStyle("width",N.width);$$(Q,I,X).setStyle("height",N.height);Z.set("html",M[B][1]||"");C.set("html",(F.showCounter&&(M.length>1))?F.counterText.replace(/{x}/,B+1).replace(/{y}/,M.length):"");if(T>=0){K.src=M[T][0]}if(U>=0){L.src=M[U][0]}if(b.clientHeight!=Q.offsetHeight){E.resize.start({height:Q.offsetHeight});break}H++;case 3:if(b.clientWidth!=Q.offsetWidth){E.resize.start({width:Q.offsetWidth,marginLeft:-Q.offsetWidth/2});break}H++;case 4:a.setStyles({top:P+b.clientHeight,marginLeft:b.style.marginLeft,visibility:"hidden",display:""});E.image.start(1);break;case 5:if(T>=0){I.style.display=""}if(U>=0){X.style.display=""}if(F.animateCaption){E.bottom.set(-J.offsetHeight).start(0)}a.style.visibility="";H=1}}function O(){if(H){H=0;N.onload=$empty;for(var d in E){E[d].cancel()}$$(b,a).setStyle("display","none");E.overlay.chain(R).start(0)}return false}})();

// AUTOLOAD CODE BLOCK (MAY BE CHANGED OR REMOVED)
Slimbox.scanPage = function() {
	var links = $$("a").filter(function(el) {
		return el.rel && el.rel.test(/^lightbox/i);
	});
	$$(links).slimbox({/* Put custom options here */}, null, function(el) {
		return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
	});
};
window.addEvent("domready", Slimbox.scanPage);





// Функция версии для печати
function viewPrint()
{
 var cr, crb, crt, ccounters, n1, n2, rtext
 var wind_img

 cr=document.getElementById("Content").innerHTML;
 crt=document.getElementsByTagName("title")[0].innerHTML;
 n1=cr.indexOf('<!-- 19722009 -->');
 n1=n1+17;
 n2=cr.indexOf('<!-- 20091972 -->');
 rtext='';
 for (var i = n1; i < n2; i++) 
 rtext=rtext + cr.charAt(i);
 
 wind_img=window.open('','','left=0,top=0,width=750,height=600,resizable=yes,toolbar=0,location=0,directories=0,status=0,scrollbars=yes,menubar=0');
 wind_img.focus();
 wind_img.document.open();
 wind_img.document.write('<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\"><html><head>');

 wind_img.document.write('<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1251\" />');
 wind_img.document.write('<title>[Версия для печати] '+crt+'</title>');
 wind_img.document.write('<meta http-equiv=\"robots\" content=\"noindex,follow\" />');
 wind_img.document.write('<meta http-equiv=\"Keywords\" content=\"\" />');
 wind_img.document.write('<meta http-equiv=\"Description\" content=\"\" />');
 wind_img.document.write('<link href=\"http://www.imagemaker.su/style/window.css\" rel=\"stylesheet\" type=\"text/css\" />');
// wind_img.document.write('<!--[if IE]>');
// wind_img.document.write('<link rel=\"Stylesheet\" type=\"text/css\" href=\"http://www.imagemaker.su/style/ie.css\" />');
// wind_img.document.write('<![endif]-->');

crb='<div id="bottom_left">2007 © Катерина Савкина</div><div id="counter">';

crb=crb+"<!--LiveInternet counter--><a href='http://www.liveinternet.ru/click' "+
"target=_blank><img src='http://counter.yadro.ru/hit?t44.18;r"+escape(document.referrer)+((typeof(screen)=="undefined")?"":
";s"+screen.width+"*"+screen.height+"*"+(screen.colorDepth?
screen.colorDepth:screen.pixelDepth))+";u"+escape(document.URL)+
";"+Math.random()+
"' alt='' title='LiveInternet' "+
"border=0 width=31 height=31><\/a>";

crb=crb+'<!-- begin of Top100 code --><script id="top100Counter" src="http://counter.rambler.ru/top100.jcn?1589222" type="text/javascript"></script> <noscript></noscript><!-- end of Top100 code --><!-- begin of Top100 logo --><a href="http://top100.rambler.ru/home?id=1589222"><img height="31" alt="Ramblers Top100" src="https://scounter.rambler.ru/img/top100/banner-88x31-rambler-gray2.gif" width="88" border="0" /></a> <!-- end of Top100 logo -->';

crb=crb+'</div><div id="bottom_right"><a href="http://www.garan.su/" target="_blank"><img style="FLOAT: left; MARGIN-RIGHT: 1em" src="http://www.imagemaker.su/style/g.gif" width="30" align="left" border="0" alt="" /></a> <a title="www.garan.su" href="http://www.garan.su/" target="_blank">Garan</a>. <a href="http://www.garan.su/" target="_blank">Интернет-решения для вашего бизнеса</a><br /><a href="http://www.garan.su/" target="_blank">Разработка сайтов, реклама в интернете</a></div>';

 wind_img.document.write('</head><body leftmargin=\"20\" topmargin=\"5\" rightmargin=\"20\" bottommargin=\"5\"><div id=\"all\"><div id=\"center\"><table width=\"100%\"><tr><td align=\"left\">[ <a href=\'#\' onclick=\' window.print(); \'>Распечатать документ</a> ]</td><td align=\"right\">[ <a href=\'#\' onclick=\' window.close(); \'>Закрыть это окно</a> ]</td></tr></table><div id=\"Content\"><p>'+rtext+'</p></div></div><div id=\"bottom\"><hr>'+crb+'</div></div></body></html>');

 wind_img.focus();
 wind_img.document.close();

 return false;
}
