﻿function country_OnChanged(s) {       
    if (s.value == "190") {
        // USA
        state.selectedIndex = 0;
    }
    else {
        //Non-USA Location
        state.selectedIndex = state.options.length - 1;
    }
}

function onState_Change(s) {
    if (state.selectedIndex != state.options.length - 1) {
        country.value = "190";
    }
    else {
        //        country.value = "0";
        country.selectedIndex = 0;
    }

//    if (state.selectedIndex == state.options.length - 1) {
//        country.selectedIndex = 0;
//    }
}

function validateState(sender, args) {   
    if (country.value == "190") {
        args.IsValid = (state.value != "");
        return;
    }
    else {
        args.IsValid = (state.value != "");
        return;
    }
}

function validateCountry(sender, args) {    
    if (country.value == "") {        
        args.IsValid = (country.value != 0);
        return;
    }
    else {        
        args.IsValid = (country.value != 0);
        return;
    }        
 }
            