function setInnerHTML(el, htmlCode) {
	 var ua = navigator.userAgent.toLowerCase();
	 if (ua.indexOf('msie') >= 0 && ua.indexOf('opera') < 0) {
	 htmlCode = '<div style="display:none">for IE</div>' + htmlCode;
	 htmlCode = htmlCode.replace(/<script([^>]*)>/gi,
	 '<script$1 defer="true">');
	 el.innerHTML = htmlCode;
	 el.removeChild(el.firstChild);
	 }
	 else {
	 var el_next = el.nextSibling;
	 var el_parent = el.parentNode;
	 el_parent.removeChild(el);
	 el.innerHTML = htmlCode;
	 if (el_next) {
	 el_parent.insertBefore(el, el_next)
	 } else {
	 el_parent.appendChild(el);
	 }
	 }
}



function setSort(sort){
	var form = $('#up'); 
	$('#sortS').html(sort);
	$('#sortV').val(sort);
	form.submit();  
}

function searchUp(){
	 var form = $('#up'); 
	 $('#districtLv').val(1);
	 form.submit();  
}
function searchSe(){
	 var form = $('#up'); 
	 $('#districtLv').val(2);
	 form.submit();  
}

function searchTh(){
	var form = $('#up'); 
	 $('#districtLv').val(3);
	 form.submit();  
}

function searchNr(){
	var form = $('#up'); 
	 
	 form.submit();
}

function searchTag(){
	var form = $('#up'); 
	 
	 form.submit();
}

function searchTool(n){
	var form = $('#up'); 
	 $('#tooltip').val(n);
	 form.submit();
}

function longleSub(){
	var form = $('#LS'); 
	 form.submit();
}

function showToolTip(cid){
	$("#tagAd_"+cid).attr('checked','true');
	$("#tooltipAct").val(1);
	$('#addToolTag').show();
}

function showClick(clickname){
	$("#clientInfo1").show();
	var client=clickname;
	var url="/getClientInfoN";
	
	$.ajax({
		url:url,
		type: "post",
		cache: false,
		dataType: "json",
		data: {
			client:client
		},
		global: true,
		success: function(data){
			
			if(data.success){
				alert('请重新登录');
			}
			
			$('#clientInfo1').html(data.html);
			
		},
		error:function(err){
			
		}
		});
}

function RLongMsg(){
	
	var longleStatus=$('input:radio[name=longleStatus]:checked').val();
	var klid=$('#klid').val();
	
	var name=$("#name").val();
	var company=$("#company").val();
	
	var browseClient=$("input[name='browseClient']").val();
	var sellClient=$("input[name='sellClient']").val();

	var giftClient=$("input[name='giftClient']").val();
	var newProduct=$("#newProduct").val();
	var key_num=$("input[name='key_num']").val();
	var mark=$("#marks").val();
	var alloted_time=$("#alloted_time").val();
//	console.log($("#marks").text());
	var url="/addDoLockLog";



	$.ajax({
		url:url,
		type: "post",
		cache: false,
		dataType: "json",
		data: {
			longleStatus:longleStatus,
			klid:klid,
			
			name:name,
			company:company,

			browseClient:browseClient,
			sellClient:sellClient,
			
			giftClient:giftClient,
			newProduct:newProduct,
			key_num:key_num,
			alloted_time:alloted_time,
			mark:mark
		},
		global: true,
		success: function(data){
			
			if(data.msg=='1'){
				var year=$("[name='year']").val();
				var cid=$("[name='cid']").val();
				var staff=$("[name='staff']").val();
				var status=$("[name='status']").val();
				var product=$("[name='product']").val();
				var search=$("[name='search']").val();

				if (search!=''){
                    window.location.href = "/keyonline?search="+search+"&year="+year+"&cid="+cid+"&staff="+staff+"&status="+status+"&product="+product+"&lid="+klid;
				} else{
					window.location.href = "/keyonline?year="+year+"&cid="+cid+"&staff="+staff+"&status="+status+"&product="+product+"&lid="+klid;
				}
				// $('#LKMSG').show();
				// $('#LKMSG').html('操作成功');
				// $('#QTP').hide();
			}else{
				$('#LKMSG').show();
				$('#LKMSG').html('操作不成功');
			}
		},
		error:function(err){
		}
		});
}


function departmentC(dep){
	$("div[id^='PART_']").hide();
	$("div[id='PART_"+dep+"']").show();
	
	//$('#PART_'+dep).show();
	if(dep==""||dep==undefined)
		$("div[id^='PART_']").show();
	
}

function reFK(){
	
	$("#reHL").toggle();
	
}

function closeClick(){
	$("#clientInfo1").hide();
}

function closelookInfo(){
	$("#lookInfo").hide();
}

function showLook(keynum){
	
	$("#lookInfo").show();
	
	var url="/ajaxGetLongleN";
	
	$.ajax({
		url:url,
		type: "post",
		cache: false,
		dataType: "json",
		data: {
			keynum:keynum
		},
		global: true,
		success: function(data){
			
			if(data.success==false){
				alert('请重新登录');
			}
			
			var str="无";
			if(data.longle.alloted_time!="")
				str=data.longle.alloted_time;
				
			var infohtml='<tr><th>出库日期</th><td>'+data.longle.make_day+'</td><th>限期</th><td>'+str+'</td></tr><tr><th>产品</th><td>'+data.longle.product+'</td><th>版本</th><td>'+data.longle.version+'</td></tr><tr><th>当前状态</th><td>'+data.longle.statusT+'</td><th>责任人</th><td>'+data.longle.responsible+'</td></tr>';
			
			$("#infohtml").html(infohtml);
			
//			var lka='<a href="javascript:void(0)" onclick="getStaffInfo(\''+data.longle.responsible+'\')" >'+data.longle.responsible+'</a>';
//			
			$("#longleID").html(data.longle.key_num);
//			
//			$("#longleStatus").html(data.longle.statusT+"/"+data.longle.product);
			
			$("#LongleLogHtml").html(data.longleLogHtml);
			
//			if(data.longle.status>=3){
//				$("#longleStatus_5").attr('disabled',false);
//				$("#longleStatus_6").attr('disabled',false);
//				$("#longleStatus_7").attr('disabled',false);
//				$("#longleStatus_8").attr('disabled',false);
//			}
//			$('#staffInfo').hide();
//			$("#longleLog").show();
//			$('#clientInfo').hide();
		},
		error:function(err){

		}
		});
}

