/* ***********************************************************
* Scroll Text
************************************************************ */

var scrollerwidth='200px'
var scrollerheight='70px'
//var scrollerbgcolor='D5E1ED'
var scrollerbgcolor=''
var scrollerbackground=''
var linkhead = '<A HREF="#press" CLASS="special7pt" ONCLICK="winpopup(' + "'"
var linktail = "','',600,550)" + '">'
var midnews = new Array();	
var messages=new Array()
var nCntr = 0

for (j=0; j<9; j++)
{
	midnews[j] = new Array("","","","");
}

/* ---------------------------
Array Element descriptions
[x][0] HREF Link
[x][1] News header  + html code
[x][2] News text  + html code
[x][3] News date + html code
------------------------------ */

midnews[nCntr][0] = linkhead + 'pdf/reports/market2012.pdf' + linktail 
midnews[nCntr][1] = '<B>Middlefield Market Commentary 2011 </B><BR>'
midnews[nCntr][2] = 'Review and Outlook'
midnews[nCntr][3] = '<P ALIGN="RIGHT"><I>January 2012</I></P></A>'
nCntr++

midnews[nCntr][0] = linkhead + 'pressrls/activenergy/120811.pdf' + "','',650,700)" + '">' 
midnews[nCntr][1] = '<B>ACTIVEnergy Income Fund '
midnews[nCntr][2] = 'Rights Offering Fully Subscribed</B>'
midnews[nCntr][3] = '<P ALIGN="RIGHT"><I>December 8, 2011</I></P></A>'
nCntr++

midnews[nCntr][0] = linkhead + 'pdf/mutual/112811.pdf' + "','',650,700)" + '">' 
midnews[nCntr][1] = '<B>Groppe Tactical Energy Fund '
midnews[nCntr][2] = 'Number One Resources Fund in Canada</B>'
midnews[nCntr][3] = '<P ALIGN="RIGHT"><I>The Globe and Mail - November 28, 2011</I></P></A>'
nCntr++

midnews[nCntr][0] = linkhead + 'pdf/resource/112311.pdf' + linktail 
midnews[nCntr][1] = '<B>Middlefield Raises $110 Million</B><BR>'
midnews[nCntr][2] = ' in 2011 Flow-Through Offerings'
midnews[nCntr][3] = '<P ALIGN="RIGHT"><I>November 23, 2011</I></P></A>'
nCntr++

midnews[nCntr][0] = linkhead + 'pdf/reports/market2011q3.pdf' + linktail 
midnews[nCntr][1] = '<B>Middlefield Market Commentary</B><BR>'
midnews[nCntr][2] = 'Q3 2011'
midnews[nCntr][3] = '<P ALIGN="RIGHT"><I>September 30, 2011</I></P></A>'
nCntr++

midnews[nCntr][0] = linkhead + 'pressrls/energyindexplus/071911.pdf' + linktail 
midnews[nCntr][1] = '<B>ENERGY INDEXPLUS Dividend Fund</B><BR>'
midnews[nCntr][2] = ' Completes IPO'
midnews[nCntr][3] = '<P ALIGN="RIGHT"><I>July 19, 2011</I></P></A>'
nCntr++

midnews[nCntr][0] = linkhead + 'pressrls/mutual/061511.pdf' + linktail 
midnews[nCntr][1] = '<B>New Middlefield Mutual Fund and Series F Shares</B><BR>'
midnews[nCntr][2] = ''
midnews[nCntr][3] = '<P ALIGN="RIGHT"><I>June 15, 2011</I></P></A>'
nCntr++

midnews[nCntr][0] = linkhead + 'pressrls/reitndxplus/051711.pdf' + linktail 
midnews[nCntr][1] = '<B>REIT INDEXPLUS Income Fund</B><BR>'
midnews[nCntr][2] = 'IPO Closes at $179,100,000'
midnews[nCntr][3] = '<P ALIGN="RIGHT"><I>May 17, 2011</I></P></A>'
nCntr++

midnews[nCntr][0] = linkhead + 'pressrls/mrf2011/042111.pdf' + linktail 
midnews[nCntr][1] = '<B>MRF 2011 Resource LP</B><BR>'
midnews[nCntr][2] = 'Raises $60 Million'
midnews[nCntr][3] = '<P ALIGN="RIGHT"><I>April 21, 2011</I></P></A>'
nCntr++


for (j=0; j<nCntr; j++)
{
	messages[j] = midnews[j][0] + midnews[j][1] + midnews[j][2] + midnews[j][3]
}

var ie=document.all
var dom=document.getElementById

if (messages.length>2)
	i=2
else
	i=0

