<!--
// DYNAMIC menus
//
// Browser / OS Detection
//
var DOM = ( document.getElementById ) ? 1 : 0;
var IE  = ( document.all 			) ? 1 : 0;
var IE4 = ( document.all && !DOM 	) ? 1 : 0;
var NS4 = ( document.layers && !DOM ) ? 1 : 0;
var NS6 = ( DOM && !IE				) ? 1 : 0;
var IE5 = (navigator.appVersion.indexOf("MSIE 5") != -1);
var IE6 = (navigator.appVersion.indexOf("MSIE 6") != -1);
var IE7 = (navigator.appVersion.indexOf("MSIE 7") != -1);
var IE8 = (navigator.appVersion.indexOf("MSIE 8") != -1);

var browser = ( DOM ) ? 'DOM' : ( (NS4) ? 'NS4' : '' );
var oldIE   = ( (navigator.appName.indexOf('Microsoft') >= 0) && (navigator.appVersion.indexOf('MSIE 4.') >= 0) ) ? 1 : 0;
var MAC     = ( (navigator.appVersion.indexOf("PPC") >0) || (navigator.appVersion.indexOf("Mac") >0) ) ? 1 : 0;
var OP9     = ( navigator.appName.indexOf("Opera") >= 0 ) ? 1 : 0;

NS6 = OP9 ? 0 : NS6;

//
// Initialize vars
//
var imagePath = "/images/";
var navArrow  = '<img src="./images/spacer.gif" width="1" height="6" border=0 align="absmiddle">';
var mnuWidth  = 211;
var mnuHeight = 19;
var mnuColor  = "#ffcc33";
var mnuHighlight   = "#ffcc33";
var mnuborderColor = "#ffffff";
var brdSty1 = ' border:1px solid ' + mnuborderColor + '; border-bottom-width:0; '
var brdSty2 = ' border:1px solid ' + mnuborderColor + '; width:' + mnuWidth + 'px; height:' + mnuHeight + 'px;'
var mnuHoff = new Array(0,0,0,0,0);
var mnuVoff = new Array(0,0,0,0,0);

var mnuHpos = new Array(0,0,0,0,0);
var mnuVpos = new Array(0,0,0,0,0);
if( IE5 || IE6 || IE7 || OP9 )
{
	for( var i=0; i<mnuVoff.length; i++ ) mnuVoff[i]=37;
}
else if( NS6 )
{
	for( var i=0; i<mnuVoff.length; i++ ) mnuVoff[i]=12;
}

mnuArr     = new Array('hdr1','hdr2','hdr3','hdr4','hdr5');
mnuPageArray = new Array('index','apps','ringtone','support','company_profile');
imgArr    = new Array('hdr1','hdr2','hdr3','hdr4','hdr5');

var URLpath = new String( window.location ).toLowerCase();
var currentSection = ""

var active=false
var menusReady = false
var currentMenu = ""
var wait, show;
var bHighlight = true;


hdr1 = new Array (
	["Solutions Overview","/Solutions-Overview.aspx",""],
	["View by Solution Type:","null",""],
	["Online Point of Sale","/Online-Point-of-Sale.aspx","1"],
	["Electronic Agreements","/Electronic-Agreements.aspx","1"],
	["Mobile Devices","/Mobile-Devices.aspx","1"],
	["Remote Authorizations","/Remote-Authorizations.aspx","1"],
	["Custom Solutions","/Custom-Solutions.aspx","1"],
	["View by Business Challenge:","null",""],
	["Reduce Chargebacks","/Reduce-Chargebacks.aspx","1"],
	["Expedite Agreements Online","/Expedite-Agreements-Online.aspx","1"],
	["Accept Signatures via PDA","/Accept-Signatures-via-PDA.aspx","1"],
	["Authorize Consent Remotely","/Authorize-Consent-Remotely.aspx","1"]
);
hdr2 = new Array (
	["Small & Midsize Companies","/Small-Midsize-Companies.aspx",""],
	["Large Enterprises","/Large-Enterprises.aspx",""]
);
hdr3 = new Array (
	["Test Drive by Solution Type","/Solutions_Demos.aspx",""],
	["Test Drive by Industry","/Industry_Demos.aspx",""]
);
hdr4 = new Array (
	["SignatureLink Support & Services","/SignatureLink-Support.aspx",""]
);
hdr5 = new Array (
	["About SignatureLink","/About-SignatureLink.aspx",""],
	["Management Team","/Management-Team.aspx",""],
	["E-Signature Learning Center","/Digital-Signature-Learning-Center.aspx",""],
	["Contact SignatureLink","/ContactUs.aspx",""]
);

