/****
* These functions allow dynamic HTML effects to be added to any
* web page and will work on both Netscape 4.0+ and MS
* Internet Explorer 4.0+ browsers.
***/

var layerList = new Array();

function createLayerActive(name,left,top,width,height,visible,content,actionStr){
	var z = layerList.length;
	var layer;
	layerList[z]=name;

	if (document.layers){
		document.writeln('<layer name="' + name + '" left=' + left + ' top=' + top + ' width=' + width + ' height=' + height + ' visibility=' + (visible ? '"show"' : '"hide"') + ' z-index=' + z + ' onMouseOut="rolloutsub(\'' + actionStr + '\',event)">');
		document.writeln(content);   
		document.writeln('</layer>');
		layer = getLayer(name);
		layer.width = width;
		layer.height = height;
	}

	if (document.all){
		document.writeln('<div id="' + name + '" style="position:absolute; overflow:none; left:' + left + 'px; top:' + top + 'px; width:' + width + 'px; height:' + height + 'px;' + ' visibility:' + (visible ? 'visible;' : 'hidden;') + '" z-index="' + z + '" onMouseOut="rolloutsub(\'' + actionStr + '\',event)">');
		document.writeln(content);
		document.writeln('</div>');
	}
}

function hideLayer(name){
	var layer = getLayer(name);

	if (document.layers)
		layer.visibility="hide";
	if (document.all)
		layer.visibility="hidden";
}

function showLayer(name){
	var layer = getLayer(name);

	if (document.layers)
		layer.visibility="show";
	if (document.all)
		layer.visibility="visible";
}

function getLeft(name){
	var layer = getLayer(name);

	if (document.layers)
		return(layer.left);
	else if (document.all)
		return(layer.pixelLeft);
	else
		return(null);
}

function getTop(name){
	var layer = getLayer(name);

	if (document.layers)
		return(layer.top);
	else if (document.all)
		return(layer.pixelTop);
	else
		return(null);
}

function getWidth(name){
	var layer = getLayer(name);

	if (document.layers)
		return(layer.width);
	else if (document.all)
		return(layer.pixelWidth);
	else
		return(null)
}

function getHeight(name){
	var layer = getLayer(name);

	if (document.layers)
		return(layer.height);
	else if (document.all)
		return(layer.pixelHeight);
	else
		return(null);
}

function getWinWidth(){
	if (document.layers)
		return(window.innerWidth);
	else if (document.all)
		return(document.body.clientWidth);
	else
		return(null);
}

function getWinHeight(){
	if (document.layers)
		return(window.innerHeight);
	else if (document.all)
		return(document.body.clientHeight);
	else
		return(null);
}

function getLayer(name){
	// Returns a handle to the named layer.
	if (document.layers)
		return(document.layers[name]);
	else if (document.all){
		layer = eval('document.all.'+name+'.style');
		return(layer);
	}
	else
		return(null);
}
