//===========================================================================================//
// 中腾科技 	充吧 专用脚本文件
// Company: ZT-TECH
// Author: 	WSY
// QQ:		23612792
// MSN:		wsy0322@live.cn
//===========================================================================================//

/**
 *	得到系统当前时间
 */
var now = new Date();
var year = now.getYear();
var month = now.getMonth()+1 < 10 ? "0" + (now.getMonth()+1) : now.getMonth()+1;
var day = now.getDate();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds();
	
/**
 *	初始化服务对象
 */
function Service(codeId, serviceId, serviceImage, serviceCode, serviceName, payPrice) {
	this.CodeId = codeId;
	this.ServiceId = serviceId;
	this.ServiceImage = serviceImage;
	this.ServiceCode = serviceCode;
	this.ServiceName = serviceName;
	this.PayPrice = payPrice;
	
}

var serviceArray = new Array(
	new Service('DM003','1','/images/qq_vip01.gif', 'LTMCLUB', 'QQ会员', 10),
	new Service('DM004','2','/images/qq_vip02.gif', 'XXJZGW', 'QQ黄钻', 10),
	new Service('DM006','3','/images/qq_vip03.gif', 'XXQQF', 'QQ红钻', 10),
	new Service('DM005','4','/images/qq_vip04.gif', 'XXQGAME', 'QQ蓝钻', 10),//超级玩家
	new Service('DM008','5','/images/qq_vip05.gif', 'XXQQT', 'QQ堂紫钻', 10),
	new Service('DM007','6','/images/qq_vip06.gif', 'PETVIP', 'QQ粉钻', 10),
	new Service('DM009','7','/images/qq_vip07.gif', 'XXZXYY', 'QQ绿钻', 10),
	new Service('DM011','8','/images/qq_vip05.gif', 'QQR2BY', 'QQ音速紫钻', 10),
	new Service('DM010','9','/images/qq_vip08.gif', 'XXLOVE', 'QQ交友', 10),
	new Service('DM012','10','/images/qq_vip09.gif', 'DNFHZ', 'DNF黑钻', 20),
	new Service('DM013','11','/images/qq_vip05.gif', 'QQFCZZ', 'QQ飞车紫钻', 10)
);


//=============================== 注册问题 ==============================//
var regQuestionArray = [
	{id:'', name:'请选择密码提示问题'}, 
	{id:'您的职业是？', name:'您的职业是？'}, 
	{id:'您的家乡是？', name:'您的家乡是？'}, 
	{id:'您初中的语文老师是？', name:'您初中的语文老师是？'}, 
	{id:'您最尊重的人是？', name:'您最尊重的人是？'},
	{id:'您最爱吃的菜是？', name:'您最爱吃的菜是？'}, 
	{id:'您最喜欢的一首歌是？', name:'您最喜欢的一首歌是？'}, 
	{id:'您最喜欢的运动是？', name:'您最喜欢的运动是？'}, 
	{id:'您最喜欢的电影是？', name:'您最喜欢的电影是？'}, 
	{id:'您最喜欢的节日是？', name:'您最喜欢的节日是？'}, 
	{id:'您最想去的地方是？', name:'您最想去的地方是？'}, 
	{id:'您最想做的事情是？', name:'您最想做的事情是？'}, 
	{id:'您最难忘的事情是？', name:'您最难忘的事情是？'} 
];

//=============================== 业务类型 ==============================//
var serviceTypeArray = [
	{id:'', name:'请选择充值服务'}, 
	{id:'1', name:'充Q币/Q点'}, 
	{id:'2', name:'QQ会员服务'}
];

//=============================== 充值服务名称 ==============================//
var typeListArray = [
	{id:'', name:'选择服务名称'}
];
//------------------Q币Q点服务------------------//
var typeQBListArray = [
	//{id:'', name:'选择服务名称'}, 
	{id:'QQACCT_SAVE', name:'Q币'}, 
	{id:'-QQPOINT', name:'Q点'}
];
//------------------QQ会员服务------------------//
var typeServiceListArray = [
	//{id:'', name:'选择服务名称'}, 
	{id:'LTMCLUB', name:'QQ会员'}, 
	{id:'XXJZGW', name:'黄钻'},
	{id:'XXQQF', name:'红钻'},
	{id:'XXQGAME', name:'蓝钻'},
	{id:'XXQQT', name:'QQ堂紫钻'},
	{id:'PETVIP', name:'粉钻'},
	{id:'XXZXYY', name:'绿钻'},
	{id:'QQR2BY', name:'音速紫钻'},
	{id:'XXLOVE', name:'QQ交友'},
	{id:'DNFHZ', name:'DNF黑钻'},
	{id:'QQFCZZ', name:'QQ飞车紫钻'}
];

//=============================== 充值卡面额 ==============================//
var cardValueArray = [
	{id:'', name:'请选择充值卡面额'}
];
var cardValue2Array = [
	{id:'50', name:'50元神州行充值卡'}, 
	{id:'100', name:'100元神州行充值卡'}
];

//=============================== 支付方式 ==============================//
var payTypeArray = [
	{id:'', name:'请选择'},
	{id:'TENPAY', name:'财付通'},
	{id:'ALIPAY', name:'支付宝'},
	{id:'CMBC', name:'民生银行'}
];

//=============================== 积分排行榜 ==============================//
var PointArray = [
	{id:'tab_1_1', type:'WEEK', display:'', imageSrc:'w'}, 
	{id:'tab_1_2', type:'MONTH', display:'none', imageSrc:'n'}, 
	{id:'tab_1_3', type:'TOTAL', display:'none', imageSrc:'a'}
];

//=============================== 快充手机话费面额vs支付金额 ==============================//
var fastPhoneFareArray = [
	{applyType:'MF01', choosePrice:'30', payPrice:'30.00'}, 
	{applyType:'MF01', choosePrice:'50', payPrice:'49.25'}, 
	{applyType:'MF01', choosePrice:'100', payPrice:'98.50'}, 
	{applyType:'MF01', choosePrice:'300', payPrice:'295.50'}
];

var fastRate = 0.985; //默认的快充折扣率（30元无折扣）

//=============================== 优惠充手机话费面额vs支付金额 ==============================//
var offersPhoneFareArray = [
	{applyType:'MY01', choosePrice:'30', payPrice:'30.00'}, 
	{applyType:'MY01', choosePrice:'50', payPrice:'49.00'}, 
	{applyType:'MY01', choosePrice:'100', payPrice:'98.00'}, 
	{applyType:'MY01', choosePrice:'300', payPrice:'294.00'}
];

var offersRate = 0.98; //默认的优惠充折扣率（30元无折扣）

