YAHOO.util.Dom.getElementsByExternal = function(root) {
	var method = function(el) { 
		if (el.href.indexOf(location.hostname) > -1 || el.href.indexOf(':') == -1) {
			return false;
		}
		return true;
	};
	return this.getElementsBy(method, 'a', root);
};
YAHOO.util.Dom.getElementsByInternal = function(root) {
	var method = function(el) { 
		if (el.href.indexOf(location.hostname) > -1 || el.href.indexOf(':') == -1) {
			return true;
		}
		return false;
	};
	return this.getElementsBy(method, 'a', root);
};
YAHOO.util.Dom.getElementsByAttribute = function(atr, val, tag, root) {
	var method = function(el) { 
		var re = new RegExp('(?:^|\\s+)' + val + '(?:\\s+|$)');
		if ( el.getAttribute(atr) && re.test(el.getAttribute(atr)) ) {
			return true;
		}
		return false;
	};
	return this.getElementsBy(method, tag, root);
};
	
YAHOO.widget.Effect = function(el) {
	this.objEl = YAHOO.util.Dom.get(el);
	this.height = parseInt(YAHOO.util.Dom.getStyle(this.objEl,'height'));
	this.width = parseInt(YAHOO.util.Dom.getStyle(this.objEl,'width'));
};
YAHOO.widget.Effect.prototype.BlindUp = function(iTimer,hide) {
	var $D = YAHOO.util.Dom;
	var timer = iTimer || 1;
	this.objEl.style.overflow = 'hidden';
	
	var attrib = {
		height: { to:0 },
		paddingBottom: { to:0 }
	};
	
	var blind = new YAHOO.util.Anim(this.objEl, attrib, timer, YAHOO.util.Easing.easeOut);
	var that = this;
	if ( hide ) {
		blind.onComplete.subscribe(
			function() {
				$D.addClass(hide,'hide');
			}
		);
	}
	blind.animate();
};

