/*  Called by the index page */
/*  This is just an experiment, so I hope you'll forgive my lack of organization.  This type of scripting requires more organization and record keeping for large applications. */



var count = 0.1;
var countLeft = 0.1;
var count2 = 0;
var ieCount2 = 0;
var countLeft2 = 0;
var ieCountLeft2 = 0;


var rightTextElement;
var leftTextElement;

var user_agent;
var rightHeaderText = "";
var leftHeaderText = "";




function loadData()
{
user_agent = navigator.userAgent;




rightTextElement = document.getElementById('rightHeaderTextFade');
rightTextElement.style.opacity = 0;
rightTextElement.style.MozOpacity = 0;
rightTextElement.style.KhtmlOpacity = 0;
rightTextElement.style.filter="progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
rightTextElement.style.filter = "alpha(opacity = 0)";
getRightHeaderText();
leftTextElement = document.getElementById('leftHeaderTextFade');
leftTextElement.style.opacity = 0;
leftTextElement.style.MozOpacity = 0;
leftTextElement.style.KhtmlOpacity = 0;
leftTextElement.style.filter="progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
leftTextElement.style.filter = "alpha(opacity = 0)";
getLeftHeaderText();
}



/* *********************************************************
             Left Header Fade
************************************************************/
function startFadeInLeftHeader()
{

if(countLeft < 1)
{
countLeft2 = parseInt(countLeft * 100)/100;
leftTextElement.style.opacity = countLeft2;
leftTextElement.style.MozOpacity = countLeft2;
leftTextElement.style.KhtmlOpacity = countLeft2;
//if(user_agent.match(/\bMSIE/)){leftTextElement.innerHTML = leftHeaderText;}
ieCountLeft2 = countLeft2 * 100;
leftTextElement.style.filter="progid:DXImageTransform.Microsoft.Alpha(Opacity=" + ieCountLeft2 + ")";
leftTextElement.style.filter = "alpha(opacity = " + ieCountLeft2 + ");";
setTimeout("startFadeInLeftHeader()", 10);
countLeft += .01;
}

}


function startFadeOutLeftHeader()
{
//if(leftTextElement.style.opacity < 1){leftTextElement.style.opacity = 0;}
//rightTextElement.fadeState = -1;
if(countLeft > 0)
{
countLeft2 = parseInt(countLeft * 100)/100;
leftTextElement.style.opacity = countLeft2;
leftTextElement.style.MozOpacity = countLeft2;
leftTextElement.style.KhtmlOpacity = countLeft2;
//if((user_agent.match(/\bMSIE/)) && (countLeft2 >= .99)){leftTextElement.innerHTML = "";}
ieCountLeft2 = countLeft2 * 100;

leftTextElement.style.filter="progid:DXImageTransform.Microsoft.Alpha(Opacity=" + ieCountLeft2 + ")";
leftTextElement.style.filter = "alpha(opacity = " + ieCountLeft2 + ");";


setTimeout("startFadeOutLeftHeader()", 10);
countLeft -= .01;
}

}








/* ********************************************************
             Right Header Fade
***********************************************************/
function startFadeInRightHeader()
{
//rightTextElement.fadeState = 1;
if(count < 1)
{
count2 = parseInt(count * 100)/100;
rightTextElement.style.opacity = count2;
rightTextElement.style.MozOpacity = count2;
rightTextElement.style.KhtmlOpacity = count2;

//if(user_agent.match(/\bMSIE/)){rightTextElement.innerHTML = rightHeaderText;}
ieCount2 = count2 * 100;
rightTextElement.style.filter="progid:DXImageTransform.Microsoft.Alpha(Opacity=" + ieCount2 + ")";
rightTextElement.style.filter = "alpha(opacity ="+ ieCount2 + ");";



setTimeout("startFadeInRightHeader()", 10);
count += .01;
}
rightTextElement.FadeState = -1;
}


function startFadeOutRightHeader()
{

//rightTextElement.fadeState = -1;
if(count > 0)
{
count2 = parseInt(count * 100)/100;
rightTextElement.style.opacity = count2;
rightTextElement.style.MozOpacity = count2;
rightTextElement.style.KhtmlOpacity = count2;
//if((user_agent.match(/\bMSIE/)) && (count2 <= .01)){rightTextElement.innerHTML = "";}
ieCount2 = count2 * 100;
rightTextElement.style.filter="progid:DXImageTransform.Microsoft.Alpha(Opacity=" + ieCountLeft2 + ")";
rightTextElement.style.filter = "alpha(opacity = " + ieCount2 + ");";

setTimeout("startFadeOutRightHeader()", 10);
count -= .01;
}
rightTextElement.FadeState = 1;
}




/* ******************************************************
           Set Up faded Header Text
*********************************************************/

function getRightHeaderText()
{
rightHeaderText = "Some management observations by Bob Sutton<br /><ul><li>You have to do the dirty work before you have somebody else do it for you.</li><li>As much predictability as possible</li><li>Forgive failure and remember failure.</li><li>Sesame Street simple (CEO P&G)</li></ul> ";
rightTextElement.innerHTML = rightHeaderText;
//if(user_agent.match(/\bMSIE/)){rightTextElement.innerHTML = "";}
return;
}



function getLeftHeaderText()
{
leftHeaderText = "Your presence is needed on the internet.   Your unique style and impact will make a difference online.   Don't just download a template.   Let us help you enhance your concepts and designs with the latest in scripting techniques.   You know your business and you know your customers.  Put your brand on your web site from the ground up.  The solution is good old fashioned hard work.  We bring good coding at good prices."; 
leftTextElement.innerHTML = leftHeaderText;
//if(user_agent.match(/\bMSIE/)){leftTextElement.innerHTML = "";}

return;
}
