// Utility javascript functions


// ACS iFrame Breakout
// if the page is loaded inside the ACS iframe, breakout of it.

function ACSiFrameBreakout() {

    // are we in the iframe
    if (self.name =="ACSFrame") {        
        // check the current location

       // if (top.location.href != self.location.href) {
            // set the location
            top.location = self.location.href
      //  } else if  (self.location.href.match("framemaker.cgi") ){
            // framemaker needs to be an exception
       //     top.location = self.location.href
       // }
    }
    
}

// OnLoad event for the ACS authentication page used by the ThreeDSecure process

function ACSOnLoadEvent(){
    document.downloadForm.target = "ACSFrame";
    document.downloadForm.submit();
}


// ACS iFrame Breakout for PPV Confirmation page
// The PPV confirmation page needs to breakout into the subframe

function ACSiFrameBreakoutPPVConfirm() {

    // are we in the iframe
    if (self.name =="ACSFrame") {        
        // check that the page is a kaspurchase.cgi
        if  (self.location.href.match("kaspurchase.cgi") ){
            top.frame2.location = self.location.href            
        } 
    }
    
}

