var content;
$(document).ready(function () {
   
    //Lightbox login form	
    $("#login_register").click(function () {
        $("#login_form").modal({ onShow: function (dialog) {
            $("#login_close", dialog.data).click(function () {
                $.modal.close();
            });
        }
        });
        return false;
    });

    //Search box
    $(".search-textbox").focus(function () {
        if ($.trim($(this).val()) == "Search" || $.trim($(this).val()) == "") {
            $(this).val("");
        }
    });

    $(".search-textbox").blur(function () {
        if ($.trim($(this).val()) == "") {
            $(this).val("Search");
        }
    });

});

function fixPNG() {
    ie6catch = $.browser.msie + $.browser.version;
    if (ie6catch.indexOf("true6") != -1) {
        for (var i = 0; i < document.images.length; i++) {
            if (document.images[i].src) {
                var imgName = document.images[i].src.toUpperCase()
                if ((imgName.substring(imgName.length - 3, imgName.length) == "PNG")&& document.images[i].className != "printImage") {
                    document.images[i].runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + document.images[i].src + "', sizingMethod='image');";
                    document.images[i].src = '/Common/Assets/Images/blank.gif';
                    document.images[i].alt = '_empty';
                }
            }
        }

        type_submit = $("input[type='image']");
        if (type_submit.length > 0) {
            for (var k = 0; k < type_submit.length; k++) {
                imgName = type_submit[k].src.toUpperCase();
                if (imgName.substring(imgName.length - 3, imgName.length) == "PNG") {
                    type_submit[k].runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + type_submit[k].src + "', sizingMethod='image');";
                    type_submit[k].src = '/Common/Assets/Images/blank.gif';
                    type_submit[k].alt = '_empty';
                }
            }
        }
    }
}
if ((navigator.userAgent.toLowerCase().indexOf("msie") != -1) && (navigator.userAgent.toLowerCase().indexOf("opera") == -1)) {
    window.attachEvent("onload", fixPNG);
}


/* Used to open and close description In video page*/
function openDiv(ID) {
    if (document.getElementById(ID).className == "transcriptCloseDiv") {
        document.getElementById(ID).className = "transcriptopenDiv";
    }
    else if (document.getElementById(ID).className == "transcriptopenDiv") {
        document.getElementById(ID).className = "transcriptCloseDiv";
    }
}

function videoFile(fileName) {

    var flashvars = {
        FLV_PATH: fileName,
        AUTOPLAY: 'false'
    };
    var params = {
        wmode: 'transparent'
    }

   
    swfobject.embedSWF("/Common/Assets/Videos/PRCVideoPlayer.swf", "flashContent", "495", "340", "9.0.28", "/Common/Assets/Videos/expressInstall.swf", flashvars, params);
}

/* Javascript to load NFL video file*/
function NFLVideoFile(fileName) {

    var flashvars = {
        FLV_PATH: fileName,
        AUTOPLAY: 'true'
    };
    var params = {
        wmode: 'transparent'
    }


    swfobject.embedSWF("/Common/Assets/Videos/PRCVideoPlayer.swf", "flashContent", "550", "302", "9.0.28", "/Common/Assets/Videos/expressInstall.swf", flashvars, params);
}

function printSelection() {

    var currentPageURL = window.location.href;

    var content = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><html><title>Print - Prilosec OTC Article</title><head><link rel="stylesheet" type="text/css" href="/Common/Assets/Styles/Print.css" /><script type="text/javascript" src="/Common/Assets/Scripts/jquery.js"></script><script type="text/javascript" src="/Common/Assets/Scripts/common.js"></script><script type="text/javascript" src="/Common/Assets/Scripts/Touchstrom.js"></script><script type="text/javascript" src="/Common/Assets/Scripts/jquery.pngfix.js"></script></head><body onload="window.print()"><div class="logoDiv"><img src="/LocaleData/enUS/Assets/Images/logo.png" width="126" height="67" alt="prilosecOTC" title="prilosecOTC"></div><div class="printSiteContent"><span >PrilosecOTC.com</span></div><div class="clear"></div>';
    if (document.getElementById('rotatingcalloutdiv')) {
        content = content + '<div class="catelogImg" id="rotatingcalloutdiv">' + document.getElementById('rotatingcalloutdiv').innerHTML + '</div>';
    }
    if (document.getElementById('catalogPrint') && document.getElementById('articlePrint')) {

        var content1 = document.getElementById('catalogPrint').innerHTML;
        content = content + '<div class="catelog">' + content1 + '</div>';
        var content2 = document.getElementById('articlePrint').innerHTML;

        content = content + '<div class="rightnav"><div class="article">' + content2 + '</div></div>';

    }

    if (document.getElementById('madnessArticlePrint')) {
        var content2 = document.getElementById('madnessArticlePrint').innerHTML;

        content = content + '<div class="rightnav"><div class="madnessRightpart">' + content2 + '</div></div>';

    }
    if (document.getElementById('catalogPrint') && !document.getElementById('articlePrint')) {


        var content1 = document.getElementById('catalogPrint').innerHTML
        content = content + '<div class="catelog" style="width:100%">' + content1 + '</div>';
    }
    if (document.getElementById('contentPartPrint')) {
        var content3 = document.getElementById('contentPartPrint').innerHTML;
        if (document.getElementById('BVContentPrint'))
        {
            var content4 = document.getElementById('BVContentPrint').innerHTML;
            content3=content3+content4;
        }
        content = content + '<div class="contentpart1">' + content3 + '</div>';
    }
    
    if (document.getElementById('NFLContentPartPrint') && document.getElementById('nflCalloutPrint') && document.getElementById('NFLSubfooterPrint')) {
        content = content + '<div class="nflprint"><div class=""><img src="/Common/Assets/Images/nflprintimage1.jpg" width="515" height="228" alt="" title="" /></div>';

        var content4 = document.getElementById('NFLTranscriptArea').innerHTML;
        content = content + '<div class="transcript">' + content4 + '</div>';

        content = content + '<div class="nflcalloutsection"><div class="calloutsectionleft"><img src="/Common/Assets/Images/nflprintimage2.jpg" alt="" width="153" height="46" /><div class="calloutcontent"><div class="callouthead">THE MOST VALUABLE PROTECTORS</div><p>Like Prilosec OTC, offensive lines provide powerful protection, so we created the Madden Most Valuable Protectors Award to honor the best.</p><p><a href="#">CHECK OUT THE MADDEN MVP AWARD</a></p></div></div><div class="calloutsectionmiddle"><div class=""><img src="/Common/Assets/Images/nflprintimage4.jpg" /></div><p style="margin-top: -120px;">Just one pill a day for two weeks&#8212;it worked for offensive linemen Anthony Herrera and David Diehl under tough training camp conditions. Now try Prilosec OTC for yourself and save.<br /><br /><a href="#">TAKE THE 14-DAY CHALLENGE</a></p></div><div class="calloutsectionright"><img src="/PublishingImages/nflprintimage3.jpg" alt="" width="152" height="46" /><div class="calloutcontent"><div class="callouthead">THE TOUGHEST BLOCKERS TELL ALL</div><p>Behind-the-scenes video puts you at the table and in the conversation as we follow offensive lines from across the NFL in O-Line Confidential.</p><p><a href="#">SEE O-LINE CONFIDENTIAL ON NFL.COM</a></p></div></div></div><div class="clear"></div><div class="subfooterline"></div><div class="subfooter_promotions"><div class="promotionimages"><img src="/Common/Assets/Images/subfooter_imagetext.png" alt="Official heartburn remedy sponser of the NFL" title="Official heartburn remedy sponser of the NFL" width="48" height="24" /><img src="/PublishingImages/subfooter_NFL_Logo.png" alt="NFL" title="NFL" width="23" height="24" /></div><div class="promotioncontent">&#169; 2010 NFL Properties LLC. Team names/logos/indicia are trademarks of the teams indicated. All other NFL-related trademarks are trademarks of the National Football League. NFL PLAYERS is a trademark of National Football League Players Incorporated.John Madden image courtesy of ABC Sports.</div><img src="/PublishingImages/subfooter_NFL_Plants.png" alt="NFL Players" title="NFL Players" width="21" height="24" /></div></div>';
    }

    content = content + '<div class="URLPrint"><span><a target=_blank href="' + currentPageURL + '">' + currentPageURL + '</a></span></div></ br></ br></ br></body></html>';
    //content = content + '<div class="URLPrint"><span><a target=_blank href="<%=Session["CurrentPageURL"]%>"><%=Session["CurrentPageURL"]%>' + '</a></span></div></body></html>';

    var pwin = window.open('', 'print_content', 'width=700,height=650,top=20,left=20,resizable=No,scrollbars=1');

    pwin.document.open();
    pwin.document.write(content);
    pwin.document.close();
}


