

function Start(page,mW,mH,winName) {
OpenWin = this.open(page, winName, 'toolbar=0,menubar=0,location=0,directories=0,status=0,copyhistory=0,scrollbars=1,resizable=1,left=5,top=20,width='+mW+',height='+mH);
}

function selection(e) {
var myStr = e.target.name;
if ((myStr!="EMAIL") && (myStr!="KEYWORDS") && (myStr.substring(0,5)!="MAIL_")) return false;
}
function clic() { return true; }

var MoveHotelMemory=new Array();

function MoveHotel(id,isHorizontal,toLeft,size)
{
    if (tabHotel=document.getElementById(id))
    {
        if (!tabHotel.firstChild ||
            !tabHotel.firstChild.firstChild ||
            !tabHotel.firstChild.firstChild.firstChild ||
            tabHotel.firstChild.firstChild.firstChild.nodeName!="TR" ||
            !tabHotel.firstChild.firstChild.firstChild.firstChild ||
            tabHotel.firstChild.firstChild.firstChild.firstChild.nodeName!="TD") return;

        if ((isHorizontal && tabHotel.offsetWidth<size) || (!isHorizontal && tabHotel.offsetHeight<size))
        {
            setTimeout("MoveHotel('"+id+"',"+(isHorizontal ? "true" : "false")+","+(toLeft ? "true" : "false")+","+size+")",1000);
            return;
        }

        var decal,inc,firstElmt,lastElmt;

        if (!MoveHotelMemory[id]) MoveHotelMemory[id]=false;
        if (toLeft) inc=-1;
        else inc=1;
        if (isHorizontal)
        {
            firstElmt=tabHotel.firstChild.firstChild.firstChild.firstChild;
            lastElmt=tabHotel.firstChild.firstChild.firstChild.lastChild;
        }
        else
        {
            firstElmt=tabHotel.firstChild.firstChild.firstChild;
            lastElmt=tabHotel.firstChild.firstChild.lastChild;
        }

        if (isHorizontal)
        {
            if (tabHotel.style.left) decal=parseInt(tabHotel.style.left)+inc;
            else decal=0;
        }
        else
        {
            if (tabHotel.style.top) decal=parseInt(tabHotel.style.top)+inc;
            else decal=0;
        }

        var parentElmt=firstElmt.parentNode;
        while ((toLeft && (isHorizontal && Math.abs(decal)>firstElmt.offsetWidth) || (!isHorizontal && Math.abs(decal)>firstElmt.offsetHeight)) ||
            (!toLeft && decal>0))
        {
            if (toLeft)
            {
                decal+=isHorizontal ? firstElmt.offsetWidth : firstElmt.offsetHeight;
                if (MoveHotelMemory[id])
                {
                    parentElmt.removeChild(firstElmt);
                    MoveHotelMemory[id]=false;
                }
                else parentElmt.appendChild(parentElmt.removeChild(firstElmt));
            }
            else
            {
                decal-=isHorizontal ? lastElmt.offsetWidth : lastElmt.offsetHeight;
                if (MoveHotelMemory[id])
                {
                    parentElmt.removeChild(lastElmt);
                    MoveHotelMemory[id]=false;
                }
                else parentElmt.insertBefore(parentElmt.removeChild(lastElmt),firstElmt);
            }

            if (isHorizontal)
            {
                firstElmt=tabHotel.firstChild.firstChild.firstChild.firstChild;
                lastElmt=tabHotel.firstChild.firstChild.firstChild.lastChild;
            }
            else
            {
                firstElmt=tabHotel.firstChild.firstChild.firstChild;
                lastElmt=tabHotel.firstChild.firstChild.lastChild;
            }
        }

        if ((isHorizontal && (tabHotel.offsetWidth+decal<size)) || (!isHorizontal && (tabHotel.offsetHeight+decal<size)))
        {
            if (MoveHotelMemory[id]) {return;}
            if (toLeft) parentElmt.appendChild(firstElmt.cloneNode(true));
            else parentElmt.insertBefore(lastElmt.cloneNode(true),firstElmt);
            MoveHotelMemory[id]=true;
        }

        if (isHorizontal) tabHotel.style.left=decal+"px";
        else tabHotel.style.top=decal+"px";
        setTimeout("MoveHotel('"+id+"',"+(isHorizontal ? "true" : "false")+","+(toLeft ? "true" : "false")+","+size+")",40);
    }
}

