/**
 * aheadWorks Co.
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the EULA
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://ecommerce.aheadworks.com/LICENSE-M1.txt
 *
 * @category AW
 * @package AW_Referafriend
 * @copyright Copyright (c) 2003-2009 aheadWorks Co. (http://www.aheadworks.com)
 * @license http://ecommerce.aheadworks.com/LICENSE-M1.txt
 */

var rafDetect = navigator.userAgent.toLowerCase();
var rafOS,rafBrowser,rafVersion,rafTotal,rafThestring;

function rafGetBrowserInfo() {
 if (rafCheckIt('konqueror')) {
 rafBrowser = "Konqueror";
 rafOS = "Linux";
 }
 else if (rafCheckIt('safari')) rafBrowser = "Safari"
 else if (rafCheckIt('omniweb')) rafBrowser = "OmniWeb"
 else if (rafCheckIt('opera')) rafBrowser = "Opera"
 else if (rafCheckIt('webtv')) rafBrowser = "WebTV";
 else if (rafCheckIt('icab')) rafBrowser = "iCab"
 else if (rafCheckIt('msie')) rafBrowser = "Internet Explorer"
 else if (!rafCheckIt('compatible')) {
 rafBrowser = "Netscape Navigator"
 rafVersion = rafDetect.charAt(8);
 }
 else rafBrowser = "An unknown browser";

 if (!rafVersion) rafVersion = rafDetect.charAt(place + rafThestring.length);

 if (!rafOS) {
 if (rafCheckIt('linux')) rafOS = "Linux";
 else if (rafCheckIt('x11')) rafOS = "Unix";
 else if (rafCheckIt('mac')) rafOS = "Mac"
 else if (rafCheckIt('win')) rafOS = "Windows"
 else rafOS = "an unknown operating system";
 }
}

function rafCheckIt(string) {
 place = rafDetect.indexOf(string) + 1;
 rafThestring = string;
 return place;
}

/*-----------------------------------------------------------------------------------------------*/

//Event.observe(window, 'load', rafInitialize, false);
Event.observe(window, 'load', rafGetBrowserInfo, false);
//Event.observe(window, 'unload', Event.unloadCache, false);

var Referafriend = Class.create();
Referafriend.prototype = {
 yPos : 0,
 xPos : 0,
 isLoaded : false,

 initialize: function(ctrl, url) {
 if (url){
 this.content = url;
 } else {
 this.content = ctrl.href;
 }
 ctrl.observe('click', function(event){this.activate();Event.stop(event);}.bind(this));
 $('referafriend').hide().observe('click', (function(event) {if (event.element().id == 'referafriend-cancel') this.deactivate(); }).bind(this));
 $('referafriend-overlay').hide().observe('click', (function(event) {if (event.element().id == 'referafriend-overlay') this.deactivate(); }).bind(this));
 $('referafriend').hide().observe('click', (function(event) {if (event.element().id == 'referafriend-close') this.deactivate(); }).bind(this));
 },
 
 activate: function(){
 if (rafBrowser == 'Internet Explorer'){
 this.getScroll();
 this.prepareIE('100%', 'hidden');
 this.setScroll(0,0);
 this.hideSelects('hidden');
 }
 this.displayReferafriend("block");
 },
 
 prepareIE: function(height, overflow){
 bod = document.getElementsByTagName('body')[0];
 bod.style.height = height;
 bod.style.overflow = overflow;
 
 htm = document.getElementsByTagName('html')[0];
 htm.style.height = height;
 htm.style.overflow = overflow; 
 },
 
 hideSelects: function(visibility){
 selects = document.getElementsByTagName('select');
 for(i = 0; i < selects.length; i++) {
 selects[i].style.visibility = visibility;
 }
 },
 
 getScroll: function(){
 if (self.pageYOffset) {
 this.yPos = self.pageYOffset;
 } else if (document.documentElement && document.documentElement.scrollTop){
 this.yPos = document.documentElement.scrollTop; 
 } else if (document.body) {
 this.yPos = document.body.scrollTop;
 }
 },
 
 setScroll: function(x, y){
 window.scrollTo(x, y); 
 },
 
 displayReferafriend: function(display){
 $('referafriend-overlay').style.display = display;
 $('referafriend').style.display = display;
 if(display != 'none') this.loadInfo();
 },
 
 loadInfo: function() {
 $('referafriend').className = "loading";
 var myAjax = new Ajax.Request(
 this.content,
 {method: 'post', parameters: "", onComplete: this.processInfo.bindAsEventListener(this)}
 );
 
 },
 
 processInfo: function(response){
 $('rafContent').update(response.responseText);
 $('referafriend').className = "done";
 this.isLoaded = true;
 this.actions();
 },
 
 actions: function(){
 rafActions = document.getElementsByClassName('rafAction');
 },
 
 deactivate: function(){
 //Element.remove($('rafContent'));
 
 if (rafBrowser == "Internet Explorer"){
 this.setScroll(0,this.yPos);
 this.prepareIE("auto", "auto");
 this.hideSelects("visible");
 }
 
 this.displayReferafriend("none");
 }
}

/*-----------------------------------------------------------------------------------------------*/


function addReferafriendMarkup() {
 bod = document.getElementsByTagName('body')[0];
 overlay = document.createElement('div');
 overlay.id = 'referafriend-overlay';
 raf = document.createElement('div');
 raf.id = 'referafriend';
 raf.className = 'loading';
 raf.innerHTML = '<div id="rafLoadMessage">' +
 '<p>Loading</p>' +
 '</div>';
 bod.appendChild(overlay);
 bod.appendChild(raf);
}

var ReferafriendForm = Class.create();
ReferafriendForm.prototype = {
 initialize: function(form){
 this.form = form;
 if ($(this.form)) {
 this.sendUrl = $(this.form).action;
 $(this.form).observe('submit', function(event){this.send();Event.stop(event);}.bind(this));
 }
 this.loadWaiting = false;
 this.validator = new Validation(this.form);
 this.onSuccess = this.success.bindAsEventListener(this);
 this.onComplete = this.resetLoadWaiting.bindAsEventListener(this);
 this.onFailure = this.resetLoadWaiting.bindAsEventListener(this);
 var container = $('invite-login-container');
 if (container && container.style.display == 'none'){
 this._disableEnableAll(container, true);
 }
 },

 send: function(){
 if(!this.validator.validate()) {
 return false;
 }
 this.setLoadWaiting(true);
 var request = new Ajax.Request(
 this.sendUrl,
 {
 method:'post',
 onComplete: this.onComplete,
 onSuccess: this.onSuccess,
 onFailure: this.onFailure,
 parameters: Form.serialize(this.form)
 }
 );
 },
 
 success: function(transport) {
 this.resetLoadWaiting();
 if (transport && transport.responseText){
 try{
 response = eval('(' + transport.responseText + ')');
 }
 catch (e) {
 response = {};
 }
 }
 if (response.error){
 if (response.error_type == 'no_login'){
 var container = $('invite-login-container');
 if (container){
 container.show();
 this._disableEnableAll(container, false);
 }
 }
 if ((typeof response.message) == 'string') {
 alert(response.message);
 } else {
 alert(response.message.join("\n"));
 }
 return false;
 }
 $('rafContent').update(transport.responseText);
 },

 _disableEnableAll: function(element, isDisabled) {
 var descendants = element.descendants();
 for (var k in descendants) {
 descendants[k].disabled = isDisabled;
 }
 element.disabled = isDisabled;
 },

 setLoadWaiting: function(isDisabled) {
 var container = $('invite-button-container');
 if (isDisabled){
 container.setStyle({opacity:.5});
 this._disableEnableAll(container, true);
 Element.show('invite-please-wait');
 this.loadWaiting = true;
 } else {
 container.setStyle({opacity:1});
 this._disableEnableAll(container, false);
 Element.hide('invite-please-wait');
 this.loadWaiting = false;
 }
 },
 
 resetLoadWaiting: function(transport){
 this.setLoadWaiting(false);
 }
}

