var streamheight;
var streamwidth;
var streamwrapper;

//formatting
var cb__fnt = cb_jobstream_text_font?'font: '+cb_jobstream_text_font+';':'';
var cb__fntclr = cb_jobstream_font_color?'color: '+cb_jobstream_font_color+';':'';
var cb__bg  = cb_jobstream_main_bgcolor?'background-color: '+cb_jobstream_main_bgcolor+';':'';
var cb__lnk = cb_jobstream_link_color?'color: '+cb_jobstream_link_color+';':'';

p6 ='<table border="0" width="100%">';
'<tr><td style="'+cb__fnt+cb__fntclr+'">No Jobs Available<br \/><\/td><\/tr>'
p6+='</table>';

document.write('<div id="stream">'+p6+'</div>');
streamheight = document.getElementById('stream').scrollHeight;
document.getElementById('stream').style.display = 'none';

streamwidth = (parseFloat(cb_jobstream_width) - 6) + 'px';
streamwrapper = (parseFloat(cb_jobstream_height)) + 'px';

//JobStream
document.write('<table border="0"><tr><td>');

c=new scrollerObj('c',streamwrapper,streamwidth,streamheight,'100',p6,cb_jobstream_main_bgcolor,cb_jobstream_main_bgcolor,'1','center')


document.write('<\/td><\/tr><\/table>');

//Scripts for scroller
function scrollerObj(name,initH,initW,heightB,widthB,content,initBg,Bg,speed,initFl){

//**data**//
this.name=name;this.initH=initH;this.initW=initW;this.heightB=heightB;
this.widthB=widthB;this.content=content;this.initBg=initBg;
this.Bg=Bg;this.iniFl=initFl;this.speed=parseInt(speed,5);
this.timer=name+"Timer";

//**methods**//
this.getElement=getElement;this.createLayer=createLayer;
this.scrollLayer=scrollLayer;this.scrollLoop=scrollLoop;

//**initiate methods**//
this.createLayer();this.getElement();this.scrollLayer();}

//**call this method to stop scrolling**//
function scrollLoop(s){this.speed=s;}
function scrollLayer(){
if(parseInt(this.elem.style.top,10)>(this.elem.offsetHeight*(-1))){
  this.elem.style.top=parseInt(this.elem.style.top,10)-this.speed+'px';
  } else {this.elem.style.top=this.initH;}}
function getElement(){this.elem=document.getElementById(this.name);}
function createLayer(){
document.write('<div id="layer'+this.name+'" style="position:relative;overflow:hidden;float:center');
document.write(';background-color:'+this.initBg+';width:');
document.write(this.initW+';height:'+this.initH+';" onmouseover="');
document.write(this.name+'.scrollLoop(0)" onmouseout="'+this.name+'.scrollLoop(');
document.write(this.speed+')">');
document.write('<table width="100%" id="'+this.name+'" style="position:absolute;top:');
document.write(this.initH+';left:0px;border:0px solid black;');
document.write('height:'+this.heightB+';background-color:');
document.write(this.Bg+'"><tr><td>');
document.write(this.content);
document.write('<\/td><\/tr><\/table><\/div>');
if(this.scrollLayer){this.timer=setInterval(this.name+'.scrollLayer()','30');}
}

function switchTabs(tab) {
     if (tab=='jbstrm') {
        document.getElementById(tab).style.display = '';
        document.getElementById("qsb").style.display = 'none';     
	}
    else {
        document.getElementById(tab).style.display = '';
        document.getElementById("jbstrm").style.display = 'none';      
    }
}

function highlight(section) {
    section.style.background = cb_jobstream_highlight;
}

function unhighlight(section) {
    section.style.background = cb_jobstream_main_bgcolor;
}