var domain ='';
var domainRef ='';
function init(d, dr) {
	domain = d;
	domainRef = dr;
	$(document).ready(function(){
		// fix breadcrumbs
		$("#breadcrumbs li:last").removeAttr('class');
		$("#breadcrumbs li").each(function(){
			if ($(this).attr('class')) {
				$(this).find(".breadcrumb-title").wrapInner('<a href="'+$(this).attr('class')+'"></a>');
			}
		});
		
		$("ul.sf-menu").supersubs({ 
            minWidth:    12,   // minimum width of sub-menus in em units 
            maxWidth:    40,   // maximum width of sub-menus in em units 
            extraWidth:  1     // extra width can ensure lines don't sometimes turn over 
                               // due to slight rounding differences and font-family 
        });
		$("ul.sf-menu").superfish();
		
		// fix forms
		$(".siteForm").attr("rel", d+$(".siteForm").attr("name"));
		
		stripeTable();
	});
}
jQuery.preloadImages = function() {
  for(var i = 0; i<arguments.length; i++) {
    jQuery("<img>").attr("src", domainRef+arguments[i]);
  }
}
function stripeTable() {
	// works backwards because the index of the first row is 0. :) nice
	$("table.stripe tr:even").addClass("odd");
	$("table.stripe tr:odd").addClass("even");
}