//=============================== 慢充手机话费面额vs支付金额 ==============================//
var slowPhoneFareArray = [
	{applyType:'MS01', choosePrice:'30', payPrice:'30.00'}, 
	{applyType:'MS01', choosePrice:'50', payPrice:'49.00'}, 
	{applyType:'MS01', choosePrice:'100', payPrice:'98.00'}, 
	{applyType:'MS01', choosePrice:'300', payPrice:'294.00'}
];

var slowRate = 0.975; //默认的慢充折扣率（30元无折扣）

//=============================== 积分排行的赠送积分 ==============================//
var awardPointsArray = [2000, 1500, 1000, 700, 600, 500, 400, 300];


/**
 *	显示头部滚动主题信息
 */
var marqueeContent=new Array();   //滚动主题
var marqueeInterval=new Array();  //定义一些常用而且要经常用到的变量
var marqueeId=0;
var marqueeDelay=4000;
var marqueeHeight=15;

function initMarquee() {
	Linkinfo.getLinkInfo(function(infos){
		if(infos){
			var info;
			for(var i = 0; i < infos.length; i++) {
		    	info = infos[i];
		    	if (i==0) {
			    	marqueeContent[i]="<a href=' " + info.linkhref + " ' target='_blank'style='color: red;text-decoration: underline;'>" + info.linkTitel + "</a>";
		    	} else {
			    	marqueeContent[i]="<a href=' " + info.linkhref + " ' target='_blank'style='color: #FFFF00;text-decoration: underline;'>" + info.linkTitel + "</a>";
		    	}
			}
		}
	});
	
	var str=marqueeContent[0];
	document.write("<div id=marqueeBox style='overflow:hidden;height:"+marqueeHeight+"px;' onmouseover='clearInterval(marqueeInterval[0])' onmouseout=\"marqueeInterval[0]=setInterval('startMarquee()',marqueeDelay)\"><div>"+str+"</div></div>");
	marqueeId++;
	marqueeInterval[0]=setInterval("startMarquee()",marqueeDelay);
}

function startMarquee() {
	var str=marqueeContent[marqueeId];
	marqueeId++;
	if(marqueeId>=marqueeContent.length) marqueeId=0;
	if(marqueeBox.childNodes.length==1) {
		var nextLine=document.createElement('DIV');
		nextLine.innerHTML=str;
		marqueeBox.appendChild(nextLine);
	} else {
		marqueeBox.childNodes[0].innerHTML=str;
		marqueeBox.appendChild(marqueeBox.childNodes[0]);
		marqueeBox.scrollTop=0;
	}
	clearInterval(marqueeInterval[1]);
	marqueeInterval[1]=setInterval("scrollMarquee()",10);
}

function scrollMarquee() {
	marqueeBox.scrollTop++;
	if(marqueeBox.scrollTop%marqueeHeight==marqueeHeight){
		clearInterval(marqueeInterval[1]);
	}
}

/**
 *	订单查询按钮点击事件
 */
function queryOrder() {
	popupTips('orders01');
	
	setValue("orderId", "");
	setValue("queryOrderId", "");
	setValue("queryCardId", "");
	setValue("queryCardPassword", "");
	setValue("queryCardValue", "0 元");
	setValue("queryPayResult", "");
	setValue("querySubmitDateTime", "");
}

/**
 *	用户订单查询
 */
function queryInfos() {
	var orderId = getValue("orderId");
	var validateCode = getValue("queryValidate");
	
   	if (orderId == '' || validateCode == ''){
    	alert('订单号/序列号及验证码不能为空!');
    	return;
  	}

	OrderQuery.checkValidateCode(validateCode, function(msg) {
		if (msg) {
			alert(msg);
			setValue("queryValidate", "");
			showQuery();
			return;
		} else {
			OrderQuery.getOrderInfo(orderId, function(info) {
				if (info != null) {
					setValue("queryOrderId", info.orderId);
	    			setValue("queryCardId", info.cardId);
	    			var pwd = info.cardPassword;
	    			setValue("queryCardPassword", pwd.substring(0,4) + "**********" + pwd.substring(14) + "&nbsp;<font color=blue>[为安全起见，仅显示前后各4位数字]</font>");//"******************"
	    			setValue("queryCardValue", info.cardValue/100 + " 元");
	    			var payResult = "";
	    			if (info.payResult == '0')
	    				payResult = "未处理";
	    			else if (info.payResult == '1')
	    				payResult = "成功";
	    			else if (info.payResult == '2')
	    				payResult = "失败";
	    			setValue("queryPayResult", payResult);
	    			setValue("querySubmitDateTime", info.submitDateTime.substring(0,19));
				} else {
					alert("未找到任何订单信息！");
				}
			});	
			setValue("queryValidate", "");
			showQuery();					
		}
	});
}

/**
 *	显示头部信息
 */
