function Copyright(Year, Name, URL)
{
   document.write('<hr size="2" color="#000000"/>');
   document.write('<font size="2">');
   if ((URL == null) && ((Name == null) || (Name == 'Bassam Abdul-Baki')))
   {
      URL = 'http://home.comcast.net/~babdulbaki/';
   }
   if (URL != null)
   {
      document.write('<a href="');
      document.write(URL);
      document.write('">');
   }
   if (Name != null)
   {
      document.write(Name);
   }
   else
   {
      document.write('Bassam Abdul-Baki');
   }
   if (URL != null)
   {
      document.write('</a>');
   }
   document.write(' &copy; ');
   document.write(Year);
   document.write(' (All Rights Reserved)</font>');
}

function blurLink()
{
   if (this.blur)
   {
      this.blur();
   }
}

function removeFocusOnAllLinks()
{
   var linksLength = document.links.length;

   for (var i = 0; i < linksLength; i++)
   {
      document.links[i].onfocus = blurLink;
   }
}

function displayFeedMZ(XMLFile, XSLFile)
{
   netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
   var xsltProcessor = new XSLTProcessor();
   // Load the xml file.
   var myXHR = new XMLHttpRequest();
   myXHR.open("GET", XMLFile, false);
   myXHR.send(null);
   if (XSLFile == null) {
      var xmlSource = (new DOMParser()).parseFromString(myXHR.responseText, "text/xml");
      var xmlType = xmlSource.documentElement.nodeName;
      if (xmlType == 'rss')
      {
         XSLFile = './includes/xsl/rss.xsl';
      }
      else if ((xmlType == 'rdf') || (xmlType == 'rdf\:RDF'))
      {
         XSLFile = './includes/xsl/rdf.xsl';
      }
   }
   // Load the xslt file.
   myXHR = new XMLHttpRequest();
   var sXSLFile = location.href.substring(0, location.href.lastIndexOf('/')) + XSLFile.substring(1, XSLFile.length - 1);
   myXHR.open("GET", sXSLFile, false);
   myXHR.send(null);
   // Get the XML document.
   xslStylesheet = myXHR.responseXML;
   xsltProcessor.importStylesheet(xslStylesheet);
   // Load the xml file.
   myXHR = new XMLHttpRequest();
   myXHR.open("GET", XMLFile, false);
   myXHR.send(null);
   //var xmlSource = myXHR.responseXML;
   var xmlSource = (new DOMParser()).parseFromString(myXHR.responseText, "text/xml");
   // Transform.
   var resultDocument = xsltProcessor.transformToDocument(xmlSource);
   alert(resultDocument);
   alert(myXHR.responseText);
   var sResult = resultDocument.childNodes[0].nodeValue;
   //if (sResult.indexOf("<transformiix:result") > -1)
   //   sResult = sResult.substring(sResult.indexOf(">") + 1, sResult.lastIndexOf("<"));
   alert(sResult);
   RSSDisplay.appendChild(resultDocument.xml);
}

function displayFeedIE(XMLFile, XSLFile)
{
   // Load XML.
   var xmlDOM, xslDOM;
   var progIDs = ['Msxml2.DOMDocument.6.0', 'Msxml2.DOMDocument.3.0'];
   for (var i = 0; i < progIDs.length; i++) {
      try {
         xmlDOM = new ActiveXObject(progIDs[i]);
         xslDOM = new ActiveXObject(progIDs[i]);
      }
      catch (ex) {
      }
   }
   xmlDOM.async = false;
   if (!xmlDOM.load(XMLFile))
   {
      RSSDisplay.innerHTML = "<iframe src='" + XMLFile + "' width='1024' height='768' frameborder='0' framespacing='0'></iframe>";
      return;
   }
   if (XSLFile == null)
   {
      var xmlType = xmlDOM.documentElement.nodeName;
      if (xmlType == 'rss')
      {
         XSLFile = './includes/xsl/rss.xsl';
      }
      else if ((xmlType == 'rdf') || (xmlType == 'rdf\:RDF'))
      {
         XSLFile = './includes/xsl/rdf.xsl';
      }
   }
   if (XSLFile != null)
   {
     // Load the XSL.
     xslDOM.async = false;
     xslDOM.load(location.href.substring(0, location.href.lastIndexOf('/') + 1) + XSLFile);
     // Transform.
     RSSDisplay.innerHTML = xmlDOM.transformNode(xslDOM);
   }
   else
   {
     // Transform.
     RSSDisplay.innerHTML = xmlDOM;
   }
   RSSDisplay.style.border = "0px solid #000000";
   RSSDisplay.style.padding = "0px";
}

