window.onload = initall();

//var count = 1;
//var imageOpacity = 1;
//var image;
//var fadingImages;

function initall() {
	for (var i=0; i<document.images.length; i++) {
		if(document.images[i].parentNode.tagName == "A") {
			setupRollover(document.images[i]);
		}
	}
}

function setupRollover(thisImage) {
	thisImage.outImage = new Image();
	thisImage.outImage.src = thisImage.src;
	thisImage.onmouseout = function() {
		this.src = this.outImage.src;
	}
	thisImage.overImage = new Image();
	thisImage.overImage.src = "theme/" + thisImage.id + "_on.jpg";
	thisImage.onmouseover = function() {
		this.src = this.overImage.src;
	}
}

function cursorHand() {
	var arr = document.getElementsByName('linkPic');
	for (var i = 0; i <= arr.length; i++) {
		arr[i].style.cursor = "pointer";
	}
	return false;
}

//****************************** Client Email Settings ******************************//
function show(id) {
	var e = document.getElementById(id);
	e.style.visibility = 'visible';
	e.style.display = 'block';
}

function hide(id1,id2,id3) {
	var a = document.getElementById(id1);
	var b = document.getElementById(id2);
	var c = document.getElementById(id3);
	a.style.visibility = 'hidden';
	a.style.display = 'none';
	b.style.visibility = 'hidden';
	b.style.display = 'none';
	c.style.visibility = 'hidden';
	c.style.display = 'none';
}

//****************************** fade in/out slide ******************************// something is broken in this -> gets glitchy if move for tab to tab in browsers 
//function slideShow() {
//	image = document.getElementById("tower" + count + "");
//		//alert("tower" + count + "");
//	var fade = setInterval(function() {
//		imageOpacity -= 0.025;
//		image.style.opacity = imageOpacity;
//			if(imageOpacity <= 0) {
//				clearInterval(fade);
//				image.style.opacity = 0;
//				if (count < 4) {
//					count++;
//					imageOpacity = 1;
//					//alert("opacity for next image is " + imageOpacity + ",");
//				} else {
//					count = 1;
//					imageOpacity = 1;
//					//alert("opacity for next image is " + imageOpacity + ",");
//					//alert("...starting slide show over at tower" + count + ".");
//					fadingImages = document.getElementsByName("fadingImage");
//					for (var i = 0; i <= fadingImages.length; i++) {
//						fadingImages[i].style.opacity = 1;
//						//alert("tower" + (i+1) + " is visible.");
//					}					
//				}
//			}
//		}, 50);	
//	var t = setTimeout(slideShow, 4 * 1000);
//}

//****************************** for menu drop downs ******************************//
function internetServiceShow() {
	document.getElementById("internetServiceDropDown").style.top = "221px";
}
function internetServiceHide() {
	document.getElementById("internetServiceDropDown").style.top = "0px";
}
function onlineSupportShow() {
	document.getElementById("onlineSupportDropDown").style.top = "269px";
}
function onlineSupportHide() {
	document.getElementById("onlineSupportDropDown").style.top = "0px";
}
