function popup(url, name, width, height)
{
	(window.open(url, name, 'width='+width+',height='+height+',resizable=yes,scrollbars=yes')).focus();
}



/* banner */
function fw_banner(bannerNode, images)
{
	this.bannerNode = bannerNode;
	this.bannerNode.style.position = 'relative';
	this.bannerNode.style.overflow = 'hidden';
	this.images = images;
	this.imgNode = null;
	this.mode = 'swap';
	this.speed = 5000;
	this.hiddenNode = null;
}
fw_banner.prototype.start = function()
{
	this.i = 0;
	this.next();
}
fw_banner.prototype.next = function()
{
	if (this.mode == 'swap') {
		this.swap();
	} else if (this.mode == 'blend') {
		this.blend();
	}
	this.i++;
	if (this.i == this.images.length) {
		this.i = 0;
	}
	banner_temp = this;
	window.setTimeout('banner_temp.next()', this.speed);
}
fw_banner.prototype.swap = function()
{
	this.getImgNode().src = this.images[this.i];
}
fw_banner.prototype.blend = function()
{
	oldNode = this.getImgNode();
	imgNode = this.getImgNode(true);
	imgNode.src = this.images[this.i];
	if (oldNode.src)
	{
		imgNode.style.visibility = 'hidden';
		this.blendIn(imgNode, oldNode);
	}
}
fw_banner.prototype.blendIn = function(imgNode, oldNode)
{
	if(this.hiddenNode)
	{
		this.hiddenNode.parentNode.removeChild(this.hiddenNode);
	}
	
	imgNode.style.zIndex = 1;
	oldNode.style.zIndex = 2;

	imgNode.style.visibility = 'visible';
	
	Effect.Fade(oldNode);
	
	this.hiddenNode = oldNode;
}
fw_banner.prototype.setSpeed = function(speed)
{
	this.speed = speed;
}
fw_banner.prototype.setMode = function(mode)
{
	this.mode = mode;
}
fw_banner.prototype.getImgNode = function(force)
{
	if (this.imgNode == null || force) {
		this.imgNode = document.createElement('img');
		this.imgNode.style.position = 'absolute';
		this.bannerNode.appendChild(this.imgNode);
	}
	return this.imgNode;
}

