
var sLocation = location.href;
var sFileName = "/" + sLocation.substring(sLocation.lastIndexOf("/")+1);
var leftnavlinks = new Array();
var subOpenLoad = "";
var sublvlID = "";
var currentLvl = 5;
var pushSection = '';

function buildSubNav(section) {

pushSection = section;

if (section == "Products") {

leftnavlinks[0] = ['Overview','/products.html'];
leftnavlinks[1] = ['ProIT',''];
leftnavlinks[1]['sub'] = new Array();
leftnavlinks[1]['sub'][0] = ['Overview','/proit/proit_overview.html'];
leftnavlinks[1]['sub'][1] = ['What\'s New','/proit/proit_whats_new.html'];
leftnavlinks[1]['sub'][2] = ['Features','/proit/proit_feature_list.html'];
leftnavlinks[1]['sub'][3] = ['Key Business Values','/proit/proit_key_business_values.html'];
leftnavlinks[1]['sub'][4] = ['Standard Modules','/proit/proit_standardmodules.html'];
leftnavlinks[1]['sub'][5] = ['ProIT Details',''];
leftnavlinks[1]['sub'][5]['sub'] = new Array();
leftnavlinks[1]['sub'][5]['sub'][0] = ['Details','/proit/proit_details.html'];
leftnavlinks[1]['sub'][5]['sub'][1] = ['Architecture','/proit/proit_architecture.html'];
leftnavlinks[1]['sub'][5]['sub'][2] = ['Benefits','/proit/proit_benefits.html'];
leftnavlinks[1]['sub'][5]['sub'][3] = ['ProIT & ITIL','/proit/proit_itil.html'];
leftnavlinks[1]['sub'][6] = ['ProIT Advantages',''];
leftnavlinks[1]['sub'][6]['sub'] = new Array();
leftnavlinks[1]['sub'][6]['sub'][0] = ['Advantages','/proit/proit_advantages.html'];
leftnavlinks[1]['sub'][6]['sub'][1] = ['Top Ten Reasons','/proit/proit_top_10_reasons.html'];
leftnavlinks[1]['sub'][6]['sub'][2] = ['Competitive Comparison','/proit/proit_competitive_comparison.html'];
leftnavlinks[1]['sub'][6]['sub'][3] = ['ProIT vs. Tools','/proit/proit_vs_tools.html'];
if(1==2) {
leftnavlinks[1]['sub'][8] = ['',''];
leftnavlinks[2] = ['ProXi',''];
leftnavlinks[2]['sub'] = new Array();
leftnavlinks[2]['sub'][0] = ['Overview','/proit/proxi_overview.html'];
leftnavlinks[2]['sub'][1] = ['Examples','/proit/proxi_examples.html'];
leftnavlinks[2]['sub'][2] = ['Key Business Values','/proit/proxi_key_business_values.html'];
leftnavlinks[2]['sub'][3] = ['How It Works','/proit/proxi_how_it_works.html'];
leftnavlinks[2]['sub'][4] = ['ProXi Advantages','/proit/proxi_advantages.html'];
leftnavlinks[2]['sub'][5] = ['MOM and Other NMSs','/proit/proxi_integration.html'];
}
leftnavlinks[2] = ['',''];
leftnavlinks[3] = ['Downloads','/proit/downloads.html'];
leftnavlinks[4] = ['White Papers','/proit/white_papers.html'];
leftnavlinks[5] = ['Request Webinar','/proit/request_webinar.html'];

} else if (section == "Services") {

leftnavlinks[0] = ['Overview','/proit/services_support.html'];
leftnavlinks[1] = ['Implementation','/proit/installation_implementation.html'];
leftnavlinks[2] = ['Monitoring & Management','/proit/monitoring_management.html'];
leftnavlinks[3] = ['Support & Maintenance','/proit/support_maintenance.html'];
leftnavlinks[4] = ['Training & Education','/proit/training_education.html'];
leftnavlinks[5] = ['Special Requests','/proit/custom_software_development.html'];
leftnavlinks[6] = ['',''];
leftnavlinks[7] = ['FAQ','/proit/faq.html'];
leftnavlinks[8] = ['Downloads','/proit/downloads.html'];

} else if (section == "Partners") {

leftnavlinks[0] = ['Overview','/proit/partners.html'];
leftnavlinks[1] = ['What We Offer','/proit/what_we_offer.html'];
leftnavlinks[2] = ['',''];
leftnavlinks[3] = ['Partnership Programs','/proit/partnership_programs.html'];
leftnavlinks[4] = ['Channel Partners','/proit/channel_partners.html'];
leftnavlinks[5] = ['Consulting Partners','/proit/consulting_partners.html'];
leftnavlinks[6] = ['Service Providers','/proit/service_providers.html'];
leftnavlinks[7] = ['Technology Partners','/proit/technology_partners.html'];
leftnavlinks[8] = ['',''];
leftnavlinks[9] = ['Partner Application','/proit/partner_application.html'];

} else if (section == "News") {

leftnavlinks[0] = ['Press Releases','/proit/news.html'];
leftnavlinks[1] = ['Articles','/proit/articles.html'];
leftnavlinks[2] = ['Awards & Honors','/proit/awards_honors.html'];
leftnavlinks[3] = ['Success Stories','/proit/success_stories.html'];
leftnavlinks[4] = ['Facts at a Glance','/proit/facts.html'];

} else if (section == "Company") {

leftnavlinks[0] = ['Vision','/proit/company.html'];
leftnavlinks[1] = ['Corporate Values','/proit/corporate_values.html'];
leftnavlinks[2] = ['Customers','/proit/customers.html'];
leftnavlinks[3] = ['Management Team','/proit/management_team.html'];
leftnavlinks[4] = ['Directions','/proit/directions.html'];

}



}


