function get_firstchild(n)
{
	x=n.firstChild;
	while (x.nodeType!=1)
		x=x.nextSibling;
	return x;
}

function change_subpage_content(id)
{
	var root;
	var divs;
	var i;
	root = document.getElementById("main_contents");
	if (id == null) {
		get_firstchild(root).style.display = "block";
		return;
	}

	divs = root.childNodes;
	for (i = 0; i < divs.length; i++) {
		if (divs[i].nodeType == 1)
			divs[i].style.display = "none";
	}
			
	var disp;
	disp = document.getElementById(id)
	if (disp == null)
		disp = get_firstchild(root);
	disp.style.display = "block";
}

function check_subframe()
{
	if(self == top)
		window.location = "http://www.halsign.com";
}

function check_anchor()
{
	var strurl = window.location;
	var patt = new RegExp("#[^#]*$");
	var result = patt.exec(strurl);
	if (result == null)
		change_subpage_content(null);
	else
		change_subpage_content(new String(result).substring(1));
}

function sub_frame_load(h)
{

	if(self == top)
	{
		window.location = "http://www.halsign.com";
		return;
	}

	var strurl = window.location;
	var patt = new RegExp("#[^#]*$");
	var result = patt.exec(strurl);
	alert(result);
	if (result == null)
		return;

	change_subpage_content(new String(result).substring(1));
}