function IPPT(){}
IPPT.pause=2000;//暂停时间
IPPT.index=0;
IPPT.count=0;
IPPT.timer=null;
IPPT.Init=function(){//初始化
    this.count=jq("#idImg img").size();
    var str1=str2="";
    jq("#idImg a").each(function(index){
        str1+="<li><a href=\""+jq(this).attr("href")+"\" target=\"_blank\">"+jq(this).attr("title")+"</a></li>";
        str2+="<li>"+(index+1)+"</li>";
    });
    jq("#idTitle").append(str1);
    jq("#idOrder").append(str2);
    if(this.count>1)
    {
        jq("#idOrder li").each(function(index,ele)
        {
            jq(ele).hover(function(){clearInterval(IPPT.timer);IPPT.goTo(index);}, function(){IPPT.play();});
        });
        this.index=0;
        this.play();
        jq("#idImg img").hover(function(){clearInterval(IPPT.timer)}, function(){IPPT.play();}); 
    }   
    jq("#idOrder li").addClass('order_li').filter(':first').addClass('order_li_hover');
    jq('#flash_img_bg').fadeTo("slow",0.5);//将背景调制1/2的可见度    
}
IPPT.play=function(){//设置时长
    this.timer=setInterval("IPPT.auto()",this.pause);
}
IPPT.goTo=function(index)//转到指定项上
{
    clearInterval(this.timer);
    this.index=index;
    this.change(this.index);
}
IPPT.change=function(i){//改变图片及样式
    jq("#idImg img").hide().eq(i).fadeIn('slow');
    jq("#idTitle li").hide().eq(i).fadeIn('fast');
    jq('#idOrder li').removeClass().addClass('order_li').eq(i).addClass('order_li_hover').blur();
}
IPPT.auto=function(){//当没有鼠标激发时，自动运行
    this.index = this.index > this.count - 2 ? 0 : this.index + 1;
    this.change(this.index);
}
jq(function(){IPPT.Init();});

fPPT.items="";
fPPT.pause=2000;//暂停时间
fPPT.speed=200;//动画速度
fPPT.index=0;
fPPT.count=0;
fPPT.timer=null;
fPPT.play=function(){//设置时长
    this.timer=setInterval("fPPT.auto()",fPPT.pause);
}
fPPT.change=function(i){//改变图片及样式
	jq(this.items).hide().eq(i).fadeIn(fPPT.speed);
}
fPPT.auto=function(){//当没有鼠标激发时，自动运行
    this.index = this.index > this.count - 2 ? 0 : this.index + 1;
    this.change(this.index);
}
fPPT.Next=function(){//下一个
this.index++;
this.index = this.index > this.count - 1 ? 0 : this.index;
    this.change(this.index);
}
fPPT.Pre=function(){//上一个
this.index--;
this.index = this.index <0?this.count -1:this.index;
    this.change(this.index);
}
function fPPT(Items,pa,sp,w,h,per,next)
{
	fPPT.items=Items;
	fPPT.count=jq(Items).length;	
	if(sp!=null)fPPT.speed=sp;
	if(pa!=null)fPPT.pause=pa;	
	fPPT.pause+=fPPT.speed;
	if(per!=null){jq(per+","+next).hover(function(){clearInterval(fPPT.timer)}, function(){fPPT.play();});jq(per).mousedown(function(){fPPT.Pre();});}
	if(next!=null)jq(next).mousedown(function(){fPPT.Next();});
	jq(Items).hover(function(){clearInterval(fPPT.timer)}, function(){fPPT.play();});
	fPPT.play();
}

