/*
function popUpEFT(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=780,height=550');");
}
*/

$(document).ready(function() {

	// service badge rollovers
	$("img.service_badge").hover(function() {
		$(this).attr("src", $(this).attr("src").split(".").join("_over."));
		}, function() {
		$(this).attr("src", $(this).attr("src").split("_over.").join("."));
	});
	// more info button rollovers
	$("img.button_more_info").hover(function() {
		$(this).attr("src", $(this).attr("src").split(".").join("_over."));
		}, function() {
		$(this).attr("src", $(this).attr("src").split("_over.").join("."));
	});
	
	// my own version of http://jqueryfordesigners.com/coda-popup-bubbles/
	$('.more_info').each(function() {
		var distance = 10;
		var time = 250;
		var shown = null;
		
		var start = this.offsetTop +10;
		var end = this.offsetTop + 20;
		
		var index = $('.more_info').index(this);
		var popup = $('.service_pricing_info').eq(index).css('opacity', 0);
		
		var hideDelay = 500;
		var hideDelayTimer = null;
		var beingShown = false;
		var shown = false;

		$([this, popup.get(0)]).mouseover(function() {
			if (hideDelayTimer) clearTimeout(hideDelayTimer);

			if (beingShown || shown) {
				return;
			} else {
				beingShown = true;
				popup.css({
					top: start,
					display: 'block' // brings the popup back in to view
				}).animate({
					top: end, //'-=' + 10 + 'px',
					opacity: 1
				}, time, 'swing', function() {
					beingShown = false;
					shown = true;
				});
      	  	}
		}).mouseout(function() {
				hideDelayTimer = setTimeout(function () {
				hideDelayTimer = null;
				popup.animate({
					top: start,
					opacity: 0
				}, time, 'swing', function() {
					shown = false;
					popup.css('display', 'none');
				});
			}, hideDelay);
		});
	});

}); // end document ready function

// for old services menu arrow animations
/*
	// show div controls
	$('div.show_focus').show();
	// hide divs
	$('div.focus_info').hide();
//$('div.focus_info p:last').css("color", "red !important");
	// perform toggle
	$('.show_focus').click(function() {
		d = $(this).next().css('display');
		
		h = $(this).html();		
		s = $(this).find('img').attr('src');

		if (d == 'none') {
			h = h.replace("MORE", "HIDE");
			s = s.replace(/arrow[^\.]*?\./, 'arrow_open.');
		} else {
			h = h.replace("HIDE", "MORE");
			s = s.replace('arrow_open', 'arrow_close');

		}
		
		$(this).html(h);
		$(this).find('img').attr('src', s);
		
		$(this).next().slideToggle('slow');
	});

});
*/
// end old services arrow animations