function getNewsPage(){
	var v=$("#newsP").find("option:selected").val();
	
	var a = v.split(":");
	
	window.location.href=encodeURI("/searchMyClient/"+a[0]+"/"+a[1]+"/"+a[2]+"/"+a[3]+"/"+a[4]);
	
}

function getNewsTPage(){
	var v=$("#newsP").find("option:selected").val();
	
	var a = v.split(":");
	
	window.location.href=encodeURI("/searchMyCompany/"+a[0]+"/"+a[1]+"/"+a[2]+"/"+a[3]+"/"+a[4]);
	
}

function checkadcl2(){
	
	var companyname=$('#adcompanyname').val();
	
	var adclientname=$('#adclientname').val();
	
	var op = $("#lv31 option:selected");
	
	if(adclientname==""){
		$('#admsg').html('请填写客户名称');
		return false;
	}

	if(companyname==""){
		$('#admsg').html('请填写公司名称');
		return false;
	}
	
	if(op.html()=="请选择"||op.html()==""){
		$('#admsg').html('请选择地区');
		return false;
	}
}

function checkadcl(){
	
	var companyname=$('#adcompanyname').val();
	
	var adclientname=$('#adclientname').val();
	
	var op = $("#lv21 option:selected");
	
	if(adclientname==""){
		$('#admsg').html('请填写客户名称');
		$('#admsg').attr('class','bsAlert bsDanger fL');
		return false;
	}

	if(companyname==""){
		$('#admsg').html('请填写公司名称');
		$('#admsg').attr('class','bsAlert bsDanger fL');
		return false;
	}
	
	
	
	
	if(op.html()=="请选择"){
		$('#admsg').html('请选择地区');
		$('#admsg').attr('class','bsAlert bsDanger fL');
		return false;
	}
	
	var op2=$("#lv22 option:selected");
	
	if(op2.html()=="请选择"){
		$('#admsg').html('请选择地区');
		$('#admsg').attr('class','bsAlert bsDanger fL');
		return false;
	}
	
	var op3=$("#lv23 option:selected");
	
	if(op3.html()=="请选择"){
		$('#admsg').html('请选择地区');
		$('#admsg').attr('class','bsAlert bsDanger fL');
		return false;
	}
	
	var url="/checkclicomname";
	
	$.ajax({
		url:url,
		type: "post",
		cache: false,
		dataType: "json",
		async:false, 
		data: {
			companyname:companyname,
			clientname:adclientname,
			district1:op.val(),
			district2:op2.val(),
			district3:op3.val()
		},
		//global: true,
		success: function(data){
			if(!data.success){
				$('#admsg').html('已经存在客户');
				//$('#admsg').attr('class','bsAlert bsDanger fL');
				return false;
			}else
				$('#adcl').submit()
		},
		error:function(err){
			if(!data.success){
				$('#admsg').html('已经存在客户');
				//$('#admsg').attr('class','bsAlert bsDanger fL');
				return false;
			}
		}
		});
	
	return false;
}

function addClient(){
	$("#addClient").show();
	$('#clientInfo').hide();
	$('#staffInfo').hide();
	$('#longleLog').hide();
	$('#changeCompany').hide();
}

function deleteTag(tid,cid,obj){
	
	var url="/ajaxDeleteTag";
	
	$.ajax({
		url:url,
		type: "post",
		cache: false,
		dataType: "json",
		data: {
			tid:tid,
			cid:cid
		},
		global: true,
		success: function(data){
			
			var tagifo=$("#syc_"+cid).attr('tag');
			obj.style.display="none";
			obj.remove();
			var retagifo=tagifo.replace(tid, " ");
			
			tagifo=$("#syc_"+cid).attr('tag',retagifo);
			
			
			//obj.hide();
		},
		error:function(err){

		}
		});
}




function deleteToolTip(a,b,c,obj){
	var url="/deleteToolTip";
	
	$.ajax({
		url:url,
		type: "post",
		cache: false,
		dataType: "json",
		data: {
			cid:a,
			cateid:b,
			name:c
		},
		global: true,
		success: function(data){
			
			obj.style.display="none";
			obj.remove();
			//obj.hide();
		},
		error:function(err){

		}
		});
}

function selectTagAd(cid){
	
	$("#tagAd_"+cid).attr('checked','true');
	
}

function showNature(nature,tk){
	$("#nature").val(nature);
	 var form = $('#up'); 
	 form.submit(); 
}

function showTag(){
	var objlist=$('#client li');
	
	var str=new Array();
	
	$('input[name="tag"]:checked').each(function(){  
		
		str.push($(this).val());
	})  
	
	var lv1=$("#lv1").val();
		
	var lv2=$("#lv2").val();
		
	var lv3=$("#lv3").val();
	
	if(str.length != 0){
		
	}else{
		objlist.hide();
		for(var m=0; m<objlist.length; m++){
			
			b1=objlist.eq(m).attr('data');
			
			ss1 = b1.split(",");
			
			if($.inArray(lv1, ss1)!=-1){
				if(lv2!=0&&$.inArray(lv2, ss1)!=-1){
				objlist.eq(m).show();
				break;
				}else if(lv2==0){
					objlist.eq(m).show();
					break;
				}
			}
			
				//objlist.eq(m).show();break;
			
			if($.inArray(lv3, ss1)!=-1){
				objlist.eq(m).show();break;
			}
			if(lv1==0)
				objlist.show();
		}
		return false;
	}
		
	for(var m=0; m<objlist.length; m++){
		b=objlist.eq(m).attr('tag');
		
		ss = b.split(",");
		
		b1=objlist.eq(m).attr('data');
		
		ss1 = b1.split(",");
		
		
		var flg=false;
		
		for(var k=0;k<str.length;k++){
			
			if($.inArray(str[k], ss)!=-1&&$.inArray(lv1, ss1)!=-1){
				
				if(lv2!=0&&$.inArray(lv2, ss1)!=-1){
				
					flg=true;
					
					objlist.eq(m).show();
						
					break;
				}else if(lv2==0){
					flg=true;
					
					objlist.eq(m).show();
						
					break;
				}
			}else if(lv1==0&&$.inArray(str[k], ss)!=-1){
				flg=true;
				
				objlist.eq(m).show();
					
				break;
			}
		}
		
		if(!flg)
			objlist.eq(m).hide();
	}
}

