﻿function SmallFont() {

document.getElementById('content_body_text').style.fontSize = '100%'; 
}
function LargeFont() {

document.getElementById('content_body_text').style.fontSize = '150%'; 
}

function PlayVideo(filename, VideoName, VideoDescription, lblVideoName, lblVideoDescription){

    var so = new SWFObject("media/swf/video_player.swf", "homepage", "400", "300", "8", "#000000");
    so.addParam("FlashVars", "VideoPath=../../media/flv/"+filename);
    so.write("flashcontent");
    
    document.getElementById(lblVideoName).innerHTML = VideoName;
    document.getElementById(lblVideoDescription).innerHTML = VideoDescription;
}

function PlayLegislatorVideo(filename){

    var so = new SWFObject("media/swf/video_player.swf", "homepage", "300", "225", "8", "#000000");
    so.addParam("FlashVars", "VideoPath=../../media/flv/"+filename);
    so.write("flashcontent");
   
}

//Row Highlighting Effects
function Highlight(row, color)
{
row.style.backgroundColor=color;
}
function UnHighlight(row, color)
{
row.style.backgroundColor=color;
}

function open_Window(url, n, w, h, sb, r, mb, tb, s, loc, dir)
{
  var screenWidth = window.screen.availWidth;
  var screenHeight = window.screen.availHeight;

  var offsetXWinXP = 5;
  var offsetYWinXP = 18;

  var halfScreenWidth = Number(window.screen.availWidth / 2);
  var halfScreenHeight = Number(window.screen.availHeight / 2);

  var halfWindowWidth = Number(w / 2);
  var halfWindowHeight = Number(h / 2);

  var diffWidth = Number(halfScreenWidth-halfWindowWidth);
  var diffHeight = Number(halfScreenHeight-halfWindowHeight);

  diffWidth -= offsetXWinXP;
  diffHeight -= offsetYWinXP;
  
  var windowName = n;
  
  if (windowName.length == 0)
  {
    //The windowName is a zero-based integer corresponding to the number of milliseconds
    //since January 1, 1970, to the date specified by the instance of the Date object;
    //therefore, the windowName will almost always be unique.
    var dtm = new Date();
    windowName = dtm.getTime();
  }
  
  //if (url == null) { url = "" };
  if (w == null) { w = 640 };
  if (h == null) { h = 480 };
  if (sb == null) { sb = "no" };
  if (r == null) { r = "no" };
  if (mb == null) { mb = "no" };
  if (tb == null) { tb = "no" };
  if (s == null) { s = "no" };
  if (loc == null) { loc = "no" };
  if (dir == null) { dir = "no" };

  var features = new StringBuilder();
  features.Append("directories=" + dir + ",");
  features.Append("location=" + loc + ",");
  features.Append("menubar=" + mb + ",");
  features.Append("resizable=" + r + ",");
  features.Append("scrollbars=" + sb + ",");
  features.Append("status=" + s + ",");
  features.Append("toolbar=" + tb +",");
  features.Append("width=" + w + ",");
  features.Append("height=" + h + ",");
  features.Append("top=" + diffHeight + ",");
  features.Append("left=" + diffWidth);
  
  return window.open(url, windowName, features.ToString());
}


function print_Friendly(contentId, title)
{
  var content = document.getElementById(contentId);
  
  if (content != null)
  {
    var friendly = open_Window("", "", 640, 480, "yes", "yes", "yes");
    
    var sb = new StringBuilder();
    sb.AppendLine("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">");
    sb.AppendLine("<html xmlns=\"http://www.w3.org/1999/xhtml\">");
    sb.AppendLine("<head>");
    sb.AppendLine("  <title>" + title + "</title>");
    sb.AppendLine("  <style type=\"text/css\">");
    sb.AppendLine("    body { font-family: Verdana; font-size: 0.75em; }");
    sb.AppendLine("  </style>");
    sb.AppendLine("</head>");
    sb.AppendLine("<body>");
    sb.AppendLine(content.innerHTML);
    sb.AppendLine("</body>");
    sb.AppendLine("</html>");

    friendly.document.write(sb.ToString());
    friendly.document.close();
    
    friendly.print();
  }
}


// Initializes a new instance of the StringBuilder class
// and appends the given value if supplied
function StringBuilder(value)
{
    this.strings = new Array("");
    this.Append(value);
}

// Appends the given value to the end of this instance.
StringBuilder.prototype.Append = function (value)
{
    if (value)
    {
        this.strings.push(value);
    }
}

// Appends the given value to the end of this instance.
StringBuilder.prototype.AppendLine = function (value)
{
    if (value)
    {
        this.strings.push(value + "\n");
    }
}

// Clears the string buffer
StringBuilder.prototype.Clear = function ()
{
    this.strings.length = 1;
}

// Converts this instance to a String.
StringBuilder.prototype.ToString = function ()
{
    return this.strings.join("");
}