﻿var shipping = "<b>Shipping Information</b><br><br>To get shipping quote add this product to the shopping cart.  You are under no obligation to buy.<br/><br/>For domestic orders, we offer shipping by UPS and Fedex.  For international orders, we offer shipping via Fedex.";
var warranty = "<b>Warranty Information</b><br><br>Rubicon Express products are warranted to be free from material and workmanship defects for as long as the original purchaser owns the vehicle the Rubicon product was originally installed on (proof of purchase is required).  This warranty is non-transferable. Rubicon Express is not responsible for any incidental or consequential damages such as, labor fees, loss of use, loss of time and freight associated with the failure of any products. Any product that has been abused, altered, incorrectly installed or used in competition and races is not covered.  Rubicon Express does not warrant any product finish. This Limited Lifetime warranty excludes the following Rubicon Express items: bushings, bump stops, tie rod end, races, heim joints. These parts are subject to wear and are not considered defective when worn. Leaf springs and coils are also wearable items and will only be considered as a case by case situation. Digital photos of the leaf springs and coils installed on the vehicle will need to be taken and turned in prior to approval of a Return Authorization Number (RGA).";
var ordering = "<b>To order, please call: 877-367-7824</b>";

function showPopup(id) {
    var cont = document.getElementById('popup');

    cont.style.top = "250px";
    cont.style.left = "400px";

    var closeUrl = "document.getElementById('popup').style.display='none';";

    var innerHtml = "<table width='250px' height='200px' cellpadding='0' style='background-color:#7F0000; margin:0px; padding:0px; border-style=solid; border-width:1px; border-color:#7F0000;' id='dynLargeTable'>"
        + "<tr height='19px'><td style='padding:0px;margin:0px;background-color:#7F0000'>"
            + "</td>"
        	+ "<td style='padding:0px;margin:0px;background-color:#7F0000'><a align=right href=\"javascript: var x =" + closeUrl + ";\">"
            + "<img border=0 align=right src='/Img/Product/xBox.gif' ></a></td></tr>"
        + "<tr><td colspan=2 style='padding:0px;margin:0px;background-color:#ffffff' valign=top><table cellpadding=5px><tr><td valign=top>"
        + window[id]
        + "</td><tr></table></td></tr>"
        + "</table>";
    cont.innerHTML = innerHtml;
    cont.style.position = "absolute";
    cont.style.display = 'block';

}

function expandImageCentered(imgId, imgSrc, e, obj) {
    //var pnt = getPoint ( e );
    var id = imgId + "_container";
    var smImageId = imgId + "_sm_Image";
    var parentid = imgId + "_abs_container";
    var cont = document.getElementById(id);
    var smImg = document.getElementById(smImageId);

    cont.style.top = "125px";
    cont.style.left = "140px";

    if (cont.style.display == 'none') {
        cont.style.display = 'block';
    }
    else {

        //var divText = "<div class='largeFloatSnp'  id='largeFloatImg' ></div>";
        var lgImg = new Image();
        lgImg.src = imgSrc;
        var cnt = 0;
        var dynSrc = imgSrc;
        var dynImgID = "dyn_lg_" + imgId;

        var closeUrl = "document.getElementById('" + id + "').style.display='none';";

        var innerHtml = "<table cellpadding='0' style='background-color:#7F0000; margin:0px; padding:0px; border-style=solid; border-width:1px; border-color:#7F0000;' id='dynLargeTable'>"
            + "<tr height='19px'><td style='padding:0px;margin:0px;background-color:#7F0000'>"
                + "</td>"
            	+ "<td style='padding:0px;margin:0px;background-color:#7F0000'><a align=right href=\"javascript: var x =" + closeUrl + ";\">"
                + "<img border=0 align=right src='/Img/Product/xBox.gif' ></a></td></tr>"
            + "<tr><td colspan=2 style='padding:0px;margin:0px;background-color:#ffffff'><a href=\"javascript: var x =" + closeUrl + ";\">"
                + "<img id='" + dynImgID + "' border=0 src='" + dynSrc + "'></a></td></tr>"
            + "</table>";
        cont.innerHTML = innerHtml;
        cont.style.position = "absolute";

    }

}

function swImg(img) {

    if (img.realImg.complete) {
        img.src = img.realImg.src;
        if (img.realImg.width > 100) {
            img.width = img.realImg.width;
        }
    }
    else {
        setTimeout(function() { swImg(img); }, 10);
    }
}

function isNumeric(sText) {
    var ValidChars = "0123456789.";
    var Char;

    for (i = 0; i < sText.length; i++) {
        Char = sText.charAt(i);
        if (ValidChars.indexOf(Char) == -1)
            return false;
    }
    return true;
}

function validateQty() {
    var txtQty = document.getElementById("txtQuantity");
    alert(isNumeric(txtQty.value));
    return false;
    if (isNumeric(txtQty.value)) {
        var lblQty = document.getElementById("invalidQty");
        lblQty.style.visibility = visible;
        return false;
    }
    return true;
}

