// init initializes all the jquery scripts individually

/* tabs */
$(document).ready(function() {
    $("#tabs").tabs();
    });

/* pop out calendar */
$(document).ready(function() {
	$('a#popCal').click(function() {
		if (document.getElementById('cal_popup').style.display == 'block')
			{
				$('#cal_popup').fadeOut('fast');
			}
		else
			{
				$('#cal_popup').fadeIn('fast');
				document.getElementById('username').focus();
			}
		return false;
	});
});

$(document).ready(function() {
	$(".datepicker").datepicker({ maxDate: '+12m' });
});

    
/* carousels */
$(document).ready(function() {
    jQuery('#mycarousel').jcarousel();
    jQuery('#datecarousel').jcarousel();
});

/* cycle - home page slideshow */
jQuery(document).ready(function() {
    	$('#top_stories_billboard').cycle({
			fx: 'fade',
				speed: 600,    // was 150
				timeout: 4000,
				pause: 1,
				pager: '#top_stories_nav'
		});
});

/* cycle - upper right internal Vue ads */
jQuery(document).ready(function() {	
    $('.zone_upper_right').cycle({   // init cycle boxes
		fx: 'fade',
				pause: 1,
                speed: 150,
                timeout: 2000
	});
});

/* magic preview for comments */ /* superseded by disqus */
/* $(document).ready(function() {	
    $('form#comment_form textarea').magicpreview('p_'); // append magic preview class
	$('form#comment_form :text').magicpreview('p_');
}); */

/* watermark input boxes */
$(function($){
   $("#simplesearchinput").Watermark("Search VUE");
   $("#search_visarts").Watermark("Search Visual Arts:");
}); 

/* scroll panes */
$(function() {
	$('.feed_box').jScrollPane();
	$('.scroll_pane').jScrollPane();
	$('#fringe_updates_scrollbox').jScrollPane();
	$('#fringe_heldover_scrollbox').jScrollPane();
});

jQuery(function( $ ){
	/**
	 * Most jQuery.localScroll's settings, actually belong to jQuery.ScrollTo, check it's demo for an example of each option.
	 * @see http://flesler.demos.com/jquery/scrollTo/
	 * You can use EVERY single setting of jQuery.ScrollTo, in the settings hash you send to jQuery.LocalScroll.
	 */
	
	// The default axis is 'y', but in this demo, I want to scroll both
	// You can modify any default like this
	// $.localScroll.defaults.axis = 'xy';
	
	// Scroll initially if there's a hash (#something) in the url 
	// $.localScroll.hash({t
	//	queue:true,
	//	duration:1500
	// });
	
	/**
	 * NOTE: I use $.localScroll instead of $('#navigation').localScroll() so I
	 * also affect the >> and << links. I want every link in the page to scroll.
	 */
	$.localScroll({
		queue:true,
		duration:500,
		hash:true
		// onBefore:function( e, anchor, $target ){
			// The 'this' is the settings object, can be modified
		// },
		// onAfter:function( anchor, settings ){
			// The 'this' contains the scrolled element (#content)
		// }
	});
});

/* modal windows */
jQuery(function ($) {
	$('#login-modal .login').click(function (e) {
		$('#login-modal-content').modal();
		  return false;
	});
});
jQuery(function ($) {
	$('.flag-modal .flag-not-yet').click(function (e) {
		$('#flag-modal-content').modal();
		  return false;
	});
});

/* jumpmenu */
$(document).ready(function() {
    $(".jumpmenu").change(function() {
        var val = $(this).selectedValues();
        if (val != '') {
            location.href=val;
        }
    });
});


