﻿function insertFlash(elm, url, w, h,w1,align) {
if (!document.getElementById(elm)) return;
var str = '';
str += '<object width="'+ w1 +'" height="'+ h +'"  align="'+align+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,124,0">';
str += '<param name="movie" value="'+ url +'">';
str += '<param value="false" name="menu"/> ';
str += '<param value="opaque" name="wmode"/>';
str += '<param name="wmode" value="transparent">';
str += '<param name="quality" value="autohigh">';
str += '<embed width="'+ w +'" height="'+ h +'" src="'+ url +'" quality="autohigh" wmode="opaque" type="application/x-shockwave-flash" plugspace="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>';
str += '</object>';
document.getElementById(elm).innerHTML = str;
}

   
function checkmobile1()
{
        var label4=window.document.all("ctl00_ContentPlaceHolder1_UC_MyOK1_TextBox2").value;
        if (label4 == "") 
        {
          alert('请输入接收短信的手机号码！');
          return false ;
        }
        else if (label4.length !=11) 
        {
          alert('接收短信的手机号码长度不对！');
          return false ;
        }
        else
        {
           return true;
        }
}

function checkmobile2()
{
        var label4=window.document.all("ctl00_ContentPlaceHolder1_UC_MyOK1_txt_Mobile").value;
        if (label4 == "") 
        {
          alert('请输入接收短信的手机号码！');
          return false ;
        }
        else if (label4.length !=11) 
        {
          alert('接收短信的手机号码长度不对！');
          return false ;
        }
        else
        {
           return true;
        }
}


//function   document.onkeydown()       
//  {   
//        
//      if( window.event.keyCode==13)
//      {
//           var button=window.document.getElementById("ctl00_ContentPlaceHolder1_UC_Query1_Button_query");
//	       if (button != null)
//	       {	        
//	          button.submit;
//	          return true;
//	       }
//	       else
//	       {   
//	          return false;
//	       }
//      }
//    
//  } 
  
  function KeyDown()
   { 
    if(event.keyCode==13)
      {
            //在页面form中，按回车不触发事件
            return false;
      }
   }
      
      function doButton()
       { 
         if(event.keyCode==13)
           {
              //btSubmit指对应的提交按扭的id名称
              document.all.Button_query.click(); 
           }
     }
     
   


