//导航菜单
var selectMenuNode = null;
function showby(o, selectStyleName)
{

	//取得选中
	if(!selectMenuNode ){
		var tList = o.parentNode.children;
		for(var i=0;i<tList.length;i++){
			var cName = tList[i].className;
			var index = cName.indexOf(selectStyleName);
			if(index>-1){
				selectMenuNode  = tList[i];
				break;
			}
		}
	}	

	if (selectMenuNode !=o) {		
		selectMenuNode .className = selectMenuNode .className.replace(selectStyleName, '');		
		o.className = o.className + ' ' + selectStyleName;	
		selectMenuNode  = o;		
	}
}

//显示菜单
function showmenu(id){
	//取得选中
	var o = document.getElementById(id);
	var tList = o.parentNode.children;
	for(var i=0;i<tList.length;i++)
		if(tList[i].style.display!='none') tList[i].style.display = 'none';	
	o.style.display='';
}


/*移动Object 开始*/
function _moveDiv(d){

	var currentX=window.event.clientX;
	var currentY=window.event.clientY;		

	var topValue = d.offsetTop;
	var leftValue = d.offsetLeft;	
		
	window.document.body.onmouseup = function(){window.document.body.onmousemove=function(){;}; };
	window.document.body.onmousemove = function()
	{		
		d.style.top=window.event.clientY - currentY + topValue;
		d.style.left=window.event.clientX - currentX + leftValue;	
	};
}
/*移动前景表单 结束*/
/*关闭前景表单 开始*/
function _closeDiv(id){
	document.getElementById(id).style.display='none';
}
function _closeDivObject(o){
    alert(123);
	o.style.display='none';
}
/*关闭前景表单 结束*/







/************************************
***  firefox 支持 children 属性
************************************/
try{
HTMLElement.prototype.__defineGetter__("children",
     function () {
         var returnValue = new Object();
         var number = 0;
         for (var i=0; i<this.childNodes.length; i++) {
             if (this.childNodes[i].nodeType == 1) {
                 returnValue[number] = this.childNodes[i];
                 number++;
             }
         }
         returnValue.length = number;
         return returnValue;
     }
 );
}catch(e){;};
/*******************************
****
***************************/
function _setpframeheight(){    
    try{
        window.frameElement.style.height= document.body.offsetHeight+10 +'px';
    }catch(e){;}
};

//用户加载
if (document.all) {
window.attachEvent('onload', _setpframeheight);
}
else {
window.addEventListener('load', _setpframeheight, false);
}



/**************************
*********通过函数**************
*************************/
//
String.prototype.trim = function() { return this.replace(/(^\s*)|(\s*$)/g, ""); };
String.prototype.leftTrim = function() { return this.replace(/(^\s*)/g, ""); };
String.prototype.rightTrim = function() { return this.replace(/(\s*$)/g, ""); };