

// dreamweaver rollovers

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


// *******************************************************		easeInOut()
/*
	--Generic Animation Step Value Generator By www.hesido.com 
		powr > 1 produces ease-in
		powr < 1 produces ease-out
		powr = 1 produces linear animations
*/
function easeInOut(minValue, maxValue, totalSteps, actualStep, powr)
{
	var delta = maxValue - minValue; 
	var stepp = minValue+(Math.pow(((1 / totalSteps) * actualStep), powr) * delta); 
	return Math.ceil(stepp);
} 

// *************************************************	dhtml pop ups:

/*
	div must be set with style="display: none;"
*/

var dhtmlPopUpInnerHTML;

function preloadDhtmlImages()
{
	bgTileGreyOutBg90 = new Image();
	bgTileGreyOutBg90.src = 'http://www.lifeteam.us/_images/bgTile-greyOutBg-90.png';
}

			
function showDhtmlPopUp(divId, topPos)
{
	var scrollXY = getScrollXY();
	var windowSize = getWindowSize();

	var popDiv = document.getElementById(divId);
	var topPosition = (topPos) ? topPos : 100;
	//topPosition += (Math.round(scrollXY[0]/2));
	
	var htmlWrapper1 = '<div id="dhtmlPopUpWrapper" style="position: absolute; top: '+Math.round(scrollXY[1])+'px; left: 0px; z-index: 101; width: 100%; height: 100%;';
	htmlWrapper1 += '	background-image: url(http://www.lifeteam.us/_images/bgTile-greyOutBg-90.png);">';
	htmlWrapper1 += '<div style="float: left; width:100%; height: 100%; position:relative;">';
	htmlWrapper1 += '<div style="clear: left; float: left; position: relative; left: 50%; top: '+topPosition+'px;">';
	htmlWrapper1 += '<div style="display: block; float: left; position: relative; right: 50%;">';

	var htmlWrapper2 = '</div></div></div></div>';
	dhtmlPopUpInnerHTML = popDiv.innerHTML;
	
	popDiv.innerHTML = htmlWrapper1+dhtmlPopUpInnerHTML+htmlWrapper2;
	
	popDiv.style.top = scrollXY[1]+'px';
	popDiv.style.zIndex = '102';
	popDiv.style.display = 'block';
}
			


function hideDhtmlPopUp(divId)
{
	var popDiv = document.getElementById(divId);
	popDiv.innerHTML = dhtmlPopUpInnerHTML;
	popDiv.style.display = 'none';
}


// *************************************************


function insertBanner(bannerName, siteRoot, selectedLinkText)
{
	var mode = (siteRoot.match(/https:/)) ? 'https' : 'http';
	
	AC_FL_RunContent(
		'codebase', mode+'://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
		'width', '887',
		'height', '158',
		'src', 'http://www.lifeteam.us/_flash/'+bannerName,
		'FlashVars', 'selectedLinkText='+selectedLinkText+'&siteRoot='+siteRoot,
		'quality', 'high',
		'pluginspage', mode+'://www.macromedia.com/go/getflashplayer',
		'align', 'middle',
		'play', 'true',
		'loop', 'false',
		'scale', 'showall',
		'wmode', 'transparent',
		'devicefont', 'false',
		'id', bannerName,
		'bgcolor', '#ffffff',
		'name', bannerName,
		'menu', 'true',
		'allowFullScreen', 'false',
		'allowScriptAccess','always',
		'movie', 'http://www.lifeteam.us/_flash/'+bannerName,
		'salign', ''
		); //end AC code
}

// *************************************************

function getVideoSkinColors()
{
	colors = new Array();
	colors[0] = 'ffe900'; // buttonColor
	colors[1] = '013e7e'; // bgColor
	colors[2] = '03274d'; // highlightColor
	colors[3] = '185ba1'; // mutedColor
	return colors;
}


// requires a div with id 'popupVideoContainer' to be set

function popUpVideo(videoName, w, h)
{
	var scrollXY = getScrollXY();
	colors = getVideoSkinColors();
	var paddedW = w + 50;
	var paddedH = h + 100;
	var html = '<div style="width: 100%; height: 100%; position: absolute; top: '+scrollXY[1]+'px; left: 0px; z-index: 100;';
	html += ' background-image: url(http://www.lifeteam.us/_images/bgTile-greyOutBg-80.png);">';
	html += '<div style="position:absolute; top: 50%; left: 50%; width: '+w+'px; height: '+h+'px;';
	html += ' margin-top: -'+Math.round(h/2)+'px; margin-left: -'+Math.round(w/2)+'px;">';
	html += '<a href="javascript: closePopUpVideo();" style="display: block; text-align: right; background-color: #'+colors[1]+'; color: #'+colors[0]+'; padding: 3px 20px;';
	//html += 'margin-bottom: 10px; ';
	html += '"><b>X</b> Close</a>';
	html += insertVideo(videoName, w, h, true);
	html += '</div></div>';

	document.getElementById('popupVideoContainer').innerHTML = html;
}


function closePopUpVideo()
{
	document.getElementById('popupVideoContainer').innerHTML = '';
}


function insertVideo(videoName, width, height, returnHtml)
{
	colors = getVideoSkinColors();
	
	if (!returnHtml) {
		AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
			'width', width,
			'height', height,
			'src', 'http://www.lifeteam.us/_flash/video_player',
			'FlashVars', 'videoUrl=http://www.lifeteam.us/_flash/videos/'+videoName+'.flv&buttonColor=0x'+colors[0]+'&bgColor=0x'+colors[1]+'&highlightColor=0x'+colors[2]+'&mutedColor=0x'+colors[3],
			'quality', 'high',
			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			'align', 'middle',
			'play', 'true',
			'loop', 'false',
			'scale', 'showall',
			'wmode', 'transparent',
			'devicefont', 'false',
			'id', videoName,
			'bgcolor', '#ffffff',
			'name', videoName,
			'menu', 'true',
			'allowFullScreen', 'false',
			'allowScriptAccess','always',
			'movie', 'http://www.lifeteam.us/_flash/video_player',
			'salign', ''
			); //end AC code
	} else {
		html = AC_FL_GetContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
			'width', width,
			'height', height,
			'src', 'http://www.lifeteam.us/_flash/video_player',
			'FlashVars', 'videoUrl=http://www.lifeteam.us/_flash/videos/'+videoName+'.flv&buttonColor=0x'+colors[0]+'&bgColor=0x'+colors[1]+'&highlightColor=0x'+colors[2]+'&mutedColor=0x'+colors[3],
			'quality', 'high',
			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			'align', 'middle',
			'play', 'true',
			'loop', 'false',
			'scale', 'showall',
			'wmode', 'transparent',
			'devicefont', 'false',
			'id', videoName,
			'bgcolor', '#ffffff',
			'name', videoName,
			'menu', 'true',
			'allowFullScreen', 'false',
			'allowScriptAccess','always',
			'movie', 'http://www.lifeteam.us/_flash/video_player',
			'salign', ''
			); //end AC code
		return html;
	}
}





// ***************************************************************

function nullFunc()
{
	return;
}

// ***************************************************************

