

//	Fading
	
//	setOpacity takes an object and an opacity value (0..100)
//	and sets the appropriate opacity.


// Email links

function pm_contact(inName, inDomain)
{
	address='mailto:' + inName + '@' + inDomain;
	location = (address);
}




function pm_setOpacity(object, opacity)
{
	if ((opacity >= 0) && (opacity <=100) && (object != null))
	{
		opacity = (opacity == 100 ? 99.999 : opacity);

		//	Safari 1.2, Firefox, Mozilla, CSS3...
		object.style.opacity = opacity / 100;

		//	Old Mozilla, Firefox...
		object.style.MozOpacity = opacity / 100;

		//	Old Safari, Konqueror...
		object.style.KHTMLOpacity = opacity / 100;

		//	IE/Win...
		object.style.filter = "alpha(opacity:"+opacity+")";
	}
}

function pm_setOpacityForId(objectId, opacity)
{
	if (document.getElementById)
	{
		object = document.getElementById(objectId);
		pm_setOpacity(object, opacity);
	}
}


//	cycleImages: cycle through the images in the named div, fading each one up in turn

function pm_cycleImagesInDiv(inDivId, inInitialDelay, inFadeIncrement, inFadeDelay, inHoldDelay)
{
	if (document.getElementById)
	{
		cycleDiv = document.getElementById(inDivId);
		childCount = cycleDiv.children.length;
		window.setTimeout("pm_cycleIn('" + inDivId + "_" + "', " + 1 + ", " + childCount + ", " + 0 + ", " + inFadeIncrement + ", " + inFadeDelay + ", " + inHoldDelay + ")", inInitialDelay);
	}
}


//	cycleIn: private method which handles the actual fading

function pm_cycleIn(objectIdPrefix, initial, count, opacity, inFadeIncrement, inFadeDelay, inHoldDelay)
{
	objectId = objectIdPrefix + initial;

	if (document.getElementById)
	{
		object = document.getElementById(objectId);
		if (opacity <= 100)
		{
			//	keep fading up image...
			pm_setOpacity(object, opacity);
			opacity += inFadeIncrement;
			window.setTimeout("pm_cycleIn('" + objectIdPrefix + "', " + initial + ", " + count + ", " + opacity + ", " + inFadeIncrement + ", " + inFadeDelay + ", " + inHoldDelay + ")", inFadeDelay);
		}
		else
		{
			//	move on to next image...
			initial += 1;
			if (initial <= count)
			{
				opacity = 0;
				window.setTimeout("pm_cycleIn('" + objectIdPrefix + "', " + initial + ", " + count + ", " + opacity + ", " + inFadeIncrement + ", " + inFadeDelay + ", " + inHoldDelay +")", inHoldDelay);
			}
			else
			{
				//	cycle complete...
				pm_setOpacityForId(objectIdPrefix + "0", 100);
				for (hideIndex = 1; hideIndex < count; hideIndex++)
				{
					pm_setOpacityForId(objectIdPrefix + hideIndex, 0);
				}
				
				initial = 1;
				opacity = 0;
				window.setTimeout("pm_cycleIn('" + objectIdPrefix + "', " + initial + ", " + count + ", " + opacity + ", " + inFadeIncrement + ", " + inFadeDelay + ", " + inHoldDelay +")", inHoldDelay);
			}
		}
	}
}

