
//Function 
function Show_Info(Driver_Item,Num,Driver_Desp,Driver_Path,Driver_Exe_File,Driver_Ver,RunFlag,Option,Current_Ver,Tip,ExtMsg,Size,Driver_State,Run,DevID,SubID,Installed)
{
	/*
	SelectItem Define
	0-->for Debug
	1-->Get Driver Desp
	2-->Get Driver Path
	3-->Get Driver Exe File
	4-->Get Driver Item
	5-->Get Driver_State
	6-->Get Driver_Ver
	7-->Get RunFlag
	8-->Get Option
	9-->Get Run
	10-->Get Current Ver
	11-->Get DevID
	12-->Get SubID	
	13-->Tip	
	*/
	this.Driver_Item=Driver_Item;
	this.Num=Num;
	this.Driver_Desp=Driver_Desp;
	this.Driver_Path=Driver_Path;
	this.Driver_Exe_File=Driver_Exe_File;
	this.Driver_Ver=Driver_Ver;
	this.RunFlag=RunFlag;
	this.Option=Option;
	this.Current_Ver=Current_Ver;
	this.Tip=Tip;
	this.ExtMsg=ExtMsg;
	this.Size=Size;
	this.Driver_State=Driver_State;
	this.Run=Run;
	this.DevID=DevID;
	this.SubID=SubID;
	this.Installed=Installed;
}
function Show_Wait()
{
	var fun;
	var Ana_Txt;
	Ana_Txt='';
	if (Timer_Count<=90)
	{
		Ana_Txt=Ana_Txt+'<table border=0 width=100%><tr><td>'
		Ana_Txt=Ana_Txt+'<font class="Ini3">Download Center is now analyizing your computer</font></tr></td>';
		//Ana_Txt=Ana_Txt+'<tr><td><font class="Ini4">'+Timer_Count+'%</font>';		
		Ana_Txt=Ana_Txt+'<tr><td><table bgcolor=red width="' + Timer_Count + '%" height="15" CELLPADDING="1" CELLSPACING="1"><tr><td><font class=proguess3>&nbsp</td></tr></table></td>'		
		Ana_Txt=Ana_Txt+'</tr></table>'
		fun='Show_Wait()';
		document.all.Progre.innerHTML=Ana_Txt;
		Ana_Txt='';
		Ana_Txt=Ana_Txt+'<table border=0 width=100%><tr><td>'
		Ana_Txt=Ana_Txt+'<font class="Ini3">&nbsp</font></tr></td>';
		//Ana_Txt=Ana_Txt+'<tr><td><font class="Ini4">'+Timer_Count+'%</font>';		
		Ana_Txt=Ana_Txt+'<tr><td><table width=100%" height="15" border=1 CELLPADDING="0" CELLSPACING="0"><tr><td align=center>'+Change_Text(Timer_Count)+'</td></tr></table></td>'		
		Ana_Txt=Ana_Txt+'</tr></table>'		
		document.all.Progre_Text.innerHTML=Ana_Txt;
		setTimeout(fun,1000);
		Timer_Count = Timer_Count + 33;
	}
	else
	{
		Ana_Txt=Ana_Txt+'<table border=0 width=100%><tr><td>'
		Ana_Txt=Ana_Txt+'<font class="Ini3">Download Center is now analyizing your computer</font></tr></td>';
		//Ana_Txt=Ana_Txt+'<tr><td><font class="Ini4">'+Timer_Count+'%</font>';		
		Ana_Txt=Ana_Txt+'<tr><td><table bgcolor=red width=100%" height="15" CELLPADDING="1" CELLSPACING="0"><tr><td><font class=proguess2>&nbsp</td></tr></table></td>'		
		Ana_Txt=Ana_Txt+'</tr></table>'
		fun='Show_Wait()';
		document.all.Progre.innerHTML=Ana_Txt;
		Ana_Txt='';
		Ana_Txt=Ana_Txt+'<table border=0 width=100%><tr><td>'
		Ana_Txt=Ana_Txt+'<font class="Ini3">&nbsp</font></tr></td>';
		//Ana_Txt=Ana_Txt+'<tr><td><font class="Ini4">'+Timer_Count+'%</font>';		
		Ana_Txt=Ana_Txt+'<tr><td><table width=100%" height="15" border=1 CELLPADDING="0" CELLSPACING="0"><tr><td align=center><font class=proguess2>100%</td></tr></table></td>'		
		Ana_Txt=Ana_Txt+'</tr></table>'		
		document.all.Progre_Text.innerHTML=Ana_Txt;		
		CheckVer.IniCheckVer(Os);
		document.all.Progre_Text.innerHTML='';
		document.all.Progre.innerHTML='';
		//alert(Show_Count);
		Xinstall.GO_But.disabled=false;
		Show_Driver(Show_Count)
	}
}
function Get_PciID()
{
	var url,Install_Check;
	var Filehttp,FileName,FileSize,Desp,Ver;
	var fun;
	var O_check;
	//url='Show.asp?' + readcmd.readid();
	//alert(Obj_Ver);
	try{
		O_check=Dldrv.GetDLObjInfo(Obj_Ver);	
	}
	catch(ex)
	{
		alert('Please wait for Download DL-Program')
		O_check=-1;
	}	
	//alert(O_check)
	if(O_check!=-1)
	{
		if(confirm('Download Center is supporting P4,K7 and K8 platform now!'))
		//if(confirm('So far Download Center only supports Intel(R) 925X,915P,915G series Motherboard.\nOther Gigabyte motherboards will be implemented soon.\nDo you want to continue?'))
		{
			//alert('Get value');
			Install_Check=Dldrv.GetDLObjInfo(Obj_Ver);
			//alert('Install_Check');
			//alert(Install_Check);
			if(Install_Check==0||Install_Check<Obj_Ver)
			{
				alert('Need to download object program,please wait...!');
				Filehttp = Host_IP_Path + 'OBJect/InstallOBJ.exe';
				FileName = 'InstallOBJ.exe';
				FileSize = OBJ_Size;
				Desp = 'InstallPackage';
				Ver =1;
				Dldrv.dl(Filehttp,FileName,FileSize,Desp,Ver,2);
				//alert('OK!')
				Wait_Obj();
			}
			else
			{	
				//parent.Main.obj.innerHTML='<object ID="DriverCDHtml1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:ACA03330-73A1-4D65-BBAC-98A2A98669AB"></object>'
				//obj.innerHTML='<object ID="DriverCDHtml1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:ACA03330-73A1-4D65-BBAC-98A2A98669AB"></object>'
				//alert('read id');
				obj.innerHTML='<object ID="DriverCDHtml1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:801CB714-0CFA-4DA9-B24C-072FE4349BD3"></object>'
				DriverCDHtml1.GBTMBFlag=1;
				url='';
				url='Show.asp?' + DriverCDHtml1.ReadID();
				//parent.Main.Driver.innerHTML=url;
				//parent.Main.location=url
				window.location=url;
				//alert('OK');
			}
		}
		else
		{
			history.back();
		}
	}
	else
	{
		history.go();
	}
	//alert(url);
}