function zoomOut() {

    /* var divh = document.getElementById('main_body').offsetHeight;
    var divw = document.getElementById('main_body').offsetWidth;
    document.getElementById('zoomOutImage').style.display = "block";
    document.getElementById('popUpmainDiv').style.display = "block";
    document.getElementById('closePackage').style.display = "block";
    document.getElementById('popUpmainDiv').style.height = divh + "px";
    document.getElementById('popUpmainDiv').style.width = divw + "px";*/


    var browserWidth;
    var browserHeight;

    if (typeof (window.innerWidth) == 'number') {
        //Non-IE 
        browserWidth = window.innerWidth;
        browserHeight = window.innerHeight;
    } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
        //IE 6+ in 'standards compliant mode' 
        browserWidth = document.documentElement.clientWidth;
        browserHeight = document.documentElement.clientHeight;
    }

    var modalWidth = $('#zoomOutImage').width();
    var closeWidth = $('#closePackage').width();
    var modalHeight = $('#zoomOutImage').height();
    var closeHeight = $('#closePackage').height();
    var winLeft = (browserWidth / 2) - (modalWidth / 2)
    var closeLeft = (browserWidth / 2) - (closeWidth / 2)
    var winTop = (browserHeight / 2) - (modalHeight / 2)
    var closeTop = (browserHeight / 2) - (closeHeight / 2)
    $('#zoomOutImage').css('top', (winTop + 100) + 'px');
    $('#closePackage').css('top', (closeTop - 216) + 'px');
    $('#zoomOutImage').css('left', winLeft + 'px');
    $('#closePackage').css('left', (closeLeft + 362) + 'px');
    $('#zoomOutImage').show();
    $('#closePackage').show();
    $('#popUpmainDiv').width($("body").width()).height($("body").height()).show();
}

function zoomOut14dayChallenge() {
    document.getElementById('HiddenPopUpDiv').innerHTML = "<div class='zoomout' id='zoomOutImage14daychallenge' name='zoomOutImage14daychallenge'><div class='pop-up-tips trans'><!--tips div starts--><div class='pop_up_tips_content'><div class='tips-point-div'><p class='tips-heading'>Important Tips</p><ul class='tips-point'><li>Take one pill every morning for 14 days.</li><li>Remember, Prilosec OTC<sup>&reg;</sup> may take one to four days to have full effect.</li><li>Commit to the Challenge-don''t skip doses.</li><li>Talk to your doctor about your Prilosec OTC trial after 14 days.</li></ul></div></div><!--tips div ends--></div></div><div class='popUpDiv' id='popUpmainDiv' name='popUpmainDiv'></div><div class='closePackageClass' id='closePackage' name='closePackage'><div class='closeImage'><img src='/Common/Assets/Images/close.png' width='22' height='24' alt='Close' onclick='zoomIn()' title='Close' /></div><div class='closeContent'><a onclick='zoomIn()'>Close</a></div></div><div class='closePackageClassChallenge' id='closePackage14dayChallenge' name='closePackage14dayChallenge'><div class='closeImage'><img src='/Common/Assets/Images/popup-close.png' width='25' height='22' alt='Close' onclick='zoomIn14dayChallenge()' title='Close' /></div><div class='closeContent'><a onclick='zoomIn14dayChallenge()'>Close</a></div></div><div class='zoomout' id='zoomOutImage' name='zoomOutImage'><img src='/Common/Assets/Images/fullpackage.png' width='935' height='754' alt='Zoom Out fullpackage'title='Zoom Out fullpackage' /></div>"
    var browserWidth;
    var browserHeight;

    if (typeof (window.innerWidth) == 'number') {
        //Non-IE 
        browserWidth = window.innerWidth;
        browserHeight = window.innerHeight;
    } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
        //IE 6+ in 'standards compliant mode' 
        browserWidth = document.documentElement.clientWidth;
        browserHeight = document.documentElement.clientHeight;
    }

    var modalWidth = $('#zoomOutImage14daychallenge').width();
    var closeWidth = $('#closePackage14dayChallenge').width();
    var modalHeight = $('#zoomOutImage14daychallenge').height();
    var closeHeight = $('#closePackage14dayChallenge').height();
    var winLeft = (browserWidth / 2) - (modalWidth / 2)
    var closeLeft = (browserWidth / 2) - (closeWidth / 2)
    var winTop = (browserHeight / 2) - (modalHeight / 2)
    var closeTop = (browserHeight / 2) - (closeHeight / 2)
    $('#zoomOutImage14daychallenge').css('top', (winTop - 180.5) + 'px');
    $('#closePackage14dayChallenge').css('top', (closeTop - 66) + 'px');
    $('#zoomOutImage14daychallenge').css('left', (winLeft - 477) + 'px');
    $('#closePackage14dayChallenge').css('left', (closeLeft + 148) + 'px');
    $('#zoomOutImage14daychallenge').show();
    $('#closePackage14dayChallenge').show();
    $('#popUpmainDiv').width($("body").width()).height($("body").height()).show();
}


/*function zoomOut14dayChallenge() {

var divh = document.getElementById('main_body').offsetHeight;
var divw = document.getElementById('main_body').offsetWidth;


document.getElementById('zoomOutImage14daychallenge').style.display = "block";
document.getElementById('popUpmainDiv').style.display = "block";
document.getElementById('closePackage14dayChallenge').style.display = "block";
document.getElementById('popUpmainDiv').style.height = divh + "px";
document.getElementById('popUpmainDiv').style.width = divw + "px";
}*/

function zoomIn() {

    document.getElementById('zoomOutImage').style.display = "none";
    document.getElementById('popUpmainDiv').style.display = "none";
    document.getElementById('closePackage').style.display = "none";
}

function zoomIn14dayChallenge() {

    document.getElementById('popUpmainDiv').style.display = "none";
    document.getElementById('zoomOutImage14daychallenge').style.display = "none";
    document.getElementById('closePackage14dayChallenge').style.display = "none";
}

function adjustFontSize(obj) {
    var topNavHeight = "32";
    var size = "75";
    var textresized = 1;
    if (obj == null) {
        obj = get_cookie("POTCTextResize");
        textresized = 0;
    }
    if (obj != null) {
        if (obj == "large_a") {
            size = "100";
            topNavHeight = "65";
        }
        else if (obj == "medium_a") {
            size = "87";
            topNavHeight = "50";
        }
        if (textresized == 1) {
            delete_cookie('POTCTextResize');
            set_cookie('POTCTextResize', obj, null, "/");
        }
        $("#text_size img").each(function() {
            if ($(this).attr("id") == obj) {
                $(this).attr("src", "/LocaleData/enUS/Assets/Images/" + $(this).attr("id") + "_on.jpg");
                $(this).css("cursor", "default");
            }
            else {
                $(this).attr("src", "/LocaleData/enUS/Assets/Images/" + $(this).attr("id") + "_off.jpg");
                $(this).css("cursor", "pointer");
            }
        });

    }

    $("body").css("font-size", size + "%");
    $(".topNavPOTCItem").css("height", topNavHeight + "px");
    var mainCatelogHeight = $(".mainCatelog").height() - 100;
    var mainContentPartHeight = $(".mainContentPart").height() - 100;
    if (mainCatelogHeight < $(".sideMenuMainDiv").height()) {
        $(".mainCatelog").css('height', ($(".sideMenuMainDiv").height() + 100) + 'px');
    }
    if (mainContentPartHeight < $(".sideMenuMainDiv").height()) {
        $(".mainContentPart").css('height', ($(".sideMenuMainDiv").height() + 100) + 'px');
    }

}

function set_cookie(name, value, days, path) {
    var cookie_string = name + "=" + escape(value);

    if (days != null) {
        var expires = new Date(days);
        cookie_string += "; expires=" + expires.toGMTString();
    }

    if (path)
        cookie_string += "; path=" + escape(path);

    document.cookie = cookie_string;
}


