function CreateBookmarkLink() { 
    title = "意古中医 ——中医在线知识库";  
    url = "http://www.tcmlib.com/";  
    if (window.sidebar) { 
        // Mozilla Firefox Bookmark     
        //alert("FIREFOX!");
        window.sidebar.addPanel(title, url,""); 
    } else if( window.external ) { 
        // IE Favorite      
        //alert("YES IE");
        window.external.AddFavorite( url, title); 
    }   
    else if(window.opera && window.print) { 
        // Opera Hotlist        
        return true; 
    } 
} //-->

function getEid(id) {
    return document.getElementById(id);
}
function googleSearch() {
    var form = getEid('webfrm');
    var s=getEid('s');
    var gclient = getEid('gclient');
    var gie = getEid('gie');
    var goe = getEid('goe');
    var ghl = getEid('ghl');
    var gchannel = getEid('gchannel');
    var tcmtype = getEid('tcmtype');
    var SearchPattern = getEid('SearchPattern');
    var tcminp_b = getEid('tcminp_b');
    var tcminp_c = getEid('tcminp_c');
    var gdomains = getEid('gdomains');
    var gsitesearch = getEid('gsitesearch');
    var gforid = getEid('gforid');
    var gflav = getEid('gflav');
    var gsig = getEid('gsig');
    var gcof = getEid('gcof');
    var sp1 = getEid('sp1');
    var sp2 = getEid('sp2');
    var sp3 = getEid('sp3');

    gclient.disabled = false;
    gie.disabled = false;
    goe.disabled = false;
    ghl.disabled = false;
    gdomains.disabled = false;
    gsitesearch.disabled = false;
    gchannel.disabled = false;
    gforid.disabled = false;
    gflav.disabled = false;
    gsig.disabled = false;
    gcof.disabled = false;
    tcmtype.disabled = true;
    sp1.disabled = true;
    sp2.disabled = true;
    sp3.disabled = true;
    form.action='http://www.google.cn/custom';
    s.name='q';
    form.target='_blank';
    form.submit();
    gclient.disabled = true;
    gie.disabled = true;
    goe.disabled = true;
    ghl.disabled = true;
    gdomains.disabled =  true;
    gsitesearch.disabled =  true;
    gchannel.disabled = true;
    gforid.disabled = true;
    gflav.disabled = true;
    gsig.disabled = true;
    gcof.disabled = true;
    tcmtype.disabled = false;
    sp1.disabled = false;
    sp2.disabled = false;
    sp3.disabled = false;
    form.action='/';
    form.target='';
    s.name='s';
}

function aliasSearch() {
    var form = getEid('webfrm');
    var sp1 = getEid('sp1');
    var sp2 = getEid('sp2');
    var sp3 = getEid('sp3');

    sp1.checked = false;
    sp2.checked = false;
    sp3.checked = true;
    form.submit();
    sp1.checked = true;
    sp2.checked = false;
    sp3.checked = false;
    form.action='/';
}


var aTmpTitle = "";
function  Point(x,y)
{
    this.x  =  x;  this.y  =  y;
}

//Get  the  mouse  position
function  getMouseLoc(e)  
{
    var  IE  =  document.all?true:false;  //Test  to  see  if  IE
    if  (!IE)  document.captureEvents(Event.MOUSEMOVE);  //If  not  IE

    if  (IE)  {  
    mouseLocation.x  =  event.clientX +  (document.documentElement.scrollLeft ?  document.documentElement.scrollLeft : document.body.scrollLeft);
    mouseLocation.y  =  event.clientY +  (document.documentElement.scrollTop ?  document.documentElement.scrollTop : document.body.scrollTop);

    }  else  {    //  grab  the  x-y  pos.s  if  browser  is  NS
    mouseLocation.x  =  e.pageX;
    mouseLocation.y  =  e.pageY;
    }    
    //  catch  possible  negative  values  
    if  (mouseLocation.x  <  0){mouseLocation.x  =  0}
    if  (mouseLocation.y  <  0){mouseLocation.y  =  0}    
    positionDiv();
    return  true;
}

function  positionDiv()
{    
    //Set  the  position  of  the  hidden  div
    document.getElementById('overdiv').style.top  =  (mouseLocation.y  +  10)  +  "px";
    document.getElementById('overdiv').style.left  =  (mouseLocation.x  +  10)  +"px";
    document.getElementById('overdiv').style.position  =  "absolute";    
}

function showhiddendiv(mylink)
{
    mouseLocation  =  new  Point(0,0);
    document.onmousemove  =  getMouseLoc;
    document.getElementById('overdiv').style.display = 'block';
    var linkdiv = document.getElementById('hiddendiv');
    var linktitle = document.getElementById(mylink); 
    sTmp=linktitle.title;
    sTmp = sTmp.replace(/;/g,'<br />');
    linkdiv.innerHTML=sTmp;
    aTmpTitle = linktitle.title;
    linktitle.title = '';
}

function hiddendiv(mylink)
{
    var linktitle = document.getElementById(mylink); 
    linktitle.title = aTmpTitle;
    document.getElementById('overdiv').style.display = 'none';
}
