
var requiredMajorVersion=10;
var requiredMinorVersion=2;
var requiredRevision=53;
var _searchStateObj={};
var g_sComponentPoolStatus=null;
var g_xmlCVGC=null;
function CheckFlash(name)
{
var hasProductInstall=DetectFlashVer(6,0,65);
var hasRequestedVersion=DetectFlashVer(requiredMajorVersion,requiredMinorVersion,requiredRevision);
var isSafariBrowser=isSafari();
var isSkyFire=(navigator.userAgent.indexOf("Skyfire")!=-1)?true:false;
if(isSkyFire)
{
hasProductInstall=true;
hasRequestedVersion=true;
}
if(hasProductInstall&&!hasRequestedVersion)
{
var MMPlayerType=(isIE==true)?"ActiveX":"PlugIn";
var MMredirectURL=window.location;
document.title=document.title.slice(0,47)+" - Flash Player Installation";
var MMdoctitle=document.title;
AC_FL_RunContent(
"src","playerProductInstall",
"FlashVars","MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
"width","100%",
"height","100%",
"align","middle",
"id",name,
"quality","high",
"bgcolor","#ffffff",
"name",name,
"allowScriptAccess","sameDomain",
"type","application/x-shockwave-flash",
"pluginspage","http://www.adobe.com/go/getflashplayer"
);
}else if(hasRequestedVersion&&isSafariBrowser){
AC_FL_RunContent(
"src",name,
"FlashVars","WebClientDir=/Flex/",
"width","100%",
"height","100%",
"align","middle",
"id",name,
"quality","high",
"bgcolor","#ffffff",
"name",name,
"allowScriptAccess","sameDomain",
"wmode","default",
"type","application/x-shockwave-flash",
"pluginspage","http://www.adobe.com/go/getflashplayer"
);
setTimeout(setFocus,100);
}else if(hasRequestedVersion&&!isSafariBrowser){
AC_FL_RunContent(
"src",name,
"FlashVars","WebClientDir=/Flex/",
"width","100%",
"height","100%",
"align","middle",
"id",name,
"quality","high",
"bgcolor","#ffffff",
"name",name,
"allowScriptAccess","sameDomain",
"wmode","opaque",
"type","application/x-shockwave-flash",
"pluginspage","http://www.adobe.com/go/getflashplayer"
);
setTimeout(setFocus,100);
}else{
var alternateContent='Fusion MLS requires the Adobe Flash Player. '
+'<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
document.write(alternateContent);
}
}
function GetChildValueGroupConstraintXML()
{
if(null==g_xmlCVGC)
{
g_xmlCVGC=new XMLHttpRequest();
g_xmlCVGC.open("GET","/MiddleTier/GetCVGCXML.asp",false);
g_xmlCVGC.setRequestHeader('Content-Length',0);
g_xmlCVGC.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
g_xmlCVGC.setRequestHeader('Content-Disposition','form-data; name="xml"');
g_xmlCVGC.send(null);
}
return g_xmlCVGC.responseText;
}
function isSafari()
{
var useragent=navigator.userAgent.toLowerCase();
useragent=useragent.toLowerCase();
var version=useragent.indexOf('5.1');
var safari=useragent.indexOf('safari');
var chrome=useragent.indexOf('chrome');
if(version!=-1&&safari!=-1&&chrome==-1)
{
return true;
}
return false;
}
function GetFilterList(p_sSubTypeID,p_sTaxCode)
{
var sURL="/MiddleTier/lm_getFilters.asp?subtypeid="+p_sSubTypeID;
if(p_sTaxCode!=null)
{
sURL+="&TaxCode="+p_sTaxCode;
}
var xmlReq=new XMLHttpRequest();
xmlReq.open("GET",sURL,false);
xmlReq.setRequestHeader('Content-Length',0);
xmlReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlReq.setRequestHeader('Content-Disposition','form-data; name="xml"');
xmlReq.send(null);
return xmlReq.responseText;
}
function GetFilterFields(p_iFilterID,p_sTaxCode)
{
var sURL="/MiddleTier/lm_getFilterInfo.asp?filterid="+p_iFilterID;
if(p_sTaxCode!=null)
{
sURL+="&TaxCode="+p_sTaxCode;
}
var xmlReq=new XMLHttpRequest();
xmlReq.open("GET",sURL,false);
xmlReq.setRequestHeader('Content-Length',0);
xmlReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlReq.setRequestHeader('Content-Disposition','form-data; name="xml"');
xmlReq.send(null);
return xmlReq.responseText;
}
function GetInitParms(p_sUserID,p_iSubTypeID,p_sTableID,p_bIncludeVV)
{
p_iSubTypeID="2";
p_sTableID="1";
p_sUserID="0";
if(null==g_sComponentPoolStatus)
{
var req=new XMLHttpRequest();
var sURL="http://"+document.domain+"/MiddleTier/GetComponentPoolStatus.asp";
req.open("GET",sURL,false);
req.setRequestHeader('Content-Length',0);
req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
req.setRequestHeader('Content-Disposition','form-data; name="xml"');
req.send(null);
g_sComponentPoolStatus=req.responseText;
g_sComponentPoolStatus=g_sComponentPoolStatus.replace("<STATUS>","");
g_sComponentPoolStatus=g_sComponentPoolStatus.replace("</STATUS>","");
}
var sFieldListURL='/MiddleTier/LM_GetFieldList.asp?ID='+p_sUserID+
'&CPS='+g_sComponentPoolStatus+
'&SubTypeID='+p_iSubTypeID+
'&TableID='+p_sTableID+
"&IncludeVV="+((p_bIncludeVV==null||p_bIncludeVV)?1:0);
var reqFields=new XMLHttpRequest();
reqFields.open("GET",sFieldListURL,false);
reqFields.send(null);
var objReturn=new Object();
objReturn.addressFormat="279|274|276|281";
objReturn.canCopyImage=false;
objReturn.dbAction=2;
objReturn.fieldList=reqFields.responseText;
objReturn.geocodeHitTypeFID=1044;
objReturn.imageWebServer="qaimage01";
objReturn.invalidDBCharacters="^|\\";
objReturn.lastTransCode="";
objReturn.latitudeFID=110;
objReturn.lmmEnableTaxSource=true;
objReturn.lmmTaxApRequired=false;
objReturn.longitudeFID=140;
objReturn.manualGeoFlagFID=1043;
objReturn.mapCity="";
objReturn.mapCountry="USA";
objReturn.mapEnabled=true;
objReturn.mapState="";
objReturn.metaMiscParmCopyImages=0;
objReturn.ohMlNumberFID=882;
objReturn.originalSysID="";
objReturn.promptGeocodeValidation=false;
objReturn.regionalSite=false;
objReturn.strKey="2907836";
objReturn.subTypeID="2";
objReturn.sysID="665147";
objReturn.tableType=1;
objReturn.taxCode="INR";
objReturn.taxCountyFID=74;
objReturn.taxIdFID=1354;
objReturn.taxSourceFID=1069;
objReturn.vtFields="";
objReturn.zipFID=312;
return objReturn;
}
function getOpenerStateObject()
{
return window.opener.getStateObject();
}
function getScreenDPI()
{
try
{
var dpiObject=new Object();
dpiObject.x=document.getElementById("divMeasure").offsetWidth;
dpiObject.y=document.getElementById("divMeasure").offsetHeight;
return dpiObject;
}
catch(e)
{
alert(e.description);
}
}
function getStateObject()
{
return _searchStateObj;
}
function showDetailsApp(p_sState,selectedRow,itemClass)
{
_searchStateObj=p_sState;
_searchStateObj.selectedRow=selectedRow;
if(itemClass!=null)
{
_searchStateObj.itemClass=itemClass;
}
var windowName="mywindow"+selectedRow.toString();
window.open("SearchDetails.html",windowName,"height=580,width=832,status=no,toolbar=no,titlebar=no,menubar=no,location=no,resizable=yes");
return 1;
}
function cleanHTML(dirtyHTML)
{
var counter=0;
var wellFormedHTML=new String();
document.all("divRenderer").innerHTML=dirtyHTML;
for(counter=0;counter<document.all("divRenderer").childNodes.length;counter++)
{
wellFormedHTML+=buildNewHTML(document.all("divRenderer").childNodes[counter]);
}
document.all("divRenderer").innerHTML="";
return wellFormedHTML;
}
function buildNewHTML(node)
{
var attribute=null;
var attributeName=null;
var attributeValue=null;
var childNode=null;
var counter=0;
var fontSize=null;
var nodeName=null;
var wellFormedHTML=new String();
var anchorTag=false;
var targetAtt=false;
var mailTo=false;
if(!node.nodeValue)
{
nodeName=node.nodeName.toLowerCase();
switch(nodeName)
{
case "em":
nodeName="i";
case "strong":
nodeName="b";
default:
anchorTag=(nodeName=="a");
if(anchorTag)
{
wellFormedHTML="<FONT color='#0000FF'><U><"+nodeName;
}
else
{
wellFormedHTML="<"+nodeName;
}
for(counter=0;counter<node.attributes.length;counter++)
{
attribute=node.attributes[counter];
if(attribute.specified)
{
attributeName=attribute.name.toLowerCase();
attributeValue=attribute.value;
if((nodeName!="font")||(attributeName!="size"))
{
if((nodeName=="font")&&(attributeName=="style")&&node.style)
{
fontSize=node.style.fontSize;
if(fontSize&&(fontSize!=""))
{
attributeName="size";
attributeValue=fontSize.replace(/pt$/,"");
}
}
else if(anchorTag)
{
if(attributeName=="target")
{
targetAtt=true;
}
else if((attributeName=="href")&&(attributeValue.indexOf("mailto")==0))
{
mailTo=true;
}
}
wellFormedHTML+=" "+attributeName+"=\"" + attributeValue + "\"";
}
}
}
if(anchorTag&&!targetAtt&&!mailTo)
{
wellFormedHTML+=" target=\"_NEW\" ";
}
wellFormedHTML+=">";
break;
}
for(counter=0;counter<node.childNodes.length;counter++)
{
childNode=node.childNodes[counter];
wellFormedHTML+=(childNode.nodeName!="#text")?buildNewHTML(childNode):childNode.nodeValue;
}
if(anchorTag)
{
wellFormedHTML+="</"+nodeName+"></U></FONT>";
}
else if(nodeName.indexOf("/")==-1)
{
wellFormedHTML+="</"+nodeName+">";
}
return wellFormedHTML;
}
else
{
return node.nodeValue;
}
}
function expireCookie(cookieName,cookiePath)
{
var expireDate=new Date("January 1, 2000");
expireDate=expireDate.toGMTString();
document.cookie=cookieName+"=;expires="+expireDate+";path="+cookiePath;
}
function setCookie(cookieName,cookieValue,cookiePath,setDomain)
{
document.cookie=cookieName+"="+cookieValue+"; path="+cookiePath;
}
function getCookieValue(cookieName)
{
var cookieValue="";
if(document.cookie.indexOf(cookieName)!=-1)
{
var cookies=document.cookie.split('; ');
for(var i=0;i<cookies.length;i++)
{
var cookie=cookies[i].split('=');
if(cookie[0]==cookieName)
{
cookieValue=cookie[1];
break;
}
}
}
return cookieValue;
}
function check4SupportedBrowser(supportedBrowsers)
{
var userAgent=new String(navigator.userAgent);
var isCorrectBrowser=false;
var browsers=supportedBrowsers.split(',');
for(var i=0;i<browsers.length;i++)
{
if(userAgent.toUpperCase().indexOf(browsers[i])>-1)
{
isCorrectBrowser=true;
break;
}
}
return isCorrectBrowser;
}
function showIPReportManager()
{
var sAttrib="dialogHeight="+window.screen.availHeight+"px;dialogWidth="+window.screen.availWidth+"px;center:yes;help:no;resizable:yes;scroll:no;status:no";
window.open('/LMDefault.asp?MLXFunction=FusionReportManager&iProfileID=-100','ReportManagerInFusion',sAttrib);
}
function showHelp(p_sURL)
{
var winHelp=window.open(p_sURL,"Fusion On-line Help","height=580,width=832,status=no,toolbar=no,titlebar=no,menubar=no,location=no,resizable=yes");
winHelp.focus();
}
var motdTab;
var selectedIndex
function showMOTDTabs(motdTabs,defaultTabSelected)
{
selectedIndex=defaultTabSelected;
motdTab=motdTabs;
window.open("MOTD.html","MessageoftheDay","width=700,height=600");
}
function showModalWindow(p_sURL)
{
try{
var sFeatures="dialogHeight: 700px; dialogWidth: 800px; help: no; scroll: no; status: no";
iWinReturn=window.showModalDialog(p_sURL,true,sFeatures);
var reauth=getCookieValue("ReauthLoginTS");
if(reauth!=null&&reauth!="")
{
windowClose();
}
else
{
onReauthenticateComplete();
}
}
catch(e)
{
var reauthen=getCookieValue("ReauthLoginTS");
if(reauthen!=null&&reauthen!="")
{
windowClose();
}
else
{
onReauthenticateComplete();
}
}
}
function windowClose()
{
try
{
var app=document.getElementById("App");
if(app==null)
{
app=document.getElementByName("App");
}
if(app!=null)
{
app.ssoLogout();
}
else
{
App.ssoLogout();
}
}catch(e)
{
var appli=document.getElementById("App");
if(appli==null)
{
appli=document.getElementByName("App");
}
if(appli!=null)
{
appli.ssoLogout();
}
else
{
App.ssoLogout();
}
}
}


