var text = new Array();
var header = new Array();
var linka = new Array();
var targa = new Array();
var divtext = new Array();
var divheader = new Array();
var objst = new Array();
var objs = new Array();
var objsh = new Array();

header[0] = "<img src=\"images\\sponsors\\mitchellpartners270.gif\" alt=\"\" border=\"0\" />";
header[1] = "<img src=\"images\\sponsors\\quest_mini.gif\" alt=\"\" border=\"0\" />";
header[2] = "<img src=\"images\\sponsors\\evansandpartners250.gif\" alt=\"\" border=\"0\" />";
header[3] = "<img src=\"images\\sponsors\\jelliscraig_mini.gif\" alt=\"\" border=\"0\" />";
header[4] = "<img src=\"images\\sponsors\\lifeguard_mini.gif\" alt=\"\" border=\"0\" />";
header[5] = "<img src=\"images\\sponsors\\charterkeckcramer270.gif\" alt=\"\" border=\"0\" />";
header[6] = "<img src=\"images\\sponsors\\colombos_mini.gif\" alt=\"\" border=\"0\" />";
header[7] = "<img src=\"images\\sponsors\\dga_mini.gif\" alt=\"\" border=\"0\" />";
header[8] = "<img src=\"images\\sponsors\\elginInn_mini.gif\" alt=\"\" border=\"0\" />";

text[0] = "<br>Chartered Accountants and Business Advisors. <br><br>Specialise in providing professional services in Business Management & Planning, Accounting & Taxation, Investment & Financial Advice, Superannuation and Retirement Planning.<br><br>Alan Mitchell - (03) 9898 4353 <br><br> <a href=\"http://www.mitchell.com.au\">www.mitchell.com.au</a>";
text[1] = "<br>Our spacious, stylishly-appointed and well-serviced apartments are available around Australia and in Fiji and NZ.<br><br> Tel: +61 (0)3 8699 1500<br><br><a href=\"http://www.questapartments.com.au\">www.questapartments.com.au</a>";
text[2] = "<br>Modern Ideas. Traditional Service.<br><br>We specialise in providing advice on Australian equities, international equities, fixed interest securities, listed property, cash and derivatives. <br><br>Contact NIGEL CREDLIN on 03 9631 9804  <a href=\"http://www.evansandpartners.com.au\">www.evansandpartners.com.au</a>";
text[3] = "<br>Exceptional real estate service and results in Melbourne's inner-eastern suburbs.<br><b>Damien Davis</b> - (03) 9818 2222<br>818 Glenferrie Rd, Hawthorn<br><br><a href=\"http://www.jelliscraig.com.au\">www.jelliscraig.com.au</a>";
text[4] = "<br>Insurance - Superannuation - Financial Planning<br>Andrew Webb & Toby Webb<br>Ph: 03 9855 2311<br><br><a href=\"mailto:lifeguard@lifeguard.com.au\">lifeguard@lifeguard.com.au</a><br><a href=\"http://www.lifeguard.com.au\" target=\"_blank\">www.lifeguard.com.au</a>";
text[5] = "<br>Charter Keck Cramer is a leading Australian independent strategic property consulting firm.<br><br>Head Office 1/620 Church Street, Richmond. <br><br>Phil Cramer<br>(03) 9425 5555<br><br><a href=\"http://www.charterkc.com.au\">www.charterkc.com.au</a>";
text[6] = "<br>Colombo's Family Restaurant. <br><br>250 Whitehorse Road Balwyn <br><br>Phone: 9836 6442";
text[7] = "<br>DGA is an Insurance brokerage with clients throughout Australia and overseas.<br><br>Level 2, 256 Queen Street Melbourne<br>03 9670 9344 <br><br><a href=\"http://www.dgainsurance.com.au\" target=\"_blank\">www.dgainsurance.com.au</a>"
text[8] ="<br>75 Burwood Rd, Hawthorn<br>(03) 9819 3338<br><br>The club gather at the Elginn after every AWAY Senior game. Excellent meals and function room hire available."

linka[0] = "http://www.mitchell.com.au";
linka[1] = "http://www.questapartments.com.au/";
linka[2] = "http://www.evansandpartners.com.au";
linka[3] = "http://www.jelliscraig.com.au/";
linka[4] = "http://www.lifeguard.com.au/";
linka[5] = "http://www.charterkc.com.au/";
linka[6] = "#";
linka[7] = "http://www.dgainsurance.com.au/";
linka[8] = "#";

