ï»¿
/*

	GalleryView - jQuery Content Gallery Plugin
	Author: 		Jack Anderson
	Version:		1.0
	Documentation: 	http://www.spaceforaname.com/jquery/galleryview/
	
*/
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(9($){$.1E.1F=9(h){7 j=$.2v($.1E.1F.1V,h);7 k;7 l;7 m=0;7 n;7 o;7 p;7 q;7 r;7 t;7 u=0;7 v=0;7 w;7 f;7 x;7 y=1n;7 z=20;7 A=5;7 B=2;7 C;7 D;7 E;7 F;9 15(i){$(\'N.V-1f\').1o(\'K\');$(\'N.V-1g\').1o(\'K\');D.1o(\'K\');8(j.1p){E.2w(j.1h).16(i%v).2x(j.1h)}8(w==\'1q\'){C.1W();7 b=Z(D[i]).H-(Z(F[0]).H+2);7 c=(b>=0?\'-=\':\'+=\')+1G.2y(b)+\'4\';C.1X({\'H\':c},j.1h,j.1H,9(){8(i>v){i=i%v;m=i;C.G(\'H\',\'-\'+((j.L+p)*i)+\'4\')}11 8(i<=(v-W)){i=(i%v)+v;m=i;C.G(\'H\',\'-\'+((j.L+p)*i)+\'4\')}8(!j.1p){E.1Y().16(i%v).1I()}u=i;$(\'N.V-1g\').K(1r);$(\'N.V-1f\').K(1s);1t()})}11{F.1W();7 d=Z(D[i]);F.1X({\'H\':(d.H-2+\'4\')},j.1h,j.1H,9(){8(!j.1p){E.1Y().16(i%v).1I()}$(\'N.V-1g\').K(1r);$(\'N.V-1f\').K(1s);1t()})}8($(\'a\',D[i])[0]){F.1o(\'K\').K(9(){7 a=$(\'a\',D[i]).16(0);8(a.J(\'1Z\')==\'21\'){23.24(a.J(\'17\'))}11{25.17=a.J(\'17\')}})}};9 18(){8(++m==D.19){m=0}15(m)};9 2z(){8(--m<0){m=D.19-1}15(m)};9 1s(){$(O).1i("S");8(++m==D.19){m=0}15(m);$(O).1j(j.1a,"S",9(){18()})};9 1r(){$(O).1i("S");8(--m<0){m=v-1}15(m);$(O).1j(j.1a,"S",9(){18()})};9 Z(a){7 b=0,I=0;7 c=a.1J;8(a.26){2A{b+=a.2B;I+=a.2C}2D(a=a.26)}8(c==l){1K{\'H\':b,\'I\':I}}11{7 d=Z(f[0]);7 e=d.H;7 g=d.I;1K{\'H\':b-e,\'I\':I-g}}};9 1t(){D.1u(9(i){8($(\'a\',12).19==0){$(12).K(9(){$(O).1i("S");15(i);m=i;$(O).1j(j.1a,"S",9(){18()})})}})};1K 12.1u(9(){f=$(12);$(\'2E\').1u(9(i){7 s=$(12);8(s.J(\'1b\')&&s.J(\'1b\').2F(/27\\.28/)){x=s.J(\'1b\').1k(\'27.28\')[0]+\'2G/\'}});f.G(\'29\',\'1L\');C=$(\'.2H\',f);D=$(\'2a\',C);E=$(\'.13\',f);l=f.J(\'1J\');v=D.19;W=1G.2I((j.X-2b)/(j.L+5));8(W>=v){w=\'P\';W=v}11{w=\'1q\'}n=j.X;o=j.14+j.T+A+(j.1v?z:A);p=1G.2J((j.X-2b-(j.L*W))/(W+1),10);8(w==\'P\'){q=(j.L*v)+(p*(v))}11{q=(j.L*v*3)+(p*(v*3))}r=0;t=((W*j.L)+((W-1)*p));C.2K(\'<Y 1M="2c"></Y>\');8(w==\'1q\'){D.2d().1c(C);D.2d().1c(C);D=$(\'2a\',C)}8($(\'.13-1l\').19>0){E.2e(\'<Y 1M="1l"></Y>\')}8(j.1v){D.2e(\'<Y 1M="1N"></Y>\').1u(9(i){$(12).2f(\'.1N\').2L($(12).2f(\'N\').J(\'2M\'))})}$(\'<N />\').2g(\'V-1f\').J(\'1b\',x+j.1m+\'/1f.1O\').1c(f).G({\'M\':\'Q\',\'1w\':\'P\',\'I\':j.14+A+((j.T-22)/2)+\'4\',\'2N\':\'1x\'}).K(1s);$(\'<N />\').2g(\'V-1g\').J(\'1b\',x+j.1m+\'/1g.1O\').1c(f).G({\'M\':\'Q\',\'1w\':\'P\',\'I\':j.14+A+((j.T-22)/2)+\'4\',\'H\':\'1x\'}).K(1r);f.G({\'M\':\'2h\',\'1P\':\'0\',\'1y\':j.1Q,\'1d\':j.1d,\'U\':n+\'4\',\'R\':o+\'4\'});E.G({\'U\':(j.X-1z(E.G(\'2O\').1k(\'4\')[0],10)-1z(E.G(\'2P\').1k(\'4\')[0],10))+\'4\',\'R\':(j.14-1z(E.G(\'2Q\').1k(\'4\')[0],10)-1z(E.G(\'2R\').1k(\'4\')[0],10))+\'4\',\'M\':\'Q\',\'I\':\'1R\',\'H\':\'1R\',\'2i\':\'1L\',\'1y\':\'1A\',\'2S\':\'1S\'});C.G({\'2T\':\'1S\',\'1P\':\'0\',\'1B\':\'0\',\'U\':q+\'4\',\'M\':\'Q\',\'1e\':\'2U\',\'I\':\'0\',\'H\':\'0\',\'R\':(j.T+10)+\'4\',\'1y\':j.1Q});D.G({\'2V\':\'H\',\'M\':\'2h\',\'R\':j.T+\'4\',\'1e\':\'2W\',\'2X\':A+\'4\',\'2Y\':\'1R\',\'2Z\':p+\'4\',\'1B\':\'0\',\'1w\':\'P\'});$(\'N\',D).G({\'1d\':\'1S\'});$(\'.2c\',f).G({\'M\':\'Q\',\'I\':j.14+\'4\',\'H\':((n-t)/2)+\'4\',\'U\':t+\'4\',\'R\':(j.T+A+(j.1v?z:A))+\'4\',\'2i\':\'1L\'});$(\'.1N\',f).G({\'M\':\'Q\',\'I\':j.T+\'4\',\'H\':\'0\',\'1P\':\'0\',\'U\':j.L+\'4\',\'1B\':\'0\',\'1T\':j.2j,\'30\':\'31\',\'2k\':\'1x\',\'R\':z+\'4\',\'32\':z+\'4\'});$(\'.13-1l\',E).G({\'M\':\'Q\',\'1e\':\'33\',\'U\':(j.X-20)+\'4\',\'R\':j.1C+\'4\',\'2l\':\'0\',\'H\':\'0\',\'1B\':\'0 1x\',\'1T\':j.1U,\'2k\':j.2m});$(\'.13-1l a\',E).G({\'1T\':j.1U,\'34\':\'35\',\'36\':\'37\'});$(\'.1l\',E).G({\'M\':\'Q\',\'1e\':\'38\',\'U\':j.X+\'4\',\'R\':j.1C+\'4\',\'2l\':\'0\',\'H\':\'0\',\'1y\':j.2n,\'39\':j.2o});$(\'.13 3a\',E).G({\'U\':j.X+\'4\',\'R\':(j.14-j.1C)+\'4\',\'1d\':\'0\'});7 b=$(\'<Y></Y>\');b.J(\'1J\',\'P\').1c(f).G({\'M\':\'Q\',\'1e\':\'3b\',\'1w\':\'P\',\'I\':Z(D[0]).I-(B/2)+\'4\',\'H\':Z(D[0]).H-(B/2)+\'4\',\'R\':j.T-B+\'4\',\'U\':j.L-B+\'4\',\'1d\':B+\'4 2p \'+(j.1m==\'3c\'?\'1D\':\'1A\')});F=$(\'#P\',f);7 c=$(\'<N />\');c.J(\'1b\',x+j.1m+\'/P.1O\').1c($(\'#P\')).G({\'M\':\'Q\',\'1e\':\'3d\',\'I\':\'-\'+(10+B)+\'4\',\'H\':((j.L/2)-10)+\'4\'});1t();8(j.2q){$(\'.13\',f).3e(9(){$(O).3f(3g,"2r",9(){$(O).1i("S");y=2s})}).3h(9(){$(O).1i("2r");8(y){$(O).1j(j.1a,"S",9(){18()});y=1n}})}$(\'.13\',f).16(0).1I();8(w==\'1q\'){C.G(\'H\',\'-\'+((j.L+p)*v)+\'4\');m=v}8($(\'a\',D[m])[0]){F.K(9(){7 a=$(\'a\',D[m]).16(0);8(a.J(\'1Z\')==\'21\'){23.24(a.J(\'17\'))}11{25.17=a.J(\'17\')}})}8(v>1){$(O).1j(j.1a,"S",9(){18()})}f.G(\'29\',\'3i\')})};$.1E.1F.1V={X:2t,14:3j,L:2u,T:2u,1C:3k,2m:\'3l\',1h:2t,1a:3m,2o:0.6,2n:\'1D\',1Q:\'1D\',1U:\'1A\',2j:\'1A\',1d:\'3n 2p 1D\',1m:\'3o\',1H:\'3p\',1v:1n,1p:2s,2q:1n}})(3q);',62,213,'||||px|||var|if|function|||||||||||||||||||||||||||||||||css|left|top|attr|click|frame_width|position|img|document|pointer|absolute|height|transition|frame_height|width|nav|strip_size|panel_width|div|getPos||else|this|panel|panel_height|showItem|eq|href|showNextItem|length|transition_interval|src|appendTo|border|zIndex|next|prev|transition_speed|stopTime|everyTime|split|overlay|nav_theme|false|unbind|fade_panels|strip|jumpToPrevItem|jumpToNextItem|enableFrameClicking|each|show_captions|cursor|10px|background|parseInt|white|padding|overlay_height|black|fn|galleryView|Math|easing|show|id|return|hidden|class|caption|png|margin|background_color|0px|none|color|overlay_text_color|defaults|stop|animate|hide|target||_blank||window|open|location|offsetParent|jquery|galleryview|visibility|li|84|strip_wrapper|clone|append|find|addClass|relative|overflow|caption_text_color|fontSize|bottom|overlay_font_size|overlay_color|overlay_opacity|solid|pause_on_hover|animation_pause|true|400|80|extend|fadeOut|fadeIn|abs|showPrevItem|do|offsetLeft|offsetTop|while|script|match|themes|filmstrip|floor|min|wrap|html|title|right|paddingLeft|paddingRight|paddingTop|paddingBottom|display|listStyle|900|float|901|marginTop|marginBottom|marginRight|textAlign|center|lineHeight|999|textDecoration|underline|fontWeight|bold|998|opacity|iframe|1000|dark|1001|mouseover|oneTime|500|mouseout|visible|300|70|1em|6000|1px|light|swing|jQuery'.split('|'),0,{}))

var countB=0;
var countS=0;
//var i=4;// êîëè÷åñòâî èçîáðàæåíèé 

function fon_on (f_id){
	document.getElementById(f_id + '_pic').style.backgroundImage='url(/images/vita/images/karta/pic11.png)';
    document.getElementById(f_id + '_a').style.backgroundColor='#fd3102';
}
function fon_off (f_id){
	document.getElementById(f_id + '_pic').style.backgroundImage='url(/images/vita/images/karta/point_san.png)';
	document.getElementById(f_id + '_a').style.backgroundColor='transparent';
}
function fon_on2 (f_id){
    document.getElementById(f_id + '_a').style.backgroundColor='#fd3102';
}
function fon_off2 (f_id){
	document.getElementById(f_id + '_a').style.backgroundColor='transparent';
}

function PaintBigImage(path, i){
	while(countB<i)
	{	
		document.write('<div class="panel">');
		document.write('<img src="'+path+'/'+(countB+1)+'.jpg"></img>'); 
		document.write('</div>');
		countB++;
	}
}
function PaintSmallImage(path, i){
	document.write('<ul class="filmstrip">');
	while(countS<i)
	{	
		document.write('<li><img src="'+path+'/frame'+(countS+1)+'.jpg"/></li>'); 
		countS++;
	}
	document.write('</ul>');
}
$(document).ready(function(){
$('#photos').galleryView({
			panel_width: 500,
			panel_height: 331,
			frame_width: 100,
			frame_height: 66,
			transition_speed: 1000,
			background_color: '#222',
			border: 'none',
			easing: 'easeInOutQuart',
			pause_on_hover: false,
			nav_theme: 'custom1'
		});
});

ï»¿


jQuery.fn.extend({
	everyTime: function(interval, label, fn, times, belay) {
		return this.each(function() {
			jQuery.timer.add(this, interval, label, fn, times, belay);
		});
	},
	oneTime: function(interval, label, fn) {
		return this.each(function() {
			jQuery.timer.add(this, interval, label, fn, 1);
		});
	},
	stopTime: function(label, fn) {
		return this.each(function() {
			jQuery.timer.remove(this, label, fn);
		});
	}
});

jQuery.event.special

jQuery.extend({
	timer: {
		global: [],
		guid: 1,
		dataKey: "jQuery.timer",
		regex: /^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/,
		powers: {
			// Yeah this is major overkill...
			'ms': 1,
			'cs': 10,
			'ds': 100,
			's': 1000,
			'das': 10000,
			'hs': 100000,
			'ks': 1000000
		},
		timeParse: function(value) {
			if (value == undefined || value == null)
				return null;
			var result = this.regex.exec(jQuery.trim(value.toString()));
			if (result[2]) {
				var num = parseFloat(result[1]);
				var mult = this.powers[result[2]] || 1;
				return num * mult;
			} else {
				return value;
			}
		},
		add: function(element, interval, label, fn, times, belay) {
			var counter = 0;
			
			if (jQuery.isFunction(label)) {
				if (!times) 
					times = fn;
				fn = label;
				label = interval;
			}
			
			interval = jQuery.timer.timeParse(interval);

			if (typeof interval != 'number' || isNaN(interval) || interval <= 0)
				return;

			if (times && times.constructor != Number) {
				belay = !!times;
				times = 0;
			}
			
			times = times || 0;
			belay = belay || false;
			
			var timers = jQuery.data(element, this.dataKey) || jQuery.data(element, this.dataKey, {});
			
			if (!timers[label])
				timers[label] = {};
			
			fn.timerID = fn.timerID || this.guid++;
			
			var handler = function() {
				if (belay && this.inProgress) 
					return;
				this.inProgress = true;
				if ((++counter > times && times !== 0) || fn.call(element, counter) === false)
					jQuery.timer.remove(element, label, fn);
				this.inProgress = false;
			};
			
			handler.timerID = fn.timerID;
			
			if (!timers[label][fn.timerID])
				timers[label][fn.timerID] = window.setInterval(handler,interval);
			
			this.global.push( element );
			
		},
		remove: function(element, label, fn) {
			var timers = jQuery.data(element, this.dataKey), ret;
			
			if ( timers ) {
				
				if (!label) {
					for ( label in timers )
						this.remove(element, label, fn);
				} else if ( timers[label] ) {
					if ( fn ) {
						if ( fn.timerID ) {
							window.clearInterval(timers[label][fn.timerID]);
							delete timers[label][fn.timerID];
						}
					} else {
						for ( var fn in timers[label] ) {
							window.clearInterval(timers[label][fn]);
							delete timers[label][fn];
						}
					}
					
					for ( ret in timers[label] ) break;
					if ( !ret ) {
						ret = null;
						delete timers[label];
					}
				}
				
				for ( ret in timers ) break;
				if ( !ret ) 
					jQuery.removeData(element, this.dataKey);
			}
		}
	}
});

jQuery(window).bind("unload", function() {
	jQuery.each(jQuery.timer.global, function(index, item) {
		jQuery.timer.remove(item);
	});
});

jQuery.easing['jswing'] = jQuery.easing['swing'];

jQuery.extend( jQuery.easing,
{
	def: 'easeOutQuad',
	swing: function (x, t, b, c, d) {
		//alert(jQuery.easing.default);
		return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
	},
	easeInQuad: function (x, t, b, c, d) {
		return c*(t/=d)*t + b;
	},
	easeOutQuad: function (x, t, b, c, d) {
		return -c *(t/=d)*(t-2) + b;
	},
	easeInOutQuad: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t + b;
		return -c/2 * ((--t)*(t-2) - 1) + b;
	},
	easeInCubic: function (x, t, b, c, d) {
		return c*(t/=d)*t*t + b;
	},
	easeOutCubic: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t + 1) + b;
	},
	easeInOutCubic: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t + b;
		return c/2*((t-=2)*t*t + 2) + b;
	},
	easeInQuart: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t + b;
	},
	easeOutQuart: function (x, t, b, c, d) {
		return -c * ((t=t/d-1)*t*t*t - 1) + b;
	},
	easeInOutQuart: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
		return -c/2 * ((t-=2)*t*t*t - 2) + b;
	},
	easeInQuint: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t*t + b;
	},
	easeOutQuint: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t*t*t + 1) + b;
	},
	easeInOutQuint: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
		return c/2*((t-=2)*t*t*t*t + 2) + b;
	},
	easeInSine: function (x, t, b, c, d) {
		return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
	},
	easeOutSine: function (x, t, b, c, d) {
		return c * Math.sin(t/d * (Math.PI/2)) + b;
	},
	easeInOutSine: function (x, t, b, c, d) {
		return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
	},
	easeInExpo: function (x, t, b, c, d) {
		return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
	},
	easeOutExpo: function (x, t, b, c, d) {
		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
	},
	easeInOutExpo: function (x, t, b, c, d) {
		if (t==0) return b;
		if (t==d) return b+c;
		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
	},
	easeInCirc: function (x, t, b, c, d) {
		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
	},
	easeOutCirc: function (x, t, b, c, d) {
		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
	},
	easeInOutCirc: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
		return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
	},
	easeInElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
	},
	easeOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
	},
	easeInOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
		return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
	},
	easeInBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*(t/=d)*t*((s+1)*t - s) + b;
	},
	easeOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
	},
	easeInOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158; 
		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
	},
	easeInBounce: function (x, t, b, c, d) {
		return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
	},
	easeOutBounce: function (x, t, b, c, d) {
		if ((t/=d) < (1/2.75)) {
			return c*(7.5625*t*t) + b;
		} else if (t < (2/2.75)) {
			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
		} else if (t < (2.5/2.75)) {
			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
		} else {
			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
		}
	},
	easeInOutBounce: function (x, t, b, c, d) {
		if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
		return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
	}
});

