// ColorBox v1.3.9 - a full featured, light-weight, customizable lightbox based on jQuery 1.3
// c) 2009 Jack Moore - www.colorpowered.com - jack@colorpowered.com
// Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
(function(b,gb){var v="none",t="click",N="LoadedContent",d=false,x="resize.",o="y",u="auto",f=true,M="nofollow",q="on",n="x";function e(a,c){a=a?' id="'+k+a+'"':"";c=c?' style="'+c+'"':"";return b("<div"+a+c+"/>")}function p(a,b){b=b===n?m.width():m.height();return typeof a==="string"?Math.round(a.match(/%/)?b/100*parseInt(a,10):parseInt(a,10)):a}function Q(c){c=b.isFunction(c)?c.call(h):c;return a.photo||c.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i)}function cb(){for(var c in a)if(b.isFunction(a[c])&&c.substring(0,2)!==q)a[c]=a[c].call(h);a.rel=a.rel||h.rel||M;a.href=a.href||b(h).attr("href");a.title=a.title||h.title}function db(d){h=d;a=b.extend({},b(h).data(r));cb();if(a.rel!==M){i=b("."+H).filter(function(){return (b(this).data(r).rel||this.rel)===a.rel});g=i.index(h);if(g===-1){i=i.add(h);g=i.length-1}}else{i=b(h);g=0}if(!w){w=F=f;R=h;try{R.blur()}catch(e){}b.event.trigger(hb);a.onOpen&&a.onOpen.call(h);y.css({opacity:+a.opacity,cursor:a.overlayClose?"pointer":u}).show();a.w=p(a.initialWidth,n);a.h=p(a.initialHeight,o);c.position(0);S&&m.bind(x+O+" scroll."+O,function(){y.css({width:m.width(),height:m.height(),top:m.scrollTop(),left:m.scrollLeft()})}).trigger("scroll."+O)}T.add(I).add(J).add(z).add(U).hide();V.html(a.close).show();c.slideshow();c.load()}var eb={transition:"elastic",speed:300,width:d,initialWidth:"600",innerWidth:d,maxWidth:d,height:d,initialHeight:"450",innerHeight:d,maxHeight:d,scalePhotos:f,scrolling:f,inline:d,html:d,iframe:d,photo:d,href:d,title:d,rel:d,opacity:.9,preloading:f,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:d,loop:f,slideshow:d,slideshowAuto:f,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:d,onLoad:d,onComplete:d,onCleanup:d,onClosed:d,overlayClose:f,escKey:f,arrowKey:f},r="colorbox",k="cbox",hb=k+"_open",P=k+"_load",W=k+"_complete",X=k+"_cleanup",fb=k+"_closed",G=b.browser.msie&&!b.support.opacity,S=G&&b.browser.version<7,O=k+"_IE6",y,j,E,s,Y,Z,ab,bb,i,m,l,K,L,U,T,z,J,I,V,C,D,A,B,h,R,g,a,w,F,c,H=k+"Element";c=b.fn[r]=b[r]=function(c,d){var a=this;if(!a[0]&&a.selector)return a;c=c||{};if(d)c.onComplete=d;if(!a[0]||a.selector===undefined){a=b("<a/>");c.open=f}a.each(function(){b(this).data(r,b.extend({},b(this).data(r)||eb,c)).addClass(H)});c.open&&db(a[0]);return a};c.init=function(){var h="hover";m=b(gb);j=e().attr({id:r,"class":G?k+"IE":""});y=e("Overlay",S?"position:absolute":"").hide();E=e("Wrapper");s=e("Content").append(l=e(N,"width:0; height:0"),L=e("LoadingOverlay").add(e("LoadingGraphic")),U=e("Title"),T=e("Current"),J=e("Next"),I=e("Previous"),z=e("Slideshow"),V=e("Close"));E.append(e().append(e("TopLeft"),Y=e("TopCenter"),e("TopRight")),e().append(Z=e("MiddleLeft"),s,ab=e("MiddleRight")),e().append(e("BottomLeft"),bb=e("BottomCenter"),e("BottomRight"))).children().children().css({"float":"left"});K=e(d,"position:absolute; width:9999px; visibility:hidden; display:none");b("body").prepend(y,j.append(E,K));s.children().hover(function(){b(this).addClass(h)},function(){b(this).removeClass(h)}).addClass(h);C=Y.height()+bb.height()+s.outerHeight(f)-s.height();D=Z.width()+ab.width()+s.outerWidth(f)-s.width();A=l.outerHeight(f);B=l.outerWidth(f);j.css({"padding-bottom":C,"padding-right":D}).hide();J.click(c.next);I.click(c.prev);V.click(c.close);s.children().removeClass(h);b("."+H).live(t,function(a){if(a.button!==0&&typeof a.button!=="undefined"||a.ctrlKey||a.shiftKey||a.altKey)return f;else{db(this);return d}});y.click(function(){a.overlayClose&&c.close()});b(document).bind("keydown",function(b){if(w&&a.escKey&&b.keyCode===27){b.preventDefault();c.close()}if(w&&a.arrowKey&&!F&&i[1])if(b.keyCode===37&&(g||a.loop)){b.preventDefault();I.click()}else if(b.keyCode===39&&(g<i.length-1||a.loop)){b.preventDefault();J.click()}})};c.remove=function(){j.add(y).remove();b("."+H).die(t).removeData(r).removeClass(H)};c.position=function(f,b){function c(a){Y[0].style.width=bb[0].style.width=s[0].style.width=a.style.width;L[0].style.height=L[1].style.height=s[0].style.height=Z[0].style.height=ab[0].style.height=a.style.height}var e,h=Math.max(m.height()-a.h-A-C,0)/2+m.scrollTop(),g=Math.max(m.width()-a.w-B-D,0)/2+m.scrollLeft();e=j.width()===a.w+B&&j.height()===a.h+A?0:f;E[0].style.width=E[0].style.height="9999px";j.dequeue().animate({width:a.w+B,height:a.h+A,top:h,left:g},{duration:e,complete:function(){c(this);F=d;E[0].style.width=a.w+B+D+"px";E[0].style.height=a.h+A+C+"px";b&&b()},step:function(){c(this)}})};c.resize=function(b){if(w){b=b||{};if(b.width)a.w=p(b.width,n)-B-D;if(b.innerWidth)a.w=p(b.innerWidth,n);l.css({width:a.w});if(b.height)a.h=p(b.height,o)-A-C;if(b.innerHeight)a.h=p(b.innerHeight,o);if(!b.innerHeight&&!b.height){b=l.wrapInner("<div style='overflow:auto'></div>").children();a.h=b.height();b.replaceWith(b.children())}l.css({height:a.h});c.position(a.transition===v?0:a.speed)}};c.prep=function(o){var d="hidden";function n(t){var o,q,s,n,d=i.length,e=a.loop;c.position(t,function(){function t(){G&&j[0].style.removeAttribute("filter")}if(w){G&&p&&l.fadeIn(100);a.iframe&&b("<iframe frameborder=0"+(a.scrolling?"":" scrolling='no'")+(G?" allowtransparency='true'":"")+"/>").attr({src:a.href,name:(new Date).getTime()}).appendTo(l);l.show();U.show().html(a.title);if(d>1){T.html(a.current.replace(/\{current\}/,g+1).replace(/\{total\}/,d)).show();J[e||g<d-1?"show":"hide"]().html(a.next);I[e||g?"show":"hide"]().html(a.previous);o=g?i[g-1]:i[d-1];s=g<d-1?i[g+1]:i[0];if(a.slideshow){z.show();g===d-1&&!e&&j.is("."+k+"Slideshow_on")&&z.click()}if(a.preloading){n=b(s).data(r).href||s.href;q=b(o).data(r).href||o.href;if(Q(n))b("<img/>")[0].src=n;if(Q(q))b("<img/>")[0].src=q}}L.hide();a.transition==="fade"?j.fadeTo(f,1,function(){t()}):t();m.bind(x+k,function(){c.position(0)});b.event.trigger(W);a.onComplete&&a.onComplete.call(h)}})}if(w){var p,f=a.transition===v?0:a.speed;m.unbind(x+k);l.remove();l=e(N).html(o);l.hide().appendTo(K.show()).css({width:function(){a.w=a.w||l.width();a.w=a.mw&&a.mw<a.w?a.mw:a.w;return a.w}(),overflow:a.scrolling?u:d}).css({height:function(){a.h=a.h||l.height();a.h=a.mh&&a.mh<a.h?a.mh:a.h;return a.h}()}).prependTo(s);K.hide();b("#"+k+"Photo").css({cssFloat:v});S&&b("select").not(j.find("select")).filter(function(){return this.style.visibility!==d}).css({visibility:d}).one(X,function(){this.style.visibility="inherit"});a.transition==="fade"?j.fadeTo(f,0,function(){n(0)}):n(f)}};c.load=function(){var j,d,q,m=c.prep;F=f;h=i[g];a=b.extend({},b(h).data(r));cb();b.event.trigger(P);a.onLoad&&a.onLoad.call(h);a.h=a.height?p(a.height,o)-A-C:a.innerHeight&&p(a.innerHeight,o);a.w=a.width?p(a.width,n)-B-D:a.innerWidth&&p(a.innerWidth,n);a.mw=a.w;a.mh=a.h;if(a.maxWidth){a.mw=p(a.maxWidth,n)-B-D;a.mw=a.w&&a.w<a.mw?a.w:a.mw}if(a.maxHeight){a.mh=p(a.maxHeight,o)-A-C;a.mh=a.h&&a.h<a.mh?a.h:a.mh}j=a.href;L.show();if(a.inline){e("InlineTemp").hide().insertBefore(b(j)[0]).bind(P+" "+X,function(){b(this).replaceWith(l.children())});m(b(j))}else if(a.iframe)m(" ");else if(a.html)m(a.html);else if(Q(j)){d=new Image;d.onload=function(){var e;d.onload=null;d.id=k+"Photo";b(d).css({margin:u,border:v,display:"block",cssFloat:"left"});if(a.scalePhotos){q=function(){d.height-=d.height*e;d.width-=d.width*e};if(a.mw&&d.width>a.mw){e=(d.width-a.mw)/d.width;q()}if(a.mh&&d.height>a.mh){e=(d.height-a.mh)/d.height;q()}}if(a.h)d.style.marginTop=Math.max(a.h-d.height,0)/2+"px";setTimeout(function(){m(d)},1);i[1]&&(g<i.length-1||a.loop)&&b(d).css({cursor:"pointer"}).click(c.next);if(G)d.style.msInterpolationMode="bicubic"};d.src=j}else e().appendTo(K).load(j,function(c,a,b){m(a==="error"?"Request unsuccessful: "+b.statusText:this)})};c.next=function(){if(!F){g=g<i.length-1?g+1:0;c.load()}};c.prev=function(){if(!F){g=g?g-1:i.length-1;c.load()}};c.slideshow=function(){function f(){z.text(a.slideshowStop).bind(W,function(){d=setTimeout(c.next,a.slideshowSpeed)}).bind(P,function(){clearTimeout(d)}).one(t,function(){e()});j.removeClass(b+"off").addClass(b+q)}var e,d,b=k+"Slideshow_";z.bind(fb,function(){z.unbind();clearTimeout(d);j.removeClass(b+"off "+b+q)});e=function(){clearTimeout(d);z.text(a.slideshowStart).unbind(W+" "+P).one(t,function(){f();d=setTimeout(c.next,a.slideshowSpeed)});j.removeClass(b+q).addClass(b+"off")};if(a.slideshow&&i[1])a.slideshowAuto?f():e()};c.close=function(){if(w){w=d;b.event.trigger(X);a.onCleanup&&a.onCleanup.call(h);m.unbind("."+k+" ."+O);y.fadeTo("fast",0);j.stop().fadeTo("fast",0,function(){j.find("iframe").attr("src","about:blank");l.remove();j.add(y).css({opacity:1,cursor:u}).hide();try{R.focus()}catch(c){}setTimeout(function(){b.event.trigger(fb);a.onClosed&&a.onClosed.call(h)},1)})}};c.element=function(){return b(h)};c.settings=eb;b(c.init)})(jQuery,this)

