// site specific config vars 
var OAS_partner = 'coacht.vnsports.com';
var OAS_defaultfile = 'index.cfm';        //this has to be set for the default file for the site!
var OAS_target = '_top';

// dynamic config vars ### DO NOT MODIFY ###
var OAS_url = 'http://oascentral.stackmag.com/RealMedia/ads/';
var OAS_sitepage = '';
var OAS_listpos = '';
var OAS_query = '';
var OAS_version = 10;
var OAS_rn = new String (Math.random()); 
var OAS_rns = OAS_rn.substring (2, 11);

// 
// private functions
//

function OAS_NORMAL(pos) {
    document.write('<A HREF="' + OAS_url + 'click_nx.cgi/' + OAS_sitepage + '/1' + OAS_rns + '@' + OAS_listpos + '!' + pos + '?' + OAS_query + '" TARGET=' + OAS_target + '>');
    document.write('<IMG SRC="' + OAS_url + 'adstream_nx.cgi/' + OAS_sitepage + '/1' + OAS_rns + '@' + OAS_listpos + '!' + pos + '?' + OAS_query + '" BORDER=0></A>');
}

function OAS_AD(pos) {
    if (OAS_version >= 11)
        OAS_RICH(pos);
    else
        OAS_NORMAL(pos);
}

function OAS_SET_SITEPAGE(istrSiteName) {
    var strFileName = document.location.pathname;
    
    //pathname starts at host URL and a slash so it will always return one slash
    if (strFileName.charAt(strFileName.length-1) == '/')
	    strFileName += OAS_defaultfile;

    OAS_sitepage = istrSiteName + strFileName;
}

function OAS_SET_KEYWORD(oaskey) {
    if (oaskey != "")
	    OAS_query = oaskey;
}

function OAS_SET_POSITIONS(poslist) {
	OAS_listpos = poslist;
}

function setOASVersion() {
    OAS_version = 11;
    if ((navigator.userAgent.indexOf('Mozilla/3') != -1) || (navigator.userAgent.indexOf('Mozilla/4.0 WebTV') != -1))
        OAS_version = 10;
    if (OAS_version >= 11)
        document.write('<SCR' + 'IPT LANGUAGE=JavaScript1.1 SRC="' + OAS_url + 'adstream_mjx.ads/' + OAS_sitepage + '/1' + OAS_rns + '@' + OAS_listpos + '?' + OAS_query + '"><\/SCRIPT>');
}

//
// public site functions.
//

// isListPos is case sensitive, comma delimited, not spaces
function OAS_INIT(isKeyWords,isListPos) { 
    OAS_SET_SITEPAGE(OAS_partner);

    OAS_SET_KEYWORD(isKeyWords);

    OAS_SET_POSITIONS(isListPos);
    
    if (OAS_listpos != '') {    
        setOASVersion();
    }
}
