//<script language="javascript">
/*=============================================================================
 WebSolvers Framework Library
 Copyright 2003, WebSolvers, Inc., All Rights Reserved.

 Library Effects
 Provides Menus/links, rollovers, and scrollers.

 Revision History:
 6-30-03 Created

 Public Functions:
	imageObject_MakeSwap(

  Notes:
  To use the scroller place the following in your code
<div id="scroller" 
	style="position: relative; visibility: hidden;
		width: 154px; height: 100px; clip: rect(0, 154, 100, 0); overflow: hidden;"> 
    <div id="content" style="position: absolute; left:0; top:0;" visibility="hidden">
    [ contents ]
    </div></div><script language="javascript"><!--
		if(window.dhtml) {
			dhtml.addBasicInit("document.getElement('scroller')", "elemObject_MakeScroller", 0, 100, true);
		}    
    //-->< /script>
=============================================================================

 The WebSolvers Framework Library may be used and/or modified by anyone owning
 the original work as it was incorporated into an original development project
 so long as this copyright notice and the comments above remain intact.

 By using this code you agree to indemnify WebSolvers, Inc. from any liability
 that might arise from its use.

 This code may not be sold exclusively or as a part of other code without prior
 written consent and is expressly forbidden.

 Obtain permission before redistributing this software over the Internet or
 in any other medium. In all cases the copyright and header must remain intact.
============================================================================= */

//======================================================================================
//                                 Internal Routines
//======================================================================================

// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------

function proc_ImgSwap(img, doc) {
	var param1;
	var attr;

	img = dhtml.normalize(img, doc);

	if(img._TypeSwap)
		return img;

	if(attr = img.getAttribute("altsrc"))
		param1 = attr;

	if(param1)
		dhtml.setType(img, elemObject_MakeSwap, param1);
	
	return img;
}

// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------

function elemObject_MakeSwap(src) {
	this._TypeSwap = true;

	dhtml.normalize(this);

	if(window.Image) {
		this.Image = new Image();
		this.Image.src = src;
	} else
		this.altsrc = src;

	this.swap = swapObject_Swap;
}

// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------

function swapObject_Swap() {
	var src = this.src;

	if(this.Image) {
		this.src = this.Image.src;
		this.Image.src = src;
	} else if(this.altsrc) {
		this.src = this.altsrc;
		this.altsrc = src;
	}
}

// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
var lDE_ActiveMenu = null;

// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------

function proc_DivMenu(div, doc) {
	var attr;
	var param1 = "";

	div = dhtml.normalize(div, doc);

	if(div._TypeMenu)
		return div;

	if(attr = div.getAttribute("timeout"))
		param1 = attr;
	else
		param1 = 100;

	dhtml.setType(div, elemObject_MakeMenu, param1);
	
	return div;
}

// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------

function elemObject_MakeMenu(timeout) {
	var node = null;
	var i =0;
	
	this._TypeMenu = true;

	dhtml.normalize(this);

	this.timeout = timeout;
	this.autoHide = false;

	this.hideMenu = menuObject_Hide;
	this.showMenu = menuObject_Show;

	this.childMenus = menuObject_ChildMenus;
	this.addEvent("mouseover", menuObject_OnMouseOver);
	this.addEvent("mouseout", menuObject_OnMouseOut);
	
	node = this.getElementsByTagName("A");
	for(i = 0; i < node.length; i++) {
		node[i].parentMenu = this;
	}
}

// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------

function menuObject_ChildMenus() {
	var node = this.getElementsByTagName("A");
	var i = 0;
	var chld = new Array();
	
	for(i = 0; i < node.length; i++)
		if(node[i].menuLink && node[i].menuLink.menu)
			chld[chld.length] = node[i].menuLink.menu;
		
	return chld;
}

function menuObject_Hide() {
	if(!this.mouseover && !this._nohide) {
		this.hide();
		if(this.parentLink && this.parentLink.parentMenu)
			this.parentLink.parentMenu._nohide = this._pnohide;
		this.rootWindow = null;
		if(lDE_ActiveMenu == this) {
			lDE_ActiveMenu = this.parentLink.parentWindow;
		}
		this.parentLink = null;
		node = this.childMenus();
		for(i = 0; i < node.length; i++)
			node[i].hide();
	}
}

// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------

