// JavaScript Document

menuArray = new Array(
new Array("Products","Agentivity Analytics","Agentivity eLearning","Quick Facts","System Architecture","Requirements"),
new Array("Services"),
new Array("Support","FAQs"),
new Array("Partners"),
new Array("Customers"),
new Array("News"),
new Array("About Syntora","Contact Us","Management"))

function trimMenuName(menuName) {
	if (menuName.indexOf(" ") < 0) {
		return menuName.toLowerCase()
	}
	else {
		menuNameArray = menuName.split(" ")
		newString = ""
		x = 0
		while (x < menuNameArray.length) {
			newString = newString + menuNameArray[x]
		x++
		}
		return newString.toLowerCase()
	}
}

function checkSubCurrent(subMenuArray) {
	z=1
	while (z < subMenuArray.length) {
		searchSubStr = "/" + trimMenuName(subMenuArray[z]) + "/"
		if (document.URL.indexOf(searchSubStr) >= 0) { //subMenu is current
			return true
		}
	z++
	}
return false
}

function generateMenuRow(rowItem,isShaded,bullet,path) {
	switch (isShaded) {
		case true:
			document.write('<tr bgcolor="#e1e1e1">')
			switch (bullet) {
				case "minus":
					document.write('<td width="30" align="center" valign="middle">')
					document.write('<img src="/img/bullet_minus_on_grey.gif" width="13" height="12" class="bullet" />')
					document.write('</td>')
				break
				case "circle":
					document.write('<td width="30" align="center" valign="middle">')
					document.write('<img src="/img/bullet_circle_no_ring_on_gr.gif" width="13" height="12" class="bullet" />')
					document.write('</td>')
				break
			}
		break
		case false:
			document.write('<tr>')
			switch (bullet) {
				case "plus":
					document.write('<td width="30" align="center" valign="middle">')
					document.write('<img src="/img/bullet_plus.gif" width="13" height="12" class="bullet" />')
					document.write('</td>')
				break
				case "minus":
					document.write('<td width="30" align="center" valign="middle">')
					document.write('<img src="/img/bullet_minus.gif" width="13" height="12" class="bullet" />')
					document.write('</td>')
				break
				case "circle":
					document.write('<td width="30" align="center" valign="middle">')
					document.write('<img src="/img/bullet_circle_no_ring.gif" width="13" height="12" class="bullet" />')
					document.write('</td>')
				break
			}
		break
	}
	document.write('<td width="130" align="left" valign="middle">')
	document.write('<a href="' + path + '" class="nav">' + rowItem + '</a></td></tr>')
	document.write('<tr>') 
}

function generateSubMenuRow(rowitem,isShaded,path) {
	if (isShaded == true) {
		document.write('<tr bgcolor="#e1e1e1">')
		document.write('<td align="left" valign="middle"></td>')
		document.write('<td align="left" valign="middle">')
		document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">')
		document.write('<tr>')
		document.write('<td width="7" align="left" valign="middle"><img src="/img/sub_bullet_circle_on_grey.gif" width="4" height="12" class="subbullet" /></td>')
		document.write('<td align="left" valign="middle"><a href="' + path + '" class="nav">' + rowitem + '</a></td>')
		document.write('</tr>')
		document.write('</table>')
		document.write('</td>')
		document.write('</tr>')
	}
	else {
		document.write('<tr>')
		document.write('<td align="left" valign="middle"></td>')
		document.write('<td align="left" valign="middle">')
		document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">')
		document.write('<tr>')
		document.write('<td width="7" align="left" valign="middle"><img src="/img/sub_bullet_circle.gif" width="4" height="12" class="subbullet" /></td>')
		document.write('<td align="left" valign="middle"><a href="' + path + '" class="nav">' + rowitem + '</a></td>')
		document.write('</tr>')
		document.write('</table>')
		document.write('</td>')
		document.write('</tr>')
	}
}

function generateLeftSideNav() {
	i = 0
	while (i < menuArray.length) {
		searchStr = "/" + trimMenuName(menuArray[i][0]) + "/"
		pageLocation = searchStr + trimMenuName(menuArray[i][0]) + ".htm"
		if (document.URL.indexOf(searchStr) >= 0) {//menu index item is in URL
			if (menuArray[i][1] == null) { // menu index is current with no subs
				generateMenuRow(menuArray[i][0],true,"circle",pageLocation)
			}
			else { // menu index is current with subs
				if (checkSubCurrent(menuArray[i]) == true) { // subMenu is current
					generateMenuRow(menuArray[i][0],false,"minus",pageLocation)
				}
				else { // subMenu is not current
					generateMenuRow(menuArray[i][0],true,"minus",pageLocation)
				}
				
				// generate subMenus
				j=1
				while (j < menuArray[i].length) {
					searchSubStr = "/" + trimMenuName(menuArray[i][j]) + "/"
					pageLocation = searchStr + trimMenuName(menuArray[i][j]) + "/" + trimMenuName(menuArray[i][j]) + ".htm"
					if (document.URL.indexOf(searchSubStr) >= 0) { //subMenu is current
						generateSubMenuRow(menuArray[i][j],true,pageLocation)
					}
					else { //subMenu is not current
						generateSubMenuRow(menuArray[i][j],false,pageLocation)
					}
				j++
				}
			}
		}
		else { // menu index item is not in URL
			if (menuArray[i][1] == null) { // unshaded main menu item with no subs
				generateMenuRow(menuArray[i][0],false,"circle",pageLocation)
			}
			else // unshaded main menu item with subs
			{
				generateMenuRow(menuArray[i][0],false,"plus",pageLocation)
			}
		}
		i++
	} 
}

