
// History:
//  02-Jul-2002 JR  - written by John Roden, KINSA
//  10-Jul-2002 JR  - copied this file to /static/scripts
//  10-Jul-2002 JR  - added immediate call to the function (it can 
//                    be called more than once without harm)
//  19-Jul-2002 JR  - added new var original_domain

// Purpose:
// Frames with documents from different domains cannot communicate via Javascript
// calls.  An "äccess denied" error is reported.  To avoid this problem, we assume
// the both documents come from domains with the same stem containing "kompass"
// (eg kcom.kompass.co.uk and www.kompass.co.uk).  To allow communication, both
// documents must call this function to shorten the domain to identical stems.

function adjust_domain_name () {
	  
    if (document.domain) {
      var p = document.domain.lastIndexOf(".kompass");
	  if (p > -1) {
         document.domain = document.domain.substring(p+1);
	     }
       // alert ("Domain shortened to: "+document.domain );
      }
   }
   
// 10-Jul-2002 JR - call the function immediately
var
   original_domain = document.domain;
   
adjust_domain_name();