var DD_belatedPNG = {
	ns: 'DD_belatedPNG',
	imgSize: {},
	delay: 10,
	nodesFixed: 0,
	createVmlNameSpace: function () { /* enable VML */
		if (document.namespaces && !document.namespaces[this.ns]) {
			document.namespaces.add(this.ns, 'urn:schemas-microsoft-com:vml');
		}
	},
	createVmlStyleSheet: function () { /* style VML, enable behaviors */
		/*
			Just in case lots of other developers have added
			lots of other stylesheets using document.createStyleSheet
			and hit the 31-limit mark, let's not use that method!
			further reading: http://msdn.microsoft.com/en-us/library/ms531194(VS.85).aspx
		*/
		var screenStyleSheet, printStyleSheet;
		screenStyleSheet = document.createElement('style');
		screenStyleSheet.setAttribute('media', 'screen');
		document.documentElement.firstChild.insertBefore(screenStyleSheet, document.documentElement.firstChild.firstChild);
		if (screenStyleSheet.styleSheet) {
			screenStyleSheet = screenStyleSheet.styleSheet;
			screenStyleSheet.addRule(this.ns + '\\:*', '{behavior:url(#default#VML)}');
			screenStyleSheet.addRule(this.ns + '\\:shape', 'position:absolute;');
			screenStyleSheet.addRule('img.' + this.ns + '_sizeFinder', 'behavior:none; border:none; position:absolute; z-index:-1; top:-10000px; visibility:hidden;'); /* large negative top value for avoiding vertical scrollbars for large images, suggested by James O'Brien, http://www.thanatopsic.org/hendrik/ */
			this.screenStyleSheet = screenStyleSheet;
			
			/* Add a print-media stylesheet, for preventing VML artifacts from showing up in print (including preview). */
			/* Thanks to Rémi Prévost for automating this! */
			printStyleSheet = document.createElement('style');
			printStyleSheet.setAttribute('media', 'print');
			document.documentElement.firstChild.insertBefore(printStyleSheet, document.documentElement.firstChild.firstChild);
			printStyleSheet = printStyleSheet.styleSheet;
			printStyleSheet.addRule(this.ns + '\\:*', '{display: none !important;}');
			printStyleSheet.addRule('img.' + this.ns + '_sizeFinder', '{display: none !important;}');
		}
	},
	readPropertyChange: function () {
		var el, display, v;
		el = event.srcElement;
		if (!el.vmlInitiated) {
			return;
		}
		if (event.propertyName.search('background') != -1 || event.propertyName.search('border') != -1) {
			DD_belatedPNG.applyVML(el);
		}
		if (event.propertyName == 'style.display') {
			display = (el.currentStyle.display == 'none') ? 'none' : 'block';
			for (v in el.vml) {
				if (el.vml.hasOwnProperty(v)) {
					el.vml[v].shape.style.display = display;
				}
			}
		}
		if (event.propertyName.search('filter') != -1) {
			DD_belatedPNG.vmlOpacity(el);
		}
	},
	vmlOpacity: function (el) {
		if (el.currentStyle.filter.search('lpha') != -1) {
			var trans = el.currentStyle.filter;
			trans = parseInt(trans.substring(trans.lastIndexOf('=')+1, trans.lastIndexOf(')')), 10)/100;
			el.vml.color.shape.style.filter = el.currentStyle.filter; /* complete guesswork */
			el.vml.image.fill.opacity = trans; /* complete guesswork */
		}
	},
	handlePseudoHover: function (el) {
		setTimeout(function () { /* wouldn't work as intended without setTimeout */
			DD_belatedPNG.applyVML(el);
		}, 1);
	},
	/**
	* This is the method to use in a document.
	* @param {String} selector - REQUIRED - a CSS selector, such as '#doc .container'
	**/
	fix: function (selector) {
		if (this.screenStyleSheet) {
			var selectors, i;
			selectors = selector.split(','); /* multiple selectors supported, no need for multiple calls to this anymore */
			for (i=0; i<selectors.length; i++) {
				this.screenStyleSheet.addRule(selectors[i], 'behavior:expression(DD_belatedPNG.fixPng(this))'); /* seems to execute the function without adding it to the stylesheet - interesting... */
			}
		}
	},
	applyVML: function (el) {
		el.runtimeStyle.cssText = '';
		this.vmlFill(el);
		this.vmlOffsets(el);
		this.vmlOpacity(el);
		if (el.isImg) {
			this.copyImageBorders(el);
		}
	},
	attachHandlers: function (el) {
		var self, handlers, handler, moreForAs, a, h;
		self = this;
		handlers = {resize: 'vmlOffsets', move: 'vmlOffsets'};
		if (el.nodeName == 'A') {
			moreForAs = {mouseleave: 'handlePseudoHover', mouseenter: 'handlePseudoHover', focus: 'handlePseudoHover', blur: 'handlePseudoHover'};
			for (a in moreForAs) {			
				if (moreForAs.hasOwnProperty(a)) {
					handlers[a] = moreForAs[a];
				}
			}
		}
		for (h in handlers) {
			if (handlers.hasOwnProperty(h)) {
				handler = function () {
					self[handlers[h]](el);
				};
				el.attachEvent('on' + h, handler);
			}
		}
		el.attachEvent('onpropertychange', this.readPropertyChange);
	},
	giveLayout: function (el) {
		el.style.zoom = 1;
		if (el.currentStyle.position == 'static') {
			el.style.position = 'relative';
		}
	},
	copyImageBorders: function (el) {
		var styles, s;
		styles = {'borderStyle':true, 'borderWidth':true, 'borderColor':true};
		for (s in styles) {
			if (styles.hasOwnProperty(s)) {
				el.vml.color.shape.style[s] = el.currentStyle[s];
			}
		}
	},
	vmlFill: function (el) {
		if (!el.currentStyle) {
			return;
		} else {
			var elStyle, noImg, lib, v, img, imgLoaded;
			elStyle = el.currentStyle;
		}
		for (v in el.vml) {
			if (el.vml.hasOwnProperty(v)) {
				el.vml[v].shape.style.zIndex = elStyle.zIndex;
			}
		}
		el.runtimeStyle.backgroundColor = '';
		el.runtimeStyle.backgroundImage = '';
		noImg = true;
		if (elStyle.backgroundImage != 'none' || el.isImg) {
			if (!el.isImg) {
				el.vmlBg = elStyle.backgroundImage;
				el.vmlBg = el.vmlBg.substr(5, el.vmlBg.lastIndexOf('")')-5);
			}
			else {
				el.vmlBg = el.src;
			}
			lib = this;
			if (!lib.imgSize[el.vmlBg]) { /* determine size of loaded image */
				img = document.createElement('img');
				lib.imgSize[el.vmlBg] = img;
				img.className = lib.ns + '_sizeFinder';
				img.runtimeStyle.cssText = 'behavior:none; position:absolute; left:-10000px; top:-10000px; border:none; margin:0; padding:0;'; /* make sure to set behavior to none to prevent accidental matching of the helper elements! */
				imgLoaded = function () {
					this.width = this.offsetWidth; /* weird cache-busting requirement! */
					this.height = this.offsetHeight;
					lib.vmlOffsets(el);
				};
				img.attachEvent('onload', imgLoaded);
				img.src = el.vmlBg;
				img.removeAttribute('width');
				img.removeAttribute('height');
				document.body.insertBefore(img, document.body.firstChild);
			}
			el.vml.image.fill.src = el.vmlBg;
			noImg = false;
		}
		el.vml.image.fill.on = !noImg;
		el.vml.image.fill.color = 'none';
		el.vml.color.shape.style.backgroundColor = elStyle.backgroundColor;
		el.runtimeStyle.backgroundImage = 'none';
		el.runtimeStyle.backgroundColor = 'transparent';
	},
	/* IE can't figure out what do when the offsetLeft and the clientLeft add up to 1, and the VML ends up getting fuzzy... so we have to push/enlarge things by 1 pixel and then clip off the excess */
	vmlOffsets: function (el) {
		var thisStyle, size, fudge, makeVisible, bg, bgR, dC, altC, b, c, v;
		thisStyle = el.currentStyle;
		size = {'W':el.clientWidth+1, 'H':el.clientHeight+1, 'w':this.imgSize[el.vmlBg].width, 'h':this.imgSize[el.vmlBg].height, 'L':el.offsetLeft, 'T':el.offsetTop, 'bLW':el.clientLeft, 'bTW':el.clientTop};
		fudge = (size.L + size.bLW == 1) ? 1 : 0;
		/* vml shape, left, top, width, height, origin */
		makeVisible = function (vml, l, t, w, h, o) {
			vml.coordsize = w+','+h;
			vml.coordorigin = o+','+o;
			vml.path = 'm0,0l'+w+',0l'+w+','+h+'l0,'+h+' xe';
			vml.style.width = w + 'px';
			vml.style.height = h + 'px';
			vml.style.left = l + 'px';
			vml.style.top = t + 'px';
		};
		makeVisible(el.vml.color.shape, (size.L + (el.isImg ? 0 : size.bLW)), (size.T + (el.isImg ? 0 : size.bTW)), (size.W-1), (size.H-1), 0);
		makeVisible(el.vml.image.shape, (size.L + size.bLW), (size.T + size.bTW), (size.W), (size.H), 1 );
		bg = {'X':0, 'Y':0};
		if (el.isImg) {
			bg.X = parseInt(thisStyle.paddingLeft, 10) + 1;
			bg.Y = parseInt(thisStyle.paddingTop, 10) + 1;
		}
		else {
			for (b in bg) {
				if (bg.hasOwnProperty(b)) {
					this.figurePercentage(bg, size, b, thisStyle['backgroundPosition'+b]);
				}
			}
		}
		el.vml.image.fill.position = (bg.X/size.W) + ',' + (bg.Y/size.H);
		bgR = thisStyle.backgroundRepeat;
		dC = {'T':1, 'R':size.W+fudge, 'B':size.H, 'L':1+fudge}; /* these are defaults for repeat of any kind */
		altC = { 'X': {'b1': 'L', 'b2': 'R', 'd': 'W'}, 'Y': {'b1': 'T', 'b2': 'B', 'd': 'H'} };
		if (bgR != 'repeat' || el.isImg) {
			c = {'T':(bg.Y), 'R':(bg.X+size.w), 'B':(bg.Y+size.h), 'L':(bg.X)}; /* these are defaults for no-repeat - clips down to the image location */
			if (bgR.search('repeat-') != -1) { /* now let's revert to dC for repeat-x or repeat-y */
				v = bgR.split('repeat-')[1].toUpperCase();
				c[altC[v].b1] = 1;
				c[altC[v].b2] = size[altC[v].d];
			}
			if (c.B > size.H) {
				c.B = size.H;
			}
			el.vml.image.shape.style.clip = 'rect('+c.T+'px '+(c.R+fudge)+'px '+c.B+'px '+(c.L+fudge)+'px)';
		}
		else {
			el.vml.image.shape.style.clip = 'rect('+dC.T+'px '+dC.R+'px '+dC.B+'px '+dC.L+'px)';
		}
	},
	figurePercentage: function (bg, size, axis, position) {
		var horizontal, fraction;
		fraction = true;
		horizontal = (axis == 'X');
		switch(position) {
			case 'left':
			case 'top':
				bg[axis] = 0;
				break;
			case 'center':
				bg[axis] = 0.5;
				break;
			case 'right':
			case 'bottom':
				bg[axis] = 1;
				break;
			default:
				if (position.search('%') != -1) {
					bg[axis] = parseInt(position, 10) / 100;
				}
				else {
					fraction = false;
				}
		}
		bg[axis] = Math.ceil(  fraction ? ( (size[horizontal?'W': 'H'] * bg[axis]) - (size[horizontal?'w': 'h'] * bg[axis]) ) : parseInt(position, 10)  );
		if (bg[axis] % 2 === 0) {
			bg[axis]++;
		}
		return bg[axis];
	},
	fixPng: function (el) {
		el.style.behavior = 'none';
		var lib, els, nodeStr, v, e;
		if (el.nodeName == 'BODY' || el.nodeName == 'TD' || el.nodeName == 'TR') { /* elements not supported yet */
			return;
		}
		el.isImg = false;
		if (el.nodeName == 'IMG') {
			if(el.src.toLowerCase().search(/\.png$/) != -1) {
				el.isImg = true;
				el.style.visibility = 'hidden';
			}
			else {
				return;
			}
		}
		else if (el.currentStyle.backgroundImage.toLowerCase().search('.png') == -1) {
			return;
		}
		lib = DD_belatedPNG;
		el.vml = {color: {}, image: {}};
		els = {shape: {}, fill: {}};
		for (v in el.vml) {
			if (el.vml.hasOwnProperty(v)) {
				for (e in els) {
					if (els.hasOwnProperty(e)) {
						nodeStr = lib.ns + ':' + e;
						el.vml[v][e] = document.createElement(nodeStr);
					}
				}
				el.vml[v].shape.stroked = false;
				el.vml[v].shape.appendChild(el.vml[v].fill);
				el.parentNode.insertBefore(el.vml[v].shape, el);
			}
		}
		el.vml.image.shape.fillcolor = 'none'; /* Don't show blank white shapeangle when waiting for image to load. */
		el.vml.image.fill.type = 'tile'; /* Makes image show up. */
		el.vml.color.fill.on = false; /* Actually going to apply vml element's style.backgroundColor, so hide the whiteness. */
		lib.attachHandlers(el);
		lib.giveLayout(el);
		lib.giveLayout(el.offsetParent);
		el.vmlInitiated = true;
		lib.applyVML(el); /* Render! */
	}
};
try {
	document.execCommand("BackgroundImageCache", false, true); /* TredoSoft Multiple IE doesn't like this, so try{} it */
} catch(r) {}
DD_belatedPNG.createVmlNameSpace();
DD_belatedPNG.createVmlStyleSheet();




 DD_belatedPNG.fix('#map div, #map img, #gallery_wrap');