function dislvM(id,p,lk){
	
	var lv1=$("#"+id).val();
	
	var url="/ajaxGetLv2";
	
	$.ajax({
		url:url,
		type: "post",
		cache: false,
		dataType: "json",
		data: {
			lv1:lv1,
			s:p
		},
		global: true,
		success: function(data){
			
			var msg=document.getElementById('mlv'+p);
			
			var arr=new Array();
			
			var upi=0;
			
			if(data.success)
				upi=data.info[0].upid;
			
			if(p==2)
				var str='<select id="lv'+p+'" onchange="dislv(\'lv'+p+'\',3,\''+upi+'\')">';
			else if(p==3)
				var str='<select id="lv'+p+'" onchange="showcli(\'lv'+p+'\',\''+upi+'\')" >';
			
			if(p==22)
				var str='<select id="lv'+p+'" name="lv'+p+'" onchange="dislv(\'lv'+p+'\',23,\''+upi+'\')">';
			else if(p==23)
				var str='<select id="lv'+p+'" name="lv'+p+'"  >';
			
			var sstr='<option value="0">请选择</option>';
			
			arr.push(sstr);
			
			for(var i=0; i<data.info.length; i++){
				
				sstr='<option value="'+data.info[i].id+'">'+data.info[i].name+'</option>';
				 
	            arr.push(sstr);
			}
			
			setInnerHTML(msg,str+arr.join("")+"</select>");
			
			var objlist=$('#client li');
			
			if(p==2){
				var b="";
				for(var i=0; i<objlist.length; i++){
					
					b=objlist.eq(i).attr('data');
					
					ss = b.split(",");
					if(ss[0]==lv1)
						objlist.eq(i).show();
					else
						objlist.eq(i).hide();
					
					if(lv1==0){
						objlist.eq(i).show();
						
						var msg2=document.getElementById('mlv2');
						var arr2=new Array();
						var ss2="<select><option></option></select>";
						
						arr2.push(ss2);
						
						setInnerHTML(msg2,arr2.join(""));
						
						var msg3=document.getElementById('mlv3');
						
						setInnerHTML(msg3,arr2.join(""));
					}
				}
			}else if(p==3){
				var b="";
				for(var i=0; i<objlist.length; i++){
					
					b=objlist.eq(i).attr('data');
					
					ss = b.split(",");
					if(ss[1]==lv1)
						objlist.eq(i).show();
					else
						objlist.eq(i).hide();
					
					if(lv1==0){
						if(ss[0]==lk)
							objlist.eq(i).show();
					}
				}
			}	
		},
		error:function(err){

		}
		});
}


function dislv(id,p,lk){
	
	var lv1=$("#"+id).val();
	
	var url="/ajaxGetLv2";
	
	$.ajax({
		url:url,
		type: "post",
		cache: false,
		dataType: "json",
		data: {
			lv1:lv1,
			s:p
		},
		global: true,
		success: function(data){
			
			var msg=document.getElementById('mlv'+p);
			
			var arr=new Array();
			
			var upi=0;
			
			if(data.success)
				upi=data.info[0].upid;
			
			if(p==2)
				var str='<select id="lv'+p+'" onchange="dislv(\'lv'+p+'\',3,\''+upi+'\')">';
			else if(p==3)
				var str='<select id="lv'+p+'" onchange="showcli(\'lv'+p+'\',\''+upi+'\')" >';
			
			if(p==22)
				var str='<select id="lv'+p+'" name="lv'+p+'" onchange="dislv(\'lv'+p+'\',23,\''+upi+'\')">';
			else if(p==23)
				var str='<select id="lv'+p+'" name="lv'+p+'"  >';
			
			if(p==32)
				var str='<select id="lv'+p+'" name="lv22" onchange="dislv(\'lv'+p+'\',33,\''+upi+'\')">';
			else if(p==33)
				var str='<select id="lv'+p+'" name="lv23"  >';
			
			var sstr='<option value="0">请选择</option>';
			
			arr.push(sstr);
			
			for(var i=0; i<data.info.length; i++){
				
				sstr='<option value="'+data.info[i].id+'">'+data.info[i].name+'</option>';
				 
	            arr.push(sstr);
			}
			
			setInnerHTML(msg,str+arr.join("")+"</select>");
			
			var objlist=$('#client li');
			
			if(p==2){
				var b="";
				for(var i=0; i<objlist.length; i++){
					
					b=objlist.eq(i).attr('data');
					
					ss = b.split(",");
					if(ss[0]==lv1)
						objlist.eq(i).show();
					else
						objlist.eq(i).hide();
					
					if(lv1==0){
						objlist.eq(i).show();
						
						var msg2=document.getElementById('mlv2');
						var arr2=new Array();
						var ss2="<select><option></option></select>";
						
						arr2.push(ss2);
						
						setInnerHTML(msg2,arr2.join(""));
						
						var msg3=document.getElementById('mlv3');
						
						setInnerHTML(msg3,arr2.join(""));
					}
				}
			}else if(p==3){
				var b="";
				for(var i=0; i<objlist.length; i++){
					
					b=objlist.eq(i).attr('data');
					
					ss = b.split(",");
					if(ss[1]==lv1)
						objlist.eq(i).show();
					else
						objlist.eq(i).hide();
					
					if(lv1==0){
						if(ss[0]==lk)
							objlist.eq(i).show();
					}
				}
			}	
		},
		error:function(err){

		}
		});
}

function showcli(id,upid){
	var lv1=$("#"+id).val();
	var objlist=$('#client li');
	var b="";
	for(var i=0; i<objlist.length; i++){
		
		b=objlist.eq(i).attr('data');
		
		ss = b.split(",");
		if(ss[2]==lv1)
			objlist.eq(i).show();
		else
			objlist.eq(i).hide();
		
		if(lv1==0){
			if(ss[1]==upid)
				objlist.eq(i).show();
		}
			
	}
	
}

