﻿function ShowPopupImage(myimage) {
	html = "<HTML><HEAD><TITLE>Image Popup</TITLE></HEAD><BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0><CENTER><IMG SRC='" + myimage + "' BORDER=0 NAME=image onload='window.resizeTo(document.image.width+50,document.image.height+50)'></CENTER></BODY></HTML>";
	popup=window.open ('','image','width=10,height=10,toolbar=0,location=0,directories=0,menuBar=0,scrollbars=1,resizable=1');
	popup.document.open();
	popup.document.write(html);
	popup.document.focus();
	popup.document.close()
}
function activateMenu(nav) {
    var navroot = document.getElementById(nav);
    var lis=navroot.getElementsByTagName("LI");  
    for (i=0; i<lis.length; i++) {
        if(lis[i].lastChild.tagName=="UL"){
     	    lis[i].onmouseover=function() {
                this.origClassName = this.className;
                var sClass = this.className + "Hover";		
                sClass = sClass.replace(/\s/g,"Hover ") + " hover";
                this.className += " " + sClass; 
     	    }
            lis[i].onmouseout=function() {
                this.className = this.origClassName;
            }
        }
    }
}
function isValidCC(oSrc, args) {
    var nCheck = 0;
    var nDigit = 0;
    var bEven  = false;

    if(args.Value.length<15){args.IsValid = false;return;}

    for (n = args.Value.length - 1; n >= 0; n--) {
        var cDigit = args.Value.charAt (n);
        if (isDigit (cDigit)) {
            var nDigit = parseInt(cDigit, 10);
            if (bEven) {
                if ((nDigit *= 2) > 9) nDigit -= 9;
            }
            nCheck += nDigit;
            bEven = ! bEven;
        }
        else if (cDigit != ' ' && cDigit != '.' && cDigit != '-'){
            args.IsValid = false;
            return;
        }
    }
    args.IsValid = (nCheck % 10) == 0;
}
function isDigit(src){return (src>='0') && (src<='9')}
