  var timer;

  function showPage(page)
  {
        for(i=0;i<pages.length;i++)
    {
      if(pages[i][1] == 1 && pages[i][0] != page)
      {
        new Effect.BlindUp(pages[i][0]);
        pages[i][1] = 0;
      }
      else if(pages[i][1] == 0 && pages[i][0] == page)
      {
        timer = setTimeout("new Effect.BlindDown('" + page+"')", 1100);
        pages[i][1] = 1;
      }
    }
  }

  function showPerson(who)
  {
    for(i=0;i<people.length;i++)
    {
      if(people[i][1] == 1 && people[i][0] != who)
      {
        new Effect.SlideUp(people[i][0]);
        people[i][1] = 0;
      }
      else if(people[i][1] == 0 && people[i][0] == who)
      {
        new Effect.SlideDown(who);
        people[i][1] = 1;
      }
  
    }
  }




  function showClients(who)
  {
    for(i=0;i<clients.length;i++)
    {
      if(clients[i][1] == 1 && clients[i][0] != who)
      {
        new Effect.Fade(clients[i][0], { duration: 0.4 });
        clients[i][1] = 0;
      }
      else if(clients[i][1] == 0 && clients[i][0] == who)
      {
        window.clearTimeout(timer);
        timer = setTimeout("new Effect.Appear('" + who+"', { duration: 0.4 })", 410);
        clients[i][1] = 1;
      }
    }

    //also need to change all menu images

    if((who.charAt(who.length-1))!=2)
    {
      document.getElementById("imgHEALTH (a) BEAUTY").src="/images/dynamic/internalMenuImage.php?tp=menuNormal&tx=HEALTH (a) BEAUTY";
      document.getElementById("imgFASHION").src="/images/dynamic/internalMenuImage.php?tp=menuNormal&tx=FASHION";
      document.getElementById("imgLIFESTYLE").src="/images/dynamic/internalMenuImage.php?tp=menuNormal&tx=LIFESTYLE";

      document.getElementById("img"+who).src="/images/dynamic/internalMenuImage.php?tp=menuSelected&tx="+who;
    }
  }



/****************/
// Testimonials //
/****************/
  var testimonials = 4;
  var testiOn = 4;
  var testimonialTimer = new Array();

  var fadeTime = 1.5; // in seconds 0.0 - 1
  var displayTime = 9; // in seconds
  function changeTestimonial(){
    testiOn++;
    if(testiOn>testimonials)
      testiOn = 1;
      
    testimonialTimer[1] = setTimeout("new Effect.Appear('testi"+ testiOn + "A', { duration: fadeTime })", 0);
    testimonialTimer[2] = setTimeout("new Effect.Appear('testi"+ testiOn + "B', { duration: fadeTime })", 1500);
    testimonialTimer[3] = setTimeout("new Effect.Fade('testi"+ testiOn + "A', { duration: fadeTime })", ((displayTime) * 1000));
    testimonialTimer[4] = setTimeout("new Effect.Fade('testi"+ testiOn + "B', { duration: fadeTime })", ((displayTime) * 1000));



    testimonialTimer[0] = setTimeout("changeTestimonial()", ((displayTime + (fadeTime)) * 1002));
  }
  // Start the runner in testimonial page...  
  
  


/****************/
// client Fader List //
/****************/
var clientRunner = null;
var clientFadeCounter = 0;
var clientFadeTimer;
var clientFadeTimers = new Array();

function clientFader()
{

  clientFadeCounter++;
  setNo = clientFadeCounter%6;
//alert(setNo);
  setToHighlight = 1;
  switch(setNo)
  { 
    case 0:
      setToHighlight = 1;
    break;
    case 1:
      setToHighlight = 3;
    break;
    case 2:
      setToHighlight = 0;
    break;
    case 3:
      setToHighlight = 4;
    break;
    case 4:
      setToHighlight = 2;
    break;
    case 5:
      setToHighlight = 5;
    break;
  }
  for(i=0;i<20;i++)
  {
  
//    alert(i*setToHighlight + " " +setToHighlight);
    if(document.getElementById("clientRow" + ((6*i)+setToHighlight) + "b")!=null)
    {
      clientFadeTimers[(20*i*setToHighlight)+1] = setTimeout("new Effect.Fade('clientRow" + ((6*i)+setToHighlight) + "b', { duration: 0.1 })", 1000);
      clientFadeTimers[(20*i*setToHighlight)+2] = setTimeout("new Effect.Appear('clientRow" + ((6*i)+setToHighlight) + "a', { duration: 1.0 })", 1100);

      clientFadeTimers[(20*i*setToHighlight)+3] = setTimeout("new Effect.Fade('clientRow" + ((6*i)+setToHighlight) + "a', { duration: 1.0 })", 5000);
      clientFadeTimers[(20*i*setToHighlight)+4] = setTimeout("new Effect.Appear('clientRow" + ((6*i)+setToHighlight) + "b', { duration: 0.1 })", 6000);
    }
  }
  clientRunner = setTimeout("clientFader()", 7000);
}





function setCookie(name,value,expires)
{
var path = "/";
var domain = "";
var secure = "";
// set time, it's in milliseconds
var today = new Date();
today.setTime( today.getTime() );

/*
if the expires variable is set, make the correct 
expires time, the current script below will set 
it for x number of days, to make it for hours, 
delete * 24, for minutes, delete * 60 * 24
*/
if ( expires )
{
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );

document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
( ( path ) ? ";path=" + path : "" ) + 
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}

function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=")
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1 
    c_end=document.cookie.indexOf(";",c_start)
    if (c_end==-1) c_end=document.cookie.length
    return unescape(document.cookie.substring(c_start,c_end))
    } 
  }
return null
}


// this deletes the cookie when called
function deleteCookie( name, path, domain ) {
if ( Get_Cookie( name ) ) document.cookie = name + "=" +
( ( path ) ? ";path=" + path : "") +
( ( domain ) ? ";domain=" + domain : "" ) +
";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}



  var imageTimer = new Array;
  var imageRunner = null;
  var nextImage = 0;
  var nextImageCookie = ((forceFirstImage != -1) ? forceFirstImage : getCookie('nextImage_'+imageType));
  if(nextImageCookie != null)
    nextImage = nextImageCookie;
 // alert(document.cookie);