function doCompanyEdit(){
	//class="bsAlert bsSuccess fL"  editCompanyD
	
	var cid=$("#cid").val();
	var companyname=$("#companyname").val();
	var lv21=$("#lv21").val();
	var lv22=$("#lv22").val();
	var lv23=$("#lv23").val();
	
	var fax=$("#fax").val();
	var webservice=$("#webservice").val();
	var address=$("#address").val();
	var ride=$("#ride").val();
	var stay=$("#stay").val();
	
	var landmarks=$("#landmarks").val();
	
	var chk_value =[];    
	  $('input[name="nature[]"]:checked').each(function(){    
	   chk_value.push($(this).val());    
	  });  
	
	if(cid==""){
		$('#editCompanyD').attr('class','bsAlert bsDanger fL');	
		$('#editCompanyD').html("请填写正确的数据");
	}
	
	if(lv21==0||lv22==0||lv23==0){
		$('#editCompanyD').attr('class','bsAlert bsDanger fL');	
		$('#editCompanyD').html("请选择地区数据");
	}
	
	if(companyname==""){
		$('#editCompanyD').attr('class','bsAlert bsDanger fL');	
		$('#editCompanyD').html("请填写公司信息");
	}
	
	
	var url='/doEditCompanyD';
	$('#load').html("<img src='/global/js/load.gif'></img>");
	$.ajax({
		url:url,
		type: "post",
		cache: false,
		dataType: "json",
		data: {
			cid:cid,
			companyname:companyname,
			lv21:lv21,
			lv22:lv22,
			lv23:lv23,
			
			nature:chk_value,
			
			fax:fax,
			webservice:webservice,
			
			address:address,
			ride:ride,
			stay:stay,
			landmarks:landmarks
			
		},
		global: true,
		success: function(data){

			if(data.success){
				$('#editCompanyD').attr('class','bsAlert bsSuccess fL');	
				$('#editCompanyD').html("记录成功");
			}else{
				$('#editCompanyD').attr('class','bsAlert bsDanger fL');	
				$('#editCompanyD').html("请填写正确的数据");
			}
			
			
			
		},
		error:function(err){
			
		}
		});
	
	
}

function editByCompany(cid){
	var url="/ajaxEditCompany";
	
	$.ajax({
		url:url,
		type: "post",
		cache: false,
		dataType: "json",
		data: {
			companyId:cid
		},
		global: true,
		success: function(data){
			
			$('#clientInfo').html(data.html);	
			$('#clientInfo').show();
			$('#addClient').hide();
			$('#longleLog').hide();
			$('#changeCompany').hide();
		},
		error:function(err){

		}
		});
	
}

function getCompany(companyId){
	var url="/ajaxGetCompany";
	$.ajax({
		url:url,
		type: "post",
		cache: false,
		dataType: "json",
		data: {
			companyId:companyId
		},
		global: true,
		success: function(data){
			
			$('#clientInfo').html(data.html);	
			$('#clientInfo').show();
			$('#addClient').hide();
			$('#longleLog').hide();
			$('#changeCompany').hide();
		},
		error:function(err){

		}
		});
}

function getLockByName(name) {
	
	//var lid=$(this).attr('data');
	
	var url="/ajaxGetLongleByName";
	
	$.ajax({
		url:url,
		type: "post",
		cache: false,
		dataType: "json",
		data: {
			name:name
		},
		global: true,
		success: function(data){
			
			if(data.success==false){
				alert('请重新登录');
			}
			
			$("#klid").val(data.klid);
			
			$("#longleTitle").html(data.longle.key_num);
			
			$("#longleResponsible").html(data.longle.responsible);
			
			$("#longleStatus").html(data.longle.statusT+"/"+data.longle.product);
			
			$("#LongleLogHtml").html(data.longleLogHtml);
			
			if(data.longle.status>=3){
				$("#longleStatus_5").attr('disabled',false);
				$("#longleStatus_6").attr('disabled',false);
				$("#longleStatus_7").attr('disabled',false);
				$("#longleStatus_8").attr('disabled',false);
			}
			$('#staffInfo').hide();
			$("#longleLog").show();
			$('#clientInfo').hide();
			autoFlashHeight();
		},
		error:function(err){
//			easyDialog.open({
//				  container : { content : '请输入正确的参数'},
//				  autoClose : 1500,
//				  overlay : false
//			});
		}
		});
	
}

function getLock(lid) {
		
		//var lid=$(this).attr('data');
		
		var url="/ajaxGetLongle";
		
		$.ajax({
			url:url,
			type: "post",
			cache: false,
			dataType: "json",
			data: {
				lid:lid
			},
			global: true,
			success: function(data){
				
				if(data.success==false){
					alert('请重新登录');
				}
				
				$("#klid").val(data.klid);
				
				$("#longleTitle").html(data.longle.key_num);
				
				$("#longleResponsible").html(data.longle.responsible);
				
				$("#longleStatus").html(data.longle.statusT+"/"+data.longle.product+"("+data.longle.alloted_time+")");
				
				$("#LongleLogHtml").html(data.longleLogHtml);
				
				if(data.longle.status>=3){
					$("#longleStatus_5").attr('disabled',false);
					$("#longleStatus_6").attr('disabled',false);
					$("#longleStatus_7").attr('disabled',false);
					$("#longleStatus_8").attr('disabled',false);
				}
				$('#staffInfo').hide();
				$("#longleLog").show();
				$('#clientInfo').hide();
				
				$("#QTP").show();
				$('#LKMSG').hide();
				
				
			},
			error:function(err){
//				easyDialog.open({
//					  container : { content : '请输入正确的参数'},
//					  autoClose : 1500,
//					  overlay : false
//				});
			}
			});
		
	}

function getStaffInfo(username){
		
		//var username=$(this).attr('data');
		
		var url="/getStaffInfo";
		
		$.ajax({
			url:url,
			type: "post",
			cache: false,
			dataType: "json",
			data: {
				username:username
			},
			global: true,
			success: function(data){
				
				if(data.success){
					alert('请重新登录');
				}
				
				$('#staffInfo').html(data.html);
				$('#staffInfo').show();
				$('#longleLog').hide();
				$('#clientInfo').hide();
				autoFlashHeight();
			},
			error:function(err){
			}
			});
	}


