function CheckFriend() {
	var error1 = "";
	error1 += checkemail($('friendform').FromEmail);
	error1 += checkemail($('friendform').ToEmail);
if (error1 != "") {
  // alert("Some of the fields were not completed correctly, please correct them and try again. There are problems with the following fields: "+wg.slice(0, -2)+".");

   alert("Please complete both email fields.");
  return false;
} else {
	return true;
}
}
function checkemail(email) {
	var error = "";
	apos=email.value.indexOf("@")
	dotpos=email.value.lastIndexOf(".")

if (email.value == "" || apos<1 || dotpos-apos<2)
{
// email.className = "form-inp-";
 		error = "error";
} else {
 //email.className = "form-inp";
}
    return error;  
}

jQuery(document).ready(function(){

jQuery('#step1').show();
jQuery('#step2').hide();
jQuery('#step3').hide();

jQuery('#plink1').click(function(){
jQuery('#step1').fadeIn('slow');
jQuery('#step2').hide();
jQuery('#step3').hide();

});


jQuery('#plink2').click(function(){
jQuery('#step2').fadeIn('slow');
jQuery('#step1').hide();
jQuery('#step3').hide();
 
});


jQuery('#plink3').click(function(){
jQuery('#step3').fadeIn('slow');
jQuery('#step1').hide();
jQuery('#step2').hide();
jQuery('#step4').hide();
 

});

 



});