infobasepublishing.com Open in urlscan Pro
52.200.113.215  Public Scan

Submitted URL: http://infobasepublishing.com/Common/js/common.js
Effective URL: https://infobasepublishing.com/Common/js/common.js
Submission: On February 23 via api from CH — Scanned from DE

Form analysis 0 forms found in the DOM

Text Content

// var SecurePagePrefix = "http://localhost:56362/";
//var SecurePagePrefix = "https://beta.infobasepublishing.com/";
var SecurePagePrefix = "https://www.infobasepublishing.com/";
function doSimpleSearch(txtKeywordID) {

    // var o = $(txtKeywordID);
    var o = document.getElementById(txtKeywordID).value;

    if (o) {
        RemoveIllegalCharacters();
        window.location.href = "/search.aspx?q=" + URLEncode(o);
    }

    return false;
}

//use this function to strip unsafe postback characters from textboxes
//on your page.  only use this when you these characters are not necessary to the data.
function RemoveIllegalCharacters() {
    for (var i = 0; i < document.forms[0].elements.length; i++) {
        var elem = document.forms[0].elements[i];
        if (elem.type == 'text') {
            //this regular expression will replace ALL instances of the "<" character
            elem.value = elem.value.replace(new RegExp(/</g), "");

        }
    }

    //allow the post to continue
    return true;
}