function FFSuggest() {
 
 var pRequest;
 var pLayer;
 var pDebug = false;
 var pInstanceName = '';
 var pSearchURL = '';
 var pQueryParamName = '';
 var pFormname = '';
 var pLayerName = '';
 var pQueryInput;
 var pSuggest = new Array();
 var pLastQuery;
 var pCurrentSelection = 0;
 var submitted = false;

 var pSuggestQueryClass = 'suggestTextQuery';
 var pSuggestTypeClass = 'suggestTextType';
 var pSuggestAmountClass = 'suggestTextAmount';
 var pSuggestQueryTypedClass = 'suggestTextQueryTyped';
 var pSuggestFooterClass = 'suggestFooter';
 var pSuggestHeaderClass = 'suggestHeader';
 var pSuggestRowClass = 'suggestRow';
 var pSuggestHighlightClass = 'suggestHighlight';

 this.init = function(searchURL, formname, queryParamName, divLayername, instanceName, debugMode, channelParamName, channel) {
 pSearchURL = searchURL;
 pFormname = formname;
 pQueryParamName = queryParamName;
 pChannelParamName = channelParamName;
 pChannel = channel;
 pLayerName = divLayername;
 pInstanceName = instanceName;
 pDebug = debugMode;
 if (pSearchURL == '') { 
 if (pDebug) alert('no searchurl defined');
 return null;
 } else if (pInstanceName == '') {
 if (pDebug) alert('no instancename defined');
 return null;
 } else if (pFormname == '') {
 if (pDebug) alert('no formname defined');
 return null;
 } else if (pQueryParamName == '') {
 if (pDebug) alert('no queryparamname defined');
 return null;
 } else if (pLayerName == '') {
 if (pDebug) alert('need a layer for output');
 }
 pQueryInput = document[pFormname][pQueryParamName];
 pQueryInput.onkeyup = handleKeyPress;
 pQueryInput.onfocus = showLayer;
 pQueryInput.onblur = hideLayer;
 document[pFormname].onsubmit = handleSubmit;
 }
 
 function handleSubmit() {
 submitted = true;
 if (pSuggest[pCurrentSelection] != undefined) {
 document[pFormname][pQueryParamName].value = pSuggest[pCurrentSelection].split('###')[0];
 if(document[pFormname]['queryFromSuggest'] != null){
 document[pFormname]['queryFromSuggest'].value = true;
 }
 }
 }
 
 this.handleClick = function() {
 if (pSuggest[pCurrentSelection] != undefined) {
 document[pFormname][pQueryParamName].value = pSuggest[pCurrentSelection].split('###')[0];
 if(document[pFormname]['queryFromSuggest'] != null){
 document[pFormname]['queryFromSuggest'].value = true;
 }
 document[pFormname].submit();
 }
 }
 
 this.handleMouseOver = function(pos) {
 var tblCell = getTableCell(pos);
 unmarkAll();
 if (tblCell != null) {
 highlightSuggest(tblCell);
 pCurrentSelection = pos;
 }
 }
 
 this.handleMouseOut = function(pos) {
 var tblCell = getTableCell(pos);
 if (tblCell != null) {
 unmarkSuggest(tblCell);
 pCurrentSelection = -1
 }
 }
 
 function handleKeyPress(evt) {
 evt = (evt) ? evt : ((event) ? event : null);
 var keyCode = evt.keyCode;
 if (keyCode == 38) {
 moveSelection('up')
 } else if (keyCode == 27) { 
 hideLayer();
 } else if (keyCode == 40) {
 moveSelection('down');
 } else {
 if (pQueryInput.value == '') {
 hideLayer();
 if (pLayer != null){ pLayer.innerHTML = ''; }
 return null;
 }
 if (pLastQuery != pQueryInput.value){ startAjax(); }
 pLastQuery = pQueryInput.value;
 }
 }
 
 function moveSelection(direction) {
 var pos = pCurrentSelection;
 if (direction == 'up'){ pos--; }
 else{ pos += 1; }
 
 if (pos < 0) {
 unmarkAll();
 pQueryInput.focus();
 pCurrentSelection = -1;
 } else {
 var tblCell = getTableCell(pos);
 if (tblCell != null) {
 unmarkAll();
 highlightSuggest(tblCell);
 pCurrentSelection = pos;
 }
 }
 
 var query = pQueryInput.value;
 pQueryInput.value = '';
 pQueryInput.focus();
 pQueryInput.value = query; 
 }
 
 function startAjax() {
 var query = pQueryInput.value;
 var requestURL = pSearchURL +'?'+ pQueryParamName +'='+ escape(query) +'&'+ pChannelParamName +'='+ pChannel;
 
 try {
 if( window.XMLHttpRequest ) {
 pRequest = new XMLHttpRequest();
 } else if( window.ActiveXObject ) {
 pRequest = new ActiveXObject( "Microsoft.XMLHTTP" );
 } else {
 if (pDebug) alert( 'no ajax connection' );
 }
 
 pLayer = document.getElementById(pLayerName);
 if (pLayer != null) {
 if (query != '') {

 pRequest.open( "GET", requestURL, true );
 pRequest.onreadystatechange = callbackAjax;
 pRequest.send( null );
 } else {
 hideLayer();
 }
 } else {
 if (pDebug) alert( 'no layer for output found' );
 }
 } catch( ex ) {
 hideLayer();
 if (ex == undefined) {
 if (pDebug) alert( 'Error: ' + ex.getmessage );
 } else {
 if (pDebug) alert( 'Error: ' + ex );
 }
 }
 }
 
 function hideLayer() {
 if (pLayer != null) {
 pLayer.style.display = 'none';
 fireSuggestLayerHidden();
 }
 }
 
 this.hideLayerOutsideCall = function() {
 if (pLayer != null) {
 pLayer.style.display = 'none';
 fireSuggestLayerHidden();
 }
 }
 
 function showLayer() {
 if (pLayer != null && pSuggest != null && pSuggest.length >= 1) {
 pLayer.style.display = 'block';
 }
 }
 
 function callbackAjax() {
 if (submitted == false) {
 if (pRequest.readyState == 4) {
 if (pRequest.status != 200) {
 hideLayer();
 if (pDebug) alert( 'Error (' + pRequest.status + '): ' + pRequest.statusText );
 } else {
 handleResponse(pRequest.responseText);
 }
 }
 }
 }

 // calls the callback for "outside" listeners if the callback is implemented
 function fireSuggestCompleted(suggestLayerIsVisible) {
 if (typeof(onSuggestCompleted) == 'function') {
 onSuggestCompleted(suggestLayerIsVisible);
 }
 }
 
 // calls the callback for "outside" listeners if the callback is implemented
 function fireSuggestLayerHidden() {
 if (typeof(onSuggestLayerHidden) == 'function') {
 onSuggestLayerHidden();
 }
 }

 function handleResponse(text) {
 pCurrentSelection = -1;
 pSuggest = new Array();
 pSuggest = text.split('\n');
 var outputText = '<table cellpadding="0" cellspacing="0" class="' + pLayerName + '" width="100%" border="0" onMouseDown="' + pInstanceName + '.handleClick();">';
 outputText += '<tr class="'+pSuggestHeaderClass+'" ><td nowrap="nowrap" colspan="3"><ff:jsescape><bean:message bundle="Suggest" key="header" /></ff:jsescape></td></tr>';
 
 var pNewSuggest = new Array();
 //for (var i in pSuggest) {
 for (var i = 0; i < pSuggest.length; i++) {
 var firstChar = pSuggest[i].charCodeAt(0);
 
 if (firstChar != 13 && firstChar != 10 && pSuggest[i].length >= 1) {
 pNewSuggest.push(pSuggest[i]);
 }
 }
 pSuggest = pNewSuggest;
 var query = pQueryInput.value;
 
 for (var i = 0; i < pSuggest.length; i++) {
 pSuggestParts = new Array();
 pSuggestParts = pSuggest[i].split("###");
 
 outputText += '<tr id="' + pLayerName + '_' + i + '" class="'+pSuggestRowClass+'" onMouseOver="' + pInstanceName + '.handleMouseOver(' + i + ');" onMouseOut="' + pInstanceName + '.handleMouseOut(' + i + ');">'
 +'<td nowrap="nowrap" class="'+ pSuggestQueryClass +'">' + pSuggestParts[0].replace(new RegExp("("+query+")","ig"),'<span class="'+pSuggestQueryTypedClass+'">$1</span>') + '</td>'
 +'<td nowrap="nowrap" class="'+ pSuggestTypeClass +'">' + pSuggestParts[2] + '</td>'
 +'</tr>';
 }
 outputText += '<tr><td class="'+pSuggestFooterClass+'" colspan="3">&nbsp;</td></tr></table>';
 if (pSuggest.length >= 1) {
 showLayer();
 pLayer.innerHTML = outputText;

 // calback for "outside" listeners
 fireSuggestCompleted(true);
 } else {
 hideLayer();
 pLayer.innerHTML = '';
 
 // calback for "outside" listeners
 fireSuggestCompleted(false);
 }
 
 }
 
 function highlightSuggest(tblCell) {
 tblCell.className = pSuggestHighlightClass; 
 }
 
 function unmarkSuggest(tblCell) {
 tblCell.className = pSuggestRowClass; 
 }
 
 function unmarkAll() {
 var tblCell;
 //for (var i in pSuggest) {
 for (var i = 0; i < pSuggest.length; i++) {
 tblCell = getTableCell(i);
 if (tblCell != null) {
 unmarkSuggest(tblCell);
 }
 }
 }
 
 function getTableCell(pos) {
 var tblCell;
 tblCell = document.getElementById(pLayerName + '_' + pos);
 return tblCell;
 }
}
var LiveChatPeriodUpdater = null;

String.prototype.trim = function()
{
 return this.replace(/(?:^\s+|\s+$)/g, "");
}

function SendMessage()
{
 var customermessage = document.getElementById('textmessage').value.trim();
 document.getElementById('textmessage').value = '';
 if (customermessage != '')
 {
 var img = document.getElementById('livachat_ajax_loader');
 if (img != null)
 {
 img.style.display = 'inline';
 }
 
 if (LiveChatPeriodUpdater != null) {
 LiveChatPeriodUpdater.stop();
 }
 
 var setBottom = isScrollAtBottom();
 Insertion.Bottom('livechat_messages', "<b>" + customerName + "</b> : " + customermessage + "<br />");
 if (setBottom) {
 ScrollChatWindowToBottom();
 }
 
 var request = new Ajax.Request(
 urlSendMessage,
 {
 method: 'get',
 parameters: { message: customermessage },
 onSuccess: function(transport, json) {
 SetUpdater();
 if (LiveChatPeriodUpdater != null) {
 LiveChatPeriodUpdater.stop();
 }
 LiveChatPeriodUpdater.start();
 
 var img = document.getElementById('livechat_ajax_loader');
 if (img != null) {
 img.style.display = 'none';
 }
 
 }
 }
 );
 }
}

function SetUpdater()
{
 var setBottom = false;
 ScrollChatWindowToBottom(true);
 
 if (LiveChatPeriodUpdater == null)
 {
 LiveChatPeriodUpdater = new Ajax.PeriodicalUpdater(
 'livechat_messages',
 urlUpdater,
 {
 frequency: frequency,
 decay: decay,
 onSuccess: 
 function() {
 setBottom = isScrollAtBottom();
 },
 onComplete: 
 function() { 
 if(setBottom) {
 ScrollChatWindowToBottom();
 }
 }
 }
 );
 }
}

function isScrollAtBottom() {
 return $('livechat_messages').scrollTop >= $('livechat_messages').scrollHeight - $('livechat_messages').getHeight();
}

function ScrollChatWindowToBottom() { 
 $('livechat_messages').scrollTop = $('livechat_messages').scrollHeight;
}

function LiveChatKeyPress(e) {
 if (e.keyCode == 13) {
 SendMessage();
 }
}

function chatOpen() {
 var request = new Ajax.Request('/flivechat/chat/openchat',
 {
 method: 'get',
 parameters: { open: 'true' },
 onSuccess: function(transport) {
 location.reload();
 }
 }
 );
}

/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
 * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
 */
if(typeof Product=='undefined') {
 var Product = {};
}

/********************* IMAGE ZOOMER ***********************/

Product.Zoom = Class.create();
/**
 * Image zoom control
 *
 * @author Magento Core Team <core@magentocommerce.com>
 */
Product.Zoom.prototype = {
 initialize: function(imageEl, trackEl, handleEl, zoomInEl, zoomOutEl, hintEl){
 this.containerEl = $(imageEl).parentNode;
 this.imageEl = $(imageEl);
 this.handleEl = $(handleEl);
 this.trackEl = $(trackEl);
 this.hintEl = $(hintEl);

 this.containerDim = Element.getDimensions(this.containerEl);
 this.imageDim = Element.getDimensions(this.imageEl);

 this.imageDim.ratio = this.imageDim.width/this.imageDim.height;

 this.floorZoom = 1;

 if (this.imageDim.width > this.imageDim.height) {
 this.ceilingZoom = this.imageDim.width / this.containerDim.width;
 } else {
 this.ceilingZoom = this.imageDim.height / this.containerDim.height;
 }

 if (this.imageDim.width <= this.containerDim.width
 && this.imageDim.height <= this.containerDim.height) {
 this.trackEl.up().hide();
 this.hintEl.hide();
 this.containerEl.removeClassName('product-image-zoom');
 return;
 }

 this.imageX = 0;
 this.imageY = 0;
 this.imageZoom = 1;

 this.sliderSpeed = 0;
 this.sliderAccel = 0;
 this.zoomBtnPressed = false;

 this.showFull = false;

 this.selects = document.getElementsByTagName('select');

 this.draggable = new Draggable(imageEl, {
 starteffect:false,
 reverteffect:false,
 endeffect:false,
 snap:this.contain.bind(this)
 });

 this.slider = new Control.Slider(handleEl, trackEl, {
 axis:'horizontal',
 minimum:0,
 maximum:Element.getDimensions(this.trackEl).width,
 alignX:0,
 increment:1,
 sliderValue:0,
 onSlide:this.scale.bind(this),
 onChange:this.scale.bind(this)
 });

 this.scale(0);

 Event.observe(this.imageEl, 'dblclick', this.toggleFull.bind(this));

 Event.observe($(zoomInEl), 'mousedown', this.startZoomIn.bind(this));
 Event.observe($(zoomInEl), 'mouseup', this.stopZooming.bind(this));
 Event.observe($(zoomInEl), 'mouseout', this.stopZooming.bind(this));

 Event.observe($(zoomOutEl), 'mousedown', this.startZoomOut.bind(this));
 Event.observe($(zoomOutEl), 'mouseup', this.stopZooming.bind(this));
 Event.observe($(zoomOutEl), 'mouseout', this.stopZooming.bind(this));
 },

 toggleFull: function () {
 this.showFull = !this.showFull;
 //TODO: hide selects for IE only

 for (i=0; i<this.selects.length; i++) {
 this.selects[i].style.visibility = this.showFull ? 'hidden' : 'visible';
 }
 val_scale = !this.showFull ? this.slider.value : 1;
 this.scale(val_scale);

 this.trackEl.style.visibility = this.showFull ? 'hidden' : 'visible';
 this.containerEl.style.overflow = this.showFull ? 'visible' : 'hidden';
 this.containerEl.style.zIndex = this.showFull ? '1000' : '9';

 return this;
 },

 scale: function (v) {

 var centerX = (this.containerDim.width*(1-this.imageZoom)/2-this.imageX)/this.imageZoom;
 var centerY = (this.containerDim.height*(1-this.imageZoom)/2-this.imageY)/this.imageZoom;

 this.imageZoom = this.floorZoom+(v*(this.ceilingZoom-this.floorZoom));

 this.imageEl.style.width = (this.imageZoom*this.containerDim.width)+'px';
 if(this.containerDim.ratio){
 this.imageEl.style.height = (this.imageZoom*this.containerDim.width*this.containerDim.ratio)+'px'; // for safari
 }

 this.imageX = this.containerDim.width*(1-this.imageZoom)/2-centerX*this.imageZoom;
 this.imageY = this.containerDim.height*(1-this.imageZoom)/2-centerY*this.imageZoom;

 this.contain(this.imageX, this.imageY, this.draggable);

 return true;
 },

 startZoomIn: function()
 {
 this.zoomBtnPressed = true;
 this.sliderAccel = .002;
 this.periodicalZoom();
 this.zoomer = new PeriodicalExecuter(this.periodicalZoom.bind(this), .05);
 return this;
 },

 startZoomOut: function()
 {
 this.zoomBtnPressed = true;
 this.sliderAccel = -.002;
 this.periodicalZoom();
 this.zoomer = new PeriodicalExecuter(this.periodicalZoom.bind(this), .05);
 return this;
 },

 stopZooming: function()
 {
 if (!this.zoomer || this.sliderSpeed==0) {
 return;
 }
 this.zoomBtnPressed = false;
 this.sliderAccel = 0;
 },

 periodicalZoom: function()
 {
 if (!this.zoomer) {
 return this;
 }

 if (this.zoomBtnPressed) {
 this.sliderSpeed += this.sliderAccel;
 } else {
 this.sliderSpeed /= 1.5;
 if (Math.abs(this.sliderSpeed)<.001) {
 this.sliderSpeed = 0;
 this.zoomer.stop();
 this.zoomer = null;
 }
 }
 this.slider.value += this.sliderSpeed;

 this.slider.setValue(this.slider.value);
 this.scale(this.slider.value);

 return this;
 },

 contain: function (x,y,draggable) {

 var dim = Element.getDimensions(draggable.element);

 var xMin = 0, xMax = this.containerDim.width-dim.width;
 var yMin = 0, yMax = this.containerDim.height-dim.height;

 x = x>xMin ? xMin : x;
 x = x<xMax ? xMax : x;
 y = y>yMin ? yMin : y;
 y = y<yMax ? yMax : y;

 this.imageX = x;
 this.imageY = y;

 this.imageEl.style.left = this.imageX+'px';
 this.imageEl.style.top = this.imageY+'px';

 return [x,y];
 }
}

