/* var searchfield = document.sitesearch.search;
if (searchfield.value == '') searchfield.value = ' Search Site';

searchfield.onfocus = function(){if(this.value == ' Search Site') this.value = ''}
searchfield.onblur = function(){if(this.value == '') this.value = ' Search Site'}
*/


if (document.getElementsByTagName && document.getElementById)
  {
    var storagediv = document.getElementById('storagediv')
    var currentMenuParent = null
    var currentDiv = null
    var secondarynav = document.getElementById("secondarynav");
    if (secondarynav != null) {var n2nodes = secondarynav.childNodes;}
    var menuDelay = 500; //ms
    var menutimer;          
    
    function hideMenus()
      {
          for (var n2 = 0 ;n2 < n2nodes.length; n2++)
          {
             if(n2nodes[n2].submenu != null)
              { n2nodes[n2].className = n2nodes[n2].className.replace(/ ?over/, "");
                n2nodes[n2].submenu.style.display = 'none' 
              }
          }
         var iframeobj = document.getElementById('spf_menu')
         iframeobj.style.left= '-1000px' ;iframeobj.style.top = '-1000px'; return;
      }
      
    function showMenu()
      {
         clearTimeout(menutimer); 
         hideMenus();
         
         this.className += " over";
         this.className =  (this.className == " over") ?"over" :this.className
         this.top = objtop=getypos(this.id);
         this.left = getxpos(this.id);
         this.submenu.style.top = (this.top + 17) + 'px';
         this.submenu.style.left = this.left + 'px';         
         this.submenu.style.zIndex = 200;
         this.submenu.style.display = 'block';
         blockburnthru("spf_menu",this.submenu.id);       
      }
      
    function setHideMenus()
      {
       menutimer = setTimeout("hideMenus()",menuDelay)
      }
      
      
    if (secondarynav != null) 
      {
        for (n2 = 0 ;n2 < n2nodes.length; n2++)
          {
            
            if(n2nodes[n2].nodeType == 1)
              {                  
                myULs = n2nodes[n2].getElementsByTagName("UL")
                if(myULs.length != 0)
                  {
                    n2nodes[n2].setAttribute('id','temp_' + n2); //assign parent a temporary id
                    n2nodes[n2].submenu = myULs[0];
                    n2nodes[n2].submenu.parentID = n2nodes[n2].id;
                    n2nodes[n2].submenu.style.display = 'none';
                    storagediv.appendChild(n2nodes[n2].submenu); //move submenu to storage;
                    n2nodes[n2].onmouseover = showMenu;
                    n2nodes[n2].onmouseout = setHideMenus;
                    n2nodes[n2].submenu.onmouseover = function(){clearTimeout(menutimer)} ;  
                    n2nodes[n2].submenu.onmouseout = setHideMenus ;                  
                  } //end if  we have a ul     
                else
                {
                    n2nodes[n2].submenu = null;
                    n2nodes[n2].onmouseover = hideMenus;
                }     
              }//end if nodeType == 1
            
          }//end for
      }//end, secondary nav not null
  }
  
  
  
//GARRY ADDED FOR MENU TESTING

//----------------------------------------------------------------------------
// shadows a div invisibly with an IFRAME to prevent IE select box burn thru
//----------------------------------------------------------------------------
function blockburnthru(iframeid,divid,hide)
{
   
   //window.status="if id="+iframeid+"\nmenuid="+divid+"\nhide="+hide;
	var iframeobj = document.getElementById(iframeid);
  if(typeof hide != "undefined") {iframeobj.style.left=-1000;iframeobj.style.top=-1000; return;}
	var divobj = document.getElementById(divid); 
  if ((navigator.userAgent.indexOf('Opera') != -1) || navigator.userAgent.indexOf('Mac') != -1){return}//don't bother with Opera; iframes cover element and don't help anyway
  
   //If either	 the iframe or div are not objects then abandon
   if(!iframeobj || !divobj) { return; }
	//duplicate divobj's position and proportions to the iframe
   
  iframeobj.style.width = (divobj.offsetWidth) + 'px';
  iframeobj.style.height = (divobj.offsetHeight) + 'px';
  var objtop=getypos(divobj.id);
  var objleft=getxpos(divobj.id);  
  
  iframeobj.style.top = objtop + 'px';
  iframeobj.style.left = objleft + 'px';
  
  
  iframeobj.style.zIndex = 1;
  iframeobj.style.marginLeft=divobj.style.marginLeft;
  iframeobj.style.marginTop=divobj.style.marginTop;
  iframeobj.style.display = "";
  
}

function showCustomPopUp(thisUrl,thisName,theseParams)
{
	remote = open(thisUrl, thisName, theseParams);
}

//----------------------------------------------------------------------------
// Returns the width of an object
//----------------------------------------------------------------------------
function getobjectwidth(objid) { return document.getElementById(objName).offsetWidth;}

