var agent;var typeOfNavigationLayout='Horiz';var setClassForActiveNav='aTag';var aDocLINKS, findPromo, linkText, theCode, ePromoCodeCode;var theCodeValue, aCookieArray, eCookie;var ajaxResponse;var directory, pageID;var bigHairyBalls=false;function navElement (uID, sectionName, fileName, title, enabled, parentArray, level, sortOrder, url){this.length=10;this.uID=uID;this.sectionName=sectionName;this.fileName=fileName;this.title=title;this.enabled=enabled;this.parentArray=parentArray;this.level=level;this.sortOrder=sortOrder;this.url=url;}usrPlatform=navigator.platform;userPlatform=usrPlatform.substr(0);if (usrPlatform=='Win32'){agent=navigator.userAgent.indexOf('MSIE') != -1 ? agent='ie' : agent=navigator.userAgent.indexOf('Gecko') != -1 ? agent='gecko': false;if (agent=='ie'){browser=navigator.userAgent;browser=browser.split(';');browser=browser[1];browser=browser.substr(5);if (browser==6||browser==5.5){document.write('<link rel="stylesheet" href="/_Lib/css/ie_styles.css" type="text/css" />');}if (browser==7){document.write('<link rel="stylesheet" href="/_Lib/css/ie7_styles.css" type="text/css" />');}}}else{agent=navigator.userAgent.indexOf('AppleWebKit') != -1 ? agent='webKit' : agent=navigator.userAgent.indexOf('Gecko') != -1 ? agent='gecko' : false;}function findEventElement(e){if (!e) var e=window.event;e.target ? currentE=e.target : currentE=e.srcElement;if (currentE.nodeType==3){currentE=currentE.parentNode;}parentE=currentE.parentNode;grandparentE=parentE.parentNode;e.relatedTarget ? relatedE=e.relatedTarget : relatedE=e.toElement;}function fLinkChecker(){aDocLINKS=document.links;findPromo=new RegExp("PromoCode=\\w+");for (var x=0; x < aDocLINKS.length; x++){linkText=aDocLINKS[x].href;theCode=findPromo.exec(linkText);if (theCode){ePromoCodeCode=theCode[0].slice(10);readCookie(ePromoCodeCode);}}}function hideElement (e){findEventElement(e);if (relatedE != topItem){decendantList=topItem.getElementsByTagName(relatedE.tagName);decendant=false;for (var x=0; x < decendantList.length; x++){if (decendantList[x]==relatedE){decendant=true;}}if (decendant==false){topItem.removeChild(topItem.lastChild);topItem.className=oldClass;topItem.firstChild.onmouseover=setListener;topItem.removeEventListener ? topItem.removeEventListener('mouseover', showElement, false) : topItem.detachEvent('onmouseover', showElement);topItem.removeEventListener ? topItem.removeEventListener('mouseout', hideElement, false) : topItem.detachEvent('onmouseout', hideElement);}else{while(currentE.nodeName=='A'){currentE=currentE.parentNode;}while(relatedE.nodeName=='A'){relatedE=relatedE.parentNode;}if (relatedE != currentE){var relationship;for (var x=0; x < 2; x++){x==0 ? useElement=currentE : useElement=relatedE;useElement==currentE ? checkElement=relatedE : checkElement=currentE;checkNodeList=useElement.getElementsByTagName(checkElement.nodeName);for (var y=0; y < checkNodeList.length; y++){if (checkNodeList[y]==checkElement){x==0 ? relationship='child' : relationship='parent';}}}if (!relationship){for (var x=0; x < 2; x++){x==0 ? useElement=currentE : useElement=relatedE;useElement==currentE ? checkElement=relatedE : checkElement=currentE;useElementParent=useElement.parentNode;checkNodeList=useElementParent.getElementsByTagName(checkElement.nodeName);for (var y=0; y < checkNodeList.length; y++){if (checkNodeList[y]==checkElement){checkElementParent=checkElement.parentNode;for (var z=0; z < checkElementParent.childNodes.length; z++){if (checkElementParent.childNodes[z]==useElement){relationship='sibling';}}}}if (!relationship){relationship='uncle';}}}if (relationship=='parent'||relationship=='sibling'){if (currentE.lastChild.nodeName=='UL'){currentE.removeChild(currentE.lastChild);}} else if(relationship=='uncle'){var relatedEParent=relatedE.parentNode;for (var x=0; x < relatedEParent.childNodes.length; x++){if (relatedEParent.childNodes[x] != relatedE && relatedEParent.childNodes[x].lastChild.nodeName=='UL'){relatedEParent.childNodes[x].removeChild(relatedEParent.childNodes[x].lastChild);}}}}}}}function initializeArrays (){aSectionArray=new Array();aSectionArray.splice (aSectionArray.length, 0, 0);for (var x=0; x < aPages.length; x++){if (aPages[x].sectionName){aSectionArray.splice (aSectionArray.length, 0, aPages[x].uID);}}for (var x=0; x < aSectionArray.length; x++){writeArray (aSectionArray[x]);}}function makeRequest (url, parameters, alertString){http_request=false;if (window.XMLHttpRequest){http_request=new XMLHttpRequest();if (http_request.overrideMimeType){http_request.overrideMimeType('text/xml');}} else if(window.ActiveXObject){try {http_request=new ActiveXObject("Msxml2.XMLHTTP");} catch(e){try {http_request=new ActiveXObject("Microsoft.XMLHTTP");} catch(e){}}}if (!http_request){alert('FAILED, Cannot create XMLHTTP instance');return false;}http_request.open('GET', url + parameters, false);http_request.send(null);if (http_request.readyState==4){if (http_request.status==200){ajaxResponse=http_request.responseText;if (ajaxResponse != 'hide'){if (alertString){if (alertString=='default'){alert('Your edits have been saved. Click OK to continue.');}else{alert(alertString);}}}return ajaxResponse;}else{alert('There was a problem with the request. \n Request Status: ' + http_request.status);}}}function readCookie(theCode){theCodeValue=theCode + "=";aCookieArray=document.cookie.split(';');for (var i=0; i < aCookieArray.length; i++){eCookie=aCookieArray[i];while(eCookie.charAt(0)==' '){eCookie=eCookie.substring(1,eCookie.length);}if (eCookie.indexOf(theCodeValue)==0){return true;}}script="/_Lib/other/processLinkCounter.php";sendPromoCode="?promoCode=" + theCode;makeRequest(script,sendPromoCode);return true;}function setDirectory(){fullURL=window.location.href;if (fullURL.match(/^\S+onScreenEditing.php\S*$/)){thisPageID=fullURL.match(/\d+$/);if (thisPageID){pageID=thisPageID;for (var x=0; x < aPages.length; x++){if (thisPageID==aPages[x].uID){currentPage=aPages[x];while(currentPage.level != 0){for (var y=0; y < aPages.length; y++){if (aPages[y].uID==currentPage.parentArray){currentPage=aPages[y];}}}}}directory=currentPage.uID;}else{directory=1;pageID=1;}}else{directory=fullURL.split("/");if (directory[3]==''){directory='index.html';}else{directory=directory[3];}}}function setListener (e){findEventElement(e);currentE.onmouseover='';if (currentE.nodeName=='A'){currentE=currentE.parentNode;}topItem=currentE;topItem.className=='navFocus' ? oldClass='navFocus' : oldClass=topItem.className;topItem.addEventListener ? topItem.addEventListener('mouseover', showElement, false) : topItem.attachEvent('onmouseover', showElement);topItem.addEventListener ? topItem.addEventListener('mouseout', hideElement, false) : topItem.attachEvent('onmouseout', hideElement);}function writeArray (targetArray){newNavArray=new Array();for (var y=0; y < aPages.length; y++){if (aPages[y].parentArray==targetArray){newNavArray[aPages[y].sortOrder]=aPages[y];}}if (bigHairyBalls==false){for (var g=0; g < newNavArray.length; g++){if (!newNavArray[g]){newNavArray.splice (g, 1);g--;}}}window['anav' + targetArray + 'Array']=newNavArray;array=newNavArray;}function showElement (e){topItem.className='dropDown';findEventElement(e);if (currentE.nodeName=='A'){if (window['a' + parentE.id + 'Array']){if (parentE.lastChild.nodeName != 'UL'){writeSubNav(window['a' + parentE.id + 'Array'], parentE, 'yes');}}}}function writeNav (){setDirectory();eNav=document.getElementById('nav');while(eNav.hasChildNodes()){eNav.removeChild(eNav.firstChild);}writeSubNav (anav0Array, eNav);}function writeSubNav (array, element, newUL){if (newUL){eUL=document.createElement('UL');for (var x=0; x < aPages.length; x++){if ('nav' + aPages[x].uID==element.id){pageLevel=aPages[x].level;}}if (agent=='ie' && browser >= 7){if (pageLevel==0){eUL.style.left='0px';eUL.className='firstDrop';}else{eUL.style.left=(element.offsetWidth - 3) + 'px';eUL.style.top='4px';}}else{if (pageLevel==0){eUL.style.left=element.offsetLeft + 'px';eUL.className='firstDrop';}else{eUL.style.left=(element.offsetWidth - 3) + 'px';eUL.style.top=(currentE.offsetTop - 2) + 'px';}}}for (var x=0; x < array.length; x++){eNewLI=document.createElement('LI');eNewLI.id='nav' + array[x].uID;if (array[x].enabled=='no'){eNewLI.className='disabled';}eNewA=document.createElement('A');if (bigHairyBalls==true){eNewA.href='?pageID=' + array[x].uID;}else{eNewA.href='/interiorPage.php?pageID='+array[x].uID;}if (window['anav' + array[x].uID + 'Array']){eNewA.onclick=function (){return false;};}if (array==anav0Array){if (window['anav' + array[x].uID + 'Array']){eNewA.onmouseover=setListener;}if (window.bigHairyBalls==true){if (array[x].uID==directory){setClassForActiveNav=='liTag' ? tempElement=eNewLI : tempElement=eNewA;tempElement.className='navFocus';if (	array[x].enabled=='no'){tempElement.className='navFocusDisabled';}}}else{if (array[x].fileName==directory||array[x].sectionName==directory){setClassForActiveNav=='liTag' ? eNewLI.className='navFocus' : eNewA.className='navFocus';}}}else{if (array[x].sectionName){agent=='ie' ? eNewLI.className='section' : eNewA.className='section';}}if (array[x].level==0 && array[x].sortOrder > 5){}else{eNewA.innerHTML=array[x].title;eNewLI.appendChild(eNewA);if (newUL){eUL.appendChild(eNewLI);}else{element.appendChild(eNewLI);}}}if (newUL){element.appendChild(eUL);}}function pasteListenerDEPRECATED(){document.body.addEventListener ? document.body.addEventListener('paste', pasteClean, false) : document.body.attachEvent('onpaste', pasteClean);}function pasteCleanDEPRECATED(){if (event.clipboardData){event.returnValue=false;eClip=event.clipboardData;alert('Safari, WebKit, FireFox, etc.');}else{window.event.returnValue=false;eClip=window.clipboardData;alert('Internet Explorer');}textString=eClip.getData('Text');textString=textString.replace(/\n/g,"</p><p>");ePara=document.createElement('P');eText=document.createTextNode(textString);mainDiv=document.getElementById("mainContent");ePara.appendChild(eText);mainDiv.appendChild(ePara);}function executeThis(){setTimeout("thenExecuteThis()", 15000);}function thenExecuteThis(){var workingArray;for (x=3; x < 6; x++){workingArray=window['slot'+x];randIndex=Math.floor(Math.random() * workingArray.length);dataToSend='?uIDin='+workingArray[randIndex];ajaxResponse=makeRequest('_Lib/admin/grabRotatingContent.php', dataToSend, '');incomingData=ajaxResponse.split("||");titleBar=incomingData[0];contentBlock=incomingData[1]+' ';image=incomingData[2];imageWidth=incomingData[3];imageHeight=incomingData[4];imageAlt=incomingData[5];linkText=incomingData[6];linkURL=incomingData[7];targetID='singleStoryModule'+x;document.getElementById(targetID).childNodes[0].firstChild.innerHTML=titleBar;document.getElementById(targetID).childNodes[1].src='/_Lib/images/'+image;document.getElementById(targetID).childNodes[1].width=imageWidth;document.getElementById(targetID).childNodes[1].height=imageHeight;document.getElementById(targetID).childNodes[2].firstChild.innerHTML=contentBlock;document.getElementById(targetID).childNodes[2].childNodes[1].href=linkURL;document.getElementById(targetID).childNodes[2].childNodes[1].firstChild.innerHTML=linkText;}setTimeout("thenExecuteThis()", 15000);}function hideShowBPPItems(){promotionLinkType=document.getElementById('promotionLinkType').value;promoONE=document.getElementById('promoONE');promoTWO=document.getElementById('promoTWO');promoTHREE=document.getElementById('promoTHREE');promoFOUR=document.getElementById('promoFOUR');promoFIVE=document.getElementById('promoFIVE');if (promotionLinkType=='noLink'){promoONE.style.display='none';promoTWO.style.display='none';if (promoTHREE){promoTHREE.style.display='none';}promoFOUR.style.display='none';} else if(promotionLinkType=='webHome'){promoONE.style.display='block';promoTWO.style.display='none';if (promoTHREE){promoTHREE.style.display='none';}promoFOUR.style.display='none';} else if(promotionLinkType=='webOther'){promoONE.style.display='block';promoTWO.style.display='block';if (promoTHREE){promoTHREE.style.display='none';}promoFOUR.style.display='none';} else if(promotionLinkType=='promoFile'){promoONE.style.display='block';promoTWO.style.display='none';promoTHREE.style.display='block';if (promoTHREE){promoFOUR.style.display='none';}else{promoFOUR.style.display='block';}promoFIVE.style.display='block';}else{alert('promotionLinkType: ELSE');}}function replaceDocument(){promoTHREE=document.getElementById('promoTHREE');promoTHREE.style.display='none';promoFOUR=document.getElementById('promoFOUR');promoFOUR.style.display='block';}function validateBPPinfo(){if (!document.getElementById('businessName').value){alert('The Business Name field is required.');return false;} else if(!document.getElementById('primaryContactName').value){alert('The Primary Contact Name field is required.');return false;} else if(!document.getElementById('primaryBusinessPhone').value){alert('The Primary Business Phone Number is required.');return false;} else if(document.getElementById('aboutUs').firstChild.nodeValue.length > 3750){aboutUsLength=document.getElementById('aboutUs').firstChild.nodeValue.length;alert('The About Us text block is limited to 750 characters... you are attempting to submit '+aboutUsLength+' characters.');return false;} else if(document.getElementById('productsServices').firstChild.nodeValue.length > 3750){productsServicesLength=document.getElementById('productsServices').firstChild.nodeValue.length;alert('The Products & Services text block is limited to 750 characters... you are attempting to submit '+productsServicesLength+' characters.');return false;} else if(document.getElementById('location').firstChild.nodeValue.length > 3750){locationLength=document.getElementById('location').firstChild.nodeValue.length;alert('The Location text block is limited to 750 characters... you are attempting to submit '+locationLength+' characters.');return false;} else if(document.getElementById('promotionName').value){startDate=document.getElementById('startDateYear').value + document.getElementById('startDateMonth').value + document.getElementById('startDateDay').value;endDate=document.getElementById('endDateYear').value + document.getElementById('endDateMonth').value + document.getElementById('endDateDay').value;if (!document.getElementById('promotionText').value){alert('When submitting a Free Business Promotion, you must have accompanying Promotion Text.');return false;} else if(startDate > endDate){alert('Your Promotion End Date is BEFORE the Promotion Beginning date... In this world, that can not be...');return false;}}}function changeTestimonialStatus(theID){textOnPage=document.getElementById(theID).firstChild;if (textOnPage.nodeValue=='Click to Display'){theNewText='Click to Hide';}else{theNewText='Click to Display';}script="_Lib/admin/changeTestimonialStatus.php";dataToSend="?theID=" + theID;makeRequest(script,dataToSend);textOnPage.nodeValue=theNewText;}function removeBPP(bppID){var answer=confirm('You are about to permamenantly remove this Business Partner. Are you sure this is what you want to do?');if (answer){script="deleteBusinessPartner.php";dataToSend="?theID=" + bppID;makeRequest(script,dataToSend);a=document.getElementById(bppID);a.onclick='return false;';a.href= '';a.firstChild.nodeValue='deleted';}}function playASLvideo(){aslModule=document.getElementById('aslModule');while(aslModule.childNodes.length > 0){aslModule.removeChild(aslModule.firstChild);}randomNumber=Math.ceil(Math.random()*11);movFile='/_Lib/files/mov/MARS_INFORM_' + randomNumber + '.mov';object=document.createElement('OBJECT');object.classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B';object.width='175';object.height='150';object.codebase='http://www.apple.com/qtactivex/qtplugin.cab';param=document.createElement('PARAM');param.name='src';param.value=movFile;object.appendChild(param);param=document.createElement('PARAM');param.name='autoplay';param.value='true';object.appendChild(param);param=document.createElement('PARAM');param.name='controller';param.value='false';object.appendChild(param);param=document.createElement('PARAM');param.name='loop';param.value='false';object.appendChild(param);embed=document.createElement('EMBED');embed.src=movFile;embed.width='175';embed.height='150';embed.autoplay='true';embed.controller=false;embed.loop='false';embed.bgcolor='#000;';embed.onclick=playASLvideo;embed.pluginspage='http://www.apple.com/quicktime/download/';object.appendChild(embed);aslModule.appendChild(object);}var vidFile=new Array();vidFile[0]='BPP_01';vidFile[1]='BPP_02';vidFile[2]='EDP_01';vidFile[3]='General_01';vidFile[4]='General_02';vidFile[5]='General_03';vidFile[6]='General_04';vidFile[7]='General_05';vidFile[8]='HIPAA_01';vidFile[9]='How2_01';vidFile[10]='How2_02';vidFile[11]='How2_03';vidFile[12]='Prefs_01';vidFile[13]='RWDS_01';vidFile[14]='RWDS_02';vidFile[15]='RWDS_03';vidFile[16]='Tips_01';vidFile[17]='Tips_02';vidFile[18]='Tips_03';vidFile[19]='Tips_04';vidFile[20]='Tips_05';vidFile[21]='Tips_06';vidFile[22]='Tips_07';vidFile[23]='Tips_08';vidFile[24]='Tips_09';function insertASLModuleMOV(){var randomnumber=(Math.floor(Math.random()*25));document.write('<div id="aslModule"> \n');document.write('  <object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="175" height="130" codebase="http://www.apple.com/qtactivex/qtplugin.cab"> \n');document.write('    <param name="src" value="http://www.massrelay.com/_Lib/files/video/'+vidFile[randomnumber]+'.mov" /> \n');document.write('    <param name="autoplay" value="false" /> \n');document.write('    <param name="controller" value="false" /> \n');document.write('    <param name="loop" value="false" /> \n');document.write('    <embed src="http://www.massrelay.com/_Lib/files/video/'+vidFile[randomnumber]+'.mov" width="175" height="130" autoplay="false" controller="false" loop="false" bgcolor="#000" pluginspage="http://www.apple.com/quicktime/download/" /> \n');document.write('  </object> \n');document.write('</div> \n');}function insertASLModuleWMV(){var randomnumber=(Math.floor(Math.random()*25));document.write('<div id="aslModule"> \n');document.write('  <object id="mediaPlayer" width="175" height="190" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject"> \n');document.write('    <param name="fileName" value="http://www.massrelay.com/_Lib/files/video/'+vidFile[randomnumber]+'.wmv" /> \n');document.write('    <param name="animationStart" value="1" /> \n');document.write('    <param name="transparentStart" value="1" /> \n');document.write('    <param name="autoStart" value="0" /> \n');document.write('    <param name="ShowControls" value="1" /> \n');document.write('    <param name="ShowDisplay" value="0" /> \n');document.write('    <param name="ShowStatusBar" value="0" /> \n');document.write('    <param name="loop" value="0" /> \n');document.write('    <embed type="application/x-mplayer2" pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" id="mediaPlayer" name="mediaPlayer" displaysize="4" autosize="0" bgcolor="darkblue" showcontrols="1" showtracker="1" showdisplay="0" showstatusbar="0" videoborder3d="0" width="175" height="190" src="http://www.massrelay.com/_Lib/files/video/'+vidFile[randomnumber]+'.wmv" autostart="0" designtimesp="5311" loop="0"> \n');document.write('    </embed> \n');document.write('  </object> \n');document.write('</div> \n');}