function addClientByCompany(cid){
	
	var url='/ajaxGetCompanyByAdd';
	
	$.ajax({
		url:url,
		type: "post",
		cache: false,
		dataType: "json",
		data: {
			cid:cid
		},
		global: true,
		success: function(data){

			$html='<form name="adcl" action="/addClientByCompany" method="post" onsubmit="return checkadcl2()">';
			$html+='<input type="hidden" name="companyKey" id="companyKey" value="'+data.data.companyKey+'" >';
			$html+='<input type="hidden" name="token" value="'+data.data.token+'">';
			$html+='<div class="contactInfo"><div class="contactPanel"><table><tbody>';
			$html+='<tr><th>姓名</th><td><span data-placement="bottom" data-toggle="ctooltip" data-original-title="*必填；请填写真实姓名" onmouseover="ctooltipon(this)"><input type="text" name="clientname" id="adclientname"  style="width:55%"></span>';
				$html+='<select name="priority" id="priority"><option value="5" selected>优先级</option><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option></select></td><th>昵称</th><td><span data-placement="bottom" data-toggle="ctooltip" data-original-title="*必填；格式：林（声平）总；江（东明）工" onmouseover="ctooltipon(this)"><input type="text" id="nicename" name="nicename" style="width:55%" ><select name="gender" id="gender"><option value="男">男</option><option value="女">女</option></select></span>  </td></tr>';
				$html+='<tr><th>手机</th><td><span data-placement="bottom" data-toggle="ctooltip" data-original-title="多个号码请用分号间隔即可" onmouseover="ctooltipon(this)"><input type="text" name="telephone" id="telephone" ></span></td><th>电话</th><td><span data-placement="bottom" data-toggle="ctooltip" data-original-title="填写格式为：0756-3850888；多个号码请用分号间隔即可" onmouseover="ctooltipon(this)"><input type="text" id="phone"  name="phone"></span></td></tr>';
				$html+='<tr><th>部门</th><td><span data-placement="bottom" data-toggle="ctooltip" data-original-title="请规范填写部门，系统将按此关键词自动归类同单位同部门下的客户" onmouseover="ctooltipon(this)"><input type="text" id="department"  name="department"></span></td><th>职务</th><td><span data-placement="bottom" data-toggle="ctooltip" data-original-title="请填写简短清晰的职务" ><input type="text" id="position"  name="position"></span></td></tr>';
				$html+='<tr><th>办公室</th><td colspan="3"><span data-placement="bottom" data-toggle="ctooltip" data-original-title="填写客户所在办公室位置等" onmouseover="ctooltipon(this)"><input type="text" id="office" name="office"></span></td></tr>';
				$html+='<tr><th>QQ</th><td><span data-placement="right" data-toggle="ctooltip" data-original-title="多个QQ请用分号间隔即可" onmouseover="ctooltipon(this)"><input type="text" id="qq"  name="qq"></span></td><th>邮箱</th><td><span data-placement="left" data-toggle="ctooltip" data-original-title="多个邮箱请用分号间隔即可" onmouseover="ctooltipon(this)"><input type="text" name="email" id="email" ></span></td></tr>';
				$html+='<tr><th>备注</th><td colspan="4"><span data-placement="bottom" data-toggle="ctooltip" data-original-title=""><input type="text" id="mark" name="mark" value=""></span></td></tr>';
				$html+='</tr></tbody></table></div><div class="contactPanel"><table>';
				
				$html+='<tbody><tr><th>单位</th><td colspan="5"><input type="text" name="companyname" readonly id="adcompanyname" value="'+data.data.companyname+'"> </td></tr>';
				
				$html+='<tr><th>地区</th><td colspan="5"><span data-placement="bottom" data-toggle="ctooltip" data-original-title="暂不提供修改" onmouseover="ctooltipon(this)">'+data.data.dishtml+'</span></td></tr>';
				$html+='<tr><th>单位地址</th><td colspan="5"><input type="text" id="address" value="'+data.data.address+'" name="address"> </td></tr>';
				$html+='<tr style="display:none"><th>性质</th><td colspan="5">';
				
					for(var i=1;i<=data.data.natureArlenght;i++){
						$html+='<label><input type="checkbox" name="nature[]" value="'+data.data.natureAr[i]+'">'+data.data.natureAr[i]+'</label>&nbsp;';
					}
					
				$html+='</td></tr>';
				$html+='<tr><th>传真</th><td><span data-placement="bottom" data-toggle="ctooltip" data-original-title="填写格式为：0756-3850888" onmouseover="ctooltipon(this)"><input type="text" id="fax" value="'+data.data.fax+'" name="fax"></span></td><th>单位主页</th><td><input type="text" name="webservice" id="webservice" value="'+data.data.webservice+'"> </td></tr>';

				
				$html+='<tr><th>乘车路线</th><td colspan="5"><input type="text" id="ride" value="'+data.data.ride+'" name="ride"> </td></tr>';
				$html+='<tr><th>地标建筑</th><td colspan="5"><input type="text" id="landmarks" value="'+data.data.landmarks+'" name="landmarks"> </td></tr>';
				$html+='<tr><th>参考住宿</th><td colspan="5"><input type="text" id="stay" value="'+data.data.stay+'" name="stay"> </td></tr>';
				$html+='<tr><td colspan="6"><input type="submit" value="确定" class="button" ><span id="admsg"></span></td></tr></tbody></table></div></div></form>';
				
			$('#clientInfo').html($html);	
			$('#clientInfo').show();
			$('#changeCompany').hide();
		},
		error:function(err){

		}
		});
}

function changeCompany(cid){
	
	var url='/ajaxClientInfo';
	
	$.ajax({
		url:url,
		type: "post",
		cache: false,
		dataType: "json",
		data: {
			cid:cid
		},
		global: true,
		success: function(data){

			$html='<div class="contactInfo"><div class="contactPanel"><table>';
			$html+='<tbody><tr><th>姓名</th><td>'+data.html.clientname+'</td></tr>';
			$html+='<tr><th>所在单位</th><td>'+data.html.companyInfo.companyname+'</td></tr>';
			$html+='<tr><th>单位性质</th><td>'+data.html.companyInfo.nature+'</td></tr>';
			$html+='<tr><th>单位地区</th><td>'+data.html.companyInfo.local+'</td></tr>';
			$html+='<tr><th>单位地址</th><td>'+data.html.companyInfo.address+'</td></tr>';

			$html+='</tbody></table><input type="hidden" name="clientID" value="'+data.html.cid+'"/></div>';
//			$html+='<form name="lock" action="/updateChangeCompany" method="post"><div class="contactPanel">';
//			$html+='<table><tbody>';
//				
//			$html+='<tr><th>单位全称</th><td colspan="3"><input type="text" name="companyname" id="tags5" /> </td></tr>';
//			$html+='<tr><td colspan="4"><div class="bsAlert bsInfo">输入单位全称，系统将为你检索是否已存在单位；<br>若存在，则点选对应的单位即可；<br>若不存在，则需填写详细单位信息，添加新单位。</div></td></tr></tbody></table></div>';
//					
//					
//			$html+='<div class="contactPanel" id="contactPanelNew" >';
//			
//			
//			
//			$html+='	</div></div></form>';
			
			$('#cli_info').html($html);	
			$('#changeCompany').show();
			$('#clientInfo').hide();
			
		},
		error:function(err){
			
		}
		});
}

