﻿

function getCoordinate(obj)
{
  var pos =
  {
    "x" : 0, "y" : 0
  }

  pos.x = document.body.offsetLeft;
  pos.y = document.body.offsetTop;

  do
  {
    pos.x += obj.offsetLeft;
    pos.y += obj.offsetTop;

    obj = obj.offsetParent;
  }
  while (obj.tagName.toUpperCase() != 'BODY')

  return pos;
}

function showCatalog(obj)
{
  var pos = getCoordinate(obj);
  var div = document.getElementById('ECS_CATALOG');

  if (div && div.style.display != 'block')
  {
    div.style.display = 'block';
    div.style.left = pos.x + "px";
    div.style.top = (pos.y + obj.offsetHeight - 1) + "px";
  }
}

function hideCatalog(obj)
{
  var div = document.getElementById('ECS_CATALOG');

  if (div && div.style.display != 'none') div.style.display = "none";
}

function sendHashMail()
{
  Ajax.call('user.php?act=send_hash_mail', '', sendHashMailResponse, 'GET', 'JSON')
}

function sendHashMailResponse(result)
{
  alert(result.message);
}

function display_mode(str)
{
    document.getElementById('display').value = str;
    setTimeout(doSubmit, 0);
    function doSubmit() {document.forms['listform'].submit();}
}


/* 修复IE6以下版本PNG图片Alpha */
function fixpng()
{
  var arVersion = navigator.appVersion.split("MSIE")
  var version = parseFloat(arVersion[1])

  if ((version >= 5.5) && (document.body.filters))
  {
     for(var i=0; i<document.images.length; i++)
     {
        var img = document.images[i]
        var imgName = img.src.toUpperCase()
        if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
        {
           var imgID = (img.id) ? "id='" + img.id + "' " : ""
           var imgClass = (img.className) ? "class='" + img.className + "' " : ""
           var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
           var imgStyle = "display:inline-block;" + img.style.cssText
           if (img.align == "left") imgStyle = "float:left;" + imgStyle
           if (img.align == "right") imgStyle = "float:right;" + imgStyle
           if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
           var strNewHTML = "<span " + imgID + imgClass + imgTitle
           + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
           + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
           + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
           img.outerHTML = strNewHTML
           i = i-1
        }
     }
  }
}

function hash(string, length)
{
  var length = length ? length : 32;
  var start = 0;
  var i = 0;
  var result = '';
  filllen = length - string.length % length;
  for(i = 0; i < filllen; i++)
  {
    string += "0";
  }
  while(start < string.length)
  {
    result = stringxor(result, string.substr(start, length));
    start += length;
  }
  return result;
}

function stringxor(s1, s2)
{
  var s = '';
  var hash = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
  var max = Math.max(s1.length, s2.length);
  for(var i=0; i<max; i++) 
  {
    var k = s1.charCodeAt(i) ^ s2.charCodeAt(i);
    s += hash.charAt(k % 52);
  }
  return s;
}

var evalscripts = new Array();
function evalscript(s)
{
  if(s.indexOf('<script') == -1) return s;
  var p = /<script[^\>]*?src=\"([^\>]*?)\"[^\>]*?(reload=\"1\")?(?:charset=\"([\w\-]+?)\")?><\/script>/ig;
  var arr = new Array();
  while(arr = p.exec(s)) appendscript(arr[1], '', arr[2], arr[3]);
  return s;
}

function $$(id)
{
    return document.getElementById(id);
}

function appendscript(src, text, reload, charset) 
{
  var id = hash(src + text);
  if(!reload && in_array(id, evalscripts)) return;
  if(reload && $$(id))
  {
    $$(id).parentNode.removeChild($$(id));
  }
  evalscripts.push(id);
  var scriptNode = document.createElement("script");
  scriptNode.type = "text/javascript";
  scriptNode.id = id;
  //scriptNode.charset = charset;
  try 
  {
    if(src) 
    {
      scriptNode.src = src;
    }
    else if(text)
    {
      scriptNode.text = text;
    }
    $$('append_parent').appendChild(scriptNode);
  } 
  catch(e)
  {}
}

function in_array(needle, haystack)
{
  if(typeof needle == 'string' || typeof needle == 'number')
  {
    for(var i in haystack)
    {
      if(haystack[i] == needle)
      {
        return true;
      }
    }
  }
  return false;
}

