var width = "250";
var border = "1";
var offsetx = 2;
var offsety = 10;

var fcolor = "#FFFFFF";
var backcolor = "#456AB5";
var textcolor = "#000000";
var capcolor = "#FFFFFF";

// used by Antioch.Common.Transfer
var handler = "/Transfer.aspx";
var errorHandler = "/Error.htm";
			
function goToTechTerm(techTerm)
{
	openWindow("/index.aspx?page=MainMenu/Our-products-and-services/Keeping-the-promise/Tech-buzz/Dictionary#" + techTerm);
}

/// <summary>
/// Gets the value of a name/value pair from the querystring
/// </summary>
/// <param name="pName">The name of the name/value pair</param>
/// <returns>The value of the name/value pair from the querystring.</returns>
function getQueryStringValue(pName)
{
	var lValue = "";
	var lCurrentUrl = document.URL;
	
	pName = pName + "=";
	var lPosStart = lCurrentUrl.indexOf( pName );
	
	if( lPosStart != -1 )
	{
		var lPosEnd = lCurrentUrl.indexOf("&", lPosStart);
		if (lPosEnd == -1)
		{
			lValue = lCurrentUrl.substring(lPosStart+pName.length, lCurrentUrl.length);
		}
		else
		{
			lValue = lCurrentUrl.substring(lPosStart+pName.length, lPosEnd);
		}
	}
	return lValue;
}

//Opens a new window
function openWindow(url)
{
    var mywindow = window.open(url);
    
    if (mywindow.opener == null)
    {
            mywindow.opener = self;
            mywindow.focus();
    }
}

// Submits the current form when Enter Key is pressed.
// This function is called from the "onkeydown" on the "Body" tag
var submitOnEnter = false;
function EnterKeySubmit()
{
	if (window.event.keyCode==13)
	{
		alert(submitOnEnter);
		document.form[0].submit()
	}
}

function addBookmark(bookmarktitle)
{  
	var strUseragent = navigator.userAgent.toLowerCase();
	if((strUseragent.indexOf("macintosh") > -1) || (strUseragent.indexOf("mac_powerpc") > -1) )
	{
		alert("Press Apple+D to add a bookmark to this site.");
	}
	else
	{
		if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4))
		{
			window.external.AddFavorite(location.href,bookmarktitle)
		}
		else 
		{ 
			if (navigator.appName=='Netscape')
			{
				alert("Press CTRL+D to add a bookmark to this site.");
			}
			else 
			{
				alert("Sorry, your browser does not support this function.")
			}
		}
	}
    return ;
}

// method iterates through a html form and sets the focus
// for the first input or select element it finds
function SetFocus(){
	for(i=0; i<document.forms.length; i++){
		frm = document.forms[i];
		for(j=0; j<frm.elements.length; j++){
			var element = frm.elements[j];
			var sTag = element.tagName.toUpperCase();
			var sType = element.type.toUpperCase();
			if(!element.disabled){
				if((sTag == "INPUT" && (sType == "TEXT" || sType == "RADIO")) || sTag == "SELECT" || sTag == "TEXTAREA"){
					element.focus();
					return;
				}
			}
		}
	}
}
