﻿// JScript File

//function DisplayTest()
//{alert('here we go');}

function EnableWorkSchoolControls()
{
//alert('here we go');
//alert('here we gonA');
//theForm = document.forms['']
theForm = document.aspnetForm
//alert(theForm.ctl00_ContentPlaceHolder1_txtFirstName.value);
    if (theForm.ctl00_ContentPlaceHolder1_txtFirstName.value == "")
      {
      alert("You must enter your first name.");
      return;
      }
//alert('here we go2');
    if (theForm.ctl00_ContentPlaceHolder1_txtLastName.value == "")
      {
      alert("You must enter your last name.");
      return;
      }
    if (theForm.ctl00_ContentPlaceHolder1_txtCity.value == "")
      {
      alert("You must enter your city.");
      return;
      }
    if (theForm.ctl00_ContentPlaceHolder1_StateList.value == "0")
      {
      alert("You must enter your state.");
      return;
      }
    if (theForm.ctl00_ContentPlaceHolder1_txtEmail.value == "")
      {
      alert("You must enter your email address.");
      return;
      }
    EnableIndustryControls();
    theForm.ctl00_ContentPlaceHolder1_txtUndergrad.disabled = false;
    theForm.ctl00_ContentPlaceHolder1_txtGrad.disabled = false;
    theForm.ctl00_ContentPlaceHolder1_txtPHD.disabled = false;
    theForm.ctl00_ContentPlaceHolder1_btnToBio.disabled = false;
    theForm.ctl00_ContentPlaceHolder1_btnBackToBasicInfo.disabled = false;
    GoToNextPage(window.ctl00_ContentPlaceHolder1_mpageProfile);
    EnableTab(window.ctl00_ContentPlaceHolder1_TabStrip1,1);
    SetTabFocus(window.ctl00_ContentPlaceHolder1_TabStrip1,1);
}

function IsStudent()
{
theForm = document.aspnetForm
if ( theForm.ctl00_ContentPlaceHolder1_chkStudent.checked == true)
  {
    DisableIndustryControls();
  }
else
  {
    EnableIndustryControls();
  }
}


function EnableBioControls()
{
 theForm = document.aspnetForm
    if ((theForm.ctl00_ContentPlaceHolder1_chkStudent.checked == false) && (GetListValue(theForm.ctl00_ContentPlaceHolder1_lstIndustry) == 0) )
      {
      alert("You must either check the Student box or select an industry.");
      return;
      }
   theForm.ctl00_ContentPlaceHolder1_txtBio.disabled = false;
    theForm.ctl00_ContentPlaceHolder1_optMale.disabled = false;
    theForm.ctl00_ContentPlaceHolder1_optFemale.disabled = false;
    theForm.ctl00_ContentPlaceHolder1_optFemale.checked=false;
    theForm.ctl00_ContentPlaceHolder1_optMale.checked=false;
    theForm.ctl00_ContentPlaceHolder1_btnToPicture.disabled = false;
    theForm.ctl00_ContentPlaceHolder1_btnBackToWorkSchool.disabled = false;
    GoToNextPage(window.ctl00_ContentPlaceHolder1_mpageProfile);
    EnableTab(window.ctl00_ContentPlaceHolder1_TabStrip1,2);
    SetTabFocus(window.ctl00_ContentPlaceHolder1_TabStrip1,2);
}

function EnablePictureControls()
{
theForm = document.aspnetForm
 if ( theForm.ctl00_ContentPlaceHolder1_optFemale.checked == false && theForm.ctl00_ContentPlaceHolder1_optMale.checked == false)
      {
        alert("You must select your gender.");
        return;
     }

 if ( theForm.ctl00_ContentPlaceHolder1_txtBio.value == "")
     {
        alert("You must enter a bio.");
        return;
     }
    theForm.ctl00_ContentPlaceHolder1_UploadedFile.disabled = false;
    theForm.ctl00_ContentPlaceHolder1_btnToParticipation.disabled = false;
    theForm.ctl00_ContentPlaceHolder1_btnBacktoBio.disabled = false;
    GoToNextPage(window.ctl00_ContentPlaceHolder1_mpageProfile);
    EnableTab(window.ctl00_ContentPlaceHolder1_TabStrip1,3);
    SetTabFocus(window.ctl00_ContentPlaceHolder1_TabStrip1,3);
}

function EnableParticipationControls()
{
theForm = document.aspnetForm
    theForm.ctl00_ContentPlaceHolder1_chkVolunteer.disabled = false;
    theForm.ctl00_ContentPlaceHolder1_chkMentor.disabled = false;
    theForm.ctl00_ContentPlaceHolder1_chkSpeaker.disabled = false;
    theForm.ctl00_ContentPlaceHolder1_btnBackToPicture.disabled = false;
    theForm.ctl00_ContentPlaceHolder1_btnToPassword.disabled = false;
    GoToNextPage(window.ctl00_ContentPlaceHolder1_mpageProfile);
    EnableTab(window.ctl00_ContentPlaceHolder1_TabStrip1,4);
    SetTabFocus(window.ctl00_ContentPlaceHolder1_TabStrip1,4);
}