// ====================================================================
//       URLEncode and URLDecode functions
//
// Copyright Albion Research Ltd. 2002
// http://www.albionresearch.com/
//
// You may copy these functions providing that 
// (a) you leave this copyright notice intact, and 
// (b) if you use these functions on a publicly accessible
//     web site you include a credit somewhere on the web site 
//     with a link back to http://www.albionresarch.com/
//
// If you find or fix any bugs, please let us know at albionresearch.com
//
// SpecialThanks to Neelesh Thakur for being the first to
// report a bug in URLDecode() - now fixed 2003-02-19.
// ====================================================================
function URLEncode(toEncode) {
    // The Javascript escape and unescape functions do not correspond
    // with what browsers actually do...
    var SAFECHARS = "0123456789" + 				// Numeric
					"ABCDEFGHIJKLMNOPQRSTUVWXYZ" + // Alphabetic
					"abcdefghijklmnopqrstuvwxyz" +
					"-_.!~*()"; 				// RFC2396 Mark characters
    var HEX = "0123456789ABCDEF";

    var plaintext = toEncode;
    var encoded = "";
    for (var i = 0; i < plaintext.length; i++) {
        var ch = plaintext.charAt(i);
        if (ch == " ") {
            encoded += "+"; 			// x-www-urlencoded, rather than %20
        } else if (SAFECHARS.indexOf(ch) != -1) {
            encoded += ch;
        } else if (ch == "<") {
            //do nothing
        } else {
            var charCode = ch.charCodeAt(0);
            if (charCode > 255) {
                alert("Unicode Character '"
						+ ch
						+ "' cannot be encoded using standard URL encoding.\n" +
						"(URL encoding only supports 8-bit characters.)\n" +
						"A space (+) will be substituted.");
                encoded += "+";
            } else {
                encoded += "%";
                encoded += HEX.charAt((charCode >> 4) & 0xF);
                encoded += HEX.charAt(charCode & 0xF);
            }
        }
    } // for

    return encoded;
}
function AddItemToCart(ISBN, GUID, isEbook, url) {
 //    sURL = unescape(window.location.href);
    //   window.location.href = sURL;

 // alert('test');
    var xmlHttp;
    try {
        // Firefox, Opera 8.0+, Safari
        xmlHttp = new XMLHttpRequest();
    }
    catch (e) {
        // Internet Explorer
        try {
            xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e) {
            try {
                xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (e) {
                alert("Your browser does not support AJAX!");
                return false;
            }
        }
    }
  // alert('test');
  //  xmlHttp.open("Get", SecurePagePrefix + "Cart.aspx?ISBN=" + ISBN + "&GUID=" + GUID + "&Action=Add&isEbook=" + isEbook, false);

    xmlHttp.open("Get", SecurePagePrefix + "Cart.aspx?ISBN=" + ISBN + "&GUID=" + GUID + "&Action=Add&isEbook=" + isEbook + "&returnurl=" + url, false);

    xmlHttp.send(null);
    document.location.reload();
   // window.location.reload();
   // window.location.href = window.location.href;
   // document.location.reload();
    // window.location = "/Cart.aspx?ISBN=" + ISBN + "&GUID=" + GUID + "&Action=Add&isEbook=" + isEbook + "&returnurl=" + url;
    // alert('test');
}

function test() {
    alert('test');
}

function DeleteShoppingCartItem(ISBN, GUID, isEbook, url) {
    var xmlHttp;
    try {
        // Firefox, Opera 8.0+, Safari
        xmlHttp = new XMLHttpRequest();
    }
    catch (e) {
        // Internet Explorer
        try {
            xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e) {
            try {
                xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (e) {
                alert("Your browser does not support AJAX!");
                return false;
            }
        }
    }

    xmlHttp.open("GET", SecurePagePrefix + "Cart.aspx?ISBN=" + ISBN + "&GUID=" + GUID + "&isEbook=" + isEbook + "&Action=Delete", false);
    xmlHttp.send(null);
    document.location.reload();
    //  window.location = "/Cart.aspx?ISBN=" + ISBN + "&GUID=" + GUID + "&isEbook=" + isEbook + "&Action=Delete&returnurl=" + url;
}

function DeleteAllCartItems(GUID) {
    var xmlHttp;
    try {
        // Firefox, Opera 8.0+, Safari
        xmlHttp = new XMLHttpRequest();
    }
    catch (e) {
        // Internet Explorer
        try {
            xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e) {
            try {
                xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (e) {
                alert("Your browser does not support AJAX!");
                return false;
            }
        }
    }

    xmlHttp.open("GET", SecurePagePrefix + "Cart.aspx?GUID=" + GUID + "&Action=DeleteAll", false);
    xmlHttp.send(null);
    document.location.reload();

}



function UpdateShoppingCartItem(ISBN, GUID, iseBook, txtid, url) {

    var str = document.getElementById(txtid).value;
    var xmlHttp;
    try {
        // Firefox, Opera 8.0+, Safari
        xmlHttp = new XMLHttpRequest();
    }
    catch (e) {
        // Internet Explorer
        try {
            xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e) {
            try {
                xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (e) {
                alert("Your browser does not support AJAX!");
                return false;
            }
        }
    }

    xmlHttp.open("GET", SecurePagePrefix + "Cart.aspx?ISBN=" + ISBN + "&GUID=" + GUID + "&isEbook=" + iseBook + "&Action=Update&Quantity=" + str, false);
    xmlHttp.send(null);
    document.location.reload();
    // window.location = "/Cart.aspx?ISBN=" + ISBN + "&GUID=" + GUID + "&isEbook=" + iseBook + "&Action=Update&Quantity=" + str + "&returnurl=" + url;

}
function AddItemToWishList(ISBN, GUID, isEbook, url) {
    //alert('test');
    var xmlHttp;
    try {
        // Firefox, Opera 8.0+, Safari
        xmlHttp = new XMLHttpRequest();
    }
    catch (e) {
        // Internet Explorer
        try {
            xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e) {
            try {
                xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (e) {
                alert("Your browser does not support AJAX!");
                return false;
            }
        }
    }

    xmlHttp.open("GET", "/WishList.aspx?ISBN=" + ISBN + "&GUID=" + GUID + "&Action=Add&isEbook=" + isEbook + "&returnurl=" + url, false);
    xmlHttp.send(null);
    document.location.reload();


    // window.location = "/WishList.aspx?ISBN=" + ISBN + "&GUID=" + GUID + "&Action=Add&isEbook=" + isEbook + "&returnurl=" + url;
}

function DeleteWishListItem(ISBN, GUID, isEbook, url) {
    //  var str = document.getElementById(txtid).value;
    var xmlHttp;
    try {
        // Firefox, Opera 8.0+, Safari
        xmlHttp = new XMLHttpRequest();
    }
    catch (e) {
        // Internet Explorer
        try {
            xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e) {
            try {
                xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (e) {
                alert("Your browser does not support AJAX!");
                return false;
            }
        }
    }

    xmlHttp.open("GET", "/WishList.aspx?ISBN=" + ISBN + "&GUID=" + GUID + "&isEbook=" + isEbook + "&Action=Delete", false);
    xmlHttp.send(null);
    document.location.reload();
    //window.location = "/WishList.aspx?ISBN=" + ISBN + "&GUID=" + GUID + "&isEbook=" + isEbook + "&Action=Delete&returnurl=" + url;
}

function UpdateWishListItem(ISBN, GUID, iseBook, txtid, url) {


    var str = document.getElementById(txtid).value;
    var xmlHttp;
    try {
        // Firefox, Opera 8.0+, Safari
        xmlHttp = new XMLHttpRequest();
    }
    catch (e) {
        // Internet Explorer
        try {
            xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e) {
            try {
                xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (e) {
                alert("Your browser does not support AJAX!");
                return false;
            }
        }
    }

    xmlHttp.open("GET", "/WishList.aspx?ISBN=" + ISBN + "&GUID=" + GUID + "&isEbook=" + iseBook + "&Action=Update&Quantity=" + str, false);
    xmlHttp.send(null);
    document.location.reload();
    //window.location = "/WishList.aspx?ISBN=" + ISBN + "&GUID=" + GUID + "&isEbook=" + iseBook + "&Action=Update&Quantity=" + str + "&returnurl=" + url;

}
function MoveWLItemtoCart(ISBN, GUID, iseBook, txtid, url) {


    // var str = document.getElementById(txtid).value;
    var xmlHttp;
    try {
        // Firefox, Opera 8.0+, Safari
        xmlHttp = new XMLHttpRequest();
    }
    catch (e) {
        // Internet Explorer
        try {
            xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e) {
            try {
                xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (e) {
                alert("Your browser does not support AJAX!");
                return false;
            }
        }
    }

    xmlHttp.open("GET", "/WishList.aspx?ISBN=" + ISBN + "&GUID=" + GUID + "&isEbook=" + iseBook + "&Action=Move", false);
    xmlHttp.send(null);
    document.location.reload();
    //  window.location = "/WishList.aspx?ISBN=" + ISBN + "&GUID=" + GUID + "&isEbook=" + iseBook + "&Action=Move&returnurl=" + url;
}

//DUMP ALL DATA FROM BILLING FORM INTO SHIPPING FORM, THIS IS OPTIONAL
function sameAsBilling() {

    if (document.getElementById('ctl00_MainContent_CBSameAsBilling').checked) {
        //  alert('test');
        document.getElementById('ctl00_MainContent_ucShipping_txtAccountNumber').value = document.getElementById('ctl00_MainContent_ucBilling_txtAccountNumber').value;
        document.getElementById('ctl00_MainContent_ucShipping_txtSchool').value = document.getElementById('ctl00_MainContent_ucBilling_txtSchool').value;
        document.getElementById('ctl00_MainContent_ucShipping_txtName').value = document.getElementById('ctl00_MainContent_ucBilling_txtName').value;
        document.getElementById('ctl00_MainContent_ucShipping_txtAddressLine1').value = document.getElementById('ctl00_MainContent_ucBilling_txtAddressLine1').value;
        document.getElementById('ctl00_MainContent_ucShipping_txtAddressLine2').value = document.getElementById('ctl00_MainContent_ucBilling_txtAddressLine2').value;
        document.getElementById('ctl00_MainContent_ucShipping_txtCity').value = document.getElementById('ctl00_MainContent_ucBilling_txtCity').value;
        document.getElementById('ctl00_MainContent_ucShipping_txtPostalCode').value = document.getElementById('ctl00_MainContent_ucBilling_txtPostalCode').value;
        document.getElementById('ctl00_MainContent_ucShipping_txtPhone').value = document.getElementById('ctl00_MainContent_ucBilling_txtPhone').value;
        document.getElementById('ctl00_MainContent_ucShipping_txtFax').value = document.getElementById('ctl00_MainContent_ucBilling_txtFax').value;

        document.getElementById('ctl00_MainContent_ucShipping_ddlStatesUS').selectedIndex = document.getElementById('ctl00_MainContent_ucBilling_ddlStatesUS').selectedIndex;
        document.getElementById('ctl00_MainContent_ucShipping_ddlCountry').selectedIndex = document.getElementById('ctl00_MainContent_ucBilling_ddlCountry').selectedIndex;
    }
    else {
        document.getElementById('ctl00_MainContent_ucShipping_txtAccountNumber').value = "";
        document.getElementById('ctl00_MainContent_ucShipping_txtSchool').value = "";
        document.getElementById('ctl00_MainContent_ucShipping_txtName').value = "";
        document.getElementById('ctl00_MainContent_ucShipping_txtAddressLine1').value = "";
        document.getElementById('ctl00_MainContent_ucShipping_txtAddressLine2').value = "";
        document.getElementById('ctl00_MainContent_ucShipping_txtCity').value = "";
        document.getElementById('ctl00_MainContent_ucShipping_txtPostalCode').value = "";
        document.getElementById('ctl00_MainContent_ucShipping_txtPhone').value = "";
        document.getElementById('ctl00_MainContent_ucShipping_txtFax').value = "";
        document.getElementById('ctl00_MainContent_ucShipping_ddlCountry').selectedIndex = 0;
        document.getElementById('ctl00_MainContent_ucShipping_ddlStatesUS').selectedIndex = 0;
    }




}
function CheckChangedSignIn(checkbox) {
    if (checkbox == 'cbYesCurrentAccount') {
        document.getElementById('ctl00_MainContent_cbYesCreateAccount').checked = false;
        document.getElementById('ctl00_MainContent_cbNoThanks').checked = false;
    }
    else if (checkbox == 'cbYesCreateAccount') {
        document.getElementById('ctl00_MainContent_cbYesCurrentAccount').checked = false;
        document.getElementById('ctl00_MainContent_cbNoThanks').checked = false;

    }
    else if (checkbox == 'cbNoThanks') {
        document.getElementById('ctl00_MainContent_cbYesCurrentAccount').checked = false;
        document.getElementById('ctl00_MainContent_cbYesCreateAccount').checked = false;

    }
}

function CheckChangedSignInEbook(checkbox) {
    if (checkbox == 'cbExistingAccount') {
        document.getElementById('ctl00_MainContent_cbNewAccount').checked = false;
    }
    else if (checkbox == 'cbNewAccount') {
        document.getElementById('ctl00_MainContent_cbExistingAccount').checked = false;

    }
}
function CheckChanged(checkbox) {

 
    if (checkbox == 'cbMailOrFax') {
        document.getElementById('ctl00_MainContent_cbCreditCard').checked = false;
        document.getElementById('ctl00_MainContent_cbBillME').checked = false;

    }
    else if (checkbox == 'cbCreditCard') {
        document.getElementById('ctl00_MainContent_cbMailOrFax').checked = false;
        document.getElementById('ctl00_MainContent_cbBillME').checked = false;
    }
    else if (checkbox == 'cbBillME') {
        document.getElementById('ctl00_MainContent_cbMailOrFax').checked = false;
        document.getElementById('ctl00_MainContent_cbCreditCard').checked = false;
    }
}
function validatePaymentOption() {

    window.location = "/OrderSummary.aspx";
    /*if (ctl00_MainContent_cbPurchaseOrder.checked) {

        if (document.getElementById('ctl00_MainContent_tbPurchaseOrderNumber').value == "") {

            alert('Please Enter a Purchase Order Number');
    return false;
    }
    }
    else if (ctl00_MainContent_cbCreditCard.checked) {
    if (document.getElementById('ctl00_MainContent_tbAccountName').value == "") {
    alert('Please Enter the Account Name');
    return false;
    }
    if (document.getElementById('ctl00_MainContent_tbExpirationDate').value == "") {
    alert('Please Enter the Account Number');
    return false;
    }
    if (document.getElementById('ctl00_MainContent_tbSecurityCode').value == "") {
    alert('Please Enter the Security Code');
    return false;
    }

    }
    else if (!ctl00_MainContent_cbCreditCard.checked && !ctl00_MainContent_cbPurchaseOrder.checked && !ctl00_MainContent_cbMailOrFax.checked) {
    alert('Please select a payment option.');
    return false;
    }
    else {
    window.location = "/OrderSummary.aspx";

    }
    window.location="/OrderSummary.aspx";*/


}

function PrintContent() {

    var WindowObject = window.open('', "PrintOrder", "width=100,height=100,top=0,left=0,toolbars=no,scrollbars=no,status=no,resizable=no");

    var PrintData = document.getElementById("tableWrap");

    var PriceData = document.getElementById("PricePrint")

    WindowObject.document.writeln("<html>\n<head>\n<style type='text/css'>\n#content\n{\nwidth: 600px;\n}\nbody\n{\nfont-family: verdana;\nmargin: 0px 0px 0px 0px;  \nfont-size: 8pt;\n}\ntable\n{\nfont-family: verdana; \nfont-size: 8pt;\n width:600px \n}\n.promo_box .left_flush\n{\n	padding: 0;\nmargin: 0 10px 0 0;	\ntext-align: right;\nfloat: right;\nheight: 85px;\nwidth: 200px;\nfont-family: verdana; \nfont-size: 8pt;\n}\n#right_flush\n{\npadding: 0;\nmargin: 0;\ntext-align: right;\nfloat: right;\nwidth: 100px;\nheight: 65px;\nborder: 0;\nfont-family: verdana; \nfont-size: 8pt;}</style>\n</head>\n<body><div id='content'>" + PrintData.innerHTML + "\n<div class='promo_box'>" + PriceData.innerHTML + "</div>\n</div></body>\n</html>");

    WindowObject.document.close();
    WindowObject.focus();
    WindowObject.print();
    WindowObject.close();
}



//var urls = new Array();
//urls[1] = "http://www.fofweb.com/Subscription/Default.asp";
//urls[2] = "http://www.fofweb.com/Demo/default.asp";
//function ToggleURL(x) {

   // url = urls[x];
//}
function formSubmit() {
    document.UserPassLogin.action = url;
    document.UserPassLogin.submit();
}

function launcheBookPopup(ISBN,Format,hardbook) {
    var url = "/PreviewBook.aspx?ISBN=" + ISBN + "&format=" + Format + "&hardbook=" + hardbook;
    
  



    var popup = window.open(url, "PreviewBook", "width=705,height=850,status=no,location=no,menubar=no,toolbar=no,resizable=no");

    popup.focus();

}

  function launchePubPopup(ISBN, Format) {
    var url = "/PreviewBook.aspx?ISBN=" + ISBN +  "&ePub=1" + "&format="+Format;
    var popup = window.open(url, "PreviewBook", "width=705,height=700,status=no,location=no,menubar=no,toolbar=no,resizable=no");

    popup.focus();

}

//function launcheBookTestDrivePopUp() {

   // window.open('http://ebooks.infobasepublishing.com/TestDrive', 'EbooksTestDrive', 'width=750px, high=600px, scrollbars=yes, resizable=yes');
//}
//function launchELMTestDrivePopUp() {

   // window.open('http://online.factsonfile.com/directpage.aspx?FWID=102492', 'ELMTestDrive', 'width=750px, high=600px, scrollbars=yes, sizable=yes');
//}
function SwapImage(imageID, imageURL) {

    var img = document.getElementById(imageID);

    if (img != null)
        img.src = imageURL;
}

function swapoffer() {
 //  alert('test');
    var obj = document.getElementById('ctl00_MainContent_hloffer');
    var ss = obj.className;

    var mtQuotes = new Array();

    mtQuotes[0] = 'bookLand1';

    mtQuotes[1] = 'bookLand2';

    mtQuotes[2] = 'bookLand3';

    mtQuotes[3] = 'bookLand4';
    do {
        var i = Math.round(0 + (3 - 0) * Math.random());
    }
    while (ss == mtQuotes[i]);

   // alert(i);


    obj.className = mtQuotes[i];
}

function setObjectVisibility(name, visibility, className) {

    var obj = document.getElementById(name);
    obj.style.visibility = visibility;
    obj.className = className;
}

function toggleElement(objID) {

    var obj = document.getElementById(objID);

    if (obj && obj.style) {
        if (obj.style.visibility == "hidden" || obj.style.visibility == "") {
            showElement(obj);
        }
        else {
            hideElement(obj);
        }
    }
}


function showElement(obj) {
    if (obj && obj.style) {
        obj.style.visibility = 'visible';
        obj.style.position = 'relative';
    }
}


// Hides a layer or other object
function hideElement(obj) {
    if (obj && obj.style) {
        obj.style.visibility = 'hidden';
        obj.style.position = 'absolute';
    }
}

function fulfillOrder() {
   
    var xmlHttp;
    try {
        // Firefox, Opera 8.0+, Safari
        xmlHttp = new XMLHttpRequest();
    }
    catch (e) {
        // Internet Explorer
        try {
            xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e) {
            try {
                xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (e) {
                alert("Your browser does not support AJAX!");
                return false;
            }
        }
    }

    xmlHttp.open("GET", "/OrderSummary.aspx?fulfillOrder=1", true);
    xmlHttp.send(null);

}