function windowPop(URL,facename,w,h,scroll){
	h=parseInt(h);
	w=parseInt(w);
	var winl = (screen.width-10)/2;
	var wint = (screen.height-h)/2;
	settings='height='+(h+20)+',width='+(screen.width-50)+',top='+wint+',left='+10+',scrollbars='+scroll+',toolbar=no,location=no,status=no,menubar=no,resizable=yes,dependent=no';
	window.open(URL,facename,settings);
}

function getBanner() {
	num = Math.round(Math.random()*3)
	if (num == 0) {
		num = 1
	}
	document.write('<img src="/img/banners/' + num + '.jpg" width="634" height="65" />')
}

function displayBanner() {
	if (document.URL.indexOf("index.htm") == -1) {
		if (document.URL.indexOf(".htm") != -1) {
			document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">')
			document.write('<tr>')
			document.write('<td class="cellHighlightColor"><script>getBanner()</script></td>')
			document.write('</tr>')
			document.write('<tr>') 
			document.write('<td class="customBorder" height="1"><img src="/img/1x1.gif" /></td>')
			document.write('</tr>')
			document.write('</table>')
		}
	}
}

function lowerLSN () {
	document.write('<table class="cellHighlightColor" width="100%" border="0" cellspacing="0" cellpadding="0 0 10 0">')

	document.write('<tr>')
	document.write('<td align="center">')
	//document.write('<a href="/request_webcast.htm?refer=home"><img src="/img/Web_Seminar_1.jpg" border="0" width="90%"></a>')
	document.write('<a href="http://www.vpi-corp.com/syntora/"><img src="/img/Live_Demo.gif"alt="Live Demo" border="0"></a>')
	document.write('</td>')
	document.write('</tr>')

	document.write('<tr>')
	document.write('<td>')
	//document.write('<img src="/img/schedule_a_demo.gif" border="0" usemap="#schedule">')
	document.write('<a href="http://www.vpi-corp.com/syntora/"><img src="/img/Whitepapers.gif"alt="Free Whitepapers" border="0"></a>')
	document.write('</td>')
	document.write('</tr>')

	document.write('<tr>')
	document.write('<td>')
	document.write('<a href="http://www.vpi-corp.com/syntora/"><img src="/img/Resource_Library.gif" alt="Resource Library" border="0"></a>')
	document.write('</td>')
	document.write('</tr>')
	
	
	document.write('<tr>')
	document.write('<td>')
	document.write('<a href="http://www.vpi-corp.com/syntora/"><img src="/img/Free_OnDemand_Webcasts.gif"alt="Free OnDemand Webcasts" border="0"></a>')
	document.write('</td>')
	document.write('</tr>')
	
	
	document.write('<tr>')
	document.write('<td>')
	document.write('')
	document.write('</td>')
	document.write('</tr>')
	
/*	document.write('<tr>') 
	document.write('<td class="customBorder" height="1"><img src="/img/1x1.gif" /></td>')
	document.write('</tr>')
*/

	document.write('</table>')
	
	document.write('<map name="datasheetmap">')
	document.write('<area shape="rect" coords="21,51,138,78" href="/datasheets/AgentivityPerformanceSuiteBrochure.pdf">')
	document.write('<area shape="rect" coords="21,85,138,110" href="/datasheets/AgentivityAnalyticsDatasheet.pdf">')
	document.write('<area shape="rect" coords="21,118,138,143" href="/datasheets/AgentivityeLearningDatasheet.pdf">')
	document.write('<area shape="rect" coords="21,151,138,178" href="/datasheets/AgentivityMessagingDatasheet.pdf">')
	document.write('</map>')
	
	document.write('<map name="schedule">')
	document.write('<area shape="rect" coords="20,143,133,164" href="/schedule_a_demo.htm">')
	document.write('</map>')
}

function infoSignUpLink() {
	if ((document.URL.indexOf('/products/') >= 0) || (document.URL.indexOf('/services/') >= 0) || (document.URL.indexOf('/faqs/')) >= 0) {
		document.write('<tr><td align="center" class="cellHighlightColor">')
		document.write('<p><a class="nav" href="http://www.vpi-corp.com/syntora/">CLICK HERE TO REQUEST MORE INFORMATION</a></p>')	
		document.write('</td></tr>')
	}
}