$(document).ready(function(){
	// z-index layering fix for IE7
	var zIndexNumber = 10000;
	$('div').each(function() {
		$(this).css('zIndex', zIndexNumber);
		zIndexNumber -= 10;
	});
	
	$('.blink').focus(function () {
			if ($(this).val() == $(this).attr('title')) {
				$(this).val('');
			}
		})
	$('.blink').blur(function () {
			if ($(this).val() == '') {
				$(this).val($(this).attr('title'));
			}
		})
	
	$('#navigation li').hover(
		function(){ $(this).find('.dd').show(); $(this).find('a:eq(0)').addClass('dd-active'); },
		function(){ $(this).find('.dd').hide(); $(this).find('a:eq(0)').removeClass('dd-active'); }
	);
	
	$('.drop-down .head a').click(function(){
		var expander = $(this).parent().parent().find('.expander');
		if(expander.hasClass('hidden')){
			expander.removeClass('hidden');
			$(this).addClass('active');
		}
		else{
			expander.addClass('hidden');
			$(this).removeClass('active');
		}
		return false;
	})
	
	// Drop Downs added to allow entire bar to be clickable
	$('.drop-down .head').click(function(){
		var expander = $(this).parent().find('.expander');
		if(expander.hasClass('hidden')){
			expander.removeClass('hidden');
			
			var anchor_link = $(this).find('a');
			anchor_link.addClass('active');
		}
		else{
			expander.addClass('hidden');
			
			var anchor_link = $(this).find('a');
			anchor_link.removeClass('active');
		}
		return false;
	})

});
function mycarousel_initCallback(carousel) {
	 $('#slide-controls a.pages').bind('click', function() {
        carousel.scroll(jQuery.jcarousel.intval($(this).text()));
        return false;
    });

	$('.mycarousel-next').bind('click', function() {
		carousel.next();
		return false;
	});
	$('.mycarousel-prev').bind('click', function() {
		carousel.prev();
		return false;
	});
};
