// Global Javascript
// Developed for DiegoPaulo.com
// Copyright 2010 Mike Zufelt

var _tbdef = {user: 'diegopauloband'};
(function(){
var d = document;var tbjs = d.createElement('script'); tbjs.type = 'text/javascript';
tbjs.async = true; tbjs.src = 'http://tweetboard.com/tb.js'; var tbel = d.getElementsByTagName('head')[0];
if(!tbel) tbel = d.getElementsByTagName('head')[0]; tbel.appendChild(tbjs);
})();

$(document).ready(function(){
	//Global functions
	$("#menu").corner("round 20px").parent().corner("round 20px");
	$("#menu li").corner("round 20px");
	$("#footer").corner("round 20px");
	$("#menu li").animate({
		opacity: .6,
		backgroundColor: '#3971a4'
	},450);
	$("#menu li").hover(function(){
		$(this).animate({
			color: '#ffc600',
			opacity: 1.0,
			backgroundColor: '#3f94d4'
		},450);
	},function(){
		$(this).animate({
			color: '#000000',
			opacity: .6,
			backgroundColor: '#3971a4'
		},450);
	});
	$("#openDiag").button({
		icons: { primary: "ui-icon-cart" }
	}).click(function(){
		$("#buyDialog").dialog('open');
	}).next().button({
		icons: { primary: "ui-icon-circle-close" },
		text: false
	}).click(function(){
		$("#buy1").fadeOut(300);
		$("#buy2").fadeIn(300);
	}).parent().buttonset();
	$("#reveal").button({
		icons: { primary: "ui-icon-cart" },
		text: false
	}).click(function(){
		$("#buy2").fadeOut(300);
		$("#buy1").fadeIn(300);
	});
	$("#buyDialog").dialog({
		autoOpen: false,
		modal: true,
		width: 315,
		height: 330
	});
	$("#digstation").button().next().button().parent().buttonset();
	
	//Main Page Functions
	$("#fadeContain").css("opacity","0");
	$(".mainPage").one("mousemove",function(){
		$("#fadeContain").animate({
				opacity: 1.0
			},1500,fadeBuy);
		function fadeBuy(){
			$("#buy1").animate({
				opacity: 1.0
			},1000);
		}
	});
	$("#showBox").accordion({autoHeight:false, event:'mouseover'});
	$("#newsBox").accordion({autoHeight:false, event:'mouseover'});

	//Press Functions
	$(".press").hover(function(){
		$(this).animate({
			color: '#ffc600'
		},450);
	},function(){
		$(this).animate({
			color: '#FFFFFF'
		},450);
	});
	$(".quote").corner("round 10px");
	$("a.press").fancybox({
		'width'				: '75%',
		'height'			: '75%',
		'autoScale'     	: false,
		'transitionIn'		: 'fade',
		'transitionOut'		: 'fade',
		'type'				: 'iframe',
	});
	
	//Media Functions
	
	
	//Bios Functions
	$("#bioFrame").corner("round 20px");
	$(".bioPic").click(function(){
		
	});
	
	//Connect Functions
	$("#facebookB").button();
	$("#facebookL").button({
		text: false,
		icons: {primary: "ui-icon-circle-arrow-s" }
	}).parent().buttonset();
	$("#myspaceB").button();
	$("#twitterB").button();
	$("#twitterL").button({
		text: false,
		icons: { primary: "ui-icon-circle-arrow-s" }
	}).parent().buttonset();
	$("#youtubeB").button();
	$("#lastfmB").button();
	$("#headlinerfmB").button();
	$("#sonicbidsB").button();
	$("#rradioB").button();
	
	//Event Functions
	$(".eventInfo").corner();
	
	//Contact Functions
	$(".contact").hover(function(){
		$(this).animate({
			color: '#ffc600'
		},450);
	},function(){
		$(this).animate({
			color: '#FFFFFF'
		},450);
	});
});
