﻿function PageLoad() {
    adImages = new Array("Images/Teaser1-Line1.gif", "Images/Teaser1-Line2.gif", "Images/Teaser1-Line3.gif", "Images/Teaser1-Line4.gif");
    // Add links to the images
    adURL = new Array("www.detoxity.co.uk", "www.detoxity.co.uk", "www.detoxity.co.uk", "www.detoxity.co.uk");
    thisAd = 0;
    imgCt = adImages.length;
    // The following Controls what is shown for the teasers and also initiates a starting value.
    //types are 0=replace text, 1=append text
    psmt1loop = 0;
    psmt1Array = new Array("Thai Massage...", "Possibly the best massage<br /> you will experience.", "<a href=\"http://www.detoxity.co.uk/Thai-Massage.html\">Click Here For Further Details</a>");
    psmt1cnt = psmt1Array.length; pst1time = 3500;

    psmt2loop = 0;
    psmt2Array = new Array("To find out more info on Detox therapies.<br/>", "Call Nina on 07709 524544");
    psmt2cnt = psmt2Array.length; pst2time = 3500;

    psmt3loop = 0;
    psmt3Array = new Array("Are you constantly tired and have no energy?",
                            "Do you feel depressed and toxic?",
                            "Have you stopped glowing on the inside and outside?",
                            "It's time to Detox your mind, body and spirit!");
    psmt3cnt = psmt3Array.length; pst3time = 4000;
    
    psmt4loop = 0;
    psmt4Array = new Array("Try our 7 Day Detoxity diet",
                            "For fast, yet healthy weight loss!",
                            "<a href=\"http://www.detoxity.co.uk/Detoxity-7-Day-Diet.html\">Click Here For More Details</a>");
    psmt4cnt = psmt4Array.length; pst4time = 3500;
    
 
    psmt5loop = 0;
    psmt5Array = new Array("Think healthy food is boring?",
                            "Think Again!",
                            "<a href=\"http://www.detoxity.co.uk/Detox-Recipes.html\">Click here for mouth-watering recipes</a>");
    psmt5cnt = psmt5Array.length; pst5time = 3500;

 
    psmt6loop = 0;
    psmt6Array = new Array("Do you have a loved one in poor shape?",
                            "Distant Healing can help them...",
                            "<a href=\"http://www.detoxity.co.uk/Distant-Healing.html\">Click Here For More Details</a>" );
    psmt6cnt = psmt6Array.length; pst6time = 3500;
    
    psmt7loop = 0;
    psmt7Array = new Array("Reiki and how it can help you",
                            "<a href=\"http://www.detoxity.co.uk/Reiki-Healing.html\">Click here to find out more!</a>");
    psmt7cnt = psmt7Array.length; pst7time = 3500;

 
    psmt8loop = 0;
    psmt8Array = new Array("Aqua Detox","See the toxins come out of your body!",
                            "<a href=\"http://www.detoxity.co.uk/Aqua-Detox.html\">Click here for more info.</a>");
    psmt8cnt = psmt8Array.length; pst8time = 3500;

 
    psmt9loop = 0;
    psmt9Array = new Array("Chi Machine",
                            "The amazing machine that exercises your body whilst you lie back and relax!",
                            "<a href=\"http://www.detoxity.co.uk/Chi-Machine.html\">Click here to find out more!</a>");
    psmt9cnt = psmt9Array.length; pst9time = 3500;

}
function rotate() {
    thisTimeOut = 3500;
    //if (document.images) {
     //   if (document.cycle.complete) {
      //      if (thisAd == imgCt) { thisAd = 0; }
       //     document.cycle.src = adImages[thisAd];
        //    thisAd++;
   //     }
        // This sets the interval to which the images and quotes are rotated. 1000 equals 1 second
   //     if (thisAd == imgCt)
   //     { thisTimeOut = 10000; }
   //     else
   //     { thisTimeOut = 3500; }
   //     setTimeout("rotate()", thisTimeOut);
   // }
}
function ProcessBanners() {

    if (document.getElementById('psmt1')) { Processpsmt1(); }
    if (document.getElementById('psmt2')) { Processpsmt2(); }
    if (document.getElementById('psmt3')) { Processpsmt3(); }
    if (document.getElementById('psmt4')) { Processpsmt4(); }
    if (document.getElementById('psmt5')) { Processpsmt5(); }
    if (document.getElementById('psmt6')) { Processpsmt6(); }
    if (document.getElementById('psmt7')) { Processpsmt7(); }
    if (document.getElementById('psmt8')) { Processpsmt8(); }
    if (document.getElementById('psmt9')) { Processpsmt9(); }
}
function Processpsmt1() {
    ProcessText('psmt1', psmt1Array[psmt1loop], 0);psmt1loop++;
    if (psmt1loop == psmt1cnt) { psmt1loop = 0; setTimeout("Processpsmt1()", (pst1time * 2)); } else { setTimeout("Processpsmt1()", pst1time); }
}
function Processpsmt2() {
    if (psmt2loop == 0) { ProcessText('psmt2', psmt2Array[psmt2loop], 0); } //Alway use a type=0 in the first part of the loop.
    else { ProcessText('psmt2', psmt2Array[psmt2loop], 1); }
    psmt2loop++;
    if (psmt2loop == psmt2cnt) { psmt2loop = 0; setTimeout("Processpsmt2()", (pst2time * 2)); } else { setTimeout("Processpsmt2()", pst2time); }
}
function Processpsmt3() {
    if (psmt3loop == 0) { ProcessText('psmt3', psmt3Array[psmt3loop], 0); } //Alway use a type=0 in the first part of the loop.
    else { ProcessText('psmt3', psmt3Array[psmt3loop], 1); }
    psmt3loop++;
    if (psmt3loop == psmt3cnt) { psmt3loop = 0; setTimeout("Processpsmt3()", (pst3time * 2)); } else { setTimeout("Processpsmt3()", pst3time); }
}
function Processpsmt4() {
    ProcessText('psmt4', psmt4Array[psmt4loop], 0); psmt4loop++;
    if (psmt4loop == psmt4cnt) { psmt4loop = 0; setTimeout("Processpsmt4()", (pst4time * 2)); } else { setTimeout("Processpsmt4()", pst4time); }
}
function Processpsmt5() {
    ProcessText('psmt5', psmt5Array[psmt5loop], 0); psmt5loop++;
    if (psmt5loop == psmt5cnt) { psmt5loop = 0; setTimeout("Processpsmt5()", (pst5time * 2)); } else { setTimeout("Processpsmt5()", pst5time); }
}
function Processpsmt6() {
    ProcessText('psmt6', psmt6Array[psmt6loop], 0); psmt6loop++;
    if (psmt6loop == psmt6cnt) { psmt6loop = 0; setTimeout("Processpsmt6()", (pst6time * 2)); } else { setTimeout("Processpsmt6()", pst6time); }
}
function Processpsmt7() {
    ProcessText('psmt7', psmt7Array[psmt7loop], 0); psmt7loop++;
    if (psmt7loop == psmt7cnt) { psmt7loop = 0; setTimeout("Processpsmt7()", (pst7time * 2)); } else { setTimeout("Processpsmt7()", pst7time); }
}
function Processpsmt8() {
    ProcessText('psmt8', psmt8Array[psmt8loop], 0); psmt8loop++;
    if (psmt8loop == psmt8cnt) { psmt8loop = 0; setTimeout("Processpsmt8()", (pst8time * 2)); } else { setTimeout("Processpsmt8()", pst8time); }
}
function Processpsmt9() {
    ProcessText('psmt9', psmt9Array[psmt9loop], 0); psmt9loop++;
    if (psmt9loop == psmt9cnt) { psmt9loop = 0; setTimeout("Processpsmt9()", (pst9time * 2)); } else { setTimeout("Processpsmt9()", pst9time); }
}

function Pause(millis) {
    var date = new Date();var curDate = null;
    do { curDate = new Date(); }
    while (curDate - date < millis);
} 

function ProcessText(id,text,type) {
    switch(type)
    {
    case 0:
        document.getElementById(id).innerHTML = text;
        break;
    case 1:
        document.getElementById(id).innerHTML = document.getElementById(id).innerHTML + '<br>' + text;
        break;
    case 2:
        id.filters[0].Apply(); // the zero her refers to the filter defined in the element. You can have multiple filters applied on the element.
        document.getElementById(id).innerHTML = text;
        id.filters.revealTrans.transition = 19;
        id.filters[0].Play();
        break;
    default:
        document.getElementById(id).innerHTML = text;
}
 }