function get_cookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for (var i = 0; i < ca.length; i++) {
        var c = ca[i];
        while (c.charAt(0) == ' ') c = c.substring(1, c.length);
        if (c.indexOf(nameEQ) == 0) return unescape(c.substring(nameEQ.length, c.length));
    }
    return null;
}


function delete_cookie(cookie_name) {
    var cookie_date = new Date();  // current date & time
    cookie_date.setTime(cookie_date.getTime() - 1);
    document.cookie = cookie_name += "=; expires=" + cookie_date.toGMTString();
}


/* end of Text Resizing Javascript*/

/*Email previewEmail begins*/
/*function previewEmail() {
    //var receipEmailId = document.getElementById('receipEmail').value;
    var receipEmailId = document.getElementById('<%= txtReceiverEmail.ClientID %>').value;

    //var nameId = document.getElementById('name').value;
    var nameId = document.getElementById('<%= txtSenderName.ClientID %>').value;

    //var emailAddressId = document.getElementById('emailAddress').value;
    var emailAddressId = document.getElementById('<%= txtSenderEmail.ClientID %>').value;

    var emailSubId = document.getElementById('<%= txtSubject.ClientID %>').value;
    var articleURL = '<%=Session["EmailMessageBody"]%>';

    var content = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><html><head><link rel="stylesheet" type="text/css" href="/Common/Assets/Styles/EmailPreview.css" /></head><body">';
    if (receipEmailId) {
        content = content + '<p class="emailPara">Recipent&rsquo;s email</p><p class="emailValPara">' + receipEmailId + '</p>';
    }
    if (nameId) {
        content = content + '<p class="emailPara">Your name</p><p class="emailValPara">' + nameId + '</p>';
    }
    if (emailAddressId) {
        content = content + '<p class="emailPara">Your email address</p><p class="emailValPara">' + emailAddressId + '</p>';
    }

    if (emailSubId) {
        content = content + '<p class="emailPara">Email Subject</p><p class="emailValPara">' + emailSubId + '</p>';
    }
    // content = content + '<p class="emailPara">Email Subject</p><p class="emailValPara">Here comes your subject</p><p class="emailPara">Personal note</p><p>Hi,</p><br /><p>I found an interesting article on PrilosecOTC website related to heartburn and thought of sharing with you.</p>';
    content = content + '<p class="emailPara">Personal Note</p><p>Hi,</p><br /><p>I found an interesting article on PrilosecOTC website related to heartburn and thought of sharing with you.</p><p class="emailValPara"><a href="' + articleURL + '">' + articleURL + '</a></p>';


    //if (PersonalNoteId) {
    //content = content + '<p class="emailValPara">' + PersonalNoteId + '</p>';
    // }
    content = content + '<br /><p>Regards</p><p>' + nameId + '</p></body></html>';
    var pwin = window.open('', 'print_content', 'width=700,height=800,top=20,left=20,resizable=No,scrollbars=1');

    pwin.document.open();
    pwin.document.write(content);
    pwin.document.close();
}*/



    function previewEmail(receipEmailId,nameId,emailAddressId,emailSubId,articleURL) {
//        var receipEmailId = document.getElementById('txtReceiverEmail').value;
//        var nameId = document.getElementById('txtSenderName').value;
//        var emailAddressId = document.getElementById('txtSenderEmail').value;
//        var emailSubId = document.getElementById('txtSubject').value;
//        var articleURL ="hi this is url";// '<%=Session["EmailMessageBody"]%>';
        var emailFooterLinks = $("#email_footer_links").html();
        var content = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><html><head><link rel="stylesheet" type="text/css" href="/Common/Assets/Styles/EmailPreview.css" /><title>Preview Email</title></head><body>';
        if (receipEmailId) {
            content = content + '<p class="emailPara">Recipent&rsquo;s email : ' + receipEmailId + '</p>';
        }
        if (nameId) {
            content = content + '<p class="emailPara">Your name : ' + nameId + '</p>';
        }
        if (emailAddressId) {
            content = content + '<p class="emailPara">Your email address : ' + emailAddressId + '</p>';
        }
        if (emailSubId) {
            content = content + '<p class="emailPara">Email Subject : ' + nameId + ' ' + emailSubId + '</p><br/>';
        }
        content = content + '<p class="emailPara">Hi,</p><br /><p>I found an interesting article on PrilosecOTC website related to heartburn and thought of sharing with you.</p><br/><p class="emailValPara"><a target=_blank href="' + articleURL + '">' + articleURL + '</a></p>';
        content = content + '<br /><p>Regards,</p><p>' + nameId + '</p><br/><p><i>Note: This message was  sent by ' + emailAddressId + ' via <a target=_blank href="http://www.prilosecotc.com">www.PrilosecOTC.com.</a><br/>Please note that Prilosec does not verify email addresses.</i><br/><br/>';
        content = content + '<p>' + emailFooterLinks + '</p>';
        content = content + '</body></html>';
        var pwin = window.open('', 'print_content', 'width=700,height=400,top=20,left=20,resizable=No,scrollbars=1');
        pwin.document.open();
        pwin.document.write(content);
        pwin.document.close();
    }
    
/* Email Preview ends*/


/*Script for External site pop up div :Starts*/
function ShowExternalLink(url) {
    $('#continue').attr("href", url)
    $('#continue').attr("target", "_blank")
};

function popupshow() {

    $("#popupContact").fadeIn("slow").positionCenter();
   
}

$(document).ready(function() {

    $.fn.positionCenter = function(options) {
        var pos = {
            sTop: function() {
                return window.pageYOffset || document.documentElement && document.documentElement.scrollTop || document.body.scrollTop;
            },
            wHeight: function() {
                return window.innerHeight || document.documentElement && document.documentElement.clientHeight || document.body.clientHeight;
            }
        };
        return this.each(function(index) {
            if (index == 0) {
                var $this = $(this);
                var elHeight = $this.outerHeight();
                var elTop = pos.sTop() + (pos.wHeight() / 2) - (elHeight / 2);
                $this.css({
                    position: 'absolute',
                    margin: '0',
                    top: elTop,
                    left: (($(window).width() - $this.outerWidth()) / 2) + 'px'
                });
            }
        });
    }


    $('.redir').click(function(e) {
        $('#redirect').show().positionCenter();
        $('#redirect').find('#continue')[0].href = e.currentTarget;
        e.preventDefault();

    });


    $('#redirect a#continue').click(function() {

        $('#redirect').hide();

    });

    $('#redirect a#exit').click(function(e) {

        $('#redirect').hide();
        e.preventDefault();

    });
});

function redirectExternalSite(url) {
    $('#redirect').show().positionCenter();
    $('#continue').attr("href", url)
    $('#continue').attr("target", "_blank")

}
/*Script for External site pop up div :Ends*/

/*Script for link checking*/
function Checklink() {
    var i = 0;
    var host = document.location.hostname;
    for (i = 0; i < document.getElementsByTagName("a").length; i++) {
        var ancElement = document.getElementsByTagName("a")[i];
        if (ancElement.href.toUpperCase().match("JAVASCRIPT:") == null) {
            if (ancElement.href.toUpperCase().match(host.toUpperCase()) == null && ancElement.href.toLowerCase().match("^(http://|https://)?(www.)?(pg|prilosecotc.com|officialsponsor.com|projectfairbanks.com|nfl.com)") == null && ancElement.target.toUpperCase().match("_BLANK") != null) {
                if (ancElement.className.toLowerCase().match("redir") == null)
                    ancElement.className += ancElement.className ? ' redir' : 'redir';
                ancElement.onclick = function() { javascript: ShowExternalLink(this.href); };
            }
        }
    }
}

/*Script for Bazaar Voice Admin - Uncheck all check boxes starts*/
function UnCheckAllDataGridCheckBoxes(aspCheckBoxID) {
    for (i = 0; i < document.forms[0].elements.length; i++) {
        if (document.forms[0].elements[i].name.indexOf(aspCheckBoxID) != -1) {
            document.forms[0].elements[i].checked = false
        }
    }
    return false;
}
/*Script for Bazaar Voice Admin - Uncheck all check boxes endss*/

