﻿function setusername(obj)
{
    if(obj.value==''||obj.value=='请输入用户名')
    {
        obj.value='请输入用户名';
        obj.style.color='#ccc';
    }
}

function clearusername(obj)
{
    obj.value='';
    obj.style.color='#000';
}

function ontip(){
    var num=document.getElementById('lbltip').innerText;
    returnString="";
    var PostInfo="FunctionName=dotip&id="+num+"";
    AJpost(PostInfo);
    if(returnString.indexOf("Error")!=-1)
    {
     
       alert(returnString);
       return ;
    }
     alert(returnString);
     window.location.reload();
}

function GoTo(s)
{      
    var path= window.location.href;
    path=path.substring(path.lastIndexOf('?i=')+3);  
    if(s==1)
    {         
        location.href= "pinglun"+path+".shtml";      
        alert('谢谢参与！'); 
    }
    if(s==2)
    {
        location.href= "pinglun"+path+".shtml";      
        alert('谢谢您的支持！'); 
    }
    if(s==3)
    {
        location.href= "pinglun"+path+".shtml";      
        alert('谢谢您的评价！'); 
    }
    
}  

function copyToClipBoard(){ 
var clipBoardContent=""; 
clipBoardContent+=document.title; 
clipBoardContent+=""; 
clipBoardContent+=this.location.href; 
window.clipboardData.setData("Text",clipBoardContent); 
alert("复制成功，请粘贴到您的QQ/MSN上推荐给您的好友"); 
}

function tosearch(s)
{
    document.getElementById("txtSearch").innerText=s;
}

function tochaye(o)
{
    for(var i=1;i<4;i++)
    {
        if(i==o)
        {
            document.getElementById('cyjs'+i).style.display='block';
        }else
        {
            document.getElementById('cyjs'+i).style.display='none';
        }
    }
}
function tochaye2(o)
{
    for(var i=1;i<4;i++)
    {
        if(i==o)
        {
            document.getElementById('cyjss'+i).style.display='block';
        }else
        {
            document.getElementById('cyjss'+i).style.display='none';
        }
    }
}

function sendmess()
{
    if(document.getElementById('txtContent').value=='')
    {
        alert('请填写评论内容');
        return false;
    }else
    {
        return true;
    }
}

function menu_s(i)
{
    for(var a=1;a<7;a++)
    {
        if(a==i)
        {
            document.getElementById('menu'+i).className='mu';
        }else
        {
            document.getElementById('menu'+a).className='nmu';
        }
    }
}

function tip(num,t)
{
    returnString="";
    var PostInfo="FunctionName=tip&id="+num+"&t="+t+"";
    AJpost(PostInfo);
       
   alert('谢谢您的参与');
   document.getElementById('lbltip').innerText=returnString;
   return ;
    
}

function tep(num,t)
{
    returnString="";
    var PostInfo="FunctionName=tep&id="+num+"&t="+t+"";
    AJpost(PostInfo);
       
   alert('谢谢您的参与');
   document.getElementById('lbltrampe').innerText=returnString;
   return ;
    
}

function search_info()
{
    var type=document.getElementById('DropDownList1').value;
    var sear=document.getElementById('txtSearch').value;
    if(sear=='')
    {
    alert('请输入查询内容');
    return;
    }else{
    returnString="";
    var PostInfo="FunctionName=searchinfo&type="+escape(type)+"&con="+escape(sear)+"";
    AJpost(PostInfo);
    window.open(returnString);
    return;}
}

function addzc(nid,id){
    returnString="";
    var PostInfo="FunctionName=zc&id="+id+"";
    AJpost(PostInfo);
       
   alert('谢谢您的参与');
   document.getElementById('newszc'+id).innerText=returnString;
   return ;
}

function addfd(nid,id){
    returnString="";
    var PostInfo="FunctionName=fd&id="+id+"";
    AJpost(PostInfo);
       
   alert('谢谢您的参与');
   document.getElementById('newsfd'+id).innerText=returnString;
   return ;
}
