﻿var shareidea_const_liuyan = "请给我们留言,并留下您的email，我们会尽快和您联系!";
//document.location = "newDomain.htm";
function GetQueryString(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
    var r = window.location.search.toLowerCase().substr(1).match(reg);
    if (r != null)
        return unescape(r[2]);
    return "";
}
function openVideo() {
    var url = "video.htm";
    window.location.href = url;
}
function GotoPlace(id) {
    document.getElementById("introductContent").src = "ShareIdea产品介绍.htm#_" + id;
}

var preListMenuOjb = null;
function shareidea_ChangeLeftMenuStyle(obj, contentID1, contentID2) {
    if (preListMenuOjb == null)
        preListMenuOjb = document.getElementById("clientID_defaultLeftMenuItem");
    if (preListMenuOjb != null)
        preListMenuOjb.className = "";
    obj.className = "xianshi";
    preListMenuOjb = obj;

    var contentObj1 = document.getElementById(contentID1);
    var contentObj2 = document.getElementById(contentID2);
    // if(document.all)
    //     contentObj1.filters[0].apply(); 
    contentObj1.innerHTML = contentObj2.innerHTML;
    //if(document.all)
    //    contentObj1.filters[0].play(2);
    var pic = document.getElementById("piccenter");
    if (pic != null) {
        if (contentID2 == "divLN") {
            pic.style.visibility = "visible";
            pic.style.display = "";

        }
        else {
            pic.style.visibility = "hidden";
            pic.style.display = "none";
        }

    }




}


function AutoForm_UI_Title_GetTable(width, height, placer1, placer2, placer3, placer4, color1, color2, color3, color4, mouseOverColor1, mouseOverColor2, mouseOverColor3, mouseOverColor4, fontSize) {

    if (mouseOverColor1 == null)
        mouseOverColor1 = "black";
    if (mouseOverColor2 == null)
        mouseOverColor2 = "black";
    if (mouseOverColor3 == null)
        mouseOverColor3 = "black";
    if (mouseOverColor4 == null)
        mouseOverColor4 = "black";
    var lineHeight = height / 2;
    if (fontSize == null) {
        fontSize = (height - 4) / 2 + "px";
    }
    var titlePicHtml = "<table cellpadding='0' line-height:" + lineHeight + "px;  width='" + width + "px' height='" + height + "px' cellspacing='0'><tr width='100%' height='50%' >";
    titlePicHtml += "<td onMouseOver=\"this.style.backgroundColor='" + mouseOverColor1 + "';\" onMouseOut=\"this.style.backgroundColor='" + color1 + "';\" style=' height:50%;width:50%;line-height:" + lineHeight + "px; text-align:center;vertical-align:middle; background-color:" + color1 + ";'><font color='" + color1 + "' style='font-size:" + fontSize + "'>" + placer1 + "</font></td>";
    titlePicHtml += "<td  onMouseOver=\"this.style.backgroundColor='" + mouseOverColor2 + "';\" onMouseOut=\"this.style.backgroundColor='" + color2 + "';\" style=' height:50%;width:50%;line-height:" + lineHeight + "px; text-align:center;vertical-align:middle;background-color:" + color2 + ";'><font color='" + color2 + "' style='font-size:" + fontSize + "'>" + placer2 + "</font></td>";
    titlePicHtml += "</tr><tr  width='100%' height='50%'  >";
    titlePicHtml += "<td  onMouseOver=\"this.style.backgroundColor='" + mouseOverColor3 + "';\" onMouseOut=\"this.style.backgroundColor='" + color3 + "';\" style=' height:50%;width:50%;line-height:" + lineHeight + "px; text-align:center;vertical-align:middle;background-color:" + color3 + ";'><font color='" + color3 + "' style='font-size:" + fontSize + "'>" + placer3 + "</font></td>";
    titlePicHtml += "<td  onMouseOver=\"this.style.backgroundColor='" + mouseOverColor4 + "';\" onMouseOut=\"this.style.backgroundColor='" + color4 + "';\" style=' height:50%;width:50%;line-height:" + lineHeight + "px; text-align:center;vertical-align:middle;background-color:" + color4 + ";'><font color='" + color4 + "' style='font-size:" + fontSize + "'>" + placer4 + "</font></td>";
    titlePicHtml += "</tr></table>";
    return titlePicHtml;
}
function AutoForm_Math_DecToHex(dec) {
    var hexStr = "0123456789ABCDEF";
    var low = dec % 16;
    var high = (dec - low) / 16;
    hex = "" + hexStr.charAt(high) + hexStr.charAt(low);
    return hex;
}
function AutoForm_UI_Title_GetRandColorNumber() {
    var vNum
    vNum = Math.random()
    vNum = Math.round(vNum * 255)
    return AutoForm_Math_DecToHex(vNum.toString());

}
function AutoForm_UI_GetRandomColor() {

    return "#" + AutoForm_UI_Title_GetRandColorNumber() + AutoForm_UI_Title_GetRandColorNumber() + AutoForm_UI_Title_GetRandColorNumber();
}
function autoform_top_setPic() {
    var titlePicObj = document.getElementById("divAboutUs");
    titlePicObj.innerHTML = autoform_getLogTable(100, 100, 6);

}
function autoform_getLogTable(width, hight, deep) {
    var table = "";
    var subLen = 1;
    for (var i = 1; i < deep; i++) {
        subLen = 1;
        for (var j = 1; j < deep - i; j++)
            subLen = subLen * 2;
        table = AutoForm_UI_Title_GetTable(width / subLen, hight / subLen, table, "吉", "吉", "软", AutoForm_UI_GetRandomColor(), AutoForm_UI_GetRandomColor(), AutoForm_UI_GetRandomColor(), AutoForm_UI_GetRandomColor(), AutoForm_UI_GetRandomColor(), AutoForm_UI_GetRandomColor(), AutoForm_UI_GetRandomColor());

    }
    return table;
}