/* Mouse rollover script for footer starts */
function activate(aID) {
    var image = document.getElementsByName(aID);
    var source = image[0].src;
    var footer_image_path = "/LocaleData/enUS/Assets/Images/";
    var newSource = footer_image_path + image[0].attributes['id'].value + '_on.png';
    image[0].src = newSource;
}

function deactivate(aID) {
    var image = document.getElementsByName(aID);
    var source = image[0].src;
    var footer_image_path = "/LocaleData/enUS/Assets/Images/";
    var newSource = footer_image_path + image[0].attributes['id'].value + '_off.png';
    image[0].src = newSource;
}
/* Mouse rollover script for footer ends*/

/*Javascript for validating date selected in age verification page*/
function ValidateDate() {
    var dateOfBirth;
    var day;
    var month;
    var year;
    day = "01";
    for (i = 0; i < document.forms[0].elements.length; i++) {
        if (document.forms[0].elements[i].id.indexOf("ddlstMonth") != -1) {
            month = document.forms[0].elements[i].value;
        }
        if (document.forms[0].elements[i].id.indexOf("ddlstYear") != -1) {
            year = document.forms[0].elements[i].value;
        }
        if (document.forms[0].elements[i].id.indexOf("txtCheckDate") != -1) {
            dateOfBirth = document.forms[0].elements[i];
        }
    }
    dateOfBirth.value = month + "/" + day + "/" + year;
}

/*ValidateDate() ends*/

function ValidateStartDate() {
    var startdate;
    var day;
    var month;
    var year;

    for (i = 0; i < document.forms[0].elements.length; i++) {
        if (document.forms[0].elements[i].id.indexOf("ddlstStartMonth") != -1) {
            month = document.forms[0].elements[i].value;
        }
        if (document.forms[0].elements[i].id.indexOf("ddlstStartDate") != -1) {
            day = document.forms[0].elements[i].value;
        }
        if (document.forms[0].elements[i].id.indexOf("ddlstStartYear") != -1) {
            year = document.forms[0].elements[i].value;
        }
        if (document.forms[0].elements[i].id.indexOf("txtCheckDate") != -1) {
            startdate = document.forms[0].elements[i];
        }
    }
    startdate.value = month + "/" + day + "/" + year;
}


/*search Javascript*/
function RedirectURL(PageURL) {

    window.location.href = PageURL;

    return false;

}
function HeaderformSubmit(e, PageURL) {



    var keycode;
    if (window.event)
        keycode = window.event.keyCode;
    else if (e)
        keycode = e.which;
    else
        return true;
    if (keycode == 13) {
        return RedirectURL(PageURL);
        //return false;
    }
    else
        return true;
}

//Fn for 14 day challenge print form
//function printChallengeForm() {
//    var firstName = document.getElementById('firstname').value;
//    var mi = document.getElementById('mi').value;
//    var lastname = document.getElementById('lastname').value;
//    var Emailaddress = document.getElementById('Emailaddress').value;
//    var mailingAddress = document.getElementById('mailingAddress').value;
//    var city = document.getElementById('city').value;
//    var state = document.getElementById('state').value;
//    var zip = document.getElementById('zip').value;
//    var phone = document.getElementById('phone').value;
//    var date = document.getElementById('date').value;
//    var month = document.getElementById('month').value;
//    var year = document.getElementById('year').value;

//    var Printcontent = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><title>Print form - Prilosec OTC</title></head><link rel="stylesheet" type="text/css" href="../Styles/print.css" /><body onload="window.print()"><div class="main-div"><div class="floatleft"><h1 class="main-heading">PRILOSEC OTC</h1><h2 class="sub-heading">14-DAY CHALLENGE COUPON</h2></div><div class="print-note">DO NOT WRITE ON THIS FORM</div><div class="spacer-10"></div><p class="print-form-para">You must send in the following: 1) ORIGINAL UPC from box, 2) ORIGINAL DATED SALES RECEIPT (within 60 days of purchase), and 3) THIS PRINTED COUPON FORM.</p><div class="spacer-10"></div><p class="print-form-para"><b>mportant Guidelines for this Coupon Form:</b> In order to receive a $10 coupon do not make additions, notations, or changes to this printed form. If the form is altered or mutilated, the coupon request might be considered invalid. Please refer to the Privacy Policy and the Terms and Conditions for further program details.</p><div class="spacer-30"></div><div class="floatleft"><div class="floatleft"><p class="address-para">' + firstName + ' ' + mi + ' ' + lastname + '</p><p class="blue-para">' + Emailaddress + '</p><p class="address-para">' + mailingAddress + ', ' + city + ', ' + state + ' ' + zip + '</p><p class="address-para">' + phone + '</p><div class="spacer-10"></div><p class="address-para">Date of Birth: ' + date + '/' + month + '/' + year + '</p></div><div class="floatleft"><p class="address-para-bold">Coupon Code:</p><p class="address-para">123445689012345</p><p>&nbsp;</p><p class="address-para">28-count package</p></div></div><div class="floatright print-note"><img src="../Images/bar-code.jpg" width="62px" height="110px"></div><div class="spacer-50"></div><img src="../Images/Do-not-write.jpg" width="700px" height="25px"><div class="spacer-50"></div><div class="Secound-content-div"><p class="msg-para">Do not forget to include:</p><div class="spacer-10"></div><ul><li class="print-list">Original UPC from box</li><li class="print-list">Original Dated Sales Receipt <br /><span>(within 60 days of purchase)</span></li><li class="print-list">Printed Coupon Form</li></ul></div><div class="Secound-content-div"><p class="msg-para">Mail to:</p><div class="spacer-10"></div><p class="print-para">Prilosec OTC 14-Day </p><p class="print-para">Challenge P.O. Box 900057</p><p class="print-para">El Paso, TX 88590-0057</p></div><div class="Third-content-div"><h3>NOTICE:</h3><p class="spacer-10"></p><p>TO MAKE SURE YOU GET YOUR $10 COUPON, JUST LEAVE THIS PRINTED FORM AS IT IS.</p><p class="spacer-10"></p><p>MAKING ANY CHANGES MIGHT MAKE YOUR REQUEST INVALID.</p><p class="spacer-10"></p><p>MAKE SURE THE INFORMATION IS CORRECT BEFORE MAILING THE FORM.</p></div><div class="spacer-50"></div><p class="print-para">You should receive your coupon within six to eight weeks.</p><div class="print-divider"></div><div class="spacer-20"></div><p class="print-form-para"><b>TERMS AND CONDITIONS</b></p><div class="spacer-20"></div><p class="print-form-para-bottom">Limit one coupon per household. Valid on one Prilosec OTC 14-count package, Prilosec OTC 28-count package, or Prilosec OTC 42-count package. USE OF MULTIPLE ADDRESSES OR P.O. BOXES TO OBTAIN ADDITIONAL COUPONS IS FRAUD AND MAY RESULT IN PROSECUTION. MULTIPLE SUBMISSIONS WILL NOT BE ACKNOWLEDGED OR RETURNED. Original dated sales receipts must be dated by [DATE], and requests must be postmarked no later than [DATE]. This coupon is limited to the purchase price and excludes any incidental or consequential damages, taxes negligence, strict liability, or any other legal theory. Some states do not allow the exclusion or limitation of incidental or consequential damages, so the above limitation or exclusion might not apply to you. This form must accompany your request. Reproduction, sale, trade, or purchase of this form or proof of purchase is prohibited. Proof of purchase must be obtained from product purchased by you. No requests from groups, clubs, or organizations will be honored. Please allow six to eight weeks for delivery. All information you give us will be kept private and will not be sold to any other company. For details of our privacy policy, please visit www.pg.com/privacy.html.</p><div class="spacer-20"></div><p class="print-form-para-bottom">Offer is valid for U.S. residents only. Void in Maine.</p></div></body></html>';
//    var printwin = window.open('', 'print_content', 'width=750,height=800,top=20,left=20,resizable=No,scrollbars=1');