// corners 
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}(';(V($){4 C=1c.1k(\'18\').Q;4 D=C[\'2l\']!==1l;4 E=C[\'2m\']!==1l;4 F=C[\'2n\']!==1l;4 G=1c.2o||0;4 H=$.1m.1u&&(($.1m.2p<8&&!G)||G<8);4 I=$.1m.1u&&(V(){4 a=1c.1k(\'18\');2q{a.Q.1v(\'Y\',\'0+0\');a.Q.2r(\'Y\')}2s(e){6 1H}6 1I})();V 1w(a,p){6 19($.J(a,p))||0};V 1n(s){4 s=19(s).2t(16);6(s.1J<2)?\'0\'+s:s};V 1K(a){1o(;a&&a.2u.1L()!=\'2v\';a=a.1p){4 v=$.J(a,\'1x\');K(v==\'2w(0, 0, 0, 0)\')1d;K(v.2x(\'2y\')>=0){4 b=v.1e(/\\d+/g);6\'#\'+1n(b[0])+1n(b[1])+1n(b[2])}K(v&&v!=\'1M\')6 v}6\'#2z\'};V 1N(a,i,b){1y(a){7\'O\':6 9.O(b*(1-9.1f(9.1z(i/b))));7\'1O\':6 9.O(b*(1+9.1f(9.1z(i/b))));7\'1P\':6 9.O(b*(1-9.1f(9.2A(i/b))));7\'1Q\':6 9.O(b*(9.1f(9.1z((b-i-1)/b))));7\'1R\':6 9.O(b*(9.1S(i,b/i)));7\'1T\':6 9.O(b*(9.1S(b,(b-i-1))));7\'1U\':6 9.O(b*(9.2B(i)));7\'1V\':6 9.O(b*(9.1f(i)));7\'1W\':6 9.O(b*(9.2C(i)));7\'1X\':6 9.O(b*(9.2D(i)));7\'1Y\':6 9.O(b*(9.2E((b-i-1),b)));7\'1A\':7\'1Z\':6(i&1)?(i+1):b;7\'20\':6(i&2)?(i+1):b;7\'21\':6(i&3)?(i+1):b;7\'22\':6(i%2)*b;7\'23\':6 b;7\'1B\':7\'24\':6 i+1}};$.1g.Z=V(B){K(5.1J==0){K(!$.2F&&5.25){4 s=5.25,c=5.2G;$(V(){$(s,c).Z(B)})}6 5}6 5.2H(V(a){4 b=$(5);4 o=[b.2I($.1g.Z.1C.26)||\'\',B||\'\'].2J(\' \').1L();4 f=/2K/.1a(o);4 g=((o.1e(/2L:(#[0-27-f]+)/)||[])[1]);4 h=((o.1e(/2M:(#[0-27-f]+)/)||[])[1]);4 k=19((o.1e(/(\\d+)M/)||[])[1])||10;4 l=/O|1B|24|23|1Q|1O|1P|1R|1T|1U|1V|22|1W|1Y|1X|21|20|1A|1Z/;4 m=((o.1e(l)||[\'O\'])[0]);4 n=/1A|1B/.1a(o);4 p={T:0,B:1};4 q={11:/W|2N|S/.1a(o),12:/W|2O|U/.1a(o),13:/X|2P|S/.1a(o),14:/X|2Q|U/.1a(o)};K(!q.11&&!q.12&&!q.13&&!q.14)q={11:1,12:1,13:1,14:1};K($.1g.Z.1C.28&&m==\'O\'&&(F||D||E)&&!g&&!h){K(q.11)b.J(F?\'N-W-S-P\':D?\'-1h-N-P-2R\':\'-1i-N-W-S-P\',k+\'M\');K(q.12)b.J(F?\'N-W-U-P\':D?\'-1h-N-P-2S\':\'-1i-N-W-U-P\',k+\'M\');K(q.13)b.J(F?\'N-X-S-P\':D?\'-1h-N-P-2T\':\'-1i-N-X-S-P\',k+\'M\');K(q.14)b.J(F?\'N-X-U-P\':D?\'-1h-N-P-2U\':\'-1i-N-X-U-P\',k+\'M\');6}4 r=1c.1k(\'18\');$(r).J({29:\'2a\',1q:\'1j\',2V:\'1j\',2W:\'1j\',1x:h||\'1M\',2b:\'1D\'});4 s={T:19($.J(5,\'2X\'))||0,R:19($.J(5,\'2Y\'))||0,B:19($.J(5,\'2Z\'))||0,L:19($.J(5,\'30\'))||0};K(31 5.Q.2c!=1l)5.Q.2c=1;K(!f)5.Q.N=\'1b\';r.Q.2d=g||1K(5.1p);4 t=$.32(5,\'1q\');1o(4 j 2e p){4 u=p[j];K((u&&(q.13||q.14))||(!u&&(q.11||q.12))){r.Q.2b=\'1b \'+(q[j+\'R\']?\'1D\':\'1b\')+\' 1b \'+(q[j+\'L\']?\'1D\':\'1b\');4 d=1c.1k(\'18\');$(d).33(\'2f-Z\');4 v=d.Q;u?5.1r(d):5.2g(d,5.2h);K(u&&t!=\'34\'){K($.J(5,\'15\')==\'2i\')5.Q.15=\'1E\';v.15=\'1F\';v.X=v.S=v.1G=v.1s=\'0\';K(I)v.1v(\'Y\',\'5.1p.2j\');1t v.Y=\'2k%\'}1t K(!u&&$.1m.1u){K($.J(5,\'15\')==\'2i\')5.Q.15=\'1E\';v.15=\'1F\';v.W=v.S=v.U=v.1G=v.1s=\'0\';K(I){4 x=1w(5,\'35\')+1w(5,\'36\');v.1v(\'Y\',\'5.1p.2j - \'+x+\'+ "M"\')}1t v.Y=\'2k%\'}1t{v.15=\'1E\';v.1s=!u?\'-\'+s.T+\'M -\'+s.R+\'M \'+(s.T-k)+\'M -\'+s.L+\'M\':(s.B-k)+\'M -\'+s.R+\'M -\'+s.B+\'M -\'+s.L+\'M\'}1o(4 i=0;i<k;i++){4 w=9.37(0,1N(m,i,k));4 e=r.38(1H);e.Q.39=\'0 \'+(q[j+\'R\']?w:0)+\'M 0 \'+(q[j+\'L\']?w:0)+\'M\';u?d.1r(e):d.2g(e,d.2h)}K(n&&$.3a.3b){K(u&&H)1d;1o(4 c 2e q){K(!q[c])1d;K(u&&(c==\'11\'||c==\'12\'))1d;K(!u&&(c==\'13\'||c==\'14\'))1d;4 y={15:\'1F\',N:\'1b\',1s:0,1G:0,29:\'2a\',1x:r.Q.2d};4 z=$(\'<18/>\').J(y).J({Y:k+\'M\',1q:\'1j\'});1y(c){7\'11\':z.J({X:0,S:0});17;7\'12\':z.J({X:0,U:0});17;7\'13\':z.J({W:0,S:0});17;7\'14\':z.J({W:0,U:0});17}d.1r(z[0]);4 A=$(\'<18/>\').J(y).J({W:0,X:0,Y:\'1j\',1q:k+\'M\'});1y(c){7\'11\':A.J({S:k});17;7\'12\':A.J({U:k});17;7\'13\':A.J({S:k});17;7\'14\':A.J({U:k});17}d.1r(A[0])}}}}})};$.1g.3c=V(){K(F||D||E)5.J(F?\'N-P\':D?\'-1h-N-P\':\'-1i-N-P\',0);$(\'18.2f-Z\',5).3d();6 5};$.1g.Z.1C={28:1I,26:\'3e-Z\'}})(3f);',62,202,'||||var|this|return|case||Math||||||||||||||||||||||||||||||||||||css|if||px|border|round|radius|style||left||right|function|top|bottom|width|corner||TL|TR|BL|BR|position||break|div|parseInt|test|none|document|continue|match|cos|fn|moz|webkit|1px|createElement|undefined|browser|hex2|for|parentNode|height|appendChild|margin|else|msie|setExpression|sz|backgroundColor|switch|asin|dogfold|bevelfold|defaults|solid|relative|absolute|padding|false|true|length|gpc|toLowerCase|transparent|getWidth|cool|sharp|bite|slide|atan2|jut|curl|tear|wicked|long|sculpt|dog|dog2|dog3|fray|notch|bevel|selector|metaAttr|9a|useNative|overflow|hidden|borderStyle|zoom|borderColor|in|jquery|insertBefore|firstChild|static|offsetWidth|100|MozBorderRadius|WebkitBorderRadius|BorderRadius|documentMode|version|try|removeExpression|catch|toString|nodeName|html|rgba|indexOf|rgb|ffffff|acos|atan|tan|sqrt|log|isReady|context|each|attr|join|keep|cc|sc|tl|tr|bl|br|topleft|topright|bottomleft|bottomright|minHeight|fontSize|paddingTop|paddingRight|paddingBottom|paddingLeft|typeof|curCSS|addClass|auto|borderLeftWidth|borderRightWidth|max|cloneNode|borderWidth|support|boxModel|uncorner|remove|data|jQuery'.split('|'),0,{}))

