﻿/************************************************************************************************
Flashing Elements.
Version	- 3.5.1
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")
			continue;

		flashSpan[numFlash]= spans.item(i);
		if(String(spans.item(i).className).substring(0,12).toLowerCase() != "flashitnodec")
		{
			if(flashSpan[numFlash].innerHTML.toLowerCase()== "new")
			{
				flashSpan[numFlash].innerHTML= "";
				var image= document.createElement("IMG");
				image.src= "../Images/new1.gif";
				image.alt= "New";
				image.style.height="11px";
				image.style.width="20px";				
				flashSpan[numFlash].appendChild(image);
				numFlash++;
				continue;
			}
			else
			{
				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+")", 500);
			}
		}
		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= "#60C0EC";
	elem.style.background= "#60C0EC";
	elem.style.border= "1px solid red";
	elem.style.fontWeight= "normal";
	elem.style.fontStyle= "italic";
	elem.style.fontSize= "90%";
	elem.style.color= "red";
}
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+')', 500);
}
InitFlash();