// $Id: veil.js,v 1.9 2009-06-16 23:26:06 peter Exp $ function veilOn() { document.getElementById('veil').style.height=document.body.parentNode.scrollHeight+'px'; document.getElementById('veil').style.zIndex=3; document.getElementById('rego_form').style.zIndex=4; document.getElementById('main_div').style.opacity=.3; var txt=""; var cw = document.getElementById('content-wrap'); for (k in cw) { txt += k + "=" + cw[k]+"\n"; } var blurb = document.getElementById('blurb'); // blurb.innerHTML = txt; document.getElementById('rego_form').style.top = (30 + cw.offsetTop) + "px"; document.getElementById('rego_form').style.left = "60px"; return false; } function veilOff() { document.getElementById('veil').style.zIndex=0; document.getElementById('rego_form').style.zIndex=0; document.getElementById('main_div').style.opacity=1; return false; } var debug = false; function handle_json() { if (http_request.readyState == 4) { // alert("readyState = " + http_request.readyState); if (http_request.status == 200) { var json_data = http_request.responseText; if (debug) { alert("received: " + json_data); } try { eval("var result = ("+json_data+")"); if (result.header && result.header.command) { if (result.header.command=="veiled_register") { if (result.header.status=="OK") { if (debug) { alert("OK!!"); } thankYouBaby(result.header.command); veilOff(); } else { ; // error message } } else if (result.header.command=="register") { if (result.header.status=="OK") { var host = document.location.host; var protocol = document.location.protocol; // also gives you a colon document.location = protocol + "//" + host + "/" + result.header.next + '.htm'; thankYouBaby(result.header.command); } } else if (result.header.command=="contact") { if (result.header.status=="OK") { thankYouBaby(result.header.command); } } else if (result.header.command=="bulletin") { if (result.header.status=="OK") { thankYouBaby(result.header.command); } } } } catch(e) { alert("Broken! - " + e);} //XXX Remove the alert } else { alert('There was a problem with the URL: ' + http_request.status); } http_request = null; normalCursor(); } } // sendRequest // ----------- // // Send a HTTP request. // // Parameters // method - "GET" or "Post" // url - The URL // args - arguments for the URL in the format "name=value&anothername=othervalue&so=on" // null if no arguments to be passed // // Returns false // var ie_http_requests = [ "MSXML2.XMLHTTP.5.0", "MSXML2.XMLHTTP.4.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP" ]; function sendRequest(method, url, args) { var isIE = false; waitCursor(); if (debug) { alert("sendRequest("+method+", "+url+", " + args + ")"); } if (window.XMLHttpRequest) { // Mozilla, Safari,... http_request = new XMLHttpRequest(); } else if (window.ActiveXObject) { // IE ifIE = true; for (var i=0; i= 0) { if (select.options) { ret = select.options[selectedIndex]; } } } return ret; } function doRegister() { var surname=document.contact_form.surname.value; var firstname=document.contact_form.firstname.value; var email=document.contact_form.email.value; var telephone=document.contact_form.telephone.value; var company=document.contact_form.company.value; var country=document.contact_form.country.value; var occupation=document.contact_form.occupation.value; var comments=document.contact_form.comments.value; var promotionsOK=false; var cmd=document.contact_form.page.value; var next=document.contact_form.next.value; var cgi_script = "/cgi-bin/contact.pl"; var host = document.location.host; if (document.contact_form.promotionsOK.checked) { promotionsOK=document.contact_form.promotionsOK.checked; } else if (document.contact_form.promotionsOK) { promotionsOK=document.contact_form.promotionsOK.value; } // The pressures of deadlines and poor infrastructure make me feel // ashamed of this XXX if (host.indexOf('bluetoad')>=0) { cgi_script = "/cgi-bin/breezway/contact.pl"; } // if (bCancel) { // self.close(); //TODO Fix for firefox // } // else { var f="surname="+surname+"&"+"firstname="+firstname+"&"+"email="+email+"&"+"telephone="+telephone+"&"+"promotionsOK="+promotionsOK+"&"+"occupation="+occupation+"&"+"country="+country+"&"+"company="+company+"&"+"cmd="+cmd+"&"+"next="+next+"&"+"comments="+comments; sendRequest("POST", cgi_script, f); // } return false; } function doCancel() { var next=document.contact_form.next.value; var host = document.location.host; var protocol = document.location.protocol; // also gives you a colon document.location = protocol + "//" + host + "/" + next + '.htm'; return false; } function thankYouBaby(cmd) { if (cmd == "contact") { window.open('/thankyou_contact.htm', 'thanks', 'width=400,height=100,,statusbar=no,toolbar=no,scollbars=no,bookmarks=no'); } else if (cmd == "register") { window.open('/thankyou_register.htm', 'thanks', 'width=400,height=100,,statusbar=no,toolbar=no,scollbars=no,bookmarks=no'); } else if (cmd == "bulletin") { window.open('/thankyou_bulletin.htm', 'thanks', 'width=400,height=100,,statusbar=no,toolbar=no,scollbars=no,bookmarks=no'); } else if (cmd == "veiled_register") { window.open('/thankyou_register.htm', 'thanks', 'width=400,height=100,,statusbar=no,toolbar=no,scollbars=no,bookmarks=no'); } } function waitCursor() { document.body.style.cursor='wait'; } function normalCursor() { document.body.style.cursor='auto'; }