function Wait_Obj()
{
	var check,fun;
	check=Dldrv.GetDLState();
	if(check!=1)
	{
		//alert('wait')
		Dldrv.SetPackVer(Obj_Ver);
		fun = 'Wait_Obj()';
		setTimeout(fun,1000);		
	}
	else
	{
		//parent.Main.obj.innerHTML='<object ID="DriverCDHtml1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:ACA03330-73A1-4D65-BBAC-98A2A98669AB"></object>'
		//obj.innerHTML='<object ID="DriverCDHtml1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:ACA03330-73A1-4D65-BBAC-98A2A98669AB"></object>'		
		//obj.innerHTML='<object ID="DriverCDHtml1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:801CB714-0CFA-4DA9-B24C-072FE4349BD3"></object>'
		//alert('Scan ID')
		//DriverCDHtml1.GBTMBFlag=0;
		//url='';
		//url='Show.asp?' + DriverCDHtml1.ReadID();
		//parent.Main.Driver.innerHTML=url;
		//parent.Main.location=url
		Dldrv.SetPackVer(Obj_Ver);
		url=window.location;		
		window.location=url;
	}
}

function Show_Driver(Count)
{
	//alert('1');
	//Count=6
	var i;
	var Htm_Str;
	Htm_Str = '' ;
	Sort();
	Htm_Str=Htm_Str+'<form name="Driverinfo" Method="Post"><table border=1 width=95%>';
	Show_Count=Count;
	//alert(Show_Count)
	for(i=0;i<Count;i++)
	{
	      //alert(Info[i].Driver_Path)
	      if(Info[i].Size!=0)
	      {
	      Set_Run_Info(i)
		//Set Show Info
		//alert(i + Info[i].Driver_Desp);
		//DriverCDHtml1.GetExtMsg(Fix_Path(Info[i].Driver_Path))
              Htm_Str=Htm_Str+'<table width="100%" border="0" bordercolor="#0099FF">';
              Htm_Str=Htm_Str+'	 <tr>'
              Htm_Str=Htm_Str+'    <td bgcolor="#FFFFFF">'
              Htm_Str=Htm_Str+'      <table width="100%" border="0" cellpadding="1" cellspacing="0">'
              Htm_Str=Htm_Str+'        <tr bgcolor="#3399FF">'
              Htm_Str=Htm_Str+'          <td bgcolor="#1A75D9">' 
              Htm_Str=Htm_Str+'            <table width="100%" border="0" cellspacing="0" cellpadding="0" bordercolor="#E0E0E0">'
              Htm_Str=Htm_Str+'              <tr>' 
              Htm_Str=Htm_Str+'                <td width="5%">' 
              Htm_Str=Htm_Str+                  Show_Check(i)// + CheckVer.GetPCIVer(Info[i].DevID,Info[i].SubID,Info[i].Driver_Ver);
              Htm_Str=Htm_Str+'                </td>'
              Htm_Str=Htm_Str+'                <td width="84%"><div id="Desp' + i + '" class="DespTxt">'  + Info[i].Driver_Desp + '</div></td><td><div id="D_S' + i + '" class="DespTxt2"></div></td>'
              Htm_Str=Htm_Str+'                <td width="11%"><div align="center"><input class="ButText" type="button" name="Install'+ i + '" value="Install" onClick=Dl(' + i + ')><input class="ButText" type="button" name="DL_only' +  i + '" value="Save as..." onClick="DL_File(' + i + ')"></div></td>'
              Htm_Str=Htm_Str+'              </tr>'
              Htm_Str=Htm_Str+'            </table>'
              Htm_Str=Htm_Str+'          </td>'
              Htm_Str=Htm_Str+'        </tr>'
              Htm_Str=Htm_Str+'        <tr bgcolor="#DFEFFF">'
              Htm_Str=Htm_Str+'          <td bgcolor="#1A75D9">' 
              Htm_Str=Htm_Str+'            <table width="100%" border="0" cellpadding="2" cellspacing="1">'
              Htm_Str=Htm_Str+'              <tr>'
              Htm_Str=Htm_Str+'                <td rowspan="2" bgcolor="#FFFFFF" width="5%"></td>'
              Htm_Str=Htm_Str+'                <td width="15%" bgcolor="#E3E3E3"><div align="left"><font color="#3366CC" size="1"><font face="Arial" size="2" color="#000000">Size</font></font></div></td>'
              Htm_Str=Htm_Str+'                <td width="22%" bgcolor="#F3F3F3" colspan=3><font face="Arial" size="2"> ' + Chenge_Size(Info[i].Size) + '</font></td>'
              Htm_Str=Htm_Str+'              </tr>'
              Htm_Str=Htm_Str+'              <tr>'
              Htm_Str=Htm_Str+'                <td width="15%" bgcolor="#E3E3E3"><div align="left"><font color="#3333CC" face="Arial" size="2"><font color="#000000">WEB Version</font></font></div></td>'              
	      Htm_Str=Htm_Str+'                <td width="22%" bgcolor="#F3F3F3"><font size="2" face="Arial">' + Info[i].Current_Ver + '</font></td>'              
              Htm_Str=Htm_Str+'                <td width="15%" bgcolor="#E3E3E3"><div align="left"><font color="#3333CC" face="Arial" size="2"><font color="#000000">Local Version</font></font></div></td>'              
	      Htm_Str=Htm_Str+'                <td width="22%" bgcolor="#F3F3F3"><font size="2" face="Arial">' + CheckVer.GetPCIVer(Info[i].DevID,Info[i].SubID,Info[i].Driver_Ver) + '</font></td>'              	      
              Htm_Str=Htm_Str+'              </tr>'              
              Htm_Str=Htm_Str+'              <tr>'
              Htm_Str=Htm_Str+'                <td colspan="6" bgcolor="#FFFFFF"><font face="Arial" size="2">' + Info[i].Tip + '</font></td>'
              Htm_Str=Htm_Str+'              </tr>'
              Htm_Str=Htm_Str+'            </table>'
              Htm_Str=Htm_Str+'          </td>'
              Htm_Str=Htm_Str+'        </tr>'
              Htm_Str=Htm_Str+'     </table>'
              Htm_Str=Htm_Str+'   </td>'
              Htm_Str=Htm_Str+' </tr>'
              Htm_Str=Htm_Str+'</table>'
        	}
        else
        	{
        		Show_Count--;
        		Info[i].Run=false;
        	}
		/*Htm_Str=Htm_Str+'<tr><td>';
		Htm_Str=Htm_Str+'<table border=1 width=100% height=100>';
		Htm_Str=Htm_Str+'<tr><td colspan=2 height=10%><Div Id=D' + i + ' class=DriverOn>'+Show_Check(i)+Info[i].Driver_Desp+'</div></td><td><input type=button value=Install onClick=Dl(' + i + ')></td></tr>';
		Htm_Str=Htm_Str+'<tr><td width=30% height=10%><font class=Head>Size:</font><font class=Info>' + Chenge_Size(Info[i].Size) + '</font></td><td width=30% height=10%><font class=Head>Version:</font><font class=Info>' + Info[i].Current_Ver + '</font></td><td></td></tr>';
		Htm_Str=Htm_Str+'<tr><td colspan=3 valign=top><font class=Tip>'+ Fix_Path(Info[i].Driver_Path) +'</font></td></tr>';
		Htm_Str=Htm_Str+'</table>';
		Htm_Str=Htm_Str+'<hr></td></tr>';*/
	}
	Htm_Str=Htm_Str+'</table>';
	//parent.Main.Driver.innerHTML=Htm_Str;
	Driver.innerHTML=Htm_Str;
	check_Option()
	//alert(Total_Size);
	//alert(Show_Count);
	//DriverCDHtml1.SetRunInfo(Desp,Driver_Path,FileName,Option,RunFlag,i,Show_Count);
	i=-1;
	DriverCDHtml1.SetRunInfo('','','',0,0,i,Show_Count);		
}