function setHeader(){
	document.write("<div id='header_logo'><a href='/'><img src='/images/logo.gif' /></a></div>");
	document.write("<div id='header_right'>");//<a href='/liuyan/' target='_blank'><img src='/images/top_bt10_flash.gif' border='0' /></a>
	document.write("<div id='header_right01'><a href='/UserRegister/UserRegister.html' target='_blank'><img src='/images/top_btn03.gif' width='48' height='26' border='0' /></a> <a href='/chongbarcj/' target='_blank'><img src='/images/games_topbtn.gif' border='0' /></a><a href='/integral/' target='_blank'><img src='/images/top_btn05.gif' width='72' height='26' border='0' /></a> <img src='/images/top_bt03.gif' style='cursor: hand;' onclick='javascript:queryOrder()' border='0' /><a href='/help/FAQ.html' target='_blank'><img src='/images/top_btn02.gif' width='72' height='26' border='0' /></a><a href='javascript:addtf()'><img src='/images/top_btn01.gif' width='72' height='26' border='0' /></a></div>");
	document.write("<div id='header_right01'><font color=blue><span id='nickNameLable'></span></font>&nbsp;&nbsp;您好，欢迎来到 充吧网！&nbsp;&nbsp;<a style='display:none;' id='userExitLable' href='javascript:userExit()'><font color=blue>[退出登录]</font></a>&nbsp;&nbsp;<script type='text/javascript'>showDate()</script></div>");
	document.write("</div>");
	document.write("<div id='header_right01a'>");
	document.write("<div style='WIDTH: 670px; POSITION: relative' align=left>");
	document.write("<div id=divQiang style='LEFT: 620px; POSITION: absolute; TOP: -18px'><img src='/images/top_zan.gif' border=0 /></div>");
	document.write("<div id=divQiang style='LEFT: 150px; POSITION: absolute; TOP: -18px'><img src='/images/top_jiang.gif' border=0 /></div>");
	document.write("</div>");
	document.write("<div id='maincontent'><div id='nav'>");
	document.write("<li id='m1'><a href='/' target='_top' class='menulinks'>首　　页</a></li>");
	document.write("<li id='m2'><a href='/payqq/' target='_top' class='menulinks'>充Q币Q点</a></li>");
	document.write("<li id='m3'><a href='/qqvip/' target='_top' class='menulinks'>QQ会员服务</a></li>");
	document.write("<li id='m4'><a href='/paygame/' target='_top' class='menulinks'>游戏充值</a></li>");
	document.write("<li id='m5'><a href='/paymobile/' target='_top' class='menulinks'>手机充值</a></li>");
	//document.write("<li id='m8'><a href='/tenpay/' target='_top' class='menulinks'>财付通专区</a></li>");
	//document.write("<li id='m8'><a href='/tenpay/' target='_top' class='menulinks'>财付通专区</a></li>");
	document.write("<li id='m10'><a href='/eBank/' target='_top' class='menulinks'>网银充值专区</a></li>");
	document.write("<li id='m6'><a href='/usermanage/' target='_top' class='menulinks'>用户中心</a></li>");
	document.write("<li id='m7'><a href='/business/' target='_top' class='menulinks'>商家服务</a></li>");
	document.write("</div></div></div>");
	
	document.write("<div id='header_right02'>");
	document.write("<div id='headerChoose01'></div>");
	document.write("<div id='headerChoose02'><select id='serviceType' onchange='changeType()'></select></div>");	
	document.write("<div id='headerChoose03'><select id='typeList'></select></div>");
	document.write("<div id='headerChoose04'><select id='cardValue'></select></div>");	
	document.write("<div id='headerChoose05'><img src='/images/top_btn.gif' style='cursor: hand;' onclick='goQuickPay()' alt='开始快速充值'/></div>");
	document.write("<div id='headerChoose06'><script type='text/javascript'>setAsync(false);initMarquee();</script></div>");
	document.write("</div>");
	
	document.write("<div id='orders01' class='hidden'>");
	document.write("<div class='win_in'><div class='win_top'><h2>用户订单查询</h2><span><a href=\"javascript:closeDiv('orders01')\" class='link_black'>关闭</a> </span></div>");
	document.write("<div class='win_info win_m'><table width='100%' border='0' cellpadding='3' cellspacing='0' background='/images/qqserverBg.gif' bgcolor='#E5ECF9'>");
    document.write("<tr><td width='16%'>订单号/序列号：</td>");
    document.write("<td width='35%'><input id='orderId' type='text' maxlength='24' style='width:190px; height:20px;'/></td>");
    document.write("<td width='9%'>验证码：</td><td width='22%'><input name='queryValidate' type='text' maxlength='4' style='width:40px; height:20px;'/> <img id='queryValidateCodeImage' src='/ShowCheckImage.zt'  align='absmiddle' onclick='javascript:showQuery()' style='cursor:hand' alt='点击换一个验证码'/></div></td>");
    document.write("<td width='18%'><img src='/images/orders.gif' width='90' height='27' onclick='javascript:queryInfos()' style='cursor:hand' /></td></tr>");
  	document.write("</table><br />");
	document.write("<table width='100%' border='0' align='center' cellpadding='8' cellspacing='1' bgcolor='#D3DFF5'>");
  	document.write("<tr><td width='26%' bgcolor='#ECF1FB'><div align='right'>订单号：</div></td><td id='queryOrderId' width='74%' bgcolor='#FFFFFF'/></tr>");
  	document.write("<tr><td bgcolor='#ECF1FB'><div align='right'>充值卡序列号：</div></td><td id='queryCardId' bgcolor='#FFFFFF' /></tr>");
  	document.write("<tr><td bgcolor='#ECF1FB'><div align='right'>充值卡密码：</div></td><td id='queryCardPassword' bgcolor='#FFFFFF' /></tr>");
	document.write("<tr><td bgcolor='#ECF1FB'><div align='right'>充值卡面值：</div></td><td id='queryCardValue' bgcolor='#FFFFFF' /></tr>");
	document.write("<tr><td bgcolor='#ECF1FB'><div align='right'>交易状态：</div></td><td id='queryPayResult' bgcolor='#FFFFFF' /></tr>");
	document.write("<tr><td bgcolor='#ECF1FB'><div align='right'>交易时间：</div></td><td id='querySubmitDateTime' bgcolor='#FFFFFF' /></tr>");
	document.write("</table><br/>");
	document.write("<div id='win_img' align='center'><input type='button' value='关　闭' class='pay_button' onclick=\"closeDiv('orders01')\"/></div></div></div></div>");
	
	
	removeAllOptions("serviceType");
	addOptions("serviceType", serviceTypeArray, "id", "name");
	setValue("serviceType", getValue("serviceType"));
	
	removeAllOptions("typeList");
	addOptions("typeList", typeListArray, "id", "name");
	setValue("typeList", getValue("typeList"));
		
	removeAllOptions("cardValue");
	addOptions("cardValue", cardValueArray, "id", "name");
	setValue("cardValue", getValue("cardValue"));
}

function showDate() {
	var day="";
	var month="";
	var ampm="";
	var ampmhour="";
	var myweekday="";
	var year="";
	mydate=new Date();
	myweekday=mydate.getDay();
	mymonth=mydate.getMonth()+1;
	myday= mydate.getDate();
	myyear= mydate.getYear();
	year=(myyear > 200) ? myyear : 1900 + myyear;
	if(myweekday == 0)
	weekday=" 星期日 ";
	else if(myweekday == 1)
	weekday=" 星期一 ";
	else if(myweekday == 2)
	weekday=" 星期二 ";
	else if(myweekday == 3)
	weekday=" 星期三 ";
	else if(myweekday == 4)
	weekday=" 星期四 ";
	else if(myweekday == 5)
	weekday=" 星期五 ";
	else if(myweekday == 6)
	weekday=" 星期六 ";
	document.write(""+year+"年"+mymonth+"月"+myday+"日 "+weekday+"");
}

/**
 *	充值服务下拉框 onchange 事件
 */
function changeType() {
	var serviceType = getValue("serviceType");
	var listArray = typeListArray;
	var cardArray = cardValueArray;
	if (serviceType == '') {
		listArray = typeListArray;
	} else if (serviceType == '1') {
		listArray = typeQBListArray;
		cardArray = cardValue2Array;
	} else if (serviceType == '2') {
		listArray = typeServiceListArray;
		cardArray = cardValue2Array;
	}
	removeAllOptions("typeList");
	addOptions("typeList", listArray, "id", "name");
	setValue("typeList", getValue("typeList"));
		
	removeAllOptions("cardValue");
	addOptions("cardValue", cardArray, "id", "name");
	setValue("cardValue", getValue("cardValue"));
}

