var xmlHttp = false;
var response;
function callServer()
{
	try 
	{
	 	xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
	} 
	catch (e) 
	{
		try 
		{
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		} 
		catch (e2) 
		{
			xmlHttp = false;
		}
	}
	if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
	 	xmlHttp = new XMLHttpRequest();
	}
	var url = "?action=viewTypeList";
	xmlHttp.open("GET", url, true);
	xmlHttp.onreadystatechange = updatePage;
	xmlHttp.send(null);  
}


function updatePage() {
  if (xmlHttp.readyState < 4) {
	 	response =false
  }
  if (xmlHttp.readyState == 4) {
		response = xmlHttp.responseText;
		xmlHttp = null
  }
  var categorydiv
  categorydiv=document.getElementById('categoryNameDiv')
  categorydiv.style.top='160px';
  categorydiv.style.left='80px';
  categorydiv.style.display='block';
  if(response==false){
		response="<div class='netstyle' >列表正在加载中...</div>"
  }
  categorydiv.innerHTML=response;
}



function ObjectDragDrop(){ 
	obj="categoryNameDiv"
    var me = this; 
    this.foo = (typeof obj=="string")?document.getElementById(obj):obj; 
     
    this.foo.onmousedown = function(e){ 
          var foo = me.foo; 
          e = e||event; 
          
          //获取鼠标在对象内部的坐标
          if( e.layerX )
		  { 
		  	  foo.oOffset = {x:e.layerX,  y:e.layerY};  
		  } 
          else{ 
		  	 foo.oOffset = {x:e.offsetX, y:e.offsetY };   
		  } 
          
          document.onmousemove = me.drag; 
          document.onmouseup   = me.drop; 
          document.onselectstart = function(){ return false; };          
    } 
     
    this.drag = function(e){ 
          var foo = me.foo; 		
          e=e||event; 
          foo.style.top  = e.clientY +(document.documentElement.scrollTop || document.body.scrollTop)- foo.oOffset.y + "px"; 
          foo.style.left = e.clientX+(document.documentElement.scrollLeft || document.body.scrollLeft) - foo.oOffset.x + "px"; 
    } 
     
    this.drop = function(e){ 
          e=e||event; 
          document.onmousemove = document.onmouseup = document.onselectstart = null;     
    }     
}

function drawobj(){ 
	var categoryNameDiv = new  ObjectDragDrop("categoryNameDiv"); 
}     