//JavaScript Document
//定义的全局变量
var nLastViewPage=0;//记录主界面初始时显示的页
var fastnavflag=true;//标识快捷导航图标的编辑状态
var warnMSG,mentionMSG;//警告和提示信息的内容变量
var warTimeout,tipTimeout;//警告和提示的定时器函数
var nLastPageIndex = 0;//记录pop图标最后的页数
var speed0 = 20;
var popexitFL = false;
var nLVflag;
var altcon;
//var dragCONTROL = true;
//托盘中鼠标拖动和单击事件的区分 
$(function(){ 
$(":checkbox").hide(); 
CheckBoxTab();
var PADDINGNUM = $(".Schedule").html();
$("#Selecttracks").html(PADDINGNUM).css("visibility","hidden");
//$(".tabboxcon1").eq(1).show().siblings().hide();	
$('.rounded').each(function() { 		
	PIE.attach(this);
});
$(".toollist li a").focus(function(){
	$(this).blur();
});
var startPointX,endPointX; 
var bMouseMove,bLeftButtonDown,clflag; 
$("#list1 li").live("mousedown",function(e){
	if(window.event.button == 1 ){		
		startPointX = e.pageX;//记录起始位置 
		bLeftButtonDown = true; 
		bMouseMove = false; 
		clflag = true; 		
	} 
	else{ 
		clflag=false; 
	} 
})
var Count = 0;
$("#list1>li").live("mouseup",function(e){ 	
if(clflag==true){ 
endPointX = e.pageX;//记录最终位置
bLeftButtonDown = false; 
if(Math.abs(startPointX-endPointX) <= 10 && fastnavflag==true && !bMouseMove) // && dragCONTROL==true
{
	TempThis = $(this);
	function Jump(){									  
		 if( TempThis.children(".back").css("top") == "-10px")
		 {
			 TempThis.children(".back").animate({"top":0},500,function(){
					 if(Count == 2)
					 { 
						clearInterval(hIntervar);
						TempThis.children(".back").animate({"top":0},500);
						return;
					}	
			 });
		}
		else
		{
			TempThis.children(".back").animate({"top":-10},500);
			 if(Count == 2)
					 { 
						clearInterval(hIntervar);
						TempThis.children(".back").animate({"top":0},500);
						return;
					}	
		}
	}
	var hIntervar=setInterval(Jump,500);
	UIToBackApp("EXECUTE_ADT_QUICK_APPLICATION",TempThis.find("img[id]").attr("id"));
	Count = 2;
} 
else 
{
//alert("拖动事件");
} 
} 
}) 
$("#list1 li").live("mousemove",function(e){ 				 
	if(clflag==true ){//&& dragCONTROL==true 
		if(bLeftButtonDown) 
		{ 
			endPointX = e.pageX;//记录最终位置 
			if(Math.abs(startPointX-endPointX) > 10 ) 
			{
				$(this).children(".back").css("cursor","move");
				bMouseMove = true; 
				UIToBackApp("SAVE_QUICKLAUNCHBAR_HTML",$("#list1").html());
			} 
			else{	 
				$(this).children(".back").css("cursor","pointer");
			}
		} 
	} 
}) 
$("#list1").dragsort({ 
	dragSelector: "div", dragBetween: false, dragEnd: saveOrder, placeHolderTemplate: "<li class='placeHolder'><div></div></li>" 
}); 
})
$(function INITSET(){
	$(".skintab").click(function(){
		UIToBackApp('OPEN_WINDOW_SKINS','');	
	})
	/*$("#demo20").html($("#demo10").html() + $("#demo10").html());
	setInterval(function(){
		if($("#demo20").outerWidth()-$("#demo0").scrollLeft()>200) {
		$("#demo0").scrollLeft($("#demo0").scrollLeft() + $("#demo10").outerWidth());
		}
		else{ 
			$("#demo0").scrollLeft($("#demo0").scrollLeft()-1); 
		} 
	},speed0)*/	
    $(".tabboxcon1 a").click(function(){
	   UIToBackApp('EXECUTE_ADT_QUICK_APPLICATION',this.id);
	}) 	
	var bContinue = true;
    $(".pulsbut").live("click",function(){
		if(!bContinue)
		{
			return;
		}
		else			
		{
			//UIToBackApp('ENABLE_ONECLICK_SENDMSG_TOUI',0);
			//alertEx("OK1");
			$(".pagelihover").hide();
			if(!popexitFL){
				bContinue = true;
				fastnavflag = false;
				$("#list1 li").die("mouseenter",list1moveEnter);
				$("#list1 li").die("mouseleave",list1moveLeave);
				$("#list1").find(".bgtest").add(".minus").show();
				$("#list1>li").each(function(){								 
					$(this).find(".imgwrap").children().eq(1).show().siblings().hide();				
				})
				//$(".con").hide();'
				$(".conwrapinner").css({"left":-773})
				//$(".conwrapinner").animate({"left":-773},1000,function(){ return bContinue = true;})
				//$("#hbg").hide();UIToBackApp('ENABLE_ONECLICK_SENDMSG_TOUI',1)
				popexitFL = true;
				//UIToBackApp('ENABLE_ONECLICK_SENDMSG_TOUI',1)
			}
			else{
				//$(".con").show();
				$(".conwrapinner").css("left",0)
				//$("#hbg").show();
				$("#list1 li").live("mouseenter",list1moveEnter);
				$("#list1 li").live("mouseleave",list1moveLeave);
				$("#list1>li").each(function(){
					$(this).find(".imgwrap").children(":even").show().siblings().hide();
				})
				$("#list1").find(".bgtest").add(".minus").hide();
				clearTimeout(warTimeout);
				clearTimeout(tipTimeout);
				$(".mention").hide();
				$(".warn").hide();
				popexitFL = false;
				bContinue = true;
				fastnavflag = true;
				//UIToBackApp('ENABLE_ONECLICK_SENDMSG_TOUI',1);
				UIToBackApp("SAVE_QUICKLAUNCHBAR_HTML",$("#list1").html());
			}
		}
		//UIToBackApp('ENABLE_ONECLICK_SENDMSG_TOUI',1)
    })
	$(".listclose").live("click",function(){
		//UIToBackApp('ENABLE_ONECLICK_SENDMSG_TOUI',0);
		$(".conwrapinner").css("left",0)
		$("#list1 li").live("mouseenter",list1moveEnter);
	    $("#list1 li").live("mouseleave",list1moveLeave);
		$("#list1>li").each(function(){
			$(this).find(".imgwrap").children(":even").show().siblings().hide();				
		})		
		$("#list1").find(".bgtest").add(".minus").hide();
		clearTimeout(warTimeout);
		clearTimeout(tipTimeout);
		$(".mention").hide();
		$(".warn").hide();
		popexitFL = false;
		bContinue = true;
		fastnavflag = true;
		//UIToBackApp('ENABLE_ONECLICK_SENDMSG_TOUI',1);
		UIToBackApp("SAVE_QUICKLAUNCHBAR_HTML",$("#list1").html());
	})
	$(".page li").live("mouseenter",function(){
		$(this).children(".pagelihover").css("display","block");		
	})
	$(".page li").live("mouseleave",function(){
		$(this).children(".pagelihover").css("display","none");
	})
	$(".page li").live("mousedown",function(){
		$(this).children(".pagelihover").empty().append("<img src='images/popbright.png' alt='' />");
	})
	$(".page li").live("mouseup",function(){
		$(this).children(".pagelihover").empty().append("<img src='images/popdarkbg.png' alt='' />");
	})		
	$(".minus").live("click",function(){
		$(this).closest("li").remove();
		return;
	})	
	$(".but_profile_wrap").hover(function(){
		$(this).css("background","url(images/hoverbutbgnew.png) no-repeat");
	},function(){
		$(this).css("background","url(images/butbgnew.png) no-repeat");
	})
	$(".pulsbut").hover(function(){
		$(this).attr("src","images/editnewhover.png");
	},function(){
		$(this).attr("src","images/editnew.png");
	})
	$(".pulsbut").mousedown(function(){
		$(this).attr("src","images/editnewclick.png");
	}).mouseup(function(){
		$(this).attr("src","images/editnewhover.png");
	})
	$(".but_profile_wrap").mousedown(function(){
		$(this).css("background","url(images/clickbutbgnew.png) no-repeat");
	})
	$(".but_right_wrap").hover(function(){ 
        $(this).css("background","url(images/hoverbutbgnew.png) no-repeat"); 
    },function(){ 
        $(this).css("background","url(images/butbgnew.png) no-repeat"); 
    })
	$(".but_right_wrap").mousedown(function(){
		$(this).css("background","url(images/clickbutbgnew.png) no-repeat");
	})
	$(".menu").hover(function(){
		$(this).css("background","url(images/menuhovernew.png) no-repeat");
	},function(){
		$(this).css("background","url(images/menubgnew.png) no-repeat");
	})
	$(".menu").mousedown(function(){
		$(this).css("background","url(images/menubgnewclick.png) no-repeat");
	}).mouseup(function(){
		$(this).css("background","url(images/menuhovernew.png) no-repeat");
	})
	$("a#MAIN_CLOSE").live("mouseover",function(){
		$(this).css("background","url(images/closehover.png) no-repeat");
	})
	$("a#MAIN_CLOSE").live("mouseout",function(){
		$(this).css("background","none");
	})
	$("a#MAIN_CLOSE").live("mousedown",function(){
		$(this).css("background","url(images/closeclick.png) no-repeat");
	})
	$(".scanbut").hover(function(){
		$(this).css("background","url(images/scanbuthovernew.png) center center  no-repeat");
	},function(){
		$(this).css("background","url(images/scanbutnew.png) center center no-repeat");
	})
	$(".scanbut").mousedown(function(){
		$(this).css("background","url(images/scanbutclicknew.png) center center no-repeat");
	})
	$(".scanbutOP").hover(function(){
		$(this).css("background","url(images/scanbuthovernew.png)  no-repeat");
	},function(){
		$(this).css("background","url(images/scanbutnew.png) no-repeat");
	})
	$(".scanbutOP").mousedown(function(){
		$(this).css("background","url(images/scanbutclicknew.png) no-repeat");
	})
	$(".opt").hover(function(){
		$(this).css("background","url(images/opthovernew.png) center center no-repeat");
	},function(){
		$(this).css("background","url(images/optnew.png) center center no-repeat");
	})
	$(".opt").mousedown(function(){
		$(this).css("background","url(images/optclickrnew.png) center center no-repeat");
	})
	$(".optOP").hover(function(){
		$(this).css("background","url(images/opthovernew.png) no-repeat");
	},function(){
		$(this).css("background","url(images/optnew.png) no-repeat");
	})
	$(".optOP").mousedown(function(){
		$(this).css("background","url(images/optclickrnew.png) no-repeat");
	})
	$(".can").hover(function(){
		$(this).css("background","url(images/scancancelhovernew.png) no-repeat");
	},function(){
		$(this).css("background","url(images/scancancelnew.png) no-repeat");
	})
	$(".can").mousedown(function(){
		$(this).css("background","url(images/scancancelclicknew.png) no-repeat");
	})
	$(".canOP").hover(function(){
		$(this).css("background","url(images/scancancelhovernew.png) no-repeat");
	},function(){
		$(this).css("background","url(images/scancancelnew.png) no-repeat");
	})
	$(".canOP").mousedown(function(){
		$(this).css("background","url(images/scancancelclicknew.png) no-repeat");
	})
	$(".optionscanover").hover(function(){
		$(this).css("color","#4CA0E1");
	},function(){
		$(this).css("color","#0D6CB5");
	})
	$(".headright li a").hover(function(){
		$(this).css("background","url(images/headerrighthover.png) repeat-x");
	},function(){
		$(this).css("background","none");
	})
	$(".headright li a").mousedown(function(){
		$(this).css("background","url(images/headerrightclick.png) repeat-x");
	})
	$(".page>li").live("click",function(e){		
		var flag=true;		
		var vid,vid1,com,img_move;		
		if($(".warn")){
			clearTimeout(warTimeout);
			clearTimeout(tipTimeout);
			$(".warn").hide();
		}
		if($(".mention")){
			clearTimeout(warTimeout);
			clearTimeout(tipTimeout);
			$(".mention").hide();
		}			
		var i=$("#list1>li").length;
		vid=$(this).find("img[id]").eq(0).attr("id");
		vid=vid.substring(0,vid.lastIndexOf("_POP"));
		img_move = $(this).find(".imgwrap").html();
		vid+="_QUICKLAUNCHBAR";	
		vid1+="_HOVER";	
		var FindObj = $("#"+vid+"");
		var j = FindObj.closest("li").index();
		if(FindObj.length == 0 && i < 8)
		{
			$("#list1").append("<li><div class='back'><div class='imgwrap'></div></div><div class='bgtest'><img src='images/minusbg.png' alt=''/></div></li>");
			$("#list1").children(":last").find(".imgwrap").append(img_move);
			$("#list1").children(":last").find(".imgwrap").children().eq(0).attr("id",vid).hide();
			$("#list1").children(":last").find(".imgwrap").children().eq(1).attr("id",vid1).show();
			$("#list1").children(":last").children(".back").append("<div class='minus'></div>");
			$("#list1").children(":last").children(".back").children(".minus").append("<img src='images/minus.png' alt=''  />");
			$("#list1").children(":last").children(".back").children(".minus").css("display","block");
		}
		else if(FindObj.length == 0 && i >= 8)
		{
			$(".warnmid").html(warnMSG);
			var pos=$("#list1").offset();
			var widthTHIS = $("#list1").width()/2;			
			var heightWRAPER = $(".salver").height() + $(".footer").height();
			$(".warn").show();
			var warnpos = $(".warnmid").width();
			var widthWARN = (warnpos + 30)/2;		
			$(".warn").css({"left":pos.left + widthTHIS - widthWARN,"bottom":heightWRAPER});
			$(".warndown").width(warnpos + 30);
			tipTimeout = setTimeout(function(){
				if ($.browser.msie && strCurIeVersion >= 9){
					$(".warn").fadeOut(1000);
				}
				else{
					$(".warn").slideUp();
				}				
			},2000);
		}else if(FindObj.length != 0 )
		{
			//提示已存在
			$(".mentionmid").html(mentionMSG);	
				var pos=$("#list1 li").eq(j).offset();
				var widthTHIS = $("#list1 li").eq(j).width()/2;				
				var heightWRAPER = $(".salver").height() + $(".footer").height();						
				$(".mention").show();
				var mentionpos=$(".mentionmid").width();
				var widthMENTION = (mentionpos+18)/2;	
				$(".mention").css({"left":pos.left + widthTHIS - widthMENTION,"bottom":heightWRAPER});
				$(".mentiondown").width(mentionpos+18);				
				warTimeout =setTimeout(function(){
					if ($.browser.msie && strCurIeVersion >= 9){
						$(".mention").fadeOut(1000);
					}
					else{
						$(".mention").slideUp();
					}					
				},2000);
		}
	})	
})
function list1moveEnter(){//快捷导航图标鼠标进入的信息提示函,"pos","show"
	//window.external.ShowTimespan(true,false);
	$(this).find(".imgwrap").children().eq(1).show().siblings().hide();	//0,1,2	
	if(!mentionFLAG){
		return;
	}
	//window.external.ShowTimespan(true,false);
	$(".mentionmid").html($("#list1").data($(this).find("img[id]").attr("id")));//缓存数据使用该行代码，使用时请注释掉上面 //6,7,8    46,47,57
	//window.external.ShowTimespan(false,true);	
	var IndexNow = $(this).index();	
	var widthTHIS = $(this).outerWidth()/2;		
	var pos=$("#list1>li").eq(IndexNow).offset();
	
	//window.external.ShowTimespan(true,false);
	var heightWRAPER = $(".salver").height() + $(".footer").height();	
	//window.external.ShowTimespan(true,false);
	$(".mention").show();
	//window.external.ShowTimespan(false,true);
	var mentionpos=$(".mentionmid").width();
	$(".mentiondown").width(mentionpos+18);	
	var widthMENTION = (mentionpos+18)/2;
	$(".mention").css({"left":pos.left + widthTHIS - widthMENTION,"bottom":heightWRAPER});
	//window.external.ShowTimespan(false,true);
}
function list1moveLeave(){//快捷导航图标鼠移出	
	$(this).find(".imgwrap").children().eq(0).show().siblings().hide();
	if(!mentionFLAG){
		return;
	}
	$(".mention").hide();
	//window.external.ShowTimespan(true,true);
}
function buwei(i){//时间补位函数	
	i = i + '';
	if(i.length < 2)
	{
		i = "0"+i;
	}
	return i;
}
function setTime(dd){//时间设置函数
	var ddhour=Math.floor(dd/3600);
	var ddminutes=Math.floor((dd%3600)/60);
	var ddseconds=dd%60;
	$("#TIME_NOWH").html(buwei(ddhour));
	$("#TIME_NOWM").html(buwei(ddminutes));
	$("#TIME_NOWS").html(buwei(ddseconds));
}
function Create_Pop(nwidth){//pop内容的设置
	$("#fastnavconlist").css("width",nwidth*724);
	$("#curpage").css("width",nwidth*31);
	$("#pagechange").css("paddingLeft",(773-68-nwidth*31)/2);
}
function TabBoxInit(){//主页面模块的初始化
	$(".tabbox>li").live("click",function TAB_CON(){
		var e=$(this).index();
		if(e==nLastViewPage){
			return;
		}
		switch(nLastViewPage)
		{
			case 0:
			case '0':
			$(".tabbox>li").eq(0).children("div").html("<img class='tabbg_OP' src='images/tabfirstnew.png'/><img class='tabbg_OP' src='images/tabfirsthovernew.png' />");
			break;
			case 1:
			case '1':
			$(".tabbox>li").eq(1).children("div").html("<img class='tabbg_OP' src='images/tabsecondnew.png'/><img class='tabbg_OP' src='images/tabsecondhovernew.png' />");
			break;
			case 2:
			case '2':
			$(".tabbox>li").eq(2).children("div").html("<img class='tabbg_OP' src='images/tabthirdnew.png'/><img class='tabbg_OP' src='images/tabthirdhovernew.png' />");
			break;
		}		
		nLastViewPage = e;
		UIToBackApp('SET_CURRENT_PAGE',e);	
		$(this).siblings().children("p").attr("class","notcur");
		$(this).siblings().children("div").attr("class","divnormal");
		if(e==1){
			$(this).children("div").append("<img class='tabbg_OP' src='images/tabsecondclicknew.png' alt=''/>").children("img:not(:last)").hide().end().attr("class","divclick");
			$(this).children("p").attr("class","curp");
		}
		else if(e==0){
			$(this).children("div").append("<img class='tabbg_OP' src='images/tabfirstclicknew.png' alt=''/>").children("img:not(:last)").hide().end().attr("class","divclick");
			$(this).children("p").attr("class","curp");
		}
		else if(e==2){
			$(this).children("div").append("<img class='tabbg_OP' src='images/tabthirdclicknew.png' alt=''/>").children("img:not(:last)").hide().end().attr("class","divclick");
			$(this).children("p").attr("class","curp");			
		}
		$(".tabboxcon").children().eq(e).show().siblings().eq(0).hide().end().eq(1).hide();		
	})
    $(".tabbox>li").live("mouseenter",function(){ 	
		if($(this).children("p").hasClass("notcur")){
			$(this).children("div").children("img:first").hide();
			$(this).children("div").children("img:last").show();
		}		
	})
    $(".tabbox>li").live("mouseleave",function(){
		if($(this).children("p").hasClass("notcur")){
			$(this).children("div").children("img:last").hide();
			$(this).children("div").children("img:first").show();
		}	
	})
}	
$(function CHECKITEM(){
	$(".item .inputimg").css("cursor","pointer").click(function(){ 
		if(!$(this).prev().attr("checked")) 
		{ 
			$(this).children().eq(1).show().siblings().hide(); ; 
			$(this).prev().attr("checked","checked");
		} 
		else 
		{ 
			$(this).children().eq(0).show().siblings().hide(); 
			$(this).prev().removeAttr("checked");
		} 
		UIToBackApp('SET_CHECKBOX_STATE',$(this).prev().attr("id"));
	});
	$(".item").next(".connect").css("cursor","pointer").click(function(){
		if(!$(this).prev("td").children(".inputstyle").children(":checkbox").attr("checked")) 
		{ 
			$(this).prev("td").children(".inputstyle").children(".inputimg").children().eq(1).show().siblings().hide();
			$(this).prev("td").children(".inputstyle").children(":checkbox").attr("checked","checked");
		} 
		else 
		{ 
			$(this).prev("td").children(".inputstyle").children(".inputimg").children('img:first').show().siblings().hide();
			$(this).prev("td").children(".inputstyle").children(":checkbox").removeAttr("checked"); 
		} 
		UIToBackApp('SET_CHECKBOX_STATE',$(this).prev("td").children(".inputstyle").children(":checkbox").attr("id"));		 
	}) 
	$(".scanword td").each(function(e){
		$(this).mouseover(function(){
			OVERECLLIPSIS($(this));
		}).mouseout(function(){					 
				$(this).attr("title","");
		}); 									  
	})
	/*$(".tooltipinfor").mouseover(function(){
		OVERECLLIPSIS($(this));
	}).mouseout(function(){					 
			$(this).attr("title","");
	})
	$(".detail_INFO p.detail_INFO_mid").mouseover(function(){
		OVERECLLIPSIS($(this));
	}).mouseout(function(){					 
			$(this).attr("title","");
	})
	$("#MAIN_MENU").mouseover(function(){
		OVERECLLIPSIS($(this));
	}).mouseout(function(){					 
			$(this).attr("title","");
	})*/
	$("input[type=button]").mouseover(function(){
											   //alertEx("in");
		OVERECLLIPSIS($(this));
	}).mouseout(function(){	
	//alertEx("out");
		$(this).attr("title","");
	})
	$("a").mouseover(function(){
		OVERECLLIPSIS($(this));
	}).mouseout(function(){					 
			$(this).attr("title","");
	})
	/*$("p").mouseover(function(){
		OVERECLLIPSIS($(this));
	}).mouseout(function(){					 
			$(this).attr("title","");
	})*/
	$("span").mouseover(function(){
		OVERECLLIPSIS($(this));
	}).mouseout(function(){					 
			$(this).attr("title","");
	})
	$(".time").mouseover(function(){
		OVERECLLIPSIS($(this));
	}).mouseout(function(){					 
			$(this).attr("title","");
	})
	$("#OC_PROGRESS_TEXT").mouseover(function(){
		OVERECLLIPSIS($(this));
	}).mouseout(function(){					 
			$(this).attr("title","");
	})
	$(".detail_INFO_mid").mouseover(function(){
		OVERECLLIPSIS($(this));
	}).mouseout(function(){					 
			$(this).attr("title","");
	})
	$(".toollist li").mouseover(function(){
		var copyThis = $(this).clone();
		copyThis.hide().css({
			'width': 'auto',
			'overflow': 'visible'
		});
		$(this).after(copyThis);
		if(copyThis.width()>$(this).width()){
			var altcon = $(this).children("a").html();
			$(this).children("a").attr("title",altcon);
			copyThis.remove();
		}else{
			copyThis.remove(); //清除复制
			return;
		}	
	}).mouseout(function(){					 
			$(this).children("a").attr("title","");
	})
	/*$(".td_left .limit").mouseover(function(){
		OVERECLLIPSIS($(this));
	}).mouseout(function(){					 
			$(this).attr("title","");
	})
	$(".td_right .limit").mouseover(function(){
		OVERECLLIPSIS($(this));
	}).mouseout(function(){					 
			$(this).attr("title","");
	})*/
})
function OVERECLLIPSIS(OBG){
	var copyThis = OBG.clone();
	copyThis.hide().css({
		'width': 'auto',
		'overflow': 'visible'
	});	
	OBG.after(copyThis);
	if(copyThis.width()>OBG.width()){		
		if(OBG.text().length <= 0){
			var altcon = OBG.val();
		}
		else{
			var altcon = OBG.text();
		}
		OBG.attr("title",altcon);
		//alertEx(OBG.attr("title"));
		copyThis.remove();
	}else{
		copyThis.remove(); //清除复制
		return;
	}	
}
function CheckBoxTab(){ //设置复选框的样式
	$(".inputimg").css("cursor","pointer").click(function(){
		UIToBackApp('SET_CHECKBOX_STATE',$(this).prev().attr("id"));
	}); 
	/*$(".inputimg").hover(function(){ 
		if(!$(this).prev().attr("checked")){ 
			$(this).children('img:last').show().siblings().hide(); 
		} 
		},function(){ 
		if(!$(this).prev().attr("checked")){ 
			$(this).children('img:first').show().siblings().hide(); 
		} 
	}) */
	$(".connect").css("cursor","pointer").click(function(){	
		UIToBackApp('SET_CHECKBOX_STATE',$(this).prev("td").children(".inputstyle").children(":checkbox").attr("id"));
	}) 	
}
function TAB_STATE(e){//切换模块按钮的设置
	nLastViewPage = e;
	    var $TAB_CUR=$(".tabbox>li").eq(e);
		$TAB_CUR.siblings().children("p").attr("class","notcur");
		$TAB_CUR.siblings().children("div").attr("class","divnormal");
		
		if(e==1){
			$TAB_CUR.children("div").append("<img class='tabbg_OP' src='images/tabsecondclicknew.png' alt=''/>").children("img:not(:last)").hide().end().attr("class","divclick");
			$TAB_CUR.children("p").attr("class","curp");
		}
		else if(e==0){
			$TAB_CUR.children("div").append("<img class='tabbg_OP' src='images/tabfirstclicknew.png' alt=''/>").children("img:not(:last)").hide().end().attr("class","divclick");
			$TAB_CUR.children("p").attr("class","curp");
		}
		else if(e==2){
			$TAB_CUR.children("div").append("<img class='tabbg_OP' src='images/tabthirdclicknew.png' alt=''/>").children("img:not(:last)").hide().end().attr("class","divclick");
			$TAB_CUR.children("p").attr("class","curp");			
		}
		
		$(".tabboxcon").children().eq(e).show().siblings().eq(0).hide().end().eq(1).hide();	
}
function SetProgress(progress) { //一键修复页面进度条
    if(progress < 0 || progress > 100)
	{
		return ;
	}
	var vTempProgress = (progress == 0)?1:progress;
	$(".rounded").width(494*(vTempProgress/100)); 
	$("#word").html(String(Math.floor((vTempProgress/100)*100)) + "%");
}
function saveOrder() {
bLeftButtonDown = false;
$(this).children(".back").css("top",0);
}; 
function iconHOVER(){
	var hoverSRCInit = $(this).find("img[id]").attr("src");
	var hoverSRC = hoverSRCInit.substring(hoverSRCInit.lastIndexOf("/"),hoverSRCInit.lastIndexOf(".png"));
	hoverSRC = hoverSRCInit.substring(0,hoverSRCInit.lastIndexOf("/")) + hoverSRC + "hover" + hoverSRCInit.substring(hoverSRCInit.lastIndexOf(".png"));
	$(this).attr("src",hoverSRC);
}
function turnPage(NPage){//pop图标翻页函数
	var curPageNum,comPage;
	$(".turnpage.right").click(function(){
		ChangePage(nLastPageIndex +1,1000);
	})
	$(".turnpage.left").click(function(){
		ChangePage(nLastPageIndex -1,1000);
	})	
	$(".curnum").click(function(){
		var e=$(this).index();
		ChangePage(e,0);
	})
}
function ChangePage(pageIndex,delay){//设置pop部分翻页时的状态
	if(pageIndex < $("#fastnavconlist").children("ul").length && pageIndex >= 0)
	{
		$(".curnum").eq(pageIndex).css("background","url(images/curpage.png) no-repeat").siblings().css("background","url(images/hidepage.png) no-repeat");
		if(pageIndex==$("#fastnavconlist").children("ul").length-1){
			$(".turnpage.right").css("background","url(images/graybutrightnew.png) no-repeat");
			$(".turnpage.left").css("background","url(images/bluebutleftnew.png) no-repeat");	
		}
		else if(pageIndex==0){
			$(".turnpage.right").css("background","url(images/bluebutnew.png) no-repeat");
			$(".turnpage.left").css("background","url(images/graybutnew.png) no-repeat");
		}
		else{
			$(".turnpage.right").css("background","url(images/bluebutnew.png) no-repeat");
			$(".turnpage.left").css("background","url(images/bluebutleftnew.png) no-repeat");	
		}		
	   nLastPageIndex = pageIndex;
	   var MOVElength = $(".page").outerWidth(true) - 0;
	   $("#fastnavconlist").animate({"left":-MOVElength*pageIndex},delay);
	}
}













