var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") ||pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}
function validarFormulario(f){
if(validar(f))
f.submit();
else
return false;
}
function insertBtn(value,action){
var html="
";
document.write(html);
}
$(document).ready( function(){
$('ul.jd_menu:not(.jd_menu_slate2)').jdMenu({activateDelay: 150,onAnimate: onAnimate});
$('ul.jd_menu:not(.jd_menu_slate2) li.open ul').show();
$('ul.jd_menu_slate2').jdMenu();
});
function onAnimate(show) {
if (show) {
$(this).css('visibility', 'visible').hide().slideDown('slow');
} else {
$(this).slideUp('fast');
}
}
/* function onShow(){
alert($(this).attr('class'));
if (this.class == 'open') {
alert('open');
$(this).jdMenuShow();
}
}
*/
$(document).ready(function(){
$(document).pngFix();
$("#inTextSearch").defaultvalue("Rechercher");
$('.btn_traite').corners('3px');
$('.btn_nontraite').corners('3px');
$('.btn_encours').corners('3px');
$("#champ_dyn_1982").hover(
function() {
$('#champ_dyn_1982').removeAttr('disabled');
$('#champ_dyn_1982').prop('disabled', false);
}
);
$("#champ_dyn_2041").hover(
function() {
$('#champ_dyn_2041').removeAttr('disabled');
$('#champ_dyn_2041').prop('disabled', false);
}
);
$("#champ_dyn_2038").hover(
function() {
$('#champ_dyn_2038').prop('disabled', false);
}
);
//------------------------------
$('#champ_dyn_2038,#champ_dyn_2041, #champ_dyn_2039, #champ_dyn_2042').on('keyup change', function()
{
console.log('miova');
var champ= $(this);
var champ_val= champ.val();
var zone=$('#champ_dyn_1982').val();
var surface=$('#champ_dyn_1854').val();
console.log ('zone' + zone);
console.log ('surface '+surface*10);
if (zone!='' && surface!='' && surface!='0.00')
{
var honoraire=zone.match(/\d+,\d+/);//
console.log(honoraire);
var honoraire1 = parseFloat(honoraire.replace(',', '.'));
var plafond= honoraire1*surface;
console.log('plafond' + plafond);
console.log('plafond '+plafond + 'champ_ val'+ champ_val);
//Debloquage du plafond des honoraires ? la charge du bailleur, et on peut les augmenter
// SP-29695, Fetra, 2022, mars, correction, on commente le code
if (champ_val>plafond)
{
if($(this).attr('id') == 'champ_dyn_2041' || $(this).attr('id') == 'champ_dyn_2042'){
$(this).val(numeral(plafond).format('0.00'));
}
}
}
});
//------------------------------
});