function $(item){
	return document.getElementById(item);
}
function $N(name){ return document.getElementsByName(name);}
isUndef  = function(a){ return typeof a == "undefined";};

String.prototype.trim   =   function(){
    return   this.replace(/(^\s*)|(\s*$)/g,   "");
}
String.prototype.escapeHTML   =   function(){
    return   this.replace(/<.+?>/mig, "");
}
String.prototype.bytesLength = function(){
	var cArr = this.match(/[^\x00-\xff]/ig);
	return this.length + (cArr == null ? 0 : cArr.length);
} 
String.prototype.strip = function(){
	var temp = this;
	temp = temp.replace(/&/ig, "&amp;"); 
	temp = temp.replace(/</ig, "&lt;");
	temp = temp.replace(/>/ig, "&gt;");
	temp = temp.replace(/\"/ig, "&quot;");
	temp = temp.replace(/\'/ig, "&#39;");
	temp = temp.replace(/ /ig, "&nbsp;");
	temp = temp.replace(/(\r?\n)|\r/ig, "<br />");
	return temp;
}
function LeftSidetool(){}
LeftSidetool.submouseOver = function (index) {
	var topindex = 'navigater_'+index;
	if($(topindex) && $(topindex).className != "selected") $(topindex).className = "onhover";

	if($('navigater_ul')) {
		var allsubs = $('navigater_ul').getElementsByTagName('UL');
		for(var i in allsubs) {
			if(allsubs[i].style)
				allsubs[i].style.display = 'none';
		}
	}
	var subul = 'sub'+index;
	if($(subul)) $(subul).style.display = 'block';
}
LeftSidetool.submouseout = function (e, o, index) {
	var select_li = '';
	if($('navigater_ul')) select_li = $('navigater_ul').getAttribute('selectedli');
	if(index == select_li)  return ;

	var topindex = 'navigater_'+index;
	var subul = 'sub'+index;
	if($(topindex)) $(topindex).className = "normal";
	if($(subul)) $(subul).style.display = 'none';

	var selected_subul = 'sub'+select_li;
	if($(selected_subul)) $(selected_subul).style.display = 'block';
}

