/**
* Interface Elements for jQuery
* FX - transfer
*
* http://interface.eyecon.ro
*
* Copyright (c) 2006 Stefan Petre
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
*
*/
//eval(function(p,a,c,k,e,d){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--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[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}('1.2=q;1.Q.P=i(o){p m.O(\'s\',i(){R 1.A.w(m,o)})};1.A.w=i(e,o){5(1.2==q){1(\'S\',n).V(\'<t N="2"></t>\');1.2=1(\'#2\')}1.2.3(\'B\',\'T\').3(\'W\',\'L\');I z=m;z.c=1(e);5(!o||!o.4){p}5(o.4.H==K&&n.G(o.4)){o.4=n.G(o.4)}J 5(!o.4.M){p}5(!o.a){o.a=U}z.a=o.a;z.4=o.4;z.b=o.10;z.9=o.9;5(z.b){1.2.19(z.b)}z.g=0;z.h=0;5(1.18){z.g=(6(1.2.3(\'17\'))||0)+(6(1.2.3(\'1a\'))||0)+(6(1.2.3(\'X\'))||0)+(6(1.2.3(\'1d\'))||0);z.h=(6(1.2.3(\'1c\'))||0)+(6(1.2.3(\'16\'))||0)+(6(1.2.3(\'15\'))||0)+(6(1.2.3(\'Z\'))||0)}z.7=1.u(1.k.v(z.c.l(0)),1.k.r(z.c.l(0)));z.8=1.u(1.k.v(z.4),1.k.r(z.4));z.7.j-=z.g;z.7.d-=z.h;z.8.j-=z.g;z.8.d-=z.h;z.11=o.9;1.2.3(\'C\',z.7.j+\'f\').3(\'E\',z.7.d+\'f\').3(\'F\',z.7.y+\'f\').3(\'D\',z.7.x+\'f\').13({F:z.8.y,D:z.8.x,C:z.8.j,E:z.8.d},z.a,i(){5(z.b)1.2.1b(z.b);1.2.3(\'B\',\'1e\');5(z.9&&z.9.H==Y){z.9.14(z.c.l(0),[z.4])}1.12(z.c.l(0),\'s\')})};',62,77,'|jQuery|transferHelper|css|to|if|parseInt|start|end|complete|duration|classname|el|hb||px|diffWidth|diffHeight|function|wb|iUtil|get|this|document||return|null|getSize|interfaceFX|div|extend|getPosition|itransferTo||||fx|display|width|left|height|top|getElementById|constructor|var|else|String|absolute|childNodes|id|queue|TransferTo|fn|new|body|block|500|append|position|paddingLeft|Function|paddingBottom|className|callback|dequeue|animate|apply|paddingTop|borderBottomWidth|borderLeftWidth|boxModel|addClass|borderRightWidth|removeClass|borderTopWidth|paddingRight|none'.split('|'),0,{}))
/**
* Interface Elements for jQuery
* FX - transfer
*
* http://interface.eyecon.ro
*
* Copyright (c) 2006 Stefan Petre
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
*
*/
jQuery.transferHelper = null;
/**
*
* @name TransferTo
* @description Animates an new build element to simulate a transfer action from one element to other
* @param Hash hash A hash of parameters
* @option Mixed to DOMElement or element ID to transfer to
* @option String className CSS class to apply to transfer element
* @option String duration animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']
* @option Function callback (optional) A function to be executed whenever the animation completes.
*
* @type jQuery
* @cat Plugins/Interface
* @author Stefan Petre
*/
jQuery.fn.TransferTo = function(o)
{
	// this.queue('interfaceFX', function(){
	return new jQuery.fx.itransferTo(this, o);
// });
// return true;
};
jQuery.fx.itransferTo = function(e, o)
{
	if(jQuery.transferHelper == null)
	{
		jQuery('body', document).append('<div id="transferHelper"></div>');
		jQuery.transferHelper = jQuery('#transferHelper');
	}
	jQuery.transferHelper.css('display', 'block').css('position', 'absolute');
	var z = this;
	z.el = jQuery(e);
	if(!o || !o.to) {
		return;
	}
	//console.log(o.to);
	if (o.to.constructor == String && document.getElementById(o.to)) {
		o.to = document.getElementById(o.to);
	} else if ( !o.to.childNodes ) {
		return;
	}
	if (!o.duration) {
		o.duration = 500;
	}
	z.duration = o.duration;
	z.to = o.to;
	z.classname = o.className;
	z.complete = o.complete;
	if (z.classname) {
		jQuery.transferHelper.addClass(z.classname);
	}
	z.diffWidth = 0;
	z.diffHeight = 0;
	if(jQuery.boxModel) {
		z.diffWidth = (parseInt(jQuery.transferHelper.css('borderLeftWidth')) || 0 )
		+ (parseInt(jQuery.transferHelper.css('borderRightWidth')) || 0)
		+ (parseInt(jQuery.transferHelper.css('paddingLeft')) || 0)
		+ (parseInt(jQuery.transferHelper.css('paddingRight')) || 0);
		z.diffHeight = (parseInt(jQuery.transferHelper.css('borderTopWidth')) || 0 )
		+ (parseInt(jQuery.transferHelper.css('borderBottomWidth')) || 0)
		+ (parseInt(jQuery.transferHelper.css('paddingTop')) || 0)
		+ (parseInt(jQuery.transferHelper.css('paddingBottom')) || 0);
	}
	z.start = jQuery.extend(
		jQuery.iUtil.getPosition(z.el.get(0)),
		jQuery.iUtil.getSize(z.el.get(0))
		);
	z.end = jQuery.extend(
		jQuery.iUtil.getPosition(z.to),
		jQuery.iUtil.getSize(z.to)
		);

	z.start.wb -= z.diffWidth;
	z.start.hb -= z.diffHeight;
	z.end.wb -= z.diffWidth;
	z.end.hb -= z.diffHeight;
	z.callback = o.complete;
	// Execute the transfer
	jQuery.transferHelper
	.css('width', z.start.wb + 'px')
	.css('height', z.start.hb + 'px')
	.css('top', z.start.y + 'px')
	.css('left', z.start.x + 'px')
	.animate(
	{
		top: z.end.y + (window.pageYOffset),
		left: z.end.x,
		width: z.end.wb,
		height: z.end.hb
	},
	z.duration,
	function()
	{
		// Set correct classname
		if(z.classname)
			jQuery.transferHelper.removeClass(z.classname);
		jQuery.transferHelper.css('display', 'none');
		// Callback
		if (z.complete && z.complete.constructor == Function) {
			z.complete.apply(z.el.get(0), [z.to]);
		}
		// Done
		jQuery.dequeue(z.el.get(0), 'interfaceFX');
	}
	);
};

