﻿// JScript 文件
function bookmark(){	
    var title=document.title
    var url=document.location.href;
    if (window.sidebar) window.sidebar.addPanel(title, url,"");
    else if( window.opera  &&  window.print ){
    var mbm = document.createElement('a');
    mbm.setAttribute('rel','sidebar');
    mbm.setAttribute('href',url);
    mbm.setAttribute('title',title);
    mbm.click();}
    else if(document.all) window.external.AddFavorite(url,title);
}

function CPos(x, y)
{
    this.x = x;
    this.y = y;
}

function GetObjPos(ATarget)
{
    var target = ATarget;
    var pos = new CPos(target.offsetLeft, target.offsetTop);    
    var target = target.offsetParent;
    while (target)
    {
        pos.x += target.offsetLeft;
        pos.y += target.offsetTop;
        
        target = target.offsetParent
    }    
    return pos;
}

function showPanel(obj)
{
    pos = GetObjPos(obj);
	var pane = document.getElementById("cityPanel");
	pane.style.display="block";
	pane.style.left = pos.x +"px";
	pane.style.top = pos.y + 17 +"px";
}
function hidePanel()
{
	document.getElementById("cityPanel").style.display="none";
}
