function OpenPage(url,target)
{
//  open (url,target);
  parent.document.location.replace(url);
}

function OpenNewPage(url,target)
{
  open (url,target);
}

function SetCurrentTab()
{
  var pathname = parent.document.location.pathname;
  var fullfilename = pathname.substr(pathname.lastIndexOf("/")+1,pathname.length);
  var filename = fullfilename.split(".");
  var cell=document.getElementById(filename[0]);
  if (!cell)  // will be case on left side links
     {
       cell=parent.document.getElementById(filename[0]);
	 }
  if (cell)
     {	 
       switch (cell.className)
        {
	      case 'HeaderCell':
            cell.className='HeaderCellActive';
		    break;
		  case 'LeftSectionLinks':
		    cell.className='LeftSectionLinkActive';
		    break;  
		}
	 }
}

function OpenComboWindow(o,target)
{
   OpenPage(o.options[o.selectedIndex].value,target);
}

function SetComboValue()
{
	var pathname = parent.document.location.pathname;
    var fullfilename = pathname.substr(pathname.lastIndexOf("/")+1,pathname.length);  //get the file
	var combo=document.getElementById("Events");  //get the combo
	combo.value=fullfilename;  //set value of combo to page name
}

function ShowWarning()
{
    var w=document.getElementById('Warning');

	if(!readCookie('ShowWarning'))
	  {  // if cookie not found display the div and create the cookie
		w.style.visibility='visible';
        if(!createCookie('ShowWarning', 'ShowWarning', 1))  // 1 day = 24 hours persistence
          w.style.visibility='hidden';   //cookies not enabled
      }
    else
	 {  // if cookie found hide the div
	    w.style.visibility='hidden';
     }
}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
	return(readCookie('ShowWarning'));  //see if can read it to know if cookies enabled
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}

function ShowCalendar()
{
  var c=parent.document.getElementById('Calendar');
  c.style.visibility='visible';
  c.style.zIndex=100;
  return false;
}

function HideCalendar()
{
  var c=parent.document.getElementById('Calendar');
  c.style.zIndex=-1;
  c.style.visibility='hidden';
}
function ShowDART()
{
  var c=parent.document.getElementById('DART');
  c.style.visibility='visible';
  c.style.zIndex=100;
  return false;
}

function HideDART()
{
  var c=parent.document.getElementById('DART');
  c.style.zIndex=-1;
  c.style.visibility='hidden';
}
