function showGlossaryTerm(term,code,parmString) {
        browserName = navigator.appName;
        browserVer = navigator.appVersion;
        browserVer = browserVer.substring(0,1);
        if (browserVer == '.') browserVer = 2;
        else browserVer = browserVer;
        //old Netscape alert
        if (browserName == "Netscape" && browserVer < 3)
    	    alert('This feature is unreliable with your version of Netscape.');
        remote = window.open("/SP/editorial/Glossary.do?"+parmString+"&term="+term+"&code="+code+"&sp_popup=YES","glossaryWindow",
            "width=610,height=410,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes");
        if (browserName != "Microsoft Internet Explorer")
	    remote.focus();
}

function isAllowedCharForInput(c) {
   return ( ((c>="0") && (c<="9")) || ((c>="A") && (c<="z")) || (c==".") || (c=="-") || (c=="_") );
}
function isSpace(c) {
   return ( c==" " );
}
function isValidAlpha(inputVal){
   for (var i=0;i<inputVal.length;i++) {
 	 if (isSpace(inputVal.charAt(i))) {
	        alert('Please revise Saved Filter Name. \nName cannot contain a space.');
		return false;
	 }   	
	 if (!isAllowedCharForInput(inputVal.charAt(i))) {
	 	alert('Please revise Saved Filter Name. \nName cannot include "'+inputVal.charAt(i)+'"');
		return false;
	 }	
   }			
   return true;
}
	function isAllowedCharForDouble(c) {
	    return (((c>= "0") && (c <= "9")) || (c == ".") || (c =="-") || (c =="+"));
    	}
	function isAllowedCharForInt(c){
  	    return ((c>= "0") && (c <= "9"));
	}
	
	function isAPosNumber(inputVal){
		for (var i=0;i<inputVal.length;i++){
		    if (!isAllowedCharForInt(inputVal.charAt(i))) 
		    	return false;
		}
 	   	return true;
	}
	function isADouble(val){
	    if (val.length == 0) return true;
	    var first = val.charAt(0);
	    var gotDot = false;
	    var gotDigit = false;
	    if (!isAllowedCharForDouble(first)) return false;
	    if (first == ".") gotDot = true;
	    if (isAllowedCharForInt(first)) gotDigit = true;
	    if (val.length == 1) {
	    	if (gotDigit) return true;
	    	else return false;
	    }
	    for (var i=1;i<val.length;i++){
	        if (val.charAt(i) == ".") {
	        	if (gotDot) return false;
	        	else gotDot = true;
	        }
	        else {
	        	if (isAllowedCharForInt(val.charAt(i))) gotDigit = true;
		        else return false;
		}
	    }
	    if (!gotDigit) return false;
	    else return true;
	}
	
	function isADate(s) {
		var month;
		var day;
		var year;
		var mIndex, dIndex, yIndex;
		var currentDate, enteredDate;
		if (s.length == 0) return true;
		mIndex = s.indexOf("/");
		if (mIndex == -1)
		    return false;
		month = s.substring(0,mIndex);
		if (!isAPosNumber(month)) return false;
		dIndex = s.indexOf("/", mIndex+1);
		if (dIndex == -1)
		    return false;
		day = s.substring(mIndex+1,dIndex);
		if (!isAPosNumber(day)) return false;
		year = s.substring(dIndex+1,s.length);
		if (!isAPosNumber(year)) return false;

		if ((month < 1) || (month > 12))
		    return false;
		if ((day < 1) || (day > 31))
		    return false;
		if ((year < 1900) || (year > 3000))
		    return false;

		currentDate = new Date();
		enteredDate = new Date(year, (month-1), day, currentDate.getHours(),
				   currentDate.getMinutes(), currentDate.getSeconds());
		if ((currentDate - enteredDate) <= 0)
			return false;

		return true;    
	}
	
function htmlEncode(s) {
        var str = new String(s);
        str = str.replace(/&/g, "&amp;");
        str = str.replace(/</g, "&lt;");
        str = str.replace(/>/g, "&gt;");
        str = str.replace(/"/g, "&quot;");
        return str;
} 
	
var newwin, newpop;
// default values
var popWinName="popWin";
var newWinName="newWin";
var popWidth=625;
var popHeight=470;
var newWinWidth=640;
var newWinHeight=600;
var expDays=1;
var validated=true;
var reSize = "no";
// -----------------------
// DESCRIPTION: pop-up window
// ARGUMENTS: filename, &name, &width, &height, &scroll
// RETURN: --
// -----------------------
function popUp(filename){
	var argv=popUp.arguments;  
	var argc=argv.length;  
	var name=(argc>1) ? argv[1] : popWinName;  
	var w=(argc>2) ? argv[2]:popWidth;
	var h=(argc>3) ? argv[3]:popHeight;
	var s=(argc>4) ? argv[4]:reSize;
	var scroll=(argc>5) ? argv[5]:"yes";
	var left=(argc>6) ? argv[6]:200;
	var top=(argc>7) ? argv[7]:100;
	window.name="ToolboxWin";
	if(!newpop||newpop.closed) {
		newpop=window.open(filename, name, "toolbar=no,width="+w+",height="+h+",menubar=yes,resizable=yes,status=no,scrollbars="+scroll+",left="+left+",top="+top);
	} else {
		newpop.focus();
		newpop.location = filename;
	}
}