var pmwinposition = new Array();

var userAgent = navigator.userAgent.toLowerCase();
var is_opera = userAgent.indexOf('opera') != -1 && opera.version();
var is_moz = (navigator.product == 'Gecko') && userAgent.substr(userAgent.indexOf('firefox') + 8, 3);
var is_ie = (userAgent.indexOf('msie') != -1 && !is_opera) && userAgent.substr(userAgent.indexOf('msie') + 5, 3);
function pmwin(action, param)
{
  var objs = document.getElementsByTagName("OBJECT");
  if(action == 'open')
  {
    for(i = 0;i < objs.length; i ++)
    {
      if(objs[i].style.visibility != 'hidden')
      {
        objs[i].setAttribute("oldvisibility", objs[i].style.visibility);
        objs[i].style.visibility = 'hidden';
      }
    }
    var clientWidth = document.body.clientWidth;
    var clientHeight = document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
    var scrollTop = document.body.scrollTop ? document.body.scrollTop : document.documentElement.scrollTop;
    var pmwidth = 800;
    var pmheight = clientHeight * 0.9;
    if(!$$('pmlayer'))
    {
      div = document.createElement('div');div.id = 'pmlayer';
      div.style.width = pmwidth + 'px';
      div.style.height = pmheight + 'px';
      div.style.left = ((clientWidth - pmwidth) / 2) + 'px';
      div.style.position = 'absolute';
      div.style.zIndex = '999';
      $$('append_parent').appendChild(div);
      $$('pmlayer').innerHTML = '<div style="width: 800px; background: #666666; margin: 5px auto; text-align: left">' +
        '<div style="width: 800px; height: ' + pmheight + 'px; padding: 1px; background: #FFFFFF; border: 1px solid #7597B8; position: relative; left: -6px; top: -3px">' +
        '<div onmousedown="pmwindrag(event, 1)" onmousemove="pmwindrag(event, 2)" onmouseup="pmwindrag(event, 3)" style="cursor: move; position: relative; left: 0px; top: 0px; width: 800px; height: 30px; margin-bottom: -30px;"></div>' +
        '<a href="###" onclick="pmwin(\'close\')"><img style="position: absolute; right: 20px; top: 15px" src="images/close.gif" title="关闭" /></a>' +
        '<iframe id="pmframe" name="pmframe" style="width:' + pmwidth + 'px;height:100%" allowTransparency="true" frameborder="0"></iframe></div></div>';
    }
    $$('pmlayer').style.display = '';
    $$('pmlayer').style.top = ((clientHeight - pmheight) / 2 + scrollTop) + 'px';
    if(!param)
    {
        pmframe.location = 'pm.php';
    }
    else
    {
        pmframe.location = 'pm.php?' + param;
    }
  }
  else if(action == 'close')
  {
    for(i = 0;i < objs.length; i ++)
    {
      if(objs[i].attributes['oldvisibility'])
      {
        objs[i].style.visibility = objs[i].attributes['oldvisibility'].nodeValue;
        objs[i].removeAttribute('oldvisibility');
      }
    }
    hiddenobj = new Array();
    $$('pmlayer').style.display = 'none';
  }
}

var pmwindragstart = new Array();
function pmwindrag(e, op)
{
  if(op == 1)
  {
    pmwindragstart = is_ie ? [event.clientX, event.clientY] : [e.clientX, e.clientY];
    pmwindragstart[2] = parseInt($$('pmlayer').style.left);
    pmwindragstart[3] = parseInt($$('pmlayer').style.top);
    doane(e);
  }
  else if(op == 2 && pmwindragstart[0])
  {
    var pmwindragnow = is_ie ? [event.clientX, event.clientY] : [e.clientX, e.clientY];
    $$('pmlayer').style.left = (pmwindragstart[2] + pmwindragnow[0] - pmwindragstart[0]) + 'px';
    $$('pmlayer').style.top = (pmwindragstart[3] + pmwindragnow[1] - pmwindragstart[1]) + 'px';
    doane(e);
  }
  else if(op == 3)
  {
    pmwindragstart = [];
    doane(e);
  }
}