/**************************** CONFIGURABLE PRODUCT **************************/
Product.Config = Class.create();
Product.Config.prototype = {
 initialize: function(config){
 this.config = config;
 this.taxConfig = this.config.taxConfig;
 this.settings = $$('.super-attribute-select');
 this.state = new Hash();
 this.priceTemplate = new Template(this.config.template);
 this.prices = config.prices;

 this.settings.each(function(element){
 Event.observe(element, 'change', this.configure.bind(this))
 }.bind(this));

 // fill state
 this.settings.each(function(element){
 var attributeId = element.id.replace(/[a-z]*/, '');
 if(attributeId && this.config.attributes[attributeId]) {
 element.config = this.config.attributes[attributeId];
 element.attributeId = attributeId;
 this.state[attributeId] = false;
 }
 }.bind(this))

 // Init settings dropdown
 var childSettings = [];
 for(var i=this.settings.length-1;i>=0;i--){
 var prevSetting = this.settings[i-1] ? this.settings[i-1] : false;
 var nextSetting = this.settings[i+1] ? this.settings[i+1] : false;
 if(i==0){
 this.fillSelect(this.settings[i])
 }
 else {
 this.settings[i].disabled=true;
 }
 $(this.settings[i]).childSettings = childSettings.clone();
 $(this.settings[i]).prevSetting = prevSetting;
 $(this.settings[i]).nextSetting = nextSetting;
 childSettings.push(this.settings[i]);
 }

 // try retireve options from url
 var separatorIndex = window.location.href.indexOf('#');
 if (separatorIndex!=-1) {
 var paramsStr = window.location.href.substr(separatorIndex+1);
 this.values = paramsStr.toQueryParams();
 this.settings.each(function(element){
 var attributeId = element.attributeId;
 element.value = this.values[attributeId];
 this.configureElement(element);
 }.bind(this));
 }
 },

 configure: function(event){
 var element = Event.element(event);
 this.configureElement(element);
 },

 configureElement : function(element) {
 this.reloadOptionLabels(element);
 if(element.value){
 this.state[element.config.id] = element.value;
 if(element.nextSetting){
 element.nextSetting.disabled = false;
 this.fillSelect(element.nextSetting);
 this.resetChildren(element.nextSetting);
 }
 }
 else {
 this.resetChildren(element);
 }
 this.reloadPrice();
// Calculator.updatePrice();
 },

 reloadOptionLabels: function(element){
 var selectedPrice;
 if(element.options[element.selectedIndex].config){
 selectedPrice = parseFloat(element.options[element.selectedIndex].config.price)
 }
 else{
 selectedPrice = 0;
 }
 for(var i=0;i<element.options.length;i++){
 if(element.options[i].config){
 element.options[i].text = this.getOptionLabel(element.options[i].config, element.options[i].config.price-selectedPrice);
 }
 }
 },

 resetChildren : function(element){
 if(element.childSettings) {
 for(var i=0;i<element.childSettings.length;i++){
 element.childSettings[i].selectedIndex = 0;
 element.childSettings[i].disabled = true;
 if(element.config){
 this.state[element.config.id] = false;
 }
 }
 }
 },

 fillSelect: function(element){
 var attributeId = element.id.replace(/[a-z]*/, '');
 var options = this.getAttributeOptions(attributeId);
 this.clearSelect(element);
 element.options[0] = new Option(this.config.chooseText, '');

 var prevConfig = false;
 if(element.prevSetting){
 prevConfig = element.prevSetting.options[element.prevSetting.selectedIndex];
 }

 if(options) {
 var index = 1;
 for(var i=0;i<options.length;i++){
 var allowedProducts = [];
 if(prevConfig) {
 for(var j=0;j<options[i].products.length;j++){
 if(prevConfig.config.allowedProducts
 && prevConfig.config.allowedProducts.indexOf(options[i].products[j])>-1){
 allowedProducts.push(options[i].products[j]);
 }
 }
 } else {
 allowedProducts = options[i].products.clone();
 }

 if(allowedProducts.size()>0){
 options[i].allowedProducts = allowedProducts;
 element.options[index] = new Option(this.getOptionLabel(options[i], options[i].price), options[i].id);
 element.options[index].config = options[i];
 index++;
 }
 }
 }
 },

 getOptionLabel: function(option, price){
 var price = parseFloat(price);
 if (this.taxConfig.includeTax) {
 var tax = price / (100 + this.taxConfig.defaultTax) * this.taxConfig.defaultTax;
 var excl = price - tax;
 var incl = excl*(1+(this.taxConfig.currentTax/100));
 } else {
 var tax = price * (this.taxConfig.currentTax / 100);
 var excl = price;
 var incl = excl + tax;
 }

 if (this.taxConfig.showIncludeTax || this.taxConfig.showBothPrices) {
 price = incl;
 } else {
 price = excl;
 }

 var str = option.label;
 if(price){
 if (this.taxConfig.showBothPrices) {
 str+= ' ' + this.formatPrice(excl, true) + ' (' + this.formatPrice(price, true) + ' ' + this.taxConfig.inclTaxTitle + ')';
 } else {
 str+= ' ' + this.formatPrice(price, true);
 }
 }
 return str;
 },

 formatPrice: function(price, showSign){
 var str = '';
 price = parseFloat(price);
 if(showSign){
 if(price<0){
 str+= '-';
 price = -price;
 }
 else{
 str+= '+';
 }
 }

 var roundedPrice = (Math.round(price*100)/100).toString();

 if (this.prices && this.prices[roundedPrice]) {
 str+= this.prices[roundedPrice];
 }
 else {
 str+= this.priceTemplate.evaluate({price:price.toFixed(2)});
 }
 return str;
 },

 clearSelect: function(element){
 for(var i=element.options.length-1;i>=0;i--){
 element.remove(i);
 }
 },

 getAttributeOptions: function(attributeId){
 if(this.config.attributes[attributeId]){
 return this.config.attributes[attributeId].options;
 }
 },

 reloadPrice: function(){
 var price = 0;
 for(var i=this.settings.length-1;i>=0;i--){
 var selected = this.settings[i].options[this.settings[i].selectedIndex];
 if(selected.config){
 price += parseFloat(selected.config.price);
 }
 }

 optionsPrice.changePrice('config', price);
 optionsPrice.reload();

 return price;

 if($('product-price-'+this.config.productId)){
 $('product-price-'+this.config.productId).innerHTML = price;
 }
 this.reloadOldPrice();
 },

 reloadOldPrice: function(){
 if ($('old-price-'+this.config.productId)) {

 var price = parseFloat(this.config.oldPrice);
 for(var i=this.settings.length-1;i>=0;i--){
 var selected = this.settings[i].options[this.settings[i].selectedIndex];
 if(selected.config){
 price+= parseFloat(selected.config.price);
 }
 }
 if (price < 0)
 price = 0;
 price = this.formatPrice(price);

 if($('old-price-'+this.config.productId)){
 $('old-price-'+this.config.productId).innerHTML = price;
 }

 }
 }
}


/**************************** SUPER PRODUCTS ********************************/

Product.Super = {};
Product.Super.Configurable = Class.create();

Product.Super.Configurable.prototype = {
 initialize: function(container, observeCss, updateUrl, updatePriceUrl, priceContainerId) {
 this.container = $(container);
 this.observeCss = observeCss;
 this.updateUrl = updateUrl;
 this.updatePriceUrl = updatePriceUrl;
 this.priceContainerId = priceContainerId;
 this.registerObservers();
 },
 registerObservers: function() {
 var elements = this.container.getElementsByClassName(this.observeCss);
 elements.each(function(element){
 Event.observe(element, 'change', this.update.bindAsEventListener(this));
 }.bind(this));
 return this;
 },
 update: function(event) {
 var elements = this.container.getElementsByClassName(this.observeCss);
 var parameters = Form.serializeElements(elements, true);

 new Ajax.Updater(this.container, this.updateUrl + '?ajax=1', {
 parameters:parameters,
 onComplete:this.registerObservers.bind(this)
 });
 var priceContainer = $(this.priceContainerId);
 if(priceContainer) {
 new Ajax.Updater(priceContainer, this.updatePriceUrl + '?ajax=1', {
 parameters:parameters
 });
 }
 }
}

