// JavaScript Document
//界面和后台程序交互接卿
//OperationType:操作类型
//strParam:参数，多参数之间可以用约定分隔符进行传辿
/*
操作类型
WINDOW_MOVE 鼠标拖拽移动窗体
WINDOW_CLOSE 右上角关闭消忿
WINDOW_MINIMIZE 最小化窗体，隐藏到托盘
OPEN_WINDOW_SKINS 打开皮肤窗体
OPEN_WINDOW_RESTORECENTER 打开恢复中心窗体
EXECUTE_ADT_QUICK_APPLICATION 执行高级工具中程序或快速启动中程序
UPDATE_QUICKLAUNCH_LANUAGE 更新托盘中图标的ALT提示
UPDATE_QUICKLAUNCH_ITEM_ALT 更新单个托盘中的ALT提示
#define OPEN_MEUN_MAIN _T("OPEN_MEUN_MAIN") 弹出菜单
#define OPEN_WINDOW_CHECUPDATE _T("OPEN_WINDOW_CHECUPDATE") 检查更新对话框
#define ENABLE_ONECLICK_SENDMSG_TOUI _T("ENABLE_ONECLICK_SENDMSG_TOUI")//禁用或启用一键优化向页面发送消息，0禁用，1启用

DISP_FUNCTION(CIntegratorDlg,"HtmlMouseDown",HtmlMouseDown,VT_EMPTY,VTS_NONE)
	DISP_FUNCTION(CIntegratorDlg,"CallApplicationDispatch",CallApplicationDispatch,VT_BOOL,VTS_BSTR VTS_I4)
	DISP_FUNCTION(CIntegratorDlg,"CallOneClickDispatch",CallOneClickDispatch,VT_EMPTY,VTS_BSTR VTS_I4)
	DISP_FUNCTION(CIntegratorDlg,"ChangeChecked",ChangeChecked,VT_EMPTY,VTS_BSTR)
	DISP_FUNCTION(CIntegratorDlg,"IsExistsQuickLaunchBar",IsExistsQuickLaunchBar,VT_BOOL,VTS_BSTR)
	DISP_FUNCTION(CIntegratorDlg,"LoadAppImageList",LoadAppImageList,VT_BOOL,VTS_NONE)
	DISP_FUNCTION(CIntegratorDlg,"LoadQuickLaunchBarImageList",LoadQuickLaunchBarImageList,VT_BOOL,VTS_BOOL)
	DISP_FUNCTION(CIntegratorDlg,"AddTagIdToQuickLaunchBar",AddTagIdToQuickLaunchBar,VT_BOOL,VTS_BSTR VTS_I4)
	DISP_FUNCTION(CIntegratorDlg,"MoveQuickLaunchBarItemTo",MoveQuickLaunchBarItemTo,VT_BOOL,VTS_I4 VTS_I4)
	DISP_FUNCTION(CIntegratorDlg,"RemoveQuickLaunchBarItem",RemoveQuickLaunchBarItem,VT_BOOL,VTS_BSTR)
	DISP_FUNCTION(CIntegratorDlg,"ChangeSettings",ChangeSettings,VT_EMPTY,VTS_UI4)
	DISP_FUNCTION(CIntegratorDlg,"SetOptions",SetOptions,VT_I4,VTS_I4)
	DISP_FUNCTION(CIntegratorDlg,"ShowRestoreCenter",RestoreCenter,VT_EMPTY,VTS_UI4)
	DISP_FUNCTION(CIntegratorDlg,"UpgrageNow",UpgrageNow,VT_BOOL,VTS_NONE)
	DISP_FUNCTION(CIntegratorDlg,"ChangeCurrentPageIndex",ChangeCurrentPageIndex,VT_EMPTY,VTS_UI4)
	DISP_FUNCTION(CIntegratorDlg,"ChangeSkin",ChangeSkin,VT_BOOL,VTS_BSTR)
	DISP_FUNCTION(CIntegratorDlg,"OpenURLByTagId",OpenURLByTagId,VT_EMPTY,VTS_BSTR)
	DISP_FUNCTION(CIntegratorDlg,"ChangeNetShare",ChangeNetShare,VT_EMPTY,VTS_BSTR)
	
	#define SET_SKINDLG_SKIN _T("SET_SKINDLG_SKIN")//设置皮肤对话框的皮肤
#define SET_SKINDLG_TRANSPARENT _T("SET_SKINDLG_TRANSPARENT")//设置皮肤透明帿
SET_MAINDLG_SKIN //设置主窗体皮耿
SET_MAINDLG_TRANSPARENT //设置主窗体透明帿
#define SET_NET_SHARE_STATE _T("SET_NET_SHARE_STATE")//设置网络共享
#define SET_CURRENT_PAGE _T("SET_CURRENT_PAGE")//设置当前響
#define SET_ONECLICK_STATE _T("SET_ONECLICK_STATE") //设置一键优化状徿
#define SET_AUTOMATIC_STATE _T("SET_AUTOMATIC_STATE")//自动优化状态设置现
OPEN_URL_BYTAGID //打开URL，通过标签ID
OPEN_WINDOW_UPGRADENOW //打开立即注册对话框窗仿
OPEN_WINDOW_SETOPTIONS //打开设置对话框窗仿
*/
var strCurIeVersion = "";//浏览器的版本
var BGkind = 0; //背景种类的标识
var adtTimeout;
var bIsSleep = false;
var strLastTagId = "";
var stateSAVE = "";
function alertEx(strContent)
{
	return;
	UIToBackApp('SHOW_MESSAGEBOX',strContent);
}
function printRIZHI(strContent)
{
	UIToBackApp('PRINT_TO_LOG',strContent);
}
function UIToBackApp(OperationType,strParam)//该函数供界面调用，向后台程序传递参擿
{
	var strTemp;
	try{
		strTemp = String(strParam);
		switch(OperationType)
		{
			case "EXECUTE_ADT_QUICK_APPLICATION": 
			case "UPDATE_QUICKLAUNCH_ITEM_ALT": 
			case "GET_ADVANCED_MODULE_DESCRTIP": 
			case "GET_ADVANCED_MODULE_NAME":
			if(strTemp.indexOf("_QUICKLAUNCHBAR") != -1)//判断是否是快速启动栏的ID，如果是的话就把结尾的后缀去掉
			{
				 strTemp = strTemp.substr(0,strTemp.indexOf("_QUICKLAUNCHBAR"));//去掉后缀
			}
			if(OperationType.indexOf('EXECUTE_ADT_QUICK_APPLICATION') == 0)
			{
				if(CheckSleep(strTemp))
				{
					return;
				}
			}
			break;
			case "SET_CHECKBOX_STATE"://index.js 193行增加了对应的代瞿20130118
			    if(strTemp.indexOf("OV_SHAREHELP") == 0)
				{
			       OperationType = "SET_NET_SHARE_STATE";//设置网络共享状徿
				}else if(strTemp.indexOf("OC_") == 0)
				{
					OperationType = "SET_ONECLICK_STATE";//设置一键优化复选状徿
				}else if(strTemp.indexOf("OV_") == 0)
				{
					OperationType = "SET_AUTOMATIC_STATE";//设置自动优化状徿
				}else
				{
					alert("unknow!!!!!");
					return;
				}
			break;
			case "SET_SKINDLG_SKIN"://向回传值
			break;
		}		
	    return window.external.UIToBackApp(OperationType,strTemp);
	   }
	catch(e)
	   {
		  //alert("Call UItoBackApp faild!" + e);//调用失败时弹出该对话框提碿
	   }
}
/*
SET_POP_HTML 设置POP窗体中应用程序图枿
SET_QUICKLAUNCHBAR_HTML 设置快速启动栏中图枿
SET_QUICKLAUNCHBAR_ADD_TIP 设置快速启动栏添加提示
GET_QUICKLAUNCHBAR_HTML 获取快速启动栏中图枿
SET_ONECLICK_BUTTON_DISPLAY 设置一键优化相关按钮的显示与隐蕿
SET_ONECLICK_PROGRESS 设置一键优化进度信息并控制进度条显碿
SET_BOOTTIME_TIME 设置开机启动时间的时间值，传递的参数为秒
SET_REGNAME 设置用户注册名称，目前没有可现实的地政
DOCUMENT_COMPLETE 页面加载完毕
INIT_COMPLETE 初始化完歿
SET_SKINDLG_TEXT 设置皮肤页面上的文字，标题、精美纹理、背景颜臿格式：标题|精美纹理|背景颜色
CHANGE_LANGUAGE_UPDATE //语言改变时的更新消息
*/
var strTagInterHtml = "";
var piclength = "";
var mentionFLAG = true;
function BackAppToUI(OperationType,strParam)//该函数供后台程序调用，用来设置或改变界面元素状徿
{
	try{
	switch(OperationType)
	{
		case "ADD_CUSTOM_BKCOLOR":
		$("#skinchangebgtop").children("img").hide();
		$("#skinchangebgtop").css("background",strParam);
		UIToBackApp("SET_SKINDLG_SKIN",strParam); 
		isSimilarColor("#ffffff",strParam,10)
		//$("#BACKGROUND_IMAGE_TEXT").html(strParam);
		if(colDEFINE){			
			var POSCOLNOW = $("#purecolor li#colorplus").offset();
			$("#colorinuse").css("left",POSCOLNOW.left+4).show();
			$("#skin li#nowbg").find(".kbg").children("img").attr("src","images/skinpicbgnormal.png");
			$("#picinuse").hide();
			colDEFINE = false;
		}		
		break;
		case "ADD_CUSTOM_BKIMAGE":
		$("#skin li#nowbg").find(".kbg").children("img").attr("src","images/skinpicbgnormal.png");
		$("#skin").children("li#nowbg").removeAttr("id");
		$("#colorinuse").hide();
		var MOVEPOS = $("#skin").css("left");
		MOVEPOS = MOVEPOS.substring(0,MOVEPOS.indexOf("px")) - 0;
		$("#skin>li:last").before("<li class='adddefine' id='nowbg'><div class='kbg'><img class='boederbg' src='images/skinpicbg.png' alt='' /></div><div id='abrepic'><img src='"+strParam+"' class='"+strParam+"' /></div><div class='del'><img class='delimg' src='images/delimg.png' alt='' /></div></li>");
		piclength = $("#skin>li").length;
		$("#skin").width(piclength*165);
		$("#skin").css("left",MOVEPOS-165);
		var posNOWBG = $("#skin li#nowbg").offset();
		$("#picinuse").css("left",posNOWBG.left+118).show();
		$("#skinchangebgtop").css("background","none");
		$("#skinchangebgtop").children("img").attr("src",strParam).attr("class",strParam).show();
		UIToBackApp("SET_SKINDLG_SKIN",strParam);
		break;
		case "SHOW_FREE_PRIVATE_USE":
			if(strParam != "")
			{
				$("#MAIN_RELEASETIP").css("text-decoration","underline");
			}
			$(".free_private_use").html(strParam);
		break;
		case "ENABLE_SHOW_QUICKLAUNCH_TIPS"://是否显示快速启动栏提示信息
		if(strParam.indexOf("0") == 0)
		{
			//移除绑定的方法
			mentionFLAG = false;
			//$("#list1 li").die("mouseenter",list1moveEnter);
	        //$("#list1 li").die("mouseleave",list1moveLeave);
		}else
		{
			mentionFLAG = true;
			//$("#list1 li").live("mouseenter",list1moveEnter);
	        //$("#list1 li").live("mouseleave",list1moveLeave);
		}
		break;
		case "SET_ADVANCED_MODULE_DESCRTIP"://高级工具模块功能提示 
		break; 
		case "SET_ADVANCED_MODULE_NAME"://高级工具模块名称提示
		break; 
		case "SET_ADVANCED_MODULE_NAME_ALL":
		AnalyzeMouodleName(strParam);//缓存数据到list1中，读取的时候也可以通过缓存数据进行读取
		break;
		case "CURRENT_IE_VERSION":
		if(strParam == "")
		{
			strParam = $.browser.version;
		}
		strCurIeVersion = strParam;
		strCurIeVersion = strCurIeVersion.substr(0,1);
		break;
		case "CHANGE_LANGUAGE_UPDATE":
		switch(strParam)//strParam是当前语言名称
		{
			case "简体中文":
			//$("*").css("fontFamily","Microsoft YaHei");
			/*if($.browser.msie && (strCurIeVersion == 6 || strCurIeVersion == 7)){
				$("#MAIN_MENU").css("lineHeight","27px");
				$(".but_profile").css("lineHeight","27px");
				$(".but_right").css("lineHeight","27px");
				$(".scanbut").css("lineHeight","52px");
				$(".can").css("lineHeight","36px");
				$(".opt").css("lineHeight","52px");
			}*/
			/*if($.browser.msie && (strCurIeVersion == 6 || strCurIeVersion == 7)){
				$("*").css("fontFamily","Microsoft YaHei");
			}*/
			break;
			default:
			//$("*").css("fontFamily","Arial");			
			break;
		}
		break;
		case "DOCUMENT_COMPLETE"://页面加载完毕，未初楌?
		if(strParam.indexOf("SKINDLG") == 0)
		{
			//皮肤库界面
			return;
		}else if(strParam.indexOf("ONECLICKDLG") == 0)
		{
			//一键优化界面
			return;
		}
		else
		{
			//初始化时的路径，strParam就是路径
			BGKIND_DE(strParam)
			setMainSkin(strParam);
			if(BGkind == 0){
				$("#wait").empty().append("<img src ='"+ strParam +"' />");
			}
			else if(BGkind == 1){
				$("#wait").empty().css("backgroundColor",strParam);
			}	
		}		
		break;
		case "INIT_START":
		ShowWelcome();
		break;
		case "INIT_COMPLETE"://初始化完歿		
		if(strParam.indexOf("SKINDLG") == 0)
		{			
			if ($.browser.msie && (strCurIeVersion != 7 && strCurIeVersion != 8)){
				$("#skinkuangbot").css("zIndex",1);
			}
			return;
		}
		else if(strParam.indexOf("ONECLICKDLG") == 0)
		{
			//一键优化界面	
			$(":checkbox").each(function(){ 
				if($(this).attr("checked")){
					$(this).next(".inputimg").children().eq(1).show().siblings().hide();
					if($(this).attr("id") == "OV_AUTOCHECKUPDATE"){
						$(this).closest("tr").next(".tips").hide();
					}
					else{
						$(this).closest("tr").next(".tips").show();
					}
				}
				else{
					if($(this).attr("id") == "OV_AUTOCHECKUPDATE"){
						$(this).closest("tr").next(".tips").show();
					}
					else{
						$(this).closest("tr").next(".tips").hide();
					}
				}												
			})
			CHECKITEM();
			INITSET();
			return;
		}else
		{
			$(":checkbox").each(function(){ 
				if($(this).attr("checked")){
					$(this).next(".inputimg").children().eq(1).show().siblings().hide();
					if($(this).attr("id") == "OV_AUTOCHECKUPDATE"){
						$(this).closest("tr").next(".tips").hide();
					}
					else{
						$(this).closest("tr").next(".tips").show();
					}
				}
				else{
					if($(this).attr("id") == "OV_AUTOCHECKUPDATE"){
						$(this).closest("tr").next(".tips").show();
					}
					else{
						$(this).closest("tr").next(".tips").hide();
					}
				}												
			})
		}
		break;
		case "SET_POP_HTML":
		$("#pop").html(strParam);
		$(".turnpage.left").css("background","url(images/graybutnew.png) no-repeat");
		$(".curnum").eq(0).css("background","url(images/curpage.png) no-repeat");
		var NPage=$("#fastnavconlist").children("ul").length;
		Create_Pop(NPage);//调整按钮布局
		turnPage(NPage);
		break;
		case "SET_QUICKLAUNCHBAR_HTML":
		$("#list1").html(strParam);	
		$("#list1 li").live("mouseenter",list1moveEnter);
	    $("#list1 li").live("mouseleave",list1moveLeave);
		if ($.browser.msie && strCurIeVersion != 6 ){
			$(".minus").hide();
			$(".bgtest").hide();
			$(".salver").css("zIndex","11002");
		}
		break;		
		//case "GET_QUICKLAUNCHBAR_HTML":
		//UIToBackApp("GET_QUICKLAUNCHBAR_HTML",$("#list1").html());
		case "GET_QUICKLAUNCHBAR_HTML": 
		UIToBackApp("SAVE_QUICKLAUNCHBAR_HTML",$("#list1").html());
		break;
		case "SET_SKINDLG_SKIN"://当前的|最后一次使用的背景图片
		BGKIND_DE(strParam);	
		skinBgchange(strParam);
		break;		
		case "SET_SKINDLG_IMAGELIST":
		AnalyzeImages(strParam);
		break;
		case "SET_SKINDLG_TRANSPARENT":
		$(".draghandle").css("left",(($(".dragbar").width()-16)*(100-strParam)/100));
		$("#tranper").html((100-strParam)+"%");	
		break;
		case "SET_SKINDLG_TEXT":
		SetSkinDlgText(strParam);
		break;
		case "SET_MAINDLG_SKIN":
		BGKIND_DE(strParam);		
		setMainSkin(strParam);		
		break;
		
		
		
		case "SET_MAINDLG_TRANSPARENT":
		if ($.browser.msie && (strCurIeVersion != 7 && strCurIeVersion != 8)){
			var nValue = (0.8*strParam+20)/100;
			if ($.browser.msie && (strCurIeVersion == 6)){
				$("#hbg").css("opacity",nValue*0.9);
			}
			else{
				$("#hbg").css("opacity",nValue);
			}
			$(".detailbg").css("opacity",nValue);
			$(".tabbox>li>div").css("opacity",nValue);
		}
		break;
		case "SET_CURRENT_PAGE":
		$(".detail_INFO").hide();
		$(".scanword tr td.thir").hide();
		$(".tabboxcon").children().eq(strParam).show().siblings().hide();		
		TAB_STATE(strParam)
		TabBoxInit();
		break;
		case "SET_ONECLICK_BUTTON_DISPLAY":
		ShowOneclickButton(strParam);
		break;
		case "SET_ONECLICK_PROGRESS":
		//return;
		UpdateProgress(strParam);
		break;
		case "SET_BOOTTIME_TIME":
		setTime(strParam);
		break;
		case "SET_REGNAME"://显示注册时的用户名信忿
		$(".user").text(strParam);
		$(".user").show();
		$("#UPGRADE_NOW").hide();
		//没有对应的设绿
		break;
		case "SET_QUICKLAUNCHBAR_ADD_TIP":
		UpdateQuicklaunchbarAddTip(strParam);
		break
	}
	}
	catch(e)
	{
		alert(e +"--" + strParam + "--"+OperationType);
		return -1;
	}
	return 0;
}
function CallOneClickDispatch(strTagId,nType)
{
	var strTemp = String(strTagId);
	var nIndex = -1;
	try{
		nIndex = strTemp.indexOf("_DETAILS");
		if(nIndex != -1)
		{
		strTemp = strTemp.substring(0,strTemp.indexOf("_DETAILS"));
		//alert(strTemp);
		}
		window.external.CallOneClickDispatch(strTemp,nType);
		}
	catch(e){
		alert("CallOneClickDispatch "+e);
		}
}
//扫描 清理 停止扫描   扫描结果和详单的显示与隐藏，由后台程序控冿
//0 扫描 1 清理 2需要清玿3初始状徿
//id="OC_PROGRESS_TEXT" id="OC_RESCAN"  id="OC_SCAN"  id="message" id="progressbar" id="OC_CLEANER"
function ShowOneclickButton(nType)
{
	//alertEx(nType);
	switch(nType)
	{
		case '0':
		case 0:
		$("#tooltip").hide();
		$("#OC_CLEANER").css("display","none");
		$(".options").css("display","none");
		$("#OC_SCAN").css("display","none");
		$(".scanresult").css("display","block");
		$("#message").css("display","block");
	    $("#progressbar").css("display","block");
	break;
	case '1':
	case 1:
	    $("#tooltip").hide();
	    $("#OC_CLEANER").css("display","none");
	    $(".scanresult").css("display","block");
		$("#message").css("display","block");
	    $("#progressbar").css("display","block");
	break;
	case '2':
	case 2:
	    $("#tooltip").show();
	    $(".options").css("display","block");
	    $("#OC_SCAN").css("display","none");
	    $("#OC_CLEANER").css("display","block");
		$("#message").css("display","none");
	    $("#progressbar").css("display","none");
	break;
	case '3':
	case 3:
	    $("#tooltip").hide();
	    $(".options").css("display","block");
	    $("#OC_SCAN").css("display","block");
	    $("#OC_CLEANER").css("display","none");
		$("#message").css("display","none");
	    $("#progressbar").css("display","none");
	break;
		}
}
//设置进度信息及进度条显示信息
function UpdateProgress(strProgress) 
{ 
	var strArr = strProgress.split("|"); 
	SetProgress(strArr[0]); 
	$("#message").text(strArr[1]); 
} 
//添加时进行的提示，对象已存在或已经满了删除部分后再添加
function UpdateQuicklaunchbarAddTip(strTip) 
{ 
	var strArr = strTip.split("|"); 
	mentionMSG = strArr[0]; 
	warnMSG = strArr[1]; 
} 

