var hpic1d=document.getElementById("idhpic1"), hpic2d=document.getElementById("idhpic2"), hpic3d=document.getElementById("idhpic3"),
hpic4d=document.getElementById("idhpic4"), hpic5d=document.getElementById("idhpic5"), hpic6d=document.getElementById("idhpic6"),
hpic7d=document.getElementById("idhpic7"), hpic8d=document.getElementById("idhpic8"), hpic9d=document.getElementById("idhpic9"),
showd=document.getElementById("idmainpic"), hpicount=-1, showtime, opcount, opvartime, optime, opvalfg, opval, oploop, opvalinc, opdelay;

preloadImagesin();
set_posin();
var nn = (navigator.vendor == 'Netscape' || navigator.vendor == 'Netscape6') ? 1 : 0;

if (!ie)
{
document.write('<div><a class="mainlink" href="contact.php" title="So take a stroll through our website &amp; please get in touch - We believe you will find the experience very rewarding !"><img id="idmainpicfg" src="images/picmain.jpg" width="250" height="180" border="0" alt="So take a stroll through our website &amp; please get in touch - We believe you will find the experience very rewarding !"></a></div><div><a class="mainlink" href="contact.php" title="So take a stroll through our website &amp; please get in touch - We believe you will find the experience very rewarding !"><img id="idmainpicn" src="images/picmain.jpg" width="250" height="180" border="0" alt="So take a stroll through our website &amp; please get in touch - We believe you will find the experience very rewarding !"></a></div>');
var showfgd=document.getElementById("idmainpicfg"), shownd=document.getElementById("idmainpicn");
}
if (nn)
{
document.write('<div><a class="mainlink" href="contact.php" title="So take a stroll through our website &amp; please get in touch - We believe you will find the experience very rewarding !"><img id="idmainpicnn" src="images/picmain.jpg" width="250" height="180" border="0" alt="So take a stroll through our website &amp; please get in touch - We believe you will find the experience very rewarding !"></a></div>');
var shownnd=document.getElementById("idmainpicnn"), nnstart=true;
}
if (!ie)
{
    showd.style.visibility = 'hidden';
    set_poshow();   
}

function set_posin()
{
     hpic1d.style.left=posleft + 223 + "px";
     hpic2d.style.left=posleft + 229 + "px";
     hpic3d.style.left=posleft + 231 + "px";
     hpic4d.style.left=posleft + 248 + "px";
     hpic5d.style.left=posleft + 244 + "px";
     hpic6d.style.left=posleft + 251 + "px";
     hpic7d.style.left=posleft + 265 + "px";
     hpic8d.style.left=posleft + 274 + "px";
     hpic9d.style.left=posleft + 157 + "px";
}

function set_poshow()
{
   showfgd.style.left = posleft + 137 + "px";
   shownd.style.left = posleft + 137 + "px";
   showfgd.style.visibility = 'visible';
   shownd.style.visibility = 'visible';
   if (nn)
   {
      shownnd.style.left = posleft + 137 + "px";
      shownnd.style.visibility = 'visible';
   }
}

function set_posinre()
{
   set_pos();
   set_posin();
   if (!ie)
       set_poshow();  
}

function preloadImagesin()
{
	if (document.images) 
	{
		picmaintl = newImage("images/picmaint.jpg");
		emailin_over = newImage("images/emailin-over.gif");
		preloadFlag = true;
	}
showpics();
window.onresize=set_posinre;
}

function showpics()
{
   if (hpicount == -1)
   {
      showtime = setTimeout ("showpics()", 8000);
      hpicount = 1;
   }
   else
   {
       if (hpicount == 0)
       {
             hpicount = 1;
  	if (ie)
   	{
      	     showd.style.filter="blendTrans(duration=.75)";
      	     showd.filters.blendTrans.Apply();	
	     showd.src= "images/picmain.jpg";
     	     showd.filters.blendTrans.Play();
                  showtime = setTimeout ("showpics()", 2000);
	}
   	else
   	{
      	     showfgd.src = picmaintl.src;
      	     shownd.src = "images/picmain.jpg";
      	     if (!nn)
         	         opvars(20, .05, 2000);
      	     else
      	     {
     	         shownnd.src = "images/picmain.jpg";
	         opvars(10, .1, 2000);
      	     }
   	}
       }
       else
       {
           if (hpicount < 9)
           {
               eval("hpic" + hpicount + "d.style.visibility='visible';");
               hpicount += 1;
               showtime = setTimeout ("showpics()", 1500);
           }
           else
           {
               hpicount = 0;
               for (var i = 1; i < 10; i++)
               {
                    eval("hpic" + i + "d.style.visibility='hidden';");
               }
  	  if (ie)
   	  {
      	       showd.style.filter="blendTrans(duration=.75)";
      	       showd.filters.blendTrans.Apply();	
	       showd.src= picmaintl.src;
     	       showd.filters.blendTrans.Play();
                    showtime = setTimeout ("showpics()", 8000);
	  }  
   	  else
   	  {
      	     showfgd.src =  "images/picmain.jpg";
      	     shownd.src =  picmaintl.src;
      	     if (!nn)
         	        opvars(20, .05, 8000);
      	     else
      	     {
         	        if (!nnstart)
         	        {
            		shownnd.src = picmaintl.src;
            		opvars(10, .1, 8000);
         	        }
         	        else
         	        {
            		shownnd.src =  "images/picmain.jpg";
            		opvarsnn(10, .1, 8000);
            		nnstart = false;
         	        }
      	     }
   	  }
           }
       }
   }
}

function opvars(loop, valinc, delay)
{
       opcount = 0;
       opvalfg = 1;
       opval = 0;
       oploop = loop;
       opvalinc = valinc;
       opdelay = delay;
       opvar();
}

function opvar()
{
    if (opcount < oploop)
    {
       opvalfg = opvalfg - opvalinc;
       opval = opval + opvalinc;
       showfgd.style.opacity = opvalfg;
       shownd.style.opacity = opval;
       opcount +=  1;
       opvartime = setTimeout ("opvar()", 0);
    }
    else
    {
       showfgd.style.opacity = 0;
       shownd.style.opacity = 1;
       clearTimeout(opvartime);
       optime = setTimeout ("showpics()", opdelay);
    }
}

function opvarsnn(loop, valinc, delay)
{     
       opcount = 0;
       opvalfg = 1;
       opval = 0;
       oploop = loop;
       opvalinc = valinc;
       opdelay = delay;
       opvarnn();
}

function opvarnn()
{
    if (opcount < oploop)
    {
       opvalfg = opvalfg - opvalinc;
       opval = opval + opvalinc;
       if (opcount == oploop - 1)
       {
            shownnd.src =  picmaintl.src;
       }
       showfgd.style.opacity = opvalfg;
       shownd.style.opacity = opval;
       opcount +=  1;
       opvartime = setTimeout ("opvarnn()", 0);
    }
    else
    {
       showfgd.style.opacity = 0;
       shownd.style.opacity = 1;
       clearTimeout(opvartime);
       optime = setTimeout ("showpics()", opdelay);
    }
}