var usrn; var pswd; var pwdMD5; var hostport; var isLan; var g_channelNum = 0; var g_analogChannel = 0; var g_digitalChannel = 0; var g_alarmInChannel = 0; var g_alarmOutChannel = 0; var g_audioInChannel = 0; var g_abilitySet = 0; var ocx; var loadPlayback = false; var loadImage = false; var deviceModel; var g_bLogin = false; var browseVer; var g_VersionDate; var Language='English'; var g_language='en'; var g_scrollWidth = 0; var g_generalTime = false; var g_lastActivate = 0; var g_main_i18n = new I18n().init('login', g_language); var modifyIP = null; function SizePF() { if ($("#playbackf")[0].style.display != "none") { //var mainheight = $("#pf")[0].contentDocument.body.scrollHeight; var mainheight = document.documentElement.clientHeight - $(".container-fluid").height(); if (mainheight > 0) $("#pf")[0].height = mainheight; } } function SizeSF() { if ($("#settingsf")[0].style.display != "none") { var mainheight = $("#sf")[0].contentDocument.body.scrollHeight; $("#sf")[0].height = mainheight; } } function SizeAF() { if ($("#alarmsf")[0].style.display != "none") { var mainheight = $("#af")[0].contentDocument.body.scrollHeight; $("#af")[0].height = mainheight; } } function SizeIF() { if ($("#infof")[0].style.display != "none") { var mainheight = $("#if")[0].contentDocument.body.scrollHeight; $("#if")[0].height = mainheight; } } function Load() { var username = getCookie('username'); $("#email")[0].value = username; Resize(); if (HasOcx()) { ocx.SetSpecialParamEx2(2, Language, 0, 0); } loadImage = false; loadPlayback = false; g_channelNum = 0; g_analogChannel = 0; g_digitalChannel = 0; g_alarmInChannel = 0; g_alarmOutChannel = 0; g_audioInChannel = 0; g_abilitySet = 0; g_bLogin = false; if(browseVer < 10){ $("#pswflag")[0].style.display="none"; $("#NewPswflag")[0].style.display="none"; $("#Confirmflag")[0].style.display="none"; } g_scrollWidth = getScrollbarWidth(); adjustLayout(devType); /* var lang = getCookie('language'); if(lang === ""){ lang = "en"; } g_language = lang; */ } function getScrollbarWidth() { var oP = document.createElement('p'), styles = { width: '100px', height: '100px', overflowY: 'scroll', visibility: 'hidden' }, i, scrollbarWidth; for (i in styles){ oP.style[i] = styles[i]; } document.body.appendChild(oP); scrollbarWidth = oP.offsetWidth - oP.clientWidth; document.body.removeChild(oP); return scrollbarWidth; } function Resize(){ var wheight = document.documentElement.clientHeight; var wwidht = document.documentElement.clientWidth - getScrollbarWidth(); var c = wheight - $('header').height() - getScrollbarWidth(); var a = 545; var e = 1180; if($("#postlogin")[0].style.display === ""){ a=680; e = 1080; }else if($("#playbackf")[0].style.display === ""){ a = 625; }else if($("#infof")[0].style.display === ""){ if($("#if")[0].src.indexOf("log.html") > 0){ a = 680; } }else if($("#settingsf")[0].style.display === ""){ if($("#sf")[0].src.indexOf("add-device.html") >= 0){ a = 750; }else if($("#sf")[0].src.indexOf("image.html")>=0){ a = 915; e = 1254; }else if($("#sf")[0].src.indexOf("encode.html")>=0){ a = 880; }else if($("#sf")[0].src.indexOf("tcp-ip.html")>=0){ a = 647; }else if($("#sf")[0].src.indexOf("wifi.html")>=0){ a = 670; }else if($("#sf")[0].src.indexOf("3g.html")>=0){ a = 790; }else if($("#sf")[0].src.indexOf("dnns.html")>=0){ a = 665; }else if($("#sf")[0].src.indexOf("email.html")>=0){ a = 600; }else if($("#sf")[0].src.indexOf("detect.html")>=0){ a = 1075; }else if($("#sf")[0].src.indexOf("schedule.html")>=0){ a = 890; }else if($("#sf")[0].src.indexOf("general.html")>=0){ if(parent.g_generalTime){ a = 960; }else{ a = 570; } }else if($("#sf")[0].src.indexOf("upgrade.html")>=0){ a = 900; }else if($("#sf")[0].src.indexOf("overlay.html")>=0){ a = 585; }else if($("#sf")[0].src.indexOf("channel-type.html")>=0){ a = 615; }else if($("#sf")[0].src.indexOf("pan-tilt-zoom.html")>=0){ a = 555; }else if($("#sf")[0].src.indexOf("camera-param.html")>=0){ a = 922; e = 1254; }else if($("#sf")[0].src.indexOf("recordctrl.html")>=0){ a = 790; } } if(c <= a){ c = a; } if(wwidht <= e) wwidht = e; $('.content-wrapper').height(c); $('.content-wrapper').width(wwidht); if($("#settingsf")[0].style.display === ""){ var a = $("#settingsf .main-content").width(); var b = a-$("#settingsf .side-bar").width() - 4 - a*0.015; $('#settingsf .side-content').width(b); } else if($("#infof")[0].style.display === ""){ var a = $("#infof .main-content").width(); var b = a-$("#infof .side-bar").width() - 4 - a*0.015; $('#infof .side-content').width(b); $('#infof .side-bar').height(c); $('#infof .side-content').height(c); } } function HasOcx() { var bIE = IsIE(); var tip = ""; if (bIE == 0) { tip = g_main_i18n.getValue("ioe_Not_Ie"); MyAlert(tip); return 0; } if (bIE == 1) { if (!DetectActiveX()) { tip = g_main_i18n.getValue("ioe_No_Plugin"); MyAlert(tip); return 0; } return 1; } if (bIE == -1) { if (!DetectExtension()) { tip = g_main_i18n.getValue("ioe_No_Plugin"); MyAlert(tip); return 0; } return 1; } } function Login() { if(g_bLogin){ return; } g_bLogin = true; deviceModel = ""; if (!HasOcx()) return; usrn = $("#email")[0].value; setCookie("username", usrn); pswd = $("#password")[0].value; var string = "CPPLUS_"; //var string=''; pwdMD5 = string + hex_md5(pswd); var cmdid = "login"; var cmddata = { "EncryptType": "MD5", "LoginType": "DVRIP-Web", "PassWord": pwdMD5, "UserName": usrn, "Name": "generalinfo" }; Communicate(cmdid, cmddata, CallBackLogin); } function CallBackLogin() { var result; try { result = CheckResponse.apply(this); if (result == "") return; } catch (e) { if(e.message == "ioe_NoPermission" || e.message == "ioe_Opr_Failed"){ MyAlert(g_main_i18n.getValue('ioe_User_Err')); }else{ MyAlert(e.message); } g_bLogin = false; return; } if (result.Ret == 100) { deviceModel = result.DeviceType; if (pswd == "admin" && ocx.NotAgain(1, "a") == "1") { g_bLogin = false; $("#BtnChangePass").click(); return; } else { GetHP(); } } else { MyAlert(g_main_i18n.getValue(getErrorStr(result.Ret))); g_bLogin = false; return; } } function GetHP() { var cmdid = "getconfig"; var cmddata = { "PassWord": pwdMD5, "UserName": usrn, "Name": "NetWork.NetCommon" }; Communicate(cmdid, cmddata, CallBackHP); } function CallBackHP() { var result; try { result = CheckResponse.apply(this); if (result == "") return; } catch (e) { MyAlert(e.message); g_bLogin = false; return; } hostport = result.TCPPort; isLan = $("#lan")[0].checked; getLocation(); } function Cancel() { $("#email")[0].value = ""; $("#password")[0].value = ""; $("#lan")[0].click(); } function ClickPlayBack() { if ($("#sf")[0].src.indexOf("image.html") >= 0) { if (null != frames["nsf"].imageocx) { frames["nsf"].imageocx.ImageView(1, -1, 0, false); } } switch_ifram(this); $("#postlogin")[0].style.display = "none"; $("#settingsf")[0].style.display = "none"; $("#alarmsf")[0].style.display = "none"; $("#infof")[0].style.display = "none"; $("#playbackf")[0].style.display = ""; Resize(); if(g_lastActivate == 1) { return; } ActivateNav(1); if ($("#pf")[0].src.indexOf(".html") < 0) { $("#pf")[0].src = "playback.html"; }else { if(null != frames["npf"].pbocx) { frames["npf"].pbocx.NotAgain(2006, ""); } } } function ClickPreview() { if ($("#sf")[0].src.indexOf("image.html") >= 0) { if (null != frames["nsf"].imageocx) { frames["nsf"].imageocx.ImageView(1, -1, 0, false); } } $("#settingsf")[0].style.display = "none"; $("#playbackf")[0].style.display = "none"; $("#alarmsf")[0].style.display = "none"; $("#infof")[0].style.display = "none"; $("#postlogin")[0].style.display = ""; Resize(); ActivateNav(0); } function ClickAlarm() { if ($("#sf")[0].src.indexOf("image.html") >= 0) { if (null != frames["nsf"].imageocx) { frames["nsf"].imageocx.ImageView(1, -1, 0, false); } } $("#postlogin")[0].style.display = "none"; $("#playbackf")[0].style.display = "none"; $("#settingsf")[0].style.display = "none"; $("#infof")[0].style.display = "none"; $("#alarmsf")[0].style.display = ""; Resize(); ActivateNav(2); if ($("#af")[0].src.indexOf(".html") < 0) { $("#af")[0].src = "alarm.html"; } } function ClickImage() { $("#postlogin")[0].style.display = "none"; $("#playbackf")[0].style.display = "none"; $("#alarmsf")[0].style.display = "none"; $("#infof")[0].style.display = "none"; $("#settingsf")[0].style.display = ""; Resize(); ActivateNav(3); if ($("#sf")[0].src.indexOf(".html") < 0) { var els = $("#Camera").find("li"); for (var i = 0; i < els.length; i++) { if (!$(els[i]).is(":hidden")) { $(els[i]).find("a").click(); break; } } } else { if ($("#sf")[0].src.indexOf("image.html") >= 0) { var nSel = frames["nsf"].$("#Chans")[0].selectedIndex; var subToken = parseInt(frames["nsf"].$("#Chans")[0].options[nSel].value); frames["nsf"].imageocx.ImageView(ocx.GetLoginHandle, subToken, 1, true); } } } function ClickInfo() { if ($("#sf")[0].src.indexOf("image.html") >= 0) { if (null != frames["nsf"].imageocx) { frames["nsf"].imageocx.ImageView(1, -1, 0, false); } } $("#postlogin")[0].style.display = "none"; $("#playbackf")[0].style.display = "none"; $("#alarmsf")[0].style.display = "none"; $("#settingsf")[0].style.display = "none"; $("#infof")[0].style.display = ""; Resize(); ActivateNav(4); if ($("#if")[0].src.indexOf(".html") < 0) { $("#infof li.active").removeClass("active"); $($("#infof li")[0]).addClass("active"); $("#if")[0].src = "info.html"; } } function ClickLG() { Resize(); if(ocx.Logout()) { if(loadPlayback) { loadPlayback = false; if(null != frames["npf"].pbocx) frames["npf"].pbocx.Logout(); } if(loadImage) { loadImage = false; if(null != frames["nsf"].imageocx) frames["nsf"].imageocx.ImageView(1, -1, 0, false); } } ocx.LogoutEx(); if(modifyIP != null && modifyIP != location.hostname) { location.replace(location.protocol + "//" + modifyIP + "/"); }else{ location.reload(); } } function ClickItem(refr, el) { if ($("#sf")[0].src.indexOf(refr) < 0) { if ($("#sf")[0].src.indexOf("image.html") >= 0) { if (null == frames["nsf"].imageocx) { return; } else { frames["nsf"].imageocx.ImageView(1, -1, 0, false); } } $("#settingsf li.active").removeClass("active"); $(el).parent().addClass("active"); $("#sf")[0].src = refr; Resize(); } } function ClickItemEx(refr, el) { if ($("#if")[0].src.indexOf(refr) < 0) { $("#infof li.active").removeClass("active"); $(el).parent().addClass("active"); $("#if")[0].src = refr; Resize(); } } function ActivateNav(nSel) { $(".pull-right").find("li").removeClass("active"); $($(".pull-right").find("li")[nSel]).addClass("active"); $(".pull-right")[0].style.display = "none"; $(".pull-right")[0].style.display = ""; if(g_lastActivate == 1) { if(null != frames["npf"].pbocx) { frames["npf"].pbocx.NotAgain(2008, ""); } } g_lastActivate = nSel; /* var head = document.getElementsByTagName('head')[0], style = document.createElement('style'); style.type ='text/css'; style.styleSheet.cssText = ':before{content:none !important}'; head.appendChild(style); */ /* setTimeout(function(){ head.removeChild(style); },0); */ } function GetEssentialParams() { var cmdid = "getinfo"; var cmddata = { "PassWord": pwdMD5, "UserName": usrn, "Name": "SystemInfo" }; Communicate(cmdid, cmddata, CallBackEssential); } function CallBackEssential() { var result; try { result = CheckResponse.apply(this); if (result == "") return; } catch (e) { MyAlert(e.message); g_bLogin = false; return; } g_channelNum = result.SystemInfo.VideoInChannel + result.SystemInfo.DigChannel; g_analogChannel = result.SystemInfo.VideoInChannel; g_digitalChannel = result.SystemInfo.DigChannel; g_alarmInChannel = result.SystemInfo.AlarmInChannel; g_alarmOutChannel = result.SystemInfo.AlarmOutChannel; g_audioInChannel = result.SystemInfo.AudioInChannel; g_VersionDate = result.SystemInfo.SoftWareVersion + "|" + result.SystemInfo.BuildTime; var cmdid = 'getability'; var cmddata = { "PassWord": pwdMD5, "UserName": usrn, "Name": "SystemFunction" }; Communicate(cmdid, cmddata, CallBackGetAbility); } function CallBackGetAbility() { var result; try { result = CheckResponse.apply(this); if (result == "") return; } catch (e) { MyAlert(e.message); g_bLogin = false; return; } g_abilitySet = result; if (g_digitalChannel == 0) { $($("#Camera").find("li")[0]).hide(); } // if(g_analogChannel == 0){ // $($("#Camera").find("li")[2]).hide(); // } if (g_abilitySet.SystemFunction.NetServerFunction.NetWifi == false || parent.devType == 2) { $($("#Network").find("li")[2]).hide(); } if (g_abilitySet.SystemFunction.NetServerFunction.Net3G == false || parent.devType == 2) { $($("#Network").find("li")[3]).hide(); } if (g_abilitySet.SystemFunction.NetServerFunction.NetPPPoE == false) { $($("#Network").find("li")[4]).hide(); } if (g_abilitySet.SystemFunction.NetServerFunction.NetDDNS == false) { $($("#Network").find("li")[5]).hide(); } if (g_abilitySet.SystemFunction.NetServerFunction.NetIPFilter == false) { $($("#Network").find("li")[6]).hide(); } if (g_abilitySet.SystemFunction.NetServerFunction.NetEmail == false) { $($("#Network").find("li")[7]).hide(); } if (g_abilitySet.SystemFunction.NetServerFunction.NetFTP == false) { $($("#Network").find("li")[8]).hide(); } if (g_abilitySet.SystemFunction.NetServerFunction.NetUPNP == false) { $($("#Network").find("li")[9]).hide(); } if (true) { $($("#Network").find("li")[10]).hide(); } if (true) { $($("#Network").find("li")[11]).hide(); } if (true) { $($("#Network").find("li")[12]).hide(); } if (g_abilitySet.SystemFunction.NetServerFunction.NetAlarmCenter == false) { $($("#Network").find("li")[13]).hide(); } if (true) { $($("#Network").find("li")[14]).hide(); } if (g_abilitySet.SystemFunction.NetServerFunction.NetPMS == false) { $($("#Network").find("li")[15]).hide(); } if(g_abilitySet.SystemFunction.NetServerFunction.NetDAS == false){ $($("#Network").find("li")[16]).hide(); } if(g_abilitySet.SystemFunction.NetServerFunction.NetHMS == false){ $($("#Network").find("li")[17]).hide(); } if (g_abilitySet.SystemFunction.AlarmFunction.MotionDetect == false && g_abilitySet.SystemFunction.AlarmFunction.BlindDetect == false && g_abilitySet.SystemFunction.AlarmFunction.LossDetect == false) { $($("#Event").find("li")[0]).hide(); } if (g_abilitySet.SystemFunction.CommFunction.CommRS485 == false || g_analogChannel == 0) { $($("#System").find("li")[2]).hide(); } if (true) { $($("#System").find("li")[3]).hide(); } if(parent.devType == 2){ if (g_abilitySet.SystemFunction.OtherFunction.NOHDDRECORD) { $($("#Storage").find("li")[1]).hide(); loginReady(); }else{ var cmdid = 'getinfo'; var cmddata = { "PassWord" : pwdMD5, "UserName" : usrn, "Name":"StorageInfo" }; Communicate(cmdid, cmddata, CallBackStorageInfo); } } else{ loginReady(); } } function loginReady(){ // $("#lang_group_id")[0].style.display="none"; $(".login-wrp")[0].style.display = "none"; $("header").show(); frames["nff"].HideWndBtn(); $(".navbar-header")[0].style.display = ""; $(".pull-right")[0].style.display = ""; $("#postlogin")[0].style.display = ""; Resize(); ActivateNav(0); var count = 0; var timeTip = setInterval(function () { count ++; var val = ocx.SetSpecialParamEx2(3, "", 0, 0); if(val >= 0){ g_language = GetLanguage(Language); g_main_i18n = null; g_main_i18n = new I18n().init('login', g_language); ocx.SetSpecialParamEx2(2, Language, 0, 0); //setCookie("language", g_language); clearInterval(timeTip); frames["nff"].LoadEx(); }else if(count > 20){ g_bLogin = false; clearInterval(timeTip); } }, 200); } function CallBackStorageInfo(){ try{ ssAccept = CheckResponse.apply(this); if (ssAccept == "") { return; } }catch(e) { parent.MyAlert(e.message); g_bLogin = false; return; } if (ssAccept.Ret == 100){ var TotalNum=0; for (var j = 0; j < ssAccept.StorageInfo.length; j++) { var partNum = ssAccept.StorageInfo[j].PartNumber; for (var i = 0; i < partNum; i++){ if(ssAccept.StorageInfo[j].Partition[i].DirverType > 4){ continue; } TotalNum += parseInt(ssAccept.StorageInfo[j].Partition[i].TotalSpace); } } if(TotalNum != 0){ $($("#Storage").find("li")[1]).show(); }else{ $($("#Storage").find("li")[1]).hide(); } loginReady(); }else{ $($("#Storage").find("li")[1]).hide(); loginReady(); } } function uaMatch(ua) { var rMsie = /(msie\s|trident.*rv:)([\w.]+)/, rFirefox = /(firefox)\/([\w.]+)/, rOpera = /(opera).+version\/([\w.]+)/, rChrome = /(chrome)\/([\w.]+)/, rSafari = /version\/([\w.]+).*(safari)/; var match = rMsie.exec(ua); if (match != null) { return {browser: "IE", version: match[2] || "0"}; } match = rFirefox.exec(ua); if (match != null) { return {browser: match[1] || "", version: match[2] || "0"}; } match = rOpera.exec(ua); if (match != null) { return {browser: match[1] || "", version: match[2] || "0"}; } match = rChrome.exec(ua); if (match != null) { return {browser: match[1] || "", version: match[2] || "0"}; } match = rSafari.exec(ua); if (match != null) { return {browser: match[2] || "", version: match[1] || "0"}; } if (match == null) { return {browser: "", version: "0"}; } } function IsIE() { var browserMatch; if (navigator.userAgent.indexOf('IE') < 0) { if (navigator.platform != "Win32") { return 0; } browserMatch = uaMatch(navigator.userAgent.toLowerCase()); if (browserMatch.browser != "IE") { return -1; } }else{ browserMatch = uaMatch(navigator.userAgent.toLowerCase()); } browseVer = parseInt(browserMatch.version); return 1; } function DetectActiveX() { try { var comActiveX = new ActiveXObject("WEB.WebCtrl.APS.CGI"); comActiveX = null; } catch (e) { return false; } return true; } function DetectExtension() { var len = navigator.mimeTypes.length; for (var i = 0; i < len; i++) { if (navigator.mimeTypes[i].type.toLowerCase() == "application/npaps-plugin") { return true; } } return false; } function ShowPSWD(el) { if(browseVer >= 10){ var domInput = $(el).parent().find("input")[0]; if (domInput.type == "password") { domInput.type = "text"; $(el).addClass("other"); } else { domInput.type = "password"; $(el).removeClass("other"); } } } function ExclusivePanel(el) { var Panels = $(".panel.catg-widget").children("a"); for (var i = 0; i < Panels.length; i++) { if (el != Panels[i]) { $(Panels[i]).addClass("collapsed"); $(Panels[i]).next().removeClass("in"); } } $(".tab-list")[0].style.display = "none"; $(".tab-list")[0].style.display = ""; /* var head = document.getElementsByTagName('head')[0], style = document.createElement('style'); style.type ='text/css'; style.styleSheet.cssText = ':after{content:none !important}'; head.appendChild(style); setTimeout(function(){ head.removeChild(style); },0); */ } function MyAlert(msg) { var tip; if(msg.search("ioe_") != -1){ tip = g_main_i18n.getValue(msg); } else { tip = msg; } var tipStr = '
' + tip + '
'; $("body").prepend(tipStr); setTimeout('$("#cgiTip").remove();', 2500); } function OnOKModal() { if (!pwdTest($("#NewPassword")[0].value)) { MyAlert(g_main_i18n.getValue("ioe_Password_Invalid")); return; } if ($("#NewPassword")[0].value != $("#ConfirmPassword")[0].value) { MyAlert(g_main_i18n.getValue("ioe_Password_Different")); return; } var cmdid = "usermanage"; var cmddata = { "PassWord": pwdMD5, "UserName": usrn, "Name": "MODIFYPASSWORD", "EncryptType": "MD5", "NewPassWord": hex_md5($("#NewPassword")[0].value), "OldPassWord": ocx.NotAgain(0, pswd), "OldUserName": usrn }; Communicate(cmdid, cmddata, CallBackChangePassword); } function CallBackChangePassword() { var result; try { result = CheckResponse.apply(this); if (result == "") return; } catch (e) { MyAlert(e.message); return; } if(result.Ret == 100) { var cmdid = "getconfig"; var string = "CPPLUS_"; var pwdMD = string + hex_md5($("#NewPassword")[0].value); var cmddata = { "Name": "System.ExUserMap", "PassWord": pwdMD, "UserName": usrn }; Communicate(cmdid, cmddata, CallBackGetExUserMap); } } function CallBackGetExUserMap(){ var result; try { result = CheckResponse.apply(this); if (result == "") return; } catch (e) { MyAlert(e.message); return; } if(result.Ret == 100){ var psw = ocx.NotAgain(2001,$("#NewPassword")[0].value); var fname = "System.ExUserMap"; for(var i = 0;i < result[fname].UserNum;i ++){ if(result[fname].User[i].Name == usrn){ result[fname].User[i].Password = psw; } } var string = "CPPLUS_"; var pwdMD = string + hex_md5($("#NewPassword")[0].value); var cmdid = "setconfig"; result.UserName = usrn; result.PassWord = pwdMD; Communicate(cmdid, result, CallBackExUserMap); } } function CallBackExUserMap(){ var result; try { result = CheckResponse.apply(this); if (result == "") return; } catch (e) { MyAlert(e.message); return; } if(result.Ret == 100){ MyAlert(g_main_i18n.getValue("ioe_Password_Successful")); pswd = $("#NewPassword")[0].value; pwdMD5 = hex_md5($("#NewPassword")[0].value); if ($("#NotAgain")[0].checked) { ocx.NotAgain(2, "a"); } $($("#ChangePassModal").find(".modal-footer button")[1]).click(); } } function GoAddDev() { $("#postlogin")[0].style.display = "none"; $("#playbackf")[0].style.display = "none"; $("#alarmsf")[0].style.display = "none"; $("#infof")[0].style.display = "none"; $("#settingsf")[0].style.display = ""; ActivateNav(3); if ($("#sf")[0].src.indexOf("add-device.html") < 0) { var els = $("#Camera").find("li"); $(els[0]).find("a").click(); } } function OnCancelModal() { return; if ($("#NotAgain")[0].checked) { ocx.NotAgain(2, "a"); } GetHP(); } function switch_ifram(id) { $(".navbar-nav li").removeClass('active'); $(id).parent().addClass('active') } function adjustLayout(nDevType) { if (nDevType == 2) { //$($(".pull-right").find("li")[1]).hide(); $($("#Camera").find("li")[4]).hide(); //$($("#Storage").find("li")[1]).hide(); $($("#System").find("li")[1]).hide(); frames["nff"].HideInstantRecord(false); } else{ $($("#Camera").find("li")[5]).hide(); $($("#Camera").find("li")[6]).hide(); } } function ShowFade(show){ if(show){ fade.style.display='block'; }else{ fade.style.display='none'; } } function OprWaitTip(nType, msg){ if(nType === 0){ $("#WaitTipId").remove(); ShowFade(false); }else if(nType === 1){ var tip; if(msg.search("ioe_") != -1){ tip = g_main_i18n.getValue(msg); } else { tip = msg; } var tipStr = '
' + tip + '
'; $("body").prepend(tipStr); ShowFade(true); } } function translateMsg(msg){ var tip; if(msg.search("ioe_") != -1){ tip = g_main_i18n.getValue(msg); } else { tip = msg; } return tip; } function GetLanguage(lang) { var language; switch (lang) { case "English": language = "en"; break; case "SimpChinese": language = "zh"; break; case "TradChinese": case "Italian": case "Spanish": case "Japanese": case "Russian": case "French": case "German": case "Portugal": case "Turkey": case "Poland": case "Romanian": case "Hungarian": case "Finnish": case "Korean": case "Farsi": case "Thai": case "Greek": case "Vietnamese": case "Brazilian": case "Hebrew": case "Indonesian": case "Arabic": case "Swedish": case "Czech": case "Bulgarian": case "Azerbaycan": case "Dutch": case "Serbian": case "Croatian": case "Azerbaycan": language = "en"; break; default: language = "en"; break; } return language; } function getCookie(cname){ var name = cname + "="; var ca = document.cookie.split(';'); var len = ca.length; for(var i=0; i < len; i++) { var c = $.trim(ca[i]); if (c.indexOf(name)==0) { return c.substring(name.length,c.length); } } return ""; } function setCookie(cname,cvalue){ document.cookie = cname+"="+cvalue+";"; } function getLocation() { var cmdid = 'getconfig'; var cmddata = { "PassWord": pwdMD5, "UserName": usrn, "Name" : "General.Location" }; Communicate(cmdid, cmddata, CallBackLocation); } function CallBackLocation() { var result; try { result = CheckResponse.apply(this); if (result == "") return; }catch (e) { MyAlert(e.message); g_bLogin = false; return; } Language = result["General.Location"].Language; GetEssentialParams(); } function UpdateLoginId() { if(null != frames["npf"].pbocx) frames["npf"].pbocx.SetNewLoginId(ocx.GetLoginHandle(), 0); }