
//-----BROWSERTEST

var version = parseInt(navigator.appVersion);
var NS = false;
var IE = false;
var MAC = false;

if (navigator.appName.substring(0,8) == "Netscape" && version >=4){
	NS = true
}
if (navigator.appName.substring(0,9) == "Microsoft" && version >=4){
	IE = true
}
if (navigator.userAgent.indexOf('Mac') != -1){
	MAC = true
}


//-----NSBUG

function handleResize(){
	history.go(0);
}

if (NS) {
	window.captureEvents(Event.RESIZE);
	window.onresize = handleResize;
}




//-----ROLLOVER /ROLLOUT

function textOver(blueLayer, blackLayer){
	if (NS) {
		document.layers[blueLayer].visibility = 'show';
		document.layers[blackLayer].visibility = 'hide';
	}

}

function textOut(blueLayer, blackLayer){
	if (NS) {
		document.layers[blueLayer].visibility = 'hide';
		document.layers[blackLayer].visibility = 'show';
	}

}

function imageOver(blueLayer, blackLayer){
	if (NS) {
		document.layers[blueLayer].zIndex = '2';
		document.layers[blackLayer].zIndex = '1';
	}

	if (IE) {
		document.all[blueLayer].style.zIndex = '2';
		document.all[blackLayer].style.zIndex = '1';
	}
}

function imageOut(blueLayer, blackLayer){
	if (NS) {
		document.layers[blueLayer].zIndex = '1';
		document.layers[blackLayer].zIndex = '2';
	}

	if (IE) {
		document.all[blueLayer].style.zIndex = '1';
		document.all[blackLayer].style.zIndex = '2';
	}
}

//----------------//
//-----LAYERS-----//
//----------------//

function openLayer(name, left, top, width, visible, z, eventOver, eventOut){
	if (NS) {
		document.writeln('<LAYER NAME = "' + name + '"; POSITION = "absolute"; LEFT = "' + left + '"; TOP = "' + top + '"; WIDTH = "' + width + '"; VISIBILITY = "' + (visible ? 'show' : 'hide') + '"; Z-INDEX = "' + z + '"; onMouseOver = "' + eventOver + '"; onMouseOut = "' + eventOut + '">');
	}

	if (IE) {
		document.writeln('<DIV ID = "' + name + '"; STYLE = "position: absolute; left:' + left + '; top:' + top + '; width:' + width + '; visibility:' + (visible ? 'visible' : 'hidden') + '; z-index:' + z + '"; onMouseOver = "' + eventOver + '"; onMouseOut = "' + eventOut + '">');
	}
}

function closeLayer(){
	if (NS) {document.writeln('</LAYER>')}
	if (IE) {document.writeln('</DIV>')}
}

//---TEXT LAYERS

function textLayer(name, left, top, width, visible, z, eventOver, eventOut, text){
	openLayer(name, left, top, width, visible, z, eventOver, eventOut);
	document.writeln('' + text + '');
	closeLayer();
}

function textLinkLayer(name, left, top, width, visible, z, eventOver, eventOut, pClass, href, target, text){
	openLayer(name, left, top, width, visible, z, eventOver, eventOut);
	document.writeln('<A CLASS = "' + pClass + '"; HREF = "' + href + '"; TARGET = "' + target + '">');
	document.writeln('' + text + '');
	document.writeln('</A>');
	closeLayer();
}

function textRollLinkLayer(name, left, top, width, visible, z, eventOver, eventOut, pClass, href, target, text){
	openLayer(name, left, top, width, visible, z, eventOver, eventOut);
	document.writeln('<A CLASS = "' + pClass + '"; HREF = "' + href + '"; TARGET = "' + target + '">');
	document.writeln('' + text + '');
	document.writeln('</A>');
	closeLayer();
}

//------IMAGE LAYERS

function imageLayer(name, left, top, width, visible, z, eventOver, eventOut, src, imgWidth, imgHeight){
	openLayer(name, left, top, width, visible, z, eventOver, eventOut);
	document.writeln('<IMG SRC = "' + src + '"; WIDTH = "' + imgWidth + '; HEIGHT = "' + imgHeight + '; BORDER = "0">');
	closeLayer();
}

function imageLinkLayer(name, left, top, width, visible, z, eventOver, eventOut, href, target, src, imgWidth, imgHeight){
	openLayer(name, left, top, width, visible, z, eventOver, eventOut);
	document.writeln('<A HREF = "' + href + '"; TARGET = "' + target + '">');
	document.writeln('<IMG SRC = "' + src + '"; WIDTH = "' + imgWidth + '; HEIGHT = "' + imgHeight + '; BORDER = "0"></A>');
	closeLayer();
}

//--------NEW WINDOW


function nWindow(href)
{
        newWindow = window.open(href);
        newWindow.focus()
}
