$def with (NameData,Data,AccountData,itmeAccGroup,ImgData,Mergestr,StorageLocation)
<!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>
		<meta http-equiv=Content-Type content="text/html;charset=utf-8" />
		<link rel="stylesheet" type="text/css" href="/static/style/common.css" />
		<link rel="stylesheet" type="text/css" href="/static/js/jqtransformplugin/jqtransformofPB.css" />
		<link rel="stylesheet" href="/static/style/jquery.Jcrop.css" type="text/css" />
		<script type="text/javascript" src="/static/js/jquery-1.7.1.js"></script>
		<script type="text/javascript" src="/static/js/jquery.artDialog.source.js?skin=aero"></script>
		<script type="text/javascript" src="/static/js/jqtransformplugin/jquery.jqtransform.js"></script>
		<script type="text/javascript" src="/static/js/jquery.smsdata.js"></script>
		<script type="text/javascript" src="/static/js/smschar.js"></script>
		<script type="text/javascript" src="/static/js/jquery.Jcrop.js"></script>
		<script type="text/javascript" src="/static/js/toolsForPB.js"></script>
		<!--script type="text/javascript" src="/static/js/pb.js" charset="UTF-8"></script-->
        <script type="text/javascript" src="/static/js/plantform.js"></script>
		<script type="text/javascript">

			var m_StorageLocation = $:json_encode(StorageLocation)
            
            
            
			var infoType = 	{
			'$trans('PBMainView_WEB_MobilePhone')' : ['$trans('PBMainView_WEB_MobilePhone')','$trans('PBMainView_WEB_HomePhone')', '$trans('PBMainView_WEB_WorkPhone')', '$trans('PBMainView_WEB_HomeFaxPhone')', '$trans('PBMainView_WEB_BBPhone')', '$trans('PBMainView_WEB_OtherPhone')','$trans('PBMainView_WEB_USERDEF')'],
			'$trans('PBMainView_WEB_EMail')' : ['$trans('PBMainView_WEB_WorkMail')', '$trans('PBMainView_WEB_HomeMail')', '$trans('PBMainView_WEB_OtherMail')','$trans('PBMainView_WEB_USERDEF')'],
			'$trans('PBMainView_WEB_TalkTool')': ['AIM', 'Msn', 'Yahoo', 'Skype', 'QQ', 'Gtalk', 'ICQ', 'Jabber','$trans('PBMainView_WEB_USERDEF')'],
			'$trans('PBMainView_WEB_Address')' : ['$trans('PBMainView_WEB_WorkAddress')', '$trans('PBMainView_WEB_HomeAddress')', '$trans('PBMainView_WEB_OtherAddress')','$trans('PBMainView_WEB_USERDEF')'],
			'$trans('PBMainView_WEB_Company')': ['$trans('PBMainView_WEB_Company')', '$trans('PBMainView_WEB_Other')','$trans('PBMainView_WEB_USERDEF')'],
			'$trans('PBMainView_WEB_Remarks')': ['$trans('PBMainView_WEB_Remarks')']
			}
			var infoTypeName = 	{
			'$trans('PBMainView_WEB_MobilePhone')' : ['PhoneNumber-Mobile','PhoneNumber-Home', 'PhoneNumber-Work', 'PhoneNumber-FaxHome', 'PhoneNumber-Page', 'PhoneNumber-Other','PhoneNumber'],
			'$trans('PBMainView_WEB_EMail')' : ['Email-Work', 'Email-Home', 'Email-Other','Email'],
			'$trans('PBMainView_WEB_TalkTool')' : ['IM-Aim', 'IM-Msn', 'IM-Yahoo', 'IM-Skype', 'IM-Qq', 'IM-Gtalk', 'IM-Icq', 'IM-Jabber','IM'],
			'$trans('PBMainView_WEB_Address')' : ['PostalAddress-Work', 'PostalAddress-Home', 'PostalAddress-Other','PostalAddress'],
			'$trans('PBMainView_WEB_Company')': ['Organization-Work', 'Organization-Other','Organization'],
			'$trans('PBMainView_WEB_Remarks')': ['Notes']
			}

			/*
			var infoType = 	{
			'移动电话' : ['移动电话','家庭电话', '工作电话', '家庭传真', '传呼机', '其他电话','自定义...'],
			'邮箱' : ['工作邮箱', '家庭邮箱', '其他邮箱','自定义...'],
			'聊天工具' : ['AIM', 'Msn', 'Yahoo', 'Skype', 'QQ', 'Gtalk', 'ICQ', 'Jabber','自定义...'],
			'地址' : ['工作地址', '家庭地址', '其他地址','自定义...'],
			'公司' : ['公司', '其他','自定义...'],
			'备注' : ['备注']
			}
			var infoTypeName = 	{
			'移动电话' : ['PhoneNumber-Mobile','PhoneNumber-Home', 'PhoneNumber-Work', 'PhoneNumber-FaxHome', 'PhoneNumber-Page', 'PhoneNumber-Other','PhoneNumber'],
			'邮箱' : ['Email-Work', 'Email-Home', 'Email-Other','Email'],
			'聊天工具' : ['IM-Aim', 'IM-Msn', 'IM-Yahoo', 'IM-Skype', 'IM-Qq', 'IM-Gtalk', 'IM-Icq', 'IM-Jabber','IM'],
			'地址' : ['PostalAddress-Work', 'PostalAddress-Home', 'PostalAddress-Other','PostalAddress'],
			'公司' : ['Organization-Work', 'Organization-Other','Organization'],
			'备注' : ['Notes']
			}
			*/

			var PBMainView_WEB_USERDEF = '$trans("PBMainView_WEB_USERDEF")'
			var PBMainView_WEB_USERDEF_CONTACTINFO = '$trans("PBMainView_WEB_USERDEF_CONTACTINFO")'
			var PBMainView_WEB_ADDGROUP = '$trans("PBMainView_WEB_ADDGROUP")'
			var PBMainView_WEB_USERDEF_CONTACTINFO = '$trans("PBMainView_WEB_USERDEF_CONTACTINFO")'
			var PBMainView_WEB_GROUPNAME_CANOT_EMPTY = '$trans("PBMainView_WEB_GROUPNAME_CANOT_EMPTY")'
			var PBMainView_WEB_GROUPNAME_TOOLONG = '$trans("PBMainView_WEB_GROUPNAME_TOOLONG")'
			var PBMainView_WEB_GROUPNAME_EXISTS = '$trans("PBMainView_WEB_GROUPNAME_EXISTS")'
			var PBMainView_WEB_PHONE_CANOT_EMPTY = '$trans("PBMainView_WEB_PHONE_CANOT_EMPTY")'
			var PBMainView_EditPanel_BR_StaticBox_CB_Type = '$trans("PBMainView_EditPanel_BR_StaticBox_CB_Type")'
			var PBMainView_WEB_CANCEL = '$trans('PBMainView_WEB_CANCEL')'
			var PB_BUTTON_OK = '$trans('PB_BUTTON_OK')'
			var PBMainView_OneInfoPanel_ScrollPanel_BtnGroup = '$trans('PBMainView_OneInfoPanel_ScrollPanel_BtnGroup')'
			var PBMainView_MoreInfoPanel_BtnDelete = '$trans('PBMainView_MoreInfoPanel_BtnDelete')'
			var PBMainView_WEB_ADDGROUP = '$trans('PBMainView_WEB_ADDGROUP')'
			var PBMainView_EditPanel_BR_StaticBox_CB_Type= '$trans('PBMainView_EditPanel_BR_StaticBox_CB_Type')'
			var PBMainView_WEB_SELECT = '$trans('PBMainView_WEB_SELECT')'
			var PBMainView_AddItem_Error = '$trans("PBMainView_AddItem_Error")'
			var PBMainView_FuncBtn_BR_StaticBox_TC_Name = '$trans('PBMainView_FuncBtn_BR_StaticBox_TC_Name')'
			var PBMainView_EditPanel_NickNameSBox_Key = "$trans('PBMainView_EditPanel_NickNameSBox_Key')"
			var PBMainView_WEB_SendSms2 = "$trans('PBMainView_WEB_SendSms2')"
			var WEBSMS_SEND_SMS_1_0 = "$trans('WEBSMS_SEND_SMS_1_0')"
			var WEBSMS_SEND_SMS_2_0 = "$trans('WEBSMS_SEND_SMS_2_0')"
			var WEBSMS_SEND_SMS_UNKWON_0 = "$trans('WEBSMS_SEND_SMS_UNKWON_0')"
			var WEBSMS_SEND_SMS_1_1 = "$trans('WEBSMS_SEND_SMS_1_1')"
			var WEBSMS_SEND_SMS_2_1 = "$trans('WEBSMS_SEND_SMS_2_1')"
			var WEBSMS_SEND_SMS_UNKWON_1 = "$trans('WEBSMS_SEND_SMS_UNKWON_1')"
			var WEBSMS_SEND_SMS_1_2 = "$trans('WEBSMS_SEND_SMS_1_2')"
			var WEBSMS_SEND_SMS_2_2 = "$trans('WEBSMS_SEND_SMS_2_2')"
			var WEBSMS_SEND_SMS_UNKWON_2 = "$trans('WEBSMS_SEND_SMS_UNKWON_2')"
			var WEBSMS_SEND_SMS_1_UNKWON = "$trans('WEBSMS_SEND_SMS_1_UNKWON')"
			var WEBSMS_SEND_SMS_2_UNKWON = "$trans('WEBSMS_SEND_SMS_2_UNKWON')"
			var WEBSMS_SEND_SMS_UNKWON_UNKWON = "$trans('WEBSMS_SEND_SMS_UNKWON_UNKWON')"
			var WEBSMS_SEND_SMS_0_0 = "$trans('WEBSMS_SEND_SMS_0_0')"
			var WEBSMS_SEND_SMS_0_1 = "$trans('WEBSMS_SEND_SMS_0_1')"
			var WEBSMS_SEND_SMS_0_2 = "$trans('WEBSMS_SEND_SMS_0_2')"
			var WEBSMS_SEND_SMS_0_UNKWON = "$trans('WEBSMS_SEND_SMS_0_UNKWON')"
			var SELECT_YOUR_IMG = "$trans('SELECT_YOUR_IMG')"
			var WORDS_TOO_LONG = "$trans('WORDS_TOO_LONG')"
			var WORDS_ILLEGAL = "$trans('WORDS_ILLEGAL')"
			var MAILBOX_ILLEGAL = "$trans('MAILBOX_ILLEGAL')"
            var PBMainSim_DetailInfoPhoneNumLabel = "$trans('PBMainSim_DetailInfoPhoneNumLabel')"
            var PBMainSim_DetailInfoHomeNumLabel = "$trans('PBMainSim_DetailInfoHomeNumLabel')"
            var PBMainSim_DetailInfoEmailLabel = "$trans('PBMainSim_DetailInfoEmailLabel')"
            var PBMainView_AddItem_MustFill_Error = "$trans('PBMainView_AddItem_MustFill_Error')"

			//var infoGroup = ['分组','家人','朋友','同事','其他','添加分组'];
			var infoTypeOther = ['PhoneNumber','Email','IM','PostalAddress','Organization'];
			/*
			*基础配置信息结束
			*/
			/*
			*以下是需要传入的数据,格式JSON.
			*/
			//名称和昵称数据
			var infoNameData = $:json_encode(NameData)
			//分组数据
			var infoGroupData ={

			}
			//图片数据
			var infoImage = $:json_encode(ImgData)

			//需传入的账户分组数据
			var AccountData  = $:json_encode(AccountData)
			/*
			{
			'': ['家人','朋友','同事','其他'],
			'litao@google.com': ['企业','驴友','基友'],
			'zsm@163.com': ['dota','war3','三国杀','合金弹头']
			}
			*/
			var AccountSelData = $:json_encode(itmeAccGroup)
			/*
			{
			'zsm@163.com': ['war3']
			}
			*/
			var selectedGroup = "All";
			var selectedAccount = "";
			var curGroup = '';//记录当前分组
			var groupLen = 32;//分组名称长度限制默认为10
			//详细信息数据
			var infoDataOrig = $:json_encode(Data)
			var infoData = {};
			for(var i = 0; i< infoDataOrig.length; i++){
                for(var k in infoDataOrig[i]){
                    infoData[k] =infoDataOrig[i][k];
                }
			}
			var numberData = infoDataOrig[0]
			/*
			*传入数据结束
			*/
			var paramMerge = "$Mergestr";
			var editFlag = false;//判断是否在编辑状态 true:是,false:否
			var nickName = infoNameData.nickname ? infoNameData.nickname : "昵称";
			var viewOrEdit = false;//判断是查看还是编辑 true:编辑,false:查看
			//修改处-----
			var inner = "";//记录当前编辑域的内容，为便为用户点击取消后，直接返回，不用访问服务器
			var first = true;//标识网页第一次加载
			//------------
			var IsMerge = false;
			if(paramMerge == "Merge")
			{
			viewOrEdit = true;
			IsMerge = true;
			}
            
            if (m_StorageLocation == "0"){
            
                var oHead = document.getElementsByTagName('HEAD').item(0);
                var oScript= document.createElement("script");
                oScript.type = "text/javascript";
                oScript.src="/static/js/pb.js";
                oHead.appendChild( oScript);
            }
            else{
                var restriction  =$:json_encode(AccountData);
                var sim_ecount = $:json_encode(itmeAccGroup);
                
                var Number1 = '$trans('PBMainSim_DetailInfoPhoneNumLabel')'.slice(0,-1);
                var Number2 = '$trans('PBMainSim_DetailInfoHomeNumLabel')'.slice(0,-1);
                var Email1 = '$trans('PBMainSim_DetailInfoEmailLabel')'.slice(0,-1);
                var PhoneNumberCount = parseInt(restriction['ContactItemPhoneNumberCount']);
                
                if (PhoneNumberCount > 1){
             
                    var infoType = 	{};
                    infoType[Number1] = [Number1];
                    infoType[Number2] = [Number2];
                    infoType[Email1] = [Email1];
                    
                    var infoTypeName = 	{};
                    infoTypeName[Number1] = ['PhoneNumber-Mobile'];
                    infoTypeName[Number2] = ['PhoneNumber-Home'];
                    infoTypeName[Email1] = ['Email-Work'];

                   
                    var infoTypeOther = ['PhoneNumber1','PhoneNumber2','Email'];
                    }
                else{
                    var infoType = 	{};
                    infoType[Number1] = [Number1];
                    
                    var infoTypeName = 	{};
                    infoTypeName[Number1] = ['PhoneNumber-Mobile'];
                    
                    var infoTypeOther = ['PhoneNumber1','Email'];
                    }
            
                
                
                var oHead = document.getElementsByTagName('HEAD').item(0);
                var oScript= document.createElement("script");
                oScript.type = "text/javascript";
                oScript.src="/static/js/pbsim.js";
                oHead.appendChild( oScript);
            
            }
            
		</script>
		
	</head>
	<body oncontextmenu="return false" onselectstart="return false" onkeydown="KeyDownFunction()">
	<div id="before"> 
		<form  method="get" id="contact-form">

		
			<div id="wrap">
				<div class="pad15">
					<div class="clearfix">
						<div class="fl" id="avatar"><img width="70" height="70" />
						</div>
						<div class="fl" id="maininfor">
							<div class="mainInfor">
								<!--font id="name_vie"  name="name_vie" class="name"></font>
								<br/>
								<br/>
								<br/>
								<p id="nickname_vie" name="nickname_vie" class="nickname"></p-->

							</div>
						</div>
					</div>
					<div class="clearfix" id="editAccountGroup">
						<div class="fl account mart10" id="editorWrap" >
							<!--<span>$trans('PBMainView_EditPanel_BR_StaticBox_CB_Type')</span>-->
							<input type="button" id="edit" name="edit" class="edit" value="$trans('PBMainView_OneInfoPanel_ScrollPanel_BtnEdit')">
						</div>
						<!--div class="fl account mart10" id="account">
							<select class="" name="phoneaccount"id="phoneaccount">

							</select>
						</div>
						<div class="fl account mart10" id="accountView"  style="display:none">
							<select class="" name="phoneaccountView"id="phoneaccountView">

							</select>
						</div>
						<div class="fl group mart10" id="grupDefine">

						</div-->
					</div>
					<h2 style="display:block;">$trans('PBMainView_WEB_CONINFO')</h2>
					<div id="optionContainer" class="clearfix">
						<div class="claer"></div>
					</div>
					<div id="addWrap" style="display:none;">
						<select id="infoTypeSelector">
							<option val='0'>$trans('PBMainView_WEB_SELECT')</option>
						</select>
					</div>
				</div>
			</div>
			<div class="btnbox pad15"style="display:none;" id="saveAndCancel">
				<input type="button" class="save" name="save" id="save" value="$trans('PBMainView_EditPanel_BtnSave_Key')" />
				<input type="reset" class="save" name="cancel" id="cancel" value="$trans('PBMainView_WEB_CANCEL')" />
			</div>
		</form>
		<div id='userGroup' style="display:none">
			$trans('PBMainView_WEB_NAME')
			<input type="text" id="userDefindName" class="newAdd"/>
			<br />
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span id='userDefindNameWrong' style="display:none;color:#ff0000">$trans('PBMainView_WEB_NAMECANOT_EMPTY')</span>
		</div>
		<div id='userGroupTwo' style="display:none">
			$trans('PBMainView_WEB_GROUPNAME')
			<input type="text" id="userDefindGroup" class="newAdd"/>
			<br />
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span id='userDefindGroupWrong' style="display:none;color:#ff0000">$trans('PBMainView_WEB_GROUPNAME_CANOT_EMPTY')</span>
		</div>

		<div id='uploadImg' style="display:none">
			<form action = "/PB/ImageAdd" enctype = "multipart/form-data" method ="post" target="JoinIframe">
				
				<table width="100%">
				   <tr>
				     <td>
				        $trans('CHOICE_IMG')
				     </td>
				     <td>
				        &nbsp;&nbsp;<input type="text" id="imgText" readonly style="border:1px #ccc solid; height:20px;"/>
				     </td>
				     <td>
				        &nbsp;&nbsp;<input type="button" class="save" id="imgButton" value=$trans('CHOICE_IMG_SELECT') />
				     </td>
				   </tr>
				</table>
				
				
				<br />
				<input type="file" name="uploadImgFile" id="uploadImgFile" onchange="document.getElementById('imgText').value=this.value;"  style="visibility:hidden;"/>
			</form>
		</div>
		<iframe name="JoinIframe"  style="display:none;" >
			
		</iframe>
		<!-- 图片裁剪 start-->
		<div class="rel" id="loadPic" style="display:none;">
			<img id="defaultPic" src="/static/imgs/avatar.png" />
			<span id="preview_box" class="crop_preview" style="display:none;"><img id="crop_preview" src="" width="280px" height="250px"/></span>
			<!--<input id="clickImg" type="button" value="click"/>-->
		</div>
	<!-- Send Sms start-->
		<div class="sendsms" id="Sms" style="margin:10px;display:block;">
		<form name="sendMsgForm" id="sendMsgForm" style="vertical-align:text-bottom">
		      <span style="display:;margin-top:5px; float:left; color:#505050;">$trans('PBMainView_WEB_SendSms2')</span>
		      <select name="sendMsg" id="sendMsg" style= "width:120px; "></select>		   
		      <br/>
			<!--<input id="clickImg" type="button" value="click"/>-->
		</form>		   
			<div class="smsChat">
	 	        <font size ='2' color='red' id='PhoneTip'></font>
				<textarea class="inChat fl" style="margin:0px;"></textarea>
			</div>
		</div>
		  <br/>
<br/>
 </div>

 <br/>
<br/>
	</body>
	<script language="javascript">
	function KeyDownFunction()
	{
	if (typeof window.event != 'undefined') {  
	           document.onkeydown = function() {  
	             var type = event.srcElement.type;  
	             var code = event.keyCode;  
	             return ((code != 8 && code != 13) ||  
	                     (type == 'text' && code != 13 ) ||  
	                     (type == 'textarea') ||  
	                     (type == 'submit' && code == 13))  
	           }  
	         } else { // FireFox/Others  
	           document.onkeypress = function(e) {  
	   
	             var type = e.target.localName.toLowerCase();  
	             var code = e.keyCode;  
	             if ((code != 8 && code != 13) ||  
	                 (type == 'input' && code != 13 ) ||  
	                 (type == 'textarea') ||  
	                 (type == 'submit' && code == 13)) {  
	                 return true;  
	             } else {  
	                 return false ;  
	             }  
	           }  
	         } 
	}
	</script>
</html>