Spade

Mini Shell

Directory:~$ /home/lmsyaran/www/pusher/
Upload File

[Home] [System Details] [Kill Me]
Current File:~$ /home/lmsyaran/www/pusher/com_jea.tar

css/print.css000064400000000000151167223230007172
0ustar00css/jea.css000064400000016613151167223230006616 0ustar00.clr {
	clear: both;
}

.numberbox {
	text-align: right;
	padding-right: 2px;
}

.right {
	text-align: right;
}

/*** Properties Search layout ***/

#jea-search-form label {
	display: inline !important;
}

#jea-search-form input {
	width: auto !important;
}

#jea-search-form .jea-counter {
	float: right;
}

#jea-search-form .jea-counter-result {
	font-weight: bold;
}

#jea-search-form h2, #jea-search-form hr {
	clear: both;
}

#jea-search-form hr {
	margin: 1em 0;
}

#jea-search-form select {
	width: 12em;
}

#jea-search-form dl {
	padding: 0.5em 0;
}

#jea-search-form dl.col-left, #jea-search-form dl.col-right {
	float: left;
}

#jea-search-form dl.col-left {
	margin-right: 3em;
}

#jea-search-form dt, #jea-search-form dd {
	margin: 0;
	padding: 0;
	display: table-cell;
}

#jea-search-form dt {
	min-width: 5em;
}

#jea-search-form ul {
	overflow: hidden;
	margin: 1em 0 !important;
	padding: 0 !important;
}

#jea-search-form ul.jea-search-other li {
	list-style: none;
	margin: 0.5em 0 !important;
	padding: 0 !important;
}

#jea-search-form ul.jea-search-other label {
	display: inline-block;
	min-width: 13em;
}

#jea-search-form .amenities li {
	width: 17em;
	margin: 0 1.5em 0.5em 0 !important;
	padding: 0 !important;
	float: left;
	list-style: none;
}

/* Properties Default layout */

.limitbox {
	text-align: right;
}

dl.jea_item {
	border-top: 1px dashed #ccc;
	padding: 1em 0;
	margin: 0;
}

dl.jea_item:FIRST-CHILD {
	border-top: none;
	padding-top: 0;
}

dl.jea_item dt.title {
	margin-bottom: 0.7em;
}

dl.jea_item dt.title strong {
	font-size: 1.3em;
}

dl.jea_item dt.image {
	text-align: center;
	margin-bottom: 1em;
}

dl.jea_item dt.image img {
	border-color: #819d26;
}

dl.jea_item span.slogan {
	float: right;
}

dl.jea_item span.slogan strong {
	color: red;
}

@media ( min-width : 1200px) {

	dl.jea_item {
		/* formatting context, prevent overshooting of floating */
		overflow: hidden;
	}

	dl.jea_item dt.title {
		clear: both;
	}

	dl.jea_item dt.image {
		float: left;
		margin-right: 1em;
		margin-bottom: 0;
	}
}

/* Property Default layout */
.prev-next-navigation {
	text-align: center;
}

.prev-next-navigation .previous {
	display: inline-block;
	margin-right: 20px;
}

.jea-tools .print-icon {
	float: right;
}

.jea-tools img {
	border: none;
}

#jea-gallery {
	margin-bottom: 10px;
}

#jea-gallery-scroll {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-content: space-between;
}

#jea-gallery-scroll a {
	display: block;
	max-width: 32%;
	margin: auto auto 5px auto;
}

#jea-gallery-preview a {
	display: inline-block;
}

#jea-gallery-preview img {
	max-width: 100%;
	margin-bottom: 5px;
}

#jea-preview-title {
	font-weight: bold;
}

#jea-preview-description {
	font-style: italic;
}

span.rate_frequency {
	font-size: 0.9em;
	font-weight: normal;
}

table.jea-data {
	width: 100%;
}

table.jea-data th, table.jea-data td {
	padding: 0.4em;
}

table.jea-data th {
	text-align: left;
	font-weight: normal;
}

table.jea-data td {
	font-weight: bold;
}

.property-description {
	margin: 2em 0;
}

#advantages_list {
	margin-bottom: 10px;
}

#jea_property_map {
	width: 100%;
	height: 300px;
	margin-bottom: 1.5em;
}

.google-map-mask {
	background: #000 url(../images/spinner.gif) center center no-repeat;
}

form#jea-contact-form legend {
	font-weight: bold;
}

form#jea-contact-form fieldset dt {
	padding: 3px 0;
	margin: 0;
}

form#jea-contact-form fieldset dd {
	padding: 3px 0;
	margin: 0 0 0.3em 0;
}

form#jea-contact-form input[type="text"], form#jea-contact-form
textarea
	{
	width: 100%;
	box-sizing: border-box;
	height: auto;
}

@media ( min-width : 1200px) {

	#jea-gallery.vertical {
		display: flex;
		justify-content: space-between;
	}

	#jea-gallery-preview.vertical {
		flex-basis: 80%;
		margin-right: 5px;
	}

	#jea-gallery-scroll.vertical {
		flex-basis: 20%;
		overflow-y: auto;
	}

	#jea-gallery-scroll.vertical a {
		max-width: 100%;
	}

	#jea-gallery-scroll.horizontal {
		display: block;
		white-space: nowrap;
		overflow-x: auto;
	}

	#jea-gallery-scroll.horizontal a {
		display: inline-block;
	}

	#jea-gallery-scroll.horizontal img {
		max-height: 80px;
		max-width: auto;
	}

	table.jea-data {
		width: auto;
	}

	.jea-col-right {
		float: right;
		margin-left: 2em;
		padding: 2em;
		border-left: 1px dashed #b2b4bf;
	}
}

/*** SqueezeBox layout ***/

#jea-squeezeBox-navblock {
	position: relative;
	bottom: -15px;
	text-align: center;
}

#jea-squeezeBox-infos {
	position: absolute;
	bottom: 15px;
	right: 15px;
	text-align: center;
	background: #000;
	padding: 10px;
	opacity: 0.8;
}

#jea-squeezeBox-title {
	font-weight: bold;
	color: #fff;
	font-size: 13px;
}

#jea-squeezeBox-description {
	color: #ddd;
	font-size: 10px;
}

a#jea-squeezeBox-prev, a#jea-squeezeBox-next {
	color: #fff;
}

#jea-squeezeBox-prev {
	margin-right: 10px;
}

#jea-squeezeBox-next {
	margin-left: 10px;
}

a#jea-squeezeBox-prev.inactive, a#jea-squeezeBox-next.inactive {
	color: #ccc;
	text-decoration: none;
	background: transparent;
	cursor: default;
}

/*format tabular list */

table.jea_listing, table.jea_listing thead, table.jea_listing th,
table.jea_listing tbody,
	table.jea_listing td {
	border: 1px solid #ccc;
}

table.jea_listing {
	border-collapse: collapse;
}

table.jea_listing th, table.jea_listing td {
	padding: 5px;
	text-align: left;
}

table.jea_listing tbody th {
	font-weight: bold;
}

table.jea_listing thead {
	font-weight: bold;
	white-space: nowrap;
	text-align: left;
}

table.jea_listing tbody tr.row1 {
	background: #F9F9F9;
}

table.jea_listing tbody tr:hover {
	background: #FFD;
}

table.jea_listing .right {
	text-align: right;
}

table.jea_listing .center {
	text-align: center;
}

table.jea_listing .nowrap {
	white-space: nowrap;
}

/*** Property form layout ***/

ul#amenities {
	list-style: none !important;
	padding: 0 !important;
	margin: 0 !important;
	overflow: hidden;
}

ul#amenities li {
	width: 200px;
	margin: 0 15px 10px 0 !important;
	padding: 0 !important;
	float: left;
}

ul#amenities li label {
	font-size: 12px;
	line-height: 13px;
}

ul#amenities li input {
	float: none;
	margin: 0 8px 0 0;
}

ul.gallery {
	margin: 10px 0 0 0 !important;
	list-style: none !important;
	padding: 0 !important;
}

ul.gallery li {
	padding: 10px 0 10px 10px !important;
	margin: 0 !important;
	border-top: 1px solid #ccc !important;
}

ul.gallery li:FIRST-CHILD {
	background: #FFFFCC
}

ul.gallery a.imgLink {
	float: left;
	margin: 0 10px 5px 0;
}

ul.gallery a.imgLink img {
	float: none;
	margin: 0;
}

ul.gallery .imgTools a {
	cursor: pointer;
	display: inline-block;
	padding: 0 5px;
}

ul.gallery .imgTools a.delete-img {
	margin-left: 20px;
}

ul.gallery label {
	display: inline-block;
	vertical-align: top;
	width: 10em;
}

#found_properties {
	white-space: nowrap;
}

.slider_background {
	background: url("../images/slider_bg.png") center center
no-repeat;
	height: 20px;
	width: 250px;
}

.knob {
	background: url("../images/knob.png") center center no-repeat;
	height: 20px;
	width: 16px;
	cursor: move;
}

.jea_slider_block {
	float: left;
	width: 250px;
	margin: 10px 10px 10px 0;
}

.jea_slider_block h2 {
	font-size: 12px;
	font-weight: bold;
	margin: 0 !important;
	padding: 0 !important;
	text-align: center;
}

.slider_infos {
	text-align: center !important;
}

.slider_min_value {
	margin-right: 10px;
}

.slider_max_value {
	margin-left: 10px;
}

/* property form */
#adminForm label {
	display: inline-block !important;
	vertical-align: top;
	width: 13em;
}

#adminForm input {
	width: auto !important;
}
css/magnific-popup.css000064400000014606151167223230010775 0ustar00/*
Magnific Popup CSS */
.mfp-bg {
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 1042;
	overflow: hidden;
	position: fixed;
	background: #0b0b0b;
	opacity: 0.8;
}

.mfp-wrap {
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 1043;
	position: fixed;
	outline: none !important;
	-webkit-backface-visibility: hidden;
}

.mfp-container {
	text-align: center;
	position: absolute;
	width: 100%;
	height: 100%;
	left: 0;
	top: 0;
	padding: 0 8px;
	box-sizing: border-box;
}

.mfp-container:before {
	content: '';
	display: inline-block;
	height: 100%;
	vertical-align: middle;
}

.mfp-align-top .mfp-container:before {
	display: none;
}

.mfp-content {
	position: relative;
	display: inline-block;
	vertical-align: middle;
	margin: 0 auto;
	text-align: left;
	z-index: 1045;
}

.mfp-inline-holder .mfp-content, .mfp-ajax-holder .mfp-content {
	width: 100%;
	cursor: auto;
}

.mfp-ajax-cur {
	cursor: progress;
}

.mfp-zoom-out-cur, .mfp-zoom-out-cur .mfp-image-holder .mfp-close {
	cursor: -moz-zoom-out;
	cursor: -webkit-zoom-out;
	cursor: zoom-out;
}

.mfp-zoom {
	cursor: pointer;
	cursor: -webkit-zoom-in;
	cursor: -moz-zoom-in;
	cursor: zoom-in;
}

.mfp-auto-cursor .mfp-content {
	cursor: auto;
}

.mfp-close, .mfp-arrow, .mfp-preloader, .mfp-counter {
	-webkit-user-select: none;
	-moz-user-select: none;
	user-select: none;
}

.mfp-loading.mfp-figure {
	display: none;
}

.mfp-hide {
	display: none !important;
}

.mfp-preloader {
	color: #CCC;
	position: absolute;
	top: 50%;
	width: auto;
	text-align: center;
	margin-top: -0.8em;
	left: 8px;
	right: 8px;
	z-index: 1044;
}

.mfp-preloader a {
	color: #CCC;
}

.mfp-preloader a:hover {
	color: #FFF;
}

.mfp-s-ready .mfp-preloader {
	display: none;
}

.mfp-s-error .mfp-content {
	display: none;
}

button.mfp-close, button.mfp-arrow {
	overflow: visible;
	cursor: pointer;
	background: transparent;
	border: 0;
	-webkit-appearance: none;
	display: block;
	outline: none;
	padding: 0;
	z-index: 1046;
	box-shadow: none;
	touch-action: manipulation;
}

button::-moz-focus-inner {
	padding: 0;
	border: 0;
}

.mfp-close {
	width: 44px;
	height: 44px;
	line-height: 44px;
	position: absolute;
	right: 0;
	top: 0;
	text-decoration: none;
	text-align: center;
	opacity: 0.65;
	padding: 0 0 18px 10px;
	color: #FFF;
	font-style: normal;
	font-size: 28px;
	font-family: Arial, Baskerville, monospace;
}

.mfp-close:hover, .mfp-close:focus {
	opacity: 1;
}

.mfp-close:active {
	top: 1px;
}

.mfp-close-btn-in .mfp-close {
	color: #333;
}

.mfp-image-holder .mfp-close, .mfp-iframe-holder .mfp-close {
	color: #FFF;
	right: -6px;
	text-align: right;
	padding-right: 6px;
	width: 100%;
}

.mfp-counter {
	position: absolute;
	top: 0;
	right: 0;
	color: #CCC;
	font-size: 12px;
	line-height: 18px;
	white-space: nowrap;
}

.mfp-arrow {
	position: absolute;
	opacity: 0.65;
	margin: 0;
	top: 50%;
	margin-top: -55px;
	padding: 0;
	width: 90px;
	height: 110px;
	-webkit-tap-highlight-color: transparent;
}

.mfp-arrow:active {
	margin-top: -54px;
}

.mfp-arrow:hover, .mfp-arrow:focus {
	opacity: 1;
}

.mfp-arrow:before, .mfp-arrow:after {
	content: '';
	display: block;
	width: 0;
	height: 0;
	position: absolute;
	left: 0;
	top: 0;
	margin-top: 35px;
	margin-left: 35px;
	border: medium inset transparent;
}

.mfp-arrow:after {
	border-top-width: 13px;
	border-bottom-width: 13px;
	top: 8px;
}

.mfp-arrow:before {
	border-top-width: 21px;
	border-bottom-width: 21px;
	opacity: 0.7;
}

.mfp-arrow-left {
	left: 0;
}

.mfp-arrow-left:after {
	border-right: 17px solid #FFF;
	margin-left: 31px;
}

.mfp-arrow-left:before {
	margin-left: 25px;
	border-right: 27px solid #3F3F3F;
}

.mfp-arrow-right {
	right: 0;
}

.mfp-arrow-right:after {
	border-left: 17px solid #FFF;
	margin-left: 39px;
}

.mfp-arrow-right:before {
	border-left: 27px solid #3F3F3F;
}

.mfp-iframe-holder {
	padding-top: 40px;
	padding-bottom: 40px;
}

.mfp-iframe-holder .mfp-content {
	line-height: 0;
	width: 100%;
	max-width: 900px;
}

.mfp-iframe-holder .mfp-close {
	top: -40px;
}

.mfp-iframe-scaler {
	width: 100%;
	height: 0;
	overflow: hidden;
	padding-top: 56.25%;
}

.mfp-iframe-scaler iframe {
	position: absolute;
	display: block;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
	background: #000;
}

/* Main image in popup */
img.mfp-img {
	width: auto;
	max-width: 100%;
	height: auto;
	display: block;
	line-height: 0;
	box-sizing: border-box;
	padding: 40px 0 40px;
	margin: 0 auto;
}

/* The shadow behind the image */
.mfp-figure {
	line-height: 0;
}

.mfp-figure:after {
	content: '';
	position: absolute;
	left: 0;
	top: 40px;
	bottom: 40px;
	display: block;
	right: 0;
	width: auto;
	height: auto;
	z-index: -1;
	box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
	background: #444;
}

.mfp-figure small {
	color: #BDBDBD;
	display: block;
	font-size: 12px;
	line-height: 14px;
}

.mfp-figure figure {
	margin: 0;
}

.mfp-bottom-bar {
	margin-top: -36px;
	position: absolute;
	top: 100%;
	left: 0;
	width: 100%;
	cursor: auto;
}

.mfp-title {
	text-align: left;
	line-height: 18px;
	color: #F3F3F3;
	word-wrap: break-word;
	padding-right: 36px;
}

.mfp-image-holder .mfp-content {
	max-width: 100%;
}

.mfp-gallery .mfp-image-holder .mfp-figure {
	cursor: pointer;
}

@media screen and (max-width: 800px) and (orientation: landscape) , screen
	and (max-height: 300px) {
	/**
       * Remove all paddings around the image on small screen
       */
	.mfp-img-mobile .mfp-image-holder {
		padding-left: 0;
		padding-right: 0;
	}
	.mfp-img-mobile img.mfp-img {
		padding: 0;
	}
	.mfp-img-mobile .mfp-figure:after {
		top: 0;
		bottom: 0;
	}
	.mfp-img-mobile .mfp-figure small {
		display: inline;
		margin-left: 5px;
	}
	.mfp-img-mobile .mfp-bottom-bar {
		background: rgba(0, 0, 0, 0.6);
		bottom: 0;
		margin: 0;
		top: auto;
		padding: 3px 5px;
		position: fixed;
		box-sizing: border-box;
	}
	.mfp-img-mobile .mfp-bottom-bar:empty {
		padding: 0;
	}
	.mfp-img-mobile .mfp-counter {
		right: 5px;
		top: 3px;
	}
	.mfp-img-mobile .mfp-close {
		top: 0;
		right: 0;
		width: 35px;
		height: 35px;
		line-height: 35px;
		background: rgba(0, 0, 0, 0.6);
		position: fixed;
		text-align: center;
		padding: 0;
	}
}

@media all and (max-width: 900px) {
	.mfp-arrow {
		-webkit-transform: scale(0.75);
		transform: scale(0.75);
	}
	.mfp-arrow-left {
		-webkit-transform-origin: 0;
		transform-origin: 0;
	}
	.mfp-arrow-right {
		-webkit-transform-origin: 100%;
		transform-origin: 100%;
	}
	.mfp-container {
		padding-left: 6px;
		padding-right: 6px;
	}
}css/jea.admin.css000064400000010225151167223230007676 0ustar00
.icon-jea {
	background-image:url(../images/header/icon-36-jea.png);
	height: 36px !important;
	width: 36px !important;
	line-height: 36px !important;
	vertical-align: middle;
}

.numberbox{
	text-align:right;
	padding-right:2px;
}

/* Used to format price / surface fields */
span.input-suffix {
	display: inline-block;
	margin-left: 5px;
}

span.input-prefix {
	display: inline-block;
	margin-right: 5px;
}

ul.gallery {
	margin-top: 10px;
}

ul.gallery,
ul.gallery li {
	list-style: none outside none;
	margin: 0;
	padding: 10px;
}

ul.gallery li {
	padding: 10px 0 10px 10px;
	border-top: 1px solid #ccc;
}

ul.gallery li:FIRST-CHILD {
	background: #FFFFCC
}

ul.gallery a.imgLink {
	float: left;
	margin: 0 10px 5px 0;
}

ul.gallery a.imgLink img {
	float: none;
	margin: 0;
}

ul.gallery .imgTools a {
	cursor: pointer;
	display: inline-block;
	padding: 0 5px;
}

ul.gallery .imgTools a.delete-img {
	margin-left: 20px;
}

ul.gallery .control-group {
	margin-bottom: 3px !important;
}

ul.gallery .control-group input {
	font-size: 12px !important;
	line-height: 14px !important;
}

#ajaxupdating {
	padding: 5px;
	border-radius: 5px;
	border: 1px solid #DE7A7B;
}

fieldset.adminform label.amenity {
	display:inline-block;
	width:200px;
	margin-right:15px;
	padding: 0;
	clear: none;
	float:left;
	font-size: 12px;
	line-height: 13px;
}

fieldset.adminform label.amenity input {
	float:none;
	margin: 0 10px 0 0;
}

/* property form - amenities */
ul#amenities {
	margin: 0 -17px;
	padding: 5px 5px 0 5px;
	overflow : hidden; /* clearfix */
}
ul#amenities li {
	margin: 0 0 5px 5px;
	border-radius: 5px;
	padding: 2px 5px;
	color: #ffffff;
	background-color: #990000;
	display: inline-block;
}
ul#amenities li label, 
ul#amenities li input {
	float: none; 
}
ul#amenities li.active {
	background-color: #009900;
}
ul#amenities li.active label{
	background: url(../images/checked.png) no-repeat scroll 100% 50%
transparent;
}
ul#amenities li label{
	background: url(../images/unchecked.png) no-repeat scroll 100% 50%
transparent;
	min-width: 75px;
	padding: 0 20px 0 0;
}


.admin .pane-sliders .panel {
	border: 1px solid #CCCCCC;
	margin-bottom: 3px;
}

.pane-sliders .panel h3 {
	background: none repeat scroll 0 0 #FAFAFA;
}

.pane-sliders .title {
	cursor: pointer;
	margin: 0;
	padding: 2px 2px 2px 5px;
}

.pane-toggler-down {
	border-bottom: 1px solid #CCCCCC;
}

/* Tools view */

.cpanel .span12 {
	display: table-cell !important;
	margin-bottom: 10px;
}

.cpanel .span12 a {
	vertical-align: middle;
}

/* Console */

.console {
	background: #000;
	color: #fff;
	font-size: 11px;
	font-family: monospace;
	padding: 5px;
	min-height: 250px;
	margin: 10px 0;
}

.console p {
	margin: 0 0 5px 0;
	border: none !important;
	background: none !important;
	color: #fff !important;
	font-size: 12px !important;
	font-family: monospace !important;
	padding: 0 !important;
}

.console p.error {
	color: red !important;
}

.console p.warning {
	color: orange !important;
}

.console a {
	color: #a2cff6;
}

/* logs */
pre#logs {
	font-size: 11px;
	font-family: "Courier New", Courier, monospace;
	background: #fff;
	padding: 1em;
	border: 1px solid #ccc;
	margin: 1em;
	min-height: 200px;
	max-height: 300px;
	overflow: auto;
}

/* Spinner */
@-ms-keyframes spin {
	from { -ms-transform: rotate(0deg); }
	to { -ms-transform: rotate(360deg); }
}

@-moz-keyframes spin {
	from { -moz-transform: rotate(0deg); }
	to { -moz-transform: rotate(360deg); }
}

@-webkit-keyframes spin {
	from { -webkit-transform: rotate(0deg); }
	to { -webkit-transform: rotate(360deg); }
}

@keyframes spin {
	from { transform:rotate(0deg); }
	to { transform:rotate(360deg); }
}

.jea-icon-spin {
	-moz-animation: spin 2s infinite linear;
	-o-animation: spin 2s infinite linear;
	-webkit-animation: spin 2s infinite linear;
	animation: spin 2s infinite linear;
	display: inline-block;
}

.spinner {
	display: inline-block;
	opacity: 0;
	max-width: 0;
	
	-webkit-transition: opacity 0.25s, max-width 0.45s; 
	-moz-transition: opacity 0.25s, max-width 0.45s;
	-o-transition: opacity 0.25s, max-width 0.45s;
	transition: opacity 0.25s, max-width 0.45s;
}

.has-spinner.active {
	cursor:progress;
}

.has-spinner.active .spinner {
	opacity: 1;
	max-width: 50px;
}


images/import.png000064400000003632151167223230010037 0ustar00�PNG


IHDR 
szz�sRGB���bKGD�������	pHYs���+tIME�
�^C�IDATX�՗k�]U�{�s�����L�C;�mJ[)�"Դ�H�,�`j����	
F5����@
��H���Xж�
�`S��b�C�i�a^����g��{[�ff:��w���k��k��/mϽ�ɷ�T/�voW�6r�>��Y���<��'�Z(�A�#��AQ�$��ɱ����<6)����Gq��}���/��Sl�Z�����3�r{O),���U�u��dɸd���>r,��:��!�t_r�=�^�T����|��L`�݊+����__��ۻ��[Yp�FP
Ăˑ<G$�Ģp(�P���g��ݼ���
]��N�w�+���W�>�k�
bE�
A�$$g@2��Ap��:@�:h��}����L���"�p�،��4V�	�"\�`?&�������l�Y��u�{�6�}���mB��R�!�Gi�H�t�R�<�nAel4��Wf�װq��U�EΝ���>��ၗ	;VV�%,t��x^�B!�#&ä#d�A��w���F��E�\�	]8{��a΂ϲp���L:@���WO��5l:�˪HVG�����*m�t��4GD�7E��f	�8���G��X�I�����IX�M�4�R��bi.��,–VZ����f"�4��$
"
ƀS�45�ֺ���O�+�TQ�4�f�4r�+	E�t="������.$�+x�㒯|��O~�����b�.��g�-�MM������bض�Sz����tYb҅a�9��x��\��6m��Ϟ��X7�JK�L�c�6ӊ:�%��c�2
�4*�㆟
�
�q�NL��lA�ב@�B��Wԋ�4�]u)7���
�jd�(�
yn0�b��1�R�;��g��	�=�B]R
T.Fg���cjϝ�f��4}���+���[�����C�b�����q�~�1�G��i��OL���+CfS2����s�KT���_�MO�Ȏ������q�(.ǥQ��&���@�E�5�)C�����NI�ӊ՟_�O���G6n
UJ���O�BaEMC�D(�Q�q�KHl�����N*5O+����W��e�?�!�LZ�r����_���T���$i��I����F^���:Tc�ߖ�o���]���F�:
(����S-Ө���ʐ	
�f��X��F�2@�=g6UI�&�2�߱�T?؅���Kq8'X��rM.����K�XAl:5�p�mdeךÅ�\�TЧЋ�_\��������w�8&*eD�Q+d����M2vW�H/,��В��j/f�2��S����
IJa�q_���m:��Z��9��u�Q����:�2Om{�d�e\)��c�ql<��
�W�U�qi�3���X4w�m��T�Β�sNi�,��}�����{�$�y�.�"��M�ҋ�p�.O�2t��W����#���Z�?�{<U��x�a�7��M�㙃�|���SlB�S�ۑr��	���›�R�N�C+fڼ����-�G�S�"ĥ�,b�G�<E��Ǎk���]Ҷ�Z^z���T�y8aL
�	�	�'^ȟ_�����s�Be.~؊�gڷ\c�W�/w㷭

��}������;�uޢ���T���q�E��tM�/��mU��/�>�n������>D<����=����{�{e�g^築0D��$@6S��Ҽ�@��.֯]��Y��
�;:�/�}��4�vM��ˌ�&��y�E�I;���f�f���ͦV����I���Lϔ�L���N�_&�4O���IEND�B`�images/logo.png000064400000006315151167223230007466
0ustar00�PNG


IHDRxx9d6�bKGD�������	pHYs1212e�2tIME�3�X�oZIDATx��{���?׻
 D�PQ4A1��F��ʲ��>��"R��@�1>Vr�X%-�a!�"/��9ϊ��r�H)�F���ӗ?��Z���Q�8f�o�V�gv>ݿ�u�o@KKKKKK�9T�Xe�v�_H��;ZVR�o{0w�H6�,ZVR�o������
ܩo{x���SC��7�6U�˖,E�n�f��	���H�Q5�K`H�,ݮ��瀷WT��f�Y�?���fD��bY��通�B��@o\+��Ȉ�0�'����I���0@+�ŌHtј�	�#0?#�4�p8�����N���5���	C#/`��2"������|F$N���	�P`AF$��	�xU�[h���xB#/`�Q��Qc/`�3"1@�/`LˈDw�3����;j��p0'#�4�p�LΈD�FN����0�،H襹!\LɈ�ipx�����5��>�Հë_�eDBh���@Z�nΈ�H
8ܚ���^��[(�U�:����pxu"0�@X�s��<��[WeD�0���~p
3����nF$Z�ҝp�X�.�N��x�
�^�RM���״��"�N�ЀW�k�0�
�v����
�]�v�H:�(?z'��zS\�.Ҁë!�]p��rM{�^�]���W��]���W���i6�O4׸ض�W��O���}A$�t5���uѲ���|
���hm�ë\ӾR�sM��^E�Y�i��S�}�i�z�4�����+�k�-5���N�y�5�)�NJ`�䗻�}�<ȕ�xO�)��]ӾP�@
{�`���C�$�?(�湦}�<�s�G��\��K���>��
x�5m�O��n0p��Z\���6״�k����	l�)״O׀��`P]
�A�l״ܜ��	���T��8^F�J��3��i7t��H:�i$�,sM�j���&&�#��
8�����sw6�=�U�*]��I'ߍ���\���)��π�i���Ym��o�Qc�������n���#�V���$��qM�Op0��,"�d^��>�{�5�s5�`�B���D��/�f�
-э�pM��p04�5�
�p
OL�zևk���D״�
�l�v���-�
=L��}�o���;�]��I���ۑtrG$��V]�(p̯�]#"�d́x�>���P$�������Y
�p`9p�6�R$�܉�����w��=X�r�������!�����@!e`N��L��?�]2
8x����t��L��|���!Ӏ�U�]`��P�!Ӏ��[����}$��v
8x�W)3\(\bK��]5��A^�(��,pM�P
8x�g�/db7��-4����9��Ӏ�W�k�Q@�Gr�5�4��A�.>��|�k��pb,ߋ�V����f���>Z;�����oލ9|PjK�:���>tM{���!.��|�=#��W�pS�ꗍ���^-+YI'�v�P����S_e�	�nM��>��m�x��hYɒH:��Z�Sh����5��1������Ԡ�[m�y�x���<x��q��&�de㩓��vI�W�j�{�`N6�j��0
>�q�]�i_�$���TQ6�:x��i�VW��E�g^��d㩢H:�U����1z�R߮�h�k��|�����q�ʂ1��fY��୴�+�N~�E��h��^�T��g$�\Y_'�r�{�M�%�FslPwf��Ѳ�i�t2�xq4�|���t5-��,*�mcú�ӝ4ÂVrR6������إ�r�D}�T�s'�_}��իu���y?�X3ͫ�jc����}�[g'O���D��b%[6o�uҕTWWS��;=���bY:U�kz�UUUl�mS�3,l��-�|`Hgu�t�୘��g�tʛ�F["���!g_n�٤g�e�&���<�5n�}��8K��iX����M�BK�Nl�܄�
��Y��n�0ѐΫ��u��}0�!�RK�n�{��
`��o�ؐ�}9��
\�7��!�iu��!��\C?`$^x����j�d��Ճ�^
G^��M�-�i���=�t�s�.R�o^ȇ;���6�,3���oޤ�X���T�À�!�喈����V�;
�LW��K�t�����㓏�m��|c�&0��e�+y���s^	�\���n��w������40x�N]�4u�6��m/���9�J
�TNQ���9�[@�[��w���-S��p
����|�M�t&���2U+X��߫��S���
o�aW�A�Q������
��x��m�v2>�h
��2�S�k�GoPS���~���=PdH�=C:�����t��٠.��A�3�Q΀9�t�K��V��'�I��9�U
\��zX�]�ex�6��P�g��UM��\�/0o�n31o�sU����
�lV�tg���D�fu^�E�t>V5�u�Y�t��Ԑ�kx��U��jH�f7-+ٙ���?j$��
�Z,K��J����X�W&�]���殩�=x�m	C:,��句t�ϲD��2��s�(��鬰D�ޜ�V;ެP��<�PLŋ����UN�9��3�3>���x+��	ʢ����G�Jʳ��@ו�ֹ�~��,U��bY�iC��n��"K�ƫ�[oe�αDl�jsO��z�������Ǟ�QK�r������6o���WZ"v���Q��m�H�>��!��Dl��a�
�X*��Zh��E��LWmg���3�W-�@w'�*������mT��rC:O["V	,1����NV��d���~]sJ���Z,K��gM�J��C��
�TZ"6R�Ķ�����G�C���P7h�s~0p�j�g�B����e�j�N��Y�`�V5b2�^�r�7�bHg�%b��V�tZ"�!p�*����#'�!��%b�T�驜G�)�D�Le�f�Z�\}��7����>@B}�f�%{��KL�d�X��9�U�a�!�{��O��Ԁ��-��ڜc��o^Q�Y��wVKKK+�?"J�yF_@IEND�B`�images/header/icon-48-import.png000064400000006360151167223230012447
0ustar00�PNG


IHDR00W��	pHYs���+�IDATh��{�]�}�?3s�s��޵��c���y���A[)("D*R$�7̓�'4�m�V�E�R�MQB	)�"`�&��ڒ�R
m�����e��z���<g��q�^_;�TE�fϜ{Ϟ�~f~�߬~�S�-�ݦ�x�/{����z�1yL&��ɂR����m"��ؤ..��ߩ�k�U�:���{U�oP�$Y&>�:iT��sA\a�6%@+E@�:��g2W��&�V�XzC��k�\�`�2���9	��_^��$^g�?1��rIy����g�r��K���]@&ۃ��
��E��6+ĵq��q�S�P�a��n��r��b�����s����3~f/=��8ut��H���t��;x	J�_DA
�u?�IZ�P*��aFwl��)XϦ��nڸ��3��ڴh��^}���ۢ�z�4�G$��B\K�Gĵ��ϣA�΀Σt�x��������
=w�O���Ĝ��gZ�NH�/�KO�w���K@�X� �ׂ�
�:�F�Πte�(��95�sq���zt������t���$||�ogZrFx��rK�x�AH�JDR�CʹEGJo�k����.4s�9��
��_}����g�j@f��%0��n�-J��S
0�U��{U˄TtT���팼�
T�b�=AyT�"�x?=��`�E�з�*�)
J�v���W*@4J��H�F�~��*�R�Y���0���T�2��v��S���2�V�O.�����M�����+.
W
ʖ0�"�dR�h@!��q��kN��lj��8>Lml��G���h`!��!̭��
'�P+E�|ʗ�{W��$��:��S����5��Q3^�'��	6�h�x"	hq䃣�7����J���`N�Fê�r�P��d܌��J���\\B	�4�N�k���D��֐�J�5BRG\������W��8>��l�Fg�̻�^|���v�w�e^�����G�kU�1ʠ29�x$��0�6I�׻p!����Ҩ�|^�<��C|���y���f
{�x*���;�x���F���.�vC4���N�}e�Aq��9j��棿ƦO���
|� �B)D��]l?�=���$�EEe�6ZGQ.���.��
�C/��2��(�'�t�]r�j���#���g����
B�(g�8?�F��*u��dzW/�@nA��(�<��U����y
KnDkP�2^ҵ��k�✰��{��\X�u\T|N�C�t�r�Ț.���W��Ë2Qn"˽���C���]�0��yb�Ծ����DD��h@���ux���w���-�=�����
!�l����k(
,�;��;�PAP���2��q���B��wu��tn7(�t��v"m9`����>����{��ԓ|��ʖ9�.��$`c�m:�.��?H����dV��7�cʨH��
Ay��b��\�񶁋?�ˮ�f�Y�����&r�B�'�M�
BҀ�R��(����G�r�x��\���&�n�퉐�E�t�RA��x����bC��	N����]����_�̓���p����1�1�HR!4��1܉]��a�ƈ���1�
�>!���o%�q�`qbq!��Gwk�]M�~�'�O�U2�1|��z_?��S��Ĝ�'Q|��@�b��fz
��+b�.�!�.�\s?�;��ӿ�c�M�L��s�R��Z�n.���D�����+1��X	](@M�@��o!*"����<�K���2���$ؐ`C�wM�.�7�};1�m��<���C�4f��R�[�>V��z�Á�6m���HB�D7�����
v��*���B9��L�
�I$$��3j�{J�A�T��T^�`Q�����8��[��,Z)
�p`�!&v5ټqe�L�$����,v�<4�{�%��
2�z
*C/����H$^2�HFE�Ȑ��!
�$�vEym�9��>���>C�w��݄d�ֲ3��
$
�ɖ(/��|�Rl�P�zv���A"�������9'��m�qӉmRs��%�?�o��O@�&bx�(���Խ[�WGI*o�����;\���6-2d��(/$29����~H.��@���[~�c�7^|[}a�����s��/}��|/!>����n&�3��jÁ��ڸ�9JmrI��9EH�
|�2�B�l��7ʡ��1le���O�'ӷ���t�F��d��w�:�2�I�ԨFG�(k@E��w�{��K�X��M�Bf�4CBN������[>��R4E����-Q�_����b��	I�`+�x��<N��׏
�4!i"�T'2�9	�b����)���L�r�[5�kHhp�9��moa���g�����k�d��T��	��ζ�NHjHR?eO�w?�HgH���big8-���~�Ԃ~���F��2�{�:����Aqj1_��k�|sqS����sKJC��G�Ycb���q���t�LOb������w_��Z$��c����O�95JH#�����ަ;��se2�.�����>^��Q�x9�zV��0[^�]��G�.��B!�������
���"�	����>r��E��t���'R
�@j�Pa��o�\񡿹�LO��o�(�(iE��:��
&��U�#ۿ��_Ϋ��l�
�yP)��,a��U�v�+��o�O׽���kn���#����(�o\��dn]m#�ަg:��/"*������o&_}���}���:��|TKx�#gK���6�r-���
,[{3ٞrjF.-����X��fqI��C�T��$���k��c+;��m�-k�z�p���}
3��R�t��Z9dV�q�MW��_Z͍�C=������E��]@�o!�l/�D�=.��4NW'�N�2}�-���;�k����?���n[�͔E�n�s�Ш�k&�Ӯ�]\`�+���!.^\f�,�"����sL�M1vh��7�g�ۆ���:��s�e'�x��Z�4��O�7Ў�w��QN;��������,-N-��z&��ڙ;��\;Υ�6�\�~^���.�t�p&�N�ݴ�����:/���Ǯ�y�w��ʝmN?�W7IEND�B`�images/header/icon-36-jea.png000064400000002631151167223230011666
0ustar00�PNG


IHDR$$���bKGD�������	pHYs��tIME�49�N�&IDATX�͘[le�����t�n/[D
�[%JH��x� 1�1H��E�!bP41<YŐh�$ "�
�F
�PJ�r�.-lK�-[������]�Vl��/��3g7�������*Y
lJ�Z�8`;(��0�5JDB�a�x���X���
k7�P�BbO5~A��H���mű�C
T���ĶӴ�6�4C*���;hܺ{�S���P�PJu��{kW*v�9��"���讃#��HZ�9ɋWF@�\��@����q�,g�ۈ�@�+����/��=2��T��n"r�p.��
�uwF�躽�J�Њ�P={�r�a�v���;k���\�>z�,	�z`��j��!�-��3��1wT��AoUD����Ȯj�.#�Q�,ED$��yH�6$-p�q	��qܽ�@Sgہ��;ڦ\�D\(���A�"����ˇ��Q�L�HK���{�,���0qjʘ!.{��^c٨��@��n;�\�
s�H�{�ן�"WF��g��m�t-��Q�8�l�[�)dg%ҙ">��^��L/�)��s���a�L���]E�s!H)��wd��5Q�����	v<�
��Q8\��)Ԓ9(M$�D��q�bz�}0�[FC��S�fr�����᳃+��oí����ƣ��/G�}��8r�"m�/ǡ�5>88��Dg��ݨ��ԭJ����$���HCt���}�$�Z���@,�|�'��>@*����]�Z<�Y�:����v��UM}�.�L�o£�P��A��?Ԝ{Q�f�2��G��oS;�־�W>u��w��:h��7T?��x�ͧQK�"����Z��G�iA}��t�#��S�eYٿ����ڦO�����|Ԅ᯳Ȅ��I��I���d"ٓ;M}(���fz�g�-{t
��;|�N�Byt+�n؝��@�H<��(p,�o"V��MU�і�E�rQĒ`ٮdm�V��/t�
���8h�Ƹ
���a��z{��#�Ԋ�6���3&q��5���v������w����"��4��GS�~�������@cO��Rs��
>�Ơ0)
��z�<�0���3v�r��k4U����2fI!���;��NY�﹋Ds+�C'�-�,
r�"¥��
�q������w�T4F*z���s����<��P"J�֗�O�2����L4�+EG}#v�m�9��A
�҆��J�]h�W�OGC������a����+�|�4F���(�`�h�#��m
�O�����7�q�6{qPꖸ�Ϯ��'ˬ�>IEND�B`�images/header/icon-48-jea.png000064400000003536151167223230011676
0ustar00�PNG


IHDR00W��bKGD�������	pHYs��tIME�6
j�L��IDATh�ՙm�UG�Ϝs��A�1Z���%`��/l�n/�6���c�j�����h�i1�����mmY���!�
*њ�1]��[��i�
��JK�v�W��3�9�pYv�rw�Nrs2Ϝ�3��?�癙�(qK+�"�5�-�.���p���qK+ᖵ
�p�����0���������bb`$�����5A�ݸ�K~;��{h~	���/Z(J/F�ڹf��~�ov�)�,Ĝ�TDNK���E��?���?
�U�d/kv�$L���w��E��v�Јa�3����f�qe�Ta�ϻ�U�q�@T��@<T4ٯ��+�*���0��E�]2^�6U+��t��^>
�������Mv�X�0c�87�=V
�@Z�_.���&t/t����#�[���w5��
�k�O�V�+0)��g��`�A˜�2hwŒ�G���X�d�'����
��eM���w����X���
���q�.�OC������}ϹZ9tt���|�8D>j��A!W5&�_��!�jE}�
(�hb\�"�D@o�b(�	L<Dt���Gw���h���=1T�m��R�/�l�5`�؅�R5�@�(����Q���/ԕ�2W���J����G����o��Og��n���	d�Bnp0�m�l>z���B5Od�~7(�~���X�o�9_7�F����<�!�k�:gĜ^�:�j���<��n�;���B��F�H5n%���N�vQ�i�T��Hb�|���V�=��l>��|�Xj`d8����_M��5e�`�Ѳ���o���G����H�=�ǀo{&���/�����A!w`<40xatM��O`AP��C����&Wz+�B��pz�L\���!&�6H5-~l�����gg�����:���<4��'��[�ŝD�U6}��D��0r�=�v�T|�棥C헪����e8�
����x�����U��˲�6]Y�J�(�7R����Udb�:�ot2k�W@�%v�:)ni�
[v�#���y���6	��l>Zr�Id@�O��6���y�h����{��=g�S���ລ��s��h������|�/&LH��*>y��T�y�T*��|�(���p����C��qR���UYT���ʠ��PU���>1�������9�=��'�b&��|��UQ@�XR'�
�@�_U�D�n�,�y�6�=�_��|�1#�����t���QԮ�.1b�3�y�ĺd�-�"���b��}b��~	g�rh�5�}�
3�v������%�jQ&5�����
p�<�w�0-&p�8
}�I>�t���{���:����+�
�s�����ִ����2��gs�#�EO
Ld���]��s�qY�JUw��#r�Sݬ��@�m��6�y_'=;��������|���b�E����OhGq:3��v�C�dj�-��@_ߦW^�Cow�P;
�����>���4��e�~������}�x�녿�����@��x
����O�����
��9���8|x�@��Ԕ�&��T�k��4e�k��/�?�g�KS}��,�y�ǁ���_�z�8����,���t�璅�����w��h��4��P4Y�];m�ɤ&�t;�6�Tl���6���v�bOW������3qij$@�j���=�.q��R1�	/��M�K�o*{IEND�B`�images/unchecked.png000064400000000514151167223230010452
0ustar00�PNG


IHDR�*��bKGD�������IDAT(���=
�@�o]0.�c�&���"�G���s!D$�Y�m���)���amۦi��B�$I�y�|>��U)E�B)%���س�}�;��D�>��w!�����,3��u�EQ�m[�u�7�0���DD��trR)%^.�������e���Io��1���NӄA���Zk\�%MS'e���r�g'�QJ�t��aY����6c�1~
Yk�1�sOk�4��
�p���(�u�Z���s"��
����O	QIEND�B`�images/checked.png000064400000001013151167223230010102
0ustar00�PNG


IHDR�*��bKGD��������IDAT(�U��β@���]�)�������{�"��l41$hDE@��=�$o�M1�$�L2��n�(*��16���w]���(
��,�*�²�
�1f�ߗe�$	9���>��m�qLD�Zx����v���$I��۶��:����">��t:�~���%I�=cL0���]�1��|4I)l�VJ�}_�5cO���8a��|~8&�I�4�ei�]�E��x��D��)�yΪ�Z�VM�
�1f@{�7�L��|*��<O�T�}�e"������W��1~��|>��n�q۶}�o������K)�1��J)�����(���s��4M۶�D�[E��{�\�����,�
�eY�UUI)9���_h���B�X,���}cm�~�_PJI)��WJi�9�BJ��l�����u6��m�z��眈���GM��@~IEND�B`�images/slider_bg.png000064400000000470151167223230010454
0ustar00�PNG


IHDR�~�asRGB���bKGD�C�	pHYs
�
�B(�xtIME�	�q��IDATX�c�vm�5˗����wп�XF�(�011�aaa]��P��\ZF����Jn4hF�(~��c��>����߿!�Vr�.��xTnTnTn��Y�[���7�������I�h�7
F������T��RIE���υ{4XF�(~`�=_�ݹ���ڵ}��-\�����gt�n������p~�2���IEND�B`�images/sort_desc.png000064400000000236151167223230010507
0ustar00�PNG


IHDR�%sRGB���PLTE�g��tRNS@��fbKGD�H	pHYs��IDAT�c`�y>���*7�IEND�B`�images/unpublished.png000064400000001376151167223230011052
0ustar00�PNG


IHDR�asRGB���bKGD�������	pHYs��tIME�	2%��<m~IDAT8�M��n�@��ױ��i���k�B��T�p�����ĕ'(���BpD��H$�4M�&�{m/�lP�]i5�;;�	�P@���ΎȁH
�@���
D�x�a�8΀Ċ������V�qy��}�hl
B9w�߿���{-c���
i13�2~U��˭��0�ܤ����y��q�C�۷����7���ko_����������W�_��Z_��`��/���zY��Ƽ����80f
d��������Nx�Y�N��9J�8T�z�z��v�em�칀�u��Uji�JS����A��p�jQ(E�^��9��Q�2�R�����,�,�Q"�i��yֺ��<K+I�p(
�����$�DZ��L�vγ�<�1i:#������i�c���b��L���,����G��	f4œ�R���3I�����Ю���n��p|�him-d8d��ܢ�!��8�Ѩw7��l�2��z�C���������Z.�U��T��6�D�&����M��10b�l��������7D�uG���[Q��*�.0\���0լЊ��}`f=�-΁\���q�y',��l�IYh�K�[�0=�-W
IEND�B`�images/knob.png000064400000001314151167223230007451
0ustar00�PNG


IHDR�b�wsRGB���bKGD�������	pHYs��tIME�	g�rLIDAT8˥T�NTA=�U�aa4&(uc|�$b�1n|ĕ1�/�7lLoL\��\�
FA
y�//AЌC&ܹ}�N���"	�t��T��>�UM]]]N)
Bɨ�U 5qk�(EaG{kB��@ă��ك�6V�6��=*�L
��T�I;4��������Km(.�da�x`%���98!�\��`"��%��fmFQܐ�+��@D��"ܹy�B(�!B:����|��03��U򕀙�'�(E��9�9�
���
��%��Ɔ�6k�o���O5?�c�
E
RP��~��]�,..g�1o�@:�U~����`�P���b(%`V��wX^Y�CO�㩋�[ZO�8F�I���l<4<�����S���dj)��f�V����h���r*k���ν�����9�w}�Y��S��_Q�Ə���ө���_��F���_��>�)&�uhm|e�_]������I�m~a.4����Z�Z댵q�t�_J�-�>>��}�L��D�Z�\��✫9jwww������ρ�1c��Sk�Y=wW�"I}���D7�w.�_�i�YIEND�B`�images/export.png000064400000007735151167223230010056
0ustar00�PNG


IHDR  szz�	pHYs��
OiCCPPhotoshop ICC profilexڝSgTS�=���BK���KoR
RB���&*!	J�!��Q�EEȠ�����Q,�
��!��������{�kּ�����>�����H3Q5��B������.@�
$p�d!s�#�~<<+"��x��M��0���B�\���t�8K�@z�B�@F���&S�`�cb�P-`'������{[�!��
e�Dh;��V�EX0fK�9�-0IWfH�����0Q��){`�##x��F�W<�+��*x��<�$9E�[-qWW.(�I+6aa�@.�y�2�4�������x����6��_-��"bb��ϫp@�t~�,/��;�m��%�h^�u��f�@����W�p�~<<E���������J�B[a�W}�g�_�W�l�~<�����$�2]�G�����L�ϒ	�b��G�����"�Ib�X*�Qq�D���2�"�B�)�%�d��,�>�5�j>{�-�]c�K'Xt���o��(�h���w��?�G�%�fI�q^D$.Tʳ?�D��*�A�,����`6�B$��BB
d�r`)��B(�Ͱ*`/�@4�Qh��p.�U�=p�a��(��	A�a!ڈb�X#����!�H�$
ɈQ"K�5H1R�T
UH�=r9�\F��;�2����G1���Q=��C��7�F��dt1�����r�=�6��Ыhڏ>C�0��3�l0.��B�8,	�c˱"����V����cϱw�E�	6wB
aAHXLXN�H�
$4�	7	�Q�'"��K�&���b21�XH,#��/{�C�7$�C2'��I��T��F�nR#�,��4H#���dk�9�,
+ȅ����3��!�[
�b@q��S�(R�jJ��4�e�2AU��Rݨ�T5�ZB���R�Q��4u�9̓IK�����hh�i��t�ݕN��W���G���w
��Ljg(�gw��L�Ӌ�T071���oUX*�*|��
�J�&�*/T����ުU�U�T��^S}�FU3S�	Ԗ�U��P�SSg�;���g�oT?�~Y��Y�L�OC�Q��_��
c�x,!k
��u�5�&���|v*�����=���9C3J3W�R�f?�q��tN	�(���~���)�)�4L�1e\k����X�H�Q�G�6����E�Y��A�J'\'Gg����S�Sݧ
�M=:��.�k���Dw�n��^��Lo��y��}/�T�m���GX�$��<�5qo</���QC]�@C�a�a�ᄑ��<��F�F�i�\�$�m�mƣ&&!&KM�M�RM��)�;L;L���͢�֙5�=1�2��כ߷`ZxZ,����eI��Z�Yn�Z9Y�XUZ]�F���%ֻ�����N�N���gð�ɶ�����ۮ�m�}agbg�Ů��}�}��=
���Z~s�r:V:ޚΜ�?}���/gX���3��)�i�S��Ggg�s�󈋉K��.�>.���Ƚ�Jt�q]�z�������ۯ�6�i�ܟ�4�)�Y3s���C�Q��?��0k߬~OCO�g��#/c/�W�װ��w��a�>�>r��>�<7�2�Y_�7��ȷ�O�o�_��C#�d�z����%g��A�[��z|!��?:�e����A���AA�����!h�쐭!��Α�i�P~���a�a��~'���W�?�p�X�1�5w��Cs�D�D�Dޛg1O9�-J5*>�.j<�7�4�?�.fY��X�XIlK9.*�6nl�������{�/�]py�����.,:�@L�N8��A*��%�w%�
y��g"/�6ш�C\*N�H*Mz�쑼5y$�3�,幄'���L
Lݛ:��v
m2=:�1����qB�!M��g�g�fvˬe����n��/��k���Y-
�B��TZ(�*�geWf�͉�9���+��̳�ې7����ᒶ��KW-X潬j9�<qy�
�+�V�<���*m�O��W��~�&zMk�^�ʂ��k�U
�}����]OX/Yߵa���>������(�x��oʿ�ܔ���Ĺd�f�f���-�[����n
�ڴ
�V��E�/��(ۻ��C���<��e����;?T�T�T�T6��ݵa�n��{��4���[���>ɾ�UUM�f�e�I���?�����m]�Nmq����#�׹���=TR��+�G�����w-
6
U����#pDy��	�
:�v�{���vg/jB��F�S��[b[�O�>����z�G��4<YyJ�T�i��ӓg�ό���}~.��`ۢ�{�c��jo�t��E���;�;�\�t���W�W��:_m�t�<���Oǻ�����\k��z��{f���7���y���՞9=ݽ�zo�����~r'��˻�w'O�_�@�A�C݇�?[�����j�w����G�������C���ˆ
��8>99�?r��C�d�&����ˮ/~�����јѡ�򗓿m|�����������x31^�V��w�w��O�|
(�h���S�������c3-�
cHRMz%������u0�`:�o�_�FIDATx��]�UU���}Ϲg���*��8V���
�B>($�%(�CXQQ>܇Đ!���!��E���K!��
����1�dF��ǽ��z83w�|;)�҆�a�}�^��������p������Ny���`��PD0�ħs�#���N[[��DdOkk+Z�y���������u�֮���^��y�@Dp��1f�EaR,inn&�L�o��9c6�]3E�{�g(G�(��N�N*
�d��p�q<�c�ʕtuu�����Ϸ�k-"?�X�����u���0��244��444E��G�����x�	G��jߌ��
a����W�\�u]����d2�(M�^�(/�-s�§dj�!�b�#[P���8:���`a>O����[	��ק����Ë�{��g~�տ�˟�c��X{�
F,�X���ic�� ٚ,��55Y� 
�Nc�gp���R�Տ+֬���R��؏�X*��A,VbB
"��1Õ,��'/
�J�:�om޲~���&��45���1<�_���,�Hz��M�j=�]�b�Qa��P�&ؐ�t�>����[�^U����
Fʆ��o:�R��R2���^�l'%ͤ�24�	�O�1��u`��Zں�%���	�I$#�0�	�L��r�`)B�'�lB2`Bb��
�AU	�-��y`ɰ�o{������(�!��\�B��NJ�P�bNJ�
�NZ�Y��V	��qHhM�O�pP�D�4�]A��b"Kɔ�2�2�3�\��௔ʝ)t�����kS}���h��qT|Z��B�	�	���1�f�ڍeд�Ώ���_y)�r_�bo�ȥ�H���ȥS4P�i`A�@�����%Ԧ�p�q���S��,�H{qCr�ήұ�}�_��|�m�P���S|y�%�גI��9�~���#�eI%�G�s��990
�K���8xa�G�>�B!���s^B�Z�1Փ�#��'��߬�t^%��
�T��@5�g��^<ȁ�_Yո~Ə�3n@|�PlZ�B�;�y�Rj�~S��U��!UPs��B����ɲq��)9��980��;Tˊd2<ϻ+w�r����|>�fV����X{�����������D5�`J)U(TOO�{�ڵD6��"�a���NE��=�SƘ�;]��c�(�l*��aZ���0��ԩS6�"���iR(*���n��۫�/_����*kuuu�t�R�����L����:ǂi�_IEND�B`�images/published.png000064400000001374151167223230010505
0ustar00�PNG


IHDR�asRGB���bKGD�������	pHYs��tIME�	26���|IDAT8�M��NQ��N��t`b���Th�B7�W��gP�A��ĭO���n\�,TL:�k�RJ�Ο���{����w�{�9Gp
��<{V�_9`�Ȁ����]����B��
 �����Ȃ����9`^��j�+z�,�/B'l)�r����g���o��e�S\`h�}��>j�X�h���DA�(�bx�q������Ç����O�����!}�k�k���l5Z���Y�V(��$<!2ė|>X<x#���퇅�����Fm��8��J+p
ws�
�_�i����,�j��z^�����C=�!q��=��Q�z����/�z�k�^�ц��Q1�[v0b((p�����Z��3��Q1A���$��hT�@����&%����MSD�r��$-S���]�ӱ��+�r�w�ߗ��ާa�@�y5��O.
C3D�h�$$q���*֞�d3���_/K������-�k��Oxҋ{g�f�m�d>X2>�M~���ϣ2���jZe�n��:$�H�$gG�G��l�c�)�J9D�X]�]x[/�/=�R1��Iv��v���޴����[��˵�3��;
�I���&��5��L��u�潶��-
���IEND�B`�images/spinner.gif000064400000003041151167223230010156
0ustar00GIF89a�?


%%%666DDDLLLTTT[[[dddlllttt{{{������������������������������������������������������������������������������������������������������������������������������������������������������������!�NETSCAPE2.0!�?,�����n
��RC�~o�Y-1����J��eF�$�v1_oa��SFr��29?,	8:BS".J#EJ')C-W7"#
,W6C.&>K,�C9!;K
6?>$�'75-8)�+b1)#/(?5)�?:>!?!4W1/?
>8�K>�?$�:IBA!�?,
X��p��$zD�+��!=�3�����~/�T))@B�X�r
��C	Ȅ����	w6D(>IB$0�B1�D3,�?:%�A!�?,Q��pXi�B��c~6CY[@~�g#�l���A������PT:ȆE�~'�F�D2:C<7
>B.%HMC"3�1WBA!�?,
O����L�H�,�M?ܢ��U2?
4B0%Y���*@~7�j��P�/D�~���<I�G��.
�j�?HA!�?,Z�����	���T��
�#���6��%����%,�V$G��0 =ݣ�
����][

w-w"{?>JH).{?(<{�?A!�?,P��o�Y	�_);^d��O�X�ʱ8"��$�
g�r�)�12��D��b8
?*=B1f.�f6^A!�?,

O��p��ňB,C�w�ȅ���FU!�2�d�2��1A�H�ߢ�x�$-������

@~-X=?	?(D�0D
	=?NCA!�?,
V��pH̸��S
ɼ�>�SH�T.��YB8dDA��6����
)h��B�	d���+�h	?	?,C"+?=2"C=a�<?:DA!�?,Q��p��
�X��?��XS�'��HL!��
6Ԥ�Ӱ~�_�H)@�Z�J �?
0P'??
>5qG>7BOGA!�?,
N��0�	�BE�p
!�C�zZS+�䞞_�`�����~�ꩠ�8V�H�(?4G.M??6zG_?HA!�?,
U����3��ȟ�!B�_��vѣ��u
�SV1 FY�꓾M
ݘ�]>�Z�X*�X
"/I8??PG/)??8i$>?A!�?,S����W��W���O�\~AWP�~(�9�Fñ6�j�s�|�G��
!
5!'7?&*?0)#C:?!C1/?
A;images/sort_asc.png000064400000000237151167223230010340 0ustar00�PNG


IHDR�%sRGB���PLTE�g��tRNS@��fbKGD�H	pHYs��IDAT�c`>y�
���TIEND�B`�images/media_trash.png000064400000000306151167223230011000
0ustar00�PNG


IHDRer�sRGB���bKGD�C�	pHYs��tIME�7,+0��FIDAT8�c`�
0���?9zI4�,sX�r��022�0k�7�41e�G��d�Y�HFN�����T��IEND�B`�js/biSlider.js000064400000012406151167223230007260
0ustar00/*
Based on Mootools 1.1 Slider.js
Author : Sylvain Philip

License:
	MIT-style license.
*/

/*
Class: BiSlider
	Creates a slider with tree elements: two knobs and a container. Returns
the values.

Note:
	The Slider requires an XHTML doctype.

Arguments:
	element - the knobs container
	knobMin - the min handle
	knobMax - the max handle
	options - see Options below

Options:
	steps - the number of steps for your slider.
	mode - either 'horizontal' or 'vertical'. defaults to
horizontal.
	offset - relative offset for knob position. default to 0.

Events:
	onChange - a function to fire when the value changes.
	onComplete - a function to fire when you're done dragging.
	onTick - optionally, you can alter the onTick behavior, for example
displaying an effect of the knob moving to the desired position.
		Passes as parameter the new position.
*/

var BiSlider = new Class({
	
	Implements: [Events, Options],
	
	Binds: ['clickedElement', 'draggedKnob',
'scrolledElement'],

	options: {
		onChange: Class.empty,
		onComplete: Class.empty,
		onTick: function(pos){
			this.knobMin.setStyle(this.p, pos);
		},
		mode: 'horizontal',
		steps: 100,
		offset: 0
	},

	initialize: function(el, knobMin, knobMax, options){
		this.element = document.id(el);
		this.element.setStyle('position', 'relative');
		this.knobMin = document.id(knobMin);
		this.knobMax = document.id(knobMax);
		this.setOptions(options);
		this.previousChange = -1;
		this.previousEnd = -1;
		this.step = -1;
		// this.element.addEvent('mousedown',
this.clickedElement.bindWithEvent(this));
		var mod, offset;
		switch(this.options.mode){
			case 'horizontal':
				this.z = 'x';
				this.p = 'left';
				mod = {'x': 'left', 'y': false};
				offset = 'offsetWidth';
				break;
			case 'vertical':
				this.z = 'y';
				this.p = 'top';
				mod = {'x': false, 'y': 'top'};
				offset = 'offsetHeight';
		}
		this.max = this.element[offset] - this.knobMin[offset] +
(this.options.offset * 2);
		this.half = this.knobMin[offset]/2;
		this.getPos = this.element['get' +
this.p.capitalize()].bind(this.element);
		this.knobMin.setStyle('position',
'absolute').setStyle(this.p, - this.options.offset);
		this.knobMax.setStyle('position',
'absolute').setStyle(this.p, this.max);
		this.KnobMinWidth = this.knobMin[offset] + (this.options.offset * 2);
		this.knobMaxWidth = this.knobMax[offset] + (this.options.offset * 2);
		
		this.stepMin = this.toStep(- this.options.offset);
		this.stepMax = this.toStep(this.max);
		
		var dragMinlim = {};
		var dragMaxlim = {};
		
		dragMinlim[this.z] = [- this.options.offset, this.max - this.knobMaxWidth
- this.options.offset];
		dragMaxlim[this.z] = [this.KnobMinWidth - this.options.offset, this.max -
this.options.offset];

		this.dragMin = new Drag(this.knobMin, {
			limit: dragMinlim,
			modifiers: mod,
			snap: 0,
			onStart: function(){
				this.draggedKnob('dragMin');
			}.bind(this),

			onDrag: function(){
				this.draggedKnob('dragMin');
			}.bind(this),

			onComplete: function(){
				this.draggedKnob('dragMin');
				this.end();
			}.bind(this)
		});

		this.dragMax = new Drag(this.knobMax, {
			limit: dragMaxlim,
			modifiers: mod,
			snap: 0,
			onStart: function(){
				this.draggedKnob('dragMax');
			}.bind(this),
			onDrag: function(){
				this.draggedKnob('dragMax');
			}.bind(this),
			onComplete: function(){
				this.draggedKnob('dragMax');
				this.end();
			}.bind(this)
		});
		
		if (this.options.initialize) this.options.initialize.call(this);
	},

	/*
	Property: set
		The slider will get the step you pass.

	Arguments:
		step - one integer
	*/

	set: function(step){
		this.step = step.limit(0, this.options.steps);
		this.checkStep();
		// this.end();
		// this.fireEvent('onTick', this.toPosition(this.step));
		return this;
	},

	clickedElement: function(event){
		/*
		var position = event.page[this.z] - this.getPos() - this.half;
		position = position.limit(-this.options.offset, this.max
-this.options.offset);
		this.step = this.toStep(position);
		this.checkStep();
		this.end();
		this.fireEvent('onTick', position);
		*/
	},

	draggedKnob: function(knob){
		var dragMinValue = this.dragMin.value.now[this.z];
		var dragMaxValue = this.dragMax.value.now[this.z];
		
		var lim = {};

		if(knob == 'dragMax' ) {
			if(dragMinValue) {
				lim[this.z] = [dragMinValue + this.KnobMinWidth - this.options.offset,
this.max - this.options.offset];
				this.dragMax.limit = lim;
			}
			this.step = this.toStep(dragMaxValue);
			this.stepMax = this.step;
		} else {
			if(dragMaxValue) {

				lim[this.z] = [- this.options.offset, dragMaxValue - this.knobMaxWidth
- this.options.offset];
				this.dragMin.limit = lim;
			}
		    this.step = this.toStep(dragMinValue);
		    this.stepMin = this.step;
		}
		this.checkStep();
	},

	checkStep: function(){
		if (this.previousChange != this.step){
			this.previousChange = this.step;
			var steps = {
				current : this.step,
				minimum : this.stepMin,
				maximum : this.stepMax 
			};
				
			this.fireEvent('onChange', steps);
		}
	},

	end: function(){
		if (this.previousEnd !== this.step){
			this.previousEnd = this.step;
			this.fireEvent('onComplete', this.step + '');
		}
	},

	toStep: function(position){
		return Math.round((position + this.options.offset) / this.max *
this.options.steps);
	},

	toPosition: function(step){
		return this.max * step / this.options.steps;
	}

});

js/console.js000064400000007670151167223230007174 0ustar00/**
 * This file is part of Joomla Estate Agency - Joomla! extension for real
estate
 * agency
 * 
 * @copyright Copyright (C) 2008 - 2020 PHILIP Sylvain. All rights
reserved.
 * @license GNU/GPL, see LICENSE.txt
 */

+function ($) {

	'use strict';
	
	// PROGRESSBAR CLASS DEFINITION
	// ============================
	
	var ProgressBar = function (element, options) {
		this.progressBar = $(element);
		this.options = options;
		this.timer = null;
		this.startTime = null;
		this.step = 0;
	}
	
	ProgressBar.DEFAULTS = {
		steps : 100,
		color : '#fff',
		size : 30
	}

	ProgressBar.prototype.setStep = function(step) {

		// if we go over our bound, just ignore it
		if (step > this.options.steps) {
			return;
		}

		this.step = step;

		var date = new Date();

		if (!this.startTime) {
			this.startTime = date.getTime() / 1000;
		}

		var now = date.getTime() / 1000;

		var perc = this.step / this.options.steps;

		var bar = Math.floor(perc * this.options.size);

		var status_bar = "[";

		for (var i = 0; i <= bar; i++) {
			status_bar += '=';
		}

		if (bar < this.options.size) {
			status_bar += '>';
			for (var i = 0; i <= this.options.size - bar; i++) {
				status_bar += '\u00A0'; // Unicode non-breaking space
			}
		} else {
			status_bar += '=';
		}

		var disp = Math.floor(perc * 100);

		status_bar += "] " + disp + "%  " + this.step +
"/" + this.options.steps;

		var rate = (now - this.startTime) / this.step;
		var left = this.options.steps - this.step;

		var remaining =
Joomla.JText._('COM_JEA_GATEWAY_IMPORT_TIME_REMAINING',
'Time remaining: %d sec.');
		var elapsed =
Joomla.JText._('COM_JEA_GATEWAY_IMPORT_TIME_ELAPSED', 'Time
elapsed: %d sec.');
		
		status_bar += "  " + remaining.replace('%d',
Math.round(rate * left))
		status_bar += "  " + elapsed.replace('%d',
Math.round(now - this.startTime))

		this.progressBar.text(status_bar);

	};

	ProgressBar.prototype.gotToNextStep = function() {
		this.step++;
		this.setStep(this.step);
	};
	

	// CONSOLE CLASS DEFINITION
	// ========================

	var Console = function (element, options) {
		this.console = $(element);
		this.options = options;
		this.progressBars = [];
	}


	Console.prototype.appendLine = function(message, prefix) {
		var text = prefix || '> ';
		var className = 'info';
		if (message.error) {
			text += message.error;
			className = 'error';
		}

		if (message.warning) {
			text += message.warning;
			className = 'warning';
		}

		if (message.text)
			text += message.text;

		var line = $('<p>', {
			class: className,
			text: text.toString()
		});
		this.console.append(line);
		return line;
	};
	
	Console.prototype.addPlaceHolder = function(name) {
		var line = $('<p>', {
			class: 'placeholder',
			id: name
		});
		this.console.append(line);
		return line;
	};

	Console.prototype.getPlaceHolder = function(name) {
		return $('#'+name);
	};
	
	Console.prototype.clear = function() {
		this.progressBars = null;
		this.console.empty();
	};
	
	Console.prototype.addProgressBar = function(name, options) {
		var progressbarContainer = $('<div>', {
			class: 'progressbar',
			id: name
		});
		var options  = $.extend({}, ProgressBar.DEFAULTS, typeof options ==
'object' && options)
		this.console.append(progressbarContainer);
		this.progressBars[name] = new ProgressBar(progressbarContainer, options);
		return this.progressBars[name];
	};
	
	Console.prototype.getProgressBar = function(name) {
			if (this.progressBars[name]) {
				return this.progressBars[name];
			}
			return false;
	};
	
	// CONSOLE PLUGIN DEFINITION
	// ============================

	function Plugin(options) {
		var $this   = $(this)
		var instance    = $this.data('jea.console')
		if (!instance) $this.data('jea.console', (instance = new
Console(this, options)))
		return instance;
	}

	var old = $.fn.console

	$.fn.console             = Plugin
	$.fn.console.Constructor = Console

	// CONSOLE NO CONFLICT
	// ====================

	$.fn.console.noConflict = function() {
		$.fn.console = old
		return this
	}

}(jQuery);




js/search.js000064400000013233151167223230006767 0ustar00/**
 * This file is part of Joomla Estate Agency - Joomla! extension for real
estate
 * agency
 * 
 * @copyright Copyright (C) 2008 - 2020 PHILIP Sylvain. All rights
reserved.
 * @license GNU/GPL, see LICENSE.txt
 */

/**
 * This implementation works with Mootools framework
 * We keep this file for backward compatibility with old templates
overriding JEA layouts
 */

JEASearch = new Class({

	Implements: [Options],

	form: null,

	forceUpdateLists : false,

	options: {
		fields : {
			filter_amenities : [],
			filter_area_id : 0,
			filter_bathrooms_min : 0,
			filter_bedrooms_min : 0,
			filter_budget_max : 0,
			filter_budget_min : 0,
			filter_condition : 0,
			filter_department_id : 0,
			filter_floor : '',
			filter_heatingtype : 0,
			filter_hotwatertype : 0,
			filter_land_space_max : 0,
			filter_land_space_min : 0,
			filter_living_space_max :0,
			filter_living_space_min : 0,
			filter_orientation : 0,
			filter_rooms_min : 0,
			filter_search : "",
			filter_town_id : 0,
			filter_transaction_type : "",
			filter_type_id : 0,
			filter_zip_codes : ""
		},
		useAJAX : false
	},

	initialize: function(formId, options) {
		this.form = document.id(formId);
		this.setOptions(options);
		this.forceUpdateLists = true;
		
		if (this.options.useAJAX) {
			for (var fieldName in this.options.fields) {
				if (fieldName == 'filter_amenities') {
					fieldName = 'filter_amenities[]';
				}
				this.initFieldBehavior(fieldName);
			}
		}

		this.form.addEvent('reset', this.reset.bind(this));
	},

	initFieldBehavior : function(fieldName) {
		if (this.form[fieldName]) {
			if (typeOf(this.form[fieldName]) == 'element') {
				var field = document.id(this.form[fieldName]);
				this.options.fields[fieldName] = field.get('value');
				field.addEvent('change', function(event) {
					this.forceUpdateLists = false;
					this.options.fields[fieldName] = field.get('value');
					this.refresh();
				}.bind(this));

			} else if (typeOf(this.form[fieldName]) == 'collection') {
				if (fieldName == 'filter_amenities[]') {
					Array.from(this.form['filter_amenities[]']).each(function(item)
{
						if (Browser.ie && Browser.version < 9){
							item = document.id(item);
						}
						item.addEvent('change', function(event) {
							var index =
this.options.fields.filter_amenities.indexOf(item.get('value'));
							this.forceUpdateLists = true;
							if (item.get('checked') && index == -1) {
								this.options.fields.filter_amenities.push(item.get('value'));
							} else if (!item.get('checked') && index > -1){
								this.options.fields.filter_amenities.splice(index, 1);
							}
							this.refresh();
						}.bind(this));
					}.bind(this));
				} else if (fieldName == 'filter_transaction_type') {
					var transTypes =
document.getElements('[name=filter_transaction_type]');
					transTypes.each(function(item) {
						item.addEvent('change', function(event) {
							this.forceUpdateLists = true;
							if (item.get('checked')) {
								this.options.fields.filter_transaction_type =
item.get('value');
							}
							this.refresh();
						}.bind(this));
					}.bind(this));
				}
			}
		}
	},

	refresh: function() {
		if (this.options.useAJAX) {
			var jSonRequest = new Request.JSON({
				url:
'index.php?option=com_jea&task=properties.search&format=json',
				onSuccess: function(response) {
					this.appendList('filter_type_id', response.types);
					this.appendList('filter_department_id',
response.departments);
					this.appendList('filter_town_id',response.towns);
					this.appendList('filter_area_id', response.areas);
					this.form.getElements('.jea-counter-result').each(function(item){
						item.set('text', response.total);
					});
				}.bind(this)
			});

			jSonRequest.post(this.options.fields);
		}
	},

	reset : function() {
		this.options.fields = {
			filter_amenities : [],
			filter_area_id : 0,
			filter_bathrooms_min : 0,
			filter_bedrooms_min : 0,
			filter_budget_max : 0,
			filter_budget_min : 0,
			filter_condition : 0,
			filter_department_id : 0,
			filter_floor : '',
			filter_heatingtype : 0,
			filter_hotwatertype : 0,
			filter_land_space_max : 0,
			filter_land_space_min : 0,
			filter_living_space_max :0,
			filter_living_space_min : 0,
			filter_orientation : 0,
			filter_rooms_min : 0,
			filter_search : "",
			filter_town_id : 0,
			// Keep selected transaction type
			filter_transaction_type : this.options.fields.filter_transaction_type,
			filter_type_id : 0,
			filter_zip_codes : ""
		};

		for (var fieldName in this.options.fields) {
			if (this.form[fieldName]) {
				if (typeOf(this.form[fieldName]) == 'element') {
					var field = document.id(this.form[fieldName]);
					if (field.get('tag') == 'select') {
						field.set('selectedIndex', 0);
					}
					field.set('value', '');

				} else if (typeOf(this.form[fieldName]) == 'collection') {
					Array.from(this.form[fieldName]).each(function(item) {
						item.set('checked', '');
					});
				}
			}
		}

		this.refresh();
	},

	appendList : function(selectName, objectList) {
		if (this.form[selectName]) {
			var selectElt = document.id(this.form[selectName]);
			// Update the list only if its value equals 0
			// Or if this.forceUpdateLists is set to true
			if (selectElt.get('value') == 0 || this.forceUpdateLists) {
				var value = selectElt.get('value');

				// Save the first option element
				var first = selectElt.getFirst().clone();
				selectElt.empty();
				if (first.get('value') == 0) {
					selectElt.adopt(first);
				}

				for (var i in objectList) {
					if (objectList[i].text) {
						var option = new Element('option', objectList[i]);
						if (objectList[i].value == value) {
							option.setProperty('selected', 'selected');
						}
						selectElt.adopt(option);
					}
				}
			}
		}
	}

});
js/jquery.magnific-popup.js000064400000121402151167223230011754 0ustar00/*!
Magnific Popup - v1.1.0 - 2016-02-20
* http://dimsemenov.com/plugins/magnific-popup/
* Copyright (c) 2016 Dmitry Semenov; */
;(function (factory) { 
if (typeof define === 'function' && define.amd) { 
 // AMD. Register as an anonymous module. 
 define(['jquery'], factory); 
 } else if (typeof exports === 'object') { 
 // Node/CommonJS 
 factory(require('jquery')); 
 } else { 
 // Browser globals 
 factory(window.jQuery || window.Zepto); 
 } 
 }(function($) { 

/*>>core*/
/**
 * 
 * Magnific Popup Core JS file
 * 
 */


/**
 * Private static constants
 */
var CLOSE_EVENT = 'Close',
	BEFORE_CLOSE_EVENT = 'BeforeClose',
	AFTER_CLOSE_EVENT = 'AfterClose',
	BEFORE_APPEND_EVENT = 'BeforeAppend',
	MARKUP_PARSE_EVENT = 'MarkupParse',
	OPEN_EVENT = 'Open',
	CHANGE_EVENT = 'Change',
	NS = 'mfp',
	EVENT_NS = '.' + NS,
	READY_CLASS = 'mfp-ready',
	REMOVING_CLASS = 'mfp-removing',
	PREVENT_CLOSE_CLASS = 'mfp-prevent-close';


/**
 * Private vars 
 */
/*jshint -W079 */
var mfp, // As we have only one instance of MagnificPopup object, we define
it locally to not to use 'this'
	MagnificPopup = function(){},
	_isJQ = !!(window.jQuery),
	_prevStatus,
	_window = $(window),
	_document,
	_prevContentType,
	_wrapClasses,
	_currPopupType;


/**
 * Private functions
 */
var _mfpOn = function(name, f) {
		mfp.ev.on(NS + name + EVENT_NS, f);
	},
	_getEl = function(className, appendTo, html, raw) {
		var el = document.createElement('div');
		el.className = 'mfp-'+className;
		if(html) {
			el.innerHTML = html;
		}
		if(!raw) {
			el = $(el);
			if(appendTo) {
				el.appendTo(appendTo);
			}
		} else if(appendTo) {
			appendTo.appendChild(el);
		}
		return el;
	},
	_mfpTrigger = function(e, data) {
		mfp.ev.triggerHandler(NS + e, data);

		if(mfp.st.callbacks) {
			// converts "mfpEventName" to "eventName" callback
and triggers it if it's present
			e = e.charAt(0).toLowerCase() + e.slice(1);
			if(mfp.st.callbacks[e]) {
				mfp.st.callbacks[e].apply(mfp, $.isArray(data) ? data : [data]);
			}
		}
	},
	_getCloseBtn = function(type) {
		if(type !== _currPopupType || !mfp.currTemplate.closeBtn) {
			mfp.currTemplate.closeBtn = $(
mfp.st.closeMarkup.replace('%title%', mfp.st.tClose ) );
			_currPopupType = type;
		}
		return mfp.currTemplate.closeBtn;
	},
	// Initialize Magnific Popup only when called at least once
	_checkInstance = function() {
		if(!$.magnificPopup.instance) {
			/*jshint -W020 */
			mfp = new MagnificPopup();
			mfp.init();
			$.magnificPopup.instance = mfp;
		}
	},
	// CSS transition detection,
http://stackoverflow.com/questions/7264899/detect-css-transitions-using-javascript-and-without-modernizr
	supportsTransitions = function() {
		var s = document.createElement('p').style, // 's' for
style. better to create an element if body yet to exist
			v = ['ms','O','Moz','Webkit'];
// 'v' for vendor

		if( s['transition'] !== undefined ) {
			return true; 
		}
			
		while( v.length ) {
			if( v.pop() + 'Transition' in s ) {
				return true;
			}
		}
				
		return false;
	};



/**
 * Public functions
 */
MagnificPopup.prototype = {

	constructor: MagnificPopup,

	/**
	 * Initializes Magnific Popup plugin. 
	 * This function is triggered only once when $.fn.magnificPopup or
$.magnificPopup is executed
	 */
	init: function() {
		var appVersion = navigator.appVersion;
		mfp.isLowIE = mfp.isIE8 = document.all &&
!document.addEventListener;
		mfp.isAndroid = (/android/gi).test(appVersion);
		mfp.isIOS = (/iphone|ipad|ipod/gi).test(appVersion);
		mfp.supportsTransition = supportsTransitions();

		// We disable fixed positioned lightbox on devices that don't handle
it nicely.
		// If you know a better way of detecting this - let me know.
		mfp.probablyMobile = (mfp.isAndroid || mfp.isIOS || /(Opera
Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows
Phone)|IEMobile/i.test(navigator.userAgent) );
		_document = $(document);

		mfp.popupsCache = {};
	},

	/**
	 * Opens popup
	 * @param  data [description]
	 */
	open: function(data) {

		var i;

		if(data.isObj === false) { 
			// convert jQuery collection to array to avoid conflicts later
			mfp.items = data.items.toArray();

			mfp.index = 0;
			var items = data.items,
				item;
			for(i = 0; i < items.length; i++) {
				item = items[i];
				if(item.parsed) {
					item = item.el[0];
				}
				if(item === data.el[0]) {
					mfp.index = i;
					break;
				}
			}
		} else {
			mfp.items = $.isArray(data.items) ? data.items : [data.items];
			mfp.index = data.index || 0;
		}

		// if popup is already opened - we just update the content
		if(mfp.isOpen) {
			mfp.updateItemHTML();
			return;
		}
		
		mfp.types = []; 
		_wrapClasses = '';
		if(data.mainEl && data.mainEl.length) {
			mfp.ev = data.mainEl.eq(0);
		} else {
			mfp.ev = _document;
		}

		if(data.key) {
			if(!mfp.popupsCache[data.key]) {
				mfp.popupsCache[data.key] = {};
			}
			mfp.currTemplate = mfp.popupsCache[data.key];
		} else {
			mfp.currTemplate = {};
		}



		mfp.st = $.extend(true, {}, $.magnificPopup.defaults, data ); 
		mfp.fixedContentPos = mfp.st.fixedContentPos === 'auto' ?
!mfp.probablyMobile : mfp.st.fixedContentPos;

		if(mfp.st.modal) {
			mfp.st.closeOnContentClick = false;
			mfp.st.closeOnBgClick = false;
			mfp.st.showCloseBtn = false;
			mfp.st.enableEscapeKey = false;
		}
		

		// Building markup
		// main containers are created only once
		if(!mfp.bgOverlay) {

			// Dark overlay
			mfp.bgOverlay = _getEl('bg').on('click'+EVENT_NS,
function() {
				mfp.close();
			});

			mfp.wrap = _getEl('wrap').attr('tabindex',
-1).on('click'+EVENT_NS, function(e) {
				if(mfp._checkIfClose(e.target)) {
					mfp.close();
				}
			});

			mfp.container = _getEl('container', mfp.wrap);
		}

		mfp.contentContainer = _getEl('content');
		if(mfp.st.preloader) {
			mfp.preloader = _getEl('preloader', mfp.container,
mfp.st.tLoading);
		}


		// Initializing modules
		var modules = $.magnificPopup.modules;
		for(i = 0; i < modules.length; i++) {
			var n = modules[i];
			n = n.charAt(0).toUpperCase() + n.slice(1);
			mfp['init'+n].call(mfp);
		}
		_mfpTrigger('BeforeOpen');


		if(mfp.st.showCloseBtn) {
			// Close button
			if(!mfp.st.closeBtnInside) {
				mfp.wrap.append( _getCloseBtn() );
			} else {
				_mfpOn(MARKUP_PARSE_EVENT, function(e, template, values, item) {
					values.close_replaceWith = _getCloseBtn(item.type);
				});
				_wrapClasses += ' mfp-close-btn-in';
			}
		}

		if(mfp.st.alignTop) {
			_wrapClasses += ' mfp-align-top';
		}

	

		if(mfp.fixedContentPos) {
			mfp.wrap.css({
				overflow: mfp.st.overflowY,
				overflowX: 'hidden',
				overflowY: mfp.st.overflowY
			});
		} else {
			mfp.wrap.css({ 
				top: _window.scrollTop(),
				position: 'absolute'
			});
		}
		if( mfp.st.fixedBgPos === false || (mfp.st.fixedBgPos ===
'auto' && !mfp.fixedContentPos) ) {
			mfp.bgOverlay.css({
				height: _document.height(),
				position: 'absolute'
			});
		}

		

		if(mfp.st.enableEscapeKey) {
			// Close on ESC key
			_document.on('keyup' + EVENT_NS, function(e) {
				if(e.keyCode === 27) {
					mfp.close();
				}
			});
		}

		_window.on('resize' + EVENT_NS, function() {
			mfp.updateSize();
		});


		if(!mfp.st.closeOnContentClick) {
			_wrapClasses += ' mfp-auto-cursor';
		}
		
		if(_wrapClasses)
			mfp.wrap.addClass(_wrapClasses);


		// this triggers recalculation of layout, so we get it once to not to
trigger twice
		var windowHeight = mfp.wH = _window.height();

		
		var windowStyles = {};

		if( mfp.fixedContentPos ) {
            if(mfp._hasScrollBar(windowHeight)){
                var s = mfp._getScrollbarSize();
                if(s) {
                    windowStyles.marginRight = s;
                }
            }
        }

		if(mfp.fixedContentPos) {
			if(!mfp.isIE7) {
				windowStyles.overflow = 'hidden';
			} else {
				// ie7 double-scroll bug
				$('body, html').css('overflow',
'hidden');
			}
		}

		
		
		var classesToadd = mfp.st.mainClass;
		if(mfp.isIE7) {
			classesToadd += ' mfp-ie7';
		}
		if(classesToadd) {
			mfp._addClassToMFP( classesToadd );
		}

		// add content
		mfp.updateItemHTML();

		_mfpTrigger('BuildControls');

		// remove scrollbar, add margin e.t.c
		$('html').css(windowStyles);
		
		// add everything to DOM
		mfp.bgOverlay.add(mfp.wrap).prependTo( mfp.st.prependTo ||
$(document.body) );

		// Save last focused element
		mfp._lastFocusedEl = document.activeElement;
		
		// Wait for next cycle to allow CSS transition
		setTimeout(function() {
			
			if(mfp.content) {
				mfp._addClassToMFP(READY_CLASS);
				mfp._setFocus();
			} else {
				// if content is not defined (not loaded e.t.c) we add class only for
BG
				mfp.bgOverlay.addClass(READY_CLASS);
			}
			
			// Trap the focus in popup
			_document.on('focusin' + EVENT_NS, mfp._onFocusIn);

		}, 16);

		mfp.isOpen = true;
		mfp.updateSize(windowHeight);
		_mfpTrigger(OPEN_EVENT);

		return data;
	},

	/**
	 * Closes the popup
	 */
	close: function() {
		if(!mfp.isOpen) return;
		_mfpTrigger(BEFORE_CLOSE_EVENT);

		mfp.isOpen = false;
		// for CSS3 animation
		if(mfp.st.removalDelay && !mfp.isLowIE &&
mfp.supportsTransition )  {
			mfp._addClassToMFP(REMOVING_CLASS);
			setTimeout(function() {
				mfp._close();
			}, mfp.st.removalDelay);
		} else {
			mfp._close();
		}
	},

	/**
	 * Helper for close() function
	 */
	_close: function() {
		_mfpTrigger(CLOSE_EVENT);

		var classesToRemove = REMOVING_CLASS + ' ' + READY_CLASS +
' ';

		mfp.bgOverlay.detach();
		mfp.wrap.detach();
		mfp.container.empty();

		if(mfp.st.mainClass) {
			classesToRemove += mfp.st.mainClass + ' ';
		}

		mfp._removeClassFromMFP(classesToRemove);

		if(mfp.fixedContentPos) {
			var windowStyles = {marginRight: ''};
			if(mfp.isIE7) {
				$('body, html').css('overflow', '');
			} else {
				windowStyles.overflow = '';
			}
			$('html').css(windowStyles);
		}
		
		_document.off('keyup' + EVENT_NS + ' focusin' +
EVENT_NS);
		mfp.ev.off(EVENT_NS);

		// clean up DOM elements that aren't removed
		mfp.wrap.attr('class',
'mfp-wrap').removeAttr('style');
		mfp.bgOverlay.attr('class', 'mfp-bg');
		mfp.container.attr('class', 'mfp-container');

		// remove close button from target element
		if(mfp.st.showCloseBtn &&
		(!mfp.st.closeBtnInside || mfp.currTemplate[mfp.currItem.type] === true))
{
			if(mfp.currTemplate.closeBtn)
				mfp.currTemplate.closeBtn.detach();
		}


		if(mfp.st.autoFocusLast && mfp._lastFocusedEl) {
			$(mfp._lastFocusedEl).focus(); // put tab focus back
		}
		mfp.currItem = null;	
		mfp.content = null;
		mfp.currTemplate = null;
		mfp.prevHeight = 0;

		_mfpTrigger(AFTER_CLOSE_EVENT);
	},
	
	updateSize: function(winHeight) {

		if(mfp.isIOS) {
			// fixes iOS nav bars
https://github.com/dimsemenov/Magnific-Popup/issues/2
			var zoomLevel = document.documentElement.clientWidth /
window.innerWidth;
			var height = window.innerHeight * zoomLevel;
			mfp.wrap.css('height', height);
			mfp.wH = height;
		} else {
			mfp.wH = winHeight || _window.height();
		}
		// Fixes #84: popup incorrectly positioned with position:relative on body
		if(!mfp.fixedContentPos) {
			mfp.wrap.css('height', mfp.wH);
		}

		_mfpTrigger('Resize');

	},

	/**
	 * Set content of popup based on current index
	 */
	updateItemHTML: function() {
		var item = mfp.items[mfp.index];

		// Detach and perform modifications
		mfp.contentContainer.detach();

		if(mfp.content)
			mfp.content.detach();

		if(!item.parsed) {
			item = mfp.parseEl( mfp.index );
		}

		var type = item.type;

		_mfpTrigger('BeforeChange', [mfp.currItem ? mfp.currItem.type :
'', type]);
		// BeforeChange event works like so:
		// _mfpOn('BeforeChange', function(e, prevType, newType) { });

		mfp.currItem = item;

		if(!mfp.currTemplate[type]) {
			var markup = mfp.st[type] ? mfp.st[type].markup : false;

			// allows to modify markup
			_mfpTrigger('FirstMarkupParse', markup);

			if(markup) {
				mfp.currTemplate[type] = $(markup);
			} else {
				// if there is no markup found we just define that template is parsed
				mfp.currTemplate[type] = true;
			}
		}

		if(_prevContentType && _prevContentType !== item.type) {
			mfp.container.removeClass('mfp-'+_prevContentType+'-holder');
		}

		var newContent = mfp['get' + type.charAt(0).toUpperCase() +
type.slice(1)](item, mfp.currTemplate[type]);
		mfp.appendContent(newContent, type);

		item.preloaded = true;

		_mfpTrigger(CHANGE_EVENT, item);
		_prevContentType = item.type;

		// Append container back after its content changed
		mfp.container.prepend(mfp.contentContainer);

		_mfpTrigger('AfterChange');
	},


	/**
	 * Set HTML content of popup
	 */
	appendContent: function(newContent, type) {
		mfp.content = newContent;

		if(newContent) {
			if(mfp.st.showCloseBtn && mfp.st.closeBtnInside &&
				mfp.currTemplate[type] === true) {
				// if there is no markup, we just append close button element inside
				if(!mfp.content.find('.mfp-close').length) {
					mfp.content.append(_getCloseBtn());
				}
			} else {
				mfp.content = newContent;
			}
		} else {
			mfp.content = '';
		}

		_mfpTrigger(BEFORE_APPEND_EVENT);
		mfp.container.addClass('mfp-'+type+'-holder');

		mfp.contentContainer.append(mfp.content);
	},


	/**
	 * Creates Magnific Popup data object based on given data
	 * @param  {int} index Index of item to parse
	 */
	parseEl: function(index) {
		var item = mfp.items[index],
			type;

		if(item.tagName) {
			item = { el: $(item) };
		} else {
			type = item.type;
			item = { data: item, src: item.src };
		}

		if(item.el) {
			var types = mfp.types;

			// check for 'mfp-TYPE' class
			for(var i = 0; i < types.length; i++) {
				if( item.el.hasClass('mfp-'+types[i]) ) {
					type = types[i];
					break;
				}
			}

			item.src = item.el.attr('data-mfp-src');
			if(!item.src) {
				item.src = item.el.attr('href');
			}
		}

		item.type = type || mfp.st.type || 'inline';
		item.index = index;
		item.parsed = true;
		mfp.items[index] = item;
		_mfpTrigger('ElementParse', item);

		return mfp.items[index];
	},


	/**
	 * Initializes single popup or a group of popups
	 */
	addGroup: function(el, options) {
		var eHandler = function(e) {
			e.mfpEl = this;
			mfp._openClick(e, el, options);
		};

		if(!options) {
			options = {};
		}

		var eName = 'click.magnificPopup';
		options.mainEl = el;

		if(options.items) {
			options.isObj = true;
			el.off(eName).on(eName, eHandler);
		} else {
			options.isObj = false;
			if(options.delegate) {
				el.off(eName).on(eName, options.delegate , eHandler);
			} else {
				options.items = el;
				el.off(eName).on(eName, eHandler);
			}
		}
	},
	_openClick: function(e, el, options) {
		var midClick = options.midClick !== undefined ? options.midClick :
$.magnificPopup.defaults.midClick;


		if(!midClick && ( e.which === 2 || e.ctrlKey || e.metaKey ||
e.altKey || e.shiftKey ) ) {
			return;
		}

		var disableOn = options.disableOn !== undefined ? options.disableOn :
$.magnificPopup.defaults.disableOn;

		if(disableOn) {
			if($.isFunction(disableOn)) {
				if( !disableOn.call(mfp) ) {
					return true;
				}
			} else { // else it's number
				if( _window.width() < disableOn ) {
					return true;
				}
			}
		}

		if(e.type) {
			e.preventDefault();

			// This will prevent popup from closing if element is inside and popup
is already opened
			if(mfp.isOpen) {
				e.stopPropagation();
			}
		}

		options.el = $(e.mfpEl);
		if(options.delegate) {
			options.items = el.find(options.delegate);
		}
		mfp.open(options);
	},


	/**
	 * Updates text on preloader
	 */
	updateStatus: function(status, text) {

		if(mfp.preloader) {
			if(_prevStatus !== status) {
				mfp.container.removeClass('mfp-s-'+_prevStatus);
			}

			if(!text && status === 'loading') {
				text = mfp.st.tLoading;
			}

			var data = {
				status: status,
				text: text
			};
			// allows to modify status
			_mfpTrigger('UpdateStatus', data);

			status = data.status;
			text = data.text;

			mfp.preloader.html(text);

			mfp.preloader.find('a').on('click', function(e) {
				e.stopImmediatePropagation();
			});

			mfp.container.addClass('mfp-s-'+status);
			_prevStatus = status;
		}
	},


	/*
		"Private" helpers that aren't private at all
	 */
	// Check to close popup or not
	// "target" is an element that was clicked
	_checkIfClose: function(target) {

		if($(target).hasClass(PREVENT_CLOSE_CLASS)) {
			return;
		}

		var closeOnContent = mfp.st.closeOnContentClick;
		var closeOnBg = mfp.st.closeOnBgClick;

		if(closeOnContent && closeOnBg) {
			return true;
		} else {

			// We close the popup if click is on close button or on preloader. Or if
there is no content.
			if(!mfp.content || $(target).hasClass('mfp-close') ||
(mfp.preloader && target === mfp.preloader[0]) ) {
				return true;
			}

			// if click is outside the content
			if(  (target !== mfp.content[0] && !$.contains(mfp.content[0],
target))  ) {
				if(closeOnBg) {
					// last check, if the clicked element is in DOM, (in case it's
removed onclick)
					if( $.contains(document, target) ) {
						return true;
					}
				}
			} else if(closeOnContent) {
				return true;
			}

		}
		return false;
	},
	_addClassToMFP: function(cName) {
		mfp.bgOverlay.addClass(cName);
		mfp.wrap.addClass(cName);
	},
	_removeClassFromMFP: function(cName) {
		this.bgOverlay.removeClass(cName);
		mfp.wrap.removeClass(cName);
	},
	_hasScrollBar: function(winHeight) {
		return (  (mfp.isIE7 ? _document.height() : document.body.scrollHeight)
> (winHeight || _window.height()) );
	},
	_setFocus: function() {
		(mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0) : mfp.wrap).focus();
	},
	_onFocusIn: function(e) {
		if( e.target !== mfp.wrap[0] && !$.contains(mfp.wrap[0],
e.target) ) {
			mfp._setFocus();
			return false;
		}
	},
	_parseMarkup: function(template, values, item) {
		var arr;
		if(item.data) {
			values = $.extend(item.data, values);
		}
		_mfpTrigger(MARKUP_PARSE_EVENT, [template, values, item] );

		$.each(values, function(key, value) {
			if(value === undefined || value === false) {
				return true;
			}
			arr = key.split('_');
			if(arr.length > 1) {
				var el = template.find(EVENT_NS + '-'+arr[0]);

				if(el.length > 0) {
					var attr = arr[1];
					if(attr === 'replaceWith') {
						if(el[0] !== value[0]) {
							el.replaceWith(value);
						}
					} else if(attr === 'img') {
						if(el.is('img')) {
							el.attr('src', value);
						} else {
							el.replaceWith( $('<img>').attr('src',
value).attr('class', el.attr('class')) );
						}
					} else {
						el.attr(arr[1], value);
					}
				}

			} else {
				template.find(EVENT_NS + '-'+key).html(value);
			}
		});
	},

	_getScrollbarSize: function() {
		// thx David
		if(mfp.scrollbarSize === undefined) {
			var scrollDiv = document.createElement("div");
			scrollDiv.style.cssText = 'width: 99px; height: 99px; overflow:
scroll; position: absolute; top: -9999px;';
			document.body.appendChild(scrollDiv);
			mfp.scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth;
			document.body.removeChild(scrollDiv);
		}
		return mfp.scrollbarSize;
	}

}; /* MagnificPopup core prototype end */




/**
 * Public static functions
 */
$.magnificPopup = {
	instance: null,
	proto: MagnificPopup.prototype,
	modules: [],

	open: function(options, index) {
		_checkInstance();

		if(!options) {
			options = {};
		} else {
			options = $.extend(true, {}, options);
		}

		options.isObj = true;
		options.index = index || 0;
		return this.instance.open(options);
	},

	close: function() {
		return $.magnificPopup.instance &&
$.magnificPopup.instance.close();
	},

	registerModule: function(name, module) {
		if(module.options) {
			$.magnificPopup.defaults[name] = module.options;
		}
		$.extend(this.proto, module.proto);
		this.modules.push(name);
	},

	defaults: {

		// Info about options is in docs:
		//
http://dimsemenov.com/plugins/magnific-popup/documentation.html#options

		disableOn: 0,

		key: null,

		midClick: false,

		mainClass: '',

		preloader: true,

		focus: '', // CSS selector of input to focus after popup is
opened

		closeOnContentClick: false,

		closeOnBgClick: true,

		closeBtnInside: true,

		showCloseBtn: true,

		enableEscapeKey: true,

		modal: false,

		alignTop: false,

		removalDelay: 0,

		prependTo: null,

		fixedContentPos: 'auto',

		fixedBgPos: 'auto',

		overflowY: 'auto',

		closeMarkup: '<button title="%title%"
type="button"
class="mfp-close">&#215;</button>',

		tClose: 'Close (Esc)',

		tLoading: 'Loading...',

		autoFocusLast: true

	}
};



$.fn.magnificPopup = function(options) {
	_checkInstance();

	var jqEl = $(this);

	// We call some API method of first param is a string
	if (typeof options === "string" ) {

		if(options === 'open') {
			var items,
				itemOpts = _isJQ ? jqEl.data('magnificPopup') :
jqEl[0].magnificPopup,
				index = parseInt(arguments[1], 10) || 0;

			if(itemOpts.items) {
				items = itemOpts.items[index];
			} else {
				items = jqEl;
				if(itemOpts.delegate) {
					items = items.find(itemOpts.delegate);
				}
				items = items.eq( index );
			}
			mfp._openClick({mfpEl:items}, jqEl, itemOpts);
		} else {
			if(mfp.isOpen)
				mfp[options].apply(mfp, Array.prototype.slice.call(arguments, 1));
		}

	} else {
		// clone options obj
		options = $.extend(true, {}, options);

		/*
		 * As Zepto doesn't support .data() method for objects
		 * and it works only in normal browsers
		 * we assign "options" object directly to the DOM element. FTW!
		 */
		if(_isJQ) {
			jqEl.data('magnificPopup', options);
		} else {
			jqEl[0].magnificPopup = options;
		}

		mfp.addGroup(jqEl, options);

	}
	return jqEl;
};

/*>>core*/

/*>>inline*/

var INLINE_NS = 'inline',
	_hiddenClass,
	_inlinePlaceholder,
	_lastInlineElement,
	_putInlineElementsBack = function() {
		if(_lastInlineElement) {
			_inlinePlaceholder.after( _lastInlineElement.addClass(_hiddenClass)
).detach();
			_lastInlineElement = null;
		}
	};

$.magnificPopup.registerModule(INLINE_NS, {
	options: {
		hiddenClass: 'hide', // will be appended with `mfp-` prefix
		markup: '',
		tNotFound: 'Content not found'
	},
	proto: {

		initInline: function() {
			mfp.types.push(INLINE_NS);

			_mfpOn(CLOSE_EVENT+'.'+INLINE_NS, function() {
				_putInlineElementsBack();
			});
		},

		getInline: function(item, template) {

			_putInlineElementsBack();

			if(item.src) {
				var inlineSt = mfp.st.inline,
					el = $(item.src);

				if(el.length) {

					// If target element has parent - we replace it with placeholder and
put it back after popup is closed
					var parent = el[0].parentNode;
					if(parent && parent.tagName) {
						if(!_inlinePlaceholder) {
							_hiddenClass = inlineSt.hiddenClass;
							_inlinePlaceholder = _getEl(_hiddenClass);
							_hiddenClass = 'mfp-'+_hiddenClass;
						}
						// replace target inline element with placeholder
						_lastInlineElement =
el.after(_inlinePlaceholder).detach().removeClass(_hiddenClass);
					}

					mfp.updateStatus('ready');
				} else {
					mfp.updateStatus('error', inlineSt.tNotFound);
					el = $('<div>');
				}

				item.inlineElement = el;
				return el;
			}

			mfp.updateStatus('ready');
			mfp._parseMarkup(template, {}, item);
			return template;
		}
	}
});

/*>>inline*/

/*>>ajax*/
var AJAX_NS = 'ajax',
	_ajaxCur,
	_removeAjaxCursor = function() {
		if(_ajaxCur) {
			$(document.body).removeClass(_ajaxCur);
		}
	},
	_destroyAjaxRequest = function() {
		_removeAjaxCursor();
		if(mfp.req) {
			mfp.req.abort();
		}
	};

$.magnificPopup.registerModule(AJAX_NS, {

	options: {
		settings: null,
		cursor: 'mfp-ajax-cur',
		tError: '<a href="%url%">The content</a> could
not be loaded.'
	},

	proto: {
		initAjax: function() {
			mfp.types.push(AJAX_NS);
			_ajaxCur = mfp.st.ajax.cursor;

			_mfpOn(CLOSE_EVENT+'.'+AJAX_NS, _destroyAjaxRequest);
			_mfpOn('BeforeChange.' + AJAX_NS, _destroyAjaxRequest);
		},
		getAjax: function(item) {

			if(_ajaxCur) {
				$(document.body).addClass(_ajaxCur);
			}

			mfp.updateStatus('loading');

			var opts = $.extend({
				url: item.src,
				success: function(data, textStatus, jqXHR) {
					var temp = {
						data:data,
						xhr:jqXHR
					};

					_mfpTrigger('ParseAjax', temp);

					mfp.appendContent( $(temp.data), AJAX_NS );

					item.finished = true;

					_removeAjaxCursor();

					mfp._setFocus();

					setTimeout(function() {
						mfp.wrap.addClass(READY_CLASS);
					}, 16);

					mfp.updateStatus('ready');

					_mfpTrigger('AjaxContentAdded');
				},
				error: function() {
					_removeAjaxCursor();
					item.finished = item.loadError = true;
					mfp.updateStatus('error',
mfp.st.ajax.tError.replace('%url%', item.src));
				}
			}, mfp.st.ajax.settings);

			mfp.req = $.ajax(opts);

			return '';
		}
	}
});

/*>>ajax*/

/*>>image*/
var _imgInterval,
	_getTitle = function(item) {
		if(item.data && item.data.title !== undefined)
			return item.data.title;

		var src = mfp.st.image.titleSrc;

		if(src) {
			if($.isFunction(src)) {
				return src.call(mfp, item);
			} else if(item.el) {
				return item.el.attr(src) || '';
			}
		}
		return '';
	};

$.magnificPopup.registerModule('image', {

	options: {
		markup: '<div class="mfp-figure">'+
					'<div class="mfp-close"></div>'+
					'<figure>'+
						'<div class="mfp-img"></div>'+
						'<figcaption>'+
							'<div class="mfp-bottom-bar">'+
								'<div class="mfp-title"></div>'+
								'<div class="mfp-counter"></div>'+
							'</div>'+
						'</figcaption>'+
					'</figure>'+
				'</div>',
		cursor: 'mfp-zoom-out-cur',
		titleSrc: 'title',
		verticalFit: true,
		tError: '<a href="%url%">The image</a> could
not be loaded.'
	},

	proto: {
		initImage: function() {
			var imgSt = mfp.st.image,
				ns = '.image';

			mfp.types.push('image');

			_mfpOn(OPEN_EVENT+ns, function() {
				if(mfp.currItem.type === 'image' && imgSt.cursor) {
					$(document.body).addClass(imgSt.cursor);
				}
			});

			_mfpOn(CLOSE_EVENT+ns, function() {
				if(imgSt.cursor) {
					$(document.body).removeClass(imgSt.cursor);
				}
				_window.off('resize' + EVENT_NS);
			});

			_mfpOn('Resize'+ns, mfp.resizeImage);
			if(mfp.isLowIE) {
				_mfpOn('AfterChange', mfp.resizeImage);
			}
		},
		resizeImage: function() {
			var item = mfp.currItem;
			if(!item || !item.img) return;

			if(mfp.st.image.verticalFit) {
				var decr = 0;
				// fix box-sizing in ie7/8
				if(mfp.isLowIE) {
					decr = parseInt(item.img.css('padding-top'), 10) +
parseInt(item.img.css('padding-bottom'),10);
				}
				item.img.css('max-height', mfp.wH-decr);
			}
		},
		_onImageHasSize: function(item) {
			if(item.img) {

				item.hasSize = true;

				if(_imgInterval) {
					clearInterval(_imgInterval);
				}

				item.isCheckingImgSize = false;

				_mfpTrigger('ImageHasSize', item);

				if(item.imgHidden) {
					if(mfp.content)
						mfp.content.removeClass('mfp-loading');

					item.imgHidden = false;
				}

			}
		},

		/**
		 * Function that loops until the image has size to display elements that
rely on it asap
		 */
		findImageSize: function(item) {

			var counter = 0,
				img = item.img[0],
				mfpSetInterval = function(delay) {

					if(_imgInterval) {
						clearInterval(_imgInterval);
					}
					// decelerating interval that checks for size of an image
					_imgInterval = setInterval(function() {
						if(img.naturalWidth > 0) {
							mfp._onImageHasSize(item);
							return;
						}

						if(counter > 200) {
							clearInterval(_imgInterval);
						}

						counter++;
						if(counter === 3) {
							mfpSetInterval(10);
						} else if(counter === 40) {
							mfpSetInterval(50);
						} else if(counter === 100) {
							mfpSetInterval(500);
						}
					}, delay);
				};

			mfpSetInterval(1);
		},

		getImage: function(item, template) {

			var guard = 0,

				// image load complete handler
				onLoadComplete = function() {
					if(item) {
						if (item.img[0].complete) {
							item.img.off('.mfploader');

							if(item === mfp.currItem){
								mfp._onImageHasSize(item);

								mfp.updateStatus('ready');
							}

							item.hasSize = true;
							item.loaded = true;

							_mfpTrigger('ImageLoadComplete');

						}
						else {
							// if image complete check fails 200 times (20 sec), we assume that
there was an error.
							guard++;
							if(guard < 200) {
								setTimeout(onLoadComplete,100);
							} else {
								onLoadError();
							}
						}
					}
				},

				// image error handler
				onLoadError = function() {
					if(item) {
						item.img.off('.mfploader');
						if(item === mfp.currItem){
							mfp._onImageHasSize(item);
							mfp.updateStatus('error',
imgSt.tError.replace('%url%', item.src) );
						}

						item.hasSize = true;
						item.loaded = true;
						item.loadError = true;
					}
				},
				imgSt = mfp.st.image;


			var el = template.find('.mfp-img');
			if(el.length) {
				var img = document.createElement('img');
				img.className = 'mfp-img';
				if(item.el && item.el.find('img').length) {
					img.alt = item.el.find('img').attr('alt');
				}
				item.img = $(img).on('load.mfploader',
onLoadComplete).on('error.mfploader', onLoadError);
				img.src = item.src;

				// without clone() "error" event is not firing when IMG is
replaced by new IMG
				// TODO: find a way to avoid such cloning
				if(el.is('img')) {
					item.img = item.img.clone();
				}

				img = item.img[0];
				if(img.naturalWidth > 0) {
					item.hasSize = true;
				} else if(!img.width) {
					item.hasSize = false;
				}
			}

			mfp._parseMarkup(template, {
				title: _getTitle(item),
				img_replaceWith: item.img
			}, item);

			mfp.resizeImage();

			if(item.hasSize) {
				if(_imgInterval) clearInterval(_imgInterval);

				if(item.loadError) {
					template.addClass('mfp-loading');
					mfp.updateStatus('error',
imgSt.tError.replace('%url%', item.src) );
				} else {
					template.removeClass('mfp-loading');
					mfp.updateStatus('ready');
				}
				return template;
			}

			mfp.updateStatus('loading');
			item.loading = true;

			if(!item.hasSize) {
				item.imgHidden = true;
				template.addClass('mfp-loading');
				mfp.findImageSize(item);
			}

			return template;
		}
	}
});

/*>>image*/

/*>>zoom*/
var hasMozTransform,
	getHasMozTransform = function() {
		if(hasMozTransform === undefined) {
			hasMozTransform =
document.createElement('p').style.MozTransform !== undefined;
		}
		return hasMozTransform;
	};

$.magnificPopup.registerModule('zoom', {

	options: {
		enabled: false,
		easing: 'ease-in-out',
		duration: 300,
		opener: function(element) {
			return element.is('img') ? element :
element.find('img');
		}
	},

	proto: {

		initZoom: function() {
			var zoomSt = mfp.st.zoom,
				ns = '.zoom',
				image;

			if(!zoomSt.enabled || !mfp.supportsTransition) {
				return;
			}

			var duration = zoomSt.duration,
				getElToAnimate = function(image) {
					var newImg =
image.clone().removeAttr('style').removeAttr('class').addClass('mfp-animated-image'),
						transition = 'all '+(zoomSt.duration/1000)+'s ' +
zoomSt.easing,
						cssObj = {
							position: 'fixed',
							zIndex: 9999,
							left: 0,
							top: 0,
							'-webkit-backface-visibility': 'hidden'
						},
						t = 'transition';

					cssObj['-webkit-'+t] = cssObj['-moz-'+t] =
cssObj['-o-'+t] = cssObj[t] = transition;

					newImg.css(cssObj);
					return newImg;
				},
				showMainContent = function() {
					mfp.content.css('visibility', 'visible');
				},
				openTimeout,
				animatedImg;

			_mfpOn('BuildControls'+ns, function() {
				if(mfp._allowZoom()) {

					clearTimeout(openTimeout);
					mfp.content.css('visibility', 'hidden');

					// Basically, all code below does is clones existing image, puts in on
top of the current one and animated it

					image = mfp._getItemToZoom();

					if(!image) {
						showMainContent();
						return;
					}

					animatedImg = getElToAnimate(image);

					animatedImg.css( mfp._getOffset() );

					mfp.wrap.append(animatedImg);

					openTimeout = setTimeout(function() {
						animatedImg.css( mfp._getOffset( true ) );
						openTimeout = setTimeout(function() {

							showMainContent();

							setTimeout(function() {
								animatedImg.remove();
								image = animatedImg = null;
								_mfpTrigger('ZoomAnimationEnded');
							}, 16); // avoid blink when switching images

						}, duration); // this timeout equals animation duration

					}, 16); // by adding this timeout we avoid short glitch at the
beginning of animation


					// Lots of timeouts...
				}
			});
			_mfpOn(BEFORE_CLOSE_EVENT+ns, function() {
				if(mfp._allowZoom()) {

					clearTimeout(openTimeout);

					mfp.st.removalDelay = duration;

					if(!image) {
						image = mfp._getItemToZoom();
						if(!image) {
							return;
						}
						animatedImg = getElToAnimate(image);
					}

					animatedImg.css( mfp._getOffset(true) );
					mfp.wrap.append(animatedImg);
					mfp.content.css('visibility', 'hidden');

					setTimeout(function() {
						animatedImg.css( mfp._getOffset() );
					}, 16);
				}

			});

			_mfpOn(CLOSE_EVENT+ns, function() {
				if(mfp._allowZoom()) {
					showMainContent();
					if(animatedImg) {
						animatedImg.remove();
					}
					image = null;
				}
			});
		},

		_allowZoom: function() {
			return mfp.currItem.type === 'image';
		},

		_getItemToZoom: function() {
			if(mfp.currItem.hasSize) {
				return mfp.currItem.img;
			} else {
				return false;
			}
		},

		// Get element postion relative to viewport
		_getOffset: function(isLarge) {
			var el;
			if(isLarge) {
				el = mfp.currItem.img;
			} else {
				el = mfp.st.zoom.opener(mfp.currItem.el || mfp.currItem);
			}

			var offset = el.offset();
			var paddingTop = parseInt(el.css('padding-top'),10);
			var paddingBottom = parseInt(el.css('padding-bottom'),10);
			offset.top -= ( $(window).scrollTop() - paddingTop );


			/*

			Animating left + top + width/height looks glitchy in Firefox, but
perfect in Chrome. And vice-versa.

			 */
			var obj = {
				width: el.width(),
				// fix Zepto height+padding issue
				height: (_isJQ ? el.innerHeight() : el[0].offsetHeight) - paddingBottom
- paddingTop
			};

			// I hate to do this, but there is no another option
			if( getHasMozTransform() ) {
				obj['-moz-transform'] = obj['transform'] =
'translate(' + offset.left + 'px,' + offset.top +
'px)';
			} else {
				obj.left = offset.left;
				obj.top = offset.top;
			}
			return obj;
		}

	}
});



/*>>zoom*/

/*>>iframe*/

var IFRAME_NS = 'iframe',
	_emptyPage = '//about:blank',

	_fixIframeBugs = function(isShowing) {
		if(mfp.currTemplate[IFRAME_NS]) {
			var el = mfp.currTemplate[IFRAME_NS].find('iframe');
			if(el.length) {
				// reset src after the popup is closed to avoid "video keeps
playing after popup is closed" bug
				if(!isShowing) {
					el[0].src = _emptyPage;
				}

				// IE8 black screen bug fix
				if(mfp.isIE8) {
					el.css('display', isShowing ? 'block' :
'none');
				}
			}
		}
	};

$.magnificPopup.registerModule(IFRAME_NS, {

	options: {
		markup: '<div class="mfp-iframe-scaler">'+
					'<div class="mfp-close"></div>'+
					'<iframe class="mfp-iframe"
src="//about:blank" frameborder="0"
allowfullscreen></iframe>'+
				'</div>',

		srcAction: 'iframe_src',

		// we don't care and support only one default type of URL by default
		patterns: {
			youtube: {
				index: 'youtube.com',
				id: 'v=',
				src: '//www.youtube.com/embed/%id%?autoplay=1'
			},
			vimeo: {
				index: 'vimeo.com/',
				id: '/',
				src: '//player.vimeo.com/video/%id%?autoplay=1'
			},
			gmaps: {
				index: '//maps.google.',
				src: '%id%&output=embed'
			}
		}
	},

	proto: {
		initIframe: function() {
			mfp.types.push(IFRAME_NS);

			_mfpOn('BeforeChange', function(e, prevType, newType) {
				if(prevType !== newType) {
					if(prevType === IFRAME_NS) {
						_fixIframeBugs(); // iframe if removed
					} else if(newType === IFRAME_NS) {
						_fixIframeBugs(true); // iframe is showing
					}
				}// else {
					// iframe source is switched, don't do anything
				//}
			});

			_mfpOn(CLOSE_EVENT + '.' + IFRAME_NS, function() {
				_fixIframeBugs();
			});
		},

		getIframe: function(item, template) {
			var embedSrc = item.src;
			var iframeSt = mfp.st.iframe;

			$.each(iframeSt.patterns, function() {
				if(embedSrc.indexOf( this.index ) > -1) {
					if(this.id) {
						if(typeof this.id === 'string') {
							embedSrc =
embedSrc.substr(embedSrc.lastIndexOf(this.id)+this.id.length,
embedSrc.length);
						} else {
							embedSrc = this.id.call( this, embedSrc );
						}
					}
					embedSrc = this.src.replace('%id%', embedSrc );
					return false; // break;
				}
			});

			var dataObj = {};
			if(iframeSt.srcAction) {
				dataObj[iframeSt.srcAction] = embedSrc;
			}
			mfp._parseMarkup(template, dataObj, item);

			mfp.updateStatus('ready');

			return template;
		}
	}
});



/*>>iframe*/

/*>>gallery*/
/**
 * Get looped index depending on number of slides
 */
var _getLoopedId = function(index) {
		var numSlides = mfp.items.length;
		if(index > numSlides - 1) {
			return index - numSlides;
		} else  if(index < 0) {
			return numSlides + index;
		}
		return index;
	},
	_replaceCurrTotal = function(text, curr, total) {
		return text.replace(/%curr%/gi, curr + 1).replace(/%total%/gi, total);
	};

$.magnificPopup.registerModule('gallery', {

	options: {
		enabled: false,
		arrowMarkup: '<button title="%title%"
type="button" class="mfp-arrow
mfp-arrow-%dir%"></button>',
		preload: [0,2],
		navigateByImgClick: true,
		arrows: true,

		tPrev: 'Previous (Left arrow key)',
		tNext: 'Next (Right arrow key)',
		tCounter: '%curr% of %total%'
	},

	proto: {
		initGallery: function() {

			var gSt = mfp.st.gallery,
				ns = '.mfp-gallery';

			mfp.direction = true; // true - next, false - prev

			if(!gSt || !gSt.enabled ) return false;

			_wrapClasses += ' mfp-gallery';

			_mfpOn(OPEN_EVENT+ns, function() {

				if(gSt.navigateByImgClick) {
					mfp.wrap.on('click'+ns, '.mfp-img', function() {
						if(mfp.items.length > 1) {
							mfp.next();
							return false;
						}
					});
				}

				_document.on('keydown'+ns, function(e) {
					if (e.keyCode === 37) {
						mfp.prev();
					} else if (e.keyCode === 39) {
						mfp.next();
					}
				});
			});

			_mfpOn('UpdateStatus'+ns, function(e, data) {
				if(data.text) {
					data.text = _replaceCurrTotal(data.text, mfp.currItem.index,
mfp.items.length);
				}
			});

			_mfpOn(MARKUP_PARSE_EVENT+ns, function(e, element, values, item) {
				var l = mfp.items.length;
				values.counter = l > 1 ? _replaceCurrTotal(gSt.tCounter, item.index,
l) : '';
			});

			_mfpOn('BuildControls' + ns, function() {
				if(mfp.items.length > 1 && gSt.arrows &&
!mfp.arrowLeft) {
					var markup = gSt.arrowMarkup,
						arrowLeft = mfp.arrowLeft = $( markup.replace(/%title%/gi,
gSt.tPrev).replace(/%dir%/gi, 'left')
).addClass(PREVENT_CLOSE_CLASS),
						arrowRight = mfp.arrowRight = $( markup.replace(/%title%/gi,
gSt.tNext).replace(/%dir%/gi, 'right')
).addClass(PREVENT_CLOSE_CLASS);

					arrowLeft.click(function() {
						mfp.prev();
					});
					arrowRight.click(function() {
						mfp.next();
					});

					mfp.container.append(arrowLeft.add(arrowRight));
				}
			});

			_mfpOn(CHANGE_EVENT+ns, function() {
				if(mfp._preloadTimeout) clearTimeout(mfp._preloadTimeout);

				mfp._preloadTimeout = setTimeout(function() {
					mfp.preloadNearbyImages();
					mfp._preloadTimeout = null;
				}, 16);
			});


			_mfpOn(CLOSE_EVENT+ns, function() {
				_document.off(ns);
				mfp.wrap.off('click'+ns);
				mfp.arrowRight = mfp.arrowLeft = null;
			});

		},
		next: function() {
			mfp.direction = true;
			mfp.index = _getLoopedId(mfp.index + 1);
			mfp.updateItemHTML();
		},
		prev: function() {
			mfp.direction = false;
			mfp.index = _getLoopedId(mfp.index - 1);
			mfp.updateItemHTML();
		},
		goTo: function(newIndex) {
			mfp.direction = (newIndex >= mfp.index);
			mfp.index = newIndex;
			mfp.updateItemHTML();
		},
		preloadNearbyImages: function() {
			var p = mfp.st.gallery.preload,
				preloadBefore = Math.min(p[0], mfp.items.length),
				preloadAfter = Math.min(p[1], mfp.items.length),
				i;

			for(i = 1; i <= (mfp.direction ? preloadAfter : preloadBefore); i++)
{
				mfp._preloadItem(mfp.index+i);
			}
			for(i = 1; i <= (mfp.direction ? preloadBefore : preloadAfter); i++)
{
				mfp._preloadItem(mfp.index-i);
			}
		},
		_preloadItem: function(index) {
			index = _getLoopedId(index);

			if(mfp.items[index].preloaded) {
				return;
			}

			var item = mfp.items[index];
			if(!item.parsed) {
				item = mfp.parseEl( index );
			}

			_mfpTrigger('LazyLoad', item);

			if(item.type === 'image') {
				item.img = $('<img class="mfp-img"
/>').on('load.mfploader', function() {
					item.hasSize = true;
				}).on('error.mfploader', function() {
					item.hasSize = true;
					item.loadError = true;
					_mfpTrigger('LazyLoadError', item);
				}).attr('src', item.src);
			}


			item.preloaded = true;
		}
	}
});

/*>>gallery*/

/*>>retina*/

var RETINA_NS = 'retina';

$.magnificPopup.registerModule(RETINA_NS, {
	options: {
		replaceSrc: function(item) {
			return item.src.replace(/\.\w+$/, function(m) { return '@2x' +
m; });
		},
		ratio: 1 // Function or number.  Set to 1 to disable.
	},
	proto: {
		initRetina: function() {
			if(window.devicePixelRatio > 1) {

				var st = mfp.st.retina,
					ratio = st.ratio;

				ratio = !isNaN(ratio) ? ratio : ratio();

				if(ratio > 1) {
					_mfpOn('ImageHasSize' + '.' + RETINA_NS,
function(e, item) {
						item.img.css({
							'max-width': item.img[0].naturalWidth / ratio,
							'width': '100%'
						});
					});
					_mfpOn('ElementParse' + '.' + RETINA_NS,
function(e, item) {
						item.src = st.replaceSrc(item, ratio);
					});
				}
			}

		}
	}
});

/*>>retina*/
 _checkInstance();
}));js/gateway-jea.js000064400000007754151167223230007733 0ustar00/**
 * This file is part of Joomla Estate Agency - Joomla! extension for real
estate
 * agency
 * 
 * @copyright Copyright (C) 2008 - 2020 PHILIP Sylvain. All rights
reserved.
 * @license GNU/GPL, see LICENSE.txt
 */

var JeaGateway = {

	startExport : function (gatewayId, gatewayTitle, webConsole) {

		var requestParams = {
			option: 'com_jea',
			format: 'json',
			task: 'gateway.export',
			id: gatewayId
		}
		
		var startMessage =
Joomla.JText._('COM_JEA_EXPORT_START_MESSAGE').replace('%s',
gatewayTitle)
	
		var startLine = webConsole.appendLine({text: startMessage})
	
		jQuery.getJSON( "index.php", requestParams)
			.done(function( json ) {
				
				if (json.error) {
					jQuery(startLine).addClass('error');
					jQuery(startLine).text('> ' + json.error);
					return;
				}
				
				var endMessage = Joomla.JText._('COM_JEA_EXPORT_END_MESSAGE')
					.replace('%s', gatewayTitle)
					.replace('%d', json.exported_properties)
				
				if (json.ftp_sent) {
					endMessage += ' ' +
Joomla.JText._('COM_JEA_GATEWAY_FTP_TRANSFERT_SUCCESS')
				}
	
				endMessage += ' <a href="' + json.zip_url
+'">' +
Joomla.JText._('COM_JEA_GATEWAY_DOWNLOAD_ZIP') +
'</a>'
	
				jQuery(startLine).html('> ' + endMessage)
				
				jQuery(document).trigger('gatewayActionDone');
			})
			.fail(function( jqxhr, textStatus, error ) {
				var err = textStatus + ", " + error
				jQuery(line).addClass('error');
				jQuery(line).text('> ' + "Request Failed: " +
err)
			});
	},

	startImport : function(gatewayId, gatewayTitle, webConsole) {
		var startMessage =
Joomla.JText._('COM_JEA_IMPORT_START_MESSAGE').replace('%s',
gatewayTitle)

		var startLine = webConsole.appendLine({text: startMessage})
		var progressbar = webConsole.addProgressBar('import_bar_' +
gatewayId);

		webConsole.addPlaceHolder('properties_found_'   + gatewayId);
		webConsole.addPlaceHolder('properties_updated_' + gatewayId);
		webConsole.addPlaceHolder('properties_created_' + gatewayId);
		webConsole.addPlaceHolder('properties_removed_' + gatewayId);

		JeaGateway.importRequest(gatewayId, gatewayTitle, startLine, webConsole);
	},

	importRequest : function(gatewayId, gatewayTitle, startLine, webConsole) {

		var requestParams = {
			option: 'com_jea',
			format: 'json',
			task: 'gateway.import',
			id: gatewayId
		}

		jQuery.getJSON( "index.php", requestParams)
			.done(function(response) {

				if (response.error) {
					jQuery(startLine).addClass('error');
					jQuery(startLine).text('> ' + response.error);
					return;
				}

				if (response.total == 0) {
					jQuery(startLine).text('> ' + 'Aucun bien à
importer.');
					return;
				}

				var progressbar = webConsole.getProgressBar('import_bar_'+
gatewayId);

				if (progressbar.step == 0) {
					webConsole.getPlaceHolder('properties_found_' +
gatewayId).empty().html(Joomla.JText._('COM_JEA_GATEWAY_PROPERTIES_FOUND').replace('%s',
response.total));
					progressbar.options.steps = response.total;
				}

				webConsole.getPlaceHolder('properties_updated_' +
gatewayId).empty()
					.html(Joomla.JText._('COM_JEA_GATEWAY_PROPERTIES_UPDATED').replace('%s',
response.updated));
				webConsole.getPlaceHolder('properties_created_' +
gatewayId).empty()
					.html(Joomla.JText._('COM_JEA_GATEWAY_PROPERTIES_CREATED').replace('%s',
response.created));
				webConsole.getPlaceHolder('properties_removed_' +
gatewayId).empty()
					.html(Joomla.JText._('COM_JEA_GATEWAY_PROPERTIES_DELETED').replace('%s',
response.removed));

				progressbar.setStep(response.imported);

				if (response.total == response.imported) {
					var endMessage =
Joomla.JText._('COM_JEA_IMPORT_END_MESSAGE').replace('%s',
gatewayTitle)
					jQuery(startLine).html('> ' + endMessage)
					jQuery(document).trigger('gatewayActionDone')
					return;
				}

				// Recursive
				JeaGateway.importRequest(gatewayId, gatewayTitle, startLine,
webConsole)
			})
			.fail(function( jqxhr, textStatus, error ) {
				var err = textStatus + ", " + error
				jQuery(startLine).addClass('error');
				jQuery(startLine).text('> ' + "Request Failed: "
+ err)
			});
	}

}

js/property.form.js000064400000012025151167223230010346 0ustar00
Element.implement({
	flash: function (to,from,reps,prop,dur) {

		//defaults
		if(!reps) { reps = 1; }
		if(!prop) { prop = 'background-color'; }
		if(!dur) { dur = 250; }
	
		//create effect
		var effect = new Fx.Tween(this, {
			duration: dur,
			link: 'chain'
		})
	
		//do it!
		for(x = 1; x <= reps; x++)
		{
			effect.start(prop,from,to).start(prop,to,from);
		}
	}
});

function updateFeature(name, fieldId, language) {
	//active option selected
	var activeValue = document.id(fieldId).get('value');
	//ajax request
	var jSonRequest = new Request.JSON({
		url: 'index.php',
		onSuccess: function(response) {
			var first = document.id(fieldId).getFirst().clone();
			document.id(fieldId).empty();
			document.id(fieldId).adopt(first);
			if (response) {
				response.each(function(item) {
					var option  = new Element('option', {'value' :
item.id});
					// keep selected value if active value is found as a result
					if (activeValue == item.id) {
						option.setProperty('selected','selected');
					}
					option.appendText(item.value);
					document.id(fieldId).adopt(option);
				});
				jQuery('#'+fieldId).trigger('liszt:updated.chosen');
// Update jQuery choosen
			}
		}
	});
	jSonRequest.post({
		'option' : 'com_jea',
		'format' : 'json',
		'task' : 'features.get_list',
		'feature' : name,
		'language' : language
	});
};

function updateAmenities(language) {
	//active option selected
	var labels = document.getElements('.amenity');
	var checkedLabels = Array();
	//store active amenities & clear labels
	labels.each(function(label){
		var input = label.getElement('input');
		if (input.get('checked')) {
			checkedLabels.push(input.get('value'));
		} 
    });
	//remove current amenities
	document.id('amenities').empty();
	//ajax request
	var jSonRequest = new Request.JSON({
		url: 'index.php',
		onSuccess: function(response) {
			if (response) {
				response.each(function(item, idx) {
					//amenity li container
					var li = new Element('li.amenity');
					//generate the label
					var label = new Element('label', { 
						'text' : item.value,
						'for' : 'jform_amenities' + idx
					});
					//generate the input checkbox
					var checkbox  = new Element('input', {
						'name' : 'jform[amenities][]',
						'value' : item.id, 
						'type' : 'checkbox',
						'class' : 'am-input',
						'id' : 'jform_amenities' + idx
					});
					//hide checkbox. It will be enabled/disabled by clicking on parent div
					checkbox.setStyle('display','none');
					// keep selected value if it's found as a result
					if (checkedLabels.contains(item.id)) {
						checkbox.checked = 'checked';
						li.addClass('active');
					}
					//div click => toggle checkbox status
					li.addEvent('click', function(event) {
						if (checkbox.checked) {
							li.removeClass('active');
							checkbox.set('checked', false);
						}
						else {
							li.addClass('active');
							checkbox.set('checked', true);
						}
					});
					//add the content to the amenity div
					li.adopt(label);
					li.adopt(checkbox);
					document.id('amenities').adopt(li);
				});
			}
		}
	});
	jSonRequest.post({
		'option' : 'com_jea',
		'format' : 'json',
		'task' : 'features.get_list',
		'feature' : 'amenity',
		'language' : language
	});
}

function updateFeatures() {
	//language selected
	var language =
document.id('jform_language').get('value');
	//update
	updateFeature('type','jform_type_id',language);
	updateFeature('condition','jform_condition_id',language);
	updateFeature('heatingtype','jform_heating_type',language);
	updateFeature('hotwatertype','jform_hot_water_type',language);
	updateFeature('slogan','jform_slogan_id',language);
	updateAmenities(language);
}

window.addEvent('domready', function() {
	// colors
	var bgColor = '#F8E9E9';
	var borderColor = '#DE7A7B';

	document.id('ajaxupdating').setStyle('display','none');
	document.id('jform_language').addEvent('change',
function(event) {
		// show field alerts
		document.id('ajaxupdating').setStyle('display','');
		document.id('ajaxupdating').flash('#fff',bgColor,2,'background-color',500);
		document.id('jform_type_id').setStyle('border','1px
solid '+borderColor);
		document.id('jform_type_id').flash('#fff',bgColor,2,'background-color',500);
		document.id('jform_condition_id').setStyle('border','1px
solid '+borderColor);
		document.id('jform_condition_id').flash('#fff',bgColor,2,'background-color',500);
		document.id('jform_heating_type').setStyle('border','1px
solid '+borderColor);
		document.id('jform_heating_type').flash('#fff',bgColor,2,'background-color',500);
		document.id('jform_hot_water_type').setStyle('border','1px
solid '+borderColor);
		document.id('jform_hot_water_type').flash('#fff',bgColor,2,'background-color',500);
		document.id('jform_slogan_id').setStyle('border','1px
solid '+borderColor);
		document.id('jform_slogan_id').flash('#fff',bgColor,2,'background-color',500);
		document.id('amenities').setStyle('border','1px
solid '+borderColor);
		document.id('amenities').flash('#fff',bgColor,2,'background-color',500);
		// update dropdowns	
		updateFeatures();
	});
	//onload update dropdowns
	updateFeatures();
});
js/geoSearch.js000064400000006364151167223230007431 0ustar00var
JEAGeoSearch = new Class({

	Implements : [ Options ],

	mask : null,

	map : null,

	options : {
		opacity : 0.5,
		counterElement : '',
		defaultArea : '',
		Itemid : 0
	},

	initialize : function(content, options) {
		this.content = document.id(content);
		this.setOptions(options);
		this.mask = Class.empty;
		this.map = Class.empty;
	},

	refresh : function() {

		var params = this.getFilters();

		var kml =
'index.php?option=com_jea&task=properties.kml&format=xml';

		for (key in params) {
			kml += '&' + key + '=' + params[key];
		}
		kml += '&Itemid=' + this.options.Itemid;

		var mapOptions = {
			mapTypeId : google.maps.MapTypeId.ROADMAP
		};

		this.map = new google.maps.Map(this.content, mapOptions);
		this.applyMask();

		geoXml = new geoXML3.parser({
			map : this.map,
			afterParse : function(docSet) {

				// Count results
				var count = 0;

				docSet.each(function(doc) {
					if (!!doc.markers) {
						count += doc.markers.length;
					}
				});

				if (!count) {
					var geocoder = new google.maps.Geocoder();
					var opts = {
						address : this.options.defaultArea
					};
					geocoder.geocode(opts, function(results, status) {
						if (status == google.maps.GeocoderStatus.OK) {
							this.map.fitBounds(results[0].geometry.viewport);
						}
					}.bind(this));
				}

				if (document.id(this.options.counterElement)) {
					document.id(this.options.counterElement).set('text', count);
				}

				this.removeMask();

			}.bind(this)
		});

		geoXml.parse(kml);
	},

	getFilters : function () {
		
		var form = document.id(this.options.form);
		var filters = {};
		var fields = [ 
		'filter_type_id', 
		'filter_department_id',
		'filter_town_id', 
		'filter_area_id', 
		'filter_budget_min',
		'filter_budget_max', 
		'filter_living_space_min',
		'filter_living_space_max', 
		'filter_rooms_min' 
		];

		if (form) {

			var transTypes =
document.getElements('[name=filter_transaction_type]');
			if (transTypes.length > 1) {
				transTypes.each(function(item) {
					if (item.get('checked')) {
						filters['filter_transaction_type'] =
item.get('value');
					}
				});
			} else if (transTypes.length == 1) {
				filters['filter_transaction_type'] =
transTypes[0].get('value');
			}

			fields.each(function(field) {
				var inputfield =
document.getElement('[name='+field+']');
				if (inputfield) {
					if (inputfield.get('value') > 0) {
						filters[field] = inputfield.get('value');
					}
				}
			});

			if (form['filter_amenities[]']) {
				var amenities =
document.getElements('[name=filter_amenities[]]');
				amenities.each(function(item, i) {
					if (item.get('checked')) {
						filters['filter_amenities[' + i + ']'] =
item.get('value');
					}
				});
			}
		}

		return filters;
	},
	

	applyMask : function() {
		this.mask = new Element('div');
		this.mask.set('class', 'google-map-mask')
		this.mask.setStyles({
			'position' : 'absolute',
			'width' : this.content.getStyle('width'),
			'height' : this.content.getStyle('height'),
			'z-index' : '9999'
		});

		this.content.appendChild(this.mask);
		this.myFx = new Fx.Tween(this.mask, {
			property : 'opacity'
		}).start(0, this.options.opacity);
	},

	removeMask : function() {
		this.myFx.start(this.options.opacity, 0);
		if (this.mask.parentNode) {
			this.mask.destroy();
		}
	}

});
js/jquery-biSlider.js000064400000010255151167223230010575 0ustar00/*
Based on Mootools 1.1 Slider.js
Author : Sylvain Philip

License:
	MIT-style license.
*/

/*
Class: BiSlider
	Creates a slider with tree elements: two knobs and a container. Returns
the values.

Note:
	The Slider requires an XHTML doctype.

Arguments:
	element - the knobs container
	knobMin - the min handle
	knobMax - the max handle
	options - see Options below

Options:
	steps - the number of steps for your slider.
	mode - either 'horizontal' or 'vertical'. defaults to
horizontal.
	offset - relative offset for knob position. default to 0.

Events:
	onChange - a function to fire when the value changes.
	onComplete - a function to fire when you're done dragging.
	onTick - optionally, you can alter the onTick behavior, for example
displaying an effect of the knob moving to the desired position.
		Passes as parameter the new position.
*/

(function ($) {
	
	const capitalize = (s) => {
		if (typeof s !== 'string') return ''
		return s.charAt(0).toUpperCase() + s.slice(1)
	}
	
	var BiSlider = function(el, knobMin, knobMax, options) {
		
		this.options = $.extend({
			onChange: function(steps){},
			onComplete: function(step){},
			mode: 'horizontal',
			steps: 100,
			offset: 0
		}, options )
		
		this.element = $(el);
		this.element.css('position', 'relative');
		this.knobMin = $(knobMin);
		this.knobMax = $(knobMax);
		this.previousChange = -1;
		this.previousEnd = -1;
		this.step = -1;

		var mod, offset;

		switch(this.options.mode){
			case 'horizontal':
				this.z = 'x';
				this.p = 'left';
				mod = {'x': 'left', 'y': false};
				offset = 'offsetWidth';
				break;
			case 'vertical':
				this.z = 'y';
				this.p = 'top';
				mod = {'x': false, 'y': 'top'};
				offset = 'offsetHeight';
		}

		this.max = this.element[0][offset] - this.knobMin[0][offset] +
(this.options.offset * 2);
		
		this.half = this.knobMin[0][offset]/2;
		this.getPos = this.element[0]['offset' + capitalize(this.p)];
		
		this.knobMin.css('position', 'absolute').css(this.p,
- this.options.offset);
		this.knobMax.css('position', 'absolute').css(this.p,
this.max);

		this.KnobMinWidth = this.knobMin[0][offset] + (this.options.offset * 2);
		this.knobMaxWidth = this.knobMax[0][offset] + (this.options.offset * 2);
		
		this.stepMin = this.toStep(- this.options.offset);
		this.stepMax = this.toStep(this.max);

		var that = this
		
		this.knobMin.draggable({
			cancel: false,
			containment: 'parent',
			axis: 'x',
			drag: function(event, ui) {
				var maxPosition = that.knobMax.position()[that.p]
				var minPosition = ui.position[that.p]
				
				if (minPosition > maxPosition) {
					return false
				}
				
				that.draggedKnob('dragMin');
			},
			stop: function(event, ui) {
				that.draggedKnob('dragMin');
				that.end()
			}
		})
		
		this.knobMax.draggable({
			cancel: false,
			containment: 'parent',
			axis: 'x',
			drag: function(event, ui) {
				var maxPosition = ui.position[that.p]
				var minPosition = that.knobMin.position()[that.p]
				
				if (maxPosition < minPosition) {
					return false
				}
				that.draggedKnob('dragMax');
			},
			stop: function(event, ui) {
				that.draggedKnob('dragMax');
				that.end()
			}
		})
	}

	BiSlider.prototype.draggedKnob = function(knob) {
		var maxPosition = this.knobMax.position()[this.p]
		var minPosition = this.knobMin.position()[this.p]

		if (knob == 'dragMax') {
			this.step = this.toStep(maxPosition);
			this.stepMax = this.step;
		} else {
			this.step = this.toStep(minPosition);
			this.stepMin = this.step;
		}

		this.checkStep();
	}

	BiSlider.prototype.checkStep = function() {
		if (this.previousChange != this.step){
			this.previousChange = this.step;
			var steps = {
				current : this.step,
				minimum : this.stepMin,
				maximum : this.stepMax 
			};

			this.options.onChange(steps)
		}
	}

	BiSlider.prototype.end = function(){
		if (this.previousEnd !== this.step){
			this.previousEnd = this.step;
			this.options.onComplete(this.step)
		}
	}

	BiSlider.prototype.toStep = function(position){
		return Math.round((position + this.options.offset) / this.max *
this.options.steps)
	}

	$.fn.bislider = function(options) {
		return this.each(function() {
			var knobs = $(this).find('.knob')
			new BiSlider(this, knobs[0], knobs[1], options)
		})
	}

}(jQuery))

js/jquery-ui-draggable.min.js000064400000074021151167223230012146
0ustar00/*! jQuery UI - v1.12.1 - 2019-12-24
* http://jqueryui.com
* Includes: widget.js, data.js, scroll-parent.js, widgets/draggable.js,
widgets/mouse.js
* Copyright jQuery Foundation and other contributors; Licensed MIT */

(function(t){"function"==typeof
define&&define.amd?define(["jquery"],t):t(jQuery)})(function(t){t.ui=t.ui||{},t.ui.version="1.12.1";var
e=0,i=Array.prototype.slice;t.cleanData=function(e){return function(i){var
s,n,o;for(o=0;null!=(n=i[o]);o++)try{s=t._data(n,"events"),s&&s.remove&&t(n).triggerHandler("remove")}catch(a){}e(i)}}(t.cleanData),t.widget=function(e,i,s){var
n,o,a,r={},h=e.split(".")[0];e=e.split(".")[1];var
l=h+"-"+e;return
s||(s=i,i=t.Widget),t.isArray(s)&&(s=t.extend.apply(null,[{}].concat(s))),t.expr[":"][l.toLowerCase()]=function(e){return!!t.data(e,l)},t[h]=t[h]||{},n=t[h][e],o=t[h][e]=function(t,e){return
this._createWidget?(arguments.length&&this._createWidget(t,e),void
0):new
o(t,e)},t.extend(o,n,{version:s.version,_proto:t.extend({},s),_childConstructors:[]}),a=new
i,a.options=t.widget.extend({},a.options),t.each(s,function(e,s){return
t.isFunction(s)?(r[e]=function(){function t(){return
i.prototype[e].apply(this,arguments)}function n(t){return
i.prototype[e].apply(this,t)}return function(){var
e,i=this._super,o=this._superApply;return
this._super=t,this._superApply=n,e=s.apply(this,arguments),this._super=i,this._superApply=o,e}}(),void
0):(r[e]=s,void
0)}),o.prototype=t.widget.extend(a,{widgetEventPrefix:n?a.widgetEventPrefix||e:e},r,{constructor:o,namespace:h,widgetName:e,widgetFullName:l}),n?(t.each(n._childConstructors,function(e,i){var
s=i.prototype;t.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete
n._childConstructors):i._childConstructors.push(o),t.widget.bridge(e,o),o},t.widget.extend=function(e){for(var
s,n,o=i.call(arguments,1),a=0,r=o.length;r>a;a++)for(s in
o[a])n=o[a][s],o[a].hasOwnProperty(s)&&void
0!==n&&(e[s]=t.isPlainObject(n)?t.isPlainObject(e[s])?t.widget.extend({},e[s],n):t.widget.extend({},n):n);return
e},t.widget.bridge=function(e,s){var
n=s.prototype.widgetFullName||e;t.fn[e]=function(o){var
a="string"==typeof o,r=i.call(arguments,1),h=this;return
a?this.length||"instance"!==o?this.each(function(){var
i,s=t.data(this,n);return"instance"===o?(h=s,!1):s?t.isFunction(s[o])&&"_"!==o.charAt(0)?(i=s[o].apply(s,r),i!==s&&void
0!==i?(h=i&&i.jquery?h.pushStack(i.get()):i,!1):void
0):t.error("no such method '"+o+"' for
"+e+" widget instance"):t.error("cannot call methods on
"+e+" prior to initialization; "+"attempted to call
method '"+o+"'")}):h=void
0:(r.length&&(o=t.widget.extend.apply(null,[o].concat(r))),this.each(function(){var
e=t.data(this,n);e?(e.option(o||{}),e._init&&e._init()):t.data(this,n,new
s(o,this))})),h}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(i,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=e++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),i),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var
e=this;this._destroy(),t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return
this.element},option:function(e,i){var
s,n,o,a=e;if(0===arguments.length)return
t.widget.extend({},this.options);if("string"==typeof
e)if(a={},s=e.split("."),e=s.shift(),s.length){for(n=a[e]=t.widget.extend({},this.options[e]),o=0;s.length-1>o;o++)n[s[o]]=n[s[o]]||{},n=n[s[o]];if(e=s.pop(),1===arguments.length)return
void 0===n[e]?null:n[e];n[e]=i}else{if(1===arguments.length)return void
0===this.options[e]?null:this.options[e];a[e]=i}return
this._setOptions(a),this},_setOptions:function(t){var e;for(e in
t)this._setOption(e,t[e]);return
this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var
i,s,n;for(i in
e)n=this.classesElementLookup[i],e[i]!==this.options.classes[i]&&n&&n.length&&(s=t(n.get()),this._removeClass(n,i),s.addClass(this._classes({element:s,keys:i,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return
this._setOptions({disabled:!1})},disable:function(){return
this._setOptions({disabled:!0})},_classes:function(e){function i(i,o){var
a,r;for(r=0;i.length>r;r++)a=n.classesElementLookup[i[r]]||t(),a=e.add?t(t.unique(a.get().concat(e.element.get()))):t(a.not(e.element).get()),n.classesElementLookup[i[r]]=a,s.push(i[r]),o&&e.classes[i[r]]&&s.push(e.classes[i[r]])}var
s=[],n=this;return
e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&i(e.keys.match(/\S+/g)||[],!0),e.extra&&i(e.extra.match(/\S+/g)||[]),s.join("
")},_untrackClassesElement:function(e){var
i=this;t.each(i.classesElementLookup,function(s,n){-1!==t.inArray(e.target,n)&&(i.classesElementLookup[s]=t(n.not(e.target).get()))})},_removeClass:function(t,e,i){return
this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return
this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s="boolean"==typeof
s?s:i;var n="string"==typeof
t||null===t,o={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s};return
o.element.toggleClass(this._classes(o),s),this},_on:function(e,i,s){var
n,o=this;"boolean"!=typeof
e&&(s=i,i=e,e=!1),s?(i=n=t(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),t.each(s,function(s,a){function
r(){return
e||o.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof
a?o[a]:a).apply(o,arguments):void 0}"string"!=typeof
a&&(r.guid=a.guid=a.guid||r.guid||t.guid++);var
h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+o.eventNamespace,c=h[2];c?n.on(l,c,r):i.on(l,r)})},_off:function(e,i){i=(i||"").split("
").join(this.eventNamespace+"
")+this.eventNamespace,e.off(i).off(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function
i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var
s=this;return
setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,s){var
n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n
in o)n in i||(i[n]=o[n]);return
this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof
n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof
n?i:n.effect||i:e;n=n||{},"number"==typeof
n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}}),t.widget,t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return
function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])}}),t.fn.scrollParent=function(e){var
i=this.css("position"),s="absolute"===i,n=e?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var
e=t(this);return
s&&"static"===e.css("position")?!1:n.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==i&&o.length?o:t(this[0].ownerDocument||document)},t.ui.ie=!!/msie
[\w.]+/.exec(navigator.userAgent.toLowerCase());var
s=!1;t(document).on("mouseup",function(){s=!1}),t.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input,
textarea, button, select,
option",distance:1,delay:0},_mouseInit:function(){var
e=this;this.element.on("mousedown."+this.widgetName,function(t){return
e._mouseDown(t)}).on("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void
0}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(e){if(!s){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=e;var
i=this,n=1===e.which,o="string"==typeof
this.options.cancel&&e.target.nodeName?t(e.target).closest(this.options.cancel).length:!1;return
n&&!o&&this._mouseCapture(e)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(e)!==!1,!this._mouseStarted)?(e.preventDefault(),!0):(!0===t.data(e.target,this.widgetName+".preventClickEvent")&&t.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return
i._mouseMove(t)},this._mouseUpDelegate=function(t){return
i._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),s=!0,!0)):!0}},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button)return
this._mouseUp(e);if(!e.which)if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else
if(!this.ignoreMissingWhich)return
this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete
this._mouseDelayTimer),this.ignoreMissingWhich=!1,s=!1,e.preventDefault()},_mouseDistanceMet:function(t){return
Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return
this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),t.ui.plugin={add:function(e,i,s){var
n,o=t.ui[e].prototype;for(n in
s)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([i,s[n]])},call:function(t,e,i,s){var
n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;o.length>n;n++)t.options[o[n][0]]&&o[n][1].apply(t.element,i)}},t.ui.safeActiveElement=function(t){var
e;try{e=t.activeElement}catch(i){e=t.body}return
e||(e=t.body),e.nodeName||(e=t.body),e},t.ui.safeBlur=function(e){e&&"body"!==e.nodeName.toLowerCase()&&t(e).trigger("blur")},t.widget("ui.draggable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(t,e){this._super(t,e),"handle"===t&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void
0):(this._removeHandleClassName(),this._mouseDestroy(),void
0)},_mouseCapture:function(e){var i=this.options;return
this.helper||i.disabled||t(e.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(e),this.handle?(this._blurActiveElement(e),this._blockFrames(i.iframeFix===!0?"iframe":i.iframeFix),!0):!1)},_blockFrames:function(e){this.iframeBlocks=this.document.find(e).map(function(){var
e=t(this);return
t("<div>").css("position","absolute").appendTo(e.parent()).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete
this.iframeBlocks)},_blurActiveElement:function(e){var
i=t.ui.safeActiveElement(this.document[0]),s=t(e.target);s.closest(i).length||t.ui.safeBlur(i)},_mouseStart:function(e){var
i=this.options;return
this.helper=this._createHelper(e),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===t(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(e),this.originalPosition=this.position=this._generatePosition(e,!1),this.originalPageX=e.pageX,this.originalPageY=e.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",e)===!1?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(e,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var
s=this._uiHash();if(this._trigger("drag",e,s)===!1)return
this._mouseUp(new
t.Event("mouseup",e)),!1;this.position=s.position}return
this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var
i=this,s=!1;return
t.ui.ddmanager&&!this.options.dropBehaviour&&(s=t.ui.ddmanager.drop(this,e)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",e)!==!1&&i._clear()}):this._trigger("stop",e)!==!1&&this._clear(),!1},_mouseUp:function(e){return
this._unblockFrames(),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),this.handleElement.is(e.target)&&this.element.trigger("focus"),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return
this.helper.is(".ui-draggable-dragging")?this._mouseUp(new
t.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(e){return
this.options.handle?!!t(e.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(e){var
i=this.options,s=t.isFunction(i.helper),n=s?t(i.helper.apply(this.element[0],[e])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return
n.parents("body").length||n.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s&&n[0]===this.element[0]&&this._setPositionRelative(),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(e){"string"==typeof
e&&(e=e.split("
")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in
e&&(this.offset.click.left=e.left+this.margins.left),"right"in
e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in
e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in
e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_isRootNode:function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var
e=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var
t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(e?0:this.scrollParent.scrollTop()),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(e?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var
e,i,s,n=this.options,o=this.document[0];return
this.relativeContainer=null,n.containment?"window"===n.containment?(this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void
0):"document"===n.containment?(this.containment=[0,0,t(o).width()-this.helperProportions.width-this.margins.left,(t(o).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void
0):n.containment.constructor===Array?(this.containment=n.containment,void
0):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=t(n.containment),s=i[0],s&&(e=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(e?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i),void
0):(this.containment=null,void
0)},_convertPositionTo:function(t,e){e||(e=this.position);var
i="absolute"===t?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(t,e){var
i,s,n,o,a=this.options,r=this._isRootNode(this.scrollParent[0]),h=t.pageX,l=t.pageY;return
r&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),e&&(this.containment&&(this.relativeContainer?(s=this.relativeContainer.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,t.pageX-this.offset.click.left<i[0]&&(h=i[0]+this.offset.click.left),t.pageY-this.offset.click.top<i[1]&&(l=i[1]+this.offset.click.top),t.pageX-this.offset.click.left>i[2]&&(h=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),a.grid&&(n=a.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/a.grid[1])*a.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-a.grid[1]:n+a.grid[1]:n,o=a.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/a.grid[0])*a.grid[0]:this.originalPageX,h=i?o-this.offset.click.left>=i[0]||o-this.offset.click.left>i[2]?o:o-this.offset.click.left>=i[0]?o-a.grid[0]:o+a.grid[0]:o),"y"===a.axis&&(h=this.originalPageX),"x"===a.axis&&(l=this.originalPageY)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(e,i,s){return
s=s||this._uiHash(),t.ui.plugin.call(this,e,[i,s,this],!0),/^(drag|start|stop)/.test(e)&&(this.positionAbs=this._convertPositionTo("absolute"),s.offset=this.positionAbs),t.Widget.prototype._trigger.call(this,e,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i,s){var
n=t.extend({},i,{item:s.element});s.sortables=[],t(s.options.connectToSortable).each(function(){var
i=t(this).sortable("instance");i&&!i.options.disabled&&(s.sortables.push(i),i.refreshPositions(),i._trigger("activate",e,n))})},stop:function(e,i,s){var
n=t.extend({},i,{item:s.element});s.cancelHelperRemoval=!1,t.each(s.sortables,function(){var
t=this;t.isOver?(t.isOver=0,s.cancelHelperRemoval=!0,t.cancelHelperRemoval=!1,t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")},t._mouseStop(e),t.options.helper=t.options._helper):(t.cancelHelperRemoval=!0,t._trigger("deactivate",e,n))})},drag:function(e,i,s){t.each(s.sortables,function(){var
n=!1,o=this;o.positionAbs=s.positionAbs,o.helperProportions=s.helperProportions,o.offset.click=s.offset.click,o._intersectsWith(o.containerCache)&&(n=!0,t.each(s.sortables,function(){return
this.positionAbs=s.positionAbs,this.helperProportions=s.helperProportions,this.offset.click=s.offset.click,this!==o&&this._intersectsWith(this.containerCache)&&t.contains(o.element[0],this.element[0])&&(n=!1),n})),n?(o.isOver||(o.isOver=1,s._parent=i.helper.parent(),o.currentItem=i.helper.appendTo(o.element).data("ui-sortable-item",!0),o.options._helper=o.options.helper,o.options.helper=function(){return
i.helper[0]},e.target=o.currentItem[0],o._mouseCapture(e,!0),o._mouseStart(e,!0,!0),o.offset.click.top=s.offset.click.top,o.offset.click.left=s.offset.click.left,o.offset.parent.left-=s.offset.parent.left-o.offset.parent.left,o.offset.parent.top-=s.offset.parent.top-o.offset.parent.top,s._trigger("toSortable",e),s.dropped=o.element,t.each(s.sortables,function(){this.refreshPositions()}),s.currentItem=s.element,o.fromOutside=s),o.currentItem&&(o._mouseDrag(e),i.position=o.position)):o.isOver&&(o.isOver=0,o.cancelHelperRemoval=!0,o.options._revert=o.options.revert,o.options.revert=!1,o._trigger("out",e,o._uiHash(o)),o._mouseStop(e,!0),o.options.revert=o.options._revert,o.options.helper=o.options._helper,o.placeholder&&o.placeholder.remove(),i.helper.appendTo(s._parent),s._refreshOffsets(e),i.position=s._generatePosition(e,!0),s._trigger("fromSortable",e),s.dropped=!1,t.each(s.sortables,function(){this.refreshPositions()}))})}}),t.ui.plugin.add("draggable","cursor",{start:function(e,i,s){var
n=t("body"),o=s.options;n.css("cursor")&&(o._cursor=n.css("cursor")),n.css("cursor",o.cursor)},stop:function(e,i,s){var
n=s.options;n._cursor&&t("body").css("cursor",n._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,i,s){var
n=t(i.helper),o=s.options;n.css("opacity")&&(o._opacity=n.css("opacity")),n.css("opacity",o.opacity)},stop:function(e,i,s){var
n=s.options;n._opacity&&t(i.helper).css("opacity",n._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(t,e,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(e,i,s){var
n=s.options,o=!1,a=s.scrollParentNotHidden[0],r=s.document[0];a!==r&&"HTML"!==a.tagName?(n.axis&&"x"===n.axis||(s.overflowOffset.top+a.offsetHeight-e.pageY<n.scrollSensitivity?a.scrollTop=o=a.scrollTop+n.scrollSpeed:e.pageY-s.overflowOffset.top<n.scrollSensitivity&&(a.scrollTop=o=a.scrollTop-n.scrollSpeed)),n.axis&&"y"===n.axis||(s.overflowOffset.left+a.offsetWidth-e.pageX<n.scrollSensitivity?a.scrollLeft=o=a.scrollLeft+n.scrollSpeed:e.pageX-s.overflowOffset.left<n.scrollSensitivity&&(a.scrollLeft=o=a.scrollLeft-n.scrollSpeed))):(n.axis&&"x"===n.axis||(e.pageY-t(r).scrollTop()<n.scrollSensitivity?o=t(r).scrollTop(t(r).scrollTop()-n.scrollSpeed):t(window).height()-(e.pageY-t(r).scrollTop())<n.scrollSensitivity&&(o=t(r).scrollTop(t(r).scrollTop()+n.scrollSpeed))),n.axis&&"y"===n.axis||(e.pageX-t(r).scrollLeft()<n.scrollSensitivity?o=t(r).scrollLeft(t(r).scrollLeft()-n.scrollSpeed):t(window).width()-(e.pageX-t(r).scrollLeft())<n.scrollSensitivity&&(o=t(r).scrollLeft(t(r).scrollLeft()+n.scrollSpeed)))),o!==!1&&t.ui.ddmanager&&!n.dropBehaviour&&t.ui.ddmanager.prepareOffsets(s,e)}}),t.ui.plugin.add("draggable","snap",{start:function(e,i,s){var
n=s.options;s.snapElements=[],t(n.snap.constructor!==String?n.snap.items||":data(ui-draggable)":n.snap).each(function(){var
e=t(this),i=e.offset();this!==s.element[0]&&s.snapElements.push({item:this,width:e.outerWidth(),height:e.outerHeight(),top:i.top,left:i.left})})},drag:function(e,i,s){var
n,o,a,r,h,l,c,u,d,p,f=s.options,m=f.snapTolerance,g=i.offset.left,v=g+s.helperProportions.width,_=i.offset.top,b=_+s.helperProportions.height;for(d=s.snapElements.length-1;d>=0;d--)h=s.snapElements[d].left-s.margins.left,l=h+s.snapElements[d].width,c=s.snapElements[d].top-s.margins.top,u=c+s.snapElements[d].height,h-m>v||g>l+m||c-m>b||_>u+m||!t.contains(s.snapElements[d].item.ownerDocument,s.snapElements[d].item)?(s.snapElements[d].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[d].item})),s.snapElements[d].snapping=!1):("inner"!==f.snapMode&&(n=m>=Math.abs(c-b),o=m>=Math.abs(u-_),a=m>=Math.abs(h-v),r=m>=Math.abs(l-g),n&&(i.position.top=s._convertPositionTo("relative",{top:c-s.helperProportions.height,left:0}).top),o&&(i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top),a&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h-s.helperProportions.width}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l}).left)),p=n||o||a||r,"outer"!==f.snapMode&&(n=m>=Math.abs(c-_),o=m>=Math.abs(u-b),a=m>=Math.abs(h-g),r=m>=Math.abs(l-v),n&&(i.position.top=s._convertPositionTo("relative",{top:c,left:0}).top),o&&(i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top),a&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l-s.helperProportions.width}).left)),!s.snapElements[d].snapping&&(n||o||a||r||p)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[d].item})),s.snapElements[d].snapping=n||o||a||r||p)}}),t.ui.plugin.add("draggable","stack",{start:function(e,i,s){var
n,o=s.options,a=t.makeArray(t(o.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});a.length&&(n=parseInt(t(a[0]).css("zIndex"),10)||0,t(a).each(function(e){t(this).css("zIndex",n+e)}),this.css("zIndex",n+a.length))}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,i,s){var
n=t(i.helper),o=s.options;n.css("zIndex")&&(o._zIndex=n.css("zIndex")),n.css("zIndex",o.zIndex)},stop:function(e,i,s){var
n=s.options;n._zIndex&&t(i.helper).css("zIndex",n._zIndex)}}),t.ui.draggable});js/admin/gallery.js000064400000002632151167223230010252
0ustar00/**
 * This file is part of Joomla Estate Agency - Joomla! extension for real
estate
 * agency
 * 
 * @copyright Copyright (C) 2008 - 2020 PHILIP Sylvain. All rights
reserved.
 * @license GNU/GPL, see LICENSE.txt
 */

window.addEvent('domready', function() {
	var sortOptions = {
		transition: Fx.Transitions.Back.easeInOut,
		duration: 700,
		mode: 'vertical',
		onComplete: function() {
			mySort.rearrangeDOM()
		}
	};

	var mySort = new Fx.Sort($$('ul.gallery li'), sortOptions);

	$$('a.delete-img').each(function(item) {
		item.addEvent('click', function() {
		this.getParent('li').destroy();
		mySort = new Fx.Sort($$('ul.gallery li'), sortOptions);
		});
	});

	$$('a.img-move-up').each(function(item) {
		item.addEvent('click', function() {
			var activeLi = this.getParent('li');
			if (activeLi.getPrevious()) {
				mySort.swap(activeLi, activeLi.getPrevious());
			} else if (this.getParent('ul').getChildren().length > 1 )
{
				// Swap with the last element
				mySort.swap(activeLi,
this.getParent('ul').getLast('li'));
			}
		});
	});

	$$('a.img-move-down').each(function(item) {
		item.addEvent('click', function() {
		var activeLi = this.getParent('li');
			if (activeLi.getNext()) {
				mySort.swap(activeLi, activeLi.getNext());
			} else if (this.getParent('ul').getChildren().length > 1 )
{
				// Swap with the first element
				mySort.swap(activeLi,
this.getParent('ul').getFirst('li'));
			}
		});
	});

});
js/admin/gateway.js000064400000007754151167223230010266 0ustar00/**
 * This file is part of Joomla Estate Agency - Joomla! extension for real
estate
 * agency
 * 
 * @copyright Copyright (C) 2008 - 2020 PHILIP Sylvain. All rights
reserved.
 * @license GNU/GPL, see LICENSE.txt
 */

var JeaGateway = {

	startExport : function (gatewayId, gatewayTitle, webConsole) {

		var requestParams = {
			option: 'com_jea',
			format: 'json',
			task: 'gateway.export',
			id: gatewayId
		}
		
		var startMessage =
Joomla.JText._('COM_JEA_EXPORT_START_MESSAGE').replace('%s',
gatewayTitle)
	
		var startLine = webConsole.appendLine({text: startMessage})
	
		jQuery.getJSON( "index.php", requestParams)
			.done(function( json ) {
				
				if (json.error) {
					jQuery(startLine).addClass('error');
					jQuery(startLine).text('> ' + json.error);
					return;
				}
				
				var endMessage = Joomla.JText._('COM_JEA_EXPORT_END_MESSAGE')
					.replace('%s', gatewayTitle)
					.replace('%d', json.exported_properties)
				
				if (json.ftp_sent) {
					endMessage += ' ' +
Joomla.JText._('COM_JEA_GATEWAY_FTP_TRANSFERT_SUCCESS')
				}
	
				endMessage += ' <a href="' + json.zip_url
+'">' +
Joomla.JText._('COM_JEA_GATEWAY_DOWNLOAD_ZIP') +
'</a>'
	
				jQuery(startLine).html('> ' + endMessage)
				
				jQuery(document).trigger('gatewayActionDone');
			})
			.fail(function( jqxhr, textStatus, error ) {
				var err = textStatus + ", " + error
				jQuery(line).addClass('error');
				jQuery(line).text('> ' + "Request Failed: " +
err)
			});
	},

	startImport : function(gatewayId, gatewayTitle, webConsole) {
		var startMessage =
Joomla.JText._('COM_JEA_IMPORT_START_MESSAGE').replace('%s',
gatewayTitle)

		var startLine = webConsole.appendLine({text: startMessage})
		var progressbar = webConsole.addProgressBar('import_bar_' +
gatewayId);

		webConsole.addPlaceHolder('properties_found_'   + gatewayId);
		webConsole.addPlaceHolder('properties_updated_' + gatewayId);
		webConsole.addPlaceHolder('properties_created_' + gatewayId);
		webConsole.addPlaceHolder('properties_removed_' + gatewayId);

		JeaGateway.importRequest(gatewayId, gatewayTitle, startLine, webConsole);
	},

	importRequest : function(gatewayId, gatewayTitle, startLine, webConsole) {

		var requestParams = {
			option: 'com_jea',
			format: 'json',
			task: 'gateway.import',
			id: gatewayId
		}

		jQuery.getJSON( "index.php", requestParams)
			.done(function(response) {

				if (response.error) {
					jQuery(startLine).addClass('error');
					jQuery(startLine).text('> ' + response.error);
					return;
				}

				if (response.total == 0) {
					jQuery(startLine).text('> ' + 'Aucun bien à
importer.');
					return;
				}

				var progressbar = webConsole.getProgressBar('import_bar_'+
gatewayId);

				if (progressbar.step == 0) {
					webConsole.getPlaceHolder('properties_found_' +
gatewayId).empty().html(Joomla.JText._('COM_JEA_GATEWAY_PROPERTIES_FOUND').replace('%s',
response.total));
					progressbar.options.steps = response.total;
				}

				webConsole.getPlaceHolder('properties_updated_' +
gatewayId).empty()
					.html(Joomla.JText._('COM_JEA_GATEWAY_PROPERTIES_UPDATED').replace('%s',
response.updated));
				webConsole.getPlaceHolder('properties_created_' +
gatewayId).empty()
					.html(Joomla.JText._('COM_JEA_GATEWAY_PROPERTIES_CREATED').replace('%s',
response.created));
				webConsole.getPlaceHolder('properties_removed_' +
gatewayId).empty()
					.html(Joomla.JText._('COM_JEA_GATEWAY_PROPERTIES_DELETED').replace('%s',
response.removed));

				progressbar.setStep(response.imported);

				if (response.total == response.imported) {
					var endMessage =
Joomla.JText._('COM_JEA_IMPORT_END_MESSAGE').replace('%s',
gatewayTitle)
					jQuery(startLine).html('> ' + endMessage)
					jQuery(document).trigger('gatewayActionDone')
					return;
				}

				// Recursive
				JeaGateway.importRequest(gatewayId, gatewayTitle, startLine,
webConsole)
			})
			.fail(function( jqxhr, textStatus, error ) {
				var err = textStatus + ", " + error
				jQuery(startLine).addClass('error');
				jQuery(startLine).text('> ' + "Request Failed: "
+ err)
			});
	}

}

js/geoxml3.js000064400000234325151167223230007107 0ustar00/**
 * @fileOverview Renders KML on the Google Maps JavaScript API Version 3
 * @name GeoXML3
 * @author Sterling Udell, Larry Ross, Brendan Byrd
 * @see http://code.google.com/p/geoxml3/
 *
 * geoxml3.js
 *
 * Renders KML on the Google Maps JavaScript API Version 3
 * http://code.google.com/p/geoxml3/
 *
 * Copyright 2010 Sterling Udell, Larry Ross
 *
 * Licensed under the Apache License, Version 2.0 (the
"License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS"
BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */
/**
 * A MultiGeometry object that will allow multiple polylines in a
MultiGeometry
 * containing LineStrings to be treated as a single object
 *
 * @param {MutiGeometryOptions} anonymous object.  Available properties:
 * map: The map on which to attach the MultiGeometry
 * paths: the individual polylines
 * polylineOptions: options to use when constructing all the polylines
 *
 * @constructor
 */
// only if Google Maps API included
if (!!window.google && !! google.maps) { 
function MultiGeometry(multiGeometryOptions) {
   function createPolyline(polylineOptions, mg) {
     var polyline = new google.maps.Polyline(polylineOptions);
     google.maps.event.addListener(polyline,'click',
function(evt) { google.maps.event.trigger(mg,'click',evt);});
     google.maps.event.addListener(polyline,'dblclick',
function(evt) { google.maps.event.trigger(mg, 'dblclick',
evt);});
     google.maps.event.addListener(polyline,'mousedown',
function(evt) { google.maps.event.trigger(mg, 'mousedown',
evt);});
     google.maps.event.addListener(polyline,'mousemove',
function(evt) { google.maps.event.trigger(mg, 'mousemove',
evt);});
     google.maps.event.addListener(polyline,'mouseout',
function(evt) { google.maps.event.trigger(mg, 'mouseout',
evt);});
     google.maps.event.addListener(polyline,'mouseover',
function(evt) { google.maps.event.trigger(mg, 'mouseover',
evt);});
     google.maps.event.addListener(polyline,'mouseup',
function(evt) { google.maps.event.trigger(mg, 'mouseup', evt);});
     google.maps.event.addListener(polyline,'rightclick',
function(evt) { google.maps.event.trigger(mg, 'rightclick',
evt);});
     return polyline;
   }
   this.setValues(multiGeometryOptions);
   this.polylines = [];

   for (i=0; i<this.paths.length;i++) {
     var polylineOptions = multiGeometryOptions;
     polylineOptions.path = this.paths[i];
     var polyline = createPolyline(polylineOptions,this);
     // Bind the polyline properties to the MultiGeometry properties
     this.polylines.push(polyline);
   }
}
MultiGeometry.prototype = new google.maps.MVCObject();
MultiGeometry.prototype.changed = function(key) {
    // alert(key+" changed");
    if (this.polylines) {
	for (var i=0; i<this.polylines.length; i++) {
	    this.polylines[i].set(key,this.get(key));
	}
    }
};
MultiGeometry.prototype.setMap = function(map) {
this.set('map',map); };
MultiGeometry.prototype.getMap = function() { return
this.get('map'); };
}

// Extend the global String object with a method to remove leading and
trailing whitespace
if (!String.prototype.trim) {
/**
 * Remove leading and trailing whitespace.
 *
 * @augments String
 * @return {String}
 */
  String.prototype.trim = function () {
    return this.replace(/^\s+|\s+$/g, '');
  };
}

/**
 * @namespace The GeoXML3 namespace.
 */
geoXML3 = window.geoXML3 || {instances: []};

/**
 * Constructor for the root KML parser object.
 *
 * <p>All top-level objects and functions are declared under a
namespace of geoXML3.
 * The core object is geoXML3.parser; typically, you'll instantiate a
one parser
 * per map.</p>
 *
 * @class Main XML parser.
 * @param {geoXML3.parserOptions} options
 */
geoXML3.parser = function (options) {
  // Inherit from Google MVC Object to include event handling   
  google.maps.MVCObject.call(this);   

  // Private variables
  var parserOptions = new geoXML3.parserOptions(options);
  var docs        = [];  // Individual KML documents
  var docsByUrl   = {};  // Same docs as an hash by cleanURL
  var kmzMetaData = {};  // Extra files from KMZ data
  var styles      = {};  // Global list of styles
  var lastPlacemark;
  var parserName;
  if (!parserOptions.infoWindow && parserOptions.singleInfoWindow)
    parserOptions.infoWindow = new google.maps.InfoWindow();

  var parseKmlString = function (kmlString, docSet) {
    // Internal values for the set of documents as a whole
    var internals = {
      parser: this,
      docSet: docSet || [],
      remaining: 1,
      parseOnly: !(parserOptions.afterParse || parserOptions.processStyles)
    };
    thisDoc = new Object();
    thisDoc.internals = internals;
    internals.docSet.push(thisDoc);
    render(geoXML3.xmlParse(kmlString),thisDoc);
  }

  var parse = function (urls, docSet) {
    // Process one or more KML documents
    if (!parserName) {
      parserName = 'geoXML3.instances[' +
(geoXML3.instances.push(this) - 1) + ']';
    }

    if (typeof urls === 'string') {
      // Single KML document
      urls = [urls];
    }

    // Internal values for the set of documents as a whole
    var internals = {
      parser: this,
      docSet: docSet || [],
      remaining: urls.length,
      parseOnly: !(parserOptions.afterParse || parserOptions.processStyles)
    };
    var thisDoc, j;
    for (var i = 0; i < urls.length; i++) {
      var baseUrl = cleanURL(defileURL(location.pathname), urls[i]);
      if (docsByUrl[baseUrl]) {
        // Reloading an existing document
        thisDoc = docsByUrl[baseUrl];
        thisDoc.reload = true;
      }
      else {
        thisDoc = new Object();
        thisDoc.baseUrl = baseUrl;
        internals.docSet.push(thisDoc);
      }
      thisDoc.url       = urls[i];
      thisDoc.internals = internals;
      fetchDoc(thisDoc.url, thisDoc);
    }
  };

  function fetchDoc(url, doc, resFunc) {
    resFunc = resFunc || function (responseXML) { render(responseXML, doc);
};

    if (typeof ZipFile === 'function' && typeof JSIO ===
'object' && typeof JSIO.guessFileType ===
'function') {  // KMZ support requires these modules loaded
      // if url is a data URI scheme, do not guess type based on extension.
      if (/^data:[^,]*(kmz)/.test(doc.baseUrl)) {
         contentType = JSIO.FileType.Binary;
      } else if (/^data:[^,]*(kml|xml)/.test(doc.baseUrl)) {
         contentType = JSIO.FileType.XML;
      } else if (/^data:/.test(doc.baseUrl)) {
         contentType = JSIO.FileType.Unknown;
      } else if (parserOptions.forceZip) {	
         contentType = JSIO.FileType.Binary;
      } else {
         contentType = JSIO.guessFileType(doc.baseUrl);
      }
      if (contentType == JSIO.FileType.Binary || contentType ==
JSIO.FileType.Unknown) {
         doc.isCompressed = true;
         doc.baseDir = doc.baseUrl + '/';
         geoXML3.fetchZIP(url, resFunc, doc.internals.parser);
         return;
      }
    }
    doc.isCompressed = false;
    doc.baseDir = defileURL(doc.baseUrl);
    geoXML3.fetchXML(url, resFunc);
  }

  var hideDocument = function (doc) {
    if (!doc) doc = docs[0];
    // Hide the map objects associated with a document
    var i;
    if (!!doc.markers) {
      for (i = 0; i < doc.markers.length; i++) {
        if(!!doc.markers[i].infoWindow) doc.markers[i].infoWindow.close();
        doc.markers[i].setVisible(false);
      }
    }
    if (!!doc.ggroundoverlays) {
      for (i = 0; i < doc.ggroundoverlays.length; i++) {
        doc.ggroundoverlays[i].setOpacity(0);
      }
    }
    if (!!doc.gpolylines) {
      for (i=0;i<doc.gpolylines.length;i++) {
        if(!!doc.gpolylines[i].infoWindow)
doc.gpolylines[i].infoWindow.close();
        doc.gpolylines[i].setMap(null);
      }
    }
    if (!!doc.gpolygons) {
      for (i=0;i<doc.gpolygons.length;i++) {
        if(!!doc.gpolygons[i].infoWindow)
doc.gpolygons[i].infoWindow.close();
        doc.gpolygons[i].setMap(null);
      }
    }
  };

  var showDocument = function (doc) {
    if (!doc) doc = docs[0];
    // Show the map objects associated with a document
    var i;
    if (!!doc.markers) {
      for (i = 0; i < doc.markers.length; i++) {
        doc.markers[i].setVisible(true);
      }
    }
    if (!!doc.ggroundoverlays) {
      for (i = 0; i < doc.ggroundoverlays.length; i++) {
       
doc.ggroundoverlays[i].setOpacity(doc.ggroundoverlays[i].percentOpacity_);
      }
    }
    if (!!doc.gpolylines) {
      for (i=0;i<doc.gpolylines.length;i++) {
        doc.gpolylines[i].setMap(parserOptions.map);
      }
    }
    if (!!doc.gpolygons) {
      for (i=0;i<doc.gpolygons.length;i++) {
        doc.gpolygons[i].setMap(parserOptions.map);
      }
    }
  };

  var defaultStyle = {
    balloon: {
      bgColor:   'ffffffff',
      textColor: 'ff000000',
      text:
"<h3>$[name]</h3>\n<div>$[description]</div>\n<div>$[geDirections]</div>",
      displayMode: 'default'
    },
    icon: {
      scale: 1.0,
      dim: {
        x: 0,
        y: 0,
        w: -1,
        h: -1
      },
      hotSpot: {
        x: 0.5,
        y: 0.5,
        xunits: 'fraction',
        yunits: 'fraction'
      }
    },
    line: {
      color: 'ffffffff', // white (KML default)
      colorMode: 'normal',
      width: 1.0
    },
    poly: {
      color: 'ffffffff', // white (KML default)
      colorMode: 'normal',
      fill: true,
      outline: true
    }
  };

  var kmlNS = 'http://www.opengis.net/kml/2.2';
  var gxNS  = 'http://www.google.com/kml/ext/2.2';
  var nodeValue              = geoXML3.nodeValue;
  var getBooleanValue        = geoXML3.getBooleanValue;
  var getElementsByTagNameNS = geoXML3.getElementsByTagNameNS;
  var getElementsByTagName   = geoXML3.getElementsByTagName;

function processStyleUrl(node) {
  var styleUrlStr = nodeValue(getElementsByTagName(node,
'styleUrl')[0]);
  if (!!styleUrlStr && styleUrlStr.indexOf('#') != -1) 
    var styleUrl = styleUrlStr.split('#');
  else var styleUrl = ["",""];
  return styleUrl;
}

  function processStyle(thisNode, baseUrl, styleID, baseDir) {
    var style = (baseUrl === '{inline}') ? clone(defaultStyle) :
(styles[baseUrl][styleID] = styles[baseUrl][styleID] ||
clone(defaultStyle));

    var styleNodes = getElementsByTagName(thisNode,
'BalloonStyle');
    if (!!styleNodes && styleNodes.length > 0) {
      style.balloon.bgColor     =
nodeValue(getElementsByTagName(styleNodes[0], 'bgColor')[0],    
style.balloon.bgColor);
      style.balloon.textColor   =
nodeValue(getElementsByTagName(styleNodes[0], 'textColor')[0],  
style.balloon.textColor);
      style.balloon.text        =
nodeValue(getElementsByTagName(styleNodes[0], 'text')[0],       
style.balloon.text);
      style.balloon.displayMode =
nodeValue(getElementsByTagName(styleNodes[0], 'displayMode')[0],
style.balloon.displayMode);
    }

    // style.list = (unsupported; doesn't make sense in Google Maps)

    var styleNodes = getElementsByTagName(thisNode, 'IconStyle');
    if (!!styleNodes && styleNodes.length > 0) {
      var icon = style.icon;

      icon.scale = parseFloat(nodeValue(getElementsByTagName(styleNodes[0],
'scale')[0], icon.scale));
      // style.icon.heading   = (unsupported; not supported in API)
      // style.icon.color     = (unsupported; not supported in API)
      // style.icon.colorMode = (unsupported; not supported in API)

      styleNodes = getElementsByTagName(styleNodes[0],
'hotSpot');
      if (!!styleNodes && styleNodes.length > 0) {
        icon.hotSpot = {
          x:      styleNodes[0].getAttribute('x'),
          y:      styleNodes[0].getAttribute('y'),
          xunits: styleNodes[0].getAttribute('xunits'),
          yunits: styleNodes[0].getAttribute('yunits')
        };
      }

      styleNodes = getElementsByTagName(thisNode, 'Icon');
      if (!!styleNodes && styleNodes.length > 0) {
        icon.href = nodeValue(getElementsByTagName(styleNodes[0],
'href')[0]);
        icon.url  = cleanURL(baseDir, icon.href);
        // Detect images buried in KMZ files (and use a base64 encoded URL)
        if (kmzMetaData[icon.url]) icon.url =
kmzMetaData[icon.url].dataUrl;

        // Support for icon palettes and exact size dimensions
        icon.dim = {
          x: parseInt(nodeValue(getElementsByTagNameNS(styleNodes[0], gxNS,
'x')[0], icon.dim.x)),
          y: parseInt(nodeValue(getElementsByTagNameNS(styleNodes[0], gxNS,
'y')[0], icon.dim.y)),
          w: parseInt(nodeValue(getElementsByTagNameNS(styleNodes[0], gxNS,
'w')[0], icon.dim.w)),
          h: parseInt(nodeValue(getElementsByTagNameNS(styleNodes[0], gxNS,
'h')[0], icon.dim.h))
        };

        // certain occasions where we need the pixel size of the image
(like the default settings...)
        // (NOTE: Scale is applied to entire image, not just the section of
the icon palette.  So,
        //  if we need scaling, we'll need the img dimensions no
matter what.)
        if (true /* (icon.dim.w < 0 || icon.dim.h < 0) &&
(icon.xunits != 'pixels' || icon.yunits == 'fraction')
|| icon.scale != 1.0 */) {
          // (hopefully, this will load by the time we need it...)
          icon.img = new Image();
          icon.img.onload = function() {
            if (icon.dim.w < 0 || icon.dim.h < 0) {
              icon.dim.w = this.width;
              icon.dim.h = this.height;
            } else {
              icon.dim.th = this.height;
            }
          };
          icon.img.src = icon.url;

          // sometimes the file is already cached and it never calls onLoad
          if (icon.img.width > 0) {
            if (icon.dim.w < 0 || icon.dim.h < 0) {
             icon.dim.w = icon.img.width;
             icon.dim.h = icon.img.height;
            } else {
             icon.dim.th = icon.img.height;
            }
          }
        }
      }
    }

    // style.label = (unsupported; may be possible but not with API)

    styleNodes = getElementsByTagName(thisNode, 'LineStyle');
    if (!!styleNodes && styleNodes.length > 0) {
      style.line.color     = nodeValue(getElementsByTagName(styleNodes[0],
'color')[0],     style.line.color);
      style.line.colorMode = nodeValue(getElementsByTagName(styleNodes[0],
'colorMode')[0], style.line.colorMode);
      style.line.width     = nodeValue(getElementsByTagName(styleNodes[0],
'width')[0],     style.line.width);
      // style.line.outerColor      = (unsupported; not supported in API)
      // style.line.outerWidth      = (unsupported; not supported in API)
      // style.line.physicalWidth   = (unsupported; unneccesary in Google
Maps)
      // style.line.labelVisibility = (unsupported; possible to implement)
    }

    styleNodes = getElementsByTagName(thisNode, 'PolyStyle');
    if (!!styleNodes && styleNodes.length > 0) {
      style.poly.color     = nodeValue(     
getElementsByTagName(styleNodes[0], 'color')[0],    
style.poly.color);
      style.poly.colorMode = nodeValue(     
getElementsByTagName(styleNodes[0], 'colorMode')[0],
style.poly.colorMode);
      style.poly.outline   =
getBooleanValue(getElementsByTagName(styleNodes[0],
'outline')[0],   style.poly.outline);
      style.poly.fill      =
getBooleanValue(getElementsByTagName(styleNodes[0], 'fill')[0],  
   style.poly.fill);
    }
    return style;
  }

  // from
http://stackoverflow.com/questions/122102/what-is-the-most-efficient-way-to-clone-a-javascript-object
  // http://keithdevens.com/weblog/archive/2007/Jun/07/javascript.clone
  function clone(obj){
    if(obj == null || typeof(obj) != 'object') return obj;
    if (obj.cloneNode) return obj.cloneNode(true);
    var temp = new obj.constructor();
    for(var key in obj) temp[key] = clone(obj[key]);
    return temp;
  }

  function processStyleMap(thisNode, baseUrl, styleID, baseDir) {
    var pairs = getElementsByTagName(thisNode, 'Pair');
    var map = new Object();

    // add each key to the map
    for (var pr=0;pr<pairs.length;pr++) {
      var pairKey      = nodeValue(getElementsByTagName(pairs[pr],
'key')[0]);
      var pairStyle    = nodeValue(getElementsByTagName(pairs[pr],
'Style')[0]);
      var pairStyleUrl = processStyleUrl(pairs[pr]);
      var pairStyleBaseUrl = pairStyleUrl[0] ? cleanURL(baseDir,
pairStyleUrl[0]) : baseUrl;
      var pairStyleID      = pairStyleUrl[1];

      if (!!pairStyle) {
        map[pairKey] = processStyle(pairStyle, pairStyleBaseUrl,
pairStyleID);
      } else if (!!pairStyleID &&
!!styles[pairStyleBaseUrl][pairStyleID]) {
        map[pairKey] = clone(styles[pairStyleBaseUrl][pairStyleID]);
      }
    }
    if (!!map["normal"]) {
      styles[baseUrl][styleID] = clone(map["normal"]);
    } else {
      styles[baseUrl][styleID] = clone(defaultStyle);
    }
    if (!!map["highlight"] &&
!!parserOptions.processStyles) {
      processStyleID(map["highlight"]);
    }
    styles[baseUrl][styleID].map = clone(map);
  }

  function processPlacemarkCoords(node, tag) {
    var parent = getElementsByTagName(node, tag);
    var coordListA = [];
    for (var i=0; i<parent.length; i++) {
      var coordNodes = getElementsByTagName(parent[i],
'coordinates');
      if (!coordNodes) {
        if (coordListA.length > 0) {
          break;
        } else {
          return [{coordinates: []}];
        }
      }

      for (var j=0; j<coordNodes.length;j++) {
        var coords = nodeValue(coordNodes[j]).trim();
        coords = coords.replace(/,\s+/g, ',');
        var path = coords.split(/\s+/g);
        var pathLength = path.length;
        var coordList = [];
        for (var k = 0; k < pathLength; k++) {
          coords = path[k].split(',');
          if (!isNaN(coords[0]) && !isNaN(coords[1])) {
            coordList.push({
              lat: parseFloat(coords[1]),
              lng: parseFloat(coords[0]),
              alt: parseFloat(coords[2])
            });
          }
        }
        coordListA.push({coordinates: coordList});
      }
    }
    return coordListA;
  }

  var render = function (responseXML, doc) {
    // Callback for retrieving a KML document: parse the KML and display it
on the map
    if (!responseXML || responseXML == "failed parse") {
      // Error retrieving the data
      geoXML3.log('Unable to retrieve ' + doc.url);
      if (parserOptions.failedParse) parserOptions.failedParse(doc);
      doc.failed = true;
      return;
    } else if (responseXML.parseError &&
responseXML.parseError.errorCode != 0) {
      // IE parse error
      var err = responseXML.parseError;
      var msg = 'Parse error in line ' + err.line + ', col
' + err.linePos + ' (error code: ' + err.errorCode +
")\n" +
        "\nError Reason: " + err.reason +
        'Error Line: ' + err.srcText;

      geoXML3.log('Unable to retrieve ' + doc.url + ':
' + msg);
      if (parserOptions.failedParse) parserOptions.failedParse(doc);
      doc.failed = true;
      return;
    } else if (responseXML.documentElement &&
responseXML.documentElement.nodeName == 'parsererror') {
      // Firefox parse error
      geoXML3.log('Unable to retrieve ' + doc.url + ':
' + responseXML.documentElement.childNodes[0].nodeValue);
      if (parserOptions.failedParse) parserOptions.failedParse(doc);
      doc.failed = true;
      return;
    } else if (!doc) {
      throw 'geoXML3 internal error: render called with null
document';
    } else { //no errors
      var i;
      doc.placemarks      = [];
      doc.groundoverlays  = [];
      doc.ggroundoverlays = [];
      doc.networkLinks    = [];
      doc.gpolygons       = [];
      doc.gpolylines      = [];

      // Check for dependent KML files
      var nodes = getElementsByTagName(responseXML, 'styleUrl');
      var docSet = doc.internals.docSet;

      for (var i = 0; i < nodes.length; i++) {
        var url = nodeValue(nodes[i]).split('#')[0];
        if (!url)                 continue;  // #id (inside doc)
        var rUrl = cleanURL( doc.baseDir, url );
        if (rUrl === doc.baseUrl) continue;  // self
        if (docsByUrl[rUrl])      continue;  // already loaded

        var thisDoc;
        var j = docSet.indexOfObjWithItem('baseUrl', rUrl);
        if (j != -1) {
          // Already listed to be loaded, but probably in the wrong order.
          // Load it right away to immediately resolve dependency.
          thisDoc = docSet[j];
          if (thisDoc.failed) continue;  // failed to load last time;
don't retry it again
        }
        else {
          // Not listed at all; add it in
          thisDoc           = new Object();
          thisDoc.url       = rUrl;  // url can't be trusted inside
KMZ files, since it may .. outside of the archive
          thisDoc.baseUrl   = rUrl;
          thisDoc.internals = doc.internals;

          doc.internals.docSet.push(thisDoc);
          doc.internals.remaining++;
        }

        // render dependent KML first then re-run renderer
        fetchDoc(rUrl, thisDoc, function (thisResXML) {
          render(thisResXML, thisDoc);
          render(responseXML, doc);
        });

        // to prevent cross-dependency issues, just load the one
        // file first and re-check the rest later
        return;
      }

      // Parse styles
      doc.styles = styles[doc.baseUrl] = styles[doc.baseUrl] || {};
      var styleID, styleNodes;
      nodes = getElementsByTagName(responseXML, 'Style');
      nodeCount = nodes.length;
      for (i = 0; i < nodeCount; i++) {
        thisNode = nodes[i];
        var styleID = thisNode.getAttribute('id');
        if (!!styleID) processStyle(thisNode, doc.baseUrl, styleID,
doc.baseDir);
      }
      // Parse StyleMap nodes
      nodes = getElementsByTagName(responseXML, 'StyleMap');
      for (i = 0; i < nodes.length; i++) {
        thisNode = nodes[i];
        var styleID = thisNode.getAttribute('id');
        if (!!styleID) processStyleMap(thisNode, doc.baseUrl, styleID,
doc.baseDir);
      }

      if (!!parserOptions.processStyles || !parserOptions.createMarker) {
        // Convert parsed styles into GMaps equivalents
        processStyles(doc);
      }

      // Parse placemarks
      if (!!doc.reload && !!doc.markers) {
        for (i = 0; i < doc.markers.length; i++) {
          doc.markers[i].active = false;
        }
      }
      var placemark, node, coords, path, marker, poly;
      var pathLength, marker, polygonNodes, coordList;
      var placemarkNodes = getElementsByTagName(responseXML,
'Placemark');
      for (pm = 0; pm < placemarkNodes.length; pm++) {
        // Init the placemark object
        node = placemarkNodes[pm];
        var styleUrl = processStyleUrl(node);
        placemark = {
          name:         nodeValue(getElementsByTagName(node,
'name')[0]),
          description:  nodeValue(getElementsByTagName(node,
'description')[0]),
          styleUrl:     styleUrl.join('#'),
          styleBaseUrl: styleUrl[0] ? cleanURL(doc.baseDir, styleUrl[0]) :
doc.baseUrl,
          styleID:      styleUrl[1],
          visibility:        getBooleanValue(getElementsByTagName(node,
'visibility')[0], true),
          balloonVisibility: getBooleanValue(getElementsByTagNameNS(node,
gxNS, 'balloonVisibility')[0],
!parserOptions.suppressInfoWindows),
          id:           node.getAttribute('id')
        };
        placemark.style = (styles[placemark.styleBaseUrl] &&
styles[placemark.styleBaseUrl][placemark.styleID]) || clone(defaultStyle);
        // inline style overrides shared style
        var inlineStyles = getElementsByTagName(node, 'Style');
        if (inlineStyles && (inlineStyles.length > 0)) {
          var style = processStyle(node, '{inline}',
'{inline}');
          processStyleID(style);
          if (style) placemark.style = style;
        }

        if (/^https?:\/\//.test(placemark.description)) {
          placemark.description = ['<a href="',
placemark.description, '">', placemark.description,
'</a>'].join('');
        }

        // record list of variables for substitution
        placemark.vars = {
          display: {
            name:         'Name',
            description:  'Description',
            address:      'Street Address',
            id:           'ID',
            Snippet:      'Snippet',
            geDirections: 'Directions'
          },
          val: {
            name:        placemark.name || '',
            description: placemark.description || '',
            address:     nodeValue(getElementsByTagName(node,
'address')[0], ''),
            id:          node.getAttribute('id') || '',
            Snippet:     nodeValue(getElementsByTagName(node,
'Snippet')[0], '')
          },
          directions: [
            'f=d',
            'source=GeoXML3'
          ]
        };

        // add extended data to variables
        var extDataNodes = getElementsByTagName(node,
'ExtendedData');
        if (!!extDataNodes && extDataNodes.length > 0) {
          var dataNodes = getElementsByTagName(extDataNodes[0],
'Data');
          for (var d = 0; d < dataNodes.length; d++) {
            var dn    = dataNodes[d];
            var name  = dn.getAttribute('name');
            if (!name) continue;
            var dName = nodeValue(getElementsByTagName(dn,
'displayName')[0], name);
            var val   = nodeValue(getElementsByTagName(dn,
'value')[0]);

            placemark.vars.val[name]     = val;
            placemark.vars.display[name] = dName;
          }
        }

        // process MultiGeometry
        var GeometryNodes = getElementsByTagName(node,
'coordinates');
        var Geometry = null;
        if (!!GeometryNodes && (GeometryNodes.length > 0)) {
          for (var gn=0;gn<GeometryNodes.length;gn++) {
            if (GeometryNodes[gn].parentNode &&
                GeometryNodes[gn].parentNode.nodeName) {
              var GeometryPN = GeometryNodes[gn].parentNode;
              Geometry = GeometryPN.nodeName;

              // Extract the coordinates
              // What sort of placemark?
              switch(Geometry) {
                case "Point":
                  placemark.Point = processPlacemarkCoords(node,
"Point")[0];
                  placemark.latlng = new
google.maps.LatLng(placemark.Point.coordinates[0].lat,
placemark.Point.coordinates[0].lng);
                  pathLength = 1;
                  break;
                case "LinearRing":
                  // Polygon/line
                  polygonNodes = getElementsByTagName(node,
'Polygon');
                  // Polygon
                  if (!placemark.Polygon)
                    placemark.Polygon = [{
                      outerBoundaryIs: {coordinates: []},
                      innerBoundaryIs: [{coordinates: []}]
                    }];
                  for (var pg=0;pg<polygonNodes.length;pg++) {
                     placemark.Polygon[pg] = {
                       outerBoundaryIs: {coordinates: []},
                       innerBoundaryIs: [{coordinates: []}]
                     }
                     placemark.Polygon[pg].outerBoundaryIs =
processPlacemarkCoords(polygonNodes[pg], "outerBoundaryIs");
                     placemark.Polygon[pg].innerBoundaryIs =
processPlacemarkCoords(polygonNodes[pg], "innerBoundaryIs");
                  }
                  coordList = placemark.Polygon[0].outerBoundaryIs;
                  break;

                case "LineString":
                  pathLength = 0;
                  placemark.LineString =
processPlacemarkCoords(node,"LineString");
                  break;

                default:
                  break;
              }
            }
          }
        }

	// parse MultiTrack/Track
        var TrackNodes =
getElementsByTagNameNS(node,gxNS,"Track");
        var coordListA = [];
        if (TrackNodes.length > 0) {  
          for (var i=0; i<TrackNodes.length; i++) {
            var coordNodes =
getElementsByTagNameNS(TrackNodes[i],gxNS,"coord");
            var coordList = [];
            for (var j=0; j<coordNodes.length;j++) { 
              var coords = geoXML3.nodeValue(coordNodes[j]).trim();
              coords = coords.split(/\s+/g);
              if (!isNaN(coords[0]) && !isNaN(coords[1])) {
                coordList.push({
                  lat: parseFloat(coords[1]), 
                  lng: parseFloat(coords[0]), 
                  alt: parseFloat(coords[2])
                });
              }
            }
	    coordListA.push({coordinates:coordList});
          }
          placemark.Track = coordListA;
        }
	      
        // call the custom placemark parse function if it is defined
        if (!!parserOptions.pmParseFn) parserOptions.pmParseFn(node,
placemark);
        doc.placemarks.push(placemark);

        // single marker
        if (placemark.Point) {
          if (!!google.maps) {
            doc.bounds = doc.bounds || new google.maps.LatLngBounds();
            doc.bounds.extend(placemark.latlng);
          }

          // Potential user-defined marker handler
          var pointCreateFunc = parserOptions.createMarker || createMarker;
          var found = false;
          if (!parserOptions.createMarker) {
            // Check to see if this marker was created on a previous load
of this document
            if (!!doc) {
              doc.markers = doc.markers || [];
              if (doc.reload) {
                for (var j = 0; j < doc.markers.length; j++) {
                    if ((doc.markers[j].id == placemark.id) ||
			// if no id, check position
                        (!doc.markers[j].id && 
                        
(doc.markers[j].getPosition().equals(placemark.latlng)))) {
                    found = doc.markers[j].active = true;
                    break;
                  }
                }
              }
            }
          }
          if (!found) {
            // Call the marker creator
            var marker = pointCreateFunc(placemark, doc);
            if (marker) { 
              marker.active = placemark.visibility;
              marker.id = placemark.id;
            }
          }
        }
        // polygon/line
        var poly, line;
        if (!!doc) {
          if (placemark.Polygon)    doc.gpolygons  = doc.gpolygons  || [];
          if (placemark.LineString) doc.gpolylines = doc.gpolylines || [];
          if (placemark.Track)      doc.gpolylines = doc.gpolylines || [];
        }

        var polyCreateFunc = parserOptions.createPolygon    ||
createPolygon;
        var lineCreateFunc = parserOptions.createLineString ||
createPolyline;
        if (placemark.Polygon) {
          poly = polyCreateFunc(placemark,doc);
          if (poly) poly.active = placemark.visibility;
        }
        if (placemark.LineString) {
          line = lineCreateFunc(placemark,doc);
          if (line) line.active = placemark.visibility;
        }
	if (placemark.Track) { // gx:Track polyline
          line = lineCreateFunc(placemark,doc);
          if (line) line.active = placemark.visibility;
        }
        if (!!google.maps) {
          doc.bounds = doc.bounds || new google.maps.LatLngBounds();
          if (poly) doc.bounds.union(poly.bounds);
          if (line) doc.bounds.union(line.bounds);
        }

      } // placemark loop

      if (!!doc.reload && !!doc.markers) {
        for (i = doc.markers.length - 1; i >= 0 ; i--) {
          if (!doc.markers[i].active) {
            if (!!doc.markers[i].infoWindow) {
              doc.markers[i].infoWindow.close();
            }
            doc.markers[i].setMap(null);
            doc.markers.splice(i, 1);
          }
        }
      }

      var overlayCreateFunc = parserOptions.createOverlay || createOverlay;
      // Parse ground overlays
      if (!!doc.reload && !!doc.groundoverlays) {
        for (i = 0; i < doc.groundoverlays.length; i++) {
          doc.groundoverlays[i].active = false;
        }
      }

      if (!!doc) {
        doc.groundoverlays = doc.groundoverlays || [];
      }
      // doc.groundoverlays =[];
      var groundOverlay, color, transparency, overlay;
      var groundNodes = getElementsByTagName(responseXML,
'GroundOverlay');
      for (i = 0; i < groundNodes.length; i++) {
        node = groundNodes[i];

        // Detect images buried in KMZ files (and use a base64 encoded URL)
        var gnUrl = cleanURL( doc.baseDir,
nodeValue(getElementsByTagName(node, 'href')[0]) );
        if (kmzMetaData[gnUrl]) gnUrl = kmzMetaData[gnUrl].dataUrl;

        // Init the ground overlay object
        groundOverlay = {
          name:        nodeValue(getElementsByTagName(node,
'name')[0]),
          description: nodeValue(getElementsByTagName(node,
'description')[0]),
          icon: { href: gnUrl },
          latLonBox: {
            north: parseFloat(nodeValue(getElementsByTagName(node,
'north')[0])),
            east:  parseFloat(nodeValue(getElementsByTagName(node,
'east')[0])),
            south: parseFloat(nodeValue(getElementsByTagName(node,
'south')[0])),
            west:  parseFloat(nodeValue(getElementsByTagName(node,
'west')[0]))
          },
          rotation: -1 * parseFloat(nodeValue(getElementsByTagName(node,
'rotation')[0]))
        };
        if (!!google.maps) {
          doc.bounds = doc.bounds || new google.maps.LatLngBounds();
          doc.bounds.union(new google.maps.LatLngBounds(
            new google.maps.LatLng(groundOverlay.latLonBox.south,
groundOverlay.latLonBox.west),
            new google.maps.LatLng(groundOverlay.latLonBox.north,
groundOverlay.latLonBox.east)
          ));
        }

        // Opacity is encoded in the color node
        var colorNode = getElementsByTagName(node, 'color');
        if (colorNode && colorNode.length > 0) {
          groundOverlay.opacity =
geoXML3.getOpacity(nodeValue(colorNode[0]));
        } else {
          groundOverlay.opacity = 1.0;  // KML default
        }

        doc.groundoverlays.push(groundOverlay);
        // Check to see if this overlay was created on a previous load of
this document
        var found = false;
        if (!!doc) {
          doc.groundoverlays = doc.groundoverlays || [];
          if (doc.reload) {
            overlayBounds = new google.maps.LatLngBounds(
              new google.maps.LatLng(groundOverlay.latLonBox.south,
groundOverlay.latLonBox.west),
              new google.maps.LatLng(groundOverlay.latLonBox.north,
groundOverlay.latLonBox.east)
            );
            var overlays = doc.groundoverlays;
            for (i = overlays.length; i--;) {
              if ((overlays[i].bounds().equals(overlayBounds)) &&
                  (overlays.url_ === groundOverlay.icon.href)) {
                found = overlays[i].active = true;
                break;
              }
            }
          }

          if (!found) {
            overlay = overlayCreateFunc(groundOverlay, doc);
            overlay.active = true;
          }
        }
        if (!!doc.reload && !!doc.groundoverlays &&
!!doc.groundoverlays.length) {
          var overlays = doc.groundoverlays;
          for (i = overlays.length; i--;) {
            if (!overlays[i].active) {
              overlays[i].remove();
              overlays.splice(i, 1);
            }
          }
          doc.groundoverlays = overlays;
        }
      }

      // Parse network links
      var networkLink;
      var docPath = document.location.pathname.split('/');
      docPath = docPath.splice(0, docPath.length - 1).join('/');
      var linkNodes = getElementsByTagName(responseXML,
'NetworkLink');
      for (i = 0; i < linkNodes.length; i++) {
        node = linkNodes[i];

        // Init the network link object
        networkLink = {
          name: nodeValue(getElementsByTagName(node, 'name')[0]),
          link: {
            href:        nodeValue(getElementsByTagName(node,
'href')[0]),
            refreshMode: nodeValue(getElementsByTagName(node,
'refreshMode')[0])
          }
        };

        // Establish the specific refresh mode
        if (!networkLink.link.refreshMode) {
          networkLink.link.refreshMode = 'onChange';
        }
        if (networkLink.link.refreshMode === 'onInterval') {
          networkLink.link.refreshInterval =
parseFloat(nodeValue(getElementsByTagName(node,
'refreshInterval')[0]));
          if (isNaN(networkLink.link.refreshInterval)) {
            networkLink.link.refreshInterval = 0;
          }
        } else if (networkLink.link.refreshMode === 'onChange') {
          networkLink.link.viewRefreshMode =
nodeValue(getElementsByTagName(node, 'viewRefreshMode')[0]);
          if (!networkLink.link.viewRefreshMode) {
            networkLink.link.viewRefreshMode = 'never';
          }
          if (networkLink.link.viewRefreshMode === 'onStop') {
            networkLink.link.viewRefreshTime =
nodeValue(getElementsByTagName(node, 'refreshMode')[0]);
            networkLink.link.viewFormat =     
nodeValue(getElementsByTagName(node, 'refreshMode')[0]);
            if (!networkLink.link.viewFormat) {
              networkLink.link.viewFormat =
'BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]';
            }
          }
        }

        if (!/^[\/|http]/.test(networkLink.link.href)) {
          // Fully-qualify the HREF
          networkLink.link.href = docPath + '/' +
networkLink.link.href;
        }

        // Apply the link
        if ((networkLink.link.refreshMode === 'onInterval')
&&
            (networkLink.link.refreshInterval > 0)) {
          // Reload at regular intervals
          setInterval(parserName + '.parse("' +
networkLink.link.href + '")',
                      1000 * networkLink.link.refreshInterval);
        } else if (networkLink.link.refreshMode === 'onChange') {
          if (networkLink.link.viewRefreshMode === 'never') {
            // Load the link just once
            doc.internals.parser.parse(networkLink.link.href,
doc.internals.docSet);
          } else if (networkLink.link.viewRefreshMode ===
'onStop') {
            // Reload when the map view changes

          }
        }
      }
    }

    if (!!doc.bounds) {
      doc.internals.bounds = doc.internals.bounds || new
google.maps.LatLngBounds();
      doc.internals.bounds.union(doc.bounds);
    }
    if (!!doc.markers || !!doc.groundoverlays || !!doc.gpolylines ||
!!doc.gpolygons) {
      doc.internals.parseOnly = false;
    }

    if (!doc.internals.parseOnly) {
      // geoXML3 is not being used only as a real-time parser, so keep the
processed documents around
      if (doc.baseUrl){ // handle case from parseKmlString (no doc.baseUrl)
        if (!docsByUrl[doc.baseUrl]) {
          docs.push(doc);
          docsByUrl[doc.baseUrl] = doc;
        } else {
          // internal replacement, which keeps the same memory ref loc in
docs and docsByUrl
          for (var i in docsByUrl[doc.baseUrl]) {
            docsByUrl[doc.baseUrl][i] = doc[i];
          }
        }
      }	  
    }

    doc.internals.remaining--;
    if (doc.internals.remaining === 0) {
      // We're done processing this set of KML documents
      // Options that get invoked after parsing completes
      if (parserOptions.zoom && !!doc.internals.bounds &&
	  !doc.internals.bounds.isEmpty() && !!parserOptions.map) {
        parserOptions.map.fitBounds(doc.internals.bounds);
      }
      if (parserOptions.afterParse) {
        parserOptions.afterParse(doc.internals.docSet);
      }
      google.maps.event.trigger(doc.internals.parser, 'parsed'); 
 
    }
  };

  var kmlColor = function (kmlIn, colorMode) {
    var kmlColor = {};
    kmlIn = kmlIn || 'ffffffff';  // white (KML 2.2 default)

    var aa = kmlIn.substr(0,2);
    var bb = kmlIn.substr(2,2);
    var gg = kmlIn.substr(4,2);
    var rr = kmlIn.substr(6,2);

    kmlColor.opacity = parseInt(aa, 16) / 256;
    kmlColor.color   = (colorMode === 'random') ? randomColor(rr,
gg, bb) : '#' + rr + gg + bb;
    return kmlColor;
  };

  // Implemented per KML 2.2 <ColorStyle> specs
  var randomColor = function(rr, gg, bb) {
    var col = { rr: rr, gg: gg, bb: bb };
    for (var k in col) {
      var v = col[k];
      if (v == null) v = 'ff';

      // RGB values are limiters for random numbers (ie: 7f would be a
random value between 0 and 7f)
      v = Math.round(Math.random() * parseInt(rr, 16)).toString(16);
      if (v.length === 1) v = '0' + v;
      col[k] = v;
    }

    return '#' + col.rr + col.gg + col.bb;
  };

  var processStyleID = function (style) {
    var icon = style.icon;
    if (!icon || !icon.href) return;

    if (icon.img && !icon.img.complete && (icon.dim.w <
0) && (icon.dim.h < 0) ) {
      // we're still waiting on the image loading (probably because
we've been blocking since the declaration)
      // so, let's queue this function on the onload stack
      icon.markerBacklog = [];
      icon.img.onload = function() {
        if (icon.dim.w < 0 || icon.dim.h < 0) {
          icon.dim.w = this.width;
          icon.dim.h = this.height;
        } else {
          icon.dim.th = this.height;
        }
        processStyleID(style);

        // we will undoubtedly get some createMarker queuing, so set this
up in advance
        for (var i = 0; i < icon.markerBacklog.length; i++) {
          var p = icon.markerBacklog[i][0];
          var d = icon.markerBacklog[i][1];
          createMarker(p, d);
          if (p.marker) p.marker.active = true;
        }
        delete icon.markerBacklog;
      };
      return;
    }
    else { //if (icon.dim.w < 0 || icon.dim.h < 0) {
      if (icon.img && icon.img.complete) {
        // sometimes the file is already cached and it never calls onLoad
        if (icon.dim.w < 0 || icon.dim.h < 0) {
        icon.dim.w = icon.img.width;
        icon.dim.h = icon.img.height;
        } else {
          icon.dim.th = icon.img.height;
        }
      }
      else {
        // settle for a default of 32x32
        icon.dim.whGuess = true;
        icon.dim.w = 32;
        icon.dim.h = 32;
        icon.dim.th = 32;
      }
    }

    // pre-scaled variables
    var rnd = Math.round;
    var y = icon.dim.y;
    if (typeof icon.dim.th !== 'undefined' && icon.dim.th
!= icon.dim.h) { // palette - reverse kml y for maps
      y = Math.abs(y - (icon.dim.th - icon.dim.h));
    }

    var scaled = {
      x: icon.dim.x     * icon.scale,
      y: y * icon.scale,
      w: icon.dim.w     * icon.scale,
      h: icon.dim.h     * icon.scale,
      aX:icon.hotSpot.x * icon.scale,
      aY:icon.hotSpot.y * icon.scale,
      iW:(icon.img ? icon.img.width  : icon.dim.w) * icon.scale,
      iH:(icon.img ? icon.img.height : icon.dim.h) * icon.scale
    };

    // Figure out the anchor spot
    // Origins, anchor positions and coordinates of the marker increase in
the X direction to the right and in
    // the Y direction down.
    var aX, aY;
    switch (icon.hotSpot.xunits) {
      case 'fraction':    aX = rnd(scaled.aX * icon.dim.w);
break;
      case 'insetPixels': aX = rnd(icon.dim.w * icon.scale -
scaled.aX); break;
      default:            aX = rnd(scaled.aX); break; // already pixels
    }
    switch(icon.hotSpot.yunits) {
      case 'fraction':    aY = scaled.h - rnd(icon.dim.h *
scaled.aY);   break;
      case 'insetPixels': aY = rnd(scaled.aY); break; 
      default:            aY = rnd(icon.dim.h * icon.scale - scaled.aY);
break;
    }
    var iconAnchor = new google.maps.Point(aX, aY);

    // Sizes
    // (NOTE: Scale is applied to entire image, not just the section of the
icon palette.)
    var iconSize   = icon.dim.whGuess  ? null : new
google.maps.Size(rnd(scaled.w),  rnd(scaled.h));
    var iconScale  = icon.scale == 1.0 ? null :
                     icon.dim.whGuess  ?        new
google.maps.Size(rnd(scaled.w),  rnd(scaled.h))
                                              : new
google.maps.Size(rnd(scaled.iW), rnd(scaled.iH));
    var iconOrigin = new google.maps.Point(rnd(scaled.x), rnd(scaled.y));

    // Detect images buried in KMZ files (and use a base64 encoded URL)
    if (kmzMetaData[icon.url]) icon.url = kmzMetaData[icon.url].dataUrl;

    // Init the style object with the KML icon
    icon.marker = {
      url: icon.url,        // url
      size: iconSize,       // size
      origin: iconOrigin,   // origin
      anchor: iconAnchor,   // anchor
      scaledSize: iconScale // scaledSize
    };

    // Look for a predictable shadow
    var stdRegEx =
/\/(red|blue|green|yellow|lightblue|purple|pink|orange)(-dot)?\.png/;
    var shadowSize = new google.maps.Size(59, 32);
    var shadowPoint = new google.maps.Point(16, 32);
    if (stdRegEx.test(icon.href)) {
      // A standard GMap-style marker icon
	icon.shadow = {
	  url:
'http://maps.google.com/mapfiles/ms/micons/msmarker.shadow.png',
// url
          size: shadowSize,    // size
          origin: null,        // origin
	  anchor: shadowPoint, // anchor
          scaledSize: shadowSize // scaledSize
	};
    } else if (icon.href.indexOf('-pushpin.png') > -1) {
      // Pushpin marker icon
      icon.shadow = {
	url:
'http://maps.google.com/mapfiles/ms/micons/pushpin_shadow.png', 
// url
        size: shadowSize,    // size
        origin: null,        // origin
        anchor: shadowPoint, // anchor
        scaledSize: shadowSize // scaledSize
      };
    } /* else {
      // Other MyMaps KML standard icon
      icon.shadow = new google.maps.MarkerImage(
        icon.href.replace('.png', '.shadow.png'),      
                 // url
        shadowSize,                                                      //
size
        null,                                                            //
origin
        anchorPoint,                                                     //
anchor
        shadowSize                                                       //
scaledSize
      );
    } */
  }

  var processStyles = function (doc) {
    for (var styleID in doc.styles) {
      processStyleID(doc.styles[styleID]);
    }
  };

  var createMarker = function (placemark, doc) {
    // create a Marker to the map from a placemark KML object
    var icon = placemark.style.icon;

    if ( !icon.marker && icon.img ) {
      // yay, single point of failure is holding up multiple markers...
      icon.markerBacklog = icon.markerBacklog || [];
      icon.markerBacklog.push([placemark, doc]);
      return;
    }

    // Load basic marker properties
    var markerOptions = geoXML3.combineOptions(parserOptions.markerOptions,
{
      map:      parserOptions.map,
      position: new google.maps.LatLng(placemark.Point.coordinates[0].lat,
placemark.Point.coordinates[0].lng),
      title:    placemark.name,
      zIndex:   Math.round(placemark.Point.coordinates[0].lat *
-100000)<<5,
      icon:     icon.marker,
      shadow:   icon.shadow,
      flat:     !icon.shadow,
      visible:  placemark.visibility
    });

    // Create the marker on the map
    var marker = new google.maps.Marker(markerOptions);
    if (!!doc) doc.markers.push(marker);

    // Set up and create the infowindow if it is not suppressed
    createInfoWindow(placemark, doc, marker);
    placemark.marker = marker;
    return marker;
  };

  var createOverlay = function (groundOverlay, doc) {
    // Add a ProjectedOverlay to the map from a groundOverlay KML object

    if (!window.ProjectedOverlay) {
      throw 'geoXML3 error: ProjectedOverlay not found while rendering
GroundOverlay from KML';
    }

    var bounds = new google.maps.LatLngBounds(
        new google.maps.LatLng(groundOverlay.latLonBox.south,
groundOverlay.latLonBox.west),
        new google.maps.LatLng(groundOverlay.latLonBox.north,
groundOverlay.latLonBox.east)
    );
    var overlayOptions =
geoXML3.combineOptions(parserOptions.overlayOptions, {
      percentOpacity: groundOverlay.opacity*100,
      rotation: groundOverlay.rotation
    });
    var overlay = new ProjectedOverlay(parserOptions.map,
groundOverlay.icon.href, bounds, overlayOptions);

    if (!!doc) {
      doc.ggroundoverlays = doc.ggroundoverlays || [];
      doc.ggroundoverlays.push(overlay);
    }

    return overlay;
  };

  // Create Polyline
  var createPolyline = function(placemark, doc) {
    var paths = [];
    var bounds = new google.maps.LatLngBounds();
    if (placemark.LineString) {
      for (var j=0; j<placemark.LineString.length; j++) {
        var path = [];
        var coords = placemark.LineString[j].coordinates;
        for (var i=0;i<coords.length;i++) {
          var pt = new google.maps.LatLng(coords[i].lat, coords[i].lng);
          path.push(pt);
          bounds.extend(pt);
        }
        paths.push(path);
      }
    } else if (placemark.Track) {
      for (var j=0; j<placemark.Track.length; j++) {
        var path = [];
        var coords = placemark.Track[j].coordinates;
        for (var i=0;i<coords.length;i++) {
          var pt = new google.maps.LatLng(coords[i].lat, coords[i].lng);
          path.push(pt);
          bounds.extend(pt);
        }
        paths.push(path);
      }
    }
    // point to open the infowindow if triggered
    var point = paths[0][Math.floor(path.length/2)];
    // Load basic polyline properties
    var kmlStrokeColor = kmlColor(placemark.style.line.color,
placemark.style.line.colorMode);
    var polyOptions = geoXML3.combineOptions(parserOptions.polylineOptions,
{
      map:           parserOptions.map,
      path:          path,
      strokeColor:   kmlStrokeColor.color,
      strokeWeight:  placemark.style.line.width,
      strokeOpacity: kmlStrokeColor.opacity,
      title:         placemark.name,
      visible:       placemark.visibility
    });
    if (paths.length > 1) {
      polyOptions.paths = paths;
      var p = new MultiGeometry(polyOptions);
    } else {
      polyOptions.path = paths[0];
      var p = new google.maps.Polyline(polyOptions);
    }
    p.bounds = bounds;

    // setup and create the infoWindow if it is not suppressed
    createInfoWindow(placemark, doc, p);
    if (!!doc) doc.gpolylines.push(p);
    placemark.polyline = p;
    return p;
  }

  // Create Polygon
  var createPolygon = function(placemark, doc) {
    var bounds = new google.maps.LatLngBounds();
    var pathsLength = 0;
    var paths = [];
    for (var
polygonPart=0;polygonPart<placemark.Polygon.length;polygonPart++) {
      for (var j=0;
j<placemark.Polygon[polygonPart].outerBoundaryIs.length; j++) {
        var coords =
placemark.Polygon[polygonPart].outerBoundaryIs[j].coordinates;
        var path = [];
        for (var i=0;i<coords.length;i++) {
          var pt = new google.maps.LatLng(coords[i].lat, coords[i].lng);
          path.push(pt);
          bounds.extend(pt);
        }
        paths.push(path);
        pathsLength += path.length;
      }
      for (var j=0;
j<placemark.Polygon[polygonPart].innerBoundaryIs.length; j++) {
        var coords =
placemark.Polygon[polygonPart].innerBoundaryIs[j].coordinates;
        var path = [];
        for (var i=0;i<coords.length;i++) {
          var pt = new google.maps.LatLng(coords[i].lat, coords[i].lng);
          path.push(pt);
          bounds.extend(pt);
        }
        paths.push(path);
        pathsLength += path.length;
      }
    }

    // Load basic polygon properties
    var kmlStrokeColor = kmlColor(placemark.style.line.color,
placemark.style.line.colorMode);
    var kmlFillColor = kmlColor(placemark.style.poly.color,
placemark.style.poly.colorMode);
    if (!placemark.style.poly.fill) kmlFillColor.opacity = 0.0;
    var strokeWeight = placemark.style.line.width;
    if (!placemark.style.poly.outline) {
      strokeWeight = 0;
      kmlStrokeColor.opacity = 0.0;
    }
    var polyOptions = geoXML3.combineOptions(parserOptions.polygonOptions,
{
      map:           parserOptions.map,
      paths:         paths,
      title:         placemark.name,
      strokeColor:   kmlStrokeColor.color,
      strokeWeight:  strokeWeight,
      strokeOpacity: kmlStrokeColor.opacity,
      fillColor:     kmlFillColor.color,
      fillOpacity:   kmlFillColor.opacity,
      visible:       placemark.visibility
    });
    var p = new google.maps.Polygon(polyOptions);
    p.bounds = bounds;

    createInfoWindow(placemark, doc, p);
    if (!!doc) doc.gpolygons.push(p);
    placemark.polygon = p;
    return p;
  }

  var createInfoWindow = function(placemark, doc, gObj) {
    var bStyle = placemark.style.balloon;
    var vars = placemark.vars;

    if (!placemark.balloonVisibility || bStyle.displayMode ===
'hide') return;

    // define geDirections 
    if (placemark.latlng && 
        (!parserOptions.suppressDirections ||
!parserOptions.suppressDirections)) {
      vars.directions.push('sll=' +
placemark.latlng.toUrlValue());

      var url = 'http://maps.google.com/maps?' +
vars.directions.join('&');
      var address = encodeURIComponent( vars.val.address ||
placemark.latlng.toUrlValue() ).replace(/\%20/g, '+');

      vars.val.geDirections = '<a href="' + url +
'&daddr=' + address + '" target=_blank>To
Here</a> - <a href="' + url + '&saddr=' +
address + '" target=_blank>From Here</a>';
    }
    else vars.val.geDirections = '';

    // add in the variables
    var iwText = bStyle.text.replace(/\$\[(\w+(\/displayName)?)\]/g,
function(txt, n, dn) { return dn ? vars.display[n] : vars.val[n]; });
    var classTxt = 'geoxml3_infowindow geoxml3_style_' +
placemark.styleID;

    // color styles
    var styleArr = [];
    if (bStyle.bgColor   != 'ffffffff')
styleArr.push('background: ' + kmlColor(bStyle.bgColor  ).color +
';');
    if (bStyle.textColor != 'ff000000')
styleArr.push('color: '      + kmlColor(bStyle.textColor).color +
';');
    var styleProp = styleArr.length ? ' style="' +
styleArr.join(' ') + '"' : '';

    var infoWindowOptions =
geoXML3.combineOptions(parserOptions.infoWindowOptions, {
      content: '<div class="' + classTxt +
'"' + styleProp + '>' + iwText +
'</div>',
      pixelOffset: new google.maps.Size(0, 2)
    });

    gObj.infoWindow = parserOptions.infoWindow || new
google.maps.InfoWindow(infoWindowOptions);
    gObj.infoWindowOptions = infoWindowOptions;

    // Info Window-opening event handler
    google.maps.event.addListener(gObj, 'click', function(e) {
      var iW = this.infoWindow;
      iW.close();
      iW.setOptions(this.infoWindowOptions);

      if      (e && e.latLng) iW.setPosition(e.latLng);
      else if (this.bounds)   iW.setPosition(this.bounds.getCenter());

      iW.setContent("<div
id='geoxml3_infowindow'>"+iW.getContent()+"</div>");
      google.maps.event.addListenerOnce(iW, "domready",
function() {
        var node = document.getElementById('geoxml3_infowindow');
        var imgArray = node.getElementsByTagName('img');
        for (var i = 0; i < imgArray.length; i++) 
        {
          var imgUrlIE = imgArray[i].getAttribute("src");
          var imgUrl  = cleanURL(doc.baseDir, imgUrlIE);

          if (kmzMetaData[imgUrl]) {
             imgArray[i].src = kmzMetaData[imgUrl].dataUrl;
          } else if (kmzMetaData[imgUrlIE]) {
             imgArray[i].src = kmzMetaData[imgUrlIE].dataUrl;
          }
        }
      });
      iW.open(this.map, this.bounds ? null : this);
    });

  }

  return {
    // Expose some properties and methods

    options:     parserOptions,
    docs:        docs,
    docsByUrl:   docsByUrl,
    kmzMetaData: kmzMetaData,

    parse:          parse,
    render:         render,
    parseKmlString: parseKmlString,
    hideDocument:   hideDocument,
    showDocument:   showDocument,
    processStyles:  processStyles,
    createMarker:   createMarker,
    createOverlay:  createOverlay,
    createPolyline: createPolyline,
    createPolygon:  createPolygon
  };
};
// End of KML Parser

// Helper objects and functions
geoXML3.getOpacity = function (kmlColor) {
  // Extract opacity encoded in a KML color value. Returns a number between
0 and 1.
  if (!!kmlColor &&
      (kmlColor !== '') &&
      (kmlColor.length == 8)) {
    var transparency = parseInt(kmlColor.substr(0, 2), 16);
    return transparency / 255;
  } else {
    return 1;
  }
};

// Log a message to the debugging console, if one exists
geoXML3.log = function(msg) {
  if (!!window.console) {
    console.log(msg);
  } else { alert("log:"+msg); }
};

/**
 * Creates a new parserOptions object.
 * @class GeoXML3 parser options.
 * @param {Object} overrides Any options you want to declare outside of the
defaults should be included here.
 * @property {google.maps.Map} map The API map on which geo objects should
be rendered.
 * @property {google.maps.MarkerOptions} markerOptions If the parser is
adding Markers to the map itself, any options specified here will be
applied to them.
 * @property {google.maps.InfoWindowOptions} infoWindowOptions If the
parser is adding Markers to the map itself, any options specified here will
be applied to their attached InfoWindows.
 * @property {ProjectedOverlay.options} overlayOptions If the parser is
adding ProjectedOverlays to the map itself, any options specified here will
be applied to them.
 */
geoXML3.parserOptions = function (overrides) {
  this.map                 = null,
  /** If true, the parser will automatically move the map to a best-fit of
the geodata after parsing of a KML document completes.
   * @type Boolean
   * @default true
   */
  this.zoom                = true,
  /**#@+ @type Boolean
   *     @default false */
  /** If true, only a single Marker created by the parser will be able to
have its InfoWindow open at once (simulating the behavior of GMaps API v2).
*/
  this.singleInfoWindow    = false,
  /** If true, suppresses the rendering of info windows. */
  this.suppressInfoWindows = false,
  /**
   * Control whether to process styles now or later.
   *
   * <p>By default, the parser only processes KML
&lt;Style&gt; elements into their GMaps equivalents
   * if it will be creating its own Markers (the createMarker option is
null). Setting this option
   * to true will force such processing to happen anyway, useful if
you're going to be calling parser.createMarker
   * yourself later. OTOH, leaving this option false removes runtime
dependency on the GMaps API, enabling
   * the use of geoXML3 as a standalone KML parser.</p>
   */
  this.processStyles       = false,
  /**#@-*/

  this.markerOptions       = {},
  this.infoWindowOptions   = {},
  this.overlayOptions      = {},

  /**#@+ @event */
  /** This function will be called when parsing of a KML document is
complete.
   * @param {geoXML3.parser#docs} doc Parsed KML data. */
  this.afterParse          = null,
  /** This function will be called when parsing of a KML document is
complete.
   * @param {geoXML3.parser#docs} doc Parsed KML data. */
  this.failedParse         = null,
  /**
   * If supplied, this function will be called once for each marker
<Placemark> in the KML document, instead of the parser adding its own
Marker to the map.
   * @param {geoXML3.parser.render#placemark} placemark Placemark object.
   * @param {geoXML3.parser#docs} doc Parsed KML data.
   */
  this.createMarker        = null,
  /**
   * If supplied, this function will be called once for each
<GroundOverlay> in the KML document, instead of the parser adding its
own ProjectedOverlay to the map.
   * @param {geoXML3.parser.render#groundOverlay} groundOverlay
GroundOverlay object.
   * @param {geoXML3.parser#docs} doc Parsed KML data.
   */
  this.createOverlay       = null
  /**#@-*/

  if (overrides) {
    for (var prop in overrides) {
      if (overrides.hasOwnProperty(prop)) this[prop] = overrides[prop];
    }
  }
  return this;
};

/**
 * Combine two options objects: a set of default values and a set of
override values.
 *
 * @deprecated This has been replaced with {@link
geoXML3.parserOptions#combineOptions}.
 * @param {geoXML3.parserOptions|Object} overrides Override values.
 * @param {geoXML3.parserOptions|Object} defaults Default values.
 * @return {geoXML3.parserOptions} Combined result.
 */
geoXML3.combineOptions = function (overrides, defaults) {
  var result = {};
  if (!!overrides) {
    for (var prop in overrides) {
      if (overrides.hasOwnProperty(prop))                             
result[prop] = overrides[prop];
    }
  }
  if (!!defaults) {
    for (prop in defaults) {
      if (defaults.hasOwnProperty(prop) && result[prop] ===
undefined) result[prop] = defaults[prop];
    }
  }
  return result;
};

/**
 * Combine two options objects: a set of default values and a set of
override values.
 *
 * @function
 * @param {geoXML3.parserOptions|Object} overrides Override values.
 * @param {geoXML3.parserOptions|Object} defaults Default values.
 * @return {geoXML3.parserOptions} Combined result.
 */
geoXML3.parserOptions.prototype.combineOptions = geoXML3.combineOptions;

// Retrieve an XML document from url and pass it to callback as a DOM
document
geoXML3.fetchers = [];

/**
 * Parses a XML string.
 *
 * <p>Parses the given XML string and returns the parsed document in
a
 * DOM data structure. This function will return an empty DOM node if
 * XML parsing is not supported in this browser.</p>
 *
 * @param {String} str XML string.
 * @return {Element|Document} DOM.
 */
geoXML3.xmlParse = function (str) {
  if ((typeof ActiveXObject != 'undefined') ||
("ActiveXObject" in window)) {
    var doc = new ActiveXObject('Microsoft.XMLDOM');
    doc.loadXML(str);
    return doc;
  }

  if (typeof DOMParser != 'undefined') {
    return (new DOMParser()).parseFromString(str, 'text/xml');
  }

  return document.createElement('div', null);
}

/**
 * Checks for XML parse error.
 *
 * @param {xmlDOM} XML DOM.
 * @return boolean.
 */
// from
http://stackoverflow.com/questions/11563554/how-do-i-detect-xml-parsing-errors-when-using-javascripts-domparser-in-a-cross
geoXML3.isParseError = function(parsedDocument) {
    if ((typeof ActiveXObject != 'undefined') ||
("ActiveXObject" in window))
	return false;
    // parser and parsererrorNS could be cached on startup for efficiency
    var p = new DOMParser(),
        errorneousParse = p.parseFromString('<',
'text/xml'),
        parsererrorNS =
errorneousParse.getElementsByTagName("parsererror")[0].namespaceURI;

    if (parsererrorNS === 'http://www.w3.org/1999/xhtml') {
        // In PhantomJS the parseerror element doesn't seem to have a
special namespace, so we are just guessing here :(
        return
parsedDocument.getElementsByTagName("parsererror").length > 0;
    }

    return parsedDocument.getElementsByTagNameNS(parsererrorNS,
'parsererror').length > 0;
};

/**
 * Fetches a XML document.
 *
 * <p>Fetches/parses the given XML URL and passes the parsed document
(in a
 * DOM data structure) to the given callback.  Documents are downloaded
 * and parsed asynchronously.</p>
 *
 * @param {String} url URL of XML document.  Must be uncompressed XML only.
 * @param {Function(Document)} callback Function to call when the document
is processed.
 */
geoXML3.fetchXML = function (url, callback) {
  function timeoutHandler() { callback(); };

  var xhrFetcher = new Object();
  if      (!!geoXML3.fetchers.length) xhrFetcher = geoXML3.fetchers.pop();
  else if (!!window.XMLHttpRequest)   xhrFetcher.fetcher = new
window.XMLHttpRequest();  // Most browsers
  else if (!!window.ActiveXObject) {                                       
             // Some IE
    // the many versions of IE's XML fetchers
    var AXOs = [
      'MSXML2.XMLHTTP.6.0',
      'MSXML2.XMLHTTP.5.0',
      'MSXML2.XMLHTTP.4.0',
      'MSXML2.XMLHTTP.3.0',
      'MSXML2.XMLHTTP',
      'Microsoft.XMLHTTP',
      'MSXML.XMLHTTP'
    ];
    for (var i = 0; i < AXOs.length; i++) {
      try      { xhrFetcher.fetcher = new ActiveXObject(AXOs[i]); break; }
      catch(e) { continue; }
    }
    if (!xhrFetcher.fetcher) {
      geoXML3.log('Unable to create XHR object');
      callback(null);
      return null;
    }
  }

  xhrFetcher.fetcher.open('GET', url, true);
  if (!!xhrFetcher.fetcher.overrideMimeType)
xhrFetcher.fetcher.overrideMimeType('text/xml');
  xhrFetcher.fetcher.onreadystatechange = function () {
    if (xhrFetcher.fetcher.readyState === 4) {
      // Retrieval complete
      if (!!xhrFetcher.xhrtimeout) clearTimeout(xhrFetcher.xhrtimeout);
      if (xhrFetcher.fetcher.status >= 400) {
        geoXML3.log('HTTP error ' + xhrFetcher.fetcher.status +
' retrieving ' + url);
        callback();
      }
      // Returned successfully
      else {
       if (xhrFetcher.fetcher.responseXML) {
        // Sometimes IE will get the data, but won't bother loading it
as an XML doc
        var xml = xhrFetcher.fetcher.responseXML;
        if (xml && !xml.documentElement &&
!xml.ownerElement) {
         xml.loadXML(xhrFetcher.fetcher.responseText);
        }
       } else {// handle valid xml sent with wrong MIME type 
        xml=geoXML3.xmlParse(xhrFetcher.fetcher.responseText);
       }
       // handle parse errors
       if (xml.parseError && (xml.parseError.errorCode != 0)) {
        geoXML3.log("XML parse error
"+xml.parseError.errorCode+",
"+xml.parseError.reason+"\nLine:"+xml.parseError.line+",
Position:"+xml.parseError.linepos+",
srcText:"+xml.parseError.srcText);
        xml = "failed parse"
       } else if (geoXML3.isParseError(xml)) {
        geoXML3.log("XML parse error");
        xml = "failed parse"
       }
       callback(xml);          
      }
      // We're done with this fetcher object
      geoXML3.fetchers.push(xhrFetcher);
    }
  };

  xhrFetcher.xhrtimeout = setTimeout(timeoutHandler, 60000);
  xhrFetcher.fetcher.send(null);
  return null;
};

var IEversion = function() {
  //
http://msdn.microsoft.com/workshop/author/dhtml/overview/browserdetection.asp
  // Returns the version of Internet Explorer or a -1
  // (indicating the use of another browser).
  var rv = -1; // Return value assumes failure
  if (navigator.appName == 'Microsoft Internet Explorer') {
    var ua = navigator.userAgent;
    var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null) {
      rv = parseFloat( RegExp.$1 );
    }
  }
  return rv;
};

/**
 * Fetches a KMZ document.
 *
 * <p>Fetches/parses the given ZIP URL, parses each image file, and
passes
 * the parsed KML document to the given callback.  Documents are downloaded
 * and parsed asynchronously, though the KML file is always passed after
the
 * images have been processed, in case the callback requires the image
data.</p>
 *
 * @requires ZipFile.complete.js
 * @param {String} url URL of KMZ document.  Must be a valid KMZ/ZIP
archive.
 * @param {Function(Document)} callback Function to call when the document
is processed.
 * @param {geoXML3.parser} parser A geoXML3.parser object.  This is used to
populate the KMZ image data.
 * @author Brendan Byrd
 * @see http://code.google.com/apis/kml/documentation/kmzarchives.html
 */
geoXML3.fetchZIP = function (url, callback, parser) {
  // Just need a single 'new' declaration with a really long
function...
  var zipFile = new ZipFile(url, function (zip) {
    // Retrieval complete

    // Check for ERRORs in zip.status
    for (var i = 0; i < zip.status.length; i++) {
      var msg = zip.status[i];
      if (msg.indexOf("ERROR") == 0) {
        geoXML3.log('HTTP/ZIP error retrieving ' + url + ':
' + msg);
        callback();
        return;
      }
      else if (msg.indexOf("EXCEPTION") == 0) {  
        geoXML3.log('HTTP/ZIP exception retrieving ' + url +
': ' + msg);
        callback();
        return;
      } else if (msg.indexOf("WARNING") == 0) {  // non-fatal,
but still might be useful
        geoXML3.log('HTTP/ZIP warning retrieving ' + url +
': ' + msg);
      } else if (msg.indexOf("INFO") == 0) {  // non-fatal, but
still might be useful
        geoXML3.log('HTTP/ZIP info retrieving ' + url + ':
' + msg);
      }
    }

    // Make sure KMZ structure is according to spec (with a single KML file
in the root dir)
    var KMLCount = 0;
    var KML;
    for (var i = 0; i < zip.entries.length; i++) {
      var name = zip.entries[i].name;
      if (!/\.kml$/.test(name)) continue;

      KMLCount++;
      if (KMLCount == 1) KML = i;
      else {
        geoXML3.log('KMZ warning retrieving ' + url + ':
found extra KML "' + name + '" in KMZ;
discarding...');
      }
    }

    // Returned successfully, but still needs extracting
    var baseUrl = cleanURL(defileURL(url), url) + '/';
    var kmlProcessing = {  // this is an object just so it gets passed
properly
      timer: null,
      extractLeft: 0,
      timerCalls: 0
    };
    var extractCb = function(entry, entryContent) {
      var mdUrl = cleanURL(baseUrl, entry.name);
      var ext = entry.name.substring(entry.name.lastIndexOf(".")
+ 1).toLowerCase();
      kmlProcessing.extractLeft--;

      if ((typeof entryContent.description == "string")
&& (entryContent.name == "Error")) {
        geoXML3.log('KMZ error extracting ' + mdUrl + ':
' + entryContent.description);
        callback();
        return;
      }

      // MIME types that can be used in KML
      var mime;
      if (ext === 'jpg') ext = 'jpeg';
      if (/^(gif|jpeg|png)$/.test(ext)) mime = 'image/' + ext;
      else if (ext === 'mp3')           mime =
'audio/mpeg';
      else if (ext === 'm4a')           mime =
'audio/mp4';
      else if (ext === 'm4a')           mime =
'audio/MP4-LATM';
      else                              mime =
'application/octet-stream';

      parser.kmzMetaData[mdUrl] = {};
      parser.kmzMetaData[mdUrl].entry = entry;
      // data:image/gif;base64,R0lGODlhEAAOALMA...
      parser.kmzMetaData[mdUrl].dataUrl = 'data:' + mime +
';base64,' + base64Encode(entryContent);
      // IE cannot handle GET requests beyond 2071 characters, even if
it's an inline image
	if (/msie/i.test(navigator.userAgent) &&
!/opera/i.test(navigator.userAgent))
        { 
            if (((IEversion() < 8.0) &&
                 (parser.kmzMetaData[mdUrl].dataUrl.length > 2071)) ||
                ((IEversion < 9.0) && 
                 (parser.kmzMetaData[mdUrl].dataUrl.length > 32767))) {
             parser.kmzMetaData[mdUrl].dataUrl =
             // this is a simple IE icon; to hint at the problem...
            
'data:image/gif;base64,R0lGODlhDwAQAOMPADBPvSpQ1Dpoyz1p6FhwvU2A6ECP63CM04CWxYCk+V6x+UK++Jao3rvC3fj7+v///yH5BAEKAA8ALAAAAAAPABAAAASC8Mk5mwCAUMlWwcLRHEelLA'
+
            
'oGDMgzSsiyGCAhCETDPMh5XQCBwYBrNBIKWmg0MCQHj8MJU5IoroYCY6AAAgrDIbbQDGIK6DR5UPhlNo0JAlSUNAiDgH7eNAxEDWAKCQM2AAFheVxYAA0AIkFOJ1gBcQQaUQKKA5w7LpcEBwkJaKMUEQA7';
            } 
       }
      
parser.kmzMetaData[internalSrc(entry.name)]=parser.kmzMetaData[mdUrl];	

    };
    var kmlExtractCb = function(entry, entryContent) {
      if ((typeof entryContent.description == "string")
&& (entryContent.name == "Error")) {
        geoXML3.log('KMZ error extracting ' + entry.name +
': ' + entryContent.description);
        callback();
        return;
      }

      // check to see if the KML is the last file extracted
      clearTimeout(kmlProcessing.timer);
      if (kmlProcessing.extractLeft <= 1) {
        kmlProcessing.extractLeft--;
        callback(geoXML3.xmlParse(entryContent));
        return;
      }
      else {
        // KML file isn't last yet; it may need to use those files, so
wait a bit (100ms)
        kmlProcessing.timerCalls++;
        if (kmlProcessing.timerCalls < 100) {
          kmlProcessing.timer = setTimeout(function() { kmlExtractCb(entry,
entryContent); }, 100);
        }
        else {
          geoXML3.log('KMZ warning extracting ' + url + ':
entire ZIP has not been extracted after 10 seconds; running through KML,
anyway...');
          kmlProcessing.extractLeft--;
          callback(geoXML3.xmlParse(entryContent));
        }
      }
      return;
    };
    for (var i = 0; i < zip.entries.length; i++) {
      var entry = zip.entries[i];
      var ext = entry.name.substring(entry.name.lastIndexOf(".")
+ 1).toLowerCase();
      if (!/^(gif|jpe?g|png|kml)$/.test(ext)) continue;  // not going to
bother to extract files we don't support
      if (ext === "kml" && i != KML)          continue; 
// extra KMLs get discarded
      if (!parser && ext != "kml")            continue; 
// cannot store images without a parser object

      // extract asynchronously
      kmlProcessing.extractLeft++;
      if (ext === "kml") entry.extract(kmlExtractCb);
      else               entry.extract(extractCb);
    }
  }); //,3 for most verbose logging

};

/**
 * Extract the text value of a DOM node, with leading and trailing
whitespace trimmed.
 *
 * @param {Element} node XML node/element.
 * @param {Any} delVal Default value if the node doesn't exist.
 * @return {String|Null}
 */
geoXML3.nodeValue = function(node, defVal) {
  var retStr="";
  if (!node) {
    return (typeof defVal === 'undefined' || defVal === null) ?
null : defVal;
  }
   if(node.nodeType==3||node.nodeType==4||node.nodeType==2){
      retStr+=node.nodeValue;
   }else if(node.nodeType==1||node.nodeType==9||node.nodeType==11){
      for(var i=0;i<node.childNodes.length;++i){
         retStr+=arguments.callee(node.childNodes[i]);
      }
   }
   return retStr;
};

/**
 * Loosely translate various values of a DOM node to a boolean.
 *
 * @param {Element} node XML node/element.
 * @param {Boolean} delVal Default value if the node doesn't exist.
 * @return {Boolean|Null}
 */
geoXML3.getBooleanValue = function(node, defVal) {
  var nodeContents = geoXML3.nodeValue(node);
  if (nodeContents === null) return defVal || false;
  nodeContents = parseInt(nodeContents);
  if (isNaN(nodeContents)) return true;
  if (nodeContents == 0) return false;
  else return true;
}

/**
 * Browser-normalized version of getElementsByTagNameNS.
 *
 * <p>Required because IE8 doesn't define it.</p>
 *
 * @param {Element|Document} node DOM object.
 * @param {String} namespace Full namespace URL to search against.
 * @param {String} tagname XML local tag name.
 * @return {Array of Elements}
 * @author Brendan Byrd
 */
geoXML3.getElementsByTagNameNS = function(node, namespace, tagname) {
  if (node && typeof node.getElementsByTagNameNS !=
'undefined') return node.getElementsByTagNameNS(namespace,
tagname);
  if (!node) return [];

  var root = node.documentElement || node.ownerDocument &&
node.ownerDocument.documentElement;
  if (!root || !root.attributes) return [];

  // search for namespace prefix
  for (var i = 0; i < root.attributes.length; i++) {
    var attr = root.attributes[i];
    if      (attr.prefix   === 'xmlns' && attr.nodeValue
=== namespace) return node.getElementsByTagName(attr.baseName +
':' + tagname);
    else if (attr.nodeName === 'xmlns' && attr.nodeValue
=== namespace) {
      // default namespace
      if (typeof node.selectNodes != 'undefined') {
        // Newer IEs have the SelectionNamespace property that can be used
with selectNodes
        if
(!root.ownerDocument.getProperty('SelectionNamespaces'))
          root.ownerDocument.setProperty('SelectionNamespaces',
"xmlns:defaultNS='" + namespace + "'");
        return node.selectNodes('.//defaultNS:' + tagname);
      }
      else {
        // Otherwise, you can still try to tack on the 'xmlns'
attribute to root
        root.setAttribute('xmlns:defaultNS', namespace);
        return node.getElementsByTagName('defaultNS:' + tagname);
      }
    }
  }
  return geoXML3.getElementsByTagName(node, tagname);  // try the
unqualified version
};

/**
 * Browser-normalized version of getElementsByTagName.
 *
 * <p>Required because MSXML 6.0 will treat this function as a
NS-qualified function,
 * despite the missing NS parameter.</p>
 *
 * @param {Element|Document} node DOM object.
 * @param {String} tagname XML local tag name.
 * @return {Array of Elements}
 * @author Brendan Byrd
 */
geoXML3.getElementsByTagName = function(node, tagname) {
  if (node && typeof node.getElementsByTagNameNS !=
'undefined') return node.getElementsByTagName(tagname);  // if it
has both functions, it should be accurate
//  if (node && typeof node.selectNodes != 'undefined')  
         return node.selectNodes(".//*[local-name()='" +
tagname + "']");
  return node.getElementsByTagName(tagname);  // hope for the best...
}

/**
 * Turn a directory + relative URL into an absolute one.
 *
 * @private
 * @param {String} d Base directory.
 * @param {String} s Relative URL.
 * @return {String} Absolute URL.
 * @author Brendan Byrd
 */
var toAbsURL = function (d, s) {
  var p, f, i;
  var h = location.protocol + "://" + location.host;

  if (!s.length)           return '';
  if (/^\w+:/.test(s))     return s;
  if (s.indexOf('/') == 0) return h + s;

  p = d.replace(/\/[^\/]*$/, '');
  f = s.match(/\.\.\//g);
  if (f) {
    s = s.substring(f.length * 3);
    for (i = f.length; i--;) { p = p.substring(0,
p.lastIndexOf('/')); }
  }

  return h + p + '/' + s;
}

var internalSrc = function(src) {
  //this gets the full url
  var url = document.location.href;
  //this removes everything after the last slash in the path
  url = url.substring(0,url.lastIndexOf("/") + 1);
  var internalPath= url+src;
  return internalPath;
}

/**
 * Remove current host from URL
 *
 * @private
 * @param {String} s Absolute or relative URL.
 * @return {String} Root-based relative URL.
 * @author Brendan Byrd
 */
var dehostURL = function (s) {
  var h = location.protocol + "://" + location.host;
  h = h.replace(/([\.\\\+\*\?\[\^\]\$\(\)])/g, '\\$1');  //
quotemeta
  return s.replace(new RegExp('^' + h, 'i'),
'');
}

/**
 * Removes all query strings, #IDs, '../' references, and
 * hosts from a URL.
 *
 * @private
 * @param {String} d Base directory.
 * @param {String} s Absolute or relative URL.
 * @return {String} Root-based relative URL.
 * @author Brendan Byrd
 */
var cleanURL  = function (d, s) { return dehostURL(toAbsURL(d ?
d.split('#')[0].split('?')[0] :
defileURL(location.pathname), s ?
s.split('#')[0].split('?')[0] : '')); }
/**
 * Remove filename from URL
 *
 * @private
 * @param {String} s Relative URL.
 * @return {String} Base directory.
 * @author Brendan Byrd
 */
var defileURL = function (s)    { return s ? s.substr(0,
s.lastIndexOf('/') + 1) : '/'; }


// Some extra Array subs for ease of use
//
http://stackoverflow.com/questions/143847/best-way-to-find-an-item-in-a-javascript-array
Array.prototype.hasObject = (
  !Array.indexOf ? function (obj) {
    var l = this.length + 1;
    while (l--) {
      if (this[l - 1] === obj) return true;
    }
    return false;
  } : function (obj) {
    return (this.indexOf(obj) !== -1);
  }
);
Array.prototype.hasItemInObj = function (name, item) {
  var l = this.length + 1;
  while (l--) {
    if (this[l - 1][name] === item) return true;
  }
  return false;
};
if (!Array.prototype.indexOf) {
  Array.prototype.indexOf = function (obj, fromIndex) {
    if (fromIndex == null) {
      fromIndex = 0;
    } else if (fromIndex < 0) {
      fromIndex = Math.max(0, this.length + fromIndex);
    }
    for (var i = fromIndex, j = this.length; i < j; i++) {
      if (this[i] === obj) return i;
    }
    return -1;
  };
}
Array.prototype.indexOfObjWithItem = function (name, item, fromIndex) {
  if (fromIndex == null) {
    fromIndex = 0;
  } else if (fromIndex < 0) {
    fromIndex = Math.max(0, this.length + fromIndex);
  }
  for (var i = fromIndex, j = this.length; i < j; i++) {
    if (this[i][name] === item) return i;
  }
  return -1;
};

/**
 * Borrowed from jquery.base64.js, with some "Array as input"
corrections
 *
 * @private
 * @param {Array of charCodes} input An array of byte ASCII codes (0-255).
 * @return {String} A base64-encoded string.
 * @author Brendan Byrd
 */
var base64Encode = function(input) {
  var keyString =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
  var output = "";
  var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
  var i = 0;
  while (i < input.length) {
    chr1 = input[i++];
    chr2 = input[i++];
    chr3 = input[i++];
    enc1 = chr1 >> 2;
    enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
    enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
    enc4 = chr3 & 63;

    if      (chr2 == undefined) enc3 = enc4 = 64;
    else if (chr3 == undefined) enc4 = 64;

    output = output + keyString.charAt(enc1) + keyString.charAt(enc2) +
keyString.charAt(enc3) + keyString.charAt(enc4);
  }
  return output;
};
js/jquery-ui-draggable.js000064400000176007151167223230011373 0ustar00/*!
jQuery UI - v1.12.1 - 2019-12-24
* http://jqueryui.com
* Includes: widget.js, data.js, scroll-parent.js, widgets/draggable.js,
widgets/mouse.js
* Copyright jQuery Foundation and other contributors; Licensed MIT */

(function( factory ) {
	if ( typeof define === "function" && define.amd ) {

		// AMD. Register as an anonymous module.
		define([ "jquery" ], factory );
	} else {

		// Browser globals
		factory( jQuery );
	}
}(function( $ ) {

$.ui = $.ui || {};

var version = $.ui.version = "1.12.1";


/*!
 * jQuery UI Widget 1.12.1
 * http://jqueryui.com
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 */

//>>label: Widget
//>>group: Core
//>>description: Provides a factory for creating stateful widgets
with a common API.
//>>docs: http://api.jqueryui.com/jQuery.widget/
//>>demos: http://jqueryui.com/widget/



var widgetUuid = 0;
var widgetSlice = Array.prototype.slice;

$.cleanData = ( function( orig ) {
	return function( elems ) {
		var events, elem, i;
		for ( i = 0; ( elem = elems[ i ] ) != null; i++ ) {
			try {

				// Only trigger remove when necessary to save time
				events = $._data( elem, "events" );
				if ( events && events.remove ) {
					$( elem ).triggerHandler( "remove" );
				}

			// Http://bugs.jquery.com/ticket/8235
			} catch ( e ) {}
		}
		orig( elems );
	};
} )( $.cleanData );

$.widget = function( name, base, prototype ) {
	var existingConstructor, constructor, basePrototype;

	// ProxiedPrototype allows the provided prototype to remain unmodified
	// so that it can be used as a mixin for multiple widgets (#8876)
	var proxiedPrototype = {};

	var namespace = name.split( "." )[ 0 ];
	name = name.split( "." )[ 1 ];
	var fullName = namespace + "-" + name;

	if ( !prototype ) {
		prototype = base;
		base = $.Widget;
	}

	if ( $.isArray( prototype ) ) {
		prototype = $.extend.apply( null, [ {} ].concat( prototype ) );
	}

	// Create selector for plugin
	$.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
		return !!$.data( elem, fullName );
	};

	$[ namespace ] = $[ namespace ] || {};
	existingConstructor = $[ namespace ][ name ];
	constructor = $[ namespace ][ name ] = function( options, element ) {

		// Allow instantiation without "new" keyword
		if ( !this._createWidget ) {
			return new constructor( options, element );
		}

		// Allow instantiation without initializing for simple inheritance
		// must use "new" keyword (the code above always passes args)
		if ( arguments.length ) {
			this._createWidget( options, element );
		}
	};

	// Extend with the existing constructor to carry over any static
properties
	$.extend( constructor, existingConstructor, {
		version: prototype.version,

		// Copy the object used to create the prototype in case we need to
		// redefine the widget later
		_proto: $.extend( {}, prototype ),

		// Track widgets that inherit from this widget in case this widget is
		// redefined after a widget inherits from it
		_childConstructors: []
	} );

	basePrototype = new base();

	// We need to make the options hash a property directly on the new
instance
	// otherwise we'll modify the options hash on the prototype that
we're
	// inheriting from
	basePrototype.options = $.widget.extend( {}, basePrototype.options );
	$.each( prototype, function( prop, value ) {
		if ( !$.isFunction( value ) ) {
			proxiedPrototype[ prop ] = value;
			return;
		}
		proxiedPrototype[ prop ] = ( function() {
			function _super() {
				return base.prototype[ prop ].apply( this, arguments );
			}

			function _superApply( args ) {
				return base.prototype[ prop ].apply( this, args );
			}

			return function() {
				var __super = this._super;
				var __superApply = this._superApply;
				var returnValue;

				this._super = _super;
				this._superApply = _superApply;

				returnValue = value.apply( this, arguments );

				this._super = __super;
				this._superApply = __superApply;

				return returnValue;
			};
		} )();
	} );
	constructor.prototype = $.widget.extend( basePrototype, {

		// TODO: remove support for widgetEventPrefix
		// always use the name + a colon as the prefix, e.g., draggable:start
		// don't prefix for widgets that aren't DOM-based
		widgetEventPrefix: existingConstructor ? (
basePrototype.widgetEventPrefix || name ) : name
	}, proxiedPrototype, {
		constructor: constructor,
		namespace: namespace,
		widgetName: name,
		widgetFullName: fullName
	} );

	// If this widget is being redefined then we need to find all widgets that
	// are inheriting from it and redefine all of them so that they inherit
from
	// the new version of this widget. We're essentially trying to
replace one
	// level in the prototype chain.
	if ( existingConstructor ) {
		$.each( existingConstructor._childConstructors, function( i, child ) {
			var childPrototype = child.prototype;

			// Redefine the child widget using the same prototype that was
			// originally used, but inherit from the new version of the base
			$.widget( childPrototype.namespace + "." +
childPrototype.widgetName, constructor,
				child._proto );
		} );

		// Remove the list of existing child constructors from the old
constructor
		// so the old child constructors can be garbage collected
		delete existingConstructor._childConstructors;
	} else {
		base._childConstructors.push( constructor );
	}

	$.widget.bridge( name, constructor );

	return constructor;
};

$.widget.extend = function( target ) {
	var input = widgetSlice.call( arguments, 1 );
	var inputIndex = 0;
	var inputLength = input.length;
	var key;
	var value;

	for ( ; inputIndex < inputLength; inputIndex++ ) {
		for ( key in input[ inputIndex ] ) {
			value = input[ inputIndex ][ key ];
			if ( input[ inputIndex ].hasOwnProperty( key ) && value !==
undefined ) {

				// Clone objects
				if ( $.isPlainObject( value ) ) {
					target[ key ] = $.isPlainObject( target[ key ] ) ?
						$.widget.extend( {}, target[ key ], value ) :

						// Don't extend strings, arrays, etc. with objects
						$.widget.extend( {}, value );

				// Copy everything else by reference
				} else {
					target[ key ] = value;
				}
			}
		}
	}
	return target;
};

$.widget.bridge = function( name, object ) {
	var fullName = object.prototype.widgetFullName || name;
	$.fn[ name ] = function( options ) {
		var isMethodCall = typeof options === "string";
		var args = widgetSlice.call( arguments, 1 );
		var returnValue = this;

		if ( isMethodCall ) {

			// If this is an empty collection, we need to have the instance method
			// return undefined instead of the jQuery instance
			if ( !this.length && options === "instance" ) {
				returnValue = undefined;
			} else {
				this.each( function() {
					var methodValue;
					var instance = $.data( this, fullName );

					if ( options === "instance" ) {
						returnValue = instance;
						return false;
					}

					if ( !instance ) {
						return $.error( "cannot call methods on " + name +
							" prior to initialization; " +
							"attempted to call method '" + options +
"'" );
					}

					if ( !$.isFunction( instance[ options ] ) || options.charAt( 0 ) ===
"_" ) {
						return $.error( "no such method '" + options +
"' for " + name +
							" widget instance" );
					}

					methodValue = instance[ options ].apply( instance, args );

					if ( methodValue !== instance && methodValue !== undefined ) {
						returnValue = methodValue && methodValue.jquery ?
							returnValue.pushStack( methodValue.get() ) :
							methodValue;
						return false;
					}
				} );
			}
		} else {

			// Allow multiple hashes to be passed on init
			if ( args.length ) {
				options = $.widget.extend.apply( null, [ options ].concat( args ) );
			}

			this.each( function() {
				var instance = $.data( this, fullName );
				if ( instance ) {
					instance.option( options || {} );
					if ( instance._init ) {
						instance._init();
					}
				} else {
					$.data( this, fullName, new object( options, this ) );
				}
			} );
		}

		return returnValue;
	};
};

$.Widget = function( /* options, element */ ) {};
$.Widget._childConstructors = [];

$.Widget.prototype = {
	widgetName: "widget",
	widgetEventPrefix: "",
	defaultElement: "<div>",

	options: {
		classes: {},
		disabled: false,

		// Callbacks
		create: null
	},

	_createWidget: function( options, element ) {
		element = $( element || this.defaultElement || this )[ 0 ];
		this.element = $( element );
		this.uuid = widgetUuid++;
		this.eventNamespace = "." + this.widgetName + this.uuid;

		this.bindings = $();
		this.hoverable = $();
		this.focusable = $();
		this.classesElementLookup = {};

		if ( element !== this ) {
			$.data( element, this.widgetFullName, this );
			this._on( true, this.element, {
				remove: function( event ) {
					if ( event.target === element ) {
						this.destroy();
					}
				}
			} );
			this.document = $( element.style ?

				// Element within the document
				element.ownerDocument :

				// Element is window or document
				element.document || element );
			this.window = $( this.document[ 0 ].defaultView || this.document[ 0
].parentWindow );
		}

		this.options = $.widget.extend( {},
			this.options,
			this._getCreateOptions(),
			options );

		this._create();

		if ( this.options.disabled ) {
			this._setOptionDisabled( this.options.disabled );
		}

		this._trigger( "create", null, this._getCreateEventData() );
		this._init();
	},

	_getCreateOptions: function() {
		return {};
	},

	_getCreateEventData: $.noop,

	_create: $.noop,

	_init: $.noop,

	destroy: function() {
		var that = this;

		this._destroy();
		$.each( this.classesElementLookup, function( key, value ) {
			that._removeClass( value, key );
		} );

		// We can probably remove the unbind calls in 2.0
		// all event bindings should go through this._on()
		this.element
			.off( this.eventNamespace )
			.removeData( this.widgetFullName );
		this.widget()
			.off( this.eventNamespace )
			.removeAttr( "aria-disabled" );

		// Clean up events and states
		this.bindings.off( this.eventNamespace );
	},

	_destroy: $.noop,

	widget: function() {
		return this.element;
	},

	option: function( key, value ) {
		var options = key;
		var parts;
		var curOption;
		var i;

		if ( arguments.length === 0 ) {

			// Don't return a reference to the internal hash
			return $.widget.extend( {}, this.options );
		}

		if ( typeof key === "string" ) {

			// Handle nested keys, e.g., "foo.bar" => { foo: { bar: ___
} }
			options = {};
			parts = key.split( "." );
			key = parts.shift();
			if ( parts.length ) {
				curOption = options[ key ] = $.widget.extend( {}, this.options[ key ]
);
				for ( i = 0; i < parts.length - 1; i++ ) {
					curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
					curOption = curOption[ parts[ i ] ];
				}
				key = parts.pop();
				if ( arguments.length === 1 ) {
					return curOption[ key ] === undefined ? null : curOption[ key ];
				}
				curOption[ key ] = value;
			} else {
				if ( arguments.length === 1 ) {
					return this.options[ key ] === undefined ? null : this.options[ key ];
				}
				options[ key ] = value;
			}
		}

		this._setOptions( options );

		return this;
	},

	_setOptions: function( options ) {
		var key;

		for ( key in options ) {
			this._setOption( key, options[ key ] );
		}

		return this;
	},

	_setOption: function( key, value ) {
		if ( key === "classes" ) {
			this._setOptionClasses( value );
		}

		this.options[ key ] = value;

		if ( key === "disabled" ) {
			this._setOptionDisabled( value );
		}

		return this;
	},

	_setOptionClasses: function( value ) {
		var classKey, elements, currentElements;

		for ( classKey in value ) {
			currentElements = this.classesElementLookup[ classKey ];
			if ( value[ classKey ] === this.options.classes[ classKey ] ||
					!currentElements ||
					!currentElements.length ) {
				continue;
			}

			// We are doing this to create a new jQuery object because the
_removeClass() call
			// on the next line is going to destroy the reference to the current
elements being
			// tracked. We need to save a copy of this collection so that we can add
the new classes
			// below.
			elements = $( currentElements.get() );
			this._removeClass( currentElements, classKey );

			// We don't use _addClass() here, because that uses
this.options.classes
			// for generating the string of classes. We want to use the value passed
in from
			// _setOption(), this is the new value of the classes option which was
passed to
			// _setOption(). We pass this value directly to _classes().
			elements.addClass( this._classes( {
				element: elements,
				keys: classKey,
				classes: value,
				add: true
			} ) );
		}
	},

	_setOptionDisabled: function( value ) {
		this._toggleClass( this.widget(), this.widgetFullName +
"-disabled", null, !!value );

		// If the widget is becoming disabled, then nothing is interactive
		if ( value ) {
			this._removeClass( this.hoverable, null, "ui-state-hover" );
			this._removeClass( this.focusable, null, "ui-state-focus" );
		}
	},

	enable: function() {
		return this._setOptions( { disabled: false } );
	},

	disable: function() {
		return this._setOptions( { disabled: true } );
	},

	_classes: function( options ) {
		var full = [];
		var that = this;

		options = $.extend( {
			element: this.element,
			classes: this.options.classes || {}
		}, options );

		function processClassString( classes, checkOption ) {
			var current, i;
			for ( i = 0; i < classes.length; i++ ) {
				current = that.classesElementLookup[ classes[ i ] ] || $();
				if ( options.add ) {
					current = $( $.unique( current.get().concat( options.element.get() ) )
);
				} else {
					current = $( current.not( options.element ).get() );
				}
				that.classesElementLookup[ classes[ i ] ] = current;
				full.push( classes[ i ] );
				if ( checkOption && options.classes[ classes[ i ] ] ) {
					full.push( options.classes[ classes[ i ] ] );
				}
			}
		}

		this._on( options.element, {
			"remove": "_untrackClassesElement"
		} );

		if ( options.keys ) {
			processClassString( options.keys.match( /\S+/g ) || [], true );
		}
		if ( options.extra ) {
			processClassString( options.extra.match( /\S+/g ) || [] );
		}

		return full.join( " " );
	},

	_untrackClassesElement: function( event ) {
		var that = this;
		$.each( that.classesElementLookup, function( key, value ) {
			if ( $.inArray( event.target, value ) !== -1 ) {
				that.classesElementLookup[ key ] = $( value.not( event.target ).get()
);
			}
		} );
	},

	_removeClass: function( element, keys, extra ) {
		return this._toggleClass( element, keys, extra, false );
	},

	_addClass: function( element, keys, extra ) {
		return this._toggleClass( element, keys, extra, true );
	},

	_toggleClass: function( element, keys, extra, add ) {
		add = ( typeof add === "boolean" ) ? add : extra;
		var shift = ( typeof element === "string" || element === null
),
			options = {
				extra: shift ? keys : extra,
				keys: shift ? element : keys,
				element: shift ? this.element : element,
				add: add
			};
		options.element.toggleClass( this._classes( options ), add );
		return this;
	},

	_on: function( suppressDisabledCheck, element, handlers ) {
		var delegateElement;
		var instance = this;

		// No suppressDisabledCheck flag, shuffle arguments
		if ( typeof suppressDisabledCheck !== "boolean" ) {
			handlers = element;
			element = suppressDisabledCheck;
			suppressDisabledCheck = false;
		}

		// No element argument, shuffle and use this.element
		if ( !handlers ) {
			handlers = element;
			element = this.element;
			delegateElement = this.widget();
		} else {
			element = delegateElement = $( element );
			this.bindings = this.bindings.add( element );
		}

		$.each( handlers, function( event, handler ) {
			function handlerProxy() {

				// Allow widgets to customize the disabled handling
				// - disabled as an array instead of boolean
				// - disabled class as method for disabling individual parts
				if ( !suppressDisabledCheck &&
						( instance.options.disabled === true ||
						$( this ).hasClass( "ui-state-disabled" ) ) ) {
					return;
				}
				return ( typeof handler === "string" ? instance[ handler ] :
handler )
					.apply( instance, arguments );
			}

			// Copy the guid so direct unbinding works
			if ( typeof handler !== "string" ) {
				handlerProxy.guid = handler.guid =
					handler.guid || handlerProxy.guid || $.guid++;
			}

			var match = event.match( /^([\w:-]*)\s*(.*)$/ );
			var eventName = match[ 1 ] + instance.eventNamespace;
			var selector = match[ 2 ];

			if ( selector ) {
				delegateElement.on( eventName, selector, handlerProxy );
			} else {
				element.on( eventName, handlerProxy );
			}
		} );
	},

	_off: function( element, eventName ) {
		eventName = ( eventName || "" ).split( " " ).join(
this.eventNamespace + " " ) +
			this.eventNamespace;
		element.off( eventName ).off( eventName );

		// Clear the stack to avoid memory leaks (#10056)
		this.bindings = $( this.bindings.not( element ).get() );
		this.focusable = $( this.focusable.not( element ).get() );
		this.hoverable = $( this.hoverable.not( element ).get() );
	},

	_delay: function( handler, delay ) {
		function handlerProxy() {
			return ( typeof handler === "string" ? instance[ handler ] :
handler )
				.apply( instance, arguments );
		}
		var instance = this;
		return setTimeout( handlerProxy, delay || 0 );
	},

	_hoverable: function( element ) {
		this.hoverable = this.hoverable.add( element );
		this._on( element, {
			mouseenter: function( event ) {
				this._addClass( $( event.currentTarget ), null,
"ui-state-hover" );
			},
			mouseleave: function( event ) {
				this._removeClass( $( event.currentTarget ), null,
"ui-state-hover" );
			}
		} );
	},

	_focusable: function( element ) {
		this.focusable = this.focusable.add( element );
		this._on( element, {
			focusin: function( event ) {
				this._addClass( $( event.currentTarget ), null,
"ui-state-focus" );
			},
			focusout: function( event ) {
				this._removeClass( $( event.currentTarget ), null,
"ui-state-focus" );
			}
		} );
	},

	_trigger: function( type, event, data ) {
		var prop, orig;
		var callback = this.options[ type ];

		data = data || {};
		event = $.Event( event );
		event.type = ( type === this.widgetEventPrefix ?
			type :
			this.widgetEventPrefix + type ).toLowerCase();

		// The original event may come from any element
		// so we need to reset the target on the new event
		event.target = this.element[ 0 ];

		// Copy original event properties over to the new event
		orig = event.originalEvent;
		if ( orig ) {
			for ( prop in orig ) {
				if ( !( prop in event ) ) {
					event[ prop ] = orig[ prop ];
				}
			}
		}

		this.element.trigger( event, data );
		return !( $.isFunction( callback ) &&
			callback.apply( this.element[ 0 ], [ event ].concat( data ) ) === false
||
			event.isDefaultPrevented() );
	}
};

$.each( { show: "fadeIn", hide: "fadeOut" }, function(
method, defaultEffect ) {
	$.Widget.prototype[ "_" + method ] = function( element, options,
callback ) {
		if ( typeof options === "string" ) {
			options = { effect: options };
		}

		var hasOptions;
		var effectName = !options ?
			method :
			options === true || typeof options === "number" ?
				defaultEffect :
				options.effect || defaultEffect;

		options = options || {};
		if ( typeof options === "number" ) {
			options = { duration: options };
		}

		hasOptions = !$.isEmptyObject( options );
		options.complete = callback;

		if ( options.delay ) {
			element.delay( options.delay );
		}

		if ( hasOptions && $.effects && $.effects.effect[
effectName ] ) {
			element[ method ]( options );
		} else if ( effectName !== method && element[ effectName ] ) {
			element[ effectName ]( options.duration, options.easing, callback );
		} else {
			element.queue( function( next ) {
				$( this )[ method ]();
				if ( callback ) {
					callback.call( element[ 0 ] );
				}
				next();
			} );
		}
	};
} );

var widget = $.widget;


/*!
 * jQuery UI :data 1.12.1
 * http://jqueryui.com
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 */

//>>label: :data Selector
//>>group: Core
//>>description: Selects elements which have data stored under the
specified key.
//>>docs: http://api.jqueryui.com/data-selector/


var data = $.extend( $.expr[ ":" ], {
	data: $.expr.createPseudo ?
		$.expr.createPseudo( function( dataName ) {
			return function( elem ) {
				return !!$.data( elem, dataName );
			};
		} ) :

		// Support: jQuery <1.8
		function( elem, i, match ) {
			return !!$.data( elem, match[ 3 ] );
		}
} );

/*!
 * jQuery UI Scroll Parent 1.12.1
 * http://jqueryui.com
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 */

//>>label: scrollParent
//>>group: Core
//>>description: Get the closest ancestor element that is scrollable.
//>>docs: http://api.jqueryui.com/scrollParent/



var scrollParent = $.fn.scrollParent = function( includeHidden ) {
	var position = this.css( "position" ),
		excludeStaticParent = position === "absolute",
		overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/,
		scrollParent = this.parents().filter( function() {
			var parent = $( this );
			if ( excludeStaticParent && parent.css( "position" )
=== "static" ) {
				return false;
			}
			return overflowRegex.test( parent.css( "overflow" ) +
parent.css( "overflow-y" ) +
				parent.css( "overflow-x" ) );
		} ).eq( 0 );

	return position === "fixed" || !scrollParent.length ?
		$( this[ 0 ].ownerDocument || document ) :
		scrollParent;
};




// This file is deprecated
var ie = $.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase()
);

/*!
 * jQuery UI Mouse 1.12.1
 * http://jqueryui.com
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 */

//>>label: Mouse
//>>group: Widgets
//>>description: Abstracts mouse-based interactions to assist in
creating certain widgets.
//>>docs: http://api.jqueryui.com/mouse/



var mouseHandled = false;
$( document ).on( "mouseup", function() {
	mouseHandled = false;
} );

var widgetsMouse = $.widget( "ui.mouse", {
	version: "1.12.1",
	options: {
		cancel: "input, textarea, button, select, option",
		distance: 1,
		delay: 0
	},
	_mouseInit: function() {
		var that = this;

		this.element
			.on( "mousedown." + this.widgetName, function( event ) {
				return that._mouseDown( event );
			} )
			.on( "click." + this.widgetName, function( event ) {
				if ( true === $.data( event.target, that.widgetName +
".preventClickEvent" ) ) {
					$.removeData( event.target, that.widgetName +
".preventClickEvent" );
					event.stopImmediatePropagation();
					return false;
				}
			} );

		this.started = false;
	},

	// TODO: make sure destroying one instance of mouse doesn't mess with
	// other instances of mouse
	_mouseDestroy: function() {
		this.element.off( "." + this.widgetName );
		if ( this._mouseMoveDelegate ) {
			this.document
				.off( "mousemove." + this.widgetName, this._mouseMoveDelegate
)
				.off( "mouseup." + this.widgetName, this._mouseUpDelegate );
		}
	},

	_mouseDown: function( event ) {

		// don't let more than one widget handle mouseStart
		if ( mouseHandled ) {
			return;
		}

		this._mouseMoved = false;

		// We may have missed mouseup (out of window)
		( this._mouseStarted && this._mouseUp( event ) );

		this._mouseDownEvent = event;

		var that = this,
			btnIsLeft = ( event.which === 1 ),

			// event.target.nodeName works around a bug in IE 8 with
			// disabled inputs (#7620)
			elIsCancel = ( typeof this.options.cancel === "string"
&& event.target.nodeName ?
				$( event.target ).closest( this.options.cancel ).length : false );
		if ( !btnIsLeft || elIsCancel || !this._mouseCapture( event ) ) {
			return true;
		}

		this.mouseDelayMet = !this.options.delay;
		if ( !this.mouseDelayMet ) {
			this._mouseDelayTimer = setTimeout( function() {
				that.mouseDelayMet = true;
			}, this.options.delay );
		}

		if ( this._mouseDistanceMet( event ) && this._mouseDelayMet(
event ) ) {
			this._mouseStarted = ( this._mouseStart( event ) !== false );
			if ( !this._mouseStarted ) {
				event.preventDefault();
				return true;
			}
		}

		// Click event may never have fired (Gecko & Opera)
		if ( true === $.data( event.target, this.widgetName +
".preventClickEvent" ) ) {
			$.removeData( event.target, this.widgetName +
".preventClickEvent" );
		}

		// These delegates are required to keep context
		this._mouseMoveDelegate = function( event ) {
			return that._mouseMove( event );
		};
		this._mouseUpDelegate = function( event ) {
			return that._mouseUp( event );
		};

		this.document
			.on( "mousemove." + this.widgetName, this._mouseMoveDelegate )
			.on( "mouseup." + this.widgetName, this._mouseUpDelegate );

		event.preventDefault();

		mouseHandled = true;
		return true;
	},

	_mouseMove: function( event ) {

		// Only check for mouseups outside the document if you've moved
inside the document
		// at least once. This prevents the firing of mouseup in the case of
IE<9, which will
		// fire a mousemove event if content is placed under the cursor. See
#7778
		// Support: IE <9
		if ( this._mouseMoved ) {

			// IE mouseup check - mouseup happened when mouse was out of window
			if ( $.ui.ie && ( !document.documentMode ||
document.documentMode < 9 ) &&
					!event.button ) {
				return this._mouseUp( event );

			// Iframe mouseup check - mouseup occurred in another document
			} else if ( !event.which ) {

				// Support: Safari <=8 - 9
				// Safari sets which to 0 if you press any of the following keys
				// during a drag (#14461)
				if ( event.originalEvent.altKey || event.originalEvent.ctrlKey ||
						event.originalEvent.metaKey || event.originalEvent.shiftKey ) {
					this.ignoreMissingWhich = true;
				} else if ( !this.ignoreMissingWhich ) {
					return this._mouseUp( event );
				}
			}
		}

		if ( event.which || event.button ) {
			this._mouseMoved = true;
		}

		if ( this._mouseStarted ) {
			this._mouseDrag( event );
			return event.preventDefault();
		}

		if ( this._mouseDistanceMet( event ) && this._mouseDelayMet(
event ) ) {
			this._mouseStarted =
				( this._mouseStart( this._mouseDownEvent, event ) !== false );
			( this._mouseStarted ? this._mouseDrag( event ) : this._mouseUp( event )
);
		}

		return !this._mouseStarted;
	},

	_mouseUp: function( event ) {
		this.document
			.off( "mousemove." + this.widgetName, this._mouseMoveDelegate
)
			.off( "mouseup." + this.widgetName, this._mouseUpDelegate );

		if ( this._mouseStarted ) {
			this._mouseStarted = false;

			if ( event.target === this._mouseDownEvent.target ) {
				$.data( event.target, this.widgetName + ".preventClickEvent",
true );
			}

			this._mouseStop( event );
		}

		if ( this._mouseDelayTimer ) {
			clearTimeout( this._mouseDelayTimer );
			delete this._mouseDelayTimer;
		}

		this.ignoreMissingWhich = false;
		mouseHandled = false;
		event.preventDefault();
	},

	_mouseDistanceMet: function( event ) {
		return ( Math.max(
				Math.abs( this._mouseDownEvent.pageX - event.pageX ),
				Math.abs( this._mouseDownEvent.pageY - event.pageY )
			) >= this.options.distance
		);
	},

	_mouseDelayMet: function( /* event */ ) {
		return this.mouseDelayMet;
	},

	// These are placeholder methods, to be overriden by extending plugin
	_mouseStart: function( /* event */ ) {},
	_mouseDrag: function( /* event */ ) {},
	_mouseStop: function( /* event */ ) {},
	_mouseCapture: function( /* event */ ) { return true; }
} );




// $.ui.plugin is deprecated. Use $.widget() extensions instead.
var plugin = $.ui.plugin = {
	add: function( module, option, set ) {
		var i,
			proto = $.ui[ module ].prototype;
		for ( i in set ) {
			proto.plugins[ i ] = proto.plugins[ i ] || [];
			proto.plugins[ i ].push( [ option, set[ i ] ] );
		}
	},
	call: function( instance, name, args, allowDisconnected ) {
		var i,
			set = instance.plugins[ name ];

		if ( !set ) {
			return;
		}

		if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode ||
				instance.element[ 0 ].parentNode.nodeType === 11 ) ) {
			return;
		}

		for ( i = 0; i < set.length; i++ ) {
			if ( instance.options[ set[ i ][ 0 ] ] ) {
				set[ i ][ 1 ].apply( instance.element, args );
			}
		}
	}
};



var safeActiveElement = $.ui.safeActiveElement = function( document ) {
	var activeElement;

	// Support: IE 9 only
	// IE9 throws an "Unspecified error" accessing
document.activeElement from an <iframe>
	try {
		activeElement = document.activeElement;
	} catch ( error ) {
		activeElement = document.body;
	}

	// Support: IE 9 - 11 only
	// IE may return null instead of an element
	// Interestingly, this only seems to occur when NOT in an iframe
	if ( !activeElement ) {
		activeElement = document.body;
	}

	// Support: IE 11 only
	// IE11 returns a seemingly empty object in some cases when accessing
	// document.activeElement from an <iframe>
	if ( !activeElement.nodeName ) {
		activeElement = document.body;
	}

	return activeElement;
};



var safeBlur = $.ui.safeBlur = function( element ) {

	// Support: IE9 - 10 only
	// If the <body> is blurred, IE will switch windows, see #9420
	if ( element && element.nodeName.toLowerCase() !==
"body" ) {
		$( element ).trigger( "blur" );
	}
};


/*!
 * jQuery UI Draggable 1.12.1
 * http://jqueryui.com
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 */

//>>label: Draggable
//>>group: Interactions
//>>description: Enables dragging functionality for any element.
//>>docs: http://api.jqueryui.com/draggable/
//>>demos: http://jqueryui.com/draggable/
//>>css.structure: ../../themes/base/draggable.css



$.widget( "ui.draggable", $.ui.mouse, {
	version: "1.12.1",
	widgetEventPrefix: "drag",
	options: {
		addClasses: true,
		appendTo: "parent",
		axis: false,
		connectToSortable: false,
		containment: false,
		cursor: "auto",
		cursorAt: false,
		grid: false,
		handle: false,
		helper: "original",
		iframeFix: false,
		opacity: false,
		refreshPositions: false,
		revert: false,
		revertDuration: 500,
		scope: "default",
		scroll: true,
		scrollSensitivity: 20,
		scrollSpeed: 20,
		snap: false,
		snapMode: "both",
		snapTolerance: 20,
		stack: false,
		zIndex: false,

		// Callbacks
		drag: null,
		start: null,
		stop: null
	},
	_create: function() {

		if ( this.options.helper === "original" ) {
			this._setPositionRelative();
		}
		if ( this.options.addClasses ) {
			this._addClass( "ui-draggable" );
		}
		this._setHandleClassName();

		this._mouseInit();
	},

	_setOption: function( key, value ) {
		this._super( key, value );
		if ( key === "handle" ) {
			this._removeHandleClassName();
			this._setHandleClassName();
		}
	},

	_destroy: function() {
		if ( ( this.helper || this.element ).is(
".ui-draggable-dragging" ) ) {
			this.destroyOnClear = true;
			return;
		}
		this._removeHandleClassName();
		this._mouseDestroy();
	},

	_mouseCapture: function( event ) {
		var o = this.options;

		// Among others, prevent a drag on a resizable-handle
		if ( this.helper || o.disabled ||
				$( event.target ).closest( ".ui-resizable-handle" ).length
> 0 ) {
			return false;
		}

		//Quit if we're not on a valid handle
		this.handle = this._getHandle( event );
		if ( !this.handle ) {
			return false;
		}

		this._blurActiveElement( event );

		this._blockFrames( o.iframeFix === true ? "iframe" :
o.iframeFix );

		return true;

	},

	_blockFrames: function( selector ) {
		this.iframeBlocks = this.document.find( selector ).map( function() {
			var iframe = $( this );

			return $( "<div>" )
				.css( "position", "absolute" )
				.appendTo( iframe.parent() )
				.outerWidth( iframe.outerWidth() )
				.outerHeight( iframe.outerHeight() )
				.offset( iframe.offset() )[ 0 ];
		} );
	},

	_unblockFrames: function() {
		if ( this.iframeBlocks ) {
			this.iframeBlocks.remove();
			delete this.iframeBlocks;
		}
	},

	_blurActiveElement: function( event ) {
		var activeElement = $.ui.safeActiveElement( this.document[ 0 ] ),
			target = $( event.target );

		// Don't blur if the event occurred on an element that is within
		// the currently focused element
		// See #10527, #12472
		if ( target.closest( activeElement ).length ) {
			return;
		}

		// Blur any element that currently has focus, see #4261
		$.ui.safeBlur( activeElement );
	},

	_mouseStart: function( event ) {

		var o = this.options;

		//Create and append the visible helper
		this.helper = this._createHelper( event );

		this._addClass( this.helper, "ui-draggable-dragging" );

		//Cache the helper size
		this._cacheHelperProportions();

		//If ddmanager is used for droppables, set the global draggable
		if ( $.ui.ddmanager ) {
			$.ui.ddmanager.current = this;
		}

		/*
		 * - Position generation -
		 * This block generates everything position related - it's the core
of draggables.
		 */

		//Cache the margins of the original element
		this._cacheMargins();

		//Store the helper's css position
		this.cssPosition = this.helper.css( "position" );
		this.scrollParent = this.helper.scrollParent( true );
		this.offsetParent = this.helper.offsetParent();
		this.hasFixedAncestor = this.helper.parents().filter( function() {
				return $( this ).css( "position" ) === "fixed";
			} ).length > 0;

		//The element's absolute position on the page minus margins
		this.positionAbs = this.element.offset();
		this._refreshOffsets( event );

		//Generate the original position
		this.originalPosition = this.position = this._generatePosition( event,
false );
		this.originalPageX = event.pageX;
		this.originalPageY = event.pageY;

		//Adjust the mouse offset relative to the helper if "cursorAt"
is supplied
		( o.cursorAt && this._adjustOffsetFromHelper( o.cursorAt ) );

		//Set a containment if given in the options
		this._setContainment();

		//Trigger event + callbacks
		if ( this._trigger( "start", event ) === false ) {
			this._clear();
			return false;
		}

		//Recache the helper size
		this._cacheHelperProportions();

		//Prepare the droppable offsets
		if ( $.ui.ddmanager && !o.dropBehaviour ) {
			$.ui.ddmanager.prepareOffsets( this, event );
		}

		// Execute the drag once - this causes the helper not to be visible
before getting its
		// correct position
		this._mouseDrag( event, true );

		// If the ddmanager is used for droppables, inform the manager that
dragging has started
		// (see #5003)
		if ( $.ui.ddmanager ) {
			$.ui.ddmanager.dragStart( this, event );
		}

		return true;
	},

	_refreshOffsets: function( event ) {
		this.offset = {
			top: this.positionAbs.top - this.margins.top,
			left: this.positionAbs.left - this.margins.left,
			scroll: false,
			parent: this._getParentOffset(),
			relative: this._getRelativeOffset()
		};

		this.offset.click = {
			left: event.pageX - this.offset.left,
			top: event.pageY - this.offset.top
		};
	},

	_mouseDrag: function( event, noPropagation ) {

		// reset any necessary cached properties (see #5009)
		if ( this.hasFixedAncestor ) {
			this.offset.parent = this._getParentOffset();
		}

		//Compute the helpers position
		this.position = this._generatePosition( event, true );
		this.positionAbs = this._convertPositionTo( "absolute" );

		//Call plugins and callbacks and use the resulting position if something
is returned
		if ( !noPropagation ) {
			var ui = this._uiHash();
			if ( this._trigger( "drag", event, ui ) === false ) {
				this._mouseUp( new $.Event( "mouseup", event ) );
				return false;
			}
			this.position = ui.position;
		}

		this.helper[ 0 ].style.left = this.position.left + "px";
		this.helper[ 0 ].style.top = this.position.top + "px";

		if ( $.ui.ddmanager ) {
			$.ui.ddmanager.drag( this, event );
		}

		return false;
	},

	_mouseStop: function( event ) {

		//If we are using droppables, inform the manager about the drop
		var that = this,
			dropped = false;
		if ( $.ui.ddmanager && !this.options.dropBehaviour ) {
			dropped = $.ui.ddmanager.drop( this, event );
		}

		//if a drop comes from outside (a sortable)
		if ( this.dropped ) {
			dropped = this.dropped;
			this.dropped = false;
		}

		if ( ( this.options.revert === "invalid" && !dropped )
||
				( this.options.revert === "valid" && dropped ) ||
				this.options.revert === true || ( $.isFunction( this.options.revert )
&&
				this.options.revert.call( this.element, dropped ) )
		) {
			$( this.helper ).animate(
				this.originalPosition,
				parseInt( this.options.revertDuration, 10 ),
				function() {
					if ( that._trigger( "stop", event ) !== false ) {
						that._clear();
					}
				}
			);
		} else {
			if ( this._trigger( "stop", event ) !== false ) {
				this._clear();
			}
		}

		return false;
	},

	_mouseUp: function( event ) {
		this._unblockFrames();

		// If the ddmanager is used for droppables, inform the manager that
dragging has stopped
		// (see #5003)
		if ( $.ui.ddmanager ) {
			$.ui.ddmanager.dragStop( this, event );
		}

		// Only need to focus if the event occurred on the draggable itself, see
#10527
		if ( this.handleElement.is( event.target ) ) {

			// The interaction is over; whether or not the click resulted in a drag,
			// focus the element
			this.element.trigger( "focus" );
		}

		return $.ui.mouse.prototype._mouseUp.call( this, event );
	},

	cancel: function() {

		if ( this.helper.is( ".ui-draggable-dragging" ) ) {
			this._mouseUp( new $.Event( "mouseup", { target: this.element[
0 ] } ) );
		} else {
			this._clear();
		}

		return this;

	},

	_getHandle: function( event ) {
		return this.options.handle ?
			!!$( event.target ).closest( this.element.find( this.options.handle )
).length :
			true;
	},

	_setHandleClassName: function() {
		this.handleElement = this.options.handle ?
			this.element.find( this.options.handle ) : this.element;
		this._addClass( this.handleElement, "ui-draggable-handle" );
	},

	_removeHandleClassName: function() {
		this._removeClass( this.handleElement, "ui-draggable-handle" );
	},

	_createHelper: function( event ) {

		var o = this.options,
			helperIsFunction = $.isFunction( o.helper ),
			helper = helperIsFunction ?
				$( o.helper.apply( this.element[ 0 ], [ event ] ) ) :
				( o.helper === "clone" ?
					this.element.clone().removeAttr( "id" ) :
					this.element );

		if ( !helper.parents( "body" ).length ) {
			helper.appendTo( ( o.appendTo === "parent" ?
				this.element[ 0 ].parentNode :
				o.appendTo ) );
		}

		// Http://bugs.jqueryui.com/ticket/9446
		// a helper function can return the original element
		// which wouldn't have been set to relative in _create
		if ( helperIsFunction && helper[ 0 ] === this.element[ 0 ] ) {
			this._setPositionRelative();
		}

		if ( helper[ 0 ] !== this.element[ 0 ] &&
				!( /(fixed|absolute)/ ).test( helper.css( "position" ) ) ) {
			helper.css( "position", "absolute" );
		}

		return helper;

	},

	_setPositionRelative: function() {
		if ( !( /^(?:r|a|f)/ ).test( this.element.css( "position" ) ) )
{
			this.element[ 0 ].style.position = "relative";
		}
	},

	_adjustOffsetFromHelper: function( obj ) {
		if ( typeof obj === "string" ) {
			obj = obj.split( " " );
		}
		if ( $.isArray( obj ) ) {
			obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 };
		}
		if ( "left" in obj ) {
			this.offset.click.left = obj.left + this.margins.left;
		}
		if ( "right" in obj ) {
			this.offset.click.left = this.helperProportions.width - obj.right +
this.margins.left;
		}
		if ( "top" in obj ) {
			this.offset.click.top = obj.top + this.margins.top;
		}
		if ( "bottom" in obj ) {
			this.offset.click.top = this.helperProportions.height - obj.bottom +
this.margins.top;
		}
	},

	_isRootNode: function( element ) {
		return ( /(html|body)/i ).test( element.tagName ) || element ===
this.document[ 0 ];
	},

	_getParentOffset: function() {

		//Get the offsetParent and cache its position
		var po = this.offsetParent.offset(),
			document = this.document[ 0 ];

		// This is a special case where we need to modify a offset calculated on
start, since the
		// following happened:
		// 1. The position of the helper is absolute, so it's position is
calculated based on the
		// next positioned parent
		// 2. The actual offset parent is a child of the scroll parent, and the
scroll parent isn't
		// the document, which means that the scroll is included in the initial
calculation of the
		// offset of the parent, and never recalculated upon drag
		if ( this.cssPosition === "absolute" &&
this.scrollParent[ 0 ] !== document &&
				$.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) {
			po.left += this.scrollParent.scrollLeft();
			po.top += this.scrollParent.scrollTop();
		}

		if ( this._isRootNode( this.offsetParent[ 0 ] ) ) {
			po = { top: 0, left: 0 };
		}

		return {
			top: po.top + ( parseInt( this.offsetParent.css(
"borderTopWidth" ), 10 ) || 0 ),
			left: po.left + ( parseInt( this.offsetParent.css(
"borderLeftWidth" ), 10 ) || 0 )
		};

	},

	_getRelativeOffset: function() {
		if ( this.cssPosition !== "relative" ) {
			return { top: 0, left: 0 };
		}

		var p = this.element.position(),
			scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );

		return {
			top: p.top - ( parseInt( this.helper.css( "top" ), 10 ) || 0 )
+
				( !scrollIsRootNode ? this.scrollParent.scrollTop() : 0 ),
			left: p.left - ( parseInt( this.helper.css( "left" ), 10 ) ||
0 ) +
				( !scrollIsRootNode ? this.scrollParent.scrollLeft() : 0 )
		};

	},

	_cacheMargins: function() {
		this.margins = {
			left: ( parseInt( this.element.css( "marginLeft" ), 10 ) || 0
),
			top: ( parseInt( this.element.css( "marginTop" ), 10 ) || 0 ),
			right: ( parseInt( this.element.css( "marginRight" ), 10 ) ||
0 ),
			bottom: ( parseInt( this.element.css( "marginBottom" ), 10 )
|| 0 )
		};
	},

	_cacheHelperProportions: function() {
		this.helperProportions = {
			width: this.helper.outerWidth(),
			height: this.helper.outerHeight()
		};
	},

	_setContainment: function() {

		var isUserScrollable, c, ce,
			o = this.options,
			document = this.document[ 0 ];

		this.relativeContainer = null;

		if ( !o.containment ) {
			this.containment = null;
			return;
		}

		if ( o.containment === "window" ) {
			this.containment = [
				$( window ).scrollLeft() - this.offset.relative.left -
this.offset.parent.left,
				$( window ).scrollTop() - this.offset.relative.top -
this.offset.parent.top,
				$( window ).scrollLeft() + $( window ).width() -
					this.helperProportions.width - this.margins.left,
				$( window ).scrollTop() +
					( $( window ).height() || document.body.parentNode.scrollHeight ) -
					this.helperProportions.height - this.margins.top
			];
			return;
		}

		if ( o.containment === "document" ) {
			this.containment = [
				0,
				0,
				$( document ).width() - this.helperProportions.width -
this.margins.left,
				( $( document ).height() || document.body.parentNode.scrollHeight ) -
					this.helperProportions.height - this.margins.top
			];
			return;
		}

		if ( o.containment.constructor === Array ) {
			this.containment = o.containment;
			return;
		}

		if ( o.containment === "parent" ) {
			o.containment = this.helper[ 0 ].parentNode;
		}

		c = $( o.containment );
		ce = c[ 0 ];

		if ( !ce ) {
			return;
		}

		isUserScrollable = /(scroll|auto)/.test( c.css( "overflow" ) );

		this.containment = [
			( parseInt( c.css( "borderLeftWidth" ), 10 ) || 0 ) +
				( parseInt( c.css( "paddingLeft" ), 10 ) || 0 ),
			( parseInt( c.css( "borderTopWidth" ), 10 ) || 0 ) +
				( parseInt( c.css( "paddingTop" ), 10 ) || 0 ),
			( isUserScrollable ? Math.max( ce.scrollWidth, ce.offsetWidth ) :
ce.offsetWidth ) -
				( parseInt( c.css( "borderRightWidth" ), 10 ) || 0 ) -
				( parseInt( c.css( "paddingRight" ), 10 ) || 0 ) -
				this.helperProportions.width -
				this.margins.left -
				this.margins.right,
			( isUserScrollable ? Math.max( ce.scrollHeight, ce.offsetHeight ) :
ce.offsetHeight ) -
				( parseInt( c.css( "borderBottomWidth" ), 10 ) || 0 ) -
				( parseInt( c.css( "paddingBottom" ), 10 ) || 0 ) -
				this.helperProportions.height -
				this.margins.top -
				this.margins.bottom
		];
		this.relativeContainer = c;
	},

	_convertPositionTo: function( d, pos ) {

		if ( !pos ) {
			pos = this.position;
		}

		var mod = d === "absolute" ? 1 : -1,
			scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );

		return {
			top: (

				// The absolute mouse position
				pos.top	+

				// Only for relative positioned nodes: Relative offset from element to
offset parent
				this.offset.relative.top * mod +

				// The offsetParent's offset without borders (offset + border)
				this.offset.parent.top * mod -
				( ( this.cssPosition === "fixed" ?
					-this.offset.scroll.top :
					( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) * mod )
			),
			left: (

				// The absolute mouse position
				pos.left +

				// Only for relative positioned nodes: Relative offset from element to
offset parent
				this.offset.relative.left * mod +

				// The offsetParent's offset without borders (offset + border)
				this.offset.parent.left * mod	-
				( ( this.cssPosition === "fixed" ?
					-this.offset.scroll.left :
					( scrollIsRootNode ? 0 : this.offset.scroll.left ) ) * mod )
			)
		};

	},

	_generatePosition: function( event, constrainPosition ) {

		var containment, co, top, left,
			o = this.options,
			scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] ),
			pageX = event.pageX,
			pageY = event.pageY;

		// Cache the scroll
		if ( !scrollIsRootNode || !this.offset.scroll ) {
			this.offset.scroll = {
				top: this.scrollParent.scrollTop(),
				left: this.scrollParent.scrollLeft()
			};
		}

		/*
		 * - Position constraining -
		 * Constrain the position to a mix of grid, containment.
		 */

		// If we are not dragging yet, we won't check for options
		if ( constrainPosition ) {
			if ( this.containment ) {
				if ( this.relativeContainer ) {
					co = this.relativeContainer.offset();
					containment = [
						this.containment[ 0 ] + co.left,
						this.containment[ 1 ] + co.top,
						this.containment[ 2 ] + co.left,
						this.containment[ 3 ] + co.top
					];
				} else {
					containment = this.containment;
				}

				if ( event.pageX - this.offset.click.left < containment[ 0 ] ) {
					pageX = containment[ 0 ] + this.offset.click.left;
				}
				if ( event.pageY - this.offset.click.top < containment[ 1 ] ) {
					pageY = containment[ 1 ] + this.offset.click.top;
				}
				if ( event.pageX - this.offset.click.left > containment[ 2 ] ) {
					pageX = containment[ 2 ] + this.offset.click.left;
				}
				if ( event.pageY - this.offset.click.top > containment[ 3 ] ) {
					pageY = containment[ 3 ] + this.offset.click.top;
				}
			}

			if ( o.grid ) {

				//Check for grid elements set to 0 to prevent divide by 0 error causing
invalid
				// argument errors in IE (see ticket #6950)
				top = o.grid[ 1 ] ? this.originalPageY + Math.round( ( pageY -
					this.originalPageY ) / o.grid[ 1 ] ) * o.grid[ 1 ] :
this.originalPageY;
				pageY = containment ? ( ( top - this.offset.click.top >=
containment[ 1 ] ||
					top - this.offset.click.top > containment[ 3 ] ) ?
						top :
						( ( top - this.offset.click.top >= containment[ 1 ] ) ?
							top - o.grid[ 1 ] : top + o.grid[ 1 ] ) ) : top;

				left = o.grid[ 0 ] ? this.originalPageX +
					Math.round( ( pageX - this.originalPageX ) / o.grid[ 0 ] ) * o.grid[ 0
] :
					this.originalPageX;
				pageX = containment ? ( ( left - this.offset.click.left >=
containment[ 0 ] ||
					left - this.offset.click.left > containment[ 2 ] ) ?
						left :
						( ( left - this.offset.click.left >= containment[ 0 ] ) ?
							left - o.grid[ 0 ] : left + o.grid[ 0 ] ) ) : left;
			}

			if ( o.axis === "y" ) {
				pageX = this.originalPageX;
			}

			if ( o.axis === "x" ) {
				pageY = this.originalPageY;
			}
		}

		return {
			top: (

				// The absolute mouse position
				pageY -

				// Click offset (relative to the element)
				this.offset.click.top -

				// Only for relative positioned nodes: Relative offset from element to
offset parent
				this.offset.relative.top -

				// The offsetParent's offset without borders (offset + border)
				this.offset.parent.top +
				( this.cssPosition === "fixed" ?
					-this.offset.scroll.top :
					( scrollIsRootNode ? 0 : this.offset.scroll.top ) )
			),
			left: (

				// The absolute mouse position
				pageX -

				// Click offset (relative to the element)
				this.offset.click.left -

				// Only for relative positioned nodes: Relative offset from element to
offset parent
				this.offset.relative.left -

				// The offsetParent's offset without borders (offset + border)
				this.offset.parent.left +
				( this.cssPosition === "fixed" ?
					-this.offset.scroll.left :
					( scrollIsRootNode ? 0 : this.offset.scroll.left ) )
			)
		};

	},

	_clear: function() {
		this._removeClass( this.helper, "ui-draggable-dragging" );
		if ( this.helper[ 0 ] !== this.element[ 0 ] &&
!this.cancelHelperRemoval ) {
			this.helper.remove();
		}
		this.helper = null;
		this.cancelHelperRemoval = false;
		if ( this.destroyOnClear ) {
			this.destroy();
		}
	},

	// From now on bulk stuff - mainly helpers

	_trigger: function( type, event, ui ) {
		ui = ui || this._uiHash();
		$.ui.plugin.call( this, type, [ event, ui, this ], true );

		// Absolute position and offset (see #6884 ) have to be recalculated
after plugins
		if ( /^(drag|start|stop)/.test( type ) ) {
			this.positionAbs = this._convertPositionTo( "absolute" );
			ui.offset = this.positionAbs;
		}
		return $.Widget.prototype._trigger.call( this, type, event, ui );
	},

	plugins: {},

	_uiHash: function() {
		return {
			helper: this.helper,
			position: this.position,
			originalPosition: this.originalPosition,
			offset: this.positionAbs
		};
	}

} );

$.ui.plugin.add( "draggable", "connectToSortable", {
	start: function( event, ui, draggable ) {
		var uiSortable = $.extend( {}, ui, {
			item: draggable.element
		} );

		draggable.sortables = [];
		$( draggable.options.connectToSortable ).each( function() {
			var sortable = $( this ).sortable( "instance" );

			if ( sortable && !sortable.options.disabled ) {
				draggable.sortables.push( sortable );

				// RefreshPositions is called at drag start to refresh the
containerCache
				// which is used in drag. This ensures it's initialized and
synchronized
				// with any changes that might have happened on the page since
initialization.
				sortable.refreshPositions();
				sortable._trigger( "activate", event, uiSortable );
			}
		} );
	},
	stop: function( event, ui, draggable ) {
		var uiSortable = $.extend( {}, ui, {
			item: draggable.element
		} );

		draggable.cancelHelperRemoval = false;

		$.each( draggable.sortables, function() {
			var sortable = this;

			if ( sortable.isOver ) {
				sortable.isOver = 0;

				// Allow this sortable to handle removing the helper
				draggable.cancelHelperRemoval = true;
				sortable.cancelHelperRemoval = false;

				// Use _storedCSS To restore properties in the sortable,
				// as this also handles revert (#9675) since the draggable
				// may have modified them in unexpected ways (#8809)
				sortable._storedCSS = {
					position: sortable.placeholder.css( "position" ),
					top: sortable.placeholder.css( "top" ),
					left: sortable.placeholder.css( "left" )
				};

				sortable._mouseStop( event );

				// Once drag has ended, the sortable should return to using
				// its original helper, not the shared helper from draggable
				sortable.options.helper = sortable.options._helper;
			} else {

				// Prevent this Sortable from removing the helper.
				// However, don't set the draggable to remove the helper
				// either as another connected Sortable may yet handle the removal.
				sortable.cancelHelperRemoval = true;

				sortable._trigger( "deactivate", event, uiSortable );
			}
		} );
	},
	drag: function( event, ui, draggable ) {
		$.each( draggable.sortables, function() {
			var innermostIntersecting = false,
				sortable = this;

			// Copy over variables that sortable's _intersectsWith uses
			sortable.positionAbs = draggable.positionAbs;
			sortable.helperProportions = draggable.helperProportions;
			sortable.offset.click = draggable.offset.click;

			if ( sortable._intersectsWith( sortable.containerCache ) ) {
				innermostIntersecting = true;

				$.each( draggable.sortables, function() {

					// Copy over variables that sortable's _intersectsWith uses
					this.positionAbs = draggable.positionAbs;
					this.helperProportions = draggable.helperProportions;
					this.offset.click = draggable.offset.click;

					if ( this !== sortable &&
							this._intersectsWith( this.containerCache ) &&
							$.contains( sortable.element[ 0 ], this.element[ 0 ] ) ) {
						innermostIntersecting = false;
					}

					return innermostIntersecting;
				} );
			}

			if ( innermostIntersecting ) {

				// If it intersects, we use a little isOver variable and set it once,
				// so that the move-in stuff gets fired only once.
				if ( !sortable.isOver ) {
					sortable.isOver = 1;

					// Store draggable's parent in case we need to reappend to it
later.
					draggable._parent = ui.helper.parent();

					sortable.currentItem = ui.helper
						.appendTo( sortable.element )
						.data( "ui-sortable-item", true );

					// Store helper option to later restore it
					sortable.options._helper = sortable.options.helper;

					sortable.options.helper = function() {
						return ui.helper[ 0 ];
					};

					// Fire the start events of the sortable with our passed browser
event,
					// and our own helper (so it doesn't create a new one)
					event.target = sortable.currentItem[ 0 ];
					sortable._mouseCapture( event, true );
					sortable._mouseStart( event, true, true );

					// Because the browser event is way off the new appended portlet,
					// modify necessary variables to reflect the changes
					sortable.offset.click.top = draggable.offset.click.top;
					sortable.offset.click.left = draggable.offset.click.left;
					sortable.offset.parent.left -= draggable.offset.parent.left -
						sortable.offset.parent.left;
					sortable.offset.parent.top -= draggable.offset.parent.top -
						sortable.offset.parent.top;

					draggable._trigger( "toSortable", event );

					// Inform draggable that the helper is in a valid drop zone,
					// used solely in the revert option to handle
"valid/invalid".
					draggable.dropped = sortable.element;

					// Need to refreshPositions of all sortables in the case that
					// adding to one sortable changes the location of the other sortables
(#9675)
					$.each( draggable.sortables, function() {
						this.refreshPositions();
					} );

					// Hack so receive/update callbacks work (mostly)
					draggable.currentItem = draggable.element;
					sortable.fromOutside = draggable;
				}

				if ( sortable.currentItem ) {
					sortable._mouseDrag( event );

					// Copy the sortable's position because the draggable's can
potentially reflect
					// a relative position, while sortable is always absolute, which the
dragged
					// element has now become. (#8809)
					ui.position = sortable.position;
				}
			} else {

				// If it doesn't intersect with the sortable, and it intersected
before,
				// we fake the drag stop of the sortable, but make sure it doesn't
remove
				// the helper by using cancelHelperRemoval.
				if ( sortable.isOver ) {

					sortable.isOver = 0;
					sortable.cancelHelperRemoval = true;

					// Calling sortable's mouseStop would trigger a revert,
					// so revert must be temporarily false until after mouseStop is
called.
					sortable.options._revert = sortable.options.revert;
					sortable.options.revert = false;

					sortable._trigger( "out", event, sortable._uiHash( sortable
) );
					sortable._mouseStop( event, true );

					// Restore sortable behaviors that were modfied
					// when the draggable entered the sortable area (#9481)
					sortable.options.revert = sortable.options._revert;
					sortable.options.helper = sortable.options._helper;

					if ( sortable.placeholder ) {
						sortable.placeholder.remove();
					}

					// Restore and recalculate the draggable's offset considering the
sortable
					// may have modified them in unexpected ways. (#8809, #10669)
					ui.helper.appendTo( draggable._parent );
					draggable._refreshOffsets( event );
					ui.position = draggable._generatePosition( event, true );

					draggable._trigger( "fromSortable", event );

					// Inform draggable that the helper is no longer in a valid drop zone
					draggable.dropped = false;

					// Need to refreshPositions of all sortables just in case removing
					// from one sortable changes the location of other sortables (#9675)
					$.each( draggable.sortables, function() {
						this.refreshPositions();
					} );
				}
			}
		} );
	}
} );

$.ui.plugin.add( "draggable", "cursor", {
	start: function( event, ui, instance ) {
		var t = $( "body" ),
			o = instance.options;

		if ( t.css( "cursor" ) ) {
			o._cursor = t.css( "cursor" );
		}
		t.css( "cursor", o.cursor );
	},
	stop: function( event, ui, instance ) {
		var o = instance.options;
		if ( o._cursor ) {
			$( "body" ).css( "cursor", o._cursor );
		}
	}
} );

$.ui.plugin.add( "draggable", "opacity", {
	start: function( event, ui, instance ) {
		var t = $( ui.helper ),
			o = instance.options;
		if ( t.css( "opacity" ) ) {
			o._opacity = t.css( "opacity" );
		}
		t.css( "opacity", o.opacity );
	},
	stop: function( event, ui, instance ) {
		var o = instance.options;
		if ( o._opacity ) {
			$( ui.helper ).css( "opacity", o._opacity );
		}
	}
} );

$.ui.plugin.add( "draggable", "scroll", {
	start: function( event, ui, i ) {
		if ( !i.scrollParentNotHidden ) {
			i.scrollParentNotHidden = i.helper.scrollParent( false );
		}

		if ( i.scrollParentNotHidden[ 0 ] !== i.document[ 0 ] &&
				i.scrollParentNotHidden[ 0 ].tagName !== "HTML" ) {
			i.overflowOffset = i.scrollParentNotHidden.offset();
		}
	},
	drag: function( event, ui, i  ) {

		var o = i.options,
			scrolled = false,
			scrollParent = i.scrollParentNotHidden[ 0 ],
			document = i.document[ 0 ];

		if ( scrollParent !== document && scrollParent.tagName !==
"HTML" ) {
			if ( !o.axis || o.axis !== "x" ) {
				if ( ( i.overflowOffset.top + scrollParent.offsetHeight ) - event.pageY
<
						o.scrollSensitivity ) {
					scrollParent.scrollTop = scrolled = scrollParent.scrollTop +
o.scrollSpeed;
				} else if ( event.pageY - i.overflowOffset.top < o.scrollSensitivity
) {
					scrollParent.scrollTop = scrolled = scrollParent.scrollTop -
o.scrollSpeed;
				}
			}

			if ( !o.axis || o.axis !== "y" ) {
				if ( ( i.overflowOffset.left + scrollParent.offsetWidth ) - event.pageX
<
						o.scrollSensitivity ) {
					scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft +
o.scrollSpeed;
				} else if ( event.pageX - i.overflowOffset.left <
o.scrollSensitivity ) {
					scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft -
o.scrollSpeed;
				}
			}

		} else {

			if ( !o.axis || o.axis !== "x" ) {
				if ( event.pageY - $( document ).scrollTop() < o.scrollSensitivity )
{
					scrolled = $( document ).scrollTop( $( document ).scrollTop() -
o.scrollSpeed );
				} else if ( $( window ).height() - ( event.pageY - $( document
).scrollTop() ) <
						o.scrollSensitivity ) {
					scrolled = $( document ).scrollTop( $( document ).scrollTop() +
o.scrollSpeed );
				}
			}

			if ( !o.axis || o.axis !== "y" ) {
				if ( event.pageX - $( document ).scrollLeft() < o.scrollSensitivity
) {
					scrolled = $( document ).scrollLeft(
						$( document ).scrollLeft() - o.scrollSpeed
					);
				} else if ( $( window ).width() - ( event.pageX - $( document
).scrollLeft() ) <
						o.scrollSensitivity ) {
					scrolled = $( document ).scrollLeft(
						$( document ).scrollLeft() + o.scrollSpeed
					);
				}
			}

		}

		if ( scrolled !== false && $.ui.ddmanager &&
!o.dropBehaviour ) {
			$.ui.ddmanager.prepareOffsets( i, event );
		}

	}
} );

$.ui.plugin.add( "draggable", "snap", {
	start: function( event, ui, i ) {

		var o = i.options;

		i.snapElements = [];

		$( o.snap.constructor !== String ? ( o.snap.items ||
":data(ui-draggable)" ) : o.snap )
			.each( function() {
				var $t = $( this ),
					$o = $t.offset();
				if ( this !== i.element[ 0 ] ) {
					i.snapElements.push( {
						item: this,
						width: $t.outerWidth(), height: $t.outerHeight(),
						top: $o.top, left: $o.left
					} );
				}
			} );

	},
	drag: function( event, ui, inst ) {

		var ts, bs, ls, rs, l, r, t, b, i, first,
			o = inst.options,
			d = o.snapTolerance,
			x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
			y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;

		for ( i = inst.snapElements.length - 1; i >= 0; i-- ) {

			l = inst.snapElements[ i ].left - inst.margins.left;
			r = l + inst.snapElements[ i ].width;
			t = inst.snapElements[ i ].top - inst.margins.top;
			b = t + inst.snapElements[ i ].height;

			if ( x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d ||
					!$.contains( inst.snapElements[ i ].item.ownerDocument,
					inst.snapElements[ i ].item ) ) {
				if ( inst.snapElements[ i ].snapping ) {
					( inst.options.snap.release &&
						inst.options.snap.release.call(
							inst.element,
							event,
							$.extend( inst._uiHash(), { snapItem: inst.snapElements[ i ].item }
)
						) );
				}
				inst.snapElements[ i ].snapping = false;
				continue;
			}

			if ( o.snapMode !== "inner" ) {
				ts = Math.abs( t - y2 ) <= d;
				bs = Math.abs( b - y1 ) <= d;
				ls = Math.abs( l - x2 ) <= d;
				rs = Math.abs( r - x1 ) <= d;
				if ( ts ) {
					ui.position.top = inst._convertPositionTo( "relative", {
						top: t - inst.helperProportions.height,
						left: 0
					} ).top;
				}
				if ( bs ) {
					ui.position.top = inst._convertPositionTo( "relative", {
						top: b,
						left: 0
					} ).top;
				}
				if ( ls ) {
					ui.position.left = inst._convertPositionTo( "relative", {
						top: 0,
						left: l - inst.helperProportions.width
					} ).left;
				}
				if ( rs ) {
					ui.position.left = inst._convertPositionTo( "relative", {
						top: 0,
						left: r
					} ).left;
				}
			}

			first = ( ts || bs || ls || rs );

			if ( o.snapMode !== "outer" ) {
				ts = Math.abs( t - y1 ) <= d;
				bs = Math.abs( b - y2 ) <= d;
				ls = Math.abs( l - x1 ) <= d;
				rs = Math.abs( r - x2 ) <= d;
				if ( ts ) {
					ui.position.top = inst._convertPositionTo( "relative", {
						top: t,
						left: 0
					} ).top;
				}
				if ( bs ) {
					ui.position.top = inst._convertPositionTo( "relative", {
						top: b - inst.helperProportions.height,
						left: 0
					} ).top;
				}
				if ( ls ) {
					ui.position.left = inst._convertPositionTo( "relative", {
						top: 0,
						left: l
					} ).left;
				}
				if ( rs ) {
					ui.position.left = inst._convertPositionTo( "relative", {
						top: 0,
						left: r - inst.helperProportions.width
					} ).left;
				}
			}

			if ( !inst.snapElements[ i ].snapping && ( ts || bs || ls || rs
|| first ) ) {
				( inst.options.snap.snap &&
					inst.options.snap.snap.call(
						inst.element,
						event,
						$.extend( inst._uiHash(), {
							snapItem: inst.snapElements[ i ].item
						} ) ) );
			}
			inst.snapElements[ i ].snapping = ( ts || bs || ls || rs || first );

		}

	}
} );

$.ui.plugin.add( "draggable", "stack", {
	start: function( event, ui, instance ) {
		var min,
			o = instance.options,
			group = $.makeArray( $( o.stack ) ).sort( function( a, b ) {
				return ( parseInt( $( a ).css( "zIndex" ), 10 ) || 0 ) -
					( parseInt( $( b ).css( "zIndex" ), 10 ) || 0 );
			} );

		if ( !group.length ) { return; }

		min = parseInt( $( group[ 0 ] ).css( "zIndex" ), 10 ) || 0;
		$( group ).each( function( i ) {
			$( this ).css( "zIndex", min + i );
		} );
		this.css( "zIndex", ( min + group.length ) );
	}
} );

$.ui.plugin.add( "draggable", "zIndex", {
	start: function( event, ui, instance ) {
		var t = $( ui.helper ),
			o = instance.options;

		if ( t.css( "zIndex" ) ) {
			o._zIndex = t.css( "zIndex" );
		}
		t.css( "zIndex", o.zIndex );
	},
	stop: function( event, ui, instance ) {
		var o = instance.options;

		if ( o._zIndex ) {
			$( ui.helper ).css( "zIndex", o._zIndex );
		}
	}
} );

var widgetsDraggable = $.ui.draggable;




}));js/jquery.magnific-popup.min.js000064400000047370151167223230012551
0ustar00/*! Magnific Popup - v1.1.0 - 2016-02-20
* http://dimsemenov.com/plugins/magnific-popup/
* Copyright (c) 2016 Dmitry Semenov; */
!function(a){"function"==typeof
define&&define.amd?define(["jquery"],a):a("object"==typeof
exports?require("jquery"):window.jQuery||window.Zepto)}(function(a){var
b,c,d,e,f,g,h="Close",i="BeforeClose",j="AfterClose",k="BeforeAppend",l="MarkupParse",m="Open",n="Change",o="mfp",p="."+o,q="mfp-ready",r="mfp-removing",s="mfp-prevent-close",t=function(){},u=!!window.jQuery,v=a(window),w=function(a,c){b.ev.on(o+a+p,c)},x=function(b,c,d,e){var
f=document.createElement("div");return
f.className="mfp-"+b,d&&(f.innerHTML=d),e?c&&c.appendChild(f):(f=a(f),c&&f.appendTo(c)),f},y=function(c,d){b.ev.triggerHandler(o+c,d),b.st.callbacks&&(c=c.charAt(0).toLowerCase()+c.slice(1),b.st.callbacks[c]&&b.st.callbacks[c].apply(b,a.isArray(d)?d:[d]))},z=function(c){return
c===g&&b.currTemplate.closeBtn||(b.currTemplate.closeBtn=a(b.st.closeMarkup.replace("%title%",b.st.tClose)),g=c),b.currTemplate.closeBtn},A=function(){a.magnificPopup.instance||(b=new
t,b.init(),a.magnificPopup.instance=b)},B=function(){var
a=document.createElement("p").style,b=["ms","O","Moz","Webkit"];if(void
0!==a.transition)return!0;for(;b.length;)if(b.pop()+"Transition"in
a)return!0;return!1};t.prototype={constructor:t,init:function(){var
c=navigator.appVersion;b.isLowIE=b.isIE8=document.all&&!document.addEventListener,b.isAndroid=/android/gi.test(c),b.isIOS=/iphone|ipad|ipod/gi.test(c),b.supportsTransition=B(),b.probablyMobile=b.isAndroid||b.isIOS||/(Opera
Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows
Phone)|IEMobile/i.test(navigator.userAgent),d=a(document),b.popupsCache={}},open:function(c){var
e;if(c.isObj===!1){b.items=c.items.toArray(),b.index=0;var
g,h=c.items;for(e=0;e<h.length;e++)if(g=h[e],g.parsed&&(g=g.el[0]),g===c.el[0]){b.index=e;break}}else
b.items=a.isArray(c.items)?c.items:[c.items],b.index=c.index||0;if(b.isOpen)return
void
b.updateItemHTML();b.types=[],f="",c.mainEl&&c.mainEl.length?b.ev=c.mainEl.eq(0):b.ev=d,c.key?(b.popupsCache[c.key]||(b.popupsCache[c.key]={}),b.currTemplate=b.popupsCache[c.key]):b.currTemplate={},b.st=a.extend(!0,{},a.magnificPopup.defaults,c),b.fixedContentPos="auto"===b.st.fixedContentPos?!b.probablyMobile:b.st.fixedContentPos,b.st.modal&&(b.st.closeOnContentClick=!1,b.st.closeOnBgClick=!1,b.st.showCloseBtn=!1,b.st.enableEscapeKey=!1),b.bgOverlay||(b.bgOverlay=x("bg").on("click"+p,function(){b.close()}),b.wrap=x("wrap").attr("tabindex",-1).on("click"+p,function(a){b._checkIfClose(a.target)&&b.close()}),b.container=x("container",b.wrap)),b.contentContainer=x("content"),b.st.preloader&&(b.preloader=x("preloader",b.container,b.st.tLoading));var
i=a.magnificPopup.modules;for(e=0;e<i.length;e++){var
j=i[e];j=j.charAt(0).toUpperCase()+j.slice(1),b["init"+j].call(b)}y("BeforeOpen"),b.st.showCloseBtn&&(b.st.closeBtnInside?(w(l,function(a,b,c,d){c.close_replaceWith=z(d.type)}),f+="
mfp-close-btn-in"):b.wrap.append(z())),b.st.alignTop&&(f+="
mfp-align-top"),b.fixedContentPos?b.wrap.css({overflow:b.st.overflowY,overflowX:"hidden",overflowY:b.st.overflowY}):b.wrap.css({top:v.scrollTop(),position:"absolute"}),(b.st.fixedBgPos===!1||"auto"===b.st.fixedBgPos&&!b.fixedContentPos)&&b.bgOverlay.css({height:d.height(),position:"absolute"}),b.st.enableEscapeKey&&d.on("keyup"+p,function(a){27===a.keyCode&&b.close()}),v.on("resize"+p,function(){b.updateSize()}),b.st.closeOnContentClick||(f+="
mfp-auto-cursor"),f&&b.wrap.addClass(f);var
k=b.wH=v.height(),n={};if(b.fixedContentPos&&b._hasScrollBar(k)){var
o=b._getScrollbarSize();o&&(n.marginRight=o)}b.fixedContentPos&&(b.isIE7?a("body,
html").css("overflow","hidden"):n.overflow="hidden");var
r=b.st.mainClass;return b.isIE7&&(r+="
mfp-ie7"),r&&b._addClassToMFP(r),b.updateItemHTML(),y("BuildControls"),a("html").css(n),b.bgOverlay.add(b.wrap).prependTo(b.st.prependTo||a(document.body)),b._lastFocusedEl=document.activeElement,setTimeout(function(){b.content?(b._addClassToMFP(q),b._setFocus()):b.bgOverlay.addClass(q),d.on("focusin"+p,b._onFocusIn)},16),b.isOpen=!0,b.updateSize(k),y(m),c},close:function(){b.isOpen&&(y(i),b.isOpen=!1,b.st.removalDelay&&!b.isLowIE&&b.supportsTransition?(b._addClassToMFP(r),setTimeout(function(){b._close()},b.st.removalDelay)):b._close())},_close:function(){y(h);var
c=r+" "+q+"
";if(b.bgOverlay.detach(),b.wrap.detach(),b.container.empty(),b.st.mainClass&&(c+=b.st.mainClass+"
"),b._removeClassFromMFP(c),b.fixedContentPos){var
e={marginRight:""};b.isIE7?a("body,
html").css("overflow",""):e.overflow="",a("html").css(e)}d.off("keyup"+p+"
focusin"+p),b.ev.off(p),b.wrap.attr("class","mfp-wrap").removeAttr("style"),b.bgOverlay.attr("class","mfp-bg"),b.container.attr("class","mfp-container"),!b.st.showCloseBtn||b.st.closeBtnInside&&b.currTemplate[b.currItem.type]!==!0||b.currTemplate.closeBtn&&b.currTemplate.closeBtn.detach(),b.st.autoFocusLast&&b._lastFocusedEl&&a(b._lastFocusedEl).focus(),b.currItem=null,b.content=null,b.currTemplate=null,b.prevHeight=0,y(j)},updateSize:function(a){if(b.isIOS){var
c=document.documentElement.clientWidth/window.innerWidth,d=window.innerHeight*c;b.wrap.css("height",d),b.wH=d}else
b.wH=a||v.height();b.fixedContentPos||b.wrap.css("height",b.wH),y("Resize")},updateItemHTML:function(){var
c=b.items[b.index];b.contentContainer.detach(),b.content&&b.content.detach(),c.parsed||(c=b.parseEl(b.index));var
d=c.type;if(y("BeforeChange",[b.currItem?b.currItem.type:"",d]),b.currItem=c,!b.currTemplate[d]){var
f=b.st[d]?b.st[d].markup:!1;y("FirstMarkupParse",f),f?b.currTemplate[d]=a(f):b.currTemplate[d]=!0}e&&e!==c.type&&b.container.removeClass("mfp-"+e+"-holder");var
g=b["get"+d.charAt(0).toUpperCase()+d.slice(1)](c,b.currTemplate[d]);b.appendContent(g,d),c.preloaded=!0,y(n,c),e=c.type,b.container.prepend(b.contentContainer),y("AfterChange")},appendContent:function(a,c){b.content=a,a?b.st.showCloseBtn&&b.st.closeBtnInside&&b.currTemplate[c]===!0?b.content.find(".mfp-close").length||b.content.append(z()):b.content=a:b.content="",y(k),b.container.addClass("mfp-"+c+"-holder"),b.contentContainer.append(b.content)},parseEl:function(c){var
d,e=b.items[c];if(e.tagName?e={el:a(e)}:(d=e.type,e={data:e,src:e.src}),e.el){for(var
f=b.types,g=0;g<f.length;g++)if(e.el.hasClass("mfp-"+f[g])){d=f[g];break}e.src=e.el.attr("data-mfp-src"),e.src||(e.src=e.el.attr("href"))}return
e.type=d||b.st.type||"inline",e.index=c,e.parsed=!0,b.items[c]=e,y("ElementParse",e),b.items[c]},addGroup:function(a,c){var
d=function(d){d.mfpEl=this,b._openClick(d,a,c)};c||(c={});var
e="click.magnificPopup";c.mainEl=a,c.items?(c.isObj=!0,a.off(e).on(e,d)):(c.isObj=!1,c.delegate?a.off(e).on(e,c.delegate,d):(c.items=a,a.off(e).on(e,d)))},_openClick:function(c,d,e){var
f=void
0!==e.midClick?e.midClick:a.magnificPopup.defaults.midClick;if(f||!(2===c.which||c.ctrlKey||c.metaKey||c.altKey||c.shiftKey)){var
g=void
0!==e.disableOn?e.disableOn:a.magnificPopup.defaults.disableOn;if(g)if(a.isFunction(g)){if(!g.call(b))return!0}else
if(v.width()<g)return!0;c.type&&(c.preventDefault(),b.isOpen&&c.stopPropagation()),e.el=a(c.mfpEl),e.delegate&&(e.items=d.find(e.delegate)),b.open(e)}},updateStatus:function(a,d){if(b.preloader){c!==a&&b.container.removeClass("mfp-s-"+c),d||"loading"!==a||(d=b.st.tLoading);var
e={status:a,text:d};y("UpdateStatus",e),a=e.status,d=e.text,b.preloader.html(d),b.preloader.find("a").on("click",function(a){a.stopImmediatePropagation()}),b.container.addClass("mfp-s-"+a),c=a}},_checkIfClose:function(c){if(!a(c).hasClass(s)){var
d=b.st.closeOnContentClick,e=b.st.closeOnBgClick;if(d&&e)return!0;if(!b.content||a(c).hasClass("mfp-close")||b.preloader&&c===b.preloader[0])return!0;if(c===b.content[0]||a.contains(b.content[0],c)){if(d)return!0}else
if(e&&a.contains(document,c))return!0;return!1}},_addClassToMFP:function(a){b.bgOverlay.addClass(a),b.wrap.addClass(a)},_removeClassFromMFP:function(a){this.bgOverlay.removeClass(a),b.wrap.removeClass(a)},_hasScrollBar:function(a){return(b.isIE7?d.height():document.body.scrollHeight)>(a||v.height())},_setFocus:function(){(b.st.focus?b.content.find(b.st.focus).eq(0):b.wrap).focus()},_onFocusIn:function(c){return
c.target===b.wrap[0]||a.contains(b.wrap[0],c.target)?void
0:(b._setFocus(),!1)},_parseMarkup:function(b,c,d){var
e;d.data&&(c=a.extend(d.data,c)),y(l,[b,c,d]),a.each(c,function(c,d){if(void
0===d||d===!1)return!0;if(e=c.split("_"),e.length>1){var
f=b.find(p+"-"+e[0]);if(f.length>0){var
g=e[1];"replaceWith"===g?f[0]!==d[0]&&f.replaceWith(d):"img"===g?f.is("img")?f.attr("src",d):f.replaceWith(a("<img>").attr("src",d).attr("class",f.attr("class"))):f.attr(e[1],d)}}else
b.find(p+"-"+c).html(d)})},_getScrollbarSize:function(){if(void
0===b.scrollbarSize){var
a=document.createElement("div");a.style.cssText="width:
99px; height: 99px; overflow: scroll; position: absolute; top:
-9999px;",document.body.appendChild(a),b.scrollbarSize=a.offsetWidth-a.clientWidth,document.body.removeChild(a)}return
b.scrollbarSize}},a.magnificPopup={instance:null,proto:t.prototype,modules:[],open:function(b,c){return
A(),b=b?a.extend(!0,{},b):{},b.isObj=!0,b.index=c||0,this.instance.open(b)},close:function(){return
a.magnificPopup.instance&&a.magnificPopup.instance.close()},registerModule:function(b,c){c.options&&(a.magnificPopup.defaults[b]=c.options),a.extend(this.proto,c.proto),this.modules.push(b)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button
title="%title%" type="button"
class="mfp-close">&#215;</button>',tClose:"Close
(Esc)",tLoading:"Loading...",autoFocusLast:!0}},a.fn.magnificPopup=function(c){A();var
d=a(this);if("string"==typeof c)if("open"===c){var
e,f=u?d.data("magnificPopup"):d[0].magnificPopup,g=parseInt(arguments[1],10)||0;f.items?e=f.items[g]:(e=d,f.delegate&&(e=e.find(f.delegate)),e=e.eq(g)),b._openClick({mfpEl:e},d,f)}else
b.isOpen&&b[c].apply(b,Array.prototype.slice.call(arguments,1));else
c=a.extend(!0,{},c),u?d.data("magnificPopup",c):d[0].magnificPopup=c,b.addGroup(d,c);return
d};var
C,D,E,F="inline",G=function(){E&&(D.after(E.addClass(C)).detach(),E=null)};a.magnificPopup.registerModule(F,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content
not
found"},proto:{initInline:function(){b.types.push(F),w(h+"."+F,function(){G()})},getInline:function(c,d){if(G(),c.src){var
e=b.st.inline,f=a(c.src);if(f.length){var
g=f[0].parentNode;g&&g.tagName&&(D||(C=e.hiddenClass,D=x(C),C="mfp-"+C),E=f.after(D).detach().removeClass(C)),b.updateStatus("ready")}else
b.updateStatus("error",e.tNotFound),f=a("<div>");return
c.inlineElement=f,f}return
b.updateStatus("ready"),b._parseMarkup(d,{},c),d}}});var
H,I="ajax",J=function(){H&&a(document.body).removeClass(H)},K=function(){J(),b.req&&b.req.abort()};a.magnificPopup.registerModule(I,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'<a
href="%url%">The content</a> could not be
loaded.'},proto:{initAjax:function(){b.types.push(I),H=b.st.ajax.cursor,w(h+"."+I,K),w("BeforeChange."+I,K)},getAjax:function(c){H&&a(document.body).addClass(H),b.updateStatus("loading");var
d=a.extend({url:c.src,success:function(d,e,f){var
g={data:d,xhr:f};y("ParseAjax",g),b.appendContent(a(g.data),I),c.finished=!0,J(),b._setFocus(),setTimeout(function(){b.wrap.addClass(q)},16),b.updateStatus("ready"),y("AjaxContentAdded")},error:function(){J(),c.finished=c.loadError=!0,b.updateStatus("error",b.st.ajax.tError.replace("%url%",c.src))}},b.st.ajax.settings);return
b.req=a.ajax(d),""}}});var
L,M=function(c){if(c.data&&void 0!==c.data.title)return
c.data.title;var d=b.st.image.titleSrc;if(d){if(a.isFunction(d))return
d.call(b,c);if(c.el)return
c.el.attr(d)||""}return""};a.magnificPopup.registerModule("image",{options:{markup:'<div
class="mfp-figure"><div
class="mfp-close"></div><figure><div
class="mfp-img"></div><figcaption><div
class="mfp-bottom-bar"><div
class="mfp-title"></div><div
class="mfp-counter"></div></div></figcaption></figure></div>',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'<a
href="%url%">The image</a> could not be
loaded.'},proto:{initImage:function(){var
c=b.st.image,d=".image";b.types.push("image"),w(m+d,function(){"image"===b.currItem.type&&c.cursor&&a(document.body).addClass(c.cursor)}),w(h+d,function(){c.cursor&&a(document.body).removeClass(c.cursor),v.off("resize"+p)}),w("Resize"+d,b.resizeImage),b.isLowIE&&w("AfterChange",b.resizeImage)},resizeImage:function(){var
a=b.currItem;if(a&&a.img&&b.st.image.verticalFit){var
c=0;b.isLowIE&&(c=parseInt(a.img.css("padding-top"),10)+parseInt(a.img.css("padding-bottom"),10)),a.img.css("max-height",b.wH-c)}},_onImageHasSize:function(a){a.img&&(a.hasSize=!0,L&&clearInterval(L),a.isCheckingImgSize=!1,y("ImageHasSize",a),a.imgHidden&&(b.content&&b.content.removeClass("mfp-loading"),a.imgHidden=!1))},findImageSize:function(a){var
c=0,d=a.img[0],e=function(f){L&&clearInterval(L),L=setInterval(function(){return
d.naturalWidth>0?void
b._onImageHasSize(a):(c>200&&clearInterval(L),c++,void(3===c?e(10):40===c?e(50):100===c&&e(500)))},f)};e(1)},getImage:function(c,d){var
e=0,f=function(){c&&(c.img[0].complete?(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("ready")),c.hasSize=!0,c.loaded=!0,y("ImageLoadComplete")):(e++,200>e?setTimeout(f,100):g()))},g=function(){c&&(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("error",h.tError.replace("%url%",c.src))),c.hasSize=!0,c.loaded=!0,c.loadError=!0)},h=b.st.image,i=d.find(".mfp-img");if(i.length){var
j=document.createElement("img");j.className="mfp-img",c.el&&c.el.find("img").length&&(j.alt=c.el.find("img").attr("alt")),c.img=a(j).on("load.mfploader",f).on("error.mfploader",g),j.src=c.src,i.is("img")&&(c.img=c.img.clone()),j=c.img[0],j.naturalWidth>0?c.hasSize=!0:j.width||(c.hasSize=!1)}return
b._parseMarkup(d,{title:M(c),img_replaceWith:c.img},c),b.resizeImage(),c.hasSize?(L&&clearInterval(L),c.loadError?(d.addClass("mfp-loading"),b.updateStatus("error",h.tError.replace("%url%",c.src))):(d.removeClass("mfp-loading"),b.updateStatus("ready")),d):(b.updateStatus("loading"),c.loading=!0,c.hasSize||(c.imgHidden=!0,d.addClass("mfp-loading"),b.findImageSize(c)),d)}}});var
N,O=function(){return void 0===N&&(N=void
0!==document.createElement("p").style.MozTransform),N};a.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(a){return
a.is("img")?a:a.find("img")}},proto:{initZoom:function(){var
a,c=b.st.zoom,d=".zoom";if(c.enabled&&b.supportsTransition){var
e,f,g=c.duration,j=function(a){var
b=a.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),d="all
"+c.duration/1e3+"s
"+c.easing,e={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},f="transition";return
e["-webkit-"+f]=e["-moz-"+f]=e["-o-"+f]=e[f]=d,b.css(e),b},k=function(){b.content.css("visibility","visible")};w("BuildControls"+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.content.css("visibility","hidden"),a=b._getItemToZoom(),!a)return
void
k();f=j(a),f.css(b._getOffset()),b.wrap.append(f),e=setTimeout(function(){f.css(b._getOffset(!0)),e=setTimeout(function(){k(),setTimeout(function(){f.remove(),a=f=null,y("ZoomAnimationEnded")},16)},g)},16)}}),w(i+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.st.removalDelay=g,!a){if(a=b._getItemToZoom(),!a)return;f=j(a)}f.css(b._getOffset(!0)),b.wrap.append(f),b.content.css("visibility","hidden"),setTimeout(function(){f.css(b._getOffset())},16)}}),w(h+d,function(){b._allowZoom()&&(k(),f&&f.remove(),a=null)})}},_allowZoom:function(){return"image"===b.currItem.type},_getItemToZoom:function(){return
b.currItem.hasSize?b.currItem.img:!1},_getOffset:function(c){var
d;d=c?b.currItem.img:b.st.zoom.opener(b.currItem.el||b.currItem);var
e=d.offset(),f=parseInt(d.css("padding-top"),10),g=parseInt(d.css("padding-bottom"),10);e.top-=a(window).scrollTop()-f;var
h={width:d.width(),height:(u?d.innerHeight():d[0].offsetHeight)-g-f};return
O()?h["-moz-transform"]=h.transform="translate("+e.left+"px,"+e.top+"px)":(h.left=e.left,h.top=e.top),h}}});var
P="iframe",Q="//about:blank",R=function(a){if(b.currTemplate[P]){var
c=b.currTemplate[P].find("iframe");c.length&&(a||(c[0].src=Q),b.isIE8&&c.css("display",a?"block":"none"))}};a.magnificPopup.registerModule(P,{options:{markup:'<div
class="mfp-iframe-scaler"><div
class="mfp-close"></div><iframe
class="mfp-iframe" src="//about:blank"
frameborder="0"
allowfullscreen></iframe></div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){b.types.push(P),w("BeforeChange",function(a,b,c){b!==c&&(b===P?R():c===P&&R(!0))}),w(h+"."+P,function(){R()})},getIframe:function(c,d){var
e=c.src,f=b.st.iframe;a.each(f.patterns,function(){return
e.indexOf(this.index)>-1?(this.id&&(e="string"==typeof
this.id?e.substr(e.lastIndexOf(this.id)+this.id.length,e.length):this.id.call(this,e)),e=this.src.replace("%id%",e),!1):void
0});var g={};return
f.srcAction&&(g[f.srcAction]=e),b._parseMarkup(d,g,c),b.updateStatus("ready"),d}}});var
S=function(a){var c=b.items.length;return
a>c-1?a-c:0>a?c+a:a},T=function(a,b,c){return
a.replace(/%curr%/gi,b+1).replace(/%total%/gi,c)};a.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'<button
title="%title%" type="button" class="mfp-arrow
mfp-arrow-%dir%"></button>',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous
(Left arrow key)",tNext:"Next (Right arrow
key)",tCounter:"%curr% of
%total%"},proto:{initGallery:function(){var
c=b.st.gallery,e=".mfp-gallery";return
b.direction=!0,c&&c.enabled?(f+="
mfp-gallery",w(m+e,function(){c.navigateByImgClick&&b.wrap.on("click"+e,".mfp-img",function(){return
b.items.length>1?(b.next(),!1):void
0}),d.on("keydown"+e,function(a){37===a.keyCode?b.prev():39===a.keyCode&&b.next()})}),w("UpdateStatus"+e,function(a,c){c.text&&(c.text=T(c.text,b.currItem.index,b.items.length))}),w(l+e,function(a,d,e,f){var
g=b.items.length;e.counter=g>1?T(c.tCounter,f.index,g):""}),w("BuildControls"+e,function(){if(b.items.length>1&&c.arrows&&!b.arrowLeft){var
d=c.arrowMarkup,e=b.arrowLeft=a(d.replace(/%title%/gi,c.tPrev).replace(/%dir%/gi,"left")).addClass(s),f=b.arrowRight=a(d.replace(/%title%/gi,c.tNext).replace(/%dir%/gi,"right")).addClass(s);e.click(function(){b.prev()}),f.click(function(){b.next()}),b.container.append(e.add(f))}}),w(n+e,function(){b._preloadTimeout&&clearTimeout(b._preloadTimeout),b._preloadTimeout=setTimeout(function(){b.preloadNearbyImages(),b._preloadTimeout=null},16)}),void
w(h+e,function(){d.off(e),b.wrap.off("click"+e),b.arrowRight=b.arrowLeft=null})):!1},next:function(){b.direction=!0,b.index=S(b.index+1),b.updateItemHTML()},prev:function(){b.direction=!1,b.index=S(b.index-1),b.updateItemHTML()},goTo:function(a){b.direction=a>=b.index,b.index=a,b.updateItemHTML()},preloadNearbyImages:function(){var
a,c=b.st.gallery.preload,d=Math.min(c[0],b.items.length),e=Math.min(c[1],b.items.length);for(a=1;a<=(b.direction?e:d);a++)b._preloadItem(b.index+a);for(a=1;a<=(b.direction?d:e);a++)b._preloadItem(b.index-a)},_preloadItem:function(c){if(c=S(c),!b.items[c].preloaded){var
d=b.items[c];d.parsed||(d=b.parseEl(c)),y("LazyLoad",d),"image"===d.type&&(d.img=a('<img
class="mfp-img"
/>').on("load.mfploader",function(){d.hasSize=!0}).on("error.mfploader",function(){d.hasSize=!0,d.loadError=!0,y("LazyLoadError",d)}).attr("src",d.src)),d.preloaded=!0}}}});var
U="retina";a.magnificPopup.registerModule(U,{options:{replaceSrc:function(a){return
a.src.replace(/\.\w+$/,function(a){return"@2x"+a})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var
a=b.st.retina,c=a.ratio;c=isNaN(c)?c():c,c>1&&(w("ImageHasSize."+U,function(a,b){b.img.css({"max-width":b.img[0].naturalWidth/c,width:"100%"})}),w("ElementParse."+U,function(b,d){d.src=a.replaceSrc(d,c)}))}}}}),A()});js/jquery-search.js000064400000011170151167223230010302
0ustar00/**
 * This file is part of Joomla Estate Agency - Joomla! extension for real
estate
 * agency
 * 
 * @copyright Copyright (C) 2008 - 2020 PHILIP Sylvain. All rights
reserved.
 * @license GNU/GPL, see LICENSE.txt
 */

function JEASearch(formId, options) {
	this.form = jQuery(formId)[0]
	this.forceUpdateLists = true
	this.options = {
		fields : {
			filter_amenities : [],
			filter_area_id : 0,
			filter_bathrooms_min : 0,
			filter_bedrooms_min : 0,
			filter_budget_max : 0,
			filter_budget_min : 0,
			filter_condition : 0,
			filter_department_id : 0,
			filter_floor : '',
			filter_heatingtype : 0,
			filter_hotwatertype : 0,
			filter_land_space_max : 0,
			filter_land_space_min : 0,
			filter_living_space_max :0,
			filter_living_space_min : 0,
			filter_orientation : 0,
			filter_rooms_min : 0,
			filter_search : "",
			filter_town_id : 0,
			filter_transaction_type : "",
			filter_type_id : 0,
			filter_zip_codes : ""
		},
		useAJAX: false,
		transactionType: ""
	}

	jQuery.extend(this.options, options)

	if (this.options.useAJAX) {
		for (var fieldName in this.options.fields) {
			if (fieldName == 'filter_amenities') {
				fieldName = 'filter_amenities[]'
			}
			this.initFieldBehavior(fieldName)
		}
	}
	
	jQuery(formId).on('reset', jQuery.proxy(this.reset, this))
}

JEASearch.prototype.initFieldBehavior = function(fieldName) {

	if (!this.form[fieldName]) {
		return
	}

	switch (fieldName) {
		case 'filter_amenities[]':
			var that = this
			jQuery(this.form).find('[name="filter_amenities[]"]').on('change',
function() {
				var index =
that.options.fields.filter_amenities.indexOf(jQuery(this).val())

				if (jQuery(this).prop('checked') && index == -1) {
					that.options.fields.filter_amenities.push(jQuery(this).val());
				} else if (!jQuery(this).prop('checked') && index
> -1){
					that.options.fields.filter_amenities.splice(index, 1);
				}

				that.forceUpdateLists = true
				that.refresh()
			})
			break
		case 'filter_transaction_type':
			var that = this
			jQuery(this.form).find('[name="filter_transaction_type"]').on('change',
function() {

				if (jQuery(this).prop('checked')) {
					that.options.fields.filter_transaction_type = jQuery(this).val()
				}
				that.forceUpdateLists = true
				that.refresh()
			})
			break
		default:
			var field = jQuery(this.form[fieldName])
			this.options.fields[fieldName] = field.val()
			field.on('change', jQuery.proxy(function() {
				this.forceUpdateLists = false
				this.options.fields[fieldName] = field.val()
				this.refresh()
			}, this))
	}
}

JEASearch.prototype.reset = function() {

	this.options.fields = {
		filter_amenities : [],
		filter_area_id : 0,
		filter_bathrooms_min : 0,
		filter_bedrooms_min : 0,
		filter_budget_max : 0,
		filter_budget_min : 0,
		filter_condition : 0,
		filter_department_id : 0,
		filter_floor : '',
		filter_heatingtype : 0,
		filter_hotwatertype : 0,
		filter_land_space_max : 0,
		filter_land_space_min : 0,
		filter_living_space_max :0,
		filter_living_space_min : 0,
		filter_orientation : 0,
		filter_rooms_min : 0,
		filter_search : "",
		filter_town_id : 0,
		filter_transaction_type : this.options.transactionType,
		filter_type_id : 0,
		filter_zip_codes : ""
	};
	
	jQuery(this.form).find(':input')
		.not(':button, :submit, :reset, :hidden')
		.val('')
		.prop('checked', false)
		.prop('selected', false)
		.removeAttr('checked')
		.removeAttr('selected')

	this.refresh()
},

JEASearch.prototype.refresh = function() {

	if (this.options.useAJAX) {
		jQuery.ajax({
			dataType: 'json',
			url:
'index.php?option=com_jea&task=properties.search&format=json',
			method: 'POST',
			data: this.options.fields,
			context: this,
			success: function(response) {
				this.appendList('filter_type_id', response.types)
				this.appendList('filter_department_id', response.departments)
				this.appendList('filter_town_id',response.towns)
				this.appendList('filter_area_id', response.areas)
				jQuery('.jea-counter-result').text(response.total)
			}
		})
	}
}

JEASearch.prototype.appendList = function(selectName, objectList) {
	
	if (!this.form[selectName]) {
		return
	}

	var selectElt = jQuery(this.form[selectName])

	// Update the list only if its value equals 0
	// Or if this.forceUpdateLists is set to true
	if (selectElt.val() == 0 || this.forceUpdateLists) {
		var value = selectElt.val()

		// Save the first option element
		var first = selectElt.children(':first').clone()
		selectElt.empty().append(first)

		jQuery.each(objectList, function( idx, item ){
			var option =
jQuery('<option></option>').text(item.text).attr('value',
item.value)

			if (item.value == value) {
				option.attr('selected', 'selected')
			}
			
			selectElt.append(option)
		})
	}
}
js/jea-squeezebox.js000064400000006254151167223230010456 0ustar00

var onOpenSqueezebox = function(content) {

	var imgLinks = $$('a.jea_modal');
	var gallery = [];
	var currentIndex = 0;

	imgLinks.each(function(el, count) {

		if (el.href.test(SqueezeBox.url)) {
			currentIndex = count;
		}
		var ImgElt = el.getElement('img');
		if (ImgElt) {
			gallery[count] = {
				title : ImgElt.getProperty('alt'),
				description : ImgElt.getProperty('title'),
				url : el.href
			};
		}
	});
	
	var replaceImage = function (imageIndex) {
		if (!gallery[imageIndex]) {
			return false;
		}
		content.empty();
		var newImage = gallery[imageIndex];

		// This override the non-wanted opacity effect once the gallery is
		// loaded
		SqueezeBox.fx.content = new Fx.Tween(content, {
			property: 'min-height',
			duration: 150,
			link: 'cancel'	
		}).set(0);
		
		SqueezeBox.setContent('image', newImage.url);
		appendInfos(newImage);
		return true;
	};

	var appendInfos = function(imgData) {
		if (imgData.title || imgData.description) {
			var infosElt = document.id('jea-squeezeBox-infos');

			if (!infosElt) {
				infosElt = new Element('div', {'id' :
'jea-squeezeBox-infos'})
				content.getParent().adopt(infosElt);
			} else {
				infosElt.empty();
			}

			if (imgData.title) {
				infosElt.adopt(new Element('div', {
					'id' : 'jea-squeezeBox-title',
					'text' : imgData.title
				}));
			}
			
			if (imgData.description) {
				infosElt.adopt(new Element('div', {
					'id' : 'jea-squeezeBox-description',
					'text' : imgData.description
				}));
			}
		}
	};

	var navBlock = document.id('jea-squeezeBox-navblock');

	if (!navBlock) {
		var navBlock = new Element('div', { 'id' :
'jea-squeezeBox-navblock' });
		content.getParent().adopt(navBlock);
	}

	if (!document.id('jea-squeezeBox-prev')) {

		if (!previousLabel) {
			previousLabel = 'Previous';
		}

		var previousLink = new Element('a', {
			'href' : '#',
			'id' : 'jea-squeezeBox-prev',
			'text' : '< ' + previousLabel
		});

		previousLink.addEvent('click', function(e) {
			e.stop();
			if (replaceImage(currentIndex-1)) {
				currentIndex--;
				if (!gallery[currentIndex-1]) {
					this.setProperty('class', 'inactive')
				}
			}
			
			if (gallery[currentIndex+1] &&
nextLink.getProperty('class') == 'inactive') {
				nextLink.removeProperty('class');
			}
		});

		navBlock.adopt(previousLink);

	} else {
		var previousLink = document.id('jea-squeezeBox-prev')
	}
	
	if (!document.id('jea-squeezeBox-next')) {

		if (!nextLabel) {
			nextLabel = 'Next';
		}

		var nextLink = new Element('a', {
			'href' : '#',
			'id' : 'jea-squeezeBox-next',
			'text' : nextLabel+' >'
		});

		nextLink.addEvent('click', function(e) {
			e.stop();
			if (replaceImage(currentIndex+1)) {
				currentIndex++;
				if (!gallery[currentIndex+1]) {
					this.setProperty('class', 'inactive')
				}
			}

			if (gallery[currentIndex-1] &&
previousLink.getProperty('class') == 'inactive') {
				previousLink.removeProperty('class');
			} 
		});

		navBlock.adopt(nextLink);
	} else {
		var nextLink = document.id('jea-squeezeBox-next')
	}

	if (!gallery[currentIndex-1]) {
		previousLink.setProperty('class', 'inactive');
	}

	if (!gallery[currentIndex+1]) {
		nextLink.setProperty('class', 'inactive');
	}

	appendInfos(gallery[currentIndex]);
	
}
js/jquery-geoSearch.js000064400000004532151167223230010741 0ustar00
function JEAGeoSearch(mapId, options) {
	this.content = document.getElementById(mapId)
	this.mask = null
	this.map = null

	this.options = {
		opacity : 0.5,
		counterElement : '',
		defaultArea : '',
		Itemid : 0
	}
	
	jQuery.extend(this.options, options)
}

JEAGeoSearch.prototype.refresh = function() {

	var params = this.getFilters();

	var kml =
'index.php?option=com_jea&task=properties.kml&format=xml'

	for (key in params) {
		kml += '&' + key + '=' + params[key]
	}

	kml += '&Itemid=' + this.options.Itemid

	var mapOptions = {
		mapTypeId : google.maps.MapTypeId.ROADMAP
	}

	this.map = new google.maps.Map(this.content, mapOptions)

	var that = this

	geoXml = new geoXML3.parser({
		map : this.map,
		afterParse : function(docSet) {

			// Count results
			var count = 0;
			
			jQuery.each(docSet, function(idx, doc) {

				if (doc.markers) {
					count += doc.markers.length
				}
			})

			if (!count) {
				var geocoder = new google.maps.Geocoder()
				var opts = {
					address : that.options.defaultArea
				}

				geocoder.geocode(opts, function(results, status) {
					if (status == google.maps.GeocoderStatus.OK) {
						that.map.fitBounds(results[0].geometry.viewport);
					}
				})
			}

			jQuery('#' + that.options.counterElement).text(count)
		}
	})

	geoXml.parse(kml);
}

JEAGeoSearch.prototype.getFilters = function () {

	var form = jQuery('#jea-search-form')
	var filters = {}
	var fields = [ 
		'filter_type_id', 
		'filter_department_id',
		'filter_town_id', 
		'filter_area_id', 
		'filter_budget_min',
		'filter_budget_max', 
		'filter_living_space_min',
		'filter_living_space_max', 
		'filter_rooms_min'
	]
	
	var transTypes =
form.find('[name="filter_transaction_type"]')
	
	if (transTypes.length > 1) {
		
		jQuery.each(transTypes, function(idx, item){
			if (jQuery(item).prop('checked')) {
				filters['filter_transaction_type'] = jQuery(item).val()
			}
		})

	} else if (transTypes.length == 1) {
		filters['filter_transaction_type'] = transTypes.val()
	}

	jQuery.each(fields, function(idx, field) {
		var val = jQuery(form).find('[name="' + field
+'"]').val()
		if (val > 0) {
			filters[field] = val
		}
	})

	var amenities =
form.find('[name="filter_amenities[]"]')
	jQuery.each(amenities, function(idx, item) {
		if (jQuery(item).prop('checked')) {
			filters['filter_amenities[' + idx + ']'] =
jQuery(item).val()
		}
	})

	return filters
}