function check_Option()
{
	var i,j;
	for(i=0;i<Show_Count;i++)
	{
		if(Info[i].Installed==1)
		{
			document.all['D_S' + i].innerHTML='Installed'
		}
	}
}

function Sort()
{
	var i,j,Cmp1,Cmp2;
	Temp_Info = new Array();
	//Sort
	for(i=0;i<Info.length-1;i++)
	{
		for(j=0;j<Info.length-1;j++)
		{
			Cmp1=parseInt(Info[j].Driver_Item);
			Cmp2=parseInt(Info[j+1].Driver_Item);
			if(Cmp1>Cmp2)
			{
				Temp_Info[0]=Info[j];
				Info[j]=Info[j+1];
				Info[j+1]=Temp_Info[0];		
			}
		}
	}
	//For Set Num
	for(i=0;i<Info.length;i++)
	{
		Info[i].Num=i
	}

}

function Chenge_Size(Org_Size)
{
	var Temp,R_Value
	Total_Size=Total_Size+Org_Size;
	Org_Size=Org_Size/1024;
	if(Org_Size>1024)
	{
		Org_Size=(Org_Size/1024)
		Temp=Org_Size;
		Temp=''+Temp;
		if(Temp.indexOf(".") > -1)
		{
			Temp=Temp.substring(0,(Temp.indexOf(".")+2));
		}
		R_Value=Temp + 'MB';
	}
	else
	{
		Temp=Org_Size;
		Temp=''+Temp;
		if(Temp.indexOf(".") > -1)
		{
			Temp=Temp.substring(0,(Temp.indexOf(".")+2));
		}		
		R_Value=Temp + 'KB';
	}	
	return R_Value;
}

function Dl(i)
{
	var Filehttp,FileName,FileSize,Desp,Ver;
	//alert('http://10.1.9.120/DLCenter/' + Info[i].Driver_Path + Info[i].Driver_Exe_File + Info[i].Size);
	Filehttp = Host_IP_Path + Info[i].Driver_Path + Info[i].Driver_Exe_File ;
	FileName = i + Info[i].Driver_Exe_File ; 
	FileSize = Info[i].Size ; 
	Desp = Info[i].Driver_Desp ;
	Ver = Info[i].Current_Ver ;
	alert(Filehttp + ',' + FileName + ',' + FileSize + ',' + Desp + ',' + Ver)
	//DriverCDHtml1.DLFile(Filehttp,FileName,FileSize,Desp,Ver);
	//DriverCDHtml1.AboutBox();
	//ShowProce(i);
	Dldrv.dl(Filehttp,FileName,FileSize,Desp,Ver,2);
}

function DL_File(i)
{
	var Filehttp,FileName,FileSize,Desp,Ver;
	var Sub_Win;
	var X1,Y1,Pos;
	//alert('http://10.1.9.120/DLCenter/' + Info[i].Driver_Path + Info[i].Driver_Exe_File + Info[i].Size);
	Filehttp = Host_IP_Path+ Info[i].Driver_Path + Info[i].Driver_Exe_File ;
	X1=(screen.width - 500)/2;
	Y1=(screen.height - 200)/2;	
	Pos='width=500,height=200,left=' + X1 + ',top=' + Y1 + ',location=no,menubar=no,status=yes,scrollbars=no'
	Sub_Win=window.open(Filehttp,'abc',Pos);
	
}

function Show_Tip(i)
{
	//alert(i)
	//parent.Main.document.body.style.cursor="hand";
	document.body.style.cursor="hand";
	//parent.Main.document.all['D'+i].style.color='red';
	document.all['D'+i].style.color='red';
	window.status="12347";
}

function Clr_Tip(i)
{
	//alert(i)
	//parent.Main.document.body.style.cursor="default";
	document.body.style.cursor="default";
	//parent.Main.document.all['D'+i].style.color='green';
	document.all['D'+i].style.color='green';
	window.status="56458";
}

function Download(Filehttp,FileName,FileSize,Desp,Ver)
{
	alert('The DownLoad Center Will DownLoad Driver And Install ');
	//alert(FileName);
	//alert(Ver);
	//Dldrv.dl(Filehttp,FileName,FileSize,Desp,Ver);
	//top.frames[2].location.reload()
	
}