//
// Helper functions
//
function preloadImages()
{
	var img;
	for(x=0;x<imgArr.length;x++) {
		img = imagePath + imgArr[x].replace(/img/,"").toLowerCase();
		eval(imgArr[x] + 'off = new Image()');
		eval(imgArr[x] + 'off.src = "' + img + '_off.jpg"');
		eval(imgArr[x] + 'on = new Image()');
		eval(imgArr[x] + 'on.src = "' + img + '_on.jpg"');
	}
}
function turnstate(i)
{
	var img = imagePath + i.replace(/img/, "").toLowerCase();
	eval(i + 'state = new Image();');
	eval(i + 'state.src = "' + img + '_state.jpg";');
	document[i].src = eval(i + "state.src")
}
function turnon(i)
{
	if( (i != currentSection) && (i.indexOf("promo") == -1) && (document[i].src.indexOf( '_state.jpg' ) == -1) )
		document[i].src = eval(i + "on.src")
}
function turnoff(i)
{
	if( (i != currentSection) && (i.indexOf("promo") == -1) && (document[i].src.indexOf( '_state.jpg' ) == -1) )
		document[i].src = eval(i + "off.src");
}

function getSection()
{
	var bOn = false;
	for( var i=0; i < mnuPageArray.length; i++ )
	{
		if( !bOn && URLpath.indexOf( mnuPageArray[i] ) >= 0 )
		{
			x = imgArr[i];
			if( document[x].src.indexOf( '_state.jpg' ) >= 0 ) currentSection = x;
			currentSection = x;
			turnstate(currentSection);
			bOn = true;
		}
	}
}

function getEvent(event, v1, v2)
{
	if(event=="lock")
	{
		return 'onmouseout="unLock(\'' + v1 + 'Lyr\')" onmouseover="lock(\'' + v1 + 'Lyr\')"';
	}
	else
	{
		return 'onmouseover="highlight(' + v1 + ',' + v2 + ',this)" onmouseout="unhighlight(' + v1 + ',' + v2 + ',this)"';
	}
}


