﻿// JScript File


/* 
	preconditions:
		must have a 1px by 1px spacer gif in: [apppath]/images/spacer.gif
		strAppPath var is defined, to the application path.
 */

var arVersion = navigator.appVersion.split("MSIE");
var IEversion = parseFloat(arVersion[1]);

//call this and pass it an html doc IMG (of type png) and if the browser is IE 5.5 or 6, it
//will process the PNG using the AlphaImageLoader.
//Created:  John Pequeno	July 2, 2006.
function fixIEPNG(myImage) 
{
  if ((IEversion >= 5.5) && (IEversion < 7) && (document.body.filters) && myImage.src.match(/\.png/i)) 
  {
		 myImage.style.cssText += ";filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
									+ "(enabled=true, src='" + myImage.src + "', sizingMethod='scale');";      
		 myImage.src = strAppPath + "TemplateImages/spacer.gif";  
	}
}
function ValidateStrongPassword(source, args) 
{
    var strPassword = args.Value;

    if (strPassword.length < 6 || strPassword.length > 12) {
        args.IsValid = false;
        return;
    }
    var i;
    var blnHasAlphaChar=false;
    var blnHasNonAlphaChar = false;
    for(i=0;i<strPassword.length;i++) {
        if (strPassword.charAt(i) >= 'a' && strPassword.charAt(i) <= 'z')
        {
        blnHasAlphaChar=true;
        }
        else if (strPassword.charAt(i) >= 'A' && strPassword.charAt(i) <= 'Z')
        { blnHasAlphaChar = true; }
        else
        { blnHasNonAlphaChar = true; }
    }
    if (blnHasAlphaChar && blnHasNonAlphaChar) {
        args.IsValid = true;
    }
    else {
        args.IsValid = false;
    }
}
