var methods = new Array("slides1()","slides2()","slides3()","slides1()","slides2()");
meth=0;
var iw;
var ih;
var tw;
var txtw;
var twrw;
var iopac=0;
var titopac=0;
var txtopac=0;
var where=0;
var wheretitle=950;
var wherelearnmore=266;
var wheretext;
var allout=3;
var bigwords=true;
var mlincr=10;
var mrincr=20;

function slidemethods()
 { dothis=eval(methods[meth]);
  dothis;
   trythis=setInterval("slidemethods2()",8500);
  }
function slidemethods2()
 {
  dothis=eval(methods[meth]);
  dothis;
   
 }
function slides1()
 {thimage=eval('slide'+meth);
   thimagesrc=eval("slide"+meth+".src");
   document.slideimage.src=thimagesrc;
   iw=thimage.width;
   ih=thimage.height;
   var whitespace=950-iw;
   
   titleobj=document.getElementById("homeslideshowtitle");
   textobj=document.getElementById("homeslideshowtext");
   titleobj.innerHTML="<span class='slidetitle1'>"+slides[meth][0]+"</span>";
   textobj.style.filter="alpha(opacity=0)";
   textobj.innerHTML=slides[meth][1];
   formattext();
   
  
   
  
   document.getElementById("homeslideshowimage").style.left=-iw+"px";
   document.getElementById("homeslideshowimage").style.width=iw+"px";
  where=-iw;
  
   document.getElementById("homeslideshowimage").style.opacity=0;
   document.getElementById("homeslideshowtext").style.filter="alpha(opacity=0)";
   
   iopac=0;
  
  movetorightimage();
  fadeinimage();
  
 
  qq=setTimeout("movetolefttitle();",500);
  
 
  qqq=setTimeout("fadeintext();",1500);
  qqq=clearTimeout;
  if(slides[meth][2] !="")
    {document.getElementById("learnmore").innerHTML="<a href='"+slides[meth][2]+"' target='_blank'><img src='learnmore.gif' border=0></a>";
     document.getElementById("learnmore").style.top="266px";
     qqqq=setTimeout("raiselearnmore();",2000);}
  
  qqqqq=setTimeout("moveout();",7000);
  
 
  if(++meth > slideno)
    {meth=0;
     }
  qqqqq=clearTimeout();
   qqq=clearTimeout();
     qq=clearTimeout();
   
     
 
 }
function slides2()
 {thimage=eval('slide'+meth);
   thimagesrc=eval("slide"+meth+".src");
   document.slideimage.src=thimagesrc;
   
   iw=thimage.width;
   ih=thimage.height
   var whitespace=950-iw;
   titleobj=document.getElementById("homeslideshowtitle");
   textobj=document.getElementById("homeslideshowtext");
   titleobj.innerHTML="<span class='slidetitle2'>"+slides[meth][0]+"</span>";
   formattext();
   textobj.style.filter="alpha(opacity=0)";
   textobj.innerHTML=slides[meth][1];
   
    document.getElementById("homeslideshowtext").style.filter="alpha(opacity=0)";
  txtw=whitespace-100;
   document.getElementById("homeslideshowimage").style.left="0px";
   document.getElementById("homeslideshowimage").style.width=iw+"px";
   document.getElementById("homeslideshowimage").style.top="-265px";
   document.getElementById("homeslideshowimage").style.opacity=10;
   
   iopac=100;
  where=-265;
 
  movefromtopimage();
  qq=setTimeout("movetolefttitle();",500);
  
  
  qqq=setTimeout("fadeintext();",1500);
  qqq=clearTimeout;
  if(slides[meth][2] !="")
    {document.getElementById("learnmore").innerHTML="<a href='"+slides[meth][2]+"' target='_blank'><img src='learnmore.gif' border=0></a>";
     document.getElementById("learnmore").style.top="266px";
     qqqq=setTimeout("raiselearnmore();",2000);}
  qqqqq=setTimeout("moveout();",7000);
  
  if(++meth > slideno)
    {meth=0;
     }
  qqqqq=clearTimeout();
   qqq=clearTimeout();
     qq=clearTimeout();
   
     
 
 } 


