	jQuery(document).ready( function() { showInterstitial(); } );
	// If the referrer is salsa, we should set the signupshown cookie.

	function showInterstitial() {

		// Show the interstitial once every five pages
		// if they haven't clicked it away - that is, a reload will make the
		// interstitial vanish temporarily.
		var loaded = parseInt(Cookie.get('reloaded'));
		if (isNaN(loaded)) loaded=0;
		if (loaded==5) loaded=0;
		loaded++;
		Cookie.set('reloaded',loaded);
		if (loaded > 1) {
		  jQuery('#shadow').hide();
		  jQuery('#caption').hide();	
		  jQuery('#popup').fadeOut();
		  jQuery('#screen').hide();
		  jQuery('#inter').hide();	
		  return; // don't show
		}

		if (Cookie.get('signupshown')==1) {
			hideInterstitial();
			return;
		}
		if (getUrlParameter('key')) {
			jQuery('#popup').html('<div style="width:600px;padding-top:90px;text-align:center;font-weight:bold;font-size:20pt;">Thank you for signing up.</div>');
		}
		jQuery('#header').css({visibility:'hidden'});
		jQuery('#headerbanner').css({backgroundColor:'#777'});

		jQuery('#inter').css({width:'100%', height:'1000', position:'fixed', top:0, left:0 });
		jQuery('#screen').css({width:'100%', height:'1000', top:0, left:0, backgroundColor:'black', opacity:'0.50', zIndex:10, position:'fixed' });
		jQuery('#popup').css({width:'600px', height:'355px', marginTop:'100px', backgroundColor:'white', opacity:1, zIndex:99 });
		jQuery('#shadow').css({top:'-400px',zIndex:29});
		jQuery('#caption').css({top:'-340px',zIndex:30});
		// add handlers for clicks outside of box
		jQuery('#screen').click(skipSignup);
		jQuery('#shadow').click(skipSignup);

		if (getUrlParameter('key')) {
			Cookie.set('signupshown',1,4000,'/');
			jQuery('#shadow').delay(4000).hide();
			jQuery('#popup').delay(4000).fadeOut('slow');
			jQuery('#screen').delay(4000).fadeOut('slow',function() { 
				jQuery('#inter').hide();	
				jQuery('#header').css({visibility:'visible'});
			});
		}
	}
  function skipSignup() {
    Cookie.set('signupshown',1,550,'/');
    hideInterstitial();
    return true;
  }
  function hideInterstitial(speed) {
    jQuery('#shadow').hide();
    jQuery('#caption').hide();	
    jQuery('#popup').fadeOut();
    jQuery('#screen').fadeOut('medium',function() { 
      jQuery('#inter').hide();	
      jQuery('#header').css({visibility:'visible'});
      });
    return false;
  }
	function setRedirect() {
		jQuery('#redirect').attr('value',document.location.href);
		return true;
	1}
	function getUrlParameter( name )
	{
		// http://www.netlobo.com/url_query_string_javascript.html
		name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
		var regexS = "[\\?&]"+name+"=([^&#]*)";
		var regex = new RegExp( regexS );
		var results = regex.exec( window.location.href );
		if( results == null )
			return "";
		else
		return results[1];
	}

