// <script type="text/javascript">
<!--  to hide script contents from old browsers

window.onload = init;

function init()
{
	display_urhere();	
	startList();
}

/*******************************************************************************
This function works with the CSS to implement the drop down navigation bar.
*******************************************************************************/
startList = function() 
{
	if (document.all && document.getElementById) 
	{
		navRoot = document.getElementById("dmenu");
		for (i=0; i < navRoot.childNodes.length; i++) 
		{
			node = navRoot.childNodes[i];
			if (node.nodeName == "LI") 
			{
				node.onmouseover = function() 
				{
					this.className += " over";
				}
				node.onmouseout = function() 
				{
					this.className = this.className.replace(" over", "");
				}
			}
		}
	}
}

/*******************************************************************************
 This function alters the style of the navigation bar to indicate urhere.
I added code from the original to shorten the href string so that it does
not include any bookmarks (....#bookmark). Otherwise, the strings would not
match and the urhere formatting would not be applied.
******************************************************************************/

function display_urhere()
{	if (!document.getElementById)
	{	
		return true;
	}

	var list = document.getElementById("navbar");
	if (list == null)
		return;
		
	//var page = list.getElementsByTagName("a");
	var page = getElementsByClass("topmenutitle");
	var currentHref = document.location.href;

	var anchorPosition = currentHref.indexOf("#");
	if (anchorPosition >= 0)
	{	currentHref = currentHref.substring(0, anchorPosition);
	}

	currentHref = getSimpleHref(currentHref);

	for (var i = 0; i < page.length; i++)
	{	
		href = getSimpleHref(page[i].href)	
	
		if (href == currentHref)
		{	
			page[i].style.background = "#fff url(images/on_bg.gif) repeat-x top left";
			page[i].style.color = "#000";
			page[i].style.borderBottom = "none";
			break;
		}
	}
	
	display_sidebar_urhere("sidebar-content");
}

/**************************************************************************************************
This function was added because Mac Safari does not include the directory structure
before the href, so there was never a match. This function strips the beginning directory structure
away and just leaves the end part--such as about_us.htm
**************************************************************************************************/

function getSimpleHref(s)
{	var length;
	var anchorPosition = 0;	

	while (anchorPosition >= 0)
	{	anchorPosition = s.indexOf('/');
		length = s.length;

		if (anchorPosition >= 0)
		{	s = s.substring(anchorPosition + 1, length);
		}		
	}
	
	return(s);
}

/*******************************************************************************
This function sets the urhere for the sub navigation menu for the portfolio pages.
If there is no sub-nav ID on the page, then the function simply returns.
*******************************************************************************/

function display_subnav_urhere()
{	
	var href;
	
	var list = document.getElementById('sub-nav');
	
	if (list == null)
	{	
		return;
	}
	
	var page = list.getElementsByTagName("a");
	var currentHref = document.location.href;

	var anchorPosition = currentHref.indexOf("#");
	if (anchorPosition >= 0)
	{	currentHref = currentHref.substring(0, anchorPosition);
	}

	currentHref = getSimpleHref(currentHref);

	for (var i = 0; i < page.length; i++)
	{	
		href = getSimpleHref(page[i].href)	
	
		if (href == currentHref)
		{	
			page[i].style.color = "#f8dfb2";	
			page[i].style.backgroundColor = "#6e3631";
			//page[i].parentNode.style.background = "#fff";			// Parent node is <div>

			break;
		}
	}
}


/*******************************************************************************
This function displays all the Service & Support pages in a sidebar. These products 
are repeated on many pages, so each page only needs a function call to this routine 
to display.

No longer used. Replaced with inline code.
*******************************************************************************/

function display_services_sidebar()
{	if (!document.getElementById)
	{	
		return false;
	}
	
	document.writeln('<h2>Services</h2>');
	
	document.writeln('<ul>');
	document.writeln('<li><a href="toolbar_pictures.html">Toolbar Pictures</a></li>');
	document.writeln('<li><a href="ie_toolbars.html">Internet Explorer Toolbars</a></li>');
	document.writeln('<li><a href="firefox_netscape_mozilla.html">Firefox/Netscape/Mozilla Toolbars (Browser Extensions)</a></li>');
	document.writeln('<li><a href="bhos.html">Browser Helper Objects (BHOs)</a></li>');
	document.writeln('<li><a href="sidebars_explorer_bars.html">Sidebars, Deskbands, Explorer Bars</a></li>');
	document.writeln('<li><a href="outlook_plugins.html">Outlook Plug-ins</a></li>');
	document.writeln('<li><a href="specialties_talents.html">Other Specialties and Talents</a></li>');
	document.writeln('<li><a href="price_quotes.html">Price Quotes &amp; Requirements</a></li>');
	document.writeln('</ul>');

	display_sidebar_urhere("sidebar-content");
}

