From abdf67268aaa7487634c0a6074dd1dc9def5688b Mon Sep 17 00:00:00 2001 From: Ryan Hoerr Date: Mon, 19 Aug 2024 22:15:51 -0400 Subject: [PATCH 1/2] Security changes from upstream 2.4.7-p2 --- .../Option/Type/File/ValidatorInfo.php | 11 +- ...ontAssertActiveProductImageActionGroup.xml | 2 +- .../Test/Mftf/Test/EndToEndB2CAdminTest.xml | 2 +- .../Config/Model/Config/Backend/File.php | 6 +- .../Customer/Model/Plugin/UpdateCustomer.php | 4 +- .../Model/Customer/ValidateCustomerData.php | 70 --------- .../Command/UpdateEncryptionKeyCommand.php | 135 ++++++++++++++++++ app/code/Magento/EncryptionKey/etc/di.xml | 7 + .../Adminhtml/Export/File/Download.php | 17 ++- .../Controller/Adminhtml/History/Download.php | 28 +++- .../Adminhtml/History/DownloadTest.php | 28 +++- .../Adminhtml/Integration/Edit/Tab/Info.php | 22 +-- .../Controller/Adminhtml/Integration.php | 28 +++- .../Controller/Adminhtml/Integration/Save.php | 16 ++- app/code/Magento/Integration/i18n/en_US.csv | 1 + .../Model/SecretBasedJwksFactory.php | 3 + .../Newsletter/Controller/Adminhtml/Queue.php | 11 +- ...inPayPalPayflowProWithValutActionGroup.xml | 8 +- ...owProCreditCardFromCustomerAccountTest.xml | 4 +- ...ProCreditCardForRegisteredCustomerTest.xml | 4 +- app/code/Magento/Quote/i18n/en_US.csv | 1 + .../Controller/Adminhtml/Report/Review.php | 44 +++--- .../Controller/Adminhtml/Report/Sales.php | 46 +++--- .../Sales/Block/Adminhtml/Order/View.php | 10 +- .../Adminhtml/Order/Creditmemo/Cancel.php | 5 +- .../Adminhtml/Order/Creditmemo/NewAction.php | 2 +- .../Adminhtml/Order/Creditmemo/Save.php | 5 +- .../Adminhtml/Order/Creditmemo/Start.php | 2 +- .../Adminhtml/Order/Creditmemo/UpdateQty.php | 2 +- .../Adminhtml/Order/Creditmemo/VoidAction.php | 5 +- .../Order/Create/SidebarPermissionCheck.php | 42 ++++++ .../layout/sales_order_create_index.xml | 3 + .../sales_order_create_load_block_data.xml | 3 + .../sales_order_create_load_block_sidebar.xml | 3 + .../templates/order/create/sidebar.phtml | 22 ++- .../Adminhtml/Order/Shipment/NewAction.php | 2 +- .../Adminhtml/Order/Shipment/Save.php | 2 +- .../Adminhtml/Order/Shipment/Start.php | 2 +- app/code/Magento/Shipping/etc/acl.xml | 2 +- .../Controller/Adminhtml/Rate.php | 5 +- .../Controller/Adminhtml/Rate/ExportPost.php | 19 +-- .../Controller/Adminhtml/Rate/ImportPost.php | 21 +-- .../view/adminhtml/layout/tax_rule_edit.xml | 3 +- .../adminhtml/Magento/backend/i18n/en_US.csv | 1 + .../frontend/Magento/blank/i18n/en_US.csv | 1 + .../frontend/Magento/luma/i18n/en_US.csv | 1 + composer.lock | 14 +- .../Adminhtml/Order/Creditmemo/SaveTest.php | 5 + .../Adminhtml/Order/Shipment/SaveTest.php | 8 +- .../Test/Js/_files/blacklist/magento.txt | 2 + lib/web/legacy-build.min.js | 4 +- lib/web/prototype/prototype.js | 6 +- pub/media/.htaccess | 2 +- 53 files changed, 469 insertions(+), 233 deletions(-) delete mode 100644 app/code/Magento/CustomerGraphQl/Model/Customer/ValidateCustomerData.php create mode 100644 app/code/Magento/EncryptionKey/Console/Command/UpdateEncryptionKeyCommand.php create mode 100644 app/code/Magento/Sales/ViewModel/Order/Create/SidebarPermissionCheck.php diff --git a/app/code/Magento/Catalog/Model/Product/Option/Type/File/ValidatorInfo.php b/app/code/Magento/Catalog/Model/Product/Option/Type/File/ValidatorInfo.php index 4c4daccb9017..8afbdf7425ca 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Type/File/ValidatorInfo.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Type/File/ValidatorInfo.php @@ -49,6 +49,7 @@ class ValidatorInfo extends Validator * @var IoFile */ private $ioFile; + /** * @var NotProtectedExtension */ @@ -147,12 +148,14 @@ private function validatePath(array $optionValuePath): bool { foreach ([$optionValuePath['quote_path'], $optionValuePath['order_path']] as $path) { $pathInfo = $this->ioFile->getPathInfo($path); - if (isset($pathInfo['extension'])) { - if (!$this->fileValidator->isValid($pathInfo['extension'])) { - return false; - } + + if (isset($pathInfo['extension']) + && (empty($pathInfo['extension']) || !$this->fileValidator->isValid($pathInfo['extension'])) + ) { + return false; } } + return true; } diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertActiveProductImageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertActiveProductImageActionGroup.xml index 0e7da54bd402..c2f0b7f11636 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertActiveProductImageActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertActiveProductImageActionGroup.xml @@ -12,6 +12,6 @@ - + diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CAdminTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CAdminTest.xml index 393a45f0973d..6d44eed04c1e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CAdminTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CAdminTest.xml @@ -216,7 +216,7 @@ - + diff --git a/app/code/Magento/Config/Model/Config/Backend/File.php b/app/code/Magento/Config/Model/Config/Backend/File.php index 6a6b0257f7b3..560ce351e69a 100644 --- a/app/code/Magento/Config/Model/Config/Backend/File.php +++ b/app/code/Magento/Config/Model/Config/Backend/File.php @@ -278,8 +278,10 @@ protected function _getAllowedExtensions() */ private function setValueAfterValidation(string $value): void { - // avoid intercepting value - if (preg_match('/[^a-z0-9_\/\\-\\.]+/i', $value)) { + if (preg_match('/[^a-z0-9_\/\\-\\.]+/i', $value) + // phpcs:ignore Magento2.Functions.DiscouragedFunction + || !$this->_mediaDirectory->isFile($this->_getUploadDir() . DIRECTORY_SEPARATOR . basename($value)) + ) { throw new LocalizedException(__('Invalid file name')); } diff --git a/app/code/Magento/Customer/Model/Plugin/UpdateCustomer.php b/app/code/Magento/Customer/Model/Plugin/UpdateCustomer.php index e8d4bdaec2d2..1436453a88fb 100644 --- a/app/code/Magento/Customer/Model/Plugin/UpdateCustomer.php +++ b/app/code/Magento/Customer/Model/Plugin/UpdateCustomer.php @@ -63,7 +63,9 @@ public function beforeSave( $customerId === $customerSessionId ) { $customer = $this->getUpdatedCustomer($customerRepository->getById($customerId), $customer); - } elseif ($userType === UserContextInterface::USER_TYPE_ADMIN && $customerId) { + } elseif ($customerId && in_array($userType, [UserContextInterface::USER_TYPE_ADMIN, + UserContextInterface::USER_TYPE_INTEGRATION], true) + ) { $customer = $this->getUpdatedCustomer($customerRepository->getById($customerId), $customer); } diff --git a/app/code/Magento/CustomerGraphQl/Model/Customer/ValidateCustomerData.php b/app/code/Magento/CustomerGraphQl/Model/Customer/ValidateCustomerData.php deleted file mode 100644 index 95d68d69d71e..000000000000 --- a/app/code/Magento/CustomerGraphQl/Model/Customer/ValidateCustomerData.php +++ /dev/null @@ -1,70 +0,0 @@ -getAllowedCustomerAttributes = $getAllowedCustomerAttributes; - $this->emailAddressValidator = $emailAddressValidator; - $this->validators = $validators; - } - - /** - * Validate customer data - * - * @param array $customerData - * @throws GraphQlInputException - * @throws LocalizedException - * @throws NoSuchEntityException - */ - public function execute(array $customerData) - { - /** @var ValidateCustomerDataInterface $validator */ - foreach ($this->validators as $validator) { - $validator->execute($customerData); - } - } -} diff --git a/app/code/Magento/EncryptionKey/Console/Command/UpdateEncryptionKeyCommand.php b/app/code/Magento/EncryptionKey/Console/Command/UpdateEncryptionKeyCommand.php new file mode 100644 index 000000000000..cd6ffb432316 --- /dev/null +++ b/app/code/Magento/EncryptionKey/Console/Command/UpdateEncryptionKeyCommand.php @@ -0,0 +1,135 @@ +encryptor = $encryptor; + $this->cache = $cache; + $this->writer = $writer; + $this->random = $random; + + parent::__construct(); + } + + /** + * @inheritDoc + */ + protected function configure() + { + $this->setName('encryption:key:change'); + $this->setDescription('Change the encryption key inside the env.php file.'); + $this->addOption( + 'key', + 'k', + InputOption::VALUE_OPTIONAL, + 'Key has to be a 32 characters long string. If not provided, a random key will be generated.' + ); + + parent::configure(); + } + + /** + * @inheritDoc + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + try { + $key = $input->getOption('key'); + + if (!empty($key)) { + $this->encryptor->validateKey($key); + } + + $this->updateEncryptionKey($key); + $this->cache->clean(); + + $output->writeln('Encryption key has been updated successfully.'); + + return Command::SUCCESS; + } catch (\Exception $e) { + $output->writeln('' . $e->getMessage() . ''); + return Command::FAILURE; + } + } + + /** + * Update encryption key + * + * @param string|null $key + * @return void + * @throws FileSystemException + */ + private function updateEncryptionKey(string $key = null): void + { + // prepare new key, encryptor and new configuration segment + if (!$this->writer->checkIfWritable()) { + throw new FileSystemException(__('Deployment configuration file is not writable.')); + } + + if (null === $key) { + $key = ConfigOptionsListConstants::STORE_KEY_ENCODED_RANDOM_STRING_PREFIX . + $this->random->getRandomBytes(ConfigOptionsListConstants::STORE_KEY_RANDOM_STRING_SIZE); + } + + $this->encryptor->setNewKey($key); + + $encryptSegment = new ConfigData(ConfigFilePool::APP_ENV); + $encryptSegment->set(ConfigOptionsListConstants::CONFIG_PATH_CRYPT_KEY, $this->encryptor->exportKeys()); + + $configData = [$encryptSegment->getFileKey() => $encryptSegment->getData()]; + + $this->writer->saveConfig($configData); + } +} diff --git a/app/code/Magento/EncryptionKey/etc/di.xml b/app/code/Magento/EncryptionKey/etc/di.xml index b4e471f4e40e..495234759a7f 100644 --- a/app/code/Magento/EncryptionKey/etc/di.xml +++ b/app/code/Magento/EncryptionKey/etc/di.xml @@ -11,4 +11,11 @@ Magento\Config\Model\Config\Structure\Proxy + + + + Magento\EncryptionKey\Console\Command\UpdateEncryptionKeyCommand + + + diff --git a/app/code/Magento/ImportExport/Controller/Adminhtml/Export/File/Download.php b/app/code/Magento/ImportExport/Controller/Adminhtml/Export/File/Download.php index 75022e2b8ad9..d23dc61e497e 100644 --- a/app/code/Magento/ImportExport/Controller/Adminhtml/Export/File/Download.php +++ b/app/code/Magento/ImportExport/Controller/Adminhtml/Export/File/Download.php @@ -16,6 +16,8 @@ use Magento\Framework\Filesystem; use Magento\ImportExport\Model\LocalizedFileName; use Throwable; +use Magento\Framework\Controller\Result\Redirect; +use Magento\Framework\App\ResponseInterface; /** * Controller that download file by name. @@ -25,7 +27,7 @@ class Download extends ExportController implements HttpGetActionInterface /** * Url to this controller */ - const URL = 'adminhtml/export_file/download/'; + public const URL = 'adminhtml/export_file/download/'; /** * @var FileFactory @@ -64,13 +66,24 @@ public function __construct( /** * Controller basic method implementation. * - * @return \Magento\Framework\Controller\Result\Redirect | \Magento\Framework\App\ResponseInterface + * @return Redirect|ResponseInterface */ public function execute() { $resultRedirect = $this->resultRedirectFactory->create(); $resultRedirect->setPath('adminhtml/export/index'); + $fileName = $this->getRequest()->getParam('filename'); + + if (empty($fileName)) { + $this->messageManager->addErrorMessage(__('Please provide valid export file name')); + + return $resultRedirect; + } + + // phpcs:ignore Magento2.Functions.DiscouragedFunction + $fileName = basename($fileName); + $exportDirectory = $this->filesystem->getDirectoryRead(DirectoryList::VAR_IMPORT_EXPORT); try { diff --git a/app/code/Magento/ImportExport/Controller/Adminhtml/History/Download.php b/app/code/Magento/ImportExport/Controller/Adminhtml/History/Download.php index 6fd229f26a1a..f6dbf4eaa443 100644 --- a/app/code/Magento/ImportExport/Controller/Adminhtml/History/Download.php +++ b/app/code/Magento/ImportExport/Controller/Adminhtml/History/Download.php @@ -3,11 +3,18 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + +declare(strict_types=1); + namespace Magento\ImportExport\Controller\Adminhtml\History; use Magento\Framework\App\Action\HttpGetActionInterface; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Controller\ResultInterface; +use Magento\ImportExport\Helper\Report; use Magento\ImportExport\Model\Import; +use Magento\Framework\Controller\Result\Redirect; +use Magento\Framework\App\ResponseInterface; /** * Download history controller @@ -44,20 +51,27 @@ public function __construct( /** * Download backup action * - * @return void|\Magento\Backend\App\Action + * @return ResponseInterface|Redirect|ResultInterface + * @throws \Exception */ public function execute() { + $resultRedirect = $this->resultRedirectFactory->create(); + $resultRedirect->setPath('*/history'); + + $fileName = $this->getRequest()->getParam('filename'); + + if (empty($fileName)) { + return $resultRedirect; + } + // phpcs:ignore Magento2.Functions.DiscouragedFunction - $fileName = basename($this->getRequest()->getParam('filename')); + $fileName = basename($fileName); - /** @var \Magento\ImportExport\Helper\Report $reportHelper */ - $reportHelper = $this->_objectManager->get(\Magento\ImportExport\Helper\Report::class); + /** @var Report $reportHelper */ + $reportHelper = $this->_objectManager->get(Report::class); if (!$reportHelper->importFileExists($fileName)) { - /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */ - $resultRedirect = $this->resultRedirectFactory->create(); - $resultRedirect->setPath('*/history'); return $resultRedirect; } diff --git a/app/code/Magento/ImportExport/Test/Unit/Controller/Adminhtml/History/DownloadTest.php b/app/code/Magento/ImportExport/Test/Unit/Controller/Adminhtml/History/DownloadTest.php index 7c8e06d3f681..ba4bb9c53de6 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Controller/Adminhtml/History/DownloadTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Controller/Adminhtml/History/DownloadTest.php @@ -8,13 +8,13 @@ namespace Magento\ImportExport\Test\Unit\Controller\Adminhtml\History; use Magento\Backend\App\Action\Context; -use Magento\Backend\Model\View\Result\Redirect; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\App\Request\Http; use Magento\Framework\App\Response\Http\FileFactory; use Magento\Framework\App\ResponseInterface; use Magento\Framework\Controller\Result\Raw; use Magento\Framework\Controller\Result\RawFactory; +use Magento\Framework\Controller\Result\Redirect; use Magento\Framework\Controller\Result\RedirectFactory; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; use Magento\ImportExport\Controller\Adminhtml\History\Download; @@ -181,8 +181,7 @@ public function executeDataProvider() { return [ 'Normal file name' => ['filename.csv', 'filename.csv'], - 'Relative file name' => ['../../../../../../../../etc/passwd', 'passwd'], - 'Empty file name' => ['', ''], + 'Relative file name' => ['../../../../../../../../etc/passwd', 'passwd'] ]; } @@ -196,4 +195,27 @@ public function testExecuteFileNotFound() $this->resultRaw->expects($this->never())->method('setContents'); $this->downloadController->execute(); } + + /** + * Test execute() with return Redirect + * @param string|null $requestFilename + * @dataProvider executeWithRedirectDataProvider + */ + public function testExecuteWithRedirect(?string $requestFilename): void + { + $this->request->method('getParam')->with('filename')->willReturn($requestFilename); + $this->resultRaw->expects($this->never())->method('setContents'); + $this->assertSame($this->redirect, $this->downloadController->execute()); + } + + /** + * @return array + */ + public function executeWithRedirectDataProvider(): array + { + return [ + 'null file name' => [null], + 'empty file name' => [''], + ]; + } } diff --git a/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit/Tab/Info.php b/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit/Tab/Info.php index 89cad471933e..b97182156d3e 100644 --- a/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit/Tab/Info.php +++ b/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit/Tab/Info.php @@ -3,6 +3,9 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + +declare(strict_types=1); + namespace Magento\Integration\Block\Adminhtml\Integration\Edit\Tab; use Magento\Integration\Controller\Adminhtml\Integration; @@ -19,23 +22,23 @@ class Info extends \Magento\Backend\Block\Widget\Form\Generic implements \Magent /**#@+ * Form elements names. */ - const HTML_ID_PREFIX = 'integration_properties_'; + public const HTML_ID_PREFIX = 'integration_properties_'; - const DATA_ID = 'integration_id'; + public const DATA_ID = 'integration_id'; - const DATA_NAME = 'name'; + public const DATA_NAME = 'name'; - const DATA_EMAIL = 'email'; + public const DATA_EMAIL = 'email'; - const DATA_ENDPOINT = 'endpoint'; + public const DATA_ENDPOINT = 'endpoint'; - const DATA_IDENTITY_LINK_URL = 'identity_link_url'; + public const DATA_IDENTITY_LINK_URL = 'identity_link_url'; - const DATA_SETUP_TYPE = 'setup_type'; + public const DATA_SETUP_TYPE = 'setup_type'; - const DATA_CONSUMER_ID = 'consumer_id'; + public const DATA_CONSUMER_ID = 'consumer_id'; - const DATA_CONSUMER_PASSWORD = 'current_password'; + public const DATA_CONSUMER_PASSWORD = 'current_password'; /**#@-*/ @@ -161,6 +164,7 @@ protected function _addGeneralFieldset($form, $integrationData) 'label' => __('Identity link URL'), 'name' => self::DATA_IDENTITY_LINK_URL, 'disabled' => $disabled, + 'class' => 'validate-url', 'note' => __( 'URL to redirect user to link their 3rd party account with this Magento integration credentials.' ) diff --git a/app/code/Magento/Integration/Controller/Adminhtml/Integration.php b/app/code/Magento/Integration/Controller/Adminhtml/Integration.php index c061911f804e..11508f8bc4d0 100644 --- a/app/code/Magento/Integration/Controller/Adminhtml/Integration.php +++ b/app/code/Magento/Integration/Controller/Adminhtml/Integration.php @@ -3,10 +3,14 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + +declare(strict_types=1); + namespace Magento\Integration\Controller\Adminhtml; use Magento\Backend\App\Action; -use Magento\Integration\Api\OauthServiceInterface as IntegrationOauthService; +use Magento\Framework\Url\Validator; +use Magento\Framework\App\ObjectManager; /** * Controller for integrations management. @@ -20,18 +24,18 @@ abstract class Integration extends Action * * @see _isAllowed() */ - const ADMIN_RESOURCE = 'Magento_Integration::integrations'; + public const ADMIN_RESOURCE = 'Magento_Integration::integrations'; /** Param Key for extracting integration id from Request */ - const PARAM_INTEGRATION_ID = 'id'; + public const PARAM_INTEGRATION_ID = 'id'; /** Reauthorize flag is used to distinguish activation from reauthorization */ - const PARAM_REAUTHORIZE = 'reauthorize'; + public const PARAM_REAUTHORIZE = 'reauthorize'; - const REGISTRY_KEY_CURRENT_INTEGRATION = 'current_integration'; + public const REGISTRY_KEY_CURRENT_INTEGRATION = 'current_integration'; /** Saved API form data session key */ - const REGISTRY_KEY_CURRENT_RESOURCE = 'current_resource'; + public const REGISTRY_KEY_CURRENT_RESOURCE = 'current_resource'; /** * @var \Magento\Framework\Registry @@ -73,6 +77,11 @@ abstract class Integration extends Action */ protected $escaper; + /** + * @var Validator + */ + protected $urlValidator; + /** * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Framework\Registry $registry @@ -83,6 +92,9 @@ abstract class Integration extends Action * @param \Magento\Integration\Helper\Data $integrationData * @param \Magento\Framework\Escaper $escaper * @param \Magento\Integration\Model\ResourceModel\Integration\Collection $integrationCollection + * @param Validator|null $urlValidator + * + * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\Backend\App\Action\Context $context, @@ -93,7 +105,8 @@ public function __construct( \Magento\Framework\Json\Helper\Data $jsonHelper, \Magento\Integration\Helper\Data $integrationData, \Magento\Framework\Escaper $escaper, - \Magento\Integration\Model\ResourceModel\Integration\Collection $integrationCollection + \Magento\Integration\Model\ResourceModel\Integration\Collection $integrationCollection, + Validator $urlValidator = null ) { parent::__construct($context); $this->_registry = $registry; @@ -104,6 +117,7 @@ public function __construct( $this->_integrationData = $integrationData; $this->escaper = $escaper; $this->_integrationCollection = $integrationCollection; + $this->urlValidator = $urlValidator ?: ObjectManager::getInstance()->get(Validator::class); parent::__construct($context); } diff --git a/app/code/Magento/Integration/Controller/Adminhtml/Integration/Save.php b/app/code/Magento/Integration/Controller/Adminhtml/Integration/Save.php index ac237750e715..f3af359ab5df 100644 --- a/app/code/Magento/Integration/Controller/Adminhtml/Integration/Save.php +++ b/app/code/Magento/Integration/Controller/Adminhtml/Integration/Save.php @@ -3,6 +3,9 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + +declare(strict_types=1); + namespace Magento\Integration\Controller\Adminhtml\Integration; use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface; @@ -30,6 +33,7 @@ class Save extends \Magento\Integration\Controller\Adminhtml\Integration impleme * * @return SecurityCookie * @deprecated 100.1.0 + * @see we don't recommend this approach anymore */ private function getSecurityCookie() { @@ -76,7 +80,7 @@ public function execute() $this->messageManager->addErrorMessage($this->escaper->escapeHtml($e->getMessage())); $this->_getSession()->setIntegrationData($this->getRequest()->getPostValue()); $this->_redirectOnSaveError(); - } catch (\Magento\Framework\Exception\LocalizedException $e) { + } catch (LocalizedException $e) { $this->messageManager->addErrorMessage($this->escaper->escapeHtml($e->getMessage())); $this->_redirectOnSaveError(); } catch (\Exception $e) { @@ -148,6 +152,8 @@ protected function _redirectOnSaveError() * * @param array $integrationData * @return void + * @throws IntegrationException + * @throws LocalizedException */ private function processData($integrationData) { @@ -157,7 +163,15 @@ private function processData($integrationData) if (!isset($data['resource'])) { $integrationData['resource'] = []; } + $integrationData = array_merge($integrationData, $data); + + // Check if the Identity Link URL field is not empty and then validate it + $url = $integrationData[Info::DATA_IDENTITY_LINK_URL] ?? null; + if (!empty($url) && !$this->urlValidator->isValid($url)) { + throw new LocalizedException(__('Invalid Identity Link URL')); + } + if (!isset($integrationData[Info::DATA_ID])) { $integration = $this->_integrationService->create($integrationData); } else { diff --git a/app/code/Magento/Integration/i18n/en_US.csv b/app/code/Magento/Integration/i18n/en_US.csv index b225ad2766ff..e26d36157ff0 100644 --- a/app/code/Magento/Integration/i18n/en_US.csv +++ b/app/code/Magento/Integration/i18n/en_US.csv @@ -125,3 +125,4 @@ OAuth,OAuth "Integrations API configuration file","Integrations API configuration file" "We couldn't find any records.","We couldn't find any records." Status,Status +"Invalid Identity Link URL", "Invalid Identity Link URL" diff --git a/app/code/Magento/JwtUserToken/Model/SecretBasedJwksFactory.php b/app/code/Magento/JwtUserToken/Model/SecretBasedJwksFactory.php index 5032db90aba3..b6941b067b32 100644 --- a/app/code/Magento/JwtUserToken/Model/SecretBasedJwksFactory.php +++ b/app/code/Magento/JwtUserToken/Model/SecretBasedJwksFactory.php @@ -35,6 +35,7 @@ class SecretBasedJwksFactory public function __construct(DeploymentConfig $deploymentConfig, JwkFactory $jwkFactory) { $this->keys = preg_split('/\s+/s', trim((string)$deploymentConfig->get('crypt/key'))); + $this->keys = [end($this->keys)]; //Making sure keys are large enough. foreach ($this->keys as &$key) { $key = str_pad($key, 2048, '&', STR_PAD_BOTH); @@ -48,6 +49,8 @@ public function __construct(DeploymentConfig $deploymentConfig, JwkFactory $jwkF * @param string $algorithm * @return Jwk[] * @throws \InvalidArgumentException When algorithm is not recognized. + * + * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ public function createFor(string $algorithm): array { diff --git a/app/code/Magento/Newsletter/Controller/Adminhtml/Queue.php b/app/code/Magento/Newsletter/Controller/Adminhtml/Queue.php index 7ed184aaa384..cc2577e24e40 100644 --- a/app/code/Magento/Newsletter/Controller/Adminhtml/Queue.php +++ b/app/code/Magento/Newsletter/Controller/Adminhtml/Queue.php @@ -18,5 +18,14 @@ abstract class Queue extends \Magento\Backend\App\Action * * @see _isAllowed() */ - const ADMIN_RESOURCE = 'Magento_Newsletter::queue'; + public const ADMIN_RESOURCE = 'Magento_Newsletter::queue'; + + /** + * @inheritDoc + */ + protected function _isAllowed() + { + return ($this->_authorization->isAllowed(self::ADMIN_RESOURCE) && + $this->_authorization->isAllowed('Magento_Newsletter::template')); + } } diff --git a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/AdminPayPalPayflowProWithValutActionGroup.xml b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/AdminPayPalPayflowProWithValutActionGroup.xml index 26a19d6e2957..38e48f93a475 100644 --- a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/AdminPayPalPayflowProWithValutActionGroup.xml +++ b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/AdminPayPalPayflowProWithValutActionGroup.xml @@ -25,10 +25,10 @@ - - - - + + + + diff --git a/app/code/Magento/Paypal/Test/Mftf/Test/DeleteSavedWithPayflowProCreditCardFromCustomerAccountTest.xml b/app/code/Magento/Paypal/Test/Mftf/Test/DeleteSavedWithPayflowProCreditCardFromCustomerAccountTest.xml index e1ec8ec69c23..6cb29988df0d 100644 --- a/app/code/Magento/Paypal/Test/Mftf/Test/DeleteSavedWithPayflowProCreditCardFromCustomerAccountTest.xml +++ b/app/code/Magento/Paypal/Test/Mftf/Test/DeleteSavedWithPayflowProCreditCardFromCustomerAccountTest.xml @@ -23,9 +23,7 @@ - - - + diff --git a/app/code/Magento/Paypal/Test/Mftf/Test/EditOrderFromAdminWithSavedWithinPayPalPayflowProCreditCardForRegisteredCustomerTest.xml b/app/code/Magento/Paypal/Test/Mftf/Test/EditOrderFromAdminWithSavedWithinPayPalPayflowProCreditCardForRegisteredCustomerTest.xml index 931be9866331..a9bdf7103ee2 100644 --- a/app/code/Magento/Paypal/Test/Mftf/Test/EditOrderFromAdminWithSavedWithinPayPalPayflowProCreditCardForRegisteredCustomerTest.xml +++ b/app/code/Magento/Paypal/Test/Mftf/Test/EditOrderFromAdminWithSavedWithinPayPalPayflowProCreditCardForRegisteredCustomerTest.xml @@ -28,9 +28,7 @@ - - - + diff --git a/app/code/Magento/Quote/i18n/en_US.csv b/app/code/Magento/Quote/i18n/en_US.csv index 6563651ba5ac..dc7cfaaaa5a7 100644 --- a/app/code/Magento/Quote/i18n/en_US.csv +++ b/app/code/Magento/Quote/i18n/en_US.csv @@ -75,3 +75,4 @@ Carts,Carts "Identity type not found","Identity type not found" "Invalid order backpressure limit config","Invalid order backpressure limit config" "Please check input parameters.","Please check input parameters." +"Please check input parameters.","Please check input parameters." diff --git a/app/code/Magento/Reports/Controller/Adminhtml/Report/Review.php b/app/code/Magento/Reports/Controller/Adminhtml/Report/Review.php index e42fbc1c754f..05c398864ccc 100644 --- a/app/code/Magento/Reports/Controller/Adminhtml/Report/Review.php +++ b/app/code/Magento/Reports/Controller/Adminhtml/Report/Review.php @@ -3,6 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); /** * Review reports admin controller @@ -11,24 +12,29 @@ */ namespace Magento\Reports\Controller\Adminhtml\Report; +use Magento\Backend\App\Action; +use Magento\Backend\App\Action\Context; +use Magento\Framework\App\Response\Http\FileFactory; + /** + * phpcs:disable Magento2.Classes.AbstractApi * @api * @since 100.0.2 */ -abstract class Review extends \Magento\Backend\App\Action +abstract class Review extends Action { /** - * @var \Magento\Framework\App\Response\Http\FileFactory + * @var FileFactory */ protected $_fileFactory; /** - * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory + * @param Context $context + * @param FileFactory $fileFactory */ public function __construct( - \Magento\Backend\App\Action\Context $context, - \Magento\Framework\App\Response\Http\FileFactory $fileFactory + Context $context, + FileFactory $fileFactory ) { $this->_fileFactory = $fileFactory; parent::__construct($context); @@ -54,16 +60,20 @@ public function _initAction() */ protected function _isAllowed() { - switch ($this->getRequest()->getActionName()) { - case 'customer': - return $this->_authorization->isAllowed('Magento_Reports::review_customer'); - break; - case 'product': - return $this->_authorization->isAllowed('Magento_Reports::review_product'); - break; - default: - return $this->_authorization->isAllowed('Magento_Reports::review'); - break; - } + return match ($this->getRequest()->getActionName()) { + 'exportCustomerCsv', + 'exportCustomerExcel', + 'customer' => + $this->_authorization->isAllowed('Magento_Reports::review_customer'), + 'exportProductCsv', + 'exportProductExcel', + 'exportProductDetailCsv', + 'exportProductDetailExcel', + 'productDetail', + 'product' => + $this->_authorization->isAllowed('Magento_Reports::review_product'), + default => + $this->_authorization->isAllowed('Magento_Reports::review'), + }; } } diff --git a/app/code/Magento/Reports/Controller/Adminhtml/Report/Sales.php b/app/code/Magento/Reports/Controller/Adminhtml/Report/Sales.php index c77ff5c26b04..ac5b1db76045 100644 --- a/app/code/Magento/Reports/Controller/Adminhtml/Report/Sales.php +++ b/app/code/Magento/Reports/Controller/Adminhtml/Report/Sales.php @@ -3,6 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); /** * Sales report admin controller @@ -13,6 +14,7 @@ /** * @SuppressWarnings(PHPMD.NumberOfChildren) + * phpcs:disable Magento2.Classes.AbstractApi * @api * @since 100.0.2 */ @@ -37,31 +39,23 @@ public function _initAction() */ protected function _isAllowed() { - switch ($this->getRequest()->getActionName()) { - case 'sales': - return $this->_authorization->isAllowed('Magento_Reports::salesroot_sales'); - break; - case 'tax': - return $this->_authorization->isAllowed('Magento_Reports::tax'); - break; - case 'shipping': - return $this->_authorization->isAllowed('Magento_Reports::shipping'); - break; - case 'invoiced': - return $this->_authorization->isAllowed('Magento_Reports::invoiced'); - break; - case 'refunded': - return $this->_authorization->isAllowed('Magento_Reports::refunded'); - break; - case 'coupons': - return $this->_authorization->isAllowed('Magento_Reports::coupons'); - break; - case 'bestsellers': - return $this->_authorization->isAllowed('Magento_Reports::bestsellers'); - break; - default: - return $this->_authorization->isAllowed('Magento_Reports::salesroot'); - break; - } + return match (strtolower($this->getRequest()->getActionName())) { + 'exportsalescsv', 'exportsalesexcel', 'sales' => + $this->_authorization->isAllowed('Magento_Reports::salesroot_sales'), + 'exporttaxcsv', 'exporttaxexcel', 'tax' => + $this->_authorization->isAllowed('Magento_Reports::tax'), + 'exportshippingcsv', 'exportshippingexcel', 'shipping' => + $this->_authorization->isAllowed('Magento_Reports::shipping'), + 'exportinvoicedcsv', 'exportinvoicedexcel', 'invoiced' => + $this->_authorization->isAllowed('Magento_Reports::invoiced'), + 'exportrefundedcsv', 'exportrefundedexcel', 'refunded' => + $this->_authorization->isAllowed('Magento_Reports::refunded'), + 'exportcouponscsv', 'exportcouponsexcel', 'coupons' => + $this->_authorization->isAllowed('Magento_Reports::coupons'), + 'exportbestsellerscsv', 'exportbestsellersexcel', 'bestsellers' => + $this->_authorization->isAllowed('Magento_Reports::bestsellers'), + default => + $this->_authorization->isAllowed('Magento_Reports::salesroot'), + }; } } diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View.php index d70df8003819..fc6edd9b6adc 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View.php @@ -16,29 +16,21 @@ class View extends \Magento\Backend\Block\Widget\Form\Container { /** - * Block group - * * @var string */ protected $_blockGroup = 'Magento_Sales'; /** - * Core registry - * * @var \Magento\Framework\Registry */ protected $_coreRegistry = null; /** - * Sales config - * * @var \Magento\Sales\Model\Config */ protected $_salesConfig; /** - * Reorder helper - * * @var \Magento\Sales\Helper\Reorder */ protected $_reorderHelper; @@ -121,7 +113,7 @@ protected function _construct() ); } - if ($this->_isAllowedAction('Magento_Sales::emails') && !$order->isCanceled()) { + if ($this->_isAllowedAction('Magento_Sales::email') && !$order->isCanceled()) { $message = __('Are you sure you want to send an order email to customer?'); $this->addButton( 'send_notification', diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/Cancel.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/Cancel.php index 1ca0b53ee878..0da7c4d8cb5a 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/Cancel.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/Cancel.php @@ -6,15 +6,16 @@ namespace Magento\Sales\Controller\Adminhtml\Order\Creditmemo; use Magento\Backend\App\Action; +use Magento\Framework\App\Action\HttpPostActionInterface; -class Cancel extends \Magento\Backend\App\Action +class Cancel extends \Magento\Backend\App\Action implements HttpPostActionInterface { /** * Authorization level of a basic admin session * * @see _isAllowed() */ - const ADMIN_RESOURCE = 'Magento_Sales::sales_creditmemo'; + public const ADMIN_RESOURCE = 'Magento_Sales::creditmemo'; /** * @var \Magento\Backend\Model\View\Result\ForwardFactory diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/NewAction.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/NewAction.php index 3ac3abda82cd..e071444fef0a 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/NewAction.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/NewAction.php @@ -15,7 +15,7 @@ class NewAction extends \Magento\Backend\App\Action implements HttpGetActionInte * * @see _isAllowed() */ - const ADMIN_RESOURCE = 'Magento_Sales::sales_creditmemo'; + public const ADMIN_RESOURCE = 'Magento_Sales::creditmemo'; /** * @var \Magento\Sales\Controller\Adminhtml\Order\CreditmemoLoader diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/Save.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/Save.php index 63558c0290e2..a0cb5a4dc8ac 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/Save.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/Save.php @@ -5,10 +5,9 @@ */ namespace Magento\Sales\Controller\Adminhtml\Order\Creditmemo; -use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface; +use Magento\Framework\App\Action\HttpPostActionInterface; use Magento\Backend\App\Action; use Magento\Sales\Helper\Data as SalesData; -use Magento\Sales\Model\Order; use Magento\Sales\Model\Order\Email\Sender\CreditmemoSender; class Save extends \Magento\Backend\App\Action implements HttpPostActionInterface @@ -18,7 +17,7 @@ class Save extends \Magento\Backend\App\Action implements HttpPostActionInterfac * * @see _isAllowed() */ - const ADMIN_RESOURCE = 'Magento_Sales::sales_creditmemo'; + public const ADMIN_RESOURCE = 'Magento_Sales::creditmemo'; /** * @var \Magento\Sales\Controller\Adminhtml\Order\CreditmemoLoader diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/Start.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/Start.php index 3dc4aa6dcd50..0fc96d4cfc8f 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/Start.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/Start.php @@ -14,7 +14,7 @@ class Start extends \Magento\Backend\App\Action implements HttpGetActionInterfac * * @see _isAllowed() */ - const ADMIN_RESOURCE = 'Magento_Sales::sales_creditmemo'; + public const ADMIN_RESOURCE = 'Magento_Sales::creditmemo'; /** * Start create creditmemo action diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/UpdateQty.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/UpdateQty.php index 47a936672791..8d1e627b4339 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/UpdateQty.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/UpdateQty.php @@ -15,7 +15,7 @@ class UpdateQty extends \Magento\Backend\App\Action implements HttpPostActionInt * * @see _isAllowed() */ - const ADMIN_RESOURCE = 'Magento_Sales::sales_creditmemo'; + public const ADMIN_RESOURCE = 'Magento_Sales::creditmemo'; /** * @var \Magento\Sales\Controller\Adminhtml\Order\CreditmemoLoader diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/VoidAction.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/VoidAction.php index 146514265517..225f57251bf2 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/VoidAction.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/VoidAction.php @@ -6,15 +6,16 @@ namespace Magento\Sales\Controller\Adminhtml\Order\Creditmemo; use Magento\Backend\App\Action; +use Magento\Framework\App\Action\HttpPostActionInterface; -class VoidAction extends Action +class VoidAction extends Action implements HttpPostActionInterface { /** * Authorization level of a basic admin session * * @see _isAllowed() */ - const ADMIN_RESOURCE = 'Magento_Sales::sales_creditmemo'; + public const ADMIN_RESOURCE = 'Magento_Sales::creditmemo'; /** * @var \Magento\Sales\Controller\Adminhtml\Order\CreditmemoLoader diff --git a/app/code/Magento/Sales/ViewModel/Order/Create/SidebarPermissionCheck.php b/app/code/Magento/Sales/ViewModel/Order/Create/SidebarPermissionCheck.php new file mode 100644 index 000000000000..cf7f8ff72636 --- /dev/null +++ b/app/code/Magento/Sales/ViewModel/Order/Create/SidebarPermissionCheck.php @@ -0,0 +1,42 @@ +authorization = $authorization; + } + + /** + * To check customer permission + * + * @return bool + */ + public function isAllowed(): bool + { + return $this->authorization->isAllowed('Magento_Customer::customer'); + } +} diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_index.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_index.xml index c2178429e30c..9d56e806a10c 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_index.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_index.xml @@ -36,6 +36,9 @@ + + Magento\Sales\ViewModel\Order\Create\SidebarPermissionCheck + diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_data.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_data.xml index 55ea314e6ea5..1f7df8dd97a8 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_data.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_data.xml @@ -11,6 +11,9 @@ + + Magento\Sales\ViewModel\Order\Create\SidebarPermissionCheck + diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar.xml index 000bc2be3871..a4b41c01bc18 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar.xml @@ -9,6 +9,9 @@ + + Magento\Sales\ViewModel\Order\Create\SidebarPermissionCheck + diff --git a/app/code/Magento/Sales/view/adminhtml/templates/order/create/sidebar.phtml b/app/code/Magento/Sales/view/adminhtml/templates/order/create/sidebar.phtml index fe8910dc3e95..6474ef0078b7 100644 --- a/app/code/Magento/Sales/view/adminhtml/templates/order/create/sidebar.phtml +++ b/app/code/Magento/Sales/view/adminhtml/templates/order/create/sidebar.phtml @@ -4,19 +4,32 @@ * See COPYING.txt for license details. */ +use Magento\Framework\Escaper; +use Magento\Framework\View\Helper\SecureHtmlRenderer; +use Magento\Sales\Block\Adminhtml\Order\Create\Sidebar; +use Magento\Sales\ViewModel\Order\Create\SidebarPermissionCheck; + /** - * @var \Magento\Sales\Block\Adminhtml\Order\Create\Sidebar $block - * @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer + * @var Sidebar $block + * @var SecureHtmlRenderer $secureRenderer + * @var Escaper $escaper */ + +/** + * @var SidebarPermissionCheck $sideBarPermissionCheck + */ +$sideBarPermissionCheck = $block->getData('sideBarPermissionCheck'); + ?> +isAllowed()): ?>
-

escapeHtml(__('Customer\'s Activities')) ?>

+

escapeHtml(__('Customer\'s Activities')) ?>

getChildHtml('top_button') ?> getLayout()->getChildBlocks($block->getNameInLayout()) as $_alias => $_child): ?> canDisplay($_child)): ?> -
+
getChildHtml($_alias) ?>
@@ -25,6 +38,7 @@ getChildHtml('bottom_button') ?>
+ - + diff --git a/app/code/Magento/TaxImportExport/Controller/Adminhtml/Rate.php b/app/code/Magento/TaxImportExport/Controller/Adminhtml/Rate.php index 008689b9ac6c..f7b79f60dc01 100644 --- a/app/code/Magento/TaxImportExport/Controller/Adminhtml/Rate.php +++ b/app/code/Magento/TaxImportExport/Controller/Adminhtml/Rate.php @@ -3,6 +3,9 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + +declare(strict_types=1); + namespace Magento\TaxImportExport\Controller\Adminhtml; /** @@ -15,7 +18,7 @@ abstract class Rate extends \Magento\Backend\App\Action * * @see _isAllowed() */ - const ADMIN_RESOURCE = 'Magento_Tax::manage_tax'; + public const ADMIN_RESOURCE = 'Magento_TaxImportExport::import_export'; /** * @var \Magento\Framework\App\Response\Http\FileFactory diff --git a/app/code/Magento/TaxImportExport/Controller/Adminhtml/Rate/ExportPost.php b/app/code/Magento/TaxImportExport/Controller/Adminhtml/Rate/ExportPost.php index f23fe8ffae7a..45437bacb0e4 100644 --- a/app/code/Magento/TaxImportExport/Controller/Adminhtml/Rate/ExportPost.php +++ b/app/code/Magento/TaxImportExport/Controller/Adminhtml/Rate/ExportPost.php @@ -3,12 +3,17 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + +declare(strict_types=1); + namespace Magento\TaxImportExport\Controller\Adminhtml\Rate; +use Magento\Framework\App\Action\HttpPostActionInterface; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\App\ResponseInterface; +use Magento\TaxImportExport\Controller\Adminhtml\Rate; -class ExportPost extends \Magento\TaxImportExport\Controller\Adminhtml\Rate +class ExportPost extends Rate implements HttpPostActionInterface { /** * Export action from import/export tax @@ -86,16 +91,4 @@ public function execute() return $this->fileFactory->create('tax_rates.csv', $fileContent, DirectoryList::VAR_DIR); } - - /** - * @return bool - */ - protected function _isAllowed() - { - return $this->_authorization->isAllowed( - 'Magento_Tax::manage_tax' - ) || $this->_authorization->isAllowed( - 'Magento_TaxImportExport::import_export' - ); - } } diff --git a/app/code/Magento/TaxImportExport/Controller/Adminhtml/Rate/ImportPost.php b/app/code/Magento/TaxImportExport/Controller/Adminhtml/Rate/ImportPost.php index ffdb7d3782df..4a43f1827eb3 100644 --- a/app/code/Magento/TaxImportExport/Controller/Adminhtml/Rate/ImportPost.php +++ b/app/code/Magento/TaxImportExport/Controller/Adminhtml/Rate/ImportPost.php @@ -3,14 +3,19 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + +declare(strict_types=1); + namespace Magento\TaxImportExport\Controller\Adminhtml\Rate; use Magento\Framework\Controller\ResultFactory; +use Magento\Framework\App\Action\HttpPostActionInterface; +use Magento\TaxImportExport\Controller\Adminhtml\Rate; -class ImportPost extends \Magento\TaxImportExport\Controller\Adminhtml\Rate +class ImportPost extends Rate implements HttpPostActionInterface { /** - * import action from import/export tax + * Import action from import/export tax * * @return \Magento\Backend\Model\View\Result\Redirect */ @@ -39,16 +44,4 @@ public function execute() $resultRedirect->setUrl($this->_redirect->getRedirectUrl()); return $resultRedirect; } - - /** - * @return bool - */ - protected function _isAllowed() - { - return $this->_authorization->isAllowed( - 'Magento_Tax::manage_tax' - ) || $this->_authorization->isAllowed( - 'Magento_TaxImportExport::import_export' - ); - } } diff --git a/app/code/Magento/TaxImportExport/view/adminhtml/layout/tax_rule_edit.xml b/app/code/Magento/TaxImportExport/view/adminhtml/layout/tax_rule_edit.xml index 1e74147780d9..f0211afdcde3 100644 --- a/app/code/Magento/TaxImportExport/view/adminhtml/layout/tax_rule_edit.xml +++ b/app/code/Magento/TaxImportExport/view/adminhtml/layout/tax_rule_edit.xml @@ -8,7 +8,8 @@ - + diff --git a/app/design/adminhtml/Magento/backend/i18n/en_US.csv b/app/design/adminhtml/Magento/backend/i18n/en_US.csv index 885d0056d4b7..deeb77923f89 100644 --- a/app/design/adminhtml/Magento/backend/i18n/en_US.csv +++ b/app/design/adminhtml/Magento/backend/i18n/en_US.csv @@ -548,3 +548,4 @@ Dashboard,Dashboard "Store Email Addresses Section","Store Email Addresses Section" "Email to a Friend","Email to a Friend" "Invalid data type","Invalid data type" +"Invalid data type","Invalid data type" diff --git a/app/design/frontend/Magento/blank/i18n/en_US.csv b/app/design/frontend/Magento/blank/i18n/en_US.csv index cc02ab5ac902..920ce75cf16d 100644 --- a/app/design/frontend/Magento/blank/i18n/en_US.csv +++ b/app/design/frontend/Magento/blank/i18n/en_US.csv @@ -440,3 +440,4 @@ Test,Test test,test Two,Two "Invalid data type","Invalid data type" +"Invalid data type","Invalid data type" diff --git a/app/design/frontend/Magento/luma/i18n/en_US.csv b/app/design/frontend/Magento/luma/i18n/en_US.csv index 3d0e8ab2650e..51fa77233314 100644 --- a/app/design/frontend/Magento/luma/i18n/en_US.csv +++ b/app/design/frontend/Magento/luma/i18n/en_US.csv @@ -490,3 +490,4 @@ Test,Test test,test Two,Two "Invalid data type","Invalid data type" +"Invalid data type","Invalid data type" diff --git a/composer.lock b/composer.lock index 8c3ab42780cb..0208e35258a3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b51a34214644ae13c3de0c65848483e7", + "content-hash": "a504dcb8af9496dc2d370bd0f916e947", "packages": [ { "name": "aws/aws-crt-php", @@ -395,16 +395,16 @@ }, { "name": "colinmollenhour/php-redis-session-abstract", - "version": "v1.5.4", + "version": "v1.5.5", "source": { "type": "git", "url": "https://github.com/colinmollenhour/php-redis-session-abstract.git", - "reference": "c2e6ed15eb9cb363c9097fafefa590039fbadcb0" + "reference": "5d93866cd53701ef8f866cb41cb5c6d7259d4416" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/colinmollenhour/php-redis-session-abstract/zipball/c2e6ed15eb9cb363c9097fafefa590039fbadcb0", - "reference": "c2e6ed15eb9cb363c9097fafefa590039fbadcb0", + "url": "https://api.github.com/repos/colinmollenhour/php-redis-session-abstract/zipball/5d93866cd53701ef8f866cb41cb5c6d7259d4416", + "reference": "5d93866cd53701ef8f866cb41cb5c6d7259d4416", "shasum": "" }, "require": { @@ -433,9 +433,9 @@ "homepage": "https://github.com/colinmollenhour/php-redis-session-abstract", "support": { "issues": "https://github.com/colinmollenhour/php-redis-session-abstract/issues", - "source": "https://github.com/colinmollenhour/php-redis-session-abstract/tree/v1.5.4" + "source": "https://github.com/colinmollenhour/php-redis-session-abstract/tree/v1.5.5" }, - "time": "2024-01-03T14:16:31+00:00" + "time": "2024-02-03T06:04:45+00:00" }, { "name": "composer/ca-bundle", diff --git a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/SaveTest.php b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/SaveTest.php index bbd6d27d688d..d0b403852139 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/SaveTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/SaveTest.php @@ -21,6 +21,11 @@ */ class SaveTest extends AbstractCreditmemoControllerTest { + /** + * @var string + */ + protected $resource = 'Magento_Sales::creditmemo'; + /** * @var string */ diff --git a/dev/tests/integration/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/SaveTest.php b/dev/tests/integration/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/SaveTest.php index e3374064aa3c..043ba86dce3e 100644 --- a/dev/tests/integration/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/SaveTest.php +++ b/dev/tests/integration/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/SaveTest.php @@ -18,6 +18,11 @@ */ class SaveTest extends AbstractShipmentControllerTest { + /** + * @var string + */ + protected $resource = 'Magento_Sales::ship'; + /** * @var string */ @@ -105,8 +110,7 @@ private function prepareRequest(array $params = []) ] ); - $data = $params ?? []; - $this->getRequest()->setPostValue($data); + $this->getRequest()->setPostValue($params); return $order; } diff --git a/dev/tests/static/testsuite/Magento/Test/Js/_files/blacklist/magento.txt b/dev/tests/static/testsuite/Magento/Test/Js/_files/blacklist/magento.txt index b1810d9daa1a..dfeec1ebd27a 100644 --- a/dev/tests/static/testsuite/Magento/Test/Js/_files/blacklist/magento.txt +++ b/dev/tests/static/testsuite/Magento/Test/Js/_files/blacklist/magento.txt @@ -13,9 +13,11 @@ lib/web/mage/adminhtml/varienLoader.js lib/web/magnifier/magnifier.js lib/web/magnifier/magnify.js lib/web/varien/js.js +lib/web/prototype/**/*.js // MINIFIED FILES app/code/**/*.min.js +lib/web/legacy-build.min.js // TEST vendor/magento/magento-coding-standard/Magento2/Tests/Eslint/* diff --git a/lib/web/legacy-build.min.js b/lib/web/legacy-build.min.js index fe88a6d6d01d..b38dcba75dac 100644 --- a/lib/web/legacy-build.min.js +++ b/lib/web/legacy-build.min.js @@ -1,4 +1,4 @@ -var Prototype={Version:"1.7.3",Browser:(function(){var d=navigator.userAgent;var b=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!b,Opera:b,WebKit:d.indexOf("AppleWebKit/")>-1,Gecko:d.indexOf("Gecko")>-1&&d.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile/.test(d)}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var b=window.Element||window.HTMLElement;return !!(b&&b.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var e=document.createElement("div"),d=document.createElement("form"),b=false;if(e.__proto__&&(e.__proto__!==d.__proto__)){b=true}e=d=null;return b})()},ScriptFragment:"]*>([\\S\\s]*?)<\/script\\s*>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(b){return b}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Class=(function(){var f=(function(){for(var g in {toString:1}){if(g==="toString"){return false}}return true})();function b(){}function d(){var n=null,l=$A(arguments);if(Object.isFunction(l[0])){n=l.shift()}function g(){this.initialize.apply(this,arguments)}Object.extend(g,Class.Methods);g.superclass=n;g.subclasses=[];if(n){b.prototype=n.prototype;g.prototype=new b;n.subclasses.push(g)}for(var h=0,o=l.length;h0){match=source.match(pattern);if(match&&match[0].length>0){result+=source.slice(0,match.index);result+=String.interpret(replacement(match));source=source.slice(match.index+match[0].length)}else{result+=source,source=""}}return result}function sub(pattern,replacement,count){replacement=prepareReplacement(replacement);count=Object.isUndefined(count)?1:count;return this.gsub(pattern,function(match){if(--count<0){return match[0]}return replacement(match)})}function scan(pattern,iterator){this.gsub(pattern,iterator);return String(this)}function truncate(length,truncation){length=length||30;truncation=Object.isUndefined(truncation)?"...":truncation;return this.length>length?this.slice(0,length-truncation.length)+truncation:String(this)}function strip(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}function stripTags(){return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?(\/)?>|<\/\w+>/gi,"")}function stripScripts(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")}function extractScripts(){var matchAll=new RegExp(Prototype.ScriptFragment,"img"),matchOne=new RegExp(Prototype.ScriptFragment,"im");return(this.match(matchAll)||[]).map(function(scriptTag){return(scriptTag.match(matchOne)||["",""])[1]})}function evalScripts(){return this.extractScripts().map(function(script){return eval(script)})}function escapeHTML(){return this.replace(/&/g,"&").replace(//g,">")}function unescapeHTML(){return this.stripTags().replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function toQueryParams(separator){var match=this.strip().match(/([^?#]*)(#.*)?$/);if(!match){return{}}return match[1].split(separator||"&").inject({},function(hash,pair){if((pair=pair.split("="))[0]){var key=decodeURIComponent(pair.shift()),value=pair.length>1?pair.join("="):pair[0];if(value!=undefined){value=value.gsub("+"," ");value=decodeURIComponent(value)}if(key in hash){if(!Object.isArray(hash[key])){hash[key]=[hash[key]]}hash[key].push(value)}else{hash[key]=value}}return hash})}function toArray(){return this.split("")}function succ(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)}function times(count){return count<1?"":new Array(count+1).join(this)}function camelize(){return this.replace(/-+(.)?/g,function(match,chr){return chr?chr.toUpperCase():""})}function capitalize(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()}function underscore(){return this.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/-/g,"_").toLowerCase()}function dasherize(){return this.replace(/_/g,"-")}function inspect(useDoubleQuotes){var escapedString=this.replace(/[\x00-\x1f\\]/g,function(character){if(character in String.specialChar){return String.specialChar[character]}return"\\u00"+character.charCodeAt().toPaddedString(2,16)});if(useDoubleQuotes){return'"'+escapedString.replace(/"/g,'\\"')+'"'}return"'"+escapedString.replace(/'/g,"\\'")+"'"}function unfilterJSON(filter){return this.replace(filter||Prototype.JSONFilter,"$1")}function isJSON(){var str=this;if(str.blank()){return false}str=str.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@");str=str.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]");str=str.replace(/(?:^|:|,)(?:\s*\[)+/g,"");return(/^[\],:{}\s]*$/).test(str)}function evalJSON(sanitize){var json=this.unfilterJSON(),cx=/[\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff\u0000]/g;if(cx.test(json)){json=json.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}try{if(!sanitize||json.isJSON()){return eval("("+json+")")}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())}function parseJSON(){var json=this.unfilterJSON();return JSON.parse(json)}function include(pattern){return this.indexOf(pattern)>-1}function startsWith(pattern,position){position=Object.isNumber(position)?position:0;return this.lastIndexOf(pattern,position)===position}function endsWith(pattern,position){pattern=String(pattern);position=Object.isNumber(position)?position:this.length;if(position<0){position=0}if(position>this.length){position=this.length}var d=position-pattern.length;return d>=0&&this.indexOf(pattern,d)===d}function empty(){return this==""}function blank(){return/^\s*$/.test(this)}function interpolate(object,pattern){return new Template(this,pattern).evaluate(object)}return{gsub:gsub,sub:sub,scan:scan,truncate:truncate,strip:String.prototype.trim||strip,stripTags:stripTags,stripScripts:stripScripts,extractScripts:extractScripts,evalScripts:evalScripts,escapeHTML:escapeHTML,unescapeHTML:unescapeHTML,toQueryParams:toQueryParams,parseQuery:toQueryParams,toArray:toArray,succ:succ,times:times,camelize:camelize,capitalize:capitalize,underscore:underscore,dasherize:dasherize,inspect:inspect,unfilterJSON:unfilterJSON,isJSON:isJSON,evalJSON:NATIVE_JSON_PARSE_SUPPORT?parseJSON:evalJSON,include:include,startsWith:String.prototype.startsWith||startsWith,endsWith:String.prototype.endsWith||endsWith,empty:empty,blank:blank,interpolate:interpolate}})());var Template=Class.create({initialize:function(b,d){this.template=b.toString();this.pattern=d||Template.Pattern},evaluate:function(b){if(b&&Object.isFunction(b.toTemplateReplacements)){b=b.toTemplateReplacements()}return this.template.gsub(this.pattern,function(f){if(b==null){return(f[1]+"")}var h=f[1]||"";if(h=="\\"){return f[2]}var d=b,l=f[3],g=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;f=g.exec(l);if(f==null){return h}while(f!=null){var e=f[1].startsWith("[")?f[2].replace(/\\\\]/g,"]"):f[1];d=d[e];if(null==d||""==f[3]){break}l=l.substring("["==f[3]?f[1].length:f[0].length);f=g.exec(l)}return h+String.interpret(d)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable=(function(){function e(E,D){try{this._each(E,D)}catch(F){if(F!=$break){throw F}}return this}function y(G,F,E){var D=-G,H=[],I=this.toArray();if(G<1){return I}while((D+=G)=D){D=H}},this);return D}function t(F,E){F=F||Prototype.K;var D;this.each(function(H,G){H=F.call(E,H,G,this);if(D==null||HF?1:0}).pluck("value")}function u(){return this.map()}function z(){var E=Prototype.K,D=$A(arguments);if(Object.isFunction(D.last())){E=D.pop()}var F=[this].concat(D).map($A);return this.map(function(H,G){return E(F.pluck(G))})}function q(){return this.toArray().length}function B(){return"#"}return{each:e,eachSlice:y,all:d,every:d,any:o,some:o,collect:p,map:p,detect:A,findAll:n,select:n,filter:n,grep:l,include:b,member:b,inGroupsOf:w,inject:r,invoke:C,max:v,min:t,partition:g,pluck:h,reject:f,sortBy:s,toArray:u,entries:u,zip:z,size:q,inspect:B,find:A}})();function $A(e){if(!e){return[]}if("toArray" in Object(e)){return e.toArray()}var d=e.length||0,b=new Array(d);while(d--){b[d]=e[d]}return b}function $w(b){if(!Object.isString(b)){return[]}b=b.strip();return b?b.split(/\s+/):[]}Array.from=$A;(function(){var C=Array.prototype,u=C.slice,w=C.forEach;function d(I,H){for(var G=0,J=this.length>>>0;G>>0;if(I===0){return -1}H=Number(H);if(isNaN(H)){H=0}else{if(H!==0&&isFinite(H)){H=(H>0?1:-1)*Math.floor(Math.abs(H))}}if(H>I){return -1}var G=H>=0?H:Math.max(I-Math.abs(H),0);for(;G>>0;if(I===0){return -1}if(!Object.isUndefined(H)){H=Number(H);if(isNaN(H)){H=0}else{if(H!==0&&isFinite(H)){H=(H>0?1:-1)*Math.floor(Math.abs(H))}}}else{H=I}var G=H>=0?Math.min(H,I-1):I-Math.abs(H);for(;G>=0;G--){if(G in K&&K[G]===J){return G}}return -1}function e(N){var L=[],M=u.call(arguments,0),O,H=0;M.unshift(this);for(var K=0,G=M.length;K>>0;H>>0;H>>0;H>>0;H"}function n(){return new Hash(this)}return{initialize:g,_each:h,set:p,get:e,unset:s,toObject:u,toTemplateReplacements:u,keys:t,values:r,index:l,merge:o,update:f,toQueryString:b,inspect:q,toJSON:u,clone:n}})());Hash.from=$H;Object.extend(Number.prototype,(function(){function f(){return this.toPaddedString(2,16)}function d(){return this+1}function n(p,o){$R(0,this,true).each(p,o);return this}function l(q,p){var o=this.toString(p||10);return"0".times(q-o.length)+o}function b(){return Math.abs(this)}function e(){return Math.round(this)}function g(){return Math.ceil(this)}function h(){return Math.floor(this)}return{toColorPart:f,succ:d,times:n,toPaddedString:l,abs:b,round:e,ceil:g,floor:h}})());function $R(e,b,d){return new ObjectRange(e,b,d)}var ObjectRange=Class.create(Enumerable,(function(){function d(h,f,g){this.start=h;this.end=f;this.exclusive=g}function e(h,g){var l=this.start,f;for(f=0;this.include(l);f++){h.call(g,l,f);l=l.succ()}}function b(f){if(f1&&!((b==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var g={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){g["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){g.Connection="close"}}if(typeof this.options.requestHeaders=="object"){var e=this.options.requestHeaders;if(Object.isFunction(e.push)){for(var d=0,f=e.length;d=200&&b<300)||b==304},getStatus:function(){try{if(this.transport.status===1223){return 204}return this.transport.status||0}catch(b){return 0}},respondToReadyState:function(b){var f=Ajax.Request.Events[b],d=new Ajax.Response(this);if(f=="Complete"){try{this._complete=true;(this.options["on"+d.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(d,d.headerJSON)}catch(g){this.dispatchException(g)}var h=d.getHeader("Content-type");if(this.options.evalJS=="force"||(this.options.evalJS&&this.isSameOrigin()&&h&&h.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse()}}try{(this.options["on"+f]||Prototype.emptyFunction)(d,d.headerJSON);Ajax.Responders.dispatch("on"+f,this,d,d.headerJSON)}catch(g){this.dispatchException(g)}if(f=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction}},isSameOrigin:function(){var b=this.url.match(/^\s*https?:\/\/[^\/]*/);return !b||(b[0]=="#{protocol}//#{domain}#{port}".interpolate({protocol:location.protocol,domain:document.domain,port:location.port?":"+location.port:""}))},getHeader:function(b){try{return this.transport.getResponseHeader(b)||null}catch(d){return null}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON())}catch(e){this.dispatchException(e)}},dispatchException:function(b){(this.options.onException||Prototype.emptyFunction)(this,b);Ajax.Responders.dispatch("onException",this,b)}});Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Response=Class.create({initialize:function(e){this.request=e;var f=this.transport=e.transport,b=this.readyState=f.readyState;if((b>2&&!Prototype.Browser.IE)||b==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(f.responseText);this.headerJSON=this._getHeaderJSON()}if(b==4){var d=f.responseXML;this.responseXML=Object.isUndefined(d)?null:d;this.responseJSON=this._getResponseJSON()}},status:0,statusText:"",getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||""}catch(b){return""}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders()}catch(b){return null}},getResponseHeader:function(b){return this.transport.getResponseHeader(b)},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders()},_getHeaderJSON:function(){var b=this.getHeader("X-JSON");if(!b){return null}try{b=decodeURIComponent(escape(b))}catch(d){}try{return b.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin())}catch(d){this.request.dispatchException(d)}},_getResponseJSON:function(){var b=this.request.options;if(!b.evalJSON||(b.evalJSON!="force"&&!(this.getHeader("Content-type")||"").include("application/json"))||this.responseText.blank()){return null}try{return this.responseText.evalJSON(b.sanitizeJSON||!this.request.isSameOrigin())}catch(d){this.request.dispatchException(d)}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,b,e,d){this.container={success:(b.success||b),failure:(b.failure||(b.success?null:b))};d=Object.clone(d);var f=d.onComplete;d.onComplete=(function(g,h){this.updateContent(g.responseText);if(Object.isFunction(f)){f(g,h)}}).bind(this);$super(e,d)},updateContent:function(f){var e=this.container[this.success()?"success":"failure"],b=this.options;if(!b.evalScripts){f=f.stripScripts()}if(e=$(e)){if(b.insertion){if(Object.isString(b.insertion)){var d={};d[b.insertion]=f;e.insert(d)}else{b.insertion(e,f)}}else{e.update(f)}}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,b,e,d){$super(d);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=b;this.url=e;this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent()},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments)},updateComplete:function(b){if(this.options.decay){this.decay=(b.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=b.responseText}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});(function(be){var aK;var a7=Array.prototype.slice;var aB=document.createElement("div");function a5(bv){if(arguments.length>1){for(var F=0,bx=[],bw=arguments.length;F');return F.tagName.toLowerCase()==="input"&&F.name==="x"}catch(bv){return false}})();var aO=be.Element;function aL(bv,F){F=F||{};bv=bv.toLowerCase();if(f&&F.name){bv="<"+bv+' name="'+F.name+'">';delete F.name;return aL.writeAttribute(document.createElement(bv),F)}if(!w[bv]){w[bv]=aL.extend(document.createElement(bv))}var bw=aW(bv,F)?w[bv].cloneNode(false):document.createElement(bv);return aL.writeAttribute(bw,F)}be.Element=aL;Object.extend(be.Element,aO||{});if(aO){be.Element.prototype=aO.prototype}aL.Methods={ByTag:{},Simulated:{}};var a9={};var N={id:"id",className:"class"};function bg(bv){bv=a5(bv);var F="<"+bv.tagName.toLowerCase();var bw,by;for(var bx in N){bw=N[bx];by=(bv[bx]||"").toString();if(by){F+=" "+bw+"="+by.inspect(true)}}return F+">"}a9.inspect=bg;function B(F){return a5(F).getStyle("display")!=="none"}function aD(bv,F){bv=a5(bv);if(typeof F!=="boolean"){F=!aL.visible(bv)}aL[F?"show":"hide"](bv);return bv}function aN(F){F=a5(F);F.style.display="none";return F}function o(F){F=a5(F);F.style.display="";return F}Object.extend(a9,{visible:B,toggle:aD,hide:aN,show:o});function aj(F){F=a5(F);F.parentNode.removeChild(F);return F}var aZ=(function(){var F=document.createElement("select"),bv=true;F.innerHTML='';if(F.options&&F.options[0]){bv=F.options[0].nodeName.toUpperCase()!=="OPTION"}F=null;return bv})();var O=(function(){try{var F=document.createElement("table");if(F&&F.tBodies){F.innerHTML="test";var bw=typeof F.tBodies[0]=="undefined";F=null;return bw}}catch(bv){return true}})();var a8=(function(){try{var F=document.createElement("div");F.innerHTML="";var bw=(F.childNodes.length===0);F=null;return bw}catch(bv){return true}})();var D=aZ||O||a8;var ax=(function(){var F=document.createElement("script"),bw=false;try{F.appendChild(document.createTextNode(""));bw=!F.firstChild||F.firstChild&&F.firstChild.nodeType!==3}catch(bv){bw=true}F=null;return bw})();function U(bx,bz){bx=a5(bx);var bA=bx.getElementsByTagName("*"),bw=bA.length;while(bw--){af(bA[bw])}if(bz&&bz.toElement){bz=bz.toElement()}if(Object.isElement(bz)){return bx.update().insert(bz)}bz=Object.toHTML(bz);var bv=bx.tagName.toUpperCase();if(bv==="SCRIPT"&&ax){bx.text=bz;return bx}if(D){if(bv in R.tags){while(bx.firstChild){bx.removeChild(bx.firstChild)}var F=z(bv,bz.stripScripts());for(var bw=0,by;by=F[bw];bw++){bx.appendChild(by)}}else{if(a8&&Object.isString(bz)&&bz.indexOf("-1){while(bx.firstChild){bx.removeChild(bx.firstChild)}var F=z(bv,bz.stripScripts(),true);for(var bw=0,by;by=F[bw];bw++){bx.appendChild(by)}}else{bx.innerHTML=bz.stripScripts()}}}else{bx.innerHTML=bz.stripScripts()}bz.evalScripts.bind(bz).defer();return bx}function an(bv,bw){bv=a5(bv);if(bw&&bw.toElement){bw=bw.toElement()}else{if(!Object.isElement(bw)){bw=Object.toHTML(bw);var F=bv.ownerDocument.createRange();F.selectNode(bv);bw.evalScripts.bind(bw).defer();bw=F.createContextualFragment(bw.stripScripts())}}bv.parentNode.replaceChild(bw,bv);return bv}var R={before:function(F,bv){F.parentNode.insertBefore(bv,F)},top:function(F,bv){F.insertBefore(bv,F.firstChild)},bottom:function(F,bv){F.appendChild(bv)},after:function(F,bv){F.parentNode.insertBefore(bv,F.nextSibling)},tags:{TABLE:["","
",1],TBODY:["","
",2],TR:["","
",3],TD:["
","
",4],SELECT:["",1]}};var aP=R.tags;Object.extend(aP,{THEAD:aP.TBODY,TFOOT:aP.TBODY,TH:aP.TD});function av(bw,bz){bw=a5(bw);if(bz&&bz.toElement){bz=bz.toElement()}if(Object.isElement(bz)){bw.parentNode.replaceChild(bz,bw);return bw}bz=Object.toHTML(bz);var by=bw.parentNode,bv=by.tagName.toUpperCase();if(bv in R.tags){var bA=aL.next(bw);var F=z(bv,bz.stripScripts());by.removeChild(bw);var bx;if(bA){bx=function(bB){by.insertBefore(bB,bA)}}else{bx=function(bB){by.appendChild(bB)}}F.each(bx)}else{bw.outerHTML=bz.stripScripts()}bz.evalScripts.bind(bz).defer();return bw}if("outerHTML" in document.documentElement){an=av}function bd(F){if(Object.isUndefined(F)||F===null){return false}if(Object.isString(F)||Object.isNumber(F)){return true}if(Object.isElement(F)){return true}if(F.toElement||F.toHTML){return true}return false}function bt(bx,bz,F){F=F.toLowerCase();var bB=R[F];if(bz&&bz.toElement){bz=bz.toElement()}if(Object.isElement(bz)){bB(bx,bz);return bx}bz=Object.toHTML(bz);var bw=((F==="before"||F==="after")?bx.parentNode:bx).tagName.toUpperCase();var bA=z(bw,bz.stripScripts());if(F==="top"||F==="after"){bA.reverse()}for(var bv=0,by;by=bA[bv];bv++){bB(bx,by)}bz.evalScripts.bind(bz).defer()}function W(bv,bw){bv=a5(bv);if(bd(bw)){bw={bottom:bw}}for(var F in bw){bt(bv,bw[F],F)}return bv}function A(bv,bw,F){bv=a5(bv);if(Object.isElement(bw)){a5(bw).writeAttribute(F||{})}else{if(Object.isString(bw)){bw=new aL(bw,F)}else{bw=new aL("div",bw)}}if(bv.parentNode){bv.parentNode.replaceChild(bw,bv)}bw.appendChild(bv);return bw}function C(bv){bv=a5(bv);var bw=bv.firstChild;while(bw){var F=bw.nextSibling;if(bw.nodeType===Node.TEXT_NODE&&!/\S/.test(bw.nodeValue)){bv.removeChild(bw)}bw=F}return bv}function ba(F){return a5(F).innerHTML.blank()}function z(by,bx,bz){var bw=R.tags[by],bA=aB;var F=!!bw;if(!F&&bz){F=true;bw=["","",0]}if(F){bA.innerHTML=" "+bw[0]+bx+bw[1];bA.removeChild(bA.firstChild);for(var bv=bw[2];bv--;){bA=bA.firstChild}}else{bA.innerHTML=bx}return $A(bA.childNodes)}function L(bw,F){if(!(bw=a5(bw))){return}var by=bw.cloneNode(F);if(!a4){by._prototypeUID=aK;if(F){var bx=aL.select(by,"*"),bv=bx.length;while(bv--){bx[bv]._prototypeUID=aK}}}return aL.extend(by)}function af(bv){var F=S(bv);if(F){aL.stopObserving(bv);if(!a4){bv._prototypeUID=aK}delete aL.Storage[F]}}function br(bv){var F=bv.length;while(F--){af(bv[F])}}function az(bx){var bw=bx.length,bv,F;while(bw--){bv=bx[bw];F=S(bv);delete aL.Storage[F];delete Event.cache[F]}}if(a4){br=az}function r(bv){if(!(bv=a5(bv))){return}af(bv);var bw=bv.getElementsByTagName("*"),F=bw.length;while(F--){af(bw[F])}return null}Object.extend(a9,{remove:aj,update:U,replace:an,insert:W,wrap:A,cleanWhitespace:C,empty:ba,clone:L,purge:r});function at(F,bw,bx){F=a5(F);bx=bx||-1;var bv=[];while(F=F[bw]){if(F.nodeType===Node.ELEMENT_NODE){bv.push(aL.extend(F))}if(bv.length===bx){break}}return bv}function aR(F){return at(F,"parentNode")}function bs(F){return aL.select(F,"*")}function ad(F){F=a5(F).firstChild;while(F&&F.nodeType!==Node.ELEMENT_NODE){F=F.nextSibling}return a5(F)}function bo(bv){var F=[],bw=a5(bv).firstChild;while(bw){if(bw.nodeType===Node.ELEMENT_NODE){F.push(aL.extend(bw))}bw=bw.nextSibling}return F}function u(F){return at(F,"previousSibling")}function bn(F){return at(F,"nextSibling")}function a1(F){F=a5(F);var bw=u(F),bv=bn(F);return bw.reverse().concat(bv)}function aX(bv,F){bv=a5(bv);if(Object.isString(F)){return Prototype.Selector.match(bv,F)}return F.match(bv)}function a2(bv,bw,bx,F){bv=a5(bv),bx=bx||0,F=F||0;if(Object.isNumber(bx)){F=bx,bx=null}while(bv=bv[bw]){if(bv.nodeType!==1){continue}if(bx&&!Prototype.Selector.match(bv,bx)){continue}if(--F>=0){continue}return aL.extend(bv)}}function ag(bv,bw,F){bv=a5(bv);if(arguments.length===1){return a5(bv.parentNode)}return a2(bv,"parentNode",bw,F)}function E(bv,bx,F){if(arguments.length===1){return ad(bv)}bv=a5(bv),bx=bx||0,F=F||0;if(Object.isNumber(bx)){F=bx,bx="*"}var bw=Prototype.Selector.select(bx,bv)[F];return aL.extend(bw)}function n(bv,bw,F){return a2(bv,"previousSibling",bw,F)}function aH(bv,bw,F){return a2(bv,"nextSibling",bw,F)}function bh(F){F=a5(F);var bv=a7.call(arguments,1).join(", ");return Prototype.Selector.select(bv,F)}function aJ(bw){bw=a5(bw);var by=a7.call(arguments,1).join(", ");var bz=aL.siblings(bw),bv=[];for(var F=0,bx;bx=bz[F];F++){if(Prototype.Selector.match(bx,by)){bv.push(bx)}}return bv}function K(bv,F){bv=a5(bv),F=a5(F);if(!bv||!F){return false}while(bv=bv.parentNode){if(bv===F){return true}}return false}function I(bv,F){bv=a5(bv),F=a5(F);if(!bv||!F){return false}if(!F.contains){return K(bv,F)}return F.contains(bv)&&F!==bv}function P(bv,F){bv=a5(bv),F=a5(F);if(!bv||!F){return false}return(bv.compareDocumentPosition(F)&8)===8}var aS;if(aB.compareDocumentPosition){aS=P}else{if(aB.contains){aS=I}else{aS=K}}Object.extend(a9,{recursivelyCollect:at,ancestors:aR,descendants:bs,firstDescendant:ad,immediateDescendants:bo,previousSiblings:u,nextSiblings:bn,siblings:a1,match:aX,up:ag,down:E,previous:n,next:aH,select:bh,adjacent:aJ,descendantOf:aS,getElementsBySelector:bh,childElements:bo});var Z=1;function a0(F){F=a5(F);var bv=aL.readAttribute(F,"id");if(bv){return bv}do{bv="anonymous_element_"+Z++}while(a5(bv));aL.writeAttribute(F,"id",bv);return bv}function bf(bv,F){return a5(bv).getAttribute(F)}function Q(bv,F){bv=a5(bv);var bw=aM.read;if(bw.values[F]){return bw.values[F](bv,F)}if(bw.names[F]){F=bw.names[F]}if(F.include(":")){if(!bv.attributes||!bv.attributes[F]){return null}return bv.attributes[F].value}return bv.getAttribute(F)}function g(bv,F){if(F==="title"){return bv.title}return bv.getAttribute(F)}var aa=(function(){aB.setAttribute("onclick",[]);var F=aB.getAttribute("onclick");var bv=Object.isArray(F);aB.removeAttribute("onclick");return bv});if(Prototype.Browser.IE&&aa()){bf=Q}else{if(Prototype.Browser.Opera){bf=g}}function a6(bx,bw,bz){bx=a5(bx);var bv={},by=aM.write;if(typeof bw==="object"){bv=bw}else{bv[bw]=Object.isUndefined(bz)?true:bz}for(var F in bv){bw=by.names[F]||F;bz=bv[F];if(by.values[F]){bz=by.values[F](bx,bz);if(Object.isUndefined(bz)){continue}}if(bz===false||bz===null){bx.removeAttribute(bw)}else{if(bz===true){bx.setAttribute(bw,bw)}else{bx.setAttribute(bw,bz)}}}return bx}var b=(function(){if(!f){return false}var bv=document.createElement('');bv.checked=true;var F=bv.getAttributeNode("checked");return !F||!F.specified})();function ae(F,bw){bw=aM.has[bw]||bw;var bv=a5(F).getAttributeNode(bw);return !!(bv&&bv.specified)}function bm(F,bv){if(bv==="checked"){return F.checked}return ae(F,bv)}be.Element.Methods.Simulated.hasAttribute=b?bm:ae;function p(F){return new aL.ClassNames(F)}var ab={};function h(bv){if(ab[bv]){return ab[bv]}var F=new RegExp("(^|\\s+)"+bv+"(\\s+|$)");ab[bv]=F;return F}function ar(F,bv){if(!(F=a5(F))){return}var bw=F.className;if(bw.length===0){return false}if(bw===bv){return true}return h(bv).test(bw)}function t(F,bv){if(!(F=a5(F))){return}if(!ar(F,bv)){F.className+=(F.className?" ":"")+bv}return F}function aA(F,bv){if(!(F=a5(F))){return}F.className=F.className.replace(h(bv)," ").strip();return F}function ak(bv,bw,F){if(!(bv=a5(bv))){return}if(Object.isUndefined(F)){F=!ar(bv,bw)}var bx=aL[F?"addClassName":"removeClassName"];return bx(bv,bw)}var aM={};var aV="className",ay="for";aB.setAttribute(aV,"x");if(aB.className!=="x"){aB.setAttribute("class","x");if(aB.className==="x"){aV="class"}}var aQ=document.createElement("label");aQ.setAttribute(ay,"x");if(aQ.htmlFor!=="x"){aQ.setAttribute("htmlFor","x");if(aQ.htmlFor==="x"){ay="htmlFor"}}aQ=null;function ai(F,bv){return F.getAttribute(bv)}function l(F,bv){return F.getAttribute(bv,2)}function H(F,bw){var bv=F.getAttributeNode(bw);return bv?bv.value:""}function bp(F,bv){return a5(F).hasAttribute(bv)?bv:null}aB.onclick=Prototype.emptyFunction;var V=aB.getAttribute("onclick");var aC;if(String(V).indexOf("{")>-1){aC=function(F,bv){var bw=F.getAttribute(bv);if(!bw){return null}bw=bw.toString();bw=bw.split("{")[1];bw=bw.split("}")[0];return bw.strip()}}else{if(V===""){aC=function(F,bv){var bw=F.getAttribute(bv);if(!bw){return null}return bw.strip()}}}aM.read={names:{"class":aV,className:aV,"for":ay,htmlFor:ay},values:{style:function(F){return F.style.cssText.toLowerCase()},title:function(F){return F.title}}};aM.write={names:{className:"class",htmlFor:"for",cellpadding:"cellPadding",cellspacing:"cellSpacing"},values:{checked:function(F,bv){bv=!!bv;F.checked=bv;return bv?"checked":null},style:function(F,bv){F.style.cssText=bv?bv:""}}};aM.has={names:{}};Object.extend(aM.write.names,aM.read.names);var bc=$w("colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc frameBorder");for(var al=0,am;am=bc[al];al++){aM.write.names[am.toLowerCase()]=am;aM.has.names[am.toLowerCase()]=am}Object.extend(aM.read.values,{href:l,src:l,type:ai,action:H,disabled:bp,checked:bp,readonly:bp,multiple:bp,onload:aC,onunload:aC,onclick:aC,ondblclick:aC,onmousedown:aC,onmouseup:aC,onmouseover:aC,onmousemove:aC,onmouseout:aC,onfocus:aC,onblur:aC,onkeypress:aC,onkeydown:aC,onkeyup:aC,onsubmit:aC,onreset:aC,onselect:aC,onchange:aC});Object.extend(a9,{identify:a0,readAttribute:bf,writeAttribute:a6,classNames:p,hasClassName:ar,addClassName:t,removeClassName:aA,toggleClassName:ak});function ac(F){if(F==="float"||F==="styleFloat"){return"cssFloat"}return F.camelize()}function bu(F){if(F==="float"||F==="cssFloat"){return"styleFloat"}return F.camelize()}function J(bw,bx){bw=a5(bw);var bA=bw.style,bv;if(Object.isString(bx)){bA.cssText+=";"+bx;if(bx.include("opacity")){var F=bx.match(/opacity:\s*(\d?\.?\d*)/)[1];aL.setOpacity(bw,F)}return bw}for(var bz in bx){if(bz==="opacity"){aL.setOpacity(bw,bx[bz])}else{var by=bx[bz];if(bz==="float"||bz==="cssFloat"){bz=Object.isUndefined(bA.styleFloat)?"cssFloat":"styleFloat"}bA[bz]=by}}return bw}function aU(bv,bw){bv=a5(bv);bw=ac(bw);var bx=bv.style[bw];if(!bx||bx==="auto"){var F=document.defaultView.getComputedStyle(bv,null);bx=F?F[bw]:null}if(bw==="opacity"){return bx?parseFloat(bx):1}return bx==="auto"?null:bx}function y(F,bv){switch(bv){case"height":case"width":if(!aL.visible(F)){return null}var bw=parseInt(aU(F,bv),10);if(bw!==F["offset"+bv.capitalize()]){return bw+"px"}return aL.measure(F,bv);default:return aU(F,bv)}}function ap(F,bv){F=a5(F);bv=bu(bv);var bw=F.style[bv];if(!bw&&F.currentStyle){bw=F.currentStyle[bv]}if(bv==="opacity"){if(!T){return bk(F)}else{return bw?parseFloat(bw):1}}if(bw==="auto"){if((bv==="width"||bv==="height")&&aL.visible(F)){return aL.measure(F,bv)+"px"}return null}return bw}function aG(F){return(F||"").replace(/alpha\([^\)]*\)/gi,"")}function ah(F){if(!F.currentStyle||!F.currentStyle.hasLayout){F.style.zoom=1}return F}var T=(function(){aB.style.cssText="opacity:.55";return/^0.55/.test(aB.style.opacity)})();function G(F,bv){F=a5(F);if(bv==1||bv===""){bv=""}else{if(bv<0.00001){bv=0}}F.style.opacity=bv;return F}function bl(F,bx){if(T){return G(F,bx)}F=ah(a5(F));var bw=aL.getStyle(F,"filter"),bv=F.style;if(bx==1||bx===""){bw=aG(bw);if(bw){bv.filter=bw}else{bv.removeAttribute("filter")}return F}if(bx<0.00001){bx=0}bv.filter=aG(bw)+" alpha(opacity="+(bx*100)+")";return F}function bj(F){return aL.getStyle(F,"opacity")}function bk(bv){if(T){return bj(bv)}var bw=aL.getStyle(bv,"filter");if(bw.length===0){return 1}var F=(bw||"").match(/alpha\(opacity=(.*)\)/i);if(F&&F[1]){return parseFloat(F[1])/100}return 1}Object.extend(a9,{setStyle:J,getStyle:aU,setOpacity:G,getOpacity:bj});if("styleFloat" in aB.style){a9.getStyle=ap;a9.setOpacity=bl;a9.getOpacity=bk}var q=0;be.Element.Storage={UID:1};function S(F){if(F===window){return 0}if(typeof F._prototypeUID==="undefined"){F._prototypeUID=aL.Storage.UID++}return F._prototypeUID}function e(F){if(F===window){return 0}if(F==document){return 1}return F.uniqueID}var a4=("uniqueID" in aB);if(a4){S=e}function d(bv){if(!(bv=a5(bv))){return}var F=S(bv);if(!aL.Storage[F]){aL.Storage[F]=$H()}return aL.Storage[F]}function bb(bv,F,bw){if(!(bv=a5(bv))){return}var bx=d(bv);if(arguments.length===2){bx.update(F)}else{bx.set(F,bw)}return bv}function aT(bw,bv,F){if(!(bw=a5(bw))){return}var by=d(bw),bx=by.get(bv);if(Object.isUndefined(bx)){by.set(bv,F);bx=F}return bx}Object.extend(a9,{getStorage:d,store:bb,retrieve:aT});var au={},a3=aL.Methods.ByTag,aI=Prototype.BrowserFeatures;if(!aI.ElementExtensions&&("__proto__" in aB)){be.HTMLElement={};be.HTMLElement.prototype=aB.__proto__;aI.ElementExtensions=true}function bi(F){if(typeof window.Element==="undefined"){return false}if(!f){return false}var bw=window.Element.prototype;if(bw){var by="_"+(Math.random()+"").slice(2),bv=document.createElement(F);bw[by]="x";var bx=(bv[by]!=="x");delete bw[by];bv=null;return bx}return false}var aw=bi("object");function aq(bv,F){for(var bx in F){var bw=F[bx];if(Object.isFunction(bw)&&!(bx in bv)){bv[bx]=bw.methodize()}}}var bq={};function aE(bv){var F=S(bv);return(F in bq)}function aF(bw){if(!bw||aE(bw)){return bw}if(bw.nodeType!==Node.ELEMENT_NODE||bw==window){return bw}var F=Object.clone(au),bv=bw.tagName.toUpperCase();if(a3[bv]){Object.extend(F,a3[bv])}aq(bw,F);bq[S(bw)]=true;return bw}function aY(bv){if(!bv||aE(bv)){return bv}var F=bv.tagName;if(F&&(/^(?:object|applet|embed)$/i.test(F))){aq(bv,aL.Methods);aq(bv,aL.Methods.Simulated);aq(bv,aL.Methods.ByTag[F.toUpperCase()])}return bv}if(aI.SpecificElementExtensions){aF=aw?aY:Prototype.K}function Y(bv,F){bv=bv.toUpperCase();if(!a3[bv]){a3[bv]={}}Object.extend(a3[bv],F)}function v(bv,bw,F){if(Object.isUndefined(F)){F=false}for(var by in bw){var bx=bw[by];if(!Object.isFunction(bx)){continue}if(!F||!(by in bv)){bv[by]=bx.methodize()}}}function ao(bx){var F;var bw={OPTGROUP:"OptGroup",TEXTAREA:"TextArea",P:"Paragraph",FIELDSET:"FieldSet",UL:"UList",OL:"OList",DL:"DList",DIR:"Directory",H1:"Heading",H2:"Heading",H3:"Heading",H4:"Heading",H5:"Heading",H6:"Heading",Q:"Quote",INS:"Mod",DEL:"Mod",A:"Anchor",IMG:"Image",CAPTION:"TableCaption",COL:"TableCol",COLGROUP:"TableCol",THEAD:"TableSection",TFOOT:"TableSection",TBODY:"TableSection",TR:"TableRow",TH:"TableCell",TD:"TableCell",FRAMESET:"FrameSet",IFRAME:"IFrame"};if(bw[bx]){F="HTML"+bw[bx]+"Element"}if(window[F]){return window[F]}F="HTML"+bx+"Element";if(window[F]){return window[F]}F="HTML"+bx.capitalize()+"Element";if(window[F]){return window[F]}var bv=document.createElement(bx),by=bv.__proto__||bv.constructor.prototype;bv=null;return by}function X(bx){if(arguments.length===0){M()}if(arguments.length===2){var bz=bx;bx=arguments[1]}if(!bz){Object.extend(aL.Methods,bx||{})}else{if(Object.isArray(bz)){for(var by=0,bw;bw=bz[by];by++){Y(bw,bx)}}else{Y(bz,bx)}}var bv=window.HTMLElement?HTMLElement.prototype:aL.prototype;if(aI.ElementExtensions){v(bv,aL.Methods);v(bv,aL.Methods.Simulated,true)}if(aI.SpecificElementExtensions){for(var bw in aL.Methods.ByTag){var F=ao(bw);if(Object.isUndefined(F)){continue}v(F.prototype,a3[bw])}}Object.extend(aL,aL.Methods);Object.extend(aL,aL.Methods.Simulated);delete aL.ByTag;delete aL.Simulated;aL.extend.refresh();w={}}Object.extend(be.Element,{extend:aF,addMethods:X});if(aF===Prototype.K){be.Element.extend.refresh=Prototype.emptyFunction}else{be.Element.extend.refresh=function(){if(Prototype.BrowserFeatures.ElementExtensions){return}Object.extend(au,aL.Methods);Object.extend(au,aL.Methods.Simulated);bq={}}}function M(){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(aL.Methods.ByTag,{FORM:Object.clone(Form.Methods),INPUT:Object.clone(Form.Element.Methods),SELECT:Object.clone(Form.Element.Methods),TEXTAREA:Object.clone(Form.Element.Methods),BUTTON:Object.clone(Form.Element.Methods)})}aL.addMethods(a9);function s(){aB=null;w=null}if(window.attachEvent){window.attachEvent("onunload",s)}})(this);(function(){function q(N){var M=N.match(/^(\d+)%?$/i);if(!M){return null}return(Number(M[1])/100)}function F(N,O){N=$(N);var P=N.style[O];if(!P||P==="auto"){var M=document.defaultView.getComputedStyle(N,null);P=M?M[O]:null}if(O==="opacity"){return P?parseFloat(P):1}return P==="auto"?null:P}function I(M,N){var O=M.style[N];if(!O&&M.currentStyle){O=M.currentStyle[N]}return O}function y(O,N){var Q=O.offsetWidth;var S=B(O,"borderLeftWidth",N)||0;var M=B(O,"borderRightWidth",N)||0;var P=B(O,"paddingLeft",N)||0;var R=B(O,"paddingRight",N)||0;return Q-S-M-P-R}if(!Object.isUndefined(document.documentElement.currentStyle)&&!Prototype.Browser.Opera){F=I}function B(W,X,N){var Q=null;if(Object.isElement(W)){Q=W;W=F(Q,X)}if(W===null||Object.isUndefined(W)){return null}if((/^(?:-)?\d+(\.\d+)?(px)?$/i).test(W)){return window.parseFloat(W)}var R=W.include("%"),O=(N===document.viewport);if(/\d/.test(W)&&Q&&Q.runtimeStyle&&!(R&&O)){var M=Q.style.left,V=Q.runtimeStyle.left;Q.runtimeStyle.left=Q.currentStyle.left;Q.style.left=W||0;W=Q.style.pixelLeft;Q.style.left=M;Q.runtimeStyle.left=V;return W}if(Q&&R){N=N||Q.parentNode;var P=q(W),S=null;var U=X.include("left")||X.include("right")||X.include("width");var T=X.include("top")||X.include("bottom")||X.include("height");if(N===document.viewport){if(U){S=document.viewport.getWidth()}else{if(T){S=document.viewport.getHeight()}}}else{if(U){S=$(N).measure("width")}else{if(T){S=$(N).measure("height")}}}return(S===null)?0:S*P}return 0}function p(M){if(Object.isString(M)&&M.endsWith("px")){return M}return M+"px"}function s(M){while(M&&M.parentNode){var N=M.getStyle("display");if(N==="none"){return false}M=$(M.parentNode)}return true}var l=Prototype.K;if("currentStyle" in document.documentElement){l=function(M){if(!M.currentStyle.hasLayout){M.style.zoom=1}return M}}function o(M){if(M.include("border")){M=M+"-width"}return M.camelize()}Element.Layout=Class.create(Hash,{initialize:function($super,N,M){$super();this.element=$(N);Element.Layout.PROPERTIES.each(function(O){this._set(O,null)},this);if(M){this._preComputing=true;this._begin();Element.Layout.PROPERTIES.each(this._compute,this);this._end();this._preComputing=false}},_set:function(N,M){return Hash.prototype.set.call(this,N,M)},set:function(N,M){throw"Properties of Element.Layout are read-only."},get:function($super,N){var M=$super(N);return M===null?this._compute(N):M},_begin:function(){if(this._isPrepared()){return}var Q=this.element;if(s(Q)){this._setPrepared(true);return}var S={position:Q.style.position||"",width:Q.style.width||"",visibility:Q.style.visibility||"",display:Q.style.display||""};Q.store("prototype_original_styles",S);var T=F(Q,"position"),M=Q.offsetWidth;if(M===0||M===null){Q.style.display="block";M=Q.offsetWidth}var N=(T==="fixed")?document.viewport:Q.parentNode;var U={visibility:"hidden",display:"block"};if(T!=="fixed"){U.position="absolute"}Q.setStyle(U);var O=Q.offsetWidth,P;if(M&&(O===M)){P=y(Q,N)}else{if(T==="absolute"||T==="fixed"){P=y(Q,N)}else{var V=Q.parentNode,R=$(V).getLayout();P=R.get("width")-this.get("margin-left")-this.get("border-left")-this.get("padding-left")-this.get("padding-right")-this.get("border-right")-this.get("margin-right")}}Q.setStyle({width:P+"px"});this._setPrepared(true)},_end:function(){var N=this.element;var M=N.retrieve("prototype_original_styles");N.store("prototype_original_styles",null);N.setStyle(M);this._setPrepared(false)},_compute:function(N){var M=Element.Layout.COMPUTATIONS;if(!(N in M)){throw"Property not found."}return this._set(N,M[N].call(this,this.element))},_isPrepared:function(){return this.element.retrieve("prototype_element_layout_prepared",false)},_setPrepared:function(M){return this.element.store("prototype_element_layout_prepared",M)},toObject:function(){var M=$A(arguments);var N=(M.length===0)?Element.Layout.PROPERTIES:M.join(" ").split(" ");var O={};N.each(function(P){if(!Element.Layout.PROPERTIES.include(P)){return}var Q=this.get(P);if(Q!=null){O[P]=Q}},this);return O},toHash:function(){var M=this.toObject.apply(this,arguments);return new Hash(M)},toCSS:function(){var M=$A(arguments);var O=(M.length===0)?Element.Layout.PROPERTIES:M.join(" ").split(" ");var N={};O.each(function(P){if(!Element.Layout.PROPERTIES.include(P)){return}if(Element.Layout.COMPOSITE_PROPERTIES.include(P)){return}var Q=this.get(P);if(Q!=null){N[o(P)]=Q+"px"}},this);return N},inspect:function(){return"#"}});Object.extend(Element.Layout,{PROPERTIES:$w("height width top left right bottom border-left border-right border-top border-bottom padding-left padding-right padding-top padding-bottom margin-top margin-bottom margin-left margin-right padding-box-width padding-box-height border-box-width border-box-height margin-box-width margin-box-height"),COMPOSITE_PROPERTIES:$w("padding-box-width padding-box-height margin-box-width margin-box-height border-box-width border-box-height"),COMPUTATIONS:{height:function(O){if(!this._preComputing){this._begin()}var M=this.get("border-box-height");if(M<=0){if(!this._preComputing){this._end()}return 0}var P=this.get("border-top"),N=this.get("border-bottom");var R=this.get("padding-top"),Q=this.get("padding-bottom");if(!this._preComputing){this._end()}return M-P-N-R-Q},width:function(O){if(!this._preComputing){this._begin()}var N=this.get("border-box-width");if(N<=0){if(!this._preComputing){this._end()}return 0}var R=this.get("border-left"),M=this.get("border-right");var P=this.get("padding-left"),Q=this.get("padding-right");if(!this._preComputing){this._end()}return N-R-M-P-Q},"padding-box-height":function(N){var M=this.get("height"),P=this.get("padding-top"),O=this.get("padding-bottom");return M+P+O},"padding-box-width":function(M){var N=this.get("width"),O=this.get("padding-left"),P=this.get("padding-right");return N+O+P},"border-box-height":function(N){if(!this._preComputing){this._begin()}var M=N.offsetHeight;if(!this._preComputing){this._end()}return M},"border-box-width":function(M){if(!this._preComputing){this._begin()}var N=M.offsetWidth;if(!this._preComputing){this._end()}return N},"margin-box-height":function(N){var M=this.get("border-box-height"),O=this.get("margin-top"),P=this.get("margin-bottom");if(M<=0){return 0}return M+O+P},"margin-box-width":function(O){var N=this.get("border-box-width"),P=this.get("margin-left"),M=this.get("margin-right");if(N<=0){return 0}return N+P+M},top:function(M){var N=M.positionedOffset();return N.top},bottom:function(M){var P=M.positionedOffset(),N=M.getOffsetParent(),O=N.measure("height");var Q=this.get("border-box-height");return O-Q-P.top},left:function(M){var N=M.positionedOffset();return N.left},right:function(O){var Q=O.positionedOffset(),P=O.getOffsetParent(),M=P.measure("width");var N=this.get("border-box-width");return M-N-Q.left},"padding-top":function(M){return B(M,"paddingTop")},"padding-bottom":function(M){return B(M,"paddingBottom")},"padding-left":function(M){return B(M,"paddingLeft")},"padding-right":function(M){return B(M,"paddingRight")},"border-top":function(M){return B(M,"borderTopWidth")},"border-bottom":function(M){return B(M,"borderBottomWidth")},"border-left":function(M){return B(M,"borderLeftWidth")},"border-right":function(M){return B(M,"borderRightWidth")},"margin-top":function(M){return B(M,"marginTop")},"margin-bottom":function(M){return B(M,"marginBottom")},"margin-left":function(M){return B(M,"marginLeft")},"margin-right":function(M){return B(M,"marginRight")}}});if("getBoundingClientRect" in document.documentElement){Object.extend(Element.Layout.COMPUTATIONS,{right:function(N){var O=l(N.getOffsetParent());var P=N.getBoundingClientRect(),M=O.getBoundingClientRect();return(M.right-P.right).round()},bottom:function(N){var O=l(N.getOffsetParent());var P=N.getBoundingClientRect(),M=O.getBoundingClientRect();return(M.bottom-P.bottom).round()}})}Element.Offset=Class.create({initialize:function(N,M){this.left=N.round();this.top=M.round();this[0]=this.left;this[1]=this.top},relativeTo:function(M){return new Element.Offset(this.left-M.left,this.top-M.top)},inspect:function(){return"#".interpolate(this)},toString:function(){return"[#{left}, #{top}]".interpolate(this)},toArray:function(){return[this.left,this.top]}});function G(N,M){return new Element.Layout(N,M)}function f(M,N){return $(M).getLayout().get(N)}function w(M){return Element.getDimensions(M).height}function e(M){return Element.getDimensions(M).width}function z(N){N=$(N);var R=Element.getStyle(N,"display");if(R&&R!=="none"){return{width:N.offsetWidth,height:N.offsetHeight}}var O=N.style;var M={visibility:O.visibility,position:O.position,display:O.display};var Q={visibility:"hidden",display:"block"};if(M.position!=="fixed"){Q.position="absolute"}Element.setStyle(N,Q);var P={width:N.offsetWidth,height:N.offsetHeight};Element.setStyle(N,M);return P}function v(M){M=$(M);function O(P){return t(P)?$(document.body):$(P)}if(n(M)||h(M)||u(M)||t(M)){return $(document.body)}var N=(Element.getStyle(M,"display")==="inline");if(!N&&M.offsetParent){return O(M.offsetParent)}while((M=M.parentNode)&&M!==document.body){if(Element.getStyle(M,"position")!=="static"){return O(M)}}return $(document.body)}function J(N){N=$(N);var M=0,O=0;if(N.parentNode){do{M+=N.offsetTop||0;O+=N.offsetLeft||0;N=N.offsetParent}while(N)}return new Element.Offset(O,M)}function D(N){N=$(N);var O=N.getLayout();var M=0,Q=0;do{M+=N.offsetTop||0;Q+=N.offsetLeft||0;N=N.offsetParent;if(N){if(u(N)){break}var P=Element.getStyle(N,"position");if(P!=="static"){break}}}while(N);Q-=O.get("margin-left");M-=O.get("margin-top");return new Element.Offset(Q,M)}function d(N){var M=0,O=0;do{if(N===document.body){var P=document.documentElement||document.body.parentNode||document.body;M+=!Object.isUndefined(window.pageYOffset)?window.pageYOffset:P.scrollTop||0;O+=!Object.isUndefined(window.pageXOffset)?window.pageXOffset:P.scrollLeft||0;break}else{M+=N.scrollTop||0;O+=N.scrollLeft||0;N=N.parentNode}}while(N);return new Element.Offset(O,M)}function H(Q){var M=0,P=0,O=document.body;Q=$(Q);var N=Q;do{M+=N.offsetTop||0;P+=N.offsetLeft||0;if(N.offsetParent==O&&Element.getStyle(N,"position")=="absolute"){break}}while(N=N.offsetParent);N=Q;do{if(N!=O){M-=N.scrollTop||0;P-=N.scrollLeft||0}}while(N=N.parentNode);return new Element.Offset(P,M)}function E(M){M=$(M);if(Element.getStyle(M,"position")==="absolute"){return M}var Q=v(M);var P=M.viewportOffset(),N=Q.viewportOffset();var R=P.relativeTo(N);var O=M.getLayout();M.store("prototype_absolutize_original_styles",{position:M.getStyle("position"),left:M.getStyle("left"),top:M.getStyle("top"),width:M.getStyle("width"),height:M.getStyle("height")});M.setStyle({position:"absolute",top:R.top+"px",left:R.left+"px",width:O.get("width")+"px",height:O.get("height")+"px"});return M}function r(N){N=$(N);if(Element.getStyle(N,"position")==="relative"){return N}var M=N.retrieve("prototype_absolutize_original_styles");if(M){N.setStyle(M)}return N}function b(M){M=$(M);var N=Element.cumulativeOffset(M);window.scrollTo(N.left,N.top);return M}function C(N){N=$(N);var M=Element.getStyle(N,"position"),O={};if(M==="static"||!M){O.position="relative";if(Prototype.Browser.Opera){O.top=0;O.left=0}Element.setStyle(N,O);Element.store(N,"prototype_made_positioned",true)}return N}function A(M){M=$(M);var O=Element.getStorage(M),N=O.get("prototype_made_positioned");if(N){O.unset("prototype_made_positioned");Element.setStyle(M,{position:"",top:"",bottom:"",left:"",right:""})}return M}function g(N){N=$(N);var P=Element.getStorage(N),M=P.get("prototype_made_clipping");if(Object.isUndefined(M)){var O=Element.getStyle(N,"overflow");P.set("prototype_made_clipping",O);if(O!=="hidden"){N.style.overflow="hidden"}}return N}function K(M){M=$(M);var O=Element.getStorage(M),N=O.get("prototype_made_clipping");if(!Object.isUndefined(N)){O.unset("prototype_made_clipping");M.style.overflow=N||""}return M}function L(P,M,X){X=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},X||{});var O=document.documentElement;M=$(M);P=$(P);var N,V,R,W={};if(X.setLeft||X.setTop){N=Element.viewportOffset(M);V=[0,0];if(Element.getStyle(P,"position")==="absolute"){var U=Element.getOffsetParent(P);if(U!==document.body){V=Element.viewportOffset(U)}}}function S(){var Y=0,Z=0;if(Object.isNumber(window.pageXOffset)){Y=window.pageXOffset;Z=window.pageYOffset}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){Y=document.body.scrollLeft;Z=document.body.scrollTop}else{if(O&&(O.scrollLeft||O.scrollTop)){Y=O.scrollLeft;Z=O.scrollTop}}}return{x:Y,y:Z}}var Q=S();if(X.setWidth||X.setHeight){R=Element.getLayout(M)}if(X.setLeft){W.left=(N[0]+Q.x-V[0]+X.offsetLeft)+"px"}if(X.setTop){W.top=(N[1]+Q.y-V[1]+X.offsetTop)+"px"}var T=P.getLayout();if(X.setWidth){W.width=R.get("width")+"px"}if(X.setHeight){W.height=R.get("height")+"px"}return Element.setStyle(P,W)}if(Prototype.Browser.IE){v=v.wrap(function(O,N){N=$(N);if(n(N)||h(N)||u(N)||t(N)){return $(document.body)}var M=N.getStyle("position");if(M!=="static"){return O(N)}N.setStyle({position:"relative"});var P=O(N);N.setStyle({position:M});return P});D=D.wrap(function(P,N){N=$(N);if(!N.parentNode){return new Element.Offset(0,0)}var M=N.getStyle("position");if(M!=="static"){return P(N)}var O=N.getOffsetParent();if(O&&O.getStyle("position")==="fixed"){l(O)}N.setStyle({position:"relative"});var Q=P(N);N.setStyle({position:M});return Q})}else{if(Prototype.Browser.Webkit){J=function(N){N=$(N);var M=0,O=0;do{M+=N.offsetTop||0;O+=N.offsetLeft||0;if(N.offsetParent==document.body){if(Element.getStyle(N,"position")=="absolute"){break}}N=N.offsetParent}while(N);return new Element.Offset(O,M)}}}Element.addMethods({getLayout:G,measure:f,getWidth:e,getHeight:w,getDimensions:z,getOffsetParent:v,cumulativeOffset:J,positionedOffset:D,cumulativeScrollOffset:d,viewportOffset:H,absolutize:E,relativize:r,scrollTo:b,makePositioned:C,undoPositioned:A,makeClipping:g,undoClipping:K,clonePosition:L});function u(M){return M.nodeName.toUpperCase()==="BODY"}function t(M){return M.nodeName.toUpperCase()==="HTML"}function n(M){return M.nodeType===Node.DOCUMENT_NODE}function h(M){return M!==document.body&&!Element.descendantOf(M,document.body)}if("getBoundingClientRect" in document.documentElement){Element.addMethods({viewportOffset:function(M){M=$(M);if(h(M)){return new Element.Offset(0,0)}var N=M.getBoundingClientRect(),O=document.documentElement;return new Element.Offset(N.left-O.clientLeft,N.top-O.clientTop)}})}})();(function(){var e=Prototype.Browser.Opera&&(window.parseFloat(window.opera.version())<9.5);var h=null;function d(){if(h){return h}h=e?document.body:document.documentElement;return h}function f(){return{width:this.getWidth(),height:this.getHeight()}}function b(){return d().clientWidth}function l(){return d().clientHeight}function g(){var n=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft;var o=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop;return new Element.Offset(n,o)}document.viewport={getDimensions:f,getWidth:b,getHeight:l,getScrollOffsets:g}})();window.$$=function(){var b=$A(arguments).join(", ");return Prototype.Selector.select(b,document)};Prototype.Selector=(function(){function b(){throw new Error('Method "Prototype.Selector.select" must be defined.')}function e(){throw new Error('Method "Prototype.Selector.match" must be defined.')}function f(q,r,n){n=n||0;var l=Prototype.Selector.match,p=q.length,h=0,o;for(o=0;o-1,Gecko:d.indexOf("Gecko")>-1&&d.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile/.test(d)}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var b=window.Element||window.HTMLElement;return !!(b&&b.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var e=document.createElement("div"),d=document.createElement("form"),b=false;if(e.__proto__&&(e.__proto__!==d.__proto__)){b=true}e=d=null;return b})()},ScriptFragment:"]*>([\\S\\s]*?)<\/script\\s*>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(b){return b}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Class=(function(){var f=(function(){for(var g in {toString:1}){if(g==="toString"){return false}}return true})();function b(){}function d(){var n=null,l=$A(arguments);if(Object.isFunction(l[0])){n=l.shift()}function g(){this.initialize.apply(this,arguments)}Object.extend(g,Class.Methods);g.superclass=n;g.subclasses=[];if(n){b.prototype=n.prototype;g.prototype=new b;n.subclasses.push(g)}for(var h=0,o=l.length;h0){match=source.match(pattern);if(match&&match[0].length>0){result+=source.slice(0,match.index);result+=String.interpret(replacement(match));source=source.slice(match.index+match[0].length)}else{result+=source,source=""}}return result}function sub(pattern,replacement,count){replacement=prepareReplacement(replacement);count=Object.isUndefined(count)?1:count;return this.gsub(pattern,function(match){if(--count<0){return match[0]}return replacement(match)})}function scan(pattern,iterator){this.gsub(pattern,iterator);return String(this)}function truncate(length,truncation){length=length||30;truncation=Object.isUndefined(truncation)?"...":truncation;return this.length>length?this.slice(0,length-truncation.length)+truncation:String(this)}function strip(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}function stripTags(){return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>'"])+)?\s*("[^">]*|'[^'>])?(\/)?>|<\/\w+>/gi, '')}function stripScripts(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")}function extractScripts(){var matchAll=new RegExp(Prototype.ScriptFragment,"img"),matchOne=new RegExp(Prototype.ScriptFragment,"im");return(this.match(matchAll)||[]).map(function(scriptTag){return(scriptTag.match(matchOne)||["",""])[1]})}function evalScripts(){return this.extractScripts().map(function(script){return eval(script)})}function escapeHTML(){return this.replace(/&/g,"&").replace(//g,">")}function unescapeHTML(){return this.stripTags().replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function toQueryParams(separator){var match=this.strip().match(/([^?#]*)(#.*)?$/);if(!match){return{}}return match[1].split(separator||"&").inject({},function(hash,pair){if((pair=pair.split("="))[0]){var key=decodeURIComponent(pair.shift()),value=pair.length>1?pair.join("="):pair[0];if(value!=undefined){value=value.gsub("+"," ");value=decodeURIComponent(value)}if(key in hash){if(!Object.isArray(hash[key])){hash[key]=[hash[key]]}hash[key].push(value)}else{hash[key]=value}}return hash})}function toArray(){return this.split("")}function succ(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)}function times(count){return count<1?"":new Array(count+1).join(this)}function camelize(){return this.replace(/-+(.)?/g,function(match,chr){return chr?chr.toUpperCase():""})}function capitalize(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()}function underscore(){return this.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/-/g,"_").toLowerCase()}function dasherize(){return this.replace(/_/g,"-")}function inspect(useDoubleQuotes){var escapedString=this.replace(/[\x00-\x1f\\]/g,function(character){if(character in String.specialChar){return String.specialChar[character]}return"\\u00"+character.charCodeAt().toPaddedString(2,16)});if(useDoubleQuotes){return'"'+escapedString.replace(/"/g,'\\"')+'"'}return"'"+escapedString.replace(/'/g,"\\'")+"'"}function unfilterJSON(filter){return this.replace(filter||Prototype.JSONFilter,"$1")}function isJSON(){var str=this;if(str.blank()){return false}str=str.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@");str=str.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]");str=str.replace(/(?:^|:|,)(?:\s*\[)+/g,"");return(/^[\],:{}\s]*$/).test(str)}function evalJSON(sanitize){var json=this.unfilterJSON(),cx=/[\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff\u0000]/g;if(cx.test(json)){json=json.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}try{if(!sanitize||json.isJSON()){return eval("("+json+")")}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())}function parseJSON(){var json=this.unfilterJSON();return JSON.parse(json)}function include(pattern){return this.indexOf(pattern)>-1}function startsWith(pattern,position){position=Object.isNumber(position)?position:0;return this.lastIndexOf(pattern,position)===position}function endsWith(pattern,position){pattern=String(pattern);position=Object.isNumber(position)?position:this.length;if(position<0){position=0}if(position>this.length){position=this.length}var d=position-pattern.length;return d>=0&&this.indexOf(pattern,d)===d}function empty(){return this==""}function blank(){return/^\s*$/.test(this)}function interpolate(object,pattern){return new Template(this,pattern).evaluate(object)}return{gsub:gsub,sub:sub,scan:scan,truncate:truncate,strip:String.prototype.trim||strip,stripTags:stripTags,stripScripts:stripScripts,extractScripts:extractScripts,evalScripts:evalScripts,escapeHTML:escapeHTML,unescapeHTML:unescapeHTML,toQueryParams:toQueryParams,parseQuery:toQueryParams,toArray:toArray,succ:succ,times:times,camelize:camelize,capitalize:capitalize,underscore:underscore,dasherize:dasherize,inspect:inspect,unfilterJSON:unfilterJSON,isJSON:isJSON,evalJSON:NATIVE_JSON_PARSE_SUPPORT?parseJSON:evalJSON,include:include,startsWith:String.prototype.startsWith||startsWith,endsWith:String.prototype.endsWith||endsWith,empty:empty,blank:blank,interpolate:interpolate}})());var Template=Class.create({initialize:function(b,d){this.template=b.toString();this.pattern=d||Template.Pattern},evaluate:function(b){if(b&&Object.isFunction(b.toTemplateReplacements)){b=b.toTemplateReplacements()}return this.template.gsub(this.pattern,function(f){if(b==null){return(f[1]+"")}var h=f[1]||"";if(h=="\\"){return f[2]}var d=b,l=f[3],g=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;f=g.exec(l);if(f==null){return h}while(f!=null){var e=f[1].startsWith("[")?f[2].replace(/\\\\]/g,"]"):f[1];d=d[e];if(null==d||""==f[3]){break}l=l.substring("["==f[3]?f[1].length:f[0].length);f=g.exec(l)}return h+String.interpret(d)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable=(function(){function e(E,D){try{this._each(E,D)}catch(F){if(F!=$break){throw F}}return this}function y(G,F,E){var D=-G,H=[],I=this.toArray();if(G<1){return I}while((D+=G)=D){D=H}},this);return D}function t(F,E){F=F||Prototype.K;var D;this.each(function(H,G){H=F.call(E,H,G,this);if(D==null||HF?1:0}).pluck("value")}function u(){return this.map()}function z(){var E=Prototype.K,D=$A(arguments);if(Object.isFunction(D.last())){E=D.pop()}var F=[this].concat(D).map($A);return this.map(function(H,G){return E(F.pluck(G))})}function q(){return this.toArray().length}function B(){return"#"}return{each:e,eachSlice:y,all:d,every:d,any:o,some:o,collect:p,map:p,detect:A,findAll:n,select:n,filter:n,grep:l,include:b,member:b,inGroupsOf:w,inject:r,invoke:C,max:v,min:t,partition:g,pluck:h,reject:f,sortBy:s,toArray:u,entries:u,zip:z,size:q,inspect:B,find:A}})();function $A(e){if(!e){return[]}if("toArray" in Object(e)){return e.toArray()}var d=e.length||0,b=new Array(d);while(d--){b[d]=e[d]}return b}function $w(b){if(!Object.isString(b)){return[]}b=b.strip();return b?b.split(/\s+/):[]}Array.from=Array.from||$A;(function(){var C=Array.prototype,u=C.slice,w=C.forEach;function d(I,H){for(var G=0,J=this.length>>>0;G>>0;if(I===0){return -1}H=Number(H);if(isNaN(H)){H=0}else{if(H!==0&&isFinite(H)){H=(H>0?1:-1)*Math.floor(Math.abs(H))}}if(H>I){return -1}var G=H>=0?H:Math.max(I-Math.abs(H),0);for(;G>>0;if(I===0){return -1}if(!Object.isUndefined(H)){H=Number(H);if(isNaN(H)){H=0}else{if(H!==0&&isFinite(H)){H=(H>0?1:-1)*Math.floor(Math.abs(H))}}}else{H=I}var G=H>=0?Math.min(H,I-1):I-Math.abs(H);for(;G>=0;G--){if(G in K&&K[G]===J){return G}}return -1}function e(N){var L=[],M=u.call(arguments,0),O,H=0;M.unshift(this);for(var K=0,G=M.length;K>>0;H>>0;H>>0;H>>0;H"}function n(){return new Hash(this)}return{initialize:g,_each:h,set:p,get:e,unset:s,toObject:u,toTemplateReplacements:u,keys:t,values:r,index:l,merge:o,update:f,toQueryString:b,inspect:q,toJSON:u,clone:n}})());Hash.from=$H;Object.extend(Number.prototype,(function(){function f(){return this.toPaddedString(2,16)}function d(){return this+1}function n(p,o){$R(0,this,true).each(p,o);return this}function l(q,p){var o=this.toString(p||10);return"0".times(q-o.length)+o}function b(){return Math.abs(this)}function e(){return Math.round(this)}function g(){return Math.ceil(this)}function h(){return Math.floor(this)}return{toColorPart:f,succ:d,times:n,toPaddedString:l,abs:b,round:e,ceil:g,floor:h}})());function $R(e,b,d){return new ObjectRange(e,b,d)}var ObjectRange=Class.create(Enumerable,(function(){function d(h,f,g){this.start=h;this.end=f;this.exclusive=g}function e(h,g){var l=this.start,f;for(f=0;this.include(l);f++){h.call(g,l,f);l=l.succ()}}function b(f){if(f1&&!((b==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var g={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){g["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){g.Connection="close"}}if(typeof this.options.requestHeaders=="object"){var e=this.options.requestHeaders;if(Object.isFunction(e.push)){for(var d=0,f=e.length;d=200&&b<300)||b==304},getStatus:function(){try{if(this.transport.status===1223){return 204}return this.transport.status||0}catch(b){return 0}},respondToReadyState:function(b){var f=Ajax.Request.Events[b],d=new Ajax.Response(this);if(f=="Complete"){try{this._complete=true;(this.options["on"+d.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(d,d.headerJSON)}catch(g){this.dispatchException(g)}var h=d.getHeader("Content-type");if(this.options.evalJS=="force"||(this.options.evalJS&&this.isSameOrigin()&&h&&h.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse()}}try{(this.options["on"+f]||Prototype.emptyFunction)(d,d.headerJSON);Ajax.Responders.dispatch("on"+f,this,d,d.headerJSON)}catch(g){this.dispatchException(g)}if(f=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction}},isSameOrigin:function(){var b=this.url.match(/^\s*https?:\/\/[^\/]*/);return !b||(b[0]=="#{protocol}//#{domain}#{port}".interpolate({protocol:location.protocol,domain:document.domain,port:location.port?":"+location.port:""}))},getHeader:function(b){try{return this.transport.getResponseHeader(b)||null}catch(d){return null}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON())}catch(e){this.dispatchException(e)}},dispatchException:function(b){(this.options.onException||Prototype.emptyFunction)(this,b);Ajax.Responders.dispatch("onException",this,b)}});Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Response=Class.create({initialize:function(e){this.request=e;var f=this.transport=e.transport,b=this.readyState=f.readyState;if((b>2&&!Prototype.Browser.IE)||b==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(f.responseText);this.headerJSON=this._getHeaderJSON()}if(b==4){var d=f.responseXML;this.responseXML=Object.isUndefined(d)?null:d;this.responseJSON=this._getResponseJSON()}},status:0,statusText:"",getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||""}catch(b){return""}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders()}catch(b){return null}},getResponseHeader:function(b){return this.transport.getResponseHeader(b)},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders()},_getHeaderJSON:function(){var b=this.getHeader("X-JSON");if(!b){return null}try{b=decodeURIComponent(escape(b))}catch(d){}try{return b.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin())}catch(d){this.request.dispatchException(d)}},_getResponseJSON:function(){var b=this.request.options;if(!b.evalJSON||(b.evalJSON!="force"&&!(this.getHeader("Content-type")||"").include("application/json"))||this.responseText.blank()){return null}try{return this.responseText.evalJSON(b.sanitizeJSON||!this.request.isSameOrigin())}catch(d){this.request.dispatchException(d)}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,b,e,d){this.container={success:(b.success||b),failure:(b.failure||(b.success?null:b))};d=Object.clone(d);var f=d.onComplete;d.onComplete=(function(g,h){this.updateContent(g.responseText);if(Object.isFunction(f)){f(g,h)}}).bind(this);$super(e,d)},updateContent:function(f){var e=this.container[this.success()?"success":"failure"],b=this.options;if(!b.evalScripts){f=f.stripScripts()}if(e=$(e)){if(b.insertion){if(Object.isString(b.insertion)){var d={};d[b.insertion]=f;e.insert(d)}else{b.insertion(e,f)}}else{e.update(f)}}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,b,e,d){$super(d);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=b;this.url=e;this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent()},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments)},updateComplete:function(b){if(this.options.decay){this.decay=(b.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=b.responseText}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});(function(be){var aK;var a7=Array.prototype.slice;var aB=document.createElement("div");function a5(bv){if(arguments.length>1){for(var F=0,bx=[],bw=arguments.length;F');return F.tagName.toLowerCase()==="input"&&F.name==="x"}catch(bv){return false}})();var aO=be.Element;function aL(bv,F){F=F||{};bv=bv.toLowerCase();if(f&&F.name){bv="<"+bv+' name="'+F.name+'">';delete F.name;return aL.writeAttribute(document.createElement(bv),F)}if(!w[bv]){w[bv]=aL.extend(document.createElement(bv))}var bw=aW(bv,F)?w[bv].cloneNode(false):document.createElement(bv);return aL.writeAttribute(bw,F)}be.Element=aL;Object.extend(be.Element,aO||{});if(aO){be.Element.prototype=aO.prototype}aL.Methods={ByTag:{},Simulated:{}};var a9={};var N={id:"id",className:"class"};function bg(bv){bv=a5(bv);var F="<"+bv.tagName.toLowerCase();var bw,by;for(var bx in N){bw=N[bx];by=(bv[bx]||"").toString();if(by){F+=" "+bw+"="+by.inspect(true)}}return F+">"}a9.inspect=bg;function B(F){return a5(F).getStyle("display")!=="none"}function aD(bv,F){bv=a5(bv);if(typeof F!=="boolean"){F=!aL.visible(bv)}aL[F?"show":"hide"](bv);return bv}function aN(F){F=a5(F);F.style.display="none";return F}function o(F){F=a5(F);F.style.display="";return F}Object.extend(a9,{visible:B,toggle:aD,hide:aN,show:o});function aj(F){F=a5(F);F.parentNode&&F.parentNode.removeChild(F);return F}var aZ=(function(){var F=document.createElement("select"),bv=true;F.innerHTML='';if(F.options&&F.options[0]){bv=F.options[0].nodeName.toUpperCase()!=="OPTION"}F=null;return bv})();var O=(function(){try{var F=document.createElement("table");if(F&&F.tBodies){F.innerHTML="test";var bw=typeof F.tBodies[0]=="undefined";F=null;return bw}}catch(bv){return true}})();var a8=(function(){try{var F=document.createElement("div");F.innerHTML="";var bw=(F.childNodes.length===0);F=null;return bw}catch(bv){return true}})();var D=aZ||O||a8;var ax=(function(){var F=document.createElement("script"),bw=false;try{F.appendChild(document.createTextNode(""));bw=!F.firstChild||F.firstChild&&F.firstChild.nodeType!==3}catch(bv){bw=true}F=null;return bw})();function U(bx,bz){bx=a5(bx);var bA=bx.getElementsByTagName("*"),bw=bA.length;while(bw--){af(bA[bw])}if(bz&&bz.toElement){bz=bz.toElement()}if(Object.isElement(bz)){return bx.update().insert(bz)}bz=Object.toHTML(bz);var bv=bx.tagName.toUpperCase();if(bv==="SCRIPT"&&ax){bx.text=bz;return bx}if(D){if(bv in R.tags){while(bx.firstChild){bx.removeChild(bx.firstChild)}var F=z(bv,bz.stripScripts());for(var bw=0,by;by=F[bw];bw++){bx.appendChild(by)}}else{if(a8&&Object.isString(bz)&&bz.indexOf("-1){while(bx.firstChild){bx.removeChild(bx.firstChild)}var F=z(bv,bz.stripScripts(),true);for(var bw=0,by;by=F[bw];bw++){bx.appendChild(by)}}else{bx.innerHTML=bz.stripScripts()}}}else{bx.innerHTML=bz.stripScripts()}bz.evalScripts.bind(bz).defer();return bx}function an(bv,bw){bv=a5(bv);if(bw&&bw.toElement){bw=bw.toElement()}else{if(!Object.isElement(bw)){bw=Object.toHTML(bw);var F=bv.ownerDocument.createRange();F.selectNode(bv);bw.evalScripts.bind(bw).defer();bw=F.createContextualFragment(bw.stripScripts())}}bv.parentNode.replaceChild(bw,bv);return bv}var R={before:function(F,bv){F.parentNode.insertBefore(bv,F)},top:function(F,bv){F.insertBefore(bv,F.firstChild)},bottom:function(F,bv){F.appendChild(bv)},after:function(F,bv){F.parentNode.insertBefore(bv,F.nextSibling)},tags:{TABLE:["","
",1],TBODY:["","
",2],TR:["","
",3],TD:["
","
",4],SELECT:["",1]}};var aP=R.tags;Object.extend(aP,{THEAD:aP.TBODY,TFOOT:aP.TBODY,TH:aP.TD});function av(bw,bz){bw=a5(bw);if(bz&&bz.toElement){bz=bz.toElement()}if(Object.isElement(bz)){bw.parentNode.replaceChild(bz,bw);return bw}bz=Object.toHTML(bz);var by=bw.parentNode,bv=by.tagName.toUpperCase();if(bv in R.tags){var bA=aL.next(bw);var F=z(bv,bz.stripScripts());by.removeChild(bw);var bx;if(bA){bx=function(bB){by.insertBefore(bB,bA)}}else{bx=function(bB){by.appendChild(bB)}}F.each(bx)}else{bw.outerHTML=bz.stripScripts()}bz.evalScripts.bind(bz).defer();return bw}if("outerHTML" in document.documentElement){an=av}function bd(F){if(Object.isUndefined(F)||F===null){return false}if(Object.isString(F)||Object.isNumber(F)){return true}if(Object.isElement(F)){return true}if(F.toElement||F.toHTML){return true}return false}function bt(bx,bz,F){F=F.toLowerCase();var bB=R[F];if(bz&&bz.toElement){bz=bz.toElement()}if(Object.isElement(bz)){bB(bx,bz);return bx}bz=Object.toHTML(bz);var bw=((F==="before"||F==="after")?bx.parentNode:bx).tagName.toUpperCase();var bA=z(bw,bz.stripScripts());if(F==="top"||F==="after"){bA.reverse()}for(var bv=0,by;by=bA[bv];bv++){bB(bx,by)}bz.evalScripts.bind(bz).defer()}function W(bv,bw){bv=a5(bv);if(bd(bw)){bw={bottom:bw}}for(var F in bw){bt(bv,bw[F],F)}return bv}function A(bv,bw,F){bv=a5(bv);if(Object.isElement(bw)){a5(bw).writeAttribute(F||{})}else{if(Object.isString(bw)){bw=new aL(bw,F)}else{bw=new aL("div",bw)}}if(bv.parentNode){bv.parentNode.replaceChild(bw,bv)}bw.appendChild(bv);return bw}function C(bv){bv=a5(bv);var bw=bv.firstChild;while(bw){var F=bw.nextSibling;if(bw.nodeType===Node.TEXT_NODE&&!/\S/.test(bw.nodeValue)){bv.removeChild(bw)}bw=F}return bv}function ba(F){return a5(F).innerHTML.blank()}function z(by,bx,bz){var bw=R.tags[by],bA=aB;var F=!!bw;if(!F&&bz){F=true;bw=["","",0]}if(F){bA.innerHTML=" "+bw[0]+bx+bw[1];bA.removeChild(bA.firstChild);for(var bv=bw[2];bv--;){bA=bA.firstChild}}else{bA.innerHTML=bx}return $A(bA.childNodes)}function L(bw,F){if(!(bw=a5(bw))){return}var by=bw.cloneNode(F);if(!a4){by._prototypeUID=aK;if(F){var bx=aL.select(by,"*"),bv=bx.length;while(bv--){bx[bv]._prototypeUID=aK}}}return aL.extend(by)}function af(bv){var F=S(bv);if(F){aL.stopObserving(bv);if(!a4){bv._prototypeUID=aK}delete aL.Storage[F]}}function br(bv){var F=bv.length;while(F--){af(bv[F])}}function az(bx){var bw=bx.length,bv,F;while(bw--){bv=bx[bw];F=S(bv);delete aL.Storage[F];delete Event.cache[F]}}if(a4){br=az}function r(bv){if(!(bv=a5(bv))){return}af(bv);var bw=bv.getElementsByTagName("*"),F=bw.length;while(F--){af(bw[F])}return null}Object.extend(a9,{remove:aj,update:U,replace:an,insert:W,wrap:A,cleanWhitespace:C,empty:ba,clone:L,purge:r});function at(F,bw,bx){F=a5(F);bx=bx||-1;var bv=[];while(F=F[bw]){if(F.nodeType===Node.ELEMENT_NODE){bv.push(aL.extend(F))}if(bv.length===bx){break}}return bv}function aR(F){return at(F,"parentNode")}function bs(F){return aL.select(F,"*")}function ad(F){F=a5(F).firstChild;while(F&&F.nodeType!==Node.ELEMENT_NODE){F=F.nextSibling}return a5(F)}function bo(bv){var F=[],bw=a5(bv).firstChild;while(bw){if(bw.nodeType===Node.ELEMENT_NODE){F.push(aL.extend(bw))}bw=bw.nextSibling}return F}function u(F){return at(F,"previousSibling")}function bn(F){return at(F,"nextSibling")}function a1(F){F=a5(F);var bw=u(F),bv=bn(F);return bw.reverse().concat(bv)}function aX(bv,F){bv=a5(bv);if(Object.isString(F)){return Prototype.Selector.match(bv,F)}return F.match(bv)}function a2(bv,bw,bx,F){bv=a5(bv),bx=bx||0,F=F||0;if(Object.isNumber(bx)){F=bx,bx=null}while(bv=bv[bw]){if(bv.nodeType!==1){continue}if(bx&&!Prototype.Selector.match(bv,bx)){continue}if(--F>=0){continue}return aL.extend(bv)}}function ag(bv,bw,F){bv=a5(bv);if(arguments.length===1){return a5(bv.parentNode)}return a2(bv,"parentNode",bw,F)}function E(bv,bx,F){if(arguments.length===1){return ad(bv)}bv=a5(bv),bx=bx||0,F=F||0;if(Object.isNumber(bx)){F=bx,bx="*"}var bw=Prototype.Selector.select(bx,bv)[F];return aL.extend(bw)}function n(bv,bw,F){return a2(bv,"previousSibling",bw,F)}function aH(bv,bw,F){return a2(bv,"nextSibling",bw,F)}function bh(F){F=a5(F);var bv=a7.call(arguments,1).join(", ");return Prototype.Selector.select(bv,F)}function aJ(bw){bw=a5(bw);var by=a7.call(arguments,1).join(", ");var bz=aL.siblings(bw),bv=[];for(var F=0,bx;bx=bz[F];F++){if(Prototype.Selector.match(bx,by)){bv.push(bx)}}return bv}function K(bv,F){bv=a5(bv),F=a5(F);if(!bv||!F){return false}while(bv=bv.parentNode){if(bv===F){return true}}return false}function I(bv,F){bv=a5(bv),F=a5(F);if(!bv||!F){return false}if(!F.contains){return K(bv,F)}return F.contains(bv)&&F!==bv}function P(bv,F){bv=a5(bv),F=a5(F);if(!bv||!F){return false}return(bv.compareDocumentPosition(F)&8)===8}var aS;if(aB.compareDocumentPosition){aS=P}else{if(aB.contains){aS=I}else{aS=K}}Object.extend(a9,{recursivelyCollect:at,ancestors:aR,descendants:bs,firstDescendant:ad,immediateDescendants:bo,previousSiblings:u,nextSiblings:bn,siblings:a1,match:aX,up:ag,down:E,previous:n,next:aH,select:bh,adjacent:aJ,descendantOf:aS,getElementsBySelector:bh,childElements:bo});var Z=1;function a0(F){F=a5(F);var bv=aL.readAttribute(F,"id");if(bv){return bv}do{bv="anonymous_element_"+Z++}while(a5(bv));aL.writeAttribute(F,"id",bv);return bv}function bf(bv,F){return a5(bv).getAttribute(F)}function Q(bv,F){bv=a5(bv);var bw=aM.read;if(bw.values[F]){return bw.values[F](bv,F)}if(bw.names[F]){F=bw.names[F]}if(F.include(":")){if(!bv.attributes||!bv.attributes[F]){return null}return bv.attributes[F].value}return bv.getAttribute(F)}function g(bv,F){if(F==="title"){return bv.title}return bv.getAttribute(F)}var aa=(function(){aB.setAttribute("onclick",[]);var F=aB.getAttribute("onclick");var bv=Object.isArray(F);aB.removeAttribute("onclick");return bv});if(Prototype.Browser.IE&&aa()){bf=Q}else{if(Prototype.Browser.Opera){bf=g}}function a6(bx,bw,bz){bx=a5(bx);var bv={},by=aM.write;if(typeof bw==="object"){bv=bw}else{bv[bw]=Object.isUndefined(bz)?true:bz}for(var F in bv){bw=by.names[F]||F;bz=bv[F];if(by.values[F]){bz=by.values[F](bx,bz);if(Object.isUndefined(bz)){continue}}if(bz===false||bz===null){bx.removeAttribute(bw)}else{if(bz===true){bx.setAttribute(bw,bw)}else{bx.setAttribute(bw,bz)}}}return bx}var b=(function(){if(!f){return false}var bv=document.createElement('');bv.checked=true;var F=bv.getAttributeNode("checked");return !F||!F.specified})();function ae(F,bw){bw=aM.has[bw]||bw;var bv=a5(F).getAttributeNode(bw);return !!(bv&&bv.specified)}function bm(F,bv){if(bv==="checked"){return F.checked}return ae(F,bv)}be.Element.Methods.Simulated.hasAttribute=b?bm:ae;function p(F){return new aL.ClassNames(F)}var ab={};function h(bv){if(ab[bv]){return ab[bv]}var F=new RegExp("(^|\\s+)"+bv+"(\\s+|$)");ab[bv]=F;return F}function ar(F,bv){if(!(F=a5(F))){return}var bw=F.className;if(bw.length===0){return false}if(bw===bv){return true}return h(bv).test(bw)}function t(F,bv){if(!(F=a5(F))){return}if(!ar(F,bv)){F.className+=(F.className?" ":"")+bv}return F}function aA(F,bv){if(!(F=a5(F))){return}F.className=F.className.replace(h(bv)," ").strip();return F}function ak(bv,bw,F){if(!(bv=a5(bv))){return}if(Object.isUndefined(F)){F=!ar(bv,bw)}var bx=aL[F?"addClassName":"removeClassName"];return bx(bv,bw)}var aM={};var aV="className",ay="for";aB.setAttribute(aV,"x");if(aB.className!=="x"){aB.setAttribute("class","x");if(aB.className==="x"){aV="class"}}var aQ=document.createElement("label");aQ.setAttribute(ay,"x");if(aQ.htmlFor!=="x"){aQ.setAttribute("htmlFor","x");if(aQ.htmlFor==="x"){ay="htmlFor"}}aQ=null;function ai(F,bv){return F.getAttribute(bv)}function l(F,bv){return F.getAttribute(bv,2)}function H(F,bw){var bv=F.getAttributeNode(bw);return bv?bv.value:""}function bp(F,bv){return a5(F).hasAttribute(bv)?bv:null}aB.onclick=Prototype.emptyFunction;var V=aB.getAttribute("onclick");var aC;if(String(V).indexOf("{")>-1){aC=function(F,bv){var bw=F.getAttribute(bv);if(!bw){return null}bw=bw.toString();bw=bw.split("{")[1];bw=bw.split("}")[0];return bw.strip()}}else{if(V===""){aC=function(F,bv){var bw=F.getAttribute(bv);if(!bw){return null}return bw.strip()}}}aM.read={names:{"class":aV,className:aV,"for":ay,htmlFor:ay},values:{style:function(F){return F.style.cssText.toLowerCase()},title:function(F){return F.title}}};aM.write={names:{className:"class",htmlFor:"for",cellpadding:"cellPadding",cellspacing:"cellSpacing"},values:{checked:function(F,bv){bv=!!bv;F.checked=bv;return bv?"checked":null},style:function(F,bv){F.style.cssText=bv?bv:""}}};aM.has={names:{}};Object.extend(aM.write.names,aM.read.names);var bc=$w("colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc frameBorder");for(var al=0,am;am=bc[al];al++){aM.write.names[am.toLowerCase()]=am;aM.has.names[am.toLowerCase()]=am}Object.extend(aM.read.values,{href:l,src:l,type:ai,action:H,disabled:bp,checked:bp,readonly:bp,multiple:bp,onload:aC,onunload:aC,onclick:aC,ondblclick:aC,onmousedown:aC,onmouseup:aC,onmouseover:aC,onmousemove:aC,onmouseout:aC,onfocus:aC,onblur:aC,onkeypress:aC,onkeydown:aC,onkeyup:aC,onsubmit:aC,onreset:aC,onselect:aC,onchange:aC});Object.extend(a9,{identify:a0,readAttribute:bf,writeAttribute:a6,classNames:p,hasClassName:ar,addClassName:t,removeClassName:aA,toggleClassName:ak});function ac(F){if(F==="float"||F==="styleFloat"){return"cssFloat"}return F.camelize()}function bu(F){if(F==="float"||F==="cssFloat"){return"styleFloat"}return F.camelize()}function J(bw,bx){bw=a5(bw);var bA=bw.style,bv;if(Object.isString(bx)){bA.cssText+=";"+bx;if(bx.include("opacity")){var F=bx.match(/opacity:\s*(\d?\.?\d*)/)[1];aL.setOpacity(bw,F)}return bw}for(var bz in bx){if(bz==="opacity"){aL.setOpacity(bw,bx[bz])}else{var by=bx[bz];if(bz==="float"||bz==="cssFloat"){bz=Object.isUndefined(bA.styleFloat)?"cssFloat":"styleFloat"}bA[bz]=by}}return bw}function aU(bv,bw){bv=a5(bv);bw=ac(bw);var bx=bv.style[bw];if(!bx||bx==="auto"){var F=document.defaultView.getComputedStyle(bv,null);bx=F?F[bw]:null}if(bw==="opacity"){return bx?parseFloat(bx):1}return bx==="auto"?null:bx}function y(F,bv){switch(bv){case"height":case"width":if(!aL.visible(F)){return null}var bw=parseInt(aU(F,bv),10);if(bw!==F["offset"+bv.capitalize()]){return bw+"px"}return aL.measure(F,bv);default:return aU(F,bv)}}function ap(F,bv){F=a5(F);bv=bu(bv);var bw=F.style[bv];if(!bw&&F.currentStyle){bw=F.currentStyle[bv]}if(bv==="opacity"){if(!T){return bk(F)}else{return bw?parseFloat(bw):1}}if(bw==="auto"){if((bv==="width"||bv==="height")&&aL.visible(F)){return aL.measure(F,bv)+"px"}return null}return bw}function aG(F){return(F||"").replace(/alpha\([^\)]*\)/gi,"")}function ah(F){if(!F.currentStyle||!F.currentStyle.hasLayout){F.style.zoom=1}return F}var T=(function(){aB.style.cssText="opacity:.55";return/^0.55/.test(aB.style.opacity)})();function G(F,bv){F=a5(F);if(bv==1||bv===""){bv=""}else{if(bv<0.00001){bv=0}}F.style.opacity=bv;return F}function bl(F,bx){if(T){return G(F,bx)}F=ah(a5(F));var bw=aL.getStyle(F,"filter"),bv=F.style;if(bx==1||bx===""){bw=aG(bw);if(bw){bv.filter=bw}else{bv.removeAttribute("filter")}return F}if(bx<0.00001){bx=0}bv.filter=aG(bw)+" alpha(opacity="+(bx*100)+")";return F}function bj(F){return aL.getStyle(F,"opacity")}function bk(bv){if(T){return bj(bv)}var bw=aL.getStyle(bv,"filter");if(bw.length===0){return 1}var F=(bw||"").match(/alpha\(opacity=(.*)\)/i);if(F&&F[1]){return parseFloat(F[1])/100}return 1}Object.extend(a9,{setStyle:J,getStyle:aU,setOpacity:G,getOpacity:bj});if("styleFloat" in aB.style){a9.getStyle=ap;a9.setOpacity=bl;a9.getOpacity=bk}var q=0;be.Element.Storage={UID:1};function S(F){if(F===window){return 0}if(typeof F._prototypeUID==="undefined"){F._prototypeUID=aL.Storage.UID++}return F._prototypeUID}function e(F){if(F===window){return 0}if(F==document){return 1}return F.uniqueID}var a4=("uniqueID" in aB);if(a4){S=e}function d(bv){if(!(bv=a5(bv))){return}var F=S(bv);if(!aL.Storage[F]){aL.Storage[F]=$H()}return aL.Storage[F]}function bb(bv,F,bw){if(!(bv=a5(bv))){return}var bx=d(bv);if(arguments.length===2){bx.update(F)}else{bx.set(F,bw)}return bv}function aT(bw,bv,F){if(!(bw=a5(bw))){return}var by=d(bw),bx=by.get(bv);if(Object.isUndefined(bx)){by.set(bv,F);bx=F}return bx}Object.extend(a9,{getStorage:d,store:bb,retrieve:aT});var au={},a3=aL.Methods.ByTag,aI=Prototype.BrowserFeatures;if(!aI.ElementExtensions&&("__proto__" in aB)){be.HTMLElement={};be.HTMLElement.prototype=aB.__proto__;aI.ElementExtensions=true}function bi(F){if(typeof window.Element==="undefined"){return false}if(!f){return false}var bw=window.Element.prototype;if(bw){var by="_"+(Math.random()+"").slice(2),bv=document.createElement(F);bw[by]="x";var bx=(bv[by]!=="x");delete bw[by];bv=null;return bx}return false}var aw=bi("object");function aq(bv,F){for(var bx in F){var bw=F[bx];if(Object.isFunction(bw)&&!(bx in bv)){bv[bx]=bw.methodize()}}}var bq={};function aE(bv){var F=S(bv);return(F in bq)}function aF(bw){if(!bw||aE(bw)){return bw}if(bw.nodeType!==Node.ELEMENT_NODE||bw==window){return bw}var F=Object.clone(au),bv=bw.tagName.toUpperCase();if(a3[bv]){Object.extend(F,a3[bv])}aq(bw,F);bq[S(bw)]=true;return bw}function aY(bv){if(!bv||aE(bv)){return bv}var F=bv.tagName;if(F&&(/^(?:object|applet|embed)$/i.test(F))){aq(bv,aL.Methods);aq(bv,aL.Methods.Simulated);aq(bv,aL.Methods.ByTag[F.toUpperCase()])}return bv}if(aI.SpecificElementExtensions){aF=aw?aY:Prototype.K}function Y(bv,F){bv=bv.toUpperCase();if(!a3[bv]){a3[bv]={}}Object.extend(a3[bv],F)}function v(bv,bw,F){if(Object.isUndefined(F)){F=false}for(var by in bw){var bx=bw[by];if(!Object.isFunction(bx)){continue}if(!F||!(by in bv)){bv[by]=bx.methodize()}}}function ao(bx){var F;var bw={OPTGROUP:"OptGroup",TEXTAREA:"TextArea",P:"Paragraph",FIELDSET:"FieldSet",UL:"UList",OL:"OList",DL:"DList",DIR:"Directory",H1:"Heading",H2:"Heading",H3:"Heading",H4:"Heading",H5:"Heading",H6:"Heading",Q:"Quote",INS:"Mod",DEL:"Mod",A:"Anchor",IMG:"Image",CAPTION:"TableCaption",COL:"TableCol",COLGROUP:"TableCol",THEAD:"TableSection",TFOOT:"TableSection",TBODY:"TableSection",TR:"TableRow",TH:"TableCell",TD:"TableCell",FRAMESET:"FrameSet",IFRAME:"IFrame"};if(bw[bx]){F="HTML"+bw[bx]+"Element"}if(window[F]){return window[F]}F="HTML"+bx+"Element";if(window[F]){return window[F]}F="HTML"+bx.capitalize()+"Element";if(window[F]){return window[F]}var bv=document.createElement(bx),by=bv.__proto__||bv.constructor.prototype;bv=null;return by}function X(bx){if(arguments.length===0){M()}if(arguments.length===2){var bz=bx;bx=arguments[1]}if(!bz){Object.extend(aL.Methods,bx||{})}else{if(Object.isArray(bz)){for(var by=0,bw;bw=bz[by];by++){Y(bw,bx)}}else{Y(bz,bx)}}var bv=window.HTMLElement?HTMLElement.prototype:aL.prototype;if(aI.ElementExtensions){v(bv,aL.Methods);v(bv,aL.Methods.Simulated,true)}if(aI.SpecificElementExtensions){for(var bw in aL.Methods.ByTag){var F=ao(bw);if(Object.isUndefined(F)){continue}v(F.prototype,a3[bw])}}Object.extend(aL,aL.Methods);Object.extend(aL,aL.Methods.Simulated);delete aL.ByTag;delete aL.Simulated;aL.extend.refresh();w={}}Object.extend(be.Element,{extend:aF,addMethods:X});if(aF===Prototype.K){be.Element.extend.refresh=Prototype.emptyFunction}else{be.Element.extend.refresh=function(){if(Prototype.BrowserFeatures.ElementExtensions){return}Object.extend(au,aL.Methods);Object.extend(au,aL.Methods.Simulated);bq={}}}function M(){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(aL.Methods.ByTag,{FORM:Object.clone(Form.Methods),INPUT:Object.clone(Form.Element.Methods),SELECT:Object.clone(Form.Element.Methods),TEXTAREA:Object.clone(Form.Element.Methods),BUTTON:Object.clone(Form.Element.Methods)})}aL.addMethods(a9);function s(){aB=null;w=null}if(window.attachEvent){window.attachEvent("onunload",s)}})(this);(function(){function q(N){var M=N.match(/^(\d+)%?$/i);if(!M){return null}return(Number(M[1])/100)}function F(N,O){N=$(N);var P=N.style[O];if(!P||P==="auto"){var M=document.defaultView.getComputedStyle(N,null);P=M?M[O]:null}if(O==="opacity"){return P?parseFloat(P):1}return P==="auto"?null:P}function I(M,N){var O=M.style[N];if(!O&&M.currentStyle){O=M.currentStyle[N]}return O}function y(O,N){var Q=O.offsetWidth;var S=B(O,"borderLeftWidth",N)||0;var M=B(O,"borderRightWidth",N)||0;var P=B(O,"paddingLeft",N)||0;var R=B(O,"paddingRight",N)||0;return Q-S-M-P-R}if(!Object.isUndefined(document.documentElement.currentStyle)&&!Prototype.Browser.Opera){F=I}function B(W,X,N){var Q=null;if(Object.isElement(W)){Q=W;W=F(Q,X)}if(W===null||Object.isUndefined(W)){return null}if((/^(?:-)?\d+(\.\d+)?(px)?$/i).test(W)){return window.parseFloat(W)}var R=W.include("%"),O=(N===document.viewport);if(/\d/.test(W)&&Q&&Q.runtimeStyle&&!(R&&O)){var M=Q.style.left,V=Q.runtimeStyle.left;Q.runtimeStyle.left=Q.currentStyle.left;Q.style.left=W||0;W=Q.style.pixelLeft;Q.style.left=M;Q.runtimeStyle.left=V;return W}if(Q&&R){N=N||Q.parentNode;var P=q(W),S=null;var U=X.include("left")||X.include("right")||X.include("width");var T=X.include("top")||X.include("bottom")||X.include("height");if(N===document.viewport){if(U){S=document.viewport.getWidth()}else{if(T){S=document.viewport.getHeight()}}}else{if(U){S=$(N).measure("width")}else{if(T){S=$(N).measure("height")}}}return(S===null)?0:S*P}return 0}function p(M){if(Object.isString(M)&&M.endsWith("px")){return M}return M+"px"}function s(M){while(M&&M.parentNode){var N=M.getStyle("display");if(N==="none"){return false}M=$(M.parentNode)}return true}var l=Prototype.K;if("currentStyle" in document.documentElement){l=function(M){if(!M.currentStyle.hasLayout){M.style.zoom=1}return M}}function o(M){if(M.include("border")){M=M+"-width"}return M.camelize()}Element.Layout=Class.create(Hash,{initialize:function($super,N,M){$super();this.element=$(N);Element.Layout.PROPERTIES.each(function(O){this._set(O,null)},this);if(M){this._preComputing=true;this._begin();Element.Layout.PROPERTIES.each(this._compute,this);this._end();this._preComputing=false}},_set:function(N,M){return Hash.prototype.set.call(this,N,M)},set:function(N,M){throw"Properties of Element.Layout are read-only."},get:function($super,N){var M=$super(N);return M===null?this._compute(N):M},_begin:function(){if(this._isPrepared()){return}var Q=this.element;if(s(Q)){this._setPrepared(true);return}var S={position:Q.style.position||"",width:Q.style.width||"",visibility:Q.style.visibility||"",display:Q.style.display||""};Q.store("prototype_original_styles",S);var T=F(Q,"position"),M=Q.offsetWidth;if(M===0||M===null){Q.style.display="block";M=Q.offsetWidth}var N=(T==="fixed")?document.viewport:Q.parentNode;var U={visibility:"hidden",display:"block"};if(T!=="fixed"){U.position="absolute"}Q.setStyle(U);var O=Q.offsetWidth,P;if(M&&(O===M)){P=y(Q,N)}else{if(T==="absolute"||T==="fixed"){P=y(Q,N)}else{var V=Q.parentNode,R=$(V).getLayout();P=R.get("width")-this.get("margin-left")-this.get("border-left")-this.get("padding-left")-this.get("padding-right")-this.get("border-right")-this.get("margin-right")}}Q.setStyle({width:P+"px"});this._setPrepared(true)},_end:function(){var N=this.element;var M=N.retrieve("prototype_original_styles");N.store("prototype_original_styles",null);N.setStyle(M);this._setPrepared(false)},_compute:function(N){var M=Element.Layout.COMPUTATIONS;if(!(N in M)){throw"Property not found."}return this._set(N,M[N].call(this,this.element))},_isPrepared:function(){return this.element.retrieve("prototype_element_layout_prepared",false)},_setPrepared:function(M){return this.element.store("prototype_element_layout_prepared",M)},toObject:function(){var M=$A(arguments);var N=(M.length===0)?Element.Layout.PROPERTIES:M.join(" ").split(" ");var O={};N.each(function(P){if(!Element.Layout.PROPERTIES.include(P)){return}var Q=this.get(P);if(Q!=null){O[P]=Q}},this);return O},toHash:function(){var M=this.toObject.apply(this,arguments);return new Hash(M)},toCSS:function(){var M=$A(arguments);var O=(M.length===0)?Element.Layout.PROPERTIES:M.join(" ").split(" ");var N={};O.each(function(P){if(!Element.Layout.PROPERTIES.include(P)){return}if(Element.Layout.COMPOSITE_PROPERTIES.include(P)){return}var Q=this.get(P);if(Q!=null){N[o(P)]=Q+"px"}},this);return N},inspect:function(){return"#"}});Object.extend(Element.Layout,{PROPERTIES:$w("height width top left right bottom border-left border-right border-top border-bottom padding-left padding-right padding-top padding-bottom margin-top margin-bottom margin-left margin-right padding-box-width padding-box-height border-box-width border-box-height margin-box-width margin-box-height"),COMPOSITE_PROPERTIES:$w("padding-box-width padding-box-height margin-box-width margin-box-height border-box-width border-box-height"),COMPUTATIONS:{height:function(O){if(!this._preComputing){this._begin()}var M=this.get("border-box-height");if(M<=0){if(!this._preComputing){this._end()}return 0}var P=this.get("border-top"),N=this.get("border-bottom");var R=this.get("padding-top"),Q=this.get("padding-bottom");if(!this._preComputing){this._end()}return M-P-N-R-Q},width:function(O){if(!this._preComputing){this._begin()}var N=this.get("border-box-width");if(N<=0){if(!this._preComputing){this._end()}return 0}var R=this.get("border-left"),M=this.get("border-right");var P=this.get("padding-left"),Q=this.get("padding-right");if(!this._preComputing){this._end()}return N-R-M-P-Q},"padding-box-height":function(N){var M=this.get("height"),P=this.get("padding-top"),O=this.get("padding-bottom");return M+P+O},"padding-box-width":function(M){var N=this.get("width"),O=this.get("padding-left"),P=this.get("padding-right");return N+O+P},"border-box-height":function(N){if(!this._preComputing){this._begin()}var M=N.offsetHeight;if(!this._preComputing){this._end()}return M},"border-box-width":function(M){if(!this._preComputing){this._begin()}var N=M.offsetWidth;if(!this._preComputing){this._end()}return N},"margin-box-height":function(N){var M=this.get("border-box-height"),O=this.get("margin-top"),P=this.get("margin-bottom");if(M<=0){return 0}return M+O+P},"margin-box-width":function(O){var N=this.get("border-box-width"),P=this.get("margin-left"),M=this.get("margin-right");if(N<=0){return 0}return N+P+M},top:function(M){var N=M.positionedOffset();return N.top},bottom:function(M){var P=M.positionedOffset(),N=M.getOffsetParent(),O=N.measure("height");var Q=this.get("border-box-height");return O-Q-P.top},left:function(M){var N=M.positionedOffset();return N.left},right:function(O){var Q=O.positionedOffset(),P=O.getOffsetParent(),M=P.measure("width");var N=this.get("border-box-width");return M-N-Q.left},"padding-top":function(M){return B(M,"paddingTop")},"padding-bottom":function(M){return B(M,"paddingBottom")},"padding-left":function(M){return B(M,"paddingLeft")},"padding-right":function(M){return B(M,"paddingRight")},"border-top":function(M){return B(M,"borderTopWidth")},"border-bottom":function(M){return B(M,"borderBottomWidth")},"border-left":function(M){return B(M,"borderLeftWidth")},"border-right":function(M){return B(M,"borderRightWidth")},"margin-top":function(M){return B(M,"marginTop")},"margin-bottom":function(M){return B(M,"marginBottom")},"margin-left":function(M){return B(M,"marginLeft")},"margin-right":function(M){return B(M,"marginRight")}}});if("getBoundingClientRect" in document.documentElement){Object.extend(Element.Layout.COMPUTATIONS,{right:function(N){var O=l(N.getOffsetParent());var P=N.getBoundingClientRect(),M=O.getBoundingClientRect();return(M.right-P.right).round()},bottom:function(N){var O=l(N.getOffsetParent());var P=N.getBoundingClientRect(),M=O.getBoundingClientRect();return(M.bottom-P.bottom).round()}})}Element.Offset=Class.create({initialize:function(N,M){this.left=N.round();this.top=M.round();this[0]=this.left;this[1]=this.top},relativeTo:function(M){return new Element.Offset(this.left-M.left,this.top-M.top)},inspect:function(){return"#".interpolate(this)},toString:function(){return"[#{left}, #{top}]".interpolate(this)},toArray:function(){return[this.left,this.top]}});function G(N,M){return new Element.Layout(N,M)}function f(M,N){return $(M).getLayout().get(N)}function w(M){return Element.getDimensions(M).height}function e(M){return Element.getDimensions(M).width}function z(N){N=$(N);var R=Element.getStyle(N,"display");if(R&&R!=="none"){return{width:N.offsetWidth,height:N.offsetHeight}}var O=N.style;var M={visibility:O.visibility,position:O.position,display:O.display};var Q={visibility:"hidden",display:"block"};if(M.position!=="fixed"){Q.position="absolute"}Element.setStyle(N,Q);var P={width:N.offsetWidth,height:N.offsetHeight};Element.setStyle(N,M);return P}function v(M){M=$(M);function O(P){return t(P)?$(document.body):$(P)}if(n(M)||h(M)||u(M)||t(M)){return $(document.body)}var N=(Element.getStyle(M,"display")==="inline");if(!N&&M.offsetParent){return O(M.offsetParent)}while((M=M.parentNode)&&M!==document.body){if(Element.getStyle(M,"position")!=="static"){return O(M)}}return $(document.body)}function J(N){N=$(N);var M=0,O=0;if(N.parentNode){do{M+=N.offsetTop||0;O+=N.offsetLeft||0;N=N.offsetParent}while(N)}return new Element.Offset(O,M)}function D(N){N=$(N);var O=N.getLayout();var M=0,Q=0;do{M+=N.offsetTop||0;Q+=N.offsetLeft||0;N=N.offsetParent;if(N){if(u(N)){break}var P=Element.getStyle(N,"position");if(P!=="static"){break}}}while(N);Q-=O.get("margin-left");M-=O.get("margin-top");return new Element.Offset(Q,M)}function d(N){var M=0,O=0;do{if(N===document.body){var P=document.documentElement||document.body.parentNode||document.body;M+=!Object.isUndefined(window.pageYOffset)?window.pageYOffset:P.scrollTop||0;O+=!Object.isUndefined(window.pageXOffset)?window.pageXOffset:P.scrollLeft||0;break}else{M+=N.scrollTop||0;O+=N.scrollLeft||0;N=N.parentNode}}while(N);return new Element.Offset(O,M)}function H(Q){var M=0,P=0,O=document.body;Q=$(Q);var N=Q;do{M+=N.offsetTop||0;P+=N.offsetLeft||0;if(N.offsetParent==O&&Element.getStyle(N,"position")=="absolute"){break}}while(N=N.offsetParent);N=Q;do{if(N!=O){M-=N.scrollTop||0;P-=N.scrollLeft||0}}while(N=N.parentNode);return new Element.Offset(P,M)}function E(M){M=$(M);if(Element.getStyle(M,"position")==="absolute"){return M}var Q=v(M);var P=M.viewportOffset(),N=Q.viewportOffset();var R=P.relativeTo(N);var O=M.getLayout();M.store("prototype_absolutize_original_styles",{position:M.getStyle("position"),left:M.getStyle("left"),top:M.getStyle("top"),width:M.getStyle("width"),height:M.getStyle("height")});M.setStyle({position:"absolute",top:R.top+"px",left:R.left+"px",width:O.get("width")+"px",height:O.get("height")+"px"});return M}function r(N){N=$(N);if(Element.getStyle(N,"position")==="relative"){return N}var M=N.retrieve("prototype_absolutize_original_styles");if(M){N.setStyle(M)}return N}function b(M){M=$(M);var N=Element.cumulativeOffset(M);window.scrollTo(N.left,N.top);return M}function C(N){N=$(N);var M=Element.getStyle(N,"position"),O={};if(M==="static"||!M){O.position="relative";if(Prototype.Browser.Opera){O.top=0;O.left=0}Element.setStyle(N,O);Element.store(N,"prototype_made_positioned",true)}return N}function A(M){M=$(M);var O=Element.getStorage(M),N=O.get("prototype_made_positioned");if(N){O.unset("prototype_made_positioned");Element.setStyle(M,{position:"",top:"",bottom:"",left:"",right:""})}return M}function g(N){N=$(N);var P=Element.getStorage(N),M=P.get("prototype_made_clipping");if(Object.isUndefined(M)){var O=Element.getStyle(N,"overflow");P.set("prototype_made_clipping",O);if(O!=="hidden"){N.style.overflow="hidden"}}return N}function K(M){M=$(M);var O=Element.getStorage(M),N=O.get("prototype_made_clipping");if(!Object.isUndefined(N)){O.unset("prototype_made_clipping");M.style.overflow=N||""}return M}function L(P,M,X){X=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},X||{});var O=document.documentElement;M=$(M);P=$(P);var N,V,R,W={};if(X.setLeft||X.setTop){N=Element.viewportOffset(M);V=[0,0];if(Element.getStyle(P,"position")==="absolute"){var U=Element.getOffsetParent(P);if(U!==document.body){V=Element.viewportOffset(U)}}}function S(){var Y=0,Z=0;if(Object.isNumber(window.pageXOffset)){Y=window.pageXOffset;Z=window.pageYOffset}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){Y=document.body.scrollLeft;Z=document.body.scrollTop}else{if(O&&(O.scrollLeft||O.scrollTop)){Y=O.scrollLeft;Z=O.scrollTop}}}return{x:Y,y:Z}}var Q=S();if(X.setWidth||X.setHeight){R=Element.getLayout(M)}if(X.setLeft){W.left=(N[0]+Q.x-V[0]+X.offsetLeft)+"px"}if(X.setTop){W.top=(N[1]+Q.y-V[1]+X.offsetTop)+"px"}var T=P.getLayout();if(X.setWidth){W.width=R.get("width")+"px"}if(X.setHeight){W.height=R.get("height")+"px"}return Element.setStyle(P,W)}if(Prototype.Browser.IE){v=v.wrap(function(O,N){N=$(N);if(n(N)||h(N)||u(N)||t(N)){return $(document.body)}var M=N.getStyle("position");if(M!=="static"){return O(N)}N.setStyle({position:"relative"});var P=O(N);N.setStyle({position:M});return P});D=D.wrap(function(P,N){N=$(N);if(!N.parentNode){return new Element.Offset(0,0)}var M=N.getStyle("position");if(M!=="static"){return P(N)}var O=N.getOffsetParent();if(O&&O.getStyle("position")==="fixed"){l(O)}N.setStyle({position:"relative"});var Q=P(N);N.setStyle({position:M});return Q})}else{if(Prototype.Browser.Webkit){J=function(N){N=$(N);var M=0,O=0;do{M+=N.offsetTop||0;O+=N.offsetLeft||0;if(N.offsetParent==document.body){if(Element.getStyle(N,"position")=="absolute"){break}}N=N.offsetParent}while(N);return new Element.Offset(O,M)}}}Element.addMethods({getLayout:G,measure:f,getWidth:e,getHeight:w,getDimensions:z,getOffsetParent:v,cumulativeOffset:J,positionedOffset:D,cumulativeScrollOffset:d,viewportOffset:H,absolutize:E,relativize:r,scrollTo:b,makePositioned:C,undoPositioned:A,makeClipping:g,undoClipping:K,clonePosition:L});function u(M){return M.nodeName.toUpperCase()==="BODY"}function t(M){return M.nodeName.toUpperCase()==="HTML"}function n(M){return M.nodeType===Node.DOCUMENT_NODE}function h(M){return M!==document.body&&!Element.descendantOf(M,document.body)}if("getBoundingClientRect" in document.documentElement){Element.addMethods({viewportOffset:function(M){M=$(M);if(h(M)){return new Element.Offset(0,0)}var N=M.getBoundingClientRect(),O=document.documentElement;return new Element.Offset(N.left-O.clientLeft,N.top-O.clientTop)}})}})();(function(){var e=Prototype.Browser.Opera&&(window.parseFloat(window.opera.version())<9.5);var h=null;function d(){if(h){return h}h=e?document.body:document.documentElement;return h}function f(){return{width:this.getWidth(),height:this.getHeight()}}function b(){return d().clientWidth}function l(){return d().clientHeight}function g(){var n=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft;var o=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop;return new Element.Offset(n,o)}document.viewport={getDimensions:f,getWidth:b,getHeight:l,getScrollOffsets:g}})();window.$$=function(){var b=$A(arguments).join(", ");return Prototype.Selector.select(b,document)};Prototype.Selector=(function(){function b(){throw new Error('Method "Prototype.Selector.select" must be defined.')}function e(){throw new Error('Method "Prototype.Selector.match" must be defined.')}function f(q,r,n){n=n||0;var l=Prototype.Selector.match,p=q.length,h=0,o;for(o=0;o+~]|"+B+")"+B+"*"),F=new RegExp("="+B+"*([^\\]'\"]*?)"+B+"*\\]","g"),ad=new RegExp(v),af=new RegExp("^"+W+"$"),an={ID:new RegExp("^#("+b+")"),CLASS:new RegExp("^\\.("+b+")"),TAG:new RegExp("^("+b.replace("w","w*")+")"),ATTR:new RegExp("^"+ar),PSEUDO:new RegExp("^"+v),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+B+"*(even|odd|(([+-]|)(\\d*)n|)"+B+"*(?:([+-]|)"+B+"*(\\d+)|))"+B+"*\\)|)","i"),bool:new RegExp("^(?:"+f+")$","i"),needsContext:new RegExp("^"+B+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+B+"*((?:-\\d)?\\d*)"+B+"*\\)|)(?=[^-]|$)","i")},n=/^(?:input|select|textarea|button)$/i,w=/^h\d$/i,aa=/^[^{]+\{\s*\[native \w/,ac=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,am=/[+~]/,Y=/'|\\/g,E=new RegExp("\\\\([\\da-f]{1,6}"+B+"?|("+B+")|.)","ig"),aq=function(e,aL,aJ){var aK="0x"+aL-65536;return aK!==aK||aJ?aL:aK<0?String.fromCharCode(aK+65536):String.fromCharCode(aK>>10|55296,aK&1023|56320)};try{d.apply((ay=y.call(U.childNodes)),U.childNodes);ay[U.childNodes.length].nodeType}catch(O){d={apply:ay.length?function(aJ,e){X.apply(aJ,y.call(e))}:function(aL,aK){var e=aL.length,aJ=0;while((aL[e++]=aK[aJ++])){}aL.length=e-1}}}function H(aQ,aJ,aU,aW){var aV,aN,aO,aS,aT,aM,aL,e,aK,aR;if((aJ?aJ.ownerDocument||aJ:U)!==N){ak(aJ)}aJ=aJ||N;aU=aU||[];if(!aQ||typeof aQ!=="string"){return aU}if((aS=aJ.nodeType)!==1&&aS!==9){return[]}if(au&&!aW){if((aV=ac.exec(aQ))){if((aO=aV[1])){if(aS===9){aN=aJ.getElementById(aO);if(aN&&aN.parentNode){if(aN.id===aO){aU.push(aN);return aU}}else{return aU}}else{if(aJ.ownerDocument&&(aN=aJ.ownerDocument.getElementById(aO))&&Q(aJ,aN)&&aN.id===aO){aU.push(aN);return aU}}}else{if(aV[2]){d.apply(aU,aJ.getElementsByTagName(aQ));return aU}else{if((aO=aV[3])&&aE.getElementsByClassName&&aJ.getElementsByClassName){d.apply(aU,aJ.getElementsByClassName(aO));return aU}}}}if(aE.qsa&&(!ao||!ao.test(aQ))){e=aL=aw;aK=aJ;aR=aS===9&&aQ;if(aS===1&&aJ.nodeName.toLowerCase()!=="object"){aM=s(aQ);if((aL=aJ.getAttribute("id"))){e=aL.replace(Y,"\\$&")}else{aJ.setAttribute("id",e)}e="[id='"+e+"'] ";aT=aM.length;while(aT--){aM[aT]=e+t(aM[aT])}aK=am.test(aQ)&&ae(aJ.parentNode)||aJ;aR=aM.join(",")}if(aR){try{d.apply(aU,aK.querySelectorAll(aR));return aU}catch(aP){}finally{if(!aL){aJ.removeAttribute("id")}}}}}return aD(aQ.replace(D,"$1"),aJ,aU,aW)}function L(){var aJ=[];function e(aK,aL){if(aJ.push(aK+" ")>z.cacheLength){delete e[aJ.shift()]}return(e[aK+" "]=aL)}return e}function u(e){e[aw]=true;return e}function q(aJ){var aL=N.createElement("div");try{return !!aJ(aL)}catch(aK){return false}finally{if(aL.parentNode){aL.parentNode.removeChild(aL)}aL=null}}function aG(aJ,aL){var e=aJ.split("|"),aK=aJ.length;while(aK--){z.attrHandle[e[aK]]=aL}}function h(aJ,e){var aL=e&&aJ,aK=aL&&aJ.nodeType===1&&e.nodeType===1&&(~e.sourceIndex||ab)-(~aJ.sourceIndex||ab);if(aK){return aK}if(aL){while((aL=aL.nextSibling)){if(aL===e){return -1}}}return aJ?1:-1}function I(e){return function(aK){var aJ=aK.nodeName.toLowerCase();return aJ==="input"&&aK.type===e}}function l(e){return function(aK){var aJ=aK.nodeName.toLowerCase();return(aJ==="input"||aJ==="button")&&aK.type===e}}function at(e){return u(function(aJ){aJ=+aJ;return u(function(aK,aO){var aM,aL=e([],aK.length,aJ),aN=aL.length;while(aN--){if(aK[(aM=aL[aN])]){aK[aM]=!(aO[aM]=aK[aM])}}})})}function ae(e){return e&&typeof e.getElementsByTagName!==aA&&e}aE=H.support={};V=H.isXML=function(e){var aJ=e&&(e.ownerDocument||e).documentElement;return aJ?aJ.nodeName!=="HTML":false};ak=H.setDocument=function(aK){var e,aL=aK?aK.ownerDocument||aK:U,aJ=aL.defaultView;if(aL===N||aL.nodeType!==9||!aL.documentElement){return N}N=aL;A=aL.documentElement;au=!V(aL);if(aJ&&aJ!==aJ.top){if(aJ.addEventListener){aJ.addEventListener("unload",function(){ak()},false)}else{if(aJ.attachEvent){aJ.attachEvent("onunload",function(){ak()})}}}aE.attributes=q(function(aM){aM.className="i";return !aM.getAttribute("className")});aE.getElementsByTagName=q(function(aM){aM.appendChild(aL.createComment(""));return !aM.getElementsByTagName("*").length});aE.getElementsByClassName=aa.test(aL.getElementsByClassName)&&q(function(aM){aM.innerHTML="
";aM.firstChild.className="i";return aM.getElementsByClassName("i").length===2});aE.getById=q(function(aM){A.appendChild(aM).id=aw;return !aL.getElementsByName||!aL.getElementsByName(aw).length});if(aE.getById){z.find.ID=function(aO,aN){if(typeof aN.getElementById!==aA&&au){var aM=aN.getElementById(aO);return aM&&aM.parentNode?[aM]:[]}};z.filter.ID=function(aN){var aM=aN.replace(E,aq);return function(aO){return aO.getAttribute("id")===aM}}}else{delete z.find.ID;z.filter.ID=function(aN){var aM=aN.replace(E,aq);return function(aP){var aO=typeof aP.getAttributeNode!==aA&&aP.getAttributeNode("id");return aO&&aO.value===aM}}}z.find.TAG=aE.getElementsByTagName?function(aM,aN){if(typeof aN.getElementsByTagName!==aA){return aN.getElementsByTagName(aM)}}:function(aM,aQ){var aR,aP=[],aO=0,aN=aQ.getElementsByTagName(aM);if(aM==="*"){while((aR=aN[aO++])){if(aR.nodeType===1){aP.push(aR)}}return aP}return aN};z.find.CLASS=aE.getElementsByClassName&&function(aN,aM){if(typeof aM.getElementsByClassName!==aA&&au){return aM.getElementsByClassName(aN)}};aC=[];ao=[];if((aE.qsa=aa.test(aL.querySelectorAll))){q(function(aM){aM.innerHTML="";if(aM.querySelectorAll("[t^='']").length){ao.push("[*^$]="+B+"*(?:''|\"\")")}if(!aM.querySelectorAll("[selected]").length){ao.push("\\["+B+"*(?:value|"+f+")")}if(!aM.querySelectorAll(":checked").length){ao.push(":checked")}});q(function(aN){var aM=aL.createElement("input");aM.setAttribute("type","hidden");aN.appendChild(aM).setAttribute("name","D");if(aN.querySelectorAll("[name=d]").length){ao.push("name"+B+"*[*^$|!~]?=")}if(!aN.querySelectorAll(":enabled").length){ao.push(":enabled",":disabled")}aN.querySelectorAll("*,:x");ao.push(",.*:")})}if((aE.matchesSelector=aa.test((p=A.webkitMatchesSelector||A.mozMatchesSelector||A.oMatchesSelector||A.msMatchesSelector)))){q(function(aM){aE.disconnectedMatch=p.call(aM,"div");p.call(aM,"[s!='']:x");aC.push("!=",v)})}ao=ao.length&&new RegExp(ao.join("|"));aC=aC.length&&new RegExp(aC.join("|"));e=aa.test(A.compareDocumentPosition);Q=e||aa.test(A.contains)?function(aN,aM){var aP=aN.nodeType===9?aN.documentElement:aN,aO=aM&&aM.parentNode;return aN===aO||!!(aO&&aO.nodeType===1&&(aP.contains?aP.contains(aO):aN.compareDocumentPosition&&aN.compareDocumentPosition(aO)&16))}:function(aN,aM){if(aM){while((aM=aM.parentNode)){if(aM===aN){return true}}}return false};P=e?function(aN,aM){if(aN===aM){ai=true;return 0}var aO=!aN.compareDocumentPosition-!aM.compareDocumentPosition;if(aO){return aO}aO=(aN.ownerDocument||aN)===(aM.ownerDocument||aM)?aN.compareDocumentPosition(aM):1;if(aO&1||(!aE.sortDetached&&aM.compareDocumentPosition(aN)===aO)){if(aN===aL||aN.ownerDocument===U&&Q(U,aN)){return -1}if(aM===aL||aM.ownerDocument===U&&Q(U,aM)){return 1}return T?(o.call(T,aN)-o.call(T,aM)):0}return aO&4?-1:1}:function(aN,aM){if(aN===aM){ai=true;return 0}var aT,aQ=0,aS=aN.parentNode,aP=aM.parentNode,aO=[aN],aR=[aM];if(!aS||!aP){return aN===aL?-1:aM===aL?1:aS?-1:aP?1:T?(o.call(T,aN)-o.call(T,aM)):0}else{if(aS===aP){return h(aN,aM)}}aT=aN;while((aT=aT.parentNode)){aO.unshift(aT)}aT=aM;while((aT=aT.parentNode)){aR.unshift(aT)}while(aO[aQ]===aR[aQ]){aQ++}return aQ?h(aO[aQ],aR[aQ]):aO[aQ]===U?-1:aR[aQ]===U?1:0};return aL};H.matches=function(aJ,e){return H(aJ,null,null,e)};H.matchesSelector=function(aK,aM){if((aK.ownerDocument||aK)!==N){ak(aK)}aM=aM.replace(F,"='$1']");if(aE.matchesSelector&&au&&(!aC||!aC.test(aM))&&(!ao||!ao.test(aM))){try{var aJ=p.call(aK,aM);if(aJ||aE.disconnectedMatch||aK.document&&aK.document.nodeType!==11){return aJ}}catch(aL){}}return H(aM,N,null,[aK]).length>0};H.contains=function(e,aJ){if((e.ownerDocument||e)!==N){ak(e)}return Q(e,aJ)};H.attr=function(aK,e){if((aK.ownerDocument||aK)!==N){ak(aK)}var aJ=z.attrHandle[e.toLowerCase()],aL=aJ&&Z.call(z.attrHandle,e.toLowerCase())?aJ(aK,e,!au):undefined;return aL!==undefined?aL:aE.attributes||!au?aK.getAttribute(e):(aL=aK.getAttributeNode(e))&&aL.specified?aL.value:null};H.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)};H.uniqueSort=function(aK){var aL,aM=[],e=0,aJ=0;ai=!aE.detectDuplicates;T=!aE.sortStable&&aK.slice(0);aK.sort(P);if(ai){while((aL=aK[aJ++])){if(aL===aK[aJ]){e=aM.push(aJ)}}while(e--){aK.splice(aM[e],1)}}T=null;return aK};S=H.getText=function(aM){var aL,aJ="",aK=0,e=aM.nodeType;if(!e){while((aL=aM[aK++])){aJ+=S(aL)}}else{if(e===1||e===9||e===11){if(typeof aM.textContent==="string"){return aM.textContent}else{for(aM=aM.firstChild;aM;aM=aM.nextSibling){aJ+=S(aM)}}}else{if(e===3||e===4){return aM.nodeValue}}}return aJ};z=H.selectors={cacheLength:50,createPseudo:u,match:an,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:true}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:true},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){e[1]=e[1].replace(E,aq);e[3]=(e[4]||e[5]||"").replace(E,aq);if(e[2]==="~="){e[3]=" "+e[3]+" "}return e.slice(0,4)},CHILD:function(e){e[1]=e[1].toLowerCase();if(e[1].slice(0,3)==="nth"){if(!e[3]){H.error(e[0])}e[4]=+(e[4]?e[5]+(e[6]||1):2*(e[3]==="even"||e[3]==="odd"));e[5]=+((e[7]+e[8])||e[3]==="odd")}else{if(e[3]){H.error(e[0])}}return e},PSEUDO:function(aJ){var e,aK=!aJ[5]&&aJ[2];if(an.CHILD.test(aJ[0])){return null}if(aJ[3]&&aJ[4]!==undefined){aJ[2]=aJ[4]}else{if(aK&&ad.test(aK)&&(e=s(aK,true))&&(e=aK.indexOf(")",aK.length-e)-aK.length)){aJ[0]=aJ[0].slice(0,e);aJ[2]=aK.slice(0,e)}}return aJ.slice(0,3)}},filter:{TAG:function(aJ){var e=aJ.replace(E,aq).toLowerCase();return aJ==="*"?function(){return true}:function(aK){return aK.nodeName&&aK.nodeName.toLowerCase()===e}},CLASS:function(e){var aJ=g[e+" "];return aJ||(aJ=new RegExp("(^|"+B+")"+e+"("+B+"|$)"))&&g(e,function(aK){return aJ.test(typeof aK.className==="string"&&aK.className||typeof aK.getAttribute!==aA&&aK.getAttribute("class")||"")})},ATTR:function(aK,aJ,e){return function(aM){var aL=H.attr(aM,aK);if(aL==null){return aJ==="!="}if(!aJ){return true}aL+="";return aJ==="="?aL===e:aJ==="!="?aL!==e:aJ==="^="?e&&aL.indexOf(e)===0:aJ==="*="?e&&aL.indexOf(e)>-1:aJ==="$="?e&&aL.slice(-e.length)===e:aJ==="~="?(" "+aL+" ").indexOf(e)>-1:aJ==="|="?aL===e||aL.slice(0,e.length+1)===e+"-":false}},CHILD:function(aJ,aM,aL,aN,aK){var aP=aJ.slice(0,3)!=="nth",e=aJ.slice(-4)!=="last",aO=aM==="of-type";return aN===1&&aK===0?function(aQ){return !!aQ.parentNode}:function(aW,aU,aZ){var aQ,a2,aX,a1,aY,aT,aV=aP!==e?"nextSibling":"previousSibling",a0=aW.parentNode,aS=aO&&aW.nodeName.toLowerCase(),aR=!aZ&&!aO;if(a0){if(aP){while(aV){aX=aW;while((aX=aX[aV])){if(aO?aX.nodeName.toLowerCase()===aS:aX.nodeType===1){return false}}aT=aV=aJ==="only"&&!aT&&"nextSibling"}return true}aT=[e?a0.firstChild:a0.lastChild];if(e&&aR){a2=a0[aw]||(a0[aw]={});aQ=a2[aJ]||[];aY=aQ[0]===aF&&aQ[1];a1=aQ[0]===aF&&aQ[2];aX=aY&&a0.childNodes[aY];while((aX=++aY&&aX&&aX[aV]||(a1=aY=0)||aT.pop())){if(aX.nodeType===1&&++a1&&aX===aW){a2[aJ]=[aF,aY,a1];break}}}else{if(aR&&(aQ=(aW[aw]||(aW[aw]={}))[aJ])&&aQ[0]===aF){a1=aQ[1]}else{while((aX=++aY&&aX&&aX[aV]||(a1=aY=0)||aT.pop())){if((aO?aX.nodeName.toLowerCase()===aS:aX.nodeType===1)&&++a1){if(aR){(aX[aw]||(aX[aw]={}))[aJ]=[aF,a1]}if(aX===aW){break}}}}}a1-=aK;return a1===aN||(a1%aN===0&&a1/aN>=0)}}},PSEUDO:function(aL,aK){var e,aJ=z.pseudos[aL]||z.setFilters[aL.toLowerCase()]||H.error("unsupported pseudo: "+aL);if(aJ[aw]){return aJ(aK)}if(aJ.length>1){e=[aL,aL,"",aK];return z.setFilters.hasOwnProperty(aL.toLowerCase())?u(function(aO,aQ){var aN,aM=aJ(aO,aK),aP=aM.length;while(aP--){aN=o.call(aO,aM[aP]);aO[aN]=!(aQ[aN]=aM[aP])}}):function(aM){return aJ(aM,0,e)}}return aJ}},pseudos:{not:u(function(e){var aJ=[],aK=[],aL=ah(e.replace(D,"$1"));return aL[aw]?u(function(aN,aS,aQ,aO){var aR,aM=aL(aN,null,aO,[]),aP=aN.length;while(aP--){if((aR=aM[aP])){aN[aP]=!(aS[aP]=aR)}}}):function(aO,aN,aM){aJ[0]=aO;aL(aJ,null,aM,aK);return !aK.pop()}}),has:u(function(e){return function(aJ){return H(e,aJ).length>0}}),contains:u(function(e){return function(aJ){return(aJ.textContent||aJ.innerText||S(aJ)).indexOf(e)>-1}}),lang:u(function(e){if(!af.test(e||"")){H.error("unsupported lang: "+e)}e=e.replace(E,aq).toLowerCase();return function(aK){var aJ;do{if((aJ=au?aK.lang:aK.getAttribute("xml:lang")||aK.getAttribute("lang"))){aJ=aJ.toLowerCase();return aJ===e||aJ.indexOf(e+"-")===0}}while((aK=aK.parentNode)&&aK.nodeType===1);return false}}),target:function(e){var aJ=aB.location&&aB.location.hash;return aJ&&aJ.slice(1)===e.id},root:function(e){return e===A},focus:function(e){return e===N.activeElement&&(!N.hasFocus||N.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===false},disabled:function(e){return e.disabled===true},checked:function(e){var aJ=e.nodeName.toLowerCase();return(aJ==="input"&&!!e.checked)||(aJ==="option"&&!!e.selected)},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling){if(e.nodeType<6){return false}}return true},parent:function(e){return !z.pseudos.empty(e)},header:function(e){return w.test(e.nodeName)},input:function(e){return n.test(e.nodeName)},button:function(aJ){var e=aJ.nodeName.toLowerCase();return e==="input"&&aJ.type==="button"||e==="button"},text:function(aJ){var e;return aJ.nodeName.toLowerCase()==="input"&&aJ.type==="text"&&((e=aJ.getAttribute("type"))==null||e.toLowerCase()==="text")},first:at(function(){return[0]}),last:at(function(e,aJ){return[aJ-1]}),eq:at(function(e,aK,aJ){return[aJ<0?aJ+aK:aJ]}),even:at(function(e,aK){var aJ=0;for(;aJ=0;){e.push(aJ)}return e}),gt:at(function(e,aL,aK){var aJ=aK<0?aK+aL:aK;for(;++aJ1?function(aM,aL,aJ){var aK=e.length;while(aK--){if(!e[aK](aM,aL,aJ)){return false}}return true}:e[0]}function K(aJ,aM,aL){var aK=0,e=aM.length;for(;aK-1){aY[a0]=!(aV[a0]=aS)}}}}else{aU=al(aU===aV?aU.splice(aP,aU.length):aU);if(aN){aN(null,aV,aU,aX)}else{d.apply(aV,aU)}}})}function ax(aO){var aJ,aM,aK,aN=aO.length,aR=z.relative[aO[0].type],aS=aR||z.relative[" "],aL=aR?1:0,aP=C(function(aT){return aT===aJ},aS,true),aQ=C(function(aT){return o.call(aJ,aT)>-1},aS,true),e=[function(aV,aU,aT){return(!aR&&(aT||aU!==aI))||((aJ=aU).nodeType?aP(aV,aU,aT):aQ(aV,aU,aT))}];for(;aL1&&aH(e),aL>1&&t(aO.slice(0,aL-1).concat({value:aO[aL-2].type===" "?"*":""})).replace(D,"$1"),aM,aL0,aM=aL.length>0,aJ=function(aW,aQ,aV,aU,aZ){var aR,aS,aX,a1=0,aT="0",aN=aW&&[],a2=[],a0=aI,aP=aW||aM&&z.find.TAG("*",aZ),aO=(aF+=a0==null?1:Math.random()||0.1),aY=aP.length;if(aZ){aI=aQ!==N&&aQ}for(;aT!==aY&&(aR=aP[aT])!=null;aT++){if(aM&&aR){aS=0;while((aX=aL[aS++])){if(aX(aR,aQ,aV)){aU.push(aR);break}}if(aZ){aF=aO}}if(e){if((aR=!aX&&aR)){a1--}if(aW){aN.push(aR)}}}a1+=aT;if(e&&aT!==a1){aS=0;while((aX=aK[aS++])){aX(aN,a2,aQ,aV)}if(aW){if(a1>0){while(aT--){if(!(aN[aT]||a2[aT])){a2[aT]=az.call(aU)}}}a2=al(a2)}d.apply(aU,a2);if(aZ&&!aW&&a2.length>0&&(a1+aK.length)>1){H.uniqueSort(aU)}}if(aZ){aF=aO;aI=a0}return aN};return e?u(aJ):aJ}ah=H.compile=function(e,aK){var aL,aJ=[],aN=[],aM=R[e+" "];if(!aM){if(!aK){aK=s(e)}aL=aK.length;while(aL--){aM=ax(aK[aL]);if(aM[aw]){aJ.push(aM)}else{aN.push(aM)}}aM=R(e,aj(aN,aJ));aM.selector=e}return aM};aD=H.select=function(aK,e,aL,aO){var aM,aR,aJ,aS,aP,aQ=typeof aK==="function"&&aK,aN=!aO&&s((aK=aQ.selector||aK));aL=aL||[];if(aN.length===1){aR=aN[0]=aN[0].slice(0);if(aR.length>2&&(aJ=aR[0]).type==="ID"&&aE.getById&&e.nodeType===9&&au&&z.relative[aR[1].type]){e=(z.find.ID(aJ.matches[0].replace(E,aq),e)||[])[0];if(!e){return aL}else{if(aQ){e=e.parentNode}}aK=aK.slice(aR.shift().value.length)}aM=an.needsContext.test(aK)?0:aR.length;while(aM--){aJ=aR[aM];if(z.relative[(aS=aJ.type)]){break}if((aP=z.find[aS])){if((aO=aP(aJ.matches[0].replace(E,aq),am.test(aR[0].type)&&ae(e.parentNode)||e))){aR.splice(aM,1);aK=aO.length&&t(aR);if(!aK){d.apply(aL,aO);return aL}break}}}}(aQ||ah(aK,aN))(aO,e,!au,aL,am.test(aK)&&ae(e.parentNode)||e);return aL};aE.sortStable=aw.split("").sort(P).join("")===aw;aE.detectDuplicates=!!ai;ak();aE.sortDetached=q(function(e){return e.compareDocumentPosition(N.createElement("div"))&1});if(!q(function(e){e.innerHTML="";return e.firstChild.getAttribute("href")==="#"})){aG("type|href|height|width",function(aJ,e,aK){if(!aK){return aJ.getAttribute(e,e.toLowerCase()==="type"?1:2)}})}if(!aE.attributes||!q(function(e){e.innerHTML="";e.firstChild.setAttribute("value","");return e.firstChild.getAttribute("value")===""})){aG("value",function(aJ,e,aK){if(!aK&&aJ.nodeName.toLowerCase()==="input"){return aJ.defaultValue}})}if(!q(function(e){return e.getAttribute("disabled")==null})){aG(f,function(aJ,e,aL){var aK;if(!aL){return aJ[e]===true?e.toLowerCase():(aK=aJ.getAttributeNode(e))&&aK.specified?aK.value:null}})}if(typeof define==="function"&&define.amd){define(function(){return H})}else{if(typeof module!=="undefined"&&module.exports){module.exports=H}else{aB.Sizzle=H}}})(window);(function(){if(typeof Sizzle!=="undefined"){return}if(typeof define!=="undefined"&&define.amd){window.Sizzle=Prototype._actual_sizzle;window.define=Prototype._original_define;delete Prototype._actual_sizzle;delete Prototype._original_define}else{if(typeof module!=="undefined"&&module.exports){window.Sizzle=module.exports;module.exports={}}}})();(function(e){var f=Prototype.Selector.extendElements;function b(g,h){return f(e(g,h||document))}function d(h,g){return e.matches(g,[h]).length==1}Prototype.Selector.engine=e;Prototype.Selector.select=b;Prototype.Selector.match=d})(Sizzle);window.Sizzle=Prototype._original_property;delete Prototype._original_property;var Form={reset:function(b){b=$(b);b.reset();return b},serializeElements:function(n,f){if(typeof f!="object"){f={hash:!!f}}else{if(Object.isUndefined(f.hash)){f.hash=true}}var g,l,b=false,h=f.submit,d,e;if(f.hash){e={};d=function(o,p,q){if(p in o){if(!Object.isArray(o[p])){o[p]=[o[p]]}o[p]=o[p].concat(q)}else{o[p]=q}return o}}else{e="";d=function(o,q,p){if(!Object.isArray(p)){p=[p]}if(!p.length){return o}var r=encodeURIComponent(q).gsub(/%20/,"+");return o+(o?"&":"")+p.map(function(s){s=s.gsub(/(\r)?\n/,"\r\n");s=encodeURIComponent(s);s=s.gsub(/%20/,"+");return r+"="+s}).join("&")}}return n.inject(e,function(o,p){if(!p.disabled&&p.name){g=p.name;l=$(p).getValue();if(l!=null&&p.type!="file"&&(p.type!="submit"||(!b&&h!==false&&(!h||g==h)&&(b=true)))){o=d(o,g,l)}}return o})}};Form.Methods={serialize:function(d,b){return Form.serializeElements(Form.getElements(d),b)},getElements:function(g){var h=$(g).getElementsByTagName("*");var f,e=[],d=Form.Element.Serializers;for(var b=0;f=h[b];b++){if(d[f.tagName.toLowerCase()]){e.push(Element.extend(f))}}return e},getInputs:function(l,e,f){l=$(l);var b=l.getElementsByTagName("input");if(!e&&!f){return $A(b).map(Element.extend)}for(var g=0,n=[],h=b.length;g=0}).sortBy(function(f){return f.tabIndex}).first();return b?b:e.find(function(f){return/^(?:input|select|textarea)$/i.test(f.tagName)})},focusFirstElement:function(d){d=$(d);var b=d.findFirstElement();if(b){b.activate()}return d},request:function(d,b){d=$(d),b=Object.clone(b||{});var f=b.parameters,e=d.readAttribute("action")||"";if(e.blank()){e=window.location.href}b.parameters=d.serialize(true);if(f){if(Object.isString(f)){f=f.toQueryParams()}Object.extend(b.parameters,f)}if(d.hasAttribute("method")&&!b.method){b.method=d.method}return new Ajax.Request(e,b)}};Form.Element={focus:function(b){$(b).focus();return b},select:function(b){$(b).select();return b}};Form.Element.Methods={serialize:function(b){b=$(b);if(!b.disabled&&b.name){var d=b.getValue();if(d!=undefined){var e={};e[b.name]=d;return Object.toQueryString(e)}}return""},getValue:function(b){b=$(b);var d=b.tagName.toLowerCase();return Form.Element.Serializers[d](b)},setValue:function(b,d){b=$(b);var e=b.tagName.toLowerCase();Form.Element.Serializers[e](b,d);return b},clear:function(b){$(b).value="";return b},present:function(b){return $(b).value!=""},activate:function(b){b=$(b);try{b.focus();if(b.select&&(b.tagName.toLowerCase()!="input"||!(/^(?:button|reset|submit)$/i.test(b.type)))){b.select()}}catch(d){}return b},disable:function(b){b=$(b);b.disabled=true;return b},enable:function(b){b=$(b);b.disabled=false;return b}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers=(function(){function d(n,o){switch(n.type.toLowerCase()){case"checkbox":case"radio":return h(n,o);default:return g(n,o)}}function h(n,o){if(Object.isUndefined(o)){return n.checked?n.value:null}else{n.checked=!!o}}function g(n,o){if(Object.isUndefined(o)){return n.value}else{n.value=o}}function b(p,s){if(Object.isUndefined(s)){return(p.type==="select-one"?e:f)(p)}var o,q,t=!Object.isArray(s);for(var n=0,r=p.length;n=0?l(o.options[n]):null}function f(q){var n,r=q.length;if(!r){return null}for(var p=0,n=[];p=this.offset[1]&&e=this.offset[0]&&b=this.offset[1]&&this.ycomp=this.offset[0]&&this.xcomp0})._each(d,b)},set:function(b){this.element.className=b},add:function(b){if(this.include(b)){return}this.set($A(this).concat(b).join(" "))},remove:function(b){if(!this.include(b)){return}this.set($A(this).without(b).join(" "))},toString:function(){return $A(this).join(" ")}};Object.extend(Element.ClassNames.prototype,Enumerable);(function(){window.Selector=Class.create({initialize:function(b){this.expression=b.strip()},findElements:function(b){return Prototype.Selector.select(this.expression,b)},match:function(b){return Prototype.Selector.match(b,this.expression)},toString:function(){return this.expression},inspect:function(){return"#"}});Object.extend(Selector,{matchElements:function(h,l){var b=Prototype.Selector.match,f=[];for(var e=0,g=h.length;e0){if(typeof arguments[0]=="string"){e=arguments[0];d=1}else{e=arguments[0]?arguments[0].id:null}}if(!e){e="window_"+new Date().getTime()}if($(e)){alert("Window "+e+" is already registered in the DOM! Make sure you use setDestroyOnClose() or destroyOnClose: true in the constructor")}this.options=Object.extend({className:"dialog",blurClassName:null,minWidth:100,minHeight:20,resizable:true,closable:true,minimizable:true,maximizable:true,draggable:true,userData:null,showEffect:(Window.hasEffectLib?Effect.Appear:Element.show),hideEffect:(Window.hasEffectLib?Effect.Fade:Element.hide),showEffectOptions:{},hideEffectOptions:{},effectOptions:null,parent:document.body,title:" ",url:null,onload:Prototype.emptyFunction,width:200,height:300,opacity:1,recenterAuto:true,wiredDrag:false,closeCallback:null,destroyOnClose:false,gridX:1,gridY:1},arguments[d]||{});if(this.options.blurClassName){this.options.focusClassName=this.options.className}if(typeof this.options.top=="undefined"&&typeof this.options.bottom=="undefined"){this.options.top=this._round(Math.random()*500,this.options.gridY)}if(typeof this.options.left=="undefined"&&typeof this.options.right=="undefined"){this.options.left=this._round(Math.random()*500,this.options.gridX)}if(this.options.effectOptions){Object.extend(this.options.hideEffectOptions,this.options.effectOptions);Object.extend(this.options.showEffectOptions,this.options.effectOptions);if(this.options.showEffect==Element.Appear){this.options.showEffectOptions.to=this.options.opacity}}if(Window.hasEffectLib){if(this.options.showEffect==Effect.Appear){this.options.showEffectOptions.to=this.options.opacity}if(this.options.hideEffect==Effect.Fade){this.options.hideEffectOptions.from=this.options.opacity}}if(this.options.hideEffect==Element.hide){this.options.hideEffect=function(){Element.hide(this.element);if(this.options.destroyOnClose){this.destroy()}}.bind(this)}if(this.options.parent!=document.body){this.options.parent=$(this.options.parent)}this.element=this._createWindow(e);this.element.win=this;this.eventMouseDown=this._initDrag.bindAsEventListener(this);this.eventMouseUp=this._endDrag.bindAsEventListener(this);this.eventMouseMove=this._updateDrag.bindAsEventListener(this);this.eventOnLoad=this._getWindowBorderSize.bindAsEventListener(this);this.eventMouseDownContent=this.toFront.bindAsEventListener(this);this.eventResize=this._recenter.bindAsEventListener(this);this.topbar=$(this.element.id+"_top");this.bottombar=$(this.element.id+"_bottom");this.content=$(this.element.id+"_content");Event.observe(this.topbar,"mousedown",this.eventMouseDown);Event.observe(this.bottombar,"mousedown",this.eventMouseDown);Event.observe(this.content,"mousedown",this.eventMouseDownContent);Event.observe(window,"load",this.eventOnLoad);Event.observe(window,"resize",this.eventResize);Event.observe(window,"scroll",this.eventResize);Event.observe(this.options.parent,"scroll",this.eventResize);if(this.options.draggable){var b=this;[this.topbar,this.topbar.up().previous(),this.topbar.up().next()].each(function(f){f.observe("mousedown",b.eventMouseDown);f.addClassName("top_draggable")});[this.bottombar.up(),this.bottombar.up().previous(),this.bottombar.up().next()].each(function(f){f.observe("mousedown",b.eventMouseDown);f.addClassName("bottom_draggable")})}if(this.options.resizable){this.sizer=$(this.element.id+"_sizer");Event.observe(this.sizer,"mousedown",this.eventMouseDown)}this.useLeft=null;this.useTop=null;if(typeof this.options.left!="undefined"){this.element.setStyle({left:parseFloat(this.options.left)+"px"});this.useLeft=true}else{this.element.setStyle({right:parseFloat(this.options.right)+"px"});this.useLeft=false}if(typeof this.options.top!="undefined"){this.element.setStyle({top:parseFloat(this.options.top)+"px"});this.useTop=true}else{this.element.setStyle({bottom:parseFloat(this.options.bottom)+"px"});this.useTop=false}this.storedLocation=null;this.setOpacity(this.options.opacity);if(this.options.zIndex){this.setZIndex(this.options.zIndex)}if(this.options.destroyOnClose){this.setDestroyOnClose(true)}this._getWindowBorderSize();this.width=this.options.width;this.height=this.options.height;this.visible=false;this.constraint=false;this.constraintPad={top:0,left:0,bottom:0,right:0};if(this.width&&this.height){this.setSize(this.options.width,this.options.height)}this.setTitle(this.options.title);Windows.register(this)},destroy:function(){this._notify("onDestroy");Event.stopObserving(this.topbar,"mousedown",this.eventMouseDown);Event.stopObserving(this.bottombar,"mousedown",this.eventMouseDown);Event.stopObserving(this.content,"mousedown",this.eventMouseDownContent);Event.stopObserving(window,"load",this.eventOnLoad);Event.stopObserving(window,"resize",this.eventResize);Event.stopObserving(window,"scroll",this.eventResize);Event.stopObserving(this.options.parent,"scroll",this.eventResize);Event.stopObserving(this.content,"load",this.options.onload);if(this._oldParent){var e=this.getContent();var b=null;for(var d=0;d
';$(this.getId()+"_table_content").innerHTML=d;this.content=$(this.element.id+"_content")}this.getContent().update(b);return this},setAjaxContent:function(d,b,f,e){this.showFunction=f?"showCenter":"show";this.showModal=e||false;b=b||{};this.setHTMLContent("");this.onComplete=b.onComplete;if(!this._onCompleteHandler){this._onCompleteHandler=this._setAjaxContent.bind(this)}b.onComplete=this._onCompleteHandler;new Ajax.Request(d,b);b.onComplete=this.onComplete},_setAjaxContent:function(b){Element.update(this.getContent(),b.responseText);if(this.onComplete){this.onComplete(b)}this.onComplete=null;this[this.showFunction](this.showModal)},setURL:function(b){if(this.options.url){this.content.src=null}this.options.url=b;var d="";$(this.getId()+"_table_content").innerHTML=d;this.content=$(this.element.id+"_content")},getURL:function(){return this.options.url?this.options.url:null},refresh:function(){if(this.options.url){$(this.element.getAttribute("id")+"_content").src=this.options.url}},setCookie:function(d,e,t,g,b){d=d||this.element.id;this.cookie=[d,e,t,g,b];var r=WindowUtilities.getCookie(d);if(r){var s=r.split(",");var p=s[0].split(":");var o=s[1].split(":");var q=parseFloat(s[2]),l=parseFloat(s[3]);var n=s[4];var f=s[5];this.setSize(q,l);if(n=="true"){this.doMinimize=true}else{if(f=="true"){this.doMaximize=true}}this.useLeft=p[0]=="l";this.useTop=o[0]=="t";this.element.setStyle(this.useLeft?{left:p[1]}:{right:p[1]});this.element.setStyle(this.useTop?{top:o[1]}:{bottom:o[1]})}},getId:function(){return this.element.id},setDestroyOnClose:function(){this.options.destroyOnClose=true},setConstraint:function(b,d){this.constraint=b;this.constraintPad=Object.extend(this.constraintPad,d||{});if(this.useTop&&this.useLeft){this.setLocation(parseFloat(this.element.style.top),parseFloat(this.element.style.left))}},_initDrag:function(d){if(Event.element(d)==this.sizer&&this.isMinimized()){return}if(Event.element(d)!=this.sizer&&this.isMaximized()){return}if(Prototype.Browser.IE&&this.heightN==0){this._getWindowBorderSize()}this.pointer=[this._round(Event.pointerX(d),this.options.gridX),this._round(Event.pointerY(d),this.options.gridY)];if(this.options.wiredDrag){this.currentDrag=this._createWiredElement()}else{this.currentDrag=this.element}if(Event.element(d)==this.sizer){this.doResize=true;this.widthOrg=this.width;this.heightOrg=this.height;this.bottomOrg=parseFloat(this.element.getStyle("bottom"));this.rightOrg=parseFloat(this.element.getStyle("right"));this._notify("onStartResize")}else{this.doResize=false;var b=$(this.getId()+"_close");if(b&&Position.within(b,this.pointer[0],this.pointer[1])){this.currentDrag=null;return}this.toFront();if(!this.options.draggable){return}this._notify("onStartMove")}Event.observe(document,"mouseup",this.eventMouseUp,false);Event.observe(document,"mousemove",this.eventMouseMove,false);WindowUtilities.disableScreen("__invisible__","__invisible__",this.overlayOpacity);document.body.ondrag=function(){return false};document.body.onselectstart=function(){return false};this.currentDrag.show();Event.stop(d)},_round:function(d,b){return b==1?d:d=Math.floor(d/b)*b},_updateDrag:function(d){var b=[this._round(Event.pointerX(d),this.options.gridX),this._round(Event.pointerY(d),this.options.gridY)];var q=b[0]-this.pointer[0];var p=b[1]-this.pointer[1];if(this.doResize){var o=this.widthOrg+q;var f=this.heightOrg+p;q=this.width-this.widthOrg;p=this.height-this.heightOrg;if(this.useLeft){o=this._updateWidthConstraint(o)}else{this.currentDrag.setStyle({right:(this.rightOrg-q)+"px"})}if(this.useTop){f=this._updateHeightConstraint(f)}else{this.currentDrag.setStyle({bottom:(this.bottomOrg-p)+"px"})}this.setSize(o,f);this._notify("onResize")}else{this.pointer=b;if(this.useLeft){var e=parseFloat(this.currentDrag.getStyle("left"))+q;var n=this._updateLeftConstraint(e);this.pointer[0]+=n-e;this.currentDrag.setStyle({left:n+"px"})}else{this.currentDrag.setStyle({right:parseFloat(this.currentDrag.getStyle("right"))-q+"px"})}if(this.useTop){var l=parseFloat(this.currentDrag.getStyle("top"))+p;var g=this._updateTopConstraint(l);this.pointer[1]+=g-l;this.currentDrag.setStyle({top:g+"px"})}else{this.currentDrag.setStyle({bottom:parseFloat(this.currentDrag.getStyle("bottom"))-p+"px"})}this._notify("onMove")}if(this.iefix){this._fixIEOverlapping()}this._removeStoreLocation();Event.stop(d)},_endDrag:function(b){WindowUtilities.enableScreen("__invisible__");if(this.doResize){this._notify("onEndResize")}else{this._notify("onEndMove")}Event.stopObserving(document,"mouseup",this.eventMouseUp,false);Event.stopObserving(document,"mousemove",this.eventMouseMove,false);Event.stop(b);this._hideWiredElement();this._saveCookie();document.body.ondrag=null;document.body.onselectstart=null},_updateLeftConstraint:function(d){if(this.constraint&&this.useLeft&&this.useTop){var b=this.options.parent==document.body?WindowUtilities.getPageSize().windowWidth:this.options.parent.getDimensions().width;if(db-this.constraintPad.right){d=b-this.constraintPad.right-this.width-this.widthE-this.widthW}}return d},_updateTopConstraint:function(e){if(this.constraint&&this.useLeft&&this.useTop){var b=this.options.parent==document.body?WindowUtilities.getPageSize().windowHeight:this.options.parent.getDimensions().height;var d=this.height+this.heightN+this.heightS;if(eb-this.constraintPad.bottom){e=b-this.constraintPad.bottom-d}}return e},_updateWidthConstraint:function(b){if(this.constraint&&this.useLeft&&this.useTop){var d=this.options.parent==document.body?WindowUtilities.getPageSize().windowWidth:this.options.parent.getDimensions().width;var e=parseFloat(this.element.getStyle("left"));if(e+b+this.widthE+this.widthW>d-this.constraintPad.right){b=d-this.constraintPad.right-e-this.widthE-this.widthW}}return b},_updateHeightConstraint:function(d){if(this.constraint&&this.useLeft&&this.useTop){var b=this.options.parent==document.body?WindowUtilities.getPageSize().windowHeight:this.options.parent.getDimensions().height;var e=parseFloat(this.element.getStyle("top"));if(e+d+this.heightN+this.heightS>b-this.constraintPad.bottom){d=b-this.constraintPad.bottom-e-this.heightN-this.heightS}}return d},_createWindow:function(b){var h=this.options.className;var f=document.createElement("div");f.setAttribute("id",b);f.className="dialog";var g;if(this.options.url){g=''}else{g='
'}var l=this.options.closable?"
":"";var n=this.options.minimizable?"
":"";var o=this.options.maximizable?"
":"";var e=this.options.resizable?"class='"+h+"_sizer' id='"+b+"_sizer'":"class='"+h+"_se'";var d="../themes/default/blank.gif";f.innerHTML=l+n+o+"
"+this.options.title+"
"+g+"
";Element.hide(f);this.options.parent.insertBefore(f,this.options.parent.firstChild);Event.observe($(b+"_content"),"load",this.options.onload);return f},changeClassName:function(b){var d=this.options.className;var e=this.getId();$A(["_close","_minimize","_maximize","_content"]).each(function(f){this._toggleClassName($(e+f),d+f,b+f)}.bind(this));this._toggleClassName($(e+"_top"),d+"_title",b+"_title");$$("#"+e+" td").each(function(f){f.className=f.className.sub(d,b)});this.options.className=b;this._getWindowBorderSize();this.setSize(this.width,this.height)},_toggleClassName:function(e,d,b){if(e){e.removeClassName(d);e.addClassName(b)}},setLocation:function(f,d){f=this._updateTopConstraint(f);d=this._updateLeftConstraint(d);var b=this.currentDrag||this.element;b.setStyle({top:f+"px"});b.setStyle({left:d+"px"});this.useLeft=true;this.useTop=true},getLocation:function(){var b={};if(this.useTop){b=Object.extend(b,{top:this.element.getStyle("top")})}else{b=Object.extend(b,{bottom:this.element.getStyle("bottom")})}if(this.useLeft){b=Object.extend(b,{left:this.element.getStyle("left")})}else{b=Object.extend(b,{right:this.element.getStyle("right")})}return b},getSize:function(){return{width:this.width,height:this.height}},setSize:function(f,d,b){f=parseFloat(f);d=parseFloat(d);if(!this.minimized&&fthis.options.maxHeight){d=this.options.maxHeight}if(this.options.maxWidth&&f>this.options.maxWidth){f=this.options.maxWidth}if(this.useTop&&this.useLeft&&Window.hasEffectLib&&Effect.ResizeWindow&&b){new Effect.ResizeWindow(this,null,null,f,d,{duration:Window.resizeEffectDuration})}else{this.width=f;this.height=d;var h=this.currentDrag?this.currentDrag:this.element;h.setStyle({width:f+this.widthW+this.widthE+"px"});h.setStyle({height:d+this.heightN+this.heightS+"px"});if(!this.currentDrag||this.currentDrag==this.element){var g=$(this.element.id+"_content");g.setStyle({height:d+"px"});g.setStyle({width:f+"px"})}}},updateHeight:function(){this.setSize(this.width,this.content.scrollHeight,true)},updateWidth:function(){this.setSize(this.content.scrollWidth,this.height,true)},toFront:function(){if(this.element.style.zIndex0)&&(navigator.userAgent.indexOf("Opera")<0)&&(this.element.getStyle("position")=="absolute")){new Insertion.After(this.element.id,'');this.iefix=$(this.element.id+"_iefix")}if(this.iefix){setTimeout(this._fixIEOverlapping.bind(this),50)}},_fixIEOverlapping:function(){Position.clone(this.element,this.iefix);this.iefix.style.zIndex=this.element.style.zIndex-1;this.iefix.show()},_getWindowBorderSize:function(d){var e=this._createHiddenDiv(this.options.className+"_n");this.heightN=Element.getDimensions(e).height;e.parentNode.removeChild(e);var e=this._createHiddenDiv(this.options.className+"_s");this.heightS=Element.getDimensions(e).height;e.parentNode.removeChild(e);var e=this._createHiddenDiv(this.options.className+"_e");this.widthE=Element.getDimensions(e).width;e.parentNode.removeChild(e);var e=this._createHiddenDiv(this.options.className+"_w");this.widthW=Element.getDimensions(e).width;e.parentNode.removeChild(e);var e=document.createElement("div");e.className="overlay_"+this.options.className;document.body.appendChild(e);var b=this;setTimeout(function(){b.overlayOpacity=($(e).getStyle("opacity"));e.parentNode.removeChild(e)},10);if(Prototype.Browser.IE){this.heightS=$(this.getId()+"_row3").getDimensions().height;this.heightN=$(this.getId()+"_row1").getDimensions().height}if(Prototype.Browser.WebKit&&Prototype.Browser.WebKitVersion<420){this.setSize(this.width,this.height)}if(this.doMaximize){this.maximize()}if(this.doMinimize){this.minimize()}},_createHiddenDiv:function(d){var b=document.body;var e=document.createElement("div");e.setAttribute("id",this.element.id+"_tmp");e.className=d;e.style.display="none";e.innerHTML="";b.insertBefore(e,b.firstChild);return e},_storeLocation:function(){if(this.storedLocation==null){this.storedLocation={useTop:this.useTop,useLeft:this.useLeft,top:this.element.getStyle("top"),bottom:this.element.getStyle("bottom"),left:this.element.getStyle("left"),right:this.element.getStyle("right"),width:this.width,height:this.height}}},_restoreLocation:function(){if(this.storedLocation!=null){this.useLeft=this.storedLocation.useLeft;this.useTop=this.storedLocation.useTop;if(this.useLeft&&this.useTop&&Window.hasEffectLib&&Effect.ResizeWindow){new Effect.ResizeWindow(this,this.storedLocation.top,this.storedLocation.left,this.storedLocation.width,this.storedLocation.height,{duration:Window.resizeEffectDuration})}else{this.element.setStyle(this.useLeft?{left:this.storedLocation.left}:{right:this.storedLocation.right});this.element.setStyle(this.useTop?{top:this.storedLocation.top}:{bottom:this.storedLocation.bottom});this.setSize(this.storedLocation.width,this.storedLocation.height)}Windows.resetOverflow();this._removeStoreLocation()}},_removeStoreLocation:function(){this.storedLocation=null},_saveCookie:function(){if(this.cookie){var b="";if(this.useLeft){b+="l:"+(this.storedLocation?this.storedLocation.left:this.element.getStyle("left"))}else{b+="r:"+(this.storedLocation?this.storedLocation.right:this.element.getStyle("right"))}if(this.useTop){b+=",t:"+(this.storedLocation?this.storedLocation.top:this.element.getStyle("top"))}else{b+=",b:"+(this.storedLocation?this.storedLocation.bottom:this.element.getStyle("bottom"))}b+=","+(this.storedLocation?this.storedLocation.width:this.width);b+=","+(this.storedLocation?this.storedLocation.height:this.height);b+=","+this.isMinimized();b+=","+this.isMaximized();WindowUtilities.setCookie(b,this.cookie)}},_createWiredElement:function(){if(!this.wiredElement){if(Prototype.Browser.IE){this._getWindowBorderSize()}var d=document.createElement("div");d.className="wired_frame "+this.options.className+"_wired_frame";d.style.position="absolute";this.options.parent.insertBefore(d,this.options.parent.firstChild);this.wiredElement=$(d)}if(this.useLeft){this.wiredElement.setStyle({left:this.element.getStyle("left")})}else{this.wiredElement.setStyle({right:this.element.getStyle("right")})}if(this.useTop){this.wiredElement.setStyle({top:this.element.getStyle("top")})}else{this.wiredElement.setStyle({bottom:this.element.getStyle("bottom")})}var b=this.element.getDimensions();this.wiredElement.setStyle({width:b.width+"px",height:b.height+"px"});this.wiredElement.setStyle({zIndex:Windows.maxZIndex+30});return this.wiredElement},_hideWiredElement:function(){if(!this.wiredElement||!this.currentDrag){return}if(this.currentDrag==this.element){this.currentDrag=null}else{if(this.useLeft){this.element.setStyle({left:this.currentDrag.getStyle("left")})}else{this.element.setStyle({right:this.currentDrag.getStyle("right")})}if(this.useTop){this.element.setStyle({top:this.currentDrag.getStyle("top")})}else{this.element.setStyle({bottom:this.currentDrag.getStyle("bottom")})}this.currentDrag.hide();this.currentDrag=null;if(this.doResize){this.setSize(this.width,this.height)}}},_notify:function(b){if(this.options[b]){this.options[b](this)}else{Windows.notify(b,this)}}};var Windows={windows:[],modalWindows:[],observers:[],focusedWindow:null,maxZIndex:0,overlayShowEffectOptions:{duration:0.5},overlayHideEffectOptions:{duration:0.5},addObserver:function(b){this.removeObserver(b);this.observers.push(b)},removeObserver:function(b){this.observers=this.observers.reject(function(d){return d==b})},notify:function(b,d){this.observers.each(function(e){if(e[b]){e[b](b,d)}})},getWindow:function(b){return this.windows.detect(function(e){return e.getId()==b})},getFocusedWindow:function(){return this.focusedWindow},updateFocusedWindow:function(){this.focusedWindow=this.windows.length>=2?this.windows[this.windows.length-2]:null},addModalWindow:function(b){if(this.modalWindows.length==0){WindowUtilities.disableScreen(b.options.className,"overlay_modal",b.overlayOpacity,b.getId(),b.options.parent)}else{if(Window.keepMultiModalWindow){$("overlay_modal").style.zIndex=Windows.maxZIndex+1;Windows.maxZIndex+=1;WindowUtilities._hideSelect(this.modalWindows.last().getId())}else{this.modalWindows.last().element.hide()}WindowUtilities._showSelect(b.getId())}this.modalWindows.push(b)},removeModalWindow:function(b){this.modalWindows.pop();if(this.modalWindows.length==0){WindowUtilities.enableScreen()}else{if(Window.keepMultiModalWindow){this.modalWindows.last().toFront();WindowUtilities._showSelect(this.modalWindows.last().getId())}else{this.modalWindows.last().element.show()}}},register:function(b){this.windows.push(b)},unregister:function(b){this.windows=this.windows.reject(function(e){return e==b})},closeAll:function(){this.windows.each(function(b){Windows.close(b.getId())})},closeAllModalWindows:function(){WindowUtilities.enableScreen();this.modalWindows.each(function(b){if(b){b.close()}})},minimize:function(e,b){var d=this.getWindow(e);if(d&&d.visible){d.minimize()}Event.stop(b)},maximize:function(e,b){var d=this.getWindow(e);if(d&&d.visible){d.maximize()}Event.stop(b)},close:function(e,b){var d=this.getWindow(e);if(d){d.close()}if(b){Event.stop(b)}},blur:function(d){var b=this.getWindow(d);if(!b){return}if(b.options.blurClassName){b.changeClassName(b.options.blurClassName)}if(this.focusedWindow==b){this.focusedWindow=null}b._notify("onBlur")},focus:function(d){var b=this.getWindow(d);if(!b){return}if(this.focusedWindow){this.blur(this.focusedWindow.getId())}if(b.options.focusClassName){b.changeClassName(b.options.focusClassName)}this.focusedWindow=b;b._notify("onFocus")},unsetOverflow:function(b){this.windows.each(function(e){e.oldOverflow=e.getContent().getStyle("overflow")||"auto";e.getContent().setStyle({overflow:"hidden"})});if(b&&b.oldOverflow){b.getContent().setStyle({overflow:b.oldOverflow})}},resetOverflow:function(){this.windows.each(function(b){if(b.oldOverflow){b.getContent().setStyle({overflow:b.oldOverflow})}})},updateZindex:function(b,d){if(b>this.maxZIndex){this.maxZIndex=b;if(this.focusedWindow){this.blur(this.focusedWindow.getId())}}this.focusedWindow=d;if(this.focusedWindow){this.focus(this.focusedWindow.getId())}}};var Dialog={dialogId:null,onCompleteFunc:null,callFunc:null,parameters:null,confirm:function(f,e){if(f&&typeof f!="string"){Dialog._runAjaxRequest(f,e,Dialog.confirm);return}f=f||"";e=e||{};var h=e.okLabel?e.okLabel:"Ok";var b=e.cancelLabel?e.cancelLabel:"Cancel";e=Object.extend(e,e.windowParameters||{});e.windowParameters=e.windowParameters||{};e.className=e.className||"alert";var d="class ='"+(e.buttonClass?e.buttonClass+" ":"")+" ok_button'";var g="class ='"+(e.buttonClass?e.buttonClass+" ":"")+" cancel_button'";var f="
"+f+"
";return this._openDialog(f,e)},alert:function(e,d){if(e&&typeof e!="string"){Dialog._runAjaxRequest(e,d,Dialog.alert);return}e=e||"";d=d||{};var f=d.okLabel?d.okLabel:"Ok";d=Object.extend(d,d.windowParameters||{});d.windowParameters=d.windowParameters||{};d.className=d.className||"alert";var b="class ='"+(d.buttonClass?d.buttonClass+" ":"")+" ok_button'";var e="
"+e+"
";return this._openDialog(e,d)},info:function(d,b){if(d&&typeof d!="string"){Dialog._runAjaxRequest(d,b,Dialog.info);return}d=d||"";b=b||{};b=Object.extend(b,b.windowParameters||{});b.windowParameters=b.windowParameters||{};b.className=b.className||"alert";var d="";if(b.showProgress){d+=""}b.ok=null;b.cancel=null;return this._openDialog(d,b)},setInfoMessage:function(b){$("modal_dialog_message").update(b)},closeInfo:function(){Windows.close(this.dialogId)},_openDialog:function(g,f){var e=f.className;if(!f.height&&!f.width){f.width=WindowUtilities.getPageSize((f.options&&f.options.parent)||document.body).pageWidth/2}if(f.id){this.dialogId=f.id}else{var d=new Date();this.dialogId="modal_dialog_"+d.getTime();f.id=this.dialogId}if(!f.height||!f.width){var b=WindowUtilities._computeSize(g,this.dialogId,f.width,f.height,5,e);if(f.height){f.width=b+5}else{f.height=b+5}}f.effectOptions=f.effectOptions;f.resizable=f.resizable||false;f.minimizable=f.minimizable||false;f.maximizable=f.maximizable||false;f.draggable=f.draggable||false;f.closable=f.closable||false;var h=new Window(f);if(!f.url){h.setHTMLContent(g)}h.showCenter(true,f.top,f.left);h.setDestroyOnClose();h.cancelCallback=f.onCancel||f.cancel;h.okCallback=f.onOk||f.ok;return h},_getAjaxContent:function(b){Dialog.callFunc(b.responseText,Dialog.parameters)},_runAjaxRequest:function(e,d,b){if(e.options==null){e.options={}}Dialog.onCompleteFunc=e.options.onComplete;Dialog.parameters=d;Dialog.callFunc=b;e.options.onComplete=Dialog._getAjaxContent;new Ajax.Request(e.url,e.options)},okCallback:function(){var b=Windows.focusedWindow;if(!b.okCallback||b.okCallback(b)){$$("#"+b.getId()+" input").each(function(d){d.onclick=null});b.close()}},cancelCallback:function(){var b=Windows.focusedWindow;$$("#"+b.getId()+" input").each(function(d){d.onclick=null});b.close();if(b.cancelCallback){b.cancelCallback(b)}}};if(Prototype.Browser.WebKit){var array=navigator.userAgent.match(new RegExp(/AppleWebKit\/([\d\.\+]*)/));Prototype.Browser.WebKitVersion=parseFloat(array[1])}var WindowUtilities={getWindowScroll:function(parent){var T,L,W,H;parent=parent||document.body;if(parent!=document.body){T=parent.scrollTop;L=parent.scrollLeft;W=parent.scrollWidth;H=parent.scrollHeight}else{var w=window;with(w.document){if(w.document.documentElement&&documentElement.scrollTop){T=documentElement.scrollTop;L=documentElement.scrollLeft}else{if(w.document.body){T=body.scrollTop;L=body.scrollLeft}}if(w.innerWidth){W=w.innerWidth;H=w.innerHeight}else{if(w.document.documentElement&&documentElement.clientWidth){W=documentElement.clientWidth;H=documentElement.clientHeight}else{W=body.offsetWidth;H=body.offsetHeight}}}}return{top:T,left:L,width:W,height:H}},getPageSize:function(f){f=f||document.body;var e,l;var g,d;if(f!=document.body){e=f.getWidth();l=f.getHeight();d=f.scrollWidth;g=f.scrollHeight}else{var h,b;if(window.innerHeight&&window.scrollMaxY){h=document.body.scrollWidth;b=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){h=document.body.scrollWidth;b=document.body.scrollHeight}else{h=document.body.offsetWidth;b=document.body.offsetHeight}}if(self.innerHeight){e=self.innerWidth;l=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){e=document.documentElement.clientWidth;l=document.documentElement.clientHeight}else{if(document.body){e=document.body.clientWidth;l=document.body.clientHeight}}}if(b"}catch(h){}var g=d.firstChild||null;if(g&&(g.tagName.toUpperCase()!=b)){g=g.getElementsByTagName(b)[0]}if(!g){g=document.createElement(b)}if(!g){return}if(arguments[1]){if(this._isStringOrNumber(arguments[1])||(arguments[1] instanceof Array)||arguments[1].tagName){this._children(g,arguments[1])}else{var f=this._attributes(arguments[1]);if(f.length){try{d.innerHTML="<"+b+" "+f+">"}catch(h){}g=d.firstChild||null;if(!g){g=document.createElement(b);for(attr in arguments[1]){g[attr=="class"?"className":attr]=arguments[1][attr]}}if(g.tagName.toUpperCase()!=b){g=d.getElementsByTagName(b)[0]}}}}if(arguments[2]){this._children(g,arguments[2])}return $(g)},_text:function(b){return document.createTextNode(b)},ATTR_MAP:{className:"class",htmlFor:"for"},_attributes:function(b){var d=[];for(attribute in b){d.push((attribute in this.ATTR_MAP?this.ATTR_MAP[attribute]:attribute)+'="'+b[attribute].toString().escapeHTML().gsub(/"/,""")+'"')}return d.join(" ")},_children:function(d,b){if(b.tagName){d.appendChild(b);return}if(typeof b=="object"){b.flatten().each(function(f){if(typeof f=="object"){d.appendChild(f)}else{if(Builder._isStringOrNumber(f)){d.appendChild(Builder._text(f))}}})}else{if(Builder._isStringOrNumber(b)){d.appendChild(Builder._text(b))}}},_isStringOrNumber:function(b){return(typeof b=="string"||typeof b=="number")},build:function(d){var b=this.node("div");$(b).update(d.strip());return b.down()},dump:function(d){if(typeof d!="object"&&typeof d!="function"){d=window}var b=("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/);b.each(function(e){d[e]=function(){return Builder.node.apply(Builder,[e].concat($A(arguments)))}})}};String.prototype.parseColor=function(){var b="#";if(this.slice(0,4)=="rgb("){var e=this.slice(4,this.length-1).split(",");var d=0;do{b+=parseInt(e[d]).toColorPart()}while(++d<3)}else{if(this.slice(0,1)=="#"){if(this.length==4){for(var d=1;d<4;d++){b+=(this.charAt(d)+this.charAt(d)).toLowerCase()}}if(this.length==7){b=this.toLowerCase()}}}return(b.length==7?b:(arguments[0]||this))};Element.collectTextNodes=function(b){return $A($(b).childNodes).collect(function(d){return(d.nodeType==3?d.nodeValue:(d.hasChildNodes()?Element.collectTextNodes(d):""))}).flatten().join("")};Element.collectTextNodesIgnoreClass=function(b,d){return $A($(b).childNodes).collect(function(e){return(e.nodeType==3?e.nodeValue:((e.hasChildNodes()&&!Element.hasClassName(e,d))?Element.collectTextNodesIgnoreClass(e,d):""))}).flatten().join("")};Element.setContentZoom=function(b,d){b=$(b);b.setStyle({fontSize:(d/100)+"em"});if(Prototype.Browser.WebKit){window.scrollBy(0,0)}return b};Element.getInlineOpacity=function(b){return $(b).style.opacity||""};Element.forceRerendering=function(b){try{b=$(b);var f=document.createTextNode(" ");b.appendChild(f);b.removeChild(f)}catch(d){}};var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},Transitions:{linear:Prototype.K,sinoidal:function(b){return(-Math.cos(b*Math.PI)/2)+0.5},reverse:function(b){return 1-b},flicker:function(b){var b=((-Math.cos(b*Math.PI)/4)+0.75)+Math.random()/4;return b>1?1:b},wobble:function(b){return(-Math.cos(b*Math.PI*(9*b))/2)+0.5},pulse:function(d,b){return(-Math.cos((d*((b||5)-0.5)*2)*Math.PI)/2)+0.5},spring:function(b){return 1-(Math.cos(b*4.5*Math.PI)*Math.exp(-b*6))},none:function(b){return 0},full:function(b){return 1}},DefaultOptions:{duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"},tagifyText:function(b){var d="position:relative";if(Prototype.Browser.IE){d+=";zoom:1"}b=$(b);$A(b.childNodes).each(function(e){if(e.nodeType==3){e.nodeValue.toArray().each(function(f){b.insertBefore(new Element("span",{style:d}).update(f==" "?String.fromCharCode(160):f),e)});Element.remove(e)}})},multiple:function(d,e){var g;if(((typeof d=="object")||Object.isFunction(d))&&(d.length)){g=d}else{g=$(d).childNodes}var b=Object.extend({speed:0.1,delay:0},arguments[2]||{});var f=b.delay;$A(g).each(function(l,h){new e(l,Object.extend(b,{delay:h*b.speed+f}))})},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(d,e,b){d=$(d);e=(e||"appear").toLowerCase();return Effect[Effect.PAIRS[e][d.visible()?1:0]](d,Object.extend({queue:{position:"end",scope:(d.id||"global"),limit:1}},b||{}))}};Effect.DefaultOptions.transition=Effect.Transitions.sinoidal;Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[];this.interval=null},_each:function(b){this.effects._each(b)},add:function(d){var e=new Date().getTime();var b=Object.isString(d.options.queue)?d.options.queue:d.options.queue.position;switch(b){case"front":this.effects.findAll(function(f){return f.state=="idle"}).each(function(f){f.startOn+=d.finishOn;f.finishOn+=d.finishOn});break;case"with-last":e=this.effects.pluck("startOn").max()||e;break;case"end":e=this.effects.pluck("finishOn").max()||e;break}d.startOn+=e;d.finishOn+=e;if(!d.options.queue.limit||(this.effects.length=this.startOn){if(e>=this.finishOn){this.render(1);this.cancel();this.event("beforeFinish");if(this.finish){this.finish()}this.event("afterFinish");return}var d=(e-this.startOn)/this.totalTime,b=(d*this.totalFrames).round();if(b>this.currentFrame){this.render(d);this.currentFrame=b}}},cancel:function(){if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).remove(this)}this.state="finished"},event:function(b){if(this.options[b+"Internal"]){this.options[b+"Internal"](this)}if(this.options[b]){this.options[b](this)}},inspect:function(){var b=$H();for(property in this){if(!Object.isFunction(this[property])){b.set(property,this[property])}}return"#"}});Effect.Parallel=Class.create(Effect.Base,{initialize:function(b){this.effects=b||[];this.start(arguments[1])},update:function(b){this.effects.invoke("render",b)},finish:function(b){this.effects.each(function(d){d.render(1);d.cancel();d.event("beforeFinish");if(d.finish){d.finish(b)}d.event("afterFinish")})}});Effect.Tween=Class.create(Effect.Base,{initialize:function(e,h,g){e=Object.isString(e)?$(e):e;var d=$A(arguments),f=d.last(),b=d.length==5?d[3]:null;this.method=Object.isFunction(f)?f.bind(e):Object.isFunction(e[f])?e[f].bind(e):function(l){e[f]=l};this.start(Object.extend({from:h,to:g},b||{}))},update:function(b){this.method(b)}});Effect.Event=Class.create(Effect.Base,{initialize:function(){this.start(Object.extend({duration:0},arguments[0]||{}))},update:Prototype.emptyFunction});Effect.Opacity=Class.create(Effect.Base,{initialize:function(d){this.element=$(d);if(!this.element){throw (Effect._elementDoesNotExistError)}if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}var b=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});this.start(b)},update:function(b){this.element.setOpacity(b)}});Effect.Move=Class.create(Effect.Base,{initialize:function(d){this.element=$(d);if(!this.element){throw (Effect._elementDoesNotExistError)}var b=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});this.start(b)},setup:function(){this.element.makePositioned();this.originalLeft=parseFloat(this.element.getStyle("left")||"0");this.originalTop=parseFloat(this.element.getStyle("top")||"0");if(this.options.mode=="absolute"){this.options.x=this.options.x-this.originalLeft;this.options.y=this.options.y-this.originalTop}},update:function(b){this.element.setStyle({left:(this.options.x*b+this.originalLeft).round()+"px",top:(this.options.y*b+this.originalTop).round()+"px"})}});Effect.MoveBy=function(d,b,e){return new Effect.Move(d,Object.extend({x:e,y:b},arguments[3]||{}))};Effect.Scale=Class.create(Effect.Base,{initialize:function(d,e){this.element=$(d);if(!this.element){throw (Effect._elementDoesNotExistError)}var b=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:e},arguments[2]||{});this.start(b)},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=this.element.getStyle("position");this.originalStyle={};["top","left","width","height","fontSize"].each(function(d){this.originalStyle[d]=this.element.style[d]}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var b=this.element.getStyle("font-size")||"100%";["em","px","%","pt"].each(function(d){if(b.indexOf(d)>0){this.fontSize=parseFloat(b);this.fontSizeType=d}}.bind(this));this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;this.dims=null;if(this.options.scaleMode=="box"){this.dims=[this.element.offsetHeight,this.element.offsetWidth]}if(/^content/.test(this.options.scaleMode)){this.dims=[this.element.scrollHeight,this.element.scrollWidth]}if(!this.dims){this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]}},update:function(b){var d=(this.options.scaleFrom/100)+(this.factor*b);if(this.options.scaleContent&&this.fontSize){this.element.setStyle({fontSize:this.fontSize*d+this.fontSizeType})}this.setDimensions(this.dims[0]*d,this.dims[1]*d)},finish:function(b){if(this.restoreAfterFinish){this.element.setStyle(this.originalStyle)}},setDimensions:function(b,g){var h={};if(this.options.scaleX){h.width=g.round()+"px"}if(this.options.scaleY){h.height=b.round()+"px"}if(this.options.scaleFromCenter){var f=(b-this.dims[0])/2;var e=(g-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY){h.top=this.originalTop-f+"px"}if(this.options.scaleX){h.left=this.originalLeft-e+"px"}}else{if(this.options.scaleY){h.top=-f+"px"}if(this.options.scaleX){h.left=-e+"px"}}}this.element.setStyle(h)}});Effect.Highlight=Class.create(Effect.Base,{initialize:function(d){this.element=$(d);if(!this.element){throw (Effect._elementDoesNotExistError)}var b=Object.extend({startcolor:"#ffff99"},arguments[1]||{});this.start(b)},setup:function(){if(this.element.getStyle("display")=="none"){this.cancel();return}this.oldStyle={};if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle("background-image");this.element.setStyle({backgroundImage:"none"})}if(!this.options.endcolor){this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff")}if(!this.options.restorecolor){this.options.restorecolor=this.element.getStyle("background-color")}this._base=$R(0,2).map(function(b){return parseInt(this.options.startcolor.slice(b*2+1,b*2+3),16)}.bind(this));this._delta=$R(0,2).map(function(b){return parseInt(this.options.endcolor.slice(b*2+1,b*2+3),16)-this._base[b]}.bind(this))},update:function(b){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(d,e,f){return d+((this._base[f]+(this._delta[f]*b)).round().toColorPart())}.bind(this))})},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))}});Effect.ScrollTo=function(e){var d=arguments[1]||{},b=document.viewport.getScrollOffsets(),f=$(e).cumulativeOffset();if(d.offset){f[1]+=d.offset}return new Effect.Tween(null,b.top,f[1],d,function(g){scrollTo(b.left,g.round())})};Effect.Fade=function(e){e=$(e);var b=e.getInlineOpacity();var d=Object.extend({from:e.getOpacity()||1,to:0,afterFinishInternal:function(f){if(f.options.to!=0){return}f.element.hide().setStyle({opacity:b})}},arguments[1]||{});return new Effect.Opacity(e,d)};Effect.Appear=function(d){d=$(d);var b=Object.extend({from:(d.getStyle("display")=="none"?0:d.getOpacity()||0),to:1,afterFinishInternal:function(e){e.element.forceRerendering()},beforeSetup:function(e){e.element.setOpacity(e.options.from).show()}},arguments[1]||{});return new Effect.Opacity(d,b)};Effect.Puff=function(d){d=$(d);var b={opacity:d.getInlineOpacity(),position:d.getStyle("position"),top:d.style.top,left:d.style.left,width:d.style.width,height:d.style.height};return new Effect.Parallel([new Effect.Scale(d,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(d,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(e){Position.absolutize(e.effects[0].element)},afterFinishInternal:function(e){e.effects[0].element.hide().setStyle(b)}},arguments[1]||{}))};Effect.BlindUp=function(b){b=$(b);b.makeClipping();return new Effect.Scale(b,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(d){d.element.hide().undoClipping()}},arguments[1]||{}))};Effect.BlindDown=function(d){d=$(d);var b=d.getDimensions();return new Effect.Scale(d,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:true,afterSetup:function(e){e.element.makeClipping().setStyle({height:"0px"}).show()},afterFinishInternal:function(e){e.element.undoClipping()}},arguments[1]||{}))};Effect.SwitchOff=function(d){d=$(d);var b=d.getInlineOpacity();return new Effect.Appear(d,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(e){new Effect.Scale(e.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(f){f.element.makePositioned().makeClipping()},afterFinishInternal:function(f){f.element.hide().undoClipping().undoPositioned().setStyle({opacity:b})}})}},arguments[1]||{}))};Effect.DropOut=function(d){d=$(d);var b={top:d.getStyle("top"),left:d.getStyle("left"),opacity:d.getInlineOpacity()};return new Effect.Parallel([new Effect.Move(d,{x:0,y:100,sync:true}),new Effect.Opacity(d,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(e){e.effects[0].element.makePositioned()},afterFinishInternal:function(e){e.effects[0].element.hide().undoPositioned().setStyle(b)}},arguments[1]||{}))};Effect.Shake=function(f){f=$(f);var d=Object.extend({distance:20,duration:0.5},arguments[1]||{});var g=parseFloat(d.distance);var e=parseFloat(d.duration)/10;var b={top:f.getStyle("top"),left:f.getStyle("left")};return new Effect.Move(f,{x:g,y:0,duration:e,afterFinishInternal:function(h){new Effect.Move(h.element,{x:-g*2,y:0,duration:e*2,afterFinishInternal:function(l){new Effect.Move(l.element,{x:g*2,y:0,duration:e*2,afterFinishInternal:function(n){new Effect.Move(n.element,{x:-g*2,y:0,duration:e*2,afterFinishInternal:function(o){new Effect.Move(o.element,{x:g*2,y:0,duration:e*2,afterFinishInternal:function(p){new Effect.Move(p.element,{x:-g,y:0,duration:e,afterFinishInternal:function(q){q.element.undoPositioned().setStyle(b)}})}})}})}})}})}})};Effect.SlideDown=function(e){e=$(e).cleanWhitespace();var b=e.down().getStyle("bottom");var d=e.getDimensions();return new Effect.Scale(e,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:d.height,originalWidth:d.width},restoreAfterFinish:true,afterSetup:function(f){f.element.makePositioned();f.element.down().makePositioned();if(window.opera){f.element.setStyle({top:""})}f.element.makeClipping().setStyle({height:"0px"}).show()},afterUpdateInternal:function(f){f.element.down().setStyle({bottom:(f.dims[0]-f.element.clientHeight)+"px"})},afterFinishInternal:function(f){f.element.undoClipping().undoPositioned();f.element.down().undoPositioned().setStyle({bottom:b})}},arguments[1]||{}))};Effect.SlideUp=function(e){e=$(e).cleanWhitespace();var b=e.down().getStyle("bottom");var d=e.getDimensions();return new Effect.Scale(e,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:d.height,originalWidth:d.width},restoreAfterFinish:true,afterSetup:function(f){f.element.makePositioned();f.element.down().makePositioned();if(window.opera){f.element.setStyle({top:""})}f.element.makeClipping().show()},afterUpdateInternal:function(f){f.element.down().setStyle({bottom:(f.dims[0]-f.element.clientHeight)+"px"})},afterFinishInternal:function(f){f.element.hide().undoClipping().undoPositioned();f.element.down().undoPositioned().setStyle({bottom:b})}},arguments[1]||{}))};Effect.Squish=function(b){return new Effect.Scale(b,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(d){d.element.makeClipping()},afterFinishInternal:function(d){d.element.hide().undoClipping()}})};Effect.Grow=function(e){e=$(e);var d=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});var b={top:e.style.top,left:e.style.left,height:e.style.height,width:e.style.width,opacity:e.getInlineOpacity()};var l=e.getDimensions();var n,h;var g,f;switch(d.direction){case"top-left":n=h=g=f=0;break;case"top-right":n=l.width;h=f=0;g=-l.width;break;case"bottom-left":n=g=0;h=l.height;f=-l.height;break;case"bottom-right":n=l.width;h=l.height;g=-l.width;f=-l.height;break;case"center":n=l.width/2;h=l.height/2;g=-l.width/2;f=-l.height/2;break}return new Effect.Move(e,{x:n,y:h,duration:0.01,beforeSetup:function(o){o.element.hide().makeClipping().makePositioned()},afterFinishInternal:function(o){new Effect.Parallel([new Effect.Opacity(o.element,{sync:true,to:1,from:0,transition:d.opacityTransition}),new Effect.Move(o.element,{x:g,y:f,sync:true,transition:d.moveTransition}),new Effect.Scale(o.element,100,{scaleMode:{originalHeight:l.height,originalWidth:l.width},sync:true,scaleFrom:window.opera?1:0,transition:d.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(p){p.effects[0].element.setStyle({height:"0px"}).show()},afterFinishInternal:function(p){p.effects[0].element.undoClipping().undoPositioned().setStyle(b)}},d))}})};Effect.Shrink=function(e){e=$(e);var d=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});var b={top:e.style.top,left:e.style.left,height:e.style.height,width:e.style.width,opacity:e.getInlineOpacity()};var h=e.getDimensions();var g,f;switch(d.direction){case"top-left":g=f=0;break;case"top-right":g=h.width;f=0;break;case"bottom-left":g=0;f=h.height;break;case"bottom-right":g=h.width;f=h.height;break;case"center":g=h.width/2;f=h.height/2;break}return new Effect.Parallel([new Effect.Opacity(e,{sync:true,to:0,from:1,transition:d.opacityTransition}),new Effect.Scale(e,window.opera?1:0,{sync:true,transition:d.scaleTransition,restoreAfterFinish:true}),new Effect.Move(e,{x:g,y:f,sync:true,transition:d.moveTransition})],Object.extend({beforeStartInternal:function(l){l.effects[0].element.makePositioned().makeClipping()},afterFinishInternal:function(l){l.effects[0].element.hide().undoClipping().undoPositioned().setStyle(b)}},d))};Effect.Pulsate=function(e){e=$(e);var d=arguments[1]||{},b=e.getInlineOpacity(),g=d.transition||Effect.Transitions.linear,f=function(h){return 1-g((-Math.cos((h*(d.pulses||5)*2)*Math.PI)/2)+0.5)};return new Effect.Opacity(e,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(h){h.element.setStyle({opacity:b})}},d),{transition:f}))};Effect.Fold=function(d){d=$(d);var b={top:d.style.top,left:d.style.left,width:d.style.width,height:d.style.height};d.makeClipping();return new Effect.Scale(d,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(e){new Effect.Scale(d,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(f){f.element.hide().undoClipping().setStyle(b)}})}},arguments[1]||{}))};Effect.Morph=Class.create(Effect.Base,{initialize:function(e){this.element=$(e);if(!this.element){throw (Effect._elementDoesNotExistError)}var b=Object.extend({style:{}},arguments[1]||{});if(!Object.isString(b.style)){this.style=$H(b.style)}else{if(b.style.include(":")){this.style=b.style.parseStyle()}else{this.element.addClassName(b.style);this.style=$H(this.element.getStyles());this.element.removeClassName(b.style);var d=this.element.getStyles();this.style=this.style.reject(function(f){return f.value==d[f.key]});b.afterFinishInternal=function(f){f.element.addClassName(f.options.style);f.transforms.each(function(g){f.element.style[g.style]=""})}}}this.start(b)},setup:function(){function b(d){if(!d||["rgba(0, 0, 0, 0)","transparent"].include(d)){d="#ffffff"}d=d.parseColor();return $R(0,2).map(function(e){return parseInt(d.slice(e*2+1,e*2+3),16)})}this.transforms=this.style.map(function(l){var h=l[0],g=l[1],f=null;if(g.parseColor("#zzzzzz")!="#zzzzzz"){g=g.parseColor();f="color"}else{if(h=="opacity"){g=parseFloat(g);if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}}else{if(Element.CSS_LENGTH.test(g)){var e=g.match(/^([\+\-]?[0-9\.]+)(.*)$/);g=parseFloat(e[1]);f=(e.length==3)?e[2]:null}}}var d=this.element.getStyle(h);return{style:h.camelize(),originalValue:f=="color"?b(d):parseFloat(d||0),targetValue:f=="color"?b(g):g,unit:f}}.bind(this)).reject(function(d){return((d.originalValue==d.targetValue)||(d.unit!="color"&&(isNaN(d.originalValue)||isNaN(d.targetValue))))})},update:function(b){var f={},d,e=this.transforms.length;while(e--){f[(d=this.transforms[e]).style]=d.unit=="color"?"#"+(Math.round(d.originalValue[0]+(d.targetValue[0]-d.originalValue[0])*b)).toColorPart()+(Math.round(d.originalValue[1]+(d.targetValue[1]-d.originalValue[1])*b)).toColorPart()+(Math.round(d.originalValue[2]+(d.targetValue[2]-d.originalValue[2])*b)).toColorPart():(d.originalValue+(d.targetValue-d.originalValue)*b).toFixed(3)+(d.unit===null?"":d.unit)}this.element.setStyle(f,true)}});Effect.Transform=Class.create({initialize:function(b){this.tracks=[];this.options=arguments[1]||{};this.addTracks(b)},addTracks:function(b){b.each(function(d){d=$H(d);var e=d.values().first();this.tracks.push($H({ids:d.keys().first(),effect:Effect.Morph,options:{style:e}}))}.bind(this));return this},play:function(){return new Effect.Parallel(this.tracks.map(function(b){var f=b.get("ids"),e=b.get("effect"),d=b.get("options");var g=[$(f)||$$(f)].flatten();return g.map(function(h){return new e(h,Object.extend({sync:true},d))})}).flatten(),this.options)}});Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderSpacing borderTopColor borderTopStyle borderTopWidth bottom clip color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop markerOffset maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex");Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;String.__parseStyleElement=document.createElement("div");String.prototype.parseStyle=function(){var d,b=$H();if(Prototype.Browser.WebKit){d=new Element("div",{style:this}).style}else{String.__parseStyleElement.innerHTML='
';d=String.__parseStyleElement.childNodes[0].style}Element.CSS_PROPERTIES.each(function(e){if(d[e]){b.set(e,d[e])}});if(Prototype.Browser.IE&&this.include("opacity")){b.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1])}return b};if(document.defaultView&&document.defaultView.getComputedStyle){Element.getStyles=function(d){var b=document.defaultView.getComputedStyle($(d),null);return Element.CSS_PROPERTIES.inject({},function(e,f){e[f]=b[f];return e})}}else{Element.getStyles=function(d){d=$(d);var b=d.currentStyle,e;e=Element.CSS_PROPERTIES.inject({},function(f,g){f[g]=b[g];return f});if(!e.opacity){e.opacity=d.getOpacity()}return e}}Effect.Methods={morph:function(b,d){b=$(b);new Effect.Morph(b,Object.extend({style:d},arguments[2]||{}));return b},visualEffect:function(e,g,d){e=$(e);var f=g.dasherize().camelize(),b=f.charAt(0).toUpperCase()+f.substring(1);new Effect[b](e,d);return e},highlight:function(d,b){d=$(d);new Effect.Highlight(d,b);return d}};$w("fade appear grow shrink fold blindUp blindDown slideUp slideDown pulsate shake puff squish switchOff dropOut").each(function(b){Effect.Methods[b]=function(e,d){e=$(e);Effect[b.charAt(0).toUpperCase()+b.substring(1)](e,d);return e}});$w("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(b){Effect.Methods[b]=Element[b]});Element.addMethods(Effect.Methods);function validateCreditCard(e){var d="0123456789";var b="";for(i=0;i9?Math.floor(a/10+a%10):a}for(i=0;i=d},maxLength:function(b,e,d){return b.length<=d},min:function(b,e,d){return b>=parseFloat(d)},max:function(b,e,d){return b<=parseFloat(d)},notOneOf:function(b,e,d){return $A(d).all(function(f){return b!=f})},oneOf:function(b,e,d){return $A(d).any(function(f){return b==f})},is:function(b,e,d){return b==d},isNot:function(b,e,d){return b!=d},equalToField:function(b,e,d){return b==$F(d)},notEqualToField:function(b,e,d){return b!=$F(d)},include:function(b,e,d){return $A(d).all(function(f){return Validation.get(f).test(b,e)})}};var Validation=Class.create();Validation.defaultOptions={onSubmit:true,stopOnFirst:false,immediate:false,focusOnError:true,useTitles:false,addClassNameToContainer:false,containerClassName:".input-box",onFormValidate:function(b,d){},onElementValidate:function(b,d){}};Validation.prototype={initialize:function(d,b){this.form=$(d);if(!this.form){return}this.options=Object.extend({onSubmit:Validation.defaultOptions.onSubmit,stopOnFirst:Validation.defaultOptions.stopOnFirst,immediate:Validation.defaultOptions.immediate,focusOnError:Validation.defaultOptions.focusOnError,useTitles:Validation.defaultOptions.useTitles,onFormValidate:Validation.defaultOptions.onFormValidate,onElementValidate:Validation.defaultOptions.onElementValidate},b||{});if(this.options.onSubmit){Event.observe(this.form,"submit",this.onSubmit.bind(this),false)}if(this.options.immediate){Form.getElements(this.form).each(function(e){if(e.tagName.toLowerCase()=="select"){Event.observe(e,"blur",this.onChange.bindAsEventListener(this))}if(e.type.toLowerCase()=="radio"||e.type.toLowerCase()=="checkbox"){Event.observe(e,"click",this.onChange.bindAsEventListener(this))}else{Event.observe(e,"change",this.onChange.bindAsEventListener(this))}},this)}},onChange:function(b){Validation.isOnChange=true;Validation.validate(Event.element(b),{useTitle:this.options.useTitles,onElementValidate:this.options.onElementValidate});Validation.isOnChange=false},onSubmit:function(b){if(!this.validate()){Event.stop(b)}},validate:function(){var b=false;var d=this.options.useTitles;var g=this.options.onElementValidate;try{if(this.options.stopOnFirst){b=Form.getElements(this.form).all(function(e){if(e.hasClassName("local-validation")&&!this.isElementInForm(e,this.form)){return true}return Validation.validate(e,{useTitle:d,onElementValidate:g})},this)}else{b=Form.getElements(this.form).collect(function(e){if(e.hasClassName("local-validation")&&!this.isElementInForm(e,this.form)){return true}if(e.hasClassName("validation-disabled")){return true}return Validation.validate(e,{useTitle:d,onElementValidate:g})},this).all()}}catch(f){}if(!b&&this.options.focusOnError){try{Form.getElements(this.form).findAll(function(e){return $(e).hasClassName("validation-failed")}).first().focus()}catch(f){}}this.options.onFormValidate(b,this.form);return b},reset:function(){Form.getElements(this.form).each(Validation.reset)},isElementInForm:function(e,d){var b=e.up("form");if(b==d){return true}return false}};Object.extend(Validation,{validate:function(e,b){b=Object.extend({useTitle:false,onElementValidate:function(f,g){}},b||{});e=$(e);var d=$w(e.className);return result=d.all(function(f){var g=Validation.test(f,e,b.useTitle);b.onElementValidate(g,e);return g})},insertAdvice:function(f,d){var b=$(f).up(".field-row");if(b){Element.insert(b,{after:d})}else{if(f.up("td.value")){f.up("td.value").insert({bottom:d})}else{if(f.advaiceContainer&&$(f.advaiceContainer)){$(f.advaiceContainer).update(d)}else{switch(f.type.toLowerCase()){case"checkbox":case"radio":var e=f.parentNode;if(e){Element.insert(e,{bottom:d})}else{Element.insert(f,{after:d})}break;default:Element.insert(f,{after:d})}}}}},showAdvice:function(e,d,b){if(!e.advices){e.advices=new Hash()}else{e.advices.each(function(f){if(!d||f.value.id!=d.id){this.hideAdvice(e,f.value)}}.bind(this))}e.advices.set(b,d);if(typeof Effect=="undefined"){d.style.display="block"}else{if(!d._adviceAbsolutize){new Effect.Appear(d,{duration:1})}else{Position.absolutize(d);d.show();d.setStyle({top:d._adviceTop,left:d._adviceLeft,width:d._adviceWidth,"z-index":1000});d.addClassName("advice-absolute")}}},hideAdvice:function(d,b){if(b!=null){new Effect.Fade(b,{duration:1,afterFinishInternal:function(){b.hide()}})}},updateCallback:function(elm,status){if(typeof elm.callbackFunction!="undefined"){eval(elm.callbackFunction+"('"+elm.id+"','"+status+"')")}},ajaxError:function(g,f){var e="validate-ajax";var d=Validation.getAdvice(e,g);if(d==null){d=this.createAdvice(e,g,false,f)}this.showAdvice(g,d,"validate-ajax");this.updateCallback(g,"failed");g.addClassName("validation-failed");g.addClassName("validate-ajax");if(Validation.defaultOptions.addClassNameToContainer&&Validation.defaultOptions.containerClassName!=""){var b=g.up(Validation.defaultOptions.containerClassName);if(b&&this.allowContainerClassName(g)){b.removeClassName("validation-passed");b.addClassName("validation-error")}}},allowContainerClassName:function(b){if(b.type=="radio"||b.type=="checkbox"){return b.hasClassName("change-container-classname")}return true},test:function(g,o,l){var d=Validation.get(g);var n="__advice"+g.camelize();try{if(Validation.isVisible(o)&&!d.test($F(o),o)){var f=Validation.getAdvice(g,o);if(f==null){f=this.createAdvice(g,o,l)}this.showAdvice(o,f,g);this.updateCallback(o,"failed");o[n]=1;if(!o.advaiceContainer){o.removeClassName("validation-passed");o.addClassName("validation-failed")}if(Validation.defaultOptions.addClassNameToContainer&&Validation.defaultOptions.containerClassName!=""){var b=o.up(Validation.defaultOptions.containerClassName);if(b&&this.allowContainerClassName(o)){b.removeClassName("validation-passed");b.addClassName("validation-error")}}return false}else{var f=Validation.getAdvice(g,o);this.hideAdvice(o,f);this.updateCallback(o,"passed");o[n]="";o.removeClassName("validation-failed");o.addClassName("validation-passed");if(Validation.defaultOptions.addClassNameToContainer&&Validation.defaultOptions.containerClassName!=""){var b=o.up(Validation.defaultOptions.containerClassName);if(b&&!b.down(".validation-failed")&&this.allowContainerClassName(o)){if(!Validation.get("IsEmpty").test(o.value)||!this.isVisible(o)){b.addClassName("validation-passed")}else{b.removeClassName("validation-passed")}b.removeClassName("validation-error")}}return true}}catch(h){throw (h)}},isVisible:function(b){while(b.tagName!="BODY"){if(!$(b).visible()){return false}b=b.parentNode}return true},getAdvice:function(b,d){return $("advice-"+b+"-"+Validation.getElmID(d))||$("advice-"+Validation.getElmID(d))},createAdvice:function(e,n,l,d){var b=Validation.get(e);var h=l?((n&&n.title)?n.title:b.error):b.error;if(d){h=d}if(jQuery.mage.__){h=jQuery.mage.__(h)}advice='";Validation.insertAdvice(n,advice);advice=Validation.getAdvice(e,n);if($(n).hasClassName("absolute-advice")){var g=$(n).getDimensions();var f=Position.cumulativeOffset(n);advice._adviceTop=(f[1]+g.height)+"px";advice._adviceLeft=(f[0])+"px";advice._adviceWidth=(g.width)+"px";advice._adviceAbsolutize=true}return advice},getElmID:function(b){return b.id?b.id:b.name},reset:function(d){d=$(d);var b=$w(d.className);b.each(function(g){var h="__advice"+g.camelize();if(d[h]){var f=Validation.getAdvice(g,d);if(f){f.hide()}d[h]=""}d.removeClassName("validation-failed");d.removeClassName("validation-passed");if(Validation.defaultOptions.addClassNameToContainer&&Validation.defaultOptions.containerClassName!=""){var e=d.up(Validation.defaultOptions.containerClassName);if(e){e.removeClassName("validation-passed");e.removeClassName("validation-error")}}})},add:function(f,e,g,d){var b={};b[f]=new Validator(f,e,g,d);Object.extend(Validation.methods,b)},addAllThese:function(b){var d={};$A(b).each(function(e){d[e[0]]=new Validator(e[0],e[1],e[2],(e.length>3?e[3]:{}))});Object.extend(Validation.methods,d)},get:function(b){return Validation.methods[b]?Validation.methods[b]:Validation.methods._LikeNoIDIEverSaw_},methods:{_LikeNoIDIEverSaw_:new Validator("_LikeNoIDIEverSaw_","",{})}});Validation.add("IsEmpty","",function(b){return(b==""||(b==null)||(b.length==0)||/^\s+$/.test(b))});Validation.addAllThese([["validate-no-html-tags","HTML tags are not allowed",function(b){return !/<(\/)?\w+/.test(b)}],["validate-select","Please select an option.",function(b){return((b!="none")&&(b!=null)&&(b.length!=0))}],["required-entry","This is a required field.",function(b){return !Validation.get("IsEmpty").test(b)}],["validate-number","Please enter a valid number in this field.",function(b){return Validation.get("IsEmpty").test(b)||(!isNaN(parseNumber(b))&&/^\s*-?\d*(\.\d*)?\s*$/.test(b))}],["validate-number-range","The value is not within the specified range.",function(e,g){if(Validation.get("IsEmpty").test(e)){return true}var f=parseNumber(e);if(isNaN(f)){return false}var d=/^number-range-(-?[\d.,]+)?-(-?[\d.,]+)?$/,b=true;$w(g.className).each(function(l){var h=d.exec(l);if(h){b=b&&(h[1]==null||h[1]==""||f>=parseNumber(h[1]))&&(h[2]==null||h[2]==""||f<=parseNumber(h[2]))}});return b}],["validate-digits","Please use numbers only in this field. Please avoid spaces or other characters such as dots or commas.",function(b){return Validation.get("IsEmpty").test(b)||!/[^\d]/.test(b)}],["validate-digits-range","The value is not within the specified range.",function(e,g){if(Validation.get("IsEmpty").test(e)){return true}var f=parseNumber(e);if(isNaN(f)){return false}var d=/^digits-range-(-?\d+)?-(-?\d+)?$/,b=true;$w(g.className).each(function(l){var h=d.exec(l);if(h){b=b&&(h[1]==null||h[1]==""||f>=parseNumber(h[1]))&&(h[2]==null||h[2]==""||f<=parseNumber(h[2]))}});return b}],["validate-range","The value is not within the specified range.",function(f,l){var g,h;if(Validation.get("IsEmpty").test(f)){return true}else{if(Validation.get("validate-digits").test(f)){g=h=parseNumber(f)}else{var e=/^(-?\d+)?-(-?\d+)?$/.exec(f);if(e){g=parseNumber(e[1]);h=parseNumber(e[2]);if(g>h){return false}}else{return false}}}var d=/^range-(-?\d+)?-(-?\d+)?$/,b=true;$w(l.className).each(function(n){var q=d.exec(n);if(q){var p=parseNumber(q[1]);var o=parseNumber(q[2]);b=b&&(isNaN(p)||g>=p)&&(isNaN(o)||h<=o)}});return b}],["validate-alpha","Please use letters only (a-z or A-Z) in this field.",function(b){return Validation.get("IsEmpty").test(b)||/^[a-zA-Z]+$/.test(b)}],["validate-code","Please use only lowercase letters (a-z), numbers (0-9) or underscore (_) in this field, and the first character should be a letter.",function(b){return Validation.get("IsEmpty").test(b)||/^[a-z]+[a-z0-9_]+$/.test(b)}],["validate-alphanum","Please use only letters (a-z or A-Z) or numbers (0-9) in this field. No spaces or other characters are allowed.",function(b){return Validation.get("IsEmpty").test(b)||/^[a-zA-Z0-9]+$/.test(b)}],["validate-alphanum-with-spaces","Please use only letters (a-z or A-Z), numbers (0-9) or spaces only in this field.",function(b){return Validation.get("IsEmpty").test(b)||/^[a-zA-Z0-9 ]+$/.test(b)}],["validate-street",'Please use only letters (a-z or A-Z), numbers (0-9), spaces and "#" in this field.',function(b){return Validation.get("IsEmpty").test(b)||/^[ \w]{3,}([A-Za-z]\.)?([ \w]*\#\d+)?(\r\n| )[ \w]{3,}/.test(b)}],["validate-phoneStrict","Please enter a valid phone number (Ex: 123-456-7890).",function(b){return Validation.get("IsEmpty").test(b)||/^(\()?\d{3}(\))?(-|\s)?\d{3}(-|\s)\d{4}$/.test(b)}],["validate-phoneLax","Please enter a valid phone number (Ex: 123-456-7890).",function(b){return Validation.get("IsEmpty").test(b)||/^((\d[-. ]?)?((\(\d{3}\))|\d{3}))?[-. ]?\d{3}[-. ]?\d{4}$/.test(b)}],["validate-fax","Please enter a valid fax number (Ex: 123-456-7890).",function(b){return Validation.get("IsEmpty").test(b)||/^(\()?\d{3}(\))?(-|\s)?\d{3}(-|\s)\d{4}$/.test(b)}],["validate-date","Please enter a valid date.",function(b){var d=new Date(b);return Validation.get("IsEmpty").test(b)||!isNaN(d)}],["validate-date-range","Make sure the To Date is later than or the same as the From Date.",function(e,h){var d=/\bdate-range-(\w+)-(\w+)\b/.exec(h.className);if(!d||d[2]=="to"||Validation.get("IsEmpty").test(e)){return true}var f=new Date().getFullYear()+"";var b=function(l){l=l.split(/[.\/]/);if(l[2]&&l[2].length<4){l[2]=f.substr(0,l[2].length)+l[2]}return new Date(l.join("/")).getTime()};var g=Element.select(h.form,".validate-date-range.date-range-"+d[1]+"-to");return !g.length||Validation.get("IsEmpty").test(g[0].value)||b(e)<=b(g[0].value)}],["validate-email","Please enter a valid email address (Ex: johndoe@domain.com).",function(b){return Validation.get("IsEmpty").test(b)||/^([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*@([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*\.(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]){2,})$/i.test(b)}],["validate-emailSender","Please use only visible characters and spaces.",function(b){return Validation.get("IsEmpty").test(b)||/^[\S ]+$/.test(b)}],["validate-password","Please enter 6 or more characters. Leading and trailing spaces will be ignored.",function(b){var d=b.strip();return !(d.length>0&&d.length<6)}],["validate-admin-password","Please enter 7 or more characters, using both numeric and alphabetic.",function(b){var d=b.strip();if(0==d.length){return true}if(!(/[a-z]/i.test(b))||!(/[0-9]/.test(b))){return false}return !(d.length<7)}],["validate-cpassword","Please make sure your passwords match.",function(b){var d=$("confirmation")?$("confirmation"):$$(".validate-cpassword")[0];var g=false;if($("password")){g=$("password")}var h=$$(".validate-password");for(var e=0;e=0}],["validate-zero-or-greater","Please enter a number 0 or greater in this field.",function(b){return Validation.get("validate-not-negative-number").test(b)}],["validate-greater-than-zero","Please enter a number greater than 0 in this field.",function(b){if(Validation.get("IsEmpty").test(b)){return true}b=parseNumber(b);return !isNaN(b)&&b>0}],["validate-state","Please select State/Province.",function(b){return(b!=0||b=="")}],["validate-new-password","Please enter 6 or more characters. Leading and trailing spaces will be ignored.",function(b){if(!Validation.get("validate-password").test(b)){return false}if(Validation.get("IsEmpty").test(b)&&b!=""){return false}return true}],["validate-cc-number","Please enter a valid credit card number.",function(b,e){var d=$(e.id.substr(0,e.id.indexOf("_cc_number"))+"_cc_type");if(d&&typeof Validation.creditCartTypes.get(d.value)!="undefined"&&Validation.creditCartTypes.get(d.value)[2]==false){if(!Validation.get("IsEmpty").test(b)&&Validation.get("validate-digits").test(b)){return true}else{return false}}return validateCreditCard(b)}],["validate-cc-type","Credit card number does not match credit card type.",function(d,g){g.value=removeDelimiters(g.value);d=removeDelimiters(d);var f=$(g.id.substr(0,g.id.indexOf("_cc_number"))+"_cc_type");if(!f){return true}var e=f.value;if(typeof Validation.creditCartTypes.get(e)=="undefined"){return false}if(Validation.creditCartTypes.get(e)[0]==false){return true}var b="";Validation.creditCartTypes.each(function(h){if(h.value[0]&&d.match(h.value[0])){b=h.key;throw $break}});if(b!=e){return false}if(f.hasClassName("validation-failed")&&Validation.isOnChange){Validation.validate(f)}return true}],["validate-cc-type-select","Card type does not match credit card number.",function(d,e){var b=$(e.id.substr(0,e.id.indexOf("_cc_type"))+"_cc_number");if(Validation.isOnChange&&Validation.get("IsEmpty").test(b.value)){return true}if(Validation.get("validate-cc-type").test(b.value,b)){Validation.validate(b)}return Validation.get("validate-cc-type").test(b.value,b)}],["validate-cc-exp","Incorrect credit card expiration date.",function(b,l){var h=b;var g=$(l.id.substr(0,l.id.indexOf("_expiration"))+"_expiration_yr").value;var f=new Date();var e=f.getMonth()+1;var d=f.getFullYear();if(h=n)}});return b}],["validate-percents","Please enter a number lower than 100.",{max:100}],["required-file","Please select a file.",function(d,e){var b=!Validation.get("IsEmpty").test(d);if(b===false){ovId=e.id+"_value";if($(ovId)){b=!Validation.get("IsEmpty").test($(ovId).value)}}return b}],["validate-cc-ukss","Please enter issue number or start date for switch/solo card type.",function(o,g){var b;if(g.id.match(/(.)+_cc_issue$/)){b=g.id.indexOf("_cc_issue")}else{if(g.id.match(/(.)+_start_month$/)){b=g.id.indexOf("_start_month")}else{b=g.id.indexOf("_start_year")}}var f=g.id.substr(0,b);var d=$(f+"_cc_type");if(!d){return true}var n=d.value;if(["SS","SM","SO"].indexOf(n)==-1){return true}$(f+"_cc_issue").advaiceContainer=$(f+"_start_month").advaiceContainer=$(f+"_start_year").advaiceContainer=$(f+"_cc_type_ss_div").down(".adv-container");var h=$(f+"_cc_issue").value;var l=$(f+"_start_month").value;var p=$(f+"_start_year").value;var e=(l&&p)?true:false;if(!e&&!h){return false}return true}]]);function removeDelimiters(b){b=b.replace(/\s/g,"");b=b.replace(/\-/g,"");return b}function parseNumber(b){if(typeof b!="string"){return parseFloat(b)}var e=b.indexOf(".");var d=b.indexOf(",");if(e!=-1&&d!=-1){if(d>e){b=b.replace(".","").replace(",",".")}else{b=b.replace(",","")}}else{if(d!=-1){b=b.replace(",",".")}}return parseFloat(b)}Validation.creditCartTypes=$H({SO:[new RegExp("^(6334[5-9]([0-9]{11}|[0-9]{13,14}))|(6767([0-9]{12}|[0-9]{14,15}))$"),new RegExp("^([0-9]{3}|[0-9]{4})?$"),true],SM:[new RegExp("(^(5[0678])[0-9]{11,18}$)|(^(6[^05])[0-9]{11,18}$)|(^(601)[^1][0-9]{9,16}$)|(^(6011)[0-9]{9,11}$)|(^(6011)[0-9]{13,16}$)|(^(65)[0-9]{11,13}$)|(^(65)[0-9]{15,18}$)|(^(49030)[2-9]([0-9]{10}$|[0-9]{12,13}$))|(^(49033)[5-9]([0-9]{10}$|[0-9]{12,13}$))|(^(49110)[1-2]([0-9]{10}$|[0-9]{12,13}$))|(^(49117)[4-9]([0-9]{10}$|[0-9]{12,13}$))|(^(49118)[0-2]([0-9]{10}$|[0-9]{12,13}$))|(^(4936)([0-9]{12}$|[0-9]{14,15}$))"),new RegExp("^([0-9]{3}|[0-9]{4})?$"),true],VI:[new RegExp("^4[0-9]{12}([0-9]{3})?$"),new RegExp("^[0-9]{3}$"),true],MC:[new RegExp("^5[1-5][0-9]{14}$"),new RegExp("^[0-9]{3}$"),true],AE:[new RegExp("^3[47][0-9]{13}$"),new RegExp("^[0-9]{4}$"),true],DI:[new RegExp("^6(011|4[4-9][0-9]|5[0-9]{2})[0-9]{12}$"),new RegExp("^[0-9]{3}$"),true],JCB:[new RegExp("^(3[0-9]{15}|(2131|1800)[0-9]{11})$"),new RegExp("^[0-9]{3,4}$"),true],OT:[false,new RegExp("^([0-9]{3}|[0-9]{4})?$"),false]});function popWin(d,e,b){var e=window.open(d,e,b);e.focus()}function setLocation(b){window.location.href=b}function setPLocation(d,b){if(b){window.opener.focus()}window.opener.location.href=d}function setLanguageCode(e,f){var b=window.location.href;var h="",g;if(g=b.match(/\#(.*)$/)){b=b.replace(/\#(.*)$/,"");h=g[0]}if(b.match(/[?]/)){var d=/([?&]store=)[a-z0-9_]*/;if(b.match(d)){b=b.replace(d,"$1"+e)}else{b+="&store="+e}var d=/([?&]from_store=)[a-z0-9_]*/;if(b.match(d)){b=b.replace(d,"")}}else{b+="?store="+e}if(typeof f!="undefined"){b+="&from_store="+f}b+=h;setLocation(b)}function decorateGeneric(h,e){var l=["odd","even","first","last"];var d={};var g=h.length;if(g){if(typeof e=="undefined"){e=l}if(!e.length){return}for(var b in l){d[l[b]]=false}for(var b in e){d[e[b]]=true}if(d.first){Element.addClassName(h[0],"first")}if(d.last){Element.addClassName(h[g-1],"last")}for(var f=0;f-1){b="?"+f.substring(d+2);f=f.substring(0,d+1)}return f+e+b}function formatCurrency(n,q,g){var l=isNaN(q.precision=Math.abs(q.precision))?2:q.precision;var v=isNaN(q.requiredPrecision=Math.abs(q.requiredPrecision))?2:q.requiredPrecision;l=v;var t=isNaN(q.integerRequired=Math.abs(q.integerRequired))?1:q.integerRequired;var p=q.decimalSymbol==undefined?",":q.decimalSymbol;var e=q.groupSymbol==undefined?".":q.groupSymbol;var d=q.groupLength==undefined?3:q.groupLength;var u="";if(g==undefined||g==true){u=n<0?"-":g?"+":""}else{if(g==false){u=""}}var h=parseInt(n=Math.abs(+n||0).toFixed(l))+"";var f=h.lengthd?j%d:0;re=new RegExp("(\\d{"+d+"})(?=\\d)","g");var b=(j?h.substr(0,j)+e:"")+h.substr(j).replace(re,"$1"+e)+(l?p+Math.abs(n-h).toFixed(l).replace(/-/,0).slice(2):"");var o="";if(q.pattern.indexOf("{sign}")==-1){o=u+q.pattern}else{o=q.pattern.replace("{sign}",u)}return o.replace("%s",b).replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function expandDetails(d,b){if(Element.hasClassName(d,"show-details")){$$(b).each(function(e){e.hide()});Element.removeClassName(d,"show-details")}else{$$(b).each(function(e){e.show()});Element.addClassName(d,"show-details")}}var isIE=navigator.appVersion.match(/MSIE/)=="MSIE";if(!window.Varien){var Varien=new Object()}Varien.showLoading=function(){var b=$("loading-process");b&&b.show()};Varien.hideLoading=function(){var b=$("loading-process");b&&b.hide()};Varien.GlobalHandlers={onCreate:function(){Varien.showLoading()},onComplete:function(){if(Ajax.activeRequestCount==0){Varien.hideLoading()}}};Ajax.Responders.register(Varien.GlobalHandlers);Varien.searchForm=Class.create();Varien.searchForm.prototype={initialize:function(d,e,b){this.form=$(d);this.field=$(e);this.emptyText=b;Event.observe(this.form,"submit",this.submit.bind(this));Event.observe(this.field,"focus",this.focus.bind(this));Event.observe(this.field,"blur",this.blur.bind(this));this.blur()},submit:function(b){if(this.field.value==this.emptyText||this.field.value==""){Event.stop(b);return false}return true},focus:function(b){if(this.field.value==this.emptyText){this.field.value=""}},blur:function(b){if(this.field.value==""){this.field.value=this.emptyText}}};Varien.DateElement=Class.create();Varien.DateElement.prototype={initialize:function(b,d,f,e){if(b=="id"){this.day=$(d+"day");this.month=$(d+"month");this.year=$(d+"year");this.full=$(d+"full");this.advice=$(d+"date-advice")}else{if(b=="container"){this.day=d.day;this.month=d.month;this.year=d.year;this.full=d.full;this.advice=d.advice}else{return}}this.required=f;this.format=e;this.day.addClassName("validate-custom");this.day.validate=this.validate.bind(this);this.month.addClassName("validate-custom");this.month.validate=this.validate.bind(this);this.year.addClassName("validate-custom");this.year.validate=this.validate.bind(this);this.setDateRange(false,false);this.year.setAttribute("autocomplete","off");this.advice.hide()},validate:function(){var l=false,o=parseInt(this.day.value,10)||0,f=parseInt(this.month.value,10)||0,h=parseInt(this.year.value,10)||0;if(this.day.value.strip().empty()&&this.month.value.strip().empty()&&this.year.value.strip().empty()){if(this.required){l="Please enter a date."}else{this.full.value=""}}else{if(!o||!f||!h){l="Please enter a valid full date."}else{var d=new Date,n=0,e=null;d.setYear(h);d.setMonth(f-1);d.setDate(32);n=32-d.getDate();if(!n||n>31){n=31}if(o<1||o>n){e="day";l="Please enter a valid day (1-%1)."}else{if(f<1||f>12){e="month";l="Please enter a valid month (1-12)."}else{if(o%10==o){this.day.value="0"+o}if(f%10==f){this.month.value="0"+f}this.full.value=this.format.replace(/%[mb]/i,this.month.value).replace(/%[de]/i,this.day.value).replace(/%y/i,this.year.value);var b=this.month.value+"/"+this.day.value+"/"+this.year.value;var g=new Date(b);if(isNaN(g)){l="Please enter a valid date."}else{this.setFullDate(g)}}}var p=false;if(!l&&!this.validateData()){e=this.validateDataErrorType;p=this.validateDataErrorText;l=p}}}if(l!==false){if(jQuery.mage.__){l=jQuery.mage.__(l)}if(!p){this.advice.innerHTML=l.replace("%1",n)}else{this.advice.innerHTML=this.errorTextModifier(l)}this.advice.show();return false}this.day.removeClassName("validation-failed");this.month.removeClassName("validation-failed");this.year.removeClassName("validation-failed");this.advice.hide();return true},validateData:function(){var d=this.fullDate.getFullYear();var b=new Date;this.curyear=b.getFullYear();return d>=1900&&d<=this.curyear},validateDataErrorType:"year",validateDataErrorText:"Please enter a valid year (1900-%1).",errorTextModifier:function(b){return b.replace("%1",this.curyear)},setDateRange:function(b,d){this.minDate=b;this.maxDate=d},setFullDate:function(b){this.fullDate=b}};Varien.DOB=Class.create();Varien.DOB.prototype={initialize:function(b,g,f){var e=$$(b)[0];var d={};d.day=Element.select(e,".dob-day input")[0];d.month=Element.select(e,".dob-month input")[0];d.year=Element.select(e,".dob-year input")[0];d.full=Element.select(e,".dob-full input")[0];d.advice=Element.select(e,".validation-advice")[0];new Varien.DateElement("container",d,g,f)}};Varien.dateRangeDate=Class.create();Varien.dateRangeDate.prototype=Object.extend(new Varien.DateElement(),{validateData:function(){var b=true;if(this.minDate||this.maxValue){if(this.minDate){this.minDate=new Date(this.minDate);this.minDate.setHours(0);if(isNaN(this.minDate)){this.minDate=new Date("1/1/1900")}b=b&&this.fullDate>=this.minDate}if(this.maxDate){this.maxDate=new Date(this.maxDate);this.minDate.setHours(0);if(isNaN(this.maxDate)){this.maxDate=new Date()}b=b&&this.fullDate<=this.maxDate}if(this.maxDate&&this.minDate){this.validateDataErrorText="Please enter a valid date between %s and %s"}else{if(this.maxDate){this.validateDataErrorText="Please enter a valid date less than or equal to %s"}else{if(this.minDate){this.validateDataErrorText="Please enter a valid date equal to or greater than %s"}else{this.validateDataErrorText=""}}}}return b},validateDataErrorText:"Date should be between %s and %s",errorTextModifier:function(b){if(this.minDate){b=b.sub("%s",this.dateFormat(this.minDate))}if(this.maxDate){b=b.sub("%s",this.dateFormat(this.maxDate))}return b},dateFormat:function(b){return b.getMonth()+1+"/"+b.getDate()+"/"+b.getFullYear()}});Varien.FileElement=Class.create();Varien.FileElement.prototype={initialize:function(b){this.fileElement=$(b);this.hiddenElement=$(b+"_value");this.fileElement.observe("change",this.selectFile.bind(this))},selectFile:function(b){this.hiddenElement.value=this.fileElement.getValue()}};Validation.addAllThese([["validate-custom"," ",function(b,d){return d.validate()}]]);Element.addMethods({getInnerText:function(b){b=$(b);if(b.innerText&&!Prototype.Browser.Opera){return b.innerText}return b.innerHTML.stripScripts().unescapeHTML().replace(/[\n\r\s]+/g," ").strip()}});function fireEvent(d,e){var b=document.createEvent("HTMLEvents");b.initEvent(e,true,true);return d.dispatchEvent(b)}function modulo(b,f){var e=f/10000;var d=b%f;if(Math.abs(d-f)b.toFixed(2).toString().length){b=b.toFixed(2)}return b+" "+d[e]};var SessionError=Class.create();SessionError.prototype={initialize:function(b){this.errorText=b},toString:function(){return"Session Error:"+this.errorText}};Ajax.Request.addMethods({initialize:function($super,d,b){$super(b);this.transport=Ajax.getTransport();if(!d.match(new RegExp("[?&]isAjax=true",""))){d=d.match(new RegExp("\\?","g"))?d+"&isAjax=true":d+"?isAjax=true"}if(Object.isString(this.options.parameters)&&this.options.parameters.indexOf("form_key=")==-1){this.options.parameters+="&"+Object.toQueryString({form_key:FORM_KEY})}else{if(!this.options.parameters){this.options.parameters={form_key:FORM_KEY}}if(!this.options.parameters.form_key){this.options.parameters.form_key=FORM_KEY}}this.request(d)},respondToReadyState:function(b){var g=Ajax.Request.Events[b],d=new Ajax.Response(this);if(g=="Complete"){try{this._complete=true;if(d.responseText.isJSON()){var f=d.responseText.evalJSON();if(f.ajaxExpired&&f.ajaxRedirect){window.location.replace(f.ajaxRedirect);throw new SessionError("session expired")}}(this.options["on"+d.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(d,d.headerJSON)}catch(h){this.dispatchException(h);if(h instanceof SessionError){return}}var l=d.getHeader("Content-type");if(this.options.evalJS=="force"||this.options.evalJS&&this.isSameOrigin()&&l&&l.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i)){this.evalResponse()}}try{(this.options["on"+g]||Prototype.emptyFunction)(d,d.headerJSON);Ajax.Responders.dispatch("on"+g,this,d,d.headerJSON)}catch(h){this.dispatchException(h)}if(g=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction}}});Ajax.Updater.respondToReadyState=Ajax.Request.respondToReadyState;var varienLoader=new Class.create();varienLoader.prototype={initialize:function(b){this.callback=false;this.cache=$H();this.caching=b||false;this.url=false},getCache:function(b){if(this.cache.get(b)){return this.cache.get(b)}return false},load:function(b,d,f){this.url=b;this.callback=f;if(this.caching){var e=this.getCache(b);if(e){this.processResult(e);return}}if(typeof d.updaterId!="undefined"){new varienUpdater(d.updaterId,b,{evalScripts:true,onComplete:this.processResult.bind(this),onFailure:this._processFailure.bind(this)})}else{new Ajax.Request(b,{method:"post",parameters:d||{},onComplete:this.processResult.bind(this),onFailure:this._processFailure.bind(this)})}},_processFailure:function(b){location.href=BASE_URL},processResult:function(b){if(this.caching){this.cache.set(this.url,b)}if(this.callback){this.callback(b.responseText)}}};if(!window.varienLoaderHandler){var varienLoaderHandler=new Object()}varienLoaderHandler.handler={onCreate:function(b){if(b.options.loaderArea===false){return}jQuery("body").trigger("processStart")},onException:function(b){jQuery("body").trigger("processStop")},onComplete:function(b){jQuery("body").trigger("processStop")}};function setLoaderPosition(){var e=$("loading_mask_loader");if(e&&Prototype.Browser.IE){var d=e.getDimensions();var f=document.viewport.getDimensions();var b=document.viewport.getScrollOffsets();e.style.left=Math.floor(f.width/2+b.left-d.width/2)+"px";e.style.top=Math.floor(f.height/2+b.top-d.height/2)+"px";e.style.position="absolute"}}function toggleSelectsUnderBlock(f,b){if(Prototype.Browser.IE){var e=document.getElementsByTagName("select");for(var d=0;d');d.document.close();Event.observe(d,"load",function(){var e=d.document.getElementById("image_preview");d.resizeTo(e.width+40,e.height+80)})}}function checkByProductPriceType(b){if(b.id=="price_type"){this.productPriceType=b.value;return false}if(b.id=="price"&&this.productPriceType==0){return false}return true}function toggleSeveralValueElements(f,e,b,d){if(e&&f){if(Object.prototype.toString.call(e)!="[object Array]"){e=[e]}e.each(function(g){toggleValueElements(f,g,b,d)})}}function toggleValueElements(l,d,f,h){if(d&&l){var n=[l];if(typeof f!="undefined"){if(Object.prototype.toString.call(f)!="[object Array]"){f=[f]}for(var g=0;g>2;l=(p&3)<<4|n>>4;g=(n&15)<<2|h>>6;f=h&63;if(isNaN(n)){g=f=64}else{if(isNaN(h)){f=64}}b=b+this._keyStr.charAt(o)+this._keyStr.charAt(l)+this._keyStr.charAt(g)+this._keyStr.charAt(f)}return b},decode:function(e){var b="";var p,n,h;var o,l,g,f;var d=0;if(typeof window.atob==="function"){return Base64._utf8_decode(window.atob(e))}e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(d>4;n=(l&15)<<4|g>>2;h=(g&3)<<6|f;b+=String.fromCharCode(p);if(g!=64){b+=String.fromCharCode(n)}if(f!=64){b+=String.fromCharCode(h)}}return Base64._utf8_decode(b)},mageEncode:function(b){return this.encode(b).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,",")},mageDecode:function(b){b=b.replace(/\-/g,"+").replace(/_/g,"/").replace(/,/g,"=");return this.decode(b)},idEncode:function(b){return this.encode(b).replace(/\+/g,":").replace(/\//g,"_").replace(/=/g,"-")},idDecode:function(b){b=b.replace(/\-/g,"=").replace(/_/g,"/").replace(/\:/g,"+");return this.decode(b)},_utf8_encode:function(d){d=d.replace(/\r\n/g,"\n");var b="";for(var f=0;f127&&e<2048){b+=String.fromCharCode(e>>6|192);b+=String.fromCharCode(e&63|128)}else{b+=String.fromCharCode(e>>12|224);b+=String.fromCharCode(e>>6&63|128);b+=String.fromCharCode(e&63|128)}}}return b},_utf8_decode:function(b){var d="";var e=0;var f=c1=c2=0;while(e191&&f<224){c2=b.charCodeAt(e+1);d+=String.fromCharCode((f&31)<<6|c2&63);e+=2}else{c2=b.charCodeAt(e+1);c3=b.charCodeAt(e+2);d+=String.fromCharCode((f&15)<<12|(c2&63)<<6|c3&63);e+=3}}}return d}};function sortNumeric(d,b){return d-b}(function(){var globals=["Prototype","Abstract","Try","Class","PeriodicalExecuter","Template","$break","Enumerable","$A","$w","$H","Hash","$R","ObjectRange","Ajax","$","Form","Field","$F","Toggle","Insertion","$continue","Position","Windows","Dialog","array","WindowUtilities","Builder","Effect","validateCreditCard","Validator","Validation","removeDelimiters","parseNumber","popWin","setLocation","setPLocation","setLanguageCode","decorateGeneric","decorateTable","decorateList","decorateDataList","parseSidUrl","formatCurrency","expandDetails","isIE","Varien","fireEvent","modulo","byteConvert","SessionError","varienLoader","varienLoaderHandler","setLoaderPosition","toggleSelectsUnderBlock","varienUpdater","setElementDisable","toggleParentVis","toggleFieldsetVis","toggleVis","imagePreview","checkByProductPriceType","toggleSeveralValueElements","toggleValueElements","submitAndReloadArea","syncOnchangeValue","updateElementAtCursor","firebugEnabled","disableElement","enableElement","disableElements","enableElements","Cookie","Fieldset","Base64","sortNumeric","Element","$$","Sizzle","Selector","Window"];globals.forEach(function(prop){window[prop]=eval(prop)})})(); \ No newline at end of file +(function(aB){var J,aE,z,S,V,ah,aD,aI,T,ai,ak,N,A,au,ao,aC,p,Q,aw="sizzle"+-(new Date()),U=aB.document,aF=0,ap=0,g=L(),av=L(),R=L(),P=function(aJ,e){if(aJ===e){ai=true}return 0},aA=typeof undefined,ab=1<<31,Z=({}).hasOwnProperty,ay=[],az=ay.pop,X=ay.push,d=ay.push,y=ay.slice,o=ay.indexOf||function(aK){var aJ=0,e=this.length;for(;aJ+~]|"+B+")"+B+"*"),F=new RegExp("="+B+"*([^\\]'\"]*?)"+B+"*\\]","g"),ad=new RegExp(v),af=new RegExp("^"+W+"$"),an={ID:new RegExp("^#("+b+")"),CLASS:new RegExp("^\\.("+b+")"),TAG:new RegExp("^("+b.replace("w","w*")+")"),ATTR:new RegExp("^"+ar),PSEUDO:new RegExp("^"+v),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+B+"*(even|odd|(([+-]|)(\\d*)n|)"+B+"*(?:([+-]|)"+B+"*(\\d+)|))"+B+"*\\)|)","i"),bool:new RegExp("^(?:"+f+")$","i"),needsContext:new RegExp("^"+B+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+B+"*((?:-\\d)?\\d*)"+B+"*\\)|)(?=[^-]|$)","i")},n=/^(?:input|select|textarea|button)$/i,w=/^h\d$/i,aa=/^[^{]+\{\s*\[native \w/,ac=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,am=/[+~]/,Y=/'|\\/g,E=new RegExp("\\\\([\\da-f]{1,6}"+B+"?|("+B+")|.)","ig"),aq=function(e,aL,aJ){var aK="0x"+aL-65536;return aK!==aK||aJ?aL:aK<0?String.fromCharCode(aK+65536):String.fromCharCode(aK>>10|55296,aK&1023|56320)};try{d.apply((ay=y.call(U.childNodes)),U.childNodes);ay[U.childNodes.length].nodeType}catch(O){d={apply:ay.length?function(aJ,e){X.apply(aJ,y.call(e))}:function(aL,aK){var e=aL.length,aJ=0;while((aL[e++]=aK[aJ++])){}aL.length=e-1}}}function H(aQ,aJ,aU,aW){var aV,aN,aO,aS,aT,aM,aL,e,aK,aR;if((aJ?aJ.ownerDocument||aJ:U)!==N){ak(aJ)}aJ=aJ||N;aU=aU||[];if(!aQ||typeof aQ!=="string"){return aU}if((aS=aJ.nodeType)!==1&&aS!==9){return[]}if(au&&!aW){if((aV=ac.exec(aQ))){if((aO=aV[1])){if(aS===9){aN=aJ.getElementById(aO);if(aN&&aN.parentNode){if(aN.id===aO){aU.push(aN);return aU}}else{return aU}}else{if(aJ.ownerDocument&&(aN=aJ.ownerDocument.getElementById(aO))&&Q(aJ,aN)&&aN.id===aO){aU.push(aN);return aU}}}else{if(aV[2]){d.apply(aU,aJ.getElementsByTagName(aQ));return aU}else{if((aO=aV[3])&&aE.getElementsByClassName&&aJ.getElementsByClassName){d.apply(aU,aJ.getElementsByClassName(aO));return aU}}}}if(aE.qsa&&(!ao||!ao.test(aQ))){e=aL=aw;aK=aJ;aR=aS===9&&aQ;if(aS===1&&aJ.nodeName.toLowerCase()!=="object"){aM=s(aQ);if((aL=aJ.getAttribute("id"))){e=aL.replace(Y,"\\$&")}else{aJ.setAttribute("id",e)}e="[id='"+e+"'] ";aT=aM.length;while(aT--){aM[aT]=e+t(aM[aT])}aK=am.test(aQ)&&ae(aJ.parentNode)||aJ;aR=aM.join(",")}if(aR){try{d.apply(aU,aK.querySelectorAll(aR));return aU}catch(aP){}finally{if(!aL){aJ.removeAttribute("id")}}}}}return aD(aQ.replace(D,"$1"),aJ,aU,aW)}function L(){var aJ=[];function e(aK,aL){if(aJ.push(aK+" ")>z.cacheLength){delete e[aJ.shift()]}return(e[aK+" "]=aL)}return e}function u(e){e[aw]=true;return e}function q(aJ){var aL=N.createElement("div");try{return !!aJ(aL)}catch(aK){return false}finally{if(aL.parentNode){aL.parentNode.removeChild(aL)}aL=null}}function aG(aJ,aL){var e=aJ.split("|"),aK=aJ.length;while(aK--){z.attrHandle[e[aK]]=aL}}function h(aJ,e){var aL=e&&aJ,aK=aL&&aJ.nodeType===1&&e.nodeType===1&&(~e.sourceIndex||ab)-(~aJ.sourceIndex||ab);if(aK){return aK}if(aL){while((aL=aL.nextSibling)){if(aL===e){return -1}}}return aJ?1:-1}function I(e){return function(aK){var aJ=aK.nodeName.toLowerCase();return aJ==="input"&&aK.type===e}}function l(e){return function(aK){var aJ=aK.nodeName.toLowerCase();return(aJ==="input"||aJ==="button")&&aK.type===e}}function at(e){return u(function(aJ){aJ=+aJ;return u(function(aK,aO){var aM,aL=e([],aK.length,aJ),aN=aL.length;while(aN--){if(aK[(aM=aL[aN])]){aK[aM]=!(aO[aM]=aK[aM])}}})})}function ae(e){return e&&typeof e.getElementsByTagName!==aA&&e}aE=H.support={};V=H.isXML=function(e){var aJ=e&&(e.ownerDocument||e).documentElement;return aJ?aJ.nodeName!=="HTML":false};ak=H.setDocument=function(aK){var e,aL=aK?aK.ownerDocument||aK:U,aJ=aL.defaultView;if(aL===N||aL.nodeType!==9||!aL.documentElement){return N}N=aL;A=aL.documentElement;au=!V(aL);if(aJ&&aJ!==aJ.top){if(aJ.addEventListener){aJ.addEventListener("unload",function(){ak()},false)}else{if(aJ.attachEvent){aJ.attachEvent("onunload",function(){ak()})}}}aE.attributes=q(function(aM){aM.className="i";return !aM.getAttribute("className")});aE.getElementsByTagName=q(function(aM){aM.appendChild(aL.createComment(""));return !aM.getElementsByTagName("*").length});aE.getElementsByClassName=aa.test(aL.getElementsByClassName)&&q(function(aM){aM.innerHTML="
";aM.firstChild.className="i";return aM.getElementsByClassName("i").length===2});aE.getById=q(function(aM){A.appendChild(aM).id=aw;return !aL.getElementsByName||!aL.getElementsByName(aw).length});if(aE.getById){z.find.ID=function(aO,aN){if(typeof aN.getElementById!==aA&&au){var aM=aN.getElementById(aO);return aM&&aM.parentNode?[aM]:[]}};z.filter.ID=function(aN){var aM=aN.replace(E,aq);return function(aO){return aO.getAttribute("id")===aM}}}else{delete z.find.ID;z.filter.ID=function(aN){var aM=aN.replace(E,aq);return function(aP){var aO=typeof aP.getAttributeNode!==aA&&aP.getAttributeNode("id");return aO&&aO.value===aM}}}z.find.TAG=aE.getElementsByTagName?function(aM,aN){if(typeof aN.getElementsByTagName!==aA){return aN.getElementsByTagName(aM)}}:function(aM,aQ){var aR,aP=[],aO=0,aN=aQ.getElementsByTagName(aM);if(aM==="*"){while((aR=aN[aO++])){if(aR.nodeType===1){aP.push(aR)}}return aP}return aN};z.find.CLASS=aE.getElementsByClassName&&function(aN,aM){if(typeof aM.getElementsByClassName!==aA&&au){return aM.getElementsByClassName(aN)}};aC=[];ao=[];if((aE.qsa=aa.test(aL.querySelectorAll))){q(function(aM){aM.innerHTML="";if(aM.querySelectorAll("[t^='']").length){ao.push("[*^$]="+B+"*(?:''|\"\")")}if(!aM.querySelectorAll("[selected]").length){ao.push("\\["+B+"*(?:value|"+f+")")}if(!aM.querySelectorAll(":checked").length){ao.push(":checked")}});q(function(aN){var aM=aL.createElement("input");aM.setAttribute("type","hidden");aN.appendChild(aM).setAttribute("name","D");if(aN.querySelectorAll("[name=d]").length){ao.push("name"+B+"*[*^$|!~]?=")}if(!aN.querySelectorAll(":enabled").length){ao.push(":enabled",":disabled")}aN.querySelectorAll("*,:x");ao.push(",.*:")})}if((aE.matchesSelector=aa.test((p=A.webkitMatchesSelector||A.mozMatchesSelector||A.oMatchesSelector||A.msMatchesSelector)))){q(function(aM){aE.disconnectedMatch=p.call(aM,"div");p.call(aM,"[s!='']:x");aC.push("!=",v)})}ao=ao.length&&new RegExp(ao.join("|"));aC=aC.length&&new RegExp(aC.join("|"));e=aa.test(A.compareDocumentPosition);Q=e||aa.test(A.contains)?function(aN,aM){var aP=aN.nodeType===9?aN.documentElement:aN,aO=aM&&aM.parentNode;return aN===aO||!!(aO&&aO.nodeType===1&&(aP.contains?aP.contains(aO):aN.compareDocumentPosition&&aN.compareDocumentPosition(aO)&16))}:function(aN,aM){if(aM){while((aM=aM.parentNode)){if(aM===aN){return true}}}return false};P=e?function(aN,aM){if(aN===aM){ai=true;return 0}var aO=!aN.compareDocumentPosition-!aM.compareDocumentPosition;if(aO){return aO}aO=(aN.ownerDocument||aN)===(aM.ownerDocument||aM)?aN.compareDocumentPosition(aM):1;if(aO&1||(!aE.sortDetached&&aM.compareDocumentPosition(aN)===aO)){if(aN===aL||aN.ownerDocument===U&&Q(U,aN)){return -1}if(aM===aL||aM.ownerDocument===U&&Q(U,aM)){return 1}return T?(o.call(T,aN)-o.call(T,aM)):0}return aO&4?-1:1}:function(aN,aM){if(aN===aM){ai=true;return 0}var aT,aQ=0,aS=aN.parentNode,aP=aM.parentNode,aO=[aN],aR=[aM];if(!aS||!aP){return aN===aL?-1:aM===aL?1:aS?-1:aP?1:T?(o.call(T,aN)-o.call(T,aM)):0}else{if(aS===aP){return h(aN,aM)}}aT=aN;while((aT=aT.parentNode)){aO.unshift(aT)}aT=aM;while((aT=aT.parentNode)){aR.unshift(aT)}while(aO[aQ]===aR[aQ]){aQ++}return aQ?h(aO[aQ],aR[aQ]):aO[aQ]===U?-1:aR[aQ]===U?1:0};return aL};H.matches=function(aJ,e){return H(aJ,null,null,e)};H.matchesSelector=function(aK,aM){if((aK.ownerDocument||aK)!==N){ak(aK)}aM=aM.replace(F,"='$1']");if(aE.matchesSelector&&au&&(!aC||!aC.test(aM))&&(!ao||!ao.test(aM))){try{var aJ=p.call(aK,aM);if(aJ||aE.disconnectedMatch||aK.document&&aK.document.nodeType!==11){return aJ}}catch(aL){}}return H(aM,N,null,[aK]).length>0};H.contains=function(e,aJ){if((e.ownerDocument||e)!==N){ak(e)}return Q(e,aJ)};H.attr=function(aK,e){if((aK.ownerDocument||aK)!==N){ak(aK)}var aJ=z.attrHandle[e.toLowerCase()],aL=aJ&&Z.call(z.attrHandle,e.toLowerCase())?aJ(aK,e,!au):undefined;return aL!==undefined?aL:aE.attributes||!au?aK.getAttribute(e):(aL=aK.getAttributeNode(e))&&aL.specified?aL.value:null};H.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)};H.uniqueSort=function(aK){var aL,aM=[],e=0,aJ=0;ai=!aE.detectDuplicates;T=!aE.sortStable&&aK.slice(0);aK.sort(P);if(ai){while((aL=aK[aJ++])){if(aL===aK[aJ]){e=aM.push(aJ)}}while(e--){aK.splice(aM[e],1)}}T=null;return aK};S=H.getText=function(aM){var aL,aJ="",aK=0,e=aM.nodeType;if(!e){while((aL=aM[aK++])){aJ+=S(aL)}}else{if(e===1||e===9||e===11){if(typeof aM.textContent==="string"){return aM.textContent}else{for(aM=aM.firstChild;aM;aM=aM.nextSibling){aJ+=S(aM)}}}else{if(e===3||e===4){return aM.nodeValue}}}return aJ};z=H.selectors={cacheLength:50,createPseudo:u,match:an,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:true}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:true},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){e[1]=e[1].replace(E,aq);e[3]=(e[4]||e[5]||"").replace(E,aq);if(e[2]==="~="){e[3]=" "+e[3]+" "}return e.slice(0,4)},CHILD:function(e){e[1]=e[1].toLowerCase();if(e[1].slice(0,3)==="nth"){if(!e[3]){H.error(e[0])}e[4]=+(e[4]?e[5]+(e[6]||1):2*(e[3]==="even"||e[3]==="odd"));e[5]=+((e[7]+e[8])||e[3]==="odd")}else{if(e[3]){H.error(e[0])}}return e},PSEUDO:function(aJ){var e,aK=!aJ[5]&&aJ[2];if(an.CHILD.test(aJ[0])){return null}if(aJ[3]&&aJ[4]!==undefined){aJ[2]=aJ[4]}else{if(aK&&ad.test(aK)&&(e=s(aK,true))&&(e=aK.indexOf(")",aK.length-e)-aK.length)){aJ[0]=aJ[0].slice(0,e);aJ[2]=aK.slice(0,e)}}return aJ.slice(0,3)}},filter:{TAG:function(aJ){var e=aJ.replace(E,aq).toLowerCase();return aJ==="*"?function(){return true}:function(aK){return aK.nodeName&&aK.nodeName.toLowerCase()===e}},CLASS:function(e){var aJ=g[e+" "];return aJ||(aJ=new RegExp("(^|"+B+")"+e+"("+B+"|$)"))&&g(e,function(aK){return aJ.test(typeof aK.className==="string"&&aK.className||typeof aK.getAttribute!==aA&&aK.getAttribute("class")||"")})},ATTR:function(aK,aJ,e){return function(aM){var aL=H.attr(aM,aK);if(aL==null){return aJ==="!="}if(!aJ){return true}aL+="";return aJ==="="?aL===e:aJ==="!="?aL!==e:aJ==="^="?e&&aL.indexOf(e)===0:aJ==="*="?e&&aL.indexOf(e)>-1:aJ==="$="?e&&aL.slice(-e.length)===e:aJ==="~="?(" "+aL+" ").indexOf(e)>-1:aJ==="|="?aL===e||aL.slice(0,e.length+1)===e+"-":false}},CHILD:function(aJ,aM,aL,aN,aK){var aP=aJ.slice(0,3)!=="nth",e=aJ.slice(-4)!=="last",aO=aM==="of-type";return aN===1&&aK===0?function(aQ){return !!aQ.parentNode}:function(aW,aU,aZ){var aQ,a2,aX,a1,aY,aT,aV=aP!==e?"nextSibling":"previousSibling",a0=aW.parentNode,aS=aO&&aW.nodeName.toLowerCase(),aR=!aZ&&!aO;if(a0){if(aP){while(aV){aX=aW;while((aX=aX[aV])){if(aO?aX.nodeName.toLowerCase()===aS:aX.nodeType===1){return false}}aT=aV=aJ==="only"&&!aT&&"nextSibling"}return true}aT=[e?a0.firstChild:a0.lastChild];if(e&&aR){a2=a0[aw]||(a0[aw]={});aQ=a2[aJ]||[];aY=aQ[0]===aF&&aQ[1];a1=aQ[0]===aF&&aQ[2];aX=aY&&a0.childNodes[aY];while((aX=++aY&&aX&&aX[aV]||(a1=aY=0)||aT.pop())){if(aX.nodeType===1&&++a1&&aX===aW){a2[aJ]=[aF,aY,a1];break}}}else{if(aR&&(aQ=(aW[aw]||(aW[aw]={}))[aJ])&&aQ[0]===aF){a1=aQ[1]}else{while((aX=++aY&&aX&&aX[aV]||(a1=aY=0)||aT.pop())){if((aO?aX.nodeName.toLowerCase()===aS:aX.nodeType===1)&&++a1){if(aR){(aX[aw]||(aX[aw]={}))[aJ]=[aF,a1]}if(aX===aW){break}}}}}a1-=aK;return a1===aN||(a1%aN===0&&a1/aN>=0)}}},PSEUDO:function(aL,aK){var e,aJ=z.pseudos[aL]||z.setFilters[aL.toLowerCase()]||H.error("unsupported pseudo: "+aL);if(aJ[aw]){return aJ(aK)}if(aJ.length>1){e=[aL,aL,"",aK];return z.setFilters.hasOwnProperty(aL.toLowerCase())?u(function(aO,aQ){var aN,aM=aJ(aO,aK),aP=aM.length;while(aP--){aN=o.call(aO,aM[aP]);aO[aN]=!(aQ[aN]=aM[aP])}}):function(aM){return aJ(aM,0,e)}}return aJ}},pseudos:{not:u(function(e){var aJ=[],aK=[],aL=ah(e.replace(D,"$1"));return aL[aw]?u(function(aN,aS,aQ,aO){var aR,aM=aL(aN,null,aO,[]),aP=aN.length;while(aP--){if((aR=aM[aP])){aN[aP]=!(aS[aP]=aR)}}}):function(aO,aN,aM){aJ[0]=aO;aL(aJ,null,aM,aK);return !aK.pop()}}),has:u(function(e){return function(aJ){return H(e,aJ).length>0}}),contains:u(function(e){return function(aJ){return(aJ.textContent||aJ.innerText||S(aJ)).indexOf(e)>-1}}),lang:u(function(e){if(!af.test(e||"")){H.error("unsupported lang: "+e)}e=e.replace(E,aq).toLowerCase();return function(aK){var aJ;do{if((aJ=au?aK.lang:aK.getAttribute("xml:lang")||aK.getAttribute("lang"))){aJ=aJ.toLowerCase();return aJ===e||aJ.indexOf(e+"-")===0}}while((aK=aK.parentNode)&&aK.nodeType===1);return false}}),target:function(e){var aJ=aB.location&&aB.location.hash;return aJ&&aJ.slice(1)===e.id},root:function(e){return e===A},focus:function(e){return e===N.activeElement&&(!N.hasFocus||N.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===false},disabled:function(e){return e.disabled===true},checked:function(e){var aJ=e.nodeName.toLowerCase();return(aJ==="input"&&!!e.checked)||(aJ==="option"&&!!e.selected)},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling){if(e.nodeType<6){return false}}return true},parent:function(e){return !z.pseudos.empty(e)},header:function(e){return w.test(e.nodeName)},input:function(e){return n.test(e.nodeName)},button:function(aJ){var e=aJ.nodeName.toLowerCase();return e==="input"&&aJ.type==="button"||e==="button"},text:function(aJ){var e;return aJ.nodeName.toLowerCase()==="input"&&aJ.type==="text"&&((e=aJ.getAttribute("type"))==null||e.toLowerCase()==="text")},first:at(function(){return[0]}),last:at(function(e,aJ){return[aJ-1]}),eq:at(function(e,aK,aJ){return[aJ<0?aJ+aK:aJ]}),even:at(function(e,aK){var aJ=0;for(;aJ=0;){e.push(aJ)}return e}),gt:at(function(e,aL,aK){var aJ=aK<0?aK+aL:aK;for(;++aJ1?function(aM,aL,aJ){var aK=e.length;while(aK--){if(!e[aK](aM,aL,aJ)){return false}}return true}:e[0]}function K(aJ,aM,aL){var aK=0,e=aM.length;for(;aK-1){aY[a0]=!(aV[a0]=aS)}}}}else{aU=al(aU===aV?aU.splice(aP,aU.length):aU);if(aN){aN(null,aV,aU,aX)}else{d.apply(aV,aU)}}})}function ax(aO){var aJ,aM,aK,aN=aO.length,aR=z.relative[aO[0].type],aS=aR||z.relative[" "],aL=aR?1:0,aP=C(function(aT){return aT===aJ},aS,true),aQ=C(function(aT){return o.call(aJ,aT)>-1},aS,true),e=[function(aV,aU,aT){return(!aR&&(aT||aU!==aI))||((aJ=aU).nodeType?aP(aV,aU,aT):aQ(aV,aU,aT))}];for(;aL1&&aH(e),aL>1&&t(aO.slice(0,aL-1).concat({value:aO[aL-2].type===" "?"*":""})).replace(D,"$1"),aM,aL0,aM=aL.length>0,aJ=function(aW,aQ,aV,aU,aZ){var aR,aS,aX,a1=0,aT="0",aN=aW&&[],a2=[],a0=aI,aP=aW||aM&&z.find.TAG("*",aZ),aO=(aF+=a0==null?1:Math.random()||0.1),aY=aP.length;if(aZ){aI=aQ!==N&&aQ}for(;aT!==aY&&(aR=aP[aT])!=null;aT++){if(aM&&aR){aS=0;while((aX=aL[aS++])){if(aX(aR,aQ,aV)){aU.push(aR);break}}if(aZ){aF=aO}}if(e){if((aR=!aX&&aR)){a1--}if(aW){aN.push(aR)}}}a1+=aT;if(e&&aT!==a1){aS=0;while((aX=aK[aS++])){aX(aN,a2,aQ,aV)}if(aW){if(a1>0){while(aT--){if(!(aN[aT]||a2[aT])){a2[aT]=az.call(aU)}}}a2=al(a2)}d.apply(aU,a2);if(aZ&&!aW&&a2.length>0&&(a1+aK.length)>1){H.uniqueSort(aU)}}if(aZ){aF=aO;aI=a0}return aN};return e?u(aJ):aJ}ah=H.compile=function(e,aK){var aL,aJ=[],aN=[],aM=R[e+" "];if(!aM){if(!aK){aK=s(e)}aL=aK.length;while(aL--){aM=ax(aK[aL]);if(aM[aw]){aJ.push(aM)}else{aN.push(aM)}}aM=R(e,aj(aN,aJ));aM.selector=e}return aM};aD=H.select=function(aK,e,aL,aO){var aM,aR,aJ,aS,aP,aQ=typeof aK==="function"&&aK,aN=!aO&&s((aK=aQ.selector||aK));aL=aL||[];if(aN.length===1){aR=aN[0]=aN[0].slice(0);if(aR.length>2&&(aJ=aR[0]).type==="ID"&&aE.getById&&e.nodeType===9&&au&&z.relative[aR[1].type]){e=(z.find.ID(aJ.matches[0].replace(E,aq),e)||[])[0];if(!e){return aL}else{if(aQ){e=e.parentNode}}aK=aK.slice(aR.shift().value.length)}aM=an.needsContext.test(aK)?0:aR.length;while(aM--){aJ=aR[aM];if(z.relative[(aS=aJ.type)]){break}if((aP=z.find[aS])){if((aO=aP(aJ.matches[0].replace(E,aq),am.test(aR[0].type)&&ae(e.parentNode)||e))){aR.splice(aM,1);aK=aO.length&&t(aR);if(!aK){d.apply(aL,aO);return aL}break}}}}(aQ||ah(aK,aN))(aO,e,!au,aL,am.test(aK)&&ae(e.parentNode)||e);return aL};aE.sortStable=aw.split("").sort(P).join("")===aw;aE.detectDuplicates=!!ai;ak();aE.sortDetached=q(function(e){return e.compareDocumentPosition(N.createElement("div"))&1});if(!q(function(e){e.innerHTML="";return e.firstChild.getAttribute("href")==="#"})){aG("type|href|height|width",function(aJ,e,aK){if(!aK){return aJ.getAttribute(e,e.toLowerCase()==="type"?1:2)}})}if(!aE.attributes||!q(function(e){e.innerHTML="";e.firstChild.setAttribute("value","");return e.firstChild.getAttribute("value")===""})){aG("value",function(aJ,e,aK){if(!aK&&aJ.nodeName.toLowerCase()==="input"){return aJ.defaultValue}})}if(!q(function(e){return e.getAttribute("disabled")==null})){aG(f,function(aJ,e,aL){var aK;if(!aL){return aJ[e]===true?e.toLowerCase():(aK=aJ.getAttributeNode(e))&&aK.specified?aK.value:null}})}if(typeof define==="function"&&define.amd){define(function(){return H})}else{if(typeof module!=="undefined"&&module.exports){module.exports=H}else{aB.Sizzle=H}}})(window);(function(){if(typeof Sizzle!=="undefined"){return}if(typeof define!=="undefined"&&define.amd){window.Sizzle=Prototype._actual_sizzle;window.define=Prototype._original_define;delete Prototype._actual_sizzle;delete Prototype._original_define}else{if(typeof module!=="undefined"&&module.exports){window.Sizzle=module.exports;module.exports={}}}})();(function(e){var f=Prototype.Selector.extendElements;function b(g,h){return f(e(g,h||document))}function d(h,g){return e.matches(g,[h]).length==1}Prototype.Selector.engine=e;Prototype.Selector.select=b;Prototype.Selector.match=d})(Sizzle);window.Sizzle=Prototype._original_property;delete Prototype._original_property;var Form={reset:function(b){b=$(b);b.reset();return b},serializeElements:function(n,f){if(typeof f!="object"){f={hash:!!f}}else{if(Object.isUndefined(f.hash)){f.hash=true}}var g,l,b=false,h=f.submit,d,e;if(f.hash){e={};d=function(o,p,q){if(p in o){if(!Object.isArray(o[p])){o[p]=[o[p]]}o[p]=o[p].concat(q)}else{o[p]=q}return o}}else{e="";d=function(o,q,p){if(!Object.isArray(p)){p=[p]}if(!p.length){return o}var r=encodeURIComponent(q).gsub(/%20/,"+");return o+(o?"&":"")+p.map(function(s){s=s.gsub(/(\r)?\n/,"\r\n");s=encodeURIComponent(s);s=s.gsub(/%20/,"+");return r+"="+s}).join("&")}}return n.inject(e,function(o,p){if(!p.disabled&&p.name){g=p.name;l=$(p).getValue();if(l!=null&&p.type!="file"&&(p.type!="submit"||(!b&&h!==false&&(!h||g==h)&&(b=true)))){o=d(o,g,l)}}return o})}};Form.Methods={serialize:function(d,b){return Form.serializeElements(Form.getElements(d),b)},getElements:function(g){var h=$(g).getElementsByTagName("*");var f,e=[],d=Form.Element.Serializers;for(var b=0;f=h[b];b++){if(d[f.tagName.toLowerCase()]){e.push(Element.extend(f))}}return e},getInputs:function(l,e,f){l=$(l);var b=l.getElementsByTagName("input");if(!e&&!f){return $A(b).map(Element.extend)}for(var g=0,n=[],h=b.length;g=0}).sortBy(function(f){return f.tabIndex}).first();return b?b:e.find(function(f){return/^(?:input|select|textarea)$/i.test(f.tagName)})},focusFirstElement:function(d){d=$(d);var b=d.findFirstElement();if(b){b.activate()}return d},request:function(d,b){d=$(d),b=Object.clone(b||{});var f=b.parameters,e=d.readAttribute("action")||"";if(e.blank()){e=window.location.href}b.parameters=d.serialize(true);if(f){if(Object.isString(f)){f=f.toQueryParams()}Object.extend(b.parameters,f)}if(d.hasAttribute("method")&&!b.method){b.method=d.method}return new Ajax.Request(e,b)}};Form.Element={focus:function(b){$(b).focus();return b},select:function(b){$(b).select();return b}};Form.Element.Methods={serialize:function(b){b=$(b);if(!b.disabled&&b.name){var d=b.getValue();if(d!=undefined){var e={};e[b.name]=d;return Object.toQueryString(e)}}return""},getValue:function(b){b=$(b);var d=b.tagName.toLowerCase();return Form.Element.Serializers[d](b)},setValue:function(b,d){b=$(b);var e=b.tagName.toLowerCase();Form.Element.Serializers[e](b,d);return b},clear:function(b){$(b).value="";return b},present:function(b){return $(b).value!=""},activate:function(b){b=$(b);try{b.focus();if(b.select&&(b.tagName.toLowerCase()!="input"||!(/^(?:button|reset|submit)$/i.test(b.type)))){b.select()}}catch(d){}return b},disable:function(b){b=$(b);b.disabled=true;return b},enable:function(b){b=$(b);b.disabled=false;return b}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers=(function(){function d(n,o){switch(n.type.toLowerCase()){case"checkbox":case"radio":return h(n,o);default:return g(n,o)}}function h(n,o){if(Object.isUndefined(o)){return n.checked?n.value:null}else{n.checked=!!o}}function g(n,o){if(Object.isUndefined(o)){return n.value}else{n.value=o}}function b(p,s){if(Object.isUndefined(s)){return(p.type==="select-one"?e:f)(p)}var o,q,t=!Object.isArray(s);for(var n=0,r=p.length;n=0?l(o.options[n]):null}function f(q){var n,r=q.length;if(!r){return null}for(var p=0,n=[];p=this.offset[1]&&e=this.offset[0]&&b=this.offset[1]&&this.ycomp=this.offset[0]&&this.xcomp0})._each(d,b)},set:function(b){this.element.className=b},add:function(b){if(this.include(b)){return}this.set($A(this).concat(b).join(" "))},remove:function(b){if(!this.include(b)){return}this.set($A(this).without(b).join(" "))},toString:function(){return $A(this).join(" ")}};Object.extend(Element.ClassNames.prototype,Enumerable);(function(){window.Selector=Class.create({initialize:function(b){this.expression=b.strip()},findElements:function(b){return Prototype.Selector.select(this.expression,b)},match:function(b){return Prototype.Selector.match(b,this.expression)},toString:function(){return this.expression},inspect:function(){return"#"}});Object.extend(Selector,{matchElements:function(h,l){var b=Prototype.Selector.match,f=[];for(var e=0,g=h.length;e0){if(typeof arguments[0]=="string"){e=arguments[0];d=1}else{e=arguments[0]?arguments[0].id:null}}if(!e){e="window_"+new Date().getTime()}if($(e)){alert("Window "+e+" is already registered in the DOM! Make sure you use setDestroyOnClose() or destroyOnClose: true in the constructor")}this.options=Object.extend({className:"dialog",blurClassName:null,minWidth:100,minHeight:20,resizable:true,closable:true,minimizable:true,maximizable:true,draggable:true,userData:null,showEffect:(Window.hasEffectLib?Effect.Appear:Element.show),hideEffect:(Window.hasEffectLib?Effect.Fade:Element.hide),showEffectOptions:{},hideEffectOptions:{},effectOptions:null,parent:document.body,title:" ",url:null,onload:Prototype.emptyFunction,width:200,height:300,opacity:1,recenterAuto:true,wiredDrag:false,closeCallback:null,destroyOnClose:false,gridX:1,gridY:1},arguments[d]||{});if(this.options.blurClassName){this.options.focusClassName=this.options.className}if(typeof this.options.top=="undefined"&&typeof this.options.bottom=="undefined"){this.options.top=this._round(Math.random()*500,this.options.gridY)}if(typeof this.options.left=="undefined"&&typeof this.options.right=="undefined"){this.options.left=this._round(Math.random()*500,this.options.gridX)}if(this.options.effectOptions){Object.extend(this.options.hideEffectOptions,this.options.effectOptions);Object.extend(this.options.showEffectOptions,this.options.effectOptions);if(this.options.showEffect==Element.Appear){this.options.showEffectOptions.to=this.options.opacity}}if(Window.hasEffectLib){if(this.options.showEffect==Effect.Appear){this.options.showEffectOptions.to=this.options.opacity}if(this.options.hideEffect==Effect.Fade){this.options.hideEffectOptions.from=this.options.opacity}}if(this.options.hideEffect==Element.hide){this.options.hideEffect=function(){Element.hide(this.element);if(this.options.destroyOnClose){this.destroy()}}.bind(this)}if(this.options.parent!=document.body){this.options.parent=$(this.options.parent)}this.element=this._createWindow(e);this.element.win=this;this.eventMouseDown=this._initDrag.bindAsEventListener(this);this.eventMouseUp=this._endDrag.bindAsEventListener(this);this.eventMouseMove=this._updateDrag.bindAsEventListener(this);this.eventOnLoad=this._getWindowBorderSize.bindAsEventListener(this);this.eventMouseDownContent=this.toFront.bindAsEventListener(this);this.eventResize=this._recenter.bindAsEventListener(this);this.topbar=$(this.element.id+"_top");this.bottombar=$(this.element.id+"_bottom");this.content=$(this.element.id+"_content");Event.observe(this.topbar,"mousedown",this.eventMouseDown);Event.observe(this.bottombar,"mousedown",this.eventMouseDown);Event.observe(this.content,"mousedown",this.eventMouseDownContent);Event.observe(window,"load",this.eventOnLoad);Event.observe(window,"resize",this.eventResize);Event.observe(window,"scroll",this.eventResize);Event.observe(this.options.parent,"scroll",this.eventResize);if(this.options.draggable){var b=this;[this.topbar,this.topbar.up().previous(),this.topbar.up().next()].each(function(f){f.observe("mousedown",b.eventMouseDown);f.addClassName("top_draggable")});[this.bottombar.up(),this.bottombar.up().previous(),this.bottombar.up().next()].each(function(f){f.observe("mousedown",b.eventMouseDown);f.addClassName("bottom_draggable")})}if(this.options.resizable){this.sizer=$(this.element.id+"_sizer");Event.observe(this.sizer,"mousedown",this.eventMouseDown)}this.useLeft=null;this.useTop=null;if(typeof this.options.left!="undefined"){this.element.setStyle({left:parseFloat(this.options.left)+"px"});this.useLeft=true}else{this.element.setStyle({right:parseFloat(this.options.right)+"px"});this.useLeft=false}if(typeof this.options.top!="undefined"){this.element.setStyle({top:parseFloat(this.options.top)+"px"});this.useTop=true}else{this.element.setStyle({bottom:parseFloat(this.options.bottom)+"px"});this.useTop=false}this.storedLocation=null;this.setOpacity(this.options.opacity);if(this.options.zIndex){this.setZIndex(this.options.zIndex)}if(this.options.destroyOnClose){this.setDestroyOnClose(true)}this._getWindowBorderSize();this.width=this.options.width;this.height=this.options.height;this.visible=false;this.constraint=false;this.constraintPad={top:0,left:0,bottom:0,right:0};if(this.width&&this.height){this.setSize(this.options.width,this.options.height)}this.setTitle(this.options.title);Windows.register(this)},destroy:function(){this._notify("onDestroy");Event.stopObserving(this.topbar,"mousedown",this.eventMouseDown);Event.stopObserving(this.bottombar,"mousedown",this.eventMouseDown);Event.stopObserving(this.content,"mousedown",this.eventMouseDownContent);Event.stopObserving(window,"load",this.eventOnLoad);Event.stopObserving(window,"resize",this.eventResize);Event.stopObserving(window,"scroll",this.eventResize);Event.stopObserving(this.options.parent,"scroll",this.eventResize);Event.stopObserving(this.content,"load",this.options.onload);if(this._oldParent){var e=this.getContent();var b=null;for(var d=0;d ';$(this.getId()+"_table_content").innerHTML=d;this.content=$(this.element.id+"_content")}this.getContent().update(b);return this},setAjaxContent:function(d,b,f,e){this.showFunction=f?"showCenter":"show";this.showModal=e||false;b=b||{};this.setHTMLContent("");this.onComplete=b.onComplete;if(!this._onCompleteHandler){this._onCompleteHandler=this._setAjaxContent.bind(this)}b.onComplete=this._onCompleteHandler;new Ajax.Request(d,b);b.onComplete=this.onComplete},_setAjaxContent:function(b){Element.update(this.getContent(),b.responseText);if(this.onComplete){this.onComplete(b)}this.onComplete=null;this[this.showFunction](this.showModal)},setURL:function(b){if(this.options.url){this.content.src=null}this.options.url=b;var d="";$(this.getId()+"_table_content").innerHTML=d;this.content=$(this.element.id+"_content")},getURL:function(){return this.options.url?this.options.url:null},refresh:function(){if(this.options.url){$(this.element.getAttribute("id")+"_content").src=this.options.url}},setCookie:function(d,e,t,g,b){d=d||this.element.id;this.cookie=[d,e,t,g,b];var r=WindowUtilities.getCookie(d);if(r){var s=r.split(",");var p=s[0].split(":");var o=s[1].split(":");var q=parseFloat(s[2]),l=parseFloat(s[3]);var n=s[4];var f=s[5];this.setSize(q,l);if(n=="true"){this.doMinimize=true}else{if(f=="true"){this.doMaximize=true}}this.useLeft=p[0]=="l";this.useTop=o[0]=="t";this.element.setStyle(this.useLeft?{left:p[1]}:{right:p[1]});this.element.setStyle(this.useTop?{top:o[1]}:{bottom:o[1]})}},getId:function(){return this.element.id},setDestroyOnClose:function(){this.options.destroyOnClose=true},setConstraint:function(b,d){this.constraint=b;this.constraintPad=Object.extend(this.constraintPad,d||{});if(this.useTop&&this.useLeft){this.setLocation(parseFloat(this.element.style.top),parseFloat(this.element.style.left))}},_initDrag:function(d){if(Event.element(d)==this.sizer&&this.isMinimized()){return}if(Event.element(d)!=this.sizer&&this.isMaximized()){return}if(Prototype.Browser.IE&&this.heightN==0){this._getWindowBorderSize()}this.pointer=[this._round(Event.pointerX(d),this.options.gridX),this._round(Event.pointerY(d),this.options.gridY)];if(this.options.wiredDrag){this.currentDrag=this._createWiredElement()}else{this.currentDrag=this.element}if(Event.element(d)==this.sizer){this.doResize=true;this.widthOrg=this.width;this.heightOrg=this.height;this.bottomOrg=parseFloat(this.element.getStyle("bottom"));this.rightOrg=parseFloat(this.element.getStyle("right"));this._notify("onStartResize")}else{this.doResize=false;var b=$(this.getId()+"_close");if(b&&Position.within(b,this.pointer[0],this.pointer[1])){this.currentDrag=null;return}this.toFront();if(!this.options.draggable){return}this._notify("onStartMove")}Event.observe(document,"mouseup",this.eventMouseUp,false);Event.observe(document,"mousemove",this.eventMouseMove,false);WindowUtilities.disableScreen("__invisible__","__invisible__",this.overlayOpacity);document.body.ondrag=function(){return false};document.body.onselectstart=function(){return false};this.currentDrag.show();Event.stop(d)},_round:function(d,b){return b==1?d:d=Math.floor(d/b)*b},_updateDrag:function(d){var b=[this._round(Event.pointerX(d),this.options.gridX),this._round(Event.pointerY(d),this.options.gridY)];var q=b[0]-this.pointer[0];var p=b[1]-this.pointer[1];if(this.doResize){var o=this.widthOrg+q;var f=this.heightOrg+p;q=this.width-this.widthOrg;p=this.height-this.heightOrg;if(this.useLeft){o=this._updateWidthConstraint(o)}else{this.currentDrag.setStyle({right:(this.rightOrg-q)+"px"})}if(this.useTop){f=this._updateHeightConstraint(f)}else{this.currentDrag.setStyle({bottom:(this.bottomOrg-p)+"px"})}this.setSize(o,f);this._notify("onResize")}else{this.pointer=b;if(this.useLeft){var e=parseFloat(this.currentDrag.getStyle("left"))+q;var n=this._updateLeftConstraint(e);this.pointer[0]+=n-e;this.currentDrag.setStyle({left:n+"px"})}else{this.currentDrag.setStyle({right:parseFloat(this.currentDrag.getStyle("right"))-q+"px"})}if(this.useTop){var l=parseFloat(this.currentDrag.getStyle("top"))+p;var g=this._updateTopConstraint(l);this.pointer[1]+=g-l;this.currentDrag.setStyle({top:g+"px"})}else{this.currentDrag.setStyle({bottom:parseFloat(this.currentDrag.getStyle("bottom"))-p+"px"})}this._notify("onMove")}if(this.iefix){this._fixIEOverlapping()}this._removeStoreLocation();Event.stop(d)},_endDrag:function(b){WindowUtilities.enableScreen("__invisible__");if(this.doResize){this._notify("onEndResize")}else{this._notify("onEndMove")}Event.stopObserving(document,"mouseup",this.eventMouseUp,false);Event.stopObserving(document,"mousemove",this.eventMouseMove,false);Event.stop(b);this._hideWiredElement();this._saveCookie();document.body.ondrag=null;document.body.onselectstart=null},_updateLeftConstraint:function(d){if(this.constraint&&this.useLeft&&this.useTop){var b=this.options.parent==document.body?WindowUtilities.getPageSize().windowWidth:this.options.parent.getDimensions().width;if(db-this.constraintPad.right){d=b-this.constraintPad.right-this.width-this.widthE-this.widthW}}return d},_updateTopConstraint:function(e){if(this.constraint&&this.useLeft&&this.useTop){var b=this.options.parent==document.body?WindowUtilities.getPageSize().windowHeight:this.options.parent.getDimensions().height;var d=this.height+this.heightN+this.heightS;if(eb-this.constraintPad.bottom){e=b-this.constraintPad.bottom-d}}return e},_updateWidthConstraint:function(b){if(this.constraint&&this.useLeft&&this.useTop){var d=this.options.parent==document.body?WindowUtilities.getPageSize().windowWidth:this.options.parent.getDimensions().width;var e=parseFloat(this.element.getStyle("left"));if(e+b+this.widthE+this.widthW>d-this.constraintPad.right){b=d-this.constraintPad.right-e-this.widthE-this.widthW}}return b},_updateHeightConstraint:function(d){if(this.constraint&&this.useLeft&&this.useTop){var b=this.options.parent==document.body?WindowUtilities.getPageSize().windowHeight:this.options.parent.getDimensions().height;var e=parseFloat(this.element.getStyle("top"));if(e+d+this.heightN+this.heightS>b-this.constraintPad.bottom){d=b-this.constraintPad.bottom-e-this.heightN-this.heightS}}return d},_createWindow:function(b){var h=this.options.className;var f=document.createElement("div");f.setAttribute("id",b);f.className="dialog";var g;if(this.options.url){g=''}else{g='
'}var l=this.options.closable?"
":"";var n=this.options.minimizable?"
":"";var o=this.options.maximizable?"
":"";var e=this.options.resizable?"class='"+h+"_sizer' id='"+b+"_sizer'":"class='"+h+"_se'";var d="../themes/default/blank.gif";f.innerHTML=l+n+o+"
"+this.options.title+"
"+g+"
";Element.hide(f);this.options.parent.insertBefore(f,this.options.parent.firstChild);Event.observe($(b+"_content"),"load",this.options.onload);return f},changeClassName:function(b){var d=this.options.className;var e=this.getId();$A(["_close","_minimize","_maximize","_content"]).each(function(f){this._toggleClassName($(e+f),d+f,b+f)}.bind(this));this._toggleClassName($(e+"_top"),d+"_title",b+"_title");$$("#"+e+" td").each(function(f){f.className=f.className.sub(d,b)});this.options.className=b;this._getWindowBorderSize();this.setSize(this.width,this.height)},_toggleClassName:function(e,d,b){if(e){e.removeClassName(d);e.addClassName(b)}},setLocation:function(f,d){f=this._updateTopConstraint(f);d=this._updateLeftConstraint(d);var b=this.currentDrag||this.element;b.setStyle({top:f+"px"});b.setStyle({left:d+"px"});this.useLeft=true;this.useTop=true},getLocation:function(){var b={};if(this.useTop){b=Object.extend(b,{top:this.element.getStyle("top")})}else{b=Object.extend(b,{bottom:this.element.getStyle("bottom")})}if(this.useLeft){b=Object.extend(b,{left:this.element.getStyle("left")})}else{b=Object.extend(b,{right:this.element.getStyle("right")})}return b},getSize:function(){return{width:this.width,height:this.height}},setSize:function(f,d,b){f=parseFloat(f);d=parseFloat(d);if(!this.minimized&&fthis.options.maxHeight){d=this.options.maxHeight}if(this.options.maxWidth&&f>this.options.maxWidth){f=this.options.maxWidth}if(this.useTop&&this.useLeft&&Window.hasEffectLib&&Effect.ResizeWindow&&b){new Effect.ResizeWindow(this,null,null,f,d,{duration:Window.resizeEffectDuration})}else{this.width=f;this.height=d;var h=this.currentDrag?this.currentDrag:this.element;h.setStyle({width:f+this.widthW+this.widthE+"px"});h.setStyle({height:d+this.heightN+this.heightS+"px"});if(!this.currentDrag||this.currentDrag==this.element){var g=$(this.element.id+"_content");g.setStyle({height:d+"px"});g.setStyle({width:f+"px"})}}},updateHeight:function(){this.setSize(this.width,this.content.scrollHeight,true)},updateWidth:function(){this.setSize(this.content.scrollWidth,this.height,true)},toFront:function(){if(this.element.style.zIndex0)&&(navigator.userAgent.indexOf("Opera")<0)&&(this.element.getStyle("position")=="absolute")){new Insertion.After(this.element.id,'');this.iefix=$(this.element.id+"_iefix")}if(this.iefix){setTimeout(this._fixIEOverlapping.bind(this),50)}},_fixIEOverlapping:function(){Position.clone(this.element,this.iefix);this.iefix.style.zIndex=this.element.style.zIndex-1;this.iefix.show()},_getWindowBorderSize:function(d){var e=this._createHiddenDiv(this.options.className+"_n");this.heightN=Element.getDimensions(e).height;e.parentNode.removeChild(e);var e=this._createHiddenDiv(this.options.className+"_s");this.heightS=Element.getDimensions(e).height;e.parentNode.removeChild(e);var e=this._createHiddenDiv(this.options.className+"_e");this.widthE=Element.getDimensions(e).width;e.parentNode.removeChild(e);var e=this._createHiddenDiv(this.options.className+"_w");this.widthW=Element.getDimensions(e).width;e.parentNode.removeChild(e);var e=document.createElement("div");e.className="overlay_"+this.options.className;document.body.appendChild(e);var b=this;setTimeout(function(){b.overlayOpacity=($(e).getStyle("opacity"));e.parentNode.removeChild(e)},10);if(Prototype.Browser.IE){this.heightS=$(this.getId()+"_row3").getDimensions().height;this.heightN=$(this.getId()+"_row1").getDimensions().height}if(Prototype.Browser.WebKit&&Prototype.Browser.WebKitVersion<420){this.setSize(this.width,this.height)}if(this.doMaximize){this.maximize()}if(this.doMinimize){this.minimize()}},_createHiddenDiv:function(d){var b=document.body;var e=document.createElement("div");e.setAttribute("id",this.element.id+"_tmp");e.className=d;e.style.display="none";e.innerHTML="";b.insertBefore(e,b.firstChild);return e},_storeLocation:function(){if(this.storedLocation==null){this.storedLocation={useTop:this.useTop,useLeft:this.useLeft,top:this.element.getStyle("top"),bottom:this.element.getStyle("bottom"),left:this.element.getStyle("left"),right:this.element.getStyle("right"),width:this.width,height:this.height}}},_restoreLocation:function(){if(this.storedLocation!=null){this.useLeft=this.storedLocation.useLeft;this.useTop=this.storedLocation.useTop;if(this.useLeft&&this.useTop&&Window.hasEffectLib&&Effect.ResizeWindow){new Effect.ResizeWindow(this,this.storedLocation.top,this.storedLocation.left,this.storedLocation.width,this.storedLocation.height,{duration:Window.resizeEffectDuration})}else{this.element.setStyle(this.useLeft?{left:this.storedLocation.left}:{right:this.storedLocation.right});this.element.setStyle(this.useTop?{top:this.storedLocation.top}:{bottom:this.storedLocation.bottom});this.setSize(this.storedLocation.width,this.storedLocation.height)}Windows.resetOverflow();this._removeStoreLocation()}},_removeStoreLocation:function(){this.storedLocation=null},_saveCookie:function(){if(this.cookie){var b="";if(this.useLeft){b+="l:"+(this.storedLocation?this.storedLocation.left:this.element.getStyle("left"))}else{b+="r:"+(this.storedLocation?this.storedLocation.right:this.element.getStyle("right"))}if(this.useTop){b+=",t:"+(this.storedLocation?this.storedLocation.top:this.element.getStyle("top"))}else{b+=",b:"+(this.storedLocation?this.storedLocation.bottom:this.element.getStyle("bottom"))}b+=","+(this.storedLocation?this.storedLocation.width:this.width);b+=","+(this.storedLocation?this.storedLocation.height:this.height);b+=","+this.isMinimized();b+=","+this.isMaximized();WindowUtilities.setCookie(b,this.cookie)}},_createWiredElement:function(){if(!this.wiredElement){if(Prototype.Browser.IE){this._getWindowBorderSize()}var d=document.createElement("div");d.className="wired_frame "+this.options.className+"_wired_frame";d.style.position="absolute";this.options.parent.insertBefore(d,this.options.parent.firstChild);this.wiredElement=$(d)}if(this.useLeft){this.wiredElement.setStyle({left:this.element.getStyle("left")})}else{this.wiredElement.setStyle({right:this.element.getStyle("right")})}if(this.useTop){this.wiredElement.setStyle({top:this.element.getStyle("top")})}else{this.wiredElement.setStyle({bottom:this.element.getStyle("bottom")})}var b=this.element.getDimensions();this.wiredElement.setStyle({width:b.width+"px",height:b.height+"px"});this.wiredElement.setStyle({zIndex:Windows.maxZIndex+30});return this.wiredElement},_hideWiredElement:function(){if(!this.wiredElement||!this.currentDrag){return}if(this.currentDrag==this.element){this.currentDrag=null}else{if(this.useLeft){this.element.setStyle({left:this.currentDrag.getStyle("left")})}else{this.element.setStyle({right:this.currentDrag.getStyle("right")})}if(this.useTop){this.element.setStyle({top:this.currentDrag.getStyle("top")})}else{this.element.setStyle({bottom:this.currentDrag.getStyle("bottom")})}this.currentDrag.hide();this.currentDrag=null;if(this.doResize){this.setSize(this.width,this.height)}}},_notify:function(b){if(this.options[b]){this.options[b](this)}else{Windows.notify(b,this)}}};var Windows={windows:[],modalWindows:[],observers:[],focusedWindow:null,maxZIndex:0,overlayShowEffectOptions:{duration:0.5},overlayHideEffectOptions:{duration:0.5},addObserver:function(b){this.removeObserver(b);this.observers.push(b)},removeObserver:function(b){this.observers=this.observers.reject(function(d){return d==b})},notify:function(b,d){this.observers.each(function(e){if(e[b]){e[b](b,d)}})},getWindow:function(b){return this.windows.detect(function(e){return e.getId()==b})},getFocusedWindow:function(){return this.focusedWindow},updateFocusedWindow:function(){this.focusedWindow=this.windows.length>=2?this.windows[this.windows.length-2]:null},addModalWindow:function(b){if(this.modalWindows.length==0){WindowUtilities.disableScreen(b.options.className,"overlay_modal",b.overlayOpacity,b.getId(),b.options.parent)}else{if(Window.keepMultiModalWindow){$("overlay_modal").style.zIndex=Windows.maxZIndex+1;Windows.maxZIndex+=1;WindowUtilities._hideSelect(this.modalWindows.last().getId())}else{this.modalWindows.last().element.hide()}WindowUtilities._showSelect(b.getId())}this.modalWindows.push(b)},removeModalWindow:function(b){this.modalWindows.pop();if(this.modalWindows.length==0){WindowUtilities.enableScreen()}else{if(Window.keepMultiModalWindow){this.modalWindows.last().toFront();WindowUtilities._showSelect(this.modalWindows.last().getId())}else{this.modalWindows.last().element.show()}}},register:function(b){this.windows.push(b)},unregister:function(b){this.windows=this.windows.reject(function(e){return e==b})},closeAll:function(){this.windows.each(function(b){Windows.close(b.getId())})},closeAllModalWindows:function(){WindowUtilities.enableScreen();this.modalWindows.each(function(b){if(b){b.close()}})},minimize:function(e,b){var d=this.getWindow(e);if(d&&d.visible){d.minimize()}Event.stop(b)},maximize:function(e,b){var d=this.getWindow(e);if(d&&d.visible){d.maximize()}Event.stop(b)},close:function(e,b){var d=this.getWindow(e);if(d){d.close()}if(b){Event.stop(b)}},blur:function(d){var b=this.getWindow(d);if(!b){return}if(b.options.blurClassName){b.changeClassName(b.options.blurClassName)}if(this.focusedWindow==b){this.focusedWindow=null}b._notify("onBlur")},focus:function(d){var b=this.getWindow(d);if(!b){return}if(this.focusedWindow){this.blur(this.focusedWindow.getId())}if(b.options.focusClassName){b.changeClassName(b.options.focusClassName)}this.focusedWindow=b;b._notify("onFocus")},unsetOverflow:function(b){this.windows.each(function(e){e.oldOverflow=e.getContent().getStyle("overflow")||"auto";e.getContent().setStyle({overflow:"hidden"})});if(b&&b.oldOverflow){b.getContent().setStyle({overflow:b.oldOverflow})}},resetOverflow:function(){this.windows.each(function(b){if(b.oldOverflow){b.getContent().setStyle({overflow:b.oldOverflow})}})},updateZindex:function(b,d){if(b>this.maxZIndex){this.maxZIndex=b;if(this.focusedWindow){this.blur(this.focusedWindow.getId())}}this.focusedWindow=d;if(this.focusedWindow){this.focus(this.focusedWindow.getId())}}};var Dialog={dialogId:null,onCompleteFunc:null,callFunc:null,parameters:null,confirm:function(f,e){if(f&&typeof f!="string"){Dialog._runAjaxRequest(f,e,Dialog.confirm);return}f=f||"";e=e||{};var h=e.okLabel?e.okLabel:"Ok";var b=e.cancelLabel?e.cancelLabel:"Cancel";e=Object.extend(e,e.windowParameters||{});e.windowParameters=e.windowParameters||{};e.className=e.className||"alert";var d="class ='"+(e.buttonClass?e.buttonClass+" ":"")+" ok_button'";var g="class ='"+(e.buttonClass?e.buttonClass+" ":"")+" cancel_button'";var f="
"+f+"
";return this._openDialog(f,e)},alert:function(e,d){if(e&&typeof e!="string"){Dialog._runAjaxRequest(e,d,Dialog.alert);return}e=e||"";d=d||{};var f=d.okLabel?d.okLabel:"Ok";d=Object.extend(d,d.windowParameters||{});d.windowParameters=d.windowParameters||{};d.className=d.className||"alert";var b="class ='"+(d.buttonClass?d.buttonClass+" ":"")+" ok_button'";var e="
"+e+"
";return this._openDialog(e,d)},info:function(d,b){if(d&&typeof d!="string"){Dialog._runAjaxRequest(d,b,Dialog.info);return}d=d||"";b=b||{};b=Object.extend(b,b.windowParameters||{});b.windowParameters=b.windowParameters||{};b.className=b.className||"alert";var d="";if(b.showProgress){d+=""}b.ok=null;b.cancel=null;return this._openDialog(d,b)},setInfoMessage:function(b){$("modal_dialog_message").update(b)},closeInfo:function(){Windows.close(this.dialogId)},_openDialog:function(g,f){var e=f.className;if(!f.height&&!f.width){f.width=WindowUtilities.getPageSize((f.options&&f.options.parent)||document.body).pageWidth/2}if(f.id){this.dialogId=f.id}else{var d=new Date();this.dialogId="modal_dialog_"+d.getTime();f.id=this.dialogId}if(!f.height||!f.width){var b=WindowUtilities._computeSize(g,this.dialogId,f.width,f.height,5,e);if(f.height){f.width=b+5}else{f.height=b+5}}f.effectOptions=f.effectOptions;f.resizable=f.resizable||false;f.minimizable=f.minimizable||false;f.maximizable=f.maximizable||false;f.draggable=f.draggable||false;f.closable=f.closable||false;var h=new Window(f);if(!f.url){h.setHTMLContent(g)}h.showCenter(true,f.top,f.left);h.setDestroyOnClose();h.cancelCallback=f.onCancel||f.cancel;h.okCallback=f.onOk||f.ok;return h},_getAjaxContent:function(b){Dialog.callFunc(b.responseText,Dialog.parameters)},_runAjaxRequest:function(e,d,b){if(e.options==null){e.options={}}Dialog.onCompleteFunc=e.options.onComplete;Dialog.parameters=d;Dialog.callFunc=b;e.options.onComplete=Dialog._getAjaxContent;new Ajax.Request(e.url,e.options)},okCallback:function(){var b=Windows.focusedWindow;if(!b.okCallback||b.okCallback(b)){$$("#"+b.getId()+" input").each(function(d){d.onclick=null});b.close()}},cancelCallback:function(){var b=Windows.focusedWindow;$$("#"+b.getId()+" input").each(function(d){d.onclick=null});b.close();if(b.cancelCallback){b.cancelCallback(b)}}};if(Prototype.Browser.WebKit){var array=navigator.userAgent.match(new RegExp(/AppleWebKit\/([\d\.\+]*)/));Prototype.Browser.WebKitVersion=parseFloat(array[1])}var WindowUtilities={getWindowScroll:function(parent){var T,L,W,H;parent=parent||document.body;if(parent!=document.body){T=parent.scrollTop;L=parent.scrollLeft;W=parent.scrollWidth;H=parent.scrollHeight}else{var w=window;with(w.document){if(w.document.documentElement&&documentElement.scrollTop){T=documentElement.scrollTop;L=documentElement.scrollLeft}else{if(w.document.body){T=body.scrollTop;L=body.scrollLeft}}if(w.innerWidth){W=w.innerWidth;H=w.innerHeight}else{if(w.document.documentElement&&documentElement.clientWidth){W=documentElement.clientWidth;H=documentElement.clientHeight}else{W=body.offsetWidth;H=body.offsetHeight}}}}return{top:T,left:L,width:W,height:H}},getPageSize:function(f){f=f||document.body;var e,l;var g,d;if(f!=document.body){e=f.getWidth();l=f.getHeight();d=f.scrollWidth;g=f.scrollHeight}else{var h,b;if(window.innerHeight&&window.scrollMaxY){h=document.body.scrollWidth;b=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){h=document.body.scrollWidth;b=document.body.scrollHeight}else{h=document.body.offsetWidth;b=document.body.offsetHeight}}if(self.innerHeight){e=self.innerWidth;l=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){e=document.documentElement.clientWidth;l=document.documentElement.clientHeight}else{if(document.body){e=document.body.clientWidth;l=document.body.clientHeight}}}if(b"}catch(h){}var g=d.firstChild||null;if(g&&(g.tagName.toUpperCase()!=b)){g=g.getElementsByTagName(b)[0]}if(!g){g=document.createElement(b)}if(!g){return}if(arguments[1]){if(this._isStringOrNumber(arguments[1])||(arguments[1] instanceof Array)||arguments[1].tagName){this._children(g,arguments[1])}else{var f=this._attributes(arguments[1]);if(f.length){try{d.innerHTML="<"+b+" "+f+">"}catch(h){}g=d.firstChild||null;if(!g){g=document.createElement(b);for(attr in arguments[1]){g[attr=="class"?"className":attr]=arguments[1][attr]}}if(g.tagName.toUpperCase()!=b){g=d.getElementsByTagName(b)[0]}}}}if(arguments[2]){this._children(g,arguments[2])}return $(g)},_text:function(b){return document.createTextNode(b)},ATTR_MAP:{className:"class",htmlFor:"for"},_attributes:function(b){var d=[];for(attribute in b){d.push((attribute in this.ATTR_MAP?this.ATTR_MAP[attribute]:attribute)+'="'+b[attribute].toString().escapeHTML().gsub(/"/,""")+'"')}return d.join(" ")},_children:function(d,b){if(b.tagName){d.appendChild(b);return}if(typeof b=="object"){b.flatten().each(function(f){if(typeof f=="object"){d.appendChild(f)}else{if(Builder._isStringOrNumber(f)){d.appendChild(Builder._text(f))}}})}else{if(Builder._isStringOrNumber(b)){d.appendChild(Builder._text(b))}}},_isStringOrNumber:function(b){return(typeof b=="string"||typeof b=="number")},build:function(d){var b=this.node("div");$(b).update(d.strip());return b.down()},dump:function(d){if(typeof d!="object"&&typeof d!="function"){d=window}var b=("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/);b.each(function(e){d[e]=function(){return Builder.node.apply(Builder,[e].concat($A(arguments)))}})}};String.prototype.parseColor=function(){var b="#";if(this.slice(0,4)=="rgb("){var e=this.slice(4,this.length-1).split(",");var d=0;do{b+=parseInt(e[d]).toColorPart()}while(++d<3)}else{if(this.slice(0,1)=="#"){if(this.length==4){for(var d=1;d<4;d++){b+=(this.charAt(d)+this.charAt(d)).toLowerCase()}}if(this.length==7){b=this.toLowerCase()}}}return(b.length==7?b:(arguments[0]||this))};Element.collectTextNodes=function(b){return $A($(b).childNodes).collect(function(d){return(d.nodeType==3?d.nodeValue:(d.hasChildNodes()?Element.collectTextNodes(d):""))}).flatten().join("")};Element.collectTextNodesIgnoreClass=function(b,d){return $A($(b).childNodes).collect(function(e){return(e.nodeType==3?e.nodeValue:((e.hasChildNodes()&&!Element.hasClassName(e,d))?Element.collectTextNodesIgnoreClass(e,d):""))}).flatten().join("")};Element.setContentZoom=function(b,d){b=$(b);b.setStyle({fontSize:(d/100)+"em"});if(Prototype.Browser.WebKit){window.scrollBy(0,0)}return b};Element.getInlineOpacity=function(b){return $(b).style.opacity||""};Element.forceRerendering=function(b){try{b=$(b);var f=document.createTextNode(" ");b.appendChild(f);b.removeChild(f)}catch(d){}};var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},Transitions:{linear:Prototype.K,sinoidal:function(b){return(-Math.cos(b*Math.PI)/2)+0.5},reverse:function(b){return 1-b},flicker:function(b){var b=((-Math.cos(b*Math.PI)/4)+0.75)+Math.random()/4;return b>1?1:b},wobble:function(b){return(-Math.cos(b*Math.PI*(9*b))/2)+0.5},pulse:function(d,b){return(-Math.cos((d*((b||5)-0.5)*2)*Math.PI)/2)+0.5},spring:function(b){return 1-(Math.cos(b*4.5*Math.PI)*Math.exp(-b*6))},none:function(b){return 0},full:function(b){return 1}},DefaultOptions:{duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"},tagifyText:function(b){var d="position:relative";if(Prototype.Browser.IE){d+=";zoom:1"}b=$(b);$A(b.childNodes).each(function(e){if(e.nodeType==3){e.nodeValue.toArray().each(function(f){b.insertBefore(new Element("span",{style:d}).update(f==" "?String.fromCharCode(160):f),e)});Element.remove(e)}})},multiple:function(d,e){var g;if(((typeof d=="object")||Object.isFunction(d))&&(d.length)){g=d}else{g=$(d).childNodes}var b=Object.extend({speed:0.1,delay:0},arguments[2]||{});var f=b.delay;$A(g).each(function(l,h){new e(l,Object.extend(b,{delay:h*b.speed+f}))})},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(d,e,b){d=$(d);e=(e||"appear").toLowerCase();return Effect[Effect.PAIRS[e][d.visible()?1:0]](d,Object.extend({queue:{position:"end",scope:(d.id||"global"),limit:1}},b||{}))}};Effect.DefaultOptions.transition=Effect.Transitions.sinoidal;Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[];this.interval=null},_each:function(b){this.effects._each(b)},add:function(d){var e=new Date().getTime();var b=Object.isString(d.options.queue)?d.options.queue:d.options.queue.position;switch(b){case"front":this.effects.findAll(function(f){return f.state=="idle"}).each(function(f){f.startOn+=d.finishOn;f.finishOn+=d.finishOn});break;case"with-last":e=this.effects.pluck("startOn").max()||e;break;case"end":e=this.effects.pluck("finishOn").max()||e;break}d.startOn+=e;d.finishOn+=e;if(!d.options.queue.limit||(this.effects.length=this.startOn){if(e>=this.finishOn){this.render(1);this.cancel();this.event("beforeFinish");if(this.finish){this.finish()}this.event("afterFinish");return}var d=(e-this.startOn)/this.totalTime,b=(d*this.totalFrames).round();if(b>this.currentFrame){this.render(d);this.currentFrame=b}}},cancel:function(){if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).remove(this)}this.state="finished"},event:function(b){if(this.options[b+"Internal"]){this.options[b+"Internal"](this)}if(this.options[b]){this.options[b](this)}},inspect:function(){var b=$H();for(property in this){if(!Object.isFunction(this[property])){b.set(property,this[property])}}return"#"}});Effect.Parallel=Class.create(Effect.Base,{initialize:function(b){this.effects=b||[];this.start(arguments[1])},update:function(b){this.effects.invoke("render",b)},finish:function(b){this.effects.each(function(d){d.render(1);d.cancel();d.event("beforeFinish");if(d.finish){d.finish(b)}d.event("afterFinish")})}});Effect.Tween=Class.create(Effect.Base,{initialize:function(e,h,g){e=Object.isString(e)?$(e):e;var d=$A(arguments),f=d.last(),b=d.length==5?d[3]:null;this.method=Object.isFunction(f)?f.bind(e):Object.isFunction(e[f])?e[f].bind(e):function(l){e[f]=l};this.start(Object.extend({from:h,to:g},b||{}))},update:function(b){this.method(b)}});Effect.Event=Class.create(Effect.Base,{initialize:function(){this.start(Object.extend({duration:0},arguments[0]||{}))},update:Prototype.emptyFunction});Effect.Opacity=Class.create(Effect.Base,{initialize:function(d){this.element=$(d);if(!this.element){throw (Effect._elementDoesNotExistError)}if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}var b=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});this.start(b)},update:function(b){this.element.setOpacity(b)}});Effect.Move=Class.create(Effect.Base,{initialize:function(d){this.element=$(d);if(!this.element){throw (Effect._elementDoesNotExistError)}var b=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});this.start(b)},setup:function(){this.element.makePositioned();this.originalLeft=parseFloat(this.element.getStyle("left")||"0");this.originalTop=parseFloat(this.element.getStyle("top")||"0");if(this.options.mode=="absolute"){this.options.x=this.options.x-this.originalLeft;this.options.y=this.options.y-this.originalTop}},update:function(b){this.element.setStyle({left:(this.options.x*b+this.originalLeft).round()+"px",top:(this.options.y*b+this.originalTop).round()+"px"})}});Effect.MoveBy=function(d,b,e){return new Effect.Move(d,Object.extend({x:e,y:b},arguments[3]||{}))};Effect.Scale=Class.create(Effect.Base,{initialize:function(d,e){this.element=$(d);if(!this.element){throw (Effect._elementDoesNotExistError)}var b=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:e},arguments[2]||{});this.start(b)},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=this.element.getStyle("position");this.originalStyle={};["top","left","width","height","fontSize"].each(function(d){this.originalStyle[d]=this.element.style[d]}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var b=this.element.getStyle("font-size")||"100%";["em","px","%","pt"].each(function(d){if(b.indexOf(d)>0){this.fontSize=parseFloat(b);this.fontSizeType=d}}.bind(this));this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;this.dims=null;if(this.options.scaleMode=="box"){this.dims=[this.element.offsetHeight,this.element.offsetWidth]}if(/^content/.test(this.options.scaleMode)){this.dims=[this.element.scrollHeight,this.element.scrollWidth]}if(!this.dims){this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]}},update:function(b){var d=(this.options.scaleFrom/100)+(this.factor*b);if(this.options.scaleContent&&this.fontSize){this.element.setStyle({fontSize:this.fontSize*d+this.fontSizeType})}this.setDimensions(this.dims[0]*d,this.dims[1]*d)},finish:function(b){if(this.restoreAfterFinish){this.element.setStyle(this.originalStyle)}},setDimensions:function(b,g){var h={};if(this.options.scaleX){h.width=g.round()+"px"}if(this.options.scaleY){h.height=b.round()+"px"}if(this.options.scaleFromCenter){var f=(b-this.dims[0])/2;var e=(g-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY){h.top=this.originalTop-f+"px"}if(this.options.scaleX){h.left=this.originalLeft-e+"px"}}else{if(this.options.scaleY){h.top=-f+"px"}if(this.options.scaleX){h.left=-e+"px"}}}this.element.setStyle(h)}});Effect.Highlight=Class.create(Effect.Base,{initialize:function(d){this.element=$(d);if(!this.element){throw (Effect._elementDoesNotExistError)}var b=Object.extend({startcolor:"#ffff99"},arguments[1]||{});this.start(b)},setup:function(){if(this.element.getStyle("display")=="none"){this.cancel();return}this.oldStyle={};if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle("background-image");this.element.setStyle({backgroundImage:"none"})}if(!this.options.endcolor){this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff")}if(!this.options.restorecolor){this.options.restorecolor=this.element.getStyle("background-color")}this._base=$R(0,2).map(function(b){return parseInt(this.options.startcolor.slice(b*2+1,b*2+3),16)}.bind(this));this._delta=$R(0,2).map(function(b){return parseInt(this.options.endcolor.slice(b*2+1,b*2+3),16)-this._base[b]}.bind(this))},update:function(b){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(d,e,f){return d+((this._base[f]+(this._delta[f]*b)).round().toColorPart())}.bind(this))})},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))}});Effect.ScrollTo=function(e){var d=arguments[1]||{},b=document.viewport.getScrollOffsets(),f=$(e).cumulativeOffset();if(d.offset){f[1]+=d.offset}return new Effect.Tween(null,b.top,f[1],d,function(g){scrollTo(b.left,g.round())})};Effect.Fade=function(e){e=$(e);var b=e.getInlineOpacity();var d=Object.extend({from:e.getOpacity()||1,to:0,afterFinishInternal:function(f){if(f.options.to!=0){return}f.element.hide().setStyle({opacity:b})}},arguments[1]||{});return new Effect.Opacity(e,d)};Effect.Appear=function(d){d=$(d);var b=Object.extend({from:(d.getStyle("display")=="none"?0:d.getOpacity()||0),to:1,afterFinishInternal:function(e){e.element.forceRerendering()},beforeSetup:function(e){e.element.setOpacity(e.options.from).show()}},arguments[1]||{});return new Effect.Opacity(d,b)};Effect.Puff=function(d){d=$(d);var b={opacity:d.getInlineOpacity(),position:d.getStyle("position"),top:d.style.top,left:d.style.left,width:d.style.width,height:d.style.height};return new Effect.Parallel([new Effect.Scale(d,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(d,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(e){Position.absolutize(e.effects[0].element)},afterFinishInternal:function(e){e.effects[0].element.hide().setStyle(b)}},arguments[1]||{}))};Effect.BlindUp=function(b){b=$(b);b.makeClipping();return new Effect.Scale(b,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(d){d.element.hide().undoClipping()}},arguments[1]||{}))};Effect.BlindDown=function(d){d=$(d);var b=d.getDimensions();return new Effect.Scale(d,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:true,afterSetup:function(e){e.element.makeClipping().setStyle({height:"0px"}).show()},afterFinishInternal:function(e){e.element.undoClipping()}},arguments[1]||{}))};Effect.SwitchOff=function(d){d=$(d);var b=d.getInlineOpacity();return new Effect.Appear(d,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(e){new Effect.Scale(e.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(f){f.element.makePositioned().makeClipping()},afterFinishInternal:function(f){f.element.hide().undoClipping().undoPositioned().setStyle({opacity:b})}})}},arguments[1]||{}))};Effect.DropOut=function(d){d=$(d);var b={top:d.getStyle("top"),left:d.getStyle("left"),opacity:d.getInlineOpacity()};return new Effect.Parallel([new Effect.Move(d,{x:0,y:100,sync:true}),new Effect.Opacity(d,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(e){e.effects[0].element.makePositioned()},afterFinishInternal:function(e){e.effects[0].element.hide().undoPositioned().setStyle(b)}},arguments[1]||{}))};Effect.Shake=function(f){f=$(f);var d=Object.extend({distance:20,duration:0.5},arguments[1]||{});var g=parseFloat(d.distance);var e=parseFloat(d.duration)/10;var b={top:f.getStyle("top"),left:f.getStyle("left")};return new Effect.Move(f,{x:g,y:0,duration:e,afterFinishInternal:function(h){new Effect.Move(h.element,{x:-g*2,y:0,duration:e*2,afterFinishInternal:function(l){new Effect.Move(l.element,{x:g*2,y:0,duration:e*2,afterFinishInternal:function(n){new Effect.Move(n.element,{x:-g*2,y:0,duration:e*2,afterFinishInternal:function(o){new Effect.Move(o.element,{x:g*2,y:0,duration:e*2,afterFinishInternal:function(p){new Effect.Move(p.element,{x:-g,y:0,duration:e,afterFinishInternal:function(q){q.element.undoPositioned().setStyle(b)}})}})}})}})}})}})};Effect.SlideDown=function(e){e=$(e).cleanWhitespace();var b=e.down().getStyle("bottom");var d=e.getDimensions();return new Effect.Scale(e,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:d.height,originalWidth:d.width},restoreAfterFinish:true,afterSetup:function(f){f.element.makePositioned();f.element.down().makePositioned();if(window.opera){f.element.setStyle({top:""})}f.element.makeClipping().setStyle({height:"0px"}).show()},afterUpdateInternal:function(f){f.element.down().setStyle({bottom:(f.dims[0]-f.element.clientHeight)+"px"})},afterFinishInternal:function(f){f.element.undoClipping().undoPositioned();f.element.down().undoPositioned().setStyle({bottom:b})}},arguments[1]||{}))};Effect.SlideUp=function(e){e=$(e).cleanWhitespace();var b=e.down().getStyle("bottom");var d=e.getDimensions();return new Effect.Scale(e,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:d.height,originalWidth:d.width},restoreAfterFinish:true,afterSetup:function(f){f.element.makePositioned();f.element.down().makePositioned();if(window.opera){f.element.setStyle({top:""})}f.element.makeClipping().show()},afterUpdateInternal:function(f){f.element.down().setStyle({bottom:(f.dims[0]-f.element.clientHeight)+"px"})},afterFinishInternal:function(f){f.element.hide().undoClipping().undoPositioned();f.element.down().undoPositioned().setStyle({bottom:b})}},arguments[1]||{}))};Effect.Squish=function(b){return new Effect.Scale(b,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(d){d.element.makeClipping()},afterFinishInternal:function(d){d.element.hide().undoClipping()}})};Effect.Grow=function(e){e=$(e);var d=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});var b={top:e.style.top,left:e.style.left,height:e.style.height,width:e.style.width,opacity:e.getInlineOpacity()};var l=e.getDimensions();var n,h;var g,f;switch(d.direction){case"top-left":n=h=g=f=0;break;case"top-right":n=l.width;h=f=0;g=-l.width;break;case"bottom-left":n=g=0;h=l.height;f=-l.height;break;case"bottom-right":n=l.width;h=l.height;g=-l.width;f=-l.height;break;case"center":n=l.width/2;h=l.height/2;g=-l.width/2;f=-l.height/2;break}return new Effect.Move(e,{x:n,y:h,duration:0.01,beforeSetup:function(o){o.element.hide().makeClipping().makePositioned()},afterFinishInternal:function(o){new Effect.Parallel([new Effect.Opacity(o.element,{sync:true,to:1,from:0,transition:d.opacityTransition}),new Effect.Move(o.element,{x:g,y:f,sync:true,transition:d.moveTransition}),new Effect.Scale(o.element,100,{scaleMode:{originalHeight:l.height,originalWidth:l.width},sync:true,scaleFrom:window.opera?1:0,transition:d.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(p){p.effects[0].element.setStyle({height:"0px"}).show()},afterFinishInternal:function(p){p.effects[0].element.undoClipping().undoPositioned().setStyle(b)}},d))}})};Effect.Shrink=function(e){e=$(e);var d=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});var b={top:e.style.top,left:e.style.left,height:e.style.height,width:e.style.width,opacity:e.getInlineOpacity()};var h=e.getDimensions();var g,f;switch(d.direction){case"top-left":g=f=0;break;case"top-right":g=h.width;f=0;break;case"bottom-left":g=0;f=h.height;break;case"bottom-right":g=h.width;f=h.height;break;case"center":g=h.width/2;f=h.height/2;break}return new Effect.Parallel([new Effect.Opacity(e,{sync:true,to:0,from:1,transition:d.opacityTransition}),new Effect.Scale(e,window.opera?1:0,{sync:true,transition:d.scaleTransition,restoreAfterFinish:true}),new Effect.Move(e,{x:g,y:f,sync:true,transition:d.moveTransition})],Object.extend({beforeStartInternal:function(l){l.effects[0].element.makePositioned().makeClipping()},afterFinishInternal:function(l){l.effects[0].element.hide().undoClipping().undoPositioned().setStyle(b)}},d))};Effect.Pulsate=function(e){e=$(e);var d=arguments[1]||{},b=e.getInlineOpacity(),g=d.transition||Effect.Transitions.linear,f=function(h){return 1-g((-Math.cos((h*(d.pulses||5)*2)*Math.PI)/2)+0.5)};return new Effect.Opacity(e,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(h){h.element.setStyle({opacity:b})}},d),{transition:f}))};Effect.Fold=function(d){d=$(d);var b={top:d.style.top,left:d.style.left,width:d.style.width,height:d.style.height};d.makeClipping();return new Effect.Scale(d,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(e){new Effect.Scale(d,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(f){f.element.hide().undoClipping().setStyle(b)}})}},arguments[1]||{}))};Effect.Morph=Class.create(Effect.Base,{initialize:function(e){this.element=$(e);if(!this.element){throw (Effect._elementDoesNotExistError)}var b=Object.extend({style:{}},arguments[1]||{});if(!Object.isString(b.style)){this.style=$H(b.style)}else{if(b.style.include(":")){this.style=b.style.parseStyle()}else{this.element.addClassName(b.style);this.style=$H(this.element.getStyles());this.element.removeClassName(b.style);var d=this.element.getStyles();this.style=this.style.reject(function(f){return f.value==d[f.key]});b.afterFinishInternal=function(f){f.element.addClassName(f.options.style);f.transforms.each(function(g){f.element.style[g.style]=""})}}}this.start(b)},setup:function(){function b(d){if(!d||["rgba(0, 0, 0, 0)","transparent"].include(d)){d="#ffffff"}d=d.parseColor();return $R(0,2).map(function(e){return parseInt(d.slice(e*2+1,e*2+3),16)})}this.transforms=this.style.map(function(l){var h=l[0],g=l[1],f=null;if(g.parseColor("#zzzzzz")!="#zzzzzz"){g=g.parseColor();f="color"}else{if(h=="opacity"){g=parseFloat(g);if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}}else{if(Element.CSS_LENGTH.test(g)){var e=g.match(/^([\+\-]?[0-9\.]+)(.*)$/);g=parseFloat(e[1]);f=(e.length==3)?e[2]:null}}}var d=this.element.getStyle(h);return{style:h.camelize(),originalValue:f=="color"?b(d):parseFloat(d||0),targetValue:f=="color"?b(g):g,unit:f}}.bind(this)).reject(function(d){return((d.originalValue==d.targetValue)||(d.unit!="color"&&(isNaN(d.originalValue)||isNaN(d.targetValue))))})},update:function(b){var f={},d,e=this.transforms.length;while(e--){f[(d=this.transforms[e]).style]=d.unit=="color"?"#"+(Math.round(d.originalValue[0]+(d.targetValue[0]-d.originalValue[0])*b)).toColorPart()+(Math.round(d.originalValue[1]+(d.targetValue[1]-d.originalValue[1])*b)).toColorPart()+(Math.round(d.originalValue[2]+(d.targetValue[2]-d.originalValue[2])*b)).toColorPart():(d.originalValue+(d.targetValue-d.originalValue)*b).toFixed(3)+(d.unit===null?"":d.unit)}this.element.setStyle(f,true)}});Effect.Transform=Class.create({initialize:function(b){this.tracks=[];this.options=arguments[1]||{};this.addTracks(b)},addTracks:function(b){b.each(function(d){d=$H(d);var e=d.values().first();this.tracks.push($H({ids:d.keys().first(),effect:Effect.Morph,options:{style:e}}))}.bind(this));return this},play:function(){return new Effect.Parallel(this.tracks.map(function(b){var f=b.get("ids"),e=b.get("effect"),d=b.get("options");var g=[$(f)||$$(f)].flatten();return g.map(function(h){return new e(h,Object.extend({sync:true},d))})}).flatten(),this.options)}});Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderSpacing borderTopColor borderTopStyle borderTopWidth bottom clip color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop markerOffset maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex");Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;String.__parseStyleElement=document.createElement("div");String.prototype.parseStyle=function(){var d,b=$H();if(Prototype.Browser.WebKit){d=new Element("div",{style:this}).style}else{String.__parseStyleElement.innerHTML='
';d=String.__parseStyleElement.childNodes[0].style}Element.CSS_PROPERTIES.each(function(e){if(d[e]){b.set(e,d[e])}});if(Prototype.Browser.IE&&this.include("opacity")){b.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1])}return b};if(document.defaultView&&document.defaultView.getComputedStyle){Element.getStyles=function(d){var b=document.defaultView.getComputedStyle($(d),null);return Element.CSS_PROPERTIES.inject({},function(e,f){e[f]=b[f];return e})}}else{Element.getStyles=function(d){d=$(d);var b=d.currentStyle,e;e=Element.CSS_PROPERTIES.inject({},function(f,g){f[g]=b[g];return f});if(!e.opacity){e.opacity=d.getOpacity()}return e}}Effect.Methods={morph:function(b,d){b=$(b);new Effect.Morph(b,Object.extend({style:d},arguments[2]||{}));return b},visualEffect:function(e,g,d){e=$(e);var f=g.dasherize().camelize(),b=f.charAt(0).toUpperCase()+f.substring(1);new Effect[b](e,d);return e},highlight:function(d,b){d=$(d);new Effect.Highlight(d,b);return d}};$w("fade appear grow shrink fold blindUp blindDown slideUp slideDown pulsate shake puff squish switchOff dropOut").each(function(b){Effect.Methods[b]=function(e,d){e=$(e);Effect[b.charAt(0).toUpperCase()+b.substring(1)](e,d);return e}});$w("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(b){Effect.Methods[b]=Element[b]});Element.addMethods(Effect.Methods);function validateCreditCard(e){var d="0123456789";var b="";for(i=0;i9?Math.floor(a/10+a%10):a}for(i=0;i=d},maxLength:function(b,e,d){return b.length<=d},min:function(b,e,d){return b>=parseFloat(d)},max:function(b,e,d){return b<=parseFloat(d)},notOneOf:function(b,e,d){return $A(d).all(function(f){return b!=f})},oneOf:function(b,e,d){return $A(d).any(function(f){return b==f})},is:function(b,e,d){return b==d},isNot:function(b,e,d){return b!=d},equalToField:function(b,e,d){return b==$F(d)},notEqualToField:function(b,e,d){return b!=$F(d)},include:function(b,e,d){return $A(d).all(function(f){return Validation.get(f).test(b,e)})}};var Validation=Class.create();Validation.defaultOptions={onSubmit:true,stopOnFirst:false,immediate:false,focusOnError:true,useTitles:false,addClassNameToContainer:false,containerClassName:".input-box",onFormValidate:function(b,d){},onElementValidate:function(b,d){}};Validation.prototype={initialize:function(d,b){this.form=$(d);if(!this.form){return}this.options=Object.extend({onSubmit:Validation.defaultOptions.onSubmit,stopOnFirst:Validation.defaultOptions.stopOnFirst,immediate:Validation.defaultOptions.immediate,focusOnError:Validation.defaultOptions.focusOnError,useTitles:Validation.defaultOptions.useTitles,onFormValidate:Validation.defaultOptions.onFormValidate,onElementValidate:Validation.defaultOptions.onElementValidate},b||{});if(this.options.onSubmit){Event.observe(this.form,"submit",this.onSubmit.bind(this),false)}if(this.options.immediate){Form.getElements(this.form).each(function(e){if(e.tagName.toLowerCase()=="select"){Event.observe(e,"blur",this.onChange.bindAsEventListener(this))}if(e.type.toLowerCase()=="radio"||e.type.toLowerCase()=="checkbox"){Event.observe(e,"click",this.onChange.bindAsEventListener(this))}else{Event.observe(e,"change",this.onChange.bindAsEventListener(this))}},this)}},onChange:function(b){Validation.isOnChange=true;Validation.validate(Event.element(b),{useTitle:this.options.useTitles,onElementValidate:this.options.onElementValidate});Validation.isOnChange=false},onSubmit:function(b){if(!this.validate()){Event.stop(b)}},validate:function(){var b=false;var d=this.options.useTitles;var g=this.options.onElementValidate;try{if(this.options.stopOnFirst){b=Form.getElements(this.form).all(function(e){if(e.hasClassName("local-validation")&&!this.isElementInForm(e,this.form)){return true}return Validation.validate(e,{useTitle:d,onElementValidate:g})},this)}else{b=Form.getElements(this.form).collect(function(e){if(e.hasClassName("local-validation")&&!this.isElementInForm(e,this.form)){return true}if(e.hasClassName("validation-disabled")){return true}return Validation.validate(e,{useTitle:d,onElementValidate:g})},this).all()}}catch(f){}if(!b&&this.options.focusOnError){try{Form.getElements(this.form).findAll(function(e){return $(e).hasClassName("validation-failed")}).first().focus()}catch(f){}}this.options.onFormValidate(b,this.form);return b},reset:function(){Form.getElements(this.form).each(Validation.reset)},isElementInForm:function(e,d){var b=e.up("form");if(b==d){return true}return false}};Object.extend(Validation,{validate:function(e,b){b=Object.extend({useTitle:false,onElementValidate:function(f,g){}},b||{});e=$(e);var d=$w(e.className);return result=d.all(function(f){var g=Validation.test(f,e,b.useTitle);b.onElementValidate(g,e);return g})},insertAdvice:function(f,d){var b=$(f).up(".field-row");if(b){Element.insert(b,{after:d})}else{if(f.up("td.value")){f.up("td.value").insert({bottom:d})}else{if(f.advaiceContainer&&$(f.advaiceContainer)){$(f.advaiceContainer).update(d)}else{switch(f.type.toLowerCase()){case"checkbox":case"radio":var e=f.parentNode;if(e){Element.insert(e,{bottom:d})}else{Element.insert(f,{after:d})}break;default:Element.insert(f,{after:d})}}}}},showAdvice:function(e,d,b){if(!e.advices){e.advices=new Hash()}else{e.advices.each(function(f){if(!d||f.value.id!=d.id){this.hideAdvice(e,f.value)}}.bind(this))}e.advices.set(b,d);if(typeof Effect=="undefined"){d.style.display="block"}else{if(!d._adviceAbsolutize){new Effect.Appear(d,{duration:1})}else{Position.absolutize(d);d.show();d.setStyle({top:d._adviceTop,left:d._adviceLeft,width:d._adviceWidth,"z-index":1000});d.addClassName("advice-absolute")}}},hideAdvice:function(d,b){if(b!=null){new Effect.Fade(b,{duration:1,afterFinishInternal:function(){b.hide()}})}},updateCallback:function(elm,status){if(typeof elm.callbackFunction!="undefined"){eval(elm.callbackFunction+"('"+elm.id+"','"+status+"')")}},ajaxError:function(g,f){var e="validate-ajax";var d=Validation.getAdvice(e,g);if(d==null){d=this.createAdvice(e,g,false,f)}this.showAdvice(g,d,"validate-ajax");this.updateCallback(g,"failed");g.addClassName("validation-failed");g.addClassName("validate-ajax");if(Validation.defaultOptions.addClassNameToContainer&&Validation.defaultOptions.containerClassName!=""){var b=g.up(Validation.defaultOptions.containerClassName);if(b&&this.allowContainerClassName(g)){b.removeClassName("validation-passed");b.addClassName("validation-error")}}},allowContainerClassName:function(b){if(b.type=="radio"||b.type=="checkbox"){return b.hasClassName("change-container-classname")}return true},test:function(g,o,l){var d=Validation.get(g);var n="__advice"+g.camelize();try{if(Validation.isVisible(o)&&!d.test($F(o),o)){var f=Validation.getAdvice(g,o);if(f==null){f=this.createAdvice(g,o,l)}this.showAdvice(o,f,g);this.updateCallback(o,"failed");o[n]=1;if(!o.advaiceContainer){o.removeClassName("validation-passed");o.addClassName("validation-failed")}if(Validation.defaultOptions.addClassNameToContainer&&Validation.defaultOptions.containerClassName!=""){var b=o.up(Validation.defaultOptions.containerClassName);if(b&&this.allowContainerClassName(o)){b.removeClassName("validation-passed");b.addClassName("validation-error")}}return false}else{var f=Validation.getAdvice(g,o);this.hideAdvice(o,f);this.updateCallback(o,"passed");o[n]="";o.removeClassName("validation-failed");o.addClassName("validation-passed");if(Validation.defaultOptions.addClassNameToContainer&&Validation.defaultOptions.containerClassName!=""){var b=o.up(Validation.defaultOptions.containerClassName);if(b&&!b.down(".validation-failed")&&this.allowContainerClassName(o)){if(!Validation.get("IsEmpty").test(o.value)||!this.isVisible(o)){b.addClassName("validation-passed")}else{b.removeClassName("validation-passed")}b.removeClassName("validation-error")}}return true}}catch(h){throw (h)}},isVisible:function(b){while(b.tagName!="BODY"){if(!$(b).visible()){return false}b=b.parentNode}return true},getAdvice:function(b,d){return $("advice-"+b+"-"+Validation.getElmID(d))||$("advice-"+Validation.getElmID(d))},createAdvice:function(e,n,l,d){var b=Validation.get(e);var h=l?((n&&n.title)?n.title:b.error):b.error;if(d){h=d}if(jQuery.mage.__){h=jQuery.mage.__(h)}advice='";Validation.insertAdvice(n,advice);advice=Validation.getAdvice(e,n);if($(n).hasClassName("absolute-advice")){var g=$(n).getDimensions();var f=Position.cumulativeOffset(n);advice._adviceTop=(f[1]+g.height)+"px";advice._adviceLeft=(f[0])+"px";advice._adviceWidth=(g.width)+"px";advice._adviceAbsolutize=true}return advice},getElmID:function(b){return b.id?b.id:b.name},reset:function(d){d=$(d);var b=$w(d.className);b.each(function(g){var h="__advice"+g.camelize();if(d[h]){var f=Validation.getAdvice(g,d);if(f){f.hide()}d[h]=""}d.removeClassName("validation-failed");d.removeClassName("validation-passed");if(Validation.defaultOptions.addClassNameToContainer&&Validation.defaultOptions.containerClassName!=""){var e=d.up(Validation.defaultOptions.containerClassName);if(e){e.removeClassName("validation-passed");e.removeClassName("validation-error")}}})},add:function(f,e,g,d){var b={};b[f]=new Validator(f,e,g,d);Object.extend(Validation.methods,b)},addAllThese:function(b){var d={};$A(b).each(function(e){d[e[0]]=new Validator(e[0],e[1],e[2],(e.length>3?e[3]:{}))});Object.extend(Validation.methods,d)},get:function(b){return Validation.methods[b]?Validation.methods[b]:Validation.methods._LikeNoIDIEverSaw_},methods:{_LikeNoIDIEverSaw_:new Validator("_LikeNoIDIEverSaw_","",{})}});Validation.add("IsEmpty","",function(b){return(b==""||(b==null)||(b.length==0)||/^\s+$/.test(b))});Validation.addAllThese([["validate-no-html-tags","HTML tags are not allowed",function(b){return !/<(\/)?\w+/.test(b)}],["validate-select","Please select an option.",function(b){return((b!="none")&&(b!=null)&&(b.length!=0))}],["required-entry","This is a required field.",function(b){return !Validation.get("IsEmpty").test(b)}],["validate-number","Please enter a valid number in this field.",function(b){return Validation.get("IsEmpty").test(b)||(!isNaN(parseNumber(b))&&/^\s*-?\d*(\.\d*)?\s*$/.test(b))}],["validate-number-range","The value is not within the specified range.",function(e,g){if(Validation.get("IsEmpty").test(e)){return true}var f=parseNumber(e);if(isNaN(f)){return false}var d=/^number-range-(-?[\d.,]+)?-(-?[\d.,]+)?$/,b=true;$w(g.className).each(function(l){var h=d.exec(l);if(h){b=b&&(h[1]==null||h[1]==""||f>=parseNumber(h[1]))&&(h[2]==null||h[2]==""||f<=parseNumber(h[2]))}});return b}],["validate-digits","Please use numbers only in this field. Please avoid spaces or other characters such as dots or commas.",function(b){return Validation.get("IsEmpty").test(b)||!/[^\d]/.test(b)}],["validate-digits-range","The value is not within the specified range.",function(e,g){if(Validation.get("IsEmpty").test(e)){return true}var f=parseNumber(e);if(isNaN(f)){return false}var d=/^digits-range-(-?\d+)?-(-?\d+)?$/,b=true;$w(g.className).each(function(l){var h=d.exec(l);if(h){b=b&&(h[1]==null||h[1]==""||f>=parseNumber(h[1]))&&(h[2]==null||h[2]==""||f<=parseNumber(h[2]))}});return b}],["validate-range","The value is not within the specified range.",function(f,l){var g,h;if(Validation.get("IsEmpty").test(f)){return true}else{if(Validation.get("validate-digits").test(f)){g=h=parseNumber(f)}else{var e=/^(-?\d+)?-(-?\d+)?$/.exec(f);if(e){g=parseNumber(e[1]);h=parseNumber(e[2]);if(g>h){return false}}else{return false}}}var d=/^range-(-?\d+)?-(-?\d+)?$/,b=true;$w(l.className).each(function(n){var q=d.exec(n);if(q){var p=parseNumber(q[1]);var o=parseNumber(q[2]);b=b&&(isNaN(p)||g>=p)&&(isNaN(o)||h<=o)}});return b}],["validate-alpha","Please use letters only (a-z or A-Z) in this field.",function(b){return Validation.get("IsEmpty").test(b)||/^[a-zA-Z]+$/.test(b)}],["validate-code","Please use only lowercase letters (a-z), numbers (0-9) or underscore (_) in this field, and the first character should be a letter.",function(b){return Validation.get("IsEmpty").test(b)||/^[a-z]+[a-z0-9_]+$/.test(b)}],["validate-alphanum","Please use only letters (a-z or A-Z) or numbers (0-9) in this field. No spaces or other characters are allowed.",function(b){return Validation.get("IsEmpty").test(b)||/^[a-zA-Z0-9]+$/.test(b)}],["validate-alphanum-with-spaces","Please use only letters (a-z or A-Z), numbers (0-9) or spaces only in this field.",function(b){return Validation.get("IsEmpty").test(b)||/^[a-zA-Z0-9 ]+$/.test(b)}],["validate-street",'Please use only letters (a-z or A-Z), numbers (0-9), spaces and "#" in this field.',function(b){return Validation.get("IsEmpty").test(b)||/^[ \w]{3,}([A-Za-z]\.)?([ \w]*\#\d+)?(\r\n| )[ \w]{3,}/.test(b)}],["validate-phoneStrict","Please enter a valid phone number (Ex: 123-456-7890).",function(b){return Validation.get("IsEmpty").test(b)||/^(\()?\d{3}(\))?(-|\s)?\d{3}(-|\s)\d{4}$/.test(b)}],["validate-phoneLax","Please enter a valid phone number (Ex: 123-456-7890).",function(b){return Validation.get("IsEmpty").test(b)||/^((\d[-. ]?)?((\(\d{3}\))|\d{3}))?[-. ]?\d{3}[-. ]?\d{4}$/.test(b)}],["validate-fax","Please enter a valid fax number (Ex: 123-456-7890).",function(b){return Validation.get("IsEmpty").test(b)||/^(\()?\d{3}(\))?(-|\s)?\d{3}(-|\s)\d{4}$/.test(b)}],["validate-date","Please enter a valid date.",function(b){var d=new Date(b);return Validation.get("IsEmpty").test(b)||!isNaN(d)}],["validate-date-range","Make sure the To Date is later than or the same as the From Date.",function(e,h){var d=/\bdate-range-(\w+)-(\w+)\b/.exec(h.className);if(!d||d[2]=="to"||Validation.get("IsEmpty").test(e)){return true}var f=new Date().getFullYear()+"";var b=function(l){l=l.split(/[.\/]/);if(l[2]&&l[2].length<4){l[2]=f.substr(0,l[2].length)+l[2]}return new Date(l.join("/")).getTime()};var g=Element.select(h.form,".validate-date-range.date-range-"+d[1]+"-to");return !g.length||Validation.get("IsEmpty").test(g[0].value)||b(e)<=b(g[0].value)}],["validate-email","Please enter a valid email address (Ex: johndoe@domain.com).",function(b){return Validation.get("IsEmpty").test(b)||/^([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*@([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*\.(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]){2,})$/i.test(b)}],["validate-emailSender","Please use only visible characters and spaces.",function(b){return Validation.get("IsEmpty").test(b)||/^[\S ]+$/.test(b)}],["validate-password","Please enter 6 or more characters. Leading and trailing spaces will be ignored.",function(b){var d=b.strip();return !(d.length>0&&d.length<6)}],["validate-admin-password","Please enter 7 or more characters, using both numeric and alphabetic.",function(b){var d=b.strip();if(0==d.length){return true}if(!(/[a-z]/i.test(b))||!(/[0-9]/.test(b))){return false}return !(d.length<7)}],["validate-cpassword","Please make sure your passwords match.",function(b){var d=$("confirmation")?$("confirmation"):$$(".validate-cpassword")[0];var g=false;if($("password")){g=$("password")}var h=$$(".validate-password");for(var e=0;e=0}],["validate-zero-or-greater","Please enter a number 0 or greater in this field.",function(b){return Validation.get("validate-not-negative-number").test(b)}],["validate-greater-than-zero","Please enter a number greater than 0 in this field.",function(b){if(Validation.get("IsEmpty").test(b)){return true}b=parseNumber(b);return !isNaN(b)&&b>0}],["validate-state","Please select State/Province.",function(b){return(b!=0||b=="")}],["validate-new-password","Please enter 6 or more characters. Leading and trailing spaces will be ignored.",function(b){if(!Validation.get("validate-password").test(b)){return false}if(Validation.get("IsEmpty").test(b)&&b!=""){return false}return true}],["validate-cc-number","Please enter a valid credit card number.",function(b,e){var d=$(e.id.substr(0,e.id.indexOf("_cc_number"))+"_cc_type");if(d&&typeof Validation.creditCartTypes.get(d.value)!="undefined"&&Validation.creditCartTypes.get(d.value)[2]==false){if(!Validation.get("IsEmpty").test(b)&&Validation.get("validate-digits").test(b)){return true}else{return false}}return validateCreditCard(b)}],["validate-cc-type","Credit card number does not match credit card type.",function(d,g){g.value=removeDelimiters(g.value);d=removeDelimiters(d);var f=$(g.id.substr(0,g.id.indexOf("_cc_number"))+"_cc_type");if(!f){return true}var e=f.value;if(typeof Validation.creditCartTypes.get(e)=="undefined"){return false}if(Validation.creditCartTypes.get(e)[0]==false){return true}var b="";Validation.creditCartTypes.each(function(h){if(h.value[0]&&d.match(h.value[0])){b=h.key;throw $break}});if(b!=e){return false}if(f.hasClassName("validation-failed")&&Validation.isOnChange){Validation.validate(f)}return true}],["validate-cc-type-select","Card type does not match credit card number.",function(d,e){var b=$(e.id.substr(0,e.id.indexOf("_cc_type"))+"_cc_number");if(Validation.isOnChange&&Validation.get("IsEmpty").test(b.value)){return true}if(Validation.get("validate-cc-type").test(b.value,b)){Validation.validate(b)}return Validation.get("validate-cc-type").test(b.value,b)}],["validate-cc-exp","Incorrect credit card expiration date.",function(b,l){var h=b;var g=$(l.id.substr(0,l.id.indexOf("_expiration"))+"_expiration_yr").value;var f=new Date();var e=f.getMonth()+1;var d=f.getFullYear();if(h=n)}});return b}],["validate-percents","Please enter a number lower than 100.",{max:100}],["required-file","Please select a file.",function(d,e){var b=!Validation.get("IsEmpty").test(d);if(b===false){ovId=e.id+"_value";if($(ovId)){b=!Validation.get("IsEmpty").test($(ovId).value)}}return b}],["validate-cc-ukss","Please enter issue number or start date for switch/solo card type.",function(o,g){var b;if(g.id.match(/(.)+_cc_issue$/)){b=g.id.indexOf("_cc_issue")}else{if(g.id.match(/(.)+_start_month$/)){b=g.id.indexOf("_start_month")}else{b=g.id.indexOf("_start_year")}}var f=g.id.substr(0,b);var d=$(f+"_cc_type");if(!d){return true}var n=d.value;if(["SS","SM","SO"].indexOf(n)==-1){return true}$(f+"_cc_issue").advaiceContainer=$(f+"_start_month").advaiceContainer=$(f+"_start_year").advaiceContainer=$(f+"_cc_type_ss_div").down(".adv-container");var h=$(f+"_cc_issue").value;var l=$(f+"_start_month").value;var p=$(f+"_start_year").value;var e=(l&&p)?true:false;if(!e&&!h){return false}return true}]]);function removeDelimiters(b){b=b.replace(/\s/g,"");b=b.replace(/\-/g,"");return b}function parseNumber(b){if(typeof b!="string"){return parseFloat(b)}var e=b.indexOf(".");var d=b.indexOf(",");if(e!=-1&&d!=-1){if(d>e){b=b.replace(".","").replace(",",".")}else{b=b.replace(",","")}}else{if(d!=-1){b=b.replace(",",".")}}return parseFloat(b)}Validation.creditCartTypes=$H({SO:[new RegExp("^(6334[5-9]([0-9]{11}|[0-9]{13,14}))|(6767([0-9]{12}|[0-9]{14,15}))$"),new RegExp("^([0-9]{3}|[0-9]{4})?$"),true],SM:[new RegExp("(^(5[0678])[0-9]{11,18}$)|(^(6[^05])[0-9]{11,18}$)|(^(601)[^1][0-9]{9,16}$)|(^(6011)[0-9]{9,11}$)|(^(6011)[0-9]{13,16}$)|(^(65)[0-9]{11,13}$)|(^(65)[0-9]{15,18}$)|(^(49030)[2-9]([0-9]{10}$|[0-9]{12,13}$))|(^(49033)[5-9]([0-9]{10}$|[0-9]{12,13}$))|(^(49110)[1-2]([0-9]{10}$|[0-9]{12,13}$))|(^(49117)[4-9]([0-9]{10}$|[0-9]{12,13}$))|(^(49118)[0-2]([0-9]{10}$|[0-9]{12,13}$))|(^(4936)([0-9]{12}$|[0-9]{14,15}$))"),new RegExp("^([0-9]{3}|[0-9]{4})?$"),true],VI:[new RegExp("^4[0-9]{12}([0-9]{3})?$"),new RegExp("^[0-9]{3}$"),true],MC:[new RegExp("^5[1-5][0-9]{14}$"),new RegExp("^[0-9]{3}$"),true],AE:[new RegExp("^3[47][0-9]{13}$"),new RegExp("^[0-9]{4}$"),true],DI:[new RegExp("^6(011|4[4-9][0-9]|5[0-9]{2})[0-9]{12}$"),new RegExp("^[0-9]{3}$"),true],JCB:[new RegExp("^(3[0-9]{15}|(2131|1800)[0-9]{11})$"),new RegExp("^[0-9]{3,4}$"),true],OT:[false,new RegExp("^([0-9]{3}|[0-9]{4})?$"),false]});function popWin(d,e,b){var e=window.open(d,e,b);e.focus()}function setLocation(b){window.location.href=b}function setPLocation(d,b){if(b){window.opener.focus()}window.opener.location.href=d}function setLanguageCode(e,f){var b=window.location.href;var h="",g;if(g=b.match(/\#(.*)$/)){b=b.replace(/\#(.*)$/,"");h=g[0]}if(b.match(/[?]/)){var d=/([?&]store=)[a-z0-9_]*/;if(b.match(d)){b=b.replace(d,"$1"+e)}else{b+="&store="+e}var d=/([?&]from_store=)[a-z0-9_]*/;if(b.match(d)){b=b.replace(d,"")}}else{b+="?store="+e}if(typeof f!="undefined"){b+="&from_store="+f}b+=h;setLocation(b)}function decorateGeneric(h,e){var l=["odd","even","first","last"];var d={};var g=h.length;if(g){if(typeof e=="undefined"){e=l}if(!e.length){return}for(var b in l){d[l[b]]=false}for(var b in e){d[e[b]]=true}if(d.first){Element.addClassName(h[0],"first")}if(d.last){Element.addClassName(h[g-1],"last")}for(var f=0;f-1){b="?"+f.substring(d+2);f=f.substring(0,d+1)}return f+e+b}function formatCurrency(n,q,g){var l=isNaN(q.precision=Math.abs(q.precision))?2:q.precision;var v=isNaN(q.requiredPrecision=Math.abs(q.requiredPrecision))?2:q.requiredPrecision;l=v;var t=isNaN(q.integerRequired=Math.abs(q.integerRequired))?1:q.integerRequired;var p=q.decimalSymbol==undefined?",":q.decimalSymbol;var e=q.groupSymbol==undefined?".":q.groupSymbol;var d=q.groupLength==undefined?3:q.groupLength;var u="";if(g==undefined||g==true){u=n<0?"-":g?"+":""}else{if(g==false){u=""}}var h=parseInt(n=Math.abs(+n||0).toFixed(l))+"";var f=h.lengthd?j%d:0;re=new RegExp("(\\d{"+d+"})(?=\\d)","g");var b=(j?h.substr(0,j)+e:"")+h.substr(j).replace(re,"$1"+e)+(l?p+Math.abs(n-h).toFixed(l).replace(/-/,0).slice(2):"");var o="";if(q.pattern.indexOf("{sign}")==-1){o=u+q.pattern}else{o=q.pattern.replace("{sign}",u)}return o.replace("%s",b).replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function expandDetails(d,b){if(Element.hasClassName(d,"show-details")){$$(b).each(function(e){e.hide()});Element.removeClassName(d,"show-details")}else{$$(b).each(function(e){e.show()});Element.addClassName(d,"show-details")}}var isIE=navigator.appVersion.match(/MSIE/)=="MSIE";if(!window.Varien){var Varien=new Object()}Varien.showLoading=function(){var b=$("loading-process");b&&b.show()};Varien.hideLoading=function(){var b=$("loading-process");b&&b.hide()};Varien.GlobalHandlers={onCreate:function(){Varien.showLoading()},onComplete:function(){if(Ajax.activeRequestCount==0){Varien.hideLoading()}}};Ajax.Responders.register(Varien.GlobalHandlers);Varien.searchForm=Class.create();Varien.searchForm.prototype={initialize:function(d,e,b){this.form=$(d);this.field=$(e);this.emptyText=b;Event.observe(this.form,"submit",this.submit.bind(this));Event.observe(this.field,"focus",this.focus.bind(this));Event.observe(this.field,"blur",this.blur.bind(this));this.blur()},submit:function(b){if(this.field.value==this.emptyText||this.field.value==""){Event.stop(b);return false}return true},focus:function(b){if(this.field.value==this.emptyText){this.field.value=""}},blur:function(b){if(this.field.value==""){this.field.value=this.emptyText}}};Varien.DateElement=Class.create();Varien.DateElement.prototype={initialize:function(b,d,f,e){if(b=="id"){this.day=$(d+"day");this.month=$(d+"month");this.year=$(d+"year");this.full=$(d+"full");this.advice=$(d+"date-advice")}else{if(b=="container"){this.day=d.day;this.month=d.month;this.year=d.year;this.full=d.full;this.advice=d.advice}else{return}}this.required=f;this.format=e;this.day.addClassName("validate-custom");this.day.validate=this.validate.bind(this);this.month.addClassName("validate-custom");this.month.validate=this.validate.bind(this);this.year.addClassName("validate-custom");this.year.validate=this.validate.bind(this);this.setDateRange(false,false);this.year.setAttribute("autocomplete","off");this.advice.hide()},validate:function(){var l=false,o=parseInt(this.day.value,10)||0,f=parseInt(this.month.value,10)||0,h=parseInt(this.year.value,10)||0;if(this.day.value.strip().empty()&&this.month.value.strip().empty()&&this.year.value.strip().empty()){if(this.required){l="Please enter a date."}else{this.full.value=""}}else{if(!o||!f||!h){l="Please enter a valid full date."}else{var d=new Date,n=0,e=null;d.setYear(h);d.setMonth(f-1);d.setDate(32);n=32-d.getDate();if(!n||n>31){n=31}if(o<1||o>n){e="day";l="Please enter a valid day (1-%1)."}else{if(f<1||f>12){e="month";l="Please enter a valid month (1-12)."}else{if(o%10==o){this.day.value="0"+o}if(f%10==f){this.month.value="0"+f}this.full.value=this.format.replace(/%[mb]/i,this.month.value).replace(/%[de]/i,this.day.value).replace(/%y/i,this.year.value);var b=this.month.value+"/"+this.day.value+"/"+this.year.value;var g=new Date(b);if(isNaN(g)){l="Please enter a valid date."}else{this.setFullDate(g)}}}var p=false;if(!l&&!this.validateData()){e=this.validateDataErrorType;p=this.validateDataErrorText;l=p}}}if(l!==false){if(jQuery.mage.__){l=jQuery.mage.__(l)}if(!p){this.advice.innerHTML=l.replace("%1",n)}else{this.advice.innerHTML=this.errorTextModifier(l)}this.advice.show();return false}this.day.removeClassName("validation-failed");this.month.removeClassName("validation-failed");this.year.removeClassName("validation-failed");this.advice.hide();return true},validateData:function(){var d=this.fullDate.getFullYear();var b=new Date;this.curyear=b.getFullYear();return d>=1900&&d<=this.curyear},validateDataErrorType:"year",validateDataErrorText:"Please enter a valid year (1900-%1).",errorTextModifier:function(b){return b.replace("%1",this.curyear)},setDateRange:function(b,d){this.minDate=b;this.maxDate=d},setFullDate:function(b){this.fullDate=b}};Varien.DOB=Class.create();Varien.DOB.prototype={initialize:function(b,g,f){var e=$$(b)[0];var d={};d.day=Element.select(e,".dob-day input")[0];d.month=Element.select(e,".dob-month input")[0];d.year=Element.select(e,".dob-year input")[0];d.full=Element.select(e,".dob-full input")[0];d.advice=Element.select(e,".validation-advice")[0];new Varien.DateElement("container",d,g,f)}};Varien.dateRangeDate=Class.create();Varien.dateRangeDate.prototype=Object.extend(new Varien.DateElement(),{validateData:function(){var b=true;if(this.minDate||this.maxValue){if(this.minDate){this.minDate=new Date(this.minDate);this.minDate.setHours(0);if(isNaN(this.minDate)){this.minDate=new Date("1/1/1900")}b=b&&this.fullDate>=this.minDate}if(this.maxDate){this.maxDate=new Date(this.maxDate);this.minDate.setHours(0);if(isNaN(this.maxDate)){this.maxDate=new Date()}b=b&&this.fullDate<=this.maxDate}if(this.maxDate&&this.minDate){this.validateDataErrorText="Please enter a valid date between %s and %s"}else{if(this.maxDate){this.validateDataErrorText="Please enter a valid date less than or equal to %s"}else{if(this.minDate){this.validateDataErrorText="Please enter a valid date equal to or greater than %s"}else{this.validateDataErrorText=""}}}}return b},validateDataErrorText:"Date should be between %s and %s",errorTextModifier:function(b){if(this.minDate){b=b.sub("%s",this.dateFormat(this.minDate))}if(this.maxDate){b=b.sub("%s",this.dateFormat(this.maxDate))}return b},dateFormat:function(b){return b.getMonth()+1+"/"+b.getDate()+"/"+b.getFullYear()}});Varien.FileElement=Class.create();Varien.FileElement.prototype={initialize:function(b){this.fileElement=$(b);this.hiddenElement=$(b+"_value");this.fileElement.observe("change",this.selectFile.bind(this))},selectFile:function(b){this.hiddenElement.value=this.fileElement.getValue()}};Validation.addAllThese([["validate-custom"," ",function(b,d){return d.validate()}]]);Element.addMethods({getInnerText:function(b){b=$(b);if(b.innerText&&!Prototype.Browser.Opera){return b.innerText}return b.innerHTML.stripScripts().unescapeHTML().replace(/[\n\r\s]+/g," ").strip()}});function fireEvent(d,e){var b=document.createEvent("HTMLEvents");b.initEvent(e,true,true);return d.dispatchEvent(b)}function modulo(b,f){var e=f/10000;var d=b%f;if(Math.abs(d-f)b.toFixed(2).toString().length){b=b.toFixed(2)}return b+" "+d[e]};var SessionError=Class.create();SessionError.prototype={initialize:function(b){this.errorText=b},toString:function(){return"Session Error:"+this.errorText}};Ajax.Request.addMethods({initialize:function($super,d,b){$super(b);this.transport=Ajax.getTransport();if(!d.match(new RegExp("[?&]isAjax=true",""))){d=d.match(new RegExp("\\?","g"))?d+"&isAjax=true":d+"?isAjax=true"}if(Object.isString(this.options.parameters)&&this.options.parameters.indexOf("form_key=")==-1){this.options.parameters+="&"+Object.toQueryString({form_key:FORM_KEY})}else{if(!this.options.parameters){this.options.parameters={form_key:FORM_KEY}}if(!this.options.parameters.form_key){this.options.parameters.form_key=FORM_KEY}}this.request(d)},respondToReadyState:function(b){var g=Ajax.Request.Events[b],d=new Ajax.Response(this);if(g=="Complete"){try{this._complete=true;if(d.responseText.isJSON()){var f=d.responseText.evalJSON();if(f.ajaxExpired&&f.ajaxRedirect){window.location.replace(f.ajaxRedirect);throw new SessionError("session expired")}}(this.options["on"+d.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(d,d.headerJSON)}catch(h){this.dispatchException(h);if(h instanceof SessionError){return}}var l=d.getHeader("Content-type");if(this.options.evalJS=="force"||this.options.evalJS&&this.isSameOrigin()&&l&&l.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i)){this.evalResponse()}}try{(this.options["on"+g]||Prototype.emptyFunction)(d,d.headerJSON);Ajax.Responders.dispatch("on"+g,this,d,d.headerJSON)}catch(h){this.dispatchException(h)}if(g=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction}}});Ajax.Updater.respondToReadyState=Ajax.Request.respondToReadyState;var varienLoader=new Class.create();varienLoader.prototype={initialize:function(b){this.callback=false;this.cache=$H();this.caching=b||false;this.url=false},getCache:function(b){if(this.cache.get(b)){return this.cache.get(b)}return false},load:function(b,d,f){this.url=b;this.callback=f;if(this.caching){var e=this.getCache(b);if(e){this.processResult(e);return}}if(typeof d.updaterId!="undefined"){new varienUpdater(d.updaterId,b,{evalScripts:true,onComplete:this.processResult.bind(this),onFailure:this._processFailure.bind(this)})}else{new Ajax.Request(b,{method:"post",parameters:d||{},onComplete:this.processResult.bind(this),onFailure:this._processFailure.bind(this)})}},_processFailure:function(b){location.href=BASE_URL},processResult:function(b){if(this.caching){this.cache.set(this.url,b)}if(this.callback){this.callback(b.responseText)}}};if(!window.varienLoaderHandler){var varienLoaderHandler=new Object()}varienLoaderHandler.handler={onCreate:function(b){if(b.options.loaderArea===false){return}jQuery("body").trigger("processStart")},onException:function(b){jQuery("body").trigger("processStop")},onComplete:function(b){jQuery("body").trigger("processStop")}};function setLoaderPosition(){var e=$("loading_mask_loader");if(e&&Prototype.Browser.IE){var d=e.getDimensions();var f=document.viewport.getDimensions();var b=document.viewport.getScrollOffsets();e.style.left=Math.floor(f.width/2+b.left-d.width/2)+"px";e.style.top=Math.floor(f.height/2+b.top-d.height/2)+"px";e.style.position="absolute"}}function toggleSelectsUnderBlock(f,b){if(Prototype.Browser.IE){var e=document.getElementsByTagName("select");for(var d=0;d');d.document.close();Event.observe(d,"load",function(){var e=d.document.getElementById("image_preview");d.resizeTo(e.width+40,e.height+80)})}}function checkByProductPriceType(b){if(b.id=="price_type"){this.productPriceType=b.value;return false}if(b.id=="price"&&this.productPriceType==0){return false}return true}function toggleSeveralValueElements(f,e,b,d){if(e&&f){if(Object.prototype.toString.call(e)!="[object Array]"){e=[e]}e.each(function(g){toggleValueElements(f,g,b,d)})}}function toggleValueElements(l,d,f,h){if(d&&l){var n=[l];if(typeof f!="undefined"){if(Object.prototype.toString.call(f)!="[object Array]"){f=[f]}for(var g=0;g>2;l=(p&3)<<4|n>>4;g=(n&15)<<2|h>>6;f=h&63;if(isNaN(n)){g=f=64}else{if(isNaN(h)){f=64}}b=b+this._keyStr.charAt(o)+this._keyStr.charAt(l)+this._keyStr.charAt(g)+this._keyStr.charAt(f)}return b},decode:function(e){var b="";var p,n,h;var o,l,g,f;var d=0;if(typeof window.atob==="function"){return Base64._utf8_decode(window.atob(e))}e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(d>4;n=(l&15)<<4|g>>2;h=(g&3)<<6|f;b+=String.fromCharCode(p);if(g!=64){b+=String.fromCharCode(n)}if(f!=64){b+=String.fromCharCode(h)}}return Base64._utf8_decode(b)},mageEncode:function(b){return this.encode(b).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,",")},mageDecode:function(b){b=b.replace(/\-/g,"+").replace(/_/g,"/").replace(/,/g,"=");return this.decode(b)},idEncode:function(b){return this.encode(b).replace(/\+/g,":").replace(/\//g,"_").replace(/=/g,"-")},idDecode:function(b){b=b.replace(/\-/g,"=").replace(/_/g,"/").replace(/\:/g,"+");return this.decode(b)},_utf8_encode:function(d){d=d.replace(/\r\n/g,"\n");var b="";for(var f=0;f127&&e<2048){b+=String.fromCharCode(e>>6|192);b+=String.fromCharCode(e&63|128)}else{b+=String.fromCharCode(e>>12|224);b+=String.fromCharCode(e>>6&63|128);b+=String.fromCharCode(e&63|128)}}}return b},_utf8_decode:function(b){var d="";var e=0;var f=c1=c2=0;while(e191&&f<224){c2=b.charCodeAt(e+1);d+=String.fromCharCode((f&31)<<6|c2&63);e+=2}else{c2=b.charCodeAt(e+1);c3=b.charCodeAt(e+2);d+=String.fromCharCode((f&15)<<12|(c2&63)<<6|c3&63);e+=3}}}return d}};function sortNumeric(d,b){return d-b}(function(){var globals=["Prototype","Abstract","Try","Class","PeriodicalExecuter","Template","$break","Enumerable","$A","$w","$H","Hash","$R","ObjectRange","Ajax","$","Form","Field","$F","Toggle","Insertion","$continue","Position","Windows","Dialog","array","WindowUtilities","Builder","Effect","validateCreditCard","Validator","Validation","removeDelimiters","parseNumber","popWin","setLocation","setPLocation","setLanguageCode","decorateGeneric","decorateTable","decorateList","decorateDataList","parseSidUrl","formatCurrency","expandDetails","isIE","Varien","fireEvent","modulo","byteConvert","SessionError","varienLoader","varienLoaderHandler","setLoaderPosition","toggleSelectsUnderBlock","varienUpdater","setElementDisable","toggleParentVis","toggleFieldsetVis","toggleVis","imagePreview","checkByProductPriceType","toggleSeveralValueElements","toggleValueElements","submitAndReloadArea","syncOnchangeValue","updateElementAtCursor","firebugEnabled","disableElement","enableElement","disableElements","enableElements","Cookie","Fieldset","Base64","sortNumeric","Element","$$","Sizzle","Selector","Window"];globals.forEach(function(prop){window[prop]=eval(prop)})})(); diff --git a/lib/web/prototype/prototype.js b/lib/web/prototype/prototype.js index a2285416d253..19e2374532ea 100644 --- a/lib/web/prototype/prototype.js +++ b/lib/web/prototype/prototype.js @@ -643,7 +643,7 @@ Object.extend(String.prototype, (function () { } function stripTags() { - return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?(\/)?>|<\/\w+>/gi, ''); + return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>'"])+)?\s*("[^">]*|'[^'>])?(\/)?>|<\/\w+>/gi, ''); } function stripScripts() { @@ -1128,7 +1128,7 @@ function $w(string) { return string ? string.split(/\s+/) : []; } -Array.from = $A; +Array.from = Array.from || $A; (function () { @@ -2205,7 +2205,7 @@ Ajax.PeriodicalUpdater = Class.create(Ajax.Base, { function remove(element) { element = $(element); - element.parentNode.removeChild(element); + element.parentNode && element.parentNode.removeChild(element); return element; } diff --git a/pub/media/.htaccess b/pub/media/.htaccess index dad304c1b499..1e536b9b4b61 100644 --- a/pub/media/.htaccess +++ b/pub/media/.htaccess @@ -11,7 +11,7 @@ Options -Indexes AddHandler cgi-script .php .pl .py .jsp .asp .htm .shtml .sh .cgi Options -ExecCGI - + SetHandler default-handler From 52c554447447ca2f400d80243a4c212fefe84d35 Mon Sep 17 00:00:00 2001 From: Ryan Hoerr Date: Mon, 19 Aug 2024 22:40:29 -0400 Subject: [PATCH 2/2] Fixes from comparison --- .../Customer/Model/Plugin/UpdateCustomer.php | 2 +- .../Model/Customer/ValidateCustomerData.php | 70 +++++++++++++++++++ 2 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 app/code/Magento/CustomerGraphQl/Model/Customer/ValidateCustomerData.php diff --git a/app/code/Magento/Customer/Model/Plugin/UpdateCustomer.php b/app/code/Magento/Customer/Model/Plugin/UpdateCustomer.php index 1436453a88fb..28b9bd5cc651 100644 --- a/app/code/Magento/Customer/Model/Plugin/UpdateCustomer.php +++ b/app/code/Magento/Customer/Model/Plugin/UpdateCustomer.php @@ -64,7 +64,7 @@ public function beforeSave( ) { $customer = $this->getUpdatedCustomer($customerRepository->getById($customerId), $customer); } elseif ($customerId && in_array($userType, [UserContextInterface::USER_TYPE_ADMIN, - UserContextInterface::USER_TYPE_INTEGRATION], true) + UserContextInterface::USER_TYPE_INTEGRATION], true) ) { $customer = $this->getUpdatedCustomer($customerRepository->getById($customerId), $customer); } diff --git a/app/code/Magento/CustomerGraphQl/Model/Customer/ValidateCustomerData.php b/app/code/Magento/CustomerGraphQl/Model/Customer/ValidateCustomerData.php new file mode 100644 index 000000000000..95d68d69d71e --- /dev/null +++ b/app/code/Magento/CustomerGraphQl/Model/Customer/ValidateCustomerData.php @@ -0,0 +1,70 @@ +getAllowedCustomerAttributes = $getAllowedCustomerAttributes; + $this->emailAddressValidator = $emailAddressValidator; + $this->validators = $validators; + } + + /** + * Validate customer data + * + * @param array $customerData + * @throws GraphQlInputException + * @throws LocalizedException + * @throws NoSuchEntityException + */ + public function execute(array $customerData) + { + /** @var ValidateCustomerDataInterface $validator */ + foreach ($this->validators as $validator) { + $validator->execute($customerData); + } + } +}