// JavaScript Document

 
/*
Fading Scroller- By DynamicDrive.com
For full source code, and usage terms, visit http://www.dynamicdrive.com
This notice MUST stay intact for use
*/

var delay=8000 //set delay between message change (in miliseconds)
var fcontent=new Array()
begintag='<p class=bodycopy align=left>' //set opening tag, such as font declarations
fcontent[1]="<b>Southland Home Sales Edge Up, Prices Level Off</b><br>Southern California’s housing market continued its slow crawl toward normalcy in June as sales volume rose and the median price slipped back a notch from May, but remained 13 percent higher than a year ago.<div class=bodycopy align=right><a href='http://dqnews.com/Articles/2010/News/California/Southern-CA/RRSCA100713.aspx'>more info</a></div>"
fcontent[2]="<b>Bay Area June Home Sales Send Mixed Signals</b><br>The number of Bay Area homes sold last month inched up from May but fell short of a year ago as the impact of the federal home buyer tax credits began to fade.<div class=bodycopy align=right><a href='http://dqnews.com/Articles/2010/News/California/Bay-Area/RRBay100715.aspx'>more info</a></div>"
fcontent[0]="<b>California June Home Sales</b><br>An estimated 43,964 new and resale houses and condos were sold statewide last month. That was up 7.3 percent from 40,965 in May, and down 0.5 percent from 44,167 for June 2009.<div class=bodycopy align=right><a href='http://dqnews.com/Articles/2010/News/California/RRCA100715.aspx'>more info</a></div>"


//fcontent[3]=""
//fcontent[3]="<b>New Southland Price Record - Sales Off Peak</b><br>The Southern California residential real estate market finished off 2004 with new price peaks and a strong, but not record-breaking sales pace. <div class=bodycopy align=right>...<a href='http://www.dqnews.com/RRSCA0105.shtm'>more info</a></div>"
closetag='</p>' 

var fwidth='169px' //set scroller width
var fheight='175px' //set scroller height

var fadescheme=0 //set 0 to fade text color from (white to black), 1 for (black to white)
var fadelinks=1  //should links inside scroller content also fade like text? 0 for no, 1 for yes.

///No need to edit below this line/////////////////

var hex=(fadescheme==0)? 255 : 0
var startcolor=(fadescheme==0)? "rgb(255,255,255)" : "rgb(0,0,0)"
var endcolor=(fadescheme==0)? "rgb(0,0,0)" : "rgb(255,255,255)"

var ie4=document.all&&!document.getElementById
var ns4=document.layers
var DOM2=document.getElementById
var faderdelay=0
var index=0

if (DOM2)
faderdelay=3000

//function to change content
function changecontent(){
if (index>=fcontent.length)
index=0
if (DOM2){
document.getElementById("fscroller").style.color=startcolor
document.getElementById("fscroller").innerHTML=begintag+fcontent[index]+closetag
linksobj=document.getElementById("fscroller").getElementsByTagName("A")
if (fadelinks)
linkcolorchange(linksobj)
colorfade()
}
else if (ie4)
document.all.fscroller.innerHTML=begintag+fcontent[index]+closetag
else if (ns4){
document.fscrollerns.document.fscrollerns_sub.document.write(begintag+fcontent[index]+closetag)
document.fscrollerns.document.fscrollerns_sub.document.close()
}

index++
setTimeout("changecontent()",delay+faderdelay)
}

// colorfade() partially by Marcio Galli for Netscape Communications.  ////////////
// Modified by Dynamicdrive.com

frame=20;

function linkcolorchange(obj){
if (obj.length>0){
for (i=0;i<obj.length;i++)
obj[i].style.color="rgb("+hex+","+hex+","+hex+")"
}
}

function colorfade() {	         	
// 20 frames fading process
if(frame>0) {	
hex=(fadescheme==0)? hex-12 : hex+12 // increase or decrease color value depd on fadescheme
document.getElementById("fscroller").style.color="rgb("+hex+","+hex+","+hex+")"; // Set color value.
if (fadelinks)
linkcolorchange(linksobj)
frame--;
setTimeout("colorfade()",20);	
}

else{
document.getElementById("fscroller").style.color=endcolor;
frame=20;
hex=(fadescheme==0)? 255 : 0
}   
}