function clientEdit(cid){
	
	var url='/ajaxClientInfo';
	
	$.ajax({
		url:url,
		type: "post",
		cache: false,
		dataType: "json",
		data: {
			cid:cid
		},
		global: true,
		success: function(data){

				$html='<div class="contactInfo"><div class="contactPanel"><table><tbody>';
				$html+='<tr><th>姓名</th><td><input type="text" name="clientname" id="clientname" value="'+data.html.clientname+'" style="width:55%">';
					
				$html+='<select name="priority" id="priority">';
				
				$html+='<option value="5" >优先级</option>';
				if(data.html.priority==1){
					$html+='<option selected value="1">1</option>';
				}else{
					$html+='<option value="1">1</option>';
				}
				if(data.html.priority==2){
					$html+='<option selected value="2">2</option>';
				}else{
					$html+='<option value="2">2</option>';
				}
				if(data.html.priority==3){
					$html+='<option selected value="3">3</option>';
				}else{
					$html+='<option value="3">3</option>';
				}
				if(data.html.priority==4){
					$html+='<option selected value="4">4</option>';
				}else{
					$html+='<option value="4">4</option>';
				}
				if(data.html.priority==5){
					$html+='<option selected value="5">5</option>';
				}else{
					$html+='<option value="5">5</option>';
				}
				
				$html+='</select></td><th>昵称</th><td><input type="text" id="nicename" name="nicename" value="'+data.html.nicename+'" style="width:55%">';
				
				$html+='<select name="gender" id="gender">';
				if(data.html.gender=="男"){
					$html+='<option selected value="男">男</option>';
				}else{
					$html+='<option value="男">男</option>';
				}
				if(data.html.gender=="女"){
					$html+='	<option selected value="女">女</option>';
				}else
					$html+='	<option value="女">女</option>';
				
				$html+='</select></td> </tr>';
				$html+='<tr><th>手机</th><td><input type="text" name="telephone" id="telephone" value="'+data.html.telephone+'"> </td><th>电话</th><td><input type="text" id="phone" value="'+data.html.phone+'" name="phone"></td></tr>';
				$html+='<tr><th>QQ</th><td><input type="text" id="qq" value="'+data.html.qq+'" name="qq"> </td><th>邮箱</th><td><input type="text" name="email" id="email" value="'+data.html.email+'"> </td></tr>';
				$html+='<tr><th>备注</th><td colspan="3"><input type="text" id="mark" value="'+data.html.mark+'" name="mark"> </td></tr>';
				$html+='<tr><th>传真</th><td><span data-placement="bottom" data-toggle="ctooltip" data-original-title="填写格式为：0756-3850888" ><input type="text" id="fax" value="'+data.html.fax+'" name="fax"></span></td><th>主页</th><td><input type="text" name="webservice" id="webservice" value="'+data.html.webservice+'"> </td></tr>';
				
				$html+='<tr><th>部门</th><td><input type="text" id="department" value="'+data.html.department+'" name="department"></td><th>职务</th><td><input type="text" id="position" value="'+data.html.position+'" name="position"> </td></tr>';
				$html+='<tr><th>办公室</th><td colspan="3"><input type="text" id="office" value="'+data.html.office+'" name="office"> </td></tr>';
				
				
				//$html+='</tr></tbody></table></div><div class="contactPanel"><table>';
				//$html+='<tbody><tr><th>单位全称</th><td colspan="5"><input type="text" name="unit" id="unit" value="'+data.html.unit+'"> </td></tr>';
				$html+='<tr><th>客户地区</th><td colspan="5">';
				$html+='<select name="lv21" id="lv31" onchange="dislv(\'lv31\',\'32\');">'+data.html.districtLv1+'</select>';
				$html+='<span id="mlv32"><select id="lv32" onchange="dislv(\'lv32\',\'33\',\''+data.html.districtList[1]['id']+'\');" name="lv22">'+data.html.districtLv2+'</select></span>';
				$html+='<span id="mlv33"><select id="lv33" name="lv23">'+data.html.districtLv3+'</select></span>';
				$html+='</td></tr>';
					
				$html+='<tr><th>客户地址</th><td colspan="5"><input type="text" id="address" value="'+data.html.address+'" name="address"> </td></tr>';
				$html+='<tr><th>客户乘车</th><td colspan="5"><input type="text" id="ride" value="'+data.html.ride+'" name="ride"> </td></tr>';
				$html+='<tr><th>客户地标</th><td colspan="5"><input type="text" id="landmarks" value="'+data.html.landmarks+'" name="landmarks"> </td></tr>';
				$html+='<tr><th>客户住宿</th><td colspan="5"><input type="text" id="stay" value="'+data.html.stay+'" name="stay"> </td></tr>';
				$html+='<tr><td colspan="3"><a href="javascript:void(0)" onclick="EclientInfo('+cid+')" class="button">确定</a><span id="load"></span></td><td ></td></tr></tbody></table></div></div>';
				
				$html+='<div class="contactPanel"><table><tbody>';
				$html+='<tr><th>单位全称</th><td colspan="3"><a href="javascript:void(0)" onclick="getCompany(\''+data.html.companyInfo.cidKey+'\')" class="cname">'+data.html.companyInfo.companyname+'</a><div class="fR"><a href="javascript:void(0)" class="icon- edit" onclick="editByCompany('+data.html.companyInfo.cid+')" >I</a>|<a href="javascript:void(0)"   onclick="changeCompany('+data.html.cid+')" class="icon- replace">J</a></div></td></tr>';
				$html+='<tr><th>单位地区</th><td colspan="3"><span>'+data.html.companyInfo.local+'</span></td></tr>';
				$html+='<tr><th>单位性质</th><td colspan="3">'+data.html.companyInfo.nature+'</td></tr>';
				$html+='<tr><th>单位地址</th><td colspan="3">'+data.html.companyInfo.address+'</td></tr>';
				$html+='<tr><th>单位乘车</th><td colspan="3">'+data.html.companyInfo.ride+'</td></tr>';
				$html+='<tr><th>单位地标</th><td colspan="3">'+data.html.companyInfo.landmarks+'</td></tr>';
				$html+='<tr><th>单位住宿</th><td colspan="3">'+data.html.companyInfo.stay+'</td></tr>';
				$html+='</tbody></table></div>';
				
				
			$('#clientInfo').html($html);	
			$('#clientInfo').show();
			$('#changeCompany').hide();
			
		},
		error:function(err){
			
		}
		});
}

