jQuery(document).ready(function(){
		jQuery('a.tooltip').each(function()
		{			
			jQuery(this).qtip({
				content: {
					text:  jQuery(this).attr('rel'),
					title: { text: jQuery(this).attr('name'), close: ' ' }
				},
				position: {
					target: jQuery('#homefeature .scroller'),
					corner: {
						target: 'topLeft',
						tooltip: 'topLeft'
					},
					adjust: {
						x: 320,
						y: 93
					}
				},
				style: {
					width: 200,					
					'padding': '0 0 10px 10px',
					background: 'white',
					'font-size': '10px',
					'font-family': 'Lucida Sans, Verdana, Helvetica, sans-serif',
					color: 'black',
					textAlign: 'left',
				   border: {
					  width: 0,
					  radius: 6,
					  color: 'white'
					},
					title: {
						color: '#211d1c',
						'font-size': '14px',
						'font-family': 'Lucida Sans, Verdana, Helvetica, sans-serif',
						overflow: 'hidden',
						background:'transparent',
						'padding': '0 0 10px 10px'							
					},
					tip: 'topRight',
					name: 'light'
				},
				show: {
					solo: true,
					ready: false,
					delay: 200,
					when: 'mouseover'
				},
				hide: {
					fixed: true,
					delay: 200
				},
				api: {
				   beforeShow: function()
				   {
					//Refer to 'before callback' on cycle plug-in
				   }
				}

			});			
		});
	
		jQuery('#homefeature .scroller').cycle({
			fx: 'fade',
			speed: 1000,
			timeout: 6000,
			prev: '#homefeature #prev',
			next: '#homefeature #next',
			pager: '#homefeature .nav',
			before: function() {
				if(jQuery(this).hasClass('tooltip')){
				//IE has problems updating tooltip transitions from one to other, so update manually
					var api = jQuery(this).qtip("api");
					var ele = api.id;
					if(ele !== 0){
						var calc = parseInt(ele-1);
						var oldQtip = jQuery.fn.qtip.interfaces[calc];
						oldQtip.options.hide.when.target.trigger(oldQtip.options.hide.when.event);
					}
					var newQtip = jQuery.fn.qtip.interfaces[ele];
					jQuery('this').mouseover(function(){
						newQtip.options.show.when.target.trigger(newQtip.options.show.when.event);
					});
				}
			}
		});

		/* Some Styling */
		var imgTotal = jQuery('#homefeature .scroller img').size();
		
		var marginLeft = 584 - ( (imgTotal * (8+5)) - 10);
		//jQuery('#homefeature .nav').css({'margin-left' : marginLeft});

		jQuery('img.tooltip').each(function()
		{			
			jQuery(this).attr("alt", "");
		});

		jQuery('#homefeature .caption').css( { 'display' : 'none' });

	});

	jQuery(document).ready(function(){

	 	jQuery("#accordmenu").accordion({
			event: "mouseover",
			navigation: false,
			active: false
		});	
		
		jQuery("#accordmenu img").mouseover(function(){
			var image = '/Skins/Moments/images/buttons/btn_acc'+jQuery(this).attr('name')+'_on.png';
			jQuery(this).attr('src', image);
    	}).mouseout(function(){
			var image = '/Skins/Moments/images/buttons/btn_acc'+jQuery(this).attr('name')+'_off.png';
			jQuery(this).attr('src', image);
		});

		jQuery(".ui-accordion-content a").show();
	});