function SwapGalleryImage(ImageName) 
{
   document.Large.src=ImageName;
}

function SwapImage(Name, ImageName) 
{
   document.images[Name].src =ImageName;
}

var aboutusmenu=new Array()
aboutusmenu[0]='<a href="whoweare_four_seasons_sunrooms_pickering.php" class="menu">Who We Are</a><br>'
aboutusmenu[1]='<a href="whatwedo_four_seasons_sunrooms_ontario.php" class="menu">What We Do</a><br>'



var productsmenu=new Array()
productsmenu[0]='<a href="easyliving_patio_rooms_durham.php" class="menu">Easy Living</a><br>'
productsmenu[1]='<a href="elegantliving_solariums_durham.php" class="menu">Elegant Living</a><br>'
productsmenu[2]='<a href="commercial-skylight_sunrooms_ontario.php" class="menu">Commercial & Skylight</a><br>'

var gallerymenu=new Array()
gallerymenu[0]='<a href="gallery1_sunrooms_oshawa.php" class="menu">Gallery 1</a><br>'
gallerymenu[1]='<a href="gallery2_sun_rooms_oshawa.php" class="menu">Gallery 2</a><br>'
gallerymenu[2]='<a href="gallery3_solarium_oshawa.php" class="menu">Gallery 3</a><br>'
gallerymenu[3]='<a href="gallery4_sunrooms_oshawa.php" class="menu">Gallery 4</a><br>'
gallerymenu[4]='<a href="gallery5_sunrooms_oshawa.php" class="menu">Gallery 5</a><br>'
gallerymenu[5]='<a href="gallery6_sunrooms_oshawa.php" class="menu">Gallery 6</a><br>'

var menuwidth='175px' //default menu width
var menubgcolor='C18260'  //menu bgcolor

var ie4=document.all
var ns6=document.getElementById&&!document.all

document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="clearhidemenu()"></div>')

function getposOffset(what, offsettype)
{
   var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
   var parentEl=what.offsetParent;
   while (parentEl!=null)
   {
      totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
      parentEl=parentEl.offsetParent;
   }
   return totaloffset;
}

function showhide(obj, e, visible, hidden, menuwidth)
{
   if (ie4||ns6)
   dropmenuobj.style.left=dropmenuobj.style.top=-500
   if (menuwidth!="")
   {
      dropmenuobj.widthobj=dropmenuobj.style
      dropmenuobj.widthobj.width=menuwidth
   }

   if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
      obj.visibility=visible
   else if (e.type=="click")
   obj.visibility=hidden
}

function iecompattest()
{
   return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge)
{
   var edgeoffset=0
   if (whichedge=="rightedge")
   {
      var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
      dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
      if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
         edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
   }
   else
   {
      var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
      dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
      if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
         edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
   }
   return edgeoffset
}

function dropdownmenu(obj, e, menucontents, menuwidth)
{
   if (window.event) event.cancelBubble=true
   else if (e.stopPropagation) e.stopPropagation()
   clearhidemenu()
   dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
   dropmenuobj.innerHTML=menucontents.join("")

   if (ie4||ns6)
   {
      showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
      dropmenuobj.x=getposOffset(obj, "left")
      dropmenuobj.y=getposOffset(obj, "top")
      dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
      dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
   }

   return clickreturnvalue()
}

function clickreturnvalue()
{
   if (ie4||ns6) return false
   else return true
}

function contains_ns6(a, b) 
{
   while (b.parentNode)
   if ((b = b.parentNode) == a)
   return true;
   return false;
}


function hidemenu(e)
{
   if (typeof dropmenuobj!="undefined")
   {
      if (ie4||ns6)
      dropmenuobj.style.visibility="hidden"
   }
}

function delayhidemenu()
{
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",5)
}

function clearhidemenu()
{
   if (typeof delayhide!="undefined")
      clearTimeout(delayhide)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

function SwapOther() 
{
	document.getElementById('howfoundother').disabled=true;
	if(document.getElementById('heardabout').value=="Other")
	{
        document.getElementById('howfoundother').disabled=false;
    }
}


