var problem = false;
var strProblem = "";
var doTimeout = true;
var doScrolling = true;

function findPos(objectID)
{
  myObject = document.getElementById(objectID);
  var x = 0;
  var y = 0;
  var width = 0;
  var height = 0;
  while (myObject != null)
  {
    x = x + myObject.offsetLeft;
    y = y + myObject.offsetTop;
    myObject = myObject.offsetParent;
  }
  if (myObject != null)
  {
	width = myObject.currentStyle.width;
	height = myObject.currentStyle.height;
  }
  return new Pos(x,y,width,height)
}

function Pos(_x,_y,width,height)
{
  this.x = _x;
  this.y = _y;
  this.width = width;
  this.height = height;
}

function stripPX(inputString)
{
  inputStringLen = inputString.length;
  outputVal = parseInt(inputString.substring(0,inputStringLen-2));
  if (isNaN(outputVal))
  {
	outputVal = 0;
  }
  return outputVal;
}

function displayImage(image,width,height)
{
	var sFeatures = "toolbar=no,directories=no,location=no,menubar=no,resizable=no,scrollbars=no,width=" + width + ",height=" + height;
	var sUrl = "../display_image.asp?image=" + escape(image);
	limoWindow = window.open(sUrl,"Limo",sFeatures);
}

function errorAlert()
{
  if (problem == false)
  {
    problem = false;
    strProblem = "";
    return false;
  }
  else
  {
    var str = "The following errors have occured while trying to process the page:\n\n";
    str += strProblem;
    str += "\nPlease contact webtechy.co.uk customer support at support@webtechy.co.uk.";
    alert(str);
    problem = false;
    strProblem = "";
    return true;
  }
}

function validateMail(sEMail)
{
	if (sEMail == "")
	{
		alert("You have not entered an e-mail address.");
		return false;
	}
	else
	{
		return true;
	}
}