//设置皮肤页面上的三个文字,字符串以“|”进行分割 
function SetSkinDlgText(strText) 
{ 
	var strArr = strText.split("|");  
	$("#TITLE").html(strArr[0]);//strTemp.substring(nCurPos,nPos)
	$("#prefont").html(strArr[0]); 
	$("#BACKGROUND_IMAGE_TEXT").html(strArr[1]);//strTemp.substring(nCurPos,nPos) 
	$("#BACKGROUND_COLOR_TEXT").html(strArr[2]);//strTemp.substring(nCurPos) 
}

//判断是否处于休眠状态，如果是将返回true否则返回false

function CheckSleep(strTagId)
{
	if(strLastTagId == strTagId)//如果最后一次的和当前的一致
	{
		if(bIsSleep)//检查是否在禁用状态，如果在禁用状态就直接返回假
		{
			return true;
		}
	}else//如果两个标签不一致，就清除上次的timeout，然后继续后面的代码
	{
		clearTimeout(adtTimeout);
	}
	strLastTagId = strTagId;
	bIsSleep = true;
	adtTimeout = setTimeout(function(){
		bIsSleep = false;
	},1000);
	return false;
}

function BGKIND_DE(bg_SAVE){
	if(bg_SAVE.indexOf("#") == -1){
		BGkind = 0;
	}
	else if(bg_SAVE.indexOf("#") != -1){
		BGkind = 1;
	}
	return BGkind;
}
//解析传递过来的图片列表，换肤使用，strImageList字符串结构:a.png|b.png|c.png|d.png|k.jpg
function AnalyzeImages(strImageList)
{
	//<li><div class='kbg'><img class='boederbg' src='images/skinpicbgnormal.png' alt='' /></div><div id='abrepic'><img src='images/skins/b.png' alt='' /></div></li>
	var str1 = strImageList.split("|") ;
	var strSkinDlgImage = "";
    $.each(str1,function(key,val){ 
    //回调函数有两个参数,第一个是元素索引,第二个为当前值
	if(val.indexOf("images\\skins\\") == -1){
		 strSkinDlgImage += "<li class='adddefine'><div class='kbg'><img class='boederbg' src='images/skinpicbgnormal.png' alt='' /></div><div id='abrepic'><img src='"+val+"' class='"+val+"' /></div><div class='del'><img class='delimg' src='images/delimg.png' alt='' /></div></li>";
	}
     else{
		 strSkinDlgImage += "<li><div class='kbg'><img class='boederbg' src='images/skinpicbgnormal.png' alt='' /></div><div id='abrepic'><img src='"+val+"' class='"+val+"' /></div></li>";
	 }
    //alertEx('_mozi数组中 ,索引 : '+key+' 对应的值为: '+val); 
    }); 
   $("#skin").html(strSkinDlgImage);    
   $("#skin").append("<li id='bgplus'><div class='kbg'><img class='boederbg' src='images/skinpicbgnormal.png' alt='' /></div><div id='abrepic'><img src='images/addbg.png' alt='' /></div></li>");
   $("#skin").width((str1.length+1)*165);
}

