﻿

function sumbitForm( name,  phone,  email, comments)
{
     PageMethods.submitContactInfo( name,  phone,  email, comments,SubmitSuccess,SubmitFailed, ctx);
}



function SubmitSuccess(value, ctx, methodName)
{
    var successText = "<br /><strong>Information has been sent.</strong><br /><br />";
    $('input').value = "";
    $('#contact2ContentDiv').html(successText);
}
var oldText;

function resetText()
{
    $('#contact2ContentDiv').html(oldText);
}

function SubmitFailed(ex, ctx, methodName) 
{
    oldText = $('#contact2ContentDiv').html();
    var failedText = "<br /><strong>We're sorry there was an error processing your request. <br /><br />Please <span onclick='javascript:resetText(); return false;' style='cursor:pointer;text-decoration:underline;'>click here</span> to try again.</strong><br /><br />";     
    $('input').value = "";
    $('#contact2ContentDiv').html(failedText);
}  

var ctx = { 
           CurrentValue: 123456, 
           CurrentDate: new Date() 
           };