/*
 * jQuery Easing v1.1.1 - http://gsgd.co.uk/sandbox/jquery.easing.php
 *
 * Uses the built in easing capabilities added in jQuery 1.1
 * to offer multiple easing options
 *
 * Copyright (c) 2007 George Smith
 * Licensed under the MIT License:
 *   http://www.opensource.org/licenses/mit-license.php
 */

jQuery.extend({
	easing: {
		easein: function(x, t, b, c, d) {
			return c*(t/=d)*t + b; // in
		},
		easeinout: function(x, t, b, c, d) {
			if (t < d/2) return 2*c*t*t/(d*d) + b;
			var ts = t - d/2;
			return -2*c*ts*ts/(d*d) + 2*c*ts/d + c/2 + b;		
		},
		easeout: function(x, t, b, c, d) {
			return -c*t*t/(d*d) + 2*c*t/d + b;
		},
		expoin: function(x, t, b, c, d) {
			var flip = 1;
			if (c < 0) {
				flip *= -1;
				c *= -1;
			}
			return flip * (Math.exp(Math.log(c)/d * t)) + b;		
		},
		expoout: function(x, t, b, c, d) {
			var flip = 1;
			if (c < 0) {
				flip *= -1;
				c *= -1;
			}
			return flip * (-Math.exp(-Math.log(c)/d * (t-d)) + c + 1) + b;
		},
		expoinout: function(x, t, b, c, d) {
			var flip = 1;
			if (c < 0) {
				flip *= -1;
				c *= -1;
			}
			if (t < d/2) return flip * (Math.exp(Math.log(c/2)/(d/2) * t)) + b;
			return flip * (-Math.exp(-2*Math.log(c/2)/d * (t-d)) + c + 1) + b;
		},
		bouncein: function(x, t, b, c, d) {
			return c - jQuery.easing['bounceout'](x, d-t, 0, c, d) + b;
		},
		bounceout: 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;
			}
		},
		bounceinout: function(x, t, b, c, d) {
			if (t < d/2) return jQuery.easing['bouncein'] (x, t*2, 0, c, d) * .5 + b;
			return jQuery.easing['bounceout'] (x, t*2-d,0, c, d) * .5 + c*.5 + b;
		},
		elasin: 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;
		},
		elasout: 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;
		},
		elasinout: 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;
		},
		backin: function(x, t, b, c, d) {
			var s=1.70158;
			return c*(t/=d)*t*((s+1)*t - s) + b;
		},
		backout: function(x, t, b, c, d) {
			var s=1.70158;
			return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
		},
		backinout: function(x, t, b, c, d) {
			var 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;
		},
		linear: function(x, t, b, c, d) {
			return c*t/d + b; //linear
		}
	}
});

/* Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * $LastChangedDate: 2007-03-19 16:02:41 +0100 (Mo, 19 Mrz 2007) $
 * $Rev: 1546 $
 */