//    printwin.document.open();
//    printwin.document.write(Printcontent);
//    printwin.document.close();
//}
function printChallengeForm(UserProfileID, FirstNameID, MiddleNameID, LastNameID, EmailID, MailingID, CityID, StateID, ZipID, PhoneID, MonthID, YearID) {

    var firstName = document.getElementById(FirstNameID).value;
    var mi = document.getElementById(MiddleNameID).value;
    var lastname = document.getElementById(LastNameID).value;
    var Emailaddress = document.getElementById(EmailID).value;
    var mailingAddress = document.getElementById(MailingID).value;
    var city = document.getElementById(CityID).value;
    var state = document.getElementById(StateID).value;
    var zip = document.getElementById(ZipID).value;
    var phone = PhoneID;
    var month = document.getElementById(MonthID).value;
    var year = document.getElementById(YearID).value;

    var Printcontent = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><title>Print form - Prilosec OTC</title></head><link rel="stylesheet" type="text/css" href="/Common/Assets/Styles/Print.css" /><body onload="window.print()"><div class="main-div"><div class="floatleft"><h1 class="main-heading">PRILOSEC OTC<sup>&reg;</sup></h1><h2 class="sub-heading">14-DAY CHALLENGE COUPON</h2></div><div class="print-note">DO NOT WRITE ON THIS FORM</div><div class="spacer-10"></div><p class="print-form-para">You must send in the following:<br />1) ORIGINAL UPC from box,<br />2) ORIGINAL DATED SALES RECEIPT (within 60 days of purchase), and<br />3) THIS PRINTED COUPON FORM.</p><div class="spacer-10"></div><p class="print-form-para"><b>Important Guidelines for this Coupon Form:</b> In order to receive a $10 coupon do not make additions, notations, or changes to this printed form. If the form is altered or mutilated, the coupon request might be considered invalid. Please refer to the Privacy Policy and the Terms and Conditions for further program details.</p><div class="spacer-30"></div><div class="floatleft"><div class="floatleft"><p class="address-para">' + firstName + ' ' + mi + ' ' + lastname + '</p><p class="blue-para">' + Emailaddress + '</p><p class="address-para">' + mailingAddress + ', ' + city + ', ' + state + ' ' + zip + '</p><p class="address-para">' + phone + '</p><div class="spacer-10"></div><p class="address-para">Date of Birth: ' + month + ' ' + year + '</p></div><div class="floatleft"><p class="address-para-bold">Coupon Code:</p><p class="address-para">' + UserProfileID + '</p><p>&nbsp;</p><p class="address-para">28-count package</p></div></div><div class="spacer-50"></div><img src="/Common/Assets/Images/Do-not-write.jpg" width="700px" height="25px"><div class="spacer-50"></div><div class="Secound-content-div"><p class="msg-para">Do not forget to include:</p><div class="spacer-10"></div><ul><li class="print-list">ORIGINAL UPC from box</li><li class="print-list">ORIGINAL DATED SALES RECEIPT<br /><span>(within 60 days of purchase)</span></li><li class="print-list">THIS PRINTED COUPON FORM.</li></ul></div><div class="Secound-content-div"><p class="msg-para">Mail to:</p><div class="spacer-10"></div><p class="print-para">Prilosec OTC 14-Day</p><p class="print-para">Challenge PO Box 900080</p><p class="print-para">El Paso, TX 88590-0080</p></div><div class="Third-content-div"><h3>NOTICE:</h3><p class="spacer-10"></p><p>TO MAKE SURE YOU GET YOUR $10 COUPON, JUST LEAVE THIS PRINTED FORM AS IT IS.</p><p class="spacer-10"></p><p>MAKING ANY CHANGES MIGHT MAKE YOUR REQUEST INVALID.</p><p class="spacer-10"></p><p>MAKE SURE THE INFORMATION IS CORRECT BEFORE MAILING THE FORM.</p></div><div class="spacer-50"></div><p class="print-para">You should receive your coupon within six to eight weeks.</p><div class="print-divider"></div><div class="spacer-20"></div><p class="print-form-para"><b>TERMS AND CONDITIONS</b></p><div class="spacer-20"></div><p class="print-form-para-bottom">Limit one coupon per household. Valid on one Prilosec OTC 14-count package, Prilosec OTC 28-count package, or Prilosec OTC 42-count package. USE OF MULTIPLE ADDRESSES OR P.O. BOXES TO OBTAIN ADDITIONAL COUPONS IS FRAUD AND MIGHT RESULT IN PROSECUTION. MULTIPLE SUBMISSIONS WILL NOT BE ACKNOWLEDGED OR RETURNED. Original dated sales receipts must be dated by September 30,2010, and requests must be postmarked no later than November 30,2010. This coupon is limited to the purchase price and excludes any incidental or consequential damages, taxes negligence, strict liability, orany other legal theory. Some states do not allow the exclusion or limitation of incidental or consequential damages, so the above limitation or exclusion might not apply to you. This form must accompany your request. Reproduction, sale, trade, or purchase of this form or proof of purchase is prohibited. Proof of purchase must be obtained from product purchased by you. No requests from groups, clubs, or organizations will be honored. Please allow six to eight weeks for delivery. All information you give us will be kept private and will not be sold to any other company. For details of our privacy policy, please visit www.pg.com/privacy.html.</p><div class="spacer-20"></div><p class="print-form-para-bottom">Offer is valid for U.S. residents only.</p></div></body></html>';
    var printwin = window.open('', 'print_content', 'width=750,height=800,top=20,left=20,resizable=No,scrollbars=1');

    printwin.document.open();
    printwin.document.write(Printcontent);
    printwin.document.close();
    return true;
}

//Rollover javscripts for Images
// JavaScript Document
$(document).ready(function() {
    $("#register_btn").mouseover(function() {
        $(this).attr("src", "/LocaleData/enUS/Assets/Images/Register_btn_on.png");
        fixPNG();
    });

    $("#register_btn").mouseout(function() {
        $(this).attr("src", "/LocaleData/enUS/Assets/Images/Register_btn_off.png");
        fixPNG();
    });

    $("#login_btn").mouseover(function() {
        $(this).attr("src", "/LocaleData/enUS/Assets/Images/Login_btn_on.png");
        fixPNG();
    });

    $("#login_btn").mouseout(function() {
        $(this).attr("src", "/LocaleData/enUS/Assets/Images/Login_btn_off.png");
        fixPNG();
    });

    $("#applynow").mouseover(function() {
        $(this).attr("src", "/LocaleData/enUS/Assets/Images/Apply_now_on.png");
    });

    $("#applynow").mouseout(function() {
        $(this).attr("src", "/LocaleData/enUS/Assets/Images/Apply_now_off.png");
    });

    $("a.color_hover").mouseover(function() { $(this).css("color", "#451c71"); });

});

function addToBookMarks(pageTitle) {
    if (window.sidebar)
        window.sidebar.addPanel(pageTitle, location.href, '');
    else (window.external)
    window.external.AddFavorite(location.href, pageTitle);

}

function addThis(url) {
    popupWin = window.open(url, '', 'menubar=yes,toolbar=yes,location=yes,directories=yes,titlebar=yes,status=yes,scrollbars=yes,resizable=yes');
};


$(document).ready(function() {

    var mainCatelogHeight = $(".mainCatelog").height() - 100;
    var mainContentPartHeight = $(".mainContentPart").height() - 100;
    if (mainCatelogHeight < $(".sideMenuMainDiv").height()) {
        $(".mainCatelog").css('height', ($(".sideMenuMainDiv").height() + 100) + 'px');
    }
    if (mainContentPartHeight < $(".sideMenuMainDiv").height()) {
        $(".mainContentPart").css('height', ($(".sideMenuMainDiv").height() + 100) + 'px');
    }
});

$(document).ready(function() {
    $(".dottedLine").attr("href", "javascript:void(0);")

    ie6catch = $.browser.msie + $.browser.version;
    if (ie6catch.indexOf("true6") != -1) {
        $(".dottedLine").mouseover(function() {
            $("a.dottedLine span.tooltip").css("display", "inline");
        });

        $(".dottedLine").mouseout(function() {
            $("a.dottedLine span.tooltip").css("display", "none");
        });

        $(".dottedLine").mouseover(function() {
            $("a.dottedLine span.tooltipTwit").css("display", "inline");
        });

        $(".dottedLine").mouseout(function() {
            $("a.dottedLine span.tooltipTwit").css("display", "none");
        });
    }



});