// carusel
$.fn.infiniteCarousel = function () {
	function repeat(a, b) {
		return new Array(b + 1).join(a)
	}
	return this.each(function () {
		var c = $('> div', this).css('overflow', 'hidden'),
		$slider = c.find('> ul'),
		$items = $slider.find('> li'),
		$single = $items.filter(':first'),
		singleWidth = $single.outerWidth(),
		visible = Math.ceil(c.innerWidth() / singleWidth),
		currentPage = 1,
		pages = Math.ceil($items.length / visible);
		if (($items.length % visible) != 0) {
			$slider.append(repeat('<li class="empty" />', visible - ($items.length % visible)));
			$items = $slider.find('> li')
		}
		$items.filter(':first').before($items.slice( - visible).clone().addClass('cloned'));
		$items.filter(':last').after($items.slice(0, visible).clone().addClass('cloned'));
		$items = $slider.find('> li');
		c.scrollLeft(singleWidth * visible);
		function gotoPage(a) {
			var b = a < currentPage ? -1 : 1,
			n = Math.abs(currentPage - a),
			left = singleWidth * b * visible * n;
			c.animate({
				opacity: 1
			},
			10, function () {
				c.filter(':not(:animated)').animate({
					scrollLeft: '+=' + left,
					opacity: 1
				},
				300, function () {
					if (a == 0) {
						c.scrollLeft(singleWidth * visible * pages);
						a = pages
					} else if (a > pages) {
						c.scrollLeft(singleWidth * visible);
						a = 1
					}
					currentPage = a
				})
			});
			return false
		}
		$('#sloganRotator', this).click(function () {
			return gotoPage(currentPage - 1)
		});
//		setInterval(function () {
//			gotoPage(currentPage - 1)
//		},
//		10000);
		$(this).bind('goto', function (a, b) {
			gotoPage(b)
		})
	})
};


