Вы находитесь на странице: 1из 2

<!

-- crear popup -->


<div id="dialogMessageBox" title="RPS - Cuadro de dialogo" style="display: none;">
<div class="divContent">
<div id="divQuestion" class="divQuestion">
<img src="<?php echo $_layoutParams['ruta_images'] . 'icon_question.png' ?>">
</div>
<div id="divExclamation" class="divExclamation">
<img src="<?php echo $_layoutParams['ruta_images'] . 'icon_exclamation.png' ?
>">
</div>
<div id="divInformation" class="divInformation">
<img src="<?php echo $_layoutParams['ruta_images'] . 'icon_information.png' ?
>">
</div>
<div id="divError" class="divError">
<img src="<?php echo $_layoutParams['ruta_images'] . 'icon_error.png' ?>">
</div>
<div id="divMessage" name="divMessage" class="divMessage" style="text-align:
justify;">
<input type="hidden" id="txtResponse" name="txtResponse" value="-1"
readonly="true">
<textarea id="txtMessage" name="txtMessage" class="txtMessage" rows="4"
value="" readonly="true"></textarea>
</div>
</div>
</div>

<script type="text/javascript">
function rpsMessageBox ( sTypeBox, nIcon, sTextMessage, okFunction,
cancelFunction ) {

/* values for sTypeBox


0 = Simple button
1 = Yes/no button

/* Values for nIcon


0 = Information
1 = Exclamation
2 = Question
3 = Error
*/

$('#txtMessage').val(sTextMessage);

if ( nIcon == '0' ) {
$('#divInformation').show();
$('#divExclamation').hide();
$('#divQuestion').hide();
$('#divError').hide();
} else if ( nIcon == '1' ) {
$('#divExclamation').show();
$('#divInformation').hide();
$('#divQuestion').hide();
$('#divError').hide();
} else if ( nIcon == '2' ) {
$('#divQuestion').show();
$('#divInformation').hide();
$('#divExclamation').hide();
$('#divError').hide();
} else {
$('#divError').show();
$('#divInformation').hide();
$('#divExclamation').hide();
$('#divQuestion').hide();
}

var dlgMessageBox = $("#dialogMessageBox");


if ( sTypeBox == '0' ) {

$(dlgMessageBox).dialog({
width: 500,
modal: true,
dialogClass: "no-close",
buttons: {
Aceptar: function () {
if ( typeof ( okFunction ) == 'function' ) {
setTimeout( okFunction, 50 );
}
$(this).dialog('destroy');
}
},
});

} else {

$(dlgMessageBox).dialog({
width: 500,
modal: true,
dialogClass: "no-close",
buttons: {
Aceptar: function () {
if ( typeof ( okFunction ) == 'function' ) {
setTimeout( okFunction, 50 );
}
$(this).dialog('destroy');
},
Cancelar: function () {
if ( typeof ( cancelFunction ) == 'function' ) {
setTimeout( cancelFunction, 50 );
}
$(this).dialog('destroy');
}
},
});

}
}
</script>

Вам также может понравиться