<?php
	header("Content-type:text/html;charset=utf-8");
	include("../include/conn_1.php");
	include("../include/function.php");
	include("../include/public.php");

	session_start();
	$username = $_SESSION["glo_username"];

	//购买项目
	if($action == "nowToMoney"){

		$amountPay = trim($_POST['amountPay']);
		$idPay 	   = intval($_POST['idPay']);
		$pwdPay    = trim($_POST['pwdPay']);
		
		if(!$amountPay || !$idPay || !$pwdPay ){
			echo json_encode(array('status'=>0,'msg'=>"数据存在异常，请刷新尝试"));
			die();
		}

		//判断项目是否存在
		$sqlsc = "select * from  {$db_prefix}project where id = '".$idPay."'";
		$rssc = $db->get_one($sqlsc);
		if(!$rssc){
			echo json_encode(array('status'=>0,'msg'=>"项目不存在，请刷新尝试"));
			die();
		}

		$hkfs      = trim($rssc['hkfs']);	//还款方式
		$zhouqi    = trim($rssc['shijian']);//周期
		$isft      = trim($rssc['isft']);	//判断是否复投
		$tqsyyj    = trim($rssc['tqsyyj']);	//提取收益佣金

		//判断投资是否投过
		if($isft == 0){
			$sqlbp = "select * from  {$db_prefix}project_buy where projectId = '".$idPay."' and username = '".$username."'";
			$rsbp = $db->get_one($sqlbp);
			if($rsbp){
				echo json_encode(array('status'=>0,'msg'=>"抱歉，当前项目只允许投一次。"));
				die();
			}
		}

		//判断项目是否停止
		if($rssc['tzzt'] == 1){
			echo json_encode(array('status'=>0,'msg'=>"该项目已经停止投资"));
			die();
		}

		if(is_int($amountPay)){
			echo json_encode(array('status'=>0,'msg'=>"金额必须整数倍"));
			die();
		 }
		 
		//判断起投数量
		if($rssc['qtje'] > $amountPay){
			echo json_encode(array('status'=>0,'msg'=>"你输入的小于起投金额"));
			die();
		}

		//判断最高投
		if((int)$rssc['zgje'] !== 0){
			if($amountPay > $rssc['zgje']){
				echo json_encode(array('status'=>0,'msg'=>"该项目最高可投金额为".$rssc['zgje']));
				die();
			}  
		}

		//判断密码是否正确
		$sql2pwd = "select pwd,amount,paypwd from  {$db_prefix}member where username = '".$username."'";
		$rs2pwd = $db->get_one($sql2pwd);
		if($rs2pwd['paypwd'] !== mymd5($pwdPay)){
			echo json_encode(array('status'=>0,'msg'=>"您输入的交易密码错误"));
			die();
		}

		if(floatval($rs2pwd['amount']) < floatval($amountPay)){
			echo json_encode(array('status'=>0,'msg'=>"您的金额不足，请进行充值"));
			die();
		}

		//判断下一次领取时间
		if($hkfs == 0){
			if($rssc['qxdw'] == '个交易日'){
		    	$zq = weekname(date('w',time()));
		    	switch ($zq) {
		    		case '星期一':
						$useritem_time2 = DateAdd("d",1, date('Y-m-d H:i:s',time()));
						break;
					case '星期二':
						$useritem_time2 = DateAdd("d",1, date('Y-m-d H:i:s',time()));
						break;
					case '星期三':
						$useritem_time2 = DateAdd("d",1, date('Y-m-d H:i:s',time()));
						break;
					case '星期四':
						$useritem_time2 = DateAdd("d",1, date('Y-m-d H:i:s',time()));
						break;
					case '星期五':
						$useritem_time2 = DateAdd("d",3, date('Y-m-d H:i:s',time()));
						break;
					case '星期六':
						$useritem_time2 = DateAdd("d",2, date('Y-m-d H:i:s',time()));
						break;
		    		case '星期日':
						$useritem_time2 = DateAdd("d",1, date('Y-m-d H:i:s',time()));
						break;
		    		default:break;
		    	}
			}else{
				$useritem_time2 = DateAdd("d",1, date('Y-m-d H:i:s',time()));
			}
		}else{
			if($rssc['qxdw'] == '个交易日'){
				$z = 0 ;
				for($ii =0 ;$ii<$zhouqi;$ii++){
					$xhrq = DateAdd("d",$ii, date('Y-m-d',time()));
					$abc  = weekname(date('w',$xhrq));
					if($abc == "星期六"){
						$z=$z+1;
					}else if($abc == "星期日"){
						$z=$z+1;
					}else{
						$zhouqi=$zhouqi+$z;
						$useritem_time2 = DateAdd("d",$zhouqi, date('Y-m-d H:i:s',time()));
					}
				}
			}else{
				$useritem_time2 = DateAdd("d",$zhouqi, date('Y-m-d H:i:s',time()));
			}
		}
		$ip = getip();
		$notice = "加入项目(".$rssc['title'].")(-)";
		meoneyLog($username,$amountPay,$ip,$notice,'-'); //金额记录日志

		$sendDay_count = $hkfs == 1?1:$zhouqi;

		//插入项目
		$sql_pro = "insert into {$db_prefix}project_buy(`username`,`projectId`,`amount`,`ip`,`useritem_time`,`useritem_time2`,`sendDay_count`) value('{$username}','{$idPay}','{$amountPay}','".getip()."','".date('Y-m-d H:i:s',time())."','".$useritem_time2."','".$sendDay_count."')";
		$db->query($sql_pro);

		//减少金额
		$sql_lgn = "update {$db_prefix}member set amount= amount-{$amountPay} where  username='{$username}' ";
		$rs_plus =$db->query($sql_lgn);
		if(!$rs_plus){
			echo json_encode(array('status'=>0,'msg'=>"投资失败，请重新操作"));
			die();
		}else{
			//插入上家分成,百分比奖励
			if($tqsyyj !== 0){
				$shangjia = checkTjr($username);	//上家账号
				if(!empty($shangjia)){
					$rewardMoney = $tqsyyj * $amountPay * 0.01;
					 
					$sqlFc="insert into {$db_prefix}member_cashback(username,xxusername,amount,preamount,type,status,posttime) values('{$shangjia}','{$username}','{$amountPay}','{$rewardMoney}','下线分成',1,'".time()."')";
					$db->query($sqlFc);
					
					// 	//发送记录
					$compnayN = configW('webname');
					$title    = "尊敬的".$shangjia."会员您好！您的下线分成".$XiaXianAmount."元";
					$content  = "您的下线".$username."充值分成".$rewardMoney."元,已赠送到您的账号。";
					$memo     = "下线分成";
					$rs_msg   = sendMsg($shangjia,$compnayN,$title,$content,$memo);

					//增加金额
					$sql_sj = "update {$db_prefix}member set amount= amount+{$rewardMoney} where  username='{$shangjia}' ";
					$db->query($sql_sj);
				}
			}
			echo json_encode(array('status'=>1,'msg'=>"投资成功，请进入会员中心进行管理"));
			die();
		}
	}


	//提现
	if($action == "moneyDeal"){

		$amount = trim($_POST['amount']);
		$paypwd = trim($_POST['paypwd']);
		$memo   = trim($_POST['memo']);
	
		if(!$amount || !$paypwd){
			echo"<script>alert('Sorry！表单填写错误，请核对');history.go(-1);</script>";  
			die();
		}
		//判断积分是否整数
		if(is_int($amount)){
			echo"<script>alert('金额必须是整数倍');history.go(-1);</script>";  
			die();
		 }

		if($amount<0){
			echo"<script>alert('提现数量必须大于0');history.go(-1);</script>";  
			die();
		}
		$sqlsc = "select paypwd,amount from  {$db_prefix}member where username = '".$username."'";
		$rssc = $db->get_one($sqlsc);
		if($rssc['paypwd'] !== mymd5($paypwd)){
			echo"<script>alert('您的交易密码错误');history.go(-1);</script>";  
			die();
		}
		//查询金额
		if ($rssc['amount'] < floatval($amount)){
			echo"<script>alert('您没有足够的额度');history.go(-1);</script>";  
			die();
		} 

		//记录提现日志
		$sql_in_log = "insert into {$db_prefix}member_deal(`username`,`amount`,`memo`,`status`,`posttime`,`ip`) value('{$username}','{$amount}','{$memo}',0,'".time()."','".getip()."')";
		$rs_log = $db->query($sql_in_log);
		if(!$rs_log){
			echo"<script>alert('Sorry！提现错误，请重新提交');history.go(-1);</script>";  
			die();
		}

		//减金额
		$sql_lgn = "update {$db_prefix}member set amount= amount-{$amount} where  username='{$username}' ";
		$rs_plus =$db->query($sql_lgn);
		if(!$rs_plus){
			echo"<script>alert('Sorry！提现错误，请重新提交#1');history.go(-1);</script>";  
			die();
		}else{
			echo"<script>alert('提现成功，我们将尽快为你支付');location.href='/user/withdraw_list.php';</script>";  
			die();
		}
	}


	//公司汇款充值
	if($action == "payCompany"){

		$amount = trim($_POST['amount']);	//金额
		$type   = trim($_POST['Serial']);	//入款方式
		$bank   = trim($_POST['bank']);		//入款银行
		$date	= trim($_POST['date']);		//日期

		if(!$amount || !$Serial || !$amount){
			echo"<script>alert('Sorry！表单填写错误，请核对');history.go(-1);</script>";  
			die();
		}
		if(!is_numeric($amount)){
			echo"<script>alert('Sorry！金额填写错误，请核对');history.go(-1);</script>";  
			die();
		}

		//插入数据
		$sql_in_log = "insert into {$db_prefix}member_companyPay(`username`,`amount`,`type`,`bank`,`todate`,`status`,`posttime`,`ip`) value('{$username}','{$amount}','{$type}','{$bank}','{$date}',0,'".time()."','".getip()."')";
		$rs_log = $db->query($sql_in_log);
		if($rs_log){
			echo"<script>alert('提交成功，我们会尽快给予审核，请耐心等待！');history.go(-1);</script>";  
			die();
		}else{
			echo"<script>alert('Sorry！填写错误，请重新提交');history.go(-1);</script>";  
			die();
		}
	}

	//查询未读短信
	if($action =="msg_Unread"){

		$sql_lgn = "select count(id) as co from {$db_prefix}member_msg  where  status = 0 and username='{$username}' ";
		$rs_lgn=$db->get_one($sql_lgn);
		echo $rs_lgn['co'];
	}

	//后台查询充值记录
	if($action =="msg_sysUnread"){
		//查询公司充值
		$sql_lgn = "select count(id) as co from {$db_prefix}member_companyPay  where  status = 0";
		$rs_lgn=$db->get_one($sql_lgn);

		//查询提现
		$sql_deal = "select count(id) as co from {$db_prefix}member_deal  where  status = 0";
		$rs_deal=$db->get_one($sql_deal);
		echo json_encode(array('compay'=>$rs_lgn['co'],'deal'=>$rs_deal['co']));
	}

	//标示已读短信
	if($action == "msg_Read"){

		if($id){
			$sql_lgn = "update {$db_prefix}member_msg set status = 1 where  id = '{$id}' and username='{$username}' ";
			$rs_lgn=$db->query($sql_lgn);
			if($rs_lgn){
				echo 1;
			}
		}else{
			echo 0;
			die();
		}
	}

	//删除短信
	if($action == "msg_Del"){

		if($id){
			$sql_lgn = "delete from {$db_prefix}member_msg  where  id = '{$id}' and username='{$username}' ";
			$rs_lgn=$db->query($sql_lgn);
			if($rs_lgn){
				echo 1;
			}
		}else{
			echo 0;
			die();
		}
	}

	//修改交易密码
	if ($action=="resetzfpass"){

		$code = trim($_POST['code']);
		$newPwd = trim($_POST['newzfpass']);
		$conPwd = trim($_POST['renewzfpass']);
		$sessionAction = trim($_POST['sessionAction']);
		if(!$code || !$newPwd || !$conPwd || !$sessionAction){
			echo"<script>alert('Sorry！表单填写错误，请核对');history.go(-1);</script>";  
			die();
		}

		if($newPwd  !== $conPwd){
			echo"<script>alert('Sorry！新密码与确认密码不一致，请核对');history.go(-1);</script>";  
			die();
		}

		if(strlen($newPwd)<6 || strlen($newPwd)>32){
			echo"<script>alert('Sorry！密码长度不能小于6位且大于32位');history.go(-1);</script>";  
			die();
		}

		$seesionType = 'code_'.trim($sessionAction);//区分session名称

		//验证手机验证码
		if($code !== $_SESSION[$seesionType]){
			echo"<script>alert('Sorry！手机验证码错误，请核对');history.go(-1);</script>";  
			die();
		}

		//匹配，修改密码，发送，记录日志
		$passW = getRandChar();	//获取6位密码
		$pwd   = mymd5($passW);
		$sql_pwd = "update  {$db_prefix}member set paypwd = '{$pwd}'   where username='".$username."'";
		$rs_pwd=$db->query($sql_pwd);
		if($rs_pwd){
			//插入记录
			$sql_in_log = "insert into {$db_prefix}member_forgot_logs(`username`,`mobile`,`ip`,`posttime`,`type`) value('{$username}','{$mobile}','".getip()."','".time()."','paypwd')";
			$db->query($sql_in_log);
			//发送记录
			$CONTENT = mobileTemp('forgotpay',$passW);
			$isSend  = sendMobile($mobile,$CONTENT,'resetzfpass');
			if($isSend['status'] == "y"){
				die(json_encode(array('info'=>"重置成功",'status'=>"y")));
			}else{
				die(json_encode(array('info'=>$isSend['info'],'status'=>"n")));
			}
		}else{
			die(json_encode(array('info'=>"密码重置错误，请重新修改",'status'=>"n")));
		}


	}

	//修改交易密码
	if ($action=="editpaypwd"){

		$code   = trim($_POST['telcode']);
		$oldPwd = trim($_POST['zfpass']);
		$newPwd = trim($_POST['newzfpass']);
		$conPwd = trim($_POST['renewzfpass']);
		if(!$oldPwd || !$newPwd || !$conPwd){
			echo"<script>alert('Sorry！表单填写错误，请核对');history.go(-1);</script>";  
			die();
		}

		$seesionType = 'code_'.trim($sessionAction);//区分session名称

		//验证手机验证码
		if($code !== $_SESSION[$seesionType]){
			echo"<script>alert('Sorry！手机验证码错误，请核对');history.go(-1);</script>";  
			die();
		}

		if($newPwd  !== $conPwd){
			echo"<script>alert('Sorry！新密码与确认密码不一致，请核对');history.go(-1);</script>";  
			die();
		}

		if(strlen($newPwd)<6 || strlen($newPwd)>32){
			echo"<script>alert('Sorry！密码长度不能小于6位且大于32位');history.go(-1);</script>";  
			die();
		}

		//查询密码是否正确
		$md5oldPwd = mymd5($oldPwd); 
		$sql_lgn = "select paypwd from {$db_prefix}member where  paypwd = '{$md5oldPwd}' and username='{$username}' ";
		$rs_lgn=$db->get_one($sql_lgn);
		if(!$rs_lgn){
			echo"<script>alert('Sorry！您填写的旧密码错误，请核对');history.go(-1);</script>";  
			die();
		}
		$_SESSION[$seesionType] = '';
		//更改新密码
		$md5newPwd = mymd5($newPwd); 
		$sql_que = "update  {$db_prefix}member set  paypwd = '{$md5newPwd}'  where  username='".$username."'";
		$rs_que  = $db->query($sql_que);
		if($rs_que){
			echo"<script>alert('恭喜您！交易密码修改成功。');history.go(-1);</script>";  
			die();
		}else{
			echo"<script>alert('Sorry！交易密码修改失败，请重新修改。');history.go(-1);</script>";  
			die();
		}
	}

	//修改登陆密码
	if ($action=="editpass"){

		$oldPwd = trim($_POST['pass']);
		$newPwd = trim($_POST['newpass']);
		$conPwd = trim($_POST['renewpass']);
		if(!$oldPwd || !$newPwd || !$conPwd){
			echo"<script>alert('Sorry！表单填写错误，请核对');history.go(-1);</script>";  
			die();
		}

		if($newPwd  !== $conPwd){
			echo"<script>alert('Sorry！新密码与确认密码不一致，请核对');history.go(-1);</script>";  
			die();
		}

		if(strlen($newPwd)<6 || strlen($newPwd)>32){
			echo"<script>alert('Sorry！密码长度不能小于6位且大于32位');history.go(-1);</script>";  
			die();
		}

		//查询密码是否正确
		$md5oldPwd = mymd5($oldPwd); 
		$sql_lgn = "select pwd from {$db_prefix}member where  pwd = '{$md5oldPwd}' and username='{$username}' ";
		$rs_lgn=$db->get_one($sql_lgn);
		if(!$rs_lgn){
			echo"<script>alert('Sorry！您填写的旧密码错误，请核对');history.go(-1);</script>";  
			die();
		}
		//更改新密码
		$md5newPwd = mymd5($newPwd); 
		$sql_que = "update  {$db_prefix}member set  pwd = '{$md5newPwd}'  where  username='".$username."'";
		$rs_que  = $db->query($sql_que);
		if($rs_que){
			echo"<script>alert('恭喜您！密码修改成功。');history.go(-1);</script>";  
			die();
		}else{
			echo"<script>alert('Sorry！密码修改失败，请重新修改。');history.go(-1);</script>";  
			die();
		}
	}

	//修改用户资料
	if ($action=="edit"){

		$realname = trim($_POST['realname']);
		$email 	  = trim($_POST['email']);
		$address  = trim($_POST['dz']);
		$qq		  = trim($_POST['qq']);
		
		$str = "";
		if($realname){	 
			if(!preg_match('/^[\x80-\xff]{4,12}$/',$realname)){	//匹配2到四个汉字  
				echo"<script>alert('Sorry！表单填写错误，请核对');history.go(-1);</script>";  
				die();
			}
			$str .= " realname = '{$realname}' ,";
		}

		if($email){	
			if (!preg_match("/[a-zA-Z0-9]+@[a-zA-Z0-9]+\.[a-z]{2,4}/",$email)){ 
				echo"<script>alert('Sorry！表单填写错误，请核对');history.go(-1);</script>";  
				die();
 			} 
			$str .= " email = '{$email}' ,";
		}
		if($address){$str .= " address = '{$address}' ,";}
		if($qq){	
			if(preg_match('/^[1-9][0-9]{4,9}$/', $qq))
			$str .= " qq = '{$qq}' ,";
		}
		$newstr = substr($str,0,strlen($str)-1); 
		if(empty($newstr)){
			echo"<script>alert('Sorry！您填写的无任何修改');history.go(-1);</script>";  
			die();
		}

		$sql_que = "update  {$db_prefix}member set  {$newstr}  where  username='".$username."'";
		$rs_que  = $db->query($sql_que);
		if($rs_que){
			echo"<script>alert('恭喜您！资料修改成功。');history.go(-1);</script>";  
			die();
		}else{
			echo"<script>alert('Sorry！资料修改失败，请重新修改。');history.go(-1);</script>";  
			die();
		}
	}

	//手机验证发送短信
	if ($action=="tel"){

		$dianhua = trim($_POST['newtel']);
		$telcode = trim($_POST['telcode']);
		$telcode = trim($_POST['telcode']);
		$seesionType = 'code_'.trim($_POST['seesionType']);//区分session名称

		if(!$telcode){
			echo"<script>alert('Sorry！请填写手机验证码。');history.go(-1);</script>";  
			die();
		}

		if(!$dianhua){
			echo"<script>alert('Sorry！请填写新手机号码。');history.go(-1);</script>";  
			die();
		}

		if ($telcode!=$_SESSION[$seesionType]) {
			echo"<script>alert('Sorry！请填写的手机验证码错误。');history.go(-1);</script>";  
			die();
		}
		

		$UserList  =configUser();
		if($UserList['mobile']  == $dianhua){
			echo"<script>alert('Sorry！您输入的号码为当前绑定号码。');history.go(-1);</script>";  
			die();
		}

		
		//判断手机是否绑带过
		$sql_lgnc = "select * from {$db_prefix}member where  mobile = '{$dianhua}'";
		$rs_lgnc=$db->get_one($sql_lgnc);
		if($rs_lgnc){
			echo"<script>alert('Sorry！您填写的手机号码已经被绑定！');history.go(-1);</script>";  
			die();
		}
		$_SESSION[$seesionType] = '';
		$sql_que = "update  {$db_prefix}member set mobile = '{$dianhua}' where  username='".$username."'";
		$rs_que  = $db->query($sql_que);
		if($rs_que){
			echo"<script>alert('恭喜您！更换成功。');history.go(-1);</script>";  
		}else{
			echo"<script>alert('Sorry！更换失败，请重新更换。');history.go(-1);</script>";  
		}
	}
	

	//手机验证发送短信
	if ($action=="smscode"){

		$dianhua 	 = trim($_POST['dianhua']);
		$seesionType = 'code_'.trim($_POST['seesionType']);//区分session名称

		if(!$dianhua){
			echo 3;
			die();
		}

		//发送短信
		$PHONE   = trim($dianhua);
		$number  = randStr();
		$_SESSION[$seesionType] = $number;
		$CONTENT = mobileTemp('public',$number);
		$isSend  = sendMobile($PHONE,$CONTENT,$seesionType);
		if($isSend['status'] == 'y'){
			echo 0;
			die();
		}else{
			echo 2;
			die();
		}
	}	


	//设置安全问题
	if ($action=="Security"){

		$question = trim($_POST['newwenti']);
		$askwer   = trim($_POST['newdaan']);
		$username = $_SESSION["glo_username"];
		
		if(!$question || !$askwer){
			echo"<script>alert('Sorry！请填写安全问题。');history.go(-1);</script>";  
			die();
		}

		$sql_que = "update  {$db_prefix}member set question = '{$question}',answer= '{$askwer}',isquestion= 1   where  username='".$username."'";
		$rs_que  = $db->query($sql_que);
		if($rs_que){
			echo"<script>alert('恭喜您！设置成功。');history.go(-1);</script>";  
		}else{
			echo"<script>alert('sorry！设置失败，请重新设置。');history.go(-1);</script>";  
		}
	}

	//修改安全问题
	if ($action=="UpSecurity"){

		$wenti 	   = trim($_POST['wenti']);
		$danan 	   = trim($_POST['danan']);
		$newwenti  = trim($_POST['newwenti']);
		$newdaan   = trim($_POST['newdaan']);
		$username  = $_SESSION["glo_username"];
		
		if(!$danan || !$newwenti || !$newdaan){
			echo"<script>alert('Sorry！请填写安全问题。');history.go(-1);</script>";  
			die();
		}

		//查询是否正确
		$sql_lgn = "select question,answer from {$db_prefix}member where answer = '{$danan}' and question = '{$wenti}' and username='{$username}' ";
		$rs_lgn=$db->get_one($sql_lgn);
		if(!$rs_lgn){
			echo"<script>alert('Sorry！您填写的旧答案错误。');history.go(-1);</script>";  
			die();
		}

		$sql_que = "update  {$db_prefix}member set question = '{$newwenti}',answer= '{$newdaan}',isquestion= 1   where  username='".$username."'";
		$rs_que  = $db->query($sql_que);
		if($rs_que){
			echo"<script>alert('恭喜您！修改成功。');history.go(-1);</script>";  
		}else{
			echo"<script>alert('sorry！修改失败，请重新修改。');history.go(-1);</script>";  
		}
	}


	//设置绑定银行
	if ($action=="bank"){

		$code 	    = trim($_POST['code']);
		$bank_name 	= trim($_POST['bank_name']);
		$bank_xm 	= trim($_POST['bank_xm']);
		$bank_zh    = trim($_POST['bank_zh']);
		$bank_khh   = trim($_POST['bank_khh']);
		$username  = $_SESSION["glo_username"];
		
		if(!$code){
			echo"<script>alert('Sorry！请填写手机验证码。');history.go(-1);</script>";  
			die();
		}

		if ($code!=$_SESSION["code_bank"]) {
			echo"<script>alert('Sorry！请填写的手机验证码错误。');history.go(-1);</script>";  
			die();
		}
		$_SESSION["code_bank"] = "";//注销

		if(!$bank_name || !$bank_xm || !$bank_zh || !$bank_khh){
			echo"<script>alert('Sorry！请填写银行卡信息。');history.go(-1);</script>";  
			die();
		}

		$sql_bank = "update  {$db_prefix}member set isbank = 1, bankname = '{$bank_name}',bankrealname = '{$bank_xm}',bankcode = '{$bank_zh}',bankaddress = '{$bank_khh}'  where  username='".$username."'";
		$rs_bank  = $db->query($sql_bank);

		if($rs_bank){
			echo"<script>alert('恭喜您！绑定成功。');history.go(-1);</script>";  
		}else{
			echo"<script>alert('sorry！绑定失败，请重新绑定。');history.go(-1);</script>";  
		}
	}

?>