/*******************************************************************************
This function displays all the Service & Support pages in a sidebar. These products 
are repeated on many pages, so each page only needs a function call to this routine 
to display.

No longer used. Replaced with inline code.
*******************************************************************************/

function display_products_sidebar()
{	if (!document.getElementById)
	{	
		return false;
	}
	
	document.writeln('<h2>Products</h2>');
	
	document.writeln('<ul>');
	document.writeln('<li><a href="gsd_outlook_express.shtml">GSD Outlook Express Toolbar Kit</a></li>');
	document.writeln('<li><a href="gsd_capture_toolbar.shtml">GSD Capture Toolbar</a></li>');
	document.writeln('<li><a href="gsd_link_validator.shtml">GSD Link Validator</a></li>');
	document.writeln('</ul>');

	display_sidebar_urhere("sidebar-content");
}

/*******************************************************************************
This function displays all the Service & Support pages in a sidebar. These products 
are repeated on many pages, so each page only needs a function call to this routine 
to display.
*******************************************************************************/

function display_sidebar_urhere(id)
{	
	var list = document.getElementById(id);
	if (list == null)
		return;
		
	var page = list.getElementsByTagName("a");
	if (page == null)
		return;
	
	var currentHref = document.location.href;

	var anchorPosition = currentHref.indexOf("#");
	if (anchorPosition >= 0)
	{	currentHref = currentHref.substring(0, anchorPosition);
	}

	currentHref = getSimpleHref(currentHref);

	for (var i = 0; i < page.length; i++)
	{	
		href = getSimpleHref(page[i].href)	
	
		if (href == currentHref)
		{	
			page[i].style.color = "#fff";
			page[i].style.textDecoration = "none";	

			page[i].parentNode.style.background = "#26f none";			// Parent node is <li>
			page[i].parentNode.style.borderTop = "1px solid #008";
			page[i].parentNode.style.borderBottom = "1px solid #008";
				

			page[i].parentNode.marginRight = "-20px";	
			page[i].parentNode.paddingRight = "0px";	
			page[i].style.paddingRight = "0px";	

			break;
		}
	}
}

/*******************************************************************************
Simply add a class name to the beginning of the function and the 2nd and 3rd arguments are optional.
*******************************************************************************/
function getElementsByClass(searchClass, node, tag) 
{
	var classElements = new Array();

	if ( node == null )
		node = document;
	
	if ( tag == null )
		tag = '*';
	
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp('(^|\\s)'+searchClass+'(\\s|$)');
	
	for (i = 0, j = 0; i < elsLen; i++) 
	{
		if ( pattern.test(els[i].className) ) 
		{
			classElements[j] = els[i];
			j++;
		}
	}
	
	return (classElements);
}

/*******************************************************************************
The following function opens a new window. 
*******************************************************************************/
function new_window(page)
{	window.open(page, '', 'resizable=yes, scrollbars=yes');
	// window.open("js_about.htm", 'About', 'fullscreen=yes, scrollbars=yes');
	// window.open("js_about.htm", 'jav', 'width=800, height=1000, resizable=yes, scrollbars=yes');
} 

/*******************************************************************************
This originally did not work in Opera. Browser would not allow scrolling to bottom of screen.
So, added test for Opera browser. 
*******************************************************************************/
function new_window_full(page)
{	var str = "left=0,screenX=0,top=0,screenY=0, resizable=yes, scrollbars=yes";

	if (window.screen)
	{	var ah = screen.availHeight - 30;
		var aw = screen.availWidth - 10;
		str += ",height=" + ah;
		str += ",innerHeight=" + ah;
		str += ",width=" + aw;
		str += ",innerWidth=" + aw;
	}

	var browser_string = navigator.userAgent.toLowerCase();
	
	if (browser_string.indexOf('opera') >= 0)
	{	str = 'resizable=yes, scrollbars=yes';
	}

	window.open(page, '', str);
} 

/*******************************************************************************
Email functions to hide email address from spambots.
*******************************************************************************/

function email_gigasoft()
{	var name0 = "Email Us";
	var name1 = "support";
	var name2 = "GigaSoftDevelopment";
	var name3 = "com";
	var addr1 = name1 + "@" + name2 + "." + name3;

	var x1 = "gigasoftpeople";
	var x2 = "gmail";
	var x3 = "com";
	var addr2 = x1 + "@" + x2 + "." + x3;
	
	var y1 = "deborah.development";
	var y2 = "gmail";
	var y3 = "com";
	var addr3 = y1 + "@" + y2 + "." + y3;
	
	var full = "mail" + "to:" + addr1 + ',' + addr2 + ',' + addr3;
	
	document.write(name0.link(full));
}


// end hiding contents from old browsers  -->
// </script>

