function search(){
    var q = document.getElementById('sinput').value;
    if ( q=="")
       alert('请输入您要搜索的关键字!');
    else
       window.location.href = "/html/search.html?q="+q;
}

function msgsearch(box){
    var q = document.getElementById(box).value;
    if ( q=="")
       alert('请输入您要搜索的关键字!');
    else
       window.location.href = "/html/msgs.html?q="+q;
}

function settab(index,t,max)
{  
    var i;
    for ( i=0;i<max;i++)
    {
        var o = document.getElementById(t+i);
        var p = document.getElementById(t+"p"+i);
        var m = document.getElementById(t+"m"+i);
        if ( index == i){
           p.style.display='';
           if ( m!=null) m.style.display='';
           o.className='tabh';
        }else{
           p.style.display='none'; 
           o.className='tab';
            if ( m!=null) m.style.display='none';
        } 
    }
}

function setbar(index)
{
    var i;
    for ( i=0;i<3;i++)
    { 
        var o = document.getElementById("bar"+i);
        if ( index == i){
           o.style.display='';  
        }else{
           o.style.display='none';             
        } 
    }
}
function showmenu(id,s,r)
{
   var e = document.getElementById("p_"+id);  
   var o = document.getElementById(id);
   if ( s){
        o.style.display="";
        o.style.zIndex=201;
        o.style.position='absolute';           
        o.style.posLeft = r? getLeft(e)-o.offsetWidth : getLeft(e); 
        o.style.posTop =  r? getTop(e):e.offsetHeight+getTop(e);    
   }else
       o.style.display='none';
}

function getTop(e){
    var offset=e.offsetTop;
    if(e.offsetParent!=null) offset+=getTop(e.offsetParent);
    return offset;
}

function getLeft(e){
    var offset=e.offsetLeft;
    if(e.offsetParent!=null) offset+=getLeft(e.offsetParent);
    return offset;
}


// old // 

        function EnterTextBox(button,textbox)
        {
            //if(event.keyCode == 13 && document.all["TextBox1"].value != "")
            if (event.keyCode ==13)
            {
                event.returnValue = false;
                if (document.all[textbox].value != "")
                {
                    //event.keyCode = 9;
                    document.all[button].click();
                }
            }
        }   
        
        function LinkUrl()   
        {
            window.open("http://www.pingan.com/campaign/channels/pingan/car-quote/index.jsp?WT.mc_id=c03-sxjjw", "newwindows", "toolbar=yes, menubar=yes, resizable=yes, scrollbars=yes, location=yes, status=yes"); 
        }
 
        function fsIn(textbox,s)
        {
            if ( textbox.value==s)
               textbox.value='';
        }             
        
        function fsOut(textbox,s)
        {
 if ( textbox.value=='')
               textbox.value=s;

            
        }

