var img1 = new Image();
img1.src = "../images/home_over.jpg";
var img2 = new Image();
img2.src = "../images/tires_over.jpg";
var img3 = new Image();
img3.src = "../images/wheels_over.jpg";
var img4 = new Image();
img4.src = "../images/comm_services_over.jpg";
var img5 = new Image();
img5.src = "../images/services_over.jpg";
var img6 = new Image();
img6.src = "../images/warranty_over.jpg";
var img7 = new Image();
img7.src = "../images/location_over.jpg";
var img8 = new Image();
img8.src = "../images/about_over.jpg";

var sdetail = null;
var wdetail = null;

function rollimg(img, req) {
    if (0 == req) {
        document.getElementById(img).src = "../images/" + img + ".jpg";
    }
    else {
        document.getElementById(img).src = "../images/" + img + "_over.jpg";
    }
}

function rollnav(img, req) {
    if (0 == req) {
        document.getElementById(img).src = "../images/" + img + ".jpg";
    }
    else {
        document.getElementById(img).src = "../images/" + img + "_over.jpg";
    }
}

function coupon(id) {
    var link = "../coupon.aspx?id=" + id;
    var win = window.open(link, 'Coupon', 'width=338,height=255,toolbars=no,scrollbars=no');
}

function setLink(template) {
    document.getElementById('template').value = template;
    document.forms[0].submit();
}

function gotoCorporate(sID) {
    if(document.cookie.length > 0) {
        var start = document.cookie.indexOf('tfcookie=');
        if(start != -1) {
            start = start + 10;
            var end = document.cookie.indexOf(';',start);
            var ccontent = document.cookie.substring(start,end);
            var cvalues = ccontent.split(',');
            if('1' == cvalues[1]) {
                var exdate = new Date();
                exdate.setDate(exdate.getDate()-1);
                document.cookie="tfcookie=" + sID + ",0;expires=" + exdate.toGMTString() + ";path=/;";
            }
        }
    }
}

