$(document).ready(function(){	
	$('form#newsletter input.i-bg').blur(function(){
		if($(this).val() == ''){
			$(this).val('enter your email here');
		}
	});
	$('form#newsletter input.i-bg').focus(function(){
		if($(this).val() == 'enter your email here'){
			$(this).val('');
		}
	});
	$('form#search input.search').blur(function(){
		if($(this).val() == ''){
			$(this).val('type here');
		}
	});
	$('form#search input.search').focus(function(){
		if($(this).val() == 'type here'){
			$(this).val('');
		}
	});
	/* $('a[href*=#]').click(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
			&& location.hostname == this.hostname) {
			var $target = $(this.hash);
			$target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
				if ($target.length) {
					$target.ScrollTo(400);
					return false;
				}
			};
	}); */
	$('a[rel*="external"]').each(function(val, el){
		$(el).attr('target', '_blank');
	});
	$('.disease dl').css({visibility: 'hidden'});
	$('.disease dl.active').css({visibility: 'visible'});
	$('.disease .next').click(function(e){
		e.preventDefault();
		var $active = $('.disease dl.active');
		if ( $active.length == 0 ) $active = $('.disease dl:last');
		var $next =  $active.next().length ? $active.next() : $('.disease dl:first');
		$active.removeClass('active').css({visibility: 'hidden'});
		$next.css({visibility: 'visible'}).addClass('active');
	});
});
function slideSwitch() {
    var $active = $('.slideshow img.active');
    if ( $active.length == 0 ) $active = $('.slideshow img:last');
    var $next =  $active.next().length ? $active.next() : $('.slideshow img:first');
    $active.addClass('last-active');
    $next.css({opacity: 0.0}).addClass('active').animate({opacity: 1.0}, 1000, function() {$active.removeClass('active last-active');});
}
$(function() {
    setInterval( "slideSwitch()", 5000 );
});
