		function equalHeight(group) {
            var tallest = 0;
            group.each(function () {
                var thisHeight = $(this).height();
                if (thisHeight > tallest) {
                    tallest = thisHeight;
                }
            });
            group.height(tallest);
        }
        $(document).ready(function () {
		var $bwidth = $(window).width();
			equalHeight($('.equal'));
			$('.agentL').hoverIntent(

		function () {
		    $('#agentPop', this).fadeIn('slow');
		    $('.chooseAgent').delay(800).addClass('visible');
		},

		function () {
		    $('#agentPop', this).fadeOut('fast');
		    $('.chooseAgent').removeClass('visible');
			}
		).css('height', '37px');

            $('.mainMenu').hoverIntent(
				function () {
		    		$('.subMenuContainer', this).slideDown('fast').parent().addClass('active');
				},
				function () {
		    		$('.subMenuContainer', this).slideUp('fast').parent().removeClass('active');
				}
			).css('height', '30px');
    
	        $('.quick').hoverIntent(
				function () {
		    		$('#quickDrop', this).slideDown('fast');
				    $('.quicklink').delay(800).addClass('qactive');
				},

				function () {
				    $('#quickDrop', this).slideUp('fast');
		    		$('.quicklink').removeClass('qactive');
				}
			);
            $('.spawnMap').colorbox({ inline: true, innerWidth: 600, innerHeight: 500,
                onLoad: function (s, e) { getPropertyLocations(); }
            });
		
		$('#banner').cycle({
            fx: 'fade',
            fxFn: spFx,
			speed: 2000,
            delay: 2000,
			timeout: 2000,
			speedOut: 500,
			speedIn: 500,
			height: 265		
			
        });
			
		function spFx() {
			var one = $(this).find('img');
			var two = $(this).find('.bnrleft');
			var three = $(this).find('.bnrright');
			one.fadeIn().delay(100);
			two.fadeIn().delay(250);
			three.fadeIn();
			};
		
		function wrapSize($bwidth) {
			var w = $bwidth;
			var w1 = w - 1300;
			var w2 = w - 1730;
			$('#banner').cycle('pause');
			/*var testalert = w + ' ' + w1 + ' ' + w2;
			alert(testalert);*/
			if (w > 1300) { 
		  		if (w < 1730) {
					$(".bnrleft").each(function() {
						$(this).width(w1 + 875);
					});
					$(".bnrleft span").each(function() {
						$(this).width(w1);
					});
					$(".inner").each(function(){
						$(this).width(w);
						$(this).css("backgroundPosition", (w1 + 1105) + "px -520px");
					});
					$(".bSlides").each(function(){
						$(this).width(w);
					});
					$('#banner').width(w);
					
				} else if (w < 2160) {
					$(".bnrleft").each(function() {$(this).width(1305);});
					$(".bnrleft span").each(function() {
						$(this).width(650);
					});
					$(".bnrright").each(function(){$(this).width(w2 + 220);});
					$(".inner").each(function(){
						$(this).width(w);
						$(this).css("backgroundPosition", (w1 + 1105) + "px -520px");
					});
					$(".bSlides").each(function(){
						$(this).width(w);
					});
					$('#banner').width(w);
					
				} else {
					$(".bnrleft").each(function() {
						$(this).width(1305);
					});
					$(".bnrleft span").each(function(){
						$(this).width(650);
					});
					$(".bnrright").each(function(){
						$(this).width(650);
					});
					$(".inner").each(function(){
						$(this).width(w).css("backgroundPosition", "1965px -520px");
					});
					$(".bSlides").each(function(){
						$(this).width(w);
					});
					$('#banner').width(w);					
				}
			}
			else {
				$('#banner').width("100%");
				$(".bnrleft").each(function() {$(this).width(875);});
				$(".bnrleft span").each(function() {$(this).width(220);});
				$(".bnrright").each(function(){$(this).width(220);});
				$(".inner").each(function(){
					$(this).width(w);
					$(this).css("backgroundPosition", "1105px -520px");
					$(this).parent().width("100%");
				});
				
			}
			$('#banner').cycle('resume');
			
		};
		
		wrapSize($bwidth);
		
		$(window).resize(function(){
			$bwidth = $(window).width();
			wrapSize($bwidth);
		});
		
		$(".vid").colorbox({iframe:true, innerWidth:640, innerHeight:385, title:" "});
		
		$(".url").colorbox({
			width:"75%", 
			height:"75%", 
			iframe:true,
			onOpen: function() { 
					$('#colorbox').addClass('newsitem');
				}
		});

			
        });
function tpay(tur) {twin=window.open(tur,'tenantpay','height=680,width=515,scrollbars=1');}
