        var map=null;var tools=new Array('favWindow','EmailForm');function $(id){return document.getElementById(id);}
function Empty(id){$(id).innerHTML='';}
function ShowHide(id){$(id).style.display = (($(id).style.display=='block')? 'none' : 'block');}
function Show(id){$(id).style.display='';}
function Block(id){$(id).style.display='block';}
function Hide(id){$(id).style.display='none';}
function Visible(id){$(id).style.visibility='visible';}
function InVisible(id){$(id).style.visibility='hidden';}
function SwapImg(id,src){$(id).src=src;}
function addLoadEvent(func){var oldonload = window.onload;if (typeof window.onload != 'function'){window.onload = func;}
else{window.onload = function(){if (oldonload){oldonload();}
func();}
}
}
var mTimer=null;function mHide(){for(i=0;i<mItems.length;i++)            Hide(mItems[i]);}
function mClear(){if (mTimer)             clearTimeout(mTimer);mTimer=null;}
function mStart(){mTimer = setTimeout("mHide()",800);}
function RemoveWin(id){$(id).parentNode.parentNode.removeChild($(id).parentNode);try{UnClipAll();}
catch(err){}
}
function AddWin(res,WinName,WinHandle){if($(WinName)==null){var newdiv = document.createElement('div');newdiv.innerHTML = res.value.Obj;$('AJAXArea').appendChild(newdiv);Drag.init($(WinHandle),$(WinName));$(WinName).style.top=posTop()+'px';$(WinName).style.right='0px';if(WinName=='EmailForm' && $('favWindow')!=null)                $('EmailForm').style.left='350px';try{UnClipAll();for(i in tools)                    if($(tools[i])!=null)                                             ClipAll($(tools[i]));}
catch(err){}
}
}
function posTop(){return typeof window.pageYOffset != 'undefined' ? window.pageYOffset: document.documentElement.scrollTop? document.documentElement.scrollTop: document.body.scrollTop? document.body.scrollTop:0;}
function ScrollStuff(){var yPos=posTop();for(i in tools)            if($(tools[i])!=null)                $(tools[i]).style.top=yPos+'px';try{UnClipAll();}
catch(err){}
for(i in tools)            try{ClipAll($(tools[i]));}
catch(err){}
}
window.onscroll=ScrollStuff;function FavVisible(){if($('favWindow')==null) return false;else return true;}
function QSVisible(){if($('QSWindow')==null) return false;else return true;}
function FavToggle(MLS_Number,IsFav){var hfs=document.getElementsByTagName('input');for(var i=0;i<hfs.length;i++){if(hfs[i].value=='Add'+MLS_Number)                    if(IsFav) hfs[i].parentNode.style.display='none';else hfs[i].parentNode.style.display='block';if(hfs[i].value=='Remove'+MLS_Number)                    if(IsFav) hfs[i].parentNode.style.display='block';else hfs[i].parentNode.style.display='none';}
}
function Callback(res){try{eval(res.value.Java);}
catch(err){}
}
var ssCnt;var ssImage=null;var ssArray=null;var ssPauseID=null;var ssPlayID=null;var ssPause=false;function SS(){if(ssImage!=null && !ssPause){if(ssCnt==ssArray.length) ssCnt=0;$(ssImage).src=ssArray[ssCnt];ssCnt++;}
setTimeout("SS()",3200);}
setTimeout("SS()",1000);function startSS(imgID,arID,playID,pauseID){if(ssImage!=imgID){ssPause=false;PlayPauseSS();ssImage=imgID;ssArray = $(arID).value.split(",");ssCnt=1;ssPlayID=playID;ssPauseID=pauseID;PlayPauseSS();}
}
function PlayPauseSS(){ssPause = (ssPause ? false : true);if(ssPlayID!=null) $(ssPlayID).style.display=(ssPause ? '' : 'none');if(ssPauseID!=null)$(ssPauseID).style.display=(ssPause ? 'none' : '');}
function NextSS(){if(ssPause!=true) PlayPauseSS();ssCnt++;if(ssCnt>=ssArray.length) ssCnt=0;$(ssImage).src=ssArray[ssCnt];}
function LastSS(){if(ssPause!=true) PlayPauseSS();ssCnt--;if(ssCnt < 0) ssCnt = (ssArray.length - 1);$(ssImage).src=ssArray[ssCnt];}
var MapZoomLevel = 17;function ZoomMap(In){if(In){if(MapZoomLevel < 17){MapZoomLevel++;map.SetZoomLevel(MapZoomLevel);}
}
else{if(MapZoomLevel > 8){MapZoomLevel--;map.SetZoomLevel(MapZoomLevel);}
}
$('divDebug').innerHTML=MapZoomLevel;}
function NumbersOnly(raw){var stripped=' ';var strValidChars = "0123456789";for(i=1;i<=raw.length;i++)            if (strValidChars.indexOf(raw.substring(i-1,i)) > -1)                 stripped += raw.substring(i-1,i);return stripped.replace(' ','');}
var ClientFavorites=null;function mLogIn(){Magic.IDX.Application.Controls.AJAXArea.GetFavorites(mFavorites_Callback);}
function mFavorites_Callback(res){ClientFavorites=res.value;AjaxPro.Services.Authentication.Login($('mLoginUserName').value, $('mLoginPassword').value, mLogIn_Callback);}
function mLogIn_Callback(res){if(res.value){Magic.IDX.Application.Controls.AJAXArea.SetFavorites(ClientFavorites);}
}
function keyDown(e){try{if(event.keyCode==113) LogInPrompt();}
catch(err){}
}
document.onkeydown = keyDown;function LogInPrompt(){$('divAdminLogin').style.display='block';$('username').focus() }
function LogIn(){$('imgAJAX').style.visibility='visible';AjaxPro.Services.Authentication.Login($('username').value, $('password').value, LogIn_Callback);}
function LogIn_Callback(res){if(res.value){$('LogInError').style.color='green';$('LogInError').innerHTML='Login Successful!';$('LogInError').style.visibility='visible';window.location.href="/ui";}
else{$('LogInError').style.visibility='visible';$('imgAJAX').style.visibility='hidden';}
res = null;}
function checkEnter(e){var characterCode;if(e && e.which){e = e;characterCode = e.which;}
else{e = event;characterCode = e.keyCode;}
if(characterCode == 13){LogIn();return false;}
else{return true;}
}
var tabcontentIDs=new Object();function expandcontent(linkobj){var ulid=linkobj.parentNode.parentNode.id;var ullist=document.getElementById(ulid).getElementsByTagName("li");for (var i=0;i<ullist.length;i++){ullist[i].className="";if (typeof tabcontentIDs[ulid][i]!="undefined")             document.getElementById(tabcontentIDs[ulid][i]).style.display="none";}
linkobj.parentNode.className="selected";document.getElementById(linkobj.getAttribute("rel")).style.display="block";}
function expandtab(tabcontentid, tabnumber){var thetab=document.getElementById(tabcontentid).getElementsByTagName("a")[tabnumber];if (thetab.getAttribute("rel"))        expandcontent(thetab);}
function savetabcontentids(ulid, relattribute){if (typeof tabcontentIDs[ulid]=="undefined")         tabcontentIDs[ulid]=new Array();tabcontentIDs[ulid][tabcontentIDs[ulid].length]=relattribute;}
function getullistlinkbyId(ulid, tabcontentid){var ullist=document.getElementById(ulid).getElementsByTagName("li");for (var i=0;i<ullist.length;i++){if (ullist[i].getElementsByTagName("a")[0].getAttribute("rel")==tabcontentid){return ullist[i].getElementsByTagName("a")[0];break;}
}
}
function initializetabcontent(){for (var i=0;i<arguments.length;i++){var ulobj=document.getElementById(arguments[i]);var ulist=ulobj.getElementsByTagName("li");for (var x=0;x<ulist.length;x++){var ulistlink=ulist[x].getElementsByTagName("a")[0];if (ulistlink.getAttribute("rel")){savetabcontentids(arguments[i], ulistlink.getAttribute("rel"));ulistlink.onclick=function(){expandcontent(this);return false;}
if (ulist[x].className=="selected")                                          expandcontent(ulistlink);}
}
}
}
var offsetfromcursorX=12;var offsetfromcursorY=10;var offsetdivfrompointerX=10;var offsetdivfrompointerY=14;document.write('<div id="ToolTip"><img src="/App_Themes/ToolTipProgress.gif" /></div>');document.write('<img id="ToolTipPointer" src="/App_Themes/ToolTipPointer.gif">');var ie=document.all;var ns6=document.getElementById && !document.all;var enabletip=false;var tipobj=document.getElementById("ToolTip");var pointerobj= document.getElementById("ToolTipPointer");var ToolTipCallbackID='74385c32-7f43-4f62-954e-3e8968509cfe';function ietruebody(){return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;}
function ShowToolTipProgress(id){ToolTipCallbackID=id;enabletip=true;return false;}
function FillToolTip(thetext, thewidth, thecolor){if (enabletip)            if(thetext.indexOf(ToolTipCallbackID)>-1){if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px";if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor;if (typeof thetext!="undefined" && thetext!="")tipobj.innerHTML=thetext;}
return false;}
function ShowToolTip(thetext, thewidth, thecolor){ToolTipCallbackID='8bf3fce6-50cf-49e6-b120-f49441a4ecf0';if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px";if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor;if (typeof thetext!="undefined" && thetext!="")tipobj.innerHTML=thetext;enabletip=true;return false;}
function positiontip(e){if (enabletip){var nondefaultpos=false;var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20;var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20;var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX;var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY;var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000;if (rightedge<tipobj.offsetWidth){tipobj.style.left=curX-tipobj.offsetWidth+"px";nondefaultpos=true;}
else if (curX<leftedge)            tipobj.style.left="5px";else{tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px";pointerobj.style.left=curX+offsetfromcursorX+"px";}
if (bottomedge<tipobj.offsetHeight){tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px";nondefaultpos=true;}
else{tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px";pointerobj.style.top=curY+offsetfromcursorY+"px";}
tipobj.style.visibility="visible";if (!nondefaultpos)            pointerobj.style.visibility="visible";else            pointerobj.style.visibility="hidden";}
}
function HideToolTip(){if(enabletip) enabletip=false;tipobj.style.visibility="hidden";pointerobj.style.visibility="hidden";tipobj.style.left="-1000px";tipobj.style.backgroundColor='';tipobj.style.width='';tipobj.innerHTML='<img src="/App_Themes/ToolTipProgress.gif" />';}
document.onmousemove=positiontip;var Drag ={obj : null,        init : function(o, oRoot, minX, maxX, minY, maxY, bSwapHorzRef, bSwapVertRef, fXMapper, fYMapper){HideToolTip();o.onmousedown= Drag.start;o.hmode= bSwapHorzRef ? false : true ;o.vmode= bSwapVertRef ? false : true ;o.root = oRoot && oRoot != null ? oRoot : o ;if (o.hmode  && isNaN(parseInt(o.root.style.left  ))) o.root.style.left   = "0px";if (o.vmode  && isNaN(parseInt(o.root.style.top   ))) o.root.style.top    = "0px";if (!o.hmode && isNaN(parseInt(o.root.style.right ))) o.root.style.right  = "0px";if (!o.vmode && isNaN(parseInt(o.root.style.bottom))) o.root.style.bottom = "0px";o.minX= typeof minX != 'undefined' ? minX : null;o.minY= typeof minY != 'undefined' ? minY : null;o.maxX= typeof maxX != 'undefined' ? maxX : null;o.maxY= typeof maxY != 'undefined' ? maxY : null;o.xMapper = fXMapper ? fXMapper : null;o.yMapper = fYMapper ? fYMapper : null;o.root.onDragStart= new Function();o.root.onDragEnd= new Function();o.root.onDrag= new Function();}
,        start : function(e){var o = Drag.obj = this;e = Drag.fixE(e);var y = parseInt(o.vmode ? o.root.style.top  : o.root.style.bottom);var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right );o.root.onDragStart(x, y);o.lastMouseX= e.clientX;o.lastMouseY= e.clientY;if (o.hmode){if (o.minX != null)o.minMouseX= e.clientX - x + o.minX;if (o.maxX != null)o.maxMouseX= o.minMouseX + o.maxX - o.minX;}
else{if (o.minX != null) o.maxMouseX = -o.minX + e.clientX + x;if (o.maxX != null) o.minMouseX = -o.maxX + e.clientX + x;}
if (o.vmode){if (o.minY != null)o.minMouseY= e.clientY - y + o.minY;if (o.maxY != null)o.maxMouseY= o.minMouseY + o.maxY - o.minY;}
else{if (o.minY != null) o.maxMouseY = -o.minY + e.clientY + y;if (o.maxY != null) o.minMouseY = -o.maxY + e.clientY + y;}
document.onmousemove= Drag.drag;document.onmouseup= Drag.end;return false;}
,        drag : function(e){e = Drag.fixE(e);var o = Drag.obj;try{UnClipAll();for(i in tools)                    if($(tools[i])!=null)                                             ClipAll($(tools[i]));}
catch(err){}
var ey= e.clientY;var ex= e.clientX;var y = parseInt(o.vmode ? o.root.style.top  : o.root.style.bottom);var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right );var nx, ny;if (o.minX != null) ex = o.hmode ? Math.max(ex, o.minMouseX) : Math.min(ex, o.maxMouseX);if (o.maxX != null) ex = o.hmode ? Math.min(ex, o.maxMouseX) : Math.max(ex, o.minMouseX);if (o.minY != null) ey = o.vmode ? Math.max(ey, o.minMouseY) : Math.min(ey, o.maxMouseY);if (o.maxY != null) ey = o.vmode ? Math.min(ey, o.maxMouseY) : Math.max(ey, o.minMouseY);nx = x + ((ex - o.lastMouseX) * (o.hmode ? 1 : -1));ny = y + ((ey - o.lastMouseY) * (o.vmode ? 1 : -1));if (o.xMapper)nx = o.xMapper(y);else if (o.yMapper)ny = o.yMapper(x);Drag.obj.root.style[o.hmode ? "left" : "right"] = nx + "px";Drag.obj.root.style[o.vmode ? "top" : "bottom"] = ny + "px";Drag.obj.lastMouseX= ex;Drag.obj.lastMouseY= ey;Drag.obj.root.onDrag(nx, ny);return false;}
,        end : function(){document.onmousemove = positiontip;document.onmouseup   = null;Drag.obj.root.onDragEnd(parseInt(Drag.obj.root.style[Drag.obj.hmode ? "left" : "right"]),         parseInt(Drag.obj.root.style[Drag.obj.vmode ? "top" : "bottom"]));try{UnClipAll();for(i in tools)                    if($(tools[i])!=null)                                             ClipAll($(tools[i]));}
catch(err){}
Drag.obj = null;}
,        fixE : function(e){if (typeof e == 'undefined') e = window.event;if (typeof e.layerX == 'undefined') e.layerX = e.offsetX;if (typeof e.layerY == 'undefined') e.layerY = e.offsetY;return e;}
}