function doane(event)
{
  e = event ? event : window.event;
  if(is_ie)
  {
    e.returnValue = false;
    e.cancelBubble = true;
  } 
  else if(e)
  {
    e.stopPropagation();
    e.preventDefault();
  }
}

//控制DIV显示隐藏
function Display(obj,targetobj,downclass,upclass)
{
    this.obj = obj;
    this.Targetobj = document.getElementById(targetobj);
    this.DownClass = downclass;
    this.UpClass = upclass;
}

Display.prototype._switch = function()
{
    this.Targetobj.style.display = this.Targetobj.style.display == "" ? "none" : "";
    this.obj.className = this.obj.className == this.DownClass ? this.UpClass : this.DownClass;
}


function font(obj,size)
{
    document.getElementById(obj).style.fontSize = size + 'px';
}

//复制到剪切板
var content;
content="";
content="我发现一篇好文章，文章标题为：[prodname]， 赶紧去看看，网址是：";
content+=location.href;
function SendToMyFriend(ProdName)
{	
    content=content.replace("[prodname]",ProdName);
    window.clipboardData.setData("Text",  content);
    alert("已经把信息拷贝到粘贴板里面，请把内容通过即时通讯工具发送给你的好朋友广而告之。");
}

function copy(con)
{	
    window.clipboardData.setData("Text",  con);
    alert("已复制");
}

function article_tab(tab,len,obj)
{
    $$('article_tab_more').href = obj.href;
    
    for (var i=1;i<=len;i++)
    {
        if (i == tab)
        {
            $$('article_tab_'+tab).className= "current_nav";
            $$('article_tab_content_'+tab).style.display = "";
        }
        else
        {
            $$('article_tab_'+i).className= "";
            $$('article_tab_content_'+i).style.display = "none";
        }
    }
}

/*申请加盟表单提交 */
function join_apply(obj)
{
    var msg = "";
    var send = true;

    if (obj.company.value == "")
    {
        msg += "公司名称不能为空\r";
        send = false;
    }
    
    if (obj.name.value == "")
    {
        msg += "联系人姓名不能为空\r";
        send = false;
    }
    

    if (obj.mobile.value == "")
    {
        msg += "手机号码不能为空\r";
        send = false;
    }
    else
    {
        if (!Utils.isMobile(obj.mobile.value))
        {
            msg += "手机号码格式错误\r";
            send = false;
        }
    }
    
    if (obj.email.value == "")
    {
        msg += "电子邮箱不能为空\r";
        send = false;
    }
    else
    {
        if (!Utils.isEmail(obj.email.value))
        {
            msg += "电子邮箱格式错误\r";
            send = false;
        }
    }
    
    
    if (obj.province.value == "")
    {
        msg += "所在省份不能为空\r";
        send = false;
    }
    
    if (obj.city.value == "")
    {
        msg += "所在城市不能为空\r";
        send = false;
    }
    
    
    if (!send)
    {
        alert(msg);
        return false;
    }
    
    var para = "&company="+obj.company.value;
    para += "&name="+obj.name.value;
    para += "&sex="+obj.sex.value;
    para += "&tel="+obj.tel.value;
    para += "&mobile="+obj.mobile.value;
    para += "&email="+obj.email.value;
    para += "&fax="+obj.fax.value;
    para += "&qq="+obj.qq.value;
    para += "&province="+obj.province.value;
    para += "&city="+obj.city.value;
    para += "&address="+obj.address.value;
    para += "&postzip="+obj.postzip.value;
    para += "&hangye="+obj.hangye.value;
    para += "&content="+obj.content.value;

    $.ajax({
        type: "POST",
        url: "/tools/ajax.aspx",
        data: "act=join_apply" + para
    });
    
    alert("信息已经成功递交，我们会尽快与你取得联系");
    
    obj.reset();
    
    return false;
}