(function($){$.fn.bgIframe=jQuery.fn.bgiframe=function(s){if(!($.browser.msie&&typeof XMLHttpRequest=='function'))return this;s=$.extend({top:'auto',left:'auto',width:'auto',height:'auto',opacity:true,src:'javascript:false;'},s||{});var prop=function(n){return n&&n.constructor==Number?n+'px':n;},html='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"style="display:block;position:absolute;z-index:-1;'+(s.opacity!==false?'filter:Alpha(Opacity=\'0\');':'')+'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))+';left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))+';width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';"/>';return this.each(function(){if(!$('iframe.bgiframe',this)[0])this.insertBefore(document.createElement(html),this.firstChild);});};})(jQuery);

/**
 *
 * Copyright (c) 2007 Sam Collett (http://www.texotela.co.uk)
 * Licensed under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 * 
 */

 
/**
 * Places selected element under another one
 *
 * @name     below
 * @name     element Which element to place the current one under
 * @param    options Hash with the following options:
 *                   adjustRight   How many pixels to adjust right by
 *                   adjustDown    How many pixels to adjust down by
 * @author   Sam Collett (http://www.texotela.co.uk)
 * @example  $("#mytip").below("#myinput");
 * @example  $("#mytip").below("#myinput", {adjustRight: 10});
 */
jQuery.fn.below = function(element, options)
{
	element = element || null;
	options = jQuery.extend({adjustRight: 0, adjustDown: 0}, options);
	return this.each(
		function()
		{
			if(element == null) return false;
			var what = jQuery(element);
			var left = what[0].offsetWidth - options.adjustRight, top = what[0].offsetHeight + options.adjustDown;
			if(jQuery.browser.opera)
			{
				var version = navigator.userAgent.match(/\d+\.\d+/);
				if(version < 9)
				{
					left += (parseInt(jQuery.css(what[0], 'borderLeftWidth'))  || 0) +
						(parseInt(jQuery.css(what.parent()[0], 'paddingLeft'))  || 0);
				}
			}
			what.after(this);
			jQuery(this).css(
				{
					position: "absolute",
					display: "inline",
					marginLeft: "-" + left  + "px",
					marginTop: top + "px"
				}
			);
		}
	);
}

/* Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * Version: 1.0b
 */
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}('(7($){$.11.B({1s:$.11.q,1a:$.11.t,q:7(a){4(1[0]==9)5 J.13||$.v&&6.L.1m||6.g.1m;4(1[0]==6)5 1i.1g(6.g.1F,6.g.R);5 1.1s(a)},t:7(a){4(1[0]==9)5 J.18||$.v&&6.L.16||6.g.16;4(1[0]==6)5 1i.1g(6.g.1v,6.g.Q);5 1.1a(a)},13:7(){5 1[0]==9||1[0]==6?1.q():1.I(\':A\')?1[0].R-f(1,\'k\')-f(1,\'1t\'):1.q()+f(1,\'10\')+f(1,\'1q\')},18:7(){5 1[0]==9||1[0]==6?1.t():1.I(\':A\')?1[0].Q-f(1,\'j\')-f(1,\'1n\'):1.t()+f(1,\'V\')+f(1,\'1l\')},1H:7(){5 1[0]==9||1[0]==6?1.q():1.I(\':A\')?1[0].R:1.q()+f(1,\'k\')+f(1,\'1t\')+f(1,\'10\')+f(1,\'1q\')},1G:7(){5 1[0]==9||1[0]==6?1.t():1.I(\':A\')?1[0].Q:1.t()+f(1,\'j\')+f(1,\'1n\')+f(1,\'V\')+f(1,\'1l\')},h:7(a){4(a!=1h)5 1.1f(7(){4(1==9||1==6)9.1e(a,$(9).i());m 1.h=a});4(1[0]==9||1[0]==6)5 J.1D||$.v&&6.L.h||6.g.h;5 1[0].h},i:7(a){4(a!=1h)5 1.1f(7(){4(1==9||1==6)9.1e($(9).h(),a);m 1.i=a});4(1[0]==9||1[0]==6)5 J.1B||$.v&&6.L.i||6.g.i;5 1[0].i},1A:7(b,c){z x=0,y=0,p=0,r=0,8=1[0],3=1[0],o,H,E=$.G(8,\'1u\'),w=$.l.1J,u=$.l.1I,1p=$.l.Z,1o=$.l.X,W=F,U=F,b=$.B({S:n,M:n,T:F,s:n,1k:F},b||{});4(b.1k)5 1.1j(b,c);4(8.D.C()==\'g\'){x=8.12;y=8.Y;4(w){x+=f(8,\'O\')+(f(8,\'j\')*2);y+=f(8,\'P\')+(f(8,\'k\')*2)}m 4(1o){x+=f(8,\'O\');y+=f(8,\'P\')}m 4(u&&1r.v){x+=f(8,\'j\');y+=f(8,\'k\')}}m{N{H=$.G(3,\'1u\');x+=3.12;y+=3.Y;4(w||u){x+=f(3,\'j\');y+=f(3,\'k\');4(w&&H==\'1d\')W=n;4(u&&H==\'1E\')U=n}o=3.1c;N{4(b.s){p+=3.h;r+=3.i}4(w&&3!=8&&$.G(3,\'1C\')!=\'A\'){x+=f(3,\'j\');y+=f(3,\'k\')}3=3.1b}K(3!=o);3=o;4(3.D.C()==\'g\'||3.D.C()==\'19\'){4((1p||(u&&$.v))&&E!=\'1d\'&&E!=\'17\'){x+=f(3,\'O\');y+=f(3,\'P\')}4((w&&!W&&E!=\'17\')||(u&&E==\'1z\'&&!U)){x+=f(3,\'j\');y+=f(3,\'k\')}1y}}K(3)}z a=e(8,b,x,y,p,r);4(c){$.B(c,a);5 1}m{5 a}},1j:7(b,c){z x=0,y=0,p=0,r=0,3=1[0],o,b=$.B({S:n,M:n,T:F,s:n},b||{});N{x+=3.12;y+=3.Y;o=3.1c;4(b.s){N{p+=3.h;r+=3.i;3=3.1b}K(3!=o)}3=o}K(3&&3.D.C()!=\'g\'&&3.D.C()!=\'19\');z a=e(1[0],b,x,y,p,r);4(c){$.B(c,a);5 1}m{5 a}}});z f=7(b,a){5 1x($.G(b.1w?b[0]:b,a))||0};z e=7(b,c,x,y,a,d){4(!c.S){x-=f(b,\'O\');y-=f(b,\'P\')}4(c.M&&($.l.Z||$.l.X)){x+=f(b,\'j\');y+=f(b,\'k\')}m 4(!c.M&&!($.l.Z||$.l.X)){x-=f(b,\'j\');y-=f(b,\'k\')}4(c.T){x+=f(b,\'V\');y+=f(b,\'10\')}4(c.s){a-=b.h;d-=b.i}5 c.s?{15:y-d,14:x-a,i:d,h:a}:{15:y,14:x}}})(1r);',62,108,'|this||parent|if|return|document|function|elem|window|||||||body|scrollLeft|scrollTop|borderLeftWidth|borderTopWidth|browser|else|true|op|sl|height|st|scroll|width|ie|boxModel|mo|||var|visible|extend|toLowerCase|tagName|elemPos|false|css|parPos|is|self|while|documentElement|border|do|marginLeft|marginTop|offsetWidth|offsetHeight|margin|padding|relparent|paddingLeft|absparent|opera|offsetTop|safari|paddingTop|fn|offsetLeft|innerHeight|left|top|clientWidth|fixed|innerWidth|html|_width|parentNode|offsetParent|absolute|scrollTo|each|max|undefined|Math|offsetLite|lite|paddingRight|clientHeight|borderRightWidth|oa|sf|paddingBottom|jQuery|_height|borderBottomWidth|position|scrollWidth|jquery|parseInt|break|static|offset|pageYOffset|overflow|pageXOffset|relative|scrollHeight|outerWidth|outerHeight|msie|mozilla'.split('|'),0,{}))


