//====================================
// ==============================================================
//  Interactive 3D Portfolio: CMS - Rollovers and Effects
// ==============================================================
//====================================

// V. 1.00

// "Interactive 3D Portfolio" content mangement system allows either
// a veteran or a aspiring 3D artist to quickly create and customize
// an efficient interactive portfolio website. It is meant to act
// like a reel with options. Any person viewing your interactive
// reel will be able to quickly identify your skillsets because of its
// easability in use. This often keeps the viewers attention rather than
// getting bored of a simple video reel and giving you no more than 30
// seconds of their time.

// (c)Snc Design - 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=90, 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 < 90) && (lights == "on"))
		{
       			opac+=30;
        		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-=30;
        		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";
			}
		}
}