
function setup_animate_find_a_property() {
//	$('.JQFEText').css({"position" : "absolute", "top" : "0px", "left" : "0px", "z-index" : "101"});
	$('#findts .JQFEText').clone().insertBefore('#findts .JQFEText').addClass('animationOverlay').removeClass('JQFEText');
	$('#findts .animationOverlay').css({"left" : "0px", "position" : "absolute", "top" : "0px", "z-index" : "105", "color" : "#FF0000" , "filter" : "Glow(Color=red,Strength=2)" });
	$('#findts .animationOverlay span').css({"opacity" : 0});
}

function animate_find_a_property() {
	var animate_speed = 800;
	var opacity_to_animate_to = 1;
			
	$('#findts .animationOverlay .word_1').fadeTo(animate_speed, opacity_to_animate_to, function() {
		$('#findts .animationOverlay .word_2').fadeTo(animate_speed, opacity_to_animate_to, function() {
			$('#findts .animationOverlay .word_3').fadeTo(animate_speed, opacity_to_animate_to);
		});
	});
	$('#findts .animationOverlay .word_1').fadeTo(animate_speed, 0, function() {
		$('#findts .animationOverlay .word_2').fadeTo(animate_speed,0, function() {
			$('#findts .animationOverlay .word_3').fadeTo(animate_speed,0);
		});
	});
	
	var t = setTimeout("animate_find_a_property()", 9000);
}

function flash_thorugh_marquee (the_marquee, what_needs_to_blink) {
	// First, we need it to stop it as soon as it restarts
	the_marquee.one('start', function () {
		the_marquee.trigger('stop');
	});
	// hide the marquee
	the_marquee.hide();

	what_needs_to_blink.fadeIn(200).animate({'opacity': '.9'},1000).fadeOut(200)
		.fadeIn(200).animate({'opacity': '.9'},1000).fadeOut(200)
		.fadeIn(200).animate({'opacity': '.9'},10000)
		.fadeOut(200, function() {
			the_marquee.show();
			the_marquee.trigger('start');
			the_marquee.one('start', function () {
				the_marquee.one('stop',function () {
					flash_thorugh_marquee (the_marquee,what_needs_to_blink);			
				});
			});
		});
	//ends overflow line
}

function call_me_on_load () {
	//The stuff that needs to be loaded for every page should be put in the common file, in a "call_me_on_load() function"

	var agent = navigator.userAgent.toLowerCase();
	if (agent.indexOf("blackberry") != -1) {
		$('#the_big_table').css( 'table-layout', 'auto' );
/*	        $('div#div_left_side_menu').css( 'display', 'block');
		$('#div_left_side_feature_boxes').css( 'display', 'block');
        	$('#div_left_side_link-group-1').css( 'display', 'block');
	        $('#div_left_side_link-group-2').css( 'display', 'block');
*/
	}

	$('#marquee_header').marquee('Event').one('stop',function () {
		flash_thorugh_marquee ($(this),$('#p_header_blink'));			
	});

        /*If Javascript is enabled, this removes the hover css before the FontEffect function gets ahold of it. */
	$('#div_left_side_menu').removeClass('noJSHover');

        setup_animate_find_a_property();
        animate_find_a_property();
}

function hover(obj, flag) {
        var base = obj.src;
        base = base.match(/\d+/);

        switch (flag) {
        case 1:
                obj.src = "/menu/menu-over_" + base + ".png";
                break;
        case 0:
                obj.src = "/menu/menu_" + base + ".png";
                break;
        }
}

