$(function() {
	$('.coda-slider').codaSlider({
		autoHeight: false,
		dynamicArrows: false,
		dynamicTabs: false,
		slideEaseDuration: 650
	});
});



$(document).ready(function() {


    $("#ctc").click(function() {
        var emailToVal = $("#email").val();
        var fname = $("#fname").val();
        var lname = $("#lname").val();
        var summary = $("#comments").val();
        url = "RegisterEmail.aspx?email=" + emailToVal + "&fname=" + fname + "&lname=" + lname + "&summary=" + summary;
        var hasError = false;
        var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;

        if (fname == '') {
            $("#fname").after('<span class="error" style="font-color:red;text-decoration:underline;"><br>You forgot to enter your firstname</span>');
            hasError = true;
        }
        if (lname == '') {
            $("#lname").after('<span class="error" style="font-color:red;text-decoration:underline;"><br>You forgot to enter your lastname</span>');
            hasError = true;
        }
        if (emailToVal == '') {
            $("#email").after('<span class="error" style="font-color:red;text-decoration:underline;"><br>You forgot to enter the email address to send to.</span>');
            hasError = true;
        } else if (!emailReg.test(emailToVal)) {
            $("#email").after('');
            $("#email").after('<span class="error"  style="font-color:red;text-decoration:underline;"><br>Enter a valid email address to send to.</span>');
            hasError = true;
        }

        if (hasError == false) {
            $("#mailme").hide('slow');
            $("#mailloader").show('slow');
            $.get(url, function(response) {
                if (response == "1") {
                    //      alert("Thanks");
                    $("#mailloader").hide('slow');

                    $("#MailMessage").show('slow');
                }

                if (response == "0") {
                    //alert("please try after some time");
                    $("#mailloader").hide('slow');
                    $("#ErrorMessage").show('slow');
                }
            });
        }
        return false;
    });

    $('#bloglink').click(function() {
        $('#bloglink').slideUp('200');
        $('#blogcomingsoon').slideDown('200');
        return false;
    });
    $('#blogclick').click(function() {
        $('#blogcomingsoon').slideUp('200');
        $('#bloglink').slideDown('200');
        return false;
    });
    $('#linked').click(function() {
        $('#educationdetails').slideDown('200');
        $('#certificationdetails').slideUp('200');
        $('#experiencedetails').slideUp('200');
        $('#skillsdetails').slideUp('200');
    });
    $('#linkc').click(function() {
        $('#certificationdetails').slideDown('200');
        $('#experiencedetails').slideUp('200');
        $('#skillsdetails').slideUp('200');
        $('#educationdetails').slideUp('200');
    });
    $('#linke').click(function() {
        $('#certificationdetails').slideUp('200');
        $('#experiencedetails').slideDown('200');
        $('#skillsdetails').slideUp('200');
        $('#educationdetails').slideUp('200');
    });
    $('#links').click(function() {
        $('#certificationdetails').slideUp('200');
        $('#educationdetails').slideUp('200');
        $('#experiencedetails').slideUp('200');
        $('#skillsdetails').slideDown('200');
    });
});