//----------------------------------------------------------------------------
// Returns the X (left) position of an object
//----------------------------------------------------------------------------
function getxpos(objid)
{
  if (typeof objid == "string"){myobj=document.getElementById(objid)}
  else{myobj = objid}
	var posleft = 0;
	if (myobj.offsetParent)
   {
	   while (myobj.offsetParent)
      {
		   posleft += myobj.offsetLeft;
			myobj = myobj.offsetParent;
		}
	}
	else if (myobj.x) { posleft += myobj.x; }
	return posleft;
}

//----------------------------------------------------------------------------
// Returns the Y (top) position of an object
//----------------------------------------------------------------------------
function getypos(objid)
{
  if (typeof objid == "string"){myobj=document.getElementById(objid)}
  else{myobj = objid}
	var postop = 0;
	if (myobj.offsetParent)
   {
	   while (myobj.offsetParent)
      {        
        postop += myobj.offsetTop;
        myobj = myobj.offsetParent;
		}
	}
	
  else if (myobj.y) { postop += myobj.y; } 
	return postop;
}

//returns inner dimensional width of a window frame or iframe
function getinnerwidth(objid)
{
   var obj=document.getElementById(objid);
   innerwidth=(document.documentElement) ? document.documentElement.clientWidth : window.innerWidth;
   return innerwidth;
}

//returns inner dimensional height of a window frame or iframe
function getinnerheight(objid)
{
   var obj=document.getElementById(objid);
   innerheight = (document.documentElement) ? document.documentElement.clientHeight : window.innerHeight;
   return innerheight;
}


 


//iRobot requested functions.

function disclaimer1() {

            alert("The press releases contained in this archive section are provided for historical purposes only.  The information contained in each press release is accurate only as of the date each press release was originally issued.  iRobot Corporation disavows any obligation to update the information contained in such press releases after the date of their issuance.")

}

function disclaimer2() {

            alert("The articles contained in this archive section are provided for historical purposes only. The articles in this archive were written and published by persons not affiliated with iRobot Corporation and do not reflect the views of iRobot Corporation.  Additionally, the information contained in these articles may not be current.  iRobot Corporation disavows any obligation to correct or to update the information contained in these articles.")

}

function disclaimer3() {

            alert("The press release that you are about to view contains certain forward-looking statements that are subject to known and unknown risks and uncertainties that could cause actual results to differ materially from those expressed or implied by such statement.  Those risks and uncertainties include, among other things:  the risk that our business could be adversely affected by changes in the policies and spending priorities of our customers, which include governments and governmental entities; the risk that the commercial robot market does not experience significant growth or our products do not achieve broad acceptance; the risks associated with our dependence on government contractors and third-party retailers; the risks associated with competition; the risk that our products become obsolete; the risk of errors or defects in our products; risks associated with our reliance on skilled personnel; and the risks associated with the protection and defense of our intellectual property and other proprietary rights.")

}

function disclaimer4(url_link) {

            if(confirm("You are leaving iRobot Corporation's website.  When you are ready to return to the iRobot website, simply click the 'Back' button on the toolbar of your Web browser until you are back where you left off.  If you wish to proceed, please click 'Ok.'  To exit, click 'Cancel.'")) {

                        window.location = url_link;

            }

}

function disclaimer5(url_link) {

            if(confirm("You have selected a link to an article written and published by persons not affiliated with iRobot Corporation and not appearing on iRobot Corporation's website.  The views expressed in the article are those of the author and do not reflect the views of iRobot Corporation.  When you are ready to return to the iRobot website, simply click the 'Back' button on the toolbar of your Web browser until you are back where you left off.  If you wish to proceed, please click 'Ok.'  To exit, click 'Cancel.'")) {

                        window.location = url_link;

            }

}

function disclaimer6(url_link) {

            if(confirm("You are leaving iRobot Corporation's website.  The views expressed in the forum that you have selected are those of their respective authors and do not reflect the views of iRobot Corporation.  When you are ready to return to the iRobot website, simply click the 'Back' button on the toolbar of your Web browser until you are back where you left off.  If you wish to proceed, please click 'Ok.'  To exit, click 'Cancel.'")) {

                        window.location = url_link;

            }

}

function printPage()
  {
    if(self.print)
      {
        msg = 'Use the browser\'s Page Set Up command in the File menu'
        msg += '\nto make sure your margins are set to .25in on all four sides'
        if(document.all)
          {
           msg +='.\n Make sure Print Background colors and images is enabled.'
           msg += '\n\n(Tools \> Internet Options \> Advanced \>Printing)'
          }
        else
         {
          msg +='\n and Print Background is enabled'
         }
        msg += '\n\nClick OK to print.'
        if(confirm(msg)){self.print()}
      }
    else
     {
      alert('Your browser doesn\'t support this function. Use the "Print" command in the browser\'s File menu')
     }
  }
