function GoToAnchor() 
{
 // First, get the anchor reference off the parent frame's URL, if there is one.
 parentURL = ""+parent.document.location;
 parSharpIndex = parentURL.indexOf("#");
 if (parSharpIndex >= 0) 
 {
  anchorString = parentURL.substring(parSharpIndex, parentURL.length);
 }
 else 
 {
  return;
 }

 // Then, strip the anchor off this document's URL, if it's got one.
 documentURL = ""+document.location;
 docSharpIndex = documentURL.indexOf("#");
 if (docSharpIndex >= 0) 
 {
  // Break out if we're already at the right anchor.
  if (anchorString == documentURL.substring(docSharpIndex, documentURL.length)) 
  {
   return;
  }
  docStrippedURL = documentURL.substring(0, docSharpIndex);
 }
 else 
 {
  docStrippedURL = documentURL;
 }

 // Now, slap the two together, and point this frame to the new, combined URL.
 document.location.replace(docStrippedURL + anchorString);
};

function framecheck() 
{
 if (parent.frames[2])
 {
  if (parent.frames[2].document.title!='Select languages')
  {
   parent.frames[2].location='../lang.htm';
  };
  GoToAnchor();
 }
 else
 {
  // Get the anchor reference off the parent frame's URL, if there is one.
  parentURL = ""+parent.document.location;
  parSharpIndex = parentURL.indexOf("#");
  if (parSharpIndex >= 0) 
  {
   anchorString = parentURL.substring(parSharpIndex, parentURL.length);
  }
  else 
  {
   anchorString = "";
  }
  window.location='../frame.htm?'+window.self.location.pathname+anchorString;
 } 
};