
  
  /***************** productspage.php scripts *********************************/
function Special1WinMacIntercept() {
    if (document.Special1Form.WinMacRadio[1].checked == 1) {
        x = document.Special1Form.item_1.selectedIndex;
        document.Special1Form.item_1[x].value = document.Special1Form.item_1.value.substr(0, 7) + "M" + Special1Form.item_1.value.substr(8);
        x = document.Special1Form.item_2.selectedIndex;
        document.Special1Form.item_2[x].value = document.Special1Form.item_2.value.substr(0, 7) + "M" + Special1Form.item_2.value.substr(8);
        x = document.Special1Form.item_3.selectedIndex;
        document.Special1Form.item_3[x].value = document.Special1Form.item_3.value.substr(0, 7) + "M" + Special1Form.item_3.value.substr(8);
        x = document.Special1Form.item_4.selectedIndex;
        document.Special1Form.item_4[x].value = document.Special1Form.item_4.value.substr(0, 7) + "M" + Special1Form.item_4.value.substr(8);

    }
    return true;
}



function Special2WinMacIntercept()
{

    if (document.Special2Form.WinMacRadio[1].checked == 1) {
        document.Special2Form.item_1.value = document.Special2Form.item_1.value.substr(0, 7) + "M" + Special2Form.item_1.value.substr(8);
        x = document.Special2Form.item_2.selectedIndex;
        document.Special2Form.item_2[x].value = document.Special2Form.item_2[x].value.substr(0, 7) + "M" + Special2Form.item_2[x].value.substr(8);
    }

    return true;
}

function Special3WinMacIntercept()
{
    x1 = document.Special3Form.item_1.selectedIndex;
    x2 = document.Special3Form.item_2.selectedIndex;

    if(document.Special3Form.WinMacRadio[1].checked==1) {
        document.Special3Form.item_1[x1].value = document.Special3Form.item_1[x1].value.substr(0, 7) + "M" + Special3Form.item_1[x1].value.substr(8);
        document.Special3Form.item_2[x2].value = document.Special3Form.item_2[x2].value.substr(0, 7) + "M" + Special3Form.item_2[x2].value.substr(8);
    }
    caretcount=0;
    for(i=0;i<document.Special3Form.item_1[x1].value.length;i++)
    {
        if(document.Special3Form.item_1[x1].value[i]=='^')
        {
            caretcount++;
            if (caretcount == 3) {
                strtindex1 = i + 1;
            }
            if (caretcount == 4) {
                endindex1 = i;
            }
        }
     }
     caretcount=0;
    for(i=0;i<document.Special3Form.item_2[x2].value.length;i++)
    {
        if(document.Special3Form.item_2[x2].value[i]=='^')
        {
            caretcount++;
            if(caretcount==3)
                strtindex2=i+1;
            if(caretcount==4)
                endindex2=i;
        }
     }


     if (document.Special3Form.item_1[x1].value.substring(strtindex1, endindex1) < document.Special3Form.item_2[x2].value.substring(strtindex2, endindex2)) {
         newprice = document.Special3Form.item_1[x1].value.substring(strtindex1, endindex1);
         newprice = newprice / 2;
         document.Special3Form.item_1[x1].value = document.Special3Form.item_1[x1].value.substr(0, strtindex1) + newprice + Special3Form.item_1[x1].value.substr(endindex1);
     }
     else {
         newprice = document.Special3Form.item_2[x2].value.substring(strtindex2, endindex2);
         newprice = newprice / 2;
         document.Special3Form.item_2[x2].value = document.Special3Form.item_2[x2].value.substr(0, strtindex2) + newprice + Special3Form.item_2[x2].value.substr(endindex2);
     }
     

    return true;
}  //figure out which one is less and change the price to 1/2, also make changes to M (mac) or W (windows) designation


