
/*
SMMiLe JavaScript Object Model
Version 1.0
By Daryl Beattie
Copyright 2000, ScreamingMedia

SAMPLE USAGE [note that "script" tag is broken as "sc ript" so that it does not end this script]:

The code blow goes in the <HEAD> section of your HTML file
replace "JSDir/ContentSetID" with your JavaScript file path and name

	<sc ript language="JavaScript" src="JSDir/ContentSetID.js"></sc ript>
	<sc ript language="JavaScript">
		if(typeof SMChosenContent != \'undefined\') {
			document.write("<scri" + "pt language=\"JavaScript\" src=\"JSDir/ContentSetID" + SMChosenContent + ".js\"></sc" + "ript>");
		}
	</scr ipt>

The JavaScript objects are modelled after the SMMiLe XML structure:

<content-set>
	<content>
		<article>
			<title>...</title>
			<metadata>...</metadata>
			<core>...</core>
			<body>...</body>
		</article>
	</content>
</content-set>

As for the JavaScript, it is structured like this:

contentSet[0](id, name, language, publishedDate, contents)
|--	contents[i](id, revisionId, type, language, role, article) 
	|
	|--	article(title, metadata, core, body)
		|
		|--	metadata(documentMetadata, publicationMetadata, structuralMetadata, subjectMetadata, relatedContentMetadata, processingMetadata)
		|	|--	documentMetadata(storage, publisherReleaseDate)
		|	|--	publicationMetadata(publicationName)
		|	|--	structuralMetadata()
		|	|--	subjectMetadata()
		|	|--	relatedContentMetadata()
		|	|--	processingMetadata()
		|
		|--	core(summaryHeadline, docAbstract, headline, author, copyright, dateLine, dateTime, type)

An example of using this object model to print out the body of the second
article is:

	document.write(SMContentSet[0].contents[1].article.body);

*/


function displayContentPage(url, contentNum) {
	window.location = url + "?SMContentIndex=" + contentNum + "&SMContentSet=" + 0;
}

function displayContentPage(url, contentNum, contentSetNum) {
	window.location = url + "?SMContentIndex=" + contentNum + "&SMContentSet=" + contentSetNum;
}

function getParamValue(matchString, defaultValue) {
	var thisURL = window.location.toString();
	var value = defaultValue;
	if ((thisURL.indexOf("?") != -1) &&
	    (thisURL.indexOf(matchString) != -1) &&
	    (thisURL.charAt(thisURL.indexOf(matchString) + matchString.length) != "&")) {
		start = thisURL.indexOf(matchString) + matchString.length;
		if (thisURL.indexOf("&", start) > -1) {
			value = thisURL.substring(start, (thisURL.indexOf("&", start)));
		}
		else {
			value = thisURL.substring(start, thisURL.length);
		}
	}
	if (value == "NaN") {
		value = devaultValue;
	}
	return value;
}

var SMChosenContent = Number(getParamValue("SMContentIndex=", -1));
var SMChosenContentSet = Number(getParamValue("SMContentSet=", 0));

function prettyDate(date) {
	var result;
	if (date.substring(5,7) == "01") {result = "January ";}
	else if (date.substring(5,7) == "02") {result = "February ";}
	else if (date.substring(5,7) == "03") {result = "March ";}
	else if (date.substring(5,7) == "04") {result = "April ";}
	else if (date.substring(5,7) == "05") {result = "May ";}
	else if (date.substring(5,7) == "06") {result = "June ";}
	else if (date.substring(5,7) == "07") {result = "July ";}
	else if (date.substring(5,7) == "08") {result = "August ";}
	else if (date.substring(5,7) == "09") {result = "September ";}
	else if (date.substring(5,7) == "10") {result = "October ";}
	else if (date.substring(5,7) == "11") {result = "November ";}
	else {result = "December ";}
	if (date.charAt(8) == "0") {result += date.charAt(9);}
	else {result += date.substring(8,10);}
	return result + ", " + date.substring(0,4);
}

// Metadata sub-type element objects.
function MakeDocumentMetadata(myStorage, myPublisherReleaseDate) {
	this.storage = myStorage;
	this.publisherReleaseDate = myPublisherReleaseDate;
}
function MakePublicationMetadata(myPublicationName) {
	this.publicationName = myPublicationName;
}
function MakeStructuralMetadata() { }
function MakeSubjectMetadata() { }
function MakeRelatedContentMetadata() { }
function MakeProcessingMetadata() { }