$(document).ready(function() {
    $(".awards_color #redir").attr("href", "JavaScript:redirectExternalSite('http://www.nfl.com/');");
    $(".palepink #redir").attr("href", "JavaScript:redirectExternalSite('http://www.nfl.com/');");
});
function IsNumeric(strString)
//  check for valid numeric strings	
{
    var strValidChars = "0123456789.-";
    var strChar;
    var blnResult = true;

    if (strString.length == 0) return false;

    //  test strString consists of valid characters listed above
    for (i = 0; i < strString.length && blnResult == true; i++) {
        strChar = strString.charAt(i);
        if (strValidChars.indexOf(strChar) == -1) {
            blnResult = false;
        }
    }
    return blnResult;
}

//new parameters Added(TopNav, Title)
function StoreLocatorSubmit(RGID, SKU, Zipcode, TopNav, Title) {
   
    var Zipcodevalue = document.getElementById(Zipcode).value;
    if (Zipcodevalue.length != 5 || IsNumeric(Zipcodevalue) == false) {
        alert("Please enter a valid zipcode.");
    }
    else {
        window.location.href = "StoreLocatorLanding.aspx?TopNav=" + TopNav + "&Article=" + Title + "&cii_sSKU=" + SKU + "&cii_nRGID=" + RGID + "&cii_sZip=" + Zipcodevalue + "&cii_sCountry=US&cii_nRadius=25";
        return false;
    }
}
//new parameters Added(TopNav, Title)
function SubmitZipCode(e, RGID, SKU, Zipcode, TopNav, Title) {

    var keycode;
    if (window.event)
        keycode = window.event.keyCode;
    else if (e)
        keycode = e.which;
    else
        return true;
    if (keycode == 13) {
        return StoreLocatorSubmit(RGID, SKU, Zipcode, TopNav, Title);
        //return false;
    }
    else
        return true;
}




var isMSIE = /*@cc_on!@*/false; // http://dean.edwards.name/weblog/2007/03/sniff/
var isIEmac = false; /*@cc_on@if(@_jscript&&!(@_win32||@_win16)&& 
(@_jscript_version<5.5)) isIEmac=true; @end
@*/
var undefined;

function isEmpty(s) { return ((s == '') || /^\s*$/.test(s)); }

var addBookmarkObj = {
    linkText: 'bookmark this page',
    title: document.title,
    URL: location.href,
    addTextLink: function(parId) {
        var a = addBookmarkObj.makeLink(parId, 1);
        if (a) {
            jQuery(a).text(addBookmarkObj.linkText);
            return;
        }
        var cont = addBookmarkObj.getParent(parId);
        if (!cont) return;
        jQuery(cont).append('<span>' + addBookmarkObj.findKeys() + '</span>');
    },
    addImageLink: function(parId, imgPath) {
        if (!imgPath || isEmpty(imgPath)) return;
        var o = addBookmarkObj, a = o.makeLink(parId), img = document.createElement('img');
        img.title = img.alt = o.modal ? o.linkText : o.findKeys();
        img.src = imgPath;
        a.appendChild(img);
    },
    makeLink: function(parId, isText) {
        var cont = addBookmarkObj.getParent(parId);
        if (!cont) return null;
        var a = document.createElement('a');
        a.href = addBookmarkObj.URL;
        var s = document.createElement('div').style;
        var isFx35plus = ((navigator.userAgent.toLowerCase().indexOf('firefox') != -1)
      && (s.wordWrap !== undefined) && (s.MozTransform !== undefined));
        if (window.external && isMSIE && !isIEmac) {
            // IE4/Win generates an error when you
            // execute 'typeof(window.external.AddFavorite)'
            // In IE7 the page must be from a web server, not directly from a local 
            // file system, otherwise, you will get a permission denied error.
            // Maxthon shows 'typeof(window.external.AddFavorite)' as 'undefined'
            // even though it is defined.
            a.onclick = function() { // IE/Win
                try {
                    window.external.AddFavorite(addBookmarkObj.URL, 'Buy Prilosec OTC Now');
                } catch (ex) {
                    var t = addBookmarkObj.findKeys();
                    alert('After closing this, ' + t.charAt(0).toLowerCase() + t.slice(1));
                }
                return false;
            }
            addBookmarkObj.modal = 1;
        } else if (window.opera || isFx35plus) { // Opera 7+, Firefox 3.5+
            a.title = 'Buy Prilosec OTC Now', a.rel = 'sidebar';
            addBookmarkObj.modal = 1;
        } else if (isText) {
            return null;
        } else {
            a.onclick = function() {
                var t = this.firstChild.title;
                alert('After closing this, ' + t.charAt(0).toLowerCase() + t.slice(1));
                return false;
            }
        }
        return cont.appendChild(a);
    },
    getParent: function(parId) {
        if (!document.getElementById || !document.createTextNode) return null;
        parId = ((typeof (parId) == 'string') && !isEmpty(parId))
      ? parId : 'addBookmarkContainer';
        return document.getElementById(parId) || null;
    },
    findKeys: function() {
        // user agent sniffing is bad in general, but this is one of the times 
        // when it's really necessary
        var ua = navigator.userAgent.toLowerCase(), isMac = (ua.indexOf('mac') != -1),
      isWebkit = (ua.indexOf('webkit') != -1), str = (isMac ? 'Command/Cmd' : 'CTRL');
        if (window.opera && (!opera.version || (opera.version() < 9))) {
            str += ' + T';  // Opera versions before 9
        } else if (ua.indexOf('konqueror') != -1) {
            str += ' + B'; // Konqueror
        } else if (window.opera || window.home || isWebkit || isMSIE || isMac) {
            // IE, Firefox, Netscape, Safari, Google Chrome, Opera 9+, iCab, IE5/Mac
            str += ' + D';
        }
        return ((str) ? 'Press ' + str + ' to bookmark this page' : str);
    }
}


jQuery(document).ready(addBookmarkObj.addTextLink);


// to make multiple links, do something like this:
/*
jQuery(document).ready(function(){
var f=addBookmarkObj.addTextLink;
f();
f('otherContainerID');
});
*/

// below is an example of how to make an image link with this
// the first parameter is the ID. If you pass an empty string it defaults to
// 'addBookmarkContainer'.
/*
jQuery(document).ready(function(){
addBookmarkObj.addImageLink('','/images/add-bookmark.jpg');
});
*/


$(document).ready(function() {
    if (document.getElementById('packageSmall')) {
        document.getElementById('HiddenPopUpDiv').innerHTML = "<div class='zoomout' id='zoomOutImage14daychallenge' name='zoomOutImage14daychallenge'><div class='pop-up-tips'><!--tips div starts--><div class='pop_up_tips_content'><div class='tips-point-div'><p class='tips-heading'>Important Tips</p><ul class='tips-point'><li>Take one pill every morning for 14 days.</li><li>Remember, Prilosec OTC<sup>&reg;</sup> may take one to four days to have full effect.</li><li>Commit to the Challenge- don''t skip doses.</li><li>Talk to your doctor about your Prilosec OTC trial after 14 days.</li></ul></div></div><!--tips div ends--></div></div><div class='popUpDiv' id='popUpmainDiv' name='popUpmainDiv'></div><div class='closePackageClass' id='closePackage' name='closePackage'><div class='closeImage'><img src='/Common/Assets/Images/close.png' width='22' height='24' alt='Close' onclick='zoomIn()' title='Close' /></div><div class='closeContent'><a onclick='zoomIn()'>Close</a></div></div><div class='closePackageClassChallenge' id='closePackage14dayChallenge' name='closePackage14dayChallenge'><div class='closeImage'><img src='/Common/Assets/Images/popup-close.png' width='25' height='22' alt='Close' onclick='zoomIn14dayChallenge()' title='Close' /></div><div class='closeContent'><a onclick='zoomIn14dayChallenge()'>Close</a></div></div><div class='zoomout' id='zoomOutImage' name='zoomOutImage'><img src='/Common/Assets/Images/fullpackage.png' width='935' height='754' alt='Zoom Out fullpackage'title='Zoom Out fullpackage' /></div>"
    }
});


$(document).ready(function() {
    $(".printbuttonClass img").mouseover(function() {
        $(this).attr("src", "/Common/Assets/Images/Print_button_on.jpg");
    });

    $(".printbuttonClass img").mouseout(function() {
        $(this).attr("src", "/Common/Assets/Images/Print_button_off.jpg");
    });
});

