﻿
$(
	function(){
		$.afterLoadScript(
						  function(){
						  //---------------	
						           $("#Entrust").click(function(){
						                window.location.href="Entrust.aspx";
						           })
						           
						           $("#btn_viewEntrust").click(function(){
						                if($("#No").val()==""){
						                    alert("请填写受理号");
						                    return;
						                }
						                if($("#validCode").val()==""){
						                    alert("请填写验证码");
						                    return;
						                }
						                
						                 $.getJSON("ajax.aspx",{cmd:"viewEntrust",rnd:new Date().toString(),No:$("#No").val(),validCode:$("#validCode").val()},function(data){
						                        if(data.status=="success"){
						                            alert(data.msg);
						                            
						                        }else if(data.status=="err"){
						                            if(data.msg){
						                                alert(data.msg);
						                            }else{
						                                alert("网络错误，请重试！");
						                            }
						                        }else{
						                            
						                            alert("网络错误，请重试！");
						                        }
						                    });
						                    
						                    if(!window.issetAjaxInt){
						                        window.issetAjaxInt=true
						                     $(window).ajaxError(function(event,request, settings){
                                                     alert("网络错误，请重试！");
                                                     $.unblockUI();
                                               }); 
                                                $(window).ajaxSend(function(event,request, settings){
                                                   $.blockUI({message:"数据提交中，请稍候。。。"});
                                               }); 
                                               $(window).ajaxComplete(function(event,request, settings){
                                                   $.unblockUI();
                                               }); 
						                    }
						                    
						           })
						           
						          
						           
						           $("#slideFlash2").MakeFlash({width:218,height:170,border:"1px solid #ccc",timedelay:2000,Direction:"up",navButtonBackground:"red",navButtonColor:"#fff"});
						           
						   
						           if($("#fclist li").size()>0){
						                marquee();
						           }
						  	//----------------------	
						  		
	                            });
	}
)


function marquee(){
    var coll=$("#fclist li");
    var current=$("#fclist li.current");
    var nowIndex=0;
    if(current.size()<=0){
        $("#fclist li:eq(0)").addClass("current")
    }else{
        if(current.next().size()>0){
            current.removeClass("current");
            current.next(":eq(0)").addClass("current")
        }else{
            current.removeClass("current");
            coll.eq(0).addClass("current")
        }
    }
    
    coll.each(function(){
        if($(this).hasClass("current")){
            $(this).find("a").css({color:"red"});
            $("#fcimg").attr("src",$(this).find("a").attr("img"));
        }else{
            $(this).find("a").css({color:"#646464"});
        }

    })
    
    
    setTimeout("marquee()",3000); 
}