/*课程报名 */
function kcbm_apply(obj) {
    var msg = "";
    var send = true;

    if (obj.name.value == "") {
        msg += "您的姓名不能为空\r";
        send = false;
    }

    if (obj.mobile.value == "") {
        msg += "手机号码不能为空\r";
        send = false;
    }
    else {
        if (!Utils.isMobile(obj.mobile.value)) {
            msg += "手机号码格式错误\r";
            send = false;
        }
    }


    if (obj.email.value == "") {
        msg += "电子邮箱不能为空\r";
        send = false;
    }
    else {
        if (!Utils.isEmail(obj.email.value)) {
            msg += "电子邮箱格式错误\r";
            send = false;
        }
    }


    if (obj.company.value == "") {
        msg += "公司名称不能为空\r";
        send = false;
    }

    if (!send) {
        alert(msg);
        return false;
    }

    var para = "act=kcbm_apply&company=" + obj.company.value;
    para += "&name=" + obj.name.value;
    para += "&sex=";
    para += "&tel=";
    para += "&mobile=" + obj.mobile.value;
    para += "&email=" + obj.email.value;
    para += "&fax=";
    para += "&qq=";
    para += "&province=" + obj.province.value;
    para += "&city=" + obj.city.value;
    para += "&address=" + obj.address.value;
    para += "&postzip=";
    para += "&hangye=";
    para += "&content=" + obj.content.value;
    para += "&job=" + obj.job.value;
    para += "&url=" + obj.url.value;
    para += "&join_type=" + obj.join_type.value;

	$.ajax({
	   type: "POST",
	   url: "/tools/ajax.aspx",
	   data: para,
	   success: function(msg){
			alert("信息已经成功递交，我们会尽快与你取得联系");
	   }
	}); 
    obj.reset();
    return false;
}


function getPosition() {
    var top = document.documentElement.scrollTop;
    var left = document.documentElement.scrollLeft;
    var height = document.documentElement.clientHeight;
    var width = document.documentElement.clientWidth;

    return { top: top, left: left, height: height, width: width };
}

function QuickPostion(objID) {
    var obj = document.getElementById(objID);

    window.onscroll = function() {
        var Position = getPosition();
        obj.style.top = (Position.top) + 60 + "px";
        obj.style.right = "1px";
    };

    if (document.getCookie("kefutype") == "0") {
        setkefu(1);
    } else if (document.getCookie("kefutype") == "1") {
        setkefu(0);
    } else {
        setkefu(1);
    }
}

function writeIm(textS, siteNm) {

    var textCrumbs = textS.split(',');
    if (textCrumbs.length == 0) return;
    if (!siteNm) siteNm = "Oran";
    var rowStr = "<div style='position:absolute;right:1px;width:100px;top:60px;z-index:1000;' id='divOranIm'><div id=\"kefubtn\" style=\"text-align:right;cursor:hand;display:none\" ><img alt='打开咨询菜单' src=\"/images/im.gif\" onclick=\"setkefu(1)\"></div><div id=\"bodd\"><div class='ImHeader' onclick='setkefu(0)' style=\"cursor:hand\" alt='隐藏咨询菜单'><a href='javascript:void(0);' onclick='setkefu(0)'></a></div><div class=\"ImBorder\"><table class='ImTable' border='0' cellspacing='0' cellpadding='0' width='96'>";
    var online = [0];
    var isType = "QQ";
    var imgPath;
    var classIm;
    var thisIm;
    var idCrumbs;
    var menber;
    var menber;
    var tt;

    for (var i = 0; i < textCrumbs.length; ++i) {

        classIm = textCrumbs[i].split('||');
        if (classIm[0]) {
            rowStr += "<tr><td class='ImGroup'>&nbsp;&nbsp;" + classIm[0] + "</td></tr>";
        }
        idCrumbs = classIm[1].split('|');
        for (var j = 0; j < idCrumbs.length; ++j) {
            rowStr += "<tr><td align='center'><div class='ImRow" + (j % 2) + "'><a target='_self' class='im' href='";




            thisim = idCrumbs[j].split('$');

            tt = thisim[0];
            tt = tt.replace(")", "").split('(');
            isType = tt[1];

            menber = tt[0];
            if (isType == "qq") {
                imgPath = "/images/qq.jpg";
                rowStr += "tencent://message/?menu=yes&site=&uin=" + menber;
            }
            if (isType == "msn") {
                imgPath = "/images/msn.jpg";
                rowStr += "msnim:chat?contact=" + menber;
            }
            if (isType == "wangwang") {
                imgPath = "/images/WANGWANG.gif";
                rowStr += "http://amos.im.alisoft.com/msg.aw?v=2&site=cntaobao&s=1&charset=utf-8&uid=" + menber;
            }




            rowStr += "'><img src='" + imgPath + "' alt='" + isType + "' style='border:none' align='absmiddle'/> " + thisim[1] + "</a></div></td></tr>";
        }
    }


    rowStr += "</table></div><div class='ImFooter'></div></div></div>";
    //document.write(rowStr);
    document.getElementById("siteim").innerHTML = rowStr;
}

