// Set the functionality of the marquee below.
var altTime  = 4000; // Set the time between message displays (in milliseconds). 
var altSpeed = .5;   // Set the transition duration.
var msgTrans =  12;  // Set the number of the transition to apply to the messages.

// Set the style of the marquee below.
var mLeft      = 5;          // Set the left position of the marquee (in pixels).
var mTop       = 5;         // Set the top position of the marquee (in pixels).
var mHeight    = 25;        // Set the height of the marquee (in pixels).
var mWidth     = 250;        // Set the width of the marquee (in pixels).
var bgColor    = '';     // Set the marquee's background color.
var brdrWidth  = 2;          // Set the marquee's border width.
var brdrStyle  = 'solid';    // Set the marquee's border style ('solid', 'dashed', 'dotted', etc.).  Different border styles only work in Netscape 6 and up, and not in Internet Explorer.
var brdrColor  = 'black';     // Set the marquee's border color.
var fontFamily = 'Arial';  // Set the font family.
var fontSize   = 14;         // Set the font size (in pixels).
var fontStyle  = 'normal';   // Set the font style ('normal' or 'italic').
var fontWeight = 'bold';     // Set the font weight ('normal' or 'bold').
var txtDec     = 'none';     // Set any decorations for the marquee's text.
var fontColor  = 'black';     // Set the font color.
var msgZIndex  = 1000;       // Set the z-index of the marquee.  Make sure that the number is bigger than the z-index of what you want it to appear over on the page.

// Input your messages here.  Your messages can contain HTML tags.
// If you want an apostrophe in your text, type \' instead of just '.
var msgArray = new Array();
msgArray[0] = 'Welcome To<font color="red"> apoorav.com</font>';
msgArray[1] = 'Check out New Section- <a href="http://techfun.x10hosting.com/video/videos.html"><i><u>VIDEOS</i></a></u>';
msgArray[2] = 'Check out New Section- <a href="http://techfun.x10hosting.com/trailer/trailers.html"><i><u>TRAILERS</i></a></u>';
//msgArray[2] = 'It will even display <font color="red">text</font> in different colors.';
//msgArray[3] = 'You can even display <i>italic</i> and <u>underlined</u> text.';

// Do not edit below this line!!!

var brwsr;
if (navigator.appName == 'Microsoft Internet Explorer')
{
	if (parseInt(navigator.appVersion) >= 3)
		brwsr = 'IE';
	else
		brwsr = null;
}
else if (navigator.appName == 'Netscape')
{
	if (parseInt(navigator.appVersion) >= 5)
		brwsr = 'NS6';
	else if (parseInt(navigator.appVersion) >= 4)
		brwsr = 'NS4';
	else
		brwsr = null;
}

function Ret(msgNum)
{
	if (brwsr == 'IE')
		return(document.all['msg' + msgNum]);
	else if (brwsr == 'NS4')
		return(document.layers['msg' + msgNum]);
	else if (brwsr == 'NS6')
		return(document.getElementById('msg' + msgNum));
	else
		return(null);
}

function ShowOrHide(msgNum)
{
	var msgRet;
	if (brwsr == 'IE' || brwsr == 'NS6')
		msgRet = Ret(msgNum).style;
	else
		msgRet = Ret(msgNum);

	if (msgRet.visibility == 'hidden' || msgRet.visibility == 'hide')
	{
		if (brwsr == 'IE')
		{
			msgRet.filter = 'revealTrans(duration=' + altSpeed + ', transition=' + msgTrans + ')';
			Ret(msgNum).filters.revealTrans.apply();
		}
		brwsr == 'NS4' ? msgRet.visibility = 'show' : msgRet.visibility = 'visible';
		if (brwsr == 'IE')
			Ret(msgNum).filters.revealTrans.play();
	}
	else if (msgRet.visibility == 'visible' || msgRet.visibility == 'show')
		brwsr == 'NS4' ? msgRet.visibility = 'hide' : msgRet.visibility = 'hidden';
}

function ShowOrHide2(msgNum)
{
	ShowOrHide(msgNum);
	setTimeout('ShowOrHide(' + msgNum + ')', altTime);
}

function LoopIt()
{
	for (i=0; i<=msgArray.length-1; i++)
		setTimeout('ShowOrHide2(' + i + ')', altTime*i);
}

function BuildMarquee()
{
	var msgBlock = '';
	if (brwsr == 'IE' || brwsr == 'NS6')
	{
		msgBlock += '<div style="height:' + mHeight + 'px; width:' + mWidth + 'px; position:absolute; left:' + mLeft + 'px; top:' + mTop + 'px; background-color:' + bgColor + '; border:' + brdrWidth + 'px ' + brdrStyle + ' ' + brdrColor + '; z-index:' + msgZIndex + ';">\r';
		for (i=0; i<=msgArray.length-1; i++)
		{
			msgBlock += '  <span id="msg' + i + '" style="visibility:hidden; height:' + (mHeight - brdrWidth * 3) + 'px; width:' + (mWidth - brdrWidth * 3) + 'px; position:absolute; left:2px; top:2; font-family:' + fontFamily + '; font-size:' + fontSize + 'px; font-style:' + fontStyle + '; font-weight:' + fontWeight + '; text-decoration:' + txtDec + '; color:' + fontColor + '; z-index:' + (msgZIndex + 1) + '; ">\r'
			+ '    ' + msgArray[i] + '\r'
			+ '  </span>\r';
		} 
		msgBlock += '</div>';
		document.write(msgBlock);
	}
	else if (brwsr == 'NS4')
	{
		var msgBlockNS4 = new Array();
		for (i=0; i<=msgArray.length-1; i++)
		{
			msgBlockNS4[i] = '  <layer bgColor="' + bgColor + '" left="' + mLeft + '" name="msg' + i + '" top="' + mTop + '" visibility="hide" z-index="' + msgZIndex + '">\r'
			+ '    <table bgColor="' + bgColor + '" border="' + brdrWidth + '" borderColor="' + brdrColor + '" cellPadding="2" cellSpacing="0" height="' + mHeight + '" width="' + mWidth + '"><tr><td height="100%" width="100%"><p style="font-family:' + fontFamily + '; font-size:' + fontSize + 'px; font-style:' + fontStyle + '; font-weight:' + fontWeight + '; text-decoration:' + txtDec + '; color:' + fontColor + ';">' + msgArray[i] + '</p></td></tr></table>\r'
			+ '  </layer>\r';
		}

		var arrayStr = '';
		for (j=0; j<=msgBlockNS4.length-1; j++)
			arrayStr += msgBlockNS4[j];
		document.write(arrayStr);
	}
	else
	{
		msgBlock ="HELLO!";
		document.write(msgBlock);
	}
}

BuildMarquee();
if (brwsr == 'NS4')
	setTimeout('LoopIt()', 100);
else
	LoopIt();
setInterval('LoopIt()', altTime*msgArray.length-1);