//// Set Global variables

    //// If we are debugging make sure to show upsell path...
    var DEBUGGING=0;

    //// Max number of free pages they can view before being blocked
    var maxPageViews = 1;

    //// Set page to show visitor when they've viewed enough content
    var upsell_page = 'http://hbcuconnect.com/cgi-bin/enter.cgi?redirect=' + escape(document.location);

    //// Put file names of files to exclude from upsell logic in 
    //// allowedPages variable (string match)
    var allowedPages = new Array("contact","privacy","terms","not_found","staff","admin","error","reading","members.cgi","tote","mediakit","advertise","about","faq","top50","scholarship");


function isContentPage() {
    var i;

    //// Make sure we're not on an allowed public page...
    for (i in allowedPages) {
        if (document.URL.indexOf(allowedPages[i]) >= 0) {
            return(0);
        }
    }

    //// Passed all my tests, so it must be a content page...
    return(1);
}

function showUpsell() {

    //// If they logged in recently no need to show upsell...
    if ( isContentPage() && !authenticated() && typeof OPENPAGE === 'undefined' ) {

	//// Send them to authentication school playa...
    	document.location = upsell_page;  // REDIRECT

    }

}

function authenticated() {

	//// If email is set, then we got'em, else we don't
        if (getCookie('email')) { 
	    return(1); 
	} else {
	    return(0);
	}

}


