
var olddollar={ // v1.1
	addOnload:function(func){
		var prev=window.onload;
		if(typeof window.onload!='function'){
			window.onload=func;
			}
		else{
			window.onload=function(){prev();func();}
			}
		},
	getByClass:function(str,node,tag){
		var classEls=new Array();
		var elements
		node=!node?document:node;
		elements=!tag?node.all||node.getElementsByTagName('*'):node.getElementsByTagName(tag);
		var pattern=new RegExp('(^|\\s)'+str+'(\\s|$)');
		for(counter=0,found=0;counter<elements.length;counter++){
			if(pattern.test(elements[counter].className)){
				classEls[found]=elements[counter];
				found++;
				}
			}
		return classEls;
		},
	getById:function(){
		var elements=new Array();
		for(var counter=0;counter<arguments.length;counter++){
			var arg=arguments[counter];
			if(typeof arg=='string')arg=document.getElementById(arg);
			if(arguments.length==1)return arg;
			elements.push(arg);
			}
		return elements;
		},
	getByTag:function(str,node){
		if(node==null)node=document;
		return node.getElementsByTagName(str);
		}
	};

var HOVER={ // v1.1
	init:function(){
		if(window.attachEvent){
			var items=$.getByClass("nav",$.getById("nav"));
			for(counter=0;counter<items.length;counter++){
				items[counter].onmouseover=function(){this.className+=" hover"};
				items[counter].onmouseout=function(){this.className=this.className.replace(new RegExp(" hover\\b"),"")};
				}
			}
		}
	};