function details(val) {
    if (1 == val) {
        var display = "<p>All flats repaired <b>FREE</b> of charge for the life of the tire.</p>";
        document.getElementById("wDetails").innerHTML = display;
    }
    else if (2 == val) {
        var display = "<p>We recommend rotation of tires at least every 4,000 to 6,000 miles, or as needed to assure maximum mileage. Rotation does not include dismounts or mounts. Proof of rotation is required.</p>";
        document.getElementById("wDetails").innerHTML = display;
    }
    else if (3 == val) {
        var display = "<p>It is our policy to charge for the original tire balance. Should rebalancing be needed for any reason, the rebalancing will be FREE for the life of the tire.* May exclude tires that are 34 inches or larger in diameter or ? ton and larger vehicles.</p>";
        document.getElementById("wDetails").innerHTML = display;
    }
    else if (4 == val) {
        var display = "<p>Free air check is available at any time. Proper inflation is recommended at all times to ensure maximum mileage.</p>";
        document.getElementById("wDetails").innerHTML = display;
    }
    else if (5 == val) {
        var display = "<p>Tires will be inspected for irregular wear, cuts and snags at any time for the life of the tires.</p>";
        document.getElementById("wDetails").innerHTML = display;
    }
    else if (6 == val) {
        //var display = "<p></p>";
        //document.getElementById("wDetails").innerHTML = display;
        alert("There are no details to display at this time");
    }
    else if (7 == val) {
        //var display = "<p></p>";
        //document.getElementById("wDetails").innerHTML = display;
        alert("There are no details to display at this time");
    }
    else if (8 == val) {
        var display = "<p>Tire Factory offers <b>FREE</b> tire replacement for the first 30% of tread life if a tire fails due to workmanship, materials or normal road hazards. If failure for these reasons occurs during the first 30% of tread wear, tire will be replaced absolutely <b>FREE</b>, including services. After the first 30% of tread wear, the adjustment will be pro-rated based upon the original purchase price plus service excluding Federal Excise Tax, multiplied by the remaining tread down to 2/32. A tire is considered worn out at 2/32 for consumer safety.</p>";
        document.getElementById("wDetails").innerHTML = display;
    }
    else if (11 == val) {
        var display = "<p>The front end alignment or brake repair service listed on the attached invoice is covered by the Tire Factory warranty. The customer will be given service under this warranty upon bringing the vehicle and presenting the Warranty Contract with attached invoice to any Tire Factory location.</p>";
        display += "<p><b>Alignment Service</b><br>Tire Factory complete alignment service includes setting caster-camber and toe-in to individual specifications. Alignment service is warranted for six months or 6,000 miles, whichever occurs first. During this time Tire Factory will re-align your vehicle to specifications at no charge. Alignment parts sold and installed by Tire Factory are warranted for a period of 12 months. Parts that fail due to defects in materials or workmanship and show no signs of service neglect or abuse will be replaced absolutely free of charge. Misalignment or damage caused by abuse or collision is excluded.<br><br>Commercial application does not apply.</p>";
        document.getElementById("wDetails").innerHTML = display;
    }
    else if (9 == val) {
        var display = "<p>When installed on a private passenger car or light truck, a brake overhaul performed by Tire Factory is warranted for 36 months or 25,000 miles, whichever occurs first. A brake overhaul includes, but is not limited to, installation of new disc pads/brake linings, hold-down hardware, wheel cylinders and grease seals, reconditioning calipers, bearings repacked and resurfacing of drums/rotors if applicable. Customer abuse or neglect may void warranty.</p>";
        document.getElementById("wDetails").innerHTML = display;
    }
    else if (10 == val) {
        var display = "<p>A brake reline performed by Tire Factory is warranted for 12 months or 12,000 miles, whichever occurs first. A brake reline includes, but is not limited to, installation of new disc pads/brake linings, grease seals, bearings repacked and resurfacing of drums/rotors.</p>";
        display += "<p>Customer abuse or neglect may void warranty.</p>";
        document.getElementById("wDetails").innerHTML = display;
    }
    else if (12 == val) {
        var display = "<p>Shock absorbers and struts are subject to manufacturer&#39;s warranty</p>";
        display += "<p>Tire Factory will replace lifetime warranty shock absorbers or struts which fail on the vehicle to which they were originally installed free of charge (excluding labor) if the failure is due to defects in material or workmanship. This warranty will be upheld for the life of the shock absorber/strut purchased, to the original purchaser.</p>";
        document.getElementById("wDetails").innerHTML = display;
    }
    else if (13 == val) {
        var display = "<p>Except for consequential damages for injury to the person, the Tire Factory will not be responsible for any consequential damages arising out of a battery, shock/strut or tire failure. This warranty gives specific legal rights, and you may also have other rights which may vary from state to state. For instance, some states do not allow the exclusion or limitation of incidental or consequential damages, so the above limitation or exclusion may not apply to you.</p>";
        document.getElementById("wDetails").innerHTML = display;
    }
    else if (14 == val) {
        var display = "<p><b>First Year Free Battery Replacement</b><br>If your Tire Factory battery should fail any time within its first year (in the same vehicle), we will replace it absolutely <b>FREE</b> (excluding labor).</p>";
        display += "<p><b>Free Service Check</b><br>Battery checked any time upon your request at any of our locations.</p>";
        display += "<p><b>Free Battery Charge</b><br>Battery charged free during warranty period.</p>";
        display += "<p><b>Pro-Rated Replacement</b><br>Should your Tire Factory battery fail after the 12 month free replacement period and within the specified months of warranty (40-50-60-72) following the date of purchase (in the same vehicle), we will sell you a battery using the current price pro-rated by the months remaining in the warranty period.</p>";
        display += "<ul><b>Not Covered</b><br><br><li>Batteries that fail due to mechanical or electrical problems</li><li>Non-commercial batteries installed in vehicles used commercially or batteries reinstalled in another vehicle</li></ul>";
        document.getElementById("wDetails").innerHTML = display;
    }

}

function sendEmail(storemail) {
    var name = document.getElementById('name').value;
    var email = document.getElementById('email').value;
    //var phone = document.getElementById('phone').value;
    var comments = document.getElementById('comments').value;

    if ("" != name) {
        if ("" != email) {
            if ("" != comments) {
                document.getElementById('store_email').value = storemail;
                document.getElementById('email_submit').value = "true";
                document.forms[0].submit();
            }
            else {
                alert("You must enter a comment to continue");
            }
        }
        else {
            alert("You must enter your email to continue");
        }
    }
    else {
        alert("You must enter your name to continue");
    }
}

