function word()
{
     try
	{
	//var oWSHShell = new ActiveXObject("WScript.Shell");                    
     	//oWSHShell.Run("winword " +  window.location.href);  

	alert ("To open the report in Word: \n\n 1 - Open the File Menu\n\n 2 - Select 'Edit with Microsoft Office Word'\n\n done.");

	}
     catch(e)
	{ handleError() }

}

function excel()
{
     try
	{
     	//var oWSHShell = new ActiveXObject("WScript.Shell");                    
     	//oWSHShell.Run("excel " +  window.location.href);  

	alert ("To open a report in Excel: \n\n>>Internet Explorer 6:\n1 - Right click in the header row of a report\n in the shaded area, not on the text\n2 - Select 'Export to Microsoft Excel'\n3 - Re-enter user name and password \n\n>>Internet Explorer 7 [One-Time Setup]:\n1 - In IE, Open Tools menu, choose Toolbars, choose Customize\n2 - Under Available toolbar buttons, choose Edit, click Add, click Close\n3 - Confirm that the Edit button appears on your toolbar.\n4 - If not visible, click on the >> arrow and look for it at the end");
 
	return false;

	}
     catch(e)
	{ handleError() }
} 

function save()
 {
     try
	{
     	document.execCommand('SaveAs',true, document.title +'.htm');
	}
     catch(e)
	{ handleError() }
 }

function printme()
 {
	window.print();
 }

function handleError() 
{
	alert ("TASK BROWSER SECURITY SETTING (One-time change). \n\n You will need to change a setting on the client computer to accept the Active X Script. \n\n1, In your IE browser, go to Tools | Internet Options | Security | Custom Level. \n2, Scroll down until you see Initalizing and Scripting ActiveX controls that are not marked safe is disabled. \n3, Changed it from disabled to prompt. This will ask you page if you would like to run the script (that opens in word or excel).");
	return false;
}

function comment(semail)
{
     try
	{
	var sPath = window.location.href;
		
	var sPage2 = sPath.substring(sPath.lastIndexOf('/') + 1);
	
	var sPage1 = sPath.substring(0, sPath.lastIndexOf('/') );
		
	var sPageLink = sPage1 + '/default.htm?page=' + sPage2 ;
	
	document.location.href="mailto:" + semail + "\?subject\=Report:" + escape(document.title) + "...&body\=Report "+ escape(sPageLink) + "%0D%0AComments here%0D%0A";
	}
     catch(e)
	{ handleError() }
}

function email()
{
     try
	{
	var sPath = window.location.href;
	
	var sPage2 = sPath.substring(sPath.lastIndexOf('/') + 1);
	
	var sPage1 = sPath.substring(0, sPath.lastIndexOf('/') );
	
	var sPageLink = sPage1 + '/default.htm?page=' + sPage2 ;

	document.location.href="mailto:\?subject\=Report:" + escape(document.title) +"...&body\=" + "Link " +  escape(sPageLink) + " %0D%0A-To add report to email, Ctrl-V to paste.%0D%0A";
	bodyrange=document.body.createTextRange().execCommand('Copy');
	}
     catch(e)
	{ handleError() }
}

function copy()
{
     try
	{
	bodyrange=document.body.createTextRange().execCommand('SelectAll');
	bodyrange=document.body.createTextRange().execCommand('Copy');
	}
     catch(e)
	{ handleError() }
} 