	// JavaScript Document
	$(document).ready(function(){	
														 
		// discography slide controler					   
		$("#myController").jFlow({
			slides: '#mySlides',
			controller: '.jFlowControl',
			slideWrapper : '#jFlowSlide',
			easing: 'swing',
			duration: 400,
			height: '300px',
			width: '300px',
			prev: '.Prev',
			next: '.Next'
		});	
		// activate social hover pulse
		$('div.socialthumb img').hoverpulse({
			size: 30,  // number of pixels to pulse element (in each direction)
			speed: 400 // speed of the animation 
	   	});
		
		// modal box
		$("a.modal").fancybox({
			'titleShow': false
		});
		
		 // video iframe
		$(".video").fancybox({
			'padding'			:    8,
			'autoScale'   : true,
			'scrolling' : 'no',
			'hideOnContentClick': false,
			'hideOnOverlayClick': false
		});
		
		// datepicker
		$("#release_date").datepicker({ dateFormat: 'yy-mm-dd' });
		// datepicker for todo list
		$("#due_date").datepicker({ dateFormat: 'yy-mm-dd' });

		$(".contact").fancybox({
			'type'			: 'iframe',														
			'height'		:	450,
			'width'		:	600,
			'padding'			:    0,
			'hideOnContentClick': false,
			'hideOnOverlayClick': false,
			'scrolling' : 'no'
		});	
		// playlist modal trigger	
		$('#playlistbutton').click(function (){
            $("#playlistmodal").dialog("open");
            return false;
       	});
		// new playlist modal
		$('#playlistmodal').dialog({
			   autoOpen: false,
			   modal: true,
			   width: 800,
			   title: 'Recently Played Tracks',
			   bgiframe: false
		});
		// click to edit tracks
		$("#mytracks li").click(function(){
           location.href = $(this).attr("rel"); 
           return false;
		});
		// begin gear div color changes
		$(".tracklisting:odd").css("background-color", "#000000");
		$(".tracklisting:even").css("background-color", "#3d3d3d");
		$(".playlist:odd").css("background-color", "#141414");
		$(".playlist:even").css("background-color", "#3d3d3d");
		$(".manageusertable tr:odd").css("background-color", "#000000");
		$(".manageusertable tr:even").css("background-color", "#3d3d3d");
		
	}); // ***** end functions ***** //
	
	// animated anchor scroll
	$(document).ready(function() {
			$("a.anchorLink").anchorAnimate()
		});
		jQuery.fn.anchorAnimate = function(settings) {
			settings = jQuery.extend({
			speed : 1100
			}, settings);	
		
		return this.each(function(){
			var caller = this
			$(caller).click(function (event) {	
				event.preventDefault()
				var locationHref = window.location.href
				var elementClick = $(caller).attr("href")
				
				var destination = $(elementClick).offset().top;
				$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, settings.speed, function() {
					window.location.hash = elementClick
				});
				return false;
				})
			});
	} ///////// end animated anchors /////////