/////////////////////////////////////////////////////////////////////////////////
////MSN冒泡提示框
//////////////////////////////////////////////////////////////////////////////////
////*   
////   消息构造   
////
//function CLASS_MSN_MESSAGE(id,width,height,caption,title,message,target){   
//    this.id     = id;   
//    this.title  = title;   
//    this.caption= caption;   
//    this.message= message;   
//    this.target = target;   
//    this.width    = width?width:200;   
//    this.height = height?height:120;   
//    this.timeout= 150;   
//    this.speed    = 20;  
//    this.step    = 1;  
//    this.right    = screen.width -1;   
//    this.bottom = screen.height;  
//    this.left    = this.right - this.width;  
//    this.top    = this.bottom - this.height;  
//    this.timer    = 0;  
//    this.pause    = false; 
//    this.close    = false; 
//    this.autoHide    = true; 
//    
//}   
//   
///**//*   
//*    隐藏消息方法   
//*/   
//CLASS_MSN_MESSAGE.prototype.hide = function(){   
//    if(this.onunload()){   
//        var offset  = this.height>this.bottom-this.top?this.height:this.bottom-this.top;  
//        var me  = this;   
//        if(this.timer>0){    
//            window.clearInterval(me.timer);   
//        }   
//        var fun = function(){   
//            if(me.pause==false||me.close){ 
//                var x  = me.left;  
//                var y  = 0;  
//                var width = me.width;  
//                var height = 0;  
//                if(me.offset>0){  
//                    height = me.offset;  
//                }  
//      
//                y  = me.bottom - height;  
//      
//                if(y>=me.bottom){  
//                    window.clearInterval(me.timer);   
//                    me.Pop.hide();   
//                } else {  
//                    me.offset = me.offset - me.step;   
//                }  
//                me.Pop.show(x,y,width,height);     
//            }              
//        }   
//        this.timer = window.setInterval(fun,this.speed)       
//    }   
//}   
//   
///**//*   
//*    消息卸载事件，可以重写   
//*/   
//CLASS_MSN_MESSAGE.prototype.onunload = function() {   
//    return true;   
//}   
///**//*   
//*    消息命令事件，要实现自己的连接，请重写它   
//*   
//*/   
//CLASS_MSN_MESSAGE.prototype.oncommand = function(){   
//    this.hide();   
// window.open(this.target); 
//}  
///**//*   
//*    消息显示方法   
//*/   
//CLASS_MSN_MESSAGE.prototype.show = function(){   
//    var oPopup = window.createPopup(); //IE5.5+   
//     
//    this.Pop = oPopup;   
//   
//    var w = this.width;   
//    var h = this.height;   
//   
//    var str = "<DIV style='BORDER-RIGHT: #455690 1px solid; BORDER-TOP: #a6b4cf 1px solid; Z-INDEX: 99999; LEFT: 0px; BORDER-LEFT: #a6b4cf 1px solid; WIDTH: " + w + "px; BORDER-BOTTOM: #455690 1px solid; POSITION: absolute; TOP: 0px; HEIGHT: " + h + "px; BACKGROUND-COLOR: #c9d3f3'>"   
//        str += "<TABLE style='BORDER-TOP: #ffffff 1px solid; BORDER-LEFT: #ffffff 1px solid' cellSpacing=0 cellPadding=0 width='100%' bgColor=#cfdef4 border=0>"   
//        str += "<TR>"   
//        str += "<TD style='FONT-SIZE: 12px;COLOR: #0f2c8c' width=30 height=24></TD>"   
//        str += "<TD style='PADDING-LEFT: 4px; FONT-WEIGHT: normal; FONT-SIZE: 12px; COLOR: #1f336b; PADDING-TOP: 4px' vAlign=center width='100%'>" + this.caption + "</TD>"   
//        str += "<TD style='PADDING-RIGHT: 2px; PADDING-TOP: 2px' vAlign=center align=right width=19>"   
//        str += "<SPAN title=关闭 style='FONT-WEIGHT: bold; FONT-SIZE: 12px; CURSOR: hand; COLOR: red; MARGIN-RIGHT: 4px' id='btSysClose' >×</SPAN></TD>"   
//        str += "</TR>"   
//        str += "<TR>"   
//        str += "<TD style='PADDING-RIGHT: 1px;PADDING-BOTTOM: 1px' colSpan=3 height=" + (h-28) + ">"   
//        str += "<DIV style='BORDER-RIGHT: #b9c9ef 1px solid; PADDING-RIGHT: 8px; BORDER-TOP: #728eb8 1px solid; PADDING-LEFT: 8px; FONT-SIZE: 12px; PADDING-BOTTOM: 8px; BORDER-LEFT: #728eb8 1px solid; WIDTH: 100%; COLOR: #1f336b; PADDING-TOP: 8px; BORDER-BOTTOM: #b9c9ef 1px solid; HEIGHT: 100%'>" + this.title + "<BR><BR>"   
//        str += "<DIV style='WORD-BREAK: break-all' align=left><A href='javascript:void(0)' hidefocus=false id='btCommand'><FONT color=#ff0000>" + this.message + "</FONT></A></DIV>"   
//        str += "</DIV>"   
//        str += "</TD>"   
//        str += "</TR>"   
//        str += "</TABLE>"   
//        str += "</DIV>"   
//   
//    oPopup.document.body.innerHTML = str;  
//     
//   
//    this.offset  = 0;  
//    var me  = this;   
//    oPopup.document.body.onmouseover = function(){me.pause=true;} 
//    oPopup.document.body.onmouseout = function(){me.pause=false;} 
//    var fun = function(){   
//        var x  = me.left;  
//        var y  = 0;  
//        var width    = me.width;  
//        var height    = me.height;  
//            if(me.offset>me.height){  
//                height = me.height;  
//            } else {  
//                height = me.offset;  
//            }  
//        y  = me.bottom - me.offset;  
//        if(y<=me.top){  
//            me.timeout--;  
//            if(me.timeout==0){  
//                window.clearInterval(me.timer);   
//                if(me.autoHide){ 
//                    me.hide();  
//                } 
//            }  
//        } else {  
//            me.offset = me.offset + me.step;  
//        }  
//        me.Pop.show(x,y,width,height);     
//    }   
//   
//    this.timer = window.setInterval(fun,this.speed)       
//   
//      
//   
//    var btClose = oPopup.document.getElementById("btSysClose");   
//   
//    btClose.onclick = function(){   
//        me.close = true; 
//        me.hide();   
//    }   
//   
//    var btCommand = oPopup.document.getElementById("btCommand");   
//    btCommand.onclick = function(){   
//        me.oncommand();   
//    }        
//}   
///**//*  
//** 设置速度方法  
//**/  
//CLASS_MSN_MESSAGE.prototype.speed = function(s){  
//    var t = 20;  
//    try {  
//        t = praseInt(s);  
//    } catch(e){}  
//    this.speed = t;  
//}  
///**//*  
//** 设置步长方法  
//**/  
//CLASS_MSN_MESSAGE.prototype.step = function(s){  
//    var t = 1;  
//    try {  
//        t = praseInt(s);  
//    } catch(e){}  
//    this.step = t;  
//}  
//   
//CLASS_MSN_MESSAGE.prototype.rect = function(left,right,top,bottom){  
//    try {  
//        this.left        = left    !=null?left:this.right-this.width;  
//        this.right        = right    !=null?right:this.left +this.width;  
//        this.bottom        = bottom!=null?(bottom>screen.height?screen.height:bottom):screen.height;  
//        this.top        = top    !=null?top:this.bottom - this.height;  
//    } catch(e){}  
//} 

