var mrMac = (navigator.userAgent.indexOf('Mac') != -1);

/*

Accesible Pop Up Code

This file contains only functions necessary for the article features
The full library code and enhanced versions of the functions present
here can be found at http://v2studio.com/k/code/lib/

MISC CLEANING-AFTER-MICROSOFT STUFF

isUndefined(v)
    returns true if [v] is not defined, false otherwise

    IE 5.0 does not support the undefined keyword, so we cannot do a direct
    comparison such as v===undefined.
*/

// MISC CLEANING-AFTER-MICROSOFT STUFF

function isUndefined(v) {
    var undef;
    return v===undef;
}

function SetSearchIndicator(type)
{
	var indicator = document.getElementById("hdnSearchFlag");
	if(indicator != null)
		indicator.value = type;
}

// These defaults should be changed the way it best fits your site
var _POPUP_FEATURES = '';

function raw_popup(url, target, features) {
    // pops up a window containing url optionally named target, optionally having features
    if (isUndefined(features)) features = _POPUP_FEATURES;
    if (isUndefined(target  )) target   = '_blank';
    var theWindow = window.open(url, target, features);
    theWindow.focus();
    return theWindow;
}

function link_popup(src, features) {
    // to be used in an html event handler as in: <a href="..." onclick="link_popup(this,...)" ...
    // pops up a window grabbing the url from the event source's href
    return raw_popup(src.getAttribute('href'), src.getAttribute('target') || '_blank', features);
}

function collapse(intCatId)
{
	var oldState = GetMyObjectByID(intCatId).states;
	var o = GetMyObjectByID(intCatId);
	
	if(oldState == "shown" || !oldState)
	{
		document.getElementById(intCatId+ 'expand' ).style.display= 'block';
		document.getElementById(intCatId+ 'closethis' ).style.display= 'none';
		document.getElementById(intCatId).style.display= 'none';
		o.states = "hidden";
	}
	else
	{
		document.getElementById(intCatId+ 'expand' ).style.display= 'none';
		document.getElementById(intCatId+ 'closethis' ).style.display= 'block';
		o.style.display= 'block';
		o.states = "shown";

	}
}

function GetMyObjectByID(itemID)
{
	// In the future will need to build in the ability to handle v4 netscape browsers.
  if (document.getElementById) // Good browsers
		return document.getElementById(itemID)
	else if (document.all) // medium browsers
    return document.all[itemID];
}


function WaitHere(where)
{
	var max  = (where*1000);
	var s = "";
	for(var x = 0;x<=max;x++)
	{
		s+="af ";
	}	
}


function ShowPage(e)
{
	var s = e.options[e.selectedIndex].value;
	if(s.length > 0)
	{
		document.location.href = s;
	}
}