/**
 *	快速充值（首页）
 */
function goQuickPay() {
	var serviceType = getValue("serviceType");
	var typeList = getValue("typeList");
	var itemName = getText("typeList");
	var cardValue = getValue("cardValue");
	
	if (serviceType == '') {
		alert("请先选择您需要的充值服务！");
	} else {
		var qqNo = "";
		var cardValue = getValue("cardValue");
		var serviceCodes = typeList;
		//alert(cardValue + "@" + serviceCodes);
		PayQQApply.goBuyQB(qqNo, serviceCodes, itemName, cardValue, function(data) {
			if (serviceType == '1') {//Q币/Q点
				location.href = "/payqq/";
			} else if (serviceType == '2') {//QQ会员服务
				location.href = "/qqvip/";
			}
		});
	}
}
 
/**
 *	显示底部信息
 */
function setFooter(){
	document.write("<div id='footer01'><a href='/business/about.html' target='_blank'>关于我们</a>  |  <a href='/business/services.html' target='_blank'>服务条款</a>  |  <a href='/business/add.html' target='_blank'>联系我们</a>  |  <a href='/help/FAQ.html' target='_blank'>帮助中心</a>  |  <a href='/integral/' target='_blank'>积分奖励</a>  |  <a href='/liuyan/' target='_blank'>用户留言</a>  |  <a href='#', onclick=\"this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.chongbar.com/');\">设为主页</a>  |  <A href='javascript:addtf()'>加入收藏</a>");//</div>
	//document.write("<div id='footer02'><div id='footerlogo'><img src='/images/footer_logo.gif' /></div>");
	//document.write("<div id='footerfont'><b>http://www.chongbar.com</b>");
	document.write("<br/>版权所有：深圳市中腾科技有限公司<br/>");
	document.write("Copyright &copy; 2009 <a href='http://www.chongbar.com/'>chongbar.com</a> All Rights Reserved<br/><a href='http://www.miibeian.gov.cn' target='_blank'>粤ICP备08131755号</a></div>");
	/**** Vdoing Code ****/
	//document.writeln("<div style='display:none;'><script type=\"text\/javascript\" charset=\"UTF-8\" src=\"http:\/\/s.vdoing.com\/u\/99\/51040.js\"><\/script>");
	//document.writeln("<noscript><a href=\"http:\/\/www.vdoing.com\" title=\"Vdoing StatsX No.51040\"><img src=\"http:\/\/simg.vdoing.com\/m\/51040\/x01.gif?noscript\" border=\"0\"><\/a><\/noscript></div>");
	/**** End of Vdoing Code ****/
	//document.write("<div id='footerlogo02'><img src='/images/footer_logo02.gif' /></div></div>"); 
	//document.write("<div><div style='display:none;'><script src='http://s86.cnzz.com/stat.php?id=1044210&web_id=1044210' language='JavaScript' charset='gb2312'></script></div></div>");
}

/**
 *	显示二级页面的头部信息
 */
function setSecondHeader() {
	document.write("<div id='helptoplogo'><a href='/'><img src='/help/image/help_logo.gif' alt='返回首页' border='0' /></a></div>");
	document.write("<div id='helptoplogo02'><a href='/help/help.html'><img src='/help/image/help_logo02.gif' /></a></div>");
	document.write("<div id='helptopright'><a href='/userRegister/UserRegister.html' target='_blank'><img src='/images/3top_02.gif' align='absmiddle'/> 注册</a> <a href='/usermanage/' target='_blank'><img src='/images/3top_01.gif' align='absmiddle'/> 登录</a> <a href='/help/FAQ.html' target='_blank'><img src='/images/3top_03.gif' align='absmiddle'/> 帮助中心</a></div>");
	
	//document.write("<div id='helptoplogo'><a href='/'><img src='/UserRegister/image/chonbar_logo.gif' alt='返回首页'></a></div>");
	//document.write("<div id='helptoplogo02'><img src='/images/pay_01.gif'>");
	//document.write("<div id='helptopright'><a href='/UserRegister/UserRegister.html'><img src='/images/3top_02.gif' align='absmiddle'> 注册</a> <a href='/'><img src='/images/3top_01.gif' align='absmiddle'> 登录</a> <a href='/help/FAQ.html'><img src='/images/3top_03.gif' align='absmiddle'> 帮助中心</a> </div>");
}

/**
 *	显示三级页面的头部信息
 */
function setThirdHeader(imageUrl) {
	document.write("<div class=regsiterlogo><a href='/'><img src='/UserRegister/image/chonbar_logo.gif' alt='返回首页'></a></div>");
	document.write("<div id='regsiterlogoleft'><img src='"+imageUrl+"'><br/><a href='/help/help.html' target='_blank'><img src='/UserRegister/image/news.gif' border='0'></a></div>");
  	document.write("<div id='regsiterlogoright'><a href='/UserRegister/UserRegister.html' target='_blank'><img src='/images/3top_02.gif' align='absmiddle' /> 注册</a> <a href='/' target='_blank'><img src='/images/3top_01.gif' align='absmiddle'> 登录</a> <a href='/help/FAQ.html' target='_blank'><img src='/images/3top_03.gif' align='absmiddle'> 帮助中心</a> </div>");
}

/**
 *	显示二级页面的底部信息
 */
function setSecondFooter() {
	document.write("<br/><a href='/business/about.html' target='_blank'>关于我们</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href='/business/services.html' target='_blank'>服务条款</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href='/business/add.html' target='_blank'>联系我们</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href='/help/FAQ.html' target='_blank'>帮助中心</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href='/integral/' target='_blank'>积分奖励</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href='/liuyan/' target='_blank'>用户留言</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href='#', onclick=\"this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.chongbar.com/');\">设为主页</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href='javascript:addtf()'>加入收藏</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href='/'>返回首页</a>");
	document.write("<br/>版权所有：深圳市中腾科技有限公司<br/>");
	document.write("Copyright &copy; 2009 <a href='http://www.chongbar.com/'>chongbar.com</a> All Rights Reserved<br/>粤ICP备08131755号");
	/**** Vdoing Code ****/
	//document.writeln("<div style='display:none;'><script type=\"text\/javascript\" charset=\"UTF-8\" src=\"http:\/\/s.vdoing.com\/u\/99\/51040.js\"><\/script>");
	//document.writeln("<noscript><a href=\"http:\/\/www.vdoing.com\" title=\"Vdoing StatsX No.51040\"><img src=\"http:\/\/simg.vdoing.com\/m\/51040\/x01.gif?noscript\" border=\"0\"><\/a><\/noscript></div>");
	/**** End of Vdoing Code ****/
	//document.write("<div style='display:none'><script src='http://s86.cnzz.com/stat.php?id=1044210&web_id=1044210' language='JavaScript' charset='gb2312'></script></div>");
}


