var popupStatus = 0; //loading popup with jQuery magic! function loadPopup(capa){ //loads popup only if it is disabled if (popupStatus == 0) { $("#capaFondo").css({"opacity": "0.5"}); //$("#capaFondo").show(); $("#capaFondo").fadeIn("slow"); $(capa).fadeIn("slow"); popupStatus = 1; } } //disabling popup with jQuery magic! function disablePopup(capa){ //disables popup only if it is enabled if (popupStatus == 1) { $("#capaFondo").fadeOut("slow"); $(capa).fadeOut("slow"); popupStatus = 0; } } //AJAX function loadXMLDoc( id ){ if (window.XMLHttpRequest){ // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else{ // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4 && xmlhttp.status==200){ document.getElementById("okOrden").innerHTML=xmlhttp.responseText; } } var url = location.href.substring(0, location.href.lastIndexOf('.nsf')) + ".nsf/" + "ajaxEnviarOrden?OpenAgent&id=" + id; xmlhttp.open("GET",url, false); xmlhttp.send(); }