﻿// common.js
// Common site functions to control the look and operations
// that are common to all pages on the site.

function getDomain() {
 var domain = String(location.href.match(/http:\/\/[^\/]*/)), domainHash;
 domain = domain.substring(domain.lastIndexOf('/') + 1);
 if (domainHash = domain.search(/\..*\..*/) + 1)
 domain = domain.substring(domainHash);
 return domain;
}

SSS_faq = {
	init : function() {
		$('div.faq .answer').fadeToggle('slow');
		$('div.faq .question').click(function() { SSS_faq.toggle(this) });
	},
	
	toggle : function(elt) {
		$(elt).toggleClass('active');
		$(elt).siblings('.answer').fadeToggle('slow');
	}
}

jQuery.fn.fadeToggle = function(speed, easing, callback) { 
   return this.animate({opacity: 'toggle'}, speed, easing, callback); 
};
