/*************************************************************************
 * Interstitial page logic
 * Jon Dunfee, November 2003
 * Copyright (c) 2003 Fusion Alliance
 */

// Initial attributes
var interstitialWinOpen = false;            // State of popup window, leave false
var interstitialWinWidth = 600;             // Default popup window width
var interstitialWinHeight = 300;            // Default popup window height
var interstitialRoot = "../interstitial/";    // Location of interstitial pages from root level

// Used in anchor tags
function sitepass(a,opt,page)
{
    if(interstitialWinOpen) interstitialWin.close();
    var LeftPosition=(screen.width)?(screen.width-interstitialWinWidth)/2:100;
    var TopPosition=(screen.height)?(screen.height-interstitialWinHeight)/2:100;
    var features = (opt)?opt:"width="+interstitialWinWidth+",height="+interstitialWinHeight+",scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no,left="+LeftPosition+",top="+TopPosition;
    var interstitial = (page)?page:interstitialRoot + "interstitial.htm?redirect=" + escape(a.href) +"&target=" + a.target;
    interstitialWin = window.open(interstitial,"interstitial",features);
    interstitialWin.focus();
    interstitialWinOpen = true;
}

// Used in sub menu items
function menupass(loc,aff,opt,page)
{
    if(interstitialWinOpen) interstitialWin.close();
    var LeftPosition=(screen.width)?(screen.width-interstitialWinWidth)/2:100;
    var TopPosition=(screen.height)?(screen.height-interstitialWinHeight)/2:100;
    var features = (opt)?opt:"width="+interstitialWinWidth+",height="+interstitialWinHeight+",scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no,left="+LeftPosition+",top="+TopPosition;
    var interstitial = (page)?page:interstitialRoot + "interstitial.htm?redirect=" + escape(loc) +"&target=" + ((aff)?"":"_blank");
    interstitialWin = window.open(interstitial,"interstitial",features);
    interstitialWin.focus();
    interstitialWinOpen = true;
}