﻿/************************************************************************************************
Flashing Elements.
Version	- 2.0
Author	- Anoop Nair.
Company	- MKCL.
Usage	- * Spans with class "FlashIt" are made flashing.
		  * Spans with class "FlashItNoDec" are made flashing, without any decoration in
				content text.

# COPYRIGHT NOTICE
# Copyright (c) 2006-2007 MKCL, All rights reserved.
# This script may be used and modified free of charge for Non-profit purposes by anyone as long
# as this copyright notice and the comments above are kept in their original form.
************************************************************************************************/

var flashSpan= new Array();
function InitFlash()
{
	var spans = document.getElementsByTagName("SPAN");
	var numFlash= 0;
	for(i=0; i< spans.length; i++)
	{
		if(String(spans.item(i).className).substring(0,7).toLowerCase() == "flashit")
		{
			flashSpan[numFlash]= spans.item(i);
			if(String(spans.item(i).className).substring(0,12).toLowerCase() != "flashitnodec")
				SetFlashStyles(flashSpan[numFlash]);
			if(navigator.userAgent.indexOf("IE")!= -1)
			{
				flashSpan[numFlash].style.display= "inline-block";
				if(flashSpan[numFlash].style.filter != 'undefined')
				{
					flashSpan[numFlash].style.filter= "alpha(opacity=0)";
					setInterval("FilterFlashWork("+numFlash+")", 800);
				}
			}
			else
			{
				//flashSpan[numFlash].style.textDecoration= 'blink';
				if (flashSpan[numFlash].style.opacity != 'undefined')
				{
					flashSpan[numFlash].style.opacity= 0;
					FlashWork(numFlash);
				}
			}
			numFlash++;
		}
	}
}
function SetFlashStyles(elem)
{
	elem.innerHTML= "&bull;"+ elem.innerHTML+ "&bull;";
	//elem.style.backgroundColor= "yellow";
	//elem.style.background= "#A6E8FD";
	//elem.style.border= "1px solid #A6E8FD";
	elem.style.fontWeight= "bold";
	//elem.style.fontStyle= "italic";
	elem.style.fontSize= "95%";
	elem.style.color= "darkred";
}
function FilterFlashWork(index)
{
	flashSpan[index].style.filter= "alpha(opacity="+(parseInt(flashSpan[index].style.filter.substring(14))+100)%200+")";
}
function FlashWork(index)
{
	flashSpan[index].style.opacity= (parseInt(flashSpan[index].style.opacity)+1)%2;
	setTimeout('FlashWork('+index+')', 800);
}
InitFlash();