function initLayers()
{
	if (IE || DOM)
	{
		for (x=0; x<mnuArr.length; x++) {
			layerName = mnuArr[x] + 'Layer'
			useArray = eval(mnuArr[x])
			mnu = '<div id="' + layerName + '" style="position:absolute; width:' + mnuWidth + 'px; z-index:20; visibility:hidden;" ' + getEvent("lock", mnuArr[x], null) + '>';
			for (v=0;v<useArray.length;v++) {
//				mnu += '<div id="' + layerName + v + '" class="' + ((v == useArray.length - 1) ?  'dnav2' : 'dnav') + '" ' + getEvent("hl", x, v) + ' onclick="linkto(\'' + useArray[v][1] + '\')">'
				mnu += '<div id="' + layerName + v + '" class="' + ((v == useArray.length - 1) ?  'dnav2' : 'dnav') + '"';
				if( useArray[v][1] == "null" )
				{
					mnu += '>';
				}
				else
				{
					mnu += ' ' + getEvent("hl", x, v) + '">';
				}
				mnu += '<table cellspacing="0"><tr><td class="menuLink">';
				if( useArray[v][1] == "null" )
				{
					mnu += '<span class="menuTitle" id="' + x + 'hdrLink' + v + '">' + useArray[v][0] + '<\/span>';
				}
				else
				{
					mnu += '<a href="' + useArray[v][1] + '" class="menuLink' + useArray[v][2] + '" id="' + x + 'hdrLink' + v + '">' + useArray[v][0] + '<\/a>';
				}
				mnu += '<\/td><\/tr><\/table><\/div>';
			}
			mnu += '<\/div>\n';
			document.write(mnu);
			//if(x==0) alert(mnu);
		}
	}

	if (NS4)
	{
		document.write('<style type="text/css">\n')
		document.write('all.mnuItem1 {' + brdSty1 + ' width:' + mnuWidth + 'px; }\n')
		document.write('all.mnuItem2 {' + brdSty2 + '}\n')
		document.write('all.menuLink { padding-left: 2px; padding-top: 0px;}</style>')
		for (x=0; x<mnuArr.length; x++)
		{
			layerName = mnuArr[x] + 'Layer'
			useArray = eval(mnuArr[x])
			mnu = '<layer id="' + layerName + '" width=' + mnuWidth + ' z-index=20 visibility=hide ' + getEvent("lock", mnuArr[x], null) + '>';
			for (v=0;v<useArray.length;v++)
			{
				props = 'z-index=' + (x + 30 - v) + ' class=' + ((v == useArray.length - 1) ?  'mnuItem2' : 'mnuItem1') + ' ' + getEvent("hl", x, v);
				mnu += '<ilayer id="' + layerName + v + '" bgcolor=' + mnuColor + '>' +
						'<layer id="offlay" visibility=show ' + props + '>' +
						'<a href="' + useArray[v][1] + '" class="fnLight" id="' + x + 'hdrLink' + v + '">' + navArrow + useArray[v][0] + '<\/a>' +
						'<\/layer>' +
						'<layer id="onlay" visibility=hide ' + props + '>' +
						'<a href="' + useArray[v][1] + '" class="menuLinkHoover" id="' + x + 'hdrLink' + v + '">' + navArrow + useArray[v][0] + '<\/a>' +
						'<\/layer>' +
						'<\/ilayer><br>';
			}
			mnu += '<\/layer>\n';
			document.write(mnu);
		}
	}

	for( x=0; x<mnuArr.length; x++ )
	{
		layerName = mnuArr[x] + 'Layer';
		useArray = eval(mnuArr[x]);
		eval(mnuArr[x] + 'Lyr = new domObject("' + layerName + '")');
		for( v=0; v<useArray.length; v++ )
		{
			eval(mnuArr[x] + v + 'Lyr = new domObject("' + layerName + v + '","' + layerName + '")');
		}
		eval(mnuArr[x] + 'Lyr.sty.left="' + mnuHpos[x] + 'px"');
		eval(mnuArr[x] + 'Lyr.sty.top="' + mnuVpos[x] + 'px"');
	}
	menusReady = true;
}

function domObject(theName,nestedLayer,frame)
{
	if (DOM || NS4) {
		if (DOM) {
			this.sty = document.getElementById(theName).style;
		}
		if (NS4) {
			if (nestedLayer) {
				this.sty = eval('document.' + nestedLayer + '.document.' + theName)
			} else {
				this.sty = document.layers[theName]
			}
		}
	}
	if (IE4) {
		this.sty = this.frame.document.all[theName].style
	}
	this.active = false;
	this.locked = false;
}


function resetMenus(lay)
{
	if (!oldIE)
	{
		for(var i=0; i<mnuArr.length; i++)
			if (lay != mnuArr[i]+'Lyr')
				eval(mnuArr[i] + 'Lyr.sty.visibility = (NS4)? "hide" : "hidden"');

		for(var i=0; i<imgArr.length; i++)
		{
			x = imgArr[i];
			if( (lay != x+'Lyr') && (document[x].src != eval(x+"off.src")) )
				turnoff(x);
		}
	}
}


function showOver(lay)
{
	if (menusReady && !oldIE) {
		resetMenus('');
		turnon(lay);
	}
}
function dropOver(lay) {
	turnoff(lay);
}

function showMenu(sourceObj,lay)
{
	theName = lay.replace(/Lyr/, "");
	if (menusReady && !oldIE) {
		currentMenu=theName;
		argmnu=lay
		eval(lay+".active=true")
		resetMenus(lay);
		var i=getArrayPos(lay);
		if (NS4) hideShowNS4Layer(i,-1);
		setLyr(sourceObj,lay,i);
		if (show) clearTimeout(show);
		show = setTimeout("showIt(argmnu)",100);
	}
}

function dropMenu(lay) {
	eval(lay+".active=false")
	whichmnu=lay;
	if(wait) clearTimeout(wait);
	wait = setTimeout("dropit(whichmnu)",700);
}

