/* * ExtInfoWindow Class, v1.2 * Copyright (c) 2007, Joe Monahan (http://www.seejoecode.com) * * 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. * * This class lets you add an info window to the map which mimics GInfoWindow * and allows for users to skin it via CSS. Additionally it has options to * pull in HTML content from an ajax request, triggered when a user clicks on * the associated marker. */ /** * Creates a new ExtInfoWindow that will initialize by reading styles from css * * @constructor * @param {GMarker} marker The marker associated with the info window * @param {String} windowId The DOM Id we will use to reference the info window * @param {String} html The HTML contents * @param {Object} opt_opts A contianer for optional arguments: * {String} ajaxUrl The Url to hit on the server to request some contents * {Number} paddingX The padding size in pixels that the info window will leave on * the left and right sides of the map when panning is involved. * {Number} paddingY The padding size in pixels that the info window will leave on * the top and bottom sides of the map when panning is involved. * {Number} beakOffset The repositioning offset for when aligning the beak element. * This is used to make sure the beak lines up correcting if the * info window styling containers a border. * {Number} maxPanning The maximum panning distance when the marker is not * in screen. This is used to make sure the map will not pan to * much when opening a marker outside the viewport * {Boolean} noCloseOnClick Indicates whether or not the info window should * close for a click on the map that was not on a marker. * If set to true, the info window will not close when the * map is clicked. The default value is false. * * * * */ function ExtInfoWindow(marker, windowId, html, opt_opts) { this.html_ = html; this.marker_ = marker; this.infoWindowId_ = windowId; this.options_ = (typeof opt_opts == 'undefined' || opt_opts === null) ? {} : opt_opts; this.ajaxUrl_ = this.options_.ajaxUrl == null ? null : this.options_.ajaxUrl; this.callback_ = this.options_.ajaxCallback == null ? null : this.options_.ajaxCallback; this.maxContent_ = this.options_.maxContent == null ? null : this.options_.maxContent; this.maximizeEnabled_ = this.maxContent_ == null ? false : true; this.isMaximized_ = false; this.borderSize_ = this.options_.beakOffset == null ? 0 : this.options_.beakOffset; this.paddingX_ = this.options_.paddingX == null ? 0 + this.borderSize_ : this.options_.paddingX + this.borderSize_; this.paddingY_ = this.options_.paddingY == null ? 0 + this.borderSize_ : this.options_.paddingY + this.borderSize_; this.maxPanning_ = this.options_.maxPanning == null ? 500 : this.options_.maxPanning; this.noCloseOnClick_ = this.options_.noCloseOnClick == null ? false : this.options_.noCloseOnClick; this.map_ = null; this.container_ = document.createElement('div'); this.container_.style.position = 'relative'; this.container_.style.display = 'none'; this.contentDiv_ = document.createElement('div'); this.contentDiv_.id = this.infoWindowId_ + '_contents'; this.contentDiv_.innerHTML = this.html_; this.contentDiv_.style.display = 'block'; this.contentDiv_.style.visibility = 'hidden'; this.wrapperDiv_ = document.createElement('div'); this.isRepositioning = false; this.triggerWindowOpenEvent = false; }; //use the GOverlay class ExtInfoWindow.prototype = new GOverlay(); /** * Called by GMap2's addOverlay method. Creates the wrapping div for our info window and adds * it to the relevant map pane. Also binds mousedown event to a private function so that they * are not passed to the underlying map. Finally, performs ajax request if set up to use ajax * in the constructor. * @param {GMap2} map The map that has had this extInfoWindow is added to it. */ ExtInfoWindow.prototype.initialize = function(map) { this.map_ = map; if( this.maximizeEnabled_ ){ this.maxWidth_ = this.map_.getSize().width * 0.9; this.maxHeight_ = this.map_.getSize().height * 0.9; } this.defaultStyles = { containerWidth: this.map_.getSize().width / 2, borderSize: 1 }; this.wrapperParts = { tl:{t:0, l:0, w:0, h:0, domElement: null}, t:{t:0, l:0, w:0, h:0, domElement: null}, tr:{t:0, l:0, w:0, h:0, domElement: null}, l:{t:0, l:0, w:0, h:0, domElement: null}, r:{t:0, l:0, w:0, h:0, domElement: null}, bl:{t:0, l:0, w:0, h:0, domElement: null}, b:{t:0, l:0, w:0, h:0, domElement: null}, br:{t:0, l:0, w:0, h:0, domElement: null}, beak:{t:0, l:0, w:0, h:0, domElement: null}, close:{t:0, l:0, w:0, h:0, domElement: null} }; if( this.maximizeEnabled_ ){ this.wrapperParts.max = {t:0, l:0, w:0, h:0, domElement: null}; this.wrapperParts.min = {t:0, l:0, w:0, h:0, domElement: null}; } for (var i in this.wrapperParts ) { var tempElement = document.createElement('div'); tempElement.id = this.infoWindowId_ + '_' + i; tempElement.style.visibility = 'hidden'; document.body.appendChild(tempElement); tempElement = document.getElementById(this.infoWindowId_ + '_' + i); var tempWrapperPart = this.wrapperParts[i]; tempWrapperPart.w = parseInt(this.getStyle_(tempElement, 'width'), 10); tempWrapperPart.h = parseInt(this.getStyle_(tempElement, 'height'), 10); document.body.removeChild(tempElement); } for (var i in this.wrapperParts) { if (i == 'close' ) { //first append the content so the close button is layered above it this.wrapperDiv_.appendChild(this.contentDiv_); } var wrapperPartsDiv = null; if (this.wrapperParts[i].domElement == null) { wrapperPartsDiv = document.createElement('div'); this.wrapperDiv_.appendChild(wrapperPartsDiv); } else { wrapperPartsDiv = this.wrapperParts[i].domElement; } wrapperPartsDiv.id = this.infoWindowId_ + '_' + i; wrapperPartsDiv.style.position = 'absolute'; wrapperPartsDiv.style.width = this.wrapperParts[i].w + 'px'; wrapperPartsDiv.style.height = this.wrapperParts[i].h + 'px'; wrapperPartsDiv.style.top = this.wrapperParts[i].t + 'px'; wrapperPartsDiv.style.left = this.wrapperParts[i].l + 'px'; this.wrapperParts[i].domElement = wrapperPartsDiv; } this.map_.getPane(G_MAP_FLOAT_PANE).appendChild(this.container_); this.container_.id = this.infoWindowId_; var containerWidth = this.getStyle_(document.getElementById(this.infoWindowId_), 'width'); this.container_.style.width = (containerWidth == null ? this.defaultStyles.containerWidth : containerWidth); this.map_.getContainer().appendChild(this.contentDiv_); this.contentWidth = this.getDimensions_(this.container_).width; this.contentDiv_.style.width = this.contentWidth + 'px'; this.contentDiv_.style.position = 'absolute'; this.container_.appendChild(this.wrapperDiv_); if( this.maximizeEnabled_ ){ this.minWidth_ = this.getDimensions_(this.container_).width; } if (this.maximizeEnabled_) { thisMap = this.map_; thisMaxWidth = this.maxWidth_; thisMaxHeight = this.maxHeight_; thisContainer = this.container_; thisMaxContent = this.maxContent_; if(this.marker_) { GEvent.trigger(this.marker_, 'extinfowindowbeforeclose'); } thisMinWidth = this.container_.style.width; thisMinHeight = this.container_.style.height; //add event handler for maximize and minimize icons GEvent.addDomListener(this.wrapperParts.max.domElement, 'click', function() { var infoWindow = thisMap.getExtInfoWindow(); infoWindow.container_.style.width = thisMaxWidth + 'px'; infoWindow.ajaxRequest_(thisMaxContent); if(this.marker_) { GEvent.trigger(this.marker_, 'extinfowindowclose'); } infoWindow.isMaximized_ = true; infoWindow.redraw(true); //swap min/max icons infoWindow.toggleMaxMin_(); } ); GEvent.addDomListener(this.wrapperParts.min.domElement, 'click', function() { var infoWindow = thisMap.getExtInfoWindow(); infoWindow.container_.style.width = thisMinWidth; infoWindow.container_.style.height = thisMinHeight; if (infoWindow.ajaxUrl_ != null ) { infoWindow.ajaxRequest_(this.ajaxUrl_); }else{ infoWindow.contentDiv_.innerHTML = infoWindow.html_; } infoWindow.isMaximized_ = false; infoWindow.redraw(true); infoWindow.resize(); //swap min/max icons infoWindow.toggleMaxMin_(); } ); this.toggleMaxMin_(); } // handle events before they get to the map var stealEvents = ['mousedown', 'dblclick', 'DOMMouseScroll', 'onmousewheel']; for( i=0; i < stealEvents.length; i++ ){ GEvent.bindDom(this.container_, stealEvents[i], this, this.onClick_); } // handle mouse wheel scroll for IE/Opera if( (navigator.userAgent.toLowerCase().indexOf('msie') != -1 && document.all) || navigator.userAgent.indexOf('Opera') > -1) { this.container_.attachEvent('onmousewheel', this.onClick_); } // handle mouse wheel scroll for safari if ( navigator.userAgent.indexOf('AppleWebKit/') > -1) { this.container_.onmousewheel = this.onClick_; } this.triggerWindowOpenEvent = true; if (this.ajaxUrl_ != null ) { this.ajaxRequest_(this.ajaxUrl_); } }; /** * Private function to steal mouse click events to prevent it from returning to the map. * Without this links in the ExtInfoWindow would not work, and you could click to zoom or drag * the map behind it. * @private * @param {MouseEvent} e The mouse event caught by this function */ ExtInfoWindow.prototype.onClick_ = function(e) { if(navigator.userAgent.toLowerCase().indexOf('msie') != -1 && document.all) { window.event.cancelBubble = true; window.event.returnValue = false; } else { //e.preventDefault(); e.stopPropagation(); } }; /** * Remove the extInfoWindow container from the map pane. */ ExtInfoWindow.prototype.remove = function() { if (this.map_.getExtInfoWindow() != null && this.container_ != null) { GEvent.trigger(this.map_, 'extinfowindowbeforeclose'); GEvent.clearInstanceListeners(this.container_); if (this.container_.outerHTML) { this.container_.outerHTML = ''; //prevent pseudo-leak in IE } if (this.container_.parentNode) { this.container_.parentNode.removeChild(this.container_); } this.container_ = null; GEvent.trigger(this.map_, 'extinfowindowclose'); this.map_.setExtInfoWindow_(null); if (this.options_.removeMarkerOnClose_) { this.map_.removeOverlay(this.marker_); } } }; /** * Return a copy of this overlay, for the parent Map to duplicate itself in full. This * is part of the Overlay interface and is used, for example, to copy everything in the * main view into the mini-map. * @return {GOverlay} */ ExtInfoWindow.prototype.copy = function() { return new ExtInfoWindow(this.marker_, this.infoWindowId_, this.html_, this.options_); }; /** * Draw extInfoWindow and wrapping decorators onto the map. Resize and reposition * the map as necessary. * @param {Boolean} force Will be true when pixel coordinates need to be recomputed. */ ExtInfoWindow.prototype.redraw = function(force) { if (!force || this.container_ == null) return; //set the content section's height, needed so browser font resizing does not affect the window's dimensions // don't include borders in height (if clientHeight is available) if (typeof this.clientHeight != 'undefined') var contentHeight = this.contentDiv_.clientHeight; else var contentHeight = this.contentDiv_.offsetHeight; this.contentWidth = this.getDimensions_(this.container_).width; this.contentDiv_.style.width = this.container_.style.width; //reposition contents depending on wrapper parts. //this is necessary for content that is pulled in via ajax this.contentDiv_.style.left = this.wrapperParts.l.w + 'px'; this.contentDiv_.style.top = this.wrapperParts.tl.h + 'px'; this.contentDiv_.style.visibility = 'visible'; //Finish configuring wrapper parts that were not set in initialization this.wrapperParts.tl.t = 0; this.wrapperParts.tl.l = 0; this.wrapperParts.t.l = this.wrapperParts.tl.w; this.wrapperParts.t.w = (this.wrapperParts.l.w + this.contentWidth + this.wrapperParts.r.w) - this.wrapperParts.tl.w - this.wrapperParts.tr.w; this.wrapperParts.t.h = this.wrapperParts.tl.h; this.wrapperParts.tr.l = this.wrapperParts.t.w + this.wrapperParts.tl.w; this.wrapperParts.l.t = this.wrapperParts.tl.h; this.wrapperParts.l.h = contentHeight; this.wrapperParts.r.l = this.contentWidth + this.wrapperParts.l.w; this.wrapperParts.r.t = this.wrapperParts.tr.h; this.wrapperParts.r.h = contentHeight; this.wrapperParts.bl.t = contentHeight + this.wrapperParts.tl.h; this.wrapperParts.b.l = this.wrapperParts.bl.w; this.wrapperParts.b.t = contentHeight + this.wrapperParts.tl.h; this.wrapperParts.b.w = (this.wrapperParts.l.w + this.contentWidth + this.wrapperParts.r.w) - this.wrapperParts.bl.w - this.wrapperParts.br.w; this.wrapperParts.b.h = this.wrapperParts.bl.h; this.wrapperParts.br.l = this.wrapperParts.b.w + this.wrapperParts.bl.w; this.wrapperParts.br.t = contentHeight + this.wrapperParts.tr.h; this.wrapperParts.beak.l = (this.wrapperParts.l.w + this.wrapperParts.r.w + this.contentWidth) / 2 - (this.wrapperParts.beak.w / 2); this.wrapperParts.beak.t = this.wrapperParts.bl.t + this.wrapperParts.bl.h - this.borderSize_; this.wrapperParts.close.l = this.wrapperParts.tr.l +this.wrapperParts.tr.w - this.wrapperParts.close.w - this.borderSize_; this.wrapperParts.close.t = this.borderSize_; if( this.maximizeEnabled_ ){ this.wrapperParts.max.l = this.wrapperParts.close.l - this.wrapperParts.max.w - 5; this.wrapperParts.max.t = this.wrapperParts.close.t; this.wrapperParts.min.l = this.wrapperParts.max.l; this.wrapperParts.min.t = this.wrapperParts.max.t; } //create the decoration wrapper DOM objects //append the styled info window to the container for (var i in this.wrapperParts) { if (i == 'close' ) { //first append the content so the close button is layered above it this.wrapperDiv_.insertBefore(this.contentDiv_, this.wrapperParts[i].domElement); } var wrapperPartsDiv = null; if (this.wrapperParts[i].domElement == null) { wrapperPartsDiv = document.createElement('div'); this.wrapperDiv_.appendChild(wrapperPartsDiv); } else { wrapperPartsDiv = this.wrapperParts[i].domElement; } wrapperPartsDiv.id = this.infoWindowId_ + '_' + i; wrapperPartsDiv.style.position='absolute'; wrapperPartsDiv.style.width = this.wrapperParts[i].w + 'px'; wrapperPartsDiv.style.height = this.wrapperParts[i].h + 'px'; wrapperPartsDiv.style.top = this.wrapperParts[i].t + 'px'; wrapperPartsDiv.style.left = this.wrapperParts[i].l + 'px'; this.wrapperParts[i].domElement = wrapperPartsDiv; } //add event handler for the close icon var currentMarker = this.marker_; var thisMap = this.map_; GEvent.addDomListener(this.wrapperParts.close.domElement, 'click', function() { thisMap.closeExtInfoWindow(); } ); //position the container on the map, over the marker var pixelLocation = this.map_.fromLatLngToDivPixel(this.marker_.getLatLng()); this.container_.style.position = 'absolute'; var markerIcon = this.marker_.getIcon(); this.container_.style.left = (pixelLocation.x - (this.contentWidth / 2) - this.wrapperParts.l.w - markerIcon.iconAnchor.x + markerIcon.infoWindowAnchor.x ) + 'px'; this.container_.style.top = (pixelLocation.y - this.wrapperParts.bl.h - contentHeight - this.wrapperParts.tl.h - this.wrapperParts.beak.h - markerIcon.iconAnchor.y + markerIcon.infoWindowAnchor.y + this.borderSize_ ) + 'px'; this.container_.style.display = 'block'; if (this.triggerWindowOpenEvent) { GEvent.trigger(this.map_, 'extinfowindowopen'); this.triggerWindowOpenEvent = false; } if(this.map_.getExtInfoWindow() != null && !this.isRepositioning) { this.isRepositioning = true; // stop infinite recursion this.repositionMap_(); this.isRepositioning = false; } }; ExtInfoWindow.prototype.toggleMaxMin_ = function(){ if( this.wrapperParts.max.domElement != null && this.wrapperParts.min.domElement != null ){ if (this.isMaximized_) { this.wrapperParts.max.domElement.style.display = 'none'; this.wrapperParts.min.domElement.style.display = 'block'; } else { this.wrapperParts.max.domElement.style.display = 'block'; this.wrapperParts.min.domElement.style.display = 'none'; } } }; /** * Determine the dimensions of the contents to recalculate and reposition the * wrapping decorator elements accordingly. */ ExtInfoWindow.prototype.resize = function(){ //Create temporary DOM node for new contents to get new height //This is done because if you manipulate this.contentDiv_ directly it causes visual errors in IE6 var tempElement = this.contentDiv_.cloneNode(true); tempElement.id = this.infoWindowId_ + '_tempContents'; tempElement.style.visibility = 'hidden'; tempElement.style.height = 'auto'; document.body.appendChild(tempElement); tempElement = document.getElementById(this.infoWindowId_ + '_tempContents'); var contentHeight = tempElement.offsetHeight; document.body.removeChild(tempElement); //Set the new height to eliminate visual defects that can be caused by font resizing in browser this.contentDiv_.style.height = contentHeight + 'px'; var contentWidth = this.container_.offsetWidth; var pixelLocation = this.map_.fromLatLngToDivPixel(this.marker_.getPoint()); var oldWindowHeight = this.wrapperParts.t.domElement.offsetHeight + this.wrapperParts.l.domElement.offsetHeight + this.wrapperParts.b.domElement.offsetHeight; var oldWindowPosTop = this.wrapperParts.t.domElement.offsetTop; //resize info window to look correct for new height this.wrapperParts.l.domElement.style.height = contentHeight + 'px'; this.wrapperParts.r.domElement.style.height = contentHeight + 'px'; var newPosTop = this.wrapperParts.b.domElement.offsetTop - contentHeight; this.wrapperParts.l.domElement.style.top = newPosTop + 'px'; this.wrapperParts.r.domElement.style.top = newPosTop + 'px'; this.contentDiv_.style.top = newPosTop + 'px'; windowTHeight = parseInt(this.wrapperParts.t.domElement.style.height, 10); newPosTop -= windowTHeight; this.wrapperParts.close.domElement.style.top = newPosTop + this.borderSize_ + 'px'; this.wrapperParts.tl.domElement.style.top = newPosTop + 'px'; this.wrapperParts.t.domElement.style.top = newPosTop + 'px'; this.wrapperParts.tr.domElement.style.top = newPosTop + 'px'; this.repositionMap_(); }; /** * Get the options properties for this ExtInfoWindow */ ExtInfoWindow.prototype.getOptions = function() { return this.options_; }; /** * Check to see if the displayed extInfoWindow is positioned off the viewable * map region and by how much. Use that information to pan the map so that * the extInfoWindow is completely displayed. * @private */ ExtInfoWindow.prototype.repositionMap_ = function(){ //pan if necessary so it shows on the screen // figure out where viewport is inside draggable map div var mapPoint = this.map_.fromLatLngToContainerPixel(this.map_.getCenter()); var divPoint = this.map_.fromLatLngToDivPixel(this.map_.getCenter()); var mapPosition = new GPoint(divPoint.x - mapPoint.x, divPoint.y- mapPoint.y); // figure out SW and NE pixels var mapSize = this.map_.getSize(); var mapSW = new GPoint(mapPosition.x, mapPosition.y+mapSize.height); var mapNE = new GPoint(mapPosition.x+mapSize.width, mapPosition.y); var markerPosition = this.map_.fromLatLngToDivPixel( this.marker_.getPoint() ); var panX = 0; var panY = 0; var paddingX = this.paddingX_; var paddingY = this.paddingY_; var infoWindowAnchor = this.marker_.getIcon().infoWindowAnchor; var iconAnchor = this.marker_.getIcon().iconAnchor; //test top of screen var windowT = this.wrapperParts.t.domElement; var windowL = this.wrapperParts.l.domElement; var windowB = this.wrapperParts.b.domElement; var windowR = this.wrapperParts.r.domElement; var windowBeak = this.wrapperParts.beak.domElement; var offsetTop = markerPosition.y - ( -infoWindowAnchor.y + iconAnchor.y + this.getDimensions_(windowBeak).height + this.getDimensions_(windowB).height + this.getDimensions_(windowL).height + this.getDimensions_(windowT).height + this.paddingY_); if (offsetTop < mapNE.y) { panY = mapNE.y - offsetTop; } else { //test bottom of screen (but don't go past top boundary) var offsetBottom = markerPosition.y + this.paddingY_; if (offsetBottom >= mapSW.y) { panY = Math.max( -(offsetBottom - mapSW.y), mapNE.y - offsetTop); } } //test right of screen var offsetRight = Math.round(markerPosition.x + this.getDimensions_(this.container_).width/2 + this.getDimensions_(windowR).width + this.paddingX_ + infoWindowAnchor.x - iconAnchor.x); if (offsetRight > mapNE.x) { panX = -( offsetRight - mapNE.x); } else { //test left of screen var offsetLeft = - (Math.round( (this.getDimensions_(this.container_).width/2 - this.marker_.getIcon().iconSize.width/2) + this.getDimensions_(windowL).width + this.borderSize_ + this.paddingX_) - markerPosition.x - infoWindowAnchor.x + iconAnchor.x); if( offsetLeft < mapSW.x) { panX = mapSW.x - offsetLeft; } } if ((panX != 0 || panY != 0 ) && this.map_.getExtInfoWindow() != null ) { if ((panY < 0 - this.maxPanning_ || panY > this.maxPanning_) && (panX < 0 - this.maxPanning_ || panX > this.maxPanning_)) { this.map_.setCenter(this.marker_.getPoint()); }else { this.map_.panBy(new GSize(panX,panY)); } } }; /** * Private function that handles performing an ajax request to the server. The response * information is assumed to be HTML and is placed inside this extInfoWindow's contents region. * Last, check to see if the height has changed, and resize the extInfoWindow accordingly. * @private * @param {String} url The Url of where to make the ajax request on the server */ ExtInfoWindow.prototype.ajaxRequest_ = function(url){ var thisMap = this.map_; var thisCallback = this.callback_; GDownloadUrl(url, function(response, status){ if (thisMap.getExtInfoWindow() !== null) { var infoWindow = document.getElementById(thisMap.getExtInfoWindow().infoWindowId_ + '_contents'); if (response == null || status == -1 ) { infoWindow.innerHTML = 'ERROR: The Ajax request failed to get HTML content from "' + url + '"'; } else { infoWindow.innerHTML = response; } if (thisCallback != null ) { thisCallback(); } thisMap.getExtInfoWindow().resize(); } GEvent.trigger(thisMap, 'extinfowindowupdate'); }); }; /** * Private function derived from Prototype.js to get a given element's * height and width * @private * @param {Object} element The DOM element that will have height and * width will be calculated for it. * @return {Object} Object with keys: width, height */ ExtInfoWindow.prototype.getDimensions_ = function(element) { var display = this.getStyle_(element, 'display'); if (display != 'none' && display != null) { // Safari bug return {width: element.offsetWidth, height: element.offsetHeight}; } // All *Width and *Height properties give 0 on elements with display none, // so enable the element temporarily var els = element.style; var originalVisibility = els.visibility; var originalPosition = els.position; var originalDisplay = els.display; els.visibility = 'hidden'; els.position = 'absolute'; els.display = 'block'; var originalWidth = element.clientWidth; var originalHeight = element.clientHeight; els.display = originalDisplay; els.position = originalPosition; els.visibility = originalVisibility; return {width: originalWidth, height: originalHeight}; }; /** * Private function derived from Prototype.js to get a given element's * value that is associated with the passed style * @private * @param {Object} element The DOM element that will be checked. * @param {String} style The style name that will be have it's value returned. * @return {Object} */ ExtInfoWindow.prototype.getStyle_ = function(element, style) { var found = false; style = this.camelize_(style); if (element.id == this.infoWindowId_ && style == 'width' && element.style.display == 'none') { element.style.visibility = 'hidden'; element.style.display = ''; } var value = element.style[style]; if (!value) { if (document.defaultView && document.defaultView.getComputedStyle) { var css = document.defaultView.getComputedStyle(element, null); value = css ? css[style] : null; } else if (element.currentStyle) { value = element.currentStyle[style]; } } if((value == 'auto') && (style == 'width' || style == 'height') && (this.getStyle_(element, 'display') != 'none')) { if( style == 'width' ) { value = element.offsetWidth; }else { value = element.offsetHeight; } } if (element.id == this.infoWindowId_ && style == 'width' && element.style.display != 'none') { element.style.display = 'none'; element.style.visibility = 'visible'; } return (value == 'auto') ? null : value; }; /** * Private function pulled from Prototype.js that will change a hyphened * style name into camel case. * @private * @param {String} element The string that will be parsed and made into camel case * @return {String} */ ExtInfoWindow.prototype.camelize_ = function(element) { var parts = element.split('-'), len = parts.length; if (len == 1) return parts[0]; var camelized = element.charAt(0) == '-' ? parts[0].charAt(0).toUpperCase() + parts[0].substring(1) : parts[0]; for (var i = 1; i < len; i++) { camelized += parts[i].charAt(0).toUpperCase() + parts[i].substring(1); } return camelized; }; GMap.prototype.ExtInfoWindowInstance_ = null; GMap.prototype.ClickListener_ = null; GMap.prototype.InfoWindowListener_ = null; /** * Creates a new instance of ExtInfoWindow for the GMarker. Register the newly created * instance with the map, ensuring only one window is open at a time. If this is the first * ExtInfoWindow ever opened, add event listeners to the map to close the ExtInfoWindow on * click, to mimic the default GInfoWindow behavior. * * @param {GMap} map The GMap2 object where the ExtInfoWindow will open * @param {String} cssId The id we will use to reference the info window * @param {String} html The HTML contents * @param {Object} opt_opts A contianer for optional arguments: * {String} ajaxUrl The Url to hit on the server to request some contents * {Number} paddingX The padding size in pixels that the info window will leave on * the left and right sides of the map when panning is involved. * {Number} paddingX The padding size in pixels that the info window will leave on * the top and bottom sides of the map when panning is involved. * {Number} beakOffset The repositioning offset for when aligning the beak element. * This is used to make sure the beak lines up correcting if the * info window styling containers a border. * {Boolean} noCloseOnClick Indicates whether or not the info window should * close for a click on the map that was not on a marker. * If set to true, the info window will not close when the * map is clicked. The default value is false. * */ GMarker.prototype.openExtInfoWindow = function(map, cssId, html, opt_opts) { if (map == null) { throw 'Error in GMarker.openExtInfoWindow: map cannot be null'; return false; } if (cssId == null || cssId == '') { throw 'Error in GMarker.openExtInfoWindow: must specify a cssId'; return false; } map.closeInfoWindow(); if (map.getExtInfoWindow() != null) { map.closeExtInfoWindow(); } if (map.getExtInfoWindow() == null) { map.setExtInfoWindow_( new ExtInfoWindow( this, cssId, html, opt_opts ) ); if (map.ClickListener_ == null) { //listen for map click, close ExtInfoWindow if open map.ClickListener_ = GEvent.addListener(map, 'click', function(event) { if( !event && map.getExtInfoWindow() != null && !map.getExtInfoWindow().getOptions().noCloseOnClick){ map.closeExtInfoWindow(); } } ); } if (map.InfoWindowListener_ == null) { //listen for default info window open, close ExtInfoWindow if open map.InfoWindowListener_ = GEvent.addListener(map, 'infowindowopen', function(event) { if (map.getExtInfoWindow() != null) { map.closeExtInfoWindow(); } } ); } map.addOverlay(map.getExtInfoWindow()); } }; /** * Creates a new instance of ExtInfoWindow. Register the newly created * instance with the map, ensuring only one window is open at a time. If this is the first * ExtInfoWindow ever opened, add event listeners to the map to close the ExtInfoWindow on * click to mimic the default GInfoWindow behavior. * * @param {GMap} map The GMap2 object where the ExtInfoWindow will open * @param {String} cssId The id we will use to reference the info window * @param {String} html The HTML contents * @param {Object} opt_opts A contianer for optional arguments: * {String} ajaxUrl The Url to hit on the server to request some contents * {Number} paddingX The padding size in pixels that the info window will leave on * the left and right sides of the map when panning is involved. * {Number} paddingX The padding size in pixels that the info window will leave on * the top and bottom sides of the map when panning is involved. * {Number} beakOffset The repositioning offset for when aligning the beak element. * This is used to make sure the beak lines up correcting if the * info window styling containers a border. * {Boolean} noCloseOnClick Indicates whether or not the info window should * close for a click on the map that was not on a marker. * If set to true, the info window will not close when the * map is clicked. The default value is false. * */ GMap2.prototype.openExtInfoWindow = function(point, cssId, html, opt_opts){ if (point == null) { throw 'Error in GMap2.openExtInfoWindow: point cannot be null'; return false; } if (cssId == null || cssId == '') { throw 'Error in GMap2.openExtInfoWindow: must specify a cssId'; return false; } this.closeInfoWindow(); if (this.getExtInfoWindow() != null) { this.closeExtInfoWindow(); } if (this.getExtInfoWindow() == null) { var icon = new GIcon(G_DEFAULT_ICON); icon.iconSize = new GSize(0, 0); icon.shadowSize = new GSize(0, 0); icon.iconAnchor = new GPoint(0, 0); icon.infoWindowAnchor = new GPoint(0,0); var marker = new GMarker( point, {hide:true, icon: icon, clickable:false} ); if (typeof opt_opts == 'undefined') { opt_opts = {}; } opt_opts.removeMarkerOnClose_ = true; this.addOverlay(marker); this.setExtInfoWindow_( new ExtInfoWindow( marker, cssId, html, opt_opts ) ); if (this.ClickListener_ == null) { //listen for map click, close ExtInfoWindow if open this.ClickListener_ = GEvent.addListener(this, 'click', function(event) { if( !event && this.getExtInfoWindow() != null && !map.getExtInfoWindow().getOptions().noCloseOnClick){ this.closeExtInfoWindow(); } } ); } if (this.InfoWindowListener_ == null) { //listen for default info window open, close ExtInfoWindow if open this.InfoWindowListener_ = GEvent.addListener(this, 'infowindowopen', function(event) { if (this.getExtInfoWindow() != null) { this.closeExtInfoWindow(); } } ); } this.addOverlay(this.getExtInfoWindow()); } }; /** * Remove the ExtInfoWindow instance * @param {GMap2} map The map where the GMarker and ExtInfoWindow exist */ GMarker.prototype.closeExtInfoWindow = function(map) { if( map.getExtInfoWindow() != null ){ map.closeExtInfoWindow(); } }; /** * Get the ExtInfoWindow instance from the map */ GMap2.prototype.getExtInfoWindow = function(){ return this.ExtInfoWindowInstance_; }; /** * Set the ExtInfoWindow instance for the map * @private */ GMap2.prototype.setExtInfoWindow_ = function( extInfoWindow ){ this.ExtInfoWindowInstance_ = extInfoWindow; }; /** * Remove the ExtInfoWindow from the map */ GMap2.prototype.closeExtInfoWindow = function(){ if( this.getExtInfoWindow() != null ){ this.ExtInfoWindowInstance_.remove(); } }; var map; var panoramioLayer ; //var event = new Array(); var markers = new Array(); var defaultIcon = new GIcon(); defaultIcon.image = 'fileadmin/templates/marker/default/imageBlue.png'; defaultIcon.printImage = 'fileadmin/templates/marker/default/printImage.gif'; defaultIcon.mozPrintImage = 'fileadmin/templates/img/markers/default/mozPrintImage.gif'; defaultIcon.iconSize = new GSize(10,15); defaultIcon.shadow = 'fileadmin/templates/marker/default/shadow.png'; defaultIcon.transparent = 'fileadmin/templates/marker/default/transparent.png'; defaultIcon.shadowSize = new GSize(18,15); defaultIcon.printShadow = 'fileadmin/templates/marker/default/printShadow.gif'; defaultIcon.iconAnchor = new GPoint(5,15); defaultIcon.infoWindowAnchor = new GPoint(5,5); defaultIcon.imageMap = [7,0,8,1,8,2,9,3,9,4,8,5,8,6,7,7,7,8,6,9,6,10,5,11,5,12,5,13,5,14,4,14,4,13,4,12,4,11,3,10,3,9,2,8,2,7,1,6,1,5,0,4,0,3,1,2,1,1,2,0]; var hotelIcon = new GIcon(); hotelIcon.image = 'fileadmin/templates/marker/default/image.png'; hotelIcon.printImage = 'fileadmin/templates/marker/default/printImage.gif'; hotelIcon.mozPrintImage = 'fileadmin/templates/img/markers/default/mozPrintImage.gif'; hotelIcon.iconSize = new GSize(10,15); hotelIcon.shadow = 'fileadmin/templates/marker/default/shadow.png'; hotelIcon.transparent = 'fileadmin/templates/marker/default/transparent.png'; hotelIcon.shadowSize = new GSize(18,15); hotelIcon.printShadow = 'fileadmin/templates/marker/default/printShadow.gif'; hotelIcon.iconAnchor = new GPoint(5,15); hotelIcon.infoWindowAnchor = new GPoint(5,5); hotelIcon.imageMap = [7,0,8,1,8,2,9,3,9,4,8,5,8,6,7,7,7,8,6,9,6,10,5,11,5,12,5,13,5,14,4,14,4,13,4,12,4,11,3,10,3,9,2,8,2,7,1,6,1,5,0,4,0,3,1,2,1,1,2,0]; var weatherIcon = new GIcon(); weatherIcon .image = 'fileadmin/templates/marker/weather/image.png'; weatherIcon .printImage = 'fileadmin/templates/marker/weather/printImage.gif'; weatherIcon .mozPrintImage = 'fileadmin/templates/marker/weather/mozPrintImage.gif'; weatherIcon .iconSize = new GSize(32,32); weatherIcon .shadow = 'fileadmin/templates/marker/weather/shadow.png'; weatherIcon .transparent = 'fileadmin/templates/marker/weather/transparent.png'; weatherIcon .shadowSize = new GSize(48,32); weatherIcon .printShadow = 'fileadmin/templates/marker/weather/printShadow.gif'; weatherIcon .iconAnchor = new GPoint(16,32); weatherIcon .infoWindowAnchor = new GPoint(16,0); weatherIcon .imageMap = [12,3,12,4,15,5,15,6,12,7,20,8,21,9,22,10,22,11,23,12,25,13,27,14,27,15,28,16,28,17,28,18,28,19,28,20,27,21,25,22,18,23,18,24,19,25,19,26,19,27,19,28,17,28,16,27,16,26,16,25,17,24,18,23,10,22,8,21,8,20,7,19,7,18,7,17,4,16,5,15,5,14,2,13,2,12,4,11,6,10,3,9,2,8,5,7,5,6,4,5,8,4,8,3]; function initMapY() { if (GBrowserIsCompatible()) { map = new GMap2(document.getElementById("mapa_main")); map.setCenter(new GLatLng(41, -96), 3); //marker with ext info window with a red skin and ajax content var redIcon1 = new GIcon(G_DEFAULT_ICON); marker = new GMarker( new GLatLng(36, -100), redIcon1); GEvent.addListener(marker, 'click', function(){ marker.openExtInfoWindow( map, "custom_info_window_red", "
Loading...
", { ajaxUrl: "ajax/ajaxTest.html", beakOffset: 3 } ); }); map.addOverlay(marker); //addEventToClaster(event[1][0]); } } function initMap() { if (window.zoom === undefined && window.centerY === undefined) { return;} //zoom = 3; centerY = 41; centerX = -96; mapType = zoom>9?G_HYBRID_MAP:G_NORMAL_MAP; map = new GMap2(document.getElementById("mapa_main")); map.setMapType(mapType); //G_HYBRID_MAP map.addControl(new GLargeMapControl3D() ); map.addControl(new GMenuMapTypeControl() ); // infoWindow = map.getInfoWindow(); // infoWindow.reset(latlng:GLatLng, tabs:GInfoWindowTab[], size:GSize, offset?:GSize, selectedTab?:Number) // infoWindow.reset(null, null, (5,5), (2,2), null); map.setCenter(new google.maps.LatLng(centerY,centerX), zoom); showHotelsInMap(); // updateClusters(); // GEvent.addListener(map, "click", function() {mapListener();}); // GEvent.addListener(map, "moveend", function() {mapListener();}); // setupWeatherMarkers(); document.getElementById('mapLayer1').style.display = "block"; document.getElementById('mapLayer2').style.display = "block"; document.getElementById('pocasie').style.display = "block"; var tmpMapSize = getCookie('mapSize'); if (!tmpMapSize) tmpMapSize = 0; document.getElementById('map_size_'+tmpMapSize).checked = "checked"; } function showHotelsInMap(){ for (i in eventMap[1]) { if (isNaN(parseFloat(i))) { continue;} addEventToClaster(eventMap[1][i]); } } function newMarkerFromEvent(event){ //GInfoWindow.reset(); //size:(width:20.height:10) if (event['category']==4) markerOptions = { icon:hotelIcon} else markerOptions = { icon:defaultIcon }; point = new GLatLng(event['Y'],event['X']); var marker = new GMarker(point,markerOptions); /* GEvent.addListener(marker, 'click', function() { marker.openInfoWindowHtml("
"+event['title']+"
"+"
"+event['content']+"
" ); })*/ GEvent.addListener(marker, 'click', function(){ marker.openExtInfoWindow( map, "custom_info_window_red", "
"+event['title']+"
"+"
"+event['content']+"
", {beakOffset: 3} ); //ajaxUrl: "ajax/ajaxTest.html", jQuery(".mapImages a").slimbox(); }); // // marker.bindInfoWindowHtml(event['text']); /*var infoWindow = map.getInfoWindow(); address = "praha"; GEvent.bind(marker,"click",{marker:marker},function() { map.openInfoWindowHtml(marker.getPoint(),address,{onOpenFn:function(){ // var infoWindowBlocks = YAHOO.util.Selector.query(’#area-map-tool div div div div’); var infoWindowBlocks = document.getElementById('boarder'); for(var c = 0; c < infoWindowBlocks.length; c++){ // if(infoWindowBlocks[c].style.height === "40px" && infoWindowBlocks[c].style.top === "25px"){ infoWindowBlocks[c].style.height = "10px"; // } // if(infoWindowBlocks[c].style.top === "65px"){ // infoWindowBlocks[c].style.top = "35px" // } } }}); }); */ GEvent.addListener(marker, "infowindowopen", function() { hCarousel = new UI.Carousel("horizontal_carousel"); }); map.addOverlay(marker); // marker.hide(); marker.category = event['category']; marker.id = event['id']; // markers[event['type']][markers[event['type']].length] = marker; // event['marker']=marker; if(event['edit']==1){ marker.openInfoWindow(event['text']); marker.enableDragging(); if (document.getElementById("tx_frontendformslib__data__tx_rtfbmap_event__point")) pointDiv = "tx_frontendformslib__data__tx_rtfbmap_event__point"; if (pointDiv) { document.getElementById(pointDiv).value=marker.getPoint().toUrlValue(); GEvent.addListener(marker, "drag", function(){ document.getElementById(pointDiv).value=marker.getPoint().toUrlValue(); }); } } return marker; } function addEventToClaster(event){ marker = newMarkerFromEvent(event); markers[marker.id] = marker; } function updateClusters(){ if (markerClusterer != null) { markerClusterer.clearMarkers(); } markerClusterer = new MarkerClusterer(map, markers, mcOptions); for (i in category){ if (isNaN(parseFloat(i))) { break;} $('cat'+i).style.display= (category[i]?'block':'none'); $('catNum'+i).innerHTML = ' ('+category[i]+')'; } } function logMes (text){ document.getElementById('search').innerHTML =text+"
"+document.getElementById('search').innerHTML; } /* WAETHER */ function getWeatherMarkers(n) { var batch = []; for (var i = 0; i < n; ++i) { batch.push(new GMarker(getRandomPoint(), { icon: getWeatherIcon() })); } return batch; } function setupWeatherMarkers() { /* mgr = new MarkerManager(map); mgr.addMarkers(getWeatherMarkers(20), 3); mgr.addMarkers(getWeatherMarkers(200), 6); mgr.addMarkers(getWeatherMarkers(1000), 8); mgr.refresh();*/ } function getMapLocation() { google.load("gdata", "2"); alert( google.loader.ClientLocation.address.region); /* if (google.loader.ClientLocation && google.loader.ClientLocation.address.country_code == "US" && google.loader.ClientLocation.address.region) {*/ } //getMapLocation(); function getLocationGps(){ // if (document.getElementById('location_gps').value) // return true; document.getElementById('searchMapLoad').innerHTML = ''; geocoder = new GClientGeocoder(); geocoder.getLocations(document.getElementById('location_text').value, searchByCoords); return false; } function location_text_onClick(){ if (location_text_default == document.getElementById('location_text').value) document.getElementById('location_text').value = ""; } var place; var placeMark; function searchByCoords(response){ if (response.Status.code==602) { document.getElementById('searchMapLoad').innerHTML = ""; alert(noResultInMap); } if (!response || response.Status.code != 200) { } else { /* place = response.Placemark[0]; newMarker(point); centerOnLocation(point);*/ place = response.Placemark[0]; placeMark = response.Placemark; //alert(place); /*if (place.AddressDetails.Country.AdministrativeArea) country = place.AddressDetails.Country.AdministrativeArea.CountryName else country = place.AddressDetails.Country.CountryName*/ point = new GLatLng(place.Point.coordinates[1], place.Point.coordinates[0]); accuracy = place.AddressDetails.Accuracy placeName = ""; countryName = ""; countryNameCode = ""; if (place.AddressDetails.Country) { countryName = place.AddressDetails.Country.CountryName countryNameCode = place.AddressDetails.Country.CountryNameCode if (place.AddressDetails.Country.AdministrativeArea){ placeName = place.AddressDetails.Country.AdministrativeArea.AdministrativeAreaName if (place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea){ if (place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea) { if (place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality){ if (place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.DependentLocality) locationName = place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.DependentLocality.DependentLocalityName } else locationName = place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.SubAdministrativeAreaName } } } } else if(place.AddressDetails.Locality) placeName = place.AddressDetails.Locality.LocalityName; //map = new GMap2(document.getElementById("mapa_main")); //map.setCenter(point); nesw = place.ExtendedData.LatLonBox; locationParams = place.Point.coordinates[0]+"|"+place.Point.coordinates[1]+"|"+place.AddressDetails.Accuracy; locationParams += "|"+countryName+"|"+countryNameCode+"|"+placeName; locationParams += "|"+nesw.north+"|"+nesw.east+"|"+nesw.south+"|"+nesw.west document.getElementById('location_params').value=locationParams; document.getElementById('search_map').submit(); } } var layer = new Array() layer[0] = ["","com.google.webcams","map_webcams"]; layer[1] = ["","com.panoramio.all","map_panoramio"]; layer[2] = ["","com.youtube.all","map_youtube"]; function showLayerOnMap(layerID){ webcamChacked = document.getElementById(layer[layerID][2]).checked; if (webcamChacked){ layer[layerID][0] = new GLayer(layer[layerID][1]); map.addOverlay(layer[layerID][0]); } else { map.removeOverlay(layer[layerID][0]); } } function setMapSize(mapId){ //setCookie("mapSize",mapId,365); //var head = document.getElementsByTagName('head')[0]; //$(document.createElement('link')).attr({type: 'text/css', href: css_href, rel: 'stylesheet, media:'screen''}).appendTo(head); //$('#mapCss').href="fileadmin/templates/css/map"+mapId+".css"; //document.location.reload(); tmpHref = document.location.href; if (tmpHref.indexOf("#")>5) tmpHref = tmpHref.substring(0,tmpHref.indexOf("#")); if (tmpHref.indexOf("?")>5) tmpHref = tmpHref.substring(0,tmpHref.indexOf("?")); document.location.href=tmpHref+"?newMapSize="+mapId //window.reload(); } function setCookie(c_name,value,expiredays) { var exdate=new Date(); exdate.setDate(exdate.getDate()+expiredays); document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : ";expires="+exdate.toGMTString()); } function getCookie(c_name) { if (document.cookie.length>0) { c_start=document.cookie.indexOf(c_name + "="); if (c_start!=-1) { c_start=c_start + c_name.length+1; c_end=document.cookie.indexOf(";",c_start); if (c_end==-1) c_end=document.cookie.length; return unescape(document.cookie.substring(c_start,c_end)); } } return ""; } function getWaypointsDistance(waypoint1, waypoint2){ var waypoint1Rad = convertDegreesToRadians(90 - waypoint1['Y']); var waypoint2Rad = convertDegreesToRadians(90 - waypoint2['Y']); dist = Math.acos(Math.cos(waypoint1Rad) * Math.cos(waypoint2Rad) + Math.sin(waypoint1Rad) * Math.sin(waypoint2Rad) * Math.cos(convertDegreesToRadians(waypoint1['X'] - waypoint2['X']))) * 6367000; return dist; } function convertDegreesToRadians(n){ return n * (Math.PI / 180.0); } /* * jQuery JavaScript Library v1.3 * http://jquery.com/ * * Copyright (c) 2009 John Resig * Dual licensed under the MIT and GPL licenses. * http://docs.jquery.com/License * * Date: 2009-01-13 12:50:31 -0500 (Tue, 13 Jan 2009) * Revision: 6104 */ (function(){var l=this,g,x=l.jQuery,o=l.$,n=l.jQuery=l.$=function(D,E){return new n.fn.init(D,E)},C=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;n.fn=n.prototype={init:function(D,G){D=D||document;if(D.nodeType){this[0]=D;this.length=1;this.context=D;return this}if(typeof D==="string"){var F=C.exec(D);if(F&&(F[1]||!G)){if(F[1]){D=n.clean([F[1]],G)}else{var H=document.getElementById(F[3]);if(H){if(H.id!=F[3]){return n().find(D)}var E=n(H);E.context=document;E.selector=D;return E}D=[]}}else{return n(G).find(D)}}else{if(n.isFunction(D)){return n(document).ready(D)}}if(D.selector&&D.context){this.selector=D.selector;this.context=D.context}return this.setArray(n.makeArray(D))},selector:"",jquery:"1.3",size:function(){return this.length},get:function(D){return D===g?n.makeArray(this):this[D]},pushStack:function(E,G,D){var F=n(E);F.prevObject=this;F.context=this.context;if(G==="find"){F.selector=this.selector+(this.selector?" ":"")+D}else{if(G){F.selector=this.selector+"."+G+"("+D+")"}}return F},setArray:function(D){this.length=0;Array.prototype.push.apply(this,D);return this},each:function(E,D){return n.each(this,E,D)},index:function(D){return n.inArray(D&&D.jquery?D[0]:D,this)},attr:function(E,G,F){var D=E;if(typeof E==="string"){if(G===g){return this[0]&&n[F||"attr"](this[0],E)}else{D={};D[E]=G}}return this.each(function(H){for(E in D){n.attr(F?this.style:this,E,n.prop(this,D[E],F,H,E))}})},css:function(D,E){if((D=="width"||D=="height")&&parseFloat(E)<0){E=g}return this.attr(D,E,"curCSS")},text:function(E){if(typeof E!=="object"&&E!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(E))}var D="";n.each(E||this,function(){n.each(this.childNodes,function(){if(this.nodeType!=8){D+=this.nodeType!=1?this.nodeValue:n.fn.text([this])}})});return D},wrapAll:function(D){if(this[0]){var E=n(D,this[0].ownerDocument).clone();if(this[0].parentNode){E.insertBefore(this[0])}E.map(function(){var F=this;while(F.firstChild){F=F.firstChild}return F}).append(this)}return this},wrapInner:function(D){return this.each(function(){n(this).contents().wrapAll(D)})},wrap:function(D){return this.each(function(){n(this).wrapAll(D)})},append:function(){return this.domManip(arguments,true,function(D){if(this.nodeType==1){this.appendChild(D)}})},prepend:function(){return this.domManip(arguments,true,function(D){if(this.nodeType==1){this.insertBefore(D,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(D){this.parentNode.insertBefore(D,this)})},after:function(){return this.domManip(arguments,false,function(D){this.parentNode.insertBefore(D,this.nextSibling)})},end:function(){return this.prevObject||n([])},push:[].push,find:function(D){if(this.length===1&&!/,/.test(D)){var F=this.pushStack([],"find",D);F.length=0;n.find(D,this[0],F);return F}else{var E=n.map(this,function(G){return n.find(D,G)});return this.pushStack(/[^+>] [^+>]/.test(D)?n.unique(E):E,"find",D)}},clone:function(E){var D=this.map(function(){if(!n.support.noCloneEvent&&!n.isXMLDoc(this)){var H=this.cloneNode(true),G=document.createElement("div");G.appendChild(H);return n.clean([G.innerHTML])[0]}else{return this.cloneNode(true)}});var F=D.find("*").andSelf().each(function(){if(this[h]!==g){this[h]=null}});if(E===true){this.find("*").andSelf().each(function(H){if(this.nodeType==3){return}var G=n.data(this,"events");for(var J in G){for(var I in G[J]){n.event.add(F[H],J,G[J][I],G[J][I].data)}}})}return D},filter:function(D){return this.pushStack(n.isFunction(D)&&n.grep(this,function(F,E){return D.call(F,E)})||n.multiFilter(D,n.grep(this,function(E){return E.nodeType===1})),"filter",D)},closest:function(D){var E=n.expr.match.POS.test(D)?n(D):null;return this.map(function(){var F=this;while(F&&F.ownerDocument){if(E?E.index(F)>-1:n(F).is(D)){return F}F=F.parentNode}})},not:function(D){if(typeof D==="string"){if(f.test(D)){return this.pushStack(n.multiFilter(D,this,true),"not",D)}else{D=n.multiFilter(D,this)}}var E=D.length&&D[D.length-1]!==g&&!D.nodeType;return this.filter(function(){return E?n.inArray(this,D)<0:this!=D})},add:function(D){return this.pushStack(n.unique(n.merge(this.get(),typeof D==="string"?n(D):n.makeArray(D))))},is:function(D){return !!D&&n.multiFilter(D,this).length>0},hasClass:function(D){return !!D&&this.is("."+D)},val:function(J){if(J===g){var D=this[0];if(D){if(n.nodeName(D,"option")){return(D.attributes.value||{}).specified?D.value:D.text}if(n.nodeName(D,"select")){var H=D.selectedIndex,K=[],L=D.options,G=D.type=="select-one";if(H<0){return null}for(var E=G?H:0,I=G?H+1:L.length;E=0||n.inArray(this.name,J)>=0)}else{if(n.nodeName(this,"select")){var M=n.makeArray(J);n("option",this).each(function(){this.selected=(n.inArray(this.value,M)>=0||n.inArray(this.text,M)>=0)});if(!M.length){this.selectedIndex=-1}}else{this.value=J}}})},html:function(D){return D===g?(this[0]?this[0].innerHTML:null):this.empty().append(D)},replaceWith:function(D){return this.after(D).remove()},eq:function(D){return this.slice(D,+D+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(D){return this.pushStack(n.map(this,function(F,E){return D.call(F,E,F)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=n.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild,D=this.length>1?I.cloneNode(true):I;if(H){for(var G=0,E=this.length;G0?D.cloneNode(true):I)}}if(F){n.each(F,y)}}return this;function K(N,O){return M&&n.nodeName(N,"table")&&n.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};n.fn.init.prototype=n.fn;function y(D,E){if(E.src){n.ajax({url:E.src,async:false,dataType:"script"})}else{n.globalEval(E.text||E.textContent||E.innerHTML||"")}if(E.parentNode){E.parentNode.removeChild(E)}}function e(){return +new Date}n.extend=n.fn.extend=function(){var I=arguments[0]||{},G=1,H=arguments.length,D=false,F;if(typeof I==="boolean"){D=I;I=arguments[1]||{};G=2}if(typeof I!=="object"&&!n.isFunction(I)){I={}}if(H==G){I=this;--G}for(;G-1}},swap:function(G,F,H){var D={};for(var E in F){D[E]=G.style[E];G.style[E]=F[E]}H.call(G);for(var E in F){G.style[E]=D[E]}},css:function(F,D,H){if(D=="width"||D=="height"){var J,E={position:"absolute",visibility:"hidden",display:"block"},I=D=="width"?["Left","Right"]:["Top","Bottom"];function G(){J=D=="width"?F.offsetWidth:F.offsetHeight;var L=0,K=0;n.each(I,function(){L+=parseFloat(n.curCSS(F,"padding"+this,true))||0;K+=parseFloat(n.curCSS(F,"border"+this+"Width",true))||0});J-=Math.round(L+K)}if(n(F).is(":visible")){G()}else{n.swap(F,E,G)}return Math.max(0,J)}return n.curCSS(F,D,H)},curCSS:function(H,E,F){var K,D=H.style;if(E=="opacity"&&!n.support.opacity){K=n.attr(D,"opacity");return K==""?"1":K}if(E.match(/float/i)){E=v}if(!F&&D&&D[E]){K=D[E]}else{if(p.getComputedStyle){if(E.match(/float/i)){E="float"}E=E.replace(/([A-Z])/g,"-$1").toLowerCase();var L=p.getComputedStyle(H,null);if(L){K=L.getPropertyValue(E)}if(E=="opacity"&&K==""){K="1"}}else{if(H.currentStyle){var I=E.replace(/\-(\w)/g,function(M,N){return N.toUpperCase()});K=H.currentStyle[E]||H.currentStyle[I];if(!/^\d+(px)?$/i.test(K)&&/^\d/.test(K)){var G=D.left,J=H.runtimeStyle.left;H.runtimeStyle.left=H.currentStyle.left;D.left=K||0;K=D.pixelLeft+"px";D.left=G;H.runtimeStyle.left=J}}}}return K},clean:function(E,J,H){J=J||document;if(typeof J.createElement==="undefined"){J=J.ownerDocument||J[0]&&J[0].ownerDocument||document}if(!H&&E.length===1&&typeof E[0]==="string"){var G=/^<(\w+)\s*\/?>$/.exec(E[0]);if(G){return[J.createElement(G[1])]}}var F=[],D=[],K=J.createElement("div");n.each(E,function(O,Q){if(typeof Q==="number"){Q+=""}if(!Q){return}if(typeof Q==="string"){Q=Q.replace(/(<(\w+)[^>]*?)\/>/g,function(S,T,R){return R.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?S:T+">"});var N=n.trim(Q).toLowerCase();var P=!N.indexOf("",""]||!N.indexOf("",""]||N.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!N.indexOf("",""]||(!N.indexOf("",""]||!N.indexOf("",""]||!n.support.htmlSerialize&&[1,"div
","
"]||[0,"",""];K.innerHTML=P[1]+Q+P[2];while(P[0]--){K=K.lastChild}if(!n.support.tbody){var M=!N.indexOf(""&&N.indexOf("=0;--L){if(n.nodeName(M[L],"tbody")&&!M[L].childNodes.length){M[L].parentNode.removeChild(M[L])}}}if(!n.support.leadingWhitespace&&/^\s/.test(Q)){K.insertBefore(J.createTextNode(Q.match(/^\s*/)[0]),K.firstChild)}Q=n.makeArray(K.childNodes)}if(Q.nodeType){F.push(Q)}else{F=n.merge(F,Q)}});if(H){for(var I=0;F[I];I++){if(n.nodeName(F[I],"script")&&(!F[I].type||F[I].type.toLowerCase()==="text/javascript")){D.push(F[I].parentNode?F[I].parentNode.removeChild(F[I]):F[I])}else{if(F[I].nodeType===1){F.splice.apply(F,[I+1,0].concat(n.makeArray(F[I].getElementsByTagName("script"))))}H.appendChild(F[I])}}return D}return F},attr:function(I,F,J){if(!I||I.nodeType==3||I.nodeType==8){return g}var G=!n.isXMLDoc(I),K=J!==g;F=G&&n.props[F]||F;if(I.tagName){var E=/href|src|style/.test(F);if(F=="selected"&&I.parentNode){I.parentNode.selectedIndex}if(F in I&&G&&!E){if(K){if(F=="type"&&n.nodeName(I,"input")&&I.parentNode){throw"type property can't be changed"}I[F]=J}if(n.nodeName(I,"form")&&I.getAttributeNode(F)){return I.getAttributeNode(F).nodeValue}if(F=="tabIndex"){var H=I.getAttributeNode("tabIndex");return H&&H.specified?H.value:I.nodeName.match(/^(a|area|button|input|object|select|textarea)$/i)?0:g}return I[F]}if(!n.support.style&&G&&F=="style"){return n.attr(I.style,"cssText",J)}if(K){I.setAttribute(F,""+J)}var D=!n.support.hrefNormalized&&G&&E?I.getAttribute(F,2):I.getAttribute(F);return D===null?g:D}if(!n.support.opacity&&F=="opacity"){if(K){I.zoom=1;I.filter=(I.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(J)+""=="NaN"?"":"alpha(opacity="+J*100+")")}return I.filter&&I.filter.indexOf("opacity=")>=0?(parseFloat(I.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}F=F.replace(/-([a-z])/ig,function(L,M){return M.toUpperCase()});if(K){I[F]=J}return I[F]},trim:function(D){return(D||"").replace(/^\s+|\s+$/g,"")},makeArray:function(F){var D=[];if(F!=null){var E=F.length;if(E==null||typeof F==="string"||n.isFunction(F)||F.setInterval){D[0]=F}else{while(E){D[--E]=F[E]}}}return D},inArray:function(F,G){for(var D=0,E=G.length;D*",this).remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(D,E){n.fn[D]=function(){return this.each(E,arguments)}});function j(D,E){return D[0]&&parseInt(n.curCSS(D[0],E,true),10)||0}var h="jQuery"+e(),u=0,z={};n.extend({cache:{},data:function(E,D,F){E=E==l?z:E;var G=E[h];if(!G){G=E[h]=++u}if(D&&!n.cache[G]){n.cache[G]={}}if(F!==g){n.cache[G][D]=F}return D?n.cache[G][D]:G},removeData:function(E,D){E=E==l?z:E;var G=E[h];if(D){if(n.cache[G]){delete n.cache[G][D];D="";for(D in n.cache[G]){break}if(!D){n.removeData(E)}}}else{try{delete E[h]}catch(F){if(E.removeAttribute){E.removeAttribute(h)}}delete n.cache[G]}},queue:function(E,D,G){if(E){D=(D||"fx")+"queue";var F=n.data(E,D);if(!F||n.isArray(G)){F=n.data(E,D,n.makeArray(G))}else{if(G){F.push(G)}}}return F},dequeue:function(G,F){var D=n.queue(G,F),E=D.shift();if(!F||F==="fx"){E=D[0]}if(E!==g){E.call(G)}}});n.fn.extend({data:function(D,F){var G=D.split(".");G[1]=G[1]?"."+G[1]:"";if(F===g){var E=this.triggerHandler("getData"+G[1]+"!",[G[0]]);if(E===g&&this.length){E=n.data(this[0],D)}return E===g&&G[1]?this.data(G[0]):E}else{return this.trigger("setData"+G[1]+"!",[G[0],F]).each(function(){n.data(this,D,F)})}},removeData:function(D){return this.each(function(){n.removeData(this,D)})},queue:function(D,E){if(typeof D!=="string"){E=D;D="fx"}if(E===g){return n.queue(this[0],D)}return this.each(function(){var F=n.queue(this,D,E);if(D=="fx"&&F.length==1){F[0].call(this)}})},dequeue:function(D){return this.each(function(){n.dequeue(this,D)})}}); /* * Sizzle CSS Selector Engine - v0.9.1 * Copyright 2009, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * More information: http://sizzlejs.com/ */ (function(){var N=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|[^[\]]+)+\]|\\.|[^ >+~,(\[]+)+|[>+~])(\s*,\s*)?/g,I=0,F=Object.prototype.toString;var E=function(ae,S,aa,V){aa=aa||[];S=S||document;if(S.nodeType!==1&&S.nodeType!==9){return[]}if(!ae||typeof ae!=="string"){return aa}var ab=[],ac,Y,ah,ag,Z,R,Q=true;N.lastIndex=0;while((ac=N.exec(ae))!==null){ab.push(ac[1]);if(ac[2]){R=RegExp.rightContext;break}}if(ab.length>1&&G.match.POS.exec(ae)){if(ab.length===2&&G.relative[ab[0]]){var U="",X;while((X=G.match.POS.exec(ae))){U+=X[0];ae=ae.replace(G.match.POS,"")}Y=E.filter(U,E(/\s$/.test(ae)?ae+"*":ae,S))}else{Y=G.relative[ab[0]]?[S]:E(ab.shift(),S);while(ab.length){var P=[];ae=ab.shift();if(G.relative[ae]){ae+=ab.shift()}for(var af=0,ad=Y.length;af0){ah=D(Y)}else{Q=false}while(ab.length){var T=ab.pop(),W=T;if(!G.relative[T]){T=""}else{W=ab.pop()}if(W==null){W=S}G.relative[T](ah,W,M(S))}}if(!ah){ah=Y}if(!ah){throw"Syntax error, unrecognized expression: "+(T||ae)}if(F.call(ah)==="[object Array]"){if(!Q){aa.push.apply(aa,ah)}else{if(S.nodeType===1){for(var af=0;ah[af]!=null;af++){if(ah[af]&&(ah[af]===true||ah[af].nodeType===1&&H(S,ah[af]))){aa.push(Y[af])}}}else{for(var af=0;ah[af]!=null;af++){if(ah[af]&&ah[af].nodeType===1){aa.push(Y[af])}}}}}else{D(ah,aa)}if(R){E(R,S,aa,V)}return aa};E.matches=function(P,Q){return E(P,null,null,Q)};E.find=function(V,S){var W,Q;if(!V){return[]}for(var R=0,P=G.order.length;R":function(U,Q,V){if(typeof Q==="string"&&!/\W/.test(Q)){Q=V?Q:Q.toUpperCase();for(var R=0,P=U.length;R=0){if(!R){P.push(Q[T])}}else{if(R){Q[T]=false}}}return false},ID:function(P){return P[1].replace(/\\/g,"")},TAG:function(Q,P){for(var R=0;!P[R];R++){}return M(P[R])?Q[1]:Q[1].toUpperCase()},CHILD:function(P){if(P[1]=="nth"){var Q=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(P[2]=="even"&&"2n"||P[2]=="odd"&&"2n+1"||!/\D/.test(P[2])&&"0n+"+P[2]||P[2]);P[2]=(Q[1]+(Q[2]||1))-0;P[3]=Q[3]-0}P[0]="done"+(I++);return P},ATTR:function(Q){var P=Q[1];if(G.attrMap[P]){Q[1]=G.attrMap[P]}if(Q[2]==="~="){Q[4]=" "+Q[4]+" "}return Q},PSEUDO:function(T,Q,R,P,U){if(T[1]==="not"){if(T[3].match(N).length>1){T[3]=E(T[3],null,null,Q)}else{var S=E.filter(T[3],Q,R,true^U);if(!R){P.push.apply(P,S)}return false}}else{if(G.match.POS.test(T[0])){return true}}return T},POS:function(P){P.unshift(true);return P}},filters:{enabled:function(P){return P.disabled===false&&P.type!=="hidden"},disabled:function(P){return P.disabled===true},checked:function(P){return P.checked===true},selected:function(P){P.parentNode.selectedIndex;return P.selected===true},parent:function(P){return !!P.firstChild},empty:function(P){return !P.firstChild},has:function(R,Q,P){return !!E(P[3],R).length},header:function(P){return/h\d/i.test(P.nodeName)},text:function(P){return"text"===P.type},radio:function(P){return"radio"===P.type},checkbox:function(P){return"checkbox"===P.type},file:function(P){return"file"===P.type},password:function(P){return"password"===P.type},submit:function(P){return"submit"===P.type},image:function(P){return"image"===P.type},reset:function(P){return"reset"===P.type},button:function(P){return"button"===P.type||P.nodeName.toUpperCase()==="BUTTON"},input:function(P){return/input|select|textarea|button/i.test(P.nodeName)}},setFilters:{first:function(Q,P){return P===0},last:function(R,Q,P,S){return Q===S.length-1},even:function(Q,P){return P%2===0},odd:function(Q,P){return P%2===1},lt:function(R,Q,P){return QP[3]-0},nth:function(R,Q,P){return P[3]-0==Q},eq:function(R,Q,P){return P[3]-0==Q}},filter:{CHILD:function(P,S){var V=S[1],W=P.parentNode;var U="child"+W.childNodes.length;if(W&&(!W[U]||!P.nodeIndex)){var T=1;for(var Q=W.firstChild;Q;Q=Q.nextSibling){if(Q.nodeType==1){Q.nodeIndex=T++}}W[U]=T-1}if(V=="first"){return P.nodeIndex==1}else{if(V=="last"){return P.nodeIndex==W[U]}else{if(V=="only"){return W[U]==1}else{if(V=="nth"){var Y=false,R=S[2],X=S[3];if(R==1&&X==0){return true}if(R==0){if(P.nodeIndex==X){Y=true}}else{if((P.nodeIndex-X)%R==0&&(P.nodeIndex-X)/R>=0){Y=true}}return Y}}}}},PSEUDO:function(V,R,S,W){var Q=R[1],T=G.filters[Q];if(T){return T(V,S,R,W)}else{if(Q==="contains"){return(V.textContent||V.innerText||"").indexOf(R[3])>=0}else{if(Q==="not"){var U=R[3];for(var S=0,P=U.length;S=0:S==="~="?(" "+U+" ").indexOf(Q)>=0:!R[4]?P:S==="!="?U!=Q:S==="^="?U.indexOf(Q)===0:S==="$="?U.substr(U.length-Q.length)===Q:S==="|="?U===Q||U.substr(0,Q.length+1)===Q+"-":false},POS:function(T,Q,R,U){var P=Q[2],S=G.setFilters[P];if(S){return S(T,R,Q,U)}}}};for(var K in G.match){G.match[K]=RegExp(G.match[K].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var D=function(Q,P){Q=Array.prototype.slice.call(Q);if(P){P.push.apply(P,Q);return P}return Q};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(J){D=function(T,S){var Q=S||[];if(F.call(T)==="[object Array]"){Array.prototype.push.apply(Q,T)}else{if(typeof T.length==="number"){for(var R=0,P=T.length;R";var P=document.documentElement;P.insertBefore(Q,P.firstChild);if(!!document.getElementById(R)){G.find.ID=function(T,U){if(U.getElementById){var S=U.getElementById(T[1]);return S?S.id===T[1]||S.getAttributeNode&&S.getAttributeNode("id").nodeValue===T[1]?[S]:g:[]}};G.filter.ID=function(U,S){var T=U.getAttributeNode&&U.getAttributeNode("id");return U.nodeType===1&&T&&T.nodeValue===S}}P.removeChild(Q)})();(function(){var P=document.createElement("div");P.appendChild(document.createComment(""));if(P.getElementsByTagName("*").length>0){G.find.TAG=function(Q,U){var T=U.getElementsByTagName(Q[1]);if(Q[1]==="*"){var S=[];for(var R=0;T[R];R++){if(T[R].nodeType===1){S.push(T[R])}}T=S}return T}}P.innerHTML="";if(P.firstChild.getAttribute("href")!=="#"){G.attrHandle.href=function(Q){return Q.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var P=E;E=function(T,S,Q,R){S=S||document;if(!R&&S.nodeType===9){try{return D(S.querySelectorAll(T),Q)}catch(U){}}return P(T,S,Q,R)};E.find=P.find;E.filter=P.filter;E.selectors=P.selectors;E.matches=P.matches})()}if(document.documentElement.getElementsByClassName){G.order.splice(1,0,"CLASS");G.find.CLASS=function(P,Q){return Q.getElementsByClassName(P[1])}}function L(Q,W,V,Z,X,Y){for(var T=0,R=Z.length;T0){T=P;break}}}P=P[Q]}Y[S]=T}}}var H=document.compareDocumentPosition?function(Q,P){return Q.compareDocumentPosition(P)&16}:function(Q,P){return Q!==P&&(Q.contains?Q.contains(P):true)};var M=function(P){return P.documentElement&&!P.body||P.tagName&&P.ownerDocument&&!P.ownerDocument.body};n.find=E;n.filter=E.filter;n.expr=E.selectors;n.expr[":"]=n.expr.filters;E.selectors.filters.hidden=function(P){return"hidden"===P.type||n.css(P,"display")==="none"||n.css(P,"visibility")==="hidden"};E.selectors.filters.visible=function(P){return"hidden"!==P.type&&n.css(P,"display")!=="none"&&n.css(P,"visibility")!=="hidden"};E.selectors.filters.animated=function(P){return n.grep(n.timers,function(Q){return P===Q.elem}).length};n.multiFilter=function(R,P,Q){if(Q){R=":not("+R+")"}return E.matches(R,P)};n.dir=function(R,Q){var P=[],S=R[Q];while(S&&S!=document){if(S.nodeType==1){P.push(S)}S=S[Q]}return P};n.nth=function(T,P,R,S){P=P||1;var Q=0;for(;T;T=T[R]){if(T.nodeType==1&&++Q==P){break}}return T};n.sibling=function(R,Q){var P=[];for(;R;R=R.nextSibling){if(R.nodeType==1&&R!=Q){P.push(R)}}return P};return;l.Sizzle=E})();n.event={add:function(H,E,G,J){if(H.nodeType==3||H.nodeType==8){return}if(H.setInterval&&H!=l){H=l}if(!G.guid){G.guid=this.guid++}if(J!==g){var F=G;G=this.proxy(F);G.data=J}var D=n.data(H,"events")||n.data(H,"events",{}),I=n.data(H,"handle")||n.data(H,"handle",function(){return typeof n!=="undefined"&&!n.event.triggered?n.event.handle.apply(arguments.callee.elem,arguments):g});I.elem=H;n.each(E.split(/\s+/),function(L,M){var N=M.split(".");M=N.shift();G.type=N.slice().sort().join(".");var K=D[M];if(n.event.specialAll[M]){n.event.specialAll[M].setup.call(H,J,N)}if(!K){K=D[M]={};if(!n.event.special[M]||n.event.special[M].setup.call(H,J,N)===false){if(H.addEventListener){H.addEventListener(M,I,false)}else{if(H.attachEvent){H.attachEvent("on"+M,I)}}}}K[G.guid]=G;n.event.global[M]=true});H=null},guid:1,global:{},remove:function(J,G,I){if(J.nodeType==3||J.nodeType==8){return}var F=n.data(J,"events"),E,D;if(F){if(G===g||(typeof G==="string"&&G.charAt(0)==".")){for(var H in F){this.remove(J,H+(G||""))}}else{if(G.type){I=G.handler;G=G.type}n.each(G.split(/\s+/),function(L,N){var P=N.split(".");N=P.shift();var M=RegExp("(^|\\.)"+P.slice().sort().join(".*\\.")+"(\\.|$)");if(F[N]){if(I){delete F[N][I.guid]}else{for(var O in F[N]){if(M.test(F[N][O].type)){delete F[N][O]}}}if(n.event.specialAll[N]){n.event.specialAll[N].teardown.call(J,P)}for(E in F[N]){break}if(!E){if(!n.event.special[N]||n.event.special[N].teardown.call(J,P)===false){if(J.removeEventListener){J.removeEventListener(N,n.data(J,"handle"),false)}else{if(J.detachEvent){J.detachEvent("on"+N,n.data(J,"handle"))}}}E=null;delete F[N]}}})}for(E in F){break}if(!E){var K=n.data(J,"handle");if(K){K.elem=null}n.removeData(J,"events");n.removeData(J,"handle")}}},trigger:function(H,J,G,D){var F=H.type||H;if(!D){H=typeof H==="object"?H[h]?H:n.extend(n.Event(F),H):n.Event(F);if(F.indexOf("!")>=0){H.type=F=F.slice(0,-1);H.exclusive=true}if(!G){H.stopPropagation();if(this.global[F]){n.each(n.cache,function(){if(this.events&&this.events[F]){n.event.trigger(H,J,this.handle.elem)}})}}if(!G||G.nodeType==3||G.nodeType==8){return g}H.result=g;H.target=G;J=n.makeArray(J);J.unshift(H)}H.currentTarget=G;var I=n.data(G,"handle");if(I){I.apply(G,J)}if((!G[F]||(n.nodeName(G,"a")&&F=="click"))&&G["on"+F]&&G["on"+F].apply(G,J)===false){H.result=false}if(!D&&G[F]&&!H.isDefaultPrevented()&&!(n.nodeName(G,"a")&&F=="click")){this.triggered=true;try{G[F]()}catch(K){}}this.triggered=false;if(!H.isPropagationStopped()){var E=G.parentNode||G.ownerDocument;if(E){n.event.trigger(H,J,E,true)}}},handle:function(J){var I,D;J=arguments[0]=n.event.fix(J||l.event);var K=J.type.split(".");J.type=K.shift();I=!K.length&&!J.exclusive;var H=RegExp("(^|\\.)"+K.slice().sort().join(".*\\.")+"(\\.|$)");D=(n.data(this,"events")||{})[J.type];for(var F in D){var G=D[F];if(I||H.test(G.type)){J.handler=G;J.data=G.data;var E=G.apply(this,arguments);if(E!==g){J.result=E;if(E===false){J.preventDefault();J.stopPropagation()}}if(J.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(G){if(G[h]){return G}var E=G;G=n.Event(E);for(var F=this.props.length,I;F;){I=this.props[--F];G[I]=E[I]}if(!G.target){G.target=G.srcElement||document}if(G.target.nodeType==3){G.target=G.target.parentNode}if(!G.relatedTarget&&G.fromElement){G.relatedTarget=G.fromElement==G.target?G.toElement:G.fromElement}if(G.pageX==null&&G.clientX!=null){var H=document.documentElement,D=document.body;G.pageX=G.clientX+(H&&H.scrollLeft||D&&D.scrollLeft||0)-(H.clientLeft||0);G.pageY=G.clientY+(H&&H.scrollTop||D&&D.scrollTop||0)-(H.clientTop||0)}if(!G.which&&((G.charCode||G.charCode===0)?G.charCode:G.keyCode)){G.which=G.charCode||G.keyCode}if(!G.metaKey&&G.ctrlKey){G.metaKey=G.ctrlKey}if(!G.which&&G.button){G.which=(G.button&1?1:(G.button&2?3:(G.button&4?2:0)))}return G},proxy:function(E,D){D=D||function(){return E.apply(this,arguments)};D.guid=E.guid=E.guid||D.guid||this.guid++;return D},special:{ready:{setup:A,teardown:function(){}}},specialAll:{live:{setup:function(D,E){n.event.add(this,E[0],c)},teardown:function(F){if(F.length){var D=0,E=RegExp("(^|\\.)"+F[0]+"(\\.|$)");n.each((n.data(this,"events").live||{}),function(){if(E.test(this.type)){D++}});if(D<1){n.event.remove(this,F[0],c)}}}}}};n.Event=function(D){if(!this.preventDefault){return new n.Event(D)}if(D&&D.type){this.originalEvent=D;this.type=D.type;this.timeStamp=D.timeStamp}else{this.type=D}if(!this.timeStamp){this.timeStamp=e()}this[h]=true};function k(){return false}function t(){return true}n.Event.prototype={preventDefault:function(){this.isDefaultPrevented=t;var D=this.originalEvent;if(!D){return}if(D.preventDefault){D.preventDefault()}D.returnValue=false},stopPropagation:function(){this.isPropagationStopped=t;var D=this.originalEvent;if(!D){return}if(D.stopPropagation){D.stopPropagation()}D.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=t;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(E){var D=E.relatedTarget;while(D&&D!=this){try{D=D.parentNode}catch(F){D=this}}if(D!=this){E.type=E.data;n.event.handle.apply(this,arguments)}};n.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(E,D){n.event.special[D]={setup:function(){n.event.add(this,E,a,D)},teardown:function(){n.event.remove(this,E,a)}}});n.fn.extend({bind:function(E,F,D){return E=="unload"?this.one(E,F,D):this.each(function(){n.event.add(this,E,D||F,D&&F)})},one:function(F,G,E){var D=n.event.proxy(E||G,function(H){n(this).unbind(H,D);return(E||G).apply(this,arguments)});return this.each(function(){n.event.add(this,F,D,E&&G)})},unbind:function(E,D){return this.each(function(){n.event.remove(this,E,D)})},trigger:function(D,E){return this.each(function(){n.event.trigger(D,E,this)})},triggerHandler:function(D,F){if(this[0]){var E=n.Event(D);E.preventDefault();E.stopPropagation();n.event.trigger(E,F,this[0]);return E.result}},toggle:function(F){var D=arguments,E=1;while(E=0){var D=F.slice(H,F.length);F=F.slice(0,H)}var G="GET";if(I){if(n.isFunction(I)){J=I;I=null}else{if(typeof I==="object"){I=n.param(I);G="POST"}}}var E=this;n.ajax({url:F,type:G,dataType:"html",data:I,complete:function(L,K){if(K=="success"||K=="notmodified"){E.html(D?n("
").append(L.responseText.replace(//g,"")).find(D):L.responseText)}if(J){E.each(J,[L.responseText,K,L])}}});return this},serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?n.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type))}).map(function(D,E){var F=n(this).val();return F==null?null:n.isArray(F)?n.map(F,function(H,G){return{name:E.name,value:H}}):{name:E.name,value:F}}).get()}});n.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(D,E){n.fn[E]=function(F){return this.bind(E,F)}});var q=e();n.extend({get:function(D,F,G,E){if(n.isFunction(F)){G=F;F=null}return n.ajax({type:"GET",url:D,data:F,success:G,dataType:E})},getScript:function(D,E){return n.get(D,null,E,"script")},getJSON:function(D,E,F){return n.get(D,E,F,"json")},post:function(D,F,G,E){if(n.isFunction(F)){G=F;F={}}return n.ajax({type:"POST",url:D,data:F,success:G,dataType:E})},ajaxSetup:function(D){n.extend(n.ajaxSettings,D)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(L){L=n.extend(true,L,n.extend(true,{},n.ajaxSettings,L));var V,E=/=\?(&|$)/g,Q,U,F=L.type.toUpperCase();if(L.data&&L.processData&&typeof L.data!=="string"){L.data=n.param(L.data)}if(L.dataType=="jsonp"){if(F=="GET"){if(!L.url.match(E)){L.url+=(L.url.match(/\?/)?"&":"?")+(L.jsonp||"callback")+"=?"}}else{if(!L.data||!L.data.match(E)){L.data=(L.data?L.data+"&":"")+(L.jsonp||"callback")+"=?"}}L.dataType="json"}if(L.dataType=="json"&&(L.data&&L.data.match(E)||L.url.match(E))){V="jsonp"+q++;if(L.data){L.data=(L.data+"").replace(E,"="+V+"$1")}L.url=L.url.replace(E,"="+V+"$1");L.dataType="script";l[V]=function(W){U=W;H();K();l[V]=g;try{delete l[V]}catch(X){}if(G){G.removeChild(S)}}}if(L.dataType=="script"&&L.cache==null){L.cache=false}if(L.cache===false&&F=="GET"){var D=e();var T=L.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+D+"$2");L.url=T+((T==L.url)?(L.url.match(/\?/)?"&":"?")+"_="+D:"")}if(L.data&&F=="GET"){L.url+=(L.url.match(/\?/)?"&":"?")+L.data;L.data=null}if(L.global&&!n.active++){n.event.trigger("ajaxStart")}var P=/^(\w+:)?\/\/([^\/?#]+)/.exec(L.url);if(L.dataType=="script"&&F=="GET"&&P&&(P[1]&&P[1]!=location.protocol||P[2]!=location.host)){var G=document.getElementsByTagName("head")[0];var S=document.createElement("script");S.src=L.url;if(L.scriptCharset){S.charset=L.scriptCharset}if(!V){var N=false;S.onload=S.onreadystatechange=function(){if(!N&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){N=true;H();K();G.removeChild(S)}}}G.appendChild(S);return g}var J=false;var I=L.xhr();if(L.username){I.open(F,L.url,L.async,L.username,L.password)}else{I.open(F,L.url,L.async)}try{if(L.data){I.setRequestHeader("Content-Type",L.contentType)}if(L.ifModified){I.setRequestHeader("If-Modified-Since",n.lastModified[L.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}I.setRequestHeader("X-Requested-With","XMLHttpRequest");I.setRequestHeader("Accept",L.dataType&&L.accepts[L.dataType]?L.accepts[L.dataType]+", */*":L.accepts._default)}catch(R){}if(L.beforeSend&&L.beforeSend(I,L)===false){if(L.global&&!--n.active){n.event.trigger("ajaxStop")}I.abort();return false}if(L.global){n.event.trigger("ajaxSend",[I,L])}var M=function(W){if(I.readyState==0){if(O){clearInterval(O);O=null;if(L.global&&!--n.active){n.event.trigger("ajaxStop")}}}else{if(!J&&I&&(I.readyState==4||W=="timeout")){J=true;if(O){clearInterval(O);O=null}Q=W=="timeout"?"timeout":!n.httpSuccess(I)?"error":L.ifModified&&n.httpNotModified(I,L.url)?"notmodified":"success";if(Q=="success"){try{U=n.httpData(I,L.dataType,L)}catch(Y){Q="parsererror"}}if(Q=="success"){var X;try{X=I.getResponseHeader("Last-Modified")}catch(Y){}if(L.ifModified&&X){n.lastModified[L.url]=X}if(!V){H()}}else{n.handleError(L,I,Q)}K();if(L.async){I=null}}}};if(L.async){var O=setInterval(M,13);if(L.timeout>0){setTimeout(function(){if(I){if(!J){M("timeout")}if(I){I.abort()}}},L.timeout)}}try{I.send(L.data)}catch(R){n.handleError(L,I,null,R)}if(!L.async){M()}function H(){if(L.success){L.success(U,Q)}if(L.global){n.event.trigger("ajaxSuccess",[I,L])}}function K(){if(L.complete){L.complete(I,Q)}if(L.global){n.event.trigger("ajaxComplete",[I,L])}if(L.global&&!--n.active){n.event.trigger("ajaxStop")}}return I},handleError:function(E,G,D,F){if(E.error){E.error(G,D,F)}if(E.global){n.event.trigger("ajaxError",[G,E,F])}},active:0,httpSuccess:function(E){try{return !E.status&&location.protocol=="file:"||(E.status>=200&&E.status<300)||E.status==304||E.status==1223}catch(D){}return false},httpNotModified:function(F,D){try{var G=F.getResponseHeader("Last-Modified");return F.status==304||G==n.lastModified[D]}catch(E){}return false},httpData:function(I,G,F){var E=I.getResponseHeader("content-type"),D=G=="xml"||!G&&E&&E.indexOf("xml")>=0,H=D?I.responseXML:I.responseText;if(D&&H.documentElement.tagName=="parsererror"){throw"parsererror"}if(F&&F.dataFilter){H=F.dataFilter(H,G)}if(typeof H==="string"){if(G=="script"){n.globalEval(H)}if(G=="json"){H=l["eval"]("("+H+")")}}return H},param:function(D){var F=[];function G(H,I){F[F.length]=encodeURIComponent(H)+"="+encodeURIComponent(I)}if(n.isArray(D)||D.jquery){n.each(D,function(){G(this.name,this.value)})}else{for(var E in D){if(n.isArray(D[E])){n.each(D[E],function(){G(E,this)})}else{G(E,n.isFunction(D[E])?D[E]():D[E])}}}return F.join("&").replace(/%20/g,"+")}});var m={},d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function s(E,D){var F={};n.each(d.concat.apply([],d.slice(0,D)),function(){F[this]=E});return F}n.fn.extend({show:function(I,K){if(I){return this.animate(s("show",3),I,K)}else{for(var G=0,E=this.length;G").appendTo("body");J=H.css("display");if(J==="none"){J="block"}H.remove();m[F]=J}this[G].style.display=n.data(this[G],"olddisplay",J)}}return this}},hide:function(G,H){if(G){return this.animate(s("hide",3),G,H)}else{for(var F=0,E=this.length;F=0;G--){if(F[G].elem==this){if(D){F[G](true)}F.splice(G,1)}}});if(!D){this.dequeue()}return this}});n.each({slideDown:s("show",1),slideUp:s("hide",1),slideToggle:s("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(D,E){n.fn[D]=function(F,G){return this.animate(E,F,G)}});n.extend({speed:function(F,G,E){var D=typeof F==="object"?F:{complete:E||!E&&G||n.isFunction(F)&&F,duration:F,easing:E&&G||G&&!n.isFunction(G)&&G};D.duration=n.fx.off?0:typeof D.duration==="number"?D.duration:n.fx.speeds[D.duration]||n.fx.speeds._default;D.old=D.complete;D.complete=function(){if(D.queue!==false){n(this).dequeue()}if(n.isFunction(D.old)){D.old.call(this)}};return D},easing:{linear:function(F,G,D,E){return D+E*F},swing:function(F,G,D,E){return((-Math.cos(F*Math.PI)/2)+0.5)*E+D}},timers:[],timerId:null,fx:function(E,D,F){this.options=D;this.elem=E;this.prop=F;if(!D.orig){D.orig={}}}});n.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(n.fx.step[this.prop]||n.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(E){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var D=parseFloat(n.css(this.elem,this.prop,E));return D&&D>-10000?D:parseFloat(n.curCSS(this.elem,this.prop))||0},custom:function(H,G,F){this.startTime=e();this.start=H;this.end=G;this.unit=F||this.unit||"px";this.now=this.start;this.pos=this.state=0;var D=this;function E(I){return D.step(I)}E.elem=this.elem;n.timers.push(E);if(E()&&n.timerId==null){n.timerId=setInterval(function(){var J=n.timers;for(var I=0;I=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var D=true;for(var E in this.options.curAnim){if(this.options.curAnim[E]!==true){D=false}}if(D){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(n.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){n(this.elem).hide()}if(this.options.hide||this.options.show){for(var H in this.options.curAnim){n.attr(this.elem.style,H,this.options.orig[H])}}}if(D){this.options.complete.call(this.elem)}return false}else{var I=F-this.startTime;this.state=I/this.options.duration;this.pos=n.easing[this.options.easing||(n.easing.swing?"swing":"linear")](this.state,I,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};n.extend(n.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(D){n.attr(D.elem.style,"opacity",D.now)},_default:function(D){if(D.elem.style&&D.elem.style[D.prop]!=null){D.elem.style[D.prop]=D.now+D.unit}else{D.elem[D.prop]=D.now}}}});if(document.documentElement.getBoundingClientRect){n.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return n.offset.bodyOffset(this[0])}var F=this[0].getBoundingClientRect(),I=this[0].ownerDocument,E=I.body,D=I.documentElement,K=D.clientTop||E.clientTop||0,J=D.clientLeft||E.clientLeft||0,H=F.top+(self.pageYOffset||n.boxModel&&D.scrollTop||E.scrollTop)-K,G=F.left+(self.pageXOffset||n.boxModel&&D.scrollLeft||E.scrollLeft)-J;return{top:H,left:G}}}else{n.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return n.offset.bodyOffset(this[0])}n.offset.initialized||n.offset.initialize();var I=this[0],F=I.offsetParent,E=I,N=I.ownerDocument,L,G=N.documentElement,J=N.body,K=N.defaultView,D=K.getComputedStyle(I,null),M=I.offsetTop,H=I.offsetLeft;while((I=I.parentNode)&&I!==J&&I!==G){L=K.getComputedStyle(I,null);M-=I.scrollTop,H-=I.scrollLeft;if(I===F){M+=I.offsetTop,H+=I.offsetLeft;if(n.offset.doesNotAddBorder&&!(n.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(I.tagName))){M+=parseInt(L.borderTopWidth,10)||0,H+=parseInt(L.borderLeftWidth,10)||0}E=F,F=I.offsetParent}if(n.offset.subtractsBorderForOverflowNotVisible&&L.overflow!=="visible"){M+=parseInt(L.borderTopWidth,10)||0,H+=parseInt(L.borderLeftWidth,10)||0}D=L}if(D.position==="relative"||D.position==="static"){M+=J.offsetTop,H+=J.offsetLeft}if(D.position==="fixed"){M+=Math.max(G.scrollTop,J.scrollTop),H+=Math.max(G.scrollLeft,J.scrollLeft)}return{top:M,left:H}}}n.offset={initialize:function(){if(this.initialized){return}var K=document.body,E=document.createElement("div"),G,F,M,H,L,D,I=K.style.marginTop,J='
';L={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(D in L){E.style[D]=L[D]}E.innerHTML=J;K.insertBefore(E,K.firstChild);G=E.firstChild,F=G.firstChild,H=G.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(F.offsetTop!==5);this.doesAddBorderForTableAndCells=(H.offsetTop===5);G.style.overflow="hidden",G.style.position="relative";this.subtractsBorderForOverflowNotVisible=(F.offsetTop===-5);K.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(K.offsetTop===0);K.style.marginTop=I;K.removeChild(E);this.initialized=true},bodyOffset:function(D){n.offset.initialized||n.offset.initialize();var F=D.offsetTop,E=D.offsetLeft;if(n.offset.doesNotIncludeMarginInBodyOffset){F+=parseInt(n.curCSS(D,"marginTop",true),10)||0,E+=parseInt(n.curCSS(D,"marginLeft",true),10)||0}return{top:F,left:E}}};n.fn.extend({position:function(){var H=0,G=0,E;if(this[0]){var F=this.offsetParent(),I=this.offset(),D=/^body|html$/i.test(F[0].tagName)?{top:0,left:0}:F.offset();I.top-=j(this,"marginTop");I.left-=j(this,"marginLeft");D.top+=j(F,"borderTopWidth");D.left+=j(F,"borderLeftWidth");E={top:I.top-D.top,left:I.left-D.left}}return E},offsetParent:function(){var D=this[0].offsetParent||document.body;while(D&&(!/^body|html$/i.test(D.tagName)&&n.css(D,"position")=="static")){D=D.offsetParent}return n(D)}});n.each(["Left","Top"],function(E,D){var F="scroll"+D;n.fn[F]=function(G){if(!this[0]){return null}return G!==g?this.each(function(){this==l||this==document?l.scrollTo(!E?G:n(l).scrollLeft(),E?G:n(l).scrollTop()):this[F]=G}):this[0]==l||this[0]==document?self[E?"pageYOffset":"pageXOffset"]||n.boxModel&&document.documentElement[F]||document.body[F]:this[0][F]}});n.each(["Height","Width"],function(G,E){var D=G?"Left":"Top",F=G?"Right":"Bottom";n.fn["inner"+E]=function(){return this[E.toLowerCase()]()+j(this,"padding"+D)+j(this,"padding"+F)};n.fn["outer"+E]=function(I){return this["inner"+E]()+j(this,"border"+D+"Width")+j(this,"border"+F+"Width")+(I?j(this,"margin"+D)+j(this,"margin"+F):0)};var H=E.toLowerCase();n.fn[H]=function(I){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+E]||document.body["client"+E]:this[0]==document?Math.max(document.documentElement["client"+E],document.body["scroll"+E],document.documentElement["scroll"+E],document.body["offset"+E],document.documentElement["offset"+E]):I===g?(this.length?n.css(this[0],H):null):this.css(H,typeof I==="string"?I:I+"px")}})})();// (c) 2008 Trent Foley ;(function($){document.write("");var ver='galleriffic-1.0';var galleryOffset=0;var galleries=[];var allImages=[];var historyCurrentHash;var historyBackStack;var historyForwardStack;var isFirst=false;var dontCheck=false;var isInitialized=false;function getHashFromString(hash){if(!hash)return-1;hash=hash.replace(/^.*#/,'');if(isNaN(hash))return-1;return(+hash);} function getHash(){var hash=location.hash;return getHashFromString(hash);} function registerGallery(gallery){galleries.push(gallery);galleryOffset+=gallery.data.length;} function getGallery(hash){for(i=0;i=0){var index=getIndex(gallery,hash);if(index>=0) gallery.goto(index);} e.preventDefault();}} function historyCallback(){var hash=getHash();if(hash<0)return;var gallery=getGallery(hash);if(!gallery)return;var index=hash-gallery.offset;gallery.goto(index);} function historyInit(){if(isInitialized)return;isInitialized=true;var current_hash=location.hash;historyCurrentHash=current_hash;if($.browser.msie){if(historyCurrentHash==''){historyCurrentHash='#';}}else if($.browser.safari){historyBackStack=[];historyBackStack.length=history.length;historyForwardStack=[];isFirst=true;} setInterval(function(){historyCheck();},100);} function historyAddHistory(hash){historyBackStack.push(hash);historyForwardStack.length=0;isFirst=true;} function historyCheck(){if($.browser.safari){if(!dontCheck){var historyDelta=history.length-historyBackStack.length;if(historyDelta){isFirst=false;if(historyDelta<0){for(var i=0;i li').each(function(i){var $li=$(this);var $aThumb=$li.find('a.thumb');var hash=gallery.offset+i;gallery.data.push({title:$aThumb.attr('title'),slideUrl:$aThumb.attr('href'),caption:$li.find('.caption').remove(),hash:hash});$aThumb.attr('rel','history');$aThumb.attr('href','#'+hash);$aThumb.click(function(e){clickHandler(e,gallery,this);});});return this;},isPreloadComplete:false,preloadInit:function(){if(this.settings.preloadAhead==0)return this;this.preloadStartIndex=this.currentIndex;var nextIndex=this.getNextIndex(this.preloadStartIndex);return this.preloadRecursive(this.preloadStartIndex,nextIndex);},preloadRelocate:function(index){this.preloadStartIndex=index;return this;},preloadRecursive:function(startIndex,currentIndex){if(startIndex!=this.preloadStartIndex){var nextIndex=this.getNextIndex(this.preloadStartIndex);return this.preloadRecursive(this.preloadStartIndex,nextIndex);} var gallery=this;var preloadCount=currentIndex-startIndex;if(preloadCount<0) preloadCount=this.data.length-1-startIndex+currentIndex;if(this.settings.preloadAhead>=0&&preloadCount>this.settings.preloadAhead){setTimeout(function(){gallery.preloadRecursive(startIndex,currentIndex);},500);return this;} var imageData=this.data[currentIndex];if(!imageData) return this;if(imageData.image) return this.preloadNext(startIndex,currentIndex);var image=new Image();image.onload=function(){imageData.image=this;gallery.preloadNext(startIndex,currentIndex);};image.alt=imageData.title;image.src=imageData.slideUrl;return this;},preloadNext:function(startIndex,currentIndex){var nextIndex=this.getNextIndex(currentIndex);if(nextIndex==startIndex){this.isPreloadComplete=true;}else{var gallery=this;setTimeout(function(){gallery.preloadRecursive(startIndex,nextIndex);},100);} return this;},getNextIndex:function(index){var nextIndex=index+1;if(nextIndex>=this.data.length) nextIndex=0;return nextIndex;},getPrevIndex:function(index){var prevIndex=index-1;if(prevIndex<0) prevIndex=this.data.length-1;return prevIndex;},pause:function(){if(this.interval) this.toggleSlideshow();return this;},play:function(){if(!this.interval) this.toggleSlideshow();return this;},toggleSlideshow:function(){if(this.interval){clearInterval(this.interval);this.interval=0;if(this.$controlsContainer){this.$controlsContainer.find('div.ss-controls a').removeClass().addClass('play').attr('title',this.settings.playLinkText).attr('href','#play').html(this.settings.playLinkText);}}else{this.ssAdvance();var gallery=this;this.interval=setInterval(function(){gallery.ssAdvance();},this.settings.delay);if(this.$controlsContainer){this.$controlsContainer.find('div.ss-controls a').removeClass().addClass('pause').attr('title',this.settings.pauseLinkText).attr('href','#pause').html(this.settings.pauseLinkText);}} return this;},ssAdvance:function(){var nextIndex=this.getNextIndex(this.currentIndex);var nextHash=this.data[nextIndex].hash;if(this.settings.enableHistory) location.href='#'+nextHash;else this.goto(nextIndex);return this;},goto:function(index){if(index<0)index=0;else if(index>=this.data.length)index=this.data.length-1;if(this.settings.onChange) this.settings.onChange(this.currentIndex,index);this.currentIndex=index;this.preloadRelocate(index);return this.refresh();},refresh:function(){var imageData=this.data[this.currentIndex];if(!imageData) return this;var isTransitioning=true;var gallery=this;var transitionOutCallback=function(){isTransitioning=false;if(gallery.$controlsContainer){gallery.$controlsContainer.find('div.nav-controls a.prev').attr('href','#'+gallery.data[gallery.getPrevIndex(gallery.currentIndex)].hash).end().find('div.nav-controls a.next').attr('href','#'+gallery.data[gallery.getNextIndex(gallery.currentIndex)].hash);} var imageData=gallery.data[gallery.currentIndex];if(gallery.$captionContainer){gallery.$captionContainer.empty().append(imageData.caption);} if(imageData.image){gallery.buildImage(imageData.image);}else{if(gallery.$loadingContainer){gallery.$loadingContainer.show();}}} if(this.settings.onTransitionOut){this.settings.onTransitionOut(transitionOutCallback);}else{this.$transitionContainers.hide();transitionOutCallback();} if(!imageData.image){var image=new Image();image.onload=function(){imageData.image=this;if(!isTransitioning){gallery.buildImage(imageData.image);}};image.alt=imageData.title;image.src=imageData.slideUrl;} this.relocatePreload=true;return this.syncThumbs();},buildImage:function(image){if(this.$imageContainer){this.$imageContainer.empty();var gallery=this;var nextIndex=this.getNextIndex(this.currentIndex);if(this.$loadingContainer){this.$loadingContainer.hide();} this.$imageContainer.append('').find('a').append(image).click(function(e){clickHandler(e,gallery,this);});} if(this.settings.onTransitionIn) this.settings.onTransitionIn();else this.$transitionContainers.show();return this;},syncThumbs:function(){if(this.$thumbsContainer){var page=Math.floor(this.currentIndex/this.settings.numThumbs);if(page!=this.currentPage){this.currentPage=page;this.updateThumbs();} var $thumbs=this.$thumbsContainer.find('ul.thumbs').children();$thumbs.filter('.selected').removeClass('selected');$thumbs.eq(this.currentIndex).addClass('selected');} return this;},updateThumbs:function(){var gallery=this;var transitionOutCallback=function(){gallery.rebuildThumbs();if(gallery.settings.onPageTransitionIn) gallery.settings.onPageTransitionIn();else gallery.$thumbsContainer.show();};if(this.settings.onPageTransitionOut){this.settings.onPageTransitionOut(transitionOutCallback);}else{this.$thumbsContainer.hide();transitionOutCallback();} return this;},rebuildThumbs:function(){if(this.currentPage<0) this.currentPage=0;var needsPagination=this.data.length>this.settings.numThumbs;var $topPager=this.$thumbsContainer.find('div.top');if($topPager.length==0) $topPager=this.$thumbsContainer.prepend('').find('div.top');if(needsPagination&&this.settings.enableTopPager){$topPager.empty();this.buildPager($topPager);} if(needsPagination&&this.settings.enableBottomPager){var $bottomPager=this.$thumbsContainer.find('div.bottom');if($bottomPager.length==0) $bottomPager=this.$thumbsContainer.append('').find('div.bottom');else $bottomPager.empty();this.buildPager($bottomPager);} var startIndex=this.currentPage*this.settings.numThumbs;var stopIndex=startIndex+this.settings.numThumbs-1;if(stopIndex>=this.data.length) stopIndex=this.data.length-1;var $thumbsUl=this.$thumbsContainer.find('ul.thumbs');$thumbsUl.find('li').each(function(i){var $li=$(this);if(i>=startIndex&&i<=stopIndex){$li.show();}else{$li.hide();}});$thumbsUl.removeClass('noscript');return this;},buildPager:function(pager){var gallery=this;var startIndex=this.currentPage*this.settings.numThumbs;if(this.currentPage>0){var prevPage=startIndex-this.settings.numThumbs;pager.append(''+this.settings.prevPageLinkText+'');} for(i=this.currentPage-3;i<=this.currentPage+3;i++){var pageNum=i+1;if(i==this.currentPage) pager.append(''+pageNum+'');else if(i>=0&&i'+pageNum+'');}} var nextPage=startIndex+this.settings.numThumbs;if(nextPage'+this.settings.nextPageLinkText+'');} pager.find('a').click(function(e){clickHandler(e,gallery,this);});return this;}});this.settings=$.extend({},defaults,settings);if(this.interval) clearInterval(this.interval);this.interval=0;if(this.settings.imageContainerSel)this.$imageContainer=$(this.settings.imageContainerSel);if(this.settings.captionContainerSel)this.$captionContainer=$(this.settings.captionContainerSel);if(this.settings.loadingContainerSel)this.$loadingContainer=$(this.settings.loadingContainerSel);this.$transitionContainers=$([]);if(this.$imageContainer) this.$transitionContainers=this.$transitionContainers.add(this.$imageContainer);if(this.$captionContainer) this.$transitionContainers=this.$transitionContainers.add(this.$captionContainer);this.offset=galleryOffset;this.$thumbsContainer=$(thumbsContainerSel);this.initializeThumbs();registerGallery(this);this.numPages=Math.ceil(this.data.length/this.settings.numThumbs);this.currentPage=-1;this.currentIndex=0;var gallery=this;if(this.$loadingContainer) this.$loadingContainer.hide();if(this.settings.controlsContainerSel){this.$controlsContainer=$(this.settings.controlsContainerSel).empty();if(this.settings.renderSSControls){if(this.settings.autoStart){this.$controlsContainer.append('');}else{this.$controlsContainer.append('');} this.$controlsContainer.find('div.ss-controls a').click(function(e){gallery.toggleSlideshow();e.preventDefault();return false;});} if(this.settings.renderNavControls){var $navControls=this.$controlsContainer.append('').find('div.nav-controls a').click(function(e){clickHandler(e,gallery,this);});}} historyInit();var hash=getHash();var hashGallery=(hash>=0)?getGallery(hash):0;var gotoIndex=(hashGallery&&this==hashGallery)?(hash-this.offset):0;this.goto(gotoIndex);if(this.settings.autoStart){setTimeout(function(){gallery.play();},this.settings.delay);} setTimeout(function(){gallery.preloadInit();},1000);return this;};})(jQuery);/* Copyright (c) 2008 Kean Loong Tan http://www.gimiti.com/kltan * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) * jFlow * Version: 1.0 (May 13, 2008) * Requires: jQuery 1.2+ */ (function(A){A.fn.jFlow=function(D){var E=A.extend({},A.fn.jFlow.defaults,D);var F=0;var B=A(".jFlowControl").length;A(this).find(".jFlowControl").each(function(G){A(this).click(function(){A(".jFlowControl").removeClass("jFlowSelected");A(this).addClass("jFlowSelected");var H=Math.abs(F-G+1);A(E.slides).animate({marginLeft:"-"+(G*A(E.slides).find(":first-child").width()+"px")},E.duration*(H));F=G})});A(E.slides).before('
').appendTo("#jFlowSlide");A(E.slides).find("div").each(function(){A(this).before('
').appendTo(A(this).prev())});A(".jFlowControl").eq(F).addClass("jFlowSelected");var C=function(G){A("#jFlowSlide").css({position:"relative",width:E.width,height:E.height,overflow:"hidden"});A(E.slides).css({position:"relative",width:A("#jFlowSlide").width()*A(".jFlowControl").length+"px",height:A("#jFlowSlide").height()+"px",overflow:"hidden"});A(E.slides).children().css({position:"relative",width:A("#jFlowSlide").width()+"px",height:A("#jFlowSlide").height()+"px","float":"left"});A(E.slides).css({marginLeft:"-"+(F*A(E.slides).find(":first-child").width()+"px")})};C();A(window).resize(function(){C()});A(".jFlowPrev").click(function(){if(F>0){F--}else{F=B-1}A(".jFlowControl").removeClass("jFlowSelected");A(E.slides).animate({marginLeft:"-"+(F*A(E.slides).find(":first-child").width()+"px")},E.duration);A(".jFlowControl").eq(F).addClass("jFlowSelected")});A(".jFlowNext").click(function(){if(F0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return i.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);;/* * jQuery UI Datepicker 1.7.1 * * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI/Datepicker * * Depends: * ui.core.js */ (function($){$.extend($.ui,{datepicker:{version:"1.7.1"}});var PROP_NAME="datepicker";function Datepicker(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass="ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Vybrať",prevText:"Pred.",nextText:"Nasl.",currentText:"Dnes",monthNames:["Január","Február","Marec","Apríl","Máj","Jún","Júl","August","September","Október","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Nedeľa","Pondelok","Utorok","Streda","Štvrtok","Piatok","Sobota"],dayNamesShort:["Neď","Pon","Uto","Str","Štv","Pia","Sob"],dayNamesMin:["Ne","Po","Ut","St","Št","Pi","So"],dateFormat:"dd/mm/yy",firstDay:1,isRTL:false};this._defaults={showOn:"focus",showAnim:"show",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,showMonthAfterYear:false,yearRange:"-10:+10",showOtherMonths:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"normal",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false};$.extend(this._defaults,this.regional[""]);this.dpDiv=$('
')}$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",log:function(){if(this.debug){console.log.apply("",arguments)}},setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase();var inline=(nodeName=="div"||nodeName=="span");if(!target.id){target.id="dp"+(++this.uuid)}var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{});if(nodeName=="input"){this._connectDatepicker(target,inst)}else{if(inline){this._inlineDatepicker(target,inst)}}},_newInst:function(target,inline){var id=target[0].id.replace(/([:\[\]\.])/g,"\\\\$1");return{id:id,input:target,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:inline,dpDiv:(!inline?this.dpDiv:$('
'))}},_connectDatepicker:function(target,inst){var input=$(target);inst.trigger=$([]);if(input.hasClass(this.markerClassName)){return}var appendText=this._get(inst,"appendText");var isRTL=this._get(inst,"isRTL");if(appendText){input[isRTL?"before":"after"](''+appendText+"")}var showOn=this._get(inst,"showOn");if(showOn=="focus"||showOn=="both"){input.focus(this._showDatepicker)}if(showOn=="button"||showOn=="both"){var buttonText=this._get(inst,"buttonText");var buttonImage=this._get(inst,"buttonImage");inst.trigger=$(this._get(inst,"buttonImageOnly")?$("").addClass(this._triggerClass).attr({src:buttonImage,alt:buttonText,title:buttonText}):$('').addClass(this._triggerClass).html(buttonImage==""?buttonText:$("").attr({src:buttonImage,alt:buttonText,title:buttonText})));input[isRTL?"before":"after"](inst.trigger);inst.trigger.click(function(){if($.datepicker._datepickerShowing&&$.datepicker._lastInput==target){$.datepicker._hideDatepicker()}else{$.datepicker._showDatepicker(target)}return false})}input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst)},_inlineDatepicker:function(target,inst){var divSpan=$(target);if(divSpan.hasClass(this.markerClassName)){return}divSpan.addClass(this.markerClassName).append(inst.dpDiv).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst);this._setDate(inst,this._getDefaultDate(inst));this._updateDatepicker(inst);this._updateAlternate(inst)},_dialogDatepicker:function(input,dateText,onSelect,settings,pos){var inst=this._dialogInst;if(!inst){var id="dp"+(++this.uuid);this._dialogInput=$('');this._dialogInput.keydown(this._doKeyDown);$("body").append(this._dialogInput);inst=this._dialogInst=this._newInst(this._dialogInput,false);inst.settings={};$.data(this._dialogInput[0],PROP_NAME,inst)}extendRemove(inst.settings,settings||{});this._dialogInput.val(dateText);this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null);if(!this._pos){var browserWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var browserHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(browserWidth/2)-100+scrollX,(browserHeight/2)-150+scrollY]}this._dialogInput.css("left",this._pos[0]+"px").css("top",this._pos[1]+"px");inst.settings.onSelect=onSelect;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if($.blockUI){$.blockUI(this.dpDiv)}$.data(this._dialogInput[0],PROP_NAME,inst);return this},_destroyDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();$.removeData(target,PROP_NAME);if(nodeName=="input"){inst.trigger.remove();$target.siblings("."+this._appendClass).remove().end().removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress)}else{if(nodeName=="div"||nodeName=="span"){$target.removeClass(this.markerClassName).empty()}}},_enableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=false;inst.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().removeClass("ui-state-disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)})},_disableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=true;inst.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().addClass("ui-state-disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)});this._disabledInputs[this._disabledInputs.length]=target},_isDisabledDatepicker:function(target){if(!target){return false}for(var i=0;i-1)}},_showDatepicker:function(input){input=input.target||input;if(input.nodeName.toLowerCase()!="input"){input=$("input",input.parentNode)[0]}if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput==input){return}var inst=$.datepicker._getInst(input);var beforeShow=$.datepicker._get(inst,"beforeShow");extendRemove(inst.settings,(beforeShow?beforeShow.apply(input,[input,inst]):{}));$.datepicker._hideDatepicker(null,"");$.datepicker._lastInput=input;$.datepicker._setDateFromField(inst);if($.datepicker._inDialog){input.value=""}if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(input);$.datepicker._pos[1]+=input.offsetHeight}var isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css("position")=="fixed";return !isFixed});if(isFixed&&$.browser.opera){$.datepicker._pos[0]-=document.documentElement.scrollLeft;$.datepicker._pos[1]-=document.documentElement.scrollTop}var offset={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null;inst.rangeStart=null;inst.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});$.datepicker._updateDatepicker(inst);offset=$.datepicker._checkOffset(inst,offset,isFixed);inst.dpDiv.css({position:($.datepicker._inDialog&&$.blockUI?"static":(isFixed?"fixed":"absolute")),display:"none",left:offset.left+"px",top:offset.top+"px"});if(!inst.inline){var showAnim=$.datepicker._get(inst,"showAnim")||"show";var duration=$.datepicker._get(inst,"duration");var postProcess=function(){$.datepicker._datepickerShowing=true;if($.browser.msie&&parseInt($.browser.version,10)<7){$("iframe.ui-datepicker-cover").css({width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4})}};if($.effects&&$.effects[showAnim]){inst.dpDiv.show(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[showAnim](duration,postProcess)}if(duration==""){postProcess()}if(inst.input[0].type!="hidden"){inst.input[0].focus()}$.datepicker._curInst=inst}},_updateDatepicker:function(inst){var dims={width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4};var self=this;inst.dpDiv.empty().append(this._generateHTML(inst)).find("iframe.ui-datepicker-cover").css({width:dims.width,height:dims.height}).end().find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){$(this).removeClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).removeClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).removeClass("ui-datepicker-next-hover")}}).bind("mouseover",function(){if(!self._isDisabledDatepicker(inst.inline?inst.dpDiv.parent()[0]:inst.input[0])){$(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");$(this).addClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).addClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).addClass("ui-datepicker-next-hover")}}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();var numMonths=this._getNumberOfMonths(inst);var cols=numMonths[1];var width=17;if(cols>1){inst.dpDiv.addClass("ui-datepicker-multi-"+cols).css("width",(width*cols)+"em")}else{inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("")}inst.dpDiv[(numMonths[0]!=1||numMonths[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");inst.dpDiv[(this._get(inst,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");if(inst.input&&inst.input[0].type!="hidden"&&inst==$.datepicker._curInst){$(inst.input[0]).focus()}},_checkOffset:function(inst,offset,isFixed){var dpWidth=inst.dpDiv.outerWidth();var dpHeight=inst.dpDiv.outerHeight();var inputWidth=inst.input?inst.input.outerWidth():0;var inputHeight=inst.input?inst.input.outerHeight():0;var viewWidth=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)+$(document).scrollLeft();var viewHeight=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)+$(document).scrollTop();offset.left-=(this._get(inst,"isRTL")?(dpWidth-inputWidth):0);offset.left-=(isFixed&&offset.left==inst.input.offset().left)?$(document).scrollLeft():0;offset.top-=(isFixed&&offset.top==(inst.input.offset().top+inputHeight))?$(document).scrollTop():0;offset.left-=(offset.left+dpWidth>viewWidth&&viewWidth>dpWidth)?Math.abs(offset.left+dpWidth-viewWidth):0;offset.top-=(offset.top+dpHeight>viewHeight&&viewHeight>dpHeight)?Math.abs(offset.top+dpHeight+inputHeight*2-viewHeight):0;return offset},_findPos:function(obj){while(obj&&(obj.type=="hidden"||obj.nodeType!=1)){obj=obj.nextSibling}var position=$(obj).offset();return[position.left,position.top]},_hideDatepicker:function(input,duration){var inst=this._curInst;if(!inst||(input&&inst!=$.data(input,PROP_NAME))){return}if(inst.stayOpen){this._selectDate("#"+inst.id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear))}inst.stayOpen=false;if(this._datepickerShowing){duration=(duration!=null?duration:this._get(inst,"duration"));var showAnim=this._get(inst,"showAnim");var postProcess=function(){$.datepicker._tidyDialog(inst)};if(duration!=""&&$.effects&&$.effects[showAnim]){inst.dpDiv.hide(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[(duration==""?"hide":(showAnim=="slideDown"?"slideUp":(showAnim=="fadeIn"?"fadeOut":"hide")))](duration,postProcess)}if(duration==""){this._tidyDialog(inst)}var onClose=this._get(inst,"onClose");if(onClose){onClose.apply((inst.input?inst.input[0]:null),[(inst.input?inst.input.val():""),inst])}this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if($.blockUI){$.unblockUI();$("body").append(this.dpDiv)}}this._inDialog=false}this._curInst=null},_tidyDialog:function(inst){inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(event){if(!$.datepicker._curInst){return}var $target=$(event.target);if(($target.parents("#"+$.datepicker._mainDivId).length==0)&&!$target.hasClass($.datepicker.markerClassName)&&!$target.hasClass($.datepicker._triggerClass)&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI)){$.datepicker._hideDatepicker(null,"")}},_adjustDate:function(id,offset,period){var target=$(id);var inst=this._getInst(target[0]);if(this._isDisabledDatepicker(target[0])){return}this._adjustInstDate(inst,offset+(period=="M"?this._get(inst,"showCurrentAtPos"):0),period);this._updateDatepicker(inst)},_gotoToday:function(id){var target=$(id);var inst=this._getInst(target[0]);if(this._get(inst,"gotoCurrent")&&inst.currentDay){inst.selectedDay=inst.currentDay;inst.drawMonth=inst.selectedMonth=inst.currentMonth;inst.drawYear=inst.selectedYear=inst.currentYear}else{var date=new Date();inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear()}this._notifyChange(inst);this._adjustDate(target)},_selectMonthYear:function(id,select,period){var target=$(id);var inst=this._getInst(target[0]);inst._selectingMonthYear=false;inst["selected"+(period=="M"?"Month":"Year")]=inst["draw"+(period=="M"?"Month":"Year")]=parseInt(select.options[select.selectedIndex].value,10);this._notifyChange(inst);this._adjustDate(target)},_clickMonthYear:function(id){var target=$(id);var inst=this._getInst(target[0]);if(inst.input&&inst._selectingMonthYear&&!$.browser.msie){inst.input[0].focus()}inst._selectingMonthYear=!inst._selectingMonthYear},_selectDay:function(id,month,year,td){var target=$(id);if($(td).hasClass(this._unselectableClass)||this._isDisabledDatepicker(target[0])){return}var inst=this._getInst(target[0]);inst.selectedDay=inst.currentDay=$("a",td).html();inst.selectedMonth=inst.currentMonth=month;inst.selectedYear=inst.currentYear=year;if(inst.stayOpen){inst.endDay=inst.endMonth=inst.endYear=null}this._selectDate(id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear));if(inst.stayOpen){inst.rangeStart=this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay));this._updateDatepicker(inst)}},_clearDate:function(id){var target=$(id);var inst=this._getInst(target[0]);inst.stayOpen=false;inst.endDay=inst.endMonth=inst.endYear=inst.rangeStart=null;this._selectDate(target,"")},_selectDate:function(id,dateStr){var target=$(id);var inst=this._getInst(target[0]);dateStr=(dateStr!=null?dateStr:this._formatDate(inst));if(inst.input){inst.input.val(dateStr)}this._updateAlternate(inst);var onSelect=this._get(inst,"onSelect");if(onSelect){onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst])}else{if(inst.input){inst.input.trigger("change")}}if(inst.inline){this._updateDatepicker(inst)}else{if(!inst.stayOpen){this._hideDatepicker(null,this._get(inst,"duration"));this._lastInput=inst.input[0];if(typeof(inst.input[0])!="object"){inst.input[0].focus()}this._lastInput=null}}},_updateAlternate:function(inst){var altField=this._get(inst,"altField");if(altField){var altFormat=this._get(inst,"altFormat")||this._get(inst,"dateFormat");var date=this._getDate(inst);dateStr=this.formatDate(altFormat,date,this._getFormatConfig(inst));$(altField).each(function(){$(this).val(dateStr)})}},noWeekends:function(date){var day=date.getDay();return[(day>0&&day<6),""]},iso8601Week:function(date){var checkDate=new Date(date.getFullYear(),date.getMonth(),date.getDate());var firstMon=new Date(checkDate.getFullYear(),1-1,4);var firstDay=firstMon.getDay()||7;firstMon.setDate(firstMon.getDate()+1-firstDay);if(firstDay<4&&checkDatenew Date(checkDate.getFullYear(),12-1,28)){firstDay=new Date(checkDate.getFullYear()+1,1-1,4).getDay()||7;if(firstDay>4&&(checkDate.getDay()||7)0&&iValue="0"&&value.charAt(iValue)<="9"){num=num*10+parseInt(value.charAt(iValue++),10);size--}if(size==origSize){throw"Missing number at position "+iValue}return num};var getName=function(match,shortNames,longNames){var names=(lookAhead(match)?longNames:shortNames);var size=0;for(var j=0;j0&&iValue-1){month=1;day=doy;do{var dim=this._getDaysInMonth(year,month-1);if(day<=dim){break}month++;day-=dim}while(true)}var date=this._daylightSavingAdjust(new Date(year,month-1,day));if(date.getFullYear()!=year||date.getMonth()+1!=month||date.getDate()!=day){throw"Invalid date"}return date},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TIMESTAMP:"@",W3C:"yy-mm-dd",formatDate:function(format,date,settings){if(!date){return""}var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var lookAhead=function(match){var matches=(iFormat+1=0;m--){doy+=this._getDaysInMonth(date.getFullYear(),m)}output+=formatNumber("o",doy,3);break;case"m":output+=formatNumber("m",date.getMonth()+1,2);break;case"M":output+=formatName("M",date.getMonth(),monthNamesShort,monthNames);break;case"y":output+=(lookAhead("y")?date.getFullYear():(date.getYear()%100<10?"0":"")+date.getYear()%100);break;case"@":output+=date.getTime();break;case"'":if(lookAhead("'")){output+="'"}else{literal=true}break;default:output+=format.charAt(iFormat)}}}}return output},_possibleChars:function(format){var chars="";var literal=false;for(var iFormat=0;iFormatmaxDate?maxDate:date);return date},_determineDate:function(date,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setDate(date.getDate()+offset);return date};var offsetString=function(offset,getDaysInMonth){var date=new Date();var year=date.getFullYear();var month=date.getMonth();var day=date.getDate();var pattern=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;var matches=pattern.exec(offset);while(matches){switch(matches[2]||"d"){case"d":case"D":day+=parseInt(matches[1],10);break;case"w":case"W":day+=parseInt(matches[1],10)*7;break;case"m":case"M":month+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break;case"y":case"Y":year+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break}matches=pattern.exec(offset)}return new Date(year,month,day)};date=(date==null?defaultDate:(typeof date=="string"?offsetString(date,this._getDaysInMonth):(typeof date=="number"?(isNaN(date)?defaultDate:offsetNumeric(date)):date)));date=(date&&date.toString()=="Invalid Date"?defaultDate:date);if(date){date.setHours(0);date.setMinutes(0);date.setSeconds(0);date.setMilliseconds(0)}return this._daylightSavingAdjust(date)},_daylightSavingAdjust:function(date){if(!date){return null}date.setHours(date.getHours()>12?date.getHours()+2:0);return date},_setDate:function(inst,date,endDate){var clear=!(date);var origMonth=inst.selectedMonth;var origYear=inst.selectedYear;date=this._determineDate(date,new Date());inst.selectedDay=inst.currentDay=date.getDate();inst.drawMonth=inst.selectedMonth=inst.currentMonth=date.getMonth();inst.drawYear=inst.selectedYear=inst.currentYear=date.getFullYear();if(origMonth!=inst.selectedMonth||origYear!=inst.selectedYear){this._notifyChange(inst)}this._adjustInstDate(inst);if(inst.input){inst.input.val(clear?"":this._formatDate(inst))}},_getDate:function(inst){var startDate=(!inst.currentYear||(inst.input&&inst.input.val()=="")?null:this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return startDate},_generateHTML:function(inst){var today=new Date();today=this._daylightSavingAdjust(new Date(today.getFullYear(),today.getMonth(),today.getDate()));var isRTL=this._get(inst,"isRTL");var showButtonPanel=this._get(inst,"showButtonPanel");var hideIfNoPrevNext=this._get(inst,"hideIfNoPrevNext");var navigationAsDateFormat=this._get(inst,"navigationAsDateFormat");var numMonths=this._getNumberOfMonths(inst);var showCurrentAtPos=this._get(inst,"showCurrentAtPos");var stepMonths=this._get(inst,"stepMonths");var stepBigMonths=this._get(inst,"stepBigMonths");var isMultiMonth=(numMonths[0]!=1||numMonths[1]!=1);var currentDate=this._daylightSavingAdjust((!inst.currentDay?new Date(9999,9,9):new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");var drawMonth=inst.drawMonth-showCurrentAtPos;var drawYear=inst.drawYear;if(drawMonth<0){drawMonth+=12;drawYear--}if(maxDate){var maxDraw=this._daylightSavingAdjust(new Date(maxDate.getFullYear(),maxDate.getMonth()-numMonths[1]+1,maxDate.getDate()));maxDraw=(minDate&&maxDrawmaxDraw){drawMonth--;if(drawMonth<0){drawMonth=11;drawYear--}}}inst.drawMonth=drawMonth;inst.drawYear=drawYear;var prevText=this._get(inst,"prevText");prevText=(!navigationAsDateFormat?prevText:this.formatDate(prevText,this._daylightSavingAdjust(new Date(drawYear,drawMonth-stepMonths,1)),this._getFormatConfig(inst)));var prev=(this._canAdjustMonth(inst,-1,drawYear,drawMonth)?''+prevText+"":(hideIfNoPrevNext?"":''+prevText+""));var nextText=this._get(inst,"nextText");nextText=(!navigationAsDateFormat?nextText:this.formatDate(nextText,this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepMonths,1)),this._getFormatConfig(inst)));var next=(this._canAdjustMonth(inst,+1,drawYear,drawMonth)?''+nextText+"":(hideIfNoPrevNext?"":''+nextText+""));var currentText=this._get(inst,"currentText");var gotoDate=(this._get(inst,"gotoCurrent")&&inst.currentDay?currentDate:today);currentText=(!navigationAsDateFormat?currentText:this.formatDate(currentText,gotoDate,this._getFormatConfig(inst)));var controls=(!inst.inline?'":"");var buttonPanel=(showButtonPanel)?'
'+(isRTL?controls:"")+(this._isInRange(inst,gotoDate)?'":"")+(isRTL?"":controls)+"
":"";var firstDay=parseInt(this._get(inst,"firstDay"),10);firstDay=(isNaN(firstDay)?0:firstDay);var dayNames=this._get(inst,"dayNames");var dayNamesShort=this._get(inst,"dayNamesShort");var dayNamesMin=this._get(inst,"dayNamesMin");var monthNames=this._get(inst,"monthNames");var monthNamesShort=this._get(inst,"monthNamesShort");var beforeShowDay=this._get(inst,"beforeShowDay");var showOtherMonths=this._get(inst,"showOtherMonths");var calculateWeek=this._get(inst,"calculateWeek")||this.iso8601Week;var endDate=inst.endDay?this._daylightSavingAdjust(new Date(inst.endYear,inst.endMonth,inst.endDay)):currentDate;var defaultDate=this._getDefaultDate(inst);var html="";for(var row=0;row'+(/all|left/.test(cornerClass)&&row==0?(isRTL?next:prev):"")+(/all|right/.test(cornerClass)&&row==0?(isRTL?prev:next):"")+this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,row>0||col>0,monthNames,monthNamesShort)+'
';var thead="";for(var dow=0;dow<7;dow++){var day=(dow+firstDay)%7;thead+="=5?' class="ui-datepicker-week-end"':"")+'>'+dayNamesMin[day]+""}calender+=thead+"";var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear==inst.selectedYear&&drawMonth==inst.selectedMonth){inst.selectedDay=Math.min(inst.selectedDay,daysInMonth)}var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var numRows=(isMultiMonth?6:Math.ceil((leadDays+daysInMonth)/7));var printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays));for(var dRow=0;dRow";var tbody="";for(var dow=0;dow<7;dow++){var daySettings=(beforeShowDay?beforeShowDay.apply((inst.input?inst.input[0]:null),[printDate]):[true,""]);var otherMonth=(printDate.getMonth()!=drawMonth);var unselectable=otherMonth||!daySettings[0]||(minDate&&printDatemaxDate);tbody+='";printDate.setDate(printDate.getDate()+1);printDate=this._daylightSavingAdjust(printDate)}calender+=tbody+""}drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++}calender+="
=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" "+this._currentClass:"")+(printDate.getTime()==today.getTime()?" ui-datepicker-today":""))+'"'+((!otherMonth||showOtherMonths)&&daySettings[2]?' title="'+daySettings[2]+'"':"")+(unselectable?"":" onclick=\"DP_jQuery.datepicker._selectDay('#"+inst.id+"',"+drawMonth+","+drawYear+', this);return false;"')+">"+(otherMonth?(showOtherMonths?printDate.getDate():" "):(unselectable?''+printDate.getDate()+"":'=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" ui-state-active":"")+'" href="#">'+printDate.getDate()+""))+"
"+(isMultiMonth?""+((numMonths[0]>0&&col==numMonths[1]-1)?'
':""):"");group+=calender}html+=group}html+=buttonPanel+($.browser.msie&&parseInt($.browser.version,10)<7&&!inst.inline?'':"");inst._keyEvent=false;return html},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,secondary,monthNames,monthNamesShort){minDate=(inst.rangeStart&&minDate&&selectedDate "}else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);monthHtml+='"}if(!showMonthAfterYear){html+=monthHtml+((secondary||changeMonth||changeYear)&&(!(changeMonth&&changeYear))?" ":"")}if(secondary||!changeYear){html+=''+drawYear+""}else{var years=this._get(inst,"yearRange").split(":");var year=0;var endYear=0;if(years.length!=2){year=drawYear-10;endYear=drawYear+10}else{if(years[0].charAt(0)=="+"||years[0].charAt(0)=="-"){year=drawYear+parseInt(years[0],10);endYear=drawYear+parseInt(years[1],10)}else{year=parseInt(years[0],10);endYear=parseInt(years[1],10)}}year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);html+='"}if(showMonthAfterYear){html+=(secondary||changeMonth||changeYear?" ":"")+monthHtml}html+="";return html},_adjustInstDate:function(inst,offset,period){var year=inst.drawYear+(period=="Y"?offset:0);var month=inst.drawMonth+(period=="M"?offset:0);var day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+(period=="D"?offset:0);var date=this._daylightSavingAdjust(new Date(year,month,day));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&datemaxDate?maxDate:date);inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();if(period=="M"||period=="Y"){this._notifyChange(inst)}},_notifyChange:function(inst){var onChange=this._get(inst,"onChangeMonthYear");if(onChange){onChange.apply((inst.input?inst.input[0]:null),[inst.selectedYear,inst.selectedMonth+1,inst])}},_getNumberOfMonths:function(inst){var numMonths=this._get(inst,"numberOfMonths");return(numMonths==null?[1,1]:(typeof numMonths=="number"?[1,numMonths]:numMonths))},_getMinMaxDate:function(inst,minMax,checkRange){var date=this._determineDate(this._get(inst,minMax+"Date"),null);return(!checkRange||!inst.rangeStart?date:(!date||inst.rangeStart>date?inst.rangeStart:date))},_getDaysInMonth:function(year,month){return 32-new Date(year,month,32).getDate()},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay()},_canAdjustMonth:function(inst,offset,curYear,curMonth){var numMonths=this._getNumberOfMonths(inst);var date=this._daylightSavingAdjust(new Date(curYear,curMonth+(offset<0?offset:numMonths[1]),1));if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()))}return this._isInRange(inst,date)},_isInRange:function(inst,date){var newMinDate=(!inst.rangeStart?null:this._daylightSavingAdjust(new Date(inst.selectedYear,inst.selectedMonth,inst.selectedDay)));newMinDate=(newMinDate&&inst.rangeStart=minDate)&&(!maxDate||date<=maxDate))},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,"shortYearCutoff");shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get(inst,"dayNamesShort"),dayNames:this._get(inst,"dayNames"),monthNamesShort:this._get(inst,"monthNamesShort"),monthNames:this._get(inst,"monthNames")}},_formatDate:function(inst,day,month,year){if(!day){inst.currentDay=inst.selectedDay;inst.currentMonth=inst.selectedMonth;inst.currentYear=inst.selectedYear}var date=(day?(typeof day=="object"?day:this._daylightSavingAdjust(new Date(year,month,day))):this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return this.formatDate(this._get(inst,"dateFormat"),date,this._getFormatConfig(inst))}});function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null||props[name]==undefined){target[name]=props[name]}}return target}function isArray(a){return(a&&(($.browser.safari&&typeof a=="object"&&a.length)||(a.constructor&&a.constructor.toString().match(/\Array\(\)/))))}$.fn.datepicker=function(options){if(!$.datepicker.initialized){$(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv);$.datepicker.initialized=true}var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=="string"&&(options=="isDisabled"||options=="getDate")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}return this.each(function(){typeof options=="string"?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options)})};$.datepicker=new Datepicker();$.datepicker.initialized=false;$.datepicker.uuid=new Date().getTime();$.datepicker.version="1.7.1";window.DP_jQuery=$})(jQuery);;/* * jQuery selectbox plugin * * Copyright (c) 2007 Sadri Sahraoui (brainfault.com) * Licensed under the GPL license and MIT: * http://www.opensource.org/licenses/GPL-license.php * http://www.opensource.org/licenses/mit-license.php * * The code is inspired from Autocomplete plugin (http://www.dyve.net/jquery/?autocomplete) * * Revision: $Id$ * Version: 0.6 * * Changelog : * Version 0.6 * - Fix IE scrolling problem * Version 0.5 * - separate css style for current selected element and hover element which solve the highlight issue * Version 0.4 * - Fix width when the select is in a hidden div @Pawel Maziarz * - Add a unique id for generated li to avoid conflict with other selects and empty values @Pawel Maziarz */ jQuery.fn.extend({ selectbox: function(options) { return this.each(function() { new jQuery.SelectBox(this, options); }); } }); /* pawel maziarz: work around for ie logging */ if (!window.console) { var console = { log: function(msg) { } } } /* */ jQuery.SelectBox = function(selectobj, options) { var opt = options || {}; opt.inputClass = opt.inputClass || "selectbox"; opt.containerClass = opt.containerClass || "selectbox-wrapper"; opt.hoverClass = opt.hoverClass || "current"; opt.currentClass = opt.selectedClass || "selected" opt.debug = opt.debug || false; var elm_id = selectobj.id; var active = 0; var inFocus = false; var hasfocus = 0; //jquery object for select element var $select = $(selectobj); // jquery container object var $container = setupContainer(opt); //jquery input object var $input = setupInput(opt); // hide select and append newly created elements $select.hide().before($input).before($container); init(); $input .click(function(){ if (!inFocus) { $container.toggle(); } }) .focus(function(){ if ($container.not(':visible')) { inFocus = true; $container.show(); } }) .keydown(function(event) { switch(event.keyCode) { case 38: // up event.preventDefault(); moveSelect(-1); break; case 40: // down event.preventDefault(); moveSelect(1); break; //case 9: // tab case 13: // return event.preventDefault(); // seems not working in mac ! $('li.'+opt.hoverClass).trigger('click'); break; case 27: //escape hideMe(); break; } }) .blur(function() { if ($container.is(':visible') && hasfocus > 0 ) { if(opt.debug) console.log('container visible and has focus') } else { // Workaround for ie scroll - thanks to Bernd Matzner if($.browser.msie || $.browser.safari){ // check for safari too - workaround for webkit if(document.activeElement.getAttribute('id').indexOf('_container')==-1){ hideMe(); } else { $input.focus(); } } else { hideMe(); } } }); function hideMe() { hasfocus = 0; $container.hide(); } function init() { $container.append(getSelectOptions($input.attr('id'))).hide(); var width = $input.css('width'); $container.width(width); } function setupContainer(options) { var container = document.createElement("div"); $container = $(container); $container.attr('id', elm_id+'_container'); $container.addClass(options.containerClass); return $container; } function moveSelect(step) { var lis = $("li", $container); if (!lis || lis.length == 0) return false; active += step; //loop through list if (active < 0) { active = lis.size(); } else if (active > lis.size()) { active = 0; } scroll(lis, active); lis.removeClass(opt.hoverClass); $(lis[active]).addClass(opt.hoverClass); } function scroll(list, active) { var el = $(list[active]).get(0); var list = $container.get(0); if (el.offsetTop + el.offsetHeight > list.scrollTop + list.clientHeight) { list.scrollTop = el.offsetTop + el.offsetHeight - list.clientHeight; } else if(el.offsetTop < list.scrollTop) { list.scrollTop = el.offsetTop; } } function setupInput(options) { var input = document.createElement("input"); var $input = $(input); $input.attr("id", elm_id+"_input"); $input.attr("type", "text"); $input.addClass(options.inputClass); $input.attr("autocomplete", "off"); $input.attr("readonly", "readonly"); $input.attr("tabIndex", $select.attr("tabindex")); // “I” capital is important for ie $input.attr("onchange", $select.attr("onchange")); // “I” capital is important for ie return $input; } function setCurrent() { var li = $("li."+opt.currentClass, $container).get(0); var ar = (''+li.id).split('_'); var el = ar[ar.length-1]; $select.val(el); $input.val($(li).html()); $("#"+$input.attr('id').substring(0, $input.attr('id').length-6)).trigger('onchange'); opt.params.selectedVal = $select.val(); opt.onChange(opt.params); return true; } // select value function getCurrentSelected() { return $select.val(); } // input value function getCurrentValue() { return $input.val(); } function getSelectOptions(parentid) { var select_options = new Array(); var ul = document.createElement('ul'); $select.children('option').each(function() { var li = document.createElement('li'); li.setAttribute('id', parentid + '_' + $(this).val()); li.innerHTML = $(this).html(); if ($(this).is(':selected')) { $input.val($(this).html()); $(li).addClass(opt.currentClass); } ul.appendChild(li); $(li) .mouseover(function(event) { hasfocus = 1; if (opt.debug) console.log('over on : '+this.id); jQuery(event.target, $container).addClass(opt.hoverClass); }) .mouseout(function(event) { hasfocus = -1; if (opt.debug) console.log('out on : '+this.id); jQuery(event.target, $container).removeClass(opt.hoverClass); }) .click(function(event) { var fl = $('li.'+opt.hoverClass, $container).get(0); if (opt.debug) console.log('click on :'+this.id); $('li.'+opt.currentClass).removeClass(opt.currentClass); $(this).addClass(opt.currentClass); setCurrent(); //$select.change(); $select.get(0).blur(); hideMe(); }); }); return ul; } }; /** * Stupid Fixed Header 1.0.3 - jQuery plugins to create a fixed headers * * Require: jQuery 1.2.6 * Author: Jacky See * Blog: http://jacky.seezone.net * email: jackysee at gmail dot com * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html */ (function($){ /* created fixed headers , require jquery dimenions plugins*/ $.fn.fixedHeader = function(o){ var s = {adjustWidth: $.fixedHeader.calcWidth}; if(o) $.extend(s,o); return this.each(function(){ var table = $(this); //table var tId = this.id; var scrollBarWidth = $.fixedHeader.getScrollBarWidth(); var IE6 = $.browser.msie && $.browser.version == '6.0'; var IE7 = $.browser.msie && $.browser.version == '7.0'; var IE = $.browser.msie; //wrap a body container var bodyContainer = table.wrap('
').parent() .attr('id', tId + "_body_container") .css({ width: s.width, height: s.height, overflow: 'auto' }); //Wrap with an overall container var tableContainer = bodyContainer.wrap('
').parent() .attr('id', tId + '_table_container') .css('position','relative'); //clone the header var position = table.position(); //HOMOLA var theadHeight = table.find('thead').outerHeight(); if (IE) { if (theadHeight == 58) theadHeight = 44; //document.getElementById('steps').innerHTML += ''; } var headerContainer = $(document.createElement('div')) .attr('id', tId + '_header_container') .css({ width: bodyContainer.innerWidth() - scrollBarWidth, height: theadHeight, overflow: 'hidden', top: position.top, left:position.left }) .prependTo(tableContainer); var headerTable = table.clone(true) .find('tbody').remove().end() .attr('id',tId + "_header") .addClass(s.tableClass || table[0].className) .css({ //width: $.browser.msie? table.outerWidth():table.width(), 'table-layout':'fixed', position:'absolute', top:0, left:0 }) .append(table.find('thead').clone(true)) .appendTo(headerContainer); //sync header width var headThs = headerTable.find('th'); table.find('th').each(function(i){ headThs.eq(i).css('width', s.adjustWidth(this)); }) //sync scroll var selects = IE6? table.find("select"): null; bodyContainer.scroll(function(){ if(IE6 && selects.size()>0){ selects.each(function(i){ this.style.visibility = ($(this).offset().top - bodyContainer.offset().top) <= table.find("thead").outerHeight() + 10 ? 'hidden':'visible'; }); } headerTable.css({ left: '-' + $(this).scrollLeft() + 'px' }); }) //Move it down headerContainer.css({ 'position': 'absolute', 'top': 0 }); }); } $.fixedHeader = { calcWidth: function(th){ var w = $(th).width(); var paddingLeft = $.fixedHeader.getComputedStyleInPx(th,'paddingLeft'); var paddingRight = $.fixedHeader.getComputedStyleInPx(th,'paddingRight'); var borderWidth = $.fixedHeader.getComputedStyleInPx(th,'borderRightWidth'); if($.browser.msie) w = w+borderWidth; if($.browser.opera) w = w+borderWidth; if($.browser.safari) w = w+paddingLeft+paddingRight+borderWidth*2; if($.browser.mozilla && parseFloat($.browser.version) <= 1.8) w=w+borderWidth; //FF2 still got a border-left missing problem, this is the best I can do. return w; }, getComputedStyleInPx: function(elem,style){ var computedStyle = (typeof elem.currentStyle != 'undefined') ?elem.currentStyle :document.defaultView.getComputedStyle(elem, null); var val = computedStyle[style]; val = val? parseInt(val.replace("px","")):0; return (!val || val == 'NaN')?0:val; }, getScrollBarWidth: function() { //calculate or get from global the scroll bar width if(!$.fixedHeader.scrollBarWidth){ var inner = $(document.createElement('p')).css({width:'100%',height:'100%'}); var outer = $(document.createElement('div')) .css({ position:'absolute', top: '0px', left: '0px', visibility: 'hidden', width: '200px', height: '150px', overflow: 'hidden' }) .append(inner) .appendTo(document.body); var w1 = inner[0].offsetWidth; outer[0].style.overflow = 'scroll'; var w2 = inner[0].offsetWidth; if (w1 == w2) w2 = outer[0].clientWidth; document.body.removeChild (outer[0]); $.fixedHeader.scrollBarWidth = (w1 - w2); } return $.fixedHeader.scrollBarWidth; } } })(jQuery); /** * jQuery lightBox plugin * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/) * and adapted to me for use like a plugin from jQuery. * @name jquery-lightbox-0.5.js * @author Leandro Vieira Pinho - http://leandrovieira.com * @version 0.5 * @date April 11, 2008 * @category jQuery plugin * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com) * @license CC Attribution-No Derivative Works 2.5 Brazil - http://creativecommons.org/licenses/by-nd/2.5/br/deed.en_US * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin */ (function($){$.fn.lightBox=function(settings){settings=jQuery.extend({overlayBgColor:'#000',overlayOpacity:0.8,fixedNavigation:false,imageLoading:'images/lightbox-ico-loading.gif',imageBtnPrev:'images/lightbox-btn-prev.gif',imageBtnNext:'images/lightbox-btn-next.gif',imageBtnClose:'images/lightbox-btn-close.gif',imageBlank:'images/lightbox-blank.gif',containerBorderSize:10,containerResizeSpeed:400,txtImage:'Image',txtOf:'of',keyToClose:'c',keyToPrev:'p',keyToNext:'n',imageArray:[],activeImage:0},settings);var jQueryMatchedObj=this;function _initialize(){_start(this,jQueryMatchedObj);return false;} function _start(objClicked,jQueryMatchedObj){$('embed, object, select').css({'visibility':'hidden'});_set_interface();settings.imageArray.length=0;settings.activeImage=0;if(jQueryMatchedObj.length==1){settings.imageArray.push(new Array(objClicked.getAttribute('href'),objClicked.getAttribute('title')));}else{for(var i=0;i
');var arrPageSizes=___getPageSize();$('#jquery-overlay').css({backgroundColor:settings.overlayBgColor,opacity:settings.overlayOpacity,width:arrPageSizes[0],height:arrPageSizes[1]}).fadeIn();var arrPageScroll=___getPageScroll();$('#jquery-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]}).show();$('#jquery-overlay,#jquery-lightbox').click(function(){_finish();});$('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function(){_finish();return false;});$(window).resize(function(){var arrPageSizes=___getPageSize();$('#jquery-overlay').css({width:arrPageSizes[0],height:arrPageSizes[1]});var arrPageScroll=___getPageScroll();$('#jquery-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]});});} function _set_image_to_view(){$('#lightbox-loading').show();if(settings.fixedNavigation){$('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();}else{$('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();} var objImagePreloader=new Image();objImagePreloader.onload=function(){$('#lightbox-image').attr('src',settings.imageArray[settings.activeImage][0]);_resize_container_image_box(objImagePreloader.width,objImagePreloader.height);objImagePreloader.onload=function(){};};objImagePreloader.src=settings.imageArray[settings.activeImage][0];};function _resize_container_image_box(intImageWidth,intImageHeight){var intCurrentWidth=$('#lightbox-container-image-box').width();var intCurrentHeight=$('#lightbox-container-image-box').height();var intWidth=(intImageWidth+(settings.containerBorderSize*2));var intHeight=(intImageHeight+(settings.containerBorderSize*2));var intDiffW=intCurrentWidth-intWidth;var intDiffH=intCurrentHeight-intHeight;$('#lightbox-container-image-box').animate({width:intWidth,height:intHeight},settings.containerResizeSpeed,function(){_show_image();});if((intDiffW==0)&&(intDiffH==0)){if($.browser.msie){___pause(250);}else{___pause(100);}} $('#lightbox-container-image-data-box').css({width:intImageWidth});$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({height:intImageHeight+(settings.containerBorderSize*2)});};function _show_image(){$('#lightbox-loading').hide();$('#lightbox-image').fadeIn(function(){_show_image_data();_set_navigation();});_preload_neighbor_images();};function _show_image_data(){$('#lightbox-container-image-data-box').slideDown('fast');$('#lightbox-image-details-caption').hide();if(settings.imageArray[settings.activeImage][1]){$('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show();} if(settings.imageArray.length>1){$('#lightbox-image-details-currentNumber').html(settings.txtImage+' '+(settings.activeImage+1)+' '+settings.txtOf+' '+settings.imageArray.length).show();}} function _set_navigation(){$('#lightbox-nav').show();$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({'background':'transparent url('+settings.imageBlank+') no-repeat'});if(settings.activeImage!=0){if(settings.fixedNavigation){$('#lightbox-nav-btnPrev').css({'background':'url('+settings.imageBtnPrev+') left 15% no-repeat'}).unbind().bind('click',function(){settings.activeImage=settings.activeImage-1;_set_image_to_view();return false;});}else{$('#lightbox-nav-btnPrev').unbind().hover(function(){$(this).css({'background':'url('+settings.imageBtnPrev+') left 15% no-repeat'});},function(){$(this).css({'background':'transparent url('+settings.imageBlank+') no-repeat'});}).show().bind('click',function(){settings.activeImage=settings.activeImage-1;_set_image_to_view();return false;});}} if(settings.activeImage!=(settings.imageArray.length-1)){if(settings.fixedNavigation){$('#lightbox-nav-btnNext').css({'background':'url('+settings.imageBtnNext+') right 15% no-repeat'}).unbind().bind('click',function(){settings.activeImage=settings.activeImage+1;_set_image_to_view();return false;});}else{$('#lightbox-nav-btnNext').unbind().hover(function(){$(this).css({'background':'url('+settings.imageBtnNext+') right 15% no-repeat'});},function(){$(this).css({'background':'transparent url('+settings.imageBlank+') no-repeat'});}).show().bind('click',function(){settings.activeImage=settings.activeImage+1;_set_image_to_view();return false;});}} _enable_keyboard_navigation();} function _enable_keyboard_navigation(){$(document).keydown(function(objEvent){_keyboard_action(objEvent);});} function _disable_keyboard_navigation(){$(document).unbind();} function _keyboard_action(objEvent){if(objEvent==null){keycode=event.keyCode;escapeKey=27;}else{keycode=objEvent.keyCode;escapeKey=objEvent.DOM_VK_ESCAPE;} key=String.fromCharCode(keycode).toLowerCase();if((key==settings.keyToClose)||(key=='x')||(keycode==escapeKey)){_finish();} if((key==settings.keyToPrev)||(keycode==37)){if(settings.activeImage!=0){settings.activeImage=settings.activeImage-1;_set_image_to_view();_disable_keyboard_navigation();}} if((key==settings.keyToNext)||(keycode==39)){if(settings.activeImage!=(settings.imageArray.length-1)){settings.activeImage=settings.activeImage+1;_set_image_to_view();_disable_keyboard_navigation();}}} function _preload_neighbor_images(){if((settings.imageArray.length-1)>settings.activeImage){objNext=new Image();objNext.src=settings.imageArray[settings.activeImage+1][0];} if(settings.activeImage>0){objPrev=new Image();objPrev.src=settings.imageArray[settings.activeImage-1][0];}} function _finish(){$('#jquery-lightbox').remove();$('#jquery-overlay').fadeOut(function(){$('#jquery-overlay').remove();});$('embed, object, select').css({'visibility':'visible'});} function ___getPageSize(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=window.innerWidth+window.scrollMaxX;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;} var windowWidth,windowHeight;if(self.innerHeight){if(document.documentElement.clientWidth){windowWidth=document.documentElement.clientWidth;}else{windowWidth=self.innerWidth;} windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;} if(yScroll MIT-style license. */ (function(w){var E=w(window),u,g,F=-1,o,x,D,v,y,L,s,n=!window.XMLHttpRequest,e=window.opera&&(document.compatMode=="CSS1Compat")&&(w.browser.version>=9.3),m=document.documentElement,l={},t=new Image(),J=new Image(),H,a,h,q,I,d,G,c,A,K;w(function(){w("body").append(w([H=w('
')[0],a=w('
')[0],G=w('
')[0]]).css("display","none"));h=w('
').appendTo(a).append(q=w('
').append([I=w('').click(B)[0],d=w('').click(f)[0]])[0])[0];c=w('
').appendTo(G).append([w('').add(H).click(C)[0],A=w('
')[0],K=w('
')[0],w('
')[0]])[0]});w.slimbox=function(O,N,M){u=w.extend({loop:false,overlayOpacity:0.8,overlayFadeDuration:400,resizeDuration:400,resizeEasing:"swing",initialWidth:250,initialHeight:250,imageFadeDuration:400,captionAnimationDuration:400,counterText:"Image {x} of {y}",closeKeys:[27,88,67],previousKeys:[37,80],nextKeys:[39,78]},M);if(typeof O=="string"){O=[[O,N]];N=0}y=E.scrollTop()+((e?m.clientHeight:E.height())/2);L=u.initialWidth;s=u.initialHeight;w(a).css({top:Math.max(0,y-(s/2)),width:L,height:s,marginLeft:-L/2}).show();v=n||(H.currentStyle&&(H.currentStyle.position!="fixed"));if(v){H.style.position="absolute"}w(H).css("opacity",u.overlayOpacity).fadeIn(u.overlayFadeDuration);z();k(1);g=O;u.loop=u.loop&&(g.length>1);return b(N)};w.fn.slimbox=function(M,P,O){P=P||function(Q){return[Q.href,Q.title]};O=O||function(){return true};var N=this;return N.unbind("click").click(function(){var S=this,U=0,T,Q=0,R;T=w.grep(N,function(W,V){return O.call(S,W,V)});for(R=T.length;Q=0)?C():(M(N,u.nextKeys)>=0)?f():(M(N,u.previousKeys)>=0)?B():false}function B(){return b(x)}function f(){return b(D)}function b(M){if(M>=0){F=M;o=g[F][0];x=(F||(u.loop?g.length:0))-1;D=((F+1)%g.length)||(u.loop?0:-1);r();a.className="lbLoading";l=new Image();l.onload=j;l.src=o}return false}function j(){a.className="";w(h).css({backgroundImage:"url("+o+")",visibility:"hidden",display:""});w(q).width(l.width);w([q,I,d]).height(l.height);w(A).html(g[F][1]||"");w(K).html((((g.length>1)&&u.counterText)||"").replace(/{x}/,F+1).replace(/{y}/,g.length));if(x>=0){t.src=g[x][0]}if(D>=0){J.src=g[D][0]}L=h.offsetWidth;s=h.offsetHeight;var M=Math.max(0,y-(s/2));if(a.offsetHeight!=s){w(a).animate({height:s,top:M},u.resizeDuration,u.resizeEasing)}if(a.offsetWidth!=L){w(a).animate({width:L,marginLeft:-L/2},u.resizeDuration,u.resizeEasing)}w(a).queue(function(){w(G).css({width:L,top:M+s,marginLeft:-L/2,visibility:"hidden",display:""});w(h).css({display:"none",visibility:"",opacity:""}).fadeIn(u.imageFadeDuration,i)})}function i(){if(x>=0){w(I).show()}if(D>=0){w(d).show()}w(c).css("marginTop",-c.offsetHeight).animate({marginTop:0},u.captionAnimationDuration);G.style.visibility=""}function r(){l.onload=null;l.src=t.src=J.src=o;w([a,h,c]).stop(true);w([I,d,h,G]).hide()}function C(){if(F>=0){r();F=x=D=-1;w(a).hide();w(H).stop().fadeOut(u.overlayFadeDuration,k)}return false}})(jQuery); // AUTOLOAD CODE BLOCK (MAY BE CHANGED OR REMOVED) if (!/android|iphone|ipod|series60|symbian|windows ce|blackberry/i.test(navigator.userAgent)) { jQuery(function($) { $("a[rel^='lightbox']").slimbox({/* Put custom options here */}, null, function(el) { return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel)); }); }); }var timer; $(document).ready(function(){ $("#placeLink").mouseover(function(){ $("#placeMenu").slideDown("slow"); }); $("#placeLink").mouseout(function(){ $("#placeMenu").hide("slow"); }); $("#countriesPath").mouseover(function(){ clearTimeout(timer); hidePathMenus(1); $("#countriesMenu").slideDown("slow"); }); $("#countriesPath").mouseout(function(){ timer = setTimeout('$("#countriesMenu").hide("slow")',1000); }); $("#placesPath").mouseover(function(){ clearTimeout(timer); hidePathMenus(2); $("#placesMenu").slideDown("slow"); }); $("#placesPath").mouseout(function(){ timer = setTimeout('$("#placesMenu").hide("slow")',1000); }); $("#locationsPath").mouseover(function(){ clearTimeout(timer); hidePathMenus(3); $("#locationsMenu").slideDown("slow"); }); $("#locationsPath").mouseout(function(){ timer = setTimeout('$("#locationsMenu").hide("slow")',1000); }); $("#hotelsPath").mouseover(function(){ clearTimeout(timer); hidePathMenus(4); $("#hotelsMenu").slideDown("slow"); }); $("#hotelsPath").mouseout(function(){ timer = setTimeout('$("#hotelsMenu").hide("slow")',1000); }); $("#navigation").mouseover(function(){ clearTimeout(timer); hidePathMenus(0); $("#continentsMenu").slideDown("slow"); }); $("#navigation").mouseout(function(){ timer = setTimeout('$("#continentsMenu").hide("slow")',1000); }); $("#order_top_menu").jFlow({ slides: "#slides", controller: ".jFlowControl", // must be class, use . sign slideWrapper : "#jFlowSlide", // must be id, use # sign selectedWrapper: "jFlowSelected", // just pure text, no sign auto: true, //auto change slide, default true width: "610px", height: "468px", duration: 400, prev: ".jFlowPrev", // must be class, use . sign next: ".jFlowNext" // must be class, use . sign }); $("#rozsirene a").click(function(){ if ($("#expandSearchContent").is(":hidden")) { $("#expandSearchContent").slideDown("slow"); //document.getElementById('rozsirene').innerHTML = document.getElementById('rozsireneDown').innerHTML; } else { $("#expandSearchContent").hide("slow"); } return false; }); $("#pocasie").click(function(){ var ajax_load = "loading..."; point = map.getCenter(); $("#pocasie_result").slideDown("slow"); $("#pocasie_result") .html(ajax_load) .load("index.php?id=57&tx_rtcestovka_pi1[lat]="+point['y']+"&tx_rtcestovka_pi1[lon]="+point['x'], null, function(responseText){ }); marker = new GMarker(point, { icon: weatherIcon }); map.addOverlay(marker); }); $("#showHiddenCountries").click(function(){ if ($("#destinations2").is(":hidden")) { $("#destinations2").slideDown("slow"); } else { $("#destinations2").hide("slow"); } return false; }); try { $(".firsttermin").fixedHeader({width:600, height:440});} catch(err) {} try { $(".datepicker").datepicker({ altFormat: '@' });} catch(err) {} try { $("#tx_frontendformslib__data__tx_rtcestovka_lastminute__terminstart_dt").datepicker({ altFormat: '@' });} catch(err) {} try { $("#tx_frontendformslib__data__tx_rtcestovka_lastminute__terminexit_dt").datepicker({ altFormat: '@' });} catch(err) {} // opt.onChange = opt.onChange || false; // opt.params = opt.params || false; initMap(); if (document.getElementById('fbIframe')) document.getElementById('fbIframe').src = "http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fhome.php%23!%2Fpages%2FSvet-dovoleniek%2F116058885080729&width=300&colorscheme=light&show_faces=true&border_color&stream=false&header=false&height=262"; // document.getElementById('fbIframe').src = "http://www.facebook.com/plugins/likebox.php?id=116058885080729&width=300&height=262&colorscheme=light&show_faces=true&stream=false&header=true"; if (document.getElementById('firsttermin_body_container')) document.getElementById('firsttermin_body_container').scrollTop= oldRows*24; FB.XFBML.parse(); }); function callbackFunction(obj) { alert(obj.selectedVal + ', ' + obj.action + ', ' + obj.another); } //globalne premenne aby som si ich mohol pozerat cez firebug var terminRow; var terminCol; var posComb = new Array(); var sum = new Array; var priceB = new Array(); // index je age_to obsah je suma var priceC = new Array(); // index je 0adult 1kid 2kid2 var host; var maxStep = 0; var slideShowId; //var currency = "€" //var calculator_result="Orientačná cena"; var prices; function hidePathMenus(id){ if (id != 0) $("#continentsMenu").hide("slow"); if (id != 1) $("#countriesMenu").hide("slow"); if (id != 2) $("#placesMenu").hide("slow"); if (id != 3) $("#locationsMenu").hide("slow"); if (id != 4) $("#hotelsMenu").hide("slow"); } function add2compare(hotelId){ // $(".add2compare").click(function(){ document.getElementById("add2compare_"+hotelId).style.display="none"; var ajax_load = "loading..."; $("#add2compareAjax") .html(ajax_load) .load("index.php?id=57&tx_rtcestovka_pi1[add2compare]="+hotelId +"&tx_rtcestovka_pi1[add2compareAjax]=1", null, function(responseText){ // $.getScript("index.php?id=57&tx_rtcestovka_pi1[add2compare]="+hotelId +"&tx_rtcestovka_pi1[add2compareAjax]=1", function(){ // $("#add2compareAjax").html(""); // }); //alert("Response:\n" + responseText); //alert($("#add2compareAjax").innerHTML); //alert(responseText); document.getElementById("hotels2compare").innerHTML += responseText; //$("#add2compareAjax").innerHTML; document.getElementById("add2compareAjax").innerHTML = ""; $("#sidebar_compare").slideDown("slow"); }); // alert($("#add2compareAjax").innerHTML); // $("#hotels2compare").innerHTML += responseText; // $("#add2compareAjax").innerHTML = ""; // }); } function remove2compare(hotelId){ //$("#compare_hotel_"+hotelId).remove(); var ajax_load = "loading..."; $("#compare_hotel_"+hotelId) .html(ajax_load) .load("index.php?id=57&tx_rtcestovka_pi1[remove2compare]="+hotelId, null, function(responseText){ $("#compare_hotel_"+hotelId).remove(); var hotels2compareDiv = document.getElementById("hotels2compare").innerHTML; hotels2compareDiv = hotels2compareDiv.replace(/^\s*|\s*$/g,''); if(!hotels2compareDiv) { $("#sidebar_compare").hide("slow");; } }); // setCookie("compare["+hotelId+"]",'',-1000);//"/runitour/","localhost" } function setCookie(name, value, expires, path, domain, secure){ document.cookie = name + "=" + escape(value) + "; "; if(expires){ expires = setExpiration(expires); document.cookie += "expires=" + expires + "; "; } if(path){ document.cookie += "path=" + path + "; "; } if(domain){ document.cookie += "domain=" + domain + "; "; } if(secure){ document.cookie += "secure; "; } } function setExpiration(cookieLife){ var today = new Date(); var expr = new Date(today.getTime() + cookieLife * 24 * 60 * 60 * 1000); return expr.toGMTString(); } function getNum2Compare() { var allcookies = document.cookie; cookiearray = allcookies.split(';'); toCompare=0; for(var i=0; i'+pricesArray[i][1]+' '+currency+''; output += ' x  = '; if (!defaultPrice && pricesArray[i][2]) defaultPrice = i; } } output+=''+calculator_result+':'; document.getElementById('price_calculator').innerHTML = output; if (pricesArray[defaultPrice][0].indexOf('1/1')>0) defaultPrice++; if (defaultPrice) document.getElementById('calculator_price_'+defaultPrice).value=(pricesArray[defaultPrice][0].indexOf('partm')>0?1:2); recalculatePrice(); } function recalculatePrice(){ i=1; priceResult = 0; while (document.getElementById('calculator_price_'+i)){ priceX = document.getElementById('calculator_price_'+i).value; subresult = priceX*prices[i][1]; document.getElementById('sub_price'+i).innerHTML = subresult+' '+currency; priceResult += subresult; i++; } document.getElementById('calculator_price_result').innerHTML = priceResult+' '+currency; } function step2(terminId) { maxStep = 2; step(2); getAjax(host+"/index.php?id=6&no-cache=1&tx_rtcestovka_pi1[hotel]="+hotelID+"&tx_rtcestovka_pi1[AJAX]=1&tx_rtcestovka_pi1[termin]="+terminId+"&L="+langId,2); } function checkOrderForm() { var name = document.shortOrder.name; var email = document.shortOrder.email; var phone = document.shortOrder.phone; var adults = document.shortOrder.adults; var agree = document.shortOrder.agree; if (name.value == "") { if (enterName) window.alert(enterName); else window.alert("Prosím, zadajte Vaše meno."); name.focus(); return false; } if (email.value == "") { if (enterEmail) window.alert(enterEmail); else window.alert("Prosím, zadajte Váš email."); email.focus(); return false; } if (email.value.indexOf("@", 0) < 0) { if (enterRightEmail) window.alert(enterRightEmail); else window.alert("Prosím, zadajte správnu emailovú adresu."); email.focus(); return false; } if (email.value.indexOf(".", 0) < 0) { if (enterRightEmail) window.alert(enterRightEmail); else window.alert("Prosím, zadajte správnu emailovú adresu."); email.focus(); return false; } if (email.value.indexOf(".", 0) == email.value.length-1) { if (enterRightEmail) window.alert(enterRightEmail); else window.alert("Prosím, zadajte správnu emailovú adresu."); email.focus(); return false; } if (phone.value == "") { if (enterTel) window.alert(enterTel); else window.alert("Prosím, zadajte Vaše telefónne číslo."); phone.focus(); return false; } if (adults.value == "") { if (enterAdults) window.alert(enterAdults); else window.alert("Prosím, zadajte počet dospelých osôb."); adults.focus(); return false; } if (agree.checked == "") { if (enterTradeCond) window.alert(enterTradeCond); else window.alert("Musíte súhlasiť s obchodnými podmienkami."); return false; } return true; } function ceckOrderForm(){ var reason = ""; reason += validateEmail(theForm.name); reason += validateEmpty(theForm.mail); reason += validateEmpty(theForm.phone); reason += validateEmpty(theForm.adults); if (reason != "") { alert("Chyba:\n" + reason); return false; } return true; } function validateEmpty(fld) { var error = ""; if (fld.value.length == 0) { fld.style.background = 'Yellow'; error = "Musíte vyplniť povinné polia.\n" } else { fld.style.background = 'White'; } return error; } function trim(s) { return s.replace(/^\s+|\s+$/, ''); } function validateEmail(fld) { var error=""; var tfld = trim(fld.value); // value of field with whitespace trimmed off var emailFilter = /^[^@]+@[^@.]+\.[^@]*\w\w$/ ; var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/ ; if (fld.value == "") { fld.style.background = 'Yellow'; error = "Zadajte prosím emailovú adresu.\n"; } else if (!emailFilter.test(tfld)) { //test email for illegal characters fld.style.background = 'Yellow'; error = "Skontrolujte prosím zadanú emailovú adresu.\n"; } else if (fld.value.match(illegalChars)) { fld.style.background = 'Yellow'; error = "Emailová adresa obsahuje nepovolené znaky.\n"; } else { fld.style.background = 'White'; } return error; } var combo; function echo(msg){ return; if (msg=="reset") document.getElementById('messages').innerHTML =""; else document.getElementById('messages').innerHTML +="
"+msg; } function smallRoom() { echo('Nevojdete sa do Vami zvolenej izby'); // document.getElementById('to2ndStep').disabled = 1; } //vrati najmensi a najvacsi pocet osob danej urovne adult/kid/kid2 function minMaxPers(per){ ret=new Array(100,0); for (i in ret) { if (per[i]ret[1]) ret[1] = per[i]; } return ret; } //do globalneho pola posComb vlozi vsetky mozne kombinacie ako sa zvoleny pocet a typ ludi vojde do cennika //per[0] = adult; per[1]=kid; per[2]=kid2 function transformBeds(combo,per){ // if (typeof(combo[per[0]]) == "undefined" || typeof(combo[per[0]][per[1]]) == "undefined" || typeof(combo[per[0]][per[1]][per[2]]) == "undefined" ) { // echo( per[0]); per[0] *=1;per[1] *=1;per[2] *=1; if (typeof(combo[per[0]]) != "undefined") if (typeof(combo[per[0]][per[1]]) != "undefined") if(typeof(combo[per[0]][per[1]][per[2]]) != "undefined") { //dobra kombinacia // echo("n"+per); ok = 1; okx = 0; for (i in posComb){ // echo("g"+i+"|"+per[0]+"|"+per[1]+"|"+per[2]); // echo(posComb[i][per[0]]); if(typeof(posComb[i][0]) != "undefined" && posComb[i][0]==per[0]){ // echo("c0"); // okx = 1; if(typeof(posComb[i][1]) != "undefined" && posComb[i][1]==per[1]) { // echo("c1"); // okx = 1; if(typeof(posComb[i][2]) != "undefined" && posComb[i][2]==per[2]) { // echo("c2"); okx = 1; // echo('naslo'); }}} if (okx ==1) ok = 0; okx=0; } if (ok || posComb.length==0) { // echo("p"+per); posComb[posComb.length]=per; } } mmPer = minMaxPers(combo); if (mmPer[0] > per[0] && per[1] > 0) { transformBeds(combo,Array(per[0]+1,per[1]-1,per[2])) } if (per[2] > 0) { transformBeds(combo,Array(per[0],per[1]+1,per[2]-1)) } return; } function accomComb(){ echo("reset"); posComb = new Array(); accoms = booking_unit_layout.split(","); combo = new Array(); maxA = 0; minA = 999999; for (k in accoms){ //kombinacie pre dabu izbu a=0;c=0;i=0;x=0; chars=""; chars = accoms[k].split(""); for (j in chars) { //pismenka v danej kombinacii if (chars[j]=="A") a++; if (chars[j]=="C") c++; if (chars[j]=="I") i++; if (chars[j]=="X") x++; } a+=x; if ( typeof(combo[a]) == "undefined" ) combo[a] = new Array(); if ( typeof(combo[a][c]) == "undefined" ) combo[a][c] = new Array; combo[a][c][i] = 1; if (maxAa) minA=a; //echo(a+" "+c+" "+i+" "+combo[a][c][i]); } var adult = document.getElementById('adult').value*1; var kid = document.getElementById('kid').value*1; var kid2 = document.getElementById('kid2').value*1; var personNum = adult+kid+kid2; //echo("------
"+adult+" "+kid+" "+kid2); //echo (adult +" "+ maxA +" "+ personNum +" "+ combo.length); /* if ((adult > maxA || personNum > combo.length)) { //nevojdu sa do izby smallRoom(); alert("Nevojdete sa do izby."); return; }*/ persons = new Array(adult,kid,kid2); transformBeds(combo,persons,persons); //napln izbu tak aby to bola moznost podla cennika echo(posComb); // posComb je pole vysledkov podla cenika prices = ""; prices=calculPrice(); //alert(prices); // alert((adult+kid+kid2)+" "+ maxA+" "+(adult+kid+kid2 > maxA) ); if (perApartman) { if(adult+kid > maxA) { document.getElementById('price').innerHTML = "Nevojdete sa do izby."; // document.getElementById('to2ndStep').disabled = 1; return; } minPrice = calculPrice()*1; minPrice += calculPriplatky(adult+kid+kid2)*1; document.getElementById('price').innerHTML= minPrice; return; } else if (posComb=="") { //wrongComb(); message = 0; if (adult+kid+kid2 > maxA) message = "Nevojdete sa do izby."; if (adult+kid+kid2 < minA) message = "Nenaplnili ste izbu"; if (message) document.getElementById('price').innerHTML = message; // document.getElementById('to2ndStep').disabled = 1; return; } else { // document.getElementById('to2ndStep').disabled = 0; } minPrice = 999999999; for (i in prices) { if (minPrice > prices[i][3]) minPrice = prices[i][3] } minPrice +=calculPriplatky(adult+kid+kid2)*1; document.getElementById('price').innerHTML= minPrice; return false; } function calculPriplatky (persons) { sumPrip = 0*1; for (i in priplatok) { if (document.getElementById('prip'+i).checked) { if (priplatok[i]['perPers']) sumPrip += persons * priplatok[i]['price']; else sumPrip += priplatok[i]['price']; } } return sumPrip; } //vrati 2 rozmerne pole, sum[i][3] je vysledna suma pre danu kombinaciu function calculPrice() { priceB = new Array(); priceC = new Array(); priceA = pricesP; // cele pole priplatky echo(priceA); for(i in priceA) { echo(priceA[i]['price_description']); if(priceA[i]['price_type'] == 'zakladni' && !priceB[priceA[i]['age_limit_to']]) { priceB[priceA[i]['age_limit_to']] = priceA[i]['unit_price_currency']; echo(priceA[i]['age_limit_to']+" "+priceA[i]['unit_price_currency']); } } // priceB.sort(); // priceB.reverse(); //priceC[0] = dospely //priceC[1] = dieta1 //priceC[2] = deta2 //priceC[-1] = dospely pristelka for (i in priceB){ if(i==99) { if (isNaN(priceC[0])) //dospely priceC[0] = priceB[i]; else { //dospely uz je dospel1 = priceC[0]; priceC[0] = max(priceC[0],priceB[i]); // if () } } else { if(typeof(priceC[1])=='undefined') priceC[1] = priceB[i]; else { if (priceC[1] < priceB[i]) { priceC[2] = priceC[1]; priceC[1] = priceB[i]; } else priceC[2] = priceB[i]; } } } for (i in posComb){ sum[i]= new Array(); sum[i][0]=posComb[i][0]*priceC[0]; sum[i][1]=posComb[i][1]*priceC[1]; sum[i][2]=posComb[i][2]*priceC[2]; if (isNaN(sum[i][1])) sum[i][1]=0; if (isNaN(sum[i][2])) sum[i][2]=0; sum[i][3]=sum[i][0]+sum[i][1]+sum[i][2]; echo(sum[i]); } if (perApartman) return priceC[0]; else return sum; } // posklada najkratsie retazce booking_unit_layout pre vybrany pocet cestujucich // comb = vysledne pole, buddyNum zvoleny pocet turistov,char znak pre dany typ turistu /*function buildUnitLayou(comb,turistNum,char) { for (i=0;i'+ 'Priezvisko: '+ 'Dátum narodenia (dd/mm/yyyy):
'; } if (select=='adult') title = 'Dospelí'; if (select=='kid') title = 'Deti do '+child_age_limit+' rokov.'; if (select=='kid2') title = 'Deti do '+child2_age_limit+' rokov.'; str = '
'+title+'
' + str; document.getElementById(place).innerHTML=str; } else { document.getElementById(place).innerHTML=str; } } function calculate(row,col){ //plati sa samostatne za osobu if (termins[row][col]['priplatky'][0]['price_per_booking_unit']=='za osobu'){ } //plati sa pausalne else { //treba dorobit kontrolu poctu ludi vs pocet miest - pravdepodobne booking_unit_layout //zaklad bude tvorit pausal, urcite medzi prvymi a prvy so statusom zakladni a vekom do 99 if ((termins[row][col]['priplatky'][0][price_type])&& (termins[row][col]['priplatky'][0][price_type]=='zakladni')&& (termins[row][col]['priplatky'][0][age_limit_to]=='99')) { var suma_vysledna = termins[row][col]['priplatky'][0]['unit_price_currency']; } else if((termins[row][col]['priplatky'][1][price_type])&& (termins[row][col]['priplatky'][1][price_type])=='zakladni') { var suma_vysledna = termins[row][col]['priplatky'][1]['unit_price_currency']; } else if((termins[row][col]['priplatky'][2][price_type])&& (termins[row][col]['priplatky'][2][price_type])=='zakladni') { var suma_vysledna = termins[row][col]['priplatky'][2]['unit_price_currency']; } /* plus pocet poisteni, zatial je to len checkbox - ten treba zmenit na selectbox, priblizny navrh nizsie.. pocet poli selectu sa zistuje podla poctu dospelych/deti/druhych deti a infantov.. tento check by sa mal robit asi pri kazdom onChange tych selectov na zmenu cestujucich. for (i in termins[row][col]['priplatky']){if (termins[row][col]['priplatky'][i][price_description]=='Komplexné poistenie Union') { var counter=0; var suma_za_poistenie=termins[row][col]['priplatky'][i]['unit_price_currency']; if (document.getElementByID("adult").value!='0') counter=counter+document.getElementById("adult").value if (document.getElementByID("kid").value!='0') counter=counter+document.getElementById("kid").value if (document.getElementByID("kid2").value!='0') counter=counter+document.getElementById("kid2").value if (document.getElementByID("infant").value!='0') counter=counter+document.getElementById("infant").value var str=''; str+='