﻿/// <reference name="MicrosoftAjax.js"/>
/// <reference name="jquery-1.3.2.min-vsdoc.js"/>
/*---------------------Default.aspx methods---------------------------------------*/
function getContent() {
    YellowstoneDermatology.Services.ContentService.Something(OnContentRetrievalSuccess, OnRetrievalError);
}

function OnContentRetrievalSuccess(e) {

    var text = Sys.Serialization.JavaScriptSerializer.deserialize(e, true);
    var welcomeHeader = $get("welcomeHeader")
    var welcomeContent = $get("welcomeContent")
    welcomeHeader.innerHTML = text.WelcomeHeader;
    if (text.WelcomeContent == "") {

        welcomeContent.style.height = "1px";
    }
    else {
        welcomeContent.style.height = "150px";
        welcomeContent.innerHTML = text.WelcomeContent;
    }

}

function OnRetrievalError(results) {
    alert(results);
}

function SendEmailContactInfo(first, last, phone, message, urgency, preference, email) {
    var urgencySelection = urgency;
    var urgencySelected = urgencySelection.options[urgencySelection.selectedIndex].text;

    var preferenceSelection = preference;
    var preferenceSelected = preferenceSelection.options[preferenceSelection.selectedIndex].text;

    this.formResult.innerHTML = '<img src="../assets/images/progress.gif"/>';
    YellowstoneDermatology.Services.ContentService.SendEmail(first, last, phone, message, urgencySelected, preferenceSelected, email, OnSucceeded);
}
function OnSucceeded(response) {
    this.formResult.innerHTML = response;
}

function Failed(error) {
    alert(error);
}                         


    

