//------------------------------------------------------------------------------
function openPopup(anchor,width,height)
	{
		window.open(anchor.href, 'pop'+Math.floor(Math.random()*1024), 'alwaysRaised=yes,dependent=yes,resizable=yes,scrollbars=no,width='+width+',height='+height);
		return false;
	}
//------------------------------------------------------------------------------
function OpenNewWindow(layout,name,w,h,top,left,scrollbars,resizable){
	var newWindow = window.open(layout,name,"alwaysRaised=yes,dependent=yes,resizable="+resizable+",scrollbars="+scrollbars+",width="+w+",height="+h+",top="+top+",left="+left+"");
	newWindow.focus();
	return newWindow;
}
//------------------------------------------------------------------------------
var myEffect = {
	queue:$A(),interval:null,rendering:false,
	add_queue: function(evt)
		{
			myEffect.queue.push({
				'frame':0,'event':evt
			});
		},
	start: function()
		{
			if (null == myEffect.interval)
				myEffect.interval = setInterval(myEffect.render,15);
		},
	render: function()
		{
			if (myEffect.rendering) return;
			myEffect.rendering = true;
			myEffect.queue.each(function(item) {
				if (item.event.render(item.frame))
					item.frame++;
				else
					myEffect.queue = myEffect.queue.without(item);
			});

			if (0 == myEffect.queue.length)
				{
					clearInterval(myEffect.interval);
					myEffect.interval = null;
				}
			myEffect.rendering = false;
		}
};
//------------------------------------------------------------------------------
myEffect.BlindDown = Class.create({
	initialize: function(element, bOpen)
		{
			this.element = $(element);
			this.frames = 7;
			this.originalStyle = { };
			['top','left','width','height','fontSize'].each( function(k) {
				this.originalStyle[k] = this.element.style[k];
			}.bind(this));
			this.orig_y = this.element.getDimensions().height;
			this.step_y = this.orig_y / this.frames;
			this.start();
		},
	start: function()
		{
			this.element.makeClipping().setStyle({height: '0px'}).show();
			myEffect.add_queue(this);
			myEffect.start();
		},
	render: function(nFrame)
		{
			if (nFrame > this.frames)
				{
					this.element.setStyle({height: (-6+this.orig_y)+'px'}).undoClipping();
					var d = this.element.getDimensions();
					return false;
				}
			this.element.setStyle({height: Math.floor(nFrame * this.step_y)+'px'});
			return true;
		}
});
//------------------------------------------------------------------------------
myEffect.BlindUp = Class.create({
	initialize: function(element, bOpen)
		{
			this.element = $(element);
			this.frames = 7;
			this.originalStyle = { };
			['top','left','width','height','fontSize'].each( function(k) {
				this.originalStyle[k] = this.element.style[k];
			}.bind(this));
			this.step_y = this.element.getDimensions().height / this.frames;
			this.start();
		},
	start: function()
		{
			this.element.makeClipping();
			myEffect.add_queue(this);
			myEffect.start();
		},
	render: function(nFrame)
		{
			if (nFrame >= this.frames)
				{
					this.element.setStyle(this.originalStyle).undoClipping().hide();
					return false;
				}
			this.element.style.height = Math.floor((this.frames-nFrame) * this.step_y)+'px';
			return true;
		}
});
//------------------------------------------------------------------------------
function make_select_option_box(f){
	var o = $(f);

	if (Prototype.Browser.IE && navigator.appVersion.match(/MSIE[ ]+[56]\.\d+/))
		o[o.visible()?'hide':'show']();
	else
		{
			if (null != myEffect.interval) return;
			new myEffect[o.visible()?'BlindUp':'BlindDown'](o);
		}
}
//------------------------------------------------------------------------------
