function openWindow(pURL, pHeight, pWidth)
  {
  window.open(pURL, "AbricaIntro", "left=20,top=20,width=" + pWidth + ",height=" + pHeight + ",resizable=1,scrollbars=1") 
  }

function bulletOn(pAnchor, pRelativePath)
  {
  bulletToggle(pAnchor, 1, pRelativePath)
  }

function bulletOff(pAnchor, pRelativePath)
  {
  bulletToggle(pAnchor, 0, pRelativePath)
  }

function bulletToggle(pAnchor, pState, pRelativePath)
  {
  if (pAnchor)
    {
    if (pAnchor.hasChildNodes())
      {
      var i;
      var vChildObject ;
      var iStored ;

      for (i=0; i < pAnchor.childNodes.length; i++)
        {
        vChildObject = pAnchor.childNodes[i] ;

        if (vChildObject.tagName == "IMG")
          {
          if (pState == 1)
            {
            vChildObject.src = pRelativePath + "images/bulletHover.jpg" ;
            }
          else
            {
            vChildObject.src = pRelativePath + "images/bullet.jpg" ;
            }
          }
        }
      }
    }
  }
  
function checkErrors()
  {
  var WebError = readCookie("WebError");

  if (WebError)
    {
	var ErrorsDiv = document.getElementById("Errors") ;
	var ErrorsMsg = document.getElementById("ErrorMessage") ;

	if (ErrorsDiv)
	  {
	  var find = /_/g ;
	  ErrorsDiv.innerHTML = WebError.replace(find, "<br>") ;
	  
	  ErrorsMsg .style.display = "inline" ;
	  
	  createCookie("WebError", "", null)
	  
	  window.scrollTo(0, 0) ;
	  }
    }
  }
  
function createCookie(name, value, days)
  {
  if (days)
    {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
    }
  else
    {
    var expires = "";
    document.cookie = name+"="+value+expires+"; path=/";
    }
  }

function readCookie(name)
  {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');

  for(var i=0;i < ca.length;i++)
    {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }

  return null;
  }

function eraseCookie(name)
  {
  createCookie(name,"",-1);
  }
 
function PageQuery(q)
  {
  if(q.length > 1)
    {
    this.q = q.substring(1, q.length);
    }
  else
    {
    this.q = null ;
    }
    
  this.keyValuePairs = new Array();

  if(q)
    {
    for(var i=0; i < this.q.split("&").length; i++)
      {
      this.keyValuePairs[i] = this.q.split("&")[i];
      }
    }

  this.getKeyValuePairs = function() { return this.keyValuePairs; }

  this.getValue = function(s) {
    for(var j=0; j < this.keyValuePairs.length; j++)
      {
      if(this.keyValuePairs[j].split("=")[0] == s)
        return this.keyValuePairs[j].split("=")[1];
      }

    return false;
    }
    
   this.getParameters = function()
     {
     var a = new Array(this.getLength());
     for(var j=0; j < this.keyValuePairs.length; j++)
       {
       a[j] = this.keyValuePairs[j].split("=")[0];
       }
       
     return a;
     }
     
  this.getLength = function() { return this.keyValuePairs.length; } 
  }

function queryString(key)
  {
  var page = new PageQuery(window.location.search); 

  return unescape(page.getValue(key)); 
  }

function displayItem(key)
  {
  if(queryString(key)=='false') 
    {
    document.write("you didn't enter a ?name=value querystring item.");
    }
  else
    {
    document.write(queryString(key));
    }
  }
  
    
function newXmlHTTP()
  {
  var xmlhttp;
  /*@cc_on @*/
  /*@if (@_jscript_version >= 5)
    // JScript gives us Conditional compilation, we can cope with old IE versions.
    // and security blocked creation of the objects.
    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
        xmlhttp = false;
      }
    }
  @else
    xmlhttp = false;
  @end @*/

  if (!xmlhttp) {
    if (typeof XMLHttpRequest != undefined) {
      xmlhttp = new XMLHttpRequest();
    } else {
      xmlhttp = false;
    }
  }

  return xmlhttp;
  }    
  
function PopupImage(pImageURL, pWidth, pHeight)
  {
  pWidth  = pWidth  + 140;
  pHeight = pHeight + 80 ;
  window.open("image.htm?imageUrl=" + pImageURL, "ImagePopup", "width=" + pWidth + ",height=" + pHeight + " ,resizable=0") 
  }
  