//Article Tools
//article_tools.js
//Author: Matt King
//Date: 2/14/2008 (happy valentine's day!)
//Purpose: Create a general purpose, platform agnostic article tools display "box" that can be shared across all CMP Medica Sites. 
//(it should be fairly easy to modify as well)


//variables used throughout the article_tools javascript
var myUrl=document.location.href;
var myTitle=encodeURIComponent(document.title);
var openTableRow="<tr>";
var closeTableRow="</tr>";

//Article Tools
//Currently: email, print, delicious, digg, technorati, reddit, yahoo, google
//To remove one, comment out it's document.write command
//To add a new one, add a new variable here, construct the proper html, and create a new document.write command with the others
//it may help to look at an existing link for help
//NOTE: Make sure to add the proper number of <tr> and </tr> tags for however you want this table to be built (2x3, 3x2, etc)

var emailText;
var printText;
var peerclipText;

//Email this page link
mySubject = ('Found an article you might be interested in');
myBody= (myTitle + ': ' + myUrl);
emailText= '<td width="60%">' +
	'<a href="mailto:?subject='+mySubject+'&body='+myBody+'"> <img border="0" title="Email this story to a friend" alt="Email icon" src="http://imaging.cmpmedica.com/CME/pt/content/email-di.gif"/> <span style="text-decoration : none">Send as email</span></a>' +
	'</td>';

//Print this page link
printText = '<td width="40%">' +
	'<a href="#" onClick="javascript:window.print()" linkindex="37">' +
	'<img width="15" height="18" border="0" alt="" src="http://imaging.cmpmedica.com/CME/pt/content/print-di.gif"/> <span style="text-decoration : none">Print this page</span></a>' +
	'</td>';


// reprints email link
myReprintsSubject = ('Diagnostic Imaging reprint request');
reprintsText= '<td width="40%">' +
	'<a href="mailto:CMPMedicaReprints@parsintl.com?subject='+myReprintsSubject+'&body='+myBody+'"> <img border="0" alt="Request article reprints" src="http://imaging.cmpmedica.com/CME/pt/content/reprints-di.gif"/> <span style="text-decoration : none">Request article reprints</span></a>' +
	'</td>';

//Ozmosis link
ozmosisText = '<td width="60%">' +
	'<a href="#" onClick="javascript:window.open(\'https://www.ozmosis.com/bookmark?reference_item[uri]=\'+encodeURIComponent(location.href)+\'&pid=5&bookmark[title]=\'+encodeURIComponent(document.title))"> <img border="0" title="Bookmark with Ozmosis" alt="Ozmosis icon" src="http://imaging.cmpmedica.com/CME/pt/content/ozmosisbookmark.gif"/> <span>Discuss this article on Ozmosis</span></a>'+
	'</td>';

//beginning of html structure for this box, contains one <tr> tag
document.write('<table width="100%" cellspacing="3" cellpadding="3"> <tbody>');
document.write(openTableRow);

//Write all the html to the page
document.write(emailText);
document.write(printText);

document.write(closeTableRow);
document.write(openTableRow);

document.write(ozmosisText);
document.write(reprintsText);


//Close the rest of the html structure
document.write(closeTableRow);
document.write("</tbody></table>");
