/* The following script is owned by media-i 2006 */ /* You may not use this without the permission of media-i in any digital form */ var mailvalue=""; function createRequestObject(){ var http_request = false; if (window.XMLHttpRequest) { // Mozilla, Safari,... http_request = new XMLHttpRequest(); if (http_request.overrideMimeType) { http_request.overrideMimeType('text/xml'); // See note below about this line } } else if (window.ActiveXObject) { // IE try { http_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } if (!http_request) { alert('Giving up :( Cannot create an XMLHTTP instance'); return false; } return http_request; //return the object } /* Function called to get the product categories list */ function getmySupport(){ /* Create the request. The first argument to the open function is the method (POST/GET), and the second argument is the url... document contains references to all items on the page We can reference document.form_category_select.select_category_select and we will be referencing the dropdown list. The selectedIndex property will give us the index of the selected item. */ http.open('post','../ajax-scripts/support-mail.php'); /* Define a function to call once a response has been received. This will be our handleProductCategories function that we define below. */ http.onreadystatechange = supportreminder; /* Send the data. We use something other than null when we are sending using the POST method. */ /* use this for the post method */ http.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); // get the data from the login html form changes variables according to the data comming in from the form mymail=document.support.useremail.value; myquestion=document.support.userquestion.value; mailvalue = validateEmail(mymail); if (mailvalue){ http.send('email='+mymail+'&comments='+ myquestion); } } /* Function called to handle the list that was returned from the internal_request.php file.. */ function supportreminder(){ /* Make sure that the transaction has finished. The XMLHttpRequest object has a property called readyState with several states: 0: Uninitialized 1: Loading 2: Loaded 3: Interactive 4: Finished */ if(http.readyState != 4 || mailvalue==false) { document.getElementById("loading").style.display = 'block'; } if(http.readyState == 4){ //Finished loading the response /* using the responseText property of the XMLHttpRequest object. */ var response = http.responseText; /* And now we want to change the