
$(function () {
	$();
	var current = location.href.replace();
	$();
	var crosslink = $();
	var offset = crosslink.offset();
	var crosslinks = $();
	crosslink.click(function() {
		crosslinks.css({left: ($.browser.msie || $.browser.opera ?
			offset.left : crosslink[0].offsetLeft) +
			crosslink.width() - crosslinks.width(),
			top: ($.browser.msie || $.browser.opera ? offset.top :
			crosslink[0].offsetTop) + crosslink.height()});
		crosslinks.slideToggle();
	});
	$(document).mousedown(function(event) {
		var target = $(event.target);
		if (!target.parents().andSelf().is('#crosslink,#crosslinks')) {
			crosslinks.slideUp();
		}
	});
	$();
	
	
	// Initialise tabs
	if ($.fn.tabs) {
		$('#tabs').tabs($.fn.tabs.tabProps);
	}
	// Execute example script tags
	$('code.selectbm').each(function () {
		$(this).removeClass('selectbm').addClass('js').hide().
			wrap().
			before().
			text();
		eval($(this).text().replace(/&lt;/g, '<').replace(/&gt;/g, '>'));
	});
	$('code.css').each(function () {
		$(this).hide().wrap('<div class="showCode"></div>').
			before('<a href="#" class="showCode">Show CSS</a><br>');
	});
	
	$('a.showCode').toggle(function() {
		$(this).text($(this).text().replace(/Show/, 'Hide')).
			parent().css('width', 'auto').find('code').show();
		return false;
	}, function() {
		$(this).text($(this).text().replace(/Hide/, 'Show')).
			parent().css('width', '80px').find('code').hide();
		return false;
	});
	
});


