function amznLink(asin,desc) {
	var lnk = '<a href="http://www.amazon.com/gp/product/' + asin +'?tag=bigsp-20&linkCode=as2&camp=1789&creative=390957&creativeASIN=';
	lnk += asin + '" target="blank">' + desc + '</a>';
	lnk += '<img src="http://www.assoc-amazon.com/e/ir?t=bigsp-20&l=as2&o=1&a=' + asin + '" width="1" height="1" style="display:none;" />';
	return lnk;
}
function amzn(asin,desc) { document.writeln(amznLink(asin,desc)); }

function linkSynergy(id,offerid,deeplink,linktext,linkstyle)
{
	var lsUrl  = 'http://click.linksynergy.com/fs-bin/click?id=' + id + '&subid=&offerid=' + offerid + '&type=10&tmpid=3909&RD_PARM1=' + escape(deeplink);
	var imgUrl = 'http://ad.linksynergy.com/fs-bin/show?id=' + id + '&bids=' + offerid + '&type=10';
	
	var lnk = '<a href="' + lsUrl + '" target="blank" style="' + linkstyle + '">' + linktext + '</a>';
			+ '<img width="1" height="1" style="display:none;" src="' + imgUrl + '" />';

	return lnk;
}


function appstoreLink(appID,linktext,linkstyle)
{
	var deeplink = 'http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=' + appID + '&mt=8';
	var ls = linkSynergy('fTFyJjqJ*U0','146261.1',deeplink,linktext,linkstyle);
	return ls;
}

function appstore(appID,linktext) 
{
	ls = appstoreLink(appID,linktext,'');
	document.write(ls);
}


function appstoreWithImg(appID, linktext)
{
	var combinedText='<img src="/_/appstoreIcons/' + appID + '.png" style="border: none; margin-left: auto; margin-right: auto; text-align:center;" /><br />' + linktext;
	var ls = appstoreLink(appID,combinedText,"text-decoration:none;text-align:center;font-weight: bold;");
	var div = '<div style="margin: 4px; text-align: center;">' + ls + '</div>';
	document.write(div);
}

function appstoreWithImgNoDiv(appID, linktext)
{
	var combinedText='<img src="/_/appstoreIcons/' + appID + '.png" style="border: none; margin-left: auto; margin-right: auto; text-align:center;" /><br />' + linktext;
	var ls = appstoreLink(appID,combinedText,"text-decoration:none;text-align:center;font-weight: bold;");
	document.write(ls);
}