//targa[0] = "_blank";

uagent = window.navigator.userAgent.toLowerCase();
IEB=(uagent.indexOf('msie') != -1)?true:false;
var scompat = document.compatMode;
var kalan=0;
var vcurr=0;
var vnext=0;
var str2='';
var mc=0;
mc=text.length;
stepc=parseInt(20*(1000/1000));
dif=0.00;
op=1.00;
dif=(1.00/stepc);

var RealTickerWidth=200;
var RealTickerHeight=220;
var CalcIcWidth=0;
var CalcIcHeight = 0;
var slideLength = 3000;

//function addSponsor(atext, imageName, alinka) {
//	text[text.length] = atext;
//	header[header.length] = "<img src=\"sponsorimages/" + imageName + "\" alt=\"\" border=\"0\" />";
//	linka[linka.length] = alinka;
//}


generateSponsorThingy();  // move to onload

function generateSponsorThingy() {



	if((IEB==true)&&(scompat == "BackCompat" )){
		RealTickerWidth=RealTickerWidth;
		RealTickerHeight=RealTickerHeight;
	} else {
		RealTickerWidth=RealTickerWidth-2*(1);
		RealTickerHeight=RealTickerHeight-2*(1);
	}

	CalcIcWidth=RealTickerWidth-2*(1);
	CalcIcHeight=RealTickerHeight-2*(1);
	str2='';
	str2 = str2 + '<div style="position:relative;width:100%;height:100%;left:0px;top:0px;overflow:hidden;visibility:visible;border-width:0px;">';
	//str2 = str2 + '<div style="position:relative;width:' + RealTickerWidth + ':px;height:' + RealTickerHeight + 'px;left:0px;top:0px;overflow:hidden;visibility:visible;border-width:0px;">';

	for(i=0;i<mc;i++){

		// div with heading image
		divheader[i]='<div id="dh'+i+'" style="visibility:inherit;background:white; COLOR:white;padding-top:0px;padding-left:0px;left:0px;top:0px; FONT-FAMILY:Verdana; FONT-SIZE:9pt; font-style: normal; font-weight:bold; TEXT-DECORATION:none;margin:0px; overflow:hidden;text-align:center;cursor:default;">';

		// div for the body text
		divtext[i]='<div id="d'+i+'" onmouseover="mdivmo('+i+')" onmouseout ="restime('+i+')" onclick="butclick('+i+')"'+' style="visibility:inherit;background:white; COLOR:black;padding-top:0px;padding-left:0px;left:0px; top:0px;  FONT-FAMILY:Verdana; FONT-SIZE:8pt; font-style:normal; font-weight:normal; margin:0px; TEXT-DECORATION:none; overflow:hidden;text-align:center;cursor: default;">';

		// I think this div does the transparency stuff
		str2 = str2 + '<div id="op' + i + '" style="position:absolute;overflow:hidden;visibility:hidden;left:0px;top:0px;width:100%;height:100%;border-style:solid;border-width:0px;">';
		//str2 = str2 + '<div id="op' + i + '" style="position:absolute;overflow:hidden;visibility:hidden;left:0px;top:0px;width:' + CalcIcWidth + 'px; height:' + CalcIcHeight + 'px;border-style:solid;border-width:0px;">';

		str2=str2+''+divheader[i]+''+header[i]+'</div>'+divtext[i]+''+text[i]+'</div>';
		str2=str2+'</div>';
		}
	str2=str2+'</div>';
}

