// JavaScript Document

// load plugins

	
  // easing 1.3
	jQuery.easing['jswing'] = jQuery.easing['swing']; jQuery.extend( jQuery.easing, { easeInExpo: function (x, t, b, c, d) { return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; }, easeOutExpo: function (x, t, b, c, d) { return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; } });



$(window).load(function () {
  
  
  // Callrail Functions for On window load. find functions in file at: seobywebmechanix.com/seobywebmechanix.js
  referrer_key = getReferrerKey();
  new_number = findNumberForSwap(referrer_key);

	function killModal() {

		$('input').blur();
		$('.modal').animate({ opacity: 0, top: -520 }, 300, 'easeInExpo', function() {
			$('#subscribe').removeClass('loading');
			$('#subscribe > p').css( "opacity", 1 );
			$('#subscribe input[type=text]').val('').removeAttr('class');
			$('.modal').removeClass('active');
			$('#overlay').fadeOut(300, function() {
				$(this).remove();
				});
			});

		}


	// modals

  	$('[href="#subscribe"]').click( function(e) {
    		e.preventDefault();
    		$('#subscribe').before('<div id="overlay"></div>').animate({ opacity: 1, top: -10 }, 300, 'easeOutExpo' );
    		$('#subscribe input[type=text]').val('');
    		$('#subscribe.modal').addClass('active');
  	})
		
		$('[href="#quote"]').click( function(e) {
  		e.preventDefault();
  		$('#quote').before('<div id="overlay"></div>').animate({ opacity: 1, top: -10 }, 300, 'easeOutExpo' );
  		$('#quote input[type=text]').val('');
  		$('#quote.modal').addClass('active');
		})

  	$('.close').live('click', function(){
  		  killModal();
  	});
  	
   $("#rotator > ul").tabs({
    fx:{opacity: "toggle"}
   }).tabs("rotate", 12000, true);
   
});   







