// UPS SolutionFinder functions
// javascript/solutionfinder.js

// if Flash version is not available then display the error html-fragment
function sfOnLoad(){
	if ( displayNoFlash ){
		var noflashdivObj = document.getElementById("noflashdiv");
		if ( noflashdivObj != null ){
			noflashdivObj.style.display = "block";
		} else {
			alert("Flash must be installed to use this application.");
		}
	} 
}

// change the stage height to accommodate the SF contents
function setStageHeight( nHeight )
{
	document.getElementById('flashPiece').style.height = nHeight + "px";
	document.getElementById('flashwrapper').style.height = nHeight + "px";
}

// scroll to the top
function goToTop()
{
	window.scrollTo(0, 0);
}

// Disable Back Button logic:
// In IE - when the href contains "javascript:" then the page unloads so the
// bussolOkToLeave is true on the first onbeforeunload because it is set in the onclick event for the link
// from a breadcrumb link but false on the second unload when it hits the "javascript:".  
// The navigate function will handle setting the variable and changing the current window
// to the passed url.
// The code that handles the onbeforeunload is in an html-fragment
// File: CONTENT_RULES_HOME/na/us/en/prim-nav/primarynavigation_jan05_12.html

// 11/20/08 - Laura Harting - Comment out the logic for the disable back button - it is not to be implemented.
function navigate(theURL){
	//alert("navigate: bussoloktoleave is getting set to true; window.location.href is set to "+theURL);
	//setBussolOkToLeave(true);
	window.location.href = theURL;
}

// update bussolOkToLeave
/*
function setBussolOkToLeave(thevalue){
	bussolOkToLeave = thevalue;
}
*/
///////////////////////  
/////test code from Caroline Sirmon this will be found in  html-fragment change for back button 
// see comment on navigate above
/*
var bussolOkToLeave= false;

window.onbeforeunload = notifyUserBeforeExitingPage;	
	 
function notifyUserBeforeExitingPage()
{ 
	alert("notifyUserBeforeExitingPage:: value is "+bussolOkToLeave);
	if ( !bussolOkToLeave )
	{
		return "All information will be lost";
	}
	bussolOkToLeave= false;
}
*/	
///////////////////////  end test code from Caroline Sirmon 