function toggleNav1(subNavLvl, statusSwitch) {
	var status = document.getElementById(subNavLvl).style.display;
	var statusArrow = document.getElementById(subNavLvl+'arrow').src;
	
	if(status == "none" || statusSwitch == 1) {
		document.getElementById(subNavLvl).style.display = "";
		document.getElementById(subNavLvl+'arrow').src = '/images/navarrow_open.gif';
	} else {
		document.getElementById(subNavLvl).style.display = "none";
		document.getElementById(subNavLvl+'arrow').src = '/images/navarrow_close.gif';
	}

		
}

function toggleNav(subNavLvl, statusSwitch) {
	var status = document.all[subNavLvl].style.display;
	var statusArrow = document.all[subNavLvl+'arrow'].src;
	
	if(status == "none" || statusSwitch == 1) {
		document.all[subNavLvl].style.display = "";
		document.all[subNavLvl+'arrow'].src = '/images/navarrow_open.gif';
	} else {
		document.all[subNavLvl].style.display = "none";
		document.all[subNavLvl+'arrow'].src = '/images/navarrow_close.gif';
	}

		
}

function renderLinks(linkEntry, entryNum, subType, maxLinkLength) {
	if (!maxLinkLength) {
		maxLinkLength = 75;
	}
var default_subType = 5;
	if (!subType) {
		subType = default_subType;
	}
var textWidth = 150 - 1 - subType;

var linkText = linkEntry[0];
var linkURL = linkEntry[1];
var aTagCode;
var highlightCode;
var fontColorCode;
var rowBgCode;
var rowRollCode;


	if (linkText.length > maxLinkLength) {
		linkText = linkText.substring(0, linkText.lastIndexOf(" ", maxLinkLength)) + '<br>' + linkText.substring(linkText.lastIndexOf(" ", maxLinkLength) + 1, linkText.length);
	}
	if (linkEntry[0] == "" && linkURL == "") {
		document.write('<tr><td height=18 colspan=4></td></tr>');
	} else if (linkURL == "" && !linkEntry['sub']) {
			
		document.write('<tr><td width=', subType, ' height=18></td><td class="subnavdivlines"></td>');
		document.write('<td width=',textWidth, ' class="leftnav" valign=center style="padding-left:7px">', linkText, '</td></tr>');
			
	} else {
		if (linkEntry['sub']) {
			if (sublvlID == "" || subType < currentLvl) {
				sublvlID = 'sublvl_' + entryNum + '_' + subType;
			} else {
				sublvlID = sublvlID + ',sublvl_' + entryNum + '_' + subType;
			}
			currentLvl = subType;
			document.write('<tr><td colspan=4 height=18><table border=0 cellpadding=0 cellspacing=0 width=100% height=18>')

			highlightCode = 'id="mark_' + entryNum + '_' + subType + '"';
			rowRollCode = ' onMouseOver="document.all[' + "'leftnavlink_" + entryNum+ '_' + subType + "'].style.color='white'; document.all['linkbg_" + entryNum + '_' + subType + "'].style.backgroundColor='#000000'; document.all['mark_" + entryNum + '_' + subType + "'].style.backgroundColor='#FFC700';" + '" onMouseOut="document.all[' + "'leftnavlink_" + entryNum + '_' + subType + "'].style.color=''; document.all['linkbg_" + entryNum + '_' + subType + "'].style.backgroundColor=''; document.all['mark_" + entryNum + '_' + subType + "'].style.backgroundColor='';" + '" onClick="toggleNav(' + "'sublvl_" + entryNum + "_" + subType + "');" + '" style=' + "'cursor:hand'";
			rowBgCode = 'id="linkbg_' + entryNum + '_' + subType + '" class="leftnav"';
			aTagCode = '<img src="/images/navarrow_close.gif" align="absmiddle" name="sublvl_' + entryNum + '_' + subType + 'arrow"><span id="leftnavlink_' + entryNum + '_' + subType + '">' + linkText + '</span>';


		} else if (linkURL == sFileName) {

			if (subType > default_subType) {
				subOpenLoad = sublvlID;
			}

			highlightCode = 'bgcolor="#FFC700"';
			rowRollCode = ' onClick="location.href=' + "'" + linkURL + "';" + '" style=' + "'cursor:hand'";
			rowBgCode = 'class="highlight_leftnav" bgcolor="#000000"';
			aTagCode = '<a href="' + linkURL + '">' + linkText + '</a>';
		} else {
			highlightCode = 'id="mark_' + entryNum + '_' + subType + '"';
			rowRollCode = ' onMouseOver="document.all[' + "'leftnavlink_" + entryNum + '_' + subType + "'].style.color='white'; document.all['linkbg_" + entryNum + '_' + subType + "'].style.backgroundColor='#000000'; document.all['mark_" + entryNum + '_' + subType + "'].style.backgroundColor='#FFC700';" + '" onMouseOut="document.all[' + "'leftnavlink_" + entryNum + '_' + subType + "'].style.color=''; document.all['linkbg_" + entryNum + '_' + subType + "'].style.backgroundColor=''; document.all['mark_" + entryNum + '_' + subType + "'].style.backgroundColor='';" + '" onClick="location.href=' + "'" + linkURL + "';" + '" style=' + "'cursor:hand'";
			rowBgCode = 'id="linkbg_' + entryNum + '_' + subType + '" class="leftnav"';
			aTagCode = '<a href="' + linkURL + '" id="leftnavlink_' + entryNum + '_' + subType + '">' + linkText + '</a>';
			//aTagCode = '<a href="">' + linkText + '</a>';
		}

		document.write('<tr', rowRollCode, ">");
		document.write('<td width=', subType, ' height=18 ',highlightCode , '></td><td width=1 class="subnavdivlines"><img src="/images/transpac.gif" width=1 height=1></td>');
		document.write('<td width=',textWidth, ' ', rowBgCode , ' valign=center style="padding-left:7px;padding-right:0px">',aTagCode , '</td></tr>');
			
		if (linkEntry['sub']) {
			document.write('</table><div id="sublvl_' + entryNum + '_' + subType + '" style="display:none"><table border=0 cellpadding=0 cellspacing=0 width=100%>')
			document.write('<tr><td colspan=4 height=1 class="subnavdivlines"></tr>');
			for ( var h=0 ; h<linkEntry['sub'].length ; h++ ) {
				renderLinks(linkEntry['sub'][h], entryNum+'_'+h, subType + 7);
				if (h < linkEntry['sub'].length - 1) {
					document.write('<tr><td height=1 class="subnavdivlines" colspan=4></td></tr>');
				}

			}
			if (subType > default_subType) {
				//currentLvl = currentLvl - 7;
			}
			document.write('</table></div></td></tr>')

		}
	}




}