function setkefu(valtype) {
    if (valtype == 0) {
        document.getElementById("bodd").style.display = "none";
        document.getElementById("kefubtn").style.display = "";
        document.setCookie("kefutype", 1);
    } else {
        document.getElementById("bodd").style.display = "";
        document.getElementById("kefubtn").style.display = "none";
        document.setCookie("kefutype", 0);
    }
}



//取得父窗口浏览器可见区高度
function getClientHeight()
{
    var clientHeight=0;
    if(parent.document.body.clientHeight&&parent.document.documentElement.clientHeight)
    {
        var clientHeight = (parent.document.body.clientHeight<parent.document.documentElement.clientHeight)?parent.document.body.clientHeight:parent.document.documentElement.clientHeight;        
    }
    else
    {
        var clientHeight = (parent.document.body.clientHeight>parent.document.documentElement.clientHeight)?parent.document.body.clientHeight:parent.document.documentElement.clientHeight;    
    }
    return clientHeight;
}

function getPos(o)
{
    var t = o.offsetTop;
    var l = o.offsetLeft;
    while(o = o.offsetParent)
    {
        t += o.offsetTop;
        l += o.offsetLeft;
    }
    var pos = {top:t,left:l};
    return pos;
}

function pop()
{
    if (navigator.userAgent.indexOf("MSIE") != -1)
    {
        this.classname = "ie_pop_style";
        this.iframe_class = "ie_pop_iframe_style";
    }
    else
    {
        this.classname = "firefox_pop_style";
        this.iframe_class = "firefox_iframe_style";
    }
}

pop.prototype.show = function()
{
    var _pop = parent.document.createElement("div");
	_pop.id = "sys_pop";
	_pop.style.width = "100%";
	_pop.style.height = ""+ getClientHeight() +"px";
	_pop.className = this.classname;
	
	var _frame = parent.document.createElement("iframe");
	_frame.frameBorder = "0";
	_frame.src = "http://www.163.com";
	_frame.className = this.iframe_class;

	parent.document.body.appendChild(_pop);
	parent.document.body.appendChild(_frame);
}

window.onload = function()
{
    //new pop().show();
    
}

/*
显示文件上传窗口
obj 点击显示窗口的对象
upload_type 文件上传类型，有file,photo,video
target_obj 目标接收返回地址的对象
save_folder 文件保存路径
*/
function upload(obj,upload_type,target_obj,save_folder)
{
    var pos = getPos(obj);
    
    if (document.getElementById('pop_upload'))
        pop_close();
        
    var pop = document.createElement("div");
    pop.id = "pop_upload";
    pop.className = "pop";
    pop.style.top = pos.top;
    pop.style.left = pos.left;
    
    document.body.appendChild(pop);
    
    var close = document.createElement("a");
    close.innerText = "×";
    close.title = "关闭";
    close.href = "javascript:pop_close('pop_upload');";
    pop.appendChild(close);
    
    var iframe = document.createElement("iframe");
    iframe.src = "/tools/upload.aspx?t="+ escape(upload_type) +"&target_obj="+ escape(target_obj) +"&save_folder="+ escape(save_folder) +"";
    iframe.width = "100%";
    iframe.height = "60";
    iframe.frameBorder = "0";
    
    document.getElementById(pop.id).appendChild(iframe);
    
    iframe.src = iframe.src;

}

function pop_close(_pop)
{
    var obj = document.getElementById(_pop);
    
    document.body.removeChild(obj);
}

/*上传商品图 */
function up_goods_photo(clcik_obj,upload_type,target_obj,obj,tow_obj)
{
    var val = obj.options[obj.selectedIndex].name;
    
    if (val == "")
    {
        alert("请先选择商品所属分类");
        return false;
    }
    
    if (tow_obj.value == "")
    {
        alert("请先输入商品货号");
        return false;
    }
    
    var res = Ajax.call('/tools/ajax.aspx', "act=get_pingying&val="+ val +"", null, "POST", "JSON", false);
    
    upload(clcik_obj,upload_type,target_obj,res.message+'|'+ tow_obj.value + '|')
}

