//special Javascript to support current Microsite

function openMicrosite(theURL){
	if(!(theURL)){theURL = 'files/flash/na/think/default.html?mainWindowSet'}
	var winName = 'microSiteWindow';
	var features = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=800,height=518;'
	window.open(theURL,winName,features);
}

function VideoPopup(pVideoFilename, configUrlHost, configUrlBase)
{

window.open(configUrlHost + configUrlBase + "na/VideoPlayer.aspx?File=" + pVideoFilename,
	"mywindow","location=no,status=no,scrollbars=no,toolbar=no,menubar=no,directories=no,resizable=no,width=326,height=309");

}

function setCaret(field){
	if (field.createTextRange) {
		var r = field.createTextRange();
		r.moveStart('character', field.value.length);
		r.collapse();
		r.select();
	}
}

function menuMOver(folder,color,columns){
//alert('menuMOver' + folder + color + columns)
 	folder.style.borderTopColor=color;
	menu = window.document.getElementById("menu"+folder.id);
	if(menu){
		head = window.document.getElementById("head"+folder.id);
		pos = getAnchorPosition("head"+folder.id);

		//Note: This is a workaround for display issues within the same
		//version of IE, across different machines.  No concrete idea
		//was recieved in researching this issue.  It works with IE 5.5+ on Win 2000, XP, 2003, Mozilla
		
		var ht = pos.y
		if (/netscape/i.test(navigator.appName)) {ht-=1;}
		if (/safari/i.test(navigator.userAgent)) {ht-=1;}

//alert(ht);
		if (ht > 120)
		{
			menu.style.top = ((ht/2) + head.offsetHeight) + 'px';
		}
		else
		{
			menu.style.top = (ht + head.offsetHeight) + 'px';
		}
//alert('2');
//menu.style.left = '0px';
//alert(head.offsetHeight);
//alert('menu.style.left before: ' + menu.style.left);
        //var menupos = pos.x + (head.offsetWidth/2) - (menu.offsetWidth/2);
//alert('menupos: ' + menupos);
		menu.style.left = (pos.x - 8) + 'px';
//alert('menu.style.left after: ' + menu.style.left);
//alert('pos.x: ' + pos.x);
//alert('head.offsetWidth/2: ' + (head.offsetWidth/2));
//alert('menu.offsetWidth/2: ' + (menu.offsetWidth/2));
//alert(menu.style.left);
		if(getAnchorPosition("menu"+folder.id).x<0){
			menu.style.left = '0px';
		}
//alert(getAnchorPosition("head"+folder.id).x);
//alert(menu.style.left);
		menu.style.visibility='visible';		
	}
}

function menuMOut(folder,stick){
//alert('menuMOut' + folder + stick)
	if(!stick){
		folder.style.borderTopColor='white';
	}
	menu = window.document.getElementById("menu"+folder.id);
	if(menu){
		menu.style.visibility='hidden';
	}
}

function itemMOver(folder,color){
//alert('itemMOver' + folder + color)
	folder.style.backgroundColor=color;
}

function itemMOut(folder,color){
//alert('itemMOut' + folder + color)
	folder.style.backgroundColor=color;
}

// getAnchorPosition(anchorname)
//   This function returns an object having .x and .y properties which are the coordinates
//   of the named anchor, relative to the BasePage.
function getAnchorPosition(anchorname) {
	// This function will return an Object with x and y properties
	var useWindow=false;
	var coordinates=new Object();
	var x=0,y=0;
	// Browser capability sniffing
	var use_gebi=false, use_css=false, use_layers=false;
	if (window.document.getElementById) { use_gebi=true; }
	else if (window.document.all) { use_css=true; }
	else if (window.document.layers) { use_layers=true; }
	// Logic to find position
 	if (use_gebi && window.document.all) {
//alert(1);
		x=AnchorPosition_getPageOffsetLeft(window.document.all[anchorname]);
		y=AnchorPosition_getPageOffsetTop(window.document.all[anchorname]);
		}
	else if (use_gebi) {
//alert(2);
		var o=window.document.getElementById(anchorname);
		x=AnchorPosition_getPageOffsetLeft(o);
		y=AnchorPosition_getPageOffsetTop(o);
		}
 	else if (use_css) {
//alert(3);
		x=AnchorPosition_getPageOffsetLeft(window.document.all[anchorname]);
		y=AnchorPosition_getPageOffsetTop(window.document.all[anchorname]);
		}
	else if (use_layers) {
//alert(4);
		var found=0;
		for (var i=0; i<window.document.anchors.length; i++) {
			if (window.document.anchors[i].name==anchorname) { found=1; break; }
			}
		if (found==0) {
			coordinates.x=0; coordinates.y=0; return coordinates;
			}
		x=window.document.anchors[i].x;
		y=window.document.anchors[i].y;
		}
	else {
//alert(5);
		coordinates.x=0; coordinates.y=0; return coordinates;
		}
	coordinates.x=x;
	coordinates.y=y;
	return coordinates;
	}