var STRINGS={
	crlf:String.fromCharCode(13)+String.fromCharCode(10),
	hasLength:function(str){
		try{
			if(GLOBALS.isDefined(str)){
				return (STRINGS.len(STRINGS.trim(str))>0);
			} else {
				return false;
			}
		} catch(e){
			return false;
		}
	},
	inStr:function(str, chars){
		/*
		Returns the first location a substring (chars) was found in the string str.  (If chars is not found, -1 is returned.)
		*/
		var subStrLen=STRINGS.len(chars);
		for (i=0; i < STRINGS.len(str); i++){
			if (chars == STRINGS.mid(str, i, subStrLen)){	
				return i; 
			}
		}
		return -1;
	},
	lcase:function(str){
		// helper function to ensure the item is cast as a string
		return String(str).toLowerCase();  
	},
	left:function(str,n){
		if (n <= 0)     // Invalid bound, return blank string
				return "";
		else if (n > String(str).length)   // Invalid bound, return
				return str;                // entire string
		else // Valid bound, return appropriate substring
				return String(str).substring(0,n);
    },
	len:function(str){
		// helper function to ensure the item is cast as a string
		return String(str).length;  
	},
	ltrim:function(str){
		var whitespace = new String(" \t\n\r");

		var s = new String(str);

		if (whitespace.indexOf(s.charAt(0)) != -1) {
			// We have a string with leading blank(s)...

			var j=0, i = s.length;

			// Iterate from the far left of string until we
			// don't have any more whitespace...
			while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
				j++;

			// Get the substring from the first non-whitespace
			// character to the end of the string...
			s = s.substring(j, i);
		}

		return s;
	},
    mid:function(str, start, len){
		// helper function to ensure the item is cast as a string
		if (start < 0 || len < 0) return "";
		var iEnd, iLen = String(str).length;
		if (start + len > iLen)
				iEnd = iLen;
		else
				iEnd = start + len;

		return String(str).substring(start,iEnd);
    },
	replaceAll:function(str,searchStr,replaceStr){
		var outStr = str;
		try{
			if(STRINGS.hasLength(outStr)&&STRINGS.hasLength(searchStr)){
				var matchPos = outStr.indexOf(searchStr);
				while (matchPos != -1){
					outStr = outStr.replace(searchStr,replaceStr);
					matchPos = outStr.indexOf(searchStr);
				}	
			}
		} catch(e){
		
		}
		return outStr;
	},
	right:function(str,n){
		if (n <= 0)     // Invalid bound, return blank string
		   return "";
		else if (n > String(str).length)   // Invalid bound, return
		   return str;                     // entire string
		else { // Valid bound, return appropriate substring
		   var iLen = String(str).length;
		   return String(str).substring(iLen, iLen - n);
		}
    },
	rtrim:function(str){
		// We don't want to trip JUST spaces, but also tabs,
		// line feeds, etc.
		var whitespace = new String(" \t\n\r");

		var s = new String(str);

		if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {
			// We have a string with trailing blank(s)...

			var i = s.length - 1;       // Get length of string

			// Iterate from the far right of string until we
			// don't have any more whitespace...
			while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
				i--;


			// Get the substring from the front of the string to
			// where the last non-whitespace character is...
			s = s.substring(0, i+1);
		}

		return s;
	},
	sqlSafe:function(str){
		var safeValue=STRINGS.replaceAll(str,"'","''");
		safeValue=STRINGS.trim(safeValue);
		return safeValue;
	},
	trim:function(str){
		// super fast trim, especially for larger strings
		try{
			var	str = str.replace(/^\s\s*/, ''),
				ws = /\s/,
				i = str.length;
			while (ws.test(str.charAt(--i)));
			return str.slice(0, i + 1);
		}
		catch(e){
			return str;
		}
	},
	ucase:function(str){
		// helper function to ensure the item is cast as a string
		return String(str).toUpperCase();  
	},
	urlEncode:function(str){
	   // Replace ' ' with +
	   // Replace special characters with %xx equivalent
	   var HEXCHARS = "0123456789ABCDEFabcdef"; 
	   var plaintext = str;
	   var encoded = "";
	   var i = 0;
	   while (i < plaintext.length) {
		   var ch = plaintext.charAt(i);
		   switch(ch){
		   	case " ":
				encoded += "+";
				break;
			case "\"":
			// add more cases here as needed
			// case "\"":
				encoded += "%"+MATH.decimalToHex(plaintext.charCodeAt(i));
		   default:
		   		encoded +=ch;
		   
		   }
		   i++;
	   }
	   return encoded;
	},
	urlDecode:function(str){
	   // Replace + with ' '
	   // Replace %xx with equivalent character
	   // Put [ERROR] in output if %xx is invalid.
	   var HEXCHARS = "0123456789ABCDEFabcdef"; 
	   var encoded = str;
	   var plaintext = "";
	   var i = 0;
	   while (i < encoded.length) {
		   var ch = encoded.charAt(i);
		   if (ch == "+") {
			   plaintext += " ";
			   i++;
		   } else if (ch == "%") {
				if (i < (encoded.length-2) 
						&& HEXCHARS.indexOf(encoded.charAt(i+1)) != -1 
						&& HEXCHARS.indexOf(encoded.charAt(i+2)) != -1 ) {
					plaintext += unescape( encoded.substr(i,3) );
					i += 3;
				} else {
					// alert( 'Bad escape combination near ...' + encoded.substr(i) );
					plaintext += "%[ERROR]";
					i++;
				}
			} else {
			   plaintext += ch;
			   i++;
			}
		} // while
	   return plaintext;
	},
	xmlSafe:function(str){
		var safeValue=STRINGS.replaceAll(str,"<","&lt;");
		safeValue=STRINGS.replaceAll(safeValue,">","&gt;");
		safeValue=STRINGS.replaceAll(safeValue,"\"","&quot;");
		safeValue=STRINGS.trim(safeValue);
		return safeValue;
	}

};



function openDesigner(){
	window.open("/try-it/designer.asp", "designer", "height=670,width=985,status=no,toolbar=no,menubar=no,location=no,resizable=no" );
	return false;
}	


// $.addOnload(HOVER.init);


