

/*cookieFun.js*/

var YAHOO;
var isIE = document.all?1:0;
var isIE6 = (window.XMLHttpRequest)?0:1;
var usrAgt = navigator.userAgent.toLowerCase();
var isFF = (usrAgt.indexOf('firefox')!=-1)?1:0;
var isOpera = (usrAgt.indexOf('opera')!=-1)?1:0;
var isSafari = ((usrAgt.indexOf('safari')!=-1)&&(usrAgt.indexOf('mac')!=-1))?1:0;
var savedSearch="";


if(typeof(document.getElementsByClassName)!="function")
{
document.getElementsByClassName = function(cl) {
var retnode = [];
var myclass = new RegExp('\\b'+cl+'\\b');
var elem = this.getElementsByTagName('*');
for (var i = 0; i < elem.length; i++)
{
var classes = elem[i].className;
if (myclass.test(classes))
retnode.push(elem[i]);
}
return retnode;
};
}

/**
 * Function that sets the cookie.
 * @author Sanjev Dutta
 * @date 31/01/2007
 * @param {String} name of the cookie
 * @param {String} value of the cookie
 * @param {String} expires expiry time for the cookie
 * @param {String} path path
 * @param {String} domain domain
 * @param {String} secure Secure cookie (SSL)
 */
function setCookie(name, value, expires, path, domain, secure)
{
	//alert(name+" "+value);
	if (name == "msgboxCK" || name == "msgboxCKSignin" || name == "msgboxtutorialcook" || name == "rememberIdPassword" || name == "Cpanel_rememberIdPassword" || name == "pv" || name == "strWidgetCookie")
	{
		if (expires)
		{
			expires = expires.toGMTString();
		}
	}
	else
		expires = null;

  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires : "") +
      ((path) ? "; path=" + path : "; path=/") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
};

/**
 * Function that gets the cookie value for given name.
 * @author Sanjev Dutta
 * @date 31/01/2007
 * @param {String} name of the cookie
 * @return (String) returns the value for the given cookie name.
 */
function getCookie(name)
{
	var dc = document.cookie;
	var prefix = name + "=";
	var begin = dc.indexOf("; " + prefix);
	if (begin == -1)
	{
		begin = dc.indexOf(prefix);
		if (begin != 0) return null;
	} 
	else
		begin += 2;
	var end = document.cookie.indexOf(";", begin);
	if (end == -1)
		end = dc.length;
	var returnCookie = unescape(dc.substring(begin + prefix.length, end));
	if((returnCookie == null) || (returnCookie == 'null'))
	{
		returnCookie = "";
	}

	return returnCookie;
	
};

/**
 * Function that deletes the cookie.
 * @author Sanjev Dutta
 * @date 31/01/2007
 * @param {String} name of the cookie
 * @param {String} path path
 * @param {String} domain domain
 * @return (void)
 */
function deleteCookie(name, path, domain)
{
	if (getCookie(name))
	{
		document.cookie = name + "=" + ((path) ? "; path=" + path : "path=/") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
	}
}


function setShareBtnStyle()
{
        if(!document.getElementsByClassName('stbuttontext')[0] || !document.getElementsByClassName('stbutton')[0])
			setTimeout('setShareBtnStyle',5000);
        else
        {
                if(document.getElementsByClassName('stbuttontext'))
				{
					document.getElementsByClassName('stbuttontext')[0].style.top="-1";
					document.getElementsByClassName('stbuttontext')[0].style.left="-3";
					document.getElementsByClassName('stbuttontext')[0].style.fontWeight="bold";
				}
				if(document.getElementsByClassName('stbutton'))
				{
					document.getElementsByClassName('stbutton')[0].style.textDecoration="none";
				}
        }
}

/*zoomCtrl2.js*/

var Bm=GEvent;
var WebRoot="/wt/"+bkTheme+"/";
function preloadImages()
{
	var img = new Array();
	for(var i=0;i<19;i++)
	{
		img[i]= new Image(100,25); 
		img[i].src=WebRoot+"images/zoom_bar/"+i+".gif"; 
	}
}

function createImageMap()
{
	var mapElm = document.createElement("map2");
	mapElm.id = "ZTracker";
	mapElm.name = "ZTracker";

	var area2 = document.createElement("area");
	area2.shape="rect";
	area2.coords="0,31,16,34";
	area2.href="javascript:DoZoom(2);";
	area2.title="Level 2";
	area2.alt="Level 2";
	mapElm.appendChild(area2);

	var area5 = document.createElement("area");
	area5.shape="rect";
	area5.coords="0,25,16,28";
	area5.href="javascript:DoZoom(5);";
	area5.title="Level 5";
	area5.alt="Level 5";
	mapElm.appendChild(area5);

	var area8 = document.createElement("area");
	area8.shape="rect";
	area8.coords="0,19,16,22";
	area8.href="javascript:DoZoom(8);";
	area8.title="Level 8";
	area8.alt="Level 8";
	mapElm.appendChild(area8);

	var area11 = document.createElement("area");
	area11.shape="rect";
	area11.coords="0,13,16,16";
	area11.href="javascript:DoZoom(11);";
	area11.title="Level 11";
	area11.alt="Level 11";
	mapElm.appendChild(area11);

	var area13 = document.createElement("area");
	area13.shape="rect";
	area13.coords="0,7,16,10";
	area13.href="javascript:DoZoom(13);";
	area13.title="Level 13";
	area13.alt="Level 13";
	mapElm.appendChild(area13);

	var area15 = document.createElement("area");
	area15.shape="rect";
	area15.coords="0,1,16,4";
	area15.href="javascript:DoZoom(15);";
	area15.title="Level 15";
	area15.alt="Level 15";
	mapElm.appendChild(area15);

	document.body.appendChild(mapElm);
}

function ZoomControl(){}
ZoomControl.prototype=new GControl();
ZoomControl.prototype.initialize=function(map2)
{
	var container=document.createElement("div");
	container.className="map_zoom clearfix";
	container.id="ZoomContainer";
	var zoomInDiv=document.createElement("div");
	zoomInDiv.className="zoom_in";
	container.appendChild(zoomInDiv);
	zoomInDiv.innerHTML="<img src='"+WebRoot+"images/zoom_bar/zoom_in.gif' />";
	Bm.addDomListener(zoomInDiv,"click",function()
	{
		if((map2.getZoom()+1)<=16)
		{
			map2.zoomIn();
			//As(false,true);
		}
	});
	var zoomLevel=document.createElement("div");
	zoomLevel.className="level";
	container.appendChild(zoomLevel);
	zoomLevel.innerHTML="<img border='0' src='"+WebRoot+"images/zoom_bar/"+map2.getZoom()+".gif' usemap='#ZTracker' />";
	Bm.addDomListener(map2,"zoomend",function()
	{
		zoomLevel.innerHTML="<img border='0' src='"+WebRoot+"images/zoom_bar/"+map2.getZoom()+".gif' usemap='#ZTracker' />";
	});
	var zoomOutDiv=document.createElement("div");
	zoomOutDiv.className="zoom_out";
	container.appendChild(zoomOutDiv);
	zoomOutDiv.innerHTML="<img src='"+WebRoot+"images/zoom_bar/zoom_out.gif' />";
	Bm.addDomListener(zoomOutDiv,"click",function()
	{
		if(map2.getZoom() > 2)	map2.zoomOut();
		//As(false,true);
	});
	map2.getContainer().appendChild(container);
	preloadImages();
	createImageMap();
	return container;
};
ZoomControl.prototype.getDefaultPosition=function()
{
	return new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(8,8));
};
function DoZoom(num)
{
	map2.setZoom(num);
}


/*mapTypeControl.js*/

function mapTypeControl(){}

mapTypeControl.prototype = new GControl();

mapTypeControl.prototype.initialize = function(map)
{
	var containerT = document.createElement("div");
	containerT.style.zindex = 1000;

	var btnMap = document.createElement("label");
	btnMap.id = "btnMap";
	btnMap.style.paddingLeft="6px";
	btnMap.style.marginRight="-4px";
	this.setButtonStyle_(btnMap,"mapTypeButton");
	containerT.appendChild(btnMap);
	btnMap.appendChild(document.createTextNode("Map"));
	GEvent.addDomListener(btnMap, "click", function(){map.setMapType(G_NORMAL_MAP);});

	var btnSat = document.createElement("label");
	btnSat.id = "btnSat";
	this.setButtonStyle_(btnSat,"mapTypeButton");
	containerT.appendChild(btnSat);
	btnSat.appendChild(document.createTextNode("Sat"));
	GEvent.addDomListener(btnSat, "click", function(){map.setMapType(G_SATELLITE_MAP);});
/*
	/*var btnHyb = document.createElement("label");
	btnHyb.id = "btnHyb";
	this.setButtonStyle_(btnHyb,"mapTypeButton");
	containerT.appendChild(btnHyb);
	btnHyb.appendChild(document.createTextNode("Hyb"));
	GEvent.addDomListener(btnHyb, "click", function(){map.setMapType(G_HYBRID_MAP);});*/

	var btnTer = document.createElement("label");
	btnTer.id = "btnTer";
	this.setButtonStyle_(btnTer,"mapTypeButton");
	containerT.appendChild(btnTer);
	btnTer.appendChild(document.createTextNode("Ter"));
	GEvent.addDomListener(btnTer, "click", function(){map.setMapType(G_PHYSICAL_MAP);});

	map.getContainer().appendChild(containerT);
	return containerT;
}

mapTypeControl.prototype.getDefaultPosition = function()
{
	return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(7, 10));
}

mapTypeControl.prototype.setButtonStyle_ = function(button,cssStyle)
{
	button.className = cssStyle;
}


/*ajaxtabs/ajaxtabs.js*/

//** Ajax Tabs Content script v2.0- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
//** Updated Oct 21st, 07 to version 2.0. Contains numerous improvements
//** Updated Feb 18th, 08 to version 2.1: Adds a public "tabinstance.cycleit(dir)" method to cycle forward or backward between tabs dynamically. Only .js file changed from v2.0.
//** Updated April 8th, 08 to version 2.2:
//   -Adds support for expanding a tab using a URL parameter (ie: http://mysite.com/tabcontent.htm?tabinterfaceid=0) 
//   -Modified Ajax routine so testing the script out locally in IE7 now works 

var ddajaxtabssettings={}
ddajaxtabssettings.bustcachevar=1  //bust potential caching of external pages after initial request? (1=yes, 0=no)
ddajaxtabssettings.loadstatustext="<img src='/js/ajaxtabs/loading.gif' /> Requesting content " 


////NO NEED TO EDIT BELOW////////////////////////

function ddajaxtabs(tabinterfaceid, contentdivid){
	this.tabinterfaceid=tabinterfaceid //ID of Tab Menu main container
	this.tabs=document.getElementById(tabinterfaceid).getElementsByTagName("a") //Get all tab links within container
	this.enabletabpersistence=true
	this.hottabspositions=[] //Array to store position of tabs that have a "rel" attr defined, relative to all tab links, within container
	this.currentTabIndex=0 //Index of currently selected hot tab (tab with sub content) within hottabspositions[] array
	this.contentdivid=contentdivid
	this.defaultHTML=""
	this.defaultIframe='<iframe src="about:blank" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" class="tabcontentiframe" style="width:100%; height:auto; min-height: 100px"></iframe>'
	this.defaultIframe=this.defaultIframe.replace(/<iframe/i, '<iframe name="'+"_ddajaxtabsiframe-"+contentdivid+'" ')
this.revcontentids=[] //Array to store ids of arbitrary contents to expand/contact as well ("rev" attr values)
	this.selectedClassTarget="link" //keyword to indicate which target element to assign "selected" CSS class ("linkparent" or "link")
}

