var showd=document.getElementById("idshow");
var imgs = new Array("images/mainpic0.jpg", "images/mainpic1.jpg", "images/mainpic2.jpg", "images/mainpic3.jpg", "images/mainpic4.jpg",
"images/mainpic5.jpg", "images/mainpic6.jpg");

if (!ie)
{
document.write('<div><a href="#" onclick="gopage()" title="Grange Garage Doors - Click to Go to Section"><img id="idhomeshowfg" src="images/spacer.gif" width="350" height="250" border="0" alt="Grange Garage Doors - Click to Go to Section"></a></div><div><a href="#" onclick="gopage()"  title="Grange Garage Doors - Click to Go to Section"><img id="idhomeshown" src="images/spacer.gif" width="350" height="250" border="0" alt="Grange Garage Doors - Click to Go to Section"></a></div>');
var showfgd=document.getElementById("idhomeshowfg"), shownd=document.getElementById("idhomeshown");
}
if (nn)
{
document.write('<div><img id="idhomeshownn" src="images/spacer.gif" width="350" height="250" alt="Grange Garage Doors - Click to Go to Section" title="Grange Garage Doors - Click to Go to Section"></div>');
var shownnd=document.getElementById("idhomeshownn");
}
preloadshow();
if (!ie)
{
   showd.style.visibility = 'hidden';
   set_poshow();
}

function set_poshow()
{
   showfgd.style.left = posleft + 210 + "px";
   shownd.style.left = posleft + 210 + "px";
   showfgd.style.visibility = 'visible';
   shownd.style.visibility = 'visible';
   if (nn)
   {
      shownnd.style.left = posleft + 210 + "px";
      shownnd.style.visibility = 'visible';
   }
}

function set_poshowre()
{
   set_pos();
   if (!ie)
       set_poshow();   
}

function poshow()
{
    window.onresize=set_poshowre;
}

function preloadshow()
{
  for (var i = 0; i < imgs.length; i++)
  {
    preloadimgs[i] = new Image();
    preloadimgs[i].src = imgs[i];
  }
  if (ie)
     showd.src= preloadimgs[n].src;
  else
     showfgd.src= preloadimgs[n].src;
  if (nn)
     shownnd.src= preloadimgs[n].src;
showpics(1, 5000, 5000, 25, .04, 15, .066);
}

function gopage()
{
// Sectional
     if (n == 0)
        window.location.href="sect.php";
     else
// Aluminium Roller
     if (n == 1)
        window.location.href="alumroll.php";
     else
// Steel Roller
     if (n == 2)
        window.location.href="steelroll.php";
     else
// Up and Over
     if (n == 3)
        window.location.href="upover.php";
     else
// Side Hinged
     if (n == 4)
        window.location.href="side.php";
     else
// Remote Control Systems
     if (n == 5)
        window.location.href="ctrl.php";
     else
// Security Window Shutters
     if (n == 6)
        window.location.href="shut.php";
}