// Metadata element object (made up of the sub-types).
function MakeMetadata(myDocumentMetadata, myPublicationMetadata, myStructuralMetadata, mySubjectMetadata, myRelatedContentMetadata, myProcessingMetadata) {
	this.documentMetadata = myDocumentMetadata;
	this.publicationMetadata = myPublicationMetadata;
	this.structuralMetadata = myStructuralMetadata;
	this.subjectMetadata = mySubjectMetadata;
	this.relatedContentMetadata = myRelatedContentMetadata;
	this.processingMetadata = myProcessingMetadata;
}

// Core element object
function MakeCore(mySummaryHeadline, myAbstract, myHeadline, myAuthor, myCopyright, myDateLine, myDateTime, myType) {
	this.summaryHeadline = mySummaryHeadline;
	this.docAbstract = myAbstract;
	this.headline = myHeadline;
	this.author = myAuthor;
	this.copyright = myCopyright;
	this.dateLine = myDateLine;
	this.dateTime = myDateTime;
	this.type = myType;
}

// Article element object
function MakeArticle(myTitle, myMetadata, myCore, myBody) {
	this.title = myTitle;
	this.metadata = myMetadata;
	this.core = myCore;
	this.body = myBody;
}

// Content element object
function MakeContent(myId, myRevisionId, myType, myLanguage, myRole, myArticle) {
	this.id = myId;
	this.revisionId = myRevisionId;
	this.type = myType;
	this.language = myLanguage;
	this.role = myRole;
	this.article = myArticle;
}

// Content-set master element object
function MakeContentSet(myId, myName, myLanguage, myPublishedDate, myContents) {
	this.id = myId;
	this.name = myName;
	this.language = myLanguage;
	this.publishedDate = myPublishedDate;
	this.contents = myContents;
}

