var IS_DEBUG = false;
var HIDDEN_ERROR = false;
var IS_DEL = "确认删除？";
var IE = (document.all) ? 1 : 0;
var NS = (document.layers) ? 1 : 0;
//var IE = (navigator.userAgent.indexOf('MSIE ') != -1);
var IE6 = (navigator.userAgent.indexOf('MSIE 6.0') != -1);
var IE7 = (navigator.userAgent.indexOf('MSIE 7.0') != -1);
var FF = (navigator.userAgent.indexOf('Firefox/') != -1);
function displayElement(elementId)
{//切换标签是否显示{{{
	
    var this_div = get(elementIdId);
	if ("none" == this_div.style.display)
		this_div.style.display = "";
	else
		this_div.style.display = "none";
}//}}} 

function showMe(elementTag)
{//显示标签{{{
	elementTag.style.display = "block";
}//}}} 

function hiddenMe(elementTag)
{//隐藏标签{{{
	elementTag.style.display = "none";
}//}}} 

function trimPx(px_value)
{//去掉宽和高的PX{{{
    if (px_value == "") 
    	return 0;
    else
	    return parseFloat(px_value.substring(0, px_value.length - 2));
}//}}} 

function getEventX(event)
{//当前鼠标所在位置的X值{{{
	if (IE)
		return window.event.clientX;
	else
		return event.clientX;
}//}}} 

function getEventY(event)
{//当前鼠标所在的位置的Y值{{{
	if (IE4)
		return window.event.clientY;
	else
		return event.clientY;
}//}}} 

function getEventElementId(event)
{//当前鼠标所在的位置标签的ID{{{
	if (IE4)
		return window.event.srcElement.id;
	else
		return event.target.id;
}//}}}

function eventKeyCode(event)
{//按键值{{{
	return event.keyCode;
}//}}}

function closeThis(tagId)
{//不显示这个标签{{{
	var obj = get(tagId);
	obj.style.display = "none";
}//}}}

function removeThis(tagId)
{//移除这个标签{{{
	var obj = get(tagId);
	obj.parentNode.removeChild(obj);
}//}}}

function goBack()
 {//后退{{{
	window.history.back();
}//}}}

function get(ID)
{//取标签{{{
	return document.getElementById(ID);
}//}}}

function getTop(e)
{//取TOP值{{{
	var t = e.offsetTop;
	if(e.offsetParent != null) 
		t+=getTop(e.offsetParent);
	return t;
}//}}}

function getLeft(e)
{//取LEFT值{{{
	var l = e.offsetLeft;
    if(e.offsetParent!=null) 
    	l+=getLeft(e.offsetParent);
	return l;
}//}}}

function DrawImage(ImgD,width,height)
{//图片等比收缩{{{
       var  image=new Image();  
       image.src=ImgD.src;  
       if(image.width>0 && image.height>0)
       {  
         if(image.width/image.height>= width/height)
         {  
           if(image.width>width)
           {      
           		ImgD.width=width;  
           		ImgD.height=(image.height*width)/image.width;  
           }
           else
           {  
           		ImgD.width=image.width;      
           		ImgD.height=image.height;  
           }  
         }  
         else
         {  
           if(image.height>height)
           {
           		ImgD.height=height;  
           		ImgD.width=(image.width*height)/image.height;            
           }
           else
           {  
           		ImgD.width=image.width;      
           		ImgD.height=image.height;  
           }  
         }  
     } 
}//}}}

function logoutRes()
{//{{{
	if (4 == xmlHttp.readyState)
	{
		resText = xmlHttp.responseText;
		if ("" == resText)
		{
			top.location.reload();
			return true;
		}
		else
		{
			alert(resText);
		}
	}
}//}}}