function Go()
{
	var fun;
	//alert('go');
	//window.open("DLProcess.htm","abc")
	Set_DL_Info();
	//alert(Dldrv.DLCount);
	if(Dldrv.DLCount!=0)
	{
		Total_Count_Lim_Unit=Math.floor(100/Dldrv.DLCount);
		Dis_But(true);
		Xinstall.GO_But.disabled=true;
		DL_Count=0;
		fun = 'Bdl(' + DL_Count + ')';
		setTimeout(fun,1000);
	}
}

function Dis_But(Sel)
{
	var i;
	for(i=0;i<Show_Count;i++)
	{
		Driverinfo['Driver'+i].disabled=Sel;
		Driverinfo['Install'+i].disabled=Sel;
		Driverinfo['DL_only'+i].disabled=Sel;
	}
}

function Bdl(Count)
{
	/*var fun;
	if(DL_Count<Dldrv.DLCount)
	{
		Progre.innerHTML='DL :' + Info[Count].Driver_Desp ;
		fun = 'Dldrv.Bdl(' + DL_Count + ')';
		setTimeout(fun,1000);
		//Dldrv.Bdl(DL_Count);
		Bdl2(DL_Count);
	}
	else
	{
		clearTimeout();
		alert('DL OK!');
		DL_Count=0;		
	}*/
	var fun;
	var Filehttp,FileName,FileSize,Desp,Ver,Proge;
	var i=0;
	Proge='';
	i=Count;
	if(Count<Show_Count)
	{
		if(Info[i].Run==true)
		{
			//alert('http://10.1.9.120/DLCenter/' + Info[i].Driver_Path + Info[i].Driver_Exe_File + Info[i].Size);
			Filehttp = Host_IP_Path+ Info[i].Driver_Path + Info[i].Driver_Exe_File ;
			alert(Filehttp);
			FileName = i + Info[i].Driver_Exe_File ; 
			FileSize = Info[i].Size ; 
			Desp = Info[i].Driver_Desp ;
			Ver = Info[i].Current_Ver ;
			ShowProce(i);
			//alert(Filehttp + ',' + FileName + ',' + FileSize + ',' + Desp + ',' + Ver)
			//DriverCDHtml1.DLFile(Filehttp,FileName,FileSize,Desp,Ver);
			//DriverCDHtml1.AboutBox();
			Dldrv.dl(Filehttp,FileName,FileSize,Desp,Ver,1);
			/*Proge=Proge + '<table width="520" border=0><tr><td>'
			Proge=Proge + '<font class="Ini2"></font><font class="Ini">' + Info[Count].Driver_Desp + '</font>';
			Proge=Proge + '</td></tr></table>'
			Progre.innerHTML=Proge;*/
			Bdl2(DL_Count);		
		}
		else
		{
			DL_Count++;
			fun = 'Bdl(' + DL_Count + ')';
			setTimeout(fun,1000);
		}
	}
	else
	{
		clearTimeout();
		alert('Download driver OK! Now starting to install!');
		DL_Count=0;	
		Show_Install_Pro_Count=0;;
		DriverCDHtml1.GO();		
		Show_Install_Pro(-1);
		/*fun = 'Show_Install_Pro(0)';
		setTimeout(fun,1000);		*/
	}	
}


function Bdl2(Count)
{
	var fun,check,F_Name,F_Size;
	clearTimeout();
	check=Dldrv.GetDLState();
	if(check!=1)
	{
		fun = 'Bdl2(' + DL_Count + ')';
		setTimeout(fun,1000);		
	}
	else
	{
		F_Name=DL_Count+Info[DL_Count].Driver_Exe_File;
		F_Size=Info[DL_Count].Size;
		if(DriverCDHtml1.CheckFile(F_Name,F_Size)==1)
		{
			DL_Count++;
			fun = 'Bdl(' + DL_Count + ')';
			setTimeout(fun,1000);						
		}
		else
		{
			DL_Try_Count++;
			if(DL_Try_Count==3)
			{
				alert('Download fail please check your net and try again!')
			}
			else
			{
				fun = 'Bdl(' + DL_Count + ')';
				setTimeout(fun,1000);									
			}
		}
	}
}

function Bdl_Old(Count)
{
	var check;
	var fun;
	//alert(Count)
	//alert(Info[Count].Driver_Desp)
	if (DL_Count<Dldrv.DLCount)
	{	
		clearTimeout();
		//check=DriverCDHtml1.GetDLState(Info[Count].Driver_Desp);
		check=Dldrv.GetDLState();
		if((check!=1) && (DL_Count!=0))
		{
			//alert('Wait');
			Progre.innerHTML='wait ' + check + ':' + Info[Count-1].Driver_Desp ;
			fun = 'Bdl(' + DL_Count + ')';
			setTimeout(fun,1000);
		}
		else
		{
			Progre.innerHTML='now dl ' + check + ':' + Info[Count].Driver_Desp ;
			Dldrv.Bdl(DL_Count);
			DL_Count = DL_Count +1
			fun = 'Bdl(' + DL_Count + ')';
			setTimeout(fun,1000);
		}
	}
	else
	{
		clearTimeout();
		alert('Download driver OK! Now starting to install!');
		DL_Count=0;
	}
}

function Set_Run_Info(i)
{
	var Filehttp,FileName,FileSize,Desp,Ver;
	var Driver_Ver,RunFlag,Option,Driver_Path	
	Filehttp = Host_IP_Path+Info[i].Driver_Path + Info[i].Driver_Exe_File ;
	FileName = i + Info[i].Driver_Exe_File ; 
	FileSize = Info[i].Size ; 
	Desp = Info[i].Driver_Desp ;
	Ver = Info[i].Current_Ver ;
	Driver_Ver = Info[i].Driver_Ver;
	RunFlag = Info[i].RunFlag;
	Option = Info[i].Option;	
	//alert(Desp+'/'+Driver_Path+'/'+FileName+'/'+Option+'/'+RunFlag+'/'+i+'/'+Show_Count)
	DriverCDHtml1.SetRunInfo(Desp,Driver_Path,FileName,Option,RunFlag,i,Show_Count);
	//alert('OK');
}