/**************************** PRICE RELOADER ********************************/
Product.OptionsPrice = Class.create();
Product.OptionsPrice.prototype = {
 initialize: function(config) {
 this.productId = config.productId;
 this.priceFormat = config.priceFormat;
 this.includeTax = config.includeTax;
 this.defaultTax = config.defaultTax;
 this.currentTax = config.currentTax;
 this.productPrice = config.productPrice;
 this.showIncludeTax = config.showIncludeTax;
 this.showBothPrices = config.showBothPrices;
 this.productPrice = config.productPrice;
 this.productOldPrice = config.productOldPrice;
 this.skipCalculate = config.skipCalculate;
 this.duplicateIdSuffix = config.idSuffix;

 this.oldPlusDisposition = config.oldPlusDisposition;
 this.plusDisposition = config.plusDisposition;

 this.oldMinusDisposition = config.oldMinusDisposition;
 this.minusDisposition = config.minusDisposition;

 this.optionPrices = {};
 this.containers = {};

 this.displayZeroPrice = true;

 this.initPrices();
 },

 setDuplicateIdSuffix: function(idSuffix) {
 this.duplicateIdSuffix = idSuffix;
 },

 initPrices: function() {
 this.containers[0] = 'product-price-' + this.productId;
 this.containers[1] = 'bundle-price-' + this.productId;
 this.containers[2] = 'price-including-tax-' + this.productId;
 this.containers[3] = 'price-excluding-tax-' + this.productId;
 this.containers[4] = 'old-price-' + this.productId;
 this.containers[5] = 'ps-product-price';
 this.containers[6] = 'ps-old-price';
 },

 changePrice: function(key, price) {
 this.optionPrices[key] = parseFloat(price);
 },

 getOptionPrices: function() {
 var result = 0;
 var nonTaxable = 0;
 $H(this.optionPrices).each(function(pair) {
 if (pair.key == 'nontaxable') {
 nonTaxable = pair.value;
 } else {
 result += pair.value;
 }
 });
 var r = new Array(result, nonTaxable);
 return r;
 },

 reload: function() {
 var price;
 var formattedPrice;
 var optionPrices = this.getOptionPrices();
 var nonTaxable = optionPrices[1];
 optionPrices = optionPrices[0];

 $H(this.containers).each(function(pair) {
 var _productPrice;
 var _plusDisposition;
 var _minusDisposition;
 if ($(pair.value)) {
 if ((pair.value == 'ps-old-price' || pair.value == 'old-price-'+this.productId) && this.productOldPrice != this.productPrice) {
 _productPrice = this.productOldPrice;
 _plusDisposition = this.oldPlusDisposition;
 _minusDisposition = this.oldMinusDisposition;
 } else {
 _productPrice = this.productPrice;
 _plusDisposition = this.plusDisposition;
 _minusDisposition = this.minusDisposition;
 }

 var price = optionPrices+parseFloat(_productPrice)
 if (this.includeTax == 'true') {
 // tax = tax included into product price by admin
 var tax = price / (100 + this.defaultTax) * this.defaultTax;
 var excl = price - tax;
 var incl = excl*(1+(this.currentTax/100));
 } else {
 var tax = price * (this.currentTax / 100);
 var excl = price;
 var incl = excl + tax;
 }

 excl += parseFloat(_plusDisposition);
 incl += parseFloat(_plusDisposition);
 excl -= parseFloat(_minusDisposition);
 incl -= parseFloat(_minusDisposition);

 //adding nontaxlable part of options
 excl += parseFloat(nonTaxable);
 incl += parseFloat(nonTaxable);

 if (pair.value == 'price-including-tax-'+this.productId) {
 price = incl;
 } else if (pair.value == 'old-price-'+this.productId || pair.value == 'ps-old-price') {
 if (this.showIncludeTax || this.showBothPrices) {
 price = incl;
 } else {
 price = excl;
 }
 } else {
 if (this.showIncludeTax) {
 price = incl;
 } else {
 if (!this.skipCalculate || _productPrice == 0) {
 price = excl;
 } else {
 price = optionPrices+parseFloat(_productPrice);
 }
 }
 }

 if (price < 0) price = 0;

 if (price > 0 || this.displayZeroPrice) {
 formattedPrice = this.formatPrice(price);
 } else {
 formattedPrice = '';
 }

 if ($(pair.value).select('.price')[0]) {
 $(pair.value).select('.price')[0].innerHTML = formattedPrice;
 if ($(pair.value+this.duplicateIdSuffix) && $(pair.value+this.duplicateIdSuffix).select('.price')[0]) {
 $(pair.value+this.duplicateIdSuffix).select('.price')[0].innerHTML = formattedPrice;
 }
 } else {
 $(pair.value).innerHTML = formattedPrice;
 if ($(pair.value+this.duplicateIdSuffix)) {
 $(pair.value+this.duplicateIdSuffix).innerHTML = formattedPrice;
 }
 }
 };
 }.bind(this));
 },
 formatPrice: function(price) {
 return formatCurrency(price, this.priceFormat);
 }
}

eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('q 1f=\'1S\';q W=54.55.2y();m(W.2q("2z")!=-1){1f=\'2z\'}U m(W.2q("1S")!=-1){1f=\'1S\'}U m(W.2q("43")!=-1){1f=\'43\'}U m(W.2q("9L")!=-1){1f=\'4o\'}q 44=1I 5O();v 3u$(1O){G C.7L(1O)};v 1H(F,5P){m(F.4p){q y=F.4p[5P];y=K(y)?y:\'1J\'}U m(1g.6P){q 4q=C.6Q.6P(F,1a);q y=4q?4q[5P]:1a}U{y=F.B[5P];y=K(y)?y:\'1J\'}G y};v 5Q(e){m(e.7M){q r=e.7M();q 56=0;q 57=0;m(C.Z&&(C.Z.2K||C.Z.2L)){57=C.Z.2L;56=C.Z.2K}U m(C.1P&&(C.1P.2K||C.1P.2L)){57=C.1P.2L;56=C.1P.2K}G{\'M\':r.M+56,\'L\':r.L+57,\'1b\':r.1b+56,\'1q\':r.1q+57}}}v 6R(e){q x=0;q y=0;m(1f==\'1S\'){y=e.3M;x=e.3N;m(C.Z&&(C.Z.2K||C.Z.2L)){y=e.3M+C.Z.2L;x=e.3N+C.Z.2K}U m(C.1P&&(C.1P.2K||C.1P.2L)){y=e.3M+C.1P.2L;x=e.3N+C.1P.2K}}U{y=e.3M;x=e.3N;y+=1g.45;x+=1g.46}G{\'x\':x,\'y\':y}}v 6S(){G P};q 6T=v(){q 1Y=1Z;m(!1Y[1])1Y=[7,1Y[0]];1x(q 6U 5R 1Y[1])1Y[0][6U]=1Y[1][6U];G 1Y[0]};v 3g(2A,13,4r){m(1f==\'4o\'||1f==\'2z\'||1f==\'43\'){3v{2A.6V(13,4r,P)}3w(e){}}U m(1f==\'1S\'){2A.5S("4s"+13,4r)}};v 6W(2A,13,4r){m(1f==\'4o\'||1f==\'2z\'||1f==\'43\'){2A.6X(13,4r,P)}U m(1f==\'1S\'){2A.7N("4s"+13,4r)}};v 7O(){q 3x=[];1x(q i=0;i<1Z.1c;i++)1x(q j=0;j<1Z[i].1c;j++)3x.3y(1Z[i][j]);G 3x};v 7P(6Y,7Q){3x=[];1x(q i=7Q;i<6Y.1c;i++)3x.3y(6Y[i]);G 3x};v 3h(47,7R){q 1Y=7P(1Z,2);G v(){47[7R].4t(47,7O(1Y,1Z))}};v 4u(e){m(1f==\'4o\'||1f==\'43\'||1f==\'2z\'){e.6Z=V;e.70();e.71()}U m(1f==\'1S\'){1g.13.6Z=V}};v 25(7S,7T,7U,7V,17){7.72=\'2.3\';7.4v=P;7.1K=3u$(7S);7.1d=3u$(7T);7.X=3u$(7U);7.1l=3u$(7V);7.1D=0;7.17=17;m(!7.17["3O"]){7.17["3O"]=""}7.3i=0;7.2M=0;7.9M=0;7.9N=0;7.26=0;7.2m=0;7.2r=20;7.9O=20;7.3z=0;7.3P=0;7.3Q=\'\';7.28=1a;m(7.17["4w"]!=\'\'){7.28=C.1r(\'58\');7.28.B.T=\'1s\';7.28.B.1h=\'1t\';7.28.2X=\'7W\';7.28.B.1p=\'1L\';7.28.B.7X=\'4x\';7.28.2Y=7.17["4y"]+\'<br/><1m 1A="0" 4z="\'+7.17["4y"]+\'" 1T="\'+7.17["4w"]+\'"/>\';7.1K.1n(7.28)}7.9P=\'\';7.5T=P;44.3y(7);7.73=3h(7,"5U");7.74=3h(7,"4A")};25.29.7Y=v(){6W(1g.C,"4A",7.73);6W(7.1K,"4A",7.74);m(7.17["T"]=="4B"){3u$(7.1K.1O+"-7Z").2Z(7.X)}U{7.1K.2Z(7.X)}7.1K.2Z(7.1D)};25.29.5U=v(e){q r=6R(e);q x=r[\'x\'];q y=r[\'y\'];q 2B=0;q 2C=0;q 2n=7.1d;3j(2n&&2n.31!="81"&&2n.31!="82"){2B+=2n.5V;2C+=2n.5W;2n=2n.59}m(1f==\'1S\'){q r=5Q(7.1d);2C=r[\'M\'];2B=r[\'L\']}2C+=K(1H(7.1d,\'5a\'));2B+=K(1H(7.1d,\'76\'));m(1f!=\'1S\'||!(C.21&&\'3A\'==C.21.2y())){2C+=K(1H(7.1d,\'3B\'));2B+=K(1H(7.1d,\'5X\'))}m(x>K(2C+7.26)){7.4C();G P}m(x<K(2C)){7.4C();G P}m(y>K(2B+7.2m)){7.4C();G P}m(y<K(2B)){7.4C();G P}m(1f==\'1S\'){7.1K.B.1B=1}G V};25.29.5Y=v(e){4u(e);7.1K.B.5b=\'83\'};25.29.77=v(e){4u(e);7.1K.B.5b=\'78\'};25.29.4A=v(e){4u(e);1x(i=0;i<44.1c;i++){m(44[i]!=7){44[i].5U(e)}}m(7.17&&7.17["48"]==V){m(7.1K.B.5b!=\'83\'){G}}m(7.4v){G}m(!7.5U(e)){G}7.4v=V;q 1E=7.1d;q 2C=0;q 2B=0;m(1f==\'4o\'||1f==\'2z\'||1f==\'43\'){q 2n=1E;3j(2n.31!="81"&&2n.31!="82"){2B+=2n.5V;2C+=2n.5W;2n=2n.59}}U{q r=5Q(7.1d);2C=r[\'M\'];2B=r[\'L\']}2C+=K(1H(7.1d,\'5a\'));2B+=K(1H(7.1d,\'76\'));m(1f!=\'1S\'||!(C.21&&\'3A\'==C.21.2y())){2C+=K(1H(7.1d,\'3B\'));2B+=K(1H(7.1d,\'5X\'))}q r=6R(e);q x=r[\'x\'];q y=r[\'y\'];7.3z=x-2C;7.3P=y-2B;m((7.3z+7.2r/2)>=7.26){7.3z=7.26-7.2r/2}m((7.3P+7.2D/2)>=7.2m){7.3P=7.2m-7.2D/2}m((7.3z-7.2r/2)<=0){7.3z=7.2r/2}m((7.3P-7.2D/2)<=0){7.3P=7.2D/2}2N(3h(7,"79"),10)};25.29.79=v(){q 5c=7.3z-7.2r/2;q 5d=7.3P-7.2D/2;q 5e=5c*(7.3i/7.26);q 5Z=5d*(7.2M/7.2m);m(C.1P.9Q==\'9R\'){5e=(7.3z+7.2r/2-7.26)*(7.3i/7.26)}5c+=K(1H(7.1d,\'5a\'));5d+=K(1H(7.1d,\'76\'));m(1f!=\'1S\'||!(C.21&&\'3A\'==C.21.2y())){5c+=K(1H(7.1d,\'3B\'));5d+=K(1H(7.1d,\'5X\'))}7.1D.B.M=5c+\'1u\';7.1D.B.L=5d+\'1u\';7.1D.B.1h="2a";m((7.3i+89-5e)<K(7.X.B.H)){5e=7.3i-K(7.X.B.H)+89}q 5f=0;m(7.17&&7.17["3O"]!=""){q 5f=19}m(7.2M+80>(K(7.X.B.N)-5f)){m((7.2M+80-5Z)<(K(7.X.B.N)-5f)){5Z=7.2M-K(7.X.B.N)+5f+80}}7.1l.B.M=(-5e)+\'1u\';7.1l.B.L=(-5Z)+\'1u\';7.X.B.L=7.3Q;7.X.B.1p=\'1L\';7.X.B.1h=\'2a\';7.1l.B.1p=\'1L\';7.1l.B.1h=\'2a\';7.4v=P};v 60(4D){q 4E="";1x(i=0;i<4D.1c;i++){4E+=49.84(14^4D.85(i))}G 4E};25.29.4C=v(){m(7.17&&7.17["4F"]==V)G;m(7.1D){7.1D.B.1h="1t"}7.X.B.L=\'-4G\';m(1f==\'1S\'){7.1K.B.1B=0}};25.29.7a=v(){7.2r=K(7.X.B.H)/(7.3i/7.26)-30;m(7.17&&7.17["3O"]!=""){7.2D=(K(7.X.B.N)-19)/(7.2M/7.2m)-23}U{7.2D=K(7.X.B.N)/(7.2M/7.2m)-23}m(7.2r>7.26){7.2r=7.26}m(7.2D>7.2m){7.2D=7.2m}7.2r=1j.2g(7.2r);7.2D=1j.2g(7.2D);m(!(C.21&&\'3A\'==C.21.2y())){q bw=K(1H(7.1D,\'5a\'));7.1D.B.H=((7.2r-2*bw))+\'1u\';7.1D.B.N=(7.2D-2*bw)+\'1u\'}U{7.1D.B.H=(7.2r)+\'1u\';7.1D.B.N=7.2D+\'1u\'}};25.29.86=v(){7.1D=C.1r("58");7.1D.2X=\'9S\';7.1D.B.1B=10;7.1D.B.1h=\'1t\';7.1D.B.T=\'1s\';7.1D.B["16"]=4a(7.17[\'16\']/2h.0);7.1D.B["-9T-16"]=4a(7.17[\'16\']/2h.0);7.1D.B["-87-16"]=4a(7.17[\'16\']/2h.0);7.1D.B["4H"]="88(9U="+7.17[\'16\']+")";7.1K.1n(7.1D);7.7a();7.1K.9V="4s";7.1K.B.9W="2s";7.1K.9X=6S;7.1K.9Y=6S};25.29.8a=v(){q 8b=7.1l.1T;m(7.2M<K(7.X.B.N)){7.X.B.N=7.2M+\'1u\';m(7.17&&7.17["3O"]!=""){7.X.B.N=(19+7.2M)+\'1u\'}}m(7.3i<K(7.X.B.H)){7.X.B.H=7.3i+\'1u\'}3j(7.X.2E){7.X.2Z(7.X.2E)}m(1f==\'1S\'){q f=C.1r("9Z");f.B.M=\'1J\';f.B.L=\'1J\';f.B.T=\'1s\';f.1T="7b:\'\'";f.B.4H=\'8c:8d.8e.a0(B=0,16=0)\';f.B.H=7.X.B.H;f.B.N=7.X.B.N;f.a1=0;7.X.1n(f)}m(7.17&&7.17["3O"]!=""){q f=C.1r("58");f.2X=\'61\';f.1O=\'61\'+7.X.1O;f.B.T=\'1U\';f.B.1B=10;f.B.M=\'1J\';f.B.L=\'1J\';f.B.2i=\'a2\';f.2Y=7.17["3O"];7.X.1n(f)}q 62=C.1r("58");62.B.3R="1t";7.X.1n(62);7.1l=C.1r("3S");7.1l.1T=8b;7.1l.B.T=\'1U\';7.1l.B.8f=\'1J\';7.1l.B.2i=\'1J\';7.1l.B.M=\'1J\';7.1l.B.L=\'1J\';62.1n(7.1l);m(\'1M\'!==4I(2t)){q 4J=60(2t[0]);q f=C.1r("3C");f.B.63=2t[1];f.B.a3=2t[2]+\'1u\';f.B.a4=2t[3];f.B.a5=\'8g\';f.B.T=\'1s\';f.B.H=2t[5];f.B.7X=2t[4];f.2Y=4J;f.B.M=\'1J\';f.B.L=K(7.X.B.N)-2t[6]+\'1u\';7.X.1n(f)}};25.29.4K=v(){m(7.28!=1a&&(!7.1l.64||0==7.1l.H||0==7.1l.N)&&7.1d.H!=0&&7.1d.N!=0){7.28.B.M=(K(7.1d.H)/2-K(7.28.65)/2)+\'1u\';7.28.B.L=(K(7.1d.N)/2-K(7.28.66)/2)+\'1u\';7.28.B.1h=\'2a\'}m(1f==\'43\'){m(!7.5T){3g(7.1l,"4b",3h(7,"4K"));7.5T=V;G}}U{m(!7.1l.64||!7.1d.64){2N(3h(7,"4K"),2h);G}}7.1l.B.8f=\'1J\';7.1l.B.2i=\'1J\';7.3i=7.1l.H;7.2M=7.1l.N;7.26=7.1d.H;7.2m=7.1d.N;m(7.3i==0||7.2M==0||7.26==0||7.2m==0){2N(3h(7,"4K"),2h);G}m(1f==\'2z\'||(1f==\'1S\'&&!(C.21&&\'3A\'==C.21.2y()))){7.26-=K(1H(7.1d,\'3B\'));7.26-=K(1H(7.1d,\'4L\'));7.2m-=K(1H(7.1d,\'5X\'));7.2m-=K(1H(7.1d,\'a6\'))}m(7.28!=1a)7.28.B.1h=\'1t\';7.1K.B.H=7.1d.H+\'1u\';7.X.B.L=\'-4G\';7.3Q=\'1J\';q r=5Q(7.1d);m(!r){7.X.B.M=7.26+K(1H(7.1d,\'5a\'))+K(1H(7.1d,\'a7\'))+K(1H(7.1d,\'3B\'))+K(1H(7.1d,\'4L\'))+15+\'1u\'}U{7.X.B.M=(r[\'1b\']-r[\'M\']+15)+\'1u\'}5g(7.17[\'T\']){1y\'M\':7.X.B.M=\'-\'+(15+K(7.X.B.H))+\'1u\';1w;1y\'1q\':m(r){7.3Q=r[\'1q\']-r[\'L\']+15+\'1u\'}U{7.3Q=7.1d.N+15+\'1u\'}7.X.B.M=\'1J\';1w;1y\'L\':7.3Q=\'-\'+(15+K(7.X.B.N))+\'1u\';7.X.B.M=\'1J\';1w;1y\'4B\':7.X.B.M=\'1J\';7.3Q=\'1J\';1w;1y\'67\':7.X.B.M=\'1J\';7.3Q=\'1J\';m(7.17[\'5h\']==-1){7.X.B.H=7.26+\'1u\'}m(7.17[\'5i\']==-1){7.X.B.N=7.2m+\'1u\'}1w}m(7.1D){7.7a();G}7.8a();7.86();3g(1g.C,"4A",7.73);3g(7.1K,"4A",7.74);m(7.17&&7.17["48"]==V){3g(7.1K,"5Y",3h(7,"5Y"));3g(7.1K,"77",3h(7,"77"))}m(7.17&&(7.17["48"]==V||7.17["4F"]==V)){7.3z=7.26/2;7.3P=7.2m/2;7.79()}};25.29.7c=v(4c,e){m(4c.3T==7.1l.1T)G;q 5j=C.1r("3S");5j.1O=7.1l.1O;5j.1T=4c.3T;q p=7.1l.8h;p.a8(5j,7.1l);7.1l=5j;7.1l.B.T=\'1U\';7.1d.1T=4c.8i;m(4c.2O!=\'\'&&3u$(\'61\'+7.X.1O)){3u$(\'61\'+7.X.1O).2E.8j=4c.2O}7.5T=P;7.4K();7.1K.3T=4c.3T;3v{E.4M()}3w(e){}};v 8k(1O,1C){q Y=1g.C.36("A");1x(q i=0;i<Y.1c;i++){m(Y[i].3a==1O){3g(Y[i],"2P",v(13){m(1f!=\'1S\'){7.8l()}U{1g.5k()}4u(13);G P});3g(Y[i],1C.17[\'5l\'],3h(1C,"7c",Y[i]));Y[i].B.7d=\'0\';Y[i].68=6T;Y[i].68({1C:1C,a9:v(){7.1C.7c(1a,7)}});q 1m=C.1r("3S");1m.1T=Y[i].3T;1m.B.T=\'1s\';1m.B.M=\'-4G\';1m.B.L=\'-4G\';C.Z.1n(1m);1m=C.1r("3S");1m.1T=Y[i].8i;1m.B.T=\'1s\';1m.B.M=\'-4G\';1m.B.L=\'-4G\';C.Z.1n(1m)}}};v aa(){3j(44.1c>0){q 1C=44.5m();1C.7Y();69 1C}};v 8m(){q 4y=\'8n ab\';q 4w=\'\';q 4N=1g.C.36("3S");1x(q i=0;i<4N.1c;i++){m(/7W/.3k(4N[i].2X)){m(4N[i].4z!=\'\')4y=4N[i].4z;4w=4N[i].1T;1w}}q Y=1g.C.36("A");1x(q i=0;i<Y.1c;i++){m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z[3]==\'V\')4F=V}2j.B.3R=\'1t\';2j.2X="ao";2j.B.1B=2h;2j.B.1h=\'1t\';m(T!=\'4B\'){2j.B.T=\'1s\'}U{2j.B.T=\'1U\'}q I=C.1r("3S");I.1O="8q"+4d;I.1T=Y[i].3T;2j.1n(I);m(T!=\'4B\'){Y[i].1n(2j)}U{3u$(Y[i].1O+\'-7Z\').1n(2j)}q 17={4F:4F,48:48,3O:Y[i].2O,16:16,5l:5l,T:T,4y:4y,4w:4w,5h:5h,5i:5i};m(T==\'67\'){Y[i].2O=\'\'}q 1C=1I 25(Y[i].1O,\'8o\'+4d,2j.1O,\'8q\'+4d,17);Y[i].68=6T;Y[i].68({1C:1C});1C.4K();8k(Y[i].1O,1C)}}};m(1f==\'1S\')3v{C.8r("8s",P,V)}3w(e){};3g(1g,"4b",8m);(v(){1g.k={72:\'1.12\',1v:{2Q:!!(1g.5S&&!1g.2z),4O:!!(1g.5S&&!1g.8t),ap:!!(1g.aq&&1g.8t),2z:!!1g.2z,8u:54.55.2q(\'ar/\')>-1,4o:54.55.2q(\'at\')>-1&&54.55.2q(\'au\')==-1,av:!!54.55.aw(/ax.*ay.*az/),6a:C.21&&\'3A\'==C.21.2y(),6b:P},$:v(F){m(!F)G 1a;m("aA"==4I F){F=C.7L(F)}G F},$A:v(3D){m(!3D)G[];m(3D.8v){G 3D.8v()}q 1c=3D.1c||0,7e=1I 5O(1c);3j(1c--)7e[1c]=3D[1c];G 7e},2F:v(2A,7f){m(\'1M\'===4I(2A)){G 2A}1x(q p 5R 7f){2A[p]=7f[p]}G 2A},7g:v(){q 3x=[];1x(q i=0,8w=1Z.1c;i<8w;i++){1x(q j=0,8x=1Z[i].1c;j<8x;j++){3x.3y(1Z[i][j])}}G 3x},2o:v(){q 1Y=k.$A(1Z),6c=1Y.6d(),47=1Y.6d();G v(){G 6c.4t(47,k.7g(1Y,k.$A(1Z)))}},3m:v(){q 1Y=k.$A(1Z),6c=1Y.6d(),47=1Y.6d();G v(13){G 6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3E(/-(\\D)/g,v(aL,8G){G 8G.aM()})}},u:{6l:v(F,4g){m(!(F=k.$(F))){G}G((\' \'+F.2X+\' \').2q(\' \'+4g+\' \')>-1)},3c:v(F,4g){m(!(F=k.$(F))){G}m(!k.u.6l(F,4g)){F.2X+=(F.2X?\' \':\'\')+4g}},6m:v(F,4g){m(!(F=k.$(F))){G}F.2X=k.49.8F(F.2X.3E(1I 3U(\'(^|\\\\s)\'+4g+\'(?:\\\\s|$)\'),\'$1\'))},1e:v(F,B){F=k.$(F);B=B==\'7l\'?\'8H\':k.49.6k(B);q 2v=F.B[B];m(!2v&&C.6Q){q 4q=C.6Q.6P(F,1a);2v=4q?4q[B]:1a}U m(!2v&&F.4p){2v=F.4p[B]}m(\'16\'==B)G 2v?4a(2v):1.0;m(/^(1A(8I|8J|8K|8L)aN)|((2i|5u)(8I|8J|8K|8L))$/.3k(B)){2v=K(2v)?2v:\'1J\'}G 2v==\'3F\'?1a:2v},O:v(F,2R){v 8M(s,n){m(\'aO\'===4I(n)&&!(\'1B\'===s||\'1C\'===s)){G\'1u\'}G\'\'}F=k.$(F);q 2S=F.B;1x(q s 5R 2R){3v{m(\'16\'===s){k.u.8N(F,2R[s]);6n}m(\'7l\'===s){2S[(\'1M\'===4I(2S.8O))?\'8H\':\'8O\']=2R[s];6n}2S[k.49.6k(s)]=2R[s]+8M(k.49.6k(s),2R[s])}3w(e){}}G F},8N:v(F,16){F=k.$(F);q 2S=F.B;16=4a(16);m(16==0){m(\'1t\'!=2S.1h)2S.1h=\'1t\'}U{m(16>1){16=4a(16/2h)}m(\'2a\'!=2S.1h)2S.1h=\'2a\'}m(!F.4p||!F.4p.aP){2S.1C=1}m(k.1v.2Q){2S.4H=(16==1)?\'\':\'88(16=\'+16*2h+\')\'}2S.16=16;G F},22:v(F){F=k.$(F);G{\'H\':F.65,\'N\':F.66}},8P:v(F){F=k.$(F);q p={x:0,y:0};3j(F&&!k.8y(F)){p.x+=F.2K;p.y+=F.2L;F=F.8h}G p},3d:v(F,1U){1U=1U||P;F=k.$(F);q s=k.u.8P(F);q l=0,t=0;aQ{l+=F.5W||0;t+=F.5V||0;F=F.59;m(1U){3j(F&&\'1U\'==F.B.T){F=F.59}}}3j(F);G{\'L\':t-s.y,\'M\':l-s.x}},3X:v(F,1U){q p=k.u.3d(F,1U);q s=k.u.22(F);G{\'L\':p.L,\'1q\':p.L+s.N,\'M\':p.M,\'1b\':p.M+s.H}},aS:v(F,c){F=k.$(F);m(F){F.2Y=c}}},2T:{5v:v(x){G x},6o:v(x){G-(1j.8Q(1j.8R*x)-1)/2},7m:v(p){G 1j.6p(p,2)},aT:v(p){G 1-k.2T.7m(1-p)},8S:v(p){G 1j.6p(p,3)},aU:v(p){G 1-k.2T.8S(1-p)},8T:v(p,x){x=x||1.aV;G 1j.6p(p,2)*((x+1)*p-x)},aW:v(p,x){G 1-k.2T.8T(1-p)},aX:v(p,x){x=x||[];G 1j.6p(2,10*--p)*1j.8Q(20*p*1j.8R*(x[0]||1)/3)},2s:v(x){G 0}},5t:[],4Q:1a,4R:v(){m(k.1v.6b){G}k.1v.6b=V;m(k.4Q){7n(k.4Q)}1x(q i=0,l=k.5t.1c;i<l;i++){k.5t[i].4t(C)}},8D:v(){m(k.1v.8u){(v(){m(k.5n(C.aY,[\'6q\',\'64\'])){k.4R();G}k.4Q=2N(1Z.6r,50);G})()}m(k.1v.2Q&&1g==L){(v(){3v{C.1P.aZ("M")}3w(e){k.4Q=2N(1Z.6r,50);G}k.4R()})()}m(k.1v.2z){k.1i.3b(C,\'8U\',v(){1x(q i=0,l=C.8V.1c;i<l;i++){m(C.8V[i].b0){k.4Q=2N(1Z.6r,50);G}k.4R()}})}k.1i.3b(C,\'8U\',k.4R);k.1i.3b(1g,\'4b\',k.4R)}};k.3n=v(){7.4h.4t(7,1Z)};k.3n.29={6s:{8W:50,b1:0.5,2p:k.2T.6o,4i:v(){},3Y:v(){},8X:v(){}},J:{},4h:v(F,6t){7.F=F;7.J=k.2F(k.2F({},7.6s),6t);7.5w=P},7o:v(3G,d){G(3G[1]-3G[0])*d+3G[0]},3H:v(2R){7.2R=2R;7.b2=0;7.b3=0;7.7p=k.4P();7.8Y=7.7p+7.J.2I*5x;7.5w=b4(k.2o(7.8Z,7),1j.2g(5x/7.J.8W));7.J.4i()},8Z:v(){q 4P=k.4P();m(4P>=7.8Y){m(7.5w){b5(7.5w);7.5w=P}7.7q(1.0);2N(7.J.3Y,10);7.J.3Y=v(){};G 7}q 5y=7.J.2p((4P-7.7p)/(7.J.2I*5x));7.7q(5y)},7q:v(5y){q 5z={};1x(q s 5R 7.2R){m(\'16\'===s){5z[s]=1j.2g(7.7o(7.2R[s],5y)*2h)/2h}U{5z[s]=1j.2g(7.7o(7.2R[s],5y))}}7.J.8X(5z);k.u.O(7.F,5z)}};m(!5O.29.2q){k.2F(5O.29,{\'2q\':v(3I,6u){q 5o=7.1c;1x(q i=(6u<0)?1j.91(0,5o+6u):6u||0;i<5o;i++){m(7[i]===3I)G i}G-1}})}})();q E={72:\'1.5.b6\',3e:[],3f:[],1B:92,2l:P,6s:{2p:k.2T.7m,1B:92,2I:0.5,7r:P,4j:P,2U:\'4x\',2e:{\'L\':0,\'M\':0,\'1q\':0,\'1b\':0},4S:\'2P\',6v:0.5,6w:0,93:\'#b7\',7s:0.2,94:V,7t:P,4T:0.b8,5A:\'6x\',7u:V,4k:\'L 1b\',7v:[\'6y\',\'3J\',\'6z\'],95:V,96:\'8n...\',97:0.75,98:V,99:V},J:{},9a:{\'6y\':{1o:0,2O:\'b9\'},\'3J\':{1o:1,2O:\'ba\'},\'6z\':{1o:2,2O:\'bb\'}},4h:v(4M){4M=4M||P;7.J=k.2F(7.6s,7.J);q 1z=/(3F|4x|1s|1U)/i.3V(7.J.2U);5g(1z[1]){1y\'3F\':7.J.2U=\'3F\';1w;1y\'1s\':7.J.2U=\'1s\';1w;1y\'1U\':7.J.2U=\'1U\';1w;1y\'4x\':78:7.J.2U=\'4x\';1w}7.J.4S=/3l/i.3k(7.J.4S)?\'3l\':\'2P\';7.1B=7.J.1B;q as=C.36("a");q l=as.1c;q 9b=0;1x(q i=0;i<l;i++){m(k.u.6l(as[i],\'E\')){E.3e.3y(1I E.6A(as[i],1a,9b++,{9c:(7.J.bd||7.J.2I),9d:(7.J.be||7.J.2I),4T:7.J.4T,5A:7.J.5A,2p:7.J.2p,4j:7.J.4j,4S:7.J.4S,6v:7.J.6v,2U:7.J.2U,2e:7.J.2e}))}}m(!4M&&E.J.95){k.1i.3b(C,\'bf\',v(e){q t=E.3o();m(t!=1a&&1M!=t){q r=k.u.3X(t.I);m((e.3N>=r.M&&e.3N<=r.1b)&&(e.3M>=r.L&&e.3M<=r.1q)){k.1i.2w(e);G P}}})}},2w:v(){1x(q t=E.3e.5m();t!=1a&&1M!=t;t=E.3e.5m()){t.9e();69 t};E.3e=[];E.3f=[]},4M:v(){7.2w();2N(v(){E.4h(V)},10);G},4U:v(e,2V){m(e){k.1i.2w(e)}q t=E.3o(),3I=E.3K(2V);m(1M==3I){G}m(!E.J.7r&&1M!=t&&2V!=t.1o){t.3Z(1a,3I,V)}U{3I.4U(7.1B)}},9f:v(2V){q 1Q=7.3f.2q(2V);m(-1!==1Q){7.3f.9g(1Q,1)}7.3f.3y(2V)},3o:v(){G(7.3f.1c>0)?7.3K(7.3f[7.3f.1c-1]):1M},9h:v(2V){q 1Q=7.3f.2q(2V);m(-1===1Q){G}7.3f.9g(1Q,1)},3K:v(2V){q 3I=1M;1x(q i=0,l=E.3e.1c;i<l;i++){m(2V==E.3e[i].1o){3I=E.3e[i];1w}}G 3I},5B:v(1k){1k=1k||1a;q 1R=[];1x(q i=0,l=E.3e.1c;i<l;i++){m(1k==E.3e[i].1k){1R.3y(E.3e[i].1o)}}G 1R.bg(v(a,b){G a-b})},7w:v(1k,3p){1k=1k||1a;3p=3p||P;q 1R=E.5B(E.3o().1k);q 1Q=1R.2q(E.3o().1o)+1;G(1Q>=1R.1c)?(!3p)?1M:E.3K(1R[0]):E.3K(1R[1Q])},7x:v(1k,3p){1k=1k||1a;3p=3p||P;q 1R=E.5B(E.3o().1k);q 1Q=1R.2q(E.3o().1o)-1;G(1Q<0)?(!3p)?1M:E.3K(1R[1R.1c-1]):E.3K(1R[1Q])},9i:v(1k){1k=1k||1a;q 1R=E.5B(1k);G(1R.1c)?E.3K(1R[0]):1M},9j:v(1k){1k=1k||1a;q 1R=E.5B(1k);G(1R.1c)?E.3K(1R[1R.1c-1]):1M},5C:v(e){m(!E.J.94){k.1i.3W(C,\'6B\',E.5C);G V}q 9k=e.bh,w=1a,r=P;5g(9k){1y 27:w=0;1w;1y 32:w=1;r=V;1w;1y 34:w=1;1w;1y 33:w=-1;1w;1y 39:1y 40:m((E.J.7t)?(e.9l||e.9m):V){w=1}1w;1y 37:1y 38:m((E.J.7t)?(e.9l||e.9m):V){w=-1}1w}m(1a!==w){m(E.3f.1c>0){k.1i.2w(e)}3v{q 3G=E.3o();q 3J=1a;m(0==w){3G.3Z(1a)}U m(-1==w){3J=E.7x(3G.1k,r)}U m(1==w){3J=E.7w(3G.1k,r)}m(1M!=3J){3G.3Z(1a,3J)}}3w(e){m(9n){9n.bi(e.bj)}}}},6C:v(F){m(k.1v.2z){k.u.O(F,{\'5b\':\'9o\'})}},9p:v(){m(E.2l&&\'2s\'!=k.u.1e(E.2l,\'1p\')){G}m(!E.2l){E.2l=C.1r(\'3C\');k.u.3c(E.2l,\'E-bk\');q R=k.5p();k.u.O(E.2l,{\'T\':\'1s\',\'1p\':\'1L\',\'L\':0,\'M\':0,\'z-1o\':(E.1B-1),\'H\':R.4f,\'N\':R.4e,\'4V-63\':E.J.93,\'16\':0});q 6D=C.1r(\'4W\');6D.1T=\'7b:"";\';k.u.O(6D,{\'H\':\'2h%\',\'N\':\'2h%\',\'1p\':\'1L\',\'4H\':\'9q()\',\'L\':0,\'bl\':0,\'T\':\'1s\',\'z-1o\':-1,\'1A\':\'2s\'});E.2l.1n(6D);C.Z.1n(E.2l);k.1i.3b(1g,\'bm\',v(){q R=k.5p();k.u.O(E.2l,{\'H\':R.H,\'N\':R.N});2N(v(){q R=k.5p();k.u.O(E.2l,{\'H\':R.4f,\'N\':R.4e})},1)})}1I k.3n(E.2l,{2I:E.J.7s,2p:k.2T.5v,4i:v(){k.u.O(E.2l,{\'1p\':\'1L\',\'16\':0})}}).3H({\'16\':[0,E.J.6w]})},9r:v(){1I k.3n(E.2l,{2I:E.J.7s,2p:k.2T.5v,3Y:v(){k.u.O(E.2l,{\'1p\':\'2s\'})}}).3H({\'16\':[E.J.6w,0]})}};E.6A=v(){7.4h.4t(7,1Z)};E.6A.29={4h:v(a,1k,2V,6t){7.J={};7.1F=a;7.1o=2V;7.1k=1k;7.2J=P;7.4X=P;7.5D=P;7.S=P;7.Q=P;7.1N=P;7.I=P;7.5E=[];7.5F=1a;7.4Y=1a;7.7y=V;7.6q=P;q 1m=1a;3v{1m=7.1F.36(\'1m\')[0]}3w(e){}m(1m){q aR=k.u.3X(1m)}U{q aR=k.u.3X(7.1F)}7.2x=C.1r(\'3C\');k.u.3c(7.2x,\'E-bn\');k.u.O(7.2x,{\'1p\':\'1L\',\'3R\':\'1t\',\'16\':E.J.97,\'T\':\'1s\',\'bo-9s\':\'bp\',\'1h\':\'1t\',\'91-H\':(aR.1b-aR.M-4)});m(k.1v.2Q&&k.1v.6a){k.u.O(7.2x,{\'H\':(aR.1b-aR.M-4)})}7.2x.1n(C.bq(E.J.96));C.Z.1n(7.2x);k.u.O(7.2x,{\'L\':1j.2g(aR.1q-(aR.1q-aR.L)/2-k.u.22(7.2x).N/2),\'M\':1j.2g(aR.1b-(aR.1b-aR.M)/2-k.u.22(7.2x).H/2)});7.7z=k.2o(v(e){m(!7.6q){k.1i.2w(e);k.u.O(7.2x,{\'1h\':\'2a\'});G}k.1i.3W(7.1F,\'2P\',7.7z);7.bs=1a},7);k.1i.3b(7.1F,\'2P\',7.7z);7.J=k.2F(7.J,6t);7.7A=k.2o(7.9t,7);m(E.J.99){7.9u()}},9e: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,{\'H\':1m.H,\'N\':1m.N});C.Z.2Z(1m)},3r,4l));4l.1T=k.u.1e(3r,\'4V-4m\').3E(/7C\\s*\\(\\s*\\"{0,1}([^\\"]*)\\"{0,1}\\s*\\)/i,\'$1\');m(k.1v.4O){q 6F=k.u.1e(3r,\'4V-4m\');6F=6F.3E(/7C\\s*\\(\\s*"(.*)"\\s*\\)/i,\'$1\');3r.B.1p=\'7D-1L\';k.u.O(3r,{\'z-1o\':1,\'T\':\'1U\'});3r.B.4H="8c:8d.8e.bx(1T=\'"+6F+"\', by=\'bz\')";3r.B.bA=\'2s\'}7.2W(1V,\'3l\',k.3m(v(e,w,h){k.u.O(7.2E,{\'M\':w,\'L\':h})},1V,w,-h));7.2W(1V,\'7E\',k.3m(v(e,w,h){k.u.O(7.2E,{\'M\':w,\'L\':0})},1V,w));7.2W(1V,\'2P\',k.3m(7.9x,7));m(\'6z\'==1V.3a&&/M/i.3k(7.J.4k||E.J.4k)&&7.1N.2E!==1V){1V=7.1N.9y(1V,7.1N.2E)}}m(k.1v.4O){7.51=C.1r(\'3C\');k.u.O(7.51,{\'T\':\'1s\',\'L\':-3q,\'z-1o\':4,\'H\':18,\'N\':18,\'4V-4m\':\'7C(\'+7.I.1T+\')\',\'1h\':\'2a\',\'1p\':\'1L\',\'4V-3p\':\'bB-3p\'});7.S.1n(7.51)}},9t:v(){v 60(4D){q 4E="";1x(i=0;i<4D.1c;i++){4E+=49.84(14^4D.85(i))}G 4E}v 6G(4J){q 9z=/\\[a([^\\]]+)\\](.*?)\\[\\/a\\]/bC;G 4J.3E(9z,"<a $1>$2</a>")}k.1i.3W(7.I,\'4b\',7.7A);7.S=C.1r("3C");k.u.O(7.S,{\'T\':\'1s\',\'1p\':\'1L\',\'1h\':\'1t\'});k.u.3c(7.S,\'E-bD\');C.Z.1n(7.S);7.1E=7.1F.36(\'1m\')[0];m(!7.1E){7.1E=C.1r(\'1m\');7.1E.1T=\'8j:4m/bE;bF,bG==\';k.u.O(7.1E,{\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\'1A-M-H\'))-K(k.u.1e(7.I,\'1A-1b-H\'))-K(k.u.1e(7.Q,\'1A-M-H\'))-K(k.u.1e(7.Q,\'1A-1b-H\')),\'2i-M\':7.Q.3B+K(k.u.1e(7.I,\'1A-M-H\')),\'2i-1b\':7.Q.4L+K(k.u.1e(7.I,\'1A-1b-H\'))});m(k.1v.2Q&&(C.21&&\'3A\'==C.21.2y())){k.u.O(7.Q,{\'H\':7.I.6J})}k.2F(7.Q,{\'2f\':k.u.22(7.Q).N});k.u.O(7.I,{1p:\'2s\'});m(\'1M\'!==4I(2t)){q 4J=60(2t[0]);q f=C.1r("3C");k.u.O(f,{\'1p\':\'7D\',\'3R\':\'1t\',\'1h\':\'2a\',\'63\':2t[1],\'6H-5G\':2t[2],\'6H-bM\':2t[3],\'6H-bN\':\'8g\',\'T\':\'1s\',\'H\':(7.I.6J*0.9),\'bO-9s\':\'1b\',\'1b\':15,\'L\':7.I.2f-20,\'z-1o\':10});f.2Y=4J;m(f.7F&&1==f.7F.bP){k.u.O(f.7F,{\'1p\':\'7D\',\'1h\':\'2a\',\'63\':2t[1]})}7.S.1n(f);k.u.O(f,{\'H\':\'90%\',\'L\':7.I.2f-k.u.22(f).N-8});7.4Y=f}m(V===(7.J.7u||E.J.7u)){7.2W(7.S,\'3l\',k.3m(7.6K,7,V));7.2W(7.S,\'7E\',k.3m(7.6K,7))}k.u.O(7.S,{\'1p\':\'2s\'});m(\'3l\'==7.J.4S){7.2W(7.1F,\'3l\',k.3m(v(e){k.1i.2w(e);7.6L=2N(k.2o(E.4U,E,1a,7.1o),7.J.6v*5x);7.2W(7.1F,\'7E\',k.3m(v(){k.1i.2w(e);m(7.6L){7n(7.6L);7.6L=P}},7))},7))}U{7.2W(7.1F,\'2P\',k.3m(E.4U,E,7.1o))}7.6q=V;C.Z.2Z(7.2x)},9C:v(R){q 6M=K(k.u.1e(7.S,\'2i-M\'))+K(k.u.1e(7.S,\'2i-1b\'))+K(k.u.1e(7.S,\'1A-M-H\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}}m(1W+1G.N+7.Q.2f>R.N+R.2c-15){1W=R.N+R.2c-15-1G.N-7.Q.2f}m(1W<R.2c+10){1W=R.2c+10}m(1X+1G.H>R.H+R.2b-15){1X=R.H+R.2b-1G.H-15}m(1X<R.2b+10){1X=R.2b+10}}G{\'L\':1W,\'M\':1X}},4U:v(1B){m(7.2J){7.5k();G P}m(!7.2J&&7.4X){G P}7.1B=1B;q R=k.5p();q 7G=k.u.3d(7.1E);k.2F(7.I,{\'5I\':7G.L,\'5J\':7G.M});q 7H={1p:\'1L\',\'T\':\'1s\',\'16\':7.J.4j?0:1,\'L\':7.I.5I,\'M\':7.I.5J,\'H\':\'3F\',\'N\':\'3F\'};m(E.J.98){7.I.3L=7.I.9A;7.I.41=7.I.2f;7.7I();7.9D(R);m(7.4Y){k.u.O(7.4Y,{\'H\':7.I.3L*0.9,\'L\':7.I.41-20});k.u.O(7.S,{\'1p\':\'1L\'});k.u.O(7.4Y,{\'H\':\'90%\',\'L\':7.I.41-k.u.22(7.4Y).N-8})}}k.2F(7H,{\'H\':7.I.6I});q 7J=7.9C(R);q 9E={\'16\':[(7.J.4j)?0:1,1],\'L\':[7.I.5I,7J.L],\'M\':[7.I.5J,7J.M],\'H\':[7.I.6I,7.I.3L]};1I k.3n(7.I,{2I:7.J.9c,2p:7.J.2p,4i:k.2o(v(){7.6E(P);k.u.O(7.I,7H);m(!7.J.4j){k.u.O(7.1E,{\'1h\':\'1t\'})}q f=E.3o();m(1M!=f){7.1B=f.1B+1}k.u.O(7.I,{\'z-1o\':7.1B});7.4n=C.1r(\'3C\');k.u.O(7.4n,{\'1p\':\'1L\',\'T\':\'1s\',\'L\':0,\'M\':0,\'z-1o\':-1,\'3R\':\'1t\',\'1A\':\'2s\',\'H\':\'2h%\',\'N\':\'2h%\'});7.4W=C.1r(\'4W\');7.4W.1T=\'7b: "";\';k.u.O(7.4W,{\'H\':\'2h%\',\'N\':\'2h%\',\'1A\':\'2s\',\'1p\':\'1L\',\'T\':\'9F\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u.22(7.S).N})}},7)}).3H({\'5u-L\':[-7.Q.2f,0]})},6K:v(e,2k){m(e){k.1i.2w(e)}2k=2k||P;q 3s=k.u.3X(7.S);q 2G=(C.21&&\'3A\'!=C.21.2y())?C.1P:C.Z;q 52=e.3N+K((2d.46)?2d.46:2G.2K);q 53=e.3M+K((2d.45)?2d.45:2G.2L);q 3t=/3l/i.3k(e.9I);q 42=k.u.1e(7.1N,\'1h\');m((!3t||\'1t\'!=42)&&(52>3s.M&&52<3s.1b)&&(53>3s.L&&53<3s.1q)){G}m(3t&&\'1t\'!=42&&!2k){G}m(!3t&&\'1t\'==42){G}q 6O=(2k||3t)?[0,1]:[1,0];1I k.3n(7.1N,{2I:0.3,2p:k.2T.5v}).3H({\'16\':6O});G},9x:v(e){q o=e.bR||e.bS;3j(o&&\'a\'!=o.31.2y()){o=o.59}q 7K=V;5g(o.3a){1y\'6y\':7.3Z(1a,E.7x(7.1k));1w;1y\'3J\':7.3Z(1a,E.7w(7.1k));1w;1y\'6z\':7.3Z(1a);1w;78:7K=P}m(7K){k.1i.2w(e)}G P},6E:v(2k){2k=(1M!==2k)?2k:V;m(k.u.6l(7.1F,\'25\')){3v{m(2k){7.1F.1C.4v=P}U{7.1F.1C.4C();7.1F.1C.4v=V}}3w(e){}}},9D:v(R){q 6M=K(k.u.1e(7.S,\'2i-M\'))+K(k.u.1e(7.S,\'2i-1b\'))+K(k.u.1e(7.S,\'1A-M-H\'))+K(k.u.1e(7.S,\'1A-1b-H\')),6N=K(k.u.1e(7.S,\'2i-L\'))+K(k.u.1e(7.S,\'2i-1q\'))+K(k.u.1e(7.S,\'1A-L-H\'))+K(k.u.1e(7.S,\'1A-1q-H\'));q x=1j.9J(7.I.3L,R.H-35-6M),y=1j.9J(7.I.41,R.N-35-6N-7.Q.2f);m(x/y>7.I.5K){x=y*7.I.5K}U m(x/y<7.I.5K){y=x/7.I.5K}7.I.3L=1j.9K(x);7.I.41=1j.9K(y);7.7I()},7I:v(){k.u.O(7.Q,{\'H\':7.I.3L-7.Q.3B-7.Q.4L-K(k.u.1e(7.Q,\'1A-M-H\'))-K(k.u.1e(7.Q,\'1A-1b-H\'))});k.u.O(7.S,{\'L\':-3q,\'1p\':\'1L\'});k.2F(7.Q,{\'2f\':k.u.22(7.Q).N});k.u.O(7.S,{\'1p\':\'2s\'})}};m(k.1v.4O){E.6A.29.6K=v(e,2k){m(e){k.1i.2w(e)}2k=2k||P;q 3s=k.u.3X(7.S);q 2G=(C.21&&\'3A\'!=C.21.2y())?C.1P:C.Z;q 52=e.3N+K((2d.46)?2d.46:2G.2K);q 53=e.3M+K((2d.45)?2d.45:2G.2L);q 3t=/3l/i.3k(e.9I);q 42=k.u.1e(7.51,\'1h\');m((!3t||!(\'1t\'!=42))&&(52>3s.M&&52<3s.1b)&&(53>3s.L&&53<3s.1q)){G}m(3t&&!(\'1t\'!=42)&&!2k){G}m(!3t&&\'1t\'!=42){G}q 6O=(2k||3t)?[1,0]:[0,1];1I k.3n(7.51,{2I:0.3,2p:k.2T.5v}).3H({\'16\':6O});G};3v{C.8r(\'8s\',P,V)}3w(e){}}k.1i.3b(C,\'8C\',v(){E.4h()});',62,737,'|||||||this|||||||||||||MagicTools||if||||var||||Element|function||||||style|document||MagicThumb|el|return|width|bigImg|options|parseInt|top|left|height|setStyle|false|caption|ps|cont|position|else|true||bigImageCont|aels|body||||event|||opacity|settings|||null|right|length|smallImage|getStyle|MagicZoom_ua|window|visibility|Event|Math|group|bigImage|img|appendChild|index|display|bottom|createElement|absolute|hidden|px|browser|break|for|case|matches|border|zIndex|zoom|pup|smallImg|anchor|imgSize|MagicZoom_getStyle|new|0px|smallImageCont|block|undefined|controlbar|id|documentElement|pos|items|msie|src|relative|cbA|destTop|destLeft|args|arguments||compatMode|getSize||sRect|MagicZoom|smallImageSizeX||loadingCont|prototype|visible|scrollX|scrollY|self|zoomPositionOffset|fullHeight|round|100|padding|bigCont|show|bgFader|smallImageSizeY|tag|bind|transition|indexOf|popupSizeX|none|gd56f7fsgd|re|val|stop|loader|toLowerCase|opera|obj|smallY|smallX|popupSizeY|firstChild|extend|ieBody|handler|duration|zoomed|scrollLeft|scrollTop|bigImageSizeY|setTimeout|title|click|ie|styles|elStyle|Transition|zoomPosition|idx|addEvent|className|innerHTML|removeChild||tagName|||||getElementsByTagName||||rel|add|addClass|getPosition|thumbs|activeIndexes|MagicZoom_addEventListener|MagicZoom_createMethodReference|bigImageSizeX|while|test|mouseover|bindAsEvent|Render|getFocused|repeat|9999|cbBgWrapper|rect|ov|MagicZoom_|try|catch|result|push|positionX|backcompat|paddingLeft|div|arr|replace|auto|ft|start|item|next|getItem|displayWidth|clientY|clientX|header|positionY|bigImageContStyleTop|overflow|IMG|href|RegExp|exec|remove|getRect|onComplete|collapse||displayHeight|vis|safari|MagicZoom_zooms|pageYOffset|pageXOffset|object|drag_mode|String|parseFloat|load|ael|rand|pageHeight|pageWidth|klass|init|onStart|keepThumbnail|controlbarPosition|bgIMG|image|overlap|gecko|currentStyle|css|listener|on|apply|MagicZoom_stopEventPropagation|recalculating|loadingImg|center|loadingText|alt|mousemove|custom|hiderect|vc67|vc68|bigImage_always_visible|10000px|filter|typeof|str|initZoom|paddingRight|refresh|iels|ie6|now|onDomReadyTimer|onDomReady|zoomTrigger|captionSlideDuration|expand|background|iframe|rendering|cr|buttons||cbOverlay|eX|eY|navigator|userAgent|wx|wy|DIV|offsetParent|borderLeftWidth|cursor|pleft|ptop|perX|headerH|switch|zoomWidth|zoomHeight|newBigImage|focus|thumb_change|pop|inArray|len|getPageSize|xScroll|yScroll|innerHeight|onDomReadyList|margin|linear|timer|1000|dx|to_css|captionSrc|getGroupItems|onKey|hasCaption|eventsCache|initTimer|size|sd|initTop|initLeft|ratio|cbSize|nextThumb|hide|Array|styleProp|MagicZoom_getBounds|in|attachEvent|safariOnLoadStarted|checkcoords|offsetTop|offsetLeft|paddingTop|mousedown|perY|xgdf7fsgd56|MagicZoomHeader|ar1|color|complete|offsetWidth|offsetHeight|inner|mzextend|delete|backCompatMode|domLoaded|__method|shift|innerWidth|scrollWidth|windowWidth|windowHeight|clientHeight|createEvent|camelize|hasClass|removeClass|continue|sin|pow|loaded|callee|defaults|opt|from|zoomTriggerDelay|backgroundFadingOpacity|span|prev|close|Item|keydown|fixCursor|frame|toggleMZ|bgURL|formatCaptionText|font|initWidth|completeWidth|toggleControlBar|hoverTimer|padW|padH|op|getComputedStyle|defaultView|MagicZoom_getEventBounds|MagicView_ia|MagicZoom_extendElement|property|addEventListener|MagicZoom_removeEventListener|removeEventListener|sequence|cancelBubble|preventDefault|stopPropagation|version|checkcoords_ref|mousemove_ref||borderTopWidth|mouseup|default|showrect|recalculatePopupDimensions|javascript|replaceZoom|outline|results|props|concat|clientWidth|fire|evType|evName|float|quadIn|clearTimeout|calc|startTime|render|allowMultipleImages|backgroundFadingDuration|useCtrlKey|controlbarEnable|controlbarButtons|getNext|getPrev|firstRun|preventClick|onImgLoad|cbBtn|url|inline|mouseout|lastChild|startPosition|startProps|resizeCaption|destPos|stopEvent|getElementById|getBoundingClientRect|detachEvent|MagicZoom_concat|MagicZoom_withoutFirst|skip|methodName|smallImageContId|smallImageId|bigImageContId|bigImageId|MagicZoomLoading|textAlign|stopZoom|big||BODY|HTML|move|fromCharCode|charCodeAt|initPopup|html|alpha||initBigContainer|bigimgsrc|progid|DXImageTransform|Microsoft|borderWidth|Tahoma|parentNode|rev|data|MagicZoom_findSelectors|blur|MagicZoom_findZooms|Loading|sim|436px|bim|execCommand|BackgroundImageCache|XMLHttpRequest|webkit|toArray|arglen|arrlen|isBody|scrollMaxX|scrollMaxY|scrollHeight|domready|bindDomReady|dispatchEvent|trim|m2|cssFloat|Top|Bottom|Left|Right|addpx|setOpacity|styleFloat|getScrolls|cos|PI|cubicIn|backIn|DOMContentLoaded|styleSheets|fps|onBeforeRender|finishTime|loop||max|1001|backgroundFadingColor|allowKeyboard|disableContextMenu|loadingMsg|loadingOpacity|fitToScreen|autoInit|cbButtons|thumbIndex|expandDuration|collapseDuration|destroy|setFocused|splice|unsetFocused|getFirst|getLast|code|ctrlKey|metaKey|console|pointer|fadeInBackground|mask|fadeOutBackground|align|prepare|preload|evt|cbLength|onCBClick|insertBefore|pat|fullWidth|initHeight|adjustPosition|resizeImage|effectProps|static|MouseEvents|toggleCaption|type|min|ceil|mozilla|layerImageSizeX|layerImageSizeY|popupSizey|baseuri|dir|rtl|MagicZoomPup|moz|Opacity|unselectable|MozUserSelect|onselectstart|oncontextmenu|IFRAME|Alpha|frameBorder|3px|fontSize|fontWeight|fontFamily|paddingBottom|borderRightWidth|replaceChild|selectThisZoom|MagicZoom_stopZooms|Zoom|throw|Invalid|invocation|random|1000000|textDecoration|sc|thumb|change|drag|mode|always|MagicZoomBigImageCont|ie7|ActiveXObject|AppleWebKit||Gecko|KHTML|mobilesafari|match|Apple|Mobile|Safari|string|Date|getTime|viewWidth|viewHeight|call|returnValue|initEvent|createEventObject|eventType|fireEvent|m1|toUpperCase|Width|number|hasLayout|do||update|quadOut|cubicOut|618|backOut|elastic|readyState|doScroll|disabled|duraton|state|curFrame|setInterval|clearInterval|04|000000|250|Previous|Next|Close||zoomDuration|restoreDuration|contextmenu|sort|keyCode|warn|description|bgfader|lef|resize|loading|vertical|middle|createTextNode||peventClick|createControlBar|icons|999||AlphaImageLoader|sizingMethod|crop|backgroundImage|no|ig|container|gif|base64|R0lGODlhAQABAIAAACqk1AAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw|amp|lt|gt|line|completeHeight|weight|family|text|nodeType|collapseEvent|currentTarget|srcElement'.split('|'),0,{}))