function EclientInfo(cid){
	
	var clientname=$("#clientname").val();
	var gender=$("#gender").val();
	var nicename=$("#nicename").val();
	var telephone=$("#telephone").val();
	var phone=$("#phone").val();
	var qq=$("#qq").val();
	var email=$("#email").val();
	var unit=$("#unit").val();
	var fax=$("#fax").val();
	var webservice=$("#webservice").val();
	var department=$("#department").val();
	var position=$("#position").val();
	var office=$("#office").val();
	var address=$("#address").val();
	var ride=$("#ride").val();
	var landmarks=$("#landmarks").val();
	var priority=$("#priority").val();
	var stay=$("#stay").val();
	var mark=$("#mark").val();
	
	var op1 = $("#lv31 option:selected");
	var op2 = $("#lv32 option:selected");
	var op3 = $("#lv33 option:selected");
	
	var lv21=$("#lv31").val();
	var lv22=$("#lv32").val();
	var lv23=$("#lv33").val();
	
	if(op1.html()=="请选择"){
		$('#load').html('请选择地区');
		$('#load').attr('class','bsAlert bsDanger fL');
		return false;
	}
	
	if(op2.html()=="请选择"){
		$('#load').html('请选择地区');
		$('#load').attr('class','bsAlert bsDanger fL');
		return false;
	}
	if(op3.html()=="请选择"){
		$('#load').html('请选择地区');
		$('#load').attr('class','bsAlert bsDanger fL');
		return false;
	}
	
	var url='/AddClientInfo';
	$('#load').html("<img src='/global/js/load.gif'></img>");
	$.ajax({
		url:url,
		type: "post",
		cache: false,
		dataType: "json",
		data: {
			cid:cid,
			clientname:clientname,
			gender:gender,
			nicename:nicename,
			telephone:telephone,
			phone:phone,
			email:email,
			unit:unit,
			fax:fax,
			webservice:webservice,
			department:department,
			position:position,
			office:office,
			address:address,
			ride:ride,
			landmarks:landmarks,
			qq:qq,
			priority:priority,
			stay:stay,
			mark:mark,
			lv21:lv21,
			lv22:lv22,
			lv23:lv23
		},
		global: true,
		success: function(data){

				
			$('#load').html("记录成功");
			
			
		},
		error:function(err){
			
		}
		});
}


function getClientInfo(client){

	//var client=$(this).attr('data');
	
	var url="/getClientInfo";
	
	$.ajax({
		url:url,
		type: "post",
		cache: false,
		dataType: "json",
		data: {
			client:client
		},
		global: true,
		success: function(data){
			
			if(data.success){
				alert('请重新登录');
			}
			
			$('#clientInfo').html(data.html);
			$('#clientInfo').show();
			$('#staffInfo').hide();
			$('#longleLog').hide();
			$('#addClient').hide();
			$('#changeCompany').hide();
			autoFlashHeight();
		},
		error:function(err){
		}
		});
	
}


function getLongleLog(lid) {
	
	//var lid=$(this).attr('data');
	
	var url="/ajaxGetLongle";
	
	$.ajax({
		url:url,
		type: "post",
		cache: false,
		dataType: "json",
		data: {
			lid:lid
		},
		global: true,
		success: function(data){
			
			if(data.success==false){
				alert('请重新登录');
			}
			
			$("#klid").val(data.klid);
			
			$("#longleTitle").html(data.longle.key_num);
			
			var lka='<a href="javascript:void(0)" onclick="getStaffInfo(\''+data.longle.responsible+'\')" >'+data.longle.responsible+'</a>';
			
			$("#longleResponsible").html(lka);
			
			$("#longleStatus").html(data.longle.statusT+"/"+data.longle.product);
			
			$("#LongleLogHtml").html(data.longleLogHtml);
			
			if(data.longle.status>=3){
				$("#longleStatus_5").attr('disabled',false);
				$("#longleStatus_6").attr('disabled',false);
				$("#longleStatus_7").attr('disabled',false);
				$("#longleStatus_8").attr('disabled',false);
			}
			$('#staffInfo').hide();
			$("#longleLog").show();
			$('#clientInfo').hide();
			$('#changeCompany').hide();
		},
		error:function(err){
//			easyDialog.open({
//				  container : { content : '请输入正确的参数'},
//				  autoClose : 1500,
//				  overlay : false
//			});
		}
		});
	
}

// function getClientInfo(client){
//
// 	//var client=$(this).attr('data');
//
// 	var url="/getClientInfo";
//
// 	$.ajax({
// 		url:url,
// 		type: "post",
// 		cache: false,
// 		dataType: "json",
// 		data: {
// 			client:client
// 		},
// 		global: true,
// 		success: function(data){
//
// 			if(data.success){
// 				alert('请重新登录');
// 			}
//
// 			$('#clientInfo').html(data.html);
// 			$('#clientInfo').show();
// 			$('#staffInfo').hide();
// 			$('#longleLog').hide();
// 			$('#addClient').hide();
// 			$('#changeCompany').hide();
// 			autoFlashHeight();
// 		},
// 		error:function(err){
// 		}
// 		});
//
// }

function aServiceLog(a,b,c){
	
	var url="/ajaxAddServiceLog";
	
	$('#load').html("<img src='/global/js/load.gif'></img>");
	
	var status=$('input[name="logstatus"]:checked').val();
	var date=$("#date").val();
	var mark=$('#mark').val();
	
	if(mark==""){
		$('#load').html('您还没有填写内容');
		$('#load').attr('class','bsAlert bsDanger fL');
		return false;
	}
	
	$('#conSer').attr({"disabled":"disabled"});
	
	var Remind=$('input[name="Remind"]:checked').val();
	var time=$("#dtp_input2").val();
	var remark=$('#remark').val();
	
	var m=$("#m").val();
	var d=$("#d").val();
	var y=$("#y").val();
	$.ajax({
		url:url,
		type: "post",
		cache: false,
		dataType: "json",
		data: {
			status:status,
			date:date,
			mark:mark,
			cid:c,
			m:m,
			d:d,
			y:y,
			Remind:Remind,
			time:time,
			remark:remark
			
		},
		global: true,
		success: function(data){
			
			if(!data.success){
				$('#load').html('请填写正确的数据');
				$('#load').attr('class','bsAlert bsDanger fL');
				return false;
			}
			var now=new Date()
			$('#load').html("记录成功");
			$('#load').attr('class','bsAlert bsDanger fL');
	var html='<div class="infoFlowList"><div class="dateTitle">';
	html+='<em class="month"><span class="num">'+m+'</span><span class="text">-'+d+'</span></em><span class="year">'+y+'</span>';
	if(status==1)
		html+='</div><ul class="flowList"><li class="item iconService">上门服务</li>';
	else if(status==2)
		html+='</div><ul class="flowList"><li class="item iconPhone">电话拜访</li>';
	else if(status==3)
		html+='</div><ul class="flowList"><li class="item iconOther">其他</li>';
	
	html+='<li class="item">'+a+'<a href="javascript:void(0)" id="getStaffInfo" data="'+b+'">'+b+'</a></li>';
			
	html+='<li class="item">'+mark+'</li></ul></div>';
	
	$('#kl').before(html);  
	
	$('#conSer').slideUp(100).delay(1000).fadeIn(100).removeAttr("disabled");
		},
		error:function(err){
			$('#load').html('请填写正确的数据');
			$('#load').attr('class','bsAlert bsDanger fL');
		}
		});
}