function Set_DL_Info()
{
	var Filehttp,FileName,FileSize,Desp,Ver;
	var Driver_Ver,RunFlag,Option,Driver_Path
	var i,Real_Count;
	Real_Count=0;
	Driver_Path='';
	//alert(Show_Count);
	for(i=0;i<Show_Count;i++)
	{
		if(Info[i].Run==true)
		{
			if(Check_Reboot(i)!=0)
			{
				if(confirm(Info[i].Driver_Desp+' need to reboot system! continue to install ?'))
				{
					//Set DL INFO
					//alert('http://10.1.9.120/DLCenter/' + Info[i].Driver_Path + Info[i].Driver_Exe_File + Info[i].Size);
					Filehttp = Host_IP_Path+ Info[i].Driver_Path + Info[i].Driver_Exe_File ;
					FileName = i + Info[i].Driver_Exe_File ; 
					FileSize = Info[i].Size ; 
					Desp = Info[i].Driver_Desp ;
					Ver = Info[i].Current_Ver ;
					Driver_Ver = Info[i].Driver_Ver;
					RunFlag = Info[i].RunFlag;
					Option = Info[i].Option;
					Dldrv.SetDLInfo(Real_Count,Filehttp,FileName,FileSize,Desp,Ver)
					Real_Count++;
				}
			}
			else
			{
				//Set DL INFO
				//alert('http://10.1.9.120/DLCenter/' + Info[i].Driver_Path + Info[i].Driver_Exe_File + Info[i].Size);
				Filehttp = Host_IP_Path+ Info[i].Driver_Path + Info[i].Driver_Exe_File ;
				FileName = i + Info[i].Driver_Exe_File ; 
				FileSize = Info[i].Size ; 
				Desp = Info[i].Driver_Desp ;
				Ver = Info[i].Current_Ver ;
				Driver_Ver = Info[i].Driver_Ver;
				RunFlag = Info[i].RunFlag;
				Option = Info[i].Option;
				Dldrv.SetDLInfo(Real_Count,Filehttp,FileName,FileSize,Desp,Ver)
				Real_Count++;				
			}
		}
		else
		{
			//alert('no');
		}
	}
	//alert(Real_Count);
	Dldrv.DLCount=Real_Count;
}

function Fix_Path(Org_Path)
{
	var i;
	var New_Path;
	New_Path='';
	i=Org_Path.indexOf("Driver");
	//alert(Org_Path.length);
	Org_Path=Org_Path.substring(7,Org_Path.length);
	//alert(Org_Path.length);	
	for(i=0;i<=Org_Path.length;i++)
	{
		if(Org_Path.charAt(i)=='/')
		{
			New_Path=New_Path+'\\'	
		}
		else
		{
			
			New_Path=New_Path+Org_Path.charAt(i);
		}
	}
	return New_Path;
}

function Check_RunState()
{
	RunState=DriverCDHtml1.RunState;
	return RunState;
}

function Show_Check(i)
{
	/*var Check_Text;
	Check_Text='<input type="checkbox" name="Driver' + i + '" onClick="SetState('+i+')" checked>';
	return Check_Text;*/
	var check,check2,check3,State,Check_Text;
	State=DriverCDHtml1.RunState;
	check=Info[i].Run
	check2=CheckVer.CheckVer(Info[i].Current_Ver,Info[i].Driver_Ver,Info[i].DevID,Info[i].Driver_Desp);
	check3=CheckVer.CheckState(Info[i].Driver_Desp);
	//alert(check2)
	//alert(check3);
	Check_Text='';
	Info[i].Installed=0;
	if(Info[i].ExtMsg!='')
	{
		Info[i].Run=false
		check3=4;
	}
	if(Check_RunState()==1 ||DriverCDHtml1.GetRegValue(3)==1)
	{		
		switch(check3)
		{
		case 0:
			if(check2==2)
			{
				/*Check_Text=Check_Text+'<input type="checkbox" name="Driver' + i + '" onClick="SetState('+i+')" checked>';			
				DriverCDHtml1.SetDriverState(true, i);
				Info[i].Run=true;*/
				Check_Text=Check_Text+'<input type="checkbox" name="Driver' + i + '" onClick="SetState('+i+')">';							
				Info[i].Installed=1;
				//DriverCDHtml1.SetDriverState(false, i);
				//Info[i].Run=false
			}
			else
			{
				if(check2==1)
				{
					/*Check_Text=Check_Text+'<input type="checkbox" name="Driver' + i + '" onClick="SetState('+i+')">';			
					DriverCDHtml1.SetDriverState(false, i);
					Info[i].Run=false;*/
					Check_Text=Check_Text+'<input type="checkbox" name="Driver' + i + '" onClick="SetState('+i+')">';			
					//DriverCDHtml1.SetDriverState(true, i);
					//Info[i].Run=true;					
					//alert(Info[i].Run);
				}
				else
				{
					/*Check_Text=Check_Text+'<input type="checkbox" name="Driver' + i + '" onClick="SetState('+i+')">';			
					DriverCDHtml1.SetDriverState(false, i);
					Info[i].Run=false;*/						
					Check_Text=Check_Text+'<input type="checkbox" name="Driver' + i + '" onClick="SetState('+i+')">';			
					//DriverCDHtml1.SetDriverState(true, i);
					//Info[i].Run=true;					
				}
			}
			break;
		case 1:		
			Check_Text=Check_Text+'<input type="checkbox" name="Driver' + i + '" onClick="SetState('+i+')">';			
			//DriverCDHtml1.SetDriverState(true, i);
			//Info[i].Run=true;				
			break;	
		case 2:
		case 888:
		case 999:
			if(check2==1)
			{
				Check_Text=Check_Text+'<input type="checkbox" name="Driver' + i + '" onClick="SetState('+i+')">';			
				//DriverCDHtml1.SetDriverState(true, i);
				//Info[i].Run=true;	
			}
			else
			{
				Check_Text=Check_Text+'<input type="checkbox" name="Driver' + i + '" onClick="SetState('+i+')" disabled=0 checked>';							
				Info[i].Installed=1;
				//document.all['D_S'+i].innerHTML='Installed'
				//DriverCDHtml1.SetDriverState(false, i);
				//Info[i].Run=false;		
			}			
			break;
		case 4:
			Check_Text=Check_Text+'<input type="checkbox" name="Driver' + i + '" onClick="SetState('+i+')" >';			
			//DriverCDHtml1.SetDriverState(false, i);
			//Info[i].Run=false;			
			break;
		default:
			Check_Text=Check_Text+'<input type="checkbox" name="Driver' + i + '" onClick="SetState('+i+')">';				
			//DriverCDHtml1.SetDriverState(true, i);
			//Info[i].Run=true;				
			break;
		}	
	}
	else
	{
		//alert(i+' run: '+Info[i].Run)
		if(Info[i].Run==true)
		{
			Check_Text=Check_Text+'<input type="checkbox" name="Driver' + i + '" onClick="SetState('+i+')">';
			//DriverCDHtml1.SetDriverState(true, i);
			//Info[i].Run=true;
		}
		else
		{
			Check_Text=Check_Text+'<input type="checkbox" name="Driver' + i + '" onClick="SetState('+i+')" >';			
			//DriverCDHtml1.SetDriverState(false, i);
			//Info[i].Run=false;			
		}
	}
	DriverCDHtml1.SetDriverState(false, i);
	Info[i].Run=false;		
	return Check_Text;	
}