function menuObject_Show(link, noAct) {
	var pm = null, cm = null;

if(!link)
	alert(this.id + "->show(): No link specified!");

	this.show();
	this.parentLink = link;
	if(this.parentLink.parentMenu) {
		this.rootMenu = this.parentLink.parentMenu.rootMenu;
		this._pnohide = this.parentLink.parentMenu._nohide;
		this.parentLink.parentMenu._nohide = true;
	}
	if(!this.rootMenu)
		this.rootMenu = this;
	if(lDE_ActiveMenu != this && !this.noAct) {
		if(lDE_ActiveMenu) {
			if(lDE_ActiveMenu.rootMenu != this.rootMenu) {
				cm = lDE_ActiveMenu.parentLink.parentMenu;
				lDE_ActiveMenu.parentLink.realLink.hideMenu();
				while(cm) {
					pm = cm.parentLink.parentMenu;
					cm.parentLink.hideMenu();
					cm = pm;
				}
			} else {
				cm = lDE_ActiveMenu.parentLink.parentMenu;
				lDE_ActiveMenu.hide();
				while(cm && cm != this && cm != this.parentLink.parentMenu) {
					pm = cm.parentLink.parentMenu;
					cm.hide();
					cm = pm;
				}
			}
		}
			
		lDE_ActiveMenu = this;
	}
	
	if(this.parentLink.parentMenu)
		this.parentLink.parentMenu.show(this.parentLink.parentMenu.parentLink, true);
}

// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------

function menuObject_OnMouseOver(e) {
	this.mouseover = 1;

	return true;
}

// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------

function menuObject_OnMouseOut(e) {
	this.mouseover = 0;
	if(this.autoHide) {
		if(this.parentLink)
			this.parentLink.realLink.hideMenu(this.timeout);
		else
			this.hideMenu();
	}

	return true;
}

// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------

function proc_DivMenuGroup(div, doc) {
	var attr;
	var slide = null;

	div = dhtml.normalize(div);

	if(div._menuGroup)
		return div;
		
	if(attr = div.getAttribute("slidelink")) {
		slide = doc.getElement(attr);
		if(slide)
			proc_DivMenuGroup(slide, doc);
	}
	
	dhtml.setType(div, elemObject_MakeMenuGroup, slide);
	
	return div;
}

// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------

function elemObject_MakeMenuGroup(slideNext) {
	var node = null;
	var i =0;
	
	this._menuGroup = true;

	dhtml.normalize(this);

	this.slideNext = slideNext;
	this.slide = menuGroupObject_Slide;
	
	this.moveTo(this.getX(), this.getY());
	
	node = this.getElementsByTagName("A");
	for(i = 0; i < node.length; i++) {
		node[i].parentMenuGroup = this;
	}
}

// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function menuGroupObject_Slide(distance, dir) {
	dir = (dir ? 1 : 0);

//alert("Sliding " + this.id + " from " + this.getY() + " " + distance + "px");
	if(dir) {
		this.moveTo(this.getX() + distance, this.getY());
	} else {
		this.moveTo(this.getX(), this.getY() + distance);
	}

	if(this.slideNext)
		this.slideNext.slide(distance, dir);	
}

// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------

function proc_AnchorMenuLink(a, doc) {
	var attr;
	var menu = null;
	var slide = null;

	var aryParam = new Array();
	var param1 = "";
	var param2 = "";
	var param3 = "";
	var param4 = "";
	var param5 = "";
	var param6 = "";
	var param7 = "";
	var param8 = "";
	var param9 = "";

	a = dhtml.normalize(a);
	link = a;

	if(a._menuLink)
		return a;

	if(attr = a.getAttribute("menulink"))
		link = doc.getElement(attr);

	if(attr = link.getAttribute("showmenu")) {
		menu = doc.getElement(attr);
		if(menu) {
			menu = proc_DivMenu(menu, doc);
			if(attr = link.getAttribute("menutimeout"))
				menu.timeout = attr;
		}
	}

	if(attr = link.getAttribute("slidelink")) {
		slide = doc.getElement(attr);
		if(slide)
			proc_DivMenuGroup(slide, doc);
	}

	if(attr = link.getAttribute("menualign"))
		aryParam[0] = attr;
	else
		aryParam[0] = "left";
	if(attr = link.getAttribute("menuvalign"))
		aryParam[1] = attr;
	else
		aryParam[1] = "top";

	if(attr = link.getAttribute("linkalign"))
		aryParam[2] = attr;
	else
		aryParam[2] = "left";
	if(attr = link.getAttribute("linkvalign"))
		aryParam[3] = attr;
	else
		aryParam[3] = "bottom";

	if(attr = link.getAttribute("linktimeout"))
		aryParam[4] = attr;
	else
		aryParam[4] = 500;

	if(attr = link.getAttribute("shiftx"))
		aryParam[5] = attr;
	else
		aryParam[5] = 0;

	if(attr = link.getAttribute("shifty"))
		aryParam[6] = attr;
	else
		aryParam[6] = 0;
		
	if(attr = a.getAttribute("autohide"))
		aryParam[7] = attr;
	else
		aryParam[7] = true;

	if(attr = a.getAttribute("autoshow"))
		aryParam[8] = attr;
	else
		aryParam[8] = true;

	if(menu && link) {
		dhtml.setType(link, elemObject_MakeMenuLink, menu, aryParam[0], aryParam[1], aryParam[2], aryParam[3], aryParam[4], aryParam[5], aryParam[6], slide);
		dhtml.setType(a, aObject_MakeMenuLink, link, aryParam[7], aryParam[8]);
	}

	return a;
}

// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function aObject_MakeMenuLink(link, autohide, autoshow) {
	var a;

	dhtml.normalize(this);

	if(this._layer)
		a = this.document.anchors[this.name].link;
	else
		a = this;

	dhtml.normalize(link);

	a._menuLink = true;
	a.menuLink = link;

	a.autoHide = (autohide == true || autohide == "yes" || autohide == "on" || autohide == "true" || autohide > 0 ? 1 : 0);
	a.autoShow = (autoshow == true || autoshow == "yes" || autoshow == "on" || autoshow == "true" || autoshow > 0 ? 1 : 0);

	a.showMenu = menuLinkObject_ShowMenu;
	a.hideMenu = menuLinkObject_HideMenu;

	a.addEvent("click", menuLinkObject_OnClick);
	a.addEvent("mouseover", menuLinkObject_OnMouseOver);
	a.addEvent("mouseout", menuLinkObject_OnMouseOut);
}

// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------

function elemObject_MakeMenuLink(menu, mAlign, mVAlign, align, vAlign, timeout, shiftX, shiftY, slideChild) {

	dhtml.normalize(this);

	this._menuLink = true;

	this.menu = menu;
	this.menuAlign = mAlign;
	this.menuVAlign = mVAlign;
	this.linkAlign = align;
	this.linkVAlign = vAlign;
	this.menuTimeout = timeout;
	this.shiftX = shiftX;
	this.shiftY = shiftY;
	this.slideChild = slideChild;
	this.slideDir = 0;
	this.realLink = this;
}

// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function menuLinkObject_OnClick(e) {
	if(this.menuLink.menu.visible())
		this.hideMenu();
	else
		this.showMenu();
}

// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function menuLinkObject_OnMouseOver(e) {
	if(this.autoShow)
		this.showMenu();
		
	return true;
}

// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function menuLinkObject_OnMouseOut(e) {
	if(this.autoHide)
		this.hideMenu(this.menuLink.menuTimeout);

	return true;
}

// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function menuLinkObject_ShowMenu() {
	this.menuLink.realLink = this;
	if(this.menuLink.slideChild)
		this.menuLink.slideChild.slide(this.menuLink.menu.getHeight(), this.menuLink.slideDir);
	this.menuLink.menu.autoHide = this.autoHide;
	this.menuLink.menu.alignTo(this.menuLink, this.menuLink.menuAlign, this.menuLink.menuVAlign, this.menuLink.linkAlign, this.menuLink.linkVAlign, this.menuLink.shiftX, this.menuLink.shiftY);
	this.menuLink.menu.showMenu(this.menuLink);
}

function menuLinkObject_HideMenu(timeout) {
	if(this.timer) {
		window.clearTimeout(this.timer)
	}
	if(timeout)
		this.timer = this.document.parentWindow.setTimeout('document.getElement("' + this.id + '").hideMenu();', timeout);
	else {
		this.timer = 0;
		if(this.menuLink.menu.parentLink == this.menuLink)
			this.menuLink.menu.hideMenu();
		if(this.menuLink.slideChild)
			this.menuLink.slideChild.slide(-this.menuLink.menu.getHeight(), this.menuLink.slideDir);
	}
}

// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function aObject_MakeRollOver(status, image) {
	dhtml.quickNorm(this);

	this.status = status;
	this.image = image;

	this.addEvent("mouseover", rollOverObject_OnMouseOver);
	this.addEvent("mouseout", rollOverObject_OnMouseOut);
}

// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function rollOverObject_OnMouseOver(e) {
	this.ostatus = window.status;
	if(!this.ostatus)
		this.ostatus = '';

	if(this.status)
		window.status = this.status;

	if(this.image)
		this.image.swap();

	return true;
}

// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------

function rollOverObject_OnMouseOut(e) {
	window.status = this.ostatus;

	if(this.image)
		this.image.swap();

	return true;
}

// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------

function preproc_ImgEffect(attr) {
	var name = "";
	var altsrc = "";

	html = "<IMG";

	for(var i = 0; i < attr.length; i++) {
		switch(attr[i][1].toLowerCase()) {
		case "altsrc":
			altsrc = attr[i][2];
			break;
		case "name":
			name = attr[i][2];
			html += ' ' + attr[i][0];
			break;
		default:
			html += ' ' + attr[i][0];
		}
	}

	if(name && name.length && altsrc && altsrc.length)
		dhtml.addBasicInit("document.images['" + name + "']", "imgObject_MakeSwap", altsrc);

	return html + ">";
}

// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------

function proc_ImgEffect(img, doc) {

	proc_ImgSwap(img, doc);
	
	return img;
}

// --------------------------------------------------------------------------------
//                                  Anchor Code
// --------------------------------------------------------------------------------

function preproc_AnchorEffect(attr, html) {
	var evt = "";

	var pid = "";
	var pname = "";
	var pstatus = "";
	var pswap = "";
	var pmenu = "";
	var pmtime = 0;
	var pmlink = "";
	var pmltime = 0;
	var pma = "";
	var pmva = "";
	var pla = "";
	var plva = "";
	var dblclick = "";

	var ihtml = html;
	html = "<A";

	for(var i = 0; i < attr.length; i++) {
		switch(attr[i][1].toLowerCase()) {
		case "id":
			pid = attr[i][2];
			break;
		case "name":
			pname = attr[i][2];
			html += ' ' + attr[i][0];
			break;
		case "ondblclick":
			dblclick = attr[i][2];
			break;
		case "status":
			pstatus = attr[i][2];
			break;
		case "swapimg":
			pswap = attr[i][2];
			break;
		case "showmenu":
			pmenu = attr[i][2];
			break;
		case "menutimeout":
			pmtime = attr[i][2];
			break;
		case "menulink":
			pmlink = attr[i][2];
			break;
		case "linktimeout":
			pmltime = attr[i][2];
			break;
		case "menualign":
			pma = attr[i][2];
			break;
		case "menuvalign":
			pmva = attr[i][2];
			break;
		case "linkalign":
			pla = attr[i][2];
			break;
		case "linkvalign":
			plva = attr[i][2];
			break;
		default:
			html += ' ' + attr[i][0];
		}
	}

	if(!pname || !pname.length) {
		if(pid && pid.length)
			pname = pid;
		else
			pname = "nlnk" + Math.round(Math.random()*1000);

		html += ' name="' + pname + '"';
	}

	if(!pmtime || !pmtime.length)
		pmtime = 100;

	if(!pmltime || !pmltime.length)
		pmltime = 500;

	html += ' ondblclick="' + pname + '"';
	dhtml.addBasicInit("document.anchors['" + pname + "']", "fix_Anchor", "[eval]document",dblclick);

	if((pstatus && pstatus.length) || (pswap && pswap.length))
		dhtml.addBasicInit("(document.anchors['" + pname + "'] ? document.anchors['" + pname + "'].link : null)", "aObject", pstatus, "[eval]document.images['" + pswap + "']");

	if(pmenu && pmenu.length)
		dhtml.addBasicInit("document.getElement('" + pmenu + "')", "menuObject", pmtime);

	if(pmlink && pmlink.length)
		dhtml.addBasicInit("document.getElement('" + pmlink + "')", "menuLinkObject", "[eval]document.getElement('" + pmenu + "')", pma, pmva, pla, plva, pmltime);

	if(pmlink && pmlink.length && pid == pmlink)
		html = '<ilayer name="' + pid + '">' + html;

	html += ">" + ihtml + '</A>';

	if(pmlink && pmlink.length && pid == pmlink)
		html += "</ilayer>";

	return html;
}

// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------

function fix_Anchor(doc, dblClick) {
	var link = null;
	var i = 0;

	this.link = null;

	for(i = 0; i < doc.links.length && !this.link; i++) {
		link = doc.links[i];
		if(link.ondblclick && link.ondblclick.toString().indexOf(this.name) > -1) {
			if(dblClick && dblClick.length)
				eval("link.ondblclick=function anonymous(e) { " + dblClick + " };");
			else
				link.ondblclick = null;
			link.name = this.name;
			this.link = link;
		}
	}
}

// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------

function proc_AnchorEffect(a, doc) {
	var attr;
	var image = null;

	var para1 = "";

	a = dhtml.quickNorm(a);

	if(attr = a.getAttribute("status"))
		para1 = attr;

	if(attr = a.getAttribute("swapimg")) {
		image = doc.images[attr];
	}
	
	if(para1 || image)
		dhtml.setType(a, aObject_MakeRollOver, para1, image);

	proc_AnchorMenuLink(a, doc);

	return a;
}

// --------------------------------------------------------------------------------
//                                  DIV Code
// --------------------------------------------------------------------------------

function elemObject_MakeScroller(direction, speed, autostop) {
	dhtml.normalize(this);

	if(direction)
		this.direction = 1;
	else
		this.direction = 0;

	if(speed)		
		this.speed = speed;
	else
		this.speed = 1;

	this.startScroll = scrollerObject_StartScroll;
	this.stopScroll = scrollerObject_StopScroll;
	this.scrolling = scrollerObject_Scrolling;
	this.scroll = scrollerObject_Scroll;

	if(autostop) {
		this.addEvent("mouseover", scrollerObject_MouseOver);
		this.addEvent("mouseout", scrollerObject_MouseOut);
	}

	if(this.speed > 1000)
		this.speed = 1000;

	this.show();

	window.setTimeout("document.getElement('" + this.id + "').startScroll();", 1000 - this.speed);
}

function scrollerObject_StartScroll() {
	if(!dhtml)
		return;

	if(!this.content) {
		if(dhtml.NN4)
			this.content = dhtml.normalize(this.document.layers[0], this.document);
		else
			this.content = dhtml.normalize(this.firstChild, this.document);
	}

	if(!this.content)
		return;

	if(this.speed > 0)
		this.scrollStep = -1;
	else if(this.speed < 0) {
		this.scrollStep = 1;
		this.speed = -this.speed;
	} else
		this.scrollStep = 0;

	if(!dhtml.NN4) {
		if(this.direction)
			this.content.resizeTo(this.content.getWidth(), this.getHeight());
		else
			this.content.resizeTo(this.getWidth(), this.content.getHeight());
	}

	this.content.show();

	if((this.direction && (this.content.getWidth() > this.getWidth())) ||
		(!this.direction && (this.content.getHeight() > this.getHeight())))
			this.scroll();
}

function scrollerObject_MouseOver(e) {
	this.stopScroll();
}

function scrollerObject_MouseOut(e) {
	this.startScroll();
}

function scrollerObject_StopScroll() {
	if(this.timer)
		window.clearTimeout(this.timer);
	this.timer = 0;
}

function scrollerObject_Scrolling() {
	return (this.timer != 0);
}

function scrollerObject_Scroll() {
	var x = this.content.getX(true);
	var y = this.content.getY(true);
	
	if(this.direction) {
		if(x < -this.content.getWidth() || x > this.content.getWidth())
			x = this.getWidth() * -this.scrollStep;
		else
			x += this.scrollStep;
	} else {
		if(y < -this.content.getHeight() || y > this.content.getHeight())
			y = this.getHeight() * -this.scrollStep;
		else
			y += this.scrollStep;
	}

	this.content.moveTo(x, y, true);
	
	this.timer = window.setTimeout("document.getElement('" + this.id + "').scroll();", this.speed);
}