function more(val) {
    var display;
    if ("s1" == val) {
        display = "<p>The main component to your braking system pumps the brake fluid to the calipers or wheel cylinder when you depress the brake pedal. This pressure converts your physical pressure on the pedal to hydraulic pressure used to operate the wheel cylinder or calipers.</p>";
    }
    else if ("s2" == val) {
        display = "<p>These devices are used to convert the hydraulic pressure and exert the force needed on the brakes to stop the vehicle. Our Tire Factory technicians will inspect for leaks in the seals during your brake inspection.</p>";
    }
    else if ("s3" == val) {
        display = "<p>Your ABS system will be thoroughly checked during the brake inspection. The ABS is controlled electronically and is designed to detect braking problems and correct them.</p>";
    }
    else if ("s4" == val) {
        display = "<p>These components should be inspected frequently to check for wear on the linings. Our technician will exam the wear and will determine if the linings need to be replaced.</p>";
    }
    else if ("s5" == val) {
        display = "<p>Our technician will make sure your parking brake is in expected working condition by checking proper lubrication, adjustment, and corrosion.</p>";
    }
    else if ("f1" == val) {
         display = "<span><b>Why do my brakes squeal?</b></span>";
        display += "<p>Believe it or not, the most probable cause of this is most likely not a problem. Today&#39;s brake pads are made out of a different material than those in the past. These new semi-metallic brake pads seem to cause a certain amount of squealing today that is considered &quot;normal&quot;. Take notice of when you are hearing the squealing. If it occurs for the first little bit while the brakes are cold, when they are slightly wet from dew, or the last few feet of a stop are generally not a problem.</p>";
        display += "<p>Another cause of this squeal or grinding noise may be due to the device that is now designed into braking systems to alert you of worn brake pads. If you hear squeal or grinding in excess, bring your vehicle in to us and we would be more than happy to diagnose the problem for you and let you know if there is anything that needs to be addressed.</p>";
        display += "<p>Do not hesitate or procrastinate with possible braking problems. If you hear an unusual noise, experience any inconsistency with your braking, or have any questions at all, please come visit us right away so that we may assist you</p>";
    }
    else if ("f2" == val) {
        display = "<span><b>When should I have my brakes checked?</b></span>";
        display += "<p>If you have any of the symptoms listed below or anything else that concerns you bring your vehicle in and our technicians will correct the problem.</p>";
        display += "<p><b>Grinding</b> This sound is caused by metal-on-metal wear and tear that indicates your brake pads have been worn through. This could cause damage to the rotors and drums of your braking system and potentially cause brake failure unless promptly addressed.</p>";
        display += "<p><b>Excessive Squeaks or Squeals</b> This sound indicates friction creating heat on the brake linings and can cause damage to your braking system.</p>";
        display += "<p><b>Fully-depressed Brake Pedal or Pumping</b> If your brake pedal can be &quot;floored&quot;, or entirely depressed, this is a signal that you may have a leak in your brake fluid system. You might have air in the brake system or your vehicle might have the need for a brake adjustment that causes this. Needing to pump your brakes to stop the vehicle is another symptom caused by these issues</p>";
        display += "<p><b>Drifting While Braking</b> This may be caused by uneven wear on your brake linings, impure brake fluid, or the need for a brake adjustment.</p>";
        display += "<p><b>Vibration While Braking</b> Vibration is most likely due to warped rotors or worn calipers. This should be attended to right away. Our technicians will be able to analyze the problem for you and effectively repair it for you to make sure you have a safe and secure working brake system.</p>";
    }
    else if ("f3" == val) {
        display = "<span><b>How often should my brakes be checked?</b></span>";
        display += "<p>You should have your brakes checked at least once a year, but no damage will be done if you have them checked more often. Bring your vehicle into Tire Factory at any time for a brake inspection. We will make sure all your main brake components are in top-notch condition, that there is no corrosion on the brake lines, ensure all the hoses are intact, and take care of all other braking maintenance</p>";
    }
    else if ("f4" == val) {
        display = "<span><b>Why should my brake fluid be serviced?</b></span>";
        display += "<p>Your brake fluid requires regular service because it becomes contaminated by moisture. How does moisture get into your brake fluid? Brake fluid is hygroscopic, which means that it magnetically attracts and absorbs moisture from the atmosphere, usually through the brake master cylinder reservoir and permeable brake hoses.</p>";
        display += "<p>Moisture contamination lowers the boiling point of your brake fluid, so, even under ordinary driving conditions, it could cause the fluid to boil and release vapor into your brake system. When the vapor compresses inside the system, you may find yourself facing one of the most dreaded driving crises &#45;a dangerously low brake pedal or even no brake pedal at all!</p>";
        display += "<p>Moisture contamination can also result in very costly repairs &#45; into the thousands if you have ABS&#45;type brakes! When moisture&#45;contaminated brake fluid reaches very high temperatures &#45; as much as 450 to 500 degrees &#45; an electrochemical reaction makes the fluid highly acidic. The acid breaks down the steel line and rubber hoses and can cause early failure of the cast iron and aluminum components in your brakes.</p>";
        display += "<p>Brake fluid contamination has become so much of a concern that some car manufacturers have added brake fluid service to their required maintenance schedules. Let our ASE certified Tire Factory technicians perform this important service for you today.</p>";
        display += "<ul>Brake Fluid Flush Services:<br><br>";
        display += "<li>Check for moisture and contamination</li>";
        display += "<li>Inspect hydraulic lines/hoses</li>";
        display += "<li>Inspect wheel cylinders/calipers</li>";
        display += "<li>Inspect master cylinder/calipers</li>";
        display += "<li>Clean dirt/old fluid out of master cylinder</li>";
        display += "<li>Flush old fluid out of master cylinder/calipers/wheel cylinders</li>";
        display += "<li>Add new brake fluid to master cylinder</li>";
        display += "<li>Road test vehicle for proper brake operation</li>";
        display += "</ul>";
    }
    document.getElementById("details").innerHTML = display;
}