/* ==========================================================================
Site: 			Local Content V4
File: 			global.js
Description:	Local Content V4 is a Sub.tv upload utility for Student Unions 
Version: 		1.0
Author: 		Faren Gambrill
Created: 		21/09/09
Last Updated:	21/09/09
==========================================================================*/

/* Smooth Scroll */
$(function(){
	$.localScroll();
});


// Tooltips 
$(function() {
	$('#main-content a').tooltip({ 
		track: true, 
		delay: 0, 
		showURL: false, 
		showBody: " - ", 
		fade: 250 	
	});
});

$(function() {
	$('#main-content div').tooltip({ 
		track: true, 
		delay: 0, 
		showURL: false, 
		showBody: " - ", 
		fade: 250 	
	});
});

$(function() {
	$('#commsCheck div').tooltip({ 
		track: true, 
		delay: 0, 
		showURL: false, 
		showBody: " - ", 
		fade: 250 	
	});
});


/* Date Picker */
$(function() {
	$("#date1").datepicker({
		dateFormat: 'yy/mm/dd'
	});
});

$(function() {
	$("#date2").datepicker({
		dateFormat: 'yy/mm/dd'
	});
});


/* Light Box Image Pop Up */
$(document).ready(function() { /* This is basic - uses default settings */ 
		$("a#single_image").fancybox(); /* Using custom settings */ 
		$("a#inline").fancybox({ 'hideOnContentClick': false }); 
		$("a.group").fancybox({ 'zoomSpeedIn': 300, 'zoomSpeedOut': 300, 'overlayShow': true 
	}); 
}); 



/*
function showNotifyLoader(show)
	{
		if (show)
		{
			$('#ajax-notify-loader').fadeIn("fast");
		}
		else
		{
			$('#ajax-notify-loader').fadeOut("slow");
		}
	}
*/

/* Delay Divs from appearing before Fades kick in */
$.fn.pause = function(duration) {
    $(this).animate({ fadeDiv: 1 }, duration);
    return this;
};


/* Fade In Home Buttons */
$(function(){
	$('#home-upload').hide();
	$("#home-upload").pause(400).fadeIn();
	$('#home-scheduler').hide();
	$('#home-scheduler').pause(440).fadeIn();
	$('#home-viewfiles').hide();
	$('#home-viewfiles').pause(470).fadeIn();
	$('#home-help').hide();
	$("#home-help").pause(500).fadeIn();
});


/* Fade In Sign In Holder Div on Index page */
$(function(){
	$('#signIn-holder').hide();
	$("#signIn-holder").pause(400).fadeIn();
});

/* Fade In Upload Holder Div on Upload page */
$(function(){
	$('#upload-holder').hide();
	$("#upload-holder").pause(200).fadeIn();
	$('#arrowNext').hide();
	$('#arrowPre').hide();
	$("#arrowNext").pause(200).fadeIn();
});

/* Fade In Scheduler Holder Div on Scheduler page */
$(function(){
	$('#scheduler-holder').hide();
	$("#scheduler-holder").pause(200).fadeIn();
	$('#arrowNext').hide();
	$('#arrowPre').hide();
	$("#arrowPre").pause(200).fadeIn();
});

/* Fade In View Holder Div on View Files page */
$(function(){
	$('#view-holder').hide();
	$("#view-holder").pause(200).fadeIn();
});

/* Fade In Help Holder Div on Help page */
$(function(){
	$('#help-holder').hide();
	$("#help-holder").pause(200).fadeIn();
});

/* Fade In Account Holder Div on My Account page */
$(function(){
	$('#account-holder').hide();
	$("#account-holder").pause(200).fadeIn();
});

/* Fade In Updates Holder Div on Campus Information Updates page */
$(function(){
	$('#updates-holder').hide();
	$("#updates-holder").pause(200).fadeIn();
});



/* On Click go to Step 2  */
$(function() {
	$('#arrowNext').click(function() {
		window.location = $(this).attr("url");
	});
});

 
/* On Click go to Step 1  */
$(function() {
	$('#arrowPre').click(function() {
		window.location = $(this).attr("url");
	});
});


/* View Files - On Click delete button fade */
$(function() {
	$(".btnDelete").click(function() {
		if(!confirm("Are you sure you want to delete this file?"))
		return false;						   
		$(this).parent().fadeOut("slow");   
	});
});

$(function() {
	$("#clear_list").click(function() {
		if(!confirm("NOTE: Clearing the Scheduler list cannot be undone. Are you sure you wish to do this?"))
		return false;						    
	});
});


