(function () {

// Cufon.replace( 'h1:not(.media-title), .cufon-text, .media-title a', {
// 	textShadow: '1px 1px #000',
// 	hover: {
// 	
// 	}
// });
// Cufon.now();

eval( JELLY.unpack() );


var testCssRule = function ( prop, value ) {
	var test = createElement( 'div' );
	test.style[ prop ] = value;
	if ( test.style[ prop ] !== value ) {
		return false;
	}
	return true;
};

if ( !testCssRule( 'display', 'run-in' ) ) {
	Q( '.run-in' ).each( function ( el ) {
		addClass( el, 'run-in-nosupport' );
	});
}

Q('a[href*="#"]:not([href^="http://"])').each(function (el) {
	if (location.href.indexOf(el.href.split('#')[0]) === -1) {
		addEvent(el, 'click', function () {this.href += '--';});
	}
});

var smoothScrollFragments = function () {
	var hash = location.hash;
	if (hash && /--$/.test(hash)) {
		var elem = document.getElementById(hash.replace(/^#|--$/g, '')); 
		if (elem) { 
			var offsetY = getY(elem);
			var resetHash = function () {
				var replacement = location.href.replace(/--$/, '');
				location.replace(replacement);
			};
			setTimeout(function () {new Scroll(window).start(0, offsetY).chain(resetHash)}, 250);
		}
	}
};
addEvent(window, 'load', smoothScrollFragments);

if (browser.ie) { 
	Q('ul.list-comments p:last-child').each(function (el) { addClass(el, 'last-child') });
	Q('div.flow-area li:last-child').each(function (el) { addClass(el, 'last') });
}

addEvent(window, 'load', function () {
	Q('div.youtube-video, div.flickr-slideshow').each(function (el) {
		var inner = createElement('.fl.'+ el.className +'-inner');
		wrapElement( getFirst(el), inner);
		addClass(el, 'ca show-object');
	});
});

var ie6 = browser.ie6, ie7 = browser.ie7;
if ( ie6 || ie7 ) {
	var nag = createBranch( '#upgrade-nagbox', 'div @:inner' );
	nag.inner.innerHTML = "Hello! It looks like you are using Internet Explorer " + (ie6 ? '6' : '7');
	nag.inner.innerHTML += ". As this site uses the latest shinest browser technology, it will look a \
		little 'off' in this browser. Try getting the latest version of <a href=\"http://www.microsoft.com/windows/internet-explorer/default.aspx\"> \
		Internet Explorer</a>. Or better still, <a href=\"http://www.mozilla.org/\">Firefox</a>. Nag done.";
	insertTop( nag.root, document.body );
}

})();