(function($) {

	/**
	 * helper variables and function
	 */
	$.ifixpng = function(customPixel) {
		$.ifixpng.pixel = customPixel;
	};
	
	$.ifixpng.getPixel = function() {
		return $.ifixpng.pixel || 'images/pixel.gif';
	};
	
	var hack = {
		ltie7  : $.browser.msie && $.browser.version < 7,
		filter : function(src) {
			return "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='"+src+"')";
		}
	};
	
	$.fn.ifixpng = hack.ltie7 ? function() {
    	return this.each(function() {
			var $$ = $(this);
			// in case rewriting urls
			var base = $('base').attr('href');
			if (base) {
				// remove anything after the last '/'
				base = base.replace(/\/[^\/]+$/,'/');
			}
			if ($$.is('img') || $$.is('input')) { // hack image tags present in dom
				if ($$.attr('src')) {
					if ($$.attr('src').match(/.*\.png([?].*)?$/i)) { // make sure it is png image
						// use source tag value if set 
						var source = (base && $$.attr('src').search(/^(\/|http:)/i)) ? base + $$.attr('src') : $$.attr('src');
						// apply filter
						$$.css({filter:hack.filter(source), width:$$.width(), height:$$.height()})
						  .attr({src:$.ifixpng.getPixel()})
						  .positionFix();
					}
				}
			} else { // hack png css properties present inside css
				var image = $$.css('backgroundImage');
				if (image.match(/^url\(["']?(.*\.png([?].*)?)["']?\)$/i)) {
					image = RegExp.$1;
					image = (base && image.substring(0,1)!='/') ? base + image : image;
					$$.css({backgroundImage:'none', filter:hack.filter(image)})
					  .children().children().positionFix();
				}
			}
		});
	} : function() { return this; };
	
	$.fn.iunfixpng = hack.ltie7 ? function() {
    	return this.each(function() {
			var $$ = $(this);
			var src = $$.css('filter');
			if (src.match(/src=["']?(.*\.png([?].*)?)["']?/i)) { // get img source from filter
				src = RegExp.$1;
				if ($$.is('img') || $$.is('input')) {
					$$.attr({src:src}).css({filter:''});
				} else {
					$$.css({filter:'', background:'url('+src+')'});
				}
			}
		});
	} : function() { return this; };
	
	/**
	 * positions selected item relatively
	 */
	 
	$.fn.positionFix = function() {
		return this.each(function() {
			var $$ = $(this);
			var position = $$.css('position');
			if (position != 'absolute' && position != 'relative') {
				$$.css({position:'relative'});
			}
		});
	};

})(jQuery);
