function affiliateLink(ISBNASIN, strTitle, strMedium, strVendor) {

	// CONFIGURATION ==============================================

	// Affiliate program ID numbers
	var strAmazonID      = 'potluck-3-20';         // https://affiliate-program.amazon.com/
	var strAbeBooksID    = '21000000000158730';  // https://www.google.com/accounts/ServiceLogin?service=affiliatenetwork&ltmpl=&continue=https%3A%2F%2Fwww.connectcommerce.com%2Fbin%2Flogin.mx&legacylogin=http%3A%2F%2Fwww.connectcommerce.com%2Fglobal%2Flogin.html%3Fll%3Dtrue&cd=_GANL&passive=true
	var strAlibrisID     = 'gn2cpCIF4*s';        // http://www.linkshare.com/
	var strBNID          = '21000000000158730';  // https://www.google.com/accounts/ServiceLogin?service=affiliatenetwork&ltmpl=&continue=https%3A%2F%2Fwww.connectcommerce.com%2Fbin%2Flogin.mx&legacylogin=http%3A%2F%2Fwww.connectcommerce.com%2Fglobal%2Flogin.html%3Fll%3Dtrue&cd=_GANL&passive=true
	var strIndieBoundID  = 'potluck7';           // http://www.indiebound.org/
	var striTunesID      = 'gn2cpCIF4*s';        // http://www.linkshare.com/
	var strCDUniverseID1 = 'lk_potluck';         // http://www.cduniverse.com/
	var strCDUniverseID2 = 'pca';               // http://www.cduniverse.com/

	// Affiliate program image snippets
	var strImageAmazon     = 'http://i193.photobucket.com/albums/z130/potluckcreativearts/General/acom_logo_th.jpg" width="105" height="31"';
	var strImageAbeBooks   = 'http://creative.cc-dt.com/pfx/21000000000155733/0/88000000000057801.gif" width="88" height="31"';
	var strImageAlibris    = 'http://images.alibris.com/marketing/alibris_saveonbooks_88x31.gif" width="88" height="31"';
	var strImageBN         = 'http://clickserve.cc-dt.com/link/banner?lid=41000000024705135" width="88" height="31"';
	var strImageIndieBound = 'http://www.indiebound.org/files/ShopIndieRed.png" width="74" height="31"';
	var strImageiTunes     = 'http://images.apple.com/itunesaffiliates/logos/iTunes_bdg_wht88x31.gif" width="88" height="31"';
	var strImageCDUniverse = 'http://www.cduniverse.com/banners/live/cdu/88x31_music/88x31_music01.gif" width="88" height="31"';

	// Default title strings
	var strTitleAmazon   = 'Shop at Amazon';
	var strTitleAbeBooks = 'Shop at Abe Books';
	var strTitleAlibris  = 'Shop at Alibris';
	var strTitleBN       = 'Shop at Barnes &amp; Noble';
	var strTitleIndieBound    = 'Shop Indie Bookstores';
	var strTitleiTunes   = 'Shop at iTunes';
	var strTitleCDUniverse    = 'Shop at CDUniverse';

	// Product ID numbers based on ISBNASIN -- customize for site
	var UPC = ''; var iTunes1 = ''; var iTunes2 = ''; var CDUPID = '';
	switch (ISBNASIN) {
case "0634034243": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0793529395": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0960735011": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0793514096": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "1881322122": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "079357000X": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0793578566": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0881889784": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0634011766": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0793578310": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0634026100": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0881887579": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0793589762": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0793570778": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "079358244X": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0793537622": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0634025783": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0793582598": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0881889792": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0793562309": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0793558557": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0634021559": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0793558069": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0793556589": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0793558085": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0793558093": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0793512948": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0793585414": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0634015907": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0634004247": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0634010433": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0634063111": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "1598020005": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "1598021303": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0933676697": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0793591295": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "1928918239": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "093367600X": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0634017276": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0793513294": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0881882607": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0634012703": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0634011030": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0881888796": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "094374847X": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0769296319": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0786651598": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0786677082": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0786677104": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "078667654X": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0786677163": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0757995578": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "1423462289": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0793585031": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0634009052": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0634026550": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0793566363": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0634015494": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0825628687": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "094374847X": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0769296319": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0786651598": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0786677104": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "142346396X": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "1423463919": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "1423463900": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0634088238": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "1423419812": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0634091220": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "1423419820": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "1423425154": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0634090291": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "1423419847": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "1423452828": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0634091247": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "1423419863": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "1423462289": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "1423425200": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0634041266": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "1423427793": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0634049119": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "1423443330": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "063402664X": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0634047361": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "1423404661": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "078667654X": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0786677163": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0757995578": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "1423401565": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "1423435672": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "1423463714": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;case "0786677082": UPC = ''; iTunes1 = ''; iTunes2 = ''; CDUPID = ''; break;
	} // switch (ISBNASIN)

	// FUNCTION ===================================================

	// Create link
	var strLink = '';
	switch (strVendor+':'+strMedium) {
		case ":Book":
			strLink  = '<ul>';
			strLink += '<li>';
			strLink += affiliateLink(ISBNASIN, strTitle, strMedium, 'Amazon');
			strLink += '</li>';
			strLink += '<li>';
			strLink += affiliateLink(ISBNASIN, strTitle, strMedium, 'AbeBooks');
			strLink += '</li>';
			strLink += '<li>';
			strLink += affiliateLink(ISBNASIN, strTitle, strMedium, 'Alibris');
			strLink += '</li>';
			strLink += '<li>';
			strLink += affiliateLink(ISBNASIN, strTitle, strMedium, 'Barnes and Noble');
			strLink += '</li>';
			strLink += '<li>';
			strLink += affiliateLink(ISBNASIN, strTitle, strMedium, 'IndieBound');
			strLink += '</li>';
			strLink += '</ul>';
			break;
		case ":Music":
			strLink  = '<ul>';
			strLink += '<li>';
			strLink += affiliateLink(ISBNASIN, strTitle, strMedium, 'Amazon');
			strLink += '</li>';
			strLink += '<li>';
			strLink += affiliateLink(ISBNASIN, strTitle, strMedium, 'CDUniverse');
			strLink += '</li>';
			strLink += '<li>';
			strLink += affiliateLink(ISBNASIN, strTitle, strMedium, 'Alibris');
			strLink += '</li>';
			strLink += '<li>';
			strLink += affiliateLink(ISBNASIN, strTitle, strMedium, 'Barnes and Noble');
			strLink += '</li>';
			strLink += '</ul>';
			break;
		case ":Movie":
			strLink  = '<ul>';
			strLink += '<li>';
			strLink += affiliateLink(ISBNASIN, strTitle, strMedium, 'Amazon');
			strLink += '</li>';
			strLink += '<li>';
			strLink += affiliateLink(ISBNASIN, strTitle, strMedium, 'CDUniverse');
			strLink += '</li>';
			strLink += '<li>';
			strLink += affiliateLink(ISBNASIN, strTitle, strMedium, 'Alibris');
			strLink += '</li>';
			strLink += '<li>';
			strLink += affiliateLink(ISBNASIN, strTitle, strMedium, 'Barnes and Noble');
			strLink += '</li>';
			strLink += '</ul>';
			break;
		case ":Digital":
			strLink  = '<ul>';
			strLink += '<li>';
			strLink += affiliateLink(ISBNASIN, strTitle, strMedium, 'iTunes');
			strLink += '</li>';
			strLink += '<li>';
			strLink += affiliateLink(ISBNASIN, strTitle, strMedium, 'Amazon');
			strLink += '</li>';
			strLink += '</ul>';
			break;
		case 'Amazon:Book':
			if (strTitle.length == 0) { strTitle = strTitleAmazon; } else { strTitle = 'Purchase '+strTitle+' at Amazon'; }
			strLink  = '<a href="http://www.amazon.com/gp/product/';
			strLink += ISBNASIN;
			strLink += '?ie=UTF8&tag=';
			strLink += strAmazonID;
			strLink += '&linkCode=as2&camp=1789&creative=9325&creativeASIN=';
			strLink += ISBNASIN;
			strLink += '" title="'+strTitle+'"><img src="';
			strLink += strImageAmazon;
			strLink += ' alt="'+strTitle+'" border="0"/></a><img src="http://www.assoc-amazon.com/e/ir?t=';
			strLink += strAmazonID;
			strLink += '&l=as2&o=1&a=';
			strLink += ISBNASIN;
			strLink += '" width="1" height="1" border="0" alt="'+strTitle+'" style="border:none !important; margin:0px !important;" />';
			break;
		case 'Amazon:Music':
			if (strTitle.length == 0) { strTitle = strTitleAmazon; } else { strTitle = 'Purchase '+strTitle+' at Amazon'; }
			strLink  = '<a href="http://www.amazon.com/gp/product/';
			strLink += ISBNASIN;
			strLink += '?ie=UTF8&tag=';
			strLink += strAmazonID;
			strLink += '&linkCode=as2&camp=1789&creative=9325&creativeASIN=';
			strLink += ISBNASIN;
			strLink += '" title="'+strTitle+'"><img src="';
			strLink += strImageAmazon;
			strLink += ' alt="'+strTitle+'" border="0"/></a><img src="http://www.assoc-amazon.com/e/ir?t=';
			strLink += strAmazonID;
			strLink += '&l=as2&o=1&a=';
			strLink += ISBNASIN;
			strLink += '" width="1" height="1" border="0" alt="'+strTitle+'" style="border:none !important; margin:0px !important;" />';
			break;
		case 'Amazon:Movie':
			if (strTitle.length == 0) { strTitle = strTitleAmazon; } else { strTitle = 'Purchase '+strTitle+' at Amazon'; }
			strLink  = '<a href="http://www.amazon.com/gp/product/';
			strLink += ISBNASIN;
			strLink += '?ie=UTF8&tag=';
			strLink += strAmazonID;
			strLink += '&linkCode=as2&camp=1789&creative=9325&creativeASIN=';
			strLink += ISBNASIN;
			strLink += '" title="'+strTitle+'"><img src="';
			strLink += strImageAmazon;
			strLink += ' alt="'+strTitle+'" border="0"/></a><img src="http://www.assoc-amazon.com/e/ir?t=';
			strLink += strAmazonID;
			strLink += '&l=as2&o=1&a=';
			strLink += ISBNASIN;
			strLink += '" width="1" height="1" border="0" alt="'+strTitle+'" style="border:none !important; margin:0px !important;" />';
			break;
		case 'Amazon:Digital':
			if (strTitle.length == 0) { strTitle = strTitleAmazon; } else { strTitle = 'Purchase '+strTitle+' at Amazon'; }
			strLink  = '<a href="http://www.amazon.com/gp/product/';
			strLink += ISBNASIN;
			strLink += '?ie=UTF8&tag=';
			strLink += strAmazonID;
			strLink += '&linkCode=as2&camp=1789&creative=9325&creativeASIN=';
			strLink += ISBNASIN;
			strLink += '" title="'+strTitle+'"><img src="';
			strLink += strImageAmazon;
			strLink += ' alt="'+strTitle+'" border="0"/></a><img src="http://www.assoc-amazon.com/e/ir?t=';
			strLink += strAmazonID;
			strLink += '&l=as2&o=1&a=';
			strLink += ISBNASIN;
			strLink += '" width="1" height="1" border="0" alt="'+strTitle+'" style="border:none !important; margin:0px !important;" />';
			break;
		case 'AbeBooks:Book':
			if (strTitle.length == 0) { strTitle = strTitleAbeBooks; } else { strTitle = 'Purchase '+strTitle+' at AbeBooks'; }
			strLink  = '<a href="http://clickserve.cc-dt.com/link/tplclick?lid=41000000024289215&pubid=';
			strLink += strAbeBooksID;
			strLink += '&redirect=http%3A%2F%2Fwww.abebooks.com%2Fservlet%2FSearchResults%3Fisbn%3D';
			strLink += ISBNASIN;
			strLink += '%26sts%3Dt%26y%3D0%26x%3D0" title="'+strTitle+'"><img src="';
			strLink += strImageAbeBooks;
			strLink += ' alt="'+strTitle+'" border="0"/></a>';
			break;
		case 'Alibris:Book':
			if (strTitle.length == 0) { strTitle = strTitleAlibris; } else { strTitle = 'Purchase '+strTitle+' at Alibris'; }
			strLink  = '<a href="http://click.linksynergy.com/fs-bin/click?id=';
			strLink += strAlibrisID;
			strLink += '&offerid=99238.122856000&type=2&subid=0&tmpid=939&RD_PARM1=http%253A%252F%252Fwww.alibris.com/booksearch%253Fqsort%253Dp%2526isbn%253D';
			strLink += ISBNASIN;
			strLink += '" title="'+strTitle+'"><img src="';
			strLink += strImageAlibris;
			strLink += ' alt="'+strTitle+'" border="0"/></a>';
			break;
		case 'Alibris:Music':
			if (strTitle.length == 0) { strTitle = strTitleAlibris; } else { strTitle = 'Purchase '+strTitle+' at Alibris'; }
			strLink  = '<a href="http://click.linksynergy.com/fs-bin/click?id=';
			strLink += strAlibrisID;
			strLink += '&offerid=39828.122856000&type=2&tmpid=939&RD_PARM1=http%253A%252F%252Fwww.alibris.com/musicsearch%253Fqsort%253Dp%2526upc%253D';
			strLink += UPC;
			strLink += '" title="'+strTitle+'"><img src="';
			strLink += strImageAlibris;
			strLink += ' alt="'+strTitle+'" border="0"/></a>';
			break;
		case 'Alibris:Movie':
			if (strTitle.length == 0) { strTitle = strTitleAlibris; } else { strTitle = 'Purchase '+strTitle+' at Alibris'; }
			strLink  = '<a href="http://click.linksynergy.com/fs-bin/click?id=';
			strLink += strAlibrisID;
			strLink += '&offerid=39828.122856000&type=2&tmpid=939&RD_PARM1=http%253A%252F%252Fwww.alibris.com/moviesearch%253Fqsort%253Dp%2526upc%253D';
			strLink += UPC;
			strLink += '" title="'+strTitle+'"><img src="';
			strLink += strImageAlibris;
			strLink += ' alt="'+strTitle+'" border="0"/></a>';
			break;
		case 'Barnes and Noble:Book':
			if (strTitle.length == 0) { strTitle = strTitleBN; } else { strTitle = 'Purchase '+strTitle+' at Barnes and Noble'; }
			strLink  = '<a href="http://clickserve.cc-dt.com/link/tplclick?lid=41000000012871747&pubid=';
			strLink += strBNID;
			strLink += '&redirect=http%3A%2F%2Fsearch.barnesandnoble.com%2Fbooksearch%2FisbnInquiry.asp%3FEAN%3D';
			strLink += ISBNASIN;
			strLink += '" title="'+strTitle+'"><img src="';
			strLink += strImageBN;
			strLink += ' alt="'+strTitle+'" border="0"/></a>';
			break;
		case 'Barnes and Noble:Music':
			if (strTitle.length == 0) { strTitle = strTitleBN; } else { strTitle = 'Purchase '+strTitle+' at Barnes and Noble'; }
			strLink  = '<a href="http://clickserve.cc-dt.com/link/tplclick?lid=41000000012871747&pubid=';
			strLink += strBNID;
			strLink += '&redirect=http%3A%2F%2Fmusic.barnesandnoble.com%2Fsearch%2Fproduct.asp%3FEAN%3D';
			strLink += UPC;
			strLink += '" title="'+strTitle+'"><img src="';
			strLink += strImageBN;
			strLink += ' alt="'+strTitle+'" border="0"/></a>';
			break;
		case 'Barnes and Noble:Movie':
			if (strTitle.length == 0) { strTitle = strTitleBN; } else { strTitle = 'Purchase '+strTitle+' at Barnes and Noble'; }
			strLink  = '<a href="http://clickserve.cc-dt.com/link/tplclick?lid=41000000012871747&pubid=';
			strLink += strBNID;
			strLink += '&redirect=http%3A%2F%2Fvideo.barnesandnoble.com%2Fsearch%2Fproduct.asp%3FEAN%3D';
			strLink += UPC;
			strLink += '" title="'+strTitle+'"><img src="';
			strLink += strImageBN;
			strLink += ' alt="'+strTitle+'" border="0"/></a>';
			break;
		case 'IndieBound:Book':
			if (strTitle.length == 0) { strTitle = strTitleIndieBound; } else { strTitle = 'Purchase '+strTitle+' at Indie Bookstores'; }
			strLink  = '<a href="http://www.indiebound.org/aff/';
			strLink += strIndieBoundID;
			strLink += '?product=';
			strLink += ISBNASIN;
			strLink += '" title="'+strTitle+'"><img src="';
			strLink += strImageIndieBound;
			strLink += ' alt=""'+strTitle+'" border="0" /></a>';
			break;
		case 'iTunes:Digital':
			if (strTitle.length == 0) { strTitle = strTitleiTunes; } else { strTitle = 'Purchase '+strTitle+' at iTunes'; }
			strLink  = '<a href="http://click.linksynergy.com/fs-bin/stat?id=';
			strLink += striTunesID;
			strLink += '&offerid=146261&type=3&subid=0&tmpid=1826&RD_PARM1=http%253A%252F%252Fitunes.apple.com%252FWebObjects%252FMZStore.woa%252Fwa%252FviewAlbum%253Fi%253D';
			strLink += iTunes1;
			strLink += '%2526id%253D';
			strLink += iTunes2;
			strLink += '%2526s%253D143441%2526uo%253D6%2526partnerId%253D30" title="'+strTitle+'"><img src="';
			strLink += strImageiTunes;
			strLink += ' alt="'+strTitle+'" border="0"/></a>';
			break;
		case 'CDUniverse:Music':
			if (strTitle.length == 0) { strTitle = strTitleCDUniverse; } else { strTitle = 'Purchase '+strTitle+' at CDUniverse'; }
			strLink  = '<a href="http://www.cduniverse.com/productinfo.asp?pid=';
			strLink += CDUPID;
			strLink += '&frm=';
			strLink += strCDUniverseID1;
			strLink += '&siteid=';
			strLink += strCDUniverseID2;
			strLink += '" title="'+strTitle+'"><img src="';
			strLink += strImageCDUniverse;
			strLink += ' alt="'+strTitle+'" border="0"/></a>';
			break;
		case 'CDUniverse:Movie':
			if (strTitle.length == 0) { strTitle = strTitleCDUniverse; } else { strTitle = 'Purchase '+strTitle+' at CDUniverse'; }
			strLink  = '<a href="http://www.cduniverse.com/productinfo.asp?pid=';
			strLink += CDUPID;
			strLink += '&frm=';
			strLink += strCDUniverseID1;
			strLink += '&siteid=';
			strLink += strCDUniverseID2;
			strLink += '" title="'+strTitle+'"><img src="';
			strLink += strImageCDUniverse;
			strLink += ' alt="'+strTitle+'" border="0"/></a>';
			break;
	} // switch (strVendor)
	return strLink;

} // function affiliateLink(ISBNASIN, strTitle, strMedium, strVendor)

function affiliateBlock(img, title, author, desc, ISBNASIN, strMedium, strVendor) {
	if(strVendor == undefined){
	strVendor='';
	};

	strBlock  = '<div class="affiliateBlock">';
	strBlock += '<img src="'+img+'" alt="'+title+'" />';
	if (title.length == 0) { strBlock += ''; } else { strBlock += '<p><strong>'+title+'</strong><br />';
	strBlock += '<em class="author">'+author+'</em></p>'; }
	strBlock += '<p>'+desc+'</p>';
	strBlock += '<br style="clear:both;" /><p>Purchase at:';
	strBlock += affiliateLink(ISBNASIN, title, strMedium, strVendor);
	strBlock += '</p><br style="clear:both;" /></div>';
	return strBlock;

} // function affiliateBlock(img, title, author, desc, ISBNASIN, strMedium, strVendor)