/* nothing right now */
function showZones(toggle) {
	badge = document.getElementById('badge');
	active = document.body.className;
	var zones = badge.getElementsByTagName('a');
	badge.className = toggle ? "expanded":"";
	for (var n=0; i = zones[n]; n++) {
		if (active.indexOf(i.id.toLowerCase().substr(1)) == -1) {
			i.style.visibility = toggle ? 'visible':'hidden';
		}
	}
}

if (document.getElementById) {
	var i,badge = document.getElementById('badge');
	if (badge != null) {
		var zones = badge.getElementsByTagName('a');
		for (var n=0; i = zones[n]; n++) {
			i.onmouseover =  function () {showZones(true)};
			i.onfocus =  function () {showZones(true)};
			i.onmouseout =  function () {showZones(false)};
//			i.onblur =  function () {showZones(false)};
		}
	}
}

function toggleFaqs(toggle) {
	if (document.getElementById && document.getElementsByTagName) {
		var n,faq,faqs=document.getElementById('faqs').getElementsByTagName('div');
		for (n=0; faq=faqs[n]; n++) {
			if (/^a (block|none)$/.test(faq.className)) {
				faq.className = toggle ? 'a block':'a none';
			}
		}
		return false; // cancel the click
	}
	return true; // didn't work, let the click through
}

function toggleFaq(faq) {
	if (faq != null && document.getElementById) {
		var ans = document.getElementById(faq);
		ans.className = ans.className == 'a block' ? 'a none':'a block';
		return false; // cancel the click
	}
	return true; // didn't work, let the click through
}

// Note that this popup leaves the user's toolbar. THIS IS DELIBERATE AND SHOULD NOT BE CHANGED - kb */
function popWin(popLink,args) {
	var pleft,ptop,pwidth,pheight;
	// gets tossed later if args is defined
	if (screen.availHeight && screen.availWidth) {
		pwidth = Math.max(600,Math.min(800,screen.availWidth/2));
		pheight = Math.max(400,Math.min(600,screen.availHeight/2));
		pleft = (screen.availWidth/2)-(pwidth/2);
		ptop = (screen.availHeight/2)-(pheight/2);
	} else {
		pwidth = 600;
		pheight = 400;
		pleft = 10;
		ptop = 10;
	}
	var wArgs = args != null ? args:"width="+pwidth+",height="+pheight+",status,resizable,scrollbars,top="+ptop+",left="+pleft;
	var targ = popLink.target != '' ? popLink.target : '_blank';
	var newWin = window.open(popLink.href,targ,wArgs);
	newWin.focus();
	return false;
}

function bqWin(bqLink) {
	var xwin=null;
	var retval;
	var sW = W = screen.availwidth; 
	var sH = H = screen.availheight; 
	if (W >= 800) { 
	W = 800; 
	} 
	if (H >= 600) { 
	H = 600; 
	}
	T = (sH - H) / 2;
	L = (sW - W) / 2;

	try {
		if( xwin != null ){
		  xwin.focus();
		} else {
			xwin = window.open("", "BlueQuote", "status,scrollbars,resizable,width="+W+",height="+H+",left="+L+",top="+T);
			xwin.resizeTo(W,H);
			xwin.moveTo(L,T);
			xwin.location = bqLink.href;
		}
	} catch(er) {
		xwin.close();
		xwin = window.open("", "BlueQuote", "status,scrollbars,resizable,width="+W+",height="+H+",left="+L+",top="+T);
		xwin.resizeTo(W,H);
		xwin.moveTo(L,T);
		xwin.location = bqLink.href;
	}

}

function infoThing(tabNum) {
	if (document.getElementById) {
		try {
			var infothing = document.getElementById('infoThing'),infoimg = infothing.getElementsByTagName('img');
			infothing.className="showTab"+tabNum;
			for (var n=0; n < infoimg.length;n++) {
				infoimg[n].src = infoimg[n].src.replace(/(.hot)?.gif/,n+1==tabNum?".hot.gif":".gif");
			}
			return false;
		} catch (e) {
			return true;
		}
	}
}