function move1(whichlayer)
{
	tlayer=eval(whichlayer)
	if (tlayer.top>0&&tlayer.top<=5)
	{
		tlayer.top=0
		setTimeout("move1(tlayer)",7500)
		setTimeout("move2(document.main.document.second)",7500)
		return
	}
	if (tlayer.top>=tlayer.document.height*-1)
	{
		tlayer.top-=5
		setTimeout("move1(tlayer)",50)
	}
	else
	{
		tlayer.top=parseInt(scrollerheight)
		tlayer.document.write(messages[i])
		tlayer.document.close()
		if (i==messages.length-1)
			i=0
		else
			i++
	}
}

function move2(whichlayer)
{
	tlayer2=eval(whichlayer)
	if (tlayer2.top>0&&tlayer2.top<=5)
	{
		tlayer2.top=0
		setTimeout("move2(tlayer2)",7500)
		setTimeout("move1(document.main.document.first)",7500)
		return
	}
	if (tlayer2.top>=tlayer2.document.height*-1)
	{
		tlayer2.top-=5
		setTimeout("move2(tlayer2)",50)
	}
	else
	{
		tlayer2.top=parseInt(scrollerheight)
		tlayer2.document.write(messages[i])
		tlayer2.document.close()
		if (i==messages.length-1)
			i=0
		else
			i++
	}
}

function move3(whichdiv)
{
	tdiv=eval(whichdiv)
	if (parseInt(tdiv.style.top)>0&&parseInt(tdiv.style.top)<=5)
	{
		tdiv.style.top=0+"px"
		setTimeout("move3(tdiv)",7500)
		setTimeout("move4(second2_obj)",7500)
		return
	}
	if (parseInt(tdiv.style.top)>=tdiv.offsetHeight*-1)
	{
		tdiv.style.top=parseInt(tdiv.style.top)-5+"px"
		setTimeout("move3(tdiv)",50)
	}
	else
	{
		tdiv.style.top=parseInt(scrollerheight)
		tdiv.innerHTML=messages[i]
		if (i==messages.length-1)
			i=0
		else
			i++
	}
}

function move4(whichdiv)
{
	tdiv2=eval(whichdiv)
	if (parseInt(tdiv2.style.top)>0&&parseInt(tdiv2.style.top)<=5)
	{
		tdiv2.style.top=0+"px"
		setTimeout("move4(tdiv2)",7500)
		setTimeout("move3(first2_obj)",7500)
		return
	}
	if (parseInt(tdiv2.style.top)>=tdiv2.offsetHeight*-1)
	{
		tdiv2.style.top=parseInt(tdiv2.style.top)-5+"px"
		setTimeout("move4(second2_obj)",50)
	}
	else
	{
		tdiv2.style.top=parseInt(scrollerheight)
		tdiv2.innerHTML=messages[i]
		if (i==messages.length-1)
			i=0
		else
			i++
	}
}

function startscroll()
{
	if (ie||dom)
	{
		first2_obj=ie? first2 : document.getElementById("first2")
		second2_obj=ie? second2 : document.getElementById("second2")
		move3(first2_obj)
		second2_obj.style.top=scrollerheight
		second2_obj.style.visibility='visible'
	}
	else if (document.layers)
	{
		document.main.visibility='show'
		move1(document.main.document.first)
		document.main.document.second.top=parseInt(scrollerheight)+5
		document.main.document.second.visibility='show'
	}
}


function firstlayer()
{
	if (document.layers) 	
		return messages[0] 
	else 
		return ""
}

function secondlayer()
{
	if (document.layers)
		return messages[dyndetermine=(messages.length==1)? 0 : 1]
	else
		return ""
}

function iebrowser()
{
	if (ie||dom)
	{
		var retstring=''
		retstring = retstring + '<div id="main2" style="position:relative;width:'+scrollerwidth+';height:'+scrollerheight+';overflow:hidden;background-color:'+scrollerbgcolor+' ;background-image:url('+scrollerbackground+')">'
		retstring = retstring + '<div style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight+';clip:rect(0 '+scrollerwidth+' '+scrollerheight+' 0);left:0px;top:0px">'
		retstring = retstring + '<div id="first2" style="position:absolute;width:'+scrollerwidth+';left:0px;top:1px;">'
		retstring = retstring + messages[0]
		retstring = retstring + '</div>'
		retstring = retstring + '<div id="second2" style="position:absolute;width:'+scrollerwidth+';left:0px;top:0px;visibility:hidden">'
		retstring = retstring + messages[dyndetermine=(messages.length==1)? 0 : 1]
		retstring = retstring + '</div>'
		retstring = retstring + '</div>'
		retstring = retstring + '</div>'
		return retstring
	}
	else
	{
		return ""	}
}