/* New Left navigation Javascript*/
$(document).ready(function() {
    $(".bullet").click(function() {
        $(this).next("a").next("ul").slideToggle('medium');
        var mainCatelogHeight = $(".mainCatelog").height() - 100;
        var mainContentPartHeight = $(".mainContentPart").height() - 100;
        if (mainCatelogHeight < $(".sideMenuMainDiv").height()) {
            $(".mainCatelog").css('height', ($(".sideMenuMainDiv").height() + 100) + 'px');
        }
        if (mainContentPartHeight < $(".sideMenuMainDiv").height()) {
            $(".mainContentPart").css('height', ($(".sideMenuMainDiv").height() + 100) + 'px');
        }

    });
});

function printNFLSelection() {
    var NFLcontent = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Untitled Document</title><link rel="stylesheet" type="text/css" href="../Styles/print.css" /></head><body style="margin: auto 0;"><div class="logoDiv"><img height="67" width="126" alt="prilosecOTC" src="/LocaleData/enUS/Assets/Images/logo.png" alt="PrilosecOTC" title="PrilosecOTC"></div><div class="printSiteContent"><span>PrilosecOTC.com</span></div><div class="clear"></div><div class="nflprint"><div class=""><img src="/Common/Assets/images/nflprintimage1.jpg" width="515" height="228" alt="The Toughest Blockers in the NFL" title="The Toughest Blockers in the NFL" /></div><div class="spacer-20"></div>';

    if (document.getElementById('centerNFLtranscript')) {
        var NFLcontent1 = document.getElementById('centerNFLtranscript').innerHTML
        NFLcontent = NFLcontent + '<div class="transcript" style="width:600px">' + NFLcontent1 + '</div>';
    }

    NFLcontent = NFLcontent + '<div class="spacer-20"></div><div class="nflcalloutsection"><div class="calloutsectionleft"><img src="/Common/Assets/Images/nflprintimage2.jpg" alt="THE MOST VALUABLE PROTECTORS" width="153" height="46" /><div class="calloutcontent"><div class="callouthead">THE MOST VALUABLE PROTECTORS</div><p>Like Prilosec OTC, offensive lines provide powerful protection, so we created the Madden Most Valuable Protectors Award to honor the best.</p><p><a href="#">CHECK OUT THE MADDEN MVP AWARD</a></p></div></div><div class="calloutsectionmiddle"><div class=""><img src="/Common/Assets/Images/nflprintimage4.jpg" alt="Take your own 14 days challenge" /></div><p style="margin-top:-120px;">Just one pill a day for two weeks&ndash;it worked for offensive linemen Anthony Herrera and David Diehl under tough training camp conditions. Now try Prilosec OTC for yourself and save.<br /><br /><a href="#">TAKE THE 14-DAY CHALLENGE</a></p></div><div class="calloutsectionright"><img src="/Common/Assets/Images/nflprintimage3.jpg" alt="THE TOUGHEST BLOCKERS TELL ALL" width="152" height="46" /><div class="calloutcontent"><div class="callouthead">THE TOUGHEST BLOCKERS TELL ALL</div><p>Behind-the-scenes video puts you at the table and in the conversation as we follow offensive lines from across the NFL in O-Line Confidential.</p><p><a href="#">SEE O-LINE CONFIDENTIAL ON NFL.COM</a></p></div></div></div><div class="clear"></div><div class="subfooterline"></div><div class="subfooter_promotions"><div class="promotionimages"><img src="/Common/Assets/Images/subfooter_imagetext.png" alt="" width="48" height="24" /><img src="/Common/Assets/Images/subfooter_NFL_Logo.png" alt="" width="23" height="24" /></div><div class="promotioncontent">&copy; 2010 NFL Properties LLC. Team names/logos/indicia are trademarks of the teams indicated. All other NFL-related trademarks are trademarks of the National Football League. NFL PLAYERS is a trademark of National Football League Players Incorporated. John Madden image courtesy of ABC Sports.</div><div class="promotionimages"><img src="/Common/Assets/Images/subfooter_NFL_Plants.png" alt="" width="21" height="24" /></div></div></div></body></html>';
    var pwin = window.open('', 'print_content', 'width=700,height=800,top=20,left=20,resizable=No,scrollbars=1');

    pwin.document.open();
    pwin.document.write(content);
    pwin.document.close();


}


/* Password Strength methods */

