var countryCode = "";
var CountryName = '';
var Currency = '';

if (document.cookie && document.cookie.indexOf('Country')>-1){

	countryCode = readCookie('Country');

	if(! countryCode.indexOf('none'))countryCode='';

	if(countryCode != '')
		document.write("<SCRIPT LANGUAGE='JavaScript' SRC='/oag/resources/js/"+countryCode + ".js'><\/SCRIPT>");
}

function setCountry (fieldName) {
var expires = new Date();
expires.setTime(expires.getTime() + (24 * 60 * 60 * 1000) * 365 );

var c_str = "Country="+fieldName+ ";expires="+expires.toGMTString() ;
c_str+="; path=/; domain=.oag.com;";

document.cookie= c_str;
}


function displayEditions(editionData,countryCode) {




// if any variables not set do not do table
if(editionData == '' || countryCode =='' ) return ;
//loop through editions and check there is a valid price, if not - return






var containsMonthlyBilling = false ;

var OAGRegion = itemList.getOAGRegion();





//Start table




//break into records on #, then break into fields on ~
var versionArray=editionData.split('#');

for (i=0;i<versionArray.length;i++){

	var editionArray=versionArray[i].split('~');
	versionDesc=editionArray[0];
	versionId=editionArray[1];
	show=editionArray[2];
	showBuy=editionArray[3];
	group=editionArray[4];
	prod=editionArray[5];


	if(itemList.findItem(versionId) != null){
		var orderUrl = "https://safe.oag.com/cart/OAGAddItemToShoppingCart.do?regionCode=" + OAGRegion + "&subscriptionDefId=" + versionId + "&country=" + countryCode;
	}
	
}//end loop		

	
	return orderUrl; 
	


}