//得到服务列表信息	
function showServiceInfo() {
	for(var i=0; i<serviceArray.length; i++) {
	    document.write("<div id='homebottomleft03'>");
	    document.write("<div id='homebottomright03a'><img src='"+serviceArray[i].ServiceImage+"' /></div>");
		document.write("<div id='homebottomright03b'><a href='/integral/show.html#" + serviceArray[i].CodeId + "' target='_blank' onmouseover=\"tooltip2.show('点击查看 "+serviceArray[i].ServiceName+" 介绍');\" onmouseout='tooltip2.hide();'>"+serviceArray[i].ServiceName + "</a></div>");
		document.write("<div id='homebottomright03e'><span style='color:#FFOOOO'>" + serviceArray[i].PayPrice+"</span>元/月</div>");
		document.write("<div id='homebottomright03c'><a href=\"javascript:goPayService('"+serviceArray[i].ServiceCode+"','"+serviceArray[i].ServiceName+"')\"><u>立即开通</u></a></div>");
		document.write("</div>");
	}
}


/**
 *	立即开通
 */
function goPayService(serviceCodes, itemName) {
	var qqNo = "";
	var cardValue = '50';

	PayQQApply.goBuyQB(qqNo, serviceCodes, itemName, cardValue, function(data) {
		location.href = "/qqvip/";
	});
}

//得到积分排行信息
function showPointInfo() {
	document.write("<div id='homebottomleft03'><table border='0' cellspacing='0' cellpadding='0' width='100%' height='26'><tr>");
    //document.write("<td id=1_1 onmouseover=showtab(1,1,3) style='CURSOR: pointer;border-left:1px #ffffff solid;padding-top:4px;' background=/images/point01.gif align='center'><b>周排行榜</b></td>");
    document.write("<td id=1_2 style='CURSOR: pointer;border-left:1px #ffffff solid;padding-top:4px;' background=/images/point02.gif align='center' onmouseover=\"tooltip2.show('点击查看排行榜奖励积分说明');\" onmouseout='tooltip2.hide();'><a href='/integral/integral02.html' target='_blank'><b><font color=red>"+year+"</font>年<font color=red>"+month+"</font>月排行榜</b></a></td>");//onmouseover=showtab(1,2,3) 
    //document.write("<td id=1_3 onmouseover=showtab(1,3,3) style='CURSOR: pointer;border-left:1px #ffffff solid;padding-top:4px;' background=/images/point02.gif align='center'><b>总排行榜</b></td>");
    document.write("</tr></table></div>");    

    for (var m=0; m<PointArray.length; m++) {    	
    	if (m == 1) {
		    document.write("<div class='homebottomleft02r' id='"+PointArray[m].id+"' style='display:'>");//"+PointArray[m].display+"
		    setAsync(false);
			Applyorderview.getPointInfos(PointArray[m].type, function(infos) {
				if (infos) {
					var len = 8, lens = 0;
					if (infos.length < len) {
						len = infos.length;
						lens = 8 - infos.length;
					}
					for (var i=0; i<len; i++) {
						document.write("<div id='homebottomleft03'>");
						document.write("<div id='homebottomleft03a'><img src='/images/"+PointArray[m].imageSrc+"0"+(i+1)+".gif'/></div>");
						
						UserService.getUserInfoByNickName(infos[i].nickName, function(data) {
							if (data != null) {
								Codelist.getCodeName(data.vipType, function(vipType) {
									document.write("<div id='homebottomleft03b'><span class='hotspot' style='CURSOR:hand;color:#0776A6;' onmouseover=\"tooltip2.show('<b>"+vipType+"</b><br/>本月底排在本位置的用户将获"+awardPointsArray[i]+"积分奖励');\" onmouseout='tooltip2.hide();'><b>" + data.userId + "</b></span></div>");
								});
							} else {
								document.write("<div id='homebottomleft03b'><span class='hotspot' style='CURSOR:hand;color:#0776A6;' onmouseover=\"tooltip2.show('<b>普通会员</b><br/>本月底排在本位置的用户将获"+awardPointsArray[i]+"积分奖励');\" onmouseout='tooltip2.hide();'><b>" + infos[i].nickName + "</b></span></div>");
							}
						});
						document.write("<div id='homebottomleft03c' align='right'>");
						document.write("<span style='color:#CC0000;font-weight: bold;font-size: 14px;'>"+ infos[i].sumFinanceValue+"</span> 分");
						document.write("</div>");
						document.write("</div>");
					}
					if (lens > 0)
					for (var i=0; i<lens; i++) {
						document.write("<div id='homebottomleft03'>");
						document.write("<div id='homebottomleft03a'><img src='/images/"+PointArray[m].imageSrc+"0"+(len + i + 1)+".gif'/></div>");
						document.write("<div id='homebottomleft03b'></div>");
						document.write("<div id='homebottomleft03c'></div>");
						document.write("</div>");
					}
				}
			});     
			document.write("</div>");
		}
	}
}

/**
 *	显示新闻公告
 */
function showNotifyInfo(){
	setAsync(false);
	Notifyinfo.getInfos(4, 1, null, function(infos) {
		if(infos){
		    var subTitle, info;
			for(var i=0; i<infos.length; i++){
			   info = infos[i];
			   if(info.newTitle.length > 12){
			        subnewTitle = info.newTitle.substring(0,12); 
			    }else{
			        subnewTitle = info.newTitle;
			     }
				document.write("<div id='right05' style='cursor:hand' onclick='showInfo("+infos[i].recordId+")'>");
				if (i == 0) {
					document.write("<font color=red>【"+infos[i].newType+"】"+subnewTitle+" </font>");
				} else {
					document.write("【"+infos[i].newType+"】"+subnewTitle+" ");
				}
				if(infos[i].newTag == "hot"){
					document.write("&nbsp;<img src='/images/hot.gif'/>");
				}else if(infos[i].newTag == "new"){
					document.write("&nbsp;<img src='/images/new.gif'/>");
				}
				document.write("</div>");
			}
		}
	});
}

function showInfo(recordid){
	Notifyinfo.saveRecordId(recordid, function(data) {
		window.open("/news/", "_blank");	
		//location.href = "/news/";	
	});
}

/**
 *	显示登录区域（包括登录成功和未成功）
 */