function Password(arg_password) {
    var password = arg_password;
    this.lcase_count = 0;
    this.ucase_count = 0;
    this.num_count = 0;
    this.length = 0;
    this.strength = 0;
    this.runs_score = 0;
    this.verdict = '';
    this.lcase_count = password.match(/[a-z]/g);
    this.lcase_count = (this.lcase_count) ? this.lcase_count.length : 0;
    this.ucase_count = password.match(/[A-Z]/g);
    this.ucase_count = (this.ucase_count) ? this.ucase_count.length : 0;
    this.num_count = password.match(/[0-9]/g);
    this.num_count = (this.num_count) ? this.num_count.length : 0;
    // These numbers are just guesses on my part (and not
    // all that educated, either ;) Adjust accordingly.
    var verdict_conv = { 'veryweak': 0, 'weak': 12, 'medium': 23, 'strong': 35 };

    // These are weighting factors.  I figure that including
    // numbers is a little better than including uppercase
    // because numbers probably are not vulnerable to
    // dictionary searches, and including special chars is
    // even better.  These factors provide yet another
    // dimension.  Again, there are only guesses.
    /* var flc = 1.0;  // lowercase factor
    var fuc = 1.0;  // uppercase factor
    var fnm = 1.3;  // number factor
    var fsc = 1.5;  // special char factor
    */
    this.getStrength = function () {
        this.length = password.length;

        if (parseInt(this.length) < parseInt(3)) {
            this.verdict = { 'val': 'Invalid', 'style': 'msg_red', 'flag': 0 };
        }
        else {
            if (this.strength == 0) {
                if (this.length > 3) { this.strength = 12; }
            }
            if (this.strength == 12) {
                if (password.match(/[a-z]/)) { this.strength += 1;  }
                if (password.match(/[A-Z]/)) { this.strength += 5;  }
                if (password.match(/\d+/)) { this.strength += 5;  }
            }
            if (this.strength == 23) {
                if (password.match(/(\d.*\d.*\d)/)) { this.strength += 5;  }
                if (password.match(/[!,@#$%^&*?_~]/)) { this.strength += 5;  }
                if (password.match(/[a-z]/) && password.match(/[A-Z]/) && password.match(/\d/) && password.match(/[!,@#$%^&*?_~]/)) { this.strength += 2;  }
            }
           // console.log(this.strength + "------S" + verdict_conv.strong + "------M" + verdict_conv.medium + "------W" + verdict_conv.weak);
            if (this.strength >= verdict_conv.strong)
                this.verdict = { 'val': 'Strong', 'style': 'msg_green', 'flag': 3 };
            if ((this.strength >= verdict_conv.medium) && (this.strength < verdict_conv.strong))
                this.verdict = { 'val': 'Good', 'style': 'msg_lgreen', 'flag': 2 };
            if ((this.strength > verdict_conv.weak) && (this.strength <= verdict_conv.medium))
                this.verdict = { 'val': 'Weak', 'style': 'msg_orange', 'flag': 1 };
            if ((this.strength >= verdict_conv.veryweak) && (this.strength < verdict_conv.weak))
                this.verdict = { 'val': 'Invalid', 'style': 'msg_red', 'flag': 0 };
        }

        return this.verdict;
    }

    // This is basically an edge detector with a 'rectified' (or
    // absolute zero) result.  The difference of adjacent equivalent 
    // char values is zero.  The greater the difference, the higher
    // the result.  'aaaaa' sums to 0. 'abcde' sums to 1.  'acegi'
    // sums to 2, etc.  'aaazz', which has a sharp edge, sums to  
    // 6.25.  Any thing 1 or below is a run, and should be considered
    // weak.

}
$(document).ready(function() {

    $('.reg_password').keyup(function(e) {

        checkPassword($(this).find('input:password'));
    });

    $('#Regis_OverLay').mouseover(function() {
      
        var errTop = $(this).offset().top, errLeft = $(this).offset().left;

        $(this).parent().next().css({ 'display': 'block', 'position': 'absolute', 'top': errTop - 40, 'left': errLeft - 150 });
    });
    
    $('#Regis_OverLay').mouseleave(function() {
        $(this).parent().next().hide();
    });
});

$(function () {
    str = $("div.progressBar").find('span')
    //console.log(str.length);
    
    
   
});
var cls = new Array("pass_red", "pass_orange", "pass_lgreen", "pass_green");
$.iterate = function (obj) {
    for (var x = 0; x < str.length; x++) {

        if ($(str[x]).attr('class') == '') {
            $(str[obj]).attr('class', cls[obj]);
        }
        else {
            $(str[obj+1]).attr('class', '');
        }

    }
}

function checkPassword(e) {

    //var special_chars = "~!@#$%&*";
    //$("div.regpass_strength > div.progressBar > span").each(function() { $(this).attr('class', ''); });



    var pwdVal = $(e).val();
    $(e).siblings('.validate_err').addClass('hdisplay');
    if (pwdVal != '') {
        var pw = new Password(pwdVal);
        var verdict = pw.getStrength();
        //console.log(verdict);
        var hint = '';
        var count = 1;
        /*if (pw.length < 8){hint += count + ". Enter atleast 8 characters. <br />";count++;}
        if (pw.lcase_count == 0){hint += count + ". Try adding some lowercase letters. <br />";count++;}
        if (pw.ucase_count == 0){hint += count + ". Try adding some uppercase letters. <br />";count++;}
        if (pw.num_count == 0) {hint += count + ". Try adding some numbers. <br />";count++;}
        if (pw.run_score <= 1) {hint += count + ". Avoid runs (e.g. 'aaaa', 'efghi', '1234'). <br />";count++;}*/
        var element = $(e).siblings('.hint');
        $(element).html(hint);
        element = $("div.regpass_strength >  span");
        $(element).html(verdict.val).attr('class', verdict.style);
        

        switch (verdict.val.toLowerCase()) {
            case 'invalid': $("div.progressBar").find('span').each(function () {
                $.iterate(verdict.flag);
                //$(this).attr('class', cls[$(this).index()]);
            });
                break;
            //attr('class',cls[$("div.regpass_strength > div.progressBar > span").index()]);break;  
            case 'weak': $("div.progressBar").find('span').each(function () {
                //console.log($(this).index());
                //$(this).attr('class', cls[$(this).index()]);
                $.iterate(verdict.flag);
            }); break;
        case 'good': $("div.progressBar").find('span').each(function () {
            //console.log($(this).index());
            //$(this).attr('class', cls[$(this).index()]);
            $.iterate(verdict.flag);
            }); break;
        case 'strong': $("div.progressBar").find('span').each(function () {
            //console.log($(this).index());
            // $(this).attr('class', cls[$(this).index()]);
            $.iterate(verdict.flag);
            }); break;
        }
    }
else {
   // console.log('dsadadafaiugdkjh v');

   
    $("div.regpass_strength span.msg_red").html(' ');
    $("div.regpass_strength > div.progressBar > span").each(function () { $(this).attr('class', ''); });
    
    }
}


/* Javascript to load Touchstorm video file*/
function TouchStormVideoFile(fileid, frameURL) {

    var flashvars = {
        'file': 'http://www.youtube.com/watch?v=' + fileid,
        'plugins': 'gapro-1, http://cdn.visiblemeasures.com/swf/as3/v4.5/jwplayerplugin.swf&jwplayerplugin.key=056f1f582a5811e0b6dd0019b9f157b5',
        'gapro.accountid': 'UA-2283429-1',
        'gapro.trackstarts': 'true',
        'gapro.trackpercentage': 'true',
        'gapro.tracktime': 'true',
        'gapro.trackdetails': 'true',
        'gapro.trackingmode': 'bridge',
        'gapro.bridgeobject': 'window.pageTracker',
        'gapro.idstring': '||mediaid||-||title||',
        'controlbar': 'over',
        'skin': '/Common/Assets/Skins/prc.zip',
        'stretching': 'uniform',
        'image': frameURL
    };

    var params = {
        'allowfullscreen': 'true',
        'allowscriptaccess': 'always',
        'wmode': 'transparent'
    };

    var attributes =
    {
        'id': 'touchstormvideoplayer',
        'name': 'touchstormvideoplayer'
    };
    
    /*Note: "touchstormvideoplayer" is the DIV Control which is placed in the webpage and this function will embade video into the "touchstormvideoplayer" div control */
    swfobject.embedSWF("/Common/Assets/Videos/Application.swf", "touchstormvideoplayer", "382", "215", "9", "/Common/Assets/Videos/playerProductInstall.swf", flashvars, params);
}
/* Javascript to load Touchstorm video file2*/
function TouchStormVideoFile2(fileid2, frameURL2) {

    var flashvars2 = {
        'file': 'http://www.youtube.com/watch?v=' + fileid2,
        'plugins': 'gapro-1, http://cdn.visiblemeasures.com/swf/as3/v4.5/jwplayerplugin.swf&jwplayerplugin.key=056f1f582a5811e0b6dd0019b9f157b5',
        'gapro.accountid': 'UA-2283429-1',
        'gapro.trackstarts': 'true',
        'gapro.trackpercentage': 'true',
        'gapro.tracktime': 'true',
        'gapro.trackdetails': 'true',
        'gapro.trackingmode': 'bridge',
        'gapro.bridgeobject': 'window.pageTracker',
        'gapro.idstring': '||mediaid||-||title||',
        'controlbar': 'over',
        'skin': '/Common/Assets/Skins/prc.zip',
        'stretching': 'uniform',
        'image': frameURL2
    };

    var params2 = {
        'allowfullscreen': 'true',
        'allowscriptaccess': 'always',
        'wmode': 'transparent'
    };

    var attributes2 =
    {
        'id': 'touchstormvideoplayer2',
        'name': 'touchstormvideoplayer2'
    };
    /*Note: "touchstormvideoplayer2" is the DIV Control which is placed in the webpage and this function will embade video into the "touchstormvideoplayer2" div control */
    swfobject.embedSWF("/Common/Assets/Videos/Application.swf", "touchstormvideoplayer2", "382", "215", "9", "/Common/Assets/Videos/playerProductInstall.swf", flashvars2, params2);
}

function TouchStormVideoFile3(fileid2, frameURL2) {

    var flashvars2 = {
        'file': 'http://www.youtube.com/watch?v=' + fileid2,
        'plugins': 'gapro-1, http://cdn.visiblemeasures.com/swf/as3/v4.5/jwplayerplugin.swf&jwplayerplugin.key=056f1f582a5811e0b6dd0019b9f157b5',
        'gapro.accountid': 'UA-2283429-1',
        'gapro.trackstarts': 'true',
        'gapro.trackpercentage': 'true',
        'gapro.tracktime': 'true',
        'gapro.trackdetails': 'true',
        'gapro.trackingmode': 'bridge',
        'gapro.bridgeobject': 'window.pageTracker',
        'gapro.idstring': '||mediaid||-||title||',
        'controlbar': 'over',
        'skin': '/Common/Assets/Skins/prc.zip',
        'stretching': 'uniform',
        'image': frameURL2
    };

    var params2 = {
        'allowfullscreen': 'true',
        'allowscriptaccess': 'always',
        'wmode': 'transparent'
    };

    var attributes2 =
    {
        'id': 'touchstormvideoplayer2',
        'name': 'touchstormvideoplayer2'
    };

    swfobject.embedSWF("/Common/Assets/Videos/Application.swf", "touchstormvideoplayer", "240", "179", "9", "/Common/Assets/Videos/playerProductInstall.swf", flashvars2, params2);
}

function VideoFile1(fileName) {

    var flashvars = {
        'file': fileName,
        'plugins': 'gapro-1, http://cdn.visiblemeasures.com/swf/as3/v4.5/jwplayerplugin.swf&jwplayerplugin.key=056f1f582a5811e0b6dd0019b9f157b5',
        'controlbar': 'over',
        'skin': '/Common/Assets/Skins/prc.zip',
        'stretching': 'uniform'

    };

    var params = {
        'allowfullscreen': 'true',
        'allowscriptaccess': 'always',
        'wmode': 'transparent'
    };

    var attributes =
    {
        'id': 'Convertvideoplayer',
        'name': 'Convertvideoplayer'
    };

    swfobject.embedSWF("/Common/Assets/Videos/Application.swf", "Convertvideoplayer", "495", "340", "9", "/Common/Assets/Videos/playerProductInstall.swf", flashvars, params);
}

