var global_width = 475;
var global_height = 550;
var global_left = 150;
var global_top = 100;

function popwindow (fname)
{
	var popup_features = "width=" + global_width + ", height=" + global_height + ", left=" + global_left + ", top=" + global_top + ", resizable=yes, scrollbars=yes";
	window.open(fname,"_blank", popup_features );
}

function custompopwindow (fname,width,height,left,top)
{
	var popup_features = "";
	if((width != null) && (width != ""))
	{
		popup_features = popup_features + "width=" + width;
	}
	else
	{
		popup_features = popup_features + "width=" + global_width;
	}
	if((height != null) && (height != ""))
	{
		popup_features = popup_features + ", height=" + height;
	}
	else
	{
		popup_features = popup_features + ", height=" + global_height;
	}
	if((left != null) && (left != ""))
	{
		popup_features = popup_features + ", left=" + left;
	}
	else
	{
		popup_features = popup_features + ", left=" + global_left;
	}
	if((top != null) && (top != ""))
	{
		popup_features = popup_features + ", top=" + top;
	}
	else
	{
		popup_features = popup_features + ", top=" + global_top;
	}
	popup_features = popup_features + ", resizable=yes, scrollbars=yes";
	window.open(fname,"_blank", popup_features);
}

function popupwindow(parent, fname)
{
		 parent.href="#";
		 popwindow(fname);
		 return false;
}

function custompopupwindow(parent, fname, width, height, left, top)
{
		 parent.href="#";
		 custompopwindow(fname,width,height,left,top);
		 return false;
}

function popwindow_TVC(fname)
{
	window.open(fname,"_blank", "width=392, height=368, left=1, top=1, resizable=no, scrollbars=no" )
}


function hrefHighLight()
{
	var file_url = window.location.href;
	var file_name = file_url;
	var top_count = 1;
	var top_str = "linkid" + top_count;
	while(document.getElementById(top_str) != null)
	{
		var top_td_str = "tdataid" + top_count;
		var top_href = document.getElementById(top_str).href;
		var regex_glossary = /\/public\/glossary\/Glossary\-\w\.htm/i;
		var matches_top_href = top_href.match(regex_glossary);
		var matches_file_name = file_name.match(regex_glossary);
		if(top_href == file_name)
		{
			if(document.getElementById(top_str).className == "SideMenu")
			{
				document.getElementById(top_td_str).className = "Lnav_highlight";
				document.getElementById(top_str).className = "Lnav_highlight";
			}
			else
			{
				document.getElementById(top_td_str).className = "SideMenuSub_Blue";
				document.getElementById(top_str).className = "SideMenuSub_Blue";
			}
			document.getElementById(top_str).style.textDecoration="none";
			document.getElementById(top_str).style.cursor="default";			
			document.getElementById(top_td_str).style.cursor="default";			
			document.getElementById(top_str).href="#";
			document.getElementById(top_str).onClick="return false;";
		}
		else if((matches_top_href != null) & (matches_file_name != null))
		{
			if(document.getElementById(top_str).className == "SideMenu")
			{
				document.getElementById(top_td_str).className = "Lnav_highlight";
				document.getElementById(top_str).className = "Lnav_highlight";
			}
			else
			{
				document.getElementById(top_td_str).className = "SideMenuSub_Blue";
				document.getElementById(top_str).className = "SideMenuSub_Blue";
			}
			document.getElementById(top_str).style.textDecoration="none";
			document.getElementById(top_str).style.cursor="default";			
			document.getElementById(top_td_str).style.cursor="default";			
			document.getElementById(top_str).href="#";
			document.getElementById(top_str).onClick="return false;";
		}
		else
		{
			document.getElementById(top_td_str).className = "";
		}
		top_count = top_count + 1;
		top_str = "linkid" + top_count;
	}
}
