// JavaScript Document

var presel = null;

function startupNews() {
	if (pararr["news"]) {
		var parnum = pararr["news"];				
		parnum = pararr["news"];
		//tech_1_section_1_link		
		if (parnum > 0) {			
			selectNews(parnum - 1);
		}
	}	
}

function selectNews(elitem) {	
	var elnews = ged("newsheadline_" + elitem);
	if (elnews) {
		window.scrollTo(0, elnews.offsetTop);
		highlightNews(elnews);
		presel = elnews;
	}
}

function highlightNews(nel) {
	
	if (presel) {
		unhighlightNews(presel);
		presel = null;
	}
	
	nel.setAttribute("class", "newsheadline_sel");
	nel.setAttribute("className", "newsheadline_sel");
	
	//set image in image window:
	var imgwin = ged("image_window");
	
	var tmparr = nel.id.split("_");
	var nelid = tmparr[1];
	
	var newsrc = ged("news_image_" + nelid).src;
	imgwin.src = newsrc;
		
	imgwin.style.display = "";
	
	var nsi = ged("news_section_image");
	//nsi.style.top = "500px";
	var pos = findPos(nel);		
	nsi.style.top = (pos["curtop"] - 140) + "px";
}

function unhighlightNews(nel) {
	nel.setAttribute("class", "newsheadline");
	nel.setAttribute("className", "newsheadline");
	var imgwin = ged("image_window");
	imgwin.style.display = "none";
}