// JavaScript Document
var action_name;
var ajax_file;
var title;
var content;
function show_guest(user_id,ajax_file,action_name,guest_title,guest_content){
this.action_name = action_name;
this.ajax_file = ajax_file;
var max_col = 'EToMaxB';
var min_col = 'EToMinB';
if(guest_title){
this.title=guest_title;
}else{
this.title='留言板';
}
if(guest_content){
this.content=guest_content;
}else{
this.content='您好,如果您对我公司产品感兴趣,请点些留言,谢谢!(限100个汉字)';
}
document.getElementById("ev_msg_zc_1").innerHTML='
';
}
function show_guest2(user_id,ajax_file,action_name,guest_title,guest_content){
this.action_name = action_name;
this.ajax_file = ajax_file;
var max_col = 'EToMaxB';
var min_col = 'EToMinB';
if(guest_title){
this.title=guest_title;
}else{
this.title='留言板';
}
if(guest_content){
this.content=guest_content;
}else{
this.content='您好,如果您对我公司产品感兴趣,请点些留言,谢谢!(限100个汉字)';
}
}
function sub_check(user_id){
var content2 = document.getElementById('content2').value;
var name = document.getElementById('name').value;
var e_mail = document.getElementById('e_mail').value;
var tel = document.getElementById('tel').value;
var time=UTCTimeDemo();
//var set_info = 1;
content2 = trim(content2);
if(content2==this.content || content2==''){
alert("请填写留言内容");
document.getElementById('content2').focus();
return false;
}else if(strLen(content2)<10 ){
alert("留言内容不能少于10个字符");
return false;
}
//name = name;
name = trim(name);
if( strLen(name)<4 ){
alert("名字不能少于4个字符!");
document.getElementById('name').focus();
return false;
}
//e_mail = e_mail;
e_mail = trim(e_mail);
var tag=checkEmail(e_mail);
if(tag==false){
alert("请填写正确的邮件地址");
document.getElementById('e_mail').focus();
return false;
}
tel = trim(tel);
if(tel!=''){
tag = phonecheck(tel);
if(tag==false){
alert("请填写正确的电话号码");
document.getElementById('tel').focus();
return false;
}
}else{
alert("请填写正确的电话号码");
document.getElementById('tel').focus();
return false;
}
var set_info = 2;
$.post(ajax_file,{type:11,con:content2,name:name,e_mail:e_mail,tel:tel,userid:user_id,set_info:set_info,u:time},
function(data){
if(data==1){
to_su();
}
}
);
}
function to_su(){
alert("留言成功");
document.location.reload();
}
function h_con(){
var value = document.getElementById("content2").value;
var defaultValue = trim(content);
if(value==defaultValue){
document.getElementById("content2").value="";
}
}
function s_con(){
var value = document.getElementById("content2").value;
var defaultValue = trim(content);
if(!value){
document.getElementById("content2").value = defaultValue;
}
}
/*//检测论坛消息
function check_message(){
var message = $('#message').val();
if(!trim(message)){
$('#huifu_error').html("消息内容不能为空");
//$('#huifu_btn').attr('disabled',true);
$('#huifu_btn').hide();
return false;
}else{
$('#huifu_error').html("");
//$('#huifu_btn').attr('disabled',false);
$('#huifu_btn').show();
}
}*/
//关闭弹窗
function close_window(){
var content = $('#message').val('');
$('#huifu_error').html("");
closeDiv();
}