$(document).ready(function(){
						   
	headline_count2 = $("div.headline2").size();
	$("div.headline2:eq("+current_headline2+")").css('top', '5px');
	setInterval(headline_rotate2,5000); //time in milliseconds
		
	$("a.event").fancybox({
				'width'				: '98%',
				'height'			: '95%',
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe',
				'overlayOpacity'	:	0.7,
				'overlayColor'		:	'#171025',
				'padding'           :  '0'
				});
	$("a.add-event").fancybox({
				'width'				: 525,
				'height'			: '80%',
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe',
				'overlayOpacity'	:  0.7,
				'overlayColor'		:  '#171025'
				});
	 
	 $("a.alerts-popup").fancybox({
				'width'				: 626,
				'height'			: 400,
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe',
				'overlayOpacity'	:	0.8,
				'overlayColor'		:	'#000000',
				});

	 $("a.wholesite-popup").fancybox({
				'width'				: 1030,
				'height'			: 520,
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe',
				'overlayOpacity'	:	0.8,
				'overlayColor'		:	'#000000'
				});
	 
	 
	  $("a#login-popup").fancybox({
				'width'				: 414,
				'height'			: 360,
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe',
				'overlayOpacity'	:  0.8,
				'overlayColor'		: '#000000'
				});

	  $("a#phone-popup").fancybox({
				'width'				: 414,
				'height'			: 325,
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe',
				'overlayOpacity'	:  0.8,
				'overlayColor'		: '#000000'
				});
				
	 $("a#share-popup").fancybox({
				'width'				: 418,
				'height'			: 562,
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe',
				'overlayOpacity'	:  0.8,
				'overlayColor'		: '#000000'
				});
	  $("a.minyanim-popup").fancybox({
				'width'				: 728,
				'height'			: 474,
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe',
				'overlayOpacity'	:  0.8,
				'overlayColor'		: '#000000'
				});
	  $("a.emergency-contact-popup").fancybox({
				'width'				: 570,
				'height'			: 355,
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe',
				'overlayOpacity'	:  0.8,
				'overlayColor'		: '#000000',
				'padding'           :  5
				});
	
	
	var options3 = {
            caption:    'permanent',
            opacity:    1
        }
    
     $('#ppy3').popeye(options3);
	
});

var headline_count;
var current_headline=0;
var headline_interval;
var old_headline = 0;



$(document).ready(function(){
  headline_count = $("div.headline").size();
  $("div.headline:eq("+current_headline+")").css('top', '5px');
  setInterval(headline_rotate,5000); //time in milliseconds
});

function headline_rotate() {
  old_headline = current_headline % headline_count;
  new_headline = ++current_headline % headline_count;
  $("div.headline:eq(" + old_headline + ")").css('top', '85px');
  $("div.headline:eq(" + new_headline + ")").show().animate({top: 0},"fast");     
};

var headline_count2;
var current_headline2=0;
 
$(document).ready(function(){ 

});

function headline_rotate2() {
  old_headline2 = current_headline2 % headline_count2;
  new_headline2 = ++current_headline2 % headline_count2;
  $("div.headline2:eq(" + old_headline2 + ")").css('top', '210px');
  $("div.headline2:eq(" + new_headline2 + ")").show().animate({top: 5},"slow");  
};

 $('#scrollup').hover(function() {
   clearInterval(headline_interval);
 }, function() {
   headline_interval = setInterval(headline_rotate,5000);
   headline_rotate();
 });