function setLoginArea() {
	document.write("<div id='loginleft'>");
	//=========================登录前=============================//
	document.write("<div id='loginleftr' style='DISPLAY: none;'><div id='loginleft01'><img src='/images/login_left01.gif' /></div>");
	document.write("<div id='loginleft02'><div id='loginleft02a'>用户名：</div><div id='loginleft02b'><input id='nickName' type='text' class='input01' maxlength='20' onkeypress='onReturn(userLogon)'/></div></div>");
	document.write("<div id='loginleft02'><div id='loginleft02a'>密　码：</div><div id='loginleft02b'><input id='loginPwd' type='password' class='input01' maxlength='20' onkeypress='onReturn(userLogon)'/></div></div>");
	document.write("<div id='loginleft02'><div id='loginleft02a'>验证码：</div><div id='loginleft02b'><input id='validateCode' type='text' class='input02' maxlength='4' onkeypress='onReturn(userLogon)'/> <img id='validateCodeImage' src='/ShowCheckImage.zt'  align='absmiddle' onclick='javascript:show()' style='cursor:hand' alt='点击换一个验证码'/></div></div>");
	document.write("<div id='loginleft03'><img src='/images/login_btn01.gif' border='0' style='cursor:hand;' onclick='userLogon()'/> <a href='/UserRegister/findpassword.html' target='_blank'><img src='/images/login_btn04.gif' border='0' align='absmiddle' name='找回密码'/></a></div>");
	document.write("<div id='loginleft03'><a href='/help/help.html' target='_blank'><img src='/images/login_btn03.gif' border='0' align='absmiddle' name='新手导航'/></a> <a href='/UserRegister/UserRegister.html' target='_blank'><img src='/images/login_btn02.gif' border='0' /></a></div></div>");
	//=========================登录后============================//
	document.write("<div id='loginedleftr' style='DISPLAY: none;'><div id='loginleft01login'>&nbsp;&nbsp;&nbsp;<img id='vipTypeImage' src='/integral/images/ka01.gif' align='absmiddle' />　<b><span id='vipType'></span></b> </div>");
	document.write("<div id='loginleft02'><span id='nickNameLogon' style='color:#FF0000; font-weight:bold;'></span>，欢迎您！&nbsp;<a href='/integral/integral02.html' target='_blank' title='点击查看积分奖励介绍'><U>积分奖励</U></a></div>");
	document.write("<div id='loginleft02'><div id='loginleft02a' style='width:85px;'>累计积分：</div><div id='loginleft02b' style='width:135px;'><span style='font-size:15px; font-weight:bold; color:#FF0000' id='awardPoints'>50</span>&nbsp;分</div></div>");
	document.write("<div id='loginleft02'><div id='loginleft02a' style='width:85px;'>可用积分：</div><div id='loginleft02b' style='width:135px;'><span style='font-size:15px; font-weight:bold; color:#FF6600' id='consumePoints'></span>&nbsp;分	<a href='/chongbarcj/' target='_blank' style='font-weight:bold;'><U>试试手气</U></a></div></div>");
	document.write("<div id='loginleft03'><a href='/huodong/invite/' target='_blank'><img src='/images/01.gif' style='cursor:hand;' /></a> <a href='/integral/' target='_blank'><img src='/images/login_on03.gif' style='cursor:hand;' /></a></div>");
	document.write("<div id='loginleft03'><img src='/images/login_on01.gif' style='cursor:hand;' onClick='javascript:jumpto();'/> <img src='/images/login_on04.gif' style='cursor:hand;' onClick='javascript:userExit();'/></div></div>");
	
	document.write("</div>");
}

/**
 *	显示活动信息【首面】
 */
function setIndexCampaign() {
	document.write("<div id='paty01'><div id='patymore'><a href='/huodong/' target='_blank'><img src='/images/all.gif' width='36' height='13' border='0' /></a></div></div>");
	document.write("<div id='paty02'>");
	setCampaign1st();
	
	document.write("<div id='paty02'>");
	setCampaign2nd();
	
	document.write("<div id='paty02'>");
	setCampaign3rd();
	
	document.write("<div id='paty08'></div>");
	document.write("<div id='paty09'></div>");
}

/**
 *	显示活动信息【二级界面】
 */
function setCampaign() {	
	document.write("<div id='pages658_paty02'>");
	setCampaign1st();
	
	document.write("<div id='pages658_paty02'>");
	setCampaign2nd();
	
	document.write("<div id='pages658_paty02'>");
	setCampaign3rd();
}

/**
 *	第1个主题活动
 */
function setCampaign1st() {
	document.write("<div id='paty03'><a href='/compositor/201008/' target='_blank'><img src='/compositor/201008/ad.jpg' style='width:159px; height:81px;' border='0' /></a></div>");
	document.write("<div id='paty04'><div id='paty05'>2010年8月分充值排行榜</div>");
	document.write("<div id='paty06'><span style='width:410px;'>每月充值获得积分，积分兑换奖品，我们给每月充值排行前八位的用户准备了丰厚的大礼，赶快来参与吧</span>！</div>");
	document.write("<div id='paty07'><a href='/compositor/201008/' target='_blank'><img src='/images/paty_bnt01.gif' border='0' /></a></div>");
	document.write("</div></div>");
}

/**
 *	第2个主题活动
 */
function setCampaign2nd() {
	document.write("<div id='paty03'><a href='/huodong/invite/' target='_blank'><img src='/huodong/images/paty_temp05.gif' style='width:159px; height:81px;' border='0' /></a></div>");
	document.write("<div id='paty04'><div id='paty05'>与好友分享，邀请好友送Q币</div>");//至2009年4月5日
	document.write("<div id='paty06'>即日起，充吧网注册用户可以通过邀请好友注册充值获得奖励积分，邀请好友越多得到积分越多，赶快行动吧。</div>");
	document.write("<div id='paty07'><a href='/huodong/invite/' target='_blank'><img src='/images/paty_bnt01.gif' border='0' /></a></div>");
	document.write("</div></div>");
}

/**
 *	第3个主题活动
 */
function setCampaign3rd() {
	document.write("<div id='paty03'><a href='/huodong/0903/' target='_blank'><img src='/huodong/images/paty_temp06.gif' style='width:159px; height:81px;' border='0' /></a></div>");
	document.write("<div id='paty04'><div id='paty05'>开通QQ服务，就送2/4个Q币</div>");//至2009年4月5日
	document.write("<div id='paty06'>即日起，凡登录充吧网后用神州行支付开通QQ服务5个月或10个月，就奖励200或400积分。</div>");
	document.write("<div id='paty07'><a href='/huodong/0903/' target='_blank'><img src='/images/paty_bnt01.gif' border='0' /></a></div>");
	document.write("</div></div>");
}

/**
 *	显示客服信息
 */