function EnablePasswordControls()
{
theForm = document.aspnetForm
if (  (theForm.ctl00_ContentPlaceHolder1_chkVolunteer.checked == false) && (theForm.ctl00_ContentPlaceHolder1_chkMentor.checked == false) && (theForm.ctl00_ContentPlaceHolder1_chkSpeaker.checked == false) )
    {
     alert("You must select a way you will participate");
     return;
    }
    theForm.ctl00_ContentPlaceHolder1_txtPassword.disabled = false;
    theForm.ctl00_ContentPlaceHolder1_txtPasswordVerification.disabled = false;
   theForm.ctl00_ContentPlaceHolder1_btnBackToParticipation.disabled=false;
   theForm.ctl00_ContentPlaceHolder1_btnToVerification.disabled=false;
    GoToNextPage(window.ctl00_ContentPlaceHolder1_mpageProfile);
    EnableTab(window.ctl00_ContentPlaceHolder1_TabStrip1,5);
    SetTabFocus(window.ctl00_ContentPlaceHolder1_TabStrip1,5);
}

function EnableVerificationControls()
{
theForm = document.aspnetForm
   if ( (theForm.ctl00_ContentPlaceHolder1_txtPassword.value == "") && (theForm.ctl00_ContentPlaceHolder1_txtPasswordVerification.value=="" ) )
     {
      alert("You must enter a password.");
      return;
     }
   if (theForm.ctl00_ContentPlaceHolder1_txtPassword.value != theForm.ctl00_ContentPlaceHolder1_txtPasswordVerification.value)
     {
      alert("Password verification failed. Try again");
      return;
     }
    theForm.ctl00_ContentPlaceHolder1_btnSave.disabled = false;
    theForm.ctl00_ContentPlaceHolder1_btnBackToPassword.disabled=false;
    GoToNextPage(window.ctl00_ContentPlaceHolder1_mpageProfile);
    EnableTab(window.ctl00_ContentPlaceHolder1_TabStrip1,6);
    SetTabFocus(window.ctl00_ContentPlaceHolder1_TabStrip1,6);
}

function GoToBasicInfo()
{
    GoToPreviousPage(window.ctl00_ContentPlaceHolder1_mpageProfile);
    SetTabFocus(window.ctl00_ContentPlaceHolder1_TabStrip1,0);

}
function GoToWorkSchool()
{
    GoToPreviousPage(window.ctl00_ContentPlaceHolder1_mpageProfile);
    SetTabFocus(window.ctl00_ContentPlaceHolder1_TabStrip1,1);

}
function GoToBio()
{
    GoToPreviousPage(window.ctl00_ContentPlaceHolder1_mpageProfile);
    SetTabFocus(window.ctl00_ContentPlaceHolder1_TabStrip1,2);

}
function GoToPictures()
{
    GoToPreviousPage(window.ctl00_ContentPlaceHolder1_mpageProfile);
    SetTabFocus(window.ctl00_ContentPlaceHolder1_TabStrip1,3);

}
function GoToParticipation()
{
    GoToPreviousPage(window.ctl00_ContentPlaceHolder1_mpageProfile);
    SetTabFocus(window.ctl00_ContentPlaceHolder1_TabStrip1,4);

}
function GoToPassword()
{
    GoToPreviousPage(window.ctl00_ContentPlaceHolder1_mpageProfile);
    SetTabFocus(window.ctl00_ContentPlaceHolder1_TabStrip1,5);

}
//function GoToNextPage()
//{
//    var multipage = window.ctl00_ContentPlaceHolder1_mpageProfile;        
//    multipage.GoNext();
//}

//function GoToPreviousPage()
//{
//    var multipage = window.ctl00_ContentPlaceHolder1_mpageProfile;        
//    multipage.GoPrevious();
//}
//function SetTabFocus(tabin, tabindex)
//{
////var tabStrip = window.ctl00_smcph_tabStrip;
//var tabStrip = tabin;
////var tab = tabStrip.GetTabFromStorage(0);
//var tab = tabStrip.GetTabFromStorage(tabindex);
//tabStrip.SetSelectedTab(tab);       

//tabStrip.Render();    
//}

//function DisableTab(tabin, tabindex)
//{
//var tabStrip = tabin;
//var tab = tabStrip.GetTabFromStorage(tabindex);
//tab.SetProperty('Enabled',false); 
//tabStrip.Render();
//}

//function EnableTab(tabin, tabindex)
//{
//var tabStrip = tabin;
//var tab = tabStrip.GetTabFromStorage(tabindex);
//tab.SetProperty('Enabled',true); 
//tabStrip.Render();
//}

function DisableIndustryControls()
{
theForm = document.aspnetForm
theForm.ctl00_ContentPlaceHolder1_lstIndustry.disabled=true;
theForm.ctl00_ContentPlaceHolder1_txtTitle.disabled=true;
}

function EnableIndustryControls()
{
theForm = document.aspnetForm
theForm.ctl00_ContentPlaceHolder1_lstIndustry.disabled=false;
theForm.ctl00_ContentPlaceHolder1_txtTitle.disabled=false;
}

function EnableSave()
{

 theForm = document.aspnetForm
theForm.ctl00_ContentPlaceHolder1_btnSave.disabled=false;
 theForm.btnBackToCharacters.disabled=false;
}