(document.layers) ? layerobject=true : layerobject=false;
(document.all) ? allobject = true: allobject = false;
(document.getElementById) ? dom = true : dom = false;
opera=navigator.userAgent.toLowerCase().indexOf('opera')!=-1;
var snow = 0;
var isSelect = false;

function getElement(layerName,parentLayer) {
	if (allobject) return document.all[layerName];
	if (dom) return document.getElementById(layerName);
	if (layerobject) {
		parentLayer = (parentLayer)? parentLayer : self;
		layerCollection = parentLayer.document.layers;
		if (layerCollection[layerName])
			return layerCollection[layerName];
			for(i=0; i < layerCollection.length;)
				return(getElement(layerName, layerCollection[i++]));
	}
}

function hide(layerName) {
	var theLayer = getElement(layerName);
	snow = 0;
	if (layerobject)
		theLayer.visibility = 'hide';
	else
		theLayer.style.visibility = 'hidden';
}

function dontdisplay(layerName) {
	var theLayer = getElement(layerName);
	snow = 0;
	if (layerobject)
		theLayer.display = 'none';
	else
		theLayer.style.display = 'none';
}

function show(layerName) {
	var theLayer = getElement(layerName);
	if (layerobject)
		theLayer.visibility = 'show';
	else
		theLayer.style.visibility = 'visible';
}

function display(layerName) {
	var theLayer = getElement(layerName);
	if (layerobject)
		theLayer.display = 'block';
	else
		theLayer.style.display = 'block';
}

function setX(layerName, x) {
	var theLayer = getElement(layerName);
	if (layerobject) {
		theLayer.left=x;
	} else if (opera) {
		theLayer.style.pixelLeft=x;
	} else {
		theLayer.style.left=x+"px";
	}
}

function setY(layerName, y) {
	var theLayer = getElement(layerName);
	if (layerobject)
		theLayer.top=y;
	else if (opera)
		theLayer.style.pixelTop=y;
	else
		theLayer.style.top=y+"px";
}

function setZ(layerName, zIndex) {
	var theLayer = getElement(layerName);
	if (layerobject)
		theLayer.zIndex = zIndex;
	else
		theLayer.style.zIndex = zIndex;
}

function setClass(layerName, classin) {
	var theLayer = getElement(layerName);

	theLayer.setAttribute("class",classin);
	theLayer.setAttribute("className",classin);
}

function setHeight(layerName, height) {
	var theLayer = getElement(layerName);
	if (layerobject)
		theLayer.clip.height = height;
	else if (opera)
		theLayer.style.pixelHeight = height;
	else
		theLayer.style.height = height+"px";
}

function setWidth(layerName, width) {
	var theLayer = getElement(layerName);
	if (layerobject)
		theLayer.clip.width = width;
	else if (opera)
		theLayer.style.pixelWidth = width;
	else
		theLayer.style.width = width+"px";
}

function setClip(layerName, top, right, bottom, left) {
	var theLayer = getElement(layerName);
	if (layerobject) {
		theLayer.clip.top = top;
		theLayer.clip.right = right;
		theLayer.clip.bottom = bottom;
		theLayer.clip.left = left;
	} else {
		theLayer.style.clip = "rect("+top+"px "+right+"px "+" "+bottom+"px "+left+"px )";
	}
}

function setContents(layerName, content) {
	var theLayer = getElement(layerName);
	if (layerobject) {
		theLayer.document.write(content);
		theLayer.document.close();
		return;
	}
	if (theLayer.innerHTML)
		theLayer.innerHTML = content;
}

function getHeight(layerName) {
	var theLayer = getElement(layerName);
	if (layerobject)
		return parseInt(theLayer.clip.height);
	else if (opera)
		return parseInt(theLayer.style.pixelHeight);
	else
		return parseInt(theLayer.style.height);
}

function getWidth(layerName) {
	var theLayer = getElement(layerName);
	if (layerobject)
		return parseInt(theLayer.clip.width);
	else if (opera)
		return parseInt(theLayer.style.pixelWidth);
	else
		return parseInt(theLayer.style.width);
}



var newsimageoff = new Image(); 
newsimageoff.src = "/images/news.png";
var newsimageon = new Image(); 
newsimageon.src = "/images/newson.png";

var fluteimageoff = new Image(); 
fluteimageoff.src = "/images/flutes.png";
var fluteimageon = new Image(); 
fluteimageon.src = "/images/fluteson.png";

var saximageoff = new Image(); 
saximageoff.src = "/images/saxophones.png";
var saximageon = new Image(); 
saximageon.src = "/images/saxophoneson.png";

var clarinetimageoff = new Image(); 
clarinetimageoff.src = "/images/clarinets.png";
var clarinetimageon = new Image(); 
clarinetimageon.src = "/images/clarinetson.png";

var galleryimageoff = new Image(); 
galleryimageoff.src = "/images/gallery.png";
var galleryimageon = new Image(); 
galleryimageon.src = "/images/galleryon.png";

var infoimageoff = new Image(); 
infoimageoff.src = "/images/info.png";
var infoimageon = new Image(); 
infoimageon.src = "/images/infoon.png";

var contactimageoff = new Image(); 
contactimageoff.src = "/images/contact.png";
var contactimageon = new Image(); 
contactimageon.src = "/images/contacton.png";

var podcastimageoff = new Image(); 
podcastimageoff.src = "/images/podoff.png";
var podcastimageon = new Image(); 
podcastimageon.src = "/images/podon.png";

function buttonhover(whichone,actionval) {
	if (whichone == 'news') {
		if (actionval == 'on') {
			newsbut.src = newsimageon.src;
		} else {
			newsbut.src = newsimageoff.src;
		}
	}
	if (whichone == 'flutes') {
		if (actionval == 'on') {
			flutesbut.src = fluteimageon.src;
		} else {
			flutesbut.src = fluteimageoff.src;
		}
	}
	if (whichone == 'sax') {
		if (actionval == 'on') {
			saxbut.src = saximageon.src;
		} else {
			saxbut.src = saximageoff.src;
		}
	}
	if (whichone == 'clarinet') {
		if (actionval == 'on') {
			clarinetbut.src = clarinetimageon.src;
		} else {
			clarinetbut.src = clarinetimageoff.src;
		}
	}
	if (whichone == 'gallery') {
		if (actionval == 'on') {
			gallerybut.src = galleryimageon.src;
		} else {
			gallerybut.src = galleryimageoff.src;
		}
	}
	if (whichone == 'info') {
		if (actionval == 'on') {
			infobut.src = infoimageon.src;
		} else {
			infobut.src = infoimageoff.src;
		}
	}
	if (whichone == 'contact') {
		if (actionval == 'on') {
			contactbut.src = contactimageon.src;
		} else {
			contactbut.src = contactimageoff.src;
		}
	}
	if (whichone == 'podcast') {
		if (actionval == 'on') {
			podcastbut.src = podcastimageon.src;
		} else {
			podcastbut.src = podcastimageoff.src;
		}
	}
}