function sys_photo_list(obj,target_obj)
{
    var pos = getPos(obj);
    
    if (document.getElementById('pop_photo'))
        pop_close();
        
    var pop = document.createElement("div");
    pop.id = "pop_photo";
    pop.className = "pop";
    pop.style.top = pos.top;
    pop.style.left = pos.left;
    
    document.body.appendChild(pop);
    
    var close = document.createElement("a");
    close.innerText = "×";
    close.title = "关闭";
    close.href = "javascript:pop_close('pop_photo');";
    pop.appendChild(close);
    
    var iframe = document.createElement("iframe");
    iframe.src = "/tools/sys_photo.aspx?target_obj="+target_obj;
    iframe.width = "100%";
    iframe.height = "200";
    iframe.frameBorder = "0";
    
    document.getElementById(pop.id).appendChild(iframe);
    
    iframe.src = iframe.src;
}

function countdown(endtime, today, showid)
{
	today = new Date();
	target_time=new Date(endtime);
	timeold=(target_time.getTime()-today.getTime()); 
	sectimeold=timeold/1000;
	secondsold=Math.floor(sectimeold); 
	msPerDay=24*60*60*1000;
	e_daysold=timeold/msPerDay;
	daysold=Math.floor(e_daysold); 
	e_hrsold=(e_daysold-daysold)*24; 
	hrsold=Math.floor(e_hrsold); 
	e_minsold=(e_hrsold-hrsold)*60; 
	minsold=Math.floor(e_minsold); 
	e_seconds=(e_minsold-minsold)*60;
	seconds=Math.floor(e_seconds); 
	e_millisecond=(e_seconds-seconds)*1000;
	millisecond=Math.floor(e_millisecond);
    millisecond10=Math.floor(millisecond/10);
	the_element = document.getElementById(showid);
	the_element.innerHTML=""+daysold+"天"+hrsold+"小时"+minsold+"分"+seconds+"秒"/*+millisecond10/*+"毫秒"*/ ; 

	//today.setSeconds(today.getSeconds() + 0.01);
	window.setTimeout("countdown('" + endtime + "', today ,'"+ showid +"')", 100); 
} 


function addToEmail(val) {
    Ajax.call('/service/flow.aspx?act=add_to_Email', 'content=' + val, alert_Msg, 'POST', 'JSON');
}
function alert_Msg(result) {
    alert(result.message);
}


function addFavorite(val) {
    if (document.all) {
        window.external.addFavorite(window.location, val);
    }
    else if (window.sidebar) {
        window.sidebar.addPanel(val, window.location, "");
    }
}


function add_Email(email, contact, mobile) {
    if (contact == "") {
        alert("联系人不能为空");
        return false;
    }
    if (email == "") {
        alert("邮箱不能为空");
        return false;
    }
    if (!Utils.isEmail(email)) {
        alert("邮箱格式错误");
        return false;
    }

    if (mobile == "") {
        alert("手机号码不能为空");
        return false;
    }
    else {
        if (!Utils.isMobile(mobile)) {
            alert("手机号码不能为空");
            return false;
        }
    }

	$.post("/tools/ajax.aspx?act=add_Email", {email: email,contact: contact,mobile: mobile },
		function (data, textStatus){
			alert(data.message);
		}, "json"
	);
    return false;
}

function add_Email(email, contact, mobile, url) {
    if (contact == "") {
        alert("联系人不能为空");
        return false;
    }
    if (email == "") {
        alert("邮箱不能为空");
        return false;
    }
    if (!Utils.isEmail(email)) {
        alert("邮箱格式错误");
        return false;
    }

    if (mobile == "") {
        alert("手机号码不能为空");
        return false;
    }
 

	$.post("/tools/ajax.aspx?act=add_Email", {email: email,contact: contact,mobile: mobile, url:url },
		function (data, textStatus){
			alert(data.message);
			window.location.href='/html/article/courses.htm';
		}, "json"
	);
    return false;
}
