jQuery(function() {
	
	//OPEN/CLOSE BOXES
	jQuery('div.greybox h2.closed').each(function(){
		content = jQuery(this).parent().find('div:first');
		content.slideUp(0);
	
	});
	jQuery('div.greybox h2').click(function(){
		content = jQuery(this).parent().find('div:first');
		if(jQuery(this).hasClass('closed')){
			content.slideDown(500);
			jQuery(this).removeClass('closed');
		} else {
			content.slideUp(500);
			jQuery(this).addClass('closed');
		}
	});
	
	//JQTIP
	jQuery('.showtip').each(function(){
		var title = jQuery(this).find('span:first').text();
		title = (title == '') ? jQuery(this).text() : title;
		jQuery(this).qtip({ 
			content:title,
			position: {
				corner: {
					target: 'topLeft',
					tooltip: 'topRight'
				}
			},
			background: '#EFEFF0',
			border: {
				width: 7,
				radius: 5,
				color: '#A2D959'
			},
			width: {
				min: 0,
				max: 350
			},
		});
	});
});