// getAnchorWindowPosition(anchorname)
//   This function returns an object having .x and .y properties which are the coordinates
//   of the named anchor, relative to the window
function getAnchorWindowPosition(anchorname) {
	var coordinates=getAnchorPosition(anchorname);
	var x=0;
	var y=0;
	if (window.document.getElementById) {
		if (isNaN(window.screenX)) {
			x=coordinates.x-window.document.body.scrollLeft+window.screenLeft;
			y=coordinates.y-window.document.body.scrollTop+window.screenTop;
			}
		else {
			x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
			y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
			}
		}
	else if (window.document.all) {
		x=coordinates.x-window.document.body.scrollLeft+window.screenLeft;
		y=coordinates.y-window.document.body.scrollTop+window.screenTop;
		}
	else if (window.document.layers) {
		x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
		y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
		}
	coordinates.x=x;
	coordinates.y=y;
	return coordinates;
	}

// Functions for IE to get position of an object
function AnchorPosition_getPageOffsetLeft (el) {
	var ol=el.offsetLeft;
	while ((el=el.offsetParent) != null) { ol += el.offsetLeft; }
	return ol;
	}

function AnchorPosition_getWindowOffsetLeft (el) {
	return AnchorPosition_getPageOffsetLeft(el)-window.document.body.scrollLeft;
	}	

function AnchorPosition_getPageOffsetTop (el) {
	var ot=el.offsetTop;
	while((el=el.offsetParent) != null) { ot += el.offsetTop; }
	return ot;
	}

function AnchorPosition_getWindowOffsetTop (el) {
	return AnchorPosition_getPageOffsetTop(el)-window.document.body.scrollTop;
	}
	
var popup = null;

