function clearFormPrompt( objElement, txtPrompt ) {
	$('#signup-errors').html('');

    if( objElement.value == txtPrompt ) {
	objElement.value = "";
    }	
} // clearFormPrompt()

function restoreFormPrompt( objElement, txtPrompt ) {
    if( objElement.value == "" ) {
	objElement.value = txtPrompt;
    }	
} // restoreFormPrompt()

function validateForm( objForm, txtPrompt ) {
	$('#signup-errors').html('');

    var el = objForm.email;
    var filter = /.+\@.+\..+/; // SUPER-simple email regexp
    if( (el.value == "") ||
	(el.value == txtPrompt ||
	!filter.test( el.value ) ) ) {
	$('#signup-errors').html('Please enter a valid email address.');
	return false;
    }

    return true;
} // validateForm()

// portable "open in new window" -- bind to onclick and onkeypress
function target_blank() {
  window.open( this.href );
  return false;
}

var TargetBlank = new Object();
TargetBlank.Initialize = function () {
  var links = $( 'a.target-blank' );

  // want links to open in a new window
  links.each(function(idx) {
    var a = links[idx];
    a.onclick = target_blank;
    a.onkeypress = target_blank;
  });
}

$(document).ready( function() {
	$('div.screenshot, .content').supersleight({shim: '/images/transparent.gif'});
	TargetBlank.Initialize();
});