function shareidea_registObj() {
    autoform_setcomefrom();
    AutoForm_Global_bodyOnLoad();
    shareidea_registerOnlineContant();
}
function shareidea_clearcontent(obj) {
    var v = obj.value;
    v = trim(v);
    if (v == shareidea_const_liuyan) {
        obj.value = "";
        obj.style.color = "black";
    }
}
function trim(str) {

    str = str.replace(/ /gi, "");
    str = str.replace(/\r\n/g, ""); 
    return str; 
}
function shareidea_feedback(id) {
    var obj = document.getElementById(id);
    var v = obj.value;
    v = trim(v);
    if (v == "" || obj.value == shareidea_const_liuyan) {
        alert("请您填写留言内容");
        return;
    }
    registAtServer(encodeURIComponent(obj.value));
    alert("非常感谢您的留言！");
}
function AutoForm_GetXMLHTTPObject() {
    var A = null;
    try {
        A = new ActiveXObject("Msxml2.XMLHTTP")
    } catch (e) {
        try {
            A = new ActiveXObject("Microsoft.XMLHTTP")
        } catch (oc) {
            A = null
        }
    }
    if (!A && typeof XMLHttpRequest != "undefined") {
        A = new XMLHttpRequest()
    }
    return A
}
function registAtServer(feedback) {
    var result = true;
    var http = AutoForm_GetXMLHTTPObject();

    var url = "register.asp?action=liuyan&txtLiuYan=" + feedback;

    http.open("get", url, false);
    http.setRequestHeader("Content-Type", "text/xml");
    http.send(null);
    delete (http);
    return result;
}
function userRegiste() {
                                    var msg="";
                                    var companyName = document.getElementById("txtCompanyName").value;
                                    var officeTel =document.getElementById("txtOfficeTel").value;
                                    var userName = document.getElementById("txtUserName").value;
                                    var userEmail = document.getElementById("txtUserEmail").value;

                                    if (companyName == "") {
                                        msg += "公司名称，";
                                    }
                                    if (officeTel == "") {
                                        msg += "办公电话，";
                                    }
                                    if (userName == "") {
                                        msg += "联系人姓名，";
                                    }
                                    if (userEmail == "") {
                                        msg += "Email，";
                                    }

                                    if (msg != "") {
					msg=msg.substring(0,msg.length-1);
                                        msg = "请您填写：" + msg;
                                        alert(msg);
                                        return;
                                    }
                                     
                                    var result = true;
                                    var http = AutoForm_GetXMLHTTPObject();

                                    var url = "register.asp?action=regist&companyName=" + companyName;
                                    url = url + "&officeTel=" + officeTel;
                                    url = url + "&userName=" + userName;
                                    url = url + "&userEmail=" + userEmail;
				 
                                    http.open("get", url, false);
                                    http.setRequestHeader("Content-Type", "text/xml");
                                    http.send(null);
                                    delete (http);
				  alert("感谢您的关注，我们会尽快联系您！");
                                    return result;
                                }
