// based on easytoggle2.js at http://simon.incutio.com/archive/2003/11/06/easytoggle
var toggle_toggleElements = [];

// set up cookie variables so we can remember the industry preference
var today = new Date();
var ONECookie;
var expires;

ONECookie = getCookie('indpref');

/*
'---------------------------------------------------------------------------------------------
' Function: OpenWindow
' Purpose:  To open a popup window
'
' Parameters:  name  - window name (must be < 10 chars)
'              url   - url to open in new window
'              sizex - size of window x-direction (if null window not sized)
'              sizey - size of window y-direction (if null window not sized)
'              posx  - position of the window on the screen x-direction
'              posy  - position of the window on the screen y-direction
'              sbars - show scroll bars? can be yes/no/true/false
'---------------------------------------------------------------------------------------------*/
function OpenWindow( name, url, sizex, sizey, posx, posy, sbars)
{
	// Netscape 7.1 and above has fixed the 'close main window with javascript' bug
	// However, the user can disable this by typing "about:config" in the address bar
	// and setting dom.allow_scripts_to_close_windows to true.			
	if( sbars == true )
	   sbars = "yes";
	if( sbars == false )
	   sbars = "no";
	
	if( sizex == null )		
		wnd = window.open( url, name, "width=" + (screen.availWidth-10) + ",height=" + (screen.availHeight-28) + ",left=0,top=0,header=false,address=false, resizable=yes,status=1,scrollbars="+sbars );		
	else
		wnd = window.open( url, name, "width=" + sizex + ",height=" + sizey + ",left="+posx + ",top=" + posy + ",header=false,address=false,scrollbars="+sbars );
     
   wnd.focus();
   return wnd;
}

function PopupExchangeRequirements()
{				
	var wnd = OpenWindow('ExchangeRequirements','http://www.microsoft.com/exchange/evaluation/sysreqs/2000.asp',640,480,null,null,true);				
} //PopupScreenShot

function PopupHelpDoc(URL)
{
	var wnd = OpenWindow('OfficeCollaborationToolsHelp',URL,800,600,null,null,true);
}	
			
function updateSloganCookie(currentSlogan)
{
	expires = new Date(today.getTime() + Cookie.year);
	setCookie('slogan', currentSlogan, expires);
}

// cookie is updated from an onclick event on the LI tag surrounding the A tag
function updateCookie(which) {
	expires = new Date(today.getTime() + Cookie.year);
	setCookie('indpref', which, expires);
}

function toggle_init() {
    var i, link, id, target, defaultexist, backupdefault, counter;
	defaultexist = false;
    for (i = 0; (link = document.links[i]); i++) {  // loop through all links
        if (/\btoggle\b/.exec(link.className)) {  // looking for classes than include "toggle"
            id = link.href.split('#')[1];
            target = document.getElementById(id);
            toggle_toggleElements[toggle_toggleElements.length] = target;
			if (ONECookie) {  // if there is a cookie
				if (id == ONECookie) {  // and this panel is the cookie default
					target.className = "panel on";  // then display it
				} else {
					target.className = "panel";  // otherwise, make sure it's hidden
				}
			}
			if (defaultexist == false) { // if there is no declared default yet	
				if (target.className == "panel on") {  // and this panel is already displayed
					link.className = "toggle on";  // then highlight the corresponding link
					defaultexist = true;  // and declare that we have a default
				}
			} else {
				target.className = "panel"; // we already have a default, so hide any extra "on" panels
			}
        	link.onclick = toggle;  
			counter = document.links[i]; // save the location in the array of the last toggle link
		}
    }
	if (defaultexist == false) {  // if there is no declared default yet
		target.className = "panel on";  // turn on the last panel
		for (i = 0; (link = document.links[i]); i++) {  // and loop through all links
			if (link.href == counter) {  // looking for the last toggle link
				link.className = "toggle on";  // and highlight it
			}
		}
	}
}

function toggle(e) {
	/* We need to know which link was activated when the function was called
	   this will allow us to identify the panel which should be displayed.
       Adapted from http://www.quirksmode.org/js/events_properties.html */
	if (typeof e == 'undefined') {
        var e = window.event;
    }
    var source;
    if (typeof e.target != 'undefined') {
        source = e.target;
    } else if (typeof e.srcElement != 'undefined') {
        source = e.srcElement;
    } else {
        return true;
    }
    /* For most browsers, targ would now be a link element; Safari however
       returns a text node so we need to check the node type to make sure */
    if (source.nodeType == 3) {
        source = source.parentNode;
    }
	for (i = 0; (link = document.links[i]); i++) {
		if (/\btoggle\b/.exec(link.className)) {
			link.className="toggle";
		}
	}
	source.className="toggle on";
    var id = source.href.split('#')[1];
    var elem;
    for (var i = 0; (elem = toggle_toggleElements[i]); i++) {
        if (elem.id != id) {
            elem.style.display = 'none';
        } else {
            elem.style.display = 'block';
        }
    }
    return false; // overrides the href for javascript-enabled browsers
}

var Rimgsa = new Array("Laptop.jpg","Router2.jpg","w2000serv.jpg");
var RcurrentAda = 0;
var RimgCta = 3;
var RDelaySec = 10;
	
function Rcyclea() {
  
  if (RcurrentAda == RimgCta) {
    RcurrentAda = 0;
  }
  document.getElementById("rotateImg").src="Images/RotatingImages/"+Rimgsa[RcurrentAda];
  RcurrentAda++;
  setTimeout("Rcyclea()",RDelaySec * 1000);
}