function getvideo()
{
	var cHdr = "<TABLE WIDTH='100%' CELLPADDING='0' CELLSPACING='0' BORDER='0' CLASS='standard7pt'>"
	var cCell1 = "<TR><TD ALIGN='LEFT' VALIGN='TOP' STYLE='border-left: 1pt #C1C1C1 solid; padding-top: 2pt; padding-left: 2pt; padding-bottom: 2pt'>"
	var cCell2 = "</TD></TR><TR><TD ALIGN='LEFT' VALIGN='TOP' BGCOLOR='#C1C1C1' HEIGHT='1'></TD></TR>"
	var cVideoStr = ""
	var nCnt = 0
	var VideoDetail = new Array();	

	for (k=0; k<8; k++)
	{
		VideoDetail[k] = new Array("","","");
	}

	VideoDetail[nCnt][0] = "<B>Dennis da Silva</B><BR>Managing Director, Resource Group of Middlefield Capital Corporation.<BR>"
	VideoDetail[nCnt][1] = "<A HREF='graphics/video/bnn012412-256k.wmv' "
	VideoDetail[nCnt][2] = "CLASS='special7pt'>View video BNN - Market Call</A><BR><FONT CLASS='standard7pt'>January 24, 2012.</FONT>"
	nCnt++

	VideoDetail[nCnt][0] = "<B>Dennis da Silva</B><BR>Managing Director, Resource Group of Middlefield Capital Corporation.<BR>"
	VideoDetail[nCnt][1] = "<A HREF='graphics/video/bnn121511-256k.wmv' "
	VideoDetail[nCnt][2] = "CLASS='special7pt'>View video BNN - Market Call</A><BR><FONT CLASS='standard7pt'>December 15, 2011.</FONT>"
	nCnt++
		
	VideoDetail[nCnt][0] = "<B>Andy Nasr</B><BR>Portfolio Manager<BR>Middlefield Capital Corporation.<BR>"
	VideoDetail[nCnt][1] = "<A HREF='graphics/video/bnn111111-256k.wmv' CLASS='special7pt'>View video BNN Market Call</A>"
	VideoDetail[nCnt][2] = "<BR><FONT CLASS='standard7pt'>November 11, 2011.</FONT>"
	nCnt++

	VideoDetail[nCnt][0] = "<B>Dennis da Silva</B><BR>Managing Director, Resource Group of Middlefield Capital Corporation.<BR>"
	VideoDetail[nCnt][1] = "<A HREF='graphics/video/bnn093011-256k.wmv' "
	VideoDetail[nCnt][2] = "CLASS='special7pt'>View video BNN - Market Call</A><BR><FONT CLASS='standard7pt'>September 30, 2011.</FONT>"
	nCnt++

	VideoDetail[nCnt][0] = "<B>Rob Lauzon</B><BR>Managing Director, Western Canada<BR>of Middlefield Group.<BR>"
	VideoDetail[nCnt][1] = "<A HREF='graphics/video/bnn091211-256k.wmv' CLASS='special7pt'>View video BNN Market Call Tonight</A>"
	VideoDetail[nCnt][2] = "<BR><FONT CLASS='standard7pt'>September 12, 2011.</FONT>"
	nCnt++

	VideoDetail[nCnt][0] = "<B>Andy Nasr</B><BR>Portfolio Manager<BR>Middlefield Capital Corporation.<BR>"
	VideoDetail[nCnt][1] = "<A HREF='graphics/video/bnn082311-256k.wmv' CLASS='special7pt'>View video BNN Market Call</A>"
	VideoDetail[nCnt][2] = "<BR><FONT CLASS='standard7pt'>August 23, 2011.</FONT>"
	nCnt++

	VideoDetail[nCnt][0] = "<B>Arthur Berman</B><BR>Energy Consultant<BR>"
	VideoDetail[nCnt][1] = "<A HREF='graphics/video/berman051011-256k.wmv' "
	VideoDetail[nCnt][2] = "CLASS='special7pt'>View video Middlefield Luncheon</A><BR>Fairmont Royal York Hotel<BR>May 10, 2011.</FONT>"
	nCnt++

	VideoDetail[nCnt][0] = "<B>Rob Lauzon</B><BR>Managing Director, Western Canada<BR>of Middlefield Group.<BR>"
	VideoDetail[nCnt][1] = "<A HREF='graphics/video/bnn050911-256k.wmv' CLASS='special7pt'>View video BNN Market Call Tonight</A>"
	VideoDetail[nCnt][2] = "<BR><FONT CLASS='standard7pt'>May 9, 2011.</FONT>"
	nCnt++

		
	for (k=0; k<nCnt; k++)
	{
		cVideoStr = cVideoStr + cCell1 + VideoDetail[k][0] + VideoDetail[k][1] + VideoDetail[k][2] + cCell2
	}

	cVideoStr = cHdr + cVideoStr + "</TABLE>"
	return cVideoStr
}

window.onload=startscroll

