$(document).ready(function() {
	if ($('#hero_headline').length > 0) {
		if ($.browser.msie) {
			$('#hero_headline').addClass('ieshadow');
		}
		else if ($.browser.webkit) {
			$('#hero_headline').addClass('wkshadow');
		}
		else if ($.browser.mozilla) {
			cont = $('#hero_headline').html();
			$('#hero').append('<div class="mozshadow">'+cont+'</div>');
		}
	}
	
	if ($('#hero.inner').length > 0) {
		$('#hero.inner').append('<div id="subnav_cap"></div>');
		$('#subnav_cap').css({
			'background': 'url(images/bg/subnav_top.png) no-repeat top left',
			'position': 'absolute',
			'left': '0px',
			'bottom': '0px',
			'width': '190px',
			'height': '24px'
		});
	}
	
	if ($('#hero_slider_frame').length > 0) {
		$('#hero_slider_frame').CloudCarousel( { 
			reflHeight: 40,
			reflGap:5,
			buttonLeft: $('#hero_slider_prev'),
			buttonRight: $('#hero_slider_next'),
			xRadius: 548,
			yRadius:-30,
			xPos: 448,
			yPos: 29,
			speed:0.3,
			mouseWheel:false
		});
	}
	
	if ($('.demo_launcher').length > 0) {
		$('.demo_launcher').fancybox({
			'padding': 5,
			'width': 640,
			'height': 390,
			'type': 'iframe',
			'centerOnScroll': true,
			'easingIn': 'easeInQuint',
			'easingOut': 'easeOutQuint',
			'showClosebutton': true
		});
	}
	
	$('.nospam').click(function() {
		href = $(this).attr('href').replace('[at]','@').replace('[dot]','.');
		document.location.href = href;
		return false;
	});
	
	$('hr').replaceWith('<div class="hr"></div>');
	
	$('.blank').click(function(){
		uri = $(this).attr('href');
		window.open(uri);
		return false;
	});
	
	$('#hero_slider_prev').hover(
		function() {
			$(this).css('background','url(images/interface/sprites.png) no-repeat -620px -5px');
		},
		function () {
			$(this).css('background','url(images/interface/sprites.png) no-repeat -545px -5px');
		}
	);
	
	$('#hero_slider_next').hover(
		function() {
			$(this).css('background','url(images/interface/sprites.png) no-repeat -660px -5px');
		},
		function () {
			$(this).css('background','url(images/interface/sprites.png) no-repeat -586px -5px');
		}
	);
	
	Cufon.replace('h2, h4', { fontFamily: 'franklin', hover: true });

});
