<!-- //

	// do not show outlines when a link is clicked
	function outline() {
		onclick='this.blur()';
	}

	// send focus to username of login
	function login() {
		document.login.filterlabs_username.focus();
	}

	// send focus to username of signup page
	function signup() {
		document.billing.signup_username.focus();
	}

	// addEvent and removeEvent
	// cross-browser event handling for IE5+,  NS6 and Mozilla
	// By Scott Andrew
	function addEvent(elm, evType, fn, useCapture) {
	  if (elm.addEventListener){
	    elm.addEventListener(evType, fn, useCapture);
	    return true;
	  } else if (elm.attachEvent){
	    var r = elm.attachEvent("on"+evType, fn);
	    return r;
	  } else {
	    alert("Handler could not be removed");
	  }
	}
	function prepareInputs() {
	 if (!document.getElementsByTagName) return;
	 var oi=0;
	 var thisObj;
	 var objs = document.getElementsByTagName("input");
	 for (oi=0;oi<objs.length;oi++) {
	  thisObj = objs[oi];
	  if(thisObj.getAttribute('type') == 'radio'){
	   thisObj.className = 'radio ' + thisObj.className;
	  }
	  if(thisObj.getAttribute('type') == 'checkbox'){
	   thisObj.className = 'checkbox ' + thisObj.className;
	  }
	  if(thisObj.getAttribute('type') == 'image'){
	   thisObj.className = 'image ' + thisObj.className;
	  }
	 }
	}
	addEvent(window, "load", prepareInputs);

	// copy contact information to billing information
	function SameAsContact() {
		document.billing.bfirst.value = document.billing.first.value;
		document.billing.blast.value = document.billing.last.value;
		document.billing.bemail.value = document.billing.email.value;
		document.billing.borg.value = document.billing.org.value;
		document.billing.bphone1.value = document.billing.phone1.value;
		document.billing.bphone2.value = document.billing.phone2.value;
		document.billing.bfax.value = document.billing.fax.value;
		document.billing.baddress.value = document.billing.address.value;
		document.billing.baddress2.value = document.billing.address2.value;
		document.billing.bcity.value = document.billing.city.value;
		document.billing.bstate.value = document.billing.state.value;
		document.billing.bzip.value = document.billing.zip.value;
		document.billing.bcountry.value = document.billing.country.value;
	}

	function stripCharacter(words,character) {
	//documentation for this script at http://www.shawnolson.net/a/499/
	  var spaces = words.length;
	  for(var x = 1; x<spaces; ++x){
	   words = words.replace(character, "");   
	 }
	 return words;
    }
	
	function changecss(theClass,element,value) {
	//documentation for this script at http://www.shawnolson.net/a/503/
	 var cssRules;
	 if (document.all) {
	  cssRules = 'rules';
	 }
	 else if (document.getElementById) {
	  cssRules = 'cssRules';
	 }
	 for (var S = 0; S < document.styleSheets.length; S++){
	  for (var R = 0; R < document.styleSheets[S][cssRules].length; R++) {
	   if (document.styleSheets[S][cssRules][R].selectorText == theClass) {
	    document.styleSheets[S][cssRules][R].style[element] = value;
	   }
	  }
	 }	
	}
	
	function checkUncheckAll(theElement) {
     var theForm = theElement.form, z = 0;
	 for(z=0; z<theForm.length;z++){
      if(theForm[z].type == 'checkbox' && theForm[z].name != 'checkall'){
	  theForm[z].checked = theElement.checked;
	  }
     }
    }
	
function checkUncheckSome(controller,theElements) {
	//Programmed by Shawn Olson
	//Copyright (c) 2006
	//Permission to use this function provided that it always includes this credit text
	//  http://www.shawnolson.net
	//Find more JavaScripts at http://www.shawnolson.net/topics/Javascript/
	
	//theElements is an array of objects designated as a comma separated list of their IDs
	//If an element in theElements is not a checkbox, then it is assumed
	//that the function is recursive for that object and will check/uncheck
	//all checkboxes contained in that element
	
     var formElements = theElements.split(',');
	 var theController = document.getElementById(controller);
	 for(var z=0; z<formElements.length;z++){
	  theItem = document.getElementById(formElements[z]);
	  if(theItem){
	  if(theItem.type){
        if(theItem.type == 'checkbox' && theItem.id != theController.id){
	     theItem.checked = theController.checked;
	    }
	  } else {

	    var nextArray = '';
	     for(var x=0;x <theItem.childNodes.length;x++){
	      if(theItem.childNodes[x]){
	        if (theItem.childNodes[x].id){
	          nextArray += theItem.childNodes[x].id+',';
		    }
	      }
	     }
	     checkUncheckSome(controller,nextArray);
	   
	   }
	  
	  }
     }
    }
	
	function changeImgSize(objectId,newWidth,newHeight) {
	  imgString = 'theImg = document.getElementById("'+objectId+'")';
	  eval(imgString);
	  oldWidth = theImg.width;
	  oldHeight = theImg.height;
	  if(newWidth>0){
	   theImg.width = newWidth;
	  } 
	  if(newHeight>0){
	   theImg.height = newHeight;
	  } 
	
	}
	
	function changeColor(theObj,newColor){
	  eval('var theObject = document.getElementById("'+theObj+'")');
	  if(theObject.style.backgroundColor==null){theBG='white';}else{theBG=theObject.style.backgroundColor;}
	  if(theObject.style.color==null){theColor='black';}else{theColor=theObject.style.color;}
	  //alert(theObject.style.color+' '+theObject.style.backgroundColor);
      switch(theColor){
	    case newColor:
		  switch(theBG){
			case 'white':
		      theObject.style.color = 'black';
		    break;
			case 'black':
			  theObject.style.color = 'white';
			  break;
			default:
			  theObject.style.color = 'black';
			  break;
		  }
		  break;
	    default:
		  theObject.style.color = newColor;
		  break;
	  }
	}

// -->