function SetState(i)
{
	var j,k;
	if(Check_Reboot(i)!=0)
	{
		if(Driverinfo['Driver'+i].checked==false)
		{
			Info[i].Run=false;
			DriverCDHtml1.SetDriverState(false, i);					
		}
		else
		{			
			if(confirm(Info[i].Driver_Desp+' need to reboot system!\nother selected driver will be remove continue to install ?'))				
			{
				Info[i].Run=true;
				DriverCDHtml1.SetDriverState(true, i);			
				for(j=0;j<Show_Count;j++)
				{
					if(i!=j)
					{
						if(Driverinfo['Driver'+j].disabled==false)
						{
							Driverinfo['Driver'+j].checked=false;
							Info[j].Run=false
							DriverCDHtml1.SetDriverState(false, j);						
						}
					}
				}			
			}
			else
			{
				Driverinfo['Driver'+i].checked=false;
				Info[i].Run=false;
				DriverCDHtml1.SetDriverState(false, i);
			}
		}
	}
	else	
	{
		for(j=0;j<Show_Count;j++)
		{
			if(i!=j)
			{
				if((Driverinfo['Driver'+j].checked==true)&&(Check_Reboot(j)!=0)&&(Driverinfo['Driver'+j].disabled==false))
				{
					if(confirm('If you want to install [' + Info[i].Driver_Desp  + '] the [' + Info[j].Driver_Desp + '] need to remove ! Continue to install ?'))
					{
						Driverinfo['Driver'+j].checked=false;
						Info[j].Run=false
						DriverCDHtml1.SetDriverState(false, j);							
					}
					else
					{
						Driverinfo['Driver'+j].checked=true;
						Info[j].Run=true;
						DriverCDHtml1.SetDriverState(true, j);	
						for(k=0;k<Show_Count;k++)
						{
							if(k!=j)
							{
								Driverinfo['Driver'+k].checked=false;
								Info[k].Run=false
								DriverCDHtml1.SetDriverState(false, k);									
							}
						}						
					}
				}
			}
		}			
		Info[i].Run=Driverinfo['Driver'+i].checked;
		DriverCDHtml1.SetDriverState(Driverinfo['Driver'+i].checked, i);		
	}
}

function SetState2(i)
{
	var j,k
	//alert(i);
	//alert(Info[i].Run);
	//alert(Driverinfo['Driver'+i].checked);
	//DriverCDHtml1.SetDriverState(Driverinfo['Driver'+i].checked, i);
	//Info[i].Run=parent.Main.Driverinfo['Driver'+i].checked;
	if(Check_Reboot(i)!=0)
	{
		for(j=0;j<Show_Count;j++)
		{
			if(j!=i)
			{
				if(Check_Reboot(j)!=0)
				{
					if(Driverinfo['Driver'+j].checked==true&&Driverinfo['Driver'+j].disabled==false)
					{
						;
					}
					else
					{
						Driverinfo['Driver'+j].disabled=false;
						Driverinfo['Driver'+j].checked=true
						Info[j].Run=Driverinfo['Driver'+j].checked;		
						DriverCDHtml1.SetDriverState(Driverinfo['Driver'+j].checked, j);
						for(k=0;k<Show_Count;k++)
						{
							if(k!=j&&k!=i)
							{
								Driverinfo['Driver'+k].disabled=true;
								Driverinfo['Driver'+k].checked=false
								Info[k].Run=false;		
								DriverCDHtml1.SetDriverState(false, k);								
							}
						}
						Info[j].Run=Driverinfo['Driver'+j].checked;
						DriverCDHtml1.SetDriverState(Driverinfo['Driver'+j].checked, j);												
						break;
					}
					
				}
				else
				{
					if(Driverinfo['Driver'+i].checked==false)
					{
						Driverinfo['Driver'+j].disabled=false;
						Driverinfo['Driver'+j].checked=true
						Info[j].Run=Driverinfo['Driver'+j].checked;		
						DriverCDHtml1.SetDriverState(Driverinfo['Driver'+j].checked, j);
					}
					else
					{
						Driverinfo['Driver'+j].disabled=true;
						Driverinfo['Driver'+j].checked=false
						Info[j].Run=Driverinfo['Driver'+j].checked;			
						DriverCDHtml1.SetDriverState(Driverinfo['Driver'+j].checked, j);
					}
				}
			}
			else
			{
				Info[j].Run=Driverinfo['Driver'+j].checked;
				DriverCDHtml1.SetDriverState(Driverinfo['Driver'+j].checked, j);
			}
		}		
	}
	else
	{
		Info[i].Run=Driverinfo['Driver'+i].checked;
		DriverCDHtml1.SetDriverState(Driverinfo['Driver'+i].checked, i);		
	}
	//check_option();
	//alert(Info[i].Run);
}