//function mainLoop()
//{
//      var   t=new   Date();  
//      var   time=t.getSeconds() 
//      if (time%5==0)
//      {
//          CheckGif();
//      }  
//      else
//      {
//          CheckMessage();
//     }   
//      var Loop=''; 
//      Loop=parseInt(Math.random()*(30000-120000+1) + 120000);
//      setTimeout("mainLoop()",Loop); 
// 
//} 

//function CheckMessage()
//{
//       var ds=Secretaire.GetMessage().value;
//       if (ds==null) return;  
//       if (ds.Tables.Count<=0) return; 
//       var tb_message=ds.Tables[0];
//       if (tb_message == null) return;
//       if (tb_message.Rows.Count<=0) return; 
//       var title= "滚动新闻";
//       var message=tb_message.Rows[0].title; 
//       var targetprompt="查看详细信息...";
//       var target="FormMessage.aspx?id="+tb_message.Rows[0].id; 
//       var MSG1 = new CLASS_MSN_MESSAGE("aa",200,120,title,message,targetprompt,target);  
//       MSG1.rect(null,null,null,screen.height-50); 
//       MSG1.speed    = 10; 
//       MSG1.step    = 5; 
//       MSG1.show();  
//} 

//function CheckGif()
//{
// 
//       var ds=Secretaire.GetMenuInfo().value;
//       if (ds==null) return; 
//       if (ds.Tables.Count<=0) return; 
//       var tb_message=ds.Tables[0];
//       if (tb_message == null) return;
//       if (tb_message.Rows.Count<=0) return;  
//       var title= "点餐秘书小辛妹提醒您";
//       var message=" 辛香汇刚刚为辛友们提供了一份小礼物-<FONT color=#ff0000>["+tb_message.Rows[0].menu_name+"]</FONT>，快快点击礼品专柜，就有机会成为我们的幸运之星"; 
//       var targetprompt="进入礼品专柜...";
//       var target="FormGiftCounter.aspx?MenuCode="+tb_message.Rows[0].menu_code+"&id="+tb_message.Rows[0].id; 
//       var MSG1 = new CLASS_MSN_MESSAGE("aa",200,120,title,message,targetprompt,target);  
//       MSG1.rect(null,null,null,screen.height-50); 
//       MSG1.speed    = 45; 
//       MSG1.step    = 5; 
//       MSG1.show();  
//} 

//var Loop=''; 
//Loop=parseInt(Math.random()*(10000-120000+1) + 60000); 
//setTimeout("mainLoop()",Loop);



