<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
// Given "Foo", returns "images/Foo.gif".

function regularImageFile(imageName) {
  return("../images/nav/" + imageName + ".gif");
}

// Given "Bar", returns "images/Bar-on.gif".

function negativeImageFile(imageName) {
  return("../images/nav/" + imageName + "-on.gif");
}

// Cache image at specified index. E.g., given index 0,
// take imageNames[0] to get "Home". Then preload 
// images/Home.gif and images/Home-Negative.gif.

function cacheImages(index) {
  regularImageObjects[index] = new Image(150, 30);
  regularImageObjects[index].src =
    regularImageFile(imageNames[index]);
  negativeImageObjects[index] = new Image(150, 30);
  negativeImageObjects[index].src =
    negativeImageFile(imageNames[index]);
}

imageNames = new Array();

regularImageObjects = new Array(imageNames.length);
negativeImageObjects = new Array(imageNames.length);

// Put images in cache for fast highlighting.
for(var i=0; i<imageNames.length; i++) {
  cacheImages(i);
}

// This is attached to onMouseOver -- change image
// under the mouse to negative (reverse video) version.

function highlight(imageName) {
  document.images[imageName].src = negativeImageFile(imageName);
}

// This is attached to onMouseOut -- return image to
// normal.

function unHighlight(imageName) {
  document.images[imageName].src = regularImageFile(imageName);
}

// This retieves the value of a cookie
function getCookieValue(cookieName)
{
	var cookieValue = document.cookie;
	var cookieStartsAt = cookieValue.indexOf(" " + cookieName + "=");
	
	if (cookieStartsAt == -1 )
	{
		cookieStartsAt = cookieValue.indexOf(cookieName + "=");
	}
	if (cookieStartsAt == -1 )
	{
		cookieValue = null;
	}
	else
	{
		cookieStartsAt = cookieValue.indexOf("=", cookieStartsAt) + 1;
		var cookieEndsAt = cookieValue.indexOf(";", cookieStartsAt);
		if (cookieEndsAt == -1)
		{
		    cookieEndsAt = cookieValue.length;
		}
		cookieValue = unescape(cookieValue.substring(cookieStartsAt,cookieEndsAt));
	}
	return cookieValue;
}
// Check if user is logged in
function CheckLogin ()
{
   if (getCookieValue('Login') == null ){
      login = false;
   }
   else {
   	   login = true;
   }
   return login;
}

// parse url to retrieve variables
function ParseQuery()
{
	var Hash = new Array();
	var url = document.location.href;
	if (url.indexOf('?') == -1)
         return -1;
	var Pairs = document.location.href.split('?')[1].split('&');
	for (var i = 0; i < Pairs.length; i++)
	{
		var OnePair = Pairs[i].split('=');
		Hash[OnePair[0]] = OnePair[1];
	}
	return Hash;
}
// Replacing text within a string with another item of text 
function replace(string,text,by) {
// Replaces text with by in string
    var strLength = string.length, txtLength = text.length;
    if ((strLength == 0) || (txtLength == 0)) return string;

    var i = string.indexOf(text);
    if ((!i) && (text != string.substring(0,txtLength))) return string;
    if (i == -1) return string;

    var newstr = string.substring(0,i) + by;

    if (i+txtLength < strLength)
        newstr += replace(string.substring(i+txtLength,strLength),text,by);

    return newstr;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