function displayFeed(XMLFile, XSLFile)
{
   // Mozilla, Safari, ... .
   if (window.ActiveXObject)
   {
      displayFeedIE(XMLFile, XSLFile);
   }
   // Internet Explorer.
   else if (window.XMLHttpRequest)
   {
      displayFeedMZ(XMLFile, XSLFile);
   }
   // Unknown browser.
   else
   {
      alert("This type of browser is not supported!");
   }
}

function showhide(layer_ref)
{
   hza = document.getElementById(layer_ref);
   state = hza.style.display;
   if (state == 'block')
   {
      state = 'none';
   }
   else
   {
      state = 'block';
   }
   // Is IE 4 or 5 (or 6 beta).
   if (document.all)
   {
      eval("document.all." + layer_ref + ".style.display = state");
   }
   // Is NETSCAPE 4 or below.
   if (document.layers)
   {
      document.layers[layer_ref].display = state;
   }
   if (document.getElementById && !document.all)
   {
      hza = document.getElementById(layer_ref);
      hza.style.display = state;
   }
}

function ShowGoogleAd()
{
   document.write('<script type="text/javascript">');
   document.write('google_ad_client = "pub-8743897978094352";');
   document.write('google_ad_width = 120;');
   document.write('google_ad_height = 600;');
   document.write('google_ad_format = "120x600_as";');
   document.write('google_ad_type = "text_image";');
   document.write('google_ad_channel ="";');
   document.write('</script>');
   document.write('<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>');
}

function ShowGoogleSearch()
{
   document.write('<!-- Search Google -->');
   document.write('<center>');
   document.write('<form method="get" action="http://www.google.com/custom" target="_top">');
   document.write('<table bgcolor="#ffffff">');
   document.write('<tr><td nowrap="nowrap" valign="top" align="left" height="32">');
   document.write('<a href="http://www.google.com/">');
   document.write('<img src="http://www.google.com/logos/Logo_25wht.gif" border="0" alt="Google" align="middle"></img></a>');
   document.write('<input type="text" name="q" size="31" maxlength="255" value=""></input>');
   document.write('<input type="submit" name="sa" value="Search"></input>');
   document.write('<input type="hidden" name="client" value="pub-8743897978094352"></input>');
   document.write('<input type="hidden" name="forid" value="1"></input>');
   document.write('<input type="hidden" name="ie" value="ISO-8859-1"></input>');
   document.write('<input type="hidden" name="oe" value="ISO-8859-1"></input>');
   document.write('<input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1;"></input>');
   document.write('<input type="hidden" name="hl" value="en"></input>');
   document.write('</td></tr></table>');
   document.write('</form>');
   document.write('</center>');
   document.write('<!-- Search Google -->');
}

function SetCookie(Software, Rating)
{
   var date = new Date();
   date.setTime(date.getTime()+(100*365*24*60*60*1000));
   document.cookie = Software + "=" + Rating + "; expires=" + date.toGMTString() + "path=/";
}

function ReadCookie(Software)
{
   var SoftwareEQ = Software + "=";
   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(SoftwareEQ) == 0)
      {
         return parseInt(c.substring(SoftwareEQ.length, c.length), 10);
      }
   }
   return 0;
}

function getversion()
{
   if(navigator.appName.indexOf("Netscape")>-1)
   {
      make="Netscape";
   }
   else if((navigator.appName.indexOf("Microsoft")>-1) || (navigator.appName.indexOf("MSIE")>-1))
   {
      make="Microsoft Internet Explorer";
   }
   else if(navigator.appName.indexOf("Opera")>-1)
   {
      make="Opera";
   }
   else
   {
      make=navigator.appName;
   }
   version=parseInt(navigator.appVersion, 10);
   details=make+"-"+version;
   return details;
}

function ExpandCollapse(postid)
{
   whichpost = document.getElementById(postid + "L");
   whichnode = document.getElementById(postid + "T");
   if (whichpost.className == "postshown")
   {
      whichpost.className = "posthidden";
      whichnode.innerHTML = "+";
   }
   else
   {
      whichpost.className = "postshown";
      whichnode.innerHTML = "-";
   }
}
