jQuery(function($) { // Tell BC this is jquery

// Start Cufon
		Cufon.now(); // IE related
		Cufon.replace('#slide h2, #slide h3, h2, .h2',  { fontFamily: 'Bitstream Vera Sans' });
		Cufon.replace('#slide span, #ask-question',  { fontFamily: 'ChunkFive' });
// End Cufon

	 $(document).ready(function() { // start javascript when document is loaded 


// Start Jquery Cycle Plugin
		$('#banner-glow .container_12 #slide').cycle({ 
			fx: 'fade',
			timeout: 6000,
			speed: 1000,
			sync: 0,
			cleartypeNoBg: true,
			cleartype: true,
			pauseOnPagerHover: true,
			pause: true,
			slideExpr: null, 
			pager: '#slide-controls',
			pagerAnchorBuilder: function(idx, slide) { 
						return '<li><a href="#"><img src="/images/next-slide.gif" width="14px" height="14px"</img></a></li>'; 
					} 
		});
				
				

		$('#slideshow').cycle({
			fx:     'none',
			speed:  'fast',
			timeout: 0,
			pager:  '#slideshow-nav',
			cleartype: true,
			cleartypeNoBg: true,
			pagerAnchorBuilder: function(idx, slide) {
				// return sel string for existing anchor
				return '#slideshow-nav li:eq(' + (idx) + ') a';
			}
		});
// End Jquery Cycle Plugin

// Twitter style login
		$(".signin").click(function(e) {
			e.preventDefault();
			$("fieldset#signin_menu").toggle();
			$(".signin").toggleClass("menu-open");
		});
		
		$("fieldset#signin_menu").mouseup(function() {
			return false
		});
		$(document).mouseup(function(e) {
			if($(e.target).parent("a.signin").length==0) {
				$(".signin").removeClass("menu-open");
				$("fieldset#signin_menu").hide();
			}
		});			
// End Twitter style login


// Jquery Tools - Accordion
	
	$("#accordion").tabs("#accordion div.pane", {tabs: 'h2', effect: 'slide'});

// End Jquery Tools - Tabs
	
// Color Box Lightbox
			$(".matrix").colorbox({width:"996px", height:"800px", innerWidth:"100%", innerHeight:"100%", scrolling:false, iframe:true});
			$(".popup").colorbox();
// End Color Box Lightbox

 
// Qtip 
    // Use the each() method to gain access to each of the elements attributes
	   $('.blog').each(function() {
		  $(this).qtip( {
				
				content: '<div class="language"><a href="/_blog/english">English</a> | <a href="/_blog/espanol">Espa&ntilde;ol</a></div>', // Give it some content
				position: {  // Set its position
					corner: {
						target: 'bottomLeft',
						tooltip: 'topMiddle'
					}
				},

			 
			hide: {
				fixed: true, // Make it fixed so it can be hovered over
				delay: 500 // Delay on hide
			 },
			 
			show: {
				delay:0 // No delay on show
			 },
			 
			 style: {
				border: { 
					width: 2,
					radius: 5 
				},
			 
				padding: '5px 15px', // Give it some extra padding
				name: 'light', // And style it with the preset dark theme
				textAlign: 'center',
				tip: true // Give it a speech bubble tip with automatic corner detection
			 }
		  });
	   }); // End Qtip

// FlowPlayer

	$("#player").flowplayer("/flowplayer/flowplayer-3.1.5.swf", {
		clip:  { 
			autoPlay: false, 
			autoBuffering: true 
		} 
	});

// End FlowPayer


// Jquery Alert on submit

   $(".matrix-button").click(function(){

		return confirm("This is the profile you want? If yes click OK otherwise, click Cancel");
	});
//


	}); // End javascript when document is loaded 
}); // End BC this is jquery
