function imgRollover(imgBoxID) {
	var MenuCounts = document.getElementById(imgBoxID).getElementsByTagName("img");
	for (i = 0; i < MenuCounts.length; i++) {
 		var numImg = MenuCounts.item(i);
		var ImgCheck = numImg.src.substring(numImg.src.length - 6, numImg.src.length);
		if (ImgCheck != "Up.jpg") {
			numImg.onmouseover = function () {
				this.src = this.src.replace(".jpg", "Up.jpg");
			}
			numImg.onmouseout = function () {
				this.src = this.src.replace("Up.jpg", ".jpg");
			}
		}
	}
}

function slideSwitch() {
	var $active = $('#slideshow img.active');
	if ( $active.length == 0 ) $active = $('#slideshow img:last');
	var $next =  $active.next().length ? $active.next() : $('#slideshow img:first');
	$active.addClass('last-active');
	$next.css({opacity: 0.0})
	 .addClass('active')
	 .animate({opacity: 1.0}, 1000, function() {
	     $active.removeClass('active last-active');
	});
}

function openNewWindow(url, name, width, height) {
	open(url, name, "left=0, top=0, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width=" + width + ", height=" + height);
}

function bluring() {
	if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
}

document.onfocusin = bluring;