function Special4WinMacIntercept()
{
    if(document.Special4Form.WinMacRadio[1].checked==1) {
        document.Special4Form.item_1.value = document.Special4Form.item_1.value.substr(0, 7) + "M" + Special4Form.item_1.value.substr(8);
        document.Special4Form.item_2.value = document.Special4Form.item_2.value.substr(0, 7) + "M" + Special4Form.item_2.value.substr(8);
        }
    return true;
}
    
    
    
 /********************* index.html scripts *********************************/

        var randomQuote = new Array(
      "\"We love our Micrograms software. You have made my job easier.\"",
      "\"I especially like Micrograms math software... the kids groan when their lab time is over.\"",
      "\"Extremely user-friendly and wonderfully easy to use on the network.\"",
      "\"The children love your software!... it makes learning fun!\"",
      "\"...easy to use, engages students, and fits curriculum standards.\"",
      "\"It is educational and still fun - what a winning combination!\"",
      "\"Both students and staff think Micrograms software is wonderful.\"",
      "\"...complement the curriculum and have greatly helped with improving skills and understanding.\"",
      "\"Children stay focused on these programs, and... we find that they fit nicely with state standards.\"",
      "\"Every day several classes request to use Wild West Math,... best program on the market for drilling basic facts...\"",
      "\"Staying focused is a difficult task for my students, but your animation catches their attention and helps them find the success they need.\"",
      "\"The variety of ways a concept is expressed in these programs makes it exciting for the students.\""
      );

      function randomComment()
      {
          var arrayCount = randomQuote.length;
          var randomNum = Math.floor((Math.random() * arrayCount));
          document.getElementById('comchange').innerHTML = randomQuote[randomNum];
          setTimeout("randomComment()", 1 * 10000);
      }

      var randomProgram = new Array(
    "./pageGraphics/Aabc.gif",
    "./pageGraphics/Abill.gif",
    "./pageGraphics/Afract.gif",
    "./pageGraphics/Ajake.gif",
    "./pageGraphics/Am1.gif",
    "./pageGraphics/Am2.gif",
    "./pageGraphics/Awest.gif",
    "./pageGraphics/ESClock.gif",
    "./pageGraphics/ESFAP.gif",
    "./pageGraphics/ESmathI.gif",
    "./pageGraphics/ESmathII.gif",
    "./pageGraphics/ESPenny.gif",
    "./pageGraphics/ESSS.gif",
    "./pageGraphics/Nbetty.gif",
    "./pageGraphics/Ndesk.gif",
    "./pageGraphics/Nmarty.gif",
    "./pageGraphics/Npond.gif",
    "./pageGraphics/Atime.gif"
    );

      var randomProgramUrl = new Array(
    "./products/abcWorld.php",
    "./products/chuckWagonBill.php",
    "./products/fractions.php",
    "./products/shutterbugJake.php",
    "./products/mathosaurusI.php",
    "./products/mathosaurusII.php",
    "./products/wildWestMath.php",
    "./products/clockFaces.php",
    "./products/facesAndPlaces.php",
    "./products/mathosaurusI.php",
    "./products/mathosaurusII.php",
    "./products/pennyPanda.php",
    "./products/superScienceShow.php",
    "./products/alphaBetty.php",
    "./products/sportsDesk.php",
    "./products/martysFamilyReader.php",
    "./products/ponderingProblems.php",
    "./products/clockFaces.php"
    );
    function randomProduct() {
        var arrayCount = randomProgram.length;
        var randomNum = Math.floor((Math.random() * arrayCount));
        document.getElementById('rotatepic').src = randomProgram[randomNum];
        document.getElementById('rotateurl').href = randomProgramUrl[randomNum];
        setTimeout("randomProduct()", 1 * 12000);
    }


    var AdHeaderGif = new Array(
    "./pageGraphics/Header1.gif",
    "./pageGraphics/Header2.gif"
    );
    var headerFrame = 0; 
    function headerAnim() {
        document.getElementById('adhomeanim').src = AdHeaderGif[headerFrame];
        headerFrame ^= 1;
        setTimeout("headerAnim()", 1 * 5000);
    }
       
   

