hexsha
string
size
int64
ext
string
lang
string
max_stars_repo_path
string
max_stars_repo_name
string
max_stars_repo_head_hexsha
string
max_stars_repo_licenses
list
max_stars_count
int64
max_stars_repo_stars_event_min_datetime
string
max_stars_repo_stars_event_max_datetime
string
max_issues_repo_path
string
max_issues_repo_name
string
max_issues_repo_head_hexsha
string
max_issues_repo_licenses
list
max_issues_count
int64
max_issues_repo_issues_event_min_datetime
string
max_issues_repo_issues_event_max_datetime
string
max_forks_repo_path
string
max_forks_repo_name
string
max_forks_repo_head_hexsha
string
max_forks_repo_licenses
list
max_forks_count
int64
max_forks_repo_forks_event_min_datetime
string
max_forks_repo_forks_event_max_datetime
string
content
string
avg_line_length
float64
max_line_length
int64
alphanum_fraction
float64
6a3231ecd213a71d641a765a62afd7b76383f5d7
596
js
JavaScript
dist/lib-esm/date/age.js
ruby232/web-standard-functions
7e5cb2138412360c56ad2c42bf36b643b987f5ab
[ "Apache-2.0" ]
null
null
null
dist/lib-esm/date/age.js
ruby232/web-standard-functions
7e5cb2138412360c56ad2c42bf36b643b987f5ab
[ "Apache-2.0" ]
null
null
null
dist/lib-esm/date/age.js
ruby232/web-standard-functions
7e5cb2138412360c56ad2c42bf36b643b987f5ab
[ "Apache-2.0" ]
null
null
null
/** * Returns the difference, in years, between the two parameters. * If the second parameter, which is optional, is omitted, then the default value is the value returned by the function Today() * @param {Date} dateFrom * @param {Date} dateTo * @return number */ import { DateTime } from "luxon"; import { today } from "../date/today"; export var age = function (dateFrom, dateTo) { if (dateTo === undefined) { dateTo = today(); } return Math.trunc( DateTime.fromJSDate(dateTo).diff(DateTime.fromJSDate(dateFrom), "years") .years ); }; //# sourceMappingURL=age.js.map
29.8
127
0.67953
6a328db479571a5d9487fd69679df8a0aa6016b1
5,959
js
JavaScript
client/src/Pages/OrderDetailView/index.js
tomiadebanjo/auftrag
969de3ae0115e0c2d16bb1f75aa33c2b402ede06
[ "MIT" ]
null
null
null
client/src/Pages/OrderDetailView/index.js
tomiadebanjo/auftrag
969de3ae0115e0c2d16bb1f75aa33c2b402ede06
[ "MIT" ]
null
null
null
client/src/Pages/OrderDetailView/index.js
tomiadebanjo/auftrag
969de3ae0115e0c2d16bb1f75aa33c2b402ede06
[ "MIT" ]
null
null
null
import React, { useEffect, useState, useCallback } from 'react'; import { useHistory, useParams, Link } from 'react-router-dom'; import { Card, Form, Input, Button, Switch, message, DatePicker } from 'antd'; import { ArrowLeftOutlined } from '@ant-design/icons'; import Footer from 'Components/Footer'; import NavBar from 'Components/Navbar'; import styles from './index.module.css'; import { getOrderDocument, updateOrder } from 'Services/order.service'; import { formatOrderDetails } from 'Utils/generalHelpers'; const OrderDetailView = () => { const history = useHistory(); const { id } = useParams(); const [editMode, setEditMode] = useState(false); const [form] = Form.useForm(); const [loading, setLoading] = useState(false); const handleInvalidOrder = useCallback(() => { message.error('Order does not exist', 3); history.push('/orders'); }, [history]); const updateFormValues = useCallback( (values) => { form.setFieldsValue(values); }, [form] ); const handleUpdate = async (values) => { try { setLoading(true); const { title, bookingDate } = values; await updateOrder(id, { title, bookingDate: bookingDate.valueOf() }); updateEditMode(false); setLoading(false); message.success('Order update successful', 3); } catch (error) { setLoading(false); console.log(error); message.error('Order update failed', 3); } }; const updateEditMode = (value) => { setEditMode(value); }; useEffect(() => { let subscription; async function fetchOrder() { const order = await getOrderDocument(id); subscription = order.onSnapshot( (snapshot) => { if (snapshot.exists) { const formattedData = formatOrderDetails(snapshot.data()); updateFormValues(formattedData); } else { handleInvalidOrder(); } }, (error) => { message.error('Error fetching order', 3); } ); } fetchOrder(); return () => { subscription(); }; }, [handleInvalidOrder, id, updateFormValues]); return ( <div className={styles.container}> <NavBar /> <main className={styles.mainContent}> <div className={styles.topContent}> <h2 className={styles.topContent_title}>Order Details</h2> <Link to="/orders" className={styles.topContent_link}> <ArrowLeftOutlined style={{ fontSize: '15px' }} /> <span>back to orders</span> </Link> </div> <Card bordered={false}> <div className={styles.switchContainer}> <Switch checked={editMode} onChange={(value) => updateEditMode(value)} /> <span className={styles.switchContainer_text}>Edit Mode</span> </div> <Form layout="vertical" onFinish={handleUpdate} initialValues={{}} className={styles.formContainer} form={form} > <Form.Item label="Order Title" className={styles.formItem} name="title" rules={[ { whitespace: true, required: true, message: 'Please input your order title!', }, ]} > <Input size="large" readOnly={!editMode} /> </Form.Item> <Form.Item label="Booking Date" className={styles.formItem} name="bookingDate" rules={[ { required: true, message: 'Please input your booking date', }, ]} > <DatePicker size="large" style={{ width: '100%' }} allowClear={false} disabled={!editMode} className={styles.datePicker} /> </Form.Item> <Form.Item label="Name" name="name" className={styles.formItem_sm}> <Input size="large" readOnly disabled={editMode} /> </Form.Item> <Form.Item label="Phone" name="phone" className={styles.formItem_sm} > <Input size="large" readOnly disabled={editMode} /> </Form.Item> <Form.Item name="email" label="Email" className={styles.formItem}> <Input size="large" readOnly disabled={editMode} /> </Form.Item> <Form.Item label="Street" name="street" className={styles.formItem_lg} > <Input size="large" readOnly disabled={editMode} /> </Form.Item> <Form.Item label="City" name="city" className={styles.formItem_sm}> <Input size="large" readOnly disabled={editMode} /> </Form.Item> <Form.Item label="Country" name="city" className={styles.formItem_sm} > <Input size="large" readOnly disabled={editMode} /> </Form.Item> <Form.Item label="Zip code" name="zip" className={styles.formItem}> <Input size="large" readOnly disabled={editMode} /> </Form.Item> <Form.Item className={styles.formItem_lg}> {editMode && ( <Button type="primary" htmlType="submit" size="large" className={styles.formItem_button} loading={loading} > Update </Button> )} </Form.Item> </Form> </Card> </main> <Footer /> </div> ); }; export default OrderDetailView;
31.529101
79
0.51418
6a32924b403f25d9ae0bbc62b8cb9c221011fef4
506
js
JavaScript
client/routes.js
auth0-extensions/auth0-user-invite-extension
d8ce25401f5c50d43579c93c0cc77151aa7c41fc
[ "MIT" ]
2
2019-01-01T00:09:00.000Z
2021-06-01T00:48:06.000Z
client/routes.js
auth0-extensions/auth0-user-invite-extension
d8ce25401f5c50d43579c93c0cc77151aa7c41fc
[ "MIT" ]
2
2018-01-29T10:48:19.000Z
2018-11-16T17:57:52.000Z
client/routes.js
auth0-extensions/auth0-user-invite-extension
d8ce25401f5c50d43579c93c0cc77151aa7c41fc
[ "MIT" ]
5
2016-10-06T11:04:42.000Z
2019-01-01T00:09:03.000Z
import * as containers from './containers'; export default { childRoutes: [ { path: '/', component: containers.Root, indexRoute: { component: containers.App }, childRoutes: [ { path: 'configuration', component: containers.ConfigurationContainer, onEnter: () => { return $('#modal-new-users').modal('hide'); // closes any open modals; else 'modal-open' css rule is still in place and scroll does not work } } ] } ] };
24.095238
150
0.577075
6a32dad78b8e870bd8b7cdd0522c4eaf68c9e09e
2,932
js
JavaScript
src/styles/StyledComponents.js
ayumitk/ayumi
4bf30ce5b58a658396608eb6a39b02728cf88d2e
[ "MIT" ]
null
null
null
src/styles/StyledComponents.js
ayumitk/ayumi
4bf30ce5b58a658396608eb6a39b02728cf88d2e
[ "MIT" ]
null
null
null
src/styles/StyledComponents.js
ayumitk/ayumi
4bf30ce5b58a658396608eb6a39b02728cf88d2e
[ "MIT" ]
null
null
null
import styled from 'styled-components'; const Grid = styled.div` display: grid; grid-template-columns: repeat(${props => props.col}, 1fr); column-gap: ${props => props.colGap}rem; row-gap: ${props => props.colGap}rem; @media (max-width: 991.98px) { grid-template-columns: ${props => ((props.col > 2) ? 'repeat(3, 1fr)' : 'repeat(2, 1fr)')}; } @media (max-width: 767.98px) { grid-template-columns: repeat(2, 1fr); } @media (max-width: 565.98px) { grid-template-columns: repeat(1, 1fr); } `; const Container = styled.div` max-width: ${props => props.theme.maxWith}; @media (min-width: 1200px) { margin: 0 auto; } @media (max-width: 1199.98px) { margin: 0 4%; } `; const Input = styled.input` width: 100%; display:block; padding: .375rem .75rem; color: #495057; background-color: #fff; background-clip: padding-box; border: 1px solid #ced4da; border-radius: .25rem; transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out; `; const Label = styled.label` margin-bottom: 1.5rem; display: block; span{ display: inline-block; margin-bottom: .5rem; } `; const Textarea = styled.textarea` width: 100%; display:block; padding: .375rem .75rem; color: #495057; background-color: #fff; background-clip: padding-box; border: 1px solid #ced4da; border-radius: .25rem; transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out; `; const Button = styled.button` background: ${props => props.theme.color.pink}; padding: 1rem 2rem; display: inline-block; color: #FFF; text-decoration: none; &:hover{ opacity: 0.9; text-decoration: none; color: #FFF; } `; const BlogRollGrid = styled.div` display: grid; grid-gap: 50px; grid-template-columns: 1fr 1fr 1fr; @media (max-width: 991.98px) { grid-template-columns: 1fr 1fr; } @media (max-width: 767.98px) { grid-template-columns: 1fr 1fr; } @media (max-width: 565.98px) { grid-template-columns: 1fr; } article{ box-shadow: rgba(39, 44, 49, 0.06) 8px 14px 38px, rgba(39, 44, 49, 0.03) 1px 3px 8px; background: rgb(255, 255, 255); cursor: pointer; transition: all 0.2s ease-out; &:hover{ box-shadow: rgba(39, 44, 49, 0.2) 8px 14px 38px, rgba(39, 44, 49, 0.1) 1px 3px 8px; } a{ display:block; &:hover{ text-decoration: none; } } p{ margin-top: 0.5rem; font-size: 1.5rem; &.date{ color: ${props => props.theme.color.gray}; font-weight: 700; font-size: 1.3rem; } } .blog-roll-grid__inner{ padding: 2rem 2rem 4rem 2rem; } .blog-roll-grid__image{ line-height:0; } } `; const PageTitle = styled.h1` padding: 5rem 0; @media (max-width: 565.98px) { padding: 3rem 0; } `; export { Grid, Container, Input, Label, Textarea, Button, BlogRollGrid, PageTitle, };
22.381679
95
0.615621
6a335797e504ff4b1ca9665e0344547ec22be095
182
js
JavaScript
docs/cpp_algorithms/search/functions_f.js
matbesancon/or-tools
b37d9c786b69128f3505f15beca09e89bf078a89
[ "Apache-2.0" ]
1
2021-07-06T13:01:46.000Z
2021-07-06T13:01:46.000Z
docs/cpp_algorithms/search/functions_f.js
matbesancon/or-tools
b37d9c786b69128f3505f15beca09e89bf078a89
[ "Apache-2.0" ]
null
null
null
docs/cpp_algorithms/search/functions_f.js
matbesancon/or-tools
b37d9c786b69128f3505f15beca09e89bf078a89
[ "Apache-2.0" ]
1
2021-07-24T22:52:41.000Z
2021-07-24T22:52:41.000Z
var searchData= [ ['to_265',['to',['../classoperations__research_1_1_knapsack_search_path.html#af020a457732b35e71f0bce09433ba4f2',1,'operations_research::KnapsackSearchPath']]] ];
36.4
160
0.802198
6a33d613a52632679464d6376a5e5e30eec00c62
528
js
JavaScript
headsupcode/src/components/Timer.js
JdPope/CodeCrown
01a9ee5ef5396f36aa4f51da2fcb04c3b1a26ed3
[ "MIT" ]
5
2019-12-03T18:09:36.000Z
2020-04-20T18:46:07.000Z
headsupcode/src/components/Timer.js
JdPope/CodeCrown
01a9ee5ef5396f36aa4f51da2fcb04c3b1a26ed3
[ "MIT" ]
20
2020-07-07T02:57:54.000Z
2022-02-19T05:24:21.000Z
headsupcode/src/components/Timer.js
JdPope/HeadsUpCode
01a9ee5ef5396f36aa4f51da2fcb04c3b1a26ed3
[ "MIT" ]
1
2020-03-28T20:52:18.000Z
2020-03-28T20:52:18.000Z
import React from 'react'; import { Text } from 'react-native'; import styles from '../styles/style'; const Timer = ({ time }) => { const { timerStyle } = styles; const calcuateTime = () => { const minutes = Math.trunc(time / 60); const secondsCalculation = `${time - (60 * minutes)}`; const seconds = secondsCalculation.length === 1 ? `0${secondsCalculation}` : secondsCalculation; return `${minutes}:${seconds}`; }; return <Text style={timerStyle}>{calcuateTime()}</Text>; }; export default Timer;
27.789474
100
0.643939
6a341d5d01562ef45ef324d7adb1ddcf01956819
4,104
js
JavaScript
z_gitignore/vendor/npm-asset/mathjs/es/function/matrix/partitionSelect.js
p2made/yii_steppewest
e546395eed71e82e9b4e91c6b5e4da0e590cf07d
[ "BSD-3-Clause", "Unlicense" ]
105
2020-11-03T09:50:32.000Z
2022-03-25T16:02:43.000Z
z_gitignore/vendor/npm-asset/mathjs/es/function/matrix/partitionSelect.js
p2made/yii_steppewest
e546395eed71e82e9b4e91c6b5e4da0e590cf07d
[ "BSD-3-Clause", "Unlicense" ]
3
2021-01-02T11:08:17.000Z
2021-11-15T08:05:51.000Z
z_gitignore/vendor/npm-asset/mathjs/es/function/matrix/partitionSelect.js
p2made/yii_steppewest
e546395eed71e82e9b4e91c6b5e4da0e590cf07d
[ "BSD-3-Clause", "Unlicense" ]
22
2020-11-03T15:18:59.000Z
2022-03-29T19:01:16.000Z
import { isMatrix } from '../../utils/is'; import { isInteger } from '../../utils/number'; import { factory } from '../../utils/factory'; var name = 'partitionSelect'; var dependencies = ['typed', 'isNumeric', 'isNaN', 'compare']; export var createPartitionSelect = /* #__PURE__ */factory(name, dependencies, function (_ref) { var typed = _ref.typed, isNumeric = _ref.isNumeric, isNaN = _ref.isNaN, compare = _ref.compare; var asc = compare; var desc = function desc(a, b) { return -compare(a, b); }; /** * Partition-based selection of an array or 1D matrix. * Will find the kth smallest value, and mutates the input array. * Uses Quickselect. * * Syntax: * * math.partitionSelect(x, k) * math.partitionSelect(x, k, compare) * * Examples: * * math.partitionSelect([5, 10, 1], 2) // returns 10 * math.partitionSelect(['C', 'B', 'A', 'D'], 1) // returns 'B' * * function sortByLength (a, b) { * return a.length - b.length * } * math.partitionSelect(['Langdon', 'Tom', 'Sara'], 2, sortByLength) // returns 'Langdon' * * See also: * * sort * * @param {Matrix | Array} x A one dimensional matrix or array to sort * @param {Number} k The kth smallest value to be retrieved zero-based index * @param {Function | 'asc' | 'desc'} [compare='asc'] * An optional comparator function. The function is called as * `compare(a, b)`, and must return 1 when a > b, -1 when a < b, * and 0 when a == b. * @return {*} Returns the kth lowest value. */ return typed(name, { 'Array | Matrix, number': function ArrayMatrixNumber(x, k) { return _partitionSelect(x, k, asc); }, 'Array | Matrix, number, string': function ArrayMatrixNumberString(x, k, compare) { if (compare === 'asc') { return _partitionSelect(x, k, asc); } else if (compare === 'desc') { return _partitionSelect(x, k, desc); } else { throw new Error('Compare string must be "asc" or "desc"'); } }, 'Array | Matrix, number, function': _partitionSelect }); function _partitionSelect(x, k, compare) { if (!isInteger(k) || k < 0) { throw new Error('k must be a non-negative integer'); } if (isMatrix(x)) { var size = x.size(); if (size.length > 1) { throw new Error('Only one dimensional matrices supported'); } return quickSelect(x.valueOf(), k, compare); } if (Array.isArray(x)) { return quickSelect(x, k, compare); } } /** * Quickselect algorithm. * Code adapted from: * https://blog.teamleadnet.com/2012/07/quick-select-algorithm-find-kth-element.html * * @param {Array} arr * @param {Number} k * @param {Function} compare * @private */ function quickSelect(arr, k, compare) { if (k >= arr.length) { throw new Error('k out of bounds'); } // check for NaN values since these can cause an infinite while loop for (var i = 0; i < arr.length; i++) { if (isNumeric(arr[i]) && isNaN(arr[i])) { return arr[i]; // return NaN } } var from = 0; var to = arr.length - 1; // if from == to we reached the kth element while (from < to) { var r = from; var w = to; var pivot = arr[Math.floor(Math.random() * (to - from + 1)) + from]; // stop if the reader and writer meets while (r < w) { // arr[r] >= pivot if (compare(arr[r], pivot) >= 0) { // put the large values at the end var tmp = arr[w]; arr[w] = arr[r]; arr[r] = tmp; --w; } else { // the value is smaller than the pivot, skip ++r; } } // if we stepped up (r++) we need to step one down (arr[r] > pivot) if (compare(arr[r], pivot) > 0) { --r; } // the r pointer is on the end of the first k elements if (k <= r) { to = r; } else { from = r + 1; } } return arr[k]; } });
28.109589
113
0.548977
6a345f3e4555aed08e827a8c95bea493e80d8e07
1,229
js
JavaScript
assets/js/theme.js
HarryHamilton/website
741fc482b747bc46f8abc101ffae64926d7cae9c
[ "MIT" ]
51
2021-07-18T09:07:53.000Z
2022-03-20T15:27:50.000Z
assets/js/theme.js
HarryHamilton/website
741fc482b747bc46f8abc101ffae64926d7cae9c
[ "MIT" ]
17
2021-07-19T12:45:30.000Z
2022-02-04T19:59:12.000Z
assets/js/theme.js
HarryHamilton/website
741fc482b747bc46f8abc101ffae64926d7cae9c
[ "MIT" ]
38
2021-07-22T13:55:22.000Z
2022-03-24T11:37:54.000Z
const light = '{{ index .Site.Params.switch 1 }}' const dark = '{{ index .Site.Params.switch 0 }}' const comment = '{{ .Site.Params.comment }}' const LIGHT = 'light', DARK = 'dark' const themeSwitcher = document.getElementById('theme-switcher') // set switcher themeSwitcher.innerHTML = localStorage.theme === LIGHT ? light : dark themeSwitcher.addEventListener('click', function () { const currentTheme = localStorage.theme const newTheme = currentTheme === LIGHT ? DARK : LIGHT // switch global theme switchMinimaTheme(currentTheme, newTheme) // switch utterance theme if necessary if (comment === 'utterances') switchUtteranceTheme(`github-${newTheme}`) }); function switchMinimaTheme(oldTheme, newTheme) { const { classList } = document.documentElement const text = newTheme === LIGHT ? light : dark; classList.remove(oldTheme); classList.add(newTheme); localStorage.theme = newTheme; themeSwitcher.innerHTML = text; } const utteranceClassName = '.utterances-frame' let utterance; function switchUtteranceTheme(theme) { if (!utterance) utterance = document.querySelector(utteranceClassName) utterance.contentWindow.postMessage({type: 'set-theme', theme}, 'https://utteranc.es') }
30.725
88
0.728234
6a34f744b072f6b5a597d7a382158b12048747dc
1,575
js
JavaScript
lib/egg/context_logger.js
linrf/egg-logger
3e4994cd27b6eaf9ce6065e2e6df4439bee30c46
[ "MIT" ]
null
null
null
lib/egg/context_logger.js
linrf/egg-logger
3e4994cd27b6eaf9ce6065e2e6df4439bee30c46
[ "MIT" ]
null
null
null
lib/egg/context_logger.js
linrf/egg-logger
3e4994cd27b6eaf9ce6065e2e6df4439bee30c46
[ "MIT" ]
null
null
null
'use strict'; const { performance } = require('perf_hooks'); /** * Request context Logger, itself isn't a {@link Logger}. */ class ContextLogger { /** * @class * @param {Context} ctx - egg Context instance * @param {Logger} logger - Logger instance */ constructor(ctx, logger) { this.ctx = ctx; this._logger = logger; } get paddingMessage() { const ctx = this.ctx; // Auto record necessary request context infomation, e.g.: user id, request spend time // format: '[$userId/$ip/$traceId/$use_ms $method $url]' const userId = ctx.userId || '-'; const traceId = ctx.tracer && ctx.tracer.traceId || '-'; let use = 0; if (ctx.performanceStarttime) { use = Math.floor((performance.now() - ctx.performanceStarttime) * 1000) / 1000; } else if (ctx.starttime) { use = Date.now() - ctx.starttime; } return '[' + userId + '/' + ctx.ip + '/' + traceId + '/' + use + 'ms ' + ctx.method + ' ' + ctx.url + ']'; } write(msg) { this._logger.write(msg); } } [ 'error', 'warn', 'info', 'debug' ].forEach(level => { const LEVEL = level.toUpperCase(); ContextLogger.prototype[level] = function() { const meta = { formatter: contextFormatter, paddingMessage: this.paddingMessage, ctx: this.ctx, }; this._logger.log(LEVEL, arguments, meta); }; }); module.exports = ContextLogger; function contextFormatter(meta) { return meta.date + ' ' + meta.level + ' ' + meta.pid + ' ' + meta.paddingMessage + ' ' + meta.message; }
24.230769
104
0.584762
6a3516a9812bd7a8d8e512e99a21a3c35aab35a5
821
js
JavaScript
src/services/httpService.js
liushuirenjialian/kf-protal
cf3bf5016f58ffc69777e140ba140615aeca922f
[ "MIT" ]
null
null
null
src/services/httpService.js
liushuirenjialian/kf-protal
cf3bf5016f58ffc69777e140ba140615aeca922f
[ "MIT" ]
null
null
null
src/services/httpService.js
liushuirenjialian/kf-protal
cf3bf5016f58ffc69777e140ba140615aeca922f
[ "MIT" ]
null
null
null
var request = require('request') var httpService = {} httpService.request = async (ctx, _method, _url, data) => { if (!data) { data = {} } data.requestIP = ctx.request.ip var _headers = {} _headers['user-agent'] = ctx.header['user-agent'] _headers['cookie'] = ctx.header['cookie'] var options = { method: _method, url: _url, headers: _headers, form: data } return new Promise((resolve, reject) => { request(options, function (error, response, body) { var cookies = response.headers['set-cookie'] if (cookies !== undefined) { ctx.set('set-cookie', cookies) } const res = JSON.parse(body) if (!error && response.statusCode === 200) { resolve(res) } else { resolve(res) } }) }) } export default httpService
22.805556
59
0.585871
6a35df39b5d5553747b71ea486b3c5e35c075c94
3,439
js
JavaScript
docs/html/search/all_c.js
elehobica/ESP32-A2DP
46d10a15044a6ffa217f0dff512d1a0a85403abd
[ "Apache-2.0" ]
null
null
null
docs/html/search/all_c.js
elehobica/ESP32-A2DP
46d10a15044a6ffa217f0dff512d1a0a85403abd
[ "Apache-2.0" ]
null
null
null
docs/html/search/all_c.js
elehobica/ESP32-A2DP
46d10a15044a6ffa217f0dff512d1a0a85403abd
[ "Apache-2.0" ]
null
null
null
var searchData= [ ['sample_5frate_0',['sample_rate',['../class_bluetooth_a2_d_p_sink.html#a09a8b269e2a936c5517bd9f88f666a1c',1,'BluetoothA2DPSink']]], ['set_5faddress_5fvalidator_1',['set_address_validator',['../class_bluetooth_a2_d_p_sink.html#ad25155f02bad11da6c130aae00c8ab9c',1,'BluetoothA2DPSink']]], ['set_5favrc_5fmetadata_5fcallback_2',['set_avrc_metadata_callback',['../class_bluetooth_a2_d_p_sink.html#aac9074521c80d7574a855f30b8301d13',1,'BluetoothA2DPSink']]], ['set_5fbits_5fper_5fsample_3',['set_bits_per_sample',['../class_bluetooth_a2_d_p_sink.html#a9ebe4927600f29318133b5f11e0ab7f8',1,'BluetoothA2DPSink']]], ['set_5fchannels_4',['set_channels',['../class_bluetooth_a2_d_p_sink.html#abc8a4564e135ace22d31c2231f1a0696',1,'BluetoothA2DPSink']]], ['set_5fi2s_5fconfig_5',['set_i2s_config',['../class_bluetooth_a2_d_p_sink.html#a39329de792f43f90a16f9ab2ee62814f',1,'BluetoothA2DPSink']]], ['set_5fi2s_5fport_6',['set_i2s_port',['../class_bluetooth_a2_d_p_sink.html#ab4e52dff7ef08f17cfce4e011cdd6542',1,'BluetoothA2DPSink']]], ['set_5fmono_5fdownmix_7',['set_mono_downmix',['../class_bluetooth_a2_d_p_sink.html#a624040cce89a4a2f66495f57db6c1457',1,'BluetoothA2DPSink']]], ['set_5fnvs_5finit_8',['set_nvs_init',['../class_bluetooth_a2_d_p_source.html#ac3825c8750538c5b25ba0082c30ec7ae',1,'BluetoothA2DPSource']]], ['set_5fon_5fconnected2bt_9',['set_on_connected2BT',['../class_bluetooth_a2_d_p_sink.html#ae1c61ea5cc7d2e5ade20889f4929fd06',1,'BluetoothA2DPSink']]], ['set_5fon_5fdata_5freceived_10',['set_on_data_received',['../class_bluetooth_a2_d_p_sink.html#af65219e635fadbbc90f4663b33abd3e0',1,'BluetoothA2DPSink']]], ['set_5fon_5fdis_5fconnected2bt_11',['set_on_dis_connected2BT',['../class_bluetooth_a2_d_p_sink.html#a468e0db979c2e0bd52821489bebfa4d0',1,'BluetoothA2DPSink']]], ['set_5fon_5fvolumechange_12',['set_on_volumechange',['../class_bluetooth_a2_d_p_sink.html#ac245103d3d5c47b0414c2de21c0d52a7',1,'BluetoothA2DPSink']]], ['set_5fpin_5fcode_13',['set_pin_code',['../class_bluetooth_a2_d_p_source.html#a615fbfaeb4cad862209fa4b3c2c8286c',1,'BluetoothA2DPSource']]], ['set_5fpin_5fconfig_14',['set_pin_config',['../class_bluetooth_a2_d_p_sink.html#af7ce8131af4f085e94eb81e3fcbfc4af',1,'BluetoothA2DPSink']]], ['set_5freset_5fble_15',['set_reset_ble',['../class_bluetooth_a2_d_p_source.html#a5efcc4c32c6ec8ce7eac2c1acb59f27c',1,'BluetoothA2DPSource']]], ['set_5fstream_5freader_16',['set_stream_reader',['../class_bluetooth_a2_d_p_sink.html#a4f94426ff4899c437d31623e013cf7a5',1,'BluetoothA2DPSink']]], ['set_5fvolume_17',['set_volume',['../class_bluetooth_a2_d_p_sink.html#a507e30ececfdc4382af60a0319cdaf1b',1,'BluetoothA2DPSink']]], ['sig_18',['sig',['../structapp__msg__t.html#aa9e22bf7fadbb972d0ea4e8841565d36',1,'app_msg_t']]], ['sounddata_19',['SoundData',['../class_sound_data.html',1,'']]], ['start_20',['start',['../class_bluetooth_a2_d_p_sink.html#a8d6eae21dcf699b671b897f53498eaa9',1,'BluetoothA2DPSink::start()'],['../class_bluetooth_a2_d_p_source.html#aa65904308e4f59ee23c95736586902af',1,'BluetoothA2DPSource::start(const char *name, music_data_channels_cb_t callback=NULL, bool is_ssp_enabled=false)']]], ['start_5fraw_21',['start_raw',['../class_bluetooth_a2_d_p_source.html#a5be617acbdef18f2b87efe08d08e5536',1,'BluetoothA2DPSource']]], ['stop_22',['stop',['../class_bluetooth_a2_d_p_sink.html#a37dcbcd418b84310ccedf3330e44834f',1,'BluetoothA2DPSink']]] ];
127.37037
322
0.808084
6a360afa8764e421c9e63ec11355eed60b70c250
12,671
js
JavaScript
test/unit/bookmarklet-tests.js
compiuta/openwhyd
ea404bf62c3944cead103f90c24d887b7d7a1690
[ "MIT" ]
null
null
null
test/unit/bookmarklet-tests.js
compiuta/openwhyd
ea404bf62c3944cead103f90c24d887b7d7a1690
[ "MIT" ]
null
null
null
test/unit/bookmarklet-tests.js
compiuta/openwhyd
ea404bf62c3944cead103f90c24d887b7d7a1690
[ "MIT" ]
null
null
null
/* global describe, it, before, after */ const assert = require('assert'); const { makeBookmarklet, pageDetectors, openwhydYouTubeExtractor, makeFileDetector, makeStreamDetector, } = require('./../../public/js/bookmarklet.js'); const bookmarklet = makeBookmarklet({ pageDetectors }); const YOUTUBE_VIDEO = { id: 'uWB8plk9sXk', title: 'Harissa - Tierra', img: `https://i.ytimg.com/vi/uWB8plk9sXk/default.jpg`, url: `https://www.youtube.com/watch?v=uWB8plk9sXk`, elementsByTagName: { 'ytd-watch-flexy': [ { role: 'main', 'video-id': 'uWB8plk9sXk', }, ], }, }; const makeElement = (attributes) => ({ ...attributes, getAttribute: (attr) => attributes[attr], }); const makeWindow = ({ url = '', title = '', elementsByTagName = {} }) => ({ location: { href: url }, document: { title, getElementsByTagName: (tagName) => (elementsByTagName[tagName] || []).map(makeElement), // TODO: getElementsByClassName() }, }); const detectTracksAsPromise = ({ window, urlPrefix, urlDetectors = [] }) => new Promise((resolve) => { const tracks = []; bookmarklet.detectTracks({ window, ui: { addThumb: (track) => tracks.push(track), addSearchThumb: (track) => tracks.push(track), finish: () => resolve(tracks), }, urlDetectors, urlPrefix, }); }); describe('bookmarklet', () => { before(() => { // disable console.info() calls from bookmarklet, to reduce noise in tests output this.consoleBackup = console; console = { ...console, info() {} }; // eslint-disable-line no-global-assign, @typescript-eslint/no-empty-function }); after(() => { // restore console console = this.consoleBackup; // eslint-disable-line no-global-assign }); it('should return a search link when no tracks were found on the page', async () => { const window = makeWindow({ title: 'dummy title' }); const results = await detectTracksAsPromise({ window }); assert.equal(typeof results, 'object'); assert.equal(results.length, 1); assert.equal(results[0].searchQuery, window.document.title); }); it('should return the default cover art with right prefix, for a MP3 file', async () => { const window = makeWindow({ elementsByTagName: { a: [ { href: 'https://test.com/music.mp3', textContent: `a random MP3 file`, }, ], }, }); const urlPrefix = 'https://openwhyd.org'; const results = await detectTracksAsPromise({ window, urlDetectors: [makeFileDetector()], urlPrefix, }); assert.equal(typeof results, 'object'); assert.equal(results.length, 1); assert.equal(results[0].img, `${urlPrefix}/images/cover-audiofile.png`); }); it('should return the track title from a Spotify page', async () => { const songTitle = 'Dummy Song'; const window = makeWindow({ url: 'https://open.spotify.com/album/0EX4lJA3CFaKIvjFJyYIpe?highlight=spotify:track:0P41Qf51RcEWId6W6RykV4', title: `${songTitle} - Spotify`, }); const results = await detectTracksAsPromise({ window }); assert.equal(typeof results, 'object'); assert.equal(results.length, 1); assert.equal(results[0].searchQuery, songTitle); }); it('should return the track url and title from a YouTube page', async () => { const window = makeWindow({ url: YOUTUBE_VIDEO.url, title: `${YOUTUBE_VIDEO.title} - YouTube`, elementsByTagName: YOUTUBE_VIDEO.elementsByTagName, }); const results = await detectTracksAsPromise({ window }); assert.equal(typeof results, 'object'); assert.equal(results.length, 1); assert.equal(results[0].name, YOUTUBE_VIDEO.title); }); it('should return the track metadata from a YouTube page when its detector is provided', async () => { const window = makeWindow({ url: YOUTUBE_VIDEO.url, title: `${YOUTUBE_VIDEO.title} - YouTube`, elementsByTagName: YOUTUBE_VIDEO.elementsByTagName, }); const playerId = 'yt'; const detectors = { [playerId]: openwhydYouTubeExtractor }; const results = await detectTracksAsPromise({ window, urlDetectors: [makeStreamDetector(detectors)], }); assert.equal(typeof results, 'object'); assert.equal(results.length, 1); const track = results[0]; assert.equal(track.id, YOUTUBE_VIDEO.id); assert.equal(track.title, YOUTUBE_VIDEO.title); assert.equal(track.img, YOUTUBE_VIDEO.img); assert.equal(track.eId, `/${playerId}/${YOUTUBE_VIDEO.id}`); assert.equal(track.sourceId, playerId); }); it(`should return a track with metadata from a YouTube page that lists that track as a link`, async () => { const window = makeWindow({ elementsByTagName: { a: [ { href: YOUTUBE_VIDEO.url, textContent: YOUTUBE_VIDEO.title, }, ], }, }); const playerId = 'yt'; const detectors = { [playerId]: openwhydYouTubeExtractor }; const results = await detectTracksAsPromise({ window, urlDetectors: [makeStreamDetector(detectors)], }); assert.equal(typeof results, 'object'); assert.equal(results.length, 1); const track = results[0]; assert.equal(track.id, YOUTUBE_VIDEO.id); assert.equal(track.title, YOUTUBE_VIDEO.title); assert.equal(track.img, YOUTUBE_VIDEO.img); assert.equal(track.eId, `/${playerId}/${YOUTUBE_VIDEO.id}`); assert.equal(track.sourceId, playerId); }); it(`should return a track with the expected name when that track was found as a link from a YouTube page`, async () => { const window = makeWindow({ elementsByTagName: { a: [ { href: YOUTUBE_VIDEO.url, textContent: `\n${YOUTUBE_VIDEO.title}\nHarissa Quartet\nVerified\n•287K views\n`, }, ], }, }); const playerId = 'yt'; const detectors = { [playerId]: openwhydYouTubeExtractor }; const results = await detectTracksAsPromise({ window, urlDetectors: [makeStreamDetector(detectors)], }); assert.equal(typeof results, 'object'); assert.equal(results.length, 1); const track = results[0]; assert.equal(track.id, YOUTUBE_VIDEO.id); assert.equal(track.title, YOUTUBE_VIDEO.title); assert.equal(track.img, YOUTUBE_VIDEO.img); assert.equal(track.eId, `/${playerId}/${YOUTUBE_VIDEO.id}`); assert.equal(track.sourceId, playerId); }); it(`should return the page's track with metadata from a YouTube page when the same track is also listed in the page with less metadata`, async () => { const window = makeWindow({ url: YOUTUBE_VIDEO.url, title: `${YOUTUBE_VIDEO.title} - YouTube`, elementsByTagName: YOUTUBE_VIDEO.elementsByTagName, }); const playerId = 'yt'; const detectors = { [playerId]: openwhydYouTubeExtractor }; const results = await detectTracksAsPromise({ window, urlDetectors: [makeStreamDetector(detectors)], }); assert.equal(typeof results, 'object'); assert.equal(results.length, 1); const track = results[0]; assert.equal(track.id, YOUTUBE_VIDEO.id); assert.equal(track.title, YOUTUBE_VIDEO.title); assert.equal(track.img, YOUTUBE_VIDEO.img); assert.equal(track.eId, `/${playerId}/${YOUTUBE_VIDEO.id}`); assert.equal(track.sourceId, playerId); }); describe('File Detector', () => { it('should not require an element', async () => { const detectFile = makeFileDetector(); const url = `http://myblog/myfile.mp3`; const element = undefined; const track = await new Promise((cb) => detectFile(url, cb, element)); assert.equal(typeof track, 'object'); assert.equal(track.id, url); }); it('should return a mp3 file from a URL', async () => { const detectFile = makeFileDetector(); const url = `http://myblog/myfile.mp3`; const track = await new Promise((cb) => detectFile(url, cb)); assert.equal(typeof track, 'object'); assert.equal(track.id, url); }); it('should return a ogg file from a URL', async () => { const detectFile = makeFileDetector(); const url = `http://myblog/myfile.ogg`; const track = await new Promise((cb) => detectFile(url, cb)); assert.equal(typeof track, 'object'); assert.equal(track.id, url); }); it('should not return duplicates', async () => { const detectFile = makeFileDetector(); const url = `http://myblog/myfile.ogg`; const detect = () => new Promise((cb) => detectFile(url, cb)); assert.equal(typeof (await detect()), 'object'); assert.equal(typeof (await detect()), 'undefined'); }); it('should return the name of the file as name of the track', async () => { const detectFile = makeFileDetector(); const fileName = 'myfile'; const url = `http://myblog/${fileName}.mp3`; const track = await new Promise((cb) => detectFile(url, cb)); assert.equal(typeof track, 'object'); assert.equal(track.title, fileName); }); it('should return the title of the link as name of the track', async () => { const detectFile = makeFileDetector(); const url = `http://myblog/myfile.mp3`; const title = 'my track'; const element = { title }; const track = await new Promise((cb) => detectFile(url, cb, element)); assert.equal(typeof track, 'object'); assert.equal(track.title, title); }); it('should return the cleaned-up inner text of the link as name of the track', async () => { const detectFile = makeFileDetector(); const url = `http://myblog/myfile.mp3`; const title = 'my track'; const element = { innerText: ` \n ${title}\n ` }; const track = await new Promise((cb) => detectFile(url, cb, element)); assert.equal(typeof track, 'object'); assert.equal(track.title, title); }); it('should return the cleaned-up text content of the link as name of the track', async () => { const detectFile = makeFileDetector(); const url = `http://myblog/myfile.mp3`; const title = 'my track'; const element = { textContent: ` \n ${title}\n ` }; const track = await new Promise((cb) => detectFile(url, cb, element)); assert.equal(typeof track, 'object'); assert.equal(track.title, title); }); }); describe('Stream Detector', () => { it('should return nothing when no players were provided', async () => { const { url } = YOUTUBE_VIDEO; const players = {}; const detectStreams = makeStreamDetector(players); const track = await new Promise((cb) => detectStreams(url, cb)); assert.equal(typeof track, 'undefined'); }); it('should return a track from its URL when a simple detector was provided', async () => { const { url } = YOUTUBE_VIDEO; const playerId = 'yt'; const detectors = { [playerId]: { getEid: openwhydYouTubeExtractor.getEid }, }; const detectStreams = makeStreamDetector(detectors); const track = await new Promise((cb) => detectStreams(url, cb)); assert.equal(typeof track, 'object'); assert.equal(track.eId, `/${playerId}/${YOUTUBE_VIDEO.id}`); }); it('should return a track from its URL when a complete detector was provided', async () => { const { url } = YOUTUBE_VIDEO; const playerId = 'yt'; const detectors = { [playerId]: { getEid: () => YOUTUBE_VIDEO.id, fetchMetadata: (url, callback) => callback({ id: YOUTUBE_VIDEO.id, title: YOUTUBE_VIDEO.title, img: YOUTUBE_VIDEO.img, }), }, }; const detectStreams = makeStreamDetector(detectors); const track = await new Promise((cb) => detectStreams(url, cb)); assert.equal(typeof track, 'object'); assert.equal(track.id, YOUTUBE_VIDEO.id); assert.equal(track.title, YOUTUBE_VIDEO.title); assert.equal(track.img, YOUTUBE_VIDEO.img); assert.equal(track.eId, `/${playerId}/${YOUTUBE_VIDEO.id}`); assert.equal(track.sourceId, playerId); }); }); }); /** * How to manually test the bookmarklet * // 1. Make sure that openwhyd is running locally // 2. In your web browser, open a web page that contains videos // 3. In the page's JavaScript console, Load the local bookmarket: window.document.body.appendChild( window.document.createElement('script') ).src = `http://localhost:8080/js/bookmarklet.js?${Date.now()}`; * **/
35.295265
152
0.625996
6a361a3987a2c79d1e7af6e43ecb0fe9368e16df
1,557
js
JavaScript
src/_js/polyfills.js
Svish/php-weblib
3383195643382a2618a02b5f9ad2b88f051f04a7
[ "MIT" ]
null
null
null
src/_js/polyfills.js
Svish/php-weblib
3383195643382a2618a02b5f9ad2b88f051f04a7
[ "MIT" ]
null
null
null
src/_js/polyfills.js
Svish/php-weblib
3383195643382a2618a02b5f9ad2b88f051f04a7
[ "MIT" ]
null
null
null
/** * String.superTrim * Trims and replaces all whitespace with single spaces. */ String.prototype.superTrim = function() { return this.trim().replace(/\s+/g, ' '); }; /** * PolyFill: String.contains * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes#Polyfill */ String.prototype.includes = String.prototype.includes || function(search, start) { if (typeof start !== 'number') start = 0; if (start + search.length > this.length) return false; else return this.indexOf(search, start) !== -1; }; /** * PolyFill: Regexp.escape * @https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions */ RegExp.escape = function(string) { return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string } /** * PolyFill: Number.isInteger * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger#Polyfill */ Number.isInteger = Number.isInteger || function(value) { return typeof value === 'number' && isFinite(value) && Math.floor(value) === value; }; /** * Get GET parameter value * @see http://stackoverflow.com/a/5448595/39321 */ function getQueryParameter(name, clean = true) { var query = window.location.search.substring(1); var vars = query.split("&"); for(var i in vars) { var pair = vars[i].split("="); if(pair[0] == name) { var value = decodeURIComponent(pair[1]); return clean ? value.replace(/\+/g, ' ') : value; } } return false; }
20.76
114
0.661529
6a361e5cb7e461bf051287293ee81c18d5fcb3c7
274
js
JavaScript
frontend/src/comment.js
ph3nomforko/book_review
b955edda52754b116fc34bcc15be8889f6e3efeb
[ "Unlicense" ]
1
2021-11-23T21:18:31.000Z
2021-11-23T21:18:31.000Z
frontend/src/comment.js
ph3nomforko/book_review
b955edda52754b116fc34bcc15be8889f6e3efeb
[ "Unlicense" ]
null
null
null
frontend/src/comment.js
ph3nomforko/book_review
b955edda52754b116fc34bcc15be8889f6e3efeb
[ "Unlicense" ]
null
null
null
class Comment { constructor(comment) { this.id = comment.id this.content = comment.attributes.content this.username = comment.attributes.username this.book = comment.attributes.book Comment.all.push(this) } } Comment.all = []
24.909091
51
0.635036
6a36575844bba2f16a3a84e4993282637f42414e
2,183
js
JavaScript
packages/reports/tests/integration/components/filter-values/date-range-test.js
Ruiqian1/navi
2348ea4f6ff8c1683f597fdb83a25a5c3c3f65c2
[ "MIT" ]
null
null
null
packages/reports/tests/integration/components/filter-values/date-range-test.js
Ruiqian1/navi
2348ea4f6ff8c1683f597fdb83a25a5c3c3f65c2
[ "MIT" ]
null
null
null
packages/reports/tests/integration/components/filter-values/date-range-test.js
Ruiqian1/navi
2348ea4f6ff8c1683f597fdb83a25a5c3c3f65c2
[ "MIT" ]
null
null
null
import { A } from '@ember/array'; import { run } from '@ember/runloop'; import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { render } from '@ember/test-helpers'; import $ from 'jquery'; import hbs from 'htmlbars-inline-precompile'; import Duration from 'navi-core/utils/classes/duration'; import Interval from 'navi-core/utils/classes/interval'; module('Integration | Component | filter values/date range', function(hooks) { setupRenderingTest(hooks); hooks.beforeEach(async function() { this.filter = { values: [] }; this.request = { logicalTable: { timeGrain: { name: 'day' } } }; this.onUpdateFilter = () => null; await render(hbs`{{filter-values/date-range filter=filter request=request onUpdateFilter=(action onUpdateFilter) }}`); }); test('it renders', function(assert) { assert.expect(3); assert .dom('.date-range__select-trigger') .hasText('Select date range', 'Placeholder text is present when no date range is selected'); assert.deepEqual( $('.predefined-range') .map(function() { return $(this) .text() .trim(); }) .get(), [ 'Last Day', 'Last 7 Days', 'Last 14 Days', 'Last 30 Days', 'Last 60 Days', 'Last 90 Days', 'Last 180 Days', 'Last 400 Days' ], 'Predefined ranges are set based on the request time grain' ); run(() => { let selectedInterval = new Interval(new Duration('P7D'), 'current'); this.set('filter', { values: A([selectedInterval]) }); }); assert.dom('.date-range__select-trigger').hasText('Last 7 Days', 'Trigger text is updated with selected interval'); }); test('changing values', function(assert) { assert.expect(1); this.set('onUpdateFilter', changeSet => { let expectedInterval = new Interval(new Duration('P7D'), 'current'); assert.ok(changeSet.interval.isEqual(expectedInterval), 'Selected interval is given to update action'); }); $('.predefined-range:contains(Last 7 Days)').click(); }); });
29.90411
119
0.608337
6a36831d2a9f3b6421e4f7a8599887700fdbff56
4,364
js
JavaScript
www/js/deviceready/fs.js
Noldor85/condrpxdenominusadm
1f7b81ce717d63c89f8880bf001b005e3f0fbeab
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
www/js/deviceready/fs.js
Noldor85/condrpxdenominusadm
1f7b81ce717d63c89f8880bf001b005e3f0fbeab
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
www/js/deviceready/fs.js
Noldor85/condrpxdenominusadm
1f7b81ce717d63c89f8880bf001b005e3f0fbeab
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
// device APIs are available // dirc = null; onFileSystemSuccess = function(dir){ if (device.platform.toLowerCase() == "android") { dirc = dir; }else{ dirc = dir.root } } function onDeviceReady_fm() { try{ if (device.platform.toLowerCase() == "android") { window.resolveLocalFileSystemURL(cordova.file.externalRootDirectory,onFileSystemSuccess, failFS); } else { window.requestFileSystem(LocalFileSystem.PERSISTENT, 0,onFileSystemSuccess, failFS); } }catch(e){ console.log(e) } } function pathToFileEntry(path,cb) { if (device.platform.toLowerCase() == "android") { window.resolveLocalFileSystemURL(path,cb, failFS); } else { window.requestFileSystem(path, 0,onFileSystemSuccess, failFS); } } function readDataUrl(file,cb) { var reader = new FileReader(); reader.onloadend = function(evt) { console.log("Read as data URL"); cb(evt.target.result); }; reader.readAsDataURL(file); } jQuery.fn.extend({ displayImageByFileURL : function(fileEntry) { this.prop("src", fileEntry.toURL()); } }) function download(fileEntry, uri,dcb) { var fileTransfer = new FileTransfer(); var fileURL = fileEntry.toURL(); fileTransfer.download( uri, fileURL, function (entry) { console.log("Successful download..."); console.log("download complete: " + entry.toURL()); dcb(entry) }, function (error) { console.log("download error source " + error.source); console.log("download error target " + error.target); console.log("upload error code" + error.code); window.plugins.toast.showLongCenter("Error downloading file") }, null, // or, pass false { //headers: { // "Authorization": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA==" //} } ); } function saveDoc(url,dcb,fail) { var fn = getNameFromUrl(url) if(dirc == null){ onDeviceReady_fm()} dirc.getDirectory(directory, { create: true }, function (dirEntry) { dirEntry.getDirectory(fn.ext, { create: true }, function (subDirEntry) { subDirEntry.getFile(fn.fullName, { create: true, exclusive: false }, function (fileEntry) { download(fileEntry, url,dcb); }, fail); }, fail); }, fail); } function openDoc(file, mime){ var fn = getNameFromUrl(file) cordova.plugins.fileOpener2.open( dirc.nativeURL + directory + "/" + fn.ext + "/" + file, mime, { error : function(e) { console.log('Error status: ' + e.status + ' - Error message: ' + e.message); }, success : function () { console.log('file opened successfully'); } } ); } function docExist(file,yesFx,noFx){ var fn = getNameFromUrl(file) if(dirc == null){ onDeviceReady_fm()} dirc.getDirectory(directory, { create: false }, function (dirEntry) { dirEntry.getDirectory(fn.ext, { create: false }, function (subDirEntry) { subDirEntry.getFile(fn.fullName, { create: false, exclusive: false }, function (fileEntry) { yesFx(fileEntry) }, noFx); }, noFx); }, noFx); } function failFS(e) { console.log(e) var msg = ''; switch (e.code) { case FileError.NOT_FOUND_ERR: msg = 'NOT_FOUND_ERR Error'; break; case FileError.SECURITY_ERR: msg = 'SECURITY_ERR Error'; break; case FileError.ABORT_ERR: msg = 'ABORT_ERR Error'; break; case FileError.NOT_READABLE_ERR: msg = 'NOT_READABLE_ERR Error'; break; case FileError.ENCODING_ERR: msg = 'ENCODING_ERR Error'; break; case FileError.NO_MODIFICATION_ALLOWED_ERR: msg = 'NO_MODIFICATION_ALLOWED_ERR Error'; break; case FileError.INVALID_STATE_ERR: msg = 'INVALID_STATE_ERR Error'; break; case FileError.SYNTAX_ERR: msg = 'SYNTAX_ERR Error'; break; case FileError.INVALID_MODIFICATION_ERR: msg = 'INVALID_MODIFICATION_ERR Error'; break; case FileError.QUOTA_EXCEEDED_ERR: msg = 'QUOTA_EXCEEDED_ERR Error'; break; case FileError.TYPE_MISMATCH_ERR: msg = 'TYPE_MISMATCH_ERR Error'; break; case FileError.PATH_EXISTS_ERR: msg = 'PATH_EXISTS_ERR'; break; default: msg = 'Unknown Error'; break; }; // alert('Error: ' + msg); }
21.929648
103
0.628093
6a36dd9d74b6b1ae4d7f8199a4018d8ef832a306
2,092
js
JavaScript
src/pages/project-portfolio.js
heyheywin/heyheywin.github.io
611d5901b585163cd6c4bb706789c27520a1e6ad
[ "MIT" ]
null
null
null
src/pages/project-portfolio.js
heyheywin/heyheywin.github.io
611d5901b585163cd6c4bb706789c27520a1e6ad
[ "MIT" ]
19
2021-03-10T14:53:19.000Z
2022-02-27T15:16:59.000Z
src/pages/project-portfolio.js
heyheywin/heyheywin.github.io
611d5901b585163cd6c4bb706789c27520a1e6ad
[ "MIT" ]
null
null
null
import React from "react" import { Link } from "gatsby" import Media from 'react-media' import Layout from "../components/layout" import SEO from "../components/seo" import SimpleSwiper from "../components/swiper" const SecondPage = () => { return ( <div> <Media queries={{ mobile: "(max-width: 599px)", desktop: "(min-width: 600px)", }}> {matches => ( <React.Fragment> {matches.mobile && <React.Fragment> <Layout> <SEO title="Project Portfolio" /> <div className="main-container"> <h4 style={{borderBottom: `1px solid #000`, paddingBottom: `3px`}}>Project Portfolio</h4> <SimpleSwiper></SimpleSwiper> </div> </Layout> </React.Fragment> } {matches.desktop && <React.Fragment> <div style={{display: `flex`, marginTop:`7vh`}} > <div style={{minWidth: 350, paddingLeft: `1em`}}> <Layout> <SEO title="Project Portfolio" /> </Layout> </div> <div style={{maxWidth:1000, padding: `4em 2em 2em 0`, width:`0 auto`, margin: `0 auto`,}}> <h4 style={{borderBottom: `1px solid #000`, paddingBottom: `3px`}}>Project Portfolio</h4> <SimpleSwiper></SimpleSwiper> </div> </div> </React.Fragment>} </React.Fragment> )} </Media> </div> ); } export default SecondPage
29.055556
113
0.375717
6a371af6d639c78ef3c11669d50569d84851cca7
4,659
js
JavaScript
sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_creates_a_thread.js
v-tsun/azure-sdk-for-js
694c3b7f99151609e733fa7a2b5dbfce43816a34
[ "MIT" ]
1
2021-08-22T18:02:55.000Z
2021-08-22T18:02:55.000Z
sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_creates_a_thread.js
v-tsun/azure-sdk-for-js
694c3b7f99151609e733fa7a2b5dbfce43816a34
[ "MIT" ]
1
2020-12-07T17:53:07.000Z
2020-12-07T17:53:07.000Z
sdk/communication/communication-chat/recordings/node/chatclient/recording_successfully_creates_a_thread.js
v-tsun/azure-sdk-for-js
694c3b7f99151609e733fa7a2b5dbfce43816a34
[ "MIT" ]
1
2019-10-21T01:32:44.000Z
2019-10-21T01:32:44.000Z
let nock = require('nock'); module.exports.hash = "a7f6f1f562f12da837c491b0a0ff3124"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://endpoint', {"encodedQueryParams":true}) .post('/identities') .query(true) .reply(200, {"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-6169-1000-343a0d00002e"}, [ 'Transfer-Encoding', 'chunked', 'Content-Type', 'application/json; charset=utf-8', 'MS-CV', 'YoNaeCoS7kCsmoqpHK1bQg.0', 'Strict-Transport-Security', 'max-age=2592000', 'x-ms-client-request-id', '87810f6a-5f77-4903-b20b-d7e5c277842e', 'api-supported-versions', '2020-07-20-preview1, 2020-07-20-preview2', 'X-Processing-Time', '64ms', 'X-Azure-Ref', '0sRVgXwAAAAA5XDjE3WoAQ5NVQGRHrWdXV1NURURHRTA4MDkAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', 'Tue, 15 Sep 2020 01:15:28 GMT' ]); nock('https://endpoint', {"encodedQueryParams":true}) .post('/identities/8%3Aacs%3A8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-6169-1000-343a0d00002e/token', {"scopes":["chat"]}) .query(true) .reply(200, {"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-6169-1000-343a0d00002e","token":"token","expiresOn":"2020-09-16T01:15:28.6299591+00:00"}, [ 'Transfer-Encoding', 'chunked', 'Content-Type', 'application/json; charset=utf-8', 'MS-CV', 'kdd5J31KeEenngGz2zNfCg.0', 'Strict-Transport-Security', 'max-age=2592000', 'x-ms-client-request-id', '55e21de9-c86d-4299-9c58-30d271d9c139', 'api-supported-versions', '2020-07-20-preview1, 2020-07-20-preview2', 'X-Processing-Time', '48ms', 'X-Azure-Ref', '0sRVgXwAAAADvqfd5347bSb881wB6GUr7V1NURURHRTA4MDkAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', 'Tue, 15 Sep 2020 01:15:28 GMT' ]); nock('https://endpoint', {"encodedQueryParams":true}) .post('/identities') .query(true) .reply(200, {"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-62cc-6a0b-343a0d00003b"}, [ 'Transfer-Encoding', 'chunked', 'Content-Type', 'application/json; charset=utf-8', 'MS-CV', 'uxfODJBOeUCE1Ub4BARqbA.0', 'Strict-Transport-Security', 'max-age=2592000', 'x-ms-client-request-id', '8b8d167d-5634-4469-9b40-7fe01525fd2a', 'api-supported-versions', '2020-07-20-preview1, 2020-07-20-preview2', 'X-Processing-Time', '78ms', 'X-Azure-Ref', '0sRVgXwAAAADoooqJg2qZRp6CBbpI+JV3V1NURURHRTA4MTQAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', 'Tue, 15 Sep 2020 01:15:29 GMT' ]); nock('https://endpoint', {"encodedQueryParams":true}) .post('/identities/8%3Aacs%3A8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-62cc-6a0b-343a0d00003b/token', {"scopes":["chat"]}) .query(true) .reply(200, {"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-62cc-6a0b-343a0d00003b","token":"token","expiresOn":"2020-09-16T01:15:29.0102475+00:00"}, [ 'Transfer-Encoding', 'chunked', 'Content-Type', 'application/json; charset=utf-8', 'MS-CV', 'IATIeGpE40u5O/OtTUjDcg.0', 'Strict-Transport-Security', 'max-age=2592000', 'x-ms-client-request-id', 'e31e3159-6d48-45a0-932d-595c018eb4a2', 'api-supported-versions', '2020-07-20-preview1, 2020-07-20-preview2', 'X-Processing-Time', '81ms', 'X-Azure-Ref', '0sRVgXwAAAADtcCQS8r3VQJ130ehKXCR2V1NURURHRTA4MTQAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', 'Tue, 15 Sep 2020 01:15:29 GMT' ]); nock('https://endpoint', {"encodedQueryParams":true}) .post('/chat/threads', {"topic":"test topic","members":[{"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-6169-1000-343a0d00002e"},{"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-62cc-6a0b-343a0d00003b"}]}) .query(true) .reply(207, {"multipleStatus":[{"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-6169-1000-343a0d00002e","statusCode":201,"type":"ThreadMember"},{"id":"8:acs:8d0de54a-ca74-4b37-89ea-75a8ab565166_00000005-2f36-62cc-6a0b-343a0d00003b","statusCode":201,"type":"ThreadMember"},{"id":"19:069d3bbafc4840df836c5fe8e232a17f@thread.v2","statusCode":201,"type":"Thread"}]}, [ 'Transfer-Encoding', 'chunked', 'Content-Type', 'application/json; charset=utf-8', 'Location', 'https://23.100.36.56/chat/threads/19%3A069d3bbafc4840df836c5fe8e232a17f@thread.v2', 'MS-CV', 'uR7btLOINk+DBjxj067hIg.0', 'Strict-Transport-Security', 'max-age=2592000', 'api-supported-versions', '2020-07-20-preview1, 2020-09-21-preview2', 'X-Processing-Time', '520ms', 'X-Azure-Ref', '0shVgXwAAAABufu0hTVnZQpRpx+MX7x4JV1NURURHRTA4MjIAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', 'Tue, 15 Sep 2020 01:15:29 GMT' ]);
36.97619
381
0.718824
6a37295b6ae568a74315ae80f56c8f69cdb4e5e5
3,409
js
JavaScript
public/assets/sweetalert2/src/utils/dom/renderers/renderIcon.js
onur-akdogan/Laravel_Blog_Project
eda3db94f60ec5b33943a0120f9cb484efbbba08
[ "MIT" ]
null
null
null
public/assets/sweetalert2/src/utils/dom/renderers/renderIcon.js
onur-akdogan/Laravel_Blog_Project
eda3db94f60ec5b33943a0120f9cb484efbbba08
[ "MIT" ]
null
null
null
public/assets/sweetalert2/src/utils/dom/renderers/renderIcon.js
onur-akdogan/Laravel_Blog_Project
eda3db94f60ec5b33943a0120f9cb484efbbba08
[ "MIT" ]
null
null
null
import { swalClasses, iconTypes } from '../../classes.js' import { error } from '../../utils.js' import * as dom from '../index.js' import privateProps from '../../../privateProps.js' export const renderIcon = (instance, params) => { const innerParams = privateProps.innerParams.get(instance) const icon = dom.getIcon() // if the given icon already rendered, apply the styling without re-rendering the icon if (innerParams && params.icon === innerParams.icon) { // Custom or default content setContent(icon, params) applyStyles(icon, params) return } if (!params.icon && !params.iconHtml) { return dom.hide(icon) } if (params.icon && Object.keys(iconTypes).indexOf(params.icon) === -1) { error(`Unknown icon! Expected "success", "error", "warning", "info" or "question", got "${params.icon}"`) return dom.hide(icon) } dom.show(icon) // Custom or default content setContent(icon, params) applyStyles(icon, params) // Animate icon dom.addClass(icon, params.showClass.icon) } const applyStyles = (icon, params) => { for (const iconType in iconTypes) { if (params.icon !== iconType) { dom.removeClass(icon, iconTypes[iconType]) } } dom.addClass(icon, iconTypes[params.icon]) // Icon color setColor(icon, params) // Success icon background color adjustSuccessIconBackgoundColor() // Custom class dom.applyCustomClass(icon, params, 'icon') } // Adjust success icon background color to match the popup background color const adjustSuccessIconBackgoundColor = () => { const popup = dom.getPopup() const popupBackgroundColor = window.getComputedStyle(popup).getPropertyValue('background-color') const successIconParts = popup.querySelectorAll('[class^=swal2-success-circular-line], .swal2-success-fix') for (let i = 0; i < successIconParts.length; i++) { successIconParts[i].style.backgroundColor = popupBackgroundColor } } const setContent = (icon, params) => { icon.textContent = '' if (params.iconHtml) { dom.setInnerHtml(icon, iconContent(params.iconHtml)) } else if (params.icon === 'success') { dom.setInnerHtml(icon, ` <div class="swal2-success-circular-line-left"></div> <span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span> <div class="swal2-success-ring"></div> <div class="swal2-success-fix"></div> <div class="swal2-success-circular-line-right"></div> `) } else if (params.icon === 'error') { dom.setInnerHtml(icon, ` <span class="swal2-x-mark"> <span class="swal2-x-mark-line-left"></span> <span class="swal2-x-mark-line-right"></span> </span> `) } else { const defaultIconHtml = { question: '?', warning: '!', info: 'i' } dom.setInnerHtml(icon, iconContent(defaultIconHtml[params.icon])) } } const setColor = (icon, params) => { if (!params.iconColor) { return } icon.style.color = params.iconColor icon.style.borderColor = params.iconColor for (const sel of ['.swal2-success-line-tip', '.swal2-success-line-long', '.swal2-x-mark-line-left', '.swal2-x-mark-line-right']) { dom.setStyle(icon, sel, 'backgroundColor', params.iconColor) } dom.setStyle(icon, '.swal2-success-ring', 'borderColor', params.iconColor) } const iconContent = (content) => `<div class="${swalClasses['icon-content']}">${content}</div>`
31.275229
133
0.667351
6a374be96934a7c9bb596a5605b9a433f9a7d889
2,074
js
JavaScript
src/AmazonResults.js
HaiSapporo/amazon2rakuten
a5ecc075ef1edf3da850706b8385f21c100b03f9
[ "MIT" ]
null
null
null
src/AmazonResults.js
HaiSapporo/amazon2rakuten
a5ecc075ef1edf3da850706b8385f21c100b03f9
[ "MIT" ]
null
null
null
src/AmazonResults.js
HaiSapporo/amazon2rakuten
a5ecc075ef1edf3da850706b8385f21c100b03f9
[ "MIT" ]
null
null
null
import React from 'react'; import AmazonResultItem from './AmazonResultItem'; import './AmazonResults.css'; /** Amazon 検索結果表示欄 */ export default class AmazonResults extends React.Component { /** * コンストラクタ * * @param {*} props Props */ constructor(props) { super(props); this.state = { isSearching: false, results: [], errorMessage: '' } } /** 検索処理を開始する */ onSearching = () => { this.setState({ isSearching: true, results: [], errorMessage: '' }); } /** * 検索結果を表示する * * @param {Array<*>}} results 検索結果の配列 */ showResults = (results) => { this.setState({ isSearching: false, results: results, errorMessage: '' }); } /** * エラーメッセージを表示する * * @param {string} errorMessage エラーメッセージ */ onError = (errorMessage) => { this.setState({ isSearching: false, results: [], errorMessage: errorMessage }); } /** * 子コンポーネントから親コンポーネントにイベントを伝搬する * * @param {*} state 商品情報 */ callShowAmazonCode = (state) => { this.props.callShowAmazonCode(state); } /** Render */ render = () => ( <div id="amazon-results"> { ((this.state.results == null || this.state.results.length === 0) && !this.state.isSearching && (this.state.errorMessage == null || this.state.errorMessage === '')) && ( <div className="message">検索してください</div> ) } { (this.state.isSearching) && ( <div className="message warn-message">検索中…</div> ) } { (this.state.errorMessage != null && this.state.errorMessage !== '') && ( <div className="message error-message">{this.state.errorMessage}</div> ) } { (this.state.results != null && this.state.results.length > 0) && ( <div className="results"> { this.state.results.map(item => (<AmazonResultItem key={item.id} item={item} callShowAmazonCode={this.callShowAmazonCode} />)) } </div> ) } </div> ) }
22.06383
176
0.540501
6a378f85dbe681a449ae4f76e35605e896f9508f
4,294
js
JavaScript
Whats_for_lunch.js
vaser888/What_to_eat
e1d6d9a89976f7bbe4bf382e50cd48bff4eb8dd3
[ "MIT" ]
null
null
null
Whats_for_lunch.js
vaser888/What_to_eat
e1d6d9a89976f7bbe4bf382e50cd48bff4eb8dd3
[ "MIT" ]
null
null
null
Whats_for_lunch.js
vaser888/What_to_eat
e1d6d9a89976f7bbe4bf382e50cd48bff4eb8dd3
[ "MIT" ]
null
null
null
var fastFoodList = ["Amirs", "LaFleurs", "Dagwoods", "Kojax", "Toasties", "Boustan", "Thai Express"]; var restaurantList = ["Chez Lien", "Sahib", "Moe's Bar & Grill", "Jack Astor's Bar & Grill", "McKibbins","La Pearl", "Peking garden", "Scarolie's", "Au Vieux Duluth", "Marathon Souvlaki", "Pizza Spano", "Cote St-Luc","Baton Rouge", "Scores", "Caribbean Curry House", "Café Milano"] window.onload = function() { loadLocalStorage() loadList(); } function loadLocalStorage(){ if (localStorage.getItem("fastFoodList") == null){ localStorage.setItem("fastFoodList", fastFoodList); } if (localStorage.getItem("restaurantList") == null){ localStorage.setItem("restaurantList", restaurantList); } else{ refreshListVariables(); } } function refreshListVariables(){ fastFoodList = localStorage.getItem("fastFoodList"); restaurantList = localStorage.getItem("restaurantList"); fastFoodList = fastFoodList.split(","); restaurantList = restaurantList.split(","); } function loadList(){ fastFoodList.sort(); restaurantList.sort(); var t = [fastFoodList, restaurantList]; var v = ["F", "R"]; for (i=0; i <= t.length - 1; i++){ for (p = 0; p <= t[i].length - 1; p++){ if (t[i] == ""){ }else{ createListItem(t[i][p], v[i]); } } } } function createListItem(name, Id){ var div = document.createElement("div"); var input = document.createElement("input"); var label = document.createElement("label"); input.setAttribute("type", "checkbox"); input.setAttribute("value", name); input.setAttribute("id", name); input.setAttribute("class", "L"); label.setAttribute("for", name); label.innerText = name; div.setAttribute("id", name + "Box"); div.appendChild(input); div.appendChild(label); document.getElementById(Id).appendChild(div); } function addToList(){ event.preventDefault(); var a = document.getElementById("nameInput").value; var b = document.getElementById("pickListToAdd").value; if (a === ""){ return } var g = checkForDuplicate(a); if (g == true){ createListItem(a,b); saveListsToLocalStorage(); } document.getElementById("nameInput").value= ""; } function checkForDuplicate(name){ refreshListVariables(); var li = []; li = fastFoodList.concat(restaurantList); if(li.indexOf(name) !== -1){ //do nothing } else{ return true; } } function getLunch(){ var li = document.querySelectorAll(".L:checked"); var ln = Math.floor(Math.random()*li.length); if (li[ln] === undefined){ document.getElementById("result").innerText = "Please choose from the list" } document.getElementById("result").innerText = li[ln].value; console.log(ln); } var toggleEdit = false function editLists() { var li = document.querySelectorAll(".L"); if (toggleEdit == false){ for (i = 0; i <= li.length - 1; i++){ var btn = document.createElement("button"); btn.setAttribute("onclick", "deleteT(this.parentElement)"); btn.setAttribute("id", "editBtn") btn.innerText = "X"; document.getElementById(li[i].value + "Box").appendChild(btn); toggleEdit = true; } } else{ for (i = 0; i <= li.length - 1; i++){ document.getElementById("editBtn").remove(); toggleEdit = false; } } } function deleteT(a){ a.remove(); saveListsToLocalStorage(); } function resetLocalStorage(){ var i = confirm("Do you really want to reset the lists back to default?\n\nThis will remove anything you added or changed.") if (i === true){ localStorage.clear(); location.reload(); } } function saveListsToLocalStorage(){ var f = document.getElementById("F").children; var r = document.getElementById("R").children; var a = []; for (i = 0 ; i <= f.length - 1; i++){ a.push(f[i].firstChild.defaultValue); } var b = []; for (i = 0 ; i <= r.length - 1; i++){ b.push(r[i].firstChild.defaultValue); } localStorage.setItem("fastFoodList", a); localStorage.setItem("restaurantList", b); }
29.410959
281
0.60503
6a38095b29926688238beebba23b2950dea96cdf
2,296
js
JavaScript
thirdparty/tinymce/plugins/fullpage/langs/ta_dlg.js
LiamW/sapphire
ebc89ffc80db1419f811dbfeabb69223e8bef79e
[ "CC-BY-3.0", "Unlicense" ]
135
2015-03-19T13:28:18.000Z
2022-03-27T06:41:42.000Z
thirdparty/tinymce/plugins/fullpage/langs/ta_dlg.js
LiamW/sapphire
ebc89ffc80db1419f811dbfeabb69223e8bef79e
[ "CC-BY-3.0", "Unlicense" ]
5
2020-10-17T02:41:18.000Z
2020-10-17T02:41:41.000Z
thirdparty/tinymce/plugins/fullpage/langs/ta_dlg.js
LiamW/sapphire
ebc89ffc80db1419f811dbfeabb69223e8bef79e
[ "CC-BY-3.0", "Unlicense" ]
83
2015-01-30T01:00:15.000Z
2022-03-08T17:25:10.000Z
tinyMCE.addI18n('ta.fullpage_dlg',{title:"Document properties","meta_tab":"General","appearance_tab":"Appearance","advanced_tab":"Advanced","meta_props":"Meta information",langprops:"Language and encoding","meta_title":"Title","meta_keywords":"Keywords","meta_description":"Description","meta_robots":"Robots",doctypes:"Doctype",langcode:"Language code",langdir:"Language direction",ltr:"Left to right",rtl:"Right to left","xml_pi":"XML declaration",encoding:"Character encoding","appearance_bgprops":"Background properties","appearance_marginprops":"Body margins","appearance_linkprops":"Link colors","appearance_textprops":"Text properties",bgcolor:"Background color",bgimage:"Background image","left_margin":"Left margin","right_margin":"Right margin","top_margin":"Top margin","bottom_margin":"Bottom margin","text_color":"Text color","font_size":"Font size","font_face":"Font face","link_color":"Link color","hover_color":"Hover color","visited_color":"Visited color","active_color":"Active color",textcolor:"Color",fontsize:"Font size",fontface:"Font family","meta_index_follow":"Index and follow the links","meta_index_nofollow":"Index and don\'t follow the links","meta_noindex_follow":"Do not index but follow the links","meta_noindex_nofollow":"Do not index and don\\\'t follow the links","appearance_style":"Stylesheet and style properties",stylesheet:"Stylesheet",style:"Style",author:"Author",copyright:"Copyright",add:"Add new element",remove:"Remove selected element",moveup:"Move selected element up",movedown:"Move selected element down","head_elements":"Head elements",info:"Information","add_title":"Title element","add_meta":"Meta element","add_script":"Script element","add_style":"Style element","add_link":"Link element","add_base":"Base element","add_comment":"Comment node","title_element":"Title element","script_element":"Script element","style_element":"Style element","base_element":"Base element","link_element":"Link element","meta_element":"Meta element","comment_element":"Comment",src:"Src",language:"Language",href:"Href",target:"Target",type:"Type",charset:"Charset",defer:"Defer",media:"Media",properties:"Properties",name:"Name",value:"Value",content:"Content",rel:"Rel",rev:"Rev",hreflang:"Href lang","general_props":"General","advanced_props":"Advanced"});
2,296
2,296
0.773519
6a38946ce255db3cd2dcf937e91a15022ab5ac60
2,350
js
JavaScript
build/static/js/54.406f5cd7.chunk.js
R1zZ/website
8affb530b1c194c2d647df125b0f3ab1f049de7f
[ "MIT" ]
null
null
null
build/static/js/54.406f5cd7.chunk.js
R1zZ/website
8affb530b1c194c2d647df125b0f3ab1f049de7f
[ "MIT" ]
null
null
null
build/static/js/54.406f5cd7.chunk.js
R1zZ/website
8affb530b1c194c2d647df125b0f3ab1f049de7f
[ "MIT" ]
null
null
null
(window.webpackJsonp=window.webpackJsonp||[]).push([[54],{1097:function(e,a,t){"use strict";t.r(a);var l=t(227),n=t(228),c=t(231),r=t(229),m=t(230),s=t(3),o=t.n(s),p=t(921),E=t(889),u=t(890),d=t(892),i=t(893),b=t(955),w=t(910),N=t(911),y=t(898),k=t(912),f=t(895),h=t(913),x=function(e){function a(){return Object(l.a)(this,a),Object(c.a)(this,Object(r.a)(a).apply(this,arguments))}return Object(m.a)(a,e),Object(n.a)(a,[{key:"render",value:function(){return o.a.createElement("div",{className:"app flex-row align-items-center"},o.a.createElement(p.a,null,o.a.createElement(E.a,{className:"justify-content-center"},o.a.createElement(u.a,{md:"9",lg:"7",xl:"6"},o.a.createElement(d.a,{className:"mx-4"},o.a.createElement(i.a,{className:"p-4"},o.a.createElement(b.a,null,o.a.createElement("h1",null,"Register"),o.a.createElement("p",{className:"text-muted"},"Create your account"),o.a.createElement(w.a,{className:"mb-3"},o.a.createElement(N.a,{addonType:"prepend"},o.a.createElement(y.a,null,o.a.createElement("i",{className:"icon-user"}))),o.a.createElement(k.a,{type:"text",placeholder:"Username",autoComplete:"username"})),o.a.createElement(w.a,{className:"mb-3"},o.a.createElement(N.a,{addonType:"prepend"},o.a.createElement(y.a,null,"@")),o.a.createElement(k.a,{type:"text",placeholder:"Email",autoComplete:"email"})),o.a.createElement(w.a,{className:"mb-3"},o.a.createElement(N.a,{addonType:"prepend"},o.a.createElement(y.a,null,o.a.createElement("i",{className:"icon-lock"}))),o.a.createElement(k.a,{type:"password",placeholder:"Password",autoComplete:"new-password"})),o.a.createElement(w.a,{className:"mb-4"},o.a.createElement(N.a,{addonType:"prepend"},o.a.createElement(y.a,null,o.a.createElement("i",{className:"icon-lock"}))),o.a.createElement(k.a,{type:"password",placeholder:"Repeat password",autoComplete:"new-password"})),o.a.createElement(f.a,{color:"success",block:!0},"Create Account"))),o.a.createElement(h.a,{className:"p-4"},o.a.createElement(E.a,null,o.a.createElement(u.a,{xs:"12",sm:"6"},o.a.createElement(f.a,{className:"btn-facebook mb-1",block:!0},o.a.createElement("span",null,"facebook"))),o.a.createElement(u.a,{xs:"12",sm:"6"},o.a.createElement(f.a,{className:"btn-twitter mb-1",block:!0},o.a.createElement("span",null,"twitter"))))))))))}}]),a}(s.Component);a.default=x}}]); //# sourceMappingURL=54.406f5cd7.chunk.js.map
1,175
2,304
0.702979
6a38b18b663dfb19559a20f295b80740e9f4bf65
921
js
JavaScript
load-test/src/index.js
SerayaEryn/nodejs-sensor
3896adec14259ab3404f866dc0fe27edcfcccfec
[ "MIT" ]
null
null
null
load-test/src/index.js
SerayaEryn/nodejs-sensor
3896adec14259ab3404f866dc0fe27edcfcccfec
[ "MIT" ]
3
2021-03-01T21:20:02.000Z
2022-01-22T13:24:16.000Z
load-test/src/index.js
DtRWoS/nodejs-sensor
611b07b3b90fec7d00f6f940d0d2417b68971118
[ "MIT" ]
null
null
null
/* eslint-disable no-console */ 'use strict'; var config = require('./config'); var cluster = require('cluster'); if (config.sensor.enabled) { require('instana-nodejs-sensor')({ level: 'info', agentPort: config.sensor.agentPort, tracing: { enabled: config.sensor.tracing, stackTraceLength: config.sensor.stackTraceLength } }); } require('heapdump'); if (cluster.isMaster && config.app.workers > 1) { initMaster(); } else { initWorker(); } function initMaster() { console.log('Master ' + process.pid + ' is running'); for (var i = 0; i < config.app.workers; i++) { cluster.fork(); } cluster.on('exit', function(worker) { console.log('worker ' + worker.process.pid + ' died'); }); } function initWorker() { console.log('Starting worker ' + process.pid); require('./app').init(function() { console.log('Worker ' + process.pid + ' started'); }); }
18.795918
58
0.62215
6a39dda827325ddd2ecd5d06b5e8d41d757c5934
126
js
JavaScript
.install.js
reinjs/rein-static
f4d1c1f9414d2abb8d271c7ea8f936bf404a0626
[ "MIT" ]
null
null
null
.install.js
reinjs/rein-static
f4d1c1f9414d2abb8d271c7ea8f936bf404a0626
[ "MIT" ]
null
null
null
.install.js
reinjs/rein-static
f4d1c1f9414d2abb8d271c7ea8f936bf404a0626
[ "MIT" ]
null
null
null
module.exports = async (ctx, name) => { return { prefix: '/', path: './public', historyApiFallback: true }; };
18
39
0.547619
6a39ead0b2c89be985dad647a84ba819f1ec6bdb
1,275
js
JavaScript
public/sw.js
philnash/service-worker-background-fetch
f0ec88c8e2075973eb80d3f9da0acda25677f132
[ "MIT" ]
12
2017-07-09T00:39:17.000Z
2020-05-14T23:50:24.000Z
public/sw.js
philnash/service-worker-background-fetch
f0ec88c8e2075973eb80d3f9da0acda25677f132
[ "MIT" ]
1
2020-05-13T11:14:28.000Z
2020-05-20T14:17:06.000Z
public/sw.js
philnash/service-worker-background-fetch
f0ec88c8e2075973eb80d3f9da0acda25677f132
[ "MIT" ]
null
null
null
self.addEventListener('install', function(event) { event.waitUntil( caches.open('files').then(function(cache) { return cache.add('/'); }) ); }); self.addEventListener('backgroundfetched', function(event) { event.waitUntil( caches.open('downloads').then(function(cache) { event.updateUI('Large file downloaded'); registration.showNotification('File downloaded!', { data: { url: event.fetches[0].request.url } }); const promises = event.fetches.map(({ request, response }) => { if (response && response.ok) { return cache.put(request, response.clone()); } }); return Promise.all(promises); }) ); }); self.addEventListener('notificationclick', function(event) { event.notification.close(); const url = new URL(event.notification.data.url); clients.openWindow(url.origin); }); self.addEventListener('fetch', function(event) { if (event.request.url.match(/images/)) { event.respondWith( caches.open('downloads').then(cache => { return cache.match(event.request).then(response => { return response || fetch(event.request); }); }) ); } else { event.respondWith(caches.match(event.request)); } });
26.020408
69
0.615686
6a3c3400a1d70bbbd93de6c0cb0f92e0b88bf0a1
6,021
js
JavaScript
lib/repeatable.js
Peppy-Health/bull
b8ca885b47698edc848e9876763a17e6aee4a586
[ "MIT" ]
2
2020-03-19T17:50:58.000Z
2022-02-18T17:41:13.000Z
lib/repeatable.js
Peppy-Health/bull
b8ca885b47698edc848e9876763a17e6aee4a586
[ "MIT" ]
1
2021-09-01T00:32:37.000Z
2021-09-01T00:32:37.000Z
lib/repeatable.js
Peppy-Health/bull
b8ca885b47698edc848e9876763a17e6aee4a586
[ "MIT" ]
1
2021-02-02T10:47:02.000Z
2021-02-02T10:47:02.000Z
'use strict'; const _ = require('lodash'); const parser = require('cron-parser'); const crypto = require('crypto'); const Job = require('./job'); module.exports = function(Queue) { Queue.prototype.nextRepeatableJob = function( name, data, opts, skipCheckExists ) { const client = this.client; const repeat = opts.repeat; const prevMillis = opts.prevMillis || 0; if (!prevMillis && opts.jobId) { repeat.jobId = opts.jobId; } const currentCount = repeat.count ? repeat.count + 1 : 1; if (!_.isUndefined(repeat.limit) && currentCount > repeat.limit) { return Promise.resolve(); } let now = Date.now(); now = prevMillis < now ? now : prevMillis; const nextMillis = getNextMillis(now, repeat); if (nextMillis) { const jobId = repeat.jobId ? repeat.jobId + ':' : ':'; const repeatJobKey = getRepeatKey(name, repeat, jobId); const createNextJob = () => { return client .zadd(this.keys.repeat, nextMillis, repeatJobKey) .then(() => { // // Generate unique job id for this iteration. // const customId = getRepeatJobId( name, jobId, nextMillis, md5(repeatJobKey) ); now = Date.now(); const delay = nextMillis - now; return Job.create( this, name, data, _.defaultsDeep( { repeat: { count: currentCount }, jobId: customId, delay: delay < 0 ? 0 : delay, timestamp: now, prevMillis: nextMillis }, opts ) ); }); }; if (skipCheckExists) { return createNextJob(); } // Check that the repeatable job hasn't been removed // TODO: a lua script would be better here return client .zscore(this.keys.repeat, repeatJobKey) .then(repeatableExists => { // The job could have been deleted since this check if (repeatableExists) { return createNextJob(); } return Promise.resolve(); }); } else { return Promise.resolve(); } }; Queue.prototype.removeRepeatable = function(name, repeat) { if (typeof name !== 'string') { repeat = name; name = Job.DEFAULT_JOB_NAME; } return this.isReady().then(() => { const jobId = repeat.jobId ? repeat.jobId + ':' : ':'; const repeatJobKey = getRepeatKey(name, repeat, jobId); const repeatJobId = getRepeatJobId(name, jobId, '', md5(repeatJobKey)); const queueKey = this.keys['']; return this.client.removeRepeatable( this.keys.repeat, this.keys.delayed, repeatJobId, repeatJobKey, queueKey ); }); }; Queue.prototype.removeRepeatableByKey = function(repeatJobKey) { const repeatMeta = this._keyToData(repeatJobKey); const queueKey = this.keys['']; const jobId = repeatMeta.id ? repeatMeta.id + ':' : ':'; const repeatJobId = getRepeatJobId( repeatMeta.name || Job.DEFAULT_JOB_NAME, jobId, '', md5(repeatJobKey) ); return this.isReady().then(() => { return this.client.removeRepeatable( this.keys.repeat, this.keys.delayed, repeatJobId, repeatJobKey, queueKey ); }); }; Queue.prototype._keyToData = function(key) { const data = key.split(':'); return { key: key, name: data[0], id: data[1] || null, endDate: parseInt(data[2]) || null, tz: data[3] || null, cron: data[4] }; }; Queue.prototype.getRepeatableJobs = function(start, end, asc) { const key = this.keys.repeat; start = start || 0; end = end || -1; return (asc ? this.client.zrange(key, start, end, 'WITHSCORES') : this.client.zrevrange(key, start, end, 'WITHSCORES') ).then(result => { const jobs = []; for (let i = 0; i < result.length; i += 2) { const data = this._keyToData(result[i]); jobs.push({ key: data.key, name: data.name, id: data.id, endDate: data.endDate, tz: data.cron ? data.tz : null, cron: data.cron || null, every: !data.cron ? parseInt(data.tz) : null, next: parseInt(result[i + 1]) }); } return jobs; }); }; Queue.prototype.getRepeatableCount = function() { return this.client.zcard(this.toKey('repeat')); }; function getRepeatJobId(name, jobId, nextMillis, namespace) { return 'repeat:' + md5(name + jobId + namespace) + ':' + nextMillis; } function getRepeatKey(name, repeat, jobId) { const endDate = repeat.endDate ? new Date(repeat.endDate).getTime() + ':' : ':'; const tz = repeat.tz ? repeat.tz + ':' : ':'; const suffix = repeat.cron ? tz + repeat.cron : String(repeat.every); return name + ':' + jobId + endDate + suffix; } function getNextMillis(millis, opts) { if (opts.cron && opts.every) { throw new Error( 'Both .cron and .every options are defined for this repeatable job' ); } if (opts.every) { return Math.floor(millis / opts.every) * opts.every + opts.every; } const currentDate = opts.startDate && new Date(opts.startDate) > new Date(millis) ? new Date(opts.startDate) : new Date(millis); const interval = parser.parseExpression( opts.cron, _.defaults( { currentDate }, opts ) ); try { return interval.next().getTime(); } catch (e) { // Ignore error } } function md5(str) { return crypto .createHash('md5') .update(str) .digest('hex'); } };
25.730769
77
0.537784
6a3c348a33138b7f162eb61b5806c3138849c29e
1,395
js
JavaScript
src/context/themeContext.js
Malaba6/tache
cabac7b57bec367a1da69186f72f2d45a2a32f85
[ "MIT" ]
null
null
null
src/context/themeContext.js
Malaba6/tache
cabac7b57bec367a1da69186f72f2d45a2a32f85
[ "MIT" ]
null
null
null
src/context/themeContext.js
Malaba6/tache
cabac7b57bec367a1da69186f72f2d45a2a32f85
[ "MIT" ]
null
null
null
import { createContext, useState, useMemo } from 'react' import { createTheme, ThemeProvider } from '@mui/material/styles' import { pink, blue, grey } from '@mui/material/colors' export const ThemeContext = createContext({toggleColorMode: () => {}}) export const ColorModeProvider = ({ children }) => { const [mode, setMode] = useState('dark') const colorMode = useMemo(() => ({ toggleColorMode: () => { setMode(prevMode => (prevMode === 'light' ? 'dark' : 'light')) } }), []) const theme = useMemo(() => createTheme({ palette: { mode, ...(mode === 'light' ? { primary: { main: '#fff', dark: grey[400], light: grey[200], }, info: { main: pink[600], }, secondary: { main: blue[600], light: blue[100], } } : { primary: { main: '#333', dark: '#333', light: '#121212', }, info: { main: pink[600], }, secondary: { main: blue[600], light: blue[100], }} ) } }), [mode]) return <ThemeContext.Provider value={colorMode}> <ThemeProvider theme={theme}> { children } </ThemeProvider> </ThemeContext.Provider> }
24.473684
70
0.458781
6a3cd6f8fbbd272819f3d4f231949b87d2c321c3
193
js
JavaScript
bin/ut-check.js
softwaregroup-bg/ut-tools
6ddc045530345da72807445e287368da7f7a16a5
[ "Apache-2.0" ]
1
2019-07-01T07:13:02.000Z
2019-07-01T07:13:02.000Z
bin/ut-check.js
softwaregroup-bg/ut-tools
6ddc045530345da72807445e287368da7f7a16a5
[ "Apache-2.0" ]
19
2017-04-26T17:43:44.000Z
2021-12-16T20:10:16.000Z
bin/ut-check.js
softwaregroup-bg/ut-tools
6ddc045530345da72807445e287368da7f7a16a5
[ "Apache-2.0" ]
8
2016-08-23T08:32:06.000Z
2022-02-25T18:08:58.000Z
#!/usr/bin/env node require('../lib/exec')('npm', ['test']); require('../lib/exec')('npm', ['audit']); // npm outdated --depth 0 --registry https://nexus.softwaregroup.com/repository/npm-all/
32.166667
88
0.637306
6a3d195f3057ae94c0beedaa31eb6576fb8e0281
285
js
JavaScript
docs/search/variables_b.js
kostergroup/Excimontec
7fb0929a9a22ff92db722161caa68e07fd0e5cde
[ "MIT" ]
19
2017-05-03T07:40:46.000Z
2021-08-03T05:58:57.000Z
docs/search/variables_b.js
kostergroup/Excimontec
7fb0929a9a22ff92db722161caa68e07fd0e5cde
[ "MIT" ]
100
2018-07-05T18:44:10.000Z
2022-02-06T10:42:59.000Z
docs/search/variables_b.js
MikeHeiber/Excimontec
19a568f3a5871efad0db54f5bb950bb9e2bc6b65
[ "MIT" ]
11
2018-01-13T09:41:52.000Z
2021-08-23T08:33:58.000Z
var searchData= [ ['object_5ftype',['object_type',['../class_excimontec_1_1_exciton.html#a564abe42899b7c49ad37cc4aaecfa1b0',1,'Excimontec::Exciton::object_type()'],['../class_excimontec_1_1_polaron.html#ab27d92edd450d140e7ac8770dc439e0c',1,'Excimontec::Polaron::object_type()']]] ];
57
263
0.789474
6a3d704c710ce56e7ca23c9d7d67913c86d339b3
1,509
js
JavaScript
site-source/js/Uize/Widgets/Buttons/Localized/VisualSampler.js
benmvp/UIZE-JavaScript-Framework
5a6e653da09ec7814314323eff708afdd2337369
[ "MIT" ]
null
null
null
site-source/js/Uize/Widgets/Buttons/Localized/VisualSampler.js
benmvp/UIZE-JavaScript-Framework
5a6e653da09ec7814314323eff708afdd2337369
[ "MIT" ]
null
null
null
site-source/js/Uize/Widgets/Buttons/Localized/VisualSampler.js
benmvp/UIZE-JavaScript-Framework
5a6e653da09ec7814314323eff708afdd2337369
[ "MIT" ]
null
null
null
/*______________ | ______ | U I Z E J A V A S C R I P T F R A M E W O R K | / / | --------------------------------------------------- | / O / | MODULE : Uize.Widgets.Buttons.Localized.VisualSampler Class | / / / | | / / / /| | ONLINE : http://www.uize.com | /____/ /__/_| | COPYRIGHT : (c)2014-2016 UIZE | /___ | LICENSE : Available under MIT License or GNU General Public License |_______________| http://www.uize.com/license.html */ /* Module Meta Data type: Class importance: 1 codeCompleteness: 100 docCompleteness: 100 */ /*? Introduction The =Uize.Widgets.Buttons.Localized.VisualSampler= class implements a visual sampler widget base class for localized button widget classes. *DEVELOPERS:* `Chris van Rensburg` */ Uize.module ({ name:'Uize.Widgets.Buttons.Localized.VisualSampler', superclass:'Uize.Widgets.VisualSampler.Widget', required:[ 'Uize.Widgets.StateValues', 'Uize.Widgets.Buttons.Localized.Widget' ], builder:function (_superclass) { 'use strict'; return _superclass.subclass ({ omegastructor:function () { this.addStateCombinationSamples ({ locale:Uize.Widgets.StateValues.locale }); this.addStateCombinationSamples ({ flavor:['normal','negative','positive','primary'] }); this.addStateCombinationSamples ({ size:Uize.Widgets.StateValues.size }); }, set:{ samplerWidgetClass:Uize.Widgets.Buttons.Localized.Widget } }); } });
26.946429
141
0.630219
6a3dbe0b2114cb153ec29b53385eac9261eb06ba
18,039
js
JavaScript
spec/quick_latex-to-ast.spec.js
Conway/math-expressions
b426a73c89560e7d450e0dd397b8c6a8c029a20f
[ "Apache-2.0" ]
47
2015-07-27T14:37:08.000Z
2021-05-09T19:07:10.000Z
spec/quick_latex-to-ast.spec.js
Conway/math-expressions
b426a73c89560e7d450e0dd397b8c6a8c029a20f
[ "Apache-2.0" ]
25
2016-04-09T02:18:20.000Z
2021-05-06T23:45:36.000Z
spec/quick_latex-to-ast.spec.js
Conway/math-expressions
b426a73c89560e7d450e0dd397b8c6a8c029a20f
[ "Apache-2.0" ]
16
2015-07-29T14:35:55.000Z
2020-03-22T19:50:49.000Z
import latexToAst from '../lib/converters/latex-to-ast'; import { ParseError } from '../lib/converters/error'; var converter = new latexToAst(); var trees = { '\\frac{1}{2} x': ['*',['/',1,2],'x'], '1+x+3': ['+',1,'x',3], '1-x-3': ['+',1,['-','x'],['-',3]], "1 + - x": ['+',1,['-','x']], "1 - - x": ['+',1,['-',['-','x']]], '1.+x+3.0': ['+',1,'x',3], 'x^2': ['^', 'x', 2], '\\log x': ['apply', 'log', 'x'], '\\ln x': ['apply', 'ln', 'x'], '-x^2': ['-',['^', 'x', 2]], '|x|': ['apply', 'abs','x'], '|\\sin|x||': ['apply', 'abs', ['apply', 'sin', ['apply', 'abs', 'x']]], 'x^47': ['^', 'x', 47], 'x^ab': ['*', ['^', 'x', 'a'], 'b'], 'x^a!': ['^', 'x', ['apply', 'factorial', 'a']], 'xyz': ['*','x','y','z'], 'c(a+b)': ['*', 'c', ['+', 'a', 'b']], '(a+b)c': ['*', ['+', 'a', 'b'], 'c'], 'a!': ['apply', 'factorial','a'], '\\theta': 'theta', 'theta': ['*', 't', 'h', 'e', 't', 'a'], '\\cos(\\theta)': ['apply', 'cos','theta'], 'cos(x)': ['*', 'c', 'o', 's', 'x'], '|\\sin(|x|)|': ['apply', 'abs', ['apply', 'sin', ['apply', 'abs', 'x']]], '\\var{blah}(x)': ['*', 'blah', 'x'], '|x+3=2|': ['apply', 'abs', ['=', ['+', 'x', 3], 2]], 'x_y_z': ['_', 'x', ['_','y','z']], 'x_{y_z}': ['_', 'x', ['_','y','z']], '{x_y}_z': ['_', ['_', 'x', 'y'],'z'], 'x^y^z': ['^', 'x', ['^','y','z']], 'x^{y^z}': ['^', 'x', ['^','y','z']], '{x^y}^z': ['^', ['^', 'x', 'y'],'z'], 'x^y_z': ['^', 'x', ['_','y','z']], 'x_y^z': ['^', ['_','x','y'],'z'], 'xyz!': ['*','x','y', ['apply', 'factorial', 'z']], 'x': 'x', 'f': 'f', 'fg': ['*', 'f','g'], 'f+g': ['+', 'f', 'g'], 'f(x)': ['apply', 'f', 'x'], 'f(x,y,z)': ['apply', 'f', ['tuple', 'x', 'y', 'z']], 'fg(x)': ['*', 'f', ['apply', 'g', 'x']], 'fp(x)': ['*', 'f', 'p', 'x'], 'fx': ['*', 'f', 'x'], 'f\'': ['prime', 'f'], 'fg\'': ['*', 'f', ['prime', 'g']], 'f\'g': ['*', ['prime', 'f'], 'g'], 'f\'g\'\'': ['*', ['prime', 'f'], ['prime', ['prime', 'g']]], 'x\'': ['prime', 'x'], 'f\'(x)' : ['apply', ['prime', 'f'], 'x'], 'f(x)\'' : ['prime', ['apply', 'f', 'x']], '\\sin(x)\'': ['prime', ['apply', 'sin', 'x']], '\\sin\'(x)': ['apply', ['prime', 'sin'], 'x'], 'f\'\'(x)': ['apply', ['prime', ['prime', 'f']],'x'], '\\sin(x)\'\'': ['prime', ['prime', ['apply','sin','x']]], 'f(x)^t_y': ['^', ['apply', 'f','x'], ['_','t','y']], 'f_t(x)': ['apply', ['_', 'f', 't'], 'x'], 'f(x)_t': ['_', ['apply', 'f', 'x'], 't'], 'f^2(x)': ['apply', ['^', 'f', 2], 'x'], 'f(x)^2': ['^', ['apply', 'f', 'x'],2], 'f\'^a(x)': ['apply', ['^', ['prime', 'f'], 'a'], 'x'], 'f^a\'(x)': ['apply', ['^', 'f', ['prime', 'a']], 'x'], 'f_a^b\'(x)': ['apply', ['^', ['_', 'f', 'a'], ['prime', 'b']],'x'], 'f_a\'^b(x)': ['apply', ['^', ['prime', ['_', 'f','a']],'b'],'x'], '\\sin x': ['apply', 'sin', 'x'], 'f x': ['*', 'f', 'x'], '\\sin^xyz': ['*', ['apply', ['^', 'sin', 'x'], 'y'], 'z'], '\\sin xy': ['*', ['apply', 'sin', 'x'], 'y'], '\\sin^2(x)': ['apply', ['^', 'sin', 2], 'x'], '\\exp(x)': ['apply', 'exp', 'x'], 'e^x': ['^', 'e', 'x'], 'x^2!': ['^', 'x', ['apply', 'factorial', 2]], 'x^2!!': ['^', 'x', ['apply', 'factorial', ['apply', 'factorial', 2]]], 'x_t^2': ['^', ['_', 'x', 't'], 2], 'x_f^2': ['_', 'x', ['^', 'f', 2]], 'x_t\'': ['prime', ['_', 'x', 't']], 'x_f\'': ['_', 'x', ['prime', 'f']], '(x,y,z)': ['tuple', 'x', 'y', 'z'], '(x,y)-[x,y]': ['+', ['tuple','x','y'], ['-', ['array','x','y']]], '2[z-(x+1)]': ['*', 2, ['+', 'z', ['-', ['+', 'x', 1]]]], '\\{1,2,x\\}': ['set', 1, 2, 'x'], '\\{x, x\\}': ['set', 'x', 'x'], '\\{x\\}': ['set', 'x'], '\\{-x\\}': ['set', ['-','x']], '(1,2]': ['interval', ['tuple', 1, 2], ['tuple', false, true]], '[1,2)': ['interval', ['tuple', 1, 2], ['tuple', true, false]], '[1,2]': ['array', 1, 2 ], '(1,2)': ['tuple', 1, 2 ], '1,2,3': ['list', 1, 2, 3], 'x=a': ['=', 'x', 'a'], 'x=y=1': ['=', 'x', 'y', 1], 'x=(y=1)': ['=', 'x', ['=', 'y', 1]], '(x=y)=1': ['=', ['=','x', 'y'], 1], '7 \\ne 2': ['ne', 7, 2], '7 \\neq 2': ['ne', 7, 2], '\\lnot x=y': ['not', ['=', 'x', 'y']], '\\lnot (x=y)': ['not', ['=', 'x', 'y']], 'x>y': ['>', 'x','y'], 'x \\gt y': ['>', 'x','y'], 'x \\ge y': ['ge', 'x','y'], 'x \\geq y': ['ge', 'x','y'], 'x>y>z': ['gts', ['tuple', 'x', 'y','z'], ['tuple', true, true]], 'x>y \\ge z': ['gts', ['tuple', 'x', 'y','z'], ['tuple', true, false]], 'x \\ge y>z': ['gts', ['tuple', 'x', 'y','z'], ['tuple', false, true]], 'x \\ge y \\ge z': ['gts', ['tuple', 'x', 'y','z'], ['tuple', false, false]], 'x<y': ['<', 'x','y'], 'x \\lt y': ['<', 'x','y'], 'x \\le y': ['le', 'x','y'], 'x \\leq y': ['le', 'x','y'], 'x<y<z': ['lts', ['tuple', 'x', 'y','z'], ['tuple', true, true]], 'x<y \\le z': ['lts', ['tuple', 'x', 'y','z'], ['tuple', true, false]], 'x \\le y<z': ['lts', ['tuple', 'x', 'y', 'z'], ['tuple', false, true]], 'x \\le y \\le z': ['lts', ['tuple', 'x', 'y', 'z'], ['tuple', false, false]], 'x<y>z': ['>', ['<', 'x', 'y'], 'z'], 'A \\subset B': ['subset', 'A', 'B'], 'A \\not\\subset B': ['notsubset', 'A', 'B'], 'A \\supset B': ['superset', 'A', 'B'], 'A \\not\\supset B': ['notsuperset', 'A', 'B'], 'x \\in A': ['in', 'x', 'A'], 'x \\notin A': ['notin', 'x', 'A'], 'x \\not\\in A': ['notin', 'x', 'A'], 'A \\ni x': ['ni', 'A', 'x'], 'A \\not\\ni x': ['notni', 'A', 'x'], 'A \\cup B': ['union', 'A', 'B'], 'A \\cap B': ['intersect', 'A', 'B'], 'A \\land B': ['and', 'A', 'B'], 'A \\wedge B': ['and', 'A', 'B'], 'A \\lor B': ['or', 'A', 'B'], 'A \\vee B': ['or', 'A', 'B'], 'A \\land B \\lor C': ['and', 'A', 'B', 'C'], 'A \\lor B \\lor C': ['or', 'A', 'B', 'C'], 'A \\land B \\lor C': ['or', ['and', 'A', 'B'], 'C'], 'A \\lor B \\land C': ['or', 'A', ['and', 'B', 'C']], '\\lnot x=1': ['not', ['=', 'x', 1]], '\\lnot(x=1)': ['not', ['=', 'x', 1]], '\\lnot(x=y) \\lor z \\ne w': ['or', ['not', ['=','x','y']], ['ne','z','w']], '1.2E3': 1200, '1.2E+3 ': 1200, '3.1E-3 ': 0.0031, '3.1E- 3 ': ['+', ['*', 3.1, 'E'], ['-', 3]], '3.1E -3 ': ['+', ['*', 3.1, 'E'], ['-', 3]], '3.1E - 3 ': ['+', ['*', 3.1, 'E'], ['-', 3]], '3.1E-3 + 2 ': ['+', ['*', 3.1, 'E'], ['-', 3], 2], '(3.1E-3 ) + 2': ['+', 0.0031, 2], '\\sin((3.1E-3)x)': ['apply', 'sin', ['*', 0.0031, 'x']], '\\sin( 3.1E-3 x)': ['apply', 'sin', ['+', ['*', 3.1, 'E'], ['-', ['*', 3, 'x']]]], '\\frac{3.1E-3 }{x}': ['/', 0.0031, 'x'], '|3.1E-3|': ['apply', 'abs', 0.0031], '|3.1E-3|': ['apply', 'abs', 0.0031], '(3.1E-3, 1E2)': ['tuple', 0.0031, 100], '(3.1E-3, 1E2]': ["interval", ["tuple", 0.0031, 100], ["tuple", false, true]], '\\{ 3.1E-3, 1E2 \\}': ['set', 0.0031, 100], '\\begin{matrix} 1E-3 & 3E-12 \\\\ 6E+3& 7E5\\end{matrix}': [ 'matrix', [ 'tuple', 2, 2 ], [ 'tuple', [ 'tuple', 0.001, 3e-12 ], [ 'tuple', 6000, 700000 ] ] ], '1.2e-3': ['+', ['*', 1.2, 'e'], ['-', 3]], '+2': 2, '\\infty': Infinity, '+\\infty': Infinity, 'a b\\,c\\!d\\ e\\>f\\;g\\>h\\quad i \\qquad j': ['*','a','b','c','d','e','f','g','h','i','j'], '\\begin{bmatrix}a & b\\\\ c&d\\end{bmatrix}': ['matrix', ['tuple', 2, 2], ['tuple', ['tuple', 'a', 'b'], ['tuple', 'c', 'd']]], '\\begin{pmatrix}a & b\\\\ c\\end{pmatrix}': ['matrix', ['tuple', 2, 2], ['tuple', ['tuple', 'a', 'b'], ['tuple', 'c', 0]]], '\\begin{matrix}a & b\\\\ &d\\end{matrix}': ['matrix', ['tuple', 2, 2], ['tuple', ['tuple', 'a', 'b'], ['tuple', 0, 'd']]], '\\begin{pmatrix}a + 3y & 2\\sin(\\theta)\\end{pmatrix}': ['matrix', ['tuple', 1, 2], ['tuple', ['tuple', ['+', 'a', ['*', 3, 'y']], ['*', 2, ['apply', 'sin', 'theta']]]]], '\\begin{bmatrix}3\\\\ \\\\ 4 & 5\\end{bmatrix}': ['matrix', ['tuple', 3, 2], ['tuple', ['tuple', 3, 0], ['tuple', 0, 0], ['tuple', 4, 5]]], '\\begin{matrix}8\\\\1&2&3\\end{matrix}': ['matrix', ['tuple', 2, 3], ['tuple', ['tuple', 8, 0, 0], ['tuple', 1, 2, 3]]], '\\frac{dx}{dt}=q': ['=', ['derivative_leibniz', 'x', ['tuple', 't']], 'q'], '\\frac { dx } { dt } = q': ['=', ['derivative_leibniz', 'x', ['tuple', 't']], 'q'], '\\frac{d x}{dt}': ['derivative_leibniz', 'x', ['tuple', 't']], '\\frac{dx}{d t}': ['derivative_leibniz', 'x', ['tuple', 't']], '\\frac{dx_2}{dt}': ["/", ["*", "d", ["_", "x", 2]], ["*", "d", "t"]], '\\frac{dxy}{dt}': ["/", ["*", "d", "x", "y"], ["*", "d", "t"]], '\\frac{d^2x}{dt^2}': ['derivative_leibniz', ['tuple', 'x', 2], ['tuple', ['tuple', 't', 2]]], '\\frac{d^{2}x}{dt^{ 2 }}': ['derivative_leibniz', ['tuple', 'x', 2], ['tuple', ['tuple', 't', 2]]], '\\frac{d^2x}{dt^3}': ["/", ["*", ["^", "d", 2], "x"], ["*", "d", ["^", "t", 3]]], '\\frac{d^2x}{dsdt}': ['derivative_leibniz', ['tuple', 'x', 2], ['tuple', 's', 't']], '\\frac{d^2x}{dsdta}': ["/", ["*", ["^", "d", 2], "x"], ["*", "d", "s", "d", "t", "a"]], '\\frac{d^3x}{ds^2dt}': ['derivative_leibniz', ['tuple', 'x', 3], ['tuple', ['tuple', 's', 2], 't']], '\\frac{d^{ 3 }x}{ds^{2}dt}': ['derivative_leibniz', ['tuple', 'x', 3], ['tuple', ['tuple', 's', 2], 't']], '\\frac{d^3x}{dsdt^2}': ['derivative_leibniz', ['tuple', 'x', 3], ['tuple', 's', ['tuple', 't', 2]]], '\\frac{d^{3}x}{dsdt^{ 2 }}': ['derivative_leibniz', ['tuple', 'x', 3], ['tuple', 's', ['tuple', 't', 2]]], '\\frac{d\\theta}{d\\pi}': ['derivative_leibniz', 'theta', ['tuple', 'pi']], '\\frac{d\\var{hello}}{d\\var{bye}}': ['derivative_leibniz', 'hello', ['tuple', 'bye']], '\\frac{d^2\\theta}{d\\pi^2}': ['derivative_leibniz', ['tuple', 'theta', 2], ['tuple', ['tuple', 'pi', 2]]], '\\frac{d^2\\var{hello}}{d\\var{bye}^2}': ['derivative_leibniz', ['tuple', 'hello', 2], ['tuple', ['tuple', 'bye', 2]]], '\\frac{d^{2}\\theta}{d\\pi^{ 2 }}': ['derivative_leibniz', ['tuple', 'theta', 2], ['tuple', ['tuple', 'pi', 2]]], '\\frac{d^{ 2 }\\var{hello}}{d\\var{bye}^{2}}': ['derivative_leibniz', ['tuple', 'hello', 2], ['tuple', ['tuple', 'bye', 2]]], '\\frac{\\partial x}{\\partial t}': ['partial_derivative_leibniz', 'x', ['tuple', 't']], '\\frac { \\partial x } { \\partial t } = q': ['=', ['partial_derivative_leibniz', 'x', ['tuple', 't']], 'q'], '\\frac{\\partial x_2}{\\partial t}': ["/", ["*", "partial", ["_", "x", 2]], ["*", "partial", "t"]], '\\frac{\\partial xy}{\\partial t}': ["/", ["*", "partial", "x", "y"], ["*", "partial", "t"]], '\\frac{\\partial^2x}{\\partial t^2}': ['partial_derivative_leibniz', ['tuple', 'x', 2], ['tuple', ['tuple', 't', 2]]], '\\frac{\\partial^{2}x}{\\partial t^{ 2 }}': ['partial_derivative_leibniz', ['tuple', 'x', 2], ['tuple', ['tuple', 't', 2]]], '\\frac{\\partial ^2x}{\\partial t^3}': ["/", ["*", ["^", "partial", 2], "x"], ["*", "partial", ["^", "t", 3]]], '\\frac{\\partial ^2x}{\\partial s\\partial t}': ['partial_derivative_leibniz', ['tuple', 'x', 2], ['tuple', 's', 't']], '\\frac{\\partial ^2x}{\\partial s\\partial ta}': ["/", ["*", ["^", "partial", 2], "x"], ["*", "partial", "s", "partial", "t", "a"]], '\\frac{\\partial ^3x}{\\partial s^2\\partial t}': ['partial_derivative_leibniz', ['tuple', 'x', 3], ['tuple', ['tuple', 's', 2], 't']], '\\frac{\\partial ^{ 3 }x}{\\partial s^{2}\\partial t}': ['partial_derivative_leibniz', ['tuple', 'x', 3], ['tuple', ['tuple', 's', 2], 't']], '\\frac{\\partial ^3x}{\\partial s\\partial t^2}': ['partial_derivative_leibniz', ['tuple', 'x', 3], ['tuple', 's', ['tuple', 't', 2]]], '\\frac{\\partial ^{3}x}{\\partial s\\partial t^{ 2 }}': ['partial_derivative_leibniz', ['tuple', 'x', 3], ['tuple', 's', ['tuple', 't', 2]]], '\\frac{\\partial \\theta}{\\partial \\pi}': ['partial_derivative_leibniz', 'theta', ['tuple', 'pi']], '\\frac{\\partial \\var{hello}}{\\partial \\var{bye}}': ['partial_derivative_leibniz', 'hello', ['tuple', 'bye']], '\\frac{\\partial ^2\\theta}{\\partial \\pi^2}': ['partial_derivative_leibniz', ['tuple', 'theta', 2], ['tuple', ['tuple', 'pi', 2]]], '\\frac{\\partial ^2\\var{hello}}{\\partial \\var{bye}^2}': ['partial_derivative_leibniz', ['tuple', 'hello', 2], ['tuple', ['tuple', 'bye', 2]]], '\\frac{\\partial ^{2}\\theta}{\\partial \\pi^{ 2 }}': ['partial_derivative_leibniz', ['tuple', 'theta', 2], ['tuple', ['tuple', 'pi', 2]]], '\\frac{\\partial ^{ 2 }\\var{hello}}{\\partial \\var{bye}^{2}}': ['partial_derivative_leibniz', ['tuple', 'hello', 2], ['tuple', ['tuple', 'bye', 2]]], '2 \\cdot 3': ['*', 2, 3], '2\\cdot3': ['*', 2, 3], '2 \\times 3': ['*', 2, 3], '2\\times3': ['*', 2, 3], '3 \\div 1': ['/', 3, 1], '3\\div1': ['/', 3, 1], '\\sin2': ['apply', 'sin', 2], '3|x|': ['*', 3, ['apply', 'abs', 'x']], '|a|b|c|': ['*',['apply', 'abs', 'a'], 'b', ['apply', 'abs', 'c']], '|a|*b*|c|': ['*',['apply', 'abs', 'a'], 'b', ['apply', 'abs', 'c']], '|a*|b|*c|': ['apply', 'abs', ['*', 'a', ['apply', 'abs', 'b'], 'c']], '\\left|a\\left|b\\right|c\\right|': ['apply', 'abs', ['*', 'a', ['apply', 'abs', 'b'], 'c']], '|a(q|b|r)c|': ['apply', 'abs', ['*', 'a', 'q', ['apply', 'abs', 'b'], 'r', 'c']], 'r=1|x': ['|', ['=', 'r', 1], 'x'], '\\{ x | x > 0 \\}': ['set', ['|', 'x', ['>', 'x', 0]]], 'r=1 \\mid x': ['|', ['=', 'r', 1], 'x'], '\\{ x \\mid x > 0 \\}': ['set', ['|', 'x', ['>', 'x', 0]]], 'r=1:x': [':', ['=', 'r', 1], 'x'], '\\{ x : x > 0 \\}': ['set', [':', 'x', ['>', 'x', 0]]], '\\ldots': ['ldots'], '1,2,3,\\ldots': ['list', 1, 2, 3, ['ldots']], '(1,2,3,\\ldots)': ['tuple', 1, 2, 3, ['ldots']], 'a-2b': ['+', 'a', ['-', ['*', 2, 'b']]], 'a+-2b': ['+', 'a', ['-', ['*', 2, 'b']]], 'a+(-2b)': ['+', 'a', ['-', ['*', 2, 'b']]], }; Object.keys(trees).forEach(function(string) { test("parses " + string, () => { expect(converter.convert(string)).toEqual(trees[string]); }); }); // inputs that should throw an error var bad_inputs = { '1++1': "Invalid location of '+'", ')1++1': "Invalid location of ')'", '(1+1': "Expecting )", 'x-y-': "Unexpected end of input", '|x_|': "Unexpected end of input", '_x': "Invalid location of _", 'x_': "Unexpected end of input", 'x@2': "Invalid symbol '@'", '|y/v': "Expecting |", 'x+^2': "Invalid location of ^", 'x/\'y': "Invalid location of '", '[1,2,3)': "Expecting ]", '(1,2,3]': "Expecting )", '[x)': "Expecting ]", '(x]': "Expecting )", '\\sin': "Unexpected end of input", '\\sin+\\cos': "Invalid location of '+'", } Object.keys(bad_inputs).forEach(function(string) { test("throws " + string, function() { expect(() => {converter.convert(string)}).toThrow(bad_inputs[string]); }); }); test("function symbols", function () { let converter = new latexToAst({functionSymbols: []}); expect(converter.convert('f(x)+h(y)')).toEqual( ['+',['*', 'f', 'x'], ['*', 'h', 'y']]); converter = new latexToAst({functionSymbols: ['f']}); expect(converter.convert('f(x)+h(y)')).toEqual( ['+',['apply', 'f', 'x'], ['*', 'h', 'y']]); converter = new latexToAst({functionSymbols: ['f', 'h']}); expect(converter.convert('f(x)+h(y)')).toEqual( ['+',['apply', 'f', 'x'], ['apply', 'h', 'y']]); converter = new latexToAst({functionSymbols: ['f', 'h', 'x']}); expect(converter.convert('f(x)+h(y)')).toEqual( ['+',['apply', 'f', 'x'], ['apply', 'h', 'y']]); }); test("applied function symbols", function () { let converter = new latexToAst({appliedFunctionSymbols: [], allowedLatexSymbols: ['custom', 'sin']}); expect(converter.convert('\\sin(x) + \\custom(y)')).toEqual( ['+', ['*', 'sin', 'x'], ['*', 'custom', 'y']]); expect(converter.convert('\\sin x + \\custom y')).toEqual( ['+', ['*', 'sin', 'x'], ['*', 'custom', 'y']]); converter = new latexToAst({appliedFunctionSymbols: ['custom'], allowedLatexSymbols: ['custom', 'sin']}); expect(converter.convert('\\sin(x) + \\custom(y)')).toEqual( ['+', ['*', 'sin', 'x'], ['apply', 'custom', 'y']]); expect(converter.convert('\\sin x + \\custom y')).toEqual( ['+', ['*', 'sin', 'x'], ['apply', 'custom', 'y']]); converter = new latexToAst({appliedFunctionSymbols: ['custom', 'sin'], allowedLatexSymbols: ['custom', 'sin']}); expect(converter.convert('\\sin(x) + \\custom(y)')).toEqual( ['+', ['apply', 'sin', 'x'], ['apply', 'custom', 'y']]); expect(converter.convert('\\sin x + \\custom y')).toEqual( ['+', ['apply', 'sin', 'x'], ['apply', 'custom', 'y']]); }); test("allow simplified function application", function () { let converter = new latexToAst(); expect(converter.convert('\\sin x')).toEqual( ['apply', 'sin', 'x']); converter = new latexToAst({allowSimplifiedFunctionApplication: false}); expect(() => {converter.convert('\\sin x')}).toThrow( "Expecting ( after function"); converter = new latexToAst({allowSimplifiedFunctionApplication: true}); expect(converter.convert('\\sin x')).toEqual( ['apply', 'sin', 'x']); }); test("parse Leibniz notation", function () { let converter = new latexToAst(); expect(converter.convert('\\frac{dy}{dx}')).toEqual( ['derivative_leibniz', 'y', ['tuple', 'x']]); converter = new latexToAst({parseLeibnizNotation: false}); expect(converter.convert('\\frac{dy}{dx}')).toEqual( ['/', ['*', 'd', 'y'], ['*', 'd', 'x']]); converter = new latexToAst({parseLeibnizNotation: true}); expect(converter.convert('\\frac{dy}{dx}')).toEqual( ['derivative_leibniz', 'y', ['tuple', 'x']]); }); test("conditional probability", function () { let converter = new latexToAst({functionSymbols: ["P"]}); expect(converter.convert("P(A|B)")).toEqual( ['apply', 'P', ['|', 'A', 'B']]); expect(converter.convert("P(A:B)")).toEqual( ['apply', 'P', [':', 'A', 'B']]); expect(converter.convert("P(R=1|X>2)")).toEqual( ['apply', 'P', ['|', ['=', 'R', 1], ['>', 'X', 2]]]); expect(converter.convert("P(R=1:X>2)")).toEqual( ['apply', 'P', [':', ['=', 'R', 1], ['>', 'X', 2]]]); expect(converter.convert("P( A \\land B | C \\lor D )")).toEqual( ['apply', 'P', ['|', ['and', 'A', 'B'], ['or', 'C', 'D']]]); expect(converter.convert("P( A \\land B : C \\lor D )")).toEqual( ['apply', 'P', [':', ['and', 'A', 'B'], ['or', 'C', 'D']]]); });
47.976064
174
0.417762
6a3e42e60ac0996c45b86594d051780261f4b6e3
2,289
js
JavaScript
packages/react-flight-dom-webpack/src/ReactFlightDOMClient.js
anton-treez/react
a3bf6688121e69cfb377c25f362000b33d7984cd
[ "MIT" ]
null
null
null
packages/react-flight-dom-webpack/src/ReactFlightDOMClient.js
anton-treez/react
a3bf6688121e69cfb377c25f362000b33d7984cd
[ "MIT" ]
40
2020-03-09T16:41:50.000Z
2022-03-08T23:13:17.000Z
packages/react-flight-dom-webpack/src/ReactFlightDOMClient.js
anton-treez/react
a3bf6688121e69cfb377c25f362000b33d7984cd
[ "MIT" ]
1
2021-02-14T05:57:32.000Z
2021-02-14T05:57:32.000Z
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow */ import type {ReactModelRoot} from 'react-client/src/ReactFlightClient'; import { createResponse, getModelRoot, reportGlobalError, processStringChunk, processBinaryChunk, complete, } from 'react-client/src/ReactFlightClient'; function startReadingFromStream(response, stream: ReadableStream): void { let reader = stream.getReader(); function progress({done, value}) { if (done) { complete(response); return; } let buffer: Uint8Array = (value: any); processBinaryChunk(response, buffer); return reader.read().then(progress, error); } function error(e) { reportGlobalError(response, e); } reader.read().then(progress, error); } function readFromReadableStream<T>(stream: ReadableStream): ReactModelRoot<T> { let response = createResponse(stream); startReadingFromStream(response, stream); return getModelRoot(response); } function readFromFetch<T>( promiseForResponse: Promise<Response>, ): ReactModelRoot<T> { let response = createResponse(promiseForResponse); promiseForResponse.then( function(r) { startReadingFromStream(response, (r.body: any)); }, function(e) { reportGlobalError(response, e); }, ); return getModelRoot(response); } function readFromXHR<T>(request: XMLHttpRequest): ReactModelRoot<T> { let response = createResponse(request); let processedLength = 0; function progress(e: ProgressEvent): void { let chunk = request.responseText; processStringChunk(response, chunk, processedLength); processedLength = chunk.length; } function load(e: ProgressEvent): void { progress(e); complete(response); } function error(e: ProgressEvent): void { reportGlobalError(response, new TypeError('Network error')); } request.addEventListener('progress', progress); request.addEventListener('load', load); request.addEventListener('error', error); request.addEventListener('abort', error); request.addEventListener('timeout', error); return getModelRoot(response); } export {readFromXHR, readFromFetch, readFromReadableStream};
27.578313
79
0.720402
6a3f0cfaecc36d5879b53a9104cc63529e7bb208
83
js
JavaScript
tests/semantics/language/toString1.js
aliahsan07/safe-development
542e4ebe5142912ad212a8517051462633bede2c
[ "BSD-3-Clause" ]
2
2021-11-25T12:53:02.000Z
2022-02-01T23:29:49.000Z
tests/semantics/language/toString1.js
aliahsan07/safe-development
542e4ebe5142912ad212a8517051462633bede2c
[ "BSD-3-Clause" ]
null
null
null
tests/semantics/language/toString1.js
aliahsan07/safe-development
542e4ebe5142912ad212a8517051462633bede2c
[ "BSD-3-Clause" ]
1
2021-06-03T21:38:53.000Z
2021-06-03T21:38:53.000Z
var o = {}; o[undefined] = 1; var __result1 = o["undefined"]; var __expect1 = 1;
11.857143
31
0.60241
6a3f8ce7e0322be6f6dcfdaf675d8395371f410f
9,056
js
JavaScript
packages/root/rootshell/build/main.ee28ace792b682347e2c.js
gregcousin126/multiframework-conversion
4ce3470b9d352009c2f325ee474d205ba64247f7
[ "MIT" ]
null
null
null
packages/root/rootshell/build/main.ee28ace792b682347e2c.js
gregcousin126/multiframework-conversion
4ce3470b9d352009c2f325ee474d205ba64247f7
[ "MIT" ]
null
null
null
packages/root/rootshell/build/main.ee28ace792b682347e2c.js
gregcousin126/multiframework-conversion
4ce3470b9d352009c2f325ee474d205ba64247f7
[ "MIT" ]
null
null
null
(()=>{var e,r,t,n,o,a,i={304:(e,r,t)=>{"use strict";var n=new Error;e.exports=new Promise(((e,r)=>{if("undefined"!=typeof rootportal)return e();t.l("http://localhost:7076/remoteEntry.js",(t=>{if("undefined"!=typeof rootportal)return e();var o=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;n.message="Loading script failed.\n("+o+": "+a+")",n.name="ScriptExternalLoadError",n.type=o,n.request=a,r(n)}),"rootportal")})).then((()=>rootportal))},362:(e,r,t)=>{"use strict";var n=new Error;e.exports=new Promise(((e,r)=>{if("undefined"!=typeof webauth)return e();t.l("http://localhost:7075/remoteEntry.js",(t=>{if("undefined"!=typeof webauth)return e();var o=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;n.message="Loading script failed.\n("+o+": "+a+")",n.name="ScriptExternalLoadError",n.type=o,n.request=a,r(n)}),"webauth")})).then((()=>webauth))},756:(e,r,t)=>{"use strict";var n=new Error;e.exports=new Promise(((e,r)=>{if("undefined"!=typeof webevent)return e();t.l("http://localhost:7071/remoteEntry.js",(t=>{if("undefined"!=typeof webevent)return e();var o=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;n.message="Loading script failed.\n("+o+": "+a+")",n.name="ScriptExternalLoadError",n.type=o,n.request=a,r(n)}),"webevent")})).then((()=>webevent))},421:(e,r,t)=>{"use strict";var n=new Error;e.exports=new Promise(((e,r)=>{if("undefined"!=typeof weborder)return e();t.l("http://localhost:7072/remoteEntry.js",(t=>{if("undefined"!=typeof weborder)return e();var o=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;n.message="Loading script failed.\n("+o+": "+a+")",n.name="ScriptExternalLoadError",n.type=o,n.request=a,r(n)}),"weborder")})).then((()=>weborder))},221:(e,r,t)=>{"use strict";var n=new Error;e.exports=new Promise(((e,r)=>{if("undefined"!=typeof webproduct)return e();t.l("http://localhost:7073/remoteEntry.js",(t=>{if("undefined"!=typeof webproduct)return e();var o=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;n.message="Loading script failed.\n("+o+": "+a+")",n.name="ScriptExternalLoadError",n.type=o,n.request=a,r(n)}),"webproduct")})).then((()=>webproduct))},279:(e,r,t)=>{"use strict";var n=new Error;e.exports=new Promise(((e,r)=>{if("undefined"!=typeof webuser)return e();t.l("http://localhost:7074/remoteEntry.js",(t=>{if("undefined"!=typeof webuser)return e();var o=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;n.message="Loading script failed.\n("+o+": "+a+")",n.name="ScriptExternalLoadError",n.type=o,n.request=a,r(n)}),"webuser")})).then((()=>webuser))}},s={};function u(e){if(s[e])return s[e].exports;var r=s[e]={id:e,exports:{}};return i[e](r,r.exports,u),r.exports}u.m=i,u.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return u.d(r,{a:r}),r},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,u.t=function(t,n){if(1&n&&(t=this(t)),8&n)return t;if("object"==typeof t&&t){if(4&n&&t.__esModule)return t;if(16&n&&"function"==typeof t.then)return t}var o=Object.create(null);u.r(o);var a={};e=e||[null,r({}),r([]),r(r)];for(var i=2&n&&t;"object"==typeof i&&!~e.indexOf(i);i=r(i))Object.getOwnPropertyNames(i).forEach((e=>a[e]=()=>t[e]));return a.default=()=>t,u.d(o,a),o},u.d=(e,r)=>{for(var t in r)u.o(r,t)&&!u.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},u.f={},u.e=e=>Promise.all(Object.keys(u.f).reduce(((r,t)=>(u.f[t](e,r),r)),[])),u.u=e=>e+"."+{275:"8a0bfe9056c301fe56d8",284:"e988f2d95f227f297db4",369:"0870d66ec5f34c9bfd3b",472:"699d29d5e163a957fb3c",616:"f09c74e6a5ba616960f3",749:"fd6354cb9795cd405232",759:"b17b1239216067444c05",948:"08122d3f8ec922944e9c",989:"8c8aeb350f90bb962fba"}[e]+".js",u.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),u.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t={},n="rootshell:",u.l=(e,r,o)=>{if(t[e])t[e].push(r);else{var a,i;if(void 0!==o)for(var s=document.getElementsByTagName("script"),f=0;f<s.length;f++){var p=s[f];if(p.getAttribute("src")==e||p.getAttribute("data-webpack")==n+o){a=p;break}}a||(i=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,u.nc&&a.setAttribute("nonce",u.nc),a.setAttribute("data-webpack",n+o),a.src=e),t[e]=[r];var l=(r,n)=>{a.onerror=a.onload=null,clearTimeout(d);var o=t[e];if(delete t[e],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach((e=>e(n))),r)return r(n)},d=setTimeout(l.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=l.bind(null,a.onerror),a.onload=l.bind(null,a.onload),i&&document.head.appendChild(a)}},u.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o={275:[275],369:[369],616:[616],749:[749],948:[948],989:[989]},a={275:["default","./ApplicationPage",221],369:["default","./ApplicationPage",362],616:["default","./ApplicationPage",421],749:["default","./App",304],948:["default","./ApplicationPage",756],989:["default","./ApplicationPage",279]},u.f.remotes=(e,r)=>{u.o(o,e)&&o[e].forEach((e=>{var t=u.R;t||(t=[]);var n=a[e];if(!(t.indexOf(n)>=0)){if(t.push(n),n.p)return r.push(n.p);var o=r=>{r||(r=new Error("Container missing")),"string"==typeof r.message&&(r.message+='\nwhile loading "'+n[1]+'" from '+n[2]),i[e]=()=>{throw r},n.p=0},s=(e,t,a,i,s,u)=>{try{var f=e(t,a);if(!f||!f.then)return s(f,i,u);var p=f.then((e=>s(e,i)),o);if(!u)return p;r.push(n.p=p)}catch(e){o(e)}},f=(e,r,o)=>s(r.get,n[1],t,0,p,o),p=r=>{n.p=1,i[e]=e=>{e.exports=r()}};s(u,n[2],0,0,((e,r,t)=>e?s(u.I,n[0],0,e,f,t):o()),1)}}))},(()=>{u.S={};var e={},r={};u.I=(t,n)=>{n||(n=[]);var o=r[t];if(o||(o=r[t]={}),!(n.indexOf(o)>=0)){if(n.push(o),e[t])return e[t];u.o(u.S,t)||(u.S[t]={});var a=u.S[t],i="rootshell",s=e=>{var r=e=>{return r="Initialization of sharing external failed: "+e,"undefined"!=typeof console&&console.warn&&console.warn(r);var r};try{var o=u(e);if(!o)return;var a=e=>e&&e.init&&e.init(u.S[t],n);if(o.then)return f.push(o.then(a,r));var i=a(o);if(i&&i.then)return f.push(i.catch(r))}catch(e){r(e)}},f=[];switch(t){case"default":((e,r,t)=>{var n=a[e]=a[e]||{},o=n[r];(!o||!o.loaded&&i>o.from)&&(n[r]={get:()=>u.e(759).then((()=>()=>u(759))),from:i})})("single-spa","5.9.3"),s(304),s(756),s(421),s(221),s(279),s(362)}return f.length?e[t]=Promise.all(f).then((()=>e[t]=1)):e[t]=1}}})(),u.p="/home/gregcousin/projects/microboil/eurika/microboil-root-eureka/microboil-frontend-eureka/packages/root/rootshell/build",(()=>{var e=e=>{var r=e=>e.split(".").map((e=>+e==e?+e:e)),t=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),n=t[1]?r(t[1]):[];return t[2]&&(n.length++,n.push.apply(n,r(t[2]))),t[3]&&(n.push([]),n.push.apply(n,r(t[3]))),n},r=(t,n)=>{if(0 in t){n=e(n);var o=t[0],a=o<0;a&&(o=-o-1);for(var i=0,s=1,u=!0;;s++,i++){var f,p,l=s<t.length?(typeof t[s])[0]:"";if(i>=n.length||"o"==(p=(typeof(f=n[i]))[0]))return!u||("u"==l?s>o&&!a:""==l!=a);if("u"==p){if(!u||"u"!=l)return!1}else if(u)if(l==p)if(s<=o){if(f!=t[s])return!1}else{if(a?f>t[s]:f<t[s])return!1;f!=t[s]&&(u=!1)}else if("s"!=l&&"n"!=l){if(a||s<=o)return!1;u=!1,s--}else{if(s<=o||p<l!=a)return!1;u=!1}else"s"!=l&&"n"!=l&&(u=!1,s--)}}var d=[],c=d.pop.bind(d);for(i=1;i<t.length;i++){var h=t[i];d.push(1==h?c()|c():2==h?c()&c():h?r(h,n):!c())}return!!c()},t=(t,n,o)=>{var a=t[n];return(n=Object.keys(a).reduce(((t,n)=>!r(o,n)||t&&!((r,t)=>{r=e(r),t=e(t);for(var n=0;;){if(n>=r.length)return n<t.length&&"u"!=(typeof t[n])[0];var o=r[n],a=(typeof o)[0];if(n>=t.length)return"u"==a;var i=t[n],s=(typeof i)[0];if(a!=s)return"o"==a&&"n"==s||"s"==s||"u"==a;if("o"!=a&&"u"!=a&&o!=i)return o<i;n++}})(t,n)?t:n),0))&&a[n]},n=(e=>function(r,t,n,o){var a=u.I(r);return a&&a.then?a.then(e.bind(e,r,u.S[r],t,n,o)):e(r,u.S[r],t,n,o)})(((e,r,n,o,a)=>{var i=r&&u.o(r,n)&&t(r,n,o);return i?(e=>(e.loaded=1,e.get()))(i):a()})),o={},a={130:()=>n("default","single-spa",[1,5,8,2],(()=>u.e(759).then((()=>()=>u(759)))))},f={284:[130]};u.f.consumes=(e,r)=>{u.o(f,e)&&f[e].forEach((e=>{if(u.o(o,e))return r.push(o[e]);var t=r=>{o[e]=0,i[e]=t=>{delete s[e],t.exports=r()}},n=r=>{delete o[e],i[e]=t=>{throw delete s[e],r}};try{var f=a[e]();f.then?r.push(o[e]=f.then(t).catch(n)):t(f)}catch(e){n(e)}}))}})(),(()=>{var e={179:0};u.f.j=(r,t)=>{var n=u.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else if(/^(284|472|759)$/.test(r)){var o=new Promise(((t,o)=>{n=e[r]=[t,o]}));t.push(n[2]=o);var a=u.p+u.u(r),i=new Error;u.l(a,(t=>{if(u.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var o=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;i.message="Loading chunk "+r+" failed.\n("+o+": "+a+")",i.name="ChunkLoadError",i.type=o,i.request=a,n[1](i)}}),"chunk-"+r)}else e[r]=0};var r=self.webpackChunkrootshell=self.webpackChunkrootshell||[],t=r.push.bind(r);r.push=r=>{for(var n,o,[a,i,s]=r,f=0,p=[];f<a.length;f++)o=a[f],u.o(e,o)&&e[o]&&p.push(e[o][0]),e[o]=0;for(n in i)u.o(i,n)&&(u.m[n]=i[n]);for(s&&s(u),t(r);p.length;)p.shift()()}})(),u.e(284).then(u.bind(u,284))})();
9,056
9,056
0.607111
6a3fd3299c0f26ea263ef7050db91be4e50fa1b2
4,060
js
JavaScript
src/pages/index.js
oflynned/Portfolio-Website
f57dfdcce4db0c3c026ac45b7ed16fa142111dea
[ "MIT" ]
null
null
null
src/pages/index.js
oflynned/Portfolio-Website
f57dfdcce4db0c3c026ac45b7ed16fa142111dea
[ "MIT" ]
null
null
null
src/pages/index.js
oflynned/Portfolio-Website
f57dfdcce4db0c3c026ac45b7ed16fa142111dea
[ "MIT" ]
null
null
null
import React, {Component} from "react"; import {Helmet} from "react-helmet"; import {Link} from "gatsby"; import {overview} from "../common/skills"; import NavBar from "../components/nav/NavBar"; import TextLoop from "react-text-loop"; import "./index.css" import Card from "../components/layout/card"; const jobTitles = [ "a full-stack engineer.", "a TypeScript developer.", "a React developer.", "a Node.js developer.", "an Android developer." ]; class Index extends Component { render() { return ( <div className={"index"}> <Helmet> <title>Edmond O'Flynn | Software Engineer</title>/> </Helmet> <NavBar selectedIndex={0}/> <div className={"content"}> <div className={"offset-page-content"}> <div className={"content-inner"}> <h1>Hi there, I'm Ed</h1> <h2 className={"job-title"}> <span>I'm </span> <span><TextLoop interval={1500} children={jobTitles}/></span> </h2> <p>I've been working as a software engineer since 2015.</p> <p>I have maintained, developed, and launched multiple projects from scratch.</p> <p>I am specialised in both frontend and backend development with complex, scalable web applications.</p> <p>I work mainly with Javascript with frameworks such as React.js and Node.js, but also have extensive experience with Ruby, Java and Python.</p> <p> Check out my <a href={"/cv.pdf"} target={"_blank"}>resume</a> or in-depth project <Link to={"/portfolio"}>portfolio</Link> for more information. </p> <div className={"grid competencies"}> <div className={"col"}> <p>My core development competencies:</p> <ul> <li>Writing clean code</li> <li>Test-driven development</li> <li>Continuous integration/delivery</li> <li>Code review</li> <li>Story/task estimation</li> </ul> </div> <div className={"col"}> <p>My core management competencies:</p> <ul> <li>Backlog grooming</li> <li>Leading project teams</li> <li>Team mentoring</li> <li>Sprint management</li> <li>Client requirement gathering</li> </ul> </div> </div> <h2>Technologies Overview</h2> <div className={"grid competencies"}> { overview.map(({title, description, icons}) => <div className={"col"}> <Card title={title} description={description} icons={icons}/> </div> ) } </div> </div> </div> </div> </div> ) } } export default Index
42.736842
120
0.384236
6a40703d7cd1dceda7f8ee1a31c9c2de54afaf00
1,323
js
JavaScript
src/_reducers/__tests__/PaymentAgentReducer-test.js
nuruddeensalihu/nuruddeensalihu.github.io
2483992ff5947165744fc60c96eecdc373738fc8
[ "MIT" ]
1
2020-08-30T04:27:09.000Z
2020-08-30T04:27:09.000Z
src/_reducers/__tests__/PaymentAgentReducer-test.js
DanSallau/nuruddeensalihu.github.io
2483992ff5947165744fc60c96eecdc373738fc8
[ "MIT" ]
null
null
null
src/_reducers/__tests__/PaymentAgentReducer-test.js
DanSallau/nuruddeensalihu.github.io
2483992ff5947165744fc60c96eecdc373738fc8
[ "MIT" ]
null
null
null
import { expect } from 'chai'; import { fromJS } from 'immutable'; import paymentAgentReducer from '../PaymentAgentReducer'; import { SERVER_DATA_PAYMENT_AGENTS, UPDATE_PAYMENT_AGENT_FIELD, } from '../../_constants/ActionTypes'; describe('paymentAgentReducer', () => { it('should update data payment agent list', () => { const beforeState = fromJS({}); const action = { type: SERVER_DATA_PAYMENT_AGENTS, serverResponse: { paymentagent_list: { list: ['First Agent', 'Second Agent'], }, }, }; const expectedState = fromJS({ paymentAgents: ['First Agent', 'Second Agent'], }); const actualState = paymentAgentReducer(beforeState, action); expect(expectedState).to.equal(actualState); }); it('should should update payment agent field with the given value', () => { const beforeState = fromJS({}); const action = { type: UPDATE_PAYMENT_AGENT_FIELD, fieldName: 'username', fieldValue: 'xxx', }; const expectedState = fromJS({ username: 'xxx' }); const actualState = paymentAgentReducer(beforeState, action); expect(expectedState).to.equal(actualState); }); });
32.268293
79
0.585034
6a413056c8f9d5dc2f49e17e8bea88c04086fcdb
1,303
js
JavaScript
hocs/withErrorBoundary/index.js
zconnect-iot/zconnect-web
ac3f258fecc8eed3d9cf574bda4e2e85f48e87cc
[ "MIT" ]
2
2018-08-19T16:16:53.000Z
2019-06-11T02:24:14.000Z
hocs/withErrorBoundary/index.js
zconnect-iot/zconnect-web
ac3f258fecc8eed3d9cf574bda4e2e85f48e87cc
[ "MIT" ]
1
2018-06-28T14:07:46.000Z
2018-06-28T14:07:46.000Z
hocs/withErrorBoundary/index.js
zconnect-iot/zconnect-web
ac3f258fecc8eed3d9cf574bda4e2e85f48e87cc
[ "MIT" ]
null
null
null
import React from 'react' import ErrorHandler from './ErrorHandler' /* Wraps the component in an error boundary and renders the FallbackComponent in the event of a render error. The retry callback resets the state which triggers another render attempt. The errorCallback can be used for reporting errors to Sentry */ export default function withErrorBoundary(config = {}) { const { FallbackComponent = ErrorHandler, errorCallback = null } = config return function withErrorBoundaryEnhancer(WrappedComponent) { class WithErrorBoundary extends React.Component { constructor(props) { super(props) this.state = { error: null, } } componentDidCatch(error, info) { this.setState({ error, info }) return errorCallback ? errorCallback(error, info) : null } retry = () => this.setState({ error: null }) render() { if (this.state.error) return (<FallbackComponent retry={this.retry} error={this.state.error} info={this.state.info} />) return <WrappedComponent {...this.props} /> } } WithErrorBoundary.displayName = `withErrorBoundary(${WrappedComponent.displayName || WrappedComponent.name || 'Component'})` return WithErrorBoundary } }
34.289474
128
0.665388
6a4225b7e37c8c58c2b85e4e40bf52ec4872606f
9,175
js
JavaScript
src/DataTable2/index.js
zhiyingzzhou/bfd-ui
dcd219e5c11e52598ea688712ef55f19be4bdc80
[ "BSD-3-Clause" ]
288
2016-09-21T09:00:06.000Z
2021-12-27T02:54:08.000Z
src/DataTable2/index.js
zhiyingzzhou/bfd-ui
dcd219e5c11e52598ea688712ef55f19be4bdc80
[ "BSD-3-Clause" ]
24
2016-09-26T08:13:13.000Z
2018-01-23T09:21:44.000Z
src/DataTable2/index.js
zhiyingzzhou/bfd-ui
dcd219e5c11e52598ea688712ef55f19be4bdc80
[ "BSD-3-Clause" ]
49
2016-10-24T08:09:48.000Z
2021-04-29T04:53:34.000Z
/** * Copyright 2016-present, Baifendian, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ import React, { Component, PropTypes } from 'react' import classnames from 'classnames' import isPlainObject from 'lodash/isPlainObject' import invariant from 'invariant' import propsToState from '../_shared/propsToState' import dataFilter from '../_shared/dataFilter' import Icon from '../Icon' import Fetch from '../Fetch' import Paging from '../Paging' import '../table.less' import './index.less' class DataTable extends Component { constructor(props) { super() this.state = { currentPage: props.currentPage || 1, totalCounts: props.totalCounts, data: props.data || [], sortKey: props.sortKey, sortType: props.sortType || 'desc' } } componentWillReceiveProps(nextProps) { const newProps = propsToState( nextProps, ['data', 'totalCounts', 'currentPage', 'sortKey', 'sortType'] ) // if ((JSON.stringify(newProps) != JSON.stringify(this.props.data)) && !newProps.hasOwnProperty('currentPage')){ // newProps['currentPage'] = 1 // } this.setState(newProps) } /** * 修改table页面为指定的值 * @param currentPage */ setCurrentPage(currentPage){ this.setState({currentPage}) } handleSort(nextSortKey) { const { sortKey, sortType } = this.state let nextSortType if (sortKey === nextSortKey) { nextSortType = sortType === 'desc' ? 'asc' : 'desc' } else { nextSortType = 'desc' } this.setState({ currentPage: 1, sortKey: nextSortKey, sortType: nextSortType }) this.props.onPageChange && this.props.onPageChange(1) this.props.onSort && this.props.onSort(nextSortKey, nextSortType) } handleLoad(res) { const { url } = this.props res = dataFilter(this, res) invariant( isPlainObject(res), `\`DataTable2\` data should be \`Plain Object\`, check the response of \`${url}\` or the return value of \`dataFilter\`.` ) const { totalCounts } = res const data = res.data || [] invariant( Array.isArray(data), `Invalid JSON for \`DataTable2\`, check the response of \`${url}\` or the return value of \`dataFilter\`. eg: { totalCounts: 1200, data: [{...}] }` ) this.setState({ totalCounts, data }) } handlePageChange(currentPage) { this.setState({ currentPage }) this.props.onPageChange && this.props.onPageChange(currentPage) } getUrl() { const { url, pagingDisabled, pageSize } = this.props const { currentPage, sortKey, sortType } = this.state if (this.props.getUrl) { return this.props.getUrl({ currentPage, pageSize, sortKey, sortType }) } if (!url) return const query = Object.create(null) pagingDisabled || Object.assign(query, { start: this.getStart(), limit: pageSize }) sortKey && Object.assign(query, { sortKey, sortType }) const queryString = Object.keys(query).map(key => key + '=' + query[key]).join('&') let _url = url if (queryString) { const connector = _url.indexOf('?') === -1 ? '?' : '&' _url += connector + queryString } return _url } getTheads() { const { columns } = this.props const { sortKey, sortType } = this.state const Theads = columns.map((item, i) => { const { title, sortable } = item let icon = sortable ? 'sort' : null if (sortable && item.key && item.key === sortKey) { icon += '-' + sortType } return ( <th key={i} width={item.width} className={classnames({'bfd-datatable__th--sortable': sortable})} onClick={() => sortable && this.handleSort(item.key)} > {title} {sortable && <Icon className="bfd-datatable__sort-symbol" type={icon} />} </th> ) }) return Theads } getRow(item, i) { const { columns, rowRender } = this.props if (rowRender) { return rowRender(item, i, columns) } const Tds = columns.map((column, j) => { const value = item[column.key] return <td key={j}>{column.render ? column.render(item, i, value) : value}</td> }) return <tr key={i}>{Tds}</tr> } getCurrentPageData() { const { pagingDisabled, pageSize, url } = this.props const { totalCounts, data, sortKey, sortType } = this.state let renderData = data || [] if (totalCounts || pagingDisabled) { return renderData } if (renderData.length) { // local paging if (sortKey && !url) { renderData = renderData.sort((a, b) => { if (a[sortKey] < b[sortKey]) return sortType === 'desc' ? 1 : -1 if (a[sortKey] > b[sortKey]) return sortType === 'desc' ? -1 : 1 return 0 }) } const start = this.getStart() return renderData.slice(start, start + pageSize) } return renderData } getStart() { return (this.state.currentPage - 1) * this.props.pageSize } render() { const { className, columns, url, dataFilter, onPageChange, pageSize, pagingDisabled, sortKey, sortType, onSort, rowRender, noDataContent, ...other } = this.props const { currentPage, totalCounts, data } = this.state delete other.currentPage delete other.totalCounts delete other.data const currentPageData = this.getCurrentPageData() return ( <Fetch className={classnames('bfd-datatable', className)} defaultHeight={70} url={this.getUrl()} onSuccess={::this.handleLoad} {...other} > <table className="bfd-table"> <thead> <tr>{this.getTheads()}</tr> </thead> <tbody> { currentPageData.length ? currentPageData.map(::this.getRow) : ( <tr> <td colSpan={columns.length} className="bfd-datatable__empty"> {noDataContent} </td> </tr> ) } </tbody> </table> {pagingDisabled || ( <Paging currentPage={currentPage} totalPageNum={totalCounts || data.length} pageSize={pageSize} onPageChange={::this.handlePageChange} /> )} </Fetch> ) } } DataTable.defaultProps = { pageSize: 10, noDataContent: '无数据' } DataTable.propTypes = { /** * 列配置 * ```js * [{ * title: '姓名', // 列头显示内容,string/node * key: 'name', // 数据对应的 key,用于排序、非 render 渲染 * sortable: true, // 是否开启排序功能 * width: '20%', // 列宽,像素/百分比 * render: (item, index, value) => item.authorised ? '已授权' : '未授权' * }] * ``` */ columns: PropTypes.array.isRequired, /** * 数据源,如果未指定 totalCounts,则根据 data.length 自动分页 * ```js * [{ * name: '王XX', * authorised: true * }] * ``` */ data: PropTypes.array, /** * url 数据源,这里的 url 不包括分页、排序等查询条件,组件内部会自动拼接,例如 * 指定 path/query.do,最终组件内部处理后变成 path/query.do?start=0&limit=10 * 也可以自定义 URL 规则,参见 `getUrl` 属性 * * url 数据源模式 JSON 格式: * ```js * { * totalCounts: 1200, // 没有则按上次请求返回的总条数分页或者根据 data.length 自动分页 * data: [{...}] // 同 data 属性格式 * } * ``` * 如果后台格式无法满足,可自定义 dataFilter 过滤 * url 数据源模式,分页切换、排序都会动态发请求 */ url: PropTypes.string, /** * 如果组件内部拼装的 url 不满足需求,可自定义最终的 url * ```js * getUrl={condition => 'your url'} * ``` */ getUrl: PropTypes.func, // url 数据源格式过滤器,返回过滤后的数据 dataFilter: PropTypes.func, // 当前页码,默认1,常用于条件改变后重置分页状态。url 数据源模式下请求参数会增加 start,currentPage 变化后会重新请求 currentPage: PropTypes.number, // 切换分页后的回调,参数为当前页码 onPageChange: PropTypes.func, // 每页显示的条数,默认10。url 数据源模式下请求参数会增加 limit ,pageSize 变化后会重新请求 pageSize: PropTypes.number, // 总条数,用于 data 数据源模式下的分页计算,未指定则根据 data.length 自动分页 totalCounts: PropTypes.number, // 是否禁用分页 pagingDisabled: PropTypes.bool, // 当前排序字段。url 数据源模式下请求参数会增加 sortKey,sortKey 变化后会重新请求 sortKey: PropTypes.string, // 当前排序类型,可选值:desc, asc, 默认 desc。url 数据源模式下请求参数会增加 sortType,sortType 变化后会重新请求 sortType: PropTypes.string, // 排序后的回调,参数: sortKey, sortType onSort: PropTypes.func, // 自定义 tbody 行渲染逻辑,参数(dataItem, index, columns),返回 <tr> rowRender: PropTypes.func, // 无数据时显示的内容,默认`无数据` noDataContent: PropTypes.string, customProp(props) { if (props.data && props.url) { return new Error('You can not use `data` and `url` at the same time.') } if (!props.data && !props.url) { return new Error('You should provide the `data` or `url` one of them.') } if (props.currentPage && !props.onPageChange) { return new Error( 'You provide a `currentPage` prop without an `onPageChange` handler.' ) } if (props.sortKey && !props.onSort) { return new Error('You provide a `sortKey` prop without an `onSort` handler.') } } } export default DataTable
26.749271
127
0.597057
6a4225dc3ba1c670b8b8530038387c951c93a347
364
js
JavaScript
node_modules/umi-build-dev/src/getConfig/configPlugins/chainWebpack.js
lsabella/baishu-admin
4fa931a52ec7c6990daf1cec7aeea690bb3aa68a
[ "MIT" ]
6
2019-09-06T01:29:58.000Z
2019-09-06T02:47:47.000Z
packages/umi-build-dev/src/getConfig/configPlugins/chainWebpack.js
infun-soso/umi
700450e817f0866b53080dc3e522659141a38b87
[ "MIT" ]
34
2020-09-28T07:24:42.000Z
2022-02-26T14:29:57.000Z
packages/umi-build-dev/src/getConfig/configPlugins/chainWebpack.js
infun-soso/umi
700450e817f0866b53080dc3e522659141a38b87
[ "MIT" ]
1
2019-06-26T03:20:10.000Z
2019-06-26T03:20:10.000Z
import assert from 'assert'; export default function(api) { return { name: 'chainWebpack', validate(val) { assert( typeof val === 'function', `Configure item outputPath should be Function, but got ${val}.`, ); }, onChange() { api.service.restart(/* why */ 'Configure item chainWebpack Changed.'); }, }; }
21.411765
76
0.576923
6a431b0738a60e8e5568e1669ff67351fa1939ed
3,180
js
JavaScript
sources/renderers/shaders/ShaderChunk/encodings_pars_fragment.glsl.js
Itee/three-full
71a0b1a301deee846a0b9b2133c0c8857a37cc9f
[ "MIT" ]
135
2018-04-06T05:30:30.000Z
2022-03-31T08:56:55.000Z
sources/renderers/shaders/ShaderChunk/encodings_pars_fragment.glsl.js
Itee/three-full
71a0b1a301deee846a0b9b2133c0c8857a37cc9f
[ "MIT" ]
30
2018-04-06T06:47:56.000Z
2022-03-02T03:22:35.000Z
sources/renderers/shaders/ShaderChunk/encodings_pars_fragment.glsl.js
Itee/three-full
71a0b1a301deee846a0b9b2133c0c8857a37cc9f
[ "MIT" ]
19
2018-05-26T21:16:54.000Z
2019-08-07T05:32:08.000Z
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // WARNING: This file was auto-generated, any change will be overridden in next release. Please use configs/es6.conf.js then run "npm run convert". // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// export default ` vec4 LinearToLinear( in vec4 value ) { return value; } vec4 GammaToLinear( in vec4 value, in float gammaFactor ) { return vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a ); } vec4 LinearToGamma( in vec4 value, in float gammaFactor ) { return vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a ); } vec4 sRGBToLinear( in vec4 value ) { return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); } vec4 LinearTosRGB( in vec4 value ) { return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); } vec4 RGBEToLinear( in vec4 value ) { return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 ); } vec4 LinearToRGBE( in vec4 value ) { float maxComponent = max( max( value.r, value.g ), value.b ); float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 ); return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 ); } vec4 RGBMToLinear( in vec4 value, in float maxRange ) { return vec4( value.rgb * value.a * maxRange, 1.0 ); } vec4 LinearToRGBM( in vec4 value, in float maxRange ) { float maxRGB = max( value.r, max( value.g, value.b ) ); float M = clamp( maxRGB / maxRange, 0.0, 1.0 ); M = ceil( M * 255.0 ) / 255.0; return vec4( value.rgb / ( M * maxRange ), M ); } vec4 RGBDToLinear( in vec4 value, in float maxRange ) { return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 ); } vec4 LinearToRGBD( in vec4 value, in float maxRange ) { float maxRGB = max( value.r, max( value.g, value.b ) ); float D = max( maxRange / maxRGB, 1.0 ); D = clamp( floor( D ) / 255.0, 0.0, 1.0 ); return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D ); } const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 ); vec4 LinearToLogLuv( in vec4 value ) { vec3 Xp_Y_XYZp = cLogLuvM * value.rgb; Xp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) ); vec4 vResult; vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z; float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0; vResult.w = fract( Le ); vResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0; return vResult; } const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 ); vec4 LogLuvToLinear( in vec4 value ) { float Le = value.z * 255.0 + value.w; vec3 Xp_Y_XYZp; Xp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 ); Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y; Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z; vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb; return vec4( max( vRGB, 0.0 ), 1.0 ); } `;
41.298701
179
0.579874
6a4325099b715e54d64eb3ab8369e1b7da98129b
14,317
js
JavaScript
src/themes/NightOwl.js
vhawk19/snipp.in
dac1377790e774f2889c0962786b158f637bfee9
[ "MIT" ]
null
null
null
src/themes/NightOwl.js
vhawk19/snipp.in
dac1377790e774f2889c0962786b158f637bfee9
[ "MIT" ]
null
null
null
src/themes/NightOwl.js
vhawk19/snipp.in
dac1377790e774f2889c0962786b158f637bfee9
[ "MIT" ]
null
null
null
export default { base: "vs-dark", inherit: true, rules: [ { background: "011627", token: "", }, { foreground: "637777", token: "comment", }, { foreground: "addb67", token: "string", }, { foreground: "ecc48d", token: "vstring.quoted", }, { foreground: "ecc48d", token: "variable.other.readwrite.js", }, { foreground: "5ca7e4", token: "string.regexp", }, { foreground: "5ca7e4", token: "string.regexp keyword.other", }, { foreground: "5f7e97", token: "meta.function punctuation.separator.comma", }, { foreground: "f78c6c", token: "constant.numeric", }, { foreground: "f78c6c", token: "constant.character.numeric", }, { foreground: "addb67", token: "variable", }, { foreground: "c792ea", token: "keyword", }, { foreground: "c792ea", token: "punctuation.accessor", }, { foreground: "c792ea", token: "storage", }, { foreground: "c792ea", token: "meta.var.expr", }, { foreground: "c792ea", token: "meta.class meta.method.declaration meta.var.expr storage.type.jsm", }, { foreground: "c792ea", token: "storage.type.property.js", }, { foreground: "c792ea", token: "storage.type.property.ts", }, { foreground: "c792ea", token: "storage.type.property.tsx", }, { foreground: "82aaff", token: "storage.type", }, { foreground: "ffcb8b", token: "entity.name.class", }, { foreground: "ffcb8b", token: "meta.class entity.name.type.class", }, { foreground: "addb67", token: "entity.other.inherited-class", }, { foreground: "82aaff", token: "entity.name.function", }, { foreground: "addb67", token: "punctuation.definition.variable", }, { foreground: "d3423e", token: "punctuation.section.embedded", }, { foreground: "d6deeb", token: "punctuation.terminator.expression", }, { foreground: "d6deeb", token: "punctuation.definition.arguments", }, { foreground: "d6deeb", token: "punctuation.definition.array", }, { foreground: "d6deeb", token: "punctuation.section.array", }, { foreground: "d6deeb", token: "meta.array", }, { foreground: "d9f5dd", token: "punctuation.definition.list.begin", }, { foreground: "d9f5dd", token: "punctuation.definition.list.end", }, { foreground: "d9f5dd", token: "punctuation.separator.arguments", }, { foreground: "d9f5dd", token: "punctuation.definition.list", }, { foreground: "d3423e", token: "string.template meta.template.expression", }, { foreground: "d6deeb", token: "string.template punctuation.definition.string", }, { foreground: "c792ea", fontStyle: "italic", token: "italic", }, { foreground: "addb67", fontStyle: "bold", token: "bold", }, { foreground: "82aaff", token: "constant.language", }, { foreground: "82aaff", token: "punctuation.definition.constant", }, { foreground: "82aaff", token: "variable.other.constant", }, { foreground: "7fdbca", token: "support.function.construct", }, { foreground: "7fdbca", token: "keyword.other.new", }, { foreground: "82aaff", token: "constant.character", }, { foreground: "82aaff", token: "constant.other", }, { foreground: "f78c6c", token: "constant.character.escape", }, { foreground: "addb67", token: "entity.other.inherited-class", }, { foreground: "d7dbe0", token: "variable.parameter", }, { foreground: "7fdbca", token: "entity.name.tag", }, { foreground: "cc2996", token: "punctuation.definition.tag.html", }, { foreground: "cc2996", token: "punctuation.definition.tag.begin", }, { foreground: "cc2996", token: "punctuation.definition.tag.end", }, { foreground: "addb67", token: "entity.other.attribute-name", }, { foreground: "addb67", token: "entity.name.tag.custom", }, { foreground: "82aaff", token: "support.function", }, { foreground: "82aaff", token: "support.constant", }, { foreground: "7fdbca", token: "upport.constant.meta.property-value", }, { foreground: "addb67", token: "support.type", }, { foreground: "addb67", token: "support.class", }, { foreground: "addb67", token: "support.variable.dom", }, { foreground: "7fdbca", token: "support.constant", }, { foreground: "7fdbca", token: "keyword.other.special-method", }, { foreground: "7fdbca", token: "keyword.other.new", }, { foreground: "7fdbca", token: "keyword.other.debugger", }, { foreground: "7fdbca", token: "keyword.control", }, { foreground: "c792ea", token: "keyword.operator.comparison", }, { foreground: "c792ea", token: "keyword.control.flow.js", }, { foreground: "c792ea", token: "keyword.control.flow.ts", }, { foreground: "c792ea", token: "keyword.control.flow.tsx", }, { foreground: "c792ea", token: "keyword.control.ruby", }, { foreground: "c792ea", token: "keyword.control.module.ruby", }, { foreground: "c792ea", token: "keyword.control.class.ruby", }, { foreground: "c792ea", token: "keyword.control.def.ruby", }, { foreground: "c792ea", token: "keyword.control.loop.js", }, { foreground: "c792ea", token: "keyword.control.loop.ts", }, { foreground: "c792ea", token: "keyword.control.import.js", }, { foreground: "c792ea", token: "keyword.control.import.ts", }, { foreground: "c792ea", token: "keyword.control.import.tsx", }, { foreground: "c792ea", token: "keyword.control.from.js", }, { foreground: "c792ea", token: "keyword.control.from.ts", }, { foreground: "c792ea", token: "keyword.control.from.tsx", }, { foreground: "ffffff", background: "ff2c83", token: "invalid", }, { foreground: "ffffff", background: "d3423e", token: "invalid.deprecated", }, { foreground: "7fdbca", token: "keyword.operator", }, { foreground: "c792ea", token: "keyword.operator.relational", }, { foreground: "c792ea", token: "keyword.operator.assignement", }, { foreground: "c792ea", token: "keyword.operator.arithmetic", }, { foreground: "c792ea", token: "keyword.operator.bitwise", }, { foreground: "c792ea", token: "keyword.operator.increment", }, { foreground: "c792ea", token: "keyword.operator.ternary", }, { foreground: "637777", token: "comment.line.double-slash", }, { foreground: "cdebf7", token: "object", }, { foreground: "ff5874", token: "constant.language.null", }, { foreground: "d6deeb", token: "meta.brace", }, { foreground: "c792ea", token: "meta.delimiter.period", }, { foreground: "d9f5dd", token: "punctuation.definition.string", }, { foreground: "ff5874", token: "constant.language.boolean", }, { foreground: "ffffff", token: "object.comma", }, { foreground: "7fdbca", token: "variable.parameter.function", }, { foreground: "80cbc4", token: "support.type.vendor.property-name", }, { foreground: "80cbc4", token: "support.constant.vendor.property-value", }, { foreground: "80cbc4", token: "support.type.property-name", }, { foreground: "80cbc4", token: "meta.property-list entity.name.tag", }, { foreground: "57eaf1", token: "meta.property-list entity.name.tag.reference", }, { foreground: "f78c6c", token: "constant.other.color.rgb-value punctuation.definition.constant", }, { foreground: "ffeb95", token: "constant.other.color", }, { foreground: "ffeb95", token: "keyword.other.unit", }, { foreground: "c792ea", token: "meta.selector", }, { foreground: "fad430", token: "entity.other.attribute-name.id", }, { foreground: "80cbc4", token: "meta.property-name", }, { foreground: "c792ea", token: "entity.name.tag.doctype", }, { foreground: "c792ea", token: "meta.tag.sgml.doctype", }, { foreground: "d9f5dd", token: "punctuation.definition.parameters", }, { foreground: "ecc48d", token: "string.quoted", }, { foreground: "ecc48d", token: "string.quoted.double", }, { foreground: "ecc48d", token: "string.quoted.single", }, { foreground: "addb67", token: "support.constant.math", }, { foreground: "addb67", token: "support.type.property-name.json", }, { foreground: "addb67", token: "support.constant.json", }, { foreground: "c789d6", token: "meta.structure.dictionary.value.json string.quoted.double", }, { foreground: "80cbc4", token: "string.quoted.double.json punctuation.definition.string.json", }, { foreground: "ff5874", token: "meta.structure.dictionary.json meta.structure.dictionary.value constant.language", }, { foreground: "d6deeb", token: "variable.other.ruby", }, { foreground: "ecc48d", token: "entity.name.type.class.ruby", }, { foreground: "ecc48d", token: "keyword.control.class.ruby", }, { foreground: "ecc48d", token: "meta.class.ruby", }, { foreground: "7fdbca", token: "constant.language.symbol.hashkey.ruby", }, { foreground: "e0eddd", background: "a57706", fontStyle: "italic", token: "meta.diff", }, { foreground: "e0eddd", background: "a57706", fontStyle: "italic", token: "meta.diff.header", }, { foreground: "ef535090", fontStyle: "italic", token: "markup.deleted", }, { foreground: "a2bffc", fontStyle: "italic", token: "markup.changed", }, { foreground: "a2bffc", fontStyle: "italic", token: "meta.diff.header.git", }, { foreground: "a2bffc", fontStyle: "italic", token: "meta.diff.header.from-file", }, { foreground: "a2bffc", fontStyle: "italic", token: "meta.diff.header.to-file", }, { foreground: "219186", background: "eae3ca", token: "markup.inserted", }, { foreground: "d3201f", token: "other.package.exclude", }, { foreground: "d3201f", token: "other.remove", }, { foreground: "269186", token: "other.add", }, { foreground: "ff5874", token: "constant.language.python", }, { foreground: "82aaff", token: "variable.parameter.function.python", }, { foreground: "82aaff", token: "meta.function-call.arguments.python", }, { foreground: "b2ccd6", token: "meta.function-call.python", }, { foreground: "b2ccd6", token: "meta.function-call.generic.python", }, { foreground: "d6deeb", token: "punctuation.python", }, { foreground: "addb67", token: "entity.name.function.decorator.python", }, { foreground: "8eace3", token: "source.python variable.language.special", }, { foreground: "82b1ff", token: "markup.heading.markdown", }, { foreground: "c792ea", fontStyle: "italic", token: "markup.italic.markdown", }, { foreground: "addb67", fontStyle: "bold", token: "markup.bold.markdown", }, { foreground: "697098", token: "markup.quote.markdown", }, { foreground: "80cbc4", token: "markup.inline.raw.markdown", }, { foreground: "ff869a", token: "markup.underline.link.markdown", }, { foreground: "ff869a", token: "markup.underline.link.image.markdown", }, { foreground: "d6deeb", token: "string.other.link.title.markdown", }, { foreground: "d6deeb", token: "string.other.link.description.markdown", }, { foreground: "82b1ff", token: "punctuation.definition.string.markdown", }, { foreground: "82b1ff", token: "punctuation.definition.string.begin.markdown", }, { foreground: "82b1ff", token: "punctuation.definition.string.end.markdown", }, { foreground: "82b1ff", token: "meta.link.inline.markdown punctuation.definition.string", }, { foreground: "7fdbca", token: "punctuation.definition.metadata.markdown", }, { foreground: "82b1ff", token: "beginning.punctuation.definition.list.markdown", }, ], colors: { "editor.foreground": "#d6deeb", "editor.background": "#011627", "editor.selectionBackground": "#5f7e9779", "editor.lineHighlightBackground": "#010E17", "editorCursor.foreground": "#80a4c2", "editorWhitespace.foreground": "#2e2040", "editorIndentGuide.background": "#5e81ce52", "editor.selectionHighlightBorder": "#122d42", }, };
20.961933
91
0.527694
6a434398d4f4a5daa58f71360ec95d5edfacece9
250
js
JavaScript
Pages/index.js
Shovan61/GitHub_Club
26beaa30a10c72e9fa61f2923dac494d4c47d0a4
[ "Apache-2.0" ]
1
2021-08-18T06:57:45.000Z
2021-08-18T06:57:45.000Z
Pages/index.js
Shovan61/GitHub_Club
26beaa30a10c72e9fa61f2923dac494d4c47d0a4
[ "Apache-2.0" ]
null
null
null
Pages/index.js
Shovan61/GitHub_Club
26beaa30a10c72e9fa61f2923dac494d4c47d0a4
[ "Apache-2.0" ]
null
null
null
import Dashboard from './Dashboard'; import Error from './Error'; import Login from './Login'; import PrivateRoute from './PrivateRoute'; import AuthWrapper from './AuthWrapper'; export { Dashboard, Error, Login, PrivateRoute, AuthWrapper };
31.25
63
0.728
6a44c47125b9d3cb17cc3ff1841030605fe30f49
5,358
js
JavaScript
index.js
uofa/targets-webpack-plugin
0d99d79cc77492f522abd3c56aac3505b31d775c
[ "MIT" ]
16
2018-05-14T08:03:05.000Z
2020-12-05T10:33:46.000Z
index.js
uofa/targets-webpack-plugin
0d99d79cc77492f522abd3c56aac3505b31d775c
[ "MIT" ]
280
2020-04-22T08:28:38.000Z
2021-10-05T21:40:26.000Z
index.js
sheerun/targets-webpack-plugin
403b7a2e3657cbc1aad895b5740c47dd08898af2
[ "MIT" ]
4
2018-05-13T10:09:19.000Z
2020-04-14T18:00:21.000Z
const SourceMapSource = require("webpack-sources").SourceMapSource; const OriginalSource = require("webpack-sources").OriginalSource; const ModuleFilenameHelpers = require("webpack/lib/ModuleFilenameHelpers"); const RequestShortener = require("webpack/lib/RequestShortener"); const babel = require("@babel/core"); const rollup = require("rollup"); const commonJs = require("@rollup/plugin-commonjs"); const { nodeResolve } = require("@rollup/plugin-node-resolve"); const hypothetical = require("rollup-plugin-hypothetical"); class TargetsPlugin { constructor(options) { if (typeof options !== "object" || Array.isArray(options)) options = {}; if (typeof options.sourceMaps === "undefined") { options.sourceMaps = true; } if (typeof options.test === "undefined") { options.test = /\.js(\?.*)?$/i; } this.options = options; } apply(compiler) { const options = this.options; const requestShortener = new RequestShortener(compiler.context); compiler.hooks.compilation.tap("targets-compilation", compilation => { compilation.hooks.optimizeChunkAssets.tapPromise( "targets-optimize-chunk-assets", chunks => { let files = []; chunks.forEach(chunk => files.push(...chunk.files)); files.push(...compilation.additionalChunkAssets); files = files.filter( ModuleFilenameHelpers.matchObject.bind(undefined, options) ); return Promise.all( files.map(async file => { let sourceMap; try { const asset = compilation.assets[file]; // if (asset.__TargetsPlugin) { // compilation.assets[file] = asset.__TargetsPlugin; // return; // } let input; let inputSourceMap; const browsers = options.browsers || [ "last 2 versions", "chrome >= 41" ]; const fileOptions = { presets: [ [ require.resolve("@babel/preset-env"), { targets: { browsers }, useBuiltIns: "usage", corejs: 3, modules: false, exclude: ["transform-typeof-symbol"] } ] ], retainLines: true, compact: options.compact || true, babelrc: false }; if (options.sourceMaps) { if (asset.sourceAndMap) { const sourceAndMap = asset.sourceAndMap(); inputSourceMap = sourceAndMap.map; input = sourceAndMap.source; } else { inputSourceMap = asset.map(); input = asset.source(); } fileOptions.inputSourceMap = inputSourceMap; } else { input = asset.source(); } if (fileOptions.inputSourceMap === null) { inputSourceMap = undefined; delete fileOptions.inputSourceMap; } const result = babel.transform(input, fileOptions); const source = result.code; const map = result.map; const bundle = await rollup.rollup({ input: "./input.js", plugins: [ nodeResolve({ mainFields: ["module", "main"] }), commonJs({ include: ["node_modules/**"] }), hypothetical({ files: { "./input.js": options.sourceMaps ? { code: source, map: inputSourceMap } : source }, allowFallthrough: true }) ] }); const result2 = await bundle.generate({ format: "iife", name: "App", indent: false, sourcemap: options.sourceMaps }); const source2 = result2.output[0].code; const map2 = result2.output[0].map; compilation.assets[file] = options.sourceMaps ? new SourceMapSource(source2, file, map2) : new OriginalSource(source2, file); // compilation.assets[file].__TargetsPlugin = // compilation.assets[file]; } catch (err) { if (err.msg) { compilation.errors.push( new Error(file + " from Babel\n" + err.msg) ); } else { compilation.errors.push( new Error(file + " from Babel\n" + err.stack) ); } } }) ); } ); }); } } module.exports = TargetsPlugin;
34.792208
76
0.452034
6a44d069438b28df940bece2721ec87db1862250
3,821
js
JavaScript
src/helper/mime.js
H5futurehreohanshuo/node_anydoor
ad66ad770d505447d8e016cfc98f37921a974b8c
[ "MIT" ]
null
null
null
src/helper/mime.js
H5futurehreohanshuo/node_anydoor
ad66ad770d505447d8e016cfc98f37921a974b8c
[ "MIT" ]
null
null
null
src/helper/mime.js
H5futurehreohanshuo/node_anydoor
ad66ad770d505447d8e016cfc98f37921a974b8c
[ "MIT" ]
null
null
null
// 根据不同的文件类型,使用相对应的 content-type 解析 const path = require('path'); const mimeTypes = { 'hqx': 'application/mac-binhex40', 'cpt': 'application/mac-compactpro', 'csv': ['text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel'], 'bin': 'application/macbinary', 'dms': 'application/octet-stream', 'lha': 'application/octet-stream', 'lzh': 'application/octet-stream', 'exe': ['application/octet-stream', 'application/x-msdownload'], 'class': 'application/octet-stream', 'psd': 'application/x-photoshop', 'so': 'application/octet-stream', 'sea': 'application/octet-stream', 'dll': 'application/octet-stream', 'oda': 'application/oda', 'pdf': ['application/pdf', 'application/x-download'], 'ai': 'application/postscript', 'eps': 'application/postscript', 'ps': 'application/postscript', 'smi': 'application/smil', 'smil': 'application/smil', 'mif': 'application/vnd.mif', 'xls': ['application/excel', 'application/vnd.ms-excel', 'application/msexcel'], 'ppt': ['application/powerpoint', 'application/vnd.ms-powerpoint'], 'wbxml': 'application/wbxml', 'wmlc': 'application/wmlc', 'dcr': 'application/x-director', 'dir': 'application/x-director', 'dxr': 'application/x-director', 'dvi': 'application/x-dvi', 'gtar': 'application/x-gtar', 'gz': 'application/x-gzip', 'php': 'application/x-httpd-php', 'php4': 'application/x-httpd-php', 'php3': 'application/x-httpd-php', 'phtml': 'application/x-httpd-php', 'phps': 'application/x-httpd-php-source', 'js': 'application/x-javascript', 'swf': 'application/x-shockwave-flash', 'sit': 'application/x-stuffit', 'tar': 'application/x-tar', 'tgz': ['application/x-tar', 'application/x-gzip-compressed'], 'xhtml': 'application/xhtml+xml', 'xht': 'application/xhtml+xml', 'zip': ['application/x-zip', 'application/zip', 'application/x-zip-compressed'], 'mid': 'audio/midi', 'midi': 'audio/midi', 'mpga': 'audio/mpeg', 'mp2': 'audio/mpeg', 'mp3': ['audio/mpeg', 'audio/mpg', 'audio/mpeg3', 'audio/mp3'], 'aif': 'audio/x-aiff', 'aiff': 'audio/x-aiff', 'aifc': 'audio/x-aiff', 'ram': 'audio/x-pn-realaudio', 'rm': 'audio/x-pn-realaudio', 'rpm': 'audio/x-pn-realaudio-plugin', 'ra': 'audio/x-realaudio', 'rv': 'video/vnd.rn-realvideo', 'wav': ['audio/x-wav', 'audio/wave', 'audio/wav'], 'bmp': ['image/bmp', 'image/x-windows-bmp'], 'gif': 'image/gif', 'jpeg': ['image/jpeg', 'image/pjpeg'], 'jpg': ['image/jpeg', 'image/pjpeg'], 'jpe': ['image/jpeg', 'image/pjpeg'], 'png': ['image/png', 'image/x-png'], 'tiff': 'image/tiff', 'tif': 'image/tiff', 'css': 'text/css', 'html': 'text/html', 'htm': 'text/html', 'shtml': 'text/html', 'txt': 'text/plain', 'text': 'text/plain', 'log': ['text/plain', 'text/x-log'], 'rtx': 'text/richtext', 'rtf': 'text/rtf', 'xml': 'text/xml', 'xsl': 'text/xml', 'mpeg': 'video/mpeg', 'mpg': 'video/mpeg', 'mpe': 'video/mpeg', 'qt': 'video/quicktime', 'mov': 'video/quicktime', 'avi': 'video/x-msvideo', 'movie': 'video/x-sgi-movie', 'doc': 'application/msword', 'docx': ['application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip'], 'xlsx': ['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/zip'], 'word': ['application/msword', 'application/octet-stream'], 'xl': 'application/excel', 'eml': 'message/rfc822', 'json': ['application/json', 'text/json'] }; module.exports = (filePath) => { let ext = path.extname(filePath).split('.').pop().toLowerCase(); if (!ext) { ext = filePath; } return mimeTypes[ext] || mimeTypes['txt']; };
36.04717
244
0.635697
6a44d5d0108ad454ae6cc5745051e5ca407b2f3b
9,370
js
JavaScript
public/js/controllers/league.js
PeteyPii/MyLoLFantasy
8a9cdedf90643d2a8032526a54f9898a4ccd2c67
[ "MIT" ]
3
2015-12-17T19:28:55.000Z
2019-03-19T21:33:01.000Z
public/js/controllers/league.js
bsankara/MyLoLFantasy
6880358886681490057ecd8d87073aae4b49ab39
[ "MIT" ]
43
2015-01-11T20:14:41.000Z
2018-07-07T04:18:38.000Z
public/js/controllers/league.js
bsankara/MyLoLFantasy
6880358886681490057ecd8d87073aae4b49ab39
[ "MIT" ]
6
2015-01-18T00:51:30.000Z
2018-11-20T03:55:15.000Z
app.controller('LeagueController', ['$rootScope', '$scope', '$routeParams', '$http', '$location', 'ngDialog', 'localStorageService', function($rootScope, $scope, $routeParams, $http, $location, ngDialog, localStorageService) { var DISPLAY_TYPE_KEY = 'league_display_type'; var DisplayType = { TOTAL: 'total', AVG: 'average', }; $rootScope.setActiveNavLink('league'); $rootScope.title = 'League'; $scope.isLoading = true; $scope.loadError = false; $scope.exists = false; $scope.league = null; $scope.totalData = null; $scope.perGameData = null; $scope.activeData = null; setActiveData(); $scope.Column = { NAME: 'name', KDA: 'kda', CS: 'cs', TURRETS: 'turrets', DOUBLES: 'doubles', TRIPLES: 'triples', QUADRAS: 'quadras', PENTAS: 'pentas', POINTS: 'points', NONE: 'none', }; $http.get('api/leagues/' + $routeParams.leagueId).then(function(response) { $scope.isLoading = false; $scope.exists = true; loadLeague(response.data); }, function(response) { $scope.isLoading = false; if (response.status === 404) { // $scope is set up to imply the League does not exist. } else { $scope.loadError = true; $rootScope.$broadcast('flashError', 'Server responded with status code ' + response.status); } }); $scope.sortedColumn = $scope.Column.NONE; $scope.ascendingSort = true; $scope.activateColumnForSorting = function(column) { if ($scope.sortedColumn === column) { $scope.ascendingSort = !$scope.ascendingSort; reverseAllData(); } else { $scope.sortedColumn = column; switch ($scope.sortedColumn) { case $scope.Column.NAME: $scope.ascendingSort = true; sortAllData(function(summonerDataPair) { return summonerDataPair[0]; }); break; case $scope.Column.KDA: $scope.ascendingSort = false; sortAllData(function(summonerDataPair) { var stats = summonerDataPair[1].stats; var kills = parseFloat(stats.championKills); var deaths = parseFloat(stats.deaths); var assists = parseFloat(stats.assists); var kda; if (deaths === 0) { kda = kills + asssits; kda = '1' + pad(kda.toFixed(20), 40); // prepend a '1' so that it sorts above KDAs for deaths == 1 } else { kda = (kills + assists) / deaths; kda = '0' + pad(kda.toFixed(20), 40); // prepend a '0' so that it sorts below KDAs for deaths == 0 } return kda; }); // We want descending order. reverseAllData(); break; case $scope.Column.CS: $scope.ascendingSort = false; sortAllData(function(summonerDataPair) { // Negative for descending. return -summonerDataPair[1].stats.minionKills; }); break; case $scope.Column.TURRETS: $scope.ascendingSort = false; sortAllData(function(summonerDataPair) { // Negative for descending. return -summonerDataPair[1].stats.turretKills; }); break; case $scope.Column.DOUBLES: $scope.ascendingSort = false; sortAllData(function(summonerDataPair) { // Negative for descending. return -summonerDataPair[1].stats.doubleKills; }); break; case $scope.Column.TRIPLES: $scope.ascendingSort = false; sortAllData(function(summonerDataPair) { // Negative for descending. return -summonerDataPair[1].stats.tripleKills; }); break; case $scope.Column.QUADRAS: $scope.ascendingSort = false; sortAllData(function(summonerDataPair) { // Negative for descending. return -summonerDataPair[1].stats.quadraKills; }); break; case $scope.Column.PENTAS: $scope.ascendingSort = false; sortAllData(function(summonerDataPair) { // Negative for descending. return -summonerDataPair[1].stats.pentaKills; }); break; case $scope.Column.POINTS: $scope.ascendingSort = false; sortAllData(function(summonerDataPair) { // Negative for descending. return -summonerDataPair[1].points; }); break; default: throw new Error('Invalid column value'); } } }; $scope.activateColumnForSorting($scope.Column.NAME); $scope.updateDisplayType = function() { if ($scope.activeData === $scope.totalData) { localStorageService.set(DISPLAY_TYPE_KEY, DisplayType.TOTAL); } else if ($scope.activeData === $scope.perGameData) { localStorageService.set(DISPLAY_TYPE_KEY, DisplayType.AVG); } }; var $outerScope = $scope; $scope.deleteLeague = function() { ngDialog.open({ template: 'views/dialogs/delete_league.html?v=' + gVersion, className: 'dialog', disableAnimation: true, controller: ['$rootScope', '$scope', '$http', '$location', function($rootScope, $scope, $http, $location) { $scope.leagueName = $outerScope.league.name; $scope.confirmClick = function() { $http.delete('api/leagues/' + $outerScope.league.id).then(function(response) { if (response.data.success) { $rootScope.$broadcast('flashSuccess', 'Successfully deleted \'' + $scope.leagueName + '\''); $scope.closeThisDialog(); $location.path('leagues'); } else { $rootScope.$broadcast('flashError', response.data.reason); $scope.closeThisDialog(); } }, function(response) { $rootScope.$broadcast('flashError', 'Error deleting \'' + $scope.leagueName + '\'. Server responded with status code ' + response.status); $scope.closeThisDialog(); }); }; $scope.cancelClick = function() { $scope.closeThisDialog(); }; }], }); }; var isUpdating = false; $scope.updateLeague = function() { if (!isUpdating) { isUpdating = true; $http.post('api/leagues/' + $scope.league.id + '/update').then(function(response) { isUpdating = false; if (response.data.success) { loadLeague(response.data.league); $rootScope.$broadcast('flashSuccess', 'Successfully refreshed stats for \'' + $scope.league.name + '\''); } else { $rootScope.$broadcast('flashError', response.data.reason); } }, function(response) { isUpdating = false; $rootScope.$broadcast('flashError', 'Error updating \'' + $scope.league.name + '\'. Server responded with status code ' + response.status); }); } }; function loadLeague(league) { $rootScope.title = league.name; $scope.league = league; $scope.league.lastUpdate = new Date($scope.league.lastUpdate); $scope.totalData = _.cloneDeep($scope.league.data); var summoner; for (summoner in $scope.totalData) { $scope.totalData[summoner].points = $scope.totalData[summoner].points.toFixed(2); } $scope.perGameData = _.cloneDeep($scope.league.data); for (summoner in $scope.perGameData) { $scope.perGameData[summoner].points = averageValue($scope.perGameData[summoner].points, $scope.league.gameCount); var stats = $scope.perGameData[summoner].stats; for (var stat in stats) { stats[stat] = averageValue(stats[stat], $scope.league.gameCount); } } $scope.totalData = dataToArray($scope.totalData); $scope.perGameData = dataToArray($scope.perGameData); setActiveData(); } function averageValue(value, count) { return (value / count).toFixed(2); } function dataToArray(data) { var dataAsArray = []; for (var summoner in data) { dataAsArray.push([summoner, data[summoner]]); } return dataAsArray; } function pad(n, width) { n = n + ''; return n.length >= width ? n : new Array(width - n.length + 1).join('0') + n; } function setActiveData() { switch (localStorageService.get(DISPLAY_TYPE_KEY)) { case DisplayType.TOTAL: $scope.activeData = $scope.totalData; break; case DisplayType.AVG: $scope.activeData = $scope.perGameData; break; default: $scope.activeData = $scope.totalData; break; } } function sortAllData(predicate) { $scope.totalData = _.sortBy($scope.totalData, predicate); $scope.perGameData = _.sortBy($scope.perGameData, predicate); setActiveData(); } function reverseAllData() { $scope.totalData.reverse(); $scope.perGameData.reverse(); } } ]);
35.093633
152
0.563607
6a457f5f8427e32762668b06018be885f222d757
842
js
JavaScript
static/tyadmin/327.b35f5ca0.async.js
baikourin/online-edu-serverless
6425c2e64da62dd8eace4f5d976eece239f7189c
[ "Apache-2.0" ]
1
2022-01-26T01:52:15.000Z
2022-01-26T01:52:15.000Z
static/tyadmin/327.b35f5ca0.async.js
baikourin/online-edu-serverless
6425c2e64da62dd8eace4f5d976eece239f7189c
[ "Apache-2.0" ]
null
null
null
static/tyadmin/327.b35f5ca0.async.js
baikourin/online-edu-serverless
6425c2e64da62dd8eace4f5d976eece239f7189c
[ "Apache-2.0" ]
null
null
null
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[327],{nwgy:function(a,e,t){"use strict";t.r(e);var n=t("q1tI"),l={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M855 160.1l-189.2 23.5c-6.6.8-9.3 8.8-4.7 13.5l54.7 54.7-153.5 153.5a8.03 8.03 0 000 11.3l45.1 45.1c3.1 3.1 8.2 3.1 11.3 0l153.6-153.6 54.7 54.7a7.94 7.94 0 0013.5-4.7L863.9 169a7.9 7.9 0 00-8.9-8.9zM416.6 562.3a8.03 8.03 0 00-11.3 0L251.8 715.9l-54.7-54.7a7.94 7.94 0 00-13.5 4.7L160.1 855c-.6 5.2 3.7 9.5 8.9 8.9l189.2-23.5c6.6-.8 9.3-8.8 4.7-13.5l-54.7-54.7 153.6-153.6c3.1-3.1 3.1-8.2 0-11.3l-45.2-45z"}}]},name:"expand-alt",theme:"outlined"},c=l,i=t("6VBw"),s=function(a,e){return n["createElement"](i["a"],Object.assign({},a,{ref:e,icon:c}))};s.displayName="ExpandAltOutlined";e["default"]=n["forwardRef"](s)}}]);
842
842
0.646081
6a45973c8f67342f8a300d78f79dc148c1dd0bb0
2,299
js
JavaScript
pages/fasilitas-kesehatan/apotek.js
untukkita-id/sda.untukkita.id
c9a2b90a3e63ae327fd278541873a2d53c9b8162
[ "Apache-2.0" ]
null
null
null
pages/fasilitas-kesehatan/apotek.js
untukkita-id/sda.untukkita.id
c9a2b90a3e63ae327fd278541873a2d53c9b8162
[ "Apache-2.0" ]
46
2021-08-13T07:14:23.000Z
2022-02-17T22:19:17.000Z
pages/fasilitas-kesehatan/apotek.js
untukkita-id/sda.untukkita.id
c9a2b90a3e63ae327fd278541873a2d53c9b8162
[ "Apache-2.0" ]
null
null
null
/* eslint-disable global-require */ /* eslint-disable import/no-unresolved */ import Head from 'next/head'; import PageTitle from 'components/common/page-title'; import Footer from 'components/common/footer'; import Header from 'components/common/header'; import CardFaskes from 'components/card/card-faskes'; import SectionGrub from 'components/common/sections'; import NavbarFaskes from 'components/navigation/navbar-faskes'; export default function FasilitasKesehatan({ dataFaskes }) { const siteInfo = { title: 'UntukKita Sidoarjo - Daftar Apotek di Kota Sidoarjo', description: 'Daftar Apotek di kota Sidoarjo. Fasilitas Penunjang Kesembuhan COVID-19 kota Sidoarjo', image: 'opengraph.jpg', url: 'https://covid.sda.untukkita.my.id', pageDescription: 'Kumpulan data apotek yang terdapat di kota Sidoarjo', pageTitle: 'Data Apotek di Kota Sidoarjo', }; const componentList = []; for (let i = 0; i < dataFaskes.length; i += 1) { componentList.push( <CardFaskes key={dataFaskes[i].nama} nama={dataFaskes[i].nama} hotline={dataFaskes[i].kontak} socialmedia={dataFaskes[i].sosialmedia} kategori={dataFaskes[i].jenis} alamat={dataFaskes[i].alamat} />, ); } return ( <div id="home" className="text-gray-700"> <Head> <title>{siteInfo.title}</title> <meta name="description" content={siteInfo.description} /> <meta name="title" content={siteInfo.title} /> <meta property="og:url" content="https://covid.sda.untukkita.my.id/" /> <meta property="og:title" content={siteInfo.title} /> <meta property="og:description" content={siteInfo.description} /> <meta property="twitter:title" content={siteInfo.title} /> <meta property="twitter:description" content={siteInfo.description} /> </Head> <Header title="Apotek" /> <NavbarFaskes /> <PageTitle title={siteInfo.pageTitle} description={siteInfo.pageDescription} /> <SectionGrub title="Data Apotek"> <ul>{componentList}</ul> </SectionGrub> <Footer /> </div> ); } export async function getStaticProps() { const dataFaskes = require('data/apotek-sheets.json'); return { props: { dataFaskes, }, }; }
34.313433
94
0.662897
6a46d434127b93d108a3537e5ce5259c52725ffb
1,092
js
JavaScript
src/app.js
soydeif/The-Excuse-Generator
1fb81bae0ecda0d3467fe0baaf04d48c865b9e5f
[ "MIT" ]
null
null
null
src/app.js
soydeif/The-Excuse-Generator
1fb81bae0ecda0d3467fe0baaf04d48c865b9e5f
[ "MIT" ]
null
null
null
src/app.js
soydeif/The-Excuse-Generator
1fb81bae0ecda0d3467fe0baaf04d48c865b9e5f
[ "MIT" ]
null
null
null
/* eslint-disable */ import "bootstrap"; import "./style.css"; import "./assets/img/rigo-baby.jpg"; import "./assets/img/4geeks.ico"; window.onload = () => { document.querySelector("#btn").addEventListener("click", () => { document.querySelector("#the-excuse").innerHTML = generateExcuse(); }); let randomNumber = Math.random() * 10; }; let generateExcuse = () => { let pronoum = ["A", "The"]; let subjet = ["dog", "thief", "racoon"]; let action = ["bit my", "threw my", "ate my"]; let possetion = ["homework", "laptop", "lunch"]; let where = ["on the street", "in the pool", "In the zoo"]; let proIndx = Math.floor(Math.random() * pronoum.length); let subjIndx = Math.floor(Math.random() * subjet.length); let actIndx = Math.floor(Math.random() * action.length); let possIndx = Math.floor(Math.random() * possetion.length); let whereIndx = Math.floor(Math.random() * where.length); return ( pronoum[proIndx] + " " + subjet[subjIndx] + " " + action[actIndx] + " " + possetion[possIndx] + " " + where[whereIndx] ); };
27.3
71
0.60989
6a4869697a7957ad146460a1f841e6db45c33033
1,010
js
JavaScript
src/plugins/enter_key_submit/plugin.js
DefenseStorm/selectize.js
be59f7a5afd75ace7e4c0f2b5cf7d57328a8aefa
[ "Apache-2.0" ]
null
null
null
src/plugins/enter_key_submit/plugin.js
DefenseStorm/selectize.js
be59f7a5afd75ace7e4c0f2b5cf7d57328a8aefa
[ "Apache-2.0" ]
null
null
null
src/plugins/enter_key_submit/plugin.js
DefenseStorm/selectize.js
be59f7a5afd75ace7e4c0f2b5cf7d57328a8aefa
[ "Apache-2.0" ]
null
null
null
/* // Include this in $('#yourSelector').selectize({ plugins: ['enter_key_submit'], onInitialize: function () { this.on('submit', function () { this.$input.closest('form').submit(); }, this); }, */ Selectize.define('enter_key_submit', function (options) { var self = this; this.onKeyDown = (function (e) { var original = self.onKeyDown; return function (e) { // this.items.length MIGHT change after event propagation. // We need the initial value as well. See next comment. var initialSelection = this.items.length; original.apply(this, arguments); if (e.keyCode === 13 // Necessary because we don't want this to be triggered when an option is selected with Enter after pressing DOWN key to trigger the dropdown options && initialSelection && initialSelection === this.items.length && this.$control_input.val() === '') { self.trigger('submit'); } }; })(); });
31.5625
161
0.60396
6a48f11b409cd22a1c15dbd20a7f7f94d2051ff3
1,692
js
JavaScript
static/assets/kendoui-2015.2.624/js/kendo.mobile.navbar.min.js
singlesingle/on_the_way
d55fce3b98ad9320690445ce3e34991a038cd0f5
[ "BSD-3-Clause" ]
1
2018-03-23T03:58:09.000Z
2018-03-23T03:58:09.000Z
static/assets/kendoui-2015.2.624/js/kendo.mobile.navbar.min.js
singlesingle/on_the_way
d55fce3b98ad9320690445ce3e34991a038cd0f5
[ "BSD-3-Clause" ]
null
null
null
static/assets/kendoui-2015.2.624/js/kendo.mobile.navbar.min.js
singlesingle/on_the_way
d55fce3b98ad9320690445ce3e34991a038cd0f5
[ "BSD-3-Clause" ]
null
null
null
/* * Kendo UI v2015.2.624 (http://www.telerik.com/kendo-ui) * Copyright 2015 Telerik AD. All rights reserved. * * Kendo UI commercial licenses may be obtained at * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete * If you do not own a commercial license, this file shall be governed by the trial license terms. */ !function(e,define){define(["./kendo.core.min"],e)}(function(){return function(e,t){function n(n,i){var r=i.find("["+o.attr("align")+"="+n+"]");return r[0]?e('<div class="km-'+n+'item" />').append(r).prependTo(i):t}function i(t){var n=t.siblings(),i=!!t.children("ul")[0],r=!!n[0]&&""===e.trim(t.text()),a=!(!o.mobile.application||!o.mobile.application.element.is(".km-android"));t.prevAll().toggleClass("km-absolute",i),t.toggleClass("km-show-title",r),t.toggleClass("km-fill-title",r&&!e.trim(t.html())),t.toggleClass("km-no-title",i),t.toggleClass("km-hide-title",a&&!n.children().is(":visible"))}var o=window.kendo,r=o.mobile,a=r.ui,s=a.Widget,l=s.extend({init:function(t,i){var o=this;s.fn.init.call(o,t,i),t=o.element,o.container().bind("show",e.proxy(this,"refresh")),t.addClass("km-navbar").wrapInner(e('<div class="km-view-title km-show-title" />')),o.leftElement=n("left",t),o.rightElement=n("right",t),o.centerElement=t.find(".km-view-title")},options:{name:"NavBar"},title:function(e){this.element.find(o.roleSelector("view-title")).text(e),i(this.centerElement)},refresh:function(e){var t=e.view;t.options.title?this.title(t.options.title):i(this.centerElement)},destroy:function(){s.fn.destroy.call(this),o.destroy(this.element)}});a.plugin(l)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t){t()});
188
1,359
0.702719
6a4967120003d5f505780ace70c8716fc6acdab4
1,278
js
JavaScript
index.js
Nexys-Consulting/qlik-cli
609a80f9509d93958fd1bb9b8bba93c45a09301d
[ "BSD-3-Clause" ]
5
2017-10-02T18:22:59.000Z
2021-07-28T00:03:11.000Z
index.js
Nexys-Consulting/qlik-cli
609a80f9509d93958fd1bb9b8bba93c45a09301d
[ "BSD-3-Clause" ]
2
2017-10-31T12:49:17.000Z
2018-09-21T18:49:59.000Z
index.js
Nexys-Consulting/qlik-cli
609a80f9509d93958fd1bb9b8bba93c45a09301d
[ "BSD-3-Clause" ]
5
2017-11-20T18:13:42.000Z
2022-03-28T06:44:39.000Z
#!/usr/bin/env node const path = require('path'); require('yargs') .commandDir('lib/commands') .option('endpoint', { alias: 'e', describe: 'Websocket endpoint used when connecting to Qlik Desktop/Server.', default: 'ws://localhost:4848/' }) .option('path', { alias: 'p', describe: 'Import/Output root path that contains App folders.', default: process.cwd() }) .option('user', { alias: 'u', describe: 'User name used when connecting to Qlik Server.', default: process.env.userName }) .option('domain', { alias: 'd', describe: 'User domain used when connecting to Qlik Server.', default: process.env.userDomain }) .option('certPath', { alias: 'c', describe: 'Path to certificates used when connecting to Qlik Server. Must include these files: client.pem, client_key.pem, and root.pem', default: '' }) .option('transformPath', { alias: 't', describe: 'Configuration transform root path that contains App folders.' }) .option('info', { alias: 'i', describe: 'Log info messages.', default: false }) .demandCommand() .help() .wrap(150) .argv
29.72093
146
0.573552
6a496bb767921696e7e33f356e889144d81a3290
1,188
js
JavaScript
build/afterSignHook.js
webspaceteam/electron-nuxt
1b39c055b1461a0c08ab111e11567bf98d32fb15
[ "MIT" ]
14
2020-01-15T11:16:19.000Z
2021-12-07T00:20:37.000Z
build/afterSignHook.js
Khaleedabuhawwas92/templet-to-desktop-electron-and-nuxtjs
ef5a2cb45b16faab5f32fa2c2a893dac5f89ac11
[ "MIT" ]
1
2021-09-15T08:19:09.000Z
2022-03-22T07:39:54.000Z
build/afterSignHook.js
Khaleedabuhawwas92/templet-to-desktop-electron-and-nuxtjs
ef5a2cb45b16faab5f32fa2c2a893dac5f89ac11
[ "MIT" ]
5
2020-02-04T04:52:02.000Z
2020-11-07T18:26:51.000Z
const fs = require('fs'); const path = require('path'); var electron_notarize = require('electron-notarize'); module.exports = async function (params) { // Only notarize the app on Mac OS only. if (process.platform !== 'darwin') { return; } // Skip notarize if target MacStore. if (params.electronPlatformName === 'mas') { console.log('Notarization skipped as target MAS') return; } console.log('afterSign hook triggered', params); // Same appId in electron-builder. let appId = params.packager.appInfo.info._metadata.name let appPath = path.join(params.appOutDir, `${params.packager.appInfo.productFilename}.app`); if (!fs.existsSync(appPath)) { throw new Error(`Cannot find application at: ${appPath}`); } console.log(`Notarizing ${appId} found at ${appPath}`); try { await electron_notarize.notarize({ appBundleId: appId, appPath: appPath, appleId: process.env.appleId, appleIdPassword: process.env.appleIdPassword, }); } catch (error) { console.error(error); } console.log(`Done notarizing ${appId}`); };
28.97561
96
0.624579
6a4a3a09026d51e7871e216890462f762058902a
507
js
JavaScript
src/options/messages.js
ismorozs/histocher
db5b9084a41f41f2e5e0d70e514bcb1035fea528
[ "MIT" ]
null
null
null
src/options/messages.js
ismorozs/histocher
db5b9084a41f41f2e5e0d70e514bcb1035fea528
[ "MIT" ]
null
null
null
src/options/messages.js
ismorozs/histocher
db5b9084a41f41f2e5e0d70e514bcb1035fea528
[ "MIT" ]
null
null
null
import { sendMessageToBackground } from '../common/interaction'; export default { removeTag, getData, startSearch, removeSearch, } function removeTag (tag) { return sendMessageToBackground('removeTag', { tag }); } function getData (tabId) { return sendMessageToBackground('getData', { tabId }); } function startSearch (query) { return sendMessageToBackground('startSearch', { query }); } function removeSearch (query) { return sendMessageToBackground('removeSearchQuery', { query }); }
20.28
65
0.727811
6a4b1cb66a15f042693d09330a6bc66ee82bec87
2,451
js
JavaScript
scenarios/api.github.com/labels/test.js
silvrwolfboy/fixtures
64c9321ef4e274d687f333c721b7294e85ec32ea
[ "MIT" ]
null
null
null
scenarios/api.github.com/labels/test.js
silvrwolfboy/fixtures
64c9321ef4e274d687f333c721b7294e85ec32ea
[ "MIT" ]
null
null
null
scenarios/api.github.com/labels/test.js
silvrwolfboy/fixtures
64c9321ef4e274d687f333c721b7294e85ec32ea
[ "MIT" ]
1
2020-03-06T11:59:09.000Z
2020-03-06T11:59:09.000Z
const axios = require("axios"); const { test } = require("tap"); const fixtures = require("../../.."); test("Labels", async t => { const mock = fixtures.mock("api.github.com/labels"); // https://developer.github.com/v3/issues/labels/#list-all-labels-for-this-repository // List all labels for a repository await axios({ method: "get", url: "https://api.github.com/repos/octokit-fixture-org/labels/labels", headers: { Accept: "application/vnd.github.v3+json", Authorization: "token 0000000000000000000000000000000000000001" } }).catch(mock.explain); // https://developer.github.com/v3/issues/labels/#create-a-label // Create a label await axios({ method: "post", url: "https://api.github.com/repos/octokit-fixture-org/labels/labels", headers: { Accept: "application/vnd.github.v3+json", Authorization: "token 0000000000000000000000000000000000000001", "Content-Type": "application/json; charset=utf-8" }, data: { name: "test-label", color: "663399" } }).catch(mock.explain); // https://developer.github.com/v3/issues/labels/#get-a-single-label // Get a label await axios({ method: "get", url: "https://api.github.com/repos/octokit-fixture-org/labels/labels/test-label", headers: { Accept: "application/vnd.github.v3+json", Authorization: "token 0000000000000000000000000000000000000001" } }).catch(mock.explain); // https://developer.github.com/v3/issues/labels/#get-a-single-label // Update a label await axios({ method: "patch", url: "https://api.github.com/repos/octokit-fixture-org/labels/labels/test-label", headers: { Accept: "application/vnd.github.v3+json", Authorization: "token 0000000000000000000000000000000000000001", "Content-Type": "application/json; charset=utf-8" }, data: { new_name: "test-label-updated", color: "BADA55" } }).catch(mock.explain); // https://developer.github.com/v3/issues/labels/#delete-a-label // Delete a label await axios({ method: "delete", url: "https://api.github.com/repos/octokit-fixture-org/labels/labels/test-label-updated", headers: { Accept: "application/vnd.github.v3+json", Authorization: "token 0000000000000000000000000000000000000001" } }).catch(mock.explain); t.doesNotThrow(mock.done.bind(mock), "satisfies all mocks"); t.end(); });
30.6375
90
0.660139
6a4bf6510b1d6ead5d6a8d83ca2ff79fe210ac98
970
js
JavaScript
configs/lib/ja/index.js
pizzacat83/textlint-configs
982945555f12135bc6d8e9143b9fb2bcfc98e145
[ "Unlicense" ]
null
null
null
configs/lib/ja/index.js
pizzacat83/textlint-configs
982945555f12135bc6d8e9143b9fb2bcfc98e145
[ "Unlicense" ]
null
null
null
configs/lib/ja/index.js
pizzacat83/textlint-configs
982945555f12135bc6d8e9143b9fb2bcfc98e145
[ "Unlicense" ]
null
null
null
const { moduleInterop } = require("@textlint/module-interop"); const commonConfig = moduleInterop(require("../common")) module.exports = { "filters": { ...commonConfig.filters, }, "rules": { ...commonConfig.rules, "textlint-rule-preset-jtf-style": { "1.2.2.ピリオド(.)とカンマ(,)": false, "2.1.6.カタカナの長音": true, "3.1.1.全角文字と半角文字の間": false, }, "textlint-rule-preset-ja-technical-writing": { "ja-no-mixed-period": false, // covered in preset-ja-engineering-paper }, "preset-ja-engineering-paper" : true, "preset-ja-spacing": { "ja-space-between-half-and-full-width": { "space": "always", }, "ja-space-around-code": { "before": true, "after": true, }, "ja-no-space-around-parentheses": true, "ja-space-after-exclamation": false, "ja-space-after-question": false, }, "no-mixed-zenkaku-and-hankaku-alphabet": { "prefer": "半角" }, }, }
26.944444
76
0.574227
6a4c8b995724f72972733136a13d00c109ae0eca
4,578
js
JavaScript
modules/aardvarkBidAdapter.js
yoshito0523/Prebid.js
66d218b099c559058b9d5316cc59a2a3d55fa30d
[ "Apache-2.0" ]
3
2017-05-07T03:46:30.000Z
2017-09-07T07:26:10.000Z
modules/aardvarkBidAdapter.js
yoshito0523/Prebid.js
66d218b099c559058b9d5316cc59a2a3d55fa30d
[ "Apache-2.0" ]
3
2017-07-11T19:26:14.000Z
2018-07-05T19:49:29.000Z
modules/aardvarkBidAdapter.js
yoshito0523/Prebid.js
66d218b099c559058b9d5316cc59a2a3d55fa30d
[ "Apache-2.0" ]
2
2016-09-27T00:26:30.000Z
2017-08-05T22:19:03.000Z
import * as utils from 'src/utils'; import {registerBidder} from 'src/adapters/bidderFactory'; const BIDDER_CODE = 'aardvark'; const DEFAULT_ENDPOINT = 'bidder.rtk.io'; const SYNC_ENDPOINT = 'sync.rtk.io'; const AARDVARK_TTL = 300; const AARDVARK_CURRENCY = 'USD'; let hasSynced = false; export function resetUserSync() { hasSynced = false; } export const spec = { code: BIDDER_CODE, isBidRequestValid: function(bid) { return ((typeof bid.params.ai === 'string') && !!bid.params.ai.length && (typeof bid.params.sc === 'string') && !!bid.params.sc.length); }, buildRequests: function(validBidRequests, bidderRequest) { var auctionCodes = []; var requests = []; var requestsMap = {}; var referer = utils.getTopWindowUrl(); var pageCategories = []; if (window.top.rtkcategories && Array.isArray(window.top.rtkcategories)) { pageCategories = window.top.rtkcategories; } utils._each(validBidRequests, function(b) { var rMap = requestsMap[b.params.ai]; if (!rMap) { rMap = { shortCodes: [], payload: { version: 1, jsonp: false, rtkreferer: referer }, endpoint: DEFAULT_ENDPOINT }; if (pageCategories && pageCategories.length) { rMap.payload.categories = pageCategories.slice(0); } if (b.params.categories && b.params.categories.length) { rMap.payload.categories = rMap.payload.categories || [] utils._each(b.params.categories, function(cat) { rMap.payload.categories.push(cat); }); } if (bidderRequest && bidderRequest.gdprConsent) { rMap.payload.gdpr = false; if (typeof bidderRequest.gdprConsent.gdprApplies === 'boolean') { rMap.payload.gdpr = bidderRequest.gdprConsent.gdprApplies; } if (rMap.payload.gdpr) { rMap.payload.consent = bidderRequest.gdprConsent.consentString; } } requestsMap[b.params.ai] = rMap; auctionCodes.push(b.params.ai); } rMap.shortCodes.push(b.params.sc); rMap.payload[b.params.sc] = b.bidId; if ((typeof b.params.host === 'string') && b.params.host.length && (b.params.host !== rMap.endpoint)) { rMap.endpoint = b.params.host; } }); utils._each(auctionCodes, function(auctionId) { var req = requestsMap[auctionId]; requests.push({ method: 'GET', url: `//${req.endpoint}/${auctionId}/${req.shortCodes.join('_')}/aardvark`, data: req.payload, bidderRequest }); }); return requests; }, interpretResponse: function(serverResponse, bidRequest) { var bidResponses = []; if (!Array.isArray(serverResponse.body)) { serverResponse.body = [serverResponse.body]; } utils._each(serverResponse.body, function(rawBid) { var cpm = +(rawBid.cpm || 0); if (!cpm) { return; } var bidResponse = { requestId: rawBid.cid, cpm: cpm, width: rawBid.width || 0, height: rawBid.height || 0, currency: rawBid.currency ? rawBid.currency : AARDVARK_CURRENCY, netRevenue: rawBid.netRevenue ? rawBid.netRevenue : true, ttl: rawBid.ttl ? rawBid.ttl : AARDVARK_TTL, creativeId: rawBid.creativeId || 0 }; if (rawBid.hasOwnProperty('dealId')) { bidResponse.dealId = rawBid.dealId } switch (rawBid.media) { case 'banner': bidResponse.ad = rawBid.adm + utils.createTrackPixelHtml(decodeURIComponent(rawBid.nurl)); break; default: return utils.logError('bad Aardvark response (media)', rawBid); } bidResponses.push(bidResponse); }); return bidResponses; }, getUserSyncs: function(syncOptions, serverResponses, gdprConsent) { const syncs = []; var url = '//' + SYNC_ENDPOINT + '/cs'; var gdprApplies = false; if (gdprConsent && (typeof gdprConsent.gdprApplies === 'boolean')) { gdprApplies = gdprConsent.gdprApplies; } if (syncOptions.iframeEnabled) { if (!hasSynced) { hasSynced = true; if (gdprApplies) { url = url + '?g=1&c=' + encodeURIComponent(gdprConsent.consentString); } syncs.push({ type: 'iframe', url: url }); } } else { utils.logWarn('Aardvark: Please enable iframe based user sync.'); } return syncs; } }; registerBidder(spec);
27.578313
100
0.593272
6a4c948e9f33fbccc1208ee7bb997d513ca7edfa
5,753
js
JavaScript
cms_community_e_commerce/src/containers/CategorySecond/UpdateCategoryModal.js
anmac/GLC
a10e31f93954fe91445a5e9760fe29df0a71f24f
[ "MIT" ]
null
null
null
cms_community_e_commerce/src/containers/CategorySecond/UpdateCategoryModal.js
anmac/GLC
a10e31f93954fe91445a5e9760fe29df0a71f24f
[ "MIT" ]
null
null
null
cms_community_e_commerce/src/containers/CategorySecond/UpdateCategoryModal.js
anmac/GLC
a10e31f93954fe91445a5e9760fe29df0a71f24f
[ "MIT" ]
null
null
null
import React from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { Button, Icon, Upload, message, Modal, Form, Input } from 'antd'; import { authError, fetchAllCategorySecond } from '@/actions/index'; import categorySecondService from '@/services/categorySecondService'; import CategorySelector from '../../components/CategorySelector'; const FormItem = Form.Item @connect( state => ({ //adminId: state.auth.admin.adminId token: state.auth.admin.token }), dispatch => ({ authError: (errorMessage) => dispatch(authError(errorMessage)), fetchCategories: () => dispatch(fetchAllCategorySecond()) }) ) @Form.create() export default class UpdateCategoryModal extends React.Component { static propTypes = { visible: PropTypes.bool.isRequired, handleCancel: PropTypes.func.isRequired, handleSubmit: PropTypes.func.isRequired, value: PropTypes.object.isRequired } state = { fileList: [], previewImage: '', previewVisible: false } handleSubmit = (e) => { e.preventDefault() this.props.form.validateFields((err, values) => { if (err) { return ; } if (values.image) { this.updateCategory( values.categorySecondId, values.categoryFirstId, values.categoryName, values.image.fileList[0].originFileObj ) } else { this.updateCategory( values.categorySecondId, values.categoryFirstId, values.categoryName, null ) } }) } handlePictureChange = ({ fileList }) => { this.setState({ fileList }) } handlePreview = (file) => { this.setState({ previewImage: file.url || file.thumbUrl, previewVisible: true, }) } handleRemove = (file) => { this.setState({ fileList: [] }) } handleCancel = () => { this.setState({ previewVisible: false }) } updateCategory = async (categorySecondId, categoryFirstId, categoryName, imageFile) => { const { token } = this.props try { const res = await categorySecondService.update( token, { categorySecondId, categoryFirstId, categoryName, imageFile } ) message.success('修改成功') this.props.fetchCategories() this.props.handleSubmit() } catch (err) { if (err.message === undefined) { const errorMessage = '服务器出错啦,请耐心等待,麻烦很耐心的等待一年,谢谢' this.props.authError(errorMessage) } if (err.response.status === 401) { const errorMessage = '您的登录已过期,请重新登录' this.props.authError(errorMessage) } // 修改不成功 if (err.response.status === 400 ||err.response.status === 404) { const errorMessage = err.response.data.message message.error(errorMessage) } } } renderUploadBtn = () => { return ( <div> <Icon type="plus" /> <div className="ant-upload-text">Upload</div> </div> ) } render() { const { visible, handleCancel, handleSubmit, form, value } = this.props const { fileList, previewImage, previewVisible } = this.state const { getFieldDecorator } = form const categorySecondId = value ? value.categorySecondId : '' const categoryName = value ? value.categoryName : '' const categoryFirstId = value ? value.categoryFirstId : '' return ( <Modal visible={visible} title="修改分类信息" okText="修改" cancelText="取消" onCancel={handleCancel} onOk={this.handleSubmit} > <Form layout="vertical"> <FormItem label="id"> {getFieldDecorator('categorySecondId', { initialValue: categorySecondId })( <Input type="text" disabled /> )} </FormItem> <FormItem label="分类名称"> {getFieldDecorator('categoryName', { rules: [{ required: true, message: '请输入分类名称' }, { max: 10, min: 1, message: '商品名称不能超过10个字符' }], initialValue: categoryName })( <Input type="text" /> )} </FormItem> <FormItem label="所属一级分类"> {getFieldDecorator('categoryFirstId', { initialValue: categoryFirstId, rules: [{ required: true, message: '请选择所属一级分类' }] })( <CategorySelector allItem={false} level="first" /> )} </FormItem> <FormItem label="修改图片"> { getFieldDecorator('image')( <Upload action="http://192.168.191.1:8080/api/v1/fileUpload" listType="picture-card" fileList={fileList} onRemove={this.handleRemove} onPreview={this.handlePreview} // onPreview={this.handlePreview} // beforeUpload={this.beforeUpload} onChange={this.handlePictureChange} > {fileList.length >= 1 ? null : this.renderUploadBtn()} </Upload> ) } </FormItem> <Modal visible={previewVisible} footer={null} onCancel={this.handleCancel}> <img alt="example" style={{ width: '100%' }} src={previewImage} /> </Modal> </Form> </Modal> ) } }
24.274262
90
0.531201
6a4d6c6e9241bb32d3886c7bd6178ba74043a01c
2,022
js
JavaScript
webpack.config.js
juju4/mitaka
260b211c3c3bffc528e7d255b5722838bb5fe4c4
[ "MIT" ]
3
2020-09-28T14:05:30.000Z
2020-10-07T10:17:21.000Z
webpack.config.js
juju4/mitaka
260b211c3c3bffc528e7d255b5722838bb5fe4c4
[ "MIT" ]
null
null
null
webpack.config.js
juju4/mitaka
260b211c3c3bffc528e7d255b5722838bb5fe4c4
[ "MIT" ]
null
null
null
const { version } = require("./package.json"); const { CleanWebpackPlugin } = require("clean-webpack-plugin"); const CopyWebpackPlugin = require("copy-webpack-plugin"); const ExtensionReloader = require("webpack-extension-reloader"); const MiniCssExtractPlugin = require("mini-css-extract-plugin"); const path = require("path"); const config = { mode: process.env.NODE_ENV, context: path.join(__dirname, "/src"), entry: { background: "./background.ts", content: "./content.ts", options: "./options.ts", }, output: { filename: "[name].js", path: path.join(__dirname, "dist/"), }, module: { rules: [ { test: /\.tsx?$/, loader: "ts-loader", }, { test: /\.scss$/, use: [ MiniCssExtractPlugin.loader, { loader: "css-loader", }, { loader: "sass-loader", }, ], }, ], }, resolve: { extensions: [".ts", ".tsx", ".js"], }, optimization: { splitChunks: { name: "vendor", chunks: "all", }, }, plugins: [ new CopyWebpackPlugin({ patterns: [ { from: "icons", to: "icons" }, { from: "options/options.html", to: "options/options.html" }, { from: "manifest.json", to: "manifest.json", transform: (content) => { const jsonContent = JSON.parse(content); jsonContent.version = version; return JSON.stringify(jsonContent, null, 2); }, }, ], }), new MiniCssExtractPlugin({ filename: "options/css/bulma.css", }), new CleanWebpackPlugin(), ], performance: { assetFilter: function (assetFilename) { return assetFilename.endsWith(".js"); }, }, }; if (process.env.HMR === "true") { config.plugins = (config.plugins || []).concat([ new ExtensionReloader({ manifest: path.join(__dirname, "/src/manifest.json"), }), ]); } module.exports = config;
22.977273
69
0.535114
6a4df3b651390c675ada134df6e3b5706dd1ea72
55,618
js
JavaScript
dist/txt.min.js
diverted247/txtjs
a8a822ec85aaa574abfe7146bfe050eba7ba2a7f
[ "BSD-2-Clause" ]
167
2015-01-02T20:38:35.000Z
2022-03-22T13:16:46.000Z
dist/txt.min.js
diverted247/txtjs
a8a822ec85aaa574abfe7146bfe050eba7ba2a7f
[ "BSD-2-Clause" ]
34
2015-02-21T18:33:47.000Z
2020-01-28T09:42:42.000Z
dist/txt.min.js
diverted247/txtjs
a8a822ec85aaa574abfe7146bfe050eba7ba2a7f
[ "BSD-2-Clause" ]
28
2015-06-16T20:51:51.000Z
2021-03-11T20:55:55.000Z
var txt;!function(t){var i=function(){function i(){}return i.set=function(i){null!=i.stage&&(null!=t.Accessibility.timeout&&clearTimeout(t.Accessibility.timeout),null==i.accessibilityId&&(t.Accessibility.data.push(i),i.accessibilityId=t.Accessibility.data.length-1),t.Accessibility.timeout=setTimeout(t.Accessibility.update,300))},i.update=function(){t.Accessibility.timeout=null;var i=t.Accessibility.data.slice(0);i.sort(function(t,i){return t.accessibilityPriority-i.accessibilityPriority});for(var s=i.length,e="",h=i[0].stage.canvas,r=0;s>r;r++)null!=i[r].stage&&(h!=i[r].stage.canvas&&(h.innerHTML=e,e="",h=i[r].stage.canvas),e+=null==i[r].accessibilityText?"<p>"+i[r].text+"</p>":i[r].accessibilityText);h.innerHTML=e},i.clear=function(){t.Accessibility.data=[]},i.data=[],i.timeout=null,i}();t.Accessibility=i}(txt||(txt={}));var __extends=this.__extends||function(t,i){function s(){this.constructor=t}for(var e in i)i.hasOwnProperty(e)&&(t[e]=i[e]);s.prototype=i.prototype,t.prototype=new s},txt;!function(t){var i=function(i){function s(s){if(void 0===s&&(s=null),i.call(this),this.text="",this.lineHeight=null,this.width=100,this.height=20,this.align=t.Align.TOP_LEFT,this.characterCase=t.Case.NORMAL,this.size=12,this.font="belinda",this.tracking=0,this.ligatures=!1,this.fillColor="#000",this.strokeColor=null,this.strokeWidth=null,this.loaderId=null,this.style=null,this.debug=!1,this.original=null,this.words=[],this.lines=[],this.missingGlyphs=null,this.renderCycle=!0,this.accessibilityText=null,this.accessibilityPriority=2,this.accessibilityId=null,s&&(this.original=s,this.set(s)),null==this.style)t.FontLoader.load(this,[this.font]);else{for(var e=[this.font],h=this.style.length,r=0;h>r;++r)void 0!=this.style[r]&&void 0!=this.style[r].font&&e.push(this.style[r].font);t.FontLoader.load(this,e)}}return __extends(s,i),s.prototype.render=function(){this.getStage().update()},s.prototype.complete=function(){},s.prototype.fontLoaded=function(t){this.layout()},s.prototype.layout=function(){if(t.Accessibility.set(this),this.text=this.text.replace(/([\n][ \t]+)/g,"\n"),this.words=[],this.lines=[],this.missingGlyphs=null,this.removeAllChildren(),this.block=new createjs.Container,this.addChild(this.block),1==this.debug){var i=t.FontLoader.getFont(this.font),s=new createjs.Shape;s.graphics.beginStroke("#FF0000"),s.graphics.setStrokeStyle(1.2),s.graphics.drawRect(0,0,this.width,this.height),this.addChild(s),s=new createjs.Shape,s.graphics.beginFill("#000"),s.graphics.drawRect(0,0,this.width,.2),s.x=0,s.y=0,this.block.addChild(s),s=new createjs.Shape,s.graphics.beginFill("#F00"),s.graphics.drawRect(0,0,this.width,.2),s.x=0,s.y=-i["cap-height"]/i.units*this.size,this.block.addChild(s),s=new createjs.Shape,s.graphics.beginFill("#0F0"),s.graphics.drawRect(0,0,this.width,.2),s.x=0,s.y=-i.ascent/i.units*this.size,this.block.addChild(s),s=new createjs.Shape,s.graphics.beginFill("#00F"),s.graphics.drawRect(0,0,this.width,.2),s.x=0,s.y=-i.descent/i.units*this.size,this.block.addChild(s)}return""===this.text||void 0===this.text?(this.render(),void this.complete()):this.characterLayout()===!1?void this.removeAllChildren():this.renderCycle===!1?(this.removeAllChildren(),void this.complete()):(this.wordLayout(),this.lineLayout(),this.render(),void this.complete())},s.prototype.characterLayout=function(){var i,s=this.text.length,e={size:this.size,font:this.font,tracking:this.tracking,characterCase:this.characterCase,fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth},h=e,r=0,a=0,o=new t.Word;this.words.push(o);for(var n=0;s>n;n++)if(null!==this.style&&void 0!==this.style[n]&&(h=this.style[n],void 0===h.size&&(h.size=e.size),void 0===h.font&&(h.font=e.font),void 0===h.tracking&&(h.tracking=e.tracking),void 0===h.characterCase&&(h.characterCase=e.characterCase),void 0===h.fillColor&&(h.fillColor=e.fillColor),void 0===h.strokeColor&&(h.strokeColor=e.strokeColor),void 0===h.strokeWidth&&(h.strokeWidth=e.strokeWidth)),"\n"!=this.text.charAt(n)){if(t.FontLoader.isLoaded(h.font)===!1)return t.FontLoader.load(this,[h.font]),!1;if(i=new t.Character(this.text.charAt(n),h,n),this.original.character&&(this.original.character.added&&i.on("added",this.original.character.added),this.original.character.click&&i.on("click",this.original.character.click),this.original.character.dblclick&&i.on("dblclick",this.original.character.dblclick),this.original.character.mousedown&&i.on("mousedown",this.original.character.mousedown),this.original.character.mouseout&&i.on("mouseout",this.original.character.mouseout),this.original.character.mouseover&&i.on("mouseover",this.original.character.mouseover),this.original.character.pressmove&&i.on("pressmove",this.original.character.pressmove),this.original.character.pressup&&i.on("pressup",this.original.character.pressup),this.original.character.removed&&i.on("removed",this.original.character.removed),this.original.character.rollout&&i.on("rollout",this.original.character.rollout),this.original.character.rollover&&i.on("rollover",this.original.character.rollover),this.original.character.tick&&i.on("tick",this.original.character.tick)),i.missing&&(null==this.missingGlyphs&&(this.missingGlyphs=[]),this.missingGlyphs.push({position:n,character:this.text.charAt(n),font:h.font})),i.measuredHeight>a&&(a=i.measuredHeight),0==h.tracking&&1==this.ligatures){var l=this.text.substr(n,4);i._font.ligatures[l.charAt(0)]&&i._font.ligatures[l.charAt(0)][l.charAt(1)]&&(i._font.ligatures[l.charAt(0)][l.charAt(1)][l.charAt(2)]?i._font.ligatures[l.charAt(0)][l.charAt(1)][l.charAt(2)][l.charAt(3)]?(i.setGlyph(i._font.ligatures[l.charAt(0)][l.charAt(1)][l.charAt(2)][l.charAt(3)].glyph),n+=3):(i.setGlyph(i._font.ligatures[l.charAt(0)][l.charAt(1)][l.charAt(2)].glyph),n+=2):(i.setGlyph(i._font.ligatures[l.charAt(0)][l.charAt(1)].glyph),n+=1))}i.x=r,o.addChild(i)," "!=this.text.charAt(n)?("-"==this.text.charAt(n)&&(o.hasHyphen=!0),r=i.x+i._glyph.offset*i.size+i.characterCaseOffset+i.trackingOffset()+i._glyph.getKerning(this.text.charCodeAt(n+1),i.size)):(o.hasSpace=!0,o.spaceOffset=i._glyph.offset*i.size,r=i.x+i._glyph.offset*i.size+i.characterCaseOffset+i.trackingOffset()+i._glyph.getKerning(this.text.charCodeAt(n+1),i.size),o.measuredWidth=r,o.measuredHeight=a,r=0,a=0,o=new t.Word,this.words.push(o))}else s-1>n&&(o.measuredWidth=r,o.measuredHeight=a,0==o.measuredHeight&&(o.measuredHeight=h.size),o.hasNewLine=!0,o=new t.Word,this.words.push(o),a=0,r=0);if(0==o.children.length){{this.words.pop()}o=this.words[this.words.length-1],r=o.measuredWidth,a=o.measuredHeight}return o.measuredWidth=r,o.measuredHeight=a,!0},s.prototype.wordLayout=function(){var i=this.words.length,s=new t.Line;this.lines.push(s),s.y=0;var e,h;this.block.addChild(s);for(var r,a=0,o=0,n=!0,l=0;i>l;l++)if(e=this.words[l],e.x=a,this.original.word&&(this.original.word.added&&e.on("added",this.original.word.added),this.original.word.click&&e.on("click",this.original.word.click),this.original.word.dblclick&&e.on("dblclick",this.original.word.dblclick),this.original.word.mousedown&&e.on("mousedown",this.original.word.mousedown),this.original.word.mouseout&&e.on("mouseout",this.original.word.mouseout),this.original.word.mouseover&&e.on("mouseover",this.original.word.mouseover),this.original.word.pressmove&&e.on("pressmove",this.original.word.pressmove),this.original.word.pressup&&e.on("pressup",this.original.word.pressup),this.original.word.removed&&e.on("removed",this.original.word.removed),this.original.word.rollout&&e.on("rollout",this.original.word.rollout),this.original.word.rollover&&e.on("rollover",this.original.word.rollover),this.original.word.tick&&e.on("tick",this.original.word.tick)),n?o=e.measuredHeight:null!=this.lineHeight?o=this.lineHeight:e.measuredHeight>o&&(o=e.measuredHeight),a+e.measuredWidth>this.width&&1==e.hasNewLine&&s.children.length>0){h=null!=this.lineHeight?s.y+this.lineHeight:s.y+o,s.measuredWidth=a,r=this.words[l-1],void 0!=r&&r.hasSpace&&(s.measuredWidth-=r.spaceOffset),s.measuredHeight=0==n&&null!=this.lineHeight?this.lineHeight:o,n=!1,s=new t.Line,this.lines.push(s),s.y=h,a=0,e.x=0,this.block.addChild(s);var c=this.words[l];s.addChild(c),s.measuredHeight=null!=this.lineHeight?this.lineHeight:c.measuredHeight,s.measuredWidth=c.measuredWidth,s=new t.Line,this.lines.push(s),s.y=null!=this.lineHeight?h+this.lineHeight:h+o,this.block.addChild(s),i-1>l&&(o=0)}else{if(a+e.measuredWidth>this.width&&l>0&&s.children.length>0)h=null!=this.lineHeight?s.y+this.lineHeight:s.y+o,s.measuredWidth=a,r=this.words[l-1],void 0!=r&&r.hasSpace&&(s.measuredWidth-=r.spaceOffset),s.measuredHeight=0==n&&null!=this.lineHeight?this.lineHeight:o,n=!1,s=new t.Line,this.lines.push(s),s.y=h,i-1>l&&(o=0),a=0,e.x=a,this.block.addChild(s);else if(1==e.hasNewLine){h=null!=this.lineHeight?s.y+this.lineHeight:s.y+o,s.measuredWidth=a+e.measuredWidth,s.measuredHeight=0==n&&null!=this.lineHeight?this.lineHeight:o,s.addChild(this.words[l]),n=!1,s=new t.Line,this.lines.push(s),s.y=h,i-1>l&&(o=0),a=0,this.block.addChild(s);continue}a+=e.measuredWidth,s.addChild(this.words[l])}if(0==s.children.length){{this.lines.pop()}s=this.lines[this.lines.length-1]}s.measuredWidth=a,s.measuredHeight=o},s.prototype.lineLayout=function(){for(var i,s=0,e=t.Align,h=t.FontLoader.getFont(this.font),r=(this.size*h.ascent/h.units,this.size*h["cap-height"]/h.units,this.size*h["x-height"]/h.units,this.size*h.descent/h.units,this.lines.length),a=0;r>a;a++)i=this.lines[a],this.original.line&&(this.original.line.added&&i.on("added",this.original.line.added),this.original.line.click&&i.on("click",this.original.line.click),this.original.line.dblclick&&i.on("dblclick",this.original.line.dblclick),this.original.line.mousedown&&i.on("mousedown",this.original.line.mousedown),this.original.line.mouseout&&i.on("mouseout",this.original.line.mouseout),this.original.line.mouseover&&i.on("mouseover",this.original.line.mouseover),this.original.line.pressmove&&i.on("pressmove",this.original.line.pressmove),this.original.line.pressup&&i.on("pressup",this.original.line.pressup),this.original.line.removed&&i.on("removed",this.original.line.removed),this.original.line.rollout&&i.on("rollout",this.original.line.rollout),this.original.line.rollover&&i.on("rollover",this.original.line.rollover),this.original.line.tick&&i.on("tick",this.original.line.tick)),void 0!=i.lastWord()&&i.lastWord().lastCharacter()&&(i.measuredWidth-=i.lastWord().lastCharacter().trackingOffset()),s+=i.measuredHeight,this.align===e.TOP_CENTER?i.x=(this.width-i.measuredWidth)/2:this.align===e.TOP_RIGHT?i.x=this.width-i.measuredWidth:this.align===e.MIDDLE_CENTER?i.x=(this.width-i.measuredWidth)/2:this.align===e.MIDDLE_RIGHT?i.x=this.width-i.measuredWidth:this.align===e.BOTTOM_CENTER?i.x=(this.width-i.measuredWidth)/2:this.align===e.BOTTOM_RIGHT&&(i.x=this.width-i.measuredWidth);this.align===e.TOP_LEFT||this.align===e.TOP_CENTER||this.align===e.TOP_RIGHT?this.block.y=this.lines[0].measuredHeight*h.ascent/h.units+this.lines[0].measuredHeight*h.top/h.units:this.align===e.MIDDLE_LEFT||this.align===e.MIDDLE_CENTER||this.align===e.MIDDLE_RIGHT?this.block.y=this.lines[0].measuredHeight+(this.height-s)/2+this.lines[0].measuredHeight*h.middle/h.units:(this.align===e.BOTTOM_LEFT||this.align===e.BOTTOM_CENTER||this.align===e.BOTTOM_RIGHT)&&(this.block.y=this.height-this.lines[this.lines.length-1].y+this.lines[0].measuredHeight*h.bottom/h.units),this.original.block&&(this.original.block.added&&this.block.on("added",this.original.block.added),this.original.block.click&&this.block.on("click",this.original.block.click),this.original.block.dblclick&&this.block.on("dblclick",this.original.block.dblclick),this.original.block.mousedown&&this.block.on("mousedown",this.original.block.mousedown),this.original.block.mouseout&&this.block.on("mouseout",this.original.block.mouseout),this.original.block.mouseover&&this.block.on("mouseover",this.original.block.mouseover),this.original.block.pressmove&&this.block.on("pressmove",this.original.block.pressmove),this.original.block.pressup&&this.block.on("pressup",this.original.block.pressup),this.original.block.removed&&this.block.on("removed",this.original.block.removed),this.original.block.rollout&&this.block.on("rollout",this.original.block.rollout),this.original.block.rollover&&this.block.on("rollover",this.original.block.rollover),this.original.block.tick&&this.block.on("tick",this.original.block.tick))},s}(createjs.Container);t.Text=i}(txt||(txt={}));var txt;!function(t){var i=function(i){function s(s,e,h,r){if(void 0===h&&(h=null),void 0===r&&(r=null),i.call(this),this.character="",this.characterCode=null,this.font=null,this.tracking=null,this.characterCase=null,this.characterCaseOffset=0,this.index=null,this.size=null,this.fillColor=null,this.strokeColor=null,this.strokeWidth=null,this.measuredWidth=null,this.measuredHeight=null,this.hPosition=null,this.missing=!1,this.set(e),this.index=h,this.characterCase==t.Case.NORMAL)this.character=s;else if(this.characterCase==t.Case.UPPER)this.character=s.toUpperCase();else if(this.characterCase==t.Case.LOWER)this.character=s.toLowerCase();else if(this.characterCase==t.Case.SMALL_CAPS){this.character=s.toUpperCase();var a=!(s===this.character)}else this.character=s;this.characterCode=this.character.charCodeAt(0),this._font=t.FontLoader.getFont(this.font),this._font.glyphs[this.characterCode]?this._glyph=this._font.glyphs[this.characterCode]:this._font.glyphs[String.fromCharCode(this.characterCode).toLowerCase().charCodeAt(0)]?this._glyph=this._font.glyphs[String.fromCharCode(this.characterCode).toLowerCase().charCodeAt(0)]:this._font.glyphs[String.fromCharCode(this.characterCode).toUpperCase().charCodeAt(0)]&&(this._glyph=this._font.glyphs[String.fromCharCode(this.characterCode).toUpperCase().charCodeAt(0)]),void 0===this._glyph&&(console.log("MISSING GLYPH:"+this.character),this._glyph=this._font.glyphs[42],this.missing=!0),this.graphics=this._glyph.graphic(),this.characterCase===t.Case.SMALL_CAPS&&a?(this.scaleX=this.size/this._font.units*.8,this.characterCaseOffset=-.2*this._glyph.offset*this.size):this.scaleX=this.size/this._font.units,this.scaleY=-this.scaleX,this.measuredHeight=(this._font.ascent-this._font.descent)*this.scaleX,this.measuredWidth=this.scaleX*this._glyph.offset*this._font.units;var o=new createjs.Shape;o.graphics.beginFill("#000").drawRect(0,this._font.descent,this._glyph.offset*this._font.units,this._font.ascent-this._font.descent),this.hitArea=o}return __extends(s,i),s.prototype.setGlyph=function(t){this._glyph=t,this.graphics=this._glyph.graphic()},s.prototype.trackingOffset=function(){return this.size*(2.5/this._font.units+1/900+this.tracking/990)},s.prototype.draw=function(t){return this._glyph._fill.style=this.fillColor,this._glyph._fill.matrix=null,this._glyph._stroke.style=this.strokeColor,this._glyph._strokeStyle.width=this.strokeWidth,this._glyph.draw(t)},s.prototype.getWidth=function(){return this.size*this._glyph.offset},s}(createjs.Shape);t.Character=i}(txt||(txt={}));var txt;!function(t){var i=function(){function t(){this.glyphs={},this.kerning={},this.top=0,this.middle=0,this.bottom=0,this.units=1e3,this.ligatures={},this.loaded=!1,this.targets=[]}return t.prototype.cloneGlyph=function(t,i){void 0==this.glyphs[t]&&void 0!=this.glyphs[i]&&(this.glyphs[t]=this.glyphs[i],this.kerning[t]=this.kerning[i])},t}();t.Font=i}(txt||(txt={}));var txt;!function(t){var i=function(){function t(){this.path="",this.kerning={},this._graphic=null}return t.prototype.graphic=function(){return null==this._graphic&&(this._graphic=new createjs.Graphics,this._stroke=new createjs.Graphics.Stroke(null,!0),this._strokeStyle=new createjs.Graphics.StrokeStyle(0),this._fill=new createjs.Graphics.Fill(null),this._graphic.decodeSVGPath(this.path),this._graphic.append(this._fill),this._graphic.append(this._strokeStyle),this._graphic.append(this._stroke)),this._graphic},t.prototype.draw=function(t){return this._graphic.draw(t),!0},t.prototype.getKerning=function(t,i){var s=-(this.kerning[t]*i);return isNaN(s)?0:isNaN(t)?0:isNaN(i)?0:void 0!=this.kerning[t]?s:0},t}();t.Glyph=i}(txt||(txt={}));var txt;!function(t){var i=function(){function i(){}return i.isLoaded=function(i){return t.FontLoader.fonts.hasOwnProperty(i)?t.FontLoader.fonts[i].loaded:!1},i.getFont=function(i){return t.FontLoader.fonts.hasOwnProperty(i)?t.FontLoader.fonts[i]:null},i.load=function(i,s){var e;null==i.loaderId?(e={},i.loaderId=t.FontLoader.loaders.push(e)-1,e._id=i.loaderId,e._target=i):e=t.FontLoader.loaders[i.loaderId];for(var h=s.length,r=0;h>r;++r)e[s[r]]=!1;for(var a in e)"_"!=a.charAt(0)&&t.FontLoader.loadFont(a,e)},i.check=function(i){var s=t.FontLoader.loaders[i];for(var e in s)if("_"!=e.charAt(0)&&(s[e]=t.FontLoader.isLoaded(e),0==s[e]))return;window.setTimeout(function(){s._target.fontLoaded()},1)},i.loadFont=function(i,s){t.FontLoader.fonts;if(t.FontLoader.fonts.hasOwnProperty(i))t.FontLoader.fonts[i].loaded===!0?t.FontLoader.check(s._id):t.FontLoader.fonts[i].targets.push(s._id);else{var e=t.FontLoader.fonts[i]=new t.Font;e.targets.push(s._id);var h=new XMLHttpRequest;if(localStorage&&t.FontLoader.cache){var r=JSON.parse(localStorage.getItem("txt_font_"+i.split(" ").join("_")));null!=r&&r.version===t.FontLoader.version&&(h.cacheResponseText=r.font,h.cacheFont=!0)}h.onload=function(){localStorage&&t.FontLoader.cache&&void 0==this.cacheFont&&localStorage.setItem("txt_font_"+i.split(" ").join("_"),JSON.stringify({font:this.responseText,version:t.FontLoader.version}));var s=this.responseText.split("\n");this.cacheResponseText&&(s=this.cacheResponseText.split("\n"));for(var h,r,a=s.length,o=0;a>o;){switch(h=s[o].split("|"),h[0]){case"0":e[h[1]]="id"==h[1]||"panose"==h[1]||"family"==h[1]||"font-style"==h[1]||"font-stretch"==h[1]?h[2]:parseInt(h[2]);break;case"1":r=new t.Glyph,r.offset=parseInt(h[2])/e.units,r.path=h[3],e.glyphs[h[1]]=r;break;case"2":void 0==e.kerning[h[1]]&&(e.kerning[h[1]]={}),void 0==e.glyphs[h[1]]&&(r=new t.Glyph,r.offset=e["default"]/e.units,r.path="",e.glyphs[h[1]]=r),e.glyphs[h[1]].kerning[h[2]]=parseInt(h[3])/e.units,e.kerning[h[1]][h[2]]=parseInt(h[3])/e.units;break;case"3":h.shift();for(var n=h.length,l=0;n>l;l++)for(var c=h[l].split(""),g=c.length,d=e.ligatures,u=0;g>u;u++)void 0==d[c[u]]&&(d[c[u]]={}),u==g-1&&(d[c[u]].glyph=e.glyphs[h[l]]),d=d[c[u]]}o++}e.cloneGlyph(183,8226),e.cloneGlyph(8729,8226),e.cloneGlyph(12539,8226),e.cloneGlyph(9702,8226),e.cloneGlyph(9679,8226),e.cloneGlyph(9675,8226),void 0==e.top&&(e.top=0),void 0==e.middle&&(e.middle=0),void 0==e.bottom&&(e.bottom=0);var p=e.targets.length;e.loaded=!0;for(var f=0;p>f;++f)t.FontLoader.check(e.targets[f]);e.targets=[]},1==h.cacheFont?h.onload():(h.open("get",t.FontLoader.path+i.split(" ").join("_")+".txt",!0),h.send())}},i.path="/font/",i.cache=!1,i.version=0,i.fonts={},i.loaders=[],i}();t.FontLoader=i}(txt||(txt={})),createjs.Graphics.prototype.decodeSVGPath=function(t){return txt.Graphics.init(this,t),this};var txt;!function(t){var i=function(){function t(){}return t.init=function(i,s){for(var e=t.parsePathData(s),h=createjs.Graphics,r=0;r<e.length;r++){var a=e[r].command,o=e[r].points;switch(a){case"L":i.append(new h.LineTo(o[0],o[1]));break;case"M":i.append(new h.MoveTo(o[0],o[1]));break;case"C":i.append(new h.BezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]));break;case"Q":i.append(new h.QuadraticCurveTo(o[0],o[1],o[2],o[3]));break;case"A":i.append(new h.SVGArc(o[0],o[1],o[2],o[3],o[4],o[5],o[6]));break;case"Z":i.append(new h.ClosePath),i.append(new h.MoveTo(o[0],o[1]))}}},t.parsePathData=function(t){if(!t)return[];var i=t,s=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];i=i.replace(new RegExp(" ","g"),",");for(var e=0;e<s.length;e++)i=i.replace(new RegExp(s[e],"g"),"|"+s[e]);var h=i.split("|"),r=[],a=0,o=0,n=h.length,l=null;for(e=1;n>e;e++){var c=h[e],g=c.charAt(0);c=c.slice(1),c=c.replace(new RegExp(",-","g"),"-"),c=c.replace(new RegExp("-","g"),",-"),c=c.replace(new RegExp("e,-","g"),"e-");var d=c.split(",");d.length>0&&""===d[0]&&d.shift();for(var u=d.length,p=0;u>p;p++)d[p]=parseFloat(d[p]);for(("z"===g||"Z"===g)&&(d=[!0]);d.length>0&&!isNaN(d[0]);){var f,k,v,m,y,C,b,x,w,L,A=null,_=[],P=a,T=o;switch(g){case"l":a+=d.shift(),o+=d.shift(),A="L",_.push(a,o);break;case"L":a=d.shift(),o=d.shift(),_.push(a,o);break;case"m":var z=d.shift(),R=d.shift();a+=z,o+=R,null==l&&(l=[a,o]),A="M",_.push(a,o),g="l";break;case"M":a=d.shift(),o=d.shift(),A="M",null==l&&(l=[a,o]),_.push(a,o),g="L";break;case"h":a+=d.shift(),A="L",_.push(a,o);break;case"H":a=d.shift(),A="L",_.push(a,o);break;case"v":o+=d.shift(),A="L",_.push(a,o);break;case"V":o=d.shift(),A="L",_.push(a,o);break;case"C":_.push(d.shift(),d.shift(),d.shift(),d.shift()),a=d.shift(),o=d.shift(),_.push(a,o);break;case"c":_.push(a+d.shift(),o+d.shift(),a+d.shift(),o+d.shift()),a+=d.shift(),o+=d.shift(),A="C",_.push(a,o);break;case"S":k=a,v=o,f=r[r.length-1],"C"===f.command&&(k=a+(a-f.points[2]),v=o+(o-f.points[3])),_.push(k,v,d.shift(),d.shift()),a=d.shift(),o=d.shift(),A="C",_.push(a,o);break;case"s":k=a,v=o,f=r[r.length-1],"C"===f.command&&(k=a+(a-f.points[2]),v=o+(o-f.points[3])),_.push(k,v,a+d.shift(),o+d.shift()),a+=d.shift(),o+=d.shift(),A="C",_.push(a,o);break;case"Q":_.push(d.shift(),d.shift()),a=d.shift(),o=d.shift(),_.push(a,o);break;case"q":_.push(a+d.shift(),o+d.shift()),a+=d.shift(),o+=d.shift(),A="Q",_.push(a,o);break;case"T":k=a,v=o,f=r[r.length-1],"Q"===f.command&&(k=a+(a-f.points[0]),v=o+(o-f.points[1])),a=d.shift(),o=d.shift(),A="Q",_.push(k,v,a,o);break;case"t":k=a,v=o,f=r[r.length-1],"Q"===f.command&&(k=a+(a-f.points[0]),v=o+(o-f.points[1])),a+=d.shift(),o+=d.shift(),A="Q",_.push(k,v,a,o);break;case"A":m=d.shift(),y=d.shift(),C=d.shift(),b=d.shift(),x=d.shift(),w=a,L=o,a=d.shift(),o=d.shift(),A="A",_=[[w,L],m,y,C,b,x,[a,o]];break;case"a":m=d.shift(),y=d.shift(),C=d.shift(),b=d.shift(),x=d.shift(),w=a,L=o,a+=d.shift(),o+=d.shift(),A="A",_=[[w,L],m,y,C,b,x,[a,o]];break;case"z":A="Z",l?(a=l[0],o=l[1],l=null):(a=0,o=0),d.shift(),_=[a,o];break;case"Z":A="Z",l?(a=l[0],o=l[1],l=null):(a=0,o=0),d.shift(),_=[a,o]}r.push({command:A||g,points:_,start:{x:P,y:T}})}}return r},t}();t.Graphics=i}(txt||(txt={}));var createjs;!function(t){var i;!function(t){var i=function(){function t(t,i,s,e,h,r,a){if(this.rx=i,this.ry=s,this.x2=a,0!=i&&0!=s){var e=e*(Math.PI/180);i=Math.abs(i),s=Math.abs(s);var o=this.rotClockwise(this.midPoint(t,a),e),n=this.pointMul(o,o),l=Math.pow(i,2),c=Math.pow(s,2),g=Math.sqrt(n[0]/l+n[1]/c);g>1&&(i*=g,s*=g,l=Math.pow(i,2),c=Math.pow(s,2));var d=l*c-l*n[1]-c*n[0];d>-1e-6&&1e-6>d&&(d=0);var u=l*n[1]+c*n[0];u>-1e-6&&1e-6>u&&(u=0);var p=Math.sqrt(d/u);h==r&&(p*=-1);var f=this.scale(p,[i*o[1]/s,-s*o[0]/i]),k=this.sum(this.rotCounterClockwise(f,e),this.meanVec(t,a)),v=[(o[0]-f[0])/i,(o[1]-f[1])/s],m=[(-1*o[0]-f[0])/i,(-1*o[1]-f[1])/s],y=this.angle([1,0],v),C=this.angle(v,m);isNaN(C)&&(C=Math.PI);var b=y,x=y+C;this.cx=k[0],this.cy=k[1],this.phi=e,this.rx=i,this.ry=s,this.start=b,this.end=x,this.fS=!r}}return t.prototype.mag=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2))},t.prototype.meanVec=function(t,i){return[(t[0]+i[0])/2,(t[1]+i[1])/2]},t.prototype.dot=function(t,i){return t[0]*i[0]+t[1]*i[1]},t.prototype.ratio=function(t,i){return this.dot(t,i)/(this.mag(t)*this.mag(i))},t.prototype.rotClockwise=function(t,i){var s=Math.cos(i),e=Math.sin(i);return[s*t[0]+e*t[1],-1*e*t[0]+s*t[1]]},t.prototype.pointMul=function(t,i){return[t[0]*i[0],t[1]*i[1]]},t.prototype.scale=function(t,i){return[t*i[0],t*i[1]]},t.prototype.sum=function(t,i){return[t[0]+i[0],t[1]+i[1]]},t.prototype.angle=function(t,i){var s=1;return t[0]*i[1]-t[1]*i[0]<0&&(s=-1),s*Math.acos(this.ratio(t,i))},t.prototype.rotCounterClockwise=function(t,i){var s=Math.cos(i),e=Math.sin(i);return[s*t[0]-e*t[1],e*t[0]+s*t[1]]},t.prototype.midPoint=function(t,i){return[(t[0]-i[0])/2,(t[1]-i[1])/2]},t.prototype.exec=function(t){return 0==this.rx||0==this.ry?void t.lineTo(this.x2[0],this.x2[1]):(t.translate(this.cx,this.cy),t.rotate(this.phi),t.scale(this.rx,this.ry),t.arc(0,0,1,this.start,this.end,this.fS),t.scale(1/this.rx,1/this.ry),t.rotate(-this.phi),void t.translate(-this.cx,-this.cy))},t}();t.SVGArc=i}(i=t.Graphics||(t.Graphics={}))}(createjs||(createjs={}));var txt;!function(t){var i=function(){function t(){}return t.NORMAL=0,t.UPPER=1,t.LOWER=2,t.SMALL_CAPS=3,t}();t.Case=i}(txt||(txt={}));var txt;!function(t){var i=function(){function t(){}return t.TOP_LEFT=0,t.TOP_CENTER=1,t.TOP_RIGHT=2,t.MIDDLE_LEFT=3,t.MIDDLE_CENTER=4,t.MIDDLE_RIGHT=5,t.BOTTOM_LEFT=6,t.BOTTOM_CENTER=7,t.BOTTOM_RIGHT=8,t.TL=0,t.TC=1,t.TR=2,t.ML=3,t.MC=4,t.MR=5,t.BL=6,t.BC=7,t.BR=8,t}();t.Align=i}(txt||(txt={}));var txt;!function(t){var i=function(i){function s(s){if(void 0===s&&(s=null),i.call(this),this.text="",this.lineHeight=null,this.width=100,this.height=20,this.align=t.Align.TOP_LEFT,this.characterCase=t.Case.NORMAL,this.size=12,this.minSize=null,this.maxTracking=null,this.font="belinda",this.tracking=0,this.ligatures=!1,this.fillColor="#000",this.strokeColor=null,this.strokeWidth=null,this.singleLine=!1,this.autoExpand=!1,this.autoReduce=!1,this.overset=!1,this.oversetIndex=null,this.loaderId=null,this.style=null,this.debug=!1,this.original=null,this.lines=[],this.missingGlyphs=null,this.renderCycle=!0,this.measured=!1,this.oversetPotential=!1,this.accessibilityText=null,this.accessibilityPriority=2,this.accessibilityId=null,s&&(this.original=s,this.set(s),this.original.tracking=this.tracking),null==this.style)t.FontLoader.load(this,[this.font]);else{for(var e=[this.font],h=this.style.length,r=0;h>r;++r)void 0!=this.style[r]&&void 0!=this.style[r].font&&e.push(this.style[r].font);t.FontLoader.load(this,e)}}return __extends(s,i),s.prototype.complete=function(){},s.prototype.fontLoaded=function(){this.layout()},s.prototype.render=function(){this.getStage().update()},s.prototype.layout=function(){if(t.Accessibility.set(this),this.overset=!1,this.measured=!1,this.oversetPotential=!1,this.original.size&&(this.size=this.original.size),this.original.tracking&&(this.tracking=this.original.tracking),this.text=this.text.replace(/([\n][ \t]+)/g,"\n"),this.singleLine===!0&&(this.text=this.text.split("\n").join(""),this.text=this.text.split("\r").join("")),this.lines=[],this.missingGlyphs=null,this.removeAllChildren(),""===this.text||void 0===this.text)return this.render(),void this.complete();if(this.block=new createjs.Container,this.addChild(this.block),1==this.debug){var i=t.FontLoader.getFont(this.font),s=new createjs.Shape;s.graphics.beginStroke("#FF0000"),s.graphics.setStrokeStyle(1.2),s.graphics.drawRect(0,0,this.width,this.height),this.addChild(s),s=new createjs.Shape,s.graphics.beginFill("#000"),s.graphics.drawRect(0,0,this.width,.2),s.x=0,s.y=0,this.block.addChild(s),s=new createjs.Shape,s.graphics.beginFill("#F00"),s.graphics.drawRect(0,0,this.width,.2),s.x=0,s.y=-i["cap-height"]/i.units*this.size,this.block.addChild(s),s=new createjs.Shape,s.graphics.beginFill("#0F0"),s.graphics.drawRect(0,0,this.width,.2),s.x=0,s.y=-i.ascent/i.units*this.size,this.block.addChild(s),s=new createjs.Shape,s.graphics.beginFill("#00F"),s.graphics.drawRect(0,0,this.width,.2),s.x=0,s.y=-i.descent/i.units*this.size,this.block.addChild(s)}return this.singleLine!==!0||this.autoExpand!==!0&&this.autoReduce!==!0||this.measure(),this.renderCycle===!1?(this.removeAllChildren(),void this.complete()):this.characterLayout()===!1?void this.removeAllChildren():(this.lineLayout(),this.render(),void this.complete())},s.prototype.measure=function(){this.measured=!0;for(var i,s,e=(this.original.size,this.text.length),h=(this.getWidth(),{size:this.original.size,font:this.original.font,tracking:this.original.tracking,characterCase:this.original.characterCase}),r=null,a=[],o=h.size,n=0;e>n;n++)r=this.text.charCodeAt(n),i=h,void 0!==this.original.style&&void 0!==this.original.style[n]&&(i=this.original.style[n],void 0===i.size&&(i.size=h.size),void 0===i.font&&(i.font=h.font),void 0===i.tracking&&(i.tracking=h.tracking)),i.size>o&&(o=i.size),s=t.FontLoader.fonts[i.font],a.push({"char":this.text[n],size:i.size,charCode:r,font:i.font,offset:s.glyphs[r].offset,units:s.units,tracking:this.trackingOffset(i.tracking,i.size,s.units),kerning:s.glyphs[r].getKerning(this.getCharCodeAt(n+1),1)});var l={"char":" ",size:i.size,charCode:32,font:i.font,offset:s.glyphs[32].offset,units:s.units,tracking:0,kerning:0};a[a.length-1].tracking=0,e=a.length;for(var c=0,g=0,d=0,u=null,n=0;e>n;n++)u=a[n],c=c+u.offset+u.kerning,g+=(u.offset+u.kerning)*u.size,d+=(u.offset+u.kerning+u.tracking)*u.size;if(g>this.width){if(this.autoReduce===!0)return this.tracking=0,this.size=this.original.size*this.width/(g+l.offset*l.size),null!=this.minSize&&this.size<this.minSize&&(this.size=this.minSize,this.oversetPotential=!0),!0}else{var p=this.offsetTracking((this.width-g)/e,u.size,u.units);if(0>p&&(p=0),p>this.original.tracking&&this.autoExpand)return this.tracking=null!=this.maxTracking&&p>this.maxTracking?this.maxTracking:p,this.size=this.original.size,!0;if(p<this.original.tracking&&this.autoReduce)return this.tracking=null!=this.maxTracking&&p>this.maxTracking?this.maxTracking:p,this.size=this.original.size,!0}return!0},s.prototype.trackingOffset=function(t,i,s){return i*(2.5/s+1/900+t/990)},s.prototype.offsetTracking=function(t,i,s){return Math.floor(990*(t-2.5/s-1/900)/i)},s.prototype.getWidth=function(){return this.width},s.prototype.characterLayout=function(){var i,s=this.text.length,e={size:this.size,font:this.font,tracking:this.tracking,characterCase:this.characterCase,fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth},h=e,r=0,a=0,o=0,n=!0,l=new t.Line;this.lines.push(l),this.block.addChild(l);for(var c=0;s>c;c++)if(null!==this.style&&void 0!==this.style[c]&&(h=this.style[c],void 0===h.size&&(h.size=e.size),void 0===h.font&&(h.font=e.font),void 0===h.tracking&&(h.tracking=e.tracking),void 0===h.characterCase&&(h.characterCase=e.characterCase),void 0===h.fillColor&&(h.fillColor=e.fillColor),void 0===h.strokeColor&&(h.strokeColor=e.strokeColor),void 0===h.strokeWidth&&(h.strokeWidth=e.strokeWidth)),"\n"!=this.text.charAt(c)&&"\r"!=this.text.charAt(c)){if(t.FontLoader.isLoaded(h.font)===!1)return t.FontLoader.load(this,[h.font]),!1;if(i=new t.Character(this.text.charAt(c),h,c),this.original.character&&(this.original.character.added&&i.on("added",this.original.character.added),this.original.character.click&&i.on("click",this.original.character.click),this.original.character.dblclick&&i.on("dblclick",this.original.character.dblclick),this.original.character.mousedown&&i.on("mousedown",this.original.character.mousedown),this.original.character.mouseout&&i.on("mouseout",this.original.character.mouseout),this.original.character.mouseover&&i.on("mouseover",this.original.character.mouseover),this.original.character.pressmove&&i.on("pressmove",this.original.character.pressmove),this.original.character.pressup&&i.on("pressup",this.original.character.pressup),this.original.character.removed&&i.on("removed",this.original.character.removed),this.original.character.rollout&&i.on("rollout",this.original.character.rollout),this.original.character.rollover&&i.on("rollover",this.original.character.rollover),this.original.character.tick&&i.on("tick",this.original.character.tick)),i.missing&&(null==this.missingGlyphs&&(this.missingGlyphs=[]),this.missingGlyphs.push({position:c,character:this.text.charAt(c),font:h.font})),n===!0?a<i.size&&(a=i.size):void 0!=this.lineHeight&&this.lineHeight>0?a<this.lineHeight&&(a=this.lineHeight):i.measuredHeight>a&&(a=i.measuredHeight),0==h.tracking&&1==this.ligatures){var g=this.text.substr(c,4);i._font.ligatures[g.charAt(0)]&&i._font.ligatures[g.charAt(0)][g.charAt(1)]&&(i._font.ligatures[g.charAt(0)][g.charAt(1)][g.charAt(2)]?i._font.ligatures[g.charAt(0)][g.charAt(1)][g.charAt(2)][g.charAt(3)]?(i.setGlyph(i._font.ligatures[g.charAt(0)][g.charAt(1)][g.charAt(2)][g.charAt(3)].glyph), c+=3):(i.setGlyph(i._font.ligatures[g.charAt(0)][g.charAt(1)][g.charAt(2)].glyph),c+=2):(i.setGlyph(i._font.ligatures[g.charAt(0)][g.charAt(1)].glyph),c+=1))}if(1==this.overset)break;if(this.singleLine===!1&&r+i.measuredWidth>this.width){var d=l.children[l.children.length-1];l.measuredWidth=32==d.characterCode?r-d.measuredWidth-d.trackingOffset()-d._glyph.getKerning(this.getCharCodeAt(c),d.size):r-d.trackingOffset()-d._glyph.getKerning(this.getCharCodeAt(c),d.size),n===!0?(l.measuredHeight=a,l.y=0,o=0):(l.measuredHeight=a,o+=a,l.y=o),n=!1,l=new t.Line,l.addChild(i),r=32==i.characterCode?0:i.x+i._glyph.offset*i.size+i.characterCaseOffset+i.trackingOffset(),this.lines.push(l),this.block.addChild(l),a=0}else 1==this.measured&&this.singleLine===!0&&r+i.measuredWidth>this.width&&1==this.oversetPotential?(this.oversetIndex=c,this.overset=!0):0==this.measured&&this.singleLine===!0&&r+i.measuredWidth>this.width?(this.oversetIndex=c,this.overset=!0):(i.x=r,l.addChild(i),r=i.x+i._glyph.offset*i.size+i.characterCaseOffset+i.trackingOffset()+i._glyph.getKerning(this.getCharCodeAt(c+1),i.size))}else s-1>c&&(n===!0?(a=h.size,l.measuredHeight=h.size,l.measuredWidth=r,o=0,l.y=0):void 0!=this.lineHeight?(a=this.lineHeight,l.measuredHeight=a,l.measuredWidth=r,o+=a,l.y=o):(a=i.measuredHeight,l.measuredHeight=a,l.measuredWidth=r,o+=a,l.y=o),n=!1,l=new t.Line,l.measuredHeight=h.size,l.measuredWidth=0,this.lines.push(l),this.block.addChild(l),a=0,r=0),"\r"==this.text.charAt(c)&&"\n"==this.text.charAt(c+1)&&c++;if(0==l.children.length){{this.lines.pop()}l=this.lines[this.lines.length-1],r=l.measuredWidth,a=l.measuredHeight}return n===!0?(l.measuredWidth=r,l.measuredHeight=a,l.y=0):(l.measuredWidth=r,l.measuredHeight=a,0==a&&(a=this.lineHeight?this.lineHeight:h.size),l.y=o+a),!0},s.prototype.getCharCodeAt=function(i){return this.characterCase==t.Case.NORMAL?this.text.charAt(i).charCodeAt(0):this.characterCase==t.Case.UPPER?this.text.charAt(i).toUpperCase().charCodeAt(0):this.characterCase==t.Case.LOWER?this.text.charAt(i).toLowerCase().charCodeAt(0):this.characterCase==t.Case.SMALL_CAPS?this.text.charAt(i).toUpperCase().charCodeAt(0):this.text.charAt(i).charCodeAt(0)},s.prototype.lineLayout=function(){for(var i,s=0,e=t.Align,h=t.FontLoader.getFont(this.font),r=(this.size*h.ascent/h.units,this.size*h["cap-height"]/h.units,this.size*h["x-height"]/h.units,this.size*h.descent/h.units,this.lines.length),a=0;r>a;a++)i=this.lines[a],i.lastCharacter()&&(i.measuredWidth-=i.lastCharacter().trackingOffset()),this.original.line&&(this.original.line.added&&i.on("added",this.original.line.added),this.original.line.click&&i.on("click",this.original.line.click),this.original.line.dblclick&&i.on("dblclick",this.original.line.dblclick),this.original.line.mousedown&&i.on("mousedown",this.original.line.mousedown),this.original.line.mouseout&&i.on("mouseout",this.original.line.mouseout),this.original.line.mouseover&&i.on("mouseover",this.original.line.mouseover),this.original.line.pressmove&&i.on("pressmove",this.original.line.pressmove),this.original.line.pressup&&i.on("pressup",this.original.line.pressup),this.original.line.removed&&i.on("removed",this.original.line.removed),this.original.line.rollout&&i.on("rollout",this.original.line.rollout),this.original.line.rollover&&i.on("rollover",this.original.line.rollover),this.original.line.tick&&i.on("tick",this.original.line.tick)),s+=i.measuredHeight,this.align===e.TOP_CENTER?i.x=(this.width-i.measuredWidth)/2:this.align===e.TOP_RIGHT?i.x=this.width-i.measuredWidth:this.align===e.MIDDLE_CENTER?i.x=(this.width-i.measuredWidth)/2:this.align===e.MIDDLE_RIGHT?i.x=this.width-i.measuredWidth:this.align===e.BOTTOM_CENTER?i.x=(this.width-i.measuredWidth)/2:this.align===e.BOTTOM_RIGHT&&(i.x=this.width-i.measuredWidth);this.align===e.TOP_LEFT||this.align===e.TOP_CENTER||this.align===e.TOP_RIGHT?this.block.y=0==h.top?this.lines[0].measuredHeight*h.ascent/h.units:this.lines[0].measuredHeight*h.ascent/h.units+this.lines[0].measuredHeight*h.top/h.units:this.align===e.MIDDLE_LEFT||this.align===e.MIDDLE_CENTER||this.align===e.MIDDLE_RIGHT?this.block.y=this.lines[0].measuredHeight+(this.height-s)/2+this.lines[0].measuredHeight*h.middle/h.units:(this.align===e.BOTTOM_LEFT||this.align===e.BOTTOM_CENTER||this.align===e.BOTTOM_RIGHT)&&(this.block.y=this.height-this.lines[this.lines.length-1].y+this.lines[0].measuredHeight*h.bottom/h.units),this.original.block&&(this.original.block.added&&this.block.on("added",this.original.block.added),this.original.block.click&&this.block.on("click",this.original.block.click),this.original.block.dblclick&&this.block.on("dblclick",this.original.block.dblclick),this.original.block.mousedown&&this.block.on("mousedown",this.original.block.mousedown),this.original.block.mouseout&&this.block.on("mouseout",this.original.block.mouseout),this.original.block.mouseover&&this.block.on("mouseover",this.original.block.mouseover),this.original.block.pressmove&&this.block.on("pressmove",this.original.block.pressmove),this.original.block.pressup&&this.block.on("pressup",this.original.block.pressup),this.original.block.removed&&this.block.on("removed",this.original.block.removed),this.original.block.rollout&&this.block.on("rollout",this.original.block.rollout),this.original.block.rollover&&this.block.on("rollover",this.original.block.rollover),this.original.block.tick&&this.block.on("tick",this.original.block.tick))},s}(createjs.Container);t.CharacterText=i}(txt||(txt={}));var txt;!function(t){!function(t){t[t.Top=0]="Top",t[t.CapHeight=1]="CapHeight",t[t.Center=2]="Center",t[t.BaseLine=3]="BaseLine",t[t.Bottom=4]="Bottom",t[t.XHeight=5]="XHeight",t[t.Ascent=6]="Ascent",t[t.Percent=7]="Percent"}(t.VerticalAlign||(t.VerticalAlign={}));var i=(t.VerticalAlign,function(i){function s(s){if(void 0===s&&(s=null),i.call(this),this.text="",this.characterCase=t.Case.NORMAL,this.size=12,this.font="belinda",this.tracking=0,this.ligatures=!1,this.minSize=null,this.maxTracking=null,this.fillColor="#000",this.strokeColor=null,this.strokeWidth=null,this.style=null,this.debug=!1,this.original=null,this.autoExpand=!1,this.autoReduce=!1,this.overset=!1,this.oversetIndex=null,this.pathPoints=null,this.path="",this.start=0,this.end=null,this.flipped=!1,this.fit=0,this.align=0,this.valign=3,this.missingGlyphs=null,this.renderCycle=!0,this.valignPercent=1,this.initialTracking=0,this.initialOffset=0,this.measured=!1,this.oversetPotential=!1,this.accessibilityText=null,this.accessibilityPriority=2,this.accessibilityId=null,s&&(this.original=s,this.set(s),this.original.tracking=this.tracking),null==this.style)t.FontLoader.load(this,[this.font]);else{for(var e=[this.font],h=this.style.length,r=0;h>r;++r)void 0!=this.style[r]&&void 0!=this.style[r].font&&e.push(this.style[r].font);t.FontLoader.load(this,e)}this.pathPoints=new t.Path(this.path,this.start,this.end,this.flipped,this.fit,this.align)}return __extends(s,i),s.prototype.complete=function(){},s.prototype.setPath=function(t){this.path=t,this.pathPoints.path=this.path,this.pathPoints.update()},s.prototype.setStart=function(t){this.start=t,this.pathPoints.start=this.start,this.pathPoints.update()},s.prototype.setEnd=function(t){this.end=t,this.pathPoints.end=this.end,this.pathPoints.update()},s.prototype.setFlipped=function(t){this.flipped=t,this.pathPoints.flipped=this.flipped,this.pathPoints.update()},s.prototype.setFit=function(t){void 0===t&&(t=0),this.fit=t,this.pathPoints.fit=this.fit,this.pathPoints.update()},s.prototype.setAlign=function(t){void 0===t&&(t=0),this.align=t,this.pathPoints.align=this.align,this.pathPoints.update()},s.prototype.fontLoaded=function(){this.layout()},s.prototype.render=function(){this.getStage().update()},s.prototype.getWidth=function(){return this.pathPoints.realLength},s.prototype.layout=function(){if(t.Accessibility.set(this),this.overset=!1,this.oversetIndex=null,this.removeAllChildren(),this.characters=[],this.missingGlyphs=null,this.measured=!1,this.oversetPotential=!1,1==this.debug){var i=new createjs.Shape;i.graphics.beginStroke("#FF0000"),i.graphics.setStrokeStyle(.1),i.graphics.decodeSVGPath(this.path),i.graphics.endFill(),i.graphics.endStroke(),this.addChild(i),i=new createjs.Shape;var s=this.pathPoints.getRealPathPoint(0);i.x=s.x,i.y=s.y,i.graphics.beginFill("black"),i.graphics.drawCircle(0,0,2),this.addChild(i),i=new createjs.Shape;var s=this.pathPoints.getRealPathPoint(this.pathPoints.start);i.x=s.x,i.y=s.y,i.graphics.beginFill("green"),i.graphics.drawCircle(0,0,2),this.addChild(i),i=new createjs.Shape,s=this.pathPoints.getRealPathPoint(this.pathPoints.end),i.x=s.x,i.y=s.y,i.graphics.beginFill("red"),i.graphics.drawCircle(0,0,2),this.addChild(i),i=new createjs.Shape,s=this.pathPoints.getRealPathPoint(this.pathPoints.center),i.x=s.x,i.y=s.y,i.graphics.beginFill("blue"),i.graphics.drawCircle(0,0,2),this.addChild(i)}return""===this.text||void 0===this.text?void this.render():(this.block=new createjs.Container,this.addChild(this.block),this.autoExpand!==!0&&this.autoReduce!==!0||this.measure()!==!1?this.renderCycle===!1?(this.removeAllChildren(),void this.complete()):this.characterLayout()===!1?void this.removeAllChildren():(this.render(),void this.complete()):void this.removeAllChildren())},s.prototype.measure=function(){this.measured=!0;for(var i,s,e=(this.original.size,this.text.length),h=this.getWidth(),r={size:this.original.size,font:this.original.font,tracking:this.original.tracking,characterCase:this.original.characterCase},a=null,o=[],n=r.size,l=0;e>l;l++)a=this.text.charCodeAt(l),i=r,void 0!==this.original.style&&void 0!==this.original.style[l]&&(i=this.original.style[l],void 0===i.size&&(i.size=r.size),void 0===i.font&&(i.font=r.font),void 0===i.tracking&&(i.tracking=r.tracking)),i.size>n&&(n=i.size),s=t.FontLoader.fonts[i.font],o.push({"char":this.text[l],size:i.size,charCode:a,font:i.font,offset:s.glyphs[a].offset,units:s.units,tracking:this.trackingOffset(i.tracking,i.size,s.units),kerning:s.glyphs[a].getKerning(this.getCharCodeAt(l+1),1)});var c={"char":" ",size:i.size,charCode:32,font:i.font,offset:s.glyphs[32].offset,units:s.units,tracking:0,kerning:0};o[o.length-1].tracking=0,e=o.length;for(var g=0,d=0,u=0,p=null,l=0;e>l;l++)p=o[l],g=g+p.offset+p.kerning,d+=(p.offset+p.kerning)*p.size,u+=(p.offset+p.kerning+p.tracking)*p.size;if(d>h){if(this.autoReduce===!0)return this.tracking=0,this.size=this.original.size*h/(d+c.offset*c.size),null!=this.minSize&&this.size<this.minSize&&(this.size=this.minSize,this.renderCycle===!1?this.overset=!0:this.oversetPotential=!0),!0}else{var f=this.offsetTracking((h-d)/e,p.size,p.units);if(0>f&&(f=0),f>this.original.tracking&&this.autoExpand)return this.tracking=null!=this.maxTracking&&f>this.maxTracking?this.maxTracking:f,this.size=this.original.size,!0;if(f<this.original.tracking&&this.autoReduce)return this.tracking=null!=this.maxTracking&&f>this.maxTracking?this.maxTracking:f,this.size=this.original.size,!0}return!0},s.prototype.characterLayout=function(){for(var i,s=this.text.length,e={size:this.size,font:this.font,tracking:this.tracking,characterCase:this.characterCase,fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth},h=e,r=0,a=0;s>a;a++)if(null!==this.style&&void 0!==this.style[a]&&(h=this.style[a],void 0===h.size&&(h.size=e.size),void 0===h.font&&(h.font=e.font),void 0===h.tracking&&(h.tracking=e.tracking),void 0===h.characterCase&&(h.characterCase=e.characterCase),void 0===h.fillColor&&(h.fillColor=e.fillColor),void 0===h.strokeColor&&(h.strokeColor=e.strokeColor),void 0===h.strokeWidth&&(h.strokeWidth=e.strokeWidth)),"\n"!=this.text.charAt(a)){if(t.FontLoader.isLoaded(h.font)===!1)return t.FontLoader.load(this,[h.font]),!1;if(0==r&&(r=this.initialOffset+this.trackingOffset(this.initialTracking,h.size,t.FontLoader.getFont(h.font).units)),i=new t.Character(this.text.charAt(a),h,a),this.original.character&&(this.original.character.added&&i.on("added",this.original.character.added),this.original.character.click&&i.on("click",this.original.character.click),this.original.character.dblclick&&i.on("dblclick",this.original.character.dblclick),this.original.character.mousedown&&i.on("mousedown",this.original.character.mousedown),this.original.character.mouseout&&i.on("mouseout",this.original.character.mouseout),this.original.character.mouseover&&i.on("mouseover",this.original.character.mouseover),this.original.character.pressmove&&i.on("pressmove",this.original.character.pressmove),this.original.character.pressup&&i.on("pressup",this.original.character.pressup),this.original.character.removed&&i.on("removed",this.original.character.removed),this.original.character.rollout&&i.on("rollout",this.original.character.rollout),this.original.character.rollover&&i.on("rollover",this.original.character.rollover),this.original.character.tick&&i.on("tick",this.original.character.tick)),i.missing&&(null==this.missingGlyphs&&(this.missingGlyphs=[]),this.missingGlyphs.push({position:a,character:this.text.charAt(a),font:h.font})),0==h.tracking&&1==this.ligatures){var o=this.text.substr(a,4);i._font.ligatures[o.charAt(0)]&&i._font.ligatures[o.charAt(0)][o.charAt(1)]&&(i._font.ligatures[o.charAt(0)][o.charAt(1)][o.charAt(2)]?i._font.ligatures[o.charAt(0)][o.charAt(1)][o.charAt(2)][o.charAt(3)]?(i.setGlyph(i._font.ligatures[o.charAt(0)][o.charAt(1)][o.charAt(2)][o.charAt(3)].glyph),a+=3):(i.setGlyph(i._font.ligatures[o.charAt(0)][o.charAt(1)][o.charAt(2)].glyph),a+=2):(i.setGlyph(i._font.ligatures[o.charAt(0)][o.charAt(1)].glyph),a+=1))}if(1==this.overset)break;if(1==this.measured&&r+i.measuredWidth>this.getWidth()&&1==this.oversetPotential){this.oversetIndex=a,this.overset=!0;break}if(0==this.measured&&r+i.measuredWidth>this.getWidth()){this.oversetIndex=a,this.overset=!0;break}i.hPosition=r,this.characters.push(i),this.block.addChild(i),r=r+i._glyph.offset*i.size+i.characterCaseOffset+i.trackingOffset()+i._glyph.getKerning(this.getCharCodeAt(a+1),i.size)}s=this.characters.length;var n,l=!1;for(a=0;s>a;a++)if(i=this.characters[a],n=this.pathPoints.getPathPoint(i.hPosition,r,i._glyph.offset*i.size),1==l&&(this.characters[a-1].parent.rotation=n.rotation,l=!1),1==n.next&&(l=!0),i.rotation=n.rotation,3==this.valign)if(i.x=n.x,i.y=n.y,n.offsetX){var c=new createjs.Container;c.x=n.x,c.y=n.y,c.rotation=n.rotation,i.parent.removeChild(i),c.addChild(i),i.x=n.offsetX,i.y=0,i.rotation=0,this.addChild(c)}else i.x=n.x,i.y=n.y,i.rotation=n.rotation;else{var c=new createjs.Container;c.x=n.x,c.y=n.y,c.rotation=n.rotation,i.parent.removeChild(i),c.addChild(i),i.x=0,i.y=0==this.valign?i.size:4==this.valign?i._font.descent/i._font.units*i.size:1==this.valign?i._font["cap-height"]/i._font.units*i.size:5==this.valign?i._font["x-height"]/i._font.units*i.size:6==this.valign?i._font.ascent/i._font.units*i.size:2==this.valign?i._font["cap-height"]/i._font.units*i.size/2:7==this.valign?this.valignPercent*i.size:0,i.rotation=0,this.addChild(c)}return this.original.block&&(this.original.block.added&&this.block.on("added",this.original.block.added),this.original.block.click&&this.block.on("click",this.original.block.click),this.original.block.dblclick&&this.block.on("dblclick",this.original.block.dblclick),this.original.block.mousedown&&this.block.on("mousedown",this.original.block.mousedown),this.original.block.mouseout&&this.block.on("mouseout",this.original.block.mouseout),this.original.block.mouseover&&this.block.on("mouseover",this.original.block.mouseover),this.original.block.pressmove&&this.block.on("pressmove",this.original.block.pressmove),this.original.block.pressup&&this.block.on("pressup",this.original.block.pressup),this.original.block.removed&&this.block.on("removed",this.original.block.removed),this.original.block.rollout&&this.block.on("rollout",this.original.block.rollout),this.original.block.rollover&&this.block.on("rollover",this.original.block.rollover),this.original.block.tick&&this.block.on("tick",this.original.block.tick)),!0},s.prototype.trackingOffset=function(t,i,s){return i*(2.5/s+1/900+t/990)},s.prototype.offsetTracking=function(t,i,s){return Math.floor(990*(t-2.5/s-1/900)/i)},s.prototype.getCharCodeAt=function(i){return this.characterCase==t.Case.NORMAL?this.text.charAt(i).charCodeAt(0):this.characterCase==t.Case.UPPER?this.text.charAt(i).toUpperCase().charCodeAt(0):this.characterCase==t.Case.LOWER?this.text.charAt(i).toLowerCase().charCodeAt(0):this.characterCase==t.Case.SMALL_CAPS?this.text.charAt(i).toUpperCase().charCodeAt(0):this.text.charAt(i).charCodeAt(0)},s}(createjs.Container));t.PathText=i}(txt||(txt={}));var txt;!function(t){!function(t){t[t.Rainbow=0]="Rainbow",t[t.Stairstep=1]="Stairstep"}(t.PathFit||(t.PathFit={}));t.PathFit;!function(t){t[t.Center=0]="Center",t[t.Right=1]="Right",t[t.Left=2]="Left"}(t.PathAlign||(t.PathAlign={}));var i=(t.PathAlign,function(){function t(t,i,s,e,h,r){void 0===i&&(i=0),void 0===s&&(s=null),void 0===e&&(e=!1),void 0===h&&(h=0),void 0===r&&(r=0),this.pathElement=null,this.path=null,this.start=0,this.center=null,this.end=null,this.angles=null,this.flipped=!1,this.fit=0,this.align=0,this.length=null,this.realLength=null,this.closed=!1,this.clockwise=!0,this.path=t,this.start=i,this.align=r,this.end=s,this.flipped=e,this.fit=h,this.update()}return t.prototype.update=function(){this.pathElement=document.createElementNS("http://www.w3.org/2000/svg","path"),this.pathElement.setAttributeNS(null,"d",this.path),this.length=this.pathElement.getTotalLength(),this.closed=-1!=this.path.toLowerCase().indexOf("z");var t=this.length/10,i=[];i.push(this.getRealPathPoint(0)),i.push(this.getRealPathPoint(t)),i.push(this.getRealPathPoint(2*t)),i.push(this.getRealPathPoint(3*t)),i.push(this.getRealPathPoint(4*t)),i.push(this.getRealPathPoint(5*t)),i.push(this.getRealPathPoint(6*t)),i.push(this.getRealPathPoint(7*t)),i.push(this.getRealPathPoint(8*t)),i.push(this.getRealPathPoint(9*t)),i.push(this.getRealPathPoint(10*t));var s=(i[1].x-i[0].x)*(i[1].y+i[0].y)+(i[2].x-i[1].x)*(i[2].y+i[1].y)+(i[3].x-i[2].x)*(i[3].y+i[2].y)+(i[4].x-i[3].x)*(i[4].y+i[3].y)+(i[5].x-i[4].x)*(i[5].y+i[4].y)+(i[6].x-i[5].x)*(i[6].y+i[5].y)+(i[7].x-i[6].x)*(i[7].y+i[6].y)+(i[8].x-i[7].x)*(i[8].y+i[7].y)+(i[9].x-i[8].x)*(i[9].y+i[8].y)+(i[10].x-i[9].x)*(i[10].y+i[9].y);this.clockwise=s>0?!1:!0,null==this.end&&(this.end=this.length),0==this.closed?0==this.flipped?this.start>this.end?(this.realLength=this.start-this.end,this.center=this.start-this.realLength/2):(this.realLength=this.end-this.start,this.center=this.start+this.realLength/2):this.start>this.end?(this.realLength=this.start-this.end,this.center=this.start-this.realLength/2):(this.realLength=this.end-this.start,this.center=this.start+this.realLength/2):0==this.clockwise?0==this.flipped?this.start>this.end?(this.realLength=this.start-this.end,this.center=this.end+this.realLength/2):(this.realLength=this.start+this.length-this.end,this.center=this.end+this.realLength/2,this.center>this.length&&(this.center=this.center-this.length)):this.start>this.end?(this.realLength=this.end+this.length-this.start,this.center=this.start+this.realLength/2,this.center>this.length&&(this.center=this.center-this.length)):(this.realLength=this.end-this.start,this.center=this.start+this.realLength/2):0==this.flipped?this.start>this.end?(this.realLength=this.end+this.length-this.start,this.center=this.start+this.realLength/2,this.center>this.length&&(this.center=this.center-this.length)):(this.realLength=this.end-this.start,this.center=this.start+this.realLength/2):this.start>this.end?(this.realLength=this.start-this.end,this.center=this.end+this.realLength/2):(this.realLength=this.start+this.length-this.end,this.center=this.end+this.realLength/2,this.center>this.length&&(this.center=this.center-this.length))},t.prototype.getRealPathPoint=function(t){return this.pathElement.getPointAtLength(t>this.length?t-this.length:0>t?t+this.length:t)},t.prototype.getPathPoint=function(t,i,s){void 0===i&&(i=0),void 0===s&&(s=0),t=.99*t,i=.99*i;var e,h,r,a=!0,o=0;0==this.closed?0==this.flipped?this.start>this.end?(2==this.align?o=this.start:0==this.align?o=this.start-(this.realLength-i)/2:1==this.align&&(o=this.start-this.realLength-i),r=o-t,a=!1):(2==this.align?o=this.start:0==this.align?o=this.start+(this.realLength-i)/2:1==this.align&&(o=this.start+this.realLength-i),r=o+t):this.start>this.end?(2==this.align?o=this.start:0==this.align?o=this.start-(this.realLength-i)/2:1==this.align&&(o=this.start-this.realLength-i),r=o-t,a=!1):(2==this.align?o=this.start:0==this.align?o=this.start+(this.realLength-i)/2:1==this.align&&(o=this.start+this.realLength-i),r=o-t):0==this.clockwise?0==this.flipped?this.start>this.end?(2==this.align?o=this.start:0==this.align?o=this.start-(this.realLength-i)/2:1==this.align&&(o=this.start-this.realLength-i),r=o-t,a=!1):(2==this.align?(o=this.start,r=o-t):0==this.align?(o=this.start-(this.realLength-i)/2,r=o-t):1==this.align&&(o=this.start-this.realLength-i,r=o-t),0>r&&(r+=this.length),a=!1):this.start>this.end?(2==this.align?(o=this.start,r=o+t):0==this.align?(o=this.start+(this.realLength-i)/2,r=o+t):1==this.align&&(o=this.start+this.realLength-i,r=o+t),r>this.length&&(r-=this.length)):(2==this.align?o=this.start:0==this.align?o=this.start+(this.realLength-i)/2:1==this.align&&(o=this.start+this.realLength-i),r=o+t):0==this.flipped?this.start>this.end?(2==this.align?(o=this.start,r=o-t):0==this.align?(o=this.start-(this.realLength-i)/2,r=o-t):1==this.align&&(o=this.start-this.realLength-i,r=o-t),0>r&&(r+=this.length),a=!1):(2==this.align?o=this.start:0==this.align?o=this.start-(this.realLength-i)/2:1==this.align&&(o=this.start-this.realLength-i),r=o-t,a=!1):this.start>this.end?(2==this.align?o=this.start:0==this.align?o=this.start+(this.realLength-i)/2:1==this.align&&(o=this.start+this.realLength-i),r=o+t):(2==this.align?(o=this.start,r=o+t):0==this.align?(o=this.start+(this.realLength-i)/2,r=o+t):1==this.align&&(o=this.start+this.realLength-i,r=o+t),r>this.length&&(r-=this.length)),e=this.getRealPathPoint(r);var n=this.pathElement.pathSegList.getItem(this.pathElement.getPathSegAtLength(r)).pathSegType;if(4==n)if(a);else if(this.pathElement.getPathSegAtLength(r)!=this.pathElement.getPathSegAtLength(r-s)){var l=this.getRealPathPoint(r),c=this.getRealPathPoint(r-s),g=this.pathElement.pathSegList.getItem(this.pathElement.getPathSegAtLength(r)-1),d=Math.sqrt(Math.pow(l.x-g.x,2)+Math.pow(l.y-g.y,2)),u=Math.sqrt(Math.pow(c.x-g.x,2)+Math.pow(c.y-g.y,2));if(d>u){e=l,h={x:g.x,y:g.y};var p=180*Math.atan((h.y-e.y)/(h.x-e.x))/Math.PI;return e.x>h.x&&(p+=180),0>p&&(p+=360),p>360&&(p-=360),e.rotation=p,e}return e={x:g.x,y:g.y},e.offsetX=-d,e.next=!0,e}h=this.getRealPathPoint(a?r+s:r-s);var p=180*Math.atan((h.y-e.y)/(h.x-e.x))/Math.PI;return e.x>h.x&&(p+=180),0>p&&(p+=360),p>360&&(p-=360),e.rotation=p,e},t}());t.Path=i}(txt||(txt={}));var txt;!function(t){var i=function(t){function i(){t.call(this),this.hasNewLine=!1,this.hasHyphen=!1,this.hasSpace=!1,this.spaceOffset=0}return __extends(i,t),i.prototype.lastCharacter=function(){return this.children[this.children.length-1]},i}(createjs.Container);t.Word=i}(txt||(txt={}));var txt;!function(t){var i=function(t){function i(){t.call(this)}return __extends(i,t),i.prototype.lastWord=function(){return this.children[this.children.length-1]},i.prototype.lastCharacter=function(){return this.children[this.children.length-1]},i}(createjs.Container);t.Line=i}(txt||(txt={}));var txt;!function(t){var i=function(){function t(){}return t.VERSION="0.8.5",t.LICENSE="BSD-2-Clause",t.CONTACT="ted@light.ly",t}();t.Info=i}(txt||(txt={}));
27,809
32,027
0.736722
6a4e622d20f4638b15ac8696b27bca636fed2fa6
1,263
js
JavaScript
website/app/index.js
rwaldron/endpoints
7d564f2540939ef234f6da7df809a7fffbf613ae
[ "MIT" ]
null
null
null
website/app/index.js
rwaldron/endpoints
7d564f2540939ef234f6da7df809a7fffbf613ae
[ "MIT" ]
null
null
null
website/app/index.js
rwaldron/endpoints
7d564f2540939ef234f6da7df809a7fffbf613ae
[ "MIT" ]
2
2015-05-02T18:42:32.000Z
2021-03-31T18:54:42.000Z
const fs = require('fs'); const markdown = require('markdown').markdown; const express = require('express'); const app = express(); app.use(express.static(__dirname + '/public')); app.set('view engine', 'jade'); app.set('views', __dirname + '/views'); app.get('/guides', function(req, res){ res.render('guides/index'); }); app.get('/guides/:topic', function(req, res){ try { var topic_doc = fs.readFileSync('./website/app/data/guides/' + req.params.topic + '.md', 'utf8'); var topic_data = markdown.toHTML(topic_doc); } catch(e) { console.log(e); } res.render('guides/topic', { topic_data: topic_data }); }); app.get('/tutorial', function(req, res){ res.render('tutorial/index'); }); app.get('/tutorial/:step', function(req, res){ var step_num = parseInt(req.params.step); try { var step_doc = fs.readFileSync('./website/app/data/tutorial/step-' + req.params.step + '.md', 'utf8'); var step_data = markdown.toHTML(step_doc); } catch(e) { console.log(e); } res.render('tutorial/step', { step_data: step_data, step_num: step_num }); }); app.get('/about', function(req, res){ res.render('about'); }); app.get('/', function(req, res){ res.sendFile(__dirname + '/views/index.html'); }); module.exports = app;
25.77551
106
0.643705
6a4e9b467902647ad3da7af6c1f303f34aa7992b
55
js
JavaScript
jackeroo-vue/src/components/jackeroo/Form/Selector/Select/index.js
zhourenfei17/jackeroo-boot
1d5b67efdededcb2ce40c2655383b8cf338dd5a3
[ "Apache-2.0" ]
null
null
null
jackeroo-vue/src/components/jackeroo/Form/Selector/Select/index.js
zhourenfei17/jackeroo-boot
1d5b67efdededcb2ce40c2655383b8cf338dd5a3
[ "Apache-2.0" ]
26
2020-05-19T09:37:17.000Z
2022-02-27T04:53:15.000Z
jackeroo-vue/src/components/jackeroo/Form/Selector/Select/index.js
zhourenfei17/jackeroo-boot
1d5b67efdededcb2ce40c2655383b8cf338dd5a3
[ "Apache-2.0" ]
null
null
null
import JSelect from './JSelect' export default JSelect
18.333333
31
0.8
6a4efe7ea43246488bfb5f0a58742b12ebffd3dc
2,973
js
JavaScript
static/scripts/mvc/form/form-view.js
emily101-gif/immport-galaxy
8f353d1f9b4e0d044e1a9d0b1f928b440df78b8c
[ "CC-BY-3.0" ]
1
2020-01-06T21:04:22.000Z
2020-01-06T21:04:22.000Z
static/scripts/mvc/form/form-view.js
emily101-gif/immport-galaxy
8f353d1f9b4e0d044e1a9d0b1f928b440df78b8c
[ "CC-BY-3.0" ]
7
2019-04-26T12:29:58.000Z
2022-03-02T04:33:12.000Z
static/scripts/mvc/form/form-view.js
emily101-gif/immport-galaxy
8f353d1f9b4e0d044e1a9d0b1f928b440df78b8c
[ "CC-BY-3.0" ]
7
2016-11-03T19:11:01.000Z
2020-05-11T14:23:52.000Z
define("mvc/form/form-view",["exports","mvc/ui/ui-portlet","mvc/ui/ui-misc","mvc/form/form-section","mvc/form/form-data"],function(t,e,i,s,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(t,"__esModule",{value:!0});var a=o(e),r=o(i),l=o(s),h=o(n);t.default=Backbone.View.extend({initialize:function(t){this.model=new Backbone.Model({initial_errors:!1,cls:"ui-portlet-limited",icon:null,always_refresh:!0,status:"warning",hide_operations:!1,onchange:function(){}}).set(t),this.setElement("<div/>"),this.render()},update:function(t){var e=this;this.data.matchModel(t,function(t,i){var s=e.input_list[i],n=e.field_list[i];if(n.refreshDefinition&&n.refreshDefinition(t),s&&s.options&&!_.isEqual(s.options,t.options)&&(s.options=t.options,n.update)){var o=[];if(-1!=["data","data_collection","drill_down"].indexOf(s.type))o=s.options;else for(var a in t.options){var r=t.options[a];r.length>2&&o.push({label:r[0],value:r[1]})}n.update(o),n.trigger("change"),Galaxy.emit.debug("form-view::update()","Updating options for "+i)}})},wait:function(t){for(var e in this.input_list){var i=this.field_list[e];this.input_list[e].is_dynamic&&i.wait&&i.unwait&&i[t?"wait":"unwait"]()}},highlight:function(t,e,i){var s=this.element_list[t];if(s&&(s.error(e||"Please verify this parameter."),this.portlet.expand(),this.trigger("expand",t),!i)){var n=this.$el.parents().filter(function(){return-1!=["auto","scroll"].indexOf($(this).css("overflow"))}).first();n.animate({scrollTop:n.scrollTop()+s.$el.offset().top-n.position().top-120},500)}},errors:function(t){if(this.trigger("reset"),t&&t.errors){var e=this.data.matchResponse(t.errors);for(var i in this.element_list)e[i]&&this.highlight(i,e[i],!0)}},render:function(){var t=this;this.off("change"),this.off("reset"),this.field_list={},this.input_list={},this.element_list={},this.data=new h.default.Manager(this),this._renderForm(),this.data.create(),this.model.get("initial_errors")&&this.errors(this.model.attributes);var e=this.data.checksum();return this.on("change",function(i){var s=t.input_list[i];if(!s||s.refresh_on_change||t.model.get("always_refresh")){var n=t.data.checksum();n!=e&&(e=n,t.model.get("onchange")())}}),this.on("reset",function(){_.each(t.element_list,function(t){t.reset()})}),this},_renderForm:function(){$(".tooltip").remove();var t=this.model.attributes;this.message=new r.default.UnescapedMessage,this.section=new l.default.View(this,{inputs:t.inputs}),this.portlet=new a.default.View({icon:t.icon,title:t.title,title_id:t.title_id,cls:t.cls,operations:!t.hide_operations&&t.operations,buttons:t.buttons,collapsible:t.collapsible,collapsed:t.collapsed,onchange_title:t.onchange_title}),this.portlet.append(this.message.$el),this.portlet.append(this.section.$el),this.$el.empty(),t.inputs&&this.$el.append(this.portlet.$el),t.message&&this.message.update({persistent:!0,status:t.status,message:t.message}),Galaxy.emit.debug("form-view::initialize()","Completed")}})});
2,973
2,973
0.730912
6a4f693d21a41fcee83d8c96db5154cb2a08c6ad
403
js
JavaScript
client/src/components/Previewer.js
OpenNewsLabs/guri-vr
de110df843be8f6ff6e450436d6ec909eaa6f376
[ "MIT" ]
194
2016-03-28T13:48:51.000Z
2022-03-23T20:32:26.000Z
client/src/components/Previewer.js
OpenNewsLabs/guri-vr
de110df843be8f6ff6e450436d6ec909eaa6f376
[ "MIT" ]
69
2016-04-19T06:26:16.000Z
2021-10-13T00:20:28.000Z
client/src/components/Previewer.js
OpenNewsLabs/guri-vr
de110df843be8f6ff6e450436d6ec909eaa6f376
[ "MIT" ]
49
2016-07-11T23:58:15.000Z
2021-12-09T16:42:03.000Z
import { h } from 'preact' import { style } from 'glamor' export default ({ body, height, mode = 'vr' }) => ( <iframe crossorigin="anonymous" height={height} {...styles.container} src={`/api/preview?mode=${mode}&body=${encodeURIComponent(JSON.stringify(body))}`} allowfullscreen /> ) const styles = { container: style({ flex: 1, border: 'none', backgroundColor: '#000' }) }
22.388889
86
0.627792
6a4f7051c0a085bae9a4b37af82cb3a8a5b055f5
27,831
js
JavaScript
js/app.js
richard110110/sydney-hackton2019
fa6f07fec16f115fde920b20efa61cc1ce69a56d
[ "MIT" ]
null
null
null
js/app.js
richard110110/sydney-hackton2019
fa6f07fec16f115fde920b20efa61cc1ce69a56d
[ "MIT" ]
2
2020-08-24T14:45:40.000Z
2021-05-09T08:07:51.000Z
js/app.js
richard110110/sydney-hackton2019
fa6f07fec16f115fde920b20efa61cc1ce69a56d
[ "MIT" ]
null
null
null
var imgs = document.getElementById("portfolio"); var node = imgs.getElementsByTagName("img"); console.log(node); console.log(node.length); var url = "./causeInfo.json"; var Underprivileged = document.querySelector("#Underprivileged"); var UnderMeals = document.querySelector("#meals"); var educationSessions = document.querySelector("#edusession") var crisisInterv = document.querySelector("#crisisInterv"); var refugee = document.querySelector("#Refugees"); var safesleep = document.querySelector("#safe-sleep"); var foodgrocery = document.querySelector("#food-grocery"); var dollar_support = document.querySelector("#dollars-support"); var child_slavery = document.querySelector("#child"); var monthVocation = document.querySelector("#MonthsVocation"); var monthLive = document.querySelector("#MonthsLive"); var socialSupport = document.querySelector("#socialSupport"); var mental = document.querySelector("#mentalHealth"); var nationalcall = document.querySelector("#nationalcalls"); var peoplereach = document.querySelector("#peopleReach"); var healthservice = document.querySelector("#healthServices"); var domestic_violence = document.querySelector("#domestic-violence"); var Victims_support = document.querySelector("#Victims_support"); var relocate = document.querySelector("#relocate"); var domestic_achieve3 = document.querySelector("#domestic-achieve3"); var global_poverty = document.querySelector("#global_poverty"); var long_lasting = document.querySelector("#long-lasting"); var Lives_saved = document.querySelector("#Lives-saved"); var global_none = document.querySelector("#global-none"); var socialEnterprise = document.querySelector("#socialEnterprise"); var weeksFull = document.querySelector("#weeksFull"); var OnsiteTraining = document.querySelector("#OnsiteTraining"); var EnglishTuition = document.querySelector("#EnglishTuition"); var youthAtRisk = document.querySelector("#youthAtRisk"); var mentor = document.querySelector("#mentor"); var supportAfter = document.querySelector("#supportAfter"); var AdviceOnTrack = document.querySelector("#AdviceOnTrack"); var UnderprivilegedModal = document.querySelector("#UnderprivilegedModal"); var CharityUnderprivilegedModal = document.querySelector("#CharityUnderprivilegedModal"); var RefugeesName = document.querySelector("#RefugeesName"); var RefugeesCharity = document.querySelector("#RefugeesCharity"); var childslaveryName = document.querySelector("#childslaveryName"); var childslaverycharity = document.querySelector("#childslaverycharity"); var domesticViolenceName = document.querySelector("#domesticViolenceName"); var domesticViolenceCharity = document.querySelector("#domesticViolenceCharity"); var globalpovertyName = document.querySelector("#globalpovertyName"); var globalpovertyCharity = document.querySelector("#globalpovertyCharity"); var socialenterpriseName = document.querySelector("#socialenterpriseName"); var socialenterpriseCharity = document.querySelector("#socialenterpriseCharity"); var youthAtRiskName = document.querySelector("#youthAtRiskName"); var youthAtRiskCharity = document.querySelector("#youthAtRiskCharity"); fetch(url).then(function (res) { return res.json(); }) .then(function (data) { console.log(data.causes.underPrivilagedYouth.causeName); updatePortfolio(data); updateModal(data); }); function updateModal(data) { UnderprivilegedModal.innerText = data.causes.underPrivilagedYouth.causeName; CharityUnderprivilegedModal.innerText = data.causes.underPrivilagedYouth.charityName; RefugeesName.innerText = data.causes.refugeesInAustralia.causeName; RefugeesCharity.innerText = data.causes.refugeesInAustralia.charityName; childslaveryName.innerText = data.causes.childSlavery.causeName; childslaverycharity.innerText = data.causes.childSlavery.charityName; mentalHealthName.innerText = data.causes.mentalHealth.causeName; mentalHealthCharity.innerText = data.causes.mentalHealth.charityName; domesticViolenceName.innerText = data.causes.womanDomesticViolence.causeName; domesticViolenceCharity.innerText = data.causes.womanDomesticViolence.charityName; globalpovertyName.innerText = data.causes.globalPoverty.causeName; globalpovertyCharity.innerText = data.causes.globalPoverty.charityName; socialenterpriseName.innerText = data.causes.socialEnterprise.causeName; socialenterpriseCharity.innerText = data.causes.socialEnterprise.charityName; youthAtRiskName.innerText = data.causes.youthAtRisk.causeName; youthAtRiskCharity.innerText = data.causes.youthAtRisk.charityName; } function updatePortfolio(data) { Underprivileged.innerText = data.causes.underPrivilagedYouth.causeName; UnderMeals.innerText = data.causes.underPrivilagedYouth.thousandAchieves.achieve1.achieveName; educationSessions.innerText = data.causes.underPrivilagedYouth.thousandAchieves.achieve2.achieveName; crisisInterv.innerText = data.causes.underPrivilagedYouth.thousandAchieves.achieve3.achieveName; refugee.innerText = data.causes.refugeesInAustralia.causeName; safesleep.innerText = data.causes.refugeesInAustralia.thousandAchieves.achieve1.achieveName; foodgrocery.innerText = data.causes.refugeesInAustralia.thousandAchieves.achieve2.achieveName; dollar_support.innerText = data.causes.refugeesInAustralia.thousandAchieves.achieve3.achieveName; child_slavery.innerText = data.causes.childSlavery.causeName; monthVocation.innerText = data.causes.childSlavery.thousandAchieves.achieve1.achieveName; monthLive.innerText = data.causes.childSlavery.thousandAchieves.achieve2.achieveName; socialSupport.innerText = data.causes.childSlavery.thousandAchieves.achieve3.achieveName; mental.innerText = data.causes.mentalHealth.causeName; nationalcall.innerText = data.causes.mentalHealth.thousandAchieves.achieve1.achieveName; peoplereach.innerText = data.causes.mentalHealth.thousandAchieves.achieve2.achieveName; healthservice.innerText = data.causes.mentalHealth.thousandAchieves.achieve3.achieveName; domestic_violence.innerText = data.causes.womanDomesticViolence.causeName; Victims_support.innerText = data.causes.womanDomesticViolence.thousandAchieves.achieve1.achieveName; relocate.innerText = data.causes.womanDomesticViolence.thousandAchieves.achieve2.achieveName; domestic_achieve3.innerText = data.causes.womanDomesticViolence.thousandAchieves.achieve3.achieveName; global_poverty.innerText = data.causes.globalPoverty.causeName; long_lasting.innerText = data.causes.globalPoverty.thousandAchieves.achieve1.achieveName; Lives_saved.innerText = data.causes.globalPoverty.thousandAchieves.achieve2.achieveName; global_none.innerText = data.causes.globalPoverty.thousandAchieves.achieve3.achieveName; socialEnterprise.innerText = data.causes.socialEnterprise.causeName; weeksFull.innerText = data.causes.socialEnterprise.thousandAchieves.achieve1.achieveName; OnsiteTraining.innerText = data.causes.socialEnterprise.thousandAchieves.achieve2.achieveName; EnglishTuition.innerText = data.causes.socialEnterprise.thousandAchieves.achieve3.achieveName; youthAtRisk.innerText = data.causes.youthAtRisk.causeName; mentor.innerText = data.causes.youthAtRisk.thousandAchieves.achieve1.achieveName; supportAfter.innerText = data.causes.youthAtRisk.thousandAchieves.achieve2.achieveName; AdviceOnTrack.innerText = data.causes.youthAtRisk.thousandAchieves.achieve3.achieveName; } function displayChart() { var enteredValue = document .getElementById("enter") .value; console.log(document.getElementById("enter").value); fetch(url).then(function (res) { return res.json(); }) .then(function (data) { console.log(data.causes.underPrivilagedYouth.causeName); new Chart(document.getElementById("bar-chart-grouped"), { type: 'bar', data: { labels: [ data.causes.underPrivilagedYouth.causeName, data.causes.childSlavery.causeName, data.causes.mentalHealth.causeName, data.causes.womanDomesticViolence.causeName, data.causes.globalPoverty.causeName, data.causes.socialEnterprise.causeName, data.causes.youthAtRisk.causeName ], datasets: [{ label: "Achieve1", backgroundColor: "red", data: [ (Math.floor(enteredValue * (data.causes.underPrivilagedYouth.thousandAchieves.achieve1.achieveAmount / 1000))), (Math.floor(enteredValue * (data.causes.childSlavery.thousandAchieves.achieve1.achieveAmount / 1000))), (Math.floor(enteredValue * (data.causes.mentalHealth.thousandAchieves.achieve1.achieveAmount / 1000))), (Math.floor(enteredValue * (data.causes.womanDomesticViolence.thousandAchieves.achieve1.achieveAmount / 1000))), (Math.floor(enteredValue * (data.causes.globalPoverty.thousandAchieves.achieve1.achieveAmount / 1000))), (Math.floor(enteredValue * (data.causes.socialEnterprise.thousandAchieves.achieve1.achieveAmount / 1000))), (Math.floor(enteredValue * (data.causes.youthAtRisk.thousandAchieves.achieve1.achieveAmount / 1000))) ] }, { label: "Achieve2", backgroundColor: "pink", data: [ (Math.floor(enteredValue * (data.causes.underPrivilagedYouth.thousandAchieves.achieve2.achieveAmount / 1000))), (Math.floor(enteredValue * (data.causes.childSlavery.thousandAchieves.achieve2.achieveAmount / 1000))), (Math.floor(enteredValue * (data.causes.mentalHealth.thousandAchieves.achieve2.achieveAmount / 1000))), (Math.floor(enteredValue * (data.causes.womanDomesticViolence.thousandAchieves.achieve2.achieveAmount / 1000))), (Math.floor(enteredValue * (data.causes.globalPoverty.thousandAchieves.achieve2.achieveAmount / 1000))), (Math.floor(enteredValue * (data.causes.socialEnterprise.thousandAchieves.achieve2.achieveAmount / 1000))), (Math.floor(enteredValue * (data.causes.youthAtRisk.thousandAchieves.achieve2.achieveAmount / 1000))) ] }, { label: "Achieve3", backgroundColor: "lightblue", data: [ (Math.floor(enteredValue * (data.causes.underPrivilagedYouth.thousandAchieves.achieve1.achieveAmount / 1000))), (Math.floor(enteredValue * (data.causes.childSlavery.thousandAchieves.achieve3.achieveAmount / 1000))), (Math.floor(enteredValue * (data.causes.mentalHealth.thousandAchieves.achieve3.achieveAmount / 1000))), (Math.floor(enteredValue * (data.causes.womanDomesticViolence.thousandAchieves.achieve3.achieveAmount / 1000))), (Math.floor(enteredValue * (data.causes.globalPoverty.thousandAchieves.achieve3.achieveAmount / 1000))), (Math.floor(enteredValue * (data.causes.socialEnterprise.thousandAchieves.achieve3.achieveAmount / 1000))), (Math.floor(enteredValue * (data.causes.youthAtRisk.thousandAchieves.achieve3.achieveAmount / 1000))) ] }] }, options: { title: { display: true, text: 'Your donation result' } } }); }); } function displayEachCauseChart() { var enteredValue = document .getElementById("enter") .value; console.log(document.getElementById("enter").value); var piechart = document.getElementById("piechart"); fetch(url).then(function (res) { return res.json(); }).then(function (data) { var piechart_data = { labels: [ data.causes.underPrivilagedYouth.thousandAchieves.achieve1.achieveName, data.causes.underPrivilagedYouth.thousandAchieves.achieve2.achieveName, data.causes.underPrivilagedYouth.thousandAchieves.achieve3.achieveName ], datasets: [{ data: [(Math.floor(enteredValue * (data.causes.underPrivilagedYouth.thousandAchieves.achieve1.achieveAmount / 1000))), (Math.floor(enteredValue * (data.causes.underPrivilagedYouth.thousandAchieves.achieve2.achieveAmount / 1000))), (Math.floor(enteredValue * (data.causes.underPrivilagedYouth.thousandAchieves.achieve3.achieveAmount / 1000))) ], backgroundColor: [ "#FF6384", "#36A2EB", "#FFCE56" ], hoverBackgroundColor: [ "#FF6384", "#36A2EB", "#FFCE56" ] }] }; var myPieChart = new Chart(piechart, { type: 'pie', data: piechart_data }); }) } function displayEachCauseChart2() { var enteredValue = document .getElementById("enter") .value; console.log(document.getElementById("enter").value); var piechart = document.getElementById("piechart2"); fetch(url).then(function (res) { return res.json(); }).then(function (data) { var piechart_data = { labels: [ data.causes.refugeesInAustralia.thousandAchieves.achieve1.achieveName, data.causes.refugeesInAustralia.thousandAchieves.achieve2.achieveName, data.causes.refugeesInAustralia.thousandAchieves.achieve3.achieveName ], datasets: [{ data: [(Math.floor(enteredValue * (data.causes.refugeesInAustralia.thousandAchieves.achieve1.achieveAmount / 1000))), (Math.floor(enteredValue * (data.causes.refugeesInAustralia.thousandAchieves.achieve2.achieveAmount / 1000))), (Math.floor(enteredValue * (data.causes.refugeesInAustralia.thousandAchieves.achieve3.achieveAmount / 1000))) ], backgroundColor: [ "#FF6384", "#36A2EB", "#FFCE56" ], hoverBackgroundColor: [ "#FF6384", "#36A2EB", "#FFCE56" ] }] }; var myPieChart = new Chart(piechart, { type: 'pie', data: piechart_data }); }) } function displayEachCauseChart3() { var enteredValue = document .getElementById("enter") .value; console.log(document.getElementById("enter").value); var piechart = document.getElementById("piechart3"); fetch(url).then(function (res) { return res.json(); }).then(function (data) { var piechart_data = { labels: [ data.causes.childSlavery.thousandAchieves.achieve1.achieveName, data.causes.childSlavery.thousandAchieves.achieve2.achieveName, data.causes.childSlavery.thousandAchieves.achieve3.achieveName ], datasets: [{ data: [(Math.floor(enteredValue * (data.causes.childSlavery.thousandAchieves.achieve1.achieveAmount / 1000))), (Math.floor(enteredValue * (data.causes.childSlavery.thousandAchieves.achieve2.achieveAmount / 1000))), (Math.floor(enteredValue * (data.causes.childSlavery.thousandAchieves.achieve3.achieveAmount / 1000))) ], backgroundColor: [ "#FF6384", "#36A2EB", "#FFCE56" ], hoverBackgroundColor: [ "#FF6384", "#36A2EB", "#FFCE56" ] }] }; var myPieChart = new Chart(piechart, { type: 'pie', data: piechart_data }); }) } function displayEachCauseChart4() { var enteredValue = document .getElementById("enter") .value; console.log(document.getElementById("enter").value); var piechart = document.getElementById("piechart4"); fetch(url).then(function (res) { return res.json(); }).then(function (data) { var piechart_data = { labels: [ data.causes.mentalHealth.thousandAchieves.achieve1.achieveName, data.causes.mentalHealth.thousandAchieves.achieve2.achieveName, data.causes.mentalHealth.thousandAchieves.achieve3.achieveName ], datasets: [{ data: [(Math.floor(enteredValue * (data.causes.mentalHealth.thousandAchieves.achieve1.achieveAmount / 1000))), (Math.floor(enteredValue * (data.causes.mentalHealth.thousandAchieves.achieve2.achieveAmount / 1000))), (Math.floor(enteredValue * (data.causes.mentalHealth.thousandAchieves.achieve3.achieveAmount / 1000))) ], backgroundColor: [ "#FF6384", "#36A2EB", "#FFCE56" ], hoverBackgroundColor: [ "#FF6384", "#36A2EB", "#FFCE56" ] }] }; var myPieChart = new Chart(piechart, { type: 'pie', data: piechart_data }); }) } function displayEachCauseChart5() { var enteredValue = document .getElementById("enter") .value; console.log(document.getElementById("enter").value); var piechart = document.getElementById("piechart5"); fetch(url).then(function (res) { return res.json(); }).then(function (data) { var piechart_data = { labels: [ data.causes.womanDomesticViolence.thousandAchieves.achieve1.achieveName, data.causes.womanDomesticViolence.thousandAchieves.achieve2.achieveName, data.causes.womanDomesticViolence.thousandAchieves.achieve3.achieveName ], datasets: [{ data: [(Math.floor(enteredValue * (data.causes.womanDomesticViolence.thousandAchieves.achieve1.achieveAmount / 1000))), (Math.floor(enteredValue * (data.causes.womanDomesticViolence.thousandAchieves.achieve2.achieveAmount / 1000))), (Math.floor(enteredValue * (data.causes.womanDomesticViolence.thousandAchieves.achieve3.achieveAmount / 1000))) ], backgroundColor: [ "#FF6384", "#36A2EB", "#FFCE56" ], hoverBackgroundColor: [ "#FF6384", "#36A2EB", "#FFCE56" ] }] }; var myPieChart = new Chart(piechart, { type: 'pie', data: piechart_data }); }) } function displayEachCauseChart6() { var enteredValue = document .getElementById("enter") .value; console.log(document.getElementById("enter").value); var piechart = document.getElementById("piechart6"); fetch(url).then(function (res) { return res.json(); }).then(function (data) { var piechart_data = { labels: [ data.causes.globalPoverty.thousandAchieves.achieve1.achieveName, data.causes.globalPoverty.thousandAchieves.achieve2.achieveName, data.causes.globalPoverty.thousandAchieves.achieve3.achieveName ], datasets: [{ data: [(Math.floor(enteredValue * (data.causes.globalPoverty.thousandAchieves.achieve1.achieveAmount / 1000))), (Math.floor(enteredValue * (data.causes.globalPoverty.thousandAchieves.achieve2.achieveAmount / 1000))), (Math.floor(enteredValue * (data.causes.globalPoverty.thousandAchieves.achieve3.achieveAmount / 1000))) ], backgroundColor: [ "#FF6384", "#36A2EB", "#FFCE56" ], hoverBackgroundColor: [ "#FF6384", "#36A2EB", "#FFCE56" ] }] }; var myPieChart = new Chart(piechart, { type: 'pie', data: piechart_data }); }) } function displayEachCauseChart7() { var enteredValue = document .getElementById("enter") .value; console.log(document.getElementById("enter").value); var piechart = document.getElementById("piechart7"); fetch(url).then(function (res) { return res.json(); }).then(function (data) { var piechart_data = { labels: [ data.causes.socialEnterprise.thousandAchieves.achieve1.achieveName, data.causes.socialEnterprise.thousandAchieves.achieve2.achieveName, data.causes.socialEnterprise.thousandAchieves.achieve3.achieveName ], datasets: [{ data: [(Math.floor(enteredValue * (data.causes.socialEnterprise.thousandAchieves.achieve1.achieveAmount / 1000))), (Math.floor(enteredValue * (data.causes.socialEnterprise.thousandAchieves.achieve2.achieveAmount / 1000))), (Math.floor(enteredValue * (data.causes.socialEnterprise.thousandAchieves.achieve3.achieveAmount / 1000))) ], backgroundColor: [ "#FF6384", "#36A2EB", "#FFCE56" ], hoverBackgroundColor: [ "#FF6384", "#36A2EB", "#FFCE56" ] }] }; var myPieChart = new Chart(piechart, { type: 'pie', data: piechart_data }); }) } function displayEachCauseChart8() { var enteredValue = document .getElementById("enter") .value; console.log(document.getElementById("enter").value); var piechart = document.getElementById("piechart8"); fetch(url).then(function (res) { return res.json(); }).then(function (data) { var piechart_data = { labels: [ data.causes.youthAtRisk.thousandAchieves.achieve1.achieveName, data.causes.youthAtRisk.thousandAchieves.achieve2.achieveName, data.causes.youthAtRisk.thousandAchieves.achieve3.achieveName ], datasets: [{ data: [(Math.floor(enteredValue * (data.causes.youthAtRisk.thousandAchieves.achieve1.achieveAmount / 1000))), (Math.floor(enteredValue * (data.causes.youthAtRisk.thousandAchieves.achieve2.achieveAmount / 1000))), (Math.floor(enteredValue * (data.causes.youthAtRisk.thousandAchieves.achieve3.achieveAmount / 1000))) ], backgroundColor: [ "#FF6384", "#36A2EB", "#FFCE56" ], hoverBackgroundColor: [ "#FF6384", "#36A2EB", "#FFCE56" ] }] }; var myPieChart = new Chart(piechart, { type: 'pie', data: piechart_data }); }) } function getDonation() { var value = document .getElementById("enter") .value; if (value < 1000 && value > 0) { alertify.warning('our minimum is $1000'); preventDefault(); } if (value < 0) { alertify.error('do not make a joke here '); preventDefault(); } if (value == null || value == "") { alertify.warning('please enter the amount you want to donate: '); preventDefault(); } if (isNaN(value)) { alertify.error('please enter a number'); preventDefault(); } var meal = Math.floor(value * 0.053); var edus = Math.floor(value * 0.011); var crisis = Math.floor(value * 0.021); document .getElementById("meal1") .innerText = meal; document .getElementById("edu1") .innerText = edus; document .getElementById("crisis1") .innerText = crisis; var sleep = Math.floor(value * 0.016); var food = Math.floor(value * 0.0016); var financial = Math.floor(value * 0.093); document .getElementById("SafeSleep") .innerText = sleep; document .getElementById("FoodAndGrocery") .innerText = food; document .getElementById("FinancialSupport") .innerText = financial; var months = Math.floor(value * 0.006); var accommodation = Math.floor(value * 0.006); var socialSupport = Math.floor(value * 0); document .getElementById("MonthsVocationalTraining") .innerText = months; document .getElementById("MonthsAccommodation") .innerText = accommodation; document .getElementById("SocialSupportToAidIntegration") .innerText = socialSupport; var nationalcall = Math.floor(value * 0.00112); var PeopleReached = Math.floor(value * 0); var HealthService = Math.floor(value * 0.0012); document .getElementById("nationalcall") .innerText = nationalcall; document .getElementById("PeopleReached") .innerText = PeopleReached; document .getElementById("HealthService") .innerText = HealthService; var Victims = (Math.floor(value * 0.006)).toFixed(2); var Relocations = (Math.floor(value * 0.0034)).toFixed(2); var none = (Math.floor(value * 0)).toFixed(2); document .getElementById("Victims") .innerText = Victims; document .getElementById("Relocations") .innerText = Relocations; document .getElementById("none") .innerText = none; var nets = Math.floor(value * 0.3); var Lives = Math.floor(value * 0.0002); var none = Math.floor(value * 0); document .getElementById("nets") .innerText = nets; document .getElementById("Lives") .innerText = Lives; document .getElementById("none1") .innerText = none; var weeks = Math.floor(value * 0.0036); var Onsite = Math.floor(value * 0); var counselling = Math.floor(value * 0); document .getElementById("weeks") .innerText = weeks; document .getElementById("Onsite") .innerText = Onsite; document .getElementById("counselling") .innerText = counselling; var mentor = Math.floor(value * 0.0036); var crises = Math.floor(value * 0); var advice = Math.floor(value * 0); document .getElementById("Mentor") .innerText = mentor; document .getElementById("crises") .innerText = crises; document .getElementById("Advice") .innerText = advice; displayChart(); displayEachCauseChart(); displayEachCauseChart2(); displayEachCauseChart3(); displayEachCauseChart4(); displayEachCauseChart5(); displayEachCauseChart6(); displayEachCauseChart7(); displayEachCauseChart8(); }
37.157543
364
0.628077
6a4fb535b834489c941d6b1023fda243e2806018
180
js
JavaScript
packages/scroll/index.js
mozyy/ttd-element
d6d03c467e007b18ebf78b91bdfbc4eb857daf69
[ "MIT" ]
null
null
null
packages/scroll/index.js
mozyy/ttd-element
d6d03c467e007b18ebf78b91bdfbc4eb857daf69
[ "MIT" ]
null
null
null
packages/scroll/index.js
mozyy/ttd-element
d6d03c467e007b18ebf78b91bdfbc4eb857daf69
[ "MIT" ]
null
null
null
import TtdScroll from './src/scroll.vue'; /* istanbul ignore next */ TtdScroll.install = function(Vue) { Vue.component(TtdScroll.name, TtdScroll); }; export default TtdScroll;
20
43
0.733333
6a505a6e4df5c506a36728e5a2af922eb72c6365
1,166
js
JavaScript
app/scripts/account-import-strategies/index.js
liuyajuntm/mymetamask
f17e38b43a5a1f2cc55a358fef24848a32812d83
[ "MIT" ]
1
2020-03-18T16:24:04.000Z
2020-03-18T16:24:04.000Z
app/scripts/account-import-strategies/index.js
liuyajuntm/mymetamask
f17e38b43a5a1f2cc55a358fef24848a32812d83
[ "MIT" ]
null
null
null
app/scripts/account-import-strategies/index.js
liuyajuntm/mymetamask
f17e38b43a5a1f2cc55a358fef24848a32812d83
[ "MIT" ]
null
null
null
const Wallet = require('ethereumjs-wallet') const importers = require('ethereumjs-wallet/thirdparty') const ethUtil = require('ethereumjs-util') const accountImporter = { importAccount (strategy, args) { try { const importer = this.strategies[strategy] const privateKeyHex = importer.apply(null, args) return Promise.resolve(privateKeyHex) } catch (e) { return Promise.reject(e) } }, strategies: { 'Private Key': (privateKey) => { const stripped = ethUtil.stripHexPrefix(privateKey) return stripped }, 'JSON File': (input, password) => { let wallet try { wallet = importers.fromEtherWallet(input, password) } catch (e) { console.log('Attempt to import as EtherWallet format failed, trying V3...') } if (!wallet) { wallet = Wallet.fromV3(input, password, true) } return walletToPrivateKey(wallet) }, }, } function walletToPrivateKey (wallet) { const privateKeyBuffer = wallet.getPrivateKey() return ethUtil.bufferToHex(privateKeyBuffer) } module.exports = accountImporter
25.347826
84
0.631218
6a507e46b32a92c167a8b5f041cff80d39952a77
4,459
js
JavaScript
front_end/layers_test_runner/layers_test_runner.js
southpolesteve/devtools-frontend
59450acba8d5e784fcce316100c2aa938a105604
[ "BSD-3-Clause" ]
null
null
null
front_end/layers_test_runner/layers_test_runner.js
southpolesteve/devtools-frontend
59450acba8d5e784fcce316100c2aa938a105604
[ "BSD-3-Clause" ]
1
2021-01-22T00:22:39.000Z
2021-01-22T00:22:39.000Z
front_end/layers_test_runner/layers_test_runner.js
emchap/devtools-frontend
65c824b5adc918400877f7f1d65f17c901e42421
[ "BSD-3-Clause" ]
null
null
null
// Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** * @fileoverview using private properties isn't a Closure violation in tests. */ self.LayersTestRunner = self.LayersTestRunner || {}; LayersTestRunner.layerTreeModel = function() { if (!LayersTestRunner._layerTreeModel) { LayersTestRunner._layerTreeModel = TestRunner.mainTarget.model(Layers.LayerTreeModel); } return LayersTestRunner._layerTreeModel; }; LayersTestRunner.labelForLayer = function(layer) { const node = layer.nodeForSelfOrAncestor(); let label = (node ? Elements.DOMPath.fullQualifiedSelector(node, false) : '<invalid node id>'); const height = layer.height(); const width = layer.width(); if (height <= 200 && width <= 200) { label += ' ' + height + 'x' + width; } if (typeof layer.__extraData !== 'undefined') { label += ' (' + layer.__extraData + ')'; } return label; }; LayersTestRunner.dumpLayerTree = function(prefix, root) { if (!prefix) { prefix = ''; } if (!root) { root = LayersTestRunner.layerTreeModel().layerTree().contentRoot(); if (!root) { TestRunner.addResult('No layer root, perhaps not in the composited mode! '); TestRunner.completeTest(); return; } } TestRunner.addResult(prefix + LayersTestRunner.labelForLayer(root)); root.children().forEach(LayersTestRunner.dumpLayerTree.bind(LayersTestRunner, prefix + ' ')); }; LayersTestRunner.dumpLayers3DView = function(prefix, root) { if (!prefix) { prefix = ''; } if (!root) { root = UI.panels.layers._layers3DView._rotatingContainerElement; } if (root.__layer) { TestRunner.addResult(prefix + LayersTestRunner.labelForLayer(root.__layer)); } for (let element = root.firstElementChild; element; element = element.nextSibling) { LayersTestRunner.dumpLayers3DView(prefix + ' ', element); } }; LayersTestRunner.evaluateAndWaitForTreeChange = async function(expression) { await TestRunner.evaluateInPageAnonymously(expression); return LayersTestRunner.layerTreeModel().once(Layers.LayerTreeModel.Events.LayerTreeChanged); }; LayersTestRunner.findLayerByNodeIdAttribute = function(nodeIdAttribute) { let result; function testLayer(layer) { const node = layer.node(); if (!node) { return false; } if (!node || node.getAttribute('id') !== nodeIdAttribute) { return false; } result = layer; return true; } LayersTestRunner.layerTreeModel().layerTree().forEachLayer(testLayer); if (!result) { TestRunner.addResult('ERROR: No layer for ' + nodeIdAttribute); } return result; }; LayersTestRunner.requestLayers = function() { LayersTestRunner.layerTreeModel().enable(); return LayersTestRunner.layerTreeModel().once(Layers.LayerTreeModel.Events.LayerTreeChanged); }; LayersTestRunner.dispatchMouseEvent = function(eventType, button, element, offsetX, offsetY) { const totalOffset = element.totalOffset(); const eventArguments = { bubbles: true, cancelable: true, view: window, screenX: totalOffset.left - element.scrollLeft + offsetX, screenY: totalOffset.top - element.scrollTop + offsetY, clientX: totalOffset.left + offsetX, clientY: totalOffset.top + offsetY, button: button, composed: true }; if (eventType === 'mouseout') { eventArguments.screenX = 0; eventArguments.screenY = 0; eventArguments.clientX = 0; eventArguments.clientY = 0; } element.dispatchEvent(new MouseEvent(eventType, eventArguments)); }; LayersTestRunner.findLayerTreeElement = function(layer) { const element = LayerViewer.LayerTreeElement.layerToTreeElement.get(layer); element.reveal(); return element.listItemElement; }; LayersTestRunner.dispatchMouseEventToLayerTree = function(eventType, button, layer) { const element = LayersTestRunner.findLayerTreeElement(layer); TestRunner.assertTrue(Boolean(element)); LayersTestRunner.dispatchMouseEvent(eventType, button, element, element.clientWidth >> 1, element.clientHeight >> 1); }; LayersTestRunner.dumpSelectedStyles = function(message, element) { const classes = []; if (element.classList.contains('selected')) { classes.push('selected'); } if (element.classList.contains('hovered')) { classes.push('hovered'); } TestRunner.addResult(message + ': ' + classes.join(', ')); };
28.401274
119
0.710025
6a50deffa015420b3fcf52cdb1bc691ff731a1a5
288
js
JavaScript
ai/DQ/mongo/monsterData.js
TouhouFishClub/baibaibot
5e1932791a6a074850134e72fa65f132eb9c4386
[ "MIT" ]
17
2018-05-10T03:15:55.000Z
2021-11-27T16:04:48.000Z
ai/DQ/mongo/monsterData.js
TouhouFishClub/baibaibot
5e1932791a6a074850134e72fa65f132eb9c4386
[ "MIT" ]
null
null
null
ai/DQ/mongo/monsterData.js
TouhouFishClub/baibaibot
5e1932791a6a074850134e72fa65f132eb9c4386
[ "MIT" ]
3
2018-05-14T16:06:11.000Z
2020-04-08T12:19:32.000Z
const MongoClient = require('mongodb').MongoClient; const config = require('../config') MongoClient.connect(`${config.MONGO_URL}/${config.MONGO_DATABASE}`, (db, err) => { }) const AllMonster = [ { name: '史莱姆', atk: 1, def: 0, hp: 4, minlv: 1, maxlv: 4, } ]
16
82
0.583333
6a51298a1baf33cfc71c5779ce801311c59ce575
82
js
JavaScript
src/config.js
FranciscoKnebel/spotify-wrapper-api
da5ecc54f2c02756a70e10579b59bacd54863480
[ "MIT" ]
null
null
null
src/config.js
FranciscoKnebel/spotify-wrapper-api
da5ecc54f2c02756a70e10579b59bacd54863480
[ "MIT" ]
null
null
null
src/config.js
FranciscoKnebel/spotify-wrapper-api
da5ecc54f2c02756a70e10579b59bacd54863480
[ "MIT" ]
null
null
null
export const API_URL = 'https://api.spotify.com/v1'; export default { API_URL };
20.5
52
0.707317
6a5188404bc22681166d4f53b725ca84e543d718
439
js
JavaScript
public/modules/assigncourses/config/assigncourses.client.config.js
nurulhudarobin/ulab-course-bot
ec15ce71a7ecdfc2a74a0848c0bde8e6ce7c881a
[ "MIT" ]
1
2015-10-25T12:06:31.000Z
2015-10-25T12:06:31.000Z
public/modules/assigncourses/config/assigncourses.client.config.js
nurulhudarobin/ulab-course-bot
ec15ce71a7ecdfc2a74a0848c0bde8e6ce7c881a
[ "MIT" ]
null
null
null
public/modules/assigncourses/config/assigncourses.client.config.js
nurulhudarobin/ulab-course-bot
ec15ce71a7ecdfc2a74a0848c0bde8e6ce7c881a
[ "MIT" ]
null
null
null
'use strict'; // Configuring the Articles module angular.module('assigncourses').run(['Menus', function(Menus) { // Set top bar menu items Menus.addMenuItem('topbar', 'Assigncourses', 'assigncourses', 'dropdown', '/assigncourses(/create)?'); Menus.addSubMenuItem('topbar', 'assigncourses', 'List Assigncourses', 'assigncourses'); Menus.addSubMenuItem('topbar', 'assigncourses', 'New Assigncourse', 'assigncourses/create'); } ]);
39.909091
104
0.722096
6a518f3b4413cde782038123d423b0dad790bc38
537
js
JavaScript
kiyoshi_ni_shokuhatsu/src/engine/ESCamera.js
grokit/grokit.github.io
4150b013eacb9bbdbc1a5046bbc8355d8306a9bc
[ "MIT", "Unlicense" ]
10
2018-06-11T16:53:54.000Z
2021-06-26T00:37:25.000Z
kiyoshi_ni_shokuhatsu/src/engine/ESCamera.js
grokit/grokit.github.io
4150b013eacb9bbdbc1a5046bbc8355d8306a9bc
[ "MIT", "Unlicense" ]
null
null
null
kiyoshi_ni_shokuhatsu/src/engine/ESCamera.js
grokit/grokit.github.io
4150b013eacb9bbdbc1a5046bbc8355d8306a9bc
[ "MIT", "Unlicense" ]
3
2018-11-14T10:08:04.000Z
2018-12-24T16:06:11.000Z
class ESCamera extends EngineStepBase { constructor() { super(); this._camera = Factory.getCamera(); this._console = Factory.getConsole(); } onBeginLoop() { this._nTrack = 0; } apply(obj) { if (obj.traits.has('hero')) { this._camera.notifyTrackedObject(obj); this._nTrack += 1; } } onEndLoop() { if (this._nTrack != 1) { this._console.trace('ESCamera tracking ' + this._nTrack + ' object(s).'); } } }
20.653846
85
0.510242
6a51ca90bbb9c6d8d9380448e74bb011c5c5745a
31,350
js
JavaScript
node_modules/@angular/platform-browser/bundles/platform-browser.umd.min.js
jetta99/breople
2bcdd46f70d1c5e6f9daa302ae764b0d3732fed1
[ "MIT" ]
null
null
null
node_modules/@angular/platform-browser/bundles/platform-browser.umd.min.js
jetta99/breople
2bcdd46f70d1c5e6f9daa302ae764b0d3732fed1
[ "MIT" ]
7
2021-05-11T07:29:31.000Z
2022-03-02T07:49:52.000Z
node_modules/@angular/platform-browser/bundles/platform-browser.umd.min.js
jetta99/breople
2bcdd46f70d1c5e6f9daa302ae764b0d3732fed1
[ "MIT" ]
null
null
null
/** * @license Angular v9.0.6 * (c) 2010-2020 Google LLC. https://angular.io/ * License: MIT */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/common"),require("@angular/core")):"function"==typeof define&&define.amd?define("@angular/platform-browser",["exports","@angular/common","@angular/core"],t):t(((e=e||self).ng=e.ng||{},e.ng.platformBrowser={}),e.ng.common,e.ng.core)}(this,(function(e,t,n){"use strict"; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function o(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return(i=Object.assign||function e(t){for(var n,r=1,o=arguments.length;r<o;r++)for(var i in n=arguments[r])Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i]);return t}).apply(this,arguments)};function a(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function s(e,t){return function(n,r){t(n,r,e)}}function u(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)} /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var c,l=function(e){function t(){return e.call(this)||this}return o(t,e),t.prototype.supportsDOMEvents=function(){return!0},t}(t.ɵDomAdapter),p=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return o(n,e),n.makeCurrent=function(){t.ɵsetRootDomAdapter(new n)},n.prototype.getProperty=function(e,t){return e[t]},n.prototype.log=function(e){window.console&&window.console.log&&window.console.log(e)},n.prototype.logGroup=function(e){window.console&&window.console.group&&window.console.group(e)},n.prototype.logGroupEnd=function(){window.console&&window.console.groupEnd&&window.console.groupEnd()},n.prototype.onAndCancel=function(e,t,n){return e.addEventListener(t,n,!1),function(){e.removeEventListener(t,n,!1)}},n.prototype.dispatchEvent=function(e,t){e.dispatchEvent(t)},n.prototype.remove=function(e){return e.parentNode&&e.parentNode.removeChild(e),e},n.prototype.getValue=function(e){return e.value},n.prototype.createElement=function(e,t){return(t=t||this.getDefaultDocument()).createElement(e)},n.prototype.createHtmlDocument=function(){return document.implementation.createHTMLDocument("fakeTitle")},n.prototype.getDefaultDocument=function(){return document},n.prototype.isElementNode=function(e){return e.nodeType===Node.ELEMENT_NODE},n.prototype.isShadowRoot=function(e){return e instanceof DocumentFragment},n.prototype.getGlobalEventTarget=function(e,t){return"window"===t?window:"document"===t?e:"body"===t?e.body:null},n.prototype.getHistory=function(){return window.history},n.prototype.getLocation=function(){return window.location},n.prototype.getBaseHref=function(e){var t=function n(){return f||(f=document.querySelector("base"))?f.getAttribute("href"):null}();return null==t?null:function r(e){return c||(c=document.createElement("a")),c.setAttribute("href",e),"/"===c.pathname.charAt(0)?c.pathname:"/"+c.pathname} /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */(t)},n.prototype.resetBaseElement=function(){f=null},n.prototype.getUserAgent=function(){return window.navigator.userAgent},n.prototype.performanceNow=function(){return window.performance&&window.performance.now?window.performance.now():(new Date).getTime()},n.prototype.supportsCookies=function(){return!0},n.prototype.getCookie=function(e){return t.ɵparseCookieValue(document.cookie,e)},n}(l),f=null,d=new n.InjectionToken("TRANSITION_ID"); /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */function y(e,r,o){return function(){o.get(n.ApplicationInitStatus).donePromise.then((function(){var n=t.ɵgetDOM();Array.prototype.slice.apply(r.querySelectorAll("style[ng-transition]")).filter((function(t){return t.getAttribute("ng-transition")===e})).forEach((function(e){return n.remove(e)}))}))}}var h=[{provide:n.APP_INITIALIZER,useFactory:y,deps:[d,t.DOCUMENT,n.Injector],multi:!0}],m=function(){function e(){}return e.init=function(){n.setTestabilityGetter(new e)},e.prototype.addToWindow=function(e){n.ɵglobal.getAngularTestability=function(t,n){void 0===n&&(n=!0);var r=e.findTestabilityInTree(t,n);if(null==r)throw new Error("Could not find testability for element.");return r},n.ɵglobal.getAllAngularTestabilities=function(){return e.getAllTestabilities()},n.ɵglobal.getAllAngularRootElements=function(){return e.getAllRootElements()},n.ɵglobal.frameworkStabilizers||(n.ɵglobal.frameworkStabilizers=[]),n.ɵglobal.frameworkStabilizers.push((function(e){var t=n.ɵglobal.getAllAngularTestabilities(),r=t.length,o=!1,i=function(t){o=o||t,0==--r&&e(o)};t.forEach((function(e){e.whenStable(i)}))}))},e.prototype.findTestabilityInTree=function(e,n,r){if(null==n)return null;var o=e.getTestability(n);return null!=o?o:r?t.ɵgetDOM().isShadowRoot(n)?this.findTestabilityInTree(e,n.host,!0):this.findTestabilityInTree(e,n.parentElement,!0):null},e}(); /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */function g(e,t){"undefined"!=typeof COMPILED&&COMPILED||((n.ɵglobal.ng=n.ɵglobal.ng||{})[e]=t)} /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */var w={ApplicationRef:n.ApplicationRef,NgZone:n.NgZone},v="probe",_="coreTokens";function b(e){return n.ɵgetDebugNodeR2(e)}function E(e){return g(v,b),g(_,i(i({},w),function t(e){return e.reduce((function(e,t){return e[t.name]=t.token,e}),{})}(e||[]))),function(){return b}}var S=[{provide:n.APP_INITIALIZER,useFactory:E,deps:[[n.NgProbeToken,new n.Optional]],multi:!0}],T=S,O=new n.InjectionToken("EventManagerPlugins"),C=function(){function e(e,t){var n=this;this._zone=t,this._eventNameToPlugin=new Map,e.forEach((function(e){return e.manager=n})),this._plugins=e.slice().reverse()}return e.prototype.addEventListener=function(e,t,n){return this._findPluginFor(t).addEventListener(e,t,n)},e.prototype.addGlobalEventListener=function(e,t,n){return this._findPluginFor(t).addGlobalEventListener(e,t,n)},e.prototype.getZone=function(){return this._zone},e.prototype._findPluginFor=function(e){var t=this._eventNameToPlugin.get(e);if(t)return t;for(var n=this._plugins,r=0;r<n.length;r++){var o=n[r];if(o.supports(e))return this._eventNameToPlugin.set(e,o),o}throw new Error("No event manager plugin found for event "+e)},a([n.Injectable(),s(0,n.Inject(O)),u("design:paramtypes",[Array,n.NgZone])],e)}(),I=function(){function e(e){this._doc=e}return e.prototype.addGlobalEventListener=function(e,n,r){var o=t.ɵgetDOM().getGlobalEventTarget(this._doc,e);if(!o)throw new Error("Unsupported event target "+o+" for event "+n);return this.addEventListener(o,n,r)},e}(),A=function(){function e(){this._stylesSet=new Set}return e.prototype.addStyles=function(e){var t=this,n=new Set;e.forEach((function(e){t._stylesSet.has(e)||(t._stylesSet.add(e),n.add(e))})),this.onStylesAdded(n)},e.prototype.onStylesAdded=function(e){},e.prototype.getAllStyles=function(){return Array.from(this._stylesSet)},a([n.Injectable()],e)}(),R=function(e){function r(t){var n=e.call(this)||this;return n._doc=t,n._hostNodes=new Set,n._styleNodes=new Set,n._hostNodes.add(t.head),n}return o(r,e),r.prototype._addStylesToHost=function(e,t){var n=this;e.forEach((function(e){var r=n._doc.createElement("style");r.textContent=e,n._styleNodes.add(t.appendChild(r))}))},r.prototype.addHost=function(e){this._addStylesToHost(this._stylesSet,e),this._hostNodes.add(e)},r.prototype.removeHost=function(e){this._hostNodes.delete(e)},r.prototype.onStylesAdded=function(e){var t=this;this._hostNodes.forEach((function(n){return t._addStylesToHost(e,n)}))},r.prototype.ngOnDestroy=function(){this._styleNodes.forEach((function(e){return t.ɵgetDOM().remove(e)}))},a([n.Injectable(),s(0,n.Inject(t.DOCUMENT)),u("design:paramtypes",[Object])],r)}(A),N={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},M=/%COMP%/g,D="_nghost-%COMP%",P="_ngcontent-%COMP%";function k(e){return P.replace(M,e)}function j(e){return D.replace(M,e)}function L(e,t,n){for(var r=0;r<t.length;r++){var o=t[r];Array.isArray(o)?L(e,o,n):(o=o.replace(M,e),n.push(o))}return n}function H(e){return function(t){if("__ngUnwrap__"===t)return e;!1===e(t)&&(t.preventDefault(),t.returnValue=!1)}}var x=function(){function e(e,t,n){this.eventManager=e,this.sharedStylesHost=t,this.appId=n,this.rendererByCompId=new Map,this.defaultRenderer=new U(e)}return e.prototype.createRenderer=function(e,t){if(!e||!t)return this.defaultRenderer;switch(t.encapsulation){case n.ViewEncapsulation.Emulated:var r=this.rendererByCompId.get(t.id);return r||(r=new B(this.eventManager,this.sharedStylesHost,t,this.appId),this.rendererByCompId.set(t.id,r)),r.applyToHost(e),r;case n.ViewEncapsulation.Native:case n.ViewEncapsulation.ShadowDom:return new z(this.eventManager,this.sharedStylesHost,e,t);default:if(!this.rendererByCompId.has(t.id)){var o=L(t.id,t.styles,[]);this.sharedStylesHost.addStyles(o),this.rendererByCompId.set(t.id,this.defaultRenderer)}return this.defaultRenderer}},e.prototype.begin=function(){},e.prototype.end=function(){},a([n.Injectable(),s(2,n.Inject(n.APP_ID)),u("design:paramtypes",[C,R,String])],e)}(),U=function(){function e(e){this.eventManager=e,this.data=Object.create(null)}return e.prototype.destroy=function(){},e.prototype.createElement=function(e,t){return t?document.createElementNS(N[t]||t,e):document.createElement(e)},e.prototype.createComment=function(e){return document.createComment(e)},e.prototype.createText=function(e){return document.createTextNode(e)},e.prototype.appendChild=function(e,t){e.appendChild(t)},e.prototype.insertBefore=function(e,t,n){e&&e.insertBefore(t,n)},e.prototype.removeChild=function(e,t){e&&e.removeChild(t)},e.prototype.selectRootElement=function(e,t){var n="string"==typeof e?document.querySelector(e):e;if(!n)throw new Error('The selector "'+e+'" did not match any elements');return t||(n.textContent=""),n},e.prototype.parentNode=function(e){return e.parentNode},e.prototype.nextSibling=function(e){return e.nextSibling},e.prototype.setAttribute=function(e,t,n,r){if(r){t=r+":"+t;var o=N[r];o?e.setAttributeNS(o,t,n):e.setAttribute(t,n)}else e.setAttribute(t,n)},e.prototype.removeAttribute=function(e,t,n){if(n){var r=N[n];r?e.removeAttributeNS(r,t):e.removeAttribute(n+":"+t)}else e.removeAttribute(t)},e.prototype.addClass=function(e,t){e.classList.add(t)},e.prototype.removeClass=function(e,t){e.classList.remove(t)},e.prototype.setStyle=function(e,t,r,o){o&n.RendererStyleFlags2.DashCase?e.style.setProperty(t,r,o&n.RendererStyleFlags2.Important?"important":""):e.style[t]=r},e.prototype.removeStyle=function(e,t,r){r&n.RendererStyleFlags2.DashCase?e.style.removeProperty(t):e.style[t]=""},e.prototype.setProperty=function(e,t,n){e[t]=n},e.prototype.setValue=function(e,t){e.nodeValue=t},e.prototype.listen=function(e,t,n){return"string"==typeof e?this.eventManager.addGlobalEventListener(e,t,H(n)):this.eventManager.addEventListener(e,t,H(n))},e}();"@".charCodeAt(0);var B=function(e){function t(t,n,r,o){var i=e.call(this,t)||this;i.component=r;var a=L(o+"-"+r.id,r.styles,[]);return n.addStyles(a),i.contentAttr=k(o+"-"+r.id),i.hostAttr=j(o+"-"+r.id),i}return o(t,e),t.prototype.applyToHost=function(t){e.prototype.setAttribute.call(this,t,this.hostAttr,"")},t.prototype.createElement=function(t,n){var r=e.prototype.createElement.call(this,t,n);return e.prototype.setAttribute.call(this,r,this.contentAttr,""),r},t}(U),z=function(e){function t(t,r,o,i){var a=e.call(this,t)||this;a.sharedStylesHost=r,a.hostEl=o,a.component=i,a.shadowRoot=i.encapsulation===n.ViewEncapsulation.ShadowDom?o.attachShadow({mode:"open"}):o.createShadowRoot(),a.sharedStylesHost.addHost(a.shadowRoot);for(var s=L(i.id,i.styles,[]),u=0;u<s.length;u++){var c=document.createElement("style");c.textContent=s[u],a.shadowRoot.appendChild(c)}return a}return o(t,e),t.prototype.nodeOrShadowRoot=function(e){return e===this.hostEl?this.shadowRoot:e},t.prototype.destroy=function(){this.sharedStylesHost.removeHost(this.shadowRoot)},t.prototype.appendChild=function(t,n){return e.prototype.appendChild.call(this,this.nodeOrShadowRoot(t),n)},t.prototype.insertBefore=function(t,n,r){return e.prototype.insertBefore.call(this,this.nodeOrShadowRoot(t),n,r)},t.prototype.removeChild=function(t,n){return e.prototype.removeChild.call(this,this.nodeOrShadowRoot(t),n)},t.prototype.parentNode=function(t){return this.nodeOrShadowRoot(e.prototype.parentNode.call(this,this.nodeOrShadowRoot(t)))},t}(U),F=function(e){function r(t){return e.call(this,t)||this}return o(r,e),r.prototype.supports=function(e){return!0},r.prototype.addEventListener=function(e,t,n){var r=this;return e.addEventListener(t,n,!1),function(){return r.removeEventListener(e,t,n)}},r.prototype.removeEventListener=function(e,t,n){return e.removeEventListener(t,n)},a([n.Injectable(),s(0,n.Inject(t.DOCUMENT)),u("design:paramtypes",[Object])],r)}(I),V={pan:!0,panstart:!0,panmove:!0,panend:!0,pancancel:!0,panleft:!0,panright:!0,panup:!0,pandown:!0,pinch:!0,pinchstart:!0,pinchmove:!0,pinchend:!0,pinchcancel:!0,pinchin:!0,pinchout:!0,press:!0,pressup:!0,rotate:!0,rotatestart:!0,rotatemove:!0,rotateend:!0,rotatecancel:!0,swipe:!0,swipeleft:!0,swiperight:!0,swipeup:!0,swipedown:!0,tap:!0},G=new n.InjectionToken("HammerGestureConfig"),Z=new n.InjectionToken("HammerLoader"),K=function(){function e(){this.events=[],this.overrides={}}return e.prototype.buildHammer=function(e){var t=new Hammer(e,this.options);for(var n in t.get("pinch").set({enable:!0}),t.get("rotate").set({enable:!0}),this.overrides)t.get(n).set(this.overrides[n]);return t},a([n.Injectable()],e)}(),q=function(e){function r(t,n,r,o){var i=e.call(this,t)||this;return i._config=n,i.console=r,i.loader=o,i}return o(r,e),r.prototype.supports=function(e){return!(!V.hasOwnProperty(e.toLowerCase())&&!this.isCustomEvent(e)||!window.Hammer&&!this.loader&&(this.console.warn('The "'+e+'" event cannot be bound because Hammer.JS is not loaded and no custom loader has been specified.'),1))},r.prototype.addEventListener=function(e,t,n){var r=this,o=this.manager.getZone();if(t=t.toLowerCase(),!window.Hammer&&this.loader){var i=!1,a=function(){i=!0};return this.loader().then((function(){if(!window.Hammer)return r.console.warn("The custom HAMMER_LOADER completed, but Hammer.JS is not present."),void(a=function(){});i||(a=r.addEventListener(e,t,n))})).catch((function(){r.console.warn('The "'+t+'" event cannot be bound because the custom Hammer.JS loader failed.'),a=function(){}})),function(){a()}}return o.runOutsideAngular((function(){var i=r._config.buildHammer(e),a=function(e){o.runGuarded((function(){n(e)}))};return i.on(t,a),function(){i.off(t,a),"function"==typeof i.destroy&&i.destroy()}}))},r.prototype.isCustomEvent=function(e){return this._config.events.indexOf(e)>-1},a([n.Injectable(),s(0,n.Inject(t.DOCUMENT)),s(1,n.Inject(G)),s(3,n.Optional()),s(3,n.Inject(Z)),u("design:paramtypes",[Object,K,n.ɵConsole,Object])],r)}(I),J=[{provide:O,useClass:q,multi:!0,deps:[t.DOCUMENT,G,n.ɵConsole,[new n.Optional,Z]]},{provide:G,useClass:K,deps:[]}],W=J,X=a([n.NgModule({providers:J})],(function X(){})),Y=["alt","control","meta","shift"],Q={"\b":"Backspace","\t":"Tab","":"Delete","":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},$={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","":"NumLock"},ee={alt:function(e){return e.altKey},control:function(e){return e.ctrlKey},meta:function(e){return e.metaKey},shift:function(e){return e.shiftKey}},te=function(e){function r(t){return e.call(this,t)||this}var i;return o(r,e),i=r,r.prototype.supports=function(e){return null!=i.parseEventName(e)},r.prototype.addEventListener=function(e,n,r){var o=i.parseEventName(n),a=i.eventCallback(o.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular((function(){return t.ɵgetDOM().onAndCancel(e,o.domEventName,a)}))},r.parseEventName=function(e){var t=e.toLowerCase().split("."),n=t.shift();if(0===t.length||"keydown"!==n&&"keyup"!==n)return null;var r=i._normalizeKey(t.pop()),o="";if(Y.forEach((function(e){var n=t.indexOf(e);n>-1&&(t.splice(n,1),o+=e+".")})),o+=r,0!=t.length||0===r.length)return null;var a={};return a.domEventName=n,a.fullKey=o,a},r.getEventFullKey=function(e){var t="",n=function r(e){var t=e.key;if(null==t){if(null==(t=e.keyIdentifier))return"Unidentified";t.startsWith("U+")&&(t=String.fromCharCode(parseInt(t.substring(2),16)),3===e.location&&$.hasOwnProperty(t)&&(t=$[t]))}return Q[t]||t}(e);return" "===(n=n.toLowerCase())?n="space":"."===n&&(n="dot"),Y.forEach((function(r){r!=n&&(0,ee[r])(e)&&(t+=r+".")})),t+=n},r.eventCallback=function(e,t,n){return function(r){i.getEventFullKey(r)===e&&n.runGuarded((function(){return t(r)}))}},r._normalizeKey=function(e){switch(e){case"esc":return"escape";default:return e}},i=a([n.Injectable(),s(0,n.Inject(t.DOCUMENT)),u("design:paramtypes",[Object])],r)}(I),ne=function(){function e(){}return e.ɵprov=n.ɵɵdefineInjectable({factory:function e(){return n.ɵɵinject(oe)},token:e,providedIn:"root"}),a([n.Injectable({providedIn:"root",useExisting:n.forwardRef((function(){return oe}))})],e)}();function re(e){return new oe(e.get(t.DOCUMENT))}var oe=function(e){function r(t){var n=e.call(this)||this;return n._doc=t,n}return o(r,e),r.prototype.sanitize=function(e,t){if(null==t)return null;switch(e){case n.SecurityContext.NONE:return t;case n.SecurityContext.HTML:return n.ɵallowSanitizationBypassAndThrow(t,"HTML")?n.ɵunwrapSafeValue(t):n.ɵ_sanitizeHtml(this._doc,String(t));case n.SecurityContext.STYLE:return n.ɵallowSanitizationBypassAndThrow(t,"Style")?n.ɵunwrapSafeValue(t):n.ɵ_sanitizeStyle(t);case n.SecurityContext.SCRIPT:if(n.ɵallowSanitizationBypassAndThrow(t,"Script"))return n.ɵunwrapSafeValue(t);throw new Error("unsafe value used in a script context");case n.SecurityContext.URL:return n.ɵgetSanitizationBypassType(t),n.ɵallowSanitizationBypassAndThrow(t,"URL")?n.ɵunwrapSafeValue(t):n.ɵ_sanitizeUrl(String(t));case n.SecurityContext.RESOURCE_URL:if(n.ɵallowSanitizationBypassAndThrow(t,"ResourceURL"))return n.ɵunwrapSafeValue(t);throw new Error("unsafe value used in a resource URL context (see http://g.co/ng/security#xss)");default:throw new Error("Unexpected SecurityContext "+e+" (see http://g.co/ng/security#xss)")}},r.prototype.bypassSecurityTrustHtml=function(e){return n.ɵbypassSanitizationTrustHtml(e)},r.prototype.bypassSecurityTrustStyle=function(e){return n.ɵbypassSanitizationTrustStyle(e)},r.prototype.bypassSecurityTrustScript=function(e){return n.ɵbypassSanitizationTrustScript(e)},r.prototype.bypassSecurityTrustUrl=function(e){return n.ɵbypassSanitizationTrustUrl(e)},r.prototype.bypassSecurityTrustResourceUrl=function(e){return n.ɵbypassSanitizationTrustResourceUrl(e)},r.ɵprov=n.ɵɵdefineInjectable({factory:function e(){return re(n.ɵɵinject(n.INJECTOR))},token:r,providedIn:"root"}),a([n.Injectable({providedIn:"root",useFactory:re,deps:[n.Injector]}),s(0,n.Inject(t.DOCUMENT)),u("design:paramtypes",[Object])],r)}(ne); /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */function ie(){p.makeCurrent(),m.init()}function ae(){return new n.ErrorHandler}function se(){return n.ɵsetDocument(document),document}var ue=[{provide:n.PLATFORM_ID,useValue:t.ɵPLATFORM_BROWSER_ID},{provide:n.PLATFORM_INITIALIZER,useValue:ie,multi:!0},{provide:t.DOCUMENT,useFactory:se,deps:[]}],ce=[{provide:n.Sanitizer,useExisting:ne},{provide:ne,useClass:oe,deps:[t.DOCUMENT]}],le=n.createPlatformFactory(n.platformCore,"browser",ue),pe=[ce,{provide:n.ɵINJECTOR_SCOPE,useValue:"root"},{provide:n.ErrorHandler,useFactory:ae,deps:[]},{provide:O,useClass:F,multi:!0,deps:[t.DOCUMENT,n.NgZone,n.PLATFORM_ID]},{provide:O,useClass:te,multi:!0,deps:[t.DOCUMENT]},W,{provide:x,useClass:x,deps:[C,R,n.APP_ID]},{provide:n.RendererFactory2,useExisting:x},{provide:A,useExisting:R},{provide:R,useClass:R,deps:[t.DOCUMENT]},{provide:n.Testability,useClass:n.Testability,deps:[n.NgZone]},{provide:C,useClass:C,deps:[O,n.NgZone]},T],fe=function(){function e(e){if(e)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}var r;return r=e,e.withServerTransition=function(e){return{ngModule:r,providers:[{provide:n.APP_ID,useValue:e.appId},{provide:d,useExisting:n.APP_ID},h]}},r=a([n.NgModule({providers:pe,exports:[t.CommonModule,n.ApplicationModule]}),s(0,n.Optional()),s(0,n.SkipSelf()),s(0,n.Inject(r)),u("design:paramtypes",[Object])],e)}();function de(){return new ye(n.ɵɵinject(t.DOCUMENT))}var ye=function(){function e(e){this._doc=e,this._dom=t.ɵgetDOM()}return e.prototype.addTag=function(e,t){return void 0===t&&(t=!1),e?this._getOrCreateElement(e,t):null},e.prototype.addTags=function(e,t){var n=this;return void 0===t&&(t=!1),e?e.reduce((function(e,r){return r&&e.push(n._getOrCreateElement(r,t)),e}),[]):[]},e.prototype.getTag=function(e){return e&&this._doc.querySelector("meta["+e+"]")||null},e.prototype.getTags=function(e){if(!e)return[];var t=this._doc.querySelectorAll("meta["+e+"]");return t?[].slice.call(t):[]},e.prototype.updateTag=function(e,t){if(!e)return null;t=t||this._parseSelector(e);var n=this.getTag(t);return n?this._setMetaElementAttributes(e,n):this._getOrCreateElement(e,!0)},e.prototype.removeTag=function(e){this.removeTagElement(this.getTag(e))},e.prototype.removeTagElement=function(e){e&&this._dom.remove(e)},e.prototype._getOrCreateElement=function(e,t){if(void 0===t&&(t=!1),!t){var n=this._parseSelector(e),r=this.getTag(n);if(r&&this._containsAttributes(e,r))return r}var o=this._dom.createElement("meta");return this._setMetaElementAttributes(e,o),this._doc.getElementsByTagName("head")[0].appendChild(o),o},e.prototype._setMetaElementAttributes=function(e,t){return Object.keys(e).forEach((function(n){return t.setAttribute(n,e[n])})),t},e.prototype._parseSelector=function(e){var t=e.name?"name":"property";return t+'="'+e[t]+'"'},e.prototype._containsAttributes=function(e,t){return Object.keys(e).every((function(n){return t.getAttribute(n)===e[n]}))},e.ɵprov=n.ɵɵdefineInjectable({factory:de,token:e,providedIn:"root"}),a([n.Injectable({providedIn:"root",useFactory:de,deps:[]}),s(0,n.Inject(t.DOCUMENT)),u("design:paramtypes",[Object])],e)}();function he(){return new me(n.ɵɵinject(t.DOCUMENT))}var me=function(){function e(e){this._doc=e}return e.prototype.getTitle=function(){return this._doc.title},e.prototype.setTitle=function(e){this._doc.title=e||""},e.ɵprov=n.ɵɵdefineInjectable({factory:he,token:e,providedIn:"root"}),a([n.Injectable({providedIn:"root",useFactory:he,deps:[]}),s(0,n.Inject(t.DOCUMENT)),u("design:paramtypes",[Object])],e)}(),ge="undefined"!=typeof window&&window||{},we=function we(e,t){this.msPerTick=e,this.numTicks=t},ve=function(){function e(e){this.appRef=e.injector.get(n.ApplicationRef)}return e.prototype.timeChangeDetection=function(e){var n=e&&e.record,r=null!=ge.console.profile;n&&r&&ge.console.profile("Change Detection");for(var o=t.ɵgetDOM().performanceNow(),i=0;i<5||t.ɵgetDOM().performanceNow()-o<500;)this.appRef.tick(),i++;var a=t.ɵgetDOM().performanceNow();n&&r&&ge.console.profileEnd("Change Detection");var s=(a-o)/i;return ge.console.log("ran "+i+" change detection cycles"),ge.console.log(s.toFixed(2)+" ms per check"),new we(s,i)},e}(),_e=function(){function e(){this.store={},this.onSerializeCallbacks={}}var t;return t=e,e.init=function(e){var n=new t;return n.store=e,n},e.prototype.get=function(e,t){return void 0!==this.store[e]?this.store[e]:t},e.prototype.set=function(e,t){this.store[e]=t},e.prototype.remove=function(e){delete this.store[e]},e.prototype.hasKey=function(e){return this.store.hasOwnProperty(e)},e.prototype.onSerialize=function(e,t){this.onSerializeCallbacks[e]=t},e.prototype.toJson=function(){for(var e in this.onSerializeCallbacks)if(this.onSerializeCallbacks.hasOwnProperty(e))try{this.store[e]=this.onSerializeCallbacks[e]()}catch(e){console.warn("Exception in onSerialize callback: ",e)}return JSON.stringify(this.store)},t=a([n.Injectable()],e)}(); /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */function be(e,t){var n=e.getElementById(t+"-state"),r={};if(n&&n.textContent)try{r=JSON.parse(function o(e){var t={"&a;":"&","&q;":'"',"&s;":"'","&l;":"<","&g;":">"};return e.replace(/&[^;]+;/g,(function(e){return t[e]}))}(n.textContent))}catch(e){console.warn("Exception while restoring TransferState for app "+t,e)}return _e.init(r)}var Ee=a([n.NgModule({providers:[{provide:_e,useFactory:be,deps:[t.DOCUMENT,n.APP_ID]}]})],(function Ee(){})),Se=function(){function e(){}return e.all=function(){return function(){return!0}},e.css=function(e){return function(n){return null!=n.nativeElement&&function r(e,n){return!!t.ɵgetDOM().isElementNode(e)&&(e.matches&&e.matches(n)||e.msMatchesSelector&&e.msMatchesSelector(n)||e.webkitMatchesSelector&&e.webkitMatchesSelector(n))} /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */(n.nativeElement,e)}},e.directive=function(e){return function(t){return-1!==t.providerTokens.indexOf(e)}},e}(),Te=new n.Version("9.0.6"); /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ Object.defineProperty(e,"ɵgetDOM",{enumerable:!0,get:function(){return t.ɵgetDOM}}),e.BrowserModule=fe,e.BrowserTransferStateModule=Ee,e.By=Se,e.DomSanitizer=ne,e.EVENT_MANAGER_PLUGINS=O,e.EventManager=C,e.HAMMER_GESTURE_CONFIG=G,e.HAMMER_LOADER=Z,e.HammerGestureConfig=K,e.HammerModule=X,e.Meta=ye,e.Title=me,e.TransferState=_e,e.VERSION=Te,e.disableDebugTools=function Oe(){g("profiler",null)} /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */,e.enableDebugTools=function Ce(e){return g("profiler",new ve(e)),e},e.makeStateKey=function Ie(e){return e},e.platformBrowser=le,e.ɵBROWSER_SANITIZATION_PROVIDERS=ce,e.ɵBROWSER_SANITIZATION_PROVIDERS__POST_R3__=[],e.ɵBrowserDomAdapter=p,e.ɵBrowserGetTestability=m,e.ɵDomEventsPlugin=F,e.ɵDomRendererFactory2=x,e.ɵDomSanitizerImpl=oe,e.ɵDomSharedStylesHost=R,e.ɵELEMENT_PROBE_PROVIDERS=T,e.ɵELEMENT_PROBE_PROVIDERS__POST_R3__=[],e.ɵHAMMER_PROVIDERS__POST_R3__=[],e.ɵHammerGesturesPlugin=q,e.ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS=ue,e.ɵKeyEventsPlugin=te,e.ɵNAMESPACE_URIS=N,e.ɵSharedStylesHost=A,e.ɵTRANSITION_ID=d,e.ɵangular_packages_platform_browser_platform_browser_a=ae,e.ɵangular_packages_platform_browser_platform_browser_b=se,e.ɵangular_packages_platform_browser_platform_browser_c=pe,e.ɵangular_packages_platform_browser_platform_browser_d=de,e.ɵangular_packages_platform_browser_platform_browser_e=he,e.ɵangular_packages_platform_browser_platform_browser_f=be,e.ɵangular_packages_platform_browser_platform_browser_g=I,e.ɵangular_packages_platform_browser_platform_browser_h=J,e.ɵangular_packages_platform_browser_platform_browser_i=W,e.ɵangular_packages_platform_browser_platform_browser_j=re,e.ɵangular_packages_platform_browser_platform_browser_k=y,e.ɵangular_packages_platform_browser_platform_browser_l=h,e.ɵangular_packages_platform_browser_platform_browser_m=E,e.ɵangular_packages_platform_browser_platform_browser_n=S,e.ɵangular_packages_platform_browser_platform_browser_o=l,e.ɵescapeHtml=function Ae(e){var t={"&":"&a;",'"':"&q;","'":"&s;","<":"&l;",">":"&g;"};return e.replace(/[&"'<>]/g,(function(e){return t[e]}))},e.ɵflattenStyles=L,e.ɵinitDomAdapter=ie,e.ɵshimContentAttribute=k,e.ɵshimHostAttribute=j,Object.defineProperty(e,"__esModule",{value:!0})}));
261.25
14,036
0.736427
6a520cb6822e50168b77076614892ebc8cfba152
1,933
js
JavaScript
controller/blog.js
Chenyuanyuan299/blog-test-koa2
d9f942b0a759ae54a7fb25728f7cd465431be5c6
[ "MIT" ]
null
null
null
controller/blog.js
Chenyuanyuan299/blog-test-koa2
d9f942b0a759ae54a7fb25728f7cd465431be5c6
[ "MIT" ]
null
null
null
controller/blog.js
Chenyuanyuan299/blog-test-koa2
d9f942b0a759ae54a7fb25728f7cd465431be5c6
[ "MIT" ]
null
null
null
// controller 用来管理数据,理解为数据控制层 // controller 拿到对应路由的数据,与数据库建立连接交互,获取数据并返回给路由 const { exec, escape } = require('../db/mysql.js') const xss = require('xss') const getList = async (author, keyword) => { // 当 author 和 keyword 不存在,1=1 起到占位作用 let sql = `select * from blogs where 1=1 ` if (author) { author = escape(author) sql += `and author=${author} ` } if (keyword) { sql += `and title like '%${keyword}%' ` } sql += `order by createtime desc;` return await exec(sql) } const getDetail = async (id) => { id = escape(id) const sql = `select * from blogs where id=${id}` const rows = await exec(sql) return rows[0] } const newBlog = async (blogData = {}) => { // blogData 是一个博客对象,包含 title content author 属性 const title = xss(blogData.title) const content = escape(blogData.content) const author = escape(blogData.author) const createTime = Date.now() const sql = ` insert into blogs (title, content, createtime, author) values ('${title}', ${content}, ${createTime}, ${author}) ` const insertData = await exec(sql) return insertData.insertId } const updateBlog = async (id, blogData = {}) => { // id 就是更新博客的 id // blogData 是一个博客对象,包含 title content 属性 // console.log('updata blog...', id, blogData) const title = xss(blogData.title) const content = escape(blogData.content) id = escape(id) const sql = ` update blogs set title='${title}', content=${content} where id=${id} ` const updateData = await exec(sql) if (updateData.affectedRows > 0) { return true } return false } const deleteBlog = async (id, author) => { author = escape(author) id = escape(id) const sql = ` delete from blogs where id=${id} and author=${author} ` const deleteData = await exec(sql) if (deleteData.affectedRows > 0) { return true } return false } module.exports = { getList, getDetail, newBlog, updateBlog, deleteBlog }
23.573171
72
0.646146
6a5282124af317e15123c94a2d09958a98bf9700
1,294
js
JavaScript
public/pkg/lib.js
weiai525/cmf
4d7d86f163518459923055ac11a323ae96e80e93
[ "MIT" ]
null
null
null
public/pkg/lib.js
weiai525/cmf
4d7d86f163518459923055ac11a323ae96e80e93
[ "MIT" ]
null
null
null
public/pkg/lib.js
weiai525/cmf
4d7d86f163518459923055ac11a323ae96e80e93
[ "MIT" ]
null
null
null
;/*!static/libs/alert.js*/ define("static/libs/alert",function(require,exports,module){require("components/bootstrap/bootstrap");{var modalTplFn=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+='<div class="modal fade">\n <div class="modal-table">\n <div class="modal-table-cell">\n <div class="modal-dialog modal-'+(null==(__t=errorLevel)?"":__t)+'">\n <div class="modal-content">\n <div class="modal-header">\n <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>\n <h4 class="modal-title">'+(null==(__t=title)?"":__t)+'</h4>\n </div>\n\n <div class="modal-body">\n <p>'+(null==(__t=content)?"":__t)+'</p>\n </div>\n <div class="modal-footer">\n <button type="button" class="btn btn-primary" data-dismiss="modal">确定</button>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n';return __p},$=require("components/jquery/jquery");module.exports=function(n,t,o){var a=$(modalTplFn({title:o||"提示信息",content:n,errorLevel:t||"info"}));a.appendTo("body").modal({backdrop:"static"}).on("hide.bs.modal",function(){a.remove()})}}});
647
1,267
0.588872
6a5355453fcae3976f15961571addd2f17ebe40c
372,868
js
JavaScript
lib/services/webSiteManagement2/lib/operations/appServicePlans.js
blueww/azure-sdk-for-node
ddd13c1e5f56975c593e58b168a57447677701aa
[ "Apache-2.0", "MIT" ]
null
null
null
lib/services/webSiteManagement2/lib/operations/appServicePlans.js
blueww/azure-sdk-for-node
ddd13c1e5f56975c593e58b168a57447677701aa
[ "Apache-2.0", "MIT" ]
null
null
null
lib/services/webSiteManagement2/lib/operations/appServicePlans.js
blueww/azure-sdk-for-node
ddd13c1e5f56975c593e58b168a57447677701aa
[ "Apache-2.0", "MIT" ]
null
null
null
/* * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is * regenerated. */ 'use strict'; const msRest = require('ms-rest'); const msRestAzure = require('ms-rest-azure'); const WebResource = msRest.WebResource; /** * @summary Get all App Service plans for a subcription. * * Get all App Service plans for a subcription. * * @param {object} [options] Optional Parameters. * * @param {boolean} [options.detailed] Specify <code>true</code> to return all * App Service plan properties. The default is <code>false</code>, which * returns a subset of the properties. * Retrieval of all properties may increase the API latency. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} callback - The callback. * * @returns {function} callback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link AppServicePlanCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ function _list(options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } if (!callback) { throw new Error('callback cannot be null.'); } let detailed = (options && options.detailed !== undefined) ? options.detailed : undefined; let apiVersion = '2016-09-01'; // Validate try { if (detailed !== null && detailed !== undefined && typeof detailed !== 'boolean') { throw new Error('detailed must be of type boolean.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/serverfarms'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; if (detailed !== null && detailed !== undefined) { queryParameters.push('detailed=' + encodeURIComponent(detailed.toString())); } queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } if(options) { for(let headerName in options['customHeaders']) { if (options['customHeaders'].hasOwnProperty(headerName)) { httpRequest.headers[headerName] = options['customHeaders'][headerName]; } } } httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + `- "${responseBody}" for the default response.`; return callback(error); } return callback(error); } // Create Result let result = null; if (responseBody === '') responseBody = null; // Deserialize Response if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { let resultMapper = new client.models['AppServicePlanCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); deserializationError.request = msRest.stripRequest(httpRequest); deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } } return callback(null, result, httpRequest, response); }); } /** * @summary Get all App Service plans in a resource group. * * Get all App Service plans in a resource group. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} callback - The callback. * * @returns {function} callback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link AppServicePlanCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ function _listByResourceGroup(resourceGroupName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } if (!callback) { throw new Error('callback cannot be null.'); } let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } if (resourceGroupName !== null && resourceGroupName !== undefined) { if (resourceGroupName.length > 90) { throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); } if (resourceGroupName.length < 1) { throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); } if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) { throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); } } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } if(options) { for(let headerName in options['customHeaders']) { if (options['customHeaders'].hasOwnProperty(headerName)) { httpRequest.headers[headerName] = options['customHeaders'][headerName]; } } } httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + `- "${responseBody}" for the default response.`; return callback(error); } return callback(error); } // Create Result let result = null; if (responseBody === '') responseBody = null; // Deserialize Response if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { let resultMapper = new client.models['AppServicePlanCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); deserializationError.request = msRest.stripRequest(httpRequest); deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } } return callback(null, result, httpRequest, response); }); } /** * @summary Get an App Service plan. * * Get an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} callback - The callback. * * @returns {function} callback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link AppServicePlan} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ function _get(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } if (!callback) { throw new Error('callback cannot be null.'); } let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } if (resourceGroupName !== null && resourceGroupName !== undefined) { if (resourceGroupName.length > 90) { throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); } if (resourceGroupName.length < 1) { throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); } if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) { throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); } } if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } if(options) { for(let headerName in options['customHeaders']) { if (options['customHeaders'].hasOwnProperty(headerName)) { httpRequest.headers[headerName] = options['customHeaders'][headerName]; } } } httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + `- "${responseBody}" for the default response.`; return callback(error); } return callback(error); } // Create Result let result = null; if (responseBody === '') responseBody = null; // Deserialize Response if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { let resultMapper = new client.models['AppServicePlan']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); deserializationError.request = msRest.stripRequest(httpRequest); deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } } return callback(null, result, httpRequest, response); }); } /** * @summary Creates or updates an App Service Plan. * * Creates or updates an App Service Plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {object} appServicePlan Details of the App Service plan. * * @param {string} [appServicePlan.appServicePlanName] Name for the App Service * plan. * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * * @param {string} [appServicePlan.adminSiteName] App Service plan * administration site. * * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for * the App Service Environment to use for the App Service plan. * * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of * the App Service Environment. * * @param {boolean} [appServicePlan.perSiteScaling] If <code>true</code>, apps * assigned to this App Service plan can be scaled independently. * If <code>false</code>, apps assigned to this App Service plan will scale to * all instances of the plan. * * @param {boolean} [appServicePlan.reserved] Reserved. * * @param {number} [appServicePlan.targetWorkerCount] Scaling worker count. * * @param {number} [appServicePlan.targetWorkerSizeId] Scaling worker size ID. * * @param {object} [appServicePlan.sku] * * @param {string} [appServicePlan.sku.name] Name of the resource SKU. * * @param {string} [appServicePlan.sku.tier] Service tier of the resource SKU. * * @param {string} [appServicePlan.sku.size] Size specifier of the resource * SKU. * * @param {string} [appServicePlan.sku.family] Family code of the resource SKU. * * @param {number} [appServicePlan.sku.capacity] Current number of instances * assigned to the resource. * * @param {object} [appServicePlan.sku.skuCapacity] Min, max, and default scale * values of the SKU. * * @param {number} [appServicePlan.sku.skuCapacity.minimum] Minimum number of * workers for this App Service plan SKU. * * @param {number} [appServicePlan.sku.skuCapacity.maximum] Maximum number of * workers for this App Service plan SKU. * * @param {number} [appServicePlan.sku.skuCapacity.default] Default number of * workers for this App Service plan SKU. * * @param {string} [appServicePlan.sku.skuCapacity.scaleType] Available scale * configurations for an App Service plan. * * @param {array} [appServicePlan.sku.locations] Locations of the SKU. * * @param {array} [appServicePlan.sku.capabilities] Capabilities of the SKU, * e.g., is traffic manager enabled? * * @param {string} [appServicePlan.kind] Kind of resource. * * @param {string} appServicePlan.location Resource Location. * * @param {object} [appServicePlan.tags] Resource tags. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} callback - The callback. * * @returns {function} callback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link AppServicePlan} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ function _createOrUpdate(resourceGroupName, name, appServicePlan, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } if (!callback) { throw new Error('callback cannot be null.'); } // Send request this.beginCreateOrUpdate(resourceGroupName, name, appServicePlan, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); let initialResult = new msRest.HttpOperationResponse(); initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { if (err) return callback(err); // Create Result let result = null; httpRequest = pollingResult.request; response = pollingResult.response; let responseBody = pollingResult.body; if (responseBody === '') responseBody = null; // Deserialize Response let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { let resultMapper = new client.models['AppServicePlan']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); deserializationError.request = msRest.stripRequest(httpRequest); deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } return callback(null, result, httpRequest, response); }); }); } /** * @summary Delete an App Service plan. * * Delete an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} callback - The callback. * * @returns {function} callback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ function _deleteMethod(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } if (!callback) { throw new Error('callback cannot be null.'); } let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } if (resourceGroupName !== null && resourceGroupName !== undefined) { if (resourceGroupName.length > 90) { throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); } if (resourceGroupName.length < 1) { throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); } if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) { throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); } } if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } if(options) { for(let headerName in options['customHeaders']) { if (options['customHeaders'].hasOwnProperty(headerName)) { httpRequest.headers[headerName] = options['customHeaders'][headerName]; } } } httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + `- "${responseBody}" for the default response.`; return callback(error); } return callback(error); } // Create Result let result = null; if (responseBody === '') responseBody = null; return callback(null, result, httpRequest, response); }); } /** * @summary List all capabilities of an App Service plan. * * List all capabilities of an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} callback - The callback. * * @returns {function} callback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ function _listCapabilities(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } if (!callback) { throw new Error('callback cannot be null.'); } let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } if (resourceGroupName !== null && resourceGroupName !== undefined) { if (resourceGroupName.length > 90) { throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); } if (resourceGroupName.length < 1) { throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); } if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) { throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); } } if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/capabilities'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } if(options) { for(let headerName in options['customHeaders']) { if (options['customHeaders'].hasOwnProperty(headerName)) { httpRequest.headers[headerName] = options['customHeaders'][headerName]; } } } httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + `- "${responseBody}" for the default response.`; return callback(error); } return callback(error); } // Create Result let result = null; if (responseBody === '') responseBody = null; // Deserialize Response if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { let resultMapper = { required: false, serializedName: 'parsedResponse', type: { name: 'Sequence', element: { required: false, serializedName: 'CapabilityElementType', type: { name: 'Composite', className: 'Capability' } } } }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); deserializationError.request = msRest.stripRequest(httpRequest); deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } } return callback(null, result, httpRequest, response); }); } /** * @summary Retrieve a Hybrid Connection in use in an App Service plan. * * Retrieve a Hybrid Connection in use in an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} namespaceName Name of the Service Bus namespace. * * @param {string} relayName Name of the Service Bus relay. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} callback - The callback. * * @returns {function} callback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link HybridConnection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } if (!callback) { throw new Error('callback cannot be null.'); } let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } if (resourceGroupName !== null && resourceGroupName !== undefined) { if (resourceGroupName.length > 90) { throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); } if (resourceGroupName.length < 1) { throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); } if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) { throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); } } if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } if (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { throw new Error('namespaceName cannot be null or undefined and it must be of type string.'); } if (relayName === null || relayName === undefined || typeof relayName.valueOf() !== 'string') { throw new Error('relayName cannot be null or undefined and it must be of type string.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } if(options) { for(let headerName in options['customHeaders']) { if (options['customHeaders'].hasOwnProperty(headerName)) { httpRequest.headers[headerName] = options['customHeaders'][headerName]; } } } httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + `- "${responseBody}" for the default response.`; return callback(error); } return callback(error); } // Create Result let result = null; if (responseBody === '') responseBody = null; // Deserialize Response if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { let resultMapper = new client.models['HybridConnection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); deserializationError.request = msRest.stripRequest(httpRequest); deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } } return callback(null, result, httpRequest, response); }); } /** * @summary Delete a Hybrid Connection in use in an App Service plan. * * Delete a Hybrid Connection in use in an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} namespaceName Name of the Service Bus namespace. * * @param {string} relayName Name of the Service Bus relay. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} callback - The callback. * * @returns {function} callback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } if (!callback) { throw new Error('callback cannot be null.'); } let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } if (resourceGroupName !== null && resourceGroupName !== undefined) { if (resourceGroupName.length > 90) { throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); } if (resourceGroupName.length < 1) { throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); } if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) { throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); } } if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } if (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { throw new Error('namespaceName cannot be null or undefined and it must be of type string.'); } if (relayName === null || relayName === undefined || typeof relayName.valueOf() !== 'string') { throw new Error('relayName cannot be null or undefined and it must be of type string.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } if(options) { for(let headerName in options['customHeaders']) { if (options['customHeaders'].hasOwnProperty(headerName)) { httpRequest.headers[headerName] = options['customHeaders'][headerName]; } } } httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; if (statusCode !== 200 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + `- "${responseBody}" for the default response.`; return callback(error); } return callback(error); } // Create Result let result = null; if (responseBody === '') responseBody = null; return callback(null, result, httpRequest, response); }); } /** * @summary Get the send key name and value of a Hybrid Connection. * * Get the send key name and value of a Hybrid Connection. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} namespaceName The name of the Service Bus namespace. * * @param {string} relayName The name of the Service Bus relay. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} callback - The callback. * * @returns {function} callback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link HybridConnectionKey} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relayName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } if (!callback) { throw new Error('callback cannot be null.'); } let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } if (resourceGroupName !== null && resourceGroupName !== undefined) { if (resourceGroupName.length > 90) { throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); } if (resourceGroupName.length < 1) { throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); } if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) { throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); } } if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } if (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { throw new Error('namespaceName cannot be null or undefined and it must be of type string.'); } if (relayName === null || relayName === undefined || typeof relayName.valueOf() !== 'string') { throw new Error('relayName cannot be null or undefined and it must be of type string.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/listKeys'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } if(options) { for(let headerName in options['customHeaders']) { if (options['customHeaders'].hasOwnProperty(headerName)) { httpRequest.headers[headerName] = options['customHeaders'][headerName]; } } } httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + `- "${responseBody}" for the default response.`; return callback(error); } return callback(error); } // Create Result let result = null; if (responseBody === '') responseBody = null; // Deserialize Response if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { let resultMapper = new client.models['HybridConnectionKey']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); deserializationError.request = msRest.stripRequest(httpRequest); deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } } return callback(null, result, httpRequest, response); }); } /** * @summary Get all apps that use a Hybrid Connection in an App Service Plan. * * Get all apps that use a Hybrid Connection in an App Service Plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} namespaceName Name of the Hybrid Connection namespace. * * @param {string} relayName Name of the Hybrid Connection relay. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} callback - The callback. * * @returns {function} callback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link ResourceCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ function _listWebAppsByHybridConnection(resourceGroupName, name, namespaceName, relayName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } if (!callback) { throw new Error('callback cannot be null.'); } let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } if (resourceGroupName !== null && resourceGroupName !== undefined) { if (resourceGroupName.length > 90) { throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); } if (resourceGroupName.length < 1) { throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); } if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) { throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); } } if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } if (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { throw new Error('namespaceName cannot be null or undefined and it must be of type string.'); } if (relayName === null || relayName === undefined || typeof relayName.valueOf() !== 'string') { throw new Error('relayName cannot be null or undefined and it must be of type string.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/sites'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } if(options) { for(let headerName in options['customHeaders']) { if (options['customHeaders'].hasOwnProperty(headerName)) { httpRequest.headers[headerName] = options['customHeaders'][headerName]; } } } httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + `- "${responseBody}" for the default response.`; return callback(error); } return callback(error); } // Create Result let result = null; if (responseBody === '') responseBody = null; // Deserialize Response if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { let resultMapper = new client.models['ResourceCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); deserializationError.request = msRest.stripRequest(httpRequest); deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } } return callback(null, result, httpRequest, response); }); } /** * @summary Get the maximum number of Hybrid Connections allowed in an App * Service plan. * * Get the maximum number of Hybrid Connections allowed in an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} callback - The callback. * * @returns {function} callback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link HybridConnectionLimits} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ function _getHybridConnectionPlanLimit(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } if (!callback) { throw new Error('callback cannot be null.'); } let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } if (resourceGroupName !== null && resourceGroupName !== undefined) { if (resourceGroupName.length > 90) { throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); } if (resourceGroupName.length < 1) { throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); } if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) { throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); } } if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionPlanLimits/limit'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } if(options) { for(let headerName in options['customHeaders']) { if (options['customHeaders'].hasOwnProperty(headerName)) { httpRequest.headers[headerName] = options['customHeaders'][headerName]; } } } httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + `- "${responseBody}" for the default response.`; return callback(error); } return callback(error); } // Create Result let result = null; if (responseBody === '') responseBody = null; // Deserialize Response if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { let resultMapper = new client.models['HybridConnectionLimits']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); deserializationError.request = msRest.stripRequest(httpRequest); deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } } return callback(null, result, httpRequest, response); }); } /** * @summary Retrieve all Hybrid Connections in use in an App Service plan. * * Retrieve all Hybrid Connections in use in an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} callback - The callback. * * @returns {function} callback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link HybridConnectionCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ function _listHybridConnections(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } if (!callback) { throw new Error('callback cannot be null.'); } let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } if (resourceGroupName !== null && resourceGroupName !== undefined) { if (resourceGroupName.length > 90) { throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); } if (resourceGroupName.length < 1) { throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); } if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) { throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); } } if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionRelays'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } if(options) { for(let headerName in options['customHeaders']) { if (options['customHeaders'].hasOwnProperty(headerName)) { httpRequest.headers[headerName] = options['customHeaders'][headerName]; } } } httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + `- "${responseBody}" for the default response.`; return callback(error); } return callback(error); } // Create Result let result = null; if (responseBody === '') responseBody = null; // Deserialize Response if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { let resultMapper = new client.models['HybridConnectionCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); deserializationError.request = msRest.stripRequest(httpRequest); deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } } return callback(null, result, httpRequest, response); }); } /** * @summary Get metrics that can be queried for an App Service plan, and their * definitions. * * Get metrics that can be queried for an App Service plan, and their * definitions. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} callback - The callback. * * @returns {function} callback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link ResourceMetricDefinitionCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ function _listMetricDefintions(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } if (!callback) { throw new Error('callback cannot be null.'); } let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } if (resourceGroupName !== null && resourceGroupName !== undefined) { if (resourceGroupName.length > 90) { throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); } if (resourceGroupName.length < 1) { throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); } if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) { throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); } } if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/metricdefinitions'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } if(options) { for(let headerName in options['customHeaders']) { if (options['customHeaders'].hasOwnProperty(headerName)) { httpRequest.headers[headerName] = options['customHeaders'][headerName]; } } } httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + `- "${responseBody}" for the default response.`; return callback(error); } return callback(error); } // Create Result let result = null; if (responseBody === '') responseBody = null; // Deserialize Response if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { let resultMapper = new client.models['ResourceMetricDefinitionCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); deserializationError.request = msRest.stripRequest(httpRequest); deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } } return callback(null, result, httpRequest, response); }); } /** * @summary Get metrics for an App Serice plan. * * Get metrics for an App Serice plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {object} [options] Optional Parameters. * * @param {boolean} [options.details] Specify <code>true</code> to include * instance details. The default is <code>false</code>. * * @param {string} [options.filter] Return only usages/metrics specified in the * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq * 'Metric1' or name.value eq 'Metric2') and startTime eq * '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain * eq duration'[Hour|Minute|Day]'. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} callback - The callback. * * @returns {function} callback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link ResourceMetricCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ function _listMetrics(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } if (!callback) { throw new Error('callback cannot be null.'); } let details = (options && options.details !== undefined) ? options.details : undefined; let filter = (options && options.filter !== undefined) ? options.filter : undefined; let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } if (resourceGroupName !== null && resourceGroupName !== undefined) { if (resourceGroupName.length > 90) { throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); } if (resourceGroupName.length < 1) { throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); } if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) { throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); } } if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } if (details !== null && details !== undefined && typeof details !== 'boolean') { throw new Error('details must be of type boolean.'); } if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { throw new Error('filter must be of type string.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/metrics'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; if (details !== null && details !== undefined) { queryParameters.push('details=' + encodeURIComponent(details.toString())); } if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + filter); } queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } if(options) { for(let headerName in options['customHeaders']) { if (options['customHeaders'].hasOwnProperty(headerName)) { httpRequest.headers[headerName] = options['customHeaders'][headerName]; } } } httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + `- "${responseBody}" for the default response.`; return callback(error); } return callback(error); } // Create Result let result = null; if (responseBody === '') responseBody = null; // Deserialize Response if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { let resultMapper = new client.models['ResourceMetricCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); deserializationError.request = msRest.stripRequest(httpRequest); deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } } return callback(null, result, httpRequest, response); }); } /** * @summary Restart all apps in an App Service plan. * * Restart all apps in an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {object} [options] Optional Parameters. * * @param {boolean} [options.softRestart] Specify <code>true</code> to performa * a soft restart, applies the configuration settings and restarts the apps if * necessary. The default is <code>false</code>, which always restarts and * reprovisions the apps * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} callback - The callback. * * @returns {function} callback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ function _restartWebApps(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } if (!callback) { throw new Error('callback cannot be null.'); } let softRestart = (options && options.softRestart !== undefined) ? options.softRestart : undefined; let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } if (resourceGroupName !== null && resourceGroupName !== undefined) { if (resourceGroupName.length > 90) { throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); } if (resourceGroupName.length < 1) { throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); } if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) { throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); } } if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } if (softRestart !== null && softRestart !== undefined && typeof softRestart !== 'boolean') { throw new Error('softRestart must be of type boolean.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/restartSites'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; if (softRestart !== null && softRestart !== undefined) { queryParameters.push('softRestart=' + encodeURIComponent(softRestart.toString())); } queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } if(options) { for(let headerName in options['customHeaders']) { if (options['customHeaders'].hasOwnProperty(headerName)) { httpRequest.headers[headerName] = options['customHeaders'][headerName]; } } } httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; if (statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + `- "${responseBody}" for the default response.`; return callback(error); } return callback(error); } // Create Result let result = null; if (responseBody === '') responseBody = null; return callback(null, result, httpRequest, response); }); } /** * @summary Get all apps associated with an App Service plan. * * Get all apps associated with an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {object} [options] Optional Parameters. * * @param {string} [options.skipToken] Skip to a web app in the list of webapps * associated with app service plan. If specified, the resulting list will * contain web apps starting from (including) the skipToken. Otherwise, the * resulting list contains web apps from the start of the list * * @param {string} [options.filter] Supported filter: $filter=state eq running. * Returns only web apps that are currently running * * @param {string} [options.top] List page size. If specified, results are * paged. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} callback - The callback. * * @returns {function} callback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link WebAppCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ function _listWebApps(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } if (!callback) { throw new Error('callback cannot be null.'); } let skipToken = (options && options.skipToken !== undefined) ? options.skipToken : undefined; let filter = (options && options.filter !== undefined) ? options.filter : undefined; let top = (options && options.top !== undefined) ? options.top : undefined; let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } if (resourceGroupName !== null && resourceGroupName !== undefined) { if (resourceGroupName.length > 90) { throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); } if (resourceGroupName.length < 1) { throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); } if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) { throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); } } if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } if (skipToken !== null && skipToken !== undefined && typeof skipToken.valueOf() !== 'string') { throw new Error('skipToken must be of type string.'); } if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { throw new Error('filter must be of type string.'); } if (top !== null && top !== undefined && typeof top.valueOf() !== 'string') { throw new Error('top must be of type string.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/sites'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; if (skipToken !== null && skipToken !== undefined) { queryParameters.push('$skipToken=' + encodeURIComponent(skipToken)); } if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + filter); } if (top !== null && top !== undefined) { queryParameters.push('$top=' + encodeURIComponent(top)); } queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } if(options) { for(let headerName in options['customHeaders']) { if (options['customHeaders'].hasOwnProperty(headerName)) { httpRequest.headers[headerName] = options['customHeaders'][headerName]; } } } httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + `- "${responseBody}" for the default response.`; return callback(error); } return callback(error); } // Create Result let result = null; if (responseBody === '') responseBody = null; // Deserialize Response if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { let resultMapper = new client.models['WebAppCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); deserializationError.request = msRest.stripRequest(httpRequest); deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } } return callback(null, result, httpRequest, response); }); } /** * @summary Get all Virtual Networks associated with an App Service plan. * * Get all Virtual Networks associated with an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} callback - The callback. * * @returns {function} callback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ function _listVnets(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } if (!callback) { throw new Error('callback cannot be null.'); } let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } if (resourceGroupName !== null && resourceGroupName !== undefined) { if (resourceGroupName.length > 90) { throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); } if (resourceGroupName.length < 1) { throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); } if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) { throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); } } if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } if(options) { for(let headerName in options['customHeaders']) { if (options['customHeaders'].hasOwnProperty(headerName)) { httpRequest.headers[headerName] = options['customHeaders'][headerName]; } } } httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + `- "${responseBody}" for the default response.`; return callback(error); } return callback(error); } // Create Result let result = null; if (responseBody === '') responseBody = null; // Deserialize Response if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { let resultMapper = { required: false, serializedName: 'parsedResponse', type: { name: 'Sequence', element: { required: false, serializedName: 'VnetInfoElementType', type: { name: 'Composite', className: 'VnetInfo' } } } }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); deserializationError.request = msRest.stripRequest(httpRequest); deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } } return callback(null, result, httpRequest, response); }); } /** * @summary Get a Virtual Network associated with an App Service plan. * * Get a Virtual Network associated with an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} vnetName Name of the Virtual Network. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} callback - The callback. * * @returns {function} callback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link VnetInfo} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ function _getVnetFromServerFarm(resourceGroupName, name, vnetName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } if (!callback) { throw new Error('callback cannot be null.'); } let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } if (resourceGroupName !== null && resourceGroupName !== undefined) { if (resourceGroupName.length > 90) { throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); } if (resourceGroupName.length < 1) { throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); } if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) { throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); } } if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { throw new Error('vnetName cannot be null or undefined and it must be of type string.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } if(options) { for(let headerName in options['customHeaders']) { if (options['customHeaders'].hasOwnProperty(headerName)) { httpRequest.headers[headerName] = options['customHeaders'][headerName]; } } } httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + `- "${responseBody}" for the default response.`; return callback(error); } return callback(error); } // Create Result let result = null; if (responseBody === '') responseBody = null; // Deserialize Response if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { let resultMapper = new client.models['VnetInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); deserializationError.request = msRest.stripRequest(httpRequest); deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } } return callback(null, result, httpRequest, response); }); } /** * @summary Get a Virtual Network gateway. * * Get a Virtual Network gateway. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} vnetName Name of the Virtual Network. * * @param {string} gatewayName Name of the gateway. Only the 'primary' gateway * is supported. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} callback - The callback. * * @returns {function} callback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link VnetGateway} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ function _getVnetGateway(resourceGroupName, name, vnetName, gatewayName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } if (!callback) { throw new Error('callback cannot be null.'); } let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } if (resourceGroupName !== null && resourceGroupName !== undefined) { if (resourceGroupName.length > 90) { throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); } if (resourceGroupName.length < 1) { throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); } if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) { throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); } } if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { throw new Error('vnetName cannot be null or undefined and it must be of type string.'); } if (gatewayName === null || gatewayName === undefined || typeof gatewayName.valueOf() !== 'string') { throw new Error('gatewayName cannot be null or undefined and it must be of type string.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } if(options) { for(let headerName in options['customHeaders']) { if (options['customHeaders'].hasOwnProperty(headerName)) { httpRequest.headers[headerName] = options['customHeaders'][headerName]; } } } httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + `- "${responseBody}" for the default response.`; return callback(error); } return callback(error); } // Create Result let result = null; if (responseBody === '') responseBody = null; // Deserialize Response if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { let resultMapper = new client.models['VnetGateway']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); deserializationError.request = msRest.stripRequest(httpRequest); deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } } return callback(null, result, httpRequest, response); }); } /** * @summary Update a Virtual Network gateway. * * Update a Virtual Network gateway. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} vnetName Name of the Virtual Network. * * @param {string} gatewayName Name of the gateway. Only the 'primary' gateway * is supported. * * @param {object} connectionEnvelope Definition of the gateway. * * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. * * @param {string} [connectionEnvelope.vpnPackageUri] The URI where the VPN * package can be downloaded. * * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} callback - The callback. * * @returns {function} callback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link VnetGateway} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ function _updateVnetGateway(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } if (!callback) { throw new Error('callback cannot be null.'); } let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } if (resourceGroupName !== null && resourceGroupName !== undefined) { if (resourceGroupName.length > 90) { throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); } if (resourceGroupName.length < 1) { throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); } if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) { throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); } } if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { throw new Error('vnetName cannot be null or undefined and it must be of type string.'); } if (gatewayName === null || gatewayName === undefined || typeof gatewayName.valueOf() !== 'string') { throw new Error('gatewayName cannot be null or undefined and it must be of type string.'); } if (connectionEnvelope === null || connectionEnvelope === undefined) { throw new Error('connectionEnvelope cannot be null or undefined.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } if(options) { for(let headerName in options['customHeaders']) { if (options['customHeaders'].hasOwnProperty(headerName)) { httpRequest.headers[headerName] = options['customHeaders'][headerName]; } } } // Serialize Request let requestContent = null; let requestModel = null; try { if (connectionEnvelope !== null && connectionEnvelope !== undefined) { let requestModelMapper = new client.models['VnetGateway']().mapper(); requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); requestContent = JSON.stringify(requestModel); } } catch (error) { let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + `payload - ${JSON.stringify(connectionEnvelope, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + `- "${responseBody}" for the default response.`; return callback(error); } return callback(error); } // Create Result let result = null; if (responseBody === '') responseBody = null; // Deserialize Response if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { let resultMapper = new client.models['VnetGateway']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); deserializationError.request = msRest.stripRequest(httpRequest); deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } } return callback(null, result, httpRequest, response); }); } /** * @summary Get all routes that are associated with a Virtual Network in an App * Service plan. * * Get all routes that are associated with a Virtual Network in an App Service * plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} vnetName Name of the Virtual Network. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} callback - The callback. * * @returns {function} callback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ function _listRoutesForVnet(resourceGroupName, name, vnetName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } if (!callback) { throw new Error('callback cannot be null.'); } let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } if (resourceGroupName !== null && resourceGroupName !== undefined) { if (resourceGroupName.length > 90) { throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); } if (resourceGroupName.length < 1) { throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); } if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) { throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); } } if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { throw new Error('vnetName cannot be null or undefined and it must be of type string.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } if(options) { for(let headerName in options['customHeaders']) { if (options['customHeaders'].hasOwnProperty(headerName)) { httpRequest.headers[headerName] = options['customHeaders'][headerName]; } } } httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + `- "${responseBody}" for the default response.`; return callback(error); } return callback(error); } // Create Result let result = null; if (responseBody === '') responseBody = null; // Deserialize Response if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { let resultMapper = { required: false, serializedName: 'parsedResponse', type: { name: 'Sequence', element: { required: false, serializedName: 'VnetRouteElementType', type: { name: 'Composite', className: 'VnetRoute' } } } }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); deserializationError.request = msRest.stripRequest(httpRequest); deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } } return callback(null, result, httpRequest, response); }); } /** * @summary Get a Virtual Network route in an App Service plan. * * Get a Virtual Network route in an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} vnetName Name of the Virtual Network. * * @param {string} routeName Name of the Virtual Network route. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} callback - The callback. * * @returns {function} callback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ function _getRouteForVnet(resourceGroupName, name, vnetName, routeName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } if (!callback) { throw new Error('callback cannot be null.'); } let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } if (resourceGroupName !== null && resourceGroupName !== undefined) { if (resourceGroupName.length > 90) { throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); } if (resourceGroupName.length < 1) { throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); } if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) { throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); } } if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { throw new Error('vnetName cannot be null or undefined and it must be of type string.'); } if (routeName === null || routeName === undefined || typeof routeName.valueOf() !== 'string') { throw new Error('routeName cannot be null or undefined and it must be of type string.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); requestUrl = requestUrl.replace('{routeName}', encodeURIComponent(routeName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } if(options) { for(let headerName in options['customHeaders']) { if (options['customHeaders'].hasOwnProperty(headerName)) { httpRequest.headers[headerName] = options['customHeaders'][headerName]; } } } httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + `- "${responseBody}" for the default response.`; return callback(error); } return callback(error); } // Create Result let result = null; if (responseBody === '') responseBody = null; // Deserialize Response if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { let resultMapper = { required: false, serializedName: 'parsedResponse', type: { name: 'Sequence', element: { required: false, serializedName: 'VnetRouteElementType', type: { name: 'Composite', className: 'VnetRoute' } } } }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); deserializationError.request = msRest.stripRequest(httpRequest); deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } } return callback(null, result, httpRequest, response); }); } /** * @summary Create or update a Virtual Network route in an App Service plan. * * Create or update a Virtual Network route in an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} vnetName Name of the Virtual Network. * * @param {string} routeName Name of the Virtual Network route. * * @param {object} route Definition of the Virtual Network route. * * @param {string} [route.vnetRouteName] The name of this route. This is only * returned by the server and does not need to be set by the client. * * @param {string} [route.startAddress] The starting address for this route. * This may also include a CIDR notation, in which case the end address must * not be specified. * * @param {string} [route.endAddress] The ending address for this route. If the * start address is specified in CIDR notation, this must be omitted. * * @param {string} [route.routeType] The type of route this is: * DEFAULT - By default, every app has routes to the local address ranges * specified by RFC1918 * INHERITED - Routes inherited from the real Virtual Network routes * STATIC - Static route set on the app only * * These values will be used for syncing an app's routes with those from a * Virtual Network. Possible values include: 'DEFAULT', 'INHERITED', 'STATIC' * * @param {string} [route.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} callback - The callback. * * @returns {function} callback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link VnetRoute} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ function _createOrUpdateVnetRoute(resourceGroupName, name, vnetName, routeName, route, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } if (!callback) { throw new Error('callback cannot be null.'); } let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } if (resourceGroupName !== null && resourceGroupName !== undefined) { if (resourceGroupName.length > 90) { throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); } if (resourceGroupName.length < 1) { throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); } if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) { throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); } } if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { throw new Error('vnetName cannot be null or undefined and it must be of type string.'); } if (routeName === null || routeName === undefined || typeof routeName.valueOf() !== 'string') { throw new Error('routeName cannot be null or undefined and it must be of type string.'); } if (route === null || route === undefined) { throw new Error('route cannot be null or undefined.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); requestUrl = requestUrl.replace('{routeName}', encodeURIComponent(routeName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } if(options) { for(let headerName in options['customHeaders']) { if (options['customHeaders'].hasOwnProperty(headerName)) { httpRequest.headers[headerName] = options['customHeaders'][headerName]; } } } // Serialize Request let requestContent = null; let requestModel = null; try { if (route !== null && route !== undefined) { let requestModelMapper = new client.models['VnetRoute']().mapper(); requestModel = client.serialize(requestModelMapper, route, 'route'); requestContent = JSON.stringify(requestModel); } } catch (error) { let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + `payload - ${JSON.stringify(route, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; if (statusCode !== 200 && statusCode !== 400 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + `- "${responseBody}" for the default response.`; return callback(error); } return callback(error); } // Create Result let result = null; if (responseBody === '') responseBody = null; // Deserialize Response if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { let resultMapper = new client.models['VnetRoute']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); deserializationError.request = msRest.stripRequest(httpRequest); deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } } return callback(null, result, httpRequest, response); }); } /** * @summary Delete a Virtual Network route in an App Service plan. * * Delete a Virtual Network route in an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} vnetName Name of the Virtual Network. * * @param {string} routeName Name of the Virtual Network route. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} callback - The callback. * * @returns {function} callback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ function _deleteVnetRoute(resourceGroupName, name, vnetName, routeName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } if (!callback) { throw new Error('callback cannot be null.'); } let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } if (resourceGroupName !== null && resourceGroupName !== undefined) { if (resourceGroupName.length > 90) { throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); } if (resourceGroupName.length < 1) { throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); } if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) { throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); } } if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { throw new Error('vnetName cannot be null or undefined and it must be of type string.'); } if (routeName === null || routeName === undefined || typeof routeName.valueOf() !== 'string') { throw new Error('routeName cannot be null or undefined and it must be of type string.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); requestUrl = requestUrl.replace('{routeName}', encodeURIComponent(routeName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } if(options) { for(let headerName in options['customHeaders']) { if (options['customHeaders'].hasOwnProperty(headerName)) { httpRequest.headers[headerName] = options['customHeaders'][headerName]; } } } httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + `- "${responseBody}" for the default response.`; return callback(error); } return callback(error); } // Create Result let result = null; if (responseBody === '') responseBody = null; return callback(null, result, httpRequest, response); }); } /** * @summary Create or update a Virtual Network route in an App Service plan. * * Create or update a Virtual Network route in an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} vnetName Name of the Virtual Network. * * @param {string} routeName Name of the Virtual Network route. * * @param {object} route Definition of the Virtual Network route. * * @param {string} [route.vnetRouteName] The name of this route. This is only * returned by the server and does not need to be set by the client. * * @param {string} [route.startAddress] The starting address for this route. * This may also include a CIDR notation, in which case the end address must * not be specified. * * @param {string} [route.endAddress] The ending address for this route. If the * start address is specified in CIDR notation, this must be omitted. * * @param {string} [route.routeType] The type of route this is: * DEFAULT - By default, every app has routes to the local address ranges * specified by RFC1918 * INHERITED - Routes inherited from the real Virtual Network routes * STATIC - Static route set on the app only * * These values will be used for syncing an app's routes with those from a * Virtual Network. Possible values include: 'DEFAULT', 'INHERITED', 'STATIC' * * @param {string} [route.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} callback - The callback. * * @returns {function} callback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link VnetRoute} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ function _updateVnetRoute(resourceGroupName, name, vnetName, routeName, route, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } if (!callback) { throw new Error('callback cannot be null.'); } let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } if (resourceGroupName !== null && resourceGroupName !== undefined) { if (resourceGroupName.length > 90) { throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); } if (resourceGroupName.length < 1) { throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); } if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) { throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); } } if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { throw new Error('vnetName cannot be null or undefined and it must be of type string.'); } if (routeName === null || routeName === undefined || typeof routeName.valueOf() !== 'string') { throw new Error('routeName cannot be null or undefined and it must be of type string.'); } if (route === null || route === undefined) { throw new Error('route cannot be null or undefined.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); requestUrl = requestUrl.replace('{routeName}', encodeURIComponent(routeName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); httpRequest.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } if(options) { for(let headerName in options['customHeaders']) { if (options['customHeaders'].hasOwnProperty(headerName)) { httpRequest.headers[headerName] = options['customHeaders'][headerName]; } } } // Serialize Request let requestContent = null; let requestModel = null; try { if (route !== null && route !== undefined) { let requestModelMapper = new client.models['VnetRoute']().mapper(); requestModel = client.serialize(requestModelMapper, route, 'route'); requestContent = JSON.stringify(requestModel); } } catch (error) { let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + `payload - ${JSON.stringify(route, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; if (statusCode !== 200 && statusCode !== 400 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + `- "${responseBody}" for the default response.`; return callback(error); } return callback(error); } // Create Result let result = null; if (responseBody === '') responseBody = null; // Deserialize Response if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { let resultMapper = new client.models['VnetRoute']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); deserializationError.request = msRest.stripRequest(httpRequest); deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } } return callback(null, result, httpRequest, response); }); } /** * @summary Reboot a worker machine in an App Service plan. * * Reboot a worker machine in an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} workerName Name of worker machine, which typically starts * with RD. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} callback - The callback. * * @returns {function} callback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ function _rebootWorker(resourceGroupName, name, workerName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } if (!callback) { throw new Error('callback cannot be null.'); } let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } if (resourceGroupName !== null && resourceGroupName !== undefined) { if (resourceGroupName.length > 90) { throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); } if (resourceGroupName.length < 1) { throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); } if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) { throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); } } if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } if (workerName === null || workerName === undefined || typeof workerName.valueOf() !== 'string') { throw new Error('workerName cannot be null or undefined and it must be of type string.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/workers/{workerName}/reboot'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{workerName}', encodeURIComponent(workerName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } if(options) { for(let headerName in options['customHeaders']) { if (options['customHeaders'].hasOwnProperty(headerName)) { httpRequest.headers[headerName] = options['customHeaders'][headerName]; } } } httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; if (statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + `- "${responseBody}" for the default response.`; return callback(error); } return callback(error); } // Create Result let result = null; if (responseBody === '') responseBody = null; return callback(null, result, httpRequest, response); }); } /** * @summary Creates or updates an App Service Plan. * * Creates or updates an App Service Plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {object} appServicePlan Details of the App Service plan. * * @param {string} [appServicePlan.appServicePlanName] Name for the App Service * plan. * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * * @param {string} [appServicePlan.adminSiteName] App Service plan * administration site. * * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for * the App Service Environment to use for the App Service plan. * * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of * the App Service Environment. * * @param {boolean} [appServicePlan.perSiteScaling] If <code>true</code>, apps * assigned to this App Service plan can be scaled independently. * If <code>false</code>, apps assigned to this App Service plan will scale to * all instances of the plan. * * @param {boolean} [appServicePlan.reserved] Reserved. * * @param {number} [appServicePlan.targetWorkerCount] Scaling worker count. * * @param {number} [appServicePlan.targetWorkerSizeId] Scaling worker size ID. * * @param {object} [appServicePlan.sku] * * @param {string} [appServicePlan.sku.name] Name of the resource SKU. * * @param {string} [appServicePlan.sku.tier] Service tier of the resource SKU. * * @param {string} [appServicePlan.sku.size] Size specifier of the resource * SKU. * * @param {string} [appServicePlan.sku.family] Family code of the resource SKU. * * @param {number} [appServicePlan.sku.capacity] Current number of instances * assigned to the resource. * * @param {object} [appServicePlan.sku.skuCapacity] Min, max, and default scale * values of the SKU. * * @param {number} [appServicePlan.sku.skuCapacity.minimum] Minimum number of * workers for this App Service plan SKU. * * @param {number} [appServicePlan.sku.skuCapacity.maximum] Maximum number of * workers for this App Service plan SKU. * * @param {number} [appServicePlan.sku.skuCapacity.default] Default number of * workers for this App Service plan SKU. * * @param {string} [appServicePlan.sku.skuCapacity.scaleType] Available scale * configurations for an App Service plan. * * @param {array} [appServicePlan.sku.locations] Locations of the SKU. * * @param {array} [appServicePlan.sku.capabilities] Capabilities of the SKU, * e.g., is traffic manager enabled? * * @param {string} [appServicePlan.kind] Kind of resource. * * @param {string} appServicePlan.location Resource Location. * * @param {object} [appServicePlan.tags] Resource tags. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} callback - The callback. * * @returns {function} callback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link AppServicePlan} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ function _beginCreateOrUpdate(resourceGroupName, name, appServicePlan, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } if (!callback) { throw new Error('callback cannot be null.'); } let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } if (resourceGroupName !== null && resourceGroupName !== undefined) { if (resourceGroupName.length > 90) { throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); } if (resourceGroupName.length < 1) { throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); } if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) { throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); } } if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } if (appServicePlan === null || appServicePlan === undefined) { throw new Error('appServicePlan cannot be null or undefined.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } if(options) { for(let headerName in options['customHeaders']) { if (options['customHeaders'].hasOwnProperty(headerName)) { httpRequest.headers[headerName] = options['customHeaders'][headerName]; } } } // Serialize Request let requestContent = null; let requestModel = null; try { if (appServicePlan !== null && appServicePlan !== undefined) { let requestModelMapper = new client.models['AppServicePlan']().mapper(); requestModel = client.serialize(requestModelMapper, appServicePlan, 'appServicePlan'); requestContent = JSON.stringify(requestModel); } } catch (error) { let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + `payload - ${JSON.stringify(appServicePlan, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; if (statusCode !== 200 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + `- "${responseBody}" for the default response.`; return callback(error); } return callback(error); } // Create Result let result = null; if (responseBody === '') responseBody = null; // Deserialize Response if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { let resultMapper = new client.models['AppServicePlan']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); deserializationError.request = msRest.stripRequest(httpRequest); deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } } // Deserialize Response if (statusCode === 202) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { let resultMapper = new client.models['AppServicePlan']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); deserializationError1.request = msRest.stripRequest(httpRequest); deserializationError1.response = msRest.stripResponse(response); return callback(deserializationError1); } } return callback(null, result, httpRequest, response); }); } /** * @summary Get all App Service plans for a subcription. * * Get all App Service plans for a subcription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} callback - The callback. * * @returns {function} callback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link AppServicePlanCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ function _listNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } if (!callback) { throw new Error('callback cannot be null.'); } // Validate try { if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } // Construct URL let requestUrl = '{nextLink}'; requestUrl = requestUrl.replace('{nextLink}', nextPageLink); // Create HTTP transport objects let httpRequest = new WebResource(); httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } if(options) { for(let headerName in options['customHeaders']) { if (options['customHeaders'].hasOwnProperty(headerName)) { httpRequest.headers[headerName] = options['customHeaders'][headerName]; } } } httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + `- "${responseBody}" for the default response.`; return callback(error); } return callback(error); } // Create Result let result = null; if (responseBody === '') responseBody = null; // Deserialize Response if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { let resultMapper = new client.models['AppServicePlanCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); deserializationError.request = msRest.stripRequest(httpRequest); deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } } return callback(null, result, httpRequest, response); }); } /** * @summary Get all App Service plans in a resource group. * * Get all App Service plans in a resource group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} callback - The callback. * * @returns {function} callback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link AppServicePlanCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ function _listByResourceGroupNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } if (!callback) { throw new Error('callback cannot be null.'); } // Validate try { if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } // Construct URL let requestUrl = '{nextLink}'; requestUrl = requestUrl.replace('{nextLink}', nextPageLink); // Create HTTP transport objects let httpRequest = new WebResource(); httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } if(options) { for(let headerName in options['customHeaders']) { if (options['customHeaders'].hasOwnProperty(headerName)) { httpRequest.headers[headerName] = options['customHeaders'][headerName]; } } } httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + `- "${responseBody}" for the default response.`; return callback(error); } return callback(error); } // Create Result let result = null; if (responseBody === '') responseBody = null; // Deserialize Response if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { let resultMapper = new client.models['AppServicePlanCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); deserializationError.request = msRest.stripRequest(httpRequest); deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } } return callback(null, result, httpRequest, response); }); } /** * @summary Get all apps that use a Hybrid Connection in an App Service Plan. * * Get all apps that use a Hybrid Connection in an App Service Plan. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} callback - The callback. * * @returns {function} callback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link ResourceCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ function _listWebAppsByHybridConnectionNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } if (!callback) { throw new Error('callback cannot be null.'); } // Validate try { if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } // Construct URL let requestUrl = '{nextLink}'; requestUrl = requestUrl.replace('{nextLink}', nextPageLink); // Create HTTP transport objects let httpRequest = new WebResource(); httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } if(options) { for(let headerName in options['customHeaders']) { if (options['customHeaders'].hasOwnProperty(headerName)) { httpRequest.headers[headerName] = options['customHeaders'][headerName]; } } } httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + `- "${responseBody}" for the default response.`; return callback(error); } return callback(error); } // Create Result let result = null; if (responseBody === '') responseBody = null; // Deserialize Response if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { let resultMapper = new client.models['ResourceCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); deserializationError.request = msRest.stripRequest(httpRequest); deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } } return callback(null, result, httpRequest, response); }); } /** * @summary Retrieve all Hybrid Connections in use in an App Service plan. * * Retrieve all Hybrid Connections in use in an App Service plan. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} callback - The callback. * * @returns {function} callback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link HybridConnectionCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ function _listHybridConnectionsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } if (!callback) { throw new Error('callback cannot be null.'); } // Validate try { if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } // Construct URL let requestUrl = '{nextLink}'; requestUrl = requestUrl.replace('{nextLink}', nextPageLink); // Create HTTP transport objects let httpRequest = new WebResource(); httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } if(options) { for(let headerName in options['customHeaders']) { if (options['customHeaders'].hasOwnProperty(headerName)) { httpRequest.headers[headerName] = options['customHeaders'][headerName]; } } } httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + `- "${responseBody}" for the default response.`; return callback(error); } return callback(error); } // Create Result let result = null; if (responseBody === '') responseBody = null; // Deserialize Response if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { let resultMapper = new client.models['HybridConnectionCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); deserializationError.request = msRest.stripRequest(httpRequest); deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } } return callback(null, result, httpRequest, response); }); } /** * @summary Get metrics that can be queried for an App Service plan, and their * definitions. * * Get metrics that can be queried for an App Service plan, and their * definitions. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} callback - The callback. * * @returns {function} callback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link ResourceMetricDefinitionCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ function _listMetricDefintionsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } if (!callback) { throw new Error('callback cannot be null.'); } // Validate try { if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } // Construct URL let requestUrl = '{nextLink}'; requestUrl = requestUrl.replace('{nextLink}', nextPageLink); // Create HTTP transport objects let httpRequest = new WebResource(); httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } if(options) { for(let headerName in options['customHeaders']) { if (options['customHeaders'].hasOwnProperty(headerName)) { httpRequest.headers[headerName] = options['customHeaders'][headerName]; } } } httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + `- "${responseBody}" for the default response.`; return callback(error); } return callback(error); } // Create Result let result = null; if (responseBody === '') responseBody = null; // Deserialize Response if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { let resultMapper = new client.models['ResourceMetricDefinitionCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); deserializationError.request = msRest.stripRequest(httpRequest); deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } } return callback(null, result, httpRequest, response); }); } /** * @summary Get metrics for an App Serice plan. * * Get metrics for an App Serice plan. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} callback - The callback. * * @returns {function} callback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link ResourceMetricCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ function _listMetricsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } if (!callback) { throw new Error('callback cannot be null.'); } // Validate try { if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } // Construct URL let requestUrl = '{nextLink}'; requestUrl = requestUrl.replace('{nextLink}', nextPageLink); // Create HTTP transport objects let httpRequest = new WebResource(); httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } if(options) { for(let headerName in options['customHeaders']) { if (options['customHeaders'].hasOwnProperty(headerName)) { httpRequest.headers[headerName] = options['customHeaders'][headerName]; } } } httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + `- "${responseBody}" for the default response.`; return callback(error); } return callback(error); } // Create Result let result = null; if (responseBody === '') responseBody = null; // Deserialize Response if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { let resultMapper = new client.models['ResourceMetricCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); deserializationError.request = msRest.stripRequest(httpRequest); deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } } return callback(null, result, httpRequest, response); }); } /** * @summary Get all apps associated with an App Service plan. * * Get all apps associated with an App Service plan. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} callback - The callback. * * @returns {function} callback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link WebAppCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ function _listWebAppsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } if (!callback) { throw new Error('callback cannot be null.'); } // Validate try { if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } // Construct URL let requestUrl = '{nextLink}'; requestUrl = requestUrl.replace('{nextLink}', nextPageLink); // Create HTTP transport objects let httpRequest = new WebResource(); httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } if(options) { for(let headerName in options['customHeaders']) { if (options['customHeaders'].hasOwnProperty(headerName)) { httpRequest.headers[headerName] = options['customHeaders'][headerName]; } } } httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + `- "${responseBody}" for the default response.`; return callback(error); } return callback(error); } // Create Result let result = null; if (responseBody === '') responseBody = null; // Deserialize Response if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { let resultMapper = new client.models['WebAppCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); deserializationError.request = msRest.stripRequest(httpRequest); deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } } return callback(null, result, httpRequest, response); }); } /** Class representing a AppServicePlans. */ class AppServicePlans { /** * Create a AppServicePlans. * @param {WebSiteManagementClient} client Reference to the service client. */ constructor(client) { this.client = client; this._list = _list; this._listByResourceGroup = _listByResourceGroup; this._get = _get; this._createOrUpdate = _createOrUpdate; this._deleteMethod = _deleteMethod; this._listCapabilities = _listCapabilities; this._getHybridConnection = _getHybridConnection; this._deleteHybridConnection = _deleteHybridConnection; this._listHybridConnectionKeys = _listHybridConnectionKeys; this._listWebAppsByHybridConnection = _listWebAppsByHybridConnection; this._getHybridConnectionPlanLimit = _getHybridConnectionPlanLimit; this._listHybridConnections = _listHybridConnections; this._listMetricDefintions = _listMetricDefintions; this._listMetrics = _listMetrics; this._restartWebApps = _restartWebApps; this._listWebApps = _listWebApps; this._listVnets = _listVnets; this._getVnetFromServerFarm = _getVnetFromServerFarm; this._getVnetGateway = _getVnetGateway; this._updateVnetGateway = _updateVnetGateway; this._listRoutesForVnet = _listRoutesForVnet; this._getRouteForVnet = _getRouteForVnet; this._createOrUpdateVnetRoute = _createOrUpdateVnetRoute; this._deleteVnetRoute = _deleteVnetRoute; this._updateVnetRoute = _updateVnetRoute; this._rebootWorker = _rebootWorker; this._beginCreateOrUpdate = _beginCreateOrUpdate; this._listNext = _listNext; this._listByResourceGroupNext = _listByResourceGroupNext; this._listWebAppsByHybridConnectionNext = _listWebAppsByHybridConnectionNext; this._listHybridConnectionsNext = _listHybridConnectionsNext; this._listMetricDefintionsNext = _listMetricDefintionsNext; this._listMetricsNext = _listMetricsNext; this._listWebAppsNext = _listWebAppsNext; } /** * @summary Get all App Service plans for a subcription. * * Get all App Service plans for a subcription. * * @param {object} [options] Optional Parameters. * * @param {boolean} [options.detailed] Specify <code>true</code> to return all * App Service plan properties. The default is <code>false</code>, which * returns a subset of the properties. * Retrieval of all properties may increase the API latency. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * * @resolve {HttpOperationResponse<AppServicePlanCollection>} - The deserialized result object. * * @reject {Error} - The error object. */ listWithHttpOperationResponse(options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { self._list(options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } return; }); }); } /** * @summary Get all App Service plans for a subcription. * * Get all App Service plans for a subcription. * * @param {object} [options] Optional Parameters. * * @param {boolean} [options.detailed] Specify <code>true</code> to return all * App Service plan properties. The default is <code>false</code>, which * returns a subset of the properties. * Retrieval of all properties may increase the API latency. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} [optionalCallback] - The optional callback. * * @returns {function|Promise} If a callback was passed as the last parameter * then it returns the callback else returns a Promise. * * {Promise} A promise is returned * * @resolve {AppServicePlanCollection} - The deserialized result object. * * @reject {Error} - The error object. * * {function} optionalCallback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link AppServicePlanCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ list(options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { optionalCallback = options; options = null; } if (!optionalCallback) { return new Promise((resolve, reject) => { self._list(options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { return self._list(options, optionalCallback); } } /** * @summary Get all App Service plans in a resource group. * * Get all App Service plans in a resource group. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * * @resolve {HttpOperationResponse<AppServicePlanCollection>} - The deserialized result object. * * @reject {Error} - The error object. */ listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } return; }); }); } /** * @summary Get all App Service plans in a resource group. * * Get all App Service plans in a resource group. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} [optionalCallback] - The optional callback. * * @returns {function|Promise} If a callback was passed as the last parameter * then it returns the callback else returns a Promise. * * {Promise} A promise is returned * * @resolve {AppServicePlanCollection} - The deserialized result object. * * @reject {Error} - The error object. * * {function} optionalCallback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link AppServicePlanCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ listByResourceGroup(resourceGroupName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { optionalCallback = options; options = null; } if (!optionalCallback) { return new Promise((resolve, reject) => { self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { return self._listByResourceGroup(resourceGroupName, options, optionalCallback); } } /** * @summary Get an App Service plan. * * Get an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * * @resolve {HttpOperationResponse<AppServicePlan>} - The deserialized result object. * * @reject {Error} - The error object. */ getWithHttpOperationResponse(resourceGroupName, name, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { self._get(resourceGroupName, name, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } return; }); }); } /** * @summary Get an App Service plan. * * Get an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} [optionalCallback] - The optional callback. * * @returns {function|Promise} If a callback was passed as the last parameter * then it returns the callback else returns a Promise. * * {Promise} A promise is returned * * @resolve {AppServicePlan} - The deserialized result object. * * @reject {Error} - The error object. * * {function} optionalCallback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link AppServicePlan} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ get(resourceGroupName, name, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { optionalCallback = options; options = null; } if (!optionalCallback) { return new Promise((resolve, reject) => { self._get(resourceGroupName, name, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { return self._get(resourceGroupName, name, options, optionalCallback); } } /** * @summary Creates or updates an App Service Plan. * * Creates or updates an App Service Plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {object} appServicePlan Details of the App Service plan. * * @param {string} [appServicePlan.appServicePlanName] Name for the App Service * plan. * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * * @param {string} [appServicePlan.adminSiteName] App Service plan * administration site. * * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for * the App Service Environment to use for the App Service plan. * * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of * the App Service Environment. * * @param {boolean} [appServicePlan.perSiteScaling] If <code>true</code>, apps * assigned to this App Service plan can be scaled independently. * If <code>false</code>, apps assigned to this App Service plan will scale to * all instances of the plan. * * @param {boolean} [appServicePlan.reserved] Reserved. * * @param {number} [appServicePlan.targetWorkerCount] Scaling worker count. * * @param {number} [appServicePlan.targetWorkerSizeId] Scaling worker size ID. * * @param {object} [appServicePlan.sku] * * @param {string} [appServicePlan.sku.name] Name of the resource SKU. * * @param {string} [appServicePlan.sku.tier] Service tier of the resource SKU. * * @param {string} [appServicePlan.sku.size] Size specifier of the resource * SKU. * * @param {string} [appServicePlan.sku.family] Family code of the resource SKU. * * @param {number} [appServicePlan.sku.capacity] Current number of instances * assigned to the resource. * * @param {object} [appServicePlan.sku.skuCapacity] Min, max, and default scale * values of the SKU. * * @param {number} [appServicePlan.sku.skuCapacity.minimum] Minimum number of * workers for this App Service plan SKU. * * @param {number} [appServicePlan.sku.skuCapacity.maximum] Maximum number of * workers for this App Service plan SKU. * * @param {number} [appServicePlan.sku.skuCapacity.default] Default number of * workers for this App Service plan SKU. * * @param {string} [appServicePlan.sku.skuCapacity.scaleType] Available scale * configurations for an App Service plan. * * @param {array} [appServicePlan.sku.locations] Locations of the SKU. * * @param {array} [appServicePlan.sku.capabilities] Capabilities of the SKU, * e.g., is traffic manager enabled? * * @param {string} [appServicePlan.kind] Kind of resource. * * @param {string} appServicePlan.location Resource Location. * * @param {object} [appServicePlan.tags] Resource tags. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * * @resolve {HttpOperationResponse<AppServicePlan>} - The deserialized result object. * * @reject {Error} - The error object. */ createOrUpdateWithHttpOperationResponse(resourceGroupName, name, appServicePlan, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { self._createOrUpdate(resourceGroupName, name, appServicePlan, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } return; }); }); } /** * @summary Creates or updates an App Service Plan. * * Creates or updates an App Service Plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {object} appServicePlan Details of the App Service plan. * * @param {string} [appServicePlan.appServicePlanName] Name for the App Service * plan. * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * * @param {string} [appServicePlan.adminSiteName] App Service plan * administration site. * * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for * the App Service Environment to use for the App Service plan. * * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of * the App Service Environment. * * @param {boolean} [appServicePlan.perSiteScaling] If <code>true</code>, apps * assigned to this App Service plan can be scaled independently. * If <code>false</code>, apps assigned to this App Service plan will scale to * all instances of the plan. * * @param {boolean} [appServicePlan.reserved] Reserved. * * @param {number} [appServicePlan.targetWorkerCount] Scaling worker count. * * @param {number} [appServicePlan.targetWorkerSizeId] Scaling worker size ID. * * @param {object} [appServicePlan.sku] * * @param {string} [appServicePlan.sku.name] Name of the resource SKU. * * @param {string} [appServicePlan.sku.tier] Service tier of the resource SKU. * * @param {string} [appServicePlan.sku.size] Size specifier of the resource * SKU. * * @param {string} [appServicePlan.sku.family] Family code of the resource SKU. * * @param {number} [appServicePlan.sku.capacity] Current number of instances * assigned to the resource. * * @param {object} [appServicePlan.sku.skuCapacity] Min, max, and default scale * values of the SKU. * * @param {number} [appServicePlan.sku.skuCapacity.minimum] Minimum number of * workers for this App Service plan SKU. * * @param {number} [appServicePlan.sku.skuCapacity.maximum] Maximum number of * workers for this App Service plan SKU. * * @param {number} [appServicePlan.sku.skuCapacity.default] Default number of * workers for this App Service plan SKU. * * @param {string} [appServicePlan.sku.skuCapacity.scaleType] Available scale * configurations for an App Service plan. * * @param {array} [appServicePlan.sku.locations] Locations of the SKU. * * @param {array} [appServicePlan.sku.capabilities] Capabilities of the SKU, * e.g., is traffic manager enabled? * * @param {string} [appServicePlan.kind] Kind of resource. * * @param {string} appServicePlan.location Resource Location. * * @param {object} [appServicePlan.tags] Resource tags. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} [optionalCallback] - The optional callback. * * @returns {function|Promise} If a callback was passed as the last parameter * then it returns the callback else returns a Promise. * * {Promise} A promise is returned * * @resolve {AppServicePlan} - The deserialized result object. * * @reject {Error} - The error object. * * {function} optionalCallback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link AppServicePlan} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ createOrUpdate(resourceGroupName, name, appServicePlan, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { optionalCallback = options; options = null; } if (!optionalCallback) { return new Promise((resolve, reject) => { self._createOrUpdate(resourceGroupName, name, appServicePlan, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { return self._createOrUpdate(resourceGroupName, name, appServicePlan, options, optionalCallback); } } /** * @summary Delete an App Service plan. * * Delete an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * * @resolve {HttpOperationResponse<null>} - The deserialized result object. * * @reject {Error} - The error object. */ deleteMethodWithHttpOperationResponse(resourceGroupName, name, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { self._deleteMethod(resourceGroupName, name, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } return; }); }); } /** * @summary Delete an App Service plan. * * Delete an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} [optionalCallback] - The optional callback. * * @returns {function|Promise} If a callback was passed as the last parameter * then it returns the callback else returns a Promise. * * {Promise} A promise is returned * * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * * {function} optionalCallback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ deleteMethod(resourceGroupName, name, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { optionalCallback = options; options = null; } if (!optionalCallback) { return new Promise((resolve, reject) => { self._deleteMethod(resourceGroupName, name, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { return self._deleteMethod(resourceGroupName, name, options, optionalCallback); } } /** * @summary List all capabilities of an App Service plan. * * List all capabilities of an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * * @resolve {HttpOperationResponse<Array>} - The deserialized result object. * * @reject {Error} - The error object. */ listCapabilitiesWithHttpOperationResponse(resourceGroupName, name, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { self._listCapabilities(resourceGroupName, name, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } return; }); }); } /** * @summary List all capabilities of an App Service plan. * * List all capabilities of an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} [optionalCallback] - The optional callback. * * @returns {function|Promise} If a callback was passed as the last parameter * then it returns the callback else returns a Promise. * * {Promise} A promise is returned * * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * * {function} optionalCallback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ listCapabilities(resourceGroupName, name, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { optionalCallback = options; options = null; } if (!optionalCallback) { return new Promise((resolve, reject) => { self._listCapabilities(resourceGroupName, name, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { return self._listCapabilities(resourceGroupName, name, options, optionalCallback); } } /** * @summary Retrieve a Hybrid Connection in use in an App Service plan. * * Retrieve a Hybrid Connection in use in an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} namespaceName Name of the Service Bus namespace. * * @param {string} relayName Name of the Service Bus relay. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * * @resolve {HttpOperationResponse<HybridConnection>} - The deserialized result object. * * @reject {Error} - The error object. */ getHybridConnectionWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { self._getHybridConnection(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } return; }); }); } /** * @summary Retrieve a Hybrid Connection in use in an App Service plan. * * Retrieve a Hybrid Connection in use in an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} namespaceName Name of the Service Bus namespace. * * @param {string} relayName Name of the Service Bus relay. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} [optionalCallback] - The optional callback. * * @returns {function|Promise} If a callback was passed as the last parameter * then it returns the callback else returns a Promise. * * {Promise} A promise is returned * * @resolve {HybridConnection} - The deserialized result object. * * @reject {Error} - The error object. * * {function} optionalCallback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link HybridConnection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ getHybridConnection(resourceGroupName, name, namespaceName, relayName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { optionalCallback = options; options = null; } if (!optionalCallback) { return new Promise((resolve, reject) => { self._getHybridConnection(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { return self._getHybridConnection(resourceGroupName, name, namespaceName, relayName, options, optionalCallback); } } /** * @summary Delete a Hybrid Connection in use in an App Service plan. * * Delete a Hybrid Connection in use in an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} namespaceName Name of the Service Bus namespace. * * @param {string} relayName Name of the Service Bus relay. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * * @resolve {HttpOperationResponse<null>} - The deserialized result object. * * @reject {Error} - The error object. */ deleteHybridConnectionWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { self._deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } return; }); }); } /** * @summary Delete a Hybrid Connection in use in an App Service plan. * * Delete a Hybrid Connection in use in an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} namespaceName Name of the Service Bus namespace. * * @param {string} relayName Name of the Service Bus relay. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} [optionalCallback] - The optional callback. * * @returns {function|Promise} If a callback was passed as the last parameter * then it returns the callback else returns a Promise. * * {Promise} A promise is returned * * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * * {function} optionalCallback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { optionalCallback = options; options = null; } if (!optionalCallback) { return new Promise((resolve, reject) => { self._deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { return self._deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, options, optionalCallback); } } /** * @summary Get the send key name and value of a Hybrid Connection. * * Get the send key name and value of a Hybrid Connection. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} namespaceName The name of the Service Bus namespace. * * @param {string} relayName The name of the Service Bus relay. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * * @resolve {HttpOperationResponse<HybridConnectionKey>} - The deserialized result object. * * @reject {Error} - The error object. */ listHybridConnectionKeysWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { self._listHybridConnectionKeys(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } return; }); }); } /** * @summary Get the send key name and value of a Hybrid Connection. * * Get the send key name and value of a Hybrid Connection. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} namespaceName The name of the Service Bus namespace. * * @param {string} relayName The name of the Service Bus relay. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} [optionalCallback] - The optional callback. * * @returns {function|Promise} If a callback was passed as the last parameter * then it returns the callback else returns a Promise. * * {Promise} A promise is returned * * @resolve {HybridConnectionKey} - The deserialized result object. * * @reject {Error} - The error object. * * {function} optionalCallback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link HybridConnectionKey} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ listHybridConnectionKeys(resourceGroupName, name, namespaceName, relayName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { optionalCallback = options; options = null; } if (!optionalCallback) { return new Promise((resolve, reject) => { self._listHybridConnectionKeys(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { return self._listHybridConnectionKeys(resourceGroupName, name, namespaceName, relayName, options, optionalCallback); } } /** * @summary Get all apps that use a Hybrid Connection in an App Service Plan. * * Get all apps that use a Hybrid Connection in an App Service Plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} namespaceName Name of the Hybrid Connection namespace. * * @param {string} relayName Name of the Hybrid Connection relay. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * * @resolve {HttpOperationResponse<ResourceCollection>} - The deserialized result object. * * @reject {Error} - The error object. */ listWebAppsByHybridConnectionWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { self._listWebAppsByHybridConnection(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } return; }); }); } /** * @summary Get all apps that use a Hybrid Connection in an App Service Plan. * * Get all apps that use a Hybrid Connection in an App Service Plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} namespaceName Name of the Hybrid Connection namespace. * * @param {string} relayName Name of the Hybrid Connection relay. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} [optionalCallback] - The optional callback. * * @returns {function|Promise} If a callback was passed as the last parameter * then it returns the callback else returns a Promise. * * {Promise} A promise is returned * * @resolve {ResourceCollection} - The deserialized result object. * * @reject {Error} - The error object. * * {function} optionalCallback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link ResourceCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ listWebAppsByHybridConnection(resourceGroupName, name, namespaceName, relayName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { optionalCallback = options; options = null; } if (!optionalCallback) { return new Promise((resolve, reject) => { self._listWebAppsByHybridConnection(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { return self._listWebAppsByHybridConnection(resourceGroupName, name, namespaceName, relayName, options, optionalCallback); } } /** * @summary Get the maximum number of Hybrid Connections allowed in an App * Service plan. * * Get the maximum number of Hybrid Connections allowed in an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * * @resolve {HttpOperationResponse<HybridConnectionLimits>} - The deserialized result object. * * @reject {Error} - The error object. */ getHybridConnectionPlanLimitWithHttpOperationResponse(resourceGroupName, name, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { self._getHybridConnectionPlanLimit(resourceGroupName, name, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } return; }); }); } /** * @summary Get the maximum number of Hybrid Connections allowed in an App * Service plan. * * Get the maximum number of Hybrid Connections allowed in an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} [optionalCallback] - The optional callback. * * @returns {function|Promise} If a callback was passed as the last parameter * then it returns the callback else returns a Promise. * * {Promise} A promise is returned * * @resolve {HybridConnectionLimits} - The deserialized result object. * * @reject {Error} - The error object. * * {function} optionalCallback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link HybridConnectionLimits} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ getHybridConnectionPlanLimit(resourceGroupName, name, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { optionalCallback = options; options = null; } if (!optionalCallback) { return new Promise((resolve, reject) => { self._getHybridConnectionPlanLimit(resourceGroupName, name, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { return self._getHybridConnectionPlanLimit(resourceGroupName, name, options, optionalCallback); } } /** * @summary Retrieve all Hybrid Connections in use in an App Service plan. * * Retrieve all Hybrid Connections in use in an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * * @resolve {HttpOperationResponse<HybridConnectionCollection>} - The deserialized result object. * * @reject {Error} - The error object. */ listHybridConnectionsWithHttpOperationResponse(resourceGroupName, name, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { self._listHybridConnections(resourceGroupName, name, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } return; }); }); } /** * @summary Retrieve all Hybrid Connections in use in an App Service plan. * * Retrieve all Hybrid Connections in use in an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} [optionalCallback] - The optional callback. * * @returns {function|Promise} If a callback was passed as the last parameter * then it returns the callback else returns a Promise. * * {Promise} A promise is returned * * @resolve {HybridConnectionCollection} - The deserialized result object. * * @reject {Error} - The error object. * * {function} optionalCallback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link HybridConnectionCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ listHybridConnections(resourceGroupName, name, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { optionalCallback = options; options = null; } if (!optionalCallback) { return new Promise((resolve, reject) => { self._listHybridConnections(resourceGroupName, name, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { return self._listHybridConnections(resourceGroupName, name, options, optionalCallback); } } /** * @summary Get metrics that can be queried for an App Service plan, and their * definitions. * * Get metrics that can be queried for an App Service plan, and their * definitions. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * * @resolve {HttpOperationResponse<ResourceMetricDefinitionCollection>} - The deserialized result object. * * @reject {Error} - The error object. */ listMetricDefintionsWithHttpOperationResponse(resourceGroupName, name, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { self._listMetricDefintions(resourceGroupName, name, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } return; }); }); } /** * @summary Get metrics that can be queried for an App Service plan, and their * definitions. * * Get metrics that can be queried for an App Service plan, and their * definitions. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} [optionalCallback] - The optional callback. * * @returns {function|Promise} If a callback was passed as the last parameter * then it returns the callback else returns a Promise. * * {Promise} A promise is returned * * @resolve {ResourceMetricDefinitionCollection} - The deserialized result object. * * @reject {Error} - The error object. * * {function} optionalCallback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link ResourceMetricDefinitionCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ listMetricDefintions(resourceGroupName, name, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { optionalCallback = options; options = null; } if (!optionalCallback) { return new Promise((resolve, reject) => { self._listMetricDefintions(resourceGroupName, name, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { return self._listMetricDefintions(resourceGroupName, name, options, optionalCallback); } } /** * @summary Get metrics for an App Serice plan. * * Get metrics for an App Serice plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {object} [options] Optional Parameters. * * @param {boolean} [options.details] Specify <code>true</code> to include * instance details. The default is <code>false</code>. * * @param {string} [options.filter] Return only usages/metrics specified in the * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq * 'Metric1' or name.value eq 'Metric2') and startTime eq * '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain * eq duration'[Hour|Minute|Day]'. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * * @resolve {HttpOperationResponse<ResourceMetricCollection>} - The deserialized result object. * * @reject {Error} - The error object. */ listMetricsWithHttpOperationResponse(resourceGroupName, name, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { self._listMetrics(resourceGroupName, name, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } return; }); }); } /** * @summary Get metrics for an App Serice plan. * * Get metrics for an App Serice plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {object} [options] Optional Parameters. * * @param {boolean} [options.details] Specify <code>true</code> to include * instance details. The default is <code>false</code>. * * @param {string} [options.filter] Return only usages/metrics specified in the * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq * 'Metric1' or name.value eq 'Metric2') and startTime eq * '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain * eq duration'[Hour|Minute|Day]'. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} [optionalCallback] - The optional callback. * * @returns {function|Promise} If a callback was passed as the last parameter * then it returns the callback else returns a Promise. * * {Promise} A promise is returned * * @resolve {ResourceMetricCollection} - The deserialized result object. * * @reject {Error} - The error object. * * {function} optionalCallback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link ResourceMetricCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ listMetrics(resourceGroupName, name, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { optionalCallback = options; options = null; } if (!optionalCallback) { return new Promise((resolve, reject) => { self._listMetrics(resourceGroupName, name, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { return self._listMetrics(resourceGroupName, name, options, optionalCallback); } } /** * @summary Restart all apps in an App Service plan. * * Restart all apps in an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {object} [options] Optional Parameters. * * @param {boolean} [options.softRestart] Specify <code>true</code> to performa * a soft restart, applies the configuration settings and restarts the apps if * necessary. The default is <code>false</code>, which always restarts and * reprovisions the apps * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * * @resolve {HttpOperationResponse<null>} - The deserialized result object. * * @reject {Error} - The error object. */ restartWebAppsWithHttpOperationResponse(resourceGroupName, name, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { self._restartWebApps(resourceGroupName, name, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } return; }); }); } /** * @summary Restart all apps in an App Service plan. * * Restart all apps in an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {object} [options] Optional Parameters. * * @param {boolean} [options.softRestart] Specify <code>true</code> to performa * a soft restart, applies the configuration settings and restarts the apps if * necessary. The default is <code>false</code>, which always restarts and * reprovisions the apps * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} [optionalCallback] - The optional callback. * * @returns {function|Promise} If a callback was passed as the last parameter * then it returns the callback else returns a Promise. * * {Promise} A promise is returned * * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * * {function} optionalCallback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ restartWebApps(resourceGroupName, name, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { optionalCallback = options; options = null; } if (!optionalCallback) { return new Promise((resolve, reject) => { self._restartWebApps(resourceGroupName, name, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { return self._restartWebApps(resourceGroupName, name, options, optionalCallback); } } /** * @summary Get all apps associated with an App Service plan. * * Get all apps associated with an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {object} [options] Optional Parameters. * * @param {string} [options.skipToken] Skip to a web app in the list of webapps * associated with app service plan. If specified, the resulting list will * contain web apps starting from (including) the skipToken. Otherwise, the * resulting list contains web apps from the start of the list * * @param {string} [options.filter] Supported filter: $filter=state eq running. * Returns only web apps that are currently running * * @param {string} [options.top] List page size. If specified, results are * paged. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * * @resolve {HttpOperationResponse<WebAppCollection>} - The deserialized result object. * * @reject {Error} - The error object. */ listWebAppsWithHttpOperationResponse(resourceGroupName, name, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { self._listWebApps(resourceGroupName, name, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } return; }); }); } /** * @summary Get all apps associated with an App Service plan. * * Get all apps associated with an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {object} [options] Optional Parameters. * * @param {string} [options.skipToken] Skip to a web app in the list of webapps * associated with app service plan. If specified, the resulting list will * contain web apps starting from (including) the skipToken. Otherwise, the * resulting list contains web apps from the start of the list * * @param {string} [options.filter] Supported filter: $filter=state eq running. * Returns only web apps that are currently running * * @param {string} [options.top] List page size. If specified, results are * paged. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} [optionalCallback] - The optional callback. * * @returns {function|Promise} If a callback was passed as the last parameter * then it returns the callback else returns a Promise. * * {Promise} A promise is returned * * @resolve {WebAppCollection} - The deserialized result object. * * @reject {Error} - The error object. * * {function} optionalCallback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link WebAppCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ listWebApps(resourceGroupName, name, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { optionalCallback = options; options = null; } if (!optionalCallback) { return new Promise((resolve, reject) => { self._listWebApps(resourceGroupName, name, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { return self._listWebApps(resourceGroupName, name, options, optionalCallback); } } /** * @summary Get all Virtual Networks associated with an App Service plan. * * Get all Virtual Networks associated with an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * * @resolve {HttpOperationResponse<Array>} - The deserialized result object. * * @reject {Error} - The error object. */ listVnetsWithHttpOperationResponse(resourceGroupName, name, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { self._listVnets(resourceGroupName, name, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } return; }); }); } /** * @summary Get all Virtual Networks associated with an App Service plan. * * Get all Virtual Networks associated with an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} [optionalCallback] - The optional callback. * * @returns {function|Promise} If a callback was passed as the last parameter * then it returns the callback else returns a Promise. * * {Promise} A promise is returned * * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * * {function} optionalCallback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ listVnets(resourceGroupName, name, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { optionalCallback = options; options = null; } if (!optionalCallback) { return new Promise((resolve, reject) => { self._listVnets(resourceGroupName, name, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { return self._listVnets(resourceGroupName, name, options, optionalCallback); } } /** * @summary Get a Virtual Network associated with an App Service plan. * * Get a Virtual Network associated with an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} vnetName Name of the Virtual Network. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * * @resolve {HttpOperationResponse<VnetInfo>} - The deserialized result object. * * @reject {Error} - The error object. */ getVnetFromServerFarmWithHttpOperationResponse(resourceGroupName, name, vnetName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { self._getVnetFromServerFarm(resourceGroupName, name, vnetName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } return; }); }); } /** * @summary Get a Virtual Network associated with an App Service plan. * * Get a Virtual Network associated with an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} vnetName Name of the Virtual Network. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} [optionalCallback] - The optional callback. * * @returns {function|Promise} If a callback was passed as the last parameter * then it returns the callback else returns a Promise. * * {Promise} A promise is returned * * @resolve {VnetInfo} - The deserialized result object. * * @reject {Error} - The error object. * * {function} optionalCallback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link VnetInfo} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ getVnetFromServerFarm(resourceGroupName, name, vnetName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { optionalCallback = options; options = null; } if (!optionalCallback) { return new Promise((resolve, reject) => { self._getVnetFromServerFarm(resourceGroupName, name, vnetName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { return self._getVnetFromServerFarm(resourceGroupName, name, vnetName, options, optionalCallback); } } /** * @summary Get a Virtual Network gateway. * * Get a Virtual Network gateway. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} vnetName Name of the Virtual Network. * * @param {string} gatewayName Name of the gateway. Only the 'primary' gateway * is supported. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * * @resolve {HttpOperationResponse<VnetGateway>} - The deserialized result object. * * @reject {Error} - The error object. */ getVnetGatewayWithHttpOperationResponse(resourceGroupName, name, vnetName, gatewayName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { self._getVnetGateway(resourceGroupName, name, vnetName, gatewayName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } return; }); }); } /** * @summary Get a Virtual Network gateway. * * Get a Virtual Network gateway. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} vnetName Name of the Virtual Network. * * @param {string} gatewayName Name of the gateway. Only the 'primary' gateway * is supported. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} [optionalCallback] - The optional callback. * * @returns {function|Promise} If a callback was passed as the last parameter * then it returns the callback else returns a Promise. * * {Promise} A promise is returned * * @resolve {VnetGateway} - The deserialized result object. * * @reject {Error} - The error object. * * {function} optionalCallback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link VnetGateway} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ getVnetGateway(resourceGroupName, name, vnetName, gatewayName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { optionalCallback = options; options = null; } if (!optionalCallback) { return new Promise((resolve, reject) => { self._getVnetGateway(resourceGroupName, name, vnetName, gatewayName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { return self._getVnetGateway(resourceGroupName, name, vnetName, gatewayName, options, optionalCallback); } } /** * @summary Update a Virtual Network gateway. * * Update a Virtual Network gateway. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} vnetName Name of the Virtual Network. * * @param {string} gatewayName Name of the gateway. Only the 'primary' gateway * is supported. * * @param {object} connectionEnvelope Definition of the gateway. * * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. * * @param {string} [connectionEnvelope.vpnPackageUri] The URI where the VPN * package can be downloaded. * * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * * @resolve {HttpOperationResponse<VnetGateway>} - The deserialized result object. * * @reject {Error} - The error object. */ updateVnetGatewayWithHttpOperationResponse(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { self._updateVnetGateway(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } return; }); }); } /** * @summary Update a Virtual Network gateway. * * Update a Virtual Network gateway. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} vnetName Name of the Virtual Network. * * @param {string} gatewayName Name of the gateway. Only the 'primary' gateway * is supported. * * @param {object} connectionEnvelope Definition of the gateway. * * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. * * @param {string} [connectionEnvelope.vpnPackageUri] The URI where the VPN * package can be downloaded. * * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} [optionalCallback] - The optional callback. * * @returns {function|Promise} If a callback was passed as the last parameter * then it returns the callback else returns a Promise. * * {Promise} A promise is returned * * @resolve {VnetGateway} - The deserialized result object. * * @reject {Error} - The error object. * * {function} optionalCallback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link VnetGateway} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ updateVnetGateway(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { optionalCallback = options; options = null; } if (!optionalCallback) { return new Promise((resolve, reject) => { self._updateVnetGateway(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { return self._updateVnetGateway(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, options, optionalCallback); } } /** * @summary Get all routes that are associated with a Virtual Network in an App * Service plan. * * Get all routes that are associated with a Virtual Network in an App Service * plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} vnetName Name of the Virtual Network. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * * @resolve {HttpOperationResponse<Array>} - The deserialized result object. * * @reject {Error} - The error object. */ listRoutesForVnetWithHttpOperationResponse(resourceGroupName, name, vnetName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { self._listRoutesForVnet(resourceGroupName, name, vnetName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } return; }); }); } /** * @summary Get all routes that are associated with a Virtual Network in an App * Service plan. * * Get all routes that are associated with a Virtual Network in an App Service * plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} vnetName Name of the Virtual Network. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} [optionalCallback] - The optional callback. * * @returns {function|Promise} If a callback was passed as the last parameter * then it returns the callback else returns a Promise. * * {Promise} A promise is returned * * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * * {function} optionalCallback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ listRoutesForVnet(resourceGroupName, name, vnetName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { optionalCallback = options; options = null; } if (!optionalCallback) { return new Promise((resolve, reject) => { self._listRoutesForVnet(resourceGroupName, name, vnetName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { return self._listRoutesForVnet(resourceGroupName, name, vnetName, options, optionalCallback); } } /** * @summary Get a Virtual Network route in an App Service plan. * * Get a Virtual Network route in an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} vnetName Name of the Virtual Network. * * @param {string} routeName Name of the Virtual Network route. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * * @resolve {HttpOperationResponse<Array>} - The deserialized result object. * * @reject {Error} - The error object. */ getRouteForVnetWithHttpOperationResponse(resourceGroupName, name, vnetName, routeName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { self._getRouteForVnet(resourceGroupName, name, vnetName, routeName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } return; }); }); } /** * @summary Get a Virtual Network route in an App Service plan. * * Get a Virtual Network route in an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} vnetName Name of the Virtual Network. * * @param {string} routeName Name of the Virtual Network route. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} [optionalCallback] - The optional callback. * * @returns {function|Promise} If a callback was passed as the last parameter * then it returns the callback else returns a Promise. * * {Promise} A promise is returned * * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * * {function} optionalCallback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ getRouteForVnet(resourceGroupName, name, vnetName, routeName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { optionalCallback = options; options = null; } if (!optionalCallback) { return new Promise((resolve, reject) => { self._getRouteForVnet(resourceGroupName, name, vnetName, routeName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { return self._getRouteForVnet(resourceGroupName, name, vnetName, routeName, options, optionalCallback); } } /** * @summary Create or update a Virtual Network route in an App Service plan. * * Create or update a Virtual Network route in an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} vnetName Name of the Virtual Network. * * @param {string} routeName Name of the Virtual Network route. * * @param {object} route Definition of the Virtual Network route. * * @param {string} [route.vnetRouteName] The name of this route. This is only * returned by the server and does not need to be set by the client. * * @param {string} [route.startAddress] The starting address for this route. * This may also include a CIDR notation, in which case the end address must * not be specified. * * @param {string} [route.endAddress] The ending address for this route. If the * start address is specified in CIDR notation, this must be omitted. * * @param {string} [route.routeType] The type of route this is: * DEFAULT - By default, every app has routes to the local address ranges * specified by RFC1918 * INHERITED - Routes inherited from the real Virtual Network routes * STATIC - Static route set on the app only * * These values will be used for syncing an app's routes with those from a * Virtual Network. Possible values include: 'DEFAULT', 'INHERITED', 'STATIC' * * @param {string} [route.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * * @resolve {HttpOperationResponse<VnetRoute>} - The deserialized result object. * * @reject {Error} - The error object. */ createOrUpdateVnetRouteWithHttpOperationResponse(resourceGroupName, name, vnetName, routeName, route, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { self._createOrUpdateVnetRoute(resourceGroupName, name, vnetName, routeName, route, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } return; }); }); } /** * @summary Create or update a Virtual Network route in an App Service plan. * * Create or update a Virtual Network route in an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} vnetName Name of the Virtual Network. * * @param {string} routeName Name of the Virtual Network route. * * @param {object} route Definition of the Virtual Network route. * * @param {string} [route.vnetRouteName] The name of this route. This is only * returned by the server and does not need to be set by the client. * * @param {string} [route.startAddress] The starting address for this route. * This may also include a CIDR notation, in which case the end address must * not be specified. * * @param {string} [route.endAddress] The ending address for this route. If the * start address is specified in CIDR notation, this must be omitted. * * @param {string} [route.routeType] The type of route this is: * DEFAULT - By default, every app has routes to the local address ranges * specified by RFC1918 * INHERITED - Routes inherited from the real Virtual Network routes * STATIC - Static route set on the app only * * These values will be used for syncing an app's routes with those from a * Virtual Network. Possible values include: 'DEFAULT', 'INHERITED', 'STATIC' * * @param {string} [route.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} [optionalCallback] - The optional callback. * * @returns {function|Promise} If a callback was passed as the last parameter * then it returns the callback else returns a Promise. * * {Promise} A promise is returned * * @resolve {VnetRoute} - The deserialized result object. * * @reject {Error} - The error object. * * {function} optionalCallback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link VnetRoute} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ createOrUpdateVnetRoute(resourceGroupName, name, vnetName, routeName, route, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { optionalCallback = options; options = null; } if (!optionalCallback) { return new Promise((resolve, reject) => { self._createOrUpdateVnetRoute(resourceGroupName, name, vnetName, routeName, route, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { return self._createOrUpdateVnetRoute(resourceGroupName, name, vnetName, routeName, route, options, optionalCallback); } } /** * @summary Delete a Virtual Network route in an App Service plan. * * Delete a Virtual Network route in an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} vnetName Name of the Virtual Network. * * @param {string} routeName Name of the Virtual Network route. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * * @resolve {HttpOperationResponse<null>} - The deserialized result object. * * @reject {Error} - The error object. */ deleteVnetRouteWithHttpOperationResponse(resourceGroupName, name, vnetName, routeName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { self._deleteVnetRoute(resourceGroupName, name, vnetName, routeName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } return; }); }); } /** * @summary Delete a Virtual Network route in an App Service plan. * * Delete a Virtual Network route in an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} vnetName Name of the Virtual Network. * * @param {string} routeName Name of the Virtual Network route. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} [optionalCallback] - The optional callback. * * @returns {function|Promise} If a callback was passed as the last parameter * then it returns the callback else returns a Promise. * * {Promise} A promise is returned * * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * * {function} optionalCallback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ deleteVnetRoute(resourceGroupName, name, vnetName, routeName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { optionalCallback = options; options = null; } if (!optionalCallback) { return new Promise((resolve, reject) => { self._deleteVnetRoute(resourceGroupName, name, vnetName, routeName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { return self._deleteVnetRoute(resourceGroupName, name, vnetName, routeName, options, optionalCallback); } } /** * @summary Create or update a Virtual Network route in an App Service plan. * * Create or update a Virtual Network route in an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} vnetName Name of the Virtual Network. * * @param {string} routeName Name of the Virtual Network route. * * @param {object} route Definition of the Virtual Network route. * * @param {string} [route.vnetRouteName] The name of this route. This is only * returned by the server and does not need to be set by the client. * * @param {string} [route.startAddress] The starting address for this route. * This may also include a CIDR notation, in which case the end address must * not be specified. * * @param {string} [route.endAddress] The ending address for this route. If the * start address is specified in CIDR notation, this must be omitted. * * @param {string} [route.routeType] The type of route this is: * DEFAULT - By default, every app has routes to the local address ranges * specified by RFC1918 * INHERITED - Routes inherited from the real Virtual Network routes * STATIC - Static route set on the app only * * These values will be used for syncing an app's routes with those from a * Virtual Network. Possible values include: 'DEFAULT', 'INHERITED', 'STATIC' * * @param {string} [route.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * * @resolve {HttpOperationResponse<VnetRoute>} - The deserialized result object. * * @reject {Error} - The error object. */ updateVnetRouteWithHttpOperationResponse(resourceGroupName, name, vnetName, routeName, route, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { self._updateVnetRoute(resourceGroupName, name, vnetName, routeName, route, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } return; }); }); } /** * @summary Create or update a Virtual Network route in an App Service plan. * * Create or update a Virtual Network route in an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} vnetName Name of the Virtual Network. * * @param {string} routeName Name of the Virtual Network route. * * @param {object} route Definition of the Virtual Network route. * * @param {string} [route.vnetRouteName] The name of this route. This is only * returned by the server and does not need to be set by the client. * * @param {string} [route.startAddress] The starting address for this route. * This may also include a CIDR notation, in which case the end address must * not be specified. * * @param {string} [route.endAddress] The ending address for this route. If the * start address is specified in CIDR notation, this must be omitted. * * @param {string} [route.routeType] The type of route this is: * DEFAULT - By default, every app has routes to the local address ranges * specified by RFC1918 * INHERITED - Routes inherited from the real Virtual Network routes * STATIC - Static route set on the app only * * These values will be used for syncing an app's routes with those from a * Virtual Network. Possible values include: 'DEFAULT', 'INHERITED', 'STATIC' * * @param {string} [route.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} [optionalCallback] - The optional callback. * * @returns {function|Promise} If a callback was passed as the last parameter * then it returns the callback else returns a Promise. * * {Promise} A promise is returned * * @resolve {VnetRoute} - The deserialized result object. * * @reject {Error} - The error object. * * {function} optionalCallback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link VnetRoute} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ updateVnetRoute(resourceGroupName, name, vnetName, routeName, route, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { optionalCallback = options; options = null; } if (!optionalCallback) { return new Promise((resolve, reject) => { self._updateVnetRoute(resourceGroupName, name, vnetName, routeName, route, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { return self._updateVnetRoute(resourceGroupName, name, vnetName, routeName, route, options, optionalCallback); } } /** * @summary Reboot a worker machine in an App Service plan. * * Reboot a worker machine in an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} workerName Name of worker machine, which typically starts * with RD. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * * @resolve {HttpOperationResponse<null>} - The deserialized result object. * * @reject {Error} - The error object. */ rebootWorkerWithHttpOperationResponse(resourceGroupName, name, workerName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { self._rebootWorker(resourceGroupName, name, workerName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } return; }); }); } /** * @summary Reboot a worker machine in an App Service plan. * * Reboot a worker machine in an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {string} workerName Name of worker machine, which typically starts * with RD. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} [optionalCallback] - The optional callback. * * @returns {function|Promise} If a callback was passed as the last parameter * then it returns the callback else returns a Promise. * * {Promise} A promise is returned * * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * * {function} optionalCallback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ rebootWorker(resourceGroupName, name, workerName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { optionalCallback = options; options = null; } if (!optionalCallback) { return new Promise((resolve, reject) => { self._rebootWorker(resourceGroupName, name, workerName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { return self._rebootWorker(resourceGroupName, name, workerName, options, optionalCallback); } } /** * @summary Creates or updates an App Service Plan. * * Creates or updates an App Service Plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {object} appServicePlan Details of the App Service plan. * * @param {string} [appServicePlan.appServicePlanName] Name for the App Service * plan. * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * * @param {string} [appServicePlan.adminSiteName] App Service plan * administration site. * * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for * the App Service Environment to use for the App Service plan. * * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of * the App Service Environment. * * @param {boolean} [appServicePlan.perSiteScaling] If <code>true</code>, apps * assigned to this App Service plan can be scaled independently. * If <code>false</code>, apps assigned to this App Service plan will scale to * all instances of the plan. * * @param {boolean} [appServicePlan.reserved] Reserved. * * @param {number} [appServicePlan.targetWorkerCount] Scaling worker count. * * @param {number} [appServicePlan.targetWorkerSizeId] Scaling worker size ID. * * @param {object} [appServicePlan.sku] * * @param {string} [appServicePlan.sku.name] Name of the resource SKU. * * @param {string} [appServicePlan.sku.tier] Service tier of the resource SKU. * * @param {string} [appServicePlan.sku.size] Size specifier of the resource * SKU. * * @param {string} [appServicePlan.sku.family] Family code of the resource SKU. * * @param {number} [appServicePlan.sku.capacity] Current number of instances * assigned to the resource. * * @param {object} [appServicePlan.sku.skuCapacity] Min, max, and default scale * values of the SKU. * * @param {number} [appServicePlan.sku.skuCapacity.minimum] Minimum number of * workers for this App Service plan SKU. * * @param {number} [appServicePlan.sku.skuCapacity.maximum] Maximum number of * workers for this App Service plan SKU. * * @param {number} [appServicePlan.sku.skuCapacity.default] Default number of * workers for this App Service plan SKU. * * @param {string} [appServicePlan.sku.skuCapacity.scaleType] Available scale * configurations for an App Service plan. * * @param {array} [appServicePlan.sku.locations] Locations of the SKU. * * @param {array} [appServicePlan.sku.capabilities] Capabilities of the SKU, * e.g., is traffic manager enabled? * * @param {string} [appServicePlan.kind] Kind of resource. * * @param {string} appServicePlan.location Resource Location. * * @param {object} [appServicePlan.tags] Resource tags. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * * @resolve {HttpOperationResponse<AppServicePlan>} - The deserialized result object. * * @reject {Error} - The error object. */ beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, name, appServicePlan, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { self._beginCreateOrUpdate(resourceGroupName, name, appServicePlan, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } return; }); }); } /** * @summary Creates or updates an App Service Plan. * * Creates or updates an App Service Plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service plan. * * @param {object} appServicePlan Details of the App Service plan. * * @param {string} [appServicePlan.appServicePlanName] Name for the App Service * plan. * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * * @param {string} [appServicePlan.adminSiteName] App Service plan * administration site. * * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for * the App Service Environment to use for the App Service plan. * * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of * the App Service Environment. * * @param {boolean} [appServicePlan.perSiteScaling] If <code>true</code>, apps * assigned to this App Service plan can be scaled independently. * If <code>false</code>, apps assigned to this App Service plan will scale to * all instances of the plan. * * @param {boolean} [appServicePlan.reserved] Reserved. * * @param {number} [appServicePlan.targetWorkerCount] Scaling worker count. * * @param {number} [appServicePlan.targetWorkerSizeId] Scaling worker size ID. * * @param {object} [appServicePlan.sku] * * @param {string} [appServicePlan.sku.name] Name of the resource SKU. * * @param {string} [appServicePlan.sku.tier] Service tier of the resource SKU. * * @param {string} [appServicePlan.sku.size] Size specifier of the resource * SKU. * * @param {string} [appServicePlan.sku.family] Family code of the resource SKU. * * @param {number} [appServicePlan.sku.capacity] Current number of instances * assigned to the resource. * * @param {object} [appServicePlan.sku.skuCapacity] Min, max, and default scale * values of the SKU. * * @param {number} [appServicePlan.sku.skuCapacity.minimum] Minimum number of * workers for this App Service plan SKU. * * @param {number} [appServicePlan.sku.skuCapacity.maximum] Maximum number of * workers for this App Service plan SKU. * * @param {number} [appServicePlan.sku.skuCapacity.default] Default number of * workers for this App Service plan SKU. * * @param {string} [appServicePlan.sku.skuCapacity.scaleType] Available scale * configurations for an App Service plan. * * @param {array} [appServicePlan.sku.locations] Locations of the SKU. * * @param {array} [appServicePlan.sku.capabilities] Capabilities of the SKU, * e.g., is traffic manager enabled? * * @param {string} [appServicePlan.kind] Kind of resource. * * @param {string} appServicePlan.location Resource Location. * * @param {object} [appServicePlan.tags] Resource tags. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} [optionalCallback] - The optional callback. * * @returns {function|Promise} If a callback was passed as the last parameter * then it returns the callback else returns a Promise. * * {Promise} A promise is returned * * @resolve {AppServicePlan} - The deserialized result object. * * @reject {Error} - The error object. * * {function} optionalCallback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link AppServicePlan} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ beginCreateOrUpdate(resourceGroupName, name, appServicePlan, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { optionalCallback = options; options = null; } if (!optionalCallback) { return new Promise((resolve, reject) => { self._beginCreateOrUpdate(resourceGroupName, name, appServicePlan, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { return self._beginCreateOrUpdate(resourceGroupName, name, appServicePlan, options, optionalCallback); } } /** * @summary Get all App Service plans for a subcription. * * Get all App Service plans for a subcription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * * @resolve {HttpOperationResponse<AppServicePlanCollection>} - The deserialized result object. * * @reject {Error} - The error object. */ listNextWithHttpOperationResponse(nextPageLink, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { self._listNext(nextPageLink, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } return; }); }); } /** * @summary Get all App Service plans for a subcription. * * Get all App Service plans for a subcription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} [optionalCallback] - The optional callback. * * @returns {function|Promise} If a callback was passed as the last parameter * then it returns the callback else returns a Promise. * * {Promise} A promise is returned * * @resolve {AppServicePlanCollection} - The deserialized result object. * * @reject {Error} - The error object. * * {function} optionalCallback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link AppServicePlanCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ listNext(nextPageLink, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { optionalCallback = options; options = null; } if (!optionalCallback) { return new Promise((resolve, reject) => { self._listNext(nextPageLink, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { return self._listNext(nextPageLink, options, optionalCallback); } } /** * @summary Get all App Service plans in a resource group. * * Get all App Service plans in a resource group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * * @resolve {HttpOperationResponse<AppServicePlanCollection>} - The deserialized result object. * * @reject {Error} - The error object. */ listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } return; }); }); } /** * @summary Get all App Service plans in a resource group. * * Get all App Service plans in a resource group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} [optionalCallback] - The optional callback. * * @returns {function|Promise} If a callback was passed as the last parameter * then it returns the callback else returns a Promise. * * {Promise} A promise is returned * * @resolve {AppServicePlanCollection} - The deserialized result object. * * @reject {Error} - The error object. * * {function} optionalCallback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link AppServicePlanCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ listByResourceGroupNext(nextPageLink, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { optionalCallback = options; options = null; } if (!optionalCallback) { return new Promise((resolve, reject) => { self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); } } /** * @summary Get all apps that use a Hybrid Connection in an App Service Plan. * * Get all apps that use a Hybrid Connection in an App Service Plan. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * * @resolve {HttpOperationResponse<ResourceCollection>} - The deserialized result object. * * @reject {Error} - The error object. */ listWebAppsByHybridConnectionNextWithHttpOperationResponse(nextPageLink, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { self._listWebAppsByHybridConnectionNext(nextPageLink, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } return; }); }); } /** * @summary Get all apps that use a Hybrid Connection in an App Service Plan. * * Get all apps that use a Hybrid Connection in an App Service Plan. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} [optionalCallback] - The optional callback. * * @returns {function|Promise} If a callback was passed as the last parameter * then it returns the callback else returns a Promise. * * {Promise} A promise is returned * * @resolve {ResourceCollection} - The deserialized result object. * * @reject {Error} - The error object. * * {function} optionalCallback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link ResourceCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ listWebAppsByHybridConnectionNext(nextPageLink, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { optionalCallback = options; options = null; } if (!optionalCallback) { return new Promise((resolve, reject) => { self._listWebAppsByHybridConnectionNext(nextPageLink, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { return self._listWebAppsByHybridConnectionNext(nextPageLink, options, optionalCallback); } } /** * @summary Retrieve all Hybrid Connections in use in an App Service plan. * * Retrieve all Hybrid Connections in use in an App Service plan. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * * @resolve {HttpOperationResponse<HybridConnectionCollection>} - The deserialized result object. * * @reject {Error} - The error object. */ listHybridConnectionsNextWithHttpOperationResponse(nextPageLink, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { self._listHybridConnectionsNext(nextPageLink, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } return; }); }); } /** * @summary Retrieve all Hybrid Connections in use in an App Service plan. * * Retrieve all Hybrid Connections in use in an App Service plan. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} [optionalCallback] - The optional callback. * * @returns {function|Promise} If a callback was passed as the last parameter * then it returns the callback else returns a Promise. * * {Promise} A promise is returned * * @resolve {HybridConnectionCollection} - The deserialized result object. * * @reject {Error} - The error object. * * {function} optionalCallback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link HybridConnectionCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ listHybridConnectionsNext(nextPageLink, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { optionalCallback = options; options = null; } if (!optionalCallback) { return new Promise((resolve, reject) => { self._listHybridConnectionsNext(nextPageLink, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { return self._listHybridConnectionsNext(nextPageLink, options, optionalCallback); } } /** * @summary Get metrics that can be queried for an App Service plan, and their * definitions. * * Get metrics that can be queried for an App Service plan, and their * definitions. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * * @resolve {HttpOperationResponse<ResourceMetricDefinitionCollection>} - The deserialized result object. * * @reject {Error} - The error object. */ listMetricDefintionsNextWithHttpOperationResponse(nextPageLink, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { self._listMetricDefintionsNext(nextPageLink, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } return; }); }); } /** * @summary Get metrics that can be queried for an App Service plan, and their * definitions. * * Get metrics that can be queried for an App Service plan, and their * definitions. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} [optionalCallback] - The optional callback. * * @returns {function|Promise} If a callback was passed as the last parameter * then it returns the callback else returns a Promise. * * {Promise} A promise is returned * * @resolve {ResourceMetricDefinitionCollection} - The deserialized result object. * * @reject {Error} - The error object. * * {function} optionalCallback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link ResourceMetricDefinitionCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ listMetricDefintionsNext(nextPageLink, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { optionalCallback = options; options = null; } if (!optionalCallback) { return new Promise((resolve, reject) => { self._listMetricDefintionsNext(nextPageLink, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { return self._listMetricDefintionsNext(nextPageLink, options, optionalCallback); } } /** * @summary Get metrics for an App Serice plan. * * Get metrics for an App Serice plan. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * * @resolve {HttpOperationResponse<ResourceMetricCollection>} - The deserialized result object. * * @reject {Error} - The error object. */ listMetricsNextWithHttpOperationResponse(nextPageLink, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { self._listMetricsNext(nextPageLink, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } return; }); }); } /** * @summary Get metrics for an App Serice plan. * * Get metrics for an App Serice plan. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} [optionalCallback] - The optional callback. * * @returns {function|Promise} If a callback was passed as the last parameter * then it returns the callback else returns a Promise. * * {Promise} A promise is returned * * @resolve {ResourceMetricCollection} - The deserialized result object. * * @reject {Error} - The error object. * * {function} optionalCallback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link ResourceMetricCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ listMetricsNext(nextPageLink, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { optionalCallback = options; options = null; } if (!optionalCallback) { return new Promise((resolve, reject) => { self._listMetricsNext(nextPageLink, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { return self._listMetricsNext(nextPageLink, options, optionalCallback); } } /** * @summary Get all apps associated with an App Service plan. * * Get all apps associated with an App Service plan. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * * @resolve {HttpOperationResponse<WebAppCollection>} - The deserialized result object. * * @reject {Error} - The error object. */ listWebAppsNextWithHttpOperationResponse(nextPageLink, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { self._listWebAppsNext(nextPageLink, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } return; }); }); } /** * @summary Get all apps associated with an App Service plan. * * Get all apps associated with an App Service plan. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {function} [optionalCallback] - The optional callback. * * @returns {function|Promise} If a callback was passed as the last parameter * then it returns the callback else returns a Promise. * * {Promise} A promise is returned * * @resolve {WebAppCollection} - The deserialized result object. * * @reject {Error} - The error object. * * {function} optionalCallback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. * See {@link WebAppCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ listWebAppsNext(nextPageLink, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { optionalCallback = options; options = null; } if (!optionalCallback) { return new Promise((resolve, reject) => { self._listWebAppsNext(nextPageLink, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { return self._listWebAppsNext(nextPageLink, options, optionalCallback); } } } module.exports = AppServicePlans;
40.123534
248
0.648822
6a53dbd0ce4995390b8e671ce64ce7b9a896c911
56
js
JavaScript
test/spec/server/index.js
redgeoff/couchdb-howler
74f7de7a395f5cbca9198aaa72b230f55641f25c
[ "MIT" ]
33
2017-12-20T04:00:47.000Z
2021-07-09T20:58:16.000Z
test/spec/server/index.js
redgeoff/couchdb-howler
74f7de7a395f5cbca9198aaa72b230f55641f25c
[ "MIT" ]
44
2017-12-17T20:45:44.000Z
2022-02-12T07:28:42.000Z
test/spec/server/index.js
redgeoff/couchdb-howler
74f7de7a395f5cbca9198aaa72b230f55641f25c
[ "MIT" ]
2
2020-05-24T15:11:46.000Z
2020-06-03T11:10:36.000Z
import './command' import './server' import './sockets'
14
18
0.678571
6a53ed3d28197f3d7144c6fe9acdc73e1a883d14
351
js
JavaScript
packages/website/src/components/List.js
mmatur/faency
0d75850ee359666cfa7ebe1190889f9a91fdbaf1
[ "Apache-2.0" ]
null
null
null
packages/website/src/components/List.js
mmatur/faency
0d75850ee359666cfa7ebe1190889f9a91fdbaf1
[ "Apache-2.0" ]
null
null
null
packages/website/src/components/List.js
mmatur/faency
0d75850ee359666cfa7ebe1190889f9a91fdbaf1
[ "Apache-2.0" ]
null
null
null
import React from 'react' import PropTypes from 'prop-types' import { Flex } from '@traefiklabs/faency' function List({ children, ...props }) { return ( <Flex sx={{ flexDirection: 'column' }} py={2} {...props}> {children} </Flex> ) } List.propTypes = { children: PropTypes.node, props: PropTypes.object, } export default List
18.473684
61
0.643875
6a54620af40a9218da01bae5366c8fb4fe07adcd
436
js
JavaScript
av/icon-twotone-library-books-element/template.js
AgeOfLearning/material-design-icons
b1da14a0e8a7011358bf4453c127d9459420394f
[ "Apache-2.0" ]
null
null
null
av/icon-twotone-library-books-element/template.js
AgeOfLearning/material-design-icons
b1da14a0e8a7011358bf4453c127d9459420394f
[ "Apache-2.0" ]
null
null
null
av/icon-twotone-library-books-element/template.js
AgeOfLearning/material-design-icons
b1da14a0e8a7011358bf4453c127d9459420394f
[ "Apache-2.0" ]
null
null
null
export default (context, html) => html` <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0V0z"/><path opacity=".3" d="M8 16h12V4H8v12zm2-10h8v2h-8V6zm0 3h8v2h-8V9zm0 3h4v2h-4v-2z"/><path d="M4 22h14v-2H4V6H2v14c0 1.1.9 2 2 2zM6 4v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2zm14 12H8V4h12v12zM10 9h8v2h-8zm0 3h4v2h-4zm0-6h8v2h-8z"/></svg> `;
145.333333
393
0.694954
6a549e879fced874e3d26f6ed40b977d5109d8d2
3,555
js
JavaScript
vendors/lightgallery/lib/plugins/pager/lg-pager.js
scpedicini/imageserver
4c982dee309644b48ec126b5fc7d317da7970b26
[ "MIT" ]
null
null
null
vendors/lightgallery/lib/plugins/pager/lg-pager.js
scpedicini/imageserver
4c982dee309644b48ec126b5fc7d317da7970b26
[ "MIT" ]
null
null
null
vendors/lightgallery/lib/plugins/pager/lg-pager.js
scpedicini/imageserver
4c982dee309644b48ec126b5fc7d317da7970b26
[ "MIT" ]
null
null
null
"use strict"; var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; Object.defineProperty(exports, "__esModule", { value: true }); var lg_events_1 = require("../../lg-events"); var lg_pager_settings_1 = require("./lg-pager-settings"); var Pager = /** @class */ (function () { function Pager(instance, $LG) { // get lightGallery core plugin instance this.core = instance; this.$LG = $LG; // extend module default settings with lightGallery core settings this.settings = __assign(__assign({}, lg_pager_settings_1.pagerSettings), this.core.settings); return this; } Pager.prototype.getPagerHtml = function (items) { var pagerList = ''; for (var i = 0; i < items.length; i++) { pagerList += "<span data-lg-item-id=\"" + i + "\" class=\"lg-pager-cont\"> \n <span data-lg-item-id=\"" + i + "\" class=\"lg-pager\"></span>\n <div class=\"lg-pager-thumb-cont\"><span class=\"lg-caret\"></span> <img src=\"" + items[i].thumb + "\" /></div>\n </span>"; } return pagerList; }; Pager.prototype.init = function () { var _this = this; if (!this.settings.pager) { return; } var timeout; this.core.$lgComponents.prepend('<div class="lg-pager-outer"></div>'); var $pagerOuter = this.core.outer.find('.lg-pager-outer'); $pagerOuter.html(this.getPagerHtml(this.core.galleryItems)); // @todo enable click $pagerOuter.first().on('click.lg touchend.lg', function (event) { var $target = _this.$LG(event.target); if (!$target.hasAttribute('data-lg-item-id')) { return; } var index = parseInt($target.attr('data-lg-item-id')); _this.core.slide(index, false, true, false); }); $pagerOuter.first().on('mouseover.lg', function () { clearTimeout(timeout); $pagerOuter.addClass('lg-pager-hover'); }); $pagerOuter.first().on('mouseout.lg', function () { timeout = setTimeout(function () { $pagerOuter.removeClass('lg-pager-hover'); }); }); this.core.LGel.on(lg_events_1.lGEvents.beforeSlide + ".pager", function (event) { var index = event.detail.index; _this.manageActiveClass.call(_this, index); }); this.core.LGel.on(lg_events_1.lGEvents.updateSlides + ".pager", function () { $pagerOuter.empty(); $pagerOuter.html(_this.getPagerHtml(_this.core.galleryItems)); _this.manageActiveClass(_this.core.index); }); }; Pager.prototype.manageActiveClass = function (index) { var $pagerCont = this.core.outer.find('.lg-pager-cont'); $pagerCont.removeClass('lg-pager-active'); $pagerCont.eq(index).addClass('lg-pager-active'); }; Pager.prototype.destroy = function () { this.core.outer.find('.lg-pager-outer').remove(); this.core.LGel.off('.lg.pager'); this.core.LGel.off('.pager'); }; return Pager; }()); exports.default = Pager; //# sourceMappingURL=lg-pager.js.map
43.353659
337
0.559212
6a5548771e2815ff2251c031e715722934e59401
2,915
js
JavaScript
js/simple-text-rotator.min.js
olifrost/personalisedhealthwarnings
580b9f2ad31d6c0ab5e40fe6ef461821bd567f5f
[ "MIT" ]
null
null
null
js/simple-text-rotator.min.js
olifrost/personalisedhealthwarnings
580b9f2ad31d6c0ab5e40fe6ef461821bd567f5f
[ "MIT" ]
null
null
null
js/simple-text-rotator.min.js
olifrost/personalisedhealthwarnings
580b9f2ad31d6c0ab5e40fe6ef461821bd567f5f
[ "MIT" ]
null
null
null
/* =========================================================== * jquery-simple-text-rotator.js v1 * =========================================================== * Copyright 2013 Pete Rojwongsuriya. * http://www.thepetedesign.com * * A very simple and light weight jQuery plugin that * allows you to rotate multiple text without changing * the layout * https://github.com/peachananr/simple-text-rotator * * ========================================================== */ !function($){ var timerId; var settings; var defaults = { animation: "dissolve", separator: ",", speed: 2000, repeat: true, text: null, onFinish: function () { } }; var checkStopped = function () { if (rotateStop == true) { settings.animation = ""; clearInterval(timerId); //settings.onFinish(); return false; } } function showText() { $('#namewrapper').css('display', 'inline-block'); } $.fx.step.textShadowBlur = function(fx) { checkStopped() $(fx.elem).prop('textShadowBlur', fx.now).css({textShadow: '0 0 ' + Math.floor(fx.now) + 'px black'}); }; $.fn.textrotator = function(options){ settings = $.extend({}, defaults, options); showText(); checkStopped() return this.each(function(){ checkStopped() var el = $(this) var array = []; ; var text = settings.text || el.text(); $.each(text.split(settings.separator), function(key, value) { array.push(value); }); el.text(array[0]); var index; var checkIndexOverflow = function () { index = $.inArray(el.text(), array) if ((index + 1) == array.length) { index = -1; if (settings.repeat == false) { clearInterval(timerId); settings.onFinish(); return false; } } return true; }; // animation option var rotate = function() { checkStopped() switch (settings.animation) { case 'dissolve': checkStopped(); el.animate({ textShadowBlur:20, opacity: 0 }, 500 , function() { checkIndexOverflow(); el.text(array[index + 1]).animate({ textShadowBlur:0, opacity: 1 }, 500 ); }); break; case 'fade': el.fadeOut(settings.speed, function() { checkIndexOverflow(); el.text(array[index + 1]).fadeIn(settings.speed); }); break; default: break; } }; timerId = setInterval(rotate, settings.speed); }); } }(window.jQuery);
24.090909
106
0.458319
6a558e0feae046aa5be7591c6611de02345b17c7
156
sjs
JavaScript
src/scripts/getMarketoFields.sjs
marklogic-community/eauser-geomapper
7f096f3710daf47798cbb0935b20c2284dfc09d1
[ "Apache-2.0" ]
1
2016-09-07T00:02:31.000Z
2016-09-07T00:02:31.000Z
src/scripts/getMarketoFields.sjs
marklogic/eauser-geomapper
7f096f3710daf47798cbb0935b20c2284dfc09d1
[ "Apache-2.0" ]
166
2016-07-15T21:46:13.000Z
2017-05-01T00:08:35.000Z
src/scripts/getMarketoFields.sjs
marklogic-community/eauser-geomapper
7f096f3710daf47798cbb0935b20c2284dfc09d1
[ "Apache-2.0" ]
4
2016-07-15T17:14:01.000Z
2016-07-15T17:20:30.000Z
/* global cts */ var res; try { var doc = cts.doc('/config/MarketoFields.json'); res = doc.toObject().fields; } catch(error) { res = error; } res;
11.142857
50
0.602564
6a55d5a7aa38660172f0e3b1fc94edb7567c14c4
1,338
js
JavaScript
src/routes/auth-routes.js
Saynka/proj9401
02b6e8934741cbab65bda73089dd192c6c8cb300
[ "MIT" ]
null
null
null
src/routes/auth-routes.js
Saynka/proj9401
02b6e8934741cbab65bda73089dd192c6c8cb300
[ "MIT" ]
1
2021-03-23T04:16:01.000Z
2021-03-23T04:16:01.000Z
src/routes/auth-routes.js
Saynka/proj9401
02b6e8934741cbab65bda73089dd192c6c8cb300
[ "MIT" ]
2
2021-03-23T05:51:11.000Z
2021-04-09T18:31:26.000Z
'use strict'; const express = require('express'); const path = require('path'); const User = require('../models/users.js'); const basicAuth = require('../../middleware/auth/basic-auth-mw.js'); const bearerAuth = require('../../middleware/auth/bearer-auth-mw.js'); const acl = require('../../middleware/auth/acl-mw.js'); const authRoute = express.Router(); authRoute.get('/', (request, response) => { console.log('started'); response.sendFile('/home/micgreene/codefellows/401/proj9401/public/html/sign-up.html'); }); authRoute.get('/sign-in', (request, response) => { console.log('sign in now'); response.sendFile('/home/micgreene/codefellows/401/proj9401/public/html/sign-in.html'); }); authRoute.post('/sign-up', async (req, res)=>{ let user = new User(req.body); const newUser = await user.save(); console.log('user: ', user); res.status(201).json(newUser); }) authRoute.post('/sign-in', basicAuth, (req,res)=>{ let userDetails = { details: req.user, token: req.user.token } console.log('userDetails: ', userDetails); res.status(200).json(userDetails); }); authRoute.put('/edit-user', bearerAuth, (req, res) => { }) authRoute.get('/protecc-route', bearerAuth, acl('read'), (req,res)=>{ res.status(200).send('You are signed in and have proper permissions'); }) module.exports = authRoute;
28.468085
89
0.670404
6a5630a717423c6a937f6f1645c576e14206bb58
4,770
js
JavaScript
src/components/views/bobross-sketch-view.js
yn5/kitsch-creator-5
d223e4763b99920ead45d181b7bdb63259ba4e92
[ "MIT" ]
1
2020-09-04T18:44:48.000Z
2020-09-04T18:44:48.000Z
src/components/views/bobross-sketch-view.js
yn5/kitsch-creator-5
d223e4763b99920ead45d181b7bdb63259ba4e92
[ "MIT" ]
24
2020-07-25T23:50:37.000Z
2022-02-26T12:54:43.000Z
src/components/views/bobross-sketch-view.js
yn5/kitsch-creator-5
d223e4763b99920ead45d181b7bdb63259ba4e92
[ "MIT" ]
1
2018-10-26T21:21:34.000Z
2018-10-26T21:21:34.000Z
/* eslint-disable no-param-reassign */ import React, { PureComponent } from 'react'; import P5 from 'p5'; import BobrossSketch from '../../lib/sketches/bobross'; import { SketchContainer, TextButton, Container, OutputImage, Overlay, Header, Title, Modal, } from './_styled/bobross-sketch-view.styled'; import Controls from '../controls'; function getPngDataUrl(canvas) { const pngDataUrl = canvas.childNodes?.[0]?.toDataURL('image/png'); return pngDataUrl; } function setupP5(sketchInstance, p5Sketch, width, height) { p5Sketch.setup = sketchInstance.setup(p5Sketch, width, height); p5Sketch.draw = sketchInstance.draw(p5Sketch); } function mapWithCurve(input, min, max, exponent = 2) { const curvedInput = input ** exponent; const output = curvedInput * (max - min) + min; return output; } export default class BobrossSketchView extends PureComponent { constructor() { super(); this.state = { controlsOpen: false, paused: false, pngDataUrl: null, positionXJitter: 0.004, positionYJitter: 0.01, }; this.sketch = new BobrossSketch(); } componentDidMount() { // Without the setTime .getBoundingClientRect() does not return // desired results. setTimeout(() => { const boundingClientRect = this.component.getBoundingClientRect(); // eslint-disable-next-line no-new new P5( (p5Sketch) => setupP5( this.sketch, p5Sketch, boundingClientRect.width, boundingClientRect.height ), this.component ); }, 1); } handleClickPause = () => { const { paused } = this.state; this.sketch.togglePause(); this.setState({ paused: !paused, }); }; handleClickRenderToImage = () => { if (!this.component) { return; } const pngDataUrl = getPngDataUrl(this.component); this.setState({ pngDataUrl, }); }; handleCloseOverlay = () => { this.setState({ pngDataUrl: null, }); }; handleClickClear = () => { this.sketch.clear(); }; handleClickControls = () => { this.setState({ controlsOpen: true, }); }; handleCloseControls = () => { this.setState({ controlsOpen: false, }); }; render() { const { controlsOpen, paused, pngDataUrl, positionXJitter, positionYJitter, } = this.state; const controlsConfig = [ { type: 'slider', id: 'positionXJitter', min: 1, max: 1000, value: Number(positionXJitter), onChange: (e) => { const { value } = e.target; const convertedValue = mapWithCurve(value / 1000, 0.001, 0.01, 2); this.sketch.setPositionXJitter(convertedValue); this.setState({ positionXJitter: value, }); }, }, { type: 'slider', id: 'positionYJitter', min: 1, max: 1000, value: Number(positionYJitter), onChange: (e) => { const { value } = e.target; const convertedValue = mapWithCurve(value / 1000, 0.001, 0.01, 2); this.sketch.setPositionYJitter(convertedValue); this.setState({ positionYJitter: value, }); }, }, ]; return ( <Container> <Header> <TextButton onClick={this.handleClickControls} type="button"> Show controls </TextButton> <TextButton onClick={this.handleClickPause} type="button"> {paused ? 'Play' : 'Pause'} </TextButton> <TextButton onClick={this.handleClickClear} type="button"> Clear </TextButton> <TextButton onClick={this.handleClickRenderToImage} type="button"> Render to image </TextButton> </Header> <SketchContainer ref={(comp) => { this.component = comp; }} /> {controlsOpen && ( <Modal> <TextButton onClick={this.handleCloseControls} type="button"> Close overlay </TextButton> <Controls config={controlsConfig} /> </Modal> )} {pngDataUrl && ( <Overlay> <Header> <Title> You can save the image by right clicking it and using the context menu </Title> <TextButton onClick={this.handleCloseOverlay} type="button"> Close overlay </TextButton> </Header> <OutputImage alt="Rendered output" src={pngDataUrl} /> </Overlay> )} </Container> ); } }
23.497537
76
0.550524
6f985f5ec8e9930c0885dd4d71ced8c7c2409f06
189
js
JavaScript
jspm_packages/npm/strict-uri-encode@1.1.0/index.js
jsdelivrbot/project-cms
4a203b9b0317443a92fcdc52afe00afacc2a80ad
[ "MIT" ]
null
null
null
jspm_packages/npm/strict-uri-encode@1.1.0/index.js
jsdelivrbot/project-cms
4a203b9b0317443a92fcdc52afe00afacc2a80ad
[ "MIT" ]
null
null
null
jspm_packages/npm/strict-uri-encode@1.1.0/index.js
jsdelivrbot/project-cms
4a203b9b0317443a92fcdc52afe00afacc2a80ad
[ "MIT" ]
1
2018-12-09T15:14:03.000Z
2018-12-09T15:14:03.000Z
/* */ 'use strict'; module.exports = function (str) { return encodeURIComponent(str).replace(/[!'()*]/g, function (c) { return '%' + c.charCodeAt(0).toString(16).toUpperCase(); }); };
23.625
66
0.613757
6f98cbddb990ceb458f332c50b6c997f7699cbff
1,617
js
JavaScript
src/pages/base/check23clock.js
ixiaofeiyang/-
c4381790629f7a26bad18fe6221d58d02e60313a
[ "Apache-2.0" ]
null
null
null
src/pages/base/check23clock.js
ixiaofeiyang/-
c4381790629f7a26bad18fe6221d58d02e60313a
[ "Apache-2.0" ]
null
null
null
src/pages/base/check23clock.js
ixiaofeiyang/-
c4381790629f7a26bad18fe6221d58d02e60313a
[ "Apache-2.0" ]
null
null
null
import wepy from 'wepy'; import moment from 'moment' import api from "../../config/api"; export default class Check23clockMixin extends wepy.mixin { data = { currenttime: '' } onLoad() {} async onShow() { //必须等token才去请去请求 let counter = 0; while (true) { if (wx.getStorageSync("user:token")) { break; } else { counter++; // if (counter > 60) break; console.log("in check23clock,onshow, sleep " + counter); await this.$parent.globalData.sleep(50); } } await this.getCurrentTime() //console.log('Check22clockMixin onshow'); let now = moment(this.currenttime) let clock22 = moment({ hour: 22 }) this.$parent.globalData.isShopOpen = now.isAfter(clock22) if (this.$parent.globalData.isShopOpen) { if (this.$parent.globalData.ifForceOpenShop) { } else { wx.reLaunch({ url: '/pages/user/time' }) } } } // 获取服务器的当前时间 async getCurrentTime() { let result = await this.$parent.globalData.get( `${api.server}/auth/currentTime` ); this.currenttime = this.$parent.globalData.currenttime = result.currenttime; // 服务器时间 和当前时间的差值 this.$parent.globalData.diffTime = new Date().getTime() - this.currenttime } }
32.34
84
0.486085
6f98dad83137ee552246c32ec0364b7449ce4514
9,116
js
JavaScript
dist/skylark-codemirror/mode/verilog/verilog.js
skylark-integration/skylark-codemirror
0c4b7f85db58c6f515d0525c7bad819f1c4366ec
[ "MIT" ]
null
null
null
dist/skylark-codemirror/mode/verilog/verilog.js
skylark-integration/skylark-codemirror
0c4b7f85db58c6f515d0525c7bad819f1c4366ec
[ "MIT" ]
null
null
null
dist/skylark-codemirror/mode/verilog/verilog.js
skylark-integration/skylark-codemirror
0c4b7f85db58c6f515d0525c7bad819f1c4366ec
[ "MIT" ]
null
null
null
/** * skylark-codemirror - A version of codemirror 5.45 that ported to running on skylarkjs * @author Hudaokeji, Inc. * @version v0.9.0 * @link https://github.com/skylark-integration/skylark-codemirror/ * @license MIT */ define(["../../CodeMirror"],function(e){"use strict";e.defineMode("verilog",function(t,n){var i=t.indentUnit,r=n.statementIndentUnit||i,a=n.dontAlignCalls,o=n.noIndentKeywords||[],l=n.multiLineStrings,s=n.hooks||{};function c(e){for(var t={},n=e.split(" "),i=0;i<n.length;++i)t[n[i]]=!0;return t}var d,u,f=c("accept_on alias always always_comb always_ff always_latch and assert assign assume automatic before begin bind bins binsof bit break buf bufif0 bufif1 byte case casex casez cell chandle checker class clocking cmos config const constraint context continue cover covergroup coverpoint cross deassign default defparam design disable dist do edge else end endcase endchecker endclass endclocking endconfig endfunction endgenerate endgroup endinterface endmodule endpackage endprimitive endprogram endproperty endspecify endsequence endtable endtask enum event eventually expect export extends extern final first_match for force foreach forever fork forkjoin function generate genvar global highz0 highz1 if iff ifnone ignore_bins illegal_bins implements implies import incdir include initial inout input inside instance int integer interconnect interface intersect join join_any join_none large let liblist library local localparam logic longint macromodule matches medium modport module nand negedge nettype new nexttime nmos nor noshowcancelled not notif0 notif1 null or output package packed parameter pmos posedge primitive priority program property protected pull0 pull1 pulldown pullup pulsestyle_ondetect pulsestyle_onevent pure rand randc randcase randsequence rcmos real realtime ref reg reject_on release repeat restrict return rnmos rpmos rtran rtranif0 rtranif1 s_always s_eventually s_nexttime s_until s_until_with scalared sequence shortint shortreal showcancelled signed small soft solve specify specparam static string strong strong0 strong1 struct super supply0 supply1 sync_accept_on sync_reject_on table tagged task this throughout time timeprecision timeunit tran tranif0 tranif1 tri tri0 tri1 triand trior trireg type typedef union unique unique0 unsigned until until_with untyped use uwire var vectored virtual void wait wait_order wand weak weak0 weak1 while wildcard wire with within wor xnor xor"),m=/[\+\-\*\/!~&|^%=?:]/,p=/[\[\]{}()]/,v=/\d[0-9_]*/,g=/\d*\s*'s?d\s*\d[0-9_]*/i,h=/\d*\s*'s?b\s*[xz01][xz01_]*/i,y=/\d*\s*'s?o\s*[xz0-7][xz0-7_]*/i,k=/\d*\s*'s?h\s*[0-9a-fxz?][0-9a-fxz?_]*/i,b=/(\d[\d_]*(\.\d[\d_]*)?E-?[\d_]+)|(\d[\d_]*\.\d[\d_]*)/i,w=/^((\w+)|[)}\]])/,x=/[)}\]]/,_=c("case checker class clocking config function generate interface module package primitive program property specify sequence table task"),I={};for(var z in _)I[z]="end"+z;for(var C in I.begin="end",I.casex="endcase",I.casez="endcase",I.do="while",I.fork="join;join_any;join_none",I.covergroup="endgroup",o){z=o[C];I[z]&&(I[z]=void 0)}var S=c("always always_comb always_ff always_latch assert assign assume else export for foreach forever if import initial repeat while");function j(e,t){var n,i,r=e.peek();if(s[r]&&0!=(n=s[r](e,t)))return n;if(s.tokenBase&&0!=(n=s.tokenBase(e,t)))return n;if(/[,;:\.]/.test(r))return d=e.next(),null;if(p.test(r))return d=e.next(),"bracket";if("`"==r)return e.next(),e.eatWhile(/[\w\$_]/)?"def":null;if("$"==r)return e.next(),e.eatWhile(/[\w\$_]/)?"meta":null;if("#"==r)return e.next(),e.eatWhile(/[\d_.]/),"def";if('"'==r)return e.next(),t.tokenize=(i=r,function(e,t){for(var n,r=!1,a=!1;null!=(n=e.next());){if(n==i&&!r){a=!0;break}r=!r&&"\\"==n}return(a||!r&&!l)&&(t.tokenize=j),"string"}),t.tokenize(e,t);if("/"==r){if(e.next(),e.eat("*"))return t.tokenize=E,E(e,t);if(e.eat("/"))return e.skipToEnd(),"comment";e.backUp(1)}if(e.match(b)||e.match(g)||e.match(h)||e.match(y)||e.match(k)||e.match(v)||e.match(b))return"number";if(e.eatWhile(m))return"meta";if(e.eatWhile(/[\w\$_]/)){var a=e.current();return f[a]?(I[a]&&(d="newblock"),S[a]&&(d="newstatement"),u=a,"keyword"):"variable"}return e.next(),null}function E(e,t){for(var n,i=!1;n=e.next();){if("/"==n&&i){t.tokenize=j;break}i="*"==n}return"comment"}function M(e,t,n,i,r){this.indented=e,this.column=t,this.type=n,this.align=i,this.prev=r}function $(e,t,n){var i=new M(e.indented,t,n,null,e.context);return e.context=i}function A(e){var t=e.context.type;return")"!=t&&"]"!=t&&"}"!=t||(e.indented=e.context.indented),e.context=e.context.prev}function q(e,t){if(e==t)return!0;var n=t.split(";");for(var i in n)if(e==n[i])return!0;return!1}return{electricInput:function(){var e=[];for(var t in I)if(I[t]){var n=I[t].split(";");for(var i in n)e.push(n[i])}return new RegExp("[{}()\\[\\]]|("+e.join("|")+")$")}(),startState:function(e){var t={tokenize:null,context:new M((e||0)-i,0,"top",!1),indented:0,startOfLine:!0};return s.startState&&s.startState(t),t},token:function(e,t){var n,i=t.context;if((e.sol()&&(null==i.align&&(i.align=!1),t.indented=e.indentation(),t.startOfLine=!0),s.token)&&void 0!==(n=s.token(e,t)))return n;if(e.eatSpace())return null;if(d=null,u=null,"comment"==(n=(t.tokenize||j)(e,t))||"meta"==n||"variable"==n)return n;if(null==i.align&&(i.align=!0),d==i.type)A(t);else if(";"==d&&"statement"==i.type||i.type&&q(u,i.type))for(i=A(t);i&&"statement"==i.type;)i=A(t);else if("{"==d)$(t,e.column(),"}");else if("["==d)$(t,e.column(),"]");else if("("==d)$(t,e.column(),")");else if(i&&"endcase"==i.type&&":"==d)$(t,e.column(),"statement");else if("newstatement"==d)$(t,e.column(),"statement");else if("newblock"==d)if("function"!=u||!i||"statement"!=i.type&&"endgroup"!=i.type)if("task"==u&&i&&"statement"==i.type);else{var r=I[u];$(t,e.column(),r)}else;return t.startOfLine=!1,n},indent:function(t,n){if(t.tokenize!=j&&null!=t.tokenize)return e.Pass;if(s.indent){var o=s.indent(t);if(o>=0)return o}var l=t.context,c=n&&n.charAt(0);"statement"==l.type&&"}"==c&&(l=l.prev);var d=!1,u=n.match(w);return u&&(d=q(u[0],l.type)),"statement"==l.type?l.indented+("{"==c?0:r):x.test(l.type)&&l.align&&!a?l.column+(d?0:1):")"!=l.type||d?l.indented+(d?0:i):l.indented+r},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}}),e.defineMIME("text/x-verilog",{name:"verilog"}),e.defineMIME("text/x-systemverilog",{name:"verilog"});var t={"|":"link",">":"property",$:"variable",$$:"variable","?$":"qualifier","?*":"qualifier","-":"hr","/":"property","/-":"property","@":"variable-3","@-":"variable-3","@++":"variable-3","@+=":"variable-3","@+=-":"variable-3","@--":"variable-3","@-=":"variable-3","%+":"tag","%-":"tag","%":"tag",">>":"tag","<<":"tag","<>":"tag","#":"tag","^":"attribute","^^":"attribute","^!":"attribute","*":"variable-2","**":"variable-2","\\":"keyword",'"':"comment"},n={"/":"beh-hier",">":"beh-hier","-":"phys-hier","|":"pipe","?":"when","@":"stage","\\":"keyword"},i=3,r=/^([~!@#\$%\^&\*-\+=\?\/\\\|'"<>]+)([\d\w_]*)/,a=/^[! ] /,o=/^[! ] */,l=/^\/[\/\*]/;function s(e,t,n){var r=t/i;return"tlv-"+e.tlvIndentationStyle[r]+"-"+n}e.defineMIME("text/x-tlv",{name:"verilog",hooks:{electricInput:!1,token:function(e,c){var d=void 0;if(e.sol()&&!c.tlvInBlockComment){"\\"==e.peek()&&(d="def",e.skipToEnd(),e.string.match(/\\SV/)?c.tlvCodeActive=!1:e.string.match(/\\TLV/)&&(c.tlvCodeActive=!0)),c.tlvCodeActive&&0==e.pos&&0==c.indented&&(h=e.match(o,!1))&&(c.indented=h[0].length);var u=c.indented,f=u/i;if(f<=c.tlvIndentationStyle.length){var m=e.string.length==u,p=f*i;if(p<e.string.length){var v=e.string.slice(p),g=v[0];n[g]&&(h=v.match(r))&&t[h[1]]&&(u+=i,"\\"==g&&p>0||(c.tlvIndentationStyle[f]=n[g],f++))}if(!m)for(;c.tlvIndentationStyle.length>f;)c.tlvIndentationStyle.pop()}c.tlvNextIndent=u}if(c.tlvCodeActive){var h,y=!1;if(void 0!==d)d+=" "+s(c,0,"scope-ident");else if(e.pos/i<c.tlvIndentationStyle.length&&(h=e.match(e.sol()?a:/^ /)))d="tlv-indent-"+(e.pos%2==0?"even":"odd")+" "+s(c,e.pos-i,"indent"),"!"==h[0].charAt(0)&&(d+=" tlv-alert-line-prefix"),function(e){var t;return(t=e.match(r,!1))&&t[2].length>0}(e)&&(d+=" "+s(c,e.pos,"before-scope-ident"));else if(c.tlvInBlockComment)e.match(/^.*?\*\//)?c.tlvInBlockComment=!1:e.skipToEnd(),d="comment";else if((h=e.match(l))&&!c.tlvInBlockComment)"//"==h[0]?e.skipToEnd():c.tlvInBlockComment=!0,d="comment";else if(h=e.match(r)){var k=h[1],b=h[2];t.hasOwnProperty(k)&&(b.length>0||e.eol())?(d=t[k],e.column()==c.indented&&(d+=" "+s(c,e.column(),"scope-ident"))):(e.backUp(e.current().length-1),d="tlv-default")}else e.match(/^\t+/)?d="tlv-tab":e.match(/^[\[\]{}\(\);\:]+/)?d="meta":(h=e.match(/^[mM]4([\+_])?[\w\d_]*/))?d="+"==h[1]?"tlv-m4-plus":"tlv-m4":e.match(/^ +/)?d=e.eol()?"error":"tlv-default":e.match(/^[\w\d_]+/)?d="number":(e.next(),d="tlv-default");y&&(d+=" tlv-statement")}else e.match(/^[mM]4([\w\d_]*)/)&&(d="tlv-m4");return d},indent:function(e){return 1==e.tlvCodeActive?e.tlvNextIndent:-1},startState:function(e){e.tlvIndentationStyle=[],e.tlvCodeActive=!0,e.tlvNextIndent=-1,e.tlvInBlockComment=!1}}})}); //# sourceMappingURL=../../sourcemaps/mode/verilog/verilog.js.map
911.6
8,821
0.661145
6f9924aa8982d8cdfc73c31d6e77d1007c051947
371
js
JavaScript
test/utils/inames.js
westonnelson/amp-token-contracts
066c4a9bf4f65450e49809a747af8106ada7f05b
[ "MIT" ]
55
2020-09-11T10:09:48.000Z
2022-03-12T23:55:45.000Z
test/utils/inames.js
westonnelson/amp-token-contracts
066c4a9bf4f65450e49809a747af8106ada7f05b
[ "MIT" ]
1
2021-11-19T11:47:31.000Z
2022-01-13T16:40:50.000Z
test/utils/inames.js
westonnelson/amp-token-contracts
066c4a9bf4f65450e49809a747af8106ada7f05b
[ "MIT" ]
17
2020-09-25T01:12:54.000Z
2022-01-08T17:27:07.000Z
export const ERC1820_ACCEPT_MAGIC = 'ERC1820_ACCEPT_MAGIC' export const ERC20_INTERFACE_NAME = 'ERC20Token' export const ERC777_INTERFACE_NAME = 'ERC777Token' export const AMP_INTERFACE_NAME = 'AmpToken' export const AMP_TOKENS_VALIDATOR = 'AmpTokensValidator' export const AMP_TOKENS_SENDER = 'AmpTokensSender' export const AMP_TOKENS_RECIPIENT = 'AmpTokensRecipient'
37.1
58
0.843666
6f9963673f8c616c0cc300b50aac3117a01a8449
7,969
js
JavaScript
index.js
eladnava/cachet-ap
675d43e11caaaebd544fc944c7af6f0b692cd532
[ "Apache-2.0" ]
15
2017-01-23T02:58:52.000Z
2021-02-14T18:52:07.000Z
index.js
eladnava/cachet-ap
675d43e11caaaebd544fc944c7af6f0b692cd532
[ "Apache-2.0" ]
10
2017-03-11T21:29:26.000Z
2020-05-26T15:15:03.000Z
index.js
eladnava/cachet-ap
675d43e11caaaebd544fc944c7af6f0b692cd532
[ "Apache-2.0" ]
14
2017-01-20T19:32:30.000Z
2020-05-26T12:27:07.000Z
var util = require('util'); var request = require('request'); var Promise = require('bluebird'); var statusCodes = require('./util/statusCodes'); // Internal package configuration var config = { // Supported Cachet API version apiVersion: 1, // Default timeout of 5 seconds for each request to the Cachet API timeout: 5000 }; // Package constructor function CachetAPI(options) { // Make sure the developer provided the status page URL if (!options.url) { throw new Error('Please provide your Cachet API endpoint URL to use this package.'); } // Make sure the developer provided the Cachet API key if (!options.apiKey) { throw new Error('Please provide your API key to use this package.'); } // Add trailing slash if ommitted in status page URL if (options.url.substr(-1) !== '/') { options.url += '/'; } // Append api/v1 to the URL options.url += 'api/v' + config.apiVersion; // Keep track of URL for later this.url = options.url; // Prepare extra headers to be sent with all API requests this.headers = { // Cachet API authentication header 'X-Cachet-Token': options.apiKey }; // Set timeout to value passed in or default to config.timeout this.timeout = options.timeout || config.timeout; // Use ca certificate if one is provided this.ca = options.ca || null; } CachetAPI.prototype.publishMetricPoint = function (metricPoint) { // Dirty hack var that = this; // Return a promise return new Promise(function (resolve, reject) { // No metric point provided? if (!metricPoint) { return reject(new Error('Please provide the metric point to publish.')); } // Point must be an object if (typeof metricPoint !== 'object') { return reject(new Error('Please provide the metric point as an object.')); } // Check for missing metric ID if (!metricPoint.id) { return reject(new Error('Please provide the metric ID.')); } // Check for missing metric value if (metricPoint.value === null) { return reject(new Error('Please provide the metric point value.')); } // Prepare API request var req = { method: 'POST', timeout: that.timeout, json: metricPoint, headers: that.headers, url: that.url + '/metrics/' + metricPoint.id + '/points', ca: that.ca }; // Execute request request(req, function (err, res, body) { // Handle the response accordingly handleResponse(err, res, body, reject, resolve); }); }); }; CachetAPI.prototype.reportIncident = function (incident) { // Dirty hack var that = this; // Return a promise return new Promise(function (resolve, reject) { // No incident provided? if (!incident) { return reject(new Error('Please provide the incident to report.')); } // Incident must be an object if (typeof incident !== 'object') { return reject(new Error('Please provide the incident as an object.')); } // Check for required parameters if (!incident.name || !incident.message || !incident.status || incident.visible === undefined) { return reject(new Error('Please provide the incident name, message, status, and visibility.')); } // Convert boolean values to integers incident.notify = incident.notify ? 1 : 0; incident.visible = incident.visible ? 1 : 0; try { // Attempt to convert incident status name to code incident.status = statusCodes.getIncidentStatusCode(incident.status); // Incident status provided? if (incident.component_status) { // Attempt to convert component status name to code incident.component_status = statusCodes.getComponentStatusCode(incident.component_status); } } catch (err) { // Bad status provided return reject(err); } // Prepare API request var req = { method: 'POST', timeout: that.timeout, json: incident, headers: that.headers, url: that.url + '/incidents', ca: that.ca }; // Execute request request(req, function (err, res, body) { // Handle the response accordingly handleResponse(err, res, body, reject, resolve); }); }); }; CachetAPI.prototype.deleteIncidentById = function (id) { // Dirty hack var that = this; // Return a promise return new Promise(function (resolve, reject) { // No incident id provided? if (!id) { return reject(new Error('Please provide the id of the incident to delete.')); } // Prepare API request var req = { method: 'DELETE', timeout: that.timeout, headers: that.headers, url: that.url + '/incidents/' + id, ca: that.ca }; // Execute request request(req, function (err, res, body) { // Handle the response accordingly handleResponse(err, res, body, reject, resolve); }); }); }; CachetAPI.prototype.getIncidentsByComponentId = function (id) { // Dirty hack var that = this; // Return a promise return new Promise(function (resolve, reject) { // No component ID provided? if (!id) { return reject(new Error('Please provide the component ID of the incidents to fetch.')); } // Prepare API request var req = { method: 'GET', json: true, timeout: that.timeout, headers: that.headers, url: that.url + '/incidents?component_id=' + id, ca: that.ca }; // Execute request request(req, function (err, res, body) { // Extract data object from body if it exists body = (body && body.data) ? body.data : body; // Handle the response accordingly handleResponse(err, res, body, reject, resolve); }); }); }; CachetAPI.prototype.getComponentById = function (id) { // Dirty hack var that = this; // Return a promise return new Promise(function (resolve, reject) { // No component ID provided? if (!id) { return reject(new Error('Please provide the component ID to fetch.')); } // Prepare API request var req = { method: 'GET', json: true, timeout: that.timeout, headers: that.headers, url: that.url + '/components/' + id, ca: that.ca }; // Execute request request(req, function (err, res, body) { // Extract data object from body if it exists body = (body && body.data) ? body.data : body; // Handle the response accordingly handleResponse(err, res, body, reject, resolve); }); }); }; function handleResponse(err, res, body, reject, resolve) { // Handle errors by rejecting the promise if (err) { return reject(err); } // Error(s) returned? if (body.errors) { // Stringify and reject promise return reject(new Error(util.inspect(body.errors))); } // Require 200 OK for success if (res.statusCode != 200 && res.statusCode != 204) { // Throw generic error return reject(new Error('An invalid response code was returned from the API: ' + res.statusCode)); } // Resolve promise with request body resolve(body); } // Expose the class object module.exports = CachetAPI;
29.735075
107
0.569331
6f9993400cbe4d95817866f598edbc828e80f115
1,906
js
JavaScript
src/BodyView.js
codinglovely226/Scheduler
c6cccdb350081038ef6916ef4e8358cb6e137058
[ "MIT" ]
null
null
null
src/BodyView.js
codinglovely226/Scheduler
c6cccdb350081038ef6916ef4e8358cb6e137058
[ "MIT" ]
null
null
null
src/BodyView.js
codinglovely226/Scheduler
c6cccdb350081038ef6916ef4e8358cb6e137058
[ "MIT" ]
null
null
null
import React, {Component} from 'react' import {PropTypes} from 'prop-types' class BodyView extends Component { constructor(props) { super(props); } static propTypes = { schedulerData: PropTypes.object.isRequired, } render() { const {schedulerData} = this.props; const {renderData, headers, config, behaviors, resources} = schedulerData; let cellWidth = schedulerData.getContentCellWidth(); let displayRenderData = renderData.filter(o => o.render); let tableRows = displayRenderData.map((item) => { let rowCells = headers.map((header, index) => { let key = item.slotId + '_' + header.time; let style = index === headers.length - 1 ? {} : {width: cellWidth}; if(!!header.nonWorkingTime) style = {...style, backgroundColor: config.nonWorkingTimeBodyBgColor}; if(item.fixed) style = {...style, backgroundColor: item.color, color: 'white'}; else if(item.groupOnly) style = {...style, backgroundColor: config.groupOnlySlotColor}; if(!!behaviors.getNonAgendaViewBodyCellBgColorFunc){ let cellBgColor = behaviors.getNonAgendaViewBodyCellBgColorFunc(schedulerData, item.slotId, header); if(!!cellBgColor) style = {...style, backgroundColor: cellBgColor}; } return ( <td key={key} style={style}><div></div></td> ) }); return ( <tr key={item.slotId} style={{height: item.rowHeight}}> {rowCells} </tr> ); }); return ( <tbody> {tableRows} </tbody> ); } } export default BodyView
34.035714
120
0.523085
6f99ebc02df3622b836b606a1907772663ada460
10,013
js
JavaScript
test/specs/code_manager/model/CodeModels.js
JeremyUrann/jeremyurann.github.io
143db62a27be81e488afc44f43c61964af567d6e
[ "BSD-3-Clause" ]
1
2019-05-07T17:40:46.000Z
2019-05-07T17:40:46.000Z
test/specs/code_manager/model/CodeModels.js
JeremyUrann/jeremyurann.github.io
143db62a27be81e488afc44f43c61964af567d6e
[ "BSD-3-Clause" ]
14
2018-10-15T10:08:57.000Z
2018-12-22T11:10:08.000Z
test/specs/code_manager/model/CodeModels.js
JeremyUrann/jeremyurann.github.io
143db62a27be81e488afc44f43c61964af567d6e
[ "BSD-3-Clause" ]
1
2021-02-18T00:36:59.000Z
2021-02-18T00:36:59.000Z
const CssGenerator = require('code_manager/model/CssGenerator'); const HtmlGenerator = require('code_manager/model/HtmlGenerator'); const DomComponents = require('dom_components'); const Component = require('dom_components/model/Component'); const Editor = require('editor/model/Editor'); const CssComposer = require('css_composer'); module.exports = { run() { let comp; let dcomp; let obj; let em; let cc; describe('HtmlGenerator', () => { beforeEach(() => { em = new Editor(); obj = new HtmlGenerator(); dcomp = new DomComponents(); comp = new Component( {}, { em, componentTypes: dcomp.componentTypes } ); }); afterEach(() => { obj = null; }); test('Build correctly one component', () => { expect(obj.build(comp)).toEqual(''); }); test('Build correctly empty component inside', () => { var m1 = comp.get('components').add({}); expect(obj.build(comp)).toEqual('<div></div>'); }); test('Build correctly not empty component inside', () => { var m1 = comp.get('components').add({ tagName: 'article', attributes: { 'data-test1': 'value1', 'data-test2': 'value2' } }); expect(obj.build(comp)).toEqual( '<article data-test1="value1" data-test2="value2"></article>' ); }); test('Build correctly component with classes', () => { var m1 = comp.get('components').add({ tagName: 'article', attributes: { 'data-test1': 'value1', 'data-test2': 'value2' } }); ['class1', 'class2'].forEach(item => { m1.get('classes').add({ name: item }); }); expect(obj.build(comp)).toEqual( '<article data-test1="value1" data-test2="value2" class="class1 class2"></article>' ); }); }); describe('CssGenerator', () => { let newCssComp; beforeEach(() => { em = new Editor({}); newCssComp = () => new CssComposer().init({ em }); cc = em.get('CssComposer'); obj = new CssGenerator(); dcomp = new DomComponents(); comp = new Component( {}, { em, componentTypes: dcomp.componentTypes } ); }); afterEach(() => { obj = null; }); test('Build correctly one component', () => { expect(obj.build(comp)).toEqual(''); }); test('Build correctly empty component inside', () => { var m1 = comp.get('components').add({ tagName: 'article' }); expect(obj.build(comp)).toEqual(''); }); test('Build correctly component with style inside', () => { var m1 = comp.get('components').add({ tagName: 'article', style: { prop1: 'value1', prop2: 'value2' } }); expect(obj.build(comp)).toEqual( '#' + m1.getId() + '{prop1:value1;prop2:value2;}' ); }); test('Build correctly component with class styled', () => { var m1 = comp.get('components').add({ tagName: 'article' }); var cls1 = m1.get('classes').add({ name: 'class1' }); var cssc = newCssComp(); var rule = cssc.add(cls1); rule.set('style', { prop1: 'value1', prop2: 'value2' }); expect(obj.build(comp, { cssc })).toEqual( '.class1{prop1:value1;prop2:value2;}' ); }); test('Build correctly component styled with class and state', () => { var m1 = comp.get('components').add({ tagName: 'article' }); var cls1 = m1.get('classes').add({ name: 'class1' }); var cssc = newCssComp(); var rule = cssc.add(cls1); rule.set('style', { prop1: 'value1', prop2: 'value2' }); rule.set('state', 'hover'); expect(obj.build(comp, { cssc })).toEqual( '.class1:hover{prop1:value1;prop2:value2;}' ); }); test('Build correctly with more classes', () => { var m1 = comp.get('components').add({ tagName: 'article' }); var cls1 = m1.get('classes').add({ name: 'class1' }); var cls2 = m1.get('classes').add({ name: 'class2' }); var cssc = newCssComp(); var rule = cssc.add([cls1, cls2]); rule.set('style', { prop1: 'value1', prop2: 'value2' }); expect(obj.build(comp, { cssc })).toEqual( '.class1.class2{prop1:value1;prop2:value2;}' ); }); test('Build rules with mixed classes', () => { var m1 = comp.get('components').add({ tagName: 'article' }); var cls1 = m1.get('classes').add({ name: 'class1' }); var cls2 = m1.get('classes').add({ name: 'class2' }); var cssc = newCssComp(); var rule = cssc.add([cls1, cls2]); rule.set('style', { prop1: 'value1', prop2: 'value2' }); rule.set('selectorsAdd', '.class1 .class2, div > .class4'); expect(obj.build(comp, { cssc })).toEqual( '.class1.class2, .class1 .class2, div > .class4{prop1:value1;prop2:value2;}' ); }); test('Build rules with only not class based selectors', () => { var cssc = newCssComp(); var rule = cssc.add([]); rule.set('style', { prop1: 'value1', prop2: 'value2' }); rule.set('selectorsAdd', '.class1 .class2, div > .class4'); expect(obj.build(comp, { cssc })).toEqual( '.class1 .class2, div > .class4{prop1:value1;prop2:value2;}' ); }); test('Build correctly with class styled out', () => { var m1 = comp.get('components').add({ tagName: 'article' }); var cls1 = m1.get('classes').add({ name: 'class1' }); var cls2 = m1.get('classes').add({ name: 'class2' }); var cssc = newCssComp(); var rule = cssc.add([cls1, cls2]); rule.set('style', { prop1: 'value1' }); var rule2 = cssc.add(cls2); rule2.set('style', { prop2: 'value2' }); expect(obj.build(comp, { cssc })).toEqual( '.class1.class2{prop1:value1;}.class2{prop2:value2;}' ); }); test('Rule with media query', () => { var m1 = comp.get('components').add({ tagName: 'article' }); var cls1 = m1.get('classes').add({ name: 'class1' }); var cls2 = m1.get('classes').add({ name: 'class2' }); var cssc = newCssComp(); var rule = cssc.add([cls1, cls2]); rule.set('style', { prop1: 'value1' }); rule.set('mediaText', '(max-width: 999px)'); expect(obj.build(comp, { cssc })).toEqual( '@media (max-width: 999px){.class1.class2{prop1:value1;}}' ); }); test('Rules mixed with media queries', () => { var m1 = comp.get('components').add({ tagName: 'article' }); var cls1 = m1.get('classes').add({ name: 'class1' }); var cls2 = m1.get('classes').add({ name: 'class2' }); var cssc = newCssComp(); var rule = cssc.add([cls1, cls2]); rule.set('style', { prop1: 'value1' }); var rule2 = cssc.add(cls2); rule2.set('style', { prop2: 'value2' }); var rule3 = cssc.add(cls1, '', '(max-width: 999px)'); rule3.set('style', { prop3: 'value3' }); var rule4 = cssc.add(cls2, '', '(max-width: 999px)'); rule4.set('style', { prop4: 'value4' }); var rule5 = cssc.add(cls1, '', '(max-width: 100px)'); rule5.set('style', { prop5: 'value5' }); expect(obj.build(comp, { cssc })).toEqual( '.class1.class2{prop1:value1;}.class2{prop2:value2;}' + '@media (max-width: 999px){.class1{prop3:value3;}.class2{prop4:value4;}}' + '@media (max-width: 100px){.class1{prop5:value5;}}' ); }); test('Avoid useless code', () => { var m1 = comp.get('components').add({ tagName: 'article' }); var cls1 = m1.get('classes').add({ name: 'class1' }); var cssc = newCssComp(); var rule = cssc.add(cls1); rule.set('style', { prop1: 'value1', prop2: 'value2' }); comp.get('components').remove(m1); expect(obj.build(comp, { cssc })).toEqual(''); }); test('Render correctly a rule without avoidInlineStyle option', () => { comp.setStyle({ color: 'red' }); const id = comp.getId(); const result = `#${id}{color:red;}`; expect(obj.build(comp, { cssc: cc })).toEqual(result); }); test('Render correctly a rule with avoidInlineStyle option', () => { em.getConfig().avoidInlineStyle = 1; comp = new Component( {}, { em, componentTypes: dcomp.componentTypes } ); comp.setStyle({ color: 'red' }); const id = comp.getId(); const result = `#${id}{color:red;}`; expect(obj.build(comp, { cssc: cc, em })).toEqual(result); }); test('Render correctly a rule with avoidInlineStyle and state', () => { em.getConfig().avoidInlineStyle = 1; const state = 'hover'; comp.config.avoidInlineStyle = 1; comp.set('state', state); comp.setStyle({ color: 'red' }); const id = comp.getId(); const result = `#${id}:${state}{color:red;}`; expect(obj.build(comp, { cssc: cc, em })).toEqual(result); }); test('Render correctly a rule with avoidInlineStyle and w/o state', () => { em.getConfig().avoidInlineStyle = 1; const state = 'hover'; comp.config.avoidInlineStyle = 1; comp.setStyle({ color: 'blue' }); comp.set('state', state); comp.setStyle({ color: 'red' }); const id = comp.getId(); const result = `#${id}{color:blue;}#${id}:${state}{color:red;}`; expect(obj.build(comp, { cssc: cc, em })).toEqual(result); }); }); } };
33.155629
93
0.516129
6f9a4ab90e4246a085073149fec8fa7031cf9855
1,003,722
js
JavaScript
1_files/site.min.js
XMockInterview/frontend
174607c8fc23ccb94e49daf2c47a3593a5f87022
[ "MIT" ]
null
null
null
1_files/site.min.js
XMockInterview/frontend
174607c8fc23ccb94e49daf2c47a3593a5f87022
[ "MIT" ]
null
null
null
1_files/site.min.js
XMockInterview/frontend
174607c8fc23ccb94e49daf2c47a3593a5f87022
[ "MIT" ]
null
null
null
/*! LAB.js (LABjs :: Loading And Blocking JavaScript) v2.0.3 (c) Kyle Simpson MIT License */ (function(r,h){var v=r.$LAB,k="UseLocalXHR",q="AlwaysPreserveOrder",n="AllowDuplicates",m="CacheBust",l="Debug",e="BasePath",s=/^[^?#]*\//.exec(location.href)[0],C=/^\w+\:\/\/\/?[^\/]+/.exec(s)[0],f=document.head||document.getElementsByTagName("head"),i=(r.opera&&Object.prototype.toString.call(r.opera)=="[object Opera]")||("MozAppearance" in document.documentElement.style),c=function(){},o=c,A=document.createElement("script"),a=typeof A.preload=="boolean",x=a||(A.readyState&&A.readyState=="uninitialized"),y=!x&&A.async===true,z=!x&&!y&&!i;if(r.console&&r.console.log){if(!r.console.error){r.console.error=r.console.log}c=function(D){r.console.log(D)};o=function(E,D){r.console.error(E,D)}}function u(D){return Object.prototype.toString.call(D)=="[object Function]"}function B(D){return Object.prototype.toString.call(D)=="[object Array]"}function g(F,E){var D=/^\w+\:\/\//;if(/^\/\/\/?/.test(F)){F=location.protocol+F}else{if(!D.test(F)&&F.charAt(0)!="/"){F=(E||"")+F}}return D.test(F)?F:((F.charAt(0)=="/"?C:s)+F)}function j(E,F){for(var D in E){if(E.hasOwnProperty(D)){F[D]=E[D]}}return F}function b(E){var F=false;for(var D=0;D<E.scripts.length;D++){if(E.scripts[D].ready&&E.scripts[D].exec_trigger){F=true;E.scripts[D].exec_trigger();E.scripts[D].exec_trigger=null}}return F}function d(F,E,D,G){F.onload=F.onreadystatechange=function(){if((F.readyState&&F.readyState!="complete"&&F.readyState!="loaded")||E[D]){return}F.onload=F.onreadystatechange=null;G()}}function w(D){D.ready=D.finished=true;for(var E=0;E<D.finished_listeners.length;E++){D.finished_listeners[E]()}D.ready_listeners=[];D.finished_listeners=[]}function t(F,G,E,H,D){setTimeout(function(){var I,K=G.real_src,J;if("item" in f){if(!f[0]){setTimeout(arguments.callee,25);return}f=f[0]}I=document.createElement("script");if(G.type){I.type=G.type}if(G.charset){I.charset=G.charset}if(D){if(x){if(F[l]){c("start script preload: "+K)}E.elem=I;if(a){I.preload=true;I.onpreload=H}else{I.onreadystatechange=function(){if(I.readyState=="loaded"){H()}}}I.src=K}else{if(D&&K.indexOf(C)==0&&F[k]){J=new XMLHttpRequest();if(F[l]){c("start script preload (xhr): "+K)}J.onreadystatechange=function(){if(J.readyState==4){J.onreadystatechange=function(){};E.text=J.responseText+"\n//@ sourceURL="+K;H()}};J.open("GET",K);J.send()}else{if(F[l]){c("start script preload (cache): "+K)}I.type="text/cache-script";d(I,E,"ready",function(){f.removeChild(I);H()});I.src=K;f.insertBefore(I,f.firstChild)}}}else{if(y){if(F[l]){c("start script load (ordered async): "+K)}I.async=false;d(I,E,"finished",H);I.src=K;f.insertBefore(I,f.firstChild)}else{if(F[l]){c("start script load: "+K)}d(I,E,"finished",H);I.src=K;f.insertBefore(I,f.firstChild)}}},0)}function p(){var F={},K=x||z,D=[],E={},H;F[k]=true;F[q]=false;F[n]=false;F[m]=false;F[l]=false;F[e]="";function J(N,P,M){var L;function O(){if(L!=null){L=null;w(M)}}if(E[P.src].finished){return}if(!N[n]){E[P.src].finished=true}L=M.elem||document.createElement("script");if(P.type){L.type=P.type}if(P.charset){L.charset=P.charset}d(L,M,"finished",O);if(M.elem){M.elem=null}else{if(M.text){L.onload=L.onreadystatechange=null;L.text=M.text}else{L.src=P.real_src}}f.insertBefore(L,f.firstChild);if(M.text){O()}}function G(N,R,Q,L){var M,P,O=function(){R.ready_cb(R,function(){J(N,R,M)})},S=function(){R.finished_cb(R,Q)};R.src=g(R.src,N[e]);R.real_src=R.src+(N[m]?((/\?.*$/.test(R.src)?"&_":"?_")+~~(Math.random()*1000000000)+"="):"");if(!E[R.src]){E[R.src]={items:[],finished:false}}P=E[R.src].items;if(N[n]||P.length==0){M=P[P.length]={ready:false,finished:false,ready_listeners:[O],finished_listeners:[S]};t(N,R,M,((L)?function(){M.ready=true;for(var T=0;T<M.ready_listeners.length;T++){M.ready_listeners[T]()}M.ready_listeners=[]}:function(){w(M)}),L)}else{M=P[0];if(M.finished){S()}else{M.finished_listeners.push(S)}}}function I(){var O,S=j(F,{}),L=[],N=0,P=false,R;function U(W,V){if(S[l]){c("script preload finished: "+W.real_src)}W.ready=true;W.exec_trigger=V;M()}function T(X,W){if(S[l]){c("script execution finished: "+X.real_src)}X.ready=X.finished=true;X.exec_trigger=null;for(var V=0;V<W.scripts.length;V++){if(!W.scripts[V].finished){return}}W.finished=true;M()}function M(){while(N<L.length){if(u(L[N])){if(S[l]){c("$LAB.wait() executing: "+L[N])}try{L[N++]()}catch(V){if(S[l]){o("$LAB.wait() error caught: ",V)}}continue}else{if(!L[N].finished){if(b(L[N])){continue}break}}N++}if(N==L.length){P=false;R=false}}function Q(){if(!R||!R.scripts){L.push(R={scripts:[],finished:true})}}O={script:function(){for(var V=0;V<arguments.length;V++){(function(Z,X){var Y;if(!B(Z)){X=[Z]}for(var W=0;W<X.length;W++){Q();Z=X[W];if(u(Z)){Z=Z()}if(!Z){continue}if(B(Z)){Y=[].slice.call(Z);Y.unshift(W,1);[].splice.apply(X,Y);W--;continue}if(typeof Z=="string"){Z={src:Z}}Z=j(Z,{ready:false,ready_cb:U,finished:false,finished_cb:T});R.finished=false;R.scripts.push(Z);G(S,Z,R,(K&&P));P=true;if(S[q]){O.wait()}}})(arguments[V],arguments[V])}return O},wait:function(){if(arguments.length>0){for(var V=0;V<arguments.length;V++){L.push(arguments[V])}R=L[L.length-1]}else{R=false}M();return O}};return{script:O.script,wait:O.wait,setOptions:function(V){j(V,S);return O}}}H={setGlobalDefaults:function(L){j(L,F);return H},setOptions:function(){return I().setOptions.apply(null,arguments)},script:function(){return I().script.apply(null,arguments)},wait:function(){return I().wait.apply(null,arguments)},queueScript:function(){D[D.length]={type:"script",args:[].slice.call(arguments)};return H},queueWait:function(){D[D.length]={type:"wait",args:[].slice.call(arguments)};return H},runQueue:function(){var N=H,L=D.length,M=L,O;for(;--M>=0;){O=D.shift();N=N[O.type].apply(null,O.args)}return N},noConflict:function(){r.$LAB=v;return H},sandbox:function(){return p()}};return H}r.$LAB=p();(function(F,D,E){if(document.readyState==null&&document[F]){document.readyState="loading";document[F](D,E=function(){document.removeEventListener(D,E,false);document.readyState="complete"},false)}})("addEventListener","DOMContentLoaded")})(this); /*! * Site.js * URL:http://www.faisco.com * Only for Guest mode * Sort as * Utils/ModuleFunction/Other Global InitFunction * Sort time @2011-10-22 * Partition time @2012-05-16 */ if(typeof Site=="undefined"){Site={}}Site.genAjaxUrl=function(b){var a="";if(document.location.pathname.indexOf("/manage/")>=0){a="../ajax/"}else{a="ajax/"}return a+b};Site.showMenu=function(n){var r=n.id;if(Fai.isNull(r)){r=""}var p=n.host;var m=0;if(!Fai.isNull(n.mode)){m=n.mode}if(Fai.isNull(n.fixpos)){n.fixpos=true}var k=n.rulerObj;var f=n.navSysClass;if(Fai.isNull(f)){f=""}var e=0;if(!Fai.isNull(n.closeMode)){e=n.closeMode}var j=0;var q=0;if(m==1){j=p.offset().left+p.width();q=p.offset().top}else{j=p.offset().left;q=p.offset().top+p.height()}var c=$("#g_menu"+r);if(c.length!=0){if(e==0){c.attr("_mouseIn",1);return c}else{c.attr("_mouseIn",0);Site.hideMenu();return null}}$(".g_menu").each(function(){$(this).remove()});var B=n.data;if(n.data==null||n.data==""){return null}c=$("<div id='g_menu"+r+"' tabindex='0' hidefocus='true' class='g_menu "+n.cls+" "+(n.clsIndex?n.cls+"Index"+n.clsIndex:"")+" "+f+"' style='display:block;outline:none;'></div>");if(typeof n.container==="string"){var l=$("#g_menu"+r+"Container");if(l.length<1){l=$(n.container);l.attr("id","g_menu"+r+"Container")}l.appendTo($("body"));c.appendTo(l)}else{c.appendTo($("body"))}var u=$("<div class='content contentLayer1'></div>");u.appendTo(c);Site.addMenuItem(B,u,n);if(n.fixpos){if(q+c.height()+20>$(document).height()){q=p.offset().top-c.height()}}c.css("left",j-Fai.getCssInt(u,"border-left-width")+"px");c.css("top",q+"px");if(e==0){c.mouseleave(function(){c.attr("_mouseIn",0);setTimeout(function(){Site.hideMenu()},100)});c.mouseover(function(){c.attr("_mouseIn",1)});c.click(function(){c.attr("_mouseIn",0);Site.hideMenu()});p.mouseleave(function(){c.attr("_mouseIn",0);setTimeout(function(){Site.hideMenu()},100)});p.mouseover(function(){c.attr("_mouseIn",1)})}else{p.mousedown(function(){c.attr("_mouseIn",2)});c.bind("blur",function(){if(c.attr("_mouseIn")!=2){c.attr("_mouseIn",0);setTimeout(function(){Site.hideMenu()},100)}});c.focus()}if(typeof Site.g_bindMenuMousewheel=="undefined"){Site.g_bindMenuMousewheel=1;$("body").bind("mousewheel",function(){$("#g_menu").remove()})}c.attr("_mouseIn",1);c.slideDown(200);Site.calcMenuSize(c,n);var s=$("#g_menu"+r+">div.content>table>tbody>tr>td.center>table.item");var w=$("#g_menu"+r);var C=(w.outerWidth()-w.width())+(w.find(".content").outerWidth()-w.find(".content").width())+(w.find(".content .middle").outerWidth()-w.find(".content .middle").width())+(w.find(".content .middle .left").outerWidth()-w.find(".content .middle .right").outerWidth())+(w.find(".content .middle .center").outerWidth()-w.find(".content .middle .center").width());var a=s.first().css("clear");var b=s.first().outerWidth();var i=s.length;if(a=="none"){if(i>1&&b>0){var y=b*i;var v=document.documentElement.clientWidth;var t=w.offset().left;var h=w.offset().right;var A=w.width();var d=p.offset().left;var g=k.outerWidth();var x=k.offset().left;var o=x+g;if(d>v/2){if(y<v&&y>v/2){var z=o-y;w.offset({left:z-C});w.find(".content>.middle").width("100%")}if(y<v&&y<v/2&&(o-t)<y){var z=o-y;w.offset({left:z-C});w.find(".content>.middle").width("100%")}if(y>v){if(v<A){w.offset({left:0});w.find(".content>.middle").width("100%")}else{w.offset({left:x});w.find(".content>.middle").width("100%")}}}else{if(y<v&&(v-d)<y){var z=v-y;w.offset({left:z-C});w.find(".content>.middle").width("100%")}if(y<v&&(o-t)<y){var z=o-y;w.offset({left:z-C});w.find(".content>.middle").width("100%")}if(y>v){if(v<A){w.offset({left:0});w.find(".content>.middle").width("100%")}else{w.offset({left:x});w.find(".content>.middle").width("100%")}}}}}return c};Site.addMenuItem=function(x,b,m,h){if(x.length<=0){return}h=h||"outMenu";var e=["<table class='top "+h+"Top' cellpadding='0' cellspacing='0'><tr><td class='left'></td><td class='center'></td><td class='right'></td></tr></table>","<table class='middle "+h+"Middle' cellpadding='0' cellspacing='0'><tr><td class='left'></div></td><td class='center'><div class='"+h+"Triangle'></td><td class='right'></td></tr></table>","<table class='bottom "+h+"Bottom' cellpadding='0' cellspacing='0'><tr><td class='left'></td><td class='center'></td><td class='right'></td></tr></table>"];var q=$(e.join(""));q.appendTo(b);q=q.parent().find(".middle .center");for(var r=0;r<x.length;++r){var u=x[r];var g=u.sub;var s=u.href;var y=u.onclick;var w=u.target;var f=u.disable;var d="";if(!s&&!y){s="";y=""}else{if(!s){s=" href='javascript:;'"}else{if(f&&typeof(g)!="undefined"){if(g!=""){s=""}else{s=' href="'+s+'" style="cursor:pointer;"'}}else{s=' href="'+s+'" style="cursor:pointer;"'}}if(!y){y=""}else{y=' onclick="'+y+'"'}if(!w){w=""}}var o=parseInt(Math.random()*100000);var k=[];var v=r+1;k.push("<table class='item itemIndex"+v+"' itemId='");k.push(o);k.push("' cellpadding='0' cellspacing='0'><tr><td class='itemLeft'></td><td class='itemCenter'><a hidefocus='true' ");k.push(s);k.push(y);k.push(w);if(u.title){k.push(" title='"+u.title+"'")}k.push(">"+u.html+"</a></td><td class='itemRight'></td></tr></table>");var n=$(k.join(""));if(g){n.addClass("itemPopup")}if(q.find(" > .subMenu").length>=1){n.insertBefore(q.find(" > .subMenu").first())}else{n.appendTo(q)}if(g){if(g.length==0){}var p=$("<div class='subMenu' itemId='"+o+"'><div class='content contentLayer2'></div></div>");p.appendTo(q);var a=p.find(" > .content");Site.addMenuItem(g,a,m,"thirdMenu");p.mouseleave(function(){$(this).attr("_mouseIn",0);setTimeout(function(){Site.hideSubMenu()},100);if(m.navBar==true&&Fai.isIE()){var A=$("#g_menu"+m.id);var C=A.find(".contentLayer1");var i=C.outerHeight(true);var B=C.outerWidth(true);var z=C.children(".middle").first().outerWidth(true);A.css({width:B+"px",height:i+"px"});C.css({width:z+"px"})}});p.mouseover(function(){$(this).attr("_mouseIn",1)});p.click(function(){$(this).attr("_mouseIn",0);Site.hideSubMenu()})}n.hover(c,l).click(j);if(m.closeMode==1){n.mousedown(t)}function t(){$(".g_menu").attr("_mouseIn",2)}function j(){$(".g_menu").attr("_mouseIn",0);setTimeout(function(){Site.hideMenu()},100)}function l(){var i=$(this);var z=null;$(this).parent().find(" > .subMenu").each(function(){if($(this).attr("itemId")==i.attr("itemId")){z=$(this)}});if(z!=null&&z.length==1){z.attr("_mouseIn",0);setTimeout(function(){Site.hideSubMenu()},100)}else{i.removeClass("itemHover");i.removeClass("itemHoverIndex"+(i.index()+1))}}function c(){var E=$(this);var O=null;$(this).parent().find(" > .subMenu").each(function(Q,P){if($(this).attr("itemId")==E.attr("itemId")){O=$(this)}});if(O!=null&&O.length==1){if(O.css("display")=="none"){if(O.attr("_hadShow")!=1){var z=E.position().left+E.outerWidth();var J=E.position().top;if(m.fixpos){var K=E.offset().top+O.height()+20-$(document).height();if(K>0){J=J-K}}O.css("left",z+"px");O.css("top",J+"px");O.slideDown(200);Site.calcMenuSize(O,m);O.attr("_hadShow",1)}else{O.slideDown(200)}if(Fai.isIE()){$(".navSubMenu .g_menu").css("border","none")}}O.attr("_mouseIn",1);if(m.navBar==true&&Fai.isIE()){var i=$("#g_menu"+m.id);var C=i.find(".contentLayer1");var A=O.find(".contentLayer2");var N=C.outerHeight(true);var I=C.outerWidth(true);var H=C.children(".middle").first().outerWidth(true);var M=A.outerHeight(true);var B=A.outerWidth(true);var L=O.position().top;var D=(M+L)-N;var G=D>0?(N+D):N;var F=I+B;i.css({width:F+"px",height:G+"px"});C.css({width:H+"px"})}}else{if($(this).parents(".subMenu").length<=0){if(m.navBar==true&&Fai.isIE()){var i=$("#g_menu"+m.id);var C=i.find(".contentLayer1");var H=C.children(".middle").first().outerWidth(true);var G=C.outerHeight(true);var F=C.outerWidth(true);i.css({width:F+"px",height:G+"px"});C.css({width:H+"px"})}}}E.addClass("itemHover");E.addClass("itemHoverIndex"+(E.index()+1));$(".g_menu").attr("_mouseIn",1)}}};Site.calcMenuSize=function(a,d){a.find(" > .content").each(function(){var l=0;var k=$(" > .middle",this);if(!Fai.isNull(d.minWidth)){l=d.minWidth-Fai.getCssInt(k.find(".left").first(),"width")-Fai.getCssInt(k.find(".right").first(),"width")}var m=l;var j=k.find(" > tbody > tr > .center > .item");j.each(function(){if($(this).width()>l){m=$(this).outerWidth();l=$(this).width()}});j.width(m);j.find(" > tbody > tr > .itemCenter").each(function(){var q=$(this);var n=q.parent().find(" > .itemLeft");var o=q.parent().find(" > .itemRight");q.css("width",(l-n.outerWidth()-o.outerWidth()-q.outerWidth()+q.width())+"px");var p=q.find("a");p.css("width",(q.width()-p.outerWidth()+p.width())+"px")});$(" > .top",this).width(k.width());$(" > .bottom",this).width(k.width())});var c=Fai.top.$(".outMenuTriangle"),b=(c.outerWidth()||0),g=c.length>0,h=d.host,f=h.outerWidth(),e=Fai.top.$(".outMenuMiddle").width(),i=0;i=(Math.min(f,e)-b)/2;if(g&&b){c.css("left",i)}};Site.hideMenu=function(){if(Fai.top._uiMode){return}$(".g_menu").each(function(){var a=$(this);if(a.length!=1){return}if(a.attr("_mouseIn")==1){return}a.remove()})};Site.hideSubMenu=function(){if(Fai.top._uiMode){return}var a=false;$(".g_menu .subMenu").each(function(){var b=$(this);if(b.length!=1){return}if(b.attr("_mouseIn")==1){a=true;return}b.css("display","none");b.parent().find(" > .item").each(function(){if($(this).attr("itemId")==b.attr("itemId")){$(this).removeClass("itemHover")}})});if(Fai.isIE()&&!a){$(".navSubMenu .g_menu").css("border","")}};Site.popupWindow=function(a){var b=true;if(!Fai.isNull(a.saveBeforePopup)){b=a.saveBeforePopup}if(Fai.top.Site&&Fai.top.Site.hasPopupModuleOpen&&Fai.top.Site.hasPopupModuleOpen()){b=false}if(b&&Site.checkSaveBar(a)){return}if($.isFunction(Site.removeAllEditLayer)){Site.removeAllEditLayer()}if(a.version==2){return Fai.popupWindowVersionTwo.createPopupWindow(a)}else{return Fai.popupWindow(a)}};Site.total=function(c){var g={colId:-1,pdId:-1,ndId:-1};var d=$.extend({},g,c);if(d.colId==null||d.colId==""||d.colId<0){d.colId=-1}if(d.pdId==null||d.pdId==""||d.pdId<0){d.pdId=-1}if(d.ndId==null||d.ndId==""||d.ndId<0){d.ndId=-1}var a="",b=navigator.userAgent;if(!b.match(/AppleWebKit.*Mobile.*/)&&!Fai.isIpad()){a="pc"}else{if(Fai.isIpad()){a="ipad"}else{if(Fai.isAndroid()){a="android"}else{if(Fai.isIphone()){a="iphone"}else{a="other"}}}}var e="ajax/statistics_h.jsp?cmd=visited";var f=[];f.push("&colId="+d.colId);f.push("&pdId="+d.pdId);f.push("&ndId="+d.ndId);f.push("&browserType="+Fai.getBrowserType());f.push("&screenType="+Fai.getScreenType(Fai.Screen().width,Fai.Screen().height));f.push("&sc="+d.sc);f.push("&rf="+Fai.encodeUrl(d.rf));f.push("&visitUrl="+Fai.encodeUrl(document.location.href));f.push("&visitEquipment="+a);f.push("&statId="+statId);$.ajax({url:e,type:"post",cache:false,data:f.join(""),success:function(h){}})};Site.sendBrowerInfo=function(a){var b=0;if(a){b=200104}else{b=200105}if(Fai.isChrome()){Site.logDog(b,1)}else{if(Fai.isIE11()){Site.logDog(b,2)}else{if(Fai.isMozilla()){Site.logDog(b,3)}else{if(Fai.isSafari()){Site.logDog(b,4)}else{if(Fai.isIE9()){Site.logDog(b,5)}else{if(Fai.isIE10()){Site.logDog(b,6)}else{if(Fai.isOpera()){Site.logDog(b,7)}else{if(Fai.isIE7()){Site.logDog(b,8)}else{if(Fai.isIE8()){Site.logDog(b,9)}else{if(Fai.isAppleWebKit()){Site.logDog(b,10)}else{if(Fai.isIE6()){Site.logDog(b,12)}else{Site.logDog(b,11)}}}}}}}}}}}};Site.siteStatVisitTime=function(){var a="ajax/statistics_h.jsp?cmd=visitTime";var b=[];$.ajax({url:a,type:"post",cache:false,data:b.join(""),success:function(c){}})};Site.report=function(a){setTimeout(function(){if(window.performance){var d=performance.timing;var l=d.fetchStart-d.navigationStart;var g=d.redirectEnd-d.redirectStart;var i=d.domainLookupStart-d.fetchStart;var m=d.unloadEventEnd-d.unloadEventStart;var b=d.domainLookupEnd-d.domainLookupStart;var e=d.connectEnd-d.connectStart;var f=d.responseEnd-d.requestStart;var n=d.domInteractive-d.responseEnd;var o=d.domComplete-d.domInteractive;var k=d.loadEventEnd-d.loadEventStart;var h=d.loadEventEnd-d.navigationStart;var j=[];j.push("&dt="+b);j.push("&ct="+e);j.push("&rt="+f);j.push("&wt="+n);j.push("&pt="+o);j.push("&bt="+Fai.getBrowserType());var c="ajax/statistics_h.jsp?cmd=report";$.ajax({url:c,type:"post",cache:false,data:j.join(""),success:function(p){}})}},500)};Site.fileUpload2=function(c,b,d){Site.logDog(200187,1);var a=Site.fileUploadExtend(b,d);if(c){$(c).unbind("click").bind("click",function(){Site.popupWindow(Site.fileUploadExtend(b,d))})}else{Site.popupWindow(a)}};Site.fileUploadExtend=function(c,e){var d={title:"添加文件",showTitle:true,checkSaveBar:false,crossiframe:"",type:[],maxSize:1,maxUploadList:1,maxChoiceList:1,imgMode:2,imgMaxWidth:4096,imgMaxHeight:4096,netFileMode:false,popUpWinZIndex:0};if(c){$.extend(d,c)}if(d.title==="添加图片"&&d.maxSize>5){d.maxSize=5}if(Fai.top._siteVer!="undefined"&&Fai.top._siteVer==10){d.maxSize=1}var b=d.title;if(d.type.length>0&&d.showTitle){if(Fai.top._siteVer!="undefined"&&Fai.top._siteVer==10){b+="<span style='font-size:12px; color:#666;'> (&nbsp;只能添加"+d.type.join(",")+", 免费版大小不超过"+d.maxSize+"MB&nbsp;)</span>"}else{b+="<span style='font-size:12px; color:#666;'> (&nbsp;只能添加"+d.type.join(",")+", 大小不超过"+d.maxSize+"MB&nbsp;)</span>"}}else{b+="<span style='font-size:12px; color:#666;'> (&nbsp;上传大小不超过"+d.maxSize+"MB&nbsp;)</span>"}var a={title:b,frameSrcUrl:(top._siteDomain?top._siteDomain:"")+"/manage/fileUploadV2.jsp?settings="+Fai.encodeUrl($.toJSON(d))+"&ram="+Math.random()+"&crossiframe="+Fai.encodeUrl(d.crossiframe),width:950,height:690,saveBeforePopup:false,callArgs:"add",closeFunc:e,version:2,popUpWinClass:"fileUploadV2",popUpWinZIndex:d.popUpWinZIndex};if(c.saveBeforePopup!==undefined){a.saveBeforePopup=c.saveBeforePopup}return a};Site.initIframeLoading=function(b,d,g,f){var h=b+d;var c=Fai.top.$("#"+h).parent().width();var a=Fai.top.$("#"+h).parent().height();var e=1;$("#"+h).attr("src",g).load(function(){$("#moduleLoading"+d).hide();$("#refreshFrame"+d).hide();Fai.top.$("#"+h).parent().show();e=2});if(f){$("#moduleLoading"+d).show();Fai.top.$("#"+h).parent().hide();$("#refreshFrame"+d).hide()}else{setTimeout(function(){if(e==1){var i="<div id='moduleLoading"+d+"' class='ajaxLoading2' style='width:"+c+"px;height:"+a+"px'></div>";Fai.top.$("#"+h).parent().before(i);Fai.top.$("#"+h).parent().hide()}},3000)}setTimeout(function(){if(e==1){$("#moduleLoading"+d).hide();if(f){$("#refreshFrame"+d).show()}else{var i="<div id='refreshFrame"+d+"' style='width:"+c+"px;height:"+a+"px;text-align:center;padding-top:5px;'><a href=\"javascript:Site.initModuleWeather('"+b+"',"+d+", '"+g+"', true);\">"+LS.refresh+"</a></div>";Fai.top.$("#"+h).parent().before(i)}e=3}},30000)};Site.logMsg=function(c){if(!c){return}var b="";var a=c.indexOf("&");if(a>=0){b=c.slice(a,c.length-1)}$.ajax({type:"GET",url:"/ajax/log_h.jsp?cmd=log&msg="+Fai.encodeUrl(c),data:b})};Site.logDog=function(b,a){$.ajax({type:"GET",url:"/ajax/log_h.jsp?cmd=dog&dogId="+Fai.encodeUrl(b)+"&dogSrc="+Fai.encodeUrl(a)})};Site.popupBox=function(q){var f={boxId:0,title:"",htmlContent:"",width:500,height:"",boxName:"",opacity:"0.5",displayBg:true,autoClose:0,extClass:"",popupBoxZIndex:0,needScollTop:true};f=$.extend(f,q);var a=parseInt(f.boxId);if(a==0||a==null){a=parseInt(Math.random()*10000)}if(f.displayBg){Fai.bg(a,f.opacity,f.popupBoxZIndex)}var o="";if(f.height!=""){o=" min-height:"+(f.height-45)+"px;"}var e=["<div id='popupBoxContent",a,"' style='width:",f.width,"px;",o," padding-bottom: 20px;","' class='popupCnBg'>",f.htmlContent,"</div>"];var j=Fai.top.document.documentElement.clientHeight;var d=Fai.top.$("body").scrollTop();if(d<=0){d=Fai.top.$("html").scrollTop()}if(d<=0){d=$(window).scrollTop()}var h="";var n="";var c="";if(f.boxName=="qqLogin"){h="style='padding-top:20px;'";n="style='margin-top:20px;'"}else{if(f.boxName=="addrInfo"){h="style='margin-top:21px;'"}else{if(f.boxName=="mallAmountZero"){h="style='height:15px;'";n="style='margin-top:10px;'"}else{if(f.boxName=="confirmReceipt"){n="style='margin-top:10px;'"}else{if(f.boxName=="mallBuy"){n="style='margin-top:10px'"}else{if(f.boxName=="memberFdPwd"){h="style='margin-top:20px;'";n="style='margin-top:20px'"}else{if(f.boxName=="bannerV2"){n="style='margin-top:18px;margin-right:18px;'"}}}}}}}if(f.popupBoxZIndex){c="z-index:"+f.popupBoxZIndex}var m=["<div id='popupBox",a,"' class='formBox "+f.extClass+"' style='width:",f.width,"px;",o,"left:",(Fai.top.document.documentElement.clientWidth-f.width)/2,"px; "+c+"'>","<div class='formTLSite'><div ",h,"class='formTCSite ",f.title==""?"formMulLanSite":"","'>",f.title,"</div></div>","<div class='formMSG' style='position:relative;'>",e.join(""),"</div>","<a href='javascript:void(0);' class='formXSite popupBClose' hidefocus='true' onclick='return false;'",n,"></a>","</div>"];m=m.join("");var l=Fai.top.$(m).appendTo("body");var k=(j-f.height)/2;if(f.height==""){k=(j-$(".popupCnBg").height())/2}$(l).css("top",f.needScollTop?k+d:k);var i=Fai.top.$("#popupBg"+a).outerHeight(true),g=Fai.top.$("#popupBoxContent"+a).outerHeight(true)+120,p=100-(g-i)>0?100-(g-i):0;if(i<g){l.css("top",p+"px")}l.hide();l.fadeIn();function b(r){return Object.prototype.toString.call(r)==="[object Function]"}l.ready(function(){l.draggable({start:function(){Fai.top.$("body").disableSelection()},handle:".formTLSite",stop:function(){Fai.top.$("body").enableSelection()}});l.find(".popupBClose").bind("click",function(){if(b(f.closeFunc)){f.closeFunc()}Fai.top.$("#popupBg"+a).remove();l.remove();if(q.reload){location.reload(true)}})});if(f.autoClose!=0){setTimeout(function(){l.find(".popupBClose").click()},f.autoClose)}return l};Site.hasXScrollBar=function(){function a(e){var f=0;if(e.length>0){f=e.scrollLeft();e.scrollLeft(0);e.scrollLeft(1);if(e.scrollLeft()===1){e.scrollLeft(f);return true}e.scrollLeft(f)}}var d,b,c=$(window);if(Fai.top._manageMode){d=$("#web");b=$("#g_main")}else{d=$("#g_main");b=$("body")}if(d.length>0){return d.width()>c.width()||a(b)}return false};Site.hasYScrollBar=function(){var a=$("#web");if(Fai.top._manageMode){if($("#g_main").css("overflow-y")==="scroll"){return true}}else{if(a.length>0){if(a.height()>$(window).height()){return true}}}return false};Site.checkEnv=function(o){function a(){var n=$("#nav"),r=0,q;if(n.length<=0){return false}if(Fai.top._navStyleData.ncp.l!==0){return false}if(Fai.top._manageMode){q=$("#g_main")}else{q=$("body")}if(n.offset().left+q.scrollLeft()!==0){return false}if(Fai.top._navStyleData.ns.w!==-1){return false}if(Site.hasYScrollBar()){r=Fai.getScrollWidth()}if(n.width()<$("#webContainer").width()){return false}if(n.width()+r<$(window).width()){return false}return true}function k(r,q){var n=0;if(r<960){return}if(q.length>0){n=$("#g_main").scrollLeft()+q.offset().left+q.width();return(n-m)>(r/2)}}function d(q){var n=false;if(q.attr("_intab")>0||q.attr("_inmulmcol")>0||q.attr("_side")==1){return}if(k(h,q)){i.push(q.prop("id"))}}var c=$(window),h=c.width(),l=0,m=0,i=[],j=[],p=$("#logoImg:visible"),b=$("#corpTitle"),f=$("#nav"),g,e;if(!$.isFunction(o)){o=function(){}}if(Site.hasYScrollBar()){h=h-Fai.getScrollWidth()}e={rightOverList:j,hasXScrollBar:Site.hasXScrollBar(),viewWidth:h};if(!e.hasXScrollBar){o(e);return}if(Fai.top._manageMode){l=$("#web").width()}else{l=$("#g_main").width()}m=(l/2);Fai.top.$(".absForms >.form").each(function(q,n){d($(n))});Fai.top.$(".floatForms >.form").each(function(q,n){d($(n))});if(i.length>0){j.push("floatModule")}if(b.length>0){if(k(h,b)){j.push("title")}}if(f.length>0){if(a()){g=f.find(".navContent");if(Fai.top._navStyleData.cp.y==1||Fai.top._navStyleData.cs.w!==-1){if(g.length>0&&k(h,g)){j.push("fullmeasureNav")}}}else{if(k(h,f)){j.push("nav1")}else{f=$("#nav .navMainContent").first();if(k(h,f)){j.push("nav2")}}}}if(k(h,$("#webContainer"))){j.push("background")}if(Fai.top._useBannerVersionTwo){if(Fai.top._bannerV2Data.blw.t===2){if(k(h,$("#bannerV2"))){j.push("bannerV2")}}}else{if(Site.getWebBackgroundData().wbws===1){if(k(h,$("#fk-webBannerZone"))){j.push("banner")}}}$("#fullmeasureTopForms").find(".fullmeasureContent").each(function(q,r){var n=$(r);if(n.width()>$("#webContainer").width()&&k(h,n)){j.push("fullmeasure");return false}});if(p.length>0){if(!p[0].complete){p.load(function(){if(k(h,p)){e.resList=["logo"];o(e)}})}else{if(k(h,p)){j.push("logo")}}}o(e);if(Fai.top._manageMode){$.each(i,function(q,n){$("#"+n).css("border","dashed black 5px")})}};Site.checkManageEnv=function(){if(!Fai.top._manageMode){return}Site.checkEnv(function(c){var d=c.rightOverList,f=c.viewWidth,a=d.length,h="",b="",e=[],g;g={floatModule:"--网站浮动模块位置;\n",logo:"--网站LOGO的宽度或位置;\n",title:"--网站标题宽度或位置;\n",fullmeasureNav:"--通栏式导航内容区位置设置项、宽度;\n",nav1:"--导航栏宽度或位置。;\n",nav2:"--导航应用了网站宽度并且存在水平偏移。请自定义导航内容区宽度;\n",banner:"--网站横幅宽度;\n",bannerV2:"--横幅2.0宽度;\n",background:"--网站背景宽度;\n",fullmeasure:"--通栏宽度;\n"};while(a>0){a--;if(g[d[a]]){e.push(g[d[a]])}}if(e.length>0){e.unshift("窗口宽度:"+f+";\n","导致模块滚动条出现的原因:\n")}else{e.push("没有检测到横向超出的元素。")}h='<a href="http://it.faisco.cn/page/forum/articleDetail.jsp?articleId=1447" style="position:absolute;right:20px;bottom:60px;font-size:14px;text-decoration:underline;" target="_blank">[了解更多]</a>';b='<button style="position:absolute;right:20px;bottom:20px;padding:4px;width:64px;cursor:pointer;padding:0px;" onclick="Site.closeCheckEnvWindow()">确定</button>';e.push(h);e.push(b);e='<div style="padding:10px;font-size:14px;cursor:point">'+$.trim(e.join("<br>"))+"</div>";Site.popupWindow({title:"横向滚动条检测结果",divContent:e,closeBtnClass:"J_checkEvnCloseBtn"})})};Site.checkVisitEnv=function(){var f,d;if(Fai.top._manageMode||Fai.top._oem){return}f={get:function(h){var g=window.sessionStorage;return g?g.getItem(h):$.cookie(h)},set:function(h,i){var g=window.sessionStorage;g?g.setItem(h,i):$.cookie(h,i)}};Site.checkEnv(function(g){var l=a("fkScrollBarCheck"),m=a("fkScreenSize"),i=g.rightOverList,k={},n=location.href,h,j;if(!l.has(n)&&i.length>0){j=c(i);k[j.dogId]=j.dogSrc;l.add(n)}if(!m.has(n)){h=b(),k[h.dogId]=h.dogSrc;m.add(n)}if(h||j){e(k)}});function b(){var i=$(window).width(),j=200094,g,h;h={"1200":1,"960":2,other:3,normal:4};if(Site.hasXScrollBar()){if(i>=1200){g=h["1200"]}else{if(i>=960&&i<1200){g=h["960"]}else{g=h.other}}}else{g=h.normal}return{dogId:j,dogSrc:g}}function c(i){var k=$(window).width(),h=i.length,m=[],n,g,j,l;j={floatModule:1,nav1:2,nav2:2,background:3,banner:4,logo:6,title:7,fullmeasure:8,fullmeasureNav:9,bannerV2:10};l={"1200":200079,"960":200080};if(k>=1200){n=l["1200"]}else{if(k>=960&&k<1200){n=l["960"]}}while(h>0){h--;g=j[i[h]];if(g!==undefined){if($.inArray(g,m)===-1){m.push(g)}}}return{dogId:n,dogSrc:m}}function e(h,g){if(h!==undefined){if($.type(h)==="object"){h=$.toJSON(h);Site.logDog(h,g);return}if($.type(g)==="array"){if(!g.length){return}g=$.toJSON(g);Site.logDog(h,g);return}if(g!==undefined){Site.logDog(h,g)}}}function a(h){var g={index:h,get:function(){var i=f.get(g.index);try{i=$.parseJSON(i)}catch(j){}if($.isArray(i)){return i}return[]},add:function(j){var i=g.get();if($.inArray(j,i)===-1){i.push(j);f.set(g.index,$.toJSON(i))}},has:function(i){return $.inArray(i,g.get())>-1}};return g}};Site.closeCheckEnvWindow=function(){var a=$(".J_checkEvnCloseBtn");if(a.length>0){a.trigger("click")}};Site.initPdNavfold=function(b){var e=$("#module"+b);if(e.parent("#leftForms").length>0){var r=e.find(".g_foldContainerPanel");if(r.find(".g_foldContainerValueRight.foldChange_J").length>0){r.find(".g_foldContainerValueCenter a").css("max-width","140px")}}if(e.find(".g_vertFold").length>0){var j=e.find(".pdLevel a");if(Fai.isIE6()||Fai.isIE7()){$.each(j,function(s,t){if($(t).width()>155){$(t).width(155)}});return}var c=e.width();if(c>210){j.css("max-width",c-55+"px")}return}var l=e.find(".g_foldContainerPanel");var d=l.length;var a=0;var p=0;var k=[];var h=[];for(var g=0;g<d;g++){var f=$(l[g]);var o=f.position();var m=o.top;if(e.width()<452){l.removeClass("g_foldContainerPadding").removeAttr("style");e.find(".g_horfoldSepLine").removeClass("g_horfoldSepLine").addClass("g_verfoldSepLine").removeAttr("style");l.height();break}if(g==0){l.addClass("g_foldContainerPadding");l=e.find(".g_foldContainerPanel");f=$(l[g]);m=f.position().top;e.find(".g_verfoldSepLine").addClass("g_horfoldSepLine").removeClass("g_verfoldSepLine")}if(g==d-1){if(p==m){var q=f.height();if(a<q){a=q}k.push(f.next());h.push(f);$.each(k,function(s,t){$(t).css("height",(a-5)+"px")});$.each(h,function(s,t){$(t).css("height",a+"px")});break}}if(p!=m){$.each(k,function(s,t){$(t).css("height",(a-5)+"px")});$.each(h,function(s,t){$(t).css("height",a+"px")});k=[];h=[];a=0;f.prev().hide();l=e.find(".g_foldContainerPanel");f=$(l[g]);p=f.position().top}var q=f.height();if(a<q){a=q}k.push(f.next());h.push(f)}k=[];h=[];e.find(".g_productNav").fadeTo(400,1)};Site.foldChange=function(w,h,k){var d=$("#module"+w);var f=k.style;var g=k.flag;d.find(".fold_h_J").mouseover(function(){$(this).addClass("g_hover")}).mouseleave(function(){$(this).removeClass("g_hover")});d.find(".foldChange_J").click(function(){var A=$(this),z=A.parents(".fold_J"),B=z.attr("foldId"),i=$("#childrenDiv"+B+"M"+w);if(i.is(":visible")){i.slideUp(300);z.find(".fold_btn_J").removeClass("g_unfold").addClass("g_fold")}else{i.slideDown(300);z.find(".fold_btn_J").removeClass("g_fold").addClass("g_unfold")}});Site.initContentSplitLine(w,h);var y=Fai.top.location.hash;if(y.length<2){return}if(Fai.getHashParam(y,"_np")&&f==24){var a=Site.decodeQsToUrl(Fai.getHashParam(y,"_np"),"_np",k);if(a){var x=Fai.getHashParam(a,"groupId");d.find(".g_foldContainerContent").find("[childGroupId="+x+"]").addClass("g_selected");d.find(".g_foldContainerContent").find("[groupId="+x+"]").addClass("g_selected")}}if(Fai.getHashParam(y,"_pp")){var a=Site.decodeQsToUrl(Fai.getHashParam(y,"_pp"),"_pp",k);var e=[];$.each(Fai.getHashParam(y,"_pp").split("_"),function(z,A){if(A){e.push(A)}});if(f==26){var x=Fai.getHashParam(a,"groupId");if(a&&!isNaN(x)){d.find(".g_foldContainerContent").find("[groupId="+x+"]").addClass("g_selected");d.find(".g_foldContainerContent").find("[childGroupId="+x+"]").addClass("g_selected");d.find(".g_foldContainerContent").find("[grandGroupId="+x+"]").addClass("g_selected")}}else{if(f==21){var s=Fai.getHashParam(a,"_ci");var l=Fai.getHashParam(y,"pid");if(a){if(!isNaN(l)){d.find(".g_foldContainerContent").find("[childGroupId="+l+"]").addClass("g_selected")}else{if(!isNaN(s)){d.find(".g_foldContainerContent").find("[groupId="+s+"]").addClass("g_selected")}}}}else{if(f==38){var b=Site.getUrlParamObj("?"+a);if(b&&e.length==3){$.each(b,function(z,A){if(z.indexOf("_li")>-1){var i=z.split("=")[0].replace("_li","");if(!isNaN(i)){d.find(".childrenDiv").find("[childGroupId="+i+"]").addClass("g_selected")}}})}if(e.length==4){var r=Fai.getHashParam(a,"_plc");var o=Fai.getHashParam(a,"labelId");if(r>-1){if(!isNaN(o)){d.find(".childrenDiv").find("[foldId="+o+"]").addClass("g_selected")}}else{if(!isNaN(o)){d.find(".g_foldContainerContent").find("[groupId="+o+"]").addClass("g_selected")}}}}else{if(f==9&&e.length==3){var v=e[2].split("~");if(v.length==1&&!isNaN(v[0])){d.find(".g_foldContainerContent").find("[groupId="+v[0]+"]").addClass("g_selected")}else{var b=Site.getUrlParamObj("?"+a);var n=false;if(!b){return}if(!Fai.checkBit(g,4)){$.each(b,function(i,A){if(i.indexOf("_fi")>-1){var z=i.split("=")[0].replace("_fi","");if(!isNaN(z)&&!isNaN(A)){d.find("#childrenDiv"+z+"M"+w).find("[childGroupId="+A+"]").addClass("g_selected")}}})}else{$.each(b,function(B,E){if(B.indexOf("_fi")>-1){var D=B.split("=")[0].replace("_fi","");var C=k.blob0;var z=0;for(var A=0;A<D;A++){z+=C[A].l.length}if(!isNaN(E)){d.find(".g_foldContainerContent").find("[groupId="+(z+parseInt(E))+"]").addClass("g_selected")}}})}}}else{if(f==95||f==96){if(k.prop0==0){var u=Fai.getHashParam(a,"groupIdList");if(!u){return}var q=JSON.parse(u);if(!q){return}var t=false;var c=false;for(var p=0;p<q.length;p++){if(d.find(".g_foldContainerContent").find("[grandgroupId="+q[p]+"]").length==1){d.find(".g_foldContainerContent").find("[grandgroupId="+q[p]+"]").addClass("g_selected");t=true}}if(!t){for(var p=0;p<q.length;p++){if(d.find(".g_foldContainerContent").find("[childgroupId="+q[p]+"]").length==1){d.find(".g_foldContainerContent").find("[childgroupId="+q[p]+"]").addClass("g_selected");c=true}}}if(!t&&!c){for(var p=0;p<q.length;p++){if(d.find(".g_foldContainerContent").find("[groupId="+q[p]+"]").length==1){d.find(".g_foldContainerContent").find("[groupId="+q[p]+"]").addClass("g_selected")}}}}else{if(k.prop0==1){var m=Fai.getHashParam(a,"_pni");if(!m){return}var j=JSON.parse(m);$.each(j,function(z,A){d.find(".g_foldContainerContent").find("[groupId="+A+"]").addClass("g_selected")})}}}}}}}}};Site.decodeQsToUrl=function(d,i,c){var a="";var j=[];var f=c.style;$.each(d.split("_"),function(l,m){if(m){j.push(m)}});if(j<2){return a}var e=j[0];if(e>0){a="fromColId="+e+"&"}var h=j[1];if(h<=0||h!=c.id){return a}a+="mid="+h+"&";if(j.length<=2){return a}if(i=="_np"&&j.length>=3){if(j.length>=4){return a+="groupId="+j[2]+"&_ngc="+j[3]}return a+="groupId="+j[2]}else{if(i=="_php"&&j.length>=3){return a+="groupId="+j[2]}else{if(i=="_pp"){switch(f){case 26:if(j.length>=4){return a+="groupId="+j[2]+"&_pgc="+j[3]}break;case 21:if(j.length>=3){return a+="_ci="+j[2]}break;case 38:if(j.length==3){var b=j[2].split("~");$.each(b,function(l,m){if(m>-1){a+="_li"+l+"="+m+"&"}});return a}else{if(j.length>=4){if(j[3]<0){return a+="labelId="+j[2]}return a+="labelId="+j[2]+"&_plc="+j[3]}}break;case 9:if(j.length==3){var g=j[2].split("~");if(g.length!=c.blob0.length){return}$.each(g,function(m,l){if(l>-1){a+="_fi"+m+"="+l+"&"}});return a}break;case 95:case 96:if(j.length==3){var k=j[2].split("~");if(k.length<1){return a}if(c.prop0==0){return a+="groupIdList="+JSON.stringify(k)}else{if(c.prop0==1){return a+="_pni="+JSON.stringify(k)}}}break;default:return a;break}}}}};Site.floatTip=function(d){var q={moduleId:"",targetId:"",tipText:"",cusClass:"",direction:3};q=$.extend(q,d);if(q.moduleId.length==0||q.targetId.length==0||q.tipText.length==0){return}$(Fai.top.document).find(".J_floatTip_"+q.moduleId).remove();var k=Fai.isIE6()||Fai.isIE7()||Fai.isIE8();var t=[];var j="floatTip_content";var r="floatTip_right";var l="floatTip_arrow";var p="floatTip_left";var o="floatTip_"+q.moduleId+"_"+q.targetId;if(k){j+=" floatTip_content_IE ";r+=" floatTip_right_IE ";l+=" floatTip_arrow_IE ";p+=" floatTip_left_IE "}t.push("<div id='"+o+"' class='J_floatTip_"+q.moduleId+" floatTip'>\n");t.push("<div class='"+l+"'></div>");t.push("<div class='"+r+"'></div>");t.push("<div class='"+p+"'></div>");t.push("<div class='"+j+q.cusClass+"'>"+q.tipText+"</div>");t.push("</div>\n");$(Fai.top.document).find("#g_main").append(t.join(""));var b=$("#"+q.moduleId);var s=$(b).find("#"+q.targetId);var a=$("#"+o);var h=$(".floatLeftTop").offset().top;var c=(Fai.top._manageMode)?$("#g_main").scrollTop():$("body").scrollTop();if(Fai.isIE6()){c=$("#g_main").scrollTop()}if(c==0){c=$("html").scrollTop()}var e=a.height();var m=a.width()*0.7;var g=s.width()*0.8;var f=s.height();var n=s.offset().left+(g-m);var i=s.offset().top+c-h;$("#"+o).show().css({top:i+"px",left:n+"px","z-index":9031});setTimeout(function(){if(k){var u=i-e-10+(f/3);$("#"+o).animate({top:u+"px",opacity:1,filter:"alpha(opacity=100)"},300)}else{var u=i-e+(f/3);$("#"+o).css({top:u+"px",opacity:1})}},50);$(s).unbind("click").bind("click",function(){if($(this).hasClass("focusBg")){$(this).removeClass("focusBg")}$("#floatTip_"+q.moduleId+"_"+q.targetId).remove()})};Site.floatTip_clear=function(a){$(Fai.top.document).find(".J_floatTip_"+a).remove()};Site.moduleSubPanel=function(m){var e={that:null,moduleId:null,idStr:"",clsStr:"",contentStr:""};$.extend(e,m);if(e.that==null){return}var a,c=e.moduleId,d=$("#module"+c),l=j(d),n=h(d,c);n=n+" modulePattern "+d.attr("class");n=n.replace("formInZone","");var b=["<div id='",e.idStr,"' class='",e.clsStr," g_m_s_J ",l,"' _mouseIn=1 style='display:none;'>","<div class='",n,"' style='zoom:0;margin:0;overflow:visible;position:relative;'>","<div class='formMiddle' style='zoom:0;width:auto;border:0;'>","<div class='formMiddleCenter' style='zoom:0;width:auto;margin:0;'>","<div class='formMiddleContent' style='",Fai.isIE6()?"_display:inline;":"","width:auto;margin:0;overflow:visible;'>",e.contentStr,"</div>","</div>","</div>","</div>","</div>"];a=$(b.join(""));a.appendTo("body");if(d.hasClass("formStyle76")){i()}else{k()}function i(){var q=d.find(".pd_mall_G_J"),o=d.find(".p_m_cotainer_J"),p;q.off("mouseleave.pr").on("mouseleave.pr",function(){p=setTimeout(function(){g(e.moduleId)},20)});a.off("mouseleave.pr").on("mouseleave.pr",function(){g(e.moduleId);if(parseInt(d.attr("_side"))===2){Site.startFlutterInterval(d)}if(parseInt(d.attr("_side"))===1){var r=d.outerWidth();d.animate({left:-r},{queue:false,duration:500})}});a.off("mouseenter.pr").on("mouseenter.pr",function(){if(p){clearTimeout(p);if(parseInt(d.attr("_side"))===2){Site.stopFlutterInterval(d)}if(parseInt(d.attr("_side"))===1){d.animate({left:0},{queue:false,duration:500})}}})}function k(){a.mouseleave(function(){a.attr("_mouseIn",0);setTimeout(f,100)});a.mouseover(function(){a.attr("_mouseIn",1)});e.that.mouseleave(function(){a.attr("_mouseIn",0);setTimeout(f,100)});e.that.mouseover(function(){a.attr("_mouseIn",1)});if(parseInt(d.attr("_side"))===2){a.mouseleave(function(){Site.startFlutterInterval(d)});a.mouseenter(function(){Site.stopFlutterInterval(d)})}}function g(q){var p=$("#module"+q).find(".p_m_cotainer_J"),o=$(".g_m_s_J");o.has(".form"+q).remove();p.removeClass("bold p_m_hover g_border");p.find(".p_m_value_J").removeClass("g_stress");p.each(function(){var r=$(this);if(r.attr("_chd")==1){r.find(".p_m_cotainerR_J").addClass("p_m_more")}})}function f(){$(".g_m_s_J").each(function(){var o=$(this);if(o.length!=1){return}if(o.attr("_mouseIn")==1){return}o.remove()})}function j(s){var q=s.attr("_intab")||0,r=s.attr("_inpack")||0,v=s.attr("_inmulmcol")||0,o=s.attr("_infullmeasure")||0,p=0,u="",t="";if(q==0&&v==0&&o==0&&r==0){t=s.parent().attr("class");t=t.replace("J_moduleZone","").replace("fk-webBannerZone","").replace("fk-moduleZone","").replace("ui-sortable","").replace("elemZone","").replace("elemZoneModule","");return t}else{if(q>0){p=q}else{if(v>0){p=v}else{if(o>0){p=o}else{if(r>0){p=r}}}}u=Fai.top.$("#module"+p);return j(u)}}function h(s,p){var u=s.attr("_intab")||0,o=s.attr("_inmulmcol")||0,t=s.attr("_infullmeasure")||0,r=s.hasClass("modulePattern")||false,v="",x=s.attr("class")||"",q=/modulePattern\d+/,w="";if(r){return x.match(q)}else{if(u==0&&o==0&&t==0){return x.match(q)}else{if(u>0){w=u}else{if(o>0){w=o}else{if(t>0){w=t}}}v=Fai.top.$("#module"+w);return h(v,p)}}}return a};Site.mobiPlatform=function(b){if(!Fai.top._siteDemo||Fai.top._designAuth){return}if(typeof(Fai.top.top)!="undefined"&&typeof(Fai.top.top.$)!="undefined"){var v=Fai.top.top.$(".fk-quickViewTemplateContent");if(v.length>0&&v.is(":visible")){return}}var g=[],h=false,r="mobiPlatform",m=document.domain,p={},d={},l={w:0,h:0},s=Fai.top.$("body"),y=Fai.getScrollWidth(),j=400,n=600,c=$.cookie("mobiPlatformBg",{domain:m,path:"/"})||0,z=parseInt($.cookie("mobiPlatformIconFlag",{domain:m,path:"/"}))||0,w="display:none;",q="",o="",f,x,k,a,u,t;var A={refresh:false};$.extend(A,b);if(Fai.isIE){if(Fai.isIE6()||Fai.isIE7()||Fai.isIE8()){h=true}}if(z>0){w="";q="display:none;";o=z==1?"mobiPlatformIcon_right":"mobiPlatformIcon_left"}p.big={};p.big.className="mobiPlatform_big";p.big.w=265;p.big.h=490;p.big.cw=295;p.big.ch=592;p.small={};p.small.className="mobiPlatform_small";p.small.w=265;p.small.h=400;p.small.cw=291;p.small.ch=483;l=Site.mobiPlatform.getWindowSize();if(l.h<=800){d=p.small}else{d=p.big}Site.mobiPlatform.nowSize=d;if(s.children("#mobiPlatform").length<1){g.push("<div id='mobiPlatform' class='mobiPlatform mobiPlatform-hide "+d.className+"' direction='0' moved='0' style='"+q+"'>");g.push(" <div class='J_innerCover mp-innerCover' style='display:none;'></div>");g.push(" <div class='J_innerIframe mp-innerIframe"+(h?" mp-innerIframe2":"")+"'>");if(!h){g.push(" <div class='J_loading mp-loading'>");g.push(" <div class='mp-loading-icon mp-loading-iconAction'></div>");g.push(" </div>")}else{g.push(" <div class='mp-updateBtnContainer'>");g.push(" <a href='https://www.baidu.com/s?wd=chrome' target='_blank' class='mp-updateBtn'></a>");g.push(" </div>")}g.push(" </div>");g.push(" <a href='javascript:;' hidefocus='true' title='隐藏' class='J_closeBtn mp-closeBtn' style='display:none;'></a>");g.push(" <div class='J_hoverTip mp-hoverTip' style='display:none;'></div>");g.push("</div>");g.push("<div id='mobiPlatformIcon' class='mobiPlatformIcon "+o+"' style='"+w+"'>");g.push(" <a href='javascript:;' class='mobiPlatformIcon-handle' onclick='Site.mobiPlatform();return false;' hidefocus='true'></a>");g.push("</div>");Fai.top.$("body").append(g.join(""));f=s.children("#mobiPlatform");x=s.children("#mobiPlatformIcon");a=f.find(".J_closeBtn");u=f.find(".J_hoverTip");f.draggable({scroll:false,cursor:"move",distance:10,containment:"parent",cancel:".J_innerCover",start:function(B,C){f.find(".J_innerCover").show()},stop:function(B,H){f.find(".J_innerCover").hide();f.attr("moved","1");if(!c){c=1;$.cookie("mobiPlatformBg",1,{expires:365,domain:m,path:"/"})}d=Site.mobiPlatform.nowSize;l=Site.mobiPlatform.getWindowSize();var G=true,I={x:1,y:1},C=4,F=s.children(".floatLeftTop"),M=F.offset(),E=~~(F.css("top").replace("px","")),L=l.h-d.ch,D=L-(H.offset.top-(M.top-E)),K=l.w-d.cw,J=K-(H.offset.left-M.left);if(J<(K/2)){J-=y;I.x=1}else{I.x=0}if(D<(L/2)){I.y=1}else{I.y=0}if(!(J<K&&J>C)){G=false}if(!(D<L&&D>C)){G=false}if(!G){if(I.y==1){if(D<=C){f.attr("direction","4")}}else{if(D>=L){f.attr("direction","3")}}if(I.x==1){if(J<=C){if(f.attr("direction")==3){f.css({bottom:"auto",top:0})}else{if(f.attr("direction")==4){f.css({bottom:0,top:"auto"})}}f.attr("direction","2").css({right:0,left:"auto"}).animate({right:(-d.cw)+"px"},j,function(){x.removeClass("mobiPlatformIcon_left").addClass("mobiPlatformIcon_right").fadeIn();f.hide();$.cookie("mobiPlatformIconFlag",1,{expires:365,domain:m,path:"/"})})}}else{if(J>=K){if(f.attr("direction")==3){f.css({bottom:"auto",top:0})}else{if(f.attr("direction")==4){f.css({bottom:0,top:"auto"})}}f.attr("direction","1").css({right:"auto",left:0}).animate({left:(-d.cw)+"px"},j,function(){x.removeClass("mobiPlatformIcon_right").addClass("mobiPlatformIcon_left").fadeIn();f.hide();$.cookie("mobiPlatformIconFlag",2,{expires:365,domain:m,path:"/"})})}}if(f.attr("direction")==3){f.animate({bottom:"auto",top:(-d.ch)+"px"},n,function(){x.removeClass("mobiPlatformIcon_left").addClass("mobiPlatformIcon_right").fadeIn();f.hide();$.cookie("mobiPlatformIconFlag",1,{expires:365,domain:m,path:"/"})})}else{if(f.attr("direction")==4){f.animate({top:(L+d.ch)+"px",bottom:"auto"},n,function(){x.removeClass("mobiPlatformIcon_left").addClass("mobiPlatformIcon_right").fadeIn();f.hide();$.cookie("mobiPlatformIconFlag",1,{expires:365,domain:m,path:"/"})})}}}}});if(!h){var e=document.createElement("iframe"),i=f.find(".J_innerIframe");e.style.width=d.w+"px";e.style.height=d.h+"px";e.style.border="none";e.src=Fai.top._mobiAdmHost;e.id="mobiFrame";if(e.attachEvent){e.attachEvent("onload",function(){f.find(".J_loading").remove();f.removeClass("mobiPlatform-hide")})}else{e.onload=function(){f.find(".J_loading").remove();f.removeClass("mobiPlatform-hide");if(Fai.isSafari()){var B=$(document.getElementById("mobiFrame").contentWindow.document.body);B.find("#g_web").css("position","fixed");B.find("#g_web").css("height","100%")}}}i.find("iframe").remove();i.append(e);k=$(e)}else{f.removeClass("mobiPlatform-hide")}Fai.top.$(window).off("resize.mobiPlatform");Fai.top.$(window).on("resize.mobiPlatform",function(){Site.mobiPlatform({refresh:true})});a.click(function(){d=Site.mobiPlatform.nowSize;l=Site.mobiPlatform.getWindowSize();rangeHeight=l.h-d.ch;rangeWidth=l.w-d.cw;nowWidth=rangeWidth-f.offset().left;var B=0;var C=f.attr("direction");if(f.attr("moved")=="0"){if(C=="0"){B=2}else{if(C=="1"){B=3}else{if(C=="2"){B=2}}}}else{if(nowWidth<(rangeWidth/2)){B=1}else{B=3}}if(B==1){f.animate({left:(rangeWidth+d.cw)+"px",right:"auto"},n,function(){x.removeClass("mobiPlatformIcon_left").addClass("mobiPlatformIcon_right").fadeIn();f.attr("direction","5").hide()})}else{if(B==2){f.animate({left:"auto",right:(-d.cw)+"px"},n,function(){x.removeClass("mobiPlatformIcon_left").addClass("mobiPlatformIcon_right").fadeIn();f.attr("direction","5").hide()})}else{if(B==3){f.animate({left:(-d.cw)+"px",right:"auto"},n,function(){x.removeClass("mobiPlatformIcon_right").addClass("mobiPlatformIcon_left").fadeIn();f.attr("direction","1").hide()})}}}});f.hover(function(){t=Fai.top.$("#mobiPlatformBg");if(t.length<1){var B=[];B.push("<div id='mobiPlatformBg' class='popupBg' style='z-index:9032;opacity:0;' >");if($.browser.msie&&$.browser.version==6){B.push("<iframe id='fixSelectIframe-mobiPlatform' wmode='transparent' style='filter: alpha(opacity=0);opacity: 0;' class='popupBg' style='z-index:-111' src='javascript:'></iframe>")}else{B.push("</div>")}f.before(B.join(""));t=Fai.top.$("#mobiPlatformBg")}t.stop(true).show().animate({opacity:0.6},500);if(!c){u.stop(true).show().animate({opacity:1})}else{u.hide()}},function(){t.stop(true).animate({opacity:0},500,function(){t.hide()});if(!c){u.stop(true).animate({opacity:0},400,function(){u.hide()})}else{u.hide()}})}else{f=s.children("#mobiPlatform");x=s.children("#mobiPlatformIcon");if(!h){k=f.find("iframe")}if(A.refresh){f.attr("class","mobiPlatform "+d.className);if(!h){k.css({width:d.w+"px",height:d.h+"px"})}}if(!A.refresh){f.show();if(f.attr("direction")==2){f.attr("moved","0").animate({right:"10px"},j,function(){x.fadeOut()})}else{if(f.attr("direction")==1){f.attr("moved","0").animate({left:"10px"},j,function(){x.fadeOut()})}else{f.attr("direction",0).attr("moved","0").css({top:"auto",left:"auto",right:(-d.cw)+"px",bottom:"10px"}).animate({right:"10px"},j,function(){x.fadeOut()})}}$.cookie("mobiPlatformIconFlag",0,{expires:365,domain:m,path:"/"})}}};(function(a){a.getWindowSize=function(){var b={w:0,h:0};if(window.innerWidth&&window.innerHeight){b.w=window.innerWidth;b.h=window.innerHeight}else{if(document.documentElement){b.w=document.documentElement.clientWidth;b.h=document.documentElement.clientHeight}else{if(document.body.clientWidth&&document.body.clientHeight){b.w=document.body.clientWidth;b.h=document.body.clientHeight}}}return b}})(Site.mobiPlatform);Site.Pagenation=(function(d){var c;function b(h,f,i){var g=d("#pagenation"+h);c=f;g.css("text-align","center");e(f,g);a(h,g,i)}function e(h,j){var l=Math.ceil(h.totalSize/h.pageSize),g=h.pageNo||1;if(j.length!=0){var f=[],k=0;f.push("<div class='pagePrev'>");if(g==1){f.push("<span>"+LS.prevPager+"</span>")}else{f.push("<a hidefocus='true' class='g_border' href='javascript:;'><span>"+LS.prevPager+"</span></a>")}f.push("</div>");if(g==1){f.push("<div class='pageNo'><span>1</span></div>")}else{f.push("<div class='pageNo'><a hidefocus='true' class='g_border' href='javascript:;'><span>1</span></a></div>")}if(g-2>2){f.push("<div class='pageEllipsis'><span>...</span></div>");for(k=g-2;k<g;k++){f.push("<div class='pageNo'><a hidefocus='true' class='g_border' href='javascript:;'><span>"+k+"</span></a></div>")}}else{for(k=2;k<g;k++){f.push("<div class='pageNo'><a hidefocus='true' class='g_border' href='javascript:;'><span>"+k+"</span></a></div>")}}if(g!=1&&g!=l){f.push("<div class='pageNo'><span>"+g+"</span></div>")}if(g+2<l-1){for(k=g+1;k<=g+2;k++){f.push("<div class='pageNo'><a hidefocus='true' class='g_border' href='javascript:;'><span>"+k+"</span></a></div>")}f.push("<div class='pageEllipsis'><span>...</span></div>")}else{for(k=g+1;k<=l-1;k++){f.push("<div class='pageNo'><a hidefocus='true' class='g_border' href='javascript:;'><span>"+k+"</span></a></div>")}}if(g==l){f.push("<div class='pageNo'><span>"+l+"</span></div>")}else{f.push("<div class='pageNo'><a hidefocus='true' class='g_border' href='javascript:;'><span>"+l+"</span></a></div>")}f.push("<div class='pageNext'>");if(g==l){f.push("<span>"+LS.nextPager+"</span>")}else{f.push("<a hidefocus='true' class='g_border' href='javascript:;'><span>"+LS.nextPager+"</span></a>")}f.push("</div>");j.html(f.join(""))}}function a(g,f,h){d("body").off("click","#pagenation"+g+" .g_border");d("body").on({hover:function(){d(this).addClass("g_hover")},mouseleave:function(){d(this).removeClass("g_hover")},click:function(){var j=f.find(".pageNo").not(":has('.g_border')").text();var i=1;if(d(this).parent().hasClass("pagePrev")){i=Number(j)-1}else{if(d(this).parent().hasClass("pageNext")){i=Number(j)+1}else{i=Number(d(this).text())}}c.pageNo=i;h(g,i);e(c,f)}},"#pagenation"+g+" .g_border")}return b})(jQuery);Site.loadCss=function(b,f,e){var c=document.createElement("link");supportOnload="onload" in c,isOldWebKit=+navigator.userAgent.replace(/.*(?:AppleWebKit|AndroidWebKit)\/?(\d+).*/i,"$1")<536,protectNum=600000;f=typeof f=="function"?f:function(){};c.rel="stylesheet";c.type="text/css";c.href=b;if(typeof e!=="undefined"){c.id=e}document.getElementsByTagName("head")[0].appendChild(c);if(isOldWebKit||!supportOnload){setTimeout(function(){a(c,f,0)},1);return}if(supportOnload){c.onload=d;c.onerror=function(){d()}}else{c.onreadystatechange=function(){if(/loaded|complete/.test(c.readyState)){d()}}}function d(){c.onload=c.onerror=c.onreadystatechange=null;c=null;f()}function a(k,l,j){var i=k.sheet,g;j+=1;if(j>protectNum){g=true;k=null;l();return}if(isOldWebKit){if(i){g=true}}else{if(i){try{if(i.cssRules){g=true}}catch(h){if(h.name==="NS_ERROR_DOM_SECURITY_ERR"){g=true}}}}setTimeout(function(){if(g){l()}else{a(k,l,j)}},20)}};Site.checkScriptLoad=function(f){if(typeof f=="undefined"||f.length<1){return}var c=document.scripts,b=c.length-1,e="",a=false,d;for(d=b;d>=0;d--){e=c[d].getAttribute("src")||"";if(e==f){a=true;break}}return a};Site.demandLoadJs=function(b,a){if(typeof b=="undefined"||b.length<1){return}if(!Site.checkScriptLoad(b)){if(typeof a=="function"){$LAB.script(b).wait(function(){a()})}else{$LAB.script(b)}}};Site.checkCssLoad=function(c){if(typeof c=="undefined"||c.length<1){return}var f=document.styleSheets,b=f.length-1,d="",a=false,e;for(e=b;e>=0;e--){src=f[e].href||"";if(src==c){a=true;break}}return a};Site.demandLoadCss=function(a,b){if(typeof a=="undefined"||a.length<1){return}if(!Site.checkCssLoad(a)){Site.loadCss(a,b)}};Site.initContentSplitLine=function(a,c){var b=$("#module"+a),g,q;if(b.hasClass("formStyle12")||b.hasClass("formStyle13")){var p=b.hasClass("formStyle13"),k=p?".f-textListPropSep":".f-hotTextListPropSep";g=p?b.find(".productTextListTable:first"):b.find(".productHotTextListTable:first");q=p?b.find(".productTextListProp"):b.find(".productHotTextListProp");if(g.length>0){$(function(){Fai.top.Fai.setCtrlStyleCssList("stylemodule","module"+a,[{cls:".g_separator",key:"margin-top",value:"-"+parseInt(g.css("margin-top").replace("px"))/2+"px"},{cls:".g_separator",key:"margin-bottom",value:"-"+parseInt(g.css("margin-bottom").replace("px"))/2+"px"}])})}if(q.length>0){var n=q.css("background-color");if(typeof n=="string"&&n.length>0){n=n.replace(/\s/g,"");if(n!="rgba(0,0,0,0)"&&n!="transparent"){$(function(){Fai.top.Fai.setCtrlStyleCssList("stylemodule","module"+a,[{cls:k,key:"display",value:"none"}])})}}}}if(b.length<1||typeof c=="undefined"||c.y!=2){return}var f=c.w?c.w:1,m=c.c?c.c:"#000",j=Number(c.s),e=b.find(".g_separator");if(isNaN(j)||j<3||j>8||e.length<1){return}if(Fai.isIE6()||Fai.isIE7()){e.css({fontSize:0,height:0,lineHeight:0,borderColor:c.c,borderWidth:c.w+"px",borderStyle:"solid",borderLeft:"none",borderTop:"none",borderRight:"none"});return}var o="<span>",h="",l,d;l=["─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ","-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·","-··-··-··-··-··-··-··-··-··-··","— - — - — - — - — - — - — - — - "];h=l[j-3];for(d=0;d<3;d++){h+=h}o+=h+"</span>";e.addClass("g_foldTextLine").html(o);Site.checkSplitLineEnough(a)};Site.checkSplitLineEnough=function(g){var c=$("#module"+g),d=c.find(".g_separator");if(c.length<1||d.length<1){return}var e=d.find("span"),b=d.width(),a=e.width(),f=e[0].innerHTML;doubleText=f+f;if(a==0||b==0){e.html(doubleText+f)}else{if(a<b){e.html(doubleText);Site.checkSplitLineEnough(g)}}if(c.hasClass("formStyle11")){d.css("width",c.find(".formMiddleContent").width()+"px")}};Site.chageTheWebVersion=function(a){$.ajax({type:"POST",url:"/ajax/webTools_h.jsp?cmd=changeWebVersion",data:"verNum="+a,error:function(){Fai.ing("系统异常,请稍后重试",true)},success:function(b){var c=jQuery.parseJSON(b);if(c.success){window.location.reload()}else{alert(c.msg)}}})};Site.getCloneAid=function(){$.ajax({type:"post",url:"/ajax/webTools_h.jsp",data:"cmd=getCloneAid",beforeSend:function(){Fai.ing("正在克隆处理......")},error:function(){Fai.ing("系统异常,请稍后重试",true)},success:function(a){var b=jQuery.parseJSON(a);if(b.success){Fai.ing("克隆成功, 账号:"+b.account+", aid:"+b.aid)}else{Fai.ing(b.msg)}}})};Site.cloneWebVersion=function(){$.ajax({type:"POST",url:"/ajax/webTools_h.jsp",data:"cmd=getAcctInfo",error:function(){Fai.ing("系统异常,请稍后重试",true)},success:function(b){var c=jQuery.parseJSON(b);if(c.success){var d=prompt("将当前网站克隆到下面输入的网站(ps:输入的账号必须为内部账号)\n\n请输入账号名:");a(d,c)}}});function a(c,b){if(c==null){return}else{if(c.trim()==""){alert("输入用户名不能为空!")}else{var d=prompt("请输入客户类型:\n\n直销账号为0; 分销账号为1");if(d==null){return}else{if(d.trim()==""){alert("输入客户类型不能为空!");return}else{if(d!=0&&d!=1){alert("输入客户类型错误!");return}else{$.ajax({type:"POST",url:"/ajax/webTools_h.jsp",data:"cmd=getAcctInfo&inputAcctName="+c+"&inputAtype="+d,error:function(){Fai.ing("系统异常,请稍后重试",true)},success:function(e){var i=jQuery.parseJSON(e);if(i.success){if(i.aid==b.aid){alert("所输入的账号与当前网站账号相同,不能克隆!")}else{if(!i.isFaier){alert("你所输入网站账号不是内部账号,不能克隆!");return}var g=["把企业aid:"+b.aid+","+b.atypeName+","+b.aacct+b.siteVerName+"(原网站)","\n\n克隆\n\n","到企业aid:"+i.aid+","+i.atypeName+","+i.aacct+i.siteVerName+"(目标网站)"];var h=window.confirm(g.join(""));if(h){var f=window.confirm("确定克隆到id:"+i.aid+";"+i.atypeName+"账号:"+i.aacct+"?必须检查清楚!!")}if(f){$.ajax({type:"POST",url:"/ajax/webTools_h.jsp",data:"cmd=cloneWebSite&fromAid="+b.aid+"&toAid="+i.aid,error:function(){Fai.ing("系统异常,请稍后重试",true)},success:function(j){var k=jQuery.parseJSON(j);if(k.success){alert("克隆成功!");window.location.reload()}else{if(k.msg!=null){alert(k.msg)}else{alert("系统错误,克隆失败!")}}}})}}}else{if(i.msg==null){alert("系统出错,克隆失败!")}else{alert(i.msg)}}}})}}}}}}};Site.updateVersionTwoStyle=function(){var a,b;a=prompt("请输入更新2.0样式版本号的方式:\n\n指定样式id请输入0; 更新全部样式请输入1");if(a==0){b=prompt("请输入需要更新的2.0样式的id!!!");if(!Fai.isNumber(b)){alert("输入有误!");return}}else{if(a==1){var c="请输入需要更新2.0的样式的类型:\n\n更新全部类型的2.0样式请输入0\n\n更新所有主题样式请输入1\n\n更新所有模块样式请输入2\n\n更新所有导航样式请输入3";c+="\n\n更新所有模块组样式(横向)样式请输入4\n\n更新所有模块组样式(竖向)样式请输入5\n\n更新所有模块列样式请输入6\n\n更新所有自由容器样式请输入7\n\n更新所有导航2.0样式请输入8";var b=prompt(c);if(!Fai.isNumber(b)){alert("输入有误!");return}}else{if(a==null){return}else{if(a!=0&&a!=1){alert("输入有误!");return}}}}$.ajax({type:"POST",url:"/ajax/webTools_h.jsp",data:"cmd=updateStyleVersion&updateType="+a+"&updateId="+b,error:function(){Fai.ing("系统异常,请稍后重试",true)},success:function(d){var e=jQuery.parseJSON(d);alert(e.msg)}})};Site.setMallTrialTime=function(e){var f,b=new Date(),d=b.getFullYear(),g=b.getMonth()+1,a=b.getDate();if(e==0){f=d+"-"+g+"-"+a+" 00:00:00"}else{if(e==1){f=d+"-"+g+"-"+(a+1)+" 00:00:00"}else{f=prompt("修改商城试用到期时间。格式:2016-06-24 09:00:00","");var c=/^((((1[6-9]|[2-9]\d)\d{2})-(0?[13578]|1[02])-(0?[1-9]|[12]\d|3[01]))|(((1[6-9]|[2-9]\d)\d{2})-(0?[13456789]|1[012])-(0?[1-9]|[12]\d|30))|(((1[6-9]|[2-9]\d)\d{2})-0?2-(0?[1-9]|1\d|2[0-8]))|(((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))-0?2-29-)) (20|21|22|23|[0-1]?\d):[0-5]?\d:[0-5]?\d$/;if(!f.match(c)){alert("格式错误!请重新输入正确的商城试用到期时间。");return}}}$.ajax({type:"POST",url:"/ajax/webTools_h.jsp",data:"cmd=setMallTrialTimeEnd&trialTime="+f,error:function(){Fai.ing("系统异常,请稍后重试",true)},success:function(h){var i=jQuery.parseJSON(h);if(i.success){alert(i.msg);window.location.reload()}else{if(i.msg){alert(i.msg)}else{alert("系统错误,修改商城试用结束时间失败!")}}}})};Site.getModuleStatus=function(d){var e=1,g="module"+d,b=Fai.top.$("#"+g),c=b.attr("_side"),a=b.parent(),f=a.attr("id")||"";if(c==2){e=4}else{if(c==1){e=5}else{if(f=="floatLeftTopForms"||f=="floatRightTopForms"||f=="floatLeftBottomForms"||f=="floatRightBottomForms"){e=3}else{if(b.css("position")=="absolute"&&a.hasClass("absForms")){e=2}}}}return e};Site.jumpToModulePosition=function(c,g,b){var d=$("#module"+c),h=0;if(d.length<1){if(!b){return}else{if(b==("/col.jsp?id="+Fai.top._colId)){return}var k=Fai.getLanCode();k=k==""?"":"/"+k;document.location.href=k+b+"#fai_"+c+"_"+g}}if(g=="bottom"){h=d.height()}var j=window.location.hash;if(j==""){window.location.hash="fai_"+c+"_"+g}var e=0;$elem=$("#module"+c);var f=c;var i=false;while(!i){var a=Site.checkNestModule($elem).parentId;if(a>0){f=a;$elem=$("#module"+f);if($elem.attr("_modulestyle")==29){e-=$("#formTabButtonList"+f).height()}continue}else{i=true}}if(f==c&&$("#module"+c).attr("_modulestyle")==80){e=document.getElementById("module"+c).offsetTop+h}else{e+=$("#module"+c).offset().top-$("#fk-toolTopBar").height()-$("#memberBarArea").height()}$("html, body, #g_main, #web").animate({scrollTop:e},{duration:500,easing:"swing"});if(b!=""){$("#navCenter").find(".itemHover").removeClass("itemHover")}};Site.getTopWindow=function(){return(typeof Fai!="undefined"&&Fai.top)||window};Site.changeABVersion=function(){if(Site.isBUser()){$.cookie("isBUser","false")}else{$.cookie("isBUser","true")}window.location.reload()};Site.isBUser=function(){var a=false;if(Fai.top._aid%2==1){a=true}if($.cookie("isBUser")!=null){a=$.cookie("isBUser")==="true"?true:false}return a};Site.delAuthorizer=function(){$.ajax({type:"POST",url:"/ajax/webTools_h.jsp",data:"cmd=delAuthorizer",error:function(){Fai.ing("系统异常,请稍后重试",true)},success:function(a){var b=jQuery.parseJSON(a);Fai.ing(b.msg,true)}})};(function(c,a,d){a.runSiteInit=function(){var k=[81,97],l=k.length,g,h,f,e;for(f=0;f<l;f++){g=c(".formStyle"+k[f]);h=g.length;for(e=0;e<h;e++){a.run(g.eq(e).attr("id"))}}};var b={};a.init=function(e,f){var g=typeof f=="number"?f:f.moduleId;if(!g){return}var h="module"+g;b[h]=b[h]||[];b[h].push({runFun:e,args:f})};a.run=function(k,g){var f,e,j,h;if(b&&b[k]&&b[k].length>0){j=b[k];f=b[k].length;for(e=0;e<f;e++){h=j[e];if(h.runFun.indexOf("ImageEffect")<0){jzUtils.run({name:h.runFun},h.args)}else{jzUtils.run({name:h.runFun,callMethod:true},h.args)}}return g?true:(delete b[k])}return false}})(jQuery,Site.cacheModuleFunc||(Site.cacheModuleFunc={}));Site.onLogout=function(){$("#topBarMsg").show();$("#topBarMsg").html(LS.topBarLogouting);$.ajax({type:"post",url:"ajax/login_h.jsp?cmd=logoutMember",error:function(){alert(LS.topBarLogoutError);$("#topBarMsg").hide()},success:function(a){var a=jQuery.parseJSON(a);if(a.success){top.location.href="index.jsp";return}$("#topBarMsg").html(LS.topBarLogoutError)}})};Site.ajaxLoadModuleDom=function(b,a,c){$.ajax({type:"post",url:"ajax/ajaxLoadModuleDom_h.jsp",data:"cmd=loadModuleDom&_colId="+b+"&_extId="+a+"&ajaxOptionInfo="+Fai.encodeUrl($.toJSON(c))+"&anchor="+Fai.encodeUrl(Fai.top.location.hash),error:function(){Fai.ing("系统异常,请稍后重试",true)},success:function(j){var j=jQuery.parseJSON(j);if(j.success){var n=jQuery.parseJSON(j.rtInfo);var e=jQuery.parseJSON(j.memberInfo);if(n.topBar){var p=Fai.top.$("#memberBarArea");p.children().remove();p.append(n.topBar);Site.mallCartInit(Fai.top._colId);Site.mobiWebInit()}if(n.visitorCounter){var h=Fai.top.$(".visitorCounterWrap");h.children().remove();h.append(n.visitorCounter)}var x=n.webRightBar;if(x){$.getScript(x.resPath,function(){new Site.webRightBar.init(x.Logined,x.mallMember,x.choiceCurrencyVal,jQuery.parseJSON(x.memberInfo_out))})}if(n.moduleDomList){for(var q=0;q<n.moduleDomList.length;q++){var u=n.moduleDomList[q];var t=u.moduleId;var r=u.dom;loadWholeModuleDom(t,r)}jzUtils.run({name:"moduleAnimation.publish",base:Site})}var k=n.newsDetail;if(k){var f=Fai.top.$("#module"+k.moduleId);if(k.style==46){var m=f.find("#newsCommentDiv");if(m.length>0){m.children().remove();m.prepend(k.newsCommentHtml)}f.find("#commentTotalSize").text(k.commentSize);var s=f.find("#prevAndNextDiv");if(s.length>0){if(k.newsNextPreHtml){s.children().remove();s.prepend(k.newsNextPreHtml)}else{s.remove()}}var o=f.find(".newsViewCount");if(o.length>0){o.text(k.newsView)}f.prepend(k.newsDetailScripts)}else{if(k.style==103){var w=f.find("#prevAndNextDivV2");if(w.length>0){if(k.newsNextPreHtml){w.children().remove();w.prepend(k.newsNextPreHtml)}else{w.remove()}}}}}var g=n.productDetail;if(g){var f=Fai.top.$("#module"+g.moduleId);var v=f.find("#accumulativeComment");if(g.productCommentHtml&&v.length>0){v.children().remove();v.prepend(g.productCommentHtml)}f.find("#commentTotalSize").text(g.commentSize);var s=f.find("#prevAndNextDiv");if(g.productNextPreHtml&&s.length>0){s.children().remove();s.prepend(g.productNextPreHtml)}f.prepend(g.productDetailScripts)}var d=n.photoDetail;if(d){var f=Fai.top.$("#module"+d.moduleId);var l=f.find("#singlePhotopagenation"+d.moduleId);if(l.length>0){if(d.photoNextPreHtml){l.children().remove();l.prepend(d.photoNextPreHtml)}else{l.remove()}}}Site.fixSiteWidth(Fai.top._manageMode);Site.fixWebFooterHeight()}}})};function loadWholeModuleDom(b,c){var a=Fai.top.$("#module"+b);a.children().remove();a.prepend(c);Site.checkSideModule(a)}Site.getUrlParamObj=function(a){var d={};if(a.indexOf("?")!=-1){var f=a.substr(1);strs=f.split("&");for(var c=0;c<strs.length;c++){var b=decodeURIComponent(strs[c].split("=")[0]);var e=strs[c].split("=")[1];if(e){d[b]=decodeURIComponent(e)}else{d[b]=""}}}return d};Site.checkDomainAuth=function(){$.ajax({type:"post",url:"ajax/site_h.jsp?cmd=checkDomainAuth",error:function(){Fai.ing("系统异常,请稍后重试",true)},success:function(a){var a=jQuery.parseJSON(a);if(a.success){var b=[];b.push("<div id='domainAuthTips' style='z-index:9032; position:fixed; top:0px; left:0px; width:100%; height:50px; background: yellow; line-height:50px; text-align:center; font-weight:bold; font-size:14px;' >");b.push("目前你已有.com/.net/域名由于未实名认证,<span style='color:red;'>已被域名管理局停止访问</span>,现在进行实名认证,可恢复访问&nbsp;&nbsp;&nbsp;&nbsp;<a href='http://www.faisco.cn/portal.jsp#appId=dnspodTransfer' style='color:red;' target='_blank'>前往实名认证</a>");b.push("</div>");$.cookie("hasShowDomainAuthTips",true,{expires:90});Site.logDog(4000048,0);$("body").before(b.join(""))}}})};Site.getHtmlUrl=function(a){return Fai.top._allowedHtmlUrl&&Fai.top._openHtmlUrl?("h-"+a+".html"):(a+".jsp")};Site.accumulateWidth=function(c){var d=$("#fk-rbar-myItem-ImgShow-"+c),b=parseInt(d.find(".fk-rbar-myItem-Img").attr("width")),f=parseInt(d.find(".fk-rbar-myItem-Img").attr("height")),g=b+20,h=f+50,e=f+8,a=f+20;d.css({width:g+"px",height:h+"px",top:"-"+e+"px"});d.find(" .fk-rbar-myItem-Img").css({width:b+"px",height:f+"px"});d.find(" .fk-rbar-myItem-TextView").css({left:"10px",width:b+"px",top:a+"px"})};Site.forPayPopup=function(h,m,g,i,d){var a=arguments.callee.caller.arguments[0]||window.event,b=$(a.target);var l=a.clientX,f=a.clientY;Site.forPayPopup.timer=Site.forPayPopup.timer||null;if(i==0){clearTimeout(Site.forPayPopup.timer)}else{clearTimeout(Site.forPayPopup.timer);Site.forPayPopup.timer=setTimeout(function(){$(".features_container").remove()},300);return}function c(u,q){Site.logDog(200170,5);var t="",n="";if(m=="网站标准版"){n=q.std_lists}else{if(m=="网站专业版"){n=q.pro_lists}else{if(m=="商城基础版"){n=q.bus_lists}}}var s='<div class="features_container" style="z-index:9033;" ><div class="popupTitle">建议升级<span class="titleFontColor">'+m+"</span></div>";var p='<div class="features_title">特色功能:<div class="'+q.title.cla+' features_name"> <span></span>'+q.title.text+"</div></div>";var o='<div class="features_list"><ul>';for(var r=0;r<n.length;r++){o+="<li><span></span>"+n[r]+"</li>"}o+="</ul></div><a href='"+d+"' onclick='Site.logDog(200170, 4);' target='_blank' class='upBtn'>立即升级</a></div>";t=s+p+o;u.append(t)}var e={title:{text:g,cla:"bgm_color"},std_lists:["无广告","百度关键词设置","7x24小时安全监控"],pro_lists:["保证百度收录","支持QQ、微信登录","文章评论、提升品牌口碑"],bus_lists:["在线商城","微信支付、积分系统","打折、满减等促销"]};var l=b.offset().left-20,f=b.offset().top+30;var k=$("body").height()-b.offset().top-20,j=272-k;if(k<302&&b.offset().top>300){var l=b.offset().left,f=b.offset().top;f=f-j+20;l=l+18}b.attr("title","");if(h<30&&m=="网站标准版"){c($("body"),e);$(".titleFontColor").css("color","#faae54");$(".features_title .bgm_color").css("color","#faae54")}else{if(h<40&&m=="网站专业版"){c($("body"),e);$(".titleFontColor").css("color","#f55c7d");$(".features_title .bgm_color").css("color","#f55c7d")}else{if(h<50&&m=="商城基础版"){c($("body"),e);$(".titleFontColor").css("color","#557ce1");$(".features_title .bgm_color").css("color","#557ce1")}}}$(".features_container").mouseenter(function(){clearTimeout(Site.forPayPopup.timer);$(".features_container").show();activeFlag=true}).mouseleave(function(){clearTimeout(Site.forPayPopup.timer);$(".features_container").hide();Site.forPayPopup.timer=setTimeout(function(){$(".features_container").remove()},300)});$(".features_container").css({position:"absolute",left:l+"px",top:f+"px",overflow:"hidden"})};Site.bookingSubmitFullTips=function(){var c=new Array();c.push("<div style='width: 80px; height:80px; border-radius:50%; border: 4px solid gray; border: 4px solid gray; margin: 20px auto; padding: 0; position: relative; top:25px; box-sizing: content-box; border-color: #F8BB86;'>");c.push("<div style='animation: pulseWarningIns 0.75s infinite alternate; -webkit-animation: pulseWarningIns 0.75s infinite alternate;'>");c.push("<span style='position: absolute; width: 5px; height: 47px; left: 50%; top: 10px; webkit-border-radius: 2px; border-radius: 2px; margin-left: -2px; background-color: #F8BB86;'></span>");c.push("<span style='position: absolute; width: 7px; height: 7px; -webkit-border-radius: 50%; border-radius: 50%; margin-left: -3px; left: 50%; bottom: 10px; background-color: #F8BB86;'></span>");c.push("</div>");c.push("</div>");c.push("<div style='color:#333; font-size:16px; padding-top: 48px; text-align:center;'>"+LS.bookingSubmitFullTips+"</div>");c.push("<div style='text-align: center; margin-bottom: 30px; margin-top: 66px;'> ");c.push("<input id='confirm' class='popupBClose' style='width: 100px; height: 35px; font-size: 12px; margin: 0 20px; border: 1px solid #557ce1; background: #557ce1; border-radius: 2px; font-family: 微软雅黑; color: #fff; cursor: pointer;' type='button' value='"+LS.confirm+"'/>");c.push("</div>");var a={htmlContent:c.join(""),width:550,height:350,extClass:"fk-fileUpload-del",popupBoxZIndex:9999};var b=Site.popupBox(a)};Site.bindInTabSwitch=function(){$(".formStyle29").each(function(){var g=$(this).attr("id").replace("module","");if(Fai.top["tabModule"+g+"Switch"]){$(this).find(".formTabButton").off("mouseenter.tab").addClass("formTabButtonClick")}else{$(this).find(".formTabButton").off("mouseenter.tab").on("mouseenter.tab",function(){$(this).trigger("click")}).removeClass("formTabButtonClick")}});var b=new Array();var e=Fai.top.location.hash;var a=Fai.top.location.search;var d=0;if(a){var f=a.indexOf("pageno");var c=a.substring(f,a.length);a=a.replace(c,"");f=a.lastIndexOf("m");c=a.substring(0,f+1);d=a.replace(c,"")}$(".formTabButtonList").each(function(){$(this).find(".formTabButton").eq(0).click();$.each($(this).find(".formTabButton"),function(g,h){var k=$(h).attr("tabModuleId");if(("#module"+k)===e||$("#module"+k).find("#module"+d).length>0){b.push(parseInt(k));return false}var j=Fai.getUrlParam(Fai.top.location.href,"m"+k+"pageno");if(typeof(j)!="undefined"&&j.length>0){b.push(parseInt(k))}})});$(".formTabButtonYList").each(function(){$(this).find(".formTabButton").eq(0).click();$.each($(this).find(".formTabButton"),function(g,h){var k=$(h).attr("tabModuleId");if(("#module"+k)===e||$("#module"+k).find("#module"+d).length>0){b.push(parseInt(k));return false}var j=Fai.getUrlParam(Fai.top.location.href,"m"+k+"pageno");if(typeof(j)!="undefined"&&j.length>0){b.push(parseInt(k))}})});$.each(b,function(g,h){Site.changeLiCnt(h,false,29)})};Site.restartMarquee=function(a,c,e){var g=Fai.top.$("#module"+a),i=g.hasClass("formStyle4")||g.hasClass("formStyle5")||g.hasClass("formStyle16")||g.hasClass("formStyle77")||g.hasClass("formStyle31")||g.hasClass("formStyle42"),j=g.hasClass("formStyle2")||g.hasClass("formStyle3")||g.hasClass("formStyle8")||g.hasClass("formStyle12")||g.hasClass("formStyle30")||g.hasClass("formStyle41")||g.hasClass("formStyle74"),b=i?"photoList":"productList";var k=g.hasClass("formStyle88")||g.hasClass("formStyle89")||g.hasClass("formStyle90");if(k){b="listPhotos"}if(c){if(Fai.top[b+a]){var f=Fai.top[b+a].data;var h=Site.getModuleAttrPattern(a).photoList;var d=Site.getModuleAttrPattern(a).productList;Fai.stopInterval("marquee"+a);if(i){Site.loadPhotoMarquee(a,h.ns,f.cusPicSize,f.newMarqueeToward)}else{if(j){Site.loadProductMarquee(a,d.ns,f.cusPicSize,f.newMarqueeToward)}else{if(k){Site.loadPhotoMarquee(a,f.picScale,f.cusPicSize,f.newMarqueeToward,"listPhotos")}}}}else{new Function("Fai.top.changeMarquee"+a+"()")()}}if(e==29){$("#formTabCntId"+a).parent().find(".formTabCntId").each(function(){if($(this).attr("show")){$(this).show();if($(this).attr("styleId")==3||$(this).attr("styleId")==16||$(this).attr("styleId")==90){var l=$($(this).find(">div")[0]).attr("id").replace("module","");new Function("Fai.top.changeMarquee"+l+"()")()}}else{$(this).hide()}})}};Site.changeLiCnt=function(g,d,a){var c=$("#formTabCntId"+g).parent().find(".formTabCntId").eq(0).find(" >.form"),b=c.attr("id");if(b==("module"+g)){return}var e=$("#formTabButton"+g);e.find(".formTabLeft").addClass("formTabLeftHover").end().find(".formTabMiddle").addClass("formTabMiddleHover").end().find(".formTabRight").addClass("formTabRightHover").end().siblings().find(".formTabLeft").removeClass("formTabLeftHover").end().find(".formTabMiddle").removeClass("formTabMiddleHover").end().find(".formTabRight").removeClass("formTabRightHover").end();e.addClass("formTabButtonHover").siblings().removeClass("formTabButtonHover");$("#formTabCntId"+g).parent().find(".formTabCntId").each(function(){if($(this).attr("show")){$(this).removeAttr("show");$(this).removeClass("formTabCntIdHover")}});var f=$("#formTabCntId"+g);f.prependTo(f.parent());f.attr("show",true);f.addClass("formTabCntIdHover");Site.restartMarquee(g,d,a);Site.triggerGobalEvent("site_moduleTabSwitch",g);Site.fixModuleInTabSwitchBug(g);jzUtils.run({name:"moduleAnimation.publish",base:Fai.top.Site});jzUtils.run({name:"moduleAnimation.contentAnimationPublish",base:Fai.top.Site})};Site.initTabYStyle=function(d){var c=Fai.top.$("#module"+d),a=c.find(".titleTable");if(Fai.isIE6()){var e=c.find(".formMiddleCenter"+d).width(),b=a.width();c.find("#formTabContent"+d).css({width:(e-b-40)+"px","float":"left"})}};Site.fixModuleInTabSwitchBug=function(c){var b=$("#module"+c),a;if(b.hasClass("formStyle83")&&!!!b.data("fk_fixEffect")){Site.adjustPhotoCardImgSize(b);b.data("fk_fixEffect",1)}if(b.hasClass("formStyle85")&&!!!b.data("fk_fixEffect")){Site.adjustPhotoNewCardImgSize(b);b.data("fk_fixEffect",1)}if(b.hasClass("formStyle98")&&!!!b.data("fk_fixEffect")){Site.adjustPhotoMoreCardImgSize(b);b.data("fk_fixEffect",1)}if(b.hasClass("formStyle1")&&!!!b.data("fk_fixEffect")){Site.richMarquee(Fai.top["richMarqueeInTab"+c]);b.data("fk_fixEffect",1)}if(b.hasClass("formStyle7")||b.hasClass("formStyle6")){a=Fai.top["newsScrollOptions"+c];if((typeof a!="undefined")&&a.scroll){b.find(".separatorLine").css("display","")}}if((b.hasClass("formStyle2")||b.hasClass("formStyle3")||b.hasClass("formStyle4")||b.hasClass("formStyle12")||b.hasClass("formStyle30")||b.hasClass("formStyle74")||b.hasClass("formStyle41")||b.hasClass("formStyle8"))&&!!!b.data("fk_fixEffect")){if(Site.ImageEffect&&Site.ImageEffect.cashOptions&&c.toString() in Site.ImageEffect.cashOptions){jzUtils.run({name:"ImageEffect.FUNC.BASIC.Init",callMethod:true},Site.ImageEffect.cashOptions[c]);b.data("fk_fixEffect",1)}}};Site.isTabYModule=function(c){if(c.length<1){return}var b=c.hasClass("formStyle29"),a=c.hasClass("fk-formTabY");return b&&a};(function(f,a,g){var c=a.data,d=a.dom,e=a.utils,b=a.event;e.getBaseDom=function(){var i=c.moduleId,k,h,j,l;k=Fai.top.$("#module"+i);if(!k.length){return}if(k.hasClass("jz-moduleTabYPattern113")){return}h=Site.isTabYModule(k);if(!h){return}j=k.find(".formTabButtonYList");l=j.find(".formTabButton");if(!j.length||!l.length){return}return{module:k,formTabButtonYList:j,formTabButton:l}};e.getAllFormTabButtonHeight=function(){var i=d.formTabButton,h=0;i.each(function(){h+=f(this).outerHeight(true)});return h};e.checkHeightEnough=function(){var j=c.wrapperHeight,i=c.allFormTabButtonHeight,k=c.formTabButtonLength;var h=j>i;return h||k<2};e.getOnePageNumForFormTabButton=function(){var m=c.wrapperHeight,i=c.arrowHeight,h=c.formTabButtonHeight,j=c.formTabButtonHoverHeight,l,k;l=m-j-i;l=l<0?0:l;k=Math.round(l/h)+1;return k};e.getPageNum=function(){return Math.ceil(c.formTabButtonLength/c.onePageNumForFormTabButton)};b.findOrCreateArrow=function(){var l=d.formTabButtonYList,k=c.bgColor,h,j;j=l.find(".J_tabYArrow");j=j.length?j:f(i()).appendTo(l);j.css("background-color",k);j.find(".J_arrowTopBg").css("border-bottom-color",k);j.find(".J_arrowBotomBg").css("border-top-color",k);return j;function i(){var m=[];m.push("<div class='fk-tabYArrow J_tabYArrow'>");m.push("<div class='f-arrowBox'>");m.push("<div class='f-arrowBoxTop f-arrowBoxItem J_tabYArrowUp' style='display:none;'>");m.push("<i class='f-arrow1 f-arrow J_arrowColor'></i>");m.push("<i class='f-arrow2 f-arrow J_arrowTopBg'></i>");m.push("</div>");m.push("<div class='f-arrowBoxBottom f-arrowBoxItem J_tabYArrowDown f-arrowBoxBottomIndex'>");m.push("<i class='f-arrow1 f-arrow J_arrowColor'></i>");m.push("<i class='f-arrow2 f-arrow J_arrowBotomBg'></i>");m.push("</div>");m.push("</div>");m.push("</div>");return m.join("")}};b.setModuleNewHeight=function(){var h=c.onePageNumForFormTabButton,m=c.formTabButtonHeight,l=c.arrowHeight,i=c.moduleId,o=c.formTabButtonHoverHeight,k=d.formTabButtonYList,n=d.arrow;var p=(h-1)*m+o,j=p+l;n.css("top",p);Site.setModuleHeight2(i,j);return j};b.setPages=function(){var k=c.pageNum,j=c.onePageNumForFormTabButton,i=d.formTabButtonYList,m=d.formTabButton;for(var h=0;h<k;h++){for(var n=j*h,l=j*(h+1);n<l;n++){m.eq(n).addClass("tabYPage"+h).data("tabYPage",h)}}m.hide();i.find(".tabYPage0").show()};b.bindArrow=function(){var n=c.pageNum,i=d.arrow,o=d.formTabButton,m=d.formTabButtonYList,k=0;var h=i.find(".J_tabYArrowUp"),l=i.find(".J_tabYArrowDown");h.off("click.page").on("click.page",function(){if(k==0){return}k--;j();o.hide();m.find(".tabYPage"+k).show().eq(0).click()});l.off("click.page").on("click.page",function(){if(k==n-1){return}k++;j();o.hide();m.find(".tabYPage"+k).show().eq(0).click()});l.one("click.pageOne",function(){l.removeClass("f-arrowBoxBottomIndex");h.show();j()});function j(){if(k==0){h.find(".J_arrowColor").addClass("f-arrowDisable")}else{h.find(".J_arrowColor").removeClass("f-arrowDisable")}if(k==n-1){l.find(".J_arrowColor").addClass("f-arrowDisable")}else{l.find(".J_arrowColor").removeClass("f-arrowDisable")}}};b.resetDataAndDom=function(){for(var i in c){delete c[i]}for(var h in d){delete d[h]}};a.initArrowIfNotEnough=function(h,i){c.moduleId=h;d=f.extend(d,e.getBaseDom());if(f.isEmptyObject(d)){return b.resetDataAndDom()}c.wrapperHeight=d.module.height();c.formTabButtonHeight=d.formTabButton.not(".formTabButtonHover").outerHeight(true);c.formTabButtonLength=d.formTabButton.length;c.allFormTabButtonHeight=e.getAllFormTabButtonHeight();if(e.checkHeightEnough()){return b.resetDataAndDom()}c.bgColor=i||"#fff";d.arrow=b.findOrCreateArrow();c.arrowHeight=d.arrow.height();c.formTabButtonHoverHeight=d.formTabButtonYList.find(".formTabButtonHover").outerHeight(true);c.onePageNumForFormTabButton=e.getOnePageNumForFormTabButton();c.pageNum=e.getPageNum();c.wrapperHeight=b.setModuleNewHeight();if(!e.checkHeightEnough()){b.setPages();b.bindArrow()}else{d.arrow=d.arrow||b.findOrCreateArrow();d.arrow.remove()}b.resetDataAndDom()}})(jQuery,Site.tabDirectionY||(Site.tabDirectionY={data:{},dom:{},utils:{},event:{}}));Site.callMusicUnload=function(a,c){var b=Site.callMusicPosition(a);$.cookie(c,b)};Site.callMusicPlayButton=function(e,d,f,c){$("#"+e).bind("click",function(){var j=$.cookie(c);var i=$(this);var h=$("#"+e).attr("bgMusicStatus");if(h!=j){$.cookie(c,h)}j=$.cookie(c);if(j=="true"){$("#"+e).attr("bgMusicStatus","false");$.cookie(c,false);Site.reStartMusic(d);i.attr("title",LS.pauseMusic);i.removeClass("bgplayerButtonP")}else{if(i.hasClass("bgplayerButtonP")){$("#"+e).attr("bgMusicStatus","false");Site.reStartMusic(d);i.attr("title",LS.pauseMusic);i.removeClass("bgplayerButtonP")}else{var g=Site.callMusicPosition(d);$.cookie(f,g);$("#"+e).attr("bgMusicStatus","true");$.cookie(c,true);Site.stopMusic(d);i.attr("title",LS.playMusic);i.addClass("bgplayerButtonP")}}});var b=$.cookie(c);var a=Fai.top.$("#"+e);if(b=="true"){a.attr("title",LS.playMusic);a.addClass("bgplayerButtonP");a.show()}else{a.show();a.attr("title",LS.pauseMusic);a.removeClass("bgplayerButtonP")}};Site.SetPositionZero=function(){$.cookie("bgplayerTime","0");var a=$("#bgplayerButton");a.attr("title",LS.playMusic);a.addClass("bgplayerButtonP")};Site.callMusicPosition=function(a){var b;try{b=Site.callMusic(a).getMusicPosition()}catch(c){}return b};Site.stopMusic=function(a){var b;try{b=Site.callMusic(a).stopMusic()}catch(c){}return b};Site.reStartMusic=function(b){var a;try{a=Site.callMusic(b).reStartMusic()}catch(c){}return a};Site.getMusicLength=function(a){var b=-1;try{while(b<0){b=Site.callMusic(a).getSoundLength()}}catch(c){}return b};Site.changeVol=function(a,b){try{Site.callMusic(a).changeVolume(b)}catch(c){console.log(c.stack)}};Site.callMusic=function(a){var b=document[a]||window[a]||Site.getTopWindow().document[a];return b};Site.bgmFlushContinue=function(){var a=$("#bgplayerButton").attr("bgmusicstatus");if(a=="false"){$.cookie("bgplayerPause","false");$.cookie("hasMusicPlaying","false")}if(a=="false"){Site.callMusicUnload("faiBgMusicPlayer","bgplayerTime")}};Site.appendQuickTime=function(b){var e=new Array(),d=b.width,c=b.height,a=b.path;e.push("<object width='"+d+"' height='"+c+"' classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' codebase='http://www.apple.com/qtactivex/qtplugin.cab'>");e.push("<param name='src' value='"+a+"'>");e.push("<param name='controller' value='true'>");e.push("<param name='type' value='video/quicktime'>");e.push("<param name='autoplay' value='false'>");e.push("<param name='target' value='myself'>");e.push("<param name='pluginspage' value='http://www.apple.com/quicktime/download/index.html'>");e.push("<embed src='"+a+"' width='"+d+"' height='"+c+"' ");e.push("controller='true' align='middle' target='myself' type='video/quicktime' autoplay='false' ");e.push("pluginspage='http://www.apple.com/quicktime/download/index.html'>");e.push("</embed>");e.push("</object>");$("#"+b.parentId).append(e.join(""))};Site.appendWMP=function(b){var a=new Array(),e=b.width,d=b.height,c=b.path;a.push("<embed type='application/x-mplayer2' classid='clsid:6bf52a52-394a-11d3-b153-00c04f79faa6' ");a.push("src='"+c+"' wmode='opaque' quality='high' ");a.push("enablecontextmenu='false' autostart='false' windowlessVideo='true' ");a.push("width='"+e+"' height='"+d+"'>");a.push("</embed>");$("#"+b.parentId).append(a.join(""))};Site.vote=function(f,i,d,e){if(_siteDemo){Fai.ing("当前为“模板网站”,请先“复制网站”再进行投票。");return}var j=$("#voteMsg"+f+i),g=parseInt($.cookie("vote"+f)),a=true;var c=new Array();j.hide();$(".voteItems"+f+i).each(function(){var l={};var k=new Array();$(this).find(".voteItemCheck").find("input:checked").each(function(){var m=$(this).val();if(!isNaN(m)){k.push(parseInt(m))}});if(k.length==0){j.show();j.text(LS.voteNotSelect);a=false;return}l.itemList=k;c.push(l)});if(!a){return}$("#vote"+f+i).attr("disabled",true);$("#vote"+f+i).faiButton("disable");$.ajax({type:"post",url:"ajax/vote_h.jsp?cmd=voteItem",async:false,data:"vid="+f+"&itemlist="+Fai.encodeUrl($.toJSON(c)),error:function(){var l=Site.getDialogContent(false,Fai.format(LS.voteError));var k={htmlContent:l,width:205,height:78};Site.popupBox(k);setTimeout(function(){document.location.reload()},3000)},success:function(m){var k=jQuery.parseJSON(m);if(k.success){j.hide();var n=Site.getDialogContent(true,Fai.format(LS.voteSuccess));var l={htmlContent:n,width:205,height:78};Site.popupBox(l);setTimeout(function(){document.location.reload()},1000);$(".voteItems"+f+i).find("input:checked").each(function(){$(this).attr("checked",false)});if(d>0){if(!$.cookie("vote"+f)){var o=new Date();o.setHours(o.getHours()+d);$.cookie("vote"+f,d,{expires:o})}}else{if(d==0){$.cookie("vote"+f,null)}else{$.cookie("vote"+f,-1,{expires:30})}}}else{if(k.login){j.show();voteMsgs.text(LS.voteErrorByNotLogin)}else{j.hide();if(k.needCode){b();return}var n=Site.getDialogContent(false,k.msg);var l={htmlContent:n,width:205,height:78};Site.popupBox(l);setTimeout(function(){document.location.reload()},1000)}}setTimeout(function(){$("#vote"+f+i).removeAttr("disabled");$("#vote"+f+i).faiButton("enable")},3000)}});function b(){var k=[];k.push("<div class='voteCodePanelBg'></div>");k.push("<div class='voteCodePanel'><div class='voteCodePanelClose'></div>");k.push("<div class='voteCodePanelTitle'><div class='voteCodePanelTitleFont'>输入验证码</div></div>");k.push("<div class='voteCodePanelContent'>");k.push("<div class='voteCodeLine'>");k.push("<div class='voteCodeTitle'>验证码:</div>");k.push("<div id='voteCodeInput' class='voteCodeInput'><input id='needVoteCode' class='voteCodeInputText myTradeInputPlaceholder' type='text' onfocus='$(\"#needVoteCode\").css(\"border-color\", \"#E3E2E8\");' placeholder='请输入图片验证码,防止刷票'/></div>");k.push("<div class='voteCodePicPanel'><img alt='' class='voteCodePic' onclick='Site.changeCaptchaImg(this, 3)' title='看不清,换一张' id='memberCaptchaImg' src='validateCode.jsp?Math.random()*1000'></div>");k.push("</div>");k.push("<div class='voteCodePanelSubmit'>确定</div><div class='voteCodePanelCannel 'voteCodePanelClose'>取消</div>");k.push("</div>");k.push("</div>");$("#g_main").after(k.join(""));var l=(Fai.top.document.documentElement.clientWidth-$(".voteCodePanel").width())/2;var m=(Fai.top.document.documentElement.clientHeight-$(".voteCodePanel").height())/2+$(window).scrollTop();$(".voteCodePanel").css({left:l,top:m});$(".voteCodePicPanel>.voteCodePic").attr("src","validateCode.jsp?"+Math.random()*1000+"&validateCodeRegType=3");$(".voteCodePanelClose, .voteCodePanelClose").unbind("click").bind("click",function(){$(".voteCodePanelBg").remove();$(".voteCodePanel").remove()});$("#needVoteCode").unbind("keyup").bind("keyup",function(){$(".voteCodePanelSubmit").css({border:"1px solid #557ce1","background-color":"#557ce1",color:"white"});if($("#needVoteCode").val()==""){$(".voteCodePanelSubmit").css({border:"1px solid #e7e7eb","background-color":"#f2f2f5",color:"#d2d2d2"})}});$(".voteCodePanelSubmit").unbind("click").bind("click",function(){var n=$("#needVoteCode").val();$.ajax({type:"post",url:"/ajax/vote_h.jsp?cmd=voteItem",data:"vid="+f+"&itemlist="+Fai.encodeUrl($.toJSON(c))+"&verificationCode="+Fai.encodeUrl(n),error:function(){alert("服务繁忙,请稍后再试。")},success:function(o){o=$.parseJSON(o);if(o.success){$(".voteCodePanel").remove();$(".voteItems"+f+i).find("input:checked").each(function(){$(this).attr("checked",false)});h()}else{$("#needVoteCode").css("border-color","red");$(".voteCodePanel").find(".voteCodePic").attr("src","validateCode.jsp?"+Math.random()*1000+"&validateCodeRegType=3")}}})})}function h(){var k=[];k.push("<div class='voteSuccessPanel sweet-alert'><div class='voteSuccessPanelClose'></div>");k.push(" <div class='sa-icon sa-success animate'>");k.push(" <span class='sa-line sa-tip animateSuccessTip'></span>");k.push(" <span class='sa-line sa-long animateSuccessLong'></span>");k.push(" <div class='sa-placeholder'></div>");k.push(" <div class='sa-fix'></div>");k.push(" </div>");k.push(" <div class='voteSuccessTitle'>感谢您的投票</div>");k.push("</div>");$("#g_main ").after(k.join(""));var l=(Fai.top.document.documentElement.clientWidth-$(".voteSuccessPanel").width())/2;var m=(Fai.top.document.documentElement.clientHeight-$(".voteSuccessPanel").height())/2+$(window).scrollTop();$(".voteSuccessPanel").css({left:l,top:m});$(".voteSuccessPanelClose").unbind("click").bind("click",function(){$(".voteCodePanelBg").remove();$(".voteSuccessPanel").remove()});setTimeout(function(){$(".voteCodePanelBg").remove();$(".voteSuccessPanel").remove()},2000)}};Site.initModuleVote=function(d){var e=d.id,c=d.delay,b=d.mid,a=d.isVoted;if(c==0){$.cookie("vote"+e,null)}else{if(c==-1){if($.cookie("vote"+e)){$.cookie("vote"+e,-1,{expires:30})}}else{if($.cookie("vote"+e)=="-1"){$.cookie("vote"+e,null)}}}$("#vote"+e+b).click(function(){Site.vote(e,b,c,a)})};Site.fixModuleVoteStyle=function(b,a){if($("#module"+a).width()<=400){$("#module"+a).find(".voteItems"+b+a).find(".voteItemPanel").css({width:"100%","padding-bottom":"10px"});$("#module"+a).find(".voteItems"+b+a).find(".voteItemCheck").css({padding:"10px 0 0px 5px"})}};Site.fixVoteResultImgStyle=function(c,a,d,b){if($("#module"+a).width()>400){if(d!=-1&&b=="img"){$("#module"+a).find(".voteResult").find(".vi-percent").find(".voteVfmImg").each(function(){$(this).css("width",$("#module"+a).find(".voteResult").find(".vi-percent").width()-48)})}}if($("#module"+a).width()<=400){$("#module"+a).find(".voteResult").find(".vi-percent").find(".voteItemImg").find("img").css({width:"30px",height:"30px"});if(d!=-1&&b=="img"){$("#module"+a).find(".voteResult").find(".vi-name").css({"text-align":"center"});$("#module"+a).find(".voteResult").find(".vi-percent").find(".voteItemImg").css({"margin-right":"2px"});$("#module"+a).find(".voteResult").find(".vi-percent").find(".voteVfmImg").each(function(){$(this).css("width",$("#module"+a).find(".voteResult").find(".vi-percent").width()-30);$(this).css("margin-top","4px")})}}};Site.fixModuleVoteResultStyle=function(b,a,c){if($("#module"+a).width()<=400){$("#module"+a).find(".voteResult").find(".vi-name").css({width:"30%"});$("#module"+a).find(".voteResult").find(".vi-percent").css({width:"50%"});$("#module"+a).find(".voteResult").find(".vi-percent").find(".voteVfm").css({height:"22px"});$("#module"+a).find(".voteResult").find(".vi-count").css({width:"20%"});$("#module"+a).find(".voteResult").find(".vi-count").find(".voteItemCount").css({"padding-left":"0"})}if(c!=-1){$("#module"+a).find(".voteResult").find(".vi-percent").find(".voteVfm").find(".g_block").each(function(){$(this).addClass("g_block"+c)})}};Site.showNavSubMenu=function(c){if(Fai.top._useNavVersionTwo){if(Fai.top._navStyleV2Data.snt!=0){return}}var b=0;if(c==1){b=1}var a=Fai.top.$("#nav");if(Fai.top._useNavVersionTwo){a=Fai.top.$("#navV2")}$.each(a.find(".navCenter .item"),function(v,r){$(this).unbind();if(c==100){var z=$(this);var o=Fai.top._colId;var B=Fai.top._fromColId;var h=z.attr("colId");if(h==o||h==B){z.addClass("itemSelected")}z.hover(function(){$(this).addClass("itemHover")},function(){$(this).removeClass("itemHover")});if(z.find(".navSubMenu").length>=1){return}var p=z.attr("id");var l=[];try{l=Fai.fkEval(p+"SubMenu")}catch(w){return false}if(!l||l.length<1){return}var f=0;if(h==o||h==B){f=1}else{for(var v=0;v<l.length;++v){var d=l[v].colId;if(d==o||d==B){f=2;break}if(!Fai.isNull(l[v].sub)){var s=l[v].sub;for(var r=0;r<s.length;++r){var A=s[r].colId;if(A==o||A==B){f=3;break}}}if(f!=0){break}}}if(l){Site.removeNavHiddenMenu(l)}if(h==o||h==B){if(l&&l.length>=1){z.addClass("itemPopupSelected")}}if(f==0){return}if(!l||l.length<1){return}var g=$("<div class='navSubMenu'></div>");var t=$("<div class='content2'><table class='top' cellpadding='0' cellspacing='0'><tr><td class='left'></td><td class='center'></td><td class='right'></td></tr></table><table class='middle' cellpadding='0' cellspacing='0'><tr><td class='left'></td><td class='center'></td><td class='right'></td></tr></table><table class='bottom' cellpadding='0' cellspacing='0'><tr><td class='left'></td><td class='center'></td><td class='right'></td></tr></table></div>");t.appendTo(g);t=t.find(".middle .center");for(var v=0;v<l.length;++v){var x="";if(l[v].colId==o||l[v].colId==B){x=" itemSelected"}var k="<table class='item"+x+"' cellpadding='0' cellspacing='0'><tr><td class='itemLeft'></td><td class='itemCenter'><a href='"+l[v].href+"'>"+l[v].html+"</a></td><td class='itemRight'></td></tr></table>";$(k).appendTo(t);if(f==1){continue}if(f==2&&o!=l[v].colId&&B!=l[v].colId){continue}if(Fai.isNull(l[v].sub)||l[v].sub.length<1){continue}var s=l[v].sub;if(f==3){var q=false;for(var r=0;r<s.length;++r){if(s[r].colId==o||s[r].colId==B){q=true;break}}if(!q){continue}}var j=$("<div class='content3'><table class='top' cellpadding='0' cellspacing='0'><tr><td class='left'></td><td class='center'></td><td class='right'></td></tr></table><table class='middle' cellpadding='0' cellspacing='0'><tr><td class='left'></td><td class='center'></td><td class='right'></td></tr></table><table class='bottom' cellpadding='0' cellspacing='0'><tr><td class='left'></td><td class='center'></td><td class='right'></td></tr></table></div>");j.appendTo(t);j=j.find(".middle .center");for(var r=0;r<s.length;++r){var u="";if(s[r].colId==o||s[r].colId==B){u=" itemSelected"}var m="<table class='item"+u+"' cellpadding='0' cellspacing='0'><tr><td class='itemLeft'></td><td class='itemCenter'><a href='"+s[r].href+"'>"+s[r].html+"</a></td><td class='itemRight'></td></tr></table>";$(m).appendTo(j)}}g.insertAfter($(this));g.find(".item").hover(function(){$(this).addClass("itemHover");$(this).siblings(".outMenuTriangle").addClass("triangleHover")},function(){$(this).removeClass("itemHover");$(this).siblings(".outMenuTriangle").removeClass("triangleHover")})}else{var z=$(this);var o=Fai.top._colId;var B=Fai.top._fromColId;var h=z.attr("colId");var p=z.attr("id");var l=[];try{l=Fai.fkEval(p+"SubMenu")}catch(w){return false}var y=v+1;var q=false;if(o==h||B==h){q=true}else{if(l&&l.length>=1){for(var v=0;v<l.length;++v){var d=l[v].colId;if(d==o||d==B){q=true;break}if(!Fai.isNull(l[v].sub)){var s=l[v].sub;for(var r=0;r<s.length;++r){var A=s[r].colId;if(A==o||A==B){q=true;break}}}if(q){break}}}}if(l){Site.removeNavHiddenMenu(l)}if(q){z.addClass("itemSelected");z.addClass("itemSelectedIndex"+y);if(l&&l.length>=1){z.addClass("itemPopupSelected")}}$(this).hover(function(){var C=$(this);var H=C.attr("id");var n=[];try{n=Fai.fkEval(H+"SubMenu")}catch(F){return false}C.addClass("itemHover");C.addClass("itemHoverIndex"+y);if(n&&n.length>=1){C.addClass("itemPopupHover")}var i="";if(a.hasClass("navStyle")){var E=a.attr("class").split(" ");$.each(E,function(e,I){if(I.search(/navStyle/)!=-1){i+=I+" "}})}else{if(Fai.top._isTemplateVersion2||Fai.top._uiMode){i="navStyle "}}var D="<div class='navSubMenu'></div>";var G=Site.showMenu({container:D,mode:b,id:H+"SubMenu",minWidth:C.width(),host:C,clsIndex:y,data:n,fixpos:false,rulerObj:a,navSysClass:i,navBar:true});if(G!=null){G.hover(function(){C.addClass("itemHover");G.find(".outMenuTriangle").addClass("triangleHover");if(n.length>0){C.addClass("itemPopupHover")}},function(){C.removeClass("itemHover");C.removeClass("itemPopupHover");G.find(".outMenuTriangle").removeClass("triangleHover")})}},function(){$(this).removeClass("itemHover");$(this).removeClass("itemHoverIndex"+y);$(this).removeClass("itemPopupHover");if($(".navSubMenu").length==0){$(this).removeClass("itemHover")}})}})};Site.removeNavHiddenMenu=function(c){for(var b=c.length-1;b>=0;--b){if(c[b].hidden){c.splice(b,1);continue}if(c[b].sub){var a=c[b].sub;for(var d=a.length-1;d>=0;--d){if(a[d].hidden){a.splice(d,1)}}}}};Site.showNavItemContainer=function(){var b=Fai.top.$("#nav");if(Fai.top._useNavVersionTwo){b=Fai.top.$("#navV2")}var g=b.find(".navCenter"),l=b.width();if(g.length>0){g.removeAttr("style")}Site.hideNavItemContainer();var o=b.find(".itemContainer"),q=g.outerWidth(true),d=0;var k=b.find(".item"),j=b.find(".itemSep"),a=k.css("float")==="none";if(a){return}Fai.top.$.each(k,function(){d+=$(this).outerWidth(true)});Fai.top.$.each(j,function(){d+=$(this).outerWidth(true)});o.off("mouseover.navigator").on("mouseover.navigator",".item",function(){var r=0;o.children().each(function(s,t){r+=$(t).outerWidth(true)});if(r>o.width()){o.css("width",r)}});if(Fai.isIE()||Fai.isMozilla()){d+=4}var f=b.find(".itemPrev"),i=b.find(".itemNext");if(Fai.top._isTemplateVersion2){f.css("display","none");i.css("display","none")}if(Fai.isIE6()||Fai.isIE7()){l=Fai.top._navStyleData.ns.w}function n(t){if(Fai.top._useNavVersionTwo){g.css("width","inherit")}if(!Fai.top._cusResponsive){o.css("width",d+"px")}if((Fai.isIE()||Fai.isMozilla())&&(d==t+4)){}else{i.css("display","block")}Fai.top._templateOtherStyleData.h=0;var s=0,r=0,x=0,w;if(j.is(":hidden")){w=0}else{w=j.width()/2}var u=g.offset().left;var v=[];k.each(function(y){v[y]=$(this).offset().left-u;r++});i.unbind("mousedown").unbind("mouseleave");f.unbind("mousedown").unbind("mouseleave");i.width(i.data("width"));i.mousedown(function(){x=v[s+1]-v[s];if(s==0){x-=w}s++;if(s==r){s=r-1}$(this).addClass("itemNextHover");o.css("left",(o.position().left-x)+"px");if(o.position().left<0){f.css("display","block")}if((Math.abs(o.position().left)+t)>=d){i.data("width",i.width());i.width(0)}}).mouseleave(function(){$(this).removeClass("itemNextHover")});f.mousedown(function(){x=v[s]-v[s-1];if(s==1){x-=w}s--;if(s<0){s=0}$(this).addClass("itemPrevHover");o.css("left",(o.position().left+x)+"px");if((Math.abs(b.find(".itemContainer").position().left)+t)<d){i.width(i.data("width"))}if(o.position().left>=0){f.css("display","none")}}).mouseleave(function(){$(this).removeClass("itemPrevHover")});i.off("mouseover.nav").on("mouseover.nav",function(){$(this).addClass("itemNextHover")});f.off("mouseover.nav").on("mouseover.nav",function(){$(this).addClass("itemPrevHover")})}var m=false;if(Fai.top._useNavVersionTwo){var c=b.find(".navContent").width();if(d>q&&c>q){m=true}}if(d>q&&!m){n(q)}else{if(b[0].className&&b[0].className.indexOf("nav2")>-1||Fai.top._useNavVersionTwo){var h=o.css("margin-left")?o.css("margin-left").replace("px",""):0,e=d+parseInt(h),p=parseInt(e)+10;g.css("width",Math.min(l,p));if(l===Math.min(l,p)&&d>l){n(l)}if(Fai.isIE11()){g.css("height",o.outerHeight(true)+"px")}if(Fai.top._manageMode){jzUtils.run({name:"reSaveNavCenterWidth"},e)}}}if(Fai.top._useNavVersionTwo){if(top._navStyleV2Data.nct.cw!=g.width()){setTimeout(function(){top._navStyleV2Data.nct.cw=parseInt(g.width());top._navStyleV2Changed++},0)}if(Fai.top._manageMode){Site.autoNavCenterWidth()}}};Site.hideNavItemContainer=function(){$("#nav .itemContainer").removeAttr("style");$("#nav").find(".itemPrev").hide();$("#nav").find(".itemNext").hide()};Site.hideNavSubMenu=function(){Fai.top.$.each(Fai.top.$("#nav .navCenter .item"),function(a,b){$(this).unbind()})};Site.initModuleNavListGroup=function(c,b){$("#module"+c+" .g_foldValueCenter").mouseover(function(){$(this).addClass("g_hover")}).mouseleave(function(){$(this).removeClass("g_hover")});if(b){var a=$("#module"+c).find(".formMiddle"+c).find("table.g_foldContainerContent").find(".g_foldContainerContentCenter");var d=a.find(".g_foldContainerName");$.each(d,function(e,g){var f=$(g);f.css("cursor","pointer");f.click(function(){var h=$(this).next();if(h.is(":visible")){var i=$(f.find(".g_unfold")[0]);i.removeClass("g_unfold").addClass("g_fold");h.hide()}else{var i=$(f.find(".g_fold")[0]);i.removeClass("g_fold").addClass("g_unfold");h.show()}})})}};Site.initModuleNavListAcrossDisplay=function(c,d,b,e){var a=$("#module"+c);m_formMiddleWidth=a.find(".formMiddle").width(),mSOptions={moduleId:c,clsStr:"navAcrossContainer navAPanel"};a.find(".navA_C_J .navA_J").hover(function(){var n=$(this),h=n.attr("_colId"),j=d[h],i=a.attr("_side"),m=a.parent(),l=a.parent().attr("id"),k=true;mSOptions.that=n;if(Fai.isIE6()||Fai.isIE7()){k=false}else{if(i==2){k=false}else{if(i==1){k=false}else{if(l=="floatLeftTopForms"||l=="floatRightTopForms"||l=="floatLeftBottomForms"||l=="floatRightBottomForms"){k=false}else{if(a.css("position")=="absolute"&&m.hasClass("absForms")){k=false}}}}}if(j!=null&&j.length>0){var o=[],f=$("#navAcM"+c+"C"+h+"Panel");if(f.length==0){o.push("<div class='s_navList'>");$.each(j,function(s,r){var v=r.allowed;var u="onclick = 'Fai.ing(LS.memberLoginNoPermission, false);'";if(!_isMemberLogin){v=true}if(v){u=" onclick = 'return true;' "}var q="";if(!!d[r.id]){q=" navA_more"}var t="";if(r.openType){t="target='_blank';"}o.push("<table class='navAcrossCotent childNavA_J g_item' cellpadding='0' cellspacing='0' _colId="+r.id+" style='*width:auto;'><tr>");o.push("<td class='navAcrossCotentLeft'></td>");o.push("<td class='navAcrossCotentCenter'>");if(b&&!!d[r.id]){o.push("<a href='javascript:void(0);' style='cursor:default;'>"+r.name+"</a></td>")}else{o.push('<a href="'+(v?r.url:"javascript:void(0);")+'" '+t+u+">"+r.name+"</a></td>")}o.push("<td class='navAcrossCotentRight"+q+"'></td>");o.push("</tr></table>")});o.push("</div>");mSOptions.idStr="navAcM"+c+"C"+h+"Panel";mSOptions.contentStr=o.join("");f=Site.moduleSubPanel(mSOptions);var p=n.offset().left,g=n.offset().top;if(!k){p+=n.outerWidth()}f.css({top:g,left:p}).show()}if(k){var p=a.offset().left+a.outerWidth();a.css("z-index",9030);f.stop(true,false).animate({left:p},500)}f.mouseleave(function(){n.removeClass("g_hover")});f.mouseover(function(){n.addClass("g_hover")});f.find(".childNavA_J").hover(function(){var s=$(this),x=s.attr("_colId"),u=d[x];mSOptions.that=s;if(u!=null&&u.length>0){var r=[],t=$("#navAcM"+c+"C"+x+"Panel");if(t.length==0){r.push("<div class='s_navList'>");$.each(u,function(y,C){var B=C.allowed;var A="onclick = 'Fai.ing(LS.memberLoginNoPermission, false);'";if(!_isMemberLogin){B=true}if(B){A="onclick = 'return true;'"}var z="";if(C.openType){z="target='_blank';"}r.push("<table class='navAcrossCotent grandNavA_J g_item' cellpadding='0' cellspacing='0' style='*width:auto;'><tr>");r.push("<td class='navAcrossCotentLeft'></td>");r.push("<td class='navAcrossCotentCenter'>");r.push("<a href='"+(B?C.url:"javascript:void(0);")+"' "+z+A+">"+C.name+"</a>");r.push("<td class='navAcrossCotentRight'></td>");r.push("</tr></table>")});r.push("</div>");mSOptions.idStr="navAcM"+c+"C"+x+"Panel";mSOptions.contentStr=r.join("");t=Site.moduleSubPanel(mSOptions);var w=s.offset().left,v=s.offset().top;if(!k){w+=s.outerWidth()}t.css({top:v,left:w}).show();if(k){var q=s.offset().left+s.outerWidth();t.css("z-index",1);t.stop(true,false).animate({left:q},500)}}t.find(".grandNavA_J").hover(function(){$(this).addClass("g_hover")},function(){$(this).removeClass("g_hover")});t.mouseleave(function(){f.attr("_mouseIn",0);n.removeClass("g_hover");s.removeClass("g_hover")});t.mouseover(function(){f.attr("_mouseIn",1);n.addClass("g_hover");s.addClass("g_hover")});s.mouseleave(function(){f.attr("_mouseIn",0)})}s.addClass("g_hover")},function(q){$(this).removeClass("g_hover")})}n.addClass("g_hover")},function(f){$(this).removeClass("g_hover")}).mouseleave(function(){a.css("z-index","")});Site.initContentSplitLine(c,e)};Site.onSiteFixTop=function(){if(Fai.top._Global._navHidden){return}var q="#nav";if(Fai.top._useNavVersionTwo){q="#navV2"}var d,r=false,c=false,k=false,B=Fai.isIE6(),A=Fai.isIE7(),s=Fai.top.$(q),D=Fai.top.$(window),x=Fai.top.$("#g_main"),i=Fai.top.$("#web"),u=Fai.top.$("body"),a=Fai.top.$(".webNavTable"),j=Fai.top.$(".webHeaderTable"),m=Fai.top.$(".webBannerTable"),p=Fai.top.$(".floatLeftTop"),e=s.parent(),v=Fai.top.$("#sitetips"),o=Fai.top.$("#webBanner"),b=Fai.top.$("#webHeader"),l=Fai.top.$("#webNav"),t,n=parseInt(s.css("top").replace("px","")),E=s.offset().top,z=v.height()||0,h=E-z,g=p.css("top").replace("px","")||0,y=Fai.top.$(window),G=y;if(B||A){c=true;G=x}if(isNaN(n)){n="auto"}else{n=n+"px"}var w;if(s.width()==i.width()){k=true;w="100%"}else{w=s.width()+"px"}var f=s.offset().left-e.offset().left;var C,F;G.on("scroll.nav",function(){var I=G.scrollTop(),H=parseInt(p.css("top").replace("px",""));g=H||0;d=Site.getNavInClientPosition(s).left;if(!r&&h<I){if(B){C=s.parent();F=s.offset().left-C.offset().left;u.prepend(s);s.css({position:"absolute",left:d+"px",top:g+"px",width:w});s.css("width",w)}else{s.addClass("navfixtop");s.css({width:w,left:d+"px",top:g+"px"});if(k&&i.width()>D.width()){s.css("width",i.width()+"px")}if(a.find(q).length>0){t=a}else{if(j.find(q).length>0){t=j}else{if(m.find(q).length>0){t=m}}}t.css({zIndex:"30",position:"relative"});o.addClass("fix-zIndex");b.addClass("fix-zIndex");l.addClass("fix-zIndex")}r=true}if(r&&h>=I){if(B){e.append(s);s.css({position:"",width:"",left:"",top:"",zIndex:""})}else{s.removeClass("navfixtop");s.css({position:"",width:"",left:"",top:""});if(t){t.css("zIndex","")}o.removeClass("fix-zIndex");b.removeClass("fix-zIndex");l.removeClass("fix-zIndex")}r=false}});Fai.top.$(window).on("resize.nav",function(){if(B&&!k&&s.offset().top==0){s.css("left",C.offset().left+F)}else{if(s.hasClass("navfixtop")&&k){if(i.width()<D.width()){s.css("width","")}else{if(i.width()>D.width()){setTimeout(function(){s.css("width",i.width()+"px")},0)}}}if(s.hasClass("navfixtop")&&!k){setTimeout(function(){s.css("left",e.offset().left+f)},0)}}})};Site.getNavInClientPosition=function(b){var a=b[0];if(typeof a.getBoundingClientRect!=="undefined"){return a.getBoundingClientRect()}else{var c=Fai.top._manageMode?Fai.top.$("#g_main"):Fai.top.$(window),e={left:0,right:0},d=a.offsetParent;e.left=a.offsetLeft;e.top=a.offsetTop;while(d!==null){e.left+=d.offsetLeft;e.top+=d.offsetTop;d=d.offsetParent}if(b.css("position")=="fixed"){e.top=b.css("top")}return{left:e.left-c.scrollLeft(),top:e.top-c.scrollTop()}}};Site.onNavCntPositionFixTop=function(){if(Fai.top._Global._navHidden||!Fai.top._navStyleData.no){return}if(Fai.top._manageMode){Site.onManageFixTop()}else{Site.onSiteFixTop()}};(function(){if(Fai.top!=window){return}var g=Fai.top.window.location.hash,d,f,b;var c=0;var e;var h=$("#module"+e);var a=Fai.top.$("#navV2").length?$("#navV2 a"):$("#nav a");f=Fai.top._manageMode?"#g_main":Fai.top.window;$(f).bind("scroll",function(){a.each(function(){e=$(this).attr("_module");if(e!=null&&e!=undefined){h=$("#module"+e);if(h.length>0){var j=h[0].getBoundingClientRect().top;var l=$(window).height();var k=h.height();var i;if(j>=0){i=(j<l)&&(l-j)>=(k*0.6);if(i){$(this).parents(".item").addClass("itemSelected");$(this).parents(".item").siblings().removeClass("itemSelected")}}else{j=Math.abs(j);i=(j<k)&&(k-j)>=(k*0.6);if(i){$(this).parents(".item").addClass("itemSelected");$(this).parents(".item").siblings().removeClass("itemSelected")}}}}})});$("#g_main").bind("scroll",function(){a.each(function(){e=$(this).attr("_module");if(e!=null&&e!=undefined){h=$("#module"+e);if(h.length>0){var j=h[0].getBoundingClientRect().top;var l=$(window).height();var k=h.height();var i;if(j>=0){i=(j<l)&&(l-j)>=(k*0.6);if(i){$(this).parents(".item").addClass("itemSelected");$(this).parents(".item").siblings().removeClass("itemSelected")}}else{j=Math.abs(j);i=(j<k)&&(k-j)>=(k*0.6);if(i){$(this).parents(".item").addClass("itemSelected");$(this).parents(".item").siblings().removeClass("itemSelected")}}}}})})})();Site.initSubNavPack=function(c,r,p,d,g,k){var u=$("#fk-subNavPack"+c);if(u.length==0){var b=$("#navV2").offset().top,s=$("#navV2").height();subNavPackHeight="300px",subNavPackWidth="100%",subNavPackLeft="0px",webWidth=$("#web").width(),webContainerWidth=$("#webContainer").width(),containerLeft=(webWidth-webContainerWidth)/2,containerWidth=webContainerWidth;if(document.getElementById("g_main").scrollHeight>document.getElementById("g_main").clientHeight){subNavPackWidth="99%"}if(k.h){subNavPackHeight=k.h+"px"}if(!d&&k.w){subNavPackWidth=k.w+"px";if(k.l){subNavPackLeft=k.l+"px";if(k.l>containerLeft){containerLeft=0}else{containerLeft=containerLeft-k.l}}if(k.w<containerWidth){containerWidth=k.w}}else{if(!d){subNavPackWidth="";subNavPackLeft=containerLeft+"px";containerLeft=0}}var l="width:"+subNavPackWidth+"; height:"+subNavPackHeight+"; top:"+(b+s)+"px; left:"+subNavPackLeft+"; background-color:"+g+";",m="width:"+containerWidth+"px; height:"+subNavPackHeight+"; margin-left:"+containerLeft+"px;",n="";if(r&&(r.length==0||p.length==0)){if(Fai.top._manageMode){$("<div id='fk-subNavPack"+c+"' class='fk-subNavPack' style='"+l+"'><div class='container J_subNavPack' id='fk-subNavPackContainer"+c+"' style='"+m+"'><div class='fk-elemZoneBg J_zoneContentBg elemZoneBg'></div></div></div>").appendTo("body");a()}else{return}}else{$("<div id='fk-subNavPack"+c+"' class='fk-subNavPack' style='"+l+"'><div class='container J_subNavPack' id='fk-subNavPackContainer"+c+"' style='"+m+"'><div class='fk-elemZoneBg J_zoneContentBg elemZoneBg'></div></div></div>").appendTo("body")}u=$("#fk-subNavPack"+c);for(var q=0;q<p.length;q++){u.find(".container").append(p[q])}var o=false;for(var q=0;q<r.length;q++){var v=r[q],j=v.id,e=v.l,h=v.t,t=v.s;if(!j){continue}var f=Fai.top.$("#module"+j);if(f.length==0){continue}f.css({position:"absolute",left:e+"px",top:h+"px"});f.attr("_inSubNavPack",1);if(t==false){f.css("display","none")}else{o=true}}if(Fai.top._manageMode&&!o){a()}if(Fai.top._manageMode){if(d){n="left:"+(containerLeft+10)+"px"}u.append("<div class='editSubNavPack' style=' "+n+" '><div class='icon'></div><div class='tit'>编辑模块</div></div>");u.find(".editSubNavPack").click(function(){if(Fai.top._subNavPackEdit==true){return}Site.logDog(200256,2);u.find(".editSubNavPack").hide();Site.inSubNavPackEdit.subNavFreePackEdit(c)});u.off("contextmenu.stopPro").on("contextmenu.stopPro",function(i){if(!Fai.top._subNavPackEdit){i.stopPropagation();i.preventDefault()}})}u.find(".formStyle86, .editTip").css("cursor","default")}function a(){var i=($("#fk-subNavPack"+c).height()-16)/2;$("#fk-subNavPack"+c).append("<div class='subNavNoModule' style='top:"+i+"px'>当前模块无内容访客态将不显示,选择<div class='toChooseTemplate'>素材模块</div>开始编辑</div>");$("#fk-subNavPack"+c).find(".toChooseTemplate").click(function(){Site.popupWindow({title:"请选择素材模块进入带图样式的编辑",frameSrcUrl:"manage_v2/subNavPackTpl.jsp?subNavColId="+c,popUpWinClass:"subNavPackTpl",width:620,height:880,version:2})})}};Site.showSubNavPack=function(){if(Fai.top._useNavVersionTwo){if(Fai.top._navStyleV2Data.snt!=2){return}}function a(c){var b=Fai.top.$("#navV2").offset().top,d=Fai.top.$("#navV2").height();$("#fk-subNavPack"+c).css("top",b+d+"px")}$.each(Fai.top.$("#navV2 .navCenter .item"),function(h,d){var m=$(this);var j=Fai.top._colId;var g=Fai.top._fromColId;var c=m.attr("colId");$(this).unbind();if(c==j||c==g){m.addClass("itemSelected")}var l=parseInt($(this).attr("id").replace("nav",""));var f=false,b=false,e,k=false;m.hover(function(){if(e){clearTimeout(e)}f=true;$(this).addClass("itemHover");a(l);if(Fai.top._navStyleV2Data.snt==2){$(".fk-subNavPack").each(function(i,n){if($(n).css("display")=="block"){k=true}});if(k){$(".fk-subNavPack").hide();Fai.top.$("#fk-subNavPack"+l).show()}else{Fai.top.$("#fk-subNavPack"+l).slideDown(200)}}},function(){f=false;$(this).removeClass("itemHover");e=setTimeout(function(){if(!b&&!Fai.top._subNavPackEdit){Fai.top.$("#fk-subNavPack"+l).slideUp(100)}},200);k=false});Fai.top.$("#fk-subNavPack"+l).hover(function(){if(e){clearTimeout(e)}b=true;a(l);if(Fai.top._navStyleV2Data.snt==2){if(!Fai.top._subNavPackEdit){Fai.top.$("#nav"+l).addClass("itemHover")}$(".fk-subNavPack").each(function(i,n){if($(n).css("display")=="block"){k=true}});if(k){$(".fk-subNavPack").hide();Fai.top.$("#fk-subNavPack"+l).show()}else{Fai.top.$("#fk-subNavPack"+l).slideDown(200)}}},function(){b=false;e=setTimeout(function(){if(!f&&!Fai.top._subNavPackEdit){Fai.top.$("#nav"+l).removeClass("itemHover");Fai.top.$("#fk-subNavPack"+l).slideUp(100)}},200);k=false})})};Site.setNavV2Wrap=function(){var b=$("#webContainer").width(),a=document.getElementById("g_main").scrollHeight;$("#navV2Wrap").css({width:b+"px",height:a+"px"})};Site.clearNavV2Wrap=function(){$("#navV2Wrap").css({width:"",height:""})};Site.initModulePhotoSwitch=function(f,L,v,l){var c=Fai.top.$("#module"+f),n=c.find(".formMiddleContent"),t=!L.picScale,x=n.width(),B=n.height(),y=L.data,d;c.data("photoSwitchData",L);c.data("photoSwitchType",v);if(l!=="carouselPhotos"){}if(v==1){var A=$("#photoSwitch"+f);A.css("margin","0 auto");var J=n.width();var g={id:f,switchType:"1",width:J,photoSwitch:A};Site.formMiddleContentWidthArray.push(g);A.imageSwitch(L);if(n.width()<A.width()){A.css("width",n.width())}var j=A.find(".imageSwitchShowName").eq(0);var E=A.find(".imageSwitchBtnArea").eq(0);if(E.width()/A.width()>=0.4){A.find(".spanHiddenName").each(function(){$(this).css("width",((1-(E.width()+20)/A.width())*100)+"%")})}E.css("bottom","5px");var o=E[0].getBoundingClientRect().left;var C=A[0].getBoundingClientRect().left;E.width((E.width()+5)+"px");E.css("top","auto");if(j.find(".spanHiddenName")&&j.css("display")=="block"){j.css("height","auto");if(l=="carouselPhotos"){j.find(".spanHiddenName").each(function(){var a=$(this).text();if(a==""){$(this).css("height","30px")}});j.css({top:"auto",bottom:"0",width:A.width()+"px","margin-left":"2px","margin-bottom":"2px"});E.css("bottom","8px")}else{j.css({top:"auto",bottom:"0","padding-bottom":"15px",width:"100%"})}}if(j.find(".spanHiddenName").length==1){j.css({"padding-bottom":"0","margin-left":""})}var u=A.find(".spanHiddenName").length;for(var I=0;I<u;I++){var s=A.find(".spanHiddenName").eq(I);s.css("max-width","98%");if(L.switchWrapName==true){j.css("padding-bottom","0px");s.css({"word-wrap":"break-word",width:"auto"});if(Fai.isIE6()||Fai.isIE7()){if(u>1){s.css("padding-bottom","15px")}}else{var p=false;if(s.css("display")=="none"){s.addClass("spanShowName");p=true}var D=C+s[0].clientWidth+10;if(p){s.removeClass("spanShowName")}if(o-D>=5){s.css({"padding-top":"2px","padding-bottom":"0px",bottom:"0px"});if(l=="carouselPhotos"&&s.text()==""){s.css("padding-bottom","30px")}}else{if(u>1){s.css("padding-bottom","15px")}}}}else{if(u==1){j.css("padding-bottom","15px");s.css({"white-space":"nowrap",width:"99%","padding-top":"2px"})}else{if((E.width()+20)/A.width()<0.4){s.css({"white-space":"nowrap",width:"60%","padding-top":"2px"})}else{s.css({"white-space":"nowrap","padding-top":"2px"})}}}if(Fai.isIE6()){for(var N=0;N<Site.formMiddleContentWidthArray.length;N++){if(Site.formMiddleContentWidthArray[N].switchType==1){$("#photoSwitch"+Site.formMiddleContentWidthArray[N].id).css("width",Site.formMiddleContentWidthArray[N].width+"px")}}}}if(L.picScale==2){var F=c.find(".switchGroup");var q=F.find("a").width();var H=F.find("a").height();var k=F.find("a");var h=F.find("img");for(var I=0;I<h.length;I++){var e=L.data[I];var K=e.widthOr;var b=e.heightOr;var G=K/b;var m=q/H;if(m<=G){h.eq(I).css("width",G*H+"px");h.eq(I).css("height",H+"px");h.eq(I).css("marginLeft",((q-G*H)/2)+"px")}else{h.eq(I).css("height",q/G+"px");h.eq(I).css("width",q+"px");h.eq(I).css("marginTop",((H-q/G)/2)+"px")}}}}else{if(v==2){var w=$("#photoDotSwitch"+f);var J=n.width();var g={id:f,switchType:"2",width:J,photoDotSwitch:w};Site.formMiddleContentWidthArray.push(g);w.imageSwitch(L);var j=w.find(".imageSwitchShowName").eq(0);var M=w.find(".imageSwitchBtnArea").eq(0);var z=0;M.css("left","");if(M.width()>w.width()){M.find(".imageSwitchBtn_dot").each(function(){$(this).css("marginRight",2+"px")});if(M.width()>w.width()){z=1;M.css("marginLeft","-"+M.width()/2+"px")}}if(z==0){M.css("marginLeft","-"+M.width()/2+"px");M.css("left","50%")}if(n.width()<w.width()){w.css("width",n.width())}if(j.css("display")=="block"&&j.find(".spanHiddenName")){if(l=="carouselPhotos"){j.css({height:"auto",top:"auto",bottom:"0","padding-bottom":"27px"});var r=w.width()-44;j.css({"margin-left":"2px","margin-bottom":"2px",width:"auto"});j.find(".spanHiddenName").each(function(){$(this).css({margin:"0px 22px",width:r})});M.css({"text-align":"center",left:"0",right:"0","margin-left":"10px"});M.find(".imageSwitchBtn_dot").css("float","none");M.css("padding-bottom","2px")}else{j.css({height:"auto",top:"auto",bottom:"0","padding-bottom":"15px"});j.find(".spanHiddenName").each(function(){$(this).css("marginLeft","0px")});j.width("100%")}}if(j.find(".spanHiddenName").length==1){j.css({"padding-bottom":"0","margin-left":""})}var u=w.find(".spanHiddenName").length;for(var I=0;I<u;I++){var s=w.find(".spanHiddenName").eq(I);if(L.switchWrapName==true){s.css("word-wrap","break-word")}else{s.css("white-space","nowrap")}}if(Fai.isIE6()){for(var N=0;N<Site.formMiddleContentWidthArray.length;N++){if(Site.formMiddleContentWidthArray[N].switchType==2){$("#photoDotSwitch"+Site.formMiddleContentWidthArray[N].id).css("width",Site.formMiddleContentWidthArray[N].width+"px");if(Site.formMiddleContentWidthArray[N].width<300){M.css("align","center");M.css("width",Site.formMiddleContentWidthArray[N].width+"px")}}}}if(L.picScale==2){var F=c.find(".switchGroup");var q=F.find("a").width();var H=F.find("a").height();var k=F.find("a");var h=F.find("img");for(var I=0;I<h.length;I++){var e=L.data[I];var K=e.widthOr;var b=e.heightOr;var G=K/b;var m=q/H;if(m<=G){h.eq(I).css("width",G*H+"px");h.eq(I).css("height",H+"px");h.eq(I).css("marginLeft",((q-G*H)/2)+"px")}else{h.eq(I).css("height",q/G+"px");h.eq(I).css("width",q+"px");h.eq(I).css("marginTop",((H-q/G)/2)+"px")}}}}}if(v!=1){if(l=="carouselPhotos"){if(L.picScale==2){var F=c.find(".switchGroup");var q=F.find("a").width();var H=F.find("a").height();var k=F.find("a");var h=F.find("img");for(var I=0;I<h.length;I++){var e=L.data[I];var K=e.width;var b=e.height;var G=K/b;var m=q/H;if(m<=G){h.eq(I).css("width",G*H+"px");h.eq(I).css("height",H+"px");h.eq(I).css("left",((q-G*H)/2)+"px")}else{h.eq(I).css("height",q/G+"px");h.eq(I).css("width",q+"px");$(this).css("top",((H-q/G)/2)+"px")}}}}}};Site.refreshModulePhotoSwitch=function(b){var c=Fai.top.$("#module"+b);if(c.length>0){var a=c.data("photoSwitchData");var d=c.data("photoSwitchType");if(d==1){c.find("#photoSwitch"+b).empty()}else{if(d==2){c.find("#photoDotSwitch"+b).empty()}}if(typeof a!="undefined"){Site.initModulePhotoSwitch(b,a,d)}}};Site.loadPhotoMarquee=function(u,F,C,n,x){var e=Fai.top["Photo"+u].ieOpt,h=Fai.top["Photo"+u].tgOpt,o=Fai.top["Photo"+u].callbackArgs;var b=$("#module"+u);if(Fai.isNull(b)){return}if(x=="listPhotos"||x=="carouselPhotos"||x=="photoList"){C=1}b.find(".demo0>div").each(function(){if($(this).attr("cloneDiv")){$(this).remove()}});var w=0;var t=b.find(".photoMarqueeForm");if(!C){t.each(function(){var H=$(this).attr("faiWidth");var G=$(this).attr("faiHeight");if(Fai.isNull(G)){return}var L=$(this).find(".imgDiv");var K=L.width();var I=L.height();var J=Fai.Img.calcSize(H,G,K,I,Fai.Img.MODE_SCALE_FILL);if(J.height>w){w=J.height}})}if(e.effType>=4&&e.effType<6){Site.clearImageEffectContent_photo("module"+u,"propDiv")}var d=0;var i=0;var D=0;var g=0;var B=0;var p=0;var E=Site.getFormMiddleContentHeight(b,u);t.each(function(){var I=$(this);var R=I.attr("faiHeight");if(Fai.isNull(R)){return}var Q=I.attr("faiWidth");var V=I.find(".imgDiv");var S=V.width();if(C){w=V.height()}var P={width:S,height:w};var O=V.find(".J_photoImgPanel");var M=V.find("img");if(F==2){var N=M.attr("iWidth");var H=M.attr("iHeight");var L=N/H;var K=S/w;if(K<=L){M.css("width",L*w+"px");M.css("height",w+"px");M.css("marginTop","");M.css("marginLeft",((S-L*w)/2)+"px");O.css({width:S,height:w,position:"relative",overflow:"hidden"})}else{M.css("height",S/L+"px");M.css("width",S+"px");M.css("marginLeft","");M.css("marginTop",((w-S/L)/2)+"px");O.css({width:S,height:w,position:"relative",overflow:"hidden"})}}else{if(typeof F=="number"){F=!!!F}if(F){if(C){P=Fai.Img.calcSize(Q,R,S,w,Fai.Img.MODE_SCALE_FILL)}else{P=Fai.Img.calcSize(Q,R,S,w,Fai.Img.MODE_SCALE_DEFLATE_HEIGHT)}}if(O.length>0||V.length>0){O.css({marginLeft:"",marginTop:"",width:P.width+"px",height:P.height+"px",position:"relative",overflow:"hidden",margin:"0 auto"});M.css("marginLeft","").css("marginTop","")}M.css("width",P.width+"px");M.css("height",P.height+"px")}var J=V.width();if(J<P.width){J=P.width}var U=I.find(".propDiv");if(U.width()!=J){U.css("width",J+"px")}if(V.width()!=J){V.css("width",J+"px")}if(V.height()!=w){V.css("height",w+"px");if($.browser.msie&&$.browser.version==6){V.addClass("wocaie6").removeClass("wocaie6")}}if(I.height()>g&&(n==0||n==1)){g=$(this).height()}if(E>g&&(n==2||n==3)){g=E}var G=I.outerWidth(true);var T=I.outerHeight(true);if(G>B){B=G}d+=G});i=d;if($(".photoMarqueeForm").length>0){Site.unifiedAttrVal(b,".photoMarqueeForm","height")}var m=b.find(".demo");var A=b.find(".demo0");D=A.outerHeight();if(g>0){m.css("height",g+"px")}if(n==0||n==1){A.css("width",d+"px");var a=m.width(),z=A.width();if(z<=a){jzUtils.run({name:"ImageEffect.FUNC.BASIC.Init",callMethod:true},{moduleId:u,imgEffOption:e,tagetOption:h,callback:Site.createImageEffectContent_photo,callbackArgs:o});return}}if(n==2||n==3){var g=m.height(),j=A.height();if(j<=g){jzUtils.run({name:"ImageEffect.FUNC.BASIC.Init",callMethod:true},{moduleId:u,imgEffOption:e,tagetOption:h,callback:Site.createImageEffectContent_photo,callbackArgs:o});return}}if(t.length==0){return}var k=t.first().outerWidth(true);if(k==0){return}var s=0,c=t.length-1;t.each(function(H,I){if(s>a){return false}var G=$(I).clone().attr("cloneDiv","true");tmpId=G.children("div.imgDiv").attr("id");G.children("div.imgDiv").attr("id",tmpId+"_clone");if(0===H&&(n==2||n==3)){$(I).css("clear","both");G.css("clear","both")}if(Fai.isIE6()||Fai.isIE7()){if(H===c){$(t[H]).after('<div style="clear:both;"></div>');G.after('<div style="clear:both;"></div>')}}A.append(G);s+=G.outerWidth(true)});var r=d+s;if(n==0||n==1){A.css("width",r+"px")}function y(){d--;m.scrollLeft(d);if(d==0){m.scrollLeft(i);d=i}}function f(){var G=m.scrollLeft();G++;m.scrollLeft(G);if(G==d){m.scrollLeft(0)}}function v(){var G=m.scrollTop();G--;m.scrollTop(G);if(G==0){m.scrollTop(D)}}function l(){var G=m.scrollTop();G++;m.scrollTop(G);if(G==D){m.scrollTop(0)}}if(n==0){m.scrollLeft(2*d);Fai.addInterval("marquee"+u,y,35)}else{if(n==1){Fai.addInterval("marquee"+u,f,35)}else{if(n==2){m.scrollTop(2*D);Fai.addInterval("marquee"+u,v,35)}else{if(n==3){Fai.addInterval("marquee"+u,l,35)}}}}m.mouseover(function(){Fai.stopInterval("marquee"+u)}).mouseleave(function(){Fai.startInterval("marquee"+u)});setTimeout(function(){Fai.startInterval("marquee"+u)},100);if(!b.data("first1")){b.data("first1",true);b.data("options",{id:u,scale:F,fixHeight:C,phoMarqueeDirection:n,flag:x})}if(b.data("first2")&&Fai.top._manageMode){var q=b.data("photoOptions");Site.initModulePhotoListItemManage(q);if(x=="listPhotos"){Site.moduleListPhotosItemManage.init(q)}}jzUtils.run({name:"ImageEffect.FUNC.BASIC.Init",callMethod:true},{moduleId:u,imgEffOption:e,tagetOption:h,callback:Site.createImageEffectContent_photo,callbackArgs:o});Site.restartPhotoMarquee(b)};Site.restartPhotoMarquee=function(a){if(!a.data("first2")){a.data("first2",true);a.on("Fai_onModuleSizeChange",function(){var b=a.data("options");Fai.stopInterval("marquee"+b.id);Site.loadPhotoMarquee(b.id,b.scale,b.fixHeight,b.phoMarqueeDirection,b.flag)});a.on("Fai_onModuleLayoutChange",function(){var b=a.data("options");Fai.stopInterval("marquee"+b.id);Site.loadPhotoMarquee(b.id,b.scale,b.fixHeight,b.phoMarqueeDirection,b.flag)})}};Site.getFormMiddleContentHeight=function(b,a){var m=b.height(),f=b.find(".formTop").first(),e=b.find(".formBanner"+a).first(),i=b.find(".formMiddle").first(),k=b.find(".formBottom").first(),c=0;if(f.css("display")!="none"){c=f.outerHeight(true)}var j=0;if(e.css("display")!="none"){j=e.outerHeight(true)}var h=0;if(k.css("display")!="none"){h=k.outerHeight(true)}var g=m-c-j-h-Fai.getFrameHeight(i);var l=i.find(".formMiddleCenter").first();g=g-Fai.getFrameHeight(l);var d=i.find(".formMiddleContent").first();g=g-Fai.getFrameHeight(d);return g};Site.loadPhotoGallery=function(w){var M=w.id,J=w.scale,f=w.cus;var K=w.flag;var d=$("#"+M),a=d.find("div.photo-container");if(w.effType>=4&&w.effType<6){Site.clearImageEffectContent_photo(w.id,"prop-container")}if(K=="listPhotos"){f=1}if(a.length!=0){for(var aa=0;aa<a.length;aa++){if(K=="listPhotos"){if($(a[aa]).children().hasClass("J_sortDiv")){$(a[aa]).children().children().unwrap()}}var Y=$(a[aa]).children("div.img-container"),m=Y.width(),H=Y.height();var l=Y.find("img"),F=l.attr("fHeight"),B=l.attr("fWidth"),S=Y.find(".J_photoImgPanel");if(J==2){var ab=l.attr("iWidth");var b=l.attr("iHeight");var X=ab/b;var r=m/H;if(r<=X){l.css("width",X*H+"px");l.css("height",H+"px");l.css("marginTop","");l.css("marginLeft",((m-X*H)/2)+"px");S.css({width:m,height:H,position:"relative",overflow:"hidden"})}else{l.css("height",m/X+"px");l.css("width",m+"px");l.css("marginLeft","");l.css("marginTop",((H-m/X)/2)+"px");S.css({width:m,height:H,position:"relative",overflow:"hidden"})}}else{var k=Fai.Img.calcSize(B,F,m,H,Fai.Img.MODE_SCALE_FILL);if(typeof J=="number"){J=!!!J}if(S.length>0||Y.length>0){if(J){S.css({marginLeft:"",marginTop:"",width:k.width+"px",height:k.height+"px",position:"relative",overflow:"hidden",margin:"0 auto"})}else{S.css({marginLeft:"",marginTop:"",width:m+"px",height:H+"px",position:"relative",overflow:"hidden",margin:"0 auto"})}l.css("marginLeft","").css("marginTop","")}if(J){l.width(k.width);l.height(k.height)}else{l.width(m);l.height(H)}}}var O=d.find(".gallery-control"),p=d.find(".gallery-control-prev"),U=d.find(".gallery-control-next"),L=p.height(),e=p.width();var R=a.first(),V=R.children("div.img-container"),C=V.outerWidth(true),t=V.outerHeight(true),A=R.children("div.prop-container"),h=0;if(A.length>0){h=A.first().outerHeight(true)*A.length}var D=t+h;a.height(D);a.width(C);a.find("div.prop-container").width(C);var z=d.find("div.photo-gallery-preview");z.height(D);var y=d.find("div.photo-gallery-inner"),o=y.outerHeight();if(o<L){var N=y.height(),T=o-N;var Q=Math.ceil((L-o)/2);var q=Math.ceil(T/2)+Q;y.css("padding-top",q+"px").css("padding-bottom",q+"px")}var I=(y.outerHeight()/2)-(L/2);O.css("top",I+"px");var c=1,ac=p.innerWidth()-e,E=d.find("div.formMiddleContent").width(),s=E-ac-(e*2),ae=R.outerWidth(true),W=R.outerWidth(),g=ae-W;if(s>ae){c=parseInt(s/ae)}var G=(c*ae)-g;z.width(G);var ad=a.length;var u=ad%c==0?ad/c:Math.floor(ad/c)+1;d.find("div.photo-gallery-container").width(ad*ae);var n=a.length<c?a.length:c;for(var Z=0;Z<n;Z++){var l=$(a[Z]).find("img");if(!l.attr("src")){l.attr("src",l.attr("lzurl"))}l.show()}d.find(".photo-gallery-inner").mouseover(function(){if(u>1){O.css("display","block")}}).mouseleave(function(){O.css("display","none")});p.addClass("gallery-control-prev-disabled");if(u==1){U.addClass("gallery-control-next-disabled")}p.click(function(){var x=$(this);if(x.hasClass("gallery-control-prev-disabled")){return false}var af=x.parent(),j=af.find("div.photo-gallery-container"),ag=af.find(".gallery-control-next");if(ag.hasClass("gallery-control-next-disabled")){ag.removeClass("gallery-control-next-disabled")}if(j.position().left==0||j.is(":animated")){return false}var i=G+g;j.animate({left:"+="+i+"px"},function(){if(j.position().left==0){x.addClass("gallery-control-prev-disabled")}})});U.click(function(){var ak=$(this);if(ak.hasClass("gallery-control-next-disabled")){return false}var af=ak.parent(),i=af.find("div.photo-gallery-container"),x=af.find(".gallery-control-prev");if(x.hasClass("gallery-control-prev-disabled")){x.removeClass("gallery-control-prev-disabled")}var al=G+g,am=-(u-1)*(al);left_position=parseInt(i.css("left").replace("px"));if(left_position==am||i.is(":animated")){return false}if(!ak.data("loading_finish")){var aj=(Math.abs(left_position)/(ae*c))+1;var j=aj<=1?1*c:aj*c,ah=j+c>a.length?a.length:j+c;for(var ag=j;ag<ah;ag++){var ai=$($(a[ag]).find("img")[0]);if(!ai.attr("src")){ai.attr("src",ai.attr("lzurl"))}ai.show()}}i.animate({left:"-="+al+"px"},function(){var an=parseInt(i.css("left").replace("px",""));if(an==am){ak.data("loading_finish",true);ak.addClass("gallery-control-next-disabled")}})})}else{var P=d.find("div.addNoProTips");d.find("div.photo-gallery").height(100).html(P)}if(d.find(".prop-wordwrap-container").length>0){d.find(".photo-container").height("auto");var v=0;d.find(".photo-container").each(function(){var i=$(this).height();if(i>v){v=i}});d.find(".photo-container").each(function(){$(this).height(v)});d.find(".photo-gallery-preview").height(v);Site.unifiedAttrVal(d,".prop-wordwrap-container","height")}if(K=="listPhotos"){if(a.length!=0){for(var aa=0;aa<a.length;aa++){if($(a[aa]).children().hasClass("J_sortDiv")){return false}else{$(a[aa]).children().wrapAll("<div class='J_sortDiv'></div>")}}}if(p&&p.length>0){p.hover(function(){if(!$(this).hasClass("gallery-control-prev-disabled")){$(this).addClass("g_hover")}},function(){$(this).removeClass("g_hover")})}if(p&&U.length>0){U.hover(function(){if(!$(this).hasClass("gallery-control-next-disabled")){$(this).addClass("g_hover")}},function(){$(this).removeClass("g_hover")})}}};var isInShareContent=false;Site.removeModulePhotoTitle=function(a){$module=$("#module"+a);$module.find(".imgDiv").each(function(){$(this).removeAttr("title")})};Site.loadPhotoResultMarquee=function(l){var a=l.id,d=l.scale,b=$("#module"+a,Fai.top.document.body);j(b);i(b);f(b);h(b);e(b,d);function j(m){var u=m.find(".J_imgDiv"),q=m.find(".showPhotoContent"),t=m.find(".photoMarquee"),n=null,o=0;var v=u.outerWidth(true);var r=v*u.length;if(q.width()<r){var s=$(".photoMarquee").html();$(".photoMarquee").append(s);t.width(r*2);p()}else{t.width(r)}u=m.find(".J_imgDiv");function p(){n=setInterval(function(){q.scrollLeft(o);o++;if(o==r){o=0}},30)}u.hover(function(){c.call(this,m);clearInterval(n)},function(){k.call(this,m);n=setInterval(function(){q.scrollLeft(o);o++;if(o==r){o=0}},30)});u.eq(0).mouseover().mouseleave()}function i(m){var r=m.find(".J_imgDiv"),q=m.find(".J_photoShowPrev"),p=m.find(".J_photoShowNext");q.click(o);p.click(n);function n(){var t=m.find(".J_selectedDiv").next();if(t.length==0||!t.hasClass("J_imgFirst")){t=m.find(".J_imgFirst:first")}r.removeClass("J_selectedDiv");$(t).addClass("J_selectedDiv");var s=$(t).find("img");g(s)}function o(){var t=m.find(".J_selectedDiv").prev();if(t.length==0||!t.hasClass("J_imgFirst")){t=m.find(".J_imgFirst:last")}r.removeClass("J_selectedDiv");$(t).addClass("J_selectedDiv");var s=$(t).find("img");g(s)}}function f(n){var p=false,o=n.find(".J_showList"),u=n.find(".J_shareContent"),r=n.find(".J_shareListMore");o.mouseover(t);o.mouseleave(q);u.mouseover(s);u.mouseleave(m);function t(){u.show();o.addClass("showList-hover");r.addClass("shareListMore-hover");p=true}function q(){setTimeout(function(){if(!isInShareContent){n.find(".J_shareContent").hide();n.find(".J_showList").removeClass("showList-hover");n.find(".J_shareListMore").removeClass("shareListMore-hover")}});p=false}function m(){isInShareContent=false;if(!p){u.hide();o.removeClass("showList-hover");r.removeClass("shareListMore-hover")}}function s(){isInShareContent=true}}function h(n){var m=n.find(".pageDiv");if(m.length===0){return}m.mouseover(function(){m.addClass("pageDiv-hover")});m.mouseleave(function(){m.removeClass("pageDiv-hover")})}function g(t){var n=t.attr("bigpicurl"),x=t.attr("bigpicwidth"),o=t.attr("bigpicheight"),w=t.attr("_href"),u=t.data("basic"),p=$("#module"+a),r=p.find(".J_photoBasicContent");if(u){r.show();r.html(u);r.attr("title",u)}else{r.hide()}var v=p.find(".photoGroupUp .imgContainer img");var m=p.find(".photoGroupUp .imgContainer a");if(!d){var y=Fai.Img.calcSize(x,o,852,453,Fai.Img.MODE_SCALE_FILL);v.width(y.width);v.height(y.height);if(y.height<452){v.css("margin-top",(452-y.height)/2)}else{v.css("margin-top",0)}var q=v.position();r.width(y.width-240);r.css("left",q.left)}else{v.width(p.width());v.css("height","452px");r.width(p.width()-240)}var s=v.attr("src");if(s!=n){v.attr("src",n);v.attr("alt",t.attr("alt"))}if($.trim(w)==""){m.attr("href","javascirpt:void(0)")}else{m.attr("href",w)}e(p,d)}function c(n){var o=n.find(".J_imgDiv"),m=$(this).find("img");Fai.stopInterval("marquee"+a);o.removeClass("J_selectedDiv");$(this).addClass("J_selectedDiv");$(this).find(".imgMask").show();g(m)}function k(m){Fai.startInterval("marquee"+a);$(this).find(".imgMask").hide()}function e(w,p){var y=w.find(".J_photoBasicContent");if(y.length===0){return}var m=w.find(".imgContainer img"),r=w.find(".photoContainer"),x=y.position().left,o=m.position().left,v=m.outerWidth(),u=r.outerWidth(),q=0.7,t=0.3,n=Math.floor(v*q),s=Math.floor(v*t/2),z=n+s*2;if(Fai.isIE6()){if(o!=x){y.css("left",0)}}if(Fai.isIE7()&&p){y.css("left",0)}if(Fai.isIE6()||Fai.isIE7()||Fai.isIE8()){y.addClass("photoBasicContent-fixIEBgColor")}if(Fai.isMozilla()){if(o!=x){y.css("left",o)}}if(z<v){n+=(v-z);z=n+s*2}if(z>u){n-=(z-u);z=n+s*2}y.css({width:n+"px",padding:"0 "+s+"px"})}};Site.loadPhotoSmallPic=function(h){var r=h.id,G=h.scale,f=h.cus;var y=h.flag;var e=$("#"+r);e.on("Fai_onModuleSizeChange",function(){Site.smallPicPhotoModuleFix(r,y)});e.on("Fai_onModuleLayoutChange",function(){Site.smallPicPhotoModuleFix(r,y)});var F=e.find("div.photoSmallPicBox");var w=e.find(".photoSmallPicUpForms").height();var s=e.find(".photoSmallPicDownForms").height();e.find(".photoSmallPicForms").height(w+s);var E=e.find(".photoSmallPicForms").width();e.find(".photoSmallPicUpForms").width(E);e.find(".photoSmallPicUpFormsMid").width(E);e.find(".photoSmallPicDownForms").width(E);var t=e.find(".photoSmallPrePic_control").outerWidth(true);e.find(".photoSmallPicDownFormsMid").css("width",E-2*t-20+"px");var p=e.find(".photoSmallPrePicContainer");var a=e.find(".photoSmallPrePicOuter").outerWidth(true);var D=0;if(Fai.isIE6()){D=2}p.width(a*F.length+D);var i=p.width();var d=e.find(".photoSmallPicDownFormsMid").width();if(e.hasClass("formStyle93")&&i<d){p.css("margin-left",(d-i)/2+"px")}var z=e.find(".photoSmallPicUpFormsMid").outerHeight()/2-23;e.find(".photoSmallPic_control").css("top",z+"px");var C=F.length;var o=Math.floor(d/a)+1;var B=C%o==0?C/o:Math.floor(C/o)+1;if(B==1&&d<p.width()){B=2}var q=F.length<o?F.length:o;for(var x=0;x<q;x++){var H=$(F[x]).find("img");Site.loadPhotoSmallPicItem(H,y)}var u=e.find(".photoSmallPicDownForms a.g_imgPrev"),v=e.find(".photoSmallPicDownForms a.g_imgNext"),l=e.find(".photoSmallPicUpForms a.photoSmallPicArrow_left"),m=e.find(".photoSmallPicUpForms a.photoSmallPicArrow_right");u.addClass("photoSmallPic-control-prev-disabled");if(B==1){v.addClass("photoSmallPic-control-next-disabled")}l.addClass("photoBigPic-control-prev-disabled");if(C==1){m.addClass("photoBigPic-control-next-disabled")}if(!h.notBindEvent){e.find(".photoSmallPicUpFormsMid").mouseover(function(){$(".photoSmallPic_control").css("display","block")}).mouseleave(function(){$(".photoSmallPic_control").css("display","none")});if(y!="carouselPhotos"){e.find(".photoContainerLeft").mouseenter(function(){var j=$(this).parents(".form").attr("id");if(_manageMode==true){Site.initModulePhotoSmallPicItemManage(j,h.isOpenImgEff)}}).mouseleave(function(){var j=$(this).parents(".form");var I=j.find("div.photoContainerLeft");if(_manageMode==true){if(h.isOpenImgEff){Site.removeEditLayer(I,null,5)}else{Site.removeEditLayer(I,null,106)}}})}F.mouseover(function(){$(this).parent().addClass("photoSmallPrePicOuterHover").addClass("g_border").addClass("g_borderHover")});F.mouseleave(function(){$(this).parent().removeClass("photoSmallPrePicOuterHover").removeClass("g_borderHover").removeClass("g_border")});e.find(".photoSmallPicUpFormsMid .photoContainerLeft img").attr("onload","Site.removePhotoSmallPicMask("+r.replace("module","")+")");l.click(g);m.click(A);v.click(n);u.click(k);F.click(b)}F.eq(0).click();c(e);function b(){var S=$(this).find("img");var O=$("#"+r);var J=O.find(".photoSmallPicUpFormsMid .photoContainerLeft img");Site.loadPhotoSmallPicItem($(this).parent().next().find("img"),y);Site.loadPhotoSmallPicItem(S,y);var ac=h.scale;var N=$(this).parent();N.siblings(".photoSmallPrePicOuter").find("div.photoSmallPicBox").removeClass("photoSmallPrePicSelected");$(this).addClass("photoSmallPrePicSelected");N.siblings(".photoSmallPrePicOuter").removeClass("photoSmallPrePicOuterClick").removeClass("g_borderSelected");N.addClass("photoSmallPrePicOuterClick").addClass("g_borderSelected");var Z=O.hasClass("formStyle42"),Y=O.find("#bigImgDetail");if(Z){Y.replaceWith(J)}else{Y.remove();O.find(".J_bigImgDetailWrap").append(J)}var I=O.find(".photoContainerLeft").width(),M=O.find(".photoContainerLeft").height();var T=S.attr("bigpicurl");var ap=S.attr("bigpicwidth");var Q=S.attr("bigpicheight");var ak=S.attr("productname");var ar=S.attr("ifshowname");var al=S.attr("aattribute");if(y=="carouselPhotos"){N.css({overflow:"visible"});N.siblings(".photoSmallPrePicOuter").find(".cs_triangle_up").hide();N.find(".cs_triangle_up").show().addClass("g_borderSelected");var ai=S.attr("pic");O.find(".imgContainer").attr("id","photoList"+ai);if(_manageMode){var am=O.data("carouselPhotosOptions");Site.moduleCarouselPhotosItemManage.init(am)}}if(ac==2){var R=Fai.Img.calcSize(ap,Q,I,M,Fai.Img.MODE_SCALE_FILL);var L=Q;var aq=ap;var an=aq/L;var W=I/M;if(W<=an){J.css("width",an*M+"px");J.css("height",M+"px");if(y=="carouselPhotos"){J.css("left",((I-an*M)/2)+"px");J.css("position","absolute");J.css("top","0")}else{J.parent(".imgContainer").css("position","relative");J.parent(".imgContainer").css("left",((I-an*M)/2)+"px");J.parent(".imgContainer").css("top","0")}}else{J.css("height",I/an+"px");J.css("width",I+"px");if(y=="carouselPhotos"){J.css("top",((M-I/an)/2)+"px");J.css("position","absolute");J.css("left","0")}else{J.parent(".imgContainer").css("top",((M-I/an)/2)+"px");J.parent(".imgContainer").css("position","relative");J.parent(".imgContainer").css("left","0")}}}else{if(ac==0){var R=Fai.Img.calcSize(ap,Q,I,M,Fai.Img.MODE_SCALE_FILL);J.width(R.width);J.height(R.height);J.css("position","")}else{J.css("width",I).css("height",M);J.css("position","")}}var af=J.attr("src");if(af==T){J.attr("src","")}J.attr("src",T);J.css("margin","auto");var U=S.attr("alt");J.attr("alt",U);if(y=="carouselPhotos"){O.find(".photoContainerLeft").css("margin-top","1.5px");O.find(".photoContainerLeft .imgContainer").css("width",I).css("height",M)}J.wrap("<a id='bigImgDetail' "+al+"></a>");O.find("#imgInnerNameDiv p").html(Fai.encodeHtml(ak));var ae=O.find("#imgInnerNameDiv");var P=O.find(".J_carouselPhotos");if(y=="carouselPhotos"){var ab=parseInt(ae.css("padding-left").replace("px",""))+parseInt(ae.css("padding-right").replace("px",""));ae.width(P.width()-ab);O.find(".photoNameContainer").width(P.width()-ab);ae.css({overflow:"hidden",margin:"0 auto",bottom:"0",left:"0",right:"0"})}else{ae.width(J.width());O.find(".photoNameContainer").width(J.width());var K=(O.find(".photoContainerLeft").height()-J.height())/2+J.height()-ae.outerHeight(true);var aj=K%2==0?K:Math.floor(K/2)*2;ae.css("top",aj+"px");var j=(O.find(".photoSmallPicUpFormsMid").width()-J.width())/2;ae.css("left",j+"px").css("overflow","hidden")}if(h.isOpenImgEff){Site.bindImageEffectCusEvent_photo(O.find(".photoSmallPic_td"),h.tgOpt)}var at=O.find(".photoSmallPrePicSelected").parent().index();l.removeClass("photoBigPic-control-prev-disabled");m.removeClass("photoBigPic-control-next-disabled");u.removeClass("photoSmallPic-control-prev-disabled");v.removeClass("photoSmallPic-control-next-disabled");var ag=O.find(".photoSmallPicDownForms").find(".photoSmallPrePicContainer");var au=parseInt(ag.css("left").replace("px"));var ah=Math.abs(au)/a;var ad=ah+o-1>C-1?C-1:ah+o-1;var V=O.find(".photoSmallPicDownFormsMid").width();var aa,X;if(at==0){l.addClass("photoBigPic-control-prev-disabled");if(au==0){u.addClass("photoSmallPic-control-prev-disabled")}}if(at==(C-1)){m.addClass("photoBigPic-control-next-disabled");aa=ah;X=C-1;if((X-aa+1)*a<=V&&au>=(C-o-1)*a){v.addClass("photoSmallPic-control-next-disabled")}}O.data("positionLeft",au);var ao=O.find(".photoSmallPrePicSelected").attr("phoid");O.find("div.photoContainerLeft").attr("phoid",ao).attr("photoname",ak).attr("id","containerLeft_PhotosmallPic"+ao);c(O)}function g(){var M=$(this);if(M.hasClass("photoBigPic-control-prev-disabled")){return false}var I=$("#"+r);var j=I.find(".photoSmallPicDownForms .photoSmallPrePicContainer");var K=Math.ceil(I.find(".photoSmallPicDownFormsMid").width()/a);var P=I.data("positionLeft");var L=Math.abs(P)/a;var O=L+K-1>C-1?C-1:L+K-1;var N=I.find(".photoSmallPrePicSelected").parent();var Q=N.index();if(Q>=L&&Q<=O){if(Q==L){P+=a}}else{P=-(Q-1)*a;j.css("left","0px")}if(j.is(":animated")){return false}$(".img_ProductPhoto_LR_Border").remove();$(".img_ProductPhoto_TB_Border").remove();$(".editLayer").remove();var J=N.prev().find("div.photoSmallPicBox");I.find("div.photoContainerLeft").attr("phoid",J.attr("phoid")).attr("photoname",J.find("img").attr("productname")).attr("id","containerLeft_PhotosmallPic"+J.attr("phoid"));j.animate({left:P+"px"},function(){N.prev().find("div.photoSmallPicBox").click()})}function A(){var M=$(this);if(M.hasClass("photoBigPic-control-next-disabled")){return false}var I=$("#"+r);var j=I.find(".photoSmallPicDownForms .photoSmallPrePicContainer");var K=Math.ceil(I.find(".photoSmallPicDownFormsMid").width()/a);var P=I.data("positionLeft");var L=Math.abs(P)/a;var O=L+K-1>C-1?C-1:L+K-1;var N=I.find(".photoSmallPrePicSelected").parent();var Q=N.index();if(Q>=L&&Q<=O){if(Q==O){P-=2*a}}else{P=-(Q-1)*a;j.css("left","0px")}if(j.is(":animated")){return false}$(".img_ProductPhoto_LR_Border").remove();$(".img_ProductPhoto_TB_Border").remove();$(".editLayer").remove();var J=N.next().find("div.photoSmallPicBox");I.find("div.photoContainerLeft").attr("phoid",J.attr("phoid")).attr("photoname",J.find("img").attr("productname")).attr("id","containerLeft_PhotosmallPic"+J.attr("phoid"));j.animate({left:P+"px"},function(){N.next().find("div.photoSmallPicBox").click()})}function k(){var M=$(this);if(M.hasClass("photoSmallPic-control-prev-disabled")){return false}var I=M.parents(".photoSmallPicDownForms").find(".photoSmallPrePicContainer");var O=Math.floor(e.find(".photoSmallPicDownFormsMid").width()/a)+1;var L=M.parents(".photoSmallPicDownForms").find("a.g_imgNext");if(L.hasClass("photoSmallPic-control-next-disabled")){L.removeClass("photoSmallPic-control-next-disabled")}var K=parseInt(I.css("left").replace("px"));var N=Math.abs(K)/a;var J=N-O+1>0?N-O+1:0;if(J==0){M.addClass("photoSmallPic-control-prev-disabled")}var j=(N-J)*a;if(I.is(":animated")){return false}I.animate({left:"+="+j+"px"});c(e)}function n(){var T=$(this);var K=$("#"+r);if(T.hasClass("photoSmallPic-control-next-disabled")){return false}var j=T.parents(".photoSmallPicDownForms").find(".photoSmallPrePicContainer"),M=T.parents(".photoSmallPicDownForms").find("a.g_imgPrev"),L=Math.floor(K.find(".photoSmallPicDownFormsMid").width()/a)+1;if(M.hasClass("photoSmallPic-control-prev-disabled")){M.removeClass("photoSmallPic-control-prev-disabled")}var U=(L-1)*a,S=parseInt(j.css("left").replace("px"));var R=Math.abs(S)/a;var V=R+L-1>C-1?C-1:R+L-1;var Q=K.find(".photoSmallPicDownFormsMid").width();if(j.is(":animated")){return false}var J;var I,O;if(V>=C-1){I=R;O=C-1;if((O-I+1)*a<=Q){J=true;T.addClass("photoSmallPic-control-next-disabled")}}else{I=V;O=V+L-1}for(var N=I;N<=O;N++){var P=$(F[N]).find("img");Site.loadPhotoSmallPicItem(P,y)}if(!J){j.animate({left:"-="+U+"px"})}c(K)}function c(I){var j=I.find(".photoSmallPicDownForms");Site.updateThumbnailForSmallPicForms({$module:e,listCls:".photoSmallPicDownForms",itemCls:".photoSmallPrePicOuter"})}};(function(a,b,d){a.updateThumbnailForSmallPicForms=function(h){var g=h.listCls,j=h.itemCls,i=h.$module;if(i.length===0){return}var f=i.find(g),k=f.find(j);if(k.length===0){return}e(k)};function e(f){f.each(function(h,j){var g=b(j),i=g.find("img"),k=i[0].complete;if(k){c(i,g)}else{i.off("load.adjustSize").one("load.adjustSize",function(){var l=b(this);c(l,g)})}})}function c(i,m){i[0].style.width=null;i[0].style.height=null;var h=i.width()/i.height(),l=m.width(),g=m.height(),k=l/g,j,f;if(h<k){f=g;j=h*f}else{j=l;f=j/h}i.css({width:j,height:f})}}(Site,jQuery));Site.removePhotoSmallPicMask=function(a){$("#module"+a).find(".loadingImg").remove()};Site.loadPhotoSmallPicItem=function(e,d){if(!e.attr("src")){e.attr("src",e.attr("lzurl"))}var f=parseInt(e.attr("sWidth")),b=parseInt(e.attr("sHeight"));var a=f>b?f:b;var c=f>b?"width":"height";if(a>71){if(d=="carouselPhotos"){if(a>76){e.css(c,76);e.css("height",60);e.css("width",76)}}else{e.css(c,71)}}else{e.css("width",f).css("height",b)}e.show()};Site.smallPicPhotoModuleFix=function(v,r){var c=$("#"+v),y=c.find("div.photoSmallPicBox");var p=c.find(".photoSmallPicUpForms").height();var l=c.find(".photoSmallPicDownForms").height();c.find(".photoSmallPicForms").height(p+l);var x=c.find(".photoSmallPicForms").width();c.find(".photoSmallPicUpFormsMid").width(x);c.find(".photoSmallPicDownForms").width(x);c.find(".photoSmallPicUpForms").width(x);var m=c.find(".photoSmallPrePic_control").outerWidth(true);c.find(".photoSmallPicDownFormsMid").css("width",x-2*m-20+"px");var d=$(".photoSmallPicUpForms").width();var i=c.find(".photoSmallPrePicContainer");var a=$(".photoSmallPrePicOuter").outerWidth(true);var w=0;if(Fai.isIE6()){w=2}i.width(a*y.length+w);var e=i.width();var b=c.find(".photoSmallPicDownFormsMid").width();var s=c.find(".photoSmallPicUpFormsMid").outerHeight()/2-46;c.find(".photoSmallPic_control").css("top",s+"px");var u=y.length;var h=Math.floor(b/a)+1;var t=u%h==0?u/h:Math.floor(u/h)+1;if(t==1&&b<i.width()){t=2}var n=c.find(".photoSmallPicDownForms a.g_imgPrev"),o=c.find(".photoSmallPicDownForms a.g_imgNext"),f=c.find(".photoSmallPicUpForms a.photoSmallPicArrow_left"),g=c.find(".photoSmallPicUpForms a.photoSmallPicArrow_right");if(t==1){n.addClass("photoSmallPic-control-prev-disabled");o.addClass("photoSmallPic-control-next-disabled")}var k=y.length<h?y.length:h;for(var q=0;q<k;q++){var z=$(y[q]).find("img");if(!z.attr("src")){Site.loadPhotoSmallPicItem(z,r)}}c.find(".photoSmallPrePicSelected").click()};Site.loadPhotoList=function(b,e,f,i,g){var c=$("#module"+b);if(Fai.isNull(c)){return}var j=0;if(g=="listPhotos"||g=="photoList"){f=1}if(!f){c.find(".photoForm").each(function(){var l=$(this).attr("faiWidth");var k=$(this).attr("faiHeight");if(Fai.isNull(k)){return}var p=$(this).find(".imgDiv");var o=p.width();var m=p.height();var n=Fai.Img.calcSize(l,k,o,m,Fai.Img.MODE_SCALE_FILL);if(n.height>j){j=n.height}})}if(i>=4&&i<6){Site.clearImageEffectContent_photo("module"+b,"parametersDiv")}var h=c.find(".nameWordWrap");if(h.length>0){var a=0;h.each(function(){var k=$(this).height();if(k>a){a=k}});h.each(function(){$(this).height(a)})}var d=0;c.find(".photoForm").each(function(){var y=$(this).attr("faiHeight");if(Fai.isNull(y)){return}var x=$(this).attr("faiWidth");var A=$(this).find(".imgDiv");var z=A.width();if(f){j=A.height()}var w={width:z,height:j};var p=A.find("img");var u=A.find(".J_photoImgPanel");if(e==2){var q=p.attr("iWidth");var k=p.attr("iHeight");var o=q/k;var l=z/j;A.css("height",j+"px");if(l<=o){p.css("width",o*j+"px");p.css("height",j+"px");p.css("marginTop","");p.css("marginLeft",((z-o*j)/2)+"px");u.css({width:z,height:j,position:"relative",overflow:"hidden"})}else{p.css("height",z/o+"px");p.css("width",z+"px");p.css("marginLeft","");p.css("marginTop",((j-z/o)/2)+"px");u.css({width:z,height:j,position:"relative",overflow:"hidden"})}}else{if(typeof e=="number"){e=!!!e}if(e){w=Fai.Img.calcSize(x,y,z,j,Fai.Img.MODE_SCALE_FILL)}if(u.length>0||A.length>0){u.css({marginLeft:"",marginTop:"",width:w.width+"px",height:w.height+"px",position:"relative",overflow:"hidden",margin:"0 auto"});p.css("marginLeft","").css("marginTop","")}p.css("width",w.width+"px");p.css("height",w.height+"px");A.css("height",j+"px");var n=c.hasClass("formStyle27");if(n){var m=$.isFunction(Site.getModuleAttrPattern);if(m){var t=Site.getModuleAttrPattern(b).photoGroup,v=(t.s&&t.s.t==1);if(!v){var s={width:160,height:160};A.css(s);if(e===false){p.css(s)}}}}}$(this).find(".photoParameters").css("height","auto");var r=$(this).height();if(r>d){d=r}});c.find(".photoForm").css("height",d+"px");Site.switchJump()};Site.multiPhoto=function(n,m,e){var f=false;var p="leftIcon";var s="rightIcon";var r="horizontal";var b=false;var o={};o=$.extend({},o,e);if(o.leftIconID!=null){p=o.leftIconID}if(o.rightIconID!=null){s=o.rightIconID}if(o.direction!=null){r=o.direction}if(o.zoom!=null){b=o.zoom=="true"?true:false}var h=n;var t=n.width();var c=n.height();var i=h.find("> ul");var d=h.find("li");var l=h.find("li .g_border");var a=d.outerWidth(true);var g=d.outerHeight(true);var k=d.length;var q=0;if(r=="horizontal"){q=parseInt(t/a)}else{q=parseInt(c/g)}if(r=="horizontal"){if(Fai.isIE6()){a++}var j=(a)*k;i.css("width",j+"px")}else{var u=g*k;i.css("height",u+"px")}if(n.hasClass("J_imgDivsStyle5")){f=true}$("#"+p).mouseover(function(){if((k>=q)&&((Math.abs(i.position().left)+h.width())>=i.width())){$(this).addClass("g_imgPrevHover")}}).mouseout(function(){$(this).removeClass("g_imgPrevHover")}).click(function(){if(i.position().left<0||i.position().top<0){if(i.is(":animated")){return}if(r=="horizontal"){i.animate({left:(i.position().left+a)+"px"},"slow")}else{if(r=="vertical"){i.animate({top:(i.position().top+g)+"px"},"slow")}}if(Math.abs(i.position().left)<=a){$(this).addClass("g_imgPrevNotClick")}$("#"+s).removeClass("g_imgNextNotClick")}});$("#"+s).mouseover(function(){if((k>=q)&&((Math.abs(i.position().left)+h.width())<=i.width())){$(this).addClass("g_imgNextHover")}}).mouseout(function(){$(this).removeClass("g_imgNextHover")}).click(function(){if(i.is(":animated")){return}if(k>=q){if(r=="horizontal"){if((Math.abs(i.position().left)+h.width())<i.width()){if((Math.abs(i.position().left)+h.width()+a)>=i.width()){$(this).addClass("g_imgNextNotClick")}$("#"+p).removeClass("g_imgPrevNotClick");i.animate({left:(i.position().left-a)+"px"},"slow")}else{$(this).removeClass("g_imgNextHover");$(this).addClass("g_imgNextNotClick")}}else{if((Math.abs(i.position().top)+h.height())<i.height()){i.animate({top:(i.position().top-g)+"px"},"slow")}else{$(this).removeClass("g_imgNextHover");$(this).addClass("g_imgNextNotClick")}}}});d.mouseover(function(){d.removeClass("g_borderHover");$(this).addClass("g_borderHover");if(f){if(_manageMode&&b){Site.removeEditLayer(m,null,106)}d.removeClass("fk-mainBorderColor");$(this).addClass("fk-mainBorderColor")}var v=$(this).find("a").attr("href");if(v==m.find("a").attr("href")){return}m.find("a").attr("href",v);var B=$(this).attr("faiWidth");var E=$(this).attr("faiHeight");var C=m.width();var y=m.height();if(m.data("divWidth")){C=m.data("divWidth")}if(m.data("divHeight")){y=m.data("divHeight")}var D;if(f){D=Fai.Img.calcSize(B,E,C,y,Fai.Img.MODE_SCALE_FILL)}else{D=Fai.Img.calcSize(B,E,C,y,Fai.Img.MODE_SCALE_DEFLATE_FILL)}var z=m.find("img");if(z.is(":animated")){return}var x=m.find("td");var w=x.width();var F=x.height();var A=[];A.push("<div class='ProductDetailloadingImg' style='width:"+w+"px;height:"+F+"px;'>");A.push("<table cellspacing='0' cellpadding='0' class='ProductDetailloadingImgTable' style='width:"+w+"px;height:"+F+"px;'><tbody><tr><td class='ProductDetailloadingImgTd'>");A.push("<div class='ajaxLoading2' style='margin:0 auto;'></div>");A.push("</td></tr></tbody></table>");A.push("</div>");x.append(A.join(""));$(z).load(function(){$(".ProductDetailloadingImg").remove();$(".multiPhotoImgLoad").fadeOut("slow",function(){$(this).remove()})});setTimeout(function(){if(!$(z).load()){var G=$("<div class='multiPhotoImgLoad'></div>");if(m.find(".multiPhotoImgLoad").length==0){G.appendTo(m)}}},1000);z.css("width",D.width+"px");z.css("height",D.height+"px");z.attr("src",v);m.attr("faiHref",v);if(b){m.find(".cloud-zoom").data("zoom").destroy();m.find(".cloud-zoom").CloudZoom({imageWidth:B,imageHeight:E})}}).mouseleave(function(){})};Site.createImageEffectContent_photo=function(j,l,c,p){var f=$(j).parents("."+c.targetParent);var k=$(j).find(".imageEffects");var d=$(f).attr("photoName");var m=$(f).attr("photoDisc");d=Fai.encodeHtml(d);m=Fai.encodeHtml(m);var i=l[Site.ImageEffect.DATA.KEY.FULL_MASK_OPEN_DISC];var n=l[Site.ImageEffect.DATA.KEY.HALF_MASK_OPEN_DISC];var o=c.nameHidden;if(o&&!i&&!n){return}g();h(l,c.nameWordWrap);function g(){var s=[];var q=l.effType;var r="";if(q==4){r="photoFullMask"}else{if(q==5){r="photoHalfMask"}}s.push("<div class='props "+r+"'>");s.push("<div class='propList g_specialClass'>");if(!o){s.push("<div class='photoName g_specialClass'>"+d+"</div>")}if(i&&m.length>0&&q==4){s.push("<div class='photoDisc'>"+m+"</div>")}if(n&&m.length>0&&q==5){s.push("<div class='photoDisc'>"+m+"</div>")}s.push("</div>");s.push("</div>");$(k).append(s.join(""))}function h(w,q){var u=$(k).find(".photoName");var z=$(k).find(".photoDisc");var A=3;if(u.length!=0&&!o){e(w,q);Site.clamp($(u)[0],{clamp:A})}if(z.length!=0&&w.effType==4&&i){b(w);Site.clamp($(z)[0],{clamp:A});setTimeout(function(){var C=$(k).height();var E=$(k).find(".props").height();if(E>C&&!o){var B=$(z).height();var D=E-C;A=(B)-D+"px";Site.clamp($(z)[0],{clamp:A})}},100)}if(w.effType==4){var s=k.parent().find(".J_photoImg");if(s.attr("picsca")==="2"){var v=s.css("margin-top");if(v.replace("px","")!=="0"){k.css("margin-top",v)}}}if(w.effType==5){var r=$(k).height()/3;var y=$(k).find(".props");var x=$(y).height()+10;var t=r;a(w);if(x>r){t=x}$(k).css("height",t).css("bottom","-"+t+"px")}}function e(u,v){var r=$(k).find(".photoName");var t="";$(r).removeAttr("style");if(u.effType==4){var s=u[Site.ImageEffect.DATA.KEY.FULL_MASK_CUS_NAME];var w=u[Site.ImageEffect.DATA.KEY.FULL_MASK_NAME_ALIG];var q=u[Site.ImageEffect.DATA.KEY.FULL_MASK_NAME_STYLE];if(s&&typeof q=="string"&&q.length>0){q=$.parseJSON(q);t+="color: "+q.fc+";";t+=(q.fb==1)?" font-weight: bold;":""}if(typeof w=="number"){t+=" text-align:"+((w==1)?"center;":(w==2)?"left;":"right;")}}if(v){if(l.effType==4){t+=" word-wrap: break-word;"}else{t+=" overflow: visible; text-overflow: clip; white-space: normal; word-wrap: break-word;"}}else{t+=" overflow: hidden; text-overflow: ellipsis; white-space: nowrap;"}$(r).attr("style",t)}function b(w){var q=$(k).find(".photoDisc");var v="";var s=w[Site.ImageEffect.DATA.KEY.FULL_MASK_CUS_DISC];var r=w[Site.ImageEffect.DATA.KEY.FULL_MASK_DISC_STYLE];var u=w[Site.ImageEffect.DATA.KEY.FULL_MASK_DISC_ALIG];$(q).removeAttr("style");if(s&&typeof r=="string"&&r.length>0){r=$.parseJSON(r);v+=" color: "+r.fc+";"}if(typeof u=="number"){v+=" text-align:"+((u==1)?"center;":(u==2)?"left;":"right;")}if(!o){var t=(Fai.isIE6()||Fai.isIE7())?16:18;v+=" margin-top: "+t+"px;"}$(q).attr("style",v)}function a(v){var s=$(k).find(".photoDisc");var u="";var t=v[Site.ImageEffect.DATA.KEY.HALF_MASK_CUS_DISC];var w=v[Site.ImageEffect.DATA.KEY.HALF_MASK_DISC_STYLE];var r=v[Site.ImageEffect.DATA.KEY.HALF_MASK_DISC_ALIG];var q=v[Site.ImageEffect.DATA.KEY.HALF_MASK_OPEN_DISC];if(!q){return}if(t&&typeof w=="string"&&w.length>0){w=$.parseJSON(w);u+=" color: "+w.fc+";"}if(typeof r=="number"){u+=" text-align:"+((r==1)?"center;":(r==2)?"left;":"right;")}$(s).attr("style",u)}};Site.clearImageEffectContent_photo=function(b,a){$("#"+b).find("."+a).remove()};Site.bindImageEffectCusEvent_photo=function(g,c){var f=$(g).find(".imageEffects");var a=true;var e=$(g).parents("."+c.targetParent).find("a");var d=$(e).attr("href");var b=(typeof d=="undefined"||d.length==0||d.indexOf("javascirpt")>0||d.indexOf("return")>0||e.length==0)?false:true;if(!b){a=false}if(a){$(f).css("cursor","pointer")}else{$(f).css("cursor","default")}$(f).unbind("click").bind("click",function(){var l=$(this).parents("."+c.targetParent).find("a");if(Fai.isNull(l)){return}var i=$(l).attr("href");var h=$(l).attr("onclick");var j=$(l).attr("target");var k=(typeof i=="undefined"||i.length==0||i.indexOf("javascirpt")>0||i.indexOf("return")>0||e.length==0)?false:true;if(typeof h!="undefined"){$(l).click()}else{if(k){window.open(i,j)}}})};Site.formMiddleContentWidthArray=new Array();Site.loadPhotoGroup=function(g,f,e,a,b){var c=$("#module"+g);if(Fai.isNull(c)){return}var d=0;c.find(".photoForm").css("height","auto").each(function(){var j=$(this),h=j.attr("faiHeight"),i=j.attr("faiWidth");if(Fai.isNull(h)){return}var o=j.find(".imgDiv"),n=o.width(),m=o.height();j.css("width",n+"px");var l=f?Fai.Img.calcSize(i,h,n,m,Fai.Img.MODE_SCALE_FILL):{width:n,height:m};o.find("img").css({width:l.width,height:l.height});j.find(".photoParameters").css("height","auto");var k=j.height();d=k>d?k:d}).css("height",d+"px");Site.photoGroupImageEffect.bind(c)};Site.initPhotoGroupSelect=function(c,e){var a=Fai.top.location.hash;var d=e.style;if(a.length<2){return}if(Fai.getHashParam(a,"_php")&&d==27){var f=Site.decodeQsToUrl(Fai.getHashParam(a,"_php"),"_php",e);var b=Fai.getHashParam(f,"groupId");Fai.top.$("#module"+c).find("table").find("[groupid="+b+"]").addClass("g_selected")}};(function(b,e,d){e(window).load(f);b.photoGroupImageEffect=e.extend({},b.photoGroupImageEffect,{bind:g});function f(){var h=e(".formStyle27",e("#web")),i="mousemove.bindImaEff";if(h.length===0){return}h.each(function(k,l){var m=e(l),j=(m.find(".J_photoImg").length>0);if(!j){return}m.off(i).one(i,function(){g(e(this),true)})})}function g(k,i){var j=b.photoGroupImageEffect,h=k.find(".J_photoImg").length>0;if(!c(k)){return}if(!h){return}if(i){setTimeout(function(){a(j,k)})}else{a(j,k)}}function a(k,l){var i=l.find(".imgDiv"),j="mouseenter.imageEffect",h="mouseleave.imageEffect";k.init(l);i.off(j).off(h);i.on(j,function(m){k.use(l,e(this).parent())}).on(h,function(m){k.unUse(l,e(this).parent())})}function c(h){return h.hasClass("formStyle27")}}(Site,jQuery));(function(c,f,e){c.photoGroupImageEffect=f.extend({},c.photoGroupImageEffect,{use:a,unUse:d,init:i,fix:g,refresh:h});function i(k,j){b("init",arguments)}function a(k,j){b("use",arguments)}function d(k,j){b("unUse",arguments)}function g(k,j){b("fix",arguments)}function h(k,j){b("refresh",arguments)}function b(m,j){var l=c.photoGroupImageEffect.getImageEffect(j[0]),k;if(f.isPlainObject(l)){k=l[m]}if(f.isFunction(k)){k.apply(l,j)}}}(Site,jQuery));(function(c,e,d){c.photoGroupImageEffect=e.extend({},c.photoGroupImageEffect,{adjustImgEffSize:i,adjustModuleImgEffSize:a,getImageEffect:f,wrapModuleImage:b,computeWrapImageSize:g});function a(k,j){k.find(".photoForm").each(function(l,m){i(e(m))})}function i(m){var j=m.find("img"),o=m.find(".imageEffects"),p=m.find(".imgDiv"),n=1,k=j.width(),r=j.height(),l=j.position().left,q=j.position().top;k=k-n*2;r=r-n*2;o.css({left:l,top:q,width:k,height:r})}function f(m){var k=m.find(".J_photoForms").attr("_imgefftype"),n=c.photoGroupImageEffect,l=function(){},j={1:{},2:n.border,3:n.magnifier,4:n.textDescFull,5:n.textDescHalf,6:n.imgScale,7:n.bgTranslate,8:n.photoReplace};return j[k]}function b(k,j){k.find(".photoForm").each(function(l,m){h(e(m))})}function h(m){var p=e('<div class="J_tmpImgWrap"></div>'),o=m.find(".imgDiv"),j=m.find("img"),q=(j.parent().hasClass(".J_tmpImgWrap")>1),k=j.width(),r=j.height(),l,n;if(q){return}p.css({position:"relative",width:k,height:r,display:"inline-block"});if(k===o.width()&&r===o.height()){l=true}else{l=false}n={initImgRatio:k/r,isImgFull:l};p.data("wrapData",n);j.wrap(p)}function g(p){var j=p.find("img"),s=p.find(".J_tmpImgWrap"),n=s.data("wrapData"),q=p.width(),m=p.height(),l=q/m,o=n.initImgRatio,k,r;if(n.isImgFull){k=q;r=m}else{if(o>l){k=q;r=k/o}else{r=m;k=r*o}}return{width:k,height:r}}}(Site,jQuery));(function(b,c,e){b.photoGroupImageEffect=c.extend({},b.photoGroupImageEffect,{border:{init:d,fix:a}});function d(h){var g,f;h.find(".imageEffects").remove();h.removeData("imageEffectData");h.find(".photoForm").each(function(r,n){var l=c(n),i=l.find(".photoImg"),j=i.parent(),q=(j.find(".imageEffects").length>0),m="solid #000 1px",s=0,o="absolute",t=0,k,p;if(q){return}p=c(Site.ImageEffect.DATA.imageEffectHtml);j.append(p);if(i.width()<j.width()){k=j.width()-i.width();k/=2}p.css({border:m,opacity:s,position:o,top:t,left:k})});g={effType:2,imgShapeType:1};f={moduleId:h.attr("_moduleid"),imgEffOption:g,tagetOption:{target:"imgDiv"}};h.data("imageEffectData",f);b.ImageEffect.FUNC.BASIC.Init(f)}function a(g,f){b.photoGroupImageEffect.adjustModuleImgEffSize(g,f)}}(Site,jQuery));(function(b,d,c){b.photoGroupImageEffect=d.extend({},b.photoGroupImageEffect,{magnifier:{init:e,fix:a}});function e(f){f.find(".imageEffects").remove();b.ImageEffect.FUNC.BASIC.Init({moduleId:f.attr("_moduleid"),imgEffOption:{effType:3,borderType:false},tagetOption:{target:"imgDiv a"}})}function a(g,f){b.photoGroupImageEffect.adjustModuleImgEffSize(g,f)}}(Site,jQuery));(function(b,f,h){b.photoGroupImageEffect=f.extend({},b.photoGroupImageEffect,{textDescFull:{use:c,init:g,fix:a}});function g(i){i.find(".imageEffects").remove();b.ImageEffect.FUNC.BASIC.Init({moduleId:i.attr("_moduleid"),imgEffOption:{effType:4,borderType:false},tagetOption:{target:"imgDiv a"}});i.find(".imageEffects").css("zIndex",1);i.find(".J_photoForm").each(function(k,m){var j=f(m);var l=j.find(".imageEffects");var n=j.attr("_photogroupdesc");d(l,n)})}function c(i){e(i)}function a(j,i){b.photoGroupImageEffect.adjustModuleImgEffSize(j,i);e(j)}function e(i){i.find(".imgDiv").each(function(j,m){var o=f(m);var k=o.find(".imageEffects");var l=o.find(".J_desc");var n=o.find(".propList");n.css({padding:"0 7.5%",position:"absolute",top:(k.height()-n.height())/2,left:0})})}function d(k,j){if(k.find(".J_mask").length>0){return}var i=f(['<div class="props photoFullMask J_mask">','<div class="propList g_specialClass">','<div class="photoName g_specialClass" style="overflow: hidden; text-overflow: ellipsis; white-space: nowrap; -webkit-box-orient: vertical; display: -webkit-box; -webkit-line-clamp: 3;"></div>','<div class="photoDisc J_desc" style="max-height:48px;text-align: center;overflow: hidden; text-overflow: ellipsis; -webkit-box-orient: vertical; display: -webkit-box; -webkit-line-clamp: 3;">'+(j||"")+"</div>","</div>","</div>"].join(""));i.css("overflow","hidden");k.append(i)}}(Site,jQuery));(function(b,e,g){b.photoGroupImageEffect=e.extend({},b.photoGroupImageEffect,{textDescHalf:{use:c,init:f,fix:a}});function f(h){h.find(".imageEffects").remove();b.ImageEffect.FUNC.BASIC.Init({moduleId:h.attr("_moduleid"),imgEffOption:{effType:5,borderType:false},tagetOption:{target:"imgDiv a"}});h.find(".imageEffects").css("zIndex",1);h.find(".J_photoForm").each(function(j,l){var i=e(l);var k=i.find(".imageEffects");var m=i.attr("_photogroupdesc");d(k);k.find(".J_desc").text(m)});a(h)}function c(l,h){var n=h.find(".imgDiv");var k=h.find(".imageEffects");var j=h.find("img");var m=j.position().left;var i=k.position().left;if(m!==i){k.css("left",0)}}function d(j,i){if(j.find(".J_mask").length>0){return}var h=e(['<div class="props photoHalfMask J_mask">','<div class="propList g_specialClass">','<div class="photoName g_specialClass" style="overflow: hidden; text-overflow: ellipsis; white-space: nowrap; -webkit-box-orient: vertical; display: -webkit-box; -webkit-line-clamp: 3;"></div>','<div class="photoDisc J_desc" style=" text-align:center;">'+(i||"")+"</div>","</div>","</div>"].join(""));j.append(h)}function a(h){h.find(".imgDiv").each(function(i,m){var o=e(m);var k=o.find(".imageEffects");var j=o.find("img"),l=j.width(),n=j.offset().left-o.offset().left;k.css({width:l,left:n})})}}(Site,jQuery));(function(a,c,e){a.photoGroupImageEffect=c.extend({},a.photoGroupImageEffect,{imgScale:{init:d,refresh:b}});function d(g){g.find(".imageEffects").remove();a.ImageEffect.FUNC.BASIC.Init({moduleId:g.attr("_moduleid"),imgEffOption:{effType:6,borderType:false},tagetOption:{target:"imgDiv a",picScale:2}});a.photoGroupImageEffect.wrapModuleImage(g)}function b(k,h,i){var j=i.width,g=i.height,l=a.photoGroupImageEffect.computeWrapImageSize;if(!c.isFunction(l)){return}if(!j||!g){return}k.find(".imgDiv").each(function(o,s){var t=c(s);var q=l(t);var n=t.find(".J_tmpImgWrap");var p=t.find("img");var r=q.width;var m=q.height;n.css({width:r,height:m});p.attr("_initwidth",r);p.attr("_initheight",m);p.css({width:r,height:m,margin:0})})}function f(m){var g=m.find("img"),p=m.find(".J_tmpImgWrap"),k=p.data("wrapData"),n=m.width(),j=m.height(),i=n/j,l=k.initImgRatio,h,o;if(k.isImgFull){h=n;o=j}else{if(l>i){h=n;o=h/l}else{o=j;h=o*l}}return{width:h,height:o}}}(Site,jQuery));(function(a,c,e){a.photoGroupImageEffect=c.extend({},a.photoGroupImageEffect,{bgTranslate:{init:d,refresh:b}});function d(f){f.find(".imageEffects").remove();f.find(".imgDiv").each(function(g,i){var k=c(i);var j=k.find("a");var h=j.attr("style")||{};j.data("initW",h.width);j.data("initH",h.height);j.css({width:j.width(),height:j.height()})});a.ImageEffect.FUNC.BASIC.Init({moduleId:f.attr("_moduleid"),imgEffOption:{effType:7,borderType:false},tagetOption:{target:"imgDiv a"}});a.photoGroupImageEffect.wrapModuleImage(f)}function b(j,g,h){var i=h.width,f=h.height,k=a.photoGroupImageEffect.computeWrapImageSize;if(!c.isFunction(k)){return}if(!i||!f){return}j.find(".imgDiv").each(function(n,r){var s=c(r),p=k(s),m=p.width,q=p.height,l=s.find(".J_tmpImgWrap"),o=s.find("img");l.parent().css({width:m,height:q});l.css({width:m,height:q});o.css({width:m+10,height:q})})}}(Site,jQuery));(function(c,f,e){c.photoGroupImageEffect=f.extend({},c.photoGroupImageEffect,{photoReplace:{init:g,use:a,unUes:d}});function g(k){k.find(".imageEffects").remove();var j=k.find(".J_photoForm");j.each(function(p,r){var o=f(r),q=o.find(".J_photoImg"),s=o.find(".J_imgDiv"),n=q.attr("_iehoverphotosrc");var m=f('<div class="imageEffect J_hovIE"><img class="J_hovImg"></div>');var l=m.find(".J_hovImg");m.css({width:q.width(),height:q.height(),position:"absolute",left:q.offset().left-s.offset().left,top:q.offset().top-s.offset().top});l.css({width:"100%",height:"100%"});l.attr("src",n);m.hide();m.insertAfter(q)});c.ImageEffect.FUNC.BASIC.Init({moduleId:k.attr("_moduleid"),imgEffOption:{effType:8,borderType:false},tagetOption:{target:"imgDiv a"}})}function a(l,j){var k={$photoForm:j};j.find(".J_photoImg").parent().off("mouseleave.useie").off("mouseenter.useie").off("mousemove.useie").one("mousemove.useie",k,i).on("mouseenter.useie",k,i).on("mouseleave.useie",k,b);h(l)}function d(k,j){j.find(".J_photoImg").off("mouseleave.useie").off("mouseenter.useie")}function h(k){var j=k.find(".J_photoForm");j.each(function(o,q){var n=f(q),p=n.find(".J_photoImg"),r=n.find(".J_imgDiv"),m=n.find(".J_hovIE"),l=m.find(".J_hovImg");m.css({width:p.width(),height:p.height(),position:"absolute",left:p.offset().left-r.offset().left,top:p.offset().top-r.offset().top})})}function i(o){var l=o.data.$photoForm,m=l.find(".J_photoImg"),k=l.find(".J_hovIE"),j=l.find(".J_hovImg"),n=(j.length>0&&m.attr("_iehoverphotosrc"));if(n){j.attr("src",j.attr("_hovImg"));k.css({width:m.width(),height:m.height(),opacity:0});k.show();k.stop().animate({opacity:1},300)}}function b(o){var l=o.data.$photoForm,m=l.find(".J_photoImg"),k=l.find(".J_hovIE"),j=l.find(".J_hovImg"),n=(j.length>0&&m.attr("_iehoverphotosrc"));if(n){j.attr("src",j.attr("_hovImg"));k.stop().animate({opacity:0},300,function(){f(this).hide()})}}}(Site,jQuery));Site.initModuleWeather=function(a,b,d,c){Site.initIframeLoading(a,b,d,c)};Site.initModuleWeatherBySina=function(b,h,a,c,j){Site.logDog(200133,1);var e=(a==11?2:1),g=0,i="json",d=Fai.isIE6(),f=[];var k="//platform.sina.com.cn/weather/forecast?app_key=1315597423&city="+encodeURIComponent(h)+"&startday="+g+"&lenday="+e+"&format="+i+"&auth_type=uuid&auth_value=0123456789012345&callback=?";$(".formMiddleContent"+b).css("overflow","hidden");$(".formMiddleContent"+b).append("<div class='weather2Loading'></div>");if($("#toolTips"+a).length>0){$("#toolTips"+a).remove()}$.getJSON(k,function(A){if(!A||A.status.code!=0){if(!c){return}Site.initModuleWeatherBySina(b,c,a);return}var t=$(".formMiddleContent"+b+" .weather2"),x=A.data.city[0].days.day,B=false;for(var y=0;y<x.length;y++){var m=x[y].f1?x[y].f1:"qing",l=x[y].f2?x[y].f2:"qing",z=(m==l?true:false),s=x[y].t1?x[y].t1:"0",r=x[y].t2?x[y].t2:"0",o=x[y].s1,n=x[y].s2,w=x[y].d1,v=x[y].d2,q=x[y].p1,u=A.data.city[0].info.name;t.find(".cityName"+a).text(u);if(a!=12&&a!=11){f.push("<ul class='weather2'>");f.push("<li class='cityName"+a+"'>");f.push(""+u+"</li>");f.push("<li class='weatherCon"+a+"'>");if(a==1){if(d){$(".formMiddleContent"+b).css("height",27+"px")}f.push(""+n+"</li>")}else{if(d){$(".formMiddleContent"+b).css("height",33+"px")}if(a==3||a==11){if(!z){f.push("<img style='margin-right: 5px;' class='image1"+a+"' title='"+o+"' src='"+_resRoot+"/image/site/weather/"+m+"1."+(d?"gif'":"png'")+"/>")}}f.push("<img class='image2"+a+"' title='"+n+"' src='"+_resRoot+"/image/site/weather/"+l+"1."+(d?"gif'":"png'")+"/>")}f.push("</li>");f.push("<li class='temperature"+a+"'>");f.push("<span class='temperature1"+a+"'>");f.push(""+s+"</span> ~");f.push("<span class='temperature2"+a+"'>");f.push(""+r+"</span>");f.push("</li>");if(a==7){f.push("<li class='weatherCondition"+a+"'>");f.push(""+q+"</li>")}f.push("</ul>")}else{if(a==11){$(".formMiddleContent"+b+" .includeWeather"+a).width(560);if(d){$(".formMiddleContent"+b).css("height",81+"px")}var C="";y==0?C="今天":C="明天";f.push("<div class='weather2' style='width:278px;'>");f.push("<div class='cityName"+a+"'>"+(!B?u:"")+"</div>");f.push("<img class='image1"+a+"' title='"+o+"' src='"+_resRoot+"/image/site/weather/"+m+"11."+(d?"gif'":"png'")+"/>");f.push("<div class='weatherToday"+a+"'>");f.push("<div class='weatherTodayInfo"+a+"'>");f.push("<span class='weatherTodayDate"+a+"'>"+C+" ");f.push(""+s+" ~ </span>");f.push(""+r+"<span class='temperature1"+a+"'>");f.push("</span> ");f.push("<span class='temperature2"+a+"'>");f.push("</span>");f.push("</div>");f.push("<div class='weatherCon"+a+"'>");if(!z){f.push("<span class='weatherCon1"+a+"'>"+o+"</span>");f.push("<span>转</span>")}f.push("<span class='weatherCon2"+a+"'>"+n+"</span>");f.push("</div>");f.push("</div>");f.push("</div>");B=true}else{if(a==12){if(d){$(".formMiddleContent"+b).css("height",135+"px")}f.push("<div class='weather2' style='width:250px;'>");f.push("<div class='left"+a+"' style='width: 90px;'>");f.push("<div class='cityName"+a+"'>"+u+"</div>");f.push("<div class='images"+a+"'>");f.push("<img class='image1"+a+"' title='"+o+"' src='"+_resRoot+"/image/site/weather/"+m+"11."+(d?"gif'":"png'")+"/>");f.push("</div>");f.push("<div class='weatherCon"+a+"'>");if(!z){f.push("<span class='weatherCon1"+a+"'>"+o+"</span>");f.push("<span>转</span>")}f.push("<span class='weatherCon2"+a+"'>"+n+"</span>");f.push("</div>");f.push("</div>");f.push("<div class='right"+a+"'>");f.push("<div class='temperatureInclude"+a+"'>");f.push("<div style='float: left;'>温&nbsp;&nbsp;度:</div>");f.push("<div class='temperature"+a+"'>");f.push("<span class='temperature1"+a+"'>"+s+"");f.push("</span> ~");f.push("<span class='temperature2"+a+"'>"+r+"");f.push("</span>");f.push("</div>");f.push("</div>");f.push("<div class='windInclude"+a+"'>");f.push("<div style='float: left;'>风&nbsp;&nbsp;力:</div>");f.push("<div class='wind"+a+"'>");f.push(""+q+"</div>");f.push("</div>");f.push("<div class='windDirectionInclude"+a+"'>");f.push("<div style='float: left;'>风&nbsp;&nbsp;向:</div>");f.push("<div class='windDirection"+a+"'>");if(w==""){f.push(""+v+"</div>")}else{f.push(""+w+"</div>")}f.push("</div>");f.push("</div>")}}}}if(f.length==0){var p="<div id='toolTips"+a+"' style='margin: 0 auto;width: 120px; cursor:pointer;' onclick='Site.initModuleWeather2( "+b+',"'+h+'", '+a+',"'+c+"\")'>网络缓慢,请重新加载</div>";$(".formMiddleContent"+b+" .includeWeather"+a).append(p)}else{$(".formMiddleContent"+b+" .includeWeather"+a).append(f.join(""))}$(".formMiddleContent"+b+" .weather2Loading").remove()})};Site.initModuleWeatherByEtouch=function(e,d,c,b){Site.logDog(200133,1);var a=[];var g=Fai.isIE6();var f="//wthrcdn.etouch.cn/weather_mini?citykey="+d+"&callback=?";$(".formMiddleContent"+e).css("overflow","hidden");$(".formMiddleContent"+e).append("<div class='weather2Loading'></div>");if($("#toolTips"+c).length>0){$("#toolTips"+c).remove()}$.getJSON(f,function(n){if(!n||n.status!=1000){if(!b){return}Site.initModuleWeatherByEtouch(e,b,c);return}var j=n.data.city;var p=n.data.wendu;var k=n.data.forecast[0].fengli;var o=n.data.forecast[0].fengxiang;var l=n.data.forecast[0].type;var h=n.data.aqi;var i="";var m="";if(h>=0&&h<=50){m="优"}else{if(h>50&&h<=100){m="良"}else{if(h>100&&h<=150){m="轻度污染"}else{if(h>150&&h<=200){m="中度污染"}else{if(h>200&&h<=300){m="重度污染"}else{if(h>300){m="严重污染"}}}}}}switch(l){case"暴雨":i="baoyu";break;case"大暴雨":i="dabaoyu";break;case"大雪":i="daxue";break;case"大雨":i="dayu";break;case"多云":i="duoyun";break;case"雷阵雨":i="leizhenyu";break;case"霾":i="mai";break;case"晴":i="qing";break;case"雾":i="wu";break;case"小雪":i="xiaoxue";break;case"小雨":i="xiaoyu";break;case"雪":i="xue";break;case"阴":i="yin";break;case"雨夹雪":i="yujiaxue";break;case"阵雨":i="zhenyu";break;case"中雪":i="zhongxue";break;case"中雨":i="zhongyu";break;case"中到大雨":i="zhongyu";break;case"小到中雨":i="xiaoyu";break;case"中到大雪":i="zhongxue";break;case"小到中雪":i="xiaoxue";break;case"大到暴雨":i="baoyu";break;default:i="kongbai"}if(c==13){if(g){$(".formMiddleContent"+e).css("height",80+"px")}a.push("<div class='weather2' style='width:300px;'>");a.push("<div class='left"+c+"'>");a.push("<div class='firstLine"+c+"'>");a.push("<div class='cityName"+c+"'>"+j+"</div>");a.push("<div class='currentTemperature"+c+"'>");a.push("<font face='微软雅黑' color='#fdbf43'>"+p+"℃</font>");a.push("</div>");a.push("</div>");a.push("<div class='secondLine"+c+"'>");a.push("<div class='weatherCon"+c+"'>");a.push("<span class='weatherCon2"+c+"'>"+l+"</span>");a.push("</div>");a.push("<div class='fenli"+c+"'>"+k+"</div>");a.push("</div>");a.push("</div>");a.push("<div class='right"+c+"'>");a.push("<div class='images"+c+"'>");a.push("<img class='image1"+c+"' title='"+l+"' src='"+_resRoot+"/image/site/weather/"+i+"22."+(g?"gif'":"png'")+"/>");a.push("</div>");a.push("</div>")}else{if(c==14){if(g){$(".formMiddleContent"+e).css("height",80+"px")}a.push("<div class='weather2' style='width:250px;'>");a.push("<div class='left"+c+"' style='width: 90px;'>");a.push("<div class='images"+c+"'>");a.push("<img class='image1"+c+"' title='"+l+"' src='"+_resRoot+"/image/site/weather/"+i+"11."+(g?"gif'":"png'")+"/>");a.push("</div>");a.push("</div>");a.push("<div class='right"+c+"'>");a.push("<div class='firstLine"+c+"'>");a.push("<div class='cityName"+c+"'>"+j+"</div>");a.push("<div class='currentTemperature"+c+"'>");a.push("<font face='微软雅黑' color='#fdbf43'>"+p+"℃</font>");a.push("</div>");a.push("</div>");a.push("<div class='secondLine"+c+"'>");a.push("<div class='weatherCon"+c+"'>");a.push("<span class='weatherCon2"+c+"'>"+l+"</span>");a.push("</div>");a.push("<div class='fenli"+c+"'>"+k+"</div>");a.push("</div>");a.push("</div>")}else{if(c==15){if(g){$(".formMiddleContent"+e).css("height",80+"px")}a.push("<div class='weather2' style='width:350px;'>");a.push("<div class='left"+c+"' style='width: 90px;'>");a.push("<div class='images"+c+"'>");a.push("<img class='image1"+c+"' title='"+l+"' src='"+_resRoot+"/image/site/weather/"+i+"33."+(g?"gif'":"png'")+"/>");a.push("</div>");a.push("</div>");a.push("<div class='right"+c+"'>");a.push("<div class='firstLine"+c+"'>");a.push("<div class='cityName"+c+"'>"+j+"</div>");a.push("<div class='weatherCon"+c+"'>");a.push(""+l+"</div>");a.push("<div class='fenli"+c+"'>"+k+"</div>");a.push("</div>");a.push("<div class='secondLine"+c+"'>");a.push("<div class='currentTemperature"+c+"'>");a.push("<font face='微软雅黑'>"+p+"℃</font>");a.push("</div>");a.push("<div class='weatherAqi"+c+"'>");a.push("<span class='weatherAqi2"+c+"'>空气质量: "+h+" "+m+"</span>");a.push("</div>");a.push;a.push("</div>");a.push("</div>")}}}if(a.length==0){var q="<div id='toolTips"+c+"' style='margin: 0 auto;width: 120px; cursor:pointer;' onclick='Site.initModuleWeatherByEtouch( "+e+", "+d+", "+c+","+b+" )'>网络缓慢,请重新加载</div>";$(".formMiddleContent"+e+" .includeWeather"+c).append(q)}else{$(".formMiddleContent"+e+" .includeWeather"+c).append(a.join(""))}$(".formMiddleContent"+e+" .weather2Loading").remove()})};Site.initWeatherOfIP=function(b,a){Site.logDog(200133,1);$.ajax({url:"//int.dpool.sina.com.cn/iplookup/iplookup.php?format=js",type:"POST",dataType:"script",success:function(c){var d=remote_ip_info.city;if(a==13||a==14||a==15){$.ajax({url:Site.genAjaxUrl("site_h.jsp"),data:"cmd=getWeatherCityCode&cityName="+Fai.encodeUrl(d),type:"post",success:function(h){var e=jQuery.parseJSON(h);if(e.success){var g=e.msg.cityCode;var f=e.msg.parentCityCode;Site.initModuleWeatherByEtouch(b,g,a,f)}}})}else{Site.initModuleWeatherBySina(b,d,a)}}})};Site.initModuleDate=function(){var a=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],d,e,b;return{init:function(f,g){d=f,e=g;b=$("#module"+d+"Date");this.start()},start:function(){this.go();if(e==2||e==3||e==5||e==7||e==8){setInterval(this.go,8001)}},go:function(){var n=new Date(),l=n.getFullYear(),i=n.getMonth()+1,p=n.getDate(),o=n.getDay(),f=a[o],j=c[o],k=n.getHours()+"",g=n.getMinutes()+"",q="";if(k.length==1){k="0"+k}if(g.length==1){g="0"+g}if(e==1){q=l+"年"+i+"月"+p+"日 "+f}else{if(e==2){q=l+"年"+i+"月"+p+"日 "+k+":"+g}else{if(e==3){q=l+"年"+i+"月"+p+"日 "+f+" "+k+":"+g}else{if(e==4){q=l+"-"+i+"-"+p}else{if(e==5){q=l+"-"+i+"-"+p+" "+k+":"+g}else{if(e==6){q=i+"/"+p+"/"+l+" "+j}else{if(e==7){q=i+"/"+p+"/"+l+" "+k+":"+g}else{q=i+"/"+p+"/"+l+" "+j+" "+k+":"+g}}}}}}}b.text(q)}}}();(function(a){jQuery.fn.extend({bannerImageSwitch:function(j){if(typeof Fai=="undefined"){alert("must import fai.js");return}var b=a.extend({title:true,desc:false,btn:true,repeat:"no-repeat",position:"50% 50%",titleSize:14,titleFont:"Verdana,宋体",titleColor:"#FFF",titleTop:4,titleLeft:4,descSize:12,descFont:"Verdana,宋体",descColor:"#FFF",descTop:2,descLeft:4,btnWidth:15,btnHeight:15,btnMargin:4,btnType:1,playTime:4000,animateTime:1500,animateStyle:"o",index:0,wideScreen:false,btnFunc:function(){}},j);var h={0:{name:"arrow",classes:"arrowImg",switchType:"Slide"},1:{name:"Num",classes:"numImg",switchType:"Fade"},2:{name:"Dot",classes:"dotImg",switchType:"Fade"},3:{name:"Box",classes:"boxImg",switchType:"Fade"},4:{name:"NoColorArrow",classes:"arrowImg",switchType:"Slide"},5:{name:"RightColorArrow",classes:"arrowImg",switchType:"Slide"},6:{name:"AdsorptionRound",classes:"adsorptionRoundImg",switchType:"Fade"},7:{name:"BottomRound",classes:"bottomRoundImg",switchType:"Fade"},8:{name:"BottomPhoto",classes:"bottomPhotoImg",switchType:"Fade"}};var d=h[b.btnType].switchType==="Slide";var i=h[b.btnType].switchType==="Fade";var f=h[b.btnType].name;var e=(function(){var k={};var m="arrow Num Dot Box NoColorArrow RightColorArrow AdsorptionRound BottomRound BottomPhoto".split(" ");for(var l=0;l<m.length;l++){k["is"+m[l]]=(function(n){return function(o){return o===n}})(m[l])}return k})();function c(m,r,s,q,n,k,o){if(e.isNum(f)){m=a('<a class="imageSwitchBtn" />').appendTo(r).html("<span>"+(s+1)+"</span>");if(s===q){m.addClass("imageSwitchBtnSel")}}else{if(e.isDot(f)){m=a('<a class="imageSwitchBtn_dot" />').appendTo(r);if(s===q){m.addClass("imageSwitchBtnSel_dot")}}else{if(e.isBox(f)){m=a('<a class="fk_imageSwitchBtn_box"><div class="f_box_height"></div></a>').appendTo(r);if(s===q){m.addClass("fk_imageSwitchBtnSel_box")}}else{if(e.isAdsorptionRound(f)){if(s===0){a('<div class="fk_adsorptionRound_current"></div>').appendTo(r)}m=a('<a class="fk_imageSwitchBtn_adsorptionRound"><span class="fk_adsorptionRound_num">'+(s+1)+"</span></a>").appendTo(r);if(s===q){if(!Site.checkBrowser()){m.addClass("fk_imageSwitchBtn_ar_current")}m.find(".fk_adsorptionRound_num").addClass("fk_adsorptionRound_num_current")}if(s===n-1){var p="";p='<svg style="height: 0;" xmlns="http://www.w3.org/2000/svg" version="1.1" width="740"><defs><filter id="AR"><feGaussianBlur in="SourceGraphic" stdDeviation="10" result="blur"></feGaussianBlur><feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 15 -5" result="AR"></feColorMatrix><feBlend in="SourceGraphic" in2="AR" /></filter></defs></svg>';a(p).appendTo(r)}}else{if(e.isBottomRound(f)){m=a('<a class="fk_imageSwitchBtn_bottomRound"></a>').appendTo(r);if(s<n-1){m.after('<div class="fk_imageSwitchBtn_line"><div class="f-animal J_bottomRoundlinear"></div></div>')}if(s===q){m.addClass("fk_imageSwitchBtnSel_bottomRound")}}else{if(e.isBottomPhoto(f)){if(s===0&&n>o){a('<div class="fk_imageSwitchBtn_bottomPhoto_prev clearFix" ><div class="f-icon_prev"></div></div>').appendTo(r)}m=a('<a class="fk_imageSwitchBtn_bottomPhoto"></a>').appendTo(r);var l=a(k.join("")).find(".J_bannerItem").clone();l.css("background-size","cover");l.attr("onclick","return false");l[0].innerHTML="";m.append(l);if(s===n-1&&n>o){a('<div class="fk_imageSwitchBtn_bottomPhoto_next clearFix"><div class="f-icon_next"></div></div>').appendTo(r)}if(s===q){m.addClass("fk_imageSwitchBtnSel_bottomPhoto")}}}}}}}return m}function g(n,t,s,k,u,p,q,r,l,w,m){if(n>1){if(!d){if(Fai.top.$("#"+t).length){if(e.isNum(f)){if(s>=k){r.css("right","40px")}else{r.css("right","50%");r.css("marginRight","-"+s/2+"px")}r.css("top",(p-r.height()-6)+"px")}else{if(e.isDot(f)||e.isBox(f)||e.isAdsorptionRound(f)||e.isBottomRound(f)||e.isBottomPhoto(f)){if(e.isAdsorptionRound(f)){r.css({bottom:"24px",width:"740px",filter:"url(#AR)"});var v=r.find("a").eq(m).position().left;if(Site.checkBrowser()){a(".fk_adsorptionRound_current").css("transform","translate3d("+v+"px, 0px, 0px) scale(1.5, 1.5)")}else{a(".fk_adsorptionRound_current").hide()}}r.css("marginLeft","-"+r.width()/2+"px");r.css("left","50%");if(e.isDot(f)){r.css("bottom","5px")}if(e.isBox(f)||e.isBottomPhoto(f)){r.css("bottom","40px")}if(e.isBottomRound(f)){var o=k-s;if(s<=k){o=o-o*0.5}else{o=40}l.css({left:o,top:"50%",marginTop:"-"+l.height()/2+"px"});w.css({right:o,top:"50%",marginTop:"-"+w.height()/2+"px"});r.css({bottom:0,background:"rgba(255, 255, 255, .7)",height:"30px",padding:"0 20px 12px"})}}}}else{r.css("left",(u-q)+"px")}}else{var o=k-s;if(s<=k){o=o-o*0.5}else{o=40}if(e.isRightColorArrow(f)){l.css({right:o,top:"50%",marginTop:"-"+l.height()+"px"});w.css({right:o,top:"50%"})}else{l.css("top","50%");l.css("marginTop","-"+l.height()/2+"px");w.css("top","50%");w.css("marginTop","-"+w.height()/2+"px");l.css({left:o,top:"50%",marginTop:"-"+l.height()/2+"px"});w.css({right:o,top:"50%",marginTop:"-"+w.height()/2+"px"})}}}}return a(this).each(function(){var p=a(this);var ac=b.width||p.width();var at=b.height||p.height();var ao=b.data.length;var aq=b.index;var o=ac<p.width()?ac:p.width();var ad=p.width();var k=Fai.top._useBannerVersionTwo?true:false;var v=k?Fai.top._bannerV2Data:Fai.top._bannerData;var K=(Site.checkBrowser()&&v.at>0)?true:false;var A=1000;var U=8;var Q=Site.getWebBackgroundData();var al=(b.width<=p.width())?b.width:"100%";var s=k?"bannerV2":"banner";var y=false;var N=false;var ai;var W;var ax;var Z;var u=4;if(k){N=v.bla==0?true:false;y=(v.blw.t==1&&N)?true:false;if(v.blw.t===2){ai=b.width}else{var ab=Fai.top.$("#webContainer").width();if(v.blw.t===0){if(!Fai.top._wideBanner){var Y=Fai.top.$("#webBanner").width();ai=Y}else{ai=ab}}if(v.blw.t===1){ai=ab}}}else{y=Q.wbs?true:false}if(y){var ag=Fai.top._manageMode?Fai.getScrollWidth():0;at=(at>=A)?A:at;var B,O=false;if((Fai.top.$(".g_web").width()+ag)>a(window).width()){B=Fai.top.$(".g_web").width()+ag}else{B=a(window).width();O=true}ad=ad>(B-ag)?B-ag:ad;al=ad;o=ad;if(Fai.top._wideBanner&&O){Fai.top.$("#g_main").width("auto");Fai.top.$("#web").width("auto")}}if(ad<960){u=3}p.css("overflow","hidden");p.height(at);var aw=a('<div class="imageSwitchShowName" />').appendTo(p);if(ao==0){aw.css("visibility","hidden")}var ak="none";if(b.data.length>1){ak=b.btn?"block":"none"}if(i){var ay=a('<div class="imageSwitchBtnArea clearFix"/>').appendTo(p).css("position","absolute").css("zIndex",3).css("display",ak)}a("<div />").appendTo(p);var av="";if(K){av="billboard billboard"+v.at}var x=a('<div class="switchGroup switchGroup_'+s+" "+av+'"/>').appendTo(p).css("width",al).css("position","relative").height("y,show-y".indexOf(b.animateStyle)!=-1?at*ao:at).css("overflow","hidden").css("margin","0 auto");if(b.wideScreen){x.css("width","100%")}var aB=0;var I="100%";if(d){b.animateStyle="x"}var ar=[];var aC="";var J="";var q="";var r="";var S="";var z="";aC=h[b.btnType].classes;a.each(b.data,function(aF,aI){var aE="";var aH="";var aD="";S="";z="";if(a.trim(aI.edgeLeft)!=""){S="background:"+aI.edgeLeft+";"}if(a.trim(aI.edgeRight)!=""){z="background:"+aI.edgeRight+";"}if(!aI.href){aE="onclick='return false;'"}if(aI.onclick){aE='onclick="'+Fai.decodeHtml(aI.onclick)+'"'}ar=[];J="";J+="position:absolute;width:100%;";if(d){if(b.wideScreen||y){J+="left:"+((aF-aq)*ad)+"px;"}else{J+="left:"+((aF-aq)*b.width)+"px;"}}if(K){ar.push("<div class='J_billboardItem billboard_item "+aC+"'>\n")}else{ar.push("<div class='J_billboardItem "+aC+"' id='"+aC+aF+"' style='"+J+"'>\n")}q="";q+="width:100%;";q+="height:"+at+"px;";q+="cursor:"+(aI.href?"pointer":"default")+";";q+="background-position:"+b.position+";";q+="background-repeat:"+b.repeat+";";q+="overflow:hidden;";q+="display:block;";q+="outline:none;";q+="margin:0 auto;";q+="position:relative;";q+="z-index:1;";if(y||N){q+="background-size:cover;"}if(aI.width&&aI.width>0){r=("<img src='"+aI.src+"' width='"+aI.width+"' height='"+aI.height+"' />\n")}else{r="";q+="background-image:url("+aI.src+");"}if(b.wideScreen&&!k){ar.push("<a class='J_bannerEdge J_bannerEdgeLeft bannerEdge bannerEdgeLeft' hidefocus='true' title='"+(aI.tip?aI.tip:"")+"' href='"+(aI.href?Fai.encodeHtml(aI.href):"javascript:;")+"' target='"+(aI.target?aI.target:"")+"' "+aE+" style='"+S+"'></a>");ar.push("<a class='J_bannerEdge J_bannerEdgeRight bannerEdge bannerEdgeRight' hidefocus='true' title='"+(aI.tip?aI.tip:"")+"' href='"+(aI.href?Fai.encodeHtml(aI.href):"javascript:;")+"' target='"+(aI.target?aI.target:"")+"' "+aE+" style='"+z+"'></a>")}if(aI.href){ar.push("<a class='J_bannerItem f-bannerItem' hidefocus='true' title='"+(aI.tip?aI.tip:"")+"' href='"+Fai.encodeHtml(aI.href)+"' target='"+(aI.ot==1?"_blank":"")+"' style='"+q+"' "+aE+">\n")}else{ar.push("<div class='J_bannerItem f-bannerItem' title='"+(aI.tip?aI.tip:"")+"' style='"+q+"'>\n")}ar.push(r);if(k){ar.push("<div id='fk-inBannerListZone-"+aF+"' _sys='1' _banId="+aI.i+" style='text-align: left;' class='elemZone elemZoneModule fk-moduleZone fk-inBannerListZone forms sideForms J_moduleZone '>\n");ar.push("<div class='fk-inBannerListZoneBg fk-elemZoneBg J_zoneContentBg elemZoneBg'></div>\n");ar.push("</div>\n")}if(aI.href){ar.push("</a>\n")}else{ar.push("</div>\n")}ar.push("</div>\n");x.append(ar.join(""));if(k){Fai.top.Fai.setCtrlStyleCssList("styleWebSite","",[{cls:"#bannerV2 .fk-inBannerListZone",key:"width",value:ai+"px"},{cls:"#bannerV2 .fk-inBannerListZone",key:"margin-left",value:"-"+ai/2+"px"}]);var aG=Fai.top.$(".fk-inBannerListZone-tmp").find(".form");aG.each(function(aJ,aK){if(a(this).parent().hasClass("fk-inBannerListZone-tmp")){if(a(this).attr("_banid")===aI.i&&parseInt(a(this).attr("_sys"))===1){a("#fk-inBannerListZone-"+aF).append(a(this))}}});if(Fai.top._manageMode){jzUtils.run({name:"_elemZone.sortModuleZone",base:Fai.top})}Site.bannerV2.stopBannerPropagation()}if(aF==aq){aD="spanShowName"}a('<span class="spanHiddenName '+aD+'"/>').appendTo(aw);W=c(W,ay,aF,aq,ao,ar,u);if(e.isNum(f)){aB+=Fai.getDivWidth(W)}});if(ao>1){var au={};au.position="absolute";au.zIndex=3;if(e.isarrow(f)){Z=a('<a class="imageSwitchBtn_arrow arrow_prev" />').appendTo(p).css(au);ax=a('<a class="imageSwitchBtn_arrow arrow_next" />').appendTo(p).css(au)}else{if(e.isNoColorArrow(f)){Z=a('<a class="fk_noColorArrowsImg fk_noColorArrowsImg_prev" />').appendTo(p).css(au);ax=a('<a class="fk_noColorArrowsImg fk_noColorArrowsImg_next" />').appendTo(p).css(au)}else{if(e.isRightColorArrow(f)){Z=a('<a class="fk_rightColorArrowsImg fk_rightColorArrowsImg_prev"><div class="f-icon_prev"></div><div class="f-horizontal-line"></div></a>').appendTo(p).css(au);ax=a('<a class="fk_rightColorArrowsImg fk_rightColorArrowsImg_next"><div class="f-icon_next"></div></a>').appendTo(p).css(au)}else{if(e.isBottomRound(f)){Z=a('<a class="fk_bottomRoundImg fk_bottomRoundImg_prev"><div class="f-background-prev"></div></a>').appendTo(p).css(au);ax=a('<a class="fk_bottomRoundImg fk_bottomRoundImg_next"><div class="f-background-next"></div></a>').appendTo(p).css(au)}else{if(e.isBottomPhoto(f)){ay.children("a").wrapAll('<div class="fk_imageSwitchPanel"><div class="fk_imageSwitchReal"></div></div>');var aj=ay.find(".fk_imageSwitchBtn_bottomPhoto");var l=ay.find(".fk_imageSwitchPanel");var R=ay.find(".fk_imageSwitchReal");var aA=+aj.css("marginRight").replace("px","");var aa=Math.ceil(ao/u);var C=ao%u;var ap=aj.outerWidth(true)*(ao<u?ao:u);var F=aj.outerHeight(true);l.width(ap-aA);l.height(F);R.width(ap*aa);R.height(F);if(Fai.isIE6()){l.parent().width(ap+60)}R.attr("index",0)}}}}}}if(e.isNum(f)){ay.width(aB)}var V=aw.children("span");var w=p.parent();var L=w.width();if(a.browser.msie&&a.browser.version==6){L=w.parent().width()}var an=w.height();if(L>b.width){L=b.width+(L-b.width)/2}if(L>p.width()){L=p.width()}if(an>at){an=at}g(ao,s,ac,p.width(),L,an,aB,ay,Z,ax,aq);if(i){var ah=ay.children("a");var P=x.find(".J_bannerItem");if(e.isBottomRound(f)){var m=ax;var T=Z}else{if(e.isBottomPhoto(f)&&ao>1){ah=R.children("a")}}}else{var m=ax;var T=Z}if("o, show, none".indexOf(b.animateStyle)!=-1){P.each(function(aD,aE){if(aq!=aD){if(!K){a(this).hide()}if(b.wideScreen){a(this).siblings(".J_bannerEdge").hide()}}})}function n(){if(k){jzUtils.run({name:"moduleAnimation.publish",base:Fai.top.Site});jzUtils.run({name:"moduleAnimation.contentAnimationPublish",base:Fai.top.Site})}}function am(){if(e.isBottomRound(f)){m.on("click",function(){if(P.is(":animated")||Site.bannerAnimate.animating){return}var aD=aq;if(K){Site.bannerAnimate.stop()}else{P.eq(aD).fadeOut(b.animateTime,"failinear",function(){Site.triggerGobalEvent("site_BannerV2Switch");n()});ah.eq(aD).removeClass("fk_imageSwitchBtnSel_bottomRound")}if(aD==ao-1){aD=-1}++aD;if(K){Site.bannerAnimate.goTo(aD)}else{P.eq(aD).fadeIn(b.animateTime,"failinear",function(){Site.triggerGobalEvent("site_BannerV2Switch");n()});ah.eq(aD).addClass("fk_imageSwitchBtnSel_bottomRound")}aq=aD});T.on("click",function(){if(P.is(":animated")||Site.bannerAnimate.animating){return}var aD=aq;if(K){Site.bannerAnimate.stop()}else{P.eq(aD).fadeOut(b.animateTime,"failinear",function(){Site.triggerGobalEvent("site_BannerV2Switch");n()});ah.eq(aD).removeClass("fk_imageSwitchBtnSel_bottomRound")}if(aD==0){aD=ao}--aD;if(K){Site.bannerAnimate.goTo(aD)}else{P.eq(aD).fadeIn(b.animateTime,"failinear",function(){Site.triggerGobalEvent("site_BannerV2Switch");n()});ah.eq(aD).addClass("fk_imageSwitchBtnSel_bottomRound")}aq=aD})}}function M(){if(e.isBottomPhoto(f)){var aE=ay.find(".fk_imageSwitchBtn_bottomPhoto_prev");var aD=ay.find(".fk_imageSwitchBtn_bottomPhoto_next");if(aq<u){aD.addClass("fk_imageSwitchBtn_bottomPhoto_next_active")}aE.on("click",function(){var aF=parseInt(R.attr("index"));if(!a(this).hasClass("fk_imageSwitchBtn_bottomPhoto_next_active")){return}if(aF===aa-1&&aa===2){aD.addClass("fk_imageSwitchBtn_bottomPhoto_next_active");a(this).removeClass("fk_imageSwitchBtn_bottomPhoto_next_active")}else{if(aF===aa-2){a(this).removeClass("fk_imageSwitchBtn_bottomPhoto_next_active");aD.addClass("fk_imageSwitchBtn_bottomPhoto_next_active")}else{aD.addClass("fk_imageSwitchBtn_bottomPhoto_next_active")}}R.attr("index",--aF);R.animate({marginLeft:-ap*aF},1000)});aD.on("click",function(){var aG=parseInt(R.attr("index"));var aF=(u-C)*aj.outerWidth(true);var aH;if(!a(this).hasClass("fk_imageSwitchBtn_bottomPhoto_next_active")){return}if(aG===0&&aG===aa-2){aE.addClass("fk_imageSwitchBtn_bottomPhoto_next_active");a(this).removeClass("fk_imageSwitchBtn_bottomPhoto_next_active")}else{if(aG===aa-2){a(this).removeClass("fk_imageSwitchBtn_bottomPhoto_next_active");aE.addClass("fk_imageSwitchBtn_bottomPhoto_next_active")}else{aE.addClass("fk_imageSwitchBtn_bottomPhoto_next_active")}}R.attr("index",++aG);if(aG===aa-1&&C!==0){aH=ap*aG-aF}else{aH=ap*aG}R.animate({marginLeft:-aH},1000)})}}function E(aJ,aD){var aG=ay.find(".fk_imageSwitchBtn_bottomPhoto_prev");var aE=ay.find(".fk_imageSwitchBtn_bottomPhoto_next");var aI=parseInt(R.attr("index"));var aF=Math.floor(aJ/u);var aK;if(aF-aI===1){aE.click()}else{if(aF-aI===-1&&(aJ+1>aD-C||C===0)){aG.click()}else{if(aI-aF>1){R.animate({marginLeft:0},1000);aG.removeClass("fk_imageSwitchBtn_bottomPhoto_next_active");aE.addClass("fk_imageSwitchBtn_bottomPhoto_next_active");R.attr("index",0)}else{if(aF-aI>1){var aH=(aa-C)*aj.outerWidth(true);if(aF===aa-1){aK=ap*2-aH}else{aK=ap*2}R.animate({marginLeft:-aK},1000);aE.removeClass("fk_imageSwitchBtn_bottomPhoto_next_active");aG.addClass("fk_imageSwitchBtn_bottomPhoto_next_active");R.attr("index",2)}}}}}if(ao==1){V.eq(0).addClass("spanShowName")}if(ao>1){if(K){Site.bannerAnimate.init({container:Fai.top.$("#"+s+" .switchGroup_"+s+""),effectIndex:v.at,currentIndex:b.index,speed:v.a,duration:v.i,_isBannerV2:k});if(i){ah.click(function(aE){aE.stopPropagation();var aD=ah.index(this);Site.bannerAnimate.stop();Site.bannerAnimate.goTo(aD);aq=aD});am();M()}else{if(d){m.click(function(aD){aD.stopPropagation();Site.bannerAnimate.next()});m.hover(function(){m.addClass(h[b.btnType].name+"_next_hover")},function(){m.removeClass(h[b.btnType].name+"_next_hover")});T.click(function(aD){aD.stopPropagation();Site.bannerAnimate.prev()});T.hover(function(){T.addClass(h[b.btnType].name+"_prev_hover")},function(){T.removeClass(h[b.btnType].name+"_prev_hover")})}}p.mouseover(function(){Site.bannerAnimate.stop()});p.mouseout(function(){Site.bannerAnimate.autoPlay()})}else{if(i){var ae=false;am();M();ah.click(function(aH){if(P.is(":animated")){return}aH.stopPropagation();var aF=ah.index(this);if(aF==aq){return}V.eq(aq).removeClass("spanShowName");V.eq(aF).addClass("spanShowName");if(e.isNum(f)){ah.eq(aq).removeClass("imageSwitchBtnSel");ah.eq(aF).addClass("imageSwitchBtnSel")}else{if(e.isBox(f)){ah.eq(aq).removeClass("fk_imageSwitchBtnSel_box");ah.eq(aF).addClass("fk_imageSwitchBtnSel_box")}else{if(e.isAdsorptionRound(f)){ah.eq(aq).find(".fk_adsorptionRound_num").removeClass("fk_adsorptionRound_num_current");ah.eq(aF).find(".fk_adsorptionRound_num").addClass("fk_adsorptionRound_num_current");if(!Site.checkBrowser()){ah.eq(aq).removeClass("fk_imageSwitchBtn_ar_current");ah.eq(aF).addClass("fk_imageSwitchBtn_ar_current")}var aD=a(".fk_adsorptionRound_current");var aE=ah.eq(aq).position().left;var aG=ah.eq(aF).position().left;aD.animate({a:aG},{step:function(aJ,aK){aK.start=aE;if(aJ>aK.start&&aK.start<aG||(aJ<aK.start&&aK.start>aG)){aD.css("transform","translate3d("+aJ+"px, 0px, 0px) scale(1.5, 1.5")}},duration:600})}else{if(e.isBottomRound(f)){ah.eq(aq).removeClass("fk_imageSwitchBtnSel_bottomRound");if(ae){ay.find(".J_bottomRoundlinear").eq(aq).addClass("f-animal-linear").css({"transition-duration":"transform "+b.animateTime/1000+"s linear","-webkit-transition":"-webkit-transform "+b.animateTime/1000+"s linear"})}else{ah.eq(aF).addClass("fk_imageSwitchBtnSel_bottomRound")}}else{if(e.isBottomPhoto(f)){ah.eq(aq).removeClass("fk_imageSwitchBtnSel_bottomPhoto");ah.eq(aF).addClass("fk_imageSwitchBtnSel_bottomPhoto");E(aF,ao)}else{ah.eq(aq).removeClass("imageSwitchBtnSel_dot");ah.eq(aF).addClass("imageSwitchBtnSel_dot")}}}}}switch(b.animateStyle){case"o":P.eq(aq).fadeOut(b.animateTime,"failinear",function(){Site.triggerGobalEvent("site_BannerV2Switch");n()});P.eq(aF).fadeIn(b.animateTime,"failinear",function(){Site.triggerGobalEvent("site_BannerV2Switch");n();if(e.isBottomRound(f)&&ae){ay.find(".J_bottomRoundlinear").removeClass("f-animal-linear").css({"transition-duration":"","-webkit-transition":""});ah.eq(aF).addClass("fk_imageSwitchBtnSel_bottomRound");ae=false}});if(b.wideScreen){P.eq(aq).siblings().fadeOut(b.animateTime,"failinear");P.eq(aF).siblings().fadeIn(b.animateTime,"failinear")}break;case"x":x.animate({marginLeft:-aF*ac},b.animateTime);break;case"y":x.animate({marginTop:-aF*at},b.animateTime);break;case"show":case"show-x":case"show-y":P.eq(aq).hide(b.animateTime);P.eq(aF).show(b.animateTime);break;case"none":P.eq(aq).hide();P.eq(aF).show();if(b.wideScreen){P.eq(aq).siblings().hide();P.eq(aF).siblings().show()}break}aq=aF;var aI=Fai.top.$("#bannerGetHref");if(aI){aI.css({width:b.data[aF].imgWidth,left:(p.width()-b.data[aF].imgWidth)/2+"px"});aI.css({height:b.data[aF].imgHeight,top:(p.height()-b.data[aF].imgHeight)/2+"px"})}});function H(){ae=true;ah.eq((aq+1)%ao).click()}}else{if(d){var G=aq;V.eq(G).addClass("spanShowName");function D(aE){aE.stopPropagation();if(Fai.top.$(".arrowImg").is(":animated")){return}V.eq(G).removeClass("spanShowName");if(G==ao-1){G=-1}++G;V.eq(G).addClass("spanShowName");var aD=o;if(b.wideScreen){aD=ad}a(function(){aD=Fai.top.$(".arrowImg").width();Fai.top.$(".arrowImg").css({display:"block"});Fai.top.$("#arrowImg"+G).css({left:aD+"px"});Fai.top.$(".arrowImg").animate({left:"-="+aD+"px"},b.animateTime,function(){Site.triggerGobalEvent("site_BannerV2Switch");n();Fai.top.$(".arrowImg").css({display:"none"});Fai.top.$("#arrowImg"+G).css({display:"block"})});var aF=Fai.top.$("#bannerGetHref");if(aF){aF.css({width:b.data[G].imgWidth,left:(p.width()-b.data[G].imgWidth)/2+"px"});aF.css({height:b.data[G].imgHeight,top:(p.height()-b.data[G].imgHeight)/2+"px"})}})}m.on("click",D);m.hover(function(){m.addClass(h[b.btnType].name+"_next_hover")},function(){m.removeClass(h[b.btnType].name+"_next_hover")});function t(aE){aE.stopPropagation();if(Fai.top.$(".arrowImg").is(":animated")){return}V.eq(G).removeClass("spanShowName");if(G==0){G=ao}var aD=o;if(b.wideScreen){aD=ad}a(function(){aD=Fai.top.$(".arrowImg").width();--G;V.eq(G).addClass("spanShowName");Fai.top.$(".arrowImg").css({display:"block"});Fai.top.$("#arrowImg"+G).css({left:"-"+aD+"px"});Fai.top.$(".arrowImg").animate({left:"+="+aD+"px"},b.animateTime,function(){Site.triggerGobalEvent("site_BannerV2Switch");n();Fai.top.$(".arrowImg").css({display:"none"});Fai.top.$("#arrowImg"+G).css({display:"block"})});var aF=Fai.top.$("#bannerGetHref");if(aF){aF.css({width:b.data[G].imgWidth,left:(p.width()-b.data[G].imgWidth)/2+"px"});aF.css({height:b.data[G].imgHeight,top:(p.height()-b.data[G].imgHeight)/2+"px"})}})}T.on("click",t);T.hover(function(){T.addClass(h[b.btnType].name+"_prev_hover")},function(){T.removeClass(h[b.btnType].name+"_prev_hover")});function X(){m.click()}}}var az="imageSwitch"+Math.random()+"banner";if(b.btnType!=0&&b.btnType!=4){Fai.addInterval(az,H,parseInt(b.playTime+b.animateTime))}else{Fai.addInterval(az,X,parseInt(b.playTime+b.animateTime))}var af=setTimeout(function(){if(i){H()}else{if(d){X()}}Fai.startInterval(az)},b.playTime);if(typeof b.mouseoverId!="undefined"){a(Fai.top.$(p).find("."+b.mouseoverId)[0]).mouseover(function(){af&&clearTimeout(af);Fai.stopInterval(az)});a(Fai.top.$(p).find("."+b.mouseoverId)[0]).mouseout(function(){af&&clearTimeout(af);Fai.startInterval(az)})}else{p.mouseover(function(){af&&clearTimeout(af);Fai.stopInterval(az)});p.mouseout(function(){af&&clearTimeout(af);Fai.startInterval(az)})}}}})}})})(jQuery);Site.initBanner=function(v,e,g){if(Fai.top._uiMode){return}var o=false;var a=Fai.top.$("#webBanner");var c=Fai.top.$("#banner");var x=Site.getWebBackgroundData();var u=x.wbs?true:false;if(Fai.top._templateLayout==0||Fai.top._templateLayout==1||Fai.top._templateLayout==9||Fai.top._templateLayout==10){var p=Fai.top._manageMode?Site.getWebBackgroundData().wbh:Fai.top._webBannerHeight;if(p>-1){v.height=p;if(c.siblings(".nav, #navV2Wrap").length>0){var q=c.attr("normalheight");if(q==-1){q=c.css("height").replace("px","")}var s=c.siblings(".nav, #navV2Wrap").height()||0;if(p>-1){v.height=a.height()-s;if(a.height()<(parseInt(q)+parseInt(s))){o=true}}if(c.attr("normalheight")==-1&&o){c.css({height:v.height+"px"})}}}}if(v._open){if(e._open&&Fai.flashChecker().f){v.mouseoverId="bannerGetHref"}else{v.mouseoverId="switchGroup"}c.children().remove();c.bannerImageSwitch(v);var r=c.width();var b=c.height();var i=Fai.top._manageMode?Fai.getScrollWidth():0;var n=Fai.top.$(window).width()>Fai.top.$("#web").width()?Fai.top.$(window).width():Fai.top.$("#web").width();if(o){b=v.height}if(u){r=Fai.top.$("#webBanner").width();r=(r>n)?n-i:r;b=Fai.top.$("#webBanner").height()}var d=(Fai.top.$("#containerFormsCenter").find("div").eq(0).attr("id"));var l=Fai.top.$("#banner .switchGroup");Fai.top.$("#banner .switchGroup .J_bannerItem").each(function(A){if(!v.data[A]){return false}var z=v.data[A]?v.data[A].imgWidth:0;if(r>=z&&!u){$(this).css("width",v.data[A].imgWidth);var y=l.width()-v.data[A].imgWidth;if(Fai.isIE()){y=y+(y%2)}$(this).siblings(".J_bannerEdge").css("width",y/2)}else{$(this).css("width",r);var y=l.width()-r;if(Fai.isIE()){y=y+(y%2)}$(this).siblings(".J_bannerEdge").css("width",y/2)}if(b>=v.data[A].imgHeight&&!u){if(Site.checkBrowser()&&Fai.top._bannerData.at>0){$(this).css("height",b)}else{$(this).css("height",v.data[A].imgHeight);$(this).parent().css("paddingTop",(b-v.data[A].imgHeight)/2+"px")}$(this).siblings(".J_bannerEdge").height(v.data[A].imgHeight);$(this).siblings(".J_bannerEdge").css("top",(b-v.data[A].imgHeight)/2+"px")}else{$(this).css("height",b);$(this).siblings(".J_bannerEdge").height(b)}});c.css("background","none")}else{Site.refreshDefaultBannerEdge()}if(e._open&&Fai.flashChecker().f){if($.browser.mozilla&&$.browser.version=="49.0"){return}var h=0;var w=0;var f=Fai.top.$("#banner").width();if(f>960){f=960;h=parseInt((Fai.top.$("#webBanner").width()-960)/2)}var j=Fai.top.$("#banner").height();if(e.position==1){f=f/2}else{if(e.position==2){f=f/2;h+=f}else{if(e.position==3){h+=e.positionLeft;w=e.positionTop}}}if(typeof Fai!="undefined"&&typeof Fai.top._resRoot!="undefined"){resRoot=Fai.top._resRoot}if(typeof e.color1=="undefined"){e.color1="#000"}if(typeof e.color2=="undefined"){e.color2="#FFFFFF"}var t="text1="+Fai.encodeUrl(e.text1)+"&text2="+Fai.encodeUrl(e.text2)+"&size1="+e.size1+"&size2="+e.size2+"&color1=0x"+e.color1.substr(1,e.color1.length-1)+"&color2=0x"+e.color2.substr(1,e.color2.length-1)+"&style1="+e.style1+"&style2="+e.style2;var m=['<div class="effectShow" id="effectShow" style="position:absolute; top:'+w+"px; left:"+h+'px; z-index:1;">','<object id="effectShow_swf" type="application/x-shockwave-flash" data="'+Fai.top._resRoot+"/image/site/effects/"+e.type+".swf?"+$.md5(t)+'" width="'+f+'" height="'+j+'">','<param name="movie" value="'+Fai.top._resRoot+"/image/site/effects/"+e.type+".swf?"+$.md5(t)+'"/>','<param name="quality" value="high" />','<param name="wmode" value="transparent" />','<param name="flashvars" value="'+t+'"/>','<embed id="effectShowEmbed" name="effectShow_swf" type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-4445535400000" src="',Fai.top._resRoot,"/image/site/effects/"+e.type+".swf?"+$.md5(t)+'" wmode="transparent" quality="high" menu="false" play="true" loop="true" width="',f,'" height="',j,'flashvars="'+t+'"','" >',"</embed>","</object>","</div>"];m=m.join("");if(g==4){var k='<div id="bannerGetHref" class="bannerGetHref" style="position:absolute; top:0; left:'+h+"px; width:"+f+"px; height:100%; z-index:1; background:url('"+resRoot+'/image/site/transpace.png\');" onmouseover="Site.bannerInitHref();" onmouseout="Site.startBannerInterval();" onclick="Site.bannerGetHref();"></div>';m=m+k}c.append(m);var b=c.height();var r=c.width();if(v.data&&v.data.length>0){Fai.top.$("#bannerGetHref").css({width:v.data[0].imgWidth,height:v.data[0].imgHeight,left:(r-v.data[0].imgWidth)/2+"px",top:(b-v.data[0].imgHeight)/2+"px"})}}if(v._open&&$(".webBanner").width()!=960){$(window).resize(function(y){if(!y.target.nodeType||y.target.nodeType==9){setTimeout(function(){Site.refreshBanner(0)},500)}})}Site.adjustBannerFlash()};Site.adjustBannerWidth=(function(){function b(){var i=Fai.top.$(window),f=Fai.top.$("#webBanner"),e=Fai.top.$("#web");webBgData=Site.getWebBackgroundData();if(f.length<1||Fai.top._useBannerVersionTwo){return}if(webBgData.wbw!=-1){var d=Fai.top._manageMode?Fai.getScrollWidth():0,h=(parseInt(f.css("borderLeftWidth").replace("px",""))+parseInt(f.css("borderRightWidth").replace("px","")))||0,g=webBgData.wbw+h,c=e.width();if(c-d<g&&c<g){a(c-h)}i.off("resize.banner");i.on("resize.banner",function(){if(Fai.top._isTemplateVersion2&&webBgData.wbws==2){}else{c=e.width();if(i.width()-d<g&&c<g){a(c-h)}else{a(webBgData.wbw)}}})}else{i.off("resize.banner")}}function a(c){Fai.top.Fai.setCtrlStyleCss("styleWebSite","",".webBanner","width",c+"px !important");Fai.top.Fai.setCtrlStyleCss("styleWebSite","",".webBanner .banner","width","auto !important");Fai.top.Fai.setCtrlStyleCss("styleWebSite","",".webBanner .switchGroup","width",c+"px")}return b})();Site.startBannerInterval=function(){var a=0;if(Fai.intervalFunc!=undefined){a=Fai.intervalFunc.length}if(a>0){var b=Fai.intervalFunc[0].id;if(typeof b!="undefined"&&b.substring(0,11)=="imageSwitch"){Fai.startInterval(b)}}if(Fai.top._bannerData.n&&Fai.top._bannerData.n.length>1&&Site.checkBrowser()&&Fai.top._bannerData.at>0){Site.bannerAnimate.autoPlay()}};Site.stopBannerInterval=function(){var a=0;if(Fai.intervalFunc!=undefined){a=Fai.intervalFunc.length}if(a>0){var b=Fai.intervalFunc[0].id;if(typeof b!="undefined"&&b.substring(0,11)=="imageSwitch"){Fai.stopInterval(b)}}if(Fai.top._bannerData.n&&Fai.top._bannerData.n.length>1&&Site.checkBrowser()&&Fai.top._bannerData.at>0){Site.bannerAnimate.stop()}};Site.bannerInitHref=function(){Site.stopBannerInterval();var c=false;var a=Fai.top.$("#banner");var b=-1;a.find(".spanHiddenName").each(function(d,e){if($(this).hasClass("spanShowName")){b=d;return false}});if(b==-1){return}a.find(".switchGroup").children().each(function(d,e){if(d==b&&Fai.top.$(e).find("a").eq(0).attr("href")!="javascript:;"){Fai.top.$("#bannerGetHref").css("cursor","pointer");c=true;return false}});if(c==false){Fai.top.$("#bannerGetHref").css("cursor","default")}};Site.bannerGetHref=function(){var a=Fai.top.$("#banner");var c=-1;a.find(".spanHiddenName").each(function(d,e){if($(this).hasClass("spanShowName")){c=d;return false}});if(c==-1){return}var b="";a.find(".switchGroup").children().each(function(d,f){if(d==c){var e=Fai.top.$(f).find("a").eq(0);b=e.attr("href");if(typeof b!="undefined"&&b=="javascript:;"){$(e).click()}return false}});if(typeof b!="undefined"&&b!="javascript:;"){window.open(b)}};Site.adjustBannerFlash=function(){var b=Fai.top.$("#banner");var c=Fai.top.$("#imgPageFlash");if(c.length>0){var a=b.width();var d=c.width();if(a<d){c.css({position:"absolute",left:-(d-a)/2+"px"})}else{c.css({position:"",left:""})}}};Site.refreshBanner=function(i){if(Fai.top._uiMode){return}var a=Fai.top.$("#webBanner");var e=Fai.top.$("#banner");if(Fai.top._bannerData.h){Fai.top.$("#banner").css("display","none");return}if(typeof i=="undefined"){i=0}if(Fai.top._bannerData.s==3&&!Fai.top._bannerData.f.p){Fai.top._bannerData.s=0}if(Fai.top._bannerData.s==4&&Fai.top._bannerData.n.length==0){Fai.top._bannerData.s=0}Fai.top.$("#banner").css("display","block");if(Fai.top._bannerData.s==0){Fai.top.$("#banner").removeAttr("style");Fai.top.$("#banner").children().remove();var o=[];o.push("<div class='"+e.attr("class")+" defaultBannerMain'></div>");o.push("<div class='defaultBannerEdge defaultBannerEdgeLeft'></div>");o.push("<div class='defaultBannerEdge defaultBannerEdgeRight'></div>");e.append(o.join(""));if(Fai.top._templateLayout==0||Fai.top._templateLayout==1||Fai.top._templateLayout==9||Fai.top._templateLayout==10){var j=Fai.top._manageMode?Site.getWebBackgroundData().wbh:Fai.top._webBannerHeight;if(j>-1){if(e.siblings(".nav, #navV2Wrap").length>0){var f=e.css("height").replace("px","");var d=e.siblings(".nav, #navV2Wrap").height();if(a.height()<(parseInt(f)+d)){f=a.height()-d;e.css({height:f+"px"})}}}}Site.refreshDefaultBannerEdge()}else{if(Fai.top._bannerData.s==3){Fai.top.$("#banner").css("background","none");Fai.top.$("#banner").css("height",Fai.top._bannerData.f.h+"px");Fai.top.$("#banner").children().remove();var g='<embed type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-4445535400000" id="imgPageFlash" src="'+Fai.top._bannerData.f.p+'" wmode="opaque" quality="high" menu="false" play="true" loop="true" width="'+Fai.top._bannerData.f.w+'" height="'+Fai.top._bannerData.f.h+'" ></embed>';Fai.top.$("#banner").append(g);Site.adjustBannerFlash()}else{if(Fai.top._bannerData.s==4){Fai.top.Site.refreshBannerImageSwitch(i)}}}if(Fai.top._bannerData.o){if($.browser.mozilla&&$.browser.version=="49.0"){return}var p=0;var m=0;var l=Fai.top.$("#banner").width();var c=Fai.top.$("#banner").height();if(l>960){l=960;p=parseInt((Fai.top.$("#webBanner").width()-960)/2)}if(Fai.top._bannerData.p==1){l=l/2}else{if(Fai.top._bannerData.p==2){l=l/2;p+=l}else{if(Fai.top._bannerData.p==3){p+=Fai.top._bannerData.pl;m=Fai.top._bannerData.pt}}}if(typeof Fai!="undefined"&&typeof Fai.top._resRoot!="undefined"){resRoot=Fai.top._resRoot}if(typeof Fai.top._bannerData.ce.c1=="undefined"){Fai.top._bannerData.ce.c1="#000"}if(typeof Fai.top._bannerData.ce.c2=="undefined"){Fai.top._bannerData.ce.c2="#FFFFFF"}var k="text1="+Fai.encodeUrl(Fai.top._bannerData.ce.t1)+"&text2="+Fai.encodeUrl(Fai.top._bannerData.ce.t2)+"&size1="+Fai.top._bannerData.ce.sz1+"&size2="+Fai.top._bannerData.ce.sz2+"&color1=0x"+Fai.top._bannerData.ce.c1.substr(1,Fai.top._bannerData.ce.c1.length-1)+"&color2=0x"+Fai.top._bannerData.ce.c2.substr(1,Fai.top._bannerData.ce.c2.length-1)+"&style1="+Fai.top._bannerData.ce.s1+"&style2="+Fai.top._bannerData.ce.s2;var h=Fai.top._resRoot+"/image/site/effects/"+Fai.top._bannerData.t+".swf?"+$.md5(k);var b=['<div class="effectShow" id="effectShow" style="position:absolute; top:'+m+"px; left:"+p+'px; z-index:1;">','<object id="effectShow_swf" type="application/x-shockwave-flash" data="'+h+'" width="'+l+'" height="'+c+'">','<param name="movie" value="'+h+'" />','<param name="quality" value="high" />','<param name="flashvars" value="'+k+'"/>','<param name="wmode" value="transparent" />','<embed name="effectShow_swf" wmode="transparent" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-4445535400000" id="effectFlash" src="'+h+'" quality="high" menu="false" play="true" loop="true" width="'+l+'" height="'+c+'" flashvars="'+k+'" >',"</embed>","</object>","</div>"];b=b.join("");if(Fai.top._bannerData.s==4){var n='<div id="bannerGetHref" class="bannerGetHref" style="position:absolute; top:0; left:'+p+"px; width:"+l+"px; height:100%;z-index:1; background:url('"+resRoot+'/image/site/transpace.png\');" onmouseover="Site.bannerInitHref();" onmouseout="Site.startBannerInterval();" onclick="Site.bannerGetHref();"></div>';b=b+n}Fai.top.$("#banner").append(b);if(Fai.top._bannerData.n&&Fai.top._bannerData.n.length>0){Fai.top.$("#bannerGetHref").css({width:Fai.top._bannerData.n[i].w,height:Fai.top._bannerData.n[i].h,left:(Fai.top.$("#banner").width()-Fai.top._bannerData.n[i].w)/2+"px",top:(Fai.top.$("#banner").height()-Fai.top._bannerData.n[i].h)/2+"px"})}}else{Fai.top.$("#effectShow").remove()}};Site.getWebBackgroundData=function(){return Fai.top._Global._useTemplateBackground?Fai.top._templateBackgroundData:Fai.top._customBackgroundData};Site.refreshBannerImageSwitch=function(g){var c=0;var q=0;var h=new Array();var i=new Array();var s=new Array();var k=Fai.top._bannerData.bt;var o=false;var b=Fai.top.$("#webBanner");var e=Fai.top.$("#banner");var u=Site.getWebBackgroundData();var t=u.wbs?true:false;$.each(Fai.top._bannerData.n,function(x,B){var z=B.el||"";var A=B.er||"";var w=parseInt(B.h);var y=parseInt(B.w);if(w>c){c=w}if(y>q){q=y}if(B.e!=0){var v=B.jUrl||"javascript:;";if(Fai.top._manageMode){if($(".panelLibItem[vid="+B.i+"]").data("JURL")!=undefined){v=$(".panelLibItem[vid="+B.i+"]").data("JURL")}if(B.urlChange==1){v=B.jUrl||"javascript:;"}}if(v.length>12&&v.substring(0,10)=="javascript"){h.push({src:B.p,href:"javascript:;",onclick:v.substring(11)+"return false;",ot:B.ot,imgWidth:y,imgHeight:w,edgeLeft:z,edgeRight:A})}else{h.push({src:B.p,href:v,ot:B.ot,imgWidth:y,imgHeight:w,edgeLeft:z,edgeRight:A})}}else{h.push({src:B.p,imgWidth:y,imgHeight:w,edgeLeft:z,edgeRight:A})}i.push(y);s.push(w)});if(Fai.top._templateLayout==0||Fai.top._templateLayout==1||Fai.top._templateLayout==9||Fai.top._templateLayout==10){var d=Fai.top._manageMode?Site.getWebBackgroundData().wbh:Fai.top._webBannerHeight;if(d>-1){c=d;if(e.siblings(".nav, #navV2Wrap").length>0){var p=e.attr("normalheight");if(p==-1){p=e.css("height").replace("px","")}var r=r=e.siblings(".nav, #navV2Wrap").height()||0;if(d>-1&&b.height()<(p+r)){o=true;c=b.height()-r}}}}c=t?e.height():c;Fai.top.$("#banner").css("background","none");Fai.top.$("#banner").children().remove();Fai.top.$("#banner").css("height",c+"px");Fai.top.$("#banner").bannerImageSwitch({data:h,index:g,width:q,height:c,from:"banner",playTime:Fai.top._bannerData.i,animateTime:Fai.top._bannerData.a,btnType:k,wideScreen:Fai.top._bannerData.ws});var a=Fai.top.$("#banner").width();var l=Fai.top.$("#banner").height();var j=Fai.top._manageMode?Fai.getScrollWidth():0;var n=Fai.top.$(window).width()>Fai.top.$("#web").width()?Fai.top.$(window).width():Fai.top.$("#web").width();if(o){l=c}if(t){a=Fai.top.$("#webBanner").width();a=(a>n)?n-j:a}var f=(Fai.top.$("#containerFormsCenter").find("div").eq(0).attr("id"));var m=Fai.top.$("#banner .switchGroup");Fai.top.$("#banner .switchGroup .J_bannerItem").each(function(w){if(a>=i[w]&&!t){$(this).css("width",i[w]);var v=m.width()-i[w];if(Fai.isIE()){v=v+(v%2)}$(this).siblings(".J_bannerEdge").css("width",(v/2)+"px")}else{$(this).css("width",a);var v=m.width()-a;if(Fai.isIE()){v=v+(v%2)}$(this).siblings(".J_bannerEdge").css("width",(v/2)+"px")}if(l>=s[w]&&!t){if(Site.checkBrowser()&&Fai.top._bannerData.at>0){$(this).css("height",l)}else{$(this).css("height",s[w]);$(this).parent().css("paddingTop",(l-s[w])/2+"px")}$(this).siblings(".J_bannerEdge").css("height",s[w]);$(this).siblings(".J_bannerEdge").css("top",(l-s[w])/2+"px")}else{$(this).css("height",l);$(this).siblings(".J_bannerEdge").css("height",l)}})};Site.refreshBannerHeight=function(){var d=Fai.top.$("#webBanner"),b=Fai.top.$("#banner"),a=b.height();var f=Fai.top._manageMode?Site.getWebBackgroundData().wbh:Fai.top._webBannerHeight;if(f>-1){a=f;if(b.siblings(".nav, #navV2Wrap").length>0){var e=b.attr("normalheight");if(e==-1){e=b.css("height").replace("px","")}var c=b.siblings(".nav, #navV2Wrap").height()||0;if(f>-1&&d.height()<(e+c)){fixHeightFlag=true;a=d.height()-c}}}Fai.top.$("#banner").css("height",a+"px")};Site.refreshDefaultBannerEdge=function(){var b=Fai.top.$("#banner");if(b.length>0){var c=b.attr("defaultwidth")||960;if(b.children(".defaultBannerEdge").length>0){var a=b.width()-c;a=(a+(a%2))/2;b.children(".defaultBannerEdge").css("width",a)}}};Site.checkBrowser=(function(){var c=["animation","MozAnimation","webkitAnimation","msAnimation","OAnimation"],e=["transform","MozTransform","webkitTransform","msTransform","OTransform"],b=["opacity","MozOpacity","webkitOpacity","msOpacity","OOpacity"],d=document.createElement("div"),a={};return function(g){if(typeof a[g]=="boolean"){return a[g]}switch(g){case"animation":props=c;break;case"transform":props=e;break;case"opacity":props=b;break;default:props=c}for(var h=0,f=props.length;h<f;h++){if(d.style[props[h]]!==undefined){a[g]=true;return a[g]}}a[g]=false;return a[g]}})();Site.bannerAnimate={};(function(j,u,k){var G=false,y=1,c=0,i=-1,f=-1,d={autoPlay:true,currentIndex:0,speed:1500,duration:4000,effectIndex:1},I,A=true,q,s,C=0,E=0,m=0,w,o,e,b,l;var x={0:{name:"arrow",classes:"arrowImg",switchType:"Slide"},1:{name:"Num",classes:"numImg",switchType:"Fade"},2:{name:"Dot",classes:"dotImg",switchType:"Fade"},3:{name:"Box",classes:"boxImg",switchType:"Fade"},4:{name:"NoColorArrow",classes:"arrowImg",switchType:"Slide"},5:{name:"RightColorArrow",classes:"arrowImg",switchType:"Slide"},6:{name:"AdsorptionRound",classes:"adsorptionRoundImg",switchType:"Fade"},7:{name:"BottomRound",classes:"bottomRoundImg",switchType:"Fade"},8:{name:"BottomPhoto",classes:"bottomPhotoImg",switchType:"Fade"}};u.animating=false;u.init=function(J){G=Site.checkBrowser();if(!G){return}if(!J.container){return}p();H(J);g();n();D()};function g(){if(Fai.isSafari()){}else{if(navigator.platform.match(/(Mac|iPhone|iPod|iPad)/i)){}else{return}}Fai.top.$("#"+o).addClass("fk-fixPerspective")}function p(){u.animating=false;clearTimeout(q);for(var J=0;J<C;J++){v(w.eq(J)[0],t)}}function D(){r();if(I.autoPlay){F()}}function F(){if(!u.animating){clearTimeout(q);q=setTimeout(u.next,I.duration)}}function z(){if(Fai.top._useBannerVersionTwo){e=x[l.bt].classes;var K="J_billboardItem billboard_item "+e;Fai.top.$("#bannerV2").find(".J_billboardItem").attr("class",K).attr("style","");b="billboard billboard"+l.at;var J="switchGroup switchGroup_bannerV2 "+b;Fai.top.$("#bannerV2 .switchGroup_bannerV2").attr("class",J);Site.bannerAnimate.init({container:Fai.top.$("#bannerV2 .switchGroup_bannerV2"),effectIndex:13,currentIndex:c,speed:I.speed,duration:I.duration,_isBannerV2:true})}else{Site.refreshBanner(c)}}u.autoPlay=function(){A=true;F()};u.next=function(){var J=c+1;if(J>=w.length){J=0}u.goTo(J,false)};u.prev=function(){var J=c-1;if(J<0){J=w.length-1}u.goTo(J,true)};u.stop=function(){if(!A){return}A=false;clearTimeout(q)};u.goTo=function(Q,S){if(isNaN(Q)||Q>=C||Q<0||Q==c){return}if(this.animating){return}f=Q;if(typeof S==="undefined"){var S=(f>c?false:true)}var ah=Fai.top.$("#"+o).find(".imageSwitchBtnArea"),V=Fai.top.$("#"+o).find(".imageSwitchShowName"),ad=V.children("span"),U=l.bt==8?ah.find(".fk_imageSwitchReal").children("a"):ah.children("a"),R=w.eq(c),T=4,O=ah.find(".fk_imageSwitchReal"),aa=parseInt(O.attr("index")),P=w.eq(f);if(l.bt==0){}else{if(l.bt==1){U.removeClass("imageSwitchBtnSel");U.eq(f).addClass("imageSwitchBtnSel")}else{if(l.bt==2){U.removeClass("imageSwitchBtnSel_dot");U.eq(f).addClass("imageSwitchBtnSel_dot")}else{if(l.bt==3){U.removeClass("fk_imageSwitchBtnSel_box");U.eq(f).addClass("fk_imageSwitchBtnSel_box")}else{if(l.bt==6){U.eq(c).find(".fk_adsorptionRound_num").removeClass("fk_adsorptionRound_num_current");U.eq(f).find(".fk_adsorptionRound_num").addClass("fk_adsorptionRound_num_current");if(!Site.checkBrowser()){U.eq(c).removeClass("fk_imageSwitchBtn_ar_current");U.eq(f).addClass("fk_imageSwitchBtn_ar_current")}var Y=j(".fk_adsorptionRound_current");var ac=U.eq(c).position().left;var X=U.eq(f).position().left;Y.animate({a:X},{step:function(al,am){am.start=ac;if(al>am.start&&am.start<X||(al<am.start&&am.start>X)){Y.css("transform","translate3d("+al+"px, 0px, 0px) scale(1.5, 1.5")}},duration:500})}else{if(l.bt==7){U.removeClass("fk_imageSwitchBtnSel_bottomRound");if(A){ah.find(".J_bottomRoundlinear").eq(c).addClass("f-animal-linear").css({"transition-duration":"transform "+l.a/1000+"s linear","-webkit-transition":"-webkit-transform "+l.a/1000+"s linear"})}else{U.eq(f).addClass("fk_imageSwitchBtnSel_bottomRound")}}else{if(l.bt==8){U.removeClass("fk_imageSwitchBtnSel_bottomPhoto");U.eq(f).addClass("fk_imageSwitchBtnSel_bottomPhoto");if(s.width()<960){T=3}var Z=ah.find(".fk_imageSwitchBtn_bottomPhoto");var ag=ah.find(".fk_imageSwitchPanel");var ai=Z.outerWidth(true)*T;var J=C%T;var W=Math.ceil(C/T);var af=(T-J)*Z.outerWidth(true);var L=Math.floor(Q/T);var M=ah.find(".fk_imageSwitchBtn_bottomPhoto_prev");var N=ah.find(".fk_imageSwitchBtn_bottomPhoto_next");var ae;if(L-aa===1){N.click()}else{if(L-aa===-1&&(f+1>C-J||J===0)){M.click()}else{if(aa-L>1){O.animate({marginLeft:0},1000);M.removeClass("fk_imageSwitchBtn_bottomPhoto_next_active");N.addClass("fk_imageSwitchBtn_bottomPhoto_next_active");O.attr("index",0)}else{if(L-aa>1){if(L===W-1){ae=ai*2-af}else{ae=ai*2}O.animate({marginLeft:-ae},1000);N.removeClass("fk_imageSwitchBtn_bottomPhoto_next_active");M.addClass("fk_imageSwitchBtn_bottomPhoto_next_active");O.attr("index",2)}}}}}}}}}}}ad.removeClass("spanShowName");ad.eq(f).addClass("spanShowName");P.css("display","block");if(y==11){var K=["15% 15%","85% 85%","15% 85%","85% 15%"];var ab=["billboardItem_11_on_zoomOut","billboardItem_11_on_zoomIn"];var ak=K[Math.floor(Math.random()*K.length)];var aj=ab[Math.floor(Math.random()*ab.length)];P.addClass(aj).removeClass("billboardItem_11_off");B(P,"transformOrigin",ak);R.addClass("billboardItem_11_off");R.removeClass("billboardItem_11_on_zoomIn billboardItem_11_on_zoomOut billboardItem_11_start")}else{R.removeClass("billboardItem_"+y+"_on billboardItem_"+y+"_on_reverse");R.addClass("billboardItem_"+y+"_off");P.removeClass("billboardItem_"+y+"_off billboardItem_"+y+"_off_reverse");P.addClass("billboardItem_"+y+"_on");if(S){R.addClass("billboardItem_"+y+"_off_reverse");P.addClass("billboardItem_"+y+"_on_reverse")}}u.animating=true;i=c;c=f;h(P[0],t)};function t(){if(v(this,t)){u.animating=false;w.eq(i).css("display","none");if(A){clearTimeout(q);if(I.effectIndex==13){z()}else{q=setTimeout(function(){u.next()},I.duration)}if(l.bt==7){var L=Fai.top.$("#"+o).find(".imageSwitchBtnArea");var J=L.children("a");var K=L.find(".J_bottomRoundlinear");K.removeClass("f-animal-linear").css({"transition-duration":"","-webkit-transition":""});J.eq(c).addClass("fk_imageSwitchBtnSel_bottomRound")}}else{if(I.effectIndex==13){z()}}if(Fai.top._useBannerVersionTwo&&Fai.top.$(".fk-inBannerListZone").find(".form").length){Site.triggerGobalEvent("site_BannerV2Switch");jzUtils.run({name:"moduleAnimation.publish",base:Fai.top.Site});jzUtils.run({name:"moduleAnimation.contentAnimationPublish",base:Fai.top.Site})}}}function r(){var L;for(var K=0;K<w.length;K++){L=w.eq(K);B(L,"animationDuration",I.speed+"ms")}var J=w.eq(I.currentIndex);J.addClass("billboardItem_"+y+"_start");w.css("display","none");J.css("display","block")}function h(J,K){J.addEventListener("animationend",K,false);J.addEventListener("webkitAnimationEnd",K,false);J.addEventListener("oAnimationEnd",K,false);J.addEventListener("oanimationend",K,false);J.addEventListener("msAnimationEnd",K,false);return true}function v(J,K){J.removeEventListener("animationend",K,false);J.removeEventListener("webkitAnimationEnd",K,false);J.removeEventListener("oAnimationEnd",K,false);J.removeEventListener("oanimationend",K,false);J.removeEventListener("msAnimationEnd",K,false);return true}function n(){E=s.width()||0;m=Fai.top.$("#"+o).height()||0;var S;var Q=Site.getWebBackgroundData();var O=false;var M=Fai.top._manageMode?Fai.getScrollWidth():0;var J=Fai.top.$(window).width()-M;if(Fai.top._useBannerVersionTwo){O=Fai.top._bannerV2Data.bla==0?true:false}else{O=Q.wbs?true:false}if(O){E=(E>J)?J:E}if(I.effectIndex==13){s.addClass("billboard"+y)}s.css("height",m+"px");for(var L=0;L<w.length;L++){S=w.eq(L);S.addClass("billboardItem_"+y+" billboardAnim");S.css({width:"100%",height:m+"px"});if(y==6){B(S,"transformOrigin","50% 50% "+(-E/2)+"px")}else{if(y==7){B(S,"transformOrigin","50% 50% "+(-m/2)+"px")}else{if(y==8||y==9){var P=j(document.createElement("div"));P.addClass("billboard_item billboardItem_"+y+" billboardItem_"+y+"_"+(L+1));for(var K=1;K<=3;K++){var N=j(document.createElement("div"));N.addClass("billboardTile billboardTile_"+K+" billboardAnim");B(N,"animationDuration",I.speed+"ms");if(y==8){B(N,"transformOrigin","50% 50% "+(-E/2)+"px")}else{B(N,"transformOrigin","50% 50% "+(-m/2)+"px")}var T=S.clone();T.attr("class","billboardImg").removeAttr("style");T.find(".J_bannerItem").addClass("billboardImgInner");j(N).append(T);j(P).append(N)}S.before(P);S.remove()}else{if(y==10||y==12){var P=j(document.createElement("div"));P.addClass("billboard_item billboardItem_"+y+" billboardItem_"+y+"_"+(L+1));P.css({width:"100%",height:m+"px"});for(var K=1;K<=4;K++){var N=j(document.createElement("div"));N.addClass("billboardTile billboardTile_"+K);var R=j(document.createElement("div"));R.addClass("billboardAnim billboardTileImg");B(R,"animationDuration",I.speed+"ms");N.append(R);var T=S.clone();T.attr("class","billboardImg").removeAttr("style");T.find(".J_bannerItem").addClass("billboardImgInner");R.append(T);P.append(N)}S.before(P);S.remove()}}}}}if(y==8||y==9||y==10||y==12){w=s.children();C=w.length}}function H(J){i=-1;f=-1;I=j.extend({},d,J);y=I.effectIndex;if(I.effectIndex==13){y=a(4,7)}c=I.currentIndex;A=I.autoPlay;s=I.container;w=s.children();C=w.length;o=I._isBannerV2?"bannerV2":"banner";l=I._isBannerV2?Fai.top._bannerV2Data:Fai.top._bannerData}function B(L,M,K){var J=M.substring(0,1).toUpperCase()+M.substring(1);L.css("Webkit"+J,K);L.css("Moz"+J,K);L.css("ms"+J,K);L.css("O"+J,K);L.css(M,K)}function a(M,J){var K=J-M+1;var L=Math.floor(Math.random()*K+M);if(Fai.top._useBannerVersionTwo){if(L==8||L==9||L==10||L==12){return a(M,J)}}return L}})(jQuery,Site.bannerAnimate);Site.initModuleProductSearch=function(e){var d=$("#module"+e+" .productSearch");d.autocomplete({source:function(g,f){jQuery.ajax({url:"ajax/product_h.jsp",data:"cmd=getKeywordList&limit=6&term="+Fai.encodeUrl(d.val())+"&prgmid="+e,type:"GET",dataType:"json",success:function(h){f($.map(h,function(i){return{label:i,value:i}}))}})},delay:100,select:function(g,h){var f=h.item.label;Site.searchProduct(e,f)}});d.keypress(function(f){if(f.keyCode==13){Site.searchProduct(e)}});var c=$("#module"+e);var b=c.find(".searchBox").attr("class");var a=c.find(".recommandKeyBox");if(b=="searchBox"){a.css("vertical-align","7px")}else{a.css("vertical-align","11px")}};Site.searchProduct=function(d,a){var e=$("#module"+d),c,f,b;if(e.find(".fk-newSearchBox").length){c=e.find(".fk-newSearchInput")}else{c=e.find("input.g_itext")}f=c.val();if(c.attr("_searching")){return}if(a){f=a}if(f.trim()==""){Fai.ing("请输入搜索内容",true);return}Fai.top.location.href="pr.jsp?keyword="+Fai.encodeUrl($.trim(f))+"&_pp=0_"+d};Site.searchProductByKey=function(c,d,b){var a="pr.jsp?keyword="+Fai.encodeUrl($.trim(d))+"&_pp=0_"+c;if(Fai.top._manageMode){Site.redirectUrl(a,"_self",b,1,0)}else{Fai.top.location.href=a}};Site.changeTxtLenght=function(){var b=Fai.top.$(".head_txt").length;var a=[];for(var d=0;d<b;d++){var c=$(".head_txt").eq(d).width();a.push(c)}var e=Math.max.apply(null,a);$(".head_txt").css("width",e)};Site.memberCenterInit=function(d,f,c,e,a){if(c){$("#module"+d).find(".formBanner").hide()}$(".mCenter .mCenterLeft li").click(function(){$(".mCenter .mCenterTitle:first-child").html("<span class='underline' style='padding-left:10px;'>"+$(this).find("span").html()+"</span>");if(c&&$(this).attr("id")=="memberCoupon"){$(".mCenter .mCenterTitleList").hide()}else{$(".mCenter .mCenterTitleList").show()}if($(this).attr("id")=="memberBind"){Site.logDog(200199,2)}if($(this).attr("id")=="memberOrder"){var g=$(".memberOrderNewPanel .mallOrderNewList");$(".J_orderEmpty").hide();if($(".itemList .itemLine").length==0){$(".pagenation").hide()}if($(".memberOrderOldPanel .line.itemLine").length==0){$(".memberOrderOldPanel .pagenation").hide()}$(".mCenterTitle").removeClass("mCenterTitleSelected");$(".memberOrderPanel").find(".itemList .itemLine").show();if(c&&e){$(".mCenter .mCenterTitleList .mCenterTitle:first-child").addClass("mCenterTitleSelected"+a)}$(".mCenter .mCenterTitleList .mCenterTitle:first-child").addClass("mCenterTitleSelected");$(".mCenter .mCenterTitleList .mCenterTitleOrder").show();$(".mCenterTitle").on("click.mCenterTitle",function(){$(".mCenter .mCenterTitleList .mCenterTitle:first-child").css("cursor","pointer");if(c&&e){$(".mCenterTitle").removeClass("mCenterTitleSelected"+a);$(this).addClass("mCenterTitleSelected"+a)}$(".mCenterTitle").removeClass("mCenterTitleSelected");$(this).addClass("mCenterTitleSelected");if(c){$(this).css("display","table-cell")}else{$(this).css("display","inline-block")}if(g.attr("_managemode")){if($(this).hasClass("J_refundStatus")){$(".memberOrderPanel").find(".itemList .itemLine").each(function(l,m){var k=false;$(m).find(".J_refundTD").each(function(o,q){var p=parseInt($(q).attr("_rs"))||0;if(p>0&&p<35){k=true;return false}});if(k){$(this).show()}else{$(this).hide()}})}else{if($(this).hasClass("mCenterTitleOrder")){var j=$(this).text();$(".memberOrderPanel").find(".itemList .itemLine .J-status").each(function(k,l){if($(this).text()==j){$(this).parents(".itemLine").show()}else{$(this).parents(".itemLine").hide()}})}else{$(".memberOrderPanel").find(".itemList .itemLine").show()}}}if($(".itemList .itemLine").length==0){$(".pagenation").hide();$(".J_orderEmpty").show()}else{$(".J_orderEmpty").hide();$(".pagenation").show()}if(g.attr("_managemode")){if($(".itemList .itemLine:visible").length==0){$(".pagenation").hide();$(".line.g_title").hide();$(".orderEmpty").show();$(".J_orderEmpty").show()}else{$(".pagenation").show();$(".line.g_title").show();$(".J_orderEmpty").hide();$(".orderEmpty").hide()}}if(!g.attr("_managemode")){g.children().hide();if($(this).hasClass("J_allOrder")){$(".mallOrderAll").show()}else{if($(this).hasClass("J_waitSettle")){$(".mallOrderWaitSettle").show()}else{if($(this).hasClass("J_finSettle")){$(".mallOrderFinSettle").show()}else{if($(this).hasClass("J_FinPay")){$(".mallOrderFinPay").show()}else{if($(this).hasClass("J_FinShip")){$(".mallOrderFinShip").show()}else{if($(this).hasClass("J_finProcess")){$(".mallOrderFinProcess").show()}else{if($(this).hasClass("J_refundStatus")){$(".mallOrderRefund").show()}}}}}}}}});if(g.length>0&&!g.attr("_managemode")){$(".mCenterTitleSelected").click()}}else{$(".mCenterTitle").off("click.mCenterTitle");$(".mCenter .mCenterTitleList .mCenterTitle:first-child").removeClass("mCenterTitleSelected");$(".mCenter .mCenterTitleList .mCenterTitleOrder").hide()}var i=$(this).attr("id");var h=$(".mCenter .mCenterRight ."+i+"Panel");h.show();h.siblings().hide();if(c&&e){$(this).addClass("selected");$(this).find("span").addClass("g_selected"+a);$(this).siblings().removeClass("selected");$(this).siblings().find("span").removeClass("g_selected"+a)}else{$(this).addClass("selected");$(this).find("span").addClass("g_selected");$(this).siblings().removeClass("selected");$(this).siblings().find("span").removeClass("g_selected")}});var b=Fai.getUrlParam(Fai.top.location.search,"item");switch(b){case"memberOrder":$("#memberOrder")[0].click();break;case"memberIntegral":if($("#memberIntegral").length>0){$("#memberIntegral")[0].click();break}case"memberInfo":$("#addrMsg").click();break;case"memberCoupon":$("#memberCoupon").click();break;case"memberCollection":$("#memberCollection").click();break;default:$("#memberProfile")[0].click();break}Site.initContentSplitLine(d,f)};Site.memberCenterNewStyleSmallWidth=function(d,b){var a=$("#module"+d);var e=a.width();var c=true;if(a.find(".memberOrderNewPanel .J-mallOrder .itemList").hasClass("newRefundStyle")){c=false}if(b&&e<1200&&c){a.find(".J-mCenterR").css("padding-left","15px");a.find(".memberOrderNewPanel .J-mallOrder .itemList .g_title .itemOpt").css("padding-left","60px")}};Site.memberCenterCompatibility=function(b){var c=!("placeholder" in document.createElement("input"));if(c){var a=$("#module"+b).find(".itemCtrl");$.each(a,function(j,l){var m=$(l).find("span");m.css({"white-space":"nowrap"});var g=$(m).width();var k=$(m).height();var f=$(l).position().top+(Fai.isIE6()?2:0);var d=$(l).position().left;$(m).css({top:f+"px",left:d+"px","line-height":k+"px",padding:"0px 0px 0px 4px",width:g+"px"});var h=$(l).find("input").val();if(h&&h.length>0){$(m).hide()}})}};Site.memberHeadPicInit=function(b){if(typeof(headPic)!="undefined"){headPic=$.parseJSON(headPic);var a=headPic.width/100;$("#memberHeadPic").css({width:headPic.imgW/a+"px",height:headPic.imgH/a+"px",top:-(headPic.top/a)+"px",left:-headPic.left/a+"px"})}$(".memberHeadPic").on({hover:function(){$(".hoverTip").toggle()},click:function(){var c="memberHeadPicEdit.jsp?id="+b+"&headPic="+Fai.encodeUrl($.toJSON(headPic))+"&mCenter=1";Fai.popupWindow({title:"自定义头像",bannerDisplay:false,frameSrcUrl:c,width:650,height:650,closeFunc:function(d){if(d){newImg=d.newImg;if(d.headPic.thumbId||newImg){headPic=d.headPic;Site.showMemberHeadPic($("#memberHeadPic"),headPic,100);Site.showMemberHeadPic($("#topBarMemberPic"),headPic,30);$(".memberProfileBtn").click()}}}});$(".formDialog .formX_old").removeClass("formX_old").removeClass("formX").addClass("formXSite").css("margin-top","10px");$(".formDialog").addClass("formBox")}})};Site.img_sf=function(d){var A=document.body,B=document.getElementById("img_1"),z=document.getElementById("img_2"),x=document.getElementById("img_3"),m=document.getElementById("imgShadow3"),g=document.getElementById("imgShadow1"),b=document.getElementById("imgShadow4"),c=document.getElementById("imgShadow5"),i=document.getElementById("imgShadow2"),p={};if(d.width>350){d.style.width=350;$(".imgArea").css("width","350px")}else{if(d.height>350){d.style.height=350;$(".imgArea").css("height","350px")}}var e=d.height,s=d.width,j=Math.min(e,s),C=document.getElementById("img_dsf"),r=coverImgHeight=m.style.width==""?j:$(m).width(),a,f=$(".editPicArea");$(".imgArea").css("height",e+"px");coverImgLeft=m.style.width==""?(s-r)/2:m.offsetLeft,coverImgTop=m.style.width==""?(e-coverImgHeight)/2:m.offsetTop;t();$(".imgArea").css({top:(f.height()-e)/2+"px",left:(f.width()-s)/2-10+"px"});var l,w,o,u,k,n,y,v;var q=false;$("body").on("mouseup",function(){q=false});$(".imgArea .coverBox,#layerImg").on({mousedown:function(E){E=E?E:window.event;l=m.offsetTop;w=m.offsetLeft;o=$(m).width();k={x:E.clientX,y:E.clientY};q=true;Site.enablePopupBtn("save",true);var D=E.target.id;if(D=="dragBotCenter"||D=="dragRightCenter"||D=="dragRightBot"){h(1)}else{if(D=="dragLeftCenter"||D=="dragLeftBot"){h(2)}else{if(D=="dragTopCenter"||D=="dragRightTop"){h(3)}else{if(D=="dragLeftTop"){h(4)}else{h(0)}}}}},mouseup:function(){q=false}});function h(D){document.onmousemove=function(E){if(!q){return}E=E?E:window.event;n={x:E.clientX,y:E.clientY};y=n.x-k.x;v=n.y-k.y;switch(D){case 0:r=o;coverImgTop=l+v;coverImgLeft=w+y;break;case 1:r=o+y;coverImgTop=l;coverImgLeft=w;break;case 2:r=o-y;coverImgTop=l;coverImgLeft=w+y;break;case 3:r=o+y;coverImgTop=l-y;coverImgLeft=w;break;case 4:r=o-y;coverImgTop=l+y;coverImgLeft=w+y;break}t()}}function t(){if(r<100){r=100;coverImgHeight=100}else{if(r>Math.min(s,e)){r=Math.min(s,e);coverImgHeight=Math.min(s,e)}}if(coverImgTop<0){coverImgTop=0}else{if(coverImgTop>e-r){coverImgTop=e-r}}if(coverImgLeft<0){coverImgLeft=0}else{if(coverImgLeft>s-r){coverImgLeft=s-r}}if(coverImgTop>=0&&coverImgTop<=e-r&&coverImgLeft>=0&&coverImgLeft<=s-r){$(m).css({width:r,height:r,top:coverImgTop,left:coverImgLeft});$("#coverBox").css({width:r-2,height:r-2,top:coverImgTop,left:coverImgLeft});$(g).css({width:s,height:coverImgTop,top:0,left:0});$(i).css({width:coverImgLeft,height:r,top:coverImgTop,left:0});$(b).css({width:s-r-coverImgLeft,height:r,top:coverImgTop,left:r+coverImgLeft});$(c).css({width:s,height:e-r-coverImgTop,top:r+coverImgTop,left:0});a=[r/100,r/50,r/30];$("#img_1").css({width:s/a[0],height:e/a[0],top:-coverImgTop/a[0],left:-coverImgLeft/a[0]});$("#img_2").css({width:s/a[1],height:e/a[1],top:-coverImgTop/a[1],left:-coverImgLeft/a[1]});$("#img_3").css({width:s/a[2],height:e/a[2],top:-coverImgTop/a[2],left:-coverImgLeft/a[2]})}}};Site.showMemberHeadPic=function(d,a,b){d.attr("src",a.path);var c=a.width/b;d.css({width:a.imgW/c,height:a.imgH/c,top:-a.top/c,left:-a.left/c})};Site.memberImgFileUpload=function(a,c,e){var d=e.split(",");var b={file_post_name:"Filedata",upload_url:"/ajax/memberHeadImgUp_h.jsp",button_placeholder_id:c,file_size_limit:a+"MB",file_queue_limit:1,button_cursor:SWFUpload.CURSOR.HAND,button_width:"80",button_height:"30",requeue_on_error:false,post_params:{ctrl:"Filedata",app:21},file_types:d.join(";"),file_dialog_complete_handler:function(f){this._allSuccess=false;this.startUpload()},file_queue_error_handler:function(g,f,h){switch(f){case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:Fai.ing(LS.siteFormSubmitCheckFileSizeErr,true);break;case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:Site.initPopupBox(LS.mobiFormSubmitFileUploadNotAllow,"alert","");break;case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED:Site.initPopupBox(jm.format(LS.mobiFormSubmitFileUploadOneTimeNum,"1"),"alert","");break;default:Site.initPopupBox(LS.mobiFormSubmitFileUploadReSelect,"alert","");break}},upload_success_handler:function(g,f){var h=jQuery.parseJSON(f);this._allSuccess=h.success;this._sysResult=h.msg;if(h.success){onFileUploadEvent("upload",h)}else{$("#imgShadow3").removeClass("loading");$("#imgShadow3").children().show();Fai.ing("文件"+g.name+","+h.msg)}},upload_error_handler:function(g,f,h){if(f==-280){Fai.ing("文件取消成功",false)}else{if(f==-270){Fai.ing("已经存在名称为"+g.name+"的文件。",true)}else{Fai.ing("服务繁忙,文件"+g.name+"上传失败,请稍候重试。")}}$("#imgShadow3").removeClass("loading");$("#imgShadow3").children().show()},upload_complete_handler:function(f){if(f.filestatus==SWFUpload.FILE_STATUS.COMPLETE&&this._allSuccess){swfObj.startUpload()}else{if(f.filestatus==SWFUpload.FILE_STATUS.ERROR){Fai.ing("服务繁忙,文件"+f.name+"上传失败,请稍候重试。");$("#imgShadow3").removeClass("loading");$("#imgShadow3").children().show()}}},upload_start_handler:function(f){Fai.enablePopupWindowBtn(0,"save",false);Fai.ing("读取文件准备上传",false)},view_progress:function(f,i,h,g){Fai.ing("正在上传"+g+"%",false);$("#imgShadow3").addClass("loading");$("#imgShadow3").children().hide()}};swfObj=SWFUploadCreator.create(b);onFileUploadEvent=function(n,j){if(n=="upload"){var k=j.name,i=j.size,h=j.path,m=j.id,f=j.width,l=j.height;smallPath=j.smallPath;newImg=j;var g=new Image();g.src=smallPath;g.onload=function(){Fai.ing(Fai.format(LS.siteFormSubmitFileUploadSucess,Fai.encodeHtml(k)),true);$("#imgShadow3").removeClass("loading");$("#imgShadow3").children().show();$(".formBodyContent").find(".editPicArea #memberHeadPic").attr("src",smallPath);$(".formBodyContent").find(".viewPicArea img").attr("src",smallPath);$("#imgShadow3").css("width","")};Site.enablePopupBtn("save",true)}}};Site.memberImgFileUploadH5=function(d,e,c,g,j,i,h){var b=c.split(",");var f={siteFree:i,updateUrlViewRes:j,auto:true,fileTypeExts:b.join(";"),multi:false,fileSizeLimit:d*1024*1024,fileSplitSize:20*1024*1024,breakPoints:true,saveInfoLocal:false,showUploadedPercent:false,showUploadedSize:false,removeTimeout:9999999,post_params:{app:21,type:0,fileUploadLimit:d,isSiteForm:true},isBurst:false,isDefinedButton:true,buttonText:h,uploader:"/ajax/memberHeadImgUp_h.jsp?cmd=mobiUpload&_TOKEN="+$("#_TOKEN").attr("value"),onUploadSuccess:function(k,m){var l=jQuery.parseJSON(m);if(l.success){onFileUploadEvent("upload",l);setTimeout(function(){Fai.ing("文件上传成功",true)},2000)}else{$("#imgShadow3").removeClass("loading");$("#imgShadow3").children().show();Fai.ing("文件:"+k.name+","+l.msg)}},onUploadError:function(k,l){$("#progressBody_ "+k.id).remove();$("#progressWrap_"+k.id).remove();$("#imgShadow3").removeClass("loading");$("#imgShadow3").children().show();Fai.ing("网络繁忙,文件:"+k.name+"上传失败,请稍后重试")},onSelect:function(){if(g){Fai.ing("已超过资源库容量限制,请升级网站版本。");return false}else{return true}},onUploadStart:function(k){$("#imgShadow3").addClass("loading");$("#imgShadow3").children().hide();$("#progressBody_ "+k.id).remove();$("#progressWrap_"+k.id).remove()}};var a=$("#"+e).uploadify(f);onFileUploadEvent=function(s,o){if(s=="upload"){var p=o.name,n=o.size,m=o.path,r=o.id,k=o.width,q=o.height;smallPath=o.smallPath;newImg=o;var l=new Image();l.src=smallPath;l.onload=function(){Fai.ing(Fai.format(LS.siteFormSubmitFileUploadSucess,Fai.encodeHtml(p)),true);$("#imgShadow3").removeClass("loading");$("#imgShadow3").children().show();$(".formBodyContent").find(".editPicArea #memberHeadPic").attr("src",smallPath);$(".formBodyContent").find(".viewPicArea img").attr("src",smallPath);$("#imgShadow3").css("width","")};Site.enablePopupBtn("save",true)}}};Site.initPopupBox=function(f,d,e){var b=["<div style='text-align:center;width: 100%;font-size: 12px; color:#636363;position:absolute;top:20px;'>",f,"</div>"];b.push("<div class='memberHeadEdit'>");if(d=="confirm"){b.push("<div style='display: inline-block;width: 100%; text-align:center;position:absolute;top:50px;'>");b.push(" <div class='confirmBtn' style='display: inline-block;zoom: 1;*display: inline; padding: 0 10px !important;height: 25px; text-align: center;margin: 10px 10px 10px auto;line-height:25px; border: 1px solid #0064B5;background:#49A3FF;color: #FFFFFF;font-size: 12px; border-radius: 2px;'>确 定</div>");b.push(" <div class='cancelBtn' style='display: inline-block;zoom: 1;*display: inline;height: 25px;padding: 0 10px !important;text-align: center;margin: 10px auto 10px 10px;height: 25px;line-height: 25px; border: 1px solid #8F8F8F;background: #F5F5F5;color: #666666;font-size: 12px; border-radius: 2px;' >取 消</div>");b.push("</div>")}else{b.push(" <div class='confirmBtn' style='position:absolute;top:60px;zoom: 1;height: 25px; text-align: center;line-height:25px; border: 1px solid #0064B5;background:#49A3FF;color: #FFFFFF;font-size: 12px;left:100px;padding: 0 10px !important;border-radius: 2px;'>确 定</div>")}b.push("</div>");var a={};a.htmlContent=b.join("");a.width=255;a.height=122;var c=Site.popupBox(a);c.find(".popupBClose").css("margin","10px 0px auto auto");c.on("click",".confirmBtn",function(){c.find(".popupBClose").click();e()});c.on("click",".cancelBtn",function(){c.find(".popupBClose").click()})};Site.enablePopupBtn=function(c,a){var b=$("#"+c);if(a){b.removeAttr("disabled");b.removeClass("saveButton-disabled");b.faiButton("enable")}else{b.attr("disabled",true);b.faiButton("disable")}};Site.memberAddrMsgOpera=function(b,a,c,n,q,f,h,A,r,m,B,z,t){var p="-----------",x=[],j,C,l,v,E,k,w;var e=-1;var D={};$.each(m,function(F,G){if(G.parentId==null||G.parentId==""||G.parentId===0){D[G.id]=G}});site_cityUtil.initProvinces(q);if(Site.addrInfoListGlobal!=null&&Site.addrInfoListGlobal!=[]){c=Site.addrInfoListGlobal}var y={};y.addrInfoList=c;$(".addAddrMsgPanel, .edit").click(function(){var Z="",ac=0,J={},ad="",ae="";e=$(this).parents(".addrMsg_default").length==0?$(this).parents(".addrMsg").attr("_item"):$(this).parents(".addrMsg_default").attr("_item");if($(this).hasClass("edit")){ae=$(this).parent().parent().attr("_item");Z="ajax/memberAdm_h.jsp?cmd=set&opera=editAddr&editItem="+ae+"&id="+b;J=c[ae];ac=J.isDefault;ad="edit"}else{Z="ajax/memberAdm_h.jsp?cmd=set&opera=addAddr&id="+b;if(c.length==0){ac=1}else{ac=0}ad="add"}if(h){var W="<div style='width:942px; height:1px; font-size:0; background-color:#eeeeee; margin-top:15px;' />";W+="<div class='editAddrInfo editAddrNewInfo'>";for(var ab=0;ab<a.length;ab++){var H=a[ab].fieldKey;var ah=a[ab].name;var U=a[ab].required;W+="<div class='addrInfoItem'>";if(H!="addr"){W+="<div class='propItemName'>"+ah+"</div>";if(U){W+="<div class='g_stress'>*</div>"}else{W+="<div class='g_stress' style='visibility: hidden;'>*</div>"}}if(H=="addr"){var G=(q==2052||q==1028)?"中国":"China";var Y=(q==2052||q==1028)?"海外":"Oversea";W+="<div class='propItemName'>"+LS.Region+"</div>";if(U){W+="<div class='g_stress'>*</div>"}else{W+="<div class='g_stress' style='visibility: hidden;'>*</div>"}W+="<div class='propItemValue'><select id='allArea' class='allArea'>";W+="<option value=''>------</option>";if(!B){W+="<option value='cn'>"+G+"</option>"}if(!z){W+="<option value='os'>"+Y+"</option>"}$.each(D,function(ai,aj){W+="<option value='"+D[ai].id+"'>"+Fai.encodeHtml(D[ai].name)+"</option>"});W+="</select></div>";W+="<div class='propItemValue' style='display:none;'>";W+="<input type='text' id='areaBoxInput' class='areaBoxInput' style='width: 295px;' placeholder='------' readOnly='true' isCn isOs isCus area1 area2 area3/>";W+="<div id='areaBox1' class='areaBox1 areaBox1New' style='display:none;'>";W+="<div id='province_box' class='province_box'>";W+="<div class='pv_head J_areaHead'>";W+="<div class='pv_pv pv'>"+LS.province+"</div>";W+="<div class='pv_city city'>"+LS.city+"</div>";W+="<div class='pv_county county'>"+LS.county+"</div>";W+="<div class='pv_street street'>"+LS.street+"</div>";W+="</div>";W+="<div class='pv_content'>";W+="<div class='spaceLine'></div>";$.each(site_cityUtil.getAreaGroupsPinYin(),function(ai,aj){W+="<div class='pv_group' style='"+(aj[0]=="OS"?"display:none;":"")+"'>";W+="<div class='group_head'>"+aj[0]+"</div>";W+="<div class='group_content'>";$.each(aj[1],function(al,ak){if(q==2052||q==1028){W+="<div class='group_item' pid='"+ak+"' pname='"+site_cityUtil.getInfo(ak).name+"'>"+site_cityUtil.simpleProvinceNameStr(site_cityUtil.getInfo(ak).name)+"</div>"}else{W+="<div class='group_item' pid='"+ak+"' pname='"+site_cityUtil.getInfoEn(ak).name+"'>"+site_cityUtil.simpleProvinceNameStrEn(site_cityUtil.getInfoEn(ak).name)+"</div>"}});W+="</div>";W+="</div>";W+="<div class='spaceLine'></div>"});W+="</div>";W+="</div>";W+="<div id='city_box' class='city_box' style='display:none;'>";W+="<div class='city_head J_areaHead'>";W+="<div class='city_pv pv'>"+LS.province+"</div>";W+="<div class='city_city city'>"+LS.city+"</div>";W+="<div class='city_county county'>"+LS.county+"</div>";W+="<div class='city_street street'>"+LS.street+"</div>";W+="</div>";W+="</div>";W+="<div id='county_box' class='county_box' style='display:none;'>";W+="<div class='county_head J_areaHead'>";W+="<div class='county_pv pv'>"+LS.province+"</div>";W+="<div class='county_city city'>"+LS.city+"</div>";W+="<div class='county_county county'>"+LS.county+"</div>";W+="<div class='county_street street'>"+LS.street+"</div>";W+="</div>";W+="</div>";W+="<div id='street_box' class='street_box' style='display:none;'>";W+="<div class='street_head J_areaHead'>";W+="<div class='street_pv pv'>"+LS.province+"</div>";W+="<div class='street_city city'>"+LS.city+"</div>";W+="<div class='street_county county'>"+LS.county+"</div>";W+="<div class='street_street street'>"+LS.street+"</div>";W+="</div>";W+="</div>";W+="</div>";W+="<div id='areaBox2' class='areaBox2 areaBox2New' style='display:none;'>";W+="<div id='sec_box' class='sec_box'>";W+="<div class='sec_head J_areaHead2'>";W+="<div class='sec_sec sec'>"+LS.firstRegion+"</div>";W+="<div class='sec_thd thd'>"+LS.secRegion+"</div>";W+="</div>";W+="<div class='sec_content'></div>";W+="</div>";W+="<div id='thd_box' class='thd_box' style='display:none;'>";W+="<div class='thd_head J_areaHead2'>";W+="<div class='thd_sec sec'>"+LS.firstRegion+"</div>";W+="<div class='thd_thd thd'>"+LS.secRegion+"</div>";W+="</div>";W+="<div class='thd_content'></div>";W+="</div>";W+="</div>";W+="</div>";W+="</div>";W+="<div class='addrInfoItem'>";W+="<div id='addrInfoStreet'>";W+="<div class='propItemName'>"+LS.addrDetail+"</div><div class='g_stress' "+(!U?"style='visibility: hidden;'":"")+" >*</div>";W+="<div class='propItemValue'><input class='addrInfo_street' placeholder='"+LS.streetAddress+"' id='addrInfo_street' ></input></div>";W+="</div>"}else{var N="";if(H=="mobile"||H=="phone"){W+="<div class='propItemValue'><input id='"+H+"' class='propItemEdit' style='border:1px solid #e7e7e7; text-indent:6px; "+N+"' maxlength='11' onkeypress='javascript:return Fai.isNumberKey(event)' oninput='value=value.replace(/[^0-9]/g,\"\");if(value.length>11)value=value.slice(0,11);'></input></div>"}else{W+="<div class='propItemValue'><input id='"+H+"' class='propItemEdit' style='border:1px solid #e7e7e7; text-indent:6px; "+N+"' maxlength='50'></input></div>"}}W+="</div>"}W+="</div>";W+="<div class='saveOrCancel saveOrCancelNew'>";W+="<div class='save save"+(h&&(A>0)?r:"")+"' style='width:108px; height:35px;'>"+LS.confirm+"</div>";W+="<div class='cancel popupBClose' style='width:108px; height:33px;'>"+LS.cancel+"</div>";W+="</div>";var I=parseInt(Math.random()*10000);var K={boxId:I,title:t,htmlContent:W,width:942,boxName:"addrInfo"}}else{var W="<div style='width:130px; height:1px; font-size:0; background-color:#44a5ff; margin-left:26px; float:left;' />";W+="<div style='width:234px; height:1px; font-size:0; background-color:#dadada; margin-left:146px;' />";W+="<div class='editAddrInfo'>";for(var ab=0;ab<a.length;ab++){var H=a[ab].fieldKey;var ah=a[ab].name;var U=a[ab].required;W+="<div class='addrInfoItem'>";if(H!="addr"){W+="<div class='propItemName'>"+ah+" :</div>"}if(H=="addr"){var G=(q==2052||q==1028)?"中国":"China";var Y=(q==2052||q==1028)?"海外":"Oversea";W+="<div class='propItemName'>"+LS.Region+" :</div>";W+="<div class='propItemValue'><select id='allArea' class='allArea' style='width: 170px;'>";W+="<option value=''>------</option>";if(!B){W+="<option value='cn'>"+G+"</option>"}if(!z){W+="<option value='os'>"+Y+"</option>"}$.each(D,function(ai,aj){W+="<option value='"+D[ai].id+"'>"+Fai.encodeHtml(D[ai].name)+"</option>"});W+="</select></div>";if(U){W+="<div class='g_stress'>*</div>"}W+="<div class='propItemName J-ssq'><span id='ssq'>"+LS.ssq+" :</span><span id='administrativeRegion'>"+LS.administrativeRegion+" :</span></div>";W+="<div class='propItemValue J-ssq'><input type='text' id='areaBoxInput' class='propItemEdit' style='border: 1px solid #e7e7e7;text-indent: 6px;-webkit-border-radius: 0;' placeholder='------' readOnly='true' isCn isOs isCus area1 area2 area3/></div>";W+="<div id='areaBox1' class='areaBox1' style='display:none;'>";W+="<div id='province_box' class='province_box'>";W+="<div class='pv_head J_areaHead'>";W+="<div class='pv_pv pv'>"+LS.province+"</div>";W+="<div class='pv_city city'>"+LS.city+"</div>";W+="<div class='pv_county county'>"+LS.county+"</div>";W+="<div class='pv_street street'>"+LS.street+"</div>";W+="</div>";W+="<div class='pv_content'>";W+="<div class='spaceLine'></div>";$.each(site_cityUtil.getAreaGroupsPinYin(),function(ai,aj){W+="<div class='pv_group' style='"+(aj[0]=="OS"?"display:none;":"")+"'>";W+="<div class='group_head'>"+aj[0]+"</div>";W+="<div class='group_content'>";$.each(aj[1],function(al,ak){if(q==2052||q==1028){W+="<div class='group_item' pid='"+ak+"' pname='"+site_cityUtil.getInfo(ak).name+"'>"+site_cityUtil.simpleProvinceNameStr(site_cityUtil.getInfo(ak).name)+"</div>"}else{W+="<div class='group_item' pid='"+ak+"' pname='"+site_cityUtil.getInfoEn(ak).name+"'>"+site_cityUtil.simpleProvinceNameStrEn(site_cityUtil.getInfoEn(ak).name)+"</div>"}});W+="</div>";W+="</div>";W+="<div class='spaceLine'></div>"});W+="</div>";W+="</div>";W+="<div id='city_box' class='city_box' style='display:none;'>";W+="<div class='city_head J_areaHead'>";W+="<div class='city_pv pv'>"+LS.province+"</div>";W+="<div class='city_city city'>"+LS.city+"</div>";W+="<div class='city_county county'>"+LS.county+"</div>";W+="<div class='city_street street'>"+LS.street+"</div>";W+="</div>";W+="</div>";W+="<div id='county_box' class='county_box' style='display:none;'>";W+="<div class='county_head J_areaHead'>";W+="<div class='county_pv pv'>"+LS.province+"</div>";W+="<div class='county_city city'>"+LS.city+"</div>";W+="<div class='county_county county'>"+LS.county+"</div>";W+="<div class='county_street street'>"+LS.street+"</div>";W+="</div>";W+="</div>";W+="<div id='street_box' class='street_box' style='display:none;'>";W+="<div class='street_head J_areaHead'>";W+="<div class='street_pv pv'>"+LS.province+"</div>";W+="<div class='street_city city'>"+LS.city+"</div>";W+="<div class='street_county county'>"+LS.county+"</div>";W+="<div class='street_street street'>"+LS.street+"</div>";W+="</div>";W+="</div>";W+="</div>";W+="<div id='areaBox2' class='areaBox2' style='display:none;'>";W+="<div id='sec_box' class='sec_box'>";W+="<div class='sec_head J_areaHead2'>";W+="<div class='sec_sec sec'>"+LS.firstRegion+"</div>";W+="<div class='sec_thd thd'>"+LS.secRegion+"</div>";W+="</div>";W+="<div class='sec_content'></div>";W+="</div>";W+="<div id='thd_box' class='thd_box' style='display:none;'>";W+="<div class='thd_head J_areaHead2'>";W+="<div class='thd_sec sec'>"+LS.firstRegion+"</div>";W+="<div class='thd_thd thd'>"+LS.secRegion+"</div>";W+="</div>";W+="<div class='thd_content'></div>";W+="</div>";W+="</div>";if(U){W+="<div class='g_stress J-ssq'>*</div>"}W+="<div id='addrInfoStreet'>";W+="<div class='propItemName'>"+LS.streetAddress+" :</div>";W+="<div class='propItemValue'><textarea id='addrInfo_street' style='height:80px;'></textarea></div>";if(U){W+="<div class='g_stress'>*</div>"}W+="</div>"}else{var N="";if(H=="mobile"||H=="phone"){W+="<div class='propItemValue'><input id='"+H+"' class='propItemEdit' style='-webkit-border-radius:0;-moz-border-radius:0; border:1px solid #e7e7e7; text-indent:6px; "+N+"' maxlength=11 onkeypress='javascript:return Fai.isNumberKey(event)' oninput='value=value.replace(/[^0-9]/g,\"\");if(value.length>11)value=value.slice(0,11);'></input></div>"}else{W+="<div class='propItemValue'><input id='"+H+"' class='propItemEdit' style='-webkit-border-radius:0;-moz-border-radius:0; border:1px solid #e7e7e7; text-indent:6px; "+N+"' maxlength=50></input></div>"}if(U){W+="<div class='g_stress'>*</div>"}}W+="</div>"}W+="</div>";W+="<div class='saveOrCancel'>";W+="<div class='cancel popupBClose' style='width:76px; height:35px;'>"+LS.cancel+"</div>";W+="<div class='save' style='width:86px; height:35px;'>"+LS.confirm+"</div>";W+="</div>";var I=parseInt(Math.random()*10000);var K={boxId:I,title:t,htmlContent:W,width:410,boxName:"addrInfo"}}var V=Site.popupBox(K);if(Fai.isIE6()||Fai.isIE7()){$(".editAddrInfo").find(".addrInfoItem").attr("style","width:100%;");$(".editAddrInfo").find(".addrInfoItem").find("#addrInfoStreet").attr("style","width:100%;")}var F=($(".J-ssq").length>0);if(F){if($("#areaBoxInput").length>0){$("#areaBox1,#areaBox2").css("left",$("#areaBoxInput").position().left);$("#areaBox1,#areaBox2").css("top",$("#areaBoxInput").position().top+$("#areaBoxInput").height())}$(".J-ssq").hide()}$(document).unbind("click.forAreaBox").bind("click.forAreaBox",function(){$("#areaBox1").hide();$("#areaBox2").hide()});$("#areaBox1,#areaBox2").unbind("click.forAreaBox").bind("click.forAreaBox",function(ai){T(ai)});function T(ai){if(ai.stopPropagation){ai.stopPropagation()}else{ai.cancelBubble=true}}$("#allArea").change(function(){if($("#allArea").val()==null||$("#allArea").val()==""||$("#allArea").val()=="os"){if(F){$(".J-ssq").hide()}else{$("#areaBoxInput").parent(".propItemValue").hide()}}else{if(F){$(".J-ssq").show()}else{$("#areaBoxInput").parent(".propItemValue").show()}}$("#areaBox1").hide();$("#areaBox2").hide();if($("#allArea").val()==null||$("#allArea").val()==""){return}$("#areaBoxInput").attr("isCn",0);$("#areaBoxInput").attr("isCus",0);$("#areaBoxInput").attr("isOs",0);$("#areaBoxInput").attr("area1","");$("#areaBoxInput").attr("area2","");$("#areaBoxInput").attr("area3","");$("#areaBoxInput").attr("area4","");if($("#allArea").val()=="cn"){$("#areaBoxInput").attr("isCn",1);$("#areaBox1 .pv").click();$("#areaBox1 .city_content").remove();$("#areaBox1 .county_content").remove();$("#areaBox1 .street_content").remove();$("#areaBox1").show()}else{if($("#allArea").val()=="os"){$("#areaBoxInput").attr("isOs",1);$("#areaBoxInput").attr("area1",990000);$("#areaBoxInput").attr("area2",990100)}else{$("#areaBoxInput").attr("isCus",1);$("#areaBoxInput").attr("area1",$("#allArea").val());$("#areaBox2 .sec_content").html("");$("#areaBox2 .thd_content").html("");$("#areaBox2").show()}}$("#areaBoxInput").val("");if($("#allArea").val()=="cn"||$("#allArea").val()=="os"){$("#areaBoxInput").show();$("#ssq").show();$("#administrativeRegion").hide()}else{var ai=d($("#allArea").val());$("#sec_box .sec_content").append(ai);$("#areaBoxInput").val($("#areaBoxInput").val()+$("#allArea option[value='"+$("#allArea").val()+"']").text());$("#ssq").hide();$("#administrativeRegion").show();if(ai===null||ai===undefined||ai===""){$("#areaBox2").hide();$(".J-ssq").hide();if(!F){$("#areaBoxInput").hide()}}}});$("#areaBoxInput").unbind("click").bind("click",function(ai){if($("#allArea").val()=="cn"){$("#areaBox1").toggle();$("#areaBox2").hide();$("#province_box").show();$("#city_box").hide();$("#county_box").hide();$("#street_box").hide()}else{if($("#allArea").val()==null||$("#allArea").val()=="os"){}else{$("#areaBox2").toggle();$("#areaBox1").hide();$("#sec_box").show();$("#thd_box").hide()}}T(ai)});$(".J_areaHead .pv").click(function(){$("#province_box").show();$("#city_box").hide();$("#county_box").hide();$("#street_box").hide()});$(".J_areaHead .city").click(function(){$("#province_box").hide();$("#city_box").show();$("#county_box").hide();$("#street_box").hide()});$(".J_areaHead .county").click(function(){$("#province_box").hide();$("#city_box").hide();$("#street_box").hide();$("#county_box").show()});$(".J_areaHead .street").click(function(){$("#province_box").hide();$("#city_box").hide();$("#street_box").show();$("#county_box").hide()});$(".J_areaHead2 .sec").click(function(){$("#sec_box").show();$("#thd_box").hide()});$(".J_areaHead2 .thd").click(function(){$("#sec_box").hide();$("#thd_box").show()});$("#province_box .group_item").bind("click",function(){$("#areaBox1 .city_content").remove();$("#areaBox1 .county_content").remove();$("#areaBox1 .street_content").remove();var ai=$(this).attr("pname");var aj=$(this).attr("pid");$(".J_areaHead .city").click();$("#areaBoxInput").val("");$("#areaBoxInput").val($("#areaBoxInput").val()+ai);$("#areaBoxInput").removeAttr("lastArea");$("#areaBoxInput").removeAttr("lastAreaType");$("#areaBoxInput").attr("area1",aj);$("#areaBoxInput").attr("area2","");$("#areaBoxInput").attr("area3","");var ak="";if(q==2052||q==1028){ak=o(site_cityUtil.getCities(aj))}else{ak=o(site_cityUtil.getCitiesEn(aj))}$("#city_box").append(ak)});$("#city_box").delegate(".group_item","click",function(){$("#areaBox1 .county_content").remove();$("#areaBox1 .street_content").remove();var ai=$(this).attr("cname");var ak=$(this).attr("cid");$(".J_areaHead .county").click();var an=$("#areaBoxInput").attr("lastArea");var aj=$("#areaBoxInput").attr("lastAreaType");if(aj!=null&&aj!=""){$("#areaBoxInput").val($("#areaBoxInput").val().substring(0,$("#areaBoxInput").val().indexOf("-")))}$("#areaBoxInput").val($("#areaBoxInput").val()+"-"+ai);$("#areaBoxInput").attr("lastArea","-"+ai);$("#areaBoxInput").attr("lastAreaType","city");$("#areaBoxInput").attr("area2",ak);$("#areaBoxInput").attr("area3","");var am="";if(q==2052||q==1028){am=i(site_cityUtil.getCounty(ak))}else{am=i(site_cityUtil.getCountyEn(ak))}var al=$(am).html();if(al===null||al===undefined||al===""){$("#areaBox1").hide()}$("#county_box").append(am)});$("#county_box").delegate(".group_item","click",function(){$("#areaBox1 .street_content").remove();var aj=$(this).attr("cname");var al=$(this).attr("cid");$(".J_areaHead .street").click();var an=$("#areaBoxInput").attr("lastArea");var ak=$("#areaBoxInput").attr("lastAreaType");if(ak!=null&&(ak=="street"||ak=="county")){$("#areaBoxInput").val($("#areaBoxInput").val().substring(0,$("#areaBoxInput").val().indexOf("-",$("#areaBoxInput").val().indexOf("-")+1)))}$("#areaBoxInput").val($("#areaBoxInput").val()+"-"+aj);$("#areaBoxInput").attr("lastArea","-"+aj);$("#areaBoxInput").attr("lastAreaType","county");$("#areaBoxInput").attr("area3",al);$("#areaBoxInput").attr("area4","");var ai="";if(q==2052||q==1028){ai=s(site_cityUtil.getStreet(al))}else{ai=s(site_cityUtil.getStreetEn(al))}var am=$(ai).html();if(am===null||am===undefined||am===""){$("#areaBox1").hide()}$("#street_box").append(ai)});$("#street_box").delegate(".group_item","click",function(){var ai=$(this).attr("cname");var ak=$(this).attr("cid");var al=$("#areaBoxInput").attr("lastArea");var aj=$("#areaBoxInput").attr("lastAreaType");if(aj!=null&&aj=="street"){$("#areaBoxInput").val($("#areaBoxInput").val().replace(al,""))}$("#areaBoxInput").val($("#areaBoxInput").val()+"-"+ai);$("#areaBoxInput").attr("lastArea","-"+ai);$("#areaBoxInput").attr("lastAreaType","street");$("#areaBoxInput").attr("area4",ak);$("#areaBox1").hide()});$("#sec_box").delegate(".group_item","click",function(){$("#areaBox2 .thd_content").html("");var ai=$(this).attr("cname");var ak=$(this).attr("cid");$(".J_areaHead2 .thd").click();var am=$("#areaBoxInput").attr("lastArea");var aj=$("#areaBoxInput").attr("lastAreaType");if(aj!=null&&aj!=""&&$("#areaBoxInput").val().indexOf("-")!=-1){$("#areaBoxInput").val($("#areaBoxInput").val().substring(0,$("#areaBoxInput").val().indexOf("-")))}$("#areaBoxInput").val($("#areaBoxInput").val()+"-"+ai);$("#areaBoxInput").attr("lastArea","-"+ai);$("#areaBoxInput").attr("lastAreaType","sec");$("#areaBoxInput").attr("area2",ak);$("#areaBoxInput").attr("area3","");var al=d(ak);if(al===null||al===undefined||al===""){$("#areaBox2").hide()}$("#thd_box .thd_content").append(al)});$("#thd_box").delegate(".group_item","click",function(){var ai=$(this).attr("cname");var ak=$(this).attr("cid");var al=$("#areaBoxInput").attr("lastArea");var aj=$("#areaBoxInput").attr("lastAreaType");if(aj!=null&&aj=="thd"){$("#areaBoxInput").val($("#areaBoxInput").val().replace(al,""))}$("#areaBoxInput").val($("#areaBoxInput").val()+"-"+ai);$("#areaBoxInput").attr("lastArea","-"+ai);$("#areaBoxInput").attr("lastAreaType","thd");$("#areaBoxInput").attr("area3",ak);$("#areaBox2").hide()});if($(this).hasClass("edit")){for(var ab=0;ab<a.length;ab++){var H=a[ab].fieldKey;var ag=J[H];if(H=="addr"){var X=J.addr_info;if(X!=null){var Q=X.isCus;if(!Q){var P="";var M="";var L="";var S="";if(q==2052||q==1028){P=site_cityUtil.getInfo(X.countyCode).name;M=site_cityUtil.getInfo(X.cityCode).name;L=site_cityUtil.getInfo(X.provinceCode).name;S=site_cityUtil.getInfo(X.streetCode).name}else{P=site_cityUtil.getInfoEn(X.countyCode).name;M=site_cityUtil.getInfoEn(X.cityCode).name;L=site_cityUtil.getInfoEn(X.provinceCode).name;S=site_cityUtil.getInfoEn(X.streetCode).name}if(X.provinceCode==990000){$("#areaBoxInput").attr("isOs",1);$("#allArea").val("os");$("#allArea").change()}else{$("#areaBoxInput").attr("isCn",1);$("#allArea").val("cn");$("#allArea").change()}$("#areaBoxInput").attr("area1",X.provinceCode);$("#areaBoxInput").attr("area2",X.cityCode);$("#areaBoxInput").attr("area3",X.countyCode);$("#areaBoxInput").attr("area4",X.streetCode);$("#addrInfo_street").val(X.streetAddr);setTimeout(function(){$("#areaBox1 .group_item[pid='"+X.provinceCode+"']").click();setTimeout(function(){$("#areaBox1 .group_item[cid='"+X.cityCode+"']").click();setTimeout(function(){$("#areaBox1 .group_item[cid='"+X.countyCode+"']").click();setTimeout(function(){$("#areaBox1 .group_item[cid='"+X.streetCode+"']").click()},0)},0)},0)},0)}else{var af=g(X.countyCode);var aa=g(X.cityCode);var O=g(X.provinceCode);$("#allArea").val(X.provinceCode);$("#allArea").change();$("#areaBoxInput").attr("lastArea","-"+af);$("#areaBoxInput").attr("lastAreaType","thd");$("#areaBoxInput").val(O+"-"+aa+"-"+af);$("#areaBoxInput").attr("isCus",1);$("#areaBoxInput").attr("area1",X.provinceCode);$("#areaBoxInput").attr("area2",X.cityCode);$("#areaBoxInput").attr("area3",X.countyCode);$("#addrInfo_street").val(X.streetAddr)}}else{$("#addrInfo_street").val(J.addr)}}else{if(H=="mobile"){$("#mobileCt").val(J.mobileCt)}}if(ag==null){ag=""}$(".propItemValue").find("#"+H).val(ag)}}var R={};V.find(".saveOrCancel .save").on("click",function(){for(var ao=0;ao<a.length;ao++){var at=a[ao].fieldKey;var ai=a[ao].name;var aq=a[ao].required;if(at=="addr"){var ar=$("#allArea").val();if(ar==null||ar==""){Fai.ing(LS.selectArea);return}else{if(ar=="os"){R.provinceCode=990000;R.cityCode=990100;R.streetAddr=$("#addrInfo_street").val();R.isCus=false;J.addr_info=R;J.addr=$("div[pid='990000']:eq(0)").text()+R.streetAddr;if(aq&&$("#addrInfo_street").val()==""){Fai.ing(LS.editStreetAddr,1);return}continue}else{if(ar!="cn"){R.isCus=true}else{R.isCus=false}}}var am=$("#areaBoxInput").attr("area4");var al=$("#areaBoxInput").attr("area3");var ap=$("#areaBoxInput").attr("area2");var an=$("#areaBoxInput").attr("area1");var au=$("#addrInfo_street");if(aq&&(an==null||an=="")){Fai.ing(LS.mallStlSubmitAddrErr,1);return}if(aq&&(ap==null||ap=="")&&!R.isCus){Fai.ing(LS.mallStlSubmitAddrErr,1);return}if(aq&&au.val()==""){Fai.ing(LS.editStreetAddr,1);return}R.provinceCode=an;R.cityCode=ap;R.countyCode=al;R.streetCode=am;R.streetAddr=au.val();J.addr_info=R;J.addr=$("#areaBoxInput").val().replace(/-/g,"")+au.val()}else{var aj=$(".editAddrInfo").find("#"+at);if(aj.length==0){continue}var ak=aj.val();if(aq&&ak.length==0){Fai.ing(LS.addrInfoInputError+ai,1);return}if((at=="email"&&!Fai.isEmail(ak)&&aq)||(at=="phone"&&!Fai.isPhone(ak)&&aq)){Fai.ing(LS.addrInfoInputError+ai,1);return}if(at=="mobile"){ak=$.trim(ak);if(ak.length>0){if(!Fai.isNationMobile(ak)){Fai.ing(LS.mobileNumRegular,1);return}J.mobileCt=$(".editAddrInfo").find("#mobileCt").val()}else{J.mobileCt=""}}J[at]=ak}}J.isDefault=ac;if(ad=="add"){c.push(J)}$.ajax({type:"post",url:Z,data:"info="+Fai.encodeUrl($.toJSON(y)),success:function(av){if(n==1){var ay=document.location.search.search(/imme/)>-1?"?imme&":"?";if(ad=="add"){document.location.href="mstl.jsp"+ay+"opera=add"}else{if(ad=="edit"){var ax=y.addrInfoList[e];var aw=$(".addrMsg_default[_item='"+e+"']").add(".addrMsg[_item='"+e+"']");aw.find(".name").text(ax.name);aw.find(".phone").text(ax.phone);aw.find(".zip").text(ax.zip);aw.find(".address").text(ax.addr);if(ax.phone==null||ax.phone==""){aw.find(".phone").text(ax.mobile)}if(ax.addr_info!=null||ax.addr_info!=""){if(!ax.addr_info.isCus){if(ax.addr_info.provinceCode==990000){$("#mallShipTemplate_allArea").val("os")}else{$("#mallShipTemplate_allArea").val("cn")}$("#mallShipTemplate_allArea").change();$("#mallShipTemplate_areaBox1 .group_item[pid='"+ax.addr_info.provinceCode+"']").click();$("#mallShipTemplate_areaBox1 .group_item[cid='"+ax.addr_info.cityCode+"']").click();$("#mallShipTemplate_areaBox1 .group_item[cid='"+ax.addr_info.countyCode+"']").click();$("#mallShipTemplate_areaBox1 .group_item[cid='"+ax.addr_info.streetCode+"']").click()}else{$("#mallShipTemplate_allArea").val(ax.addr_info.provinceCode);$("#mallShipTemplate_allArea").change();$("#mallShipTemplate_areaBox2 .group_item[cid='"+ap+"']").click();$("#mallShipTemplate_areaBox2 .group_item[cid='"+al+"']").click()}$("#streetAddress").val(ax.addr_info.streetAddr)}$(".propList .propItemValue").each(function(az,aB){var aA=$(this).attr("_field");$(this).find("input").val(ax[aA])});$(".saveOrCancel .popupBClose").click()}else{document.location.href="mstl.jsp"+ay}}}else{document.location.href="mCenter.jsp?item=memberInfo"}},error:function(){Fai.ing(LS.systemError)}})})});$(".delete").click(function(){var F=$(this).parent().parent().attr("_item");var H=["<div class='fk-cancelOrder'>","<div style='padding:10px;'>",LS.conCancelAddrInfo,"</div>","<div style='padding:10px 0 18px 0;'>","<span class='J-rpt-cancel popupBClose' style='margin-right:20px;'>",LS.cancel,"</span>","<span class='J-rpt-save con-hover'>"+LS.confirm+"</span>","</div>","</div>"];var K=parseInt(Math.random()*10000);var G={boxId:K,title:"",htmlContent:H.join(""),width:300};var I=Site.popupBox(G);var J="ajax/memberAdm_h.jsp?cmd=set&id="+b;I.find(".J-rpt-save").on("click",function(){c.splice(F,1);$.ajax({type:"post",url:J,data:"info="+Fai.encodeUrl($.toJSON(y)),error:function(){Fai.ing(LS.systemError,false)},success:function(L){var M=$.parseJSON(L);if(M.success){if(n==1){var N=document.location.search.search(/imme/)>-1?"?imme":"";document.location.href="mstl.jsp"+N}else{document.location.href="mCenter.jsp?item=memberInfo"}}else{Fai.ing(M.msg,true)}}})})});$(".makeDefault").click(function(){var G=$(this).parent().parent().attr("_item");var F="ajax/memberAdm_h.jsp?cmd=set&id="+b;for(e in c){c[e].isDefault=0}c[G].isDefault=1;$.ajax({type:"post",url:F,data:"info="+Fai.encodeUrl($.toJSON(y)),error:function(){Fai.ing(LS.systemError,false)},success:function(H){var I=$.parseJSON(H);if(I.success){if(n==1){var J=document.location.search.search(/imme/)>-1?"?imme":"";document.location.href="mstl.jsp"+J}else{document.location.href="mCenter.jsp?item=memberInfo"}}else{Fai.ing(I.msg,true)}}})});if(Fai.isIE6()){$(".addrMsg , .addrMsg_default").hover(function(){if($(this).hasClass("isDefault")){$(this).find(".edit").attr("style","margin-left:85px;")}else{$(this).find(".edit").attr("style","margin-left:70px;")}if(h){$(this).find(".other").attr("style","top:20px;")}else{$(this).find(".other").attr("style","top:90px;")}},function(){if(h){$(this).find(".other").attr("style","top:-65px;")}else{$(this).find(".other").attr("style","top:150px;")}})}function o(G){var F="";F+="<div class='city_content'>";$.each(G,function(H,I){if(q==2052||q==1028){F+="<div class='group_item' cid='"+I.id+"' cname='"+site_cityUtil.getInfo(I.id).name+"'>"+site_cityUtil.simpleCityNameStr(site_cityUtil.getInfo(I.id).name)+"</div>"}else{F+="<div class='group_item' cid='"+I.id+"' cname='"+site_cityUtil.getInfoEn(I.id).name+"'>"+site_cityUtil.simpleCityNameStrEn(site_cityUtil.getInfoEn(I.id).name)+"</div>"}});F+="</div>";return F}function i(G){var F="";F+="<div class='county_content'>";$.each(G,function(H,I){if(q==2052||q==1028){F+="<div class='group_item' cid='"+I.id+"' cname='"+site_cityUtil.getInfo(I.id).name+"'>"+site_cityUtil.getInfo(I.id).name+"</div>"}else{F+="<div class='group_item' cid='"+I.id+"' cname='"+site_cityUtil.getInfoEn(I.id).name+"'>"+site_cityUtil.getInfoEn(I.id).name+"</div>"}});F+="</div>";return F}function s(G){var F="";F+="<div class='street_content'>";$.each(G,function(H,I){if(q==2052||q==1028){F+="<div class='group_item' cid='"+I.id+"' cname='"+site_cityUtil.getInfo(I.id).name+"'>"+site_cityUtil.getInfo(I.id).name+"</div>"}else{F+="<div class='group_item' cid='"+I.id+"' cname='"+site_cityUtil.getInfoEn(I.id).name+"'>"+site_cityUtil.getInfoEn(I.id).name+"</div>"}});F+="</div>";return F}function g(G){var F="";var H=false;$.each(m,function(I,J){if(H){return}if(J.id==G){F=J.name;H=true}});return F}function u(G){var F=[];$.each(m,function(H,I){if(I.parentId==G){F.push(I)}});return F}function d(F){if(isNaN(F)){return""}var H=parseInt(F);var G="";$.each(u(H),function(I,J){G+="<div class='group_item' cid='"+J.id+"' cname='"+J.name+"'>"+J.name+"</div>"});return G}};Site.submitInfoWhileNoAddrMsg=function(a,l){var f={};var h=l.addrInfoList||[];var d={};var o=0;var n=false;if(h.length>0){$.each(h,function(p,q){if(q.isDefault==1){d=q;return false}o++})}var g="ajax/memberAdm_h.jsp?cmd=set&opera=editAddr&editItem="+o+"&id="+l.id;if(h.length==0){n=true;g="ajax/memberAdm_h.jsp?cmd=set&opera=addAddr&id="+l.id}for(var j=0;j<a.length;j++){var m=a[j].fieldKey;var b=a[j].name;var k=a[j].required;var c=$(".J_noAddrMsgContent").find("#"+m);if(c.length==0){continue}var e=c.val()||"";if(k&&e.length==0){Fai.ing(LS.addrInfoInputError+b,1);return}if((m=="email"&&!Fai.isEmail(e)&&k)||(m=="phone"&&!Fai.isPhone(e)&&k)){Fai.ing(LS.addrInfoInputError+b,1);return}if(m=="mobile"){e=$.trim(e);if(e.length>0){if(!Fai.isNationMobile(e)){Fai.ing(LS.mobileNumRegular,1);return}d.mobileCt=$(".J_noAddrMsgContent").find("#mobileCt").val()}else{d.mobileCt=""}}d[m]=e}if(n){d.isDefault=1;h.push(d)}f.addrInfoList=h;$.ajax({type:"post",url:g,data:"info="+Fai.encodeUrl($.toJSON(f)),success:function(i){document.location.href="mCenter.jsp?item=memberInfo"},error:function(){Fai.ing(LS.systemError)}})};Site.memberIntegralInit=function(c,e,a){var d=false;if(c){d=true}$("#incomeTab").css({"border-top":"1px solid #eeeeee","border-right":"1px solid #eeeeee"});$("#expenseTab").css({"border-top":"1px solid #eeeeee","border-right":"1px solid #eeeeee"});$("#totalTab").css({"border-top":"1px solid #eeeeee","border-left":"1px solid #eeeeee","border-right":"1px solid #eeeeee"});$("#integralTabLine").find(".integralTab").click(function(){$("#integralTabLine").find(".g_border").removeClass("g_title"+a);$(this).addClass("g_title"+(e?a:""));b($(this).attr("id"));$("#integralTabLine").find(".g_title").removeClass("g_title");$(this).addClass("g_title")});function b(g){var f=g||"totalTab";if(f=="incomeTab"){$("#allIntegralList").hide();$("#incomeIntegralList").show();$("#expenseIntegralList").hide()}else{if(f=="expenseTab"){$("#allIntegralList").hide();$("#incomeIntegralList").hide();$("#expenseIntegralList").show()}else{$("#allIntegralList").show();$("#incomeIntegralList").hide();$("#expenseIntegralList").hide()}}}};Site.FitMemberProfilePanelImgSize=function(){if($(".memberProfilePanel").length<=0){return}var g=$(".memberProfilePanel .mBulletin_content").find("img"),f=$(".mBulletin_Area"),c=f.width(),e=f.height(),b,a,d;g.each(function(j,h){b=$(h).attr("width");a=$(h).attr("height");if(b>c){d=Fai.Img.calcSize(b,a,c,e,Fai.Img.MODE_SCALE_FILL);$(h).css({width:d.width,height:d.height});if(Fai.isIE()){$(".formStyle55 .formMiddleContent").css("overflow","hidden")}}})};Site.loadPdCollectionList=function(c,b,d,e,a){this.pIdList=b;this.mid=c;this.isNewUser=d;this.colorStyleType=e;this.colorStyle=a;this.panel=$(".memberCollectionPanel")};(function(d,n,e){var j=n.prototype,t,g,h,s,q,k,m=[],u=12,b,c=[];j.init=function(){g=this.pIdList,k=this.panel;t=this.mid;h=this.isNewUser;s=this.colorStyleType;q=this.colorStyle;r();a();var x=g.slice(0,u);b=x.length;p(x);i()};function r(){d.post("ajax/product_h.jsp",{mid:t,cmd:"updateCollections",ids:d.toJSON(g)},function(x){if(x.success){g=x.list}},"json")}function p(x){d.ajax({url:"ajax/product_h.jsp",data:{cmd:"batchGetPd",ids:d.toJSON(x)},async:false,type:"POST",dataType:"json",success:function(y){if(y.success){d(function(){o(x,y.list)})}}})}function v(y){var x=false,z;d.each(c,function(A,B){if(y==B.lid){x=true;z=B}});if(!x){z=l(y)}return z}function l(x){var y={lid:x};d.ajax({url:"ajax/productProp_h.jsp?cmd=list&lid="+x,async:false,type:"POST",dataType:"json",success:function(z){if(z.success){var A=false,B=false;d.each(z.list,function(C,D){if(D.fieldKey=="mallMarketPrice"){B=true}if(D.fieldKey=="mallPrice"){A=true}});y.showMarketPrice=B;y.showPrice=A;c.push(y)}}});return y}function w(){var y={},x=false;y.productCollections=g.reverse()+"";d.ajax({url:"ajax/member_h.jsp",data:{cmd:"set",id:t,info:d.toJSON(y)},async:false,type:"POST",dataType:"json",success:function(z){if(z.success){x=true}else{x=false}}});return x}function a(){var x=Math.ceil(g.length/u);if(k.find(".pagination").length==0){k.append('<div class="pagination"><a id="upPage">'+LS.prevPager+'</a> <span id="currentPage">1</span>/<span id="totalPage">'+x+'</span>页 <a id="downPage">'+LS.nextPager+"</a></div>")}else{d("#totalPage").text(x)}if(x>Number(d("#currentPage").text())){d("#downPage").addClass("g_border")}else{d("#downPage").removeClass("g_border")}if(d("#currentPage").text()!="1"){d("#upPage").addClass("g_border")}else{d("#upPage").removeClass("g_border")}}function o(x,y){var z=[];d.each(y,function(B,A){var C=v(A.lid);z.push("<li>");z.push(' <div class="pdImg">');z.push(' <a href="pd.jsp?id='+A.id+'">');z.push(' <div class="delColl" data-id="'+A.id+'">');z.push(' <div class="delCollBg"></div>');z.push(' <div class="delCollIcon"></div>');z.push(" </div> ");z.push(' <img src="'+A.picPath+'" />');z.push(" </a>");z.push(" </div> ");z.push(' <div class="pdName">'+A.name+"</div>");z.push(' <div class="pdPrice">');if(A.mallPrice!=-1&&C.showPrice){z.push(' <div class="mallPrice mallPrice'+(h&&(s>0)?q:"")+'">'+Fai.top.choiceCurrencyVal+" "+A.mallPrice+"</div>")}if(A.mallMarketPrice!=-1&&C.showMarketPrice){z.push(' <div class="mallMarketPrice">'+Fai.top.choiceCurrencyVal+" "+A.mallMarketPrice+"</div>")}z.push(" </div>");z.push("</li>")});k.find(".collectionList").append(z.join(""))}function i(){k.on({hover:function(){d(this).find(".delColl").show()},mouseleave:function(){if(d(this).parents(".memberCollectionNewPanel").length==0){d(this).find(".delColl").hide()}}},".pdImg");k.on("click",".delColl",function(){var y=d(this);y.parents("a").attr("href","javascript:;");var x=y.attr("data-id");var A=g.indexOf(Number(x));if(A>-1){g.splice(A,1)}var B=["<div class='fk-cancelOrder'>","<div style='padding:10px;'>",LS.sureDelCollection,"</div>","<div style='padding:10px 0 18px 0;'>","<span class='J-rpt-cancel popupBClose' style='margin-right:20px;'>",LS.cancel,"</span>","<span class='J-rpt-save con-hover'>"+LS.confirm+"</span>","</div>","</div>"];var D=parseInt(Math.random()*10000);var z={boxId:D,title:"",htmlContent:B.join(""),width:300};var C=Site.popupBox(z);C.find(".J-rpt-save").on("click",function(){if(w()){y.parents("li").remove()}else{Fai.ing(LS.systemError);return}a();if(g.length>b){var G=g[b];b=b+1;var F=[];F.push(G);p(F)}f();if(g.length==0){k.find(".collectionList").html("<div class='noCollIcon'></div><div class='noCollTip'>"+LS.notCollection+"</div>");k.find(".pagination").remove()}var E=true;d(".collectionList li").each(function(){if(!d(this).is(":hidden")){E=false;return true}});if(E){d("#upPage").click()}C.find(".popupBClose").click()})});k.on("click","#downPage",function(){if(d(this).hasClass("g_border")){d("#currentPage").text(Number(d("#currentPage").text())+1);a();if(g.length>b){var x=g.slice(b,b+u);b=b+x.length;if(x.length>0){p(x)}}f()}});k.on("click","#upPage",function(){if(d(this).hasClass("g_border")){d("#currentPage").text(Number(d("#currentPage").text())-1);a();f()}})}function f(){var x=Number(d("#currentPage").text())-1;k.find(".collectionList").children().hide();var z=x*u;for(var y=z;y<z+12;y++){k.find(".collectionList li:eq("+y+")").show()}}})(jQuery,Site.loadPdCollectionList);Site.memberProfileResetPwd=function(c){var a=Fai.top.$("#module"+c);var b=a.find(".itemPwd");if(b.is(":visible")){b.hide();a.find(".resetPwd").html(LS.memberProfileResetPwd)}else{b.show();a.find(".resetPwd").html(LS.memberProfileCanelPwd)}};Site.memberProfileSubmit=function(l,s,e){var b=$("#module"+l);b.find(".memberProfileMsg").show();var d=b.find(".memberProfileMsg .msgText");var r={};var k=false;var q=true;$(".userEditItem").each(function(){userEditItemName=$(this).attr("id");j=$(this).val();r[userEditItemName]=j;if("mobile"==userEditItemName&&j.length>0){if($(this).attr("disabled")!="disabled"){if(!Fai.isNationMobile(j)){d.html(LS.mobileNumRegular);$(this).focus();q=false;return false}else{r.mobileCt=$(this).parent().find("#mobileCt").val();k=true}}else{r[userEditItemName]=""}}});if(!q){return}var c=b.find(".itemPwd");if(c.is(":visible")){if(e){var p=$("#memberProfileOldPwd").val();if(p==null||p==""){d.html(LS.memberProfileOldPwdEmpty);$("#memberProfileOldPwd").focus();return}}var f=$("#memberProfilePwd").val();if(f==null||f==""){d.html(LS.memberProfilePwdEmpty);$("#memberProfilePwd").focus();return}if(f.length<4){d.html(LS.memberProfilePwdMinLength);$("#memberProfilePwd").focus();return}var m=$("#memberProfileRepwd").val();if(f!=m){d.html(LS.memberProfilePwdNotMatch);$("#memberProfileRepwd").focus();return}r.oldPwd=$.md5(p);r.pwd=$.md5(f)}var o="";var j="";var t=0;$(".userEditItem").each(function(){userEditItemID=$(this).attr("id");j=$(this).val();userEditItemName=$(this).attr("name");userEditItemMaxLength=$(this).attr("maxlength");if(userEditItemID=="email"&&j.length>0){if(!Fai.isEmail(j)){d.html(Fai.format(LS.memberProfileItemCorrect,userEditItemName));$(this).focus();t=1;return false}}if(j.length>userEditItemMaxLength){d.html(Fai.format(LS.memberProfileUserEditItemMaxLength,userEditItemName,userEditItemMaxLength));$(this).focus();t=1;return false}});var i=b.find("#acct");if(i.attr("disabled")!=""){if(i.val()==""){h=1}else{r.acct=i.val()}}if(t==1){return}var h=0;var n=0;var a="";$(".isCheckUAI").each(function(){userEditItemID=$(this).attr("id");j=$(this).val();userEditItemName=$(this).attr("name");if(j==null||j==""){if($(this).is("input")){d.html(Fai.format(LS.memberSignupUserAddItemIsEmpty,userEditItemName))}else{d.html(Fai.format(LS.memberSignupUserAddItemIsEmpty2,userEditItemName))}$(this).focus();h=1;return false}if(userEditItemID=="email"&&j.length>0){if(!Fai.isEmail(j)){d.html(Fai.format(LS.memberProfileItemCorrect,userEditItemName));$(this).focus();n=1;return false}}});if(h==1){return}if(n==1){return}var g=b.find(".memberProfileBtn");g.attr("disabled",true);d.html(LS.memberProfileSubmitting);if(newImg&&"id" in newImg&&oldImgId!=newImg.id){$.ajax({type:"post",url:"../ajax/member_h.jsp?cmd=cimg",data:"oldImgId="+oldImgId+"&mid="+s+"&newImg="+Fai.encodeUrl($.toJSON(newImg)),async:false,error:function(){Fai.ing(LS.systemError)},success:function(u){u=jQuery.parseJSON(u);if(u.success){headPic.thumbId=u.fileId}}})}r.headPic=headPic;$.ajax({type:"post",async:false,url:"ajax/member_h.jsp?cmd=set",data:"id="+s+"&info="+Fai.encodeUrl($.toJSON(r)),error:function(){g.removeAttr("disabled");d.html(LS.memberProfileError)},success:function(u){g.removeAttr("disabled");var v=jQuery.parseJSON(u);if(v.success){d.html(LS.memberProfileOK);setTimeout(function(){d.html("");d.parent().hide()},3000);if(v.changeAcct){b.find(".acctOnlyOnceTip").hide();b.find(".canReset").removeClass("canReset");b.find("#acct").attr("disabled","disabled")}b.find(".itemPwd").hide();b.find(".itemPwd input").val("");b.find(".resetPwd").html(LS.memberProfileResetPwd);if(k==true){b.find("#mobile").attr("disabled","disabled");b.find("#mobile").removeAttr("style");var w=b.find("#mobileCt").find("option:selected").text();if(w!=null&&w.indexOf("+")>=0){w=w.substring(w.indexOf("+"));b.find("#mobile").val(w+" "+b.find("#mobile").val())}b.find("#mobileCt").remove()}Site.checkMemberDataIntegrity(l)}else{if(v.rt==-3){d.html(LS.memberProfileOldPwdIncorrectError)}else{if(v.rt==-6){d.html(LS.memberSignupRegisterExisted)}else{if(v.mobileErr==true){d.html(LS.mobileNumRegular);$("#mobile").focus()}else{d.html(LS.memberProfileError)}}}}}})};Site.checkMemberDataIntegrity=function(c){var d=Fai.top.$("#module"+c);var f=0;var e=0;var a=d.find(".allTooltip").width();var b=0;d.find(".memberProNewfile .J_memberProfileItem").not(".itemPwd").each(function(g,h){e++;if(typeof $(this).find("input").val()!="undefined"&&$(this).find("input").val().length>0){f++;return true}});b=f/e;d.find(".dataIntegrity").text(Math.floor(b*100));d.find(".realTooltip").css("width",b*a)};Site.loadCouponList=(function(e){function f(m){this.mid=m}var g=f.prototype,k,b=0;pageno=[1,1,1],pageSize=9;var j=[];j[0]=new Array(),j[1]=new Array(),j[2]=new Array(),couponColorList=["red","orange","yellow","green","blue","pink","purple","gray"];g.init=function(n,m){k=this;if(_manageMode){var o={id:0,couponName:"示例优惠券",savePrice:10,orderMinPrice:10,couponLeaveAmount:999,flag:0,receiveCount:1,state:true,validity:"无时间限制",cdId:73,bg:0,status:0,redeemCode:"1111111"};j[0]=[o,o,o];e(".couponList").append(i(n,m));return}c(n,m);l(n,m)};function c(n,m){var o=k;e.ajax({url:"ajax/mallCoupon_h.jsp?cmd=getCouponByMid",data:"mid="+o.mid,dataType:"json",success:function(p){if(p.success){if(p.receiveList){j[0]=p.receiveList}if(p.usedList){j[1]=p.usedList}if(p.expireList){j[2]=p.expireList}a(n,m)}},error:function(){}})}function a(o,n){var s=k;var r=e(".couponList");var q=[];q.push('<div class="tabList">');q.push('<div class="coupon-tab"><span class="">'+(o?LS.myCoupon:LS.notUse)+'(<span class="couponAmount">'+j[0].length+"</span>)</span><em></em></div>");q.push('<div class="coupon-tab"><span>'+(o?LS.usedCoupon:LS.used)+'(<span class="couponAmount">'+j[1].length+"</span>)</span><em></em></div>");q.push('<div class="coupon-tab"><span>'+(o?LS.expiredCoupon:LS.expired)+'(<span class="couponAmount">'+j[2].length+"</span>)</span><em></em></div>");q.push("</div>");r.append(q.join(""));var p=e(".coupon-tab").eq(b),m=e(".g_selected").css("background-color");h(p,o,n);p.addClass("g_selected");p.find("em").css({"border-top-color":m})}function l(n,m){var o=k;e("body").on("click",".coupon-tab",function(){if(b==Number(e(this).index())){return}h(e(this),n,m)});e("body").on("click",".coupon-delete",function(){var p=e(this).parents(".coupon").attr("data_id"),w=e(this).parents(".coupon-warp");var q=LS.delCouponWillUnavail;if(b!=0){q=LS.confirmDelCoupon}var u;var r=j[b];var v=r.length;var t=["<div class='fk-cancelOrder'>","<div style='padding:10px;'>",q,"</div>","<div style='padding:10px 0 18px 0;'>","<span class='J-rpt-cancel popupBClose' style='margin-right:20px;'>",LS.cancel,"</span>","<span class='J-rpt-save con-hover'>"+LS.confirm+"</span>","</div>","</div>"];var x=parseInt(Math.random()*10000);var y={boxId:x,title:"",htmlContent:t.join(""),width:300};var s=Site.popupBox(y);s.find(".J-rpt-save").on("click",function(){for(var z=0;z<v;z++){if(parseInt(p)==r[z].cdId){u=z;break}}j[b].splice(z,1);e.ajax({url:"ajax/member_h.jsp?cmd=delCoupon",data:"mid="+o.mid+"&cdid="+p,dataType:"json",success:function(A){if(A.success){w.remove();d(b,pageno[b],n,m);e(".coupon-tab").eq(b).find(".couponAmount").text(j[b].length)}},error:function(){}});s.find(".popupBClose").click()})})}function h(p,o,n){var m=e(".g_selected").css("background-color");e(".coupon-tab").removeClass("g_selected");e(".coupon-tab").find("em").css({"border-top-color":""});p.addClass("g_selected");p.find("em").css({"border-top-color":m});b=p.index();e(".show-coupon-list").remove();e(".couponList").append(i(o,n));if(j[b].length>pageSize){e(".couponList").append("<div class='pagenation' id='pagenation"+b+"'></div>");new Site.Pagenation(b,{pageNo:1,pageSize:pageSize,totalSize:j[b].length},d)}else{e(".memberCouponPanel .pagenation").remove()}}function i(p,o){var r=k,n=[],m=pageno[b];n=j[b].slice((m-1)*pageSize,m*pageSize);var q=[];q.push("<div class='show-coupon-list'>");if(n.length>0){e.each(n,function(t,s){if(b!=0){s.bg=7}if(p=="new"){q.push("<div class='coupon-warp'>");q.push("<div class='coupon-code-new'>"+LS.couponNumber+":"+s.redeemCode+"</div>");q.push("<div class='coupon coupon-new' data_id='"+s.cdId+"'>");q.push("<div class='coupon-content-new "+((b==1||b==2)?"coupon-background":"")+" coupon-color-"+couponColorList[s.bg]+"'>");q.push("<div class='couponSavePrice'><span class='priceSign'>"+Fai.top.choiceCurrencyVal+"</span><span class='couponPrice'>"+s.savePrice+"</span><span class='couponActivity'>"+LS.Event+LS.name+":"+Fai.encodeHtml(s.couponName)+"</span></div>");q.push("<div class='couponCondition'>"+LS.useCondition+":"+LS.full+s.orderMinPrice+"</div>");q.push("<div class='couponTime'>"+LS.valiteTime+":"+s.validity+"</div>");q.push("</div>");if(b==1){if(o==2052||o==1028){q.push('<div class="fk-coupon-used"></div>')}else{q.push('<div class="fk-coupon-used-en"></div>')}}q.push("</div>");q.push("</div>")}else{q.push("<div class='coupon-warp'>");q.push("<div class='coupon-code'>"+LS.couponNumber+":"+s.redeemCode+"</div>");q.push("<div class='coupon' data_id='"+s.cdId+"'>");q.push("<div class='coupon-left coupon-"+couponColorList[s.bg]+"-left'></div>");q.push("<div class='coupon-content coupon-color-"+couponColorList[s.bg]+"'>");q.push("<div class='couponSavePrice'><span class='priceSign'>"+Fai.top.choiceCurrencyVal+"</span><span class='couponPrice'>"+s.savePrice+"</span></div>");q.push("<div>"+LS.Event+LS.name+":"+Fai.encodeHtml(s.couponName)+"</div>");q.push("<div>"+LS.useCondition+":"+LS.full+s.orderMinPrice+"</div>");q.push("<div>"+LS.valiteTime+":"+s.validity+"</div>");q.push("</div>");q.push("<div class='coupon-right coupon-"+couponColorList[s.bg]+"-right'></div>");q.push("<div class='coupon-watermark'>券</div>");if(b==2){q.push('<div class="fk-coupon-expired"></div>')}q.push("</div>");q.push("</div>")}})}else{q.push("<div class='couponEmpty'>");q.push(" <div class='couponEmpty-img'>");q.push(" <div class='couponEmpty-img-container'></div>");q.push(" </div>");q.push(" <div class='couponEmpty-message'>");if(b==0){q.push(" <span>"+LS.noUseCoupon+"</span>")}else{q.push(" <span>"+LS.noRelatedCoupon+"</span>")}q.push(" </div>");q.push("</div>")}q.push("</div>");return q.join("")}function d(p,m,o,n){pageno[p]=m;e(".tabList").next().remove();e(".tabList").after(i(o,n))}return f})(jQuery);Site.onlyShowPhoneCode=function(a){var b=$("#"+a);if(typeof b=="undefined"||b==null){return}var c=b.val();c=c.substring(0,c.length-5);b.val(c)};Site.newOrderList=function(moduleId){var $module=$("#module"+moduleId);$module.find(".memberOrderPanel").on("click",".pageNo, .pagePrev, .pageNext",function(){var pageSize=$(this).attr("_pageSize");var pageno=$.trim($(this).text());var status=$(this).attr("_status");var colorStyleType=$(this).attr("_colorStyleType");var colorStyle=$(this).attr("_colorStyle");if($(this).hasClass("pagePrev")){pageno=$(this).attr("_prepage")}else{if($(this).hasClass("pageNext")){pageno=$(this).attr("_nextpage")}}if(!$(this).hasClass("J_pageSelect")&&pageno){var mallOrderStatusId=$module.find(".memberOrderNewPanel .mallOrderNewList > div:visible").attr("id");mallOrderStatusId=$.trim(mallOrderStatusId);Site.showLoading(mallOrderStatusId);$.ajax({url:"ajax/member_h.jsp?cmd=getNewOrderListHtml",data:"moduleId="+moduleId+"&status="+status+"&pageno="+pageno+"&pageSize="+pageSize+"&colorStyleType="+colorStyleType+"&colorStyle="+colorStyle,dataType:"json",success:function(result){if(result.success){var newOrderListHtml=result.msg;if(status==2){$(".mallOrderWaitSettle").empty();$(".mallOrderWaitSettle").append(newOrderListHtml)}else{if(status==5){$(".mallOrderFinSettle").empty();$(".mallOrderFinSettle").append(newOrderListHtml)}else{if(status==10){$(".mallOrderFinPay").empty();$(".mallOrderFinPay").append(newOrderListHtml)}else{if(status==15){$(".mallOrderFinShip").empty();$(".mallOrderFinShip").append(newOrderListHtml)}else{if(status==20){$(".mallOrderFinProcess").empty();$(".mallOrderFinProcess").append(newOrderListHtml)}else{if(status==25){$(".mallOrderAll").empty();$(".mallOrderAll").append(newOrderListHtml)}else{if(status==-2){$(".mallOrderRefund").empty();$(".mallOrderRefund").append(newOrderListHtml)}else{if(status==-3){$("#mallOrderAllOld").empty();$("#mallOrderAllOld").append(newOrderListHtml)}}}}}}}}var newOrderListScript=result.scripts;eval(newOrderListScript)}else{Fai.ing(result.msg,true)}Site.closeLoading(mallOrderStatusId)},error:function(){Site.showLoadingAgain(mallOrderStatusId,pageno)}})}})};Site.showLoading=function(b){var a=['<div class="orderLoading" style="margin-top:50px;margin-bottom:50px;">','<table style="width:100%;height:100%;"><tr><td align="center" valign="middle">','<div class="ajaxLoading2"></div>',"</td></tr></table>","</div>"];$("#"+b).empty().append(a.join(""))};Site.showLoadingAgain=function(b,c){Site.closeLoading(b);var a=['<div class="orderLoadingAgain orderLoading" style="margin-top:50px;margin-bottom:50px;text-align:center;">','<div style="color: #1b7ad1; text-decoration: none; text-align:center; width:100%;cursor:pointer;" onclick="Site.reloadingClick(\''+b+"',"+c+');">加载失败,请点击重新加载</div>',"</div>"];$("#"+b).empty().append(a.join(""))};Site.closeLoading=function(a){$("#"+a).find(".orderLoading").remove()};Site.reloadingClick=function(a,b){Site.showLoading(a);$("#"+a).find(".pageNo").each(function(){if($.trim($(this).text())==b){$(this).click()}})};Site.integralInitEvent=function(a){ajaxLoadIntegralList(a,"allIntegralList",-1);ajaxLoadIntegralList(a,"incomeIntegralList",0);ajaxLoadIntegralList(a,"expenseIntegralList",1)};function ajaxLoadIntegralList(d,c,a){var b=$("#module"+d).find(".memberIntegralPanel");b.find("#"+c).on("click",".pageNo, .pagePrev, .pageNext",function(){var e=$(this).attr("_pageSize"),f=$.trim($(this).text());if($(this).hasClass("pagePrev")){f=$(this).attr("_prepage")}else{if($(this).hasClass("pageNext")){f=$(this).attr("_nextpage")}}if(!$(this).hasClass("J_pageSelect")&&f){Site.showLoading(c);$.ajax({url:"ajax/member_h.jsp?cmd=getIntegralListHtml",data:"moduleId="+d+"&pageno="+f+"&pageSize="+e+"&integralType="+a,dataType:"json",type:"post",success:function(g){setTimeout(function(){if(g.success){b.find("#"+c).empty();b.find("#"+c).prepend(g.integralListHtml)}else{Fai.ing(g.msg,true)}Site.closeLoading(c)},150)}})}})}Site.memberOrderListInitEvent=function(b){var a=$("#module"+b).find(".mallOrderList");a.on("click",".pageNo, .pagePrev, .pageNext",function(){var c=$(this).attr("_pageSize"),d=$.trim($(this).text());if($(this).hasClass("pagePrev")){d=$(this).attr("_prepage")}else{if($(this).hasClass("pageNext")){d=$(this).attr("_nextpage")}}if(!$(this).hasClass("J_pageSelect")&&d){$.ajax({url:"ajax/member_h.jsp?cmd=getMemberOrderListHtml",data:"moduleId="+b+"&pageno="+d+"&pageSize="+c,dataType:"json",type:"post",success:function(e){if(e.success){a.empty();a.prepend(e.orderListHtml);Site.initModuleItemCover("#module"+b+" .itemLine",e.contentSplitLine);Site.fixSiteWidth(Fai.top._manageMode);Site.fixWebFooterHeight()}else{Fai.ing(e.msg,true)}}})}})};Site.changeBindAcct=function(a,f){Site.logDog(200199,3);var b=$("#module"+a);b.find(".memberBindMsg").show();var c=b.find(".memberBindMsg .msgText");var e="cmd=bindOtherAcct";var d={};var i=$("#bindAcct").val();var h=$("#bindPassword").val();var g=$.cookie("isOtherLogin");if(i==null||i==""){c.html(LS.memberSignupRegisterAcctEmpty);$("#bindAcct").focus();return}if(h==null||h==""){c.html(LS.memberSignupRegisterPwdEmpty);$("#bindPassword").focus();return}h=$.md5(h);d.acct=i;d.pwd=h;$.ajax({type:"post",url:"ajax/member_h.jsp?"+e,data:"info="+Fai.encodeUrl($.toJSON(d))+"&mid="+f+"&loginType="+g,error:function(){},success:function(j){var k=jQuery.parseJSON(j);if(k.success){if(k.fromBind){Site.memberInactiveDialog(k.mail,k.memName)}else{if(k.active){Site.memberActiveDialog(d.email,Fai.encodeUrl(d.acct),function(){Fai.top.location.href=url;Fai.top.event.returnValue=false})}else{document.location.reload()}}}else{if(k.msg=="该帐号已绑定到其他帐号"){c.html(LS.hasBindOtherAcct)}else{if(k.rt==-601){c.html(LS.reGetMobileCode)}else{if(k.rt==-8){c.html(LS.mobileHasSigned)}else{if(k.rt==-6){c.html(LS.memberSignupRegisterExisted)}else{if(k.rt==-4){c.html(LS.memberSignupRegisterLimit)}else{if(k.rt==-3){if(k.msg=="密码不正确"){c.html(LS.memberPwdError)}else{c.html(LS.memberDialogNotFound)}}else{if(k.rt==1){c.html(LS.memberOtherLgnAcctAlreadyBind)}else{c.html(LS.memberSignupRegisterError)}}}}}}}}}})};Site.initModuleMemberSignup=function(c,f,e,a){$("#memberSignupAcct").focus();var b=Site.getUrlParamObj(Fai.top.location.search).url||a;if(f==2){$("#module"+c).find(".formMiddle").addClass("memberSignupMiddle");var d=$("#module"+c).find("#memberSignupButton");$(d).unbind("click").bind("click",function(){if(e){Fai.ing("您目前处于网站管理状态,请先点击网站右上方的“退出”后再注册会员。")}else{Site.memberSignupSubmit(c,b,f)}});Site.memberSignupCompatibility(c)}};Site.memberSignupCompatibility=function(b){if(Fai.isIE6()){var e=$("#module"+b).find(".J_memberSignupPanel");$(e).removeAttr("style");var d=$(e).width();if(d>313||d<200){d=(d>313)?"313px":(d<200)?"200px":"auto";$(e).css("width",d)}}var c=!("placeholder" in document.createElement("input"));if(c){var a=$("#module"+b).find(".itemMiddle");$.each(a,function(k,m){var n=$(m).find("span");n.css({"white-space":"nowrap"});var h=n.width();var l=n.height();var g=$(m).position().top+(Fai.isIE6()?2:0);var f=$(m).position().left;$(n).css({top:g+"px",left:f+"px","line-height":l+"px",padding:"0px 0px 0px 4px",width:h+"px"});var j=$(m).find("input").val();if(j&&j.length>0){$(n).hide()}})}};Site.getSignMobileCode=function(d,b){var c=Site.checkGetMobileCodeParam(d,b);var a=$("#module"+d);if(d=="J_memberRegisterDialogPanel"){a=$("#J_memberRegisterDialogPanel")}if(c.checkResult==true){$.ajax({type:"post",url:"ajax/member_h.jsp?cmd=getMobileCode",data:"mobile="+c.info.mobile+"&mobileCt="+c.info.mobileCt+"&validateCode="+c.info.captcha,error:function(){Site.showSignupMsg(b,d,"",LS.getMobileCodeErrAf,true)},success:function(e){var f=jQuery.parseJSON(e);if(f.success){Site.showSignupMsg(b,d,"",LS.sendMobileCodeSuc,true);Site.getSignMobileCodeCountDown(d)}else{Site.changeCaptchaImg(a.find("#memberSignupCaptchaImg")[0]);$("#memberSignupCaptcha").val("");if(f.rt==-401){Site.showSignupMsg(b,d,"memberSignupCaptcha",LS.memberSignupRegisterCaptchaNotMatch)}else{if(f.rt==-2){Site.showSignupMsg(b,d,"",LS.argsError)}else{if(f.rt==2){Site.showSignupMsg(b,d,"mobile",LS.memberDialogSendMobileCodeErr)}else{if(f.rt==-4||f.rt==8){Site.showSignupMsg(b,d,"",LS.getMobileOneMin,true)}else{if(f.rt==-8){Site.showSignupMsg(b,d,"",LS.getMobileHalfHour,true)}else{if(f.rt==3){Site.showSignupMsg(b,d,"",LS.memberDialogMobileMoneyErr,true)}else{if(f.rt==9){Site.showSignupMsg(b,d,"",LS.memberDialogSendMobileCodeLimit,true)}else{if(f.rt==101){Site.showSignupMsg(b,d,"",LS.mobileSetErr,true)}else{if(f.rt==-6){Site.showSignupMsg(b,d,"mobile",LS.mobileHasSigned,true)}else{if(f.rt==23){Site.showSignupMsg(b,d,"",LS.mobileNationTplErr,true)}else{Site.showSignupMsg(b,d,"",LS.getMobileRefresh,true)}}}}}}}}}}}}})}};Site.getSignMobileCodeCountDown=function(d){var b=$("#module"+d);if(d=="J_memberRegisterDialogPanel"){b=$("#J_memberRegisterDialogPanel")}var e=b.find(".getMobileCdBtn");var c=e.attr("cTime");var f=60;if(!c||c==null){c=0}else{c=parseInt(c);f=1800}c++;e.attr("cTime",c);e.attr("s_onclick",e.attr("onclick"));e.removeAttr("onclick");var a=setInterval(function(){f--;e.html(LS.reGetMsg+"("+f+")");if(f<=0){e.html(e.attr("title"));e.attr("onclick",e.attr("s_onclick"));clearInterval(a)}},1000)};Site.checkGetMobileCodeParam=function(f,c){var e={checkResult:false,info:{}};var b=$("#module"+f);if(f=="J_memberRegisterDialogPanel"){b=$("#J_memberRegisterDialogPanel")}var a=b.find("#mobile").val();var d=b.find("#memberSignupCaptcha").val();if(!Fai.isNationMobile(a)){Site.showSignupMsg(c,f,"mobile",LS.mobileNumRegular);return e}if(d==null||d==""){Site.showSignupMsg(c,f,"memberSignupCaptcha",LS.memberSignupRegisterCaptchaEmpty);return e}e.checkResult=true;e.info.mobile=a;if(a&&a!=null&&$.trim(a)!=""){e.info.mobileCt=b.find("#mobileCt").val()}else{e.info.mobileCt=""}e.info.captcha=d;return e};Site.memberSignupSubmit=function(b,h,j){var a=Site.getUrlParamObj(Fai.top.location.search).url||h;if(_siteDemo){Fai.ing("当前为“模板网站”,请先“复制网站”再进行注册。");return}var d=$("#module"+b);var i=d.find("#memberSignupAcct").val();var f=d.find("#memberSignupPwd").val();var g=Site.checkSignupValid(b,j);if(!g.checkResult){return}var c=d.find(".memberSignupBtn");var e=d.find(".memberSignupMsg .msgText");c.attr("disabled",true);e.html(LS.memberSignupRegisterIng);$.ajax({type:"post",url:"ajax/member_h.jsp?cmd=add",data:"info="+Fai.encodeUrl($.toJSON(g.info))+"&validateCode="+g.captcha,error:function(){c.removeAttr("disabled");Site.showSignupMsg(j,b,"",LS.memberSignupRegisterError,true)},success:function(k){var l=jQuery.parseJSON(k);if(l.success){if(l.active){Site.memberActiveDialog(g.info.email,Fai.encodeUrl(g.info.acct),function(){if(a){Fai.top.location.href="login.jsp?errno=12&url="+Fai.encodeUrl(a)}else{Fai.top.location.href="login.jsp?errno=12"}Fai.top.event.returnValue=false})}else{if(l.rt==0){Fai.top.location.href="login.jsp?errno=-303"}setTimeout(function(){if(a){Site.autoLogin(i,f,a)}else{Fai.top.location.href="login.jsp?errno=12"}},3000)}}else{c.removeAttr("disabled");Site.changeCaptchaImg($("#memberSignupCaptchaImg")[0]);$("#memberSignupCaptcha").val("");if(l.rt==-601){Site.showSignupMsg(j,b,"messageAuthCode",LS.reGetMobileCode)}else{if(l.rt==-401){Site.showSignupMsg(j,b,"memberSignupCaptcha",LS.memberSignupRegisterCaptchaNotMatch);if(l.needCode){$(".J_memberSignupCaptcha").removeClass("memberSignupCaptchaHide")}}else{if(l.rt==-8){Site.showSignupMsg(j,b,"mobile",LS.mobileHasSigned)}else{if(l.rt==-6){Site.showSignupMsg(j,b,"memberSignupAcct",LS.memberSignupRegisterExisted)}else{if(l.rt==-4){Site.showSignupMsg(j,b,"",LS.memberSignupRegisterLimit,true)}else{if(l.rt==-28){Site.showSignupMsg(j,b,"",LS.memberRegisterLimit,true)}else{if(l.rt==-20){Site.showSignupMsg(j,b,"",l.msg,true)}else{Site.showSignupMsg(j,b,"",LS.memberSignupRegisterError,true)}}}}}}}if(l.hasFW){Site.showSignupMsg(j,b,"",l.msg,true);d.find(".memberSignupMsg .msgItem").hide()}}}})};Site.memberSignupDialogSubmit=function(b,a,n,g,l,o,k,c,h){if(_siteDemo){Fai.ing("当前为“模板网站”,请先“复制网站”再进行注册。");return}var e=$("#"+b);var m=e.find("#memberSignupAcct").val();var j=e.find("#memberSignupPwd").val();var i=Site.checkSignupValid(b,n);if(!i.checkResult){return}var d=e.find(".memberSignupBtn");var f=e.find(".memberSignupMsg .msgText");d.attr("disabled",true);f.html(LS.memberSignupRegisterIng);$.ajax({type:"post",url:"ajax/member_h.jsp?cmd=add",data:"info="+Fai.encodeUrl($.toJSON(i.info))+"&validateCode="+i.captcha,error:function(){d.removeAttr("disabled");Site.showSignupMsg(n,b,"",LS.memberSignupRegisterError,true)},success:function(p){var q=jQuery.parseJSON(p);if(q.success){if(q.active){Site.memberActiveDialog(i.info.email,Fai.encodeUrl(i.info.acct),function(){if(a){Fai.top.location.href="login.jsp?errno=12&url="+Fai.encodeUrl(a)}else{Fai.top.location.href="login.jsp?errno=12"}Fai.top.event.returnValue=false})}else{if(a){Site.autoLoginForDialog(m,j,a,g,b,l,o,k,c,h)}else{Fai.top.location.href="login.jsp?errno=12"}}}else{d.removeAttr("disabled");Site.changeCaptchaImg($("#memberSignupCaptchaImg")[0]);$("#memberSignupCaptcha").val("");if(q.rt==-601){Site.showSignupMsg(n,b,"messageAuthCode",LS.reGetMobileCode)}else{if(q.rt==-401){Site.showSignupMsg(n,b,"memberSignupCaptcha",LS.memberSignupRegisterCaptchaNotMatch);if(q.needCode){$(".J_memberSignupCaptcha").removeClass("memberSignupCaptchaHide")}}else{if(q.rt==-8){Site.showSignupMsg(n,b,"mobile",LS.mobileHasSigned)}else{if(q.rt==-6){Site.showSignupMsg(n,b,"memberSignupAcct",LS.memberSignupRegisterExisted)}else{if(q.rt==-4){Site.showSignupMsg(n,b,"",LS.memberSignupRegisterLimit,true)}else{if(q.rt==-28){Site.showSignupMsg(n,b,"",LS.memberRegisterLimit,true)}else{Site.showSignupMsg(n,b,"",LS.memberSignupRegisterError,true)}}}}}}if(q.hasFW){Site.showSignupMsg(n,b,"",q.msg,true)}}}})};Site.autoLogin=function(c,b,a){b=$.md5(b);$.ajax({type:"post",url:"ajax/login_h.jsp",data:"cmd=loginMember&acct="+Fai.encodeUrl(c)+"&pwd="+Fai.encodeUrl(b),error:function(){Fai.top.location.href="login.jsp?errno=-1&url="+Fai.encodeUrl(a)+"&acct="+Fai.encodeUrl(c)},success:function(d){var d=jQuery.parseJSON(d);if(d.success){Fai.top.location.href=a;return}else{Fai.top.location.href="login.jsp?returnUrl="+Fai.encodeUrl(a)}}})};Site.autoLoginForDialog=function(i,f,a,d,c,h,j,g,b,e){f=$.md5(f);$.ajax({type:"post",url:"ajax/login_h.jsp",data:"cmd=loginMember&acct="+Fai.encodeUrl(i)+"&pwd="+Fai.encodeUrl(f),error:function(){Fai.top.location.href="login.jsp?errno=-1&url="+Fai.encodeUrl(a)+"&acct="+Fai.encodeUrl(i)},success:function(k){var k=jQuery.parseJSON(k);if(k.success){$("#_TOKEN").attr("value")||$("title").after(k._TOKEN);if(g=="addCartItem"){var l={};l.pid=d;l.mid=h;l.url=j;l.opList=b;l.count=e;l.doWhat="add";$.cookie("isNeedAddCartItem",$.toJSON(l));Fai.top.location.reload()}else{if(g=="immeBuy"){var l={};l.pid=d;l.mid=h;l.url=j;l.opList=b;l.count=e;l.doWhat="buy";$.cookie("isNeedAddCartItem",$.toJSON(l));Fai.top.location.reload()}}return}else{Fai.top.location.href="login.jsp?returnUrl="+Fai.encodeUrl(a)}}})};Site.memberSignup=function(a){var b=Fai.getUrlParam(Fai.top.location.href,"url");if(a){Fai.top.location.href=Site.getHtmlUrl("signup")+"?url="+Fai.encodeUrl(a)}else{if(b){Fai.top.location.href=Site.getHtmlUrl("signup")+"?url="+Fai.encodeUrl(b)}else{Fai.top.location.href=Site.getHtmlUrl("signup")}}};Site.checkSignupValid=function(s,e){var b={checkResult:true,captcha:"",info:{}};if(s=="J_memberRegisterDialogPanel"){var a=$("#"+s)}else{var a=$("#module"+s)}a.find(".memberSignupMsg").show();var d=a.find(".memberSignupMsg .msgText");var k=$.trim($("#memberSignupAcct").val());if(k==null||k==""){Site.showSignupMsg(e,s,"memberSignupAcct",LS.memberSignupRegisterAcctEmpty);b.checkResult=false;return b}var g=$("#memberSignupPwd").val();if(g==null||g==""){Site.showSignupMsg(e,s,"memberSignupPwd",LS.memberSignupRegisterPwdEmpty);b.checkResult=false;return b}if(g.length<4){Site.showSignupMsg(e,s,"memberSignupPwd",LS.memberSignupRegisterPwdMinLength);b.checkResult=false;return b}var n=$("#memberSignupRepwd").val();if(g!=n){Site.showSignupMsg(e,s,"memberSignupRepwd",LS.memberSignupRegisterPwdNotMatch);b.checkResult=false;return b}var o="";if($("#memberSignupRemark").length>0){o=$("#memberSignupRemark").val();var t=$("#memberSignupRemark").attr("maxlength");if(o.length>t){Site.showSignupMsg(e,s,"memberSignupRemark",Fai.format(LS.memberSignupRegisterRemarkMaxLength,t));b.checkResult=false;return b}}if(typeof(a.find("#messageAuthCode").attr("maxlength"))!="undefined"&&a.find("#messageAuthCode").attr("maxlength")!=null){var m=a.find("#messageAuthCode").val();if(typeof(m)=="undefined"||m==null||m==""){Site.showSignupMsg(e,s,"messageAuthCode",LS.inputMobileCode);b.checkResult=false;return b}b.info.messageAuthCode=m}b.info.acct=k;b.info.pwd=$.md5(g);b.info.remark=o;var c="";var p="";var h="";var r=0;var l="";var f=0;var j="";$(".userAddItem").each(function(){userAddItemID=$(this).attr("id");h=$(this).val();c=$(this).attr("name");l=$(this).attr("maxlength");b.info[userAddItemID]=h;if(h.length>l){Site.showSignupMsg(e,s,userAddItemID,Fai.format(LS.memberSignupUserAddItemMaxLength,c,l));r=1;b.checkResult=false;return b}if(userAddItemID=="phone"&&h.length>0){if(!Fai.isPhone(h)){Site.showSignupMsg(e,s,userAddItemID,Fai.format(LS.memberSignupUserAddItemCorrect,c));f=1;b.checkResult=false;return b}}if(userAddItemID=="email"&&h.length>0){if(!Fai.isEmail(h)){Site.showSignupMsg(e,s,userAddItemID,Fai.format(LS.memberSignupUserAddItemCorrect,c));f=1;b.checkResult=false;return b}}if(userAddItemID=="mobile"&&h.length>0){if(!Fai.isNationMobile(h)){Site.showSignupMsg(e,s,userAddItemID,LS.mobileNumRegular);f=1;b.checkResult=false;return b}else{b.info.mobileCt=$("#mobileCt").val()}}});if(f==1){b.checkResult=false;return b}if(r==1){b.checkResult=false;return b}var i=0;$(".isCheckUAI").each(function(){userAddItemID=$(this).attr("id");h=$(this).val();c=$(this).attr("name");if(h==null||h==""){if($(this).is("input")){Site.showSignupMsg(e,s,userAddItemID,Fai.format(LS.memberSignupUserAddItemIsEmpty,c))}else{Site.showSignupMsg(e,s,userAddItemID,Fai.format(LS.memberSignupUserAddItemIsEmpty2,c))}i=1;return false}if(userAddItemID=="email"&&h.length>0){if(!Fai.isEmail(h)){Site.showSignupMsg(e,s,userAddItemID,Fai.format(LS.memberSignupUserAddItemCorrect,c));i=1;return false}}});if(i==1){b.checkResult=false;return b}if($(".J_memberSignupCaptcha").css("display")!="none"){b.captcha=$("#memberSignupCaptcha").val();if(b.captcha==null||b.captcha==""||typeof(b.captcha)=="undefined"){Site.showSignupMsg(e,s,"memberSignupCaptcha",LS.memberSignupRegisterCaptchaEmpty);b.checkResult=false;return b}}else{if(b.captcha==null||b.captcha==""||typeof(b.captcha)=="undefined"){b.captcha=""}}var q=$("#memberAgreePro");if(q.length>0){if(!q.prop("checked")){Site.showSignupMsg(e,s,"memberAgreePro",LS.memberProtocolNotAgree,true);b.checkResult=false;return b}}b.checkResult=true;return b};Site.showSignupMsg=function(g,a,h,f,i){if(a=="J_memberRegisterDialogPanel"){Fai.ing(f);return}var b=$("#module"+a);var e=new Object();var d="";if(h.length>0){e=$(b).find("#"+h);d=$(e).prop("tagName").toLocaleLowerCase()}b.find(".memberSignupMsg .msgItem").show();if(g==1){b.find(".memberSignupMsg").show();var c=b.find(".memberSignupMsg .msgText");if(d.length>0&&d=="input"){$(e).focus();c.html(f)}else{c.html(f)}return}if(i){Fai.ing(f,false);return}if(g==2){var j={moduleId:"module"+a,targetId:h,tipText:f};Site.floatTip(j);$(e).addClass("focusBg");return}};Site.initModuleMemberLogin=function(b,d,e,c,a){if(typeof a!="object"){a=new Object()}if(d==2){$("#module"+b).find(".J_loginButton").bind("click",function(){if(c){Fai.ing("您目前处于网站管理状态,请先点击网站右上方的“退出”后再登录会员。")}else{if(e){Site.memberLogin1(b,d,a)}else{Site.memberLogin2(b,d,a)}}})}Site.memberLoginCompatibility(b)};Site.memberLoginCompatibility=function(c){var b=$("#module"+c);if(c=="loginDialog"){b=$("#J_memberLoginDialogPanel")}if(Fai.isIE6()){var f=b.find(".J_memberLoginPanel");$(f).removeAttr("style");var e=$(f).width();if(e>260||e<180){e=(e>260)?"260px":(e<180)?"180px":"auto";$(f).css("width",e)}}var d=!("placeholder" in document.createElement("input"));if(d){var a=b.find(".J_memberLoginItem");$.each(a,function(l,n){var o=$(n).find("span");var j=$(o).width();var m=$(o).height();var h=$(n).position().top+(Fai.isIE6()?2:0);var g=$(n).position().left;if($(n).hasClass("memberCaptcha")){g+=10}else{g+=25}$(o).css({top:h+"px",left:g+"px","line-height":m+"px",padding:"0px 0px 0px 4px",width:j+"px"});var k=$(n).find("input").val();if(k.length>0){$(o).hide()}})}};Site.memberLogin=function(b){var a=Fai.top.location.href;if(a.indexOf("errno=")>-1){return}var c=Site.getHtmlUrl("login")+"?url="+Fai.encodeUrl(Fai.top.location.pathname+Fai.top.location.search);if(b!==undefined){c+="&errno="+b}Fai.top.location.href=c};Site.memberLogin1=function(b,j,k){Site.logDog(200061,2);if(typeof k!="object"){k=new Object()}if(Site.mbLogining){return}Site.mbLogining=true;var a=Fai.getUrlParam(Fai.top.location.href,"url");if(!a){a="./index.jsp"}var c=$("#module"+b);var i=c.find(".memberAcctInput").val();var g=c.find(".memberPwdInput").val();var f=(c.find(".memberCaptcha").css("display")!="none");var h=c.find(".memberCaptchaInput").val();if(i==null||i==""){Site.showMemberLoginMsg(b,1,false,j);return}if(g==null||g==""){Site.showMemberLoginMsg(b,2,false,j);return}if(f&&(h==null||h=="")){Site.showMemberLoginMsg(b,3,false,j);return}g=$.md5(g);var e=false;var d=c.find("#autoLogin"+b);if(d&&d.attr("checked")){e=true}$.ajax({type:"post",url:"ajax/login_h.jsp",data:"cmd=loginMember&acct="+Fai.encodeUrl(i)+"&pwd="+Fai.encodeUrl(g)+"&captcha="+Fai.encodeUrl(h)+"&autoLogin="+Fai.encodeUrl(e),error:function(){Site.mbLogining=false;Site.showMemberLoginMsg(b,-1,j)},success:function(v){Site.mbLogining=false;var v=jQuery.parseJSON(v);if(v.success){$("#_TOKEN").attr("value")||$("title").after(v._TOKEN);if(!!k.skipUrl){a=k.skipUrl}if(k.isPhotoSlide){var m=a.split(";");for(var p=0;p<m.length-1;p++){var r=new RegExp("[^script:]");if(r.test(a)){var u=m[p].split(":"),l=u[1].indexOf("(")+1,o=u[1].lastIndexOf(")"),s=Array.prototype.slice.call(u[1].substring(l,o).split(",")),n=u[1].substring(0,l-1),t=[];Site.photoSlide.returnIndex=function(){delete Site.photoSlide.returnIndex;Fai.top.location.href="/index.jsp"};var q=[{name:n,base:window}];t=q.concat(s);jzUtils.run.apply(window,t)}}}else{Fai.top.location.href=a;return}}else{if(v.active){Site.memberInactiveDialog(v.mail,v.memName)}else{Site.showMemberLoginMsg(b,v.rt,v.captcha,j)}}}})};Site.mbLogining=false;Site.memberLogin2=function(b,l,n){Site.logDog(200061,2);if(typeof n!="object"){n=new Object()}if(Site.mbLogining){return}Site.mbLogining=true;var a=Fai.getUrlParam(Fai.top.location.href,"url");if(!a){a="./index.jsp"}var o=Fai.getUrlParam(Fai.top.location.href,"mid");var d=Fai.getUrlParam(Fai.top.location.href,"fid");var c=$("#module"+b);var k=$.trim(c.find(".memberAcctInput").val());var h=c.find(".memberPwdInput").val();var g=(c.find(".memberCaptcha").css("display")!="none");var i=c.find(".memberCaptchaInput").val();if(k==null||k==""){Site.showMemberLoginMsg(b,1,false,l);return}if(h==null||h==""){Site.showMemberLoginMsg(b,2,false,l);return}if(g&&(i==null||i=="")){Site.showMemberLoginMsg(b,3,false,l);return}h=$.md5(h);var m=c.find(".memberLoginMsg");m.show();m.find(".msgText").html(LS.memberLogining);var j=c.find(".memberLoginBtn");j.attr("disabled",true);var f=false;var e=c.find("#autoLogin"+b);if(e&&e.attr("checked")){f=true}$.ajax({type:"post",url:"ajax/login_h.jsp",data:"cmd=loginMember&acct="+Fai.encodeUrl(k)+"&pwd="+Fai.encodeUrl(h)+"&captcha="+Fai.encodeUrl(i)+"&autoLogin="+Fai.encodeUrl(f),error:function(){Site.mbLogining=false;j.removeAttr("disabled");Site.showMemberLoginMsg(b,-1,l)},success:function(z){Site.mbLogining=false;j.removeAttr("disabled");var z=jQuery.parseJSON(z);if(z.success){$("#_TOKEN").attr("value")||$("title").after(z._TOKEN);if(o!=null&&d!=null){$.cookie("_moduleid",o,{expires:1});$.cookie("_fileid",d,{expires:1})}if(!!n.skipUrl){a=n.skipUrl}if(n.isPhotoSlide){var q=a.split(";");for(var t=0;t<q.length-1;t++){var v=new RegExp("[^script:]");if(v.test(a)){var y=q[t].split(":"),p=y[1].indexOf("(")+1,s=y[1].lastIndexOf(")"),w=Array.prototype.slice.call(y[1].substring(p,s).split(",")),x=[],r=y[1].substring(0,p-1);Site.photoSlide.returnIndex=function(){delete Site.photoSlide.returnIndex;Fai.top.location.href="/index.jsp"};var u=[{name:r,base:window}];x=u.concat(w);jzUtils.run.apply(window,x)}}}else{Fai.top.location.href=a;return}}else{if(z.active){Site.memberInactiveDialog(z.mail,z.memName)}else{Site.showMemberLoginMsg(b,z.rt,z.captcha,l)}}}})};Site.memberLogin3=function(j){if(typeof j!="object"){j=new Object()}var a=Fai.getUrlParam(Fai.top.location.href,"url");if(!a){a="./index.jsp"}var b=$("#J_WebRightBar");var i=$.trim(b.find("#memberAcct").val());var f=b.find("#memberPwd").val();var e=(b.find(".rbar-captcha").css("display")!="none");var g=b.find(".memberLoginCaptcha").val();if(i==null||i==""){Fai.top.location.href="login.jsp?errno=1&url="+Fai.encodeUrl(a);return}if(f==null||f==""){Fai.top.location.href="login.jsp?errno=2&url="+Fai.encodeUrl(a)+"&acct="+Fai.encodeUrl(i);return}f=$.md5(f);var h=b.find(".memberLoginBtn");h.attr("disabled",true);var d=false;var c=b.find("#autoLoginRightBar");if(c&&c.attr("checked")){d=true}$.ajax({type:"post",url:"ajax/login_h.jsp",data:"cmd=loginMember&acct="+Fai.encodeUrl(i)+"&pwd="+Fai.encodeUrl(f)+"&captcha="+Fai.encodeUrl(g)+"&autoLogin="+Fai.encodeUrl(d),error:function(){Site.mbLogining=false;h.removeAttr("disabled");Fai.top.location.href="login.jsp?errno=-1&url="+Fai.encodeUrl(a)+"&acct="+Fai.encodeUrl(i)},success:function(k){Site.mbLogining=false;h.removeAttr("disabled");var k=jQuery.parseJSON(k);if(k.success){$("#_TOKEN").attr("value")||$("title").after(k._TOKEN);if(!!j.skipUrl){a=j.skipUrl}Fai.top.location.href=a;return}else{if(k.active){Site.memberInactiveDialog(k.mail,k.memName);return}if(k.captcha){Fai.top.location.href="login.jsp?errno="+k.rt+"&captcha="+k.captcha+"&url="+Fai.encodeUrl(a)+"&acct="+Fai.encodeUrl(i);return}else{Site.showMemberLoginMsg("webRightBar",k.rt,k.captcha,2)}}}})};Site.mbLogining=false;Site.memberLogin4=function(e,c,o,l,b,i){var a=Fai.getUrlParam(Fai.top.location.href,"url");if(!a){a="./index.jsp"}if(Site.mbLogining){return}Site.mbLogining=true;var d=$("#J_memberLoginDialogPanel");var n=$.trim(d.find("#memberAcct").val());var j=d.find("#memberPwd").val();var h=(d.find(".memberCaptcha").css("display")!="none");var k=d.find(".memberCaptchaInput").val();if(n==null||n==""){Fai.ing("帐号不能为空!");return}if(j==null||j==""){Fai.ing("密码不能为空!");return}if(h&&(k==null||k=="")){Fai.ing(LS.memberCaptchError);return}j=$.md5(j);var m=d.find(".memberLoginBtn");m.attr("disabled",true);var g=false;var f=d.find("#memberLoginDialogAutoLogin");if(f&&f.attr("checked")){g=true}$.ajax({type:"post",url:"ajax/login_h.jsp",data:"cmd=loginMember&acct="+Fai.encodeUrl(n)+"&pwd="+Fai.encodeUrl(j)+"&captcha="+Fai.encodeUrl(k)+"&autoLogin="+Fai.encodeUrl(g),error:function(){Site.mbLogining=false;m.removeAttr("disabled");Fai.top.location.href="login.jsp?errno=-1&url="+Fai.encodeUrl(a)+"&acct="+Fai.encodeUrl(n)},success:function(p){Site.mbLogining=false;m.removeAttr("disabled");var p=jQuery.parseJSON(p);if(p.success){$("#_TOKEN").attr("value")||$("title").after(p._TOKEN);if(l=="addCartItem"){var q={};q.pid=e;q.mid=c;q.url=o;q.opList=b;q.count=i;q.doWhat="add";$.cookie("isNeedAddCartItem",$.toJSON(q));Fai.top.location.reload()}else{if(l=="immeBuy"){var q={};q.pid=e;q.mid=c;q.url=o;q.opList=b;q.count=i;q.doWhat="buy";$.cookie("isNeedAddCartItem",$.toJSON(q));Fai.top.location.reload()}}return}else{if(p.active){Site.memberInactiveDialog(p.mail,p.memName);return}else{Site.showMemberLoginMsg("loginDialog",p.rt,p.captcha,2)}}}})};Site.showMemberLoginMsg=function(a,b,e,f){var c,d="",h="",i=false;if(a=="webRightBar"){c=$("#J_WebRightBar")}else{if(a=="loginDialog"){c=$("#J_memberLoginDialogPanel")}else{c=$("#module"+a)}}if(b==1){d=LS.memberInputAcct;c.find(".memberAcctInput").focus();h="memberLoginAcct"}else{if(b==2){d=LS.memberInputPwd;c.find(".memberPwdInput").focus();h="memberLoginPwd"}else{if(b==3){d=LS.memberInputCaptcha;h="memberLoginCaptcha"}else{if(b==11){d=LS.memberLoginFirst;i=true}else{if(b==12){d=LS.memberLoginSignup;i=true}else{if(b==13){d=LS.memberLoginToView;i=true}else{if(b==14){d=LS.memberLoginNoPermission;i=true}else{if(b==-3){d=LS.memberPwdError;h="memberLoginPwd"}else{if(b==-301){d=LS.memberCaptchError;h="memberLoginCaptcha"}else{if(b==-302){d=LS.memberAcctError;h="memberLoginAcct"}else{if(b==-303){d=LS.memberNoAuth;h="memberLoginAcct"}else{if(b==-305){d=LS.memberPwdError;h="memberLoginPwd"}else{d=LS.memberLoginError;i=true}}}}}}}}}}}}if(e&&a!="webRightBar"){c.find(".memberCaptcha").show();c.find(".memberCaptchaImg").attr("src","validateCode.jsp?"+Math.random()*1000);Site.memberLoginCompatibility(a)}if(i){Fai.ing(d,false);return}if(f==1){var g=c.find(".memberLoginMsg");g.show();g.find(".msgText").html(d)}if(f==2){var j={moduleId:"module"+a,targetId:h,tipText:d};if(a!="loginDialog"){if(a=="webRightBar"){j.moduleId="J_WebRightBar"}else{j.moduleId="module"+a}setTimeout(function(){Site.floatTip(j)},50)}else{Fai.ing(d)}}};Site.changeCaptchaImg=function(a,b){$(a).attr("src","validateCode.jsp?"+Math.random()*1000+"&validateCodeRegType="+b)};Site.wxListener={timer:"",winOpen:"",w_uid:"",c:0,wx_name:"",wx_avator:"",popupId:"",popupClose:false};Site.initWXLogin=function(d,a,e,c,f,h,b){a+="/wxLogin.jsp";$("#"+h).click(function(){if(Site.wxListener.c==0){Site.wxListener.winOpen=window.open("https://open.weixin.qq.com/connect/qrconnect?appid="+d+"&redirect_uri="+Fai.encodeUrl(a)+"&response_type=code&scope=snsapi_login#wechat_redirect","","height=525,width=585, toolbar=no, menubar=no, scrollbars=no, status=no, location=yes, resizable=yes");Site.wxListener.timer=window.setInterval("Site.wxWinListener('"+e+"', "+c+", "+f+", "+b+",3)",500);window.addEventListener("message",g,false);++Site.wxListener.c}});function g(i){var j=$.parseJSON(i.data);Site.wxListener.w_uid=j.uid;Site.wxListener.wx_name=j.wx_name;Site.wxListener.wx_avator=j.wx_avator;Site.wxListener.winOpen.close()}};Site.initNewWXLogin=function(c,b,d,e,a){$("#"+e).click(function(){var f={title:"微信登录",frameSrcUrl:Fai.top._siteDomain+"/newSiteWX.jsp",width:370,height:480,closeFunc:function(){$("body").css("overflow","")}};Site.wxListener.popupId=top.Fai.popupWindowVersionTwo.createPopupWindow(f).getPopupWindowId();var g=parseInt($("#popupWindow"+Site.wxListener.popupId).css("top"));$("#popupWindow"+Site.wxListener.popupId).css("top",g+$(document).scrollTop()+"px");Site.wxListener.timer=window.setInterval("Site.wxWinListener('"+c+"', "+b+", "+d+", "+a+",4)",500);$("body").css("overflow","hidden")})};Site.wxWinListener=function(h,c,d,k,g){if(Site.wxListener.popupClose==true||Site.wxListener.winOpen.closed==true){window.clearInterval(Site.wxListener.timer);Site.wxListener.c=0;Site.wxListener.popupClose=false;if(Site.wxListener.w_uid!=null&&Site.wxListener.w_uid!=""){var a=Fai.getUrlParam(Fai.top.location.href,"url");if(!a){a="./index.jsp"}var b=Site.checkHasMobileOption(h);h=jQuery.parseJSON(h);var j=false;if(h){for(var f=0;f<h.length;f++){if(h[f]["otherLoginMust"]){j=true;break}}}var e="loginType="+g+"&hasMobile="+b+"&otherLoginMust="+j+"&openId="+encodeURIComponent(Site.wxListener.w_uid);if(!j){e+="&avator="+encodeURIComponent(Site.wxListener.wx_avator)+"&name="+Site.wxListener.wx_name}$.ajax({type:"post",url:"ajax/login_h.jsp?cmd=otherLoginMember",data:e,error:function(){Fai.ing(LS.memberLoginError,true)},success:function(y){var y=jQuery.parseJSON(y);if(y.success){$("#_TOKEN").attr("value")||$("title").after(y._TOKEN);var m=$.cookie("forThirtLoginBuy");if(typeof m!="undefined"&&m!=null&&m!=""){var w=$.parseJSON(m);if(typeof w!="undefined"&&w!=null){if(w.where=="addCartItem"){var s={};s.pid=w.pid;s.mid=w.mid;s.url=w.url;s.opList=w.opList;s.count=w.count;s.doWhat="add";$.cookie("isNeedAddCartItem",$.toJSON(s));Fai.top.location.reload()}else{if(w.where=="immeBuy"){var s={};s.pid=w.pid;s.mid=w.mid;s.url=w.url;s.opList=w.opList;s.count=w.count;s.doWhat="buy";$.cookie("isNeedAddCartItem",$.toJSON(s));Fai.top.location.reload()}}}$.cookie("forThirtLoginBuy",null);return}if(!!k.skipUrl){a=k.skipUrl}if(k.isPhotoSlide){var n=a.split(";");for(var q=0;q<n.length-1;q++){var t=new RegExp("[^script:]");if(t.test(a)){var x=n[q].split(":"),l=x[1].indexOf("(")+1,p=x[1].lastIndexOf(")"),u=Array.prototype.slice.call(x[1].substring(l,p).split(",")),o=x[1].substring(0,l-1),v=[];Site.photoSlide.returnIndex=function(){delete Site.photoSlide.returnIndex;Fai.top.location.href="/index.jsp"};var r=[{name:o,base:window}];v=r.concat(u);jzUtils.run.apply(window,v)}}}else{Fai.top.location.href=a;return}}else{if(y.active){Site.memberInactiveDialog(y.mail,y.memName)}else{if(y.rt==-3){if((typeof(y.bindOtherAcct)!="undefined")&&y.bindOtherAcct){Site.memberOtherBindOrLogin(h,Site.wxListener.w_uid,g,y.mobileCtNameList,y.signNeenMobile,k)}else{Site.memberOtherLoginFill(h,Site.wxListener.w_uid,g,y.mobileCtNameList,y.signNeenMobile,k)}}else{if(y.rt==-303){Fai.ing(LS.memberNoAuth,true)}else{Fai.ing(LS.argsError,true)}}}}}})}}};Site.wbListener={timer:"",winOpen:"",w_uid:"",c:0,wb_name:"",wb_avator:""};Site.initWBLogin=function(h,a,d,c,e,g,b){$("#"+g).click(function(){if(Site.wbListener.c==0){Site.wbListener.winOpen=window.open("https://api.weibo.com/oauth2/authorize?client_id="+h+"&redirect_uri="+a+"/wbLogin.jsp&response_type=code","","height=525,width=585, toolbar=no, menubar=no, scrollbars=no, status=no, location=yes, resizable=yes");Site.wbListener.timer=window.setInterval("Site.wbWinListener('"+d+"', "+c+", "+e+", "+b+")",500);window.addEventListener("message",f,false);++Site.wbListener.c}});function f(i){var j=$.parseJSON(i.data);Site.wbListener.w_uid=j.uid;Site.wbListener.wb_name=j.name;Site.wbListener.wb_avator=j.w_avator;Site.wbListener.winOpen.close()}};Site.wbWinListener=function(g,c,d,j){if(Site.wbListener.winOpen.closed==true){window.clearInterval(Site.wbListener.timer);Site.wbListener.c=0;if(Site.wbListener.w_uid!=null&&Site.wbListener.w_uid!=""){var a=Fai.getUrlParam(Fai.top.location.href,"url");if(!a){a="./index.jsp"}var b=Site.checkHasMobileOption(g);g=jQuery.parseJSON(g);var h=false;if(g){for(var f=0;f<g.length;f++){if(g[f]["otherLoginMust"]){h=true;break}}}var e="loginType=2&hasMobile="+b+"&otherLoginMust="+h+"&openId="+encodeURIComponent(Site.wbListener.w_uid);if(!h){e+="&avator="+encodeURIComponent(Site.wbListener.wb_avator)+"&name="+Site.wbListener.wb_name}$.ajax({type:"post",url:"ajax/login_h.jsp?cmd=otherLoginMember",data:e,error:function(){Fai.ing(LS.memberLoginError,true)},success:function(x){var x=jQuery.parseJSON(x);if(x.success){$("#_TOKEN").attr("value")||$("title").after(x._TOKEN);var l=$.cookie("forThirtLoginBuy");if(typeof l!="undefined"&&l!=null&&l!=""){var v=$.parseJSON(l);if(typeof v!="undefined"&&v!=null){if(v.where=="addCartItem"){var r={};r.pid=v.pid;r.mid=v.mid;r.url=v.url;r.opList=v.opList;r.count=v.count;r.doWhat="add";$.cookie("isNeedAddCartItem",$.toJSON(r));Fai.top.location.reload()}else{if(v.where=="immeBuy"){var r={};r.pid=v.pid;r.mid=v.mid;r.url=v.url;r.opList=v.opList;r.count=v.count;r.doWhat="buy";$.cookie("isNeedAddCartItem",$.toJSON(r));Fai.top.location.reload()}}}$.cookie("forThirtLoginBuy",null);return}if(!!j.skipUrl){a=j.skipUrl}if(j.isPhotoSlide){var m=a.split(";");for(var p=0;p<m.length-1;p++){var s=new RegExp("[^script:]");if(s.test(a)){var w=m[p].split(":"),k=w[1].indexOf("(")+1,o=w[1].lastIndexOf(")"),t=Array.prototype.slice.call(w[1].substring(k,o).split(",")),n=w[1].substring(0,k-1),u=[];Site.photoSlide.returnIndex=function(){delete Site.photoSlide.returnIndex;Fai.top.location.href="/index.jsp"};var q=[{name:n,base:window}];u=q.concat(t);jzUtils.run.apply(window,u)}}}else{Fai.top.location.href=a;return}}else{if(x.active){Site.memberInactiveDialog(x.mail,x.memName)}else{if(x.rt==-3){if((typeof(x.bindOtherAcct)!="undefined")&&x.bindOtherAcct){Site.memberOtherBindOrLogin(g,Site.wbListener.w_uid,2,x.mobileCtNameList,x.signNeenMobile,j)}else{Site.memberOtherLoginFill(g,Site.wbListener.w_uid,2,x.mobileCtNameList,x.signNeenMobile,j)}}else{if(x.rt==-303){Fai.ing(LS.memberNoAuth,true)}else{Fai.ing(LS.argsError,true)}}}}}})}}};Site.qqPopupID="";Site.initQQLogin=function(g,a,d,c,e,f,b){Site.qqLoginPC(g,a,d,c,e,f,b)};Site.qqListener={timer:"",winOpen:"",q_uid:"",c:0,q_name:"",q_avator:"",q_recv:0};Site.qqLoginPC=function(h,a,d,c,e,g,b){$("#"+g).click(function(){if(Site.qqListener.c==0){Site.qqListener.winOpen=window.open("https://graph.qq.com/oauth2.0/authorize?client_id="+h+"&redirect_uri="+a+"/qqLoginPC.jsp&response_type=token&scope=all","","height=525,width=585, toolbar=no, menubar=no, scrollbars=no, status=no, location=yes, resizable=yes");Site.qqListener.timer=window.setInterval("Site.qqWinListenerPC('"+d+"', "+c+", "+e+", "+b+")",500);window.addEventListener("message",f,false);Site.qqListener.q_recv=0;++Site.qqListener.c}});function f(i){Site.qqListener.q_recv++;if(Site.qqListener.q_recv==1){var j=$.parseJSON(i.data);Site.qqListener.q_uid=j.uid;Site.qqListener.q_name=j.q_name;Site.qqListener.q_avator=j.q_avator;Site.qqListener.winOpen.close()}}};Site.qqWinListenerPC=function(g,c,d,j){if(Site.qqListener.winOpen.closed==true){window.clearInterval(Site.qqListener.timer);Site.qqListener.c=0;if(Site.qqListener.q_uid!=null&&Site.qqListener.q_uid!=""){var a=Fai.getUrlParam(Fai.top.location.href,"url");if(!a){a="./index.jsp"}var b=Site.checkHasMobileOption(g);g=jQuery.parseJSON(g);var h=false;if(g){for(var f=0;f<g.length;f++){if(g[f]["otherLoginMust"]){h=true;break}}}var e="loginType=1&hasMobile="+b+"&otherLoginMust="+h+"&openId="+encodeURIComponent(Site.qqListener.q_uid);if(!h){e+="&avator="+encodeURIComponent(Site.qqListener.q_avator)+"&name="+Site.qqListener.q_name}$.ajax({type:"post",url:"ajax/login_h.jsp?cmd=otherLoginMember",data:e,error:function(){Fai.ing(LS.memberLoginError,true)},success:function(x){var x=jQuery.parseJSON(x);if(x.success){$("#_TOKEN").attr("value")||$("title").after(x._TOKEN);var l=$.cookie("forThirtLoginBuy");if(typeof l!="undefined"&&l!=null&&l!=""){var v=$.parseJSON(l);if(typeof v!="undefined"&&v!=null){if(v.where=="addCartItem"){var r={};r.pid=v.pid;r.mid=v.mid;r.url=v.url;r.opList=v.opList;r.count=v.count;r.doWhat="add";$.cookie("isNeedAddCartItem",$.toJSON(r));Fai.top.location.reload()}else{if(v.where=="immeBuy"){var r={};r.pid=v.pid;r.mid=v.mid;r.url=v.url;r.opList=v.opList;r.count=v.count;r.doWhat="buy";$.cookie("isNeedAddCartItem",$.toJSON(r));Fai.top.location.reload()}}}$.cookie("forThirtLoginBuy",null);return}if(!!j.skipUrl){a=j.skipUrl}if(j.isPhotoSlide){var m=a.split(";");for(var p=0;p<m.length-1;p++){var s=new RegExp("[^script:]");if(s.test(a)){var w=m[p].split(":"),k=w[1].indexOf("(")+1,o=w[1].lastIndexOf(")"),t=Array.prototype.slice.call(w[1].substring(k,o).split(",")),n=w[1].substring(0,k-1),u=[];Site.photoSlide.returnIndex=function(){delete Site.photoSlide.returnIndex;Fai.top.location.href="/index.jsp"};var q=[{name:n,base:window}];u=q.concat(t);jzUtils.run.apply(window,u)}}}else{Fai.top.location.href=a;return}}else{if(x.active){Site.memberInactiveDialog(x.mail,x.memName)}else{if(x.rt==-3){if((typeof(x.bindOtherAcct)!="undefined")&&x.bindOtherAcct){Site.memberOtherBindOrLogin(g,Site.qqListener.q_uid,1,x.mobileCtNameList,x.signNeenMobile,j)}else{Site.memberOtherLoginFill(g,Site.qqListener.q_uid,1,x.mobileCtNameList,x.signNeenMobile,j)}}else{if(x.rt==-303){Fai.ing(LS.memberNoAuth,true)}else{Fai.ing(LS.argsError,true)}}}}}})}}};Site.memberOtherBindOrLogin=function(e,a,c,b,d,f){var g=parseInt(Math.random()*10000);if(c==1){avatorUrl=Site.qqListener.q_avator;loginName=Site.qqListener.q_name}else{if(c==2){avatorUrl=Site.wbListener.wb_avator;avatorSize=50;marginLeft=165;loginName=Site.wbListener.wb_name}else{if(c==3||c==4){avatorUrl=Site.wxListener.wx_avator;marginLeft=158;avatorSize=64;loginName=Site.wxListener.wx_name}}}var h=['<div style="width:100%; height:1px; font-size:0; background-color:#e3e2e8; margin-top:14px;"/>','<div id="bindOrLogin">','<div style="width:100px; height:100px; margin-top:38px; margin-left:153px; background-image:url(',avatorUrl,'); background-size:contain; border-radius:50%;"/>','<div style="font-size:14px; font-family:MiscosoftYaHei Regular;color:rgb(102,102,102); text-align:center; margin:25px auto 20px;">',loginName,"</div>",'<div style="text-align:center; margin-top:32px;">','<a hidefocus="true" class="formBtn" style="width:250px; height:40px; line-height:40px; background:#557ce1; font-size:14px; border-radius:30px;" href="javascript:;" onclick=\'Site.chooseBindAcct();return false;\'>'+LS.memberOtherLgnBindAcct+"</a>","</div>",'<div style="text-align:center; margin-top:25px;">','<a hidefocus="true" class="formBtn" style="width:249px; height:39px; border:1px solid #557ce1; line-height:40px; background:#FFFFFF;font-size:14px; border-radius:30px; color:#557ce1;" href="javascript:;" onclick=\'Site.otherLoginNow('+g+","+$.toJSON(e)+', "'+a+'", '+c+", "+$.toJSON(b)+", "+d+", "+$.toJSON(f)+");return false;'>"+LS.memberOtherLgnNow+"</a>","</div></div>",'<div id="bindAcctFirst" style="display:none;">','<div style="margin-top:60px;"><span style="padding-right:20px;margin-left:62px;font-size:14px;color:rgb(102,102,102);">'+LS.loginDialogAcct+' :</span><input type="text" id="bindUser" maxlength="50" style="width:200px;height: 32px;font-size: 12px;color: rgb(99,99,99);border: 1px solid #e3e2e8;text-indent: 6px;" /></div>','<div style="margin-top:20px;"><span style="padding-right:20px;margin-left:62px;font-size:14px;color:rgb(102,102,102);">'+LS.loginDialogPsw+' :</span><input type="password" id="bindPassword" autocomplete="off" maxlength="20" style="width:200px;height: 32px;font-size: 12px;color: rgb(99,99,99);border: 1px solid #e3e2e8;text-indent: 6px;" /></div>','<div id="oLoginTip" style="text-align:center;padding-top:6px;color:red;"></div>','<div style="text-align:center; margin-top:58px;">','<a hidefocus="true" class="formBtn" style="width:250px; height:40px; line-height:40px; background:#557ce1; font-size:14px; border-radius:30px;" href="javascript:;" onclick=\'Site.bindAcctFirst('+g+","+c+',"'+a+'",'+$.toJSON(f)+");return false;'>"+LS.memberOtherLgnBind+"</a>","</div>",'<div style="text-align:center; margin-top:25px;">','<a hidefocus="true" class="formBtn" style="width:249px; height:39px; border:1px solid #557ce1; line-height:40px; background:#FFFFFF; font-size:14px; border-radius:30px; color:#557ce1;" href="javascript:;" onclick=\'Site.returnBindOrLogin();return false;\'>'+LS.backingOut+"</a>","</div></div>"];h=h.join("");var i={boxId:g,boxName:"qqLogin",title:LS.memberOtherLgnModeChoice,htmlContent:h,width:406,height:475};Site.popupBox(i)};Site.chooseBindAcct=function(){$("#bindOrLogin").hide();$("#bindAcctFirst").show()};Site.returnBindOrLogin=function(){$("#bindAcctFirst").hide();$("#bindOrLogin").show()};Site.otherLoginNow=function(n,j,a,g,e,h,m){Fai.top.$("#popupBox"+n).remove();Fai.top.$("#popupBg"+n).remove();var d="cmd=otherAdd",c=$("#oLoginTip"),b={};var l=false;if(j){for(var f=0;f<j.length;f++){if(j[f]["otherLoginMust"]){l=true;break}}}if(!l){if(g==1){b.qqOpenId=a;b.headImgUrl=Site.qqListener.q_avator}else{if(g==2){b.sinaOpenId=a;b.headImgUrl=Site.wbListener.wb_avator}else{if(g==3){b.wxOpenId=a;b.headImgUrl=Site.wxListener.wx_avator}else{if(g==4){b.mobiWxOpenId=a;b.headImgUrl=Site.wxListener.wx_avator}}}}var k=!l;$.ajax({type:"post",url:"ajax/member_h.jsp?"+d,data:"info="+Fai.encodeUrl($.toJSON(b))+"&loginType="+g+"&loginNow="+k,error:function(){c.html(LS.memberSignupRegisterError)},success:function(C){var t=jQuery.parseJSON(C);if(t.success){$("#_TOKEN").attr("value")||$("title").after(C._TOKEN);var p=$.cookie("forThirtLoginBuy");if(typeof p!="undefined"&&p!=null&&p!=""){var B=$.parseJSON(p);if(typeof B!="undefined"&&B!=null){if(B.where=="addCartItem"){var w={};w.pid=B.pid;w.mid=B.mid;w.url=B.url;w.opList=B.opList;w.count=B.count;w.doWhat="add";$.cookie("isNeedAddCartItem",$.toJSON(w));Fai.top.location.reload()}else{if(B.where=="immeBuy"){var w={};w.pid=B.pid;w.mid=B.mid;w.url=B.url;w.opList=B.opList;w.count=B.count;w.doWhat="buy";$.cookie("isNeedAddCartItem",$.toJSON(w));Fai.top.location.reload()}}}$.cookie("forThirtLoginBuy",null);return}if(t.fromBind){Fai.top.$("#popupBg"+n).remove();Fai.top.$("#popupBox"+n).remove();Site.memberInactiveDialog(t.mail,t.memName)}else{if(t.active){Fai.top.$("#popupBg"+n).remove();Fai.top.$("#popupBox"+n).remove();cons;Site.memberActiveDialog(b.email,Fai.encodeUrl(b.acct),function(){Fai.top.location.href=url;Fai.top.event.returnValue=false})}else{if(!!m.skipUrl){url=m.skipUrl}if(m.isPhotoSlide){var q=url.split(";");for(var u=0;u<q.length-1;u++){var x=new RegExp("[^script:]");if(x.test(url)){var A=q[u].split(":"),o=A[1].indexOf("(")+1,s=A[1].lastIndexOf(")"),y=Array.prototype.slice.call(A[1].substring(o,s).split(",")),r=A[1].substring(0,o-1),z=[];Site.photoSlide.returnIndex=function(){delete Site.photoSlide.returnIndex;Fai.top.location.href="/index.jsp"};var v=[{name:r,base:window}];z=v.concat(y);jzUtils.run.apply(window,z)}}}else{Fai.top.location.href=url}}}}else{if(t.rt==-601){c.html(LS.reGetMobileCode)}else{if(t.rt==-8){c.html(LS.mobileHasSigned)}else{if(t.rt==-6){c.html(LS.memberSignupRegisterExisted)}else{if(t.rt==-4){c.html(LS.memberSignupRegisterLimit)}else{if(t.rt==-3){c.html(LS.memberDialogNotFound)}else{if(t.rt==Site.otherLoginErrno.acctAlreadyBind){c.html(LS.memberOtherLgnAcctAlreadyBind)}else{c.html(LS.memberSignupRegisterError)}}}}}}}}})}else{Site.memberOtherLoginFill(j,a,g,e,h,m)}};Site.bindAcctFirst=function(j,f,b,i){var e="cmd=bindAcct";var c=$("#oLoginTip");var d={};var h=$("#bindUser").val();var g=$("#bindPassword").val();if(h==null||h==""){c.html(LS.memberSignupRegisterAcctEmpty);$("#bindUser").focus();return}if(g==null||g==""){c.html(LS.memberSignupRegisterPwdEmpty);$("#bindPassword").focus();return}g=$.md5(g);d.acct=h;d.pwd=g;if(f==1){d.qqOpenId=b}else{if(f==2){d.sinaOpenId=b}else{if(f==3){d.wxOpenId=b}else{if(f==4){d.mobiWxOpenId=b}}}}var a=Fai.getUrlParam(Fai.top.location.href,"url");if(!a){a="./index.jsp"}$.ajax({type:"post",url:"ajax/member_h.jsp?"+e,data:"info="+Fai.encodeUrl($.toJSON(d))+"&loginType="+f,error:function(){c.html()},success:function(y){var p=jQuery.parseJSON(y);if(p.success){$("#_TOKEN").attr("value")||$("title").after(y._TOKEN);var l=$.cookie("forThirtLoginBuy");if(typeof l!="undefined"&&l!=null&&l!=""){var x=$.parseJSON(l);if(typeof x!="undefined"&&x!=null){if(x.where=="addCartItem"){var s={};s.pid=x.pid;s.mid=x.mid;s.url=x.url;s.opList=x.opList;s.count=x.count;s.doWhat="add";$.cookie("isNeedAddCartItem",$.toJSON(s));Fai.top.location.reload()}else{if(x.where=="immeBuy"){var s={};s.pid=x.pid;s.mid=x.mid;s.url=x.url;s.opList=x.opList;s.count=x.count;s.doWhat="buy";$.cookie("isNeedAddCartItem",$.toJSON(s));Fai.top.location.reload()}}}$.cookie("forThirtLoginBuy",null);return}if(p.fromBind){Fai.top.$("#popupBg"+j).remove();Fai.top.$("#popupBox"+j).remove();Site.memberInactiveDialog(p.mail,p.memName)}else{if(p.active){Fai.top.$("#popupBg"+j).remove();Fai.top.$("#popupBox"+j).remove();Site.memberActiveDialog(d.email,Fai.encodeUrl(d.acct),function(){Fai.top.location.href=a;Fai.top.event.returnValue=false})}else{if(!!i.skipUrl){a=i.skipUrl}if(i.isPhotoSlide){var m=a.split(";");for(var q=0;q<m.length-1;q++){var t=new RegExp("[^script:]");if(t.test(a)){var w=m[q].split(":"),k=w[1].indexOf("(")+1,o=w[1].lastIndexOf(")"),u=Array.prototype.slice.call(w[1].substring(k,o).split(",")),n=w[1].substring(0,k-1),v=[];Site.photoSlide.returnIndex=function(){delete Site.photoSlide.returnIndex;Fai.top.location.href="/index.jsp"};var r=[{name:n,base:window}];v=r.concat(u);jzUtils.run.apply(window,v)}}}else{Fai.top.location.href=a}}}}else{if(p.rt==-601){c.html(LS.reGetMobileCode)}else{if(p.rt==-8){c.html(LS.mobileHasSigned)}else{if(p.rt==-6){c.html(LS.memberSignupRegisterExisted)}else{if(p.rt==-4){c.html(LS.memberSignupRegisterLimit)}else{if(p.rt==-3){if(p.msg=="密码不正确"){c.html(LS.memberPwdError)}else{c.html(LS.memberDialogNotFound)}}else{if(p.rt==Site.otherLoginErrno.acctAlreadyBind){c.html(LS.memberOtherLgnAcctAlreadyBind)}else{c.html(LS.memberSignupRegisterError)}}}}}}}}})};Site.checkHasMobileOption=function(b){b=jQuery.parseJSON(b);var c=false;if(b){for(var a=0;a<b.length;a++){if(b[a]["fieldKey"]=="mobile"&&b[a]["otherLoginMust"]){c=true;break}}}return c};Site.memberOtherLoginFill=function(f,a,d,c,e,k){var l=parseInt(Math.random()*10000);var g="",j="",b=170,i=40;if(d==1){g=Site.qqListener.q_avator;j=Site.qqListener.q_name}else{if(d==2){g=Site.wbListener.wb_avator;i=50;b=165;j=Site.wbListener.wb_name}else{if(d==3||d==4){g=Site.wxListener.wx_avator;b=158;i=64;j=Site.wxListener.wx_name}}}var m=['<div style="width:100%; height:1px; font-size:0; background-color:#e3e2e8; margin-top:14px;"/>','<div style="width:100px; height:100px; margin-top:38px; margin-left:153px; background-image:url(',g,'); background-size:contain;"/>','<div style="padding:6px 2px;">','<div style="padding:5px 0; text-align:center;">','<div style="vertical-align:middle;font-size:14px;">',j,"</div>","</div>",'<table cellpadding="0" cellspacing="0" style="_margin:0 auto; margin-top:25px;">','<tr><td><input id="openId" type="password" autocomplete="off" disabled style="display:none;"/></td></tr>'];$.each(f,function(p,t){if(t.otherLoginMust){var s,r="width:200px;";if(t.fieldKey=="mobile"){r="width:103px;";s=[];s.push("<select id='mobileCt' name='mobileCt' style='width:60px;margin-left:5px;height:28px;font-size: 12px;color: rgb(99,99,99);border: 1px solid #e3e2e8;text-indent: 6px;' >");if(c){for(var o=0;o<c.length;o++){s.push("<option value='"+c[o]["ctName"]+"'>"+c[o]["ctShowName"]+c[o]["ctCode"]+"</option>")}}s.push("</select>");s.join("")}var q=[];q.push('<tr class="bindAcctHidn" style="display:block; margin-top:20px; width:400px;">');q.push('<td style="width:110px;_width:auto;text-align:right; color:rgb(99,99,99);font-size:12px;">'+t.name+":</td><td>");q.push(s);if(t.must){q.push('<input id="'+t.fieldKey+'" type="text" name="'+t.name+'" maxlength="50" placeholder="'+t.placeholder+'" class="userAddItem isCheckUAI" style="'+r+'height:30px; margin-left:5px;-webkit-border-radius:0;-moz-border-radius:0; border:1px solid #e3e2e8; text-indent:6px;"/>');q.push('<span style="font-size:14px; color:rgb(255,36,46); margin-left:5px;">*</span></td>')}else{q.push('<input id="'+t.fieldKey+'" type="text" name="'+t.name+'" maxlength="50" placeholder="'+t.placeholder+'" class="userAddItem " style="'+r+'height:30px; margin-left:5px;-webkit-border-radius:0;-moz-border-radius:0; border:1px solid #e3e2e8; text-indent:6px;"/>')}q.push("</tr>");m.push(q.join(""))}});if(e){m.push('<tr class="bindAcctHidn" style="display:block; margin-top:10px; width:400px;">');m.push('<td style="width:110px;_width:auto;text-align:right; color:rgb(99,99,99);font-size:12px;">'+LS.memberSignup_captcha+"</td>");m.push('<td><input id="memberSignupCaptcha" type="text" style="width:80px;margin-left:5px;height: 25px;font-size: 12px;color: rgb(99,99,99);border: 1px solid #e3e2e8;text-indent: 6px;" maxlength="4"/><div style="width:81px;height:25px;line-height:25px;float:right;text-align:center;color:red;"><img style="width:100%;height:100%;cursor:pointer;margin-left:10px;margin-top:2px;" alt="" id="memberSignupCaptchaImg" onclick="Site.changeCaptchaImg(this)" title="'+LS.msgBoradChageValidateCode+'" src="validateCode.jsp?'+Math.random()*1000+'"/></div></td>');m.push("</tr>");m.push('<tr class="bindAcctHidn" style="display:block; margin-top:10px; width:400px;">');m.push('<td style="width:110px;_width:auto;text-align:right; color:rgb(99,99,99);font-size:12px;">'+LS.mobileMsmCode+"</td>");m.push('<td><input type="text" style="width:80px;margin-left:5px;height: 25px;font-size: 12px;color: rgb(99,99,99);border: 1px solid #e3e2e8;text-indent:6px;" id="messageAuthCode" maxlength="6" /><div style="width:100px;height:25px;line-height:25px;float:right;text-align:center;margin-left:10px;margin-top:1px;" class="memberOtherSignup"><div title="'+LS.getMobileMsmCode+'" class="getMobileCdBtn" onclick="Site.getOtherSignMobileCode()">'+LS.getMobileMsmCode+"</div></div></td>");m.push("</tr>")}var h="";if(d==1){h=LS.memberOtherLgnQQMsg}else{if(d==2){h=LS.memberOtherLgnSinaMsg}else{if(d==3||d==4){h=LS.memberOtherLgnWXMsg}}}m.push("</table>");m.push('<div id="oLoginTip" style="text-align:center;padding-top:6px;color:red;"></div>');m.push('<div style="text-align:center; margin-top:32px;">');m.push('<a hidefocus="true" class="formBtn" style="width:250px; height:40px; line-height:40px; background:#1779ff; font-size:14px; border-radius:30px;" href="javascript:;" onclick=\'Site.memberOtherLoginSubmit('+l+',"'+j+'",'+d+","+$.toJSON(k)+");return false;'>"+LS.confirm+"</a>");m.push("</div></div>");m=m.join("");var n={boxId:l,boxName:"qqLogin",title:LS.memberOtherLgnAddTitle,htmlContent:m,width:406};Site.popupBox(n);$("#openId").val(a)};Site.getOtherSignMobileCode=function(){var a=Site.checkOtherGetMobileCodeParam();if(a.checkResult==true){$.ajax({type:"post",url:"ajax/member_h.jsp?cmd=getMobileCode",data:"mobile="+a.info.mobile+"&mobileCt="+a.info.mobileCt+"&validateCode="+a.info.captcha,error:function(){Fai.ing(LS.getMobileCodeErrAf,true)},success:function(b){var c=jQuery.parseJSON(b);if(c.success){Fai.ing(LS.sendMobileCodeSuc,true);Site.otherSignMobileCodeCountDown()}else{Site.changeCaptchaImg($("#memberSignupCaptchaImg")[0]);$("#memberSignupCaptcha").val("");if(c.rt==-401){Fai.ing(LS.memberSignupRegisterCaptchaNotMatch,true)}else{if(c.rt==-2){Fai.ing(LS.argsError,true)}else{if(c.rt==2){Fai.ing(LS.memberDialogSendMobileCodeErr,true)}else{if(c.rt==-4||c.rt==8){Fai.ing(LS.getMobileOneMin,true)}else{if(c.rt==-8){Fai.ing(LS.getMobileHalfHour,true)}else{if(c.rt==3){Fai.ing(LS.memberDialogMobileMoneyErr,true)}else{if(c.rt==9){Fai.ing(LS.memberDialogSendMobileCodeLimit,true)}else{if(c.rt==101){Fai.ing(LS.mobileSetErr,true)}else{if(c.rt==-6){Fai.ing(LS.mobileHasSigned,true)}else{if(c.rt==23){Fai.ing(LS.mobileNationTplErr,true)}else{Fai.ing(LS.getMobileRefresh,true)}}}}}}}}}}}}})}};Site.checkOtherGetMobileCodeParam=function(){var c={checkResult:false,info:{}};var a=$("#mobile").val();var b=$("#memberSignupCaptcha").val();if(!Fai.isNationMobile(a)){Fai.ing(LS.mobileNumRegular,true);return c}if(b==null||b==""){Fai.ing(LS.memberSignupRegisterCaptchaEmpty,true);return c}c.checkResult=true;c.info.mobile=a;if(a&&a!=null&&$.trim(a)!=""){c.info.mobileCt=$("#mobileCt").val()}else{c.info.mobileCt=""}c.info.captcha=b;return c};Site.otherSignMobileCodeCountDown=function(){var c=$(".getMobileCdBtn");var b=c.attr("cTime");var d=60;if(!b||b==null){b=0}else{b=parseInt(b);d=1800}b++;c.attr("cTime",b);c.attr("s_onclick",c.attr("onclick"));c.removeAttr("onclick");var a=setInterval(function(){d--;c.html(LS.reGetMsg+"("+d+")");if(d<=0){c.html(c.attr("title"));c.attr("onclick",c.attr("s_onclick"));clearInterval(a)}},1000)};Site.memberOtherLoginSubmit=function(p,c,n,o){var i="cmd=otherAdd",e=$("#oLoginTip"),f={};f.acct=c;if(n==1){f.qqOpenId=$("#openId").val();f.headImgUrl=Site.qqListener.q_avator}else{if(n==2){f.sinaOpenId=$("#openId").val();f.headImgUrl=Site.wbListener.wb_avator}else{if(n==3){f.wxOpenId=$("#openId").val();f.headImgUrl=Site.wxListener.wx_avator}else{if(n==4){f.mobiWxOpenId=Site.wxListener.w_uid;f.headImgUrl=Site.wxListener.wx_avator}}}}var k="",d="",m="",q=0,h="",l=0;$(".userAddItem").each(function(){userAddItemID=$(this).attr("id");m=$(this).val();k=$(this).attr("name");h=$(this).attr("maxlength");f[userAddItemID]=m;if(m.length>h){e.html(Fai.format(LS.memberSignupUserAddItemMaxLength,k,h));$(this).focus();q=1;return false}if(userAddItemID=="phone"&&m.length>0){if(!Fai.isPhone(m)){e.html(Fai.format(LS.memberSignupUserAddItemCorrect,k));$(this).focus();l=1;return false}}if(userAddItemID=="mobile"&&m.length>0){if(!Fai.isNationMobile(m)){e.html(LS.mobileNumRegular);l=1;return false}else{f.mobileCt=$("#mobileCt").val()}}});if(l==1){return}if(q==1){return}if(typeof($("#messageAuthCode").attr("maxlength"))!="undefined"&&$("#messageAuthCode").attr("maxlength")!=null){var j=$("#memberSignupCaptcha").val();if(typeof(j)=="undefined"||j==null||j==""){e.html(LS.memberInputCaptcha);return false}var a=$("#messageAuthCode").val();if(typeof(a)=="undefined"||a==null||a==""){e.html(LS.inputMobileCode);return false}f.messageAuthCode=a}var g=0;$("#popupBoxContent"+p+" .isCheckUAI").each(function(){userAddItemID=$(this).attr("id");m=$(this).val();k=$(this).attr("name");if(m==null||m==""){e.html(Fai.format(LS.memberSignupUserAddItemIsEmpty,k));$(this).focus();g=1;return false}if(userAddItemID=="email"&&m.length>0){if(!Fai.isEmail(m)){e.html(Fai.format(LS.memberSignupUserAddItemCorrect,k));$(this).focus();g=1;return false}}});if(g==1){return}e.html(LS.memberSignupRegisterIng);var b=Fai.getUrlParam(Fai.top.location.href,"url");if(!b){b="./index.jsp"}$.ajax({type:"post",url:"ajax/member_h.jsp?"+i,data:"info="+Fai.encodeUrl($.toJSON(f))+"&loginType="+n,error:function(){e.html(LS.memberSignupRegisterError)},success:function(F){var w=jQuery.parseJSON(F);if(w.success){$("#_TOKEN").attr("value")||$("title").after(F._TOKEN);var s=$.cookie("forThirtLoginBuy");if(typeof s!="undefined"&&s!=null&&s!=""){var E=$.parseJSON(s);if(typeof E!="undefined"&&E!=null){if(E.where=="addCartItem"){var z={};z.pid=E.pid;z.mid=E.mid;z.url=E.url;z.opList=E.opList;z.count=E.count;z.doWhat="add";$.cookie("isNeedAddCartItem",$.toJSON(z));Fai.top.location.reload()}else{if(E.where=="immeBuy"){var z={};z.pid=E.pid;z.mid=E.mid;z.url=E.url;z.opList=E.opList;z.count=E.count;z.doWhat="buy";$.cookie("isNeedAddCartItem",$.toJSON(z));Fai.top.location.reload()}}}$.cookie("forThirtLoginBuy",null);return}if(w.fromBind){Fai.top.$("#popupBg"+p).remove();Fai.top.$("#popupBox"+p).remove();Site.memberInactiveDialog(w.mail,w.memName)}else{if(w.active){Fai.top.$("#popupBg"+p).remove();Fai.top.$("#popupBox"+p).remove();Site.memberActiveDialog(f.email,Fai.encodeUrl(f.acct),function(){Fai.top.location.href=b;Fai.top.event.returnValue=false})}else{if(!!o.skipUrl){b=o.skipUrl}if(o.isPhotoSlide){var t=b.split(";");for(var x=0;x<t.length-1;x++){var A=new RegExp("[^script:]");if(A.test(b)){var D=t[x].split(":"),r=D[1].indexOf("(")+1,v=D[1].lastIndexOf(")"),B=Array.prototype.slice.call(D[1].substring(r,v).split(",")),u=D[1].substring(0,r-1),C=[];Site.photoSlide.returnIndex=function(){delete Site.photoSlide.returnIndex;Fai.top.location.href="/index.jsp"};var y=[{name:u,base:window}];C=y.concat(B);jzUtils.run.apply(window,C)}}}else{Fai.top.location.href=b}}}}else{if(w.rt==-601){e.html(LS.reGetMobileCode)}else{if(w.rt==-8){e.html(LS.mobileHasSigned)}else{if(w.rt==-6){e.html(LS.memberSignupRegisterExisted)}else{if(w.rt==-4){e.html(LS.memberSignupRegisterLimit)}else{if(w.rt==-3){e.html(LS.memberDialogNotFound)}else{if(w.rt==Site.otherLoginErrno.acctAlreadyBind){e.html(LS.memberOtherLgnAcctAlreadyBind)}else{e.html(LS.memberSignupRegisterError)}}}}}}}}})};Site.otherLoginErrno={acctAlreadyBind:1};Site.memberFdPwdStepOne=function(c){var d=parseInt(Math.random()*10000);var a=$.trim($("#module"+c+" .memberAcct").val());var e=["<div class='memberFdPwdStepOne' style='height:100%;'>","<div style='width:80px; height:1px; font-size:0; background-color:#44a5ff; margin-left:26px; float:left;' class='J_titleBlueLine'></div>","<div style='width:250px; height:1px; font-size:0; background-color:#dadada; margin-left:96px;'></div>","<div class='itemLine' style='margin-top:8px;'>","<div class='itemTitle' style='font-family:微软雅黑; font-size:14px; color:rgb(99,99,99); width:110px;'>",LS.memberDialogFwdAcct,"</div>","<div class='itemCtrl'><input type='text' id='macct' name='macct' style='-webkit-border-radius: 0; -moz-border-radius: 0; border:1px solid #e7e7e7; width:168px;height:30px;' class='acctInput' value='",Fai.encodeHtml(a),"'/></div>","</div>","<div class='itemLine'>","<div class='itemTitle'></div>","<div class='itemCtrl'><a hidefocus='true' class='formBtn' style='background:#1779ff; margin-left:50px;' href='javascript:;' onclick='Site.memberFdPwdStepTwo(",d,");return false;'>",LS.memberDialogNextStep,"</a></div>","</div>","</div>"];e=e.join("");var b={boxId:d,title:"<span class='J_fidnPwFirstTitle'>"+LS.memberDialogFwdStepOneTitle+"</span>",htmlContent:e,width:372,height:176,boxName:"memberFdPwd"};Site.popupBox(b);setTimeout(function(){var g=Fai.top.$("#popupBox"+d);var f=g.find(".J_fidnPwFirstTitle").width();g.find(".J_titleBlueLine").css("width",(f+10)+"px")},200)};Site.memberFdPwdStepTwo=function(b){var a=$.trim($("#macct").val());if(a==""){Fai.ing(LS.memberDialogPleaseEnterAcct,true);$("#macct").focus();return}$.ajax({type:"post",url:"ajax/member_h.jsp?cmd=getMAcctMail",data:"mAcct="+Fai.encodeUrl(a),error:function(){Fai.ing(LS.systemError,false)},success:function(q){var q=jQuery.parseJSON(q);if(q.success){if(!q.findPwByMobileOpen){if(q.noMail){var e=LS.memberDialogNoEmailMsg;Site.showModifyPwContMsg(e,b);return}}if(!q.findPwByMailOpen){if(q.mobile==null||q.mobile=="null"||""==q.mobile){var e=LS.memberDialogNoMobile;Site.showModifyPwContMsg(e,b);return}}if(q.noMail&&(q.mobile=="null"||""==q.mobile)){var e=LS.memberDialogNoMailMobile;Site.showModifyPwContMsg(e,b);return}if(q.noMail){q.findPwByMailOpen=false}if(q.mobile=="null"||""==q.mobile){q.findPwByMobileOpen=false}Fai.top.$("#popupBg"+b).remove();Fai.top.$("#popupBox"+b).remove();var k=parseInt(Math.random()*10000);var p="",g="",f="";var c="";if(Fai.isIE6()){g="position:relative;";f="top:5px;";c="height:355px"}else{g="position:absolute; top:30px;";f="top:-20px;";p="position:relative;margin-top:-20px;"}var m=["<div class='memberFdPwdStepTwo' style='height:90%;",g,"'>","<div class='J_btBlueLine' style='width:110px; height:1px; font-size:0; background-color:#44a5ff; margin-left:26px; position:absolute; z-index:1;",f,"'></div>","<div style='width:460px; height:1px; font-size:0; background-color:#dadada; margin-left:26px; position:absolute; ",f,"'></div>"];var h=[];if(q.findPwByMailOpen){if(q.noMail){h=["<div class='J_fdFwdByMailContent' style='"+c+"'>","<div class='memberFdPwdTwoMsg' style='color:#636363;font-family:微软雅黑;font-size:14px;font-weight:bold;position:relative;top:90px;left:70px;width:360px;'>",LS.memberShowNoMail+"<br>"+LS.memberDialogConMg,"</div>","<div class='memberDialogNoNumberTip'></div>","<div style='margin-top:35px;'><div class='itemTitle2' style='height:34px; width:173px;'></div><a hidefocus='true' style='background: #1779ff; width:166px; height:35px;position:relative;top:170px;' class='formBtn' href='javascript:;' onclick='Site.closeFdPwdBoxById(",k,");return false;'>",LS.confirm," </a></div>","</div>"]}else{h=["<div class='J_fdFwdByMailContent' style='",p,"'>","<div class='memberFdPwdTwoMsg'>","<div class='itemStepLine'>",LS.memberDialogFwdOneStep,"<a href='javascript:;' hidefocus='true' style='color:#ff6d00' id='memSendPwdCode' onclick='Site.sendMemberEmailPwdCode();return false;'>",LS.memberDialogClickHere,"</a><span id='menWaitMsg'></span>",Fai.format(LS.memberDialogFwdOneStepThirdMsg,q.mail),"</div>","<div class='itemStepLine'>",LS.memberDialogFwdTwoStep,"</div>","<div class='itemStepLine'>",LS.memberDialogFwdThreeStep,"</div>","</div>","<div style='height:26px; margin-top:30px;'><div class='itemTitle2' style='padding-top:3px; width:124px; font-family:微软雅黑; font-size:14px; color:rgb(99,99,99);'>",LS.memberDialogFwdMailCode,"</div><input type='text' id='memEmailCode' style='width:284px; height:26px; border: 1px solid #e7e7e7;-webkit-border-radius: 0; -moz-border-radius: 0px;'/></div>","<div style='display:none;'><div class='itemTitle2'></div><input type='text' id='memMailCodeSign' disabled/></div>","<div style='display:none;'><div class='itemTitle2'></div><input type='text' id='macct2' value='",Fai.encodeHtml(a),"' disabled/></div>","<div style='height:26px; margin-top:20px;'><div class='itemTitle2' style='padding-top:3px; width:124px; font-family:微软雅黑; font-size:14px; color:rgb(99,99,99);'>",LS.memberDialogFwd,"</div><input type='password' id='memPwd' style='width:284px; height:26px; border: 1px solid #e7e7e7;-webkit-border-radius: 0; -moz-border-radius: 0px;'/></div>","<div style='height:26px; margin-top:20px;'><div class='itemTitle2' style='padding-top:3px; width:124px; font-family:微软雅黑; font-size:14px; color:rgb(99,99,99);'>",LS.memberDialogFwd2,"</div><input type='password' id='memPwd2' style='width:284px; height:26px; border: 1px solid #e7e7e7;-webkit-border-radius: 0; -moz-border-radius: 0px;'/></div>","<div id='memPwdItemErrorWrap' style='display:none;padding:0 10px; margin-top:10px;text-align:center;'><span style='color:red;height:24px;line-height:24px;font-family:微软雅黑;font-size:14px;' id='memPwdItemError'></span></div>","<div style='margin-top:35px;'><div class='itemTitle2' style='height:34px; width:173px;'></div><a hidefocus='true' style='background: #1779ff; width:166px; height:35px;' class='formBtn' href='javascript:;' onclick='Site.memberFdPwdStepLast(",k,",",1,");return false;'>",LS.memberDialogNextStep," </a></div>","</div>"]}}var j=[];if(q.findPwByMobileOpen){var o="display:block;"+c;if(q.findPwByMailOpen){o="display:none;"+c}if(q.mobile=="null"||""==q.mobile){j=["<div class='J_fdFwdByMobileContent' style='"+o+"'>","<div class='memberFdPwdTwoMsg' style ='color:#636363;font-family:微软雅黑;font-size:14px;font-weight:bold;position:relative;top:90px;left:70px;width:360px;'>",LS.memberShowNoMobile+"<br>"+LS.memberDialogConMg,"</div>","<div class='memberDialogNoNumberTip'></div>","<div style='margin-top:35px;'><div class='itemTitle2' style='height:34px; width:173px;'></div><a hidefocus='true' style='background: #1779ff; width:166px; height:35px;position:relative;top:170px;' class='formBtn' href='javascript:;' onclick='Site.closeFdPwdBoxById(",k,");return false;'>",LS.confirm," </a></div>","</div>"]}else{var d="";if(!q.findPwByMailOpen||q.noMail){d="<div style='display:none;'><div class='itemTitle2'></div><input type='text' id='macct2' value='"+Fai.encodeHtml(a)+"' disabled/></div>"}j=["<div class='J_fdFwdByMobileContent' style='",o,p,"'>","<div class='memberFdPwdTwoMsg'>","<div class='itemStepLine'>",LS.memberDialogFwdOneStep,"<a href='javascript:;' hidefocus='true' style='color:#ff6d00' id='memSendMobilePwdCode' onclick='Site.sendMemberMobileCode();return false;'>",LS.memberDialogClickHere,"</a><span id='menMbWaitMsg'></span>",Fai.format(LS.memberDialogFwdByMobileOneStep,q.mobile),"</div>","<div class='itemStepLine'>",LS.memberDialogFwdByMobileSendStep,"</div>","<div class='itemStepLine'>",LS.memberDialogFwdThreeStep,"</div>","</div>","<div style='height:26px; margin-top:30px;'><div class='itemTitle2' style='padding-top:3px; width:124px; font-family:微软雅黑; font-size:14px; color:rgb(99,99,99);'>",LS.mobileCodeTip+" : &nbsp;","</div><input type='text' id='memMobileCode' maxlength='6' style='width:284px; height:26px; border: 1px solid #e7e7e7;-webkit-border-radius: 0; -moz-border-radius: 0px;'/></div>","<div style='display:none;'><div class='itemTitle2'></div><input type='text' id='memMobileCodeSign' disabled/></div>",d,"<div style='height:26px; margin-top:20px;'><div class='itemTitle2' style='padding-top:3px; width:124px; font-family:微软雅黑; font-size:14px; color:rgb(99,99,99);'>",LS.memberDialogFwd,"</div><input type='password' id='memPwdMb' style='width:284px; height:26px; border: 1px solid #e7e7e7;-webkit-border-radius: 0; -moz-border-radius: 0px;'/></div>","<div style='height:26px; margin-top:20px;'><div class='itemTitle2' style='padding-top:3px; width:124px; font-family:微软雅黑; font-size:14px; color:rgb(99,99,99);'>",LS.memberDialogFwd2,"</div><input type='password' id='memPwdMb2' style='width:284px; height:26px; border: 1px solid #e7e7e7;-webkit-border-radius: 0; -moz-border-radius: 0px;'/></div>","<div id='memPwdMbItemErrorWrap' style='display:none;padding:0 10px; margin-top:10px;text-align:center;'><span style='color:red;height:24px;line-height:24px;font-family:微软雅黑;font-size:14px;' id='memPwdMbItemError'></span></div>","<div style='margin-top:35px;'><div class='itemTitle2' style='height:34px; width:173px;'></div><a hidefocus='true' style='background: #1779ff; width:166px; height:35px;' class='formBtn' href='javascript:;' onclick='Site.memberFdPwdStepLast(",k,",",2,");return false;'>",LS.memberDialogNextStep," </a></div>","</div>"]}}Array.prototype.push.apply(m,h);Array.prototype.push.apply(m,j);m.push("</div>");m=m.join("");var i="";if(q.findPwByMailOpen){i="<span class='f-findPwSetHoverBox J_findPwByMailBox' onclick='Site.changeFdPwdShowTab(1, "+k+","+q.findPwByMailOpen+")'>"+LS.memberDialogMailTitle+"</span>"}if(q.findPwByMobileOpen){var l="";if(q.findPwByMailOpen){l="style='margin-left:30px;'"}i=i+"<span "+l+" class='f-findPwSetHoverBox J_findPwByMobileBox' onclick='Site.changeFdPwdShowTab(2, "+k+","+q.findPwByMailOpen+")'>"+LS.memberDialogMobileTitle+"</span>"}var n={boxId:k,title:i,htmlContent:m,width:510,height:437,boxName:"memberFdPwd"};Site.popupBox(n);setTimeout(function(){Site.changeFdPwdShowTab(1,k,q.findPwByMailOpen)},200)}else{if(q.notFound){Fai.ing(LS.memberDialogNotFound,true)}else{Fai.ing(LS.argsError,true)}}}})};Site.memberFdPwdStepLast=function(b,a){if(typeof(a)!="undefined"&&a==2){Site.memberFdPwdByMobileStepLast(b)}else{Site.memberFdPwdByMailStepLast(b)}};Site.sendMemberMobileCode=function(){if($("#memSendMobilePwdCode").data("_disable")){return}var a=$("#macct2").val();if(a==""){Fai.ing(LS.memberDialogPleaseEnterAcct,true);return}$.ajax({type:"post",url:"ajax/member_h.jsp?cmd=sendMemberPwdMobileCode",data:"memName="+Fai.encodeUrl(a),error:function(){$("#memSendMobilePwdCode").data("_disable",false);Fai.ing(LS.systemError,false)},success:function(b){$("#memSendMobilePwdCode").data("_disable",false);var b=jQuery.parseJSON(b);if(b.success){$("#memMobileCodeSign").val(b.mobileCodeSign);$("#memPwdMbItemErrorWrap").show();$("#memPwdMbItemError").html(LS.memberDialogSendMobileCode);$("#memSendMobilePwdCode").hide();$("#menMbWaitMsg").show();$("#menMbWaitMsg").text(Fai.format(LS.memberDialogCountDown,60));$("#menMbWaitMsg").data("_time",60);Site.memberMbDisableTimeout("memSendMobilePwdCode")}else{if(b.argErr){$("#memPwdMbItemErrorWrap").show();$("#memPwdMbItemError").html(LS.memberDialogSendMobileClose)}else{if(b.apiKeyNotFound){$("#memPwdMbItemErrorWrap").show();$("#memPwdMbItemError").html(LS.memberDialogYunPianErr)}else{if(b.tplNotFound){$("#memPwdMbItemErrorWrap").show();$("#memPwdMbItemError").html(LS.memberDialogMobileTplErr)}else{if(b.notFound){Fai.ing(LS.memberDialogNotFound,true)}else{if(b.limitOne){Fai.ing(LS.getMobileOneMin,true)}else{if(b.limitTwo){Fai.ing(LS.getMobileHalfHour,true)}else{if(b.noMoney){Fai.ing(LS.memberDialogMobileMoneyErr,true)}else{if(b.mobileErr){Fai.ing(LS.memberDialogSendMobileCodeErr,true)}else{if(b.sendLimit){Fai.ing(LS.memberDialogSendMobileCodeLimit,true)}else{if(b.mobileSysErr){Fai.ing(LS.memberDialogSendMobileSysErr,true)}else{if(b.tplNationErr){Fai.ing(LS.mobileNationTplErr,true)}else{if(b.systemErr){Fai.ing(LS.systemError,true)}else{Fai.ing(LS.argsError,true)}}}}}}}}}}}}}}});$("#memSendMobilePwdCode").data("_disable",true)};Site.memberFdPwdByMobileStepLast=function(f){var b=$("#macct2").val();if(b==""){Fai.ing(LS.memberDialogPleaseEnterAcct,true);return}var g;var d=$("#memMobileCode").val();var c=$("#memMobileCodeSign").val();var a=$("#memPwdMb").val();var h=$("#memPwdMb2").val();if(!c){g=LS.memberDialogSendMobileFirst}else{if(!d){g=LS.inputMobileCode}else{if(d.length!=6){g=LS.mobileNumRegular}else{if(!a){g=LS.memberDialogPleaseEnterPwd}else{if(!h){g=LS.memberDialogPleaseEnterPwd2}else{if(a!=h){g=LS.memberDialogPwdDifToPwd2}else{if(a.length<4||a.length>20){g=Fai.format(LS.memberDialogPwdLimit,4,20)}}}}}}}if(g){$("#memPwdMbItemErrorWrap").show();$("#memPwdMbItemError").html(g);return}$("#memPwdMbItemErrorWrap").show();$("#memPwdMbItemError").html(LS.memberDialogResetting);var e="memMobileCode="+Fai.encodeUrl(d)+"&memMobileCodeSign="+Fai.encodeUrl(c)+"&memPwd="+$.md5(a)+"&memName="+Fai.encodeUrl(b);$.ajax({type:"post",url:"ajax/member_h.jsp?cmd=setMemberPwdByMobileCode",data:e,error:function(){Fai.ing(LS.systemError,false)},success:function(i){var i=jQuery.parseJSON(i);if(i.success){Fai.top.$("#popupBg"+f).remove();Fai.top.$("#popupBox"+f).remove();var k=["<div style='padding-left:60px;'>","<div class='alertWarn memberFdPwdLastMsg' style='margin-top:17px;'>",LS.memberDialogReSetPwdSucess,"</div>","<div style='padding:10px 0 10px 30px; font-family:微软雅黑; font-size:14px; color:rgb(99,99,99);'>",LS.memberDialogFwdAcct,i.macct,"</div>","<a href='javascript:void(0);' class='formBtn popupBClose' style='margin-left:45px; margin-top:16px; background:#1779ff; width:166px; height:35px;'>",LS.login,"</a>","</div>"];k=k.join("");var j={htmlContent:k,width:372,height:176};Site.popupBox(j)}else{if(i.rt==1){$("#memMobileCodeSign").val("");$("#memPwdMbItemErrorWrap").show();$("#memPwdMbItemError").html(LS.reGetMobileCode)}else{if(i.notFound){Fai.ing(LS.memberDialogNotFound,true)}else{Fai.ing(LS.argsError,true)}}}}})};Site.sendMemberEmailPwdCode=function(){if($("#memSendMobilePwdCode").data("_disable")){return}var a=$("#macct2").val();if(a==""){Fai.ing(LS.memberDialogPleaseEnterAcct,true);return}$.ajax({type:"post",url:"ajax/mail_h.jsp?cmd=sendMemberPwdEmail",data:"memName="+Fai.encodeUrl(a),error:function(){$("#memSendPwdCode").data("_disable",false);Fai.ing(LS.systemError,false)},success:function(b){$("#memSendPwdCode").data("_disable",false);var b=jQuery.parseJSON(b);if(b.success){$("#memMailCodeSign").val(b.emailCodeSign);$("#memPwdItemErrorWrap").show();$("#memPwdItemError").html(LS.memberDialogSendMailSucess);$("#memSendPwdCode").hide();$("#menWaitMsg").show();$("#menWaitMsg").text(Fai.format(LS.memberDialogCountDown,60));$("#menWaitMsg").data("_time",60);Site.memberDisableTimeout("memSendPwdCode",1)}else{if(b.aliasNotF){$("#memPwdItemErrorWrap").show();$("#memPwdItemError").html(LS.memberDialogAliasNotFound)}else{if(b.notFound){Fai.ing(LS.memberDialogNotFound,true)}else{if(b.smtpErr){Fai.ing(LS.smtpErr,true)}else{Fai.ing(LS.argsError,true)}}}}}});$("#memSendPwdCode").data("_disable",true)};Site.memberFdPwdByMailStepLast=function(f){var d=$("#macct2").val();if(d==""){Fai.ing(LS.memberDialogPleaseEnterAcct,true);return}var g;var b=$("#memEmailCode").val();var c=$("#memMailCodeSign").val();var a=$("#memPwd").val();var h=$("#memPwd2").val();if(!c){g=LS.memberDialogPleaseSendCode}else{if(!b){g=LS.memberDialogPleaseEnterCode}else{if(!a){g=LS.memberDialogPleaseEnterPwd}else{if(!h){g=LS.memberDialogPleaseEnterPwd2}else{if(a!=h){g=LS.memberDialogPwdDifToPwd2}else{if(a.length<4||a.length>20){g=Fai.format(LS.memberDialogPwdLimit,4,20)}}}}}}if(g){$("#memPwdItemErrorWrap").show();$("#memPwdItemError").html(g);return}$("#memPwdItemErrorWrap").show();$("#memPwdItemError").html(LS.memberDialogResetting);var e="memEmailCode="+Fai.encodeUrl(b)+"&memMailCodeSign="+Fai.encodeUrl(c)+"&memPwd="+$.md5(a)+"&memName="+Fai.encodeUrl(d);$.ajax({type:"post",url:"ajax/member_h.jsp?cmd=setMemberPwdByCode",data:e,error:function(){Fai.ing(LS.systemError,false)},success:function(i){var i=jQuery.parseJSON(i);if(i.success){Fai.top.$("#popupBg"+f).remove();Fai.top.$("#popupBox"+f).remove();var k=["<div style='padding-left:60px;'>","<div class='alertWarn memberFdPwdLastMsg' style='margin-top:17px;'>",LS.memberDialogReSetPwdSucess,"</div>","<div style='padding:10px 0 10px 30px; font-family:微软雅黑; font-size:14px; color:rgb(99,99,99);'>",LS.memberDialogFwdAcct,i.macct,"</div>","<a href='javascript:void(0);' class='formBtn popupBClose' style='margin-left:45px; margin-top:16px; background:#1779ff; width:166px; height:35px;'>",LS.login,"</a>","</div>"];k=k.join("");var j={htmlContent:k,width:372,height:176};Site.popupBox(j)}else{if(i.rt==1){$("#memMailCodeSign").val("");$("#memPwdItemErrorWrap").show();$("#memPwdItemError").html(LS.memberDialogCodeMailFailure)}else{if(i.notFound){Fai.ing(LS.memberDialogNotFound,true)}else{Fai.ing(LS.argsError,true)}}}}})};Site.memberInactiveDialog=function(a,c){var d=["<div class='formPanel'>","<div class='itemLine2 reActWarn'>",LS.memberDialogAcctInactive,"</div>","<div class='itemLine2'>",Fai.format(LS.memberDialogShowLoginMail,a),"</div>","<div class='itemLine2 reActWarn'>",LS.memberDialogNoRevSureEmail,"</div>","<div class='itemLine2' style='padding-top:0;padding-bottom:0;'>",LS.memberDialogPleaseConfirmYourMail,"<input type='text' id='memEmail' class='memEmailAlterInput' value='",a,"'/><a id='memSendMail' hidefocus='true' onclick='Site.memberSendActiveMail(\"",Fai.encodeHtml(c),"\");' href='javascript:void(0);'>",LS.memberDialogClickReSendMsg,"</a><span id='menWaitMsg'></span></div>","<div class='itemLine2' id='showOKorErrorMsg' style='color:red;'></div>","</div>"];d=d.join("");var b={title:LS.memberDialogTips,htmlContent:d,width:465,height:226};Site.popupBox(b)};Site.memberActiveDialog=function(a,c,e){var d=["<div class='formPanel'>","<div class='itemLine2 reActWarn'>",LS.memberDialogRegSuccess,"</div>","<div class='itemLine2'>",Fai.format(LS.memberDialogShowLoginMail,a),"</div>","<div class='itemLine2 reActWarn'>",LS.memberDialogNoRevSureEmail,"</div>","<div class='itemLine2' style='padding-top:0;padding-bottom:0;'>",LS.memberDialogPleaseConfirmYourMail,"<input type='text' id='memEmail' class='memEmailAlterInput' value='",a,"'/><a id='memSendMail' hidefocus='true' onclick='Site.memberSendActiveMail(\"",Fai.encodeHtml(c),"\");' href='javascript:void(0);'>",LS.memberDialogClickReSendMsg,"</a><span id='menWaitMsg'></span></div>","<div class='itemLine2' id='showOKorErrorMsg' style='color:red;'></div>","</div>"];d=d.join("");var b={title:LS.memberDialogActiveAcctTitle,htmlContent:d,width:465,height:226,closeFunc:e};Site.popupBox(b);$.ajax({type:"post",url:"ajax/mail_h.jsp?cmd=sendMemberActiveMail",data:"memName="+Fai.encodeUrl(c)+"&memEmail="+a,error:function(){Fai.ing(LS.systemError,false)},success:function(f){}})};Site.memberSendActiveMail=function(b){if($("#memSendMail").data("_disable")){return}var a=$.trim($("#memEmail").val());if(!Fai.isEmail(a)){Fai.ing(LS.memberDialogPleaseSureMail,true);return}$.ajax({type:"post",url:"ajax/mail_h.jsp?cmd=sendMemberActiveMail",data:"memName="+Fai.encodeUrl(b)+"&memEmail="+a,error:function(){$("#memSendMail").data("_disable",false);Fai.ing(LS.systemError,false)},success:function(c){$("#memSendMail").data("_disable",false);var c=jQuery.parseJSON(c);if(c.success){Fai.top.$("#showOKorErrorMsg").html(LS.memberDialogOKorErrorMsg);Fai.top.$("#memSendMail").hide();Fai.top.$("#menWaitMsg").show();Fai.top.$("#menWaitMsg").text(Fai.format(LS.memberDialogAfterTimeToResend,60));Fai.top.$("#menWaitMsg").data("_time",60);Site.memberDisableTimeout("memSendMail",0)}else{if(c.AliaNotF){$("#showOKorErrorMsg").html(LS.memberDialogAliasNotFound);$("#showOKorErrorMsg").show()}}}});$("#memSendMail").data("_disable",true)};Site.memberDisableTimeout=function(d,b){var c=Fai.top.$("#menWaitMsg");var a=parseInt(c.data("_time"));if(a>0){a--;setTimeout(function(){var e=LS.memberDialogAfterTimeToResend;if(b==1){e=LS.memberDialogCountDown}c.text(Fai.format(e,a));Site.memberDisableTimeout(d,b)},1000);$("#menWaitMsg").data("_time",a)}else{Fai.top.$("#"+d).show();c.text("").hide()}};Site.memberMbDisableTimeout=function(c){var b=Fai.top.$("#menMbWaitMsg");var a=parseInt(b.data("_time"));if(a>0){a--;setTimeout(function(){var d=LS.memberDialogCountDown;b.text(Fai.format(d,a));Site.memberMbDisableTimeout(c)},1000);$("#menMbWaitMsg").data("_time",a)}else{Fai.top.$("#"+c).show();b.text("").hide()}};Site.closeFdPwdBoxById=function(a){Fai.top.$("#popupBg"+a).remove();Fai.top.$("#popupBox"+a).remove()};Site.showModifyPwContMsg=function(d,b){var c=["<div>","<div style='padding:8px 26px;text-align:center;height:60px;'>",d,"</div>","<a href='javascript:void(0);' class='formBtn popupBClose' style='margin-left:128px;'>",LS.confirm,"</a>","</div>"];c=c.join("");var a={htmlContent:c,width:378,height:120};Site.popupBox(a);Fai.top.$("#popupBg"+b).remove();Fai.top.$("#popupBox"+b).remove()};Site.changeFdPwdShowTab=function(b,c,e){if(!e){b=2}if(b==1){var d=Fai.top.$("#popupBox"+c);var a=d.find(".J_findPwByMailBox").width();d.find(".J_findPwByMailBox").css("color","#44A5FF");d.find(".J_findPwByMobileBox").css("color","");if(typeof(a)!="undefined"&&a>0){d.find(".J_btBlueLine").css({width:((a+10)+"px"),"margin-left":"26px"})}d.find(".J_fdFwdByMobileContent").css("display","none");d.find(".J_fdFwdByMailContent").css({display:"block"})}else{if(b==2){var d=Fai.top.$("#popupBox"+c);d.find(".J_findPwByMobileBox").css("color","#44A5FF");d.find(".J_findPwByMailBox").css("color","");var a=d.find(".J_findPwByMobileBox").width();var f=d.find(".J_findPwByMailBox").width();if(typeof(a)!="undefined"&&a>0){if(f<=0){f=f+26}else{f=f+56}d.find(".J_btBlueLine").css({width:((a+15)+"px"),"margin-left":(f+"px")})}d.find(".J_fdFwdByMailContent").css("display","none");d.find(".J_fdFwdByMobileContent").css({display:"block"})}}};Site.initModuleBdMap=function(b,e,a,d){var k=Fai.top.$("#mapframe"+e);var j=k.attr("width");var i=k.attr("height");var l="<iframe id='mapframe"+e+"' class='J_mapframe' name='mapframe' frameborder='0' scrolling='no' height='"+i+"' width='"+j+"' src='about:blank'></iframe>";k.replaceWith(l);var c=Fai.top.$("#mapframe"+e).parent().width();var m=a+c+"&ran="+Math.random();Site.initIframeLoading(b,e,m,d);$("#refreshChlid"+e).css("padding-top","40%");var g=Fai.top.$("#module"+e);var h=g.width()/2-30;var f='<div class="coverDiv" style="position:absolute;width:66px;height:38px;left:'+h+'px;top:0;z-index:9028;"></div>';g.append(f)};Site.initModuleSiteSearch=function(a){var c=$("#module"+a),h=$(c.find("input.g_itext")[0]),d=$(c.find(".g_btn")[0]);h.keypress(function(k){if(k.keyCode==13&&d.length>0){d[0].click()}});var b=$("#module"+a);var f=b.find(".searchBox").attr("class");var g=b.find(".recommandKeyBox");if(f=="searchBox"){g.css("vertical-align","7px")}else{g.css("vertical-align","11px")}if(Fai.isIE6()||Fai.isIE7()||Fai.isIE8()){var e=c.find(".fk-newSearchBoxContainer");if(e){var j=e.height();c.find(".fk-newSearchInput").css({"line-height":j+"px",height:j+"px"})}}var i=Fai.getHashParam(Fai.top.location.hash,"skeyword");if(i&&i!=""){c.find(".fk-newSearchInput").val(i)}};Site.searchInSite=function(d){var e=$("#module"+d),c,b,a;if(e.find(".fk-newSearchBox").length){c=e.find(".fk-newSearchInput")}else{c=e.find("input.g_itext")}b=c.val();a=c.attr("_nSL");if(c.attr("_searching")){return}if($.trim(b)==""){Fai.ing("请输入搜索内容",true);return}if(Fai.isPC()){c.attr("_searching",true)}Fai.top.location.href="sr.jsp?skeyword="+Fai.encodeUrl($.trim(b))+"&nSL="+a};Site.searchInSiteByKey=function(e,g,d){var f=$("#module"+e),c,b,a;if(f.find(".fk-newSearchBox").length){c=f.find(".fk-newSearchInput")}else{c=f.find("input.g_itext")}a=c.attr("_nSL");href="sr.jsp?skeyword="+Fai.encodeUrl($.trim(g))+"&nSL="+a;if(c.attr("_searching")){return}if(Fai.isPC()){c.attr("_searching",true)}if(Fai.top._manageMode){Site.redirectUrl(href,"_self",d,1,0)}else{Fai.top.location.href=href}};Site.searchMenu={};Site.initSearchDropMenu=function(a,i){i=$.parseJSON(i);var e=(!Fai.top._oem&&Fai.top._closePhotoDetailEditSettings)?(Fai.top._siteSeachRangeLength-3):Fai.top._siteSeachRangeLength;if(i.length>=e){return}var g=$("#module"+a),h=g.find(".fk-openSearchMenu"),b=[0,1,2,3,4,5,6,7,8],d=b,f=[{id:4,name:"site",value:LS.searchMenuSite,enable:true,nSL:[]},{id:1,name:"product",value:LS.searchMenuProduct,enable:false,nSL:[3,4,5,6,7,8]},{id:2,name:"article",value:LS.searchMenuArticle,enable:false,nSL:[0,1,2,5,6,7,8]},{id:3,name:"gallery",value:LS.searchMenuPhoto,enable:false,nSL:[0,1,2,3,4,8]}],c;if(i.length>0){$.each(i,function(j,k){var l=$.inArray(k,d);if(l>-1){d.splice(l,1)}})}$.each(d,function(j,k){if(k>=0&&k<=2){f[1].enable=true}else{if(k>=3&&k<=4){f[2].enable=true}else{if(k>=5&&k<=7){f[3].enable=true}}}});$.each(f,function(j,k){if(k.enable){c=uniqueNslArray(k.nSL.concat(i));h.find(".fk-newSearchInput").attr("_nsl",$.toJSON(c));h.find(".fk-searchMenuWord").text(k.value);h.find(".fk-newSearchSelectMenu").attr("_selectItem",k.id);return false}});Site.searchMenu["module"+a]=new NewSearchMenu(a,f,i);Site.searchMenu["module"+a].bindMenuDropEvent()};function uniqueNslArray(b){var d=[],c=0,a=b.length;for(c=0;c<a;c++){if(b.indexOf(b[c])!=-1){d.push(b[c])}}return d}function NewSearchMenu(c,a,b){this.id=c;this.openMenuList=a;this.noSearchList=b}NewSearchMenu.prototype.initSearchMenuDom=function(b){var a=[];a.push("<div id='J_newSearchSelectMenu"+this.id+"' class='J_newSearchSelectMenu fk-newSearchSelectMenu"+this.id+"' style='display:none;'>");a.push("<div class='fk-newSearchSelectMenuShow fk-newSearchPanel"+b+"'>");$.each(this.openMenuList,function(c,d){if(d.enable){a.push("<span class='fk-searchMenuKeyWord J_searchMenuItem"+d.id+" fk-"+d.name+"SearchMenu' _nsl='["+d.nSL+"]' _val='"+d.id+"'>"+d.value+"</span>\n")}});a.push("</div>\n");a.push("</div>\n");return a.join("")};NewSearchMenu.prototype.getMenuPanelPosition=function(){var g=$("#module"+this.id),h=g.find(".fk-openSearchMenu"),a=h.attr("_borderwidth"),b=h.attr("_bordertype"),e,i,d,f,c,j;if(b==0){c=1}else{if(b==1){c=0}else{c=a}}if(h.length>0){j=h.attr("_type")}if(j==10){h=h.find(".fk-newSearchSelectMenu")}e=h.offset().left;i=h.offset().top;d=h.outerHeight();if(j==10){f=h.width()-c}else{f=h.find(".fk-newSearchSelectMenu").width()}if(!Fai.top._manageMode){i-=$(window).scrollTop();e-=$(window).scrollLeft()}return{left:e,top:i+d,width:(j==1||j==8||j==3||j==5||j==2||j==9||j==7)?++f:f}};NewSearchMenu.prototype.setMenuPanelPosition=function(h){var g=this.getMenuPanelPosition(),e=g.left,i=g.top,b=g.width,a=this.id,j=$("#module"+a),l=j.find(".fk-openSearchMenu"),k=j.find(".fk-newSearchSelectWrap"),m=j.find(".fk-newSearchSelectMenu"),d=h.find(".fk-newSearchSelectMenuShow"),c=k.css("border-bottom-width").replace("px",""),f=m.css("border-bottom-width").replace("px","");if(h.length){if(j.find(".fk-dynamicSearch").length){if(j.find(".fk-newSearchBox7").length){i=i-4;h.find(".fk-searchMenuKeyWord").css("padding-left","18px")}else{b=b-2;d.css({marginTop:"10px",padding:"10px 0"})}}else{if(j.find(".fk-newSearchBox2").length){i-=parseInt(l.attr("_borderWidth")||1)}else{if(j.find(".fk-newSearchBox9").length){i-=parseInt(l.attr("_borderWidth")||3)}else{if(j.find(".fk-newSearchBox8").length){i-=f}else{if(j.find(".fk-newSearchBox1").length){i-=c}}}}}if(j.parent().hasClass("leftForms")||j.parent().hasClass("rightForms")||j.parent().hasClass("middleLeftForms")||j.parent().hasClass("middleRightForms")){h.find(".fk-searchMenuKeyWord").css("padding-left","12px")}d.width(b+"px");h.css({position:"fixed",left:e,top:i,"z-index":1001})}};NewSearchMenu.prototype.foldSelectMenuPanel=function(){var k=this.id,d=$("#module"+k),o=d.find(".fk-openSearchMenu"),b=o.find(".fk-newSearchSelectMenu"),n=o.find(".fk-newSearchBoxContainer"),c=n.find(".fk-searchMenuSplitLine"),e,r,l,f,q,m=this,h,j,g,a,i,p;r=$("#J_newSearchSelectMenu"+m.id);l=b.attr("_status");f=(l=="fold")?true:false;h=o.attr("_type");j=o.attr("_styleColor");_usethemecolor=o.attr("_usethemecolor");j=(_usethemecolor==1)?(Fai.top._useTempThemeColor||j):j;bgColor=o.attr("_bgColor");a=o.attr("_bordercolor");borderWidth=o.attr("_borderwidth");borderType=o.attr("_bordertype");borderStyle=o.attr("_borderstyle");g=b.attr("_selectItem");e=$(this.initSearchMenuDom(h));i=a?a:j,styleName=changeSearchBorderStyle(borderStyle);if(borderWidth){p=borderWidth}else{p=(h==1)?2:1}if(f){if(!r.length){if(h==2||h==7){fixSelectMenuStyle(h,f,k)}else{if(h==10){o.css("border-bottom-right-radius","0")}}$("#g_main").append(e);r=$("#J_newSearchSelectMenu"+m.id);m.setMenuPanelPosition(r);o.addClass("fk-searchShowMenu");m.bindMenuPanelSpanEvent();r.slideDown("200");b.attr("_status","unfold").data("inMenu",false).data("inPanel",false);b.find(".fk-searchMenuImgArrow").removeClass("fk-searchMenuFold").addClass("fk-searchMenuUnfold");c=d.find(".fk-searchShowMenu .fk-searchMenuSplitLine");if((h==3||h==8||h==2||h==5||h==9||h==10||h==7)&&borderType==2){c.css("border-left-style",styleName);c.css("border-left-color",i);c.css("border-left-width",p+"px")}if((h==1||h==5)&&borderType!=1){c.css("border-left-style",styleName);c.css("border-left-color",i);c.css("border-left-width",p+"px");r.find(".fk-newSearchSelectMenuShow").css("border-color",i)}r.find(".J_searchMenuItem"+g).css("color",j).addClass("J_selectThisKeyWord");r.find(".fk-newSearchSelectMenuShow").css("background-color",bgColor)}}};function changeSearchBorderStyle(b){var a="solid";if(b==2){a="dashed"}else{if(b==1){a="dotted"}}return a}NewSearchMenu.prototype.unfoldSelectMenuPanel=function(){var b=this.id,i=$("#module"+b),k=i.find(".fk-openSearchMenu"),j=k.find(".fk-newSearchSelectWrap"),d=k.find(".fk-searchMenuSplitLine"),l=k.find(".fk-newSearchSelectMenu"),g=k.find(".fk-searchBoxBtn"),e,h,c,a,f=this,m;e=$("#J_newSearchSelectMenu"+f.id);h=l.attr("_status");c=(h=="fold")?true:false;a=(l.data("inPanel")||l.data("inMenu"))?true:false;m=k.attr("_type"),borderWidth=parseInt(k.attr("_borderWidth")),borderType=parseInt(k.attr("_borderType"));if(!c&&!a){l.attr("_status","fold");l.find(".fk-searchMenuImgArrow").removeClass("fk-searchMenuUnfold").addClass("fk-searchMenuFold");e.slideUp("200",function(){e.remove();if(m==2||m==7){fixSelectMenuStyle(m,c,b)}else{if(m==10){k.css("border-bottom-right-radius","5px")}}if(m==1||m==3||m==8||m==2||m==5||m==9||m==10||m==7){d.css("border-left-color","");d.css("border-left-width","");d.css("border-left-style","")}k.removeClass("fk-searchShowMenu")})}};function fixSelectMenuStyle(d,b,g){var e=$("#module"+g),c=e.find(".fk-openSearchMenu"),a=c.find(".fk-newSearchSelect"),f=(d==2)?c:a;if(b){f.css({borderTopLeftRadius:"5px",borderBottomLeftRadius:"5px"})}else{f.css({borderTopLeftRadius:"40px",borderBottomLeftRadius:"40px"})}}NewSearchMenu.prototype.bindMenuDropEvent=function(){var d=this.id,k=$("#module"+d),m=k.find(".fk-openSearchMenu"),l=m.find(".fk-newSearchSelectWrap"),n=m.find(".fk-newSearchSelectMenu"),h=m.find(".fk-searchBoxBtn"),f,j,e,c,g=this,i=m.attr("_type"),a=parseInt(m.attr("_borderWidth")),b=parseInt(m.attr("_borderType"));n.unbind("mouseenter.foldpMenu").bind("mouseenter.foldpMenu",function(){if(Fai.isIE8()){return}f=$("#J_newSearchSelectMenu"+g.id);j=n.attr("_status");e=(j=="fold")?true:false;if(e){g.foldSelectMenuPanel()}n.data("inMenu",true)});n.unbind("mouseleave.unfoldMenu").bind("mouseleave.unfoldMenu",function(){if(Fai.isIE8()){return}setTimeout(g.unfoldSelectMenuPanel.bind(g),200);n.data("inMenu",false)});if(Fai.isIE8()){n.unbind("click.unfoldMenu").bind("click.unfoldMenu",function(){Fai.ing("下拉选择不能支持当下浏览器,请更新浏览器后再使用。",false)})}if(Fai.top._manageMode){Fai.top.$("#g_main").unbind("scroll.srcollSc").bind("scroll.srcollSc",function(o){$(".J_newSearchSelectMenu").hide()})}else{Fai.top.$(window).unbind("scroll.srcollSc").bind("scroll.srcollSc",function(o){$(".J_newSearchSelectMenu").hide()})}};NewSearchMenu.prototype.bindMenuPanelSpanEvent=function(){var o=this,m=o.id,f=$("#module"+m),q=f.find(".fk-openSearchMenu"),b=q.find(".fk-newSearchSelectMenu"),n=$("#J_newSearchSelectMenu"+m),e=n.find(".fk-searchMenuKeyWord"),h=q.attr("_type"),k=q.attr("_styleColor"),i=q.attr("_usethemecolor"),c=(h==4||h==6)?true:false,s=this.openMenuList,l=this.noSearchList,a,j,g,r=o.unfoldSelectMenuPanel,p,d;k=(i==1)?(Fai.top._useTempThemeColor||k):k;e.hover(function(){if(c){$(this).css("background-color","#f5f5f5").siblings().css("background-color","")}$(this).css("color",k)},function(){if(c){$(this).css("background-color","#fff")}if(!$(this).hasClass("J_selectThisKeyWord")){$(this).css("color","")}}).click(function(t){g=$(this);j=g.attr("_val");b.attr("_selectItem",j);e.removeClass("J_selectThisKeyWord").css("color","#7f7f7f");g.addClass("J_selectThisKeyWord").css("color",k);b.find(".fk-searchMenuWord").text(g.text());p=$.parseJSON(g.attr("_nsl"));d=$.unique(p.concat(l));q.find(".fk-newSearchInput").attr("_nsl",$.toJSON(d));$(".J_newSearchSelectMenu").hide()});n.mouseenter(function(t){b.data("inPanel",true);o.foldSelectMenuPanel()}).mouseleave(function(t){b.data("inPanel",false);setTimeout(o.unfoldSelectMenuPanel.bind(o),200)})};Site.dynamicSearchBox={};Site.initDynamicSearchBox=function(e,d){var c=$("#module"+e),b=c.find(".J_newSearchBox"),a=(b.attr("_usethemecolor")==1);d=a?(Fai.top._useTempThemeColor||d):d;Site.fixDynamicSearchMenu(e);Site.dynamicSearchBox["module"+e]=new NewDynamicSearchBox(e,d,a);Site.dynamicSearchBox["module"+e].bindSearchBoxEvent()};Site.fixDynamicSearchMenu=function(h){var f=$("#module"+h),e=f.find(".fk-dynamicSearch"),a=e.find(".fk-newSearchSelect"),d=e.find(".fk-newSearchSelectMenu"),b=e.find(".fk-newSearchBoxContainer"),c,g;e.width(Site.fixCusWidthSearchBox(h,true));g=a.width();a.data("width",g).css({position:"relative",left:g+"px"})};function NewDynamicSearchBox(c,b,a){this.id=c;this.color=b;this._usethemecolor=a}NewDynamicSearchBox.prototype.bindSearchBoxEvent=function(){var n=this,m=n.id,o=n.color,j=this._usethemecolor,e=$("#module"+m),i=e.find(".fk-newSearchBox"),r=i.find(".fk-newSearchSelect"),p=i.find(".fk-searchBoxBtn"),t=i.find(".fk-newSearchSelectMenu"),l=t.find(".fk-searchMenuWord"),h=i.find(".fk-newSearchBoxContainer"),k=h.find("input"),f=e.attr("_modulestyle"),g=i.attr("_type"),u,s,d,b,a,v;d=(g==4);b=(g==6);a=(g==7);p.hover(function(){o=j?(Fai.top._useTempThemeColor||o):o;if(!p.data("unfold")){$(this).find("span").css("color",o)}},function(){if(!p.data("unfold")){$(this).find("span").css("color","#C2C2C2")}}).click(function(w){u=p.data("unfold");v=r.data("width");if(!u){q()}else{s=k.val().trim();if(s==""){c()}else{f==62?Site.searchInSite(m):Site.searchProduct(m)}}});if(Fai.top!=window){return}$(Fai.top.document.body).bind("click.hideSearchBox",function(w){if($(w.target).parents("#module"+m).length||$(w.target).parents("#J_newSearchSelectMenu"+m).length){return}u=p.data("unfold");if(u){c()}});function q(){var w,x=RgbatoRgb(i.attr("_borderColor"))||"#ddd";if(a){w={left:0,opacity:1};r.css("border-color",x);p.css("border-color",x)}else{w={left:0,opacity:1}}if(d||b){t.find(".fk-searchSelectMenuRightBorder").height(l.height());d&&p.css("border-bottom-color","");b&&p.css("border-right-color","")&&r.css("border-left-color","")}p.css("background-color","");t.css("visibility","visible");h.css("visibility","visible");r.animate(w,300,function(){$(this).css("left","0");$(this).css("opacity","1");k.focus()});if(a){p.css("border-color",x);r.css("border-color",x)}k.css("background-color","");t.css("background-color","");p.data("unfold",true).find("span").css("color",o);e.find(".J_dynamicShowTip").css("visibility","visible")}function c(){var w,x=RgbatoRgb(i.attr("_borderColor"))||"#ddd";v=r.width();k.focusout();r.animate({left:v+"px"},300,function(){$(this).css("left",v+"px");t.css("visibility","hidden");h.css("visibility","hidden");d&&p.css("border-bottom-color","#ddd");b&&p.css("border-right-color","#ddd")&&r.css("border-left-color","#ddd")});if(a){r.css("border-color","transparent");p.css("border-color","transparent")}t.css("background-color","transparent");k.css("background-color","transparent");p.css("background-color","transparent");p.data("unfold",false).find("span").css("color","#C2C2C2");e.find(".J_dynamicShowTip").css("visibility","hidden")}};Site.fixCusWidthSearchBox=function(b,k){var l=$("#module"+b),c=l.find(".formMiddleContent"),m=l.find(".J_newSearchBox"),d=m.find(".fk-newSearchSelectWrap"),q=m.find(".fk-newSearchSelect"),n=m.find(".fk-newSearchSelectMenu"),a=m.find(".fk-newSearchBoxContainer"),g=m.find(".fk-searchBoxBtn"),f=m.attr("_type"),e=m.attr("_borderwidth"),j=c.innerWidth(),o=l.outerWidth()-j,i=d.outerWidth(true),p=g.outerWidth(true),h;if(n.length){i=n.outerWidth(true)+a.outerWidth(true)+q.outerWidth(true)-q.width()}h=i+p;e=parseInt(e);if(f==1||f==3||f==8){e||(e=(f==1)?2:1);h+=e}else{if(f==2||f==5||f==9||f==10){e||(e=1);h+=e*2}else{if(f==4||f==7){e||(e=(f==7)?2:1)}else{if(f==6){e||(e=1)}}}}if(k){return h}if(j<h){l.width(h+o)}};Site.bindSearchBtnEvent=function(f){var d=$("#module"+f),c=d.find(".fk-newSearchBox"),b=c.find(".fk-newSearchBoxContainer"),a=b.find("input"),e=d.attr("_modulestyle");a.unbind("keyup.searchip").bind("keyup.searchip",function(g){if(g.keyCode===13){inputVal=a.val().trim();if(inputVal!=""){e==62?Site.searchInSite(f):Site.searchProduct(f)}else{Fai.ing("请输入搜索内容",true)}}})};function RgbatoRgb(d){if(!d){return""}if(/#/g.test(d)){return d}var c=d.split("(")[1].split(")")[0].split(",");var f=c[0],e=c[1],a=c[2];return"rgb("+f+","+e+","+a+")"}Site.fixWidthChangeBtn=function(c,e,b){var g=$("#module"+c),a=g.find(".fk-newSearchBox"),i=g.find(".fk-newSearchSelectWrap"),h=a.find(".fk-searchBoxBtn"),f,d;if(e==1){f=i.height()+b*2;h.height(f).find("span").css("line-height",f+"px");a.height(f)}else{if(e==3||e==8){f=i.height();h.height(f).find("span").css("line-height",f+"px");a.height(f)}else{if(e==4){f=i.outerHeight();a.height(f)}else{if(e==6){d=Site.fixCusWidthSearchBox(c,true);a.width(d)}else{if(e==7){f=i.outerHeight();a.height(f);d=Site.fixCusWidthSearchBox(c,true);a.width(d)}}}}}};Site.msgBoardShowMsg=function(a){$("#msgAdd .msgTips").show();$("#msgAdd .msgTips").html(a)};Site.msgBoardAddMsg=function(n,b,l){if(_siteDemo){Fai.ing("当前为“模板网站”,请先“复制网站”再进行留言。");return}$msgBoard=$("#msgBoard"+b);var a=$msgBoard.find("#reqName").val();var h=$msgBoard.find("#reqPhone").val();var i=$msgBoard.find("#reqEmail").val();var g=$msgBoard.find("#reqContent").val();var m=$msgBoard.find("#msgBoardCaptcha").val();var c=$msgBoard.find(".msgTips").show();var j=$msgBoard.find(".J_msgBoardCaptcha");var f=0;$msgBoard.find("input.msg_isMust").each(function(){var p=$(this).attr("id");var q=$(this).attr("name");var o=$(this).val();if(o==""||o==null){c.html(Fai.format(LS.msgBoardInputIsEmpty,Fai.encodeHtml(q)));$msgBoard.find("#"+p).focus();f=1;return false}if(p=="reqPhone"&&!Fai.isPhone(o)){c.html(Fai.format(LS.msgBoardInputCorrect,Fai.encodeHtml(q)));$msgBoard.find("#"+p).focus();f=1;return false}if(p=="reqEmail"&&!Fai.isEmail(o)){c.html(Fai.format(LS.msgBoardInputCorrect,Fai.encodeHtml(q)));$msgBoard.find("#"+p).focus();f=1;return false}});if(f==1){return false}var e=0;$msgBoard.find("input.msg_ipt").each(function(){var p=$(this).attr("id");var r=$(this).attr("name");var o=$(this).val();var q=$(this).attr("maxlength");if(o.length>q){c.html(Fai.format(LS.msgBoardInputMaxLength,Fai.encodeHtml(r),q));$msgBoard.find("#"+p).focus();e=1;return false}if(p=="reqPhone"&&o.length&&!Fai.isPhone(o)){c.html(Fai.format(LS.msgBoardInputCorrect,Fai.encodeHtml(r)));$msgBoard.find("#"+p).focus();e=1;return false}if(p=="reqEmail"&&o.length&&!Fai.isEmail(o)){c.html(Fai.format(LS.msgBoardInputCorrect,Fai.encodeHtml(r)));$msgBoard.find("#"+p).focus();e=1;return false}});if(e==1){return false}if(g==null||g==""){Site.msgBoardShowMsg(LS.msgBoardInputContent);$msgBoard.find("#reqContent").focus();return}var d=10000;if(g.length>d){Site.msgBoardShowMsg(Fai.format(LS.msgBoardInputContent2,d));$msgBoard.find("#reqContent").focus();return}if(!j.hasClass("msgBoardCaptchaHide")){if(m==null||m==""){Site.msgBoardShowMsg(LS.msgBoardInputValidateCode);$msgBoard.find("#msgBoardCaptcha").focus();return}}Site.msgBoardShowMsg(LS.msgBoardDoing);var k={};$msgBoard.find("input.msg_ipt").each(function(){var p=$(this).attr("id");var o=$(this).val();k[p]=$.trim(o)});k.reqContent=g;k.memberId=(l===undefined)?0:l;$.ajax({type:"post",url:"ajax/msgBoard_h.jsp",data:"cmd=add&msgBdData="+Fai.encodeUrl($.toJSON(k))+"&validateCode="+Fai.encodeUrl(m)+"&moduleId="+Fai.encodeUrl(b),error:function(){var p=Site.getDialogContent(true,Fai.format(LS.systemError));var o={htmlContent:p,width:205,height:78};Site.popupBox(o);setTimeout(function(){Fai.top.location.reload()},3000)},success:function(o){o=jQuery.parseJSON(o);if(o.success){var q=Site.getDialogContent(true,Fai.format(LS.msgBoardSendOkAutoOpen));var p={htmlContent:q,width:205,height:78};Site.popupBox(p);setTimeout(function(){Fai.top.location.reload()},3000);$msgBoard.find('#msgAdd input[type="text"]').val("");$msgBoard.find("#reqContent").val("")}else{if(o.errno==1){Site.msgBoardShowMsg(LS.captchaError)}else{if(o.errno==2){Site.msgBoardShowMsg(LS.argsError)}else{if(o.errno==-4){Site.msgBoardShowMsg(LS.msgBoardAddCountLimit)}else{Site.msgBoardShowMsg(LS.systemError)}}}if(o.needCode){Site.msgBoardShowMsg(o.msg,b);j.removeClass("msgBoardCaptchaHide")}if(o.hasFW){Site.msgBoardShowMsg(o.msg)}}Site.changeMsgBoardValidateCode()}})};Site.changeMsgBoardValidateCode=function(){$("#msgBoardCaptchaImg").attr("src","validateCode.jsp?"+Math.random()*1000)};Site.setStarSelect=function(a){_getBackgroundColor=function(c){var d="";while(c[0].tagName.toLowerCase()!="html"){d=c.css("background-color");if(d!="rgba(0, 0, 0, 0)"&&d!="transparent"){break}c=c.parent()}return d};var b="";if($(".submitStarList").length>0){b=_getBackgroundColor($(".submitStarList"))}if(!b){b="#FFF"}$("body").on({click:function(){a=$(this).index();if(a<5){var c=$(this).parent();c.attr("star",a+1);_changeSelectStar(a,c)}},hover:function(){var d=$(this).index();if(d<5){var c=$(this).parent();_changeSelectStar(d,c)}},mouseleave:function(d){if(a<5){var c=$(this).parent();_changeSelectStar(a,c)}}},".submitStarList li");if($(".statisticCommSwap").length!=0){$(".statisticBox .percent span").css({"border-color":"transparent "+b+" transparent transparent"})}_changeSelectStar=function(e,g){var h=$(".submitStarList").hasClass("fk-pdStyle5")||false;for(var f=0;f<5;f++){var c=g.find("li").eq(f);if(f<e+1){if(e<2){c.removeClass("select_more");c.addClass("select_less")}else{c.removeClass("select_less");c.addClass("select_more")}}else{c.removeClass("select_more");c.removeClass("select_less")}}var j="";var d="";if(e==0){j=LS.badComment;d="#b7b6b6"}else{if(e==1){j=LS.moderateComment;d="#b7b6b6"}else{if(e==2){j=LS.moderateComment;d="#ffb600"}else{j=LS.highComment;d="#ffb600"}}}if(e==-1){g.find("li:last").removeClass("scoreTipHover")}else{if(!h){g.find("li:last").css({color:d})}g.find("li:last").html("<em></em><span></span>"+(e+1)+LS.score+j);g.find("li:last").addClass("scoreTipHover")}if(!h){g.find("li:last em").css({"border-color":"transparent "+d+" transparent transparent"})}g.find("li:last span").css({"border-color":"transparent "+b+" transparent transparent"})}};Site.msgSubmitShowMsg=function(b,a){$("#msgSubmit"+a).find("#msgSAdd .msgSTips").show();$("#msgSubmit"+a).find("#msgSAdd .msgSTips").html(b)};Site.msgSubmitAddMsg=function(n,b,l){$msgSubmit=$("#msgSubmit"+b);var a=$.trim($msgSubmit.find("#reqName").val());var h=$msgSubmit.find("#reqPhone").val();var i=$msgSubmit.find("#reqEmail").val();var g=$msgSubmit.find("#reqContent").val();var m=$msgSubmit.find("#msgSubmitCaptcha").val();var c=$msgSubmit.find(".msgSTips").show();var j=$msgSubmit.find(".J_msgBoardCaptcha");var f=0;$msgSubmit.find("input.msgSubmit_isMust").each(function(){var p=$(this).attr("id");var q=$(this).attr("name");var o=$(this).val();if(o==""||o==null){c.html(Fai.format(LS.msgBoardInputIsEmpty,Fai.encodeHtml(q)));$msgSubmit.find("#"+p).focus();f=1;return false}if(p=="reqPhone"&&!Fai.isPhone(o)){c.html(Fai.format(LS.msgBoardInputCorrect,Fai.encodeHtml(q)));$msgSubmit.find("#"+p).focus();f=1;return false}if(p=="reqEmail"&&!Fai.isEmail(o)){c.html(Fai.format(LS.msgBoardInputCorrect,Fai.encodeHtml(q)));$msgSubmit.find("#"+p).focus();f=1;return false}});if(f==1){return false}var e=0;$msgSubmit.find("input.msgSubmit_ipt").each(function(){var p=$(this).attr("id");var r=$(this).attr("name");var o=$(this).val();var q=$(this).attr("maxlength");if(o.length>q){c.html(Fai.format(LS.msgBoardInputMaxLength,Fai.encodeHtml(r),q));$msgSubmit.find("#"+p).focus();e=1;return false}if(p=="reqPhone"&&o.length&&!Fai.isPhone(o)){c.html(Fai.format(LS.msgBoardInputCorrect,Fai.encodeHtml(r)));$msgSubmit.find("#"+p).focus();e=1;return false}if(p=="reqEmail"&&o.length&&!Fai.isEmail(o)){c.html(Fai.format(LS.msgBoardInputCorrect,Fai.encodeHtml(r)));$msgSubmit.find("#"+p).focus();e=1;return false}});if(e==1){return false}if(g==null||g==""){Site.msgSubmitShowMsg(LS.msgBoardInputContent,b);$msgSubmit.find("#reqContent").focus();return}var d=10000;if(g.length>d){Site.msgSubmitShowMsg(Fai.format(LS.msgBoardInputContent2,d),b);$msgSubmit.find("#reqContent").focus();return}if(!j.hasClass("msgBoardCaptchaHide")){if(m==null||m==""){Site.msgSubmitShowMsg(LS.msgBoardInputValidateCode,b);$msgSubmit.find("#msgSubmitCaptcha").focus();return}}Site.msgSubmitShowMsg(LS.msgBoardDoing,b);var k={};$msgSubmit.find("input.msgSubmit_ipt").each(function(){var p=$(this).attr("id");var o=$(this).val();k[p]=$.trim(o)});k.reqContent=g;k.memberId=(l===undefined)?0:l;$.ajax({type:"post",url:"ajax/msgBoard_h.jsp",data:"cmd=add&msgBdData="+Fai.encodeUrl($.toJSON(k))+"&validateCode="+Fai.encodeUrl(m)+"&vCodeId="+Fai.encodeUrl(b)+"&moduleId="+Fai.encodeUrl(b),error:function(){var p=Site.getDialogContent(true,Fai.format(LS.systemError));var o={htmlContent:p,width:205,height:78};Site.popupBox(o);setTimeout(function(){Fai.top.location.reload()},3000)},success:function(o){o=jQuery.parseJSON(o);if(o.success){var q=Site.getDialogContent(true,Fai.format(LS.msgBoardSendOkAutoOpen));var p={htmlContent:q,width:205,height:78};Site.popupBox(p);setTimeout(function(){Fai.top.location.reload()},3000);$msgSubmit.find('#msgSAdd input[type="text"]').val("");$msgSubmit.find("#reqContent").val("")}else{if(o.errno==1){Site.msgSubmitShowMsg(LS.captchaError,b)}else{if(o.errno==2){Site.msgSubmitShowMsg(LS.argsError,b)}else{if(o.errno==-4){Site.msgSubmitShowMsg(LS.msgBoardAddCountLimit,b)}else{Site.msgSubmitShowMsg(LS.systemError,b)}}}if(o.needCode){Site.msgSubmitShowMsg(o.msg,b);j.removeClass("msgBoardCaptchaHide")}if(o.hasFW){Site.msgSubmitShowMsg(o.msg,b)}}Site.changeMsgSubmitValidateCode(b)}})};Site.changeMsgSubmitValidateCode=function(a){$("#msgSubmit"+a).find("#msgSubmitCaptchaImg").attr("src","validateCode.jsp?"+Math.random()*1000+"&vCodeId="+a)};Site.fixMsgSubmitStyle=function(c){var h=parseInt(Fai.top.$("#module"+c+"").find(".msgSAdd").find(".msgPanel_N").find(".msgSubmit_overToPoint ").width());var e=parseInt(Fai.top.$("#module"+c+"").find(".msgSAdd").find(".msgPanel_N").find(".star ").width());if(isNaN(e)){e=0}var i=parseInt(Fai.top.$("#module"+c+"").find("#msgSubmit"+c+"").find(".msgSAdd_N").width());var j=parseInt(Fai.top.$("#module"+c+"").find("#msgSubmit"+c+"").find(".msgSAdd_N").find(".msgPanel_N").css("margin-right"));var d=parseInt(Fai.top.$("#module"+c+"").find("#msgSubmit"+c+"").find(".msgSAdd_N").find(".msgPanel_N").width());var g=h+194+e+j;var b;var f=194;if(Fai.top.$("#module"+c+"").width()<=400){if(Fai.top.$("#module"+c+"").width()<300){Fai.top.$("#module"+c+"").find(".msgSubmit_overToPoint").css("width","60px");Fai.top.$("#module"+c+"").find(".msgSubmit_PropBoard").css("width","56px");Fai.top.$("#module"+c+"").find(".paramResizeHandleRight").css("left","56px");Fai.top.$("#module"+c+"").find(".msgSAdd").find(".msgAddButton_N").find(".msgSubmit_overToPoint").css({width:"5px",display:"none"});j=parseInt(Fai.top.$("#module"+c+"").find("#msgSubmit"+c+"").find(".msgSAdd_N").find(".msgPanel_N").css("margin-right"))}Fai.top.$("#module"+c+"").find("#msgSubmit"+c+"").css({"margin-left":"6px"});Fai.top.$("#module"+c+"").find(".msgSAdd").find(".msgAddText_N").css({"line-height":"70px",height:"70px"});Fai.top.$("#module"+c+"").find(".msgSAdd").find(".msgCaptcha_N").find(".validateCode_N").css({"float":"none","margin-left":"50px"});Fai.top.$("#module"+c+"").find(".msgSAdd").find(".msgCaptcha_N").find("#msgSubmitCaptchaImg").css({"margin-bottom":"15px","margin-top":"10px"});if(Fai.top.$("#module"+c+"").width()<300){d=i-5}else{d=i-j}f=b=d-h-e-13;Fai.top.$("#module"+c+"").find("#msgSubmit"+c+"").find(".msgSAdd_N").find(".msgPanel_N").css({width:d+"px"});Fai.top.$("#module"+c+"").find(".msgSAdd").find(".msgPanel_N").find(".g_itext").css({width:b+"px"});Fai.top.$("#module"+c+"").find(".msgSAdd").find(".msgAddText_N").find(".g_textarea").css({width:f+"px"})}var a=Fai.top.$("#module"+c+"").find(".msgSAdd").find(".msgPanel_N").length;if(Fai.top.$("#module"+c+"").width()>400){Fai.top.$("#module"+c+"").find(".msgSAdd").find(".msgAddButton_N").find(".msgSubmit_overToPoint").css({display:"inline-block"});if(g<=i&&i<2*g){d=i-j;f=b=d-h-e-13}else{if(2*g<=i&&i<3*g){if(a==1){d=i-j;f=b=d-h-e-13}else{d=(i/2)-j;b=d-h-e-13;f=b*2+j+h+e+13}}else{if(i>=3*g){if(a==1){d=i-j;f=b=d-h-e-13}else{if(a==2){d=(i/2)-j;b=d-h-e-13;f=b*2+j+h+e+13}else{d=(i/3)-j;b=d-h-e-13;f=d*3+j*2-h-e*3}}}}}Fai.top.$("#module"+c+"").find("#msgSubmit"+c+"").find(".msgSAdd_N").find(".msgPanel_N").css({width:d+"px"});Fai.top.$("#module"+c+"").find(".msgSAdd").find(".msgPanel_N").find(".g_itext").css({width:b+"px"});Fai.top.$("#module"+c+"").find(".msgSAdd").find(".msgAddText_N").find(".g_textarea").css({width:f+"px"});if(Fai.top.$("#module"+c+"").width()>300&&Fai.top.$("#module"+c+"").width()<650){Fai.top.$("#module"+c+"").find(".msgSAdd").find(".m_ibutton").css({"float":"left"})}}};Site.fixMsgBoardStyle=function(g){var h=parseInt(Fai.top.$("#module"+g+"").find("#msgBoard"+g+"").find(".msgSAdd_N").width());var b=parseInt(Fai.top.$("#module"+g+"").find("#msgBoard"+g+"").find(".msgSAdd_N").find(".msgPanel_N").css("margin-right"));var a=parseInt(Fai.top.$("#module"+g+"").find("#msgBoard"+g+"").find(".msgSAdd_N").find(".msgPanel_N").width());var e=a+b;var c=280+b;if(Fai.top.$("#module"+g+"").width()<=400){Fai.top.$("#module"+g+"").find("#msgBoard"+g+"").css({"margin-left":"6px"});Fai.top.$("#module"+g+"").find(".msgSAdd").find(".g_itext").css({width:"106px"});Fai.top.$("#module"+g+"").find(".msgSAdd").find(".msgAddText_N").find(".g_textarea").css({width:"104px",height:"64px"});Fai.top.$("#module"+g+"").find(".msgSAdd").find(".msgAddText_N").css({"line-height":"70px",height:"70px"});Fai.top.$("#module"+g+"").find(".msgSAdd").find(".msgBoardPanel").find(".msgTitle_N").find(".msgUser").css({"margin-left":"35px","text-align":"center"});Fai.top.$("#module"+g+"").find(".msgSAdd").find(".msgBoardPanel").find(".msgContent").find(".userMsg").css({"margin-left":"16px","margin-top":"16px"});Fai.top.$("#module"+g+"").find(".msgSAdd").find(".msgBoardPanel").find(".user_level_name").css({position:"relative"});Fai.top.$("#module"+g+"").find(".msgSAdd").find(".msgAddButton_N").find(".msgSubmit_overToPoint").css({width:"5px"});Fai.top.$("#module"+g+"").find(".msgSAdd").find(".msgCaptcha_N").find(".validateCode_N").css({"float":"none","margin-left":"50px"});Fai.top.$("#module"+g+"").find(".msgSAdd").find(".msgCaptcha_N").find("#msgBoardCaptchaImg").css({"margin-bottom":"15px","margin-top":"10px"});Fai.top.$("#module"+g+"").find("#pagenation"+g+"").find("div").each(function(i,j){if($(this).hasClass("pagePrev_N")||$(this).hasClass("pageNext_N")||$(this).hasClass("J_pageArrow_N")){$(this).show()}else{$(this).hide()}})}else{Fai.top.$("#module"+g+"").find("#pagenation"+g+"").find("div").each(function(i,j){$(this).show()})}var d;var f=Fai.top.$("#module"+g+"").find(".msgSAdd").find(".msgPanel_N").length;if(Fai.top.$("#module"+g+"").width()>400){if(e<=h&&h<2*e){Fai.top.$("#module"+g+"").find(".msgSAdd").find(".msgPanel_N").find(".g_itext").css({width:"246px"});Fai.top.$("#module"+g+"").find(".msgSAdd").find(".msgAddText_N").find(".g_textarea").css({width:"244px"})}else{if(2*e<=h&&h<3*c){if(f>2){d=a+b+246;Fai.top.$("#module"+g+"").find(".msgSAdd").find(".msgPanel_N").find(".g_itext").css({width:"246px"});Fai.top.$("#module"+g+"").find(".msgSAdd").find(".msgAddText_N").find(".g_textarea").css({width:d+"px"})}else{if(f==2){d=a+b+246;Fai.top.$("#module"+g+"").find(".msgSAdd").find(".msgPanel_N").find(".g_itext").css({width:"246px"});Fai.top.$("#module"+g+"").find(".msgSAdd").find(".msgAddText_N").find(".g_textarea").css({width:d+"px"})}else{if(f==1){d=246;Fai.top.$("#module"+g+"").find(".msgSAdd").find(".msgPanel_N").find(".g_itext").css({width:"246px"});Fai.top.$("#module"+g+"").find(".msgSAdd").find(".msgAddText_N").find(".g_textarea").css({width:d+"px"})}}}}else{if(h>3*c){if(h>=3*(b+a)){if(f>2){d=2*(a+b)+194;Fai.top.$("#module"+g+"").find(".msgSAdd").find(".msgPanel_N").find(".g_itext").css({width:"194px"});Fai.top.$("#module"+g+"").find(".msgSAdd").find(".msgAddText_N").find(".g_textarea").css({width:d+"px"})}else{if(f==2){d=a+b+194;Fai.top.$("#module"+g+"").find(".msgSAdd").find(".msgPanel_N").find(".g_itext").css({width:"194px"});Fai.top.$("#module"+g+"").find(".msgSAdd").find(".msgAddText_N").find(".g_textarea").css({width:d+"px"})}else{if(f==1){d=246;Fai.top.$("#module"+g+"").find(".msgSAdd").find(".msgPanel_N").find(".g_itext").css({width:"246px"});Fai.top.$("#module"+g+"").find(".msgSAdd").find(".msgAddText_N").find(".g_textarea").css({width:d+"px"})}}}}else{if(f>=2){d=a+b+194;Fai.top.$("#module"+g+"").find(".msgSAdd").find(".msgPanel_N").find(".g_itext").css({width:"194px"});Fai.top.$("#module"+g+"").find(".msgSAdd").find(".msgAddText_N").find(".g_textarea").css({width:d+"px"})}else{if(f==1){d=246;Fai.top.$("#module"+g+"").find(".msgSAdd").find(".msgPanel_N").find(".g_itext").css({width:"246px"});Fai.top.$("#module"+g+"").find(".msgSAdd").find(".msgAddText_N").find(".g_textarea").css({width:d+"px"})}}}}}}}};Site.jumpToPage=function(d,b,a){var c=parseInt($(Fai.top.$("#module"+d+"").find(".pagenation_N").find(".jumpPageDiv").find("#jumpPage")).val());if(isNaN(c)){c=1}if(c>b){c=parseInt(b)}if(c==0){c=1}window.location.href=""+a+"?m"+d+"pageno="+c+"#module"+d+""};Site.msgSubmitCusResize=function(b){var a="#msgSubmit"+b;Site.msgComCusResize(b,a)};Site.msgBoardCusResize=function(b){var a="#msgBoard"+b;Site.msgComCusResize(b,a)};Site.msgComCusResize=function(g,d){var c=$(d).find(".msgSAdd");var f=c.find(".msgSubmit_PropBoard");var b=f.width();f.attr("class","msgSubmit_PropBoard paramResize");c.find(".msgFlag_N").find(".msgSubmit_overToPoint").attr("class","msgSubmit_overToPoint");var a=c.find(".paramResize");a.hover(function(){a.css("cursor","auto")});h();var e=c.find(".paramResize,.u-paramResize-w,.u-paramResize-e");e.hover(function(){a.css({"border-left":"1px dashed #2b73ba","border-right":"1px dashed #2b73ba","border-top":"1px solid #2b73ba","border-bottom":"1px solid #2b73ba"})},function(){a.css("border","1px dashed transparent")});function h(){if(a.length<1){return}a.each(function(){var o=$(this),i=Fai.isIE8()?$(document):$(window),q,n,k=$(this).parent(),m,l={};if(o.hasClass("paramResize")){o.before("<div class='u-paramResize-w' style='float:left' title='可拖动调节宽度'><div style='position:absolute;width:5px;height:"+$(o).height()+"px;z-index:999'></div></div>");o.after("<div class='u-paramResize-e' style='float:left' title='可拖动调节宽度'><div class='paramResizeHandleRight' style='position:absolute;top:0px;left:"+b+"px;width:5px;height:"+$(o).height()+"px;z-index:999'></div></div>");$(".u-paramResize-e,.u-paramResize-w").css("cursor","e-resize")}q=$(o).prev();n=$(o).next();if(!n.hasClass("u-paramResize-e")||!q.hasClass("u-paramResize-w")){return}q.off("mousedown.fi").on("mousedown.fi",r);n.off("mousedown.fi").on("mousedown.fi",r);function r(s){s=s||window.event;l.x=s.pageX;if($(this).hasClass("u-paramResize-w")){l.dir="w";l.ptb=parseInt(k.css("width"))}else{if($(this).hasClass("u-paramResize-e")){l.dir="e";l.ptb=parseInt(k.css("width"))}}m=$("#dockTip").show().css({left:"-1000px;",top:"-1000px"});i.off("mousemove.fi").on("mousemove.fi",j);i.off("mouseup.fi").on("mouseup.fi",p);s.preventDefault()}function j(v){$("body").css("cursor","e-resize");a.css({"border-left":"1px dashed #2b73ba","border-right":"1px dashed #2b73ba","border-top":"1px solid #2b73ba","border-bottom":"1px solid #2b73ba"});v=v||window.event;var w={x:v.pageX},t,z,s=1,u=200,y="",x;if(l.dir=="w"){t=l.x-w.x;z=l.ptb+t;z=z>s?z:s;z=z>u?u:z;z=Math.round(z);y="宽度:"}else{if(l.dir=="e"){t=w.x-l.x;z=l.ptb+t;z=z>s?z:s;z=z>u?u:z;z=Math.round(z);y="宽度:"}}if(d.indexOf("msgSubmit")>-1){x=280-60+z;f.parent().css({width:z+"px"});f.css({width:(z-4)+"px"});c.find(".paramResizeHandleRight").css("left",(z-4)+"px");c.find(".msgPanel_N").css({width:x+"px"});Site.fixMsgSubmitStyle(g)}else{if(d.indexOf("msgBoard")>-1){x=330-60+z;f.parent().css({width:z+"px"});f.css({width:(z-4)+"px"});c.find(".paramResizeHandleRight").css("left",(z-4)+"px");c.find(".msgPanel_N").css({width:x+"px"});Site.fixMsgBoardStyle(g)}}m.html(y+z).css({left:v.pageX-28,top:v.pageY-40});v.preventDefault()}function p(t){$("body").css("cursor","");a.css("border","1px dashed transparent");t=t||window.event;l.dir="";i.off("mousemove.fi");i.off("mouseup.fi");m.hide();var s=Site.getModuleAttr(g);s.data.changed=true;Site.styleChanged();l={};t.preventDefault()}})}};Site.desMallBuyCount=function(c){var a=$("#cartbuyCount"+c).val();var b=1;if(Fai.isInteger(a)){b=parseInt(a)}b--;if($("#limitAmountDiv").text()==""){if(b<2){b=1;$("#buyCountDes"+c).addClass("disableMallJian");$("#buyCountInc"+c).removeClass("disableMallJia")}else{if(b>9999998){b=9999999;$("#buyCountDes"+c).removeClass("disableMallJian");$("#buyCountInc"+c).addClass("disableMallJia")}else{$("#buyCountDes"+c).removeClass("disableMallJian");$("#buyCountInc"+c).removeClass("disableMallJia")}}}$("#cartbuyCount"+c).val(b)};Site.incMallBuyCount=function(c){var a=$("#cartbuyCount"+c).val();var b=0;if(Fai.isInteger(a)){b=parseInt(a)}b++;if($("#limitAmountDiv").text()==""){if(b<2){b=1;$("#buyCountDes"+c).addClass("disableMallJian");$("#buyCountInc"+c).removeClass("disableMallJia")}else{if(b>9999998){b=9999999;$("#buyCountDes"+c).removeClass("disableMallJian");$("#buyCountInc"+c).addClass("disableMallJia")}else{$("#buyCountDes"+c).removeClass("disableMallJian");$("#buyCountInc"+c).removeClass("disableMallJia")}}}$("#cartbuyCount"+c).val(b)};Site.mallBuyCountChange=function(c){if($("#limitAmountDiv").text()==""){var a=$("#cartbuyCount"+c).val();var b=1;if(Fai.isInteger(a)){b=parseInt(a)}if(b<2){b=1;$("#buyCountDes"+c).addClass("disableMallJian");$("#buyCountInc"+c).removeClass("disableMallJia")}else{if(b>9999998){b=9999999;$("#buyCountDes"+c).removeClass("disableMallJian");$("#buyCountInc"+c).addClass("disableMallJia")}else{$("#buyCountDes"+c).removeClass("disableMallJian");$("#buyCountInc"+c).removeClass("disableMallJia")}}$("#cartbuyCount"+c).val(b)}};Site.mallBuy=function(e,b,g){var d="mbuy.jsp?id="+e;if(b&&b!="undefined"){var c=$("#module"+b);var h=c.find(".optionMsg");if(Fai.isNull(c)){return}var i=true;var f=[];d+="&fromDetail=true";c.find(".optionItemWrap").each(function(){var k=$(this).parent().parent().find(".propName").text();if(k.charAt(k.length-1)==":"||k.charAt(k.length-1)==":"){k=k.substring(0,k.length-1)}if($(this).find(".optionItemHover").length==1){var l=$(this).attr("data");var j=$(this).find(".optionItemHover").attr("data");var m={};m.name=l;m.value=parseInt(j);f.push(m);h.hide()}else{h.show();if(b==="PdSlide"){var o=$(this).parent().parent().position();var n=$(".fk-slideForProduct .f-propListContent");n.scrollTop(o.top)}h.html(Fai.format(LS.mallCartChoiceItemError,Fai.encodeHtml(k)));i=false;return false}});if(!i){return false}if(f.length>0){d+="&optionList="+Fai.encodeUrl($.toJSON(f))}}if(g&&g.length>0){d+="&"+g}var a=window.open(d+"&ram="+Math.random(),"mallcart");a.focus();if(Fai.isIE()){window.event.cancelBubble=true;window.event.returnValue=false}else{event.stopPropagation();event.preventDefault()}};Site.MallAjaxErrno={ok:0,error:1,manager:2,login:3,idNotExist:4,orderSettle:5,noMall:6,toProductDetail:7,orderNotExist:8,networkError:9,outOfMallAmount:10,mallAmountZero:11,mallOptionStop:12,OutOfAllowAmount:13,notAdded:14,payDomainError:15,couponNotFound:16,couponUnavail:17,couponOverTime:18,authMemberNotAllow:19};Site.getDialogHtml=function(r,g){if(!Fai.isInteger(r.rt)){r.rt=1}var h=parseInt(r.rt),d=0,m=0,k="",e="about:blant;",p=LS.goToMallCartStr,a=LS.continueShopping,b=LS.resultFailMsg,n="resultFailIcon";if(!g){g="javascript:;"}var i=Site.getHtmlUrl("mcart");var q="target='_blank'";var f;switch(h){case Site.MallAjaxErrno.ok:n="suc-ico";b=LS.resultSuccessMsg;if(typeof(r.totalPrice)!="undefined"){d=r.totalPrice}if(typeof(r.totalAmount)!="undefined"){m=r.totalAmount}if(typeof(r.choiceCurrencyVal)!="undefiend"){k=r.choiceCurrencyVal}var j=k+d;f=Fai.format(LS.cartDetailInfo,m,j);break;case Site.MallAjaxErrno.error:Site.getTopWindow().location.href="mcart.jsp?msg=2";return false;break;case Site.MallAjaxErrno.manager:n="resultFailIcon";b="购买失败。";var p="去购物车结算";var a="返回";f="当前为管理状态,购买失败。";r.success=true;break;case Site.MallAjaxErrno.login:return false;break;case Site.MallAjaxErrno.idNotExist:Site.getTopWindow().location.href="mcart.jsp?msg=1";return false;break;case Site.MallAjaxErrno.orderSettle:Site.getTopWindow().location.href="mcart.jsp";return false;break;case Site.MallAjaxErrno.noMall:Site.getTopWindow().location.href="mcart.jsp";return false;break;case Site.MallAjaxErrno.toProductDetail:Site.getTopWindow().location.href="pd.jsp?id="+productId+"&ram="+Math.random();return false;break;case Site.MallAjaxErrno.orderNotExist:Site.getTopWindow().location.href="mcart.jsp?msg=1";return false;break;case Site.MallAjaxErrno.networkError:f=LS.networkError;break;case Site.MallAjaxErrno.outOfMallAmount:f=LS.mallAmountOverFlow;break;case Site.MallAjaxErrno.mallAmountZero:f=LS.mallAmountZero;break;case Site.MallAjaxErrno.mallOptionStop:f=LS.mallOptionStop;break;case Site.MallAjaxErrno.OutOfAllowAmount:f=LS.allowAmountOverFlow;break;case Site.MallAjaxErrno.notAdded:f=LS.mallProductNotAdded;break;case Site.MallAjaxErrno.authMemberNotAllow:f=r.data+LS.authLevelBuy;break;default:Site.getTopWindow().location.href.reload();return false}var l=[];if(r.success){l=["<div class='mallCartOperate'>","<a id='settleAccountsBtn' class='formBtn' "+q+" href='"+i+"' style='width:108px; height:35px; background:#ff6d00;font-size:14px;'>"+p+"</a>","<a id='dialogContinueShopping' href='javascript:;' class='shopping popupBClose' style='font-size:14px; color:#636363 !important;'>",a,"</a>","</div>"]}var c="";if(Site.getTopWindow()._lcid===1033){c="letter-spacing:0px;"}var o=["<table style='width:100%;height:100%;'>","<tr>","<td style='width:50px;'></td>","<td style='width:280px;'>","<div class='"+n+" addItemTextTips' style='font-size:14px; color:#636363' >"+b+"</div>","<div class='cartInfoContent' style='"+c+"' >"+f+"</div>",l.join(""),"</td>","<td style='width:50px;'></td>","</tr>","</table>"];if(h==Site.MallAjaxErrno.mallAmountZero||h==Site.MallAjaxErrno.OutOfAllowAmount||h==Site.MallAjaxErrno.outOfMallAmount){o[0]="<table style='width:100%;height:100%;margin-top:10px;'>"}return o.join("")};var loginDialogCache=[];loginDialogCache.html="";loginDialogCache.qqOpen=false;loginDialogCache.sinaOpen=false;loginDialogCache.wxOpen=false;loginDialogCache.newWXOpen=false;loginDialogCache.closeOldSiteWX=false;loginDialogCache.qqAppId="";loginDialogCache.sinaAppKey="";loginDialogCache.wxAppKey="";loginDialogCache.qqReUri="";loginDialogCache.sinaReUri="";loginDialogCache.wxReUri="";loginDialogCache.displayList;loginDialogCache.noRemark;loginDialogCache.REMARK_MAXLEN;loginDialogCache.extendParam;var loginDialogLock=false;Site.createLoginDialog=function(D,e,r,F,h,B){var n,w,x,C,G,A,o,b,g;var m,I,t;var p="";var l="";var d="";var H="";var k="";var u="";var j="";var y;var f;var z;var v;var s="";if(loginDialogLock){return}loginDialogLock=true;if(loginDialogCache!=null&&loginDialogCache.html!=null&&loginDialogCache.html!=""){var K=parseInt(Math.random()*10000);var q={boxId:K,boxName:"loginDialog",title:"",htmlContent:loginDialogCache.html,width:380};s=Site.popupBox(q);if(loginDialogCache.qqOpen||loginDialogCache.sinaOpen||loginDialogCache.wxOpen){var a={};a.pid=D;a.mid=e;a.url=r;a.opList=h;a.count=B;a.where=F;$.cookie("forThirtLoginBuy",$.toJSON(a))}if(loginDialogCache.qqOpen){Site.initQQLogin(loginDialogCache.qqAppId,loginDialogCache.qqReUri,loginDialogCache.displayList,loginDialogCache.noRemark,loginDialogCache.REMARK_MAXLEN,"ld_qqLogin",loginDialogCache.extendParam)}if(loginDialogCache.sinaOpen){Site.initWBLogin(loginDialogCache.sinaAppKey,loginDialogCache.sinaReUri,loginDialogCache.displayList,loginDialogCache.noRemark,loginDialogCache.REMARK_MAXLEN,"ld_wbLogin",loginDialogCache.extendParam)}if((loginDialogCache.wxOpen&&loginDialogCache.newWXOpen)||(loginDialogCache.wxOpen&&loginDialogCache.closeOldSiteWX)){Site.initNewWXLogin(loginDialogCache.displayList,loginDialogCache.noRemark,loginDialogCache.REMARK_MAXLEN,"ld_wxLogin",loginDialogCache.extendParam)}else{if(loginDialogCache.wxOpen&&!loginDialogCache.closeOldSiteWX){Site.initWXLogin(loginDialogCache.wxAppKey,loginDialogCache.wxReUri,loginDialogCache.displayList,loginDialogCache.noRemark,loginDialogCache.REMARK_MAXLEN,"ld_wxLogin",loginDialogCache.extendParam)}}c();loginDialogLock=false}else{$.ajax({type:"post",url:"ajax/site_h.jsp?cmd=getMemberLoginMsg",error:function(){Fai.ing("获取登录信息错误,请稍后再试.")},success:function(L){var L=jQuery.parseJSON(L);if(L.success){var Q=L.msg;w=Q.findPwdOpen;n=Q.autoLogin;x=Q.qqOpen;C=Q.sinaOpen;G=Q.wxOpen;A=Q.noRemark;o=Q.signUpbyMobile;b=Q.proOpen;g=Q.showCaptcha;closeOldSiteWX=Q.closeOldSiteWX;newWXOpen=Q.newWXOpen;m=Q.qqReUrlId;I=Q.sinaReUrlId;t=Q.wxReUrlId;p=Q.qqReUri;l=Q.sinaReUri;d=Q.wxReUri;H=Q.qqAppId;k=Q.sinaAppKey;u=Q.wxAppKey;j=Q.registerHtml;y=$.toJSON(Q.displayList);f=$.toJSON(Q.extendParam);z=Q.REMARK_MAXLEN;v=Q.ACCT_MAXLEN;loginDialogCache.qqOpen=x;loginDialogCache.sinaOpen=C;loginDialogCache.wxOpen=G;loginDialogCache.qqAppId=H;loginDialogCache.sinaAppKey=k;loginDialogCache.wxAppKey=u;loginDialogCache.qqReUri=p;loginDialogCache.sinaReUri=l;loginDialogCache.wxReUri=d;loginDialogCache.displayList=y;loginDialogCache.noRemark=A;loginDialogCache.REMARK_MAXLEN=z;loginDialogCache.extendParam=f;loginDialogCache.newWXOpen=newWXOpen;loginDialogCache.closeOldSiteWX=closeOldSiteWX;var R=[];R=i(R,n,w,"");R=E(R,x,C,G);R=J(R,o,b,g);var O=R.join("");loginDialogCache.html=O;var P=parseInt(Math.random()*10000);var M={boxId:P,boxName:"loginDialog",title:"",htmlContent:O,width:380};s=Site.popupBox(M);if(x||C||G){var N={};N.pid=D;N.mid=e;N.url=r;N.opList=h;N.count=B;N.where=F;$.cookie("forThirtLoginBuy",$.toJSON(N))}if(x){Site.initQQLogin(H,p,y,A,z,"ld_qqLogin",f)}if(C){Site.initWBLogin(k,l,y,A,z,"ld_wbLogin",f)}if((G&&newWXOpen)||(G&&closeOldSiteWX)){Site.initNewWXLogin(y,A,z,"ld_wxLogin",f)}else{if(G&&!closeOldSiteWX){Site.initWXLogin(u,d,y,A,z,"ld_wxLogin",f)}}c();loginDialogLock=false}}})}function i(O,M,N,L){O.push("<div id='J_memberLoginDialogPanel' class='memberLoginDialogPanel'>\n");O.push("<div class='loginAndRegister'>\n");O.push("<div class='login loginDialogSelected'>"+LS.memberLogin+"</div>\n");O.push("<div class='register'>"+LS.memberReg+"</div>\n");O.push("</div>\n");O.push("<div class='splitLine'></div>\n");O.push("<div class='memberLoginDialogItemList'>\n");O.push("<div id='memberLoginAcct' class='J_memberLoginItem memberLoginDialogItem'>\n");O.push("<input id='memberAcct' class='generateInput memberAcctInput' type='text' value='"+($.cookie("loginMemberAcct")==null?"":$.cookie("loginMemberAcct"))+"' placeholder='"+LS.loginDialogAcct+"' />\n");O.push("</div>\n");O.push("<div id='memberLoginPwd' class='J_memberLoginItem memberLoginDialogItem itemSpace'>\n");O.push("<input id='memberPwd' class='generateInput memberPwdInput' type='password' placeholder='"+LS.loginDialogPsw+"' onkeydown='if (Fai.isEnterKey(event)){$(\"#J_memberLoginDialogPanel .J_loginButton\").click();}'/>\n");O.push("</div>\n");O.push("<div class='J_memberLoginItem memberCaptcha memberLoginDialogItem'>\n");O.push("<input id='memberLoginCaptcha' class='memberCaptchaInput' type='text' placeholder='"+LS.loginDialogCaptcha+"' />\n");O.push("<img alt='' id='memberCaptchaImg' class='memberCaptchaImg' onclick='Site.changeCaptchaImg(this)' title='"+LS.msgBoradChageValidateCode+"'/>\n");O.push("</div>\n");if(M||N){O.push("<div class='memberLoginDialogItem'>\n");if(M){if(N){O.push("<div class='autoLogin'>\n");O.push("<input type='checkbox' value='1' id='memberLoginDialogAutoLogin' /><label for='memberLoginDialogAutoLogin'>"+LS.loginDialogRememberMe+"</label><label class='special' for='memberLoginDialogAutoLogin'>"+LS.loginDialogAutoLogin+"</label>\n")}else{O.push("<div class='autoLogin autoLogin_noFindPwd g_specialClass'>\n");O.push("<input type='checkbox' value='1' id='memberLoginDialogAutoLogin' /><label for='memberLoginDialogAutoLogin'>"+LS.loginDialogRememberMe+"</label><label for='memberLoginDialogAutoLogin'>"+LS.loginDialogAutoLogin+"</label>\n")}O.push("</div>\n")}O.push("<div class='signup'>\n");if(N){O.push("<a hidefocus='true' href='javascript:;' onclick='Site.memberFdPwdStepOne(0);return false;'>"+LS.loginDialogFindPsw+"?</a>\n")}O.push("</div>\n");O.push("</div>\n")}O.push("<div class='memberLoginDialogItem memberLoginDialogItem_Button'>\n");O.push("<div class=' J_loginButton loginButton loginButton'>\n");O.push("<div class='left'></div>\n");O.push("<div class='middle'>"+LS.memberLogin+"</div>\n");O.push("<div class='right'></div>\n");O.push("</div>\n");O.push("</div>\n");O.push("</div>\n");return O}function E(O,M,L,N){if(M||L||N){console.log("test");O.push("<div class='thirdPartyLogin'>\n");O.push("<div class='thirdPartyTips'>"+LS.loginDialogUseThird+"</div>\n");O.push("<div class='thirdPartyGroup'>\n");if(M){O.push("<a id='ld_qqLogin' href='javascript:;' hidefocus='true' class='thirdPartyItem qq'></a>")}if(L){O.push("<a id='ld_wbLogin' href='javascript:;' hidefocus='true' class='thirdPartyItem sina'></a>")}if(N){if(Fai.top._siteDemo===true){O.push("<a id='ld_wxLogin' href='javascript:;' hidefocus='true' onclick='Fai.ing(\"样板网站无法登录。\", true)' class='thirdPartyItem wx'></a>")}else{O.push("<a id='ld_wxLogin' href='javascript:;' hidefocus='true' class='thirdPartyItem wx'></a>")}}O.push("</div>\n");O.push("</div>\n")}O.push("</div>\n");return O}function J(P,M,L,N){P.push("<div id='J_memberRegisterDialogPanel' class='memberRegisterDialogPanel' style='display:none;'>\n");P.push("<div class='loginAndRegister'>\n");P.push("<div class='login'>"+LS.memberLogin+"</div>\n");P.push("<div class='register loginDialogSelected'>"+LS.memberReg+"</div>\n");P.push("</div>\n");P.push("<div class='splitLine'></div>\n");P.push("<div class='memberSignupContent' cellpadding='0' cellspacing='0'>\n");P.push("<div class='memberSignupItem itemSpace'>\n");P.push("<div class='itemMiddle'>\n");P.push("<input type='text' id='memberSignupAcct' placeholder='"+LS.loginDialogAcct+"' maxlength='"+v+"' />\n");P.push("</div>\n");P.push("<div class='itemRight'>*</div>\n");P.push("</div>\n");P.push("<div class='memberSignupItem itemSpace'>\n");P.push("<div class='itemMiddle'>\n");P.push("<input type='password' id='memberSignupPwd' placeholder='"+LS.loginDialogPsw+"' maxlength='"+v+"' />\n");P.push("</div>\n");P.push("<div class='itemRight'>*</div>\n");P.push("</div>\n");P.push("<div class='memberSignupItem itemSpace'>\n");P.push("<div class='itemMiddle'>\n");P.push("<input type='password' id='memberSignupRepwd' placeholder='"+LS.loginDialogConfirmPsw+"' maxlength='"+v+"' />\n");P.push("</div>\n");P.push("<div class='itemRight'>*</div>\n");P.push("</div>\n");P.push(j);if(A){P.push("<div class='memberSignupItem_remark itemSpace'>\n");P.push("<div class='itemMiddle'>\n");P.push("<textarea id='memberSignupRemark' placeholder='"+LS.loginDialogComment+"' maxlength='"+z+"'></textarea>\n");P.push("</div>\n");P.push("<div class='itemRight'></div>\n");P.push("</div>\n")}var O="J_memberSignupCaptcha memberSignupCaptchaHide";if(N||M){O="J_memberSignupCaptcha"}P.push("<div class='memberSignupItem_captcha "+O+"'>\n");P.push("<div class='itemMiddle' style='float:left;width: 150px;'>\n");P.push("<input id='memberSignupCaptcha' type='text' maxlength='4' placeholder='"+LS.loginDialogCaptcha+"' onkeydown='if (Fai.isEnterKey(event)){$(\"#J_memberRegisterButton\").click();}'/>\n");P.push("</div>\n");P.push("<div class='itemRight'><img alt='' id='memberSignupCaptchaImg' class='memberSignupCaptchaImg' onclick='Site.changeCaptchaImg(this)' title='"+LS.msgBoradChageValidateCode+"' src='validateCode.jsp?"+parseInt(Math.random()*1000)+"'/></div>\n");P.push("</div>\n");if(M){P.push("<div class='mobileItem itemSpace'>\n");P.push("<div class='itemMiddle'>\n");P.push("<input type='text' id='messageAuthCode' maxlength='6' placeholder='"+LS.loginDialogMsgCode+"' />\n");P.push("</div>\n");P.push("<div class='itemRight'><div title='"+LS.getMobileMsmCode+"' class='getMobileCdBtn' onclick='Site.getSignMobileCode(\"J_memberRegisterDialogPanel\",2)'>"+LS.getMobileMsmCode+"</div></div>\n");P.push("</div>\n")}P.push("</div>\n");if(L){P.push("<div class='memberSignupItem_regInfo'>\n");P.push("<div class='itemMiddle'>\n");P.push("<input type='checkbox' id='memberAgreePro' maxlength='"+z+"' checked /><label for='memberAgreePro'>"+LS.loginDialogReadAndAgree+"</label>\n");P.push("<a hidefocus='true' href='mProtocol.jsp' target='_blank'>《"+LS.loginDialogAgreement+"》</a>\n");P.push("</div>\n");P.push("</div>\n")}P.push("<div id='J_memberRegisterButton' class='memberSignupItem_signupButton'>\n");P.push("<div class='itemLeft'>&nbsp;</div>\n");P.push("<div class='itemMiddle'>"+LS.memberReg+"</div>\n");P.push("<div class='itemRight'>&nbsp;</div>\n");P.push("</div>\n");P.push("</div>\n");return P}function c(){$("#J_memberLoginDialogPanel .J_loginButton").off("click").on("click",function(){if(!_manageMode){Site.memberLogin4(D,e,r,F,h,B)}else{Fai.ing("您目前处于网站管理状态,请先点击网站右上方的“退出”后再登录会员。")}});$("#J_memberRegisterButton").off("click").on("click",function(){if(!_manageMode){Site.memberSignupDialogSubmit("J_memberRegisterDialogPanel",Fai.top.location.href,2,D,e,r,F,h,B)}else{Fai.ing("您目前处于网站管理状态,请先点击网站右上方的“退出”后再注册会员。")}});$(".loginAndRegister").find(".login").off("click").on("click",function(){$("#J_memberLoginDialogPanel").show();$("#J_memberRegisterDialogPanel").hide()});$(".loginAndRegister").find(".register").off("click").on("click",function(){$("#J_memberLoginDialogPanel").hide();$("#J_memberRegisterDialogPanel").show()});$("#J_memberRegisterDialogPanel .memberSignupContent").mCustomScrollbar({theme:"greyish-thin",scrollSpeed:10,advanced:{updateOnContentResize:true},axis:"y",callbacks:{}})}};Site.mallBuying={};Site.mallBuy2=function(e,a,p){if(_siteDemo){Fai.ing("当前为“模板网站”,请先“复制网站”再进行购买。");return}if(typeof(Site.mallBuying[e])=="undefined"){Site.mallBuying[e]=false}var f=false;$.each(Site.mallBuying,function(j,i){if(i){f=true;return false}});if(f){return}Site.mallBuying[e]=true;var n="id="+e;if(a&&a!="undefined"){var c;if(a==="PdSlide"){c=$("#fk-productSlideContent")}else{c=$("#module"+a)}var q=c.find(".optionMsg");if(Fai.isNull(c)){Site.mallBuying[e]=false;return}var r=true;var k=[];n+="&fromDetail=true";var m=$.cookie("isNeedAddCartItem");if(typeof m=="undefined"||m==null||m==""){c.find(".optionItemWrap").each(function(){var v=$(this);if(v.find(".optionItemHover").length==1){var u=v.attr("data"),t=v.attr("type"),i=v.find(".optionItemHover").attr("data"),w={};w.name=u;w.value=parseInt(i);if(t!=null){w.type=parseInt(t)}k.push(w);q.hide()}else{var j=v.parent().parent().find(".propName").text();if(j.charAt(j.length-1)==":"||j.charAt(j.length-1)==":"){j=j.substring(0,j.length-1)}q.show();q.html(Fai.format(LS.mallCartChoiceItemError,Fai.encodeHtml(j)));if(a==="PdSlide"){var y=$(this).parent().parent().position();var x=$(".fk-slideForProduct .f-propListContent");x.scrollTop(y.top)}r=false;return false}});if(Site.optionsStr.oldOptionsStr!="null"&&Site.optionsStr.oldOptionsStr){var o=Site.optionsStr.oldOptionsStr.split("_"),d=[];for(var h=0;h<o.length;h++){for(var g=0;g<k.length;g++){if(k[g].name==o[h]){d.push(k[g])}}}k=d}if(!r){Site.mallBuying[e]=false;return false}if(k.length>0){n+="&optionList="+Fai.encodeUrl($.toJSON(k))}var b=$("#cartbuyCount"+a).val();var l=1;if(Fai.isInteger(b)){l=parseInt(b)}if(l<1){l=1}else{if(l>9999999){l=9999999}}$("#cartbuyCount"+a).val(l);n+="&amount="+l}else{var s=$.parseJSON(m);k=Fai.decodeUrl(s.opList);if(typeof k!="undefined"&&k!="[]"&&k!=""){n+="&optionList="+Fai.encodeUrl(k)}n+="&amount="+s.count;$.cookie("isNeedAddCartItem",null)}}$.ajax({type:"post",url:"ajax/order_h.jsp?cmd=addCartItem",data:n,error:function(){var j=Site.getDialogHtml({rt:Site.MallAjaxErrno.networkError},p);var i={htmlContent:j,width:382,height:115};Site.popupBox(i);Site.mallBuying[e]=false},success:function(i){var v=$.parseJSON(i);Site.refreshTopAndRightBarMallCartNum();if(v.rt==Site.MallAjaxErrno.login){Site.createLoginDialog(e,a,p,"addCartItem",Fai.encodeUrl($.toJSON(k)),l);Site.mallBuying[e]=false;return}var w=Site.getDialogHtml(v);Site.mallBuying[e]=false;if(!w){return}var u={};var t=parseInt(v.rt);if(t==Site.MallAjaxErrno.mallAmountZero||t==Site.MallAjaxErrno.outOfMallAmount){u={htmlContent:w,width:240,height:116,boxName:"mallAmountZero"}}else{if(t==Site.MallAjaxErrno.OutOfAllowAmount){u={htmlContent:w,width:240,height:116,boxName:"allowAmountFlow"}}else{if(t==Site.MallAjaxErrno.notAdded){u={htmlContent:w,width:240,height:116,boxName:"notAdded"}}else{if(t==Site.MallAjaxErrno.authMemberNotAllow){u={htmlContent:w,width:240,height:100,boxName:"authMemberNotAllow"}}else{u={htmlContent:w,width:372,height:150,boxName:"mallBuy"}}}}}var j=Site.popupBox(u)}});if(Fai.isIE()){window.event.cancelBubble=true;window.event.returnValue=false}else{if(!Fai.isMozilla()){event.stopPropagation();event.preventDefault()}}};Site.initOptionsStr=function(a){Site.optionsStr.oldOptionsStr=a};Site.optionsStr={};Site.mallImmeBuying=false;Site.mallImmeBuy=function(f,b){if(_siteDemo){Fai.ing("当前为“模板网站”,请先“复制网站”再进行立刻购买。");return}if(Site.mallImmeBuying){return}Site.mallImmeBuying=true;var n="id="+f;var d;if(b==="PdSlide"){d=$("#fk-productSlideContent")}else{d=$("#module"+b)}var m=$.cookie("isNeedAddCartItem");if(typeof m=="undefined"||m==null||m==""){if(b&&b!="undefined"){var p=d.find(".optionMsg");if(Fai.isNull(d)){return}var r=true;var k=[];n+="&fromDetail=true";d.find(".optionItemWrap").each(function(){var v=$(this);if(v.find(".optionItemHover").length==1){var u=v.attr("data"),t=v.attr("type"),i=v.find(".optionItemHover").attr("data"),w={};w.name=u;w.value=parseInt(i);if(t!=null){w.type=parseInt(t)}k.push(w);p.hide()}else{var j=v.parent().parent().find(".propName").text();if(j.charAt(j.length-1)==":"||j.charAt(j.length-1)==":"){j=j.substring(0,j.length-1)}p.show();p.html(Fai.format(LS.mallCartChoiceItemError,Fai.encodeHtml(j)));if(b==="PdSlide"){var y=$(this).parent().parent().position();var x=$(".fk-slideForProduct .f-propListContent");x.scrollTop(y.top)}r=false;return false}});if(Site.optionsStr.oldOptionsStr!="null"&&Site.optionsStr.oldOptionsStr){var o=Site.optionsStr.oldOptionsStr.split("_"),e=[];for(var h=0;h<o.length;h++){for(var g=0;g<k.length;g++){if(k[g].name==o[h]){e.push(k[g])}}}k=e}if(!r){Site.mallImmeBuying=false;return false}if(k.length>0){n+="&optionList="+Fai.encodeUrl($.toJSON(k))}}var q=$("#cartbuyCount"+b),c=q.val(),l=1;if(Fai.isInteger(c)){l=parseInt(c)}if(l<1){l=1}else{if(l>9999999){l=9999999}}q.val(l);var a={pid:f,amount:l,optList:$.toJSON(k)};n+="&amount="+l+"&codata="+$.toJSON(a)}else{var k=[];var s=$.parseJSON(m);k=Fai.decodeUrl(s.opList);if(b&&b!="undefined"){n+="&fromDetail=true";if(typeof k!="undefined"&&k!="[]"&&k!=""){n+="&optionList="+Fai.encodeUrl(k)}}var a={pid:s.pid,amount:s.count,optList:k};n+="&amount="+s.count+"&codata="+$.toJSON(a);$.cookie("isNeedAddCartItem",null)}$.ajax({type:"post",url:"ajax/order_h.jsp?cmd=addIme",data:n,error:function(){Site.mallImmeBuying=false;Fai.ing(LS.networkError,true)},success:function(i){Site.mallImmeBuying=false;var j=$.parseJSON(i);if(j.rt==Site.MallAjaxErrno.login){Site.createLoginDialog(f,b,"","immeBuy",Fai.encodeUrl($.toJSON(k)),l)}else{if(j.rt==Site.MallAjaxErrno.mallAmountZero){Fai.ing(LS.mallAmountZero,true)}else{if(j.rt==Site.MallAjaxErrno.mallOptionStop){Fai.ing(LS.mallOptionStop,true)}else{if(j.rt==Site.MallAjaxErrno.outOfMallAmount){Fai.ing(LS.mallAmountOverFlow,true)}else{if(j.rt==Site.MallAjaxErrno.OutOfAllowAmount){Fai.ing(LS.allowAmountOverFlow,true)}else{if(j.rt==Site.MallAjaxErrno.notAdded){Fai.ing(LS.mallProductNotAdded,true)}else{if(j.rt==Site.MallAjaxErrno.authMemberNotAllow){Fai.ing(j.data+LS.authLevelBuy,true)}else{Fai.top.location.href=Site.getHtmlUrl("mstl")+"?imme"}}}}}}}}});if(Fai.isIE()){window.event.cancelBubble=true;window.event.returnValue=false}else{if(!Fai.isMozilla()){event.stopPropagation();event.preventDefault()}}};Site.desMallCartAmount=function(d,f,h,n,i,s,g,b){var e=Fai.top.$("#module"+d);var r=e.find(".itemLine"+f);var q=r.find(".amountEdit");var m=parseInt(q.val());var l=r.find(".J_mcart-pdSelect").prop("checked");var k=m;m--;if(m<i||m==i){m=i;$("#buyCountDes"+d+"_"+f).addClass("disableMallJian");$("#buyCountInc"+d+"_"+f).removeClass("disableMallJia")}else{if(m>9999998){m=9999999;$("#buyCountDes"+d+"_"+f).removeClass("disableMallJian");$("#buyCountInc"+d+"_"+f).addClass("disableMallJia")}else{$("#buyCountDes"+d+"_"+f).removeClass("disableMallJian");$("#buyCountInc"+d+"_"+f).removeClass("disableMallJia")}}q.val(m);if(g!=0&&b){q.parents(".itemAmount").find(".noStockTip").html("")}if(k!=m&&l){Site.mallCartAmountChange(d,f,h,n,i,s,g,b)}else{var c=parseFloat(r.find(".amountEdit").attr("_itemprice"),2);var o=parseInt(r.find(".amountEdit").val());var j=(c*o);if(Fai.top._lcid!=2052&&Fai.top._lcid!=1028){j=Fai.formatPriceEn(j)}else{j=j.toFixed(2)}r.find(".itemTotalText").text(j)}};Site.incMallCartAmount=function(d,f,h,n,i,s,g,b){var e=Fai.top.$("#module"+d);var r=e.find(".itemLine"+f);var q=r.find(".amountEdit");var m=parseInt(q.val());var k=m;var l=r.find(".J_mcart-pdSelect").prop("checked");m++;if(m<2){m=1;$("#buyCountDes"+d+"_"+f).addClass("disableMallJian");$("#buyCountInc"+d+"_"+f).removeClass("disableMallJia")}else{if((m>s||m==s)&&s!=0){m=s;$("#buyCountDes"+d+"_"+f).removeClass("disableMallJian");$("#buyCountInc"+d+"_"+f).addClass("disableMallJia")}else{if(m>9999998){m=9999999;$("#buyCountDes"+d+"_"+f).removeClass("disableMallJian");$("#buyCountInc"+d+"_"+f).addClass("disableMallJia")}else{$("#buyCountDes"+d+"_"+f).removeClass("disableMallJian");$("#buyCountInc"+d+"_"+f).removeClass("disableMallJia")}}}q.val(m);if(g!=0&&b){q.parents(".itemAmount").find(".noStockTip").html("")}if(k!=m&&l){Site.mallCartAmountChange(d,f,h,n,i,s,g,b)}else{var c=parseFloat(r.find(".amountEdit").attr("_itemprice"),2);var o=parseInt(r.find(".amountEdit").val());var j=(c*o);if(Fai.top._lcid!=2052&&Fai.top._lcid!=1028){j=Fai.formatPriceEn(j)}else{j=j.toFixed(2)}r.find(".itemTotalText").text(j)}};Site.mallCartAmountChange=function(b,d,f,m,j,o,e,a){var c=Fai.top.$("#module"+b);var n=c.find(".itemLine"+d);var g=n.find(".amountEdit");var i=g.val();var h=1;var k=n.find(".J_mcart-pdSelect").prop("checked");if(Fai.isInteger(i)){h=parseInt(i)}if(h<j){h=j;$("#buyCountDes"+b+"_"+d).addClass("disableMallJian");$("#buyCountInc"+b+"_"+d).removeClass("disableMallJia")}else{if((h>o||h==o)&&o!=0){h=o;$("#buyCountDes"+b+"_"+d).removeClass("disableMallJian");$("#buyCountInc"+b+"_"+d).addClass("disableMallJia")}else{if(h>e&&a){h=e;Fai.ing(LS.mallAmountOverFlow,true);$("#buyCountDes"+b+"_"+d).removeClass("disableMallJian");$("#buyCountInc"+b+"_"+d).addClass("disableMallJia")}else{if(h>9999998){h=9999999;$("#buyCountDes"+b+"_"+d).removeClass("disableMallJian");$("#buyCountInc"+b+"_"+d).addClass("disableMallJia")}else{$("#buyCountDes"+b+"_"+d).removeClass("disableMallJian");$("#buyCountInc"+b+"_"+d).removeClass("disableMallJia")}}}}if(h<=1){h=1;$("#buyCountDes"+b+"_"+d).addClass("disableMallJian")}if(e==0&&a){h=0;$("#buyCountInc"+b+"_"+d).addClass("disableMallJia");$("#buyCountDes"+b+"_"+d).addClass("disableMallJian")}else{g.parent().find(".noStockTip").html("")}g.val(h);var l=c.find(".cartMsg");if(isNaN(h)||h<=0||h>9999999){l.html(LS.mallCartAmountError);return}c.find(".amountEdit").attr("disabled",true);l.show();if(c.find(".mallCartNew").length>0){l.hide()}l.html(LS.mallCartUpdating);$.ajax({type:"post",url:"ajax/order_h.jsp?cmd=setItem&orderId="+f,data:"itemId="+m+"&amount="+h,error:function(){c.find(".amountEdit").removeAttr("disabled");l.html(LS.mallCartUpdateError)},success:function(p){c.find(".amountEdit").removeAttr("disabled");var p=jQuery.parseJSON(p);if(p.success){l.html(LS.mallCartUpdateOk);Site.reCountCartMoney(c)}else{if(p.rt==-3){l.html(LS.mallCartUpdateNotFound)}else{if(p.rt==-9){l.html(LS.mallCartUpdateStatusError)}else{l.html(LS.mallCartUpdateError)}}}}})};Site.reCountCartMoney=function(d){var b=d.find(".cartTotalValue");var g=b.attr("choiceCurrencyVal");var c=b.attr("levelDiscount");var a=b.attr("levelName");var f=0;var e=0;d.find(".itemListcount").each(function(){var p=$.parseJSON($(this).attr("saleInfo"));var n=$(this).find(".itemLine");if(d.find(".J_mallCart").hasClass("mallCartNew")){n=$(this).find(".goodsInfoLine")}if(typeof(n)!="undefined"&&n!=null&&n.length>0){var u=0;if(typeof(p)!="undefined"&&p!=null&&Site.checkSaleProVal(p)){var j=$(this).attr("lineno");var q=p.other.ruleData.d;if(p.other.ruleData.s=="1"||p.other.ruleData.s=="2"){var h=0;var l=0;n.each(function(){var i=Site.getEachItemPrice(this);var v=$(this).find(".J_mcart-pdSelect").prop("checked");if(Fai.top._lcid!=2052&&Fai.top._lcid!=1028){$(this).find(".itemTotalText").text(Fai.formatPriceEn(i))}else{$(this).find(".itemTotalText").text(i.toFixed(2))}if(v){l+=i}});var q=p.other.ruleData.d;var t=0;var m=0;for(var o=0;o<q.length;o++){var s=parseFloat(q[o].m);var k=parseFloat(q[o].n);if(s<=0){s=0;k=0}if(l>=s){if(s>t){t=s;m=k}}}f+=l;e+=l-m;if(m>0){var r=[];r.push("<div class='needPay'>");r.push(g+(l-m).toFixed(2));r.push("</div>");r.push("<div class='itemTotalPay'>");r.push(g+l.toFixed(2));r.push("</div>");$(".J_salePrice_"+j).html(r.join(""));$(".J_salePrice_"+j).css("bottom","1px");$(".J_salePrice_"+j).parent(".showRedsalePro").find(".fullReduceCalss").addClass("fullReduceRed");$(".J_salePrice_"+j).parent(".showRedsalePro").find(".fullReduceCalss").removeClass("fullReduceGray");$(".J_salePrice_"+j).parent(".showRedsalePro").find(".fullReduceCalssRect").addClass("fullReduceRectRed");$(".J_salePrice_"+j).parent(".showRedsalePro").find(".fullReduceCalssRect").removeClass("fullReduceRectGray")}else{$(".J_salePrice_"+j).removeAttr("style");$(".J_salePrice_"+j).html(g+l.toFixed(2));$(".J_salePrice_"+j).parent(".showRedsalePro").find(".fullReduceCalss").addClass("fullReduceGray");$(".J_salePrice_"+j).parent(".showRedsalePro").find(".fullReduceCalss").removeClass("fullReduceRed");$(".J_salePrice_"+j).parent(".showRedsalePro").find(".fullReduceCalssRect").addClass("fullReduceRectGray");$(".J_salePrice_"+j).parent(".showRedsalePro").find(".fullReduceCalssRect").removeClass("fullReduceRectRed")}}}else{n.each(function(){p=$.parseJSON($(this).attr("saleInfo"));var v=$(this).find(".J_mcart-pdSelect").prop("checked");var i=Site.getEachItemPrice(this);if(v){u+=i;f+=i}if(Fai.top._lcid!=2052&&Fai.top._lcid!=1028){$(this).find(".itemTotalText").text(Fai.formatPriceEn(i))}else{$(this).find(".itemTotalText").text(i.toFixed(2))}})}e+=u}});Site.refreshTopAndRightBarMallCartNum();if(Fai.top._lcid!=2052&&Fai.top._lcid!=1028){if(d.has("mallCartNew")){$(".J_countTotal").html(LS.goodsTotalMoney+"<span class='countTotalText'>"+g+Fai.formatPriceEn(f)+"</span>");$(".J_countSave").html("&nbsp;&nbsp;&nbsp;"+LS.offsetMoney+"<span class='countSaveText'>"+g+Fai.formatPriceEn(f-e)+"</span>");d.find(".cartTotalValue").html("<span class='currencyValText'>"+g+"</span>"+Fai.formatPriceEn(e))}else{$(".J_countTotal").html(LS.shoppingCartCountMoney+g+Fai.formatPriceEn(f));$(".J_countSave").html("&nbsp;&nbsp;&nbsp;"+LS.shoppingCartCountReduce+g+Fai.formatPriceEn(f-e));d.find(".cartTotalValue").html(g+Fai.formatPriceEn(e))}}else{if(d.has("mallCartNew")){$(".J_countTotal").html(LS.goodsTotalMoney+"<span class='countTotalText'>"+g+f.toFixed(2)+"</span>");$(".J_countSave").html("&nbsp;&nbsp;&nbsp;"+LS.offsetMoney+"<span class='countSaveText'>"+g+(f-e).toFixed(2)+"</span>");d.find(".cartTotalValue").html("<span class='currencyValText'>"+g+"</span>"+e.toFixed(2))}else{$(".J_countTotal").html(LS.shoppingCartCountMoney+g+f.toFixed(2));$(".J_countSave").html("&nbsp;&nbsp;&nbsp;"+LS.shoppingCartCountReduce+g+(f-e).toFixed(2));d.find(".cartTotalValue").html(g+e.toFixed(2))}}};Site.getEachItemPrice=function(d){var c=parseFloat($(d).find(".amountEdit").attr("_itemprice"),2);var b=parseInt($(d).find(".amountEdit").val());if(isNaN(b)){return parseFloat($(d).find(".itemTotalText").html())}else{return(c*b)}};Site.showSaleRedPromotion=function(e,c,a,m,k){if(typeof(e)=="undefined"||typeof(c)=="undefined"||e==null||c==null){return}if(c<0){return}var h=$(".showRedsalePro").eq(0).width();var l=$(".J_fullReduceCalss_"+c).eq(0).width();if(Site.checkSaleProVal(e)){var f=e.other.ruleData.d;if(f.length>0){var g="";var b=[];for(var d=0;d<f.length;d++){if(typeof(f[d].m)!="undefined"&&typeof(f[d].n)!="undefined"){if(d!=0){b.push(LS.comma)}if(Fai.top._lcid!=2052&&Fai.top._lcid!=1028){b.push(Fai.format(LS.salePromotionFullReduce,Fai.formatPriceEn(f[d].m,null,true),Fai.formatPriceEn(f[d].n,null,true)))}else{b.push(Fai.format(LS.salePromotionFullReduce,f[d].m,f[d].n))}}}if(e.other.ruleData.s=="1"){g=Fai.format(LS.salePromotionSigle,b.join(""))}else{if(e.other.ruleData.s=="2"){g=Fai.format(LS.salePromotionGroup,b.join(""))}}$(".J_saleWord_"+c).css({left:(45+l)+"px",width:(h-235-l)+"px"});$(".J_saleWord_"+c).html(g);$(".J_saleWord_"+c).attr("title",g)}}if(typeof(a)=="undefined"||typeof(m)=="undefined"||typeof(k)=="undefined"||a==null||m==null||k==null){return}if(a==m){if(Fai.top._lcid!=2052&&Fai.top._lcid!=1028){$(".J_salePrice_"+c).html(k+Fai.formatPriceEn(a))}else{$(".J_salePrice_"+c).html(k+a.toFixed(2))}}else{var j=[];if(Fai.top._lcid!=2052&&Fai.top._lcid!=1028){j.push("<div class='needPay'>");j.push(k+Fai.formatPriceEn(a));j.push("</div>");j.push("<div class='itemTotalPay'>");j.push(k+Fai.formatPriceEn(m));j.push("</div>")}else{j.push("<div class='needPay'>");j.push(k+a.toFixed(2));j.push("</div>");j.push("<div class='itemTotalPay'>");j.push(k+m.toFixed(2));j.push("</div>")}$(".J_salePrice_"+c).html(j.join(""));$(".J_salePrice_"+c).css("bottom","1px");$(".J_salePrice_"+c).parent(".showRedsalePro").find(".fullReduceCalss").addClass("fullReduceRed");$(".J_salePrice_"+c).parent(".showRedsalePro").find(".fullReduceCalss").removeClass("fullReduceGray");$(".J_salePrice_"+c).parent(".showRedsalePro").find(".fullReduceCalssRect").addClass("fullReduceRectRed");$(".J_salePrice_"+c).parent(".showRedsalePro").find(".fullReduceCalssRect").removeClass("fullReduceRectGray")}};Site.showCountPrice=function(e,b,g,c,a,d){if(typeof(e)=="undefined"||typeof(b)=="undefined"||typeof(g)=="undefined"||e==null||b==null||g==null){return}var h=b-e;if(Fai.top._lcid!=2052&&Fai.top._lcid!=1028){h=Fai.formatPriceEn(h);b=Fai.formatPriceEn(b);e=Fai.formatPriceEn(e)}else{h=h.toFixed(2);b=b.toFixed(2);e=e.toFixed(2)}if(d){$(".J_countTotal").html(LS.goodsTotalMoney+"<span class='countTotalText'>"+g+b+"</span>");$(".J_countSave").html("&nbsp;&nbsp;&nbsp;"+LS.offsetMoney+"<span class='countSaveText'>"+g+h+"</span>");var f=[];f.push("<span class='cartTotalName'>");f.push(LS.finalPayMoney);f.push("</span>");f.push("<span class='cartTotalValue mCart_color' choiceCurrencyVal ='"+g+"' levelDiscount='"+c+"' levelName='"+a+"' >");f.push("<span class='currencyValText'>"+g+"</span>"+e);f.push("</span>");$(".J_countNeedPay").html(f.join(""))}else{$(".J_countTotal").html(LS.shoppingCartCountMoney+g+b);$(".J_countSave").html("&nbsp;&nbsp;&nbsp;"+LS.shoppingCartCountReduce+g+h);var f=[];f.push("<span class='cartTotalName'>");f.push(LS.shouldPayMoney);f.push("</span>");f.push("<span class='cartTotalValue g_stress' choiceCurrencyVal ='"+g+"' levelDiscount='"+c+"' levelName='"+a+"' >");f.push(g+e);f.push("</span>");$(".J_countNeedPay").html(f.join(""))}};Site.showSaleMemOrRedPrice=function(d,a,i,h,b){if(typeof(d)!="undefined"&&d!=null){if(Site.checkSaleProVal(d)){var e=d.other.ruleData.d;if(e.length>0){var f="";var c=e[0].m;if(d.other.ruleData.s=="1"){if(_lcid==2052||_lcid==1028){f=Fai.format(LS.salePromotionPdDisCount,c.toFixed(1))}else{f=Fai.format(LS.salePromotionPdDisCount,Fai.formatPriceEn(10*(10-c),1))}}else{if(d.other.ruleData.s=="2"){if(_lcid==2052||_lcid==1028){f=Fai.format(LS.salePromotionPdLapse,h+c.toFixed(2))}else{f=Fai.format(LS.salePromotionPdLapse,h+Fai.formatPriceEn(c))}}}var g=[];g.push("<div class='saleMemOrRedName'>");g.push("<table cellpadding='0' cellspacing='0'><tr>");g.push("<td>");g.push(LS.salePromotionName);g.push("</td>");g.push("<td>");g.push("<div class='saleMemOrJt'>");g.push("</div>");g.push("</td>");g.push("</tr></table>");g.push("</div>");g.push("<div class='saleMemOrRedVal'>");g.push(LS.salePromotionActivity+Fai.encodeHtml(d.name));g.push("<div style='height:3px;'></div>");g.push(f);g.push("</div>");$(".J_itemPrice_"+b).filter(":not('.mallCartNew .J_itemPrice_"+b+"')").css("margin-top","-18px");$(".J_saleMemOrRedPrice_"+b).html(g.join(""))}}}else{if(a>0&&a<1){var g=[];g.push("<div class='saleMemOrRedName'>");g.push("<table cellpadding='0' cellspacing='0'><tr>");g.push("<td>");g.push(LS.memberPrice);g.push("</td>");g.push("<td>");g.push("<div class='saleMemOrJt'>");g.push("</div>");g.push("</td>");g.push("</tr></table>");g.push("</div>");g.push("</div>");g.push("<div class='saleMemOrRedVal'>");a=Math.round(a*100);g.push(i+Fai.format(LS.salePromotionRedVal,"*"+a+"%"));g.push("</div>");$(".J_itemPrice_"+b).filter(":not('.mallCartNew .J_itemPrice_"+b+"')").css("margin-top","-18px");$(".J_saleMemOrRedPrice_"+b).html(g.join(""))}}};Site.checkSaleProVal=function(a){if(typeof(a.other)!="undefined"){if(typeof(a.other.ruleData)!="undefined"){if(typeof(a.other.ruleData.s)!="undefined"&&typeof(a.other.ruleData.d)!="undefined"){if(a.other.ruleData.d!=null&&a.other.ruleData.d.length>0){return true}}}}return false};Site.showSaleMemOrRedValInIE=function(){$(".saleProSignHover").hover(function(){$(this).find(".saleMemOrRedName").css("border-bottom-width","0px");$(this).find(".saleMemOrRedVal").css({"background-color":"#ffefe9",display:"block"});$(this).find(".saleMemOrJt").addClass("saleMemOrJtUp")},function(){$(this).find(".saleMemOrRedName").css("border-bottom-width","1px");$(this).find(".saleMemOrRedVal").css({"background-color":"#ffefe9",display:"none"});$(this).find(".saleMemOrJt").removeClass("saleMemOrJtUp")})};Site.mallCartItemDel=function(h,e,a,g,d,c){var b=Fai.top.$("#module"+h);var f=b.find(".cartMsg");f.show();if(b.find(".mallCartNew").length>0){f.hide()}f.html(LS.mallCartUpdating);$.ajax({type:"post",url:"ajax/order_h.jsp?cmd=delItem&orderId="+a,data:"itemId="+g,error:function(){f.html(LS.mallCartUpdateError)},success:function(s){var s=jQuery.parseJSON(s);if(s.success){f.html(LS.mallCartUpdateOk);var q=b.find(".itemLine"+e);var p=q.parent();var m=p.find(".itemLine");var j=m.length;var n=0;for(var l=0;l<j;l++){if(q.attr("class")==m.eq(l).attr("class")){n=l;break}}if(j>1){if(n==(j-1)){p.find(".separatorLine").eq((n-1)).remove();var k=m.eq((j-1)).find(".J_saleXuXian").attr("style");m.eq((j-2)).find(".J_saleXuXian").attr("style",k)}else{b.find(".separatorLine"+e).remove()}}q.remove();if(j==1){var o=p.attr("lineno");b.find(".J_saleRemove_"+o).remove()}setTimeout(function(){var i=b.find(".J_saleTabItem_"+c).length;if(i<=0){b.find(".J_saleTabRemove_"+c).remove()}},100);var r=b.find(".itemLine");if(r.length==0){Fai.top.location.reload()}else{Site.reCountCartMoney(b)}}else{if(s.rt==-3){f.html(LS.mallCartUpdateNotFound)}else{if(s.rt==-9){f.html(LS.mallCartUpdateStatusError)}else{f.html(LS.mallCartUpdateError)}}if(b.find(".mallCartNew").length>0){f.hide()}}}})};Site.mallSettle=function(b){var c=$(".J_mcart-pdSelect").not("input:checked");var a=$(".J_mcart-pdSelect").filter("input:checked");var e=new Array();$(c).each(function(){var f=$(this).attr("itemId");e.push(f)});$(".J_mallCart .J_Invalid").each(function(){var f=$(this).attr("itemid");e.push(f)});if(a.length>500){Fai.ing(LS.mcartTooLong)}else{if(a.length){var d=false;$(a).each(function(){var g=Number($(this).parents(".goodsInfoLine").find(".itemAmount .amountEdit").val());var h=Number($(this).attr("_realAmount"));var f=$(this).attr("_enableMallAmount");if((g>h)&&f=="true"){d=true;return false}});if(d){Fai.ing(LS.mallAmountOverFlow);return}if(b>0){Fai.top.location.href=Site.getHtmlUrl("mstl")+"?id="+b+"&unCheckedItemIds="+e}else{Fai.top.location.href=Site.getHtmlUrl("mstl")}}else{Fai.ing(LS.mallSelectSettleItem)}}};Site.mallSelectAllShop=function(g,e){var d=$("#module"+g),f=d.find("#selectAll"),h=d.find(".J_mcart-pdSelect"),b=d.find(".J_mcart-pdSelect:checked"),a=h.not("input:checked");var c=f.prop("checked");if(!e){if(c){a.click();f.prop("checked",true)}else{b.click();f.prop("checked",false)}}else{h.prop("checked",c)}Site.setCheckBoxToFalgDiv(d);Site.reCountCartMoney(d)};Site.mallSelectShop=function(d){var b=$("#module"+d),c=b.find(".J_mcart-pdSelect"),a=b.find("#selectAll");a.prop("checked",true);$.each(c,function(e,f){if(!$(f).prop("checked")){a.prop("checked",false);return false}});Site.setCheckBoxToFalgDiv(b);Site.reCountCartMoney(b)};Site.mallStlPayMode=function(b,c){var a=Fai.top.$("#module"+b);a.find("input[name=mallPay]").val(c);if(c==2){a.find(".bankList").show()}else{a.find(".bankList").hide()}if(c==3||c==4||c==5||c==6||c==7||c==8||c==9||c==10||c==11||c==12||c==13){a.find(".payOnlinePanel").show();a.find(".payOnlinePanel input[value='"+c+"']").click();if(c===8||c===11||c===13){$(a.find(".payOnlinePanel input[type='radio']")[0]).click()}}else{a.find(".payOnlinePanel").hide()}};Site.mallStlCalcTotal=function(a){var b=Fai.top.$("#module"+a);var e=parseFloat(b.find(".cartTotal").attr("pay_price"));if(isNaN(e)){return}var c=parseFloat(b.find("input[name=mallShip]:checked").attr("price"));if(isNaN(c)){c=0}if($("#mallShipTemplate_province").length>0){var i=b.find("input[name=mallShip]:checked");i.attr("provinceCode",$.trim($("#mallShipTemplate_areaBoxInput").attr("area1")));i.attr("cityCode",$.trim($("#mallShipTemplate_areaBoxInput").attr("area2")));i.attr("countyCode",$.trim($("#mallShipTemplate_areaBoxInput").attr("area3")));i.attr("streetCode",$.trim($("#mallShipTemplate_areaBoxInput").attr("area4")));i.attr("isCus",$.trim($("#mallShipTemplate_areaBoxInput").attr("isCus")))}var f=0;if($("#offsetMoney").length>0){var h=$("#offsetMoney").attr("_offsetmoney");if(!isNaN(h)){f=parseFloat(h);if((e+c)<f){Fai.ing(Fai.format(LS.integral_maxUse,$("#useItg").attr("_maxuse"),Fai.encodeHtml($("#useItg").attr("__itegName"))),true);$("#useItg").focus();if(Fai.top._lcid!=2052&&Fai.top._lcid!=1028){b.find(".mallStlTotal .totalValue").text(Fai.formatPriceEn(e+c))}else{b.find(".mallStlTotal .totalValue").text((e+c).toFixed(2))}return}}}var g=0;if($("#couponOffsetMoney").length>0){var h=$("#couponOffsetMoney").attr("_offsetmoney");if(!isNaN(h)){g=parseInt(h)}}if(e<(f+g)){return false}var d=parseInt(b.find("#presentItg").attr("value"));if(d>0){b.find("#presentItg").text(parseInt((e-f-g).toFixed(2)*d))}if(Fai.top._lcid!=2052&&Fai.top._lcid!=1028){b.find("#shippingMoneyVal").text(Fai.formatPriceEn(c)).attr("_shipmoney",c);b.find(".mallStlTotal .totalValue").text(Fai.formatPriceEn(e+c-f-g))}else{b.find("#shippingMoneyVal").text(c.toFixed(2)).attr("_shipmoney",c);b.find(".mallStlTotal .totalValue").text((e+c-f-g).toFixed(2))}};Site.mallStlChangeBank=function(a){$("#"+a).attr("checked",true)};Site.mallNumeric=function(a){$("#module"+a+" .numeric").numeric({decimal:" ",negative:false})};Site.getBackgroundColor=function(a){var b="";while(a[0].tagName.toLowerCase()!="html"){b=a.css("background-color");if(b!="rgba(0, 0, 0, 0)"&&b!="transparent"){break}a=a.parent()}return b};Site.getMallSubmitData=function(f,v,t,e,q){var k="";f.find(".propItemValue").each(function(){var B=$(this),E=B.attr("_required")==1;if(B.hasClass("J-pccS")&&q){var G=($("#areaBoxInput").attr("isCus")==1);var y=$("#areaBoxInput").attr("area1");if(E&&(y==null||y=="")){k=LS.mallStlSubmitAddrErr;return false}var C=$("#areaBoxInput").attr("area2");if(E&&!G&&(C==null||C=="")){k=LS.mallStlSubmitAddrErr;return false}var I=$("#areaBoxInput").attr("area3"),A=$("#areaBoxInput").attr("area4"),w=$("#addrInfo_street"),J=$.trim($("#addrInfo_street").val());if(E&&J===""){k=LS.editStreetAddr;return false}var D=$("#areaBoxInput").val().replace(/-/g,"")+J;if(e!=0){var F={};F.provinceCode=y;F.cityCode=C;F.countyCode=I;F.streetCode=A;F.streetAddr=J;t.addr_info=F;t.addr=D;t.isDefault=1}v.addr=D}else{var H=B.attr("_field");var x;var z;if(H=="mobile"){x=B.find("input").val();if(x.length>0){if(!Fai.isNationMobile(x)){k=LS.mallStlSubmitInput2+B.attr("_prop");return false}else{z=B.find("select").val()}}else{z=""}}else{x=B.find("input").val()}if(E==1&&!x){k=LS.mallStlSubmitInput+B.attr("_prop");return false}if(x&&x.length>0){if(H==="email"&&!Fai.isEmail(x)){k=LS.mallStlSubmitInput2+B.attr("_prop");return false}if(H==="phone"&&!Fai.isPhone(x)){k=LS.mallStlSubmitInput2+B.attr("_prop");return false}}if(typeof H!=="undefined"){v[H]=x;if(e!=0&&q){t[H]=x;if(H=="mobile"&&x.length>0){t.mobileCt=z}}if(H=="mobile"&&x.length>0){v.mobileCt=z}}}});if(k!=""){return k}if(Site.orderMessageOpen){var p=Fai.decodeHtml($("#orderLeveaMsgIn").val());if(p.length>Site.orderMessageMaxNum){p=p.substring(0,Site.orderMessageMaxNum)}if(p!==Site.orderLeveaMsgTip){v.msg=p}else{v.msg=""}}else{v.msg=""}var c=f.find("input[name=mallShip]:checked");if($("#mallShipTemplate_province").length===1&&c.length===1){var i=parseInt(c.attr("provinceCode")),m=parseInt(c.attr("cityCode")),h=parseInt(c.attr("countyCode")),j=parseInt(c.attr("streetCode")),b=(c.attr("isCus")==1);if(!i||isNaN(i)||(!site_cityUtil.isValidProvince(i)&&!b)){k=LS.mallStlSubmitAddrErr;return k}if((!m||isNaN(m)||!site_cityUtil.isValidCity(m,i))&&!b){k=LS.mallStlSubmitAddrErr;return k}if(isNaN(i)){i=-1}if(isNaN(m)){m=-1}if(isNaN(h)){h=-1}if(isNaN(j)){j=-1}var l={type:parseInt(c.val()),templateId:parseInt(c.attr("templateId")),provinceCode:i,cityCode:m,countyCode:h,streetCode:j,isCus:b,streetAddr:$.trim($("#streetAddress").val())};if($.trim($("#streetAddress").val())==""){l.streetAddr=$.trim($("#addrInfo_street").val())}v.shipType=l}else{if(c.length===1){v.shipType=parseInt(c.val())}}var n=f.find("input[name=mallPay]:checked");if(n.length==1){v.payMode=parseInt(n.val())}var o=parseInt(n.val());var u=$("#useItg");if(u.length>0){var d=u.val();if(Fai.isInteger(d)){var g=parseInt(u.attr("_maxUse")),a=parseInt(u.attr("_currentitg")),s=u.attr("_itgname");if(d>a){k=Fai.format(LS.integral_notOverCurrent,Fai.encodeHtml(s),Fai.encodeHtml(s));return k}if(d>g){k=Fai.format(LS.integral_notOver,Fai.encodeHtml(s),g);return k}if(d<0){k=LS.integral_inputInteger;return k}v.useItg=parseInt(d)}else{if(d.length!=0){k=LS.integral_inputInteger;return k}}}if($("#presentItgShow").length>0){v.presentItg=true}if($("#couponList input:checked").length>0){var r=$("#couponList input:checked").attr("data_id");v.cdId=Number(r)}return k};Site.mallImmeSubmit=function(c,l,n,j){var i={},e={},c=Fai.top.$("#module"+c),f=c.find(".stlMsg");var d=Site.getMallSubmitData(c,i,e,l,n);if(d!=""){f.show();f.html(d);Site.scrollToDiv(c);return}var b=c.find(".mallStlOpt input");b.attr("disabled",true);f.show();f.html(LS.mallStlSubmitting);Site.scrollToDiv(c);if(l!=0&&n){var k={},g=[];g.push(e);k.addrInfoList=g;$.ajax({type:"post",url:action="ajax/memberAdm_h.jsp?cmd=set&opera=addAddr&id="+l,data:"info="+Fai.encodeUrl($.toJSON(k)),success:function(o){},error:function(){}})}if(i.payMode==5){var m=i.name;var a=new RegExp("[\\u4E00-\\u9FFF]+","g");if(m){if(m.length<2){if(!a.test(m)){f.hide();Site.scrollToDiv(c);Fai.ing(LS.orderValidRecvName);b.attr("disabled",false);return}}}else{if(l!=0&&j){var h="";if(j.length<2){if(!a.test(m)){h="会员"}}i.name=h+j}else{i.name="游客"}}}$.ajax({type:"post",url:"ajax/order_h.jsp?cmd=settle&imme",data:"data="+Fai.encodeUrl($.toJSON(i)),error:function(){b.removeAttr("disabled");f.html(LS.mallStlSubmitError)},success:function(o){b.removeAttr("disabled");var o=jQuery.parseJSON(o);if(o.success){Fai.top.location.href=Site.getHtmlUrl("mdetail")+"?id="+o.oid+"#firstSubmit"}else{if(o.rt==-3){f.html(LS.mallStlSubmitNotFound)}else{if(o.rt==-9){f.html(LS.mallStlSubmitStatusError)}else{if(o.rt==Site.MallAjaxErrno.outOfMallAmount){f.html(Fai.format(LS.mallAmountOverNameList,o.productsName))}else{f.html(LS.mallStlSubmitError)}}}}}})};Site.mallSubmit=function(e,a,b,q,n,p,l){if(a==0){Fai.top.location.href=Site.getHtmlUrl("mdetail");return}var k={},g={},e=Fai.top.$("#module"+e),h=e.find(".stlMsg");var f=Site.getMallSubmitData(e,k,g,n,p);if(f!=""){h.show();h.html(f);Site.scrollToDiv(e);return}var d=e.find(".mallStlOpt input");d.attr("disabled",true);h.show();h.html(LS.mallStlSubmitting);Site.scrollToDiv(e);if(n!=0&&p){var m={},i=[];i.push(g);m.addrInfoList=i;$.ajax({type:"post",url:action="ajax/memberAdm_h.jsp?cmd=set&opera=addAddr&id="+n,data:"info="+Fai.encodeUrl($.toJSON(m)),success:function(r){},error:function(){}})}if(k.payMode==5){var o=k.name;var c=new RegExp("[\\u4E00-\\u9FFF]+","g");if(o){if(o.length<2){if(!c.test(o)){h.hide();Site.scrollToDiv(e);Fai.ing(LS.orderValidRecvName);d.attr("disabled",false);return}}}else{if(n!=0&&l){var j="";if(l.length<2){if(!c.test(o)){j="会员"}}k.name=j+l}else{k.name="游客"}}}$.ajax({type:"post",url:"ajax/order_h.jsp?cmd=delItem&orderId="+a,data:"itemIds="+Fai.encodeUrl($.toJSON(b)),error:function(){d.removeAttr("disabled");h.html(LS.mallStlSubmitError)},success:function(){$.ajax({type:"post",url:"ajax/order_h.jsp?cmd=settle&orderId="+a,data:"data="+Fai.encodeUrl($.toJSON(k)),error:function(){d.removeAttr("disabled");h.html(LS.mallStlSubmitError)},success:function(r){d.removeAttr("disabled");var r=jQuery.parseJSON(r);if(r.success){$.ajax({type:"post",url:"ajax/order_h.jsp?cmd=addAfterShop",data:"data="+Fai.encodeUrl($.toJSON(q)),error:function(){d.removeAttr("disabled");h.html(LS.mallStlSubmitError)},success:function(s){Fai.top.location.href=Site.getHtmlUrl("mdetail")+"?id="+a+"#firstSubmit"}})}else{if(r.rt==-3){h.html(LS.mallStlSubmitNotFound)}else{if(r.rt==-9){h.html(LS.mallStlSubmitStatusError)}else{if(r.rt==Site.MallAjaxErrno.outOfMallAmount){h.html(Fai.format(LS.mallAmountOverNameList,r.productsName))}else{if(r.rt==Site.MallAjaxErrno.OutOfAllowAmount){h.html(Fai.format(LS.allowAmountOverNameList,r.productsName))}else{if(r.rt==Site.MallAjaxErrno.couponOverTime){h.html(LS.couponOverTime)}else{if(r.rt==Site.MallAjaxErrno.couponUnavail){h.html(LS.couponUnavail)}else{if(r.rt==Site.MallAjaxErrno.couponNotFound){h.html(LS.couponNotFound)}else{h.html(LS.mallStlSubmitError)}}}}}}}}}})}})};Site.initModuleMallAddrInfo=function(c,b,f,u,q){var t="-----------",A=[],m,C,r,z,D,o,B;if(Site.addrInfoListGlobal!=null&&Site.addrInfoListGlobal!=[]){c=Site.addrInfoListGlobal}site_cityUtil.initProvinces(u);if(c.length==0){var n="";n+="<div class='spaceLine'></div>";$.each(site_cityUtil.getAreaGroupsPinYin(),function(j,E){n+="<div class='pv_group' style='"+(E[0]=="OS"?"display:none;":"")+"'>";n+="<div class='group_head'>"+E[0]+"</div>";n+="<div class='group_content'>";$.each(E[1],function(F,i){if(u==2052||u==1028){n+="<div class='group_item' pid='"+i+"' pname='"+site_cityUtil.getInfo(i).name+"'>"+site_cityUtil.simpleProvinceNameStr(site_cityUtil.getInfo(i).name)+"</div>"}else{n+="<div class='group_item' pid='"+i+"' pname='"+site_cityUtil.getInfoEn(i).name+"'>"+site_cityUtil.simpleProvinceNameStrEn(site_cityUtil.getInfoEn(i).name)+"</div>"}});n+="</div>";n+="</div>";n+="<div class='spaceLine'></div>"});$("#areaBox1 .pv_content").html("").append(n);if($("#areaBox1").length>0){$("#areaBox1").css("left",$("#areaBoxInput").position().left+13)}$("#areaBoxInput").hide();var a=$(".J_isOldStyle2").length>0;if(a){$("#areaBox1").parents(".propList").css("overflow","visible")}$(document).unbind("click.forAreaBox3").bind("click.forAreaBox3",function(){$("#areaBox1").hide();$("#areaBox2").hide()});$("#areaBox1,#areaBox2").unbind("click.forAreaBox").bind("click.forAreaBox",function(i){k(i)});function k(i){if(i.stopPropagation){i.stopPropagation()}else{i.cancelBubble=true}}$("#allArea").change(function(){if($("#allArea").val()==null||$("#allArea").val()==""||$("#allArea").val()=="os"){$("#areaBoxInput").hide()}else{$("#areaBoxInput").show()}$("#areaBox1").hide();$("#areaBox2").hide();if($("#allArea").val()==null||$("#allArea").val()==""){return}$("#areaBoxInput").attr("isCn",0);$("#areaBoxInput").attr("isCus",0);$("#areaBoxInput").attr("isOs",0);$("#areaBoxInput").attr("area1","");$("#areaBoxInput").attr("area2","");$("#areaBoxInput").attr("area3","");$("#areaBoxInput").attr("area4","");if($("#allArea").val()=="cn"){$("#areaBoxInput").attr("isCn",1);$("#areaBox1 .pv").click();$("#areaBox1 .city_content").remove();$("#areaBox1 .county_content").remove();$("#areaBox1 .street_content").remove();$("#areaBox1").show();$("#areaBoxInput").val("")}else{if($("#allArea").val()=="os"){$("#areaBoxInput").attr("isOs",1);$("#areaBoxInput").attr("area1",990000);$("#areaBoxInput").attr("area2",990100);$("#areaBoxInput").val($("#areaBox1").find(".group_item[pid='990000']").text())}else{$("#areaBoxInput").attr("isCus",1);$("#areaBoxInput").attr("area1",$("#allArea").val());$("#areaBox2 .sec_content").html("");$("#areaBox2 .thd_content").html("");$("#areaBox2").show();$("#areaBoxInput").val("")}}$("#mallShipTemplate_allArea").val($("#allArea").val());$("#mallShipTemplate_allArea").change();if($("#allArea").val()=="cn"||$("#allArea").val()=="os"){return}var i=d($("#allArea").val());$("#sec_box .sec_content").append(i);$("#areaBoxInput").val($("#areaBoxInput").val()+$("#allArea option[value='"+$("#allArea").val()+"']").text());if(i===null||i===undefined||i===""){$("#areaBox2").hide();$(".J-ssq").hide();$("#areaBoxInput").hide()}});$("#areaBoxInput").unbind("click").bind("click",function(i){if($("#allArea").val()=="cn"){$("#areaBox1").toggle();$("#areaBox2").hide();$("#province_box").show();$("#city_box").hide();$("#county_box").hide();$("#street_box").hide()}else{if($("#allArea").val()==null||$("#allArea").val()=="os"){}else{$("#areaBox2").toggle();$("#areaBox1").hide();$("#sec_box").show();$("#thd_box").hide()}}k(i)});$("#areaBox1 .J_areaHead .pv").click(function(){$("#province_box").show();$("#city_box").hide();$("#county_box").hide();$("#street_box").hide()});$("#areaBox1 .J_areaHead .city").click(function(){$("#province_box").hide();$("#city_box").show();$("#county_box").hide();$("#street_box").hide()});$("#areaBox1 .J_areaHead .county").click(function(){$("#province_box").hide();$("#city_box").hide();$("#county_box").show();$("#street_box").hide()});$("#areaBox1 .J_areaHead .street").click(function(){$("#province_box").hide();$("#city_box").hide();$("#county_box").hide();$("#street_box").show()});$("#areaBox2 .J_areaHead2 .sec").click(function(){$("#sec_box").show();$("#thd_box").hide()});$("#areaBox2 .J_areaHead2 .thd").click(function(){$("#sec_box").hide();$("#thd_box").show()});$("#province_box .group_item").bind("click",function(){$("#areaBox1 .city_content").remove();$("#areaBox1 .county_content").remove();$("#areaBox1 .street_content").remove();var i=$(this).attr("pname");var j=$(this).attr("pid");$("#areaBox1 .J_areaHead .city").click();$("#areaBoxInput").val("");$("#areaBoxInput").val($("#areaBoxInput").val()+i);$("#areaBoxInput").removeAttr("lastArea");$("#areaBoxInput").removeAttr("lastAreaType");$("#areaBoxInput").attr("area1",j);$("#areaBoxInput").attr("area2","");$("#areaBoxInput").attr("area3","");$("#areaBoxInput").attr("area4","");$("#areaBox1 .city_content").remove();var F=s(site_cityUtil.getCities(j));var E=$(F).html();if(E===null||E===undefined||E===""){$("#areaBox1").hide()}$("#city_box").append(F);$("#mallShipTemplate_province_box .group_item[pid='"+j+"']").click()});$("#city_box").delegate(".group_item","click",function(){$("#areaBox1 .county_content").remove();$("#areaBox1 .street_content").remove();var i=$(this).attr("cname");var E=$(this).attr("cid");$("#areaBox1 .J_areaHead .county").click();var H=$("#areaBoxInput").attr("lastArea");var j=$("#areaBoxInput").attr("lastAreaType");if(j!=null&&j!=""){$("#areaBoxInput").val($("#areaBoxInput").val().substring(0,$("#areaBoxInput").val().indexOf("-")))}$("#areaBoxInput").val($("#areaBoxInput").val()+"-"+i);$("#areaBoxInput").attr("lastArea","-"+i);$("#areaBoxInput").attr("lastAreaType","city");$("#areaBoxInput").attr("area2",E);$("#areaBoxInput").attr("area3","");$("#areaBoxInput").attr("area4","");$("#areaBox1 .county_content").remove();var G=l(site_cityUtil.getCounty(E));var F=$(G).html();if(F===null||F===undefined||F===""){$("#areaBox1").hide()}$("#county_box").append(G);$("#mallShipTemplate_city_box .group_item[cid='"+E+"']").click()});$("#county_box").delegate(".group_item","click",function(){$("#areaBox1 .street_content").remove();var j=$(this).attr("cname");var F=$(this).attr("cid");var H=$("#areaBoxInput").attr("lastArea");var E=$("#areaBoxInput").attr("lastAreaType");$("#areaBox1 .J_areaHead .street").click();if(E!=null&&(E=="street"||E=="county")){$("#areaBoxInput").val($("#areaBoxInput").val().substring(0,$("#areaBoxInput").val().indexOf("-",$("#areaBoxInput").val().indexOf("-")+1)))}$("#areaBoxInput").val($("#areaBoxInput").val()+"-"+j);$("#areaBoxInput").attr("lastArea","-"+j);$("#areaBoxInput").attr("lastAreaType","county");$("#areaBoxInput").attr("area3",F);$("#areaBoxInput").attr("area4","");var i=v(site_cityUtil.getStreet(F));var G=$(i).html();if(G===null||G===undefined||G===""){$("#areaBox1").hide()}$("#street_box").append(i);$("#mallShipTemplate_county_box .group_item[cid='"+F+"']").click()});$("#street_box").delegate(".group_item","click",function(){var i=$(this).attr("cname");var E=$(this).attr("cid");var F=$("#areaBoxInput").attr("lastArea");var j=$("#areaBoxInput").attr("lastAreaType");if(j!=null&&j=="street"){$("#areaBoxInput").val($("#areaBoxInput").val().replace(F,""))}$("#areaBoxInput").val($("#areaBoxInput").val()+"-"+i);$("#areaBoxInput").attr("lastArea","-"+i);$("#areaBoxInput").attr("lastAreaType","street");$("#areaBoxInput").attr("area4",E);$("#areaBox1").hide();$("#mallShipTemplate_street_box .group_item[cid='"+E+"']").click()});$("#sec_box").delegate(".group_item","click",function(){$("#areaBox2 .thd_content").html("");var i=$(this).attr("cname");var E=$(this).attr("cid");$(".J_areaHead2 .thd").click();var G=$("#areaBoxInput").attr("lastArea");var j=$("#areaBoxInput").attr("lastAreaType");if(j!=null&&j!=""&&$("#areaBoxInput").val().indexOf("-")!=-1){$("#areaBoxInput").val($("#areaBoxInput").val().substring(0,$("#areaBoxInput").val().indexOf("-")))}$("#areaBoxInput").val($("#areaBoxInput").val()+"-"+i);$("#areaBoxInput").attr("lastArea","-"+i);$("#areaBoxInput").attr("lastAreaType","sec");$("#areaBoxInput").attr("area2",E);$("#areaBoxInput").attr("area3","");var F=d(E);if(F===null||F===undefined||F===""){$("#areaBox2").hide()}$("#thd_box .thd_content").append(F);$("#mallShipTemplate_sec_box .group_item[cid='"+E+"']").click()});$("#thd_box").delegate(".group_item","click",function(){var i=$(this).attr("cname");var E=$(this).attr("cid");var F=$("#areaBoxInput").attr("lastArea");var j=$("#areaBoxInput").attr("lastAreaType");if(j!=null&&j=="thd"){$("#areaBoxInput").val($("#areaBoxInput").val().replace(F,""))}$("#areaBoxInput").val($("#areaBoxInput").val()+"-"+i);$("#areaBoxInput").attr("lastArea","-"+i);$("#areaBoxInput").attr("lastAreaType","thd");$("#areaBoxInput").attr("area3",E);$("#areaBox2").hide();$("#mallShipTemplate_thd_box .group_item[cid='"+E+"']").click()})}$(".addrMsg_default, .addrMsg").click(function(){var H=$(this).attr("_item");$(this).find(".selected").show();if($(this).parent().find(".addrMsg_default").hasClass("isDefault")){$(this).parent().find(".addrMsg_default").attr("class","addrMsg isDefault")}else{$(this).parent().find(".addrMsg_default").attr("class","addrMsg notDefault")}if($(this).hasClass("isDefault")){$(this).attr("class","addrMsg_default isDefault")}else{$(this).attr("class","addrMsg_default notDefault")}$(this).parent().find(".addrMsg_default, .addrMsg").each(function(){if($(this).attr("_item")!=H){$(this).find(".selected").hide()}});var F=c[H];if(F.addr_info!=null){var J=F.addr_info["isCus"];if(!J){var M="";var K="";var I="";var E="";if(u==2052||u==1028){M=site_cityUtil.getInfo(F.addr_info.countyCode).name;K=site_cityUtil.getInfo(F.addr_info.cityCode).name;I=site_cityUtil.getInfo(F.addr_info.provinceCode).name;E=site_cityUtil.getInfo(F.addr_info.streetCode).name}else{M=site_cityUtil.getInfoEn(F.addr_info.countyCode).name;K=site_cityUtil.getInfoEn(F.addr_info.cityCode).name;I=site_cityUtil.getInfoEn(F.addr_info.provinceCode).name;E=site_cityUtil.getInfoEn(F.addr_info.streetCode).name}if(F.addr_info.provinceCode==990000){$("#mallShipTemplate_areaBoxInput").attr("isOs",1);$("#mallShipTemplate_allArea").val("os");$("#mallShipTemplate_allArea").change()}else{$("#mallShipTemplate_areaBoxInput").attr("isCn",1);$("#mallShipTemplate_allArea").val("cn");$("#mallShipTemplate_allArea").change()}$("#mallShipTemplate_areaBoxInput").attr("area1",F.addr_info.provinceCode);$("#mallShipTemplate_areaBoxInput").attr("area2",F.addr_info.cityCode);$("#mallShipTemplate_areaBoxInput").attr("area3",F.addr_info.countyCode);$("#mallShipTemplate_areaBoxInput").attr("area4",F.addr_info.streetCode);$("#mallShipTemplate_areaBoxInput").attr("lastArea","-"+M);$("#mallShipTemplate_areaBoxInput").attr("lastAreaType","county");setTimeout(function(){$("#mallShipTemplate_areaBox1 .group_item[pid='"+F.addr_info.provinceCode+"']").click();setTimeout(function(){$("#mallShipTemplate_areaBox1 .group_item[cid='"+F.addr_info.cityCode+"']").click();setTimeout(function(){$("#mallShipTemplate_areaBox1 .group_item[cid='"+F.addr_info.countyCode+"']").click();setTimeout(function(){$("#mallShipTemplate_areaBox1 .group_item[cid='"+F.addr_info.streetCode+"']").click()},0)},0)},0)},0);$("#streetAddress").val(F.addr_info.streetAddr)}else{setTimeout(function(){$("#mallShipTemplate_allArea").val(F.addr_info.provinceCode);$("#mallShipTemplate_allArea").change();setTimeout(function(){$("#mallShipTemplate_areaBox2 .group_item[cid='"+F.addr_info.cityCode+"']").click();setTimeout(function(){$("#mallShipTemplate_areaBox2 .group_item[cid='"+F.addr_info.countyCode+"']").click()},0)},0)},0);$("#streetAddress").val(F.addr_info.streetAddr)}}for(var G=0;G<b.length;G++){if(b[G]!=null){var j=b[G]["fieldKey"];var L=F[j];$(".propList").find(".propItemValue").each(function(){if($(this).attr("_field")==j){$(this).find("input").val(L)}});if(j=="mobile"){j="mobileCt";L=F[j];$(".propList").find(".propItemValue").each(function(){if($(this).attr("_field")==j){$(this).find("input").val(L)}})}}}});for(var x=0;x<c.length;x++){var e=c[x];if(e.isDefault==1){for(var w=0;w<b.length;w++){if(b[w]!=null){var g=b[w]["fieldKey"];var p=e[g];$(".propList").find(".propItemValue").each(function(){if($(this).attr("_field")==g){$(this).find("input").val(p)}});if(g=="mobile"){g="mobileCt";p=e[g];$(".propList").find(".propItemValue").each(function(){if($(this).attr("_field")==g){$(this).find("input").val(p)}})}}}if(e.addr_info!=null){$(".addrMsg_default, .addrMsg").each(function(){if($(this).attr("_item")==x){$(this).click()}})}}}if(f==7){$(".addrMsg_default, .addrMsg").each(function(){if($(this).attr("_item")==(c.length-1)){$(this).click()}})}else{if(f!=6){$(".addrMsg_default, .addrMsg").each(function(){if($(this).attr("_item")==f){$(this).click()}})}}if(Fai.isIE6()){if(c.length>2){$(".addrMsgList").attr("style","cursor:pointer;height:300px;width:690px;")}else{$(".addrMsgList").attr("style","cursor:pointer;height:150px;")}}function s(j){var i="";i+="<div class='city_content'>";$.each(j,function(E,F){if(u==2052||u==1028){i+="<div class='group_item' cid='"+F.id+"' cname='"+site_cityUtil.getInfo(F.id).name+"'>"+site_cityUtil.simpleCityNameStr(site_cityUtil.getInfo(F.id).name)+"</div>"}else{i+="<div class='group_item' cid='"+F.id+"' cname='"+site_cityUtil.getInfoEn(F.id).name+"'>"+site_cityUtil.simpleCityNameStrEn(site_cityUtil.getInfoEn(F.id).name)+"</div>"}});i+="</div>";return i}function l(j){var i="";i+="<div class='county_content'>";$.each(j,function(E,F){if(u==2052||u==1028){i+="<div class='group_item' cid='"+F.id+"' cname='"+site_cityUtil.getInfo(F.id).name+"'>"+site_cityUtil.getInfo(F.id).name+"</div>"}else{i+="<div class='group_item' cid='"+F.id+"' cname='"+site_cityUtil.getInfoEn(F.id).name+"'>"+site_cityUtil.getInfoEn(F.id).name+"</div>"}});i+="</div>";return i}function v(j){var i="";i+="<div class='street_content'>";$.each(j,function(E,F){if(u==2052||u==1028){i+="<div class='group_item' cid='"+F.id+"' cname='"+site_cityUtil.getInfo(F.id).name+"'>"+site_cityUtil.getInfo(F.id).name+"</div>"}else{i+="<div class='group_item' cid='"+F.id+"' cname='"+site_cityUtil.getInfoEn(F.id).name+"'>"+site_cityUtil.getInfoEn(F.id).name+"</div>"}});i+="</div>";return i}function h(j){var i="";var E=false;$.each(q,function(F,G){if(E){return}if(G.id==j){i=G.name;E=true}});return i}function y(j){var i=[];$.each(q,function(E,F){if(F.parentId==j){i.push(F)}});return i}function d(i){if(isNaN(i)){return""}var E=parseInt(i);var j="";$.each(y(E),function(F,G){j+="<div class='group_item' cid='"+G.id+"' cname='"+G.name+"'>"+G.name+"</div>"});return j}};Site.changePayModePopup=function(a,c){var e="g_stress";if($("#changePayMode").hasClass("mDetailStyleFlag")){e="mDetail_hover_color"}$("#changePayMode").hover(function(){$("#changePayMode").addClass(e)},function(){$("#changePayMode").removeClass(e)});$("#changePayMode").on("click",function(){var h=[];h.push("<div class='payModePop J_payModepop'>");h.push("<div class='p-title'>");h.push(LS.choosePayment);h.push("</div>");if(c.length>3){h.push("<div class='p-content1'>")}else{h.push("<div class='p-content2'>")}$.each(c,function(j,l){var k=d(l);if(k){h.push("<div class='p-payMode J_payMode' _data='"+l+"'>");h.push("<div class='p-payMode-"+k+"'>");h.push("</div>");h.push("</div>")}});h.push("</div>");h.push("<div class='p-foot'>");h.push("<div class='payModeBtn' id='payModeBtn'>");h.push(LS.goAndPay);h.push("</div>");h.push("</div>");h.push("</div>");var g={};if(c.length>3){g.height=295}else{g.height=250}g.width=500;g.htmlContent=h.join("");var f=Site.popupBox(g);f.find(".J_payMode").on("click",function(){$(".J_payModepop").find(".J_payMode").removeClass("selected");$(".J_payModepop").find(".selected1").remove();$(this).addClass("selected");$(this).append("<div class='selected1'></div>")});$("#payModeBtn").on("click",function(){var i=$(".J_payModepop").find(".selected").attr("_data");if(!i){Fai.ing(LS.selectPaymentFirst,true);return}if(!isNaN(i)){i=parseInt(i)}var j={};j.payMode=i;$.ajax({type:"post",url:"ajax/order_h.jsp?cmd=setOrder",data:"id="+a+"&info="+$.toJSON(j),dataType:"json",error:function(){Fai.ing(LS.mallStlSubmitError)},success:function(k){if(k.success){var l=b();if(l){var m;if(i==3){m="tenpay.jsp?orderId="+a}else{if(i==4||i==5||i==6||i==12){m="alipay.jsp?orderId="+a}else{if(i==7){m="paypal.jsp?orderId="+a}else{if(i==9){m="cbpay.jsp?orderId="+a}else{if(i==10){Site.getWxpayUrl(a);f.find(".popupBClose").click();return}else{Site.getTopWindow().location.reload();return}}}}}Site.getTopWindow().location.href=m}}else{Fai.ing(k.msg)}}})})});function d(f){if(f==2){return"bank"}else{if(f==3){return"tenpay"}else{if(f==4||f==5||f==6||f==8||f==12||f==13){return"alipay"}else{if(f==7){return"paypal"}else{if(f==9){return"pm"}else{if(f==10||f==11){return"wxpay"}}}}}}}function b(){var f=true;$.ajax({type:"post",url:"ajax/order_h.jsp?cmd=checkOrder",data:"orderId="+a,async:false,dataType:"json",error:function(){Fai.ing(LS.mallStlSubmitError)},success:function(g){if(!g.success){f=false;if(g.rt==-3){Fai.ing(LS.mallStlSubmitNotFound)}else{if(g.rt==-9){Fai.ing(LS.mallStlSubmitStatusError)}else{if(g.rt==Site.MallAjaxErrno.outOfMallAmount){Fai.ing(Fai.format(LS.mallAmountOverNameList,g.productsName))}else{if(g.rt==Site.MallAjaxErrno.OutOfAllowAmount){Fai.ing(Fai.format(LS.allowAmountOverNameList,g.productsName))}else{if(g.rt==Site.MallAjaxErrno.payDomainError){Fai.ing(LS.mallPayDomainError)}else{if(g.rt==Site.MallAjaxErrno.notAdded){Fai.ing(LS.mallProductNotAdded)}else{Fai.ing(LS.mallStlSubmitError)}}}}}}}}});return f}};Site.initPayOrder=function(a){var b=new Site.payOrder(a);b.init()};Site.payOrder=function(a){this.orderId=a};(function(f,a,c){var g=a.prototype;var b,h=f(".dtlSubmit"),d=f(".detailMsg");g.init=function(){b=this.orderId;i()};function i(){h=f(".dtlSubmit"),d=f(".detailMsg");h.on("click",function(){var j=e(b);if(j){var k=f(this).attr("_href");if(k!="WXPAY"){Site.getTopWindow().location.href=k}else{Site.getWxpayUrl(b)}}})}function e(){var j=true;f.ajax({type:"post",url:"ajax/order_h.jsp?cmd=checkOrder",data:"orderId="+b,async:false,dataType:"json",error:function(){Fai.ing(LS.mallStlSubmitError)},success:function(k){if(!k.success){j=false;if(k.rt==-3){d.html(LS.mallStlSubmitNotFound)}else{if(k.rt==-9){d.html(LS.mallStlSubmitStatusError)}else{if(k.rt==Site.MallAjaxErrno.outOfMallAmount){d.html(Fai.format(LS.mallAmountOverNameList,k.productsName))}else{if(k.rt==Site.MallAjaxErrno.OutOfAllowAmount){d.html(Fai.format(LS.allowAmountOverNameList,k.productsName))}else{if(k.rt==Site.MallAjaxErrno.payDomainError){d.html(LS.mallPayDomainError)}else{if(k.rt==Site.MallAjaxErrno.notAdded){d.hide();var l=["<div class='fk-order-tip formBox' style='width:235px; height:78px; padding:0 0;background-color:#FFF;'>","<div class='J-close formXSite' style='margin-top:3px;'></div>","<div class='t-txt' style='margin-top:30px; text-align:center;'>"+LS.mallProductNotAdded+"</div>","<div>"];tip=f(l.join(""));module.prepend(tip);tip.find(".J-close").click(function(){tip.remove()});tip.css({top:20,left:(module.width()-tip.width())/2})}else{d.html(LS.mallStlSubmitError)}}}}}}d.show()}}});return j}})(jQuery,Site.payOrder);Site.initModuleMallShipTemplate=function(B,C,d,E,o,e,b,u,r,f){var k=E.vType||1,w=E.sco||0,h=E.openItemList;var t="-----------",A=[],m,D,q,y,F,p,z;var j=true;site_cityUtil.initProvinces(u);var n="";n+="<div class='spaceLine'></div>";$.each(site_cityUtil.getAreaGroupsPinYin(),function(G,H){n+="<div class='pv_group' style='"+(H[0]=="OS"?"display:none;":"")+"'>";n+="<div class='group_head'>"+H[0]+"</div>";n+="<div class='group_content'>";$.each(H[1],function(J,I){if(u==2052||u==1028){n+="<div class='group_item' pid='"+I+"' pname='"+site_cityUtil.getInfo(I).name+"'>"+site_cityUtil.simpleProvinceNameStr(site_cityUtil.getInfo(I).name)+"</div>"}else{n+="<div class='group_item' pid='"+I+"' pname='"+site_cityUtil.getInfoEn(I).name+"'>"+site_cityUtil.simpleProvinceNameStrEn(site_cityUtil.getInfoEn(I).name)+"</div>"}});n+="</div>";n+="</div>";n+="<div class='spaceLine'></div>"});$("#mallShipTemplate_areaBox1 .pv_content").html("").append(n);var a=$(".J_isOldStyle").length>0;if(a){$("#mallShipTemplate_allArea").parents(".shipList").css("overflow","visible")}$(document).unbind("click.forAreaBox4").bind("click.forAreaBox4",function(){$("#mallShipTemplate_areaBox1").hide();$("#mallShipTemplate_areaBox2").hide()});$("#mallShipTemplate_areaBox1,#mallShipTemplate_areaBox2").unbind("click.forAreaBox2").bind("click.forAreaBox2",function(G){i(G)});function i(G){if(G.stopPropagation){G.stopPropagation()}else{G.cancelBubble=true}}$("#mallShipTemplate_allArea").change(function(){if($("#mallShipTemplate_allArea").val()==null||$("#mallShipTemplate_allArea").val()==""||$("#mallShipTemplate_allArea").val()=="os"){$("#mallShipTemplate_areaBoxInput").hide();$("#mallShipTemplate_areaBox1").hide();$("#mallShipTemplate_areaBox2").hide()}else{$("#mallShipTemplate_areaBoxInput").show()}if($("#mallShipTemplate_allArea").val()==null||$("#mallShipTemplate_allArea").val()==""){return}$("#mallShipTemplate_areaBoxInput").attr("isCn",0);$("#mallShipTemplate_areaBoxInput").attr("isCus",0);$("#mallShipTemplate_areaBoxInput").attr("isOs",0);$("#mallShipTemplate_areaBoxInput").attr("area1","");$("#mallShipTemplate_areaBoxInput").attr("area2","");$("#mallShipTemplate_areaBoxInput").attr("area3","");$("#mallShipTemplate_areaBoxInput").attr("area4","");if($("#mallShipTemplate_allArea").val()=="cn"){$("#mallShipTemplate_areaBoxInput").attr("isCn",1);$("#mallShipTemplate_areaBox1 .pv").click();$("#mallShipTemplate_areaBox1 .city_content").remove();$("#mallShipTemplate_areaBox1 .county_content").remove();$("#mallShipTemplate_areaBox1 .street_content").remove();$("#mallShipTemplate_areaBoxInput").val("")}else{if($("#mallShipTemplate_allArea").val()=="os"){$("#mallShipTemplate_areaBoxInput").attr("isOs",1);$("#mallShipTemplate_areaBoxInput").attr("area1",990000);$("#mallShipTemplate_areaBoxInput").attr("area2",990100);$("#mallShipTemplate_areaBoxInput").val($("#mallShipTemplate_areaBox1").find(".group_item[pid='990000']").text());Site.mallStlCalcTotal(B)}else{$("#mallShipTemplate_areaBoxInput").attr("isCus",1);$("#mallShipTemplate_areaBoxInput").attr("area1",$("#mallShipTemplate_allArea").val());$("#mallShipTemplate_areaBox2 .sec_content").html("");$("#mallShipTemplate_areaBox2 .thd_content").html("");$("#mallShipTemplate_areaBoxInput").val("")}}if($("#mallShipTemplate_allArea").val()=="cn"||$("#mallShipTemplate_allArea").val()=="os"){return}var G=c($("#mallShipTemplate_allArea").val());$("#mallShipTemplate_sec_box .sec_content").append(G);$("#mallShipTemplate_areaBoxInput").val($("#mallShipTemplate_areaBoxInput").val()+$("#mallShipTemplate_allArea option[value='"+$("#mallShipTemplate_allArea").val()+"']").text());var H=$("#mallShipTemplate_allArea").val();j=false;if(C===0&&f){Site.mallStlCalcTotal(B);return}$.each(h,function(J,L){if(w){var K=false,I=E.scrl||[];$.each(I,function(N,M){if(M.st===L.type){var O=false;if(j){O=$.inArray(parseInt(H),M.arl)>-1}else{O=$.inArray(parseInt(H),M.carl)>-1}if(O){if(M.fc===1){if(k===1){if(C>=M.d1){K=true;return false}}else{if(C<=M.d1){K=true;return false}}}if(M.fc===2){if(d>=M.d2){K=true;return false}}if(M.fc===3){if(k===1){if(C>=M.d1&&d>=M.d2){K=true;return false}}else{if(C<=M.d1&&d>=M.d2){K=true;return false}}}if(M.fc===4){if(k===1){if(C>=M.d1||d>=M.d2){K=true;return false}}else{if(C<=M.d1||d>=M.d2){K=true;return false}}}}}});if(K){$("#template_item_money"+L.type).html("").html(LS.freeShipping);$("#template_item_"+L.type).attr("price",0);return}}if(!L.regionList||L.regionList.length<=0){$("#template_item_money"+L.type).html("").html((o+L.defaultPrice.toFixed(2)));$("#template_item_"+L.type).attr("price",L.defaultPrice.toFixed(1));return true}$.each(L.regionList,function(S,V){var N=false;if(j){N=$.inArray(parseInt(H),V.areaList)<0}else{N=$.inArray(parseInt(H),V.cusAreaList)<0}if(N){$("#template_item_money"+L.type).html("").html((o+L.defaultPrice.toFixed(2)));$("#template_item_"+L.type).attr("price",L.defaultPrice.toFixed(1));return true}var R=0,O=V.price,T=V.rha==null?1:V.rha,U=V.ria==null?1:V.ria,P=V.rip||0;var Q=C;if(T>0){R=O;Q-=T}if(U>0&&Q>0){var M=(Q/U).toFixed(1);M=Math.ceil(M);R+=P*M}$("#template_item_money"+L.type).html("").html((o+R.toFixed(2)));$("#template_item_"+L.type).attr("price",R.toFixed(1));return false})});Site.mallStlCalcTotal(B)});$("#mallShipTemplate_areaBoxInput").unbind("click").bind("click",function(G){if($("#mallShipTemplate_allArea").val()=="cn"){$("#mallShipTemplate_areaBox1").toggle();$("#mallShipTemplate_areaBox2").hide();$("#mallShipTemplate_province_box").show();$("#mallShipTemplate_city_box").hide();$("#mallShipTemplate_county_box").hide();$("#mallShipTemplate_street_box").hide()}else{if($("#mallShipTemplate_allArea").val()==null||$("#mallShipTemplate_allArea").val()=="os"){}else{$("#mallShipTemplate_areaBox2").toggle();$("#mallShipTemplate_areaBox1").hide();$("#mallShipTemplate_sec_box").show();$("#mallShipTemplate_thd_box").hide()}}i(G)});$("#mallShipTemplate_areaBox1 .J_areaHead .pv").click(function(){$("#mallShipTemplate_province_box").show();$("#mallShipTemplate_city_box").hide();$("#mallShipTemplate_county_box").hide();$("#mallShipTemplate_street_box").hide()});$("#mallShipTemplate_areaBox1 .J_areaHead .city").click(function(){$("#mallShipTemplate_province_box").hide();$("#mallShipTemplate_city_box").show();$("#mallShipTemplate_county_box").hide();$("#mallShipTemplate_street_box").hide()});$("#mallShipTemplate_areaBox1 .J_areaHead .county").click(function(){$("#mallShipTemplate_province_box").hide();$("#mallShipTemplate_city_box").hide();$("#mallShipTemplate_street_box").hide();$("#mallShipTemplate_county_box").show()});$("#mallShipTemplate_areaBox1 .J_areaHead .street").click(function(){$("#mallShipTemplate_province_box").hide();$("#mallShipTemplate_city_box").hide();$("#mallShipTemplate_county_box").hide();$("#mallShipTemplate_street_box").show()});$("#mallShipTemplate_areaBox2 .J_areaHead2 .sec").click(function(){$("#mallShipTemplate_sec_box").show();$("#mallShipTemplate_thd_box").hide()});$("#mallShipTemplate_areaBox2 .J_areaHead2 .thd").click(function(){$("#mallShipTemplate_sec_box").hide();$("#mallShipTemplate_thd_box").show()});$("#mallShipTemplate_province_box .group_item").bind("click",function(){$("#mallShipTemplate_areaBox1 .city_content").remove();$("#mallShipTemplate_areaBox1 .county_content").remove();$("#mallShipTemplate_areaBox1 .street_content").remove();var G=$(this).attr("pname");var H=$(this).attr("pid");$("#mallShipTemplate_areaBox1 .J_areaHead .city").click();$("#mallShipTemplate_areaBoxInput").val("");$("#mallShipTemplate_areaBoxInput").val($("#mallShipTemplate_areaBoxInput").val()+G);$("#mallShipTemplate_areaBoxInput").removeAttr("lastArea");$("#mallShipTemplate_areaBoxInput").removeAttr("lastAreaType");$("#mallShipTemplate_areaBoxInput").attr("area1",H);$("#mallShipTemplate_areaBoxInput").attr("area2","");$("#mallShipTemplate_areaBoxInput").attr("area3","");$("#mallShipTemplate_areaBoxInput").attr("area4","");$("#mallShipTemplate_areaBox1 .city_content").remove();var I="";if(u==2052||u==1028){I=s(site_cityUtil.getCities(H))}else{I=s(site_cityUtil.getCitiesEn(H))}$("#mallShipTemplate_city_box").append(I);$.each(h,function(J,K){$("#template_item_"+K.type).attr("price",K.defaultPrice.toFixed(1))});Site.mallStlCalcTotal(B)});$("#mallShipTemplate_city_box").delegate(".group_item","click",function(){if($("#mallShipTemplate_allArea").val()==""||$("#mallShipTemplate_allArea").val()=="cn"||$("#mallShipTemplate_allArea").val()=="os"){j=true}else{j=false}$("#mallShipTemplate_areaBox1 .county_content").remove();$("#mallShipTemplate_areaBox1 .street_content").remove();var G=$(this).attr("cname");var I=$(this).attr("cid");$("#mallShipTemplate_areaBox1 .J_areaHead .county").click();var K=$("#mallShipTemplate_areaBoxInput").attr("lastArea");var H=$("#mallShipTemplate_areaBoxInput").attr("lastAreaType");if(H!=null&&H!=""){$("#mallShipTemplate_areaBoxInput").val($("#mallShipTemplate_areaBoxInput").val().substring(0,$("#mallShipTemplate_areaBoxInput").val().indexOf("-")))}$("#mallShipTemplate_areaBoxInput").val($("#mallShipTemplate_areaBoxInput").val()+"-"+G);$("#mallShipTemplate_areaBoxInput").attr("lastArea","-"+G);$("#mallShipTemplate_areaBoxInput").attr("lastAreaType","city");$("#mallShipTemplate_areaBoxInput").attr("area2",I);$("#mallShipTemplate_areaBoxInput").attr("area3","");$("#mallShipTemplate_areaBoxInput").attr("area4","");$("#mallShipTemplate_areaBox1 .county_content").remove();var J="";if(u==2052||u==1028){J=l(site_cityUtil.getCounty(I))}else{J=l(site_cityUtil.getCountyEn(I))}$("#mallShipTemplate_county_box").append(J);if(C===0&&f){Site.mallStlCalcTotal(B);return}$.each(h,function(M,O){if(w){var N=false,L=E.scrl||[];$.each(L,function(Q,P){if(P.st===O.type){var R=false;if(j){R=$.inArray(parseInt(I),P.arl)>-1}else{R=$.inArray(parseInt(I),P.carl)>-1}if(R){if(P.fc===1){if(k===1){if(C>=P.d1){N=true;return false}}else{if(C<=P.d1){N=true;return false}}}if(P.fc===2){if(d>=P.d2){N=true;return false}}if(P.fc===3){if(k===1){if(C>=P.d1&&d>=P.d2){N=true;return false}}else{if(C<=P.d1&&d>=P.d2){N=true;return false}}}if(P.fc===4){if(k===1){if(C>=P.d1||d>=P.d2){N=true;return false}}else{if(C<=P.d1||d>=P.d2){N=true;return false}}}}}});if(N){$("#template_item_money"+O.type).html("").html(LS.freeShipping);$("#template_item_"+O.type).attr("price",0);return}}if(!O.regionList||O.regionList.length<=0){$("#template_item_money"+O.type).html("").html((o+O.defaultPrice.toFixed(2)));$("#template_item_"+O.type).attr("price",O.defaultPrice.toFixed(1));return true}$.each(O.regionList,function(V,Y){var Q=false;if(j){Q=$.inArray(parseInt(I),Y.areaList)<0}else{Q=$.inArray(parseInt(I),Y.cusAreaList)<0}if(Q){$("#template_item_money"+O.type).html("").html((o+O.defaultPrice.toFixed(2)));$("#template_item_"+O.type).attr("price",O.defaultPrice.toFixed(1));return true}var U=0,R=Y.price,W=Y.rha==null?1:Y.rha,X=Y.ria==null?1:Y.ria,S=Y.rip||0;var T=C;if(W>0){U=R;T-=W}if(X>0&&T>0){var P=(T/X).toFixed(1);P=Math.ceil(P);U+=S*P}$("#template_item_money"+O.type).html("").html((o+U.toFixed(2)));$("#template_item_"+O.type).attr("price",U.toFixed(1));return false})});Site.mallStlCalcTotal(B)});$("#mallShipTemplate_county_box").delegate(".group_item","click",function(){$("#mallShipTemplate_areaBox1 .street_content").remove();var H=$(this).attr("cname");var J=$(this).attr("cid");var L=$("#mallShipTemplate_areaBoxInput").attr("lastArea");var I=$("#mallShipTemplate_areaBoxInput").attr("lastAreaType");$("#mallShipTemplate_areaBox1 .J_areaHead .street").click();if(I!=null&&(I=="street"||I=="county")){$("#mallShipTemplate_areaBoxInput").val($("#mallShipTemplate_areaBoxInput").val().substring(0,$("#mallShipTemplate_areaBoxInput").val().indexOf("-",$("#mallShipTemplate_areaBoxInput").val().indexOf("-")+1)))}$("#mallShipTemplate_areaBoxInput").val($("#mallShipTemplate_areaBoxInput").val()+"-"+H);$("#mallShipTemplate_areaBoxInput").attr("lastArea","-"+H);$("#mallShipTemplate_areaBoxInput").attr("lastAreaType","county");$("#mallShipTemplate_areaBoxInput").attr("area3",J);$("#mallShipTemplate_areaBoxInput").attr("area4","");var G="";if(u==2052||u==1028){G=v(site_cityUtil.getStreet(J))}else{G=v(site_cityUtil.getStreetEn(J))}var K=$(G).html();if(K===null||K===undefined||K===""){$("#mallShipTemplate_areaBox1").hide()}$("#mallShipTemplate_street_box").append(G);Site.mallStlCalcTotal(B)});$("#mallShipTemplate_street_box").delegate(".group_item","click",function(){var G=$(this).attr("cname");var I=$(this).attr("cid");var J=$("#mallShipTemplate_areaBoxInput").attr("lastArea");var H=$("#mallShipTemplate_areaBoxInput").attr("lastAreaType");if(H!=null&&H=="street"){$("#mallShipTemplate_areaBoxInput").val($("#mallShipTemplate_areaBoxInput").val().replace(J,""))}$("#mallShipTemplate_areaBoxInput").val($("#mallShipTemplate_areaBoxInput").val()+"-"+G);$("#mallShipTemplate_areaBoxInput").attr("lastArea","-"+G);$("#mallShipTemplate_areaBoxInput").attr("lastAreaType","street");$("#mallShipTemplate_areaBoxInput").attr("area4",I);$("#mallShipTemplate_areaBox1").hide();Site.mallStlCalcTotal(B)});$("#mallShipTemplate_sec_box").delegate(".group_item","click",function(){if($("#mallShipTemplate_allArea").val()==""||$("#mallShipTemplate_allArea").val()=="cn"||$("#mallShipTemplate_allArea").val()=="os"){j=true}else{j=false}$("#mallShipTemplate_areaBox2 .thd_content").html("");var G=$(this).attr("cname");var I=$(this).attr("cid");$("#mallShipTemplate_areaBox2 .J_areaHead2 .thd").click();var K=$("#mallShipTemplate_areaBoxInput").attr("lastArea");var H=$("#mallShipTemplate_areaBoxInput").attr("lastAreaType");if(H!=null&&H!=""&&$("#mallShipTemplate_areaBoxInput").val().indexOf("-")!=-1){$("#mallShipTemplate_areaBoxInput").val($("#mallShipTemplate_areaBoxInput").val().substring(0,$("#mallShipTemplate_areaBoxInput").val().indexOf("-")))}$("#mallShipTemplate_areaBoxInput").val($("#mallShipTemplate_areaBoxInput").val()+"-"+G);$("#mallShipTemplate_areaBoxInput").attr("lastArea","-"+G);$("#mallShipTemplate_areaBoxInput").attr("lastAreaType","sec");$("#mallShipTemplate_areaBoxInput").attr("area2",I);$("#mallShipTemplate_areaBoxInput").attr("area3","");var J=c(I);$("#mallShipTemplate_thd_box .thd_content").append(J);if(C===0&&f){Site.mallStlCalcTotal(B);return}$.each(h,function(M,O){if(w){var N=false,L=E.scrl||[];$.each(L,function(Q,P){if(P.st===O.type){var R=false;if(j){R=$.inArray(parseInt(I),P.arl)>-1}else{R=$.inArray(parseInt(I),P.carl)>-1}if(R){if(P.fc===1){if(k===1){if(C>=P.d1){N=true;return false}}else{if(C<=P.d1){N=true;return false}}}if(P.fc===2){if(d>=P.d2){N=true;return false}}if(P.fc===3){if(k===1){if(C>=P.d1&&d>=P.d2){N=true;return false}}else{if(C<=P.d1&&d>=P.d2){N=true;return false}}}if(P.fc===4){if(k===1){if(C>=P.d1||d>=P.d2){N=true;return false}}else{if(C<=P.d1||d>=P.d2){N=true;return false}}}}}});if(N){$("#template_item_money"+O.type).html("").html(LS.freeShipping);$("#template_item_"+O.type).attr("price",0);return}}if(!O.regionList||O.regionList.length<=0){$("#template_item_money"+O.type).html("").html((o+O.defaultPrice.toFixed(2)));$("#template_item_"+O.type).attr("price",O.defaultPrice.toFixed(1));return true}$.each(O.regionList,function(V,Y){var Q=false;if(j){Q=$.inArray(parseInt(I),Y.areaList)<0}else{Q=$.inArray(parseInt(I),Y.cusAreaList)<0}if(Q){$("#template_item_money"+O.type).html("").html((o+O.defaultPrice.toFixed(2)));$("#template_item_"+O.type).attr("price",O.defaultPrice.toFixed(1));return true}var U=0,R=Y.price,W=Y.rha==null?1:Y.rha,X=Y.ria==null?1:Y.ria,S=Y.rip||0;var T=C;if(W>0){U=R;T-=W}if(X>0&&T>0){var P=(T/X).toFixed(1);P=Math.ceil(P);U+=S*P}$("#template_item_money"+O.type).html("").html((o+U.toFixed(2)));$("#template_item_"+O.type).attr("price",U.toFixed(1));return false})});Site.mallStlCalcTotal(B)});$("#mallShipTemplate_thd_box").delegate(".group_item","click",function(){if($("#mallShipTemplate_allArea").val()==""||$("#mallShipTemplate_allArea").val()=="cn"||$("#mallShipTemplate_allArea").val()=="os"){j=true}else{j=false}var G=$(this).attr("cname");var I=$(this).attr("cid");var J=$("#mallShipTemplate_areaBoxInput").attr("lastArea");var H=$("#mallShipTemplate_areaBoxInput").attr("lastAreaType");if(H!=null&&H=="thd"){$("#mallShipTemplate_areaBoxInput").val($("#mallShipTemplate_areaBoxInput").val().replace(J,""))}$("#mallShipTemplate_areaBoxInput").val($("#mallShipTemplate_areaBoxInput").val()+"-"+G);$("#mallShipTemplate_areaBoxInput").attr("lastArea","-"+G);$("#mallShipTemplate_areaBoxInput").attr("lastAreaType","thd");$("#mallShipTemplate_areaBoxInput").attr("area3",I);$("#mallShipTemplate_areaBox2").hide();if(C===0&&f){Site.mallStlCalcTotal(B);return}$.each(h,function(L,N){if(w){var M=false,K=E.scrl||[];$.each(K,function(P,O){if(O.st===N.type){var Q=false;if(j){Q=$.inArray(parseInt(I),O.arl)>-1}else{Q=$.inArray(parseInt(I),O.carl)>-1}if(Q){if(O.fc===1){if(k===1){if(C>=O.d1){M=true;return false}}else{if(C<=O.d1){M=true;return false}}}if(O.fc===2){if(d>=O.d2){M=true;return false}}if(O.fc===3){if(k===1){if(C>=O.d1&&d>=O.d2){M=true;return false}}else{if(C<=O.d1&&d>=O.d2){M=true;return false}}}if(O.fc===4){if(k===1){if(C>=O.d1||d>=O.d2){M=true;return false}}else{if(C<=O.d1||d>=O.d2){M=true;return false}}}}}});if(M){$("#template_item_money"+N.type).html("").html(LS.freeShipping);$("#template_item_"+N.type).attr("price",0);return}}if(!N.regionList||N.regionList.length<=0){$("#template_item_money"+N.type).html("").html((o+N.defaultPrice.toFixed(2)));$("#template_item_"+N.type).attr("price",N.defaultPrice.toFixed(1));return true}$.each(N.regionList,function(U,X){var P=false;if(j){P=$.inArray(parseInt(I),X.areaList)<0}else{P=$.inArray(parseInt(I),X.cusAreaList)<0}if(P){$("#template_item_money"+N.type).html("").html((o+N.defaultPrice.toFixed(2)));$("#template_item_"+N.type).attr("price",N.defaultPrice.toFixed(1));return true}var T=0,Q=X.price,V=X.rha==null?1:X.rha,W=X.ria==null?1:X.ria,R=X.rip||0;var S=C;if(V>0){T=Q;S-=V}if(W>0&&S>0){var O=(S/W).toFixed(1);O=Math.ceil(O);T+=R*O}$("#template_item_money"+N.type).html("").html((o+T.toFixed(2)));$("#template_item_"+N.type).attr("price",T.toFixed(1));return false})});Site.mallStlCalcTotal(B)});$("#template_item_"+e.type).click();function s(H){var G="";G+="<div class='city_content'>";$.each(H,function(I,J){if(u==2052||u==1028){G+="<div class='group_item' cid='"+J.id+"' cname='"+site_cityUtil.getInfo(J.id).name+"'>"+site_cityUtil.simpleCityNameStr(site_cityUtil.getInfo(J.id).name)+"</div>"}else{G+="<div class='group_item' cid='"+J.id+"' cname='"+site_cityUtil.getInfoEn(J.id).name+"'>"+site_cityUtil.simpleCityNameStrEn(site_cityUtil.getInfoEn(J.id).name)+"</div>"}});G+="</div>";return G}function l(H){var G="";G+="<div class='county_content'>";$.each(H,function(I,J){if(u==2052||u==1028){G+="<div class='group_item' cid='"+J.id+"' cname='"+site_cityUtil.getInfo(J.id).name+"'>"+site_cityUtil.getInfo(J.id).name+"</div>"}else{G+="<div class='group_item' cid='"+J.id+"' cname='"+site_cityUtil.getInfoEn(J.id).name+"'>"+site_cityUtil.getInfoEn(J.id).name+"</div>"}});G+="</div>";return G}function v(H){var G="";G+="<div class='street_content'>";$.each(H,function(I,J){if(u==2052||u==1028){G+="<div class='group_item' cid='"+J.id+"' cname='"+site_cityUtil.getInfo(J.id).name+"'>"+site_cityUtil.getInfo(J.id).name+"</div>"}else{G+="<div class='group_item' cid='"+J.id+"' cname='"+site_cityUtil.getInfoEn(J.id).name+"'>"+site_cityUtil.getInfoEn(J.id).name+"</div>"}});G+="</div>";return G}function g(H){var G="";var I=false;$.each(r,function(J,K){if(I){return}if(K.id==H){G=K.name;I=true}});return G}function x(H){var G=[];$.each(r,function(I,J){if(J.parentId==H){G.push(J)}});return G}function c(G){if(isNaN(G)){return""}var I=parseInt(G);var H="";$.each(x(I),function(J,K){H+="<div class='group_item' cid='"+K.id+"' cname='"+K.name+"'>"+K.name+"</div>"});return H}};Site.initPresentIpt=function(){var a=$("#useItg");if(a.length>0){a.bind("blur",function(){var h=parseInt(a.attr("_needitg"));var f=parseInt(a.val());var k=a.attr("_itgname");var j=parseInt(a.attr("_maxuse"));var b=0;if(isNaN(f)){f=0}var c=$(this).attr("moduleId");var d=Fai.top.$("#module"+c);var g=parseFloat(d.find(".cartTotal").attr("pay_price"));if(isNaN(g)){return}if($("#couponList").length>0&&$("#couponList input:checkbox").is(":checked")){var i=0;if($("#couponOffsetMoney").length>0){var l=$("#couponOffsetMoney").attr("_offsetmoney");if(!isNaN(l)){i=parseInt(l);var m=Math.floor((g-i)*h);if(m<j){j=m}}}}if(f>j){Fai.ing(Fai.format(LS.integral_maxUse,j,Fai.encodeHtml(k)),true);a.val(j);var e=(j/h).toFixed(2);if(Fai.top._lcid!=2052&&Fai.top._lcid!=1028){$("#offsetMoney").text(Fai.formatPriceEn(e)).attr("_offsetmoney",e)}else{$("#offsetMoney").text(e).attr("_offsetmoney",e)}Site.mallStlCalcTotal(c);return}if(f>parseInt(a.attr("_currentItg"))){Fai.ing(Fai.format(LS.integral_notOverCurrent,Fai.encodeHtml(k),Fai.encodeHtml(k)));a.focus();return}if(f<0){Fai.ing(LS.integral_inputInteger);a.focus();return}else{if(f==0){$("#integralInfo").hide()}else{$("#integralInfo").show()}}var e=(f/h).toFixed(2);if(Fai.top._lcid!=2052&&Fai.top._lcid!=1028){$("#offsetMoney").text(Fai.formatPriceEn(e)).attr("_offsetmoney",e)}else{$("#offsetMoney").text(e).attr("_offsetmoney",e)}if($("#couponList").length>0){$("#couponList input:checkbox").each(function(){var n=parseInt($(this).attr("_minPrice"));if(g-e<n){$(this).parents("#couponList tr").hide();if($(this).prop("checked")){$(".useItgTip .maxUse").text($("#useItg").attr("_maxuse"));$(".cp-offsetTip .used-count").text("0");$("#couponOffsetMoney").text("0.00");$("#couponOffsetMoney").attr("_offsetmoney","0.00")}$("#couponList input:checkbox").attr("checked",false)}else{$(this).parents("#couponList tr").show()}});if($("#couponList tr").is(":visible")){$("#couponListTip").hide()}else{$("#couponListTip").show()}}Site.mallStlCalcTotal(c)})}};Site.deductionItem=function(a){$("#itgTitle,#couponTitle").click(function(){if(Fai.isIE6()||Fai.isIE7()){$(this).next().show()}else{$(this).next().slideToggle()}if($(this).find(".switch-sign").text()=="+"){$(this).find(".switch-sign").text("-")}else{$(this).find(".switch-sign").text("+")}});var b=Site.getBackgroundColor($(".J-fk-triangle"));$(".J-fk-triangle").css("border-color","transparent transparent "+b+" transparent");$(".couponMsg input:checkbox").click(function(){if($(this).is(":checked")){$(this).attr("checked",false)}else{$(this).attr("checked",true)}});$(".couponMsg tr").click(function(){var i=$(this).find("input:checkbox").is(":checked");$("#couponList input:checkbox").attr("checked",false);var g=0;$(".cp-offsetTip .used-count").text("0");if(!i){$(".cp-offsetTip .used-count").text("1");var j=$(this).find("input:checkbox");j.attr("checked",true);g=parseFloat(j.attr("data_saveprice"))}if($(".integralMsg").length>0){var d=$("#useItg"),f=parseInt(d.attr("_needitg")),h=parseInt(d.attr("_maxuse"));var c=Fai.top.$("#module"+a);var e=parseFloat(c.find(".cartTotal").attr("pay_price"));if(isNaN(e)){return}var k=Math.floor((e-g)*f);if(k<h){$(".useItgTip .maxUse").text(k)}else{$(".useItgTip .maxUse").text(h)}}if(g>0){$("#couponInfo").show()}else{$("#couponInfo").hide()}if(Fai.top._lcid!=2052&&Fai.top._lcid!=1028){$("#couponOffsetMoney").text(Fai.formatPriceEn(g))}else{$("#couponOffsetMoney").text(g.toFixed(2))}$("#couponOffsetMoney").attr("_offsetmoney",g);Site.mallStlCalcTotal(a)});$("#clickShowInput").click(function(){$(this).next().show();$(this).remove()})};Site.showBankList=function(b){var a=$("#"+b).attr("value");$("#mallPay").attr("value",a)};Site.initOnlineBankList=function(){$("#payOnlinePanel").insertAfter($("#onlineItem")[0])};Site.getWxpayUrl=function(b){var a=$("#wxpayBtn");if(a.attr("_sending")==="true"){Fai.ing("您的操作太频繁,请稍后再试。",true);return}a.attr("_sending","true");$.ajax({type:"post",url:"ajax/mall_h.jsp?cmd=getWxpayUrl",data:"orderId="+b,error:function(){Fai.ing("系统错误。")},success:function(c){var d=$.parseJSON(c);if(d.success){Site.showWxQRCode(d.url,b)}else{a.attr("_sending","false");Fai.ing(d.errMsg+"(请联系网站管理员)")}}})};Site.showWxQRCode=function(a,b){var h=parseInt(Math.random()*10000);var i=480;var d=800;var f=["<div id='wxpayQrCodeBox"+h+"' class='popupBg' style='filter: alpha(opacity=50); opacity:0.5;'></div>","<div id='wxPayQRCodeDisplay"+h+"' class='webSiteQRCodeDisplay' style='z-index:9032;display:block;width: "+d+"px;height:"+i+"px;left:"+(Fai.top.document.documentElement.clientWidth-d)/2+"px;'>","<div class='wxqrCodeTitileBox'>","<div class='wxqrCodeTitile'>微信支付</div>","<a hidefocus='true' href='javascript:;' class='cancelBtn' onclick='Site.closeWxQrcodeDiv("+h+","+b+");return false;'></a>","<div style='clear:both;'></div>","</div>","<div class='wxpayQrCodeBox'>","<div class='wxpayQrCodeImgBox'>","<img title='' src='/qrCode.jsp?cmd=wxPayQrCode&&url="+a+"' >","</div>","<div class='wxpayQrCodeTips'></div>","</div>","<div class='wxGuardImg'></div>","<div style='clear:both;'></div>","<div class='paidTips'>完成支付5秒后没跳转,请刷新页面。</div>","</div>"];Fai.top.$(f.join("")).appendTo("body");var e=Fai.top.document.documentElement.clientHeight;var g=(e-i)/2;var c=$(window).scrollTop();$("#wxPayQRCodeDisplay"+h).css("top",g+c);$("#wxpayBtn").attr("_sending","false");setInterval("Site.checkOrderStatue("+b+")",2000)};Site.closeWxQrcodeDiv=function(b,a){Fai.top.$("#wxpayQrCodeBox"+b).remove();Fai.top.$("#wxPayQRCodeDisplay"+b).remove();Site.checkOrderStatue(a)};Site.checkOrderStatue=function(a){$.ajax({type:"post",url:"ajax/mall_h.jsp?cmd=checkOrderStatue",data:"orderId="+a,error:function(){Fai.ing("系统错误。")},success:function(b){var c=$.parseJSON(b);if(c.success){Fai.top.location.href=Site.getHtmlUrl("mdetail")+"?id="+a+"&paySuccessSuc=true"}}})};Site.mallCartInit=function(c){var b=Fai.top.$("#memberBar");if(b.length<1){return}var a=b.find("#mallCart_js");var d=b.find(".mallCartPanel");$(a).find(".mallCartItem").bind("click",function(){window.open(Site.getHtmlUrl("mcart"),"_blank")});$(d).find(".checkMallCartBtn").bind("click",function(){window.open(Site.getHtmlUrl("mcart"),"_blank")});Site.refreshTopAndRightBarMallCartNum();if(c!=13&&c!=14){$(a).bind("mouseenter",function(e){var f=b.find(".mallCartPanel");$(this).attr("_mouseIn",1);$(this).find(".mallCartItem").addClass("mallCartItem_hover");if(!$(f).is(":visible")){Site.refreshTopBarMallCart(this)}}).bind("mouseleave",function(){$(this).attr("_mouseIn",0);setTimeout(function(){var e=b.find(".mallCartPanel");var f=$(e).attr("_mouseIn");if(f!=1){$(e).hide();b.find(".mallCartItem").removeClass("mallCartItem_hover")}},50)});$(d).bind("mouseenter",function(){$(this).attr("_mouseIn",1)}).bind("mouseleave",function(){$(this).attr("_mouseIn",0);setTimeout(function(){var f=Fai.top.$("#memberBar");var e=f.find("#mallCart_js");var g=$(e).attr("_mouseIn");if(g!=1){f.find(".mallCartPanel").hide();f.find(".mallCartItem").removeClass("mallCartItem_hover")}},50)})}};Site.mobiWebInit=function(){var c=Fai.top.$("#memberBar").find("#mobiWeb_js");var b=Fai.top.$("#memberBar").find(".mobiWebPanel");var a=Fai.top.$("#memberBar").find("#mobiWebQRCode_js");$(c).bind("mouseenter",function(f){$(this).attr("_mouseIn",1);$(this).find(".mobiWebItem").addClass("mobiWebItem_hover");var d=parseInt($(c).css("margin-left"));var e=parseInt($(a).css("width"))+2;var g=$(c).position().left+d-e+$(c).width();$(b).css("left",g+"px");$(b).show()}).bind("mouseleave",function(){$(this).attr("_mouseIn",0);setTimeout(function(){var d=Fai.top.$("#memberBar").find(".mobiWebPanel");var e=$(d).attr("_mouseIn");if(e!=1){$(d).hide();Fai.top.$("#memberBar").find(".mobiWebItem").removeClass("mobiWebItem_hover")}},50)});$(b).bind("mouseenter",function(d){$(this).attr("_mouseIn",1)}).bind("mouseleave",function(){$(this).attr("_mouseIn",0);setTimeout(function(){var d=Fai.top.$("#memberBar").find("#mobiWeb_js");var e=$(d).attr("_mouseIn");if(e!=1){Fai.top.$("#memberBar").find(".mobiWebPanel").hide();Fai.top.$("#memberBar").find(".mobiWebItem").removeClass("mobiWebItem_hover")}},50)})};Site.refreshTopBarMallCart=function(a){var d=Fai.top.$("#memberBar").find("#mallCartList_js");var b=$(a).position().top+$(a).height();var c=parseInt($(a).css("margin-left"));var e=$(a).position().left+c-parseInt($(d).css("width"))-2+$(a).width();var f=Fai.top.$("#memberBar").find(".mallCartPanel");$(f).css("top",b+"px").css("left",e+"px");$(f).show().children().before("<div class='mallCartLoad'></div>");if(Fai.isIE6()){var g=$(f).height();$(f).find(".mallCartLoad").css("height",g+"px")}$.ajax({type:"post",url:"ajax/order_h.jsp?cmd=getTopBarMallCartList",data:"",success:function(h){var i=$.parseJSON(h);var k=i.topBarProductList;if(i.success&&k.length>0){Site.refreshTopAndRightBarMallCartNum();Site.createTopBarMallCartList(k,i.orderId,i.choiceCurrencyVal)}else{var j=Fai.top.$("#memberBar").find(".mallCartPanel");Site.refreshTopAndRightBarMallCartNum();$(j).find(".mcProductList").html(LS.memberMallCartNoProduct);$(j).find(".checkMallCartBtn").removeClass("checkMallCartBtn_hasPro");$(j).find(".mall_cart_total").remove()}Fai.top.$("#memberBar").find(".mallCartPanel").find(".mallCartLoad").remove()}})};Site.createTopBarMallCartList=function(c,a,k){Fai.top.$("#memberBar").find(".mcProductList").attr("data-orderId",a).html("");var i=[];var b=0,m=0;var g=0;for(var h in c){b+=c[h].amount}for(h=0;h<c.length;h++){var d=c[h],e=d.amount;if(d.isValid){m+=d.price*e}}var j=[];j.push("<div class='mall_cart_total'>");j.push("<div>");j.push(Fai.format(LS.shoppingCartCalculatePro,b));j.push("</div>");j.push("<div>");if(Fai.top._lcid!=2052&&Fai.top._lcid!=1028){j.push("<span class='sC-priceTotal'>"+LS.shoppingCartCountMoney+"<b>"+k.toString()+Fai.formatPriceEn(m.toFixed(2))+"</b></span>")}else{j.push("<span class='sC-priceTotal'>"+LS.shoppingCartCountMoney+"<b>"+k.toString()+m.toFixed(2)+"</b></span>")}j.push("</div>");j.push("</div>");i.push("<ul>");i.push("<div style='text-align: left;padding:0 15px;'>"+LS.memberMallCartJoin+":</div>");for(var h in c){var d=c[h];var e=d.amount;if(g==5){break}b=b-e;f(d);g++}i.push("<li class='mcProductListTip'></li>");Fai.top.$("#memberBar").find(".checkMallCartBtn").css("margin-top","12px");i.push("</ul>");Fai.top.$("#memberBar").find(".mcProductList").append(i.join(""));Fai.top.$("#memberBar").find(".mall_cart_total").remove();Fai.top.$("#memberBar").find(".mcProductList").after(j.join(""));var l=[];Fai.top.$("#memberBar").find(".mcProductList .mcPdInvalid").each(function(){l.push($(this).prop("outerHTML"));$(this).remove()});Fai.top.$("#memberBar").find(".mcProductListTip").before(l.join(""));Fai.top.$("#memberBar").find(".checkMallCartBtn").addClass("checkMallCartBtn_hasPro");function f(s){var t=d.isValid?"":" mcPdInvalid ";var p=d.inValidType;var q=[];if(d.picId!=""){q.push("<div class='mcProductList_proPic'>");q.push("<img alt='"+Fai.encodeHtml(d.name)+"' src='"+d.picPath+"'>");q.push("</div>")}else{q.push("<div class='mcProductList_proNoPic'></div>")}var o="";if(t!=""){if(p=="notAdded"||p=="delete"){o="title='"+LS.notAdded+"'";q.push("<div class='invalid'><span class='invalidTip' title='"+LS.notAdded+"'>"+LS.notAdded+"</span><i class='visible'></i></div>")}else{if(p=="outOfStock"){o=" title='"+LS.invalid+"' ";q.push("<div class='invalid'><span class='invalidTip' style='margin-left:0;' title='"+LS.invalid+"'>"+LS.invalid+"</span><i class='visible'></i></div>")}}}var n=s.amount;if(s.amount>9999){n=(n+"").substring(0,3)+"..."}i.push("<li class='mcProductList_pro "+t+"' data-itemId='"+d.id+"'"+o+">");i.push(q.join(""));i.push("<div class='mcProductList_proName' style='width: 85px;'>");i.push("<span title='"+Fai.encodeHtml(d.name)+"' style='width:95px;'>"+Fai.encodeHtml(d.name)+"</span>");i.push("</div>");i.push("<div class='mcProductList_proDel' style=''><a hidefocus='true' href='javascript:;' ");i.push("onclick='Site.delTopBarMallCartItem("+a+", "+d.id+");return false;'>"+LS.memberMallCartDel+"</a>");i.push("</div>");i.push("<div class='mcProductList_proPrice' style='width: 95px;'>");var r=d.price.toFixed(2);if(Fai.top._lcid!=2052&&Fai.top._lcid!=1028){r=Fai.formatPriceEn(d.price)}if(t){i.push("<span class='s_invalid_price'>"+k.toString()+r+"</span>")}else{i.push("<span class='s_price'>"+k.toString()+r+"</span>")}i.push("<span style='margin-left: 10px;float:right;'>×"+n+"</span>");i.push("</div>");i.push("</li>")}};Site.delTopBarMallCartItem=function(a,b){$.ajax({type:"post",url:"ajax/order_h.jsp?cmd=delItem",data:{orderId:a,itemId:b,isTopBarMallCart:true},error:function(c){var d=$.parseJSON(c);if(!d.success){Fai.ing("系统繁忙,请稍后重试。",true)}},success:function(c){var e=$.parseJSON(c);if(e.success){var d=Fai.top.$("#memberBar").find("#mallCart_js");$(d).find("[data-itemId="+b+"]").first().remove();Site.refreshTopBarMallCart(d)}else{if(e.rt==-2){Fai.ing("参数错误,请稍后重试。",true)}}}})};Site.refreshTopAndRightBarMallCartNum=function(){$.ajax({type:"post",url:"ajax/order_h.jsp?cmd=getMallCartProductNum",data:"",success:function(a){var f=$.parseJSON(a);if(f.success){if(f.rt==1){var e=$.trim(f.productAmount);var c=Fai.top.$("#memberBar").find("#mallCart_js");if(c.length>0){e=(e>99)?"99+":e;$(c).find(".mallCart_proNum").text("("+e+")")}var g=Fai.top.$(".shoppingAmount");var b=Fai.top.$(".shoppingAmountContent");if(e>0||e=="99+"){g.css("display","block").text(e);b.css("display","block")}else{g.css("display","none").text(e);b.css("display","none")}var d=Fai.top.$("#J_WebRightBar").find("#rbar_cart");if(d.length>0){if(e=="99+"){$(d).find(".fk-rbar-cartItem-cirNum").text("...")}else{$(d).find(".fk-rbar-cartItem-cirNum").text(e)}}}}}})};Site.showContacterExtMsg=function(f){var e=$("#module"+f),g=e.find(".J-head-more"),b=e.find(".J-cont-msg-ext"),a=e.find(".fk-order-dt").width(),c=b.width(),d=a-g.position().left;g.hover(function(){b.css({top:g.position().top+g.height()+14});if(d>=c){b.css({left:g.position().left-140})}else{b.find(".cont-tri").css({left:c-50});b.css({left:g.position().left-(c-d)-10})}b.show()},function(){b.hide()})};Site.showOrderNewMoreBox=function(d){var c=$("#module"+d),e=c.find(".J_orderRecvMore"),b=c.find(".J_orderNewMoreBox"),a=c.find(".J_orderRecvMoreIcon");if(b.find("table tr").length==0){return}e.click(function(){if(b.is(":hidden")){a.removeClass("orderRecvMoreIconDown");a.addClass("orderRecvMoreIconUp")}else{a.addClass("orderRecvMoreIconDown");a.removeClass("orderRecvMoreIconUp")}b.slideToggle()})};Site.initFlowMsg=function(c,a){var b=$("#module"+c);$.ajax({type:"post",url:"ajax/order_h.jsp?cmd=flowMsg",data:"id="+a,success:function(e){var g=$.parseJSON(e);b.find(".J-ajaxLoad").hide();if(g.msgList==null||g.msgList.length===0||!g.success){if(g.success){b.find(".J-no-msg").show()}else{Fai.ing(g.msg,true);b.find(".J-err-msg").show()}var j=b.find(".mDetail_color").css("color");b.find(".noFlowMsgTip").css("color",j)}else{var k="",h="",d=[];d.push("<ul class='msgFlowList'>");var f=b.find(".mDetailOld").length>0,i=0;$.each(g.msgList,function(l,m){k="";h="";if(l===i){k=" class='mDetail_color lastFlowMsgLine'";if(f){k=" class='lastFlowMsgLine g_stress'"}h=" mDetail_bg"}d.push("<li"+k+">");d.push("<span class='circleAround'><i class='circlePoint "+h+"'></i></span>");d.push("<span class='f-time'>"+m.time+"</span>");d.push("<span>"+m.context+"</span>");d.push("</li>")});d.push("</ul>");b.find(".J-flow-msg").append(d.join(""));if(f){var j=b.find(".lastFlowMsgLine").css("color");b.find(".lastFlowMsgLine .circlePoint").css("background-color",j)}}}})};Site.initmCenterFlowQuery=function(b){var a=$("#module"+b),c=a.find(".J-mallOrder");c.find(".J-flow").hover(function(){var l=$(this),g=l.attr("_oi"),h=l.offset().top+l.outerHeight()+8,m=l.offset().left-100,j=$("#m"+b+"-f-"+g);if(j.length>0){j.show();if(Fai.isIE6()||Fai.isIE7()){h+=10}j.css({top:h,left:m});return true}var e=l.attr("_fn"),f=l.attr("_fnu");var d=$(this).attr("_colorStyleType");var i=$(this).attr("_colorStyle");var k=["<div id='m",b,"-f-",g,"' class='"+(d>0?"g-flow-msg"+i:"g-flow-msg")+" fk-flow g_border J-f-block' style='top:",h,"px;left:",m,"px;'>","<div class='"+(d>0?"g-b-head-ico"+i:"g-b-head-ico")+" b-head-ico'></div>","<div class='b-head'>","<span>",e,"</span>","<span class='head-bill'>",LS.flowBill,f,"</span>","</div>","<div class='flow-ajaxLoading J-ajaxLoad'>&nbsp;</div>","<div class='no-msg J-no-msg'>",LS.flowNoMsg,"</div>","<div class='flow-msg J-flow-msg'></div>","</div>"];j=$(k.join(""));j.appendTo("body");$.ajax({type:"post",url:"ajax/order_h.jsp?cmd=flowMsg",data:"id="+g,success:function(o){var q=$.parseJSON(o);j.find(".J-ajaxLoad").hide();if(q.msgList==null||q.msgList.length===0||!q.success){j.find(".J-no-msg").show()}else{var n=[];n.push("<ul>");if(q.msgList.indexOf("http")<0){for(var p=0;p<q.msgList.length;p++){var r=q.msgList[p];firstCls="";if(p===0){firstCls=" class='g_stress"+(d>0?i:"")+"'"}n.push("<li"+firstCls+">");n.push("<div>"+r.context+"</div>");n.push("<div class='f-time'>"+r.time+"</div>");n.push("</li>");if(p===2){break}}n.push("</ul>");j.find(".J-flow-msg").append(n.join(""))}}if(q.success){}else{Fai.ing(q.msg,true)}}})},function(){var e=$(this),d=e.attr("_oi");$("#m"+b+"-f-"+d).hide()})};Site.initOrderSuc=function(b,a){var c=Fai.top.location.hash;if(c.indexOf("firstSubmit")>0){Fai.top.location.hash="paid";if(history.pushState){window.history.pushState({},"","mdetail.jsp?id="+a)}$(".J_payBtn").click()}};Site.initConfirmReceipt=function(c,d){var b=$("#module"+c);var a=b.find(".memberOrderNewPanel").length>0;b.find(".J-con-rpt").click(function(){var i=$(this),f=i.parent().parent();orderId=i.attr("_oid");var g=["<div class='fk-conRpt' style='margin-top:16px;'>","<div style='padding:10px; font-family:微软雅黑; font-size:12px; color:rgb(99,99,99);'>",LS.orderConfirmMsg,"</div>","<div style='padding:10px 0 18px 0;'>","<span class='J-rpt-cancel popupBClose' title='",LS.cancel,"' style='margin-right:20px;width:60px; height:26px; line-height:25px;'>",LS.cancel,"</span>","<span class='J-rpt-save con-hover' title='",LS.orderSure,"' style='width:77px; height:26px; background:#1779ff; line-height:25px; border:0;'>"+LS.orderSure+"</span>","</div>","</div>"];var k=parseInt(Math.random()*10000);var e={boxId:k,title:"",htmlContent:g.join(""),width:372,height:150,boxName:"confirmReceipt"};var h=Site.popupBox(e);var j="cmd=setStatus&id="+orderId+"&status=20";h.find(".J-rpt-save").on("click",function(){$.ajax({type:"post",url:"ajax/order_h.jsp",data:j,error:function(){Fai.ing(LS.systemError,false)},success:function(l){var m=$.parseJSON(l);if(m.success){if(d){if(a){f.find(".oOptTd").append("<a hidefocus='true' title='"+LS.comment+"' href='oc.jsp?id="+orderId+"' target='_blank'><span class='optIcon opComent'></span></a>")}else{f.find(".itemOpt").append("<span title='"+LS.comment+"' class='pd-ct J-pd-ct' _oid='"+orderId+"'></span>");Site.initPdComment(c)}}Fai.ing(LS.orderSureMsg,true);f.find(".J-status").text(m.msg);f.find(".J-flow").remove();Fai.top.$("#popupBg"+k).remove();h.remove();i.remove()}else{Fai.ing(m.msg,true)}}})})})};Site.initConOrderCancel=function(b,c){var a=$("#module"+b);if(!c){a.find(".J-order-cancel").hover(function(){var d=$(this);d.attr("class","order-cancel-hover")},function(){var d=$(this);d.attr("class","order-cancel")})}a.find(".J-order-cancel").click(function(){var h=$(this),e=h.parent().parent();orderId=h.attr("_oid");var f=["<div class='fk-cancelOrder'>","<div style='padding:10px;'>",LS.orderCancelMsg,"</div>","<div style='padding:10px 0 18px 0;'>","<span class='J-rpt-cancel popupBClose' style='margin-right:20px;'>",LS.cancel,"</span>","<span class='J-rpt-save con-hover'>"+LS.confirm+"</span>","</div>","</div>"];var j=parseInt(Math.random()*10000);var d={boxId:j,title:"",htmlContent:f.join(""),width:360};var g=Site.popupBox(d);var i="cmd=setStatus&id="+orderId+"&status=25";g.find(".J-rpt-save").on("click",function(){$.ajax({type:"post",url:"ajax/order_h.jsp",data:i,error:function(){Fai.ing(LS.systemError,false)},success:function(k){var l=$.parseJSON(k);if(l.success){Fai.ing(LS.orderCanceled,true);setTimeout(function(){document.location.reload()},200)}else{Fai.ing(l.msg,true)}}})})})};Site.initPdComment=function(b){var a=$("#module"+b);a.find(".J-pd-ct").unbind("click").bind("click",function(){var e=$(this),c=e.attr("_oid"),d=a.find(".J-pd-panel"+c),f=d.find(".msgImgList");if(Fai.isIE6()){f.css("display","none")}if(d.is(":visible")){d.hide()}else{d.show();if(Fai.isIE6()){setTimeout(function(){f.css({display:"block"});var g=f.find("td");if(typeof(g)!="undefined"&&g!=null){f.find("td").eq(0).find("div").click()}},20)}}})};Site.commMenUpAllImgList=null;Site.setMenCommUpAllImgList=function(a){Site.commMenUpAllImgList=Fai.fkEval("("+a+")");if(Fai.isIE6()||Fai.isIE7()){$(".msgBoard_upImg_border").css({width:"50px",height:"50px"})}};Site.siteMenCommImgFileUpload2=function(b,e,g,a,d){if(!Fai.isIE()){Site.siteMenCommImgFileUpload2H5(b,e,g,a,d);return}var f=g.split(",");var c={file_post_name:"Filedata",upload_url:"/ajax/commUpsiteimg_h.jsp",button_placeholder_id:e,file_size_limit:b+"MB",button_image_type:3,file_queue_limit:a,button_width:"50px",button_height:"50px",button_cursor:SWFUpload.CURSOR.HAND,button_image_url:_resRoot+"/image/site/msgUpImg/upload1.jpg",requeue_on_error:false,post_params:{ctrl:"Filedata",app:21,type:0,fileUploadLimit:5,isSiteForm:true},file_types:f.join(";"),file_dialog_complete_handler:function(h){this._allSuccess=false;this.startUpload()},file_queue_error_handler:function(i,h,j){switch(h){case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:Fai.ing(LS.siteFormSubmitCheckFileSizeErr,true);break;case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:Fai.ing(LS.siteFormSubmitFileUploadNotAllow,true);break;case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED:Fai.ing(Fai.format(LS.siteFormSubmitFileUploadOneTimeNum,a),true);break;default:Fai.ing(LS.siteFormSubmitFileUploadReSelect,true);break}},upload_success_handler:function(i,h){var j=jQuery.parseJSON(h);this._allSuccess=j.success;this._sysResult=j.msg;if(j.success){Fai.ing(Fai.format(LS.siteFormSubmitFileUploadSucess,Fai.encodeHtml(i.name)),true);j.tbNum=d;onFileUploadEvent("upload",j)}else{Fai.ing(LS.siteFormSubmitFileUploadFile+i.name+" "+j.msg)}},upload_error_handler:function(i,h,j){if(h==-280){Fai.ing(LS.siteFormSubmitFileUploadFileCancle,false)}else{if(h==-270){Fai.ing(Fai.format(LS.siteFormSubmitFileUploadFileExist,Fai.encodeHtml(i.name)),true)}else{Fai.ing(Fai.format(LS.siteFormSubmitFileUploadSvrBusy,Fai.encodeHtml(i.name)))}}},upload_complete_handler:function(i){if(i.filestatus==SWFUpload.FILE_STATUS.COMPLETE){if(a==null||typeof(a)=="undefined"){a=5}var j=$("#msgBoardAddImgTb"+d).eq(0);var h=j.find("td").length;if(h>=(a+1)){Fai.ing(LS.siteFormSubmitFileUploadOfMax,true);var k=j.find("td").eq(j.find("td").length-1);k.css("display","none");return}if(typeof(swfObjList)=="undefined"){swfObjList={}}swfObj=swfObjList[d];setTimeout(function(){swfObj.startUpload()},swfObj.upload_delay)}else{if(i.filestatus==SWFUpload.FILE_STATUS.ERROR){Fai.ing(Fai.format(LS.siteFormSubmitFileUploadSvrBusy,Fai.encodeHtml(i.name)))}}},upload_start_handler:function(h){Fai.enablePopupWindowBtn(0,"save",false);Fai.ing(LS.siteFormSubmitFileUploadPrepare,false)},view_progress:function(h,k,j,i){Fai.ing(LS.siteFormSubmitFileUploadIng+i+"%",false)}};if(typeof(swfObjList)=="undefined"){swfObjList={}}swfObjList[d]=SWFUploadCreator.create(c);onFileUploadEvent=function(p,m){if(p=="upload"){var j=m.id;var o=m.name;var l=m.size;var k=m.path;var q=m.pathSmall;var i=m.fileId;var h=m.width;var n=m.height;Site.productMenCommImgTableCtrl2(k,o,j,l,a,i,m.tbNum,q)}}};Site.siteMenCommImgFileUpload2H5=function(b,e,h,a,d){$("#"+e).parent(".uploadImgDiv").css("background-image","url("+_resRoot+"/image/site/msgUpImg/upload1.jpg)");var f=h.split(",");var c={siteFree:false,updateUrlViewRes:"",auto:true,fileTypeExts:f.join(";"),multi:false,fileSizeLimit:b*1024*1024,fileSplitSize:20*1024*1024,breakPoints:true,saveInfoLocal:false,showUploadedPercent:false,showUploadedSize:false,removeTimeout:9999999,post_params:{app:21,type:0,fileUploadLimit:b,isSiteForm:true},isBurst:false,isDefinedButton:true,buttonText:"",uploader:"/ajax/commUpsiteimg_h.jsp?cmd=mobiUpload&_TOKEN="+$("#_TOKEN").attr("value"),onUploadSuccess:function(i,k){var j=jQuery.parseJSON(k);if(j.success){Fai.ing(Fai.format(LS.siteFormSubmitFileUploadSucess,Fai.encodeHtml(i.name)),true);j.tbNum=d;onFileUploadEvent("upload",j)}else{Fai.ing(LS.siteFormSubmitFileUploadFile+i.name+" "+j.msg)}},onUploadError:function(i,j){Fai.ing("网络繁忙,文件:"+i.name+"上传失败,请稍后重试")},onSelect:function(){if(a==null||typeof(a)=="undefined"){a=5}var j=$("#msgBoardAddImgTb"+d).eq(0);var i=j.find("td").length;if(i>=(a+1)){Fai.ing(LS.siteFormSubmitFileUploadOfMax,true);var k=j.find("td").eq(j.find("td").length-1);k.css("display","none");return false}return true},onUploadStart:function(i){$("#progressBody_ "+i.id).remove();$("#progressWrap_"+i.id).remove()}};if(typeof(swfObjList)=="undefined"){swfObjList={}}var g=$("#"+e).uploadify(c);$("#"+e).find(".uploadify-button").css("width",50).css("height",50).css("display","inline-block");onFileUploadEvent=function(q,n){if(q=="upload"){var k=n.id;var p=n.name;var m=n.size;var l=n.path;var r=n.pathSmall;var j=n.fileId;var i=n.width;var o=n.height;Site.productMenCommImgTableCtrl2(l,p,k,m,a,j,n.tbNum,r)}}};Site.productMenCommImgTableCtrl2=function(l,a,b,g,c,d,j,k){var h=$("#pdCommTb"+j).eq(0);var i=h.find(".J_td").length-1;var e=h.find(".J_td").eq(i);e.html((i)+"/"+c);var f=[];f.push("<td class='J_td'>");f.push("<table class='pdCtIconDiv' cellpadding='0' cellspacing='0'>");f.push("<tr>");f.push("<td>");f.push("<img alt='' class='pdCtIcon' src='"+k+"' _name='"+a+"' _id='"+b+"' _file_size='"+g+"' _file_id='"+d+"' _path='"+l+"' _smallPath='"+k+"'/>");f.push("</td>");f.push("</tr>");f.push("</table>");f.push("<span onclick='Site.productMenCommImgDelete2(this,"+j+")' class='delPicIcon'/>");f.push("</td>");e.before(f.join(""));if(i>=c){h.find(".J_td").eq(0).hide()}};Site.productMenCommImgDelete2=function(a,d){var e=$("#pdCommTb"+d).eq(0);var b=e.find(".J_td").length;for(var c=0;c<b;c++){if(e.find(".J_td").eq(c).find(".delPicIcon")[0]===a){e.find(".J_td").eq(c).remove();break}}b=e.find(".J_td").length-1;var f=e.find(".J_td").eq(b);f.html((b-1)+"/"+f.attr("maxNum"));e.find(".J_td").eq(0).show()};Site.orderPdCommentAddCom2=function(o,q,k,m){if(_siteDemo){Fai.ing("当前为“模板网站”,请先“复制网站”再进行评论。");return}var u=$("#oCommentItem"+q),s=$("#ocArea"+q),d=$.trim(s.val()),j=parseInt(s.attr("minlength")),e=parseInt(s.attr("maxlength"));if(typeof(d)!="string"||""==d){s.focus();Fai.ing(LS.commentNotEmpty,true);return}if(d.length<j){Fai.ing(Fai.format(LS.commentLenTips,Fai.encodeHtml(j)),true);return}if(d.length>e){Fai.ing(Fai.format(LS.commentLenTips,Fai.encodeHtml(e)),true);return}var r=$("#pdCommTb"+k);var h=[];var l=[];if(r!=null&&typeof(r)!="undefined"){var c=r.eq(0);var g=c.find("td").length;if(g>1){for(var x=0;x<(g-1);x++){var f=c.find(".J_td").eq(x).find(".pdCtIcon");if(f!=null&&typeof(f)!="undefined"&&f.length>0){var y={};var b={};var w=f.attr("_id");var A=f.attr("_name");var v=f.attr("_path");var a=f.attr("_smallpath");var p=f.attr("_file_size");var t=f.attr("_file_id");y.imgId=w;y.imgName=A;y.imgSize=p;y.tempFileId=t;h.push(y);b.path=v;b.smallPath=a;l.push(b)}}}}var z=$(".submitStarList").attr("star");if(!z){z=5}var n={oid:o,iid:q,commImgList:$.toJSON(h),comment:d,star:z};$.ajax({type:"post",url:"ajax/order_h.jsp?cmd=addPC",data:n,error:function(){Fai.ing(LS.systemError)},success:function(L){var G=jQuery.parseJSON(L);if(G.success){Fai.ing(LS.submitSuccess,true);var K=G.imgsPathStr;s.remove();var H=u.find(".commentStarLine");var E=u.find(".commentLine");var C=u.find(".commentOptLine");H.remove();E.remove();C.css({visibility:"hidden",position:"absolute","z-index":"-1"});var B=0;if(typeof(Site.commMenUpAllImgList)!="undefined"&&Site.commMenUpAllImgList!=null){B=Site.commMenUpAllImgList.length}else{Site.commMenUpAllImgList=[]}var i=[];var I='<div class="commentLine">';I+='<table class="commentTable"><tbody><tr>';I+='<td class="ctTitleTd"></td>';I+='<td class="ctCommentArea">';I+='<div class="ctContent">';I+=Fai.encodeHtml(d);I+="</div>";I+="</td>";I+="</tr></tbody></table>";I+="</div>";I+='<div class="commentLine">';I+='<table class="commentTable"><tbody><tr>';I+='<td class="ctTitleTd"></td>';I+='<td><div class="ctOpt J_imgDiv">';I+='<table class="pdCtIconList J_imageTable" border="0" cellspacing="0" cellpadding="0"><tbody><tr>';$.each(h,function(N,O){I+='<td class="J_td">';I+='<table class="pdCtIconDiv" cellpadding="0" cellspacing="0" onclick="Site.showMenCommImgList(\''+O.imgId+"_"+k+"_"+N+"','"+K[N]["path"]+"','picGroupId_"+k+"','"+k+"','"+N+"', true)\"><tr><td>";I+='<img id="'+O.imgId+"_"+k+"_"+N+'" class="pdCtIcon" src="'+l[N]["smallPath"]+'"/>';I+="</td></tr></table>";I+="</td>";var M=new Object();M.data=K[N]["path"];i.push(M)});I+="</tr></tbody></table>";I+="</div></td>";I+="</tr></tbody></table>";I+="</div>";I+='<div class="commentStarLine"><table class="commentTable"><tr>';I+='<td class="ctTitleTd"></td>';I+="<td>";if(m){I+='<div class="lt-ctStarList">';for(var D=1;D<=5;D++){if(D<=z){I+='<li class="fk-icons-star lt_select_more ctStar"></li>'}else{I+='<li class="fk-icons-star lt_no_select ctStar"></li>'}}I+="</div>"}I+='<div class="ctTime">'+G.ctime+'<span class="commented">['+LS.commentOK+"]</span></div>";I+="</td>";I+="</tr></table></div>";var F=new Object();F.data=i;Site.commMenUpAllImgList.push(F);u.append(I)}else{var J="";switch(G.rt){case 1:J=LS.commentError;break;case 2:J=LS.mallStlSubmitNotFound;break;case 3:J=LS.commentError;break;case 5:J=LS.paramError;break;case 6:Fai.top.location.href="login.jsp?url="+Fai.encodeUrl(Fai.getUrlRoot(top.location.href))+"&errno=11";return false;break;case 7:J=LS.commentClosed;break;case 8:J=LS.commentExist;break;case 9:J=LS.commentCountLimit;break;default:J=LS.systemError;break}Fai.ing(J)}}})};Site.siteMenCommImgFileUpload=function(b,e,g,a,d){var f=g.split(",");var c={file_post_name:"Filedata",upload_url:"/ajax/commUpsiteimg_h.jsp",button_placeholder_id:e,file_size_limit:b+"MB",button_image_type:3,file_queue_limit:a,button_width:"50px",button_height:"50px",button_cursor:SWFUpload.CURSOR.HAND,button_image_url:_resRoot+"/image/site/msgUpImg/upload1.jpg",requeue_on_error:false,post_params:{ctrl:"Filedata",app:21,type:0,fileUploadLimit:5,isSiteForm:true},file_types:f.join(";"),file_dialog_complete_handler:function(h){this._allSuccess=false;this.startUpload()},file_queue_error_handler:function(i,h,j){switch(h){case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:Fai.ing(LS.siteFormSubmitCheckFileSizeErr,true);break;case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:Fai.ing(LS.siteFormSubmitFileUploadNotAllow,true);break;case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED:Fai.ing(Fai.format(LS.siteFormSubmitFileUploadOneTimeNum,a),true);break;default:Fai.ing(LS.siteFormSubmitFileUploadReSelect,true);break}},upload_success_handler:function(i,h){var j=jQuery.parseJSON(h);this._allSuccess=j.success;this._sysResult=j.msg;if(j.success){Fai.ing(Fai.format(LS.siteFormSubmitFileUploadSucess,Fai.encodeHtml(i.name)),true);j.tbNum=d;onFileUploadEvent("upload",j)}else{Fai.ing(LS.siteFormSubmitFileUploadFile+i.name+" "+j.msg)}},upload_error_handler:function(i,h,j){if(h==-280){Fai.ing(LS.siteFormSubmitFileUploadFileCancle,false)}else{if(h==-270){Fai.ing(Fai.format(LS.siteFormSubmitFileUploadFileExist,Fai.encodeHtml(i.name)),true)}else{Fai.ing(Fai.format(LS.siteFormSubmitFileUploadSvrBusy,Fai.encodeHtml(i.name)))}}},upload_complete_handler:function(i){if(i.filestatus==SWFUpload.FILE_STATUS.COMPLETE){if(a==null||typeof(a)=="undefined"){a=5}var j=$("#msgBoardAddImgTb"+d).eq(0);var h=j.find("td").length;if(h>=(a+1)){Fai.ing(LS.siteFormSubmitFileUploadOfMax,true);var k=j.find("td").eq(j.find("td").length-1);k.css("display","none");return}if(typeof(swfObjList)=="undefined"){swfObjList={}}swfObj=swfObjList[d];setTimeout(function(){swfObj.startUpload()},swfObj.upload_delay)}else{if(i.filestatus==SWFUpload.FILE_STATUS.ERROR){Fai.ing(Fai.format(LS.siteFormSubmitFileUploadSvrBusy,Fai.encodeHtml(i.name)))}}},upload_start_handler:function(h){Fai.ing(LS.siteFormSubmitFileUploadPrepare,false)},view_progress:function(h,k,j,i){Fai.ing(LS.siteFormSubmitFileUploadIng+i+"%",false)}};if(typeof(swfObjList)=="undefined"){swfObjList={}}swfObjList[d]=SWFUploadCreator.create(c);onFileUploadEvent=function(p,m){if(p=="upload"){var j=m.id;var o=m.name;var l=m.size;var k=m.path;var q=m.pathSmall;var i=m.fileId;var h=m.width;var n=m.height;Site.productMenCommImgTableCtrl(k,o,j,l,a,i,m.tbNum,q)}}};Site.productMenCommImgTableCtrl=function(l,a,b,g,c,d,j,k){var h=$("#msgBoardAddImgTb"+j).eq(0);var i=h.find("td").length;var e=h.find("td").eq(i-1);e.find(".msgBoard_showImgCount").html((i)+"/"+c);var f=[];if(Fai.isIE6()||Fai.isIE7()){f.push("<td class='msgBoard_upImg_tb_td2' style='border:0px !important;padding-right:3px;'>");f.push("<div class='msgBoard_upImg_border' style='width:50px !important;height:50px !important;margin-left:3px;'>")}else{f.push("<td class='msgBoard_upImg_tb_td2' style='border:0px !important;'>");f.push("<div class='msgBoard_upImg_border'>")}f.push("<span onclick='Site.productMenCommImgDelete(this,"+j+")' class='msgBoard_upImgTop_set'/>");if(Fai.isIE6()||Fai.isIE7()){f.push("<div><p><img alt='' class='msgBoard_upImg_set' src='"+k+"' _name='"+a+"' _id='"+b+"' _file_size='"+g+"' _file_id='"+d+"' _path='"+l+"' _smallPath='"+k+"'></p></div>")}else{f.push("<div><p><img alt='' class='msgBoard_upImg_set' src='"+k+"' _name='"+a+"' _id='"+b+"' _file_size='"+g+"' _file_id='"+d+"' _path='"+l+"' _smallPath='"+k+"' style='margin-left:-1px;'></p></div>")}f.push("</div>");f.push("</td>");e.before(f.join(""))};Site.productMenCommImgDelete=function(a,d){var e=$("#msgBoardAddImgTb"+d).eq(0);var b=e.find("td").length;for(var c=0;c<b;c++){if(e.find("td").eq(c).find(".msgBoard_upImgTop_set")[0]===a){e.find("td").eq(c).remove();break}}b=e.find("td").length;var f=e.find("td").eq(b-1);f.find(".msgBoard_showImgCount").html((b-1)+"/"+f.attr("maxNum"));if(b<=f.attr("maxNum")){if(Fai.isIE6()||Fai.isIE7()){f.css({display:"block","padding-top":"7px"})}else{if(Fai.isIE()){f.css({display:"block","padding-top":"8px"})}else{f.css({display:"block","padding-top":"12px"})}}}};Site.showMenCommImgList=function(i,l,d,h,c,b){var f=$("#"+d);if(f!=null&&typeof(f)!="undefined"){f.remove()}var k=$("#"+i);var g=k.parentsUntil(".J_imgDiv",".J_imageTable");g.attr("chooseTr",h);g.attr("chooseTd",c);var e;if(b){e=g.find(".J_td")}else{e=g.find("td");b=false}e.find(".show_msg_border_rect").remove();var j="<div class='show_msg_border_rect'><div class='show_msg_triangle_down'></div></div>";e.eq(c).prepend(j);var a=[];a.push("<div id='"+d+"' class='show_msg_outer_div'>");if(Fai.isIE6()||Fai.isIE7()){a.push("<span onclick=Site.commShowPicClose('"+d+"','"+i+"') class='msg_close_show_img_icon' style='margin-top:-8px;'/>");a.push("<div class='show_msg_bordered_div' style='width:298px !important; margin-top:-8px;'></div>");a.push("<div class='show_msg_border_div' style='width:299px !important;margin-top:-8px;'>")}else{a.push("<span onclick=Site.commShowPicClose('"+d+"','"+i+"') class='msg_close_show_img_icon'/>");a.push("<div class='show_msg_bordered_div' style='width:299px;'></div>");a.push("<div class='show_msg_border_div' style='margin-top:-8px;margin-left:1px;'>")}a.push("<div><p><img alt='' class='msg_up_show_img_set' src='"+l+"'></p></div>");a.push("</div>");a.push("</div>");g.after(a.join(""));setTimeout(function(){$("#"+d).hover(function(){var m=$("#"+d);if(m.find("#J_showCommPicMoveSign").attr("class")==null||typeof(m.find("#J_showCommPicMoveSign").attr("class"))=="undefined"){var n=[];n.push("<div id='J_showCommPicMoveSign'>");n.push("<img alt='' class='showCommPicMoveLeftClickArea' onclick=Site.showMenCommImgMove('"+i+"','"+d+"','left',"+b+")>");n.push("<img alt='' src='"+_resRoot+"/image/site/msgUpImg/mLeft.png' onclick=Site.showMenCommImgMove('"+i+"','"+d+"','left',"+b+") class='showCommPicMoveLeft'>");n.push("<img alt='' class='showCommPicMoveRightClickArea' onclick=Site.showMenCommImgMove('"+i+"','"+d+"','right',"+b+")>");n.push("<img alt='' src='"+_resRoot+"/image/site/msgUpImg/mRight.png' onclick=Site.showMenCommImgMove('"+i+"','"+d+"','right',"+b+") class='showCommPicMoveRight'>");n.push("</div>");m.prepend(n.join(""))}},function(){var m=$("#"+d);if(Fai.isIE7()){setTimeout(function(){m.find("#J_showCommPicMoveSign").remove()},500)}else{m.find("#J_showCommPicMoveSign").remove()}})},10)};Site.showMenCommImgMove=function(h,b,g,a){if(h==null||g==null){return}var j=$("#"+h);var d=j.parentsUntil(".J_imgDiv",".J_imageTable");currentChooseTr=d.attr("chooseTr");currentChooseTd=d.attr("chooseTd");if(currentChooseTr==null||currentChooseTd==null){return}if(Site.commMenUpAllImgList==null){return}var k=0;var c;if(a){c=d.find(".J_td")}else{c=d.find("td");a=false}var f=parseInt(c.length);if(f<=1){return}if(g=="left"){if(currentChooseTd=="0"||currentChooseTd==0){k=f-1}else{k=parseInt(currentChooseTd)-1}}else{if(g=="right"){k=parseInt(currentChooseTd)+1;if(k>=Site.commMenUpAllImgList[currentChooseTr].data.length){k=0}}}c.eq(currentChooseTd).find(".show_msg_border_rect").remove();var i="<div class='show_msg_border_rect'><div class='show_msg_triangle_down'></div></div>";c.eq(k).prepend(i);d.attr("chooseTd",k);var e=$("#"+b).find(".msg_up_show_img_set").parent();$("#"+b).find(".msg_up_show_img_set").remove();e.append("<img alt='' class='msg_up_show_img_set' src='"+Site.commMenUpAllImgList[currentChooseTr].data[k].data+"'>")};Site.orderPdCommentAddCom=function(n,p,j,l){if(_siteDemo){Fai.ing("当前为“模板网站”,请先“复制网站”再进行评论。");return}var s=$(".J-ct-panel-"+n+"-"+p),z=$("#pc_"+n+"_"+p),d=$.trim(z.val()),h=z.attr("minlength");if(typeof(d)!="string"||""==d){z.focus();Fai.ing(LS.commentNotEmpty,true);return}if(d.length<h){Fai.ing(Fai.format(LS.commentLenTips,Fai.encodeHtml(h)),true);return}var q=$("#msgBoardAddImgTb"+j);var g=[];var k=[];if(q!=null&&typeof(q)!="undefined"){var c=q.eq(0);var f=c.find("td").length;if(f>1){for(var v=0;v<(f-1);v++){var e=c.find("td").eq(v).find(".msgBoard_upImg_set");if(e!=null&&e!="undefined"){var w={};var b={};var u=e.attr("_id");var y=e.attr("_name");var t=e.attr("_path");var a=e.attr("_smallpath");var o=e.attr("_file_size");var r=e.attr("_file_id");w.imgId=u;w.imgName=y;w.imgSize=o;w.tempFileId=r;g.push(w);b.path=t;b.smallPath=a;k.push(b)}}}}var x=$(".submitStarList").attr("star");if(!x){x=5}var m={oid:n,iid:p,commImgList:$.toJSON(g),comment:d,star:x};$.ajax({type:"post",url:"ajax/order_h.jsp?cmd=addPC",data:m,error:function(){Fai.ing(LS.systemError)},success:function(E){var P=jQuery.parseJSON(E);if(P.success){Fai.ing(LS.submitSuccess,true);var O=s.find(".g_textarea").parent();var M=s.find(".ct-area3");var K=s.find(".g_ibutton").parent();var D=s.find(".ct-comm-title"),C=s.find(".submitStarList");var Q=s.find(".msgBoard_submit_btn").parent();O.remove();M.css({visibility:"hidden",position:"absolute","z-index":"-1"});K.remove();D.remove();C.remove();Q.remove();var N=0;if(typeof(Site.commMenUpAllImgList)!="undefined"&&Site.commMenUpAllImgList!=null){N=Site.commMenUpAllImgList.length}else{Site.commMenUpAllImgList=[]}var F=[];F.push("<div class='ct-area2'>"+d+"</div>");F.push("<div class='msgImgList ct-area3' style='margin-top:-12px;'>");F.push("<table>");F.push("<tr style='border:0px !important;'>");var i=[];if(g!="[]"&&g.length>0&&P.imgsPathStr!="null"&&g.length==P.imgsPathStr.length){for(var L=0;L<g.length;L++){var J=g[L].imgId;var I=P.imgsPathStr[L].path;var A=k[L].smallPath;F.push("<td class='msgBoard_showImg_tb_td' style='border:0px !important;'>");F.push("<div onclick=Site.showMenCommImgList('"+J+"','"+I+"','picGroupId_"+N+"','"+N+"','"+L+"') class='msgBoard_upImg_border'>");F.push("<div><p><img alt='' class='msgBoard_upImg_set' id='"+J+"' src='"+A+"'></p></div>");F.push("</div>");F.push("</td>");var G=new Object();G.data=I;i.push(G)}}F.push("</tr>");F.push("</table>");F.push("</div>");F.push("<div class='ct-time'>");F.push("<span style='margin-right:10px;'>"+P.ctime+"</span>");F.push("<span class='g_stress'>"+LS.commentOK+"</span>");F.push("</div>");if(l){F.push("<div class='commStarList comm-star-list'>");for(var L=1;L<=5;L++){if(L<=x){F.push("<li class='fk-icons-star lt_select_more'></li>")}else{F.push("<li class='fk-icons-star lt_no_select'></li>")}}F.push("</div>")}var H=new Object();H.data=i;Site.commMenUpAllImgList.push(H);s.append(F.join(""));if(Fai.isIE6()||Fai.isIE7()){setTimeout(function(){$(".msgBoard_upImg_border").css({width:"50px",height:"50px"})},50)}}else{var B="";switch(P.rt){case 1:B=LS.commentError;break;case 2:B=LS.mallStlSubmitNotFound;break;case 3:B=LS.commentError;break;case 5:B=LS.paramError;break;case 6:Fai.top.location.href="login.jsp?url="+Fai.encodeUrl(Fai.getUrlRoot(top.location.href))+"&errno=11";return false;break;case 7:B=LS.commentClosed;break;case 8:B=LS.commentExist;break;case 9:B=LS.commentCountLimit;break;default:B=LS.systemError;break}Fai.ing(B)}}})};Site.changeIEMsgInputWidth=function(){if(isIE=navigator.userAgent.indexOf("MSIE")!=-1){$("#orderLeveaMsgIn").css({height:"17px","line-height":"17px",width:"98%"})}};Site.orderLeveaMsgTip="";Site.orderMessageOpen=false;Site.orderMessageMaxNum=0;Site.setLisMsgInput=function(c,a,b){Site.orderMessageOpen=a;Site.orderLeveaMsgTip=c;Site.orderMessageMaxNum=b;$(function(){$("#orderLeveaMsgIn").focusin(function(){if($(this).val()===Site.orderLeveaMsgTip){$(this).val("")}$(this).css("color","#333")});$("#orderLeveaMsgIn").focusout(function(){$(this).css("color","black");if($(this).val()==""){$(this).val(Site.orderLeveaMsgTip);$(this).css("color","#b8b8b8")}})})};Site.setLisMsgInputInit=function(a){$(function(){$("#orderLeveaMsgIn").val(a);$("#orderLeveaMsgIn").css("color","#b8b8b8")})};Site.showBankLeaveMsg=function(){$(".bankLeaveMsgNew").hover(function(){var b=$(this).offset().top+23;var c=$(this).offset().left-5;var d=$(this).attr("val");var a="<div class='J_bankLeaveMsg bankLeaveMsgNewPanel' style='top:"+b+"px;left: "+c+"px;'>"+Fai.encodeHtml(d)+"</div>";$("body").append(a)},function(){$(".J_bankLeaveMsg").remove()})};(function(m){m.cusAreaList=[];m.isHideCN=false;m.isHideOS=false;m.initMstlDomEvent=function(z,B,K,H,E){m.cusAreaList=B;m.isHideCN=K;m.isHideOS=H;var I=z.moduleId,u=z.sessionMid,t=z.memberId,v=z.addrInfoList,D=z.orderId,x=z.unCheckeditemIdList,w=z.unCheckedItemList,F=z.isFirstTime,A=z.memberName,J=z.imme,s=z.newPropList,C=z.mobileCtNameList,y=z.operaKey,G={};G.addrInfoList=v;$(".addrListWrap").off("click.mstl").on("click.mstl",".addrMsg",function(O){var M=$(O.currentTarget),L=parseInt(M.attr("_item")),N=$(O.target||O.srcElement),L;if(N.hasClass("editAddrBtn")){g(L,u,v,t,s,C,E);b(L,v,s);O.stopPropagation();return}if(M.hasClass("j_addrMsg")&&!M.hasClass("selectedMsg")){$(".selectedMsg").removeClass("selectedMsg mstl_border");M.addClass("selectedMsg mstl_border");n(L,v);return}if(M.hasClass("addAddrMsgPanel")){g(-1,u,v,t,s,C,E);return}});$(".delAddrBtn").click(function(R){var L=$(this).parent().parent().attr("_item");var N=["<div class='fk-cancelOrder'>","<div style='padding:10px;'>",LS.conCancelAddrInfo,"</div>","<div style='padding:10px 0 18px 0;'>","<span class='J-rpt-cancel popupBClose' style='margin-right:20px;'>",LS.cancel,"</span>","<span class='J-rpt-save con-hover'>"+LS.confirm+"</span>","</div>","</div>"];var Q=parseInt(Math.random()*10000);var M={boxId:Q,title:"",htmlContent:N.join(""),width:300};var O=m.popupBox(M);var P="ajax/memberAdm_h.jsp?cmd=set&id="+u;O.find(".J-rpt-save").on("click",function(){v.splice(L,1);$.ajax({type:"post",url:P,data:"info="+Fai.encodeUrl($.toJSON(G)),error:function(){Fai.ing(LS.systemError,false)},success:function(S){var T=$.parseJSON(S);if(T.success){var U=document.location.search.search(/imme/)>-1?"?imme":"";document.location.href="mstl.jsp"+U}else{Fai.ing(T.msg,true)}}})});R.stopPropagation()});$(".setDefaultBtn").click(function(N){var M=$(this).parent().parent().attr("_item");var L="ajax/memberAdm_h.jsp?cmd=set&id="+u;for(index in v){v[index].isDefault=0}v[M].isDefault=1;$.ajax({type:"post",url:L,data:"info="+Fai.encodeUrl($.toJSON(G)),error:function(){Fai.ing(LS.systemError,false)},success:function(O){var P=$.parseJSON(O);if(P.success){var Q=document.location.search.search(/imme/)>-1?"?imme":"";document.location.href="mstl.jsp"+Q}else{Fai.ing(P.msg,true)}}});N.stopPropagation()});$(".mallShipSelect").off("change.mstl").on("change.mstl",function(O){var M=$(this).find("option:selected"),N=$(".shippingPay"),P=$("#shippingMoneyVal"),L=parseFloat(M.attr("price")).toFixed(2);if(Fai.top._lcid!=2052&&Fai.top._lcid!=1028){N.text(Fai.formatPriceEn(L)).attr("_shipmoney",L);P.text(Fai.formatPriceEn(L)).attr("_shipmoney",L)}else{N.text(L).attr("_shipmoney",L);P.text(L).attr("_shipmoney",L)}p()}).trigger("change.mstl");$(".payListWrap").off("click.mstl").on("click.mstl",".payItemBox",function(M){var L=$(M.currentTarget);if(!L.hasClass("payChecked")){$(".payChecked").removeClass("payChecked mstl_border mstl_payChecked");L.addClass("payChecked mstl_border mstl_payChecked");if(L.hasClass("payItemBox2")){$(".banksMsgWrap").addClass("banksMsgWrapShow")}else{$(".banksMsgWrap").removeClass("banksMsgWrapShow")}}});if($(".payChecked ").hasClass("payItemBox2")){$(".banksMsgWrap").addClass("banksMsgWrapShow")}$(".payItemBox1, .payItemBox2").off("mouseenter.mstl").on("mouseenter.mstl",function(){var M=$(this),L=M.find(".payMethod").attr("tips");if(!L){return}var N="<div class='payTipsPanel'>";N+="<div class='panelTriOut'>";N+="<div class='panelTriIn'></div>";N+="</div>";N+=L;N+="</div>";M.append(N)}).off("mouseleave.mstl").on("mouseleave.mstl",function(){var L=$(this),M=L.find(".payTipsPanel");if(M.length>0){M.remove()}});k();e();$(".mstlSublimeBtn").off("click.mstl").on("click.mstl",function(){var O=$(".J_noAddrMsgContent").length>0;var L=false;var Q=$(".addrListWrap .selectedMsg").attr("_item");if(!O){if(v.length>0&&Q!=null){for(var R=0;R<s.length;R++){var V=s[R].fieldKey;var M=s[R].name;var U=s[R].required;if(V=="addr"){L=true}if(!U){continue}if(v[Q][V]==null||v[Q][V]==""){Fai.ing(LS.addrInfoInputError+M,1);return}}if(L){var N=v[Q]["addr_info"].isCus||"";var W=v[Q]["addr_info"].provinceCode||"";var S=v[Q]["addr_info"].cityCode||"";var P=v[Q]["addr_info"].countyCode||"";var T=v[Q]["addr_info"].streetCode||"";if(W!=""&&N){if(d(W)==""){Fai.ing(LS.enterCorrectAddress,1);return}}if(S!=""&&N){if(d(S)==""){Fai.ing(LS.enterCorrectAddress,1);return}}if(P!=""&&N){if(d(P)==""){Fai.ing(LS.enterCorrectAddress,1);return}}}}else{Fai.ing(LS.enterConsignee,1);return}}q(I,D,x,w,t,F,A,v,J,s)});if(y==7){$(".addrMsg").each(function(){if($(this).attr("_item")==(v.length-1)){$(this).click()}})}else{if(y!=6){$(".addrMsg").each(function(){if($(this).attr("_item")==y){$(this).click()}})}}if($(".selectedMsg").length>0){n(parseInt($(".selectedMsg").attr("_item")),v)}m.placeholder($(".msgforSeller, .integralValInput"))};function b(z,t,s){var N=t[z],G=$(".addAddrPopPanel"),y=$("#addrDetail"),J=Fai.top._lcid,I,w,E,F,u=false,H;for(var L=0;L<s.length;L++){H=s[L];if(H.fieldKey=="addr"){var C=N.addr_info.isCus;if(!C){var B="";var x="";var v="";var D="";if(J==2052||J==1028){B=site_cityUtil.getInfo(N.addr_info.countyCode).name;x=site_cityUtil.getInfo(N.addr_info.cityCode).name;v=site_cityUtil.getInfo(N.addr_info.provinceCode).name;D=site_cityUtil.getInfo(N.addr_info.streetCode).name}else{B=site_cityUtil.getInfoEn(N.addr_info.countyCode).name;x=site_cityUtil.getInfoEn(N.addr_info.cityCode).name;v=site_cityUtil.getInfoEn(N.addr_info.provinceCode).name;D=site_cityUtil.getInfoEn(N.addr_info.streetCode).name}if(N.addr_info.provinceCode==990000){$("#areaBoxInput").attr("isOs",1);$("#allArea").val("os");$("#allArea").change()}else{$("#areaBoxInput").attr("isCn",1);$("#allArea").val("cn");$("#allArea").change()}$("#areaBoxInput").attr("area1",N.addr_info.provinceCode);$("#areaBoxInput").attr("area2",N.addr_info.cityCode);$("#areaBoxInput").attr("area3",N.addr_info.countyCode);$("#areaBoxInput").attr("area4",N.addr_info.streetCode);y.val(N.addr_info.streetAddr||"");setTimeout(function(){$("#areaBox1 .group_item[pid='"+N.addr_info.provinceCode+"']").click();setTimeout(function(){$("#areaBox1 .group_item[cid='"+N.addr_info.cityCode+"']").click();setTimeout(function(){$("#areaBox1 .group_item[cid='"+N.addr_info.countyCode+"']").click();setTimeout(function(){$("#areaBox1 .group_item[cid='"+N.addr_info.streetCode+"']").click()},0)},0)},0)},0);$("#areaBox1").hide()}else{var M=d(N.addr_info.countyCode);var K=d(N.addr_info.cityCode);var A=d(N.addr_info.provinceCode);$("#allArea").val(N.addr_info.provinceCode);$("#allArea").change();$("#areaBoxInput").attr("lastArea","-"+M);$("#areaBoxInput").attr("lastAreaType","thd");$("#areaBoxInput").val(A+"-"+K+"-"+M);$("#areaBoxInput").attr("isCus",1);$("#areaBoxInput").attr("area1",N.addr_info.provinceCode);$("#areaBoxInput").attr("area2",N.addr_info.cityCode);$("#areaBoxInput").attr("area3",N.addr_info.countyCode);$("#addrDetail").val(N.addr_info.streetAddr)}u=true;continue}F=G.find("#"+H.fieldKey);if(F.length>0&&N[H.fieldKey]){F.val(N[H.fieldKey]||"");if(H.fieldKey=="mobile"){$("#mobileCt").val(N.mobileCt)}}}if(!u&&$("#mallShipTemplate_province").length===1){if(J==2052||J==1028){I=$("#addrInfo_county"),w=$("#addrInfo_city"),E=$("#addrInfo_province");E.val(N.addr_info.provinceCode);E.trigger("change");w.val(N.addr_info.cityCode);w.trigger("change");I.val(N.addr_info.countyCode)}y.val(N.addr_info.streetAddr||"")}}function g(A,v,x,u,t,B,K){var N=[],E,Q,H,M,T,G,O,z,D="",J=Fai.top._lcid;var P={};P.addrInfoList=x;site_cityUtil.initProvinces(J);var S={};$.each(m.cusAreaList,function(U,V){if(V.parentId==null||V.parentId==""||V.parentId===0){S[V.id]=V}});if(J==2052||J==1028){O=site_cityUtil.getProvince();site_cityUtil.simpleProvinceName(O)}z={};z.width=942;var R=parseInt($(".mallStlNew").attr("themecolor"));var w=isNaN(R)?"":("mstlColor"+R);z.extClass="addAddrPopPanel "+w;z.title="<div class='addAddrPanelTitle'>"+K+"</div>";D+="<div class='addAddrPanelContent'>";var y=false;var F={};for(var L=0;L<t.length;L++){F=t[L];if(F.fieldKey=="addr"){var s=(J==2052||J==1028)?"中国":"China";var I=(J==2052||J==1028)?"海外":"Oversea";D+="<div class='newAddrLine'><label class='itemLabel'>"+LS.Region+"<i class='mustWrite'>*</i></label>";D+="<select id='allArea' class='allArea addrSelectInput'>";D+="<option value=''>------</option>";if(!m.isHideCN){D+="<option value='cn'>"+s+"</option>"}if(!m.isHideOS){D+="<option value='os'>"+I+"</option>"}$.each(S,function(U,V){D+="<option value='"+S[U].id+"'>"+Fai.encodeHtml(S[U].name)+"</option>"});D+="</select>";D+="<input type='text' id='areaBoxInput' class='areaBoxInput' class='itemValInput' style='width:295px;' placeholder='------' readOnly='true' isCn isOs isCus area1 area2 area3/>";D+="<div id='areaBox1' class='areaBox1 areaBox1New' style='display:none;'>";D+="<div id='province_box' class='province_box'>";D+="<div class='pv_head J_areaHead'>";D+="<div class='pv_pv pv'>"+LS.province+"</div>";D+="<div class='pv_city city'>"+LS.city+"</div>";D+="<div class='pv_county county'>"+LS.county+"</div>";D+="<div class='pv_street street'>"+LS.street+"</div>";D+="</div>";D+="<div class='pv_content'>";D+="<div class='spaceLine'></div>";$.each(site_cityUtil.getAreaGroupsPinYin(),function(U,V){D+="<div class='pv_group' style='"+(V[0]=="OS"?"display:none;":"")+"'>";D+="<div class='group_head'>"+V[0]+"</div>";D+="<div class='group_content'>";$.each(V[1],function(X,W){if(J==2052||J==1028){D+="<div class='group_item' pid='"+W+"' pname='"+site_cityUtil.getInfo(W).name+"'>"+site_cityUtil.simpleProvinceNameStr(site_cityUtil.getInfo(W).name)+"</div>"}else{D+="<div class='group_item' pid='"+W+"' pname='"+site_cityUtil.getInfoEn(W).name+"'>"+site_cityUtil.simpleProvinceNameStrEn(site_cityUtil.getInfoEn(W).name)+"</div>"}});D+="</div>";D+="</div>";D+="<div class='spaceLine'></div>"});D+="</div>";D+="</div>";D+="<div id='city_box' class='city_box' style='display:none;'>";D+="<div class='city_head J_areaHead'>";D+="<div class='city_pv pv'>"+LS.province+"</div>";D+="<div class='city_city city'>"+LS.city+"</div>";D+="<div class='city_county county'>"+LS.county+"</div>";D+="<div class='city_street street'>"+LS.street+"</div>";D+="</div>";D+="</div>";D+="<div id='county_box' class='county_box' style='display:none;'>";D+="<div class='county_head J_areaHead'>";D+="<div class='county_pv pv'>"+LS.province+"</div>";D+="<div class='county_city city'>"+LS.city+"</div>";D+="<div class='county_county county'>"+LS.county+"</div>";D+="<div class='county_street street'>"+LS.street+"</div>";D+="</div>";D+="</div>";D+="<div id='street_box' class='street_box' style='display:none;'>";D+="<div class='street_head J_areaHead'>";D+="<div class='street_pv pv'>"+LS.province+"</div>";D+="<div class='street_city city'>"+LS.city+"</div>";D+="<div class='street_county county'>"+LS.county+"</div>";D+="<div class='street_street street'>"+LS.street+"</div>";D+="</div>";D+="</div>";D+="</div>";D+="<div id='areaBox2' class='areaBox2 areaBox2New' style='display:none;'>";D+="<div id='sec_box' class='sec_box'>";D+="<div class='sec_head J_areaHead2'>";D+="<div class='sec_sec sec'>"+LS.firstRegion+"</div>";D+="<div class='sec_thd thd'>"+LS.secRegion+"</div>";D+="</div>";D+="<div class='sec_content'></div>";D+="</div>";D+="<div id='thd_box' class='thd_box' style='display:none;'>";D+="<div class='thd_head J_areaHead2'>";D+="<div class='thd_sec sec'>"+LS.firstRegion+"</div>";D+="<div class='thd_thd thd'>"+LS.secRegion+"</div>";D+="</div>";D+="<div class='thd_content'></div>";D+="</div>";D+="</div>";D+="</div>";D+="<p class='newAddrLine'><label class='itemLabel'>"+LS.addrDetail+"<i class='mustWrite'>"+(F.required?"*":"&nbsp;")+"</i></label>";D+="<input id='addrDetail' class='addrDetail itemValInput' placeholder='"+LS.addrDetail+"' maxLength='100'></p>";y=true;continue}D+="<p class='newAddrLine j_newAddrLine'>";D+="<label class='itemLabel'>";D+=F.name;D+="<i class='mustWrite'>"+(F.required?"*":"&nbsp;")+"</i>";D+="</label>";if(F.fieldKey=="mobile"||F.fieldKey=="phone"){D+="<input id='"+F.fieldKey+"' type='number' class='itemValInput "+F.fieldKey+"' maxLength='11' onkeypress='javascript:return Fai.isNumberKey(event)' oninput='value=value.replace(/[^0-9]/g,\"\");if(value.length>11)value=value.slice(0,11);'>"}else{D+="<input id='"+F.fieldKey+"' class='itemValInput "+F.fieldKey+"' maxLength='50'>"}D+="</p>"}if(!y&&$("#mallShipTemplate_province").length===1){var s=(J==2052||J==1028)?"中国":"China";var I=(J==2052||J==1028)?"海外":"Oversea";D+="<div class='newAddrLine'><label class='itemLabel'>"+LS.Region+"<i class='mustWrite'>*</i></label>";D+="<select id='allArea' class='allArea addrSelectInput'>";D+="<option value=''>------</option>";if(!m.isHideCN){D+="<option value='cn'>"+s+"</option>"}if(!m.isHideOS){D+="<option value='os'>"+I+"</option>"}$.each(S,function(U,V){D+="<option value='"+S[U].id+"'>"+Fai.encodeHtml(S[U].name)+"</option>"});D+="</select>";D+="<input type='text' id='areaBoxInput' class='itemValInput areaBoxInput' style='width:295px;' placeholder='------' readOnly='true' isCn isOs isCus area1 area2 area3/>";D+="<div id='areaBox1' class='areaBox1 areaBox1New' style='display:none;'>";D+="<div id='province_box' class='province_box'>";D+="<div class='pv_head J_areaHead'>";D+="<div class='pv_pv pv'>"+LS.province+"</div>";D+="<div class='pv_city city'>"+LS.city+"</div>";D+="<div class='pv_county county'>"+LS.county+"</div>";D+="<div class='pv_street street'>"+LS.street+"</div>";D+="</div>";D+="<div class='pv_content'>";D+="<div class='spaceLine'></div>";$.each(site_cityUtil.getAreaGroupsPinYin(),function(U,V){D+="<div class='pv_group' style='"+(V[0]=="OS"?"display:none;":"")+"'>";D+="<div class='group_head'>"+V[0]+"</div>";D+="<div class='group_content'>";$.each(V[1],function(X,W){if(J==2052||J==1028){D+="<div class='group_item' pid='"+W+"' pname='"+site_cityUtil.getInfo(W).name+"'>"+site_cityUtil.simpleProvinceNameStr(site_cityUtil.getInfo(W).name)+"</div>"}else{D+="<div class='group_item' pid='"+W+"' pname='"+site_cityUtil.getInfoEn(W).name+"'>"+site_cityUtil.simpleProvinceNameStrEn(site_cityUtil.getInfoEn(W).name)+"</div>"}});D+="</div>";D+="</div>";D+="<div class='spaceLine'></div>"});D+="</div>";D+="</div>";D+="<div id='city_box' class='city_box' style='display:none;'>";D+="<div class='city_head J_areaHead'>";D+="<div class='city_pv pv'>"+LS.province+"</div>";D+="<div class='city_city city'>"+LS.city+"</div>";D+="<div class='city_county county'>"+LS.county+"</div>";D+="<div class='city_street street'>"+LS.street+"</div>";D+="</div>";D+="</div>";D+="<div id='county_box' class='county_box' style='display:none;'>";D+="<div class='county_head J_areaHead'>";D+="<div class='county_pv pv'>"+LS.province+"</div>";D+="<div class='county_city city'>"+LS.city+"</div>";D+="<div class='county_county county'>"+LS.county+"</div>";D+="<div class='county_street street'>"+LS.street+"</div>";D+="</div>";D+="</div>";D+="<div id='street_box' class='street_box' style='display:none;'>";D+="<div class='street_head J_areaHead'>";D+="<div class='street_pv pv'>"+LS.province+"</div>";D+="<div class='street_city city'>"+LS.city+"</div>";D+="<div class='street_county county'>"+LS.county+"</div>";D+="<div class='street_street street'>"+LS.street+"</div>";D+="</div>";D+="</div>";D+="</div>";D+="<div id='areaBox2' class='areaBox2 areaBox2New' style='display:none;'>";D+="<div id='sec_box' class='sec_box'>";D+="<div class='sec_head J_areaHead2'>";D+="<div class='sec_sec sec'>"+LS.firstRegion+"</div>";D+="<div class='sec_thd thd'>"+LS.secRegion+"</div>";D+="</div>";D+="<div class='sec_content'></div>";D+="</div>";D+="<div id='thd_box' class='thd_box' style='display:none;'>";D+="<div class='thd_head J_areaHead2'>";D+="<div class='thd_sec sec'>"+LS.firstRegion+"</div>";D+="<div class='thd_thd thd'>"+LS.secRegion+"</div>";D+="</div>";D+="<div class='thd_content'></div>";D+="</div>";D+="</div>";D+="</div>";D+="<p class='newAddrLine'><label class='itemLabel'></label>";D+="<input id='addrDetail' class='addrDetail itemValInput' placeholder='"+LS.addrDetail+"' maxLength='100'></p>"}D+="<p class='newAddrLine'><label class='itemLabel'></label><span id='sublimeNewAddr' class='sublimeNewAddr addAddrBtn mstl_bg'>"+LS.confirm+"</span><span id='cancelNewAddr' class='cancelNewAddr addAddrBtn'>"+LS.cancel+"</span></p>";D+="</div>";z.htmlContent=D;m.popupBox(z);if($("#areaBoxInput").length>0){$("#areaBox1,#areaBox2").css("left",$("#areaBoxInput").position().left)}$("#areaBoxInput").hide();$(document).unbind("click.forAreaBox").bind("click.forAreaBox",function(){$("#areaBox1").hide();$("#areaBox2").hide()});$("#areaBox1,#areaBox2").unbind("click.forAreaBox").bind("click.forAreaBox",function(U){C(U)});function C(U){if(U.stopPropagation){U.stopPropagation()}else{U.cancelBubble=true}}$("#allArea").change(function(){if($("#allArea").val()==null||$("#allArea").val()==""||$("#allArea").val()=="os"){$("#areaBoxInput").hide()}else{$("#areaBoxInput").show()}$("#areaBox1").hide();$("#areaBox2").hide();if($("#allArea").val()==null||$("#allArea").val()==""){return}$("#areaBoxInput").attr("isCn",0);$("#areaBoxInput").attr("isCus",0);$("#areaBoxInput").attr("isOs",0);$("#areaBoxInput").attr("area1","");$("#areaBoxInput").attr("area2","");$("#areaBoxInput").attr("area3","");$("#areaBoxInput").attr("area4","");if($("#allArea").val()=="cn"){$("#areaBoxInput").attr("isCn",1);$("#areaBox1 .pv").click();$("#areaBox1 .city_content").remove();$("#areaBox1 .county_content").remove();$("#areaBox1 .street_content").remove();$("#areaBox1").show();$("#areaBoxInput").val("")}else{if($("#allArea").val()=="os"){$("#areaBoxInput").attr("isOs",1);$("#areaBoxInput").attr("area1",990000);$("#areaBoxInput").attr("area2",990100);$("#areaBoxInput").val($("#areaBox1").find(".group_item[pid='990000']").text())}else{$("#areaBoxInput").attr("isCus",1);$("#areaBoxInput").attr("area1",$("#allArea").val());$("#areaBox2 .sec_content").html("");$("#areaBox2 .thd_content").html("");$("#areaBox2").show();$("#areaBoxInput").val("")}}if($("#allArea").val()=="cn"||$("#allArea").val()=="os"){return}var U=a($("#allArea").val());$("#sec_box .sec_content").append(U);$("#areaBoxInput").val($("#areaBoxInput").val()+$("#allArea option[value='"+$("#allArea").val()+"']").text());if(U===null||U===undefined||U===""){$("#areaBox2").hide();$(".J-ssq").hide();$("#areaBoxInput").hide()}});$("#areaBoxInput").unbind("click").bind("click",function(U){if($("#allArea").val()=="cn"){$("#areaBox1").toggle();$("#areaBox2").hide();$("#province_box").show();$("#city_box").hide();$("#county_box").hide();$("#street_box").hide()}else{if($("#allArea").val()==null||$("#allArea").val()=="os"){}else{$("#areaBox2").toggle();$("#areaBox1").hide();$("#sec_box").show();$("#thd_box").hide()}}C(U)});$("#areaBox1 .J_areaHead .pv").click(function(){$("#province_box").show();$("#city_box").hide();$("#county_box").hide();$("#street_box").hide()});$("#areaBox1 .J_areaHead .city").click(function(){$("#province_box").hide();$("#city_box").show();$("#county_box").hide();$("#street_box").hide()});$("#areaBox1 .J_areaHead .county").click(function(){$("#province_box").hide();$("#city_box").hide();$("#county_box").show();$("#street_box").hide()});$("#areaBox1 .J_areaHead .street").click(function(){$("#province_box").hide();$("#city_box").hide();$("#county_box").hide();$("#street_box").show()});$(".J_areaHead2 .sec").click(function(){$("#sec_box").show();$("#thd_box").hide()});$(".J_areaHead2 .thd").click(function(){$("#sec_box").hide();$("#thd_box").show()});$("#province_box .group_item").bind("click",function(){$("#areaBox1 .city_content").remove();$("#areaBox1 .county_content").remove();$("#areaBox1 .street_content").remove();var U=$(this).attr("pname");var V=$(this).attr("pid");$("#areaBox1 .J_areaHead .city").click();$("#areaBoxInput").val("");$("#areaBoxInput").val($("#areaBoxInput").val()+U);$("#areaBoxInput").removeAttr("lastArea");$("#areaBoxInput").removeAttr("lastAreaType");$("#areaBoxInput").attr("area1",V);$("#areaBoxInput").attr("area2","");$("#areaBoxInput").attr("area3","");$("#areaBoxInput").attr("area4","");$(".city_content").remove();var X="";if(J==2052||J==1028){X=i(site_cityUtil.getCities(V))}else{X=i(site_cityUtil.getCitiesEn(V))}var W=$(X).html();if(W===null||W===undefined||W===""){$("#areaBox1").hide()}$("#city_box").append(X)});$("#city_box").delegate(".group_item","click",function(){$("#areaBox1 .county_content").remove();$("#areaBox1 .street_content").remove();var U=$(this).attr("cname");var W=$(this).attr("cid");$("#areaBox1 .J_areaHead .county").click();var Z=$("#areaBoxInput").attr("lastArea");var V=$("#areaBoxInput").attr("lastAreaType");if(V!=null&&V!=""){$("#areaBoxInput").val($("#areaBoxInput").val().substring(0,$("#areaBoxInput").val().indexOf("-")))}$("#areaBoxInput").val($("#areaBoxInput").val()+"-"+U);$("#areaBoxInput").attr("lastArea","-"+U);$("#areaBoxInput").attr("lastAreaType","city");$("#areaBoxInput").attr("area2",W);$("#areaBoxInput").attr("area3","");$("#areaBoxInput").attr("area4","");$(".county_content").remove();var Y="";if(J==2052||J==1028){Y=f(site_cityUtil.getCounty(W))}else{Y=f(site_cityUtil.getCountyEn(W))}var X=$(Y).html();if(X===null||X===undefined||X===""){$("#areaBox1").hide()}$("#county_box").append(Y)});$("#county_box").delegate(".group_item","click",function(){$("#areaBox1 .street_content").remove();var V=$(this).attr("cname");var X=$(this).attr("cid");$(".J_areaHead .street").click();var Z=$("#areaBoxInput").attr("lastArea");var W=$("#areaBoxInput").attr("lastAreaType");if(W!=null&&(W=="street"||W=="county")){$("#areaBoxInput").val($("#areaBoxInput").val().substring(0,$("#areaBoxInput").val().indexOf("-",$("#areaBoxInput").val().indexOf("-")+1)))}$("#areaBoxInput").val($("#areaBoxInput").val()+"-"+V);$("#areaBoxInput").attr("lastArea","-"+V);$("#areaBoxInput").attr("lastAreaType","county");$("#areaBoxInput").attr("area3",X);$("#areaBoxInput").attr("area4","");var U="";if(J==2052||J==1028){U=j(site_cityUtil.getStreet(X))}else{U=j(site_cityUtil.getStreetEn(X))}var Y=$(U).html();if(Y===null||Y===undefined||Y===""){$("#areaBox1").hide()}$("#street_box").append(U)});$("#street_box").delegate(".group_item","click",function(){var U=$(this).attr("cname");var W=$(this).attr("cid");var X=$("#areaBoxInput").attr("lastArea");var V=$("#areaBoxInput").attr("lastAreaType");if(V!=null&&V=="street"){$("#areaBoxInput").val($("#areaBoxInput").val().replace(X,""))}$("#areaBoxInput").val($("#areaBoxInput").val()+"-"+U);$("#areaBoxInput").attr("lastArea","-"+U);$("#areaBoxInput").attr("lastAreaType","street");$("#areaBoxInput").attr("area4",W);$("#areaBox1").hide()});$("#sec_box").delegate(".group_item","click",function(){$("#areaBox2 .thd_content").html("");var U=$(this).attr("cname");var W=$(this).attr("cid");$(".J_areaHead2 .thd").click();var Y=$("#areaBoxInput").attr("lastArea");var V=$("#areaBoxInput").attr("lastAreaType");if(V!=null&&V!=""&&$("#areaBoxInput").val().indexOf("-")!=-1){$("#areaBoxInput").val($("#areaBoxInput").val().substring(0,$("#areaBoxInput").val().indexOf("-")))}$("#areaBoxInput").val($("#areaBoxInput").val()+"-"+U);$("#areaBoxInput").attr("lastArea","-"+U);$("#areaBoxInput").attr("lastAreaType","sec");$("#areaBoxInput").attr("area2",W);$("#areaBoxInput").attr("area3","");var X=a(W);if(X===null||X===undefined||X===""){$("#areaBox2").hide()}$("#thd_box .thd_content").append(X)});$("#thd_box").delegate(".group_item","click",function(){var U=$(this).attr("cname");var W=$(this).attr("cid");var X=$("#areaBoxInput").attr("lastArea");var V=$("#areaBoxInput").attr("lastAreaType");if(V!=null&&V=="thd"){$("#areaBoxInput").val($("#areaBoxInput").val().replace(X,""))}$("#areaBoxInput").val($("#areaBoxInput").val()+"-"+U);$("#areaBoxInput").attr("lastArea","-"+U);$("#areaBoxInput").attr("lastAreaType","thd");$("#areaBoxInput").attr("area3",W);$("#areaBox2").hide()});$(".sublimeNewAddr").off("click.mstl").on("click.mstl",function(){h(A,P,v,u,t)});$(".cancelNewAddr").off("click.mstl").on("click.mstl",function(){$(".popupBClose").click()})}function i(t){var s="";s+="<div class='city_content'>";$.each(t,function(u,v){if(Fai.top._lcid==2052||Fai.top._lcid==1028){s+="<div class='group_item' cid='"+v.id+"' cname='"+site_cityUtil.getInfo(v.id).name+"'>"+site_cityUtil.simpleCityNameStr(site_cityUtil.getInfo(v.id).name)+"</div>"}else{s+="<div class='group_item' cid='"+v.id+"' cname='"+site_cityUtil.getInfoEn(v.id).name+"'>"+site_cityUtil.simpleCityNameStrEn(site_cityUtil.getInfoEn(v.id).name)+"</div>"}});s+="</div>";return s}function f(t){var s="";s+="<div class='county_content'>";$.each(t,function(u,v){if(Fai.top._lcid==2052||Fai.top._lcid==1028){s+="<div class='group_item' cid='"+v.id+"' cname='"+site_cityUtil.getInfo(v.id).name+"'>"+site_cityUtil.getInfo(v.id).name+"</div>"}else{s+="<div class='group_item' cid='"+v.id+"' cname='"+site_cityUtil.getInfoEn(v.id).name+"'>"+site_cityUtil.getInfoEn(v.id).name+"</div>"}});s+="</div>";return s}function j(t){var s="";s+="<div class='street_content'>";$.each(t,function(u,v){if(Fai.top._lcid==2052||Fai.top._lcid==1028){s+="<div class='group_item' cid='"+v.id+"' cname='"+site_cityUtil.getInfo(v.id).name+"'>"+site_cityUtil.getInfo(v.id).name+"</div>"}else{s+="<div class='group_item' cid='"+v.id+"' cname='"+site_cityUtil.getInfoEn(v.id).name+"'>"+site_cityUtil.getInfoEn(v.id).name+"</div>"}});s+="</div>";return s}function d(t){var s="";var u=false;$.each(m.cusAreaList,function(v,w){if(u){return}if(w.id==t){s=w.name;u=true}});return s}function o(t){var s=[];$.each(m.cusAreaList,function(u,v){if(v.parentId==t){s.push(v)}});return s}function a(s){if(isNaN(s)){return""}var u=parseInt(s);var t="";$.each(o(u),function(v,w){t+="<div class='group_item' cid='"+w.id+"' cname='"+w.name+"'>"+w.name+"</div>"});return t}function h(C,P,v,u,s){var w=P.addrInfoList;var D={};var y=C==-1?{}:w[C];var H=$(".addAddrPopPanel"),L=Fai.top._lcid,K,A,F,J,G,I,E=false,z=false,N,x=false,R="";for(var O=0;O<s.length;O++){I=s[O];E=I.required;if(I.fieldKey=="addr"){x=E;var Q=$("#allArea").val();if(Q==null||Q==""){Fai.ing(LS.selectArea);return}else{if(Q=="cn"||Q=="os"){D.isCus=false}else{D.isCus=true}}J=$("#areaBoxInput").attr("area4");K=$("#areaBoxInput").attr("area3");A=$("#areaBoxInput").attr("area2");F=$("#areaBoxInput").attr("area1");if(A==null){A=-1}if(K==null){K=-1}if(J==null){J=-1}if(F==""&&x){Fai.ing(LS.mallStlSubmitAddrErr,1);return}if(A==""&&x&&!D.isCus){Fai.ing(LS.mallStlSubmitAddrErr,1);return}D.provinceCode=parseInt(F);D.cityCode=parseInt(A);D.countyCode=parseInt(K);D.streetCode=parseInt(J);N=$("#areaBoxInput").val().replace(/-/g,"");if(D.provinceCode==990000){N=N.replace($("div[pid='990000']:eq(0)").text()+$("div[pid='990000']:eq(0)").text(),$("div[pid='990000']:eq(0)").text())}var B=$("#addrDetail");if(B.val()==""&&x){Fai.ing(LS.editStreetAddr,1);return}D.streetAddr=B.val();y.addr_info=D;y.addr=(N||"")+B.val();if(E&&!y.addr){return Fai.ing(LS.addrInfoInputError+I.name,1)}z=true;continue}G=H.find("#"+I.fieldKey);if(G.length>0){R=G.val();if(E&&R==""){return Fai.ing(LS.addrInfoInputError+I.name,1)}if(I.fieldKey=="email"&&!Fai.isEmail(R)&&E){Fai.ing(LS.addrInfoInputError+I.name,1);return}if(I.fieldKey=="phone"&&!Fai.isPhone(R)&&E){Fai.ing(LS.addrInfoInputError+I.name,1);return}if(I.fieldKey=="mobile"){y.mobileCt=$("#mobileCt").val();if(!Fai.isNationMobile(R)&&E){return Fai.ing(LS.mobileNumRegular)}}y[I.fieldKey]=G.val()}}if(!z&&$("#mallShipTemplate_province").length===1){var t=$("#allArea").val();if(t==null||t==""){Fai.ing(LS.selectArea);return}else{if(t=="cn"||t=="os"){D.isCus=false}else{D.isCus=true}}J=$("#areaBoxInput").attr("area4");K=$("#areaBoxInput").attr("area3");A=$("#areaBoxInput").attr("area2");F=$("#areaBoxInput").attr("area1");if(F==null||F==""){Fai.ing(LS.mallStlSubmitAddrErr,1);return}if((A==null||A=="")&&!D.isCus){Fai.ing(LS.mallStlSubmitAddrErr,1);return}D.provinceCode=parseInt(F);D.cityCode=parseInt(A);D.countyCode=parseInt(K);D.streetCode=parseInt(J);N=$("#areaBoxInput").val().replace(/-/g,"");var B=$("#addrDetail");if(B.val()==""&&x){Fai.ing(LS.editStreetAddr,1);return}D.streetAddr=B.val();y.addr_info=D;y.addr=(N||"")+B.val();if(!y.addr){return Fai.ing(LS.addrInfoInputError+I.name,1)}}if(C==-1){if(u==0){y.isDefault=1}w.push(y);var M="ajax/memberAdm_h.jsp?cmd=set&opera=addAddr&id="+v}else{M="ajax/memberAdm_h.jsp?cmd=set&opera=editAddr&editItem="+C+"&id="+v;y=w[C]}if(!!u){$(".sublimeNewAddr").off("click.mstl");$.ajax({type:"post",url:M,data:"info="+Fai.encodeUrl($.toJSON(P)),success:function(aa){var U=$.parseJSON(aa);if(U.success){var V=document.location.search.search(/imme/)>-1?"?imme&":"?";if(C==-1){document.location.href="mstl.jsp"+V+"opera=add"}else{var S=P.addrInfoList[C];var T=$(".j_addrMsg[_item='"+C+"']");T.find(".addrName span").text(S.name);T.find(".addrPhone span").text(S.phone);T.find(".msgAddrText").text(S.addr);if(S.phone==null||S.phone==""){T.find(".addrPhone span").text(S.mobile)}if((S.addr_info!=null||S.addr_info!="")&&T.hasClass("selectedMsg")){var X=S.addr_info.isCus;if(!X){var Z="";var Y="";var W="";if(L==2052||L==1028){Z=site_cityUtil.getInfo(S.addr_info.countyCode).name;Y=site_cityUtil.getInfo(S.addr_info.cityCode).name;W=site_cityUtil.getInfo(S.addr_info.provinceCode).name}else{Z=site_cityUtil.getInfoEn(S.addr_info.countyCode).name;Y=site_cityUtil.getInfoEn(S.addr_info.cityCode).name;W=site_cityUtil.getInfoEn(S.addr_info.provinceCode).name}if(S.addr_info.provinceCode==990000){$("#mallShipTemplate_areaBoxInput").attr("isOs",1);$("#mallShipTemplate_allArea").val("os");$("#mallShipTemplate_allArea").change()}else{$("#mallShipTemplate_areaBoxInput").attr("isCn",1);$("#mallShipTemplate_allArea").val("cn");$("#mallShipTemplate_allArea").change()}$("#mallShipTemplate_areaBoxInput").attr("area1",S.addr_info.provinceCode);$("#mallShipTemplate_areaBoxInput").attr("area2",S.addr_info.cityCode);$("#mallShipTemplate_areaBoxInput").attr("area3",S.addr_info.countyCode);$("#mallShipTemplate_areaBoxInput").attr("lastArea","-"+Z);$("#mallShipTemplate_areaBoxInput").attr("lastAreaType","county");setTimeout(function(){$("#mallShipTemplate_areaBox1 .group_item[pid='"+S.addr_info.provinceCode+"']").click();setTimeout(function(){$("#mallShipTemplate_areaBox1 .group_item[cid='"+S.addr_info.cityCode+"']").click();setTimeout(function(){$("#mallShipTemplate_areaBox1 .group_item[cid='"+S.addr_info.countyCode+"']").click()},0)},0)},0);$("#streetAddress").val(S.addr_info.streetAddr)}else{setTimeout(function(){$("#mallShipTemplate_allArea").val(S.addr_info.provinceCode);$("#mallShipTemplate_allArea").change();setTimeout(function(){$("#mallShipTemplate_areaBox2 .group_item[cid='"+S.addr_info.cityCode+"']").click();setTimeout(function(){$("#mallShipTemplate_areaBox2 .group_item[cid='"+S.addr_info.countyCode+"']").click()},0)},0)},0);$("#streetAddress").val(S.addr_info.streetAddr)}}$(".addAddrPanelContent").parents(".formMSG").next(".popupBClose").click()}}else{Fai.ing(U.msg)}},error:function(){Fai.ing(LS.systemError)}})}else{l(P)}}function l(u){var s=[],t=u.addrInfoList[0];s.push("<div class='addrMsg j_addrMsg selectedMsg mstl_border' _item='0'>");s.push("<div class='headerBg'></div>");s.push("<div class='dealAddrHandler'>");s.push("<div class='delAddrBtn vDelAddrBtn mstl_deleteBtn'></div>");s.push("<div class='editAddrBtn mstl_editBtn'></div>");s.push("<div class='setDefaultBtn vSetDefaultBtn mstl_color'>设为默认</div>");s.push("</div>");s.push("<div class='addrItem addrName'><i class='msgIcon msgIconName'></i>"+(t.name||"")+"</div>");s.push("<div class='addrItem addrPhone'><i class='msgIcon msgIconPhone'></i>"+(t.phone||t.mobile||"")+"</div>");s.push("<div class='addrItem addrDetial'><i class='msgIcon msgIconAddr'></i><span class='msgAddrText'>"+(t.addr||"")+"</span></div>");s.push("<div class='bottomSelected mstl_selectFlag'></div>");s.push("</div>");$(".addrListWrap").html("").append(s.join(""));n(0,u.addrInfoList);$(".popupBClose").click()}function k(){var s=$("#useItg");if(s.length<1){return}if(parseInt(s.attr("_currentitg"))==0){s.prop("disabled",true);return}$(".integralTitle").off("click.mstl").on("click.mstl",function(u){var t=$(this);if(t.hasClass("discountChecked")){t.removeClass("discountChecked");t.next().val("").trigger("blur").attr("disabled","true")}else{t.addClass("discountChecked");t.next().removeAttr("disabled")}});s.bind("blur",function(){var z=parseInt(s.attr("_needitg"));var x=parseInt(s.val());var C=s.attr("_itgname");var B=parseInt(s.attr("_maxuse"));var t=0;if(isNaN(x)){x=0}var u=$(this).attr("moduleId");var v=Fai.top.$("#module"+u);var y=parseFloat(v.find(".calTotalItem").attr("pay_price"));if(isNaN(y)){return}if($("#couponCheckBox").length>0&&$("#couponCheckBox").prop("checked")){var A=0;if($("#couponOffsetMoney").length>0){var D=$("#couponOffsetMoney").attr("_offsetmoney");if(!isNaN(D)){A=parseInt(D);var E=Math.floor((y-A)*z);if(E<B){B=E}}}}if(x>B){Fai.ing(Fai.format(LS.integral_maxUse,B,Fai.encodeHtml(C)),true);s.val(B);var w=(B/z).toFixed(2);if(Fai.top._lcid!=2052&&Fai.top._lcid!=1028){$("#offsetMoney").text(Fai.formatPriceEn(w))}else{$("#offsetMoney").text(w)}$("#offsetMoney").attr("_offsetmoney",w);p();return}if(x>parseInt(s.attr("_currentItg"))){Fai.ing(Fai.format(LS.integral_notOverCurrent,Fai.encodeHtml(C),Fai.encodeHtml(C)));s.focus();return}if(x<0){Fai.ing(LS.integral_inputInteger);s.focus();return}var w=(x/z).toFixed(2);if(Fai.top._lcid!=2052&&Fai.top._lcid!=1028){$("#offsetMoney").text(Fai.formatPriceEn(w))}else{$("#offsetMoney").text(w)}$("#offsetMoney").attr("_offsetmoney",w);if(x>0){$("#integralInfo").show()}else{$("#integralInfo").hide()}if($("#couponCheckBox").length>0){$(".couponShowList option").each(function(){var F=parseInt($(this).attr("_minPrice"));if(y-w<F){$(this).hide();if($(this).prop("checked")){$("#couponOffsetMoney").text("0.00").attr("_offsetmoney","0.00")}$(".couponShowList").val(-1)}else{$(this).show()}})}p()})}function e(){var s=$("#couponCheckBox"),t=$(".couponShowList");if(s.length<1){return}if(t.find("option").length==1){s.prop("disabled",true);return}$(".couponTitle").off("click.mstl").on("click.mstl",function(v){var u=$(this);if(u.hasClass("discountChecked")){u.removeClass("discountChecked");u.next().val(-1).trigger("change").attr("disabled","true")}else{u.addClass("discountChecked");u.next().removeAttr("disabled")}});t.off("change.mstl").on("change.mstl",function(y){var v=$(this),w=v.find("option:selected");var x=$(this).find("input:checkbox").is(":checked");var u=0;if(v.val()!=-1){u=parseFloat(w.attr("data_saveprice"))}if(u>0){$("#couponInfo").show()}else{$("#couponInfo").hide()}if(Fai.top._lcid!=2052&&Fai.top._lcid!=1028){$("#couponOffsetMoney").text(Fai.formatPriceEn(u)).attr("_offsetmoney",u)}else{$("#couponOffsetMoney").text(u.toFixed(2)).attr("_offsetmoney",u)}p()})}function p(){var w=parseFloat($(".calTotalItem").attr("pay_price")).toFixed(2)*100||0,t=parseFloat($("#offsetMoney").attr("_offsetmoney")).toFixed(2)*100||0,s=parseFloat($("#couponOffsetMoney").attr("_offsetmoney")).toFixed(2)*100||0,x=parseFloat($("#shippingMoneyVal").attr("_shipmoney")).toFixed(2)*100||0,v=$("#finalPay"),u=((w+x-t-s)/100).toFixed(2);if(Fai.top._lcid!=2052&&Fai.top._lcid!=1028){v.text(Fai.formatPriceEn(u))}else{v.text(u)}}function r(){var t=$(".mallShipSelect").find("option:selected");shippingMoneytext=$(".shippingPay"),culshippingMoneyVal=$("#shippingMoneyVal"),price=parseFloat(t.attr("price")).toFixed(2);if(Fai.top._lcid!=2052&&Fai.top._lcid!=1028){shippingMoneytext.text(Fai.formatPriceEn(price)).attr("_shipmoney",price);culshippingMoneyVal.text(Fai.formatPriceEn(price)).attr("_shipmoney",price)}else{shippingMoneytext.text(price).attr("_shipmoney",price);culshippingMoneyVal.text(price).attr("_shipmoney",price)}if($("#mallShipTemplate_province").length>0){var s=$(".mallShipSelect option:selected");s.attr("provinceCode",$.trim($("#mallShipTemplate_areaBoxInput").attr("area1")));s.attr("cityCode",$.trim($("#mallShipTemplate_areaBoxInput").attr("area2")));s.attr("countyCode",$.trim($("#mallShipTemplate_areaBoxInput").attr("area3")));s.attr("streetCode",$.trim($("#mallShipTemplate_areaBoxInput").attr("area4")))}p()}m.initModuleMallShipTemplateNew=function(L,M,t,O,C,u,s,G,v){var z=O.vType||1,H=O.sco||0,w=O.openItemList;var F="-----------",K=[],A,N,E,I,P,D,J;var y=true;site_cityUtil.initProvinces(G);var B="";B+="<div class='spaceLine'></div>";$.each(site_cityUtil.getAreaGroupsPinYin(),function(Q,R){B+="<div class='pv_group' style='"+(R[0]=="OS"?"display:none;":"")+"'>";B+="<div class='group_head'>"+R[0]+"</div>";B+="<div class='group_content'>";$.each(R[1],function(T,S){if(G==2052||G==1028){B+="<div class='group_item' pid='"+S+"' pname='"+site_cityUtil.getInfo(S).name+"'>"+site_cityUtil.simpleProvinceNameStr(site_cityUtil.getInfo(S).name)+"</div>"}else{B+="<div class='group_item' pid='"+S+"' pname='"+site_cityUtil.getInfoEn(S).name+"'>"+site_cityUtil.simpleProvinceNameStrEn(site_cityUtil.getInfoEn(S).name)+"</div>"}});B+="</div>";B+="</div>";B+="<div class='spaceLine'></div>"});$("#mallShipTemplate_areaBox1 .pv_content").html("").append(B);$(document).unbind("click.forAreaBox2").bind("click.forAreaBox2",function(){$("#mallShipTemplate_areaBox1").hide();$("#mallShipTemplate_areaBox2").hide()});$("#mallShipTemplate_areaBox1,#mallShipTemplate_areaBox2").unbind("click.forAreaBox").bind("click.forAreaBox",function(Q){x(Q)});function x(Q){if(Q.stopPropagation){Q.stopPropagation()}else{Q.cancelBubble=true}}$("#mallShipTemplate_allArea").change(function(){if($("#mallShipTemplate_allArea").val()==null||$("#mallShipTemplate_allArea").val()==""||$("#mallShipTemplate_allArea").val()=="os"){$("#mallShipTemplate_areaBoxInput").hide();$("#mallShipTemplate_areaBox1").hide();$("#mallShipTemplate_areaBox2").hide()}else{$("#mallShipTemplate_areaBoxInput").show()}if($("#mallShipTemplate_allArea").val()==null||$("#mallShipTemplate_allArea").val()==""){return}$("#mallShipTemplate_areaBoxInput").attr("isCn",0);$("#mallShipTemplate_areaBoxInput").attr("isCus",0);$("#mallShipTemplate_areaBoxInput").attr("isOs",0);$("#mallShipTemplate_areaBoxInput").attr("area1","");$("#mallShipTemplate_areaBoxInput").attr("area2","");$("#mallShipTemplate_areaBoxInput").attr("area3","");if($("#mallShipTemplate_allArea").val()=="cn"){$("#mallShipTemplate_areaBoxInput").attr("isCn",1);$("#mallShipTemplate_areaBox1 .pv").click();$("#mallShipTemplate_areaBox1 .city_content").remove();$("#mallShipTemplate_areaBox1 .county_content").remove();$("#mallShipTemplate_areaBox1 .street_content").remove();$("#mallShipTemplate_areaBoxInput").val("")}else{if($("#mallShipTemplate_allArea").val()=="os"){$("#mallShipTemplate_areaBoxInput").attr("isOs",1);$("#mallShipTemplate_areaBoxInput").attr("area1",990000);$("#mallShipTemplate_areaBoxInput").attr("area2",990100);$("#mallShipTemplate_areaBoxInput").val($("#mallShipTemplate_areaBox1").find(".group_item[pid='990000']").text());r()}else{$("#mallShipTemplate_areaBoxInput").attr("isCus",1);$("#mallShipTemplate_areaBoxInput").attr("area1",$("#mallShipTemplate_allArea").val());$("#mallShipTemplate_areaBox2 .sec_content").html("");$("#mallShipTemplate_areaBox2 .thd_content").html("");$("#mallShipTemplate_areaBoxInput").val("")}}if($("#mallShipTemplate_allArea").val()=="cn"||$("#mallShipTemplate_allArea").val()=="os"){return}var Q=a($("#mallShipTemplate_allArea").val());$("#mallShipTemplate_sec_box .sec_content").append(Q);$("#mallShipTemplate_areaBoxInput").val($("#mallShipTemplate_areaBoxInput").val()+$("#mallShipTemplate_allArea option[value='"+$("#mallShipTemplate_allArea").val()+"']").text());var R=$("#mallShipTemplate_allArea").val();y=false;if(M===0&&v){r();return}$.each(w,function(T,V){if(H){var U=false,S=O.scrl||[];$.each(S,function(X,W){if(W.st===V.type){var Y=false;if(y){Y=$.inArray(parseInt(R),W.arl)>-1}else{Y=$.inArray(parseInt(R),W.carl)>-1}if(Y){if(W.fc===1){if(z===1){if(M>=W.d1){U=true;return false}}else{if(M<=W.d1){U=true;return false}}}if(W.fc===2){if(t>=W.d2){U=true;return false}}if(W.fc===3){if(z===1){if(M>=W.d1&&t>=W.d2){U=true;return false}}else{if(M<=W.d1&&t>=W.d2){U=true;return false}}}if(W.fc===4){if(z===1){if(M>=W.d1||t>=W.d2){U=true;return false}}else{if(M<=W.d1||t>=W.d2){U=true;return false}}}}}});if(U){$("#template_item_"+V.type).attr("price",0);return}}if(!V.regionList||V.regionList.length<=0){$("#template_item_"+V.type).attr("price",V.defaultPrice.toFixed(1));return true}$.each(V.regionList,function(ac,af){var X=false;if(y){X=$.inArray(parseInt(R),af.areaList)<0}else{X=$.inArray(parseInt(R),af.cusAreaList)<0}if(X){$("#template_item_"+V.type).attr("price",V.defaultPrice.toFixed(1));return true}var ab=0,Y=af.price,ad=af.rha==null?1:af.rha,ae=af.ria==null?1:af.ria,Z=af.rip||0;var aa=M;if(ad>0){ab=Y;aa-=ad}if(ae>0&&aa>0){var W=(aa/ae).toFixed(1);W=Math.ceil(W);ab+=Z*W}$("#template_item_"+V.type).attr("price",ab.toFixed(1));return false})});r()});$("#mallShipTemplate_areaBoxInput").unbind("click").bind("click",function(Q){if($("#mallShipTemplate_allArea").val()=="cn"){$("#mallShipTemplate_areaBox1").toggle();$("#mallShipTemplate_areaBox2").hide();$("#mallShipTemplate_province_box").show();$("#mallShipTemplate_city_box").hide();$("#mallShipTemplate_county_box").hide();$("#mallShipTemplate_street_box").hide()}else{if($("#mallShipTemplate_allArea").val()==null||$("#mallShipTemplate_allArea").val()=="os"){}else{$("#mallShipTemplate_areaBox2").toggle();$("#mallShipTemplate_areaBox1").hide();$("#mallShipTemplate_sec_box").show();$("#mallShipTemplate_thd_box").hide()}}x(Q)});$("#mallShipTemplate_areaBox1 .J_areaHead .pv").click(function(){$("#mallShipTemplate_province_box").show();$("#mallShipTemplate_city_box").hide();$("#mallShipTemplate_county_box").hide();$("#mallShipTemplate_street_box").hide()});$("#mallShipTemplate_areaBox1 .J_areaHead .city").click(function(){$("#mallShipTemplate_province_box").hide();$("#mallShipTemplate_city_box").show();$("#mallShipTemplate_county_box").hide();$("#mallShipTemplate_street_box").hide()});$("#mallShipTemplate_areaBox1 .J_areaHead .county").click(function(){$("#mallShipTemplate_province_box").hide();$("#mallShipTemplate_city_box").hide();$("#mallShipTemplate_street_box").hide();$("#mallShipTemplate_county_box").show()});$("#mallShipTemplate_areaBox1 .J_areaHead .street").click(function(){$("#mallShipTemplate_province_box").hide();$("#mallShipTemplate_city_box").hide();$("#mallShipTemplate_street_box").show();$("#mallShipTemplate_county_box").hide()});$("#mallShipTemplate_areaBox2 .J_areaHead2 .sec").click(function(){$("#mallShipTemplate_sec_box").show();$("#mallShipTemplate_thd_box").hide()});$("#mallShipTemplate_areaBox2 .J_areaHead2 .thd").click(function(){$("#mallShipTemplate_sec_box").hide();$("#mallShipTemplate_thd_box").show()});$("#mallShipTemplate_province_box .group_item").bind("click",function(){$("#mallShipTemplate_areaBox1 .city_content").remove();$("#mallShipTemplate_areaBox1 .county_content").remove();$("#mallShipTemplate_areaBox1 .street_content").remove();var Q=$(this).attr("pname");var R=$(this).attr("pid");$("#mallShipTemplate_areaBox1 .J_areaHead .city").click();$("#mallShipTemplate_areaBoxInput").val("");$("#mallShipTemplate_areaBoxInput").val($("#mallShipTemplate_areaBoxInput").val()+Q);$("#mallShipTemplate_areaBoxInput").removeAttr("lastArea");$("#mallShipTemplate_areaBoxInput").removeAttr("lastAreaType");$("#mallShipTemplate_areaBoxInput").attr("area1",R);$("#mallShipTemplate_areaBoxInput").attr("area2","");$("#mallShipTemplate_areaBoxInput").attr("area3","");$("#mallShipTemplate_areaBoxInput").attr("area4","");$("#mallShipTemplate_areaBox1 .city_content").remove();var T=i(site_cityUtil.getCities(R));var S=$(T).html();if(S===null||T===undefined||T===""){$("#areaBox1").hide()}$("#mallShipTemplate_city_box").append(T);$.each(w,function(U,V){$("#template_item_"+V.type).attr("price",V.defaultPrice.toFixed(1))});r()});$("#mallShipTemplate_city_box").delegate(".group_item","click",function(){if($("#mallShipTemplate_allArea").val()==""||$("#mallShipTemplate_allArea").val()=="cn"||$("#mallShipTemplate_allArea").val()=="os"){y=true}else{y=false}$("#mallShipTemplate_areaBox1 .county_content").remove();$("#mallShipTemplate_areaBox1 .street_content").remove();var Q=$(this).attr("cname");var S=$(this).attr("cid");$("#mallShipTemplate_areaBox1 .J_areaHead .county").click();var U=$("#mallShipTemplate_areaBoxInput").attr("lastArea");var R=$("#mallShipTemplate_areaBoxInput").attr("lastAreaType");if(R!=null&&R!=""){$("#mallShipTemplate_areaBoxInput").val($("#mallShipTemplate_areaBoxInput").val().substring(0,$("#mallShipTemplate_areaBoxInput").val().indexOf("-")))}$("#mallShipTemplate_areaBoxInput").val($("#mallShipTemplate_areaBoxInput").val()+"-"+Q);$("#mallShipTemplate_areaBoxInput").attr("lastArea","-"+Q);$("#mallShipTemplate_areaBoxInput").attr("lastAreaType","city");$("#mallShipTemplate_areaBoxInput").attr("area2",S);$("#mallShipTemplate_areaBoxInput").attr("area3","");$("#mallShipTemplate_areaBoxInput").attr("area4","");$("#mallShipTemplate_areaBox1 .county_content").remove();var T=f(site_cityUtil.getCounty(S));$("#mallShipTemplate_county_box").append(T);if(M===0&&v){r();return}$.each(w,function(W,Y){if(H){var X=false,V=O.scrl||[];$.each(V,function(aa,Z){if(Z.st===Y.type){var ab=false;if(y){ab=$.inArray(parseInt(S),Z.arl)>-1}else{ab=$.inArray(parseInt(S),Z.carl)>-1}if(ab){if(Z.fc===1){if(z===1){if(M>=Z.d1){X=true;return false}}else{if(M<=Z.d1){X=true;return false}}}if(Z.fc===2){if(t>=Z.d2){X=true;return false}}if(Z.fc===3){if(z===1){if(M>=Z.d1&&t>=Z.d2){X=true;return false}}else{if(M<=Z.d1&&t>=Z.d2){X=true;return false}}}if(Z.fc===4){if(z===1){if(M>=Z.d1||t>=Z.d2){X=true;return false}}else{if(M<=Z.d1||t>=Z.d2){X=true;return false}}}}}});if(X){$("#template_item_"+Y.type).attr("price",0);return}}if(!Y.regionList||Y.regionList.length<=0){$("#template_item_"+Y.type).attr("price",Y.defaultPrice.toFixed(1));return true}$.each(Y.regionList,function(af,ai){var aa=false;if(y){aa=$.inArray(parseInt(S),ai.areaList)<0}else{aa=$.inArray(parseInt(S),ai.cusAreaList)<0}if(aa){$("#template_item_"+Y.type).attr("price",Y.defaultPrice.toFixed(1));return true}var ae=0,ab=ai.price,ag=ai.rha==null?1:ai.rha,ah=ai.ria==null?1:ai.ria,ac=ai.rip||0;var ad=M;if(ag>0){ae=ab;ad-=ag}if(ah>0&&ad>0){var Z=(ad/ah).toFixed(1);Z=Math.ceil(Z);ae+=ac*Z}$("#template_item_"+Y.type).attr("price",ae.toFixed(1));return false})});r()});$("#mallShipTemplate_county_box").delegate(".group_item","click",function(){$("#mallShipTemplate_areaBox1 .street_content").remove();var R=$(this).attr("cname");var T=$(this).attr("cid");var V=$("#mallShipTemplate_areaBoxInput").attr("lastArea");var S=$("#mallShipTemplate_areaBoxInput").attr("lastAreaType");$("#mallShipTemplate_areaBox1 .J_areaHead .street").click();if(S!=null&&(S=="street"||S=="county")){$("#mallShipTemplate_areaBoxInput").val($("#mallShipTemplate_areaBoxInput").val().substring(0,$("#mallShipTemplate_areaBoxInput").val().indexOf("-",$("#mallShipTemplate_areaBoxInput").val().indexOf("-")+1)))}$("#mallShipTemplate_areaBoxInput").val($("#mallShipTemplate_areaBoxInput").val()+"-"+R);$("#mallShipTemplate_areaBoxInput").attr("lastArea","-"+R);$("#mallShipTemplate_areaBoxInput").attr("lastAreaType","county");$("#mallShipTemplate_areaBoxInput").attr("area3",T);$("#mallShipTemplate_areaBoxInput").attr("area4","");var Q=j(site_cityUtil.getStreet(T));var U=$(Q).html();if(U===null||U===undefined||U===""){$("#mallShipTemplate_areaBox1").hide()}$("#mallShipTemplate_street_box").append(Q);r()});$("#mallShipTemplate_street_box").delegate(".group_item","click",function(){var Q=$(this).attr("cname");var S=$(this).attr("cid");var T=$("#mallShipTemplate_areaBoxInput").attr("lastArea");var R=$("#mallShipTemplate_areaBoxInput").attr("lastAreaType");$("#mallShipTemplate_areaBox1 .J_areaHead .street").click();if(R!=null&&R=="street"){$("#mallShipTemplate_areaBoxInput").val($("#mallShipTemplate_areaBoxInput").val().replace(T,""))}$("#mallShipTemplate_areaBoxInput").val($("#mallShipTemplate_areaBoxInput").val()+"-"+Q);$("#mallShipTemplate_areaBoxInput").attr("lastArea","-"+Q);$("#mallShipTemplate_areaBoxInput").attr("lastAreaType","street");$("#mallShipTemplate_areaBoxInput").attr("area4",S);$("#mallShipTemplate_areaBox1").hide();r()});$("#mallShipTemplate_sec_box").delegate(".group_item","click",function(){if($("#mallShipTemplate_allArea").val()==""||$("#mallShipTemplate_allArea").val()=="cn"||$("#mallShipTemplate_allArea").val()=="os"){y=true}else{y=false}$("#mallShipTemplate_areaBox2 .thd_content").html("");var Q=$(this).attr("cname");var S=$(this).attr("cid");$("#mallShipTemplate_areaBox2 .J_areaHead2 .thd").click();var U=$("#mallShipTemplate_areaBoxInput").attr("lastArea");var R=$("#mallShipTemplate_areaBoxInput").attr("lastAreaType");if(R!=null&&R!=""&&$("#mallShipTemplate_areaBoxInput").val().indexOf("-")!=-1){$("#mallShipTemplate_areaBoxInput").val($("#mallShipTemplate_areaBoxInput").val().substring(0,$("#mallShipTemplate_areaBoxInput").val().indexOf("-")))}$("#mallShipTemplate_areaBoxInput").val($("#mallShipTemplate_areaBoxInput").val()+"-"+Q);$("#mallShipTemplate_areaBoxInput").attr("lastArea","-"+Q);$("#mallShipTemplate_areaBoxInput").attr("lastAreaType","sec");$("#mallShipTemplate_areaBoxInput").attr("area2",S);$("#mallShipTemplate_areaBoxInput").attr("area3","");var T=a(S);$("#mallShipTemplate_thd_box .thd_content").append(T);if(M===0&&v){r();return}$.each(w,function(W,Y){if(H){var X=false,V=O.scrl||[];$.each(V,function(aa,Z){if(Z.st===Y.type){var ab=false;if(y){ab=$.inArray(parseInt(S),Z.arl)>-1}else{ab=$.inArray(parseInt(S),Z.carl)>-1}if(ab){if(Z.fc===1){if(z===1){if(M>=Z.d1){X=true;return false}}else{if(M<=Z.d1){X=true;return false}}}if(Z.fc===2){if(t>=Z.d2){X=true;return false}}if(Z.fc===3){if(z===1){if(M>=Z.d1&&t>=Z.d2){X=true;return false}}else{if(M<=Z.d1&&t>=Z.d2){X=true;return false}}}if(Z.fc===4){if(z===1){if(M>=Z.d1||t>=Z.d2){X=true;return false}}else{if(M<=Z.d1||t>=Z.d2){X=true;return false}}}}}});if(X){$("#template_item_"+Y.type).attr("price",0);return}}if(!Y.regionList||Y.regionList.length<=0){$("#template_item_"+Y.type).attr("price",Y.defaultPrice.toFixed(1));return true}$.each(Y.regionList,function(af,ai){var aa=false;if(y){aa=$.inArray(parseInt(S),ai.areaList)<0}else{aa=$.inArray(parseInt(S),ai.cusAreaList)<0}if(aa){$("#template_item_"+Y.type).attr("price",Y.defaultPrice.toFixed(1));return true}var ae=0,ab=ai.price,ag=ai.rha==null?1:ai.rha,ah=ai.ria==null?1:ai.ria,ac=ai.rip||0;var ad=M;if(ag>0){ae=ab;ad-=ag}if(ah>0&&ad>0){var Z=(ad/ah).toFixed(1);Z=Math.ceil(Z);ae+=ac*Z}$("#template_item_"+Y.type).attr("price",ae.toFixed(1));return false})});r()});$("#mallShipTemplate_thd_box").delegate(".group_item","click",function(){if($("#mallShipTemplate_allArea").val()==""||$("#mallShipTemplate_allArea").val()=="cn"||$("#mallShipTemplate_allArea").val()=="os"){y=true}else{y=false}var Q=$(this).attr("cname");var S=$(this).attr("cid");var T=$("#mallShipTemplate_areaBoxInput").attr("lastArea");var R=$("#mallShipTemplate_areaBoxInput").attr("lastAreaType");if(R!=null&&R=="thd"){$("#mallShipTemplate_areaBoxInput").val($("#mallShipTemplate_areaBoxInput").val().replace(T,""))}$("#mallShipTemplate_areaBoxInput").val($("#mallShipTemplate_areaBoxInput").val()+"-"+Q);$("#mallShipTemplate_areaBoxInput").attr("lastArea","-"+Q);$("#mallShipTemplate_areaBoxInput").attr("lastAreaType","thd");$("#mallShipTemplate_areaBoxInput").attr("area3",S);$("#mallShipTemplate_areaBox2").hide();if(M===0&&v){r();return}$.each(w,function(V,X){if(H){var W=false,U=O.scrl||[];$.each(U,function(Z,Y){if(Y.st===X.type){var aa=false;if(y){aa=$.inArray(parseInt(S),Y.arl)>-1}else{aa=$.inArray(parseInt(S),Y.carl)>-1}if(aa){if(Y.fc===1){if(z===1){if(M>=Y.d1){W=true;return false}}else{if(M<=Y.d1){W=true;return false}}}if(Y.fc===2){if(t>=Y.d2){W=true;return false}}if(Y.fc===3){if(z===1){if(M>=Y.d1&&t>=Y.d2){W=true;return false}}else{if(M<=Y.d1&&t>=Y.d2){W=true;return false}}}if(Y.fc===4){if(z===1){if(M>=Y.d1||t>=Y.d2){W=true;return false}}else{if(M<=Y.d1||t>=Y.d2){W=true;return false}}}}}});if(W){$("#template_item_"+X.type).attr("price",0);return}}if(!X.regionList||X.regionList.length<=0){$("#template_item_"+X.type).attr("price",X.defaultPrice.toFixed(1));return true}$.each(X.regionList,function(ae,ah){var Z=false;if(y){Z=$.inArray(parseInt(S),ah.areaList)<0}else{Z=$.inArray(parseInt(S),ah.cusAreaList)<0}if(Z){$("#template_item_"+X.type).attr("price",X.defaultPrice.toFixed(1));return true}var ad=0,aa=ah.price,af=ah.rha==null?1:ah.rha,ag=ah.ria==null?1:ah.ria,ab=ah.rip||0;var ac=M;if(af>0){ad=aa;ac-=af}if(ag>0&&ac>0){var Y=(ac/ag).toFixed(1);Y=Math.ceil(Y);ad+=ab*Y}$("#template_item_"+X.type).attr("price",ad.toFixed(1));return false})});r()});$("#template_item_"+u.type).click()};function n(y,z){var s=z[y]||(z[0]={}),u=Fai.top._lcid;if($("#mallShipTemplate_province").length<1){return}if(s.addr_info!=null){var w=s.addr_info["isCus"];if(!w){var x="";var v="";var t="";if(u==2052||u==1028){x=site_cityUtil.getInfo(s.addr_info.countyCode).name;v=site_cityUtil.getInfo(s.addr_info.cityCode).name;t=site_cityUtil.getInfo(s.addr_info.provinceCode).name}else{x=site_cityUtil.getInfoEn(s.addr_info.countyCode).name;v=site_cityUtil.getInfoEn(s.addr_info.cityCode).name;t=site_cityUtil.getInfoEn(s.addr_info.provinceCode).name}if(s.addr_info.provinceCode==990000){$("#mallShipTemplate_areaBoxInput").attr("isOs",1);$("#mallShipTemplate_allArea").val("os");$("#mallShipTemplate_allArea").change()}else{$("#mallShipTemplate_areaBoxInput").attr("isCn",1);$("#mallShipTemplate_allArea").val("cn");$("#mallShipTemplate_allArea").change()}$("#mallShipTemplate_areaBoxInput").attr("area1",s.addr_info.provinceCode);$("#mallShipTemplate_areaBoxInput").attr("area2",s.addr_info.cityCode);$("#mallShipTemplate_areaBoxInput").attr("area3",s.addr_info.countyCode);$("#mallShipTemplate_areaBoxInput").attr("area4",s.addr_info.streetCode);$("#mallShipTemplate_areaBoxInput").attr("lastArea","-"+x);$("#mallShipTemplate_areaBoxInput").attr("lastAreaType","county");setTimeout(function(){$("#mallShipTemplate_areaBox1 .group_item[pid='"+s.addr_info.provinceCode+"']").click();setTimeout(function(){$("#mallShipTemplate_areaBox1 .group_item[cid='"+s.addr_info.cityCode+"']").click();setTimeout(function(){$("#mallShipTemplate_areaBox1 .group_item[cid='"+s.addr_info.countyCode+"']").click();setTimeout(function(){$("#mallShipTemplate_areaBox1 .group_item[cid='"+s.addr_info.streetCode+"']").click()},0)},0)},0)},0);$("#streetAddress").val(s.addr_info.streetAddr)}else{setTimeout(function(){$("#mallShipTemplate_allArea").val(s.addr_info["provinceCode"]);$("#mallShipTemplate_allArea").change();setTimeout(function(){$("#mallShipTemplate_areaBox2 .group_item[cid='"+s.addr_info.cityCode+"']").click();setTimeout(function(){$("#mallShipTemplate_areaBox2 .group_item[cid='"+s.addr_info.countyCode+"']").click()},0)},0)},0);$("#streetAddress").val(s.addr_info.streetAddr)}}}function c(ah,af,ac,I,C){var T=$(".selectedMsg"),U=parseInt(T.attr("_item")),G=ac[U]||{},x=G.addr_info,L=Fai.top._lcid,N={},K={},ab="";var D,ai,w=false;var al=$(".J_noAddrMsgContent").length>0;site_cityUtil.initProvinces(L);if(al){if(ac!=null&&ac.length>0){$.each(ac,function(am,an){if(an.isDefault==1){G=an;return false}})}for(var ae=0;ae<C.length;ae++){var B=C[ae].fieldKey;var E=C[ae].name;var J=C[ae].required;var u=$(".J_noAddrMsgContent").find("#"+B);if(u.length==0){continue}var R=u.val()||"";if(J&&R.length==0){Fai.ing(LS.addrInfoInputError+E,1);return}if((B=="email"&&!Fai.isEmail(R)&&J)||(B=="phone"&&!Fai.isPhone(R)&&J)){Fai.ing(LS.addrInfoInputError+E,1);return}if(B=="mobile"){R=$.trim(R);if(R.length>0){if(!Fai.isNationMobile(R)){Fai.ing(LS.mobileNumRegular,1);return}G.mobileCt=$(".J_noAddrMsgContent").find("#mobileCt").val();ah.mobileCt=G.mobileCt}else{G.mobileCt=""}}G[B]=R;ah[B]=R}}else{for(var ae=0;ae<C.length;ae++){D=C[ae];ai=D.fieldKey;if(ai=="addr"){if(!x){ab=LS.mallStlSubmitAddrErr;return ab}K.isCus=x.isCus;K.provinceCode=parseInt(x.provinceCode);K.cityCode=parseInt(x.cityCode);K.countyCode=parseInt(x.countyCode);K.streetCode=parseInt(x.streetCode);K.streetAddr=x.streetAddr;if(isNaN(K.cityCode)){K.cityCode=-1}if(isNaN(K.countyCode)){K.countyCode=-1}if(isNaN(K.streetCode)){K.streetCode=-1}if(I){af.addr_info=K;af.addr=K.streetAddr;af.isDefault=1;af.name=x.name;af.email=x.email;af.phone=x.phone;af.zip=x.zip}ah.addr_info=K;ah.addr=K.streetAddr;ah.addr="";if(!K.isCus){if(site_cityUtil.isValidProvince(K.provinceCode)){if(L==2052||L==1028){ah.addr+=site_cityUtil.getInfo(K.provinceCode).name}else{ah.addr+=site_cityUtil.getInfoEn(K.provinceCode).name}}if(L==2052||L==1028){if(K.cityCode!=990100){ah.addr+=site_cityUtil.getInfo(K.cityCode).name}}else{ah.addr+=site_cityUtil.getInfoEn(K.cityCode).name}if(L==2052||L==1028){ah.addr+=site_cityUtil.getInfo(K.countyCode).name}else{ah.addr+=site_cityUtil.getInfoEn(K.countyCode).name}if(L==2052||L==1028){ah.addr+=site_cityUtil.getInfo(K.streetCode).name}else{ah.addr+=site_cityUtil.getInfoEn(K.streetCode).name}ah.addr+=K.streetAddr}else{ah.addr=G.addr}if(typeof K.provinceCode!="number"||typeof K.cityCode!="number"){ab=LS.mallStlSubmitAddrErr;return ab}if(typeof K.countyCode!="number"){delete K.countyCode}w=true;continue}if(ai=="mobile"){ah.mobileCt=G.mobileCt}ah[ai]=G[ai]}}if(!w&&$("#mallShipTemplate_province").length===1){if(!x){ab=LS.mallStlSubmitAddrErr;return ab}K.isCus=x.isCus;K.provinceCode=parseInt(x.provinceCode);K.cityCode=parseInt(x.cityCode);K.countyCode=parseInt(x.countyCode);K.streetCode=parseInt(x.streetCode);K.streetAddr=x.streetAddr;if(isNaN(K.cityCode)){K.cityCode=-1}if(isNaN(K.countyCode)){K.countyCode=-1}if(isNaN(K.streetCode)){K.streetCode=-1}if(I){af.addr_info=K;af.addr=K.streetAddr;af.isDefault=1;af.name=x.name;af.email=x.email;af.phone=x.phone;af.zip=x.zip}ah.addr_info=K;ah.addr=K.streetAddr;ah.addr="";if(!K.isCus){if(site_cityUtil.isValidProvince(K.provinceCode)){ah.addr+=site_cityUtil.getInfo(K.provinceCode).name}if(site_cityUtil.isValidCity(K.cityCode,K.provinceCode)){ah.addr+=site_cityUtil.getInfo(K.cityCode).name}ah.addr+=site_cityUtil.getInfo(K.countyCode).name;ah.addr+=site_cityUtil.getInfo(K.streetCode).name;ah.addr+=K.streetAddr}else{ah.addr=G.addr}if(typeof K.provinceCode!="number"||typeof K.cityCode!="number"){ab=LS.mallStlSubmitAddrErr;return ab}if(typeof K.countyCode!="number"){delete K.countyCode}}var z=$(".mallShipSelect"),aa=z.find("option:checked");if($("#mallShipTemplate_province").length===1&&aa.length===1){var M=K.provinceCode,Z=K.cityCode,P=K.countyCode,H=K.streetCode,X=$.trim(K.streetAddr);if(!K.isCus){if(!M||isNaN(M)||!site_cityUtil.isValidProvince(M)){ab=LS.mallStlSubmitAddrErr;return ab}if(!Z||isNaN(Z)||!site_cityUtil.isValidCity(Z,M)){ab=LS.mallStlSubmitAddrErr;return ab}}else{if(!M||isNaN(M)){ab=LS.mallStlSubmitAddrErr;return ab}if(!Z||isNaN(Z)){ab=LS.mallStlSubmitAddrErr;return ab}}if(isNaN(M)){M=-1}if(isNaN(Z)){Z=-1}if(isNaN(P)){P=-1}if(isNaN(H)){H=-1}var F={type:parseInt(aa.attr("value")),templateId:parseInt(aa.attr("templateId")),streetAddr:X};F.provinceCode=M;F.cityCode=Z;F.countyCode=P;F.streetCode=H;F.isCus=K.isCus;ah.shipType=F}else{if(aa.length===1){ah.shipType=parseInt(aa.attr("value"))}}var v=$(".payChecked");if(v.length==1){ah.payMode=parseInt(v.attr("_paymode"))}var W=$(".msgforSeller");if(W.length>0){var ag=Fai.decodeHtml(W.val());var Y=parseInt(W.attr("maxlength"));if(ag.length>Y){ag=ag.substring(0,Y)}var O=W.attr("plcaeholder");if(ag!==O){ah.msg=ag}else{ah.msg=""}}else{ah.msg=""}var s=$("#useItg"),S=$("#integralCheckBox");if(S.length>0&&S.prop("checked")){var ak=s.val();if(Fai.isInteger(ak)){var Q=parseInt(s.attr("_maxUse")),ad=parseInt(s.attr("_currentitg")),t=s.attr("_itgname");if(ak>ad){ab=Fai.format(LS.integral_notOverCurrent,Fai.encodeHtml(t),Fai.encodeHtml(t));return ab}if(ak>Q){ab=Fai.format(LS.integral_notOver,Fai.encodeHtml(t),Q);return ab}if(ak<0){ab=LS.integral_inputInteger;return ab}ah.useItg=parseInt(ak)}else{if(ak.length!=0){ab=LS.integral_inputInteger;return ab}}}if($("#presentItgShow").length>0){ah.presentItg=true}var A=$("#couponCheckBox"),V=$(".couponShowList"),aj;if(V.length>0&&parseInt(V.val())!=-1){aj=V.find("option:selected");var y=aj.attr("data_id");ah.cdId=Number(y)}return ab}function q(w,G,z,y,v,H,A,x,J,t){if(!J&&G==0){Fai.top.location.href=m.getHtmlUrl("mdetail");return}var K={},I={},w=Fai.top.$("#module"+w),D=w.find(".stlMsg");var C=c(K,I,x,H,t);if(C!=""){D.show();D.html(C);m.scrollToDiv(w);return}var E=w.find(".mallStlOpt input");E.attr("disabled",true);D.show();D.html(LS.mallStlSubmitting);m.scrollToDiv(w);if(v!=0&&H){var s={},x=[];x.push(I);s.addrInfoList=x;$.ajax({type:"post",url:action="ajax/memberAdm_h.jsp?cmd=set&opera=addAddr&id="+v,data:"info="+Fai.encodeUrl($.toJSON(s)),success:function(L){},error:function(){}})}if(K.payMode==5){var F=K.name;var B=new RegExp("[\\u4E00-\\u9FFF]+","g");if(F){if(F.length<2){if(!B.test(F)){D.hide();m.scrollToDiv(w);Fai.ing(LS.orderValidRecvName);E.attr("disabled",false);return}}}else{if(v!=0&&A){var u="";if(A.length<2){if(!B.test(F)){u="会员"}}K.name=u+A}else{K.name="游客"}}}if(J){$.ajax({type:"post",url:"ajax/order_h.jsp?cmd=settle&imme",data:"data="+Fai.encodeUrl($.toJSON(K)),error:function(){E.removeAttr("disabled");D.html(LS.mallStlSubmitError)},success:function(L){E.removeAttr("disabled");var L=jQuery.parseJSON(L);if(L.success){Fai.top.location.href=m.getHtmlUrl("mdetail")+"?id="+L.oid+"#firstSubmit"}else{if(L.rt==-3){D.html(LS.mallStlSubmitNotFound)}else{if(L.rt==-9){D.html(LS.mallStlSubmitStatusError)}else{if(L.rt==m.MallAjaxErrno.outOfMallAmount){D.html(Fai.format(LS.mallAmountOverNameList,L.productsName))}else{if(L.rt==m.MallAjaxErrno.notAdded){D.hide();var M=["<div class='fk-order-tip formBox' style='width:235px; height:78px; padding:0 0;background-color:#FFF;'>","<div class='J-close formXSite' style='margin-top:3px;'></div>","<div class='t-txt' style='margin-top:30px; text-align:center;'>"+LS.mallProductNotAdded+"</div>","<div>"];tip=$(M.join(""));w.prepend(tip);tip.find(".J-close").click(function(){tip.remove()});tip.css({top:20,left:(w.width()-tip.width())/2})}else{D.html(LS.mallStlSubmitError)}}}}}}})}else{$.ajax({type:"post",url:"ajax/order_h.jsp?cmd=delItem&orderId="+G,data:"itemIds="+Fai.encodeUrl($.toJSON(z)),error:function(){E.removeAttr("disabled");D.html(LS.mallStlSubmitError)},success:function(){$.ajax({type:"post",url:"ajax/order_h.jsp?cmd=settle&orderId="+G,data:"data="+Fai.encodeUrl($.toJSON(K)),error:function(){E.removeAttr("disabled");D.html(LS.mallStlSubmitError)},success:function(L){E.removeAttr("disabled");var L=jQuery.parseJSON(L);if(L.success){$.ajax({type:"post",url:"ajax/order_h.jsp?cmd=addAfterShop",data:"data="+Fai.encodeUrl($.toJSON(y)),error:function(){E.removeAttr("disabled");D.html(LS.mallStlSubmitError)},success:function(N){Fai.top.location.href=m.getHtmlUrl("mdetail")+"?id="+G+"#firstSubmit"}})}else{if(L.rt==-3){D.html(LS.mallStlSubmitNotFound)}else{if(L.rt==-9){D.html(LS.mallStlSubmitStatusError)}else{if(L.rt==m.MallAjaxErrno.outOfMallAmount){D.html(Fai.format(LS.mallAmountOverNameList,L.productsName))}else{if(L.rt==m.MallAjaxErrno.OutOfAllowAmount){D.html(Fai.format(LS.allowAmountOverNameList,L.productsName))}else{if(L.rt==m.MallAjaxErrno.couponOverTime){D.html(LS.couponOverTime)}else{if(L.rt==m.MallAjaxErrno.couponUnavail){D.html(LS.couponUnavail)}else{if(L.rt==m.MallAjaxErrno.couponNotFound){D.html(LS.couponNotFound)}else{if(L.rt==m.MallAjaxErrno.notAdded){D.hide();var M=["<div class='fk-order-tip formBox' style='width:235px; height:78px; padding:0 0;background-color:#FFF;'>","<div class='J-close formXSite' style='margin-top:3px;'></div>","<div class='t-txt' style='margin-top:30px; text-align:center;'>"+LS.mallProductNotAdded+"</div>","<div>"];tip=$(M.join(""));w.prepend(tip);tip.find(".J-close").click(function(){tip.remove()});tip.css({top:20,left:(w.width()-tip.width())/2})}else{D.html(LS.mallStlSubmitError)}}}}}}}}}}})}})}}$(".J_guaranteeName").hover(function(){var t=$(this).offset().top+30;var v=$(this).offset().left+4;var u=$(this).attr("_explain");if(!Fai.isNull(u)&&u!=""){var s="<div class='J_explain tipsPanel' style='top: "+t+"px;left: "+v+"px;'>";s+="<div class='panelTriOut'>";s+="<div class='panelTriIn'></div>";s+="</div>";s+=Fai.encodeHtml(u);s+="</div>";$("body").append(s)}},function(){$(".J_explain").remove()})})(Site);Site.placeholder=function(b){var a="placeholder" in document.createElement("input");if(!a){b.each(function(g,c){var f=$(this),d=f.attr("placeholder"),j=f.position(),e=f.outerHeight(true),k=f.outerWidth(true),m=f.css("padding-left"),l=f.css("padding-top"),i=$("<span class='J_wrap-placeholder'></span>").text(d).css({display:"inline-block",height:e,"line-height":e+"px",position:"absolute",left:j.left,top:j.top,paddingLeft:8,paddingTop:l,color:"#aaa"});i.appendTo(f.parent());f.on("focusin keyup",function(){f.val()!=""?i.hide():i.show()});i.on("click",function(){f.focus()});f.siblings(".fk_lowIEPlaceholderStyle").remove()})}};Site.mCartsaleItemCk=function(e){var input=$(e).prev();if(input.prop("checked")){input.prop("checked",false)}else{input.prop("checked",true)}eval($(e).prev().attr("onclick"))};Site.setCheckBoxToFalgDiv=function(b){if(b.find(".J_mallCart").hasClass("mallCartNew")){var a=b.find(".mCartCheckDiv");a.each(function(){var c=$(this).prev();if(c.prop("checked")){$(this).addClass("itemLabelChecked mCart_checked")}else{$(this).removeClass("itemLabelChecked mCart_checked")}})}};Site.initOrderList=function(d){var b=$("#module"+d);var a=b.find(".J_showMorePd");a.unbind("click").on("click.showOrderItem",function(){var f=$(this).attr("_oid");var e=$(this).parent().siblings("#hidePdItem"+f);if($(this).hasClass("J_showing")){e.slideUp();$(this).removeClass("J_showing").addClass("J_hidden")}else{e.slideDown();$(this).addClass("J_showing").removeClass("J_hidden")}e.css("zoom",1)});var c=b.find(".J_pdName");c.hover(function(){$(this).addClass("g_selected")},function(){$(this).removeClass("g_selected")})};Site.refundImgUpload=function(c,e){var d="*.jpg,*.jpeg,*.bmp,*.gif,*.png,*.ico".split(",");var a=5;var b={file_post_name:"Filedata",upload_url:"/ajax/commUpsiteimg_h.jsp",button_placeholder_id:c,file_size_limit:"5MB",button_image_type:3,file_queue_limit:a,button_width:"52px",button_height:"52px",button_cursor:SWFUpload.CURSOR.HAND,button_image_url:_resRoot+"/image/site/msgUpImg/add.png",requeue_on_error:false,post_params:{ctrl:"Filedata",app:21,type:0,fileUploadLimit:5,isSiteForm:true},file_types:d.join(";"),file_dialog_complete_handler:function(f){this._allSuccess=false;this.startUpload()},file_queue_error_handler:function(g,f,h){switch(f){case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:Fai.ing(LS.siteFormSubmitCheckFileSizeErr,true);break;case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:Fai.ing(LS.siteFormSubmitFileUploadNotAllow,true);break;case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED:Fai.ing(Fai.format(LS.siteFormSubmitFileUploadOneTimeNum,a),true);break;default:Fai.ing(LS.siteFormSubmitFileUploadReSelect,true);break}},upload_success_handler:function(g,f){var h=jQuery.parseJSON(f);this._allSuccess=h.success;this._sysResult=h.msg;if(h.success){Fai.ing(Fai.format(LS.siteFormSubmitFileUploadSucess,Fai.encodeHtml(g.name)),true);onFileUploadEvent("upload",h)}else{Fai.ing(LS.siteFormSubmitFileUploadFile+g.name+" "+h.msg)}},upload_error_handler:function(g,f,h){if(f==-280){Fai.ing(LS.siteFormSubmitFileUploadFileCancle,false)}else{if(f==-270){Fai.ing(Fai.format(LS.siteFormSubmitFileUploadFileExist,Fai.encodeHtml(g.name)),true)}else{Fai.ing(Fai.format(LS.siteFormSubmitFileUploadSvrBusy,Fai.encodeHtml(g.name)))}}},upload_complete_handler:function(g){if(g.filestatus==SWFUpload.FILE_STATUS.COMPLETE){if(a==null||typeof(a)=="undefined"){a=5}var h=$("#msgBoardAddImgTb").eq(0);var f=h.find("td").length;if(f>=(a+1)){Fai.ing(LS.siteFormSubmitFileUploadOfMax,true);var i=h.find("td").eq(h.find("td").length-1);i.css("display","none");return}setTimeout(function(){swfObj.startUpload()},swfObj.upload_delay)}else{if(g.filestatus==SWFUpload.FILE_STATUS.ERROR){Fai.ing(Fai.format(LS.siteFormSubmitFileUploadSvrBusy,Fai.encodeHtml(g.name)))}}},upload_start_handler:function(f){Fai.enablePopupWindowBtn(0,"save",false);Fai.ing(LS.siteFormSubmitFileUploadPrepare,false)},view_progress:function(f,i,h,g){Fai.ing(LS.siteFormSubmitFileUploadIng+g+"%",false)}};swfObj=SWFUploadCreator.create(b);onFileUploadEvent=function(n,k){if(n=="upload"){var h=k.id;var m=k.name;var j=k.size;var i=k.path;var o=k.pathSmall;var g=k.fileId;var f=k.width;var l=k.height;if(!!e&&(typeof e==="function")){e(h,m,i,j,g,o,f,l)}}}};Site.refundinit=function(a,e,d){$(".J_refundType").click(function(){$(".J_refundType").removeClass("refundSelected");$(this).addClass("refundSelected");if($(this).attr("_type")==1){$("#refundHasRecvGood").hide();$("#refundType").removeClass("shortRefund")}else{$("#refundHasRecvGood").show();$("#refundType").addClass("shortRefund")}});$(".J_uploadIconDiv").live("mouseover mouseout",function(f){if(f.type=="mouseover"){$(this).find(".J_closeIcon").show()}else{$(this).find(".J_closeIcon").hide()}});$(".J_closeIcon").live("click",function(){$(this).parent().remove();$("#refundUpload").show();$("#picNumCount").html($(".J_uploadIconDiv").length)});$("#refundArea").bind("propertychange input",function(){var g=$("#refundArea").val();var f=g.length;if(f<=200){$("#reasonWordNum").text(f);return}$("#refundArea").val(g.substring(0,200))});$("#refundPrice").numeric({negative:false});$("#refundPrice").bind("propertychange input",function(){var f=parseFloat($(this).val()),g=parseFloat($(this).attr("_max"));if(f>g){$("#refundPrice").val(g.toFixed(2))}});Site.refundImgUpload("refundImgSWFUpload",b);function b(i,o,l,m,g,p,f,h){var j="",n="";if(f>h){n="width: 50px;"}else{n="height: 50px;"}j+="<div class='J_uploadIconDiv uploadIconDiv' _tmpFileId='"+i+"' _fileSize='"+m+"' _fileName='"+Fai.encodeHtmlJs(o)+"' _fileId='"+g+"'>";j+="<img src='"+p+"' class='uploadImg' style='"+n+" vertical-align: middle;'/>";j+="<div class='closeIcon J_closeIcon'></div>";j+="</div>";$("#refundUploadList").prepend(j);var k=$(".J_uploadIconDiv").length;$("#picNumCount").html(k);if(k==5){$("#refundUpload").hide()}}var c=false;$("#noRefundCommit").click(function(){if(c){return}var j=$("#refundTypeContent").find(".refundSelected");var p=0;if(j.length==1){p=parseInt(j.attr("_type"))}var l=$("#refundPrice");var m=parseFloat(l.val());if(!m){Fai.ing(LS.refundPriceErr,true);return}var g=parseFloat(l.attr("_max"));if(!g||m>g){Fai.ing(LS.refundPriceTooMuchErr,true);return}var n=$.trim($("#refundPhone").val());if(!n){Fai.ing(LS.refundNeedPhone,true);return}var h=$.trim($("#refundArea").val());if(!h){Fai.ing(LS.refundEnterReason,true);return}if(h.length>200){Fai.ing(LS.refundReasonTooLong,true);return}c=true;var k={};var f=$("#refundHasRecvGood");if(f.length==1&&f.is(":visible")){if($("#recv").attr("checked")){k.hasRecvGood=true}else{k.hasRecvGood=false}}k.refundPrice=m;k.refundType=p;k.refundPhone=n;k.refundReason=h;var i=$(".J_uploadIconDiv");if(i.length>0){var o=[];$.each(i,function(r,v){var q=$(v);var s=q.attr("_fileId");if(!s){return true}var t={};t.ii=s;var u=q.attr("_tmpFileId");if(u){t["in"]=q.attr("_fileName");t.tfi=u;t.is=q.attr("_fileSize")}o.push(t)});if(o.length>0){k.refundImgList=o}}$.ajax({type:"post",url:"ajax/order_h.jsp?cmd=setOrderNoRefund&orderId="+a+"&itemId="+e+"&nowStatus="+d,data:"refundInfo="+Fai.encodeUrl($.toJSON(k)),error:function(){c=false;Fai.ing("系统繁忙,请稍后重试。")},success:function(q){var q=$.parseJSON(q);if(q.success){window.location.reload()}else{Fai.ing(q.msg,true);c=false}}})});$("#sendFlowCommit").click(function(){if(c){return}var g=$.trim($("#refundFlowCom").val());if(!g){Fai.ing(LS.refundEnterFlowName,true);return}if(g.length>30){Fai.ing(LS.refundFlowNameTooLong,true);return}var i=$.trim($("#refundFlowID").val());if(!i){Fai.ing(LS.refundEnterFlowCode,true);return}if(i.length>30){Fai.ing(LS.refundFlowCodeTooLong,true);return}var f=$.trim($("#refundPhone").val());if(!f){Fai.ing(LS.refundNeedPhone,true);return}if(f.length>30){Fai.ing(LS.refundPhoneTooLong,true);return}var l=$.trim($("#refundArea").val());if(l.length>200){Fai.ing(LS.refundFlowDetailTooLong,true);return}c=true;var k={company:g,flowId:i,phone:f,refundArea:l};var j=$(".J_uploadIconDiv");if(j.length>0){var h=[];$.each(j,function(o,s){var m=$(s);var p=$(s).attr("_fileId");if(!p){return true}var q={};q.ii=p;var r=m.attr("_tmpFileId");if(r){q["in"]=m.attr("_fileName");q.tfi=r;q.is=m.attr("_fileSize")}h.push(q)});if(h.length>0){k.flowImgList=h}}$.ajax({type:"post",url:"ajax/order_h.jsp?cmd=setRefundFlow&orderId="+a+"&itemId="+e+"&nowStatus="+d,data:"flowInfo="+Fai.encodeUrl($.toJSON(k)),error:function(){c=false;Fai.ing("系统繁忙,请稍后重试。")},success:function(m){var m=$.parseJSON(m);if(m.success){window.location.reload()}else{Fai.ing(m.msg,true);c=false}}})})};Site.printRemarkRefund=function(a,d,b){$("#createRefundRemark").click(function(){var f="";f+="<div class='remarkContent'>";f+="<textarea id='remarkInputArea' class='remarkInputArea' maxlength='200' placeholder='最多输入200字'></textarea>";f+="</div>";f+="<div class='remarkSubmit' id='remarkSubmit'>"+LS.refundSubmit+"</div>";var i="<div class='refundRemarkTitle'>"+LS.refundWantReamrk+"</div>";var h=parseInt(Math.random()*10000);var e={boxId:h,title:i,htmlContent:f,width:580,boxName:"remarkInfo",extClass:"refundRemarkPopup"};var g=Site.popupBox(e);$("#remarkInputArea").focus()});var c=false;$("#remarkSubmit").live("click.refundRemark",function(){if(c){return}var e=$("#remarkInputArea").val();if($.trim(e).length==0){Fai.ing(LS.refundRemarkNotEmpty);return}if(e.length>200){Fai.ing(LS.refundRemarkTooLong);return}c=true;Fai.ing(LS.refundRemarkSubmiting);$.ajax({type:"post",url:"ajax/order_h.jsp?cmd=setRefundRemark",data:"orderId="+a+"&speaker=1&itemId="+d+"&remark="+Fai.encodeUrl(e),error:function(){c=false;Fai.ing("系统繁忙,请稍后重试。")},success:function(g){var g=$.parseJSON(g);if(g.success){Fai.ing(LS.refundRemarkSuccess,true);$(".refundRemarkPopup").find(".popupBClose").click();var f=$.format.date(new Date(g.remarkTime),"yyyy-MM-dd HH:mm:ss");var h="";h+="<div class='recordContent'>";h+="<div class='recordLine'>";h+="<div class='recordSenderIcon memberIcon'></div>";h+="<div class='recordSender'>"+b+"</div>";h+="<div class='recordTime'>"+f+"</div>";h+="</div>";h+="<div class='recordDetail'>";h+="<table class='recordDetailTable'>";h+="<tr class='recordDetailLine'>";h+="<td class='recordDetailCusTd' colspan='2'>";h+=Fai.encodeHtml(e);h+="</td>";h+="</tr>";h+="</table>";h+="<div class='triangleIco'>◆</div>";h+="</div>";h+="</div>";$("#refundRemarkTitle").after(h)}else{Fai.ing(g.msg,true)}c=false}})})};Site.refundPanelEvent=function(a,c,b){$("#closeRefund").click(function(){var e="";e+="<div class='refundCloseTips'>"+LS.refundCancelTip+"</div>";e+="<div class='refundCloseSubmit' id='closeRefundBtn'>"+LS.refundSure+"</div>";var g=parseInt(Math.random()*10000);var d={boxId:g,title:"",htmlContent:e,width:358,boxName:"closeRefundInfo",extClass:"closeRefundPopup"};var f=Site.popupBox(d)});$("#closeRefundBtn").live("click.closeRefund",function(){$.ajax({type:"post",url:"ajax/order_h.jsp?cmd=setRefundStatus&type=del&nowStatus="+b,data:"orderId="+a+"&itemId="+c,error:function(){isSave=false;Fai.ing("系统繁忙,请稍后重试。")},success:function(d){var d=$.parseJSON(d);if(d.success){window.location.reload()}else{Fai.ing(d.msg,true);isSave=false}}})});$("#editRefund").click(function(){$.ajax({type:"post",url:"ajax/order_h.jsp?cmd=setRefundStatus&type=edit&nowStatus="+b,data:"orderId="+a+"&itemId="+c,error:function(){isSave=false;Fai.ing("系统繁忙,请稍后重试。")},success:function(d){var d=$.parseJSON(d);if(d.success){window.location.reload()}else{Fai.ing(d.msg,true);isSave=false}}})});$("#editFlow").click(function(){$.ajax({type:"post",url:"ajax/order_h.jsp?cmd=setRefundStatus&type=editFlow&nowStatus="+b,data:"orderId="+a+"&itemId="+c,error:function(){isSave=false;Fai.ing("系统繁忙,请稍后重试。")},success:function(d){var d=$.parseJSON(d);if(d.success){window.location.reload()}else{Fai.ing(d.msg,true);isSave=false}}})})};Site.remarkImgEvent=function(){$(".J_refundPic").click(function(){var c=$(this),f=c.parent();var b=f.find(".J_refundPic");var e=[],g=-1,d=c.attr("bigImg");$.each(b,function(j,k){var h=$(k).attr("bigImg");if(h){e.push(h);if(h==d){g=j}}});if(g<0){return}b.hide();f.data("imgList",e);f.data("index",g);var a="";a+="<div class='picImgViewer J_imgViewer'>";if(b.length>1){a+="<div>";a+="<div class='picPage left J_page'></div>";a+="<div class='picPage right J_page'></div>";a+="</div>"}a+="<span class='closeIcon J_close'></span>";a+="<table cellpadding='0' cellspacing='0' class='picTb'><tr><td>";a+="<img class='picImg J_img' src='"+e[g]+"'/>";a+="</td></tr></table>";a+="</div>";c.parent().append(a)});$(".J_refundPicContain .J_close").live("click",function(){var a=$(this).parents(".J_refundPicContain");a.find(".picImgViewer").remove();a.find(".J_refundPic").show()});$(".J_refundPicContain .J_page").live("click",function(){var a=$(this).parents(".J_refundPicContain");var c=a.data("imgList"),d=a.data("index"),b=c.length;if(b<=1){return}if($(this).hasClass("left")){d--}else{d++}if(d<0){d=b-1}if(d>=b){d=0}a.data("index",d);a.find(".J_img").attr("src",c[d])})};Site.showTopBar=function(){if(Fai.top.$("#arrow").hasClass("g_arrow_up")){Fai.top.$("#arrow").removeClass("g_arrow_up");Fai.top.$("#topBar").hide()}else{Fai.top.$("#arrow").addClass("g_arrow_up");Fai.top.$("#topBar").show()}Site.resetGmainPos()};Site.showOrHideMailBox=function(){$.ajax({url:"../ajax/mail_h.jsp?cmd=showOrHideMailBox",data:"",success:function(a){var b=$.parseJSON(a);if(b.success){var c=['<div id="mailInfo" title="进入企业邮箱" class="mailInfo" >','<a href="'+b.linkAdd+'" target="_blank" onclick="Site.logDog(100038, 14);">','<div class="mailIco"></div>',"</a>","</div>"];$(".J_beforeMailBox.line").after(c.join(""));$(".J_beforeMailBox.line").css("display","block")}},error:function(){Fai.ing("系统异常,请稍后重试",true)}})};Site.copyWebSite=function(){var b=Fai.top.location.href;var a=$.browser.msie;if(a){clipboardData.setData("Text",b)}else{prompt(LS.shareTips,b)}};Site.initModuleFileList=function(a,b){$("#module"+a+" .line table").mouseover(function(){$(this).addClass("g_hover")}).mouseleave(function(){$(this).removeClass("g_hover")});Site.initContentSplitLine(a,b)};Site.richMarquee=function(c){var t={direction:"up",speed:"normal",loop:"infinite",moveout:false,isScrolling:false};$.extend(t,c);if(t.speed=="normal"){$.extend(t,{speed:28})}else{if(t.speed=="slow"){$.extend(t,{speed:60})}else{$.extend(t,{speed:13})}}if(!t.id){return}if($("#module"+t.id).data("restart")){var j=t.id;Fai.top.$("#richmarqueeNewParent"+j).after($("#module"+t.id).data("content"));Fai.top.$("#richmarqueeNewParent"+j).remove()}if(!$("#module"+t.id).data("content")){var n=Fai.top.$(".formMiddleContent"+t.id).html();$("#module"+t.id).data("content",n)}if($("#module"+t.id).data("_intab")!==0){Fai.top["richMarqueeInTab"+t.id]=t}var j=t.id,r=$("#richMarquee"+j),f=r.outerHeight(true),d=r.outerWidth(true),i=(d>a())?d:a(),e=g(),i=e>i?e:i,x=t.direction,u=0,h="top",p=t.speed,v=(t.loop!="infinite"||t.loop<=0)?1:t.loop,l=t.moveout,y=t.isScrolling,w=20,s=$("<div id='richMarqueeCopy"+j+"' class='richMarquee' style='position:absolute; overflow:hidden; width:"+i+"px; height:"+r.height()+"px ' ></div>"),m=$("<div id='richmarqueeNewParent"+j+"' style='overflow:hidden;width:"+i*2+"'></div>");function o(){Fai.stopInterval("rm"+j);if($("#richmarqueeNewParent"+j).length<1){m.appendTo(r.parent());r.appendTo(m);s.appendTo(m);if(!y&&!l){}else{$(r.html()).appendTo(s)}}else{m=$("#richmarqueeNewParent"+j);r=$("#richMarquee"+j);s=$("richMarqueeCopy"+j)}if(x=="up"){u=f;h="top"}else{if(x=="down"){u=0-f;if(y&&!l){u=0}h="top"}else{if(x=="left"){u=f;h="left"}else{u=0-i;if(y&&!l){u=0}if(y&&l){u=-i}h="left"}}}if(l){r.css(h,0)}else{r.css(h,u)}if(x=="up"||x=="down"){r.css("left",0)}if(x=="left"||x=="right"){r.css("top",0)}$("#richmarqueeNewParent"+j).mouseover(function(){Fai.stopInterval("rm"+j)}).mouseout(function(){if(v=="infinite"||v>0){Fai.startInterval("rm"+j)}});b();k(x)}function a(){var z=r.find("img");if(z.length>0){var B=z[0].width;for(var A=0;A<z.length;A++){if(B<z[A].width){B=z[A].width}}return B}return 0}function g(){var E=r.children(".richContent"),D=E.children(),B=D.length,A=0,z=0,C;for(C=B-1;C>=0;C--){z=D.eq(C).outerWidth();if(z>A){A=z}}return A}function b(){var z=r.find("img");$(z).load(function(){var A=r.height();if(f!=A){f=A;k(x)}})}function k(z){if(z=="left"||z=="right"){m.css("position","relative");m.css("width",i);s.css("top",0);if(f!=0){m.css("height",f)}if(z=="left"){s.css("margin-left",w);if(y&&!l){r.css("left",i);s.css("left",i*2)}if(y&&l){s.css("left",i)}if(!y&&!l){r.css("left",d);s.css("left",i+d)}if(!y&&l){s.css("left",i+d)}}else{s.css("left",0);r.css("margin-left",w);r.css("width",(i)+"px");if(y&&!l){r.css("padding-left",i);r.css("padding-right",i);m.scrollLeft(i*2+w)}if(y&&l){r.css("padding-left",i);m.scrollLeft(i*2)}if(!y&&!l){r.css("padding-right",i+d);r.css("padding-left",i+d);m.scrollLeft(i+d+w)}if(!y&&l){r.css("padding-right",i+d);r.css("padding-left",i+d);m.scrollLeft(i+d+w)}}}if(z=="up"||z=="down"){m.css("position","relative");if(f!=0){m.css("height",f)}m.css("width",i);s.css("left",0);s.css("height",f);r.css("width",i);if(z=="up"){s.css("top",f*2);s.css("margin-top",w);if(y&&!l){m.scrollTop(0)}if(y&&l){s.css("top",f);m.scrollTop(0)}if(!y&&!l){m.scrollTop(0)}if(!y&&l){m.scrollTop(0)}}else{r.css("height",f);s.css("top",0);r.css("margin-top",w);if(y&&!l){r.css("padding-top",f);r.css("padding-bottom",f);m.scrollTop(f*2+w)}if(y&&l){r.css("padding-top",f);m.scrollTop(f*2)}if(!y&&!l){r.css("padding-top",f*2);r.css("padding-bottom",f*2);m.scrollTop(f*2+w)}if(!y&&l){r.css("padding-top",f*2);r.css("padding-bottom",f*2);m.scrollTop(f*2+w)}}}}function q(){if(x=="left"){var z=m.scrollLeft();z++;if(y&&!l){if(z==i*2+w){m.scrollLeft(i)}else{m.scrollLeft(z)}}if(y&&l){if(z==i+w){m.scrollLeft(0)}else{m.scrollLeft(z)}}if(!y&&!l){if(z==(i+d)+w){m.scrollLeft(0)}else{m.scrollLeft(z)}}if(!y&&l){if(z==i+d+w){m.scrollLeft(0)}else{m.scrollLeft(z)}}}else{if(x=="right"){var z=m.scrollLeft();z--;if(y&&!l){if(z==0){m.scrollLeft(i+w)}else{m.scrollLeft(z)}}if(y&&l){if(z==0){m.scrollLeft(i+w)}else{m.scrollLeft(z)}}if(!y&&!l){if(z==0){m.scrollLeft(i+d+w)}else{m.scrollLeft(z)}}if(!y&&l){if(z==0){m.scrollLeft(i+d+w)}else{m.scrollLeft(z)}}}else{if(x=="up"){var z=m.scrollTop();z++;if(y&&!l){if(z==m.height()*2+w){m.scrollTop(f)}else{m.scrollTop(z)}}if(y&&l){if(z==m.height()+w){m.scrollTop(0)}else{m.scrollTop(z)}}if(!y&&!l){if(z==m.height()*2){m.scrollTop(0)}else{m.scrollTop(z)}}if(!y&&l){if(z==m.height()*2+w){m.scrollTop(0)}else{m.scrollTop(z)}}}else{var z=m.scrollTop();z--;if(y&&!l){if(z==0){m.scrollTop(f+w)}else{m.scrollTop(z)}}if(y&&l){if(z==0){m.scrollTop(f+w)}else{m.scrollTop(z)}}if(!y&&!l){if(z==0){m.scrollTop(f*2+w)}else{m.scrollTop(z)}}if(!y&&l){if(z==0){m.scrollTop(f*2+w)}else{m.scrollTop(z)}}}}}}o();Fai.stopInterval("rm"+j);Fai.addInterval("rm"+j,q,p);Fai.startInterval("rm"+j);if(!$("#module"+t.id).data("first1")){$("#module"+t.id).data("first1",true);$("#module"+t.id).data("options",t)}Site.restartRichMarquee(t)};Site.restartRichMarquee=function(a){if(!a){return}var b=$("#module"+a.id);if(!b.data("first2")){b.data("first2",true);if(a.speed==28){a.speed="normal"}else{if(a.speed==60){a.speed="slow"}else{a.speed="fast"}}b.on("Fai_onModuleSizeChange",function(){Fai.stopInterval("rm"+a.id);b.data("restart",true);Site.richMarquee(a)});b.on("Fai_onModuleLayoutChange",function(){Fai.stopInterval("rm"+a.id);b.data("restart",true);Site.richMarquee(a)})}};Site.productScroll=function(k){var f={pauseDuration:3000,showDuration:600,scrollMode:"up"};var c=$.extend({},f,k);var d=$("#module"+c.moduleId),b=d.find(".J_productTextList"),g=b.parent(),j=b.find(".productTextListTable"),h=j.outerHeight(),a="proScroll"+c.moduleId;if(j.length<2){return}b.css({position:"relative",height:b.height()+"px"});g.css({overflow:"hidden"});b.mouseover(function(){Fai.stopInterval(a)}).mouseout(function(){Fai.startInterval(a)});function i(){function l(){if(c.scrollMode=="up"){b.animate({top:"-="+h},c.showDuration,function(){var m=b.find(".productTextListTable:first");m.appendTo(b).end().hide().fadeIn(400);b.css({top:0});e()})}else{b.animate({top:"+="+h},c.showDuration,function(){var m=b.find(".productTextListTable:last");m.insertBefore(b.find(".productTextListTable:first")).end().hide().fadeIn(400);b.css({top:0});e()})}}Fai.addTimeout(a,l,c.pauseDuration);Fai.startInterval(a)}function e(){i()}i()};Site.loadProductMarquee=function(w,I,D,u){var f=Fai.top["Product"+w].ieOpt,h=Fai.top["Product"+w].tgOpt,m=Fai.top["Product"+w].paramLayoutType,p=Fai.top["Product"+w].callbackArgs;var c=Fai.top.$("#module"+w);if(Fai.isNull(c)){return}c.find(".demo0>div").each(function(){if($(this).attr("cloneDiv")){$(this).remove()}});var t=c.find(".productMarqueeForm");var x=0;if(Fai.isIE6()||Fai.isIE7()){t.each(function(){var J=$(this).find(".imgDiv").width();$(this).css({width:+J+"px"})})}if(!D&&m!=6){if(t.length>=1){var i=t.first().find(".imgDiv");var F=i.width();var y=i.height();t.each(function(){var K=$(this).attr("faiWidth");var J=$(this).attr("faiHeight");if(Fai.isNull(J)){return}var L=Fai.Img.calcSize(K,J,F,y,Fai.Img.MODE_SCALE_FILL);if(L.height>x){x=L.height}})}}if(f.effType>=4&&f.effType<6){if(m==6){Site.clearImageEffectContent_product(w,"sixth_ProductPanel")}if(m==8){Site.clearImageEffectContent_product(w,"eighth_ProductPanel")}Site.clearImageEffectContent_product(w,"propDiv")}var e=0;var g=0;var C=0;var E=0;var o=0;var H=Site.getFormMiddleContentHeight(c,w);t.each(function(){var N=$(this);var P=c.find(".productMarqueeForms").attr("_bordertype");var O=parseInt(c.find(".productMarqueeForms").attr("_borderwidth"));var Q=c.find(".productMarqueeForms").attr("_bgtype");var ae=N.find("img");var ad=N.attr("faiHeight");if(Fai.isNull(ad)){return}var X=N.attr("faiWidth");var S=N.find(".imgDiv");var ac=S.width();if(D||m==6){x=S.height()}var M={width:ac,height:x};if(I==2){var K=N.attr("faiWidthOr");var R=N.attr("faiHeightOr");var J=K/R;var aa=ac/x;if(aa<=J){ae.css("width",J*x+"px");ae.css("height",x+"px");ae.css("marginLeft",((ac-J*x)/2)+"px");S.css("overflow","hidden")}else{ae.css("height",ac/J+"px");ae.css("width",ac+"px");ae.css("marginTop",((x-ac/J)/2)+"px");S.css("overflow","hidden")}var L=S.width();if(L<M.width){L=M.width}}else{if(I==0){if(D){M=Fai.Img.calcSize(X,ad,ac,x,Fai.Img.MODE_SCALE_FILL)}else{M=Fai.Img.calcSize(X,ad,ac,x,Fai.Img.MODE_SCALE_DEFLATE_HEIGHT)}var L=S.width();if(L<M.width){L=M.width}ae.css("width",M.width+"px");ae.css("height",M.height+"px");ae.css({marginLeft:"",marginTop:""})}else{if(typeof(I)!="number"&&I){if(D){M=Fai.Img.calcSize(X,ad,ac,x,Fai.Img.MODE_SCALE_FILL)}else{M=Fai.Img.calcSize(X,ad,ac,x,Fai.Img.MODE_SCALE_DEFLATE_HEIGHT)}}var L=S.width();if(L<M.width){L=M.width}ae.css("width",M.width+"px");ae.css("height",M.height+"px");ae.css({marginLeft:"",marginTop:""})}}if(Fai.top._manageMode){ae.data("realWidth",M.width);ae.data("realHeight",M.height)}if(N.find(".propWordWrapDiv").length>0){if(m==6){N.find(".propWordWrapDiv").width(L*0.8)}else{N.find(".propWordWrapDiv").width(L)}N.find(".propWordWrapDiv").height("auto")}else{if(N.find(".first_ProductName,.second_ProductName,.third_ProductName,.fourth_ProductName,.fifth_ProductName,.sixth_ProductName").length>0){if(m==6){N.find(".productName").width(L*0.8)}else{N.find(".productName").width(L)}N.find(".productName").height("auto")}else{var W=0;N.find(".productName > a").each(function(){if($(this).width()>W){W=$(this).width()}});if(W>L){L=W}}}var ab=N.find(".propDiv");if(m==6){ab.css("width",L*0.8+"px");N.find(".sixth_ProductName").css("width","80%")}else{ab.css("width",L+"px")}if(S.width()!=L){S.css("width",L+"px")}if(S.height()!=x){S.css("height",x+"px");if($.browser.msie&&$.browser.version==6){S.addClass("wocaie6").removeClass("wocaie6")}}if($(".propWordWrapDiv").length>0){Site.unifiedAttrVal(c,".propWordWrapDiv","height")}if(m==6){N.find(".sixth_ProductPanel").css({top:"-"+(N.find(".sixth_ProductPanel").height()-12)+"px","max-height":x/2+10})}if(N.outerHeight()>g&&(u==0||u==1)){g=N.outerHeight()}if(H>g&&(u==2||u==3)){g=H}var Z=N.outerWidth(true);var Y=N.outerHeight(true);if(Z>C){C=Z}e+=Z;var U=$(this).find(".eighth_ProductPanel");var T=U.find(".eighth_Pricepanel");var V=U.find(".fk_rightPiecePanel");if(!!U.length){if(P==1){T.css("left","4px");V.css("right","16px")}else{if(P==2){T.css("left",(4+O)+"px");V.css("right",(16+O)+"px");U.css("bottom",(84+O)+"px")}}}});if(t.length>=1){t.each(function(){if($(this).find(".fifth_mallBuy").length>0){var J=parseInt($(this).find(".fifth_mallBuy").width())-1;$(this).find(".fifth_mallBuy").css({"line-height":J+"px"})}})}tmpTotalWidth=e;var n=c.find(".demo");var B=c.find(".demo0");E=B.height();if(g>0){if(m==6){n.css("height",(g+50)+"px")}else{n.css("height",g+"px")}}if(u==0||u==1){B.css("width",e+"px");if(t.length==0){return}var a=n.width(),A=B.width();if(A<=a){jzUtils.run({name:"ImageEffect.FUNC.BASIC.Init",callMethod:true},{moduleId:w,imgEffOption:f,tagetOption:h,callback:Site.createImageEffectContent_product,callbackArgs:p});return}}if(u==2||u==3){var g=n.height(),j=B.height();if(j<=g){jzUtils.run({name:"ImageEffect.FUNC.BASIC.Init",callMethod:true},{moduleId:w,imgEffOption:f,tagetOption:h,callback:Site.createImageEffectContent_product,callbackArgs:p});return}}var l=t.first().outerWidth(true);if(l==0){return}var G=Fai.top.productMarqueelist;var s=0,d=t.length-1;t.each(function(K,M){if(s>a){return false}var J=$(M).clone().attr("cloneDiv","true"),N=J.children("div.imgDiv").attr("id");J.children("div.imgDiv").attr("id",N+"_clone");B.append(J);s+=J.outerWidth(true);if(0===K&&(u==2||u==3)){$(M).css("clear","both");J.css("clear","both")}if(Fai.isIE6()||Fai.isIE7()){if(K===d){$(t[K]).after('<div style="clear:both;"></div>');J.after('<div style="clear:both;"></div>')}}if(typeof G!="undefined"){for(var K=0;K<G.length;K++){var L=G[K];if(L.cloneflag&&L.cloneflag==N){$("#"+L.cloneflag+"_clone").mouseover(function(){var O=Site.addEditLayer(this,L,6);if(!O){return}O.mouseover(function(){Fai.stopInterval("marquee"+w)}).mouseout(function(){Fai.startInterval("marquee"+w)})}).mouseleave(function(){Site.removeEditLayer(this)});break}}}});var r=e+s;if(u==0||u==1){B.css("width",r+"px")}function q(){var J=n.scrollLeft();J++;n.scrollLeft(J);if(J==e){n.scrollLeft(0)}}function b(){e--;n.scrollLeft(e);if(e==0){n.scrollLeft(tmpTotalWidth);e=tmpTotalWidth}}function z(){var J=n.scrollTop();J--;n.scrollTop(J);if(J==0){n.scrollTop(E)}}function v(){var J=n.scrollTop();J++;n.scrollTop(J);if(J==E){n.scrollTop(0)}}if(u==0){n.scrollLeft(2*e);Fai.addInterval("marquee"+w,b,35)}else{if(u==1){Fai.addInterval("marquee"+w,q,35)}else{if(u==2){n.scrollTop(2*E);Fai.addInterval("marquee"+w,z,35)}else{if(u==3){Fai.addInterval("marquee"+w,v,35)}}}}n.mouseover(function(){Fai.stopInterval("marquee"+w)}).mouseleave(function(){Fai.startInterval("marquee"+w)});setTimeout(function(){Fai.startInterval("marquee"+w)},100);if(!c.data("first1")){c.data("first1",true);c.data("options",{id:w,scale:I,fixHeight:D,proMarqueeDirection:u,ieOpt:f,tgOpt:h,callback:Site.createImageEffectContent_product,callbackArgs:p})}if(c.data("first2")&&Fai.top._manageMode){var k=c.data("productOptions");Site.initModuleProductListItemManage(k)}jzUtils.run({name:"ImageEffect.FUNC.BASIC.Init",callMethod:true},{moduleId:w,imgEffOption:f,tagetOption:h,callback:Site.createImageEffectContent_product,callbackArgs:p});Site.restartProductMarquee(c)};Site.restartProductMarquee=function(a){if(!a.data("first2")){a.data("first2",true);a.on("Fai_onModuleSizeChange",function(){var b=a.data("options");Fai.stopInterval("marquee"+b.id);Site.loadProductMarquee(b.id,b.scale,b.fixHeight,b.proMarqueeDirection,b.ieOpt,b.tgOpt,b.callback,b.callbackArgs)});a.on("Fai_onModuleLayoutChange",function(){var b=a.data("options");Fai.stopInterval("marquee"+b.id);Site.loadProductMarquee(b.id,b.scale,b.fixHeight,b.proMarqueeDirection,b.ieOpt,b.tgOpt,b.callback,b.callbackArgs)})}};Site.initModuleProductFilter=function(c,b){$("#module"+c+" .productFilterValue").mouseover(function(){$(this).addClass("g_hover")}).mouseleave(function(){$(this).removeClass("g_hover")});if(b){var a=$("#module"+c).find(".formMiddle"+c).find("table.productFilterContent").find(".productFilterContentCenter");var d=a.find(".productFilterName");$.each(d,function(e,g){var f=$(g);f.css("cursor","pointer");f.click(function(){var h=$(this).next();if(h.is(":visible")){f.removeClass("productFilterUnfold").addClass("productFilterFold");h.hide()}else{f.removeClass("productFilterFold").addClass("productFilterUnfold");h.show()}})})}};Site.initModuleProductCatalog=function(c,a){$("#module"+c+" .productFilterValue").mouseover(function(){$(this).addClass("g_tableHover");$(this).find(".productFilterValueCenter").addClass("g_hover")}).mouseleave(function(){$(this).removeClass("g_tableHover");$(this).find(".productFilterValueCenter").removeClass("g_hover")});if(a){var d=$("#module"+c).find(".formMiddle"+c).find("table .parentClickedTd");var b=$("#module"+c).find(".formMiddle"+c).find("table .parentCatalog a");$.each(d,function(e,g){var f=$(g);f.css("cursor","pointer");f.click(function(){var i=parseInt($(this).attr("prodId"));var h=$("#prodDiv"+i);if(h.is(":visible")){$(this).removeClass("productFilterUnfold").addClass("productFilterFold");h.hide()}else{$(this).removeClass("productFilterFold").addClass("productFilterUnfold");h.show()}})});$.each(b,function(e,g){var f=$(g);f.click(function(l){l.preventDefault();var i=parseInt($(this).attr("prodId"));var h=$("#prodDiv"+i);var k=$("#provId"+i);var j=$(this).parent().find(".parentClickedTd");if(h.is(":visible")){h.hide();k.removeClass("productFilterUnfold").addClass("productFilterFold")}else{k.removeClass("productFilterFold").addClass("productFilterUnfold");h.show()}})})}};Site.loadProductTextList=function(b){var a=$("#module"+b);if(Fai.isNull(a)){return}if(!_manageMode){a.find(".productTextListTable").on("mouseenter.manage",function(){$(this).addClass("g_hover")}).on("mouseleave.manage",function(){$(this).removeClass("g_hover")})}};Site.loadProductTile=function(b,h,i,k,j,g){var f=$("#module"+b);if(Fai.isNull(f)){return}var m=0;var e=f.find(".productList").attr("_bordertype");var a=parseInt(f.find(".productList").attr("_borderwidth"));var l=f.find(".productList").attr("_bgtype");if(!i&&g!=6&&g!=8){f.find(".productTileForm").each(function(){var p=$(this).attr("faiWidth");var n=$(this).attr("faiHeight");if(Fai.isNull(n)){return}var u=$(this).find(".imgDiv");var t=u.width();var q=u.height();var r=$(this).attr("faiWidthOr");var o=$(this).attr("faiHeightOr");var s=Fai.Img.calcSize(r,o,t,q,Fai.Img.MODE_SCALE_FILL);if(s.height>m){m=s.height}})}f.find(".productTileForm").each(function(){var z=$(this).attr("faiHeight");if(Fai.isNull(z)){return}var x=$(this).attr("faiWidth");var r=$(this).attr("faiWidthOr");var y=$(this).attr("faiHeightOr");var C=$(this).find(".imgDiv");var A=C.width();var B=C.height();var o=$(this).find(".eighth_ProductPanel");var w=o.find(".eighth_Pricepanel");var q=o.find(".fk_rightPiecePanel");var s=C.find("img");if(i||g==6||g==8){B=C.height()}var v={width:A,height:B};if(h==2){var p=r/y;var n=A/B;if(n<=p){s.css("width",p*B+"px");s.css("height",B+"px");s.css("marginLeft",((A-p*B)/2)+"px")}else{s.css("height",A/p+"px");s.css("width",A+"px");s.css("marginTop",((B-A/p)/2)+"px")}}else{if(typeof(h)=="number"&&h==0){v=Fai.Img.calcSize(r,y,A,B,Fai.Img.MODE_SCALE_FILL);s.css("width",v.width+"px");s.css("height",v.height+"px");C.css("height",B+"px");s.css({marginTop:"",marginLeft:""})}else{if(typeof(h)!=="number"&&h){v=Fai.Img.calcSize(r,y,A,B,Fai.Img.MODE_SCALE_FILL)}s.css("width",v.width+"px");s.css("height",v.height+"px");C.css("height",B+"px");s.css({marginTop:"",marginLeft:""})}}if(Fai.top._manageMode){s.data("realWidth",v.width);s.data("realHeight",v.height)}if(g==4||g==5||g==9){var u=$(this).find(".fifth_mallBuy");var t=u.width();u.css("line-height",t+"px");u.css("height",t+"px")}if(g==6){$(this).css({"margin-bottom":"54px",overflow:"visible"})}if(!!o.length){if(e==0){if(l==1){w.css("left","15px");q.css("right","33px");o.css("bottom","36px")}}else{if(e==1){w.css("left","14px");q.css("right","34px");o.css("bottom","36px")}else{if(e==2){$(this).width(C.outerWidth());$(this).height(C.outerHeight());if(l==1){w.css("left",(14+a)+"px");q.css("right",(36+a)+"px");o.css("bottom",(36+a)+"px")}else{w.css("left",(4+a)+"px");q.css("right",(26+a)+"px");o.css("bottom",(25+a)+"px")}}}}}if(g<6){$(this).width(C.outerWidth(true))}});if(j>=4&&j<6){Site.clearImageEffectContent_product(b,"propList");return}if(k==-1&&f.find(".productNameWordWrap").length==0){Site.unifiedAttrVal(f,".productTileForm","height")}if(f.find(".productNameWordWrap").length>0){f.find(".productNameWordWrap").attr("paramLayoutType",g);if(g==3){var d=f.find(".productNameWordWrap");var c=0;d.each(function(){var n=$(this).outerHeight();n=parseInt(n);if(n>c){c=n}});d.each(function(){$(this).css("height",c+"px")})}else{Site.unifiedAttrVal(f,".productNameWordWrap","height")}Site.unifiedAttrVal(f,".productTileForm","height")}};Site.initProductRestrict=function(a,h,f,e,c){if(h){var g=0;if(c.count!=null){g=c.count}var i=0;i=e-g;if(Fai.fkEval(i)<0){i=-1}var b=1,d=-1;if(f>1&&e!=0){$("#limitAmountDiv").text("( "+LS.minAmount+" : "+f+" ; "+LS.maxAmount+" : "+i+" )");b=f;d=i}else{if(f==1&&e!=0){$("#limitAmountDiv").text("( "+LS.maxAmount+" : "+i+" )");d=i}else{if(f>1&&e==0){$("#limitAmountDiv").text("( "+LS.minAmount+" : "+f+" )");b=f}}}$("#cartbuyCount"+a).unbind("change");$("#cartbuyCount"+a).val(b);$("#cartbuyCount"+a).change(function(){var j=$("#cartbuyCount"+a).val();var k=1;if(Fai.isInteger(j)){k=parseInt(j)}if(k<b||k==b){k=b;$("#buyCountDes"+a).addClass("disableMallJian");$("#buyCountInc"+a).removeClass("disableMallJia");if((b>d||b==d)&&d!=-1){$("#buyCountInc"+a).addClass("disableMallJia")}}else{if(d!=-1&&(k>d||k==d)){k=d;$("#buyCountInc"+a).addClass("disableMallJia");$("#buyCountDes"+a).removeClass("disableMallJian")}else{if(k>9999998){k=9999999;$("#buyCountDes"+a).removeClass("disableMallJian");$("#buyCountInc"+a).addClass("disableMallJia")}else{$("#buyCountDes"+a).removeClass("disableMallJian");$("#buyCountInc"+a).removeClass("disableMallJia")}}}$("#cartbuyCount"+a).val(k)});$("#cartbuyCount"+a).change();$("#buyCountDes"+a).click(function(){var j=$("#cartbuyCount"+a).val();var k=1;if(Fai.isInteger(j)){k=parseInt(j)}if(k<b+1){$("#cartbuyCount"+a).val(b);$("#buyCountDes"+a).addClass("disableMallJian")}else{$("#buyCountInc"+a).removeClass("disableMallJia")}});$("#buyCountInc"+a).click(function(){var j=$("#cartbuyCount"+a).val();var k=1;if(Fai.isInteger(j)){k=parseInt(j)}if(k>d-1&&d!=-1){if(d>b){$("#cartbuyCount"+a).val(d);$("#buyCountInc"+a).addClass("disableMallJia")}else{$("#cartbuyCount"+a).val(b);$("#buyCountInc"+a).addClass("disableMallJia")}}else{$("#buyCountDes"+a).removeClass("disableMallJian")}})}};Site.wipeOffRunOne=true;Site.initProductOptions=function(m,g,r,b,o,j){var a;if(m==="PdSlide"){a=$("#fk-productSlideContent")}else{a=$("#module"+m)}if(Fai.isNull(a)){return}var p=a.find(".optionItemWrap");var n=[];var i=a.find("#realMallAmount").html();var k=a.find("#mallAmount").html();var c=a.find("#mallWeight").html();if(!r){$.each(g,function(u,v){if(typeof v.oAmount!="undefined"){delete v.oAmount}})}if(k<=0){s(p.find(".J-item"))}else{$.each(g,function(u,w){if(w.oAmount<=0&&p.length<=1){var v=p.find(".J-item[data='"+w.t2+"']");s(v)}else{if(w.oAmount<=0&&p.length>1){n.push(w.t2)}}})}p.find(".J-item").hover(function(){if($(this).attr("isEmptyAmount")=="1"){return}$(this).addClass("g_borderSelected fk-mainBorderColor fk-mainFontColor")},function(){if($(this).attr("isEmptyAmount")=="1"){return}if(!$(this).hasClass("optionItemHover")){$(this).removeClass("g_borderSelected fk-mainBorderColor fk-mainFontColor")}});p.find(".optionItem img").hover(function(){if($(this).attr("isEmptyAmount")=="1"){return}var w=$(this).parent();if(w.find("img").length===0){return false}var u=w.find(".J-img-tip");if(u.length>0){u.stop(true,true).fadeIn();return false}var v=w.find("span").text();u=["<div class='img-tip J-img-tip'>","<div>",v,"</div>","<div class='tip-ico J-ico'></div>","</div>"];u=$(u.join(""));w.append(u);u.find(".J-ico").css("left",(u.outerWidth()-11)/2);u.css("left",-((u.outerWidth()-38)/2));u.fadeIn()},function(){if($(this).attr("isEmptyAmount")=="1"){return}$(this).parent().find(".J-img-tip").fadeOut()});var e=$("#cartbuyCount"+m).val();var d=$("#imgDiv"+m);var h="<div class='J-img-tri img-selected g_borderSelected'></div><div class='J-img-tri op-selected-ico'></div>";p.find(".optionItem").bind("click",function(){if($(this).find(".J-item").attr("isEmptyAmount")=="1"){return}var X=$(this),Y=X.siblings(),O=X.find(".J-item");var W;if(O.hasClass("J-isSelected")){O.removeClass("optionItemHover g_borderSelected fk-mainBorderColor fk-mainFontColor J-isSelected");O.parent().find(".J-img-tri").remove();a.find("#realMallAmount").html(i);a.find("#mallAmount").html(k);a.find("#mallWeight").html(c);if(o){$("#limitAmountDiv").text("");$("#buyCountInc"+m).removeClass("disableMallJia");$("#buyCountDes"+m).removeClass("disableMallJian");$("#buyCountInc"+m).unbind("click");$("#buyCountDes"+m).unbind("click")}var z=p.find(".optionItem:hidden");if(z.length>0){W="";p.each(function(ad,ae){if($(p[ad]).find(".J-item.g_borderSelected").length<=0){W+="x_"}else{W+=$(p[ad]).find(".J-item.g_borderSelected").attr("data")+"_"}});W=W.substring(0,W.length-1);$.each(z,function(){var ag=false;var af=$(this).find(".J-item").attr("data");var ae=$(".optionItemWrap").index($(this).parent());var ad=W.split("_");ad[ae]=af;var ah=ad.join("_");$.each(g,function(ai,aj){if(!isNaN(aj.flag)&&aj.flag==0){return true}if(t(ah,aj.t2)){ag=true;return false}});if(ag){z.show()}})}}else{O.addClass("optionItemHover g_borderSelected fk-mainBorderColor fk-mainFontColor J-isSelected");Y.find(".J-item").removeClass("optionItemHover g_borderSelected fk-mainBorderColor fk-mainFontColor J-isSelected");Y.find(".J-img-tri").remove();if(O.hasClass("J-item-img")){X.append(h)}}if(p.length>1&&r){var ab=0;if(typeof W=="undefined"){W="";p.each(function(ad,ae){if($(p[ad]).find(".J-item.g_borderSelected").length<=0){W+="x_"}else{W+=$(p[ad]).find(".J-item.g_borderSelected").attr("data")+"_"}});W=W.substring(0,W.length-1)}$.each(g,function(ad,ae){if(t(W,ae.t2)){if(ae.flag!=0&&!isNaN(ae.oAmount)){ab+=ae.oAmount}}});$("#mallAmount").text(ab)}var E=O.attr("_fk-org");if(d.length>0&&E){d.find("img").attr("src",E);var A=d.find(".cloud-zoom");if(A.length>0){d.attr("faihref",E);A.attr("href",E).data("zoom").destroy();A.CloudZoom({imageWidth:parseInt(O.attr("faiwidth")),imageHeight:parseInt(O.attr("faiheight"))})}}var G=p.length;var J=p.find(".J-item.g_borderSelected");if(G==J.length){var y="",Q,B,u,D,H;$.each(J,function(ad,ae){y+=$(ae).attr("data")+"_"});$.each(g,function(ad,af){var ae=af.t2;if((ae+"_")==y){Q=af.oPrice;B=af.oAmount;u=af.minAmount;D=af.maxAmount;H=af.w}});if(o){$("#limitAmountDiv").text("");var v=0;var ac=j.optionsCount;if(ac!=null&&ac.d!=null){for(var U=0;U<ac.d.length;U++){if((ac.d[U].t+"_")==y){v=ac.d[U].c}}}var C=0;C=D-v;if(Fai.fkEval(C)<0){C=-1}var P=1;var T=-1;if(u>1&&D!=0){$("#limitAmountDiv").text("( "+LS.minAmount+" : "+u+" ; "+LS.maxAmount+" : "+C+" )");P=u;T=C}else{if(u==1&&D!=0){$("#limitAmountDiv").text("( "+LS.maxAmount+" : "+C+" )");T=C}else{if(u>1&&D==0){$("#limitAmountDiv").text("( "+LS.minAmount+" : "+u+" )");P=u}}}$("#cartbuyCount"+m).val(P);$("#cartbuyCount"+m).unbind("change");$("#cartbuyCount"+m).bind("change");$("#cartbuyCount"+m).change(function(){var ad=$("#cartbuyCount"+m).val();var ae=1;if(Fai.isInteger(ad)){ae=parseInt(ad)}if(ae<P||ae==P){ae=P;$("#buyCountDes"+m).addClass("disableMallJian");$("#buyCountInc"+m).removeClass("disableMallJia");if((P>T||P==T)&&T!=-1){$("#buyCountInc"+m).addClass("disableMallJia")}}else{if(T!=-1&&(ae>T||ae==T)){ae=T;$("#buyCountInc"+m).addClass("disableMallJia");$("#buyCountDes"+m).removeClass("disableMallJian")}else{if(ae>9999998){ae=9999999;$("#buyCountDes"+m).removeClass("disableMallJian");$("#buyCountInc"+m).addClass("disableMallJia")}else{$("#buyCountDes"+m).removeClass("disableMallJian");$("#buyCountInc"+m).removeClass("disableMallJia")}}}$("#cartbuyCount"+m).val(ae)});$("#cartbuyCount"+m).change();$("#buyCountDes"+m).unbind("click");$("#buyCountInc"+m).unbind("click");$("#buyCountDes"+m).click(function(){var ad=$("#cartbuyCount"+m).val();var ae=1;if(Fai.isInteger(ad)){ae=parseInt(ad)}if(ae<P+1){$("#cartbuyCount"+m).val(P);$("#buyCountDes"+m).addClass("disableMallJian")}else{$("#buyCountInc"+m).removeClass("disableMallJia")}});$("#buyCountInc"+m).click(function(){var ad=$("#cartbuyCount"+m).val();var ae=1;if(Fai.isInteger(ad)){ae=parseInt(ad)}if(ae>T-1&&T!=-1){if(T>P){$("#cartbuyCount"+m).val(T);$("#buyCountInc"+m).addClass("disableMallJia")}else{$("#cartbuyCount"+m).val(P);$("#buyCountInc"+m).addClass("disableMallJia")}}else{$("#buyCountDes"+m).removeClass("disableMallJian")}})}if(r){$("#mallAmount").text(B)}if(Q==null){if(Fai.top._lcid!=2052&&Fai.top._lcid!=1028){$("#realMallAmount").text(Fai.formatPriceEn(b))}else{$("#realMallAmount").text(b)}Site.onlyChangeSalePrice(b)}else{if(Fai.top._lcid!=2052&&Fai.top._lcid!=1028){$("#realMallAmount").text(Fai.formatPriceEn(Q))}else{$("#realMallAmount").text(Q)}Site.onlyChangeSalePrice(Q);if(Fai.isIE10()){if(Site.wipeOffRunOne){$(".pd_J .pd_propTable .propName").each(function(ad,ae){$(ae).removeClass("propName");setTimeout(function(){$(ae).addClass("propName")},0)})}Site.wipeOffRunOne=false}}if(H!=null){$("#mallWeight").text(H)}}if(G!=J.length&&G!=1){l()}if((G-1)<=J.length&&G!=1){var N="";$.each(p,function(ad,ae){if($(p[ad]).find(".J-item.g_borderSelected").length<=0){N+="x_"}else{N+=$(p[ad]).find(".J-item.g_borderSelected").attr("data")+"_"}});if(N!=""){N=N.substring(0,N.length-1)}var F="";$.each(p,function(ad,af){var ae=$(p[ad]).find(".J-item.g_borderSelected");if(ae.length<=0){F=$(p[ad])}});if(F!=""){var Z=F.find(".J-item");$.each(Z,function(ad,af){var ae=N.replace("x",$(Z[ad]).attr("data"));if($.inArray(ae,n)>=0){s(Z[ad])}else{f(Z[ad])}})}else{$.each(p,function(ad,af){var ae=$(p[ad]).find(".J-item");$.each(ae,function(ai,ah){if($(ae[ai]).hasClass("g_borderSelected")){return}var ag=N.split("_");ag[ad]=$(ae[ai]).attr("data");var aj=ag.join("_");if($.inArray(aj,n)>=0){s(ae[ai])}else{f(ae[ai])}})})}}var V=[],S=false;for(var U=0;U<p.length;U++){var I=p.eq(""+U+"");if(I.find(".J-item").hasClass("g_borderSelected")){V.push(I.find(".J-item.g_borderSelected").attr("data"))}else{break}}if(V.length<=p.length&&V.length>1){var L=V.length;for(var U=0;U<L;U++){$.each(g,function(ae,ag){var af=ag.t2;var ad=af.split("_");if(ag.flag==undefined){ag.flag=1}if(ag.flag==1&&q(ad,V)){S=true;return false}});if(!S){var M=p.eq(V.length-1).find(".J-item");var K=V.pop();M.each(function(){if($(this).attr("data")==K){var ad=$(this).parent();ad.hide()}});M.parent().find(".J-img-tri").remove();M.removeClass("g_borderSelected fk-mainBorderColor fk-mainFontColor optionItemHover J-isSelected")}else{break}}}var aa=p.index(X.parent());for(var R=aa;R<V.length;R++){var w=V.slice(0,R+1);S=false;for(var U=w.length;U<p.length;U++){var x=p.eq(""+U+"");x.find(".optionItem").each(function(){var ad=$(this).find(".J-item").attr("data");S=false;$.each(g,function(af,ah){var ag=ah.t2;var ae=ag.split("_");if(ah.flag==undefined){ah.flag=1}if(ad==ae[U]&&ah.flag==1&&q(ae,w)){S=true;return false}});if(!S){$(this).hide()}else{$(this).show()}})}}});function s(u){$(u).css({"border-style":"dashed",color:"#CDCDCD",cursor:"not-allowed"});$(u).attr("isEmptyAmount","1")}function f(u){$(u).css({"border-style":"",color:"",cursor:""});$(u).attr("isEmptyAmount","")}function l(){$(".optionItemWrap .J-item").css({"border-style":"",color:"",cursor:""});$(".optionItemWrap .J-item").attr("isEmptyAmount","")}function t(w,y){var x=true;var v=w.split("_");var u=y.split("_");if(v.length!=u.length){return false}$.each(v,function(z,A){if(v[z]=="x"){return true}if(v[z]!=u[z]){x=false;return false}});return x}function q(v,x){var u=true;for(var w=0;w<x.length;w++){if(x[w]!=v[w]){u=false;break}}return u}};Site.initMbPdCollection={};(function(e,g,f){g.init=function(l,j,h,i,k){g.sessionMid=l;g.collectionList=j==null?[]:j;g.pid=h;g._manageMode=i;a(k);c();if(e("#_TOKEN").length!=0&&!i&&Fai.Cookie.get("collectId")==h&&!e("#pdCollection .pdCollectIcon").hasClass("collectionSelect")){e("#pdCollection").click()}Fai.Cookie.clear("collectId")};function b(h){var i={};i.productCollections=g.collectionList+"";e.post("ajax/member_h.jsp",{cmd:"set",id:g.sessionMid,info:e.toJSON(i)},function(j){if(j.success){d(h)}},"json")}function d(i){var j={height:72};if(i=="suc"){j.width=183;j.htmlContent='<div class="suc-ico addItemTextTips" style="font-size:14px; color:#636363 ;margin-left: 29px; padding-left: 39px;">'+LS.sucCollection+"</div>"}else{if(i=="warn"){j.width=210;j.htmlContent='<div class="warn-ico addItemTextTips" style="font-size:14px; color:#636363 ;margin-left: 29px; padding-left: 39px;">'+LS.cancelCollection+"</div>"}else{if(i=="err"){j.height=90;j.width=280;j.htmlContent='<div class="resultFailIcon addItemTextTips" style="font-size:14px; color:#636363 ;margin-left: 39px; padding-left: 35px;">';j.htmlContent+=LS.isManagefailCollection+"</div>"}}}var h=Site.popupBox(j),k;if(Fai.top._isTemplateVersion2){k={"margin-top":"0px",right:"9px",width:"18px",height:"18px","background-position":"-448px -187px"}}else{k={"margin-top":"9px",right:"9px",width:"12px",height:"12px","background-position":"-1665px -110px"}}h.find(".popupBClose").css(k);if(i!="err"){setTimeout(function(){h.find(".popupBClose").click()},1500)}}function c(){e("#pdCollection").on("click",function(){if(g.sessionMid==0){if(g._manageMode){d("err")}else{window.location.href="login.jsp?url="+Fai.encodeUrl(window.location.href);Fai.Cookie.set("collectId",g.pid)}}else{if(e.inArray(g.pid,g.collectionList)==-1){g.collectionList.push(g.pid);e("#pdCollection .pdCollectIcon").addClass("collectionSelect");e("#pdCollection .pdCollectIcon").addClass("faisco-icons-star3");e(".faisco-icons-star3").css({"font-size":"22px","line-height":"22px",height:"22px"});e("#pdCollection .pdCollectIcon").removeClass("faisco-icons-start2");b("suc")}else{if(e.inArray(g.pid,g.collectionList)!=-1){g.collectionList.splice(e.inArray(g.pid,g.collectionList),1);e("#pdCollection .pdCollectIcon").removeClass("collectionSelect");e("#pdCollection .pdCollectIcon").addClass("faisco-icons-start2");e("#pdCollection .pdCollectIcon").removeClass("faisco-icons-star3");b("warn")}}}})}function a(h){if(g.sessionMid!=0&&e.inArray(g.pid,g.collectionList)!=-1){e("#pdCollection .pdCollectIcon").addClass("collectionSelect");e("#pdCollection .pdCollectIcon").addClass("faisco-icons-star3");e(".faisco-icons-star3").css({"font-size":"22px","line-height":"22px",height:"22px"});e("#pdCollection .pdCollectIcon").removeClass("faisco-icons-start2")}if(!!h){return}}})(jQuery,Site.initMbPdCollection);Site.loadCollection=function(){$("#pdCollection").hover(function(){$("#pdCollection .collection").removeClass("text").addClass("productOperaTextColor").addClass("operaTextHover");$("#pdCollection .pdCollectIcon").removeClass("text").addClass("productOperaTextColor").addClass("operaTextHover")},function(){$("#pdCollection .collection").addClass("text").removeClass("productOperaTextColor").removeClass("operaTextHover");$("#pdCollection .pdCollectIcon").addClass("text").removeClass("productOperaTextColor").removeClass("operaTextHover")});$("#pdCollection .collection,#pdCollection .pdCollectIcon").hover(function(){$("#pdCollection .collection").removeClass("text").addClass("productOperaTextColor").addClass("operaTextHover");$("#pdCollection .pdCollectIcon").removeClass("text").addClass("productOperaTextColor").addClass("operaTextHover")})};Site.getQueryString=function(a){var b=new RegExp("(^|&)"+a+"=([^&]*)(&|$)");var c=window.location.search.substr(1).match(b);if(c!=null){return unescape(c[2])}return null};Site.loadProductDetail=function(n,q,k,i){var c=$("#module"+n),u=i==5?"vertical":"horizontal",v="leftIcon"+n,f="rightIcon"+n,h,d;if(i==5){u="vertical";v="prePdIcon"+n;f="nextPdIcon"+n}if(Fai.isNull(c)){return}var j=c.find(".imgDiv");var l=j.attr("faiWidth");var s=j.attr("faiHeight");if(Fai.isNull(s)){return}if(q==null&&k==null){var w=j.width();var p=j.height()}else{var w=q;var p=k}var b=Fai.Img.calcSize(l,s,w,p,Fai.Img.MODE_SCALE_DEFLATE_FILL);var o=b.height;var r=b.width;d=$("#imgGroup"+n);if(i==5){thumbList=d.find(".imgGroupDiv");if(q==null&&k==null){d.height(p)}if((thumbList.length*thumbList.outerHeight(true))<=p){c.find("#prePdIcon"+n).hide();c.find("#nextPdIcon"+n).hide();d.find(".J_imgDivsStyle5").css({position:"absolute",top:"-8px",left:"0",height:p+"px"})}else{d.find(".J_imgDivsStyle5").height(p-2*d.find("#nextPdIcon"+n).width())}}var x=c.find(".imgGroupDiv");x.each(function(){var C=$(this).attr("faiWidth");var D=$(this).attr("faiHeight");if(Fai.isNull(D)){return}var B=Fai.Img.calcSize(C,D,w,p,Fai.Img.MODE_SCALE_DEFLATE_FILL);if(B.height>o){o=B.height}if(B.width>r){r=B.width}var A=$(this).find("img");$(A).one("load",function(){var G=A.width();var H=A.height();C=A.attr("faiWidth");D=A.attr("faiHeight");var F=Fai.Img.MODE_SCALE_FILL;if(G==1&&H==1){var E=new Image();E.src=A.data("original");$(E).on("load",function(){G=E.width;H=E.height;B=Fai.Img.calcSize(G,H,C,D,F);A.css("width",B.width+"px");A.css("height",B.height+"px");if(A.attr("src")!=A.data("original")){A.attr("src",A.data("original"))}A.css("display","block")})}else{B=Fai.Img.calcSize(G,H,C,D,F);if(B.width==1){B.width=C}if(B.height==1){B.height=D}A.css("width",B.width+"px");A.css("height",B.height+"px");A.css("display","block")}})});var z=j.find("img");if(i!=5){z.css("width",b.width+"px");z.css("height",b.height+"px")}z.css("display","block");j.data("divWidth",w);j.data("divHeight",p);if(q!=null&&k!=null){j.css("height",k+"px");j.css("width",q+"px")}if(i==2){$(".pd_J .imgContainer_J").css("margin","0px auto");$(".pd_J .imgContainer_J").css("float","none");$(".pd_J .imgContainer_J").parent().css("width","100%")}var a=j.find(".cloud-zoom");if(a.length==1){a.attr("rel","adjustX:-4, adjustY:-4, maxWidth:"+w+", maxHeight:"+o+',position:"inside"');a.CloudZoom({imageHeight:s,imageWidth:l})}if(x.length>1){if(i!=5){h=d.width()-$("#leftIcon"+n).outerWidth(true)-$("#rightIcon"+n).outerWidth(true)}$("#imgDivs"+n).width(h);var y=(a.length==1)?"true":"false";Site.multiPhoto($("#imgDivs"+n),$("#imgDiv"+n),{leftIconID:v,rightIconID:f,zoom:y,direction:u})}var e=c.find(".pd_J").width(),g=c.find(".imgContainer_J").width(),t=c.find(".pdLayoutR_J"),m=c.find(".pdAppendLayout_J");if((e-g)<200){t.appendTo(m)}};Site.productBigPicResponsive=function(a,c,d,f,g){var b=$("#module"+a),l,i,k,j,e,h;if(d||b.length<1){return}i=b.width();if(c){j=(i-260)/2}else{j=(i+300)/3}k=Fai.Img.calcSize(f,g,j,j,Fai.Img.MODE_SCALE_FILL);l=b.find("#imgDiv"+a);l.css({width:j+"px",height:j+"px"});l.find("img").css({width:k.width+"px",height:k.height+"px"});if(c){b.find(".imgContainer_J").width(j+130)}else{b.find(".imgContainer_J").width(j)}e=b.find("#imgGroup"+a);e.height(k.height)};Site.initPdCommentSwitch=function(){var a=0;if(document.cookie.length>0){cStart=document.cookie.indexOf("tabSwitch=");if(-1!=cStart){cStart=cStart+10;cEnd=document.cookie.indexOf(";",cStart);if(-1==cEnd){cEnd=document.cookie.length}a=unescape(document.cookie.substring(cStart,cEnd))}}$(".tabSwitch").eq(a).click()};Site.pdSaleRecordPagenation=function(b,a){$("#saleRecordSwitch").on("click",function(){if($("#saleRecordPanel .tableBody").children().length==0){Site.loadSaleRecord(b,a,1)}});$("body").on({hover:function(){$(this).addClass("g_hover")},mouseleave:function(){$(this).removeClass("g_hover")},click:function(){var d=$("#saleRecordPanel .pagenation .pageNo").not(":has('.g_border')").text();var c=1;if($(this).parent().hasClass("pagePrev")){c=Number(d)-1}else{if($(this).parent().hasClass("pageNext")){c=Number(d)+1}else{c=Number($(this).text())}}Site.loadSaleRecord(b,a,c)}},"#saleRecordPanel .pagenation .g_border")};Site.loadSaleRecord=function(c,a,b){$.ajax({url:"ajax/product_h.jsp?cmd=getSaleRecordList",data:"pid="+c+"&pno="+b,type:"post",dataType:"json",success:function(e){if(e.success){$(".saleRecordBody tr").remove();var g=[];$.each(e.list,function(i,h){g.push("<tr class='b_li'>");g.push("<td class='b_creator'><span class='msgBoard_msgUser_level' style='margin-right:12px;'></span>"+h.createName+"</td>");if(a){g.push("<td class='b_optionType'>"+h.optionType+"</td>")}g.push("<td class='b_amount'>"+h.amount+"</td>");var j=new Date(h.paidTime);g.push("<td class='b_paidTime'><span>"+$.format.date(j,"yyyy-MM-dd")+"</span><br><span>"+$.format.date(j,"HH:mm:ss")+"</span></td>");g.push("</tr>")});$(".saleRecordBody .tableBody").html(g.join(""));if($(".saleRecordFooter .pagenation").length!=0){var d=[];d.push("<div class='pagePrev'>");if(b==1){d.push("<span>"+LS.prevPager+"</span>")}else{d.push("<a hidefocus='true' class='g_border' href='javascript:;'><span>"+LS.prevPager+"</span></a>")}d.push("</div>");if(b==1){d.push("<div class='pageNo'><span>1</span></div>")}else{d.push("<div class='pageNo'><a hidefocus='true' class='g_border' href='javascript:;'><span>1</span></a></div>")}if(b-2>2){d.push("<div class='pageEllipsis'><span>...</span></div>");for(var f=b-2;f<b;f++){d.push("<div class='pageNo'><a hidefocus='true' class='g_border' href='javascript:;'><span>"+f+"</span></a></div>")}}else{for(var f=2;f<b;f++){d.push("<div class='pageNo'><a hidefocus='true' class='g_border' href='javascript:;'><span>"+f+"</span></a></div>")}}if(b!=1&&b!=e.totalPage){d.push("<div class='pageNo'><span>"+b+"</span></div>")}if(b+2<e.totalPage-1){for(var f=b+1;f<=b+2;f++){d.push("<div class='pageNo'><a hidefocus='true' class='g_border' href='javascript:;'><span>"+f+"</span></a></div>")}d.push("<div class='pageEllipsis'><span>...</span></div>")}else{for(var f=b+1;f<=e.totalPage-1;f++){d.push("<div class='pageNo'><a hidefocus='true' class='g_border' href='javascript:;'><span>"+f+"</span></a></div>")}}if(b==e.totalPage){d.push("<div class='pageNo'><span>"+e.totalPage+"</span></div>")}else{d.push("<div class='pageNo'><a hidefocus='true' class='g_border' href='javascript:;'><span>"+e.totalPage+"</span></a></div>")}d.push("<div class='pageNext'>");if(b==e.totalPage){d.push("<span>"+LS.nextPager+"</span>")}else{d.push("<a hidefocus='true' class='g_border' href='javascript:;'><span>"+LS.nextPager+"</span></a>")}d.push("</div>");$(".saleRecordFooter .pagenation").children().remove();$(".saleRecordFooter .pagenation").html(d.join(""))}}},error:function(){Fai.ing(LS.systemError)}})};Site.loadPdShareMore=function(){if(Fai.isIE6()||Fai.isIE7()){if(Fai.isIE6()){$(".productOpera .shareInfo").css({top:"20px",left:"0"});$(".productOpera .pdShareDiv").css({position:"relative"});$(".pdShare").css({"padding-top":"0"})}if(Fai.isIE7()){$(".productOpera .shareInfo").css({top:"26px",left:"0"});$(".productOpera .pdShareDiv").css({position:"relative"})}var c=$(".productOpera .m_shareCtrl a").length;if(c<7){if(c==0){$(".productOpera .shareInfo").width("75px");$(".productOpera .shareInfo").height("30px")}else{$(".productOpera .shareInfo").width(c*28+"px")}}else{$(".productOpera .shareInfo").width("200px")}if($(".productOpera .shareInfo").width<75){$(".productOpera .shareInfo").width("75px")}}$(".pdShareDiv .pdShare,.pdShareDiv .shareInfo ").hover(function(){$(".pdShareDiv .pdShare").children("div").removeClass("text").addClass("productOperaTextColor").addClass("operaTextHover")},function(){$(".pdShareDiv .pdShare").children("div").addClass("text").removeClass("productOperaTextColor").removeClass("operaTextHover")});$(".pdShare .share ,.pdShare .pdShareIcon").hover(function(){$(".pdShare .share").addClass("productOperaTextColor").addClass("operaTextHover");$(".pdShare .pdShareIcon").addClass("productOperaTextColor").addClass("operaTextHover")});$("body").on({hover:function(){$("#pdShare").addClass("pdShareHover");$("#pdShare").css({"z-index":"999"});$(".shareInfo_J").css({"z-index":"998"});$(".productOpera .shareInfo").show();$(".shareDown").addClass("shareUp");$(".share").addClass("operaTextHover");if(Fai.isIE6()||Fai.isIE7()){$(".productOpera").css("z-index","1000")}},mouseleave:function(){$("#pdShare").removeClass("pdShareHover");$("#pdShare").css({"z-index":""});$(".shareInfo_J").css({"z-index":""});$(".productOpera .shareInfo").hide();$(".shareDown").removeClass("shareUp");$(".share").removeClass("operaTextHover");if(Fai.isIE6()||Fai.isIE7()){$(".productOpera").css("z-index","")}}},".productOpera .pdShare,.productOpera .shareInfo");var d=$(".pd_J .pd_t_l_left_J"),b=d.find(".imgContainer_J"),a=d.find(".shareContainer_J"),e=a.find(".shareInfo_J");if(Fai.isIE6()||Fai.isIE7()){d.width(b.width())}setTimeout(function(){var g=a.height(),h=e.height(),f=e.find(".shareMore_J");if(h>g+5){$(f).click(function(){if(a.hasClass("s_expand")){a.removeClass("s_expand");f.find("div").removeClass("s_more_up")}else{a.addClass("s_expand");f.find("div").addClass("s_more_up")}})}else{f.remove()}},0)};Site.loadPdSerOnLineMore=function(){if(Fai.isIE6()||Fai.isIE7()){if(Fai.isIE6()){$(".productOpera .serOnlineInfo").css({top:"22px",left:"0"});$(".productOpera .pdSerOnlineDiv").css({position:"relative"});$(".pdSerOnline").css({"padding-top":"0"})}if(Fai.isIE7()){$(".productOpera .serOnlineInfo").css({top:"28px",left:"0"});$(".productOpera .pdSerOnlineDiv").css({position:"relative"})}}$(".pdSerOnline,.serOnlineInfo").hover(function(){$(".pdSerOnline .pdKefuIcon").addClass("productOperaTextColor").addClass("operaTextHover").removeClass("text");$(".pdSerOnline .serOnline").addClass("productOperaTextColor").addClass("operaTextHover").removeClass("text")},function(){$(".pdSerOnline .pdKefuIcon").addClass("text").removeClass("operaTextHover").removeClass("productOperaTextColor");$(".pdSerOnline .serOnline").addClass("text").removeClass("operaTextHover").removeClass("productOperaTextColor")});$(".pdSerOnline .pdKefuIcon,.pdSerOnline .serOnline").hover(function(){$(".pdSerOnline .pdKefuIcon").addClass("productOperaTextColor").addClass("operaTextHover").removeClass("text");$(".pdSerOnline .serOnline").addClass("productOperaTextColor").addClass("operaTextHover").removeClass("text")});$("body").on({hover:function(){$("#pdSerOnline").addClass("pdSerOnlineHover");$("#pdSerOnline").css({"z-index":"999"});$(".J_serOnlineInfo").css({"z-index":"998"});$(".productOpera .serOnlineInfo").show();$(".serOnlineDown").addClass("serOnlineUp");$(".pdSerOnline").addClass("operaTextHover");if(Fai.isIE6()||Fai.isIE7()){$(".productOpera").css("z-index","1000")}var d=0;var a=0;var b=0;var e=0;$(".serOnline-list:odd").each(function(f,g){d=d>$(g).width()?d:$(g).width();e++});$(".serOnline-list:even").each(function(f,g){a=a>$(g).width()?a:$(g).width();e++});var c=$("#pdSerOnline").width();b=d+a+27;if(c>b){$(".productDetail .serOnline-service").css("width",(c+5)+"px");$(".productDetail .serOnline-list:odd").css("width",(d+c-b+5)+"px");$(".productDetail .serOnline-list:even").css("width",a+"px")}else{$(".productDetail .serOnline-service").css("width",(b+5)+"px");$(".productDetail .serOnline-list:odd").css("width",d+"px");$(".productDetail .serOnline-list:even").css("width",a+"px")}if(e>1){$(".productDetail .serOnline-list:even").css("margin-right","27px")}},mouseleave:function(){$("#pdSerOnline").removeClass("pdSerOnlineHover");$("#pdSerOnline").css({"z-index":""});$(".J_serOnlineInfo").css({"z-index":""});$(".productOpera .serOnlineInfo").hide();$(".serOnlineDown").removeClass("serOnlineUp");$(".pdSerOnline").removeClass("operaTextHover");if(Fai.isIE6()||Fai.isIE7()){$(".productOpera").css("z-index","")}}},".productOpera .pdSerOnline,.productOpera .serOnlineInfo")};Site.onlineServiceNameHoverShow=function(){var a=$("<div id='fk-seronlineDockTip' class='resizableToShowWidth dockTip' style='border:solid 1px #999999;background:#f9fafb;slineHeight:20px;fontSize:20px;padding:2px 5px;color:black;border-radius:2px;'></div>");$(".J_onlineServiceNameHoverShow").mouseover(function(c){var d=this;var b=$(d).offset().left+12;var f=$(d).offset().top+30;a.html($(this).attr("_title")).css({left:(b||0),top:(f||0)}).show();$("body").append(a);setTimeout(function(){a.remove()},2000)}).mouseout(function(){a.remove()})};Site.onlineServiceWaWaIsOnline=function(){$(".J_aliWaWa").each(function(){var b=this;var a=$(b).attr("account");$(b).siblings(".serOnline-img").addClass("wawaImgOnline");if(a!=null&&typeof(a)!="undefined"){$.ajax({type:"post",dataType:"jsonp",url:"http://amos.alicdn.com/muliuserstatus.aw?beginnum=0&site=cnalichn&charset=utf-8&uids="+Fai.encodeUrl(a),success:function(c){if(c.data!=null){if(c.data[0]==0){$(b).addClass("serOnlineOffline");$(b).siblings(".serOnline-img").removeClass("wawaImgOnline");$(b).siblings(".serOnline-img").addClass("wawaImgOffline")}else{$(b).removeClass("serOnlineOffline")}}}})}});$(".J_taobaoWaWa ").each(function(){var b=this;var a=$(b).attr("account");$(b).siblings(".serOnline-img").addClass("wawaImgOnline");if(a!=null&&typeof(a)!="undefined"){$.ajax({type:"post",dataType:"jsonp",url:"http://amos.alicdn.com/muliuserstatus.aw?beginnum=0&site=cntaobao&charset=utf-8&uids="+Fai.encodeUrl(a),success:function(c){if(c.data!=null){if(c.data[0]==0){$(b).addClass("serOnlineOffline");$(b).siblings(".serOnline-img").removeClass("wawaImgOnline");$(b).siblings(".serOnline-img").addClass("wawaImgOffline")}else{$(b).removeClass("serOnlineOffline")}}}})}})};Site.loadProductSlide=function(a){var b=$(".slide");if(Fai.isNull(b)){return}var l=b.find(".imgDiv");var i=l.attr("faiWidth");var j=l.attr("faiHeight");var g=l.width();var d=l.height();var c=b.find(".imgGroupDiv");c.each(function(){var p=$(this).width();var r=$(this).height();var m=$(this).find("img");var o=m.attr("faiWidth");var q=m.attr("faiHeight");var n=Fai.Img.calcSize(o,q,p,r,Fai.Img.MODE_SCALE_FILL);m.css("width",n.width+"px");m.css("height",n.height+"px");m.css("display","block")});var h=Fai.Img.calcSize(i,j,g,d,Fai.Img.MODE_SCALE_DEFLATE_FILL);var e=l.find("img");e.css("width",h.width+"px");e.css("height",h.height+"px");e.css("display","block");var k=l.find(".cloud-zoom");if(k.length==1){k.attr("rel","adjustX:-4, adjustY:-4, maxWidth:"+g+", maxHeight:"+d+',position:"inside"');k.CloudZoom({imageHeight:j,imageWidth:i})}if(c.length>1){var f=(k.length==1)?"true":"false";Site.multiPhoto($("#imgDivs"+a),$("#imgDiv"+a),{leftIconID:"leftIcon"+a,rightIconID:"rightIcon"+a,zoom:f})}};Site.loadProductPicList=function(f,d,c,e,a){var b=$("#module"+f);if(Fai.isNull(b)){return}b.find(".productPicListForm").each(function(){var q=$(this).parent(".productList").attr("picwidth");var r=$(this).parent(".productList").attr("picheight");var p=$(this).attr("faiHeight");if(Fai.isNull(p)){return}var o=$(this).attr("faiWidth"),k=$(this).attr("faiWidthOr"),j=$(this).attr("faiHeightOr"),s=$(this).find(".imgDiv");var i=s.find("img");var n={width:q,height:r};if(d==2){var h=k/j,g=q/r;if(g<=h){o=h*r+"px";p=r+"px";i.css("width",h*r+"px");i.css("height",r+"px");i.css("marginLeft",((q-h*r)/2)+"px");s.css("overflow","hidden");s.css("height",n.height+"px");s.css("width",n.width+"px")}else{o=q;p=q/h;i.css("height",q/h+"px");i.css("width",q+"px");i.css("marginTop",((r-q/h)/2)+"px");s.css("overflow","hidden");s.css("height",n.height+"px");s.css("width",n.width+"px")}}else{if(typeof(d)=="number"&&(d==0)){n=Fai.Img.calcSize($(this).attr("faiWidthOr"),$(this).attr("faiHeightOr"),q,r,Fai.Img.MODE_SCALE_FILL);o=n.width;p=n.height;i.css("width",n.width+"px");i.css("height",n.height+"px");s.css("height",n.height+"px");i.css({marginTop:"",marginLeft:""});s.css("height",n.height+"px");s.css("width",n.width+"px")}else{if(typeof(d)!="number"&&d){if(c){q=o;r=p}n=Fai.Img.calcSize($(this).attr("faiWidthOr"),$(this).attr("faiHeightOr"),q,r,Fai.Img.MODE_SCALE_FILL);i.css("width",n.width+"px");i.css("height",n.height+"px");s.css("height",r+"px");i.css({marginTop:"",marginLeft:""})}else{i.css("width",n.width+"px");i.css("height",n.height+"px");i.css({marginTop:"",marginLeft:""});s.css("height",r+"px");s.css("width",q+"px")}}}if(typeof(d)!="number"&&!d&&!c){s.css("height","160px");s.css("width","160px");i.css("width","160px");i.css("height","160px");i.css({marginTop:"",marginLeft:""})}if(a==4||a==5||a==9){if($(this).find(".fifth_mallBuy").length>0){var m=$(this).find(".fifth_mallBuy");var l=$(this).find(".fifth_mallBuy").width();m.css({"line-height":l+"px",height:l+"px",width:l+"px"})}}});Site.initContentSplitLine(f,e)};Site.loadProductDoublePicList=function(g,f,d,a){var c=$("#module"+g);if(Fai.isNull(c)){return}var e=0;var b=0;c.find(".doubleProduct").each(function(){$(this).find(".productDoublePicListForm").each(function(){var s=$(this).attr("faiHeight");if(Fai.isNull(s)){return}var q=$(this).attr("faiWidth"),v=$(this).find(".imgDiv"),m=v.find("img"),w=$(this).find(".propList"),k=$(this).attr("faiwidthor"),r=$(this).attr("faiheightor");m.css("width",0);m.css("height",0);var u=v.width(),t=v.height();if(d){var l=$(this).attr("newWidth");var h=$(this).attr("newHeight");if(l&&h){u=l;t=h}else{u=q;t=s}}var p={width:u,height:t};if(f==2){var j=k/r,i=u/t;if(i<=j){m.css("width",j*t+"px");m.css("height",t+"px");m.css("marginLeft",((u-j*t)/2)+"px");v.css("overflow","hidden")}else{m.css("height",u/j+"px");m.css("width",u+"px");m.css("marginTop",((t-u/j)/2)+"px");v.css("overflow","hidden")}}else{if(typeof(f)=="number"&&(f==0)){p=Fai.Img.calcSize($(this).attr("faiWidthOr"),$(this).attr("faiHeightOr"),u,t,Fai.Img.MODE_SCALE_FILL);m.css("width",p.width+"px");m.css("height",p.height+"px");v.css("height",t+"px");m.css({marginTop:"",marginLeft:""})}else{if(typeof(f)!="number"&&f){p=Fai.Img.calcSize($(this).attr("faiWidthOr"),$(this).attr("faiHeightOr"),u,t,Fai.Img.MODE_SCALE_FILL)}m.css("width",p.width+"px");m.css("height",p.height+"px");v.css("height",t+"px");m.css({marginTop:"",marginLeft:""})}}if(Number(t)>Number(b)){if(Number(t)>Number(w.height())){b=t}else{b=w.height()}e=Number(b)+20+Number($(this).css("margin-top").replace("px",""))+Number($(this).css("margin-bottom").replace("px",""));$(this).parent().css("height",(e)+"px")}if(a==4||a==5||a==9){if($(this).find(".fifth_mallBuy").length>0){var o=$(this).find(".fifth_mallBuy");var n=$(this).find(".fifth_mallBuy").width();o.css({"line-height":n+"px",width:n+"px",height:n+"px"})}}});e=0;b=0})};Site.loadProductHotTextList=function(e,d,c,a){var b=$("#module"+e);if(Fai.isNull(b)){return}b.find(".productHotTextListHot").each(function(){var n=$(this).attr("faiHeight");if(Fai.isNull(n)){return}var m=$(this).attr("faiWidth");var q=$(this).find(".imgDiv");var o=q.width();var p=q.height();var h=$(this).attr("faiwidthor");imgHeightOr=$(this).attr("faiheightor");var i=q.find("img");var l={width:o,height:p};if(d==2){var g=h/imgHeightOr,f=o/p;if(f<=g){i.css("width",g*p+"px");i.css("height",p+"px");i.css("marginLeft",((o-g*p)/2)+"px");q.css({height:p+"px",width:p+"px"});q.css("overflow","hidden")}else{i.css("height",o/g+"px");i.css("width",o+"px");i.css("marginTop",((p-o/g)/2)+"px");q.css("overflow","hidden");q.css({height:p+"px",width:p+"px"})}}else{if(d==0){l=Fai.Img.calcSize($(this).attr("faiWidthOr"),$(this).attr("faiHeightOr"),o,p,Fai.Img.MODE_SCALE_FILL);i.css("width",l.width+"px");i.css("height",l.height+"px");q.css("height",l.height+"px");i.css("marginLeft","");i.css("marginTop","")}else{i.css("width",l.width+"px");i.css("height",l.height+"px");q.css("height",l.height+"px");i.css("marginLeft","");i.css("marginTop","")}}if(a==4||a==5||a==9){if($(this).find(".fifth_mallBuy").length>0){var k=$(this).find(".fifth_mallBuy");var j=$(this).find(".fifth_mallBuy").width();k.css({"line-height":j+"px",height:j+"px",width:j+"px"})}}});b.find(".productHotTextListTable").each(function(){var k=$(this).find("tr");for(var j=0;j<k.length;++j){var o=k[j];var h=$(o).find("td");$(h[1]).css("width","30%");var g=h.length;var p=100;p-=30;for(var f=2;f<g;++f){if(f==h.length-1){var m=$(h[f]).attr("buybtn");if(m){$(h[f]).css("width","15%");p-=15;break}}var l=parseInt(p/g);$(h[f]).css("width",l+"%")}}$(this).mouseover(function(){$(this).addClass("g_hover")}).mouseleave(function(){$(this).removeClass("g_hover")})});b.find(".productHotTextListProp").each(function(){var k=$(this).find("tr");for(var j=0;j<k.length;++j){var o=k[j];var h=$(o).find("td");$(h[1]).css({width:"30%","margin-left":"5px"});var g=h.length;var p=100;p-=30;for(var f=2;f<g;++f){if(f==h.length-1){var m=$(h[f]).attr("buybtn");if(m){$(h[f]).css({width:"15%","margin-right":"5px"});p-=15;break}}var l=parseInt(p/g);$(h[f]).css("width",l+"%")}}})};Site.unifiedAttrVal=function(b,d,a){var c=b.find(d);var e=0;c.each(function(){var f=$(this).css(a);f=parseInt(f);if(f>e){e=f}});c.each(function(){$(this).css(a,e+"px")})};Site.loadProductGallery=function(F){var G=new Date().getMilliseconds();var Y=F.id,V=F.scale,g=F.cus,z=F.paramLayoutType||"";var c=$("#module"+Y),D=c.find("div.product-container");var W=c.find(".product-gallery").attr("_bordertype");var e=parseInt(c.find(".product-gallery").attr("_borderwidth"));var af=c.find(".product-gallery").attr("_bgtype"),ae=Fai.top._manageMode?Site.getModuleAttrPattern(Y).productList.hnhc:F.heightCorrect;var o,d;if(F.effType>=4&&F.effType<6){if(z==6){Site.clearImageEffectContent_product(Y,"sixth_ProductPanel")}if(z==8){Site.clearImageEffectContent_product(Y,"eighth_ProductPanel")}Site.clearImageEffectContent_product(F.id,"prop-container")}if(D.length!=0){var al=$(D[0]).children("div.img-container"),p=al.width(),T=al.height();for(var an=0;an<D.length;an++){al=$(D[an]).children("div.img-container");var n=al.find("img"),O=n.attr("fHeight"),K=n.attr("fWidth");if(V==2){var ap=n.attr("fWidthOr"),M=n.attr("fHeightOr"),aj=ap/M,u=p/T;if(u<=aj){n.css("width",aj*T+"px");n.css("height",T+"px");n.css("marginLeft",((p-aj*T)/2)+"px");al.css("overflow","hidden")}else{n.css("height",p/aj+"px");n.css("width",p+"px");n.css("marginTop",((T-p/aj)/2)+"px");al.css("overflow","hidden")}}else{if(V==0){var m=Fai.Img.calcSize(K,O,p,T,Fai.Img.MODE_SCALE_FILL);n.width(m.width);n.height(m.height);o=m.width;d=m.height;n.css({marginTop:"",marginLeft:""})}else{n.width(p);n.height(T);o=p;d=T;n.css({marginTop:"",marginLeft:""})}}if(Fai.top._manageMode){n.data("realWidth",o);n.data("realHeight",d)}}var aa=c.find(".gallery-control"),s=c.find(".gallery-control-prev"),ag=c.find(".gallery-control-next"),X=s.height(),f=s.width();var l=D.first(),ah=l.children("div.img-container"),L=ah.outerWidth(true),y=ah.outerHeight(true),S=l.find("div.paramNewStyle"),ak=0,J=l.find("div.prop-container"),k=0;if(D.find(".fk-productName").length>0){D.find(".fk-productName").height("auto")}if(J.length>0){if(ae){$.each(J,function(j){if($(J[j]).is(":visible")){k+=$(J[j]).outerHeight(true)}})}else{$.each(J,function(j){k+=$(J[j]).outerHeight(true)})}}if(S.length>0){$.each(S,function(j){ak+=$(S[j]).outerHeight(true)})}var w=y+k+ak;D.height(w);D.width(L);if(z==6){D.find("div.prop-container").width(L*0.8);D.find(".sixth_ProductName").width("80%")}else{D.find("div.prop-container").width(L)}var I=c.find("div.product-gallery-preview");var a=c.find(".fk-productListForm").outerHeight()-c.find(".fk-productListForm").height();if(a>0){w+=a}I.height(w);var H=c.find("div.product-gallery-inner"),r=H.outerHeight();if(r<X){var Z=H.height(),ad=r-Z;var ac=Math.ceil((X-r)/2);var t=Math.ceil(ad/2)+ac;H.css("padding-top",t+"px").css("padding-bottom",t+"px")}var U=(H.outerHeight()/2)-(X/2);aa.css("top",U+"px");var b=1,ao=s.innerWidth()-f,N=c.find("div.formMiddleContent").width(),v=N-ao-(f*2),at=l.outerWidth(true),ai=l.outerWidth(),h=at-ai;if(v>at){b=parseInt(v/at)}var R=(b*at)-h;I.width(R);var ar=D.length;var A=ar%b==0?ar/b:Math.floor(ar/b)+1;c.find("div.product-gallery-container").width(ar*at);var q=D.length<b?D.length:b;for(var am=0;am<q;am++){var n=$(D[am]).find("img");if(!n.attr("src")){n.attr("src",n.attr("lzurl"))}n.show()}s.addClass("gallery-control-prev-disabled");if(A==1){ag.addClass("gallery-control-next-disabled")}s.click(function(){var x=$(this);if(x.hasClass("gallery-control-prev-disabled")){return false}var au=x.parent(),j=au.find("div.product-gallery-container"),av=au.find(".gallery-control-next");if(av.hasClass("gallery-control-next-disabled")){av.removeClass("gallery-control-next-disabled")}if(j.position().left==0||j.is(":animated")){return false}var i=c.find(".product-gallery-preview").width()+h;j.animate({left:"+="+i+"px"},function(){if(j.position().left==0){x.addClass("gallery-control-prev-disabled")}})});ag.click(function(){var az=$(this);if(az.hasClass("gallery-control-next-disabled")){return false}var au=az.parent(),i=au.find("div.product-gallery-container"),x=au.find(".gallery-control-prev");if(x.hasClass("gallery-control-prev-disabled")){x.removeClass("gallery-control-prev-disabled")}var aA=c.find(".product-gallery-preview").width()+h,aB=-(A-1)*(aA);left_position=parseInt(i.css("left").replace("px"));if(left_position==aB||i.is(":animated")){return false}if(!az.data("loading_finish")){var ay=(Math.abs(left_position)/(at*b))+1;var j=ay<=1?1*b:ay*b,aw=j+b>D.length?D.length:j+b;for(var av=j;av<aw;av++){var ax=$(D[av]).find("img");if(!ax.attr("src")){ax.attr("src",ax.attr("lzurl"))}ax.show()}}i.animate({left:"-="+aA+"px"},function(){var aC=parseInt(i.css("left").replace("px",""));if(aC==aB){az.data("loading_finish",true);az.addClass("gallery-control-next-disabled")}})})}else{var ab=c.find("div.addNoProTips");c.find("div.product-gallery").height(100).html(ab)}c.find(".product-container").each(function(){var x=$(this).find(".eighth_ProductPanel");var i=x.find(".eighth_Pricepanel");var j=x.find(".fk_rightPiecePanel");if(!!x.length){if(W==1){i.css("left","4px");j.css("right","16px")}else{if(W==2){i.css("left",(4+e)+"px");j.css("right",(16+e)+"px");x.css("bottom",(84+e)+"px")}}}});if(c.find(".prop-wordwrap-container").length>0){c.find(".product-container").height("auto");var B=0;var P=0;var aq=0;c.find(".product-container").each(function(){var i=$(this).height();P=$(this).outerHeight();if(i>B){B=i}if(P>aq){aq=P}});c.find(".product-container").each(function(){$(this).height(B)});c.find(".product-gallery-preview").height(aq);var H=c.find("div.product-gallery-inner"),aa=c.find(".gallery-control"),s=c.find(".gallery-control-prev"),X=s.height(),U=(H.outerHeight()/2)-(X/2);aa.css("top",U+"px")}if(z==6){var Q=0;c.find(".product-container").each(function(){var i=$(this).outerHeight();if(i>Q){Q=i}});if(c.find(".prop-wordwrap-container").length==0){c.find(".sixth_ProductPanel").css({bottom:"40px"})}else{c.find(".product-gallery-preview").height(Q+30);c.find(".sixth_ProductPanel").css({bottom:""})}c.find(".sixth_mallBuy").parent().height("auto")}if(D.length!=0){for(var an=0;an<D.length;an++){if($(D[an]).find(".fifth_mallBuy").length>0){var C=$(D[an]).find(".fifth_mallBuy");var E=$(D[an]).find(".fifth_mallBuy").width();C.css({"line-height":E+"px"})}}}if(c.find(".prop-wordwrap-container").length>0){Site.unifiedAttrVal(c,".prop-wordwrap-container","height")}};Site.loadProductSmallPic=function(D){var S=D.id,K=D.scale,g=D.cus,O=D.dataObjs,T=D.bigPicObjs,q=D.tmp_allow_marketprice,H=D.tmp_allow_price,o=D.tmp_allow_price_menberLevel,M=parseInt($(".productSmallPicForms").attr("_mallbuybtntype")),E=$(".productSmallPicForms").attr("_mallbuybtncolor"),U=D.bookingOpen;if(o){o="title = '"+o+"'"}var c=$("#"+S);var x=D.paramLayoutType;c.on("Fai_onModuleSizeChange",function(){Site.smallPicModuleFix(S)});c.on("Fai_onModuleLayoutChange",function(){Site.smallPicModuleFix(S)});var C=c.find("div.productSmallPicBox");var ag=c.find(".smallPicUpForms").height();var h=c.find(".smallPicDownForms").height();c.find(".productSmallPicForms").height(ag+h);var N=c.find(".productSmallPicForms").width();var b=c.find(".smallPic_control").outerWidth(true);var ad=N-b*2-c.find(".containerLeft").width();var W=ad>150?ad:150;c.find(".containerRight").width(W);c.find(".smallPicUpForms").css("width",N+"px");c.find(".smallPicDownForms").css("width",N+"px");var F=c.find(".smallPrePic_control").outerWidth(true);c.find(".smallPicDownFormsMid").css("width",N-2*F-20+"px");var m=c.find(".containerLeft").width()+c.find(".containerRight").width();c.find(".smallPicUpFormsMid").width(m);var af=c.find(".smallPrePicContainer");var Y=c.find(".smallPrePicOuter").outerWidth(true);var V=0;if(Fai.isIE6()){V=2}af.width(Y*C.length+V);var L=af.width();var aa=c.find(".smallPicUpFormsMid").outerHeight()/2-30;c.find(".smallPic_control").css("top",aa+"px");var w=c.find(".smallPicDownFormsMid").width();var ah=C.length;var s=Math.floor(w/Y)+1;var A=ah%s==0?ah/s:Math.floor(ah/s)+1;if(A==1&&w<af.width()){A=2}var p=C.length<s?C.length:s;for(var ab=0;ab<p;ab++){var l=$(C[ab]).find("img");Site.loadProductSmallPicItem(l)}var B="default";var I=true;var a=false;var G=false;var f=false;var Q=false;var u="style='cursor:pointer;";var Z="";var r="";var k=0;if(Fai.isIE6()||Fai._isIE7||(U&&M>=8)){M=0}switch(M){case 1:B="first";k=1;u+="border-radius:5px;height:33px;line-height:33px;";break;case 2:B="second";k=2;u+="border-radius:5px;height:31px;line-height:31px;";a=true;break;case 3:B="third";k=3;u+="border-radius:0px;height:33px;line-height:33px;";break;case 4:B="fourth";k=4;u+="border-radius:0px;height:31px;line-height:31px;";a=true;break;case 5:B="fifth";k=5;u+="border-radius:16px;height:33px;line-height:33px;";break;case 6:B="sixth";k=6;u+="border-radius:16px;height:31px;line-height:31px;";a=true;break;case 7:B="seventh";k=7;break;case 8:B="eight";k=8;a=true;break;case 9:B="nine";u+="border-radius:2px;min-height:46px;min-width:46px;display:table;";k=9;a=true;f=true;break;case 10:B="ten";u+="border-radius:2px;min-height:48px;min-width:48px;";k=10;G=true;break;case 11:B="eleven";u+="min-height:48px;min-width:48px;display:table;";k=11;a=true;f=true;break;case 12:B="twelve";u+="min-height:50px;min-width:50px;";k=12;G=true;break;case 13:B="thirteen";u+="display:table;";k=13;f=true;Q=true;break;default:I=false}var P=I?"fk-newMallBuyBtn":"fk-mallBuy";if(!I&&U){P="fk-mallBuy fk-bookingIcon"}var y="";var ae=Q?32:30;var e=(k>=7&&k<=13)?true:false;if(a){u+="background:none;border:1px solid "+E+";";y="style='color: "+E+";'"}else{if(!Q){u+="border:none;background-color: "+E+";";y="style='color: white;'"}}if(G){Z="fk-mallBgCar";y="style='color: "+E+";"}if(f){r="faisco-icons-mallBuyCar";y="style='color: "+E+";font-size: "+ae+"px;display:table-cell;";u+="color: "+E+";";if(k==11){y+="padding-top: 3px;"}if(k==13){y+="vertical-align:bottom;"}else{y+="vertical-align:middle;"}}if(Q){u+="border:none;background:none;"}if(x==2||x==3){u+="width:60%;"}y+="'";u=I?u+="'":"";var t=c.find(".smallPicDownForms .g_imgPrev"),X=c.find(".smallPicDownForms .g_imgNext"),R=c.find(".smallPicUpForms .g_control_prev"),i=c.find(".smallPicUpForms .g_control_next");t.addClass("smallPic-control-prev-disabled");if(A==1){X.addClass("smallPic-control-next-disabled")}R.addClass("bigPic-control-prev-disabled");if(ah==1){i.addClass("bigPic-control-next-disabled")}c.find(".smallPicUpForms").mouseover(function(){$(".smallPic_control").css("display","block")}).mouseleave(function(){$(".smallPic_control").css("display","none")});C.mouseover(function(){$(this).parent().addClass("smallPrePicOuterHover").addClass("g_border").addClass("g_borderHover")});C.mouseleave(function(){$(this).parent().removeClass("smallPrePicOuterHover").removeClass("g_borderHover").removeClass("g_border")});c.find(".smallPicUpFormsMid").mouseenter(function(){var j=$(this).parents(".form").attr("id");if(_manageMode==true){Site.initModuleProductSmallPicItemManage(j,D.productSelect,D.isOpenImgEff)}}).mouseleave(function(){var j=$(this).parents(".form");var ai=j.find("div.containerLeft");if(_manageMode==true){if(D.isOpenImgEff){Site.removeEditLayer(ai)}else{Site.removeEditLayer(ai,null,106)}}});t.click(ac);X.click(n);R.click(v);i.click(J);C.click(d);C.eq(0).click();z(c);function z(j){Site.updateThumbnailForSmallPicForms({$module:j,listCls:".smallPicDownForms",itemCls:".smallPrePicOuter"})}function ac(){var am=$(this);if(am.hasClass("smallPic-control-prev-disabled")){return false}var ai=am.parents(".smallPicDownForms").find(".smallPrePicContainer");var ao=Math.floor(c.find(".smallPicDownFormsMid").width()/Y)+1;var al=am.parents(".smallPicDownForms").find(".g_imgNext");if(al.hasClass("smallPic-control-next-disabled")){al.removeClass("smallPic-control-next-disabled")}var ak=parseInt(ai.css("left").replace("px"));var an=Math.abs(ak)/Y;var aj=an-ao+1>0?an-ao+1:0;if(aj==0){am.addClass("smallPic-control-prev-disabled")}var j=(an-aj)*Y;if(ai.is(":animated")){return false}ai.animate({left:"+="+j+"px"});z(c)}function n(){var au=$(this);var ak=$("#"+S);if(au.hasClass("smallPic-control-next-disabled")){return false}var j=au.parents(".smallPicDownForms").find(".smallPrePicContainer"),am=au.parents(".smallPicDownForms").find(".g_imgPrev"),al=Math.floor(ak.find(".smallPicDownFormsMid").width()/Y)+1;if(am.hasClass("smallPic-control-prev-disabled")){am.removeClass("smallPic-control-prev-disabled")}var av=(al-1)*Y,at=parseInt(j.css("left").replace("px"));var ar=Math.abs(at)/Y;var aw=ar+al-1>ah-1?ah-1:ar+al-1;var aq=ak.find(".smallPicDownFormsMid").width();if(j.is(":animated")){return false}var aj;var ai,ao;if(aw>=ah-1){ai=ar;ao=ah-1;if((ao-ai+1)*Y<=aq){aj=true;au.addClass("smallPic-control-next-disabled")}}else{ai=aw;ao=aw+al-1}for(var an=ai;an<=ao;an++){var ap=$(C[an]).find("img");Site.loadProductSmallPicItem(ap)}if(!aj){j.animate({left:"-="+av+"px"})}z(ak)}function v(){var am=$(this);if(am.hasClass("bigPic-control-prev-disabled")){return false}var ai=$("#"+S);var j=ai.find(".smallPicDownForms").find(".smallPrePicContainer");var ak=Math.floor(ai.find(".smallPicDownFormsMid").width()/Y)+1;var ap=ai.data("positionLeft");var al=Math.abs(ap)/Y;var ao=al+ak-1>ah-1?ah-1:al+ak-1;var an=ai.find(".smallPrePicSelected").parent();var aq=an.index();if(aq>=al&&aq<=ao){if(aq==al){ap+=Y}}else{ap=-(aq-1)*Y;j.css("left","0px")}if(j.is(":animated")){return false}$(".img_ProductPhoto_LR_Border").remove();$(".img_ProductPhoto_TB_Border").remove();$(".editLayer").remove();var aj=an.prev().find("div.productSmallPicBox");ai.find("div.containerLeft").attr("productId",aj.attr("proid")).attr("productName",aj.find("img").attr("productname")).attr("topClassName",aj.find("img").attr("classname")).attr("topSwitch",aj.find("img").attr("topswitch")).attr("id","containerLeft_ProdsmallPic"+aj.attr("proid"));j.animate({left:ap+"px"},function(){an.prev().find("div.productSmallPicBox").click()})}function J(){var am=$(this);if(am.hasClass("bigPic-control-next-disabled")){return false}var ai=$("#"+S);var j=$(".smallPicDownForms").find(".smallPrePicContainer");var ak=Math.floor(ai.find(".smallPicDownFormsMid").width()/Y)+1;var ap=ai.data("positionLeft");var al=Math.abs(ap)/Y;var ao=al+ak-1>ah-1?ah-1:al+ak-1;var an=ai.find(".smallPrePicSelected").parent();var aq=an.index();if(aq>=al&&aq<=ao){if(aq==ao){ap-=2*Y}}else{ap=-(aq-1)*Y;j.css("left","0px")}if(j.is(":animated")){return false}$(".img_ProductPhoto_LR_Border").remove();$(".img_ProductPhoto_TB_Border").remove();$(".editLayer").remove();var aj=an.next().find("div.productSmallPicBox");ai.find("div.containerLeft").attr("productId",aj.attr("proid")).attr("productName",aj.find("img").attr("productname")).attr("topClassName",aj.find("img").attr("classname")).attr("topSwitch",aj.find("img").attr("topswitch")).attr("id","containerLeft_ProdsmallPic"+aj.attr("proid"));j.animate({left:ap+"px"},function(){an.next().find("div.productSmallPicBox").click()})}function d(){var ay=$(this).find("img");Site.loadProductSmallPicItem($(this).parent().next().find("img"));Site.loadProductSmallPicItem(ay);var aq=$("#"+S);var al=aq.find(".smallPicUpFormsMid .containerLeft img");aq.find(".containerRight").children().remove();var aP=D.scale;var ap=$(this).parent();ap.siblings(".smallPrePicOuter").find("div.productSmallPicBox").removeClass("smallPrePicSelected");$(this).addClass("smallPrePicSelected");ap.siblings(".smallPrePicOuter").removeClass("smallPrePicOuterClick").removeClass("g_borderSelected");ap.addClass("smallPrePicOuterClick").addClass("g_borderSelected");var aI=aq.find("#bigImgDetail");aI.remove();aq.find(".smallPic_td").append(al);var a0=$(this).attr("proid");var a3=T[a0]["bigPicThumbPath"];var aw=T[a0]["bWidth"];var aA=T[a0]["bHeight"];var j=aq.find(".containerLeft").width(),an=aq.find(".containerLeft").height();if(aP==0){var ax=Fai.Img.calcSize(aw,aA,j,an,Fai.Img.MODE_SCALE_FILL);al.width(ax.width);al.height(ax.height)}else{al.css("width",j).css("height",an)}var aH=[];aH.push("<div class='loadingImg' style='width:"+j+"px;height:"+an+"px;'>");aH.push("<table cellspacing='0' cellpadding='0' class='loadingImgTable' style='width:"+j+"px;height:"+an+"px;'><tbody><tr><td class='loadingImgTd'>");aH.push("<div class='ajaxLoading2' style='margin:0 auto;'></div>");aH.push("</td></tr></tbody></table>");aH.push("</div>");aq.find(".smallPic_td").append(aH.join(""));var aX=al.attr("src");if(aX==a3){al.attr("src","")}al.attr("src",a3);al.css("margin","auto");var aD=ay.attr("alt");al.attr("alt",aD);aq.find(".containerLeft").height(aq.find(".containerLeft").height());aq.find(".containerLeft").css("overflow","hidden");var bh=$(this).find("img");var bf=bh.attr("ifcenter");var a9=bh.attr("ifshowname");var aN=bh.attr("ifwordwrap");var ar=bh.attr("ifmallbtn");var a4=bh.attr("aAttribute");var au=bh.attr("click");var aK=bh.attr("btntext");var bb=bh.attr("topswitch");if(_manageMode){if(bb=="off"&&!D.productSelect){aq.find(".J_productListTopFlag").text("置顶").addClass("f-productListTopFlag")}else{aq.find(".J_productListTopFlag").text("").removeClass("f-productListTopFlag")}}if(G){aK="&nbsp;"}else{if(f){aK=""}}al.wrap("<a id='bigImgDetail' "+a4+"></a>");var at="text-align:center";var ao="margin:0 auto;";if(bf=="false"){at="text-align:left";ao="margin-left:0;"}if(x==2){at="text-align:center"}if(x==3||x==4||x==5||x==9){at="text-align:left"}var a1="word-break:normal;white-space:normal;overflow:visible;text-overflow:clip";if(aN=="false"){a1="white-space:nowrap;overflow:hidden;text-overflow:ellipsis"}var aH=[];var aG=aq.find(".containerRight").width();aH.push("<div class='productParamContainer' style='width:"+aG+"px;"+ao+""+(x==4||x==9?"position:absolute;bottom:10px;":"")+"'>");if(a9=="true"){if(x==2){aH.push("<a "+a4+" title='"+$(this).find("img").attr("productname")+"' style='text-decoration:none;'><div class='second_ProductName fk-productName' style='width:"+(aG-20)+"px;"+a1+";'>"+Fai.encodeHtml($(this).find("img").attr("productname"))+"</div></a>");aH.push("<div class='dotted'></div>")}else{if(x==3){aH.push("<a "+a4+" title='"+$(this).find("img").attr("productname")+"' style='text-decoration:none;'><div class='third_ProductName fk-productName' style='width:"+(aG-20)+"px;"+a1+";'>"+Fai.encodeHtml($(this).find("img").attr("productname"))+"</div></a>")}else{if(x==4||x==9){aH.push("<a "+a4+" title='"+$(this).find("img").attr("productname")+"' style='text-decoration:none;'><div class='fourth_ProductName fk-productName' style='width:"+(aG-20)+"px;"+a1+";'>"+Fai.encodeHtml($(this).find("img").attr("productname"))+"</div></a>")}else{if(x==5){aH.push("<a "+a4+" title='"+$(this).find("img").attr("productname")+"' style='text-decoration:none;'><div class='fifth_ProductName fk_paramNewStyle5 fk-productName' style='width:"+(aG-20)+"px;"+a1+";'>"+Fai.encodeHtml($(this).find("img").attr("productname"))+"</div></a>")}else{aH.push("<a "+a4+" title='"+$(this).find("img").attr("productname")+"' style='text-decoration:none;'><div class='fk-productName' style='width:"+(aG-20)+"px;margin:auto;"+at+";margin-top:20px;margin-bottom:8px;"+a1+";'>"+Fai.encodeHtml($(this).find("img").attr("productname"))+"</div></a>")}}}}}var av=O[a0];var ba=O.lcid.lcid;var ak=O.lcid._isLogin;var a6="";var aT="";var bi=false;var aO=false;var aL="";var aj="";var aB="";for(var a8=0;a8<av.length;a8++){var bd=av[a8];var a7=bd.vip,aC=bd.name,a2=bd.value,bg=bd.type,aW=bd.title;aj="";var a5="";var ai=aW?"title = "+aW:"";if(bg==12){if(x==2||x==3||x==4||x==5||x==9){aO=true;aT=a2;continue}a5="g_minor mallMarketPrice fk-prop-marketprice"}if(bg==11&&a7){aB=aC;aj=" g_stress"}if(bg==11){if(x==2||x==3||x==4||x==5||x==9){bi=true;a6=a2;continue}a5="g_stress mallPrice fk-prop-price"}if(bg==17){a5=" fk-prop-sales"}else{if(bg==13){a5=" fk-prop-amount"}else{if(bg!=11&&bg!=12){a5=" fk-prop-other"}}}aH.push("<div class='"+(x==5?"fk_paramNewStyle5":"")+"' style='"+(x==2||x==3?"color:#767676;":"")+" margin:auto;height:20px;line-height:20px;padding: 5px 0;width:"+(aG-20)+"px;"+at+";text-overflow:ellipsis;white-space:nowrap;overflow:hidden;'>");if(D.propNameShow||(bg==11&&a7)){aH.push("<span class='fk-prop-name"+aj+"'>"+aC+":</span>")}aH.push("<span class='"+a5+"' "+ai+">"+a2+"</span>");aH.push("</div>")}if((x==2||x==3)&&(bi||aO)){aH.push("<div class='g_stress fk_productSmallPicPiece second_Pricepanel' style='"+(x==3?"text-align:left;":"text-align:center;")+"'>");if(bi){if(H){if(aB=="会员价"){aH.push("<span class='fk-prop-name g_stress'>"+aB+":</span>")}else{if(aB=="VIP"){aH.push("<div class='vip-show-dashed g_borderSelected g_stress'>VIP</div>")}}aH.push("<span class='fk-prop-price-other'>"+a6.slice(0,1)+"</span>");aH.push("<span class='second_Price fk-prop-price'>"+(a6.slice(1)).split(".")[0]+"<span class='fk-prop-price-other priceDecimal'>."+(a6.slice(1)).split(".")[1]+"</span></span>")}else{aH.push("<span class='fk-prop-price second_Price' style='margin:0;'>价格:</span>\n");aH.push("<span class='propValue' "+o+">"+a6+"</span>\n")}}if(aO){if(q){aH.push("<span class='second_Marketprice fk-prop-marketprice'>"+aT.slice(0,1)+""+aT.slice(1)+"</span>")}}aH.push("</div>")}if(x==4||x==9){if(e){aL="fk_fifth_mallBuy"}else{aL="fk_fourth_mallBuy"}aH.push("<div style='width: 100%; display: inline-block;text-align:left; margin-left:10px; padding-top:6px;'>");aH.push("<div style='width:"+((bi&&H)?"55%":"100%")+";display:inline-block;'>");if(bi&&H){aH.push("<div style='display:inline-block; width:auto;'>");if(aB=="会员价"){aH.push("<span class='fk-prop-name g_stress'>"+aB+":</span>")}else{if(aB=="VIP"){aH.push("<div class='vip-show-dashed g_borderSelected g_stress'>VIP</div>")}}aH.push("</div>")}aH.push("<div class='g_stress fk_productSmallPicPiece fourth_Pricepanel' style='display:inline;'>");if(bi){if(H){aH.push("<span class='fk-prop-price-other'>"+a6.slice(0,1)+"</span>");aH.push("<span class='fourth_Price fk-prop-price'>"+(a6.slice(1)).split(".")[0]+"<span class='fk-prop-price-other priceDecimal'>."+(a6.slice(1)).split(".")[1]+"</span></span>")}else{aH.push("<span class='fk-prop-price fourth_Price' style='margin:0;'>价格:</span>\n");aH.push("<span class='propValue'"+o+">"+a6+"</span>\n")}}if(aO){if(q){aH.push("<span class='fourth_Marketprice fk-prop-marketprice'>"+aT.slice(0,1)+""+aT.slice(1)+"</span>")}}aH.push("</div>");aH.push("</div>");if(ar=="true"){if(e){aH.push("<div style='position:absolute; display: inline-block; width: 30%; right:0;"+(Q?"bottom:6px;":"bottom:12px;")+at+";text-overflow:ellipsis;white-space:nowrap;overflow:hidden;'>")}else{aH.push("<div style='position:absolute; display: inline-block; width: 40%; bottom:6px; "+(a?"right:2px;":"right:0;overflow:hidden;")+" height:29px;line-height:29px;padding: 5px 0;"+at+";text-overflow:ellipsis;white-space:nowrap;'>")}aH.push("<a hidefocus='true' class='"+aL+" "+P+" fk-"+B+"BtnStyle "+Z+"' "+a4+" "+u+">\n");aH.push("<span "+y+" class='"+r+"' >"+aK+"</span>\n");aH.push("</a>");aH.push("</div>")}aH.push("</div>")}if(x==5){if(e||!I){aL="fk_fifth_mallBuy"}else{aL="fk_fourth_mallBuy"}aH.push("<div class='fk_mallbuy5' style='width: 100%; display: inline-block; position:relative; height:"+((bi&&H)?"auto":"60px")+";'>");aH.push("<div style='width:"+((bi&&H&&aB=="会员价")?"80%":"100%")+";text-align:left;padding-left:10px;display:inline-block;'>");if(bi&&H&&aB=="会员价"){aH.push("<div style='width:auto;margin-bottom:3px;text-align:left;display:inline-block;'>");aH.push("<span class='fk-prop-name g_stress'>"+aB+":</span></div>")}aH.push("<div class='g_stress fk_productSmallPicPiece fifth_Pricepanel' style='display:inline;'>");if(bi){if(H){aH.push("<span class='fk-prop-price-other'>"+a6.slice(0,1)+"</span>");aH.push("<span class='fifth_Price fk-prop-price'>"+(a6.slice(1)).split(".")[0]+"<span class='fk-prop-price-other priceDecimal'>."+(a6.slice(1)).split(".")[1]+"</span></span>")}else{aH.push("<span class='fk-prop-price fifth_Price' style='margin:0;'>价格:</span>\n");aH.push("<span class='propValue'"+o+">"+a6+"</span>\n")}}if(aO){if(q){aH.push("<span class='fifth_Marketprice fk-prop-marketprice'>"+aT.slice(0,1)+""+aT.slice(1)+"</span>")}}aH.push("</div>");aH.push("</div>");if(ar=="true"){if(e||!I){aH.push("<div style='position:absolute; display: inline-block; width: 30%; right:0;"+(Q?"bottom:2px;":"bottom:8px;")+at+";text-overflow:ellipsis;white-space:nowrap;overflow:hidden;'>")}else{aH.push("<div style='position:absolute; display: inline-block; width: 40%; bottom:6px; "+(a?"right:2px;":"right:0;overflow:hidden;")+" height:29px;line-height:29px;padding: 5px 0;"+at+";text-overflow:ellipsis;white-space:nowrap;'>")}aH.push("<a hidefocus='true' class='"+aL+" "+P+" fk-"+B+"BtnStyle "+Z+"' "+a4+" "+u+">\n");aH.push("<span "+y+" class='"+r+"' >"+aK+"</span>\n");aH.push("</a>");aH.push("</div>")}aH.push("</div>")}if(ar=="true"&&x!=4&&x!=5&&x!=9){if(x==3){aL="fk_third_mallBuy"}if(x==1){aH.push("<div style='margin-left:9px;height: auto;padding: 5px 0;width:"+(aG-20)+"px;"+at+";text-overflow:ellipsis;white-space:nowrap;overflow:hidden;'>");aH.push("<a hidefocus='true' class='fk_first_mallBuy "+P+" "+B+"BtnStyle' "+a4+" "+u+">\n");aH.push("<span "+y+">"+aK+"</span>\n");aH.push("</a>")}if(x!=2&&x!=1){aH.push("<div style='margin-left:9px;height:36px;line-height:36px;padding: 5px 0;width:"+(aG-20)+"px;"+at+";text-overflow:ellipsis;white-space:nowrap;overflow:hidden;'>");aH.push("<a hidefocus='true' class='"+aL+" "+ +P+" "+B+"BtnStyle' "+a4+" "+u+">");aH.push("<span "+y+">"+aK+"</span>\n");aH.push("</a>")}aH.push("</div>")}if(ar=="true"&&x==2){if(x==2){aL="fk_second_mallBuy"}aH.push("<div style='display: inline-block; bottom: 0; position: absolute;'>");aH.push("<div style='margin-left:9px;height:36px;line-height:36px;padding: 5px 0;width:"+(aG-20)+"px;"+at+";text-overflow:ellipsis;white-space:nowrap;overflow:hidden;'>");aH.push("<a hidefocus='true' class='"+aL+" "+ +P+" "+B+"BtnStyle' "+a4+" "+u+">");aH.push("<span "+y+">"+aK+"</span>\n");aH.push("</a>");aH.push("</div>")}aH.push("</div>");aq.find(".containerRight").append(aH.join(""));var bc=aq.find(".smallPrePicSelected").parent().index();R.removeClass("bigPic-control-prev-disabled");i.removeClass("bigPic-control-next-disabled");t.removeClass("smallPic-control-prev-disabled");X.removeClass("smallPic-control-next-disabled");var aY=aq.find(".smallPicDownForms").find(".smallPrePicContainer");var be=parseInt(aY.css("left").replace("px"));var aZ=Math.abs(be)/Y;var aR=aZ+s-1>ah-1?ah-1:aZ+s-1;var aE=aq.find(".smallPicDownFormsMid").width();var aM,aF;if(bc==0){R.addClass("bigPic-control-prev-disabled");if(be==0){t.addClass("smallPic-control-prev-disabled")}}if(bc==(ah-1)){i.addClass("bigPic-control-next-disabled");aM=aZ;aF=ah-1;if((aF-aM+1)*Y<=aE&&be>=(ah-s-1)*Y){X.addClass("smallPic-control-next-disabled")}}aq.data("positionLeft",be);aq.find("div.containerLeft").attr("productId",a0).attr("productName",ay.attr("productname")).attr("topClassName",ay.attr("classname")).attr("topSwitch",ay.attr("topswitch")).attr("id","containerLeft_ProdsmallPic"+a0);if(x==5||x==4||x==9){var az=$(".fk_fifth_mallBuy");var aJ=$(".fk_fifth_mallBuy").width();az.css({"line-height":aJ+"px",height:aJ+"px"});var aV=$(".fk_paramNewStyle5");var aQ=$(".fk_mallbuy5").height();var am=$(".smallPicUpFormsMid").find(".containerRight").height();var aU=0;var aS=0;$.each(aV,function(bj){aS+=$(aV[bj]).outerHeight(true)});aU=am-aS-aQ;$(".fk_mallbuy5").css({"margin-top":aU+"px"})}z(aq)}};Site.fixProductMallPosition=function(g,e,d){var e=e||"";var d=d||"";var f=$("#module"+g).find("."+e);var c=$("#module"+g).find(".productListForms");var a=c.length?c.attr("_mallbuybtntype"):-1;var b=false;if(d==4||d==9){if(a>6){b=true}}else{if(d==5){if(a>6||a==0){b=true}}}f.each(function(){var j=$(this).height();var h=$(this).find(".propList").find(".propDiv");var k=$(this).width()/2;var i=$(this).find(".propList").find(".fifth_ProductName a").width();if(d==2||d==3||d==5||d==9||b){if($(this).find(".propList").find(".paramNewStyle").length>0){$(this).find(".propList").find(".paramNewStyle").css({"margin-top":"40px"})}if($(this).find(".imgDiv").length>0){if($(".productPicListForm").attr("faiwidth")<k){$(this).find(".imgDiv").css({width:"50%"})}$(this).find(".imgDiv").find("td").css({"vertical-align":"middle"})}if($(this).find(".propList").length>0){$(this).find(".propList").css({"vertical-align":"middle"})}}})};Site.removeProductSmallPicMask=function(a){$("#module"+a).find(".loadingImg").remove()};Site.loadProductSmallPicItem=function(d){if(!d.attr("src")){d.attr("src",d.attr("lzurl"))}var e=parseInt(d.attr("sWidth")),b=parseInt(d.attr("sHeight"));var a=e>b?e:b;var c=e>b?"width":"height";if(a>71){d.css(c,71)}else{d.css("width",e).css("height",b)}d.show()};Site.smallPicModuleFix=function(w){var e=$("#"+w),g=e.find("div.productSmallPicBox");var n=e.find(".productSmallPicForms").width();var f=e.find(".smallPic_control").outerWidth(true);var d=n-f*2-e.find(".containerLeft").width();var b=d>150?d:150;e.find(".containerRight").width(b);e.find(".smallPicUpForms").css("width",n+"px");e.find(".smallPicDownForms").css("width",n+"px");var p=e.find(".smallPrePic_control").outerWidth(true);e.find(".smallPicDownFormsMid").css("width",n-2*p-20+"px");var t=e.find(".containerLeft").width()+e.find(".containerRight").width();$(".smallPicUpFormsMid").width(t);var l=e.find(".smallPrePicContainer");var a=$(".smallPrePicOuter").outerWidth(true);var x=0;if(Fai.isIE6()){x=2}l.width(a*g.length+x);var h=l.width();var c=e.find(".smallPicDownFormsMid").width();var u=g.length;var m=Math.floor(c/a)+1;var v=u%m==0?u/m:Math.floor(u/m)+1;if(v==1&&c<l.width()){v=2}var q=e.find(".smallPicDownForms .g_imgPrev"),r=e.find(".smallPicDownForms .g_imgNext"),i=e.find(".smallPicUpForms .g_control_prev"),k=e.find(".smallPicUpForms .g_control_next");if(v==1){q.addClass("smallPic-control-prev-disabled");r.addClass("smallPic-control-next-disabled")}var o=g.length<m?g.length:m;for(var s=0;s<o;s++){var y=$(g[s]).find("img");if(!y.attr("src")){Site.loadProductSmallPicItem(y)}}e.find(".smallPrePicSelected").click()};Site.productInfoSwitchClick=function(a,h){var g=1,f=1,e=(!Fai.top._isTemplateVersion2&&h)?" selected fk_productDetailBorderSelect":" selected g_borderSelected fk_productDetailBorderSelect",c,d;d=$("#pdInfoSwitchTable");d.find(".tabSwitch").removeClass("selected g_borderSelected fk-mainBorderColor fk-mainFontColor fk_productDetailBorderSelect");d.find(".tabSwitch div").removeClass("pdNoBottomBorder");d.find(".J_tabTitleWrap").removeClass("f-tabTitleWrap f-tabTitleWrap2");if(h){g=0;f=0;$("#pdInfoSwitchTable .J_paramBorder").show()}else{$("#pdInfoSwitchTable .tabSwitch:last").css({"border-right-width":g+"px"});$("#pdInfoSwitchTable .tabSwitch").css({"border-left-width":f+"px"})}var b=0;if(a=="comm"){c=$("#accComSwitch");$("#msgBoardCaptchaImg").attr({src:"validateCode.jsp?"+Math.random()*1000});c.addClass(e);$(".selected div").addClass("pdNoBottomBorder");if(h){c.addClass("fk-mainBorderColor fk-mainFontColor")}$("#detailedDesc").hide();$("#saleRecordPanel").hide();$("#accumulativeComment").show();if(h){c.prev(".J_paramBorder ").hide();c.next(".J_paramBorder ").hide();if(c.index(".tabSwitch")==0){c.find(".J_tabTitleWrap").addClass("f-tabTitleWrap2")}else{c.find(".J_tabTitleWrap").addClass("f-tabTitleWrap")}}else{c.next().css({"border-left-width":"0"})}$("#pdInfoSwitchTable .tabSwitch").each(function(i){if($(this).attr("id")=="accComSwitch"){b=i;return true}})}else{if(a=="detail"){c=$("#detDescSwitch");c.addClass(e);$(".selected div").addClass("pdNoBottomBorder");if(h){c.addClass("fk-mainBorderColor fk-mainFontColor")}$("#accumulativeComment").hide();$("#saleRecordPanel").hide();$("#detailedDesc").show();if(h){c.prev(".J_paramBorder ").hide();c.next(".J_paramBorder ").hide();if(c.index(".tabSwitch")==0){c.find(".J_tabTitleWrap").addClass("f-tabTitleWrap2")}else{c.find(".J_tabTitleWrap").addClass("f-tabTitleWrap")}}else{c.next().css({"border-left-width":"0"})}$("#pdInfoSwitchTable .tabSwitch").each(function(i){if($(this).attr("id")=="detDescSwitch"){b=i;return true}})}else{if(a=="sale"){c=$("#saleRecordSwitch");c.addClass(e);$(".selected div").addClass("pdNoBottomBorder");if(h){c.addClass("fk-mainBorderColor fk-mainFontColor")}$("#accumulativeComment").hide();$("#detailedDesc").hide();$("#saleRecordPanel").show();if(h){c.prev(".J_paramBorder ").hide();c.next(".J_paramBorder ").hide();if(c.index(".tabSwitch")==0){c.find(".J_tabTitleWrap").addClass("f-tabTitleWrap2")}else{c.find(".J_tabTitleWrap").addClass("f-tabTitleWrap")}}else{c.next().css({"border-left-width":"0"})}$("#pdInfoSwitchTable .tabSwitch").each(function(i){if($(this).attr("id")=="saleRecordSwitch"){b=i;return true}})}}}document.cookie="tabSwitch="+b;Fai.refreshClass($("body"))};Site.initModuleProductCommentItemManage=function(b,a){Fai.top.$("#"+b).mouseover(function(){Site.addEditLayer(b,a,1)}).mouseleave(function(){Site.removeEditLayer(b)})};Site.siteCommImgFileUpload=function(b,d,f,a,g){if(!Fai.isIE()){Site.siteCommImgFileUploadH5(b,d,f,a,g);return}var e=f.split(",");var c={file_post_name:"Filedata",upload_url:"/ajax/commUpsiteimg_h.jsp",button_placeholder_id:d,file_size_limit:b+"MB",button_image_type:3,file_queue_limit:a,button_width:"50px",button_height:"50px",button_cursor:SWFUpload.CURSOR.HAND,button_image_url:_resRoot+"/image/site/msgUpImg/upload1.jpg",requeue_on_error:false,post_params:{ctrl:"Filedata",app:21,type:0,fileUploadLimit:5,isSiteForm:true},file_types:e.join(";"),file_dialog_complete_handler:function(h){this._allSuccess=false;this.startUpload()},file_queue_error_handler:function(i,h,j){switch(h){case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:Fai.ing(LS.siteFormSubmitCheckFileSizeErr,true);break;case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:Fai.ing(LS.siteFormSubmitFileUploadNotAllow,true);break;case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED:Fai.ing(Fai.format(LS.siteFormSubmitFileUploadOneTimeNum,a),true);break;default:Fai.ing(LS.siteFormSubmitFileUploadReSelect,true);break}},upload_success_handler:function(i,h){var j=jQuery.parseJSON(h);this._allSuccess=j.success;this._sysResult=j.msg;if(j.success){Fai.ing(Fai.format(LS.siteFormSubmitFileUploadSucess,Fai.encodeHtml(i.name)),true);onFileUploadEvent("upload",j)}else{Fai.ing(LS.siteFormSubmitFileUploadFile+i.name+" "+j.msg)}},upload_error_handler:function(i,h,j){if(h==-280){Fai.ing(LS.siteFormSubmitFileUploadFileCancle,false)}else{if(h==-270){Fai.ing(Fai.format(LS.siteFormSubmitFileUploadFileExist,Fai.encodeHtml(i.name)),true)}else{Fai.ing(Fai.format(LS.siteFormSubmitFileUploadSvrBusy,Fai.encodeHtml(i.name)))}}},upload_complete_handler:function(i){if(i.filestatus==SWFUpload.FILE_STATUS.COMPLETE){if(a==null||typeof(a)=="undefined"){a=5}var j=$("#msgBoardAddImgTb").eq(0);var h=j.find("td").length;if(h>=(a+1)){Fai.ing(LS.siteFormSubmitFileUploadOfMax,true);var k=j.find("td").eq(j.find("td").length-1);k.css("display","none");return}setTimeout(function(){swfObj.startUpload()},swfObj.upload_delay)}else{if(i.filestatus==SWFUpload.FILE_STATUS.ERROR){Fai.ing(Fai.format(LS.siteFormSubmitFileUploadSvrBusy,Fai.encodeHtml(i.name)))}}},upload_start_handler:function(h){Fai.enablePopupWindowBtn(0,"save",false);Fai.ing(LS.siteFormSubmitFileUploadPrepare,false)},view_progress:function(h,k,j,i){Fai.ing(LS.siteFormSubmitFileUploadIng+i+"%",false)}};if(g){c.button_image_url=_resRoot+"/image/site/msgUpImg/add.png";$(".f-upCommImgName").css("margin-top",0)}swfObj=SWFUploadCreator.create(c);onFileUploadEvent=function(p,m){if(p=="upload"){var j=m.id;var o=m.name;var l=m.size;var k=m.path;var q=m.pathSmall;var i=m.fileId;var h=m.width;var n=m.height;Site.productCommImgTableCtrl(q,o,j,l,a,i,g)}}};Site.siteCommImgFileUploadH5=function(b,d,g,a,h){var e=g.split(",");var c={siteFree:false,updateUrlViewRes:"",auto:true,fileTypeExts:e.join(";"),multi:false,fileSizeLimit:b*1024*1024,fileSplitSize:20*1024*1024,breakPoints:true,saveInfoLocal:false,showUploadedPercent:false,showUploadedSize:false,removeTimeout:9999999,post_params:{app:21,type:0,fileUploadLimit:b,isSiteForm:true},isBurst:false,isDefinedButton:true,buttonText:"",uploader:"/ajax/commUpsiteimg_h.jsp?cmd=mobiUpload&_TOKEN="+$("#_TOKEN").attr("value"),onUploadSuccess:function(i,k){var j=jQuery.parseJSON(k);if(j.success){onFileUploadEvent("upload",j);setTimeout(function(){Fai.ing("文件上传成功",true)},2000)}else{Fai.ing("文件:"+i.name+","+j.msg)}},onUploadError:function(i,j){$("#progressBody_ "+i.id).remove();$("#progressWrap_"+i.id).remove();Fai.ing("网络繁忙,文件:"+i.name+"上传失败,请稍后重试")},onSelect:function(){if(a==null||typeof(a)=="undefined"){a=5}var j=$("#msgBoardAddImgTb").eq(0);var i=j.find("td").length;if(i>=(a+1)){Fai.ing(LS.siteFormSubmitFileUploadOfMax,true);var k=j.find("td").eq(j.find("td").length-1);k.css("display","none");return false}return true},onUploadStart:function(i){$("#progressBody_ "+i.id).remove();$("#progressWrap_"+i.id).remove()}};var f=$("#"+d).uploadify(c);if(h){$("#comm-img-swfu-placeholder .uploadify-button").css("background-image","url("+_resRoot+"/image/site/msgUpImg/add.png)")}onFileUploadEvent=function(q,n){if(q=="upload"){var k=n.id;var p=n.name;var m=n.size;var l=n.path;var r=n.pathSmall;var j=n.fileId;var i=n.width;var o=n.height;Site.productCommImgTableCtrl(r,p,k,m,a,j,h)}}};Site.commUpAllImgList=null;Site.setCommUpAllImgList=function(a){Site.commUpAllImgList=Fai.fkEval("("+a+")");if(Fai.isIE6()||Fai.isIE7()){$(".msgBoard_upImg_border").css({width:"50px",height:"50px"})}$(function(){setTimeout(function(){var c=$(".J_countRecSize");if(typeof(c)!="undefined"&&c!=null){for(var e=0;e<c.length;e++){var f=c[e];var d=f.getBoundingClientRect().right;var g=$(f).parent().parent().parent().parent().find(".msgBoard_msgUser_level");if(typeof(g)!="undefined"&&g!=null&&g.width()!=null){var b=g[0].getBoundingClientRect().left;var h=b-d-5;g.css("margin-left","-"+h+"px")}}}},200)})};Site.productCommImgTableCtrl=function(l,a,b,i,c,d,e){var j=$("#msgBoardAddImgTb").eq(0);var k=j.find("td").length;var g=j.find("td").eq(k-1),f=(k)+"/"+c;if(e){f="还可上传"+(c-k)+"张图片,每张不超过5M,支持格式jpg,jpeg,bmp,png,gif"}g.find(".msgBoard_showImgCount").html(f);var h=[];h.push("<td class='msgBoard_upImg_tb_td2'>");if(Fai.isIE6()||Fai.isIE7()){h.push("<div class='msgBoard_upImg_border' style='width:50px !important;height:50px !important;'>")}else{h.push("<div class='msgBoard_upImg_border'>")}h.push("<span onclick='Site.productCommImgDelete(this)' class='msgBoard_upImgTop_set'/>");if(Fai.isIE6()||Fai.isIE7()){h.push("<div><p><img alt='' class='msgBoard_upImg_set' src='"+l+"' _name='"+a+"' _id='"+b+"' _file_size='"+i+"' _file_id='"+d+"'></p></div>")}else{h.push("<div><p><img alt='' class='msgBoard_upImg_set' src='"+l+"' _name='"+a+"' _id='"+b+"' _file_size='"+i+"' _file_id='"+d+"' style='margin-left:-1px;'></p></div>")}h.push("</div>");h.push("</td>");g.before(h.join(""))};Site.productCommImgDelete=function(a){var d=$("#msgBoardAddImgTb").eq(0);var b=d.find("td").length;for(var c=0;c<b;c++){if(d.find("td").eq(c).find(".msgBoard_upImgTop_set")[0]===a){d.find("td").eq(c).remove();break}}b=d.find("td").length;var e=d.find("td").eq(b-1);e.find(".msgBoard_showImgCount").html((b-1)+"/"+e.attr("maxNum"));if(b<=e.attr("maxNum")){if(Fai.isIE6()||Fai.isIE7()){e.css({display:"block","padding-top":"7px"})}else{if(Fai.isIE()){e.css({display:"block","padding-top":"8px"})}else{e.css({display:"block","padding-top":"10px"})}}}};Site.showCommImgList=function(k,o,c,h,b,j){var e=$("#"+c),g=(typeof j=="number"&&j==5);if(e!=null&&typeof(e)!="undefined"){e.remove()}var n=$("#"+k);var f=n.parent().parent().parent().parent().parent().parent().parent();f.attr("chooseTr",h);f.attr("chooseTd",b);var d=f.find("td");d.find(".show_msg_border_rect").remove();var m="<div class='show_msg_border_rect'><div class='show_msg_triangle_down'></div></div>";d.eq(b).prepend(m);var a=[];a.push("<div id='"+c+"' class='show_msg_outer_div'>");a.push("<span onclick=Site.commShowPicClose('"+c+"','"+k+"',"+g+") class='msg_close_show_img_icon'/>");if(Fai.isIE6()||Fai.isIE7()){a.push("<div class='show_msg_bordered_div' style='width:298px !important;'></div>");a.push("<div class='show_msg_border_div' style='width:299px !important;'>")}else{a.push("<div class='show_msg_bordered_div' style='width:299px;'></div>");a.push("<div class='show_msg_border_div' style='margin-left:1px;'>")}a.push("<div><p><img alt='' class='msg_up_show_img_set' src='"+o+"'></p></div>");a.push("</div>");a.push("</div>");f.after(a.join(""));if(!g){setTimeout(function(){$("#"+c).hover(function(){l()},function(){var p=$("#"+c);if(Fai.isIE7()){setTimeout(function(){p.find("#J_showCommPicMoveSign").remove()},500)}else{p.find("#J_showCommPicMoveSign").remove()}})},10)}else{f.hide();i()}function l(){var p=$("#"+c);if(p.find("#J_showCommPicMoveSign").attr("class")==null||typeof(p.find("#J_showCommPicMoveSign").attr("class"))=="undefined"){var q=[];q.push("<div id='J_showCommPicMoveSign'>");q.push("<img alt='' class='showCommPicMoveLeftClickArea' onclick=Site.showCommImgMove('"+k+"','"+c+"','left')>");q.push("<img alt='' src='"+_resRoot+"/image/site/msgUpImg/mLeft.png' onclick=Site.showCommImgMove('"+k+"','"+c+"','left') class='showCommPicMoveLeft'>");q.push("<img alt='' class='showCommPicMoveRightClickArea' onclick=Site.showCommImgMove('"+k+"','"+c+"','right')>");q.push("<img alt='' src='"+_resRoot+"/image/site/msgUpImg/mRight.png' onclick=Site.showCommImgMove('"+k+"','"+c+"','right') class='showCommPicMoveRight'>");q.push("</div>");p.prepend(q.join(""))}}function i(){var p=$("#"+c);if(p.find("#J_showCommPicMoveSign").attr("class")==null||typeof(p.find("#J_showCommPicMoveSign").attr("class"))=="undefined"){var q=[];q.push("<div id='J_showCommPicMoveSign' class='fk-commPicAreaPage'>");q.push("<div class='f-pageLeft' onclick=\"Site.showCommImgMove('"+k+"','"+c+"','left');\"></div>");q.push("<div class='f-pageRight' onclick=\"Site.showCommImgMove('"+k+"','"+c+"','right')\";></div>");q.push("</div>");p.prepend(q.join(""))}}};Site.showCommImgMove=function(g,a,f){if(g==null||f==null){return}var i=$("#"+g);var c=i.parent().parent().parent().parent().parent().parent().parent();currentChooseTr=c.attr("chooseTr");currentChooseTd=c.attr("chooseTd");if(currentChooseTr==null||currentChooseTd==null){return}if(Site.commUpAllImgList==null){return}var b=c.find("td");var e=parseInt(b.length);if(e<=1){return}var j=0;if(f=="left"){if(currentChooseTd=="0"||currentChooseTd==0){j=e-1}else{j=parseInt(currentChooseTd)-1}}else{if(f=="right"){j=parseInt(currentChooseTd)+1;if(j>=Site.commUpAllImgList[currentChooseTr].data.length){j=0}}}b.eq(currentChooseTd).find(".show_msg_border_rect").remove();var h="<div class='show_msg_border_rect'><div class='show_msg_triangle_down'></div></div>";b.eq(j).prepend(h);c.attr("chooseTd",j);var d=$("#"+a).find(".msg_up_show_img_set").parent();$("#"+a).find(".msg_up_show_img_set").remove();d.append("<img alt='' class='msg_up_show_img_set' src='"+Site.commUpAllImgList[currentChooseTr].data[j].data+"'>")};Site.commShowPicClose=function(c,b,f){var a=$("#"+c),e;if(a!=null&&typeof(a)!="undefined"){a.remove()}var d=$("#"+b);if(!f){e=d.parent().parent().parent().parent().parent().parent().parent()}else{e=d.parentsUntil(".J_msgImgList").last(":table");e.show()}e.find("td").find(".show_msg_border_rect").remove()};Site.productCommentAddCom=function(l){if(_siteDemo){Fai.ing("当前为“模板网站”,请先“复制网站”再进行评论。");return}if(_manageMode&&typeof l=="string"&&l=="5"){Fai.ing("当前为管理状态,您不能提交评论。");return}var k=$.trim($("#productCommentCreator").val());var p=$("#productCommentCreator").attr("minlength");var b=$("#productCommentInput").val();var h=$("#productCommentInput").attr("minlength");var f=$("#validateCodeInput").val();var q=$("#productCommentInput").attr("productId");var e=$("#submitTips").attr("isDefaultTips");if(typeof(e)=="string"&&e=="true"){$("#submitTips").show();return}if(typeof(k)!="string"){$("#submitTips").text(LS.creatorTips).show();return}if(typeof(b)!="string"||""==b){$("#submitTips").text(LS.commentNotEmpty).show();return}if(b.length<h){$("#submitTips").text(Fai.format(LS.commentLenTips,Fai.encodeHtml(h))).show();return}if(typeof(f)!="string"||""==f){$("#submitTips").text(LS.memberInputCaptcha).show();return}var n=$("#msgBoardAddImgTb");var g=[];if(n!=null&&typeof(n)!="undefined"){var a=n.eq(0);var d=a.find("td").length;if(d>1){for(var s=0;s<(d-1);s++){var c=a.find("td").eq(s).find(".msgBoard_upImg_set");if(c!=null&&c!="undefined"){var u={};var r=c.attr("_id");var w=c.attr("_name");var m=c.attr("_file_size");var o=c.attr("_file_id");u.imgId=r;u.imgName=w;u.imgSize=m;u.tempFileId=o;g.push(u)}}}}var v=$(".submitStarList").attr("star");if(!v){v=5}var j={validateCode:f,productId:q,creator:k,commImgList:$.toJSON(g),comment:b,star:v};var t="ajax/productComment_h.jsp?cmd=submitPC";$("#submitTips").text(LS.siteFormSubmitIng).show();$.ajax({type:"POST",url:t,data:j,error:function(){Fai.ing(LS.systemError);$("#msgBoardCaptchaImg").click()},success:function(i){var x=jQuery.parseJSON(i);if(!x||!x.success){$("#msgBoardCaptchaImg").click()}Fai.removeBg();switch(x.msg){case 1:$("#submitTips").text(LS.captchaError).show();break;case 2:$("#submitTips").text(LS.creatorError).show();break;case 3:$("#submitTips").text(LS.commentError).show();break;case 4:Fai.top.location.reload();$("#submitTips").text(LS.submitSuccess).show();break;case 5:$("#submitTips").text(LS.paramError).show();break;case 6:$("#submitTips").html(Fai.format(LS.commentOnlyMember,'<a href="login.jsp?url='+Fai.encodeUrl(window.location.href)+'">'+Fai.encodeHtml(LS.login)+"</a>")).show();break;case 7:$("#submitTips").text(LS.commentClosed).show();break;case 8:$("#submitTips").text(LS.commentSubmitError).show();break;case 9:$("#submitTips").text(LS.commentCountLimit).show();break;default:}if(x.hasFW){$("#submitTips").text(x.msg).show()}}})};Site.showProductQRCode=function(c,a){var b=["<div id='productQRCodeDisplay' class='webSiteQRCodeDisplay'>","<img title='' src='/qrCode.jsp?cmd=mobiDetailQR&&id=",c,"&lcid=",a,"&t=2' >","<span>",LS.productORCodeMsg,"</span>","</div>"];Fai.top.$(b.join("")).appendTo("body");$("#productQrCode").mouseenter(function(d){$("#productQRCodeDisplay").css("top",$(this).offset().top+"px");$("#productQRCodeDisplay").css("left",($(this).offset().left+24)+"px");$("#productQRCodeDisplay").show()}).mouseleave(function(d){$("#productQRCodeDisplay").hide()})};Site.initRepPropValueOfURL=function(){var a=new RegExp("https?|ftp|file://");$(".pd_J .propValue").each(function(b,d){var c=$(this).text();if(a.test(c)){$(this).html(Fai.replaceContentOfURL(c))}})};Site.salePromotionDetail={salePromotionParam:"",showType:"2",styleType:"1",saleCountTimeInterval:{}};Site.initSalePromotion=function(b,a){Site.salePromotionDetail.salePromotionParam=b;Site.salePromotionDetail.styleType=a};Site.onlyChangeSalePrice=function(b){b=parseFloat(b);if(isNaN(b)){return}var c=Site.salePromotionDetail.salePromotionParam;if(typeof(c)=="undefined"||c==null||c==""){return}if(c.saleType=="1"){var a=parseFloat(c.other.ruleData.d[0].m);if(c.other.ruleData.s=="1"){b=b*(a/10)}else{b=b-a}if(b<0){b=0}if(Fai.top._lcid!=2052&&Fai.top._lcid!=1028){$(".J_realMallAmount").html(Fai.formatPriceEn(b))}else{$(".J_realMallAmount").html(b.toFixed(2))}}};Site.showSalePromotionDl=function(q,o){if(Site.salePromotionDetail.showType!="2"){return}if(typeof(q)=="undefined"||q==null||q==""){return}var g=$("#realMallAmount").css("color");if(typeof(g)=="undefined"||g==null||g==""){g="#FC4643"}var c=$(".J_saleFullReduce").find(".propName").attr("style")||"";var k=[];var p="f-saleValue";if(q.saleType=="1"){var n="";var f=parseFloat(q.other.ruleData.d[0].m);var b=$(".J_saleFullReduce").find(".propName").html();var m=$("#realMallAmount").html();m=m.replace(/\,/g,"");var j=m.indexOf("~");if(j>0){priceNumber=parseFloat(m.substring(0,j));if(Fai.top._lcid!=2052&&Fai.top._lcid!=1028){m=Fai.formatPriceEn(m.split("~")[0])+"~"+Fai.formatPriceEn(m.split("~")[1])}}else{priceNumber=parseFloat(m);m=parseFloat(m).toFixed(2);if(Fai.top._lcid!=2052&&Fai.top._lcid!=1028){m=Fai.formatPriceEn(m)}}if(isNaN(priceNumber)){priceNumber=0}var a=0;var l=$("#realMallAmount").attr("curval");if(q.other.ruleData.s=="1"){if(_lcid==2052||_lcid==1028){n=Fai.format(LS.salePromotionDisCount,f)}else{n=Fai.format(LS.salePromotionDisCount,Fai.formatPriceEn(10*(10-f),null,true))}a=priceNumber*(f/10)}else{if(_lcid==2052||_lcid==1028){n=Fai.format(LS.salePromotionLapse,f)}else{n=Fai.format(LS.salePromotionLapse,Fai.formatPriceEn(f,null,true))}a=priceNumber-f}if(isNaN(a)||a<0){a=0}if(Fai.top._lcid!=2052&&Fai.top._lcid!=1028){$("#realMallAmount").html(Fai.formatPriceEn(a))}else{$("#realMallAmount").html(a.toFixed(2))}$("#realMallAmount").addClass("J_realMallAmount");$("#realMallAmount").removeAttr("id");$(".J_saleFullReduce").addClass("J_salePromotionRemove");var e=[];if(o==4){$(".J_saleFullReduce").find(".propName").html(LS.promotionPrice+":");e.push("<tr>");e.push("<td valign='top' class='propName g_minor' style='"+c+"'>");e.push(b);e.push("</td>");e.push("<td valign='top' class='propValue g_minor mallMarketPrice realMallAmount'>");e.push("<span>");e.push(l);e.push("</span>");e.push("<span curval='"+l+"' id='realMallAmount' class='mallPrice'>");e.push(m);e.push("</span>");e.push("</td>");e.push("</tr>")}else{$(".J_saleFullReduce").find(".propName").html(LS.promotionPrice+LS.colon);e.push("<tr>");e.push("<td valign='top' class='propName g_minor' style='"+c+"'>");e.push(b);e.push("</td>");e.push("<td valign='top' class='propValue g_minor mallMarketPrice realMallAmount'>");e.push("<span>");e.push(l);e.push("</span>");e.push("<span curval='"+l+"' id='realMallAmount' class='mallPrice'>");e.push(m);e.push("</span>");e.push("</td>");e.push("</tr>")}$(".J_saleFullReduce").before(e.join(""));var d="";if((o==1||o==2||o==3)&&Fai.isIE6()){d="padding-bottom:10px; margin:0px; line-height:25px;"}k.push("<td class='saleHoverDefault showSaleReducePrice J_salePromotionRemove' style='"+d+"'>");k.push("<table border='0' cellspacing='0' cellpadding='0'><tr>");k.push("<td style='vertical-align: bottom;padding:0;margin:0;'>");k.push("<div style='width: 0; height: 0; border-bottom: 5px solid "+g+"; border-left: 5px solid transparent;' class='J_changeSaleCrBb'>");k.push("</div>");k.push("</td>");k.push("<td class='f-SaleReduce'>");k.push("<div style='font-size:12px; background-color:"+g+"; padding:0px 3px; word-wrap: normal; height:20px; line-height:20px;' class='J_changeSaleCrBd' title='"+q.name+"'>");k.push(n);k.push("</div>");k.push("</td>");k.push("</tr></table>");k.push("</td>");$(".J_realMallAmount").parent().after(k.join(""))}else{if(typeof(q.other.ruleData.d.length)=="undefined"){return}k.push("<tr class='J_salePromotionRemove fk-changeSaleCrW saleFullCutPding'>");if(o==4){k.push("<td valign='top' class='propName g_minor' style='"+c+"'>");k.push(LS.salePromotionName);k.push(":</td>")}else{k.push("<td valign='top' class='propName g_minor' style='"+c+"'>");k.push(LS.salePromotionName+LS.colon);k.push("</td>")}k.push("<td valign='top' class='saleHoverDefault propValue J_changeSaleCrW' colSpan=2 style='color:"+g+";' title='"+q.name+"' >");if(o!=5){for(var h=0;h<q.other.ruleData.d.length;h++){if(h>0){k.push("<div class='saleFullReMgTop'>")}else{k.push("<div>")}k.push("<span class='saleFullReBg J_changeSaleCrBd' style='margin:0;background-color:"+g+";'>");k.push(Fai.format(LS.salePromotionOnlyFullReduce));k.push("</span>");k.push("<span style='margin:0; margin-left:8px;'>");if(Fai.top._lcid!=2052&&Fai.top._lcid!=1028){k.push(Fai.format(LS.salePromotionFullReduce,Fai.formatPriceEn(q.other.ruleData.d[h].m,null,true),Fai.formatPriceEn(q.other.ruleData.d[h].n,null,true)))}else{k.push(Fai.format(LS.salePromotionFullReduce,q.other.ruleData.d[h].m,q.other.ruleData.d[h].n))}k.push("</span>");k.push("</div>")}}else{k.push("<div>");for(var h=0;h<q.other.ruleData.d.length;h++){p=(h==0)?"":"f-saleValue";k.push("<span class='saleFullReBg J_changeSaleCrBd fk-mainBgColor "+p+"'>");k.push(Fai.format(LS.salePromotionOnlyFull));k.push("</span>");k.push("<span class='f-saleDiscount'>");if(Fai.top._lcid!=2052&&Fai.top._lcid!=1028){k.push(Fai.format(LS.salePromotionFullReduce,Fai.formatPriceEn(q.other.ruleData.d[h].m,null,true),Fai.formatPriceEn(q.other.ruleData.d[h].n,null,true)))}else{k.push(Fai.format(LS.salePromotionFullReduce,q.other.ruleData.d[h].m,q.other.ruleData.d[h].n))}k.push("</span>")}k.push("</div>")}k.push("</td>");k.push("</tr>");$(".J_saleFullReduce").after(k.join(""))}};Site.changeSaleColor=function(){var a=Site.getTopWindow().$(".J_realMallAmount").css("color");if(typeof(a)=="undefined"||a==null||a==""){a=Site.getTopWindow().$("#realMallAmount").css("color");if(typeof(a)=="undefined"||a==null||a==""){a="#FC4643"}}Site.getTopWindow().$(".J_changeSaleCrBb").css("border-bottom-color",a);Site.getTopWindow().$(".J_changeSaleCrW").css("color",a);Site.getTopWindow().$(".J_changeSaleCrBd").css("background-color",a)};Site.saleCountTimeInterval={};Site.showSaleTimeCountDown=function(b,f,d,e){var h="";var c=LS.salePromotionBegin;var g=LS.salePromotionEnd;var a=0;Site.salePromotionDetail.showType=d;if(d==1){h=c;a=b}else{h=g;a=f}clearInterval(Site.salePromotionDetail.saleCountTimeInterval);Site.salePromotionDetail.saleCountTimeInterval=setInterval(function(){var q=parseInt(a/(3600*24));var o=parseInt(a/3600)-(q*24);var m=parseInt(a/60)-(q*24*60)-(o*60);var p=parseInt(a%60);if(_lcid!=2052&&_lcid!=1028){if(o<10){o="0"+o}if(m<10){m="0"+m}if(p<10){p="0"+p}}a--;var j=Fai.format(h,q,o,m,p);if(e==2||e==3){var l=j.indexOf(":");if(l<0){l=j.indexOf(":")}if(l>0){var n=j.substring(0,l+1);var k=j.substring(l+1,j.length);$(".showSaleTimeNameClass").html(n);$(".showSaleTimeClass").html(k)}else{$(".showSaleTimeClass").html(Fai.format(h,q,o,m,p))}}else{$(".showSaleTimeClass").text(j)}if(a<0){if(d==1){a=f;h=g;d=2;Site.salePromotionDetail.showType=2;Site.showSalePromotionDl(Site.salePromotionDetail.salePromotionParam,Site.salePromotionDetail.styleType)}else{clearInterval(Site.salePromotionDetail.saleCountTimeInterval);Site.salePromotionDetail.showType=1;var i=$(".J_realMallAmount").attr("style");$(".realMallAmount").removeClass("g_minor mallMarketPrice");$(".realMallAmount").addClass("g_stress mallPriceBig");$(".realMallAmount").attr("style",i);$(".J_salePromotionRemove").remove()}}},1000)};Site.initModuleProductMallGroups=function(a,d,g,e){var b=$("#module"+a),h=b.find(".pd_mall_G_J .p_m_cotainer_J");var c=false;if(typeof b.find(".pd_mall_G_J").menuAim=="function"){k()}function k(){b.find(".pd_mall_G_J").menuAim({rowSelector:" .p_m_cotainer_J",activate:j,deactivate:i,exitActRow:function(){return true}})}function j(y){var K=$(y);K.find(".p_m_cotainerR_J").removeClass("p_m_more");K.find(".p_m_value_J").addClass("g_stress");K.addClass("bold p_m_hover g_border");var C=K.attr("_id"),u=d[C];if(u==null||u.list.length===0){return true}var H=f(u);var r={that:K,moduleId:a,clsStr:"pd_m_panel "+(g===1||g===2?"pd_m_jd":"pd_m_yhd"),idStr:"group"+C+"Panel",contentStr:H.join("")};panel=Site.moduleSubPanel(r);var m=b.find(".formBanner"),N=0;if(m.length>0&&m.is(":visible")){N=m.outerHeight()}var z=b.find(".formMiddleRight").outerWidth();if(Fai.isIE8()){z=0}var o=b.find(".formMiddleCenter").width(),s=b.find(".pd_mall_G_J").width(),M=b.offset().top+N,q=b.offset().left+b.outerWidth()-((o-s)/2)-2-z;panel.css({top:M,left:q}).show();if(Fai.isIE6()){var O=panel.find(".p_m_body_J").outerWidth();panel.width(O)}var x=0,l=0,I=K.outerHeight()-K.innerHeight();m_border=parseInt((b.outerHeight()-b.innerHeight())/2);oFormMiddle=b.find(".formMiddle"),m_content_innerPaddingTopStr=oFormMiddle.find(".formMiddleContent").css("margin-top"),m_content_innerPaddingTop=parseInt(m_content_innerPaddingTopStr.replace("px",""));if(g===2){var w=20,D=K.outerHeight(),p=panel.outerHeight(),B=$(window).height(),F=K.offset().top-$(window).scrollTop(),v=B-F,G=0;if(v<p){G=p-v+w}if(G>K.position().top){G=K.position().top}if(D<p&&G+D>p){G=p-v}var A=oFormMiddle.height(),J=parseInt((oFormMiddle.outerHeight()-oFormMiddle.innerHeight())/2);M+=K.position().top-G+m_border+J+m_content_innerPaddingTop;panel.css({top:M});l=G+I/2;x=D>p?p-4:K.outerHeight()-I}else{var L=b.find(".formMiddleContent").offset().top-b.find(".formMiddleCenter").offset().top,E=K.position().top+K.outerHeight()+L,n=panel.outerHeight();if(n-5<E){var t=panel.find(".p_m_body_J");t.height(E)}l=K.position().top+I/2+m_border+m_content_innerPaddingTop;x=K.outerHeight()-I}$(panel).find(".p_m_cover_J").css({top:l,height:x});$(".J_paddingMarginWrap").css("z-index",-1)}function i(m){var l=$(m);Fai.top.$(".g_m_s_J").each(function(){var n=$(this);if(n.length!=1){return}n.remove()});l.removeClass("bold p_m_hover g_border");l.find(".p_m_value_J").removeClass("g_stress");if(l.attr("_chd")==1){l.find(".p_m_cotainerR_J").addClass("p_m_more")}$(".J_paddingMarginWrap").css("z-index","")}function f(l){var n=[];n.push("<div class='p_m_cover p_m_cover_J'></div>");n.push("<div class='"+(l.hasGrand?"p_m_body2":"p_m_body")+" g_border p_m_body_J'>");var m="";if(e===1){m="target='_blank'"}if(l.hasGrand){if(g===1||g===2){$.each(l.list,function(o,p){if(e!==1&&_manageMode){m="onclick=\"Site.redirectUrl('"+p._href+"', '_self', event, 1, 0);return false;\""}n.push("<dl>");n.push("<dt><a class='g_stress' href='"+p._href+"' "+m+">"+Fai.encodeHtml(p.name)+"</a></dt>");n.push("<dd>");$.each(p.children,function(q,r){if(e!==1&&_manageMode){m="onclick=\"Site.redirectUrl('"+r._href+"', '_self', event, 1, 0);return false;\""}n.push("<a href='"+r._href+"' "+m+" title='"+Fai.encodeHtml(r.name)+"'>"+Fai.encodeHtml(r.name)+"</a>")});n.push("</dd>");n.push("</dl>");n.push("<div class='p_m_sep'></div>")})}else{$.each(l.list,function(o,p){if(e!==1&&_manageMode){m="onclick=\"Site.redirectUrl('"+p._href+"', '_self', event, 1, 0);return false;\""}n.push("<dl>");n.push("<dt><a class='g_stress' href='"+p._href+"' "+m+">"+Fai.encodeHtml(p.name)+"</a></dt>");$.each(p.children,function(q,r){if(e!==1&&_manageMode){m="onclick=\"Site.redirectUrl('"+r._href+"', '_self', event, 1, 0);return false;\""}n.push("<dd><a href='"+r._href+"' "+m+" title='"+Fai.encodeHtml(r.name)+"'>"+Fai.encodeHtml(r.name)+"</a></dd>")});n.push("</dl>");if((o+1)%3==0||(o+1)==l.list.length){n.push("<div class='p_m_sep'></div>")}})}}else{$.each(l.list,function(o,p){if(e!==1&&_manageMode){m="onclick=\"Site.redirectUrl('"+p._href+"', '_self', event, 1, 0);return false;\""}n.push("<a class='p_m_line g_stress' href='"+p._href+"' "+m+">"+Fai.encodeHtml(p.name)+"</a>")})}n.push("</div>");return n}};Site.createImageEffectContent_product=function(h,n,i,c){if(!c){return}var k={fwc:(n.wordType)?n.fullmaskWordColor:"#fff",fwr:(n.wordType)?n.fullmaskWordResize:12,fws:(n.wordType)?n.fullmaskWordStyle:"微软雅黑"};var f=$(h).find(".imageEffects");var l=$(h).attr("id");if(typeof l=="undefined"){var d=$(f).parents("."+i.targetParent).attr("productid");l=i.targetParent+d}var b=(n.effType==5)?($(h).height()*0.75)*0.5:($(f).height()*0.5);var e=$(f).width();var a="";m();j();g();function m(){var r=[];var G="";var u="";var p=false;var o=0;var D="";var y="";y+=(n.effType==5?"padding-top: 2.5%;":"");y+=(i.productTextCenter?"text-align: center;":"text-align: left;");var E="<div class='props'><div class='propList g_specialClass' style='"+y+"'></div><div class='propBuy'></div></div>";$(f).append(E);if(i.targetParent=="productMarqueeForm"){l=l.replace("_clone","")}for(var w in c){if(c[w][l]!=undefined){r=jQuery.parseJSON(c[w][l]);u=c[w]["productName"];a=c[w]["productBuyBtnText"];p=c[w]["hasDiscount"];o=c[w]["tmpPropPrice"];D=c[w]["tmpPropName"];break}}var A=$(f).find(".props .propList");if(i.productNameShow){$(A).append("<a href='javascript:;' onclick='return false;' class='fk_imgEffProductName imgEffPropName "+(i.productNameWordWrap?"":"noNameWrap")+"'>"+u+"</a>")}if(r.length>0){for(var w in r){var q=r[w];var B=q.propName;var x=q.propValue;var s=q.type||-1;var t=q.allowed;var z=false;var C="";if(s==11&&p){B=D;x=o;z=true;C=" g_stress"}if(!i.propNameShow&&!z){B=""}else{B="<span class='propName"+C+" fk-prop-name'>"+B+":</span>"}if($(A).height()<b){if((s==11||s==12)&&t){if(s==12){x="<span class='effect_second_Marketprice fk-prop-marketprice'>"+Fai.top._choiceCurrencyVal+x+"</span>";tempStr=B+x}else{x="<span class='propValue g_stress mallPrice fk-prop-price'>"+Fai.top._choiceCurrencyVal+x+"</span>";tempStr=B+x}}else{tempStr=B+x}$(A).append("<p class='prop'>"+tempStr+"</p>")}else{var F=$(A).children().last();if($(F).width()<e){var v=$(A).children().last().html();$(A).children().last().html(v+"...")}break}}}if(n.wordType){$(f).find(".imgEffPropName").css({color:k.fwc,"font-size":k.fwr+"px","font-family":k.fws})}$(f).find(".prop").css({color:k.fwc,"font-size":k.fwr+"px","font-family":k.fws})}function j(){if(i.mallShowBuy){var o="<span>"+a+"</span>";$(f).find(".props .propBuy").append(o)}else{$(f).find(".props .propBuy").remove()}}function g(){$(f).find(".propBuy").bind("mouseenter",function(){$(this).addClass("propBuy_hover")}).bind("mouseleave",function(){$(this).removeClass("propBuy_hover")});if(Fai.isIE6()||Fai.isIE7()){$(f).find(".propBuy").bind("click",function(){var o=$(this).attr("data-click");if(o.length>0){Fai.fkEval(o)}})}}};Site.clearImageEffectContent_product=function(b,a){$("#module"+b).find("."+a).remove();if($("#module"+b).find(".mallPanel").length>0){$("#module"+b).find(".mallPanel").remove()}};Site.bindImageEffectCusEvent_product=function(c,a){var b=$(c).find(".imageEffects");$(b).css("cursor","pointer");$(b).bind("click",function(){var g=$(this).parents("."+a.targetParent).find("a");if(Fai.isNull(g)){return}var e=$(g).attr("href");var d=$(g).attr("onclick");var f=$(g).attr("target");if(typeof d!="undefined"){Fai.fkEval(d)}else{if(e.length>0){window.open(e,f)}}})};Site.initModuleProductResultPropFilter=function(d){var c=$("#module"+d),e=c.find(".fp_list_J"),f=e.find(".fp_block_J");if(Fai.isIE6()||Fai.isIE7()||Fai.isIE8()){var a=e.find(".block_head_J").outerWidth();e.find(".block_body_J").width(e.width()-a)}$.each(f,function(j,k){var k=$(k),h=k.find(".block_head_J"),g=k.find(".block_body_J"),l=h.outerHeight();blockBodyH=g.outerHeight();if(blockBodyH>l+10){g.attr("_h",blockBodyH);$(k).find(".block_tail_J .more_btn_J").text(LS.productResultMore);return}$(k).find(".block_tail_J").remove()});var b=c.find(".fp_list_J .block_tail_J");b.click(function(){var j=$(this),k=j.parent(),g=k.find(".block_body_J"),h=j.find(".more_btn_J"),i=j.find(".more_down");if(i.hasClass("more_up")){k.removeAttr("style");h.text(LS.productResultMore);i.removeClass("more_up")}else{k.height(g.attr("_h"));h.text(LS.productResultColl);i.addClass("more_up")}});$("#conds_body_sel").change(function(){window.location.href=$(this).val()});if(Fai.top._manageMode){$("#pf_tips").hover(function(){var g=$(this);tipImgW=g.width(),tipTop=g.offset().top,tipLeft=g.offset().left,str="<div id='pf_tips_Msg' class='pf_tips_Msg g_tip'>"+g.attr("_tipVal")+"</div>";Fai.top.$(str).appendTo("body");var h=$("#pf_tips_Msg");h.offset({top:tipTop-h.outerHeight()-10,left:tipLeft})},function(){$("#pf_tips_Msg").remove()})}};Site.productResultPropFilterSearch=function(a){$("#searchButton").click(function(){var b=$("#searchCondInput").val();b=Fai.encodeUrl($.trim(b));if(!b){Fai.top.location.href="pr.jsp?pfc="+Fai.encodeUrl($.toJSON(a))}if(a){Fai.top.location.href="pr.jsp?keywordCond="+b+"&pfc="+Fai.encodeUrl($.toJSON(a))}else{Fai.top.location.href="pr.jsp?keywordCond="+b}});$("#searchCondInput").keydown(function(b){if(b.keyCode==13){var c=$("#searchCondInput").val();c=Fai.encodeUrl($.trim(c));if(!c){Fai.top.location.href="pr.jsp?pfc="+Fai.encodeUrl($.toJSON(a))}if(a){Fai.top.location.href="pr.jsp?keywordCond="+c+"&pfc="+Fai.encodeUrl($.toJSON(a))}else{Fai.top.location.href="pr.jsp?keywordCond="+c}}})};Site.productResultPriceCondFilter=function(b){var a=false;$("#sort_priceMin").bind("focus",function(){$("#sort_priceMin").removeClass("sort_priceArea");$("#sort_priceMin").addClass("sort_priceAreaCheck g_borderSelected");$("#sort_submit").show();$("#prSort_item2").addClass("sort_select2");a=true});$("#sort_priceMax").bind("focus",function(){$("#sort_priceMax").removeClass("sort_priceArea");$("#sort_priceMax").addClass("sort_priceAreaCheck g_borderSelected");$("#sort_submit").show();$("#prSort_item2").addClass("sort_select2");a=true});$("#sort_submit").bind("click",function(){var k=$("#sort_priceMin").val();var l=$("#sort_priceMax").val();if(!(k||l)){return}var h=parseInt(k);var e=parseInt(l);if(isNaN(h)&&""!=k){$("#sort_priceMin").removeClass("sort_priceArea");$("#sort_priceMin").addClass("sort_priceAreaCheck g_borderSelected");return}if(isNaN(e)&&""!=l){$("#sort_priceMax").removeClass("sort_priceArea");$("#sort_priceMax").addClass("sort_priceAreaCheck g_borderSelected");return}if(h>e){var g=l;l=k;k=g;g=e;e=h;h=g}if(!b){b={}}if(!b.props){var d=[];b.props=d}var i=b.props;var j=false;var f="";if(k){f+=h}else{f+="0,"+e}if(k&&l){f+=","+e}f="["+f+"]";$.each(i,function(m,o){if(o.k==11){o.v=f;j=true}});if(!j){var c={};c.k=11;c.v=f;i.push(c)}Fai.top.location.href="pr.jsp?pfc="+Fai.encodeUrl($.toJSON(b))});$("#sort_priceMin").bind("blur",function(){a=false;var c=$.trim($("#sort_priceMin").val());var d=parseInt(c);if(""!=c){if(isNaN(d)){$("#sort_priceMin").val("");return}}$("#sort_priceMin").removeClass("sort_priceAreaCheck g_borderSelected");$("#sort_priceMin").addClass("sort_priceArea");setTimeout(function(){if(!a){$("#sort_submit").hide();$("#prSort_item2").removeClass("sort_select2")}},250)});$("#sort_priceMax").bind("blur",function(){a=false;var d=$.trim($("#sort_priceMax").val());var c=parseInt(d);if(""!=d){if(isNaN(c)){$("#sort_priceMax").val("");return}}$("#sort_priceMax").removeClass("sort_priceAreaCheck g_borderSelected");$("#sort_priceMax").addClass("sort_priceArea");setTimeout(function(){if(!a){$("#sort_submit").hide();$("#prSort_item2").removeClass("sort_select2")}},250)})};Site.initPdPagenation=function(a){$("#pagenation"+a).on("click.product",".pageNo",function(){var b=$(this);b.addClass("fk-select")})};Site.setProductStatify=function(a,b,k){var j=$("#module"+a),h=j.find(".J_proSatifySum"),l,f,n,e;if(h.length<1){return}var m=Fai.isIE6()||Fai.isIE7(),d="J_select",g="J_noSelect fk-noSelect";if(m){d="lt_select_more";g="lt_no_select"}l=j.find(".J_pdCommStarList");if(l.length>0){f=l.find(".J_proStar");b=Math.round(b);for(var c=0;c<b;c++){f.eq(c).addClass(d)}for(var c=b;c<=5;c++){f.eq(c).addClass(g)}l.attr("star",b)}e=j.find(".J_commNum");if(e.length>0){e.text(k)}};Site.initProDetailStyle=function(o,d){var f=$("#module"+o),i=f.find(".formBanner"+o),a=f.find(".J_productDetail").width(),m=f.find(".pdTableLayout").width(),e=false,t,b,g,n,r,k,c,h,j,s,p,l,q;f.removeClass("fk-proDetaliModuleStyle");i.removeClass("fk-proDetailBannerStyle");if(d==5){f.addClass("fk-proDetaliModuleStyle");i.addClass("fk-proDetailBannerStyle");if(a<m){g=f.find(".pdLayoutR_J");n=f.find(".pd_t_l_left_J");b=$("#imgGroup"+o);if(b.length>0){e=true}r=(a-280)/23;if(r<20){r=20}t=f.find(".J_saleFullReduce");t.find("#realMallAmount").css({"font-size":r+"px","line-height":r+"px"});t.find(".propName").css("line-height",t.find(".J_mallPrice").height()+"px");k=(a-320)/21;g.find(".J_pdDetailBorder").css("margin","0 0 0 "+(k>0?k:0)+"px");if(e){q=$("#imgDiv"+o).outerWidth(true);j=a/46;b.css("margin-right",j+"px");l=b.outerWidth(true);n.find(".imgContainer_J").css({"margin-right":j+"px",width:(l+q)});h=n.find(".J_productOpera");s=parseInt(b.outerWidth(true));h.css("left",(s>0?s:0)+"px");n.find("#prevAndNextDiv").css("margin-left",(s>0?s:0)+"px")}p=a-n.outerWidth(true);if(p<=0){p="100%"}f.find(".J_productTitle").width(p);g.find(".propValue:not('.J_mallPrice')").width(a-n.outerWidth(true)-g.find(".propName:last").outerWidth(true)-g.find(".propColon:last").outerWidth(true)-3)}}Site.switchJump()};Site.initProDetailPage=function(b,d,a){$("#singleProductpagenation"+b).find("a").hover(function(){$(this).addClass("g_hover")},function(){$(this).removeClass("g_hover")});if(!d){return}var c=false;if($("#imgGroup"+b).length>0){c=true}if(c){$("#prevAndNextDiv").addClass("fk-pd5PageStyle")}if(!a){$("#prevAndNextDiv").width($("#imgDiv"+b).width())}};(function(h,f,c){var j=false;var g={};f.initModuleMallGroup=function(k,u,s,A,y,q,n,x){var m=$("#module"+k);var t=$(".styleMall"+k);var p=m.width();var o=m.height();var w;var r=h.top._manageMode;if(h.isIE6()||h.isIE7()||h.isIE8()){if(i(n)){n=b(n);if(s==0){$(".mallGroupRight"+k).css("border","1px solid "+n);x=b(x);m.find(".mallHeadYHD").css("background-color",x)}else{if(s==1){m.find(".mallHeadJD").css("background-color",n);$(".mallGroupRight"+k).css("border","1px solid "+n);$(".styleMall"+k).find(".li-color").css({"background-color":n})}else{if(s==2){m.find(".mallHeadTM").css("background-color",n);$(".mallGroupRight"+k).css("border-color",n)}}}}if(s==1){$(".styleMall"+k).find(".li-color").css({"border-bottom":"1px solid","border-top":"1px solid","border-color":n})}}z();f.cacheModuleFunc.init("mallGroupEventBind",{moduleId:k,useColorCode:n,mallStyle:s,groupDisplay:y,liSize:q});if(y==1){if(h.top._colId==2){v()}else{l()}}else{if(y==2){if($("#module"+k+":visible").length){v()}}else{l()}}if(m.is(":hidden")){t.hide()}function l(){m.find(".mallHead").die("mouseenter mouseleave").live("mouseenter",function(){$(".styleMall"+k).css({width:m.width()});$(".mallGroupRight"+k).css({left:m.width(),top:0});if(h.isIE()){t.show()}else{t.stop(true,true).slideDown(800,"easeOutExpo")}$.each($(".styleMall"+k).find("li"),function(B,C){g.fixHWSecondMenuPanel(C)});d(k)}).live("mouseleave",function(){if(event.relatedTarget==null){return}var B=event.relatedTarget.className;if(B.indexOf("li-color")<0&&B.indexOf("mallLiName")<0&&B.indexOf("displayRight")<0&&B.indexOf("ui-resizable-bottomLine")<0){if(h.isIE()){t.hide()}else{t.stop(true,true).slideUp(800,"easeOutExpo")}}});t.die("mouseleave").live("mouseleave",function(D){if(D.relatedTarget==null){return}var B=D.relatedTarget.className;if(s==0){$(this).find(".li-color").find(".pdg_font_icon").removeAttr("style")}if(s==0){$(this).find(".li-color").removeClass("li-color-"+u);$(this).find(".li-color").find(".displayRight").removeClass("displayRight-hover")}else{if(s==1){$(this).find(".li-color").removeClass("JDli-hover-"+u)}else{if(s==2){t.find("ul").removeClass("li-border-"+u);$(this).find(".li-color").removeClass("TMli-hover-"+u)}}}if(h.isIE()){$(".mallGroupRight"+k+":visible").hide()}else{$(".mallGroupRight"+k).stop(true,true);var C=$(".mallGroupRight"+k+":visible").width();$(".mallGroupRight"+k+":visible").animate({width:0,opacity:0},1000,"easeOutExpo",function(){$(this).width(C);$(this).css({opacity:1,display:"none"})})}j=true;if(B.indexOf("mallHead")>=0){return}if(h.isIE()){t.hide()}else{t.stop(true,true).slideUp(800,"easeOutExpo")}})}function v(){var C=true,B;t.show();C=(t.attr("_useThemeColor")!=1);t.mouseleave(function(E){B=$(this).find(".li-color");t.find(".li-color").removeClass("f-leaveLiSubmenu, f-enterLiSubmenu");if(s==0){B.find(".pdg_font_icon").removeAttr("style");B.addClass("f-leaveLiSubmenu");B.find(".displayRight").removeClass("displayRight-hover")}else{if(s==1){C?B.css("background-color",n):B.css("background-color","")}else{if(s==2){t.find("ul").css({"border-right":""});B.removeClass("TMli-hover");B.css({"border-color":"",color:""})}else{if(s==3){B.find(".fk-firstMenuHW, .fk-secondMenuHW").css("color","")}}}}$(".mallGroupRight"+k).stop(true,true);var D=$(".mallGroupRight"+k+":visible").width();if(h.isIE()){$(".mallGroupRight"+k+":visible").hide()}else{$(".mallGroupRight"+k+":visible").animate({width:0,opacity:0},1000,"easeOutExpo",function(){$(this).width(D);$(this).css({opacity:1,display:"none"})})}j=true;return})}function z(){m=$("#module"+k);if(!r){m.find(".mallHead").css("cursor","pointer")}t=$(".styleMall"+k);if(t.parent().attr("id")!="g_main"){if(m.parent().hasClass("fk-webBannerZone")&&m.parent().css("display")==="none"){return}$("#g_main").append(t);t=$(".styleMall"+k)}d(k);t.css({width:m.width(),"z-index":4});$(".formMiddleCenter"+k).css({height:"100%"});$(".formMiddleContent"+k).css({height:"100%"})}};f.mallGroupEventBind=function(t){var k=t.moduleId,m=$("#module"+k),n=m.width();useColorCode=t.useColorCode,styleMall=$(".styleMall"+k),mallStyle=t.mallStyle,useThemeColor=(styleMall.attr("_useThemeColor")==1),groupDisplay=t.groupDisplay,liSize=t.liSize,isNeedChangeWidth=true;r(useColorCode);function r(u){p(u,mallStyle);$(".mallGroupRight"+k).css({left:n,top:0});styleMall.find(".secGroupName").die("mouseenter mouseleave").live("mouseenter",function(){useThemeColor&&(u=h.top._useTempThemeColor||u);$(this).css("color",u)}).live("mouseleave",function(){$(this).removeAttr("style")});styleMall.find(".thdGroupBox").die("mouseenter mouseleave").live("mouseenter",function(){useThemeColor&&(u=h.top._useTempThemeColor||u);$(this).css("color",u)}).live("mouseleave",function(){$(this).removeAttr("style")});m.find(".mallHead").off("click").on("click",function(){styleMall=$(".styleMall"+k);if(styleMall.parent().attr("id")!="g_main"){$("#g_main").append(styleMall);styleMall=$(".styleMall"+k)}if(styleMall.css("display")!="none"){$(".styleMall"+k+" li").eq(0).trigger("mouseleave")}styleMall.toggle();styleMall.find(".mallGroupRight").hide();styleMall.css({width:m.width(),height:"auto","z-index":4});m.show();$(".mallGroupRight"+k).css({left:m.width(),top:0});d(k)});var v;$.each(styleMall.find("li"),function(w,x){v=styleMall.find("li:eq("+w+") .mallGroupRight");o(v,groupDisplay);l(v,groupDisplay);s(v,groupDisplay);q(x);if(!(h.isIE6()||h.isIE7())){if(mallStyle==0&&v.width()>=750){v.mCustomScrollbar({theme:"dark-3",scrollSpeed:10,scrollButtons:{enable:true},advanced:{updateOnContentResize:true},axis:"y",callbacks:{}})}else{if(mallStyle!=0){v.mCustomScrollbar({theme:"dark-3",scrollSpeed:10,scrollButtons:{enable:true},advanced:{updateOnContentResize:true},axis:"y",callbacks:{}})}}}});if(mallStyle==0){styleMall.find("li").last().css("border-bottom","0")}if(h.isIE6()||h.isIE7()){if(mallStyle==2){styleMall.find("ul").removeClass("ulMall").addClass("ulMall-ie6");styleMall.find("ul li").removeClass("li-color").addClass("li-color-ie6");styleMall.find(".mallGroupRight").css("border-left-width","1px");styleMall.find(".mallGroupRight").css("height",(styleMall.find(".mallGroupRight").height()+liSize*2)+"px")}else{if(mallStyle==1){styleMall.find("ul li").css({"margin-bottom":"-2px","margin-top":"0px"});styleMall.css("top",(parseInt(styleMall.css("top"))-1)+"px");if(h.isIE6()){styleMall.find(".mallGroupRight").css("height",(styleMall.find(".mallGroupRight").height()+liSize)+"px")}}else{if(mallStyle==0){styleMall.find(".mallGroupRight").css("height",(styleMall.find(".mallGroupRight").height()+liSize*2)+"px")}}}}}function p(v,u,w){if(typeof styleMall.find("ul").menuAim=="function"){x()}function x(){var y=false;styleMall=$(".styleMall"+k);y=(styleMall.attr("_useThemeColor")==1);styleMall.find("ul").menuAim({rowSelector:".li-color",activate:B,enter:A,deactivate:z,exitMenu:C});function B(E){styleMall=$(".styleMall"+k);styleMall.stop(true,true);y&&(v=h.top._useTempThemeColor||v);$(E).stop(true,true);temThis=E;subMallRight=$(E).children(".mallGroupRight");styleMall.find(".li-color").removeClass("f-enterLiSubmenu");$(E).addClass("f-enterLiSubmenu");if(u==0){$(E).find(".displayRight").addClass("displayRight-hover");!y&&$(E).css({"background-color":v,color:"#fff"})}else{if(u==1){$(E).css("background-color",a(v,0));$(E).removeClass("bg-transtion")}else{if(u==2){styleMall.find("ul").css({"border-right":"1px solid "+v});$(E).addClass("TMli-hover");$(E).css({"border-color":v,color:v})}else{if(u==3){$(E).find(".mallGroupRight").length&&$(E).addClass("HWli-hover");$(E).find(".mallLiNameHW").css("color",v);$(E).find(".J_secondMenuHW").css("color",v)}}}}if(u==0){$(E).find(".pdg_font_icon").css("color","#fff")}if(h.isIE()){subMallRight.show()}else{$(".mallGroupRight").stop(true,true);var D=subMallRight.width();subMallRight.width(0);subMallRight.css({opacity:0,display:"block"});subMallRight.animate({width:D,opacity:"1"},800,"easeOutQuint")}j=false;if($(E).children(".mallGroupRight").length<=0&&u==2){$(".styleMall"+k).find("ul").css({"border-right":""});$(E).css("border-right-width","1px")}}function A(E){if(typeof event!="undefined"&&typeof event.target!="undefined"&&typeof event.target.className!="undefined"&&(event.target.className.indexOf("mallGroupRight"+k)>=0||event.target.className.indexOf("secGroup")>=0||event.target.className.indexOf("thdGroup")>=0)){return}styleMall=$(".styleMall"+k);styleMall.stop(true,true).css("z-index",1002);temThis=E;subMallRight=$(E).children(".mallGroupRight");if(!j){return}styleMall.find(".li-color").removeClass("f-enterLiSubmenu");$(E).addClass("f-enterLiSubmenu");y&&(v=h.top._useTempThemeColor||v);if(u==0){$(E).find(".displayRight").addClass("displayRight-hover");!y&&$(E).css({"background-color":v,color:"#fff"})}else{if(u==1){$(E).css("background-color",a(v,0))}else{if(u==2){styleMall.find("ul").css({"border-right":"1px solid "+v});$(E).addClass("TMli-hover");$(E).css({"border-color":v,color:v})}else{if(u==3){$(E).find(".mallGroupRight").length&&$(E).addClass("HWli-hover");$(E).find(".mallLiNameHW").css("color",v);$(E).find(".J_secondMenuHW").css("color",v)}}}}if(u==0){$(E).find(".pdg_font_icon").css("color","#fff")}if(h.isIE()){subMallRight.show()}else{$(".mallGroupRight").stop(true,true);var D=subMallRight.width();subMallRight.width(0);subMallRight.animate({width:D,opacity:"show"},800,"easeOutQuint")}j=false;if($(E).children(".mallGroupRight").length<=0&&u==2){$(".styleMall"+k).find("ul").css({"border-right":""});$(E).css("border-right-width","1px")}}function z(E){styleMall=$(".styleMall"+k);subMallRight=$(E).children(".mallGroupRight");if(u==0){if(h.isIE()||i($(E).css("background-color"))){$(E).css({"background-color":"#fff",color:"#4a4949"})}else{$(E).animate({"background-color":"#fff",color:"#4a4949"},100,"linear",function(){y&&$(E).css({"background-color":"",color:""})})}$(E).find(".displayRight").removeClass("displayRight-hover")}else{if(u==1){if(h.isIE()||i($(E).css("background-color"))){}else{$(E).addClass("bg-transtion")}y?$(E).css("background-color",""):$(E).css("background-color",v)}else{if(u==2){styleMall.find("ul").css({"border-right":""});$(E).removeClass("TMli-hover");$(E).css({"border-color":"",color:""})}else{if(u==3){$(E).removeClass("HWli-hover");$(E).find(".mallLiNameHW").css("color","");$(E).find(".J_secondMenuHW").css("color","")}}}}if(h.isIE()){subMallRight.hide()}else{$(".mallGroupRight").stop(true,true);var D=subMallRight.width();subMallRight.animate({width:0,opacity:0},1000,"easeOutExpo",function(){$(E).children(".mallGroupRight").width(D);$(E).children(".mallGroupRight").css({opacity:1,display:"none"})})}if(u==0){$(E).find(".pdg_font_icon").removeAttr("style")}}function C(D){var E=$(D).children("li-color");styleMall=$(".styleMall"+k);styleMall.css("z-index",4);if(u==0){$(E).find(".pdg_font_icon").removeAttr("style")}else{if(u==3){var F=styleMall.find(".HWli-hover");F.find(".mallLiNameHW").css("color","");F.find(".J_secondMenuHW").css("color","");F.removeClass("HWli-hover")}}}}}function l(y,x){var u=y.find(".secGroupBox");if(u.length==0){y.prev(".displayRight").hide();y.remove();return}if(mallStyle==0||mallStyle==3){return}y.show();var z=true;if(styleMall.css("display")=="none"){z=false;styleMall.show()}var w=0;var v=y.find(".thdGroup");isNeedChangeWidth=true;$.each(v,function(A,B){if(v.eq(A).html()==""||v.eq(A).html()==null){v.eq(A).hide();v.eq(A).prev(".point2").hide();return}if(v.eq(A).height()>30){isNeedChangeWidth=false}w=(w>v.eq(A).width()?w:v.eq(A).width())});$.each(v,function(A,B){v.eq(A).width(w)});if(isNeedChangeWidth){if(!h.isIE()){y.css("opacity",1)}y.width(w+232)}y.hide();if(!z){styleMall.hide()}}function s(y,x){if(mallStyle!=3){return}y.show();var z=true;if(styleMall.css("display")=="none"){z=false;styleMall.show()}var v=0;var u=y.find(".J_thirdGroupPanleHW");if(!u.length){var w=y.find(".secGroupNameHW");$.each(w,function(A,B){if($(B).width()>=140){$(B).width(140)}})}isNeedChangeWidth=true;$.each(u,function(A,B){if(u.eq(A).html()==""||u.eq(A).html()==null){u.eq(A).hide();return}if(u.eq(A).width()>=497){isNeedChangeWidth=false;v=497}else{v=(v>u.eq(A).width()?v:u.eq(A).width())}});$.each(u,function(A,B){if(u.eq(A).length){u.eq(A).width(v);u.eq(A).find(".thdGroupBox").addClass("fk-floatLeftMenuItem")}});y.hide();if(!z){styleMall.hide()}}function q(w){var z=$(w).find(".J_secondMenuHW"),u=z.length,x=$(w).parents(".styleHW").width()-($(w).innerWidth()-$(w).width()),B,A,v=0,C,y=false;if(x<0){return}if(u>0){B=z.children();A=B.length;$(w).find(".fk-menuContainerHW").width(x);if(A){$.each(B,function(D,E){E=$(E);!y&&(y=E.hasClass("fk-hiddenIconHW"));if(A==1&&y){$(E).remove();return}v+=$(E).innerWidth();if(v>x){y&&--D;z.find("span:gt("+(D-1)+")").remove();z.addClass("fk-hiddenLongWord");return}})}}}g.fixHWSecondMenuPanel=function(u){q(u)};function o(H,G){if(mallStyle!=0){return}var u=true;if(styleMall.css("display")=="none"){u=false;styleMall.css({opacity:0,display:"block"})}H.css({opacity:0,display:"block"});var C=H.find(".groupCol1").selector;var z=H.find(".groupCol2").selector;var y=H.find(".groupCol3").selector;var I=H.find(".secGroupBox");var x=false;$.each(I,function(J,K){if(x){J++}if((J+1)%3==1){if(x){J--}if($(C).height()-$(z).height()>100){I.eq(J).appendTo(z).show();x=true;return}I.eq(J).appendTo(C).show()}else{if((J+1)%3==2){if(x){J--}if($(z).height()-$(y).height()>100){I.eq(J).appendTo(y).show();x=true;return}I.eq(J).appendTo(z).show()}else{if((J+1)%3==0){if(x){J--}I.eq(J).appendTo(y).show()}}}});var E=$(C).height();var D=$(z).height();var B=$(y).height();var v=E>D?(E>B?E:B):(D>B?D:B);var w=H.height();var F=(v>w?v:w);var A=250*3;$(C).height(F);$(z).height(F);$(y).height(F);if($(C).html()==""){A-=250}if($(z).html()==""){A-=250}if($(y).html()==""){A-=250}H.width(A);if(h.isIE6()){if($(C).width()>249){$(C).width(249).css("overflow","hidden")}if($(z).width()>249){$(z).width(249).css("overflow","hidden")}if($(y).width()>249){$(y).width(249).css("overflow","hidden")}H.find(".secGroupBox").css("margin-left","15px")}if(!u){styleMall.css({opacity:1,display:"none"})}H.css({opacity:1,display:"none"})}};function d(k){setTimeout(function(){var m=$("#module"+k),o=$(".styleMall"+k),l,n,p;l=f.getModuleGMainRect(k);n=l.left;p=l.bottom;o.css({top:p,left:n})},0)}f.fixAllMallPosition=function(){h.top.$(".formStyle97").each(function(){var k=$(this).attr("_moduleid");d(k)})};function a(m,u){if(m.indexOf("#")>=0){m=e(m)}var p,o,l;var q=m.split("(")[1].split(")")[0].split(",");var w=parseInt(q[0]);var n=parseInt(q[1]);var t=parseInt(q[2]);if(w>=n){if(w>=t){p=25;if(n>=t){o=23;l=20}else{o=20;l=23}}else{p=23;if(n>=t){o=25;l=20}else{o=20;l=25}}}else{if(w>=t){p=23;if(n>=t){o=25;l=20}else{o=20;l=25}}else{p=20;if(n>=t){o=25;l=23}else{o=23;l=25}}}if(u==0){if(i(m)){var k=parseInt(q[0])-p<=0?"0":""+(parseInt(q[0])-p)+"";var s=parseInt(q[1])-o<=0?"0":""+(parseInt(q[1])-o)+"";var v=parseInt(q[2])-l<=0?"0":""+(parseInt(q[2])-l)+"";return"rgba("+k+","+s+","+v+","+q[3]+")"}else{var k=parseInt(q[0])-p<=0?"0":""+(parseInt(q[0])-p)+"";var s=parseInt(q[1])-o<=0?"0":""+(parseInt(q[1])-o)+"";var v=parseInt(q[2])-l<=0?"0":""+(parseInt(q[2])-l)+"";return"rgb("+k+","+s+","+v+")"}}else{if(i(m)){var k=parseInt(q[0])+p<=0?"0":""+(parseInt(q[0])+p)+"";var s=parseInt(q[1])+o<=0?"0":""+(parseInt(q[1])+o)+"";var v=parseInt(q[2])+l<=0?"0":""+(parseInt(q[2])+l)+"";return"rgba("+k+","+s+","+v+","+q[3]+")"}else{var k=parseInt(q[0])+p<=0?"0":""+(parseInt(q[0])+p)+"";var s=parseInt(q[1])+o<=0?"0":""+(parseInt(q[1])+o)+"";var v=parseInt(q[2])+l<=0?"0":""+(parseInt(q[2])+l)+"";return"rgb("+k+","+s+","+v+")"}}}function i(k){return(k.indexOf("#")<0&&(k.indexOf("rgba")>=0||k.indexOf("RGBA")>=0))}function b(l){if(!i(l)){return}if(l.indexOf("transparent")>=0){return"rgb(255,255,255)"}var k=l.split("(")[1].split(")")[0].split(",");return"rgb("+k[0]+","+k[1]+","+k[2]+")"}function e(m){var n=m.toLowerCase();if(n&&n.indexOf("#")>=0){if(n.length===4){var o="#";for(var l=1;l<4;l+=1){o+=n.slice(l,l+1).concat(n.slice(l,l+1))}n=o}var k=[];for(var l=1;l<7;l+=2){k.push(parseInt("0x"+n.slice(l,l+2)))}return"RGB("+k.join(",")+")"}else{return n}}})(Fai,Site,undefined);Site.newsScroll=function(l){var g={pauseDuration:2400,showDuration:600,scrollMode:"up"},c=$.extend({},g,l),a="scroll"+c.moduleId,d=$("#module"+c.moduleId),b=d.find(".newsList");b.stop(true,true);Fai.stopInterval(a);if(l.noScroll){return}var h=b.parent(),k=b.find(".line"),j=b.find(".separatorLine");var f=c.leader||0;d.on("mouseover.newsScroll",function(){b.stop();Fai.stopInterval(a);$(this).attr("scrollInterval",0)}).on("mouseout.newsScroll",function(){if($(this).attr("scrollInterval")==0){b.stop();Fai.stopInterval(a);Fai.startInterval(a);$(this).attr("scrollInterval",1)}});(k,d).on("mouseover.newsScroll",function(){b.stop();Fai.stopInterval(a);$(this).attr("scrollInterval",0)}).on("mouseout.newsScroll",function(){if($(this).attr("scrollInterval")==0){b.stop();Fai.stopInterval(a);Fai.startInterval(a);$(this).attr("scrollInterval",1)}});function i(){b.css({position:"relative"});h.css({overflow:"hidden",position:"relative"});b.height(b.height());h.height(b.height());function m(){if(c.scrollMode=="up"){var s=b.find(".line").eq(f);var o=b.find(".separatorLine").eq(f);var p=s.outerHeight();var q=o.is(":visible");var n=q?o.outerHeight(true):0;if(f==0){b.animate({top:"-="+(p+n)},c.showDuration*((p+n)/32),function(){s.appendTo(b).end().hide().fadeIn(400);o.appendTo(b).end().hide();if(q){o.fadeIn(400)}s.insertAfter(b.find(".separatorLine:last")).end().hide().fadeIn(400);o.insertAfter(b.find(".line:last")).end().hide();if(q){o.fadeIn(400)}b.css({top:0});e()})}else{s.animate({opacity:0},400).slideUp(600,function(){s.css({opacity:1}).appendTo(b).end().hide().fadeIn(400);o.appendTo(b).end().hide();if(q){o.fadeIn(400)}});e()}}else{var t=b.find(".line:last");var v=b.find(".separatorLine:last");var q=v.is(":visible");var u=t.outerHeight();var r=q?v.outerHeight(true):0;if(f==0){b.animate({top:"+="+(u+r)},c.showDuration*((u+r)/32),function(){v.insertBefore(b.find(".line").eq(f)).end().hide();if(q){v.fadeIn(400)}t.insertBefore(b.find(".separatorLine").eq(f)).end().hide().fadeIn(400);b.css({top:0});e()})}else{v.insertBefore(b.find(".line").eq(f)).end().hide();if(q){v.slideDown().css({opacity:0}).animate({opacity:1})}t.insertBefore(b.find(".separatorLine").eq(f)).end().hide().slideDown().css({opacity:0}).animate({opacity:1});e()}}}Fai.addTimeout(a,m,c.pauseDuration);Fai.startInterval(a)}function e(){i()}i()};Site.loadNewsList=function(h,g,c){var d=$("#module"+h).find(".newsList");if(d.length==0){return}var a={};d.find(".lineBody").each(function(m){var k=$(this);var n=k.find(".newsType");if(n.length!=0){var p=n.find(">a");var q=0;$.each(p,function(s,r){q+=$(r).outerWidth()+Fai.getCssInt($(r),"margin-right")});var i=q+Fai.getCssInt(n,"padding-left")+Fai.getCssInt(n,"padding-right")+5;if(typeof a.nt=="undefined"||a.nt<i){if(i>300){i=300}a.nt=i}}var j=k.find(".newsCalendar");if(j.length!=0){var l=j.find(">a").first().outerWidth();var o=l+Fai.getCssInt(j,"padding-left")+Fai.getCssInt(j,"padding-right")+5;if(typeof a.nc=="undefined"||a.nc<o){a.nc=o}}});var f=d.attr("newslisttype");d.find(".lineBody").each(function(){var l=$(this);if(!l.children().hasClass("J_noChangeStyle")){if(c){var i=l.width();var k,j;if(i<=400){if(l.find(".newsType").length==0){k="100%";j="0%"}else{k="60%";j="40%"}}else{if(l.find(".newsType").length==0){k="100%";j="0%"}else{k="70%";j="30%"}}l.find(".newsTitle").css("width",k);if(typeof a.nt!="undefined"){l.find(".newsType").css("width",j).css("text-overflow","ellipsis")}}else{if(f!=3){l.find(".newsTitle").css("width","100%")}if(typeof a.nt!="undefined"){l.find(".newsType").css("width",a.nt+"px").css("text-overflow","ellipsis")}}if(typeof a.nc!="undefined"&&f!=3){l.find(".newsCalendar").css("width",a.nc+"px")}if(l.find(".newsCalendar").width()<l.find(".newsCalendar>a").width()){l.find(".newsCalendar").width(l.find(".newsCalendar>a").width())}}});d.find(".word").css({display:"block",width:"100%"});if(Fai.isIE6()&&(d.find(".wWLine").length>0)){d.find(".line").each(function(){$(this).height($(this).height())});if(d.find(".g_topFlag").length>0){d.find(".newsTitle a").each(function(){$(this).height($(this).height())})}}var b=d.find(".line").css("background-color");d.find(".line").find(".newsType, .J_newsTypePicList").find("a").hover(function(i){i.stopPropagation();$(this).parents(".line").removeClass("g_hover");$(this).addClass("g_hover");$(this).css("background",b)},function(){$(this).removeClass("g_hover");$(this).css("background","")});d.find(".line").mouseover(function(){if(!$(this).hasClass("noHover")){$(this).addClass("g_hover")}}).mouseleave(function(){if(!$(this).hasClass("noHover")){$(this).removeClass("g_hover")}});var e=!!d.hasClass("pic-mixNewsList");if(e){d.find(".mixNewsStyleTitleContainer").off("mouseover.stylePic").on("mouseover.stylePic",function(i){$(this).addClass("g_hover");fixHoverNewsListPicTitleWidth(h,$(this))}).off("mouseleave.stylePic").on("mouseleave.stylePic",function(i){$(this).removeClass("g_hover");fixHoverNewsListPicTitleWidth(h,$(this))})}d.find(".lineHeader").first().addClass("firstHeader");Site.initContentSplitLine(h,g)};function fixHoverNewsListPicTitleWidth(a,g){var e=$("#module"+a),c=e.find(".newsList");var d=g.find(".mixNewsStyleTitle");if(d.attr("mix")==1){var b=c.find("td.newsTitle").width()||0;var i=c.find(".articlePhotoBox img").width()||0;var f=g.find(".mixNewsStyleDate").width()||0;var h=parseInt(b)-parseInt(f)-parseInt(i)-40;if(Fai.isIE6()){h-=20}d.css({width:h+"px"})}}Site.loadNewsNewStyle=function(q,b,s,o,g,i,j,r,u,w,p){var d=$("#module"+q);var z=d.find(".newsList");var h=d.width();var k=Fai.top._isTemplateVersion2?"newsCircle_hover":"g_block";if(z.length==0){return}if(b||s||i||j){if(d.find("#pagenation"+q).length>0){d.find("#pagenation"+q).css({"text-align":"center"})}if(!j){var n=z.find(".J_newsListLine");if(n.hasClass("top_with_line_icon")){n.css("padding-left","0")}}if(h<=400){if(!p){if(!o){$(z.find(".newsTitle").find("a")).each(function(A,B){$(this).css({height:"auto","white-space":"normal","word-break":"normal"});if($(this).html().length>23){var C=$(this).html().substring(0,20)+"...";$(this).html(C)}if(i){$(this).parent().css({height:"auto"})}})}if(!j){z.find(".newsTitle").css({display:"inline"})}z.find(".newsTitle").find("a").css({display:"inline"})}}z.find(".newsTypePicList_four").find(".newsTypePic").mouseover(function(){$(this).css({color:"#fff",background:"#bababa","border-color":"#bababa"})}).mouseleave(function(){$(this).css({color:"#717171",background:"#fff","border-color":"#dadada"})})}if(s||i||j){var l;z.find(".fk-newsListTitle").mouseenter(function(){if(i){$(this).parent().parent().find(".newsCircle").addClass(k)}if(j){l&&clearTimeout(l);var A=$(this);l=setTimeout(function(){A.addClass("g_stress");A.addClass("g_hover")},200)}else{$(this).addClass("g_stress");$(this).addClass("g_hover")}}).mouseleave(function(){if(i){$(this).parent().parent().find(".newsCircle").removeClass(k)}if(j){clearTimeout(l)}$(this).removeClass("g_stress");$(this).removeClass("g_hover")})}else{if(b){z.find(".J_titleLine").mouseenter(function(){var B=$(this).find(".fk-newsListTitle");var A=$(this).find(".fk-newsListDate");B.addClass("g_stress");B.addClass("g_hover");A.addClass("g_stress");A.addClass("g_hover")}).mouseleave(function(){var B=$(this).find(".fk-newsListTitle");var A=$(this).find(".fk-newsListDate");B.removeClass("g_stress");B.removeClass("g_hover");A.removeClass("g_stress");A.removeClass("g_hover")})}}if(b){z.find(".newsCalendar").css({width:"23.5%"});if(h<=400){z.find(".newsTitle").css({width:"100%"});z.find(".newsCalendar").css({display:"block","text-align":"left"})}else{z.find(".newsTitle").css({width:"75%"});if(Fai.isIE6()||Fai.isIE7()){z.find(".newsTitle").css({"float":"left"});z.find(".newsCalendar").css({"float":"right"})}}}if(s){var y=z.find(".J_newsListLine").width(),x;if(!!w){if(u){z.find(".lineBody").css({width:"100%"})}else{x=z.find(".J_newsListLine .J_newsCalendar").outerWidth(true);if(Fai.top._manageMode){z.find(".lineBody").css({width:"-moz-calc(100% - "+x+"px)",width:"-webkit-calc(100% - "+x+"px)",width:"calc(100% - "+x+"px)"})}else{z.find(".lineBody").width(parseInt(y-x))}}}else{if(h<=400){if(!g){z.find(".newsCalendar").hide()}z.find(".lineBody").css({width:"100%"})}else{z.find(".newsCalendar").show();z.find(".lineBody").css({width:"84%"})}}}if(i){if(h<=400){z.find(".newsCircleOuter").css({margin:"5px 8px 0px 0"});z.find(".lineBody").css({width:"100%"});z.find(".newsTitle").parent().css({width:"80%"});z.find(".J_timeLine").css({left:"9px"});z.find(".newsCalendar").css({"margin-left":"30px"})}var f=z.height();var e=z.find(".newsCircleOuter");var a=z.find(".newsCalendar").width();if(e.length==0){return}var m=e.position().left+parseInt(e.css("margin-left").replace("px",""))+e.width()/2;if(Fai.isIE6()||Fai.isIE7()){z.find(".J_timeLine").css({height:f-20+"px",left:e.position().left+e.width()/2+parseInt(e.css("margin-left").replace("px",""))+a+"px"})}else{z.find(".J_timeLine").css({height:f-20+"px",left:m+"px"})}}if(j){if(h<=400){z.find(".line").css({"margin-left":"",width:"198px"});if(!r){z.find(".J_articlePhotoBox").find(".cutImgPanel").each(function(B,D){var C=$(this).find("img").width()/$(this).find("img").height();var A=(198/C-124)/2;$(this).parent().css({width:"198px",height:"124px"});$(this).css({height:"124px",bottom:A+"px"});$(this).find("img").css({width:"198px",height:(198/C)+"px"})});z.find(".articlePhotoBox").find("img").each(function(A,B){if($(this).attr("_defimg")){$(this).css({width:"198px",height:"124px"})}$(this).parent().css({width:"198px",height:"124px"})})}}else{var c=z.hasClass("useOldStyleForHeight");var v=d.hasClass("formInZone");if(!c){if(v){setTimeout(function(){Site.autoFixNewsHeight(q)},0)}else{Site.autoFixNewsHeight(q)}}else{var t=function(){var A=0;z.find(".J_newsListLine").each(function(B,C){if($(this).height()>A){A=$(this).height()}if(A>550){A=550}});z.find(".J_newsListLine").css({height:A+"px"})};if(v){setTimeout(function(){t()},0)}else{t()}}}}};Site.getNewsListStyleData=function(c){var b=Fai.top.newsListStyleData,a;if(!b){return}a=b["newsListStyle"+c]||{};return a};Site.setNewsListImgSize=function(l,p){var e=$("#module"+l),t=Site.getModuleAttrPattern(l).newsList,u=e.find("#newsList"+l),f=e.find(".J_newsListLine"),o=f.find(".J_articlePicHref"),r=e.find(".J_articlePhotoBox"),n=o.find(".J_newsListPic"),c=Site.getNewsListStyleData(l),d=t.tw||false,m=t.ps.t||false,g=c.isNewModuleStyleFour||false,i=parseFloat(c.picPaddingRight),q=parseFloat(c.picPaddingBottom),j=c.pictureDefaultHeight||107,k=c.pictureDefaultWidth||152,b=e.width(),h,s,a;if(p){h=t.ps.w;s=t.ps.h}if(n.length<1&&o.length<1){return}if(p){n.css({height:s,width:h});o.css({height:s,width:h});r.css({marginBottom:q,marginRight:i})}else{if(g){f.width(k)}o.css({height:j,width:k});r.css({marginBottom:q,marginRight:i})}if(g){if(b<=400){f.css({"margin-left":"",width:"198px",height:"auto"});if(!m){Site.setNewsListDefaultPicSize(e)}}else{f.css({"margin-left":"30px",width:h});Site.setNewsListLineMaxHeight(f,l)}}Site.resetNewScroll(l,parseInt(t.ls.t))};Site.setNewsClassifyStyle=function(d,f){var a,n,k,e,q,g,b,l,i,p,c,j,m,o,h;m=Site.getModuleAttrPattern(d);o=Fai.top.$("#module"+d);$newsModule=o.find("#newsList"+d);a=$newsModule.find(".J_lineBody");i=a.find(".J_articlePhotoBox");p=f?"newsList":"newsResult";c=".J_"+p+"Pic";j=m[p];h=parseInt(j.tw);a.each(function(r,s){_this=$(s);n=_this.find(".J_newsTypePicList");if(n.length!=0){l=n.prevAll(":not('.J_articlePhotoBox')");b=0;$.each(l,function(t,u){b+=$(u).outerHeight()});k=_this.outerWidth()-i.eq(r).outerWidth();n.css("width",k+"px");g=_this.find(c).outerHeight()-b-n.outerHeight();g=(g<0?0:g);if(h==1||h==-1||g<0){g=0}n.css("margin-top",g+"px")}})};Site.refreshNewsListStyle=function(c,b){var a;if(b){a=Site.getModuleAttrPattern(c).newsList;Site.setNewsListImgSize(c,parseInt(a.ps.t));Site.refreshNewsTimeLine(c)}Site.setNewsClassifyStyle(c,b)};Site.refreshNewsTimeLine=function(l){var e=Site.getNewsListStyleData(l),q=Site.getModuleAttrPattern(l).newsList,r,d,f,n,h,c,a,j,i,s,m,g,b,o,k,p;g=e.isNewModuleStyleOne;s=e.isNewModuleStyleTwo;m=e.isNewModuleStyleThree;b=e.isNewModuleStyleFour;p=e.smallWidthHideDate;if(!(s||m||g||b)){return}r=$("#newsList"+l);n=r.find(".J_newsCalendar");i=r.find(".J_lineBody");d=r.width();o=r.find(".J_newsTitle");if(g){n.css({width:"23.5%"});if(d<=400){o.css({width:"100%"});n.css({display:"block"})}else{n.css({display:"inline-block"});o.css({width:"75%"})}}else{if(s){if(!p){if(d<=400){if(!e.newModuleStyleTwo_horizontal){n.hide()}i.css({width:"100%"})}else{n.show();i.css({width:"84%"})}}}else{if(m){h=r.find(".J_timeLine");f=r.find(".newsCircleOuter");if(d<=400){f.css({margin:"5px 8px 0px 0"});i.css({width:"100%"});o.parent().css({width:"80%"});h.css({left:"9px"});n.css({"margin-left":"30px"})}c=r.height();a=n.width();if(f.length==0){return}j=f.position().left+parseInt(f.css("margin-left").replace("px",""))+f.width()/2;h.css({height:c-20+"px",left:j+"px"})}}}};Site.setNewsListDefaultPicSize=function(a){$articlePhotoBox=a.find(".J_articlePhotoBox");$articlePhotoBox.find(".cutImgPanel").each(function(c,e){var d=$(this).find("img").width()/$(this).find("img").height();var b=(198/d-124)/2;$(e).parent().css({width:"198px",height:"124px"});$(e).css({height:"124px",bottom:b+"px"});$(e).find("img").css({width:"198px",height:(198/d)+"px"})});$articlePhotoBox.find("img").each(function(b,c){if($(c).attr("_defimg")){$(c).css({width:"198px",height:"124px"})}$(c).parent().css({width:"198px",height:"124px"})})};Site.resetNewScroll=function(a,h){var i=$("#module"+a),k=Site.getModuleAttrPattern(a).newsList,b="scroll"+a,c=i.find("#newsList"+a),d="down",j=c.find(".J_newsListLine"),g,f,e;c.stop(true,true);Fai.top.Fai.stopInterval("scroll"+a);j.off("mouseover.newsScroll mouseout.newsScroll");i.off("mouseover.newsScroll mouseout.newsScroll");c.css({height:"",top:"",position:""});c.parent().css({height:"",overflow:"",position:""});if(h){d=(parseInt(k.ls.d))?"up":"down";g=Site.getNewsListStyleData(a);f=g.isPictureStyle;e=f?1:0;c.height("auto");c.parent().height("auto");Fai.top.Site.newsScroll({moduleId:a,scrollMode:d,leader:e,noScroll:false})}};Site.setNewsListLineMaxHeight=function(c,d){var a=c.parent().hasClass("useOldStyleForHeight");if(!a){Site.autoFixNewsHeight(d)}else{var b=0;if(c.length<1){return}c.css("height","auto");c.each(function(e,f){$elem=$(f);if($elem.height()>b){b=$elem.height()}if(b>550){b=550}});c.css({height:b+"px"})}};Site.afterAddNews=function(a){if(typeof(a)!="undefined"){document.location.reload()}};Site.newsAddComment=function(){if(_siteDemo){Fai.ing("当前为“模板网站”,请先“复制网站”再进行评论。");return}var b=$.trim($("#commentCreator").val());var g=$("#commentCreator").attr("minlength");var f=$("#commentInput").val();var h=$("#commentInput").attr("minlength");var i=$("#validateCodeInput").val();var a=$("#commentInput").attr("newsId");var c=$("#submitTips").attr("isDefaultTips");if(typeof(c)=="string"&&c=="true"){$("#submitTips").show();return}if(typeof(b)!="string"){$("#submitTips").text(LS.creatorTips).show();return}if(typeof(f)!="string"||""==f){$("#submitTips").text(LS.commentNotEmpty).show();return}if(f.length<h){$("#submitTips").text(Fai.format(LS.commentLenTips,Fai.encodeHtml(h))).show();return}if(!$(".J_newsCommentCaptcha").hasClass("captchaHide")){if(typeof(i)!="string"||""==i){$("#submitTips").text(LS.memberInputCaptcha).show();return}}var d={validateCode:i,newsId:a,creator:b,comment:f};var e="ajax/newsComment_h.jsp?cmd=submitComment";$("#submitTips").text(LS.siteFormSubmitIng).show();$.ajax({type:"POST",url:e,data:d,error:function(){Fai.ing(LS.systemError,false);$("#msgBoardCaptchaImg").click()},success:function(j){var k=jQuery.parseJSON(j);if(!k||!k.success){$("#msgBoardCaptchaImg").click()}Fai.removeBg();switch(k.msg){case 1:$("#submitTips").text(LS.captchaError).show();break;case 2:$("#submitTips").text(LS.creatorError).show();break;case 3:$("#submitTips").text(LS.commentError).show();break;case 4:Fai.top.location.reload();$("#submitTips").text(LS.submitSuccess).show();break;case 5:$("#submitTips").text(LS.paramError).show();break;case 6:$("#submitTips").html(Fai.format(LS.commentOnlyMember,'<a href="login.jsp?url='+Fai.encodeUrl(window.location.href)+'">'+Fai.encodeHtml(LS.login)+"</a>")).show();break;case 7:$("#submitTips").text(LS.commentClosed).show();break;case 8:$("#submitTips").text(LS.commentSubmitError).show();break;case 9:$("#submitTips").text(LS.commentCountLimit).show();break;case 10:$("#submitTips").text(LS.msgBoardInputValidateCode).show();if(k.needCode){$(".J_newsCommentCaptcha").removeClass("captchaHide")}break;default:}if(k.hasFW){$("#submitTips").text(k.msg).show()}}})};Site.showNewsQRCode=function(e,c,a){var b=a=="newsV2"?"webSiteQRCodeDisplayV2":"webSiteQRCodeDisplay";var d=["<div id='newsQRCodeDisplay' class='"+b+"'>","<img title='' src='/qrCode.jsp?cmd=mobiDetailQR&id=",e,"&lcid=",c,"&t=1' >","<span>",LS.newsQRCodeMsg,"</span>","</div>"];Fai.top.$(d.join("")).appendTo("body");$("#newsQrCode").mouseenter(function(f){if(a){$("#newsQRCodeDisplay").css("top",($(this).offset().top+$(this).height()+10)+"px");$("#newsQRCodeDisplay").css("left",($(this).offset().left-60)+"px")}else{$("#newsQRCodeDisplay").css("top",$(this).offset().top+"px");$("#newsQRCodeDisplay").css("left",($(this).offset().left+24)+"px")}if(a){$("#newsQRCodeDisplay").slideDown("fast")}else{$("#newsQRCodeDisplay").show()}}).mouseleave(function(f){if(a){$("#newsQRCodeDisplay").slideUp("fast")}else{$("#newsQRCodeDisplay").hide()}})};Site.initMixNews=function(l){var g=l.leader||0;var e=$("#module"+l.moduleId),b=e.find(".newsList"),i=b.parent();var d=b.find(".mixNewsStyleTitle");if(d.attr("mix")==1){var a=b.find("td.newsTitle").width()||0;var f=b.find(".mixNewsStyleDate").width()||0;var k=b.find(".articlePhotoBox img").width()||0;var h=parseInt(a)-parseInt(f)-parseInt(k)-40;if(Fai.isIE6()){h-=20}d.css({width:h+"px"});if(h<1){d.addClass("mixNewsStyleTitle-hide")}else{d.removeClass("mixNewsStyleTitle-hide")}}if(Fai.isIE6()&&g!=0){var j=b.find("td.newsTitle").height();b.find(".line").eq(0).css({height:j+"px"})}var c=Fai.top.$("#module"+l.moduleId);c.on("Fai_onModuleLayoutChange",function(){var p=$(this).find(".newsList");var t=p.parent();var s=p.find(".mixNewsStyleTitle");p.css({height:"auto"});t.css({height:"auto"});if(Fai.isIE6()&&g!=0){var m=p.find("td.newsTitle").height();p.find(".line").eq(0).css({height:m+"px"})}if(p.find(".mixNewsStyleTitle").attr("mix")==1){var r=p.find("td.newsTitle").width()||0;var o=p.find(".mixNewsStyleDate").width()||0;var n=p.find(".articlePhotoBox img").width()||0;var q=parseInt(r)-parseInt(o)-parseInt(n)-40;if(Fai.isIE6()){q-=20}p.find(".mixNewsStyleTitle").css({width:q+"px"});if(q<1){s.addClass("mixNewsStyleTitle-hide")}else{s.removeClass("mixNewsStyleTitle-hide")}}if(Fai.isIE6()&&g!=0){var m=p.find("td.newsTitle").height();p.find(".line").eq(0).css({height:m+"px"})}});c.find(".lineBody").each(function(q){var s=$(this);var r=s.find(".newsTypePicList");if(r.length!=0){var o=$(r).prevAll();var n=0;$.each(o,function(t,u){if(!$(u).hasClass("articlePhotoBox")){n+=$(u).outerHeight()}});var m=s.outerWidth()-s.find(".articlePhotoBox").outerWidth();$(r).css("width",m+"px");var p=s.find(".articlePhotoBox img").outerHeight()-n-$(r).outerHeight();p=(p<0?0:p);$(r).css("margin-top",p+"px")}})};Site.setNewsListStylePattern=function(c,b){var a=Fai.top.newsListStyleData;if(!a){Fai.top.newsListStyleData={}}Fai.top.newsListStyleData["newsListStyle"+c]=b};Site.setNewsModuleAttrPattern=function(d,a,c){var b=Site.getModuleAttrPattern(d);if(!!b[a]){b[a]=c}};Site.autoFixNewsHeight=function(c){var e=$("#module"+c);var b=e.find(".J_newsList");var l=b.find(".J_newsListLine");var a=b.width();var k=l.outerWidth(true);var d=parseInt(a/k);var p=0,g=[],n,m;for(var h=0,f=1,o=l.length;h<o;h++){n=$(l[h]);m=n.height();if(m>p){p=m}g.push(n);if(f===d||h===o-1){$(g).each(function(){$(this).css("height",p+"px")});f=1;p=0;g=[]}else{f++}}};Site.initNewsDetailV2=function(){var h=$(".newsDetailV2");var e=h.find(".middlePanel"),b=e.find(".shareInfo");if(b.length>0){var l=b.find(".shareTag"),c=b.find(".shareListPanel"),a=c.find("a").length,g=parseInt(c.width()/(33+12)),k=b.position().top,f=b.position().left-10,d,j="",i;e.css("height",e.height()+"px");if(g<a){d=c.find("a").eq(g-1);j+="<a class='shareIcon more' hidefocus='true' title='更多' href='javascript:;'></a>";d.before(j);i=c.find(".more");i.on("click",function(m){m.stopPropagation();b.hide();$(this).hide();b.css("top",k+"px");b.css("right",0);b.addClass("showAllShare");b.slideDown("fast")});$(document).on("click",function(){if(b.hasClass("showAllShare")){b.fadeOut("fast",function(){b.removeAttr("style");b.removeClass("showAllShare");i.show();b.show()})}})}}h.find(".newsInfoWrap").find(".leftInfo").find(".newsInfo").find("a").hover(function(){$(this).addClass("g_hover")},function(){$(this).removeClass("g_hover")})};Site.siteFormAdd=function(b,q,o,g,a,e,d){if(_siteDemo){Fai.ing("当前为“模板网站”,请先“复制网站”再进行提交。");return}var i=[];var p=o;var c=true;var l=100;var f=1000;var n=g;var m=$("#M"+b+"F"+q+"siteFormValidateCode");var j=m.val();var k=[];if(p.length>0){$.each(p,function(H,E){if(E.hide){return true}var C=E.id;var O=E.name;var D=E.must;var w=E.type;var B=E.size;var K={};var J=E.openAreaCode;K.id=C;K.type=w;K.must=D;if(w==0){var M=$.trim($("#M"+b+"F"+q+"siteFormInput"+C).val());if(D&&M==""){Site.siteFormShowMsg(Fai.format(LS.siteFormSubmitInputIsEmpty,Fai.encodeHtml(O)),q,b);c=false;return false}if(M.length>l){Site.siteFormShowMsg(Fai.format(LS.siteFormSubmitInputMaxLength,Fai.encodeHtml(O),l),q,b);c=false;return false}K.val=M}else{if(w==1){var t=$.trim($("#M"+b+"F"+q+"siteFormTextArea"+C).val());if(D&&t==""){Site.siteFormShowMsg(Fai.format(LS.siteFormSubmitInputIsEmpty,Fai.encodeHtml(O)),q,b);c=false;return false}if(t.length>f){Site.siteFormShowMsg(Fai.format(LS.siteFormSubmitInputMaxLength,Fai.encodeHtml(O),f),q,b);c=false;return false}K.val=t}else{if(w==2){if(D&&$("input[name=M"+b+"F"+q+"siteFormRadioR"+C+"]:checked").length==0){Site.siteFormShowMsg(Fai.format(LS.siteFormSubmitCheckIsEmpty,Fai.encodeHtml(O)),q,b);c=false;return false}if($("input[name=M"+b+"F"+q+"siteFormRadioR"+C+"]:checked").length>0){K.val=$("input[name=M"+b+"F"+q+"siteFormRadioR"+C+"]:checked").first().val()}else{K.val=""}}else{if(w==3){if(D&&$("input[name=M"+b+"F"+q+"siteFormCheckboxR"+C+"]:checked").length==0){Site.siteFormShowMsg(Fai.format(LS.siteFormSubmitCheckIsEmpty,Fai.encodeHtml(O)),q,b);c=false;return false}var F=[];$("input[name=M"+b+"F"+q+"siteFormCheckboxR"+C+"]:checked").each(function(P,Q){F.push($(this).val())});K.val=F.join("\n")}else{if(w==4){if(D&&($("#M"+b+"F"+q+"siteFormSelect"+C+" option:selected").length==0||$("#M"+b+"F"+q+"siteFormSelect"+C+" option:selected").val()=="none")){Site.siteFormShowMsg(Fai.format(LS.siteFormSubmitCheckIsEmpty,Fai.encodeHtml(O)),q,b);c=false;return false}var s=[];$("#M"+b+"F"+q+"siteFormSelect"+C+" option:selected").each(function(P,Q){s.push($(this).val())});K.val=s.join("\n")}else{if(w==5){return true}else{if(w==6){var M=$("#M"+b+"F"+q+"siteFormInput"+C).val(),x=E.dateSetting?E.dateSetting.type:0,y=x==1?$("#M"+b+"F"+q+"siteFormInput"+C+"_end").val():"";if(D&&M==""){Site.siteFormShowMsg(Fai.format(LS.siteFormSubmitCheckIsEmpty,Fai.encodeHtml(O)),q,b);c=false;return false}if(D&&x==1&&y==""){Site.siteFormShowMsg(Fai.format(LS.siteFormSubmitCheckIsEmpty,Fai.encodeHtml(O)),q,b);c=false;return false}temInput=x==1?(M+" 至 "+y):M;K.val=temInput}else{if(w==7){var v=$("#module"+b).find("#siteForm"+b+"fileName"+C);var L={};if(D&&v.attr("_tmpFileId")==""){Site.siteFormShowMsg(Fai.format(LS.siteFormSubmitCheckHasFileUpload,Fai.encodeHtml(O)),q,b);c=false;return false}if(v.attr("_tmpFileId")==""){K.val=""}else{K.val=v.attr("_fileId");L.tmpFileName=v.attr("_tmpFileName");L.fileId=K.val;L.tmpFileId=v.attr("_tmpFileId");k.push(L)}}else{if(w==8){var N=$("#M"+b+"F"+q+"siteFormPhoneInput"+C).val();if(D&&N==""){Site.siteFormShowMsg(Fai.format(LS.siteFormSubmitInputIsEmpty,Fai.encodeHtml(O)),q,b);c=false;return false}if(!Fai.isNationMobile(N)){c=false;return false}if(N<1000000||N>99999999999){c=false;return false}if(J){var u=$("#M"+b+"F"+q+"siteFormSelectPhoneCT"+C).val();K.val=u+N}else{K.val=N}}else{if(w==9){var I=$("#M"+b+"F"+q+"siteFormMailInput"+C).val();if(D&&I==""){Site.siteFormShowMsg(Fai.format(LS.siteFormSubmitInputIsEmpty,Fai.encodeHtml(O)),q,b);c=false;return false}if(D&&!Fai.isEmail(I)){Site.siteFormShowMsg(Fai.format(LS.memberSignupUserAddItemCorrect,Fai.encodeHtml(O)),q,b);c=false;return false}K.val=I}else{if(w==10){var A=$("#M"+b+"F"+q+"siteFormIdentityInput"+C).val();if(D&&A==""){Site.siteFormShowMsg(Fai.format(LS.siteFormSubmitInputIsEmpty,Fai.encodeHtml(O)),q,b);c=false;return false}if(!Fai.isCardNo(A)){Site.siteFormShowMsg(Fai.format(LS.memberSignupUserAddItemCorrect,Fai.encodeHtml(O)),q,b);c=false;return false}K.val=A}else{if(w==11){var z=$("#M"+b+"F"+q+"siteFormSelectProvince"+C).find("option:selected").attr("_val");var G=$("#M"+b+"F"+q+"siteFormSelectCity"+C).find("option:selected").attr("_val");var r=$("#M"+b+"F"+q+"siteFormSelectCounty"+C).find("option:selected").attr("_val");if(D&&(z=="-1"||G=="-1")){Site.siteFormShowMsg(Fai.format(LS.siteFormSubmitInputIsEmpty,Fai.encodeHtml(O)),q,b);c=false;return false}K.val=z+G+r}}}}}}}}}}}}i.push(K)})}if(!c){return false}if(n&&j==""){Site.siteFormShowMsg(Fai.format(LS.siteFormSubmitInputIsEmpty,m.attr("msg")),q,b);c=false;return false}if(!e){e=""}var h="&submitContentList="+Fai.encodeUrl($.toJSON(i));Site.siteFormShowMsg(LS.siteFormSubmitIng,q,b);if((typeof($("#module"+b).data("siteFormAdd_is_reCommit"))=="undefined")||$("#module"+b).data("siteFormAdd_is_reCommit")==false){$("#module"+b).data("siteFormAdd_is_reCommit",true);$.ajax({type:"post",url:"ajax/siteForm_h.jsp",data:"cmd=addSubmit&formId="+q+"&submitContentList="+Fai.encodeUrl($.toJSON(i))+"&vCodeId="+b+q+"&validateCode="+j+"&tmpFileList="+Fai.encodeUrl($.toJSON(k)),error:function(){$("#module"+b).data("siteFormAdd_is_reCommit",false);var s=Site.getDialogContent(false,Fai.format(LS.siteFormSubmitError));var r={htmlContent:s,width:205,height:78};Site.popupBox(r)},success:function(r){$("#module"+b).data("siteFormAdd_is_reCommit",false);r=$.parseJSON(r);if(r.success){Fai.top.$("#siteFormMsgM"+b+"F"+q).hide();var w=[];w.push("<div class='voteSuccessPanel sweet-alert' style='margin-top:20px; height:180px;'>");w.push(" <div class='sa-icon sa-success animate' style='margin-top:0;'>");w.push(" <span class='sa-line sa-tip animateSuccessTip'></span>");w.push(" <span class='sa-line sa-long animateSuccessLong'></span>");w.push(" <div class='sa-placeholder'></div>");w.push(" <div class='sa-fix'></div>");w.push(" </div>");w.push(" <div class='voteSuccessTitle'>"+LS.siteFormSubmitOk+"</div>");w.push("</div>");var s={htmlContent:w.join(""),width:367,height:225,autoClose:3000};Site.popupBox(s);setTimeout(function(){location.href=e},3000);Site.siteFormValidation(q,b);Fai.top.$("#module"+b+" .siteForm input[type=text]").val("");Fai.top.$("#module"+b+" .siteForm textarea").val("");Fai.top.$("#module"+b+" .siteForm input[type=radio]").each(function(){$(this)[0].checked=false});Fai.top.$("#module"+b+" .siteForm input[type=checkbox]").each(function(){$(this)[0].checked=false});if(Fai.top.$("#module"+b+" .siteForm select")[0]!=undefined){Fai.top.$("#module"+b+" .siteForm select")[0].selectedIndex=0}Fai.top.$("#module"+b).find(".siteFormFileName").html(LS.siteFormSubmitNotSeletcFile);Fai.top.$("#module"+b).find(".siteFormFileName").removeAttr("_tmpFileId").removeAttr("_tmpFileName").removeAttr("title").removeAttr("_fileId")}else{if(r.hasFW){Site.siteFormShowMsg(r.msg,q,b)}else{if(r.rt==-4){Site.siteFormShowMsg(LS.siteFormSubmitCountLimit,q,b)}else{if(r.rt==-7){Site.siteFormShowMsg(LS.siteImgFull,q,b)}else{if(r.rt==-20){Site.siteFormShowMsg(r.msg,q,b)}else{if(r.rt==-401){Site.siteFormShowMsg(LS.siteFormSubmitValidateCodeErr,q,b);$("#M"+b+"F"+q+"siteFormValidateCode").val("");Site.siteFormValidation(q,b)}else{var v=LS.siteFormSubmitError,x=205,u=78;var w=Site.getDialogContent(false,Fai.format(v));if(r.rt==-28){var t=new Array();t.push("<div style='width: 80px; height:80px; border-radius:50%; border: 4px solid gray; border: 4px solid gray; margin: 0 auto; padding: 0; position: relative; top:25px; box-sizing: content-box; border-color: #F8BB86;'>");t.push("<div style='animation: pulseWarningIns 0.75s infinite alternate; -webkit-animation: pulseWarningIns 0.75s infinite alternate;'>");t.push("<span style='position: absolute; width: 5px; height: 47px; left: 50%; top: 10px; webkit-border-radius: 2px; border-radius: 2px; margin-left: -2px; background-color: #F8BB86;'></span>");t.push("<span style='position: absolute; width: 7px; height: 7px; -webkit-border-radius: 50%; border-radius: 50%; margin-left: -3px; left: 50%; bottom: 10px; background-color: #F8BB86;'></span>");t.push("</div>");t.push("</div>");t.push("<div style='color:#333; font-size:16px; padding-top: 48px; text-align:center;'>"+LS.hasSubmitThisSiteForm+"</div>");x=367,u=225;w=t.join("")}Fai.top.$("#siteFormMsgM"+b+"F"+q).hide();var s={htmlContent:w,width:x,height:u};Site.popupBox(s);if(r.rt==-28){setTimeout(function(){document.location.reload()},2000)}}}}}if(r.needCode){Site.siteFormShowMsg(r.msg,q,b);$("#module"+b+" .J_formValidation").removeClass("siteFormValidationHide")}}}}})}};Site.fixLowIePlaceholder=function(c,b){var a=false;if(Fai.isIE){if(Fai.isIE6()||Fai.isIE7()||Fai.isIE8()||Fai.isIE9()){a=true}}if(!a){$(Fai.top.$("#module"+b+"").find(".resize:not(select)")).each(function(){var d=$(this).attr("_placeHolder");$(this).attr("placeHolder",d)})}else{remind=function(e,g){var f=g,d=e.defaultValue;if(!d){e.val(f).addClass("phcolor")}e.focus(function(){if(e.val()==f){$(this).val("")}});e.blur(function(){if(e.val()==""){$(this).val(f).addClass("phcolor")}});e.keydown(function(){$(this).removeClass("phcolor")})};$(Fai.top.$("#module"+b+"").find(".resize:not(select)")).each(function(){var d=$(this).attr("_placeHolder");remind($(this),d)})}};Site.siteFormNotLogin=function(d,c){var b=Fai.encodeUrl(Fai.top.location.href);var a=LS.siteFormSubmitNotLogin+"<a href='login.jsp?url="+b+"'>"+LS.login+"</a>"+LS.period;Site.siteFormShowMsg(a,d,c)};Site.siteFormShowMsg=function(c,b,a){Fai.top.$("#siteFormMsgM"+a+"F"+b).show();Fai.top.$("#siteFormMsgM"+a+"F"+b).html(c)};Site.siteFormTimeBtn=function(c){var d=parseInt($.format.date(new Date(),"yyyy"))+10,d="1900:"+d,f=124,b;for(var e=0,a=c.length;e<a;e++){b=c[e].dateSetting;(function(q,l){var t=$("#"+l),h=t.hasClass("fk-startTime"),n=t.hasClass("fk-endTime"),m=t.closest(".siteFormMiddle"),x=q.type==1,u=(q.type==0&&q.accuracy==1),k=new Date(),v=new Date(k.getFullYear(),k.getMonth(),k.getDate()),w=v.getTime(),r=(q.type==0&&$.inArray(w,q.od.unSelectDay)==-1),j=(!!q.od.unSelectDay?q.od.unSelectDay.concat([]).sort(function(y,i){return y-i}):[]),p=0,s;for(var o=0;o<24;o++){if($.inArray(o,q.ot.unSelectTime)==-1){p=o;break}}s=q.banPassDate==1?v:new Date(1900,0,1);t.datetimepicker({dateFormat:"yy-mm-dd",changeYear:true,changeMonth:true,showButtonPanel:r,yearRange:d,zIndex:9033,hour:p,controlType:"fkControl",showMinute:false,showTime:false,hourText:"",hourAccuracy:true,minDate:s,showTimepicker:u,autoChangeMonthYear:false,beforeShow:function(i,z){var y=0;z.dpDiv.addClass("fk-siteFormDatePicker");if(h&&z.startDateNotLimit){z.settings.minDate=s;z.settings.maxDate=null;z.startDateNotLimit=false}$("#g_main").off("scroll.timepicker").on("scroll.timepicker",function(){if(z.dpDiv.is(":visible")&&y++>10){$(i).datetimepicker("hide");y=0}})},afterShow:function(i,z){var y,A;if(n){y=l.replace("_end","");A=new Date($("#"+y).val());if(!!A.getTime()){$.datepicker._selectToMonthYearDate("#"+i.id,z,A.getMonth(),A.getFullYear(),A.getDate())}}},onAfterUpdatePicker:function(B){var z=B.dpDiv.find(".ui-datepicker-today"),A=z.find(".ui-state-default"),i=new Date(B.currentYear,B.currentMonth,B.currentDay),C=B.currentYear!=0||B.currentMonth!=0||B.currentDay!=0,y=new Date(k.getFullYear(),k.getHours(),k.getDate());if(A.hasClass("ui-state-hover")&&!C){A.addClass("fk-todayDefaultStyle")}else{B.dpDiv.find(".ui-state-hover").removeClass("ui-state-hover")}},beforeShowTime:function(i){if(q.ot.unSelectTime.length>0&&$.inArray(i,q.ot.unSelectTime)>-1){return false}return true},beforeShowDay:function(i){return g(i)},onSelect:function(B,E){var z=B.replace(/-/g,"/"),G=new Date(z),I=new Date(G.getFullYear(),G.getMonth(),G.getDate()).getTime(),H=E.input,F={minDate:s,maxDate:null},A,y;if(h){if(q.banAll==1||q.banHoliday==1||j.length>0){for(D=0;D<365;D++){nextDay=new Date(I+(D*86400000));if(!g(nextDay)[0]){F.maxDate=nextDay;break}}}E.startDateNotLimit=true;F.minDate=new Date(z);$("#"+l+"_end").datetimepicker("option",F)}else{if(n){A=l.replace("_end","");for(var C=j.length,D=C;D>=0;D--){if(I>=j[D]){y=D;break}}if(typeof y=="number"&&q.od.t==1){F.minDate=s.getTime()<j[y]?new Date(j[y]):s}E.startDateNotLimit=false;F.maxDate=new Date(z);$("#"+A).datetimepicker("option",F)}}if(!u){E.inline=false}},onAfterSelect:function(i,y){if(!y.inline&&h){$("#"+l+"_end").focus()}}});if(n){$("#"+l+"_mask").on("click",function(){$("#"+l.replace("_end","")).focus()})}if(x&&t.width()<=f){m.find(".fk-timeUtile").addClass("fk-timeMinStyle");if(n){m.find(".fk-endTimeWrap").addClass("fk-timeMinStyle")}else{t.addClass("fk-timeMinStyle")}}})(b,c[e].id)}function g(j){var i=true,h=j.getDay(),k=j.getTime();if(b.banAll==1){i=false}if(h==0||h==6){if(b.banHoliday==1){i=false}else{i=true}}if(b.od.t==1&&$.inArray(k,b.od.unSelectDay)>-1){i=false}if(b.od.t==1&&$.inArray(k,b.od.openDay)>-1){i=true}return[i,""]}};Site.siteFormValidation=function(b,a){$("#M"+a+"F"+b+"validateCodeImg").attr("src","validateCode.jsp?"+parseInt(Math.random()*1000)+"&vCodeId="+a+b)};Site.fixSiteFormStyle=function(f,a,b,d,i){Fai.top.$(".siteFormItem_N_U").find(".F"+f+"siteFormItemShowVal").find("textarea").parent().css({height:"102px"});Fai.top.$("#module"+a+"").css("overflow","hidden");if(Fai.top.$("#module"+a+"").width()<=400){if(Fai.top.$("#module"+a+"").find(".siteFormItemTable_N_U").is("table")){$(Fai.top.$("#module"+a+"").find(".siteFormItemTable_N_U")).css({padding:"0"});$(Fai.top.$("#module"+a+"").find(".siteForm")).css({padding:"0 25px"})}if($(Fai.top.$("#module"+a+"").find(".siteFormItem_N_U").find(".siteFormItemCheckItem_N_U_A")).length>0){$(Fai.top.$("#module"+a+"").find(".siteFormItemCheckItem_N_U_A")).css({"margin-right":"12px"});$(Fai.top.$("#module"+a+"").find(".siteFormItemCheckItem_N_U_A").find("input")).css({"float":"left"});$(Fai.top.$("#module"+a+"").find(".siteFormItemCheckItem_N_U_A").find("label")).each(function(){$(this).wrapAll("<div style='float:left;width:100px;'></div>")})}if($(Fai.top.$("#module"+a+"").find(".siteFormValidate_N_U")).length>0){if(!d){$(Fai.top.$("#module"+a+"").find(".siteFormValidate_N_U").find(".siteFormValidate")).css({margin:"4px 0 0 0"});$(Fai.top.$("#module"+a+"").find(".siteFormValidate_N_U").find(".star")).css({"margin-top":"4px"})}}if($(Fai.top.$("#module"+a+"").find(".siteFormValidate_N_U")).length>0){$(Fai.top.$("#module"+a+"").find(".siteFormValidate_N_U").find("input")).css({width:"92%","max-width":"400px"})}if($(Fai.top.$("#module"+a+"").find(".faiButton")).length>0){$(Fai.top.$("#module"+a+"").find(".faiButton")).css({width:"95%"})}if($(Fai.top.$("#module"+a+"").find("#buttonStyle")).length>0){if(d){if(Fai.top.$("#module"+a+"").width()<=220){$(Fai.top.$("#module"+a+"").find("#buttonStyle").find(".s_ibutton")).css({width:"100%"})}$(Fai.top.$("#module"+a+"").find("#buttonStyle")).css({width:"100%"})}else{$(Fai.top.$("#module"+a+"").find("#buttonStyle")).css({width:"77%"})}}if($(Fai.top.$("#module"+a+"").find(".address-resize")).length>0){$(Fai.top.$("#module"+a+"").find(".address-resize")).find(".three-resize").css({width:"94%","margin-bottom":"10px"});$(Fai.top.$("#module"+a+"").find(".address-resize")).find(".three-resize").last().css({"margin-bottom":""});var c=$(Fai.top.$("#module"+a+"").find(".address-resize").find("select").first()).width();$(Fai.top.$("#module"+a+"").find(".address-resize").parent().find(".star")).css({position:"absolute",left:c+25+"px"})}if($(Fai.top.$("#module"+a+"").find(".phone-resize")).length>0){$(Fai.top.$("#module"+a+"").find(".phone-resize")).find(".two-resize").first().css({width:"94%","margin-bottom":"10px"});$(Fai.top.$("#module"+a+"").find(".phone-resize")).find(".two-resize").last().css({width:"93%","margin-bottom":""});var c=$(Fai.top.$("#module"+a+"").find(".phone-resize").find("select")).width();$(Fai.top.$("#module"+a+"").find(".phone-resize").parent().find(".star")).css({position:"absolute",left:c+25+"px"})}}if(Fai.top.$("#module"+a+"").find(".siteFormAddButton").find("#buttonStyle").find(".middle").width()>241){Fai.top.$("#module"+a+"").find(".siteFormAddButton").find("#buttonStyle").find(".middle").css({width:"240px"})}$(Fai.top.$(".siteFormItem_N_U").find("select")).each(function(){if($(this).attr("id").indexOf("siteFormSelectPhoneCT")==-1){$($(this).find("option")[0]).hide()}});if($(Fai.top.$("#module"+a+"").find(".siteFormItem_N_U").find(".siteFormItemCheckItem_N_U_F")).length>0){var h=Fai.top.$("#module"+a+"").find(".siteFormItemCheckItem_N_U_F").width();var g=(h/b-10)+"px";var e=((h/b-54)<=36)?36:(h/b-54)+"px";Fai.top.$("#module"+a+"").find(".siteFormRadioFix").css({width:g});Fai.top.$("#module"+a+"").find(".siteFormRadioCententFix").css({width:e})}if(i&&i.length>0){$(Fai.top.$("#module"+a+"").find(".siteFormItem_N_U").find(".resize")).each(function(){var k=$(this).attr("_id");var l=$(this).attr("_show");for(var j=0;j<i.length;j++){if(i[j].wo!=l){break}if(i[j].i==k){$(this).css({width:i[j].w*100+"%"});$(this).attr("_width",i[j].w)}}})}};Site.siteFormFileUpload=function(h){var j=h.fileSize;var i=h.siteFormItemId;var f=h.siteFormId;var t=h.moduleId;var e=h.fileTypeList;var q=h.buttonValue;var d=h.isModuleButtonStyle;var o=h.showType;var l=h.srcjQueryUploadPath;var s;var v;var g=document.documentElement||document.body;var k=$("#siteForm"+t+"fileUpload"+i);var b=k.parent().width();var c=Fai.top.$("#module"+t+"").width();var a=b*0.31;var u;if(d){if(c<=400){if(o){a=(c-60)*0.95}else{a=(c-10)*0.75*0.92}if(a>161){a=161}}else{if(a<111){a=111}else{if(a>161){a=161}}}}if(!Fai.isIE()){var p={auto:true,fileTypeExts:e.join(""),multi:true,fileSizeLimit:j*1024*1024,fileSplitSize:20*1024*1024,breakPoints:true,isBurst:false,saveInfoLocal:false,showUploadedPercent:true,showUploadedSize:true,removeTimeout:9999999,post_params:{app:21,type:0,fileUploadLimit:j},getFileSizeUrl:"/ajax/advanceUpload.jsp?cmd=_getUploadSize",uploader:"/ajax/advanceUpload.jsp?cmd=_mobiupload",onUploadSuccess:function(x,z){var y=$.parseJSON(z);if(y.success){var w={status:"end",id:x.id,title:"上传成功。"};Fai.ing("文件: "+x.name+" 上传成功",true);n("upload",y,t,i)}else{var w={status:"end",id:x.id,title:y.msg};Fai.ing("文件:"+x.name+","+y.msg)}},onUploadError:function(w,x){$("#progressBody_"+w.id).remove();$("#progressWrap_"+w.id).remove();Fai.ing("网络繁忙,文件:"+w.name+"上传失败,请稍后重试")}};function r(){s=k.uploadify(p);k.css("width",a+2);k.on("click",function(){k.find("a")[0].click()})}if(typeof k.uploadify=="function"){r()}else{v=document.createElement("script");v.src=l;v.type="text/javascript";g.appendChild(v);v.onload=function(){r()}}}else{if(d){u=5}else{u=3}if(navigator.userAgent.toLowerCase().indexOf("se 2.x")>-1){u=6}var m={file_post_name:"Filedata",upload_url:"/ajax/upsiteimg_h.jsp",button_placeholder_id:"siteForm"+t+"fileUpload"+i,file_size_limit:j+"MB",button_image_type:u,file_queue_limit:1,requeue_on_error:false,button_height:d?"34":"22",button_width:d?(a-2):"71",button_text:d?"<span class='fk_btText'>"+q+"</span>":"",button_text_style:d?".fk_btText{text-align:center; font-family: 微软雅黑; color: #666666;}":"",button_text_top_padding:d?8:"",post_params:{ctrl:"Filedata",app:21,type:0,isSiteForm:true},file_types:e.join(""),file_dialog_complete_handler:function(w){this._allSuccess=false;this.startUpload()},file_queue_error_handler:function(x,w,y){switch(w){case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:Fai.ing(LS.siteFormSubmitCheckFileSizeErr,true);break;case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:Fai.ing("不允许的文件类型",true);break;case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED:Fai.ing("一次只能上传一个文件",true);break;default:Fai.ing("请重新选择文件上传。",true);break}},upload_success_handler:function(x,w){var y=jQuery.parseJSON(w);this._allSuccess=y.success;this._sysResult=y.msg;if(y.success){Fai.ing(Fai.format(LS.siteFormSubmitFileUploadSucess,Fai.encodeHtml(x.name)),true);n("upload",y,t,i)}else{Fai.ing("文件"+x.name+","+y.msg)}},upload_error_handler:function(x,w,y){if(w==-280){Fai.ing("文件取消成功",false)}else{if(w==-270){Fai.ing("已经存在名称为"+x.name+"的文件。",true)}else{Fai.ing("服务繁忙,文件"+x.name+"上传失败,请稍候重试。")}}},upload_complete_handler:function(w){if(w.filestatus==SWFUpload.FILE_STATUS.COMPLETE){setTimeout(function(){s.startUpload()},s.upload_delay)}else{if(w.filestatus==SWFUpload.FILE_STATUS.ERROR){Fai.ing("服务繁忙,文件"+w.name+"上传失败,请稍候重试。")}}},upload_start_handler:function(w){Fai.enablePopupWindowBtn(0,"save",false);Fai.ing("读取文件准备上传",false)},view_progress:function(w,z,y,x){Fai.ing("正在上传"+x+"%",false)}};s=SWFUploadCreator.create(m)}function n(L,G,M,D){if(L=="upload"){var A=G.id;var I=G.name;var y=G.type;var F=G.size;var E=G.path;var z=G.createTime;var w=G.groupId;var B="";var x=100;var H=100;var C=G.fileId;var J=$("#module"+M);var K=J.find("#siteForm"+M+"fileName"+D);J.find("#siteForm"+M+"FUDesc"+D).hide();K.show();K.html(I);K.attr("_tmpFileId",A).attr("_tmpFileName",I).attr("title",I).attr("_fileId",C)}}};Site.siteFormInputResize=function(d,c){var a=Fai.top.$("#module"+c+"").find(".siteFormItem_N_U").find(".resize");var b=false;if(a.length<1){return}if(Fai.top.$("#module"+c+"").width()<=400){b=true}a.each(function(){var n=$(this),g=Fai.isIE8()?$(document):$(window),o=$("#g_main"),l,h,m,f=$(this),j,i={};if(n.hasClass("resize")){if(n.is("textarea")){n.before("<div class='u-inputResize-w' style='height:100px;' title='可拖动调节宽度'><div style='position:absolute;width:3px;height:100px;border-left:1px dashed #2b73ba;'></div></div>");n.after("<div class='u-inputResize-e' style='height:100px;' title='可拖动调节宽度'><div style='position:absolute;width:3px;height:100px;border-left:1px dashed #2b73ba;'></div></div>")}else{n.before("<div class='u-inputResize-w' title='可拖动调节宽度'><div style='position:absolute;width:3px;height:34px;border-left:1px dashed #2b73ba;'></div></div>");n.after("<div class='u-inputResize-e' title='可拖动调节宽度'><div style='position:absolute;width:3px;height:34px;border-left:1px dashed #2b73ba;'></div></div>")}}l=$(n).prev();h=$(n).next();if(!l.hasClass("u-inputResize-w")||!h.hasClass("u-inputResize-e")){return}l.off("mousedown.fi").on("mousedown.fi",e);h.off("mousedown.fi").on("mousedown.fi",e);function e(q){q=q||window.event;i.x=q.pageX;g.css("cursor","n-resize!important");if($(this).hasClass("u-inputResize-w")){i.dir="w";i.ptb=parseInt(f.css("width"))}else{if($(this).hasClass("u-inputResize-e")){i.dir="e";i.ptb=parseInt(f.css("width"))}}i.elem=$(this);$(this).addClass("u-inputResize-show");i.ieFirstChange=$("#saveButton").hasClass("buttonDisabled");j=$("#dockTip").show().css({left:"-1000px;",top:"-1000px"});g.off("mousemove.fi").on("mousemove.fi",k);g.off("mouseup.fi").on("mouseup.fi",p);q.preventDefault()}function k(t){t=t||window.event;var u={x:t.pageX},r,w,q=n.parent().width()*0.3,s=n.parent().width()*0.93,v="";if(n.hasClass("phone-resize")||n.hasClass("address-resize")||n.hasClass("date-resize")){s=n.parent().width()}if(i.dir=="w"){r=i.x-u.x;w=i.ptb+r;w=w>q?w:q;w=w>s?s:w;w=Math.round(w);v="宽度:"}else{if(i.dir=="e"){r=u.x-i.x;w=i.ptb+r;w=w>q?w:q;w=w>s?s:w;w=Math.round(w);v="宽度:"}}n.css({width:w+"px"});j.html(v+w).css({left:t.pageX-28,top:t.pageY-40});Site.siteFormInputResizeLine(n,d,c);t.preventDefault()}function p(s){s=s||window.event;i.dir="";g.css("cursor","");g.off("mousemove.fi");g.off("mouseup.fi");j.hide();i.elem.removeClass("u-inputResize-show");Fai.top.$("body").find(".inputResizeLine").hide();var r=n.width()/(n.parent().width()-2);n.attr("_width",Math.round(r*1000)/1000);var q=Site.getModuleAttr(c);q.data.changed=true;Site.styleChanged();i={};s.preventDefault()}})};Site.siteFormInputResizeLine=function(d,h,b){var j=Fai.top.$("#module"+b+"").find(".siteFormItem_N_U").find(".resize"),m=j.length,k=$(j[0]).offset().top-15+"px",c=d.offset().left+d.width()+"px",l=($(j[m-1]).offset().top-$(j[0]).offset().top+60)+"px",a=false;if(Fai.isIE){if(Fai.isIE6()||Fai.isIE7()||Fai.isIE8()){a=true}}if(a){var g=[];for(var e=0;e<j.length;e++){if(!$(d).is(j[e])){g.push(j[e])}}$(g).each(function(){var i=d.width();var o=$(this).width();if(d.hasClass("phone-resize")||d.hasClass("address-resize")||d.hasClass("date-resize")){i=i*0.93}if($(this).hasClass("phone-resize")||$(this).hasClass("address-resize")||$(this).hasClass("date-resize")){o=o*0.93}var n=$(this).offset().left+o+"px";if(Math.abs(i-o)<3){if(!Fai.top.$("body").find(".inputResizeLine").is("div")){Fai.top.$("body").append("<div class='inputResizeLine' style='display:none;height:"+l+";width:1px;position:absolute;left:"+n+";top:"+k+";border-right:1px solid #2b73ba;'></div>")}else{Fai.top.$("body").find(".inputResizeLine").css({left:n,top:k,height:l})}Fai.top.$("body").find(".inputResizeLine").show();return false}else{Fai.top.$("body").find(".inputResizeLine").hide()}})}else{function f(i){return !$(i).is(d)}$($.makeArray(j).filter(f)).each(function(){var i=d.width();var o=$(this).width();if(d.hasClass("phone-resize")||d.hasClass("address-resize")||d.hasClass("date-resize")){i=i*0.93}if($(this).hasClass("phone-resize")||$(this).hasClass("address-resize")||$(this).hasClass("date-resize")){o=o*0.93}var n=$(this).offset().left+o+"px";if(Math.abs(i-o)<3){if(!Fai.top.$("body").find(".inputResizeLine").is("div")){Fai.top.$("body").append("<div class='inputResizeLine' style='display:none;height:"+l+";width:1px;position:absolute;left:"+n+";top:"+k+";border-right:1px solid #2b73ba;'></div>")}else{Fai.top.$("body").find(".inputResizeLine").css({left:n,top:k,height:l})}Fai.top.$("body").find(".inputResizeLine").show();return false}else{Fai.top.$("body").find(".inputResizeLine").hide()}})}};Site.siteFormAddressInit=function(i,c,b,f,j){var g=[];var h;var d;var a;var e;if(f==2052||f==1028){h=site_cityUtil.getProvince()}else{h=site_cityUtil.getProvinceEn()}$.each(h,function(k,l){if(f==2052||f==1028){g.push("<option _val='"+l.name+"' value='"+l.id+"'>"+site_cityUtil.simpleCityNameStr(l.name)+"</option>")}else{g.push("<option _val='"+l.name+"' value='"+l.id+"'>"+site_cityUtil.simpleCityNameStrEn(l.name)+"</option>")}});$("#M"+b+"F"+c+"siteFormSelectProvince"+i+"").html("").html("<option _val='-1' value='-1'>"+j+"</option>"+g.join("")).change(function(k){d=$("#M"+b+"F"+c+"siteFormSelectProvince"+i+"").val();if(isNaN(d)||d<=0){$("#M"+b+"F"+c+"siteFormSelectCity"+i+"").html("").html("<option value='-1'>"+j+"</option>");$("#M"+b+"F"+c+"siteFormSelectCounty"+i+"").html("").html("<option value='-1'>"+j+"</option>")}a=[];if(f==2052||f==1028){citylist=site_cityUtil.getCities(d)}else{citylist=site_cityUtil.getCitiesEn(d)}$.each(citylist,function(l,m){a.push("<option _val='"+m.name+"' value='"+m.id+"' >"+m.name+"</option>")});$("#M"+b+"F"+c+"siteFormSelectCity"+i+"").removeAttr("disabled");$("#M"+b+"F"+c+"siteFormSelectCity"+i+"").html("").html("<option _val='-1' value='-1'>"+j+"</option>"+a.join("")).unbind().bind("change",function(l){cityId=$("#M"+b+"F"+c+"siteFormSelectCity"+i+"").val();if(isNaN(cityId)||cityId<=0){$("#M"+b+"F"+c+"siteFormSelectCounty"+i+"").html("").html("<option _val='-1' value='-1'>"+j+"</option>")}e=[];if(f==2052||f==1028){countylist=site_cityUtil.getCounty(cityId)}else{countylist=site_cityUtil.getCountyEn(cityId)}$.each(countylist,function(m,n){e.push("<option _val='"+n.name+"' value='"+n.id+"' >"+n.name+"</option>")});$("#M"+b+"F"+c+"siteFormSelectCounty"+i+"").removeAttr("disabled");$("#M"+b+"F"+c+"siteFormSelectCounty"+i+"").html("").html("<option _val='-1' value='-1'>"+j+"</option>"+e.join("")).unbind().bind("change",function(m){});if($("#M"+b+"F"+c+"siteFormSelectCounty"+i+"").find("option").length<=1&&cityId!=-1){$("#M"+b+"F"+c+"siteFormSelectCounty"+i+"").hide()}else{$("#M"+b+"F"+c+"siteFormSelectCounty"+i+"").show()}})})};Site.siteFormPhoneValidate=function(d,c,a){var b=$("#M"+c+"F"+d+"siteFormPhoneInput"+a);b.blur(function(){var e=$(this).val().trim();if(!e){$(this).val("")}if(e.length<7||e.length>11){Fai.ing("请输入合法的手机号码!");$(this).val("")}});b.focus(function(){$(this).off("mousewheel.disabledScroll").on("mousewheel.disabledScroll",function(e){e.preventDefault()});$(this).off("keydown.preventDefault").on("keydown.preventDefault",function(e){if(e.keyCode==38||e.keyCode==40){e.preventDefault()}if(e.keyCode==13){$(this).trigger("blur")}})})};Site.addFlashModuleFlash=function(a){var c="Opaque";if(a.transparent!=1){c="transparent"}var b=['<embed id="'+a.moduleId+'" width="'+a.width+'" height="'+a.height+'" allowscriptaccess="'+a.allowScriptAccess+'" style="visibility: visible;" pluginspage="http://get.adobe.com/cn/flashplayer/" flashvars="playMovie=true&amp;auto=1" allowfullscreen="true" quality="hight" src="'+a.path+'" type="application/x-shockwave-flash" wmode="'+c+'"></embed>'];$("#flashModuleFlash"+a.moduleId).append(b.join(""))};Site.noticeMarquee=function(f,x){var w={direction:"up",speed:"normal",loop:"infinite",moveout:false,isScrolling:false};$.extend(w,f);if(w.speed=="normal"){$.extend(w,{speed:28})}else{if(w.speed=="slow"){$.extend(w,{speed:60})}else{$.extend(w,{speed:13})}}$("#noticeMarquee"+w.id).data("options",f);var m=w.id,u=$("#noticeMarquee"+m),h=u.outerHeight(true),g=u.outerWidth(true),p=u.children().width(),c=$("#noticeContainer"+m),d=c.outerWidth(),l=(p>d)?p:d;if(x!=null){var k=$("#noticeMarquee"+x).width();k=k?k:0;g=k;l=(g>d)?g:d;Fai.stopInterval("rm"+x);$("#noticeMarqueeCopy"+x).remove();$(u).appendTo($("#noticeContainer"+x));$("#noticeMarqueeNewParent"+x).remove()}var B=w.direction,z=0,j="left",r=w.speed,A=(w.loop!="infinite"||w.loop<=0)?1:w.loop,n=w.moveout,C=w.isScrolling,v=w.noticeType,y=20,t=$("<div id='noticeMarqueeCopy"+m+"' class='noticeMarquee' style='overflow:hidden;width:"+l+"px;' ></div>");var i="<div id='noticeMarqueeNewParent"+m+"' style='position:relative;overflow:hidden;width:"+l*2+";";if(v!=4){i+="left:23px;'></div>"}else{i+="'></div>"}var o=$(i);function q(){o.appendTo(u.parent());u.appendTo(o);t.appendTo(o);if(!C&&!n){}else{$(u.html()).appendTo(t)}if(B=="left"){z=h;j="left"}else{z=0-l;if(C&&!n){z=0}if(C&&n){z=-l}j="left"}if(n){u.css(j,0)}else{u.css(j,z)}if(B=="left"||B=="right"){u.css("top",0)}$("#module"+m+" .noticeContainer").mouseover(function(){Fai.stopInterval("rm"+m)}).mouseout(function(){if(A=="infinite"||A>0){Fai.startInterval("rm"+m)}});e();a(B)}function b(){var D=u.find("img");if(D.length>0){var F=D[0].width;for(var E=0;E<D.length;E++){if(F<D[E].width){F=D[E].width}}return F}return 0}function e(){var D=u.find("img");$(D).load(function(){var E=u.height();if(h!=E){h=E;a(B)}})}function a(D){if(D=="left"||D=="right"){o.css("position","relative");o.css("width",l);t.css("top",0);if(D=="left"){t.css("margin-left",y);if(C&&!n){u.css("left",l);t.css("left",l*2)}if(C&&n){t.css("left",l+50)}if(!C&&!n){u.css("left",g);t.css("left",l+g)}if(!C&&n){t.css("left",l+g)}}else{t.css("left",0);u.css("margin-left",y);u.css("width",(l)+"px");if(C&&!n){u.css("padding-left",l);u.css("padding-right",l);o.scrollLeft(l*2+y)}if(C&&n){u.css("padding-left",l);o.scrollLeft(l*2)}if(!C&&!n){u.css("padding-right",l+g);u.css("padding-left",l+g);o.scrollLeft(l+g+y)}if(!C&&n){u.css("padding-right",l+g);u.css("padding-left",l+g);o.scrollLeft(l+g+y)}}}}function s(){if(B=="left"){var D=o.scrollLeft();D++;if(C&&!n){if(D==l*2+y){o.scrollLeft(l)}else{o.scrollLeft(D)}}if(C&&n){if(D==l+50+y){o.scrollLeft(0)}else{o.scrollLeft(D)}}if(!C&&!n){if(D==(l+g)+y){o.scrollLeft(0)}else{o.scrollLeft(D)}}if(!C&&n){if(D==l+g+y){o.scrollLeft(0)}else{o.scrollLeft(D)}}}else{if(B=="right"){var D=o.scrollLeft();D--;if(C&&!n){if(D==-1){o.scrollLeft(l+y)}else{o.scrollLeft(D)}}if(C&&n){if(D==-1){o.scrollLeft(l+y)}else{o.scrollLeft(D)}}if(!C&&!n){if(D==-1){o.scrollLeft(l+g+y)}else{o.scrollLeft(D)}}if(!C&&n){if(D==-1){o.scrollLeft(l+g+y)}else{o.scrollLeft(D)}}}}}if(f!=null){q();Fai.addInterval("rm"+m,s,r);Fai.startInterval("rm"+m)}};Site.saveNoticeMarqueeProps=function(a){if(a!=null){$("#noticeMarquee"+a.id).data("options",a)}$("#module"+a.id).on("Fai_onModuleSizeChange",function(){Site.noticeMarquee($("#noticeMarquee"+a.id).data("options"),a.id)});$("#module"+a.id).on("Fai_onModulePositionChange",function(){Site.noticeMarquee($("#noticeMarquee"+a.id).data("options"),a.id)})};Site.revertIcon=function(d){var c=$("#module"+d);var b=false;var a=c.find(".noticeContainer").height();if(c.find(".noticeFontIcon").length!=0){b=true}if(b){c.find(".noticeFontIcon").css("line-height",a+"px")}else{c.find(".noticeImg").css("margin-top",(a-21)/2+"px")}};Site.noticeMarqueeUpDown=function(c){var b={direction:"top",speed:"normal",stopTime:1000};$.extend(b,c);if("fast"===b.speed){$.extend(b,{speed:500})}else{if("slow"===b.speed){$.extend(b,{speed:1100})}else{$.extend(b,{speed:850})}}var g=$("#noticeScrollbar"+b.id+" li");if(g.length==1){var f=$(g.get(0));var a="<li class='scrollbarLi'>"+f.html()+"</li>";$(a).insertAfter(f)}$("#noticeScrollbar"+b.id).marquee({yScroll:b.direction,showSpeed:b.speed,pauseSpeed:b.stopTime,hoverChange:false});var e=$("#module"+b.id+" .formMiddleContent");e.css("overflow","hidden");e.css("width","98%");var d=$("#module"+b.id+" .formMiddleCenter");d.css("overflow","hidden")};Site.noticeUpDownSizeChange=function(d){var b=$("#noticeMarquee"+d),a=b.height(),c=b.children().children();$.each(c,function(e,f){$(f).css("top",-(a+2)+"px")});$("#noticeScrollbar"+d).removeData("_innerHeight")};Site.setSerTextOverflow=function(d){var c=$("#serOnline-container"+d);var e=c.find(".serOnline-service").children(".serOnline-list-h");var a=c.find(".serOnline-contact").children(".serOnline-list-h");var b=c.outerWidth(),f=c.outerHeight();Site.setSerListCSS(e,b);Site.setSerListCSS(a,b)};Site.setSerListCSS=function(a,d){var c,f,e,b;$.each(a,function(h,g){c=$(g).outerWidth();if(c>d-3){if(f!=null&&f<d-3){$('<div style="clear:both;"></div>').insertAfter($(g).prev())}b=$(g).outerWidth();$(g).css("white-space","normal");$(g).css("word-break","break-all");e=true}f=e?b:$(g).outerWidth();e=false})};Site.initCustomIframe=function(d){var g=Fai.top.$("#iframe"+d);var b=g.attr("width");var c=g.attr("height");var a=g.attr("src");var e="<iframe id='iframe"+d+"' frameborder='0' height='"+c+"' width='"+b+"'></iframe>";var f=$(e);g.replaceWith(f);f.attr("src",g.attr("src"))};Site.initModuleWeiboShow=function(b,e,a,d){var h=Fai.top.$("#wbShowFrame"+e);var g=h.attr("width");var f=h.attr("height");var i="<iframe id='wbShowFrame"+e+"' name='wbShowFrame' frameborder='0' scrolling='no' height='"+f+"' width='"+g+"' src='about:blank'></iframe>";h.replaceWith(i);var c=Fai.top.$("#wbShowFrame"+e).parent().width();var j=a+c+"&ran="+Math.random();Site.initIframeLoading(b,e,j,d);$("#refreshChlid"+e).css("padding-top","40%")};Site.initLocaler=function(b,a){if(typeof Fai.top._localerJsonTmp=="undefined"){Fai.top._localerJsonTmp=b}if(a){Site.initLocalerManage(b)}else{Site.initLocalerSite()}Site.checkLocalerItemWidthForIE();Site.bindLocalerItemEvent()};Site.initLocaleStyle=function(b){var a=$("#webTop").width();if(b>a){$("#localer").css("left","auto");$("#localer").css("right",a-b-$("#localer").width()+"px")}else{$("#localer").css("left",b);$("#localer").css("right","auto")}};Site.initLocalerSite=function(){$("#localer").bind("mouseenter",function(){Site.openLocalerList()}).bind("mouseleave",function(){Site.closeLocalerList(this)})};Site.openLocalerList=function(){var b=parseInt($("#localer").attr("_moduleStyle"));if(b>=1&&b<=3){return}var a=$("#localer").find(".J_localerList").height();if(Fai.isIE()){$("#localer").find(".J_localerPanel").stop().animate({height:a},{duration:200})}else{$("#localer").find(".J_localerPanel").css("height",a+"px")}$("#localer").find(".J_localerPanel .J_localerList .first .arrow").addClass("arrow_hover")};Site.closeLocalerList=function(c){var b=parseInt($("#localer").attr("_moduleStyle"));if(b>=1&&b<=3){return}var a=$("#localer").find(".J_localerPanel .J_localerList .first").height();if(Fai.isIE()){$("#localer").find(".J_localerPanel").stop().animate({height:a},{duration:200})}else{$("#localer").find(".J_localerPanel").css("height",a+"px")}$("#localer").find(".J_localerPanel .J_localerList .first .arrow").removeClass("arrow_hover")};Site.bindLocalerItemEvent=function(){$("#localer").find(".J_localerPanel .J_localerList .localerItemContent").bind("mouseenter",function(){if($(this).hasClass("first")){return}$(this).addClass("localerItemContent_hover")}).bind("mouseleave",function(){if($(this).hasClass("first")){return}$(this).removeClass("localerItemContent_hover")})};Site.checkLocalerItemWidthForIE=function(){Fai.top.$("#localer").find(".localerItemContent").removeAttr("style");var b=parseInt(Fai.top.$("#localer").attr("_moduleStyle"));if((Fai.isIE6()||Fai.isIE7())&&(b>=4&&b<=9)){var c=Fai.top.$("#localer").find(".J_localerPanel").width();Fai.top.$("#localer").find(".localerItemContent").css("width",c+"px")}if((Fai.isIE6())&&(b>=1&&b<=3)){var a=Fai.top.$("#localer").find(".J_localerPanel").height();Fai.top.$("#localer").find(".J_localerPanel").css("line-height",a+"px")}};Site.initFloatImg=function(a){Site.hoverChangeImage()};Site.floatImgInContainerForms=function(a){if(!$("#webContainerTable").length){return false}if($("#webContainerTable").find("#module"+a).length){if(!(Site.checkNestModule($("#module"+a)).parentId>0)){return true}else{return false}}else{return false}};Site.picShape=function(a,k,l){var b=$("#module"+a),f=b.find(".floatImgWrap"),j=b.find(".floatImgWrap").find("img"),e=b.find(".floatImg_J"),i=b.find(".forMargin"),c=k.borderRadius,m=k.imgShapeType,q=b.find(".floatImg"),p=b.find(".formWrap"),o=j.height(),n=j.width(),d=0;if(l.effType){var g=l.effType,h=q.find(".imageEffects");borderWidth=parseInt(h.css("borderWidth"))}i.css({width:"initial",height:"initial"});if(o>n){d=n}else{d=o}if(m==2||m==4){b.find(".forStyle").css("borderRadius","0");q.css({"text-align":"center",overflow:"visible"});if(d!=0){f.css({width:d+"px",height:d+"px",overflow:"hidden",display:"inline-block"})}b.css({overflow:"hidden"});if(o>n){f.css("marginTop",(o-n)/2+"px");i.css("marginTop",-(o-n)/2+"px");if(g){if(g==2){h.css({height:d+"px",width:(d-2*borderWidth)+"px",marginTop:((o-n)/2-borderWidth)+"px"})}}}if(n>o){i.css("marginLeft",-(n-o)/2+"px");if(g){if(g==2){h.css({width:d+"px"});h.css("marginLeft",(n-o)/2+"px")}}}if(m==4){f.addClass("picShape");h.addClass("picShape")}else{f.removeClass("picShape");h.removeClass("picShape");b.find(".forMargin").css("borderRadius","0")}}else{if(m==1||m==3){i.css("marginLeft","0");i.css("marginTop","0");f.css("marginTop","0");j.css("marginTop","0");j.css("marginLeft","0");if(m==1){b.find(".forMargin").css("borderRadius","0")}f.removeClass("picShape");h.removeClass("picShape");f.css({width:"initial",height:"initial"});if(f.width()!=0&&f.height()!=0){h.css({width:f.width()-2+"px",height:f.height()-2+"px",marginTop:"0",marginLeft:"0"})}if(m==3){b.find(".forMargin").css({height:o+"px",width:n+"px",borderRadius:c+"px",overflow:"hidden"})}}}};Site.bindImageEffectCusEvent_floatImg=function(g,c){var f=Fai.top.$(g).find(".imageEffects"),a=true,e=Fai.top.$(g).find("a"),d=$(e).attr("href"),b=(typeof d=="undefined"||d.length==0||d.indexOf("javascirpt")>0||d.indexOf("return")>0||e.length==0)?false:true;if(!b){a=false}if(a){$(f).css("cursor","pointer")}else{$(f).css("cursor","default")}$(f).off("click.imgEft").on("click.imgEft",function(){var l=$(this).parents("."+c.targetParent).find("a");if(Fai.isNull(l)){return}var i=$(l).attr("href"),h=$(l).attr("onclick"),j=$(l).attr("target");if(typeof j=="undefined"){j="_self"}var k=(typeof i=="undefined"||i.length==0||i.indexOf("javascirpt")>0||i.indexOf("return")>0||e.length==0)?false:true;if(typeof h!="undefined"){$(l).click()}else{if(k){window.open(i,j)}}})};Site.mallCoupon=function(a){this.moduleId=a;this.module=Fai.top.$("#module"+a);this.couponList=this.module.find("#couponList"+a)};(function(c,a,b){var d=a.prototype,h={};d.init=function(k){h["moduleId"+k]=this;i(k);if(window.localStorage){var l=window.localStorage.getItem("receTime");if(l&&Fai.top._TOKEN){if(new Date().getTime()-Number(l)>120000){localStorage.removeItem("receTime");return}var j=window.localStorage.getItem("cpId");c("div.receiveCoupon[coupon_id="+j+"]").click();window.localStorage.removeItem("receTime");window.localStorage.removeItem("cpId")}}};function i(j){h["moduleId"+j].module.on("click",".receiveCoupon",function(){if(_manageMode){if(!Fai.top._couponOpen){return}var l={};l.height=75;l.width=280;l.htmlContent='<div class="resultFailIcon addItemTextTips" style="font-size:14px; color:#636363 ;margin-left: 39px; padding-left: 35px;">';l.htmlContent+="当前为管理状态,领取失败</div>";l.autoClose=2000;var k=Site.popupBox(l)}else{var m=c(this).attr("coupon_id");var n=c(this).attr("bg_id");f(m,n)}})}function f(j,k){c.ajax({url:"ajax/mallCoupon_h.jsp?cmd=receiveCoupon",data:"bgId="+k+"&cid="+j+"&t="+new Date().getTime(),dataType:"json",success:function(m){var p={};if(m.success){var o=m.coupon;p.height=229;p.width=379;var q=[];q.push('<div class="coupon-popup-box">');q.push('<div class="coupon-receive-success">');q.push(LS.CongratulatSuccess);q.push("</div>");q.push('<div class="coupon-line">');q.push(LS.coupon+LS.name+":"+o.couponName);q.push("</div>");q.push('<div class="coupon-line">');q.push(LS.denomination+':<span class="savePrice">'+o.savePrice+"</span>");q.push("</div>");q.push('<div class="coupon-line">');q.push(LS.useConditionOrderOver+Fai.top.choiceCurrencyVal+o.orderMinPrice);q.push("</div>");q.push('<div class="coupon-line">');q.push(LS.vilidaty+":"+o.validity);q.push("</div>");q.push('<div class="coupon-opera">');q.push('<div class="goto-coupon-btn">');q.push(LS.view+LS.coupon);q.push("</div>");q.push('<div class="back-page">');q.push(LS.returnPage);q.push("</div>");q.push("</div>");q.push("</div>");p.htmlContent=q.join("");p.reload=true;var l=Site.popupBox(p);g(l,m.success);e(l)}else{var n=m.rt;if(n==-23){if(window.localStorage){var r=window.localStorage.getItem("receTime");if(r){window.localStorage.removeItem("receTime");window.localStorage.removeItem("cpId")}localStorage.setItem("cpId",j);localStorage.setItem("receTime",new Date().getTime())}document.location.href="login.jsp?url="+document.location.href}else{if(n==-4){p.height=155;p.width=312;var q=[];q.push('<div class="coupon-popup-box">');q.push('<div class="coupon-receive-fail">');q.push(LS.receiveFail);q.push("</div>");q.push('<div class="coupon-msg">');q.push(LS.receiveOverLimit);q.push("</div>");q.push('<div style="white-space: nowrap;">');q.push('<div class="goto-coupon-btn">');q.push(LS.view+LS.coupon);q.push("</div>");q.push('<div class="back-page">');q.push(LS.returnPage);q.push("</div>");q.push("</div>");q.push("</div>");p.htmlContent=q.join("");var l=Site.popupBox(p);l.css("width","");l.find(".popupCnBg").css("width","");g(l);e(l)}else{p.height=110;p.width=270;var q=[];q.push('<div class="coupon-popup-box">');q.push('<div class="coupon-receive-fail">');q.push(LS.receiveFail);q.push("</div>");q.push('<div class="coupon-msg">');if(m.msg=="receiveOverLimit"){q.push(LS.receiveOverLimit)}else{if(m.msg=="couponCountZero"){q.push(LS.couponCountZero)}else{if(m.msg=="couponExpired"){p.height=110;p.width=210;q.push(LS.couponExpired)}}}q.push("</div>");q.push("</div>");p.htmlContent=q.join("");var l=Site.popupBox(p);l.css("width","");l.find(".popupCnBg").css("width","")}}}},error:function(){Fai.ing(LS.systemError,true)}})}function g(k,j){k.find(".back-page").on("click",function(){k.find(".popupBClose").click();if(j){location.reload(true)}})}function e(j){j.find(".goto-coupon-btn").on("click",function(){document.location.href="mCenter.jsp?item=memberCoupon"})}d.showPage=function(){return function(k,j){c.ajax({url:"../ajax/mallCoupon_h.jsp?cmd=getPageData",data:"moduleId="+k+"&pageNo="+j,dataType:"json",success:function(l){if(l.success){var m=[];c.each(l.list,function(o,n){if(n.id==0){return false}m.push("<div class='coupon' id='coupon"+n.id+"' couponId='"+n.id+"' couponName='"+n.couponName+"'>");m.push("<div class='couponWatermark '>券</div>");if(n.state){m.push("<div class='coupon-left coupon-"+l.bg+"-left'></div>");m.push("<div class='coupon-content coupon-color-"+l.bg+"'>")}else{m.push("<div class='coupon-left coupon-invalid-left'></div>");m.push("<div class='coupon-content coupon-color-invalid'>")}m.push("<div class='couponSavePrice'><span class='priceSign'>"+Fai.top.choiceCurrencyVal+"</span><span class='couponPrice'>"+n.savePrice+"</span></div>");if(n.state){m.push("<div class='couponUseCondition'><span>"+LS.full+n.orderMinPrice+LS.money+"</span><br><span>"+LS.canUse+"</span><br><span class='coupon-name coupon-name-"+l.bg+"'>"+n.couponName+"</span></div>")}else{m.push("<div class='couponUseCondition'><span>"+LS.full+n.orderMinPrice+LS.money+"</span><br><span>"+LS.canUse+"</span><br><span class='coupon-name coupon-name-invalid'>"+n.couponName+"</span></div>")}var q=LS.immediatelyReceive;var p=l.bg;if(!n.state){q=LS.expired;p="gray"}else{if(n.couponLeaveAmount==0&&!n.autoInc){q=LS.receivedOver;p="gray"}else{if(n.currentMemberReceived){q=LS.alreadyReceived;p="gray"}}}m.push("<div class='receiveCoupon font-color-"+p+"' coupon_id='"+n.id+"'>"+q+"</div>");m.push("<div class='validTime'>"+LS.vilidaty+":"+n.validity+"</div>");m.push("</div>");if(n.state){m.push("<div class='coupon-right coupon-"+l.bg+"-right'></div>")}else{m.push("<div class='coupon-right coupon-invalid-right'></div>")}m.push("</div>")});h["moduleId"+k].couponList.html(m.join(""));Fai.Cookie.set("pageNo"+k,j);if(_manageMode&&Fai.top._couponOpen){Site.initModuleCouponListItemManage({couponParent:"couponList"+k,coupon:"coupon",moduleId:k})}}},error:function(){Fai.ing(LS.systemError,true)}});if(_manageMode){Site.initModuleCouponListItemManage({couponParent:"couponList"+k,coupon:"coupon",moduleId:k})}}}})(jQuery,Site.mallCoupon);Site.initMallCoupon=function(a){Fai.top.mallCoupon=Fai.top.mallCoupon||{};Fai.top.mallCoupon["couponList"+a]=new Site.mallCoupon(a);Fai.top.mallCoupon["couponList"+a].init(a)};Site.videoCompatible=function(p){var a=Fai.top.navigator.userAgent,j=/^https?.+\.(mp4)$/i,i=p.flvPagePath,d=false;if(j.test(i)){d=true}if(!(d&&/(iPhone|iPad|iPod|iOS|Android)/i.test(a))){return}var b=!!(document.createElement("video").canPlayType),k="mediaplayerObj"+p.moduleId,m="mediaplayer"+p.moduleId,h=[],g=[],l,f,c,o;if(!b&&p.mediaJsUrl.length>0){if(Fai.top.$("#jz-Html5VideoJs").length<1){var n=document.createElement("script"),e=document.head||document.body;n.id="jz-Html5VideoJs";n.type="text/javascript";n.src=p.mediaJsUrl;e.appendChild(n)}}if(p.videoType==1){k=p.moduleId;m="onLineFlv"+p.moduleId}c=Fai.top.$("#"+m);o=Fai.top.$("#"+k);h.push('id="'+k+'"');if(p.flvImgUrl.length>0){h.push('poster="'+p.flvImgUrl+'"')}h.push('width="'+p.flvWidth+'"');h.push('height="'+p.flvHeight+'"');h.push("controls");l=h.join(" ");g.push("<video "+l+">");g.push('<source src="'+i+'">');g.push("抱歉,你的浏览器不能查看该视频。");g.push("</video>");f=g.join("");if(o.length>0){o.remove();c.append(f)}};Site.videoNetUrlDeal=function(i){var b="";if(i){var h=$("#onLineFlv"+i);$onLineVideo=h.find("#"+i);b=$onLineVideo.attr("src");try{if(b){b=Fai.decodeHtml(b);b=b.replace(/&nbsp;/gi," ").replace(/&lt;/gi,"<").replace(/&gt;/g,">").replace(/&#92;/gi,"\\").replace(/&#39;/gi,"'").replace(/&quot;/gi,'"').replace(/\<br\/\>/gi,"\n").replace(/&amp;/gi,"&");var a=$(b);var d=a.get(0).tagName.toLowerCase();var k="";k=a.attr("src");var m=k.split("/");var f=m[2];if(d=="iframe"&&f.indexOf("youku.com")!=-1){k="http://player.youku.com/player.php/sid/"+m[4]+"/v.swf";$onLineVideo.attr("src",k);var g=$onLineVideo.prop("outerHTML");$onLineVideo.remove();h.append(g)}else{if(k){k=Fai.decodeHtml(k);if(d=="embed"){$onLineVideo.attr("src",k);var g=$onLineVideo.prop("outerHTML");$onLineVideo.remove();h.append(g)}else{if(d=="iframe"){var c=$onLineVideo.width();var l=$onLineVideo.height();$onLineVideo.remove();h.append('<iframe frameborder="0" width="'+c+'" height="'+l+'" src="'+k+'" allowfullscreen="true"></iframe>')}}}}}}catch(j){}}};Site.optimizeFooterAlign=function(){var d=$("#footerNav"),b=true,g;if(d.length<1){return}var a=d.find(".J_footerItemListContainer"),h=a.children(".J_footerItemSection");if(h.length<1){return}var f=a.children(".J_footerItemSpacing_end"),k=h.first(),i=h.last(),j=i.find(".J_footerItemContainer"),c,e;if(Fai.top._designAuth){g=Site.getFooterStyleData();if(g.fa!=2){b=false}if(g.fis==2){b=false}}if(k.offset().top<i.offset().top){b=false}if(!b){i.removeClass("fixWidth");return}if(Fai.top._designAuth){i.removeClass("fixWidth")}e=i.width();c=j.width();Fai.top.Fai.setCtrlStyleCss("stylefooter","webFooterTable",".footerItemSpacing_end","display","none");if(e<c){i.removeClass("fixWidth")}else{i.addClass("fixWidth");Fai.top.Fai.setCtrlStyleCss("stylefooter","webFooterTable",".footerItemListContainer .fixWidth","width",c+"px")}};Site.changeTheLogoSize=function(){if($("#footerSupport")){var b=$("#footerSupport").css("font-size");var a=parseInt(b.substring(0,b.length-2))+3;$("#faisco-icons-logo").css("font-size",a+"px")}};Site.initCorpTitleContent=function(c,j,a){var e=$("#"+c),i=$("#corpTitle"),k,l,m,f,d,h,g,b;if(i.length<=0){return}if(!j){a=""}d=i.clone();d.html(j);if(c=="primaryTitle"){g=!!(d.find("#primaryTitle").length);b=!!(d.find(".newPrimaryTitle").length);if(!g&&!b&&j!="请输入网站标题"){l=$("<div id='primaryTitle' style='"+a+"'></div>");i.append(l);l.html(j.replace(/\s/g,"&nbsp;"))}else{i.append(j)}}if(c=="subTitle"){if(d.find("#subTitle").length<=0){f=$("<div id='subTitle' style='"+a+"'></div>");i.append(f);f.html(j.replace(/\s/g,"&nbsp;"))}else{i.append(j)}}};(function(c,e,h,b){var d=Fai.top.$("#webContainer");var l=d.width();h.init=function(m){i(m);f(m);g(m);j()};function i(n){var v=n;var m=Fai.top.$("#webBanner");var p=Fai.top.$("#bannerV2");var q=v.widthType;var t;if(v._open){if(q===0){t=v.width}else{if(q===1){t=v.width;m.css("width","100%")}else{if(q===2){t=v.cusBannerWidth;v.width=t;if(t>0){m.css("width",t+"px")}}}}v.mouseoverId="switchGroup";p.css("background","none");p.children().remove();p.bannerImageSwitch(v)}else{var r=v.bannerListAdapt;var s;if(q===0){t=v.defaultwidth;s=l}else{if(q===1){m.css("width","100%");s=l}else{if(q===2){t=v.cusBannerWidth;m.css("width",t);s=t}}}if(r===0){p.find(".banner").css("background-size","cover")}else{p.find(".banner").css("background-size","")}var o=[];var u=Fai.top.$(".fk-inBannerListZone-tmp").find(".form");o.push("<div id='fk-inBannerListZone' _sys='0' _banId='' class='elemZone elemZoneModule J_moduleZone fk-moduleZone fk-inBannerListZone forms sideForms J_moduleZone'>");o.push(" <div class='fk-inBannerListZoneBg fk-elemZoneBg J_zoneContentBg elemZoneBg'></div>");o.push("</div>");p.prepend(o.join(""));Fai.top.Fai.setCtrlStyleCssList("styleWebSite","",[{cls:"#bannerV2 .fk-inBannerListZone",key:"width",value:s+"px"},{cls:"#bannerV2 .fk-inBannerListZone",key:"margin-left",value:"-"+s/2+"px"}]);u.each(function(w,x){var y=c(this).parent();if(y.hasClass("fk-inBannerListZone-tmp")){if(parseInt(c(this).attr("_sys"))===0){Fai.top.$("#fk-inBannerListZone").append(c(this))}}});if(Fai.top._manageMode){e.sortable();jzUtils.run({name:"_elemZone.sortModuleZone",base:Fai.top})}}}function j(){if(Fai.top._bannerV2Data.ble.t===0&&!Fai.top._bannerData.h){k()}}function k(){var n=Fai.top.$("#webBanner");var t=Fai.top.$("#bannerV2");var v=t.width();var x=t.height();var p=t.find(".switchGroup_bannerV2 .J_bannerItem");var o=t.find(".J_billboardItem");var q;var s;if(!t.find(".J_specialEffects").length){q='<div class="J_specialEffects f-specialEffects" style="position: absolute;top: 0;width: 100%;height:100%;z-index:2;pointer-events: none;"></div>';t.append(q)}var r=t.find(".J_specialEffects");switch(Fai.top._bannerV2Data.ble.at){case 0:r.remove();break;case 1:r.find(":not(.snow-canvas)").remove();if(!r.find(".snow-canvas").length){var m='<canvas class="snow-canvas" speed="1" interaction="false" size="2" count="80" opacity="0.00001" start-color="rgba(253,252,251,1)" end-color="rgba(251,252,253,0.3)" wind-power="0" image="false" width="'+v+'" height="'+x+'"></canvas><canvas class="snow-canvas" speed="3" interaction="true" size="6" count="30" start-color="rgba(253,252,251,1)" end-color="rgba(251,252,253,0.3)" opacity="0.00001" wind-power="2" image="false" width="'+v+'" height="'+x+'"></canvas><canvas class="snow-canvas" speed="3" interaction="true" size="12" count="20" wind-power="-5" image="'+Fai.top._resImageRoot+'/image/snow.png" width="'+v+'" height="'+x+'"></canvas>';r[0].innerHTML=m;t.find(".snow-canvas").faiSnow()}break;case 2:r.find(":not(.meteor-canvas)").remove();if(!r.find(".meteor-canvas").length){r.faiMeteor({width:v,height:x})}break;case 3:r.find(":not(.fireworks-canvas)").remove();if(!r.find(".fireworks-canvas").length){r.faiFireworks({width:v,height:x})}break;case 4:u();break;case 5:case 6:r.remove();var p=t.find(".switchGroup_bannerV2 .J_bannerItem");var w=Fai.top._bannerV2Data.ble.at===5?0:1;if(p.length){p.each(function(z,A){var y=c(this).css("background-image");var B=/^url\((['"]?)(.*)\1\)$/.exec(y);var C=c("<img class='J_rainyDaybackground' alt='background' width='"+v+"' height='"+x+"' style='visibility:hidden;' />");c(this).css("background-image","none");B=B?B[2]:"";c(this).append(C);C[0].onload=function(){C.faiRainyDay({rainyEffect:w});C[0].onload=null;if(Fai.top._bannerV2Data.s==1){p.find(".rainyday-canvas").css("z-index",-1)}else{if(Fai.top._bannerV2Data.s==0){p.find(".rainyday-canvas").css("z-index",1)}}};C[0].crossOrigin="Anonymous";C[0].src=B})}break;default:break}function u(){try{r.remove();function A(){var C=document.createElement("canvas");var D=C.getContext("webgl")||C.getContext("experimental-webgl");var B=D&&D.getExtension("OES_texture_float")&&D.getExtension("OES_texture_float_linear");return B}if(!!A()){p.css("width",o.width());function y(){var B=Math.random()*p.outerWidth();var E=Math.random()*p.outerHeight();var C=20;var D=0.04+Math.random()*0.04;p.faiRipples("drop",B,E,C,D);s=setTimeout(function(){y()},400)}p.faiRipples({resolution:512,dropRadius:20,perturbance:0.04});clearTimeout(s);y()}}catch(z){}}}function f(q){var p=q.backgroundType;var n=q.backgroundColor;var m=q.backgroundOpacity;if(p==1){var o=Fai.hexadecimalToRgb(n);if(Fai.isIE6()||Fai.isIE7()||Fai.isIE8()){Fai.top.Fai.setCtrlStyleCss("styleBannerBg","",".webBannerTable","background",""+n+" !important")}else{Fai.top.Fai.setCtrlStyleCss("styleBannerBg","",".webBannerTable","background","rgba("+o+", "+m/100+") !important")}Fai.top.Fai.setCtrlStyleCss("styleBannerBg","",".webBanner","background","none !important")}else{if(p==0){Fai.top.Fai.setCtrlStyleCss("styleBannerBg","",".webBannerTable","background","none !important");Fai.top.Fai.setCtrlStyleCss("styleBannerBg","",".webBanner","background","none !important")}}}function g(n){var m=n;var o=Fai.top._bannerV2Data.blw.t==1||(Fai.top._bannerV2Data.blw.t==0&&Fai.top._wideBanner);if(m._open&&o){c(window).resize(function(p){if(!p.target.nodeType||p.target.nodeType==9){setTimeout(function(){a(0)},500)}})}}h.refreshBanner=function(q){var m=Fai.top.$("#webBanner");var o=Fai.top.$("#bannerV2");var p=Fai.top._bannerV2Data.blw.t;var n=Fai.top._bannerV2Data.blh.t;var s;var w;var r;if(!o.length){return}if(Fai.top._bannerData.h){o.css("display","none");return}else{o.css("display","block")}if(Fai.top._bannerV2Data.s==1&&Fai.top._bannerV2Data.bl.length==0){Fai.top._bannerV2Data.s=0}if(Fai.top._bannerV2Data.s==0){if(p===0){s=parseInt(o.attr("defaultwidth"));m.css("width",Fai.top._wideBanner?"":l);r=l}else{if(p===1){m.css("width","100%");r=l}else{if(p===2){s=Fai.top._bannerV2Data.blw.w;m.css("width",s)}}}var t=[];var u=o.find("#fk-inBannerListZone .form");u.each(function(x,y){var A=c(this).parent();if(A.hasClass("fk-inBannerListZone")){var z=A.attr("_sys");c(this).attr("_sys",z);Fai.top.$(".fk-inBannerListZone-tmp").append(c(this))}});t.push("<div id='fk-inBannerListZone' _sys='"+Fai.top._bannerV2Data.s+"' _banId='' style='width:"+r+"px;margin-left:-"+r/2+"px;' class='fk-moduleZone fk-inBannerListZone forms sideForms J_moduleZone'>");t.push(" <div class='fk-inBannerListZoneBg'></div>");t.push("</div>");t.push("<div class='"+o.attr("class")+" defaultBannerMain J_bannerItem' style='"+(n==1?"height:"+w+"px":"")+"'></div>");o.removeAttr("style");o.children().remove();o.append(t.join(""));if(Fai.top._bannerV2Data.bla===0){o.find(".banner").css("background-size","cover")}else{o.find(".banner").css("background-size","")}if(n==1){w=Fai.top._bannerV2Data.blh.h;o.css("height",w);o.find(".banner").css("height",w)}var v=Fai.top.$(".fk-inBannerListZone-tmp").find(".form");v.each(function(x,y){var z=c(this).parent();if(z.hasClass("fk-inBannerListZone-tmp")){if(parseInt(c(this).attr("_sys"))===0){Fai.top.$("#fk-inBannerListZone").append(c(this))}}});if(Fai.top._manageMode){e.sortable();jzUtils.run({name:"_elemZone.sortModuleZone",base:Fai.top})}j()}else{if(Fai.top._bannerV2Data.s==1){if(p===0){m.css("width",Fai.top._wideBanner?"":l)}else{if(p===1){m.css("width","100%")}else{if(p===2){s=Fai.top._bannerV2Data.blw.w;m.css("width",s)}}}a(q)}}jzUtils.run({name:"_elemZone.selectToolOneZone",base:Fai.top},Fai.top.$(".fk-inBannerListZone"))};function a(p){var s=0;var v=0;var t=[];var q=[];var r=[];var m=Fai.top.$("#webBanner");var o=Fai.top.$("#bannerV2");var n=Fai.top._bannerV2Data.blw.t;if(Fai.top._bannerV2Data.blh.t==1&&typeof Fai.top._bannerV2Data.blh.h!="undefined"){v=Fai.top._bannerV2Data.blh.h}else{v=parseInt(Fai.top._bannerV2Data.bl[0].h);if(v<200){v=200}else{if(v>1000){v=1000}}}var u=o.find(".fk-inBannerListZone .form");u.each(function(w,x){var A=c(this).parent();if(A.hasClass("fk-inBannerListZone")){var y=A.attr("_banid");var z=A.attr("_sys");c(this).attr("_banId",y);c(this).attr("_sys",z);Fai.top.$(".fk-inBannerListZone-tmp").append(c(this))}});c.each(Fai.top._bannerV2Data.bl,function(y,A){var x=parseInt(A.h);var z=parseInt(A.w);if(s<z){s=z}if(A.e!=0){var w=A.jUrl||"javascript:;";if(w.length>12&&w.substring(0,10)=="javascript"){t.push({src:A.p,href:"javascript:;",onclick:w.substring(11)+"return false;",ot:A.ot,imgWidth:z,imgHeight:x,i:A.i})}else{t.push({src:A.p,href:w,ot:A.ot,imgWidth:z,imgHeight:x,i:A.i})}}else{t.push({src:A.p,imgWidth:z,imgHeight:x,i:A.i})}q.push(z);r.push(x)});if(n===2){s=Fai.top._bannerV2Data.blw.w}o.css("background","none");o.children(":not(.J_specialEffects)").remove();o.css("height",v+"px");o.bannerImageSwitch({data:t,index:p,width:s,height:v,from:"banner",playTime:Fai.top._bannerV2Data.i,animateTime:Fai.top._bannerV2Data.a,btnType:Fai.top._bannerV2Data.bt,wideScreen:true});h.adjustBannerWidth();j()}h.adjustBannerWidth=function(){var p=Fai.top.$("#bannerV2");var r=Fai.top.$("#webBanner").width();var n=p.find(".switchGroup");var o=Fai.top._manageMode?Fai.getScrollWidth():0;var q=Fai.top.$(window).width()>Fai.top.$("#web").width()?Fai.top.$(window).width():Fai.top.$("#web").width();var s=Fai.top._bannerV2Data.bla==0?true:false;var m=Fai.top._bannerV2Data.at==0?true:false;if(s&&(Fai.top._bannerV2Data.blw.t==1||(Fai.top._bannerV2Data.blw.t==0&&Fai.top._wideBanner))){r=(r>q)?q-o:r;n.find(".J_bannerItem").each(function(t){if(r>=c(this).width()){c(this).css("width",r);c(this).parent().css("width",r);if(m&&Fai.top._bannerV2Data.bt===0){c(this).parent().css("left",-r*t+"px")}}})}};h.setBannerBg=function(){var m=Fai.top._bannerV2Data.bzb.c?Fai.top._bannerV2Data.bzb.c:"#000";var o=(typeof Fai.top._bannerV2Data.bzb.o=="undefined")?100:Fai.top._bannerV2Data.bzb.o;var n=Fai.hexadecimalToRgb(m);Fai.top._bannerV2Data.bzb.c=m;Fai.top._bannerV2Data.bzb.o=o;if(Fai.isIE6()||Fai.isIE7()||Fai.isIE8()){Fai.top.Fai.setCtrlStyleCss("styleBannerBg","",".webBannerTable","background",""+m+" !important")}else{Fai.top.Fai.setCtrlStyleCss("styleBannerBg","",".webBannerTable","background","rgba("+n+", "+o/100+") !important")}Fai.top.Fai.setCtrlStyleCss("styleBannerBg","",".webBanner","background","none !important")};h.hideBannerBg=function(){Fai.top.Fai.setCtrlStyleCss("styleBannerBg","",".webBannerTable","background","none !important");Fai.top.Fai.setCtrlStyleCss("styleBannerBg","",".webBanner","background","none !important")};h.startBannerInterval=function(){var m=0;if(Fai.intervalFunc!=b){m=Fai.intervalFunc.length}if(m>0){for(var p=0;p<m;p++){var o=Fai.intervalFunc[p].id;var n=o.length;if(typeof o!="undefined"&&o.substring(0,11)=="imageSwitch"&&o.substring(n-6,n)=="banner"){Fai.startInterval(o)}}}if(Fai.top._bannerV2Data.bl&&Fai.top._bannerV2Data.bl.length>1&&e.checkBrowser()&&Fai.top._bannerV2Data.at>0){e.bannerAnimate.autoPlay()}};h.stopBannerInterval=function(){var m=0;if(Fai.intervalFunc!=b){m=Fai.intervalFunc.length}if(m>0){for(var p=0;p<m;p++){var o=Fai.intervalFunc[p].id;var n=o.length;if(typeof o!="undefined"&&o.substring(0,11)=="imageSwitch"&&o.substring(n-6,n)=="banner"){Fai.stopInterval(o)}}}if(Fai.top._bannerV2Data.bl&&Fai.top._bannerV2Data.bl.length>1&&e.checkBrowser()&&Fai.top._bannerV2Data.at>0){e.bannerAnimate.stop()}};h.stopBannerPropagation=function(){var m=Fai.top.$("#bannerV2").find(".fk-inBannerListZone");m.off("click.stopFormP").on("click.stopFormP",".form",function(q){var n=c(q.target).parentsUntil("#bannerV2",".J_bannerItem");var o=n.attr("href");var p=n.attr("target");n.attr("href","javascript:void(0);").attr("target","");q.stopPropagation();setTimeout(function(){n.attr("href",o).attr("target",p)},0)})}})(jQuery,Site,Site.bannerV2||(Site.bannerV2={}));Site.initForms=function(){$(".form").each(function(){var a=$(this),b=a.attr("_moduleid")||0;if(b>0){if(a.attr("_autoHeight")!="1"){Site.setModuleHeight2(b,a.height())}else{if(a.hasClass("formStyle29")){Site.setModuleHeight2(b,a.height())}}}})};Site.setModuleHeight2=function(m,l){var b=Fai.top.$("#module"+m);b.css("height",l+"px");if(b.hasClass("formStyle80")||b.hasClass("formStyle87")){return}var g=b.find(".formTop"+m);var k=b.find(".formBanner"+m);var j=b.find(".formMiddle"+m);var r=b.find(".formBottom"+m);var a=g.is(":visible")?g.outerHeight(true):0;var f=k.is(":visible")?k.outerHeight(true):0;var s=r.is(":visible")?r.outerHeight(true):0;var n=j.find(".formMiddleCenter"+m);var o=j.find(".formMiddleContent"+m);var t=l-a-f-s-Fai.getFrameHeight(j);j.css("height",t+"px");t=t-Fai.getFrameHeight(n);t=t-Fai.getFrameHeight(o);if(!b.hasClass("formStyle81")&&!b.hasClass("formStyle82")&&!b.hasClass("formStyle85")&&!b.hasClass("formStyle98")){if(t>0){o.css("height",t+"px");o.css("overflow-y","hidden")}}if(b.hasClass("formStyle29")){var p=b.find(".titleTable"),i=b.find(".formTabButtonList");if(p.length==1){var h=p.outerHeight(true);if(b.find(".formTabDirectionY").length>0){h=i.outerHeight(true)}var c=b.find(".formTabContent"+m);var e=t-h-Fai.getCssInt(c,"border-top-width")-Fai.getCssInt(c,"border-bottom-width");if(Fai.isIE6()){e+=1}c.css("height",e+"px");var d=b.find(".formTabCntId");d.css("height",e+"px")}}else{if(b.hasClass("formStyle79")){var q=b.attr("id").replace("module","");if(!Site.floatImgInContainerForms(q)){b.find("#float_img_"+m).css("height",t+"px")}}}};Site.refreshForms=function(){Site.refreshFormIndexClass();Site.displayAddModule();Fai.top.Fai.delayLoadImg(20)};Site.addModuleStyle=function(a){Fai.top.Fai.addCtrlStyle("stylemodule",a)};Site.displayAddModule=function(){if(!Fai.top._designAuth){return}Site.addAddModuleButton(1);Site.addAddModuleButton(2);Site.addAddModuleButton(3);Site.addAddModuleButton(4);Site.addAddModuleButton(5);Site.addAddModuleButton(6);Site.addAddModuleButton(7);Site.addAddModuleButton(8);Site.addAddModuleButton(10);Site.addAddModuleButton(11);Site.addAddModuleButton(12);Site.addAddModuleButton(13);Site.addAddModuleButton(20);Site.addAddModuleButton(22);Site.addAddModuleButton(23);Site.addAddModuleButton(24);Site.addAddModuleButton(25);Site.addAddModuleButton(26);Site.addAddModuleButton(27);Site.addAddModuleButton(28)};Site.checkModuleInZone=function(a){return a.parent().hasClass("J_moduleZone")};Site.checkModuleInSubNav=function(a){return a.parent().hasClass("J_subNavPack")};Site.checkModuleInElemZone=function(a){return a.parent().hasClass("elemZone")};Site.checkFloatModulePosition=function(b){if(!b.length){return}var h=b.parent().attr("id");var e=b.offset().top,m=b[0].getBoundingClientRect().top;moduleTop=e-Fai.top.$("body").scrollTop();var d=b.offset().left;var i=b.height();var l=moduleTop+i;var k=0;var f=Fai.top.Fai.getBrowserHeight()-k;var a=Site.getModuleStatus(b.attr("id").replace("module",""));if(h=="floatLeftBottomForms"||h=="floatRightBottomForms"){var j=Fai.top.$("#web").offset().top;if(l>f){var g=f-i;if(a!=3){b.offset({left:d,top:j+Fai.top.Fai.getBrowserHeight()/2})}}if(l<j){b.offset({top:j+Fai.top.Fai.getBrowserHeight()/2})}if(moduleTop<j){if(a!=3){b.offset({top:j+Fai.top.Fai.getBrowserHeight()/2})}}}else{if(h=="floatLeftTopForms"||h=="floatRightTopForms"){var j=Fai.top.$("#web").offset().top;if(j<0){j=0}if(moduleTop>(j+Fai.top.Fai.getBrowserHeight())){b.offset({top:j+Fai.top.Fai.getBrowserHeight()/2-i})}if(l<j){b.offset({top:j})}if(moduleTop<j){b.offset({top:j})}}}if(b.hasClass("matFactoryModule")&&!Fai.top._matFactorySideModuleDrag&&!Fai.top._matFactoryLockModuleDrag){var c=-(Fai.top.Fai.getBrowserHeight()+i)/2;$("#"+h).find(".matFactoryModule").each(function(n,o){if($(o).attr("id")!=b.attr("id")){var p=$(o).css("top").replace("px","");if(c==p){c+=40}}});b.css("top",c+"px")}};Site.closeAd=function(a){$("#"+a).data("top",$("#"+a).position().top);$("#"+a).data("left",$("#"+a).position().left);$("#"+a).hide()};Site.checkSideModule=function(a){Site.reSetSidePosition(a)};Site.reSetSidePosition=function(b,r){var k=b.attr("id");var v=b.offset().top;var o=Fai.top.Fai.getBrowserWidth();var a=Fai.top.Fai.getBrowserHeight();var n=b.outerWidth();var x=b.height();var z=Fai.getCssInt(b,"border-left-width");var s=b.parent().attr("id");var c=b.attr("_side");var h=0;var j=[];var t=Fai.top.$("#"+k+"SideBtn");t.remove();var w=k.replace("module","");var m=b.find(".mainTitle"+w).first().text();var g=0;var d=false;var i=parseInt(b.attr("_modulestyle"));if(i==79||i==81||i==86){if(b.find(".mainTitle").length<1){m=b.attr("bannertitle")}}if(c==1){if(s=="floatLeftTopForms"||s=="floatLeftBottomForms"){b.offset({top:v,left:0});h=1;j=["<div id='"+k+"SideBtn' class='g_sideBtn fk-sideLeft'><div class='g_sideBtn_t g_sB_lt'></div><div class='g_sideBtn_c g_sB_lc'><span class='g_sideBtn_tl'>"+m+"</span></div><div class='g_sideBtn_b g_sB_lb'></div><div class='g_sideBtn_extend g_sB_le'></div></div>"];b.animate({left:-n},{queue:false,duration:0});b.off("mouseenter.sideModule").on("mouseenter.sideModule",Site.bindSideIn1);b.off("mouseleave.sideModule").on("mouseleave.sideModule",Site.bindSideOut1)}else{if(s=="floatRightTopForms"||s=="floatRightBottomForms"){if(Fai.top._Global._webRightBar){g=Fai.getScrollWidth()+$(".fk-rbar").width();if(b.width()>10){b.data("_selfWidth",b.width())}if(b.attr("_moduleStyle")==7){b.find(".formWrap").css({"word-break":"keep-all","white-space":"nowrap",overflow:"hidden","text-overflow":"ellipsis"})}d=b.data("notInitState")||d}b.offset({top:v,left:o-n-g});h=0;j=["<div id='"+k+"SideBtn' class='g_sideBtn fk-sideRight'><div class='g_sideBtn_t g_sB_rt'></div><div class='g_sideBtn_c g_sB_rc'><span class='g_sideBtn_tl'>"+m+"</span></div><div class='g_sideBtn_b g_sB_rb'></div><div class='g_sideBtn_extend g_sB_re'></div></div>"];if(Fai.top._Global._webRightBar){if(!d){b.animate({left:0},{queue:false,duration:0})}if(Fai.top._manageMode&&!r){b.css("overflow","visible");b.animate({left:-g+"px",width:0},{queue:false,duration:300})}else{if(Fai.top._manageMode&&r){b.animate({left:-g+"px"},{queue:false,duration:0})}else{b.animate({left:-$(".fk-rbar").width()+"px"},{queue:false,duration:500})}}}else{b.animate({left:0},{queue:false,duration:0})}b.off("mouseenter.sideModule").on("mouseenter.sideModule",Site.bindSideIn2);b.off("mouseleave.sideModule").on("mouseleave.sideModule",Site.bindSideOut2)}else{b.attr("_side",0)}}b.css("overflow","visible")}b.append(j.join(""));b.addClass("jz-moduleSide");if(!!b.find(".formMiddle").length){b.find(".formMiddle").addClass("jz-moduleSide-content")}var l=Fai.top.$("#"+k+"SideBtn");if(l.length>0){var u=l.width();var e=l.height();var q=parseInt((x-e)/2);if(h==0){l.css({top:q,left:-u-z})}else{l.css({top:q,left:n-z})}var p=l.position().top;var y=l.position().top+e;if(c==1){if(s=="floatLeftTopForms"||s=="floatRightTopForms"){if(y<=0){l.css({top:x-e})}}else{if(s=="floatLeftBottomForms"||s=="floatRightBottomForms"){if((p-a)>=0){l.css({top:0})}}}var f=l[0].getBoundingClientRect();if(f.top>a||f.bottom<0){l.css({top:0})}}}};Site.checkFlutterModule=function(b){var a=b.attr("_side");if(a==2){Site.flutterStart(b)}};var flutterCount=1000;Site.flutterInternel=function(d){var i=d.attr("_flutterSwitch");if(i=="true"){Site.stopFlutterInterval(d)}var m=1;var b=document.body.scrollTop;var g=document.body.scrollLeft;if(Fai.isIE8()||Fai.isIE7()||Fai.isIE10()||Fai.isIE9()||Fai.isIE11()){b=document.documentElement.scrollTop}var a=$("#g_main").offset().top+b;var e=0+g;var c=document.documentElement.clientWidth-d.width()+g;var h=document.documentElement.clientHeight-d.height()+b;if(Fai.isIE6()){c=document.body.clientWidth-d.width()}var l=d.data("flutterXPos");var f=d.data("flutterYPos");d.offset({left:l,top:f});var k=d.data("flutterXPos")+m*(d.data("flutterXon")?1:-1);d.data("flutterXPos",k);if(d.data("flutterXPos")<=e){d.data("flutterXon",true);d.data("flutterXPos",e)}if(d.data("flutterXPos")>=c){d.data("flutterXon",false);d.data("flutterXPos",c)}var j=d.data("flutterYPos")+m*(d.data("flutterYon")?1:-1);d.data("flutterYPos",j);if(d.data("flutterYPos")<=a){d.data("flutterYon",true);d.data("flutterYPos",a)}if(d.data("flutterYPos")>=h){d.data("flutterYon",false);d.data("flutterYPos",h)}};Site.stopFlutterInterval=function(a){Fai.stopInterval("flutter"+a.attr("id"))};Site.startFlutterInterval=function(b){var a=b.attr("_side");if(a!=2){return}if(b.attr("_edit")=="true"){return}Site.stopFlutterInterval(b);var d=function(){var f=b.attr("_side");var g=b.attr("_flutterSwitch");if(f==2){Site.flutterInternel(b)}else{Site.stopFlutterInterval(b)}};var e=10;var c="flutter"+b.attr("id");Fai.addInterval(c,d,e);Fai.startInterval(c)};Site.flutterStart=function(b,a){b.addClass("fk-flutterForm");var g=0;var f=document.body.scrollLeft;if(Fai.isIE6()){rightBoundary=document.body.clientWidth-b.width()}else{rightBoundary=document.documentElement.clientWidth-b.width()+f}if(b.offset().left>rightBoundary){b.offset({left:rightBoundary-b.outerWidth()})}else{if(b.offset().left+b.width()<0){b.offset({left:0})}}var h=b.position().left;var c=b.position().top;var i=b.data("toFlutterFlag");var k=b.attr("_flutterSwitch");if(!i){b.data("startFlutterXPos",h);b.data("startFlutterYPos",c)}else{var j=b.data("startFlutterXPos");var d=b.data("startFlutterYPos");if(!j&&!d){b.data("startFlutterXPos",h);b.data("startFlutterYPos",c)}}var l=b.data("startFlutterParentId");if(!l){b.data("startFlutterParentId",b.parent().attr("id"))}b.data("flutterXPos",b.offset().left);b.data("flutterYPos",b.offset().top);b.data("flutterXon",true);b.data("flutterYon",true);var e=b.attr("_side");if(_manageMode==true&&e==2&&!a){b.attr("_flutterSwitch",true)}var k=b.attr("_flutterSwitch");if(k=="false"||!k){Site.startFlutterInterval(b)}b.on("mouseenter",function(){Site.stopFlutterInterval($(this))});b.on("mouseleave",function(){var m=$(this).attr("_flutterSwitch");if(m=="false"||!m){Site.startFlutterInterval($(this))}})};Site.bindSideIn1=function(b){var b=$(this);var c=b.attr("_side");var a=b.outerWidth();var d=b.parent().attr("id");if(Fai.top._manageMode){Site.disableEditLayer();if(-a==b.offset().left){jzUtils.run({name:"moduleAnimation.canRunAgain",base:Site})}b.animate({left:0},{queue:false,duration:500,complete:function(){Site.enableEditLayer();if(c==1){b.unbind("mouseenter.sideModule",Site.bindSideIn1).unbind("mouseleave.sideModule",Site.bindSideOut1).unbind("mouseenter.sideModule",Site.bindSideIn2).unbind("mouseleave.sideModule",Site.bindSideOut2)}jzUtils.run({name:"moduleAnimation.publish",base:Site});jzUtils.run({name:"moduleAnimation.contentAnimationPublish",base:Site})}})}else{if(-a==b.offset().left){jzUtils.run({name:"moduleAnimation.canRunAgain",base:Site})}b.animate({left:0},{queue:false,duration:500,complete:function(){jzUtils.run({name:"moduleAnimation.publish",base:Site});jzUtils.run({name:"moduleAnimation.contentAnimationPublish",base:Site})}})}$(b).find("img").trigger("appear")};Site.bindSideIn2=function(e){var e=$(this);var d=e.attr("_side");var g=e.outerWidth();var i=e.parent().attr("id");var m=Fai.top.Fai.getBrowserWidth();var j=0;var l=Fai.top.$("#"+e.attr("id")+"SideBtn");var k=l.width();var b=Fai.getCssInt(e,"border-left-width");var f=0;var c={left:-g};var h=0;var a=500;if(Fai.top._Global._webRightBar){f=$(".fk-rbar").width();j=Fai.getScrollWidth()+f;g=e.data("_selfWidth");if(e.attr("_moduleStyle")==7){e.find(".formWrap").css({"word-break":"keep-all","white-space":"nowrap",overflow:"hidden","text-overflow":"ellipsis"})}e.data("notInitState",true);c={left:-g-j,width:g};h=Fai.getScrollWidth();if(Fai.top._isTemplateVersion2&&Fai.top._manageMode){a=0}}e.find("img").trigger("appear");if(Fai.top._manageMode){Site.disableEditLayer();if(m==(e.offset().left+f+h)){jzUtils.run({name:"moduleAnimation.canRunAgain",base:Site})}e.animate(c,{queue:false,duration:a,complete:function(){Site.enableEditLayer();if(d==1){e.unbind("mouseenter.sideModule",Site.bindSideIn1).unbind("mouseleave.sideModule",Site.bindSideOut1).unbind("mouseenter.sideModule",Site.bindSideIn2).unbind("mouseleave.sideModule",Site.bindSideOut2)}jzUtils.run({name:"moduleAnimation.publish",base:Site});jzUtils.run({name:"moduleAnimation.contentAnimationPublish",base:Site})}})}else{if(m==e.offset().left){jzUtils.run({name:"moduleAnimation.canRunAgain",base:Site})}e.animate({left:-g-f},{queue:false,duration:500,complete:function(){jzUtils.run({name:"moduleAnimation.publish",base:Site});jzUtils.run({name:"moduleAnimation.contentAnimationPublish",base:Site})}})}};Site.bindSideOut1=function(b){var b=$(this);var c=b.attr("_side");var a=b.outerWidth();var d=b.parent().attr("id");b.animate({left:-a},{queue:false,duration:500})};Site.bindSideOut2=function(d){var d=$(this);var e=d.attr("_side");var b=d.outerWidth();var f=d.parent().attr("id");var a=0;var c=0;if(Fai.top._Global._webRightBar){a=Fai.getScrollWidth()+$(".fk-rbar").width();if(d.attr("_moduleStyle")==7){d.find(".formWrap").css({"word-break":"keep-all","white-space":"nowrap"})}c=$(".fk-rbar").width()}if(Fai.top._manageMode){d.animate({left:0-a},{queue:false,duration:500})}else{d.animate({left:-c},{queue:false,duration:500})}};Site.setAbsFormsHolder2=function(h){var a=0,f=0,j=0,g=Fai.top.$("#containerPlaceholder"),b=Fai.top.$("#g_main"),d=Fai.isIE6(),c=Fai.isIE7(),i=false,k,e;k=function(l){if(!Fai.top._manageMode&&!d&&!c){return l}var m=b.scrollTop();if(m<=0){return l}return l+m};Fai.top.$("#absForms >.form").each(function(){var l=$(this).offset().top+$(this).outerHeight();l=k(l);if(l>a){a=l}});Fai.top.$("#absTopForms >.form").each(function(){var l=$(this).offset().top+$(this).outerHeight();l=k(l);if(l>a){a=l}});f=Fai.top.$("#fullmeasureBottomForms").outerHeight();if(f>0){a=a-f;if(a<0){a=0}i=true}j=k(g.offset().top);if(i){if(a>j){e=a-j;if(e!==parseInt(g.height())){if(!Fai.top._manageMode&&Fai.top._colOtherStyleData.y>e){g.css("height",e+"px")}else{g.css("height",e+"px");if(!h){Fai.top._colOtherStyleData.y=parseInt(e)}}}else{if(Fai.top._manageMode&&Fai.top._colOtherStyleData.y!=parseInt(e)){Fai.top._colOtherStyleData.y=parseInt(e)}}}else{if(a!=0&&(a-j)!==0){g.css("height","0");if(!h){Fai.top._colOtherStyleData.y=0}}else{if(Fai.top._colOtherStyleData.y>0&&a<j){g.css("height","0");Fai.top._colOtherStyleData.y=0}}}}else{if(a>j){var e=a-j;if(e!==parseInt(g.height())){g.css("height",e+"px");Fai.top._colOtherStyleData.y=parseInt(e)}}else{if(a!=0&&(a-j)!==0){g.css("height","0px");Fai.top._colOtherStyleData.y=0}}}};Site.checkAbsModulePosition=function(c,a){var h=c.parent().attr("id");var f=c.offset().left;var d=c.offset().top;var e=c.height();var g=c.offset().top+e;if(h=="absTopForms"){var b=Fai.top.$("#web").offset().top;if(d<b){d=b;c.offset({top:d,left:f})}Site.setAbsFormsHolder2(a)}else{if(h=="absBottomForms"){var b=Fai.top.$("#webFooter").offset().top;if(d<b){d=b}if(Fai.top._siteVer<30){var b=Site.getFooterBottom();if(d+e>b){d=b-e;c.offset({top:d,left:f})}}else{var b=Site.getFooterBottom(true);if(d+e>b){d=b-e;c.offset({top:d,left:f})}}c.offset({top:d,left:f})}else{if(h=="absForms"){Site.setAbsFormsHolder2(a)}}}};Site.demoStyleDesignLoading=function(a,c){var b=$('<div class="forWaiting ajaxLoading2" style="position:absolute;background-color:#d6d9e0;width:100%;height:205px;top:0;left:0;"></div>');b.appendTo("#"+a);$("#"+c).load(function(){$(".forWaiting").remove()})};Site._webToggleClass=function(a){if(a=="show"){$("html").removeClass("g_html").addClass("g_htmlManage");$("body").removeClass("g_body").addClass("g_bodyManage");$("#g_main").addClass("g_mainManage");$("#web").addClass("g_webManage")}};Site._demoTemplate=function(){var a=$("#siteTipsDemoTemplate");if(a.is(":visible")){document.location.reload()}else{a.show();Site._webToggleClass("show");if($("#topBarArea").length>0){$("#topBarArea").hide();$("#topBar").hide()}Site.demoStyleDesignLoading("siteTipsDemoTemplate","siteTipsDemoTemplateFrame");$("#siteTipsDemoTemplateFrame").attr("src","manage/styleTemplate.jsp?demoTemplate=true&ram"+Math.random());Site.resetGmainPos()}};Site.adjustFlBtnPos=function(b){var a=Fai.top.$("#module"+b);a.css({border:"10px solid transparent","margin-top":"-10px","margin-left":"-10px"});if(Fai.isIE6()){var c=a.attr("style");a.attr("style",c+"; _border-color:tomato; _filter:chroma(color=tomato)")}};Site.initFlBtnStyle=function(a){var g=a.moduleId,f=a.btnNumSystem,e=a.btnStyle,h="module"+g,b=Fai.top.$("#"+h);if(Fai.top._designAuth){Site.initManageFlBtnStyle(g,f,e)}else{var c=Fai.top.$(".mulMColContent");var d=b.find(".floatBtn")}};Site.setFlBtnParentColHide=function(){var a=Fai.top.$(".mulMColContent");if(a.length>0){a.each(function(){if($(this).find(".formStyle81").length>0){var b=$(this).attr("id");Fai.top.Fai.setCtrlStyleCss("stylemodule",b,".mulMColList","overflow","hidden")}})}};Site.initPhotoCard=function(b){var a=Fai.top.$("#module"+b);Site.resizePhotoCardHeight(a);Site.setPhotoCardHeight(a);Site.adjustPhotoCardImgSize(a);jzUtils.run({name:"ImageEffect.FUNC.BASIC.Init",callMethod:true},Fai.top["photoCard"+b])};Site.setPhotoCardHeight=function(a){var b=a.find(".cardTd");b.each(function(){var e=$(this).height(),d=$(this).find(".photoCard"),c=d.height();if(c<e){d.css("height",e+"px")}})};Site.adjustPhotoCardImgSize=function(b){var c=b.attr("id").replace("module",""),a=b.find(".photoCard"),d=b.find(".cardDivEffect .cardImg");Site.setPhotoCardHeight(b);a.each(function(){var o=$(this).find(".cardImgView"),l=$(this).find(".cardDivEffect"),m=$(this).height();if(o.length<1){return true}var k=o.width(),g=o.height(),e=$(this).width(),i,n,f=k,j=g,h=l.attr("tmpPic");imgOrProp=f/j;if(e/m<=imgOrProp){o.css("width","");o.css("height",m+"px");i=$(this).width();n=o.width();l.css("marginTop","");l.css("marginLeft",((i-n)/2)+"px")}else{o.css("height","");o.css("width",e+"px");i=$(this).height();n=o.height();l.css("marginLeft","");l.css("marginTop",((i-n)/2)+"px")}o.removeClass("cardImgViewHide")});d.load(function(){var p=$(this),m=p.parents(".cardDiv"),j=p.parents(".photoCard"),n=j.height();var l=p.width(),f=p.height(),e=j.width(),k,o,i,h=l/f,g=m.attr("tmpPic");if(e/n<=h){p.css("width","");p.css("height",n+"px");k=j.width();o=p.width();i=(k-o)/2;m.css("marginTop","");m.css("marginLeft",i+"px")}else{p.css("height","");p.css("width",e+"px");k=j.height();o=p.height();i=(k-o)/2;m.css("marginLeft","");m.css("marginTop",i+"px")}jzUtils.run({name:"ImageEffect.FUNC.BASIC.Init",callMethod:true},Fai.top["photoCard"+c])})};Site.resizePhotoCardHeight=function(c){var k=c.find(".photoCardTable"),l=c.find(".formMiddleContent"),a=c.find(".photoCardOuter"),b=c.find(".photoCardInner"),h=k.find("tr"),e=c.find(".cardTd"),d=a.attr("cusHeight"),f=h.length,i=c.height(),j=parseInt(l.css("marginTop").replace("px",""));formMiddleContentMB=parseInt(l.css("marginBottom").replace("px",""));photoCardInnerMT=parseInt(b.css("marginTop").replace("px",""));photoCardInnerMB=parseInt(b.css("marginBottom").replace("px",""));cellspacing=parseInt(k.attr("cellspacing"));if(d){i=a.height();j=0;formMiddleContentMB=0}var g=i-j-formMiddleContentMB-photoCardInnerMT-photoCardInnerMB-(2*cellspacing);e.each(function(){var n=$(this).find(".photoCard"),o=parseInt($(this).attr("rowspan")),m=(g-(f-1)*cellspacing)/f||"";switch(o){case 1:n.css("height",m+"px");break;case 2:n.css("height",(m*2+cellspacing)+"px");break;default:n.css("height",m+"px")}})};Site.adjustPhotoCard=function(b){if(Fai.isNumber(b)){var a=Fai.top.$("#module"+b);if(a.hasClass("formStyle83")&&!a.find(".photoCardOuter").attr("cusHeight")){Site.initPhotoCard(b);a.attr("_autoheight",0)}}else{if(typeof b=="object"){var d=b;var c=d.find(".formStyle83");if(c.length>0){e(c)}}else{if(b==undefined){var c=Fai.top.$(".formStyle83");if(c.length>0){e(c)}}}}function e(f){c.each(function(){var h=$(this).attr("id").replace("module",""),g=$(this).find(".photoCardOuter"),i=g.attr("cusHeight");if(i){return true}Site.initPhotoCard(h);$(this).attr("_autoheight",0)})}};Site.addPhotoCardModuleHeight=function(b){var g=Fai.top.$("#module"+b),a=g.find(".photoCardOuter"),f=g.find(".photoCard"),c=g.width(),i=g.height(),h=c/960,j=a.attr("cusHeight"),e=a.height(),d=i*h;if(j){d=e}g.css("height",d+"px");Site.initPhotoCard(b);Site.scrollToModuleDiv(g);Site.getModuleAttrPattern(b).changed=true;g.attr("_autoheight",0)};Site.initPhotoNewCard=function(b){var a=Fai.top.$("#module"+b);Site.resizePhotoNewCardHeight(a);Site.setPhotoNewCardHeight(a);Site.adjustPhotoNewCardImgSize(a);jzUtils.run({name:"ImageEffect.FUNC.BASIC.Init",callMethod:true},Fai.top["photoNewCard"+b])};Site.setPhotoNewCardHeight=function(a){var b=a.find(".cardTd");b.each(function(){var c=$(this).height(),e=$(this).find(".photoNewCard"),d=e.height();if(d<c){e.css("height",c+"px")}})};Site.adjustPhotoNewCardImgSize=function(a){var c=a.attr("id").replace("module",""),b=a.find(".photoNewCard"),d=a.find(".cardDivEffect .cardImg");Site.setPhotoNewCardHeight(a);b.each(function(){var o=$(this).find(".cardImgView"),l=$(this).find(".cardDivEffect"),m=$(this).height();if(o.length<1){return true}var k=o.width(),g=o.height(),e=$(this).width(),i,n,f=k,j=g,h=l.attr("tmpPic");imgOrProp=f/j;if(e/m<=imgOrProp){o.css("width","");o.css("height",m+"px");i=$(this).width();n=o.width();l.css("marginTop","");l.css("marginLeft",((i-n)/2)+"px")}else{o.css("height","");o.css("width",e+"px");i=$(this).height();n=o.height();l.css("marginLeft","");l.css("marginTop",((i-n)/2)+"px")}o.removeClass("cardImgViewHide")});d.load(function(){var p=$(this),m=p.parents(".cardDiv"),g=p.parents(".photoNewCard"),n=g.height();var l=p.width(),f=p.height(),e=g.width(),k,o,j,i=l/f,h=m.attr("tmpPic");if(e/n<=i){p.css("width","");p.css("height",n+"px");k=g.width();o=p.width();j=(k-o)/2;m.css("marginTop","");m.css("marginLeft",j+"px")}else{p.css("height","");p.css("width",e+"px");k=g.height();o=p.height();j=(k-o)/2;m.css("marginLeft","");m.css("marginTop",j+"px")}jzUtils.run({name:"ImageEffect.FUNC.BASIC.Init",callMethod:true},Fai.top["photoNewCard"+c])})};Site.resizePhotoNewCardHeight=function(a){var k=a.find(".photoNewCardTable"),l=a.find(".formMiddleContent"),e=a.find(".photoNewCardOuter"),f=a.find(".photoNewCardInner"),h=k.find(".newCardDrag"),c=a.find(".cardTd"),b=e.attr("cusHeight"),d=h.length,i=a.height(),j=parseInt(l.css("marginTop").replace("px",""));formMiddleContentMB=parseInt(l.css("marginBottom").replace("px",""));photoNewCardInnerMT=parseInt(f.css("marginTop").replace("px",""));photoNewCardInnerMB=parseInt(f.css("marginBottom").replace("px",""));cellspacing=parseInt(k.attr("cellspacing"));if(b){i=e.height();j=0;formMiddleContentMB=0}var g=i-j-formMiddleContentMB-photoNewCardInnerMT-photoNewCardInnerMB-(2*cellspacing);c.each(function(){var o=$(this).find(".photoNewCard"),n=parseInt($(this).attr("rowspan")),m=(g-(d-1)*cellspacing)/d||"";switch(n){case 1:o.css("height",m-1+"px");break;case 2:o.css("height",(m*2+cellspacing)-1+"px");break;default:o.css("height",m-1+"px")}})};Site.adjustPhotoNewCard=function(b){if(Fai.isNumber(b)){var a=Fai.top.$("#module"+b);if(a.hasClass("formStyle85")&&!a.find(".photoNewCardOuter").attr("cusHeight")){Site.initPhotoNewCard(b);a.attr("_autoheight",0)}}else{if(typeof b=="object"){var d=b;var e=d.find(".formStyle85");if(e.length>0){c(e)}}else{if(b==undefined){var e=Fai.top.$(".formStyle85");if(e.length>0){c(e)}}}}function c(f){e.each(function(){var h=$(this).attr("id").replace("module",""),g=$(this).find(".photoNewCardOuter"),i=g.attr("cusHeight");if(i){return true}Site.initPhotoNewCard(h);$(this).attr("_autoheight",1)})}};Site.addPhotoNewCardModuleHeight=function(a){var d=Fai.top.$("#module"+a),h=d.find(".formBanner").height(),e=d.find(".photoNewCardOuter"),c=d.find(".photoNewCard"),l=d.width(),g=d.height(),j=l/960,k=e.attr("cusHeight"),i=e.height(),b=g*j;if(k){b=i}var f=(d.find(".newCardDrag").length)/2;d.css("height",b*f+"px");Site.initPhotoNewCard(a);Site.scrollToModuleDiv(d);Site.getModuleAttrPattern(a).changed=true;d.attr("_autoheight",0)};Site.hideDrag=function(a){$("#module"+a).find(".photoNewCardTable").find(".drag").each(function(){$(this).css("display","none")})};Site.initPhotoMoreCard=function(b,c){var a=Fai.top.$("#module"+b);Site.resizePhotoMoreCardHeight(a,c);Site.setPhotoMoreCardHeight(a);Site.adjustPhotoMoreCardImgSize(a);jzUtils.run({name:"ImageEffect.FUNC.BASIC.Init",callMethod:true},Fai.top["photoMoreCard"+b])};Site.setPhotoMoreCardHeight=function(a){var b=a.find(".moreCardTd");b.each(function(){var f=$(this).height(),c=$(this).width(),g=$(this).find(".photoMoreCard"),h=g.height(),e=g.width(),d=parseInt(g.css("borderTopWidth").replace("px","")||0);if(h>=f){g.css("height",f-2*d+"px")}if(e>=c){g.css("width",c-2*d+"px")}if(g.attr("photoname")=="noPhoto"){g.css("border","2px dashed #d4d4d4")}})};Site.adjustPhotoMoreCardImgSize=function(a){var c=a.attr("id").replace("module",""),b=a.find(".photoMoreCard"),d=a.find(".cardDivEffect .cardImg");Site.setPhotoMoreCardHeight(a);b.each(function(){var o=$(this).find(".cardImgView"),l=$(this).find(".cardDivEffect"),m=$(this).height();if(o.length<1){return true}var k=o.width(),g=o.height(),e=$(this).width(),i,n,f=k,j=g,h=l.attr("tmpPic");imgOrProp=f/j;if(e/m<=imgOrProp){o.css("width","");o.css("height",m+"px");i=$(this).width();n=o.width();l.css("marginTop","");l.css("marginLeft",((i-n)/2)+"px")}else{o.css("height","");o.css("width",e+"px");i=$(this).height();n=o.height();l.css("marginLeft","");l.css("marginTop",((i-n)/2)+"px")}o.removeClass("cardImgViewHide")});d.load(function(){var p=$(this),m=p.parents(".cardDiv"),h=p.parents(".photoMoreCard"),n=h.height();var l=p.width(),f=p.height(),e=h.width(),k,o,j,i=l/f,g=m.attr("tmpPic");if(e/n<=i){p.css("width","");p.css("height",n+"px");k=h.width();o=p.width();j=(k-o)/2;m.css("marginTop","");m.css("marginLeft",j+"px")}else{p.css("height","");p.css("width",e+"px");k=h.height();o=p.height();j=(k-o)/2;m.css("marginLeft","");m.css("marginTop",j+"px")}})};Site.resizePhotoMoreCardHeight=function(b,d){var p=b.find(".photoMoreCardTable"),q=b.find(".formMiddleContent"),c=b.find(".photoMoreCardOuter"),e=b.find(".photoMoreCardInner"),m=p.find(".moreCardDrag"),i=b.find(".moreCardTd"),k=1,h=1,j=false,f=c.attr("cusHeight"),g=m.length,a=b.width(),n=b.height(),o=parseInt((q.css("marginTop")||"0").replace("px",""));formMiddleContentMB=parseInt((q.css("marginBottom")||"0").replace("px",""));photoMoreCardInnerMT=parseInt((e.css("marginTop")||"0").replace("px",""));photoMoreCardInnerMB=parseInt((e.css("marginBottom")||"0").replace("px",""));cellspacing=parseInt(p.attr("cellspacing"));if(f){n=c.height();o=0;formMiddleContentMB=0}var l=n-o-formMiddleContentMB-photoMoreCardInnerMT-photoMoreCardInnerMB-(2*cellspacing);if(d!=null){b.find(".moreCardDrag").each(function(s,t){var r=parseInt($(this).attr("num"));if(s==0){k=(a-((2+r)*cellspacing))/(d-((2+r)*cellspacing))}else{h=(a-((2+r)*cellspacing))/(d-((2+r)*cellspacing));return false}});j=true}i.each(function(){var t=$(this).find(".photoMoreCard"),s=parseInt($(this).attr("rowspan")),u=$(this).width(),r=Math.floor((l-(g-1)*cellspacing)/g)||"";$(this).css("padding-top",cellspacing+"px");$(this).css("padding-left",cellspacing+"px");if(j){if($(this).parents(".moreCardDrag").attr("tr")==0){$(this).css("width",u*k+"px");t.css("width",u*k+"px")}else{$(this).css("width",u*h+"px");t.css("width",u*h+"px")}}});Site.resizePhotoMoreCartShape(b)};Site.resizePhotoMoreCartShape=function(c){var r=c.find(".photoMoreCardTable"),i=c.find(".photoMoreCardOuter"),n=c.find(".moreCardDrag"),l=c.find(".moreCardTd"),b=parseInt(r.attr("cellspacing")),u=parseInt(c.find(".photoMoreCardInner").attr("cardstyle"))||0;var n=c.find(".moreCardDrag"),t=n.length,p=t/2,d=c.height()-(t+1)*b,a=d/(p),h,m,s,g,e,l;o(c);var k=0;n.each(function(w,x){var v=$(this).find(".noPhoto");var y=v.length>0;if(y){j($(this),v)}k+=$(this).find(".moreCardTd").last().height()});function j(x,v){var w=v.first().prev();if(w.length>0&&w.attr("rowspan")!="2"){x.find(".noPhoto, .noPhoto .photoMoreCard").css("height",w.height());return}if(w.length>0&&w.attr("rowspan")=="2"){x.find(".noPhoto, .noPhoto .photoMoreCard").css("height",(w.height()-u)/2);return}if(w.length==0){var y=x.prev().find(".moreCardTd").last().height();x.find(".noPhoto, .noPhoto .photoMoreCard").css("height",a-y)}}var q=[];c.find(".moreCardTd").each(function(){var v=$(this).height();if($(this).attr("rowspan")=="2"){q.push($(this))}else{$(this).css("height",Math.floor(d*v/k));$(this).find(".photoMoreCard").css("height",Math.floor(d*v/k))}});$.each(q,function(w,y){if(y.attr("rowspan")=="2"){var x=y.next().height();var v=y.parent().next().find(".moreCardTd").first().height();y.css("height",Math.floor(x+v+b));y.find(".photoMoreCard").css("height",Math.floor(x+v+b))}});f();function f(){n.each(function(){var w=$(this).find(".noPhoto");if(w.length<1){return true}var v=$(this).children(),x=v.first();if(!x.hasClass("noPhoto")&&x.attr("rowspan")!="2"){v.css("height",x.height())}})}function o(v){v.find(".moreCardTd").each(function(){var x=$(this),w=x.height();if(w===0){x.height(1)}x.find(".photoMoreCard").each(function(){var y=$(this),z=y.height();if(z===0){y.height(1)}})})}};Site.adjustPhotoMoreCard=function(d){if(Fai.isNumber(d)){var b=Fai.top.$("#module"+d);if(b.hasClass("formStyle98")&&!b.find(".photoMoreCardOuter").attr("cusHeight")){Site.initPhotoMoreCard(d);b.attr("_autoheight",0)}}else{if(typeof d=="object"){var e=d;var c=e.find(".formStyle98");if(c.length>0){a(c)}}else{if(d==undefined){var c=Fai.top.$(".formStyle98");if(c.length>0){a(c)}}}}function a(f){c.each(function(){var h=$(this).attr("id").replace("module",""),g=$(this).find(".photoMoreCardOuter"),j=g.attr("cusHeight"),i=parseInt($(this).data("contentWidth"))||undefined;if(j){return true}Site.initPhotoMoreCard(h,i);$(this).attr("_autoheight",1)})}};Site.photoMoreCardHideDrag=function(a){$("#module"+a).find(".photoMoreCardTable").find(".drag").each(function(){$(this).css("display","none")})};Site.initPhotoMoreCardTdLength=function(d,b){var a=$("#module"+d),c=a.find(".photoMoreCardTable"),e=parseInt(c.attr("cellspacing"));a.data("photoStyleId",b);if(b==0){a.find(".moreCardDrag").each(function(g,h){var f=$(this).attr("num");if(f==0){$(this).attr("num",1)}else{$(this).attr("num",2)}})}else{if(b==1){a.find(".moreCardDrag").each(function(g,h){var f=$(this).attr("num");if(f==0){$(this).attr("num",2)}else{$(this).attr("num",1)}})}else{if(b==2){a.find(".moreCardDrag").each(function(g,h){var f=$(this).attr("num");if(f==0){$(this).attr("num",2)}else{$(this).attr("num",2)}})}else{if(b==3){a.find(".moreCardDrag").each(function(g,h){var f=$(this).attr("num");if(f==0){$(this).attr("num",1)}else{$(this).attr("num",2)}})}else{if(b==4){a.find(".moreCardDrag").each(function(g,h){var f=$(this).attr("num");if(f==0){$(this).attr("num",1)}else{$(this).attr("num",2)}})}else{if(b==5){a.find(".moreCardDrag").each(function(g,h){var f=$(this).attr("num");if(f==0){$(this).attr("num",2)}else{$(this).attr("num",1)}})}else{if(b==6){a.find(".moreCardDrag").each(function(g,h){var f=$(this).attr("num");if(f==0){$(this).attr("num",3)}else{$(this).attr("num",2)}})}else{if(b==7){a.find(".moreCardDrag").each(function(g,h){var f=$(this).attr("num");if(f==0){$(this).attr("num",2)}else{$(this).attr("num",1)}})}else{if(b==8){a.find(".moreCardDrag").each(function(g,h){var f=$(this).attr("num");if(f==0){$(this).attr("num",1)}else{$(this).attr("num",2)}})}else{if(b==9){a.find(".moreCardDrag").each(function(g,h){var f=$(this).attr("num");if(f==0){$(this).attr("num",1)}else{$(this).attr("num",0)}})}else{if(b==10){a.find(".moreCardDrag").each(function(g,h){var f=$(this).attr("num");if(f==0){$(this).attr("num",0)}else{$(this).attr("num",1)}})}else{if(b==11){a.find(".moreCardDrag").each(function(g,h){var f=$(this).attr("num");if(f==0){$(this).attr("num",1)}else{$(this).attr("num",1)}})}else{if(b==12){a.find(".moreCardDrag").each(function(g,h){var f=$(this).attr("num");if(f==0){$(this).attr("num",2)}else{$(this).attr("num",2)}})}}}}}}}}}}}}}};Site.firstPhotoMoreCardInit=function(b,o){var c=$("#module"+b),p=c.find(".photoMoreCardTable"),g=parseInt(p.attr("cellspacing")),n=c.width(),j=c.height(),f;c.data("photoStyleId",o);if(o==0){var f=Math.ceil(c.find(".moreCardTd").length/4),l=(n-3*g)*0.35,k=(n-3*g)*0.65,e=(n-4*g-l)*0.5,m=e,a=(j-(f+1)*g)/f,i=(a-g)/2,h=i,d=h;c.find(".moreCardTd").each(function(q,r){q=q%4;if(q==0){$(this).css("width",l+"px");$(this).css("height",a+"px")}else{if(q==1){$(this).css("width",k+"px");$(this).css("height",i+"px")}else{if(q==2){$(this).css("width",e+"px");$(this).css("height",h+"px")}else{if(q==3){$(this).css("width",m+"px");$(this).css("height",d+"px")}}}}})}else{if(o==1){var f=Math.ceil(c.find(".moreCardTd").length/4);l=(n-3*g)*0.35,k=(n-4*g-l)*0.5,e=k,m=(n-3*g)*0.65,a=(j-(f+1)*g)/f,i=(a-g)/2,h=i,d=h;c.find(".moreCardTd").each(function(q,r){q=q%4;if(q==0){$(this).css("width",l+"px");$(this).css("height",a+"px")}else{if(q==1){$(this).css("width",k+"px");$(this).css("height",i+"px")}else{if(q==2){$(this).css("width",e+"px");$(this).css("height",h+"px")}else{if(q==3){$(this).css("width",m+"px");$(this).css("height",d+"px")}}}}})}else{if(o==2){var f=Math.ceil(c.find(".moreCardTd").length/5);l=(n-4*g)*0.35,k=(n-4*g-l)*0.5,e=k,m=e,fifthWidth=m,a=(j-(f+1)*g)/f,i=(a-g)/2,h=i,d=h,fifthHeight=d;c.find(".moreCardTd").each(function(q,r){q=q%5;if(q==0){$(this).css("width",l+"px");$(this).css("height",a+"px")}else{if(q==1){$(this).css("width",k+"px");$(this).css("height",i+"px")}else{if(q==2){$(this).css("width",e+"px");$(this).css("height",h+"px")}else{if(q==3){$(this).css("width",m+"px");$(this).css("height",d+"px")}else{if(q==4){$(this).css("width",fifthWidth+"px");$(this).css("height",fifthHeight+"px")}}}}}})}else{if(o==3){var f=Math.ceil(c.find(".moreCardTd").length/5);l=(n-3*g)*0.35,k=(n-3*g)*0.65,e=l,m=(n-4*g-l)*0.5,fifthWidth=m,a=((j-(f+1)*g)/f-g)/2,i=a,h=i,d=h,fifthHeight=d;c.find(".moreCardTd").each(function(q,r){q=q%5;if(q==0){$(this).css("width",l+"px");$(this).css("height",a+"px")}else{if(q==1){$(this).css("width",k+"px");$(this).css("height",i+"px")}else{if(q==2){$(this).css("width",e+"px");$(this).css("height",h+"px")}else{if(q==3){$(this).css("width",m+"px");$(this).css("height",d+"px")}else{if(q==4){$(this).css("width",fifthWidth+"px");$(this).css("height",fifthHeight+"px")}}}}}})}else{if(o==4){var f=Math.ceil(c.find(".moreCardTd").length/5);l=(n-3*g)*0.65,k=(n-3*g)*0.35,e=(n-4*g-k)*0.5,m=e,fifthWidth=k,a=((j-(f+1)*g)/f-g)/2,i=a,h=i,d=h,fifthHeight=d;c.find(".moreCardTd").each(function(q,r){q=q%5;if(q==0){$(this).css("width",l+"px");$(this).css("height",a+"px")}else{if(q==1){$(this).css("width",k+"px");$(this).css("height",i+"px")}else{if(q==2){$(this).css("width",e+"px");$(this).css("height",h+"px")}else{if(q==3){$(this).css("width",m+"px");$(this).css("height",d+"px")}else{if(q==4){$(this).css("width",fifthWidth+"px");$(this).css("height",fifthHeight+"px")}}}}}})}else{if(o==5){var f=Math.ceil(c.find(".moreCardTd").length/5);m=(n-3*g)*0.65,fifthWidth=(n-3*g)*0.35,l=(n-4*g-fifthWidth)*0.5,k=l,e=(n-4*g)*0.35,a=((j-(f+1)*g)/f-g)/2,i=a,h=i,d=h,fifthHeight=d;c.find(".moreCardTd").each(function(q,r){q=q%5;if(q==0){$(this).css("width",l+"px");$(this).css("height",a+"px")}else{if(q==1){$(this).css("width",k+"px");$(this).css("height",i+"px")}else{if(q==2){$(this).css("width",e+"px");$(this).css("height",h+"px")}else{if(q==3){$(this).css("width",m+"px");$(this).css("height",d+"px")}else{if(q==4){$(this).css("width",fifthWidth+"px");$(this).css("height",fifthHeight+"px")}}}}}})}else{if(o==6){var f=Math.ceil(c.find(".moreCardTd").length/7);l=(n-5*g)*0.25,k=l,e=k,m=e,fifthWidth=l*2+g,sixthWidth=m,seventhWidth=sixthWidth,a=((j-(f+1)*g)/f-g)/2,i=a,h=i,d=h,fifthHeight=d;sixthHeight=fifthHeight,seventhHeight=sixthHeight;c.find(".moreCardTd").each(function(q,r){q=q%7;if(q==0){$(this).css("width",l+"px");$(this).css("height",a+"px")}else{if(q==1){$(this).css("width",k+"px");$(this).css("height",i+"px")}else{if(q==2){$(this).css("width",e+"px");$(this).css("height",h+"px")}else{if(q==3){$(this).css("width",m+"px");$(this).css("height",d+"px")}else{if(q==4){$(this).css("width",fifthWidth+"px");$(this).css("height",fifthHeight+"px")}else{if(q==5){$(this).css("width",sixthWidth+"px");$(this).css("height",sixthHeight+"px")}else{if(q==6){$(this).css("width",seventhWidth+"px");$(this).css("height",seventhHeight+"px")}}}}}}}})}else{if(o==7){var f=Math.ceil(c.find(".moreCardTd").length/5);l=(n-4*g)*0.33,k=(n-4*g)*0.34,e=l,m=(n-3*g)*0.5,fifthWidth=m,a=((j-(f+1)*g)/f-g)/2,i=a,h=i,d=h,fifthHeight=d;c.find(".moreCardTd").each(function(q,r){q=q%5;if(q==0){$(this).css("width",l+"px");$(this).css("height",a+"px")}else{if(q==1){$(this).css("width",k+"px");$(this).css("height",i+"px")}else{if(q==2){$(this).css("width",e+"px");$(this).css("height",h+"px")}else{if(q==3){$(this).css("width",m+"px");$(this).css("height",d+"px")}else{if(q==4){$(this).css("width",fifthWidth+"px");$(this).css("height",fifthHeight+"px")}}}}}})}else{if(o==8){var f=Math.ceil(c.find(".moreCardTd").length/5);l=(n-3*g)*0.5,k=l,e=(n-4*g)*0.33,m=(n-4*g)*0.34,fifthWidth=e,a=((j-(f+1)*g)/f-g)/2,i=a,h=i,d=h,fifthHeight=d;c.find(".moreCardTd").each(function(q,r){q=q%5;if(q==0){$(this).css("width",l+"px");$(this).css("height",a+"px")}else{if(q==1){$(this).css("width",k+"px");$(this).css("height",i+"px")}else{if(q==2){$(this).css("width",e+"px");$(this).css("height",h+"px")}else{if(q==3){$(this).css("width",m+"px");$(this).css("height",d+"px")}else{if(q==4){$(this).css("width",fifthWidth+"px");$(this).css("height",fifthHeight+"px")}}}}}})}else{if(o==9){var f=Math.ceil(c.find(".moreCardTd").length/3);l=(n-3*g)*0.5,k=l,e=(n-2*g)*1,a=((j-(f+1)*g)/f-g)/2,i=a,h=i;c.find(".moreCardTd").each(function(q,r){q=q%3;if(q==0){$(this).css("width",l+"px");$(this).css("height",a+"px")}else{if(q==1){$(this).css("width",k+"px");$(this).css("height",i+"px")}else{if(q==2){$(this).css("width",e+"px");$(this).css("height",h+"px")}}}})}else{if(o==10){var f=Math.ceil(c.find(".moreCardTd").length/3);l=(n-2*g)*1,k=(n-3*g)*0.5,e=k,a=((j-(f+1)*g)/f-g)/2,i=a,h=i;c.find(".moreCardTd").each(function(q,r){q=q%3;if(q==0){$(this).css("width",l+"px");$(this).css("height",a+"px")}else{if(q==1){$(this).css("width",k+"px");$(this).css("height",i+"px")}else{if(q==2){$(this).css("width",e+"px");$(this).css("height",h+"px")}}}})}else{if(o==11){var f=Math.ceil(c.find(".moreCardTd").length/4);l=(n-3*g)*0.65,k=(n-3*g)*0.35,e=k,m=l,a=((j-(f+1)*g)/f-g)/2,i=a,h=i,d=h;c.find(".moreCardTd").each(function(q,r){q=q%4;if(q==0){$(this).css("width",l+"px");$(this).css("height",a+"px")}else{if(q==1){$(this).css("width",k+"px");$(this).css("height",i+"px")}else{if(q==2){$(this).css("width",e+"px");$(this).css("height",h+"px")}else{if(q==3){$(this).css("width",m+"px");$(this).css("height",d+"px")}}}}})}else{if(o==12){var f=Math.ceil(c.find(".moreCardTd").length/6);l=(n-4*g)*0.43,k=(n-4*g)*0.34,e=(n-4*g)*0.23,m=e,fifthWidth=k,sixthWidth=l,a=((j-(f+1)*g)/f-g)/2,i=a,h=i,d=h,fifthHeight=d;sixthHeight=fifthHeight;c.find(".moreCardTd").each(function(q,r){q=q%6;if(q==0){$(this).css("width",l+"px");$(this).css("height",a+"px")}else{if(q==1){$(this).css("width",k+"px");$(this).css("height",i+"px")}else{if(q==2){$(this).css("width",e+"px");$(this).css("height",h+"px")}else{if(q==3){$(this).css("width",m+"px");$(this).css("height",d+"px")}else{if(q==4){$(this).css("width",fifthWidth+"px");$(this).css("height",fifthHeight+"px")}else{if(q==5){$(this).css("width",sixthWidth+"px");$(this).css("height",sixthHeight+"px")}}}}}}})}}}}}}}}}}}}}Site.adjustPhotoMoreCardImgSize(c)};Site.nophotoMoreCardInit=function(a,l){var b=$("#module"+a),m=b.find(".photoMoreCardTable"),e=parseInt(m.attr("cellspacing")),k=b.width(),f=b.height(),c;if(l==0){var j,h,g,i=b.find(".noPhoto").length,d=b.find(".noPhoto").eq(0).attr("number");if(i==1){j=b.find(".moreCardTd").eq(d-1).width();h=b.find(".moreCardTd").eq(d-2).width()-j-e;b.find(".noPhoto").eq(0).css("width",h+"px")}else{if(i==2){j=b.find(".moreCardTd").eq(d-1).width();h=(j-e)/2;g=h;b.find(".noPhoto").eq(0).css("width",h+"px");b.find(".noPhoto").eq(1).css("width",g+"px")}else{if(i==3){j=b.find(".moreCardTd").eq(d-1).width();h=k-j-3*e;g=(k-j-4*e)/2;b.find(".noPhoto").eq(0).css("width",h+"px");b.find(".noPhoto").eq(1).css("width",g+"px");b.find(".noPhoto").eq(2).css("width",g+"px")}}}}else{if(l==1){var j,h,g,i=b.find(".noPhoto").length,d=b.find(".noPhoto").eq(0).attr("number");if(i==1){j=b.find(".moreCardTd").eq(d-1).width();h=b.find(".moreCardTd").eq(d-2).width()+j+e;b.find(".noPhoto").eq(0).css("width",h+"px")}else{if(i==2){j=b.find(".moreCardTd").eq(d-2).width();h=k-3*e-j;g=h-b.find(".moreCardTd").eq(d-1).width()-e;b.find(".noPhoto").eq(0).css("width",g+"px");b.find(".noPhoto").eq(1).css("width",h+"px")}else{if(i==3){j=b.find(".moreCardTd").eq(d-1).width();h=k-j-3*e;g=(k-j-4*e)/2;b.find(".noPhoto").eq(0).css("width",g+"px");b.find(".noPhoto").eq(1).css("width",g+"px");b.find(".noPhoto").eq(2).css("width",h+"px")}}}}else{if(l==2){var j,h,g,i=b.find(".noPhoto").length,d=b.find(".noPhoto").eq(0).attr("number");if(i==1){j=b.find(".moreCardTd").eq(d-4).width();h=k-b.find(".moreCardTd").eq(d-1).width()-j-4*e;b.find(".noPhoto").eq(0).css("width",h+"px")}else{if(i==2){j=b.find(".moreCardTd").eq(d-3).width();h=(k-4*e-j)/2;b.find(".noPhoto").eq(0).css("width",h+"px");b.find(".noPhoto").eq(1).css("width",h+"px")}else{if(i==3){j=b.find(".moreCardTd").eq(d-2).width();h=k-b.find(".moreCardTd").eq(d-1).width()-j-4*e;g=(k-j-4*e)/2;b.find(".noPhoto").eq(0).css("width",h+"px");b.find(".noPhoto").eq(1).css("width",g+"px");b.find(".noPhoto").eq(2).css("width",g+"px")}else{if(i==4){j=b.find(".moreCardTd").eq(d-1).width();h=(k-4*e-j)/2;b.find(".noPhoto").eq(0).css("width",h+"px");b.find(".noPhoto").eq(1).css("width",h+"px");b.find(".noPhoto").eq(2).css("width",h+"px");b.find(".noPhoto").eq(3).css("width",h+"px")}}}}}else{if(l==3){var j,h,g,i=b.find(".noPhoto").length,d=b.find(".noPhoto").eq(0).attr("number");if(i==1){j=k-b.find(".moreCardTd").eq(d-1).width()-b.find(".moreCardTd").eq(d-2).width()-4*e;b.find(".noPhoto").eq(0).css("width",j+"px")}else{if(i==2){j=(k-b.find(".moreCardTd").eq(d-1).width()-4*e)/2;b.find(".noPhoto").eq(0).css("width",j+"px");b.find(".noPhoto").eq(1).css("width",j+"px")}else{if(i==3){j=(k-4*e)/3;b.find(".noPhoto").eq(0).css("width",j+"px");b.find(".noPhoto").eq(1).css("width",j+"px");b.find(".noPhoto").eq(2).css("width",j+"px")}else{if(i==4){j=k-b.find(".moreCardTd").eq(d-1).width()-3*e;h=(k-4*e)/3;b.find(".noPhoto").eq(0).css("width",j+"px");b.find(".noPhoto").eq(1).css("width",h+"px");b.find(".noPhoto").eq(2).css("width",h+"px");b.find(".noPhoto").eq(3).css("width",h+"px")}}}}}else{if(l==4){var j,h,g,i=b.find(".noPhoto").length,d=b.find(".noPhoto").eq(0).attr("number");if(i==1){j=k-b.find(".moreCardTd").eq(d-1).width()-b.find(".moreCardTd").eq(d-2).width()-4*e;b.find(".noPhoto").eq(0).css("width",j+"px")}else{if(i==2){j=(k-b.find(".moreCardTd").eq(d-1).width()-4*e)/2;b.find(".noPhoto").eq(0).css("width",j+"px");b.find(".noPhoto").eq(1).css("width",j+"px")}else{if(i==3){j=(k-4*e)/3;b.find(".noPhoto").eq(0).css("width",j+"px");b.find(".noPhoto").eq(1).css("width",j+"px");b.find(".noPhoto").eq(2).css("width",j+"px")}else{if(i==4){j=k-b.find(".moreCardTd").eq(d-1).width()-3*e;h=(k-4*e)/3;b.find(".noPhoto").eq(0).css("width",j+"px");b.find(".noPhoto").eq(1).css("width",h+"px");b.find(".noPhoto").eq(2).css("width",h+"px");b.find(".noPhoto").eq(3).css("width",h+"px")}}}}}else{if(l==5){var j,h,g,i=b.find(".noPhoto").length,d=b.find(".noPhoto").eq(0).attr("number");if(i==1){j=k-b.find(".moreCardTd").eq(d-1).width()-3*e;b.find(".noPhoto").eq(0).css("width",j+"px")}else{if(i==2){j=(k-3*e)/2;b.find(".noPhoto").eq(0).css("width",j+"px");b.find(".noPhoto").eq(1).css("width",j+"px")}else{if(i==3){j=k-b.find(".moreCardTd").eq(d-1).width()-b.find(".moreCardTd").eq(d-2).width()-4*e;h=(k-3*e)/2;b.find(".noPhoto").eq(0).css("width",j+"px");b.find(".noPhoto").eq(1).css("width",h+"px");b.find(".noPhoto").eq(2).css("width",h+"px")}else{if(i==4){j=(k-b.find(".moreCardTd").eq(d-1).width()-4*e)/2;h=(k-3*e)/2;b.find(".noPhoto").eq(0).css("width",j+"px");b.find(".noPhoto").eq(1).css("width",j+"px");b.find(".noPhoto").eq(2).css("width",h+"px");b.find(".noPhoto").eq(3).css("width",h+"px")}}}}}else{if(l==6){var j,h,g,i=b.find(".noPhoto").length,d=b.find(".noPhoto").eq(0).attr("number");if(i==1){j=k-b.find(".moreCardTd").eq(d-1).width()-b.find(".moreCardTd").eq(d-2).width()-4*e;b.find(".noPhoto").eq(0).css("width",j+"px")}else{if(i==2){j=(k-b.find(".moreCardTd").eq(d-1).width()-4*e)/2;b.find(".noPhoto").eq(0).css("width",j+"px");b.find(".noPhoto").eq(1).css("width",j+"px")}else{if(i==3){j=(k-4*e)/3;b.find(".noPhoto").eq(0).css("width",j+"px");b.find(".noPhoto").eq(1).css("width",j+"px");b.find(".noPhoto").eq(2).css("width",j+"px")}else{if(i==4){j=k-b.find(".moreCardTd").eq(d-1).width()-b.find(".moreCardTd").eq(d-2).width()-b.find(".moreCardTd").eq(d-3).width()-5*e;h=(k-4*e)/3;b.find(".noPhoto").eq(0).css("width",j+"px");b.find(".noPhoto").eq(1).css("width",h+"px");b.find(".noPhoto").eq(2).css("width",h+"px");b.find(".noPhoto").eq(3).css("width",h+"px")}else{if(i==5){j=(k-b.find(".moreCardTd").eq(d-1).width()-b.find(".moreCardTd").eq(d-2).width()-5*e)/2;h=(k-4*e)/3;b.find(".noPhoto").eq(0).css("width",j+"px");b.find(".noPhoto").eq(1).css("width",j+"px");b.find(".noPhoto").eq(2).css("width",h+"px");b.find(".noPhoto").eq(3).css("width",h+"px");b.find(".noPhoto").eq(4).css("width",h+"px")}else{if(i==6){j=(k-b.find(".moreCardTd").eq(d-1).width()-5*e)/3;h=(k-4*e)/3;b.find(".noPhoto").eq(0).css("width",j+"px");b.find(".noPhoto").eq(1).css("width",j+"px");b.find(".noPhoto").eq(2).css("width",j+"px");b.find(".noPhoto").eq(3).css("width",h+"px");b.find(".noPhoto").eq(4).css("width",h+"px");b.find(".noPhoto").eq(5).css("width",h+"px")}}}}}}}else{if(l==7){var j,h,g,i=b.find(".noPhoto").length,d=b.find(".noPhoto").eq(0).attr("number");if(i==1){j=k-b.find(".moreCardTd").eq(d-1).width()-3*e;b.find(".noPhoto").eq(0).css("width",j+"px")}else{if(i==2){j=(k-3*e)/2;b.find(".noPhoto").eq(0).css("width",j+"px");b.find(".noPhoto").eq(1).css("width",j+"px")}else{if(i==3){j=k-b.find(".moreCardTd").eq(d-1).width()-b.find(".moreCardTd").eq(d-2).width()-4*e;h=(k-3*e)/2;b.find(".noPhoto").eq(0).css("width",j+"px");b.find(".noPhoto").eq(1).css("width",h+"px");b.find(".noPhoto").eq(2).css("width",h+"px")}else{if(i==4){j=(k-b.find(".moreCardTd").eq(d-1).width()-4*e)/2;h=(k-3*e)/2;b.find(".noPhoto").eq(0).css("width",j+"px");b.find(".noPhoto").eq(1).css("width",j+"px");b.find(".noPhoto").eq(2).css("width",h+"px");b.find(".noPhoto").eq(3).css("width",h+"px")}}}}}else{if(l==8){var j,h,g,i=b.find(".noPhoto").length,d=b.find(".noPhoto").eq(0).attr("number");if(i==1){j=k-b.find(".moreCardTd").eq(d-1).width()-b.find(".moreCardTd").eq(d-2).width()-4*e;b.find(".noPhoto").eq(0).css("width",j+"px")}else{if(i==2){j=(k-b.find(".moreCardTd").eq(d-1).width()-4*e)/2;b.find(".noPhoto").eq(0).css("width",j+"px");b.find(".noPhoto").eq(1).css("width",j+"px")}else{if(i==3){j=(k-4*e)/3;b.find(".noPhoto").eq(0).css("width",j+"px");b.find(".noPhoto").eq(1).css("width",j+"px");b.find(".noPhoto").eq(2).css("width",j+"px")}else{if(i==4){j=k-b.find(".moreCardTd").eq(d-1).width()-3*e;h=(k-4*e)/3;b.find(".noPhoto").eq(0).css("width",j+"px");b.find(".noPhoto").eq(1).css("width",h+"px");b.find(".noPhoto").eq(2).css("width",h+"px");b.find(".noPhoto").eq(3).css("width",h+"px")}}}}}else{if(l==9){var j,h,g,i=b.find(".noPhoto").length,d=b.find(".noPhoto").eq(0).attr("number");if(i==1){j=k-2*e;b.find(".noPhoto").eq(0).css("width",j+"px")}else{if(i==2){j=k-b.find(".moreCardTd").eq(d-1).width()-3*e;h=k-2*e;b.find(".noPhoto").eq(0).css("width",j+"px");b.find(".noPhoto").eq(1).css("width",h+"px")}}}else{if(l==10){var j,h,g,i=b.find(".noPhoto").length,d=b.find(".noPhoto").eq(0).attr("number");if(i==1){j=k-b.find(".moreCardTd").eq(d-1).width()-3*e;b.find(".noPhoto").eq(0).css("width",j+"px")}else{if(i==2){j=(k-3*e)/2;b.find(".noPhoto").eq(0).css("width",j+"px");b.find(".noPhoto").eq(1).css("width",j+"px")}}}else{if(l==11){var j,h,g,i=b.find(".noPhoto").length,d=b.find(".noPhoto").eq(0).attr("number");if(i==1){j=k-b.find(".moreCardTd").eq(d-1).width()-3*e;b.find(".noPhoto").eq(0).css("width",j+"px")}else{if(i==2){j=(k-3*e)/2;b.find(".noPhoto").eq(0).css("width",j+"px");b.find(".noPhoto").eq(1).css("width",j+"px")}else{if(i==3){j=k-b.find(".moreCardTd").eq(d-1).width()-3*e;h=(k-3*e)/2;b.find(".noPhoto").eq(0).css("width",j+"px");b.find(".noPhoto").eq(1).css("width",h+"px");b.find(".noPhoto").eq(2).css("width",h+"px")}}}}else{if(l==12){var j,h,g,i=b.find(".noPhoto").length,d=b.find(".noPhoto").eq(0).attr("number");if(i==1){j=k-b.find(".moreCardTd").eq(d-1).width()-b.find(".moreCardTd").eq(d-2).width()-4*e;b.find(".noPhoto").eq(0).css("width",j+"px")}else{if(i==2){j=(k-b.find(".moreCardTd").eq(d-1).width()-4*e)/2;b.find(".noPhoto").eq(0).css("width",j+"px");b.find(".noPhoto").eq(1).css("width",j+"px")}else{if(i==3){j=(k-4*e)/3;b.find(".noPhoto").eq(0).css("width",j+"px");b.find(".noPhoto").eq(1).css("width",j+"px");b.find(".noPhoto").eq(2).css("width",j+"px")}else{if(i==4){j=k-b.find(".moreCardTd").eq(d-1).width()-b.find(".moreCardTd").eq(d-2).width()-4*e;h=(k-4*e)/3;b.find(".noPhoto").eq(0).css("width",j+"px");b.find(".noPhoto").eq(1).css("width",h+"px");b.find(".noPhoto").eq(2).css("width",h+"px");b.find(".noPhoto").eq(3).css("width",h+"px")}else{if(i==5){j=(k-b.find(".moreCardTd").eq(d-1).width()-4*e)/2;h=(k-4*e)/3;b.find(".noPhoto").eq(0).css("width",j+"px");b.find(".noPhoto").eq(1).css("width",j+"px");b.find(".noPhoto").eq(2).css("width",h+"px");b.find(".noPhoto").eq(3).css("width",h+"px");b.find(".noPhoto").eq(4).css("width",h+"px")}}}}}}}}}}}}}}}}}}Site.adjustPhotoMoreCardImgSize(b)};Site.initSimpleTextContent=function(d,c){var b=Fai.top.$("#module"+d),a;if(c!=1){if(b.is(":visible")){b.css("height","auto");b.css("height",b.height())}else{a=b.clone();a.attr("id","").css({position:"absolute",visibility:"hidden",height:"auto"}).appendTo(Fai.top.$("body"));b.css("height",a.height());a.remove()}}};(function(h,e,f){var b={},l="fullmeasureOuterContentPage",g=false,k=false,c=false,j=false,a=0,i=0;var d=[];h(function(){var o=h(".formStyle80");setTimeout(function(){k=true;if(d.length>0||Fai.top._manageMode){h("body").off("mousemove.fmGmainMousemove").on("mousemove.fmGmainMousemove",function(p){if(Fai.top._manageMode){if(h(".popupBg").length>0){if(!j){j=true;a=0;var w=h(".formStyle80");if(w.length>0){w.each(function(y,A){var z=h(A).attr("id");if(typeof(z)!=f){h("#module"+z.replace("module","")).data("mouseenter",false)}})}}}else{j=false}}if(d.length>0){if(c){return}c=true;a=0;var u=p||window.event;var v=u.clientY;var s=false;for(var t=0;t<d.length;t++){var r=h("#module"+d[t]);var x=r.height();var q=h("#module"+d[t])[0].getBoundingClientRect().top;if(v>=q&&v<=(x+q)){a=d[t];s=true;break}}if(!s){a=0}c=false}})}if(Fai.top._manageMode){h("body").off("click.fmGmainClick").on("click.fmGmainClick",function(){if(i==0){return}if(i!=a){if(h("#faiFloatPanel").css("display")!="block"){i=0}}})}},1500);if(o.length>0||Fai.top._manageMode){o.each(function(p,q){var r=h(q).attr("id");if(typeof(r)!=f){e.refFillRelativeDivHeight(r.replace("module",""),true)}});if(Fai.top._colId==8){setTimeout(function(){o.each(function(p,q){var r=h(q).attr("id");if(typeof(r)!=f){e.refFillRelativeDivHeight(r.replace("module",""),true)}})},2500)}setTimeout(function(){g=true;o.each(function(p,r){var q=h(r).attr("id");if(typeof(q)!=f){q=q.replace("module","");e.refFillRelativeDivHeight(q,true);e.dynamicSetArrowDom(q)}})},1000);h(window).resize(function(){var p=h(".formStyle80");p.each(function(q,t){var s=h(t).attr("fmslidestyle");var r=h(t).attr("id");if(typeof r!=f){r=r.replace("module","");e.buildFmSlideStyleDom(r,s)}})})}});e.fmAddModuleStopCarousel=function(q){if(typeof(q)==f){return}if(Fai.top._manageMode){var o=h("#module"+q);if(!o.hasClass("formStyle80")){var p=Site.checkNestModule(o);if(p.inFullmeasure){q=p.parentId}}}setTimeout(function(){i=q},500)};e.setFmCarouselIdList=function(r,q){var o=false;for(var p=(d.length-1);p>=0;p--){if(d[p]==r){if(q!=1){d.splice(p,1)}o=true;break}}if(!o){if(q==1){d[d.length]=r}}};function n(r,p,o,q){e.setModuleFmSlideStyleAndPage(r,p,o,q);e.clearAnimate(r);e.bindModuleEvent(r);e.refFillRelativeDivHeight(r)}e.setModuleFmSlideStyleAndPage=function(r,p,o,q){if(typeof(r)==f||typeof(p)==f||typeof(o)==f){return}h("#module"+r).attr("fmSlideStyle",p);h("#module"+r).attr("fmPage",o);h("#module"+r).attr("isCarousel",q.c);h("#module"+r).attr("displayTime",q.d);h("#module"+r).attr("carouselSpeed",q.s);h("#module"+r).attr("cuscarousel",q.u);e.buildFmSlideStyleDom(r,p);e.setFmCarouselIdList(r,q.c);m(r)};e.clearAnimate=function(p){if(p in b){var o=b[p];if("animateCt" in o){clearInterval(o.animateCt)}if("animateSlide" in o){clearInterval(o.animateSlide)}}};e.bindModuleEvent=function(p){var o=h("#module"+p);o.off("mouseenter.fullmeasureAnimate").on("mouseenter.fullmeasureAnimate",function(){h(this).data("mouseenter",true)});o.off("mouseleave.fullmeasureAnimate").on("mouseleave.fullmeasureAnimate",function(){h(this).data("mouseenter",false)})};e.refFillRelativeDivHeight=function(o,u){if(typeof(o)==f){return}var q=h("#module"+o);var x=0,p=0;if(q.find(".fullmeasureContent").length>0){var r=q.find(".J_fullmeasurePageShow .fullmeasureOuterContent").clone();var s=false;q.prepend("<div class='J_fullmeasureGetMaxHeight' style='display:none; position:relative; height:auto;'></div>");if(typeof(r)!=f&&r!=null){r.each(function(z,A){h(A).find("input").removeAttr("name");q.find(".J_fullmeasureGetMaxHeight").html(h(A));if(q.find(".J_fullmeasureGetMaxHeight").find(".fullmeasureContent").children(".form").length<=0){var B=q.find(".J_fullmeasureGetMaxHeight").innerHeight();var y=q.find(".J_fullmeasureGetMaxHeight").height();if(y>0){s=true}if(B>p){p=B}return true}var y=q.find(".J_fullmeasureGetMaxHeight").height();if(y>x){x=y}})}q.find(".J_fullmeasureGetMaxHeight").remove();var w=q.find(".J_fullmeasurePageShow").find(".fullmeasureOuterContentBg");w.each(function(y,A){var z=h(A).css("background");if(typeof(z)!=f&&z.indexOf("url")>0){s=true;return false}});if(s==true&&q.find(".fullmeasureContent").find(".form").length<=0){x=p}r=null;if(x<=0){if(Fai.top._manageMode||s==true){x=165}}q.find(".fillContentRelative").css({height:x,position:"relative"})}if(u==true){var v=q.find(".fullmeasureOuterContentPage");for(var t=0;t<v.length;t++){if(v.eq(t).css("display")!="block"){v.eq(t).addClass("hideFmOuterContentPage").css("display","block")}}setTimeout(function(){q.find(".formTabButtonHover").click();setTimeout(function(){q.find(".hideFmOuterContentPage").removeClass("hideFmOuterContentPage").css("display","none")},100)},1000)}e.dynamicSetArrowDom(o)};e.refreshSlideArrowPositon=function(p){var o=h("#module"+p).attr("fmslidestyle");e.buildFmSlideStyleDom(p,o)};e.slide=function(q,E,u,s){if(!k){return}var A=b[q];var p=h("#module"+q);if(s!=0){if(Fai.top._manageMode){if(h("body").children(".popupBg").length||h(".moduleMaskContainer").length>0){return}if(h("#faiFloatPanel").css("display")=="block"&&q==i){return}}if(p.data("stopCarousel")==true){return}if(a==q){return}}var o=parseInt(p.attr("isCarousel"));if(isNaN(o)){o=0}var F=o;if(typeof(s)!=f){o=s}var G=parseFloat(p.attr("carouselSpeed"));if(isNaN(G)){G=1}if(o==1){if(p.data("mouseenter")==true){return}}if(p.data("animateSlide")==true){return}p.data("animateSlide",true);var v=p.find(".J_fullmeasurePageShow");if("animateSlide" in A){clearInterval(A.animateSlide)}if(v.length<=1){p.data("animateSlide",false);return}var y,D,C,r=true;if(o==1){for(var B=0;B<v.length;B++){var z=v.eq(B);if(z.css("display")=="block"){D=z;C=B;if(B<(v.length-1)){E=(parseInt(B)+1);y=v.eq(E)}else{E=0;y=v.eq(0)}break}}}else{for(var B=0;B<v.length;B++){var z=v.eq(B);if(z.css("display")=="block"&&B!=E){D=z;C=B;break}}y=v.eq(E)}if(typeof(y)==f||y==null||y.length<=0){p.data("animateSlide",false);return}if(typeof(D)==f||D==null||D.length<=0){p.data("animateSlide",false);return}if(C>E){r=false}if(u==true&&E==0){r=true}if(o==1){r=true}var x=p.width(),t=0,w=parseInt(x/parseInt(G*1000/40));if(F!=1){w=150}p.find(".fmSlideStyleShow").removeClass("fmSlideStyleShow");p.find(".fmSlideStyle").eq(E).addClass("fmSlideStyleShow");if(r){y.css({left:x,display:"block"})}else{y.css({left:("-"+x+"px"),display:"block"})}if("animateSlide" in A){clearInterval(A.animateSlide)}A.animateSlide=setInterval(function(){if(r){if(y.css("left").replace("px","")<=0){if("animateSlide" in A){clearInterval(A.animateSlide);jzUtils.run({name:"moduleAnimation.publish",base:Fai.top.Site});jzUtils.run({name:"moduleAnimation.contentAnimationPublish",base:Fai.top.Site})}y.css({display:"block",left:"0"});D.css({display:"none",left:"0"});p.data("animateSlide",false);return}if(t>=x){y.css({display:"block",left:"0"});D.css({display:"none",left:"0"});if("animateSlide" in A){clearInterval(A.animateSlide);jzUtils.run({name:"moduleAnimation.publish",base:Fai.top.Site});jzUtils.run({name:"moduleAnimation.contentAnimationPublish",base:Fai.top.Site})}p.data("animateSlide",false);return}D.css("left","-"+t+"px");y.css("left",(parseInt(x)-parseInt(t))+"px");t=t+w}else{if(y.css("left").replace("px","")>=0){if("animateSlide" in A){clearInterval(A.animateSlide);jzUtils.run({name:"moduleAnimation.publish",base:Fai.top.Site});jzUtils.run({name:"moduleAnimation.contentAnimationPublish",base:Fai.top.Site})}y.css({display:"block",left:"0"});D.css({display:"none",left:"0"});p.data("animateSlide",false);return}if(t>=x){y.css({display:"block",left:"0"});D.css({display:"none",left:"0"});if("animateSlide" in A){clearInterval(A.animateSlide);jzUtils.run({name:"moduleAnimation.publish",base:Fai.top.Site});jzUtils.run({name:"moduleAnimation.contentAnimationPublish",base:Fai.top.Site})}p.data("animateSlide",false);return}D.css("left",t+"px");y.css("left",(parseInt("-"+x)+parseInt(t))+"px");t=t+w}},40)};function m(o){if(typeof(b[o])!=f){if("animateCt" in b[o]){clearInterval(b[o]["animateCt"])}}var p={};b[o]=p;var q=h("#module"+o);var v=q.find(".fullmeasureOuterContentPage");var u=v.eq(0);if(q.find(".fillContentRelative").length>0){var t=u.height();q.find(".formWrap").css({position:"relative"});v.css({position:"absolute"})}if(v.length<=1){if(!Fai.top._manageMode&&v.length==1){v.css({position:"static"})}return}v.each(function(z,A){var y=h(A);var B=h(A).attr("page");if(typeof(B)==f){B=1000;y.attr("1000")}});var s=parseInt(q.attr("isCarousel"));if(isNaN(s)){s=0}if(s==1){var x=parseFloat(q.attr("displayTime"));if(isNaN(x)){x=4}var r=parseFloat(q.attr("carouselSpeed"));if(isNaN(r)){r=1}var w=(r+x)*1000;p.animateCt=setInterval("Site.inFullmeasueAnimation.slide('"+o+"');",w)}}e.animateFm=function(r,p,o,q){var r=r+"";n(r,p,o,q);m(r)};e.slideArrow=function(u,s){var u=u+"";var q=h("#module"+u);var o=q.find(".J_fullmeasurePageShow");var r=o.length;if(r<=1){return}var p=0;o.each(function(v,w){if(h(w).css("display")=="block"){p=v;return false}});if(s==1){p--}else{if(s==2){p++}else{return}}if(p<-1){r=parseInt(r)-1}else{if(p>=r){r=0}else{r=p}}var t=s==2?true:false;e.slide(u,r,t,0)};e.dynamicSetArrowDom=function(s){var s=s+"";var p=h("#module"+s);var o=p.find(".fmSlideStyleArrowBase");if(o.length>0){if(o.css("display")=="none"){setTimeout(function(){var u=p.height();if(u<80){o.css({display:"none"})}else{var t=parseInt((parseInt(u)-80)/2);o.css({top:t+"px",display:"block"})}},500)}else{var r=p.height();if(r<80){o.css({display:"none"})}else{var q=parseInt((parseInt(r)-80)/2);o.css({top:q+"px",display:"block"})}}}else{if(g){if(p.find(".J_fmSlideStyle").length>0){var r=p.height();if(r<40){p.find(".J_fmSlideStyle").css("display","none")}else{p.find(".J_fmSlideStyle").css("display","block")}}}}};e.buildFmSlideStyleDom=function(r,C){var r=r+"";var s=h("#module"+r);s.find(".J_fmSlideStyle").remove();var B=s.find(".J_fullmeasurePageShow");var A=B.length;if(A<=1){return}var q=0;B.each(function(F,G){if(h(G).css("display")=="block"){q=F;return false}});var x=[];if(C==3){var y=B.find(".fullmeasureContent").width();var z=h(document.body).width();var p=0;if((z-y)>184){p=parseInt(((parseInt(z)-parseInt(y))/2-92));if(Fai.top._manageMode){p=p-10}}else{p=20}p=p+"px";var o="style='display:none;left:"+p+";'",E="style='display:none;right:"+p+";''";var w="",u="",D="";w="J_fmSlideStyle fmSlideStyleArrowBase fmSlideStyleArrowLast fmSlideStyle"+C;u="J_fmSlideStyle fmSlideStyleArrowBaseBg fmSlideStyleArrowBase fmSlideStyleArrowLast";x.push("<div "+o+" class='"+u+"'></div><div "+o+" class='"+w+"' onclick='Site.inFullmeasueAnimation.slideArrow("+r+", 1)'></div>");w="J_fmSlideStyle fmSlideStyleArrowBase fmSlideStyleArrowNext fmSlideStyle"+C;u="J_fmSlideStyle fmSlideStyleArrowBaseBg fmSlideStyleArrowBase fmSlideStyleArrowNext";D="Site.inFullmeasueAnimation.slideArrow("+r+", 'next')";x.push("<div "+E+" class='"+u+"'></div><div "+E+" class='"+w+"' onclick='Site.inFullmeasueAnimation.slideArrow("+r+", 2)'></div>")}else{var t="";if(!g){t="style='display:none;'"}x.push("<div "+t+" class='fmSlideStyleWrap J_fmSlideStyle'>");var w="",D="";for(var v=0;v<A;v++){w="fmSlideStyle fmSlideStyle"+C;D="Site.inFullmeasueAnimation.slide("+r+","+v+", false, 0)";if(v==q){w=w+" fmSlideStyleShow"}x.push("<div class='"+w+"' onclick='"+D+"'></div>")}x.push("</div>")}s.append(x.join(""));e.dynamicSetArrowDom(r)}})(jQuery,Site.inFullmeasueAnimation||(Site.inFullmeasueAnimation={}),"undefined");(function(a,b){if(window!=Fai.top){return}b.pZone=null;b.openZone=function(g,f){if(!window.site_cityUtil){$LAB.script(Fai.top._cityJsLink).wait(function(){d(g,f)})}else{d(g,f)}};function d(h,f){Fai.top.$("#popupLevel").addClass("popupLevelShow");b.pZone&&b.pZone.destroy();b.pZone=new b.PopupZone(null,h,f);var g=b.pZone;g.ajaxDomShow();b.id=b.pZone.id;b.formLinkWin=f?f:b.formLinkWin}b.closeZone=function(){b.pZone&&b.pZone.destroy()};b.PopupZone=function(h,i,g,f){var i=i||(h&&h.attr("id").replace("module","")),h=h||(i&&Fai.top.$("#module"+i));this.id=i;this.module=h;this.create=f||false;this.funPanel=null;this.editing=false;this.enterStatus=g?true:false;this.extDomModules=[79,81,86];this.allPopupZoneList=[];this.historyModules=[];this.switchActive=false};b.PopupZone.prototype.destroy=function(){var f=this;module=this.module,extDomModules=this.extDomModules;if(Fai.top._manageMode&&!f.manageDestroy()){delete f.isSwitching;return false}if(!f.isSwitching){Fai.top.Fai.removeBg("popupZone")}this.module.remove();Fai.top.$("#popupLevel").removeClass("popupLevelShow");Fai.top.$("body").removeClass("popupZoneShow_gBody");b.pZone=null;$(window).off("resize.pz");delete b.id;delete f.isSwitching;return true};b.PopupZone.prototype.show=function(){var f=this;if(Fai.top.$("#popupBgpopupZone").length<1){Fai.top.Fai.bg("popupZone",null,null,"popupZoneDelOnlyById")}if(Fai.top.$("link[href='"+Fai.top._floatBtnCssLink+"']").length==0){Fai.top.$('<link type="text/css" href="'+Fai.top._floatBtnCssLink+'" rel="stylesheet">').appendTo(top.$("head"))}Fai.top.$("#popupLevel").appendTo(Fai.top.$("body"));Fai.top.$("#popupLevelForms").append(this.module);b.delay(function(){f.module.addClass("popupZoneScale");f.inModuleInit()});this.module.find(".popupZoneAreaClose").off("click.pz").on("click.pz",function(g){a.logDog(200302,1);f.hide();g.stopPropagation()});$("#popupLevelForms").off("mousewheel.pz").on("mousewheel.pz",function(g){g.stopPropagation()});if(Fai.top._manageMode){f.manageShow()}f.calScroll();$(window).off("resize.pz").on("resize.pz",function(){if(Fai.top._manageMode&&f.editing){f.calEditOperateArea()}f.calScroll()});delete f.enterStatus};b.PopupZone.prototype.inModuleInit=function(){if(Fai.top._manageMode){return}var h=this,g=h.module,f=this.extDomModules;g.find(".form").each(function(){var k=$(this).attr("id"),i=parseInt($(this).attr("_modulestyle")),j=true;if($.inArray(i,f)>-1){j=false}a.cacheModuleFunc.run(k,j)})};b.PopupZone.prototype.hide=function(){this.destroy()};b.PopupZone.prototype.ajaxDomShow=function(){var g=this,h=g.id;e(h,function(r){var l,o=$.parseJSON(r),k=o.rtInfo&&$.parseJSON(o.rtInfo),m=k&&k.moduleDomList&&k.moduleDomList[0]&&k.moduleDomList[0].dom,n=k&&k.moduleDomList&&k.moduleDomList[0]&&k.moduleDomList[0].inModuleList;if(!m){Fai.ing("弹窗链接不见了!");Fai.top.Fai.removeBg("popupZone");return}var q=Fai.top.$(f(m)),p=q.filter("script").first(),j=q.filter("#module"+h).first();p.appendTo(Fai.top.$("body"));for(l=0;l<n.length;l++){if(n[l].i&&!n[l].s){j.find("#module"+n[l].i).hide()}}g.module=j;g.show();b.delay(function(){q.filter("script").last().appendTo(Fai.top.$("body"))})});function f(j){var i=j.replace(/(.*?<script[\s\S]*?)document\.write([\s\S]*?<\/script>.*?)/gi,"$1void$2");return i}};b.PopupZone.prototype.calScroll=function(){var l=this,g=l.id,h=l.module,m=h.height(),p=h.width(),j=Fai.top.$("#popupLevelWrap"),n=j.height(),o=j.width(),i=Fai.top.$("#popupLevelForms"),k=Fai.getBrowserHeight(),f;if(l.editing){i.css({height:n-115})}else{i.css({height:m>n?(m+40):"100%"})}if(l.editing){h.css("left",m>i.height()?parseInt(Fai.getScrollWidth()/2):"")}else{h.css("left",m>j.height()?parseInt(Fai.getScrollWidth()/2):"")}f=i.height();h.css("marginTop",f<m?0:(f-m)/2);i.css("width",p>o?(p+40):"");if(!Fai.top._manageMode){if(m>k){Fai.top.$("body").addClass("popupZoneShow_gBody")}else{Fai.top.$("body").removeClass("popupZoneShow_gBody")}}};var c=false;function e(g,f){if(c){return}c=true;$.ajax({type:"post",url:"ajax/module_h.jsp",data:"cmd=getPopupZoneModule&_fresh=false&_colId="+Fai.top._colId+"&_extId="+Fai.top._extId+"&popupZoneId="+g+"&manageMode="+Fai.top._manageMode+"&_majorColor="+Fai.top._majorColorData,error:function(){Fai.ing("系统异常,请稍后重试",true)},success:function(h){f&&f(h);c=false}})}a.hasPopupModuleOpen=function(){return b.pZone};b.delay=function(g,f){setTimeout(g,f||0)}})(Site,Fai.top._popupZone||(Fai.top._popupZone={}));(function(f,b,c){var d=!!window.localStorage;var e={bit:{},tens:{},array:{}};b.setBitMemory=function(h,m){var l=e.bit[h];if(typeof l!="number"){throw new Error("参数错误!!未配置dic字典");return}var j=parseInt(l/31),k=l%31,i=g("JBM"+j);if(i==null){i=0}else{i=parseInt(i)}if(Boolean(m)){i|=(1<<k)}else{i&=~(1<<k)}a("JBM"+j,i)};b.getBitMemory=function(h){var l=e.bit[h];if(typeof l!="number"){throw new Error("参数错误!!");return}var j=parseInt(l/31),k=l%31,i=g("JBM"+j);if(i==null){return c}else{i=parseInt(i)}return((i&(1<<k))!=0)?true:false};b.setTensMemory=function(k,o){var h=e.tens[k];if(typeof h!="number"||o>9||o<0){throw new Error("参数错误!!");return}var n=parseInt(h),m=g("JTM")||"",l=0;if(m==""){l=n}else{l=n-m.length}for(var j=l;j>0;j--){m+="0"}m=m.split("");m[n]=o;m=m.join("");a("JTM",m)};b.getTensMemory=function(j){var i=e.tens[j];if(typeof i!="number"){throw new Error("参数错误!!");return}var l=i,k=g("JTM")||[],h;k=k.split("");h=Number(k[l]);return isNaN(h)?c:h};b.setArrayMemory=function(j,k){var l=e.array[j];if(typeof l!="number"){throw new Error("参数错误!!");return}var h=unescape(g("JAM")||""),i=h.split(",")||[];i[l]=k;h=i.join(",");a("JAM",escape(h))};b.getArrayMemory=function(j){var k=e.array[j];if(typeof k!="number"){throw new Error("参数错误!!");return}var h=unescape(g("JAM")),i=h.split(",")||[];return i[k]||c};function a(h,i){if(d){b.getTopWindow().localStorage.setItem(h,i)}else{f.cookie(h,i,{expires:1800,path:"/"})}}function g(h){if(d){return b.getTopWindow().localStorage.getItem(h)}else{return f.cookie(h,{path:"/"})}}})(jQuery,Site);$.ajaxSettings.errorCall.push(function(c,a,d){var b=Site.getTopWindow()._faiAjax;if(b){b.ajax({type:"post",url:"ajax/logAjaxErr_h.jsp?cmd=ajaxErr&error="+d+"&status="+a,data:"msg="+Fai.encodeHtml("ajaxUrl="+Fai.encodeUrl(c.url)+";refer="+Fai.encodeUrl(top.location.href))})}});Site.initPage=function(){var f=0,i=0;var d=setInterval(function(){$.each(Fai.top.$("body>iframe"),function(k,l){var j=$.trim($(l).attr("src"));var n=j;var m=j.indexOf("http://");if(m>=0){n=j.substring(m+7)}else{return}m=n.indexOf("/");if(m>0){n=n.substring(0,m)}m=n.indexOf(":");if(m>0){n=n.substring(0,m)}if(Fai.isIp(n)){$(l).remove();Site.logMsg("body be iframe. iframeSrc="+j+"; ")}});f++;if(f>=30){clearInterval(d)}},300);if(Fai.isIE6()){try{document.execCommand("BackgroundImageCache",false,true)}catch(h){}}Site.resetGmainPos();if(Fai.isIE7()||Fai.isIE6()){$(window).resize(function(){Site.resetGmainPos()})}Site.initForms();Site.refreshForms();if(!Fai.top._Global._footerHidden){$("#footer").show()}Site.initPageBindAmousedown();Site.setAbsFormsHolder2(true);Fai.top.setAbsFormsHolder2_interval=setInterval(function(){Site.setAbsFormsHolder2(true)},1000);Site.fixSiteWidth(Fai.top._manageMode);var g=$("#web").find("iframe");if(g.size()>0){for(var c=0;c<g.length-1;c++){$(g[c]).bind("load",function(){Site.fixWebFooterHeight()})}}else{Site.fixWebFooterHeight()}Site.refreshDefaultBannerEdge();if(Fai.top._manageMode&&Fai.top.toolBoxShowView&&!(Fai.top._uiMode&&Fai.top._isTemplateVersion2)){Site.showFaierTool()}if(Fai.top._uiMode){Fai.top.$("#nav .navCenter .item").eq(0).mouseover()}Site.initPagenationEvent();function a(l){var e=l.width(),k=$(window).width()-Fai.getScrollWidth(),j=(e-k)/2;return j}if(!Fai.top._manageMode){i=a($("#g_main"));$(window).scrollLeft(i)}else{i=a($("#web"));$("#g_main").scrollLeft(i)}Site.initPageWithLogDog();Site.serviceLogDog();if(!Fai.top._manageMode){var b=Fai.getUrlParam(window.location.href,"errno");if(b==14){Fai.ing(LS.memberLoginNoPermission)}}};Site.initPageWithLogDog=function(){a();Site.checkVisitEnv();if(_siteDemo&&!Fai.top._manageMode&&Site.hasXScrollBar()){Site.logDog(200190,1)}function a(){var i=200099,b=Fai.top.screen,e=(b.width+"*"+b.height),h="fkLogDog-screenResolution",d,j,c,g;var f={set:function(l,m){var k=window.localStorage;k?k.setItem(l,m):$.cookie(l,m,{expires:7,path:"/"})},get:function(l){var k=window.localStorage;return k?k.getItem(l):$.cookie(l)}};if(f.get(h)){return}c={"1920*1080":1,"1366*768":2,"1440*900":3,"1600*900":4,other:5,"1680*1050":6,"1280*800":7,"1280*1024":8,"1360*768":9,"1280*720":10,"1024*768":11,"1280*768":12,"1600*1200":13,"1600*1024":14};g={"1920*1080":15,"1366*768":16,"1440*900":17,"1600*900":18,other:19,"1680*1050":20,"1280*800":21,"1280*1024":22,"1360*768":23,"1280*720":24,"1024*768":25,"1280*768":26,"1600*1200":27,"1600*1024":28};j=Fai.top._manageMode?c:g;d=(j[e]||j.other);if(!Fai.isPC()){d=j.other}if(i&&d){f.set(h,true);Site.logDog(i,d)}}};Site.initPagenationEvent=function(){var d=$(".pagenation a");var b=$(".pagenation");var c="mouseover.bindPagenationHoverCls";var a="mouseout.bindPagenationHoverCls";if(b.parents(".formStyle6").length===0){b.off(c).on(c,"a",function(){$(this).addClass("g_hover")});b.off(a).on(a,"a",function(){$(this).removeClass("g_hover")})}var e=$(".pagenation_N").find(".pageNo a, .prevShow_model, .nextShow_model, .jumpPageDiv .bottomSearch");e.live("mouseover",function(){$(this).addClass("p_hover")});e.live("mouseout",function(){$(this).removeClass("p_hover")})};Site.showFaierTool=function(){var k=Site.getTopWindow().location.href;var a=/\?/;k+=(a.test(k)?"&":"?")+"_safeMode=true";var d=Fai.top._mainUrl+"?_safeMode=true";var g=["dear","boss","theone","cyb","max","mgz","qnt","kiki","emma"];var j=function(o,n){return parseInt(Math.random()*(n-o)+o)};var c=j(0,g.length);var h=0;while(c===0){if((h++)>1){break}c=j(0,g.length)}if(c===1){c=j(1,g.length)}if(c===2){c=j(2,g.length)}$("#_faiMenuBtn").remove();$("#fai_spinach").remove();if($("#fai_webVersionList")){$("#fai_webVersionList").remove()}var m="http://hs.aaadns.com/image/faisco_onepice/"+g[c]+".jpg";var i="<div id='_faiMenuBtn' style='width:50px;height:50px;position:absolute;bottom:100px;left:0px;background:#a90;z-index:9032;'><div style='width:50px;height:50px;background:url("+m+") center no-repeat;'><span id='_faiMenuClose' style='display:none;width:15px;height:14px;line-height:14px;text-align:center;position:absolute;top:0px;right:0px;background:url(http://0.ss.faidns.com/image/bg02.png) -1503px -123px no-repeat;cursor:pointer;color:#fff;'></div></div></div>";var f="<div id='fai_spinach' style='padding:5px 0px 5px 5px;line-height:20px;position:absolute;bottom:100px;left:50px;background:#ff8400;z-index:9032;display:none;border:1px solid #000'><table>";if(Fai.top.toolBoxShowView){f=f+"<tr><td><a href='"+k+"' style='color:#fff;font-size:12px;'>安全模式</a></td></tr><tr><td><a href='"+d+"' style='color:#fff;font-size:12px;' target='_blank'>主域名安全模式</a></td></tr><tr><td><a href='javascript:;' style='color:#fff;font-size:12px;' onclick='Site.checkManageEnv();return false;'>检测横向滚动条</a></td></tr><tr><td><a href='javascript:;' style='color:#fff;font-size:12px;' onclick='Site.getCloneAid();return false;'>自动克隆当前网站</a></td></tr><tr id='J_cloneWebVersion'><td><a href='javascript:;' style='color:#fff;font-size:12px;' onclick='Site.cloneWebVersion()'>克隆企业网站</a></td></tr><tr id='J_changeABVersion'><td><a href='javascript:;' style='color:#fff;font-size:12px;' onclick='Site.changeABVersion()'>切换到"+(Site.isBUser()?"A":"B")+"类网站</a></td></tr><tr id='J_delAuthorizer'><td><a href='javascript:;' style='color:#fff;font-size:12px;' onclick='Site.delAuthorizer()'>解除公众号授权</a></td></tr>"}if(Fai.top.toolBoxShowSet){f=f+"<tr id='J_changeTrialMallTime'><td><a href='javascript:;' style='color:#fff;font-size:12px;padding-right:5px;'>设置商城试用时间</a></td></tr><tr id='J_changeWebVersion'><td><a href='javascript:;' style='color:#fff;font-size:12px;'>切换网站版本</a></td></tr>"}if(Fai.top._debug||Fai.top._isPre){f=f+"<tr id='J_cloneWebVersion'><td><a href='javascript:;' style='color:#fff;font-size:12px;' onclick='Site.updateVersionTwoStyle()'>更新样式2.0版本号</a></td></tr>"}f=f+"</table></div>";$("body").append(i).append(f);var b="<div id='fai_trialEndTime' style='padding:5px;line-height:20px;position:absolute;bottom:100px;left:160px;background:#ff8400;z-index:9032;display:none;border:1px solid #000;'>";b+="<table>";b+="<tr><td><a href='javascript:;' style='color:#fff;font-size:12px;' onclick='Site.setMallTrialTime(0)'>已过期</a></td></tr>";b+="<tr><td><a href='javascript:;' style='color:#fff;font-size:12px;' onclick='Site.setMallTrialTime(1)'>未过期</a></td></tr>";b+="<tr><td><a href='javascript:;' style='color:#fff;font-size:12px;' onclick='Site.setMallTrialTime(2)'>自定义时间</a></td></tr>";b+="</table>";b+="</div>";$("body").append(b);$("#J_changeTrialMallTime").mouseenter(function(){$("#fai_trialEndTime").show()}).mouseleave(function(){$("#fai_trialEndTime").hide()});$("#fai_trialEndTime").mouseenter(function(){$("#fai_trialEndTime").show();$("#fai_spinach").show()}).mouseleave(function(){$("#fai_trialEndTime").hide();$("#_faiMenuClose").hide()});if(Fai.top.toolBoxShowView){if(!Fai.top._oem){var l=["<div id='fai_webVersionList' style='padding:5px;line-height:20px;position:absolute;bottom:100px;left:160px;background:#ff8400;z-index:9032;display:none;border:1px solid #000;'>","<table>","<tr><td><a href='javascript:;' style='color:#fff;font-size:12px;' onclick='Site.chageTheWebVersion(10)'>免费版</a></td></tr>","<tr><td><a href='javascript:;' style='color:#fff;font-size:12px;' onclick='Site.chageTheWebVersion(30)'>标准版</a></td></tr>","<tr><td><a href='javascript:;' style='color:#fff;font-size:12px;' onclick='Site.chageTheWebVersion(40)'>专业版</a></td></tr>","<tr><td><a href='javascript:;' style='color:#fff;font-size:12px;' onclick='Site.chageTheWebVersion(50)'>商城版</a></td></tr>","<tr><td><a href='javascript:;' style='color:#fff;font-size:12px;' onclick='Site.chageTheWebVersion(51)'>旗舰版</a></td></tr>","</table>","</div>"]}else{var l=["<div id='fai_webVersionList' style='padding:5px;line-height:20px;position:absolute;bottom:100px;left:160px;background:#ff8400;z-index:9032;display:none;border:1px solid #000;'>","<table>","<tr><td><a href='javascript:;' style='color:#fff;font-size:12px;' onclick='Site.chageTheWebVersion(120)'>初级版</a></td></tr>","<tr><td><a href='javascript:;' style='color:#fff;font-size:12px;' onclick='Site.chageTheWebVersion(110)'>试用版</a></td></tr>","<tr><td><a href='javascript:;' style='color:#fff;font-size:12px;' onclick='Site.chageTheWebVersion(130)'>中级版</a></td></tr>","<tr><td><a href='javascript:;' style='color:#fff;font-size:12px;' onclick='Site.chageTheWebVersion(140)'>高级版</a></td></tr>","<tr><td><a href='javascript:;' style='color:#fff;font-size:12px;' onclick='Site.chageTheWebVersion(150)'>尊贵版</a></td></tr>","<tr><td><a href='javascript:;' style='color:#fff;font-size:12px;' onclick='Site.chageTheWebVersion(160)'>至尊版</a></td></tr>","</table>","</div>"]}$("body").append(l.join(""));$("#J_changeWebVersion").mouseenter(function(){$("#fai_webVersionList").show()}).mouseleave(function(){$("#fai_webVersionList").hide()});$("#fai_webVersionList").mouseenter(function(){$("#fai_webVersionList").show();$("#fai_spinach").show()}).mouseleave(function(){$("#fai_webVersionList").hide();$("#_faiMenuClose").hide()})}var e=false;$("#_faiMenuBtn").mouseenter(function(n){$("#fai_spinach").show();$("#_faiMenuClose").show()}).mouseleave(function(n){window.setTimeout(function(){if(!e){$("#fai_spinach").hide()}},200);$("#_faiMenuClose").hide()});$("#fai_spinach").mouseenter(function(n){e=true}).mouseleave(function(n){e=false;$("#fai_spinach").hide()});$("#_faiMenuClose").click(function(n){$("#_faiMenuBtn").hide();$("#fai_spinach").hide()})};Site.colLayout45Width=function(){var a=Fai.top._colOtherStyleData.layout4Width;var e=Fai.top._colOtherStyleData.layout5Width;var b=$(".containerFormsCenterMiddle").width();var d=Math.floor(b*0.02);if(Fai.top._manageMode){$("#middleLeftForms").css("padding-right",d+"px");if((a+e+d)>b){$("#middleLeftForms").css("width",(b-(e+d))+"px")}}if(a>0&&e==0){var c=$("#middleLeftForms").css("padding-right").replace("px","");$("#middleLeftForms").css("width",a);$("#middleRightForms").css("width",b-c-a);Fai.top._colOtherStyleData.layout5Width=$("#middleRightForms").width()}};Site.initPage2=function(){Site.manageFaiscoAd();Fai.top.$(".absForms >.form").each(function(){Site.checkAbsModulePosition($(this),true)});Fai.top.$(".floatForms >.form").each(function(){Site.checkFloatModulePosition($(this));Site.checkSideModule($(this));Site.checkFlutterModule($(this))});if(Fai.top.$("#faiBgMusicPlayer").length>0){Site.callMusicPlayButton("bgplayerButton","faiBgMusicPlayer","bgplayerTime","bgplayerPause");var a=Fai.top.$("#faiBgMusicPlayer").attr("bgpause");if(a==="false"){$.cookie("bgplayerPause","false");$("#bgplayerButton").attr("bgMusicStatus","false")}if(a==="true"){$("#bgplayerButton").addClass("bgplayerButtonP");$("#bgplayerButton").attr("title",LS.playMusic);$("#bgplayerButton").attr("bgMusicStatus","true");$.cookie("bgplayerPause","true")}}if(!Fai.top._Global._footerHidden){if(Fai.top.$(".footerSupport").find(":visible").length==0){Fai.top.$(".footerSupport").hide()}}Site.setAbsFormsHolder2(true);$.each($("img"),function(c,b){if($.trim($(b).attr("data-original")).length>0){$(b).addClass("loadingPlaceholderBackground")}});if(Fai.isIE6()||Fai.isIE7()){$("img").lazyload({threshold:400,lazyRemoveclass:"loadingPlaceholderBackground",container:$("#g_main")})}else{$("img").lazyload({threshold:400,lazyRemoveclass:"loadingPlaceholderBackground"})}Site.bindGobalEvent("site_moduleTabSwitch",function(b,d){var c=$("#formTabCntId"+d).find("img");$.each(c,function(f,e){var g=$.trim($(e).attr("data-original"));if(g.length>0){$(e).attr("src",g).removeClass("loadingPlaceholderBackground")}})});Site.bindGobalEvent("site_BannerV2Switch",function(b){var c=$("#bannerV2").find(".fk-inBannerListZone img");$.each(c,function(e,d){var f=$.trim($(d).attr("data-original"));if(f.length>0){$(d).attr("src",f).removeClass("loadingPlaceholderBackground")}})});$(".g_ibutton").livequery(function(){$(this).faiButton()})};Site.initModuleItemHover=function(a){$(a).mouseover(function(){$(this).addClass("g_hover")}).mouseleave(function(){$(this).removeClass("g_hover")})};Site.initModuleItemCover=function(a,c,d){$(a).mouseover(function(){$(this).addClass("g_hover")}).mouseleave(function(){$(this).removeClass("g_hover")});var b=a.replace("#module","");Site.initContentSplitLine(b,d)};Site.initBackToTopTool=function(k,j,f,h,a){var d='<div id="BackToTopborder" style="display:none;"><div id="BackToTopborder-left" style="position:fixed;border-left:1px dashed #2b73ba;z-index:9030;"></div><div id="BackToTopborder-top" style="position:fixed;border-top:1px dashed #2b73ba;z-index:9030;"></div><div id="BackToTopborder-bottom" style="position:fixed;border-bottom:1px dashed #2b73ba;z-index:9030;"></div><div id="BackToTopborder-right" style="position:fixed;border-right:1px dashed #2b73ba;z-index:9030;"></div></div>';var g='<div id="borderLayer" class=" fk-editLayer-v2 fk-editLayer-v2-forBackToTop " style=" position:absolute;display:none; "><div class="item f-button-text"><a class="tool backToTopEdit" href="javascript:;" style="cursor:pointer;" >编辑</a></div><div class="itemHr"></div><div class="item f-button-icon f-hide-btn" data-title-tip="隐藏"><a class="tool backToTopClose" style="cursor:pointer;" title="您可以在网站设计-网站设置-高级设置中重新开启" title="设置样式">隐藏</a></div></div>';var l="";if(a=="small_box"||a=="null"){a="";l=$('<div id="siteBackToTop_small_box" class="fk_siteBackToTop" title="'+h+'" _style="'+a+'"></div>');Fai.top.Fai.setCtrlStyleCssList("stylebacktotop","",[{cls:".fk_siteBackToTop",key:"display",value:"none"},{cls:".fk_siteBackToTop",key:"width",value:"41px"},{cls:".fk_siteBackToTop",key:"height",value:"38px"},{cls:".fk_siteBackToTop",key:"cursor",value:"pointer"},{cls:".fk_siteBackToTop",key:"position",value:"fixed"},{cls:".fk_siteBackToTop",key:"z-index",value:"9030"},{cls:".fk_siteBackToTop",key:"right",value:"40px"},{cls:".fk_siteBackToTop",key:"bottom",value:"50px"},{cls:".fk_siteBackToTop",key:"background",value:"url("+_resRoot+"/image/site/backtotop.png?v=201411241810) no-repeat"}])}else{l=$('<div id="siteBackToTop_small_box" class="fk_siteBackToTop" title="'+h+'" _style="'+a+'"></div>');Fai.top.Fai.setCtrlStyleCssList("stylebacktotop","",[{cls:".fk_siteBackToTop",key:"display",value:"none"},{cls:".fk_siteBackToTop",key:"cursor",value:"pointer"},{cls:".fk_siteBackToTop",key:"position",value:"fixed"},{cls:".fk_siteBackToTop",key:"z-index",value:"9030"},{cls:".fk_siteBackToTop",key:"right",value:"40px"},{cls:".fk_siteBackToTop",key:"bottom",value:"50px"}]);getBackToTopStyleCss(a,false)}$("#g_main").before(l);if(j){$("#g_main").before(d);$("#g_main").before(g)}$(".backToTopEdit").bind("click",function(){Site.popupWindow({title:"编辑返回顶部图标",frameSrcUrl:"manage/backToTopEdit.jsp?ram="+Math.random(),width:"543",height:"543",version:2,frameScrolling:"no",saveBeforePopup:false,closeFunc:Site.closeCss})});$(".backToTopClose").bind("click",function(){e.hide();$("#BackToTopborder").hide();$("#borderLayer").hide();Fai.top._advanceSettingData.backToTopOpen=false;Fai.top._Global._backToTop=false;Site.styleChanged();Site.styleSetting("open","webSettingTab",false,"advanceFuncShow");Fai.ing("您可以在网站设计-网站设置-高级设置中重新开启。",true);c.scrollTop(0)});if(j&&Site.simpleTip){Site.simpleTip($("#borderLayer .f-hide-btn"),0)}function b(){var n=$("#siteBackToTop_small_box").offset().left,m=$("#siteBackToTop_small_box").offset().top;$("#BackToTopborder-left").css({left:(n-2)+"px",top:(m-2)+"px",height:$("#siteBackToTop_small_box").height()+2+"px"});$("#BackToTopborder-top").css({left:(n-2)+"px",top:(m-2)+"px",width:$("#siteBackToTop_small_box").width()+2+"px"});$("#BackToTopborder-bottom").css({left:(n-2)+"px",top:(m+$("#siteBackToTop_small_box").height()+1)+"px",width:$("#siteBackToTop_small_box").width()+2+"px"});$("#BackToTopborder-right").css({left:(n+$("#siteBackToTop_small_box").width()+1)+"px",top:(m-2)+"px",height:$("#siteBackToTop_small_box").height()+2+"px"});$("#borderLayer").css({left:($("#siteBackToTop_small_box").offset().left+$("#siteBackToTop_small_box").width()-$("#borderLayer").outerWidth())+"px",top:(m-$("#borderLayer").outerHeight()-6)+"px"})}var e=$("#siteBackToTop_small_box");var c=Fai.top.$("#g_main");if(!k&&!Fai.isIE6()){c=$(window);e.css("right",40+"px");e.css("bottom",50+"px")}if(Fai.top._manageMode){e.css("right",40+Fai.getScrollWidth()+"px");e.css("bottom",50+"px")}if(!k&&Fai.isIE6()){e.css("bottom",50+"px")}i();c.scroll(function(){i()});e.click(function(){c.scrollTop(0)});function i(){if(!Fai.top._Global._backToTop){e.hide();return}if(c.scrollTop()>0){if(e.css("display")=="none"){if(Fai.isIE6()){e.css("position","absolute")}if(Fai.isIE8()&&Fai.top._manageMode){e.show()}else{e.slideDown("slow")}}}else{if(Fai.isIE8()&&Fai.top._manageMode){e.hide()}else{e.slideUp("slow")}}}$("#siteBackToTop_small_box").hover(function(){var n=$(this),m=n.attr("_style");n.animate({opacity:0.2},"slow",function(){$("#siteBackToTop_small_box").css("height","")});if(m!=""&&m!="small_box"){getBackToTopStyleCss(m,true)}b();$("#BackToTopborder").show();$("#borderLayer").show();n.attr("_realmousein","1")},function(){var n=$(this),m=n.attr("_style");n.animate({opacity:1},"slow",function(){$("#siteBackToTop_small_box").css("height","")});if(m!=""&&m!="small_box"){getBackToTopStyleCss(m,false)}return setTimeout(function(){n.attr("_realmousein","0");if(n.attr("_mousein")==1){$("#BackToTopborder").show();$("#borderLayer").show()}else{$("#BackToTopborder").hide();$("#borderLayer").hide()}},50)});$("#borderLayer").hover(function(){$("#BackToTopborder").show();$("#borderLayer").show();$("#siteBackToTop_small_box").attr("_mousein","1")},function(){return setTimeout(function(){$("#siteBackToTop_small_box").attr("_mousein","0");if($("#siteBackToTop_small_box").attr("_realmousein")==1){$("#BackToTopborder").show();$("#borderLayer").show()}else{$("#BackToTopborder").hide();$("#borderLayer").hide()}},50)})};function getBackToTopStyleCss(a,e){var g=a.split("_"),c=g[0],b=g[1],d=[],f="";if(e){f="_hover"}if(a!="small_box"){switch(c){case"firstStyle":d.push({cls:".fk_siteBackToTop",key:"position",value:"fixed"});d.push({cls:".fk_siteBackToTop",key:"width",value:"42px"});d.push({cls:".fk_siteBackToTop",key:"height",value:"42px"});d.push({cls:".fk_siteBackToTop",key:"margin",value:"5px"});if(e){d.push({cls:".fk_siteBackToTop:hover",key:"background-image",value:"url("+_resRoot+"/image/backToTop/firstStyle/"+b+f+".png?v=201505251717)"})}else{d.push({cls:".fk_siteBackToTop",key:"background-image",value:"url("+_resRoot+"/image/backToTop/firstStyle/"+b+f+".png?v=201505251717)"})}break;case"secondStyle":d.push({cls:".fk_siteBackToTop",key:"position",value:"fixed"});d.push({cls:".fk_siteBackToTop",key:"width",value:"50px"});d.push({cls:".fk_siteBackToTop",key:"height",value:"50px"});d.push({cls:".fk_siteBackToTop",key:"margin",value:"1px"});if(b=="01"||b=="05"){if(e){d.push({cls:".fk_siteBackToTop:hover",key:"background-image",value:"url("+_resRoot+"/image/backToTop/secondStyle/"+b+f+".png?v=201505261406)"})}else{d.push({cls:".fk_siteBackToTop",key:"background-image",value:"url("+_resRoot+"/image/backToTop/secondStyle/"+b+".png?v=201505251717)"})}}else{if(e){d.push({cls:".fk_siteBackToTop:hover",key:"background-image",value:"url("+_resRoot+"/image/backToTop/secondStyle/"+b+f+".png?201505251717)"})}else{d.push({cls:".fk_siteBackToTop",key:"background-image",value:"url("+_resRoot+"/image/backToTop/secondStyle/"+b+".png?v=201505251717)"})}}break;case"special":d.push({cls:".fk_siteBackToTop",key:"position",value:"fixed"});if(e){d.push({cls:".fk_siteBackToTop:hover",key:"background-image",value:"url("+_resRoot+"/image/backToTop/"+b+f+".png?v=201505251717)"})}else{d.push({cls:".fk_siteBackToTop",key:"background-image",value:"url("+_resRoot+"/image/backToTop/"+b+".png?v=201505251717)"})}break}if(c=="special"){switch(b){case"01":d.push({cls:".fk_siteBackToTop",key:"width",value:"32px"});d.push({cls:".fk_siteBackToTop",key:"height",value:"32px"});d.push({cls:".fk_siteBackToTop",key:"margin",value:"10px 10px"});break;case"02":d.push({cls:".fk_siteBackToTop",key:"width",value:"26px"});d.push({cls:".fk_siteBackToTop",key:"height",value:"48px"});d.push({cls:".fk_siteBackToTop",key:"margin",value:"2px 13px"});break;case"03":d.push({cls:".fk_siteBackToTop",key:"width",value:"42px"});d.push({cls:".fk_siteBackToTop",key:"height",value:"42px"});d.push({cls:".fk_siteBackToTop",key:"margin",value:"5px"});break;case"04":d.push({cls:".fk_siteBackToTop",key:"width",value:"45px"});d.push({cls:".fk_siteBackToTop",key:"height",value:"50px"});d.push({cls:".fk_siteBackToTop",key:"margin",value:"1px 3px"});break}}}else{Fai.top.Fai.setCtrlStyleCssList("stylebacktotop","",[{cls:".fk_siteBackToTop",key:"display",value:"none"},{cls:".fk_siteBackToTop",key:"width",value:"41px"},{cls:".fk_siteBackToTop",key:"height",value:"38px"},{cls:".fk_siteBackToTop",key:"cursor",value:"pointer"},{cls:".fk_siteBackToTop",key:"position",value:"fixed"},{cls:".fk_siteBackToTop",key:"z-index",value:"9030"},{cls:".fk_siteBackToTop",key:"right",value:"40px"},{cls:".fk_siteBackToTop",key:"bottom",value:"50px"},{cls:".fk_siteBackToTop",key:"background",value:"url("+_resRoot+"/image/site/backtotop.png?v=201411241810) no-repeat"},]);if(e){Fai.top.Fai.removeCtrlStyleCssList("stylebacktotop","",[{cls:".fk_siteBackToTop:hover",key:"background"},])}}if(!!d.length){Fai.top.Fai.setCtrlStyleCssList("stylebacktotop","",d)}}Site.closeCss=function(){if(Fai.top._advanceSettingData.btts=="small_box"){Fai.top.$("#siteBackToTop_small_box").attr("style","display:block");Fai.top.Fai.removeCtrlStyleCssList("stylebacktotop","",[{cls:".fk_siteBackToTop:hover",key:"background"},])}else{Fai.top.Fai.setCtrlStyleCssList("stylebacktotop","",[{cls:".fk_siteBackToTop",key:"cursor",value:"pointer"},{cls:".fk_siteBackToTop",key:"position",value:"fixed"},{cls:".fk_siteBackToTop",key:"z-index",value:"9030"},{cls:".fk_siteBackToTop",key:"right",value:"40px"},{cls:".fk_siteBackToTop",key:"bottom",value:"50px"},])}Fai.top.$("#siteBackToTop_small_box").attr("_style",Fai.top._advanceSettingData.btts);getBackToTopStyleCss(Fai.top._advanceSettingData.btts,false)};Site.fixSiteWidth=function(c){b(c);var a;Fai.top.$(window).off("resize.fixSiteWidth");Fai.top.$(window).on("resize.fixSiteWidth",function(){if(typeof a=="number"){return}a=setTimeout(function(){b(c);Site.fixWebFooterHeight();Site.refreshDefaultBannerEdge();Site.fixAllMallPosition();a=null},300)});function b(f){var s=Fai.top.$("#webContainer").outerWidth(true),o=s,q=s,n=document.documentElement?document.documentElement.clientWidth:document.body.clientWidth,j=document.documentElement?document.documentElement.scrollWidth:document.body.scrollWidth,k=Fai.top.$("#web"),m=Fai.top.$("#g_main"),l=0,i=960,h=(f||(Fai.isIE6()||Fai.isIE7()))?m.scrollLeft():$(document).scrollLeft(),e=k[0].getBoundingClientRect().right+h,r=0,p,g;if(f||Fai.isIE6()){n=n-Fai.getScrollWidth()}Fai.top.$(".fullmeasureForms").find(".fullmeasureContent").each(function(t,u){if($(u).is(":visible")&&o<$(u).width()){o=$(u).width()}});q=o;n=n>q?n:q;i=n>i?n:i;p=Fai.top.$("#nav");p=p.add(k.find("div.absForms").children(".form"));p=p.add(Fai.top.$("#corpTitle"));p=p.add(Fai.top.$("#logo"));r=d(p)+h;g=(r-e)*2+e;if(g>i){i=g;l=(i-m[0].scrollWidth)+h}if(f){if(!Fai.top._cusResponsive){k.css({width:i+"px"})}if(l>0){m.scrollLeft(l)}}else{if(Fai.isIE6()||Fai.isIE7()){if(!Fai.top._cusResponsive){k.css({width:i+"px"})}if(l>0){m.scrollLeft(l)}}else{if(!Fai.top._cusResponsive){m.css({width:i+"px"})}if(l>0){$(document).scrollLeft(l)}}}}function d(h){var f=h.length,e=0,g,i;while(f){f-=1;i=h.eq(f);if(i.is(":hidden")||i.css("position")=="fixed"){continue}g=i[0].getBoundingClientRect().right;if(g>e){e=g}}return e}};Site.fixWebFooterHeight=function(){var h=Fai.top.$("#web"),a=Fai.top.$("body").height(),c=Fai.top.$("#webFooterTable"),b=c.css({height:""})&&c.height(),f=h.offset().top,d=h.height();if(Fai.top._manageMode||Fai.isIE6()){var g=0;h.children().each(function(){g+=$(this).height()});if(a>(g+f)){c.css("height",(a-g+b-f)+"px")}}else{var e=d+f;if(a>e){var i=a-e;b=c.outerHeight();c.css("height",i+b+"px")}}};Site.initPageBindAmousedown=function(){function a(f){if(Fai.isIE8()&&f.button==1){return true}else{if(Fai.isIE6()&&f.button==1){return true}else{if(Fai.isIE7()&&f.button==1){return true}else{if(f.button==0){return true}}}}return false}if(!Fai.top._designAuth){return}var d=Site.getTopWindow().$(Site.getTopWindow().document).find("#g_main");var c=Site.getTopWindow().$(Site.getTopWindow().document).find("#memberBarArea");var b=/^javascript/g;d.delegate("a","click.initSaveChange",function(f){if(!a(f)){return}var e=$(this).attr("href");if(e&&e.match(b)==null&&!$(this).hasClass("stopPropagation")){var g=$(this).attr("target")||"_self";if(!Site.redirectUrl(e,g,f,0,0)){return false}}});c.delegate("a","mousedown",function(f){if(!a(f)){return}var e=$(this).attr("href");if(e&&e.match(b)==null&&!$(this).hasClass("stopPropagation")){var g=$(this).attr("target")||"_self";Site.redirectUrl(e,g,f,0,0)}return false});Site.getTopWindow().$(Site.getTopWindow().document).find("#tabs a.cancelBtn").mousedown(function(e){if(!a(e)){return}Site.redirectUrl("javascript:;","cancelBtn",e,0,1);return false});Site.getTopWindow().$(Site.getTopWindow().document).delegate("div.navSubMenu a","mousedown",function(f){if(!a(f)){return}var e=$(this).attr("href");if(e&&e.match(b)==null&&!$(this).hasClass("stopPropagation")){var g=$(this).attr("target")||"_self";Site.redirectUrl(e,g,f,1,0)}return false})};Site.refreshFooterItemSpacing=function(){var b=Fai.top.$("#footerNav");if(b.length<1){return}var j=b.find(".footerItemSpacing");var h=b.find(".footerItemSection");if(h.length<1){return}var a=9;var f=5;if(b.attr("cusHeight")=="1"){if(Fai.top._manageMode){var e=Site.getFooterStyleData()||{};Fai.top.Fai.removeCtrlStyleCssList("stylefooter","webFooterTable",[{cls:"li.footerItemSpacing",key:"padding-top"}]);if(b.hasClass("footerPattern1")){Fai.top.Fai.setCtrlStyleCssList("stylefooter","webFooterTable",[{cls:"li.footerItemSection",key:"height",value:e.fih+"px"},{cls:"li.footerItemSpacing",key:"height",value:(e.fih-a)+"px"},{cls:"li.footerItemSpacing",key:"padding-top",value:f+"px"}])}else{Fai.top.Fai.setCtrlStyleCssList("stylefooter","webFooterTable",[{cls:"li.footerItemSection",key:"height",value:e.fih+"px"},{cls:"li.footerItemSpacing",key:"height",value:e.fih+"px"}])}}return}Fai.top.Fai.removeCtrlStyleCssList("stylefooter","webFooterTable",[{cls:"li.footerItemSpacing",key:"padding-top"}]);Fai.top.Fai.setCtrlStyleCssList("tmpStylefooter","webFooterTable",[{cls:"li.footerItemSection",key:"height",value:"auto !important"},{cls:"li.footerItemSpacing",key:"height",value:"auto !important"}]);var g=h.eq(0).height();var d=0;for(var c=1;c<h.length;c++){d=h.eq(c).height();if(d>g){g=d}}if(b.hasClass("footerPattern1")){Fai.top.Fai.setCtrlStyleCssList("stylefooter","webFooterTable",[{cls:"li.footerItemSection",key:"height",value:g+"px"},{cls:"li.footerItemSpacing",key:"height",value:(g-a)+"px"},{cls:"li.footerItemSpacing",key:"padding-top",value:f+"px"}])}else{Fai.top.Fai.setCtrlStyleCssList("stylefooter","webFooterTable",[{cls:"li.footerItemSection",key:"height",value:g+"px"},{cls:"li.footerItemSpacing",key:"height",value:g+"px"}])}Fai.top.Fai.removeCtrlStyleCssList("tmpStylefooter","webFooterTable",[{cls:"li.footerItemSection",key:"height"},{cls:"li.footerItemSpacing",key:"height"}]);Fai.top.$("#tmpStylefooter").remove()};Site.pageOnload=function(){Site.userReadyOperateSite();Site.mobiPlatform();Site.fixWebFooterHeight();if(Fai.top.$("#banner").length){Site.refreshBanner(0)}if(Fai.top.$("#bannerV2").length){Site.bannerV2.adjustBannerWidth()}Site.adjustBannerWidth();Site.addStellarEvent();Site.excuteMallBuy2();Site.checkFaiAnchor();Site.fixAllMallPosition()};Site.excuteMallBuy2=function(){var f=$.cookie("isNeedAddCartItem");if(typeof f=="undefined"||f==null||f==""){return}var e=$.parseJSON(f);var b=e.pid;var d=e.mid;var c=e.url;var a=e.doWhat;if(a=="add"){Site.mallBuy2(b,d,c)}else{if(a=="buy"){Site.mallImmeBuy(b,d)}}setTimeout(function(){$.cookie("isNeedAddCartItem",null)},1000)};Site.beforeUnloadFunc=function(){var a=Fai.top.onbeforeunload;Fai.top.onbeforeunload=function(){if(typeof a=="function"){a.apply(this,arguments)}Site.siteStatVisitTime()}};Site.bindBeforeUnloadEvent=function(b,c,a){Fai.top.$(document).ready(function(){Fai.top.$(window).bind("beforeunload",function(f){if(c){Site.bgmFlushContinue()}else{if(Fai.top.bgmCloseToOpen){Site.bgmFlushContinue()}}if(b){if(_changeStyleNum>0){return"您的网站设计正处于编辑状态,离开该页面将会失去您对网站所做的修改。"}}if(a){Site.jumpToMobiDesign(1)}});var d=Fai.top.onbeforeunload;Fai.top.onbeforeunload=function(){if(typeof d=="function"){d.apply(this,arguments)}if(b){if(_changeStyleNum>0){return"您的网站设计正处于编辑状态,离开该页面将会失去您对网站所做的修改。"}}}})};Site.closeRightClickTool=function(){$(document).bind("contextmenu copy cut",function(a){if($(a.target).is("input, textarea")){return}else{return false}});if(Fai.isIE6()||Fai.isIE7()||Fai.isIE8()){$(document).bind("selectstart",function(a){if($(a.target).is("input, textarea")){return}else{return false}})}};Site.triggerGobalEvent=function(a,b){Fai.top.$(Fai.top.document).trigger(a,b)};Site.bindGobalEvent=function(a,b){if(a=="site_articlePictureChange"&&Fai.isIE()){Fai.top.$(Fai.top.document).off(a)}Fai.top.$(Fai.top.document).on(a,b)};Site.refreshFormIndexClass=function(){Site.refreshFormIndexClass2({id:"topForms"});Site.refreshFormIndexClass2({id:"leftForms"});Site.refreshFormIndexClass2({id:"centerTopForms"});Site.refreshFormIndexClass2({id:"middleLeftForms"});Site.refreshFormIndexClass2({id:"middleRightForms"});Site.refreshFormIndexClass2({id:"centerBottomForms"});Site.refreshFormIndexClass2({id:"rightForms"});Site.refreshFormIndexClass2({id:"bottomForms"});Site.refreshFormIndexClass2({id:"fullmeasureTopForms"});Site.refreshFormIndexClass2({id:"fullmeasureBottomForms"});Site.refreshFormIndexClass2({id:"absTopForms"});Site.refreshFormIndexClass2({id:"absForms"});Site.refreshFormIndexClass2({id:"absBottomForms"});Site.refreshFormIndexClass2({id:"floatLeftTopForms"});Site.refreshFormIndexClass2({id:"floatRightTopForms"});Site.refreshFormIndexClass2({id:"floatLeftBottomForms"});Site.refreshFormIndexClass2({id:"floatRightBottomForms"});Site.refreshFormIndexClass2({id:"fk-webHeaderZone"});Site.refreshFormIndexClass2({id:"fk-webBannerZone"});Site.refreshFormIndexClass2({id:"fk-webFooterZone"});Site.refreshFormIndexClass2({_class:"fk-inBannerListZone"});Site.refreshFormIndexClassInPopupZone()};Site.refreshFormIndexClass2=function(i){var b=i.id;var e=i._class;var a=i.inFullmeasure||0;var h,d,c,g;var f;if(typeof b!="undefined"){f=Fai.top.$("#"+b).children(".form")}else{if(typeof e!="undefined"){f=Fai.top.$("."+e).children(".form")}}f.each(function(j,k){c=$(k);g=Site.checkNestModule(c);c.attr("_inmulmcol",0);c.attr("_intab",0);c.attr("_infullmeasure",0);c.attr("_inpack",0);if(g.isCol){Site.refreshFormIndexClassInCol(c)}else{if(g.isTab){Site.refreshFormIndexClassInTab(c)}else{if(g.isPack){Site.refreshFormIndexClassInPack(c)}else{if(g.isFullmeasure){Site.refreshFormIndexClassInFullmeasure(c)}}}}h=c.attr("_indexClass");d="formIndex"+(j+1);if(Fai.isNull(h)){c.addClass(d);c.attr("_indexClass",d);Fai.refreshClass(c)}else{if(h!=d){c.removeClass(h);c.addClass(d);c.attr("_indexClass",d);Fai.refreshClass(c)}}})};Site.refreshFormIndexClassInCol=function(b){var d=b.attr("id").replace("module","")||0,a,c;b.find(".mulMColList").children(".form").each(function(e,f){a=$(f);a.attr("_inmulmcol",d);a.attr("_intab",0);a.attr("_infullmeasure",0);a.attr("_inpack",0);a.removeAttr("_indexclass ");c=Site.checkNestModule(a);if(c.isTab){Site.refreshFormIndexClassInTab(a)}else{if(c.isPack){Site.refreshFormIndexClassInPack(a)}}})};Site.refreshFormIndexClassInTab=function(b){var c=b.attr("id").replace("module","")||0,a;b.find(".formTabCntId").children(".form").each(function(d,e){a=$(e);a.attr("_inmulmcol",0);a.attr("_intab",c);a.attr("_infullmeasure",0);a.attr("_inpack",0);a.removeAttr("_indexclass ");if(Site.checkNestModule(a).isPack){Site.refreshFormIndexClassInPack(a)}})};Site.refreshFormIndexClassInFullmeasure=function(c){var f=c.attr("id").replace("module","")||0,a,e,b,d;c.find(".fullmeasureContent").children(".form").each(function(g,h){b=$(h);b.attr("_inmulmcol",0);b.attr("_intab",0);b.attr("_infullmeasure",f);b.attr("_inpack",0);d=Site.checkNestModule(b);if(d.isTab){Site.refreshFormIndexClassInTab(b)}else{if(d.isCol){Site.refreshFormIndexClassInCol(b)}else{if(d.isPack){Site.refreshFormIndexClassInPack(b)}}}a=b.attr("_indexClass");e="formIndex"+(g+1);if(Fai.isNull(a)){b.addClass(e);b.attr("_indexClass",e);Fai.refreshClass(b)}else{if(a!=e){b.removeClass(a);b.addClass(e);b.attr("_indexClass",e);Fai.refreshClass(b)}}})};Site.refreshFormIndexClassInPack=function(b){var d=b.attr("id").replace("module","")||0,a,c;b.find(".J_packContent").children(".form").each(function(e,f){a=$(f);a.attr("_inmulmcol",0);a.attr("_intab",0);a.attr("_infullmeasure",0);a.attr("_inpack",d);a.removeAttr("_indexclass ");c=Site.checkNestModule(a);if(c.isTab){Site.refreshFormIndexClassInTab(a)}else{if(c.isCol){Site.refreshFormIndexClassInCol(a)}}})};Site.refreshFormIndexClassInPopupZone=function(){var b=Fai.top.$(".formStyle105");if(b.length<1){return}var d=b.attr("id").replace("module","")||0,a,c;b.find(".J_popupZoneContent").children(".form").each(function(e,f){a=$(f);a.attr("_inmulmcol",0);a.attr("_intab",0);a.attr("_infullmeasure",0);a.attr("_inpack",0);a.attr("_inpopupzone",d);a.removeAttr("_indexclass ")})};Site.checkNestModule=function(b){var j={nest:false,isTab:false,isCol:false,isFullmeasure:false,isPack:false,isElemZone:false,isPopupZone:false,parentId:0,inTab:false,inCol:false,inFullmeasure:false,inPack:false,inZone:false,inSubNav:false,inElemZone:false,inPopupZone:false},e=parseInt(b.attr("_intab"))||0,f=parseInt(b.attr("_inmulmcol"))||0,a=parseInt(b.attr("_infullmeasure"))||0,i=parseInt(b.attr("_inpack"))||0,h=Site.checkModuleInZone(b),g=Site.checkModuleInSubNav(b),d=Site.checkModuleInElemZone(b),c=parseInt(b.attr("_inpopupzone"))||0;if(b.hasClass("formStyle35")){j.nest=true;j.isCol=true}else{if(b.hasClass("formStyle29")){j.nest=true;j.isTab=true}else{if(b.hasClass("formStyle80")){j.nest=true;j.isFullmeasure=true}else{if(b.hasClass("formStyle87")){j.nest=true;j.isPack=true}else{if(b.hasClass("formStyle105")){j.nest=true;j.isPopupZone=true}}}}}if(b.hasClass("elemZone")){j.isElemZone=true}if(e>0){j.parentId=e;j.inTab=true}else{if(f>0){j.parentId=f;j.inCol=true}else{if(a>0){j.parentId=a;j.inFullmeasure=true}else{if(i>0){j.parentId=i;j.inPack=true}else{if(h){j.parentId=b.parent().attr("id");j.inZone=true}else{if(g){j.parentId=b.parent().attr("id");j.inSubNav=true}else{if(c){j.parentId=b.parent().attr("id");j.inPopupZone=true}}}}}}}if(d){j.inElemZone=true;j.realParentId=b.parent().attr("id")}return j};Site.createMemberBar=function(e,c,g,d,a){if(Fai.top.$("#memberBarArea").length>0){return}var b=[];b.push("<div id='memberBarArea' class='memberBarArea g_editPanel' >");b.push("<div id='memberBar' class='memberBar'>");b.push(" <div class='right'>");b.push(" <div style='float:right;'>");if(e||c||g){if(g){b.push(" <a href='javascript:;' class='l_Btn' id='t_wxLgn'>");b.push(" <span class='l_Ico wxLgn'></span>");b.push(" </a>")}if(c){b.push(" <a href='javascript:;' class='l_Btn' id='t_wbLgn'>");b.push(" <span class='l_Ico wbLgn'></span>");b.push(" </a>")}if(e){b.push(" <a href='javascript:;' class='l_Btn' id='t_qqLgn'>");b.push(" <span class='l_Ico qqLgn'></span>");b.push(" </a>")}b.push(" <span style='float: right;'>"+LS.otherAccountLogin+":</span>")}b.push(" <a class='memberOption memberReg' href='/signup.jsp' style='margin-right:10px;'>"+LS.memberReg+"</a>");b.push(" <a class='memberOption memberLogin' href='/login.jsp' >"+LS.memberLogin+"</a>");b.push(" </div>");b.push(" </div>");b.push(' <div class="left">');if(!d){Fai.top._memberTopBar_myOrder=false}if(Fai.top._memberTopBar_addBookMark){b.push(' <div style="float:left;margin-left: 8px;">');b.push(' <a id="topBarMember_addBookMark" hidefocus="true" href="javascript:;"" style="text-decoration:none;display:;" onclick="">'+LS.favorite+"</a>");b.push(" </div>")}else{b.push(' <div style="float:left;margin-left: 8px;">');b.push(' <a id="topBarMember_addBookMark" hidefocus="true" href="javascript:;"" style="text-decoration:none;display:none;" onclick="">'+LS.favorite+"</a>");b.push(" </div> ")}if(Fai.top._memberTopBar_addBookMark&&(Fai.top._memberTopBar_myOrder||Fai.top._memberTopBar_myProfile)){b.push(' <div id="line1" class="line" style="float:left;display:;"></div>')}else{b.push(' <div id="line1" class="line" style="float:left;display:none;"></div>')}if(Fai.top._memberTopBar_myProfile){b.push(' <div style="float:left;">');b.push(' <a id="topBarMember_myProfile" hidefocus="true" style="text-decoration:none;display:;" href="mCenter.jsp">'+LS.member_center_profile+"</a>");b.push(" </div> ")}else{b.push(' <div style="float:left;">');b.push(' <a id="topBarMember_myProfile" hidefocus="true" style="text-decoration:none;display:none;" href="mCenter.jsp">'+LS.member_center_profile+"</a>");b.push(" </div>")}if(Fai.top._memberTopBar_myProfile&&Fai.top._memberTopBar_myOrder){b.push(' <div id="line2" class="line" style="float:left;display:;"></div>')}else{b.push(' <div id="line2" class="line" style="float:left;display:none;"></div>')}if(Fai.top._memberTopBar_myOrder){b.push(' <div style="float:left;">');b.push(' <a id="topBarMember_myOrder" hidefocus="true" style="text-decoration:none;display:;" href="mCenter.jsp?item=memberOrder">'+LS.member_center_order+"</a>");b.push(" </div>")}else{b.push(' <div style="float:left;">');b.push(' <a id="topBarMember_myOrder" hidefocus="true" style="text-decoration:none;display:none;" href="mCenter.jsp?item=memberOrder">'+LS.member_center_order+"</a>");b.push(" </div>")}if(d){var f="";if(Fai.top._memberTopBar_mallCart){f="display:none;"}if(Fai.top._memberTopBar_addBookMark||Fai.top._memberTopBar_myOrder||Fai.top._memberTopBar_myProfile){b.push(' <div id="mallCartLine" class="line" style="'+f+'margin-right: 0px;"></div>')}else{b.push(' <div id="mallCartLine" class="line" style="display:none;margin-right: 0px;"></div>')}b.push(' <div style="float:left; margin-left: 15px;">');b.push(' <div id="mallCart_js" class="mallCart" style="'+f+'">');b.push(' <div class="mallCartItem">');b.push(' <span class="mallCart_icon">&nbsp;</span>');b.push(' <span class="mallCart_name">'+LS.memberMallCart+"</span>");b.push(' <span class="mallCart_proNum">(0)</span>');b.push(' <span class="mallCart_down">&nbsp;</span>');b.push(" </div>");b.push(" </div>");b.push(' <div class="mallCartPanel">');b.push(' <div id="mallCartList_js" class="mallCartList">');b.push(' <div class="mcProductList">'+LS.memberMallCartNoProduct+"</div>");b.push(' <div class="checkMallCartBtn" <%=(isRU || isLo) ? "style=\'width: 178px;\'" : "" %> >'+LS.memberMallCartCheckBtn+"</div>");b.push(" </div>");b.push(" </div>");b.push(" </div>")}if(Fai.top._memberTopBar_mobiWeb&&Fai.top.openMSite){if(Fai.top._memberTopBar_myOrder||Fai.top._memberTopBar_myProfile||d){b.push(' <div id="mobiWeb_line" class="line" style="margin-right: 0px; display:;"></div>')}b.push(' <div style="float:left; margin-left: 15px;">');b.push(' <div id="mobiWeb_js" class="mobiWeb">');b.push(' <div class="mobiWebItem">');b.push(' <span class="mobiWeb_icon">&nbsp;</span>');b.push(' <span class="mobi_down">&nbsp;</span>');b.push(" </div>");b.push(" </div>");b.push(' <div class="mobiWebPanel">');b.push(' <div id="mobiWebQRCode_js" class="mobiWebQRCode">');b.push(' <div style="text-align:center;padding-top:10px;"><img src="/qrCode.jsp?cmd=mobiQR&_s=80&lanCode==lanCode"></div>');b.push(' <div style="text-align:center;padding-top:2px;font-size:12px;color:#555555;">'+LS.showMobiWeb+"</div>");b.push(" </div>");b.push(" </div>");b.push(" </div>")}else{if(Fai.top._memberTopBar_myOrder||Fai.top._memberTopBar_myProfile||d){b.push(' <div id="mobiWeb_line" class="line" style="margin-right: 0px; display:none;"></div>')}b.push(' <div style="float:left; margin-left: 15px;">');b.push(' <div id="mobiWeb_js" class="mobiWeb" style="display:none;">');b.push(' <div class="mobiWebItem">');b.push(' <span class="mobiWeb_icon">&nbsp;</span>');b.push(' <span class="mobi_down">&nbsp;</span>');b.push(" </div>");b.push(" </div>");b.push(' <div class="mobiWebPanel" style="display:none;">');b.push(' <div id="mobiWebQRCode_js" class="mobiWebQRCode">');b.push(' <div style="text-align:center;padding-top:10px;"><img src="/qrCode.jsp?cmd=mobiQR&_s=80"></div>');b.push(' <div style="text-align:center;padding-top:2px;">'+LS.showMobiWeb+"</div>");b.push(" </div>");b.push(" </div>");b.push(" </div> ")}b.push(" </div>");b.push(" </div>");b.push("</div>");Fai.top.$("body").prepend(b.join(""));Site.resetMemberBarPos();if(Fai.top._manageMode){Site.dblclickUtils.init()}if(d){Site.mallCartInit(Fai.top._colId)}if(Fai.top._memberTopBar_mobiWeb){Site.mobiWebInit()}};Site.resetGmainPos=function(c){var e=0;e=c||Site.getTopHeight();var b=Fai.top.$("#g_main");if(Fai.isIE6()||Fai.isIE7()){var a=Fai.top.document.documentElement.clientHeight-e;if(b.height()!=a){b.css("height",a+"px")}var d=Fai.top.document.documentElement.clientWidth;if(b.width()!=d){b.css("width",d+"px")}}if($("#topBar").css("display")==="block"){e=(e-6)}if($("#memberBarArea").length!==0){e=e-2}if(b.css("top")!=(e+"px")){b.css("top",e+"px")}Site.resetMemberBarPos();Fai.top.$(".floatLeftTop").css("top",e+"px");Fai.top.$(".floatRightTop").css("top",e+"px")};Site.resetMemberBarPos=function(){var b=Site.getTopHeight()-37;if($("#topBar").css("display")==="block"){b=(b-6)}var a=Fai.top.$("#memberBarArea");if(a.css("top")!=(b+"px")){a.css("top",b+"px")}};Site.getTopHeight=function(){if(Fai.top._Global._topBarV2){return a()}else{return b()}function b(){var h=0;var g=0;var c=0;var f=0;var i=0;var e=0;var d=0;if((Fai.top.$("#sitetips").length>0)&&(Fai.top.$("#sitetips").css("display")!="none")){i=Fai.top.$("#sitetips").outerHeight(true)}if((Fai.top.$("#arrears").length>0)&&(Fai.top.$("#arrears").css("display")!="none")){g=Fai.top.$("#arrears").outerHeight(true)}if((Fai.top.$("#topBar").length>0)&&(Fai.top.$("#topBar").css("display")!="none")){c=Fai.top.$("#topBarArea").outerHeight(true)}if((Fai.top.$("#styleDesign").length>0)&&(Fai.top.$("#styleDesign").css("display")!="none")){f=Fai.top.$("#styleDesign").outerHeight(true)}if((Fai.top.$("#siteTipsDemoTemplate").length>0)&&(Fai.top.$("#siteTipsDemoTemplate").css("display")!="none")){e=Fai.top.$("#siteTipsDemoTemplate").outerHeight(true)}if((Fai.top.$("#memberBarArea").length>0)&&(Fai.top.$("#memberBarArea").css("display")!="none")){d=Fai.top.$("#memberBarArea").outerHeight(true)}if(f>0){i=0}h=g+c+f+i+e+d;return h}function a(){var h=0,c=Fai.top.$("#sitetips"),f=Fai.top.$("#arrears"),e=Fai.top.$("#fk-toolTopBar"),d=Fai.top.$("#siteTipsDemoTemplate"),g=Fai.top.$("#memberBarArea");if(c.length>0&&c.is(":visible")){h+=c.outerHeight(true)}if(f.length>0&&f.is(":visible")){h+=f.outerHeight(true)}if(e.length>0&&e.is(":visible")){h+=e.outerHeight(true)}if(d.length>0&&d.is(":visible")){d+=d.outerHeight(true)}if(g.length>0&&g.is(":visible")){h+=g.outerHeight(true)}return h<0?0:h}};Site.scrollToDiv=function(a){if(Fai.top.$("#g_main").hasClass("g_mainManage")){Fai.top.$("#g_main").scrollTop(0);Fai.top.$("#g_main").scrollTop(a.offset().top-Fai.top.$(".g_main").offset().top-10)}else{Fai.top.$("body").scrollTop(0);Fai.top.$("body").scrollTop(a.offset().top-10)}};Site.checkSaveBar=function(a){if(Fai.top._changeStyleNum>0){Site.popupStyleChangeBodyWindow({msg:"您的网站设计已经更改,是否立即保存?",isCancelBtn:false,runCallback:false,saveBtnStr:"确定",cancelBtnStr:"取消",otherOptions:a});return true}return false};Site.logClick=function(c,b){return;var a="cmd=click&app="+c;if(typeof b!="undefined"){a+="&value="+b}$.ajax({type:"post",url:Site.genAjaxUrl("log_h.jsp"),data:a,error:function(){},success:function(){}})};Site.popupLogin=function(a,c){try{if(!Site.getTopWindow().location.href){alert('您好,目前无法打开登录框,可能是以下原因:\n1、当前网页未完全加载,请稍后重试或刷新再试。\n2、不支持"域名转发"时登录。\n3、不支持"被其他网站嵌入"时登录。');return}}catch(b){alert('您好,目前无法打开登录框,可能是以下原因:\n1、当前网页未完全加载,请稍后重试或刷新再试。\n2、不支持"域名转发"时登录。\n3、不支持"被其他网站嵌入"时登录。');return}a=a+"/loginForm.jsp?cid="+c+"&f="+Fai.encodeUrl(window.location.href)+"&rqDomain="+Fai.encodeUrl(Fai.top.document.domain);Fai.popupWindow({title:"登录",frameSrcUrl:a+"&track=2&ram="+Math.random(),width:"380",height:"175",frameScrolling:"no"})};Site.getFooterBottom=function(a){if(!a){if(Fai.top.$(".footerSupport").css("display")!="none"){return Fai.top.$(".footerSupport").offset().top}else{return Fai.top.$("#webFooter").offset().top+Fai.top.$("#webFooter").height()}}else{return Fai.top.$("#webFooter").offset().top+Fai.top.$("#webFooter").height()}};Site.navAppendToParent=function(e,f){var a=Site.getTopWindow().$("#nav"),b,g;function d(h,i){if(Fai.top.$("#nav").data("isChangeNavWidth")!==true){return}if(h!==i){a.offset({top:h});a.removeData("isChangeNavWidth")}}if(!f){var c=Site.getTopWindow().$("#nav");if(Fai.top._useNavVersionTwo){c=Site.getTopWindow().$("#navV2Wrap")}if(Fai.top._isThemeNavFloatRight){c.appendTo(Site.getTopWindow().$("#webNav"))}else{if(e==0){Site.getTopWindow().$("#banner").appendTo(Site.getTopWindow().$("#webBanner .bannerCenter"));c.appendTo(Site.getTopWindow().$("#webBanner .bannerCenter"))}else{if(e==1){Site.getTopWindow().$("#banner").appendTo(Site.getTopWindow().$("#webBanner .bannerCenter"));c.appendTo(Site.getTopWindow().$("#webHeader .headerNav"))}else{if(e==2){Site.getTopWindow().$("#banner").appendTo(Site.getTopWindow().$("#containerMiddleLeft"));c.appendTo(Site.getTopWindow().$("#webHeader .headerNav"))}else{if(e==3||e==5){c.appendTo(Site.getTopWindow().$("#containerMiddleLeft"));Site.getTopWindow().$("#banner").appendTo(Site.getTopWindow().$("#containerMiddleLeft"))}else{if(e==4||e==6){Site.getTopWindow().$("#banner").appendTo(Site.getTopWindow().$("#containerMiddleCenterTop"));c.appendTo(Site.getTopWindow().$("#containerMiddleLeft"))}else{if(e==7){Site.getTopWindow().$("#banner").prependTo(Site.getTopWindow().$("#containerFormsCenter"));c.appendTo(Site.getTopWindow().$("#webHeader .headerNav"))}else{if(e==8){Site.getTopWindow().$("#banner").prependTo(Site.getTopWindow().$("#centerTopForms"));c.appendTo(Site.getTopWindow().$("#webHeader .headerNav"))}else{if(e==9){Site.getTopWindow().$("#banner").appendTo(Site.getTopWindow().$("#webBanner .bannerCenter"));c.appendTo(Site.getTopWindow().$("#webNav"))}else{if(e==10){c.appendTo(Site.getTopWindow().$("#webBanner .bannerCenter"));Site.getTopWindow().$("#banner").appendTo(Site.getTopWindow().$("#webBanner .bannerCenter"))}}}}}}}}}}}};Site.initTemplateLayout=function(c,d,b){var a=Fai.top.$("#webBanner");Site.navAppendToParent(c,d);if(c==0){a.show();Site.showNavSubMenu(0);setTimeout(function(){Site.showNavItemContainer()},200)}else{if(c==1){a.show();Site.showNavSubMenu(0);setTimeout(function(){Site.showNavItemContainer()},200)}else{if(c==2){a.hide();Site.showNavSubMenu(0);setTimeout(function(){Site.showNavItemContainer()},200)}else{if(c==3){a.hide();Site.showNavSubMenu(1);setTimeout(function(){Site.showNavItemContainer()},200);Site.hideNavItemContainer()}else{if(c==4){a.hide();Site.showNavSubMenu(1);setTimeout(function(){Site.showNavItemContainer()},200);Site.hideNavItemContainer()}else{if(c==5){a.hide();Site.showNavSubMenu(1);setTimeout(function(){Site.showNavItemContainer()},200);Site.hideNavItemContainer()}else{if(c==6){a.hide();Site.showNavSubMenu(100);setTimeout(function(){Site.showNavItemContainer()},200);Site.hideNavItemContainer()}else{if(c==7){a.hide();Site.showNavSubMenu(0);setTimeout(function(){Site.showNavItemContainer()},200)}else{if(c==8){a.hide();Site.showNavSubMenu(0);setTimeout(function(){Site.showNavItemContainer()},200)}else{if(c==9||c==10){a.show();Site.showNavSubMenu(0);setTimeout(function(){Site.showNavItemContainer()},200)}}}}}}}}}}if(Fai.top._manageMode){setTimeout(function(){Site.absoluteNavDraggableAndResize(c,b)},300)}};Site.checkFaiAnchor=function(){var c=window.location.hash;var b=c.substring(1).split("_");if(b[0]!="fai"){return}var d=b[1],a=b[2];if(!!d){if(typeof a=="undefined"){a="top"}Site.jumpToModulePosition(d,a)}return};Site.logout=function(a){Fai.ing("正在退出系统...",false);$.ajax({type:"post",url:"ajax/login_h.jsp?cmd=logout",error:function(){Fai.ing("系统繁忙,请稍后重试。",false)},success:function(b){Fai.successHandle(b,"","系统繁忙,请稍后重试。",a,1,1)}})};Site.manageFaiscoAd=function(){if(_manageMode){$(".siteAdvertisement_box").mouseover(function(){$(".siteAdvertisement_boxTip").css("display","block")}).mouseleave(function(){$(".siteAdvertisement_boxTip").css("display","none")})}$(".reportUrl").mouseover(function(){$(this).text("举报此网站").css("text-decoration","underline")}).mouseleave(function(){$(this).text("举报").css("text-decoration","none")});$(".closeImg").click(function(){if(_manageMode){if(Fai.isDbg()){$.cookie("faiscoAd",false,{expires:1,path:"/",domain:"aaa.cn"})}else{$.cookie("faiscoAd",false,{expires:1,path:"/",domain:"faisco.cn"})}var a=$.cookie("faiscoAdLoopCount");if(a=="1"){Site.logDog(4000067,5)}else{if(a=="2"){Site.logDog(200004,23)}else{if(a=="3"){Site.logDog(200004,24)}else{if(a=="4"){Site.logDog(200004,21)}}}}}$(".siteAdvertisement_box").css("display","none")})};Site.initMulColModuleInIE=function(a){if(Fai.isIE10()){$(a).find(".mulModuleColStyleLine").css("height",$(a).height()-25+"px")}};Site.initCorpTitleJump=function(){$("#corpTitle").click(function(){var b=$(this).attr("_href");if(b==""||b==null){return false}if($(this).find(".fkEditor").attr("contenteditable")=="true"){return false}var a=parseInt($(this).attr("_linktype"));if(Fai.top._titleData!=null&&Fai.top._titleData!=""){if(Fai.top._titleData.jm.ot===1){window.open(b)}else{Fai.top.location.href=b}}else{if(a===1){window.open(b)}else{Fai.top.location.href=b}}})};Site.onTitleSiteFixTop=function(){var f,h=false,a=false,r=Fai.isIE6(),q=Fai.isIE7(),z=Fai.top.$("#corpTitle"),u=Fai.top.$(window),n=Fai.top.$("#g_main"),d=Fai.top.$("#web"),k=Fai.top.$("body"),w=Fai.top.$(".webTopTable"),g=Fai.top.$(".floatLeftTop"),e=z.parent(),m=Fai.top.$("#sitetips"),l,v=parseInt(z.css("top").replace("px","")),s=z.offset().top-n.offset().top,j=z.position().left,p=m.height()||0,c=s,b=g.css("top").replace("px","")||0,o=Fai.top.$(window),y=o;if(r||q){a=true;y=n}var x=z.offset().left-e.offset().left;var t,i;y.off("scroll.title");y.on("scroll.title",function(){var B=y.scrollTop(),A=parseInt(g.css("top").replace("px",""))-1;b=A||0;f=Site.getNavInClientPosition(z).left;if(w.find("#corpTitle").length>0){l=w;l.css({zIndex:"60",position:"relative"})}if(!h&&c<B){if(r){t=z.parent();i=z.offset().left-t.offset().left;k.prepend(z);z.css({position:"absolute",left:f+"px",top:b+"px"})}else{z.addClass("titlefixtop");z.css({left:f+"px",top:b+"px",position:"fixed"})}h=true}if(h&&c>B){if(r){e.append(z);z.css({position:"absolute",left:j,top:s,zIndex:""})}else{z.removeClass("titlefixtop");z.css({position:"absolute",left:j,top:s})}h=false}});Fai.top.$(window).on("resize.title",function(){if(r&&z.offset().top==0){z.css("left",t.offset().left+i)}else{if(z.hasClass("titlefixtop")){setTimeout(function(){z.css("left",e.offset().left+x)},0)}}})};Site.onLogoSiteFixTop=function(){var f,j=false,a=false,s=Fai.isIE6(),q=Fai.isIE7(),g=Fai.top.$("#logo"),w=Fai.top.$(window),n=Fai.top.$("#g_main"),e=Fai.top.$("#web"),k=Fai.top.$("body"),x=Fai.top.$(".webTopTable"),i=Fai.top.$(".floatLeftTop"),h=g.parent(),m=Fai.top.$("#sitetips"),l,v=parseInt(g.css("top").replace("px","")),y=g.offset().top-n.offset().top,r=g.position().left,p=m.height()||0,d=y,c=i.css("top").replace("px","")||0,o=Fai.top.$(window),z=o;if(s||q){a=true;z=n}var u=g.offset().left-h.offset().left;var t,b;z.off("scroll.logo");z.on("scroll.logo",function(){var B=z.scrollTop(),A=parseInt(i.css("top").replace("px",""))-1;c=A||0;f=Site.getNavInClientPosition(g).left;if(x.find("#logo").length>0){l=x;l.css({zIndex:"60",position:"relative"})}if(!j&&d<B){if(s){t=g.parent();b=g.offset().left-t.offset().left;k.prepend(g);g.css({position:"absolute",left:f+"px",top:c+"px",zIndex:60})}else{g.addClass("logofixtop");g.css({left:f+"px",top:c+"px",position:"fixed"})}j=true}if(j&&d>B){if(s){h.append(g);g.css({position:"absolute",left:r,top:y,zIndex:""})}else{g.removeClass("logofixtop");g.css({position:"absolute",left:r,top:y})}j=false}});Fai.top.$(window).on("resize.logo",function(){if(s&&g.offset().top==0){g.css("left",t.offset().left+b)}else{if(g.hasClass("logofixtop")){setTimeout(function(){g.css("left",h.offset().left+u)},0)}}})};Site.voidFun=function(){};Site.codeInsertButtom=function(d){var b=/document.write/g;d=d.replace(b,"Site.voidFun");var a=document.createElement("script");a.type="text/javascript";try{a.appendChild(document.createTextNode(d))}catch(c){a.text=d}document.body.appendChild(a)};Site.computeTabsWidthHideMore=function(e){var d=Fai.top.$("#module"+e).find(".formTabButtonTopCenter");var c=parseInt(d.css("width"))+4;var b=0;var a=d.find(".formTabButton");$.each(a,function(f,h){var g=parseInt($(h).css("width"));b+=g+5});b+=40;if(b>c){d.find(".formTabButtonMore").hide()}else{d.find(".formTabButtonMore").show()}};Site.wxShareAlter=function(b,d){var e=[];e.push("<div class='wxShare'>");e.push("<div class='wxShareContent'>");e.push("<div class='wxShareDesc'>");e.push("<span>"+LS.weChatShare+"</span>");e.push("</div>");e.push("<div class='wxShareQrcode'><img alt='' src='"+b+"' /></div>");e.push("</div>");e.push("</div>");var c=0;if(d){var a={title:"微信分享",width:480,height:480,divContent:e.join(""),closeFunc:function(){$("body").css("overflow","")}};c=Site.getTopWindow().Fai.popupWindowVersionTwo.createPopupWindow(a).getPopupWindowId();var g=$("#popupWindow"+c);var f=parseInt(g.css("top"));g.css("top",f+$(document).scrollTop()+"px");$("body").css("overflow","hidden")}else{c=Site.getTopWindow().Fai.popupWindow({width:480,height:420,frameScrolling:"no",bannerDisplay:false,bgClose:true,closeBtnClass:"wxSharehideCloseBtn",divContent:e.join("")})}if(Fai.isIE6()&&Fai.top.$("#fixSelectIframe"+c).length>0){Fai.top.$("#fixSelectIframe"+c).remove()}};Site.hoverChangeImage=function(k){var n=[],f=[];var r=false;var o=this.body?this.body:(this.editor?this.editor.body:false);if(!!k&&k.length>0){n=k.find("img[_defImg][_hovImg], img[_defFont][_hovFont], div[_defFont][_hovFont], div[_defImg][_hovImg]");f=k.find(".J_hoverImage")}else{if(o){n=$(o).find("img[_defImg][_hovImg], img[_defFont][_hovFont], div[_defFont][_hovFont], div[_defImg][_hovImg]");f=$(o).find(".J_hoverImage")}else{n=$("img[_defImg][_hovImg], img[_defFont][_hovFont], div[_defFont][_hovFont], div[_defImg][_hovImg]");f=$(".J_hoverImage")}}if(n.length==0){return}f.remove();for(var s=0;s<n.length;s++){var v=n[s];var p=$(v).parent();var e=$(v).position().top;var c=$(v).position().left;var t=$(v).width();var q=$(v).height();var d=$(v).attr("title")||"";var m=$(v).attr("_defFont");var h="";var g=$(v).attr("_hovImg");var w="position: absolute; opacity:0;";var l=$(v).attr("_hovFont");var j=$(v).attr("_hovColor");r=($(v).parents(".richContent").length>0||o)&&$(p).is("p, span, td");if(r){if(!(p[0].nodeName.toLowerCase()==="span"&&$(p).hasClass("J_hoverImageParent"))){var a="display: inline-block; width: "+t+"px; height: "+q+"px; _display: block; _zoom: 1;";$(v).after("<span class='J_hoverImageParent' style='"+a+"'></span>");p=$(v).next("span");$(p).append($(v))}}var h=$(p).find(".J_hoverImage");if(h.length==0){w+="top: 0px; left: 0px; width:"+t+"px; height:"+q+"px;";if(!!l){font_size=(t>q)?q:t;w+="font-size:"+font_size+"px; text-align : center; line-height:"+q+"px;";h="<div class='J_hoverImage "+l+"' style='"+w+"color: "+j+"' ></div>"}else{h="<img class='J_hoverImage' src='"+g+"' style='"+w+(g?"":"visibility:hidden;")+"' title='"+d+"' alt='"+d+"' >"}$(v).after(h)}$(v).css("opacity","")}var u=$(n).parent();$.each(u,function(y,z){var A=$(this).find("img[_defImg], div[_defFont]")[0];if(typeof($(A).attr("_hovImg"))=="undefined"&&typeof($(A).attr("_hovFont"))=="undefined"){return}if(typeof($(A).attr("_hovImg"))!="undefined"&&$(A).attr("_hovImg").length==0){return}var x=$(z).parents(".form");if(Fai.isChrome()&&!$(x).hasClass("formStyle31")){$(z).css("position","relative")}$(z).off(".hoverImage");$(z).on("mouseenter.hoverImage",function(){var B=$(this).find("img[_defImg], div[_defFont]")[0];var C=$(this).find(".J_hoverImage");var i=$(this).find(".forMargin");b(B,C);$(B).stop(false,true).animate({opacity:0},500);$(C).stop(false,true).animate({opacity:1},500)}).on("mouseleave.hoverImage",function(){var i=$(this).find("img[_defImg], div[_defFont]")[0];var B=$(this).find(".J_hoverImage");b(i,B);$(B).stop(false,true).animate({opacity:0},500);$(i).stop(false,true).animate({opacity:1},500)})});function b(A,D){var y=$(A).width();var x=$(A).height();var z=$(A).position().top;var i=$(A).position().left;var C=$(A).css("margin-left");var B=$(A).css("margin-top");if(!!C){C=parseInt(C.replace("px",""));i+=C}if(!!B){B=parseInt(B.replace("px",""));z+=B}if($(A).context.tagName=="DIV"){$(A).parent().css("display","block")}$(D).css({top:z+"px",left:i+"px",width:y+"px",height:x+"px"})}};Site.hoverStyle=function(){var k=$("a[aStyle_h]"),m=this.body?this.body:(this.editor?this.editor.body:false),f,c,d,g=true,j,b;if(m){k=$(m).find("a[aStyle_h]")}if(k.length==0){return}for(var e=0;e<k.length;e++){$(k[e]).off("mouseenter.hoverStyle").off("mouseleave.hoverStyle").on("mouseenter.hoverStyle",h).on("mouseleave.hoverStyle",l)}function h(){var o=$.parseJSON($(this).attr("stylehover")),i=$.parseJSON($(this).attr("wbackColor_h"));if(o==null&&i==null){return}else{if(o!=null&&i==null){for(var n=0;j=this.childNodes.length,n<j;n++){var p=this.childNodes[n];a(p,1,o,null,false)}d=this.style.textDecoration;c=this.style.color;$(this).css({"text-decoration":(o.u?"underline":"none"),color:o.c,display:"inline-block","text-indent":0});if(!o.u){g=false}}else{if(i!=null&&o==null){for(var n=0;j=this.childNodes.length,n<j;n++){var p=this.childNodes[n];a(p,2,null,i,false)}}else{d=this.style.textDecoration;c=this.style.color;for(var n=0;j=this.childNodes.length,n<j;n++){var p=this.childNodes[n];a(p,3,o,i,false)}$(this).css({"text-decoration":(o.u?"underline":"none"),color:o.c});if(!o.u){g=false}}}}}function l(){var o=$.parseJSON($(this).attr("stylehover"));var i=$.parseJSON($(this).attr("wbackColor_h"));if(o==null&&i==null){return}$(this).css("display","");for(var n=0;b=this.childNodes.length,n<b;n++){var p=this.childNodes[n];a(p,3,o,i,true)}if(!g){$(this).css({"text-decoration":"none"});g=true}if($(this).attr("astyle_h")==1){$(this).css({color:""+c+""});$(this).css({"text-decoration":""+d+""})}else{if($(this).attr("astyle_h")==2){$(this).css({color:""});$(this).css({"text-decoration":""})}}d=null;c=null;f=null}function a(s,p,r,i,q){var p=p||0;var o=s.childNodes.length;if(s.nodeType==1&&o>0){for(var n=0;n<o;n++){a(s.childNodes[n],p,r,i,q)}}if(s.nodeType==3){if(q){s.parentNode.style.cssText=f}else{f=s.parentNode.style.cssText;if(p==1){$(s.parentNode).css({"font-size":r.fs,"font-weight":r.b?"bold":"normal","font-family":r.ff,color:r.c})}else{if(p==2){$(s.parentNode).css({"background-color":i.bc})}else{if(p==3){$(s.parentNode).css({"font-size":r.fs,"font-weight":r.b?"bold":"normal","font-family":r.ff,color:r.c,"background-color":i.bc})}}}}}}};Site.setFullMeasureBgHightInIe6=function(b){if(Fai.isIE6()){var a=Fai.top.$("#module"+b),c=a.height();a.find(".fullmeasureOuterContentBg"+b).css("height",c+"px");a.find(".fullmeasureContentBg"+b).css("height",c+"px")}};Site.addStellarEvent=function(){var a=Fai.top.$(".fullmeasureOuterContentBg"),b=false;if(a.length>0){a.each(function(){if(!!$(this).attr("data-stellar-background-ratio")){b=true;return}})}if(b){if(Fai.top._manageMode){Fai.top.$("#g_main").stellar("destroy");Fai.top.$("#g_main").stellar({horizontalScrolling:false,responsive:false})}else{$(Fai.top).stellar("destroy");$(Fai.top).stellar({horizontalScrolling:false,responsive:false})}}};Site.popupPwdTips=function(b,a,c){Site.getTopWindow().$.cookie("hasLoginSite","true",{expires:1,path:"/"});Site.getTopWindow().$(".formDialog .formX").trigger("click");var d=[];d+="<div id='changePwdPopWin' style=''>";d+=" <div class='headeline_pwd'><span class='warmIcon'></span>请先修改您的密码</div>";d+=" <div class='summery_pwd'>您的密码过于简单,为避免盗号造成损失,请先修改密码</div>";d+=" <div class='btnBox'>";d+=" <a class='btn_pwd cancle_pwd' href='javaScript:void(0);' onclick=\"Site.tipsClose('"+a+"','"+c+"')\">暂不修改</a>";d+=" <a class='btn_pwd changePwd_pwd' href='"+b+"/portal.jsp#appId=setPwd' onclick='toSetPwd();Site.logDog(100068,9);'>修改密码</a> ";d+=" <div>";d+="<div>";Fai.ing2(d,false);Site.getTopWindow().$(".msg2").css({"text-align":"left",margin:"15px",width:"auto"});Site.getTopWindow().$(".tips2").css({height:"224px",width:"440px",border:"none"});Site.getTopWindow().$("#ing2").css({width:"452px","margin-top":"105px"});Site.getTopWindow().$("#ing2").css({transition:"opacity 0s ease",position:"fixed",top:"0"});Site.getTopWindow().$("#ing2,.tips2").css({transition:"opacity ease 0s","-webkit-box-shadow":"none","box-shadow":"none","-moz-box-shadow":"none"});Site.getTopWindow().$(".msg2").css({margin:"0px",width:"auto"});Fai.bg(0,0.7);Site.getTopWindow().$("body").css("overflow","hidden");Site.getTopWindow().$("#popupBg0").click(function(){Site.tipsClose(a,c)});Site.getTopWindow().$("#ing2 .close").bind("click",function(){Site.tipsClose(a,c)})};Site.tipsClose=function(a,b){Site.getTopWindow().Fai.removeIng2();Site.getTopWindow().Fai.removeBg();Site.getTopWindow().$("body").css("overflow","scroll");$.cookie("hasLoginSite","false",{expires:1,path:"/"});window.location.href="http://"+a+"."+b+""};Site.changeAdmHref=function(a,b){window.location.href="http://"+a+"."+b+""};Site.getDialogContent=function(b,a){var d=b?"suc-ico":"resultFailIcon";var c=["<table style='width:100%;height:100%;'>","<tr>","<td style='width:100px;'></td>","<td style='width:180px;'>","<div class='"+d+" addItemTextTips' style='max-width:160px;font-size:14px; color:#636363; overflow: hidden;word-wrap:normal; white-space: nowrap; text-overflow: ellipsis;' >"+a+"</div>","</td>","<td style='width:100px;'></td>","</tr>","</table>"];return c.join("")}; /*! * Clamp.js 0.5.1 * * Copyright 2011-2013, Joseph Schmitt http://joe.sh * Released under the WTFPL license * http://sam.zoy.org/wtfpl/ * * 第三方 多行省略代码 */ (function(a,c){function b(i,k){k=k||{};var u=this,l=window,g={clamp:k.clamp||2,useNativeClamp:typeof(k.useNativeClamp)!="undefined"?k.useNativeClamp:true,splitOnChars:k.splitOnChars||[".","-","–","—"," "],animate:k.animate||false,truncationChar:k.truncationChar||"…",truncationHTML:k.truncationHTML},s=i.style,A=i.innerHTML,w=typeof(i.style.webkitLineClamp)!="undefined",f=g.clamp,n=f.indexOf&&(f.indexOf("px")>-1||f.indexOf("em")>-1),p;if(g.truncationHTML){p=document.createElement("span");p.innerHTML=g.truncationHTML}var e=g.splitOnChars.slice(0),x=e[0],r,z;if(f=="auto"){f=j()}else{if(n){f=j(parseInt(f))}}var q;if(w&&g.useNativeClamp){s.overflow="hidden";s.textOverflow="ellipsis";s.webkitBoxOrient="vertical";s.display="-webkit-box";s.webkitLineClamp=f;if(n){s.height=g.clamp+"px"}}else{var v=y(f);if(v<=i.clientHeight){q=h(d(i),v)}}return{original:A,clamped:q};function t(B,C){if(!l.getComputedStyle){l.getComputedStyle=function(D,E){this.el=D;this.getPropertyValue=function(G){var F=/(\-([a-z]){1})/g;if(G=="float"){G="styleFloat"}if(F.test(G)){G=G.replace(F,function(){return arguments[2].toUpperCase()})}return D.currentStyle&&D.currentStyle[G]?D.currentStyle[G]:null};return this}}return l.getComputedStyle(B,null).getPropertyValue(C)}function j(B){var C=B||i.clientHeight,D=o(i);return Math.max(Math.floor(C/D),0)}function y(B){var C=o(i);return C*B}function o(C){var B=t(C,"line-height");if(B=="normal"){B=parseInt(t(C,"font-size"))*1.2}return parseInt(B)}function d(B){if(B.lastChild.children&&B.lastChild.children.length>0){return d(Array.prototype.slice.call(B.children).pop())}else{if(!B.lastChild||!B.lastChild.nodeValue||B.lastChild.nodeValue==""||B.lastChild.nodeValue==g.truncationChar){B.lastChild.parentNode.removeChild(B.lastChild);return d(i)}else{return B.lastChild}}}function h(E,D){if(!D){return}function C(){e=g.splitOnChars.slice(0);x=e[0];r=null;z=null}var B=E.nodeValue.replace(g.truncationChar,"");if(!r){if(e.length>0){x=e.shift()}else{x=""}r=B.split(x)}if(r.length>1){z=r.pop();m(E,r.join(x))}else{r=null}if(p){E.nodeValue=E.nodeValue.replace(g.truncationChar,"");i.innerHTML=E.nodeValue+" "+p.innerHTML+g.truncationChar}if(r){if(i.clientHeight<=D){if(e.length>=0&&x!=""){m(E,r.join(x)+x+z);r=null}else{return i.innerHTML}}}else{if(x==""){m(E,"");E=d(i);C()}}if(g.animate){setTimeout(function(){h(E,D)},g.animate===true?10:g.animate)}else{return h(E,D)}}function m(B,C){B.nodeValue=C+g.truncationChar}}a.clamp=b})(Site);Site.userReadyOperateSite=function(){if(Fai.top._manageMode){Site.mallCartInit(_colId);Site.mobiWebInit()}if(!Fai.top._Global._footerHidden){if(!Fai.top._oem){Site.changeTheLogoSize()}Site.refreshFooterItemSpacing()}Site.bindInTabSwitch()};(function(){if(Fai.top!=window){return}var f=Fai.top.window.location.hash,b,c,a;if(!f){return}try{b=$(f)}catch(d){return}if(b.length<1){return}c=Fai.top._manageMode?"#g_main":Fai.top.window;a=b.parents(":not(#g_main)");$(c).one("scroll",function(){a.each(function(){if($(this).css("overflow")=="hidden"){$(this).scrollTop(0);$(this).scroll(function(){if($(this).scrollTop()!=0){$(this).scrollTop(0)}})}})})})();Site.loginSiteInit=function(b,a,d,e){var c=$.cookie("hasLoginSite");if(c=="true"&&c!=null){$.cookie("hasLoginSite","false",{expires:1,path:"/"});Site.changeAdmHref(b,a)}if(d){Fai.ing(e,true)}};Site.getModuleGMainRect=function(c){var i=Fai.top.$("#module"+c),g=Fai.top.$("#g_main"),e=Fai.top.$(window),b,h,f,d,j;if(i.length<1){return}b=i[0].getBoundingClientRect();h=b.top+(a()?g.scrollTop():e.scrollTop())-g.position().top;f=b.left+(a()?g.scrollLeft():e.scrollLeft())-g.position().left;d=b.width;j=b.height;return{left:f,top:h,right:f+d,bottom:h+j,width:d,height:j};function a(){return Fai.top._manageMode}};Site.switchJump=function(){var a=$(".switchJump");$.each(a,function(c,f){if(c==="length"){return}var d=f.getAttribute("href");var b=f.getAttribute("_mu")||f.getAttribute("mJUrl");var e=f.getAttribute("_mColHide");if(b==null&&!e){return}if(d==b){f.setAttribute("href","javascript:void(0);");f.setAttribute("style","text-decoration:none;");return}})};Site.serviceLogDog=function(){var a=$(".formStyle40 .serOnline-service, .formStyle44 .serOnline-service");a.find(">div[servicetype]").off("click.log").on("click.log",function(){var b=$(this).attr("servicetype");switch(parseInt(b)){case 0:Site.logDog(200172,1);break;case 1:Site.logDog(200172,4);break;case 2:Site.logDog(200172,2);break;case 3:Site.logDog(200172,3);break}});setTimeout(function(){$("#jiaxin-mcs-fixed-btn").off("click.log").on("click.log",function(){Site.logDog(200172,7)});$("#newBridge #nb_icon_wrap").off("click.log").on("click.log",function(){Site.logDog(200172,6)})},2000)};(function(){if(Fai.top!=window){return}var a=[];window.onerror=function(c,b,d){if(typeof Site=="undefined"){alert("您的网页未加载完成,请尝试按“CTRL+功能键F5”重新加载。")}if(d<1||typeof c!="string"||c.length<1){return}var f="Error:"+c+";Line:"+d+";Url:"+b;var e="Error:"+c+"\nLine:"+d+"\nUrl:"+b+"\n";var j=function(i){return typeof i==="undefined"?"":encodeURIComponent(i)};var k=true;var h={m:c,u:b,l:d};for(var g=0;g<a.length;g++){if(a[g].m==h.m&&a[g].u==h.u&&a[g].l==h.l){k=false;break}}if(k){a.push(h);_faiAjax.ajax({type:"post",url:"ajax/logJsErr_h.jsp?cmd=jsErr",data:"msg="+j(f)})}if(Fai.top._devMode){alert(e)}}})();Site.ajaxClick=function(d,c){showLoading=function(f){var e=['<div class="ajaxLoading" style="margin-top:50px;margin-bottom:50px;">','<table style="width:100%;height:100%;"><tr><td align="center" valign="middle">','<div class="ajaxLoading2"></div>',"</td></tr></table>","</div>"];$("#module"+f+" .formMiddle").empty().append(e.join(""))};showLoadingAgain=function(f){closeLoading(f);var e=['<div class="ajaxLoadingAgain width" style="margin-top:50px;margin-bottom:50px;text-align:center;">','<div style="color: #1b7ad1; text-decoration: none; text-align:center; width:100%;cursor:pointer;" onclick="reloadingClick('+f+');">加载失败,请点击重新加载</div>',"</div>"];$("#module"+f+" .formMiddle").empty().append(e.join(""))};closeLoading=function(e){$("#module"+e+" .formMiddle .ajaxLoading").remove()};reloadingClick=function(e){loadingAjaxDom(e)};var a=$(d).attr("href");if(!a||typeof(a)=="undefined"){Fai.ing(LS.argsError,true);return}var b=false;loadingAjaxDom=function(e){setTimeout(function(){if(!b){showLoading(e)}},1000);$.ajax({type:"post",url:"ajax/ajaxLoadModuleDom_h.jsp",data:"cmd=getAjaxPageModuleInfo&_colId="+Fai.top._colId+"&_extId="+0+"&moduleId="+e+"&href="+Fai.encodeUrl(a),error:function(f){b=true;showLoadingAgain(e);Fai.ing(LS.systemError,true)},success:function(f){b=true;closeLoading(e);var f=$.parseJSON(f);if(f.success){$("#module"+e).html("");$("#module"+e).html($(f.domStr).html());Fai.fkEval(f.scripts);jzUtils.run({name:"moduleAnimation.publish",base:Fai.top.Site});jzUtils.run({name:"moduleAnimation.contentAnimationPublish",base:Fai.top.Site})}else{Fai.ing(f.msg,true);showLoadingAgain(e)}}})};loadingAjaxDom(c)};(function(h,m,n,d){var e="mCustomScrollbar",a="mCS",l=".mCustomScrollbar",f={setWidth:false,setHeight:false,setTop:0,setLeft:0,axis:"y",scrollbarPosition:"inside",scrollInertia:950,autoDraggerLength:true,autoHideScrollbar:false,autoExpandScrollbar:false,alwaysShowScrollbar:0,snapAmount:null,snapOffset:0,mouseWheel:{enable:true,scrollAmount:"auto",axis:"y",preventDefault:false,deltaFactor:"auto",normalizeDelta:false,invert:false,disableOver:["select","option","keygen","datalist","textarea"]},scrollButtons:{enable:false,scrollType:"stepless",scrollAmount:"auto"},keyboard:{enable:true,scrollType:"stepless",scrollAmount:"auto"},contentTouchScroll:25,advanced:{autoExpandHorizontalScroll:false,autoScrollOnFocus:"input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']",updateOnContentResize:true,updateOnImageLoad:true,updateOnSelectorChange:false},theme:"light",callbacks:{onScrollStart:false,onScroll:false,onTotalScroll:false,onTotalScrollBack:false,whileScrolling:false,onTotalScrollOffset:0,onTotalScrollBackOffset:0,alwaysTriggerOffsets:true},live:false,liveSelector:null},k=0,p={},c=function(q){if(p[q]){clearTimeout(p[q]);g._delete.call(null,p[q])}},j=(m.attachEvent&&!m.addEventListener)?1:0,o=false,b={init:function(r){var r=h.extend(true,{},f,r),q=g._selector.call(this);if(r.live){var t=r.liveSelector||this.selector||l,s=h(t);if(r.live==="off"){c(t);return}p[t]=setTimeout(function(){s.mCustomScrollbar(r);if(r.live==="once"&&s.length){c(t)}},500)}else{c(t)}r.setWidth=(r.set_width)?r.set_width:r.setWidth;r.setHeight=(r.set_height)?r.set_height:r.setHeight;r.axis=(r.horizontalScroll)?"x":g._findAxis.call(null,r.axis);r.scrollInertia=r.scrollInertia<17?17:r.scrollInertia;if(typeof r.mouseWheel!=="object"&&r.mouseWheel==true){r.mouseWheel={enable:true,scrollAmount:"auto",axis:"y",preventDefault:false,deltaFactor:"auto",normalizeDelta:false,invert:false}}r.mouseWheel.scrollAmount=!r.mouseWheelPixels?r.mouseWheel.scrollAmount:r.mouseWheelPixels;r.mouseWheel.normalizeDelta=!r.advanced.normalizeMouseWheelDelta?r.mouseWheel.normalizeDelta:r.advanced.normalizeMouseWheelDelta;r.scrollButtons.scrollType=g._findScrollButtonsType.call(null,r.scrollButtons.scrollType);g._theme.call(null,r);return h(q).each(function(){var v=h(this);if(!v.data(a)){v.data(a,{idx:++k,opt:r,scrollRatio:{y:null,x:null},overflowed:null,bindEvents:false,tweenRunning:false,sequential:{},langDir:v.css("direction"),cbOffsets:null,trigger:null});var x=v.data(a).opt,w=v.data("mcs-axis"),u=v.data("mcs-scrollbar-position"),y=v.data("mcs-theme");if(w){x.axis=w}if(u){x.scrollbarPosition=u}if(y){x.theme=y;g._theme.call(null,x)}g._pluginMarkup.call(this);b.update.call(null,v)}})},update:function(r){var q=r||g._selector.call(this);return h(q).each(function(){var u=h(this);if(u.data(a)){var w=u.data(a),v=w.opt,s=h("#mCSB_"+w.idx+"_container"),t=[h("#mCSB_"+w.idx+"_dragger_vertical"),h("#mCSB_"+w.idx+"_dragger_horizontal")];if(!s.length){return}if(w.tweenRunning){g._stop.call(null,u)}if(u.hasClass("mCS_disabled")){u.removeClass("mCS_disabled")}if(u.hasClass("mCS_destroyed")){u.removeClass("mCS_destroyed")}g._maxHeight.call(this);g._expandContentHorizontally.call(this);if(v.axis!=="y"&&!v.advanced.autoExpandHorizontalScroll){s.css("width",g._contentWidth(s.children()))}w.overflowed=g._overflowed.call(this);g._scrollbarVisibility.call(this);if(v.autoDraggerLength){g._setDraggerLength.call(this)}g._scrollRatio.call(this);g._bindEvents.call(this);var x=[Math.abs(s[0].offsetTop),Math.abs(s[0].offsetLeft)];if(v.axis!=="x"){if(!w.overflowed[0]){g._resetContentPosition.call(this);if(v.axis==="y"){g._unbindEvents.call(this)}else{if(v.axis==="yx"&&w.overflowed[1]){g._scrollTo.call(this,u,x[1].toString(),{dir:"x",dur:0,overwrite:"none"})}}}else{if(t[0].height()>t[0].parent().height()){g._resetContentPosition.call(this)}else{g._scrollTo.call(this,u,x[0].toString(),{dir:"y",dur:0,overwrite:"none"})}}}if(v.axis!=="y"){if(!w.overflowed[1]){g._resetContentPosition.call(this);if(v.axis==="x"){g._unbindEvents.call(this)}else{if(v.axis==="yx"&&w.overflowed[0]){g._scrollTo.call(this,u,x[0].toString(),{dir:"y",dur:0,overwrite:"none"})}}}else{if(t[1].width()>t[1].parent().width()){g._resetContentPosition.call(this)}else{g._scrollTo.call(this,u,x[1].toString(),{dir:"x",dur:0,overwrite:"none"})}}}g._autoUpdate.call(this)}})},scrollTo:function(s,r){if(typeof s=="undefined"||s==null){return}var q=g._selector.call(this);return h(q).each(function(){var v=h(this);if(v.data(a)){var y=v.data(a),x=y.opt,w={trigger:"external",scrollInertia:x.scrollInertia,scrollEasing:"mcsEaseInOut",moveDragger:false,callbacks:true,onStart:true,onUpdate:true,onComplete:true},t=h.extend(true,{},w,r),z=g._arr.call(this,s),u=t.scrollInertia<17?17:t.scrollInertia;z[0]=g._to.call(this,z[0],"y");z[1]=g._to.call(this,z[1],"x");if(t.moveDragger){z[0]*=y.scrollRatio.y;z[1]*=y.scrollRatio.x}t.dur=u;setTimeout(function(){if(z[0]!==null&&typeof z[0]!=="undefined"&&x.axis!=="x"&&y.overflowed[0]){t.dir="y";t.overwrite="all";g._scrollTo.call(this,v,z[0].toString(),t)}if(z[1]!==null&&typeof z[1]!=="undefined"&&x.axis!=="y"&&y.overflowed[1]){t.dir="x";t.overwrite="none";g._scrollTo.call(this,v,z[1].toString(),t)}},60)}})},stop:function(){var q=g._selector.call(this);return h(q).each(function(){var r=h(this);if(r.data(a)){g._stop.call(null,r)}})},disable:function(s){var q=g._selector.call(this);return h(q).each(function(){var r=h(this);if(r.data(a)){var u=r.data(a),t=u.opt;g._autoUpdate.call(this,"remove");g._unbindEvents.call(this);if(s){g._resetContentPosition.call(this)}g._scrollbarVisibility.call(this,true);r.addClass("mCS_disabled")}})},destroy:function(){var q=g._selector.call(this);return h(q).each(function(){var t=h(this);if(t.data(a)){var v=t.data(a),u=v.opt,r=h("#mCSB_"+v.idx),s=h("#mCSB_"+v.idx+"_container"),w=h(".mCSB_"+v.idx+"_scrollbar");if(u.live){c(q)}g._autoUpdate.call(this,"remove");g._unbindEvents.call(this);g._resetContentPosition.call(this);t.removeData(a);g._delete.call(null,this.mcs);w.remove();r.replaceWith(s.contents());t.removeClass(e+" _"+a+"_"+v.idx+" mCS-autoHide mCS-dir-rtl mCS_no_scrollbar mCS_disabled").addClass("mCS_destroyed")}})}},g={_selector:function(){return(typeof h(this)!=="object"||h(this).length<1)?l:this},_theme:function(t){var s=["rounded","rounded-dark","rounded-dots","rounded-dots-dark"],r=["rounded-dots","rounded-dots-dark","3d","3d-dark","3d-thick","3d-thick-dark","inset","inset-dark","inset-2","inset-2-dark","inset-3","inset-3-dark"],q=["minimal","minimal-dark"],v=["minimal","minimal-dark"],u=["minimal","minimal-dark"];t.autoDraggerLength=h.inArray(t.theme,s)>-1?false:t.autoDraggerLength;t.autoExpandScrollbar=h.inArray(t.theme,r)>-1?false:t.autoExpandScrollbar;t.scrollButtons.enable=h.inArray(t.theme,q)>-1?false:t.scrollButtons.enable;t.autoHideScrollbar=h.inArray(t.theme,v)>-1?true:t.autoHideScrollbar;t.scrollbarPosition=h.inArray(t.theme,u)>-1?"outside":t.scrollbarPosition},_findAxis:function(q){return(q==="yx"||q==="xy"||q==="auto")?"yx":(q==="x"||q==="horizontal")?"x":"y"},_findScrollButtonsType:function(q){return(q==="stepped"||q==="pixels"||q==="step"||q==="click")?"stepped":"stepless"},_pluginMarkup:function(){var z=h(this),y=z.data(a),s=y.opt,u=s.autoExpandScrollbar?" mCSB_scrollTools_onDrag_expand":"",C=["<div id='mCSB_"+y.idx+"_scrollbar_vertical' class='mCSB_scrollTools mCSB_"+y.idx+"_scrollbar mCS-"+s.theme+" mCSB_scrollTools_vertical"+u+"'><div class='mCSB_draggerContainer'><div id='mCSB_"+y.idx+"_dragger_vertical' class='mCSB_dragger' style='position:absolute;' oncontextmenu='return false;'><div class='mCSB_dragger_bar' /></div><div class='mCSB_draggerRail' /></div></div>","<div id='mCSB_"+y.idx+"_scrollbar_horizontal' class='mCSB_scrollTools mCSB_"+y.idx+"_scrollbar mCS-"+s.theme+" mCSB_scrollTools_horizontal"+u+"'><div class='mCSB_draggerContainer'><div id='mCSB_"+y.idx+"_dragger_horizontal' class='mCSB_dragger' style='position:absolute;' oncontextmenu='return false;'><div class='mCSB_dragger_bar' /></div><div class='mCSB_draggerRail' /></div></div>"],v=s.axis==="yx"?"mCSB_vertical_horizontal":s.axis==="x"?"mCSB_horizontal":"mCSB_vertical",x=s.axis==="yx"?C[0]+C[1]:s.axis==="x"?C[1]:C[0],w=s.axis==="yx"?"<div id='mCSB_"+y.idx+"_container_wrapper' class='mCSB_container_wrapper' />":"",t=s.autoHideScrollbar?" mCS-autoHide":"",q=(s.axis!=="x"&&y.langDir==="rtl")?" mCS-dir-rtl":"";if(s.setWidth){z.css("width",s.setWidth)}if(s.setHeight){z.css("height",s.setHeight)}s.setLeft=(s.axis!=="y"&&y.langDir==="rtl")?"989999px":s.setLeft;z.addClass(e+" _"+a+"_"+y.idx+t+q).wrapInner("<div id='mCSB_"+y.idx+"' class='mCustomScrollBox mCS-"+s.theme+" "+v+"'><div id='mCSB_"+y.idx+"_container' class='mCSB_container' style='position:relative; top:"+s.setTop+"; left:"+s.setLeft+";' dir="+y.langDir+" /></div>");var r=h("#mCSB_"+y.idx),A=h("#mCSB_"+y.idx+"_container");if(s.axis!=="y"&&!s.advanced.autoExpandHorizontalScroll){A.css("width",g._contentWidth(A.children()))}if(s.scrollbarPosition==="outside"){if(z.css("position")==="static"){z.css("position","relative")}z.css("overflow","visible");r.addClass("mCSB_outside").after(x)}else{r.addClass("mCSB_inside").append(x);A.wrap(w)}g._scrollButtons.call(this);var B=[h("#mCSB_"+y.idx+"_dragger_vertical"),h("#mCSB_"+y.idx+"_dragger_horizontal")];B[0].css("min-height",B[0].height());B[1].css("min-width",B[1].width())},_contentWidth:function(q){return Math.max.apply(Math,q.map(function(){return h(this).outerWidth(true)}).get())},_expandContentHorizontally:function(){var r=h(this),t=r.data(a),s=t.opt,q=h("#mCSB_"+t.idx+"_container");if(s.advanced.autoExpandHorizontalScroll&&s.axis!=="y"){q.css({position:"absolute",width:"auto"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({width:(Math.ceil(q[0].getBoundingClientRect().right+0.4)-Math.floor(q[0].getBoundingClientRect().left)),position:"relative"}).unwrap()}},_scrollButtons:function(){var t=h(this),v=t.data(a),u=v.opt,r=h(".mCSB_"+v.idx+"_scrollbar:first"),s=["<a href='#' class='mCSB_buttonUp' oncontextmenu='return false;' />","<a href='#' class='mCSB_buttonDown' oncontextmenu='return false;' />","<a href='#' class='mCSB_buttonLeft' oncontextmenu='return false;' />","<a href='#' class='mCSB_buttonRight' oncontextmenu='return false;' />"],q=[(u.axis==="x"?s[2]:s[0]),(u.axis==="x"?s[3]:s[1]),s[2],s[3]];if(u.scrollButtons.enable){r.prepend(q[0]).append(q[1]).next(".mCSB_scrollTools").prepend(q[2]).append(q[3])}},_maxHeight:function(){var u=h(this),x=u.data(a),w=x.opt,s=h("#mCSB_"+x.idx),r=u.css("max-height"),t=r.indexOf("%")!==-1,q=u.css("box-sizing");if(r!=="none"){var v=t?u.parent().height()*parseInt(r)/100:parseInt(r);if(q==="border-box"){v-=((u.innerHeight()-u.height())+(u.outerHeight()-u.innerHeight()))}s.css("max-height",Math.round(v))}},_setDraggerLength:function(){var v=h(this),t=v.data(a),q=h("#mCSB_"+t.idx),x=h("#mCSB_"+t.idx+"_container"),z=[h("#mCSB_"+t.idx+"_dragger_vertical"),h("#mCSB_"+t.idx+"_dragger_horizontal")],u=[q.height()/x.outerHeight(false),q.width()/x.outerWidth(false)],r=[parseInt(z[0].css("min-height")),Math.round(u[0]*z[0].parent().height()),parseInt(z[1].css("min-width")),Math.round(u[1]*z[1].parent().width())],s=j&&(r[1]<r[0])?r[0]:r[1],y=j&&(r[3]<r[2])?r[2]:r[3];z[0].css({height:s,"max-height":(z[0].parent().height()-10)}).find(".mCSB_dragger_bar").css({"line-height":r[0]+"px"});z[1].css({width:y,"max-width":(z[1].parent().width()-10)})},_scrollRatio:function(){var u=h(this),w=u.data(a),r=h("#mCSB_"+w.idx),s=h("#mCSB_"+w.idx+"_container"),t=[h("#mCSB_"+w.idx+"_dragger_vertical"),h("#mCSB_"+w.idx+"_dragger_horizontal")],v=[s.outerHeight(false)-r.height(),s.outerWidth(false)-r.width()],q=[v[0]/(t[0].parent().height()-t[0].height()),v[1]/(t[1].parent().width()-t[1].width())];w.scrollRatio={y:q[0],x:q[1]}},_onDragClasses:function(s,u,r){var t=r?"mCSB_dragger_onDrag_expanded":"",q=["mCSB_dragger_onDrag","mCSB_scrollTools_onDrag"],v=s.closest(".mCSB_scrollTools");if(u==="active"){s.toggleClass(q[0]+" "+t);v.toggleClass(q[1]);s[0]._draggable=s[0]._draggable?0:1}else{if(!s[0]._draggable){if(u==="hide"){s.removeClass(q[0]);v.removeClass(q[1])}else{s.addClass(q[0]);v.addClass(q[1])}}}},_overflowed:function(){var u=h(this),v=u.data(a),r=h("#mCSB_"+v.idx),t=h("#mCSB_"+v.idx+"_container"),s=v.overflowed==null?t.height():t.outerHeight(false),q=v.overflowed==null?t.width():t.outerWidth(false);return[s>r.height(),q>r.width()]},_resetContentPosition:function(){var u=h(this),w=u.data(a),v=w.opt,r=h("#mCSB_"+w.idx),s=h("#mCSB_"+w.idx+"_container"),t=[h("#mCSB_"+w.idx+"_dragger_vertical"),h("#mCSB_"+w.idx+"_dragger_horizontal")];g._stop(u);if((v.axis!=="x"&&!w.overflowed[0])||(v.axis==="y"&&w.overflowed[0])){t[0].add(s).css("top",0)}if((v.axis!=="y"&&!w.overflowed[1])||(v.axis==="x"&&w.overflowed[1])){var q=dx=0;if(w.langDir==="rtl"){q=r.width()-s.outerWidth(false);dx=Math.abs(q/w.scrollRatio.x)}s.css("left",q);t[1].css("left",dx)}},_bindEvents:function(){var s=h(this),u=s.data(a),t=u.opt;if(!u.bindEvents){g._draggable.call(this);if(t.contentTouchScroll){g._contentDraggable.call(this)}if(t.mouseWheel.enable){function r(){q=setTimeout(function(){if(!h.event.special.mousewheel){r()}else{clearTimeout(q);g._mousewheel.call(s[0])}},1000)}var q;r()}g._draggerRail.call(this);g._wrapperScroll.call(this);if(t.advanced.autoScrollOnFocus){g._focus.call(this)}if(t.scrollButtons.enable){g._buttons.call(this)}if(t.keyboard.enable){g._keyboard.call(this)}u.bindEvents=true}},_unbindEvents:function(){var t=h(this),u=t.data(a),q=a+"_"+u.idx,v=".mCSB_"+u.idx+"_scrollbar",s=h("#mCSB_"+u.idx+",#mCSB_"+u.idx+"_container,#mCSB_"+u.idx+"_container_wrapper,"+v+" .mCSB_draggerContainer,#mCSB_"+u.idx+"_dragger_vertical,#mCSB_"+u.idx+"_dragger_horizontal,"+v+">a"),r=h("#mCSB_"+u.idx+"_container");if(u.bindEvents){h(n).unbind("."+q);s.each(function(){h(this).unbind("."+q)});clearTimeout(t[0]._focusTimeout);g._delete.call(null,t[0]._focusTimeout);clearTimeout(u.sequential.step);g._delete.call(null,u.sequential.step);clearTimeout(r[0].onCompleteTimeout);g._delete.call(null,r[0].onCompleteTimeout);u.bindEvents=false}},_scrollbarVisibility:function(r){var u=h(this),w=u.data(a),v=w.opt,q=h("#mCSB_"+w.idx+"_container_wrapper"),s=q.length?q:h("#mCSB_"+w.idx+"_container"),x=[h("#mCSB_"+w.idx+"_scrollbar_vertical"),h("#mCSB_"+w.idx+"_scrollbar_horizontal")],t=[x[0].find(".mCSB_dragger"),x[1].find(".mCSB_dragger")];if(v.axis!=="x"){if(w.overflowed[0]&&!r){x[0].add(t[0]).add(x[0].children("a")).css("display","block");s.removeClass("mCS_no_scrollbar_y mCS_y_hidden")}else{if(v.alwaysShowScrollbar){if(v.alwaysShowScrollbar!==2){t[0].add(x[0].children("a")).css("display","none")}s.removeClass("mCS_y_hidden")}else{x[0].css("display","none");s.addClass("mCS_y_hidden")}s.addClass("mCS_no_scrollbar_y")}}if(v.axis!=="y"){if(w.overflowed[1]&&!r){x[1].add(t[1]).add(x[1].children("a")).css("display","block");s.removeClass("mCS_no_scrollbar_x mCS_x_hidden")}else{if(v.alwaysShowScrollbar){if(v.alwaysShowScrollbar!==2){t[1].add(x[1].children("a")).css("display","none")}s.removeClass("mCS_x_hidden")}else{x[1].css("display","none");s.addClass("mCS_x_hidden")}s.addClass("mCS_no_scrollbar_x")}}if(!w.overflowed[0]&&!w.overflowed[1]){u.addClass("mCS_no_scrollbar")}else{u.removeClass("mCS_no_scrollbar")}},_coordinates:function(r){var q=r.type;switch(q){case"pointerdown":case"MSPointerDown":case"pointermove":case"MSPointerMove":case"pointerup":case"MSPointerUp":return[r.originalEvent.pageY,r.originalEvent.pageX];break;case"touchstart":case"touchmove":case"touchend":var s=r.originalEvent.touches[0]||r.originalEvent.changedTouches[0];return[s.pageY,s.pageX];break;default:return[r.pageY,r.pageX]}},_draggable:function(){var v=h(this),t=v.data(a),q=t.opt,s=a+"_"+t.idx,u=["mCSB_"+t.idx+"_dragger_vertical","mCSB_"+t.idx+"_dragger_horizontal"],w=h("#mCSB_"+t.idx+"_container"),x=h("#"+u[0]+",#"+u[1]),B,z,A;x.bind("mousedown."+s+" touchstart."+s+" pointerdown."+s+" MSPointerDown."+s,function(F){F.stopImmediatePropagation();F.preventDefault();if(!g._mouseBtnLeft(F)){return}o=true;if(j){n.onselectstart=function(){return false}}y(false);g._stop(v);B=h(this);var G=B.offset(),H=g._coordinates(F)[0]-G.top,C=g._coordinates(F)[1]-G.left,E=B.height()+G.top,D=B.width()+G.left;if(H<E&&H>0&&C<D&&C>0){z=H;A=C}g._onDragClasses(B,"active",q.autoExpandScrollbar)}).bind("touchmove."+s,function(D){D.stopImmediatePropagation();D.preventDefault();var E=B.offset(),F=g._coordinates(D)[0]-E.top,C=g._coordinates(D)[1]-E.left;r(z,A,F,C)});h(n).bind("mousemove."+s+" pointermove."+s+" MSPointerMove."+s,function(D){if(B){var E=B.offset(),F=g._coordinates(D)[0]-E.top,C=g._coordinates(D)[1]-E.left;if(z===F){return}r(z,A,F,C)}}).add(x).bind("mouseup."+s+" touchend."+s+" pointerup."+s+" MSPointerUp."+s,function(C){if(B){g._onDragClasses(B,"active",q.autoExpandScrollbar);B=null}o=false;if(j){n.onselectstart=null}y(true)});function y(C){var D=w.find("iframe");if(!D.length){return}var E=!C?"none":"auto";D.css("pointer-events",E)}function r(E,F,H,C){w[0].idleTimer=q.scrollInertia<233?250:0;if(B.attr("id")===u[1]){var D="x",G=((B[0].offsetLeft-F)+C)*t.scrollRatio.x}else{var D="y",G=((B[0].offsetTop-E)+H)*t.scrollRatio.y}g._scrollTo(v,G.toString(),{dir:D,drag:true})}},_contentDraggable:function(){var z=h(this),L=z.data(a),J=L.opt,G=a+"_"+L.idx,w=h("#mCSB_"+L.idx),A=h("#mCSB_"+L.idx+"_container"),x=[h("#mCSB_"+L.idx+"_dragger_vertical"),h("#mCSB_"+L.idx+"_dragger_horizontal")],F,H,M,N,D=[],E=[],I,B,v,u,K,y,s=0,r,t=J.axis==="yx"?"none":"all";A.bind("touchstart."+G+" pointerdown."+G+" MSPointerDown."+G,function(O){if(!g._pointerTouch(O)||o){return}var P=A.offset();F=g._coordinates(O)[0]-P.top;H=g._coordinates(O)[1]-P.left}).bind("touchmove."+G+" pointermove."+G+" MSPointerMove."+G,function(R){if(!g._pointerTouch(R)||o){return}R.stopImmediatePropagation();B=g._getTime();var Q=w.offset(),T=g._coordinates(R)[0]-Q.top,V=g._coordinates(R)[1]-Q.left,S="mcsLinearOut";D.push(T);E.push(V);if(L.overflowed[0]){var P=x[0].parent().height()-x[0].height(),U=((F-T)>0&&(T-F)>-(P*L.scrollRatio.y))}if(L.overflowed[1]){var O=x[1].parent().width()-x[1].width(),W=((H-V)>0&&(V-H)>-(O*L.scrollRatio.x))}if(U||W){R.preventDefault()}y=J.axis==="yx"?[(F-T),(H-V)]:J.axis==="x"?[null,(H-V)]:[(F-T),null];A[0].idleTimer=250;if(L.overflowed[0]){C(y[0],s,S,"y","all",true)}if(L.overflowed[1]){C(y[1],s,S,"x",t,true)}});w.bind("touchstart."+G+" pointerdown."+G+" MSPointerDown."+G,function(O){if(!g._pointerTouch(O)||o){return}O.stopImmediatePropagation();g._stop(z);I=g._getTime();var P=w.offset();M=g._coordinates(O)[0]-P.top;N=g._coordinates(O)[1]-P.left;D=[];E=[]}).bind("touchend."+G+" pointerup."+G+" MSPointerUp."+G,function(Q){if(!g._pointerTouch(Q)||o){return}Q.stopImmediatePropagation();v=g._getTime();var O=w.offset(),U=g._coordinates(Q)[0]-O.top,W=g._coordinates(Q)[1]-O.left;if((v-B)>30){return}K=1000/(v-I);var R="mcsEaseOut",S=K<2.5,X=S?[D[D.length-2],E[E.length-2]]:[0,0];u=S?[(U-X[0]),(W-X[1])]:[U-M,W-N];var P=[Math.abs(u[0]),Math.abs(u[1])];K=S?[Math.abs(u[0]/4),Math.abs(u[1]/4)]:[K,K];var V=[Math.abs(A[0].offsetTop)-(u[0]*q((P[0]/K[0]),K[0])),Math.abs(A[0].offsetLeft)-(u[1]*q((P[1]/K[1]),K[1]))];y=J.axis==="yx"?[V[0],V[1]]:J.axis==="x"?[null,V[1]]:[V[0],null];r=[(P[0]*4)+J.scrollInertia,(P[1]*4)+J.scrollInertia];var T=parseInt(J.contentTouchScroll)||0;y[0]=P[0]>T?y[0]:0;y[1]=P[1]>T?y[1]:0;if(L.overflowed[0]){C(y[0],r[0],R,"y",t,false)}if(L.overflowed[1]){C(y[1],r[1],R,"x",t,false)}});function q(Q,O){var P=[O*1.5,O*2,O/1.5,O/2];if(Q>90){return O>4?P[0]:P[3]}else{if(Q>60){return O>3?P[3]:P[2]}else{if(Q>30){return O>8?P[1]:O>6?P[0]:O>4?O:P[2]}else{return O>8?O:P[3]}}}}function C(Q,S,T,P,O,R){if(!Q){return}g._scrollTo(z,Q.toString(),{dur:S,scrollEasing:T,dir:P,overwrite:O,drag:R})}},_mousewheel:function(){var t=h(this),v=t.data(a),u=v.opt,r=a+"_"+v.idx,q=h("#mCSB_"+v.idx),s=[h("#mCSB_"+v.idx+"_dragger_vertical"),h("#mCSB_"+v.idx+"_dragger_horizontal")];q.bind("mousewheel."+r,function(A,E){g._stop(t);if(g._disableMousewheel(t,A.target)){return}var C=u.mouseWheel.deltaFactor!=="auto"?parseInt(u.mouseWheel.deltaFactor):(j&&A.deltaFactor<100)?100:A.deltaFactor<40?40:A.deltaFactor||100;if(u.axis==="x"||u.mouseWheel.axis==="x"){var x="x",D=[Math.round(C*v.scrollRatio.x),parseInt(u.mouseWheel.scrollAmount)],z=u.mouseWheel.scrollAmount!=="auto"?D[1]:D[0]>=q.width()?q.width()*0.9:D[0],F=Math.abs(h("#mCSB_"+v.idx+"_container")[0].offsetLeft),B=s[1][0].offsetLeft,y=s[1].parent().width()-s[1].width(),w=A.deltaX||A.deltaY||E}else{var x="y",D=[Math.round(C*v.scrollRatio.y),parseInt(u.mouseWheel.scrollAmount)],z=u.mouseWheel.scrollAmount!=="auto"?D[1]:D[0]>=q.height()?q.height()*0.9:D[0],F=Math.abs(h("#mCSB_"+v.idx+"_container")[0].offsetTop),B=s[0][0].offsetTop,y=s[0].parent().height()-s[0].height(),w=A.deltaY||E}if((x==="y"&&!v.overflowed[0])||(x==="x"&&!v.overflowed[1])){return}if(u.mouseWheel.invert){w=-w}if(u.mouseWheel.normalizeDelta){w=w<0?-1:1}if((w>0&&B!==0)||(w<0&&B!==y)||u.mouseWheel.preventDefault){A.stopImmediatePropagation();A.preventDefault()}g._scrollTo(t,(F-(w*z)).toString(),{dir:x})})},_disableMousewheel:function(s,u){var q=u.nodeName.toLowerCase(),r=s.data(a).opt.mouseWheel.disableOver,t=["select","textarea"];return h.inArray(q,r)>-1&&!(h.inArray(q,t)>-1&&!h(u).is(":focus"))},_draggerRail:function(){var t=h(this),u=t.data(a),r=a+"_"+u.idx,s=h("#mCSB_"+u.idx+"_container"),v=s.parent(),q=h(".mCSB_"+u.idx+"_scrollbar .mCSB_draggerContainer");q.bind("touchstart."+r+" pointerdown."+r+" MSPointerDown."+r,function(w){o=true}).bind("touchend."+r+" pointerup."+r+" MSPointerUp."+r,function(w){o=false}).bind("click."+r,function(A){if(h(A.target).hasClass("mCSB_draggerContainer")||h(A.target).hasClass("mCSB_draggerRail")){g._stop(t);var x=h(this),z=x.find(".mCSB_dragger");if(x.parent(".mCSB_scrollTools_horizontal").length>0){if(!u.overflowed[1]){return}var w="x",y=A.pageX>z.offset().left?-1:1,B=Math.abs(s[0].offsetLeft)-(y*(v.width()*0.9))}else{if(!u.overflowed[0]){return}var w="y",y=A.pageY>z.offset().top?-1:1,B=Math.abs(s[0].offsetTop)-(y*(v.height()*0.9))}g._scrollTo(t,B.toString(),{dir:w,scrollEasing:"mcsEaseInOut"})}})},_focus:function(){var s=h(this),u=s.data(a),t=u.opt,q=a+"_"+u.idx,r=h("#mCSB_"+u.idx+"_container"),v=r.parent();r.bind("focusin."+q,function(y){var x=h(n.activeElement),z=r.find(".mCustomScrollBox").length,w=0;if(!x.is(t.advanced.autoScrollOnFocus)){return}g._stop(s);clearTimeout(s[0]._focusTimeout);s[0]._focusTimer=z?(w+17)*z:0;s[0]._focusTimeout=setTimeout(function(){var D=[x.offset().top-r.offset().top,x.offset().left-r.offset().left],C=[r[0].offsetTop,r[0].offsetLeft],A=[(C[0]+D[0]>=0&&C[0]+D[0]<v.height()-x.outerHeight(false)),(C[1]+D[1]>=0&&C[0]+D[1]<v.width()-x.outerWidth(false))],B=(t.axis==="yx"&&!A[0]&&!A[1])?"none":"all";if(t.axis!=="x"&&!A[0]){g._scrollTo(s,D[0].toString(),{dir:"y",scrollEasing:"mcsEaseInOut",overwrite:B,dur:w})}if(t.axis!=="y"&&!A[1]){g._scrollTo(s,D[1].toString(),{dir:"x",scrollEasing:"mcsEaseInOut",overwrite:B,dur:w})}},s[0]._focusTimer)})},_wrapperScroll:function(){var r=h(this),s=r.data(a),q=a+"_"+s.idx,t=h("#mCSB_"+s.idx+"_container").parent();t.bind("scroll."+q,function(u){t.scrollTop(0).scrollLeft(0)})},_buttons:function(){var v=h(this),x=v.data(a),w=x.opt,q=x.sequential,s=a+"_"+x.idx,u=h("#mCSB_"+x.idx+"_container"),t=".mCSB_"+x.idx+"_scrollbar",r=h(t+">a");r.bind("mousedown."+s+" touchstart."+s+" pointerdown."+s+" MSPointerDown."+s+" mouseup."+s+" touchend."+s+" pointerup."+s+" MSPointerUp."+s+" mouseout."+s+" pointerout."+s+" MSPointerOut."+s+" click."+s,function(A){A.preventDefault();if(!g._mouseBtnLeft(A)){return}var z=h(this).attr("class");q.type=w.scrollButtons.scrollType;switch(A.type){case"mousedown":case"touchstart":case"pointerdown":case"MSPointerDown":if(q.type==="stepped"){return}o=true;x.tweenRunning=false;y("on",z);break;case"mouseup":case"touchend":case"pointerup":case"MSPointerUp":case"mouseout":case"pointerout":case"MSPointerOut":if(q.type==="stepped"){return}o=false;if(q.dir){y("off",z)}break;case"click":if(q.type!=="stepped"||x.tweenRunning){return}y("on",z);break}function y(B,C){q.scrollAmount=w.snapAmount||w.scrollButtons.scrollAmount;g._sequentialScroll.call(this,v,B,C)}})},_keyboard:function(){var v=h(this),u=v.data(a),r=u.opt,y=u.sequential,t=a+"_"+u.idx,s=h("#mCSB_"+u.idx),x=h("#mCSB_"+u.idx+"_container"),q=x.parent(),w="input,textarea,select,datalist,keygen,[contenteditable='true']";s.attr("tabindex","0").bind("blur."+t+" keydown."+t+" keyup."+t,function(E){switch(E.type){case"blur":if(u.tweenRunning&&y.dir){z("off",null)}break;case"keydown":case"keyup":var B=E.keyCode?E.keyCode:E.which,C="on";if((r.axis!=="x"&&(B===38||B===40))||(r.axis!=="y"&&(B===37||B===39))){if(((B===38||B===40)&&!u.overflowed[0])||((B===37||B===39)&&!u.overflowed[1])){return}if(E.type==="keyup"){C="off"}if(!h(n.activeElement).is(w)){E.preventDefault();E.stopImmediatePropagation();z(C,B)}}else{if(B===33||B===34){if(u.overflowed[0]||u.overflowed[1]){E.preventDefault();E.stopImmediatePropagation()}if(E.type==="keyup"){g._stop(v);var D=B===34?-1:1;if(r.axis==="x"||(r.axis==="yx"&&u.overflowed[1]&&!u.overflowed[0])){var A="x",F=Math.abs(x[0].offsetLeft)-(D*(q.width()*0.9))}else{var A="y",F=Math.abs(x[0].offsetTop)-(D*(q.height()*0.9))}g._scrollTo(v,F.toString(),{dir:A,scrollEasing:"mcsEaseInOut"})}}else{if(B===35||B===36){if(!h(n.activeElement).is(w)){if(u.overflowed[0]||u.overflowed[1]){E.preventDefault();E.stopImmediatePropagation()}if(E.type==="keyup"){if(r.axis==="x"||(r.axis==="yx"&&u.overflowed[1]&&!u.overflowed[0])){var A="x",F=B===35?Math.abs(q.width()-x.outerWidth(false)):0}else{var A="y",F=B===35?Math.abs(q.height()-x.outerHeight(false)):0}g._scrollTo(v,F.toString(),{dir:A,scrollEasing:"mcsEaseInOut"})}}}}}break}function z(G,H){y.type=r.keyboard.scrollType;y.scrollAmount=r.snapAmount||r.keyboard.scrollAmount;if(y.type==="stepped"&&u.tweenRunning){return}g._sequentialScroll.call(this,v,G,H)}})},_sequentialScroll:function(s,v,t){var x=s.data(a),r=x.opt,z=x.sequential,y=h("#mCSB_"+x.idx+"_container"),q=z.type==="stepped"?true:false;switch(v){case"on":z.dir=[(t==="mCSB_buttonRight"||t==="mCSB_buttonLeft"||t===39||t===37?"x":"y"),(t==="mCSB_buttonUp"||t==="mCSB_buttonLeft"||t===38||t===37?-1:1)];g._stop(s);if(g._isNumeric(t)&&z.type==="stepped"){return}u(q);break;case"off":w();if(q||(x.tweenRunning&&z.dir)){u(true)}break}function u(A){var G=z.type!=="stepped",K=!A?1000/60:G?r.scrollInertia/1.5:r.scrollInertia,C=!A?2.5:G?7.5:40,J=[Math.abs(y[0].offsetTop),Math.abs(y[0].offsetLeft)],F=[x.scrollRatio.y>10?10:x.scrollRatio.y,x.scrollRatio.x>10?10:x.scrollRatio.x],D=z.dir[0]==="x"?J[1]+(z.dir[1]*(F[1]*C)):J[0]+(z.dir[1]*(F[0]*C)),I=z.dir[0]==="x"?J[1]+(z.dir[1]*parseInt(z.scrollAmount)):J[0]+(z.dir[1]*parseInt(z.scrollAmount)),H=z.scrollAmount!=="auto"?I:D,E=!A?"mcsLinear":G?"mcsLinearOut":"mcsEaseInOut",B=!A?false:true;if(A&&K<17){H=z.dir[0]==="x"?J[1]:J[0]}g._scrollTo(s,H.toString(),{dir:z.dir[0],scrollEasing:E,dur:K,onComplete:B});if(A){z.dir=false;return}clearTimeout(z.step);z.step=setTimeout(function(){u()},K)}function w(){clearTimeout(z.step);g._stop(s)}},_arr:function(s){var r=h(this).data(a).opt,q=[];if(typeof s==="function"){s=s()}if(!(s instanceof Array)){q[0]=s.y?s.y:s.x||r.axis==="x"?null:s;q[1]=s.x?s.x:s.y||r.axis==="y"?null:s}else{q=s.length>1?[s[0],s[1]]:r.axis==="x"?[null,s[0]]:[s[0],null]}if(typeof q[0]==="function"){q[0]=q[0]()}if(typeof q[1]==="function"){q[1]=q[1]()}return q},_to:function(v,w){if(v==null||typeof v=="undefined"){return}var C=h(this),B=C.data(a),u=B.opt,D=h("#mCSB_"+B.idx+"_container"),r=D.parent(),F=typeof v;if(!w){w=u.axis==="x"?"x":"y"}var q=w==="x"?D.outerWidth(false):D.outerHeight(false),x=w==="x"?D.offset().left:D.offset().top,E=w==="x"?D[0].offsetLeft:D[0].offsetTop,z=w==="x"?"left":"top";switch(F){case"function":return v();break;case"object":if(v.nodeType){var A=w==="x"?h(v).offset().left:h(v).offset().top}else{if(v.jquery){if(!v.length){return}var A=w==="x"?v.offset().left:v.offset().top}}return A-x;break;case"string":case"number":if(g._isNumeric.call(null,v)){return Math.abs(v)}else{if(v.indexOf("%")!==-1){return Math.abs(q*parseInt(v)/100)}else{if(v.indexOf("-=")!==-1){return Math.abs(E-parseInt(v.split("-=")[1]))}else{if(v.indexOf("+=")!==-1){var s=(E+parseInt(v.split("+=")[1]));return s>=0?0:Math.abs(s)}else{if(v.indexOf("px")!==-1&&g._isNumeric.call(null,v.split("px")[0])){return Math.abs(v.split("px")[0])}else{if(v==="top"||v==="left"){return 0}else{if(v==="bottom"){return Math.abs(r.height()-D.outerHeight(false))}else{if(v==="right"){return Math.abs(r.width()-D.outerWidth(false))}else{if(v==="first"||v==="last"){var y=D.find(":"+v),A=w==="x"?h(y).offset().left:h(y).offset().top;return A-x}else{if(h(v).length){var A=w==="x"?h(v).offset().left:h(v).offset().top;return A-x}else{D.css(z,v);b.update.call(null,C[0]);return}}}}}}}}}}break}},_autoUpdate:function(r){var u=h(this),G=u.data(a),A=G.opt,w=h("#mCSB_"+G.idx+"_container");if(r){clearTimeout(w[0].autoUpdate);g._delete.call(null,w[0].autoUpdate);return}var t=w.parent(),q=[h("#mCSB_"+G.idx+"_scrollbar_vertical"),h("#mCSB_"+G.idx+"_scrollbar_horizontal")],E=function(){return[q[0].is(":visible")?q[0].outerHeight(true):0,q[1].is(":visible")?q[1].outerWidth(true):0]},F=z(),y,v=[w.outerHeight(false),w.outerWidth(false),t.height(),t.width(),E()[0],E()[1]],I,C=H(),x;D();function D(){clearTimeout(w[0].autoUpdate);w[0].autoUpdate=setTimeout(function(){if(A.advanced.updateOnSelectorChange){y=z();if(y!==F){s();F=y;return}}if(A.advanced.updateOnContentResize){I=[w.outerHeight(false),w.outerWidth(false),t.height(),t.width(),E()[0],E()[1]];if(I[0]!==v[0]||I[1]!==v[1]||I[2]!==v[2]||I[3]!==v[3]||I[4]!==v[4]||I[5]!==v[5]){s();v=I}}if(A.advanced.updateOnImageLoad){x=H();if(x!==C){w.find("img").each(function(){B(this.src)});C=x}}if(A.advanced.updateOnSelectorChange||A.advanced.updateOnContentResize||A.advanced.updateOnImageLoad){D()}},60)}function H(){var J=0;if(A.advanced.updateOnImageLoad){J=w.find("img").length}return J}function B(M){var J=new Image();function L(N,O){return function(){return O.apply(N,arguments)}}function K(){this.onload=null;s()}J.onload=L(J,K);J.src=M}function z(){if(A.advanced.updateOnSelectorChange===true){A.advanced.updateOnSelectorChange="*"}var J=0,K=w.find(A.advanced.updateOnSelectorChange);if(A.advanced.updateOnSelectorChange&&K.length>0){K.each(function(){J+=h(this).height()+h(this).width()})}return J}function s(){clearTimeout(w[0].autoUpdate);b.update.call(null,u[0])}},_snapAmount:function(s,q,r){return(Math.round(s/q)*q-r)},_stop:function(q){var s=q.data(a),r=h("#mCSB_"+s.idx+"_container,#mCSB_"+s.idx+"_container_wrapper,#mCSB_"+s.idx+"_dragger_vertical,#mCSB_"+s.idx+"_dragger_horizontal");r.each(function(){g._stopTween.call(this)})},_scrollTo:function(r,t,v){var J=r.data(a),F=J.opt,E={trigger:"internal",dir:"y",scrollEasing:"mcsEaseOut",drag:false,dur:F.scrollInertia,overwrite:"all",callbacks:true,onStart:true,onUpdate:true,onComplete:true},v=h.extend(E,v),H=[v.dur,(v.drag?0:v.dur)],w=h("#mCSB_"+J.idx),C=h("#mCSB_"+J.idx+"_container"),L=F.callbacks.onTotalScrollOffset?g._arr.call(r,F.callbacks.onTotalScrollOffset):[0,0],q=F.callbacks.onTotalScrollBackOffset?g._arr.call(r,F.callbacks.onTotalScrollBackOffset):[0,0];J.trigger=v.trigger;if(F.snapAmount){t=g._snapAmount(t,F.snapAmount,F.snapOffset)}switch(v.dir){case"x":var y=h("#mCSB_"+J.idx+"_dragger_horizontal"),A="left",D=C[0].offsetLeft,I=[w.width()-C.outerWidth(false),y.parent().width()-y.width()],s=[t,(t/J.scrollRatio.x)],M=L[1],K=q[1],B=M>0?M/J.scrollRatio.x:0,x=K>0?K/J.scrollRatio.x:0;break;case"y":var y=h("#mCSB_"+J.idx+"_dragger_vertical"),A="top",D=C[0].offsetTop,I=[w.height()-C.outerHeight(false),y.parent().height()-y.height()],s=[t,(t/J.scrollRatio.y)],M=L[0],K=q[0],B=M>0?M/J.scrollRatio.y:0,x=K>0?K/J.scrollRatio.y:0;break}if(s[1]<0){s=[0,0]}else{if(s[1]>=I[1]){s=[I[0],I[1]]}else{s[0]=-s[0]}}clearTimeout(C[0].onCompleteTimeout);if(!J.tweenRunning&&((D===0&&s[0]>=0)||(D===I[0]&&s[0]<=I[0]))){return}g._tweenTo.call(null,y[0],A,Math.round(s[1]),H[1],v.scrollEasing);g._tweenTo.call(null,C[0],A,Math.round(s[0]),H[0],v.scrollEasing,v.overwrite,{onStart:function(){if(v.callbacks&&v.onStart&&!J.tweenRunning){if(u("onScrollStart")){G();F.callbacks.onScrollStart.call(r[0])}J.tweenRunning=true;g._onDragClasses(y);J.cbOffsets=z()}},onUpdate:function(){if(v.callbacks&&v.onUpdate){if(u("whileScrolling")){G();F.callbacks.whileScrolling.call(r[0])}}},onComplete:function(){if(v.callbacks&&v.onComplete){if(F.axis==="yx"){clearTimeout(C[0].onCompleteTimeout)}var N=C[0].idleTimer||0;C[0].onCompleteTimeout=setTimeout(function(){if(u("onScroll")){G();F.callbacks.onScroll.call(r[0])}if(u("onTotalScroll")&&s[1]>=I[1]-B&&J.cbOffsets[0]){G();F.callbacks.onTotalScroll.call(r[0])}if(u("onTotalScrollBack")&&s[1]<=x&&J.cbOffsets[1]){G();F.callbacks.onTotalScrollBack.call(r[0])}J.tweenRunning=false;C[0].idleTimer=0;g._onDragClasses(y,"hide")},N)}}});function u(N){return J&&F.callbacks[N]&&typeof F.callbacks[N]==="function"}function z(){return[F.callbacks.alwaysTriggerOffsets||D>=I[0]+M,F.callbacks.alwaysTriggerOffsets||D<=-K]}function G(){var P=[C[0].offsetTop,C[0].offsetLeft],Q=[y[0].offsetTop,y[0].offsetLeft],N=[C.outerHeight(false),C.outerWidth(false)],O=[w.height(),w.width()];r[0].mcs={content:C,top:P[0],left:P[1],draggerTop:Q[0],draggerLeft:Q[1],topPct:Math.round((100*Math.abs(P[0]))/(Math.abs(N[0])-O[0])),leftPct:Math.round((100*Math.abs(P[1]))/(Math.abs(N[1])-O[1])),direction:v.dir}}},_tweenTo:function(s,v,t,r,B,u,K){var K=K||{},H=K.onStart||function(){},C=K.onUpdate||function(){},I=K.onComplete||function(){},A=g._getTime(),y,w=0,E=s.offsetTop,F=s.style;if(v==="left"){E=s.offsetLeft}var z=t-E;s._mcsstop=0;if(u!=="none"){D()}q();function J(){if(s._mcsstop){return}if(!w){H.call()}w=g._getTime()-A;G();if(w>=s._mcstime){s._mcstime=(w>s._mcstime)?w+y-(w-s._mcstime):w+y-1;if(s._mcstime<w+1){s._mcstime=w+1}}if(s._mcstime<r){s._mcsid=_request(J)}else{I.call()}}function G(){if(r>0){s._mcscurrVal=x(s._mcstime,E,z,r,B);F[v]=Math.round(s._mcscurrVal)+"px"}else{F[v]=t+"px"}C.call()}function q(){y=1000/60;s._mcstime=w+y;_request=(!m.requestAnimationFrame)?function(L){G();return setTimeout(L,0.01)}:m.requestAnimationFrame;s._mcsid=_request(J)}function D(){if(s._mcsid==null){return}if(!m.requestAnimationFrame){clearTimeout(s._mcsid)}else{m.cancelAnimationFrame(s._mcsid)}s._mcsid=null}function x(N,M,R,Q,O){switch(O){case"linear":case"mcsLinear":return R*N/Q+M;break;case"mcsLinearOut":N/=Q;N--;return R*Math.sqrt(1-N*N)+M;break;case"easeInOutSmooth":N/=Q/2;if(N<1){return R/2*N*N+M}N--;return -R/2*(N*(N-2)-1)+M;break;case"easeInOutStrong":N/=Q/2;if(N<1){return R/2*Math.pow(2,10*(N-1))+M}N--;return R/2*(-Math.pow(2,-10*N)+2)+M;break;case"easeInOut":case"mcsEaseInOut":N/=Q/2;if(N<1){return R/2*N*N*N+M}N-=2;return R/2*(N*N*N+2)+M;break;case"easeOutSmooth":N/=Q;N--;return -R*(N*N*N*N-1)+M;break;case"easeOutStrong":return R*(-Math.pow(2,-10*N/Q)+1)+M;break;case"easeOut":case"mcsEaseOut":default:var P=(N/=Q)*N,L=P*N;return M+R*(0.499999999999997*L*P+-2.5*P*P+5.5*L+-6.5*P+4*N)}}},_getTime:function(){if(m.performance&&m.performance.now){return m.performance.now()}else{if(m.performance&&m.performance.webkitNow){return m.performance.webkitNow()}else{if(Date.now){return Date.now()}else{return new Date().getTime()}}}},_stopTween:function(){var q=this;if(q._mcsid==null){return}if(!m.requestAnimationFrame){clearTimeout(q._mcsid)}else{m.cancelAnimationFrame(q._mcsid)}q._mcsid=null;q._mcsstop=1},_delete:function(r){try{delete r}catch(q){r=null}},_mouseBtnLeft:function(q){return !(q.which&&q.which!==1)},_pointerTouch:function(r){var q=r.originalEvent.pointerType;return !(q&&q!=="touch"&&q!==2)},_isNumeric:function(q){return !isNaN(parseFloat(q))&&isFinite(q)}};var i=("https:"==n.location.protocol)?"https:":"http:";h.fn[e]=function(q){if(b[q]){return b[q].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof q==="object"||!q){return b.init.apply(this,arguments)}else{h.error("Method "+q+" does not exist")}}};h[e]=function(q){if(b[q]){return b[q].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof q==="object"||!q){return b.init.apply(this,arguments)}else{h.error("Method "+q+" does not exist")}}};h[e].defaults=f;m[e]=true;h(m).load(function(){h(l)[e]()})})(jQuery,window,document);
40,148.88
953,939
0.685602
6f9a5578f2b448977c0f7f0943fb08e686180e02
1,016
js
JavaScript
src/rooms-data.js
MAbdurahman/react-beachwalk-resort
418cfa0c559ffc3ba70946580f198f822c2fa82f
[ "MIT" ]
1
2021-02-28T16:47:17.000Z
2021-02-28T16:47:17.000Z
src/rooms-data.js
MAbdurahman/react-beachwalk-resort
418cfa0c559ffc3ba70946580f198f822c2fa82f
[ "MIT" ]
null
null
null
src/rooms-data.js
MAbdurahman/react-beachwalk-resort
418cfa0c559ffc3ba70946580f198f822c2fa82f
[ "MIT" ]
null
null
null
// import room1 from '../../images/room1.jpeg'; import room1 from '../src/img/room1.jpeg'; import room2 from '../src/img/room2.jpeg'; import room3 from '../src/img/room3.jpeg'; import room4 from '../src/img/room4.jpg'; export default [ { id: 1, img: room1, title: 'basic economy', info: 'Lorem ipsum dolor sit amet consectetur, adipisicing elit. Est quisquam corrupti dicta tempora sequi sapiente!', price: 125, }, { id: 2, img: room2, title: 'presidential suite', info: 'Lorem ipsum dolor sit amet consectetur, adipisicing elit. Est quisquam corrupti dicta tempora sequi sapiente!', price: 250, }, { id: 3, img: room3, title: 'queen suite', info: 'Lorem ipsum dolor sit amet consectetur, adipisicing elit. Est quisquam corrupti dicta tempora sequi sapiente!', price: 375, }, { id: 4, img: room4, title: 'king suite', info: 'Lorem ipsum dolor sit amet consectetur, adipisicing elit. Est quisquam corrupti dicta tempora sequi sapiente!', price: 475, }, ];
24.780488
115
0.679134
6f9a8134f0043b06835d22f0dba0ec383d622067
1,141
js
JavaScript
src/echartsContainer.js
tyleung/openlab-hsbc
7551c8274db02ec595494b1f191197de256b83c0
[ "Apache-2.0" ]
2
2019-03-10T02:04:31.000Z
2019-05-14T10:57:30.000Z
src/echartsContainer.js
tyleung/openlab-hsbc
7551c8274db02ec595494b1f191197de256b83c0
[ "Apache-2.0" ]
null
null
null
src/echartsContainer.js
tyleung/openlab-hsbc
7551c8274db02ec595494b1f191197de256b83c0
[ "Apache-2.0" ]
null
null
null
import React, { Component } from 'react'; import ReactEcharts from 'echarts-for-react'; export class EchartsContainer1 extends Component { render() { const option = { title: { text: 'chart for age distribution', left: 'center', textStyle: { color: '#111', fontStyle: 'normal', fontWeight: 'bold', fontFamily: 'sans-serif', fontSize: 22 } }, xAxis: { type: 'category', data: [ '[0, 10)', '[21, 30)', '[15, 21)', '[10, 15)', '[30, 35)', '[35, 100)' ] }, yAxis: { type: 'value' }, series: [ { data: [2578, 2249, 1603, 1293, 1222, 1055], type: 'bar' } ] }; return <ReactEcharts option={option} />; } } export class EchartsContainerRealTime extends Component { render() { return <ReactEcharts option={this.props.option} />; } } export class EchartsContainerAreaInfo extends Component { render() { return <ReactEcharts option={this.props.option} />; } }
21.12963
57
0.496056
6f9acd20d554e6fb8958e5721814515dd86df692
161
js
JavaScript
test/html/a/a.js
PirateD311/PirateCMS
900ef1d0eaa33ae5ca8734934d3ff4cd1525e107
[ "MIT" ]
1
2018-10-25T04:06:08.000Z
2018-10-25T04:06:08.000Z
test/html/a/a.js
PirateD311/PirateCMS
900ef1d0eaa33ae5ca8734934d3ff4cd1525e107
[ "MIT" ]
null
null
null
test/html/a/a.js
PirateD311/PirateCMS
900ef1d0eaa33ae5ca8734934d3ff4cd1525e107
[ "MIT" ]
null
null
null
let fs = require('fs'), cheerio = require('cheerio') let html = fs.readFileSync('./aim.html'), $ = cheerio.load(html) console.log($('#icontent').text())
26.833333
41
0.621118
6f9add588f04a9f3ab3ecfc0630fa3d41ed21803
1,758
js
JavaScript
tests/PlayboardManagerCompanies.js.spec.js
Heinrich-Barth/sit-down-and-play
1df6785c62a03cdc8b56d6887a51a80f80177e61
[ "MIT" ]
2
2021-07-29T02:12:04.000Z
2022-01-24T21:01:51.000Z
tests/PlayboardManagerCompanies.js.spec.js
Heinrich-Barth/sit-down-and-play
1df6785c62a03cdc8b56d6887a51a80f80177e61
[ "MIT" ]
5
2022-02-28T08:14:37.000Z
2022-02-28T08:49:44.000Z
tests/PlayboardManagerCompanies.js.spec.js
Heinrich-Barth/sit-down-and-play
1df6785c62a03cdc8b56d6887a51a80f80177e61
[ "MIT" ]
null
null
null
const PlayboardManagerCompanies = require("../game-server/PlayboardManagerCompanies"); describe('PlayboardManagerCompanies', () => { it("createNewCompany", () => { const instance = new PlayboardManagerCompanies([], {}, {}, false); const companyId = "c1"; const playerId = "p1"; const pCharacter = "ppp"; const startingLocation = "s1"; const pCompany = instance.createNewCompany(companyId, playerId, pCharacter, startingLocation) expect(pCompany.id).toEqual(companyId); expect(pCompany.playerId).toEqual(playerId); expect(pCompany.characters.length).toEqual(1); expect(pCompany.characters.includes(pCharacter)).toEqual(true); expect(pCompany.sites.current).toEqual(startingLocation); expect(pCompany.sites.target).toEqual(""); expect(pCompany.sites.regions.length).toEqual(0); expect(pCompany.sites.attached.length).toEqual(0); }); it("createNewCompanyWithCharacter", () => { const instance = new PlayboardManagerCompanies([], {}, {}, false); const hostUuid = "uu1"; const companyId = "c1"; const playerId = "p1"; const startingLocation = "s1"; const pCompany = instance.createNewCompanyWithCharacter(companyId, playerId, hostUuid, ["a1","a2"], startingLocation) expect(pCompany.id).toEqual(companyId); expect(pCompany.playerId).toEqual(playerId); expect(pCompany.characters.length).toEqual(1); expect(pCompany.sites.current).toEqual(startingLocation); expect(pCompany.sites.target).toEqual(""); expect(pCompany.sites.regions.length).toEqual(0); expect(pCompany.sites.attached.length).toEqual(0); }); });
39.066667
125
0.656428
6f9b3f46f1f1340777bc977c53985846d284b3ca
687
js
JavaScript
src/core_plugins/input_control_vis/public/lineage/parent_candidates.js
chandlerprall/kibana
7c784db2f18ef9cbc758c1d5959fbcd345e56fb0
[ "Apache-2.0" ]
2
2016-12-17T07:34:09.000Z
2021-08-25T16:38:27.000Z
src/core_plugins/input_control_vis/public/lineage/parent_candidates.js
chandlerprall/kibana
7c784db2f18ef9cbc758c1d5959fbcd345e56fb0
[ "Apache-2.0" ]
null
null
null
src/core_plugins/input_control_vis/public/lineage/parent_candidates.js
chandlerprall/kibana
7c784db2f18ef9cbc758c1d5959fbcd345e56fb0
[ "Apache-2.0" ]
1
2020-11-04T07:06:39.000Z
2020-11-04T07:06:39.000Z
import { getTitle } from '../editor_utils'; export function getParentCandidates(controlParamsList, controlId, lineageMap) { return controlParamsList.filter((controlParams) => { // Ignore controls that do not have index pattern and field set if (!controlParams.indexPattern || !controlParams.fieldName) { return false; } // Ignore controls that would create a circlar graph const lineage = lineageMap.get(controlParams.id); if (lineage.includes(controlId)) { return false; } return true; }).map((controlParams, controlIndex) => { return { value: controlParams.id, text: getTitle(controlParams, controlIndex) }; }); }
31.227273
79
0.68559
6f9c5fb50a58808df01241d3fc0a349a04d741ee
7,373
js
JavaScript
src/common/interceptors/loadingHandler/loadingHandler.js
amobbs/plog
0282a164b2d05e33c53dd8cd63580bf639256270
[ "MIT" ]
null
null
null
src/common/interceptors/loadingHandler/loadingHandler.js
amobbs/plog
0282a164b2d05e33c53dd8cd63580bf639256270
[ "MIT" ]
null
null
null
src/common/interceptors/loadingHandler/loadingHandler.js
amobbs/plog
0282a164b2d05e33c53dd8cd63580bf639256270
[ "MIT" ]
null
null
null
/** * Loading Handler * Count requests/responses. When there are active requests, start a timer. * If the timer goes above X seconds, send a broadcast for (loadingHandler.loading", true) (show dialog) * When the requests are completed, wait X milliseconds. * After X milliseconds, if there are no more requests, send a broadcast for (loadingHandler.loading", false) (close dialog) */ angular.module('loadingHandler', []) /** * LOADING_MIN_THRESHOLD: Minimum duration that must pass before the loading message is displayed * LOADING_MIN_DISPLAY_DURATION: Minimum time the loading message must be shown for. Prevents "flashes" of the loading screen. * LOADING_EXIT_GRACE: Grace period for Loading dialog dismissal. Prevents sequential requests resulting in the dialog being cleared. * * @integer - milliseconds */ .constant('LOADING_ENTRY_GRACE', 1000) // 1s .constant('LOADING_MIN_DISPLAY_DURATION', 1000) // 1s .constant('LOADING_EXIT_GRACE', 100)// 0.2s /** * Request handler */ .config(function($httpProvider, LOADING_ENTRY_GRACE, LOADING_MIN_DISPLAY_DURATION, LOADING_EXIT_GRACE) { var loading = false, // Loading process active? loadingDisplayed = false, // Loading panel visible? loadingGrace = false, // Grace period for dialog still active? numberOfRequests = 0, // Request # tracker entryTimer, // Timer for pending display graceTimer, // Timer for grace period; loader must be open for this period exitTimer, // Timer for pending hide /** * Increst requests * @param $rootScope * @param $timeout */ increaseRequest = function($rootScope, $timeout) { numberOfRequests++; // Only instigate the timer if if (!loading) { loading = true; // If visible if (!loadingDisplayed) { // Timer for entry activity entryTimer = $timeout(function() { // Mark as displayed, and grace period active. loadingDisplayed = true; loadingGrace = true; // Broadcast $rootScope.$broadcast('loadingHandler.loading', loading); // Instigate Exit Timer // Hide the dialog after grace period, if no longer loading. graceTimer = $timeout(function() { // Clear this timer loadingGrace = false; // If the dialog should be cleared (no load pending) if (!loading) { hideLoadingDialog($rootScope, $timeout); } }, LOADING_MIN_DISPLAY_DURATION); }, LOADING_ENTRY_GRACE); } } }, /** * Decrease requests until empty. * @param $rootScope * @param $timeout */ decreaseRequest = function($rootScope, $timeout) { if (loading) { numberOfRequests--; if (numberOfRequests === 0) { // cancel loader loading = false; // Clear loading timer if present $timeout.cancel(entryTimer); // If the dialog is still visible if (loadingDisplayed) { // If the grace period has passed already if (!loadingGrace) { // Clear loader hideLoadingDialog($rootScope, $timeout); } } } } }; /** * Hide the loading dialog * - Instigates a timer with a grace period. When grace passes, loader will be cleared. * @param $rootScope * @param $timeout */ hideLoadingDialog = function( $rootScope, $timeout ) { // Restart the timer $timeout.cancel(exitTimer); // Create timer exitTimer = $timeout(function() { // If the dialog should be cleared (no load pending) if (!loading) { // Hide display loadingDisplayed = false; $rootScope.$broadcast('loadingHandler.loading', loading); } }, LOADING_EXIT_GRACE); }; /** * Test for if the Loader should be executed for this url * Specify regex here for URLS you wish to exclude from the global loader. */ allowRequest = function (url) { var found = 0; found += RegExp('dashboards/[a-zA-Z0-9]+/widgets/[a-zA-Z0-9]+$').test(url); found += RegExp('search$').test(url); return !found; }; /** * HTTP Interceptor * - Add count of HTTP activity when a request is commenced * - Remove count of HTTP activity when a request completes or fails. * Note: $timeout is passed as it's unavailable where the functions are defined. */ $httpProvider.interceptors.push(['$q', '$rootScope', '$timeout', function($q, $rootScope, $timeout) { return { 'request': function(config) { if (allowRequest(config.url)) { increaseRequest($rootScope, $timeout); } return config || $q.when(config); }, 'requestError': function(rejection) { if (allowRequest(rejection.url)) { decreaseRequest($rootScope, $timeout); } return $q.reject(rejection); }, 'response': function(response) { if (allowRequest(response.url)) { decreaseRequest($rootScope, $timeout); } return response || $q.when(response); }, 'responseError': function(rejection) { if (allowRequest(rejection.url)) { decreaseRequest($rootScope, $timeout); } return $q.reject(rejection); } }; }]); }) ;
37.426396
137
0.448122
6f9def4644e18a981bdcb12c79c7014722b7328f
794
js
JavaScript
config/scripts/helpers.js
mahcr/frontend-starter
327149f2316700cbe39944990bb562288c9f2657
[ "MIT" ]
null
null
null
config/scripts/helpers.js
mahcr/frontend-starter
327149f2316700cbe39944990bb562288c9f2657
[ "MIT" ]
null
null
null
config/scripts/helpers.js
mahcr/frontend-starter
327149f2316700cbe39944990bb562288c9f2657
[ "MIT" ]
null
null
null
'use strict'; import path from 'path'; import fs from 'fs'; const _root = path.resolve(__dirname, '..'); export function root(args) { args = Array.prototype.slice.call(arguments, 0); return path.join.apply(path, [_root].concat(args)); } /** * Get subdirectories names */ // export const getFolders = (src) => fs.readdirSync(src).filter(file => fs.statSync(path.join(src, file)).isDirectory()); // const srcPages = './src/app/pages'; // const src = 'src'; /** * Get Obj with pages * TODO: refactor */ // export const getEntries = () => { // const folders = getFolders(srcPages), // pages = {}; // folders.map((v) => { // pages[v] = `${ srcPages }/${ v }/${ v }.js`; // }); // pages.main = './src/main.js'; // console.log(pages); // return pages; // };
20.894737
122
0.588161
6f9f1c2768dbeae2e521f7fdb0832a4ee58c8a5b
136
js
JavaScript
src/Store/GlobalStore.js
greatvivek11/react-global-state
969e4ac8a2300703190dd5bbc69bfe49c93bdf9f
[ "MIT" ]
null
null
null
src/Store/GlobalStore.js
greatvivek11/react-global-state
969e4ac8a2300703190dd5bbc69bfe49c93bdf9f
[ "MIT" ]
null
null
null
src/Store/GlobalStore.js
greatvivek11/react-global-state
969e4ac8a2300703190dd5bbc69bfe49c93bdf9f
[ "MIT" ]
null
null
null
import { useContext } from "react"; import {Context} from './Context'; export const useStore = () => { return useContext(Context); };
22.666667
35
0.669118