function mdivmo(gnum){
	if(linka[gnum]!=''){
		objs[gnum].style.color='#B40000';
		objs[gnum].style.cursor='pointer';
		window.status=''+linka[gnum];
	}
}
function restime(gnum2){
	objs[gnum2].style.color='#060606';
	window.status='';
}
function butclick(gnum3){
	if(linka[gnum3].substring(0,11)=="javascript:")	{
		eval(""+linka[gnum3]);return;
	}
	//if(targa[gnum3]==''){
	targa[gnum3] = '_blank';
	//targa[gnum3] = '_parent';
	//}
	if(IEB){
		window.open(''+linka[gnum3],''+targa[gnum3]);
	} else {
		if((targa[gnum3].indexOf("_parent")>-1)){
			eval("parent.window.location='"+linka[gnum3]+"'");
		} else if((targa[gnum3].indexOf("_top")>-1)){
			eval("top.window.location='"+linka[gnum3]+"'");
		} else	{
		window.open(''+linka[gnum3],''+targa[gnum3]);
		}
	}
}
function zindx(){
	objst[vnext].style.visibility="visible";
	objst[vcurr].style.zIndex=2;
	objst[vnext].style.zIndex=3;
}
function Sonraki(){
	vcurr=vnext;
	vnext=vnext+1;
	if(vnext>=mc){
		vnext=0;
	}
}
function dotrans(){
	if(vnext!=vcurr){
		if(IEB){
			spageObj.filters[0].apply();
		}
		objs[vnext].style.color='#060606';
		objst[vnext].style.visibility='visible';
		objst[vcurr].style.visibility='hidden';

		if(IEB){
			spageObj.filters[0].play();
		}
	}
	Sonraki();
	setTimeout('dotrans()', slideLength + 1000);
}
function dotransff(){
	op=op-dif;
	if(op<(0.00)){
		op=0.00;
	}
	objst[vcurr].style.opacity = op;
	objst[vnext].style.opacity = 1.00-op;
	if(op>(0.00)){
		setTimeout('dotransff()',50);
	} else {
		objst[vcurr].style.zIndex=2;
		objst[vnext].style.zIndex=3;
		Sonraki();
		setTimeout('beftrans()', slideLength);
	}
}
function beftrans(){
	op=1.00;
	objst[vcurr].style.visibility="visible";
	objst[vnext].style.visibility="visible";
	objst[vcurr].style.zIndex=3;
	objst[vnext].style.zIndex=2;
	objst[vcurr].style.opacity = 1.00;
	objst[vnext].style.opacity = 1.00;
	dotransff();
}
function DoScrollUp(){
	kalan=kalan-Math.ceil(kalan/(1000/1000));
	objst[vcurr].style.top=""+(kalan-CalcIcHeight)+"px";
	objst[vnext].style.top=""+kalan+"px";
	if(kalan<=0){
		Sonraki();
		kalan=CalcIcHeight;
		objst[vnext].style.top=""+kalan+"px";
		zindx();
		timeo = setTimeout('DoScrollUp()', slideLength);
	} else {
	setTimeout('DoScrollUp()',50);
	}
}
function DoSlide(){
	kalan=kalan-Math.ceil(kalan/(1000/1000));
	objst[vcurr].style.left=""+(kalan-CalcIcWidth)+"px";
	objst[vnext].style.left=""+kalan+"px";
	if(kalan<=0){
		Sonraki();
		kalan=CalcIcWidth;
		objst[vnext].style.left=""+kalan+"px";
		zindx();
		timeo = setTimeout('DoSlide()', slideLength);
	}else{
		setTimeout('DoSlide()',50);
	}
}
function dofirst(){
	var i=0;
	for(i=0;i<mc;i++){
		objs[i]=document.getElementById("d"+i);
		objs[i].style.left="0px";
		objs[i].style.top="0px";
		objsh[i]=document.getElementById("dh"+i);
		objsh[i].style.left="0px";
		objsh[i].style.top="0px";
		objst[i]=document.getElementById("op"+i);
		objst[i].style.left="0px";
		objst[i].style.top="0px";
		objst[i].style.visibility="hidden";
	}
	objst[0].style.visibility="visible";
	if(5==2){
		kalan=CalcIcWidth;
		vnext=0;
		Sonraki();
		zindx();
		objst[vnext].style.left=""+kalan+"px";
		setTimeout('DoSlide()', slideLength);
	} else if(5==4){
		kalan=CalcIcHeight;
		vnext=0;
		Sonraki();
		zindx();
		setTimeout('DoScrollUp()', slideLength);
	} else if(5==5){
		if(IEB){
		    setTimeout('dotrans()', slideLength);
		} else {
		setTimeout('beftrans()', slideLength);
		}
	}    else{
	setTimeout('dotrans()', slideLength);
	}
}
function initte(){
	spageObj=document.getElementById('spage');
	if(!spageObj){
		setTimeout('initte()',200);
	}
	spageObj.innerHTML=str2;
	vnext=1;
	if(vnext>=mc){
		vnext=0;
	}
	spageObj.style.left="0px";
	spageObj.style.top="0px";
	setTimeout('dofirst()',100);
}
setTimeout('initte()',100);