/* ANIMATED ARROWS ON HOME PAGE, EVENTS PAGE AND TWITTER THING IN FOOTER */

$(document).ready(function(){
    
    // Using multiple unit types within one animation.
    $(".eventimage").hover(function(){
      $(".eventarrow").animate({ width: "70px", marginLeft: "-13px" }, 400 );
	}, function() {
      $(".eventarrow").animate({ width: "57px", marginLeft: "0px" }, 900 );		
    });

    $(".postimage").hover(function(){
      $(".postarrow").animate({ width: "70px", marginLeft: "-13px" }, 400 );
	}, function() {
      $(".postarrow").animate({ width: "57px", marginLeft: "0px" }, 900 );	  
    });

    $(".contactimage").hover(function(){
      $(".contactarrow").animate({ width: "70px", marginRight: "13px" }, 400 );
	}, function() {
      $(".contactarrow").animate({ width: "57px", marginRight: "0px" }, 900 );	  
    });

	// Animated buy tickets arrow - need to get working correctly!!!
    /*$(".imgcontainer, .buytickets").hover(function(){
      $(".buytickets").animate({ marginTop: "0", height: "73px" }, 400 );
	}, function() {
      $(".buytickets").animate({ marginTop: "0px", height: "58px" }, 900 );	  
    });*/

    $(".followus").hover(function(){
      $(".followus").animate({ marginTop: "4px" }, 850 );
	}, function() {
      $(".followus").animate({ marginTop: "0px" }, 900 );	  
    });


/*DISPLAYS TWITTER */

	$(function(){
		$('.tweet').tweetable({username: 'wefearsilence', time: true, limit: 1});
	});


/* QTIP TOOL TIPS */

	$(".eventcontainer").qtip({
		effect: 'fade',
		delay: 250,
		content: 'The Next Party',
		style:		{ 
			border: { width: 1, radius: 1, color: '#07506b' }, 
			background: 'rgba(0, 143, 198, 0.4)', 
			color: '#FFFFFF', 
			width: { min: 100 }, 
			'font-family' : 'helvetica, arial, sans-serif',
			'font-size' : 16,
			'font-weight' : 900,
			'letter-spacing' : -1
			},
		position: 	{ 
			corner: { target: 'bottomMiddle', tooltip: 'bottomMiddle' },  
			adjust: { x: 0, y: 10 }
			}
	});
	
	$(".postcontainer").qtip({
		effect: 'fade',
		delay: 250,
		content: 'Latest Blog Post',
		style:		{ 
			border: { width: 1, radius: 1, color: '#680432' }, 
			background: 'rgba(207, 0, 122, 0.4)', 
			color: '#FFFFFF', 
			width: 	{ min: 100 }, 
			'font-family' : 'helvetica, arial, sans-serif',
			'font-size' : 16,
			'font-weight' : 900,			
			'letter-spacing' : -1
			},
		position: 	{ 
			corner: { target: 'bottomMiddle', tooltip: 'bottomMiddle' }, 
			adjust: { x: 0, y: 10 }		
			}
	});
	
	$(".contactcontainer").qtip({
		effect: 'fade',
		delay: 250,
		content: 'Get In Touch',
		style:		{ 
			border: { width: 1, radius: 1, color: '#716d09' }, 
			background: 'rgba(224, 213, 0, 0.4)', 
			color: '#FFFFFF', 
			width: { min: 100 }, 
			'font-family' : 'helvetica, arial, sans-serif',
			'font-size' : 16,
			'font-weight' : 900,			
			'letter-spacing' : -1
			},
		position: 	{ 
			corner: { target: 'bottomMiddle', tooltip: 'bottomMiddle' }, 
			adjust: { x: 0, y: 10 }		
			}
	});


});


/* http://www.dreamincode.net/code/snippet4235.htm - AUTO RESIZE FONT SIZE - WILL NEED FOR FRONT PAGE HEADLINE!!!!!!!!!!!!!!
$(document).ready(function(){
						   
$.fn.fontfit = function(max) {
	var max_size = 18;
	if (typeof(max) == "undefined")
		max = max_size;
	$(this).wrapInner('<div id="fontfit"></div>');
	var dheight = $(this).height();
	var cheight = $("#fontfit").height();
	var fsize = (($(this).css("font-size")).slice(0,-2))*1;
	while(cheight<dheight && fsize<max) {
		fsize+=1;
		$(this).css("font-size",fsize+"px");
		cheight = $("#fontfit").height();
	}
	while(cheight>dheight || fsize>max) {
		fsize-=1;
		$(this).css("font-size",fsize+"px");
		cheight = $("#fontfit").height();
	}
	$("#fontfit").replaceWith($("#fontfit").html());
	return this;
}

});
*/