var applyNow; function ApplyNow(job_ad_id){ this.dialog = document.getElementById('apply_now_dialog'); this.job_ad_id = job_ad_id; this.initiate_dialog(); } ApplyNow.prototype.dialog = ""; ApplyNow.prototype.job_ad_id = ""; ApplyNow.prototype.initiate_dialog = function(){ this.getrequest('job='+this.job_ad_id); $('#apply_now_dialog').dialog("open"); } ApplyNow.prototype.request_login = function(){ document.getElementById('loading_alert').style.display = "block"; document.getElementById('sign_in_button').disable = true; var username = document.getElementById('js_username').value; var password = document.getElementById('js_password').value; this.getrequest('job='+this.job_ad_id+'&u='+username+'&p='+password); } ApplyNow.prototype.getrequest = function(query){ var ANO = this; var inlineAjax = new InlineAjax(); inlineAjax.requestObject.onreadystatechange = function(){ if(inlineAjax.requestObject.readyState == 4){ ANO.dialog.innerHTML = inlineAjax.requestObject.responseText; } } url = "/packages/Application/includes/apply_now.php?" + query; inlineAjax.requestObject.open("GET",url,true); inlineAjax.requestObject.send(null); } function loadApply(id){ applyNow = new ApplyNow(id); }