var marqueePos = -1;
var timeout = null;
var z = 2
var is_visible = true;
var marqueeText = [
	"<img src=images/cloud.jpg alt=Welcome> <h1>Welcome to entrustIT  the UK market leader in cloud based managed IT services</h1> <h2>We take care of every aspect of your business IT from initial installation to recovery after disaster Simple, flexible and hassle free with security, resilience and availability guaranteed.</h2>",
	
	"<div id=flash><object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0 width=220 height=160 title=Entrustit> <param name=movie value=Entrust-Video_2.swf /> <param name=quality value=high /> <param name=wmode value=transparent /> <embed src=Entrust-Video_2.swf quality=high wmode=transparent pluginspage=http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash type=application/x-shockwave-flash width=220 height=160></embed></object></div> <h1>Hosted Desktops</h1> <h2>Secure desktop computing from the Cloud, available 24x7 from any internet enabled location. </h2><h3> Fixed monthly fee per user allowing your IT spend to grow and contract as you do. No sudden upgrade costs.</h3>",
	
	"<img src=images/image1.jpg alt=Welcome> <h1>Managed Services</h1> <h2>Let us manage your IT systems for you, either on your premises or from our datacentres. </h2><h3>On-site and remote support and access to our expert support desk & technical team.</h3>",
	
	"<div id=flash><object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0 width=220 height=160 title=Entrustit> <param name=movie value=Entrust-Video_1.swf /> <param name=quality value=high /> <param name=wmode value=transparent /> <embed src=Entrust-Video_1.swf quality=high wmode=transparent pluginspage=http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash type=application/x-shockwave-flash width=220 height=160></embed></object></div> <h1>Virtualization </h1> <h2>Consultancy, procurement and implementation services to help you consolidate your IT infrastructure. </h2> <h3>Benefit from lower costs and be environmentally responsible at the same time.</h3>",
	
	"<img src=images/voip.jpg alt=Welcome> <h1>VoIP Telephony</h1> <h2>Big company telephony at a fraction of the cost and without a complex phone system. </h2> <h3>Increased mobility -  work from the office, home or abroad especially in conjunction with a hosted desktop.</h3>",
	
	"<img src=images/engineer.jpg alt=Welcome> <h1>Support Services for Schools and Businesses</h1> <h2>Pay as you go support charged on a time and material basis as you need it. </h2> <h3>Fix-on-fail and all inclusive support contracts for those who want the reassurance of a guaranteed response time.</h3>",
	
	"<img src=images/cart.jpg alt=Welcome> <h1>Hardware Sales</h1> <h2>The latest laptop and desktop computers at competitive prices. PC or Mac. </h2> <h3> A friendly and skilled sales team who know enough to give sensible buying advice.</h3>"
	 ];

function changeMarqueeText ()
{
	document.getElementById ( "marquee" ).innerHTML = marqueeText [ marqueePos ];
}

function setMarqueeOpacityForAllBrowsers ( alpha ) {
	document.getElementById ( "marquee" ).style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=0,opacity:" + alpha + ")";	// MSIE
	document.getElementById ( "marquee" ).style.KHTMLOpacity = alpha / 100;	// Safari < 1.2, Konqueror
	document.getElementById ( "marquee" ).style.MozOpacity = alpha / 100;	// Older Mozilla & Firefox
	document.getElementById ( "marquee" ).style.opacity = alpha / 100;	// Safari 1.2+, newer Mozilla & Firefox, CSS3
}

function affectMarquee ( currentAlpha, increment, cbFuncName ) {

	var alpha = currentAlpha + increment;

	// have we gone beyond either threshold?
	if ( alpha < 0 || alpha > 95 )	// use 95 so code jumps from 95 -> 99; Mozilla flickers the div if 95 -> 100
	{
		// if so, cancel the operation by invoking callback
		if ( cbFuncName != null )
			cbFuncName ();
	} else {
		// else, adjust transparency and setup the next adjustment
		setMarqueeOpacityForAllBrowsers ( alpha );
		setTimeout ( "affectMarquee ( " + alpha + ", " + increment + ", " + cbFuncName + " )", 25 );
	}
}


function marqueeDisappear ()
{
	affectMarquee ( 100, -5, "marqueeDisappearCallback" );
}

function marqueeAppear ()
{
	affectMarquee ( 0, 5, "marqueeAppearCallback" );
}

function marqueeDisappearCallback ()
{
	is_visible = false;
	marqueeForward ();
	marqueeAppear ();
}

function marqueeAppearCallback ()
{
	is_visible = true;
	setMarqueeOpacityForAllBrowsers ( 99 );
	timeout = setTimeout ( "marqueeDisappear ()", 5000 );
}

function marqueeForward ()
{
	if ( timeout != null ) clearTimeout ( timeout ); // cancel the pending fade out
	marqueePos++;
	if ( marqueePos >= marqueeText.length ) marqueePos = 0;
	changeMarqueeText ();

	if ( is_visible )
		timeout = setTimeout ( "marqueeDisappear ()", 5000 ); // reschedule the fade out in another 10 s
}

function marqueeBackward ()
{
	if ( timeout != null ) clearTimeout ( timeout ); // cancel the pending fade out
	marqueePos--;
	if ( marqueePos < 0 ) marqueePos = marqueeText.length - 1;
	changeMarqueeText ();

	if ( is_visible )
		timeout = setTimeout ( "marqueeDisappear ()", 5000 ); // reschedule the fade out in another 10 s
}

function startMarquee ()
{
	marqueeDisappear ();
}


