<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.letousky.lottery.delegate.WinMoneyManage"%>
<%@page import="java.util.List"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.letousky.lottery.delegate.SelectIssueCurManage"%>
<%@page import="com.letousky.lottery.util.TimeUtil"%>
<%@page import="com.letousky.lottery.util.StandardFormat"%>
<%
	String lot1 = request.getParameter("lot")==null?"201":(String)request.getParameter("lot");
	String[] adverExt=new String[31];
	String[] nr = new WinMoneyManage().getWinMoneyItems(
			new String[] { lot1 }, "C0046");
			
	String[] n1 = null;
	if (nr == null) {
		nr = new String[50];
		nr[2] = "--";
		nr[15] = "            ";
		nr[16] = "            ";
		nr[49] = " ";
		n1 = new String[] {};
	} else {
		n1 = (nr[17].split("//")[0]).split("/");
	}
	//out.println("nr[49]="+nr[49]);
	//out.println("nr[47]="+nr[47]);
	if (nr != null) {
		nr[49] = new java.math.BigDecimal(new Double(nr[49])
				.doubleValue()).toString();
		if (nr[49].indexOf(".") != -1) {
			nr[49] = nr[49].substring(0, nr[49].indexOf("."));
		}
	}
	
	for(int s=18,l=0;s<49;s++,l++){
		adverExt[l]=nr[s+1];
	}

	SelectIssueCurManage sc = new SelectIssueCurManage();
	String[] issueAry = sc.getCurIssue(new String[] { request
			.getParameter("lot") }, "C0018");
	if (issueAry != null) {
		issueAry[0] = issueAry[0].trim();
		issueAry[3] = TimeUtil.string2time(issueAry[3]);
		issueAry[3]=issueAry[3].substring(5,issueAry[3].length());
		issueAry[4] = StandardFormat.lotStateMap.get(("0"
				.equals(issueAry[4].trim())) ? "0" : "-21");
		 		
	     
	} else {
		issueAry = new String[5];
		issueAry[0] = request.getParameter("lot").trim();//玩法代码
		issueAry[1] = "--";//期号
		issueAry[3] = "--年--月--日 --:--";//截止时间
		issueAry[4] = StandardFormat.lotStateMap.get("-21");//销售状态

	}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>数字彩</title>
	<meta http-equiv="pragma" content="no-cache"/>
	<meta http-equiv="cache-control" content="no-cache"/>
	<meta http-equiv="expires" content="0"/>    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3"/>
	<meta http-equiv="description" content="This is my page"/>
	<link href="<%=request.getContextPath() %>/Letousky/numberLetou/css/infomationStyle.css" rel="stylesheet" type="text/css" />
  </head>
  <body>
  	 <div id='InformationContent'>
  	 	<div class='presen'>
  	 		<div class='presenLogo'>
  	 			<span class='presen_ssq' id='presenSp'></span>
  	 		</div>
  	 		<div class='presenNum'>
  	 			<div id='pnumber'>
  	 				<span class='periods'><%=nr[2]%>期开奖：</span>
  	 				<ul class='ratherNumber' id='ratherNumber'></ul>
  	 			</div>
  	 			<div id='advertising'>
  	 				<span id='adverName'></span><span class='adverGuG' id='adverGuG'></span><span class='ratherTime' id='ratherTime'></span>
  	 			</div>
  	 			<div class='deadline'>
  	 				<span>第<font color="ff0065" style='font-weight:bold'><%=Integer.parseInt(nr[2])+1%></font>期投注截止时间：
  	 				<font color="#FF0000"><%=issueAry[3]%></font> 还有：</span><span id='jztime'></span>
  	 			</div>
  	 			<div class='mapLink'>
  	 				<a href="<%=request.getContextPath() %>/Letousky/zoushitu/chart/ssq/chart_ssq.jsp?wf=jbzs" target="_blank" class='zst'>双色球走势图</a><a href="<%=request.getContextPath() %>/Letousky/serviceCenter/serviceCenter.jsp?h=5" style='margin-left:15px;' target="_blank" class='wfjs'>双色球玩法介绍</a>
  	 			</div>
  	 		</div>
  	 	</div>
  	 	
  	 	<div class='winningNoteNumber'>
  	 		<table cellspacing='1' cellpadding='0' id="noteNuberTab">
  	 			<thead>
  	 				<tr><td width='73'>奖项</td><td width='70'>中奖注数</td><td width="84">单注奖金(元)</td></tr>
  	 			</thead>
  	 			<tbody id='noteTbody'></tbody>
  	 		</table>
  	 	</div>
  	 </div>
  </body>
  </html>
  <script type='text/javascript'>
  
   var FX=new Object();
    
   function number_format(s){
    	if(/[^0-9\.\-]/.test(s)) 
			return "invalid value";
    	s=s.replace(/^(\d*)$/,"$1.");
    	s=(s+"").replace(/(\d*\.\d\d)\d*/,"$1");
    	s=s.replace(".",",");
    	var re=/(\d)(\d{3},)/;
    	while(re.test(s))
           s=s.replace(re,"$1,$2");
    	   s=s.replace(/,(\d\d)$/,".$1");
	 
  		return s.replace(/^\./,"0.").replace(/.$/,"");
   }
  
  /*
  **
  **
  *****全局变量***
  **/
  FX.list=[];
  FX.lired='';
  FX.liblue='';
  FX.awardTD='';
  FX.$=function(ele) { return document.getElementById(ele); };
  FX.time='<%=issueAry[6]%>';
  FX.E=null;
  FX.day='--';
  FX.hours='--';
  FX.min='--';
  FX.s='--';
  FX.return_time=function(){
	
	var date =new Date();

	var seconds=parseInt(FX.time)-parseInt(date.getTime());
	
	FX.day = parseInt(seconds / (24 * 60 * 60 * 1000));
	FX.hours = parseInt((seconds / (60 * 60 * 1000) - FX.day * 24));
	FX.min = parseInt(((seconds / (60 * 1000)) - (FX.day * 24 * 60) - (FX.hours * 60)));
	FX.s = parseInt((seconds / 1000 - FX.day * 24 * 60 * 60 - FX.hours * 60 * 60 - FX.min * 60));
	
	FX.day<0?FX.day='0':FX.day=FX.day;
	FX.hours<0?FX.hours='0':FX.hours=FX.hours;
	FX.min<0?FX.min='0':FX.min=FX.min;
	FX.s<0?FX.s='0':FX.s=FX.s;
	
	var str= FX.hours+'小时'+(FX.min<10?'0'+FX.min:FX.min)+'分'+(FX.s<10?'0'+FX.s:FX.s)+'秒';
	
	FX.$('jztime').innerHTML=str;
	
	window.setTimeout("FX.return_time()",1000);
}
FX._$=function(className, tag, parent){

  var parent = parent || document;
  var tag = tag||"*";
  //if(!(parent = F$(parent))){return false;}
  // 查找所有匹配标签
  var allTags = (tag == "*" && parent.all) ? parent.all : F$$(tag, parent);
  var classElements = [];
  
  // 创建一个正则表达是来判断className的正确性
  className = className.replace(/\-/g, "\\-");
  var regex = new RegExp("(^|\\s)" + className + "(\\s|$)");
  var elenemt;
  // 检查每个元素
  for(var i=0; i<allTags.length; i++){
    elem = allTags[i];
    if(regex.test(elem.className)){
      classElements.push(elem);
    }
  }
 
  return classElements;
};

  

  /*全局配置*/
    var infomation_config={
    	'201':{
    		'name':'双色球',
    		'imgText':'ssq',
    		'advertising':'2元赢取￥1500万',
    		'ratherTime':'每周二、四、日20：45开奖',
    		'etcSize':6,
    		'awardEtc':{
    			"a_1":{'awardName':'一等奖','note':'<%=adverExt[0]%>','awardPrice':'<%=adverExt[1]%>'}, 
    			"a_2":{'awardName':'二等奖','note':'<%=adverExt[2]%>','awardPrice':'<%=adverExt[3]%>'},
    			"a_3":{'awardName':'三等奖','note':'<%=adverExt[4]%>','awardPrice':'<%=adverExt[5]%>'},
    			"a_4":{'awardName':'四等奖','note':'<%=adverExt[6]%>','awardPrice':'<%=adverExt[7]%>'},
    			"a_5":{'awardName':'五等奖','note':'<%=adverExt[8]%>','awardPrice':'<%=adverExt[9]%>'},
    			"a_6":{'awardName':'六等奖','note':'<%=adverExt[10]%>','awardPrice':'<%=adverExt[11]%>'}
    		}
    	},
    	'110':{
    		'name':'大乐透',
    		'imgText':'dlt',
    		'advertising':'3元赢取￥1600万',
    		'ratherTime':'每周一、三、六20:30开奖',
    		'etcSize':11,
			'awardEtc':{
    			"a_1":{'awardName':'一等奖/基本','note':'<%=adverExt[0]%>','awardPrice':'<%=adverExt[1]%>'}, 
    			"a_2":{'awardName':'一等奖/追加','note':'<%=adverExt[2]%>','awardPrice':'<%=adverExt[3]%>'},
    			"a_3":{'awardName':'二等奖/基本','note':'<%=adverExt[4]%>','awardPrice':'<%=adverExt[5]%>'},
    			"a_4":{'awardName':'二等奖/追加','note':'<%=adverExt[6]%>','awardPrice':'<%=adverExt[7]%>'},
    			"a_5":{'awardName':'三等奖/基本','note':'<%=adverExt[8]%>','awardPrice':'<%=adverExt[9]%>'},
    			"a_6":{'awardName':'三等奖/追加','note':'<%=adverExt[10]%>','awardPrice':'<%=adverExt[11]%>'},
    			"a_7":{'awardName':'四等奖','note':'<%=adverExt[12]%>','awardPrice':'<%=adverExt[13]%>'}, 
    			"a_8":{'awardName':'五等奖','note':'<%=adverExt[14]%>','awardPrice':'<%=adverExt[15]%>'},
    			"a_9":{'awardName':'六等奖','note':'<%=adverExt[16]%>','awardPrice':'<%=adverExt[17]%>'},
    			"a_10":{'awardName':'七等奖','note':'<%=adverExt[18]%>','awardPrice':'<%=adverExt[19]%>'},
    			"a_11":{'awardName':'八等奖','note':'<%=adverExt[20]%>','awardPrice':'<%=adverExt[21]%>'}
    		}
    	},
    	'105':{
    		'name':'排列三',
    		'imgText':'plthree',
    		'advertising':'每天开奖天天中奖',
    		'ratherTime':'每日20:30开奖',
    		'etcSize':3,
    		'awardEtc':{
    			"a_1":{'awardName':'直选','note':'<%=adverExt[0]%>','awardPrice':'<%=adverExt[1]%>'}, 
    			"a_2":{'awardName':'组选3','note':'<%=adverExt[2]%>','awardPrice':'<%=adverExt[3]%>'},
    			"a_3":{'awardName':'组选6','note':'<%=adverExt[4]%>','awardPrice':'<%=adverExt[5]%>'}
    		}
    	},
    	'109':{
    		'name':'排列五',
    		'imgText':'plfive',
    		'advertising':'每天开奖天天中奖',
    		'ratherTime':'每日20:30开奖',
    		'etcSize':1,
    		'awardEtc':{
    			"a_1":{'awardName':'一等奖','note':'<%=adverExt[0]%>','awardPrice':'<%=adverExt[1]%>'}
    		}
    	},
    	'202':{
    		'name':'福彩3D',
    		'imgText':'fc3d',
    		'advertising':'每天开奖天天中奖',
    		'ratherTime':'每日20:30开奖',
    		'etcSize':3,
    		'awardEtc':{
    			"a_1":{'awardName':'直选','note':'<%=adverExt[0]%>','awardPrice':'<%=adverExt[1]%>'}, 
    			"a_2":{'awardName':'组选3','note':'<%=adverExt[2]%>','awardPrice':'<%=adverExt[3]%>'},
    			"a_3":{'awardName':'组选6','note':'<%=adverExt[4]%>','awardPrice':'<%=adverExt[5]%>'}
    		}
    	},
    	'205':{
    		'name':'七乐彩',
    		'imgText':'qlc',
    		'advertising':'百万富翁生产线',
    		'ratherTime':'每周二、四、日20：45开奖',
    		'etcSize':7,
    		'awardEtc':{
    			"a_1":{'awardName':'一等奖','note':'<%=adverExt[0]%>','awardPrice':'<%=adverExt[1]%>'}, 
    			"a_2":{'awardName':'二等奖','note':'<%=adverExt[2]%>','awardPrice':'<%=adverExt[3]%>'},
    			"a_3":{'awardName':'三等奖','note':'<%=adverExt[4]%>','awardPrice':'<%=adverExt[5]%>'},
    			"a_4":{'awardName':'四等奖','note':'<%=adverExt[6]%>','awardPrice':'<%=adverExt[7]%>'},
    			"a_5":{'awardName':'五等奖','note':'<%=adverExt[8]%>','awardPrice':'<%=adverExt[9]%>'},
    			"a_6":{'awardName':'六等奖','note':'<%=adverExt[10]%>','awardPrice':'<%=adverExt[11]%>'},
    			"a_7":{'awardName':'七等奖','note':'<%=adverExt[12]%>','awardPrice':'<%=adverExt[13]%>'}
    		}
    	},
    	'108':{
    		'name':'七星彩',
    		'imgText':'qxc',
    		'advertising':'2元就中500万',
    		'ratherTime':'每周二、四、日20：45开奖',
    		'etcSize':6,
    		'awardEtc':{
    			"a_1":{'awardName':'一等奖','note':'<%=adverExt[0]%>','awardPrice':'<%=adverExt[1]%>'}, 
    			"a_2":{'awardName':'二等奖','note':'<%=adverExt[2]%>','awardPrice':'<%=adverExt[3]%>'},
    			"a_3":{'awardName':'三等奖','note':'<%=adverExt[4]%>','awardPrice':'<%=adverExt[5]%>'},
    			"a_4":{'awardName':'四等奖','note':'<%=adverExt[6]%>','awardPrice':'<%=adverExt[7]%>'},
    			"a_5":{'awardName':'五等奖','note':'<%=adverExt[8]%>','awardPrice':'<%=adverExt[9]%>'},
    			"a_6":{'awardName':'六等奖','note':'<%=adverExt[10]%>','awardPrice':'<%=adverExt[11]%>'}
    		}
    	},
    	'111':{
    		'name':'22选5',
    		'imgText':'22x5',
    		'advertising':'中盘玩法大奖易中',
    		'ratherTime':'每周二、四、日20：45开奖',
    		'etcSize':3,
    		'awardEtc':{
    			"a_1":{'awardName':'一等奖','note':'<%=adverExt[0]%>','awardPrice':'<%=adverExt[1]%>'}, 
    			"a_2":{'awardName':'二等奖','note':'<%=adverExt[2]%>','awardPrice':'<%=adverExt[3]%>'},
    			"a_3":{'awardName':'三等奖','note':'<%=adverExt[4]%>','awardPrice':'<%=adverExt[5]%>'}
    		}
    	},
    	'parameters':{
    		'lot':'<%=lot1%>',
    		'number':'<%=nr[17]%>',
    		'poolGunCun':number_format('<%=nr[49]%>')
    	},
    	'show':function(){
    		
    		var num=infomation_config['parameters'].number;
    		FX.lot=infomation_config['parameters'].lot;
    		num.indexOf('//')>-1?FX.list.push({'qq':num.split('//')[0].split('/'),'hq':num.split('//')[1].split('/')}):FX.list.push({'qq':num.split('/'),'hq':''});
    			
  			for(var i=0;i<FX.list[0].qq.length;i++){
  				
				switch(FX.lot){
					case '110':
					case '201':
					case '205':
					case '111':
  						FX.list[0].qq[i]=FX.list[0].qq[i]<10?'0'+FX.list[0].qq[i]:FX.list[0].qq[i];
					break;
				}
  				
  				FX.lired+='<li class="rtRed">'+FX.list[0].qq[i]+'</li>';
  			
  				if(FX.list[0].hq.length>0 && FX.list[0].hq[i]){
  					
  					FX.list[0].hq[i]=FX.list[0].hq[i]<10?'0'+parseInt(FX.list[0].hq[i],10):FX.list[0].hq[i];
  					FX.liblue+='<li class="rtBlue">'+FX.list[0].hq[i]+'</li>';
  					
  				}
  			}
  			
  			
  			
  			
  			FX.$('ratherNumber').innerHTML=FX.lired+FX.liblue;
   			FX.$('adverGuG').innerHTML=infomation_config[FX.lot].advertising;
   			FX.$('ratherTime').innerHTML=infomation_config[FX.lot].ratherTime;
   			FX.$('adverName').innerHTML=infomation_config[FX.lot].name;
			FX.$('presenSp').className='presen_'+infomation_config[FX.lot].imgText;
			FX._$('zst')[0].innerText=infomation_config[FX.lot].name+'走势图';
			FX._$('wfjs')[0].innerText=infomation_config[FX.lot].name+'玩法介绍';
			FX.return_time();
			
			for(var k=1,awardLength=infomation_config[FX.lot].etcSize;k<=awardLength;k++){
				
				var award=infomation_config[FX.lot].awardEtc;
				
				FX.awardTD='<tr><td>'+award['a_'+k].awardName+'</td><td>'+award['a_'+k].note+'</td><td>'+award['a_'+k].awardPrice+'</td></tr>';
				
				var row=FX.$('noteTbody').insertRow(-1);
				var cell1=row.insertCell(-1);
 				var cell2=row.insertCell(-1); 
 				var cell3=row.insertCell(-1);
				cell1.innerHTML=award['a_'+k].awardName;
				cell2.innerHTML='<font color="red">'+award['a_'+k].note+'</font>注';
				cell3.innerHTML='<font color="red">'+number_format(award['a_'+k].awardPrice)+'</font>元';
				
			}
			
			
    	}
    }
    
window.onload=function(){ return infomation_config['show']() };
    	
   
    	
    	
    
  </script>
