
var OAS_sitepage = 'chron.com/business/story';
var OAS_listpos = 'Top,Top1,Right,Middle,Right3,x33,x35';
var OAS_query = '';
//alert ('set by adwiz: sitepage('+OAS_sitepage+'), listpos('+OAS_listpos+')');
// pek TODO: will be set up in external DNS shortly
OAS_url = 'http://oascentral.chron.com/RealMedia/ads/';
//OAS_url = 'http://oasc04106.247realmedia.com/RealMedia/ads/';
// pek: other value is 64.58.80.26
// ************* RBX MODIFIED HERE ***********************
//Look to see if we have set them before the dat file
CHRON_url = 'chron.com/disp/story.mpl/headline/biz/5189905.html';
CHRON_sitepage ? OAS_sitepage=CHRON_sitepage : OAS_sitepage = 'chron.com/business/story' + CHRON_sitepage_append;
CHRON_listpos ? OAS_listpos=CHRON_listpos : OAS_listpos = 'Top,Top1,Right,Middle,Right3,x33,x35';
CHRON_query ? OAS_query=CHRON_query : OAS_query = '';


//sync the protype object with dat entries
try{
CHRON_adwiz_sync_prototype();
}catch(e){}
// TEMPORARY TARGETING
// there is more in the OAD_AD function
//this was added to all to target unique users
var Xpos = 'x96';
//OAS_listpos += ','+Xpos;
var X_COUNTER = 0;
//this is called on the first ad call and counter is moved to 1
	function doXpos(){
		if (X_COUNTER < 1 ){
			X_COUNTER++;
			document.write('<div id="' + chron_div_id + '" rel="ADPLACEMENT" pos=' + pos + '>'); 
			OAS_AD_LIST +='\n' + Xpos ;
			//catch errors incase the listpos or other error happen
			try{
				if (OAS_version >= 11) {
					OAS_RICH(Xpos);
				}else{
					OAS_NORMAL(Xpos);
				}
			}catch(e){/*alert('<!-- ADWIZ OAS_AD ERROR: '+ e +' version '+ OAS_version +' -->');*/}
			document.write('</div>');
		}
	}
// END TEMPORARY TARGETING

// REPRISE TARGETING
// REMOVE THE X01 POSITIONS 
var reprise_array = Array();
reprise_array = CHRON_get_param_array();
if (reprise_array['reprise']){
	OAS_listpos = OAS_listpos.replace(/x01,?/,'');
}
// END REPRISE TARGETING
//OAS_listpos final checks
//OAS_listpos = OAS_listpos.replace(/Top\,?/,''); //shut off top
OAS_listpos = OAS_listpos.replace(/\s+/g,'');//make sure there is no spaces in listpos

var OAS_FINAL = '<!-- ****** final OAS values ***** \n';
OAS_FINAL += 'OAS_listpos value: '+ OAS_listpos +'\n';
OAS_FINAL += 'OAS_sitepage value: '+ OAS_sitepage +' \n';
OAS_FINAL += 'OAS_query value: '+ OAS_query +' \n';
OAS_FINAL += 'CHRON_url: '+ CHRON_url +'\n';
OAS_FINAL += 'CHRON_adwiz: '+ CHRON_hostname +'\n';
OAS_FINAL += '***** /final OAS values ***** -->\n';
document.write(OAS_FINAL);
// *********** / RBX MODIFIED HERE ************************
//end of configuration
//this is for a user that has javascript version 1.0
OAS_rns = CHRON_random_number();
function OAS_NORMAL(pos) {
  if (OAS_sitepage != '' && OAS_listpos !=''){
	CHRON_serve_OAS_NX(OAS_sitepage, OAS_listpos, pos, OAS_query);
  }
}
//this is for a use that has javascript version  1.1
if ((navigator.userAgent.indexOf('Mozilla/3') != -1) || (navigator.userAgent.indexOf('Mozilla/4.0 WebTV') != -1)){
  OAS_version = 10;
}
// if listpos and sitepage and Rich media 11 then
if (OAS_version >= 11 && (OAS_listpos != '' && OAS_sitepage != '') ) {
	CHRON_serve_OAS_MJX(OAS_sitepage, OAS_listpos, OAS_query);
}


//tells how to call the ad position
var OAS_AD_LIST ='ADS CALLED ON PAGE: ';
document.write('');

function OAS_AD(pos) {
// TEMPORARY TARGETING
//doXpos();
// END TEMPORARY TARGETING

	var chron_div_id = 'CHRON_ADPLACEMENT_'+pos;
	document.write('<div id="' + chron_div_id + '" rel="ADPLACEMENT" pos=' + pos + '>'); 
	OAS_AD_LIST +='\n'+ pos ;
  	//catch errors incase the listpos or other error happen
  	try{
		if (OAS_version >= 11) {
			OAS_RICH(pos);
		}else{
			OAS_NORMAL(pos);
		}
	}catch(e){/*alert('<!-- ADWIZ OAS_AD ERROR: '+ e +' version '+ OAS_version +' -->');*/}
	document.write('</div>');
	//audit function
   chron_audit_pos(pos);
}

//added to check to make sure that everything is ok and that ads are served
if (OAS_sitepage == '' || OAS_listpos == ''){
	CHRON_serve_reporter(OAS_sitepage, OAS_listpos, CHRON_url); /* this is a function in loadadwiz */ 
}
