﻿
try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }

if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	try {
		xmlhttp = new XMLHttpRequest();
	} catch (e) {
		xmlhttp=false;
	}
}
if (!xmlhttp && window.createRequest) {
	try {
		xmlhttp = window.createRequest();
	} catch (e) {
		xmlhttp=false;
	}
}

iBox.default_width = 797;
iBox.padding = 0;
iBox.fade_in_speed = 0;
iBox.inherit_frames = false;

var overlayContent = new Array();

overlayContent[0] = 'inbound_processing.html';
overlayContent[1] = 'poi_data.html';
overlayContent[2] = 'loc_content.html';
overlayContent[3] = 'outbound.html';
overlayContent[4] = 'apps.html';
overlayContent[5] = 'r_and_a.html';
overlayContent[6] = 'ws_apis.html';

function loadOverlay(ind) {
	loadContent(ind,1);
}

function nextOverlay(next) {
	var currentURL = document.getElementById('overlayUrl').innerHTML;
	var currentIndex, i, nextIndex, prevIndex, getIndex;
	
	for (i=0; i<overlayContent.length; i++) {
		if (overlayContent[i] == currentURL) {
			currentIndex = i;
			nextIndex = i+1;
			prevIndex = i-1;

			if (nextIndex == overlayContent.length) nextIndex = 0;
			if (prevIndex < 0) prevIndex = overlayContent.length - 1;
				
			break;
		}
	}
	
	if (next) { getIndex = nextIndex; } else {getIndex = prevIndex; }
	
	loadContent(getIndex,0);
}

function loadContent(getIndex,niBox) {
	xmlhttp.open("GET", "overlay_content/" + overlayContent[getIndex],true);
	xmlhttp.onreadystatechange=function() {
	  if (xmlhttp.readyState==4) {
	   if (niBox) {
		iBox.show(xmlhttp.responseText);
	   }
	   else {
		iBox.html(xmlhttp.responseText);
	   }
	  }
	 }
	 xmlhttp.send(null)	
}