function a() {
    $('#masonny-div').infinitescroll({
	navSelector: "#next",
	nextSelector: "#next a",
	itemSelector: ".item",
	animate: true,
	extraScrollPx: 150,
	debug: false,
	bufferPx: 5,
	binder: $("#solder"),
	//binder: $(window),
	loading: {
	    finishedMsg: '没有更多内容了',
	    //img:  'loading_new.gif',
	    msgText: '正在加载中...',
	},
    },
	    function(newElements, opt) {

		//成功后执行自定义的函数
		//如果需要对新内容进行加工，就在这里实现
	    }
    );
}



$(function() {
	
	a();
	
	$("input[id^='longleStatus_']").click(function() {
		
		var lid=$(this).val();
		
		$("#longleStatusShow_3").hide();
		$("#longleStatusShow_4").hide();
		$("#longleStatusShow_5").hide();
		$("#longleStatusShow_6").hide();
		
		$("#longleStatusShow_8").hide();
		$("#longleStatusShow_9").hide();
		$("#longleStatusShow_10").hide();
		$("#longleStatusShow_"+lid).show();
		
	});
	
	$("a[id^='getStaffInfo']").click(function(){
		
		var username=$(this).attr('data');
		
		var url="/getStaffInfo";
		
		$.ajax({
			url:url,
			type: "post",
			cache: false,
			dataType: "json",
			data: {
				username:username
			},
			global: true,
			success: function(data){
				
				if(data.success){
					alert('请重新登录');
				}
				
				$('#staffInfo').html(data.html);
				$('#staffInfo').show();
				$('#longleLog').hide();
				$('#clientInfo').hide();
				$('#changeCompany').hide();
			},
			error:function(err){
			}
			});
	});
	
	$("a[id^='getClientInfo']").click(function(){

		var client=$(this).attr('data');
		
		var url="/getClientInfo";
		
		$.ajax({
			url:url,
			type: "post",
			cache: false,
			dataType: "json",
			data: {
				client:client
			},
			global: true,
			success: function(data){
				
				if(data.success){
					alert('请重新登录');
				}
				
				$('#clientInfo').html(data.html);
				$('#clientInfo').show();
				$('#staffInfo').hide();
				$('#longleLog').hide();
				$('#addClient').hide();
				$('#changeCompany').hide();
				autoFlashHeight();
			},
			error:function(err){
				autoFlashHeight();
			}
			});
		
	});
	
	$("a[id^='getCompanyInfo']").click(function(){
		alert('dd');
	});
	
	$("a[id^='getLongleLog_']").click(function() {
		
		var lid=$(this).attr('data');
		var url="/ajaxGetLongle";
		
		$.ajax({
			url:url,
			type: "post",
			cache: false,
			dataType: "json",
			data: {
				lid:lid
			},
			global: true,
			success: function(data){
				
				if(data.success==false){
					alert('请重新登录');
				}
				//console.log(data);
				//$("#klid").val(data.klid);
				$("#klid").val(data.lidKey);
				
				$("#longleTitle").html(data.longle.key_num);
				
				var lka='<a href="javascript:void(0)" onclick="getStaffInfo(\''+data.longle.responsible+'\')" >'+data.longle.responsible+'</a>';
				
				$("#longleResponsible").html(lka);
				
				var kk="";
				if(data.longle.alloted_time!=""){
					kk=" 期限："+data.longle.alloted_time;
					$("#alloted").show();
				}else{
					$("#alloted").hide();
					$("#longleStatusShow_10").hide();
				}

				var licencesHtml='';
				if(!(data.longle.licences==""||data.longle.licences==0)){
					licencesHtml=" 节点"+data.longle.licences;
				}
				
				if(data.longle.version!="")
				$("#longleStatus").html(data.longle.statusT+"/"+data.longle.product+"/("+data.longle.version+")"+kk+licencesHtml);
				else
				$("#longleStatus").html(data.longle.statusT+"/"+data.longle.product+""+kk+licencesHtml);
				
				$("#LongleLogHtml").html(data.longleLogHtml);
				
				if(data.longle.status>=3){
					$("#longleStatus_5").attr('disabled',false);
					$("#longleStatus_6").attr('disabled',false);
					//$("#longleStatus_7").attr('disabled',false);
					$("#longleStatus_8").attr('disabled',false);
				}
				if(data.longle.status<=2){
					$("#longleStatus_5").attr('disabled',true);
					$("#longleStatus_6").attr('disabled',true);
					//$("#longleStatus_7").attr('disabled',true);
					//$("#longleStatus_8").attr('disabled',true);
				}
				$('#staffInfo').hide();
				$("#longleLog").show();
				$('#clientInfo').hide();
				$("#QTP").show();
				$("#LKMSG").hide();
				autoFlashHeight();
			},
			error:function(err){
//				easyDialog.open({
//					  container : { content : '请输入正确的参数'},
//					  autoClose : 1500,
//					  overlay : false
//				});
			}
			});
		
	});
	
//	name=CASYN[]
//	  $('input[name=CASYN]:checked').length;
})






function selectToolTipCl(name){
	var e = is_ie ? event : selectToolTipCl.caller.arguments[0];
	obj = is_ie ? e.srcElement : e.target;
	var arr = document.getElementsByName(name);
	var k = arr.length;
	for ( var i = 0; i < k; i++) {
		arr[i].checked = obj.checked;
	}
	$('#addToolTag').hide();
}

function selectTagCl(name){
	var e = is_ie ? event : selectTagCl.caller.arguments[0];
	obj = is_ie ? e.srcElement : e.target;
	var arr = document.getElementsByName(name);
	var k = arr.length;
	for ( var i = 0; i < k; i++) {
		arr[i].checked = obj.checked;
	}
}

function checkall(name) {
	var e = is_ie ? event : checkall.caller.arguments[0];
	obj = is_ie ? e.srcElement : e.target;
	var arr = document.getElementsByName(name);
	var k = arr.length;
	for ( var i = 0; i < k; i++) {
		arr[i].checked = obj.checked;
	}
}



if (is_ie)
	document.documentElement.addBehavior("#default#userdata");

var userAgent = navigator.userAgent.toLowerCase();
var is_ie = (userAgent.indexOf('msie') != -1 && !is_opera) && userAgent.substr(userAgent.indexOf('msie') + 5, 3);