function showIt(lay) {
	if (eval(lay+".active")==true) {
		eval(lay+'.sty.visibility=(NS4)?"show":"visible"')
		turnon(lay.replace(/Lyr/,""))
	}
}
function dropit(lay) {
	if (!oldIE && eval(lay+".locked")==false && eval(lay+".active")==false) {
		eval(lay+'.sty.visibility=(NS4)?"hide":"hidden"')
		currentMenu=""
		turnoff(lay.replace(/Lyr/,""))
	}
}

function highlight(x, v, el) {
	if( el.id.indexOf('hdrLink') == -1 )
	{
		var sty = eval(mnuArr[x] + v + 'Lyr.sty');
		if (IE || DOM) {
			sty.backgroundColor = mnuHighlight;
			sty.cursor = "hand";
			//sty.textDecoration = "underline";
			document.getElementById( x + 'hdrLink' + v ).style.textDecoration = "underline";
			//document.getElementById( x + 'hdrLink' + v ).style.color = mnuColor;
		}
		if (NS4) {
			sty.bgColor = mnuHighlight;
			hideShowNS4Layer(x,v,"hide");
		}
		sty.color = mnuColor;
	}
}
function unhighlight(x, v, el) {
	if( el.id.indexOf('hdrLink') == -1 )
	{
		var sty = eval(mnuArr[x] + v + 'Lyr.sty');
		if (IE || DOM) {
			sty.backgroundColor = mnuColor;
			sty.cursor = "auto";
			//sty.textDecoration = "none";
			document.getElementById( x + 'hdrLink' + v ).style.textDecoration = "none";
			//document.getElementById( x + 'hdrLink' + v ).style.color = mnuHighlight;
		}
		if (NS4) {
			sty.bgColor = mnuColor;
			hideShowNS4Layer(x,v,"show");
		}
		sty.color = mnuHighlight;
	}
}
function highlight2(el) {
	if( bHighlight )
	{
		var sty = el.style;
		if (IE || DOM) {
			sty.backgroundColor = "#b6cae9";
			sty.cursor = "hand";
			//el.all.item("lnk").style.textDecoration = "underline";
		}
		if (NS4) {
			sty.bgColor = mnuHighlight;
			hideShowNS4Layer(x,v,"hide");
		}
		sty.color = mnuColor;
	}
}
function unhighlight2(el) {
	if( bHighlight )
	{
		var sty = el.style;
		if (IE || DOM) {
			sty.backgroundColor = "#dae2ef";
			sty.cursor = "auto";
			//el.all.item("lnk").style.textDecoration = "none";
		}
		if (NS4) {
			sty.bgColor = mnuColor;
			hideShowNS4Layer(x,v,"show");
		}
		sty.color = mnuHighlight;
	}
}
function do_highlight(bool) {
	bHighlight = bool;
}

function lock(lay) {
	eval(lay+".locked=true")
}
function unLock(lay) {
	eval(lay+".locked=false")
	dropMenu(lay)
}

function linkto(link) {
	location=link
}

function hideShowNS4Layer(x,v,visible)
{
	var tmp = 'document.' + mnuArr[x] + 'Layer';
	useArray = eval(mnuArr[x]);
	for( i=0; i<useArray.length; i++ )
	{
		pLay = tmp + '.' + tmp + i + '.document.';
		eval(pLay + 'offlay.visibility = (i==v) ? "hide" : "show"');
		eval(pLay + 'onlay.visibility = (i==v) ? "show" : "hide"');

	}
}

function setLyr(obj,lyr,i)
{
	var newX = findPosX(obj) + mnuHoff[i];
	var newY = findPosY(obj) + mnuVoff[i];
	eval(lyr+'.sty.left="'+newX+'px"');
	eval(lyr+'.sty.top="'+newY+'px"');
	//alert('newX='+newX+'\nnewY='+newY);
}

function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;

	return curleft;
}
function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;

	return curtop;
}

function getArrayPos(lyr)
{
	for( i=0; i<mnuArr.length; i++ )
		if( lyr == mnuArr[i]+'Lyr' )
			return i;

	return -1;
}


preloadImages();
if (!oldIE) initLayers();
-->