function registerValidation()
{
      	var b_correct=true;
        if(b_correct && func_trim(document.frmEnigma.txtName.value)=="")
	{
                b_correct=false;
		alert("Please give your name");
		document.frmEnigma.txtName.focus();
	}
        if(b_correct && func_trim(document.frmEnigma.txtEmail.value)=="")
	{
		b_correct=false;
		alert("Please give your email address");
		document.frmEnigma.txtEmail.focus();
	}

	if(b_correct && !func_is_email(func_trim(document.frmEnigma.txtEmail.value)))
	{
		b_correct=false;
		alert("Please give a valid email address");
		document.frmEnigma.txtEmail.focus();
		document.frmEnigma.txtEmail.select();
	}
        if(b_correct && func_trim(document.frmEnigma.txtPurchasedFrom.value)=="")
	{
		b_correct=false;
		alert("Please give name of shop or address of website from which you have purchased the book");
		document.frmEnigma.txtPurchasedFrom.focus();
	}
        if(b_correct && func_trim(document.frmEnigma.txtPurchaseDate.value)=="")
	{
		b_correct=false;
		alert("Please give purchase date");
		document.frmEnigma.txtPurchaseDate.focus();
	}
        if(b_correct && !(document.frmEnigma.chkWanPurchase.checked) && func_trim(document.frmEnigma.fleProof.value)=="")
	{
		b_correct=false;
		alert("Please upload scan or phone photo");
		document.frmEnigma.fleProof.focus();
	}
        return b_correct;
		
}
function claimValidation()
{
    var b_correct=true;
    if(b_correct && func_trim(document.frmEnigmaClaim.txtRegCode.value)=="")
    {
            b_correct=false;
            alert("Please give your registration code");
            document.frmEnigmaClaim.txtRegCode.focus();
    }

    var editor = $("textarea[name='txtClaimText']").parents("p").find("iframe").contents().find("body:first");
    if(b_correct && $.trim(editor.text())=="")
    {
            b_correct=false;
            alert("Please explain the link between the Enigma shape and the storyline of The Architect.");
            document.frmEnigmaClaim.txtClaimText.focus();
    }
    return b_correct;
}
$(document).ready(function()
{
    
  $("#chkWanPurchase").click(function(){
    if($(this).is(":checked"))
        {
            $("#jqPhoto").hide();
        }
        else
         {
            $("#jqPhoto").show();
         }

});
});


