function popIn(target){
	thisPopIn = document.getElementById(target);
	thisPopIn.style.display = "block";
	return false;
}
function closePopIn(target){
	thisPopIn = document.getElementById(target);
	thisPopIn.style.display = "none";
	return false;
}
function backToTop(){
	window.scroll(0,0);
	return false;
}

//Summary: opens a pop up, retrieves size
function openPopUp(url, width, height, scrollbars)
{
    mywindow = window.open(url,"mywindow","location=1,resizable=1,status=1,toolbar=1,menubar=1,scrollbars=" + scrollbars + ",width=" + width + ",height=" + height);
    
    return false;
}

function openAdobe()
{
    return openPopUp('http://www.adobe.com/products/acrobat/readstep2.html', 800, 600, 1);    
}

function altFooter()
{
    UpdateImage= document.getElementById('right_container');
    UpdateImage.style.backgroundImage = 'url(../../images/content-btm_2.gif)';
    return false;
}

//Non-Obtrusive Image Swap Script V1.1 by Hesido.com 
//Do not delete these comments. 
//Attribution required on all accounts 
function prepareImageSwap(elem,mouseOver,mouseOutRestore,mouseDown,mouseUpRestore,mouseOut,mouseUp) {
	if (typeof(elem) == 'string') elem = document.getElementById(elem); 
	if (elem == null) return; 
	var regg = /(.*)(_nm\.)([^\.]{3,4})$/ 
	var prel = new Array(), img, imgList, imgsrc, mtchd; 
	imgList = elem.getElementsByTagName('img'); 
	for (var i=0; img = imgList[i]; i++) { 
		if (!img.rolloverSet && img.src.match(regg)) { 
			mtchd = img.src.match(regg); 
			img.hoverSRC = mtchd[1]+'_hv.'+ mtchd[3]; 
			img.outSRC = img.src; 
			if (typeof(mouseOver) != 'undefined') { 
				img.hoverSRC = (mouseOver) ? mtchd[1]+'_hv.'+ mtchd[3] : false; 
				img.outSRC = (mouseOut) ? mtchd[1]+'_ou.'+ mtchd[3] : (mouseOver && mouseOutRestore) ? img.src : false; 
				img.mdownSRC = (mouseDown) ? mtchd[1]+'_md.' + mtchd[3] : false; 
				img.mupSRC = (mouseUp) ? mtchd[1]+'_mu.' + mtchd[3] : (mouseOver && mouseDown && mouseUpRestore) ? img.hoverSRC : (mouseDown && mouseUpRestore) ? img.src : false; 
				} 
			if (img.hoverSRC) {preLoadImg(img.hoverSRC); img.onmouseover = imgHoverSwap;} 
			if (img.outSRC) {preLoadImg(img.outSRC); img.onmouseout = imgOutSwap;} 
			if (img.mdownSRC) {preLoadImg(img.mdownSRC); img.onmousedown = imgMouseDownSwap;} 
			if (img.mupSRC) {preLoadImg(img.mupSRC); img.onmouseup = imgMouseUpSwap;}
			img.rolloverSet = true; 
		} 
	} 
	function preLoadImg(imgSrc) {
		prel[prel.length] = new Image(); prel[prel.length-1].src = imgSrc; 
	} 
} 
function imgHoverSwap() {this.src = this.hoverSRC;} 
function imgOutSwap() {this.src = this.outSRC;} 
function imgMouseDownSwap() {this.src = this.mdownSRC;} 
function imgMouseUpSwap() {this.src = this.mupSRC;}

//Find all link elements and add an onfocus attribute and value
function hideFocusBorders(){
    if (!document.getElementsByTagName) return false;
	var theahrefs = document.getElementsByTagName("a");
	if (!theahrefs){return;}
	var href_length = theahrefs.length;
	for(var x=0;x!=href_length;x++){
		theahrefs[x].onfocus = function stopLinkFocus(){this.hideFocus=true;};
	}
}
