function getCookie(name) {
	var dc = document.cookie;
	var prefix = name + "=";
	var begin = dc.indexOf("; " + prefix);

	if (begin == -1) {
		begin = dc.indexOf(prefix);
		if (begin != 0) return null;
	} else {
		begin += 2;
	}

	var end = document.cookie.indexOf(";", begin);
	if (end == -1) {
		end = dc.length;
	}
	return unescape(dc.substring(begin + prefix.length, end));
}

/* use this function to set a cookie if u know the end date */
function setCookie(name, value, expires, path, domain) {
	cookieString = name + "=" + escape(value) +
		((expires) ? "; expires=" + expires.toUTCString() : "") +
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "");
	document.cookie = cookieString;
}

/* use this function to set a cookie if u want to add a cookie that adds years to today's date (expires = # of yrs to add) */
function setCookieYear(name, value, expires, path, domain) {
	var d = new Date();
	d.setFullYear(d.getFullYear()+expires);
	cookieString = name + "=" + escape(value) +
		((expires) ? "; expires=" + d : "") +
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "");
	document.cookie = cookieString;
}

/* use this function to set a cookie if u want to add a cookie that adds months to today's date (expires = # of months to add) */
function setCookieMonth(name, value, expires, path, domain) {
	var d = new Date();
	d.setMonth(d.getMonth()+expires);
	cookieString = name + "=" + escape(value) +
		((expires) ? "; expires=" + d : "") +
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "");
	document.cookie = cookieString;
}

/* use this function to set a cookie if u want to add a cookie that adds days to today's date (expires = # of days to add) */
function setCookieDay(name, value, expires, path, domain) {
	var d = new Date();
	d.setDate(d.getDate()+expires);
	cookieString = name + "=" + escape(value) +
		((expires) ? "; expires=" + d : "") +
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "");
	document.cookie = cookieString;
}


function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function otherLinkPopUp(fileName) {
	myFloater = window.open('')
	myFloater.location.href = fileName;
}

// Correctly handle PNG transparency in Win IE 5.5 or higher.
// http://homepage.ntlworld.com/bobosola. Updated 02-March-2004

function correctPNG()
   {
   for(var i=0; i<document.images.length; i++)
      {
	  var img = document.images[i]
	  var imgName = img.src.toUpperCase()
	  if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
	     {
		 var imgID = (img.id) ? "id='" + img.id + "' " : ""
		 var imgClass = (img.className) ? "class='" + img.className + "' " : ""
		 var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
		 var imgStyle = "display:inline-block;" + img.style.cssText
		 if (img.align == "left") imgStyle = "float:left;" + imgStyle
		 if (img.align == "right") imgStyle = "float:right;" + imgStyle
		 if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
		 var strNewHTML = "<span " + imgID + imgClass + imgTitle
		 + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
	     + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
		 + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
		 img.outerHTML = strNewHTML
		 i = i-1
	     }
      }
   }
window.attachEvent("onload", correctPNG);

/* FUNCTION TO CHANGE THE CONTENT OF THE IFRAME ON THE TABS ON THE HOMEPAGE */
function changeMainTab(newUrl,height) {
   if(document.getElementById && !(document.all)) {
      document.getElementById('mainFrame').style.height = height;
      document.getElementById('mainFrame').src = newUrl;
   }
   else if(document.all) {
      document.all.mainFrame.style.height = height;
      document.all.mainFrame.src = newUrl;
   }
}