function slides3()
 {thimage=eval('slide'+meth);
   thimagesrc=eval("slide"+meth+".src");
   document.slideimage.src=thimagesrc;
   
   iw=thimage.width;
   ih=thimage.height
   var whitespace=950-iw;
   titleobj=document.getElementById("homeslideshowtitle");
   textobj=document.getElementById("homeslideshowtext");
   textobj.style.filter="alpha(opacity=0)";
   titleobj.innerHTML="<span class='slidetitle3'>"+slides[meth][0]+"</span>";
  
   
   textobj.innerHTML=slides[meth][1];
   document.getElementById("homeslideshowtext").style.filter="alpha(opacity=0)";
   
  txtw=whitespace-100;
   document.getElementById("homeslideshowimage").style.left="0px";
   document.getElementById("homeslideshowimage").style.width=iw+"px";
   document.getElementById("homeslideshowimage").style.top="265px";
   document.getElementById("homeslideshowimage").style.opacity=0;
   
   iopac=0;
  where=265;
 formattext();
 
  movefrombottomimage();
  fadeinimage();
  wheretitle=950-tw+5;
  document.getElementById("homeslideshowtitle").style.top="-100px";
  document.getElementById("homeslideshowtitle").style.left=wheretitle+"px";
  
  twrw=-100;
   
  qq=setTimeout("movetitlefromtop();",500);
 
  
   document.getElementById("homeslideshowtext").style.filter="alpha(opacity=0)";
  qqq=setTimeout("fadeintext();",1500);
  qqq=clearTimeout;
  if(slides[meth][2] !="")
    {document.getElementById("learnmore").innerHTML="<a href='"+slides[meth][2]+"' target='_blank'><img src='learnmore.gif' border=0></a>";
     document.getElementById("learnmore").style.top="266px";
     qqqq=setTimeout("raiselearnmore();",2000);}
  qqqqq=setTimeout("moveout();",7000);
  
  if(++meth > slideno)
    {meth=0;
     }
  qqqqq=clearTimeout();
   qqq=clearTimeout();
     qq=clearTimeout();
   
     
 
 } 

function movefromtopimage()
   {target=0;
    
    where=where +10;
   if(where > target)
     {where=target;}
   document.getElementById("homeslideshowimage").style.top=where+"px";
   if(where < target)
     { mlrr=setTimeout("movefromtopimage();",20);}
   else
     {mlrr=clearTimeout();
       
 }
}

function movefrombottomimage()
   {target=0;
    
    where=where -10;
   if(where < target)
     {where=target;}
   document.getElementById("homeslideshowimage").style.top=where+"px";
   if(where > target)
     { mlrq=setTimeout("movefrombottomimage();",20);}
   else
     {mlrq=clearTimeout();
       
 }
}
function formattext()
  { titleobj=document.getElementById("homeslideshowtitle");
   textobj=document.getElementById("homeslideshowtext");
   titleobj.style.background="transparent";
   textobj.style.background="transparent";
   titleobj.style.opacity=1;
   titleobj.style.filter="alpha(opactity=100)";
   textobj.style.opacity=0;
   textobj.style.filter="alpha(opactity=0)";
   textobj.style.padding="10px";
   var whitespace=950-iw;
  
   if(iw < 650)

   {txtw=whitespace-50;
   tw=whitespace-20;
   var tleft=iw+10;
   bigwords=false;
   }
   else
   {tw=700;
   bigwords-true;
   titleobj.style.background="transparent";
   textobj.style.background="transparent";
   var tleft=125;
   titleobj.style.background="url('letterback.gif')";
       textobj.style.background="url('letterback.gif')";
       textobj.style.padding="10px";
    whitespace=125;
   txtw=700; 
   tw=700;
   
   
   textspot=tleft;
  }
    textobj.style.width=txtw+"px";
   titleobj.width=tw+"px";
   wheretext=tleft;
   textobj.style.left=tleft+"px";
   titleobj.style.left="950px";
   textobj.style.top="90px";
   titleobj.style.top="20px";
}   
   
