﻿function genericMouseOver(control) {    
    var imageUrl = control.src;    
    var fileExt = imageUrl.substring(imageUrl.length - 3, imageUrl.length);
    control.src = replace(imageUrl, "." + fileExt, "_over." + fileExt);
}
function genericMouseOut(control) {    
    var imageUrl = control.src;    
    var fileExt = imageUrl.substring(imageUrl.length - 3, imageUrl.length);
    control.src = replace(imageUrl, "_over." + fileExt, "." + fileExt);  
}
function replace(lookIn, find, put) {
    var expression = new RegExp(find);
    expression.ignoreCase = false;
    expression.multiline = true;
    expression.global = true;    
    return lookIn.replace(expression, put);    
}
function mapMouseOver(controlId) {
    var controls = document.getElementsByName(controlId);
    var imageUrl = controls[0].getAttribute("src");
    var fileExt = imageUrl.substring(imageUrl.length - 3, imageUrl.length);
    imageUrl = replace(imageUrl, "." + fileExt, "_over." + fileExt);     
    controls[0].setAttribute("src", imageUrl)
    alert(imageUrl);
}
function mapMouseOut(controlId) {
    var controls = document.getElementsByName(controlId);
    var imageUrl = controls[0].getAttribute("src");
    var fileExt = imageUrl.substring(imageUrl.length - 3, imageUrl.length);
    imageUrl = replace(imageUrl, "_over." + fileExt, "." + fileExt);     
    controls[0].setAttribute("src", imageUrl)
}

function callout14DaysMouseOver() {
    image = document.getElementById("ctl00_CalloutsControl_day_14_image");
    imageUrl = "Images/Callout/14Days_on.jpg";
    image.setAttribute("src", imageUrl)
}
function callout14DaysMouseOut() {
    image = document.getElementById("ctl00_CalloutsControl_day_14_image");
    imageUrl = "Images/Callout/14Days_off.jpg";
    image.setAttribute("src", imageUrl)
}

function callout35DollarsMouseOver() {
    image = document.getElementById("ctl00_CalloutsControl_dollar_35_image");
    imageUrl = "Images/Callout/35Dollars_on.jpg";
    image.setAttribute("src", imageUrl)
}
function callout35DollarsMouseOut() {
    image = document.getElementById("ctl00_CalloutsControl_dollar_35_image");
    imageUrl = "Images/Callout/35Dollars_off.jpg";
    image.setAttribute("src", imageUrl)
}

function calloutHowACIPHEXworksMouseOver() {
    image = document.getElementById("ctl00_CalloutsControl_how_aciphex_works_image");
    imageUrl = "Images/Callout/HowACIPHEXworks_on.jpg";
    image.setAttribute("src", imageUrl)
}
function calloutHowACIPHEXworksMouseOut() {
    image = document.getElementById("ctl00_CalloutsControl_how_aciphex_works_image");
    imageUrl = "Images/Callout/HowACIPHEXworks_off.jpg";
    image.setAttribute("src", imageUrl)
}

function calloutDoctorDiscussionMouseOver() {
    image = document.getElementById("ctl00_CalloutsControl_doctor_discussion_image");
    imageUrl = "Images/Callout/DoctorDiscussion_on.jpg";
    image.setAttribute("src", imageUrl)
}
function calloutDoctorDiscussionMouseOut() {
    image = document.getElementById("ctl00_CalloutsControl_doctor_discussion_image");
    imageUrl = "Images/Callout/DoctorDiscussion_off.jpg";
    image.setAttribute("src", imageUrl)
}

function calloutRealPatientsMouseOver() {
    image = document.getElementById("ctl00_CalloutsControl_real_patients_image");
    imageUrl = "Images/Callout/RealPatients_on.jpg";
    image.setAttribute("src", imageUrl)
}
function calloutRealPatientsMouseOut() {
    image = document.getElementById("ctl00_CalloutsControl_real_patients_image");
    imageUrl = "Images/Callout/RealPatients_off.jpg";
    image.setAttribute("src", imageUrl)
}

//function calloutFreeTrialSmallMouseOver() {
//    image = document.getElementById("ctl00_CalloutsControl_free_trial_image_small");
//    imageUrl = "images/callout/pic_trial_offer_small_over.gif";
//    image.setAttribute("src", imageUrl)
//}
//function calloutFreeTrialSmallMouseOut() {
//    image = document.getElementById("ctl00_CalloutsControl_free_trial_image_small");
//    imageUrl = "images/callout/pic_trial_offer_small.gif";
//    image.setAttribute("src", imageUrl)
//}
//function calloutFreeTrialMouseOver() {
//    image = document.getElementById("ctl00_CalloutsControl_free_trial_image");
//    imageUrl = "images/callout/pic_trial_offer_over.gif";
//    image.setAttribute("src", imageUrl)
//}
//function calloutFreeTrialMouseOut() {
//    image = document.getElementById("ctl00_CalloutsControl_free_trial_image");
//    imageUrl = "images/callout/pic_trial_offer.gif";
//    image.setAttribute("src", imageUrl)
//}
//function calloutSavingsCouponScissorMouseOver() {
//    image = document.getElementById("ctl00_CalloutsControl_savings_coupon_scissor");
//    imageUrl = "images/callout/savings_coupon_scissor_over.gif";
//    image.setAttribute("src", imageUrl)
//}
//function calloutSavingsCouponScissorMouseOut() {
//    image = document.getElementById("ctl00_CalloutsControl_savings_coupon_scissor");
//    imageUrl = "images/callout/savings_coupon_scissor.gif";
//    image.setAttribute("src", imageUrl)
//}
//function calloutSavingsCouponMouseOver() {
//    image = document.getElementById("ctl00_CalloutsControl_savingscoupon_image");
//    imageUrl = "images/callout/savings_coupon_over.gif";
//    image.setAttribute("src", imageUrl)
//}
//function calloutSavingsCouponMouseOut() {
//    image = document.getElementById("ctl00_CalloutsControl_savingscoupon_image");
//    imageUrl = "images/callout/savings_coupon.gif";
//    image.setAttribute("src", imageUrl)
//}
//function calloutSaveNextPrescriptionMouseOver() {
//    image = document.getElementById("ctl00_CalloutsControl_savenextprescription_image");
//    imageUrl = "images/callout/save_next_prescription_over.gif";
//    image.setAttribute("src", imageUrl)
//}
//function calloutSaveNextPrescriptionMouseOut() {
//    image = document.getElementById("ctl00_CalloutsControl_savenextprescription_image");
//    imageUrl = "images/callout/save_next_prescription.gif";
//    image.setAttribute("src", imageUrl)
//}
function navigateNotice(site, newWindow) {
    newWindow = false;
    userResponse = confirm("NOTE: This link will take you to a site maintained by a third party who is solely responsible for its contents and Privacy Policy. We are not responsible for the Privacy Policy of any third-party Web site. We encourage you to read the Privacy Policy of every Web site you visit.");    
    if (!userResponse)
        return false;
    if (newWindow)
        window.open(site);
    else
        window.location = site;
}