function shareidea_ontxtliuyanblur(obj) {
    if (obj.value == "") {
        obj.value = shareidea_const_liuyan;
        obj.style.color = "gray";
    }

}
function shareidea_registerOnlineContant() {

    var onlineContantHtml = "<div class=\"Contact_top\" onmousedown=\"AutoForm_Dragging_HelpDragging(this, event, true); \" ><img src=\"image/1.gif\" /></div>";
    onlineContantHtml += " <div class=\"Contact_middle\">";
    onlineContantHtml += "<div class=\"Contact_img\"><img  src=\"image/b1.jpg\" /></div>";



  onlineContantHtml += " <div class=\"Contact_qq\"><img src=\"image/b2.gif\" />";
    onlineContantHtml += "<a target=\"blank\" href=\"http://wpa.qq.com/msgrd?V=1&Uin=19065685&Site=http://www.shareIdea.net&Menu=yes\">19065685</a></div>";
    

	onlineContantHtml += " <div class=\"Contact_qq\"><img src=\"image/b2.gif\" />";
    onlineContantHtml += "<a target=\"blank\" href=\"http://wpa.qq.com/msgrd?V=1&Uin=635710703&Site=http://www.shareIdea.net&Menu=yes\">635710703</a></div>";

onlineContantHtml += "  <div class=\"Contact_msn\"><img src=\"image/b3.gif\" /><a title=\"support@shareidea.net\" href=\"msnim:chat?contact=support@shareidea.net\">support</a></div>";
   
  
    
    //onlineContantHtml += " <div style=\"text-align:center;color:black;\" class=\"Contact_qq\">服务热线<br>";
    //onlineContantHtml += "(0755) 8223 1883</div>";
   
    
    onlineContantHtml += "  <div class=\"Contant_feedback\"><textarea name=\"txtLiuYan\" onblur=\"javascript:shareidea_ontxtliuyanblur(this);\" onclick=\"javascript:shareidea_clearcontent(this);\" style=\"color:gray;width:105px; height:65px;font-size:12px;\" rows=\"4\" id=\"shareide_clientID_feedback\" >" + shareidea_const_liuyan + "</textarea><br><input type=button value='发送' onclick=\"javascript:shareidea_feedback('shareide_clientID_feedback');\" /></div>";
    //onlineContantHtml +="<div class=\"Contant_feedback\">eee<div>";

    onlineContantHtml += " </div>";
    onlineContantHtml += " <div class=\"Contact_bottom\"></div>";
    var obj = document.createElement("div");
    obj.className = "Contact_Contact";
    obj.id = "shareidea_contantID";
    obj.style.left = "45px";
    obj.style.top = "290px";
    obj.style.zIndex = 10;
    obj.innerHTML = onlineContantHtml;

    document.forms[0].appendChild(obj);
}
function autoform_setcomefrom() {
    var frame = autoform_getHiddenFrame();
    if (frame != null) {
        var comeFrom = GetQueryString("comefrom");
        frame.src = "guest.asp?fileName=" + shareIdeaFileName + "&comeFrom=" + comeFrom;
    }
}
function autoform_getHiddenFrame() {
    var frame = document.getElementById("introductContent");
    if (frame == null) {
        frame = document.createElement("iframe");
        frame.id = "introductContent";
        frame.style.width = "0";
        frame.style.height = "0";
        document.forms[0].appendChild(frame);
    }
    return frame;
}
function shareidea_initContent(id1, id2) {
    var contentObj1 = document.getElementById(id1);
    var contentObj2 = document.getElementById(id2);
    if (contentObj1 != null && contentObj2 != null)
        contentObj1.innerHTML = contentObj2.innerHTML;
}
function AutoForm_Global_bodyOnLoad() {
    document.onclick = function(e1) //要兼容FF的话，这个参数一定要写上
    {
        AutoForm_Global_Event = window.event || e1;

    }

}
function shareidea_openOrCloseViewDesc(obj, id) {

    var div = document.getElementById(id);
    var visible = true;
    if (div != null) {
        if (div.style.visibility == "visible")
            visible = true;
        else
            visible = false;

        visible = !visible;
        if (visible) {
            div.style.visibility = "visible";
            div.style.display = "block";
            obj.innerHTML = " - "
        }
        else {
            div.style.visibility = "hidden";
            div.style.display = "none";
            obj.innerHTML = " + "
        }
    }
}