function moveout()
  
  { if(ie)
       {mlincr=50;}
          else
      {mlincr=10}
        
    if(iw>350)
      {if(ie)
          {mlincr=70;}
        else
      {mlincr=50};
    }
    
    moveoutleftimage();
   moveoutrighttext();
   qh=false;
   if(document.getElementById("learnmore").innerHTML !="")
     {moveoutlearnmore();}
   
}
function moveoutleftimage()
   {target=-iw;
    
    where=where - mlincr;
  
    
   if(where < target)
     {where=target;}
   document.getElementById("homeslideshowimage").style.left=where+"px";
   if(where > target)
     { ml=setTimeout("moveoutleftimage();",20);}
   else
     {ml=clearTimeout();
       document.getElementById("homeslideshowimage").style.opacity=0;
       
       iopac=0;
       
 }
}
function moveoutrighttext()
  {
   target=950;
  
   wheretitle=wheretitle + 40;
   wheretext=wheretext+50
   if(wheretitle > target)
     {wheretitle=target;}
   
   if(wheretext > target)
     {wheretext=target;}
   document.getElementById("homeslideshowtitle").style.left=wheretitle+"px";
   document.getElementById("homeslideshowtext").style.left=wheretext+"px";
   if(wheretitle < 950 || wheretext < 950)
     { fkkjh=setTimeout("moveoutrighttext();",10);
      }
    else
     { fkkjh=clearTimeout();
       document.getElementById("homeslideshowtext").style.opacity=0;
       document.getElementById("homeslideshowtext").style.filter="alpha(opacity=0)";
       txtopac=0;
       allout++;}
}
function moveoutlearnmore()
  {
   target=266
   
   wherelearnmore=wherelearnmore + 10;
   if(wherelearnmore > target)
     {wherelearnmore=target}
   document.getElementById("learnmore").style.top=wherelearnmore+"px";
   if(wherelearnmore < target)
     { mtlmq=setTimeout("moveoutlearnmore();",20);}
   else
    {document.getElementById("learnmore").innerHTML="";
     mtlmq=clearTimeout();}
    
 
}
function movetorightimage()
  { 
    
    if(iw >450)
      {where=where + 30;}
    else
      {where=where + 10;}
   if(where > 0)
     {where=0;}
   document.getElementById("homeslideshowimage").style.left=where+"px";
   if(where < 0)
     { mr=setTimeout("movetorightimage();",30);}
    else
     { mr=clearTimeout();}
 
}
function fadeinimage()
{
 iopac=iopac+1;
 eopac="alpha(opacity="+iopac+")"

 
  document.getElementById("homeslideshowimage").style.opacity=(iopac/100);
  if(iopac < 100)
   {fi=setTimeout("fadeinimage();",20);
    }
   else
    
     { fi=clearTimeout();}
    
 
}


function fadeintext()
{txtopac=txtopac+5;
 eopac="alpha(opacity="+txtopac+")"

 if(ie)
  {document.getElementById("homeslideshowtext").style.filter=eopac;
  
   }
  document.getElementById("homeslideshowtext").style.opacity=(txtopac/100);
  if(txtopac < 100)
   {ttt=setTimeout("fadeintext();",20);
    }
   else
     { ttt=clearTimeout();}
 
}
var qh=false;
function movetolefttitle()
  {
   target=950-tw+5;
   
   wheretitle=wheretitle - 10;
   if(wheretitle < target)
     {wheretitle=target;}
   document.getElementById("homeslideshowtitle").style.left=wheretitle+"px";
   if(wheretitle > target)
     { mtl=setTimeout("movetolefttitle();",1);}
   else
    {
    mtl=clearTimeout();}
}
function movetitlefromtop()
 { target=20;
   twrw=twrw+5;
   if(twrw > target)
      {twrw=target;}
    document.getElementById("homeslideshowtitle").style.top=twrw+"px";
   if(twrw <target)
      {flsf=setTimeout("movetitlefromtop();",5);}
     else
      {flsf=clearTimeout();}
  }
   
  
function raiselearnmore()
  {
   target=200
   
   wherelearnmore=wherelearnmore - 10;
   if(wherelearnmore < target)
     {wherelearnmore=target}
   document.getElementById("learnmore").style.top=wherelearnmore+"px";
   if(wherelearnmore > 200)
     { mtlm=setTimeout("raiselearnmore();",20);}
    else
     { mtlm=clearTimeout();}
 
}