function CreateWnd (file, title, width, height, resize, showbrowserbars)
{
	var doCenter = false;
	if((popup == null) || popup.closed)
	{
		if(!(navigator.appName=="Netscape")){width+=18;}
		attribs = "";
		if(resize) size = "yes"; else size = "no";
		for(var item in window)
			{ if(item == "screen") { doCenter = true; break; } }
		if(doCenter)
		{	
			if(width > screen.availWidth){width=screen.availWidth}
			if(height > (screen.availHeight - 38)){height=screen.availHeight - 38}
			if(screen.availWidth <= width || screen.availHeight <= height) size = "yes";
			WndTop  = ((screen.availHeight - 38) - height) / 2;
			WndLeft = (screen.availWidth  - width)  / 2;
			attribs = "width=" + width + ",height=" + height + ",resizable=" + size + ",scrollbars=" + size + "," + 
			"status=" + showbrowserbars + ",toolbar=" + showbrowserbars + ",directories=" + showbrowserbars + ",menubar=" + showbrowserbars + ",location=" + showbrowserbars + ",top=" + WndTop + ",left=" + WndLeft;
		}
		else
		{
			if(navigator.appName=="Netscape" && navigator.javaEnabled())
			{	
				var toolkit = java.awt.Toolkit.getDefaultToolkit();
				var screen_size = toolkit.getScreenSize();
				if(screen_size.width <= width || screen_size.height <= height) size = "yes";
				WndTop  = (screen_size.height - height) / 2;
				WndLeft = (screen_size.width  - width)  / 2;
				attribs = "width=" + width + ",height=" + height + ",resizable=" + size + ",scrollbars=" + size + "," + 
				"status=" + showbrowserbars + ",toolbar=" + showbrowserbars + ",directories=" + showbrowserbars + ",menubar=" + showbrowserbars + ",location=" + showbrowserbars + ",top=" + WndTop + ",left=" + WndLeft;
			}
			else
			{
				size = "yes";
				attribs = "width=" + width + ",height=" + height + ",resizable=" + size + ",scrollbars=" + size + "," + 
				"status=no,toolbar=no,directories=no,menubar=no,location=no";
			}
		}

		if(!(file.indexOf('images')<0)){
			popup = open('', 'SteelcaseFullImage', attribs);
			popup.window.document.write('<html xmlns="http://schemas.microsoft.com/intellisense/html-401"><link rel="SHORTCUT ICON" href="images/infocrats.ico">
<head><title>'+title+'</title><script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-25148138-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>
</head><body style="margin:0"><img src="'+file+'"></body></html>');
		}
		else{
			popup = open(file, 'SteelcasePopUp', attribs);
		}
	}
	else
	{
		DestroyWnd();
		CreateWnd(file, title, width, height, resize, showbrowserbars);
	}
}

function DestroyWnd ()
{
	if(popup != null)
	{
		popup.close();
		popup = null;
	}
}

function browserHeight() {
  if(typeof(window.innerHeight) == 'number'){
    //Non-IE
    return window.innerHeight;
  } else if(window.document.documentElement && window.document.documentElement.clientHeight){
    //IE 6+ in 'standards compliant mode'
    return window.document.documentElement.clientHeight;
  } else if( window.document.body && window.document.body.clientHeight){
    //IE 4 compatible
    return window.document.body.clientHeight;
  }
}

function browserWidth() {
  if(typeof(window.innerWidth) == 'number'){
    //Non-IE
    return window.innerWidth;
  } else if(window.document.documentElement && window.document.documentElement.clientWidth){
    //IE 6+ in 'standards compliant mode'
    return window.document.documentElement.clientWidth;
  } else if( window.document.body && window.document.body.clientWidth){
    //IE 4 compatible
    return window.document.body.clientWidth;
  }
}

function embedFlash(url,height,width, language) {
    document.write('<!--[if IE]>');
	document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
	document.write('		codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"');
	document.write('		width="' + width + '" height="' + height + '"');
	document.write('		id="flash"');
	document.write('		viewastext>');
	document.write('	<PARAM name="movie" value="' + url + '?language=' + language + '">');
	document.write('	<PARAM name="quality" value="high">');
    document.write('   <PARAM name="salign" VALUE="tr">');
	document.write('	<PARAM name="bgcolor" value="#FFFFFF">');
	document.write('	<PARAM name="wmode" value="transparent">');
	document.write('	<PARAM name="scale" value="exactfit">');
	document.write('</OBJECT>');
	document.write('<![endif]-->');
	document.write('<![if !IE]>');
	document.write('<EMBED src="' + url + '?language=' + language + '" ');
	document.write('		quality="high"');
	document.write('		bgcolor="#FFFFFF"');
	document.write('		width="' + width + '" ');
	document.write('		height="' + height + '"');
	document.write('		type="application/x-shockwave-flash"');
	document.write('		pluginspage="http://www.macromedia.com/go/getflashplayer"');
	document.write('		salign="lt"');
	document.write('		wmode="transparent"');
	document.write('		scale="exactfit"');
	document.write('		id="flash">');
	document.write('</EMBED>');
	document.write('<![endif]>');
}

function embedAppdbIdrop(Image, Drawing, Height, Width, NotInstalledImage, Path) {
    document.write('<object name="idrop" classid="clsid:21E0CB95-1198-4945-A3D2-4BF804295F78" width="' + Width + '" height="' + Height + '" VIEWASTEXT>');
    document.write('				<param name="background" value="' + Image + '"/>');
    document.write('				<param name="proxyrect" value="0,0,' + Width + ',' + Height + '"/>');
    document.write('				<param name="griprect" value="0,0,' + Width + ',' + Height + '"/>');
    document.write('				<param name="package" value="' + Path + '?f=18310&adbstreamfileid=idrop&tu=' + Image + '&du=' + Drawing +'"/>');
    document.write('				<param name="validate" value="1"/>');
    document.write('				<img src="' + NotInstalledImage + '" />');
    document.write('</object>');
}

function embedIdropv2(Background, Package, Height, Width, NotInstalledImage) {
    document.write('<object name="idrop" classid="clsid:21E0CB95-1198-4945-A3D2-4BF804295F78" width="' + Width + '" height="' + Height + '" VIEWASTEXT>');
    document.write('				<param name="background" value="' + Background + '"/>');
    document.write('				<param name="proxyrect" value="0,0,' + Width + ',' + Height + '"/>');
    document.write('				<param name="griprect" value="0,0,' + Width + ',' + Height + '"/>');
    document.write('				<param name="package" value="' + Package +'"/>');
    document.write('				<param name="validate" value="1"/>');
    document.write('				<img src="' + NotInstalledImage + '" />');
    document.write('</object>');
}

