// News Highlights
var latest_highlight
var latest_img
var popup
var popupFade
var popcheck = false
function setupHighlights () {
	with(document) {
		latest_highlight = getElementById('latest-highlight').innerHTML
		latest_img = getElementById('highlight-img').src
		var highlights = document.getElementsByName('highlight')
		for(var i=0; i<highlights.length; i++) {
			highlights[i].onmouseover = highlightsOV
			/*highlights[i].onmouseout = highlightsOUT*/
		}
		//getElementById('highlight-img').onload = headerLoaded
	}
}
function headerLoaded () {
	fade('highlight-img',0,20,true)
	this.onload = null
}
function highlightsOV () {
	document.getElementById('latest-highlight').innerHTML = this.title
	document.getElementById('latest-highlight').href = this.href
	document.getElementById('highlight-img').src = this.rel
}
function highlightsOUT () {
	document.getElementById('latest-highlight').innerHTML = latest_highlight
	document.getElementById('highlight-img').src = latest_img
}
function setupPopUp() {
	if(popup==null) {
		popup = document.getElementById('pop-up-news')
		popup.onmouseover = showPopUp
		popup.onmouseout = hidePopUp
		document.getElementById('news-link').onmouseover = showPopUp
		document.getElementById('news-link').onmouseout = hidePopUp
	}
	popup.style.top="-1035px"
}
function showPopUp() {
	popup.style.top = "-33px"
	popcheck = true
}
function hidePopUp() {
	popup.style.top = "-1035px"
	popcheck = false
}

// Logo Mouse Over
function setupFade(id_mo,id_fade,fadeinCheck,speed) {
	var obj_mo = document.getElementById(id_mo)
	
	if(fadeinCheck) { // id_fade fades in onmouserover of id_mo
		obj_mo.onmouseover=function(){fade(id_fade,0,speed,true)}
		obj_mo.onmouseout=function(){fade(id_fade,100,speed,false)}
	} else { // id_fade fades out onmouseover of id_mo
		obj_mo.onmouseover=function(){fade(id_fade,100,speed,false)}
		obj_mo.onmouseout=function(){fade(id_fade,0,speed,true)}
	}
}

// HTTP Object
function get_httpObject() {
	var httpObject=null
	try {
		 // Firefox, Opera 8.0+, Safari
		 httpObject=new XMLHttpRequest();
	}
	catch (e) {
		//Internet Explorer
		try {
			httpObject=new ActiveXObject("Msxml2.httpObject")
		}
		catch (e) {
			httpObject=new ActiveXObject("Microsoft.httpObject")
		}
	}
	if (httpObject==null) {
		alert ("Browser does not support HTTP Request.")
		return
	} else { return httpObject }
}
