﻿function scrollNews(selector,Entry,time,StartIndex)
{
	var _self=this;
	this.Selector=selector;
	this.Entry=Entry;
	this.time = time;
	this.i=StartIndex||0;
	this.Count=5;//$(this.Selector+" ul li").length;
	$(this.Selector+" ul li").hide();//全部隐藏
	$(this.Selector+" ul li").eq(this.i).show();//第i个显示
	$(this.Selector).bind("mouseenter",function(){
	    	if(_self.sI){clearInterval(_self.sI);}
	}).bind("mouseleave",function(){
			_self.showIndex(_self.i++);
	})
	this.sI=setInterval(this.Entry+".showIndex(null)",this.time);
	this.GetSelector=function(){return this.Selector;}
	this.showIndex=function(index)
	{
		this.i++;//显示下一个
		if(this.sI){clearInterval(this.sI);}
		this.sI=setInterval(this.Entry+".showIndex()",this.time);
		if (index!=null)
		{
			this.i=index;
		}
		//alert(this.i +','+this.Count)
		if(this.i==this.Count)
			this.i=0;
		$(this.Selector+" ul li").hide();
		$(this.Selector+" ul li").eq(this.i).slideDown();
	}
}
var s=new scrollNews(".logo","s", 3000 , 0);

$(document).ready(function(){
            $("#txtSearch").click(function(){
                            if($(this).val()=='请输入查询关键字')
                                $(this).val('');
                            else
                                $(this).select();
            });
            $("#txtSearch").blur(function(){
                            if($(this).val()=='')
                                $(this).val('请输入查询关键字');
            });
            
});

function chkValidateNum()
    {
        var retVal =  $.ajax({
           type: "POST",
           url: "/Ajax.aspx",
           data: "cmd=chkCode&cid="+$("#txtValidateNum").val(),
           async: false
        }).responseText;  
        if(retVal == '0')
            return true;
        else
            return false;
    }