nereidFadeObjects = new Object();
nereidFadeTimers = new Object();
function nereidFade(object, destOp, rate, delta){
if (!document.all)
return
    if (object != "[object]"){  //do this so I can take a string too
        setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0);
        return;
    }
    clearTimeout(nereidFadeTimers[object.sourceIndex]);
    diff = destOp-object.filters.alpha.opacity;
    direction = 1;
    if (object.filters.alpha.opacity > destOp){
        direction = -1;
    }
    delta=Math.min(direction*diff,delta);
    object.filters.alpha.opacity+=direction*delta;
    if (object.filters.alpha.opacity != destOp){
        nereidFadeObjects[object.sourceIndex]=object;
        nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);
    }
}



var i=0
var aaa=0.00
var MImg=0
var w=12
var h=12
var imageold = new Image();
var imagenew = new Image();
imagenew.src='images/selectpic.gif';


function max(object){
if (object==null) return;
/*MImg=object.style.pixelWidth+=4
object.style.pixelHeight=MImg*aaa*/
imageold.src=object.src;
object.src=imagenew.src;
}

//变小
function min(object){
if (object==null) return;
/*MImg=object.style.pixelWidth-=4
object.style.pixelHeight=MImg*aaa*/
object.src=imageold.src;
}

function init(object){
//aaa=object.height/object.width
//object.style.pixelWidth=w
//object.style.pixelHeight=h
}


         
            var image1 = new Image(701, 683);
            image1.src = 'TableImages\Dinner_gc_pdd.jpg';
            var image2 = new Image(701, 683);
            image2.src =  'TableImages\Dinner_gc_cxd.jpg';

            function DisplayImage(image) {
	            var theImage = document.images['ImageMap1'];
	            if (!theImage) {
	                theImage = document.getElementById('ImageMap1');	
	            }
                theImage.src = image.src;
                return true;
            }
            

/********************************************************************************************

   ToolTip.js
   Copyright by FLYSO Blog, All rights reserved.

********************************************************************************************/


function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

/********************************************************************************************

Dynamic Drive DHTML code library (www.dynamicdrive.com)

********************************************************************************************/

var offsetxpoint = -20; // 
var offsetypoint = 20;   // 
var ie = document.all;
var ns6 = document.getElementById && !document.all;
var safari = isSafari();
var enabletip = false;

function showTip(messageContent)
{
// 
var desc = messageContent.split(';');

messageContent = "";
if (desc[3])
{
   var imageAttr = "";
   if (parseInt(desc[4],10) >= parseInt(desc[5],10))
   {
    imageAttr = "width='100'";
   }
   else
   {
    imageAttr = "height='100'";
   }

   // messageContent = messageContent + desc[4] + "/" + desc[5] + imageAttr;
   messageContent = messageContent + "<img src='http://www.flyso.net/"+ desc[3] + "' " + imageAttr + " align='right' style='padding:3px; margin: 3px; border: 3px solid #cccccc;'>";
}

if (desc.length > 2)
{
   messageContent = messageContent + "<strong>标题</strong> : " + desc[0] + "<br>";
}
else
{
   messageContent = desc[0];
}

if (desc[6]) { messageContent = messageContent + "<strong>发布时间</strong> : " + desc[6] + "<br>"; }
if (desc[1]) { messageContent = messageContent + "<strong>内容</strong> : " + desc[1] + "<br>"; }
if (desc[2]) { messageContent = messageContent + "<strong>浏览次数</strong> : " + desc[2] + " 次<br>"; }
if (desc[3]) { messageContent = messageContent + "<strong>图片大小</strong> : 宽度:" + desc[4] + "px, 高度:" + desc[5] + "px<br>"; }


//ddrivetip(messageContent);

var tipObject = MM_findObj('toolTipWindow');
tipObject.innerHTML = messageContent;
enabletip = true;
return false;
}

function hideTip()
{
// 
var tipObject = MM_findObj('toolTipWindow'); 
enabletip = false;
tipObject.style.visibility = "hidden";
}

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
}
function isSafari(){
return navigator.userAgent.toLowerCase().indexOf("safari") + 1;
}

