Irish News Links

From All n One's bxp software Wixi

Jump to: navigation, search

It can be useful to background research on a company for sales purposes. To this end bxp software can save a lot of time in research. The newspaper button links are simple JavaScript which reads the name of the company and then searches the relevant site for related articles. In this way you can scan a news paper for company related articles to further the background research of the company.

The first part is to put in a section header to hold the buttons. The following has three rows of buttons. The first are national news agencies. The second row is technical articles. The third row is to share prices.

<input type=button name=btnNewsTools1 id=btnNewsTools1 class='Master_Button' style='width:19%;' value='Irish Times' />
<input type=button name=btnNewsTools2 id=btnNewsTools2 class='Master_Button' style='width:19%;' value='Irish Independent' />
<input type=button name=btnNewsTools3 id=btnNewsTools3 class='Master_Button' style='width:19%;' value='Irish Examiner' />
<input type=button name=btnNewsTools4 id=btnNewsTools4 class='Master_Button' style='width:19%;' value='Sunday Bus. Post' />
<input type=button name=btnNewsTools5 id=btnNewsTools5 class='Master_Button' style='width:19%;' value='RTE' />
<hr noshade="noshade" />
<input type=button name=btnTechTools1 id=btnTechTools1 class='Master_Button' style='width:19%;' value='Silicon Republic' />
<input type=button name=btnTechTools2 id=btnTechTools2 class='Master_Button' style='width:19%;' value='Tech Central' />
<input type=button name=btnTechTools3 id=btnTechTools3 class='Master_Button' style='width:19%;' value='CNET' />
<input type=button name=btnTechTools4 id=btnTechTools4 class='Master_Button' style='width:19%;' value='ITLG' />
<input type=button name=btnTechTools5 id=btnTechTools5 class='Master_Button' style='width:19%;' value='Blacknight' />
<hr noshade="noshade" />
<input type=button name=btnFinancialTools1 id=btnFinancialTools1 class='Master_Button' style='width:49%;' value='Irish Share Exchange' />
<input type=button name=btnFinancialTools2 id=btnFinancialTools2 class='Master_Button' style='width:49%;' value='FTSE' />

So this adds the button, now we need to add some JavaScript to the onload of the page to add the functionality to the buttons. The first line looks up the field with the company name to do the searching on.

var strNewsKeyword = document.getElementById('strCDA_41_field_0_4').value;

//onLoad function to set up links if existing record
function fn_InitialiseNewsLinks() {

	//If the values have been initialised
	if (strNewsKeyword != '') {

		//Add the onclick event to allow
		addEvent( document.getElementById('btnNewsTools1'), 'click', strURL_IrishTimes );
		addEvent( document.getElementById('btnNewsTools2'), 'click', strURL_IrishIndependent );
		addEvent( document.getElementById('btnNewsTools3'), 'click', strURL_IrishExaminer );
		addEvent( document.getElementById('btnNewsTools4'), 'click', strURL_SundayBusinessPost );
		addEvent( document.getElementById('btnNewsTools5'), 'click', strURL_RTE );
		addEvent( document.getElementById('btnTechTools1'), 'click', strURL_SiliconRepublic );
		addEvent( document.getElementById('btnTechTools2'), 'click', strURL_TechCentral );
		addEvent( document.getElementById('btnTechTools3'), 'click', strURL_CNET );
		addEvent( document.getElementById('btnTechTools4'), 'click', strURL_ITLG );
		addEvent( document.getElementById('btnTechTools5'), 'click', strURL_Blacknight );
		addEvent( document.getElementById('btnFinancialTools1'), 'click', strURL_ISE );
		addEvent( document.getElementById('btnFinancialTools2'), 'click', strURL_FTSE );

//Daniels add event function
function addEvent( obj, type, fn ) {
	if ( obj.attachEvent ) {
		obj['e'+type+fn] = fn;
		obj[type+fn] = function(){obj['e'+type+fn]( window.event );}
		obj.attachEvent( 'on'+type, obj[type+fn] );
	} else
	obj.addEventListener( type, fn, false );

//The News Sites
function strURL_IrishExaminer(){"" + strNewsKeyword + "&x=0&y=0");
function strURL_IrishTimes(){"" + strNewsKeyword + "&x=0&y=0");
function strURL_SundayBusinessPost(){"!search/" + strNewsKeyword + "");
function strURL_IrishIndependent(){"" + strNewsKeyword + "");
function strURL_RTE(){"" + strNewsKeyword + "");

//The Tech Sites
function strURL_SiliconRepublic(){"" + strNewsKeyword + "&IW_DATABASE=SRNewsChain&");
function strURL_CNET(){"" + strNewsKeyword + "&tag=srch&searchtype=news");
function strURL_Blacknight(){"" + strNewsKeyword + "&submit.x=0&submit.y=0");
function strURL_TechCentral(){"" + strNewsKeyword + "&idcategory=0");
function strURL_ITLG(){"" + strNewsKeyword + "&p=1");

//The Financial Sites
function strURL_ISE(){",-Indices-Stats/Equity-Market-Data/Shares-In-Issue/?list=full&type=SHARESISS");
function strURL_FTSE(){"");

//OnLoad fire it all off