// not animated collapse/expand function togglePannelStatus(content) { var expand = (content.style.display == "none"); content.style.display = (expand ? "block" : "none"); toggleChevronIcon(content); expand = null; } // current animated collapsible panel content var currentContent = null; function togglePannelAnimatedStatus(content, interval, step) { // wait for another animated expand/collapse action to end content=document.getElementById("divStickyToolbarContent"); if (currentContent == null) { currentContent = content; var divAnimation = document.getElementById("divMainAnimation"); divAnimation.style.bottom = "20px"; var expand = (content.style.display == "none"); if (expand) { content.style.display = "block"; if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)) { divAnimation.style.bottom = "330px"; } else { divAnimation.style.bottom = "353px"; } } var max_height = content.offsetHeight; var step_height = step + (expand ? 0 : -max_height); toggleChevronIcon(content); // schedule first animated collapse/expand event content.style.height = Math.abs(step_height) + "px"; setTimeout("togglePannelAnimatingStatus(" + interval + "," + step + "," + max_height + "," + step_height + ")", interval); expand = null; divAnimation = null; max_height = null; step_height = null; } } function togglePannelAnimatingStatus(interval, step, max_height, step_height) { var step_height_abs = Math.abs(step_height); // schedule next animated collapse/expand event if (step_height_abs >= step && step_height_abs <= (max_height - step)) { step_height += step; currentContent.style.height = Math.abs(step_height) + "px"; setTimeout("togglePannelAnimatingStatus(" + interval + "," + step + "," + max_height + "," + step_height + ")", interval); } // animated expand/collapse done else { if (step_height_abs < step) currentContent.style.display = "none"; currentContent.style.height = ""; currentContent = null; } step_height_abs = null; } // change chevron icon into either collapse or expand function toggleChevronIcon(content) { // var chevron = content.parentNode.firstChild.childNodes[1].childNodes[0]; var chevron = document.getElementById("imgExpendCollapse") var expand = (chevron.src.indexOf("expand.png") > 0); chevron.src = chevron.src .split(expand ? "expand.png" : "collapse.png") .join(expand ? "collapse.png" : "expand.png"); chevron = null; expand = null; } function GoogleAnalyticalTracker() { var GoogleAnalyticsKey = null; GoogleAnalyticsKey = "<%=ConfigurationManager.AppSettings.Get('GoogleAnalyticsKey') %>"; if (GoogleAnalyticsKey != "") { var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); try { var pageTracker = _gat._getTracker(GoogleAnalyticsKey); pageTracker._trackPageview(); } catch (err) { } } } function ScrollOnDivMessageHistory(dvMessageHistory) { var divMessageHistory = null; divMessageHistory = document.getElementById(dvMessageHistory); divMessageHistory.scrollTop = divMessageHistory.scrollHeight; } function DeleteFlyke(hidd, button, val) { document.getElementById(hidd).value = val; __doPostBack(button, ''); return true; } function mouseover() { document.body.style.cursor = 'pointer'; } function mouseout() { document.body.style.cursor = 'default'; } function SetScrollingVariable() { document.getElementById('ctl00_ctl00_hidScrollUp').value = "1"; } function scrollPageToTop() { if (document.getElementById('ctl00_ctl00_hidScrollUp').value == "1") { document.getElementById('ctl00_ctl00_hidScrollUp').value = "0"; window.scroll(0, document.body.scrollTop); } } function load(hiddenDebugMode) { Sys.WebForms.PageRequestManager.getInstance().add_endRequest(scrollPageToTop); setTimeout("LoadToolBar('"+hiddenDebugMode +"')", 1); } function LoadToolBar(hiddenDebugMode) { if (document.getElementById(hiddenDebugMode).value == "1") { document.getElementById("divMainToolbar").style.visibility = "visible"; } else { document.getElementById("divMainToolbar").style.visibility = "hidden"; } } function Resize(hiddenDebugMode) { document.getElementById("divMainToolbar").style.visibility = "hidden"; document.getElementById("divMainToolbar").style.bottom = "0px"; setTimeout("LoadToolBar('" + hiddenDebugMode + "')", 200); } function MessagePrint() { var prtContent = document.getElementById('ctl00_ctl00_Base_Body1_Body1_StickyToolBarDetail_ucStickyToolbarDetail1_ucStickyToolbarAktivForesporsler1_gvMessageHistory'); var WinPrint = window.open('', 'StickyToolbar', 'left=0, top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0'); window.focus(); WinPrint.document.write('
'); WinPrint.document.write(prtContent.innerHTML); WinPrint.document.close(); WinPrint.resizeTo(0, 0); WinPrint.print(); WinPrint.close(); } var reqTBar=""; function InitializeToolbarCompanyList() { try { reqTBar = null; reqTBar = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { reqTBar = null; reqTBar = new ActiveXObject("Microsoft.XMLHTTP"); } catch (oc) { reqTBar = ""; } } if (!reqTBar && typeof XMLHttpRequest != "undefined") { reqTBar = null; reqTBar = new XMLHttpRequest(); } } function BindToolbarCompanyList(CompanyInfo, flag) { InitializeToolbarCompanyList(); CompanyInfo = CompanyInfo.replace("&", "%26"); var url = null; url = "getCustomerList.aspx?CompanyInfo=" + CompanyInfo + "&isDeleted=" + flag; if (reqTBar != null) { reqTBar.onreadystatechange = ProcessToolbarCompanyList; //encode(url) used for change the special char reqTBar.open("GET", encodeURI(url), true); reqTBar.send(null); } } function ShowMovingImg() { document.getElementById("divMainAnimation").style.visibility = "visible"; if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)) { setTimeout("HideMovingImg()", 700); } else { setTimeout("HideMovingImg()", 1000); } } function HideMovingImg() { document.getElementById("divMainAnimation").style.visibility = "hidden"; } function ProcessToolbarCompanyList() { if (document.getElementById('dvStickyToolbar') != null) document.getElementById('dvStickyToolbar').innerHTML = ""; if (reqTBar.readyState == 4) { if (document.getElementById('dvStickyToolbar') != null) document.getElementById('dvStickyToolbar').innerHTML = ""; if (reqTBar.status == 200) { if (reqTBar.responseText == "") { if (document.getElementById('dvStickyToolbar') != null) document.getElementById('dvStickyToolbar').innerHTML = "Ingen poster å vise."; } else { var myString = new String(reqTBar.responseText); var myStringList = myString.split('§'); if (document.getElementById('dvStickyToolbar') != null) document.getElementById('dvStickyToolbar').innerHTML = myStringList[0]; var lblAntallbedrifter= document.getElementById('ctl00_ctl00_Base_Body1_Body1_StickyToolBarHeader_ucStickyToolbarHeader1_lblAntallbedrifter'); if (myStringList[1] > 0) { if (lblAntallbedrifter != null) { lblAntallbedrifter.innerHTML = myStringList[1]; } } else { if (lblAntallbedrifter != null) { lblAntallbedrifter.innerHTML = "0"; } } if (myStringList[2] == "New") { ShowMovingImg(); } myString = null; myStringList = null; } } else { if (document.getElementById('dvStickyToolbar') != null) document.getElementById('dvStickyToolbar').innerHTML = ""; } } } function DeleteSelectCompany(CompanyInfo) { //code for remove selected item from company list BindToolbarCompanyList(CompanyInfo, true); } var reqResponseTime=""; function InitializeResponseTime() { try { reqResponseTime = null; reqResponseTime = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { reqResponseTime = null; reqResponseTime = new ActiveXObject("Microsoft.XMLHTTP"); } catch (oc) { reqResponseTime = null; } } if (!reqResponseTime && typeof XMLHttpRequest != "undefined") { reqResponseTime = null; reqResponseTime = new XMLHttpRequest(); } } function SendQuery(days, hours, minutes) { InitializeResponseTime(); var url = null; url = "getrules.aspx?DAYS=" + days + "&HOURS=" + hours + "&MINUTES=" + minutes; if (reqResponseTime != null) { reqResponseTime.onreadystatechange = ProcessResponseTime; reqResponseTime.open("GET", encodeURI(url), true); reqResponseTime.send(null); } } function ProcessResponseTime() { if (reqResponseTime.readyState == 4) { var lblInnen = document.getElementById('ctl00_ctl00_Base_Body1_Body1_StickyToolBarDetail_ucStickyToolbarDetail1_ucStickyToolbarNyForesporsler1_lblInnen'); if (reqResponseTime.status == 200) { if (reqResponseTime.responseText == "") { if (lblInnen != null) { lblInnen.innerHTML = ""; } } else { var myString = null; myString= new String(reqResponseTime.responseText); var myStringList = null; myStringList = myString.split('|'); myString = null; if (lblInnen != null) lblInnen.innerHTML = myStringList[0]; var chkSMS = document.getElementById('ctl00_ctl00_Base_Body1_Body1_StickyToolBarDetail_ucStickyToolbarDetail1_ucStickyToolbarNyForesporsler1_chkSMS'); var chkEmail = document.getElementById('ctl00_ctl00_Base_Body1_Body1_StickyToolBarDetail_ucStickyToolbarDetail1_ucStickyToolbarNyForesporsler1_chkEmail'); var chkWebPage = document.getElementById('ctl00_ctl00_Base_Body1_Body1_StickyToolBarDetail_ucStickyToolbarDetail1_ucStickyToolbarNyForesporsler1_chkWebPage'); chkSMS.disabled = false; chkWebPage.disabled = false; chkEmail.disabled = false; chkSMS.checked = false; chkWebPage.checked = false; chkEmail.checked = false if ((myStringList[1] == 'SMS,EMAIL,WEB') || (myStringList[1] == 'SMS,WEB,EMAIL') || (myStringList[1] == 'EMAIL,WEB,SMS') || (myStringList[1] == 'EMAIL,SMS,WEB') || (myStringList[1] == 'WEB,SMS,EMAIL') || (myStringList[1] == 'WEB,EMAIL,SMS')) { chkEmail.disabled = true; chkSMS.disabled = true; chkWebPage.disabled = true; if (myStringList[2] == "SMS") { chkSMS.checked = true; chkSMS.disabled = false; } else if (myStringList[2] == "EMAIL") { chkEmail.checked = true; chkEmail.disabled = false; } else if (myStringList[2] == "WEB") { chkWebPage.checked = true; chkWebPage.disabled = false; } } else if ((myStringList[1] == 'SMS,EMAIL') || (myStringList[1] == 'EMAIL,SMS')) { chkEmail.disabled = true; chkSMS.disabled = true; if (myStringList[2] == "SMS") { chkSMS.checked = true; chkSMS.disabled = false; } else if (myStringList[2] == "EMAIL") { chkEmail.checked = true; chkEmail.disabled = false; } else if ((myStringList[2] == "SMS,EMAIL") || (myStringList[2] == "EMAIL,SMS")) { chkEmail.checked = true; chkSMS.checked = true; } } else if ((myStringList[1] == 'SMS,WEB') || (myStringList[1] == 'WEB,SMS')) { chkSMS.disabled = true; chkWebPage.disabled = true; if (myStringList[2] == "SMS") { chkSMS.checked = true; chkSMS.disabled = false; } else if (myStringList[2] == "WEB") { chkWebPage.checked = true; chkWebPage.disabled = false; } else if ((myStringList[2] == "SMS,WEB") || (myStringList[2] == "WEB,SMS")) { chkSMS.checked = true; chkWebPage.checked = true; } } else if ((myStringList[1] == 'EMAIL,WEB') || (myStringList[1] == 'WEB,EMAIL')) { chkWebPage.disabled = true; chkEmail.disabled = true; if (myStringList[2] == "EMAIL") { chkEmail.checked = true; chkWebPage.disabled = false; } else if (myStringList[2] == "WEB") { chkWebPage.checked = true; chkEmail.disabled = false; } else if ((myStringList[2] == "EMAIL,WEB") || (myStringList[2] == "WEB,EMAIL")) { chkEmail.checked = true; chkWebPage.checked = true; } } else if (myStringList[1] == 'SMS') { chkSMS.disabled = false; chkSMS.checked = true; } else if (myStringList[1] == 'EMAIL') { chkEmail.disabled = false; chkEmail.checked = true; } else if (myStringList[1] == 'WEB') { chkWebPage.disabled = false; chkWebPage.checked = true; } else { chkSMS.disabled = false; chkWebPage.disabled = false; chkEmail.disabled = false; chkSMS.checked = true; chkWebPage.checked = true; chkEmail.checked = true; } } EnableDisableEmail(chkEmail); myStringList = null; } else { lblInnen.innerHTML = ""; } } } function EnableDisableEmail(chkEmail) { // var chkEmail =document.getElementById('ctl00_ctl00_Base_Body1_Body1_StickyToolBarDetail_ucStickyToolbarDetail1_ucStickyToolbarNyForesporsler1_chkEmail'); var txtEmail = document.getElementById('ctl00_ctl00_Base_Body1_Body1_StickyToolBarDetail_ucStickyToolbarDetail1_ucStickyToolbarNyForesporsler1_txtEmail'); var dvemail = document.getElementById("dvstickyemail"); if (chkEmail.checked) { dvemail.className = "float-left stickytxtemail"; txtEmail.disabled = false; } else { dvemail.className = "float-left stickytxtemailgray"; txtEmail.disabled = true; } } function ConfirmForespørselDeletion() { var confirmMsg = null; confirmMsg = document.getElementById('ctl00_ctl00_Base_Body1_Body1_StickyToolBarDetail_ucStickyToolbarDetail1_ucStickyToolbarNavigator1_hdnConfirmDeleteRequest').value; if (confirm(confirmMsg)) { return true; } else { return false; } } function ConfirmForespørselStop() { var confirmMsg = null; confirmMsg = document.getElementById('ctl00_ctl00_Base_Body1_Body1_StickyToolBarDetail_ucStickyToolbarDetail1_ucStickyToolbarNavigator1_hdnConfirmStopRequest').value; if (confirm(confirmMsg)) { return true; } else { return false; } } function ConfirmCompanyDelete() { var confirmMsg = null; confirmMsg = document.getElementById('ctl00_ctl00_Base_Body1_Body1_StickyToolBarDetail_ucStickyToolbarDetail1_ucStickyToolbarNavigator1_hdnConfirmDeleteComapny').value; if (confirm(confirmMsg)) { return true; } else { return false; } } /* Result Page */ function setMapPosition() { var scrollpos = getScrollPosition(); if (scrollpos > 150) { if (typeof window.pageYOffset != "undefined") { var a = 'margin-top:' + Number(scrollpos - 80) + 'px'; document.getElementById('dvRightSideMap').setAttribute('style', a); } else { document.getElementById('dvRightSideMap').style.marginTop = scrollpos - 80; } } } function getScrollPosition() { var scroll = 0; if (typeof window.pageYOffset != "undefined") { scroll = window.pageYOffset; } else if (typeof document.documentElement.scrollTop != "undefined") { scroll = document.documentElement.scrollTop; } else { scroll = document.body.scrollTop; } return scroll; } function setPreMapPosition() { //document.getElementById('myRightSideBox').style.marginTop = 0; } function AdjustMap() { var scrollpos = getScrollPosition(); if (scrollpos < saveScrollpos) { saveScrollpos = scrollpos; if (document.getElementById('dvRightSideMap') != null) { document.getElementById('dvRightSideMap').style.margin = 0 + 'px'; } } else saveScrollpos = scrollpos; } window.setInterval('AdjustMap()', 250); var saveScrollpos = getScrollPosition(); /* End Result Page*/ /* Start Result Detail Page */ function fillCompanyList(sender, eventArgs) { var txtCompanyId = document.getElementById('ctl00_ctl00_Base_Body1_Body1_ContentPlaceHolderTop_ucPageSearchResult1_ucBoxPageDeatails1_DetailInfo_txtCompanyId').value; var txtCustomerId = document.getElementById('ctl00_ctl00_Base_Body1_Body1_ContentPlaceHolderTop_ucPageSearchResult1_ucBoxPageDeatails1_DetailInfo_txtCustomerId').value; var txtCompanyName = document.getElementById('ctl00_ctl00_Base_Body1_Body1_ContentPlaceHolderTop_ucPageSearchResult1_ucBoxPageDeatails1_DetailInfo_txtCompanyName').value; var txtCompanyABStatus = document.getElementById('ctl00_ctl00_Base_Body1_Body1_ContentPlaceHolderTop_ucPageSearchResult1_ucBoxPageDeatails1_DetailInfo_txtCompanyABStatus').value; var txtCompanyEmail = document.getElementById('ctl00_ctl00_Base_Body1_Body1_ContentPlaceHolderTop_ucPageSearchResult1_ucBoxPageDeatails1_DetailInfo_txtCompanyEmail').value; var txtCompanyABID = document.getElementById('ctl00_ctl00_Base_Body1_Body1_ContentPlaceHolderTop_ucPageSearchResult1_ucBoxPageDeatails1_DetailInfo_txtCompanyABID').value; BindToolbarCompanyList(txtCompanyABID + '|' + txtCustomerId + '|' + txtCompanyName + '|' + txtCompanyABStatus + '|' + txtCompanyEmail, false); } function AddCompanyToolBarShow() { fillCompanyList(); var divAnimationContainer = document.getElementById("myDiv"); togglePannelAnimatedStatus(divAnimationContainer.nextSibling, 5, 50); FocusOnSubject(); } /* End Result Page Detail*/