function Class(cid,cname)
{
    this.classid = cid;
    this.classname = cname;
}

function Item(iid,iname,cid)
{
    this.itemid=iid;
    this.itemname=iname;
    this.classid=cid;
}

//创建层函数
function getElem(ElemID,ElemType,Parent)
{
    if(!document.getElementById(ElemID))
    { 
        var newNode=document.createElement(ElemType);
        newNode.setAttribute("id",ElemID);
        Parent.appendChild(newNode);  
    }
    return document.getElementById(ElemID);
}

function openWindow(url)
{
    var frmNew;
    frmNew = document.getElementById("frmNew");
    if(!frmNew){ frmNew = getElem("frmNew","form",document.body); }
    
    frmNew.action = url;
    frmNew.method = "post";
    frmNew.target = "_blank";
    frmNew.submit();
}

function getInt(pxNum)
{
    return parseInt(pxNum.toString().replace("px",""));
} 

//取得层offsetTop
function getObjTop(e){
  var t=e.offsetTop;
  while(e=e.offsetParent){
    t+=e.offsetTop;
    }
  return t;
  } 
  
//取得层offsetLeft
function getObjLeft(e){
  var l=e.offsetLeft;
  while(e=e.offsetParent){
    l+=e.offsetLeft;
    }
    return l;
  }
  
var pX,pY;
var curMoveObj=null;
var curMoveIframe=null;

document.onmouseup=function(){
    if(curMoveObj != null)
    {
        //curMoveObj.releaseCapture();
        curMoveObj.style.filter="Alpha(Opacity=100)";
        curMoveObj=null;
        curMoveIframe=null;
    }
}

document.onmousemove=function(){
    var curX, curY;
    curX = event.x-pX;
    curY = event.y-pY;

    if(curMoveObj != null)
    {
        if(curX<0) curMoveObj.style.pixelLeft = 0;
        else if(curX>document.body.clientWidth-curMoveObj.offsetWidth) curMoveObj.style.pixelLeft = document.body.clientWidth-curMoveObj.offsetWidth;
        else curMoveObj.style.pixelLeft = curX;
        
        if(curY<0) curMoveObj.style.pixelTop = 0;
        else if(curY>document.body.scrollHeight-curMoveObj.offsetHeight) curMoveObj.style.pixelTop = document.body.scrollHeight-curMoveObj.offsetHeight;
        else curMoveObj.style.pixelTop = curY;

        curMoveObj.style.filter="Alpha(Opacity=70)";
    }
    
    if(curMoveIframe)
    {
        if(curX<0) curMoveIframe.style.pixelLeft = 0;
        else if(curX>document.body.clientWidth-curMoveIframe.offsetWidth) curMoveIframe.style.pixelLeft = document.body.clientWidth-curMoveIframe.offsetWidth;
        else curMoveIframe.style.pixelLeft = curX;
        
        if(curY<0) curMoveIframe.style.pixelTop = 0;
        else if(curY>document.body.scrollHeight-curMoveIframe.offsetHeight) curMoveIframe.style.pixelTop = document.body.scrollHeight-curMoveIframe.offsetHeight;
        else curMoveIframe.style.pixelTop = curY;
        
        curMoveIframe.style.filter="Alpha(Opacity=0)";
    }
}