function getPage(link) { document.location = link; } function getOrder(orderid) { document.location = "../Showorders.php?oid="+orderid; } function showOrders() { if(document.getElementById("myorders").style.display == "block") { document.getElementById("myorders").style.display = "none"; return; } else { document.getElementById("myorders").style.display = "block"; } } // end show orders var req4; function loadXMLDoc4(url) { // branch for native XMLHttpRequest object if (window.XMLHttpRequest) { req4 = new XMLHttpRequest(); req4.onreadystatechange = processReqChange4; req4.open("GET", url, true); req4.send(null); // branch for IE/Windows ActiveX version } else if (window.ActiveXObject) { req4 = new ActiveXObject("Microsoft.XMLHTTP"); if (req4) { req4.onreadystatechange = processReqChange4; req4.open("GET", url, true); req4.send(); } } } // end load XML function function processReqChange4() { if (req4.readyState == 4) { // only if "OK" if (req4.status == 200) { // ...processing statements go here... response = req4.responseXML.documentElement; method = response.getElementsByTagName('method')[0].firstChild.data; result = response.getElementsByTagName('result')[0].firstChild.data; eval(method + '(\'\', result)'); } else { alert("There was a problem retrieving the XML data:\n" + req4.statusText); } } }// end function function checkMyName(input,response) { // alert(response); // return; if (response != ''){ if(response == 1) { //we found a match in our database alert("That account name is already in our system.\n Please choose another."); document.myinfo.cpusername.value = ""; //reset account name document.myinfo.cpusername.focus(); //set form focus return; }if(response ==0) { } } else { //initial function call // Input mode url = '../checkmyusername.php?q='+input; // alert(url); loadXMLDoc4(url); } } function downloadIssue(fileid) { // alert(fileid); document.location = "../downloadissue.php?fid="+fileid; } function downloademedia(fileid) { // alert(fileid); document.location = "../downloademedia.php?fid="+fileid; } function setStateFields(formid,value) { if(value == 'United States') { document.getElementById('usstate').style.display=''; document.getElementById('intlstate').style.display='none'; document.getElementById('canprov').style.display='none'; document.getElementById('bcc').style.display = 'none'; } else if(value == 'Canada') { document.getElementById('canprov').style.display=''; document.getElementById('intlstate').style.display='none'; document.getElementById('usstate').style.display='none'; document.getElementById('bcc').style.display = ''; getShipCountryCode(document.forms[formid].billing_country[document.forms[formid].billing_country.selectedIndex].value,'',formid); } else { document.getElementById('intlstate').style.display=''; document.getElementById('canprov').style.display='none'; document.getElementById('usstate').style.display='none'; document.getElementById('bcc').style.display = ''; getShipCountryCode(document.forms[formid].billing_country[document.forms[formid].billing_country.selectedIndex].value,'',formid); } } function setShipStateFields(formid,value,shipid) { // alert(shipid); // return; if(shipid == "") { if(value == 'United States') { document.getElementById('shipusstate').style.display=''; document.getElementById('shipintlstate').style.display='none'; document.getElementById('shipcanprov').style.display='none'; document.getElementById('shipbcc').style.display = 'none'; } else if(value == 'Canada') { document.getElementById('shipcanprov').style.display=''; document.getElementById('shipintlstate').style.display='none'; document.getElementById('shipusstate').style.display='none'; document.getElementById('shipbcc').style.display = ''; getShipCountryCode(document.forms[formid].shipping_country[document.forms[formid].shipping_country.selectedIndex].value,'',formid); } else { document.getElementById('shipintlstate').style.display=''; document.getElementById('shipcanprov').style.display='none'; document.getElementById('shipusstate').style.display='none'; document.getElementById('shipbcc').style.display = ''; getShipCountryCode(document.forms[formid].shipping_country[document.forms[formid].shipping_country.selectedIndex].value,'',formid); } } else { if(value == 'United States') { document.getElementById('shipusstate_'+shipid).style.display=''; document.getElementById('shipintlstate_'+shipid).style.display='none'; document.getElementById('shipcanprov_'+shipid).style.display='none'; document.getElementById('shipbcc_'+shipid).style.display = 'none'; } else if(value == 'Canada') { document.getElementById('shipcanprov_'+shipid).style.display=''; document.getElementById('shipintlstate_'+shipid).style.display='none'; document.getElementById('shipusstate_'+shipid).style.display='none'; document.getElementById('shipbcc_'+shipid).style.display = ''; getShipCountryCode(document.forms[formid].shipping_country[document.forms[formid].shipping_country.selectedIndex].value,'',formid); } else { document.getElementById('shipintlstate_'+shipid).style.display=''; document.getElementById('shipcanprov_'+shipid).style.display='none'; document.getElementById('shipusstate_'+shipid).style.display='none'; document.getElementById('shipbcc_'+shipid).style.display = ''; getShipCountryCode(document.forms[formid].shipping_country[document.forms[formid].shipping_country.selectedIndex].value,'',formid); } } } function checkShipping(formid,the_email) { // alert(formid); // return; var err_read = ""; var error_fields = new Array(); var statefrom; if (document.forms[formid].shipping_fname.value == "") { err_read += "You must provide your first name.\n"; error_fields[error_fields.length] = "shipping_fname"; } if (document.forms[formid].shipping_lname.value == "") { err_read += "You must provide your last name.\n"; error_fields[error_fields.length] = "shipping_lname"; } if (!document.forms[formid].shipping_country.selectedIndex > 0){ err_read += "You must provide your Country\n"; error_fields[error_fields.length] = "shipping_country"; } n = document.forms[formid].shipping_country.selectedIndex; if (document.forms[formid].shipping_addr1.value == "") { err_read += "You must provide your address.\n"; error_fields[error_fields.length] = "shipping_addr1"; } if (document.forms[formid].shipping_city.value == "") { err_read += "You must provide your city.\n"; error_fields[error_fields.length] = "shipping_city"; } if (document.forms[formid].shipping_country[n].value == "United States"){ statefrom = "shipus_state"; //set flag to let php know where shipping state field is comming from if (!document.forms[formid].shipus_state.selectedIndex > 0){ err_read+= "You must indicate your State.\n"; error_fields[error_fields.length] = "shipus_state"; } } if (document.forms[formid].shipping_country[n].value == "Canada"){ statefrom = "shipcan_prov"; //set flag to let php know where shipping state field is comming from if (!document.forms[formid].shipcan_prov.selectedIndex > 0){ err_read += "You must indicate your Province.\n"; error_fields[error_fields.length] = "shipcan_prov"; } } if (document.forms[formid].shipping_country[n].value != "Canada" && document.forms[formid].shipping_country[n].value != "United States" ){ statefrom = "shipintl_state"; //set flag to let php know where shipping state field is comming from if (document.forms[formid].shipintl_state.value == "") { err_read += "You must provide your Province/Region/State information\n"; error_fields[error_fields.length] = "shipintl_state"; } } if (document.forms[formid].shipping_zip.value == "") { err_read += "You must provide your postal code.\n"; error_fields[error_fields.length] = "shipping_zip"; } if (document.forms[formid].shipping_phone.value == "") { err_read += "You must provide your phone.\n"; error_fields[error_fields.length] = "shipping_phone"; } if (err_read == "") { document.forms[formid].state.value = statefrom; document.forms[formid].submit(); } else { err_read = "We found the following omissions in your form: \n" + err_read; var thefield = error_fields[0]; alert(err_read); document.forms[formid][thefield].focus(); } } // end check shipping form function checkUser(formid,the_email) { // alert(formid); // return; var err_read = ""; var error_fields = new Array(); var statefrom; if (document.forms[formid].billing_fname.value == "") { err_read += "You must provide your first name.\n"; error_fields[error_fields.length] = "billing_fname"; } if (document.forms[formid].billing_lname.value == "") { err_read += "You must provide your last name.\n"; error_fields[error_fields.length] = "billing_lname"; } if (document.forms[formid].billing_email.value == "") { err_read += "You must provide your email address.\n"; error_fields[error_fields.length] = "billing_email"; } var emailok = ""; var the_at = the_email.indexOf("@"); var the_dot = the_email.lastIndexOf("."); var a_space = the_email.indexOf(" "); if ((the_at != -1) && (the_at != 0) && (the_dot != -1) && (the_dot > the_at +1) && (the_dot < the_email.length -1) && (a_space == -1)) { emailok == "1"; } else { emailok == ""; err_read += "Your email address is not in the correct format.\n"; error_fields[error_fields.length] = "billing_email"; } if (!document.forms[formid].billing_country.selectedIndex > 0){ err_read += "You must provide your Country\n"; error_fields[error_fields.length] = "billing_country"; } n = document.forms[formid].billing_country.selectedIndex; if (document.forms[formid].billing_addr1.value == "") { err_read += "You must provide your address.\n"; error_fields[error_fields.length] = "billing_addr1"; } if (document.forms[formid].billing_city.value == "") { err_read += "You must provide your city.\n"; error_fields[error_fields.length] = "billing_city"; } if (document.forms[formid].billing_country[n].value == "United States"){ statefrom = "us_state"; //set flag to let php know where billing state field is comming from if (!document.forms[formid].us_state.selectedIndex > 0){ err_read+= "You must indicate your State.\n"; error_fields[error_fields.length] = "us_state"; } } if (document.forms[formid].billing_country[n].value == "Canada"){ statefrom = "can_prov"; //set flag to let php know where billing state field is comming from if (!document.forms[formid].can_prov.selectedIndex > 0){ err_read += "You must indicate your Province.\n"; error_fields[error_fields.length] = "can_prov"; } } if (document.forms[formid].billing_country[n].value != "Canada" && document.forms[formid].billing_country[n].value != "United States" ){ statefrom = "intl_state"; //set flag to let php know where billing state field is comming from if (document.forms[formid].intl_state.value == "") { err_read += "You must provide your Province/Region/State information\n"; error_fields[error_fields.length] = "intl_state"; } } if (document.forms[formid].billing_zip.value == "") { err_read += "You must provide your postal code.\n"; error_fields[error_fields.length] = "billing_zip"; } if (document.forms[formid].billing_phone.value == "") { err_read += "You must provide your phone.\n"; error_fields[error_fields.length] = "billing_phone"; } if (document.forms[formid].cpusername.value == "") { err_read += "You must provide a user name.\n"; error_fields[error_fields.length] = "cpusername"; } if (document.forms[formid].cppassword.value == "") { err_read += "You must provide a password.\n"; error_fields[error_fields.length] = "cppassword"; } if (document.forms[formid].confirmpass.value == "") { err_read += "You must confirm your password.\n"; error_fields[error_fields.length] = "confirmpass"; } if (document.forms[formid].cppassword.value != document.forms[formid].confirmpass.value) { err_read += "Your passwords do not match\n"; error_fields[error_fields.length] = "cppassword"; } if(document.forms[formid].security_question.selectedIndex < 1) { err_read += "You must select a Security Question\n"; error_fields[error_fields.length] = "security_question"; } if (document.forms[formid].security_answer.value == "") { err_read += "You must provide an answer to the Security Question\n"; error_fields[error_fields.length] = "security_answer"; } if (err_read == "") { document.forms[formid].state.value = statefrom; document.forms[formid].submit(); } else { err_read = "We found the following omissions in your form: \n" + err_read; var thefield = error_fields[0]; alert(err_read); document.forms[formid][thefield].focus(); } } // end check user form var req2; //variable used to establish an XML Http Request object //this javascript function establishes a socket connection in which //php script communication takes place - it passes user input and //communicates back XML document results built by the php script function loadXMLDoc2(url) { // branch for native XMLHttpRequest object if (window.XMLHttpRequest) { req2 = new XMLHttpRequest(); req2.onreadystatechange = processReqChange2; req2.open("GET", url, true); req2.send(null); // branch for IE/Windows ActiveX version } else if (window.ActiveXObject) { req2 = new ActiveXObject("Microsoft.XMLHTTP"); if (req2) { req2.onreadystatechange = processReqChange2; req2.open("GET", url, true); req2.send(); } } } //this JavaScript function processes the response from the php //script - basically it parses the XML response into useable strings function processReqChange2() { // only if req2 shows "complete" if (req2.readyState == 4) { //redyState of 4 siginifies a completed script if (req2.status == 200) { //status of 200 means that we have no errors in communication //we are assigning our xml document to an object so that //we can parse the individual tags into useable variables response = req2.responseXML.documentElement; method = response.getElementsByTagName('method')[0].firstChild.data; //this is the name of the original calling function result = response.getElementsByTagName('result')[0].firstChild.data; //this is the name of the country code formid = response.getElementsByTagName('formid')[0].firstChild.data; //this is the name of the country code //now that we have parsed the data we must pass it back to our original calling function by using the eval method. eval(method + '(\'\', result, formid)'); }else{ //if status not 200 then we need to alert the error alert("There was a problem retrieving the XML data:\n" + req2.statusText); } } //end our "only process when finished" check } //end processing function function getCountryCode(input, response, formid) { if (response != ''){ if(response != 0) { //we found a match in our database document.forms[formid].billing_country_code.value = "+" + response; } }else{ //initial function call url = 'getmycountrycode.php?var=' + input +'&f='+formid; loadXMLDoc2(url); } } function getShipCountryCode(input, response, formid) { if (response != ''){ if(response != 0) { //we found a match in our database document.forms[formid].shipping_country_code.value = "+" + response; } }else{ //initial function call url = 'getmycountrycode.php?var=' + input +'&f='+formid; loadXMLDoc2(url); } } var req5; var shipping_fname = ""; var shipping_lname = ""; var shipping_addr1 = ""; var shipping_addr2 = ""; var shipping_city = ""; var shipping_state = ""; var shipping_zip = ""; var shipping_country = ""; var shipping_phone = ""; var shipping_email = ""; var shipping_country_code; function loadXMLDoc5(url) { // branch for native XMLHttpRequest object if (window.XMLHttpRequest) { req5 = new XMLHttpRequest(); req5.onreadystatechange = processReqChange5; req5.open("GET", url, true); req5.send(null); // branch for IE/Windows ActiveX version } else if (window.ActiveXObject) { req5 = new ActiveXObject("Microsoft.XMLHTTP"); if (req5) { req5.onreadystatechange = processReqChange5; req5.open("GET", url, true); req5.send(); } } } // end load XML function function processReqChange5() { if (req5.readyState == 4) { // only if "OK" if (req5.status == 200) { // ...processing statements go here... shipping_fname = ""; shipping_lname = ""; shipping_addr1 = ""; shipping_addr2 = ""; shipping_city = ""; shipping_state = ""; shipping_zip = ""; shipping_country = ""; shipping_phone = ""; shipping_email = ""; shipping_country_code = ""; response = req5.responseXML.documentElement; method = response.getElementsByTagName('method')[0].firstChild.data; result = response.getElementsByTagName('result')[0].firstChild.data; formid = response.getElementsByTagName('formid')[0].firstChild.data; // alert(formid); // return; if(response.getElementsByTagName('shipping_fname')[0].firstChild != null) { shipping_fname = response.getElementsByTagName('shipping_fname')[0].firstChild.data; } if(response.getElementsByTagName('shipping_lname')[0].firstChild != null) { shipping_lname = response.getElementsByTagName('shipping_lname')[0].firstChild.data; } if(response.getElementsByTagName('shipping_addr1')[0].firstChild != null) { shipping_addr1 = response.getElementsByTagName('shipping_addr1')[0].firstChild.data; } if(response.getElementsByTagName('shipping_addr2')[0].firstChild != null) { shipping_addr2 = response.getElementsByTagName('shipping_addr2')[0].firstChild.data; } if(response.getElementsByTagName('shipping_city')[0].firstChild != null) { shipping_city = response.getElementsByTagName('shipping_city')[0].firstChild.data; } if(response.getElementsByTagName('shipping_state')[0].firstChild != null) { shipping_state = response.getElementsByTagName('shipping_state')[0].firstChild.data; } if(response.getElementsByTagName('shipping_zip')[0].firstChild != null) { shipping_zip = response.getElementsByTagName('shipping_zip')[0].firstChild.data; } if(response.getElementsByTagName('shipping_country')[0].firstChild != null) { shipping_country = response.getElementsByTagName('shipping_country')[0].firstChild.data; } if(response.getElementsByTagName('shipping_phone')[0].firstChild != null) { shipping_phone = response.getElementsByTagName('shipping_phone')[0].firstChild.data; } if(response.getElementsByTagName('shipping_email')[0].firstChild != null) { shipping_email = response.getElementsByTagName('shipping_email')[0].firstChild.data; } // alert(shipping_fname); // return; eval(method + '(\'\', result, formid)'); } else { alert("There was a problem retrieving the XML data:\n" + req5.statusText); } } }// end function function getShipping(input, response, formid) { if (response != ''){ // alert(shipping_fname); // return; document.forms[formid].shipping_fname.value = shipping_fname; document.forms[formid].shipping_lname.value = shipping_lname; if(shipping_country != "" && shipping_country != null) { for(var y=0; y < document.forms[formid].shipping_country.length; y++) { var thisvalue = document.forms[formid].shipping_country.options[y].value; if(thisvalue.toUpperCase() == shipping_country.toUpperCase()) { document.forms[formid].shipping_country.options[y].selected = true; } } } document.forms[formid].shipping_addr1.value = shipping_addr1; document.forms[formid].shipping_addr2.value = shipping_addr2; document.forms[formid].shipping_city.value = shipping_city; //country logic if(shipping_country) { var us = "United States"; var canada = "Canada"; if(shipping_country.toUpperCase() == us.toUpperCase()) { if(shipping_state != "" && shipping_state != null) { for(var x=0; x < document.forms[formid].shipus_state.length; x++) { var thisstate = document.forms[formid].shipus_state.options[x].value; if(thisstate.toUpperCase() == shipping_state.toUpperCase()) { document.forms[formid].shipus_state.options[x].selected = true; } } } } else if(shipping_country.toUpperCase() == canada.toUpperCase()) { document.getElementById('shipcanprov_'+response).style.display=''; document.getElementById('shipintlstate_'+response).style.display='none'; document.getElementById('shipusstate_'+response).style.display='none'; if(shipping_state != "" && shipping_state != null) { for(var x=0; x < document.forms[formid].shipcan_prov.length; x++) { var thisstate = document.forms[formid].shipcan_prov.options[x].value; if(thisstate.toUpperCase() == shipping_state.toUpperCase()) { document.forms[formid].shipcan_prov.options[x].selected = true; } } } } else { document.getElementById('shipintlstate_'+response).style.display=''; document.getElementById('shipcanprov_'+response).style.display='none'; document.getElementById('shipusstate_'+response).style.display='none'; document.forms[formid].shipintl_state.value = shipping_state; } } else { for(var x=0; x < document.forms[formid].shipping_country.length; x++) { if(document.forms[formid].shipping_country.options[x].value == "United States") { document.forms[formid].shipping_country.options[x].selected = true; } } } document.forms[formid].shipping_zip.value = shipping_zip; document.forms[formid].shipping_phone.value = shipping_phone; document.forms[formid].shipping_email.value = shipping_email; return; } else { //initial function call // Input mode url = 'cpshippingdata.php?q='+input+'&f='+formid; // alert(url); // return; loadXMLDoc5(url); } } // end function var mempub = "pubcontent_0"; var volarray = new Array(); function showVols(subid,pubid,bgcolor) { var pubcontent = "pubcontent_" + subid; // alert(pubcontent); if(mempub != "pubcontent_0") { if(mempub != pubcontent) { if(document.getElementById(mempub).style.display == "block") { document.getElementById(mempub).style.display = "none"; } } } mempub = pubcontent; if(document.getElementById(pubcontent).style.display == "block") { document.getElementById(pubcontent).style.display = "none"; return; } else { document.getElementById(pubcontent).style.display = "block"; } var thisform = "
| \n";
thisform += " Available Volumes: \n";
thisform += " \n";
thisform += " | \n";
thisform += "
| \n"; thisform += " |