//====================================
// ==============================================================
//  Flash Hybrid CMS: Effects
// ==============================================================
//====================================

// V. 1.1

// 2nd generation technology built off the Interactive 3D portfolio.
// This site utilizes many similar features with some new and improved applets.

// (c)Snc Design 2008 - Quality Graphics and Code - [www.sncdesign.net]

// =================================
//  Button Effect
// =================================
function buttonEffect(i, tf)
{
	var ie5 = (document.all && document.getElementById);
	var ns6 = (!document.all && document.getElementById);
	if(tf == "TRUE")
	{
       	 	if(ie5) document.getElementById(i).filters.alpha.opacity = 50;
        	if(ns6) document.getElementById(i).style.MozOpacity = .5;
	}
	else
	{
       	 	if(ie5) document.getElementById(i).filters.alpha.opacity = 100;
        	if(ns6) document.getElementById(i).style.MozOpacity = 1;
	}
}

// =================================
//  Launch a Hidden Window
// =================================
function winLaunch(i)
{
	var ie5 = (document.all && document.getElementById);
	var ns6 = (!document.all && document.getElementById);
	if(window.document.getElementById(i).style.visibility == "visible")
	{
		fadeWinOut(i, opac=100, ie5, ns6, lights="off");
	}
	else
	{
		window.document.getElementById(i).style.visibility="visible";
		fadeWin(i, opac=0, ie5, ns6, lights="on");
	}
}

// =================================
//  Window Fade Animation
// =================================
// Fade in and out are placed in seperate functions
// for performance reasons in Firefox.

function fadeWin(i, opac, ie5, ns6, lights) 
{
		if((opac < 100) && (lights == "on"))
		{
       			opac+=50;
        		if(ie5) document.getElementById(i).filters.alpha.opacity = opac;
        		if(ns6) document.getElementById(i).style.MozOpacity = opac/100;
			setTimeout(function() { fadeWin(i, opac, ie5, ns6, lights) }, 2);
		}	
}

function fadeWinOut(i, opac, ie5, ns6, lights) 
{
		if ((opac > 0) && (lights == "off"))
		{
       			opac-=50;
        		if(ie5) document.getElementById(i).filters.alpha.opacity = opac;
			if (opac != 0) //prevents division by zero
			{
        			if(ns6) document.getElementById(i).style.MozOpacity = opac/100;
			}
			setTimeout(function() { fadeWinOut(i, opac, ie5, ns6, lights) }, 2);
			if (opac == 0)
			{
				window.document.getElementById(i).style.visibility="hidden";
			}
		}
}