YAHOO.widget.Effect.prototype.CartDelete = function(iTimer,onComplete) {
	var $D = YAHOO.util.Dom;
	var timer = iTimer || 1;
	if (!this.objEl) return;
	this.objEl.style.overflow = 'hidden';

	var blind = new YAHOO.util.Anim(this.objEl, { height: { to:0 }, opacity: { to:0, from:1 } }, timer, YAHOO.util.Easing.easeOut);
	var that = this;
	blind.onComplete.subscribe(
		function() {
			that.objEl.style.display = 'none';
			that.objEl.parentNode.removeChild(that.objEl);
			YAHOO.nubedo.reorderCart();
		}
	);
	blind.animate();
};
YAHOO.widget.Effect.prototype.BlindDown = function(iTimer,onComplete) {
	var $D = YAHOO.util.Dom;
	var timer = iTimer || 1;
	this.objEl.style.visibility = 'hidden';
	this.objEl.style.overflow = 'hidden';
	display = $D.setStyle(this.objEl,'display','block');
	this.objEl.style.height = '';
	var height = parseInt(YAHOO.util.Dom.getStyle(this.objEl,'height'));
	if (!height) var height = this.objEl.offsetHeight;
	if (!height) var height = 400;
	this.objEl.style.height = '0';
	this.objEl.style.visibility = 'visible';
	this.objEl.style.display = '';
	var attrib = {
		height: { to:height, from:0 },
		paddingBottom: { to:13, from:0 }
	};
	var blind = new YAHOO.util.Anim(this.objEl, attrib, timer, YAHOO.util.Easing.easeOut);
	var that = this;
	blind.onComplete.subscribe(
		function() {
			if (onComplete) {
				onComplete();
			}
			that.objEl.style.height = '';
			that.objEl.style.visibility = 'visible';
			that.objEl.style.overflow = '';
		}
	);
	blind.animate();
};
YAHOO.widget.Effect.prototype.BlindDownPartial = function(iTimer,endHeight,onComplete) {
	var timer = iTimer || 1;
	var startHeight = parseInt(YAHOO.util.Dom.getStyle(this.objEl,'height'));
	if (!startHeight) var startHeight = this.objEl.offsetHeight;
	var endHeight = startHeight + endHeight;
	this.objEl.style.visibility = 'visible';
	this.objEl.style.display = '';
	var attrib = {
		height: { to:endHeight, from:startHeight},
		paddingBottom: { to:16, from:0 }
	};
	var blind = new YAHOO.util.Anim(this.objEl, attrib, timer, YAHOO.util.Easing.easeOut);
	var that = this;
	blind.onComplete.subscribe(
		function() {
			if (onComplete) {
				onComplete();
			}
			that.height = '';
		}
	);
	blind.animate();
};
YAHOO.widget.Effect.prototype.FadeBlindDown = function(iTimer,onComplete) {
	var timer = iTimer || 1;
	YAHOO.util.Dom.setStyle(this.objEl,'opacity',0);
	this.objEl.style.visibility = 'hidden';
	this.objEl.style.overflow = 'hidden';
	this.objEl.style.height = '';
	var height = parseInt(YAHOO.util.Dom.getStyle(this.objEl,'height'));
	if (!height) var height = this.objEl.offsetHeight;
	if (!height) var height = 120;
	this.objEl.style.height = '0';
	this.objEl.style.visibility = 'visible';
	this.objEl.style.display = '';
	var blind = new YAHOO.util.Anim(this.objEl, { height: { to:height, from:0}, opacity: { to: 1 } }, timer, YAHOO.util.Easing.easeOut);
	if ( onComplete ) {
		blind.onComplete.subscribe(onComplete);
	}
	blind.animate();
};
YAHOO.widget.Effect.prototype.FadeIn = function(iTimer,fadeTo,onComplete) {
	var timer = iTimer || 1;
	var timer = fadeTo || 1;
	YAHOO.util.Dom.setStyle(this.objEl,'opacity',0);
	this.objEl.style.display = '';
	var blind = new YAHOO.util.Anim(this.objEl, { opacity: { to: fadeTo } }, timer, YAHOO.util.Easing.easeOut);
	if ( onComplete ) {
		blind.onComplete.subscribe(onComplete);
	}
	blind.animate();
};
YAHOO.widget.Effect.prototype.FadeOut = function(iTimer,fadeTo,onComplete) {
	var timer = iTimer || 1;
	var timer = fadeTo || 1;
//	YAHOO.util.Dom.setStyle(this.objEl,'opacity',1);
	this.objEl.style.display = '';
	var blind = new YAHOO.util.Anim(this.objEl, { opacity: { to: fadeTo } }, timer, YAHOO.util.Easing.easeOut);
	var that = this;
	blind.onComplete.subscribe(
		function() {
			YAHOO.util.Dom.setStyle(that.objEl,'display','none');
			YAHOO.util.Dom.setStyle(that.objEl,'opacity',1);
			onComplete();
		}
	);
	blind.animate();
};
YAHOO.widget.Effect.prototype.yoyo = function(iTimer,show,hide,onComplete) {
	var $D = YAHOO.util.Dom;
	this.objEl.style.overflow = 'hidden';
	var height = parseInt(YAHOO.util.Dom.getStyle(this.objEl,'height'));
	if (!height) var height = this.objEl.offsetHeight;
	var timer = iTimer || 1;
	var yoyo = new YAHOO.util.Anim(this.objEl, { height: { to:0} }, timer, YAHOO.util.Easing.easeOut);
	var that = this;
	yoyo.onComplete.subscribe(
		function() {
		
			$D.addClass(hide,'hide');
			$D.removeClass(show,'hide');
		
			that.objEl.style.visibility = 'hidden';
			that.objEl.style.overflow = 'hidden';
			that.objEl.style.height = '';
			var height = parseInt(YAHOO.util.Dom.getStyle(that.objEl,'height'));
			if (!height) var height = that.objEl.offsetHeight;
			that.objEl.style.height = '0';
			that.objEl.style.visibility = 'visible';
			var blind = new YAHOO.util.Anim(that.objEl, { height: { to:height, from:0} }, timer, YAHOO.util.Easing.easeIn);
			if ( onComplete ) {
				blind.onComplete.subscribe(onComplete);
			}
			blind.animate();
		}
	);
	yoyo.animate();
};