var G = {
	e: false, ee: false, ei: false, ec: false, wPw:800, wPh:600, wW:800, wH:600, cW: 0, cH: 0, s:10, ss:10, sW:80, sH:60, d:10, tid:false, tid2:false, sbW:17, iW:800,
	S: function() {
		if (this.tid2)
			clearTimeout(this.tid2);
		if (!this.e) {
			this.tid2 = setTimeout("G.S();", 100);
		} else {
			if (this.e.style.display == 'none') {
				this.cWp();
				this.cWd();
				this.e.style.display = 'block';
				this.ee.style.overflow = 'auto';
			} else
				this.H();
		}
	},
	H: function() {
		this.e.style.display = 'none';
		this.e.style.width = 'auto';
		this.e.style.height = 'auto';
		this.ee.style.width = 'auto';
		this.ee.style.height = 'auto';
		if (this.tid)
			clearTimeout(this.tid);
	},
	cWp: function() {
		this.wPw = document.documentElement.clientWidth;
		this.wPh = document.documentElement.clientHeight;
		if (navigator.userAgent.indexOf('Opera') == 0)
			this.wPh = window.innerHeight;
		if (this.wPh - 50 > this.cH)
			this.sbW = 0;
		this.sW = Math.round((Math.min(this.wPw - 50, this.cW) + this.sbW) * this.s / 100);
		this.sH = Math.round(Math.min(this.wPh - 50, this.cH) * this.s / 100);
	},
	I: function() {
		this.e = document.getElementById('big_img_c');
		this.ee = document.getElementById('big_img_cc');
		this.ei = this.ee.getElementsByTagName('img')[0];
		this.e.style.visibility = 'hidden';
		this.e.style.display = 'block';
		this.cW = this.e.clientWidth;
		this.cH = this.e.clientHeight;
		this.iW = this.ei.width;
		this.e.style.display = 'none';
		this.e.style.visibility = 'visible';
	},
	cWd: function() {
		var w = Math.min(this.wPw - 50, this.cW) + this.sbW;
		var h = Math.min(this.wPh - 50, this.cH);
		var fw = Math.floor((Math.min(this.wPw - 50, this.cW) + this.sbW) * this.ss / 100);
		var fh = Math.round(Math.min(this.wPh - 50, this.cH) * this.ss / 100);
		this.G(fw, fh, w, h);
	},
	G: function(w, h, tw, th) {
		if (w <= tw || h <= th) {
			var eew = Math.max(w - 20, 1);
			var eeh = Math.max(h - 20, 1);
			
			this.e.style.left = ((this.wPw - w) / 2) + 'px';
			this.e.style.top = ((this.wPh - h) / 2 + document.documentElement.scrollTop) + 'px';
			this.e.style.width = w + 'px';
			this.e.style.height = h + 'px';
			this.ee.style.width = eew + 'px';
			this.ee.style.height = eeh + 'px';
			//if (this.iW <= 800 || (navigator.userAgent.indexOf('Firefox') == -1 && navigator.userAgent.indexOf('Chrome') == -1)) {
				this.ei.width = this.iW * w / tw;
				this.SO(w / tw);
			//}
			if (w < tw || h < th)
				this.tid = setTimeout("G.G("+(Math.min(w+this.sW, tw))+", "+(Math.min(h+this.sH, th))+", "+tw+", "+th+");", this.d);
			else {
				this.SO(1);
				this.ei.width = this.iW;
			}
		}
	},
	SO: function(o) {
		this.ee.style.filter = "alpha(opacity:"+(o * 100)+");";
		this.ee.style.opacity = o;
	}
}

