function GetCookieValue(sName)
{
  var aCookie = document.cookie.split("; ");

  for (var i=0; i < aCookie.length; i++)
  {
    var aCrumb = aCookie[i].split("=");
    if (sName == aCrumb[0]) 
      return unescape(aCrumb[1]);
  }

  return null;
}

function SetCookie(cookieName, cookieValue)
{
	cookieValue = escape(cookieValue);
	document.cookie = cookieName + "=" + cookieValue;
}

function OpenPopUp(url,width,height)
{
    var strFeatures = 'width=' + width + ',height=' + height + ',scrollbars=yes,resizable=yes,' + 'top=' + (screen.height-height) / 2 +  ',left=' + (screen.width-width) / 2;
    window.open(url,'_PopUp',strFeatures,false);
}

function OpenFSPopUp(url)
{
    var strFeatures = 'width=' + screen.width + ',height=' + screen.height + ',scrollbars=yes,resizable=yes,' + 'top=0,left= 0';
    window.open(url,'_PopUp2',strFeatures,'');
}

function OpenFrame(url, frameId)
{
    window.open(url,frameId, '','');
}

function OpenDoubleFrame(url1, frameId1, url2, frameId2)
{
    window.open(url1, frameId1, '','');
    window.open(url2, frameId2, '','');
}

function BeginTable(Title, TableWidth, TableHeight, BackColor)
{
	document.write("<table cellSpacing='0' cellPadding='0' border='0' width='" + TableWidth + "'>\n");
	document.write("<tr width='100%'>\n");
	document.write("<td background='images/barleft.bmp' height='24' width='24'>\n");
	document.write("<td background='images/barcenter.bmp' height='24' class='style1'>\n");
	document.write(Title);
	document.write("</td>\n");
	document.write("<td background='images/barright.bmp' height='24' width='24' />\n");
	document.write("</tr>\n");
	document.write("</table>\n");
	document.write("<Table CellSpacing='0' CellPadding='0' width='" + TableWidth + "' height='" + TableHeight + "' bgColor='" + BackColor + "'");
	document.write("style='BORDER-RIGHT: #7f7f7f 1px solid; BORDER-LEFT: #7f7f7f 1px solid; BORDER-BOTTOM: #7f7f7f 1px solid; BORDER-COLLAPSE: collapse'> \n");
}

function EndTable()
{
	document.write("</table>\n");
}

function Table(TableId, Title, TableWidth, TableHeight, BackColor)
{
	document.write("<table cellSpacing='0' cellPadding='0' border='0' width='" + TableWidth + "'>\n");
	document.write("<tr width='100%'>\n");
	document.write("<td background='images/barleft.bmp' height='24' width='24'>\n");
	document.write("<td background='images/barcenter.bmp' height='24' class='style1'>\n");
	document.write(Title);
	document.write("</td>\n");
	document.write("<td background='images/barright.bmp' height='24' width='24' />\n");
	document.write("</tr>\n");
	document.write("</table>\n");
	document.write("<Table CellSpacing='0' CellPadding='0' width='" + TableWidth + "' height='" + TableHeight + "' bgColor='" + BackColor + "'");
	document.write("style='BORDER-RIGHT: #5e789b 1px solid; BORDER-TOP: #5e789b 0px solid; BORDER-LEFT: #5e789b 1px solid; BORDER-BOTTOM: #5e789b 1px solid; BORDER-COLLAPSE: collapse'> \n");
	document.write("<tr><td><div width='100%' height='100%' id='" + TableId + "'> \n");
	document.write("</div></td></tr></table> \n");
}

function EmptySpace(hgt)
{
	document.write("<table><tr><td style='FONT-SIZE: 1px;' Height='" + hgt + "'>&nbsp;</td></tr></table>");
}