
function getRedirectAuthLink(destination) {
	var returnValue;
	returnValue = $.ajax({
	      url: "/toolbox/tools/stepbystep/stepbystepurl.html?routeurl="+destination,
	      global: false,
	      type: "POST",
		  async: false,
	      dataType: "text"
	   }
	).responseText;
	return returnValue;
}
function launchStepByStepPopup() {
	var redirectUrl ;
	redirectUrl = getRedirectAuthLink("stepbystep.target.destination");
	if (redirectUrl.indexOf('http') > 2) {
		redirectUrl = redirectUrl.substring(redirectUrl.indexOf('http'));
	}
	popPageWithScroll(720,830,redirectUrl,'toolsScroll');
}

function launchStepByStepNoPopup() {
	var redirectUrl ;
	redirectUrl = getRedirectAuthLink("stepbystep.target.destination");
	if (redirectUrl.indexOf('http') > 2) {
		redirectUrl = redirectUrl.substring(redirectUrl.indexOf('http'));
	}
	window.location=redirectUrl;
}


//**************************************************************
//* FIT 34907 - bfuller 05/24/10
//*
//* Copying launchStepByStepPopup() logic to save the
//* session info for the plan print friendly pop up 
//* window.
//*
//* See PrinterFriendlyUtils.getOnclickForPDFPrionterFriendly() 
//* for the code that builds the link that calls this function
//**************************************************************

function getPdfRedirectAuthLink(destination) {
	var returnValue;
	
	returnValue = $.ajax({
	      url: "/toolbox/pdfprintfriendlyurl.html?routeurl="+destination,
	      global: false,
	      type: "POST",
		  async: false,
	      dataType: "text"
	   }
	).responseText;

	return returnValue;
}

function launchPDFPrintFriendlyPopup(t, id) {

	var redirectUrl ;

	redirectUrl = getPdfRedirectAuthLink("pdfprintfriendly.target.destination");
	
	if (redirectUrl.indexOf('http') > 2) {
		redirectUrl = redirectUrl.substring(redirectUrl.indexOf('http'));
	}
	redirectUrl = redirectUrl + "&t=" + t + "&id=" + id;
	
	//* function located in print.js
	popPageWithLoc(5,5,redirectUrl, 9000, 9000);  	
}

//FIT 82381 - This one is for the Health Summary PDF.
function launchPDFPrintHealthSummaryPopup(t, id, piececd) {

	var redirectUrl ;

	redirectUrl = getPdfRedirectAuthLink("pdfprintfriendly.target.destination");
	
	if (redirectUrl.indexOf('http') > 2) {
		redirectUrl = redirectUrl.substring(redirectUrl.indexOf('http'));
	}
	redirectUrl = redirectUrl + "&pieceCD=" + piececd + "&t=" + t + "&id=" + id;
	
	//* function located in print.js
	popPageWithLoc(5,5,redirectUrl, 9000, 9000);  	
}

//**************************************************************
//* FIT 42240 - adyer 09/14/10
//*
//* Removing code since it never worked.Honesty is best.
//**************************************************************