function positionTip(e)
{
if (enabletip)
{
   var tipobj = MM_findObj('toolTipWindow');
  
   var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
   var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
   //Find out how close the mouse is to the corner of the window
   var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20;
   var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20;
  
   var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000
  
   //if the horizontal distance isn't enough to accomodate the width of the context menu
   if (rightedge<tipobj.offsetWidth)
   {
    //move the horizontal position of the menu to the left by it's width
    tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"
   }
   else if (curX<leftedge)
   {
    tipobj.style.left="5px"
   }
   else
   {
    //position the horizontal position of the menu where the mouse is positioned
    tipobj.style.left=curX+offsetxpoint+"px";
   }

   if(safari)
   {
    tipobj.style.top=curY+offsetypoint+"px";
   }
   else
   {
    //same concept with the vertical position
    if (bottomedge<tipobj.offsetHeight)
    {
     tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px";
    }
    else
    {
     tipobj.style.top=curY+offsetypoint+"px";
    }
   }
   tipobj.style.visibility="visible";
}
}

document.onmousemove = positionTip;


function enableTooltips(id){
var links,i,h;
if(!document.getElementById || !document.getElementsByTagName) return;
AddCss();
h=document.createElement("span");
h.id="btc";
h.setAttribute("id","btc");
h.style.position="absolute";
document.getElementsByTagName("body")[0].appendChild(h);
if(id==null) links=document.getElementsByTagName("a");
else links=document.getElementById(id).getElementsByTagName("a");
for(i=0;i<links.length;i++){
       Prepare(links[i]);
       }
}

function Prepare(el){
var tooltip,t,b,s,l,id;
id=el.getAttribute("id");
if (id!="tableindex") return;
if(t==null || t.length==0) t="餐桌介绍：";
t=el.getAttribute("title");
if(t==null || t.length==0) t="餐桌介绍：";
el.removeAttribute("title");
tooltip=CreateEl("span","tooltip");
s=CreateEl("span","top");
s.appendChild(document.createTextNode(t));
tooltip.appendChild(s);
b=CreateEl("b","bottom");
l=el.getAttribute("href");
if(l.length>28) l=l.substr(0,25)+"...";
//b.appendChild(document.createTextNode(l));
tooltip.appendChild(b);
setOpacity(tooltip);
el.tooltip=tooltip;
el.onmouseover=showTooltip;
el.onmouseout=hideTooltip;
el.onmousemove=Locate;
}

function showTooltip(e){
document.getElementById("btc").appendChild(this.tooltip);
Locate(e);
}

function hideTooltip(e){
var d=document.getElementById("btc");
if(d.childNodes.length>0) d.removeChild(d.firstChild);
}

function setOpacity(el){
el.style.filter="alpha(opacity:95)";
el.style.KHTMLOpacity="0.95";
el.style.MozOpacity="0.95";
el.style.opacity="0.95";
}

function CreateEl(t,c){
var x=document.createElement(t);
x.className=c;
x.style.display="block";
return(x);
}

function AddCss(){
var l=CreateEl("link");
l.setAttribute("type","text/css");
l.setAttribute("rel","stylesheet");
l.setAttribute("href","bt.css");
l.setAttribute("media","screen");
document.getElementsByTagName("head")[0].appendChild(l);
}

function Locate(e){
var posx=0,posy=0;
if(e==null) e=window.event;
if(e.pageX || e.pageY){
       posx=e.pageX; posy=e.pageY;
       }
else if(e.clientX || e.clientY){
       if(document.documentElement.scrollTop){
           posx=e.clientX+document.documentElement.scrollLeft;
           posy=e.clientY+document.documentElement.scrollTop;
           }
       else{
           posx=e.clientX+document.body.scrollLeft;
           posy=e.clientY+document.body.scrollTop;
           }
       }
document.getElementById("btc").style.top=(posy+10)+"px";
document.getElementById("btc").style.left=(posx-20)+"px";
}





///////////////////////////////////////////////////////
var offsetfromcursorX = 12;
var offsetfromcursorY = 10;
var offsetdivfrompointerX = 10;
var offsetdivfrompointerY = 14;

document.write('<div id="dhtmltooltip"></div>');
document.write('<img id="dhtmlpointer" src="Images/tooltiparrow.gif">');

var ie = document.all;
var ns6 = document.getElementById && ! document.all;
var enabletip = false;

if (ie || ns6)
  var tipobj = document.all ? document.all["dhtmltooltip"] : document.getElementById ? document.getElementById("dhtmltooltip") : "";

