var mapStyle = [ { "featureType": "administrative", "elementType": "geometry", "stylers": [ { "visibility": "off" } ] }, { "featureType": "poi", "stylers": [ { "visibility": "off" } ] }, { "featureType": "road", "elementType": "labels.icon", "stylers": [ { "visibility": "off" } ] }, { "featureType": "transit", "stylers": [ { "visibility": "off" } ] } ]; var silver = [ { elementType: "geometry", stylers: [{ color: "#f5f5f5" }], }, { elementType: "labels.icon", stylers: [{ visibility: "off" }], }, { elementType: "labels.text.fill", stylers: [{ color: "#616161" }], }, { elementType: "labels.text.stroke", stylers: [{ color: "#f5f5f5" }], }, { featureType: "administrative.land_parcel", elementType: "labels.text.fill", stylers: [{ color: "#bdbdbd" }], }, { featureType: "poi", elementType: "geometry", stylers: [{ color: "#eeeeee" }], }, { featureType: "poi", elementType: "labels.text.fill", stylers: [{ color: "#757575" }], }, { featureType: "poi.park", elementType: "geometry", stylers: [{ color: "#e5e5e5" }], }, { featureType: "poi.park", elementType: "labels.text.fill", stylers: [{ color: "#9e9e9e" }], }, { featureType: "road", elementType: "geometry", stylers: [{ color: "#ffffff" }], }, { featureType: "road.arterial", elementType: "labels.text.fill", stylers: [{ color: "#757575" }], }, { featureType: "road.highway", elementType: "geometry", stylers: [{ color: "#dadada" }], }, { featureType: "road.highway", elementType: "labels.text.fill", stylers: [{ color: "#616161" }], }, { featureType: "road.local", elementType: "labels.text.fill", stylers: [{ color: "#9e9e9e" }], }, { featureType: "transit.line", elementType: "geometry", stylers: [{ color: "#e5e5e5" }], }, { featureType: "transit.station", elementType: "geometry", stylers: [{ color: "#eeeeee" }], }, { featureType: "water", elementType: "geometry", stylers: [{ color: "#c9c9c9" }], }, { featureType: "water", elementType: "labels.text.fill", stylers: [{ color: "#9e9e9e" }], }, ]; var mql = new Object(); $(document).ready(function () { if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { mql.matches = true; } else { const ua = window.navigator.userAgent.toLowerCase(); if (ua.indexOf('macintosh') > -1 && ('ontouchend' in document)) { mql.matches = true; } else { mql.matches = false; } } }); function MakeSyncWebCall(URL, parameters, method) { var varResp = null; var options = { type: method, dataType: 'json', data: parameters, contentType: 'application/json; charset=utf-8', url: URL, success: function (resp) { if (resp != null && resp != undefined) { if (resp.hasOwnProperty("d")) { varResp = resp.d; } else { varResp = resp; } } }, error: function (xhr, status, e) { }, cache: false, async: false, crossDomain: true }; $.ajax(options); return varResp; } function getParameterByName(name) { name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); var regex = new RegExp("[\\?&]" + name + "=([^#]*)"); results = regex.exec(location.search); return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); } function inIframe() { try { return window.self !== window.top; } catch (e) { return true; } } function validateEmail(email) { var regex = /^([a-zA-Z0-9_.-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/; return regex.test(email); } function returnQueryString(findKey) { var querystring = ""; if (typeof (findKey) == "undefined") findKey = ""; //var sRestrictkeys = "panobankguid,panoguid" var url = window.location.search; if (url != "") { url = url.substring(1, url.length); var urlarray = url.split('&'); if (urlarray.length > 0) { for (var i = 0; i < urlarray.length; i++) { var key = urlarray[i].split('=')[0]; if (key.toLowerCase() == findKey.toLowerCase()) { querystring = urlarray[i].split('=')[1]; } } } } return querystring; } function getQuerystring(sRestrictkeys) { var querystring = ""; //var sRestrictkeys = "panobankguid,panoguid,title"; var url = window.location.search; if (url != '') { url = url.substring(1, url.length); var urlarray = url.split('&'); if (urlarray.length > 0) { for (var i = 0; i < urlarray.length; i++) { var key = urlarray[i].split('=')[0]; if (sRestrictkeys.indexOf(key) < 0) { querystring = querystring + urlarray[i] + "&"; } } } } return querystring; } function getUrlVars() { var vars = [], hash; var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); for (var i = 0; i < hashes.length; i++) { hash = hashes[i].split('='); vars.push(hash[0]); vars[hash[0]] = hash[1]; } return vars; } function updateRadar() { if ((!activeNodeLatLng) || (!pano) || (!map)) return; var d2r = Math.PI / 180; var r2d = 180 / Math.PI; var fov = pano.getFov(); var pan = pano.getPanNorth(); var zoom = map.getZoom(); var gps = pano.getNodeLatLng(""); if ((gps.length >= 2) && ((gps[0] != 0) || (gps[1] != 0))) { if (zoom < 6) zoom = 6; // avoid large radar beams on world map if ((fov == lastFov) && (pan == lastPan) && (zoom == lastZoom) && (gps[0] == activeNodeLatLng.lat()) && (gps[1] == activeNodeLatLng.lng())) return; // nothing to do lastPan = pan; lastFov = fov; lastZoom = zoom; activeNodeLatLng = new google.maps.LatLng(gps[0], gps[1]); var rLat = 4.0 * r2d / Math.pow(2, zoom); // beam size var rLng = rLat / Math.cos(activeNodeLatLng.lat() * d2r); // generate radar fan for fov var radar_poly = new Array(); radar_poly.push(activeNodeLatLng); var segments = 5; for (i = -segments; i <= segments; i++) { var angle = (fov / (2 * segments)) * i; var x = -rLng * Math.sin((pan + angle) * d2r) + activeNodeLatLng.lng(); var y = rLat * Math.cos((pan + angle) * d2r) + activeNodeLatLng.lat(); radar_poly.push(new google.maps.LatLng(y, x)); } // clear old radar if (radar) { radar.setMap(null); radar = null; } // show radar radar = new google.maps.Polygon({ paths: radar_poly, strokeColor: "#000000", strokeOpacity: 0.8, strokeWeight: 1, fillColor: "#000000", fillOpacity: 0.35 }); radar.setMap(map); } else { // clear radar if (radar) { activeNodeLatLng = new google.maps.LatLng(0, 0); radar.setMap(null); radar = null; } } } function createShortUrl(emailShareUrl, addclientpath) { var shortUrl = ''; var url = "api/panorama/getshorturl?url=" + encodeURIComponent(emailShareUrl); if (addclientpath != undefined) { url = url + "&addclientpath=" + addclientpath; } var response = MakeSyncWebCall(url, "{}", "get"); if (response.length > 0) { shortUrl = response; } return shortUrl; } function createVideoShortUrl(longurl, addclientpath) { var shortUrl = ''; var url = "api/video/shorturl?url=" + encodeURIComponent(longurl); if (addclientpath != undefined) { url += url + "&addclientpath=" + addclientpath; } var response = MakeSyncWebCall(url, "{}", "get"); if (response.length > 0) { shortUrl = response; } return shortUrl; } function createShortUrlforSubFolder(emailShareUrl) { var shortUrl = ''; var url = "../api/panorama/getshorturl?url=" + encodeURIComponent(emailShareUrl); var response = MakeSyncWebCall(url, "{}", "get"); if (response.length > 0) { shortUrl = response; } return shortUrl; } function PostOnWall() { $("#pShare").hide(); $("#imgprogress").show(); FB.api("/me/photos", "POST", { "message": $("#txlText").val(), "url": $("#hdAttachmentUrl").val(), "allow_spherical_photo": true, }, function (response) { if (response && !response.error) { $("#lblError").show(); $("#lblError").text(response.error); $("#divShareText").modal('hide'); $("#pShare").show(); } if (response.error) { $("#imgprogress").hide(); $("#lblError").show(); $("#lblError").text(response.error.message); $("#pShare").show(); $("#divShareText").modal('show'); } $("#imgprogress").hide(); } ); } function popupwindow(url, title, w, h) { var left = (screen.width / 2) - (w / 2); var top = (screen.height / 2) - (h / 2); return window.open(url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left); } //function validateEmail(email) { // var emailReg = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i); // //([\w-\.]+)@((?:[\w]+\.)+)([a-zA-Z]{2,4}) // var valid = emailReg.test(email); // if (!valid) { // return false; // } else { // return true; // } //} function SetGeoAddress(lat, lng, txtAddress) { var latlng = new google.maps.LatLng(lat, lng); var geocoder = new google.maps.Geocoder(); geocoder.geocode({ 'latLng': latlng }, function (results, status) { if (status == google.maps.GeocoderStatus.OK) { if (results[0]) { $('#' + txtAddress).val(results[0].formatted_address); } } }); } function getdropdownImage(category) { var image = ""; $.each($('#ddCategories li'), function (index, data) { if ($(data).find("input").val() == category) { image = $(data).find("img").prop('src'); } }); return image; } function setDateTimeFormat(newDate) { var d = new Date(newDate); var day = d.getDate(); var month = d.getMonth() + 1; var year = d.getFullYear(); var hr = d.getHours(); var min = d.getMinutes(); if (day < 10) { day = "0" + day; } if (month < 10) { month = "0" + month; } return (month + "-" + day + "-" + year); } //function setDateTimeFormat(newDate) { // var d = new Date(newDate); // var day = d.getDate(); // var month = d.getMonth() + 1; // var year = d.getFullYear(); // var hr = d.getHours(); // var min = d.getMinutes(); // if (day < 10) { // day = "0" + day; // } // if (month < 10) { // month = "0" + month; // } // return (month + "-" + day + "-" + year + " " + hr + ":" + min); //} function validatePhone(txtPhone) { var arr = txtPhone.split(','); var isvalid = true; if (arr.length > 0) { $.each(arr, function (index, data) { var filter = /\(?([0-9]{3})\)?([ .-]?)([0-9]{3})\2([0-9]{4})/; if (!filter.test(data)) { isvalid = false; } }); } return isvalid; } function getImageBasePath(identifier) { var url = "api/panorama/config?identifier=" + identifier; return MakeSyncWebCall(url, "{}", "get"); } function getNewName(name, bAddDateTime) { var url = "api/video/hash?data=" + name + "&bAddDateTime=" + bAddDateTime; return MakeSyncWebCall(url, "{}", "get"); } function formatTime(time) { if (parseInt(time) < 10) { return '0' + time; } return time; } function getModalBackgroundCount() { var length = $('.modal-backdrop').length; length--; return length; } function getOrderPrice(type, photographerasid, companyid, ordermasterpricelistid, photographercompanyid, clientid) { var url = "api/order/pricelist?type=" + type + "&photographerasid=" + photographerasid + "&companyid=" + companyid + "&ordermasterpricelistid=" + ordermasterpricelistid + "&photographercompanyid=" + photographercompanyid + "&clientid=" + (clientid == undefined ? 0 : clientid); return MakeSyncWebCall(url, "{}", "get"); } function getPricelistSettings(clientid, photographerasid, companyid, ordermasterid,asid) {//ordermasterpricelistid //var url = "api/orderlanding/orderpricelistimagesettings?orderpricelistmasterid=" + ordermasterpricelistid + "&clientid=" + clientid + "&photographerasid=" + photographerasid + "&companyid=" + companyid + "&ordermasterid=" + ordermasterid; var url = "api/orderlanding/orderpricelistimagesettings?clientid=" + clientid + "&photographerasid=" + photographerasid + "&companyid=" + companyid + "&ordermasterid=" + ordermasterid+"&asid="+asid; return MakeSyncWebCall(url, "{}", "get"); } function dataURItoBlob(dataURI, type) { // convert base64 to raw binary data held in a string var byteString = atob(dataURI.split(',')[1]); // separate out the mime component var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0] // write the bytes of the string to an ArrayBuffer var ab = new ArrayBuffer(byteString.length); var ia = new Uint8Array(ab); for (var i = 0; i < byteString.length; i++) { ia[i] = byteString.charCodeAt(i); } // write the ArrayBuffer to a blob, and you're done var bb = new Blob([ab], { type: type }); return bb; } function getUniqueRealEstatechain(array) { return [...new Set(array.map(item => item.realestatechainname))]; } function setCustomMenu() { // whenever we hover over a menu item that has a submenu $('.custommenuitem').on('mouseover', function () { var $menuItem = $(this), $submenuWrapper = $('> .customsubmenu', $menuItem); // grab the menu item's position relative to its positioned parent var menuItemPos = $menuItem.position(); // place the submenu in the correct position relevant to the menu item $submenuWrapper.css({ top: menuItemPos.top, left: menuItemPos.left + Math.round($menuItem.outerWidth() * 0.75) }); }); } function getProductPrice(currency, producttype) { var url = "api/stripe/price?currency=" + currency + "&type=" + producttype; return MakeSyncWebCall(url, "{}", "get"); }