// JavaScript Document

$(function(){
		   
		   
		    /* Banner */
		    $("#banner").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 5000, true);
			/*$("#banner").tabs({fx:{opacity: "toggle"}}).tabs({enable: function(){
														a=$(this).attr("id");
														$("#+a").animate();
														}}).tabs("rotate", 5000, true);*/
			
			
			/*	Stop rotation when hovered.
			
			$("#banner").hover(function(){
					$(this).tabs("rotate",0,false);
			}, function(){
					$("#banner").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 5000, true);
			});*/
		
			
		   /* Read more buttons */
		    $(".read").mouseover(function(){
				$(this).stop().animate({opacity: 1,
								 color: "#003366",
								}, 600);	
			}).mouseout(function(){
				$(this).stop().animate({opacity: 0.8,
								 color: "#ffffff",
								}, 400);		
			});
						
			
			/*Navigation
			
			$(".menu-item").mouseover(function(){
				$(this).stop().animate({backgroundPosition: "(0 12px)"},500);
			}).mouseout(function(){
				$(this).stop().animate({backgroundPosition: "(0 0)"},500);
			});
			*/
		
//			$(".menu-item").mouseover(function(){
//				$(this).stop().switchClass("menu-item", "menu-item-active", 400);
//				$(this).find("ul.subitems").stop(true, true).hide().slideDown("fast").show();
//			}).mouseout(function(){
//				$(this).stop().switchClass("menu-item-active", "menu-item", 200);
//				$(this).find("ul.subitems").stop(true, true).slideUp("slow");
//			});
			
			
			
			/*chat box*/
			
			
			$("#skype-chat").click(function(){
				$("#skype").dialog(
										{
										width: 200,
										height: 250,
										modal: true,
										resizable: false,
										draggable: false
										});
				return false;
			});
			
			$("#yahoo-messenger-chat").click(function(){
				$("#yahoo").dialog(
										{
										width: 200,
										height: 230,
										modal: true,
										resizable: false,
										draggable: false
										});
				return false;
			});
			
			
			/*List*/
				var index = 0;
    			setInterval(listF,6300);
				function listF() {
					
					if(index < 4) {
						index += 1;
								$("#list-"+index).addClass("active").fadeOut(300,function(){
									$(this).fadeIn(3000,function(){
										$(this).fadeOut(3000,function(){
											$("#list-"+index).switchClass("active", "inactive");
											});
										});
								});						
					} else {
						index = 0;
					}
				}
				
				/*Gallery*/
				
				$("#videos").fancybox({
				'width'				: 425,
				'height'			: 349,
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'

			});
				
				$("#videos2").fancybox({
				'width'				: 425,
				'height'			: 349,
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'

			});
				
				$("#videos3").fancybox({
				'width'				: 425,
				'height'			: 349,
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'

			});
				
				$("#videos4").fancybox({
				'width'				: 425,
				'height'			: 349,
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'

			});


                $("a[rel=gallery-school]").fancybox({
                  'transitionIn'		: 'none',
                  'transitionOut'		: 'none',
                  'titlePosition' 	: 'over',
                  'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
                      return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
                   }
           });
				
				
                $("a[rel=gallery-classes]").fancybox({
                  'transitionIn'		: 'none',
                  'transitionOut'		: 'none',
                  'titlePosition' 	: 'over',
                  'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
                      return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
                   }
           });
				
				
                $("a[rel=gallery-activities]").fancybox({
                  'transitionIn'		: 'none',
                  'transitionOut'		: 'none',
                  'titlePosition' 	: 'over',
                  'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
                      return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
                   }
           });
				
				 $("a[rel=gallery-accommodation]").fancybox({
                  'transitionIn'		: 'none',
                  'transitionOut'		: 'none',
                  'titlePosition' 	: 'over',
                  'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
                      return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
                   }
           });
				 
				$("a[rel=gallery-larrys]").fancybox({
                  'transitionIn'		: 'none',
                  'transitionOut'		: 'none',
                  'titlePosition' 	: 'over',
                  'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
                      return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
                   }
           });
				
				$("a[rel=gallery-fo]").fancybox({
                  'transitionIn'		: 'none',
                  'transitionOut'		: 'none',
                  'titlePosition' 	: 'over',
                  'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
                      return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
                   }
           });
				
				$("a[rel=gallery-laundry]").fancybox({
                  'transitionIn'		: 'none',
                  'transitionOut'		: 'none',
                  'titlePosition' 	: 'over',
                  'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
                      return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
                   }
           });
				
				$("a[rel=gallery-security]").fancybox({
                  'transitionIn'		: 'none',
                  'transitionOut'		: 'none',
                  'titlePosition' 	: 'over',
                  'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
                      return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
                   }
           });
				
				$("a[rel=gallery-rooms]").fancybox({
                  'transitionIn'		: 'none',
                  'transitionOut'		: 'none',
                  'titlePosition' 	: 'over',
                  'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
                      return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
                   }
           });

				 
				 $("a[rel=gallery-caregiving]").fancybox({
                  'transitionIn'		: 'none',
                  'transitionOut'		: 'none',
                  'titlePosition' 	: 'over',
                  'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
                      return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
                   }
           });

			
			
});