function ShowProce(Count)
{
	var fun;
	var Proge,Proge_Text;
	//Count=DL_Count;	
	//alert(Count);
	Proge='';
	Proge_Text='';
		Proge=Proge + '<table width="520" border=0><tr><td colspan=2>'
		Proge=Proge + '<font class="Ini2">NOW Download </font><font class="Ini">' + Info[Count].Driver_Desp + '</font>';
		Proge=Proge + '</td></tr><tr><td width="20%">'
		/*Proge=Proge + '<font class="proguess">Now Install:</font></td><td>'
		Proge=Proge + '<table bgcolor=red width="100%" height="15" CELLPADDING="0" CELLSPACING="0"><tr><td>&nbsp</td></tr></table>'
		Proge=Proge + '</td></tr><tr><td width="20%">'
		Proge=Proge + '<font class="proguess">Total Install:</font></td><td>'
		Proge=Proge + '<table bgcolor=blue width="80%" height="15" CELLPADDING="0" CELLSPACING="0"><tr><td>&nbsp</td></tr></table>'*/
		Proge=Proge + '</td></tr></table>'
		document.all.Progre.innerHTML= Proge;
		/*Proge_Text=Proge_Text + '<table width="520" border=0><tr><td colspan=2>'
		Proge_Text=Proge_Text + '<font class="Ini2"></font><font class="Ini">&nbsp</font>';
		Proge_Text=Proge_Text + '</td></tr><tr><td width="20%">'
		Proge_Text=Proge_Text + '<font class="proguess"></font></td><td>'
		Proge_Text=Proge_Text + '<table border=1 width="100%" height="15" CELLPADDING="0" CELLSPACING="0"><tr><td align=center><font class="proguess2">99%</font></td></tr></table>'
		Proge_Text=Proge_Text + '</td></tr><tr><td width="20%">'
		Proge_Text=Proge_Text + '<font class="proguess"></font></td><td>'
		Proge_Text=Proge_Text + '<table border=1 width="100%" height="15" CELLPADDING="0" CELLSPACING="0"><tr><td align=center><font class="proguess2">80%</font></td></tr></table>'
		Proge_Text=Proge_Text + '</td></tr></table>'
		document.all.Progre_Text.innerHTML= Proge_Text;	*/	
		/*fun = 'ShowProce()';
		setTimeout(fun,100);*/	
}

function Show_Install_Pro(Cur_Run_Num)
{
	var fun;
	var Next_Num;
	var Proge,Proge_Text;
	Proge='';
	Proge_Text='';
	if(DriverCDHtml1.GetRegValue(2)!=999)
	{	
		Next_Num=DriverCDHtml1.GetRegValue(2)-1;
		if(Check_Reboot(Next_Num)==1)
		{
			wait_reboot(Next_Num);
		}		
		else
		{			
			if(Cur_Run_Num == Next_Num)
			{
				if(Show_Install_Pro_Count<100)
				{
					Show_Install_Pro_Count=Show_Install_Pro_Count+2;
				}
				else	
				{
					Show_Install_Pro_Count=0;
				}
				if(Total_Count<100)
				{
					if(Total_Count_Lim>Total_Count)
					{
						Total_Count=Total_Count+1;
					}			
				}
			}
			else
			{
				//Show_Driver(Show_Count);
				Total_Count_Lim=Total_Count_Lim_Unit*Next_Num;
				Total_Count=Total_Count+Math.floor(Info[Next_Num].Size/Total_Size)*100;
				Show_Install_Pro_Count=0;
			}
			if(Info[Next_Num].Run==true)
			{
				Proge=Proge + '<table width="520" border=0><tr><td colspan=2>'
				Proge=Proge + '<font class="Ini2">NOW Install </font><font class="Ini">' + Info[Next_Num].Driver_Desp + '</font>';
				Proge=Proge + '</td></tr><tr><td width="20%">'		
				Proge=Proge + '<font class="proguess">Now Install:</font></td><td>'
				Proge=Proge + '<table bgcolor=red width="' + Show_Install_Pro_Count + '%" height="15" CELLPADDING="1" CELLSPACING="1"><tr><td><font class="proguess2">&nbsp</td></tr></table>'
				Proge=Proge + '</td></tr><tr><td width="20%">'
				Proge=Proge + '<font class="proguess">Total Install:</font></td><td>'
				Proge=Proge + '<table bgcolor=blue width="' + Total_Count + '%" height="15" CELLPADDING="1" CELLSPACING="1"><tr><td><font class="proguess2">&nbsp</td></tr></table>'
				Proge=Proge + '</td></tr></table>'
				document.all.Progre.innerHTML= Proge;	
				Proge_Text=Proge_Text + '<table width="520" border=0><tr><td colspan=2>'
				Proge_Text=Proge_Text + '<font class="Ini2"></font><font class="Ini">&nbsp</font>';
				Proge_Text=Proge_Text + '</td></tr><tr><td width="20%">'
				Proge_Text=Proge_Text + '<font class="proguess"></font></td><td>'
				Proge_Text=Proge_Text + '<table border=1 width="100%" height="15" CELLPADDING="0" CELLSPACING="0"><tr><td align=center>' + Change_Text(Show_Install_Pro_Count) + '</font></td></tr></table>'
				Proge_Text=Proge_Text + '</td></tr><tr><td width="20%">'
				Proge_Text=Proge_Text + '<font class="proguess"></font></td><td>'
				Proge_Text=Proge_Text + '<table border=1 width="100%" height="15" CELLPADDING="0" CELLSPACING="0"><tr><td align=center>' + Change_Text(Total_Count) + '</font></td></tr></table>'
				Proge_Text=Proge_Text + '</td></tr></table>'
				document.all.Progre_Text.innerHTML= Proge_Text;	
			}
			else
			{
				document.all.Progre.innerHTML= '';	
				document.all.Progre_Text.innerHTML= '';			
			}
			fun = 'Show_Install_Pro(' + Next_Num + ')';
			setTimeout(fun,1000);	
		}	
	}
	else
	{
		if(Cur_Run_Num==-1)
		{
			clearTimeout();
			Proge='';
			document.all.Progre.innerHTML= Proge;
			document.all.Progre_Text.innerHTML= Proge_Text;	
			if(DriverCDHtml1.GetRegValue(2)!=999)
			{
				Next_Num=DriverCDHtml1.GetRegValue(2)-1;
				fun = 'Show_Install_Pro('+ Next_Num +')';
				setTimeout(fun,1000);				
			}
			else
			{	
				fun = 'Show_Install_Pro(-1)';
				setTimeout(fun,500);			
			}
		}
		else
		{
			clearTimeout();
			if(Check_Reboot(Cur_Run_Num)==1)
			{
				wait_reboot(Cur_Run_Num);
			}
			else
			{		
				Proge='';
				Proge=Proge + '<table width="520" border=0><tr><td colspan=2>'
				Proge=Proge + '<font class="Ini2">NOW Install </font><font class="Ini">' + Info[Cur_Run_Num].Driver_Desp + '</font>';
				Proge=Proge + '</td></tr><tr><td width="20%">'		
				Proge=Proge + '<font class="proguess">Now Install:</font></td><td>'
				Proge=Proge + '<table bgcolor=red width="100%" height="15" CELLPADDING="1" CELLSPACING="1"><tr><td><font class="proguess2">&nbsp</font></td></tr></table>'
				Proge=Proge + '</td></tr><tr><td width="20%">'
				Proge=Proge + '<font class="proguess">Total Install:</font></td><td>'
				Proge=Proge + '<table bgcolor=blue width="100%" height="15" CELLPADDING="1" CELLSPACING="1"><tr><td><font class="proguess2">&nbsp</font></td></tr></table>'
				Proge=Proge + '</td></tr></table>'
				document.all.Progre.innerHTML= Proge;	
				Proge_Text=Proge_Text + '<table width="520" border=0><tr><td colspan=2>'
				Proge_Text=Proge_Text + '<font class="Ini2"></font><font class="Ini">&nbsp</font>';
				Proge_Text=Proge_Text + '</td></tr><tr><td width="20%">'
				Proge_Text=Proge_Text + '<font class="proguess"></font></td><td>'
				Proge_Text=Proge_Text + '<table border=1 width="100%" height="15" CELLPADDING="0" CELLSPACING="0"><tr><td align=center><font class="proguess2">100%</font></td></tr></table>'
				Proge_Text=Proge_Text + '</td></tr><tr><td width="20%">'
				Proge_Text=Proge_Text + '<font class="proguess"></font></td><td>'
				Proge_Text=Proge_Text + '<table border=1 width="100%" height="15" CELLPADDING="0" CELLSPACING="0"><tr><td align=center><font class="proguess2">100%</font></td></tr></table>'
				Proge_Text=Proge_Text + '</td></tr></table>'
				document.all.Progre_Text.innerHTML= Proge_Text;					
				alert('Install driver OK! Please reboot your computer!');
				Proge='';
				Proge_Text='';
				document.all.Progre.innerHTML= Proge;
				document.all.Progre_Text.innerHTML= Proge_Text;				
			}
		}
	}
}