ddajaxtabs.connect=function(pageurl, tabinstance){
	var page_request = false
	var bustcacheparameter=""
	if (window.ActiveXObject){ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
		try {
		page_request = new ActiveXObject("Msxml2.XMLHTTP")
		} 
		catch (e){
			try{
			page_request = new ActiveXObject("Microsoft.XMLHTTP")
			}
			catch (e){}
		}
	}
	else if (window.XMLHttpRequest) // if Mozilla, Safari etc
		page_request = new XMLHttpRequest()
	else
		return false
	var ajaxfriendlyurl=pageurl.replace(/^http:\/\/[^\/]+\//i, "http://"+window.location.hostname+"/") 
	page_request.onreadystatechange=function(){ddajaxtabs.loadpage(page_request, pageurl, tabinstance)}
	if (ddajaxtabssettings.bustcachevar) //if bust caching of external page
		bustcacheparameter=(ajaxfriendlyurl.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
	page_request.open('GET', ajaxfriendlyurl+bustcacheparameter, true)
	page_request.send(null)
}

ddajaxtabs.loadpage=function(page_request, pageurl, tabinstance){
	var divId=tabinstance.contentdivid
	document.getElementById(divId).innerHTML=ddajaxtabssettings.loadstatustext //Display "fetching page message"
	if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){
		document.getElementById(divId).innerHTML=page_request.responseText
		ddajaxtabs.ajaxpageloadaction(pageurl, tabinstance)
	}
}

ddajaxtabs.ajaxpageloadaction=function(pageurl, tabinstance){
	tabinstance.onajaxpageload(pageurl) //call user customized onajaxpageload() function when an ajax page is fetched/ loaded
}

ddajaxtabs.getCookie=function(Name){ 
	var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
	if (document.cookie.match(re)) //if cookie found
		return document.cookie.match(re)[0].split("=")[1] //return its value
	return ""
}

ddajaxtabs.setCookie=function(name, value){
	document.cookie = name+"="+value+";path=/" //cookie value is domain wide (path=/)
}

ddajaxtabs.prototype={

	expandit:function(tabid_or_position){ //PUBLIC function to select a tab either by its ID or position(int) within its peers
		this.cancelautorun() //stop auto cycling of tabs (if running)
		var tabref=""
		try{
			if (typeof tabid_or_position=="string" && document.getElementById(tabid_or_position).getAttribute("rel")) //if specified tab contains "rel" attr
				tabref=document.getElementById(tabid_or_position)
			else if (parseInt(tabid_or_position)!=NaN && this.tabs[tabid_or_position].getAttribute("rel")) //if specified tab contains "rel" attr
				tabref=this.tabs[tabid_or_position]
		}
		catch(err){alert("Invalid Tab ID or position entered!")}
		if (tabref!="") //if a valid tab is found based on function parameter
			this.expandtab(tabref) //expand this tab
	},

	cycleit:function(dir, autorun){ //PUBLIC function to move foward or backwards through each hot tab (tabinstance.cycleit('foward/back') )
		if (dir=="next"){
			var currentTabIndex=(this.currentTabIndex<this.hottabspositions.length-1)? this.currentTabIndex+1 : 0
		}
		else if (dir=="prev"){
			var currentTabIndex=(this.currentTabIndex>0)? this.currentTabIndex-1 : this.hottabspositions.length-1
		}
		if (typeof autorun=="undefined") //if cycleit() is being called by user, versus autorun() function
			this.cancelautorun() //stop auto cycling of tabs (if running)
		this.expandtab(this.tabs[this.hottabspositions[currentTabIndex]])
	},

	setpersist:function(bool){ //PUBLIC function to toggle persistence feature
			this.enabletabpersistence=bool
	},

	loadajaxpage:function(pageurl){ //PUBLIC function to fetch a page via Ajax and display it within the Tab Content instance's container
		ddajaxtabs.connect(pageurl, this)
	},

	loadiframepage:function(pageurl){ //PUBLIC function to fetch a page and load it into the IFRAME of the Tab Content instance's container
		this.iframedisplay(pageurl, this.contentdivid)
	},

	setselectedClassTarget:function(objstr){ //PUBLIC function to set which target element to assign "selected" CSS class ("linkparent" or "link")
		this.selectedClassTarget=objstr || "link"
	},

	getselectedClassTarget:function(tabref){ //Returns target element to assign "selected" CSS class to
		return (this.selectedClassTarget==("linkparent".toLowerCase()))? tabref.parentNode : tabref
	},

	urlparamselect:function(tabinterfaceid){
		var result=window.location.search.match(new RegExp(tabinterfaceid+"=(\\d+)", "i")) //check for "?tabinterfaceid=2" in URL
		return (result==null)? null : parseInt(RegExp.$1) //returns null or index, where index (int) is the selected tab's index
	},

	onajaxpageload:function(pageurl){ //PUBLIC Event handler that can invoke custom code whenever an Ajax page has been fetched and displayed
		//do nothing by default
	},

	expandtab:function(tabref){
		var relattrvalue=tabref.getAttribute("rel")
		//Get "rev" attr as a string of IDs in the format ",john,george,trey,etc," to easy searching through
		var associatedrevids=(tabref.getAttribute("rev"))? ","+tabref.getAttribute("rev").replace(/\s+/, "")+"," : ""
		if (relattrvalue=="#default")
			document.getElementById(this.contentdivid).innerHTML=this.defaultHTML
		else if (relattrvalue=="#iframe")
			this.iframedisplay(tabref.getAttribute("href"), this.contentdivid)
		else
			ddajaxtabs.connect(tabref.getAttribute("href"), this)
		this.expandrevcontent(associatedrevids)
		for (var i=0; i<this.tabs.length; i++){ //Loop through all tabs, and assign only the selected tab the CSS class "selected"
			this.getselectedClassTarget(this.tabs[i]).className=(this.tabs[i].getAttribute("href")==tabref.getAttribute("href"))? "selected" : ""
		}
		if (this.enabletabpersistence) //if persistence enabled, save selected tab position(int) relative to its peers
			ddajaxtabs.setCookie(this.tabinterfaceid, tabref.tabposition)
		this.setcurrenttabindex(tabref.tabposition) //remember position of selected tab within hottabspositions[] array
	},

	iframedisplay:function(pageurl, contentdivid){
		if (typeof window.frames["_ddajaxtabsiframe-"+contentdivid]!="undefined"){
			try{delete window.frames["_ddajaxtabsiframe-"+contentdivid]} //delete iframe within Tab content container if it exists (due to bug in Firefox)
			catch(err){}
		}
		document.getElementById(contentdivid).innerHTML=this.defaultIframe
		window.frames["_ddajaxtabsiframe-"+contentdivid].location.replace(pageurl) //load desired page into iframe
	},


	expandrevcontent:function(associatedrevids){
		var allrevids=this.revcontentids
		for (var i=0; i<allrevids.length; i++){ //Loop through rev attributes for all tabs in this tab interface
			//if any values stored within associatedrevids matches one within allrevids, expand that DIV, otherwise, contract it
			document.getElementById(allrevids[i]).style.display=(associatedrevids.indexOf(","+allrevids[i]+",")!=-1)? "block" : "none"
		}
	},

	setcurrenttabindex:function(tabposition){ //store current position of tab (within hottabspositions[] array)
		for (var i=0; i<this.hottabspositions.length; i++){
			if (tabposition==this.hottabspositions[i]){
				this.currentTabIndex=i
				break
			}
		}
	},

	autorun:function(){ //function to auto cycle through and select tabs based on a set interval
		this.cycleit('next', true)
	},

	cancelautorun:function(){
		if (typeof this.autoruntimer!="undefined")
			clearInterval(this.autoruntimer)
	},

	init:function(automodeperiod){
		var persistedtab=ddajaxtabs.getCookie(this.tabinterfaceid) //get position of persisted tab (applicable if persistence is enabled)
		var selectedtab=-1 //Currently selected tab index (-1 meaning none)
		var selectedtabfromurl=this.urlparamselect(this.tabinterfaceid) //returns null or index from: tabcontent.htm?tabinterfaceid=index
		this.automodeperiod=automodeperiod || 0
		this.defaultHTML=document.getElementById(this.contentdivid).innerHTML
		for (var i=0; i<this.tabs.length; i++){
			this.tabs[i].tabposition=i //remember position of tab relative to its peers
			if (this.tabs[i].getAttribute("rel")){
				var tabinstance=this
				this.hottabspositions[this.hottabspositions.length]=i //store position of "hot" tab ("rel" attr defined) relative to its peers
				this.tabs[i].onclick=function(){
					tabinstance.expandtab(this)
					tabinstance.cancelautorun() //stop auto cycling of tabs (if running)
					return false
				}
				if (this.tabs[i].getAttribute("rev")){ //if "rev" attr defined, store each value within "rev" as an array element
					this.revcontentids=this.revcontentids.concat(this.tabs[i].getAttribute("rev").split(/\s*,\s*/))
				}
				if (selectedtabfromurl==i || this.enabletabpersistence && selectedtab==-1 && parseInt(persistedtab)==i || !this.enabletabpersistence && selectedtab==-1 && this.getselectedClassTarget(this.tabs[i]).className=="selected"){
					selectedtab=i //Selected tab index, if found
				}
			}
		} //END for loop
		if (selectedtab!=-1) //if a valid default selected tab index is found
			this.expandtab(this.tabs[selectedtab]) //expand selected tab (either from URL parameter, persistent feature, or class="selected" class)
		else //if no valid default selected index found
			this.expandtab(this.tabs[this.hottabspositions[0]]) //Just select first tab that contains a "rel" attr
		if (parseInt(this.automodeperiod)>500 && this.hottabspositions.length>1){
			this.autoruntimer=setInterval(function(){tabinstance.autorun()}, this.automodeperiod)
		}
	} //END int() function

} //END Prototype assignment

/*./thirdParty/jquery-1.2.3.pack.js*/

/*
 * jQuery 1.2.3 - New Wave Javascript
 *
 * Copyright (c) 2008 John Resig (jquery.com)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * $Date: 2008-02-06 00:21:25 -0500 (Wed, 06 Feb 2008) $
 * $Rev: 4663 $
 */
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(J(){7(1c.3w)L u=1c.3w;L v=1c.3w=J(a,b){K 1A v.2g.4H(a,b)};7(1c.$)L w=1c.$;1c.$=v;L x=/^[^<]*(<(.|\\s)+>)[^>]*$|^#(\\w+)$/;L y=/^.[^:#\\[\\.]*$/;v.1m=v.2g={4H:J(a,b){a=a||T;7(a.15){6[0]=a;6.M=1;K 6}N 7(1n a=="25"){L c=x.2N(a);7(c&&(c[1]||!b)){7(c[1])a=v.48([c[1]],b);N{L d=T.4I(c[3]);7(d)7(d.2h!=c[3])K v().2i(a);N{6[0]=d;6.M=1;K 6}N a=[]}}N K 1A v(b).2i(a)}N 7(v.1p(a))K 1A v(T)[v.1m.1Y?"1Y":"3x"](a);K 6.5N(a.1j==1K&&a||(a.4J||a.M&&a!=1c&&!a.15&&a[0]!=10&&a[0].15)&&v.2z(a)||[a])},4J:"1.2.3",7e:J(){K 6.M},M:0,1Z:J(a){K a==10?v.2z(6):6[a]},2A:J(a){L b=v(a);b.4K=6;K b},5N:J(a){6.M=0;1K.2g.1g.1h(6,a);K 6},R:J(a,b){K v.R(6,a,b)},4L:J(a){L b=-1;6.R(J(i){7(6==a)b=i});K b},1F:J(a,b,c){L d=a;7(a.1j==49)7(b==10)K 6.M&&v[c||"1F"](6[0],a)||10;N{d={};d[a]=b}K 6.R(J(i){Q(a 1q d)v.1F(c?6.W:6,a,v.1k(6,d[a],c,i,a))})},1l:J(a,b){7((a==\'26\'||a==\'1O\')&&2B(b)<0)b=10;K 6.1F(a,b,"2j")},1t:J(a){7(1n a!="38"&&a!=V)K 6.4a().39((6[0]&&6[0].2k||T).4M(a));L b="";v.R(a||6,J(){v.R(6.3a,J(){7(6.15!=8)b+=6.15!=1?6.5O:v.1m.1t([6])})});K b},4N:J(b){7(6[0])v(b,6[0].2k).4O().3b(6[0]).27(J(){L a=6;28(a.1B)a=a.1B;K a}).39(6);K 6},7f:J(a){K 6.R(J(){v(6).5P().4N(a)})},7g:J(a){K 6.R(J(){v(6).4N(a)})},39:J(){K 6.3y(18,P,S,J(a){7(6.15==1)6.3c(a)})},5Q:J(){K 6.3y(18,P,P,J(a){7(6.15==1)6.3b(a,6.1B)})},5R:J(){K 6.3y(18,S,S,J(a){6.1a.3b(a,6)})},4P:J(){K 6.3y(18,S,P,J(a){6.1a.3b(a,6.2C)})},3d:J(){K 6.4K||v([])},2i:J(b){L c=v.27(6,J(a){K v.2i(b,a)});K 6.2A(/[^+>] [^+>]/.17(b)||b.1f("..")>-1?v.4Q(c):c)},4O:J(d){L e=6.27(J(){7(v.14.1d&&!v.3z(6)){L a=6.5S(P),4R=T.3e("1v");4R.3c(a);K v.48([4R.3f])[0]}N K 6.5S(P)});L f=e.2i("*").4S().R(J(){7(6[A]!=10)6[A]=V});7(d===P)6.2i("*").4S().R(J(i){7(6.15==3)K;L a=v.O(6,"2O");Q(L b 1q a)Q(L c 1q a[b])v.16.1b(f[i],b,a[b][c],a[b][c].O)});K e},1C:J(b){K 6.2A(v.1p(b)&&v.3A(6,J(a,i){K b.1P(a,i)})||v.3g(b,6))},4T:J(a){7(a.1j==49)7(y.17(a))K 6.2A(v.3g(a,6,P));N a=v.3g(a,6);L b=a.M&&a[a.M-1]!==10&&!a.15;K 6.1C(J(){K b?v.2P(6,a)<0:6!=a})},1b:J(a){K!a?6:6.2A(v.2Q(6.1Z(),a.1j==49?v(a).1Z():a.M!=10&&(!a.12||v.12(a,"3h"))?a:[a]))},3B:J(a){K a?v.3g(a,6).M>0:S},7h:J(a){K 6.3B("."+a)},5T:J(b){7(b==10){7(6.M){L c=6[0];7(v.12(c,"2l")){L d=c.3C,4U=[],11=c.11,2R=c.U=="2l-2R";7(d<0)K V;Q(L i=2R?d:0,29=2R?d+1:11.M;i<29;i++){L e=11[i];7(e.2m){b=v.14.1d&&!e.7i.1D.7j?e.1t:e.1D;7(2R)K b;4U.1g(b)}}K 4U}N K(6[0].1D||"").1r(/\\r/g,"")}K 10}K 6.R(J(){7(6.15!=1)K;7(b.1j==1K&&/4V|4W/.17(6.U))6.3i=(v.2P(6.1D,b)>=0||v.2P(6.2S,b)>=0);N 7(v.12(6,"2l")){L a=b.1j==1K?b:[b];v("7k",6).R(J(){6.2m=(v.2P(6.1D,a)>=0||v.2P(6.1t,a)>=0)});7(!a.M)6.3C=-1}N 6.1D=b})},3j:J(a){K a==10?(6.M?6[0].3f:V):6.4a().39(a)},5U:J(a){K 6.4P(a).1Q()},5V:J(i){K 6.2D(i,i+1)},2D:J(){K 6.2A(1K.2g.2D.1h(6,18))},27:J(b){K 6.2A(v.27(6,J(a,i){K b.1P(a,i,a)}))},4S:J(){K 6.1b(6.4K)},O:J(a,b){L c=a.21(".");c[1]=c[1]?"."+c[1]:"";7(b==V){L d=6.4X("7l"+c[1]+"!",[c[0]]);7(d==10&&6.M)d=v.O(6[0],a);K d==V&&c[1]?6.O(c[0]):d}N K 6.1L("7m"+c[1]+"!",[c[0],b]).R(J(){v.O(6,a,b)})},2T:J(a){K 6.R(J(){v.2T(6,a)})},3y:J(d,e,f,g){L h=6.M>1,3k;K 6.R(J(){7(!3k){3k=v.48(d,6.2k);7(f)3k.7n()}L b=6;7(e&&v.12(6,"1R")&&v.12(3k[0],"4b"))b=6.3D("1S")[0]||6.3c(6.2k.3e("1S"));L c=v([]);v.R(3k,J(){L a=h?v(6).4O(P)[0]:6;7(v.12(a,"1o")){c=c.1b(a)}N{7(a.15==1)c=c.1b(v("1o",a).1Q());g.1P(b,a)}});c.R(5W)})}};v.2g.4H.2g=v.2g;J 5W(i,a){7(a.3E)v.3F({1e:a.3E,3l:S,1G:"1o"});N v.4Y(a.1t||a.5X||a.3f||"");7(a.1a)a.1a.2U(a)}v.1s=v.1m.1s=J(){L a=18[0]||{},i=1,M=18.M,4Z=S,11;7(a.1j==7o){4Z=a;a=18[1]||{};i=2}7(1n a!="38"&&1n a!="J")a={};7(M==1){a=6;i=0}Q(;i<M;i++)7((11=18[i])!=V)Q(L b 1q 11){7(a===11[b])5Y;7(4Z&&11[b]&&1n 11[b]=="38"&&a[b]&&!11[b].15)a[b]=v.1s(a[b],11[b]);N 7(11[b]!=10)a[b]=11[b]}K a};L A="3w"+(1A 3G()).3H(),5Z=0,50={};L B=/z-?4L|7p-?7q|1w|60|7r-?1O/i;v.1s({7s:J(a){1c.$=w;7(a)1c.3w=u;K v},1p:J(a){K!!a&&1n a!="25"&&!a.12&&a.1j!=1K&&/J/i.17(a+"")},3z:J(a){K a.1H&&!a.1i||a.2a&&a.2k&&!a.2k.1i},4Y:J(a){a=v.3m(a);7(a){L b=T.3D("61")[0]||T.1H,1o=T.3e("1o");1o.U="1t/4c";7(v.14.1d)1o.1t=a;N 1o.3c(T.4M(a));b.3c(1o);b.2U(1o)}},12:J(a,b){K a.12&&a.12.2E()==b.2E()},1T:{},O:J(a,b,c){a=a==1c?50:a;L d=a[A];7(!d)d=a[A]=++5Z;7(b&&!v.1T[d])v.1T[d]={};7(c!=10)v.1T[d][b]=c;K b?v.1T[d][b]:d},2T:J(a,b){a=a==1c?50:a;L c=a[A];7(b){7(v.1T[c]){2V v.1T[c][b];b="";Q(b 1q v.1T[c])1U;7(!b)v.2T(a)}}N{1V{2V a[A]}1W(e){7(a.51)a.51(A)}2V v.1T[c]}},R:J(a,b,c){7(c){7(a.M==10){Q(L d 1q a)7(b.1h(a[d],c)===S)1U}N Q(L i=0,M=a.M;i<M;i++)7(b.1h(a[i],c)===S)1U}N{7(a.M==10){Q(L d 1q a)7(b.1P(a[d],d,a[d])===S)1U}N Q(L i=0,M=a.M,1D=a[0];i<M&&b.1P(1D,i,1D)!==S;1D=a[++i]){}}K a},1k:J(a,b,c,i,d){7(v.1p(b))b=b.1P(a,i);K b&&b.1j==52&&c=="2j"&&!B.17(d)?b+"2W":b},1u:{1b:J(b,c){v.R((c||"").21(/\\s+/),J(i,a){7(b.15==1&&!v.1u.3I(b.1u,a))b.1u+=(b.1u?" ":"")+a})},1Q:J(b,c){7(b.15==1)b.1u=c!=10?v.3A(b.1u.21(/\\s+/),J(a){K!v.1u.3I(c,a)}).62(" "):""},3I:J(a,b){K v.2P(b,(a.1u||a).3J().21(/\\s+/))>-1}},63:J(a,b,c){L d={};Q(L e 1q b){d[e]=a.W[e];a.W[e]=b[e]}c.1P(a);Q(L e 1q b)a.W[e]=d[e]},1l:J(b,c,d){7(c=="26"||c=="1O"){L e,3K={3L:"53",54:"22",19:"3M"},3n=c=="26"?["7t","7u"]:["7v","7w"];J 55(){e=c=="26"?b.7x:b.7y;L a=0,2X=0;v.R(3n,J(){a+=2B(v.2j(b,"7z"+6,P))||0;2X+=2B(v.2j(b,"2X"+6+"64",P))||0});e-=23.7A(a+2X)}7(v(b).3B(":4d"))55();N v.63(b,3K,55);K 23.29(0,e)}K v.2j(b,c,d)},2j:J(c,d,e){L f;J 3N(a){7(!v.14.2b)K S;L b=T.4e.56(a,V);K!b||b.57("3N")==""}7(d=="1w"&&v.14.1d){f=v.1F(c.W,"1w");K f==""?"1":f}7(v.14.2F&&d=="19"){L g=c.W.58;c.W.58="0 7B 7C";c.W.58=g}7(d.1E(/4f/i))d=D;7(!e&&c.W&&c.W[d])f=c.W[d];N 7(T.4e&&T.4e.56){7(d.1E(/4f/i))d="4f";d=d.1r(/([A-Z])/g,"-$1").2o();L h=T.4e.56(c,V);7(h&&!3N(c))f=h.57(d);N{L j=[],2G=[];Q(L a=c;a&&3N(a);a=a.1a)2G.59(a);Q(L i=0;i<2G.M;i++)7(3N(2G[i])){j[i]=2G[i].W.19;2G[i].W.19="3M"}f=d=="19"&&j[2G.M-1]!=V?"2H":(h&&h.57(d))||"";Q(L i=0;i<j.M;i++)7(j[i]!=V)2G[i].W.19=j[i]}7(d=="1w"&&f=="")f="1"}N 7(c.4g){L k=d.1r(/\\-(\\w)/g,J(a,b){K b.2E()});f=c.4g[d]||c.4g[k];7(!/^\\d+(2W)?$/i.17(f)&&/^\\d/.17(f)){L l=c.W.2c,3O=c.3O.2c;c.3O.2c=c.4g.2c;c.W.2c=f||0;f=c.W.7D+"2W";c.W.2c=l;c.3O.2c=3O}}K f},48:J(h,k){L l=[];k=k||T;7(1n k.3e==\'10\')k=k.2k||k[0]&&k[0].2k||T;v.R(h,J(i,d){7(!d)K;7(d.1j==52)d=d.3J();7(1n d=="25"){d=d.1r(/(<(\\w+)[^>]*?)\\/>/g,J(a,b,c){K c.1E(/^(7E|7F|65|7G|4h|66|7H|3o|7I|7J|7K)$/i)?a:b+"></"+c+">"});L e=v.3m(d).2o(),1v=k.3e("1v");L f=!e.1f("<7L")&&[1,"<2l 67=\'67\'>","</2l>"]||!e.1f("<7M")&&[1,"<68>","</68>"]||e.1E(/^<(7N|1S|7O|7P|7Q)/)&&[1,"<1R>","</1R>"]||!e.1f("<4b")&&[2,"<1R><1S>","</1S></1R>"]||(!e.1f("<7R")||!e.1f("<7S"))&&[3,"<1R><1S><4b>","</4b></1S></1R>"]||!e.1f("<65")&&[2,"<1R><1S></1S><69>","</69></1R>"]||v.14.1d&&[1,"1v<1v>","</1v>"]||[0,"",""];1v.3f=f[1]+d+f[2];28(f[0]--)1v=1v.5a;7(v.14.1d){L g=!e.1f("<1R")&&e.1f("<1S")<0?1v.1B&&1v.1B.3a:f[1]=="<1R>"&&e.1f("<1S")<0?1v.3a:[];Q(L j=g.M-1;j>=0;--j)7(v.12(g[j],"1S")&&!g[j].3a.M)g[j].1a.2U(g[j]);7(/^\\s/.17(d))1v.3b(k.4M(d.1E(/^\\s*/)[0]),1v.1B)}d=v.2z(1v.3a)}7(d.M===0&&(!v.12(d,"3h")&&!v.12(d,"2l")))K;7(d[0]==10||v.12(d,"3h")||d.11)l.1g(d);N l=v.2Q(l,d)});K l},1F:J(c,d,e){7(!c||c.15==3||c.15==8)K 10;L f=v.3z(c)?{}:v.3K;7(d=="2m"&&v.14.2b)c.1a.3C;7(f[d]){7(e!=10)c[f[d]]=e;K c[f[d]]}N 7(v.14.1d&&d=="W")K v.1F(c.W,"7T",e);N 7(e==10&&v.14.1d&&v.12(c,"3h")&&(d=="7U"||d=="7V"))K c.7W(d).5O;N 7(c.2a){7(e!=10){7(d=="U"&&v.12(c,"4h")&&c.1a)6a"U 7X 7Y\'t 7Z 80";c.81(d,""+e)}7(v.14.1d&&/6b|3E/.17(d)&&!v.3z(c))K c.4i(d,2);K c.4i(d)}N{7(d=="1w"&&v.14.1d){7(e!=10){c.60=1;c.1C=(c.1C||"").1r(/6c\\([^)]*\\)/,"")+(2B(e).3J()=="82"?"":"6c(1w="+e*6d+")")}K c.1C&&c.1C.1f("1w=")>=0?(2B(c.1C.1E(/1w=([^)]*)/)[1])/6d).3J():""}d=d.1r(/-([a-z])/83,J(a,b){K b.2E()});7(e!=10)c[d]=e;K c[d]}},3m:J(a){K(a||"").1r(/^\\s+|\\s+$/g,"")},2z:J(a){L b=[];7(1n a!="84")Q(L i=0,M=a.M;i<M;i++)b.1g(a[i]);N b=a.2D(0);K b},2P:J(a,b){Q(L i=0,M=b.M;i<M;i++)7(b[i]==a)K i;K-1},2Q:J(a,b){7(v.14.1d){Q(L i=0;b[i];i++)7(b[i].15!=8)a.1g(b[i])}N Q(L i=0;b[i];i++)a.1g(b[i]);K a},4Q:J(a){L b=[],2p={};1V{Q(L i=0,M=a.M;i<M;i++){L c=a[i];7("38"==1n a[i]){c=v.O(a[i])}7(!2p[c]){2p[c]=P;b.1g(a[i])}}}1W(e){b=a}K b},3A:J(a,b,c){L d=[];Q(L i=0,M=a.M;i<M;i++)7(!c&&b(a[i],i)||c&&!b(a[i],i))d.1g(a[i]);K d},27:J(a,b){L c=[];Q(L i=0,M=a.M;i<M;i++){L d=b(a[i],i);7(d!==V&&d!=10){7(d.1j!=1K)d=[d];c=c.6e(d)}}K c}});L C=85.86.2o();v.14={5b:(C.1E(/.+(?:87|88|89|8a)[\\/: ]([\\d.]+)/)||[])[1],2b:/6f/.17(C),2F:/2F/.17(C),1d:/1d/.17(C)&&!/2F/.17(C),3P:/3P/.17(C)&&!/(8b|6f)/.17(C)};L D=v.14.1d?"6g":"6h";v.1s({8c:!v.14.1d||T.6i=="6j",3K:{"Q":"8d","8e":"1u","4f":D,6h:D,6g:D,3f:"3f",1u:"1u",1D:"1D",2Y:"2Y",3i:"3i",8f:"8g",2m:"2m",8h:"8i",3C:"3C",6k:"6k",2a:"2a",12:"12"}});v.R({6l:J(a){K a.1a},8j:J(a){K v.4j(a,"1a")},8k:J(a){K v.2Z(a,2,"2C")},8l:J(a){K v.2Z(a,2,"4k")},8m:J(a){K v.4j(a,"2C")},8n:J(a){K v.4j(a,"4k")},8o:J(a){K v.5c(a.1a.1B,a)},8p:J(a){K v.5c(a.1B)},5P:J(a){K v.12(a,"8q")?a.8r||a.8s.T:v.2z(a.3a)}},J(c,d){v.1m[c]=J(a){L b=v.27(6,d);7(a&&1n a=="25")b=v.3g(a,b);K 6.2A(v.4Q(b))}});v.R({6m:"39",8t:"5Q",3b:"5R",8u:"4P",8v:"5U"},J(b,c){v.1m[b]=J(){L a=18;K 6.R(J(){Q(L i=0,M=a.M;i<M;i++)v(a[i])[c](6)})}});v.R({8w:J(a){v.1F(6,a,"");7(6.15==1)6.51(a)},8x:J(a){v.1u.1b(6,a)},8y:J(a){v.1u.1Q(6,a)},8z:J(a){v.1u[v.1u.3I(6,a)?"1Q":"1b"](6,a)},1Q:J(a){7(!a||v.1C(a,[6]).r.M){v("*",6).1b(6).R(J(){v.16.1Q(6);v.2T(6)});7(6.1a)6.1a.2U(6)}},4a:J(){v(">*",6).1Q();28(6.1B)6.2U(6.1B)}},J(a,b){v.1m[a]=J(){K 6.R(b,18)}});v.R(["8A","64"],J(i,b){L c=b.2o();v.1m[c]=J(a){K 6[0]==1c?v.14.2F&&T.1i["5d"+b]||v.14.2b&&1c["8B"+b]||T.6i=="6j"&&T.1H["5d"+b]||T.1i["5d"+b]:6[0]==T?23.29(23.29(T.1i["5e"+b],T.1H["5e"+b]),23.29(T.1i["5f"+b],T.1H["5f"+b])):a==10?(6.M?v.1l(6[0],c):V):6.1l(c,a.1j==49?a:a+"2W")}});L E=v.14.2b&&4l(v.14.5b)<8C?"(?:[\\\\w*4m-]|\\\\\\\\.)":"(?:[\\\\w\\8D-\\8E*4m-]|\\\\\\\\.)",6n=1A 4n("^>\\\\s*("+E+"+)"),6o=1A 4n("^("+E+"+)(#)("+E+"+)"),6p=1A 4n("^([#.]?)("+E+"*)");v.1s({6q:{"":J(a,i,m){K m[2]=="*"||v.12(a,m[2])},"#":J(a,i,m){K a.4i("2h")==m[2]},":":{8F:J(a,i,m){K i<m[3]-0},8G:J(a,i,m){K i>m[3]-0},2Z:J(a,i,m){K m[3]-0==i},5V:J(a,i,m){K m[3]-0==i},3p:J(a,i){K i==0},3Q:J(a,i,m,r){K i==r.M-1},6r:J(a,i){K i%2==0},6s:J(a,i){K i%2},"3p-4o":J(a){K a.1a.3D("*")[0]==a},"3Q-4o":J(a){K v.2Z(a.1a.5a,1,"4k")==a},"8H-4o":J(a){K!v.2Z(a.1a.5a,2,"4k")},6l:J(a){K a.1B},4a:J(a){K!a.1B},8I:J(a,i,m){K(a.5X||a.8J||v(a).1t()||"").1f(m[3])>=0},4d:J(a){K"22"!=a.U&&v.1l(a,"19")!="2H"&&v.1l(a,"54")!="22"},22:J(a){K"22"==a.U||v.1l(a,"19")=="2H"||v.1l(a,"54")=="22"},8K:J(a){K!a.2Y},2Y:J(a){K a.2Y},3i:J(a){K a.3i},2m:J(a){K a.2m||v.1F(a,"2m")},1t:J(a){K"1t"==a.U},4V:J(a){K"4V"==a.U},4W:J(a){K"4W"==a.U},5g:J(a){K"5g"==a.U},4p:J(a){K"4p"==a.U},5h:J(a){K"5h"==a.U},6t:J(a){K"6t"==a.U},6u:J(a){K"6u"==a.U},2I:J(a){K"2I"==a.U||v.12(a,"2I")},4h:J(a){K/4h|2l|6v|2I/i.17(a.12)},3I:J(a,i,m){K v.2i(m[3],a).M},8L:J(a){K/h\\d/i.17(a.12)},8M:J(a){K v.3A(v.3R,J(b){K a==b.Y}).M}}},6w:[/^(\\[) *@?([\\w-]+) *([!*$^~=]*) *(\'?"?)(.*?)\\4 *\\]/,/^(:)([\\w-]+)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/,1A 4n("^([:.#]*)("+E+"+)")],3g:J(a,b,c){L d,2q=[];28(a&&a!=d){d=a;L f=v.1C(a,b,c);a=f.t.1r(/^\\s*,\\s*/,"");2q=c?b=f.r:v.2Q(2q,f.r)}K 2q},2i:J(t,a){7(1n t!="25")K[t];7(a&&a.15!=1&&a.15!=9)K[];a=a||T;L b=[a],2p=[],3Q,12;28(t&&3Q!=t){L r=[];3Q=t;t=v.3m(t);L d=S;L e=6n;L m=e.2N(t);7(m){12=m[1].2E();Q(L i=0;b[i];i++)Q(L c=b[i].1B;c;c=c.2C)7(c.15==1&&(12=="*"||c.12.2E()==12))r.1g(c);b=r;t=t.1r(e,"");7(t.1f(" ")==0)5Y;d=P}N{e=/^([>+~])\\s*(\\w*)/i;7((m=e.2N(t))!=V){r=[];L f={};12=m[2].2E();m=m[1];Q(L j=0,3q=b.M;j<3q;j++){L n=m=="~"||m=="+"?b[j].2C:b[j].1B;Q(;n;n=n.2C)7(n.15==1){L g=v.O(n);7(m=="~"&&f[g])1U;7(!12||n.12.2E()==12){7(m=="~")f[g]=P;r.1g(n)}7(m=="+")1U}}b=r;t=v.3m(t.1r(e,""));d=P}}7(t&&!d){7(!t.1f(",")){7(a==b[0])b.4q();2p=v.2Q(2p,b);r=b=[a];t=" "+t.6x(1,t.M)}N{L h=6o;L m=h.2N(t);7(m){m=[0,m[2],m[3],m[1]]}N{h=6p;m=h.2N(t)}m[2]=m[2].1r(/\\\\/g,"");L k=b[b.M-1];7(m[1]=="#"&&k&&k.4I&&!v.3z(k)){L l=k.4I(m[2]);7((v.14.1d||v.14.2F)&&l&&1n l.2h=="25"&&l.2h!=m[2])l=v(\'[@2h="\'+m[2]+\'"]\',k)[0];b=r=l&&(!m[3]||v.12(l,m[3]))?[l]:[]}N{Q(L i=0;b[i];i++){L o=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];7(o=="*"&&b[i].12.2o()=="38")o="3o";r=v.2Q(r,b[i].3D(o))}7(m[1]==".")r=v.5i(r,m[2]);7(m[1]=="#"){L p=[];Q(L i=0;r[i];i++)7(r[i].4i("2h")==m[2]){p=[r[i]];1U}r=p}b=r}t=t.1r(h,"")}}7(t){L q=v.1C(t,r);b=r=q.r;t=v.3m(q.t)}}7(t)b=[];7(b&&a==b[0])b.4q();2p=v.2Q(2p,b);K 2p},5i:J(r,m,a){m=" "+m+" ";L b=[];Q(L i=0;r[i];i++){L c=(" "+r[i].1u+" ").1f(m)>=0;7(!a&&c||a&&!c)b.1g(r[i])}K b},1C:J(t,r,b){L d;28(t&&t!=d){d=t;L p=v.6w,m;Q(L i=0;p[i];i++){m=p[i].2N(t);7(m){t=t.8N(m[0].M);m[2]=m[2].1r(/\\\\/g,"");1U}}7(!m)1U;7(m[1]==":"&&m[2]=="4T")r=y.17(m[3])?v.1C(m[3],r,P).r:v(r).4T(m[3]);N 7(m[1]==".")r=v.5i(r,m[2],b);N 7(m[1]=="["){L e=[],U=m[3];Q(L i=0,3q=r.M;i<3q;i++){L a=r[i],z=a[v.3K[m[2]]||m[2]];7(z==V||/6b|3E|2m/.17(m[2]))z=v.1F(a,m[2])||\'\';7((U==""&&!!z||U=="="&&z==m[5]||U=="!="&&z!=m[5]||U=="^="&&z&&!z.1f(m[5])||U=="$="&&z.6x(z.M-m[5].M)==m[5]||(U=="*="||U=="~=")&&z.1f(m[5])>=0)^b)e.1g(a)}r=e}N 7(m[1]==":"&&m[2]=="2Z-4o"){L f={},e=[],17=/(-?)(\\d*)n((?:\\+|-)?\\d*)/.2N(m[3]=="6r"&&"2n"||m[3]=="6s"&&"2n+1"||!/\\D/.17(m[3])&&"8O+"+m[3]||m[3]),3p=(17[1]+(17[2]||1))-0,d=17[3]-0;Q(L i=0,3q=r.M;i<3q;i++){L g=r[i],1a=g.1a,2h=v.O(1a);7(!f[2h]){L c=1;Q(L n=1a.1B;n;n=n.2C)7(n.15==1)n.4r=c++;f[2h]=P}L h=S;7(3p==0){7(g.4r==d)h=P}N 7((g.4r-d)%3p==0&&(g.4r-d)/3p>=0)h=P;7(h^b)e.1g(g)}r=e}N{L j=v.6q[m[1]];7(1n j=="38")j=j[m[2]];7(1n j=="25")j=6y("S||J(a,i){K "+j+";}");r=v.3A(r,J(a,i){K j(a,i,m,r)},b)}}K{r:r,t:t}},4j:J(a,b){L c=[];L d=a[b];28(d&&d!=T){7(d.15==1)c.1g(d);d=d[b]}K c},2Z:J(a,b,c,d){b=b||1;L e=0;Q(;a;a=a[c])7(a.15==1&&++e==b)1U;K a},5c:J(n,a){L r=[];Q(;n;n=n.2C){7(n.15==1&&(!a||n!=a))r.1g(n)}K r}});v.16={1b:J(e,f,g,h){7(e.15==3||e.15==8)K;7(v.14.1d&&e.5j!=10)e=1c;7(!g.2J)g.2J=6.2J++;7(h!=10){L i=g;g=J(){K i.1h(6,18)};g.O=h;g.2J=i.2J}L j=v.O(e,"2O")||v.O(e,"2O",{}),1x=v.O(e,"1x")||v.O(e,"1x",J(){L a;7(1n v=="10"||v.16.5k)K a;a=v.16.1x.1h(18.3S.Y,18);K a});1x.Y=e;v.R(f.21(/\\s+/),J(a,b){L c=b.21(".");b=c[0];g.U=c[1];L d=j[b];7(!d){d=j[b]={};7(!v.16.2r[b]||v.16.2r[b].4s.1P(e)===S){7(e.3T)e.3T(b,1x,S);N 7(e.6z)e.6z("4t"+b,1x)}}d[g.2J]=g;v.16.2d[b]=P});e=V},2J:1,2d:{},1Q:J(d,e,f){7(d.15==3||d.15==8)K;L g=v.O(d,"2O"),2e,4L;7(g){7(e==10||(1n e=="25"&&e.8P(0)=="."))Q(L h 1q g)6.1Q(d,h+(e||""));N{7(e.U){f=e.2s;e=e.U}v.R(e.21(/\\s+/),J(a,b){L c=b.21(".");b=c[0];7(g[b]){7(f)2V g[b][f.2J];N Q(f 1q g[b])7(!c[1]||g[b][f].U==c[1])2V g[b][f];Q(2e 1q g[b])1U;7(!2e){7(!v.16.2r[b]||v.16.2r[b].4u.1P(d)===S){7(d.6A)d.6A(b,v.O(d,"1x"),S);N 7(d.6B)d.6B("4t"+b,v.O(d,"1x"))}2e=V;2V g[b]}}})}Q(2e 1q g)1U;7(!2e){L i=v.O(d,"1x");7(i)i.Y=V;v.2T(d,"2O");v.2T(d,"1x")}}},1L:J(a,b,c,d,f){b=v.2z(b||[]);7(a.1f("!")>=0){a=a.2D(0,-1);L g=P}7(!c){7(6.2d[a])v("*").1b([1c,T]).1L(a,b)}N{7(c.15==3||c.15==8)K 10;L h,2e,1m=v.1p(c[a]||V),16=!b[0]||!b[0].30;7(16)b.59(6.5l({U:a,2K:c}));b[0].U=a;7(g)b[0].6C=P;7(v.1p(v.O(c,"1x")))h=v.O(c,"1x").1h(c,b);7(!1m&&c["4t"+a]&&c["4t"+a].1h(c,b)===S)h=S;7(16)b.4q();7(f&&v.1p(f)){2e=f.1h(c,h==V?b:b.6e(h));7(2e!==10)h=2e}7(1m&&d!==S&&h!==S&&!(v.12(c,\'a\')&&a=="5m")){6.5k=P;1V{c[a]()}1W(e){}}6.5k=S}K h},1x:J(a){L b;a=v.16.5l(a||1c.16||{});L c=a.U.21(".");a.U=c[0];L d=v.O(6,"2O")&&v.O(6,"2O")[a.U],3U=1K.2g.2D.1P(18,1);3U.59(a);Q(L j 1q d){L e=d[j];3U[0].2s=e;3U[0].O=e.O;7(!c[1]&&!a.6C||e.U==c[1]){L f=e.1h(6,3U);7(b!==S)b=f;7(f===S){a.30();a.3V()}}}7(v.14.1d)a.2K=a.30=a.3V=a.2s=a.O=V;K b},5l:J(a){L b=a;a=v.1s({},b);a.30=J(){7(b.30)b.30();b.8Q=S};a.3V=J(){7(b.3V)b.3V();b.8R=P};7(!a.2K)a.2K=a.8S||T;7(a.2K.15==3)a.2K=b.2K.1a;7(!a.5n&&a.5o)a.5n=a.5o==a.2K?a.8T:a.5o;7(a.6D==V&&a.6E!=V){L c=T.1H,1i=T.1i;a.6D=a.6E+(c&&c.2t||1i&&1i.2t||0)-(c.6F||0);a.8U=a.8V+(c&&c.2u||1i&&1i.2u||0)-(c.6G||0)}7(!a.3n&&((a.4v||a.4v===0)?a.4v:a.6H))a.3n=a.4v||a.6H;7(!a.6I&&a.6J)a.6I=a.6J;7(!a.3n&&a.2I)a.3n=(a.2I&1?1:(a.2I&2?3:(a.2I&4?2:0)));K a},2r:{1Y:{4s:J(){5p();K},4u:J(){K}},3W:{4s:J(){7(v.14.1d)K S;v(6).2v("5q",v.16.2r.3W.2s);K P},4u:J(){7(v.14.1d)K S;v(6).3X("5q",v.16.2r.3W.2s);K P},2s:J(a){7(G(a,6))K P;18[0].U="3W";K v.16.1x.1h(6,18)}},3Y:{4s:J(){7(v.14.1d)K S;v(6).2v("5r",v.16.2r.3Y.2s);K P},4u:J(){7(v.14.1d)K S;v(6).3X("5r",v.16.2r.3Y.2s);K P},2s:J(a){7(G(a,6))K P;18[0].U="3Y";K v.16.1x.1h(6,18)}}}};v.1m.1s({2v:J(a,b,c){K a=="5s"?6.2R(a,b,c):6.R(J(){v.16.1b(6,a,c||b,c&&b)})},2R:J(b,c,d){K 6.R(J(){v.16.1b(6,b,J(a){v(6).3X(a);K(d||c).1h(6,18)},d&&c)})},3X:J(a,b){K 6.R(J(){v.16.1Q(6,a,b)})},1L:J(a,b,c){K 6.R(J(){v.16.1L(a,b,6,P,c)})},4X:J(a,b,c){7(6[0])K v.16.1L(a,b,6[0],S,c);K 10},2w:J(){L b=18;K 6.5m(J(a){6.5t=0==6.5t?1:0;a.30();K b[6.5t].1h(6,18)||S})},8W:J(a,b){K 6.2v(\'3W\',a).2v(\'3Y\',b)},1Y:J(a){5p();7(v.31)a.1P(T,v);N v.3Z.1g(J(){K a.1P(6,v)});K 6}});v.1s({31:S,3Z:[],1Y:J(){7(!v.31){v.31=P;7(v.3Z){v.R(v.3Z,J(){6.1h(T)});v.3Z=V}v(T).4X("1Y")}}});L F=S;J 5p(){7(F)K;F=P;7(T.3T&&!v.14.2F)T.3T("6K",v.1Y,S);7(v.14.1d&&1c==3r)(J(){7(v.31)K;1V{T.1H.8X("2c")}1W(3s){40(18.3S,0);K}v.1Y()})();7(v.14.2F)T.3T("6K",J(){7(v.31)K;Q(L i=0;i<T.5u.M;i++)7(T.5u[i].2Y){40(18.3S,0);K}v.1Y()},S);7(v.14.2b){L a;(J(){7(v.31)K;7(T.3t!="6L"&&T.3t!="1y"){40(18.3S,0);K}7(a===10)a=v("W, 66[8Y=8Z]").M;7(T.5u.M!=a){40(18.3S,0);K}v.1Y()})()}v.16.1b(1c,"3x",v.1Y)}v.R(("90,91,3x,92,5e,5s,5m,93,"+"94,95,96,5q,5r,97,2l,"+"5h,98,99,9a,3s").21(","),J(i,b){v.1m[b]=J(a){K a?6.2v(b,a):6.1L(b)}});L G=J(a,b){L c=a.5n;28(c&&c!=b)1V{c=c.1a}1W(3s){c=b}K c==b};v(1c).2v("5s",J(){v("*").1b(T).3X()});v.1m.1s({3x:J(c,d,e){7(v.1p(c))K 6.2v("3x",c);L f=c.1f(" ");7(f>=0){L g=c.2D(f,c.M);c=c.2D(0,f)}e=e||J(){};L h="5v";7(d)7(v.1p(d)){e=d;d=V}N{d=v.3o(d);h="6M"}L i=6;v.3F({1e:c,U:h,1G:"3j",O:d,1y:J(a,b){7(b=="1X"||b=="6N")i.3j(g?v("<1v/>").39(a.4w.1r(/<1o(.|\\s)*?\\/1o>/g,"")).2i(g):a.4w);i.R(e,[a.4w,b,a])}});K 6},9b:J(){K v.3o(6.6O())},6O:J(){K 6.27(J(){K v.12(6,"3h")?v.2z(6.9c):6}).1C(J(){K 6.2S&&!6.2Y&&(6.3i||/2l|6v/i.17(6.12)||/1t|22|4p/i.17(6.U))}).27(J(i,b){L c=v(6).5T();K c==V?V:c.1j==1K?v.27(c,J(a,i){K{2S:b.2S,1D:a}}):{2S:b.2S,1D:c}}).1Z()}});v.R("6P,6Q,6R,6S,6T,6U".21(","),J(i,o){v.1m[o]=J(f){K 6.2v(o,f)}});L H=(1A 3G).3H();v.1s({1Z:J(a,b,c,d){7(v.1p(b)){c=b;b=V}K v.3F({U:"5v",1e:a,O:b,1X:c,1G:d})},9d:J(a,b){K v.1Z(a,V,b,"1o")},9e:J(a,b,c){K v.1Z(a,b,c,"3u")},9f:J(a,b,c,d){7(v.1p(b)){c=b;b={}}K v.3F({U:"6M",1e:a,O:b,1X:c,1G:d})},9g:J(a){v.1s(v.5w,a)},5w:{2d:P,U:"5v",32:0,6V:"4x/x-9h-3h-9i",6W:P,3l:P,O:V,9j:V,4p:V,4y:{41:"4x/41, 1t/41",3j:"1t/3j",1o:"1t/4c, 4x/4c",3u:"4x/3u, 1t/4c",1t:"1t/9k",4z:"*/*"}},4A:{},3F:J(s){L c,33=/=\\?(&|$)/g,1z,O;s=v.1s(P,s,v.1s(P,{},v.5w,s));7(s.O&&s.6W&&1n s.O!="25")s.O=v.3o(s.O);7(s.1G=="4B"){7(s.U.2o()=="1Z"){7(!s.1e.1E(33))s.1e+=(s.1e.1E(/\\?/)?"&":"?")+(s.4B||"6X")+"=?"}N 7(!s.O||!s.O.1E(33))s.O=(s.O?s.O+"&":"")+(s.4B||"6X")+"=?";s.1G="3u"}7(s.1G=="3u"&&(s.O&&s.O.1E(33)||s.1e.1E(33))){c="4B"+H++;7(s.O)s.O=(s.O+"").1r(33,"="+c+"$1");s.1e=s.1e.1r(33,"="+c+"$1");s.1G="1o";1c[c]=J(a){O=a;1X();1y();1c[c]=10;1V{2V 1c[c]}1W(e){}7(g)g.2U(h)}}7(s.1G=="1o"&&s.1T==V)s.1T=S;7(s.1T===S&&s.U.2o()=="1Z"){L d=(1A 3G()).3H();L f=s.1e.1r(/(\\?|&)4m=.*?(&|$)/,"$9l="+d+"$2");s.1e=f+((f==s.1e)?(s.1e.1E(/\\?/)?"&":"?")+"4m="+d:"")}7(s.O&&s.U.2o()=="1Z"){s.1e+=(s.1e.1E(/\\?/)?"&":"?")+s.O;s.O=V}7(s.2d&&!v.5x++)v.16.1L("6P");7((!s.1e.1f("9m")||!s.1e.1f("//"))&&s.1G=="1o"&&s.U.2o()=="1Z"){L g=T.3D("61")[0];L h=T.3e("1o");h.3E=s.1e;7(s.6Y)h.9n=s.6Y;7(!c){L i=S;h.9o=h.9p=J(){7(!i&&(!6.3t||6.3t=="6L"||6.3t=="1y")){i=P;1X();1y();g.2U(h)}}}g.3c(h);K 10}L j=S;L k=1c.6Z?1A 6Z("9q.9r"):1A 70();k.9s(s.U,s.1e,s.3l);1V{7(s.O)k.4C("9t-9u",s.6V);7(s.5y)k.4C("9v-5z-9w",v.4A[s.1e]||"9x, 9y 9z 9A 5A:5A:5A 9B");k.4C("X-9C-9D","70");k.4C("9E",s.1G&&s.4y[s.1G]?s.4y[s.1G]+", */*":s.4y.4z)}1W(e){}7(s.71)s.71(k);7(s.2d)v.16.1L("6U",[k,s]);L l=J(a){7(!j&&k&&(k.3t==4||a=="32")){j=P;7(m){72(m);m=V}1z=a=="32"&&"32"||!v.73(k)&&"3s"||s.5y&&v.74(k,s.1e)&&"6N"||"1X";7(1z=="1X"){1V{O=v.75(k,s.1G)}1W(e){1z="5B"}}7(1z=="1X"){L b;1V{b=k.5C("76-5z")}1W(e){}7(s.5y&&b)v.4A[s.1e]=b;7(!c)1X()}N v.5D(s,k,1z);1y();7(s.3l)k=V}};7(s.3l){L m=5j(l,13);7(s.32>0)40(J(){7(k){k.9F();7(!j)l("32")}},s.32)}1V{k.9G(s.O)}1W(e){v.5D(s,k,V,e)}7(!s.3l)l();J 1X(){7(s.1X)s.1X(O,1z);7(s.2d)v.16.1L("6T",[k,s])}J 1y(){7(s.1y)s.1y(k,1z);7(s.2d)v.16.1L("6R",[k,s]);7(s.2d&&!--v.5x)v.16.1L("6Q")}K k},5D:J(s,a,b,e){7(s.3s)s.3s(a,b,e);7(s.2d)v.16.1L("6S",[a,s,e])},5x:0,73:J(r){1V{K!r.1z&&9H.9I=="5g:"||(r.1z>=77&&r.1z<9J)||r.1z==78||r.1z==9K||v.14.2b&&r.1z==10}1W(e){}K S},74:J(a,b){1V{L c=a.5C("76-5z");K a.1z==78||c==v.4A[b]||v.14.2b&&a.1z==10}1W(e){}K S},75:J(r,a){L b=r.5C("9L-U");L c=a=="41"||!a&&b&&b.1f("41")>=0;L d=c?r.9M:r.4w;7(c&&d.1H.2a=="5B")6a"5B";7(a=="1o")v.4Y(d);7(a=="3u")d=6y("("+d+")");K d},3o:J(a){L s=[];7(a.1j==1K||a.4J)v.R(a,J(){s.1g(3v(6.2S)+"="+3v(6.1D))});N Q(L j 1q a)7(a[j]&&a[j].1j==1K)v.R(a[j],J(){s.1g(3v(j)+"="+3v(6))});N s.1g(3v(j)+"="+3v(a[j]));K s.62("&").1r(/%20/g,"+")}});v.1m.1s({1I:J(b,c){K b?6.2f({1O:"1I",26:"1I",1w:"1I"},b,c):6.1C(":22").R(J(){6.W.19=6.5E||"";7(v.1l(6,"19")=="2H"){L a=v("<"+6.2a+" />").6m("1i");6.W.19=a.1l("19");7(6.W.19=="2H")6.W.19="3M";a.1Q()}}).3d()},1J:J(a,b){K a?6.2f({1O:"1J",26:"1J",1w:"1J"},a,b):6.1C(":4d").R(J(){6.5E=6.5E||v.1l(6,"19");6.W.19="2H"}).3d()},79:v.1m.2w,2w:J(a,b){K v.1p(a)&&v.1p(b)?6.79(a,b):a?6.2f({1O:"2w",26:"2w",1w:"2w"},a,b):6.R(J(){v(6)[v(6).3B(":22")?"1I":"1J"]()})},9N:J(a,b){K 6.2f({1O:"1I"},a,b)},9O:J(a,b){K 6.2f({1O:"1J"},a,b)},9P:J(a,b){K 6.2f({1O:"2w"},a,b)},9Q:J(a,b){K 6.2f({1w:"1I"},a,b)},9R:J(a,b){K 6.2f({1w:"1J"},a,b)},9S:J(a,b,c){K 6.2f({1w:b},a,c)},2f:J(h,i,j,k){L l=v.7a(i,j,k);K 6[l.34===S?"R":"34"](J(){7(6.15!=1)K S;L f=v.1s({},l);L g=v(6).3B(":22"),4D=6;Q(L p 1q h){7(h[p]=="1J"&&g||h[p]=="1I"&&!g)K v.1p(f.1y)&&f.1y.1h(6);7(p=="1O"||p=="26"){f.19=v.1l(6,"19");f.35=6.W.35}}7(f.35!=V)6.W.35="22";f.42=v.1s({},h);v.R(h,J(a,b){L e=1A v.2x(4D,f,a);7(/2w|1I|1J/.17(b))e[b=="2w"?g?"1I":"1J":b](h);N{L c=b.3J().1E(/^([+-]=)?([\\d+-.]+)(.*)$/),24=e.2q(P)||0;7(c){L d=2B(c[2]),2L=c[3]||"2W";7(2L!="2W"){4D.W[a]=(d||1)+2L;24=((d||1)/e.2q(P))*24;4D.W[a]=24+2L}7(c[1])d=((c[1]=="-="?-1:1)*d)+24;e.43(24,d,2L)}N e.43(24,b,"")}});K P})},34:J(a,b){7(v.1p(a)||(a&&a.1j==1K)){b=a;a="2x"}7(!a||(1n a=="25"&&!b))K I(6[0],a);K 6.R(J(){7(b.1j==1K)I(6,a,b);N{I(6,a).1g(b);7(I(6,a).M==1)b.1h(6)}})},9T:J(a,b){L c=v.3R;7(a)6.34([]);6.R(J(){Q(L i=c.M-1;i>=0;i--)7(c[i].Y==6){7(b)c[i](P);c.7b(i,1)}});7(!b)6.5F();K 6}});L I=J(a,b,c){7(!a)K 10;b=b||"2x";L q=v.O(a,b+"34");7(!q||c)q=v.O(a,b+"34",c?v.2z(c):[]);K q};v.1m.5F=J(a){a=a||"2x";K 6.R(J(){L q=I(6,a);q.4q();7(q.M)q[0].1h(6)})};v.1s({7a:J(a,b,c){L d=a&&a.1j==9U?a:{1y:c||!c&&b||v.1p(a)&&a,2y:a,44:c&&b||b&&b.1j!=9V&&b};d.2y=(d.2y&&d.2y.1j==52?d.2y:{9W:9X,9Y:77}[d.2y])||9Z;d.5G=d.1y;d.1y=J(){7(d.34!==S)v(6).5F();7(v.1p(d.5G))d.5G.1h(6)};K d},44:{7c:J(p,n,a,b){K a+b*p},5H:J(p,n,a,b){K((-23.a0(p*23.a1)/2)+0.5)*b+a}},3R:[],45:V,2x:J(a,b,c){6.11=b;6.Y=a;6.1k=c;7(!b.46)b.46={}}});v.2x.2g={4E:J(){7(6.11.36)6.11.36.1h(6.Y,[6.2M,6]);(v.2x.36[6.1k]||v.2x.36.4z)(6);7(6.1k=="1O"||6.1k=="26")6.Y.W.19="3M"},2q:J(a){7(6.Y[6.1k]!=V&&6.Y.W[6.1k]==V)K 6.Y[6.1k];L r=2B(v.1l(6.Y,6.1k,a));K r&&r>-a2?r:2B(v.2j(6.Y,6.1k))||0},43:J(b,c,d){6.5I=(1A 3G()).3H();6.24=b;6.3d=c;6.2L=d||6.2L||"2W";6.2M=6.24;6.4F=6.4G=0;6.4E();L e=6;J t(a){K e.36(a)}t.Y=6.Y;v.3R.1g(t);7(v.45==V){v.45=5j(J(){L a=v.3R;Q(L i=0;i<a.M;i++)7(!a[i]())a.7b(i--,1);7(!a.M){72(v.45);v.45=V}},13)}},1I:J(){6.11.46[6.1k]=v.1F(6.Y.W,6.1k);6.11.1I=P;6.43(0,6.2q());7(6.1k=="26"||6.1k=="1O")6.Y.W[6.1k]="a3";v(6.Y).1I()},1J:J(){6.11.46[6.1k]=v.1F(6.Y.W,6.1k);6.11.1J=P;6.43(6.2q(),0)},36:J(a){L t=(1A 3G()).3H();7(a||t>6.11.2y+6.5I){6.2M=6.3d;6.4F=6.4G=1;6.4E();6.11.42[6.1k]=P;L b=P;Q(L i 1q 6.11.42)7(6.11.42[i]!==P)b=S;7(b){7(6.11.19!=V){6.Y.W.35=6.11.35;6.Y.W.19=6.11.19;7(v.1l(6.Y,"19")=="2H")6.Y.W.19="3M"}7(6.11.1J)6.Y.W.19="2H";7(6.11.1J||6.11.1I)Q(L p 1q 6.11.42)v.1F(6.Y.W,p,6.11.46[p])}7(b&&v.1p(6.11.1y))6.11.1y.1h(6.Y);K S}N{L n=t-6.5I;6.4G=n/6.11.2y;6.4F=v.44[6.11.44||(v.44.5H?"5H":"7c")](6.4G,n,0,1,6.11.2y);6.2M=6.24+((6.3d-6.24)*6.4F);6.4E()}K P}};v.2x.36={2t:J(a){a.Y.2t=a.2M},2u:J(a){a.Y.2u=a.2M},1w:J(a){v.1F(a.Y.W,"1w",a.2M)},4z:J(a){a.Y.W[a.1k]=a.2M+a.2L}};v.1m.5f=J(){L b=0,3r=0,Y=6[0],5J;7(Y)a4(v.14){L c=Y.1a,47=Y,1M=Y.1M,1N=Y.2k,5K=2b&&4l(5b)<a5&&!/a6/i.17(C),37=v.1l(Y,"3L")=="37";7(Y.7d){L d=Y.7d();1b(d.2c+23.29(1N.1H.2t,1N.1i.2t),d.3r+23.29(1N.1H.2u,1N.1i.2u));1b(-1N.1H.6F,-1N.1H.6G)}N{1b(Y.5L,Y.5M);28(1M){1b(1M.5L,1M.5M);7(3P&&!/^t(a7|d|h)$/i.17(1M.2a)||2b&&!5K)2X(1M);7(!37&&v.1l(1M,"3L")=="37")37=P;47=/^1i$/i.17(1M.2a)?47:1M;1M=1M.1M}28(c&&c.2a&&!/^1i|3j$/i.17(c.2a)){7(!/^a8|1R.*$/i.17(v.1l(c,"19")))1b(-c.2t,-c.2u);7(3P&&v.1l(c,"35")!="4d")2X(c);c=c.1a}7((5K&&(37||v.1l(47,"3L")=="53"))||(3P&&v.1l(47,"3L")!="53"))1b(-1N.1i.5L,-1N.1i.5M);7(37)1b(23.29(1N.1H.2t,1N.1i.2t),23.29(1N.1H.2u,1N.1i.2u))}5J={3r:3r,2c:b}}J 2X(a){1b(v.2j(a,"a9",P),v.2j(a,"aa",P))}J 1b(l,t){b+=4l(l)||0;3r+=4l(t)||0}K 5J}})();',62,631,'||||||this|if||||||||||||||||||||||||||||||||||||||function|return|var|length|else|data|true|for|each|false|document|type|null|style||elem||undefined|options|nodeName||browser|nodeType|event|test|arguments|display|parentNode|add|window|msie|url|indexOf|push|apply|body|constructor|prop|css|fn|typeof|script|isFunction|in|replace|extend|text|className|div|opacity|handle|complete|status|new|firstChild|filter|value|match|attr|dataType|documentElement|show|hide|Array|trigger|offsetParent|doc|height|call|remove|table|tbody|cache|break|try|catch|success|ready|get||split|hidden|Math|start|string|width|map|while|max|tagName|safari|left|global|ret|animate|prototype|id|find|curCSS|ownerDocument|select|selected||toLowerCase|done|cur|special|handler|scrollLeft|scrollTop|bind|toggle|fx|duration|makeArray|pushStack|parseFloat|nextSibling|slice|toUpperCase|opera|stack|none|button|guid|target|unit|now|exec|events|inArray|merge|one|name|removeData|removeChild|delete|px|border|disabled|nth|preventDefault|isReady|timeout|jsre|queue|overflow|step|fixed|object|append|childNodes|insertBefore|appendChild|end|createElement|innerHTML|multiFilter|form|checked|html|elems|async|trim|which|param|first|rl|top|error|readyState|json|encodeURIComponent|jQuery|load|domManip|isXMLDoc|grep|is|selectedIndex|getElementsByTagName|src|ajax|Date|getTime|has|toString|props|position|block|color|runtimeStyle|mozilla|last|timers|callee|addEventListener|args|stopPropagation|mouseenter|unbind|mouseleave|readyList|setTimeout|xml|curAnim|custom|easing|timerId|orig|offsetChild|clean|String|empty|tr|javascript|visible|defaultView|float|currentStyle|input|getAttribute|dir|previousSibling|parseInt|_|RegExp|child|password|shift|nodeIndex|setup|on|teardown|charCode|responseText|application|accepts|_default|lastModified|jsonp|setRequestHeader|self|update|pos|state|init|getElementById|jquery|prevObject|index|createTextNode|wrapAll|clone|after|unique|container|andSelf|not|values|radio|checkbox|triggerHandler|globalEval|deep|windowData|removeAttribute|Number|absolute|visibility|getWH|getComputedStyle|getPropertyValue|outline|unshift|lastChild|version|sibling|client|scroll|offset|file|submit|classFilter|setInterval|triggered|fix|click|relatedTarget|fromElement|bindReady|mouseover|mouseout|unload|lastToggle|styleSheets|GET|ajaxSettings|active|ifModified|Modified|00|parsererror|getResponseHeader|handleError|oldblock|dequeue|old|swing|startTime|results|safari2|offsetLeft|offsetTop|setArray|nodeValue|contents|prepend|before|cloneNode|val|replaceWith|eq|evalScript|textContent|continue|uuid|zoom|head|join|swap|Width|col|link|multiple|fieldset|colgroup|throw|href|alpha|100|concat|webkit|styleFloat|cssFloat|compatMode|CSS1Compat|defaultValue|parent|appendTo|quickChild|quickID|quickClass|expr|even|odd|image|reset|textarea|parse|substr|eval|attachEvent|removeEventListener|detachEvent|exclusive|pageX|clientX|clientLeft|clientTop|keyCode|metaKey|ctrlKey|DOMContentLoaded|loaded|POST|notmodified|serializeArray|ajaxStart|ajaxStop|ajaxComplete|ajaxError|ajaxSuccess|ajaxSend|contentType|processData|callback|scriptCharset|ActiveXObject|XMLHttpRequest|beforeSend|clearInterval|httpSuccess|httpNotModified|httpData|Last|200|304|_toggle|speed|splice|linear|getBoundingClientRect|size|wrapInner|wrap|hasClass|attributes|specified|option|getData|setData|reverse|Boolean|font|weight|line|noConflict|Left|Right|Top|Bottom|offsetWidth|offsetHeight|padding|round|solid|black|pixelLeft|abbr|br|img|meta|hr|area|embed|opt|leg|thead|tfoot|colg|cap|td|th|cssText|action|method|getAttributeNode|property|can|be|changed|setAttribute|NaN|ig|array|navigator|userAgent|rv|it|ra|ie|compatible|boxModel|htmlFor|class|readonly|readOnly|maxlength|maxLength|parents|next|prev|nextAll|prevAll|siblings|children|iframe|contentDocument|contentWindow|prependTo|insertAfter|replaceAll|removeAttr|addClass|removeClass|toggleClass|Height|inner|417|u0128|uFFFF|lt|gt|only|contains|innerText|enabled|header|animated|substring|0n|charAt|returnValue|cancelBubble|srcElement|toElement|pageY|clientY|hover|doScroll|rel|stylesheet|blur|focus|resize|dblclick|mousedown|mouseup|mousemove|change|keydown|keypress|keyup|serialize|elements|getScript|getJSON|post|ajaxSetup|www|urlencoded|username|plain|1_|http|charset|onload|onreadystatechange|Microsoft|XMLHTTP|open|Content|Type|If|Since|Thu|01|Jan|1970|GMT|Requested|With|Accept|abort|send|location|protocol|300|1223|content|responseXML|slideDown|slideUp|slideToggle|fadeIn|fadeOut|fadeTo|stop|Object|Function|slow|600|fast|400|cos|PI|10000|1px|with|522|adobeair|able|inline|borderLeftWidth|borderTopWidth'.split('|'),0,{}))

/*./thirdParty/jquery.cookie-min.js*/

/**
 * Cookie plugin
 *
 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('r.5=w(k,d,a){4(m d!=\'H\'){a=a||{};4(d===p){d=\'\';a.3=-1}2 g=\'\';4(a.3&&(m a.3==\'n\'||a.3.u)){2 f;4(m a.3==\'n\'){f=G E();f.C(f.B()+(a.3*z*s*s*v))}o{f=a.3}g=\'; 3=\'+f.u()}2 b=a.7?\'; 7=\'+(a.7):\'\';2 e=a.9?\'; 9=\'+(a.9):\'\';2 l=a.t?\'; t\':\'\';6.5=[k,\'=\',K(d),g,b,e,l].I(\'\')}o{2 h=p;4(6.5&&6.5!=\'\'){2 c=6.5.F(\';\');D(2 i=0;i<c.8;i++){2 j=r.A(c[i]);4(j.q(0,k.8+1)==(k+\'=\')){h=y(j.q(k.8+1));x}}}J h}};',47,47,'||var|expires|if|cookie|document|path|length|domain|||||||||||||typeof|number|else|null|substring|jQuery|60|secure|toUTCString|1000|function|break|decodeURIComponent|24|trim|getTime|setTime|for|Date|split|new|undefined|join|return|encodeURIComponent'.split('|'),0,{}))

/*./thirdParty/jquery.cookie.js*/

/**
 * Cookie plugin
 *
 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */

/**
 * Create a cookie with the given name and value and other optional parameters.
 *
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Set the value of a cookie.
 * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
 * @desc Create a cookie with all available options.
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Create a session cookie.
 * @example $.cookie('the_cookie', null);
 * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
 *       used when the cookie was set.
 *
 * @param String name The name of the cookie.
 * @param String value The value of the cookie.
 * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
 * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
 *                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
 *                             If set to null or omitted, the cookie will be a session cookie and will not be retained
 *                             when the the browser exits.
 * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
 * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
 * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
 *                        require a secure protocol (like HTTPS).
 * @type undefined
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */

/**
 * Get the value of a cookie with the given name.
 *
 * @example $.cookie('the_cookie');
 * @desc Get the value of a cookie.
 *
 * @param String name The name of the cookie.
 * @return The value of the cookie.
 * @type String
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */
jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }
        // CAUTION: Needed to parenthesize options.path and options.domain
        // in the following expressions, otherwise they evaluate to undefined
        // in the packed version for some reason...
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};

/*utils.js*/

/* Fix for IE6 background-image flicker
 * See http://www.mister-pixel.com/#Content__state=is_that_simple
*/

try {
	document.execCommand('BackgroundImageCache', false, true);
} catch(err) {}
/* 
 * Global var if doesn't Exist
*/

if(!global)
{
	var global = {};
}
/*
 *	Ajax manager
*/
if($.manageAjax)
{
global.ajaxManager = $.manageAjax({manageType: 'sync', blockSameRequest: true});
}
/*
 * Array Utils
*/
$.extend({
	isArray: function(obj) {
		return obj.constructor == Array;
	},
	without : function(array,exclude){
		var tempArr;
		if(!$.isArray(exclude))
		{
			return $.grep(array, function(n){
			  return (n != exclude);
			});
		}
		else
		{
                        tempArr = array;
			$(exclude).each(function(){
				tempArr = $.without(tempArr,this);
                                alert(tempArr);
			});
			return tempArr;
		}
	},
	loadJS : function(options)
	{
		options = $.extend({
			 src : "",
			 id : ""
		}, options);
		if(options.src==="")
		{
			return;
		}
		if($("#"+options.id).length===0)
		{
			var appendStr = '<script id="'+options.id+'" src="'+options.src+'" type="text/javascript"></script>';
			$("head").eq(0).append(appendStr);
		}
	},
	sleep: function(timeout) {
        var loop = true;
        var current = new Date();
        var now;
        var cTimestamp = current.getTime();

        while(loop) {
                now = new Date();
                nTimestamp = now.getTime();

                if(nTimestamp - cTimestamp > timeout) {
                        loop = false;
                }
        }

	},
	formatDistance:  function(distance){
		var distance =  Math.round(distance*100)/100;
		distance = (isNaN(distance))?"N/A":distance;
		return distance;
	},
	formatPhoneNumber: function(phone){
		if(phone === 'undefined' || typeof(phone) === 'undefined' || phone===null || phone==='' || phone==="0")
		{
				return "Not Available";
		}
		var ext = "";
		if (phone.indexOf ('E') != -1)
		{
				var tmpArr = phone.split ("E");
				phone = tmpArr[0];
				if (tmpArr[1] != null || tmpArr[1] != "")
				{
						ext = " Ext " + tmpArr[1];
				}
		}
		
		if (phone.length == 11)
		{
				return phone.substring(0, 1) + "-" + phone.substring(1, 4) + "-" + phone.substring(4, 7) + "-" + phone.substring(7) + ext;
		}
		else if (phone.length == 10)
		{
				return phone.substring(0, 3) + "-" + phone.substring(3, 6) + "-" + phone.substring(6) + ext;
		}
		else if (phone.length == 7)
		{
				return phone.substring(0, 3) + "-" + substring(phone, 4, 6) + ext;
		}
		else
		{
				return "Not Available";
		}
     },
	 formatNumber: function(options)
	 { 
		options = $.extend({number:'0',prefix:'',precision:'0',suffix:''},options);
		var retVal = "N/A";
		if(isNaN(parseFloat(options.number)))
		{
			retVal = (options.returnNotValid)?options.returnNotValid:retVal;
			return retVal;
		}
		options.number = parseFloat(options.number).toFixed(options.precision);
		options.number+= '';
		var x = options.number.split('.');
		var x1 = x[0];
		var x2 = x.length > 1 ? '.' + x[1] : '';
		var rgx = /(\d+)(\d{3})/;
		while (rgx.test(x1)) {
			x1 = x1.replace(rgx, '$1' + ',' + '$2');
		}
		return options.prefix+x1 + x2+options.suffix;
	 }
});

$.fn.extend({
  check: function() {
    return this.each(function() { this.checked = true; });
  },
  uncheck: function() {
    return this.each(function() { this.checked = false; });
  }
});

if($.template)
{
	$.extend( $.template.helpers , {
		formatDistance: function(value){
				return $.formatDistance(value);
		},
		formatPhoneNumber: function(value){
			return $.formatPhoneNumber(value);
		},
		formatPrice: function(value){
			return $.formatNumber({number:value,prefix:"$"});
		},
		formatSqft: function(value){
			if (value == "")
			{
				return '';
			}
			return '<p>' + $.formatNumber({number:value,suffix:" sqft"}) + ' </p>';
		},
		formatDetailUrl: function(value){
			if (value == "")
			{
				return '';
			}
			return '<p><a class="getDirctionAnch" href="' + value + '" target="_blank">View listing details </a></p>';
		}
	});
}

$.extend({
	searchCookie: function(ckName,ckValue){
  		var strSearchCookie = $.cookie("strSearchCookie");
		var arrSearchCookie = new Array();
		if(strSearchCookie != null && $.trim(strSearchCookie) != "")
		{
			arrSearchCookie = strSearchCookie.split(':::');
		}
		var arrNameSearchCookie = new Array();
		var arrValueSearchCookie = new Array();
		
		if(arrSearchCookie.length > 0)
		{
			for(var i=0;i<arrSearchCookie.length;i++)
			{
				var arrKeyVal = arrSearchCookie[i].split('=');
				arrNameSearchCookie[arrNameSearchCookie.length] = $.trim(arrKeyVal[0]);
				arrValueSearchCookie[arrValueSearchCookie.length] = $.trim(arrKeyVal[1]);
			}	
		}
		if(arrNameSearchCookie.find(ckName) !== false )
		{
			var ckIndex = arrNameSearchCookie.find($.trim(ckName));
			if(!ckValue)
			{
				returnCKValue = $.trim(unescape(arrValueSearchCookie[ckIndex]));
                		return returnCKValue;
			}

			arrValueSearchCookie[ckIndex] = escape(ckValue);
		}	
		else
		{
			if(!ckValue)
			{
				return;
			}
			arrNameSearchCookie[arrNameSearchCookie.length] = $.trim(ckName);
			arrValueSearchCookie[arrValueSearchCookie.length] = $.trim(escape(ckValue));
		}
		
		var strSearchCookie = "";
		for(var j=0;j<arrNameSearchCookie.length;j++)
		{
			if(j==0)
				strSearchCookie = strSearchCookie + $.trim(arrNameSearchCookie[j]) + '=' + $.trim(arrValueSearchCookie[j]); 
			else
				strSearchCookie = strSearchCookie + ':::' + $.trim(arrNameSearchCookie[j]) + '=' + $.trim(arrValueSearchCookie[j]);
		}
		$.cookie("strSearchCookie",strSearchCookie, {path: '/'});
	}
});



Array.prototype.find = function(searchStr, from, strict) 
{
	 if(from == undefined || from >= this.length) from = 0;
	   strict = strict == undefined ? false : strict;

	  var returnArray = false;
	  for (i=from; i<this.length; i++) 
	{
		if (typeof(searchStr) == 'function') 
		{
		  if (searchStr.test(this[i]))
			{
				if (!returnArray)
					{ returnArray = [] }
				returnArray.push(i);
			}
		} 
		else
		{
			if(strict)
			{
					if (this[i]===searchStr) 
					{
							if (!returnArray) 
								{ returnArray = [] }
							returnArray.push(i);
					}
			}
			else
			{
				if (this[i]==searchStr) 
				{
					if (!returnArray) 
						{ returnArray = [] }
					returnArray.push(i);
				}
			 }
		}
		
	  }
	  return returnArray;
};







/*yahooUI.js*/

var isIE = document.all?1:0;
var isIE6 = (window.XMLHttpRequest)?0:1;
var usrAgt = navigator.userAgent.toLowerCase();
var isFF = (usrAgt.indexOf('firefox')!=-1)?1:0;
var isOpera = (usrAgt.indexOf('opera')!=-1)?1:0;
var isSafari = ((usrAgt.indexOf('safari')!=-1)&&(usrAgt.indexOf('mac')!=-1))?1:0;
//enables background image cache for internet explorer 6
if (isIE6) try {document.execCommand("BackgroundImageCache", false, true);} catch(e){};
var IE6orIE7 = false /*@cc_on || @_jscript_version < 5.7 @*/;
var YAHOO;

function f_clientWidth() {
	return f_filterResults (
		window.innerWidth ? window.innerWidth : 0,
		document.documentElement ? document.documentElement.clientWidth : 0,
		document.body ? document.body.clientWidth : 0
	);
}
function f_clientHeight() {
	return f_filterResults (
		window.innerHeight ? window.innerHeight : 0,
		document.documentElement ? document.documentElement.clientHeight : 0,
		document.body ? document.body.clientHeight : 0
	);
}
function f_scrollLeft() {
	return f_filterResults (
		window.pageXOffset ? window.pageXOffset : 0,
		document.documentElement ? document.documentElement.scrollLeft : 0,
		document.body ? document.body.scrollLeft : 0
	);
}
function f_scrollTop() {
	return f_filterResults (
		window.pageYOffset ? window.pageYOffset : 0,
		document.documentElement ? document.documentElement.scrollTop : 0,
		document.body ? document.body.scrollTop : 0
	);
}
function f_filterResults(n_win, n_docel, n_body) {
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}

function setDlgPos(elid)
{
	
	if(elid=="initWithMe")
		return;
	if(document.getElementById(elid))
	{
		var f_cw = f_clientWidth();
		var f_ch = f_clientHeight();
		var el_H = document.getElementById(elid).style.height.substr(0,3);
		var el_W = document.getElementById(elid).style.width.substr(0,3);
		document.getElementById(elid).style.position = "static";
		document.getElementById(elid).style.top  = eval(Math.abs(f_ch/2) - Math.abs(el_H/2))+"px";
		document.getElementById(elid).style.left = eval(Math.abs(f_cw/2) - Math.abs(el_W/2))+"px";
		var myObj = document.getElementsByClassName('underlay');
		if(myObj != null)
		{
			var myLen = myObj.length;
			for(var i=0;i<myLen;i++)
			{
				myObj[i].removeClassName('underlay');
			}
		}			
	}	
}

function createDialog(elid)
{
	var useShim;
	var ua = navigator.userAgent.toLowerCase();
	if (isIE){
		useShim = true;
		if(!IE6orIE7)
			setDlgPos(elid);
	}else{
		useShim = false;
		setDlgPos(elid);
	}
	if(YAHOO==null)
	{
		alert("Please include yahoo.js");
	}
	else
	{
		dlgBox = new YAHOO.widget.Panel(elid, {modal:true, visible:false, fixedcenter:true, constraintoviewport:true, shim:useShim, draggable:false} );
		dlgBox.render();
		if (!isIE6)
			dlgBox.beforeShowEvent.subscribe(function(){setDlgPos(elid);}, this);
		return dlgBox;
	}
}


/*sendEmail.js*/

	var sessid	= '';
	var sharePageUrl = '';
	var emailPopup = null;
	// YUI Related Functions 
	/**
	 * Create the YAHOO Panel dynamically
	 * @param {id} elid The div id of the Yahoo Panel
	 * @return Panel object
	 */
	 function setDlgPos(elid)
	{
		
		if(elid=="initWithMe")
			return;
		if(document.getElementById(elid))
		{
			var f_cw = f_clientWidth();
			var f_ch = f_clientHeight();
			var el_H = document.getElementById(elid).style.height;
			var el_W = document.getElementById(elid).style.width;
			document.getElementById(elid).style.position = "static";
			document.getElementById(elid).style.top = eval(Math.abs(f_ch/2) - Math.abs(el_H/2))+"px";
			document.getElementById(elid).style.left = eval(Math.abs(f_cw/2) - Math.abs(el_W/2))+"px";
			var myObj = document.getElementsByClassName('underlay');
			if(myObj != null)
			{
				var myLen = myObj.length;
				for(var i=0;i<myLen;i++)
				{
					if(myObj[i])
					{
						var orgCls = myObj[i].className;
						myObj[i].className = orgCls.replace('underlay','');
					}
				}
			}			
		}	
	}
	function createDialog(elid)
	{
		var useShim;
		var ua = navigator.userAgent.toLowerCase();
		if (isIE){
			useShim = true;
		}else{
			useShim = false;
			setDlgPos(elid);
		}
		if(YAHOO==null)
		{
			alert("Please include yahoo.js");
		}
		else
		{			
			dlgBox = new YAHOO.widget.Panel(elid, {modal:true, visible:false, fixedcenter:true, constraintoviewport:true, shim:useShim, draggable:false} );
			dlgBox.render();
			if (!isIE6)
				dlgBox.beforeShowEvent.subscribe(function(){setDlgPos(elid);}, this);					
			return dlgBox;
		}
	};

	function emailIsValid(id)
	{
		var testresults;
		var str=document.getElementById(id).value;
		var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
		if (filter.test(str))
		{
			testresults=true;
		}
		else
		{
			alertErrorMsg = "Please input a valid email address!";
			document.getElementById(id).value="";
			document.getElementById(id).focus();
			testresults=false;
		}
		return (testresults)
	}
	function phoneIsValid(id,disp)
	{
		var decimalRE = /^\s*(\d{3}-\d{3}-\d{4}|\(\d{3}\) \d{3}-\d{4})\s*$/;
		if(trim(document.getElementById(id).value)=="")
			return true;
	//	var decimalRE = "^(\\+|-)?[0-9][0-9]*(\\.[0-9]*)?$";
		if((document.getElementById(id).value)==0)
		{
			alertErrorMsg = "Phone is not Valid.\nPlease input in format like 306-954-2548";
			return false;
			
		}
		if (trim(document.getElementById(id).value) != "" && document.getElementById(id).value.match(decimalRE) == null)
		{
			alertErrorMsg = "Phone is not Valid.\nPlease input in format like 306-954-2548";
			return false;
		}
		return true;
	}
	function numTotal(strMoney)
	{
		var strArr = new Array();
		var newnum = '';
		for(var cnt=0; cnt < strMoney.length; cnt++)
		{	
			strArr[cnt] = strMoney[cnt];
			var i = strArr[cnt];
			if(i=="1"||i=="2"||i=="3"||i=="4"||i=="5"||i=="6"||i=="7"||i=="8"||i=="9"||i=="0")
			{
				newnum += i;
			}
		}
		newnum = parseFloat(newnum);
		if(!isNaN(newnum))
			return(newnum);
		else
			return "";
	}
/*	function createEmailPopup()
	{
		if(emailPopup == null)
			emailPopup = createDialog($("divPowerPopup_Email"));

		$("divPowerPopup_Email_mask").style.display = "block";
		$("divPowerPopup_Email").style.display = "block";
		$('powerPopupErr').innerHTML = '';
		emailPopup.show();
		$('powerToEmail').focus();
	}*/
	function createEmailPopup()
	{
		if(emailPopup == null)
			emailPopup = createDialog($("yahooPopupDiv"));

		$("yahooPopupDiv").style.display = "block";
		$('popupErrorDiv').innerHTML = '';
		emailPopup.show();
		if($('txtName')) $('txtName').focus();
		if($('txtFName')) $('txtFName').focus();

		emailPopup.beforeShowEvent.subscribe(function(){
			if($('txtName')) $('txtName').className = 'textbox';
			if($('txtEmail')) $('txtEmail').className = 'textbox';
			if($('txtPhone')) $('txtPhone').className = 'textbox';
			if($('txtAddress')) $('txtAddress').className = 'textbox';
			if($('txtCity')) $('txtCity').className = 'textbox';
			if($('txtState')) $('txtState').className = 'textbox';
			if($('txtZip')) $('txtZip').className = 'textbox';
		},this);
	}

	function validateSharePage(page) 
	{
		if($('sent').value == '0')
		{
			$('powerPopupErr').innerHTML = '';
			$('powerToEmail').className = '';
			$('powerDesc').className = '';
			$('powerPopupErr').innerHTML = '';			
			var sent = false;
			var desc = trim($('powerDesc').value);
			var email = trim($('powerToEmail').value);
			var nhood = $('powerNhood').value;
			var specialchars = "!$@%^&*()+=-[]\\\';,/{}|\":<>?``";

			if(email == '')
			{
				$('powerPopupErr').innerHTML = "Please provide atleast one recipient email id.";
				$('powerToEmail').focus();
				$('powerToEmail').className="textboxRed";
				return false;
			}
			else if(!emailIsValid("powerToEmail"))
			{
				$('powerPopupErr').innerHTML = "Please input valid email addresses in recipients!";
				$('powerToEmail').focus();
				$('powerToEmail').className="textboxRed";
				return false;
			}

			if(desc)
			{
				for (var charNo = 0; charNo < desc.length; charNo++) 
				{
					if (specialchars.indexOf(desc.charAt(charNo)) != -1)
					{
						errorMsg = "Desc should not contain special characters.";
						$('powerPopupErr').innerHTML = errorMsg;
						$('powerDesc').className 	= "textboxRed";
						$('powerDesc').focus();
						return false ;	  				
					}
				}
			}
			sendEmail(page, email, nhood, desc);
		}
	}

	function validateContactPage(page, action, subject) 
	{
		if($('sent').value == '0')
		{
			var sent = false;
			var specialchars = "!@#$%^&*()+=-[]\\\';,/{}|\":<>?``";

			$('popupErrorDiv').innerHTML = '';
			if($('txtName')) $('txtName').className = 'textbox';
			if($('txtEmail')) $('txtEmail').className = 'textbox';
			if($('txtPhone')) $('txtPhone').className = 'textbox';
			if($('txtAddress')) $('txtAddress').className = 'textbox';
			if($('txtCity')) $('txtCity').className = 'textbox';
			if($('txtState')) $('txtState').className = 'textbox';
			if($('txtZip')) $('txtZip').className = 'textbox';
		
			var name	= $('txtName').value;
			var email	= $('txtEmail').value;
			var phone	= $('txtPhone').value;
			var address = escape($('txtAddress').value);
			var city	= $('txtCity').value;
			var state	= $('txtState').value.toUpperCase();
			var zip		= $('txtZip').value;

			if(name == '')
			{
				$('popupErrorDiv').innerHTML = "Please specify name.";
				$('txtName').focus();
				$('txtName').className="textboxRed";
				return false;
			}
			else if(name)
			{
				for (var charNo = 0; charNo < name.length; charNo++) 
				{
					if (specialchars.indexOf(name.charAt(charNo)) != -1)
					{
						errorMsg = "Name should not contain special characters.";
						$('popupErrorDiv').innerHTML = errorMsg;
						$('txtName').className 	= "textboxRed";
						$('txtName').focus();
						return false ;	  				
					}
				}
			}
			if(email == '')
			{
				$('popupErrorDiv').innerHTML = "Please specify email.";
				$('txtEmail').focus();
				$('txtEmail').className="textboxRed";
				return false;
			}			
			else if(!emailIsValid("txtEmail"))
			{
				$('popupErrorDiv').innerHTML = "Please specify valid email.";
				$('txtEmail').focus();
				$('txtEmail').className="textboxRed";
				return false;
			}
/*			if(phone == '')
			{
				$('popupErrorDiv').innerHTML = "Please specify phone.";
				$('txtPhone').focus();
				$('txtPhone').className="textboxRed";
				return false;
			}			
			else*/ if(!phoneIsValid("txtPhone"))
			{
				$('popupErrorDiv').innerHTML = "Please specify valid phone no.";
				$('txtPhone').focus();
				$('txtPhone').className="textboxRed";
				return false;
			}
			if(address)
			{
				var specialchars = "?";
				for (var charNo = 0; charNo < address.length; charNo++) 
				{
					if (specialchars.indexOf(address.charAt(charNo)) != -1)
					{
						errorMsg = "Address should not contain special characters.";
						$('popupErrorDiv').innerHTML = errorMsg;
						$('txtAddress').className 	= "textboxRed";
						$('txtAddress').focus();
						return false ;	  				
					}
				}
			}
			if(city)
			{
				var specialchars = "!@#%^()+=[]\\\'/{}|\"<>``";
				for (var charNo = 0; charNo < city.length; charNo++) 
				{
					if (specialchars.indexOf(city.charAt(charNo)) != -1)
					{
						errorMsg = "City should not contain special characters.";
						$('popupErrorDiv').innerHTML = errorMsg;
						$('txtCity').className 	= "textboxRed";
						$('txtCity').focus();
						return false ;	  				
					}
				}
			}
			if(state)
			{
				var specialchars = "!@#%^()+=[]\\\'/{}|\"<>``";
				for (var charNo = 0; charNo < state.length; charNo++) 
				{
					if (specialchars.indexOf(state.charAt(charNo)) != -1)
					{
						errorMsg = "State should not contain special characters.";
						$('popupErrorDiv').innerHTML = errorMsg;
						$('txtState').className 	= "textboxRed";
						$('txtState').focus();
						return false ;	  				
					}
				}
			}
			if(!zipIsValid("txtZip"))
			{
				$('popupErrorDiv').innerHTML = "Please specify valid Zip.";
				$('txtZip').focus();
				$('txtZip').className="textboxRed";
				return false;
			}
			var queryString = '';
			queryString = "&action=" + action + "&subject=" + subject + "&name=" + name +  "&email=" + email + "&phone=" + phone + "&address=" + address + "&city=" + city + "&state=" + state + "&zip=" + zip;
			sendEmail(page, queryString);
		}
	}

	function sendEmail(page, queryString)
	{
		$('sent').value = '1';

		if(page == 'DIRECTION')	
			queryString = "&page=" + page + "&email=" + email + "&nhood=" + nhood + queryString;
		else
			queryString = "&page=" + page + "&shareUrl=" + escape(location) + queryString;

		ajaxRequest('/help/' + bkTheme + '/sendEmail.php', queryString, function(reqobj) { 
			var emailSent = false;
			var response = reqobj.responseText;
			var resArr = response.split("|==|");

			for(var resArrCnt = 0; resArrCnt < resArr.length; resArrCnt++)
			{
				if(resArr[resArrCnt] == 1)
				{
					emailSent = true;
					break;
				}
			}
			if(emailSent)
			{	
				alert('Your mail has been sent.');
				resetAllDivs();
			}
			else
			{	
				alert('Sending information to email failed.');
			}	
			$('sent').value = '0';
			setTimeout('emailPopup.hide();',800);
		});
	}

	function resetAllDivs() 
	{
		if($('popupErrorDiv')) $('popupErrorDiv').innerHTML = '';
		if($('txtName')) $('txtName').className = 'textbox';
		if($('txtEmail')) $('txtEmail').className = 'textbox';
		if($('txtPhone')) $('txtPhone').className = 'textbox';
		if($('txtAddress')) $('txtAddress').className = 'textbox';
		if($('txtCity')) $('txtCity').className = 'textbox';
		if($('txtState')) $('txtState').className = 'textbox';
		if($('txtZip')) $('txtZip').className = 'textbox';

		if($('txtName')) $('txtName').value = '';
		if($('txtEmail')) $('txtEmail').value = '';
		if($('txtPhone')) $('txtPhone').value = '';
		if($('txtAddress')) $('txtAddress').value = '';
		if($('txtCity')) $('txtCity').value = '';
		if($('txtState')) $('txtState').value = '';
		if($('txtZip')) $('txtZip').value = '';
	}

/*agent-offices.js*/

var emailPopup = null;
function loadOfficeMap() 
{
			 if (GBrowserIsCompatible()) 
				{                       
						/*if(typeof(gMap) != 'object' )
						{ */      
								map = new GMap2($("officeMap"));
								ysliderCtrl = new ZoomControl(); 
								map.addControl(ysliderCtrl);
								map.addControl(new GMenuMapTypeControl());
								map.addMapType(G_PHYSICAL_MAP);
								/*
								mapTypeCtrl = new mapTypeControl();
								map.addControl(mapTypeCtrl);   
								document.getElementById("btnMap").className="mapTypeButtonSelect";
								GEvent.addListener(map,"maptypechanged",function(){highlightMapTypeBtn(map);});
								*/
								map.setCenter(new GLatLng(41.8795350,-87.6243330), 12);
								
						//}
				

				var myData = eval('('+dataJson+')');
				for(var i=0;i<myData.length;i++)
				{
					    var id = myData[i].srno;
                        var name  = myData[i].name;
                        var address = myData[i].address;
                        var city = myData[i].city;
                        var state = myData[i].state;
                        var zip = myData[i].zip;
                     
                        var lat = parseFloat(myData[i].latitude);
                        var lng = parseFloat(myData[i].longitude);
						//alert(lat +" " + lng);
						/* ------ MAP PUSHPINS ------ */
						
						/********************************/
						if(lat != 0)
						{
							var point = new GLatLng(lat, lng);
							//bounds.extend(point);
							//var zoomValue = map.getBoundsZoomLevel(bounds);
							//map.setZoom(zoomValue);
						}
						/********************************/
                        //var point = new GLatLng(parseFloat(lat),parseFloat(lng));
                        if (!point)
                        {
                        }
                        else
                        {
							pushPinIcon = new GIcon();
							pushPinIcon.image = "/wt/"+bkTheme+"/images/pushpin/mlsCountySearch_pushpin.png";
							//alert(pushPinIcon.image);
							pushPinIcon.iconSize = new GSize(49,38);
							pushPinIcon.iconAnchor = new GPoint(6, 20);
							pushPinIcon.infoWindowAnchor = new GPoint(5, 1);
							//var imgSrc = imgThmPath+'common/'+dataSource+'.gif';
							html = "<div class='username'>"+name+"</div><div class='useraddr' style='text-align:left;'>"+address+", "+city+", "+state;
							eval("marker"+id+" = new createMarker(point,html,id,pushPinIcon)");
							map.addOverlay(eval("marker"+id));
                        }
				
                }

				if(!bounds.isEmpty())
				{
					map.setCenter(bounds.getCenter());
					map.setZoom(map.getBoundsZoomLevel(bounds));					
				}
	
			}
	//map.setCenter(bounds.getCenter());
}
	//ANIL
	function loadAgentListings(act,bkID,aid,auid) {

		$("pageValS").value=0;
		var currPageNo = $("pageValC").value;
		$('paginationLinks').innerHTML="";
		currPageNo= parseInt(currPageNo);
		var totalPages;
		if(currPageNo=="0" && act=="p")	return;
		else if( act=="p")
		{
			currPageNo--;
			$("pageValC").value=currPageNo;
		}
		else if(act=="n")
		{			
			currPageNo++;
			if(currPageNo >= parseInt($("totalPageC").value ))	return;
			$("pageValC").value=currPageNo;
		}
		else if(act=="")	currPageNo=0;
        var url = "/agent-offices/agentOfficeHandler.php";
        var qs	= "op=getAgentListings&currPageNo="+currPageNo;	
			qs += "&bkID="+bkID;
			qs += "&aid="+aid;
			qs += "&auid="+auid;

		/*$("soldList").innerHTML="";
		$("currList").innerHTML="";
		$("currList").innerHTML = '<img src="/wt/atproperties/images/common/currentListing_h.gif" style="vertical-align:bottom;" />';
		$("soldList").innerHTML = '<img src="/wt/atproperties/images/common/recentSale_n.gif" style="vertical-align:bottom;" />';*/

		$("tbSoldListing").className="";
		$("tbCurrListing").className="selected";


		if(currPageNo==0)
		$("totalRecs").innerHTML = '<img src="/wt/'+ bkTheme +'/images/common/loaderLogin.gif" alt="Loading..."/> Loading Current Listings';	

		ajaxRequest(url,qs.toString(),function(reqobj){
			var varResponse = trim(reqobj.responseText);
			agentDataHtml	= varResponse.split("=^^=");
			if(agentDataHtml.length>1) {
				response = eval('(' + agentDataHtml[1] + ')');
				totalPages = response[0]['totalpages'];
				totalListings = response[0]['totalcount'];

				$("agentSoldData").innerHTML="";
				$("agtSoldData").style.display="none";
				$("agtCurrData").style.display="block";				
				$("agentData").innerHTML = agentDataHtml[0];
				if(currPageNo==0)
				{
					$("totalPageC").value = totalPages;		
					$("totalRecs").innerHTML = totalListings + " Listing(s) Found";
				}
				totalPages = $("totalPageC").value;
				showPagingTxt(totalPages,bkID,"","","",aid,auid,"pageValC","Curr");
				if(parseInt(totalPages)==1)	$("paginationLinks").style.display="none";
			}
			else
			{
				$("agtSoldData").style.display="none";
				$("agtCurrData").style.display="block";
				$("totalRecs").innerHTML = "";

				var noDataStr ="";
				ht = 100;
				wd = 200;
				body = '<font color=\'#666666\'>No Current Listing Found</font>';
				noDataStr += '<table align="center" valign="middle" style="height:100%;width:100%;"><tr><td valign="middle" style="padding-top:10px;">';
					noDataStr +=  '<table align="center" valign="middle" style="width:'+wd+'px; height:'+ht+'px" border="0" cellspacing="0" cellpadding="0">';
					noDataStr += '<tr style="height:7px;">';
						noDataStr +=  '<td class="msgTableTopleft" valign="bottom"></td>';
						noDataStr +=  '<td class="msgTableTopmid" valign="bottom"></td>';
						noDataStr +=  '<td class="msgTableTopright" valign="bottom"></td>';
					noDataStr +=  '</tr>';
					noDataStr +=  '<tr style="height:'+(ht-16)+'px;">';
						noDataStr +=  '<td class="msgTableCenleft"></td>';
						noDataStr +=  '<td class="msgTableCenmid"><font color="#666666"><span class="lang">'+body+'</span></font></td>';
						noDataStr +=  '<td class="msgTableCenright"></td>';
					noDataStr +=  '</tr>';
					noDataStr +=  '<tr style="height:8px;">';
						noDataStr +=  '<td class="msgTableBotleft"></td>';
						noDataStr +=  '<td class="msgTableBotmid"></td>';
						noDataStr +=  '<td class="msgTableBotright"></td>';
					noDataStr +=  '</tr>';
					noDataStr +=  '</table>';
				noDataStr +=  '</td></tr></table>';
				$("agentData").innerHTML=noDataStr;
				$("paginationLinks").innerHTML="";			
			}
		});		
	}



function loadAgentSoldListings(act,bkID,aid,auid) {

		$("pageValC").value=0;
		var currPageNo = $("pageValS").value;
		$('paginationLinks').innerHTML="";
		currPageNo= parseInt(currPageNo);
		var totalPages;
		if(currPageNo=="0" && act=="p")	return;
		else if( act=="p")
		{
			currPageNo--;
			$("pageValS").value=currPageNo;
		}
		else if(act=="n")
		{			
			currPageNo++;
			if(currPageNo >= parseInt($("totalPageS").value ))	return;
			$("pageValS").value=currPageNo;
		}
		else if(act=="")	currPageNo=0;
        var url = "/agent-offices/agentOfficeHandler.php";
        var qs	= "op=getAgentSoldListings&currPageNo="+currPageNo;	
			qs += "&bkID="+bkID;
			qs += "&aid="+aid;
			qs += "&auid="+auid;

		/*$("soldList").innerHTML="";
		$("currList").innerHTML="";
		$("currList").innerHTML = '<img src="/wt/atproperties/images/common/currentListing_n.gif" style="vertical-align:bottom;" />';
		$("soldList").innerHTML = '<img src="/wt/atproperties/images/common/recentSale_h.gif" style="vertical-align:bottom;" />'; */
		$("tbSoldListing").className="selected";
		$("tbCurrListing").className="";
		
		if(currPageNo==0)
		$("totalRecsSold").innerHTML = '<img src="/wt/'+ bkTheme +'/images/common/loaderLogin.gif" alt="Loading..."/> Loading Sold Listings';	

		ajaxRequest(url,qs.toString(),function(reqobj){
			var varResponse = trim(reqobj.responseText);
			agentDataHtml	= varResponse.split("=^^=");
			if(agentDataHtml.length>1) {
				response = eval('(' + agentDataHtml[1] + ')');
				totalPages = response[0]['totalpages'];
				totalListings = response[0]['totalcount'];

				$("agtCurrData").style.display="none";		
				$("agentData").innerHTML ="";
				$("agtSoldData").style.display="block";

				$("agentSoldData").innerHTML = agentDataHtml[0];
				if(currPageNo==0)
				{
					$("totalPageS").value = totalPages;		
					$("totalRecsSold").innerHTML = totalListings + " Listing(s) Found";
				}

				totalPages = $("totalPageS").value;
				showPagingTxt(totalPages,bkID,"","","",aid,auid,"pageValS","Sold");
				if(parseInt(totalPages)==1)	$("paginationLinks2").style.display="none";
			}
			else
			{
				$("agtCurrData").style.display="none";
				$("agtSoldData").style.display="block";
				$("totalRecsSold").innerHTML="";
				//$("totalRecs").innerHTML = "No Sold Listings.";
					var noDataStr ="";
				ht = 100;
				wd = 200;
				body = '<font color=\'#666666\'>No Recent Sales Found</font>';
				noDataStr += '<table align="center" valign="middle" style="height:100%;width:100%;"><tr><td valign="middle" style="padding-top: 10px;">';
					noDataStr +=  '<table align="center" valign="middle" style="width:'+wd+'px; height:'+ht+'px" border="0" cellspacing="0" cellpadding="0">';
					noDataStr += '<tr style="height:7px;">';
						noDataStr +=  '<td class="msgTableTopleft" valign="bottom"></td>';
						noDataStr +=  '<td class="msgTableTopmid" valign="bottom"></td>';
						noDataStr +=  '<td class="msgTableTopright" valign="bottom"></td>';
					noDataStr +=  '</tr>';
					noDataStr +=  '<tr style="height:'+(ht-16)+'px;">';
						noDataStr +=  '<td class="msgTableCenleft"></td>';
						noDataStr +=  '<td class="msgTableCenmid"><font color="#666666"><span class="lang">'+body+'</span></font></td>';
						noDataStr +=  '<td class="msgTableCenright"></td>';
					noDataStr +=  '</tr>';
					noDataStr +=  '<tr style="height:8px;">';
						noDataStr +=  '<td class="msgTableBotleft"></td>';
						noDataStr +=  '<td class="msgTableBotmid"></td>';
						noDataStr +=  '<td class="msgTableBotright"></td>';
					noDataStr +=  '</tr>';
					noDataStr +=  '</table>';
				noDataStr +=  '</td></tr></table>';
				$("agentSoldData").innerHTML=noDataStr;
				$("paginationLinks2").innerHTML="";
			}
		});		
	}

	function createMarker(point,html,id,icon)
	{

		var marker = new GMarker(point,{icon:icon});
		GEvent.addListener(marker, "click", function()
		{
				//getTrackdata(cmpid,<?php echo $_GET['cmp_id']; ?>);
				marker.openInfoWindowHtml(html);
		});
		bounds.extend(point);
		return marker;
	}


	function loadAgents(act,bkID,srchTxt,srchLang,srchSpec,getAgentsBy)
	{
		if(getAgentsBy == "alpha") //if alphabat selected, then dont consider text box search or language search...Jahnvi
		{
			$("agtSrchTxt").value="First name,last name";
			$("langPref").value = "0";
		}
		var currPageNo = $("pageVal").value;

		$("paginationLinks").innerHTML = "";
		if(srchTxt == "first name or last name" || srchTxt == "First name or Last name" || srchTxt == "First name orlast name" || srchTxt == "First name,last name")
		{
			srchTxt="";
		}

		location.hash = currPageNo;
		currPageNo= parseInt(currPageNo);
		var totalPages;
		if(currPageNo=="0" && act=="p")
		{
			return;
		}
		else if( act=="p")
		{
				currPageNo--;
				$("pageVal").value=currPageNo;
		}
		else if(act=="n")
		{			
			currPageNo++;
			if(currPageNo >= parseInt($("totalPage").value ))
			{
					return;
			}
			$("pageVal").value=currPageNo;
		}
		else if(act=="")
		{
				currPageNo=0;
		}
		if(getAgentsBy == "alpha")
		{
			var alphaLinks = document.getElementsByClassName("alphaSel");
			if(alphaLinks.length > 0)
			{
				for(i=0;i<alphaLinks.length;i++)
				{
					alphaLinks[i].className = "dictinary";
				}
				$("lnk_"+srchTxt).addClassName = "alphaSel";
			}
			srchSpec = "";
			srchLang="0";
		}
		else
		{
			var alphaLinks = document.getElementsByClassName("alphaSel");
			if(alphaLinks.length > 0)
			{
				for(i=0;i<alphaLinks.length;i++)
				{
					alphaLinks[i].className = "dictinary";
				}
			}
		}
		if(getAgentsBy == "alpha")
			$("lnk_"+srchTxt).className="alphaSel";
	
        var url = "/agent-offices/agentOfficeHandler.php";
        var qs = "op=getAgents&currPageNo="+currPageNo;
			  qs += "&bkID="+bkID;
	          qs += "&srchTxt="+srchTxt;
	          qs += "&srchLang="+srchLang;
	          qs += "&srchSpec="+srchSpec;
			  qs += "&getAgentsBy="+getAgentsBy;
			  $("paginationLinks").innerHTML = '<img src="/wt/'+ bkTheme +'/images/common/loaderLogin.gif" alt="Loading..."/> <span class="bluetxt"> Loading agents please wait.</span> ';	
			if(currPageNo==0)
				$("totalRecs").innerHTML = "";

	    	  ajaxRequest(url,qs.toString(),function(reqobj){
                        var varResponse = trim(reqobj.responseText);
						agentDataHtml = varResponse.split("||");
						totalPages=agentDataHtml[1];
						totalAgents = agentDataHtml[2];						
							//alert(varResponse);
						
						if(totalAgents=="")
									$("totalRecs").innerHTML = "";
						$("agentData").innerHTML = agentDataHtml[0];
						
						//condiiton commented to solve an issue when no recs for a perticular language
						//and then select no preference, agents were coming but count not, becoz of this condition....Jahnvi.
						
						//if(currPageNo==0) 
					    //{
								$("totalPage").value = totalPages;
								if(totalAgents!="")
									$("totalRecs").innerHTML = "<b>"+totalAgents+" agents found </b> ";
					    //}
						  totalPages = $("totalPage").value;
						  $("paginationLinks").innerHTML="";
						  if(totalAgents>totalRecsToShow)
							{
							  showPagingTxt(totalPages,bkID,srchTxt,srchLang,srchSpec,"","","","",getAgentsBy);
							}
                });
	}


function showPagingTxt(totalPage,bkID,srchTxt,srchLang,srchSpec,aid,auid,pageV,listType,getAgentsBy)
{	
	var pctr;
	var pagiText = " ";

	if(pageV=="")
		var pageVal = 'pageVal';
	else
		var pageVal = pageV;

	if(listType=="Curr")
		callFun = "loadAgentListings";
	else if(listType == "Sold")
		callFun = "loadAgentSoldListings";

	var pno = $F(pageVal);

	var imgThmPath = "/wt/"+bkTheme+"/images/";

	pno = parseInt(pno);
	if(pno == '-1') pno = '0';		
	prev=pno-1;
	next=pno+1;	
	recordPerPage=4;

	
	sLimit = recordPerPage*pno + 1;
	sLimit = parseInt(sLimit);
	recordPerPage = parseInt(recordPerPage);    
	if(prev < 0) 
		prevImg = '<img src="'+imgThmPath+'common/arrow_left_deactive1.gif" />';		
	else {
		if(aid != "" && trim(auid) != "")
			prevImg = '<img class="crsr" src="'+imgThmPath+'common/arrow_left_active1.gif" onclick="javascript:'+callFun+'(\'p\',\''+bkID+'\',\''+aid+'\',\''+auid+'\');" title="Previous"/>';
		else
			prevImg = '<img class="crsr" src="'+imgThmPath+'common/arrow_left_active1.gif" onclick="javascript:loadAgents(\'p\','+bkID+',\''+srchTxt+'\',\''+srchLang+'\',\''+srchSpec+'\',\''+getAgentsBy+'\');" title="Previous"/>';
	}

	if(next >= totalPage) 
		nextImg = '<img src="'+imgThmPath+'common/arrow_right_deactive1.gif" />';
	else {
		if(aid != "" && auid != "")
			nextImg = '<img class="crsr" src="'+imgThmPath+'common/arrow_right_active1.gif" onclick="javascript:'+callFun+'(\'n\',\''+bkID+'\',\''+aid+'\',\''+auid+'\');" title="Next"/>';
		else
			nextImg = '<img class="crsr" src="'+imgThmPath+'common/arrow_right_active1.gif" onclick="javascript:loadAgents(\'n\','+bkID+',\''+srchTxt+'\',\''+srchLang+'\',\''+srchSpec+'\',\''+getAgentsBy+'\');" title="Next"/>';
	}
	
	//alert(sLimit + " === "+eLimit);
	//$("paginationDiv").innerHTML = '<table align="center" style="padding-left:10px;"><tr><td>'+prevImg+'</td><td class="pagiText" id="txtLimit"> &nbsp;&nbsp; '+ sLimit +' - '+ eLimit +' of '+totalRecords+' Results  &nbsp;&nbsp;</td><td>'+nextImg+'</td></tr></table>';
	//alert( sLimit +' - '+ eLimit +' of '+totalRecords);
	var pno1 = pno;
	if(totalPage - pno <= 4)
		pno1 =  parseInt(totalPage - 5);
		
	if(totalPage > 1)
	{
		var totPageStr = "'"+totalPage+"'";
		var totPageStrCnt = totPageStr.length-2;
		var pagiEnd  = 3;		
		if(totPageStrCnt > 3)
			pagiEnd  = 2;		
		for(pctr = pno1; pctr <= (pno1+pagiEnd); pctr++)
		{		pctr=parseInt(pctr);
				if(pctr >= 0 && pctr < totalPage)
				{
					var stlTag = 'style=""';
					if(pctr == pno)
						stlTag = 'style="background-color:#ccc"';

					if(aid!="" && trim(auid)!="")
						pagiText += '<a href="javascript:void(0)" onclick="javascript:$(\''+pageVal+'\').value='+pctr+'; '+callFun+'(\'d\',\''+bkID+'\',\''+aid+'\',\''+auid+'\');" '+stlTag+' >'+(pctr+1)+'</a>';
					else
						pagiText += '<a href="javascript:void(0)" onclick="javascript:$(\''+pageVal+'\').value='+pctr+'; loadAgents(\'d\','+bkID+',\''+srchTxt+'\',\''+srchLang+'\',\''+srchSpec+'\',\''+getAgentsBy+'\');" '+stlTag+' >'+(pctr+1)+'</a>';
				}
				pagiText += " ";
		}
		var stlTag = 'style=""';

		if((totalPage-1) == pno)
			stlTag = 'style="background-color:#ccc"';
		if(aid!="" && auid!="")
			pagiText += "... "+'<a href="javascript:void(0)" onclick="javascript:$(\''+pageVal+'\').value='+(totalPage-1)+';'+callFun+'(\'d\',\''+bkID+'\',\''+aid+'\',\''+auid+'\');" '+stlTag+'>'+totalPage+'</a> ';
		else
			pagiText += "... "+'<a href="javascript:void(0)" onclick="javascript:$(\''+pageVal+'\').value='+(totalPage-1)+';loadAgents(\'d\','+bkID+',\''+srchTxt+'\',\''+srchLang+'\',\''+srchSpec+'\',\''+getAgentsBy+'\');" '+stlTag+'>'+totalPage+'</a> ';
	}

	$('paginationLinks').innerHTML = '<table><tr><td>'+prevImg+'</td><td class="listPrice" id="txtLimit"> &nbsp;'+ pagiText +'&nbsp;</td><td>'+nextImg+'</td></tr></table>';
	$('paginationLinks2').innerHTML = '<table ><tr><td>'+prevImg+'</td><td class="listPrice" id="txtLimit"> &nbsp;'+ pagiText +'&nbsp;</td><td>'+nextImg+'</td></tr></table>';
}


function sendContactMail()
{
	$("neighborhood").className = "ipboxes";
	$("agtNameTxt").className = "ipboxes";
	$("agtEmailTxt").className = "ipboxes";
	$('agtPhoneTxt').className = "ipboxes";
	$("pref").className = "";
	$("validationDiv").innerHTML="";

	name		   = $("agtNameTxt").value;
	isForSelling = $("selling").checked;
	isForBuying = $("buying").checked;
	preference  = $("pref").value;
	phn			   = $("agtPhoneTxt").value;
	email		   = $("agtEmailTxt").value;
	var neighborhood   = $("neighborhood").value;
	var hereFor = '';
	if(isForSelling == "1")
		hereFor += " selling ";
	if(isForBuying== "1")
	{
		if(hereFor!="")
			hereFor +=" and "
		hereFor += " buying ";
	}

	if(trim(name)=="")
	{
	    errorMsg = "Please Enter Name";
		$('validationDiv').innerHTML = errorMsg;
		$('agtNameTxt').className 		= "textboxRed";
		$('agtNameTxt').focus();
		return false;
	}

	if(trim(preference)=="")
	{
	    errorMsg = "Please Enter Special needs or Preferences";
		$('validationDiv').innerHTML = errorMsg;
		$('pref').className 		= "textboxRed";
		$('pref').focus();
		return false;
	}

	if(phn!="")
	{
		var p = phoneIsValid("agtPhoneTxt","");
		if(p === false)
		{
			$('validationDiv').innerHTML = alertErrorMsg;
			$('agtPhoneTxt').className 		= "textboxRed";
			$('agtPhoneTxt').focus();
			return false;
		}
		else
		{
			$("agtPhoneTxt").className = "ipboxes";
		}
	}

	if(email == "")
	{
	    errorMsg = "Please Enter Email Address.";
		$('validationDiv').innerHTML = errorMsg;
		$('agtEmailTxt').className 		= "textboxRed";
		$('agtEmailTxt').focus();
		return false;
	}
	else 	if(!emailIsValid("agtEmailTxt"))
	{
	    errorMsg = "Please Enter Valid Email Address.";
		$('validationDiv').innerHTML = errorMsg;
		$('agtEmailTxt').className 		= "textboxRed";
		$('agtEmailTxt').focus();
		return false;
	}	




        var url = "/agent-offices/agentOfficeHandler.php";
        var qs = "op=sendContactMail";
			  qs += "&name="+name;
	          qs += "&hereFor="+hereFor;
	          qs += "&preference="+preference;
	          qs += "&phn="+phn;
	          qs += "&email="+email;
	          qs += "&neighborhood="+neighborhood;
			  


	    	  ajaxRequest(url,qs.toString(),function(reqobj){
                        var varResponse = trim(reqobj.responseText);
						if(varResponse=="")
					  {
							alert("Mail has been sent");

							$("agtNameTxt").value = ""; 
							$("selling").checked= false;      
							$("buying").checked = false
							$("pref").value = "";  
							$("agtPhoneTxt").value = "";
							$("agtEmailTxt").value =""; 
							$("neighborhood").value= "Any";
							//$("neighborhood").className = "ipboxes";
							$("agtNameTxt").className = "ipboxes";
							$("agtEmailTxt").className = "ipboxes";
							$("agtPhoneTxt").className = "ipboxes";
							$("validationDiv").innerHTML="";
					  }
                });



}
function trim(str)
{ 
	if((str == null) || ( str != null && str.length == 0))
		return "";
	else if (typeof(str) != "string")
		return "";

	return(str.replace(/^\s+|\s+$/g, ''));
};
function sendAgtMail()
{

	document.getElementById("txtName").className = "textbox";
	document.getElementById("txtEmail").className = "textbox";
	document.getElementById("txtAPhone").className = "textbox";
	document.getElementById("txtMsg").className = "";
	document.getElementById("popupErrorDiv").innerHTML="";

	name		   = document.getElementById("txtName").value;
	preference		= escape(encodeURI(trim(document.getElementById("txtMsg").value)));
	phn			   = document.getElementById("txtAPhone").value;
	email		   = document.getElementById("txtEmail").value;
	addr			   = document.getElementById("txtAddress").value;
	city			   = document.getElementById("txtCity").value;
	state		   = document.getElementById("txtState").value;
	zip		       = document.getElementById("txtZip").value;
	if(document.getElementById('contact') != null && document.getElementById('contact').value != '')
	{
		document.getElementById("hdEmail").value = document.getElementById('contact').value;
	}
	toMail			= document.getElementById("hdEmail").value;

	if(trim(name)=="")
	{
	    errorMsg = "Please Enter Name";
		document.getElementById('popupErrorDiv').innerHTML = errorMsg;
		document.getElementById('txtName').className 		= "textboxRed";
		document.getElementById('txtName').focus();
		return false;
	}


	if(email == "")
	{
	    errorMsg = "Please Enter Email Address.";
		document.getElementById('popupErrorDiv').innerHTML = errorMsg;
		document.getElementById('txtEmail').className 		= "textboxRed";
		document.getElementById('txtEmail').focus();
		return false;
	}
	else 	if(!emailIsValid("txtEmail"))
	{
	    errorMsg = "Please Enter Valid Email Address.";
		document.getElementById('popupErrorDiv').innerHTML = errorMsg;
		document.getElementById('txtEmail').className 		= "textboxRed";
		document.getElementById('txtEmail').focus();
		return false;
	}	



	if(phn == "")
	{
	    errorMsg = "Please Enter Phone Number.";
		document.getElementById('popupErrorDiv').innerHTML = errorMsg;
		document.getElementById('txtAPhone').className 		= "textboxRed";
		document.getElementById('txtAPhone').focus();
		return false;
	}
	else{
		var p = phoneIsValid("txtAPhone","");
		if(p === false)
		{
			document.getElementById('popupErrorDiv').innerHTML = alertErrorMsg;
			document.getElementById('txtAPhone').className 		= "textboxRed";
			document.getElementById('txtAPhone').focus();
			return false;
		}
	}



	if(trim(preference)=="")
	{
	    errorMsg = "Please Enter Message ";
		document.getElementById('popupErrorDiv').innerHTML = errorMsg;
		document.getElementById('txtMsg').className 		= "textboxRed";
		document.getElementById('txtMsg').focus();
		return false;
	}


        var url = "/agent-offices/agentOfficeHandler.php";
        var qs = "op=sendAgtContactMail";
			  qs += "&name="+name;
	          qs += "&msg="+preference;
	          qs += "&phn="+phn;
	          qs += "&email="+email;
	          qs += "&address="+addr;
	          qs += "&city="+city;
	          qs += "&state="+state;
	          qs += "&zip="+zip;
	          qs += "&toMail="+toMail;

				
			//alert(url+"=="+qs.toString());
    		ajaxRequest(url,qs.toString(),function(reqobj){
                        var varResponse = trim(reqobj.responseText);
						if(varResponse=="")
					  {
							alert("Mail has been sent");

							document.getElementById("txtName").value = ""; 
							document.getElementById("txtMsg").value = "";  
							document.getElementById("txtAPhone").value = "";
							document.getElementById("txtEmail").value =""; 
							document.getElementById("txtAddress").value= "";
							document.getElementById("txtCity").value= "";
							document.getElementById("txtState").value= "";
							document.getElementById("txtZip").value= "";
							//document.getElementById("neighborhood").className = "ipboxes";
							document.getElementById("txtName").className = "textbox";
							document.getElementById("txtEmail").className = "textbox";
							document.getElementById("txtAPhone").className = "textbox";						
							document.getElementById("popupErrorDiv").innerHTML="";

							emailPopup.hide();
					  }
                });

}

	function createAgtPopup()
	{
		if(emailPopup == null)
			emailPopup = createDialog(document.getElementById("yahooPopupDiv"));

		document.getElementById("yahooPopupDiv").style.display = "block";
		document.getElementById('popupErrorDiv').innerHTML = '';
		emailPopup.show();
		if(document.getElementById('txtName')) document.getElementById('txtName').focus();
		else if(document.getElementById('txtFName')) document.getElementById('txtFName').focus();
	}





/*/vendor/yui/SinglePropMin-YUI.js*/

/*File Not Exists*/

/*subneighborhood.js*/

function addSubnHood(id)
{
	var url = "/info/addSubneighborhood.php?";
	var qs= "";
	if(id != "") qs += 'id='+id;
	window.location.href = url+qs;
}

function backNbrListings()
{
	var url = "";
	window.location.href = url;
}
function saveSubNeighborHood()
{
	if(trim($F('subnbrhood')) == "")
	{
		alert('Enter Sub Neighborhood Name');
		$('subnbrhood').focus();
		return false;
	}	
	else if(trim($F('txtPolygon')) == "")
	{
		alert('Draw polygon for sub neighborhood');		
		return false;
	}
	
	var op='add';
	if($F('subNbrId') != "")  op = 'edit';

	if(!chkSubNbrHoodName(trim($F('subnbrhood')),op,trim($F('subNbrId'))))
	{
		alert('Sub Neighborhood Name already exist');
		$('subnbrhood').focus();
		return false;
	}
	var url = "/info/brokerSubNbrHoodHandler.php";
	var qs  = 'op='+op+'&title='+trim($F('subnbrhood'))+'&id='+trim($F('subNbrId'))+'&polygon='+trim($F('txtPolygon'))+'&area='+trim($F('txtArea'));
	ajaxRequest(url,qs,function(r)
	{	
		rsText = r.responseText;
		if(op == 'add')
			alert('Sub Neighborhood inserted successfully');
		else
			alert('Sub Neighborhood updated successfully');

		window.location.href = '/brokerAdmin/brokerAdmin.php?tabType=subneighborhood';
	});
}

function chkNbrHoodName(name,op,id)
{
	var url = "/info/brokerSubNbrHoodHandler.php";
	var qs  = 'op=chkName&name='+name;
	if($('isSubNbr') && $('isSubNbr').checked) 
		qs +='&nbradd=no';
	else
		qs +='&nbradd=yes';

	if(id != '') 
		qs +='&id='+id;
	var flg=true;
	var op = op;
	ajaxRequest(url,qs,function(r)
	{		
		rsText = r.responseText;		
		if(parseInt(rsText) > 0) flg = false;
	},false);	
	return flg;
}

function delSubNbrHood(id)
{
	var conf  = confirm('Are you sure you want to delete this neighborhood?');
	if(conf)
	{
		var url = "/info/brokerSubNbrHoodHandler.php";
		var qs  = 'op=del&id='+id;
		ajaxRequest(url,qs,function(r)
		{	
			rsText = r.responseText;		
				alert('Sub Neighborhood deleted successfully');

			window.location.href = '/brokerAdmin/brokerAdmin.php?tabType=neighborhood';
		});
	}
}

function clearMapList()
{
	pointswitch = false;
	if($('dist')) $("dist").style.display = "none";	
	$('txtArea').value='';
	$('txtPolygon').value='';
	removeSearchCookie('area');
	removeSearchCookie("polygon");
	polyRouteArr.clear();
	routePoints.clear();
	if(minimap) minimap.clearOverlays();	
}

function cityResponseList(resp)
{	
	var cityResp = trim((resp.responseText)).split(",");
	/*geoCity = cityResp[0];
	geoState = cityResp[1];
	latitude = cityResp[2];
	longitude = cityResp[3];
	if(geoCity=="")
	{
		alert("Sorry, There are no listings for the selected region.");
		$("txtArea").value = "";
		$("txtPolygon").value = "";
		while(routePoints.length > 1)
		{
			routePoints.pop();
			plotRoute();
		}
		routePoints.clear();
		minimap.removeOverlay(startMarker);
	}
	else
	{*/
		if(trim($("txtArea").value) == "")
		{
			$("txtArea").value = tmpBound.toString();
			$("txtPolygon").value = routePoints.toString();
		}
		else 
		{
			if($("txtPolygon").value == "")
			{
				$("txtPolygon").value = rectToPoly($("txtArea").value);
			}
			$("txtArea").value += "|" +tmpBound.toString();
			$("txtPolygon").value += "|"+routePoints.toString();
		}			
	//}
	latitude	= cityResp[2];
	longitude	= cityResp[3];

	if(latitude && $('addnbrhoodLat'))
		$('addnbrhoodLat').value = latitude;
	if(longitude && $('addnbrhoodLng'))
		$('addnbrhoodLng').value = longitude;
}

function hideMapList()
{
	return;
}

function isSubNbrHood(isNbrId)
{
	if($('addnbrhoodMls')) $('addnbrhoodMls').value = "";
	if($('subnhoods'))  $('subnhoods').value = "";
	if(isNbrId.checked)
	{
		$('subNbrHoodsTr').hide();
		$('parentNbrHoodTr').show();
		$('addNhoodMlsTR').hide();
		$('drMapStar').show();
	}
	else
	{
		$('subNbrHoodsTr').show();
		$('parentNbrHoodTr').hide();
		$('addNhoodMlsTR').show();
		$('drMapStar').hide();

		//VISHAL
		/*$('trseoblank').style.display		=	'';
		$('trseoTitle').style.display		=	'';
		$('trseoDesc').style.display		=	'';
		$('trseoKeywords').style.display	=	'';*/
	}
}

// Encode a signed number in the encode format.
function encodeSignedNumber(num) 
{
  var sgn_num = num << 1;

  if (num < 0) {
    sgn_num = ~(sgn_num);
  }

  return(encodeNumber(sgn_num));
}

// Encode an unsigned number in the encode format.
function encodeNumber(num) 
{
  var encodeString = "";

  while (num >= 0x20) {
    encodeString += (String.fromCharCode((0x20 | (num & 0x1f)) + 63));
    num >>= 5;
  }

  encodeString += (String.fromCharCode(num + 63));
  return encodeString;
}

function doEncoding() 
{
	var txtPolyVal = $('txtPolygon').value;
	txtPolyVal= txtPolyVal.replace(/\(/g,'');
	txtPolyVal = txtPolyVal.replace(/\)/g,'');
	var PolyValArr = txtPolyVal.split(',');	
	var i,j;
	var plat = 0;
	var plng = 0;	
	var encoded_points = "";
	var pointArray = new Array();
	for(i=0;i<PolyValArr.length;i+=2)
	{
		  j=i;		  
		  var pointObj = new Object();
		  pointObj.Latitude = PolyValArr[j];
		  pointObj.Longitude= PolyValArr[j+1];
		  pointArray.push(pointObj);	  
	}
	for(i = 0; i < pointArray.length; i++) 
	{
		var point = pointArray[i];
		var lat = point.Latitude;
		var lng = point.Longitude;

		var late5 = Math.round(lat * 1e5);
		var lnge5 = Math.round(lng * 1e5);

		dlat = late5 - plat;
		dlng = lnge5 - plng;

		plat = late5;
		plng = lnge5;

		encoded_points += encodeSignedNumber(dlat) + encodeSignedNumber(dlng);
	}
	return encoded_points;
}

function decodeLine (encoded) 
{
  var len = encoded.length;
  var index = 0;
  var array = [];
  var lat = 0;
  var lng = 0;

  while (index < len) {
    var b;
    var shift = 0;
    var result = 0;
    do {
      b = encoded.charCodeAt(index++) - 63;
      result |= (b & 0x1f) << shift;
      shift += 5;
    } while (b >= 0x20);
    var dlat = ((result & 1) ? ~(result >> 1) : (result >> 1));
    lat += dlat;

    shift = 0;
    result = 0;
    do {
      b = encoded.charCodeAt(index++) - 63;
      result |= (b & 0x1f) << shift;
      shift += 5;
    } while (b >= 0x20);
    var dlng = ((result & 1) ? ~(result >> 1) : (result >> 1));
    lng += dlng;

    array.push([lat * 1e-5, lng * 1e-5]);
  }
  return array;
}

function convPolyPointStr(array)
{
	polyPointStr = "";
	cnt=0;
	for(i=0;i<array.length;i++)
	{
		cnt++;
		polyPointStr += "("+array[i][0]+", "+array[i][1]+")";
		if(cnt != array.length)
			polyPointStr +=",";
	}
	return polyPointStr;
}

function searchNbrHood()
{	
	if($F('nbrSerName') == '') {
		alert("Please specify neighborhood name to search.");
		return;
	}
	var qry = 'nbrSerName='+(encodeURI(trim($F('nbrSerName'))));
	var purl = '/info/addNbrhoodInfo.php';
	
	loadToDiv(purl,qry,"listTabDiv",function(resp) {
    	  var xDoc = resp.responseXML ;     	 
          try
           {  
          		if(xDoc.getElementsByTagName('headdiv')[0].firstChild.nodeValue == 1) 
    	       	{ 
					$('headdiv').style.display='none';  
					
    	       	}  
    	       	if(navigator.userAgent.indexOf('MSIE') != -1){
					$('listTabDiv').innerHTML = xDoc.getElementsByTagName('div')[0].firstChild.xml   ; 
						
				}
    	       	else{
    	        	$('listTabDiv').innerHTML = resp.responseText   ; 
				}
    	        	
    	        if ($('paginationDiv')){
					$('paginationDiv').style.display = "none";				
				}
           }
           catch(err)
           {
				$('listTabDiv').innerHTML = resp.responseText ;
	           	if ($('paginationDiv'))
					$('paginationDiv').style.display = "none";	           	
           } 		  
    });    
}