
function isValidEmailAddress(emailAddress) {
var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
return pattern.test(emailAddress);
}



window.onload = function() {
	
$("#nletterEmail").click( function() {
    
	if (this.value == "Email Address") {
		this.value = "";
	}
	
});

$("#nletterEmail").blur( function() {
    
	if (this.value == "") {
		this.value = "Email Address";
	}
	
});



    $("#newsletterForm").submit(function() {
	if(isValidEmailAddress(document.getElementById("nletterEmail").value))
	{
		//$.post('/data/sendNewsletterRequest.php', {email: document.getElementById("nletterEmail").value});
		/*
		document.getElementById("newsletterForm").style.display = "none";
		document.getElementById("invalidNewsletter").style.display = "none";
		document.getElementById("newsletterdone").style.display = "block";
		*/
		
		return true;
	}
	else
	{
		document.getElementById("newsletterForm").style.display = "none";
		document.getElementById("invalidNewsletter").style.display = "block";
		return false;
	}    
	
});


$("#GoBackNewsletter").click(function (){
	
		document.getElementById("newsletterForm").style.display = "block";
		document.getElementById("invalidNewsletter").style.display = "none";
});


$("#dmBox").mouseover(function (){
	$('body').css('cursor', 'pointer'); 
});

$("#dmBox").mouseout(function (){
	$('body').css('cursor', 'auto'); 
});

$("#ctBox").mouseover(function (){
	$('body').css('cursor', 'pointer'); 
});

$("#ctBox").mouseout(function (){
	$('body').css('cursor', 'auto'); 
});

$("#dmBox").click(function (){
	$('#boadCT').css('display', 'none'); 
	$('#boadDM').css('display', 'block'); 	
	$('#solutionsNames').css('border-bottom', '3px solid #e40400'); 	
	
});

$("#ctBox").click(function (){
	$('#boadCT').css('display', 'block'); 
	$('#boadDM').css('display', 'none'); 	
	$('#solutionsNames').css('border-bottom', '3px solid #48a92f'); 	
});

}
