//stupid IE
if(!jQuery.browser.msie)
    {
	jQuery(document).ready(function(){   
       
		jQuery("#content_loading").fadeOut('fast');
		
		jQuery("#container_page").fadeIn('slow');

		// clear field plugin for the small sign up box
		jQuery("#email_address_small").clearField();
	    });
    }
//else
//{
 //          jQuery(document).ready(function(){       
//		jQuery("#content_loading").hide();		
//		jQuery("#container_page").show();
//	    });
//}


// take the email address from the subscription box and take the user the full form and fill in the email address
function go_to_subscribe_with_email()
{
    //get the value of the field in the small box/form and go to the location
    var email = document.getElementById('email_address_small').value;
    location.href='/tref/subscribe?email=' + email;
}

function get_url_param( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  //the logic here doesn't quite work, but results[1] has the email value, so return it

  return results[1];
  //if( results == null )
  //return "";
  //else
  //return results[1];
}

//fill in the email value in the embedded sign up form
function fill_in_email_value()
{
    document.getElementById('email_address').value = get_url_param('email');
} 