//  TOOLTIPS **********
$(function() {
	
	$('.tip_rollover').each(function() {
		$(this).qtip({
			content: getContent($(this).attr('alt')),
			position: {
				corner: {
					target: 'topMiddle',
					tooltip: 'bottomMiddle'
				},
				//target: 'mouse',
				adjust: {
					y: -1
				}
			},
			show: {
				when: 'mouseover',
				solo: false,
				delay: 0,
				effect: {
					length: 100
				}
			},
			hide: { 
				effect: {
					length: 200
				}
			},
			style: {
				tip: {
					corner: 'bottomMiddle',
					size : {
						x: 6,
						y: 6
					}
				},
				border: {
					width: 1,
					radius: 1
				},
				background: '#fffdee',
				padding: 5,
				width: 'auto',
				textAlign: 'left',
				name: 'light'
			}
		});
	});
});

//split title and subtitle for rollovers
function getContent(txt) {
	var parts = txt.split(',');
	return '<p class="name">'+parts[0]+'</p><p class="title">'+parts[1]+'</p>';
}

// Start jQuery

$(document).ready(function() {

// HOME SCRIPTS //

	// style-sheet switcher from http://www.SohTanaka.com
	$("a.switch_thumb").toggle(function(){
	  $(this).addClass("swap"); 
	  $("div.display").fadeOut("fast", function() {
	  	$(this).fadeIn("fast").addClass("thumb_view"); 
		 });
	  }, function () {
      $(this).removeClass("swap");
	  $("div.display").fadeOut("fast", function() {
	  	$(this).fadeIn("fast").removeClass("thumb_view");
		});
	}); 
	
	$(function() {
		$('.rollover').hover(function() {
			var currentImg = $(this).attr('src');
			$(this).attr('src', $(this).attr('hover'));
			$(this).attr('hover', currentImg);
		}, function() {
			var currentImg = $(this).attr('src');
			$(this).attr('src', $(this).attr('hover'));
			$(this).attr('hover', currentImg);
		});
	});
	

	
	
}); // End jQuery



