$(function(){
$("#oneOffValuationDate").unbind("change", oneOffValuationDateChange).bind("change", oneOffValuationDateChange); // oneOffValuationDate 一级菜单ID
$("#accountCurrency").unbind("change", accountCurrencyChange).bind("change", accountCurrencyChange);
}); //accountCurrency 二级菜单ID
var oneOffValuationDateChange=function(){
var selectedValue = $(this).val();
$("#accountCurrency").children("span").each(function(){
$(this).children().clone().replaceAll($(this));
});
var ac = $("#accountCurrency").val();
var flag = false;
if( selectedValue != ""){
$("#accountCurrency").children("option[currencyValue!='" + selectedValue + "'][value!='']").each(function(){
$(this).wrap("<span style='display:none'></span>");
});
if ( ac != ""){
$("#accountCurrency").children("option[currencyValue='" + selectedValue + "'][value!='']").each(function(){
if( $(this).attr("value") == ac ){
ac = $(this).attr("value");
$("#accountCurrency").val(ac);
flag = true;
}
});
}
if (!flag){
alert("please select Account Currency!");
}
}else{
$("#accountCurrency").children("option[currencyValue!=''][value!='']").each(function(){
$(this).wrap("<span style='display:none'></span>");
});
}
};
var accountCurrencyChange = function(){
$("#accountCurrency").val($(this).children("option:selected").attr("currencyValue"));
};