Can You See Why This Still Does Not Work?

Discussion in 'Scripts' started by the Patrician, Jan 9, 2010.

  1. #1
    This script is supposed to be a banner rotator script.
    I still can't find where the error is that keeps it from working.
    Would any of you be able to correct it?
    Thanks!

    ======================

    <script type="text/javascript">
    <!-- Begin
    rnd.today=new Date();
    rnd.seed=rnd.today.getTime();

    function rnd() {
    rnd.seed = (rnd.seed*9301+49297) % 233280;
    return rnd.seed/(233280.0);
    };

    function rand(number) {
    var result = Math.ceil(rnd()*number);
    if (!result)result++;
    return result
    };
    var ad_cnt4 = 4;
    var ad4 = rand(ad_cnt4);
    var link4;
    var adBanner4;
    var width4
    var height4
    if (ad4==1) {
    link4="http://clickserve.cc-dt.com/link/click?lid=##########";
    adBanner4="http://www.bellbookandcandlepublications.com/greenwoodsvillage/images/adbanners/new%20rules%20marketing.jpg";
    width4="130";
    height4="";
    alt4="New Rules of Marketing";
    }
    if (ad4==2) {
    link4="http://clickserve.cc-dt.com/link/click?lid=#########";
    adBanner4="http://www.bellbookandcandlepublications.com/greenwoodsvillage/images/adbanners/facebook%20marketing.jpg";
    width4="130";
    height4="";
    alt4="Facebook Marketing";
    }
    if (ad4==3) {
    link4="http://clickserve.cc-dt.com/link/click?lid=###########";
    adBanner4="http://www.bellbookandcandlepublications.com/greenwoodsvillage/images/adbanners/internet%20riches.jpg";
    width4="130";
    height4="";
    alt4="Internet Riches";
    }
    if (ad4==4) {
    link4="http://clickserve.cc-dt.com/link/click?lid=##########";
    adBanner4="http://www.bellbookandcandlepublications.com/greenwoodsvillage/images/adbanners/aff%20market%20on%20web.jpg";
    width4="130";
    height4="";
    alt4="Affiliate Marketing on the Web";
    }
    document.write('<center><a href="' + link4 + '" target="_blank">');
    document.write('<img src="' + adBanner4 + '" width=' + width4 + ' height=' + height4 + ' border=0 alt="' + alt4 + '"></a>');
    document.write('</center>');
    // End -->
    </SCRIPT>

    ======================
     
    the Patrician, Jan 9, 2010 IP