﻿// Function fixes the transparent png on IE 6
function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
   var arVersion = navigator.appVersion.split("MSIE")
   var version = parseFloat(arVersion[1])
   
   
   if (version <= 6)
   {
   
   
   if ((version >= 5.5) && (document.body.filters)) 
   {
      for(var i=0; i<document.images.length; i++)
      {
         var img = document.images[i]
         var imgName = img.src.toUpperCase()
         if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
         {
            var imgID = (img.id) ? "id='" + img.id + "' " : ""
            var imgClass = (img.className) ? "class='" + img.className + "' " : ""
            var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
            var imgStyle = "display:inline-block;" + img.style.cssText 
            if (img.align == "left") imgStyle = "float:left;" + imgStyle
            if (img.align == "right") imgStyle = "float:right;" + imgStyle
            if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
            var strNewHTML = "<span " + imgID + imgClass + imgTitle
            + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
            + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
            + "(src=\'" + img.src + "\', sizingMethod='image');\"></span>" 
            img.outerHTML = strNewHTML
            i = i-1
         }
      }
   }  
   
     
   }
}






// Javascript function for showing the captcha explanation
function ShowCaptcha()
{

    // Grab the current page height
    var PageHeight = screen.height;
    var PageWidth = screen.width;
    
    
    // Determine the top and left positions
    var PageTop = ((PageHeight - 440) / 2);
    var PageLeft = ((PageWidth - 440) / 2);
        
    
    // Open up the new window
    window.open("/sitefiles/Captcha/codeverification.html", "null", "width=440, height=440, top=" + PageTop + ", Left=" + PageLeft + "location=no, menubar=no, resizeable=no, scrollbars=no, status=no, titlebar=no, toolbar=no");


}






// Opens a new window centered on the page
function OpenNewWindow(WindowPath, WindowWidth, WindowHeight)
{
    
    // Grab the current page width and height
    var PageHeight = screen.height;
    var PageWidth = screen.width;
    
    
    
    // Determine the top and left positions
    var PageTop = ((PageHeight - WindowHeight) / 2);
    var PageLeft = ((PageWidth - WindowWidth) / 2);
    
    
    
    // Set the window properties
    var WindowProperties = "width=" + WindowWidth + ", height=" + WindowHeight + ", top=" + PageTop + ", left=" + PageLeft + ", location=no, menubar=no, resizeable=yes, scrollbars=yes, status=no, titlebar=no, toolbar=no";
    
    
    
    // Open the new window
    window.open(WindowPath, "null", WindowProperties);
    
    
}






// Opens a new window centered on the page
function OpenNewWindowNoScroll(WindowPath, WindowWidth, WindowHeight)
{
    
    // Grab the current page width and height
    var PageHeight = screen.height;
    var PageWidth = screen.width;
    
    
    
    // Determine the top and left positions
    var PageTop = ((PageHeight - WindowHeight) / 2);
    var PageLeft = ((PageWidth - WindowWidth) / 2);
    
    
    
    // Set the window properties
    var WindowProperties = "width=" + WindowWidth + ", height=" + WindowHeight + ", top=" + PageTop + ", left=" + PageLeft + ", location=no, menubar=no, resizeable=no, scrollbars=no, status=no, titlebar=no, toolbar=no";
    
    
    
    // Open the new window
    window.open(WindowPath, "null", WindowProperties);
    
    
}