function createHTTPObject() { var req; if(window.XMLHttpRequest){ // Firefox, Safari, Opera... req = new XMLHttpRequest(); } else if(window.ActiveXObject) { // Internet Explorer 5+ req = new ActiveXObject("Microsoft.XMLHTTP"); } else { alert('Problem creating the XMLHttpRequest object'); } return req; } var current_button = null; function changeItem(irw,pid) { var br = sChangeContentBoth(irw); var rb = replaceButton(pid); } // function changeItem(irw,pid) { // var rb = replaceButton(pid); // var lr = sChangeContentLeft(irw); // var rr = sChangeContentRight(irw); // } function replaceButton(pid) { if(current_button!=null) { var on = current_button + '_on'; var off = current_button; document.getElementById(on).style.display='none'; document.getElementById(off).style.display='block'; } var on = pid + '_on'; var off = pid; document.getElementById(off).style.display='none'; document.getElementById(on).style.display='block'; current_button = pid; return null; } function sChangeContentBoth(irw) { var url = (!irw) ? '/publications/content/both/' : '/publications/content/both/'+irw+'/'; var result = doReplace(url,'BothContent'); return null; } function sChangeContentLeft(irw) { var url = (!irw) ? '/publications/content/left/' : '/publications/content/left/'+irw+'/'; var result = doReplace(url,'LeftContent'); return null; } function sChangeContentRight(irw) { var url = (!irw) ? '/publications/content/right/' : '/publications/content/right/'+irw+'/'; var result = doReplace(url,'RightContent'); return null; } function doReplace(url,id) { var http = createHTTPObject(); http.open('get',url); http.onreadystatechange = function() { if (http.readyState == 4 && http.status == 200) { var response = http.responseText; // alert('response:' + response); if(response) { document.getElementById(id).innerHTML = http.responseText; } } } http.send(null); return null; } function orderWindow() { var orderWindow; orderWindow = window.open('/publications/order/','pub_order','width=670,height=680') } function orderWindowClose() { var test = confirm('Are you sure you want to cancel? Any information you have provided will be lost.'); if(test) { window.close(); } }