/**
 * sprintf() for JavaScript v.0.1
 *
 * Copyright (c) 2007 Alexandru Marasteanu <http://alexei.417.ro/>
 *
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation; either version 2 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 * Place, Suite 330, Boston, MA 02111-1307 USA
 */

function str_repeat(i, m) { for (var o = []; m > 0; o[--m] = i); return(o.join('')); }

function sprintf() {
	var i = 0, f = arguments[i++], o = [], m, a, p;
	while (f) {
		if (m = /^[^\x25]+/.exec(f)) o.push(m[0]);
		else if (m = /^\x25{2}/.exec(f)) o.push('%');
		else if (m = /^\x25(\+)?(0|'[^$])?(-)?(\d+)?(\.\d+)?([b-fosuxX])/.exec(f)) {
			if (!(a = arguments[i++])) throw("Too few arguments.");
			if (/[^s]/.test(m[6]) && (typeof(a) != 'number'))
				throw("Expecting number but found " + typeof(a));
			switch (m[6]) {
				case 'b': a = a.toString(2); break;
				case 'c': a = String.fromCharCode(a); break;
				case 'd': a = parseInt(a); break;
				case 'e': a = m[5] ? a.toExponential(m[5].charAt(1)) : a.toExponential(); break;
				case 'f': a = m[5] ? parseFloat(a).toFixed(m[5].charAt(1)) : parseFloat(a); break;
				case 'o': a = a.toString(8); break;
				case 's': a = ((a = String(a)) && m[5] ? a.substring(0, m[5].charAt(1)) : a); break;
				case 'u': a = Math.abs(a); break;
				case 'x': a = a.toString(16); break;
				case 'X': a = a.toString(16).toUpperCase(); break;
			}
			a = (/[def]/.test(m[6]) && m[1] && a > 0 ? '+' + a : a);
			p = m[4] ? str_repeat(m[2] ? m[2] == '0' ? '0' : m[2].charAt(1) : ' ', m[5] ? m[4] - String(a).length : m[4]) : '';
			o.push(m[3] ? a + p : p + a);
		} else throw("Huh ?");
		f = f.substring(m[0].length);
	}
	return(o.join(''));
}