//解析传递过来的提示信息,strModuleNameList格式：控件ID：控件名称|控件1ID：控件1名称|控件2ID：控件2名称|......控件NID：控件N名称
function AnalyzeMouodleName(strModuleNameList)
{
	var arrModuleName = strModuleNameList.split("|");
	$.each(arrModuleName,function(key,val){ 
		SetQuickLaunchBarTips(val);
	});
}
function SetQuickLaunchBarTips(strKeyValye)
{
	 var arrIdToName = strKeyValye.split(":");
	 $("#list1").data(arrIdToName[0] + '_QUICKLAUNCHBAR', arrIdToName[1]);
	 //alert($("#list1").data(arrIdToName[0] + '_QUICKLAUNCHBAR'));
}
function CHECKSTATESET(CHECKObj,CHECKSTATE)
{
	if(CHECKSTATE == 1 || CHECKSTATE == "1"){
		$("#"+CHECKObj).attr("checked","checked");
		$("#"+CHECKObj).next(".inputimg").children().eq(1).show().siblings().hide();
		if(CHECKObj == "OV_AUTOCHECKUPDATE"){
			$("#"+CHECKObj).closest("tr").next(".tips").hide();
		}
		else{
			$("#"+CHECKObj).closest("tr").next(".tips").show();
		}
	}
	else{
		$("#"+CHECKObj).removeAttr("checked");	
		$("#"+CHECKObj).next(".inputimg").children().eq(0).show().siblings().hide();
		if(CHECKObj == "OV_AUTOCHECKUPDATE"){
			$("#"+CHECKObj).closest("tr").next(".tips").show();
		}
		else{
			$("#"+CHECKObj).closest("tr").next(".tips").hide();
		}
	}
	return 0;
}
function ShowWelcome(){//页面载入状态
	$("#wait").animate({"opacity":0},2000,function(){
		$("#wait").remove();
		if ($.browser.msie && strCurIeVersion == 6 ){
			$(".minus").hide();
			$(".bgtest").hide();
		}		
	});
	$(".headright li").show();
}
/*function bar(nValue) {
	$("#hbg").css("opacity",nValue/100);
	//$("#footbg").css("opacity",nValue/100);
	$(".detailbg").css("opacity",nValue/100);
	$(".tabbox>li>div").css("opacity",nValue/100);
}*/
function setMainSkin(mainbgsrc){
	if(BGkind == 0){
		$("#bigbg").empty().append("<img alt='' src='"+mainbgsrc+"'>"); 
	}
	else if(BGkind == 1){
		$("#bigbg").empty().css("backgroundColor",mainbgsrc);
	}
}
var strTimeInfo = "";
var bShowBox = false;
var bReset = false;
function ShowTimeSpan(bReset,bShowBox,strTestName) 
{
	//alert(strTimeInfo +"______strTestName"+strTestName);
	strTimeInfo += strTestName + ":" 
	strTimeInfo += window.external.ShowTimespan(bReset,false); 
	if(bReset) 
	{ 
		strTimeInfo = ""; 
	} 
	if(bShowBox) 
	{ 
		$("#MAIN_CURVERSION").html(strTimeInfo); 
	} 
}
//window.external.ShowTimespan(bReset,true);		//返回毫秒数 第一个参数是否重设，如果重设将清零计时，重新计算时间，第二个参数是否弹出提示对话框，如果是就会弹出一个耗时毫秒数的对话框
   


