function blink() {
	if(!document.all)
		return;
	else {
		var a = document.getElementsByTagName("blink");
		for(var i = 0; i < a.length; i++)
			a[i].style.visibility = (a[i].style.visibility == "visible") ? "hidden" : "visible";
	}
}

function headlineClick() {
	window.navigate(event.srcElement.getAttribute("tag"));
}

function headlineOver(index) {
	var table = event.srcElement;
	while(table.tagName != "TABLE")
		table = table.parentElement;
	table.rows[0].cells[0].innerHTML = event.srcElement.getAttribute("headline");
	table.rows[0].cells[0].setAttribute("tag", event.srcElement.getAttribute("href"));
	for(var i = 0; i < table.rows[1].cells[0].children.length; i++) {
		table.rows[1].cells[0].children[i].style.backgroundColor = index == i ? "#CCCCCC" : "";
		table.rows[1].cells[1].children[i].style.display = index == i ? "" : "none";
	}
}

function headlineOverB() {
	var obj = event.srcElement;
	while(obj.tagName != "A")
		obj = obj.parentElement;
	if(document.getElementById("HeadlineCell") != null) {
		HeadlineCell.innerHTML = obj.children[0].alt;
		HeadlineCell.setAttribute("tag", obj.href, 0);
	}
	else {
		var table = obj.parentElement;
		while(table.tagName != "TABLE")
			table = table.parentElement;
		var td = table.rows[0].cells[0];
		td.children[0].href = obj.href;
		td.children[0].children[0].innerHTML = obj.children[0].alt;
		td.children[0].children[1].innerHTML = obj.title;
		td.children[0].children[2].alt = obj.children[1].innerText;
		td.children[0].children[2].src = obj.children[0].src.replace("_b.jpg", ".jpg");
	}
}

function headlineOverC() {
	var obj = event.srcElement;
	while(obj.tagName != "A")
		obj = obj.parentElement;
	if(document.getElementById("HeadlineCell") != null) {
	}
	else {
		var table = obj.parentElement;
		while(table.tagName != "TABLE")
			table = table.parentElement;
		var td = table.rows[0].cells[0];
		td.children[0].href = obj.href;
		td.children[0].children[0].innerHTML = obj.getAttribute("headline");
		td.children[0].children[1].innerHTML = obj.getAttribute("spot");
		td.children[0].children[2].alt = obj.innerText;
		td.children[0].children[2].src = obj.getAttribute("img");
	}
}

function hideHeadline(id) {
	try {
		var obj = eval("title_" + id);
		obj.innerHTML = obj.getAttribute("tag");
		obj = eval("desc_" + id);
		obj.innerText = obj.getAttribute("tag");
		obj = eval("img_" + id);
		obj.src = obj.getAttribute("tag");
	}
	catch(ex) {
		window.status = ex.description;
	}
}

function menuMouseOut(td) {
	try {
		with(td) {
			children[1].style.display = "none";
			with(children[0].style) {
				backgroundColor = "";
				color = "";
			}
		}
	}
	catch(ex) {
	}
}

function menuMouseOver(td) {
	try {
		with(td) {
			children[1].style.display = "";
			with(children[0].style) {
				backgroundColor = "#FFFFFF";
				color = "#990000";
			}
		}
	}
	catch(ex) {
	}
}

function showDialog(page, id) {
	try {
		return(window.showModalDialog("/" + page + ".aspx?id=" + id, "", "dialogHeight: 425px; dialogWidth: 606px; help: no; resizable: no; scroll: auto; status: no;"));
	}
	catch(ex) {
		alert(ex.description);
	}
}

function showHeadline(id, source, img) {
	try {
		var obj = eval("title_" + id);
//		obj.innerText = source.innerText.substr(0, source.innerText.length - 5);
		obj.innerHTML = source.getAttribute("tag");
		obj = eval("desc_" + id);
		obj.innerText = source.title;
		obj = eval("img_" + id);
		obj.src = img;
	}
	catch(ex) {
		window.status = ex.description;
	}
}

function showTab(index) {
	try {
		var table = event.srcElement.parentElement.parentElement.parentElement;
		for(var i = 0; i < table.tFoot.rows[0].cells.length; i++) {
			table.tFoot.rows[0].cells[i].className = i == index ? "TabSelected" : "Tab";
			table.tBodies[0].rows[i].style.display = i == index ? "" : "none";
		}
	}
	catch(ex) {
		window.status = ex.description;
	}
}

function showWindow(page, id) {
	try {
		var myWindow = window.open("/" + page + ".aspx?id=" + id, "myWindow", "height=325,menubar=0,width=406,resizable=1,scrollbars=1,status=0,toolbar=0");
		myWindow.focus();
	}
	catch(ex) {
		alert(ex.description);
	}
}

window.setInterval("blink()", 600);