// Chas E Smith javascript 
function addLoadEvent(func) {var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { oldonload(); func(); } } }
function getElementsByClassName(classname) { var a = []; var re = new RegExp('\\b' + classname + '\\b'); var els = document.getElementsByTagName("*"); for(var i=0,j=els.length; i<j; i++) if(re.test(els[i].className))a.push(els[i]); return a; }
addLoadEvent(runBookmark);
function runBookmark(){ var bookmark = document.getElementById("bookmark"); if(!bookmark){ return true; } var title = bookmark.getAttribute("title"); bookmark.onclick = function(){ return addBookmark(title, bookmark); }; }
addLoadEvent(openPopup);
function openPopup(){
	var popupLinks = getElementsByClassName("openPopup");
	for ( var i=0; i < popupLinks.length; i++ ){
		var trigger = popupLinks[i].getAttribute("className") || popupLinks[i].getAttribute("class");
		switch(trigger)
		{
			case "openPopup prodPopup":
			popupLinks[i].onclick = function(){
				return popup( this, "Product", "602", "743", "yes" );
			}
		break;
		case "openPopup terms":
			popupLinks[i].onclick = function(){
				return popup( this, "Terms", "600", "744", "yes" );
			}
		break;
		case "openPopup emailPopup":
			popupLinks[i].onclick = function(){
				return popup( this, "EmailFriend", "440", "450", "" );
			}
		break;
		case "openPopup forgotten":
			popupLinks[i].onclick = function(){
				return popup( this, "forgotten", "440", "298", "" );
			}
		break;
		case "openPopup security":
			popupLinks[i].onclick = function(){
				return popup( this, "security", "440", "368", "" );
			}
		break;
		}
	}
}
function popup( vURL, vWinName, vWidth, vHeight, vScrollbar)
//vWinName cannot contain spaces, leave vScrollbar blank for no scrollba
{
	if (! window.focus)return true;
	
	var vhref;
	var vSWidth = screen.width
	var vSHeight = screen.height
	
	if(vScrollbar == "yes")
	{
		vWidth = new Number(vWidth) + 16
	}
	
	var vleftPos = (vSWidth / 2) - (vWidth / 2)
	var vtopPos = (vSHeight / 2) - (vHeight / 2)
	
	if (typeof(vURL) == 'string')
	{
		vhref = vURL;
	} else {
		vhref = vURL.href;
	}
	window.open(vhref, vWinName, 'scrollbars=' + vScrollbar + ',statusbar=no,menubar=0,width=' + vWidth + ',height=' + vHeight + ',left=' + vleftPos + ',top=' + vtopPos);	
	return false;
}
function addBookmark(title,url) { if (window.sidebar) { window.sidebar.addPanel(title, url,""); } else if( document.all ) { window.external.AddFavorite( url, title); } else if( window.opera && window.print ) { return true; }; return false; }
addLoadEvent(faqClick); 
function faqClick(){ if (!document.getElementById("questions")){ return false; } var QBox = document.getElementById("questions"); var questionList = QBox.getElementsByTagName("a"); if (questionList.length < 1) return false;	for ( var i=0; i < questionList.length; i++){ var thisq = i+1; questionList[i].onclick = function(){ activateTip(this.id); return true;	} } }
var last = 'q1';
function activateTip(which){ toTheTop(); document.getElementById(which+'_a').className='question on'; last = which; }
function toTheTop(){ document.getElementById(last+'_a').className="question"; }