function setServices() {
	document.write("<div id='homebottomright05'>客服热线：<span style='color:#5FB3E0;font-weight: bold;font-size: 16px;'>0755-82171085</span></div>");
	//document.write("<div id='homebottomright05'><a href='tencent://message/?uin=1013421744&amp;Site=www.tenpay.com&amp;Menu=yes'><img src='/images/qq_online.jpg' alt='中腾客服1，点击这里给我发消息' border='0'/></a></div>");//<img src='http://wpa.qq.com/pa?p=1:1013421744:5' alt='中腾客服1，点击这里给我发消息' border='0'/>
	//document.write("<div id='homebottomright05'><a href='tencent://message/?uin=1010141833&amp;Site=www.tenpay.com&amp;Menu=yes'><img src='/images/qq_online.jpg' alt='中腾客服2，点击这里给我发消息' border='0'/></a></div>");//<img src='http://wpa.qq.com/pa?p=1:1010141833:5' alt='中腾客服2，点击这里给我发消息' border='0'/>
	document.write("<div id='homebottomright05'><a href='tencent://message/?uin=706287096&amp;Site=www.tenpay.com&amp;Menu=yes'><img src='/images/qq_online.jpg' alt='中腾客服，点击这里给我发消息' border='0'/></a></div>");//<img src='http://wpa.qq.com/pa?p=1:906129687:5' alt='中腾客服3，点击这里给我发消息' border='0'/>
	document.write("<BR/>");//<img src='http://wpa.qq.com/pa?p=1:906129687:5' alt='中腾客服3，点击这里给我发消息' border='0'/>
	//document.write("<div id='homebottomright05'>客服&nbsp;QQ：<a href='tencent://message/?uin=1013421744&amp;Site=www.tenpay.com&amp;Menu=yes' title='点此QQ联系中腾客服1'>1013421744</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>");//<img src='http://wpa.qq.com/pa?p=1:1013421744:5' alt='中腾客服1，点击这里给我发消息' border='0'/>
	//document.write("<div id='homebottomright05'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='tencent://message/?uin=1010141833&amp;Site=www.tenpay.com&amp;Menu=yes' title='点此QQ联系中腾客服2'>1010141833</a></div>");//<img src='http://wpa.qq.com/pa?p=1:1010141833:5' alt='中腾客服2，点击这里给我发消息' border='0'/>
	//document.write("<div id='homebottomright05'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='tencent://message/?uin=906129687&amp;Site=www.tenpay.com&amp;Menu=yes' title='点此QQ联系中腾客服3'>906129687</a></div>");//<img src='http://wpa.qq.com/pa?p=1:906129687:5' alt='中腾客服3，点击这里给我发消息' border='0'/>
	document.write("<div id='homebottomright05'>每周7天8:30-22:00</div>");
}

/**
 *	显示商家服务模块联系链接信息
 */
function setBusinessLink() {
	document.write("<div id='busleftrightContent03btn'><a href='/business/bus_online.html'><img src='/business/images/yiyue_btn.gif' border='0' /></a></div><div id='busleftrightContent03font'>感谢你对的关注，我们在收到你的信息后，会在第一时间核实，并跟你联系。</div>");
}

/**
 *	页面onload事件
 */
function init() {	
	UserService.getUserInfo(function(info) {
		if (info != null) {
			$("loginleftr").style.display = "none";
			$("loginedleftr").style.display = "";
			
			$("userExitLable").style.display = '';
			setValue("nickNameLable", info.userId);
			setValue("nickNameLogon", info.userId);
			//setValue("buyTimes", info.buyTimes);//
			setValue("awardPoints", info.awardPoints);//
			setValue("consumePoints", info.consumePoints);//
			
			var vipTypeId = info.vipType;
			if (vipTypeId == '') {
				vipTypeId = '1';
			}
			$('vipTypeImage').src='/integral/images/ka0'+vipTypeId+'.gif';
	
			Codelist.getCodeName(vipTypeId, function(data) {
				setValue("vipType", data);
			});
		} else {
			$("userExitLable").style.display = 'none';
			setValue("nickNameLable", "");
			
			$("loginleftr").style.display = "";
			$("loginedleftr").style.display = "none";			
		}
	});	
	
	getUserLevelInfo();
}

function init2() {	
	UserService.getUserInfo(function(info) {
		if (info != null) {
			$("userExitLable").style.display = '';
			setValue("nickNameLable", info.userId);
		} else {
			$("userExitLable").style.display = 'none';
			setValue("nickNameLable", "");
		}
	});			
	
	getUserLevelInfo();
}

function getUserLevelInfo() {
	UserService.getUserLevelInfo(function(infos) {
		if (infos) {
			var info;
			for(var i=0; i<infos.length; i++) {
				info = infos[i];
				if (info.businessType == 'MF01') {//快充
					fastRate = info.levelRate;
				} else if (info.businessType == 'MY01') {//优惠充
					offersRate = info.levelRate;
				} else if (info.businessType == 'MS01') {//慢充
					slowRate = info.levelRate;
				}
			}
		}
		
		var choosePrice = getRadioChoose(document.getElementsByName("priceS"));
		if(choosePrice != '') {
			if (choosePrice != '30') {
				setValue("payPriceFast", getPayPrice(choosePrice * fastRate));
				setValue("payPriceOffers", getPayPrice(choosePrice * offersRate));
				setValue("payPriceSlow", getPayPrice(choosePrice * slowRate));
			} else if (choosePrice == '30') {
				setValue("payPriceFast", getPayPrice(choosePrice));
				setValue("payPriceOffers", getPayPrice(choosePrice));
				setValue("payPriceSlow", getPayPrice(choosePrice));
			}
		
			var applyTypeInput = getValue("applyTypeInput");
			if (applyTypeInput != '') {
				var phoneRate;
				
				if (applyTypeInput == 'MF01') {
					phoneRate = fastRate;
				} else if (applyTypeInput == 'MY01') {
					phoneRate = offersRate;
				} else if (applyTypeInput == 'MS01') {
					phoneRate = slowRate;
				}
				
				if (choosePrice != '30') {
					setValue("payPriceInput", getPayPrice(choosePrice * phoneRate));
				} else if (choosePrice == '30') {
					setValue("payPriceInput", getPayPrice(choosePrice));
				} 
			}
		}
	});		
}

function checkPricesCheckBox() {	
	//window.location.reload;	
	//if(typeof document.getElementsByName("priceS") != "undefined")
	//	document.getElementsByName("priceS")[2].click();
	//var priceS = eval(document.getElementsByName("priceS"));
	//if (priceS != null) {
	//	alert('存在');
	//} else {
	//	alert('不存在');
	//}
}

/**
 *	更换验证码图片
 */
function show() {
	$("validateCodeImage").src = "/ShowCheckImage.zt?" + new Date().getTime();
	setValue("validateCode", "");
}

/**
 *	更换订单查询的验证码图片
 */
