﻿// JScript File

function SetPersonalCountry(ddlCountryId,divOtherCountryId, divVietNamCityId, vietNamId)
    {
        var strCountry = document.getElementById(ddlCountryId);
        var strVN = vietNamId;
        if(strCountry.options[strCountry.selectedIndex].value == strVN)        
        {
            document.getElementById(divOtherCountryId).style.display = 'none';
            document.getElementById(divVietNamCityId).style.display = 'inline';
        }
        else
        {
            document.getElementById(divOtherCountryId).style.display = 'inline';
            document.getElementById(divVietNamCityId).style.display = 'none';
        }
        return false;
    }
    
   
    
    function ShowEndDate(checkBoxId,divTextEndId,divEndDate)
    {
        var idStill = document.getElementById(checkBoxId);
        if(idStill.checked == true)
        {
            document.getElementById(divTextEndId).style.display = 'none';
            document.getElementById(divEndDate).style.display = 'none';
        }
        else
        {
            document.getElementById(divTextEndId).style.display = 'inline';
            document.getElementById(divEndDate).style.display = 'inline';
        }                
    }
    


  function ShowNameDialog(dropDownListId,otherId,divOtherId)
    {
        var strCountry = document.getElementById(dropDownListId);
        var strOtherUniversity = otherId
        if(strCountry.options[strCountry.selectedIndex].value == strOtherUniversity)
            document.getElementById(divOtherId).style.display = 'inline';
        else
            document.getElementById(divOtherId).style.display = 'none';
        return false;
    }



function ConfirmDelete()
{
    return confirm("Are you sure you wish to remove the selected items?");
}

function parentCheckBoxOnclick(parentForm, status, subCheckBoxName)
{                  
    for(var i=0; i<parentForm.elements.length; i++)
    {            
        if(parentForm.elements[i].type == "checkbox" && parentForm.elements[i].name == subCheckBoxName && parentForm.elements[i].disabled == false) 
        {
            parentForm.elements[i].checked = status;
        }
    }
}
function subCheckBoxOnClick(status, parentCheckBox)
{
    if (status == false)
        parentCheckBox.checked = false;
}