function wait_reboot(i)
{
	var fun;
	var Next_Num;
	var Proge,Proge_Text;
	Proge='';
	Proge_Text='';	
	Proge=Proge + '<table width="520" border=0><tr><td colspan=2>'
	Proge=Proge + '<font class="Ini2">NOW Install </font><font class="Ini">' + Info[i].Driver_Desp + '</font>';
	Proge=Proge + '</td></tr><tr><td width="20%">'		
	Proge=Proge + '<font class="proguess">Now Install:</font></td><td>'
	Proge=Proge + '<table bgcolor=red width="' + Reboot_Count + '%" height="15" CELLPADDING="1" CELLSPACING="1"><tr><td><font class="proguess3">&nbsp</font></td></tr></table>'
	Proge=Proge + '</td></tr><tr><td width="20%">'
	Proge=Proge + '<font class="proguess">Total Install:</font></td><td>'
	Proge=Proge + '<table bgcolor=blue width="' + Total_Count + '%" height="15" CELLPADDING="1" CELLSPACING="1"><tr><td><font class="proguess3">&nbsp</font></td></tr></table>'
	Proge=Proge + '</td></tr></table>'
	document.all.Progre.innerHTML= Proge;	
	Proge_Text=Proge_Text + '<table width="520" border=0><tr><td colspan=2>'
	Proge_Text=Proge_Text + '<font class="Ini2">&nbsp</font><font class="Ini">&nbsp</font>';
	Proge_Text=Proge_Text + '</td></tr><tr><td width="20%">'
	Proge_Text=Proge_Text + '<font class="proguess">&nbsp</font></td><td>'
	Proge_Text=Proge_Text + '<table border=1 width="100%" height="15" CELLPADDING="0" CELLSPACING="0"><tr><td align=center>' + Change_Text(Reboot_Count) + '</font></td></tr></table>'
	Proge_Text=Proge_Text + '</td></tr><tr><td width="20%">'
	Proge_Text=Proge_Text + '<font class="proguess">&nbsp</font></td><td>'
	Proge_Text=Proge_Text + '<table border=1 width="100%" height="15" CELLPADDING="0" CELLSPACING="0"><tr><td align=center>' + Change_Text(Total_Count) + '<font></td></tr></table>'
	Proge_Text=Proge_Text + '</td></tr></table>'
	document.all.Progre_Text.innerHTML= Proge_Text;	
	if(Reboot_Count<100)
	{
		Reboot_Count++;	
	}
	else
	{
		Reboot_Count=0;	
	}
	if(Total_Count<100)
	{
		Total_Count++;
	}
	else
	{
		Total_Count=100;			
	}
	fun = 'wait_reboot(' + i + ')';
	setTimeout(fun,1000);		
}

function Change_Text(Pro_Text)
{
	var rtl_text;
	rtl_text='';
	if(Pro_Text<48)
	{
		rtl_text = '<font class="proguess3">' + Pro_Text + '%'
	}
	else
	{
		rtl_text = '<font class="proguess2">' + Pro_Text + '%'
	}
	return rtl_text;
}

function Check_Reboot(i)
{
	var rtl_Value;
	//0-->No reboot 1-->Reboot
	switch(Info[i].Option)
	{
		case 0:
			rtl_Value=0;
			break;
		case 1:
			rtl_Value=1;
			break;
		case 2:
			rtl_Value=1;
			break;
		case 3:
			rtl_Value=0;
			break;
		case 4:
			rtl_Value=1;
			break;
		case 5:
			rtl_Value=0;
			break;
		case 6:
			if(Os==12||Os==15)
			{
				rtl_Value=1;
			}
			else
			{
				rtl_Value=0;
			}
			break;
		case 7:
			if(Os==12||Os==15)
			{
				rtl_Value=1;
			}
			else
			{
				rtl_Value=2;
			}		
			break;
		case 8:
			rtl_Value=1;
			break;
		case 9:
			if(Os==15)
			{
				rtl_Value=1;
			}
			else
			{
				rtl_Value=0;
			}		
			break;			
		case 10:
			if(Os==12||Os==15)
			{
				rtl_Value=1;
			}
			else
			{
				rtl_Value=0;
			}		
			break;		
		case 11:
			rtl_Value=1;
			break;	
		case 12:
			if(Os==12||Os==15)
			{
				rtl_Value=1;
			}
			else
			{
				rtl_Value=0;
			}		
			break;				
		case 13:
			rtl_Value=0;
			break;				
		case 14:
			rtl_Value=2;
			break;							
		default:
			rtl_Value=0;
			break;																									
	}
	return rtl_Value;
}