window.onload = function()
{
	createSwftype(".swfFooter", "flash/SwftypeAvenir.swf", "css/swftype.css", 215, 25, false, "all", false);
	createSwftype(".swfFooter", "/media/flash/SwftypeAvenir.swf", "/css/swftype.css", 215, 25, false, "all", false);
	createSwftype(".swfTitleBar", "/media/flash/SwftypeAvenir.swf", "/css/swftype.css", 500, 25, false, "width", false);
	createSwftype(".swfTitleBarSmaller", "/media/flash/SwftypeAvenir.swf", "/css/swftype.css", 500, 25, false, "width", false);
	createSwftype(".swfGreen", "/media/flash/SwftypeAvenir.swf", "/css/swftype.css", 470, 25, false, "width", false);
	createSwftype(".swfFlashHeading", "/media/flash/SwftypeAvenir.swf", "/css/swftype.css", 250, 25, false, "width", false);
	createSwftype(".swfGrey", "/media/flash/SwftypeAvenir.swf", "/css/swftype.css", 400, 25, false, "width", false);
	createSwftype(".swfBanner", "/media/flash/SwftypeAvenir.swf", "/css/swftype.css", 600, 25, false, "width", false);
	createSwftype(".swfBanner2", "/media/flash/SwftypeAvenir.swf", "/css/swftype.css", 600, 25, false, "width", false);
	
}

function changeSwfBlk() {
    var _parentDiv = document.getElementsByClassName('innovationBg');
    var _swfDiv;
    if (_parentDiv.length > 0) {
        _swfDiv = document.getElementsByClassName('swfGreen');
        for (var i = 0; i < _swfDiv.length; i++) {
            _swfDiv[i].className = 'swfBlack';
        }
    }
}

function changeSwf()
{
	var _parentDiv = document.getElementsByClassName('pscqBg');
	var _swfDiv;
	if(_parentDiv.length > 0)	
	{
		_swfDiv = document.getElementsByClassName('swfGreen');
		for(var i = 0;i<_swfDiv.length;i++)
		{
			_swfDiv[i].className = 'swfPink';
		}
	}
}

function navOver(imgTag)
{        
	var theImage = imgTag;	
	if(theImage.src.indexOf("_off.") != -1)	
	{
		theImage.src = theImage.src.replace("_off.","_on.");		
	}
	else	
	{
		theImage.src = theImage.src.replace("_on.","_off.");	
	}
}
function initFaq()
{
	var AnswerList = document.getElementsByClassName("question");
	var QuestionList = document.getElementsByClassName("answer");
	
	for(i=0;i<AnswerList.length;i++)
	{		
		var theQuestion = AnswerList[i];
		var LinkItem = AnswerList[i].getElementsByTagName("a")[0];
		LinkItem.onclick = function(i){
			return function(){
				toggleFaq("answerDiv"+i, "questionDiv"+i);
			}
		}(i);
		theQuestion.id = "questionDiv"+i;
		var DivItem = QuestionList[i];
		DivItem.id = "answerDiv"+i;
		DivItem.style.display = "none";
	}
}

function toggleFaq(divToToggle, questionClicked)
{
	var theIdClicked = document.getElementById(questionClicked);
	var theIdDisplay = document.getElementById(divToToggle).style;
	if(theIdDisplay.display == "block")
	{
		theIdDisplay.display = "none";
	}
	else
	{
		theIdDisplay.display  = "block";
	}
	return false;
}

function initAccordion()
{
	var titleList = document.getElementsByClassName("accordionTitle");
	var contentList = document.getElementsByClassName("accordionContent");
	
	for(i=0;i<titleList.length;i++)
	{		
		var theTitle = titleList[i];
		var LinkItem = titleList[i].getElementsByTagName("a")[0];
		LinkItem.onclick = function(i){
			return function(){
				toggleAccordion("contentDiv"+i, "titleDiv"+i);return false;
			}
		}(i);
		theTitle.id = "titleDiv"+i;
		var DivItem = contentList[i];
		DivItem.id = "contentDiv"+i;
		DivItem.style.display = "none";
	}
}

function toggleAccordion(divToToggle, titleClicked)
{
	var theIdClicked = document.getElementById(titleClicked);
	var theIdDisplay = document.getElementById(divToToggle).style;
	if(theIdDisplay.display == "block")
	{
		theIdDisplay.display = "none";
	}
	else
	{
		theIdDisplay.display  = "block";
	}
	return false;
}

function togglePwPopup(divName) {
    var theDiv = document.getElementById(divName);
    if (theDiv.style.display == "none")
        theDiv.style.display = "block";
    else if (theDiv.style.display == "block")
        theDiv.style.display = "none";
}

function changeImage(theElem, imageSrc, imgAlt) 
{
	document.getElementById(theElem).src = imageSrc;
	document.getElementById(theElem).alt = imgAlt;
}
function rolloverProduct(theElem,imageSrc)
{
	document.getElementById(theElem).src = imageSrc;
}

function hideDiv(elem)
{
	document.getElementById(elem).style.display = "none";
}

function showDiv(elem)
{
	document.getElementById(elem).style.display = "block";
}


