/* ***************************************************************************/
/*                                                                           */
/*        Adaptive Systems Limited Copyright 1999.                           */
/*                   England.                                                */
/*                                                                           */
/* Name   : angloscript.js                                                   */
/* Author : D. C. Jarman, Melissa WebMasters                                 */
/*                                                                           */
/* Edit Record                                                               */
/* Date      Issue  Comment.                                                 */
/* --------- ------ -------------------------------------------------------- */
/* 22-Oct-03 0.1    New script.                                              */
/*                                                                           */
/* ***************************************************************************/

function StartEmailForm( Dept, FormName, Redirect )
{  
  document.writeln( '<form method="POST" action="' + Redirect + '" enctype="plain/text" name="' + FormName + '">' );

// angloenterprises@breathemail.net

} // StartEmailForm


function getCookie (name)
{
	var dcookie = document.cookie;
	var cname = name + "=";
	var clen = dcookie.length;
	var cbegin = 0;
	while (cbegin < clen)
	{
		var vbegin = cbegin + cname.length;
		if (dcookie.substring(cbegin, vbegin) == cname)
		{
			var vend = dcookie.indexOf (";", vbegin);
			if (vend == -1) vend = clen;
				return unescape(dcookie.substring(vbegin, vend));
		}
		cbegin = dcookie.indexOf(" ", cbegin) + 1;
		if (cbegin == 0) break;
	}
	return null;
}

function setCookie (name, value, expires)
{
	if (!expires) expires = new Date();
	document.cookie = name + "=" + escape (value) + "; expires=" + expires.toGMTString() +  "; path=/";
}

function delCookie (name)
{
	var expireNow = new Date();
	document.cookie = name + "=" + "; expires=Thu, 01-Jan-70 00:00:01 GMT" +  "; path=/";
}

function callOrderForm()
{
  if ( top != self )
  {
//  alert( "Calling in frame" );
    top.main.location="orderform.php";
  }
  else
  {
    document.location="orderform.php";
  }
}

function checkTop( page )
{
  if ( top != self )
  {
//    alert( "Top not self" );
    if ( top.main.location != self )
    {
      alert( "In correctFrame" );
      top.main.location=page;
    }
  }
}