//popup functionality - taken directly from the RAID utility.js
window.onerror=null;
var win = null;
function PopWindow(mypage,myname) {
	//closePopWin();
	winprops = 'height=500,width=820,top=30,left=0,scrollbars=1,resizable=1,status=1';
	win = window.open(mypage, myname, winprops);
	}
function SizedPopWindow(mypage,myname,w,h) {
	//closePopWin();
	winprops = 'height='+h+',width='+w+',top=30,left=0,scrollbars=1,resizable=1,status=1';
	win = window.open(mypage, myname, winprops);
	}
function closePopWin() {
	if(win != null) { 
		if(!win.closed) { 
			win.close();
			win = null;
			} else {
			win = null;
			}
		}	
	}

//faq toggle
function toggle(obj) {
	var el = document.getElementById(obj);
	var ar = document.getElementById(obj+'ar');
	if ( el.style.display != 'none' ) {
		el.style.display = 'none';
		ar.innerHTML='<img src="../i/arrow_right.gif" style="width:5px;height:9px;" alt="" title="" />';
	}
	else {
		el.style.display = 'block';
		ar.innerHTML='<img src="../i/arrow_down.gif" style="width:9px;height:5px;" alt="" title="" />';
	}

}

//navigation rollovers
function load(defImg) {
	document.getElementById(defImg).src=("../i/left/nav_" + defImg + "_on.gif");
}

sfHover = function() {
	var sfEls = document.getElementById("leftNav").getElementsByTagName("a");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

// function: show / hide menu
function showMenu(menuId) {
	document.getElementById(menuId).style.display="";
}

function hideMenu(menuId) {
	document.getElementById(menuId).style.display="none";
}

// function: show / hide tabs
function showTab(tabId) {
	document.getElementById('tab1').style.display="none";
	document.getElementById('tab2').style.display="none";
	document.getElementById('tab3').style.display="none";
	document.getElementById('tab1a').style.display="none";
	document.getElementById('tab2a').style.display="none";
	document.getElementById('tab3a').style.display="none";
	document.getElementById('tab1b').style.display="inline";
	document.getElementById('tab2b').style.display="inline";
	document.getElementById('tab3b').style.display="inline";
	document.getElementById(tabId+'b').style.display="none";
	document.getElementById(tabId+'a').style.display="inline";
	document.getElementById(tabId).style.display="block";
}

function showTab4(tabId) {
	document.getElementById('tab1').style.display="none";
	document.getElementById('tab2').style.display="none";
	document.getElementById('tab3').style.display="none";
	document.getElementById('tab4').style.display="none";
	document.getElementById('tab1a').style.display="none";
	document.getElementById('tab2a').style.display="none";
	document.getElementById('tab3a').style.display="none";
	document.getElementById('tab4a').style.display="none";
	document.getElementById('tab1b').style.display="inline";
	document.getElementById('tab2b').style.display="inline";
	document.getElementById('tab3b').style.display="inline";
	document.getElementById('tab4b').style.display="inline";
	document.getElementById(tabId+'b').style.display="none";
	document.getElementById(tabId+'a').style.display="inline";
	document.getElementById(tabId).style.display="block";
}

// function: clear form field
function clearDefault(el) {
  if (el.defaultValue==el.value) el.value = "";
  el.setAttribute('maxLength','9');
}

