var swind = null;

function UnloadWindow() {
	if (swind) {
		swind.close();
		swind = null;
	}
}

function ShowFullSample(src, owidth, oheight) {
	var width = owidth + 40;
	var height = oheight + 80;
	if (swind) {
		try {
			swind.close();
		} catch (e) {
		}
		swind = null;
	}
	swind = window.open('', 'sample', 'width='+width+',height='+height+',resizable=yes,scrollbars=yes,menubar=yes');
	swind.document.write( "<html><head><title>Sample image</title><style>a {color: $darkcol; text-decoration: none; font-family: verdana, helvetica, sans-serif; font-size: 12px;} a:hover {text-decoration: underline;}</style></head><body><center><img src='"+src+"' width='"+owidth+"' height='"+oheight+"' /><br /><p><a href='javascript:window.close();'>Close this window</a></p></center></body></html>" );
	swind.document.close();
}

function OpenSubsWindow() {
	var width = 500;
	var height = 500;
	if (swind) {
		try {
			swind.close();
		} catch (e) {
		}
		swind = null;
	}
	swind = window.open('/subscriptions.html', 'subs', 'width='+width+',height='+height+',resizable=yes,scrollbars=yes,menubar=yes');
}

function validateRegForm() {
	var f = document.forms["regform"];
	if (f.ineu[0].checked) {
		f.inuk[0].disabled = false;
		f.inuk[1].disabled = false;
		if (f.inuk[0].checked) {
			f.business[0].disabled = false;
			f.business[1].disabled = false;
		} else {
			f.business[0].checked = false;
			f.business[0].disabled = true;
			f.business[1].checked = false;
			f.business[1].disabled = true;
		}
	} else {
		f.inuk[0].checked = false;
		f.inuk[0].disabled = true;
		f.inuk[1].checked = false;
		f.inuk[1].disabled = true;
		f.business[0].checked = false;
		f.business[0].disabled = true;
		f.business[1].checked = false;
		f.business[1].disabled = true;
	}
}

function FixBox(elem) {
	if (elem.value == 'Enter surname') {
		elem.value='';
	}
	if (elem.style) {
		elem.style.color = 'black';
	}
}

function UnfixBox(elem) {
	if (elem.value == '') {
		elem.value='Enter surname';
		if (elem.style) {
			elem.style.color = 'red';
		}
	}
}

function AddBookmark(url, name) {
	if (navigator.appName == "Microsoft Internet Explorer") {
		window.external.AddFavorite(url, name);
	} else if (window.sidebar && window.sidebar.addPanel) {
		window.sidebar.addPanel(name, url, "");
	} else {
		alert("Sorry! Your browser doesn't support this function. Please manually add the bookmark from the browser menu.");
	}
}

var bubbleTimer = window.setTimeout("hideBubble();", 5000);
function hideBubble() {
	bubbleTimer = null;
	var elem = document.getElementById("currencybubble");
	if (elem)
		elem.style.display = "none";
}

function bubbleOver() {
	if (bubbleTimer != null)
		window.clearTimeout(bubbleTimer);
	var elem = document.getElementById("currencybubble");
	if (elem)
		elem.style.display = "block";
}

function bubbleOut() {
	if (bubbleTimer != null)
		window.clearTimeout(bubbleTimer);
	bubbleTimer = window.setTimeout("hideBubble();", 500);
}


