/* SCRIPTS FOR THE NEWS WIDGET
scrollbox contents are found in a separate file that is written by ASP
...
much of this script was taken from weather.com and modified... they haven't got it working right in Netscape 6, and I didn't have any better luck, so much of the N6-specific lines are commented out. Instead, a link to the press room is written for N6 users.
*/

//performs color-based rollover effects on the widget in IE
function gf_newsTableFx(mouseIsOver) {
	if (!N6) { //Navigator 4 doesn't have the mouseOver event for the table
		if (mouseIsOver) {
			//document.all.newsTable.style.borderColor = '#cc0000';
			//document.all.newsTableHeader.style.color = '#003366';
			document.all.newsTableHeader.style.backgroundColor = '#cc0000';
			//document.all.newsTableCell.style.backgroundColor = 'white'
		} else {
			//document.all.newsTable.style.borderColor = 'white';
			document.all.newsTableHeader.style.color = 'white';
			document.all.newsTableHeader.style.backgroundColor = '#003366';
			//document.all.newsTableCell.style.backgroundColor = 'aqua'
		}
	}
}

// this set of code runs the marquee:

//Specify the marquee's width (in pixels)
var marqueewidth2=200
//Specify the marquee's height
var marqueeheight2=75
//Specify the marquee's scroll speed2 (larger is faster)
var speed2=1
//Specify the marquee contents
//<!-- start of new wc3 DOM feature scroller code -->
var feature_pos1;
var feature_pos = marqueeheight2 + 5; // initial offset of <DIV> at start of each loop, relies on marqueeheight2 from above
var feature_myspeed=2; // higher is faster
var feature_scroll_over = 0;
var feature_max_neg;  	// this is now based on the height of the content
						// EXCEPT!!! -- need to manually set for Netscape 6 in the immediate execution area at the bottom of this script


function intializemarquee2(){
	if (NN) {
		document.cmarquee03.document.cmarquee04.document.write(marqueecontents2)
		document.cmarquee03.document.cmarquee04.document.close()
		thelength2=document.cmarquee03.document.cmarquee04.document.height
		scrollit2()
	} //else if (N6) initialize_dom_features_scroll();
}

function pause_ns4_FoW_scroll() {
	if(feature_scroll_over == 1){
		window.setTimeout("pause_ns4_FoW_scroll();",200);
	}else{
		scrollit2();
	}
}

function scrollit2(){
	if (document.cmarquee03.document.cmarquee04.top>=thelength2*(-1)){
		if(feature_scroll_over == 1){ 
	    	pause_ns4_FoW_scroll(); 
		}else{
			document.cmarquee03.document.cmarquee04.top-=speed2
			window.setTimeout("scrollit2()",100)
		}
	}else{
		document.cmarquee03.document.cmarquee04.top=marqueeheight2
		scrollit2()
	}
}

function initialize_dom_features_scroll() {
   feature_pos1 = feature_pos;
   //document.getElementById("domFeatureDiv").style.visibility = "visible";
   dom_features_scroll();
}

function pause_dom_features_scroll() {
   if(feature_scroll_over == 1){
      window.setTimeout("pause_dom_features_scroll();",200);
   }else{
      dom_features_scroll();
   }
}

function dom_features_scroll() {
	feature_pos1 -= feature_myspeed;
	if( feature_pos1 <= feature_max_neg) feature_pos1 = feature_pos;
	feature_pos1px = feature_pos1+"px";
	document.getElementById("domFeatureDiv").style.top = feature_pos1px;
	if(feature_scroll_over == 1){ 
		pause_dom_features_scroll(); 
	}else{
		window.setTimeout("dom_features_scroll();",150);
	}
}

//immediate execution -- document.writing
if(document.getElementById && !document.all){
  /* var new_top = document.getElementById("newsTableCell")['offsetTop'] + 18;
   var new_left = document.getElementById("newsTableCell")['offsetLeft'] + 2;
   document.write('<DIV ID="feature_clip" name="feature_clip" style="width:150px; height:40px; position:absolute; top:'+new_top+'px; left:'+new_left+'px; clip:rect(0px,130px,37px,0px); visibility:show;"><div id="domFeatureDiv" style="position:relative; top:0px; left:0px; height:40px; width:130px; visibility:show">'+marqueecontents2+'<script language="JavaScript">gf_writeTourDIV(false);</script><script language="JavaScript">gf_writeTourDIV(false);</script>');
   //feature_max_neg = -1 * (document.getElementById("domFeatureDiv").offsetHeight);
   feature_max_neg = 40;*/
   document.write('<a href="/press/" class="dirLink">Visit the <b>Press Room</b></a>');
} else if (document.all){
  document.write('<marquee name="FOW_ie" onmouseover="stop()" onmouseout="start()" direction="up" scrollAmount='+speed2+' style="width:'+marqueewidth2+';height:'+marqueeheight2+'">'+marqueecontents2+'</marquee>');
}
//<!-- end of new wc3 DOM features ticker code -->