﻿
        //<!--
        function loadIframe(iframeName, url) 
            {
              if ( window.frames[iframeName] ) {
                window.frames[iframeName].location = url;   
                return false;
              }
              else return true;
            }
       //-->
       
        //<!-- Ensure that the text object does not exceed a specified number of characters
        var totchars = 0;
        var Key;     
        
        function checkLength(e, oObject, MaxLen)
        {
             //Retrieve the key that was pressed
             if(window.event)
                 Key = window.event.keyCode;        //IE
             else
                  Key = e.which;                    //firefox     
                                       
            if (oObject.value.length < MaxLen)            

            switch (Key)
            {
              case 8:                                //Backspace
                 if (totchars > 0) 
                 totchars--;
                 lbl.value = totchars;
                 return true;
                 break

              case 37:                               //Down Arrow Key
                 return true;
                 break

              case 38:                               //Up Arrow Key
                 return true;
                 break

              case 39:                               //Left Arrow Key
                 return true;
                 break

              case 40:                               //Right Arrow Key
                 return true;
                 break

              default:                              // Prevent all other characters
                  totchars++;
                  lbl.value = totchars;
                  return true;
            }

            else
        {

            switch (Key)
            {
              case 37:                               //Down Arrow Key
                 return true;
                 break

              case 38:                               //Up Arrow Key
                 return true;
                 break

              case 39:                               //Left Arrow Key
                 return true;
                 break

              case 40:                               //Right Arrow Key
                 return true;
                 break

              case 8:                                //Backspace
                 if (totchars > 0) 
                 totchars--;
                 lbl.value = totchars;
                 return true;
                 break

              default:                              // Prevent all other characters
                     alert ("You have exceeded the total number of allowed characters");
                     oObject.value= oObject.value.substring(0, MaxLen);          
            }
                  
         }         
        }
       //-->
       
        //-- Disable copying the page content in IE>

        document.onselectstart=new Function ("return false");
        
            var message = "Sorry, that function is disabled.\n\n";
            message += "This page is copyrighted, and ";
            message += "all content is protected.";

            function click(e) 
            {
                if (document.all) 
                {
                    if (event.button == 2) 
                    {
                        alert(message);
                        return false;
                    }
                }

                if (document.layers) 
                {
                    if (e.which == 3) 
                    {
                        alert(message);
                        return false;
                    }
                }

            }
                if (document.layers) 
                {
                    document.captureEvents(Event.MOUSEDOWN);
                }
                    document.onmousedown = click;
            //-->
 

        function PrintThisPage() 
            { 
               var sOption="toolbar=yes,location=no,directories=yes,menubar=yes,"; 
                     sOption+="scrollbars=yes,width=1200,height=840,left=100,top=25"; 
               
               var winprint=window.open("../Printer/print.asp","Print",sOption); 
             
                winprint.focus(); 
            }

  // finds a control that had the given server id, of a the given type in the given parent.
        //
        function findControl(parent, tagName, serverId) {
            var items = parent.getElementsByTagName(tagName);
            
            // walk the items looking for the right guy
            for (var i = 0; i < items.length; i++) {
                var ctl = items[i];
                if (ctl && ctl.id) {
                    // check the end of the name.
                    //
                    var subId = ctl.id.substring(ctl.id.length - serverId.length);
                    if (subId == serverId) {
                        return ctl;                        
                    }
                }
            }   
            return null;
        }
      
        function loadTabPanel(sender, e) {
           
             var tabContainer = sender;           
                       
            if (tabContainer) {
                var updateControlId = "TabButton" + tabContainer.get_activeTabIndex();
                 // get the active tab and find our button
                //
                var activeTab = tabContainer.get_activeTab();            
               
                
                // check to see if we've already loaded
                //
                if (findControl(activeTab.get_element(), "div", "TabContent" + tabContainer.get_activeTabIndex())) return;
                
                var updateControl =  findControl(activeTab.get_element(), "input", updateControlId);
                
                if (updateControl) {
                
                    // fire the update
                    //
                    updateControl.click();
                }                             
            }           
        }

        function OnLoad() {
            // create a tabbed mode search control
            var tabbed = new google.search.SearchControl();

            tabbed.addSearcher(new google.search.LocalSearch());
            tabbed.addSearcher(new google.search.WebSearch());
            tabbed.addSearcher(new google.search.BlogSearch());
            tabbed.addSearcher(new google.search.NewsSearch());
            tabbed.addSearcher(new google.search.BookSearch());
            tabbed.addSearcher(new google.search.PatentSearch());
            tabbed.addSearcher(new google.search.ImageSearch());

            // draw in tabbed layout mode
            var drawOptions = new google.search.DrawOptions();
            drawOptions.setDrawMode(google.search.SearchControl.DRAW_MODE_TABBED);
            tabbed.draw(document.getElementById("search_control_tabbed"), drawOptions);

            tabbed.execute();
        }

        google.setOnLoadCallback(OnLoad, true)

//browser detection
    var agt=navigator.userAgent.toLowerCase();
    var is_major = parseInt(navigator.appVersion);
    var is_minor = parseFloat(navigator.appVersion);

    var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
    var is_nav4 = (is_nav && (is_major == 4));
    var is_nav6 = (is_nav && (is_major == 5));
    var is_nav6up = (is_nav && (is_major >= 5));
    var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
    

