 /*****************************************************************************
    The sIFR configuration should typically go in `sifr-config.js`, but in order to
    keep the config file clean, and to give a quick overview, it's done here instead.
    *****************************************************************************/

    var ps = {
      src: 'flash/ps.swf'
      ,ratios: [7,1.32,11,1.31,13,1.24,14,1.25,19,1.23,27,1.2,34,1.19,42,1.18,47,1.17,48,1.18,69,1.17,74,1.16,75,1.17,1.16]
    };


    // sIFR.domains = ['novemberborn.net'] // Don't check for domains in this demo
    sIFR.useStyleCheck = true;
    sIFR.activate(ps);

	sIFR.replace(ps, {
      selector: 'h1.featured'
      ,css: [
        '.sIFR-root { text-align: left; font-weight: bold;color:#ffffff;background: transparent }'
      ]
	  ,transparent: true
    });
	
    sIFR.replace(ps, {
      selector: 'h1'
      ,css: [
        '.sIFR-root { text-align: left; font-weight: bold;color:#998675;background: transparent }'
		,'.featured { color:#ffffff}'
      ]
	  ,transparent: true
    });
	
	
	$(document).ready(function () {
$.localScroll(
{
speed:300
}
);
});

$(function() {


$("#menu").lavaLamp({
fx: "backout",
speed: 700,
click: function(event, menuItem) {
return false;
}
});

$("#submit").click(function(){
				   				   
		$(".error").hide();
		var hasError = false;
		var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
		
		var fromNameVal = $("#fromname").val();
		
		if(fromNameVal == '') {
		
			$("#fromname").after('<span class="error">You forgot to enter your name.</span>');
			hasError = true;
		}
		
		var emailFromVal = $("#emailFrom").val();
		if(emailFromVal == '') {
			$("#emailFrom").after('<span class="error">You forgot to enter the email address to send from.</span>');
			hasError = true;
		} else if(!emailReg.test(emailFromVal)) {	
			$("#emailFrom").after('<span class="error">Enter a valid email address to send from.</span>');
			hasError = true;
		}
		
		var subjectVal = $("#subject").val();
		if(subjectVal == '') {
			$("#subject").after('<span class="error">You forgot to enter the subject.</span>');
			hasError = true;
		}
		
		var messageVal = $("#message").val();
		if(messageVal == '') {
			$("#message").after('<span class="error">You forgot to enter the message.</span>');
			hasError = true;
		}
		
		
		if(hasError == false) {
			$(this).hide();
			$("#sendEmail li.buttons").append('<img src="img/loading.gif" alt="Loading" id="loading" />');
			
			$.post("sendemail.php",
   				{ From: fromNameVal, emailFrom: emailFromVal, subject: subjectVal, message: messageVal },
   					function(data){
						$("#sendEmail").slideUp("normal", function() {				   
							
							$("#sendEmail").before('<p class="alert">Your email was sent.</p>');											
						});
   					}
				 );
		}

		return false;
	
	});



});