function checkPrint()
{
 	var x =  location.href;
 	var sPath = x.substring(0, x.lastIndexOf('/')+ 1);
	var sPage = document.forms[0].elements["printFriendlyPage"];
	if(sPage == null) {
		//alert("no object");
		//use the existing page
		changeCSS(); } 
	else if (sPage.value != "") {		
		//alert("object found, and has value");
		//re-direct to the htm page that contains the all the content (pages)
		location.href = sPath + sPage.value; }
	else {
		//alert("object found, but has no value");
		//use the existing page
		changeCSS(); }
}

function mailLink()
{
mail_str = "mailto:?subject=" + document.title;
mail_str += "&body=I thought you might be interested in " + document.title;
mail_str += ". You can view it at, " + location.href.toString(); 
location.href = mail_str;
}

function continuousPopUp()
{

newWindow=open(location.href, "Explanation", "height=250, width=475, scrollbars=yes, location=no");
if(window.focus)
	{ 
		newWindow.focus();
		newWindow.document.write(
		"<body><h2>Continuous Function and Server Duration</h2>" +
		"<div style=\"text-align: justify\">A continuous function is one in which small changes in input result in small changes in output. However, actual server capacity is acquired in sets and finding an optimal duration that can be implemented in a datacenter requires additional input factors and a more advanced modeling tool.<br /><br />" +
		"The duration calculator serves to demonstrate how short the breakeven point-in-time actually is and the cost savings opportunity available when duration is optimally managed.  Accounting for these variables and constraints still results in durations far less than three to six years, which translates into fewer licenses.</div></body>"); 
		newWindow.document.close();  //close for further writing
	}
return false;
}


function saveBookmark()
{
	var url = location.href;
	var title = document.title;
	
	if (window.sidebar) { // firefox
              window.sidebar.addPanel(title, url,"");
        } else if( document.all ) { //MSIE
                window.external.AddFavorite( url, title);
        } else {
               alert("Sorry, your browser doesn't support this");
        }
}
function resetSearch(){
	if(document.forms[0].elements["txtSearch"].value == ""){ 
		document.forms[0].elements["txtSearch"].value = "enter your search...";}
}


function clearSearch()
{
    document.forms[0].elements["txtSearch"].value ="";
}

function duration() 
{
	//fetch values
		var formElements = document.forms[0].elements;
		var h = formElements["hcost"].value;
		var s = formElements["scost"].value;
		var r = formElements["crate"].value;

	//compute duration 
	var rv = Math.log(1 + (h / s)) / Math.log(1 + (r / 100));
	
	//check result for a good number
	if(!isNaN(rv) &&
		(rv != Number.POSITIVE_INFINITY) &&
		(rv != Number.NEGATIVE_INFINITY))
	{
		formElements["durResult"].value = Math.round(rv * Math.pow(10,2)) / Math.pow(10,2); 	
	}
	//otherwise, the input was proabably bad so return an empty value
	else
	{
		formElements["durResult"].value =  "Error";
	}
}
function print()
{
	document.write("<span id=\"lblTitle\" style=\"white-space: nowrap !important; font-family: Arial; font-weight: bold; color: #804F0D; font-size: 20pt; position: relative !important; right: -8% !important; top: 45% !important;\">" + document.title + "</span>");
}