function showQuery() {
	$("queryValidateCodeImage").src = "/ShowCheckImage.zt?" + new Date().getTime();
	setValue("queryValidate", "");
}

function userLogon() {
	var nickName = getValue("nickName");
	var loginPwd = getValue("loginPwd");
	var validateCode = getValue("validateCode");
	if(nickName == '' || loginPwd == ''){
	   alert("请输入用户名或密码！");
	   return false;
	}
	
	UserValidate.checkValidateCode(validateCode, function(msg) {
		if (msg) {
			alert(msg);
			$("loginleftr").style.display = "";
			$("loginedleftr").style.display = "none";
			$("nickName").value = nickName;
			$("loginPwd").value = loginPwd;
			show();
			return false;			
		} else {
			UserService.userLogin2(nickName, loginPwd, function(info) {
				if (info) {
					$("loginleftr").style.display = "none";
					$("loginedleftr").style.display = "";
					
					$("userExitLable").style.display = '';
					setValue("nickNameLable", info.userId);
					setValue("nickNameLogon", info.userId);
					//setValue("buyTimes", info.buyTimes);//
					setValue("awardPoints", info.awardPoints);//
					setValue("consumePoints", info.consumePoints);//
					
					var vipTypeId = info.vipType;
					if (vipTypeId == '') {
						vipTypeId = '1';
					}
					$('vipTypeImage').src='/integral/images/ka0'+vipTypeId+'.gif';
			
					Codelist.getCodeName(vipTypeId, function(data) {
						setValue("vipType", data);
					});
			
					getUserLevelInfo();
				} else {
					alert("对不起，登录失败，您输入的用户名或密码错误！");
					$("loginleftr").style.display = "";
					$("loginedleftr").style.display = "none";
					clearInfo();
					return false;			
				}
			});
		}
	});	
}

/**
 *	进入用户中心
 */
function jumpto() {
	location.href = "/usermanage/";
}

/**
 *	用户退出
 */
function userExit() {
	if (confirm("您确认要退出吗？")) {
		UserService.userExit(function(data) {
			$("loginleftr").style.display = "";
			$("loginedleftr").style.display = "none";
			$("userExitLable").style.display = 'none';
			setValue("nickNameLable", "");
			setValue("nickName", "");
			setValue("loginPwd", "");
			show();
			
			fastRate = 0.985;//快充
			offersRate = 0.98;//优惠充
			slowRate = 0.975;//慢充
			
			var choosePrice = getRadioChoose(document.getElementsByName("priceS"));
			if(choosePrice != '') {
				if (choosePrice != '30') {
					setValue("payPriceFast", getPayPrice(choosePrice * fastRate));
					setValue("payPriceOffers", getPayPrice(choosePrice * offersRate));
					setValue("payPriceSlow", getPayPrice(choosePrice * slowRate));
				} else if (choosePrice == '30') {
					setValue("payPriceFast", getPayPrice(choosePrice));
					setValue("payPriceOffers", getPayPrice(choosePrice));
					setValue("payPriceSlow", getPayPrice(choosePrice));
				}
			
				var applyTypeInput = getValue("applyTypeInput");
				if (applyTypeInput != '') {
					var phoneRate;
					
					if (applyTypeInput == 'MF01') {
						phoneRate = fastRate;
					} else if (applyTypeInput == 'MY01') {
						phoneRate = offersRate;
					} else if (applyTypeInput == 'MS01') {
						phoneRate = slowRate;
					}
					
					if (choosePrice != '30') {
						setValue("payPriceInput", getPayPrice(choosePrice * phoneRate));
					} else if (choosePrice == '30') {
						setValue("payPriceInput", getPayPrice(choosePrice));
					} 
				}
			}
		});
	}
}

function getPayPrice(price) {
	var payPrice;
	var price = "" + price;
	//alert(price);
	if (price.indexOf(".") == -1) {
		payPrice = price + ".00";
	} else if (price.indexOf(".") > -1 && price.substring(price.indexOf(".")+1).length == 1) {
		payPrice = price + "0";
	} else {
		payPrice = price;
	}
	//alert(payPrice);
	return payPrice;
}

/**
 *	重置
 */
function clearInfo(){
	setValue("nickName", "");
	setValue("loginPwd", "");
	setValue("validateCode", "");
}


function custSearch() { 
	openWindow("用户订单查询", "/payPlat/custservice/searchResult.jsp", 810, 280);
	return true;
} 

function addtf() {
	//定义存放地址的变量
	var address = "http://www.chongbar.com";
	//定义存放名称的变量
	var addname = "充吧神州行支付";
	//调用相应的函数,实现添加到收藏夹的功能
	window.external.addFavorite(address,addname);
	return;
}

//=============================== 以下为充吧弹出DIV需要用到的js方法 ==============================//
function $id(){
	var elements = new Array();
	for (var i = 0; i < arguments.length; i++){
		var element = arguments[i];
		if (typeof element == 'string')
			element = document.getElementById(element);
		if (arguments.length == 1)
			return element;
		elements.push(element);
	 } 
	return elements;
}

function popupTips(obj){	
	if(isIe){
		setSelectState('hidden');
	}
	
	var popupDiv = $id(obj);
	popupDiv.className = "popupdiv";
	popupDiv.style.marginLeft = "-" + popupDiv.clientWidth/2 + "px";
	popupBg = document.createElement("div");
	popupBg.setAttribute("id","popupbg");
	pHeight = popupDiv.clientHeight;
	bHeight = document.body.clientHeight;
	if(pHeight>bHeight){
		popupBg.style.height = pHeight+300+"px";
	 	popupDiv.style.marginTop = "-250px";
	}else{
	 	popupBg.style.height = bHeight+"px";
	 	popupDiv.style.marginTop  = "-" + popupDiv.clientHeight/2 + "px";
	}
	document.body.appendChild(popupBg);
	hiddenSelect();	 
}

function closeDiv(obj){
	popupBg.className = "hidden";
	$id(obj).className = "hidden";
	showSelect();
	
	if(isIe){
		setSelectState('');
	}
}

function hiddenSelect(){
	if($id("leftcnt")){
		var items = $id("leftcnt").getElementsByTagName("select");
		for(var i=0;i<items.length;i++){
			items[i].style.visibility="hidden";
		}
	}
}

function showSelect(){
	if($id("leftcnt")){
		var items = $id("leftcnt").getElementsByTagName("select");
		for(var i=0;i<items.length;i++){
			items[i].style.visibility="visible";
		}
	}
}

var isIe=(document.all)?true:false;
//设置select的可见状态
function setSelectState(state) {
	var objl=document.getElementsByTagName('select');
	for(var i=0;i<objl.length;i++) {
		objl[i].style.visibility=state;
	}
}