function preproc_ScrollEffect(attr, html) {
	var evt = "";

	var id = "";
	var cls = "";
	var width = 0;
	var height = 0;
	var speed = Number.NaN;
	var dir = 0;
	var autos = false;

	var ihtml = html;
	html = "<DIV";

	for(var i = 0; i < attr.length; i++) {
		switch(attr[i][1].toLowerCase()) {
		case "id":
			id = attr[i][2];
			html += ' ' + attr[i][0];
			break;
		case "name":
			id = attr[i][2];
			html += ' ' + attr[i][0];
			break;
		case "speed":
			speed = parseInt(attr[i][2]);
			break;
		case "dir":
			dir = dhtml.procAlign(attr[i][2]);
			if(dir < 0)
				dir = 0;
			break;
		case "stop":
			autos = true;
			break;
		case "width":
			width = parseInt(attr[i][2]);
			html += ' ' + attr[i][0];
			break;
		case "height":
			height = parseInt(attr[i][2]);
			html += ' ' + attr[i][0];
			break
		default:
			html += ' ' + attr[i][0];
		}
	}

	if(!pmtime || !pmtime.length)
		pmtime = 100;

	if(!pmltime || !pmltime.length)
		pmltime = 500;

	if(!isNaN(speed) && id && id.length)
		dhtml.addBasicInit("document.getElement('" + id + "')", "scrollerObject", speed, dir, autos);

	html += "><DIV id=\"" + id + "_content\">" + ihtml + '</DIV></DIV>';

	return html;
}

function proc_ScrollEffect(elem, doc) {
	var attr;

	//If the gecko render is not geater than 20020529 then don't
	// do anythign since that version an prior has issues with this.
	if(dhtml.mozilla && !dhtml.checkVersion(1, 20020529))
		return elem;
	
	dhtml.quickNorm(elem);
	
	var id = "";
	var cls = "";
	var param1 = Number.NaN;
	var param2 = 0;
	var param3 = false;
	var width = 0;
	var height = 0;

	if(attr = elem.getAttribute("id"))
		id = attr;

	if(attr = elem.getAttribute("class"))
		cls = attr;

	if(attr = elem.getAttribute("dir")) {
		param1 = dhtml.procAlign(attr);
		if(param1 < 0)
			param1 = 0;
	}

	if(attr = elem.getAttribute("speed"))
		param2 = parseInt(attr);
	
	if(attr = elem.getAttribute("stop")) 
		param3 = true;
	
	if(attr = elem.getAttribute("width"))
		width = parseInt(attr);

	if(attr = elem.getAttribute("height"))
		height = parseInt(attr);
		
	var ep = elem.getParent();
	var frag = document.newFragment();
	var scroller = document.newElement('DIV');
	var content = document.newElement('DIV');

	frag.appendChild(scroller);	
	scroller.id = id;
	scroller.style.position = "relative";
	scroller.appendChild(content);
	scroller.resizeTo(width, height,false);
	scroller.hide();

	content.moveTo(0, 0);
	if(cls)
		content.setClass(cls);
	content.hide();
	
	if(elem.firstChild.nodeType == 8) {
		content.setHTML(elem.firstChild.nodeValue);
	} else
		while(elem.firstChild)
			content.appendChild(elem.removeChild(elem.firstChild));

	ep.replaceElem(frag, elem);

	if(id && !isNaN(param2)) {
		dhtml.setType(scroller, elemObject_MakeScroller, param1, param2, param3);
	}
	
	return frag;
}

function preproc_WindowEffect(attr, html) {
	return html;
}

function proc_WindowEffect(elem, doc) {
	dhtml.quickNorm(elem);

	var width = null;
	var height = null;

	if(attr = elem.getAttribute("width"))
		width = parseInt(attr);

	if(attr = elem.getAttribute("height"))
		height = parseInt(attr);


	var ep = elem.getParent();
	var frag = document.newFragment();
	var scroll = document.newElement('DIV');

	//Mozilla quirkyness workaround for TABLEs
	if(dhtml.Moz && !elem.firstChild && elem.nextSibling && elem.nextSibling.nodeName == 'TABLE') {
		scroll.appendChild(ep.removeChild(elem.nextSibling));
	} else {
		while(elem.firstChild) {
			scroll.appendChild(elem.removeChild(elem.firstChild));
		}
	}

	scroll.resizeTo(width, height, true);

	ep.replaceElem(scroll, elem);
	
	return scroll;
}

// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------

if(window.dhtml) {
	dhtml.addTag('A', proc_AnchorEffect, null, preproc_AnchorEffect, -1);
	dhtml.addTag('IMG', proc_ImgEffect, null, preproc_ImgEffect, 0);
	dhtml.addTag('SCROLL', proc_ScrollEffect, null, preproc_ScrollEffect, 1);
	dhtml.addTag('WINDOW', proc_WindowEffect, null, preproc_WindowEffect, 1);
}
