<!--script by: Shelly Korobanik August 2000 -->
<!--begin

//functions to change images
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		home_over = newImage("images/home_over.jpg");
		products_over = newImage("images/products_over.jpg");
		services_over = newImage("images/services_over.jpg");
		rentals_over = newImage("images/rentals_over.jpg");
		demo_over = newImage("images/demo_over.jpg");
		walk_over = newImage("images/walk_over.jpg");
		clinics_over = newImage("images/clinics_over.jpg");
		contact_over = newImage("images/contact_over.jpg");
		prod_over = newImage("images/pH/prod_over.gif");
		serv_over = newImage("images/pH/serv_over.gif");
		rent_over = newImage("images/pH/rent_over.gif");
		dd_over = newImage("images/pH/demo_over.gif");
		clin_over = newImage("images/pH/clin_over.gif");
		nw_over = newImage("images/pH/walk_over.gif");
		cont_over = newImage("images/pH/cont_over.gif");
		preloadFlag = true;
	}
}

//function to swap binding images based on selection in dropdown list
function swap(source) {
    if (document.images) {
        document.images['bindings'].src = source;
    }
}

//function to swap shoe images based on selection in dropdown list
function swapShoes(source) {
    if (document.images) {
        document.images['shoes'].src = source;
    }
}

//function to swap boot images based on selection in dropdown list
function swapBoots(source) {
    if (document.images) {
        document.images['boots'].src = source;
    }
}

//function to swap sweater images based on selection in dropdown list
function swapSweaters(source) {
    if (document.images) {
        document.images['sweaters'].src = source;
    }
}
//function for automatic forwarding of user to selected page

function quickLink(form){
var URL = document.form.site.options[document.form.site.selectedIndex].value;
window.location.href = URL;
}

//function to open separate window 
	function openWindow(URL)
	{
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'scrollbars=1, location=1, resizable=1, width=778, height=450, left = 200, top = 40');");
	}

//function to open smaller separate window 
	function openWindow2(URL)
	{
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'scrollbars=1, location=1, resizable=1, width=500, height=250, left = 200, top = 40');");
	}

//function to open smaller separate window 
	function openWindow3(URL)
	{
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'scrollbars=1, location=1, resizable=1, width=525, height=650, left = 200, top = 40');");
	}
//function to bookmark the site
function addbookmark()
	  {
	      var bookmarkURL="http://www.stussisports.com"
          var bookmarkTitle="Welcome to Stussi Sports - Vernon, British Columbia"
      
         if (document.all)
		 {
             window.external.AddFavorite(bookmarkURL,bookmarkTitle)
         }

        if (document.layers)
		{
            window.alert('Please hit CTRL-D to bookmark this page.')
        }
	 }

//disable the view source right click function
var message="Function Disabled";
function click(e) {
if (document.all) {
if (event.button==2||event.button==3) {
alert(message);
return false;
}
}
else if (document.layers||document.getElementById) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;

//menu tree functions
 function InitMenu()
   {
     var bar = menuBar.children     

     for(var i=0;i < bar.length;i++) 
        {
          var menu=eval(bar[i].menu)
          menu.style.visibility = "hidden"
          bar[i].onmouseover = new Function("ShowMenu("+bar[i].id+")")
          var Items = menu.children
          for(var j=0; j<Items.length; j++)
            {
              var menuItem = eval(Items[j].id)
                
                if(menuItem.menu != null)
                   { 
                    menuItem.innerHTML += "<Span Id="+menuItem.id+"_Arrow class='Arrow'>4</Span>"
                    
                    FindSubMenu(menuItem.menu)}
               
                 if(menuItem.cmd != null) 
                   {
                   menuItem.onclick = new Function("Do("+menuItem.id+")") } 
                   
              menuItem.onmouseover = new Function("highlight("+Items[j].id+")")
            
            }    
        
        }  
   }
   function FindSubMenu(subMenu)
   {
         var menu=eval(subMenu)
         var Items = menu.children
          for(var j=0; j<Items.length; j++)
            {
              menu.style.visibility = "hidden"
              var menuItem = eval(Items[j].id)
              
              
              if(menuItem.menu!= null)
                 {
                    menuItem.innerHTML += "<Span Id="+menuItem.id+"_Arrow class='Arrow'>4</Span>"
                    // var tmp = eval(menuItem.id+"_Arrow")
                    //tmp.style.pixelLeft = 35 //menuItem.getBoundingClientRect().right - tmp.offsetWidth - 15
                    FindSubMenu(menuItem.menu)
                 }

                 if(menuItem.cmd != null) 
                   {
                   menuItem.onclick = new Function("Do("+menuItem.id+")") } 
                  
              menuItem.onmouseover = new Function("highlight("+Items[j].id+")")
                 
            }  
   } 
   function ShowMenu(obj)
   {
     HideMenu(menuBar)
     var menu = eval(obj.menu)
     var bar = eval(obj.id)
     bar.className="barOver"
     menu.style.visibility = "visible"
     menu.style.pixelTop =  obj.getBoundingClientRect().top + obj.offsetHeight + Bdy.scrollTop
     menu.style.pixelLeft = obj.getBoundingClientRect().left + Bdy.scrollLeft
   }
   
   function highlight(obj)
   {
     var PElement = eval(obj.parentElement.id)
     if(PElement.hasChildNodes() == true)
     {  var Elements = PElement.children
       for(var i=0;i<Elements.length;i++)
       {
          TE = eval(Elements[i].id)
          TE.className = "menuItem"
       }
      } 
     obj.className="ItemMouseOver"
     window.defaultStatus = obj.title
     ShowSubMenu(obj)
   }
   
   function Do(obj)
   {
    var cmd = eval(obj).cmd	
    window.navigate(cmd)
     
   }
   
   function HideMenu(obj)
   {
          if(obj.hasChildNodes()==true)
              {  
                 var child = obj.children     
                 
                 for(var j =0;j<child.length;j++)
                  {
                     if (child[j].className=="barOver")
                     {var bar = eval(child[j].id)
                      bar.className="Bar"}
                      
                     if(child[j].menu != null)
                       {
                          var childMenu = eval(child[j].menu)
                          if(childMenu.hasChildNodes()==true) 
                               HideMenu(childMenu)
                          
                           childMenu.style.visibility = "hidden" 
                         }
                  }
              
              }
   }

 //error checking for form --not working
//function checkForm(thisForm)
//{
//	 var valid = true;
//
//   if (this.productpr1.value == "Select binding:")&&(this.productpr2.value="Installation Required:20.00"){
//	  alert("Cannot have installation without a binding selected. Please select a binding or uncheck Installation Required box.");
 //     this.productpr1.focus();
//      valid = false;
//	 }
// }


  function ShowSubMenu(obj)
  {
     PMenu = eval(obj.parentElement.id)
      HideMenu(PMenu)
     if(obj.menu != null)
     {
     var menu = eval(obj.menu)
     menu.style.visibility = "visible"
     menu.style.pixelTop =  obj.getBoundingClientRect().top + Bdy.scrollTop
     menu.style.pixelLeft = obj.getBoundingClientRect().right + Bdy.scrollLeft
     if(menu.getBoundingClientRect().right > window.screen.availWidth )
       menu.style.pixelLeft = obj.getBoundingClientRect().left - menu.offsetWidth
    }
  } 

//End-->