function leftNav(navlinkList, subType) {

	if(!subType) {
		subType = 5;
	}
	if(!navlinkList) {
		linkList = leftnavlinks;
	}

	for ( var i=0 ; i<linkList.length ; i++ ) {
		renderLinks(linkList[i], i, subType);

		if(!navlinkList) {
			document.write('<tr><td height=1 class="subnavdivlines" colspan=4></td></tr>');
		}
	}

	
if (subOpenLoad != "") {
	var subLvls = subOpenLoad.split(",");
	for ( var i=0 ; i<subLvls.length ; i++ ) {
		toggleNav(subLvls[i],1);
	}
	//alert(subOpenLoad);
}

if(pushSection == "Products") {
	toggleNav('sublvl_1_5',1);
}

}


function ProITflash(introLocationStr) {
	var popupX = 700;
	var popupY = 438;
	var popupSize = "width=" + popupX + ",height=" + popupY;
	var winX = (screen.availWidth-popupX)/2;
	var winY = (screen.availHeight-popupY)/2;
	var popupPos = "";
	if (window.screen && document.layers) {
		popupPos = ",screenX=" + winX + ",screenY=" + winY;
	 } else if (window.screen && !document.layers) {
		popupPos = ",left=" + winX + ",top=" + winY;
	}
	window.open(introLocationStr, "flashWindow", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no," + popupSize + popupPos);

}

function featureTour(whichFeature) {
	if(!whichFeature) {
		whichFeature = 0;
	}
	var popupX = 786;
	var popupY = 550;
	var popupSize = "width=" + popupX + ",height=" + popupY;
	var winX = (screen.availWidth-popupX)/2;
	var winY = (screen.availHeight-popupY)/2;
	var popupPos = "";
	if (window.screen && document.layers) {
		popupPos = ",screenX=" + winX + ",screenY=" + winY;
	 } else if (window.screen && !document.layers) {
		popupPos = ",left=" + winX + ",top=" + winY;
	}
	window.open("/feature_tour/feature_browser.html?feature=" + whichFeature, "featureWindow", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes," + popupSize + popupPos);

}

//------------------------------------------------------------------------


function setCookie(name,value,expires,path,domain,secure)  {
var today = new Date();
today.setTime( today.getTime() );
if (expires) {
	expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date(today.getTime() + (expires));

document.cookie = name + "=" +escape(value) +
((expires) ? ";expires=" + expires_date.toGMTString() : "") + 
((path) ? ";path=" + path : "" ) + 
((domain) ? ";domain=" + domain : "") +
((secure) ? ";secure" : "");
}

function readCookie(name) {
	
var start = document.cookie.indexOf(name + "=");
var len = start + name.length + 1;
	if (!start && name != document.cookie.substring(0,name.length)) {
		null;
	}
	if (start == -1) return null;
var end = document.cookie.indexOf(";", len);
	if (end == -1) end = document.cookie.length;

return unescape(document.cookie.substring(len,end));
}


var strQuery;
var arrayParm;
var arrayValue;
var adSource;
var goLocation;

strQuery = location.search.substring(1);

arrayParm = strQuery.split("&");



for ( i=0; i<arrayParm.length; i++ ) {
	arrayValue = arrayParm[i].split("=");
	if (arrayValue[0] == "source") {
		adSource = arrayValue[1];
	} else if (arrayValue[0] == "go") {
		goLocation = arrayValue[1];
	} else if (arrayValue[0] != ""){
		evlStr = "var " + arrayValue[0] + " = \"" + arrayValue[1] + "\"";
		eval(evlStr);
	}
}
if (adSource && adSource != "" && adSource != "null") {
	setCookie('adSource',adSource,'3','/','','');
}



//------------------------------------------------------------------------


function pressRelease(whichRelease) {
	if(!whichRelease) {
		whichRelease = 0;
	}
	var popupX = 786;
	var popupY = 570;
	var popupSize = "width=" + popupX + ",height=" + popupY;
	var winX = (screen.availWidth-popupX)/2;
	var winY = (screen.availHeight-popupY)/2;
	var popupPos = "";
	if (window.screen && document.layers) {
		popupPos = ",screenX=" + winX + ",screenY=" + winY;
	 } else if (window.screen && !document.layers) {
		popupPos = ",left=" + winX + ",top=" + winY;
	}
	window.open("/press_releases/release.html?release=" + whichRelease, "releasaeWindow", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes," + popupSize + popupPos);

}

//------------------------------------------------------------------------