function doShowLogin() { $('html, body').animate({ scrollTop: 0 }, 'slow');doCloseSliders(doObject('oContainerLogin')); if(doObject('oContainerLogin').style.display=='none'){ $('#oContainerLogin').css('left',$(doObject('oLoginLink')).position().left-10); }; doToggleSlide('oContainerLogin'); } function doAjaxLogin() { var x = ''; $.post('/admin/login.asp', $('#oFormLogin :input').serialize(), function(x) { if (x == 'true') { window.parent.document.location.reload(); } else { $('#oFormLogin').hide(); $('#oLoginFailed').show(); setTimeout(function() { $('#oLoginFailed').hide(); $('#oFormLogin').show(); }, 5000); document.location = document.location; } } ); } function doShare(sURL,w,h) { window.open(sURL, 'sharer', 'toolbar=0,status=0,width='+w+',height='+h); return false; } function doTop() { $('html, body').animate({ scrollTop: 0 }, 'slow'); } function doToggleSlide(obj) { obj = doObject(obj); if(obj.style.display=='none') { $(obj).slideToggle('fast'); } else { $(obj).slideUp(500); setTimeout(function() { $(obj).stop(true, true).hide(); }, 400); } } function doToggleFader(obj) { obj = doObject(obj); var wp = $(window).width()/2-362; var hp = $(window).height()/2-212; if(obj.style.display=='none') { $(obj).css('left', wp); $(obj).css('top', hp); $('html, body').animate({ scrollTop: 0 }, 'slow'); $(obj).fadeIn("slow"); } else { $(obj).fadeOut("slow"); } } function doCloseSliders(obj) { if(obj==doObject('oContainerLogin')) { if(doObject('oContainerMyAccount').style.display!='none') { doToggleSlide(doObject('oContainerMyAccount')); } } if(obj==doObject('oContainerMyAccount')) { if(doObject('oContainerLogin').style.display!='none') { doToggleSlide(doObject('oContainerLogin')); } } } function doShadowBox(sTemp,sTitle,iWidth,iHeight) { if(!iWidth) { var iWidth = 600; } if(!iHeight) { var iHeight = 450; } if(!Shadowbox.isOpen()) { Shadowbox.open({ content: '
' + sTemp + '
', player: "html", title: '' + '   ' + sTitle + '', height: iHeight, width: iWidth}); } else { doObject('oShadowBox').innerHTML = sTemp; doObject('oShadowboxTitle').innerHTML = '   ' + sTitle; } } function doShadowBoxAjax(sURL,sTitle) { var sTemp = doAjaxReturn(sURL); doShadowBox(sTemp,sTitle); } function doShadowBoxIFrame(sURL,sTitle,iWidth,iHeight) { if(!iWidth) { var iWidth = 900; } if(!iHeight) { var iHeight = 600; } if (top != self ) { doPopUp(sURL,iWidth,iHeight); } else { sTemp = ''; doShadowBox(sTemp,sTitle,iWidth+50,iHeight+50); } } function doSearchKeyUp(k) { if( ( doObject('sSearch').value.length > 2 || k == 8 ) && k != 40 && k!= 38 ) { doAjax('/ajax/search.asp?sSearch=' + doObject('sSearch').value, doObject('oContainerAjaxSearchResults')); doObject('oContainerAjaxSearchResults').style.display = 'inline'; } var v = parseInt( doObject('oCursorPos').value ); var s = $('div#oAjaxSearchResults').children('div').size() - 1; if(k == 13 && s > 0 ) { var h = $('div#oAjaxSearchResults').children('div').slice(v-1,v).find('a').attr('href'); if(s==1) { h = $('div#oAjaxSearchResults').find('a').attr('href'); } if (s==1 || v>0) { document.location = h; } } if(k==40 && v < s) { v = v + 1 ; doObject('oCursorPos').value = v; } if(k==38 && v > 1) { v = v - 1 ; doObject('oCursorPos').value = v; } $('div#oAjaxSearchResults').children('div').removeClass('ui-state-focal'); $('div#oAjaxSearchResults').children('div').slice(v-1,v).addClass('ui-state-focal'); } function doSearchBlur(v) { var obj = doObject('sSearch'); obj.value='City, Project, Builder: ?'; obj.style.backgroundColor='#FFFFFF'; $(doObject('oSearchButton')).attr('src','/icons/icon-search-34x24-fb-blue.png'); doObject('oContainerAjaxSearchResults').style.display='none'; doSearchResetCursor(); } function doSearchResetCursor() { doObject('oCursorPos').value = 0; } function doSetupDataTable() { $('#dataTableExample').dataTable({ "bPaginate": true, "bLengthChange": false, "bFilter": true, "bSort": true, "bInfo": true, "bAutoWidth": true, "bJQueryUI": true, "sDom": '<"top">rt<"bottom"iflp<"clear">>', "bStateSave": true, // "sPaginationType": "full_numbers", "aoColumns": [null,{ "sType": "html" },null,null,null,null,null,null,null] }); } function doPost(url,obj) { doObject(obj); $.post(url, $(obj).serialize(),function(x) {$(obj).html(x)}); } function doProvChange(obj) { if (doObject('oMapCanada')) { var str = '-' + obj.options[obj.selectedIndex].innerText; doObject("oMapCanada").src = '/files/images/maps/map-canada' + str + '.jpg'; } } function doShadowBoxReportChange(sURL) { doObject('oReportContent').innerHTML = doAjaxReturn(sURL); } function doFormatCurrency(v) { var a = doAjaxReturn('/frameworks/ajax/currency.asp?sValue='+v); return a; } function doLeft(str, n){ if (n <= 0) return ""; else if (n > String(str).length) return str; else return String(str).substring(0,n); } function doRight(str, n){ if (n <= 0) return ""; else if (n > String(str).length) return str; else { var iLen = String(str).length; return String(str).substring(iLen, iLen - n); } } function doTrim(str) { return String( str.replace(/^\s+|\s+$/g, '')); } function doSO(str) { if(typeof(str)=='object') { return(str); } else { return( document.getElementById( str ) ); } } function doObject(str) { if(typeof(str)=='object') { return(str); } else { return( document.getElementById( str ) ); } } function doAjaxToggleChecked(url,obj) { var objHTTP = false; if(navigator.appName == "Microsoft Internet Explorer") { objHTTP = new ActiveXObject("Microsoft.XMLHTTP"); } else { objHTTP = new XMLHttpRequest(); } if(objHTTP) { var obj = obj; objHTTP.open("GET",url); objHTTP.onreadystatechange = function() { if (objHTTP.readyState == 4 && objHTTP.status == 200) { if (objHTTP.responseText=='True') { obj.checked='checked'; } else { obj.checked=''; } alert('Process OK!'); } } objHTTP.send(null); } } function doMapLinkToggle(obj) { if (document.getElementById('bMap').value=='0') { document.getElementById('oMapLinkToggle').innerText='Hide'; document.getElementById('bMap').value='255'; } else { document.getElementById('oMapLinkToggle').innerText='Show'; document.getElementById('bMap').value='0'; } } function doToggleShow(objA,objB,sName) { if (objA.style.display=='none') { objA.style.display='block'; objB.src='/files/system/images/thread-hide.gif'; doAjaxCookieSet(sName,'Hide','11/12/2019'); } else { objA.style.display='none'; objB.src='/files/system/images/thread-show.gif'; doAjaxCookieSet(sName,'Show','11/12/2019'); } } function doToggle(obj) { if (obj.checked) { obj.checked = ''; } else { obj.checked = 'checked'; } } function doAutoCompleteCity(obj,key) { if (obj.value.length>3&&key>8) { doAjaxAutoComplete('/frameworks/ajax/autocomplete-city.asp?iProv='+doObject('iProv').value+'&sCityLike='+obj.value,obj.name); } } function doAjaxReload(url,obj) { if(XMLHttpRequestObject) { XMLHttpRequestObject.open('get',url); XMLHttpRequestObject.onreadystatechange = function() { if (XMLHttpRequestObject.readyState==4&&XMLHttpRequestObject.status==200) { obj.innerHTML = XMLHttpRequestObject.responseText; } } XMLHttpRequestObject.send(null); } } function doAjaxReturn(url) { if(XMLHttpRequestObject) { XMLHttpRequestObject.open('get',url,false); XMLHttpRequestObject.send(null); var str = XMLHttpRequestObject.responseText; return(str); } } // THIS FUNCTION IS SYNCHRONOUS - IT WAITS FOR SERVER RESPONSE!! function doAjaxCityName(iCity) { if(XMLHttpRequestObject) { XMLHttpRequestObject.open('get','/frameworks/ajax/get-city-name.asp?iCity='+iCity,false); XMLHttpRequestObject.send(null); var sCity = XMLHttpRequestObject.responseText; return(sCity); } } // THIS FUNCTION IS SYNCHRONOUS - IT WAITS FOR SERVER RESPONSE!! function doAjaxCityNearest(iLat,iLong) { if(XMLHttpRequestObject) { XMLHttpRequestObject.open('get','/frameworks/ajax/get-city-nearest.asp?iLat='+iLat+'&iLong='+iLong,false); XMLHttpRequestObject.send(null); var iCity = XMLHttpRequestObject.responseText; document.getElementById('iProvSearch').selectedIndex=doAjaxProvGet(iCity)-1; return(iCity); } } function doAjaxProvGet(iCity) { if(XMLHttpRequestObject) { XMLHttpRequestObject.open('get','/frameworks/ajax/get-province-by-city.asp?iCity='+iCity,false); XMLHttpRequestObject.send(null); return(XMLHttpRequestObject.responseText); } } function doAjaxDelete(tbl,id,sKey) { doAjaxReturn('/frameworks/ajax/tag-record-as-deleted.asp?tbl='+tbl+'&id='+id+'&sKey='+sKey); } function doAjaxDeleteRow(tbl,id,sKey) { if(XMLHttpRequestObject) { XMLHttpRequestObject.open('get','/frameworks/ajax/delete-record-by-row.asp?tbl='+tbl+'&id='+id+'&sKey='+sKey,false); XMLHttpRequestObject.send(null); } } function doAjaxDeleteNot(tbl,id,sKey) { if(XMLHttpRequestObject) { XMLHttpRequestObject.open('get','/frameworks/ajax/tag-record-as-deleted-not.asp?tbl='+tbl+'&id='+id+'&sKey='+sKey,false); XMLHttpRequestObject.send(null); } } function doAjaxTeamMemberAdd(sEmail,iSite) { if(XMLHttpRequestObject) { XMLHttpRequestObject.open('get','/frameworks/ajax/team-member-add.asp?sEmail='+sEmail+'&iSite='+iSite); XMLHttpRequestObject.onreadystatechange = function() { if (XMLHttpRequestObject.readyState==4&&XMLHttpRequestObject.status==200) { str = XMLHttpRequestObject.responseText; if(str.length>0) { alert(str); }else{ doAjaxReload('/admin/ajax-list-builder-team.asp?iSite='+iSite,doObject('oBuilderTeamList')); } } } XMLHttpRequestObject.send(null); } } function doAjaxTeamMemberCut(id,iSite) { if(XMLHttpRequestObject) { XMLHttpRequestObject.open('get','/frameworks/ajax/team-member-cut.asp?id='+id+'&iSite='+iSite,false); XMLHttpRequestObject.send(null); } } function doAjaxTeamMemberBuyApproval(b,skey) { if(XMLHttpRequestObject) { XMLHttpRequestObject.open('get','/frameworks/ajax/team-member-buy-approval.asp?sKey='+skey+'&bBuyOK='+b); XMLHttpRequestObject.send(null); } } function doAjaxTeamMemberSave(sname,semail,skey) { if(XMLHttpRequestObject) { XMLHttpRequestObject.open('get','/frameworks/ajax/team-member-save.asp?sName='+document.getElementById( sname ).value+'&sEmail='+document.getElementById( semail ).value+'&sKey='+skey); XMLHttpRequestObject.send(null); } } function doAjaxCookieClearSearch() { if(XMLHttpRequestObject) { XMLHttpRequestObject.open("get","/frameworks/ajax/cookie-clear-search.asp"); XMLHttpRequestObject.send(null); } } // SYNCHRONOUS function doSjaxCookieGet(sName) { if(XMLHttpRequestObject) { XMLHttpRequestObject.open('get','/frameworks/ajax/cookie-get.asp?sName='+sName); XMLHttpRequestObject.send(null); return( XMLHttpRequestObject.responseText ); } } function doAjaxCookieSet(sName,sValue,sExpiry) { if(!sExpiry) { sExpiry = '11/12/2019 1:58:50 PM' } if(XMLHttpRequestObject) { XMLHttpRequestObject.open('get','/frameworks/ajax/cookie-set.asp?sName='+sName+'&sValue='+sValue+'&sExpiry='+sExpiry); XMLHttpRequestObject.send(null); } } // Keep to be backwards compatible with old function function ConfirmDelete() { if (document.getElementById('bDeleted').checked) { if (window.confirm("Delete: Are you sure?")) { } else { document.getElementById('bDeleted').checked = false; } } } function doDeleteConfirm(obj) { if (obj.checked) { if (window.confirm("Delete: Are you sure?")) { return(true); } else { obj.checked = false; return(false); } } } function doConfirm(str) { if (window.confirm(str)) { return(true); } else { return(false); } } function doCheckLength(obj,req,msg) { obj = doObject(obj); if (obj.value.length < req) { obj.style.backgroundColor='#FCCCCC'; alert(msg); return(false); } else { obj.style.backgroundColor='#CCFCCC'; return(true); } } function doWindow(sURL) { oWindow = window.open (sURL, 'oWindow','location=0,status=0,scrollbars=1,width=640,height=500'); oWindow.moveTo(100,100); } function doWindowSized(sURL,x,y) { oWindow = window.open (sURL, 'oWindow','location=0,status=0,scrollbars=0,width='+x+',height='+y); oWindow.moveTo(100,100); } function doThread(obj1,obj2) { if (document.getElementById(obj1).style.display=='none') { document.getElementById(obj1).style.display='block'; obj2.src='/files/system/images/thread-hide.gif'; } else { document.getElementById(obj1).style.display='none'; obj2.src='/files/system/images/thread-show.gif'; } } function PopWindow(sURL,w,h) { doPopUp(sURL,w,h); } function doPopUp(sURL,iWidth,iHeight) { var iWidth = iWidth + 50; var iHeight = iHeight + 50; day = new Date(); id = day.getTime(); eval("page" + id + " = window.open(sURL, '" + id + "', 'toolbar=no,scrollbars=no,location=no,statusbar=no,menubar=no,resizable=yes,width='+iWidth+',height='+iHeight);"); } function doStart() { if(top == self && self.location.href.indexOf('bEmbed') > 0 ){ window.parent.location.href = self.location.href.replace('&bEmbed=true','');// 'http://inNewHomes.com/';.replace(regexp/substr,newstring); } } // SYNCRONOUS function doSJax(url,obj) { var obj = doObject(obj); if(XMLHttpRequestObject) { XMLHttpRequestObject.open('get',url,false); XMLHttpRequestObject.send(null); obj.innerHTML = XMLHttpRequestObject.responseText; } } function doAjax(url,obj) { obj = doObject( obj ); $.get(url, function(data) {$(obj).html(data);}); } function doLiveToggle(str,obj) { var objHTTP = false; if(navigator.appName == "Microsoft Internet Explorer") { objHTTP = new ActiveXObject("Microsoft.XMLHTTP"); } else { objHTTP = new XMLHttpRequest(); } if(objHTTP) { var obj = obj; objHTTP.open("GET", '/frameworks/ajax/set-toggle-live.asp?sKey='+str); objHTTP.onreadystatechange = function() { if (objHTTP.readyState == 4 && objHTTP.status == 200) { if (objHTTP.responseText=='True') { obj.checked='checked'; } else { obj.checked=''; } alert('Process OK'); } } objHTTP.send(null); } } function doLogin() { doObject('oFormLogin').submit(); } function doSetAccountsType(str,obj) { var objHTTP = false; if(navigator.appName == "Microsoft Internet Explorer") { objHTTP = new ActiveXObject("Microsoft.XMLHTTP"); } else { objHTTP = new XMLHttpRequest(); } if(objHTTP) { var obj = obj; objHTTP.open("GET", '/frameworks/ajax/set-accounts-type.asp?sKey='+str+'&iType='+obj.options[obj.selectedIndex].value); objHTTP.onreadystatechange = function() { if (objHTTP.readyState == 4 && objHTTP.status == 200) { if (objHTTP.responseText=='OK') { alert('Process OK'); } else { alert('Process failed!'); } } } objHTTP.send(null); } } // For simple Ajax functions var XMLHttpRequestObject = false; if (window.XMLHttpRequest) { XMLHttpRequestObject = new XMLHttpRequest(); } else if (window.ActiveXObject) { XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP"); } function getNumeric(dataSource, obj) { if(XMLHttpRequestObject) { var obj = obj; XMLHttpRequestObject.open("GET", dataSource); XMLHttpRequestObject.onreadystatechange = function() { if (XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200) { obj.value = XMLHttpRequestObject.responseText; } } XMLHttpRequestObject.send(null); } } function doFormatAlphaNumeric(obj) { obj.value = doAjaxReturn('/frameworks/ajax/alphanumeric.asp?sValue='+obj.value); } function doPCase(str) { doAjaxReturn('/frameworks/ajax/pcase.asp?sValue='+str); } function doFormatPCase(obj) { obj.value = doAjaxReturn('/frameworks/ajax/pcase.asp?sValue='+obj.value); } function doFormatPhone(obj) { obj.value = doAjaxReturn('/frameworks/ajax/phone.asp?sValue='+obj.value); } function doAjaxRecordUpdate(str) { if(XMLHttpRequestObject) { var obj = obj; XMLHttpRequestObject.open("GET",str); XMLHttpRequestObject.onreadystatechange = function() { if (XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200) { alert( XMLHttpRequestObject.responseText ); } } XMLHttpRequestObject.send(null); } } function doCheckEmail(sURL,sEmail) { obj = doSO( sEmail ); if(XMLHttpRequestObject) { XMLHttpRequestObject.open("get",sURL,false); XMLHttpRequestObject.send(null); bTemp=XMLHttpRequestObject.responseText; if (bTemp) { obj.style.backgroundColor=''; return(true); } else { obj.style.backgroundColor='#FCCCCC'; alert('Invalid Email Address'); return(false); } } } function doImageUpSize(sFile,xOffset,yOffset,sCaption) { doPositionObject( document.getElementById('oContainerUpSize'),xOffset,yOffset ); document.getElementById('oImageUpSize').src=sFile; document.getElementById('oContainerUpSize').style.display = 'block'; if(sCaption) { document.getElementById('oUpSizeCaption').innerHTML=sCaption; } } function doImageUpSizeOff() { document.getElementById('oContainerUpSize').style.display = 'none'; document.getElementById('oUpSizeCaption').innerHTML=''; } function doBubble225UpSize(sHTML) { doPositionObject( document.getElementById('oBubble225'),-5,71 ); if(x>screen.width/2) { document.getElementById('oBubble225').style.left = x-230; document.getElementById('oBubble225').className='bubble225left'; } else { document.getElementById('oBubble225').className='bubble225'; } document.getElementById('oBubble225').innerHTML=sHTML; document.getElementById('oBubble225').style.display = 'block'; } function doBubble225UpSizeOff() { document.getElementById('oBubble225').style.display = 'none'; } function doUpSize468(str) { doPositionObject( doObject('oUpSize468'),510,150 ); doObject('oUpSize468Image').src=str; doObject('oUpSize468').style.display = 'block'; } function doUpSize468Off() { doObject('oUpSize468').style.display = 'none'; doObject('oUpSize468Image').src=''; } function doPositionObject(obj,xOffset,yOffset) { doMousePosition(); if (obj != null) { obj.style.position = 'absolute'; if(x>screen.width/2) { obj.style.left = mousePos.x-xOffset; } else { obj.style.left = mousePos.x+10; } obj.style.top = mousePos.y-yOffset; } return(x); } function doMousePosition(ev) { ev = ev || window.event; mousePos = getMouseCoords(ev); } function getMouseCoords(ev){ if(ev.pageX || ev.pageY) { x = ev.pageX y = ev.pageY } else { x = ev.clientX + document.body.scrollLeft - document.body.clientLeft; y = ev.clientY + document.body.scrollTop - document.body.clientTop; } return {x:x,y:y}; } function doInfoBubbleOff() { window.clearTimeout(infoBubble); document.getElementById('oInfoBubble').style.display='none'; } function doURLEncode(str) { return escape(str).replace('+', '%2B').replace('%20', '+').replace('*', '%2A').replace('/', '%2F').replace('@', '%40'); } function urlencode(str) { doURLEncode(str) } function urldecode(str) { return unescape(str.replace('+', ' ')); } function doPasswordMatch() { if (doObject('sPassword1').value != doObject('sPassword2').value) { doObject('sPassword1').style.backgroundColor = '#FCCCCC'; doObject('sPassword2').style.backgroundColor = '#FCCCCC'; doObject('sPassword1').value = ''; doObject('sPassword2').value = ''; alert('Password fields do not match!'); return (false); } else { doObject('sPassword1').style.backgroundColor = '#CCFCCC'; doObject('sPassword2').style.backgroundColor = '#CCFCCC'; } } function doIsEmail(str) { if(typeof(str)=='object') { str = doObject(str).value; } var filter = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; if( filter.test(str) ) { return (true); } else { return (false); } } function doMessagePrice() { // doShadowBoxIFrame('/shadowboxes/send-message.asp?sKeyRecipient=&sKeyInterest=&sSubject=' + doURLEncode(' in ') + '&sKeySubject=&sBody=Please send me the latest pricing information and sales incentives for .', 'Send a Message to ',600); } function doSubmitMyAccount() { var b = doValidation(); if (b != false ) { var x = ''; $.post('/ajax/my-account.asp', $('#oFormMyAccount :input').serialize(), function(sResponse) { $('#oFormMyAccount').html(sResponse); alert('['+sResponse+']'); }); window.location.reload(); } else { // submit failed } } function doValidation() { if (!doCheckLength(doObject('sCodeSPAM'), 3, 'The No-SPAM code should be three (3) characters!')) { return (false); } if (doObject('bAccept').checked != true) { if (confirm('I have read, and I agree with this web sites Terms of Use and Privacy Policy.')) { doObject('bAccept').checked = true; } else { alert('You must agree in order to sign up.'); return (false); } } if (!doCheckLength(doObject('sNameFirst'), 2, 'Your first name must be at least two (2) characters!')) { return (false); } if (!doCheckLength(doObject('sNameFamily'), 2, 'Your family name must be at least two (2) characters!')) { return (false); } if (doIsEmail(doObject('sEmail'))==false) { doObject('sEmail').style.backgroundColor = '#FCFCCC'; alert('The email address is not in an acceptable format.'); } else { doObject('sEmail').style.backgroundColor = '#CCFCCC'; } if (!doCheckLength(doObject('sPassword1'), 6, 'Password must be at least (6) characters in length!')) { doObject('sPassword1').style.backgroundColor = '#FCCCCC'; return (false); } else { doObject('sPassword1').style.backgroundColor = '#CCFCCC'; } doPasswordMatch(); }