var pointerobj = document.all ? document.all["dhtmlpointer"] : document.getElementById ? document.getElementById("dhtmlpointer") : "";

function ietruebody() {
  return (document.compatMode && document.compatMode != "BackCompat") ? document.documentElement : document.body;
}

function showtip(thetext, thewidth, thecolor) {
  if (ns6 || ie) {
    if (typeof thewidth != "undefined")
      tipobj.style.width = thewidth + "px";
    if (typeof thecolor != "undefined" && thecolor != "")
    
     tipobj.style.backgroundColor = thecolor;
      thetext="1.如没有注册，请先注册会员，然后登录<br>"+

"2.在首页点击在线预订进入到店铺的导航页面<br>"+

"3.选择所需预订的店铺名称，点击黄色我要定座按钮<br>"+

"4.选择就餐日期及市别后点击查询按钮进入到店铺平面图<br>"+

"5.平面图上有绿色圆点的餐桌代表可以接受网络预订<br>"+

"6.根据就餐人数选择您所需预订餐桌，点击绿色圆点查看该餐位环境图片<br>"+

"7.如要预订该餐桌，请选择用辛元订位或点餐单据号订位<br>"+

"8.如用点餐单据号订位，需在线点餐获取点餐单据号，点好菜后复制点"+

"餐单据号，然后点击点餐单据号订位，预订成功。<br>"+

"9.您的手机会收到预订成功短信通知<br>"+

"10.就餐时，至您所预订的店铺，告知店内迎宾您的手机号码即可";

    tipobj.innerHTML = thetext;
    tipobj.onmouseout = hidetip;
    enabletip = true;
    return false;
  }
}

function positiontip(e) {
  if (enabletip) {
    var nondefaultpos = false;
    var curX = (ns6) ? e.pageX : event.clientX + ietruebody().scrollLeft;
    var curY = (ns6) ? e.pageY : event.clientY + ietruebody().scrollTop;
    
    var winwidth = ie && ! window.opera ? ietruebody().clientWidth : window.innerWidth - 20;
    var winheight = ie && ! window.opera ? ietruebody().clientHeight : window.innerHeight - 20;

    var rightedge = ie && ! window.opera ? winwidth - event.clientX - offsetfromcursorX : winwidth - e.clientX - offsetfromcursorX;
    var bottomedge = ie && ! window.opera ? winheight - event.clientY - offsetfromcursorY : winheight - e.clientY - offsetfromcursorY;

    var leftedge = (offsetfromcursorX < 0) ? offsetfromcursorX * (- 1) : - 1000;

    if (rightedge < tipobj.offsetWidth) {
      tipobj.style.left = curX - tipobj.offsetWidth + "px";
      nondefaultpos = true;
    }
    else if (curX < leftedge)
      tipobj.style.left = "5px";
    else {
      tipobj.style.left = curX + offsetfromcursorX - offsetdivfrompointerX + "px";
      pointerobj.style.left = curX + offsetfromcursorX + "px";
    }

    if (bottomedge < tipobj.offsetHeight) {
      tipobj.style.top = curY - tipobj.offsetHeight - offsetfromcursorY + "px";
      nondefaultpos = true;
    }
    else {
      tipobj.style.top = curY + offsetfromcursorY + offsetdivfrompointerY + "px";
      pointerobj.style.top = curY + offsetfromcursorY + "px";
    }

    tipobj.style.visibility = "visible";

    if (! nondefaultpos)
      pointerobj.style.visibility = "visible";
    else
      pointerobj.style.visibility = "hidden";
  }
}

function hidetip() {
  if (ns6 || ie) {
    enabletip = false;
    tipobj.style.visibility = "hidden";
    pointerobj.style.visibility = "hidden";
    tipobj.style.left = "-1000px";
    tipobj.style.backgroundColor = '';
    tipobj.style.width = '';
  }
}

if ( typeof window.addEventListener != "undefined" )
document.addEventListener( "mousemove", positiontip, false );
else if ( typeof window.attachEvent != "undefined" )
document.attachEvent( "onmousemove", positiontip );
else {
if ( document.onmousemove != null ) {
var oldOnmousemove = document.onmousemove;
document.onmousemove = function ( e ) {
oldOnmousemove( e );
positiontip(e);
};
}
else
document.onmousemove = positiontip;
}









