var browserVer=navigator.appVersion;
var platform=navigator.platform;
var buttonID = null;

if(navigator.appName == 'Netscape') {
	platform.match('Win') ?
		document.write('<link type="text/css" rel="stylesheet" href="http://www.neosnetworksweb.co.uk/css/netscape_pc.css?id=2" />'):
		document.write('<link type="text/css" rel="stylesheet" href="http://www.neosnetworksweb.co.uk/css/netscape.css?id=2" />');
}
	
//window.onresize = resizeCopy;

function chat() {
	alert('What\'s supposed to happen here?');
}

function contact() {
	location = '/contact_us.html';
}

function download(doc) {
	location = '/docs/'+doc;
}

function goTo(link) {
	location = link;
}

function init() {
	resizeCopy();
}

function hideSub(id) {
	var status = document.getElementById('nav'+id).style;
	var button = document.getElementById('nav1_'+id).style;
	
	buttonID = null;
	
	status.display = 'none';
	button.backgroundColor = '';
}

function openWindow(link, width, height) {
	if(!width) width = 200;
	if(!height) height = 420;
	window.open(link, 'SSE Telecoms', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,height='+height+',width='+width);
}

function popup() {
	var popup = document.getElementById("popup");
	popup.style.display == "block" ?
		popup.style.display = "none" :
		popup.style.display = "block" ;
}

function resizeCopy() {
	var thisFrame = document.getElementById('copy');
	var posTop = document.getElementById('copy').offsetTop;
	if(typeof(window.innerHeight) == 'number') {
		var maxHeight = (window.innerHeight - 250) - posTop;
	} else {
		var maxHeight = (document.documentElement.clientHeight - 250) - posTop;
	}

	thisFrame.style.height = maxHeight + 'px';
}

function showNews(page) {
	location = '/news/'+page;
}

function showContact(type, on) {
	var state1 = document.getElementById(type+'H');
	var state2 = document.getElementById(type);
	
	if(on) {
		state1.style.display = 'block';
		state2.style.display = 'none';
	} else {
		state1.style.display = 'none';
		state2.style.display = 'block';
	}
}

function showSub(id) {
	var status = document.getElementById('nav'+id).style;
	var button = document.getElementById('nav1_'+id).style;
	
	buttonID = id;
	
	status.display = 'block';
	button.backgroundColor = 'rgb(97, 114, 161)';
}