{ // This block intializes the data objects.

	var Index = -1;
	if (typeof SMContentSet == "undefined") {
		var SMContentSet = new Array();
	}
	var contents = new Array();
//////////////////////// This section is made PER CONTENT (because the actual data is written in here)

	
	documentMetadata = new MakeDocumentMetadata('internal', '2010-02-04T09:50:23');
	publicationMetadata = new MakePublicationMetadata('NewsRx.com');

	title = 'RESEARCHERS FROM KAISER PERMANENTE PUBLISH NEW STUDIES AND FINDINGS IN THE AREA OF PROSTATE CANCER';
	metadata = new MakeMetadata(documentMetadata, publicationMetadata, '', '', '', '');

	core = new MakeCore(
		'RESEARCHERS FROM KAISER PERMANENTE PUBLISH NEW STUDIES AND FINDINGS IN THE AREA OF PROSTATE CANCER',
		'"Red wine contains polyphenol antioxidants that inhibit prostate cancer development in animal studies. We investigated the effect of red wine intake on the risk of prostate cancer using data prospectively collected in the California Men\'s Health Study (CMHS)." The researchers concluded: "Neither red wine nor total alcohol consumption were associated with prostate cancer risk in this population of moderate drinkers."',
		'RESEARCHERS FROM KAISER PERMANENTE PUBLISH NEW STUDIES AND FINDINGS IN THE AREA OF PROSTATE CANCER',
		'',
		'??? 2007 NewsRx.com. All Rights Reserved.;;??Copyright 2010, Mental Health Business Week via NewsRx.com',
		'February 13, 2010',
		'',
		''
		);

	article = new MakeArticle(title, metadata, core, '');

	contents[++Index] = new MakeContent(
		'newsrx_2010_02_04_eng-newsrx_eng-newsrx_095023_7639083709830361514',
		'01265319434756',
		'article',
		'en-US',
		'',
		article
		);

		
	documentMetadata = new MakeDocumentMetadata('internal', '2010-02-01T06:22:15');
	publicationMetadata = new MakePublicationMetadata('World Entertainment News Network');

	title = 'HOPPER DISMISSES \'DYING\' RUMOURS WITH RESTAURANT VISIT';
	metadata = new MakeMetadata(documentMetadata, publicationMetadata, '', '', '', '');

	core = new MakeCore(
		'HOPPER DISMISSES \'DYING\' RUMOURS WITH RESTAURANT VISIT',
		'Ailing actor DENNIS HOPPER quashed reports he is close to death by taking a group of pals out for a meal over the weekend (30-31Jan10)',
		'HOPPER DISMISSES \'DYING\' RUMOURS WITH RESTAURANT VISIT',
		'',
		'(c) 2007 World Entertainment News Network',
		'WENN',
		'',
		''
		);

	article = new MakeArticle(title, metadata, core, '');

	contents[++Index] = new MakeContent(
		'wenn_2010_02_01_eng-wenn_eng-wenn_062215_5553159385106795183',
		'01265318638225',
		'article',
		'en-US',
		'',
		article
		);

		
	documentMetadata = new MakeDocumentMetadata('internal', '2010-01-28T11:14:15');
	publicationMetadata = new MakePublicationMetadata('NewsRx.com');

	title = 'NEW PROSTATECTOMY STUDY FINDINGS HAVE BEEN REPORTED BY J.P. MULHALL AND CO-RESEARCHERS';
	metadata = new MakeMetadata(documentMetadata, publicationMetadata, '', '', '', '');

	core = new MakeCore(
		'NEW PROSTATECTOMY STUDY FINDINGS HAVE BEEN REPORTED BY J.P. MULHALL AND CO-RESEARCHERS',
		'In this recent study, researchers in the United States conducted a study "To define if erectile function (EF) outcomes were better in men with early institution of penile rehabilitation after radical prostatectomy (RP), as one of the mechanisms by which patients fail to recover EF after RP is collagenization of corporal smooth muscle with subsequent venous leak development, and rehabilitation is aimed at preventing these structural alterations. The study population comprised patients who: (i) had clinically organ- confined prostate cancer; (ii) had fully functional erections, corroborated by the partner; (iii) had bilateral nerve-sparing RP; and (iv) committed to pharmacological penile rehabilitation." The researchers concluded: "These data suggest that delaying the start of penile rehabilitation after RP is associated with poorer outcomes for EF."',
		'NEW PROSTATECTOMY STUDY FINDINGS HAVE BEEN REPORTED BY J.P. MULHALL AND CO-RESEARCHERS',
		'',
		'??? 2007 NewsRx.com. All Rights Reserved.;;??Copyright 2010, Medical Devices & Surgical Technology Week via NewsRx.com',
		'February 7, 2010',
		'',
		''
		);

	article = new MakeArticle(title, metadata, core, '');

	contents[++Index] = new MakeContent(
		'newsrx_2010_01_28_eng-newsrx_eng-newsrx_111415_6927776784313114156',
		'01265319434756',
		'article',
		'en-US',
		'',
		article
		);

		
	documentMetadata = new MakeDocumentMetadata('internal', '2010-02-04T10:39:02');
	publicationMetadata = new MakePublicationMetadata('NewsRx.com');

	title = 'RESEARCH IN THE AREA OF PROSTATE CANCER QUALITY OF CARE REPORTED FROM MEMORIAL SLOAN-KETTERING CANCER CENTER';
	metadata = new MakeMetadata(documentMetadata, publicationMetadata, '', '', '', '');

	core = new MakeCore(
		'RESEARCH IN THE AREA OF PROSTATE CANCER QUALITY OF CARE REPORTED FROM MEMORIAL SLOAN-KETTERING CANCER CENTER',
		'Researchers detail in \'The role of spirituality in the relationship between religiosity and depression in prostate cancer patients,\' new data in prostate cancer. "This study aims to develop a theoretical framework of the relationship among religiosity, spirituality, and depression, potentially explaining the often mixed and inconsistent associations between religiosity and depression. When examining religiosity and spirituality, the main component that may help reduce depression is a sense of meaning and peace," wrote C. Nelson and colleagues, Memorial Sloan-Kettering Cancer Center. The researchers concluded: "These results highlight the potential importance of developing a patient\'s sense of meaning through activities/interventions (not exclusive to religious involvement) to achieve this goal."',
		'RESEARCH IN THE AREA OF PROSTATE CANCER QUALITY OF CARE REPORTED FROM MEMORIAL SLOAN-KETTERING CANCER CENTER',
		'',
		'??? 2007 NewsRx.com. All Rights Reserved.;;??Copyright 2010, Mental Health Business Week via NewsRx.com',
		'February 13, 2010',
		'',
		''
		);

	article = new MakeArticle(title, metadata, core, '');

	contents[++Index] = new MakeContent(
		'newsrx_2010_02_04_eng-newsrx_eng-newsrx_103902_3127791803211777385',
		'01265319434756',
		'article',
		'en-US',
		'',
		article
		);

		
	documentMetadata = new MakeDocumentMetadata('internal', '2010-02-04T12:33:10');
	publicationMetadata = new MakePublicationMetadata('NewsRx.com');

	title = 'OVERCOMING TAXANE RESISTANCE IN CANCER';
	metadata = new MakeMetadata(documentMetadata, publicationMetadata, '', '', '', '');

	core = new MakeCore(
		'OVERCOMING TAXANE RESISTANCE IN CANCER',
		'Taxanes, a group of cancer drugs that includes paclitaxel (Taxol) and docetaxel (Taxotere), have become front-line therapy for a variety of metastatic cancers. But as with many chemotherapy agents, resistance can develop, a frequent problem in breast, ovarian, prostate and other cancers. Now, cancer researchers at Children\'s Hospital Boston report a protein previously unknown to be involved in taxane resistance and could potentially be targeted with drugs, making a cancer more susceptible to chemotherapy. The researchers believe that this protein, prohibitin1, could also serve as a biomarker, allowing doctors to predict a patient\'s response to chemotherapy with a simple blood test.',
		'OVERCOMING TAXANE RESISTANCE IN CANCER',
		'',
		'??? 2007 NewsRx.com. All Rights Reserved.;;??Copyright 2010, Hospital Business Week via NewsRx.com',
		'February 14, 2010',
		'',
		''
		);

	article = new MakeArticle(title, metadata, core, '');

	contents[++Index] = new MakeContent(
		'newsrx_2010_02_04_eng-newsrx_eng-newsrx_123310_7208387532626191656',
		'01265319434756',
		'article',
		'en-US',
		'',
		article
		);

		
	documentMetadata = new MakeDocumentMetadata('internal', '2010-01-28T13:12:26');
	publicationMetadata = new MakePublicationMetadata('NewsRx.com');

	title = 'NEW PROSTATE CANCER GENETICS STUDY FINDINGS HAVE BEEN PUBLISHED BY SCIENTISTS AT INSTITUTE OF CANCER RESEARCH';
	metadata = new MakeMetadata(documentMetadata, publicationMetadata, '', '', '', '');

	core = new MakeCore(
		'NEW PROSTATE CANCER GENETICS STUDY FINDINGS HAVE BEEN PUBLISHED BY SCIENTISTS AT INSTITUTE OF CANCER RESEARCH',
		'Researchers detail in \'Mutation analysis of the MSMB gene in familial prostate cancer,\' new data in prostate cancer. According to recent research from Sutton, the United Kingdom, "MSMB, a gene coding for beta- microseminoprotein, has been identified as a candidate susceptibility gene for prostate cancer (PrCa) in two genome-wide association studies (GWAS). SNP rs10993994 is 2 bp upstream of the transcription initiation site of MSMB and was identified as an associated PrCa risk variant." The researchers concluded: "We conclude that MSMB is unlikely to be a familial PrCa gene and propose that the high-risk alleles of the SNPs in the 5\'UTR effect PrCa risk by modifying MSMB gene expression in response to hormones in a tissue-specific manner."',
		'NEW PROSTATE CANCER GENETICS STUDY FINDINGS HAVE BEEN PUBLISHED BY SCIENTISTS AT INSTITUTE OF CANCER RESEARCH',
		'',
		'??? 2007 NewsRx.com. All Rights Reserved.;;??Copyright 2010, Medical Device Business Week via NewsRx.com',
		'February 3, 2010',
		'',
		''
		);

	article = new MakeArticle(title, metadata, core, '');

	contents[++Index] = new MakeContent(
		'newsrx_2010_01_28_eng-newsrx_eng-newsrx_131226_4894870602109295099',
		'01265319434756',
		'article',
		'en-US',
		'',
		article
		);

		
	documentMetadata = new MakeDocumentMetadata('internal', '2010-01-28T12:00:12');
	publicationMetadata = new MakePublicationMetadata('NewsRx.com');

	title = 'RESEARCH FROM BRIGHAM AND WOMEN\'S HOSPITAL PROVIDE NEW INSIGHTS INTO PROSTATE CANCER';
	metadata = new MakeMetadata(documentMetadata, publicationMetadata, '', '', '', '');

	core = new MakeCore(
		'RESEARCH FROM BRIGHAM AND WOMEN\'S HOSPITAL PROVIDE NEW INSIGHTS INTO PROSTATE CANCER',
		'According to recent research published in the Journal of Clinical Oncology, "We examined whether time-dependent continuous prostate- specific antigen (PSA) velocity at recurrence was associated with all cause mortality (ACM) adjusting for comorbidity levels among men treated with definitive radiation therapy (RT) alone with or without androgen suppression therapy (AST) in the setting of a randomized controlled trial. From 1995 to 2001, 206 men with localized, unfavorable prostate cancer were randomly assigned to receive RT alone or RT and AST combined." The researchers concluded: "These findings support judicious use of salvage AST, particularly in men with moderate to severe comorbidities, where prospective surveillance protocols are needed."',
		'RESEARCH FROM BRIGHAM AND WOMEN\'S HOSPITAL PROVIDE NEW INSIGHTS INTO PROSTATE CANCER',
		'',
		'??? 2007 NewsRx.com. All Rights Reserved.;;??Copyright 2010, Clinical Trials Week via NewsRx.com',
		'February 1, 2010',
		'',
		''
		);

	article = new MakeArticle(title, metadata, core, '');

	contents[++Index] = new MakeContent(
		'newsrx_2010_01_28_eng-newsrx_eng-newsrx_120012_8663210783966745928',
		'01265319434756',
		'article',
		'en-US',
		'',
		article
		);

		
	documentMetadata = new MakeDocumentMetadata('internal', '2010-01-28T12:34:14');
	publicationMetadata = new MakePublicationMetadata('NewsRx.com');

	title = 'PROTEIN CENTRAL TO BEING MALE PLAYS KEY ROLE IN WOUND HEALING';
	metadata = new MakeMetadata(documentMetadata, publicationMetadata, '', '', '', '');

	core = new MakeCore(
		'PROTEIN CENTRAL TO BEING MALE PLAYS KEY ROLE IN WOUND HEALING',
		'A molecular receptor pivotal to the action of male hormones such as testosterone also plays a crucial role in the body\'s ability to heal, report scientists in the December issue of the Journal of Clinical Investigation (see also University of Rochester Medical Center). In studies in mice, scientists at the University of Rochester Medical Center found that this receptor - the androgen receptor - delays wound healing. When scientists used an experimental compound to block the receptor, wounds healed much more quickly.',
		'PROTEIN CENTRAL TO BEING MALE PLAYS KEY ROLE IN WOUND HEALING',
		'',
		'??? 2007 NewsRx.com. All Rights Reserved.;;??Copyright 2010, Physician Business Week via NewsRx.com',
		'February 2, 2010',
		'',
		''
		);

	article = new MakeArticle(title, metadata, core, '');

	contents[++Index] = new MakeContent(
		'newsrx_2010_01_28_eng-newsrx_eng-newsrx_123414_3903544010593991847',
		'01265319434756',
		'article',
		'en-US',
		'',
		article
		);

		
	documentMetadata = new MakeDocumentMetadata('internal', '2010-02-03T12:05:41');
	publicationMetadata = new MakePublicationMetadata('Associated Press');

	title = 'ROCHE 2009 PROFIT DOWN 22 PCT ON GENENTECH COSTS';
	metadata = new MakeMetadata(documentMetadata, publicationMetadata, '', '', '', '');

	core = new MakeCore(
		'ROCHE 2009 PROFIT DOWN 22 PCT ON GENENTECH COSTS',
		'Drug maker Roche Holding AG on Wednesday reported a 22 percent drop in full-year net profit to 8.51 billion Swiss francs ($8.06 billion), citing costs linked to the takeover of California-based Genentech.',
		'ROCHE 2009 PROFIT DOWN 22 PCT ON GENENTECH COSTS',
		'By FRANK JORDANS (Associated Press Writer)',
		'Copyright 2010 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.',
		'',
		'',
		''
		);

	article = new MakeArticle(title, metadata, core, '');

	contents[++Index] = new MakeContent(
		'ap_2010_02_03_ap.worldstream.english.business_D9DKQPO84_news_ap_org.anpa',
		'01265319434756',
		'article',
		'en-US',
		'',
		article
		);

		
	

//////////////////////// End PER ARTICLE section

	contentSetId = '890_PROSTATE';
	contentSetName = 'PROSTATE';
	contentSetLanguage = '';
	contentSetPublishedDate = '2010-02-04T15:38:33';

	id = '890_PROSTATE';
	contentType = '';

} // End data initialization block.

if (typeof ContentIndex == "undefined") {
	ContentIndex = -1;
}

SMContentSet[++ContentIndex] = new MakeContentSet(contentSetId, contentSetName, contentSetLanguage, contentSetPublishedDate, contents);
