
// Create a cookie with the specified name and value.
// The cookie expires at the end of the 20th century.
function SetCookie(sName, sValue)
{
  date = new Date();
  //document.cookie = sName + "=" + escape(sValue) + "; expires=" + date.toGMTString();
  document.cookie = sName + "=" + escape(sValue) + "; expires=Fri, 01 Jan 2010 23:59:59 GMT";
}
// Retrieve the value of the cookie with the specified name.
function GetCookie(sName)
{
  // cookies are separated by semicolons
  var aCookie = document.cookie.split("; ");
  for (var i=0; i < aCookie.length; i++)
  {
    // a name/value pair (a crumb) is separated by an equal sign
    var aCrumb = aCookie[i].split("=");
    if (sName == aCrumb[0])
      return unescape(aCrumb[1]);
  }

  // a cookie with the requested name does not exist
  return null;
}
// Delete the cookie with the specified name.
function DelCookie(sName)
{
  document.cookie = sName + "=" + escape(sValue) + "; expires=Fri, 31 Dec 1999 23:59:59 GMT;";
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
thewin = window.open(theURL,winName,features);
thewin.focus()
}

function openWin(theURL,winName,features) { //v2.0
     thewin = window.open(theURL,winName,features);
     thewin.focus()
}

function EmailWindow(winName,features) { //v2.0
thewin = window.open('http://www.itlnet.net/users/k2l/EmailMe.asp?xURL=programwitch&xURL2=itlnet.net',winName,features);
thewin.focus()
}

     function newImage(arg) {
          if (document.images) {
               rslt = new Image();
               rslt.src = arg;
               return rslt;
          }
     }

     function changeImages() {
          if (document.images && (preloadFlag == true)) {
               for (var i=0; i<changeImages.arguments.length; i+=2) {
                    document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
               }
          }
     }

     var preloadFlag = false;
     function preloadImages() {
          if (document.images) {
               K2L_toolbar_01_over = newImage("images/K2L_toolbar_01-over.gif");
               K2L_toolbar_02_over = newImage("images/K2L_toolbar_02-over.gif");
               // K2L_toolbar_03_over = newImage("images/K2L_toolbar_03-over.gif");
               // K2L_toolbar_04_over = newImage("images/K2L_toolbar_04-over.gif");
               // K2L_toolbar_05_over = newImage("images/K2L_toolbar_05-over.gif");
               preloadFlag = true;
          }
     }

     function toggleDisplay(id) {
       if (document.getElementById) {
         var e = document.getElementById(id);
         if (e) {
           if (e.style.display != "block") {
              e.style.display = "block";
              SetCookie(id, "block");
           } else {
              e.style.display = "none";
              SetCookie(id, "none");
           }
         }
       }
     }


     var speed = 20;
     var step = 5;
     var hide = 5000;
     var moveto = 168;

     // Do not edit below this line
     var left = 165;

     function movein(){
       if (document.layers) {
             document.layers['message'].pageX = window.pageXOffset + left;
             left+=step;
             if(left<moveto){ setTimeout('movein()',speed); }
             else { setTimeout('closemessage()',hide); }
         }

       else{
          document.getElementById('message').style.left=left+'px';
          left+=step;
          if(left<moveto){ setTimeout('movein()',speed); }
          else { setTimeout('closemessage()',hide); }
       }
     }
     function closemessage(){
             if (document.layers) {document.layers['message'].visibility='hidden';}
             else{document.getElementById('message').style.visibility='hidden';}
}


//  Hide script from older browsers
// script by http://www.hypergurl.com
 var urlAddress = "http://www.programwitch.com/main.asp";
 var pageName = "Program Witch Pages";

 function addToFavorites()
 {
  if (window.external)
  {
   window.external.AddFavorite(urlAddress,pageName)
  }
  else
  {
   alert("Sorry! Your browser doesn't support this function.\nTry CTRL-D to bookmark this page.");
  }
 }


// 2005 (c) Blogs.IceRocket.com.
// JAVASCRIPT for the feature "Number of Linking Posts"
// you can edit next section

///////////// STYLE VARIABLES ------------------->
// Following parameters determine appearance of returned document
// in the frame.
//
// Link does have following scheme in the returned document:
// <a style='[LINK_STYLE]' class='[LINK_CLASS]' href="...">XX Linking Posts</a>
//
// You have two options to customize look&feel of links in the document:
//
// 1. Specify STYLE of the link:
//
// Style for the link (e.g. "color:white" or "font-size:1.0em;font-color:red"
// Use any CSS value for the style:
var linkStyle = "font-size:10px;";
// leave variable empty if you do not want to have this attribute in the frame's document
// var linkStyle = "";
//
// 2. Specify CLASS of the link and pass URL to CSS file
//    which has defined style for the CLASS of the link
//
// Class name for the link
var linkClass = "citation";
// leave variable empty if you do not want to have this attribute in the frame's document
// var linkClass = "";
//
// Full URL to CSS document (Cascade Style Sheets), which will be inserted into returned document
// <link rel="stylesheet" href="[FRAME_URL_CSS]">
// e.g. : http://your.site.com/style.css
var frameUrlCSS = "http://www.programwitch.com/main.css";
// leave variable empty if you do not want to have this attribute in the frame's document
// var frameUrlCSS = "";
//
/////////////// <------------------- END OF SECTION

///////////// FRAME PARAMETERS ------------------->
// These parameter determine style of iframe element
var iframeStyle = "width: 100px;height:1.2em;border: 0px gray solid";
/////////////// <------------------- END OF SECTION

// PLEASE, Do not edit this code. Thanks :)
escapedStyle = encodeURIComponent(linkStyle);
escapedClass = encodeURIComponent(linkClass);
escapedUrlCSS = encodeURIComponent(frameUrlCSS);

function writeCitationsFrame(permanentLink){
 document.write('<IFRAME SRC="http:\/\/blogs.icerocket.com\/citations?f=frame&style='+escapedStyle+'&class='+escapedClass+'&css='+escapedUrlCSS+'&q='+permanentLink+'" ALLOWTRANSPARENCY="true" frameborder=0 style="'+iframeStyle+'" align=top marginwidth=0 marginheight=0 scrolling=no title="Linking Posts From IceRocket"><a href="http:\/\/blogs.icerocket.com\/search?q='+permanentLink+'">Linking posts</a><\/IFRAME>');
}
