diff --git a/.coverage b/.coverage deleted file mode 100644 index a209ff4..0000000 --- a/.coverage +++ /dev/null @@ -1 +0,0 @@ -!coverage.py: This is a private format, don't read it directly!{"runs": [{"brief_sys": "CPython 2.7.11 Darwin"}], "lines": {"/Users/akusok/Dropbox/Documents/X-ELM/hpelm/hpelm/modules/rbf_param.py": [8, 9, 10, 13, 6], "/Users/akusok/Dropbox/Documents/X-ELM/hpelm/hpelm/modules/mrsr2.py": [16, 19, 12, 14, 15], "/Users/akusok/Dropbox/Documents/X-ELM/hpelm/hpelm/modules/hdf5_tools.py": [164, 6, 8, 9, 10, 11, 77, 14, 145, 184], "/Users/akusok/Dropbox/Documents/X-ELM/hpelm/hpelm/elm.py": [512, 514, 6, 8, 9, 10, 11, 12, 13, 14, 15, 18, 45, 47, 48, 49, 50, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, 67, 68, 69, 73, 74, 75, 76, 77, 79, 80, 81, 82, 83, 84, 85, 87, 114, 115, 116, 119, 122, 123, 124, 125, 128, 129, 130, 134, 135, 142, 147, 149, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 168, 169, 171, 173, 175, 177, 181, 182, 184, 198, 199, 202, 203, 204, 206, 207, 208, 209, 210, 212, 233, 234, 236, 237, 240, 241, 242, 243, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 259, 260, 263, 265, 279, 280, 281, 283, 326, 335, 336, 337, 339, 348, 349, 350, 352, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 377, 385, 386, 387, 388, 389, 390, 391, 392, 393, 396, 397, 398, 399, 400, 401, 403, 405, 408, 413, 414, 416, 424, 427, 447, 448, 450, 470, 473, 474, 485, 486, 487, 488, 489, 490, 492, 493, 504, 505, 506, 507, 508, 509, 511], "/Users/akusok/Dropbox/Documents/X-ELM/hpelm/hpelm/tests/__init__.py": [6], "/Users/akusok/Dropbox/Documents/X-ELM/hpelm/hpelm/nnets/__init__.py": [8, 6], "/Users/akusok/Dropbox/Documents/X-ELM/hpelm/hpelm/mss_v.py": [8, 11, 6], "/Users/akusok/Dropbox/Documents/X-ELM/hpelm/hpelm/modules/mrsr.py": [48, 43, 45], "/Users/akusok/Dropbox/Documents/X-ELM/hpelm/hpelm/tests/test_correctness.py": [6, 8, 9, 10, 11, 12, 15, 17, 18, 19, 20, 21, 22, 24, 25, 26, 27, 28, 29, 31, 32, 33, 34, 35, 36, 38, 45, 46, 47, 48, 49, 50, 52, 53, 54, 55, 56, 57, 59, 60, 61, 62, 63, 64, 66, 67, 68, 69, 70, 71, 73, 74, 75, 76, 77, 79, 80, 81, 82, 83, 85, 86, 87, 88, 90, 91, 92, 93, 95, 96, 97, 98, 100, 101, 102, 103, 105, 106, 107, 108, 110, 111, 112, 113, 115, 116, 117, 118, 120, 121, 122, 123, 125, 126, 127, 128, 129, 131, 132, 133, 134, 135, 136, 137, 138, 140, 141, 142, 143, 144, 145, 147, 148, 149, 150, 151, 153, 154, 155, 156, 157, 159, 160, 161, 162, 163, 164, 165, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 178, 179, 180, 181, 183, 184, 185, 186, 187, 188, 190, 191, 192, 194, 195, 196, 197, 198, 199, 200, 202, 203, 204, 205, 206, 207, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 220, 221, 222, 223, 224, 225, 227, 228, 229, 230, 231, 232, 234, 235, 236, 237, 238, 239, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 252, 253, 254, 255, 256, 257, 259, 260, 261, 262, 263, 264, 266, 267, 268, 269, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 313, 314, 315, 316, 317, 319, 321, 322, 323, 324, 325, 327], "/Users/akusok/Dropbox/Documents/X-ELM/hpelm/hpelm/nnets/slfn.py": [172, 131, 132, 86, 6, 135, 8, 9, 10, 11, 140, 141, 14, 143, 144, 146, 171, 47, 133, 161, 91, 164, 134, 38, 40, 43, 44, 45, 46, 175, 49, 50, 51, 52, 53, 138, 56, 57, 58, 59, 60, 61, 62, 64, 139, 200, 203, 205, 173, 210, 211, 212, 214, 87, 89, 90, 219, 92, 93, 94, 101, 97, 98, 99, 166, 233, 107, 108, 109, 111, 136, 114, 115, 116, 118, 121, 122, 123, 124, 126], "/Users/akusok/Dropbox/Documents/X-ELM/hpelm/hpelm/mss_loo.py": [8, 9, 12, 6], "/Users/akusok/Dropbox/Documents/X-ELM/hpelm/hpelm/mss_cv.py": [8, 11, 6], "/Users/akusok/Dropbox/Documents/X-ELM/hpelm/hpelm/__init__.py": [8, 9, 5, 7], "/Users/akusok/Dropbox/Documents/X-ELM/hpelm/hpelm/hp_elm.py": [326, 118, 6, 8, 9, 107, 12, 13, 14, 15, 157, 18, 211, 20, 462, 22, 79, 93, 254, 415], "/Users/akusok/Dropbox/Documents/X-ELM/hpelm/hpelm/modules/__init__.py": [8, 9, 10, 11, 6]}} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 5365995..dcbe863 100755 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,8 @@ /try/ # HTML documentation -/docs/_build +_build/ +_build # Python egg metadata, regenerated from source files by setuptools /*.egg-info diff --git a/.idea/.name b/.idea/.name deleted file mode 100644 index ae38688..0000000 --- a/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -hpelm \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml deleted file mode 100644 index 97626ba..0000000 --- a/.idea/encodings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/hpelm.iml b/.idea/hpelm.iml deleted file mode 100644 index 9eedade..0000000 --- a/.idea/hpelm.iml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 9cc9d75..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index ee06289..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index dffbaee..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,1738 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1452164411573 - - - 1452522143258 - - - 1452768472331 - - - 1452777152162 - - - 1452859585184 - - - 1452869820802 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.pypirc b/.pypirc deleted file mode 100644 index 94c2fd9..0000000 --- a/.pypirc +++ /dev/null @@ -1,14 +0,0 @@ -[distutils] -index-servers= - pypi - pypitest - -[pypitest] -repository = https://testpypi.python.org/pypi -username = akusoka1 -password = sonne32432 - -[pypi] -repository = https://pypi.python.org/pypi -username = akusoka1 -password = sonne32432 diff --git a/CHANGELOG.md b/CHANGELOG.md index 233b17a..d36191c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log All changes to 'hpelm' toolbox will be documented in this file. +## [1.0.1] - 21-01-2016 +### New +- Major toolbox update +- Support for Nvidia GPU with Scikit-CUDA, no compilation needed + ## [0.6.13] - 18-08-2015 ### Fixed - Fixed a bug (typo) which caused HPELM to skip the last batch of data in training/predicting/etc. diff --git a/MANIFEST.in b/MANIFEST.in index 13af1dc..063cd54 100755 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,2 @@ include README.rst include CHANGELOG.md -include acc/gpu_code.cpp acc/gpu_code.h acc/gpu_solver.pyx \ No newline at end of file diff --git a/dataset_tests/andrey.py~ b/dataset_tests/andrey.py~ deleted file mode 100644 index 0780cf2..0000000 --- a/dataset_tests/andrey.py~ +++ /dev/null @@ -1,60 +0,0 @@ -# -*- coding: utf-8 -*- -""" -Created on Tue Apr 14 20:15:12 2015 - -@author: akusok -""" - -import numpy as np -import os -import hpelm -import cPickle -import sys -from time import time - - -def elm(folder, i, nn): - # get file names - Xtr = np.load(os.path.join(folder, "xtrain_%d.npy" % (i + 1))) - Xts = np.load(os.path.join(folder, "xtest_%d.npy" % (i + 1))) - Ttr = np.load(os.path.join(folder, "ytrain_%d.npy" % (i + 1))) - Tts = np.load(os.path.join(folder, "ytest_%d.npy" % (i + 1))) - print Xtr.shape - - # build ELM - elm = hpelm.ELM(Xtr.shape[1], Ttr.shape[1]) - elm.add_neurons(1, "sigm") - errs = [] - for _ in xrange(nn-1): - elm.add_neurons(1, "sigm") - elm.train(Xtr, Ttr, "c", "loo") - - H = elm.solver.project(Xtr) - HH, HT = elm.solver.get_batch(Xtr, Ttr) - N = Xtr.shape[0] - - P = np.linalg.inv(HH) - Bt = np.dot(P, HT) - R = np.ones((N,)) - np.einsum('ij,ji->i', np.dot(H, P), H.T) - Y = np.dot(H, Bt) - errs.append(elm._error(Y, Ttr, R)) - - return errs - - -def trainer(): - f1 = "/home/akusok/Dropbox/Documents/X-ELM/hpelm/dataset_tests/Classification-Iris" - nn = 20 - from matplotlib import pyplot - for j in range(10): - errs = np.array(elm(f1, j, nn)) - pyplot.plot(range(len(errs)), errs) - - pyplot.show() - - -if __name__ == "__main__": - trainer() - - - diff --git a/develop/XXXXhpelm.py b/develop/XXXXhpelm.py index 730cffd..98adb68 100644 --- a/develop/XXXXhpelm.py +++ b/develop/XXXXhpelm.py @@ -1,310 +1,310 @@ -# -*- coding: utf-8 -*- -""" -Created on Mon Oct 27 17:48:33 2014 - -@author: akusok -""" - -import numpy as np - -from nnet import SLFN - - -class HPELM(SLFN): - """High performance GPU and parallel Extreme Learning Machine. - """ - - # inherited def __init__(self, inputs, outputs): - # inherited def _checkdata(self, X, T): - # inherited def add_neurons(self, number, func, W=None, B=None): - # inherited def project(self, X): - # inherited def predict(self, X): - # inherited def save(self, model): - # inherited def load(self, model): - - def __init__(self, X, T, *args, **kvargs): - """Universal contructor of ELM model with model structure selection. - - :param X: input data matrix - :param T: target data matrix - :param Xmean: vector of mean value of X for normalization !!! hpelm - :param Xstd: vector of srd of X for normalization !!! hpelm - - Model structure selection (exclusive, choose one) - :param "V": use validation set - :param "CV": use cross-validation - :param "MCCV": use Monte-Carlo cross-validation - :param "LOO": use leave-one-out validation - - Additional validation parameters - :param Xv: validation data X ("V") - :param Tv: validation targets T ("V") - :param k: number of splits ("CV", "MCCV") - :param n: number of repetitions ("MCCV") - - Ranking of hidden neurons - :param "HQ": use Hannan-Quinn criterion - # no OP-ELM - - System setup - :param "classification"/"c": build ELM for classification - :param "multiclass"/"mc": build ELM for multiclass classification - :param "adaptive"/"ad": build adaptive ELM for non-stationary model - :param "batch": batch size for adaptive ELM (sliding window step size) - - """ - - print X.shape - print T.shape - print "start args" - for arg in args: - print arg - print "start kvargs" - for kv, arg in kvargs.items(): - print kv, arg - print "end (kv)args" - - N, inputs = X.shape - _, targets = T.shape - super(ELM, self).__init__(inputs, targets) - - def train(self, X, T): - """Learn a model to project inputs X to targets T. - - :param X: - matrix of inputs - :param T: - matrix of targets - """ - assert len(self.neurons) > 0, "Add neurons before training ELM" - X, T = self._checkdata(X, T) - H = self.project(X) - self.Beta = np.linalg.pinv(H).dot(T) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ''' COPY OF OLD PRUNING METHODS - def prune_op(self, X, T, batch=10000, delimiter=" "): - """Prune ELM as in OP-ELM paper. - """ - # get data iterators - genX, self.inputs, N = batchX(X, batch, delimiter) - genT, self.targets = batchT(T, batch, delimiter, self.C_dict) - - # project data - nn = len(self.ufunc) - delta = 0.95 # improvement of MSE for adding more neurons - nfeats = [] - neurons = np.zeros((nn,)) - for X1,T1 in zip(genX, genT): - - # get hidden layer outputs - H = np.dot(X1,self.W) - for i in xrange(H.shape[1]): - H[:,i] = self.ufunc[i](H[:,i]) - H,T1 = semi_Tikhonov(H,T1,self.Tmean) # add Tikhonov regularization - - # get ranking of neurons in that batch - rank = mrsr(H, T1, nn) - - # select best number of neurons - MSE = press(H[:, rank[:2]], T1, self.classification, self.multiclass) - R_opt = rank[:2] - early_stopping = int(nn/10) + 1 # early stopping if no improvement in 10% neurons - last_improvement = 0 - for i in range(3, nn): - last_improvement += 1 - r = rank[:i] - mse1 = press(H[:,r], T1, self.classification, self.multiclass) - if mse1 < MSE * delta: - MSE = mse1 - R_opt = r - last_improvement = 0 - elif last_improvement > early_stopping: # early stopping if MSE raises - break - r = R_opt - - # save number of neurons and their ranking information - nfeats.append(len(r)) - # first selected neuron gets weight 2, last one gets weight 1 - neurons[r] += np.linspace(2,1,num=len(r)) - - # combine neuron ranking - nfeats = np.round(np.mean(nfeats)) - neurons = np.argsort(neurons)[::-1][:nfeats] # sorting in descending order - - # update ELM parameters and re-calculate B - self.W = self.W[:,neurons] - self.ufunc = [self.ufunc[j] for j in neurons] - self.train(X, T, batch=batch, delimiter=delimiter) - - - - def prune_op2(self, X, T, norm=1, batch=10000, delimiter=" "): - """Prune ELM with a more recent implementation of MRSR. - - :param norm: - check numpy.linalg.norm(X, ) - """ - # get data iterators - genX, self.inputs, N = batchX(X, batch, delimiter) - genT, self.targets = batchT(T, batch, delimiter, self.C_dict) - - # project data - nn = len(self.ufunc) - delta = 0.95 # improvement of MSE for adding more neurons - nfeats = [] - neurons = np.zeros((nn,)) - for X1,T1 in zip(genX, genT): - - # get hidden layer outputs - H = np.dot(X1,self.W) - for i in xrange(H.shape[1]): - H[:,i] = self.ufunc[i](H[:,i]) - H,T1 = semi_Tikhonov(H,T1,self.Tmean) # add Tikhonov regularization - - # get ranking of neurons in that batch - # this MRSR2 is a class, with <.rank> attribute and <.new_input()> method - M = mrsr2(H, T1, norm) - M.new_input() - M.new_input() - - # select best number of neurons - MSE = press(H[:, M.rank], T1, self.classification, self.multiclass) - R_opt = M.rank - early_stopping = int(nn/10) + 1 # early stopping if no improvement in 10% neurons - last_improvement = 0 - for i in range(3, nn): - last_improvement += 1 - M.new_input() - mse1 = press(H[:, M.rank], T1, self.classification, self.multiclass) - if mse1 < MSE * delta: - MSE = mse1 - R_opt = M.rank - last_improvement = 0 - elif last_improvement > early_stopping: # early stopping if MSE raises - break - rank = R_opt - del M - - # save number of neurons and their ranking information - nfeats.append(len(rank)) - # first selected neuron gets weight 2, last one gets weight 1 - neurons[rank] += np.linspace(2,1,num=len(rank)) - - # combine neuron ranking - nfeats = np.round(np.mean(nfeats)) - neurons = np.argsort(neurons)[::-1][:nfeats] # sorting in descending order - - # update ELM parameters and re-calculate B - self.W = self.W[:,neurons] - self.ufunc = [self.ufunc[j] for j in neurons] - self.train(X, T, batch=batch, delimiter=delimiter) - ''' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# -*- coding: utf-8 -*- +""" +Created on Mon Oct 27 17:48:33 2014 + +@author: akusok +""" + +import numpy as np + +from nnet import SLFN + + +class HPELM(SLFN): + """High performance GPU and parallel Extreme Learning Machine. + """ + + # inherited def __init__(self, inputs, outputs): + # inherited def _checkdata(self, X, T): + # inherited def add_neurons(self, number, func, W=None, B=None): + # inherited def project(self, X): + # inherited def predict(self, X): + # inherited def save(self, model): + # inherited def load(self, model): + + def __init__(self, X, T, *args, **kvargs): + """Universal contructor of ELM model with model structure selection. + + :param X: input data matrix + :param T: target data matrix + :param Xmean: vector of mean value of X for normalization !!! hpelm + :param Xstd: vector of srd of X for normalization !!! hpelm + + Model structure selection (exclusive, choose one) + :param "V": use validation set + :param "CV": use cross-validation + :param "MCCV": use Monte-Carlo cross-validation + :param "LOO": use leave-one-out validation + + Additional validation parameters + :param Xv: validation data X ("V") + :param Tv: validation targets T ("V") + :param k: number of splits ("CV", "MCCV") + :param n: number of repetitions ("MCCV") + + Ranking of hidden neurons + :param "HQ": use Hannan-Quinn criterion + # no OP-ELM + + System setup + :param "classification"/"c": build ELM for classification + :param "multiclass"/"mc": build ELM for multiclass classification + :param "adaptive"/"ad": build adaptive ELM for non-stationary model + :param "batch": batch size for adaptive ELM (sliding window step size) + + """ + + print X.shape + print T.shape + print "start args" + for arg in args: + print arg + print "start kvargs" + for kv, arg in kvargs.items(): + print kv, arg + print "end (kv)args" + + N, inputs = X.shape + _, targets = T.shape + super(ELM, self).__init__(inputs, targets) + + def train(self, X, T): + """Learn a model to project inputs X to targets T. + + :param X: - matrix of inputs + :param T: - matrix of targets + """ + assert len(self.neurons) > 0, "Add neurons before training ELM" + X, T = self._checkdata(X, T) + H = self.project(X) + self.Beta = np.linalg.pinv(H).dot(T) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ''' COPY OF OLD PRUNING METHODS + def prune_op(self, X, T, batch=10000, delimiter=" "): + """Prune ELM as in OP-ELM paper. + """ + # get data iterators + genX, self.inputs, N = batchX(X, batch, delimiter) + genT, self.targets = batchT(T, batch, delimiter, self.C_dict) + + # project data + nn = len(self.ufunc) + delta = 0.95 # improvement of MSE for adding more neurons + nfeats = [] + neurons = np.zeros((nn,)) + for X1,T1 in zip(genX, genT): + + # get hidden layer outputs + H = np.dot(X1,self.W) + for i in xrange(H.shape[1]): + H[:,i] = self.ufunc[i](H[:,i]) + H,T1 = semi_Tikhonov(H,T1,self.Tmean) # add Tikhonov regularization + + # get ranking of neurons in that batch + rank = mrsr(H, T1, nn) + + # select best number of neurons + MSE = press(H[:, rank[:2]], T1, self.classification, self.multiclass) + R_opt = rank[:2] + early_stopping = int(nn/10) + 1 # early stopping if no improvement in 10% neurons + last_improvement = 0 + for i in range(3, nn): + last_improvement += 1 + r = rank[:i] + mse1 = press(H[:,r], T1, self.classification, self.multiclass) + if mse1 < MSE * delta: + MSE = mse1 + R_opt = r + last_improvement = 0 + elif last_improvement > early_stopping: # early stopping if MSE raises + break + r = R_opt + + # save number of neurons and their ranking information + nfeats.append(len(r)) + # first selected neuron gets weight 2, last one gets weight 1 + neurons[r] += np.linspace(2,1,num=len(r)) + + # combine neuron ranking + nfeats = np.round(np.mean(nfeats)) + neurons = np.argsort(neurons)[::-1][:nfeats] # sorting in descending order + + # update ELM parameters and re-calculate B + self.W = self.W[:,neurons] + self.ufunc = [self.ufunc[j] for j in neurons] + self.train(X, T, batch=batch, delimiter=delimiter) + + + + def prune_op2(self, X, T, norm=1, batch=10000, delimiter=" "): + """Prune ELM with a more recent implementation of MRSR. + + :param norm: - check numpy.linalg.norm(X, ) + """ + # get data iterators + genX, self.inputs, N = batchX(X, batch, delimiter) + genT, self.targets = batchT(T, batch, delimiter, self.C_dict) + + # project data + nn = len(self.ufunc) + delta = 0.95 # improvement of MSE for adding more neurons + nfeats = [] + neurons = np.zeros((nn,)) + for X1,T1 in zip(genX, genT): + + # get hidden layer outputs + H = np.dot(X1,self.W) + for i in xrange(H.shape[1]): + H[:,i] = self.ufunc[i](H[:,i]) + H,T1 = semi_Tikhonov(H,T1,self.Tmean) # add Tikhonov regularization + + # get ranking of neurons in that batch + # this MRSR2 is a class, with <.rank> attribute and <.new_input()> method + M = mrsr2(H, T1, norm) + M.new_input() + M.new_input() + + # select best number of neurons + MSE = press(H[:, M.rank], T1, self.classification, self.multiclass) + R_opt = M.rank + early_stopping = int(nn/10) + 1 # early stopping if no improvement in 10% neurons + last_improvement = 0 + for i in range(3, nn): + last_improvement += 1 + M.new_input() + mse1 = press(H[:, M.rank], T1, self.classification, self.multiclass) + if mse1 < MSE * delta: + MSE = mse1 + R_opt = M.rank + last_improvement = 0 + elif last_improvement > early_stopping: # early stopping if MSE raises + break + rank = R_opt + del M + + # save number of neurons and their ranking information + nfeats.append(len(rank)) + # first selected neuron gets weight 2, last one gets weight 1 + neurons[rank] += np.linspace(2,1,num=len(rank)) + + # combine neuron ranking + nfeats = np.round(np.mean(nfeats)) + neurons = np.argsort(neurons)[::-1][:nfeats] # sorting in descending order + + # update ELM parameters and re-calculate B + self.W = self.W[:,neurons] + self.ufunc = [self.ufunc[j] for j in neurons] + self.train(X, T, batch=batch, delimiter=delimiter) + ''' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/develop/_ELM_JMA/elm-jma/auxBuildKernelMatrix.m b/develop/_ELM_JMA/elm-jma/auxBuildKernelMatrix.m index 2e1e35e..d7cc5df 100755 --- a/develop/_ELM_JMA/elm-jma/auxBuildKernelMatrix.m +++ b/develop/_ELM_JMA/elm-jma/auxBuildKernelMatrix.m @@ -1,97 +1,97 @@ -function KM = auxBuildKernelMatrix(x, activationFcns, numHiddenNeurons, rndstream) - [N,d] = size(x); - KM.value = []; - KM.function = []; - KM.param.p1 = []; - KM.param.p2 = []; - - for i = 1:length(activationFcns) - switch lower(activationFcns{i}) - case {'linear', 'l', 'lin'} - KM.value = [KM.value x]; - KM.function = [KM.function repmat({'lin'}, 1, d)]; - KM.param.p1 = [KM.param.p1 zeros(d,d)]; - KM.param.p2 = [KM.param.p2 1:d]; - - case {'sigmoid', 's', 'sig'} - tt = rand(rndstream, d, numHiddenNeurons(i)) * 5 - 2.5; - bb = rand(rndstream, 1, numHiddenNeurons(i)) * 2 - 1; - h = x * tt + ones(N, 1) * bb; - KM.value = [KM.value 1 ./ (1 + exp(-h))]; - KM.function=[KM.function repmat({'sig'}, 1, numHiddenNeurons(i))]; - KM.param.p1=[KM.param.p1 tt]; - KM.param.p2=[KM.param.p2 bb]; - - case {'tanh', 't'} - tt = rand(rndstream, d, numHiddenNeurons(i)) * 5 - 2.5; - bb = rand(rndstream, 1, numHiddenNeurons(i)) * 2 - 1; - - h = x * tt + ones(N, 1) * bb; - KM.value = [KM.value tanh(h)]; - KM.function=[KM.function repmat({'tanh'}, 1, numHiddenNeurons(i))]; - KM.param.p1=[KM.param.p1 tt]; - KM.param.p2=[KM.param.p2 bb]; - - case {'sin', 'sine'} - tt = rand(rndstream, d, numHiddenNeurons(i)) * 5 - 2.5; - bb = rand(rndstream, 1, numHiddenNeurons(i)) * 2 - 1; - h = x * tt + ones(N, 1) * bb; - KM.value = [KM.value sin(h)]; - KM.function = [KM.function repmat({'sine'}, 1, numHiddenNeurons(i))]; - KM.param.p1=[KM.param.p1 tt]; - KM.param.p2=[KM.param.p2 bb]; - - case {'rbf'} - mm = minmax(x'); - W1 = zeros(numHiddenNeurons(i), d); - for j = 1:numHiddenNeurons(i) - W1(j,:) = transpose(rand(1, d)) .* (mm(:,2) - mm(:,1)) + mm(:,1); - end - if (N > 2000) - Y = pdist(x(randperm(rndstream, 2000),:)); - else - Y = pdist(x); - end - a20 = prctile(Y, 20); - a60 = prctile(Y, 60); - W10 = rand(rndstream, 1, numHiddenNeurons(i)) * (a60-a20) + a20; - vi = zeros(N, numHiddenNeurons(i)); - for j = 1:numHiddenNeurons(i) - vi(:,j) = auxGaussianFcn(x, W1(j,:), W10(j)); - end - KM.value = [KM.value vi]; - KM.function = [KM.function repmat({'rbf'}, 1, numHiddenNeurons(i))]; - KM.param.p1 = [KM.param.p1 W1']; - KM.param.p2 = [KM.param.p2 W10]; - clear a20 a60 W1 W10 Y vi mm - - case {'gauss', 'g', 'gaussian'} - if (N > 2000) - Y = pdist(x(randperm(rndstream, 2000),:)); - else - Y = pdist(x); - end - plower = prctile(Y,20); - pupper = prctile(Y,60); - if (numHiddenNeurons(i) <= N) - MP = randperm(rndstream, N); - MP = MP(1:numHiddenNeurons(i)); - else - MP = ceil(rand(rndstream, 1, numHiddenNeurons(i)) * N); - end - W1 = x(MP,:); - W10 = rand(rndstream, 1, numHiddenNeurons(i)) * (pupper-plower) + plower; - - vi = zeros(N, numHiddenNeurons(i)); - for j = 1:numHiddenNeurons(i) - vi(:,j) = auxGaussianFcn(x, W1(j,:), W10(j)); -% vi(:,j) = exp(-sum((x - ones(N,1) * W1(j,:)).^2, 2) / W10(j)^2); - end - KM.value = [KM.value vi]; - KM.function = [KM.function repmat({'gauss'}, 1, numHiddenNeurons(i))]; - KM.param.p1 = [KM.param.p1 W1']; - KM.param.p2 = [KM.param.p2 W10]; - clear W1 W10 pupper plower Y MP - end - end -end +function KM = auxBuildKernelMatrix(x, activationFcns, numHiddenNeurons, rndstream) + [N,d] = size(x); + KM.value = []; + KM.function = []; + KM.param.p1 = []; + KM.param.p2 = []; + + for i = 1:length(activationFcns) + switch lower(activationFcns{i}) + case {'linear', 'l', 'lin'} + KM.value = [KM.value x]; + KM.function = [KM.function repmat({'lin'}, 1, d)]; + KM.param.p1 = [KM.param.p1 zeros(d,d)]; + KM.param.p2 = [KM.param.p2 1:d]; + + case {'sigmoid', 's', 'sig'} + tt = rand(rndstream, d, numHiddenNeurons(i)) * 5 - 2.5; + bb = rand(rndstream, 1, numHiddenNeurons(i)) * 2 - 1; + h = x * tt + ones(N, 1) * bb; + KM.value = [KM.value 1 ./ (1 + exp(-h))]; + KM.function=[KM.function repmat({'sig'}, 1, numHiddenNeurons(i))]; + KM.param.p1=[KM.param.p1 tt]; + KM.param.p2=[KM.param.p2 bb]; + + case {'tanh', 't'} + tt = rand(rndstream, d, numHiddenNeurons(i)) * 5 - 2.5; + bb = rand(rndstream, 1, numHiddenNeurons(i)) * 2 - 1; + + h = x * tt + ones(N, 1) * bb; + KM.value = [KM.value tanh(h)]; + KM.function=[KM.function repmat({'tanh'}, 1, numHiddenNeurons(i))]; + KM.param.p1=[KM.param.p1 tt]; + KM.param.p2=[KM.param.p2 bb]; + + case {'sin', 'sine'} + tt = rand(rndstream, d, numHiddenNeurons(i)) * 5 - 2.5; + bb = rand(rndstream, 1, numHiddenNeurons(i)) * 2 - 1; + h = x * tt + ones(N, 1) * bb; + KM.value = [KM.value sin(h)]; + KM.function = [KM.function repmat({'sine'}, 1, numHiddenNeurons(i))]; + KM.param.p1=[KM.param.p1 tt]; + KM.param.p2=[KM.param.p2 bb]; + + case {'rbf'} + mm = minmax(x'); + W1 = zeros(numHiddenNeurons(i), d); + for j = 1:numHiddenNeurons(i) + W1(j,:) = transpose(rand(1, d)) .* (mm(:,2) - mm(:,1)) + mm(:,1); + end + if (N > 2000) + Y = pdist(x(randperm(rndstream, 2000),:)); + else + Y = pdist(x); + end + a20 = prctile(Y, 20); + a60 = prctile(Y, 60); + W10 = rand(rndstream, 1, numHiddenNeurons(i)) * (a60-a20) + a20; + vi = zeros(N, numHiddenNeurons(i)); + for j = 1:numHiddenNeurons(i) + vi(:,j) = auxGaussianFcn(x, W1(j,:), W10(j)); + end + KM.value = [KM.value vi]; + KM.function = [KM.function repmat({'rbf'}, 1, numHiddenNeurons(i))]; + KM.param.p1 = [KM.param.p1 W1']; + KM.param.p2 = [KM.param.p2 W10]; + clear a20 a60 W1 W10 Y vi mm + + case {'gauss', 'g', 'gaussian'} + if (N > 2000) + Y = pdist(x(randperm(rndstream, 2000),:)); + else + Y = pdist(x); + end + plower = prctile(Y,20); + pupper = prctile(Y,60); + if (numHiddenNeurons(i) <= N) + MP = randperm(rndstream, N); + MP = MP(1:numHiddenNeurons(i)); + else + MP = ceil(rand(rndstream, 1, numHiddenNeurons(i)) * N); + end + W1 = x(MP,:); + W10 = rand(rndstream, 1, numHiddenNeurons(i)) * (pupper-plower) + plower; + + vi = zeros(N, numHiddenNeurons(i)); + for j = 1:numHiddenNeurons(i) + vi(:,j) = auxGaussianFcn(x, W1(j,:), W10(j)); +% vi(:,j) = exp(-sum((x - ones(N,1) * W1(j,:)).^2, 2) / W10(j)^2); + end + KM.value = [KM.value vi]; + KM.function = [KM.function repmat({'gauss'}, 1, numHiddenNeurons(i))]; + KM.param.p1 = [KM.param.p1 W1']; + KM.param.p2 = [KM.param.p2 W10]; + clear W1 W10 pupper plower Y MP + end + end +end diff --git a/develop/_ELM_JMA/elm-jma/auxGaussianFcn.m b/develop/_ELM_JMA/elm-jma/auxGaussianFcn.m index 111b281..4e60e6a 100755 --- a/develop/_ELM_JMA/elm-jma/auxGaussianFcn.m +++ b/develop/_ELM_JMA/elm-jma/auxGaussianFcn.m @@ -1,4 +1,4 @@ -function out = auxGaussianFcn(X, C, sig) -% out = exp(sum((X - ones(size(X,1),1) * C).^2, 2) / sig^2); - out = exp(-mean(abs((X - ones(size(X,1),1) * C)).^2, 2) / sig^2); +function out = auxGaussianFcn(X, C, sig) +% out = exp(sum((X - ones(size(X,1),1) * C).^2, 2) / sig^2); + out = exp(-mean(abs((X - ones(size(X,1),1) * C)).^2, 2) / sig^2); end \ No newline at end of file diff --git a/develop/_ELM_JMA/elm-jma/combineJackknife.m b/develop/_ELM_JMA/elm-jma/combineJackknife.m index ca1def4..269f0d4 100755 --- a/develop/_ELM_JMA/elm-jma/combineJackknife.m +++ b/develop/_ELM_JMA/elm-jma/combineJackknife.m @@ -1,57 +1,57 @@ -function weights = combineJackknife(residuals, minThresh, criterion, numBestModels) -% -% Jackknife model averaging with some thresholding. Original Jackknife is -% based on loo residuals. -% -% Optional arguments are focused on condisering only several models, -% i.e. taking best models based on some criterion. Minimization is assumed, -% that is, the smaller the value in this vector the better the model is. -% -% Input: -% residuals Residuals of the models. Matrix NxK. -% minThresh Minimum threshold for weights to be included. Default is 0. -% criterion Some criterion for models. Vector Kx1. -% numBestModels Number of best models to choose (based on above criterion). -% -% Output: -% weights Ensemble weights for all K models. Those that are -% not considered at all have 0 weight. -% - -% -% Reference: -% Hansen and Racine. 'Jackknife model averaging', -% Journal of Econometrics 167():38-46, 2012 -% - - numModels = size(residuals, 2); - if (nargin < 2 || isempty(minThresh)) - minThresh = 0; - end - if (nargin < 3 || isempty(criterion)) - idx = 1:numModels; - else - [~,idx] = sort(criterion); - end - if (nargin < 4 || isempty(numBestModels)) - numBestModels = numModels; - end - - numBest = min(max(1, numBestModels), numModels); - idx = idx(1:numBest); - sel = false(1,numModels); - sel(idx) = true; - weights = zeros(numModels,1); - - % quadratic problem solver - S = (residuals(:,sel)' * residuals(:,sel)) / size(residuals,1); - S = (S + S') / 2; - w = quadprog(2*S, zeros(1,numBest), [], [], ones(1,numBest), 1, zeros(numBest,1), [], [],... - optimset('Algorithm', 'interior-point-convex', 'Display', 'off')); - - list = w < minThresh; - w(list) = 0; - w(~list) = w(~list) ./ sum(w(~list)); - weights(sel) = w; -end - +function weights = combineJackknife(residuals, minThresh, criterion, numBestModels) +% +% Jackknife model averaging with some thresholding. Original Jackknife is +% based on loo residuals. +% +% Optional arguments are focused on condisering only several models, +% i.e. taking best models based on some criterion. Minimization is assumed, +% that is, the smaller the value in this vector the better the model is. +% +% Input: +% residuals Residuals of the models. Matrix NxK. +% minThresh Minimum threshold for weights to be included. Default is 0. +% criterion Some criterion for models. Vector Kx1. +% numBestModels Number of best models to choose (based on above criterion). +% +% Output: +% weights Ensemble weights for all K models. Those that are +% not considered at all have 0 weight. +% + +% +% Reference: +% Hansen and Racine. 'Jackknife model averaging', +% Journal of Econometrics 167():38-46, 2012 +% + + numModels = size(residuals, 2); + if (nargin < 2 || isempty(minThresh)) + minThresh = 0; + end + if (nargin < 3 || isempty(criterion)) + idx = 1:numModels; + else + [~,idx] = sort(criterion); + end + if (nargin < 4 || isempty(numBestModels)) + numBestModels = numModels; + end + + numBest = min(max(1, numBestModels), numModels); + idx = idx(1:numBest); + sel = false(1,numModels); + sel(idx) = true; + weights = zeros(numModels,1); + + % quadratic problem solver + S = (residuals(:,sel)' * residuals(:,sel)) / size(residuals,1); + S = (S + S') / 2; + w = quadprog(2*S, zeros(1,numBest), [], [], ones(1,numBest), 1, zeros(numBest,1), [], [],... + optimset('Algorithm', 'interior-point-convex', 'Display', 'off')); + + list = w < minThresh; + w(list) = 0; + w(~list) = w(~list) ./ sum(w(~list)); + weights(sel) = w; +end + diff --git a/develop/_ELM_JMA/elm-jma/elmSimulate_loo.m b/develop/_ELM_JMA/elm-jma/elmSimulate_loo.m index e4d447d..ef964f7 100755 --- a/develop/_ELM_JMA/elm-jma/elmSimulate_loo.m +++ b/develop/_ELM_JMA/elm-jma/elmSimulate_loo.m @@ -1,44 +1,44 @@ -function [err yh] = elmSimulate_loo(model, x, y) - - if (nargin < 3 || isempty(y)) - y = ones(size(x,1),1) * NaN; - end - - KM = model.KM; - [N,d] = size(x); - - H = zeros(size(x,1), length(KM.function)); - for i = 1:length(KM.function) - switch KM.function{i} - case 'lin' - H(:,i) = x(:,KM.param.p2(i)); - - case 'sig' - tt = x * KM.param.p1(:,i) + ones(N,1) * KM.param.p2(:,i); - H(:,i) = 1 ./ (1 + exp(-tt)); - - case 'tanh' - tt = x * KM.param.p1(:,i) + ones(N,1) * KM.param.p2(:,i); - H(:,i) = tanh(tt); - - case 'sine' - tt = x * KM.param.p1(:,i) + ones(N,1) * KM.param.p2(:,i); - H(:,i) = sin(tt); - - case {'rbf', 'gauss'} -% H(:,i) = exp(sum((x - ones(N,1) * KM.param.p1(:,i)').^2, 2) / KM.param.p2(:,i)); - H(:,i) = auxGaussianFcn(x, KM.param.p1(:,i)', KM.param.p2(:,i)); - end - end - - yh.loo = [H(:,1:model.bestloo) ones(N,1)] * model.outWeights([1:model.bestloo end]); - err.loo = mean((y - yh.loo).^2); - - ll = find(model.jackWeights > 0); - yh.jack = zeros(N, length(model.jackWeights)); - for i = 1:length(ll) - yh.jack(:,ll(i)) = [H(:,1:ll(i)) ones(N,1)] * model.allWeights([1:ll(i) size(KM.value,2)+1], ll(i)); - end - yh.jack = yh.jack * model.jackWeights; - err.jack = mean((y - yh.jack).^2); -end +function [err yh] = elmSimulate_loo(model, x, y) + + if (nargin < 3 || isempty(y)) + y = ones(size(x,1),1) * NaN; + end + + KM = model.KM; + [N,d] = size(x); + + H = zeros(size(x,1), length(KM.function)); + for i = 1:length(KM.function) + switch KM.function{i} + case 'lin' + H(:,i) = x(:,KM.param.p2(i)); + + case 'sig' + tt = x * KM.param.p1(:,i) + ones(N,1) * KM.param.p2(:,i); + H(:,i) = 1 ./ (1 + exp(-tt)); + + case 'tanh' + tt = x * KM.param.p1(:,i) + ones(N,1) * KM.param.p2(:,i); + H(:,i) = tanh(tt); + + case 'sine' + tt = x * KM.param.p1(:,i) + ones(N,1) * KM.param.p2(:,i); + H(:,i) = sin(tt); + + case {'rbf', 'gauss'} +% H(:,i) = exp(sum((x - ones(N,1) * KM.param.p1(:,i)').^2, 2) / KM.param.p2(:,i)); + H(:,i) = auxGaussianFcn(x, KM.param.p1(:,i)', KM.param.p2(:,i)); + end + end + + yh.loo = [H(:,1:model.bestloo) ones(N,1)] * model.outWeights([1:model.bestloo end]); + err.loo = mean((y - yh.loo).^2); + + ll = find(model.jackWeights > 0); + yh.jack = zeros(N, length(model.jackWeights)); + for i = 1:length(ll) + yh.jack(:,ll(i)) = [H(:,1:ll(i)) ones(N,1)] * model.allWeights([1:ll(i) size(KM.value,2)+1], ll(i)); + end + yh.jack = yh.jack * model.jackWeights; + err.jack = mean((y - yh.jack).^2); +end diff --git a/develop/_ELM_JMA/elm-jma/elmTrain_loo.m b/develop/_ELM_JMA/elm-jma/elmTrain_loo.m index b9ccf8f..f65d361 100755 --- a/develop/_ELM_JMA/elm-jma/elmTrain_loo.m +++ b/develop/_ELM_JMA/elm-jma/elmTrain_loo.m @@ -1,88 +1,88 @@ -function model = elmTrain_loo(x, y, activationFcns, numHiddenNeurons, rndseed) -% -% Extreme Learning Machine training phase with LOO as criterion. -% Train neuron by neuron, and ensemble with Jackknife model averaging -% -% Input: -% x -% y -% humHiddenNeurons -% -% Output: -% model model which contains weights for all possible -% weight averaging combinations -% - - [N,d] = size(x); - numHiddenNeurons = double(numHiddenNeurons); - - if (exist('rndseed', 'var') && ~isempty(rndseed)) - elmStream = RandStream.create('mt19937ar', 'NumStreams', 1, 'Seed', rndseed); - else - elmStream = RandStream.getDefaultStream; - end - - %% initialization of kernels - H = auxBuildKernelMatrix(x, activationFcns, numHiddenNeurons, elmStream); - maxNeurons = min(N - 5, size(H.value,2)); % N-5 because of kicc, keep this since I am going to compare to kicc criterion - perm = randperm(elmStream, maxNeurons); - H.value = H.value(:,perm); % permute to avoid stacked same functions - H.function = H.function(perm); - H.param.p1 = H.param.p1(:,perm); - H.param.p2 = H.param.p2(perm); - - %% go through possible solutions (adding 1 neuron at a time) - weights = zeros(maxNeurons+1, maxNeurons); - yh = zeros(N,maxNeurons); - residuals = zeros(N,maxNeurons); -% yhloo = zeros(N,maxNeurons); - residualsloo = zeros(N,maxNeurons); - loo = zeros(1,maxNeurons); - -% timer = CTimer(); -% timer.start(); - for i = 1:maxNeurons - Ht = [H.value(:,1:i) ones(N,1)]; - [Q R] = qr(Ht, 0); - opts.UT = true; - w = linsolve(R, Q' * y, opts); - - s = R \ eye(size(R,1)); - P = Ht * (s * s'); - mydiag = dot(P, Ht, 2); - yh(:,i) = Ht * w; - residuals(:,i) = y - yh(:,i); - residualsloo(:,i) = residuals(:,i) ./ (1 - mydiag); -% yhloo(:,i) = y - residualsloo(:,i); - - weights([1:i maxNeurons+1],i) = w; - - loo(i) = mean(residualsloo(:,i).^2); - end - elm_train_time = timer.getElapsedSeconds(); -% timer.stop(); - - [~, idxloo] = min(loo); - ww = weights(:,idxloo); - % check gradient as well (TO DO) - - - %% ensembling - MIN_THRESH = 1e-3; -% timer.start(); - jack = combineJackknife(residualsloo, MIN_THRESH); - ensemble_time = timer.getElapsedSeconds(); -% timer.stop(); - - - %% build output structure - model.KM = H; - model.outWeights = ww; - model.allWeights = weights; - model.loo = loo; - model.bestloo = idxloo; - model.jackWeights = jack; - model.times.train = elm_train_time; - model.times.ensemble = ensemble_time; - -end +function model = elmTrain_loo(x, y, activationFcns, numHiddenNeurons, rndseed) +% +% Extreme Learning Machine training phase with LOO as criterion. +% Train neuron by neuron, and ensemble with Jackknife model averaging +% +% Input: +% x +% y +% humHiddenNeurons +% +% Output: +% model model which contains weights for all possible +% weight averaging combinations +% + + [N,d] = size(x); + numHiddenNeurons = double(numHiddenNeurons); + + if (exist('rndseed', 'var') && ~isempty(rndseed)) + elmStream = RandStream.create('mt19937ar', 'NumStreams', 1, 'Seed', rndseed); + else + elmStream = RandStream.getDefaultStream; + end + + %% initialization of kernels + H = auxBuildKernelMatrix(x, activationFcns, numHiddenNeurons, elmStream); + maxNeurons = min(N - 5, size(H.value,2)); % N-5 because of kicc, keep this since I am going to compare to kicc criterion + perm = randperm(elmStream, maxNeurons); + H.value = H.value(:,perm); % permute to avoid stacked same functions + H.function = H.function(perm); + H.param.p1 = H.param.p1(:,perm); + H.param.p2 = H.param.p2(perm); + + %% go through possible solutions (adding 1 neuron at a time) + weights = zeros(maxNeurons+1, maxNeurons); + yh = zeros(N,maxNeurons); + residuals = zeros(N,maxNeurons); +% yhloo = zeros(N,maxNeurons); + residualsloo = zeros(N,maxNeurons); + loo = zeros(1,maxNeurons); + +% timer = CTimer(); +% timer.start(); + for i = 1:maxNeurons + Ht = [H.value(:,1:i) ones(N,1)]; + [Q R] = qr(Ht, 0); + opts.UT = true; + w = linsolve(R, Q' * y, opts); + + s = R \ eye(size(R,1)); + P = Ht * (s * s'); + mydiag = dot(P, Ht, 2); + yh(:,i) = Ht * w; + residuals(:,i) = y - yh(:,i); + residualsloo(:,i) = residuals(:,i) ./ (1 - mydiag); +% yhloo(:,i) = y - residualsloo(:,i); + + weights([1:i maxNeurons+1],i) = w; + + loo(i) = mean(residualsloo(:,i).^2); + end + elm_train_time = timer.getElapsedSeconds(); +% timer.stop(); + + [~, idxloo] = min(loo); + ww = weights(:,idxloo); + % check gradient as well (TO DO) + + + %% ensembling + MIN_THRESH = 1e-3; +% timer.start(); + jack = combineJackknife(residualsloo, MIN_THRESH); + ensemble_time = timer.getElapsedSeconds(); +% timer.stop(); + + + %% build output structure + model.KM = H; + model.outWeights = ww; + model.allWeights = weights; + model.loo = loo; + model.bestloo = idxloo; + model.jackWeights = jack; + model.times.train = elm_train_time; + model.times.ensemble = ensemble_time; + +end diff --git a/develop/_Incremental_Timeseries/MG_opium.py b/develop/_Incremental_Timeseries/MG_opium.py index 941cbde..108ac56 100644 --- a/develop/_Incremental_Timeseries/MG_opium.py +++ b/develop/_Incremental_Timeseries/MG_opium.py @@ -1,99 +1,99 @@ -""" -Greville and OPIUM method for classifying Mackey-Glass from: -J. Tapson and A. van Schaik, -"Learning the Pseudoinverse Solution to Network Weights" -Neural Networks - -Used for Figure 3. - -@author: andrevanschaik -""" -from pylab import * -from numpy import * -from OPIUM import * - -# Simulation parameters -dt = 0.1 # time step -maxtime = 4000 # simulation stop time -alpha =1.0 # learning rate for OPIUM - -# generate Mackey-Glass series -a = 0.2 -b = 0.1 -tau = 170 -mg = ones(maxtime) -mg[0] = 0.000001 -for t in range (tau,maxtime-1): - mg[t+1] = mg[t]+((a*mg[t-tau])/(1+(pow(mg[t-tau],10)))-b*mg[t]) - -# Network parameters -numtaps = 4 -taps = array((0,60,170,1000)) -max_taps = 1000 -fanout = 10 -forward = 50 -size_hidden = numtaps*fanout # size of hidden layer -random_weights = random.rand(size_hidden,numtaps)-0.5 # input->hidden weights - -# Greville Method - -# Initialisation of matrices -M = zeros((1,size_hidden)) # hidden->output weights -x = zeros((numtaps,1)) # current inputs to the network -h = zeros((size_hidden,1)) # hidden layer output -E = zeros(maxtime) # error matrix for plotting vs time -Y = zeros((1,maxtime)) # network output vs time -P = eye(size_hidden) / size_hidden # initialise correlation matrix inverse - -for t in range(max_taps,maxtime-forward): - x = reshape(mg[t-taps],(numtaps,1)) # input vector - h = tanh(dot(random_weights,x)) # hidden layer activation with sigmoid - y = dot(M,h) # output value - Y[0,t+forward] = y # output is saved as the predicted sample - E[t+forward] = mg[t+forward]-y # calculate error - Greville(h,E[t+forward],M,P) # basic Greville method -# end for t - -# Calculate RMS error for the last 1000 points -error_G = sqrt(mean((Y[0,maxtime-1000:maxtime]-mg[maxtime-1000:maxtime])**2)) -print error_G - -# Plot input, output, and error -ion() -figure(0) -plot(mg) -plot(Y[0],'r') -plot(E,'g') - -savetxt('MG_Greville.txt',(mg, Y[0], E)) - -# OPIUM Method - -# Initialisation of signal matrices -M = zeros((1,size_hidden)) # hidden->output weights -x = zeros((numtaps,1)) # current inputs to the network -h = zeros((size_hidden,1)) # hidden layer output -E_O = zeros(maxtime) # error matrix for plotting vs time -Y_O = zeros((1,maxtime)) # network output vs time -P = eye(size_hidden) / size_hidden # initialise correlation matrix inverse - -for t in range(max_taps,maxtime-forward): - x = reshape(mg[t-taps],(numtaps,1)) # input vector - h = tanh(dot(random_weights,x)) # hidden layer activation with sigmoid - y = dot(M,h) # output value - Y_O[0,t+forward] = y # output is saved as the predicted sample - E_O[t+forward] = mg[t+forward]-y # calculate error - OPIUM(h,E_O[t+forward],M,P,alpha) # OPIUM method -# end for t - -# Calculate RMS error for the last 1000 points -error_O = sqrt(mean((Y_O[0,maxtime-1000:maxtime]-mg[maxtime-1000:maxtime])**2)) -print error_O - -# Plot input, output, and error -figure(1) -plot(mg) -plot(Y_O[0],'r') -plot(E_O,'g') - -savetxt('MG_Opium.txt',(mg, Y_O[0], E_O)) +""" +Greville and OPIUM method for classifying Mackey-Glass from: +J. Tapson and A. van Schaik, +"Learning the Pseudoinverse Solution to Network Weights" +Neural Networks + +Used for Figure 3. + +@author: andrevanschaik +""" +from pylab import * +from numpy import * +from OPIUM import * + +# Simulation parameters +dt = 0.1 # time step +maxtime = 4000 # simulation stop time +alpha =1.0 # learning rate for OPIUM + +# generate Mackey-Glass series +a = 0.2 +b = 0.1 +tau = 170 +mg = ones(maxtime) +mg[0] = 0.000001 +for t in range (tau,maxtime-1): + mg[t+1] = mg[t]+((a*mg[t-tau])/(1+(pow(mg[t-tau],10)))-b*mg[t]) + +# Network parameters +numtaps = 4 +taps = array((0,60,170,1000)) +max_taps = 1000 +fanout = 10 +forward = 50 +size_hidden = numtaps*fanout # size of hidden layer +random_weights = random.rand(size_hidden,numtaps)-0.5 # input->hidden weights + +# Greville Method + +# Initialisation of matrices +M = zeros((1,size_hidden)) # hidden->output weights +x = zeros((numtaps,1)) # current inputs to the network +h = zeros((size_hidden,1)) # hidden layer output +E = zeros(maxtime) # error matrix for plotting vs time +Y = zeros((1,maxtime)) # network output vs time +P = eye(size_hidden) / size_hidden # initialise correlation matrix inverse + +for t in range(max_taps,maxtime-forward): + x = reshape(mg[t-taps],(numtaps,1)) # input vector + h = tanh(dot(random_weights,x)) # hidden layer activation with sigmoid + y = dot(M,h) # output value + Y[0,t+forward] = y # output is saved as the predicted sample + E[t+forward] = mg[t+forward]-y # calculate error + Greville(h,E[t+forward],M,P) # basic Greville method +# end for t + +# Calculate RMS error for the last 1000 points +error_G = sqrt(mean((Y[0,maxtime-1000:maxtime]-mg[maxtime-1000:maxtime])**2)) +print error_G + +# Plot input, output, and error +ion() +figure(0) +plot(mg) +plot(Y[0],'r') +plot(E,'g') + +savetxt('MG_Greville.txt',(mg, Y[0], E)) + +# OPIUM Method + +# Initialisation of signal matrices +M = zeros((1,size_hidden)) # hidden->output weights +x = zeros((numtaps,1)) # current inputs to the network +h = zeros((size_hidden,1)) # hidden layer output +E_O = zeros(maxtime) # error matrix for plotting vs time +Y_O = zeros((1,maxtime)) # network output vs time +P = eye(size_hidden) / size_hidden # initialise correlation matrix inverse + +for t in range(max_taps,maxtime-forward): + x = reshape(mg[t-taps],(numtaps,1)) # input vector + h = tanh(dot(random_weights,x)) # hidden layer activation with sigmoid + y = dot(M,h) # output value + Y_O[0,t+forward] = y # output is saved as the predicted sample + E_O[t+forward] = mg[t+forward]-y # calculate error + OPIUM(h,E_O[t+forward],M,P,alpha) # OPIUM method +# end for t + +# Calculate RMS error for the last 1000 points +error_O = sqrt(mean((Y_O[0,maxtime-1000:maxtime]-mg[maxtime-1000:maxtime])**2)) +print error_O + +# Plot input, output, and error +figure(1) +plot(mg) +plot(Y_O[0],'r') +plot(E_O,'g') + +savetxt('MG_Opium.txt',(mg, Y_O[0], E_O)) diff --git a/develop/_Sphinx/doc/_build/doctrees/environment.pickle b/develop/_Sphinx/doc/_build/doctrees/environment.pickle deleted file mode 100755 index 73c3387..0000000 Binary files a/develop/_Sphinx/doc/_build/doctrees/environment.pickle and /dev/null differ diff --git a/develop/_Sphinx/doc/_build/doctrees/index.doctree b/develop/_Sphinx/doc/_build/doctrees/index.doctree deleted file mode 100755 index 1ad9bef..0000000 Binary files a/develop/_Sphinx/doc/_build/doctrees/index.doctree and /dev/null differ diff --git a/develop/_Sphinx/doc/_build/html/.buildinfo b/develop/_Sphinx/doc/_build/html/.buildinfo deleted file mode 100755 index bc45ac0..0000000 --- a/develop/_Sphinx/doc/_build/html/.buildinfo +++ /dev/null @@ -1,4 +0,0 @@ -# Sphinx build info version 1 -# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: b4b4f9e2b05aa9574cb8f99e4576f370 -tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/develop/_Sphinx/doc/_build/html/_modules/elm.html b/develop/_Sphinx/doc/_build/html/_modules/elm.html deleted file mode 100755 index 2e1005f..0000000 --- a/develop/_Sphinx/doc/_build/html/_modules/elm.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - elm — ELM toolbox 0.1a1 documentation - - - - - - - - - - - - - - - -
-
-
-
- -

Source code for elm

-'''
-Created on Aug 18, 2014
-
-@author: akusoka1
-'''
-
-from elm import ELM
-
- -
-
-
-
-
- - -
-
-
-
- - - - \ No newline at end of file diff --git a/develop/_Sphinx/doc/_build/html/_modules/index.html b/develop/_Sphinx/doc/_build/html/_modules/index.html deleted file mode 100755 index 9ddc3ea..0000000 --- a/develop/_Sphinx/doc/_build/html/_modules/index.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - Overview: module code — ELM toolbox 0.1a1 documentation - - - - - - - - - - - - - - -
-
-
-
- -

All modules for which code is available

- - -
-
-
-
-
- - -
-
-
-
- - - - \ No newline at end of file diff --git a/develop/_Sphinx/doc/_build/html/_sources/index.txt b/develop/_Sphinx/doc/_build/html/_sources/index.txt deleted file mode 100755 index cfe5dd0..0000000 --- a/develop/_Sphinx/doc/_build/html/_sources/index.txt +++ /dev/null @@ -1,27 +0,0 @@ -.. ELM toolbox documentation master file, created by - sphinx-quickstart on Wed Aug 20 10:41:04 2014. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -Welcome to ELM toolbox's documentation! -======================================= - -Contents: - -.. toctree:: - :maxdepth: 2 - - -.. automodule:: elm - -.. autoclass:: ELM - :members: - - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` - diff --git a/develop/_Sphinx/doc/_build/html/_static/ajax-loader.gif b/develop/_Sphinx/doc/_build/html/_static/ajax-loader.gif deleted file mode 100755 index 61faf8c..0000000 Binary files a/develop/_Sphinx/doc/_build/html/_static/ajax-loader.gif and /dev/null differ diff --git a/develop/_Sphinx/doc/_build/html/_static/basic.css b/develop/_Sphinx/doc/_build/html/_static/basic.css deleted file mode 100755 index 967e36c..0000000 --- a/develop/_Sphinx/doc/_build/html/_static/basic.css +++ /dev/null @@ -1,537 +0,0 @@ -/* - * basic.css - * ~~~~~~~~~ - * - * Sphinx stylesheet -- basic theme. - * - * :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -/* -- main layout ----------------------------------------------------------- */ - -div.clearer { - clear: both; -} - -/* -- relbar ---------------------------------------------------------------- */ - -div.related { - width: 100%; - font-size: 90%; -} - -div.related h3 { - display: none; -} - -div.related ul { - margin: 0; - padding: 0 0 0 10px; - list-style: none; -} - -div.related li { - display: inline; -} - -div.related li.right { - float: right; - margin-right: 5px; -} - -/* -- sidebar --------------------------------------------------------------- */ - -div.sphinxsidebarwrapper { - padding: 10px 5px 0 10px; -} - -div.sphinxsidebar { - float: left; - width: 230px; - margin-left: -100%; - font-size: 90%; -} - -div.sphinxsidebar ul { - list-style: none; -} - -div.sphinxsidebar ul ul, -div.sphinxsidebar ul.want-points { - margin-left: 20px; - list-style: square; -} - -div.sphinxsidebar ul ul { - margin-top: 0; - margin-bottom: 0; -} - -div.sphinxsidebar form { - margin-top: 10px; -} - -div.sphinxsidebar input { - border: 1px solid #98dbcc; - font-family: sans-serif; - font-size: 1em; -} - -div.sphinxsidebar #searchbox input[type="text"] { - width: 170px; -} - -div.sphinxsidebar #searchbox input[type="submit"] { - width: 30px; -} - -img { - border: 0; - max-width: 100%; -} - -/* -- search page ----------------------------------------------------------- */ - -ul.search { - margin: 10px 0 0 20px; - padding: 0; -} - -ul.search li { - padding: 5px 0 5px 20px; - background-image: url(file.png); - background-repeat: no-repeat; - background-position: 0 7px; -} - -ul.search li a { - font-weight: bold; -} - -ul.search li div.context { - color: #888; - margin: 2px 0 0 30px; - text-align: left; -} - -ul.keywordmatches li.goodmatch a { - font-weight: bold; -} - -/* -- index page ------------------------------------------------------------ */ - -table.contentstable { - width: 90%; -} - -table.contentstable p.biglink { - line-height: 150%; -} - -a.biglink { - font-size: 1.3em; -} - -span.linkdescr { - font-style: italic; - padding-top: 5px; - font-size: 90%; -} - -/* -- general index --------------------------------------------------------- */ - -table.indextable { - width: 100%; -} - -table.indextable td { - text-align: left; - vertical-align: top; -} - -table.indextable dl, table.indextable dd { - margin-top: 0; - margin-bottom: 0; -} - -table.indextable tr.pcap { - height: 10px; -} - -table.indextable tr.cap { - margin-top: 10px; - background-color: #f2f2f2; -} - -img.toggler { - margin-right: 3px; - margin-top: 3px; - cursor: pointer; -} - -div.modindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -div.genindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -/* -- general body styles --------------------------------------------------- */ - -a.headerlink { - visibility: hidden; -} - -h1:hover > a.headerlink, -h2:hover > a.headerlink, -h3:hover > a.headerlink, -h4:hover > a.headerlink, -h5:hover > a.headerlink, -h6:hover > a.headerlink, -dt:hover > a.headerlink { - visibility: visible; -} - -div.body p.caption { - text-align: inherit; -} - -div.body td { - text-align: left; -} - -.field-list ul { - padding-left: 1em; -} - -.first { - margin-top: 0 !important; -} - -p.rubric { - margin-top: 30px; - font-weight: bold; -} - -img.align-left, .figure.align-left, object.align-left { - clear: left; - float: left; - margin-right: 1em; -} - -img.align-right, .figure.align-right, object.align-right { - clear: right; - float: right; - margin-left: 1em; -} - -img.align-center, .figure.align-center, object.align-center { - display: block; - margin-left: auto; - margin-right: auto; -} - -.align-left { - text-align: left; -} - -.align-center { - text-align: center; -} - -.align-right { - text-align: right; -} - -/* -- sidebars -------------------------------------------------------------- */ - -div.sidebar { - margin: 0 0 0.5em 1em; - border: 1px solid #ddb; - padding: 7px 7px 0 7px; - background-color: #ffe; - width: 40%; - float: right; -} - -p.sidebar-title { - font-weight: bold; -} - -/* -- topics ---------------------------------------------------------------- */ - -div.topic { - border: 1px solid #ccc; - padding: 7px 7px 0 7px; - margin: 10px 0 10px 0; -} - -p.topic-title { - font-size: 1.1em; - font-weight: bold; - margin-top: 10px; -} - -/* -- admonitions ----------------------------------------------------------- */ - -div.admonition { - margin-top: 10px; - margin-bottom: 10px; - padding: 7px; -} - -div.admonition dt { - font-weight: bold; -} - -div.admonition dl { - margin-bottom: 0; -} - -p.admonition-title { - margin: 0px 10px 5px 0px; - font-weight: bold; -} - -div.body p.centered { - text-align: center; - margin-top: 25px; -} - -/* -- tables ---------------------------------------------------------------- */ - -table.docutils { - border: 0; - border-collapse: collapse; -} - -table.docutils td, table.docutils th { - padding: 1px 8px 1px 5px; - border-top: 0; - border-left: 0; - border-right: 0; - border-bottom: 1px solid #aaa; -} - -table.field-list td, table.field-list th { - border: 0 !important; -} - -table.footnote td, table.footnote th { - border: 0 !important; -} - -th { - text-align: left; - padding-right: 5px; -} - -table.citation { - border-left: solid 1px gray; - margin-left: 1px; -} - -table.citation td { - border-bottom: none; -} - -/* -- other body styles ----------------------------------------------------- */ - -ol.arabic { - list-style: decimal; -} - -ol.loweralpha { - list-style: lower-alpha; -} - -ol.upperalpha { - list-style: upper-alpha; -} - -ol.lowerroman { - list-style: lower-roman; -} - -ol.upperroman { - list-style: upper-roman; -} - -dl { - margin-bottom: 15px; -} - -dd p { - margin-top: 0px; -} - -dd ul, dd table { - margin-bottom: 10px; -} - -dd { - margin-top: 3px; - margin-bottom: 10px; - margin-left: 30px; -} - -dt:target, .highlighted { - background-color: #fbe54e; -} - -dl.glossary dt { - font-weight: bold; - font-size: 1.1em; -} - -.field-list ul { - margin: 0; - padding-left: 1em; -} - -.field-list p { - margin: 0; -} - -.optional { - font-size: 1.3em; -} - -.versionmodified { - font-style: italic; -} - -.system-message { - background-color: #fda; - padding: 5px; - border: 3px solid red; -} - -.footnote:target { - background-color: #ffa; -} - -.line-block { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} - -.line-block .line-block { - margin-top: 0; - margin-bottom: 0; - margin-left: 1.5em; -} - -.guilabel, .menuselection { - font-family: sans-serif; -} - -.accelerator { - text-decoration: underline; -} - -.classifier { - font-style: oblique; -} - -abbr, acronym { - border-bottom: dotted 1px; - cursor: help; -} - -/* -- code displays --------------------------------------------------------- */ - -pre { - overflow: auto; - overflow-y: hidden; /* fixes display issues on Chrome browsers */ -} - -td.linenos pre { - padding: 5px 0px; - border: 0; - background-color: transparent; - color: #aaa; -} - -table.highlighttable { - margin-left: 0.5em; -} - -table.highlighttable td { - padding: 0 0.5em 0 0.5em; -} - -tt.descname { - background-color: transparent; - font-weight: bold; - font-size: 1.2em; -} - -tt.descclassname { - background-color: transparent; -} - -tt.xref, a tt { - background-color: transparent; - font-weight: bold; -} - -h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { - background-color: transparent; -} - -.viewcode-link { - float: right; -} - -.viewcode-back { - float: right; - font-family: sans-serif; -} - -div.viewcode-block:target { - margin: -1px -10px; - padding: 0 10px; -} - -/* -- math display ---------------------------------------------------------- */ - -img.math { - vertical-align: middle; -} - -div.body div.math p { - text-align: center; -} - -span.eqno { - float: right; -} - -/* -- printout stylesheet --------------------------------------------------- */ - -@media print { - div.document, - div.documentwrapper, - div.bodywrapper { - margin: 0 !important; - width: 100%; - } - - div.sphinxsidebar, - div.related, - div.footer, - #top-link { - display: none; - } -} \ No newline at end of file diff --git a/develop/_Sphinx/doc/_build/html/_static/comment-bright.png b/develop/_Sphinx/doc/_build/html/_static/comment-bright.png deleted file mode 100755 index 551517b..0000000 Binary files a/develop/_Sphinx/doc/_build/html/_static/comment-bright.png and /dev/null differ diff --git a/develop/_Sphinx/doc/_build/html/_static/comment-close.png b/develop/_Sphinx/doc/_build/html/_static/comment-close.png deleted file mode 100755 index 09b54be..0000000 Binary files a/develop/_Sphinx/doc/_build/html/_static/comment-close.png and /dev/null differ diff --git a/develop/_Sphinx/doc/_build/html/_static/comment.png b/develop/_Sphinx/doc/_build/html/_static/comment.png deleted file mode 100755 index 92feb52..0000000 Binary files a/develop/_Sphinx/doc/_build/html/_static/comment.png and /dev/null differ diff --git a/develop/_Sphinx/doc/_build/html/_static/default.css b/develop/_Sphinx/doc/_build/html/_static/default.css deleted file mode 100755 index 5f1399a..0000000 --- a/develop/_Sphinx/doc/_build/html/_static/default.css +++ /dev/null @@ -1,256 +0,0 @@ -/* - * default.css_t - * ~~~~~~~~~~~~~ - * - * Sphinx stylesheet -- default theme. - * - * :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -@import url("basic.css"); - -/* -- page layout ----------------------------------------------------------- */ - -body { - font-family: sans-serif; - font-size: 100%; - background-color: #11303d; - color: #000; - margin: 0; - padding: 0; -} - -div.document { - background-color: #1c4e63; -} - -div.documentwrapper { - float: left; - width: 100%; -} - -div.bodywrapper { - margin: 0 0 0 230px; -} - -div.body { - background-color: #ffffff; - color: #000000; - padding: 0 20px 30px 20px; -} - -div.footer { - color: #ffffff; - width: 100%; - padding: 9px 0 9px 0; - text-align: center; - font-size: 75%; -} - -div.footer a { - color: #ffffff; - text-decoration: underline; -} - -div.related { - background-color: #133f52; - line-height: 30px; - color: #ffffff; -} - -div.related a { - color: #ffffff; -} - -div.sphinxsidebar { -} - -div.sphinxsidebar h3 { - font-family: 'Trebuchet MS', sans-serif; - color: #ffffff; - font-size: 1.4em; - font-weight: normal; - margin: 0; - padding: 0; -} - -div.sphinxsidebar h3 a { - color: #ffffff; -} - -div.sphinxsidebar h4 { - font-family: 'Trebuchet MS', sans-serif; - color: #ffffff; - font-size: 1.3em; - font-weight: normal; - margin: 5px 0 0 0; - padding: 0; -} - -div.sphinxsidebar p { - color: #ffffff; -} - -div.sphinxsidebar p.topless { - margin: 5px 10px 10px 10px; -} - -div.sphinxsidebar ul { - margin: 10px; - padding: 0; - color: #ffffff; -} - -div.sphinxsidebar a { - color: #98dbcc; -} - -div.sphinxsidebar input { - border: 1px solid #98dbcc; - font-family: sans-serif; - font-size: 1em; -} - - - -/* -- hyperlink styles ------------------------------------------------------ */ - -a { - color: #355f7c; - text-decoration: none; -} - -a:visited { - color: #355f7c; - text-decoration: none; -} - -a:hover { - text-decoration: underline; -} - - - -/* -- body styles ----------------------------------------------------------- */ - -div.body h1, -div.body h2, -div.body h3, -div.body h4, -div.body h5, -div.body h6 { - font-family: 'Trebuchet MS', sans-serif; - background-color: #f2f2f2; - font-weight: normal; - color: #20435c; - border-bottom: 1px solid #ccc; - margin: 20px -20px 10px -20px; - padding: 3px 0 3px 10px; -} - -div.body h1 { margin-top: 0; font-size: 200%; } -div.body h2 { font-size: 160%; } -div.body h3 { font-size: 140%; } -div.body h4 { font-size: 120%; } -div.body h5 { font-size: 110%; } -div.body h6 { font-size: 100%; } - -a.headerlink { - color: #c60f0f; - font-size: 0.8em; - padding: 0 4px 0 4px; - text-decoration: none; -} - -a.headerlink:hover { - background-color: #c60f0f; - color: white; -} - -div.body p, div.body dd, div.body li { - text-align: justify; - line-height: 130%; -} - -div.admonition p.admonition-title + p { - display: inline; -} - -div.admonition p { - margin-bottom: 5px; -} - -div.admonition pre { - margin-bottom: 5px; -} - -div.admonition ul, div.admonition ol { - margin-bottom: 5px; -} - -div.note { - background-color: #eee; - border: 1px solid #ccc; -} - -div.seealso { - background-color: #ffc; - border: 1px solid #ff6; -} - -div.topic { - background-color: #eee; -} - -div.warning { - background-color: #ffe4e4; - border: 1px solid #f66; -} - -p.admonition-title { - display: inline; -} - -p.admonition-title:after { - content: ":"; -} - -pre { - padding: 5px; - background-color: #eeffcc; - color: #333333; - line-height: 120%; - border: 1px solid #ac9; - border-left: none; - border-right: none; -} - -tt { - background-color: #ecf0f3; - padding: 0 1px 0 1px; - font-size: 0.95em; -} - -th { - background-color: #ede; -} - -.warning tt { - background: #efc2c2; -} - -.note tt { - background: #d6d6d6; -} - -.viewcode-back { - font-family: sans-serif; -} - -div.viewcode-block:target { - background-color: #f4debf; - border-top: 1px solid #ac9; - border-bottom: 1px solid #ac9; -} \ No newline at end of file diff --git a/develop/_Sphinx/doc/_build/html/_static/doctools.js b/develop/_Sphinx/doc/_build/html/_static/doctools.js deleted file mode 100755 index c5455c9..0000000 --- a/develop/_Sphinx/doc/_build/html/_static/doctools.js +++ /dev/null @@ -1,238 +0,0 @@ -/* - * doctools.js - * ~~~~~~~~~~~ - * - * Sphinx JavaScript utilities for all documentation. - * - * :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -/** - * select a different prefix for underscore - */ -$u = _.noConflict(); - -/** - * make the code below compatible with browsers without - * an installed firebug like debugger -if (!window.console || !console.firebug) { - var names = ["log", "debug", "info", "warn", "error", "assert", "dir", - "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", - "profile", "profileEnd"]; - window.console = {}; - for (var i = 0; i < names.length; ++i) - window.console[names[i]] = function() {}; -} - */ - -/** - * small helper function to urldecode strings - */ -jQuery.urldecode = function(x) { - return decodeURIComponent(x).replace(/\+/g, ' '); -}; - -/** - * small helper function to urlencode strings - */ -jQuery.urlencode = encodeURIComponent; - -/** - * This function returns the parsed url parameters of the - * current request. Multiple values per key are supported, - * it will always return arrays of strings for the value parts. - */ -jQuery.getQueryParameters = function(s) { - if (typeof s == 'undefined') - s = document.location.search; - var parts = s.substr(s.indexOf('?') + 1).split('&'); - var result = {}; - for (var i = 0; i < parts.length; i++) { - var tmp = parts[i].split('=', 2); - var key = jQuery.urldecode(tmp[0]); - var value = jQuery.urldecode(tmp[1]); - if (key in result) - result[key].push(value); - else - result[key] = [value]; - } - return result; -}; - -/** - * highlight a given string on a jquery object by wrapping it in - * span elements with the given class name. - */ -jQuery.fn.highlightText = function(text, className) { - function highlight(node) { - if (node.nodeType == 3) { - var val = node.nodeValue; - var pos = val.toLowerCase().indexOf(text); - if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { - var span = document.createElement("span"); - span.className = className; - span.appendChild(document.createTextNode(val.substr(pos, text.length))); - node.parentNode.insertBefore(span, node.parentNode.insertBefore( - document.createTextNode(val.substr(pos + text.length)), - node.nextSibling)); - node.nodeValue = val.substr(0, pos); - } - } - else if (!jQuery(node).is("button, select, textarea")) { - jQuery.each(node.childNodes, function() { - highlight(this); - }); - } - } - return this.each(function() { - highlight(this); - }); -}; - -/** - * Small JavaScript module for the documentation. - */ -var Documentation = { - - init : function() { - this.fixFirefoxAnchorBug(); - this.highlightSearchWords(); - this.initIndexTable(); - }, - - /** - * i18n support - */ - TRANSLATIONS : {}, - PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; }, - LOCALE : 'unknown', - - // gettext and ngettext don't access this so that the functions - // can safely bound to a different name (_ = Documentation.gettext) - gettext : function(string) { - var translated = Documentation.TRANSLATIONS[string]; - if (typeof translated == 'undefined') - return string; - return (typeof translated == 'string') ? translated : translated[0]; - }, - - ngettext : function(singular, plural, n) { - var translated = Documentation.TRANSLATIONS[singular]; - if (typeof translated == 'undefined') - return (n == 1) ? singular : plural; - return translated[Documentation.PLURALEXPR(n)]; - }, - - addTranslations : function(catalog) { - for (var key in catalog.messages) - this.TRANSLATIONS[key] = catalog.messages[key]; - this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); - this.LOCALE = catalog.locale; - }, - - /** - * add context elements like header anchor links - */ - addContextElements : function() { - $('div[id] > :header:first').each(function() { - $('\u00B6'). - attr('href', '#' + this.id). - attr('title', _('Permalink to this headline')). - appendTo(this); - }); - $('dt[id]').each(function() { - $('\u00B6'). - attr('href', '#' + this.id). - attr('title', _('Permalink to this definition')). - appendTo(this); - }); - }, - - /** - * workaround a firefox stupidity - */ - fixFirefoxAnchorBug : function() { - if (document.location.hash && $.browser.mozilla) - window.setTimeout(function() { - document.location.href += ''; - }, 10); - }, - - /** - * highlight the search words provided in the url in the text - */ - highlightSearchWords : function() { - var params = $.getQueryParameters(); - var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; - if (terms.length) { - var body = $('div.body'); - if (!body.length) { - body = $('body'); - } - window.setTimeout(function() { - $.each(terms, function() { - body.highlightText(this.toLowerCase(), 'highlighted'); - }); - }, 10); - $('') - .appendTo($('#searchbox')); - } - }, - - /** - * init the domain index toggle buttons - */ - initIndexTable : function() { - var togglers = $('img.toggler').click(function() { - var src = $(this).attr('src'); - var idnum = $(this).attr('id').substr(7); - $('tr.cg-' + idnum).toggle(); - if (src.substr(-9) == 'minus.png') - $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); - else - $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); - }).css('display', ''); - if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { - togglers.click(); - } - }, - - /** - * helper function to hide the search marks again - */ - hideSearchWords : function() { - $('#searchbox .highlight-link').fadeOut(300); - $('span.highlighted').removeClass('highlighted'); - }, - - /** - * make the url absolute - */ - makeURL : function(relativeURL) { - return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; - }, - - /** - * get the current relative url - */ - getCurrentURL : function() { - var path = document.location.pathname; - var parts = path.split(/\//); - $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { - if (this == '..') - parts.pop(); - }); - var url = parts.join('/'); - return path.substring(url.lastIndexOf('/') + 1, path.length - 1); - } -}; - -// quick alias for translations -_ = Documentation.gettext; - -$(document).ready(function() { - Documentation.init(); -}); diff --git a/develop/_Sphinx/doc/_build/html/_static/down-pressed.png b/develop/_Sphinx/doc/_build/html/_static/down-pressed.png deleted file mode 100755 index 6f7ad78..0000000 Binary files a/develop/_Sphinx/doc/_build/html/_static/down-pressed.png and /dev/null differ diff --git a/develop/_Sphinx/doc/_build/html/_static/down.png b/develop/_Sphinx/doc/_build/html/_static/down.png deleted file mode 100755 index 3003a88..0000000 Binary files a/develop/_Sphinx/doc/_build/html/_static/down.png and /dev/null differ diff --git a/develop/_Sphinx/doc/_build/html/_static/file.png b/develop/_Sphinx/doc/_build/html/_static/file.png deleted file mode 100755 index d18082e..0000000 Binary files a/develop/_Sphinx/doc/_build/html/_static/file.png and /dev/null differ diff --git a/develop/_Sphinx/doc/_build/html/_static/jquery.js b/develop/_Sphinx/doc/_build/html/_static/jquery.js deleted file mode 100755 index e2efc33..0000000 --- a/develop/_Sphinx/doc/_build/html/_static/jquery.js +++ /dev/null @@ -1,9404 +0,0 @@ -/*! - * jQuery JavaScript Library v1.7.2 - * http://jquery.com/ - * - * Copyright 2011, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * - * Date: Fri Jul 5 14:07:58 UTC 2013 - */ -(function( window, undefined ) { - -// Use the correct document accordingly with window argument (sandbox) -var document = window.document, - navigator = window.navigator, - location = window.location; -var jQuery = (function() { - -// Define a local copy of jQuery -var jQuery = function( selector, context ) { - // The jQuery object is actually just the init constructor 'enhanced' - return new jQuery.fn.init( selector, context, rootjQuery ); - }, - - // Map over jQuery in case of overwrite - _jQuery = window.jQuery, - - // Map over the $ in case of overwrite - _$ = window.$, - - // A central reference to the root jQuery(document) - rootjQuery, - - // A simple way to check for HTML strings or ID strings - // Prioritize #id over to avoid XSS via location.hash (#9521) - quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/, - - // Check if a string has a non-whitespace character in it - rnotwhite = /\S/, - - // Used for trimming whitespace - trimLeft = /^\s+/, - trimRight = /\s+$/, - - // Match a standalone tag - rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, - - // JSON RegExp - rvalidchars = /^[\],:{}\s]*$/, - rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, - rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, - rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, - - // Useragent RegExp - rwebkit = /(webkit)[ \/]([\w.]+)/, - ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/, - rmsie = /(msie) ([\w.]+)/, - rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/, - - // Matches dashed string for camelizing - rdashAlpha = /-([a-z]|[0-9])/ig, - rmsPrefix = /^-ms-/, - - // Used by jQuery.camelCase as callback to replace() - fcamelCase = function( all, letter ) { - return ( letter + "" ).toUpperCase(); - }, - - // Keep a UserAgent string for use with jQuery.browser - userAgent = navigator.userAgent, - - // For matching the engine and version of the browser - browserMatch, - - // The deferred used on DOM ready - readyList, - - // The ready event handler - DOMContentLoaded, - - // Save a reference to some core methods - toString = Object.prototype.toString, - hasOwn = Object.prototype.hasOwnProperty, - push = Array.prototype.push, - slice = Array.prototype.slice, - trim = String.prototype.trim, - indexOf = Array.prototype.indexOf, - - // [[Class]] -> type pairs - class2type = {}; - -jQuery.fn = jQuery.prototype = { - constructor: jQuery, - init: function( selector, context, rootjQuery ) { - var match, elem, ret, doc; - - // Handle $(""), $(null), or $(undefined) - if ( !selector ) { - return this; - } - - // Handle $(DOMElement) - if ( selector.nodeType ) { - this.context = this[0] = selector; - this.length = 1; - return this; - } - - // The body element only exists once, optimize finding it - if ( selector === "body" && !context && document.body ) { - this.context = document; - this[0] = document.body; - this.selector = selector; - this.length = 1; - return this; - } - - // Handle HTML strings - if ( typeof selector === "string" ) { - // Are we dealing with HTML string or an ID? - if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { - // Assume that strings that start and end with <> are HTML and skip the regex check - match = [ null, selector, null ]; - - } else { - match = quickExpr.exec( selector ); - } - - // Verify a match, and that no context was specified for #id - if ( match && (match[1] || !context) ) { - - // HANDLE: $(html) -> $(array) - if ( match[1] ) { - context = context instanceof jQuery ? context[0] : context; - doc = ( context ? context.ownerDocument || context : document ); - - // If a single string is passed in and it's a single tag - // just do a createElement and skip the rest - ret = rsingleTag.exec( selector ); - - if ( ret ) { - if ( jQuery.isPlainObject( context ) ) { - selector = [ document.createElement( ret[1] ) ]; - jQuery.fn.attr.call( selector, context, true ); - - } else { - selector = [ doc.createElement( ret[1] ) ]; - } - - } else { - ret = jQuery.buildFragment( [ match[1] ], [ doc ] ); - selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes; - } - - return jQuery.merge( this, selector ); - - // HANDLE: $("#id") - } else { - elem = document.getElementById( match[2] ); - - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE and Opera return items - // by name instead of ID - if ( elem.id !== match[2] ) { - return rootjQuery.find( selector ); - } - - // Otherwise, we inject the element directly into the jQuery object - this.length = 1; - this[0] = elem; - } - - this.context = document; - this.selector = selector; - return this; - } - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return ( context || rootjQuery ).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return this.constructor( context ).find( selector ); - } - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( jQuery.isFunction( selector ) ) { - return rootjQuery.ready( selector ); - } - - if ( selector.selector !== undefined ) { - this.selector = selector.selector; - this.context = selector.context; - } - - return jQuery.makeArray( selector, this ); - }, - - // Start with an empty selector - selector: "", - - // The current version of jQuery being used - jquery: "1.7.2", - - // The default length of a jQuery object is 0 - length: 0, - - // The number of elements contained in the matched element set - size: function() { - return this.length; - }, - - toArray: function() { - return slice.call( this, 0 ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - return num == null ? - - // Return a 'clean' array - this.toArray() : - - // Return just the object - ( num < 0 ? this[ this.length + num ] : this[ num ] ); - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems, name, selector ) { - // Build a new jQuery matched element set - var ret = this.constructor(); - - if ( jQuery.isArray( elems ) ) { - push.apply( ret, elems ); - - } else { - jQuery.merge( ret, elems ); - } - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - - ret.context = this.context; - - if ( name === "find" ) { - ret.selector = this.selector + ( this.selector ? " " : "" ) + selector; - } else if ( name ) { - ret.selector = this.selector + "." + name + "(" + selector + ")"; - } - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - // (You can seed the arguments with an array of args, but this is - // only used internally.) - each: function( callback, args ) { - return jQuery.each( this, callback, args ); - }, - - ready: function( fn ) { - // Attach the listeners - jQuery.bindReady(); - - // Add the callback - readyList.add( fn ); - - return this; - }, - - eq: function( i ) { - i = +i; - return i === -1 ? - this.slice( i ) : - this.slice( i, i + 1 ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - slice: function() { - return this.pushStack( slice.apply( this, arguments ), - "slice", slice.call(arguments).join(",") ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map(this, function( elem, i ) { - return callback.call( elem, i, elem ); - })); - }, - - end: function() { - return this.prevObject || this.constructor(null); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: push, - sort: [].sort, - splice: [].splice -}; - -// Give the init function the jQuery prototype for later instantiation -jQuery.fn.init.prototype = jQuery.fn; - -jQuery.extend = jQuery.fn.extend = function() { - var options, name, src, copy, copyIsArray, clone, - target = arguments[0] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - target = arguments[1] || {}; - // skip the boolean and the target - i = 2; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction(target) ) { - target = {}; - } - - // extend jQuery itself if only one argument is passed - if ( length === i ) { - target = this; - --i; - } - - for ( ; i < length; i++ ) { - // Only deal with non-null/undefined values - if ( (options = arguments[ i ]) != null ) { - // Extend the base object - for ( name in options ) { - src = target[ name ]; - copy = options[ name ]; - - // Prevent never-ending loop - if ( target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { - if ( copyIsArray ) { - copyIsArray = false; - clone = src && jQuery.isArray(src) ? src : []; - - } else { - clone = src && jQuery.isPlainObject(src) ? src : {}; - } - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend({ - noConflict: function( deep ) { - if ( window.$ === jQuery ) { - window.$ = _$; - } - - if ( deep && window.jQuery === jQuery ) { - window.jQuery = _jQuery; - } - - return jQuery; - }, - - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // A counter to track how many items to wait for before - // the ready event fires. See #6781 - readyWait: 1, - - // Hold (or release) the ready event - holdReady: function( hold ) { - if ( hold ) { - jQuery.readyWait++; - } else { - jQuery.ready( true ); - } - }, - - // Handle when the DOM is ready - ready: function( wait ) { - // Either a released hold or an DOMready/load event and not yet ready - if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) { - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( !document.body ) { - return setTimeout( jQuery.ready, 1 ); - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.fireWith( document, [ jQuery ] ); - - // Trigger any bound ready events - if ( jQuery.fn.trigger ) { - jQuery( document ).trigger( "ready" ).off( "ready" ); - } - } - }, - - bindReady: function() { - if ( readyList ) { - return; - } - - readyList = jQuery.Callbacks( "once memory" ); - - // Catch cases where $(document).ready() is called after the - // browser event has already occurred. - if ( document.readyState === "complete" ) { - // Handle it asynchronously to allow scripts the opportunity to delay ready - return setTimeout( jQuery.ready, 1 ); - } - - // Mozilla, Opera and webkit nightlies currently support this event - if ( document.addEventListener ) { - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", jQuery.ready, false ); - - // If IE event model is used - } else if ( document.attachEvent ) { - // ensure firing before onload, - // maybe late but safe also for iframes - document.attachEvent( "onreadystatechange", DOMContentLoaded ); - - // A fallback to window.onload, that will always work - window.attachEvent( "onload", jQuery.ready ); - - // If IE and not a frame - // continually check to see if the document is ready - var toplevel = false; - - try { - toplevel = window.frameElement == null; - } catch(e) {} - - if ( document.documentElement.doScroll && toplevel ) { - doScrollCheck(); - } - } - }, - - // See test/unit/core.js for details concerning isFunction. - // Since version 1.3, DOM methods and functions like alert - // aren't supported. They return false on IE (#2968). - isFunction: function( obj ) { - return jQuery.type(obj) === "function"; - }, - - isArray: Array.isArray || function( obj ) { - return jQuery.type(obj) === "array"; - }, - - isWindow: function( obj ) { - return obj != null && obj == obj.window; - }, - - isNumeric: function( obj ) { - return !isNaN( parseFloat(obj) ) && isFinite( obj ); - }, - - type: function( obj ) { - return obj == null ? - String( obj ) : - class2type[ toString.call(obj) ] || "object"; - }, - - isPlainObject: function( obj ) { - // Must be an Object. - // Because of IE, we also have to check the presence of the constructor property. - // Make sure that DOM nodes and window objects don't pass through, as well - if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { - return false; - } - - try { - // Not own constructor property must be Object - if ( obj.constructor && - !hasOwn.call(obj, "constructor") && - !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { - return false; - } - } catch ( e ) { - // IE8,9 Will throw exceptions on certain host objects #9897 - return false; - } - - // Own properties are enumerated firstly, so to speed up, - // if last one is own, then all properties are own. - - var key; - for ( key in obj ) {} - - return key === undefined || hasOwn.call( obj, key ); - }, - - isEmptyObject: function( obj ) { - for ( var name in obj ) { - return false; - } - return true; - }, - - error: function( msg ) { - throw new Error( msg ); - }, - - parseJSON: function( data ) { - if ( typeof data !== "string" || !data ) { - return null; - } - - // Make sure leading/trailing whitespace is removed (IE can't handle it) - data = jQuery.trim( data ); - - // Attempt to parse using the native JSON parser first - if ( window.JSON && window.JSON.parse ) { - return window.JSON.parse( data ); - } - - // Make sure the incoming data is actual JSON - // Logic borrowed from http://json.org/json2.js - if ( rvalidchars.test( data.replace( rvalidescape, "@" ) - .replace( rvalidtokens, "]" ) - .replace( rvalidbraces, "")) ) { - - return ( new Function( "return " + data ) )(); - - } - jQuery.error( "Invalid JSON: " + data ); - }, - - // Cross-browser xml parsing - parseXML: function( data ) { - if ( typeof data !== "string" || !data ) { - return null; - } - var xml, tmp; - try { - if ( window.DOMParser ) { // Standard - tmp = new DOMParser(); - xml = tmp.parseFromString( data , "text/xml" ); - } else { // IE - xml = new ActiveXObject( "Microsoft.XMLDOM" ); - xml.async = "false"; - xml.loadXML( data ); - } - } catch( e ) { - xml = undefined; - } - if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { - jQuery.error( "Invalid XML: " + data ); - } - return xml; - }, - - noop: function() {}, - - // Evaluates a script in a global context - // Workarounds based on findings by Jim Driscoll - // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context - globalEval: function( data ) { - if ( data && rnotwhite.test( data ) ) { - // We use execScript on Internet Explorer - // We use an anonymous function so that context is window - // rather than jQuery in Firefox - ( window.execScript || function( data ) { - window[ "eval" ].call( window, data ); - } )( data ); - } - }, - - // Convert dashed to camelCase; used by the css and data modules - // Microsoft forgot to hump their vendor prefix (#9572) - camelCase: function( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); - }, - - nodeName: function( elem, name ) { - return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); - }, - - // args is for internal usage only - each: function( object, callback, args ) { - var name, i = 0, - length = object.length, - isObj = length === undefined || jQuery.isFunction( object ); - - if ( args ) { - if ( isObj ) { - for ( name in object ) { - if ( callback.apply( object[ name ], args ) === false ) { - break; - } - } - } else { - for ( ; i < length; ) { - if ( callback.apply( object[ i++ ], args ) === false ) { - break; - } - } - } - - // A special, fast, case for the most common use of each - } else { - if ( isObj ) { - for ( name in object ) { - if ( callback.call( object[ name ], name, object[ name ] ) === false ) { - break; - } - } - } else { - for ( ; i < length; ) { - if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) { - break; - } - } - } - } - - return object; - }, - - // Use native String.trim function wherever possible - trim: trim ? - function( text ) { - return text == null ? - "" : - trim.call( text ); - } : - - // Otherwise use our own trimming functionality - function( text ) { - return text == null ? - "" : - text.toString().replace( trimLeft, "" ).replace( trimRight, "" ); - }, - - // results is for internal usage only - makeArray: function( array, results ) { - var ret = results || []; - - if ( array != null ) { - // The window, strings (and functions) also have 'length' - // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 - var type = jQuery.type( array ); - - if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) { - push.call( ret, array ); - } else { - jQuery.merge( ret, array ); - } - } - - return ret; - }, - - inArray: function( elem, array, i ) { - var len; - - if ( array ) { - if ( indexOf ) { - return indexOf.call( array, elem, i ); - } - - len = array.length; - i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; - - for ( ; i < len; i++ ) { - // Skip accessing in sparse arrays - if ( i in array && array[ i ] === elem ) { - return i; - } - } - } - - return -1; - }, - - merge: function( first, second ) { - var i = first.length, - j = 0; - - if ( typeof second.length === "number" ) { - for ( var l = second.length; j < l; j++ ) { - first[ i++ ] = second[ j ]; - } - - } else { - while ( second[j] !== undefined ) { - first[ i++ ] = second[ j++ ]; - } - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, inv ) { - var ret = [], retVal; - inv = !!inv; - - // Go through the array, only saving the items - // that pass the validator function - for ( var i = 0, length = elems.length; i < length; i++ ) { - retVal = !!callback( elems[ i ], i ); - if ( inv !== retVal ) { - ret.push( elems[ i ] ); - } - } - - return ret; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var value, key, ret = [], - i = 0, - length = elems.length, - // jquery objects are treated as arrays - isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ; - - // Go through the array, translating each of the items to their - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret[ ret.length ] = value; - } - } - - // Go through every key on the object, - } else { - for ( key in elems ) { - value = callback( elems[ key ], key, arg ); - - if ( value != null ) { - ret[ ret.length ] = value; - } - } - } - - // Flatten any nested arrays - return ret.concat.apply( [], ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // Bind a function to a context, optionally partially applying any - // arguments. - proxy: function( fn, context ) { - if ( typeof context === "string" ) { - var tmp = fn[ context ]; - context = fn; - fn = tmp; - } - - // Quick check to determine if target is callable, in the spec - // this throws a TypeError, but we will just return undefined. - if ( !jQuery.isFunction( fn ) ) { - return undefined; - } - - // Simulated bind - var args = slice.call( arguments, 2 ), - proxy = function() { - return fn.apply( context, args.concat( slice.call( arguments ) ) ); - }; - - // Set the guid of unique handler to the same of original handler, so it can be removed - proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; - - return proxy; - }, - - // Mutifunctional method to get and set values to a collection - // The value/s can optionally be executed if it's a function - access: function( elems, fn, key, value, chainable, emptyGet, pass ) { - var exec, - bulk = key == null, - i = 0, - length = elems.length; - - // Sets many values - if ( key && typeof key === "object" ) { - for ( i in key ) { - jQuery.access( elems, fn, i, key[i], 1, emptyGet, value ); - } - chainable = 1; - - // Sets one value - } else if ( value !== undefined ) { - // Optionally, function values get executed if exec is true - exec = pass === undefined && jQuery.isFunction( value ); - - if ( bulk ) { - // Bulk operations only iterate when executing function values - if ( exec ) { - exec = fn; - fn = function( elem, key, value ) { - return exec.call( jQuery( elem ), value ); - }; - - // Otherwise they run against the entire set - } else { - fn.call( elems, value ); - fn = null; - } - } - - if ( fn ) { - for (; i < length; i++ ) { - fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); - } - } - - chainable = 1; - } - - return chainable ? - elems : - - // Gets - bulk ? - fn.call( elems ) : - length ? fn( elems[0], key ) : emptyGet; - }, - - now: function() { - return ( new Date() ).getTime(); - }, - - // Use of jQuery.browser is frowned upon. - // More details: http://docs.jquery.com/Utilities/jQuery.browser - uaMatch: function( ua ) { - ua = ua.toLowerCase(); - - var match = rwebkit.exec( ua ) || - ropera.exec( ua ) || - rmsie.exec( ua ) || - ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) || - []; - - return { browser: match[1] || "", version: match[2] || "0" }; - }, - - sub: function() { - function jQuerySub( selector, context ) { - return new jQuerySub.fn.init( selector, context ); - } - jQuery.extend( true, jQuerySub, this ); - jQuerySub.superclass = this; - jQuerySub.fn = jQuerySub.prototype = this(); - jQuerySub.fn.constructor = jQuerySub; - jQuerySub.sub = this.sub; - jQuerySub.fn.init = function init( selector, context ) { - if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) { - context = jQuerySub( context ); - } - - return jQuery.fn.init.call( this, selector, context, rootjQuerySub ); - }; - jQuerySub.fn.init.prototype = jQuerySub.fn; - var rootjQuerySub = jQuerySub(document); - return jQuerySub; - }, - - browser: {} -}); - -// Populate the class2type map -jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); -}); - -browserMatch = jQuery.uaMatch( userAgent ); -if ( browserMatch.browser ) { - jQuery.browser[ browserMatch.browser ] = true; - jQuery.browser.version = browserMatch.version; -} - -// Deprecated, use jQuery.browser.webkit instead -if ( jQuery.browser.webkit ) { - jQuery.browser.safari = true; -} - -// IE doesn't match non-breaking spaces with \s -if ( rnotwhite.test( "\xA0" ) ) { - trimLeft = /^[\s\xA0]+/; - trimRight = /[\s\xA0]+$/; -} - -// All jQuery objects should point back to these -rootjQuery = jQuery(document); - -// Cleanup functions for the document ready method -if ( document.addEventListener ) { - DOMContentLoaded = function() { - document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); - jQuery.ready(); - }; - -} else if ( document.attachEvent ) { - DOMContentLoaded = function() { - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( document.readyState === "complete" ) { - document.detachEvent( "onreadystatechange", DOMContentLoaded ); - jQuery.ready(); - } - }; -} - -// The DOM ready check for Internet Explorer -function doScrollCheck() { - if ( jQuery.isReady ) { - return; - } - - try { - // If IE is used, use the trick by Diego Perini - // http://javascript.nwbox.com/IEContentLoaded/ - document.documentElement.doScroll("left"); - } catch(e) { - setTimeout( doScrollCheck, 1 ); - return; - } - - // and execute any waiting functions - jQuery.ready(); -} - -return jQuery; - -})(); - - -// String to Object flags format cache -var flagsCache = {}; - -// Convert String-formatted flags into Object-formatted ones and store in cache -function createFlags( flags ) { - var object = flagsCache[ flags ] = {}, - i, length; - flags = flags.split( /\s+/ ); - for ( i = 0, length = flags.length; i < length; i++ ) { - object[ flags[i] ] = true; - } - return object; -} - -/* - * Create a callback list using the following parameters: - * - * flags: an optional list of space-separated flags that will change how - * the callback list behaves - * - * By default a callback list will act like an event callback list and can be - * "fired" multiple times. - * - * Possible flags: - * - * once: will ensure the callback list can only be fired once (like a Deferred) - * - * memory: will keep track of previous values and will call any callback added - * after the list has been fired right away with the latest "memorized" - * values (like a Deferred) - * - * unique: will ensure a callback can only be added once (no duplicate in the list) - * - * stopOnFalse: interrupt callings when a callback returns false - * - */ -jQuery.Callbacks = function( flags ) { - - // Convert flags from String-formatted to Object-formatted - // (we check in cache first) - flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {}; - - var // Actual callback list - list = [], - // Stack of fire calls for repeatable lists - stack = [], - // Last fire value (for non-forgettable lists) - memory, - // Flag to know if list was already fired - fired, - // Flag to know if list is currently firing - firing, - // First callback to fire (used internally by add and fireWith) - firingStart, - // End of the loop when firing - firingLength, - // Index of currently firing callback (modified by remove if needed) - firingIndex, - // Add one or several callbacks to the list - add = function( args ) { - var i, - length, - elem, - type, - actual; - for ( i = 0, length = args.length; i < length; i++ ) { - elem = args[ i ]; - type = jQuery.type( elem ); - if ( type === "array" ) { - // Inspect recursively - add( elem ); - } else if ( type === "function" ) { - // Add if not in unique mode and callback is not in - if ( !flags.unique || !self.has( elem ) ) { - list.push( elem ); - } - } - } - }, - // Fire callbacks - fire = function( context, args ) { - args = args || []; - memory = !flags.memory || [ context, args ]; - fired = true; - firing = true; - firingIndex = firingStart || 0; - firingStart = 0; - firingLength = list.length; - for ( ; list && firingIndex < firingLength; firingIndex++ ) { - if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) { - memory = true; // Mark as halted - break; - } - } - firing = false; - if ( list ) { - if ( !flags.once ) { - if ( stack && stack.length ) { - memory = stack.shift(); - self.fireWith( memory[ 0 ], memory[ 1 ] ); - } - } else if ( memory === true ) { - self.disable(); - } else { - list = []; - } - } - }, - // Actual Callbacks object - self = { - // Add a callback or a collection of callbacks to the list - add: function() { - if ( list ) { - var length = list.length; - add( arguments ); - // Do we need to add the callbacks to the - // current firing batch? - if ( firing ) { - firingLength = list.length; - // With memory, if we're not firing then - // we should call right away, unless previous - // firing was halted (stopOnFalse) - } else if ( memory && memory !== true ) { - firingStart = length; - fire( memory[ 0 ], memory[ 1 ] ); - } - } - return this; - }, - // Remove a callback from the list - remove: function() { - if ( list ) { - var args = arguments, - argIndex = 0, - argLength = args.length; - for ( ; argIndex < argLength ; argIndex++ ) { - for ( var i = 0; i < list.length; i++ ) { - if ( args[ argIndex ] === list[ i ] ) { - // Handle firingIndex and firingLength - if ( firing ) { - if ( i <= firingLength ) { - firingLength--; - if ( i <= firingIndex ) { - firingIndex--; - } - } - } - // Remove the element - list.splice( i--, 1 ); - // If we have some unicity property then - // we only need to do this once - if ( flags.unique ) { - break; - } - } - } - } - } - return this; - }, - // Control if a given callback is in the list - has: function( fn ) { - if ( list ) { - var i = 0, - length = list.length; - for ( ; i < length; i++ ) { - if ( fn === list[ i ] ) { - return true; - } - } - } - return false; - }, - // Remove all callbacks from the list - empty: function() { - list = []; - return this; - }, - // Have the list do nothing anymore - disable: function() { - list = stack = memory = undefined; - return this; - }, - // Is it disabled? - disabled: function() { - return !list; - }, - // Lock the list in its current state - lock: function() { - stack = undefined; - if ( !memory || memory === true ) { - self.disable(); - } - return this; - }, - // Is it locked? - locked: function() { - return !stack; - }, - // Call all callbacks with the given context and arguments - fireWith: function( context, args ) { - if ( stack ) { - if ( firing ) { - if ( !flags.once ) { - stack.push( [ context, args ] ); - } - } else if ( !( flags.once && memory ) ) { - fire( context, args ); - } - } - return this; - }, - // Call all the callbacks with the given arguments - fire: function() { - self.fireWith( this, arguments ); - return this; - }, - // To know if the callbacks have already been called at least once - fired: function() { - return !!fired; - } - }; - - return self; -}; - - - - -var // Static reference to slice - sliceDeferred = [].slice; - -jQuery.extend({ - - Deferred: function( func ) { - var doneList = jQuery.Callbacks( "once memory" ), - failList = jQuery.Callbacks( "once memory" ), - progressList = jQuery.Callbacks( "memory" ), - state = "pending", - lists = { - resolve: doneList, - reject: failList, - notify: progressList - }, - promise = { - done: doneList.add, - fail: failList.add, - progress: progressList.add, - - state: function() { - return state; - }, - - // Deprecated - isResolved: doneList.fired, - isRejected: failList.fired, - - then: function( doneCallbacks, failCallbacks, progressCallbacks ) { - deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks ); - return this; - }, - always: function() { - deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments ); - return this; - }, - pipe: function( fnDone, fnFail, fnProgress ) { - return jQuery.Deferred(function( newDefer ) { - jQuery.each( { - done: [ fnDone, "resolve" ], - fail: [ fnFail, "reject" ], - progress: [ fnProgress, "notify" ] - }, function( handler, data ) { - var fn = data[ 0 ], - action = data[ 1 ], - returned; - if ( jQuery.isFunction( fn ) ) { - deferred[ handler ](function() { - returned = fn.apply( this, arguments ); - if ( returned && jQuery.isFunction( returned.promise ) ) { - returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify ); - } else { - newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] ); - } - }); - } else { - deferred[ handler ]( newDefer[ action ] ); - } - }); - }).promise(); - }, - // Get a promise for this deferred - // If obj is provided, the promise aspect is added to the object - promise: function( obj ) { - if ( obj == null ) { - obj = promise; - } else { - for ( var key in promise ) { - obj[ key ] = promise[ key ]; - } - } - return obj; - } - }, - deferred = promise.promise({}), - key; - - for ( key in lists ) { - deferred[ key ] = lists[ key ].fire; - deferred[ key + "With" ] = lists[ key ].fireWith; - } - - // Handle state - deferred.done( function() { - state = "resolved"; - }, failList.disable, progressList.lock ).fail( function() { - state = "rejected"; - }, doneList.disable, progressList.lock ); - - // Call given func if any - if ( func ) { - func.call( deferred, deferred ); - } - - // All done! - return deferred; - }, - - // Deferred helper - when: function( firstParam ) { - var args = sliceDeferred.call( arguments, 0 ), - i = 0, - length = args.length, - pValues = new Array( length ), - count = length, - pCount = length, - deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ? - firstParam : - jQuery.Deferred(), - promise = deferred.promise(); - function resolveFunc( i ) { - return function( value ) { - args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; - if ( !( --count ) ) { - deferred.resolveWith( deferred, args ); - } - }; - } - function progressFunc( i ) { - return function( value ) { - pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; - deferred.notifyWith( promise, pValues ); - }; - } - if ( length > 1 ) { - for ( ; i < length; i++ ) { - if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) { - args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) ); - } else { - --count; - } - } - if ( !count ) { - deferred.resolveWith( deferred, args ); - } - } else if ( deferred !== firstParam ) { - deferred.resolveWith( deferred, length ? [ firstParam ] : [] ); - } - return promise; - } -}); - - - - -jQuery.support = (function() { - - var support, - all, - a, - select, - opt, - input, - fragment, - tds, - events, - eventName, - i, - isSupported, - div = document.createElement( "div" ), - documentElement = document.documentElement; - - // Preliminary tests - div.setAttribute("className", "t"); - div.innerHTML = "
a"; - - all = div.getElementsByTagName( "*" ); - a = div.getElementsByTagName( "a" )[ 0 ]; - - // Can't get basic test support - if ( !all || !all.length || !a ) { - return {}; - } - - // First batch of supports tests - select = document.createElement( "select" ); - opt = select.appendChild( document.createElement("option") ); - input = div.getElementsByTagName( "input" )[ 0 ]; - - support = { - // IE strips leading whitespace when .innerHTML is used - leadingWhitespace: ( div.firstChild.nodeType === 3 ), - - // Make sure that tbody elements aren't automatically inserted - // IE will insert them into empty tables - tbody: !div.getElementsByTagName("tbody").length, - - // Make sure that link elements get serialized correctly by innerHTML - // This requires a wrapper element in IE - htmlSerialize: !!div.getElementsByTagName("link").length, - - // Get the style information from getAttribute - // (IE uses .cssText instead) - style: /top/.test( a.getAttribute("style") ), - - // Make sure that URLs aren't manipulated - // (IE normalizes it by default) - hrefNormalized: ( a.getAttribute("href") === "/a" ), - - // Make sure that element opacity exists - // (IE uses filter instead) - // Use a regex to work around a WebKit issue. See #5145 - opacity: /^0.55/.test( a.style.opacity ), - - // Verify style float existence - // (IE uses styleFloat instead of cssFloat) - cssFloat: !!a.style.cssFloat, - - // Make sure that if no value is specified for a checkbox - // that it defaults to "on". - // (WebKit defaults to "" instead) - checkOn: ( input.value === "on" ), - - // Make sure that a selected-by-default option has a working selected property. - // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) - optSelected: opt.selected, - - // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) - getSetAttribute: div.className !== "t", - - // Tests for enctype support on a form(#6743) - enctype: !!document.createElement("form").enctype, - - // Makes sure cloning an html5 element does not cause problems - // Where outerHTML is undefined, this still works - html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav>", - - // Will be defined later - submitBubbles: true, - changeBubbles: true, - focusinBubbles: false, - deleteExpando: true, - noCloneEvent: true, - inlineBlockNeedsLayout: false, - shrinkWrapBlocks: false, - reliableMarginRight: true, - pixelMargin: true - }; - - // jQuery.boxModel DEPRECATED in 1.3, use jQuery.support.boxModel instead - jQuery.boxModel = support.boxModel = (document.compatMode === "CSS1Compat"); - - // Make sure checked status is properly cloned - input.checked = true; - support.noCloneChecked = input.cloneNode( true ).checked; - - // Make sure that the options inside disabled selects aren't marked as disabled - // (WebKit marks them as disabled) - select.disabled = true; - support.optDisabled = !opt.disabled; - - // Test to see if it's possible to delete an expando from an element - // Fails in Internet Explorer - try { - delete div.test; - } catch( e ) { - support.deleteExpando = false; - } - - if ( !div.addEventListener && div.attachEvent && div.fireEvent ) { - div.attachEvent( "onclick", function() { - // Cloning a node shouldn't copy over any - // bound event handlers (IE does this) - support.noCloneEvent = false; - }); - div.cloneNode( true ).fireEvent( "onclick" ); - } - - // Check if a radio maintains its value - // after being appended to the DOM - input = document.createElement("input"); - input.value = "t"; - input.setAttribute("type", "radio"); - support.radioValue = input.value === "t"; - - input.setAttribute("checked", "checked"); - - // #11217 - WebKit loses check when the name is after the checked attribute - input.setAttribute( "name", "t" ); - - div.appendChild( input ); - fragment = document.createDocumentFragment(); - fragment.appendChild( div.lastChild ); - - // WebKit doesn't clone checked state correctly in fragments - support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; - - // Check if a disconnected checkbox will retain its checked - // value of true after appended to the DOM (IE6/7) - support.appendChecked = input.checked; - - fragment.removeChild( input ); - fragment.appendChild( div ); - - // Technique from Juriy Zaytsev - // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/ - // We only care about the case where non-standard event systems - // are used, namely in IE. Short-circuiting here helps us to - // avoid an eval call (in setAttribute) which can cause CSP - // to go haywire. See: https://developer.mozilla.org/en/Security/CSP - if ( div.attachEvent ) { - for ( i in { - submit: 1, - change: 1, - focusin: 1 - }) { - eventName = "on" + i; - isSupported = ( eventName in div ); - if ( !isSupported ) { - div.setAttribute( eventName, "return;" ); - isSupported = ( typeof div[ eventName ] === "function" ); - } - support[ i + "Bubbles" ] = isSupported; - } - } - - fragment.removeChild( div ); - - // Null elements to avoid leaks in IE - fragment = select = opt = div = input = null; - - // Run tests that need a body at doc ready - jQuery(function() { - var container, outer, inner, table, td, offsetSupport, - marginDiv, conMarginTop, style, html, positionTopLeftWidthHeight, - paddingMarginBorderVisibility, paddingMarginBorder, - body = document.getElementsByTagName("body")[0]; - - if ( !body ) { - // Return for frameset docs that don't have a body - return; - } - - conMarginTop = 1; - paddingMarginBorder = "padding:0;margin:0;border:"; - positionTopLeftWidthHeight = "position:absolute;top:0;left:0;width:1px;height:1px;"; - paddingMarginBorderVisibility = paddingMarginBorder + "0;visibility:hidden;"; - style = "style='" + positionTopLeftWidthHeight + paddingMarginBorder + "5px solid #000;"; - html = "
" + - "" + - "
"; - - container = document.createElement("div"); - container.style.cssText = paddingMarginBorderVisibility + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px"; - body.insertBefore( container, body.firstChild ); - - // Construct the test element - div = document.createElement("div"); - container.appendChild( div ); - - // Check if table cells still have offsetWidth/Height when they are set - // to display:none and there are still other visible table cells in a - // table row; if so, offsetWidth/Height are not reliable for use when - // determining if an element has been hidden directly using - // display:none (it is still safe to use offsets if a parent element is - // hidden; don safety goggles and see bug #4512 for more information). - // (only IE 8 fails this test) - div.innerHTML = "
t
"; - tds = div.getElementsByTagName( "td" ); - isSupported = ( tds[ 0 ].offsetHeight === 0 ); - - tds[ 0 ].style.display = ""; - tds[ 1 ].style.display = "none"; - - // Check if empty table cells still have offsetWidth/Height - // (IE <= 8 fail this test) - support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); - - // Check if div with explicit width and no margin-right incorrectly - // gets computed margin-right based on width of container. For more - // info see bug #3333 - // Fails in WebKit before Feb 2011 nightlies - // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right - if ( window.getComputedStyle ) { - div.innerHTML = ""; - marginDiv = document.createElement( "div" ); - marginDiv.style.width = "0"; - marginDiv.style.marginRight = "0"; - div.style.width = "2px"; - div.appendChild( marginDiv ); - support.reliableMarginRight = - ( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0; - } - - if ( typeof div.style.zoom !== "undefined" ) { - // Check if natively block-level elements act like inline-block - // elements when setting their display to 'inline' and giving - // them layout - // (IE < 8 does this) - div.innerHTML = ""; - div.style.width = div.style.padding = "1px"; - div.style.border = 0; - div.style.overflow = "hidden"; - div.style.display = "inline"; - div.style.zoom = 1; - support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); - - // Check if elements with layout shrink-wrap their children - // (IE 6 does this) - div.style.display = "block"; - div.style.overflow = "visible"; - div.innerHTML = "
"; - support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); - } - - div.style.cssText = positionTopLeftWidthHeight + paddingMarginBorderVisibility; - div.innerHTML = html; - - outer = div.firstChild; - inner = outer.firstChild; - td = outer.nextSibling.firstChild.firstChild; - - offsetSupport = { - doesNotAddBorder: ( inner.offsetTop !== 5 ), - doesAddBorderForTableAndCells: ( td.offsetTop === 5 ) - }; - - inner.style.position = "fixed"; - inner.style.top = "20px"; - - // safari subtracts parent border width here which is 5px - offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 ); - inner.style.position = inner.style.top = ""; - - outer.style.overflow = "hidden"; - outer.style.position = "relative"; - - offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 ); - offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop ); - - if ( window.getComputedStyle ) { - div.style.marginTop = "1%"; - support.pixelMargin = ( window.getComputedStyle( div, null ) || { marginTop: 0 } ).marginTop !== "1%"; - } - - if ( typeof container.style.zoom !== "undefined" ) { - container.style.zoom = 1; - } - - body.removeChild( container ); - marginDiv = div = container = null; - - jQuery.extend( support, offsetSupport ); - }); - - return support; -})(); - - - - -var rbrace = /^(?:\{.*\}|\[.*\])$/, - rmultiDash = /([A-Z])/g; - -jQuery.extend({ - cache: {}, - - // Please use with caution - uuid: 0, - - // Unique for each copy of jQuery on the page - // Non-digits removed to match rinlinejQuery - expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ), - - // The following elements throw uncatchable exceptions if you - // attempt to add expando properties to them. - noData: { - "embed": true, - // Ban all objects except for Flash (which handle expandos) - "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", - "applet": true - }, - - hasData: function( elem ) { - elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; - return !!elem && !isEmptyDataObject( elem ); - }, - - data: function( elem, name, data, pvt /* Internal Use Only */ ) { - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var privateCache, thisCache, ret, - internalKey = jQuery.expando, - getByName = typeof name === "string", - - // We have to handle DOM nodes and JS objects differently because IE6-7 - // can't GC object references properly across the DOM-JS boundary - isNode = elem.nodeType, - - // Only DOM nodes need the global jQuery cache; JS object data is - // attached directly to the object so GC can occur automatically - cache = isNode ? jQuery.cache : elem, - - // Only defining an ID for JS objects if its cache already exists allows - // the code to shortcut on the same path as a DOM node with no cache - id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey, - isEvents = name === "events"; - - // Avoid doing any more work than we need to when trying to get data on an - // object that has no data at all - if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) { - return; - } - - if ( !id ) { - // Only DOM nodes need a new unique ID for each element since their data - // ends up in the global cache - if ( isNode ) { - elem[ internalKey ] = id = ++jQuery.uuid; - } else { - id = internalKey; - } - } - - if ( !cache[ id ] ) { - cache[ id ] = {}; - - // Avoids exposing jQuery metadata on plain JS objects when the object - // is serialized using JSON.stringify - if ( !isNode ) { - cache[ id ].toJSON = jQuery.noop; - } - } - - // An object can be passed to jQuery.data instead of a key/value pair; this gets - // shallow copied over onto the existing cache - if ( typeof name === "object" || typeof name === "function" ) { - if ( pvt ) { - cache[ id ] = jQuery.extend( cache[ id ], name ); - } else { - cache[ id ].data = jQuery.extend( cache[ id ].data, name ); - } - } - - privateCache = thisCache = cache[ id ]; - - // jQuery data() is stored in a separate object inside the object's internal data - // cache in order to avoid key collisions between internal data and user-defined - // data. - if ( !pvt ) { - if ( !thisCache.data ) { - thisCache.data = {}; - } - - thisCache = thisCache.data; - } - - if ( data !== undefined ) { - thisCache[ jQuery.camelCase( name ) ] = data; - } - - // Users should not attempt to inspect the internal events object using jQuery.data, - // it is undocumented and subject to change. But does anyone listen? No. - if ( isEvents && !thisCache[ name ] ) { - return privateCache.events; - } - - // Check for both converted-to-camel and non-converted data property names - // If a data property was specified - if ( getByName ) { - - // First Try to find as-is property data - ret = thisCache[ name ]; - - // Test for null|undefined property data - if ( ret == null ) { - - // Try to find the camelCased property - ret = thisCache[ jQuery.camelCase( name ) ]; - } - } else { - ret = thisCache; - } - - return ret; - }, - - removeData: function( elem, name, pvt /* Internal Use Only */ ) { - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var thisCache, i, l, - - // Reference to internal data cache key - internalKey = jQuery.expando, - - isNode = elem.nodeType, - - // See jQuery.data for more information - cache = isNode ? jQuery.cache : elem, - - // See jQuery.data for more information - id = isNode ? elem[ internalKey ] : internalKey; - - // If there is already no cache entry for this object, there is no - // purpose in continuing - if ( !cache[ id ] ) { - return; - } - - if ( name ) { - - thisCache = pvt ? cache[ id ] : cache[ id ].data; - - if ( thisCache ) { - - // Support array or space separated string names for data keys - if ( !jQuery.isArray( name ) ) { - - // try the string as a key before any manipulation - if ( name in thisCache ) { - name = [ name ]; - } else { - - // split the camel cased version by spaces unless a key with the spaces exists - name = jQuery.camelCase( name ); - if ( name in thisCache ) { - name = [ name ]; - } else { - name = name.split( " " ); - } - } - } - - for ( i = 0, l = name.length; i < l; i++ ) { - delete thisCache[ name[i] ]; - } - - // If there is no data left in the cache, we want to continue - // and let the cache object itself get destroyed - if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) { - return; - } - } - } - - // See jQuery.data for more information - if ( !pvt ) { - delete cache[ id ].data; - - // Don't destroy the parent cache unless the internal data object - // had been the only thing left in it - if ( !isEmptyDataObject(cache[ id ]) ) { - return; - } - } - - // Browsers that fail expando deletion also refuse to delete expandos on - // the window, but it will allow it on all other JS objects; other browsers - // don't care - // Ensure that `cache` is not a window object #10080 - if ( jQuery.support.deleteExpando || !cache.setInterval ) { - delete cache[ id ]; - } else { - cache[ id ] = null; - } - - // We destroyed the cache and need to eliminate the expando on the node to avoid - // false lookups in the cache for entries that no longer exist - if ( isNode ) { - // IE does not allow us to delete expando properties from nodes, - // nor does it have a removeAttribute function on Document nodes; - // we must handle all of these cases - if ( jQuery.support.deleteExpando ) { - delete elem[ internalKey ]; - } else if ( elem.removeAttribute ) { - elem.removeAttribute( internalKey ); - } else { - elem[ internalKey ] = null; - } - } - }, - - // For internal use only. - _data: function( elem, name, data ) { - return jQuery.data( elem, name, data, true ); - }, - - // A method for determining if a DOM node can handle the data expando - acceptData: function( elem ) { - if ( elem.nodeName ) { - var match = jQuery.noData[ elem.nodeName.toLowerCase() ]; - - if ( match ) { - return !(match === true || elem.getAttribute("classid") !== match); - } - } - - return true; - } -}); - -jQuery.fn.extend({ - data: function( key, value ) { - var parts, part, attr, name, l, - elem = this[0], - i = 0, - data = null; - - // Gets all values - if ( key === undefined ) { - if ( this.length ) { - data = jQuery.data( elem ); - - if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { - attr = elem.attributes; - for ( l = attr.length; i < l; i++ ) { - name = attr[i].name; - - if ( name.indexOf( "data-" ) === 0 ) { - name = jQuery.camelCase( name.substring(5) ); - - dataAttr( elem, name, data[ name ] ); - } - } - jQuery._data( elem, "parsedAttrs", true ); - } - } - - return data; - } - - // Sets multiple values - if ( typeof key === "object" ) { - return this.each(function() { - jQuery.data( this, key ); - }); - } - - parts = key.split( ".", 2 ); - parts[1] = parts[1] ? "." + parts[1] : ""; - part = parts[1] + "!"; - - return jQuery.access( this, function( value ) { - - if ( value === undefined ) { - data = this.triggerHandler( "getData" + part, [ parts[0] ] ); - - // Try to fetch any internally stored data first - if ( data === undefined && elem ) { - data = jQuery.data( elem, key ); - data = dataAttr( elem, key, data ); - } - - return data === undefined && parts[1] ? - this.data( parts[0] ) : - data; - } - - parts[1] = value; - this.each(function() { - var self = jQuery( this ); - - self.triggerHandler( "setData" + part, parts ); - jQuery.data( this, key, value ); - self.triggerHandler( "changeData" + part, parts ); - }); - }, null, value, arguments.length > 1, null, false ); - }, - - removeData: function( key ) { - return this.each(function() { - jQuery.removeData( this, key ); - }); - } -}); - -function dataAttr( elem, key, data ) { - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - - var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); - - data = elem.getAttribute( name ); - - if ( typeof data === "string" ) { - try { - data = data === "true" ? true : - data === "false" ? false : - data === "null" ? null : - jQuery.isNumeric( data ) ? +data : - rbrace.test( data ) ? jQuery.parseJSON( data ) : - data; - } catch( e ) {} - - // Make sure we set the data so it isn't changed later - jQuery.data( elem, key, data ); - - } else { - data = undefined; - } - } - - return data; -} - -// checks a cache object for emptiness -function isEmptyDataObject( obj ) { - for ( var name in obj ) { - - // if the public data object is empty, the private is still empty - if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { - continue; - } - if ( name !== "toJSON" ) { - return false; - } - } - - return true; -} - - - - -function handleQueueMarkDefer( elem, type, src ) { - var deferDataKey = type + "defer", - queueDataKey = type + "queue", - markDataKey = type + "mark", - defer = jQuery._data( elem, deferDataKey ); - if ( defer && - ( src === "queue" || !jQuery._data(elem, queueDataKey) ) && - ( src === "mark" || !jQuery._data(elem, markDataKey) ) ) { - // Give room for hard-coded callbacks to fire first - // and eventually mark/queue something else on the element - setTimeout( function() { - if ( !jQuery._data( elem, queueDataKey ) && - !jQuery._data( elem, markDataKey ) ) { - jQuery.removeData( elem, deferDataKey, true ); - defer.fire(); - } - }, 0 ); - } -} - -jQuery.extend({ - - _mark: function( elem, type ) { - if ( elem ) { - type = ( type || "fx" ) + "mark"; - jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 ); - } - }, - - _unmark: function( force, elem, type ) { - if ( force !== true ) { - type = elem; - elem = force; - force = false; - } - if ( elem ) { - type = type || "fx"; - var key = type + "mark", - count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 ); - if ( count ) { - jQuery._data( elem, key, count ); - } else { - jQuery.removeData( elem, key, true ); - handleQueueMarkDefer( elem, type, "mark" ); - } - } - }, - - queue: function( elem, type, data ) { - var q; - if ( elem ) { - type = ( type || "fx" ) + "queue"; - q = jQuery._data( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !q || jQuery.isArray(data) ) { - q = jQuery._data( elem, type, jQuery.makeArray(data) ); - } else { - q.push( data ); - } - } - return q || []; - } - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - fn = queue.shift(), - hooks = {}; - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - } - - if ( fn ) { - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift( "inprogress" ); - } - - jQuery._data( elem, type + ".run", hooks ); - fn.call( elem, function() { - jQuery.dequeue( elem, type ); - }, hooks ); - } - - if ( !queue.length ) { - jQuery.removeData( elem, type + "queue " + type + ".run", true ); - handleQueueMarkDefer( elem, type, "queue" ); - } - } -}); - -jQuery.fn.extend({ - queue: function( type, data ) { - var setter = 2; - - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - setter--; - } - - if ( arguments.length < setter ) { - return jQuery.queue( this[0], type ); - } - - return data === undefined ? - this : - this.each(function() { - var queue = jQuery.queue( this, type, data ); - - if ( type === "fx" && queue[0] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - }); - }, - dequeue: function( type ) { - return this.each(function() { - jQuery.dequeue( this, type ); - }); - }, - // Based off of the plugin by Clint Helfers, with permission. - // http://blindsignals.com/index.php/2009/07/jquery-delay/ - delay: function( time, type ) { - time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; - type = type || "fx"; - - return this.queue( type, function( next, hooks ) { - var timeout = setTimeout( next, time ); - hooks.stop = function() { - clearTimeout( timeout ); - }; - }); - }, - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - }, - // Get a promise resolved when queues of a certain type - // are emptied (fx is the type by default) - promise: function( type, object ) { - if ( typeof type !== "string" ) { - object = type; - type = undefined; - } - type = type || "fx"; - var defer = jQuery.Deferred(), - elements = this, - i = elements.length, - count = 1, - deferDataKey = type + "defer", - queueDataKey = type + "queue", - markDataKey = type + "mark", - tmp; - function resolve() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - } - while( i-- ) { - if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) || - ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) || - jQuery.data( elements[ i ], markDataKey, undefined, true ) ) && - jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) { - count++; - tmp.add( resolve ); - } - } - resolve(); - return defer.promise( object ); - } -}); - - - - -var rclass = /[\n\t\r]/g, - rspace = /\s+/, - rreturn = /\r/g, - rtype = /^(?:button|input)$/i, - rfocusable = /^(?:button|input|object|select|textarea)$/i, - rclickable = /^a(?:rea)?$/i, - rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, - getSetAttribute = jQuery.support.getSetAttribute, - nodeHook, boolHook, fixSpecified; - -jQuery.fn.extend({ - attr: function( name, value ) { - return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 ); - }, - - removeAttr: function( name ) { - return this.each(function() { - jQuery.removeAttr( this, name ); - }); - }, - - prop: function( name, value ) { - return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 ); - }, - - removeProp: function( name ) { - name = jQuery.propFix[ name ] || name; - return this.each(function() { - // try/catch handles cases where IE balks (such as removing a property on window) - try { - this[ name ] = undefined; - delete this[ name ]; - } catch( e ) {} - }); - }, - - addClass: function( value ) { - var classNames, i, l, elem, - setClass, c, cl; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( j ) { - jQuery( this ).addClass( value.call(this, j, this.className) ); - }); - } - - if ( value && typeof value === "string" ) { - classNames = value.split( rspace ); - - for ( i = 0, l = this.length; i < l; i++ ) { - elem = this[ i ]; - - if ( elem.nodeType === 1 ) { - if ( !elem.className && classNames.length === 1 ) { - elem.className = value; - - } else { - setClass = " " + elem.className + " "; - - for ( c = 0, cl = classNames.length; c < cl; c++ ) { - if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) { - setClass += classNames[ c ] + " "; - } - } - elem.className = jQuery.trim( setClass ); - } - } - } - } - - return this; - }, - - removeClass: function( value ) { - var classNames, i, l, elem, className, c, cl; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( j ) { - jQuery( this ).removeClass( value.call(this, j, this.className) ); - }); - } - - if ( (value && typeof value === "string") || value === undefined ) { - classNames = ( value || "" ).split( rspace ); - - for ( i = 0, l = this.length; i < l; i++ ) { - elem = this[ i ]; - - if ( elem.nodeType === 1 && elem.className ) { - if ( value ) { - className = (" " + elem.className + " ").replace( rclass, " " ); - for ( c = 0, cl = classNames.length; c < cl; c++ ) { - className = className.replace(" " + classNames[ c ] + " ", " "); - } - elem.className = jQuery.trim( className ); - - } else { - elem.className = ""; - } - } - } - } - - return this; - }, - - toggleClass: function( value, stateVal ) { - var type = typeof value, - isBool = typeof stateVal === "boolean"; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( i ) { - jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); - }); - } - - return this.each(function() { - if ( type === "string" ) { - // toggle individual class names - var className, - i = 0, - self = jQuery( this ), - state = stateVal, - classNames = value.split( rspace ); - - while ( (className = classNames[ i++ ]) ) { - // check each className given, space seperated list - state = isBool ? state : !self.hasClass( className ); - self[ state ? "addClass" : "removeClass" ]( className ); - } - - } else if ( type === "undefined" || type === "boolean" ) { - if ( this.className ) { - // store className if set - jQuery._data( this, "__className__", this.className ); - } - - // toggle whole className - this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; - } - }); - }, - - hasClass: function( selector ) { - var className = " " + selector + " ", - i = 0, - l = this.length; - for ( ; i < l; i++ ) { - if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { - return true; - } - } - - return false; - }, - - val: function( value ) { - var hooks, ret, isFunction, - elem = this[0]; - - if ( !arguments.length ) { - if ( elem ) { - hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; - - if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { - return ret; - } - - ret = elem.value; - - return typeof ret === "string" ? - // handle most common string cases - ret.replace(rreturn, "") : - // handle cases where value is null/undef or number - ret == null ? "" : ret; - } - - return; - } - - isFunction = jQuery.isFunction( value ); - - return this.each(function( i ) { - var self = jQuery(this), val; - - if ( this.nodeType !== 1 ) { - return; - } - - if ( isFunction ) { - val = value.call( this, i, self.val() ); - } else { - val = value; - } - - // Treat null/undefined as ""; convert numbers to string - if ( val == null ) { - val = ""; - } else if ( typeof val === "number" ) { - val += ""; - } else if ( jQuery.isArray( val ) ) { - val = jQuery.map(val, function ( value ) { - return value == null ? "" : value + ""; - }); - } - - hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; - - // If set returns undefined, fall back to normal setting - if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { - this.value = val; - } - }); - } -}); - -jQuery.extend({ - valHooks: { - option: { - get: function( elem ) { - // attributes.value is undefined in Blackberry 4.7 but - // uses .value. See #6932 - var val = elem.attributes.value; - return !val || val.specified ? elem.value : elem.text; - } - }, - select: { - get: function( elem ) { - var value, i, max, option, - index = elem.selectedIndex, - values = [], - options = elem.options, - one = elem.type === "select-one"; - - // Nothing was selected - if ( index < 0 ) { - return null; - } - - // Loop through all the selected options - i = one ? index : 0; - max = one ? index + 1 : options.length; - for ( ; i < max; i++ ) { - option = options[ i ]; - - // Don't return options that are disabled or in a disabled optgroup - if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && - (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) { - - // Get the specific value for the option - value = jQuery( option ).val(); - - // We don't need an array for one selects - if ( one ) { - return value; - } - - // Multi-Selects return an array - values.push( value ); - } - } - - // Fixes Bug #2551 -- select.val() broken in IE after form.reset() - if ( one && !values.length && options.length ) { - return jQuery( options[ index ] ).val(); - } - - return values; - }, - - set: function( elem, value ) { - var values = jQuery.makeArray( value ); - - jQuery(elem).find("option").each(function() { - this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; - }); - - if ( !values.length ) { - elem.selectedIndex = -1; - } - return values; - } - } - }, - - attrFn: { - val: true, - css: true, - html: true, - text: true, - data: true, - width: true, - height: true, - offset: true - }, - - attr: function( elem, name, value, pass ) { - var ret, hooks, notxml, - nType = elem.nodeType; - - // don't get/set attributes on text, comment and attribute nodes - if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - if ( pass && name in jQuery.attrFn ) { - return jQuery( elem )[ name ]( value ); - } - - // Fallback to prop when attributes are not supported - if ( typeof elem.getAttribute === "undefined" ) { - return jQuery.prop( elem, name, value ); - } - - notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); - - // All attributes are lowercase - // Grab necessary hook if one is defined - if ( notxml ) { - name = name.toLowerCase(); - hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook ); - } - - if ( value !== undefined ) { - - if ( value === null ) { - jQuery.removeAttr( elem, name ); - return; - - } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) { - return ret; - - } else { - elem.setAttribute( name, "" + value ); - return value; - } - - } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) { - return ret; - - } else { - - ret = elem.getAttribute( name ); - - // Non-existent attributes return null, we normalize to undefined - return ret === null ? - undefined : - ret; - } - }, - - removeAttr: function( elem, value ) { - var propName, attrNames, name, l, isBool, - i = 0; - - if ( value && elem.nodeType === 1 ) { - attrNames = value.toLowerCase().split( rspace ); - l = attrNames.length; - - for ( ; i < l; i++ ) { - name = attrNames[ i ]; - - if ( name ) { - propName = jQuery.propFix[ name ] || name; - isBool = rboolean.test( name ); - - // See #9699 for explanation of this approach (setting first, then removal) - // Do not do this for boolean attributes (see #10870) - if ( !isBool ) { - jQuery.attr( elem, name, "" ); - } - elem.removeAttribute( getSetAttribute ? name : propName ); - - // Set corresponding property to false for boolean attributes - if ( isBool && propName in elem ) { - elem[ propName ] = false; - } - } - } - } - }, - - attrHooks: { - type: { - set: function( elem, value ) { - // We can't allow the type property to be changed (since it causes problems in IE) - if ( rtype.test( elem.nodeName ) && elem.parentNode ) { - jQuery.error( "type property can't be changed" ); - } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { - // Setting the type on a radio button after the value resets the value in IE6-9 - // Reset value to it's default in case type is set after value - // This is for element creation - var val = elem.value; - elem.setAttribute( "type", value ); - if ( val ) { - elem.value = val; - } - return value; - } - } - }, - // Use the value property for back compat - // Use the nodeHook for button elements in IE6/7 (#1954) - value: { - get: function( elem, name ) { - if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { - return nodeHook.get( elem, name ); - } - return name in elem ? - elem.value : - null; - }, - set: function( elem, value, name ) { - if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { - return nodeHook.set( elem, value, name ); - } - // Does not return so that setAttribute is also used - elem.value = value; - } - } - }, - - propFix: { - tabindex: "tabIndex", - readonly: "readOnly", - "for": "htmlFor", - "class": "className", - maxlength: "maxLength", - cellspacing: "cellSpacing", - cellpadding: "cellPadding", - rowspan: "rowSpan", - colspan: "colSpan", - usemap: "useMap", - frameborder: "frameBorder", - contenteditable: "contentEditable" - }, - - prop: function( elem, name, value ) { - var ret, hooks, notxml, - nType = elem.nodeType; - - // don't get/set properties on text, comment and attribute nodes - if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); - - if ( notxml ) { - // Fix name and attach hooks - name = jQuery.propFix[ name ] || name; - hooks = jQuery.propHooks[ name ]; - } - - if ( value !== undefined ) { - if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { - return ret; - - } else { - return ( elem[ name ] = value ); - } - - } else { - if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { - return ret; - - } else { - return elem[ name ]; - } - } - }, - - propHooks: { - tabIndex: { - get: function( elem ) { - // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set - // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - var attributeNode = elem.getAttributeNode("tabindex"); - - return attributeNode && attributeNode.specified ? - parseInt( attributeNode.value, 10 ) : - rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? - 0 : - undefined; - } - } - } -}); - -// Add the tabIndex propHook to attrHooks for back-compat (different case is intentional) -jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex; - -// Hook for boolean attributes -boolHook = { - get: function( elem, name ) { - // Align boolean attributes with corresponding properties - // Fall back to attribute presence where some booleans are not supported - var attrNode, - property = jQuery.prop( elem, name ); - return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ? - name.toLowerCase() : - undefined; - }, - set: function( elem, value, name ) { - var propName; - if ( value === false ) { - // Remove boolean attributes when set to false - jQuery.removeAttr( elem, name ); - } else { - // value is true since we know at this point it's type boolean and not false - // Set boolean attributes to the same name and set the DOM property - propName = jQuery.propFix[ name ] || name; - if ( propName in elem ) { - // Only set the IDL specifically if it already exists on the element - elem[ propName ] = true; - } - - elem.setAttribute( name, name.toLowerCase() ); - } - return name; - } -}; - -// IE6/7 do not support getting/setting some attributes with get/setAttribute -if ( !getSetAttribute ) { - - fixSpecified = { - name: true, - id: true, - coords: true - }; - - // Use this for any attribute in IE6/7 - // This fixes almost every IE6/7 issue - nodeHook = jQuery.valHooks.button = { - get: function( elem, name ) { - var ret; - ret = elem.getAttributeNode( name ); - return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ? - ret.nodeValue : - undefined; - }, - set: function( elem, value, name ) { - // Set the existing or create a new attribute node - var ret = elem.getAttributeNode( name ); - if ( !ret ) { - ret = document.createAttribute( name ); - elem.setAttributeNode( ret ); - } - return ( ret.nodeValue = value + "" ); - } - }; - - // Apply the nodeHook to tabindex - jQuery.attrHooks.tabindex.set = nodeHook.set; - - // Set width and height to auto instead of 0 on empty string( Bug #8150 ) - // This is for removals - jQuery.each([ "width", "height" ], function( i, name ) { - jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { - set: function( elem, value ) { - if ( value === "" ) { - elem.setAttribute( name, "auto" ); - return value; - } - } - }); - }); - - // Set contenteditable to false on removals(#10429) - // Setting to empty string throws an error as an invalid value - jQuery.attrHooks.contenteditable = { - get: nodeHook.get, - set: function( elem, value, name ) { - if ( value === "" ) { - value = "false"; - } - nodeHook.set( elem, value, name ); - } - }; -} - - -// Some attributes require a special call on IE -if ( !jQuery.support.hrefNormalized ) { - jQuery.each([ "href", "src", "width", "height" ], function( i, name ) { - jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { - get: function( elem ) { - var ret = elem.getAttribute( name, 2 ); - return ret === null ? undefined : ret; - } - }); - }); -} - -if ( !jQuery.support.style ) { - jQuery.attrHooks.style = { - get: function( elem ) { - // Return undefined in the case of empty string - // Normalize to lowercase since IE uppercases css property names - return elem.style.cssText.toLowerCase() || undefined; - }, - set: function( elem, value ) { - return ( elem.style.cssText = "" + value ); - } - }; -} - -// Safari mis-reports the default selected property of an option -// Accessing the parent's selectedIndex property fixes it -if ( !jQuery.support.optSelected ) { - jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, { - get: function( elem ) { - var parent = elem.parentNode; - - if ( parent ) { - parent.selectedIndex; - - // Make sure that it also works with optgroups, see #5701 - if ( parent.parentNode ) { - parent.parentNode.selectedIndex; - } - } - return null; - } - }); -} - -// IE6/7 call enctype encoding -if ( !jQuery.support.enctype ) { - jQuery.propFix.enctype = "encoding"; -} - -// Radios and checkboxes getter/setter -if ( !jQuery.support.checkOn ) { - jQuery.each([ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = { - get: function( elem ) { - // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified - return elem.getAttribute("value") === null ? "on" : elem.value; - } - }; - }); -} -jQuery.each([ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], { - set: function( elem, value ) { - if ( jQuery.isArray( value ) ) { - return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); - } - } - }); -}); - - - - -var rformElems = /^(?:textarea|input|select)$/i, - rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/, - rhoverHack = /(?:^|\s)hover(\.\S+)?\b/, - rkeyEvent = /^key/, - rmouseEvent = /^(?:mouse|contextmenu)|click/, - rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, - rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/, - quickParse = function( selector ) { - var quick = rquickIs.exec( selector ); - if ( quick ) { - // 0 1 2 3 - // [ _, tag, id, class ] - quick[1] = ( quick[1] || "" ).toLowerCase(); - quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" ); - } - return quick; - }, - quickIs = function( elem, m ) { - var attrs = elem.attributes || {}; - return ( - (!m[1] || elem.nodeName.toLowerCase() === m[1]) && - (!m[2] || (attrs.id || {}).value === m[2]) && - (!m[3] || m[3].test( (attrs[ "class" ] || {}).value )) - ); - }, - hoverHack = function( events ) { - return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" ); - }; - -/* - * Helper functions for managing events -- not part of the public interface. - * Props to Dean Edwards' addEvent library for many of the ideas. - */ -jQuery.event = { - - add: function( elem, types, handler, data, selector ) { - - var elemData, eventHandle, events, - t, tns, type, namespaces, handleObj, - handleObjIn, quick, handlers, special; - - // Don't attach events to noData or text/comment nodes (allow plain objects tho) - if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) { - return; - } - - // Caller can pass in an object of custom data in lieu of the handler - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - selector = handleObjIn.selector; - } - - // Make sure that the handler has a unique ID, used to find/remove it later - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure and main handler, if this is the first - events = elemData.events; - if ( !events ) { - elemData.events = events = {}; - } - eventHandle = elemData.handle; - if ( !eventHandle ) { - elemData.handle = eventHandle = function( e ) { - // Discard the second event of a jQuery.event.trigger() and - // when an event is called after a page has unloaded - return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ? - jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : - undefined; - }; - // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events - eventHandle.elem = elem; - } - - // Handle multiple events separated by a space - // jQuery(...).bind("mouseover mouseout", fn); - types = jQuery.trim( hoverHack(types) ).split( " " ); - for ( t = 0; t < types.length; t++ ) { - - tns = rtypenamespace.exec( types[t] ) || []; - type = tns[1]; - namespaces = ( tns[2] || "" ).split( "." ).sort(); - - // If event changes its type, use the special event handlers for the changed type - special = jQuery.event.special[ type ] || {}; - - // If selector defined, determine special event api type, otherwise given type - type = ( selector ? special.delegateType : special.bindType ) || type; - - // Update special based on newly reset type - special = jQuery.event.special[ type ] || {}; - - // handleObj is passed to all event handlers - handleObj = jQuery.extend({ - type: type, - origType: tns[1], - data: data, - handler: handler, - guid: handler.guid, - selector: selector, - quick: selector && quickParse( selector ), - namespace: namespaces.join(".") - }, handleObjIn ); - - // Init the event handler queue if we're the first - handlers = events[ type ]; - if ( !handlers ) { - handlers = events[ type ] = []; - handlers.delegateCount = 0; - - // Only use addEventListener/attachEvent if the special events handler returns false - if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - // Bind the global event handler to the element - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle, false ); - - } else if ( elem.attachEvent ) { - elem.attachEvent( "on" + type, eventHandle ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add to the element's handler list, delegates in front - if ( selector ) { - handlers.splice( handlers.delegateCount++, 0, handleObj ); - } else { - handlers.push( handleObj ); - } - - // Keep track of which events have ever been used, for event optimization - jQuery.event.global[ type ] = true; - } - - // Nullify elem to prevent memory leaks in IE - elem = null; - }, - - global: {}, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, selector, mappedTypes ) { - - var elemData = jQuery.hasData( elem ) && jQuery._data( elem ), - t, tns, type, origType, namespaces, origCount, - j, events, special, handle, eventType, handleObj; - - if ( !elemData || !(events = elemData.events) ) { - return; - } - - // Once for each type.namespace in types; type may be omitted - types = jQuery.trim( hoverHack( types || "" ) ).split(" "); - for ( t = 0; t < types.length; t++ ) { - tns = rtypenamespace.exec( types[t] ) || []; - type = origType = tns[1]; - namespaces = tns[2]; - - // Unbind all events (on this namespace, if provided) for the element - if ( !type ) { - for ( type in events ) { - jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); - } - continue; - } - - special = jQuery.event.special[ type ] || {}; - type = ( selector? special.delegateType : special.bindType ) || type; - eventType = events[ type ] || []; - origCount = eventType.length; - namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null; - - // Remove matching events - for ( j = 0; j < eventType.length; j++ ) { - handleObj = eventType[ j ]; - - if ( ( mappedTypes || origType === handleObj.origType ) && - ( !handler || handler.guid === handleObj.guid ) && - ( !namespaces || namespaces.test( handleObj.namespace ) ) && - ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { - eventType.splice( j--, 1 ); - - if ( handleObj.selector ) { - eventType.delegateCount--; - } - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - } - - // Remove generic event handler if we removed something and no more handlers exist - // (avoids potential for endless recursion during removal of special event handlers) - if ( eventType.length === 0 && origCount !== eventType.length ) { - if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { - jQuery.removeEvent( elem, type, elemData.handle ); - } - - delete events[ type ]; - } - } - - // Remove the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - handle = elemData.handle; - if ( handle ) { - handle.elem = null; - } - - // removeData also checks for emptiness and clears the expando if empty - // so use it instead of delete - jQuery.removeData( elem, [ "events", "handle" ], true ); - } - }, - - // Events that are safe to short-circuit if no handlers are attached. - // Native DOM events should not be added, they may have inline handlers. - customEvent: { - "getData": true, - "setData": true, - "changeData": true - }, - - trigger: function( event, data, elem, onlyHandlers ) { - // Don't do events on text and comment nodes - if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) { - return; - } - - // Event object or event type - var type = event.type || event, - namespaces = [], - cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType; - - // focus/blur morphs to focusin/out; ensure we're not firing them right now - if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { - return; - } - - if ( type.indexOf( "!" ) >= 0 ) { - // Exclusive events trigger only for the exact event (no namespaces) - type = type.slice(0, -1); - exclusive = true; - } - - if ( type.indexOf( "." ) >= 0 ) { - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split("."); - type = namespaces.shift(); - namespaces.sort(); - } - - if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) { - // No jQuery handlers for this event type, and it can't have inline handlers - return; - } - - // Caller can pass in an Event, Object, or just an event type string - event = typeof event === "object" ? - // jQuery.Event object - event[ jQuery.expando ] ? event : - // Object literal - new jQuery.Event( type, event ) : - // Just the event type (string) - new jQuery.Event( type ); - - event.type = type; - event.isTrigger = true; - event.exclusive = exclusive; - event.namespace = namespaces.join( "." ); - event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null; - ontype = type.indexOf( ":" ) < 0 ? "on" + type : ""; - - // Handle a global trigger - if ( !elem ) { - - // TODO: Stop taunting the data cache; remove global events and always attach to document - cache = jQuery.cache; - for ( i in cache ) { - if ( cache[ i ].events && cache[ i ].events[ type ] ) { - jQuery.event.trigger( event, data, cache[ i ].handle.elem, true ); - } - } - return; - } - - // Clean up the event in case it is being reused - event.result = undefined; - if ( !event.target ) { - event.target = elem; - } - - // Clone any incoming data and prepend the event, creating the handler arg list - data = data != null ? jQuery.makeArray( data ) : []; - data.unshift( event ); - - // Allow special events to draw outside the lines - special = jQuery.event.special[ type ] || {}; - if ( special.trigger && special.trigger.apply( elem, data ) === false ) { - return; - } - - // Determine event propagation path in advance, per W3C events spec (#9951) - // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) - eventPath = [[ elem, special.bindType || type ]]; - if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { - - bubbleType = special.delegateType || type; - cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode; - old = null; - for ( ; cur; cur = cur.parentNode ) { - eventPath.push([ cur, bubbleType ]); - old = cur; - } - - // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( old && old === elem.ownerDocument ) { - eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]); - } - } - - // Fire handlers on the event path - for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) { - - cur = eventPath[i][0]; - event.type = eventPath[i][1]; - - handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); - if ( handle ) { - handle.apply( cur, data ); - } - // Note that this is a bare JS function and not a jQuery handler - handle = ontype && cur[ ontype ]; - if ( handle && jQuery.acceptData( cur ) && handle.apply( cur, data ) === false ) { - event.preventDefault(); - } - } - event.type = type; - - // If nobody prevented the default action, do it now - if ( !onlyHandlers && !event.isDefaultPrevented() ) { - - if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) && - !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) { - - // Call a native DOM method on the target with the same name name as the event. - // Can't use an .isFunction() check here because IE6/7 fails that test. - // Don't do default actions on window, that's where global variables be (#6170) - // IE<9 dies on focus/blur to hidden element (#1486) - if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) { - - // Don't re-trigger an onFOO event when we call its FOO() method - old = elem[ ontype ]; - - if ( old ) { - elem[ ontype ] = null; - } - - // Prevent re-triggering of the same event, since we already bubbled it above - jQuery.event.triggered = type; - elem[ type ](); - jQuery.event.triggered = undefined; - - if ( old ) { - elem[ ontype ] = old; - } - } - } - } - - return event.result; - }, - - dispatch: function( event ) { - - // Make a writable jQuery.Event from the native event object - event = jQuery.event.fix( event || window.event ); - - var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []), - delegateCount = handlers.delegateCount, - args = [].slice.call( arguments, 0 ), - run_all = !event.exclusive && !event.namespace, - special = jQuery.event.special[ event.type ] || {}, - handlerQueue = [], - i, j, cur, jqcur, ret, selMatch, matched, matches, handleObj, sel, related; - - // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[0] = event; - event.delegateTarget = this; - - // Call the preDispatch hook for the mapped type, and let it bail if desired - if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { - return; - } - - // Determine handlers that should run if there are delegated events - // Avoid non-left-click bubbling in Firefox (#3861) - if ( delegateCount && !(event.button && event.type === "click") ) { - - // Pregenerate a single jQuery object for reuse with .is() - jqcur = jQuery(this); - jqcur.context = this.ownerDocument || this; - - for ( cur = event.target; cur != this; cur = cur.parentNode || this ) { - - // Don't process events on disabled elements (#6911, #8165) - if ( cur.disabled !== true ) { - selMatch = {}; - matches = []; - jqcur[0] = cur; - for ( i = 0; i < delegateCount; i++ ) { - handleObj = handlers[ i ]; - sel = handleObj.selector; - - if ( selMatch[ sel ] === undefined ) { - selMatch[ sel ] = ( - handleObj.quick ? quickIs( cur, handleObj.quick ) : jqcur.is( sel ) - ); - } - if ( selMatch[ sel ] ) { - matches.push( handleObj ); - } - } - if ( matches.length ) { - handlerQueue.push({ elem: cur, matches: matches }); - } - } - } - } - - // Add the remaining (directly-bound) handlers - if ( handlers.length > delegateCount ) { - handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) }); - } - - // Run delegates first; they may want to stop propagation beneath us - for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) { - matched = handlerQueue[ i ]; - event.currentTarget = matched.elem; - - for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) { - handleObj = matched.matches[ j ]; - - // Triggered event must either 1) be non-exclusive and have no namespace, or - // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). - if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) { - - event.data = handleObj.data; - event.handleObj = handleObj; - - ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) - .apply( matched.elem, args ); - - if ( ret !== undefined ) { - event.result = ret; - if ( ret === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - } - } - } - - // Call the postDispatch hook for the mapped type - if ( special.postDispatch ) { - special.postDispatch.call( this, event ); - } - - return event.result; - }, - - // Includes some event props shared by KeyEvent and MouseEvent - // *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 *** - props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), - - fixHooks: {}, - - keyHooks: { - props: "char charCode key keyCode".split(" "), - filter: function( event, original ) { - - // Add which for key events - if ( event.which == null ) { - event.which = original.charCode != null ? original.charCode : original.keyCode; - } - - return event; - } - }, - - mouseHooks: { - props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), - filter: function( event, original ) { - var eventDoc, doc, body, - button = original.button, - fromElement = original.fromElement; - - // Calculate pageX/Y if missing and clientX/Y available - if ( event.pageX == null && original.clientX != null ) { - eventDoc = event.target.ownerDocument || document; - doc = eventDoc.documentElement; - body = eventDoc.body; - - event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); - event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); - } - - // Add relatedTarget, if necessary - if ( !event.relatedTarget && fromElement ) { - event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; - } - - // Add which for click: 1 === left; 2 === middle; 3 === right - // Note: button is not normalized, so don't use it - if ( !event.which && button !== undefined ) { - event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); - } - - return event; - } - }, - - fix: function( event ) { - if ( event[ jQuery.expando ] ) { - return event; - } - - // Create a writable copy of the event object and normalize some properties - var i, prop, - originalEvent = event, - fixHook = jQuery.event.fixHooks[ event.type ] || {}, - copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; - - event = jQuery.Event( originalEvent ); - - for ( i = copy.length; i; ) { - prop = copy[ --i ]; - event[ prop ] = originalEvent[ prop ]; - } - - // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2) - if ( !event.target ) { - event.target = originalEvent.srcElement || document; - } - - // Target should not be a text node (#504, Safari) - if ( event.target.nodeType === 3 ) { - event.target = event.target.parentNode; - } - - // For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8) - if ( event.metaKey === undefined ) { - event.metaKey = event.ctrlKey; - } - - return fixHook.filter? fixHook.filter( event, originalEvent ) : event; - }, - - special: { - ready: { - // Make sure the ready event is setup - setup: jQuery.bindReady - }, - - load: { - // Prevent triggered image.load events from bubbling to window.load - noBubble: true - }, - - focus: { - delegateType: "focusin" - }, - blur: { - delegateType: "focusout" - }, - - beforeunload: { - setup: function( data, namespaces, eventHandle ) { - // We only want to do this special case on windows - if ( jQuery.isWindow( this ) ) { - this.onbeforeunload = eventHandle; - } - }, - - teardown: function( namespaces, eventHandle ) { - if ( this.onbeforeunload === eventHandle ) { - this.onbeforeunload = null; - } - } - } - }, - - simulate: function( type, elem, event, bubble ) { - // Piggyback on a donor event to simulate a different one. - // Fake originalEvent to avoid donor's stopPropagation, but if the - // simulated event prevents default then we do the same on the donor. - var e = jQuery.extend( - new jQuery.Event(), - event, - { type: type, - isSimulated: true, - originalEvent: {} - } - ); - if ( bubble ) { - jQuery.event.trigger( e, null, elem ); - } else { - jQuery.event.dispatch.call( elem, e ); - } - if ( e.isDefaultPrevented() ) { - event.preventDefault(); - } - } -}; - -// Some plugins are using, but it's undocumented/deprecated and will be removed. -// The 1.7 special event interface should provide all the hooks needed now. -jQuery.event.handle = jQuery.event.dispatch; - -jQuery.removeEvent = document.removeEventListener ? - function( elem, type, handle ) { - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle, false ); - } - } : - function( elem, type, handle ) { - if ( elem.detachEvent ) { - elem.detachEvent( "on" + type, handle ); - } - }; - -jQuery.Event = function( src, props ) { - // Allow instantiation without the 'new' keyword - if ( !(this instanceof jQuery.Event) ) { - return new jQuery.Event( src, props ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || - src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; - - // Event type - } else { - this.type = src; - } - - // Put explicitly provided properties onto the event object - if ( props ) { - jQuery.extend( this, props ); - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || jQuery.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; -}; - -function returnFalse() { - return false; -} -function returnTrue() { - return true; -} - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - preventDefault: function() { - this.isDefaultPrevented = returnTrue; - - var e = this.originalEvent; - if ( !e ) { - return; - } - - // if preventDefault exists run it on the original event - if ( e.preventDefault ) { - e.preventDefault(); - - // otherwise set the returnValue property of the original event to false (IE) - } else { - e.returnValue = false; - } - }, - stopPropagation: function() { - this.isPropagationStopped = returnTrue; - - var e = this.originalEvent; - if ( !e ) { - return; - } - // if stopPropagation exists run it on the original event - if ( e.stopPropagation ) { - e.stopPropagation(); - } - // otherwise set the cancelBubble property of the original event to true (IE) - e.cancelBubble = true; - }, - stopImmediatePropagation: function() { - this.isImmediatePropagationStopped = returnTrue; - this.stopPropagation(); - }, - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse -}; - -// Create mouseenter/leave events using mouseover/out and event-time checks -jQuery.each({ - mouseenter: "mouseover", - mouseleave: "mouseout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = { - delegateType: fix, - bindType: fix, - - handle: function( event ) { - var target = this, - related = event.relatedTarget, - handleObj = event.handleObj, - selector = handleObj.selector, - ret; - - // For mousenter/leave call the handler if related is outside the target. - // NB: No relatedTarget if the mouse left/entered the browser window - if ( !related || (related !== target && !jQuery.contains( target, related )) ) { - event.type = handleObj.origType; - ret = handleObj.handler.apply( this, arguments ); - event.type = fix; - } - return ret; - } - }; -}); - -// IE submit delegation -if ( !jQuery.support.submitBubbles ) { - - jQuery.event.special.submit = { - setup: function() { - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Lazy-add a submit handler when a descendant form may potentially be submitted - jQuery.event.add( this, "click._submit keypress._submit", function( e ) { - // Node name check avoids a VML-related crash in IE (#9807) - var elem = e.target, - form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; - if ( form && !form._submit_attached ) { - jQuery.event.add( form, "submit._submit", function( event ) { - event._submit_bubble = true; - }); - form._submit_attached = true; - } - }); - // return undefined since we don't need an event listener - }, - - postDispatch: function( event ) { - // If form was submitted by the user, bubble the event up the tree - if ( event._submit_bubble ) { - delete event._submit_bubble; - if ( this.parentNode && !event.isTrigger ) { - jQuery.event.simulate( "submit", this.parentNode, event, true ); - } - } - }, - - teardown: function() { - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Remove delegated handlers; cleanData eventually reaps submit handlers attached above - jQuery.event.remove( this, "._submit" ); - } - }; -} - -// IE change delegation and checkbox/radio fix -if ( !jQuery.support.changeBubbles ) { - - jQuery.event.special.change = { - - setup: function() { - - if ( rformElems.test( this.nodeName ) ) { - // IE doesn't fire change on a check/radio until blur; trigger it on click - // after a propertychange. Eat the blur-change in special.change.handle. - // This still fires onchange a second time for check/radio after blur. - if ( this.type === "checkbox" || this.type === "radio" ) { - jQuery.event.add( this, "propertychange._change", function( event ) { - if ( event.originalEvent.propertyName === "checked" ) { - this._just_changed = true; - } - }); - jQuery.event.add( this, "click._change", function( event ) { - if ( this._just_changed && !event.isTrigger ) { - this._just_changed = false; - jQuery.event.simulate( "change", this, event, true ); - } - }); - } - return false; - } - // Delegated event; lazy-add a change handler on descendant inputs - jQuery.event.add( this, "beforeactivate._change", function( e ) { - var elem = e.target; - - if ( rformElems.test( elem.nodeName ) && !elem._change_attached ) { - jQuery.event.add( elem, "change._change", function( event ) { - if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { - jQuery.event.simulate( "change", this.parentNode, event, true ); - } - }); - elem._change_attached = true; - } - }); - }, - - handle: function( event ) { - var elem = event.target; - - // Swallow native change events from checkbox/radio, we already triggered them above - if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { - return event.handleObj.handler.apply( this, arguments ); - } - }, - - teardown: function() { - jQuery.event.remove( this, "._change" ); - - return rformElems.test( this.nodeName ); - } - }; -} - -// Create "bubbling" focus and blur events -if ( !jQuery.support.focusinBubbles ) { - jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { - - // Attach a single capturing handler while someone wants focusin/focusout - var attaches = 0, - handler = function( event ) { - jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); - }; - - jQuery.event.special[ fix ] = { - setup: function() { - if ( attaches++ === 0 ) { - document.addEventListener( orig, handler, true ); - } - }, - teardown: function() { - if ( --attaches === 0 ) { - document.removeEventListener( orig, handler, true ); - } - } - }; - }); -} - -jQuery.fn.extend({ - - on: function( types, selector, data, fn, /*INTERNAL*/ one ) { - var origFn, type; - - // Types can be a map of types/handlers - if ( typeof types === "object" ) { - // ( types-Object, selector, data ) - if ( typeof selector !== "string" ) { // && selector != null - // ( types-Object, data ) - data = data || selector; - selector = undefined; - } - for ( type in types ) { - this.on( type, selector, data, types[ type ], one ); - } - return this; - } - - if ( data == null && fn == null ) { - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - if ( fn === false ) { - fn = returnFalse; - } else if ( !fn ) { - return this; - } - - if ( one === 1 ) { - origFn = fn; - fn = function( event ) { - // Can use an empty set, since event contains the info - jQuery().off( event ); - return origFn.apply( this, arguments ); - }; - // Use same guid so caller can remove using origFn - fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); - } - return this.each( function() { - jQuery.event.add( this, types, fn, data, selector ); - }); - }, - one: function( types, selector, data, fn ) { - return this.on( types, selector, data, fn, 1 ); - }, - off: function( types, selector, fn ) { - if ( types && types.preventDefault && types.handleObj ) { - // ( event ) dispatched jQuery.Event - var handleObj = types.handleObj; - jQuery( types.delegateTarget ).off( - handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, - handleObj.selector, - handleObj.handler - ); - return this; - } - if ( typeof types === "object" ) { - // ( types-object [, selector] ) - for ( var type in types ) { - this.off( type, selector, types[ type ] ); - } - return this; - } - if ( selector === false || typeof selector === "function" ) { - // ( types [, fn] ) - fn = selector; - selector = undefined; - } - if ( fn === false ) { - fn = returnFalse; - } - return this.each(function() { - jQuery.event.remove( this, types, fn, selector ); - }); - }, - - bind: function( types, data, fn ) { - return this.on( types, null, data, fn ); - }, - unbind: function( types, fn ) { - return this.off( types, null, fn ); - }, - - live: function( types, data, fn ) { - jQuery( this.context ).on( types, this.selector, data, fn ); - return this; - }, - die: function( types, fn ) { - jQuery( this.context ).off( types, this.selector || "**", fn ); - return this; - }, - - delegate: function( selector, types, data, fn ) { - return this.on( types, selector, data, fn ); - }, - undelegate: function( selector, types, fn ) { - // ( namespace ) or ( selector, types [, fn] ) - return arguments.length == 1? this.off( selector, "**" ) : this.off( types, selector, fn ); - }, - - trigger: function( type, data ) { - return this.each(function() { - jQuery.event.trigger( type, data, this ); - }); - }, - triggerHandler: function( type, data ) { - if ( this[0] ) { - return jQuery.event.trigger( type, data, this[0], true ); - } - }, - - toggle: function( fn ) { - // Save reference to arguments for access in closure - var args = arguments, - guid = fn.guid || jQuery.guid++, - i = 0, - toggler = function( event ) { - // Figure out which function to execute - var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i; - jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 ); - - // Make sure that clicks stop - event.preventDefault(); - - // and execute the function - return args[ lastToggle ].apply( this, arguments ) || false; - }; - - // link all the functions, so any of them can unbind this click handler - toggler.guid = guid; - while ( i < args.length ) { - args[ i++ ].guid = guid; - } - - return this.click( toggler ); - }, - - hover: function( fnOver, fnOut ) { - return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); - } -}); - -jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + - "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + - "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { - - // Handle event binding - jQuery.fn[ name ] = function( data, fn ) { - if ( fn == null ) { - fn = data; - data = null; - } - - return arguments.length > 0 ? - this.on( name, null, data, fn ) : - this.trigger( name ); - }; - - if ( jQuery.attrFn ) { - jQuery.attrFn[ name ] = true; - } - - if ( rkeyEvent.test( name ) ) { - jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks; - } - - if ( rmouseEvent.test( name ) ) { - jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks; - } -}); - - - -/*! - * Sizzle CSS Selector Engine - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ -(function(){ - -var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, - expando = "sizcache" + (Math.random() + '').replace('.', ''), - done = 0, - toString = Object.prototype.toString, - hasDuplicate = false, - baseHasDuplicate = true, - rBackslash = /\\/g, - rReturn = /\r\n/g, - rNonWord = /\W/; - -// Here we check if the JavaScript engine is using some sort of -// optimization where it does not always call our comparision -// function. If that is the case, discard the hasDuplicate value. -// Thus far that includes Google Chrome. -[0, 0].sort(function() { - baseHasDuplicate = false; - return 0; -}); - -var Sizzle = function( selector, context, results, seed ) { - results = results || []; - context = context || document; - - var origContext = context; - - if ( context.nodeType !== 1 && context.nodeType !== 9 ) { - return []; - } - - if ( !selector || typeof selector !== "string" ) { - return results; - } - - var m, set, checkSet, extra, ret, cur, pop, i, - prune = true, - contextXML = Sizzle.isXML( context ), - parts = [], - soFar = selector; - - // Reset the position of the chunker regexp (start from head) - do { - chunker.exec( "" ); - m = chunker.exec( soFar ); - - if ( m ) { - soFar = m[3]; - - parts.push( m[1] ); - - if ( m[2] ) { - extra = m[3]; - break; - } - } - } while ( m ); - - if ( parts.length > 1 && origPOS.exec( selector ) ) { - - if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { - set = posProcess( parts[0] + parts[1], context, seed ); - - } else { - set = Expr.relative[ parts[0] ] ? - [ context ] : - Sizzle( parts.shift(), context ); - - while ( parts.length ) { - selector = parts.shift(); - - if ( Expr.relative[ selector ] ) { - selector += parts.shift(); - } - - set = posProcess( selector, set, seed ); - } - } - - } else { - // Take a shortcut and set the context if the root selector is an ID - // (but not if it'll be faster if the inner selector is an ID) - if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && - Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { - - ret = Sizzle.find( parts.shift(), context, contextXML ); - context = ret.expr ? - Sizzle.filter( ret.expr, ret.set )[0] : - ret.set[0]; - } - - if ( context ) { - ret = seed ? - { expr: parts.pop(), set: makeArray(seed) } : - Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); - - set = ret.expr ? - Sizzle.filter( ret.expr, ret.set ) : - ret.set; - - if ( parts.length > 0 ) { - checkSet = makeArray( set ); - - } else { - prune = false; - } - - while ( parts.length ) { - cur = parts.pop(); - pop = cur; - - if ( !Expr.relative[ cur ] ) { - cur = ""; - } else { - pop = parts.pop(); - } - - if ( pop == null ) { - pop = context; - } - - Expr.relative[ cur ]( checkSet, pop, contextXML ); - } - - } else { - checkSet = parts = []; - } - } - - if ( !checkSet ) { - checkSet = set; - } - - if ( !checkSet ) { - Sizzle.error( cur || selector ); - } - - if ( toString.call(checkSet) === "[object Array]" ) { - if ( !prune ) { - results.push.apply( results, checkSet ); - - } else if ( context && context.nodeType === 1 ) { - for ( i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { - results.push( set[i] ); - } - } - - } else { - for ( i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && checkSet[i].nodeType === 1 ) { - results.push( set[i] ); - } - } - } - - } else { - makeArray( checkSet, results ); - } - - if ( extra ) { - Sizzle( extra, origContext, results, seed ); - Sizzle.uniqueSort( results ); - } - - return results; -}; - -Sizzle.uniqueSort = function( results ) { - if ( sortOrder ) { - hasDuplicate = baseHasDuplicate; - results.sort( sortOrder ); - - if ( hasDuplicate ) { - for ( var i = 1; i < results.length; i++ ) { - if ( results[i] === results[ i - 1 ] ) { - results.splice( i--, 1 ); - } - } - } - } - - return results; -}; - -Sizzle.matches = function( expr, set ) { - return Sizzle( expr, null, null, set ); -}; - -Sizzle.matchesSelector = function( node, expr ) { - return Sizzle( expr, null, null, [node] ).length > 0; -}; - -Sizzle.find = function( expr, context, isXML ) { - var set, i, len, match, type, left; - - if ( !expr ) { - return []; - } - - for ( i = 0, len = Expr.order.length; i < len; i++ ) { - type = Expr.order[i]; - - if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { - left = match[1]; - match.splice( 1, 1 ); - - if ( left.substr( left.length - 1 ) !== "\\" ) { - match[1] = (match[1] || "").replace( rBackslash, "" ); - set = Expr.find[ type ]( match, context, isXML ); - - if ( set != null ) { - expr = expr.replace( Expr.match[ type ], "" ); - break; - } - } - } - } - - if ( !set ) { - set = typeof context.getElementsByTagName !== "undefined" ? - context.getElementsByTagName( "*" ) : - []; - } - - return { set: set, expr: expr }; -}; - -Sizzle.filter = function( expr, set, inplace, not ) { - var match, anyFound, - type, found, item, filter, left, - i, pass, - old = expr, - result = [], - curLoop = set, - isXMLFilter = set && set[0] && Sizzle.isXML( set[0] ); - - while ( expr && set.length ) { - for ( type in Expr.filter ) { - if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { - filter = Expr.filter[ type ]; - left = match[1]; - - anyFound = false; - - match.splice(1,1); - - if ( left.substr( left.length - 1 ) === "\\" ) { - continue; - } - - if ( curLoop === result ) { - result = []; - } - - if ( Expr.preFilter[ type ] ) { - match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); - - if ( !match ) { - anyFound = found = true; - - } else if ( match === true ) { - continue; - } - } - - if ( match ) { - for ( i = 0; (item = curLoop[i]) != null; i++ ) { - if ( item ) { - found = filter( item, match, i, curLoop ); - pass = not ^ found; - - if ( inplace && found != null ) { - if ( pass ) { - anyFound = true; - - } else { - curLoop[i] = false; - } - - } else if ( pass ) { - result.push( item ); - anyFound = true; - } - } - } - } - - if ( found !== undefined ) { - if ( !inplace ) { - curLoop = result; - } - - expr = expr.replace( Expr.match[ type ], "" ); - - if ( !anyFound ) { - return []; - } - - break; - } - } - } - - // Improper expression - if ( expr === old ) { - if ( anyFound == null ) { - Sizzle.error( expr ); - - } else { - break; - } - } - - old = expr; - } - - return curLoop; -}; - -Sizzle.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); -}; - -/** - * Utility function for retreiving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -var getText = Sizzle.getText = function( elem ) { - var i, node, - nodeType = elem.nodeType, - ret = ""; - - if ( nodeType ) { - if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { - // Use textContent || innerText for elements - if ( typeof elem.textContent === 'string' ) { - return elem.textContent; - } else if ( typeof elem.innerText === 'string' ) { - // Replace IE's carriage returns - return elem.innerText.replace( rReturn, '' ); - } else { - // Traverse it's children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - } else { - - // If no nodeType, this is expected to be an array - for ( i = 0; (node = elem[i]); i++ ) { - // Do not traverse comment nodes - if ( node.nodeType !== 8 ) { - ret += getText( node ); - } - } - } - return ret; -}; - -var Expr = Sizzle.selectors = { - order: [ "ID", "NAME", "TAG" ], - - match: { - ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, - CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, - NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, - ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/, - TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, - CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/, - POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, - PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ - }, - - leftMatch: {}, - - attrMap: { - "class": "className", - "for": "htmlFor" - }, - - attrHandle: { - href: function( elem ) { - return elem.getAttribute( "href" ); - }, - type: function( elem ) { - return elem.getAttribute( "type" ); - } - }, - - relative: { - "+": function(checkSet, part){ - var isPartStr = typeof part === "string", - isTag = isPartStr && !rNonWord.test( part ), - isPartStrNotTag = isPartStr && !isTag; - - if ( isTag ) { - part = part.toLowerCase(); - } - - for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { - if ( (elem = checkSet[i]) ) { - while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} - - checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? - elem || false : - elem === part; - } - } - - if ( isPartStrNotTag ) { - Sizzle.filter( part, checkSet, true ); - } - }, - - ">": function( checkSet, part ) { - var elem, - isPartStr = typeof part === "string", - i = 0, - l = checkSet.length; - - if ( isPartStr && !rNonWord.test( part ) ) { - part = part.toLowerCase(); - - for ( ; i < l; i++ ) { - elem = checkSet[i]; - - if ( elem ) { - var parent = elem.parentNode; - checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; - } - } - - } else { - for ( ; i < l; i++ ) { - elem = checkSet[i]; - - if ( elem ) { - checkSet[i] = isPartStr ? - elem.parentNode : - elem.parentNode === part; - } - } - - if ( isPartStr ) { - Sizzle.filter( part, checkSet, true ); - } - } - }, - - "": function(checkSet, part, isXML){ - var nodeCheck, - doneName = done++, - checkFn = dirCheck; - - if ( typeof part === "string" && !rNonWord.test( part ) ) { - part = part.toLowerCase(); - nodeCheck = part; - checkFn = dirNodeCheck; - } - - checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML ); - }, - - "~": function( checkSet, part, isXML ) { - var nodeCheck, - doneName = done++, - checkFn = dirCheck; - - if ( typeof part === "string" && !rNonWord.test( part ) ) { - part = part.toLowerCase(); - nodeCheck = part; - checkFn = dirNodeCheck; - } - - checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML ); - } - }, - - find: { - ID: function( match, context, isXML ) { - if ( typeof context.getElementById !== "undefined" && !isXML ) { - var m = context.getElementById(match[1]); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - return m && m.parentNode ? [m] : []; - } - }, - - NAME: function( match, context ) { - if ( typeof context.getElementsByName !== "undefined" ) { - var ret = [], - results = context.getElementsByName( match[1] ); - - for ( var i = 0, l = results.length; i < l; i++ ) { - if ( results[i].getAttribute("name") === match[1] ) { - ret.push( results[i] ); - } - } - - return ret.length === 0 ? null : ret; - } - }, - - TAG: function( match, context ) { - if ( typeof context.getElementsByTagName !== "undefined" ) { - return context.getElementsByTagName( match[1] ); - } - } - }, - preFilter: { - CLASS: function( match, curLoop, inplace, result, not, isXML ) { - match = " " + match[1].replace( rBackslash, "" ) + " "; - - if ( isXML ) { - return match; - } - - for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { - if ( elem ) { - if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) { - if ( !inplace ) { - result.push( elem ); - } - - } else if ( inplace ) { - curLoop[i] = false; - } - } - } - - return false; - }, - - ID: function( match ) { - return match[1].replace( rBackslash, "" ); - }, - - TAG: function( match, curLoop ) { - return match[1].replace( rBackslash, "" ).toLowerCase(); - }, - - CHILD: function( match ) { - if ( match[1] === "nth" ) { - if ( !match[2] ) { - Sizzle.error( match[0] ); - } - - match[2] = match[2].replace(/^\+|\s*/g, ''); - - // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' - var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec( - match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || - !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); - - // calculate the numbers (first)n+(last) including if they are negative - match[2] = (test[1] + (test[2] || 1)) - 0; - match[3] = test[3] - 0; - } - else if ( match[2] ) { - Sizzle.error( match[0] ); - } - - // TODO: Move to normal caching system - match[0] = done++; - - return match; - }, - - ATTR: function( match, curLoop, inplace, result, not, isXML ) { - var name = match[1] = match[1].replace( rBackslash, "" ); - - if ( !isXML && Expr.attrMap[name] ) { - match[1] = Expr.attrMap[name]; - } - - // Handle if an un-quoted value was used - match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" ); - - if ( match[2] === "~=" ) { - match[4] = " " + match[4] + " "; - } - - return match; - }, - - PSEUDO: function( match, curLoop, inplace, result, not ) { - if ( match[1] === "not" ) { - // If we're dealing with a complex expression, or a simple one - if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { - match[3] = Sizzle(match[3], null, null, curLoop); - - } else { - var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); - - if ( !inplace ) { - result.push.apply( result, ret ); - } - - return false; - } - - } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { - return true; - } - - return match; - }, - - POS: function( match ) { - match.unshift( true ); - - return match; - } - }, - - filters: { - enabled: function( elem ) { - return elem.disabled === false && elem.type !== "hidden"; - }, - - disabled: function( elem ) { - return elem.disabled === true; - }, - - checked: function( elem ) { - return elem.checked === true; - }, - - selected: function( elem ) { - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - parent: function( elem ) { - return !!elem.firstChild; - }, - - empty: function( elem ) { - return !elem.firstChild; - }, - - has: function( elem, i, match ) { - return !!Sizzle( match[3], elem ).length; - }, - - header: function( elem ) { - return (/h\d/i).test( elem.nodeName ); - }, - - text: function( elem ) { - var attr = elem.getAttribute( "type" ), type = elem.type; - // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) - // use getAttribute instead to test this case - return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null ); - }, - - radio: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type; - }, - - checkbox: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type; - }, - - file: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "file" === elem.type; - }, - - password: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "password" === elem.type; - }, - - submit: function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && "submit" === elem.type; - }, - - image: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "image" === elem.type; - }, - - reset: function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && "reset" === elem.type; - }, - - button: function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && "button" === elem.type || name === "button"; - }, - - input: function( elem ) { - return (/input|select|textarea|button/i).test( elem.nodeName ); - }, - - focus: function( elem ) { - return elem === elem.ownerDocument.activeElement; - } - }, - setFilters: { - first: function( elem, i ) { - return i === 0; - }, - - last: function( elem, i, match, array ) { - return i === array.length - 1; - }, - - even: function( elem, i ) { - return i % 2 === 0; - }, - - odd: function( elem, i ) { - return i % 2 === 1; - }, - - lt: function( elem, i, match ) { - return i < match[3] - 0; - }, - - gt: function( elem, i, match ) { - return i > match[3] - 0; - }, - - nth: function( elem, i, match ) { - return match[3] - 0 === i; - }, - - eq: function( elem, i, match ) { - return match[3] - 0 === i; - } - }, - filter: { - PSEUDO: function( elem, match, i, array ) { - var name = match[1], - filter = Expr.filters[ name ]; - - if ( filter ) { - return filter( elem, i, match, array ); - - } else if ( name === "contains" ) { - return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0; - - } else if ( name === "not" ) { - var not = match[3]; - - for ( var j = 0, l = not.length; j < l; j++ ) { - if ( not[j] === elem ) { - return false; - } - } - - return true; - - } else { - Sizzle.error( name ); - } - }, - - CHILD: function( elem, match ) { - var first, last, - doneName, parent, cache, - count, diff, - type = match[1], - node = elem; - - switch ( type ) { - case "only": - case "first": - while ( (node = node.previousSibling) ) { - if ( node.nodeType === 1 ) { - return false; - } - } - - if ( type === "first" ) { - return true; - } - - node = elem; - - /* falls through */ - case "last": - while ( (node = node.nextSibling) ) { - if ( node.nodeType === 1 ) { - return false; - } - } - - return true; - - case "nth": - first = match[2]; - last = match[3]; - - if ( first === 1 && last === 0 ) { - return true; - } - - doneName = match[0]; - parent = elem.parentNode; - - if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) { - count = 0; - - for ( node = parent.firstChild; node; node = node.nextSibling ) { - if ( node.nodeType === 1 ) { - node.nodeIndex = ++count; - } - } - - parent[ expando ] = doneName; - } - - diff = elem.nodeIndex - last; - - if ( first === 0 ) { - return diff === 0; - - } else { - return ( diff % first === 0 && diff / first >= 0 ); - } - } - }, - - ID: function( elem, match ) { - return elem.nodeType === 1 && elem.getAttribute("id") === match; - }, - - TAG: function( elem, match ) { - return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match; - }, - - CLASS: function( elem, match ) { - return (" " + (elem.className || elem.getAttribute("class")) + " ") - .indexOf( match ) > -1; - }, - - ATTR: function( elem, match ) { - var name = match[1], - result = Sizzle.attr ? - Sizzle.attr( elem, name ) : - Expr.attrHandle[ name ] ? - Expr.attrHandle[ name ]( elem ) : - elem[ name ] != null ? - elem[ name ] : - elem.getAttribute( name ), - value = result + "", - type = match[2], - check = match[4]; - - return result == null ? - type === "!=" : - !type && Sizzle.attr ? - result != null : - type === "=" ? - value === check : - type === "*=" ? - value.indexOf(check) >= 0 : - type === "~=" ? - (" " + value + " ").indexOf(check) >= 0 : - !check ? - value && result !== false : - type === "!=" ? - value !== check : - type === "^=" ? - value.indexOf(check) === 0 : - type === "$=" ? - value.substr(value.length - check.length) === check : - type === "|=" ? - value === check || value.substr(0, check.length + 1) === check + "-" : - false; - }, - - POS: function( elem, match, i, array ) { - var name = match[2], - filter = Expr.setFilters[ name ]; - - if ( filter ) { - return filter( elem, i, match, array ); - } - } - } -}; - -var origPOS = Expr.match.POS, - fescape = function(all, num){ - return "\\" + (num - 0 + 1); - }; - -for ( var type in Expr.match ) { - Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); - Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); -} -// Expose origPOS -// "global" as in regardless of relation to brackets/parens -Expr.match.globalPOS = origPOS; - -var makeArray = function( array, results ) { - array = Array.prototype.slice.call( array, 0 ); - - if ( results ) { - results.push.apply( results, array ); - return results; - } - - return array; -}; - -// Perform a simple check to determine if the browser is capable of -// converting a NodeList to an array using builtin methods. -// Also verifies that the returned array holds DOM nodes -// (which is not the case in the Blackberry browser) -try { - Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; - -// Provide a fallback method if it does not work -} catch( e ) { - makeArray = function( array, results ) { - var i = 0, - ret = results || []; - - if ( toString.call(array) === "[object Array]" ) { - Array.prototype.push.apply( ret, array ); - - } else { - if ( typeof array.length === "number" ) { - for ( var l = array.length; i < l; i++ ) { - ret.push( array[i] ); - } - - } else { - for ( ; array[i]; i++ ) { - ret.push( array[i] ); - } - } - } - - return ret; - }; -} - -var sortOrder, siblingCheck; - -if ( document.documentElement.compareDocumentPosition ) { - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { - return a.compareDocumentPosition ? -1 : 1; - } - - return a.compareDocumentPosition(b) & 4 ? -1 : 1; - }; - -} else { - sortOrder = function( a, b ) { - // The nodes are identical, we can exit early - if ( a === b ) { - hasDuplicate = true; - return 0; - - // Fallback to using sourceIndex (in IE) if it's available on both nodes - } else if ( a.sourceIndex && b.sourceIndex ) { - return a.sourceIndex - b.sourceIndex; - } - - var al, bl, - ap = [], - bp = [], - aup = a.parentNode, - bup = b.parentNode, - cur = aup; - - // If the nodes are siblings (or identical) we can do a quick check - if ( aup === bup ) { - return siblingCheck( a, b ); - - // If no parents were found then the nodes are disconnected - } else if ( !aup ) { - return -1; - - } else if ( !bup ) { - return 1; - } - - // Otherwise they're somewhere else in the tree so we need - // to build up a full list of the parentNodes for comparison - while ( cur ) { - ap.unshift( cur ); - cur = cur.parentNode; - } - - cur = bup; - - while ( cur ) { - bp.unshift( cur ); - cur = cur.parentNode; - } - - al = ap.length; - bl = bp.length; - - // Start walking down the tree looking for a discrepancy - for ( var i = 0; i < al && i < bl; i++ ) { - if ( ap[i] !== bp[i] ) { - return siblingCheck( ap[i], bp[i] ); - } - } - - // We ended someplace up the tree so do a sibling check - return i === al ? - siblingCheck( a, bp[i], -1 ) : - siblingCheck( ap[i], b, 1 ); - }; - - siblingCheck = function( a, b, ret ) { - if ( a === b ) { - return ret; - } - - var cur = a.nextSibling; - - while ( cur ) { - if ( cur === b ) { - return -1; - } - - cur = cur.nextSibling; - } - - return 1; - }; -} - -// Check to see if the browser returns elements by name when -// querying by getElementById (and provide a workaround) -(function(){ - // We're going to inject a fake input element with a specified name - var form = document.createElement("div"), - id = "script" + (new Date()).getTime(), - root = document.documentElement; - - form.innerHTML = ""; - - // Inject it into the root element, check its status, and remove it quickly - root.insertBefore( form, root.firstChild ); - - // The workaround has to do additional checks after a getElementById - // Which slows things down for other browsers (hence the branching) - if ( document.getElementById( id ) ) { - Expr.find.ID = function( match, context, isXML ) { - if ( typeof context.getElementById !== "undefined" && !isXML ) { - var m = context.getElementById(match[1]); - - return m ? - m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? - [m] : - undefined : - []; - } - }; - - Expr.filter.ID = function( elem, match ) { - var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); - - return elem.nodeType === 1 && node && node.nodeValue === match; - }; - } - - root.removeChild( form ); - - // release memory in IE - root = form = null; -})(); - -(function(){ - // Check to see if the browser returns only elements - // when doing getElementsByTagName("*") - - // Create a fake element - var div = document.createElement("div"); - div.appendChild( document.createComment("") ); - - // Make sure no comments are found - if ( div.getElementsByTagName("*").length > 0 ) { - Expr.find.TAG = function( match, context ) { - var results = context.getElementsByTagName( match[1] ); - - // Filter out possible comments - if ( match[1] === "*" ) { - var tmp = []; - - for ( var i = 0; results[i]; i++ ) { - if ( results[i].nodeType === 1 ) { - tmp.push( results[i] ); - } - } - - results = tmp; - } - - return results; - }; - } - - // Check to see if an attribute returns normalized href attributes - div.innerHTML = ""; - - if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && - div.firstChild.getAttribute("href") !== "#" ) { - - Expr.attrHandle.href = function( elem ) { - return elem.getAttribute( "href", 2 ); - }; - } - - // release memory in IE - div = null; -})(); - -if ( document.querySelectorAll ) { - (function(){ - var oldSizzle = Sizzle, - div = document.createElement("div"), - id = "__sizzle__"; - - div.innerHTML = "

"; - - // Safari can't handle uppercase or unicode characters when - // in quirks mode. - if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { - return; - } - - Sizzle = function( query, context, extra, seed ) { - context = context || document; - - // Only use querySelectorAll on non-XML documents - // (ID selectors don't work in non-HTML documents) - if ( !seed && !Sizzle.isXML(context) ) { - // See if we find a selector to speed up - var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query ); - - if ( match && (context.nodeType === 1 || context.nodeType === 9) ) { - // Speed-up: Sizzle("TAG") - if ( match[1] ) { - return makeArray( context.getElementsByTagName( query ), extra ); - - // Speed-up: Sizzle(".CLASS") - } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) { - return makeArray( context.getElementsByClassName( match[2] ), extra ); - } - } - - if ( context.nodeType === 9 ) { - // Speed-up: Sizzle("body") - // The body element only exists once, optimize finding it - if ( query === "body" && context.body ) { - return makeArray( [ context.body ], extra ); - - // Speed-up: Sizzle("#ID") - } else if ( match && match[3] ) { - var elem = context.getElementById( match[3] ); - - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE and Opera return items - // by name instead of ID - if ( elem.id === match[3] ) { - return makeArray( [ elem ], extra ); - } - - } else { - return makeArray( [], extra ); - } - } - - try { - return makeArray( context.querySelectorAll(query), extra ); - } catch(qsaError) {} - - // qSA works strangely on Element-rooted queries - // We can work around this by specifying an extra ID on the root - // and working up from there (Thanks to Andrew Dupont for the technique) - // IE 8 doesn't work on object elements - } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { - var oldContext = context, - old = context.getAttribute( "id" ), - nid = old || id, - hasParent = context.parentNode, - relativeHierarchySelector = /^\s*[+~]/.test( query ); - - if ( !old ) { - context.setAttribute( "id", nid ); - } else { - nid = nid.replace( /'/g, "\\$&" ); - } - if ( relativeHierarchySelector && hasParent ) { - context = context.parentNode; - } - - try { - if ( !relativeHierarchySelector || hasParent ) { - return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra ); - } - - } catch(pseudoError) { - } finally { - if ( !old ) { - oldContext.removeAttribute( "id" ); - } - } - } - } - - return oldSizzle(query, context, extra, seed); - }; - - for ( var prop in oldSizzle ) { - Sizzle[ prop ] = oldSizzle[ prop ]; - } - - // release memory in IE - div = null; - })(); -} - -(function(){ - var html = document.documentElement, - matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector; - - if ( matches ) { - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9 fails this) - var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ), - pseudoWorks = false; - - try { - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( document.documentElement, "[test!='']:sizzle" ); - - } catch( pseudoError ) { - pseudoWorks = true; - } - - Sizzle.matchesSelector = function( node, expr ) { - // Make sure that attribute selectors are quoted - expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); - - if ( !Sizzle.isXML( node ) ) { - try { - if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { - var ret = matches.call( node, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || !disconnectedMatch || - // As well, disconnected nodes are said to be in a document - // fragment in IE 9, so check for that - node.document && node.document.nodeType !== 11 ) { - return ret; - } - } - } catch(e) {} - } - - return Sizzle(expr, null, null, [node]).length > 0; - }; - } -})(); - -(function(){ - var div = document.createElement("div"); - - div.innerHTML = "
"; - - // Opera can't find a second classname (in 9.6) - // Also, make sure that getElementsByClassName actually exists - if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { - return; - } - - // Safari caches class attributes, doesn't catch changes (in 3.2) - div.lastChild.className = "e"; - - if ( div.getElementsByClassName("e").length === 1 ) { - return; - } - - Expr.order.splice(1, 0, "CLASS"); - Expr.find.CLASS = function( match, context, isXML ) { - if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { - return context.getElementsByClassName(match[1]); - } - }; - - // release memory in IE - div = null; -})(); - -function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - - if ( elem ) { - var match = false; - - elem = elem[dir]; - - while ( elem ) { - if ( elem[ expando ] === doneName ) { - match = checkSet[elem.sizset]; - break; - } - - if ( elem.nodeType === 1 && !isXML ){ - elem[ expando ] = doneName; - elem.sizset = i; - } - - if ( elem.nodeName.toLowerCase() === cur ) { - match = elem; - break; - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } -} - -function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - - if ( elem ) { - var match = false; - - elem = elem[dir]; - - while ( elem ) { - if ( elem[ expando ] === doneName ) { - match = checkSet[elem.sizset]; - break; - } - - if ( elem.nodeType === 1 ) { - if ( !isXML ) { - elem[ expando ] = doneName; - elem.sizset = i; - } - - if ( typeof cur !== "string" ) { - if ( elem === cur ) { - match = true; - break; - } - - } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { - match = elem; - break; - } - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } -} - -if ( document.documentElement.contains ) { - Sizzle.contains = function( a, b ) { - return a !== b && (a.contains ? a.contains(b) : true); - }; - -} else if ( document.documentElement.compareDocumentPosition ) { - Sizzle.contains = function( a, b ) { - return !!(a.compareDocumentPosition(b) & 16); - }; - -} else { - Sizzle.contains = function() { - return false; - }; -} - -Sizzle.isXML = function( elem ) { - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; - - return documentElement ? documentElement.nodeName !== "HTML" : false; -}; - -var posProcess = function( selector, context, seed ) { - var match, - tmpSet = [], - later = "", - root = context.nodeType ? [context] : context; - - // Position selectors must be done after the filter - // And so must :not(positional) so we move all PSEUDOs to the end - while ( (match = Expr.match.PSEUDO.exec( selector )) ) { - later += match[0]; - selector = selector.replace( Expr.match.PSEUDO, "" ); - } - - selector = Expr.relative[selector] ? selector + "*" : selector; - - for ( var i = 0, l = root.length; i < l; i++ ) { - Sizzle( selector, root[i], tmpSet, seed ); - } - - return Sizzle.filter( later, tmpSet ); -}; - -// EXPOSE -// Override sizzle attribute retrieval -Sizzle.attr = jQuery.attr; -Sizzle.selectors.attrMap = {}; -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; -jQuery.expr[":"] = jQuery.expr.filters; -jQuery.unique = Sizzle.uniqueSort; -jQuery.text = Sizzle.getText; -jQuery.isXMLDoc = Sizzle.isXML; -jQuery.contains = Sizzle.contains; - - -})(); - - -var runtil = /Until$/, - rparentsprev = /^(?:parents|prevUntil|prevAll)/, - // Note: This RegExp should be improved, or likely pulled from Sizzle - rmultiselector = /,/, - isSimple = /^.[^:#\[\.,]*$/, - slice = Array.prototype.slice, - POS = jQuery.expr.match.globalPOS, - // methods guaranteed to produce a unique set when starting from a unique set - guaranteedUnique = { - children: true, - contents: true, - next: true, - prev: true - }; - -jQuery.fn.extend({ - find: function( selector ) { - var self = this, - i, l; - - if ( typeof selector !== "string" ) { - return jQuery( selector ).filter(function() { - for ( i = 0, l = self.length; i < l; i++ ) { - if ( jQuery.contains( self[ i ], this ) ) { - return true; - } - } - }); - } - - var ret = this.pushStack( "", "find", selector ), - length, n, r; - - for ( i = 0, l = this.length; i < l; i++ ) { - length = ret.length; - jQuery.find( selector, this[i], ret ); - - if ( i > 0 ) { - // Make sure that the results are unique - for ( n = length; n < ret.length; n++ ) { - for ( r = 0; r < length; r++ ) { - if ( ret[r] === ret[n] ) { - ret.splice(n--, 1); - break; - } - } - } - } - } - - return ret; - }, - - has: function( target ) { - var targets = jQuery( target ); - return this.filter(function() { - for ( var i = 0, l = targets.length; i < l; i++ ) { - if ( jQuery.contains( this, targets[i] ) ) { - return true; - } - } - }); - }, - - not: function( selector ) { - return this.pushStack( winnow(this, selector, false), "not", selector); - }, - - filter: function( selector ) { - return this.pushStack( winnow(this, selector, true), "filter", selector ); - }, - - is: function( selector ) { - return !!selector && ( - typeof selector === "string" ? - // If this is a positional selector, check membership in the returned set - // so $("p:first").is("p:last") won't return true for a doc with two "p". - POS.test( selector ) ? - jQuery( selector, this.context ).index( this[0] ) >= 0 : - jQuery.filter( selector, this ).length > 0 : - this.filter( selector ).length > 0 ); - }, - - closest: function( selectors, context ) { - var ret = [], i, l, cur = this[0]; - - // Array (deprecated as of jQuery 1.7) - if ( jQuery.isArray( selectors ) ) { - var level = 1; - - while ( cur && cur.ownerDocument && cur !== context ) { - for ( i = 0; i < selectors.length; i++ ) { - - if ( jQuery( cur ).is( selectors[ i ] ) ) { - ret.push({ selector: selectors[ i ], elem: cur, level: level }); - } - } - - cur = cur.parentNode; - level++; - } - - return ret; - } - - // String - var pos = POS.test( selectors ) || typeof selectors !== "string" ? - jQuery( selectors, context || this.context ) : - 0; - - for ( i = 0, l = this.length; i < l; i++ ) { - cur = this[i]; - - while ( cur ) { - if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { - ret.push( cur ); - break; - - } else { - cur = cur.parentNode; - if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) { - break; - } - } - } - } - - ret = ret.length > 1 ? jQuery.unique( ret ) : ret; - - return this.pushStack( ret, "closest", selectors ); - }, - - // Determine the position of an element within - // the matched set of elements - index: function( elem ) { - - // No argument, return index in parent - if ( !elem ) { - return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1; - } - - // index in selector - if ( typeof elem === "string" ) { - return jQuery.inArray( this[0], jQuery( elem ) ); - } - - // Locate the position of the desired element - return jQuery.inArray( - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[0] : elem, this ); - }, - - add: function( selector, context ) { - var set = typeof selector === "string" ? - jQuery( selector, context ) : - jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), - all = jQuery.merge( this.get(), set ); - - return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? - all : - jQuery.unique( all ) ); - }, - - andSelf: function() { - return this.add( this.prevObject ); - } -}); - -// A painfully simple check to see if an element is disconnected -// from a document (should be improved, where feasible). -function isDisconnected( node ) { - return !node || !node.parentNode || node.parentNode.nodeType === 11; -} - -jQuery.each({ - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return jQuery.dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, i, until ) { - return jQuery.dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return jQuery.nth( elem, 2, "nextSibling" ); - }, - prev: function( elem ) { - return jQuery.nth( elem, 2, "previousSibling" ); - }, - nextAll: function( elem ) { - return jQuery.dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return jQuery.dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, i, until ) { - return jQuery.dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, i, until ) { - return jQuery.dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); - }, - children: function( elem ) { - return jQuery.sibling( elem.firstChild ); - }, - contents: function( elem ) { - return jQuery.nodeName( elem, "iframe" ) ? - elem.contentDocument || elem.contentWindow.document : - jQuery.makeArray( elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var ret = jQuery.map( this, fn, until ); - - if ( !runtil.test( name ) ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - ret = jQuery.filter( selector, ret ); - } - - ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret; - - if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) { - ret = ret.reverse(); - } - - return this.pushStack( ret, name, slice.call( arguments ).join(",") ); - }; -}); - -jQuery.extend({ - filter: function( expr, elems, not ) { - if ( not ) { - expr = ":not(" + expr + ")"; - } - - return elems.length === 1 ? - jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : - jQuery.find.matches(expr, elems); - }, - - dir: function( elem, dir, until ) { - var matched = [], - cur = elem[ dir ]; - - while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { - if ( cur.nodeType === 1 ) { - matched.push( cur ); - } - cur = cur[dir]; - } - return matched; - }, - - nth: function( cur, result, dir, elem ) { - result = result || 1; - var num = 0; - - for ( ; cur; cur = cur[dir] ) { - if ( cur.nodeType === 1 && ++num === result ) { - break; - } - } - - return cur; - }, - - sibling: function( n, elem ) { - var r = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - r.push( n ); - } - } - - return r; - } -}); - -// Implement the identical functionality for filter and not -function winnow( elements, qualifier, keep ) { - - // Can't pass null or undefined to indexOf in Firefox 4 - // Set to 0 to skip string check - qualifier = qualifier || 0; - - if ( jQuery.isFunction( qualifier ) ) { - return jQuery.grep(elements, function( elem, i ) { - var retVal = !!qualifier.call( elem, i, elem ); - return retVal === keep; - }); - - } else if ( qualifier.nodeType ) { - return jQuery.grep(elements, function( elem, i ) { - return ( elem === qualifier ) === keep; - }); - - } else if ( typeof qualifier === "string" ) { - var filtered = jQuery.grep(elements, function( elem ) { - return elem.nodeType === 1; - }); - - if ( isSimple.test( qualifier ) ) { - return jQuery.filter(qualifier, filtered, !keep); - } else { - qualifier = jQuery.filter( qualifier, filtered ); - } - } - - return jQuery.grep(elements, function( elem, i ) { - return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep; - }); -} - - - - -function createSafeFragment( document ) { - var list = nodeNames.split( "|" ), - safeFrag = document.createDocumentFragment(); - - if ( safeFrag.createElement ) { - while ( list.length ) { - safeFrag.createElement( - list.pop() - ); - } - } - return safeFrag; -} - -var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + - "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", - rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, - rleadingWhitespace = /^\s+/, - rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, - rtagName = /<([\w:]+)/, - rtbody = /]", "i"), - // checked="checked" or checked - rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, - rscriptType = /\/(java|ecma)script/i, - rcleanScript = /^\s*", "" ], - legend: [ 1, "
", "
" ], - thead: [ 1, "", "
" ], - tr: [ 2, "", "
" ], - td: [ 3, "", "
" ], - col: [ 2, "", "
" ], - area: [ 1, "", "" ], - _default: [ 0, "", "" ] - }, - safeFragment = createSafeFragment( document ); - -wrapMap.optgroup = wrapMap.option; -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -// IE can't serialize and - - - - - - - - - -
-
-
-
- - -

Index

- -
- A - | E - | G - | R - | T - -
-

A

- - -
- -
add_neurons() (elm.ELM method) -
- -
- -

E

- - - -
- -
ELM (class in elm) -
- -
- -
elm (module) -
- -
- -

G

- - -
- -
get_model() (elm.ELM method) -
- -
- -

R

- - -
- -
run() (elm.ELM method) -
- -
- -

T

- - -
- -
train() (elm.ELM method) -
- -
- - - -
-
-
-
-
- - - - - -
-
-
-
- - - - \ No newline at end of file diff --git a/develop/_Sphinx/doc/_build/html/index.html b/develop/_Sphinx/doc/_build/html/index.html deleted file mode 100755 index ec771fa..0000000 --- a/develop/_Sphinx/doc/_build/html/index.html +++ /dev/null @@ -1,188 +0,0 @@ - - - - - - - - Welcome to ELM toolbox’s documentation! — ELM toolbox 0.1a1 documentation - - - - - - - - - - - - - - -
-
-
-
- -
-

Welcome to ELM toolbox’s documentation!

-

Contents:

-
-
    -
-
-

Created on Aug 18, 2014

-

@author: akusoka1

-
-
-class elm.ELM(inputs, targets)
-

Extreme Learning Machine, high-level wrapper.

-
-
-add_neurons(count, ufunc, W=None, B=None)
-

Add neurons of a given type to the model.

-

Can specify W input weight vector and B scalar bias. -:param count: number of neurons to add -:param ufunc: transformation function of those neurons, can use “None” for identity function -:param W: weight matrix for input-to-hidden layer -:param B: biases for hidden layer

-
- -
-
-get_model()
-

Returns all parameters of the ELM model.

- --- - - - -
Return type:python dictionary
-

Model does not require specific classes to load and edit, unlike pickled class instances.

-

Neuron format: list of [‘input weights vector’, ‘bias scalar’, ‘transformation function as numpy.ufunc’]

-
- -
-
-run(X)
-

Get predictions using a trained or loaded ELM model.

- --- - - - - - -
Parameters:X – input data
Return type:predictions Th
-
- -
-
-train(X, T)
-

Wrapper for training ELM.

- --- - - - -
Parameters:
    -
  • X (2-d matrix) – Training inputs
  • -
  • T (1-d or 2-d matrix) – Training targets
  • -
-
-

Trains the ELM model with input features and corresponding desired outputs. -Number of inputs and outputs must be the same.

-

If no neurons are added to the model, adds ‘tanh’ neurons automatically.

-
- -
- -
-
-

Indices and tables

- -
- - -
-
-
-
-
-

Table Of Contents

- - -

This Page

- - - -
-
-
-
- - - - \ No newline at end of file diff --git a/develop/_Sphinx/doc/_build/html/objects.inv b/develop/_Sphinx/doc/_build/html/objects.inv deleted file mode 100755 index 0a2f4a2..0000000 Binary files a/develop/_Sphinx/doc/_build/html/objects.inv and /dev/null differ diff --git a/develop/_Sphinx/doc/_build/html/py-modindex.html b/develop/_Sphinx/doc/_build/html/py-modindex.html deleted file mode 100755 index 98f475b..0000000 --- a/develop/_Sphinx/doc/_build/html/py-modindex.html +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - - Python Module Index — ELM toolbox 0.1a1 documentation - - - - - - - - - - - - - - - - - - - -
-
-
-
- - -

Python Module Index

- -
- e -
- - - - - - - -
 
- e
- elm -
- - -
-
-
-
-
- - -
-
-
-
- - - - \ No newline at end of file diff --git a/develop/_Sphinx/doc/_build/html/search.html b/develop/_Sphinx/doc/_build/html/search.html deleted file mode 100755 index dc34bb1..0000000 --- a/develop/_Sphinx/doc/_build/html/search.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - Search — ELM toolbox 0.1a1 documentation - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -

Search

-
- -

- Please activate JavaScript to enable the search - functionality. -

-
-

- From here you can search these documents. Enter your search - words into the box below and click "search". Note that the search - function will automatically search for all of the words. Pages - containing fewer words won't appear in the result list. -

-
- - - -
- -
- -
- -
-
-
-
-
-
-
-
-
- - - - \ No newline at end of file diff --git a/develop/_Sphinx/doc/_build/html/searchindex.js b/develop/_Sphinx/doc/_build/html/searchindex.js deleted file mode 100755 index b799f2b..0000000 --- a/develop/_Sphinx/doc/_build/html/searchindex.js +++ /dev/null @@ -1 +0,0 @@ -Search.setIndex({envversion:42,terms:{load:0,"function":0,layer:0,featur:0,weight:0,get_model:0,predict:0,modul:0,neuron:0,number:0,automat:0,dataset:[],high:0,scalar:0,bias:0,param:0,arg:[],desir:0,add_neuron:0,akusoka1:0,paramet:0,index:0,given:0,creat:0,aug:0,author:0,get:0,numpi:0,transform:0,wrapper:0,content:0,matrix:0,add:0,vector:0,requir:0,input:0,hidden:0,type:0,machin:0,all:0,ufunc:0,run:0,format:0,python:0,"return":0,specifi:0,bia:0,train:0,dictionari:0,same:0,data:0,"class":0,those:0,must:0,count:0,dim:[],search:0,ident:0,target:0,specif:0,level:0,edit:0,tanh:0,list:0,unlik:0,doe:0,pickl:0,instanc:0,can:0,none:0,learn:0,output:0,model:0,extrem:0,page:0,correspond:0},objtypes:{"0":"py:module","1":"py:method","2":"py:class"},objnames:{"0":["py","module","Python module"],"1":["py","method","Python method"],"2":["py","class","Python class"]},filenames:["index"],titles:["Welcome to ELM toolbox’s documentation!"],objects:{"":{elm:[0,0,0,"-"]},"elm.ELM":{add_neurons:[0,1,1,""],train:[0,1,1,""],get_model:[0,1,1,""],run:[0,1,1,""]},elm:{ELM:[0,2,1,""]}},titleterms:{welcom:0,elm:0,indic:0,tabl:0,toolbox:0,document:0}}) \ No newline at end of file diff --git a/develop/_Sphinx/doc/_build/latex/ELMtoolbox.aux b/develop/_Sphinx/doc/_build/latex/ELMtoolbox.aux deleted file mode 100755 index 449ed66..0000000 --- a/develop/_Sphinx/doc/_build/latex/ELMtoolbox.aux +++ /dev/null @@ -1,36 +0,0 @@ -\relax -\providecommand\hyper@newdestlabel[2]{} -\providecommand\HyperFirstAtBeginDocument{\AtBeginDocument} -\HyperFirstAtBeginDocument{\ifx\hyper@anchor\@undefined -\global\let\oldcontentsline\contentsline -\gdef\contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}} -\global\let\oldnewlabel\newlabel -\gdef\newlabel#1#2{\newlabelxx{#1}#2} -\gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}} -\AtEndDocument{\ifx\hyper@anchor\@undefined -\let\contentsline\oldcontentsline -\let\newlabel\oldnewlabel -\fi} -\fi} -\global\let\hyper@last\relax -\gdef\HyperFirstAtBeginDocument#1{#1} -\providecommand\HyField@AuxAddToFields[1]{} -\providecommand\HyField@AuxAddToCoFields[2]{} -\select@language{english} -\@writefile{toc}{\select@language{english}} -\@writefile{lof}{\select@language{english}} -\@writefile{lot}{\select@language{english}} -\newlabel{index::doc}{{}{1}{}{section*.2}{}} -\newlabel{index:module-elm}{{}{1}{}{section*.3}{}} -\newlabel{index:elm.ELM}{{}{1}{}{section*.4}{}} -\newlabel{index:elm.ELM.add_neurons}{{}{1}{}{section*.5}{}} -\newlabel{index:elm.ELM.get_model}{{}{1}{}{section*.6}{}} -\newlabel{index:elm.ELM.run}{{}{1}{}{section*.7}{}} -\newlabel{index:elm.ELM.train}{{}{1}{}{section*.8}{}} -\@writefile{toc}{\contentsline {chapter}{\numberline {1}Indices and tables}{3}{chapter.1}} -\@writefile{lof}{\addvspace {10\p@ }} -\@writefile{lot}{\addvspace {10\p@ }} -\newlabel{index:welcome-to-elm-toolbox-s-documentation}{{1}{3}{Indices and tables}{chapter.1}{}} -\newlabel{index:indices-and-tables}{{1}{3}{Indices and tables}{chapter.1}{}} -\@writefile{toc}{\contentsline {chapter}{Python Module Index}{5}{section*.9}} -\@writefile{toc}{\contentsline {chapter}{Index}{7}{section*.10}} diff --git a/develop/_Sphinx/doc/_build/latex/ELMtoolbox.idx b/develop/_Sphinx/doc/_build/latex/ELMtoolbox.idx deleted file mode 100755 index 55f4f08..0000000 --- a/develop/_Sphinx/doc/_build/latex/ELMtoolbox.idx +++ /dev/null @@ -1,6 +0,0 @@ -\indexentry{elm (module)|hyperpage}{1} -\indexentry{ELM (class in elm)|hyperpage}{1} -\indexentry{add\_neurons() (elm.ELM method)|hyperpage}{1} -\indexentry{get\_model() (elm.ELM method)|hyperpage}{1} -\indexentry{run() (elm.ELM method)|hyperpage}{1} -\indexentry{train() (elm.ELM method)|hyperpage}{1} diff --git a/develop/_Sphinx/doc/_build/latex/ELMtoolbox.ilg b/develop/_Sphinx/doc/_build/latex/ELMtoolbox.ilg deleted file mode 100755 index ace096b..0000000 --- a/develop/_Sphinx/doc/_build/latex/ELMtoolbox.ilg +++ /dev/null @@ -1,7 +0,0 @@ -This is makeindex, version 2.15 [TeX Live 2013] (kpathsea + Thai support). -Scanning style file ./python.ist......done (6 attributes redefined, 0 ignored). -Scanning input file ELMtoolbox.idx....done (6 entries accepted, 0 rejected). -Sorting entries....done (15 comparisons). -Generating output file ELMtoolbox.ind....done (24 lines written, 0 warnings). -Output written in ELMtoolbox.ind. -Transcript written in ELMtoolbox.ilg. diff --git a/develop/_Sphinx/doc/_build/latex/ELMtoolbox.ind b/develop/_Sphinx/doc/_build/latex/ELMtoolbox.ind deleted file mode 100755 index 6ccba07..0000000 --- a/develop/_Sphinx/doc/_build/latex/ELMtoolbox.ind +++ /dev/null @@ -1,24 +0,0 @@ -\begin{theindex} -\def\bigletter#1{{\Large\sffamily#1}\nopagebreak\vspace{1mm}} - - \bigletter A - \item add\_neurons() (elm.ELM method), \hyperpage{1} - - \indexspace - \bigletter E - \item ELM (class in elm), \hyperpage{1} - \item elm (module), \hyperpage{1} - - \indexspace - \bigletter G - \item get\_model() (elm.ELM method), \hyperpage{1} - - \indexspace - \bigletter R - \item run() (elm.ELM method), \hyperpage{1} - - \indexspace - \bigletter T - \item train() (elm.ELM method), \hyperpage{1} - -\end{theindex} diff --git a/develop/_Sphinx/doc/_build/latex/ELMtoolbox.log b/develop/_Sphinx/doc/_build/latex/ELMtoolbox.log deleted file mode 100755 index f7fcedd..0000000 --- a/develop/_Sphinx/doc/_build/latex/ELMtoolbox.log +++ /dev/null @@ -1,978 +0,0 @@ -This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian) (format=pdflatex 2014.7.4) 20 AUG 2014 12:44 -entering extended mode - restricted \write18 enabled. - %&-line parsing enabled. -**ELMtoolbox.tex -(./ELMtoolbox.tex -LaTeX2e <2011/06/27> -Babel <3.9h> and hyphenation patterns for 40 languages loaded. -(./sphinxmanual.cls -Document Class: sphinxmanual 2009/06/02 Document class (Sphinx manual) -(/usr/share/texlive/texmf-dist/tex/latex/base/report.cls -Document Class: report 2007/10/19 v1.4h Standard LaTeX document class -(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo -File: size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option) -) -\c@part=\count79 -\c@chapter=\count80 -\c@section=\count81 -\c@subsection=\count82 -\c@subsubsection=\count83 -\c@paragraph=\count84 -\c@subparagraph=\count85 -\c@figure=\count86 -\c@table=\count87 -\abovecaptionskip=\skip41 -\belowcaptionskip=\skip42 -\bibindent=\dimen102 -)) -(/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty -Package: inputenc 2008/03/30 v1.1d Input encoding file -\inpenc@prehook=\toks14 -\inpenc@posthook=\toks15 - -(/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def -File: utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc -Now handling font encoding OML ... -... no UTF-8 mapping file for font encoding OML -Now handling font encoding T1 ... -... processing UTF-8 mapping file for font encoding T1 - -(/usr/share/texlive/texmf-dist/tex/latex/base/t1enc.dfu -File: t1enc.dfu 2008/04/05 v1.1m UTF-8 support for inputenc - defining Unicode char U+00A1 (decimal 161) - defining Unicode char U+00A3 (decimal 163) - defining Unicode char U+00AB (decimal 171) - defining Unicode char U+00BB (decimal 187) - defining Unicode char U+00BF (decimal 191) - defining Unicode char U+00C0 (decimal 192) - defining Unicode char U+00C1 (decimal 193) - defining Unicode char U+00C2 (decimal 194) - defining Unicode char U+00C3 (decimal 195) - defining Unicode char U+00C4 (decimal 196) - defining Unicode char U+00C5 (decimal 197) - defining Unicode char U+00C6 (decimal 198) - defining Unicode char U+00C7 (decimal 199) - defining Unicode char U+00C8 (decimal 200) - defining Unicode char U+00C9 (decimal 201) - defining Unicode char U+00CA (decimal 202) - defining Unicode char U+00CB (decimal 203) - defining Unicode char U+00CC (decimal 204) - defining Unicode char U+00CD (decimal 205) - defining Unicode char U+00CE (decimal 206) - defining Unicode char U+00CF (decimal 207) - defining Unicode char U+00D0 (decimal 208) - defining Unicode char U+00D1 (decimal 209) - defining Unicode char U+00D2 (decimal 210) - defining Unicode char U+00D3 (decimal 211) - defining Unicode char U+00D4 (decimal 212) - defining Unicode char U+00D5 (decimal 213) - defining Unicode char U+00D6 (decimal 214) - defining Unicode char U+00D8 (decimal 216) - defining Unicode char U+00D9 (decimal 217) - defining Unicode char U+00DA (decimal 218) - defining Unicode char U+00DB (decimal 219) - defining Unicode char U+00DC (decimal 220) - defining Unicode char U+00DD (decimal 221) - defining Unicode char U+00DE (decimal 222) - defining Unicode char U+00DF (decimal 223) - defining Unicode char U+00E0 (decimal 224) - defining Unicode char U+00E1 (decimal 225) - defining Unicode char U+00E2 (decimal 226) - defining Unicode char U+00E3 (decimal 227) - defining Unicode char U+00E4 (decimal 228) - defining Unicode char U+00E5 (decimal 229) - defining Unicode char U+00E6 (decimal 230) - defining Unicode char U+00E7 (decimal 231) - defining Unicode char U+00E8 (decimal 232) - defining Unicode char U+00E9 (decimal 233) - defining Unicode char U+00EA (decimal 234) - defining Unicode char U+00EB (decimal 235) - defining Unicode char U+00EC (decimal 236) - defining Unicode char U+00ED (decimal 237) - defining Unicode char U+00EE (decimal 238) - defining Unicode char U+00EF (decimal 239) - defining Unicode char U+00F0 (decimal 240) - defining Unicode char U+00F1 (decimal 241) - defining Unicode char U+00F2 (decimal 242) - defining Unicode char U+00F3 (decimal 243) - defining Unicode char U+00F4 (decimal 244) - defining Unicode char U+00F5 (decimal 245) - defining Unicode char U+00F6 (decimal 246) - defining Unicode char U+00F8 (decimal 248) - defining Unicode char U+00F9 (decimal 249) - defining Unicode char U+00FA (decimal 250) - defining Unicode char U+00FB (decimal 251) - defining Unicode char U+00FC (decimal 252) - defining Unicode char U+00FD (decimal 253) - defining Unicode char U+00FE (decimal 254) - defining Unicode char U+00FF (decimal 255) - defining Unicode char U+0102 (decimal 258) - defining Unicode char U+0103 (decimal 259) - defining Unicode char U+0104 (decimal 260) - defining Unicode char U+0105 (decimal 261) - defining Unicode char U+0106 (decimal 262) - defining Unicode char U+0107 (decimal 263) - defining Unicode char U+010C (decimal 268) - defining Unicode char U+010D (decimal 269) - defining Unicode char U+010E (decimal 270) - defining Unicode char U+010F (decimal 271) - defining Unicode char U+0110 (decimal 272) - defining Unicode char U+0111 (decimal 273) - defining Unicode char U+0118 (decimal 280) - defining Unicode char U+0119 (decimal 281) - defining Unicode char U+011A (decimal 282) - defining Unicode char U+011B (decimal 283) - defining Unicode char U+011E (decimal 286) - defining Unicode char U+011F (decimal 287) - defining Unicode char U+0130 (decimal 304) - defining Unicode char U+0131 (decimal 305) - defining Unicode char U+0132 (decimal 306) - defining Unicode char U+0133 (decimal 307) - defining Unicode char U+0139 (decimal 313) - defining Unicode char U+013A (decimal 314) - defining Unicode char U+013D (decimal 317) - defining Unicode char U+013E (decimal 318) - defining Unicode char U+0141 (decimal 321) - defining Unicode char U+0142 (decimal 322) - defining Unicode char U+0143 (decimal 323) - defining Unicode char U+0144 (decimal 324) - defining Unicode char U+0147 (decimal 327) - defining Unicode char U+0148 (decimal 328) - defining Unicode char U+014A (decimal 330) - defining Unicode char U+014B (decimal 331) - defining Unicode char U+0150 (decimal 336) - defining Unicode char U+0151 (decimal 337) - defining Unicode char U+0152 (decimal 338) - defining Unicode char U+0153 (decimal 339) - defining Unicode char U+0154 (decimal 340) - defining Unicode char U+0155 (decimal 341) - defining Unicode char U+0158 (decimal 344) - defining Unicode char U+0159 (decimal 345) - defining Unicode char U+015A (decimal 346) - defining Unicode char U+015B (decimal 347) - defining Unicode char U+015E (decimal 350) - defining Unicode char U+015F (decimal 351) - defining Unicode char U+0160 (decimal 352) - defining Unicode char U+0161 (decimal 353) - defining Unicode char U+0162 (decimal 354) - defining Unicode char U+0163 (decimal 355) - defining Unicode char U+0164 (decimal 356) - defining Unicode char U+0165 (decimal 357) - defining Unicode char U+016E (decimal 366) - defining Unicode char U+016F (decimal 367) - defining Unicode char U+0170 (decimal 368) - defining Unicode char U+0171 (decimal 369) - defining Unicode char U+0178 (decimal 376) - defining Unicode char U+0179 (decimal 377) - defining Unicode char U+017A (decimal 378) - defining Unicode char U+017B (decimal 379) - defining Unicode char U+017C (decimal 380) - defining Unicode char U+017D (decimal 381) - defining Unicode char U+017E (decimal 382) - defining Unicode char U+200C (decimal 8204) - defining Unicode char U+2013 (decimal 8211) - defining Unicode char U+2014 (decimal 8212) - defining Unicode char U+2018 (decimal 8216) - defining Unicode char U+2019 (decimal 8217) - defining Unicode char U+201A (decimal 8218) - defining Unicode char U+201C (decimal 8220) - defining Unicode char U+201D (decimal 8221) - defining Unicode char U+201E (decimal 8222) - defining Unicode char U+2030 (decimal 8240) - defining Unicode char U+2031 (decimal 8241) - defining Unicode char U+2039 (decimal 8249) - defining Unicode char U+203A (decimal 8250) - defining Unicode char U+2423 (decimal 9251) -) -Now handling font encoding OT1 ... -... processing UTF-8 mapping file for font encoding OT1 - -(/usr/share/texlive/texmf-dist/tex/latex/base/ot1enc.dfu -File: ot1enc.dfu 2008/04/05 v1.1m UTF-8 support for inputenc - defining Unicode char U+00A1 (decimal 161) - defining Unicode char U+00A3 (decimal 163) - defining Unicode char U+00B8 (decimal 184) - defining Unicode char U+00BF (decimal 191) - defining Unicode char U+00C5 (decimal 197) - defining Unicode char U+00C6 (decimal 198) - defining Unicode char U+00D8 (decimal 216) - defining Unicode char U+00DF (decimal 223) - defining Unicode char U+00E6 (decimal 230) - defining Unicode char U+00EC (decimal 236) - defining Unicode char U+00ED (decimal 237) - defining Unicode char U+00EE (decimal 238) - defining Unicode char U+00EF (decimal 239) - defining Unicode char U+00F8 (decimal 248) - defining Unicode char U+0131 (decimal 305) - defining Unicode char U+0141 (decimal 321) - defining Unicode char U+0142 (decimal 322) - defining Unicode char U+0152 (decimal 338) - defining Unicode char U+0153 (decimal 339) - defining Unicode char U+2013 (decimal 8211) - defining Unicode char U+2014 (decimal 8212) - defining Unicode char U+2018 (decimal 8216) - defining Unicode char U+2019 (decimal 8217) - defining Unicode char U+201C (decimal 8220) - defining Unicode char U+201D (decimal 8221) -) -Now handling font encoding OMS ... -... processing UTF-8 mapping file for font encoding OMS - -(/usr/share/texlive/texmf-dist/tex/latex/base/omsenc.dfu -File: omsenc.dfu 2008/04/05 v1.1m UTF-8 support for inputenc - defining Unicode char U+00A7 (decimal 167) - defining Unicode char U+00B6 (decimal 182) - defining Unicode char U+00B7 (decimal 183) - defining Unicode char U+2020 (decimal 8224) - defining Unicode char U+2021 (decimal 8225) - defining Unicode char U+2022 (decimal 8226) -) -Now handling font encoding OMX ... -... no UTF-8 mapping file for font encoding OMX -Now handling font encoding U ... -... no UTF-8 mapping file for font encoding U - defining Unicode char U+00A9 (decimal 169) - defining Unicode char U+00AA (decimal 170) - defining Unicode char U+00AE (decimal 174) - defining Unicode char U+00BA (decimal 186) - defining Unicode char U+02C6 (decimal 710) - defining Unicode char U+02DC (decimal 732) - defining Unicode char U+200C (decimal 8204) - defining Unicode char U+2026 (decimal 8230) - defining Unicode char U+2122 (decimal 8482) - defining Unicode char U+2423 (decimal 9251) -)) - defining Unicode char U+00A0 (decimal 160) - -(/usr/share/texlive/texmf-dist/tex/latex/cmap/cmap.sty -Package: cmap 2008/03/06 v1.0h CMap support: searchable PDF -) -(/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty -Package: fontenc 2005/09/27 v1.99g Standard LaTeX package - -(/usr/share/texlive/texmf-dist/tex/latex/base/t1enc.def -File: t1enc.def 2005/09/27 v1.99g Standard LaTeX file -LaTeX Font Info: Redeclaring font encoding T1 on input line 43. -)<>) -(/usr/share/texlive/texmf-dist/tex/generic/babel/babel.sty -Package: babel 2013/12/03 3.9h The Babel package - -(/usr/share/texlive/texmf-dist/tex/generic/babel-english/english.ldf -Language: english 2012/08/20 v3.3p English support from the babel system - -(/usr/share/texlive/texmf-dist/tex/generic/babel/babel.def -File: babel.def 2013/12/03 3.9h Babel common definitions -\babel@savecnt=\count88 -\U@D=\dimen103 -) -\l@canadian = a dialect from \language\l@american -\l@australian = a dialect from \language\l@british -\l@newzealand = a dialect from \language\l@british -)) -(/usr/share/texlive/texmf-dist/tex/latex/psnfss/times.sty -Package: times 2005/04/12 PSNFSS-v9.2a (SPQR) -) (./fncychap.sty -Package: fncychap 2007/07/30 v1.34 LaTeX package (Revised chapters) -\RW=\skip43 -\mylen=\skip44 -\myhi=\skip45 -\px=\skip46 -\py=\skip47 -\pyy=\skip48 -\pxx=\skip49 -\c@AlphaCnt=\count89 -\c@AlphaDecCnt=\count90 -) -(/usr/share/texlive/texmf-dist/tex/latex/tools/longtable.sty -Package: longtable 2004/02/01 v4.11 Multi-page Table package (DPC) -\LTleft=\skip50 -\LTright=\skip51 -\LTpre=\skip52 -\LTpost=\skip53 -\LTchunksize=\count91 -\LTcapwidth=\dimen104 -\LT@head=\box26 -\LT@firsthead=\box27 -\LT@foot=\box28 -\LT@lastfoot=\box29 -\LT@cols=\count92 -\LT@rows=\count93 -\c@LT@tables=\count94 -\c@LT@chunks=\count95 -\LT@p@ftn=\toks16 -) (./sphinx.sty -Package: sphinx 2010/01/15 LaTeX package (Sphinx markup) - -(/usr/share/texlive/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty -\fancy@headwidth=\skip54 -\f@ncyO@elh=\skip55 -\f@ncyO@erh=\skip56 -\f@ncyO@olh=\skip57 -\f@ncyO@orh=\skip58 -\f@ncyO@elf=\skip59 -\f@ncyO@erf=\skip60 -\f@ncyO@olf=\skip61 -\f@ncyO@orf=\skip62 -) -(/usr/share/texlive/texmf-dist/tex/latex/base/textcomp.sty -Package: textcomp 2005/09/27 v1.99g Standard LaTeX package -Package textcomp Info: Sub-encoding information: -(textcomp) 5 = only ISO-Adobe without \textcurrency -(textcomp) 4 = 5 + \texteuro -(textcomp) 3 = 4 + \textohm -(textcomp) 2 = 3 + \textestimated + \textcurrency -(textcomp) 1 = TS1 - \textcircled - \t -(textcomp) 0 = TS1 (full) -(textcomp) Font families with sub-encoding setting implement -(textcomp) only a restricted character set as indicated. -(textcomp) Family '?' is the default used for unknown fonts. -(textcomp) See the documentation for details. -Package textcomp Info: Setting ? sub-encoding to TS1/1 on input line 71. - -(/usr/share/texlive/texmf-dist/tex/latex/base/ts1enc.def -File: ts1enc.def 2001/06/05 v3.0e (jk/car/fm) Standard LaTeX file -Now handling font encoding TS1 ... -... processing UTF-8 mapping file for font encoding TS1 - -(/usr/share/texlive/texmf-dist/tex/latex/base/ts1enc.dfu -File: ts1enc.dfu 2008/04/05 v1.1m UTF-8 support for inputenc - defining Unicode char U+00A2 (decimal 162) - defining Unicode char U+00A3 (decimal 163) - defining Unicode char U+00A4 (decimal 164) - defining Unicode char U+00A5 (decimal 165) - defining Unicode char U+00A6 (decimal 166) - defining Unicode char U+00A7 (decimal 167) - defining Unicode char U+00A8 (decimal 168) - defining Unicode char U+00A9 (decimal 169) - defining Unicode char U+00AA (decimal 170) - defining Unicode char U+00AC (decimal 172) - defining Unicode char U+00AE (decimal 174) - defining Unicode char U+00AF (decimal 175) - defining Unicode char U+00B0 (decimal 176) - defining Unicode char U+00B1 (decimal 177) - defining Unicode char U+00B2 (decimal 178) - defining Unicode char U+00B3 (decimal 179) - defining Unicode char U+00B4 (decimal 180) - defining Unicode char U+00B5 (decimal 181) - defining Unicode char U+00B6 (decimal 182) - defining Unicode char U+00B7 (decimal 183) - defining Unicode char U+00B9 (decimal 185) - defining Unicode char U+00BA (decimal 186) - defining Unicode char U+00BC (decimal 188) - defining Unicode char U+00BD (decimal 189) - defining Unicode char U+00BE (decimal 190) - defining Unicode char U+00D7 (decimal 215) - defining Unicode char U+00F7 (decimal 247) - defining Unicode char U+0192 (decimal 402) - defining Unicode char U+02C7 (decimal 711) - defining Unicode char U+02D8 (decimal 728) - defining Unicode char U+02DD (decimal 733) - defining Unicode char U+0E3F (decimal 3647) - defining Unicode char U+2016 (decimal 8214) - defining Unicode char U+2020 (decimal 8224) - defining Unicode char U+2021 (decimal 8225) - defining Unicode char U+2022 (decimal 8226) - defining Unicode char U+2030 (decimal 8240) - defining Unicode char U+2031 (decimal 8241) - defining Unicode char U+203B (decimal 8251) - defining Unicode char U+203D (decimal 8253) - defining Unicode char U+2044 (decimal 8260) - defining Unicode char U+204E (decimal 8270) - defining Unicode char U+2052 (decimal 8274) - defining Unicode char U+20A1 (decimal 8353) - defining Unicode char U+20A4 (decimal 8356) - defining Unicode char U+20A6 (decimal 8358) - defining Unicode char U+20A9 (decimal 8361) - defining Unicode char U+20AB (decimal 8363) - defining Unicode char U+20AC (decimal 8364) - defining Unicode char U+20B1 (decimal 8369) - defining Unicode char U+2103 (decimal 8451) - defining Unicode char U+2116 (decimal 8470) - defining Unicode char U+2117 (decimal 8471) - defining Unicode char U+211E (decimal 8478) - defining Unicode char U+2120 (decimal 8480) - defining Unicode char U+2122 (decimal 8482) - defining Unicode char U+2126 (decimal 8486) - defining Unicode char U+2127 (decimal 8487) - defining Unicode char U+212E (decimal 8494) - defining Unicode char U+2190 (decimal 8592) - defining Unicode char U+2191 (decimal 8593) - defining Unicode char U+2192 (decimal 8594) - defining Unicode char U+2193 (decimal 8595) - defining Unicode char U+2329 (decimal 9001) - defining Unicode char U+232A (decimal 9002) - defining Unicode char U+2422 (decimal 9250) - defining Unicode char U+25E6 (decimal 9702) - defining Unicode char U+25EF (decimal 9711) - defining Unicode char U+266A (decimal 9834) -)) -LaTeX Info: Redefining \oldstylenums on input line 266. -Package textcomp Info: Setting cmr sub-encoding to TS1/0 on input line 281. -Package textcomp Info: Setting cmss sub-encoding to TS1/0 on input line 282. -Package textcomp Info: Setting cmtt sub-encoding to TS1/0 on input line 283. -Package textcomp Info: Setting cmvtt sub-encoding to TS1/0 on input line 284. -Package textcomp Info: Setting cmbr sub-encoding to TS1/0 on input line 285. -Package textcomp Info: Setting cmtl sub-encoding to TS1/0 on input line 286. -Package textcomp Info: Setting ccr sub-encoding to TS1/0 on input line 287. -Package textcomp Info: Setting ptm sub-encoding to TS1/4 on input line 288. -Package textcomp Info: Setting pcr sub-encoding to TS1/4 on input line 289. -Package textcomp Info: Setting phv sub-encoding to TS1/4 on input line 290. -Package textcomp Info: Setting ppl sub-encoding to TS1/3 on input line 291. -Package textcomp Info: Setting pag sub-encoding to TS1/4 on input line 292. -Package textcomp Info: Setting pbk sub-encoding to TS1/4 on input line 293. -Package textcomp Info: Setting pnc sub-encoding to TS1/4 on input line 294. -Package textcomp Info: Setting pzc sub-encoding to TS1/4 on input line 295. -Package textcomp Info: Setting bch sub-encoding to TS1/4 on input line 296. -Package textcomp Info: Setting put sub-encoding to TS1/5 on input line 297. -Package textcomp Info: Setting uag sub-encoding to TS1/5 on input line 298. -Package textcomp Info: Setting ugq sub-encoding to TS1/5 on input line 299. -Package textcomp Info: Setting ul8 sub-encoding to TS1/4 on input line 300. -Package textcomp Info: Setting ul9 sub-encoding to TS1/4 on input line 301. -Package textcomp Info: Setting augie sub-encoding to TS1/5 on input line 302. -Package textcomp Info: Setting dayrom sub-encoding to TS1/3 on input line 303. -Package textcomp Info: Setting dayroms sub-encoding to TS1/3 on input line 304. - -Package textcomp Info: Setting pxr sub-encoding to TS1/0 on input line 305. -Package textcomp Info: Setting pxss sub-encoding to TS1/0 on input line 306. -Package textcomp Info: Setting pxtt sub-encoding to TS1/0 on input line 307. -Package textcomp Info: Setting txr sub-encoding to TS1/0 on input line 308. -Package textcomp Info: Setting txss sub-encoding to TS1/0 on input line 309. -Package textcomp Info: Setting txtt sub-encoding to TS1/0 on input line 310. -Package textcomp Info: Setting lmr sub-encoding to TS1/0 on input line 311. -Package textcomp Info: Setting lmdh sub-encoding to TS1/0 on input line 312. -Package textcomp Info: Setting lmss sub-encoding to TS1/0 on input line 313. -Package textcomp Info: Setting lmssq sub-encoding to TS1/0 on input line 314. -Package textcomp Info: Setting lmvtt sub-encoding to TS1/0 on input line 315. -Package textcomp Info: Setting qhv sub-encoding to TS1/0 on input line 316. -Package textcomp Info: Setting qag sub-encoding to TS1/0 on input line 317. -Package textcomp Info: Setting qbk sub-encoding to TS1/0 on input line 318. -Package textcomp Info: Setting qcr sub-encoding to TS1/0 on input line 319. -Package textcomp Info: Setting qcs sub-encoding to TS1/0 on input line 320. -Package textcomp Info: Setting qpl sub-encoding to TS1/0 on input line 321. -Package textcomp Info: Setting qtm sub-encoding to TS1/0 on input line 322. -Package textcomp Info: Setting qzc sub-encoding to TS1/0 on input line 323. -Package textcomp Info: Setting qhvc sub-encoding to TS1/0 on input line 324. -Package textcomp Info: Setting futs sub-encoding to TS1/4 on input line 325. -Package textcomp Info: Setting futx sub-encoding to TS1/4 on input line 326. -Package textcomp Info: Setting futj sub-encoding to TS1/4 on input line 327. -Package textcomp Info: Setting hlh sub-encoding to TS1/3 on input line 328. -Package textcomp Info: Setting hls sub-encoding to TS1/3 on input line 329. -Package textcomp Info: Setting hlst sub-encoding to TS1/3 on input line 330. -Package textcomp Info: Setting hlct sub-encoding to TS1/5 on input line 331. -Package textcomp Info: Setting hlx sub-encoding to TS1/5 on input line 332. -Package textcomp Info: Setting hlce sub-encoding to TS1/5 on input line 333. -Package textcomp Info: Setting hlcn sub-encoding to TS1/5 on input line 334. -Package textcomp Info: Setting hlcw sub-encoding to TS1/5 on input line 335. -Package textcomp Info: Setting hlcf sub-encoding to TS1/5 on input line 336. -Package textcomp Info: Setting pplx sub-encoding to TS1/3 on input line 337. -Package textcomp Info: Setting pplj sub-encoding to TS1/3 on input line 338. -Package textcomp Info: Setting ptmx sub-encoding to TS1/4 on input line 339. -Package textcomp Info: Setting ptmj sub-encoding to TS1/4 on input line 340. -) -(/usr/share/texlive/texmf-dist/tex/latex/fancybox/fancybox.sty -Package: fancybox 2010/05/15 1.4 - -Style option: `fancybox' v1.4 <2010/05/15> (tvz) -\@fancybox=\box30 -\shadowsize=\dimen105 -\@Sbox=\box31 -\do@VerbBox=\toks17 -\the@fancyput=\toks18 -\this@fancyput=\toks19 -\EndVerbatimTokens=\toks20 -\Verbatim@Outfile=\write3 -\Verbatim@Infile=\read1 -) (/usr/share/texlive/texmf-dist/tex/latex/titlesec/titlesec.sty -Package: titlesec 2011/12/15 v2.10.0 Sectioning titles -\ttl@box=\box32 -\beforetitleunit=\skip63 -\aftertitleunit=\skip64 -\ttl@plus=\dimen106 -\ttl@minus=\dimen107 -\ttl@toksa=\toks21 -\titlewidth=\dimen108 -\titlewidthlast=\dimen109 -\titlewidthfirst=\dimen110 -) -(./tabulary.sty -Package: tabulary 2008/12/01 v0.9 tabulary package (DPC) - (/usr/share/texlive/texmf-dist/tex/latex/tools/array.sty -Package: array 2008/09/09 v2.4c Tabular extension package (FMi) -\col@sep=\dimen111 -\extrarowheight=\dimen112 -\NC@list=\toks22 -\extratabsurround=\skip65 -\backup@length=\skip66 -) -\TY@count=\count96 -\TY@linewidth=\dimen113 -\tymin=\dimen114 -\tymax=\dimen115 -\TY@tablewidth=\dimen116 -) -(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty -Package: amsmath 2013/01/14 v2.14 AMS math features -\@mathmargin=\skip67 - -For additional information on amsmath, use the `?' option. -(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty -Package: amstext 2000/06/29 v2.01 - -(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty -File: amsgen.sty 1999/11/30 v2.0 -\@emptytoks=\toks23 -\ex@=\dimen117 -)) -(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty -Package: amsbsy 1999/11/29 v1.2d -\pmbraise@=\dimen118 -) -(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty -Package: amsopn 1999/12/14 v2.01 operator names -) -\inf@bad=\count97 -LaTeX Info: Redefining \frac on input line 210. -\uproot@=\count98 -\leftroot@=\count99 -LaTeX Info: Redefining \overline on input line 306. -\classnum@=\count100 -\DOTSCASE@=\count101 -LaTeX Info: Redefining \ldots on input line 378. -LaTeX Info: Redefining \dots on input line 381. -LaTeX Info: Redefining \cdots on input line 466. -\Mathstrutbox@=\box33 -\strutbox@=\box34 -\big@size=\dimen119 -LaTeX Font Info: Redeclaring font encoding OML on input line 566. -LaTeX Font Info: Redeclaring font encoding OMS on input line 567. -\macc@depth=\count102 -\c@MaxMatrixCols=\count103 -\dotsspace@=\muskip10 -\c@parentequation=\count104 -\dspbrk@lvl=\count105 -\tag@help=\toks24 -\row@=\count106 -\column@=\count107 -\maxfields@=\count108 -\andhelp@=\toks25 -\eqnshift@=\dimen120 -\alignsep@=\dimen121 -\tagshift@=\dimen122 -\tagwidth@=\dimen123 -\totwidth@=\dimen124 -\lineht@=\dimen125 -\@envbody=\toks26 -\multlinegap=\skip68 -\multlinetaggap=\skip69 -\mathdisplay@stack=\toks27 -LaTeX Info: Redefining \[ on input line 2665. -LaTeX Info: Redefining \] on input line 2666. -) -(/usr/share/texlive/texmf-dist/tex/latex/base/makeidx.sty -Package: makeidx 2000/03/29 v1.0m Standard LaTeX package -) -(/usr/share/texlive/texmf-dist/tex/latex/framed/framed.sty -Package: framed 2011/10/22 v 0.96: framed or shaded text with page breaks -\OuterFrameSep=\skip70 -\fb@frw=\dimen126 -\fb@frh=\dimen127 -\FrameRule=\dimen128 -\FrameSep=\dimen129 -) -(/usr/share/texlive/texmf-dist/tex/latex/base/ifthen.sty -Package: ifthen 2001/05/26 v1.1c Standard LaTeX ifthen package (DPC) -) -(/usr/share/texlive/texmf-dist/tex/latex/graphics/color.sty -Package: color 2005/11/14 v1.0j Standard LaTeX Color (DPC) - -(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/color.cfg -File: color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive -) -Package color Info: Driver file: pdftex.def on input line 130. - -(/usr/share/texlive/texmf-dist/tex/latex/pdftex-def/pdftex.def -File: pdftex.def 2011/05/27 v0.06d Graphics/color for pdfTeX - -(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty -Package: infwarerr 2010/04/08 v1.3 Providing info/warning/error messages (HO) -) -(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty -Package: ltxcmds 2011/11/09 v1.22 LaTeX kernel commands for general use (HO) -) -\Gread@gobject=\count109 -)) -(/usr/share/texlive/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty -Package: fancyvrb 2008/02/07 - -Style option: `fancyvrb' v2.7a, with DG/SPQR fixes, and firstline=lastline fix -<2008/02/07> (tvz) (/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty -Package: keyval 1999/03/16 v1.13 key=value parser (DPC) -\KV@toks@=\toks28 -) -\FV@CodeLineNo=\count110 -\FV@InFile=\read2 -\FV@TabBox=\box35 -\c@FancyVerbLine=\count111 -\FV@StepNumber=\count112 -\FV@OutFile=\write4 -) (/usr/share/texlive/texmf-dist/tex/latex/threeparttable/threeparttable.sty -Package: threeparttable 2003/06/13 v 3.0 -\@tempboxb=\box36 -) -(/usr/share/texlive/texmf-dist/tex/latex/mdwtools/footnote.sty -Package: footnote 1997/01/28 1.13 Save footnotes around boxes -\fn@notes=\box37 -\fn@width=\dimen130 -) -(/usr/share/texlive/texmf-dist/tex/latex/wrapfig/wrapfig.sty -\wrapoverhang=\dimen131 -\WF@size=\dimen132 -\c@WF@wrappedlines=\count113 -\WF@box=\box38 -\WF@everypar=\toks29 -Package: wrapfig 2003/01/31 v 3.6 -) -(/usr/share/texlive/texmf-dist/tex/latex/parskip/parskip.sty -Package: parskip 2001/04/09 non-zero parskip adjustments -) -(/usr/share/texlive/texmf-dist/tex/latex/base/alltt.sty -Package: alltt 1997/06/16 v2.0g defines alltt environment -) -(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty -Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR) - -(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty -Package: graphics 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR) - -(/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty -Package: trig 1999/03/16 v1.09 sin cos tan (DPC) -) -(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/graphics.cfg -File: graphics.cfg 2010/04/23 v1.9 graphics configuration of TeX Live -) -Package graphics Info: Driver file: pdftex.def on input line 91. -) -\Gin@req@height=\dimen133 -\Gin@req@width=\dimen134 -) -(/usr/share/texlive/texmf-dist/tex/plain/misc/pdfcolor.tex) -\distancetoright=\skip71 -\py@argswidth=\skip72 -\py@noticelength=\skip73 -\lineblockindentation=\skip74 -\image@box=\box39 -\image@width=\dimen135 - -(/usr/share/texlive/texmf-dist/tex/latex/hyperref/hyperref.sty -Package: hyperref 2012/11/06 v6.83m Hypertext links for LaTeX - -(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty -Package: hobsub-hyperref 2012/05/28 v1.13 Bundle oberdiek, subset hyperref (HO) - - -(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty -Package: hobsub-generic 2012/05/28 v1.13 Bundle oberdiek, subset generic (HO) -Package: hobsub 2012/05/28 v1.13 Construct package bundles (HO) -Package hobsub Info: Skipping package `infwarerr' (already loaded). -Package hobsub Info: Skipping package `ltxcmds' (already loaded). -Package: ifluatex 2010/03/01 v1.3 Provides the ifluatex switch (HO) -Package ifluatex Info: LuaTeX not detected. -Package: ifvtex 2010/03/01 v1.5 Detect VTeX and its facilities (HO) -Package ifvtex Info: VTeX not detected. -Package: intcalc 2007/09/27 v1.1 Expandable calculations with integers (HO) -Package: ifpdf 2011/01/30 v2.3 Provides the ifpdf switch (HO) -Package ifpdf Info: pdfTeX in PDF mode is detected. -Package: etexcmds 2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO) -Package etexcmds Info: Could not find \expanded. -(etexcmds) That can mean that you are not using pdfTeX 1.50 or -(etexcmds) that some package has redefined \expanded. -(etexcmds) In the latter case, load this package earlier. -Package: kvsetkeys 2012/04/25 v1.16 Key value parser (HO) -Package: kvdefinekeys 2011/04/07 v1.3 Define keys (HO) -Package: pdftexcmds 2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO -) -Package pdftexcmds Info: LuaTeX not detected. -Package pdftexcmds Info: \pdf@primitive is available. -Package pdftexcmds Info: \pdf@ifprimitive is available. -Package pdftexcmds Info: \pdfdraftmode found. -Package: pdfescape 2011/11/25 v1.13 Implements pdfTeX's escape features (HO) -Package: bigintcalc 2012/04/08 v1.3 Expandable calculations on big integers (HO -) -Package: bitset 2011/01/30 v1.1 Handle bit-vector datatype (HO) -Package: uniquecounter 2011/01/30 v1.2 Provide unlimited unique counter (HO) -) -Package hobsub Info: Skipping package `hobsub' (already loaded). -Package: letltxmacro 2010/09/02 v1.4 Let assignment for LaTeX macros (HO) -Package: hopatch 2012/05/28 v1.2 Wrapper for package hooks (HO) -Package: xcolor-patch 2011/01/30 xcolor patch -Package: atveryend 2011/06/30 v1.8 Hooks at the very end of document (HO) -Package atveryend Info: \enddocument detected (standard20110627). -Package: atbegshi 2011/10/05 v1.16 At begin shipout hook (HO) -Package: refcount 2011/10/16 v3.4 Data extraction from label references (HO) -Package: hycolor 2011/01/30 v1.7 Color options for hyperref/bookmark (HO) -) -(/usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty -Package: ifxetex 2010/09/12 v0.6 Provides ifxetex conditional -) -(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/auxhook.sty -Package: auxhook 2011/03/04 v1.3 Hooks for auxiliary files (HO) -) -(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty -Package: kvoptions 2011/06/30 v3.11 Key value format for package options (HO) -) -\@linkdim=\dimen136 -\Hy@linkcounter=\count114 -\Hy@pagecounter=\count115 - -(/usr/share/texlive/texmf-dist/tex/latex/hyperref/pd1enc.def -File: pd1enc.def 2012/11/06 v6.83m Hyperref: PDFDocEncoding definition (HO) -Now handling font encoding PD1 ... -... no UTF-8 mapping file for font encoding PD1 -) -\Hy@SavedSpaceFactor=\count116 - -(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/hyperref.cfg -File: hyperref.cfg 2002/06/06 v1.2 hyperref configuration of TeXLive -) -Package hyperref Info: Option `colorlinks' set `true' on input line 4319. -Package hyperref Info: Option `breaklinks' set `true' on input line 4319. -Package hyperref Info: Hyper figures OFF on input line 4443. -Package hyperref Info: Link nesting OFF on input line 4448. -Package hyperref Info: Hyper index ON on input line 4451. -Package hyperref Info: Plain pages OFF on input line 4458. -Package hyperref Info: Backreferencing OFF on input line 4463. -Package hyperref Info: Implicit mode ON; LaTeX internals redefined. -Package hyperref Info: Bookmarks ON on input line 4688. -\c@Hy@tempcnt=\count117 - -(/usr/share/texlive/texmf-dist/tex/latex/url/url.sty -\Urlmuskip=\muskip11 -Package: url 2013/09/16 ver 3.4 Verb mode for urls, etc. -) -LaTeX Info: Redefining \url on input line 5041. -\XeTeXLinkMargin=\dimen137 -\Fld@menulength=\count118 -\Field@Width=\dimen138 -\Fld@charsize=\dimen139 -Package hyperref Info: Hyper figures OFF on input line 6295. -Package hyperref Info: Link nesting OFF on input line 6300. -Package hyperref Info: Hyper index ON on input line 6303. -Package hyperref Info: backreferencing OFF on input line 6310. -Package hyperref Info: Link coloring ON on input line 6313. -Package hyperref Info: Link coloring with OCG OFF on input line 6320. -Package hyperref Info: PDF/A mode OFF on input line 6325. -LaTeX Info: Redefining \ref on input line 6365. -LaTeX Info: Redefining \pageref on input line 6369. -\Hy@abspage=\count119 -\c@Item=\count120 -\c@Hfootnote=\count121 -) - -Package hyperref Message: Driver (autodetected): hpdftex. - -(/usr/share/texlive/texmf-dist/tex/latex/hyperref/hpdftex.def -File: hpdftex.def 2012/11/06 v6.83m Hyperref driver for pdfTeX -\Fld@listcount=\count122 -\c@bookmark@seq@number=\count123 - -(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty -Package: rerunfilecheck 2011/04/15 v1.7 Rerun checks for auxiliary files (HO) -Package uniquecounter Info: New unique counter `rerunfilecheck' on input line 2 -82. -) -\Hy@SectionHShift=\skip75 -) -(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/hypcap.sty -Package: hypcap 2011/02/16 v1.11 Adjusting the anchors of captions (HO) -) -\DUlineblockindent=\skip76 -) -(/usr/share/texlive/texmf-dist/tex/latex/multirow/multirow.sty -\bigstrutjot=\dimen140 -) -\@indexfile=\write5 -\openout5 = `ELMtoolbox.idx'. - - -Writing index file ELMtoolbox.idx -(./ELMtoolbox.aux) -\openout1 = `ELMtoolbox.aux'. - -LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 117. -LaTeX Font Info: ... okay on input line 117. -LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 117. -LaTeX Font Info: ... okay on input line 117. -LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 117. -LaTeX Font Info: ... okay on input line 117. -LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 117. -LaTeX Font Info: ... okay on input line 117. -LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 117. -LaTeX Font Info: ... okay on input line 117. -LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 117. -LaTeX Font Info: ... okay on input line 117. -LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 117. -LaTeX Font Info: Try loading font information for TS1+cmr on input line 117. - - (/usr/share/texlive/texmf-dist/tex/latex/base/ts1cmr.fd -File: ts1cmr.fd 1999/05/25 v2.5h Standard LaTeX font definitions -) -LaTeX Font Info: ... okay on input line 117. -LaTeX Font Info: Checking defaults for PD1/pdf/m/n on input line 117. -LaTeX Font Info: ... okay on input line 117. -LaTeX Font Info: Try loading font information for T1+ptm on input line 117. - -(/usr/share/texlive/texmf-dist/tex/latex/psnfss/t1ptm.fd -File: t1ptm.fd 2001/06/04 font definitions for T1/ptm. -) -(/usr/share/texlive/texmf-dist/tex/context/base/supp-pdf.mkii -[Loading MPS to PDF converter (version 2006.09.02).] -\scratchcounter=\count124 -\scratchdimen=\dimen141 -\scratchbox=\box40 -\nofMPsegments=\count125 -\nofMParguments=\count126 -\everyMPshowfont=\toks30 -\MPscratchCnt=\count127 -\MPscratchDim=\dimen142 -\MPnumerator=\count128 -\makeMPintoPDFobject=\count129 -\everyMPtoPDFconversion=\toks31 -) (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty -Package: epstopdf-base 2010/02/09 v2.5 Base part for package epstopdf - -(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/grfext.sty -Package: grfext 2010/08/19 v1.1 Manage graphics extensions (HO) -) -Package grfext Info: Graphics extension search list: -(grfext) [.png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,.PNG,.PDF,.JPG,.JPE -G,.JBIG2,.JB2,.eps] -(grfext) \AppendGraphicsExtensions on input line 452. - -(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg -File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Liv -e -)) -\AtBeginShipoutBox=\box41 -Package hyperref Info: Link coloring ON on input line 117. - -(/usr/share/texlive/texmf-dist/tex/latex/hyperref/nameref.sty -Package: nameref 2012/10/27 v2.43 Cross-referencing by name of section - -(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/gettitlestring.sty -Package: gettitlestring 2010/12/03 v1.4 Cleanup title references (HO) -) -\c@section@level=\count130 -) -LaTeX Info: Redefining \ref on input line 117. -LaTeX Info: Redefining \pageref on input line 117. -LaTeX Info: Redefining \nameref on input line 117. - -(./ELMtoolbox.out) (./ELMtoolbox.out) -\@outlinefile=\write6 -\openout6 = `ELMtoolbox.out'. - - -Underfull \hbox (badness 10000) in paragraph at lines 120--120 - - [] - -LaTeX Font Info: Try loading font information for T1+phv on input line 120. -(/usr/share/texlive/texmf-dist/tex/latex/psnfss/t1phv.fd -File: t1phv.fd 2001/06/04 scalable font definitions for T1/phv. -) -LaTeX Font Info: Font shape `T1/phv/bx/n' in size <24.88> not available -(Font) Font shape `T1/phv/b/n' tried instead on input line 120. -LaTeX Font Info: Font shape `T1/phv/m/it' in size <17.28> not available -(Font) Font shape `T1/phv/m/sl' tried instead on input line 120. -LaTeX Font Info: Font shape `T1/phv/bx/it' in size <17.28> not available -(Font) Font shape `T1/phv/b/it' tried instead on input line 120. -LaTeX Font Info: Font shape `T1/phv/b/it' in size <17.28> not available -(Font) Font shape `T1/phv/b/sl' tried instead on input line 120. -LaTeX Font Info: Font shape `T1/phv/bx/n' in size <17.28> not available -(Font) Font shape `T1/phv/b/n' tried instead on input line 120. -<><><><> [1 - -{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] [2 - -] (./ELMtoolbox.toc -LaTeX Font Info: Font shape `T1/ptm/bx/n' in size <10> not available -(Font) Font shape `T1/ptm/b/n' tried instead on input line 2. -) -\tf@toc=\write7 -\openout7 = `ELMtoolbox.toc'. - - -Adding blank page after the table of contents. -LaTeX Font Info: Font shape `T1/phv/bx/n' in size <10> not available -(Font) Font shape `T1/phv/b/n' tried instead on input line 120. -[1 - -] [2] -LaTeX Font Info: Try loading font information for T1+pcr on input line 132. - (/usr/share/texlive/texmf-dist/tex/latex/psnfss/t1pcr.fd -File: t1pcr.fd 2001/06/04 font definitions for T1/pcr. -) -LaTeX Font Info: Font shape `T1/pcr/bx/n' in size <10> not available -(Font) Font shape `T1/pcr/b/n' tried instead on input line 132. -LaTeX Font Info: Try loading font information for TS1+ptm on input line 181. - - -(/usr/share/texlive/texmf-dist/tex/latex/psnfss/ts1ptm.fd -File: ts1ptm.fd 2001/06/04 font definitions for TS1/ptm. -) [1 - -] [2 - -] -Chapter 1. -LaTeX Font Info: Font shape `T1/phv/bx/n' in size <14.4> not available -(Font) Font shape `T1/phv/b/n' tried instead on input line 198. -LaTeX Font Info: Font shape `T1/ptm/bx/n' in size <14.4> not available -(Font) Font shape `T1/ptm/b/n' tried instead on input line 198. -LaTeX Font Info: Font shape `T1/ptm/bx/n' in size <24.88> not available -(Font) Font shape `T1/ptm/b/n' tried instead on input line 198. -[3] [4 - -] [5 - - -] (./ELMtoolbox.ind [6 - - -] [7 - - -]) -Package atveryend Info: Empty hook `BeforeClearDocument' on input line 221. -Package atveryend Info: Empty hook `AfterLastShipout' on input line 221. - (./ELMtoolbox.aux) -Package atveryend Info: Executing hook `AtVeryEndDocument' on input line 221. -Package atveryend Info: Executing hook `AtEndAfterFileList' on input line 221. -Package rerunfilecheck Info: File `ELMtoolbox.out' has not changed. -(rerunfilecheck) Checksum: 58A24DBAC241BD48B02EC38B19AFF600;150. -Package atveryend Info: Empty hook `AtVeryVeryEnd' on input line 221. - ) -Here is how much of TeX's memory you used: - 9046 strings out of 494252 - 125401 string characters out of 6159911 - 220464 words of memory out of 5000000 - 12068 multiletter control sequences out of 15000+600000 - 53038 words of font info for 58 fonts, out of 8000000 for 9000 - 438 hyphenation exceptions out of 8191 - 36i,11n,45p,252b,397s stack positions out of 5000i,500n,10000p,200000b,80000s -{/usr/share/texlive/texmf-dist/fonts/enc/dvips/base/8r.enc} - -Output written on ELMtoolbox.pdf (11 pages, 83944 bytes). -PDF statistics: - 129 PDF objects out of 1000 (max. 8388607) - 101 compressed objects within 2 object streams - 23 named destinations out of 1000 (max. 500000) - 45 words of extra memory for PDF output out of 10000 (max. 10000000) - diff --git a/develop/_Sphinx/doc/_build/latex/ELMtoolbox.out b/develop/_Sphinx/doc/_build/latex/ELMtoolbox.out deleted file mode 100755 index 273197c..0000000 --- a/develop/_Sphinx/doc/_build/latex/ELMtoolbox.out +++ /dev/null @@ -1,3 +0,0 @@ -\BOOKMARK [0][-]{chapter.1}{Indices and tables}{}% 1 -\BOOKMARK [0][-]{section*.9}{Python Module Index}{}% 2 -\BOOKMARK [0][-]{section*.10}{Index}{}% 3 diff --git a/develop/_Sphinx/doc/_build/latex/ELMtoolbox.pdf b/develop/_Sphinx/doc/_build/latex/ELMtoolbox.pdf deleted file mode 100755 index cf8d37c..0000000 Binary files a/develop/_Sphinx/doc/_build/latex/ELMtoolbox.pdf and /dev/null differ diff --git a/develop/_Sphinx/doc/_build/latex/ELMtoolbox.tex b/develop/_Sphinx/doc/_build/latex/ELMtoolbox.tex deleted file mode 100755 index 6e13248..0000000 --- a/develop/_Sphinx/doc/_build/latex/ELMtoolbox.tex +++ /dev/null @@ -1,221 +0,0 @@ -% Generated by Sphinx. -\def\sphinxdocclass{report} -\documentclass[letterpaper,10pt,english]{sphinxmanual} -\usepackage[utf8]{inputenc} -\DeclareUnicodeCharacter{00A0}{\nobreakspace} -\usepackage{cmap} -\usepackage[T1]{fontenc} -\usepackage{babel} -\usepackage{times} -\usepackage[Bjarne]{fncychap} -\usepackage{longtable} -\usepackage{sphinx} -\usepackage{multirow} - - -\title{ELM toolbox Documentation} -\date{August 20, 2014} -\release{0.1a1} -\author{Anton Akusok} -\newcommand{\sphinxlogo}{} -\renewcommand{\releasename}{Release} -\makeindex - -\makeatletter -\def\PYG@reset{\let\PYG@it=\relax \let\PYG@bf=\relax% - \let\PYG@ul=\relax \let\PYG@tc=\relax% - \let\PYG@bc=\relax \let\PYG@ff=\relax} -\def\PYG@tok#1{\csname PYG@tok@#1\endcsname} -\def\PYG@toks#1+{\ifx\relax#1\empty\else% - \PYG@tok{#1}\expandafter\PYG@toks\fi} -\def\PYG@do#1{\PYG@bc{\PYG@tc{\PYG@ul{% - \PYG@it{\PYG@bf{\PYG@ff{#1}}}}}}} -\def\PYG#1#2{\PYG@reset\PYG@toks#1+\relax+\PYG@do{#2}} - -\expandafter\def\csname PYG@tok@gd\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.63,0.00,0.00}{##1}}} -\expandafter\def\csname PYG@tok@gu\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.50,0.00,0.50}{##1}}} -\expandafter\def\csname PYG@tok@gt\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.27,0.87}{##1}}} -\expandafter\def\csname PYG@tok@gs\endcsname{\let\PYG@bf=\textbf} -\expandafter\def\csname PYG@tok@gr\endcsname{\def\PYG@tc##1{\textcolor[rgb]{1.00,0.00,0.00}{##1}}} -\expandafter\def\csname PYG@tok@cm\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.56}{##1}}} -\expandafter\def\csname PYG@tok@vg\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.38,0.84}{##1}}} -\expandafter\def\csname PYG@tok@m\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}} -\expandafter\def\csname PYG@tok@mh\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}} -\expandafter\def\csname PYG@tok@cs\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.56}{##1}}\def\PYG@bc##1{\setlength{\fboxsep}{0pt}\colorbox[rgb]{1.00,0.94,0.94}{\strut ##1}}} -\expandafter\def\csname PYG@tok@ge\endcsname{\let\PYG@it=\textit} -\expandafter\def\csname PYG@tok@vc\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.38,0.84}{##1}}} -\expandafter\def\csname PYG@tok@il\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}} -\expandafter\def\csname PYG@tok@go\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.20,0.20,0.20}{##1}}} -\expandafter\def\csname PYG@tok@cp\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} -\expandafter\def\csname PYG@tok@gi\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.63,0.00}{##1}}} -\expandafter\def\csname PYG@tok@gh\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,0.50}{##1}}} -\expandafter\def\csname PYG@tok@ni\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.84,0.33,0.22}{##1}}} -\expandafter\def\csname PYG@tok@nl\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.13,0.44}{##1}}} -\expandafter\def\csname PYG@tok@nn\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.05,0.52,0.71}{##1}}} -\expandafter\def\csname PYG@tok@no\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.38,0.68,0.84}{##1}}} -\expandafter\def\csname PYG@tok@na\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} -\expandafter\def\csname PYG@tok@nb\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} -\expandafter\def\csname PYG@tok@nc\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.05,0.52,0.71}{##1}}} -\expandafter\def\csname PYG@tok@nd\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.33,0.33,0.33}{##1}}} -\expandafter\def\csname PYG@tok@ne\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} -\expandafter\def\csname PYG@tok@nf\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.02,0.16,0.49}{##1}}} -\expandafter\def\csname PYG@tok@si\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.44,0.63,0.82}{##1}}} -\expandafter\def\csname PYG@tok@s2\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} -\expandafter\def\csname PYG@tok@vi\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.38,0.84}{##1}}} -\expandafter\def\csname PYG@tok@nt\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.02,0.16,0.45}{##1}}} -\expandafter\def\csname PYG@tok@nv\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.38,0.84}{##1}}} -\expandafter\def\csname PYG@tok@s1\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} -\expandafter\def\csname PYG@tok@gp\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.78,0.36,0.04}{##1}}} -\expandafter\def\csname PYG@tok@sh\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} -\expandafter\def\csname PYG@tok@ow\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} -\expandafter\def\csname PYG@tok@sx\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.78,0.36,0.04}{##1}}} -\expandafter\def\csname PYG@tok@bp\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} -\expandafter\def\csname PYG@tok@c1\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.56}{##1}}} -\expandafter\def\csname PYG@tok@kc\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} -\expandafter\def\csname PYG@tok@c\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.56}{##1}}} -\expandafter\def\csname PYG@tok@mf\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}} -\expandafter\def\csname PYG@tok@err\endcsname{\def\PYG@bc##1{\setlength{\fboxsep}{0pt}\fcolorbox[rgb]{1.00,0.00,0.00}{1,1,1}{\strut ##1}}} -\expandafter\def\csname PYG@tok@kd\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} -\expandafter\def\csname PYG@tok@ss\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.32,0.47,0.09}{##1}}} -\expandafter\def\csname PYG@tok@sr\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.14,0.33,0.53}{##1}}} -\expandafter\def\csname PYG@tok@mo\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}} -\expandafter\def\csname PYG@tok@mi\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}} -\expandafter\def\csname PYG@tok@kn\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} -\expandafter\def\csname PYG@tok@o\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}} -\expandafter\def\csname PYG@tok@kr\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} -\expandafter\def\csname PYG@tok@s\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} -\expandafter\def\csname PYG@tok@kp\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} -\expandafter\def\csname PYG@tok@w\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.73,0.73}{##1}}} -\expandafter\def\csname PYG@tok@kt\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.56,0.13,0.00}{##1}}} -\expandafter\def\csname PYG@tok@sc\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} -\expandafter\def\csname PYG@tok@sb\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} -\expandafter\def\csname PYG@tok@k\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} -\expandafter\def\csname PYG@tok@se\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} -\expandafter\def\csname PYG@tok@sd\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} - -\def\PYGZbs{\char`\\} -\def\PYGZus{\char`\_} -\def\PYGZob{\char`\{} -\def\PYGZcb{\char`\}} -\def\PYGZca{\char`\^} -\def\PYGZam{\char`\&} -\def\PYGZlt{\char`\<} -\def\PYGZgt{\char`\>} -\def\PYGZsh{\char`\#} -\def\PYGZpc{\char`\%} -\def\PYGZdl{\char`\$} -\def\PYGZhy{\char`\-} -\def\PYGZsq{\char`\'} -\def\PYGZdq{\char`\"} -\def\PYGZti{\char`\~} -% for compatibility with earlier versions -\def\PYGZat{@} -\def\PYGZlb{[} -\def\PYGZrb{]} -\makeatother - -\begin{document} - -\maketitle -\tableofcontents -\phantomsection\label{index::doc} - - -Contents: -\phantomsection\label{index:module-elm}\index{elm (module)} -Created on Aug 18, 2014 - -@author: akusoka1 -\index{ELM (class in elm)} - -\begin{fulllineitems} -\phantomsection\label{index:elm.ELM}\pysiglinewithargsret{\strong{class }\code{elm.}\bfcode{ELM}}{\emph{inputs}, \emph{targets}}{} -Extreme Learning Machine, high-level wrapper. -\index{add\_neurons() (elm.ELM method)} - -\begin{fulllineitems} -\phantomsection\label{index:elm.ELM.add_neurons}\pysiglinewithargsret{\bfcode{add\_neurons}}{\emph{count}, \emph{ufunc}, \emph{W=None}, \emph{B=None}}{} -Add neurons of a given type to the model. - -Can specify W input weight vector and B scalar bias. -:param count: number of neurons to add -:param ufunc: transformation function of those neurons, can use ``None'' for identity function -:param W: weight matrix for input-to-hidden layer -:param B: biases for hidden layer - -\end{fulllineitems} - -\index{get\_model() (elm.ELM method)} - -\begin{fulllineitems} -\phantomsection\label{index:elm.ELM.get_model}\pysiglinewithargsret{\bfcode{get\_model}}{}{} -Returns all parameters of the ELM model in python dictionary. - -Model does not require specific classes to load and edit, unlike pickled class instances. - -\end{fulllineitems} - -\index{run() (elm.ELM method)} - -\begin{fulllineitems} -\phantomsection\label{index:elm.ELM.run}\pysiglinewithargsret{\bfcode{run}}{\emph{X}}{} -Get predictions using a trained or loaded ELM model. -\begin{quote}\begin{description} -\item[{Parameters}] \leavevmode -\textbf{X} -- input data - -\item[{Return type}] \leavevmode -predictions Th - -\end{description}\end{quote} - -\end{fulllineitems} - -\index{train() (elm.ELM method)} - -\begin{fulllineitems} -\phantomsection\label{index:elm.ELM.train}\pysiglinewithargsret{\bfcode{train}}{\emph{X}, \emph{T}}{} -Wrapper for training ELM. -\begin{quote}\begin{description} -\item[{Parameters}] \leavevmode\begin{itemize} -\item {} -\textbf{X} -- input training dataset as 2-dim matrix - -\item {} -\textbf{T} -- output training targets as 1- or 2-dim matrix - -\end{itemize} - -\end{description}\end{quote} - -\end{fulllineitems} - - -\end{fulllineitems} - - - -\chapter{Indices and tables} -\label{index:welcome-to-elm-toolbox-s-documentation}\label{index:indices-and-tables}\begin{itemize} -\item {} -\emph{genindex} - -\item {} -\emph{modindex} - -\item {} -\emph{search} - -\end{itemize} - - -\renewcommand{\indexname}{Python Module Index} -\begin{theindex} -\def\bigletter#1{{\Large\sffamily#1}\nopagebreak\vspace{1mm}} -\bigletter{e} -\item {\texttt{elm}}, \pageref{index:module-elm} -\end{theindex} - -\renewcommand{\indexname}{Index} -\printindex -\end{document} diff --git a/develop/_Sphinx/doc/_build/latex/ELMtoolbox.toc b/develop/_Sphinx/doc/_build/latex/ELMtoolbox.toc deleted file mode 100755 index 4e8038a..0000000 --- a/develop/_Sphinx/doc/_build/latex/ELMtoolbox.toc +++ /dev/null @@ -1,4 +0,0 @@ -\select@language {english} -\contentsline {chapter}{\numberline {1}Indices and tables}{3}{chapter.1} -\contentsline {chapter}{Python Module Index}{5}{section*.9} -\contentsline {chapter}{Index}{7}{section*.10} diff --git a/develop/_Sphinx/doc/_build/latex/Makefile b/develop/_Sphinx/doc/_build/latex/Makefile deleted file mode 100755 index 6b87ad8..0000000 --- a/develop/_Sphinx/doc/_build/latex/Makefile +++ /dev/null @@ -1,66 +0,0 @@ -# Makefile for Sphinx LaTeX output - -ALLDOCS = $(basename $(wildcard *.tex)) -ALLPDF = $(addsuffix .pdf,$(ALLDOCS)) -ALLDVI = $(addsuffix .dvi,$(ALLDOCS)) - -# Prefix for archive names -ARCHIVEPRREFIX = -# Additional LaTeX options -LATEXOPTS = - -all: $(ALLPDF) -all-pdf: $(ALLPDF) -all-dvi: $(ALLDVI) -all-ps: all-dvi - for f in *.dvi; do dvips $$f; done - -all-pdf-ja: - for f in *.pdf *.png *.gif *.jpg *.jpeg; do extractbb $$f; done - for f in *.tex; do platex -kanji=utf8 $(LATEXOPTS) $$f; done - for f in *.tex; do platex -kanji=utf8 $(LATEXOPTS) $$f; done - for f in *.tex; do platex -kanji=utf8 $(LATEXOPTS) $$f; done - -for f in *.idx; do mendex -U -f -d "`basename $$f .idx`.dic" -s python.ist $$f; done - for f in *.tex; do platex -kanji=utf8 $(LATEXOPTS) $$f; done - for f in *.tex; do platex -kanji=utf8 $(LATEXOPTS) $$f; done - for f in *.dvi; do dvipdfmx $$f; done - -zip: all-$(FMT) - mkdir $(ARCHIVEPREFIX)docs-$(FMT) - cp $(ALLPDF) $(ARCHIVEPREFIX)docs-$(FMT) - zip -q -r -9 $(ARCHIVEPREFIX)docs-$(FMT).zip $(ARCHIVEPREFIX)docs-$(FMT) - rm -r $(ARCHIVEPREFIX)docs-$(FMT) - -tar: all-$(FMT) - mkdir $(ARCHIVEPREFIX)docs-$(FMT) - cp $(ALLPDF) $(ARCHIVEPREFIX)docs-$(FMT) - tar cf $(ARCHIVEPREFIX)docs-$(FMT).tar $(ARCHIVEPREFIX)docs-$(FMT) - rm -r $(ARCHIVEPREFIX)docs-$(FMT) - -bz2: tar - bzip2 -9 -k $(ARCHIVEPREFIX)docs-$(FMT).tar - -# The number of LaTeX runs is quite conservative, but I don't expect it -# to get run often, so the little extra time won't hurt. -%.dvi: %.tex - latex $(LATEXOPTS) '$<' - latex $(LATEXOPTS) '$<' - latex $(LATEXOPTS) '$<' - -makeindex -s python.ist '$(basename $<).idx' - latex $(LATEXOPTS) '$<' - latex $(LATEXOPTS) '$<' - -%.pdf: %.tex - pdflatex $(LATEXOPTS) '$<' - pdflatex $(LATEXOPTS) '$<' - pdflatex $(LATEXOPTS) '$<' - -makeindex -s python.ist '$(basename $<).idx' - pdflatex $(LATEXOPTS) '$<' - pdflatex $(LATEXOPTS) '$<' - -clean: - rm -f *.dvi *.log *.ind *.aux *.toc *.syn *.idx *.out *.ilg *.pla - -.PHONY: all all-pdf all-dvi all-ps clean -.PHONY: all-pdf-ja - diff --git a/develop/_Sphinx/doc/_build/latex/fncychap.sty b/develop/_Sphinx/doc/_build/latex/fncychap.sty deleted file mode 100755 index 9a56c04..0000000 --- a/develop/_Sphinx/doc/_build/latex/fncychap.sty +++ /dev/null @@ -1,683 +0,0 @@ -%%% Copyright Ulf A. Lindgren -%%% -%%% Note Premission is granted to modify this file under -%%% the condition that it is saved using another -%%% file and package name. -%%% -%%% Revision 1.1 (1997) -%%% -%%% Jan. 8th Modified package name base date option -%%% Jan. 22th Modified FmN and FmTi for error in book.cls -%%% \MakeUppercase{#}->{\MakeUppercase#} -%%% Apr. 6th Modified Lenny option to prevent undesired -%%% skip of line. -%%% Nov. 8th Fixed \@chapapp for AMS -%%% -%%% Revision 1.2 (1998) -%%% -%%% Feb. 11th Fixed appendix problem related to Bjarne -%%% Aug. 11th Fixed problem related to 11pt and 12pt -%%% suggested by Tomas Lundberg. THANKS! -%%% -%%% Revision 1.3 (2004) -%%% Sep. 20th problem with frontmatter, mainmatter and -%%% backmatter, pointed out by Lapo Mori -%%% -%%% Revision 1.31 (2004) -%%% Sep. 21th problem with the Rejne definition streched text -%%% caused ugly gaps in the vrule aligned with the title -%%% text. Kindly pointed out to me by Hendri Adriaens -%%% -%%% Revision 1.32 (2005) -%%% Jun. 23th compatibility problem with the KOMA class 'scrbook.cls' -%%% a remedy is a redefinition of '\@schapter' in -%%% line with that used in KOMA. The problem was pointed -%%% out to me by Mikkel Holm Olsen -%%% -%%% Revision 1.33 (2005) -%%% Aug. 9th misspelled ``TWELV'' corrected, the error was pointed -%%% out to me by George Pearson -%%% -%%% Revision 1.34 (2007) -%%% Added an alternative to Lenny provided by Peter -%%% Osborne (2005-11-28) -%%% Corrected front, main and back matter, based on input -%%% from Bas van Gils (2006-04-24) -%%% Jul. 30th Added Bjornstrup option provided by Jean-Marc -%%% Francois (2007-01-05). -%%% Reverted to \MakeUppercase{#} see rev 1.1, solved -%%% problem with MakeUppercase and MakeLowercase pointed -%%% out by Marco Feuerstein (2007-06-06) - - -%%% Last modified Jul. 2007 - -\NeedsTeXFormat{LaTeX2e}[1995/12/01] -\ProvidesPackage{fncychap} - [2007/07/30 v1.34 - LaTeX package (Revised chapters)] - -%%%% For conditional inclusion of color -\newif\ifusecolor -\usecolorfalse - - - -%%%% DEFINITION OF Chapapp variables -\newcommand{\CNV}{\huge\bfseries} -\newcommand{\ChNameVar}[1]{\renewcommand{\CNV}{#1}} - - -%%%% DEFINITION OF TheChapter variables -\newcommand{\CNoV}{\huge\bfseries} -\newcommand{\ChNumVar}[1]{\renewcommand{\CNoV}{#1}} - -\newif\ifUCN -\UCNfalse -\newif\ifLCN -\LCNfalse -\def\ChNameLowerCase{\LCNtrue\UCNfalse} -\def\ChNameUpperCase{\UCNtrue\LCNfalse} -\def\ChNameAsIs{\UCNfalse\LCNfalse} - -%%%%% Fix for AMSBook 971008 - -\@ifundefined{@chapapp}{\let\@chapapp\chaptername}{} - - -%%%%% Fix for Bjarne and appendix 980211 - -\newif\ifinapp -\inappfalse -\renewcommand\appendix{\par - \setcounter{chapter}{0}% - \setcounter{section}{0}% - \inapptrue% - \renewcommand\@chapapp{\appendixname}% - \renewcommand\thechapter{\@Alph\c@chapter}} - -%%%%% Fix for frontmatter, mainmatter, and backmatter 040920 - -\@ifundefined{@mainmatter}{\newif\if@mainmatter \@mainmattertrue}{} - -%%%%% - - - -\newcommand{\FmN}[1]{% -\ifUCN - {\MakeUppercase{#1}}\LCNfalse -\else - \ifLCN - {\MakeLowercase{#1}}\UCNfalse - \else #1 - \fi -\fi} - - -%%%% DEFINITION OF Title variables -\newcommand{\CTV}{\Huge\bfseries} -\newcommand{\ChTitleVar}[1]{\renewcommand{\CTV}{#1}} - -%%%% DEFINITION OF the basic rule width -\newlength{\RW} -\setlength{\RW}{1pt} -\newcommand{\ChRuleWidth}[1]{\setlength{\RW}{#1}} - -\newif\ifUCT -\UCTfalse -\newif\ifLCT -\LCTfalse -\def\ChTitleLowerCase{\LCTtrue\UCTfalse} -\def\ChTitleUpperCase{\UCTtrue\LCTfalse} -\def\ChTitleAsIs{\UCTfalse\LCTfalse} -\newcommand{\FmTi}[1]{% -\ifUCT - {\MakeUppercase{#1}}\LCTfalse -\else - \ifLCT - {\MakeLowercase{#1}}\UCTfalse - \else {#1} - \fi -\fi} - - - -\newlength{\mylen} -\newlength{\myhi} -\newlength{\px} -\newlength{\py} -\newlength{\pyy} -\newlength{\pxx} - - -\def\mghrulefill#1{\leavevmode\leaders\hrule\@height #1\hfill\kern\z@} - -\newcommand{\DOCH}{% - \CNV\FmN{\@chapapp}\space \CNoV\thechapter - \par\nobreak - \vskip 20\p@ - } -\newcommand{\DOTI}[1]{% - \CTV\FmTi{#1}\par\nobreak - \vskip 40\p@ - } -\newcommand{\DOTIS}[1]{% - \CTV\FmTi{#1}\par\nobreak - \vskip 40\p@ - } - -%%%%%% SONNY DEF - -\DeclareOption{Sonny}{% - \ChNameVar{\Large\sf} - \ChNumVar{\Huge} - \ChTitleVar{\Large\sf} - \ChRuleWidth{0.5pt} - \ChNameUpperCase - \renewcommand{\DOCH}{% - \raggedleft - \CNV\FmN{\@chapapp}\space \CNoV\thechapter - \par\nobreak - \vskip 40\p@} - \renewcommand{\DOTI}[1]{% - \CTV\raggedleft\mghrulefill{\RW}\par\nobreak - \vskip 5\p@ - \CTV\FmTi{#1}\par\nobreak - \mghrulefill{\RW}\par\nobreak - \vskip 40\p@} - \renewcommand{\DOTIS}[1]{% - \CTV\raggedleft\mghrulefill{\RW}\par\nobreak - \vskip 5\p@ - \CTV\FmTi{#1}\par\nobreak - \mghrulefill{\RW}\par\nobreak - \vskip 40\p@} -} - -%%%%%% LENNY DEF - -\DeclareOption{Lenny}{% - - \ChNameVar{\fontsize{14}{16}\usefont{OT1}{phv}{m}{n}\selectfont} - \ChNumVar{\fontsize{60}{62}\usefont{OT1}{ptm}{m}{n}\selectfont} - \ChTitleVar{\Huge\bfseries\rm} - \ChRuleWidth{1pt} - \renewcommand{\DOCH}{% - \settowidth{\px}{\CNV\FmN{\@chapapp}} - \addtolength{\px}{2pt} - \settoheight{\py}{\CNV\FmN{\@chapapp}} - \addtolength{\py}{1pt} - - \settowidth{\mylen}{\CNV\FmN{\@chapapp}\space\CNoV\thechapter} - \addtolength{\mylen}{1pt} - \settowidth{\pxx}{\CNoV\thechapter} - \addtolength{\pxx}{-1pt} - - \settoheight{\pyy}{\CNoV\thechapter} - \addtolength{\pyy}{-2pt} - \setlength{\myhi}{\pyy} - \addtolength{\myhi}{-1\py} - \par - \parbox[b]{\textwidth}{% - \rule[\py]{\RW}{\myhi}% - \hskip -\RW% - \rule[\pyy]{\px}{\RW}% - \hskip -\px% - \raggedright% - \CNV\FmN{\@chapapp}\space\CNoV\thechapter% - \hskip1pt% - \mghrulefill{\RW}% - \rule{\RW}{\pyy}\par\nobreak% - \vskip -\baselineskip% - \vskip -\pyy% - \hskip \mylen% - \mghrulefill{\RW}\par\nobreak% - \vskip \pyy}% - \vskip 20\p@} - - - \renewcommand{\DOTI}[1]{% - \raggedright - \CTV\FmTi{#1}\par\nobreak - \vskip 40\p@} - - \renewcommand{\DOTIS}[1]{% - \raggedright - \CTV\FmTi{#1}\par\nobreak - \vskip 40\p@} - } - -%%%%%% Peter Osbornes' version of LENNY DEF - -\DeclareOption{PetersLenny}{% - -% five new lengths -\newlength{\bl} % bottom left : orig \space -\setlength{\bl}{6pt} -\newcommand{\BL}[1]{\setlength{\bl}{#1}} -\newlength{\br} % bottom right : orig 1pt -\setlength{\br}{1pt} -\newcommand{\BR}[1]{\setlength{\br}{#1}} -\newlength{\tl} % top left : orig 2pt -\setlength{\tl}{2pt} -\newcommand{\TL}[1]{\setlength{\tl}{#1}} -\newlength{\trr} % top right :orig 1pt -\setlength{\trr}{1pt} -\newcommand{\TR}[1]{\setlength{\trr}{#1}} -\newlength{\blrule} % top right :orig 1pt -\setlength{\trr}{0pt} -\newcommand{\BLrule}[1]{\setlength{\blrule}{#1}} - - - \ChNameVar{\fontsize{14}{16}\usefont{OT1}{phv}{m}{n}\selectfont} - \ChNumVar{\fontsize{60}{62}\usefont{OT1}{ptm}{m}{n}\selectfont} - \ChTitleVar{\Huge\bfseries\rm} - \ChRuleWidth{1pt} -\renewcommand{\DOCH}{% - - -%%%%%%% tweaks for 1--9 and A--Z -\ifcase\c@chapter\relax% -\or\BL{-3pt}\TL{-4pt}\BR{0pt}\TR{-6pt}%1 -\or\BL{0pt}\TL{-4pt}\BR{2pt}\TR{-4pt}%2 -\or\BL{0pt}\TL{-4pt}\BR{2pt}\TR{-4pt}%3 -\or\BL{0pt}\TL{5pt}\BR{2pt}\TR{-4pt}%4 -\or\BL{0pt}\TL{3pt}\BR{2pt}\TR{-4pt}%5 -\or\BL{-1pt}\TL{0pt}\BR{2pt}\TR{-2pt}%6 -\or\BL{0pt}\TL{-3pt}\BR{2pt}\TR{-2pt}%7 -\or\BL{0pt}\TL{-3pt}\BR{2pt}\TR{-2pt}%8 -\or\BL{0pt}\TL{-3pt}\BR{-4pt}\TR{-2pt}%9 -\or\BL{-3pt}\TL{-3pt}\BR{2pt}\TR{-7pt}%10 -\or\BL{-6pt}\TL{-6pt}\BR{0pt}\TR{-9pt}%11 -\or\BL{-6pt}\TL{-6pt}\BR{2pt}\TR{-7pt}%12 -\or\BL{-5pt}\TL{-5pt}\BR{0pt}\TR{-9pt}%13 -\or\BL{-6pt}\TL{-6pt}\BR{0pt}\TR{-9pt}%14 -\or\BL{-3pt}\TL{-3pt}\BR{3pt}\TR{-6pt}%15 -\or\BL{-3pt}\TL{-3pt}\BR{3pt}\TR{-6pt}%16 -\or\BL{-5pt}\TL{-3pt}\BR{-8pt}\TR{-6pt}%17 -\or\BL{-5pt}\TL{-5pt}\BR{0pt}\TR{-9pt}%18 -\or\BL{-3pt}\TL{-3pt}\BR{-6pt}\TR{-9pt}%19 -\or\BL{0pt}\TL{0pt}\BR{0pt}\TR{-5pt}%20 -\fi - -\ifinapp\ifcase\c@chapter\relax% -\or\BL{0pt}\TL{14pt}\BR{5pt}\TR{-19pt}%A -\or\BL{0pt}\TL{-5pt}\BR{-3pt}\TR{-8pt}%B -\or\BL{-3pt}\TL{-2pt}\BR{1pt}\TR{-6pt}\BLrule{0pt}%C -\or\BL{0pt}\TL{-5pt}\BR{-3pt}\TR{-8pt}\BLrule{0pt}%D -\or\BL{0pt}\TL{-5pt}\BR{2pt}\TR{-3pt}%E -\or\BL{0pt}\TL{-5pt}\BR{-10pt}\TR{-1pt}%F -\or\BL{-3pt}\TL{0pt}\BR{0pt}\TR{-7pt}%G -\or\BL{0pt}\TL{-5pt}\BR{3pt}\TR{-1pt}%H -\or\BL{0pt}\TL{-5pt}\BR{3pt}\TR{-1pt}%I -\or\BL{2pt}\TL{0pt}\BR{-3pt}\TR{1pt}%J -\or\BL{0pt}\TL{-5pt}\BR{3pt}\TR{-1pt}%K -\or\BL{0pt}\TL{-5pt}\BR{2pt}\TR{-19pt}%L -\or\BL{0pt}\TL{-5pt}\BR{3pt}\TR{-1pt}%M -\or\BL{0pt}\TL{-5pt}\BR{-2pt}\TR{-1pt}%N -\or\BL{-3pt}\TL{-2pt}\BR{-3pt}\TR{-11pt}%O -\or\BL{0pt}\TL{-5pt}\BR{-9pt}\TR{-3pt}%P -\or\BL{-3pt}\TL{-2pt}\BR{-3pt}\TR{-11pt}%Q -\or\BL{0pt}\TL{-5pt}\BR{4pt}\TR{-8pt}%R -\or\BL{-2pt}\TL{-2pt}\BR{-2pt}\TR{-7pt}%S -\or\BL{-3pt}\TL{0pt}\BR{-5pt}\TR{4pt}\BLrule{8pt}%T -\or\BL{-7pt}\TL{-11pt}\BR{-5pt}\TR{-7pt}\BLrule{0pt}%U -\or\BL{-14pt}\TL{-5pt}\BR{-14pt}\TR{-1pt}\BLrule{14pt}%V -\or\BL{-10pt}\TL{-9pt}\BR{-13pt}\TR{-3pt}\BLrule{7pt}%W -\or\BL{0pt}\TL{-5pt}\BR{3pt}\TR{-1pt}\BLrule{0pt}%X -\or\BL{-6pt}\TL{-4pt}\BR{-7pt}\TR{1pt}\BLrule{7pt}%Y -\or\BL{0pt}\TL{-5pt}\BR{3pt}\TR{-1pt}\BLrule{0pt}%Z -\fi\fi -%%%%%%% - \settowidth{\px}{\CNV\FmN{\@chapapp}} - \addtolength{\px}{\tl} %MOD change 2pt to \tl - \settoheight{\py}{\CNV\FmN{\@chapapp}} - \addtolength{\py}{1pt} - - \settowidth{\mylen}{\CNV\FmN{\@chapapp}\space\CNoV\thechapter} - \addtolength{\mylen}{\trr}% MOD change 1pt to \tr - \settowidth{\pxx}{\CNoV\thechapter} - \addtolength{\pxx}{-1pt} - - \settoheight{\pyy}{\CNoV\thechapter} - \addtolength{\pyy}{-2pt} - \setlength{\myhi}{\pyy} - \addtolength{\myhi}{-1\py} - \par - \parbox[b]{\textwidth}{% - \rule[\py]{\RW}{\myhi}% - \hskip -\RW% - \rule[\pyy]{\px}{\RW}% - \hskip -\px% - \raggedright% - \CNV\FmN{\@chapapp}\rule{\blrule}{\RW}\hskip\bl\CNoV\thechapter%MOD -% \CNV\FmN{\@chapapp}\space\CNoV\thechapter %ORIGINAL - \hskip\br% %MOD 1pt to \br - \mghrulefill{\RW}% - \rule{\RW}{\pyy}\par\nobreak% - \vskip -\baselineskip% - \vskip -\pyy% - \hskip \mylen% - \mghrulefill{\RW}\par\nobreak% - \vskip \pyy}% - \vskip 20\p@} - - - \renewcommand{\DOTI}[1]{% - \raggedright - \CTV\FmTi{#1}\par\nobreak - \vskip 40\p@} - - \renewcommand{\DOTIS}[1]{% - \raggedright - \CTV\FmTi{#1}\par\nobreak - \vskip 40\p@} - } - - -% - - -%%%%%% BJORNSTRUP DEF - -\DeclareOption{Bjornstrup}{% - \usecolortrue - % pzc (Zapf Chancelery) is nice. ppl (Palatino) is cool too. - \ChNumVar{\fontsize{76}{80}\usefont{OT1}{pzc}{m}{n}\selectfont} - \ChTitleVar{\raggedleft\Large\sffamily\bfseries} - - \setlength{\myhi}{10pt} % Space between grey box border and text - \setlength{\mylen}{\textwidth} - \addtolength{\mylen}{-2\myhi} - \renewcommand{\DOCH}{% - \settowidth{\py}{\CNoV\thechapter} - \addtolength{\py}{-10pt} % Amount of space by which the -% % number is shifted right - \fboxsep=0pt% - \colorbox[gray]{.85}{\rule{0pt}{40pt}\parbox[b]{\textwidth}{\hfill}}% - \kern-\py\raise20pt% - \hbox{\color[gray]{.5}\CNoV\thechapter}\\% - } - - \renewcommand{\DOTI}[1]{% - \nointerlineskip\raggedright% - \fboxsep=\myhi% - \vskip-1ex% - \colorbox[gray]{.85}{\parbox[t]{\mylen}{\CTV\FmTi{#1}}}\par\nobreak% - \vskip 40\p@% - } - - \renewcommand{\DOTIS}[1]{% - \fboxsep=0pt - \colorbox[gray]{.85}{\rule{0pt}{40pt}\parbox[b]{\textwidth}{\hfill}}\\% - \nointerlineskip\raggedright% - \fboxsep=\myhi% - \colorbox[gray]{.85}{\parbox[t]{\mylen}{\CTV\FmTi{#1}}}\par\nobreak% - \vskip 40\p@% - } -} - - -%%%%%%% GLENN DEF - - -\DeclareOption{Glenn}{% - \ChNameVar{\bfseries\Large\sf} - \ChNumVar{\Huge} - \ChTitleVar{\bfseries\Large\rm} - \ChRuleWidth{1pt} - \ChNameUpperCase - \ChTitleUpperCase - \renewcommand{\DOCH}{% - \settoheight{\myhi}{\CTV\FmTi{Test}} - \setlength{\py}{\baselineskip} - \addtolength{\py}{\RW} - \addtolength{\py}{\myhi} - \setlength{\pyy}{\py} - \addtolength{\pyy}{-1\RW} - - \raggedright - \CNV\FmN{\@chapapp}\space\CNoV\thechapter - \hskip 3pt\mghrulefill{\RW}\rule[-1\pyy]{2\RW}{\py}\par\nobreak} - - \renewcommand{\DOTI}[1]{% - \addtolength{\pyy}{-4pt} - \settoheight{\myhi}{\CTV\FmTi{#1}} - \addtolength{\myhi}{\py} - \addtolength{\myhi}{-1\RW} - \vskip -1\pyy - \rule{2\RW}{\myhi}\mghrulefill{\RW}\hskip 2pt - \raggedleft\CTV\FmTi{#1}\par\nobreak - \vskip 80\p@} - -\newlength{\backskip} - \renewcommand{\DOTIS}[1]{% -% \setlength{\py}{10pt} -% \setlength{\pyy}{\py} -% \addtolength{\pyy}{\RW} -% \setlength{\myhi}{\baselineskip} -% \addtolength{\myhi}{\pyy} -% \mghrulefill{\RW}\rule[-1\py]{2\RW}{\pyy}\par\nobreak -% \addtolength{}{} -%\vskip -1\baselineskip -% \rule{2\RW}{\myhi}\mghrulefill{\RW}\hskip 2pt -% \raggedleft\CTV\FmTi{#1}\par\nobreak -% \vskip 60\p@} -%% Fix suggested by Tomas Lundberg - \setlength{\py}{25pt} % eller vad man vill - \setlength{\pyy}{\py} - \setlength{\backskip}{\py} - \addtolength{\backskip}{2pt} - \addtolength{\pyy}{\RW} - \setlength{\myhi}{\baselineskip} - \addtolength{\myhi}{\pyy} - \mghrulefill{\RW}\rule[-1\py]{2\RW}{\pyy}\par\nobreak - \vskip -1\backskip - \rule{2\RW}{\myhi}\mghrulefill{\RW}\hskip 3pt % - \raggedleft\CTV\FmTi{#1}\par\nobreak - \vskip 40\p@} - } - -%%%%%%% CONNY DEF - -\DeclareOption{Conny}{% - \ChNameUpperCase - \ChTitleUpperCase - \ChNameVar{\centering\Huge\rm\bfseries} - \ChNumVar{\Huge} - \ChTitleVar{\centering\Huge\rm} - \ChRuleWidth{2pt} - - \renewcommand{\DOCH}{% - \mghrulefill{3\RW}\par\nobreak - \vskip -0.5\baselineskip - \mghrulefill{\RW}\par\nobreak - \CNV\FmN{\@chapapp}\space \CNoV\thechapter - \par\nobreak - \vskip -0.5\baselineskip - } - \renewcommand{\DOTI}[1]{% - \mghrulefill{\RW}\par\nobreak - \CTV\FmTi{#1}\par\nobreak - \vskip 60\p@ - } - \renewcommand{\DOTIS}[1]{% - \mghrulefill{\RW}\par\nobreak - \CTV\FmTi{#1}\par\nobreak - \vskip 60\p@ - } - } - -%%%%%%% REJNE DEF - -\DeclareOption{Rejne}{% - - \ChNameUpperCase - \ChTitleUpperCase - \ChNameVar{\centering\Large\rm} - \ChNumVar{\Huge} - \ChTitleVar{\centering\Huge\rm} - \ChRuleWidth{1pt} - \renewcommand{\DOCH}{% - \settoheight{\py}{\CNoV\thechapter} - \parskip=0pt plus 1pt % Set parskip to default, just in case v1.31 - \addtolength{\py}{-1pt} - \CNV\FmN{\@chapapp}\par\nobreak - \vskip 20\p@ - \setlength{\myhi}{2\baselineskip} - \setlength{\px}{\myhi} - \addtolength{\px}{-1\RW} - \rule[-1\px]{\RW}{\myhi}\mghrulefill{\RW}\hskip - 10pt\raisebox{-0.5\py}{\CNoV\thechapter}\hskip 10pt\mghrulefill{\RW}\rule[-1\px]{\RW}{\myhi}\par\nobreak - \vskip -3\p@% Added -2pt vskip to correct for streched text v1.31 - } - \renewcommand{\DOTI}[1]{% - \setlength{\mylen}{\textwidth} - \parskip=0pt plus 1pt % Set parskip to default, just in case v1.31 - \addtolength{\mylen}{-2\RW} - {\vrule width\RW}\parbox{\mylen}{\CTV\FmTi{#1}}{\vrule width\RW}\par\nobreak% - \vskip -3pt\rule{\RW}{2\baselineskip}\mghrulefill{\RW}\rule{\RW}{2\baselineskip}% - \vskip 60\p@% Added -2pt in vskip to correct for streched text v1.31 - } - \renewcommand{\DOTIS}[1]{% - \setlength{\py}{\fboxrule} - \setlength{\fboxrule}{\RW} - \setlength{\mylen}{\textwidth} - \addtolength{\mylen}{-2\RW} - \fbox{\parbox{\mylen}{\vskip 2\baselineskip\CTV\FmTi{#1}\par\nobreak\vskip \baselineskip}} - \setlength{\fboxrule}{\py} - \vskip 60\p@ - } - } - - -%%%%%%% BJARNE DEF - -\DeclareOption{Bjarne}{% - \ChNameUpperCase - \ChTitleUpperCase - \ChNameVar{\raggedleft\normalsize\rm} - \ChNumVar{\raggedleft \bfseries\Large} - \ChTitleVar{\raggedleft \Large\rm} - \ChRuleWidth{1pt} - - -%% Note thechapter -> c@chapter fix appendix bug -%% Fixed misspelled 12 - - \newcounter{AlphaCnt} - \newcounter{AlphaDecCnt} - \newcommand{\AlphaNo}{% - \ifcase\number\theAlphaCnt - \ifnum\c@chapter=0 - ZERO\else{}\fi - \or ONE\or TWO\or THREE\or FOUR\or FIVE - \or SIX\or SEVEN\or EIGHT\or NINE\or TEN - \or ELEVEN\or TWELVE\or THIRTEEN\or FOURTEEN\or FIFTEEN - \or SIXTEEN\or SEVENTEEN\or EIGHTEEN\or NINETEEN\fi -} - - \newcommand{\AlphaDecNo}{% - \setcounter{AlphaDecCnt}{0} - \@whilenum\number\theAlphaCnt>0\do - {\addtocounter{AlphaCnt}{-10} - \addtocounter{AlphaDecCnt}{1}} - \ifnum\number\theAlphaCnt=0 - \else - \addtocounter{AlphaDecCnt}{-1} - \addtocounter{AlphaCnt}{10} - \fi - - - \ifcase\number\theAlphaDecCnt\or TEN\or TWENTY\or THIRTY\or - FORTY\or FIFTY\or SIXTY\or SEVENTY\or EIGHTY\or NINETY\fi - } - \newcommand{\TheAlphaChapter}{% - - \ifinapp - \thechapter - \else - \setcounter{AlphaCnt}{\c@chapter} - \ifnum\c@chapter<20 - \AlphaNo - \else - \AlphaDecNo\AlphaNo - \fi - \fi - } - \renewcommand{\DOCH}{% - \mghrulefill{\RW}\par\nobreak - \CNV\FmN{\@chapapp}\par\nobreak - \CNoV\TheAlphaChapter\par\nobreak - \vskip -1\baselineskip\vskip 5pt\mghrulefill{\RW}\par\nobreak - \vskip 20\p@ - } - \renewcommand{\DOTI}[1]{% - \CTV\FmTi{#1}\par\nobreak - \vskip 40\p@ - } - \renewcommand{\DOTIS}[1]{% - \CTV\FmTi{#1}\par\nobreak - \vskip 40\p@ - } -} - -\DeclareOption*{% - \PackageWarning{fancychapter}{unknown style option} - } - -\ProcessOptions* \relax - -\ifusecolor - \RequirePackage{color} -\fi -\def\@makechapterhead#1{% - \vspace*{50\p@}% - {\parindent \z@ \raggedright \normalfont - \ifnum \c@secnumdepth >\m@ne - \if@mainmatter%%%%% Fix for frontmatter, mainmatter, and backmatter 040920 - \DOCH - \fi - \fi - \interlinepenalty\@M - \if@mainmatter%%%%% Fix for frontmatter, mainmatter, and backmatter 060424 - \DOTI{#1}% - \else% - \DOTIS{#1}% - \fi - }} - - -%%% Begin: To avoid problem with scrbook.cls (fncychap version 1.32) - -%%OUT: -%\def\@schapter#1{\if@twocolumn -% \@topnewpage[\@makeschapterhead{#1}]% -% \else -% \@makeschapterhead{#1}% -% \@afterheading -% \fi} - -%%IN: -\def\@schapter#1{% -\if@twocolumn% - \@makeschapterhead{#1}% -\else% - \@makeschapterhead{#1}% - \@afterheading% -\fi} - -%%% End: To avoid problem with scrbook.cls (fncychap version 1.32) - -\def\@makeschapterhead#1{% - \vspace*{50\p@}% - {\parindent \z@ \raggedright - \normalfont - \interlinepenalty\@M - \DOTIS{#1} - \vskip 40\p@ - }} - -\endinput - - diff --git a/develop/_Sphinx/doc/_build/latex/python.ist b/develop/_Sphinx/doc/_build/latex/python.ist deleted file mode 100755 index 9ffa0f9..0000000 --- a/develop/_Sphinx/doc/_build/latex/python.ist +++ /dev/null @@ -1,11 +0,0 @@ -line_max 100 -headings_flag 1 -heading_prefix " \\bigletter " - -preamble "\\begin{theindex} -\\def\\bigletter#1{{\\Large\\sffamily#1}\\nopagebreak\\vspace{1mm}} - -" - -symhead_positive "{Symbols}" -numhead_positive "{Numbers}" diff --git a/develop/_Sphinx/doc/_build/latex/sphinx.sty b/develop/_Sphinx/doc/_build/latex/sphinx.sty deleted file mode 100755 index 554845f..0000000 --- a/develop/_Sphinx/doc/_build/latex/sphinx.sty +++ /dev/null @@ -1,522 +0,0 @@ -% -% sphinx.sty -% -% Adapted from the old python.sty, mostly written by Fred Drake, -% by Georg Brandl. -% - -\NeedsTeXFormat{LaTeX2e}[1995/12/01] -\ProvidesPackage{sphinx}[2010/01/15 LaTeX package (Sphinx markup)] - -\@ifclassloaded{memoir}{}{\RequirePackage{fancyhdr}} - -\RequirePackage{textcomp} -\RequirePackage{fancybox} -\RequirePackage{titlesec} -\RequirePackage{tabulary} -\RequirePackage{amsmath} % for \text -\RequirePackage{makeidx} -\RequirePackage{framed} -\RequirePackage{ifthen} -\RequirePackage{color} -% For highlighted code. -\RequirePackage{fancyvrb} -% For table captions. -\RequirePackage{threeparttable} -% Handle footnotes in tables. -\RequirePackage{footnote} -\makesavenoteenv{tabulary} -% For floating figures in the text. -\RequirePackage{wrapfig} -% Separate paragraphs by space by default. -\RequirePackage{parskip} -% For parsed-literal blocks. -\RequirePackage{alltt} - -% Redefine these colors to your liking in the preamble. -\definecolor{TitleColor}{rgb}{0.126,0.263,0.361} -\definecolor{InnerLinkColor}{rgb}{0.208,0.374,0.486} -\definecolor{OuterLinkColor}{rgb}{0.216,0.439,0.388} -% Redefine these colors to something not white if you want to have colored -% background and border for code examples. -\definecolor{VerbatimColor}{rgb}{1,1,1} -\definecolor{VerbatimBorderColor}{rgb}{1,1,1} - -% Uncomment these two lines to ignore the paper size and make the page -% size more like a typical published manual. -%\renewcommand{\paperheight}{9in} -%\renewcommand{\paperwidth}{8.5in} % typical squarish manual -%\renewcommand{\paperwidth}{7in} % O'Reilly ``Programmming Python'' - -% use pdfoutput for pTeX and dvipdfmx -\ifx\kanjiskip\undefined\else - \ifx\Gin@driver{dvipdfmx.def}\undefined\else - \newcount\pdfoutput\pdfoutput=0 - \fi -\fi - -% For graphicx, check if we are compiling under latex or pdflatex. -\ifx\pdftexversion\undefined - \usepackage{graphicx} -\else - \usepackage[pdftex]{graphicx} -\fi - -% for PDF output, use colors and maximal compression -\newif\ifsphinxpdfoutput\sphinxpdfoutputfalse -\ifx\pdfoutput\undefined\else\ifcase\pdfoutput - \let\py@NormalColor\relax - \let\py@TitleColor\relax -\else - \sphinxpdfoutputtrue - \input{pdfcolor} - \def\py@NormalColor{\color[rgb]{0.0,0.0,0.0}} - \def\py@TitleColor{\color{TitleColor}} - \pdfcompresslevel=9 -\fi\fi - -% XeLaTeX can do colors, too -\ifx\XeTeXrevision\undefined\else - \def\py@NormalColor{\color[rgb]{0.0,0.0,0.0}} - \def\py@TitleColor{\color{TitleColor}} -\fi - -% Increase printable page size (copied from fullpage.sty) -\topmargin 0pt -\advance \topmargin by -\headheight -\advance \topmargin by -\headsep - -% attempt to work a little better for A4 users -\textheight \paperheight -\advance\textheight by -2in - -\oddsidemargin 0pt -\evensidemargin 0pt -%\evensidemargin -.25in % for ``manual size'' documents -\marginparwidth 0.5in - -\textwidth \paperwidth -\advance\textwidth by -2in - - -% Style parameters and macros used by most documents here -\raggedbottom -\sloppy -\hbadness = 5000 % don't print trivial gripes - -\pagestyle{empty} % start this way - -% Use this to set the font family for headers and other decor: -\newcommand{\py@HeaderFamily}{\sffamily\bfseries} - -% Redefine the 'normal' header/footer style when using "fancyhdr" package: -\@ifundefined{fancyhf}{}{ - % Use \pagestyle{normal} as the primary pagestyle for text. - \fancypagestyle{normal}{ - \fancyhf{} - \fancyfoot[LE,RO]{{\py@HeaderFamily\thepage}} - \fancyfoot[LO]{{\py@HeaderFamily\nouppercase{\rightmark}}} - \fancyfoot[RE]{{\py@HeaderFamily\nouppercase{\leftmark}}} - \fancyhead[LE,RO]{{\py@HeaderFamily \@title, \py@release}} - \renewcommand{\headrulewidth}{0.4pt} - \renewcommand{\footrulewidth}{0.4pt} - % define chaptermark with \@chappos when \@chappos is available for Japanese - \ifx\@chappos\undefined\else - \def\chaptermark##1{\markboth{\@chapapp\space\thechapter\space\@chappos\space ##1}{}} - \fi - } - % Update the plain style so we get the page number & footer line, - % but not a chapter or section title. This is to keep the first - % page of a chapter and the blank page between chapters `clean.' - \fancypagestyle{plain}{ - \fancyhf{} - \fancyfoot[LE,RO]{{\py@HeaderFamily\thepage}} - \renewcommand{\headrulewidth}{0pt} - \renewcommand{\footrulewidth}{0.4pt} - } -} - -% Some custom font markup commands. -% -\newcommand{\strong}[1]{{\textbf{#1}}} -\newcommand{\code}[1]{\texttt{#1}} -\newcommand{\bfcode}[1]{\code{\bfseries#1}} -\newcommand{\email}[1]{\textsf{#1}} - -% Redefine the Verbatim environment to allow border and background colors. -% The original environment is still used for verbatims within tables. -\let\OriginalVerbatim=\Verbatim -\let\endOriginalVerbatim=\endVerbatim - -% Play with vspace to be able to keep the indentation. -\newlength\distancetoright -\def\mycolorbox#1{% - \setlength\distancetoright{\linewidth}% - \advance\distancetoright -\@totalleftmargin % - \fcolorbox{VerbatimBorderColor}{VerbatimColor}{% - \begin{minipage}{\distancetoright}% - #1 - \end{minipage}% - }% -} -\def\FrameCommand{\mycolorbox} - -\renewcommand{\Verbatim}[1][1]{% - % list starts new par, but we don't want it to be set apart vertically - \bgroup\parskip=0pt% - \smallskip% - % The list environement is needed to control perfectly the vertical - % space. - \list{}{% - \setlength\parskip{0pt}% - \setlength\itemsep{0ex}% - \setlength\topsep{0ex}% - \setlength\partopsep{0pt}% - \setlength\leftmargin{0pt}% - }% - \item\MakeFramed {\FrameRestore}% - \small% - \OriginalVerbatim[#1]% -} -\renewcommand{\endVerbatim}{% - \endOriginalVerbatim% - \endMakeFramed% - \endlist% - % close group to restore \parskip - \egroup% -} - - -% \moduleauthor{name}{email} -\newcommand{\moduleauthor}[2]{} - -% \sectionauthor{name}{email} -\newcommand{\sectionauthor}[2]{} - -% Augment the sectioning commands used to get our own font family in place, -% and reset some internal data items: -\titleformat{\section}{\Large\py@HeaderFamily}% - {\py@TitleColor\thesection}{0.5em}{\py@TitleColor}{\py@NormalColor} -\titleformat{\subsection}{\large\py@HeaderFamily}% - {\py@TitleColor\thesubsection}{0.5em}{\py@TitleColor}{\py@NormalColor} -\titleformat{\subsubsection}{\py@HeaderFamily}% - {\py@TitleColor\thesubsubsection}{0.5em}{\py@TitleColor}{\py@NormalColor} -\titleformat{\paragraph}{\small\py@HeaderFamily}% - {\py@TitleColor}{0em}{\py@TitleColor}{\py@NormalColor} - -% {fulllineitems} is the main environment for object descriptions. -% -\newcommand{\py@itemnewline}[1]{% - \@tempdima\linewidth% - \advance\@tempdima \leftmargin\makebox[\@tempdima][l]{#1}% -} - -\newenvironment{fulllineitems}{ - \begin{list}{}{\labelwidth \leftmargin \labelsep 0pt - \rightmargin 0pt \topsep -\parskip \partopsep \parskip - \itemsep -\parsep - \let\makelabel=\py@itemnewline} -}{\end{list}} - -% \optional is used for ``[, arg]``, i.e. desc_optional nodes. -\newcommand{\optional}[1]{% - {\textnormal{\Large[}}{#1}\hspace{0.5mm}{\textnormal{\Large]}}} - -\newlength{\py@argswidth} -\newcommand{\py@sigparams}[2]{% - \parbox[t]{\py@argswidth}{#1\code{)}#2}} -\newcommand{\pysigline}[1]{\item[#1]\nopagebreak} -\newcommand{\pysiglinewithargsret}[3]{% - \settowidth{\py@argswidth}{#1\code{(}}% - \addtolength{\py@argswidth}{-2\py@argswidth}% - \addtolength{\py@argswidth}{\linewidth}% - \item[#1\code{(}\py@sigparams{#2}{#3}]} - -% Production lists -% -\newenvironment{productionlist}{ -% \def\optional##1{{\Large[}##1{\Large]}} - \def\production##1##2{\\\code{##1}&::=&\code{##2}} - \def\productioncont##1{\\& &\code{##1}} - \parindent=2em - \indent - \setlength{\LTpre}{0pt} - \setlength{\LTpost}{0pt} - \begin{longtable}[l]{lcl} -}{% - \end{longtable} -} - -% Notices / Admonitions -% -\newlength{\py@noticelength} - -\newcommand{\py@heavybox}{ - \setlength{\fboxrule}{1pt} - \setlength{\fboxsep}{6pt} - \setlength{\py@noticelength}{\linewidth} - \addtolength{\py@noticelength}{-2\fboxsep} - \addtolength{\py@noticelength}{-2\fboxrule} - %\setlength{\shadowsize}{3pt} - \noindent\Sbox - \minipage{\py@noticelength} -} -\newcommand{\py@endheavybox}{ - \endminipage - \endSbox - \fbox{\TheSbox} -} - -\newcommand{\py@lightbox}{{% - \setlength\parskip{0pt}\par - \noindent\rule[0ex]{\linewidth}{0.5pt}% - \par\noindent\vspace{-0.5ex}% - }} -\newcommand{\py@endlightbox}{{% - \setlength{\parskip}{0pt}% - \par\noindent\rule[0.5ex]{\linewidth}{0.5pt}% - \par\vspace{-0.5ex}% - }} - -% Some are quite plain: -\newcommand{\py@noticestart@note}{\py@lightbox} -\newcommand{\py@noticeend@note}{\py@endlightbox} -\newcommand{\py@noticestart@hint}{\py@lightbox} -\newcommand{\py@noticeend@hint}{\py@endlightbox} -\newcommand{\py@noticestart@important}{\py@lightbox} -\newcommand{\py@noticeend@important}{\py@endlightbox} -\newcommand{\py@noticestart@tip}{\py@lightbox} -\newcommand{\py@noticeend@tip}{\py@endlightbox} - -% Others gets more visible distinction: -\newcommand{\py@noticestart@warning}{\py@heavybox} -\newcommand{\py@noticeend@warning}{\py@endheavybox} -\newcommand{\py@noticestart@caution}{\py@heavybox} -\newcommand{\py@noticeend@caution}{\py@endheavybox} -\newcommand{\py@noticestart@attention}{\py@heavybox} -\newcommand{\py@noticeend@attention}{\py@endheavybox} -\newcommand{\py@noticestart@danger}{\py@heavybox} -\newcommand{\py@noticeend@danger}{\py@endheavybox} -\newcommand{\py@noticestart@error}{\py@heavybox} -\newcommand{\py@noticeend@error}{\py@endheavybox} - -\newenvironment{notice}[2]{ - \def\py@noticetype{#1} - \csname py@noticestart@#1\endcsname - \strong{#2} -}{\csname py@noticeend@\py@noticetype\endcsname} - -% Allow the release number to be specified independently of the -% \date{}. This allows the date to reflect the document's date and -% release to specify the release that is documented. -% -\newcommand{\py@release}{} -\newcommand{\version}{} -\newcommand{\shortversion}{} -\newcommand{\releaseinfo}{} -\newcommand{\releasename}{Release} -\newcommand{\release}[1]{% - \renewcommand{\py@release}{\releasename\space\version}% - \renewcommand{\version}{#1}} -\newcommand{\setshortversion}[1]{% - \renewcommand{\shortversion}{#1}} -\newcommand{\setreleaseinfo}[1]{% - \renewcommand{\releaseinfo}{#1}} - -% Allow specification of the author's address separately from the -% author's name. This can be used to format them differently, which -% is a good thing. -% -\newcommand{\py@authoraddress}{} -\newcommand{\authoraddress}[1]{\renewcommand{\py@authoraddress}{#1}} - -% This sets up the fancy chapter headings that make the documents look -% at least a little better than the usual LaTeX output. -% -\@ifundefined{ChTitleVar}{}{ - \ChNameVar{\raggedleft\normalsize\py@HeaderFamily} - \ChNumVar{\raggedleft \bfseries\Large\py@HeaderFamily} - \ChTitleVar{\raggedleft \textrm{\Huge\py@HeaderFamily}} - % This creates chapter heads without the leading \vspace*{}: - \def\@makechapterhead#1{% - {\parindent \z@ \raggedright \normalfont - \ifnum \c@secnumdepth >\m@ne - \DOCH - \fi - \interlinepenalty\@M - \DOTI{#1} - } - } -} - -% Redefine description environment so that it is usable inside fulllineitems. -% -\renewcommand{\description}{% - \list{}{\labelwidth\z@% - \itemindent-\leftmargin% - \labelsep5pt% - \let\makelabel=\descriptionlabel}} - -% Definition lists; requested by AMK for HOWTO documents. Probably useful -% elsewhere as well, so keep in in the general style support. -% -\newenvironment{definitions}{% - \begin{description}% - \def\term##1{\item[##1]\mbox{}\\*[0mm]} -}{% - \end{description}% -} - -% Tell TeX about pathological hyphenation cases: -\hyphenation{Base-HTTP-Re-quest-Hand-ler} - - -% The following is stuff copied from docutils' latex writer. -% -\newcommand{\optionlistlabel}[1]{\bf #1 \hfill} -\newenvironment{optionlist}[1] -{\begin{list}{} - {\setlength{\labelwidth}{#1} - \setlength{\rightmargin}{1cm} - \setlength{\leftmargin}{\rightmargin} - \addtolength{\leftmargin}{\labelwidth} - \addtolength{\leftmargin}{\labelsep} - \renewcommand{\makelabel}{\optionlistlabel}} -}{\end{list}} - -\newlength{\lineblockindentation} -\setlength{\lineblockindentation}{2.5em} -\newenvironment{lineblock}[1] -{\begin{list}{} - {\setlength{\partopsep}{\parskip} - \addtolength{\partopsep}{\baselineskip} - \topsep0pt\itemsep0.15\baselineskip\parsep0pt - \leftmargin#1} - \raggedright} -{\end{list}} - -% Redefine includgraphics for avoiding images larger than the screen size -% If the size is not specified. -\let\py@Oldincludegraphics\includegraphics - -\newbox\image@box% -\newdimen\image@width% -\renewcommand\includegraphics[2][\@empty]{% - \ifx#1\@empty% - \setbox\image@box=\hbox{\py@Oldincludegraphics{#2}}% - \image@width\wd\image@box% - \ifdim \image@width>\linewidth% - \setbox\image@box=\hbox{\py@Oldincludegraphics[width=\linewidth]{#2}}% - \box\image@box% - \else% - \py@Oldincludegraphics{#2}% - \fi% - \else% - \py@Oldincludegraphics[#1]{#2}% - \fi% -} - -% to make pdf with correct encoded bookmarks in Japanese -% this should precede the hyperref package -\ifx\kanjiskip\undefined\else - \usepackage{atbegshi} - \ifx\ucs\undefined - \ifnum 42146=\euc"A4A2 - \AtBeginShipoutFirst{\special{pdf:tounicode EUC-UCS2}} - \else - \AtBeginShipoutFirst{\special{pdf:tounicode 90ms-RKSJ-UCS2}} - \fi - \else - \AtBeginShipoutFirst{\special{pdf:tounicode UTF8-UCS2}} - \fi -\fi - -% Include hyperref last. -\RequirePackage[colorlinks,breaklinks, - linkcolor=InnerLinkColor,filecolor=OuterLinkColor, - menucolor=OuterLinkColor,urlcolor=OuterLinkColor, - citecolor=InnerLinkColor]{hyperref} -% Fix anchor placement for figures with captions. -% (Note: we don't use a package option here; instead, we give an explicit -% \capstart for figures that actually have a caption.) -\RequirePackage{hypcap} - -% From docutils.writers.latex2e -\providecommand{\DUspan}[2]{% - {% group ("span") to limit the scope of styling commands - \@for\node@class@name:=#1\do{% - \ifcsname docutilsrole\node@class@name\endcsname% - \csname docutilsrole\node@class@name\endcsname% - \fi% - }% - {#2}% node content - }% close "span" -} - -\providecommand*{\DUprovidelength}[2]{ - \ifthenelse{\isundefined{#1}}{\newlength{#1}\setlength{#1}{#2}}{} -} - -\DUprovidelength{\DUlineblockindent}{2.5em} -\ifthenelse{\isundefined{\DUlineblock}}{ - \newenvironment{DUlineblock}[1]{% - \list{}{\setlength{\partopsep}{\parskip} - \addtolength{\partopsep}{\baselineskip} - \setlength{\topsep}{0pt} - \setlength{\itemsep}{0.15\baselineskip} - \setlength{\parsep}{0pt} - \setlength{\leftmargin}{#1}} - \raggedright - } - {\endlist} -}{} - - -% From footmisc.sty: allows footnotes in titles -\let\FN@sf@@footnote\footnote -\def\footnote{\ifx\protect\@typeset@protect - \expandafter\FN@sf@@footnote - \else - \expandafter\FN@sf@gobble@opt - \fi -} -\edef\FN@sf@gobble@opt{\noexpand\protect - \expandafter\noexpand\csname FN@sf@gobble@opt \endcsname} -\expandafter\def\csname FN@sf@gobble@opt \endcsname{% - \@ifnextchar[%] - \FN@sf@gobble@twobracket - \@gobble -} -\def\FN@sf@gobble@twobracket[#1]#2{} - -% adjust the margins for footer, -% this works with the jsclasses only (Japanese standard document classes) -\ifx\@jsc@uplatextrue\undefined\else - \hypersetup{setpagesize=false} - \setlength\footskip{2\baselineskip} - \addtolength{\textheight}{-2\baselineskip} -\fi - -% fix the double index and bibliography on the table of contents -% in jsclasses (Japanese standard document classes) -\ifx\@jsc@uplatextrue\undefined\else - \renewcommand{\theindex}{ - \cleardoublepage - \phantomsection - \py@OldTheindex - } - \renewcommand{\thebibliography}[1]{ - \cleardoublepage - \phantomsection - \py@OldThebibliography{1} - } -\fi - -% disable \@chappos in Appendix in pTeX -\ifx\kanjiskip\undefined\else - \let\py@OldAppendix=\appendix - \renewcommand{\appendix}{ - \py@OldAppendix - \gdef\@chappos{} - } -\fi diff --git a/develop/_Sphinx/doc/_build/latex/sphinxhowto.cls b/develop/_Sphinx/doc/_build/latex/sphinxhowto.cls deleted file mode 100755 index 26e63a7..0000000 --- a/develop/_Sphinx/doc/_build/latex/sphinxhowto.cls +++ /dev/null @@ -1,104 +0,0 @@ -% -% sphinxhowto.cls for Sphinx (http://sphinx-doc.org/) -% - -\NeedsTeXFormat{LaTeX2e}[1995/12/01] -\ProvidesClass{sphinxhowto}[2009/06/02 Document class (Sphinx HOWTO)] - -% 'oneside' option overriding the 'twoside' default -\newif\if@oneside -\DeclareOption{oneside}{\@onesidetrue} -% Pass remaining document options to the parent class. -\DeclareOption*{\PassOptionsToClass{\CurrentOption}{\sphinxdocclass}} -\ProcessOptions\relax - -% Default to two-side document -\if@oneside -% nothing to do (oneside is the default) -\else -\PassOptionsToClass{twoside}{\sphinxdocclass} -\fi - -\LoadClass{\sphinxdocclass} - -% Set some sane defaults for section numbering depth and TOC depth. You can -% reset these counters in your preamble. -% -\setcounter{secnumdepth}{2} - -% Change the title page to look a bit better, and fit in with the fncychap -% ``Bjarne'' style a bit better. -% -\renewcommand{\maketitle}{ - \rule{\textwidth}{1pt} - \ifsphinxpdfoutput - \begingroup - % These \defs are required to deal with multi-line authors; it - % changes \\ to ', ' (comma-space), making it pass muster for - % generating document info in the PDF file. - \def\\{, } - \def\and{and } - \pdfinfo{ - /Author (\@author) - /Title (\@title) - } - \endgroup - \fi - \begin{flushright} - \sphinxlogo% - {\rm\Huge\py@HeaderFamily \@title} \par - {\em\large\py@HeaderFamily \py@release\releaseinfo} \par - \vspace{25pt} - {\Large\py@HeaderFamily - \begin{tabular}[t]{c} - \@author - \end{tabular}} \par - \vspace{25pt} - \@date \par - \py@authoraddress \par - \end{flushright} - \@thanks - \setcounter{footnote}{0} - \let\thanks\relax\let\maketitle\relax - %\gdef\@thanks{}\gdef\@author{}\gdef\@title{} -} - -\let\py@OldTableofcontents=\tableofcontents -\renewcommand{\tableofcontents}{ - \begingroup - \parskip = 0mm - \py@OldTableofcontents - \endgroup - \rule{\textwidth}{1pt} - \vspace{12pt} -} - -\@ifundefined{fancyhf}{ - \pagestyle{plain}}{ - \pagestyle{normal}} % start this way; change for -\pagenumbering{arabic} % ToC & chapters - -\thispagestyle{empty} - -% Fix the bibliography environment to add an entry to the Table of -% Contents. -% For an article document class this environment is a section, -% so no page break before it. -\let\py@OldThebibliography=\thebibliography -\renewcommand{\thebibliography}[1]{ - \phantomsection - \py@OldThebibliography{1} - \addcontentsline{toc}{section}{\bibname} -} - -% Same for the indices. -% The memoir class already does this, so we don't duplicate it in that case. -% -\@ifclassloaded{memoir}{}{ - \let\py@OldTheindex=\theindex - \renewcommand{\theindex}{ - \phantomsection - \py@OldTheindex - \addcontentsline{toc}{section}{\indexname} - } -} diff --git a/develop/_Sphinx/doc/_build/latex/sphinxmanual.cls b/develop/_Sphinx/doc/_build/latex/sphinxmanual.cls deleted file mode 100755 index a6b9b39..0000000 --- a/develop/_Sphinx/doc/_build/latex/sphinxmanual.cls +++ /dev/null @@ -1,148 +0,0 @@ -% -% sphinxmanual.cls for Sphinx (http://sphinx-doc.org/) -% - -\NeedsTeXFormat{LaTeX2e}[1995/12/01] -\ProvidesClass{sphinxmanual}[2009/06/02 Document class (Sphinx manual)] - -% chapters starting at odd pages (overridden by 'openany' document option) -\PassOptionsToClass{openright}{\sphinxdocclass} - -% 'oneside' option overriding the 'twoside' default -\newif\if@oneside -\DeclareOption{oneside}{\@onesidetrue} -% Pass remaining document options to the parent class. -\DeclareOption*{\PassOptionsToClass{\CurrentOption}{\sphinxdocclass}} -\ProcessOptions\relax - -% Defaults two-side document -\if@oneside -% nothing to do (oneside is the default) -\else -\PassOptionsToClass{twoside}{\sphinxdocclass} -\fi - -\LoadClass{\sphinxdocclass} - -% Set some sane defaults for section numbering depth and TOC depth. You can -% reset these counters in your preamble. -% -\setcounter{secnumdepth}{2} -\setcounter{tocdepth}{1} - -% Change the title page to look a bit better, and fit in with the fncychap -% ``Bjarne'' style a bit better. -% -\renewcommand{\maketitle}{% - \begin{titlepage}% - \let\footnotesize\small - \let\footnoterule\relax - \rule{\textwidth}{1pt}% - \ifsphinxpdfoutput - \begingroup - % These \defs are required to deal with multi-line authors; it - % changes \\ to ', ' (comma-space), making it pass muster for - % generating document info in the PDF file. - \def\\{, } - \def\and{and } - \pdfinfo{ - /Author (\@author) - /Title (\@title) - } - \endgroup - \fi - \begin{flushright}% - \sphinxlogo% - {\rm\Huge\py@HeaderFamily \@title \par}% - {\em\LARGE\py@HeaderFamily \py@release\releaseinfo \par} - \vfill - {\LARGE\py@HeaderFamily - \begin{tabular}[t]{c} - \@author - \end{tabular} - \par} - \vfill\vfill - {\large - \@date \par - \vfill - \py@authoraddress \par - }% - \end{flushright}%\par - \@thanks - \end{titlepage}% - \cleardoublepage% - \setcounter{footnote}{0}% - \let\thanks\relax\let\maketitle\relax - %\gdef\@thanks{}\gdef\@author{}\gdef\@title{} -} - - -% Catch the end of the {abstract} environment, but here make sure the abstract -% is followed by a blank page if the 'openright' option is used. -% -\let\py@OldEndAbstract=\endabstract -\renewcommand{\endabstract}{ - \if@openright - \ifodd\value{page} - \typeout{Adding blank page after the abstract.} - \vfil\pagebreak - \fi - \fi - \py@OldEndAbstract -} - -% This wraps the \tableofcontents macro with all the magic to get the spacing -% right and have the right number of pages if the 'openright' option has been -% used. This eliminates a fair amount of crud in the individual document files. -% -\let\py@OldTableofcontents=\tableofcontents -\renewcommand{\tableofcontents}{% - \pagenumbering{roman}% - \setcounter{page}{1}% - \pagebreak% - \pagestyle{plain}% - {% - \parskip = 0mm% - \py@OldTableofcontents% - \if@openright% - \ifodd\value{page}% - \typeout{Adding blank page after the table of contents.}% - \pagebreak\hspace{0pt}% - \fi% - \fi% - \cleardoublepage% - }% - \pagenumbering{arabic}% - \@ifundefined{fancyhf}{}{\pagestyle{normal}}% -} -\pagenumbering{alph} - -% This is needed to get the width of the section # area wide enough in the -% library reference. Doing it here keeps it the same for all the manuals. -% -\renewcommand*\l@section{\@dottedtocline{1}{1.5em}{2.6em}} -\renewcommand*\l@subsection{\@dottedtocline{2}{4.1em}{3.5em}} - -% Fix the bibliography environment to add an entry to the Table of -% Contents. -% For a report document class this environment is a chapter. -\let\py@OldThebibliography=\thebibliography -\renewcommand{\thebibliography}[1]{ - \cleardoublepage - \phantomsection - \py@OldThebibliography{1} - \addcontentsline{toc}{chapter}{\bibname} -} - -% Same for the indices. -% The memoir class already does this, so we don't duplicate it in that case. -% -\@ifclassloaded{memoir}{}{ - \let\py@OldTheindex=\theindex - \renewcommand{\theindex}{ - \cleardoublepage - \phantomsection - \py@OldTheindex - \addcontentsline{toc}{chapter}{\indexname} - } -} diff --git a/develop/_Sphinx/doc/_build/latex/tabulary.sty b/develop/_Sphinx/doc/_build/latex/tabulary.sty deleted file mode 100755 index 7ea572c..0000000 --- a/develop/_Sphinx/doc/_build/latex/tabulary.sty +++ /dev/null @@ -1,449 +0,0 @@ -%% -%% This is file `tabulary.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% tabulary.dtx (with options: `package') -%% DRAFT VERSION -%% -%% File `tabulary.dtx'. -%% Copyright (C) 1995 1996 2003 2008 David Carlisle -%% This file may be distributed under the terms of the LPPL. -%% See 00readme.txt for details. -%% -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{tabulary} - [2008/12/01 v0.9 tabulary package (DPC)] -\RequirePackage{array} -\catcode`\Z=14 -\DeclareOption{debugshow}{\catcode`\Z=9\relax} -\ProcessOptions -\def\arraybackslash{\let\\=\@arraycr} -\def\@finalstrut#1{% - \unskip\ifhmode\nobreak\fi\vrule\@width\z@\@height\z@\@depth\dp#1} -\newcount\TY@count -\def\tabulary{% - \let\TY@final\tabular - \let\endTY@final\endtabular - \TY@tabular} -\def\TY@tabular#1{% - \edef\TY@{\@currenvir}% - {\ifnum0=`}\fi - \@ovxx\TY@linewidth - \@ovyy\TY@tablewidth - \count@\z@ - \@tempswatrue - \@whilesw\if@tempswa\fi{% - \advance\count@\@ne - \expandafter\ifx\csname TY@F\the\count@\endcsname\relax - \@tempswafalse - \else - \expandafter\let\csname TY@SF\the\count@\expandafter\endcsname - \csname TY@F\the\count@\endcsname - \global\expandafter\let\csname TY@F\the\count@\endcsname\relax - \expandafter\let\csname TY@S\the\count@\expandafter\endcsname - \csname TY@\the\count@\endcsname - \fi}% - \global\TY@count\@ne - \TY@width\xdef{0pt}% - \global\TY@tablewidth\z@ - \global\TY@linewidth#1\relax -Z\message{^^J^^JTable^^J% -Z Target Width: \the\TY@linewidth^^J% -Z \string\tabcolsep: \the\tabcolsep\space -Z \string\arrayrulewidth: \the\arrayrulewidth\space -Z \string\doublerulesep: \the\doublerulesep^^J% -Z \string\tymin: \the\tymin\space -Z \string\tymax: \the\tymax^^J}% - \let\@classz\TY@classz - \let\verb\TX@verb - \toks@{}\TY@get@body} -\let\TY@@mkpream\@mkpream -\def\TY@mkpream{% - \def\@addamp{% - \if@firstamp \@firstampfalse \else - \global\advance\TY@count\@ne - \edef\@preamble{\@preamble &}\fi - \TY@width\xdef{0pt}}% - \def\@acol{% - \TY@subwidth\col@sep - \@addtopreamble{\hskip\col@sep}}% - \let\@arrayrule\TY@arrayrule - \let\@classvi\TY@classvi - \def\@classv{\save@decl - \expandafter\NC@ecs\@nextchar\extracolsep{}\extracolsep\@@@ - \sbox\z@{\d@llarbegin\@nextchar\d@llarend}% - \TY@subwidth{\wd\z@}% - \@addtopreamble{\d@llarbegin\the@toks\the\count@\relax\d@llarend}% - \prepnext@tok}% - \global\let\@mkpream\TY@@mkpream - \TY@@mkpream} -\def\TY@arrayrule{% - \TY@subwidth\arrayrulewidth - \@addtopreamble \vline} -\def\TY@classvi{\ifcase \@lastchclass - \@acol \or - \TY@subwidth\doublerulesep - \@addtopreamble{\hskip \doublerulesep}\or - \@acol \or - \@classvii - \fi} -\def\TY@tab{% - \setbox\z@\hbox\bgroup - \let\[$\let\]$% - \let\equation$\let\endequation$% - \col@sep\tabcolsep - \let\d@llarbegin\begingroup\let\d@llarend\endgroup - \let\@mkpream\TY@mkpream - \def\multicolumn##1##2##3{\multispan##1\relax}% - \CT@start\TY@tabarray} -\def\TY@tabarray{\@ifnextchar[{\TY@array}{\@array[t]}} -\def\TY@array[#1]{\@array[t]} -\def\TY@width#1{% - \expandafter#1\csname TY@\the\TY@count\endcsname} -\def\TY@subwidth#1{% - \TY@width\dimen@ - \advance\dimen@-#1\relax - \TY@width\xdef{\the\dimen@}% - \global\advance\TY@linewidth-#1\relax} -\def\endtabulary{% - \gdef\@halignto{}% - \expandafter\TY@tab\the\toks@ - \crcr\omit - {\xdef\TY@save@row{}% - \loop - \advance\TY@count\m@ne - \ifnum\TY@count>\z@ - \xdef\TY@save@row{\TY@save@row&\omit}% - \repeat}\TY@save@row - \endarray\global\setbox1=\lastbox\setbox0=\vbox{\unvbox1 - \unskip\global\setbox1=\lastbox}\egroup - \dimen@\TY@linewidth - \divide\dimen@\TY@count - \ifdim\dimen@<\tymin - \TY@warn{tymin too large (\the\tymin), resetting to \the\dimen@}% - \tymin\dimen@ - \fi - \setbox\tw@=\hbox{\unhbox\@ne - \loop -\@tempdima=\lastskip -\ifdim\@tempdima>\z@ -Z \message{ecs=\the\@tempdima^^J}% - \global\advance\TY@linewidth-\@tempdima -\fi - \unskip - \setbox\tw@=\lastbox - \ifhbox\tw@ -Z \message{Col \the\TY@count: Initial=\the\wd\tw@\space}% - \ifdim\wd\tw@>\tymax - \wd\tw@\tymax -Z \message{> max\space}% -Z \else -Z \message{ \@spaces\space}% - \fi - \TY@width\dimen@ -Z \message{\the\dimen@\space}% - \advance\dimen@\wd\tw@ -Z \message{Final=\the\dimen@\space}% - \TY@width\xdef{\the\dimen@}% - \ifdim\dimen@<\tymin -Z \message{< tymin}% - \global\advance\TY@linewidth-\dimen@ - \expandafter\xdef\csname TY@F\the\TY@count\endcsname - {\the\dimen@}% - \else - \expandafter\ifx\csname TY@F\the\TY@count\endcsname\z@ -Z \message{***}% - \global\advance\TY@linewidth-\dimen@ - \expandafter\xdef\csname TY@F\the\TY@count\endcsname - {\the\dimen@}% - \else -Z \message{> tymin}% - \global\advance\TY@tablewidth\dimen@ - \global\expandafter\let\csname TY@F\the\TY@count\endcsname - \maxdimen - \fi\fi - \advance\TY@count\m@ne - \repeat}% - \TY@checkmin - \TY@checkmin - \TY@checkmin - \TY@checkmin - \TY@count\z@ - \let\TY@box\TY@box@v - {\expandafter\TY@final\the\toks@\endTY@final}% - \count@\z@ - \@tempswatrue - \@whilesw\if@tempswa\fi{% - \advance\count@\@ne - \expandafter\ifx\csname TY@SF\the\count@\endcsname\relax - \@tempswafalse - \else - \global\expandafter\let\csname TY@F\the\count@\expandafter\endcsname - \csname TY@SF\the\count@\endcsname - \global\expandafter\let\csname TY@\the\count@\expandafter\endcsname - \csname TY@S\the\count@\endcsname - \fi}% - \TY@linewidth\@ovxx - \TY@tablewidth\@ovyy - \ifnum0=`{\fi}} -\def\TY@checkmin{% - \let\TY@checkmin\relax -\ifdim\TY@tablewidth>\z@ - \Gscale@div\TY@ratio\TY@linewidth\TY@tablewidth - \ifdim\TY@tablewidth <\TY@linewidth - \def\TY@ratio{1}% - \fi -\else - \TY@warn{No suitable columns!}% - \def\TY@ratio{1}% -\fi -\count@\z@ -Z \message{^^JLine Width: \the\TY@linewidth, -Z Natural Width: \the\TY@tablewidth, -Z Ratio: \TY@ratio^^J}% -\@tempdima\z@ -\loop -\ifnum\count@<\TY@count -\advance\count@\@ne - \ifdim\csname TY@F\the\count@\endcsname>\tymin - \dimen@\csname TY@\the\count@\endcsname - \dimen@\TY@ratio\dimen@ - \ifdim\dimen@<\tymin -Z \message{Column \the\count@\space ->}% - \global\expandafter\let\csname TY@F\the\count@\endcsname\tymin - \global\advance\TY@linewidth-\tymin - \global\advance\TY@tablewidth-\csname TY@\the\count@\endcsname - \let\TY@checkmin\TY@@checkmin - \else - \expandafter\xdef\csname TY@F\the\count@\endcsname{\the\dimen@}% - \advance\@tempdima\csname TY@F\the\count@\endcsname - \fi - \fi -Z \dimen@\csname TY@F\the\count@\endcsname\message{\the\dimen@, }% -\repeat -Z \message{^^JTotal:\the\@tempdima^^J}% -} -\let\TY@@checkmin\TY@checkmin -\newdimen\TY@linewidth -\def\tyformat{\everypar{{\nobreak\hskip\z@skip}}} -\newdimen\tymin -\tymin=10pt -\newdimen\tymax -\tymax=2\textwidth -\def\@testpach{\@chclass - \ifnum \@lastchclass=6 \@ne \@chnum \@ne \else - \ifnum \@lastchclass=7 5 \else - \ifnum \@lastchclass=8 \tw@ \else - \ifnum \@lastchclass=9 \thr@@ - \else \z@ - \ifnum \@lastchclass = 10 \else - \edef\@nextchar{\expandafter\string\@nextchar}% - \@chnum - \if \@nextchar c\z@ \else - \if \@nextchar l\@ne \else - \if \@nextchar r\tw@ \else - \if \@nextchar C7 \else - \if \@nextchar L8 \else - \if \@nextchar R9 \else - \if \@nextchar J10 \else - \z@ \@chclass - \if\@nextchar |\@ne \else - \if \@nextchar !6 \else - \if \@nextchar @7 \else - \if \@nextchar <8 \else - \if \@nextchar >9 \else - 10 - \@chnum - \if \@nextchar m\thr@@\else - \if \@nextchar p4 \else - \if \@nextchar b5 \else - \z@ \@chclass \z@ \@preamerr \z@ \fi \fi \fi \fi\fi \fi \fi\fi \fi - \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi} -\def\TY@classz{% - \@classx - \@tempcnta\count@ - \ifx\TY@box\TY@box@v - \global\advance\TY@count\@ne - \fi - \let\centering c% - \let\raggedright\noindent - \let\raggedleft\indent - \let\arraybackslash\relax - \prepnext@tok - \ifnum\@chnum<4 - \global\expandafter\let\csname TY@F\the\TY@count\endcsname\z@ - \fi - \ifnum\@chnum=6 - \global\expandafter\let\csname TY@F\the\TY@count\endcsname\z@ - \fi - \@addtopreamble{% - \ifcase\@chnum - \hfil \d@llarbegin\insert@column\d@llarend \hfil \or - \kern\z@ - \d@llarbegin \insert@column \d@llarend \hfil \or - \hfil\kern\z@ \d@llarbegin \insert@column \d@llarend \or - $\vcenter\@startpbox{\@nextchar}\insert@column \@endpbox $\or - \vtop \@startpbox{\@nextchar}\insert@column \@endpbox \or - \vbox \@startpbox{\@nextchar}\insert@column \@endpbox \or - \d@llarbegin \insert@column \d@llarend \or% dubious "s" case - \TY@box\centering\or - \TY@box\raggedright\or - \TY@box\raggedleft\or - \TY@box\relax - \fi}\prepnext@tok} -\def\TY@box#1{% - \ifx\centering#1% - \hfil \d@llarbegin\insert@column\d@llarend \hfil \else - \ifx\raggedright#1% - \kern\z@%<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - \d@llarbegin \insert@column \d@llarend \hfil \else - \ifx\raggedleft#1% - \hfil\kern\z@ \d@llarbegin \insert@column \d@llarend \else - \ifx\relax#1% - \d@llarbegin \insert@column \d@llarend - \fi \fi \fi \fi} -\def\TY@box@v#1{% - \vtop \@startpbox{\csname TY@F\the\TY@count\endcsname}% - #1\arraybackslash\tyformat - \insert@column\@endpbox} -\newdimen\TY@tablewidth -\def\Gscale@div#1#2#3{% - \setlength\dimen@{#3}% - \ifdim\dimen@=\z@ - \PackageError{graphics}{Division by 0}\@eha - \dimen@#2% - \fi - \edef\@tempd{\the\dimen@}% - \setlength\dimen@{#2}% - \count@65536\relax - \ifdim\dimen@<\z@ - \dimen@-\dimen@ - \count@-\count@ - \fi - \loop - \ifdim\dimen@<8192\p@ - \dimen@\tw@\dimen@ - \divide\count@\tw@ - \repeat - \dimen@ii=\@tempd\relax - \divide\dimen@ii\count@ - \divide\dimen@\dimen@ii - \edef#1{\strip@pt\dimen@}} -\long\def\TY@get@body#1\end - {\toks@\expandafter{\the\toks@#1}\TY@find@end} -\def\TY@find@end#1{% - \def\@tempa{#1}% - \ifx\@tempa\TY@\def\@tempa{\end{#1}}\expandafter\@tempa - \else\toks@\expandafter - {\the\toks@\end{#1}}\expandafter\TY@get@body\fi} -\def\TY@warn{% - \PackageWarning{tabulary}} -\catcode`\Z=11 -\AtBeginDocument{ -\@ifpackageloaded{colortbl}{% -\expandafter\def\expandafter\@mkpream\expandafter#\expandafter1% - \expandafter{% - \expandafter\let\expandafter\CT@setup\expandafter\relax - \expandafter\let\expandafter\CT@color\expandafter\relax - \expandafter\let\expandafter\CT@do@color\expandafter\relax - \expandafter\let\expandafter\color\expandafter\relax - \expandafter\let\expandafter\CT@column@color\expandafter\relax - \expandafter\let\expandafter\CT@row@color\expandafter\relax - \@mkpream{#1}} -\let\TY@@mkpream\@mkpream -\def\TY@classz{% - \@classx - \@tempcnta\count@ - \ifx\TY@box\TY@box@v - \global\advance\TY@count\@ne - \fi - \let\centering c% - \let\raggedright\noindent - \let\raggedleft\indent - \let\arraybackslash\relax - \prepnext@tok -\expandafter\CT@extract\the\toks\@tempcnta\columncolor!\@nil - \ifnum\@chnum<4 - \global\expandafter\let\csname TY@F\the\TY@count\endcsname\z@ - \fi - \ifnum\@chnum=6 - \global\expandafter\let\csname TY@F\the\TY@count\endcsname\z@ - \fi - \@addtopreamble{% - \setbox\z@\hbox\bgroup\bgroup - \ifcase\@chnum - \hskip\stretch{.5}\kern\z@ - \d@llarbegin\insert@column\d@llarend\hskip\stretch{.5}\or - \kern\z@%<<<<<<<<<<<<<<<<<<<<<<<<<<< - \d@llarbegin \insert@column \d@llarend \hfill \or - \hfill\kern\z@ \d@llarbegin \insert@column \d@llarend \or - $\vcenter\@startpbox{\@nextchar}\insert@column \@endpbox $\or - \vtop \@startpbox{\@nextchar}\insert@column \@endpbox \or - \vbox \@startpbox{\@nextchar}\insert@column \@endpbox \or - \d@llarbegin \insert@column \d@llarend \or% dubious s case - \TY@box\centering\or - \TY@box\raggedright\or - \TY@box\raggedleft\or - \TY@box\relax - \fi - \egroup\egroup -\begingroup - \CT@setup - \CT@column@color - \CT@row@color - \CT@do@color -\endgroup - \@tempdima\ht\z@ - \advance\@tempdima\minrowclearance - \vrule\@height\@tempdima\@width\z@ -\unhbox\z@ -}\prepnext@tok}% - \def\TY@arrayrule{% - \TY@subwidth\arrayrulewidth - \@addtopreamble{{\CT@arc@\vline}}}% - \def\TY@classvi{\ifcase \@lastchclass - \@acol \or - \TY@subwidth\doublerulesep - \ifx\CT@drsc@\relax - \@addtopreamble{\hskip\doublerulesep}% - \else - \@addtopreamble{{\CT@drsc@\vrule\@width\doublerulesep}}% - \fi\or - \@acol \or - \@classvii - \fi}% -}{% -\let\CT@start\relax -} -} -{\uccode`\*=`\ % -\uppercase{\gdef\TX@verb{% - \leavevmode\null\TX@vwarn - {\ifnum0=`}\fi\ttfamily\let\\\ignorespaces - \@ifstar{\let~*\TX@vb}{\TX@vb}}}} -\def\TX@vb#1{\def\@tempa##1#1{\toks@{##1}\edef\@tempa{\the\toks@}% - \expandafter\TX@v\meaning\@tempa\\ \\\ifnum0=`{\fi}}\@tempa!} -\def\TX@v#1!{\afterassignment\TX@vfirst\let\@tempa= } -\begingroup -\catcode`\*=\catcode`\# -\catcode`\#=12 -\gdef\TX@vfirst{% - \if\@tempa#% - \def\@tempb{\TX@v@#}% - \else - \let\@tempb\TX@v@ - \if\@tempa\space~\else\@tempa\fi - \fi - \@tempb} -\gdef\TX@v@*1 *2{% - \TX@v@hash*1##\relax\if*2\\\else~\expandafter\TX@v@\fi*2} -\gdef\TX@v@hash*1##*2{*1\ifx*2\relax\else#\expandafter\TX@v@hash\fi*2} -\endgroup -\def\TX@vwarn{% - \@warning{\noexpand\verb may be unreliable inside tabularx/y}% - \global\let\TX@vwarn\@empty} -\endinput -%% -%% End of file `tabulary.sty'. diff --git a/develop/_Sphinx/doc/make.bat b/develop/_Sphinx/doc/make.bat index 0160e79..a013e8e 100755 --- a/develop/_Sphinx/doc/make.bat +++ b/develop/_Sphinx/doc/make.bat @@ -1,242 +1,242 @@ -@ECHO OFF - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set BUILDDIR=.build -set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . -set I18NSPHINXOPTS=%SPHINXOPTS% . -if NOT "%PAPER%" == "" ( - set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% - set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% -) - -if "%1" == "" goto help - -if "%1" == "help" ( - :help - echo.Please use `make ^` where ^ is one of - echo. html to make standalone HTML files - echo. dirhtml to make HTML files named index.html in directories - echo. singlehtml to make a single large HTML file - echo. pickle to make pickle files - echo. json to make JSON files - echo. htmlhelp to make HTML files and a HTML help project - echo. qthelp to make HTML files and a qthelp project - echo. devhelp to make HTML files and a Devhelp project - echo. epub to make an epub - echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter - echo. text to make text files - echo. man to make manual pages - echo. texinfo to make Texinfo files - echo. gettext to make PO message catalogs - echo. changes to make an overview over all changed/added/deprecated items - echo. xml to make Docutils-native XML files - echo. pseudoxml to make pseudoxml-XML files for display purposes - echo. linkcheck to check all external links for integrity - echo. doctest to run all doctests embedded in the documentation if enabled - goto end -) - -if "%1" == "clean" ( - for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i - del /q /s %BUILDDIR%\* - goto end -) - - -%SPHINXBUILD% 2> nul -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ - exit /b 1 -) - -if "%1" == "html" ( - %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/html. - goto end -) - -if "%1" == "dirhtml" ( - %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. - goto end -) - -if "%1" == "singlehtml" ( - %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. - goto end -) - -if "%1" == "pickle" ( - %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can process the pickle files. - goto end -) - -if "%1" == "json" ( - %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can process the JSON files. - goto end -) - -if "%1" == "htmlhelp" ( - %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can run HTML Help Workshop with the ^ -.hhp project file in %BUILDDIR%/htmlhelp. - goto end -) - -if "%1" == "qthelp" ( - %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can run "qcollectiongenerator" with the ^ -.qhcp project file in %BUILDDIR%/qthelp, like this: - echo.^> qcollectiongenerator %BUILDDIR%\qthelp\ELMtoolbox.qhcp - echo.To view the help file: - echo.^> assistant -collectionFile %BUILDDIR%\qthelp\ELMtoolbox.ghc - goto end -) - -if "%1" == "devhelp" ( - %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. - goto end -) - -if "%1" == "epub" ( - %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The epub file is in %BUILDDIR%/epub. - goto end -) - -if "%1" == "latex" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "latexpdf" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - cd %BUILDDIR%/latex - make all-pdf - cd %BUILDDIR%/.. - echo. - echo.Build finished; the PDF files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "latexpdfja" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - cd %BUILDDIR%/latex - make all-pdf-ja - cd %BUILDDIR%/.. - echo. - echo.Build finished; the PDF files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "text" ( - %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The text files are in %BUILDDIR%/text. - goto end -) - -if "%1" == "man" ( - %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The manual pages are in %BUILDDIR%/man. - goto end -) - -if "%1" == "texinfo" ( - %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. - goto end -) - -if "%1" == "gettext" ( - %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The message catalogs are in %BUILDDIR%/locale. - goto end -) - -if "%1" == "changes" ( - %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes - if errorlevel 1 exit /b 1 - echo. - echo.The overview file is in %BUILDDIR%/changes. - goto end -) - -if "%1" == "linkcheck" ( - %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck - if errorlevel 1 exit /b 1 - echo. - echo.Link check complete; look for any errors in the above output ^ -or in %BUILDDIR%/linkcheck/output.txt. - goto end -) - -if "%1" == "doctest" ( - %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest - if errorlevel 1 exit /b 1 - echo. - echo.Testing of doctests in the sources finished, look at the ^ -results in %BUILDDIR%/doctest/output.txt. - goto end -) - -if "%1" == "xml" ( - %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The XML files are in %BUILDDIR%/xml. - goto end -) - -if "%1" == "pseudoxml" ( - %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. - goto end -) - -:end +@ECHO OFF + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set BUILDDIR=.build +set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . +set I18NSPHINXOPTS=%SPHINXOPTS% . +if NOT "%PAPER%" == "" ( + set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% + set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% +) + +if "%1" == "" goto help + +if "%1" == "help" ( + :help + echo.Please use `make ^` where ^ is one of + echo. html to make standalone HTML files + echo. dirhtml to make HTML files named index.html in directories + echo. singlehtml to make a single large HTML file + echo. pickle to make pickle files + echo. json to make JSON files + echo. htmlhelp to make HTML files and a HTML help project + echo. qthelp to make HTML files and a qthelp project + echo. devhelp to make HTML files and a Devhelp project + echo. epub to make an epub + echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter + echo. text to make text files + echo. man to make manual pages + echo. texinfo to make Texinfo files + echo. gettext to make PO message catalogs + echo. changes to make an overview over all changed/added/deprecated items + echo. xml to make Docutils-native XML files + echo. pseudoxml to make pseudoxml-XML files for display purposes + echo. linkcheck to check all external links for integrity + echo. doctest to run all doctests embedded in the documentation if enabled + goto end +) + +if "%1" == "clean" ( + for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i + del /q /s %BUILDDIR%\* + goto end +) + + +%SPHINXBUILD% 2> nul +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "html" ( + %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/html. + goto end +) + +if "%1" == "dirhtml" ( + %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. + goto end +) + +if "%1" == "singlehtml" ( + %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. + goto end +) + +if "%1" == "pickle" ( + %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can process the pickle files. + goto end +) + +if "%1" == "json" ( + %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can process the JSON files. + goto end +) + +if "%1" == "htmlhelp" ( + %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can run HTML Help Workshop with the ^ +.hhp project file in %BUILDDIR%/htmlhelp. + goto end +) + +if "%1" == "qthelp" ( + %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can run "qcollectiongenerator" with the ^ +.qhcp project file in %BUILDDIR%/qthelp, like this: + echo.^> qcollectiongenerator %BUILDDIR%\qthelp\ELMtoolbox.qhcp + echo.To view the help file: + echo.^> assistant -collectionFile %BUILDDIR%\qthelp\ELMtoolbox.ghc + goto end +) + +if "%1" == "devhelp" ( + %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. + goto end +) + +if "%1" == "epub" ( + %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The epub file is in %BUILDDIR%/epub. + goto end +) + +if "%1" == "latex" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "latexpdf" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + cd %BUILDDIR%/latex + make all-pdf + cd %BUILDDIR%/.. + echo. + echo.Build finished; the PDF files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "latexpdfja" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + cd %BUILDDIR%/latex + make all-pdf-ja + cd %BUILDDIR%/.. + echo. + echo.Build finished; the PDF files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "text" ( + %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The text files are in %BUILDDIR%/text. + goto end +) + +if "%1" == "man" ( + %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The manual pages are in %BUILDDIR%/man. + goto end +) + +if "%1" == "texinfo" ( + %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. + goto end +) + +if "%1" == "gettext" ( + %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The message catalogs are in %BUILDDIR%/locale. + goto end +) + +if "%1" == "changes" ( + %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes + if errorlevel 1 exit /b 1 + echo. + echo.The overview file is in %BUILDDIR%/changes. + goto end +) + +if "%1" == "linkcheck" ( + %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck + if errorlevel 1 exit /b 1 + echo. + echo.Link check complete; look for any errors in the above output ^ +or in %BUILDDIR%/linkcheck/output.txt. + goto end +) + +if "%1" == "doctest" ( + %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest + if errorlevel 1 exit /b 1 + echo. + echo.Testing of doctests in the sources finished, look at the ^ +results in %BUILDDIR%/doctest/output.txt. + goto end +) + +if "%1" == "xml" ( + %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The XML files are in %BUILDDIR%/xml. + goto end +) + +if "%1" == "pseudoxml" ( + %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. + goto end +) + +:end diff --git a/develop_HtH/idea.txt b/develop_HtH/idea.txt index dbc9352..9f43e60 100644 --- a/develop_HtH/idea.txt +++ b/develop_HtH/idea.txt @@ -1,77 +1,77 @@ -The information in ELM is presented in a form of (H'H + H'T) matrices. They are the same -size nn*nn for any amount of data - from one sample to a billion of samples. More samples -provide a more accurate estimation of H'H, but the size stays the same. - -A global H'H matrix is a sum of H1'H1 + H2'H2 + ... -That means for classification, we can consider a separate H'H[c0], H'H[c1], ... class -matrices. Then the problem of unbalanced dataset is solved easily by - - -Two best variables of IRIS (nn, acc over 100 * 10x c-v) -Best: vars 2 and 3, nn=7 -0 1 -3 70.9+-2.6 -4 74.9+-1.7 -5 76.3+-1.1 -6 77.2+-1.1 -7 77.5+-1.1 -8 77.9+-1.0 -9 77.9+-0.9 -10 78.2+-1.0 -11 78.1+-0.9 -12 78.1+-0.9 -0 2 -3 76.0+-2.5 -4 82.7+-2.2 -5 86.9+-2.1 -6 90.3+-1.7 -7 91.8+-1.6 -8 93.4+-1.1 -9 94.0+-0.8 -10 94.2+-0.8 -11 94.5+-0.6 -12 94.5+-0.5 -0 3 -3 74.7+-2.8 -4 83.4+-2.6 -5 87.7+-2.1 -6 90.8+-1.5 -7 92.0+-1.5 -8 93.4+-1.0 -9 94.2+-0.9 -10 94.3+-0.7 -11 94.6+-0.7 -12 94.6+-0.6 -1 2 -3 76.8+-2.7 -4 83.1+-2.1 -5 86.1+-1.8 -6 88.5+-1.8 -7 89.8+-1.5 -8 91.1+-1.3 -9 91.7+-1.1 -10 92.5+-1.1 -11 92.7+-1.0 -12 93.3+-0.8 -1 3 -3 80.5+-3.0 -4 86.3+-2.0 -5 89.2+-1.8 -6 91.2+-1.5 -7 92.5+-1.4 -8 93.7+-1.0 -9 94.3+-0.7 -10 94.4+-0.8 -11 94.7+-0.6 -12 94.6+-0.6 -2 3 -3 84.9+-2.9 -4 91.6+-2.1 -5 94.1+-1.1 -6 95.1+-0.6 -7 95.5+-0.5 -8 95.6+-0.4 -9 95.6+-0.3 -10 95.7+-0.3 -11 95.8+-0.3 +The information in ELM is presented in a form of (H'H + H'T) matrices. They are the same +size nn*nn for any amount of data - from one sample to a billion of samples. More samples +provide a more accurate estimation of H'H, but the size stays the same. + +A global H'H matrix is a sum of H1'H1 + H2'H2 + ... +That means for classification, we can consider a separate H'H[c0], H'H[c1], ... class +matrices. Then the problem of unbalanced dataset is solved easily by + + +Two best variables of IRIS (nn, acc over 100 * 10x c-v) +Best: vars 2 and 3, nn=7 +0 1 +3 70.9+-2.6 +4 74.9+-1.7 +5 76.3+-1.1 +6 77.2+-1.1 +7 77.5+-1.1 +8 77.9+-1.0 +9 77.9+-0.9 +10 78.2+-1.0 +11 78.1+-0.9 +12 78.1+-0.9 +0 2 +3 76.0+-2.5 +4 82.7+-2.2 +5 86.9+-2.1 +6 90.3+-1.7 +7 91.8+-1.6 +8 93.4+-1.1 +9 94.0+-0.8 +10 94.2+-0.8 +11 94.5+-0.6 +12 94.5+-0.5 +0 3 +3 74.7+-2.8 +4 83.4+-2.6 +5 87.7+-2.1 +6 90.8+-1.5 +7 92.0+-1.5 +8 93.4+-1.0 +9 94.2+-0.9 +10 94.3+-0.7 +11 94.6+-0.7 +12 94.6+-0.6 +1 2 +3 76.8+-2.7 +4 83.1+-2.1 +5 86.1+-1.8 +6 88.5+-1.8 +7 89.8+-1.5 +8 91.1+-1.3 +9 91.7+-1.1 +10 92.5+-1.1 +11 92.7+-1.0 +12 93.3+-0.8 +1 3 +3 80.5+-3.0 +4 86.3+-2.0 +5 89.2+-1.8 +6 91.2+-1.5 +7 92.5+-1.4 +8 93.7+-1.0 +9 94.3+-0.7 +10 94.4+-0.8 +11 94.7+-0.6 +12 94.6+-0.6 +2 3 +3 84.9+-2.9 +4 91.6+-2.1 +5 94.1+-1.1 +6 95.1+-0.6 +7 95.5+-0.5 +8 95.6+-0.4 +9 95.6+-0.3 +10 95.7+-0.3 +11 95.8+-0.3 12 95.7+-0.3 \ No newline at end of file diff --git a/develop_HtH/over_sampling.py b/develop_HtH/over_sampling.py index 40968b5..f2eada5 100644 --- a/develop_HtH/over_sampling.py +++ b/develop_HtH/over_sampling.py @@ -1,247 +1,247 @@ -# -*- coding: utf-8 -*- -""" -Created on Fri Feb 27 05:16:53 2015 - -@author: Anton -""" - -import numpy as np -import numexpr as ne -import os -from matplotlib import pyplot as plt - - -class elm(object): - - def __init__(self): - self.sigm = lambda a: ne.evaluate("1/(1+exp(-a))") - - - def train(self, X, T, nn, idx): - n,d = X.shape - np.random.seed() - W = np.random.randn(d, nn) * 3**0.5 - bias = np.random.randn(nn) - self.W = W - self.bias = bias - - H = np.dot(X,W) + bias # random projection - H = self.sigm(H) # non-linear transformation - #self.B = np.dot(np.linalg.pinv(H), T) # linear regression - - ################################################## - - - H1 = H[T[:,0]==1] - T1 = T[T[:,0]==1] - HH1 = np.dot(H1.T, H1) + 1E-6*np.eye(H1.shape[1]) - HT1 = np.dot(H1.T, T1) - - #H2 = H[T[:,1]==1] - #T2 = T[T[:,1]==1] - H2 = H[idx] - T2 = T[idx] - HH2 = np.dot(H2.T, H2) + 1E-6*np.eye(H2.shape[1]) - HT2 = np.dot(H2.T, T2) - - """ - ### RESAMPLING - Nsampl = H2.shape[0] - s = (np.std(X[T[:,0]==1], axis=0) + np.std(X[idx], axis=0) + np.std(X[T[:,2]==1], axis=0)) / 3 - Nres = (np.sum(T[:,0]==1) + np.sum(T[:,2]==1)) / 2 - Xres = np.zeros((Nres, d)) - for i in xrange(Nres): - sampl = X[idx][np.random.randint(Nsampl)] - Xres[i] = sampl + np.random.randn(1,d)*s - H2res = np.dot(Xres,W) + bias - H2res = self.sigm(H2res) - T2res = np.tile(T2[0], (Nres,1)) - H2 = np.vstack((H2, H2res)) - T2 = np.vstack((T2, T2res)) - HH2 = np.dot(H2.T, H2) + 1E-6*np.eye(H2.shape[1]) - HT2 = np.dot(H2.T, T2) - #""" - Xres=np.zeros((3,2)) - - - H3 = H[T[:,2]==1] - T3 = T[T[:,2]==1] - HH3 = np.dot(H3.T, H3) + 1E-6*np.eye(H3.shape[1]) - HT3 = np.dot(H3.T, T3) - - N = n*1.0 - k = np.array([1, 1, 1], dtype=np.float64) - k = np.array([N/H1.shape[0], N/H2.shape[0], N/H3.shape[0]]).astype(np.float64) - k = k / np.sum(k) - HH = k[0]*HH1 + k[1]*HH2 + k[2]*HH3 - HT = k[0]*HT1 + k[1]*HT2 + k[2]*HT3 - - - ################################################## - - #HH = H.T.dot(H) + 1E-6*np.eye(H.shape[1]) - #HT = H.T.dot(T) - self.B = np.linalg.lstsq(HH, HT)[0] - return Xres - - - - - def run(self, X): - H = np.dot(X, self.W) + self.bias - H = self.sigm(H) - return np.dot(H, self.B) - - - -def code(nn): - folder = 'Classification-Iris' - folder = os.path.join(os.path.dirname(__file__), "../datasets", folder) - acc = np.zeros((10,)) - for i in range(10): # 10-fold cross-validation - # get file names - Xtr = np.load(os.path.join(folder, "xtrain_%d.npy" % (i + 1))) - Xts = np.load(os.path.join(folder, "xtest_%d.npy" % (i + 1))) - Ytr = np.load(os.path.join(folder, "ytrain_%d.npy" % (i + 1))) - Yts = np.load(os.path.join(folder, "ytest_%d.npy" % (i + 1))) - # train ELM - Xtr = Xtr[:,2:] - Xts = Xts[:,2:] - Ytr = np.hstack((Ytr[:,:2], Ytr[:,3][:,None])) - Yts = np.hstack((Yts[:,:2], Yts[:,3][:,None])) - - e = elm() - e.train(Xtr, Ytr, nn) - Yh = e.run(Xts) - - # evaluate classification results - Yts = np.argmax(Yts, 1) - Yh = np.argmax(Yh, 1) - acc[i] = float(np.sum(Yh == Yts)) / Yts.shape[0] - return acc - - -def code_show(nn, i): - folder = 'Classification-Iris' - folder = os.path.join(os.path.dirname(__file__), "../datasets", folder) - acc = np.zeros((10,)) - # get file names - Xtr = np.load(os.path.join(folder, "xtrain_%d.npy" % (i + 1))) - Xts = np.load(os.path.join(folder, "xtest_%d.npy" % (i + 1))) - Ytr = np.load(os.path.join(folder, "ytrain_%d.npy" % (i + 1))) - Yts = np.load(os.path.join(folder, "ytest_%d.npy" % (i + 1))) - # train ELM - #Xtr = Xtr[:,2:] - #Xts = Xts[:,2:] - i1 = 0 - i2 = 3 - Xtr = np.vstack((Xtr[:,i1], Xtr[:,i2])).T - Xts = np.vstack((Xts[:,i1], Xts[:,i2])).T - - Ytr = np.hstack((Ytr[:,:2], Ytr[:,3][:,None])) - Yts = np.hstack((Yts[:,:2], Yts[:,3][:,None])) - - #print '1' - #print Xtr[Ytr[:,0]==1].std(axis=0)**2 - #print Xtr[Ytr[:,1]==1].std(axis=0)**2 - - - # prepare mesh grid - x = np.arange(-2.5, 2.5, 0.1) - y = np.arange(-2.5, 2.5, 0.1) - n = x.shape[0] - xm, ym = np.meshgrid(x, y) - D = np.vstack((xm.ravel(), ym.ravel())).T - - # reduce number of samples of one class - N2 = 2 - idx = np.where(Ytr[:,1]==1)[0] - np.random.shuffle(idx) - idx = idx[:N2] - idx = np.array([21, 76]) - print idx - - # average over many runs - Z = [] - acc = [] - for _ in range(1): - - e = elm() - Xres = e.train(Xtr, Ytr, nn, idx) - - # evaluate classification results - Yh = e.run(Xts) - Yts1 = np.argmax(Yts, 1) - Yh1 = np.argmax(Yh, 1) - acc.append(float(np.sum(Yh1 == Yts1)) / Yts1.shape[0]) - - # show plot - Z.append(e.run(D)) - - Z = np.array(Z).mean(0) - print "acc:", np.mean(acc) - - I = Z.copy() - Z[Z<0] = 0 - I[I<0] = 0 - I = I.reshape(n,n,3) - I = I / I.max(axis=2)[:,:,None] - - I = I[::-1, :, :] - - - plt.imshow(I, extent=[-2.5, 2.5, -2.5, 2.5]) - #cl = 1 - #plt.contour(xm, ym, Z[:,cl].reshape(n,n), colors='k') - #plt.contourf(xm, ym, Z[:,cl].reshape(n,n), cmap=plt.cm.bone) - #plt.scatter(D[:,0], D[:,1], s=Z[:,0]) - - #Xa = np.vstack((Xtr, Xts)) - #Ya = np.vstack((Ytr, Yts)) - #plt.scatter(Xa[:,0], Xa[:,1], c=Ya) - #plt.scatter(Xtr[:,0], Xtr[:,1], c=Ytr) - plt.scatter(Xtr[Ytr[:,0]==1,0], Xtr[Ytr[:,0]==1,1], c=Ytr[Ytr[:,0]==1]) - plt.scatter(Xtr[idx,0], Xtr[idx,1], c=Ytr[idx]) - plt.scatter(Xres[:,0], Xres[:,1], c=Ytr[idx[0]]) - plt.scatter(Xtr[Ytr[:,2]==1,0], Xtr[Ytr[:,2]==1,1], c=Ytr[Ytr[:,2]==1]) - plt.show() - - - - - -if __name__ == "__main__": - nn = 7 - #m = [] - #for _ in range(100): - # acc = code(nn) - # m.append(np.mean(acc)) - #m = np.array(m)*100 - #print "%.1f+-%.1f" % (np.mean(m), np.std(m)) - - code_show(nn, 0) - - - - - - - - - - - - - - - - - - - - - - - - - +# -*- coding: utf-8 -*- +""" +Created on Fri Feb 27 05:16:53 2015 + +@author: Anton +""" + +import numpy as np +import numexpr as ne +import os +from matplotlib import pyplot as plt + + +class elm(object): + + def __init__(self): + self.sigm = lambda a: ne.evaluate("1/(1+exp(-a))") + + + def train(self, X, T, nn, idx): + n,d = X.shape + np.random.seed() + W = np.random.randn(d, nn) * 3**0.5 + bias = np.random.randn(nn) + self.W = W + self.bias = bias + + H = np.dot(X,W) + bias # random projection + H = self.sigm(H) # non-linear transformation + #self.B = np.dot(np.linalg.pinv(H), T) # linear regression + + ################################################## + + + H1 = H[T[:,0]==1] + T1 = T[T[:,0]==1] + HH1 = np.dot(H1.T, H1) + 1E-6*np.eye(H1.shape[1]) + HT1 = np.dot(H1.T, T1) + + #H2 = H[T[:,1]==1] + #T2 = T[T[:,1]==1] + H2 = H[idx] + T2 = T[idx] + HH2 = np.dot(H2.T, H2) + 1E-6*np.eye(H2.shape[1]) + HT2 = np.dot(H2.T, T2) + + """ + ### RESAMPLING + Nsampl = H2.shape[0] + s = (np.std(X[T[:,0]==1], axis=0) + np.std(X[idx], axis=0) + np.std(X[T[:,2]==1], axis=0)) / 3 + Nres = (np.sum(T[:,0]==1) + np.sum(T[:,2]==1)) / 2 + Xres = np.zeros((Nres, d)) + for i in xrange(Nres): + sampl = X[idx][np.random.randint(Nsampl)] + Xres[i] = sampl + np.random.randn(1,d)*s + H2res = np.dot(Xres,W) + bias + H2res = self.sigm(H2res) + T2res = np.tile(T2[0], (Nres,1)) + H2 = np.vstack((H2, H2res)) + T2 = np.vstack((T2, T2res)) + HH2 = np.dot(H2.T, H2) + 1E-6*np.eye(H2.shape[1]) + HT2 = np.dot(H2.T, T2) + #""" + Xres=np.zeros((3,2)) + + + H3 = H[T[:,2]==1] + T3 = T[T[:,2]==1] + HH3 = np.dot(H3.T, H3) + 1E-6*np.eye(H3.shape[1]) + HT3 = np.dot(H3.T, T3) + + N = n*1.0 + k = np.array([1, 1, 1], dtype=np.float64) + k = np.array([N/H1.shape[0], N/H2.shape[0], N/H3.shape[0]]).astype(np.float64) + k = k / np.sum(k) + HH = k[0]*HH1 + k[1]*HH2 + k[2]*HH3 + HT = k[0]*HT1 + k[1]*HT2 + k[2]*HT3 + + + ################################################## + + #HH = H.T.dot(H) + 1E-6*np.eye(H.shape[1]) + #HT = H.T.dot(T) + self.B = np.linalg.lstsq(HH, HT)[0] + return Xres + + + + + def run(self, X): + H = np.dot(X, self.W) + self.bias + H = self.sigm(H) + return np.dot(H, self.B) + + + +def code(nn): + folder = 'Classification-Iris' + folder = os.path.join(os.path.dirname(__file__), "../datasets", folder) + acc = np.zeros((10,)) + for i in range(10): # 10-fold cross-validation + # get file names + Xtr = np.load(os.path.join(folder, "xtrain_%d.npy" % (i + 1))) + Xts = np.load(os.path.join(folder, "xtest_%d.npy" % (i + 1))) + Ytr = np.load(os.path.join(folder, "ytrain_%d.npy" % (i + 1))) + Yts = np.load(os.path.join(folder, "ytest_%d.npy" % (i + 1))) + # train ELM + Xtr = Xtr[:,2:] + Xts = Xts[:,2:] + Ytr = np.hstack((Ytr[:,:2], Ytr[:,3][:,None])) + Yts = np.hstack((Yts[:,:2], Yts[:,3][:,None])) + + e = elm() + e.train(Xtr, Ytr, nn) + Yh = e.run(Xts) + + # evaluate classification results + Yts = np.argmax(Yts, 1) + Yh = np.argmax(Yh, 1) + acc[i] = float(np.sum(Yh == Yts)) / Yts.shape[0] + return acc + + +def code_show(nn, i): + folder = 'Classification-Iris' + folder = os.path.join(os.path.dirname(__file__), "../datasets", folder) + acc = np.zeros((10,)) + # get file names + Xtr = np.load(os.path.join(folder, "xtrain_%d.npy" % (i + 1))) + Xts = np.load(os.path.join(folder, "xtest_%d.npy" % (i + 1))) + Ytr = np.load(os.path.join(folder, "ytrain_%d.npy" % (i + 1))) + Yts = np.load(os.path.join(folder, "ytest_%d.npy" % (i + 1))) + # train ELM + #Xtr = Xtr[:,2:] + #Xts = Xts[:,2:] + i1 = 0 + i2 = 3 + Xtr = np.vstack((Xtr[:,i1], Xtr[:,i2])).T + Xts = np.vstack((Xts[:,i1], Xts[:,i2])).T + + Ytr = np.hstack((Ytr[:,:2], Ytr[:,3][:,None])) + Yts = np.hstack((Yts[:,:2], Yts[:,3][:,None])) + + #print '1' + #print Xtr[Ytr[:,0]==1].std(axis=0)**2 + #print Xtr[Ytr[:,1]==1].std(axis=0)**2 + + + # prepare mesh grid + x = np.arange(-2.5, 2.5, 0.1) + y = np.arange(-2.5, 2.5, 0.1) + n = x.shape[0] + xm, ym = np.meshgrid(x, y) + D = np.vstack((xm.ravel(), ym.ravel())).T + + # reduce number of samples of one class + N2 = 2 + idx = np.where(Ytr[:,1]==1)[0] + np.random.shuffle(idx) + idx = idx[:N2] + idx = np.array([21, 76]) + print idx + + # average over many runs + Z = [] + acc = [] + for _ in range(1): + + e = elm() + Xres = e.train(Xtr, Ytr, nn, idx) + + # evaluate classification results + Yh = e.run(Xts) + Yts1 = np.argmax(Yts, 1) + Yh1 = np.argmax(Yh, 1) + acc.append(float(np.sum(Yh1 == Yts1)) / Yts1.shape[0]) + + # show plot + Z.append(e.run(D)) + + Z = np.array(Z).mean(0) + print "acc:", np.mean(acc) + + I = Z.copy() + Z[Z<0] = 0 + I[I<0] = 0 + I = I.reshape(n,n,3) + I = I / I.max(axis=2)[:,:,None] + + I = I[::-1, :, :] + + + plt.imshow(I, extent=[-2.5, 2.5, -2.5, 2.5]) + #cl = 1 + #plt.contour(xm, ym, Z[:,cl].reshape(n,n), colors='k') + #plt.contourf(xm, ym, Z[:,cl].reshape(n,n), cmap=plt.cm.bone) + #plt.scatter(D[:,0], D[:,1], s=Z[:,0]) + + #Xa = np.vstack((Xtr, Xts)) + #Ya = np.vstack((Ytr, Yts)) + #plt.scatter(Xa[:,0], Xa[:,1], c=Ya) + #plt.scatter(Xtr[:,0], Xtr[:,1], c=Ytr) + plt.scatter(Xtr[Ytr[:,0]==1,0], Xtr[Ytr[:,0]==1,1], c=Ytr[Ytr[:,0]==1]) + plt.scatter(Xtr[idx,0], Xtr[idx,1], c=Ytr[idx]) + plt.scatter(Xres[:,0], Xres[:,1], c=Ytr[idx[0]]) + plt.scatter(Xtr[Ytr[:,2]==1,0], Xtr[Ytr[:,2]==1,1], c=Ytr[Ytr[:,2]==1]) + plt.show() + + + + + +if __name__ == "__main__": + nn = 7 + #m = [] + #for _ in range(100): + # acc = code(nn) + # m.append(np.mean(acc)) + #m = np.array(m)*100 + #print "%.1f+-%.1f" % (np.mean(m), np.std(m)) + + code_show(nn, 0) + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/develop_HtH/singlesample.py b/develop_HtH/singlesample.py index adbcf72..6fcce6f 100644 --- a/develop_HtH/singlesample.py +++ b/develop_HtH/singlesample.py @@ -1,283 +1,283 @@ -# -*- coding: utf-8 -*- -""" -Created on Fri Feb 27 05:16:53 2015 - -@author: Anton -""" - -import numpy as np -from scipy.spatial.distance import cdist -import numexpr as ne -import os -from matplotlib import pyplot as plt - - -class elm(object): - - def __init__(self): - self.sigm = lambda a: ne.evaluate("1/(1+exp(-a))") - - - def train(self, X, T, nn, idx): - n,d = X.shape - np.random.seed() - W = np.random.randn(d, nn) * 3**0.5 - bias = np.random.randn(nn) - self.W = W - self.bias = bias - - - H = np.dot(X,W) + bias # random projection - H = self.sigm(H) # non-linear transformation - #self.B = np.dot(np.linalg.pinv(H), T) # linear regression - - ################################################## - - - Hneg = H[T[:,3]==1] - Tneg = T[T[:,3]==1] - HHneg = np.dot(Hneg.T, Hneg) + 1E-6*np.eye(Hneg.shape[1]) - HTneg = np.dot(Hneg.T, Tneg) - - H1 = H[T[:,0]==1] - T1 = T[T[:,0]==1] - HH1 = np.dot(H1.T, H1) + 1E-6*np.eye(H1.shape[1]) - HT1 = np.dot(H1.T, T1) - - H2 = H[T[:,1]==1] - T2 = T[T[:,1]==1] - #H2 = H[idx] - #T2 = T[idx] - HH2 = np.dot(H2.T, H2) + 1E-6*np.eye(H2.shape[1]) - HT2 = np.dot(H2.T, T2) - - """ - ### RESAMPLING - Nsampl = H2.shape[0] - s = (np.std(X[T[:,0]==1], axis=0) + np.std(X[idx], axis=0) + np.std(X[T[:,2]==1], axis=0)) / 3 - Nres = (np.sum(T[:,0]==1) + np.sum(T[:,2]==1)) / 2 - Xres = np.zeros((Nres, d)) - for i in xrange(Nres): - sampl = X[idx][np.random.randint(Nsampl)] - Xres[i] = sampl + np.random.randn(1,d)*s - H2res = np.dot(Xres,W) + bias - H2res = self.sigm(H2res) - T2res = np.tile(T2[0], (Nres,1)) - H2 = np.vstack((H2, H2res)) - T2 = np.vstack((T2, T2res)) - HH2 = np.dot(H2.T, H2) + 1E-6*np.eye(H2.shape[1]) - HT2 = np.dot(H2.T, T2) - #""" - #Xres=np.zeros((3,2)) - - - H3 = H[T[:,2]==1] - T3 = T[T[:,2]==1] - HH3 = np.dot(H3.T, H3) + 1E-6*np.eye(H3.shape[1]) - HT3 = np.dot(H3.T, T3) - - - N = n*1.0 - #k = np.array([1, 1, 1, 1], dtype=np.float64) - k = np.array([N/H1.shape[0], N/H2.shape[0], N/H3.shape[0]]).astype(np.float64) - k = k / np.sum(k) - HH = k[0]*HH1 + k[1]*HH2 + k[2]*HH3 + 0.01*HHneg - HT = k[0]*HT1 + k[1]*HT2 + k[2]*HT3 + 0.01*HTneg - - - ################################################## - - #HH = H.T.dot(H) + 1E-6*np.eye(H.shape[1]) - #HT = H.T.dot(T) - self.B = np.linalg.lstsq(HH, HT)[0] - - - - - def run(self, X): - H = np.dot(X, self.W) + self.bias - H = self.sigm(H) - return np.dot(H, self.B) - - - -def code(nn): - folder = 'Classification-Iris' - folder = os.path.join(os.path.dirname(__file__), "../datasets", folder) - acc = np.zeros((10,)) - for i in range(10): # 10-fold cross-validation - # get file names - Xtr = np.load(os.path.join(folder, "xtrain_%d.npy" % (i + 1))) - Xts = np.load(os.path.join(folder, "xtest_%d.npy" % (i + 1))) - Ytr = np.load(os.path.join(folder, "ytrain_%d.npy" % (i + 1))) - Yts = np.load(os.path.join(folder, "ytest_%d.npy" % (i + 1))) - # train ELM - Xtr = Xtr[:,2:] - Xts = Xts[:,2:] - Ytr = np.hstack((Ytr[:,:2], Ytr[:,3][:,None])) - Yts = np.hstack((Yts[:,:2], Yts[:,3][:,None])) - - e = elm() - e.train(Xtr, Ytr, nn) - Yh = e.run(Xts) - - # evaluate classification results - Yts = np.argmax(Yts, 1) - Yh = np.argmax(Yh, 1) - acc[i] = float(np.sum(Yh == Yts)) / Yts.shape[0] - return acc - - -def code_show(nn, i): - folder = 'Classification-Iris' - folder = os.path.join(os.path.dirname(__file__), "../datasets", folder) - acc = np.zeros((10,)) - # get file names - Xtr = np.load(os.path.join(folder, "xtrain_%d.npy" % (i + 1))) - Xts = np.load(os.path.join(folder, "xtest_%d.npy" % (i + 1))) - Ytr = np.load(os.path.join(folder, "ytrain_%d.npy" % (i + 1))) - Yts = np.load(os.path.join(folder, "ytest_%d.npy" % (i + 1))) - # train ELM - #Xtr = Xtr[:,2:] - #Xts = Xts[:,2:] - i1 = 0 - i2 = 3 - Xtr = np.vstack((Xtr[:,i1], Xtr[:,i2])).T - Xts = np.vstack((Xts[:,i1], Xts[:,i2])).T - - Ytr = np.hstack((Ytr[:,:2], Ytr[:,3][:,None])) - Yts = np.hstack((Yts[:,:2], Yts[:,3][:,None])) - - #print '1' - #print Xtr[Ytr[:,0]==1].std(axis=0)**2 - #print Xtr[Ytr[:,1]==1].std(axis=0)**2 - - ############################################################ - ### NEGATIVE CLASS SAMPLES - n,d = Xtr.shape - Nneg = n*10 - Yneg = np.tile(np.array([[0,0,0,1]]), (Nneg,1)) - Xneg = np.zeros((Nneg, d)) - s = (np.std(Xtr[Ytr[:,0]==1]) + np.std(Xtr[Ytr[:,1]==1]) + np.std(Xtr[Ytr[:,2]==1])) / 3 - for i in xrange(Nneg): - sample = Xtr[np.random.randint(n)] + np.random.randn(1,2)*0.1 - Xneg[i] = sample - #while True: - #dist = cdist(sample, Xtr, "euclidean") - #if np.min(dist) > s: - #if np.sum(sample**2)**0.5 > 3: - # Xneg[i] = sample - # break - - Ytr = np.hstack((Ytr, np.zeros((n,1)))) - Ytr = np.vstack((Ytr, Yneg)) - Xtr = np.vstack((Xtr, Xneg)) - m2 = Xtr.mean(0) - s2 = Xtr.std(0) - #Xtr = (Xtr - m2) / s2 - - ############################################################ - - # prepare mesh grid - sz = 8 - x = np.arange(-sz, sz, 0.1) - y = np.arange(-sz, sz, 0.1) - n = x.shape[0] - xm, ym = np.meshgrid(x, y) - D = np.vstack((xm.ravel(), ym.ravel())).T - - # reduce number of samples of one class - N2 = 2 - idx = np.where(Ytr[:,1]==1)[0] - np.random.shuffle(idx) - idx = idx[:N2] - idx = np.array([21, 76]) - print idx - - # average over many runs - Z = [] - acc = [] - for _ in range(1000): - - e = elm() - e.train(Xtr, Ytr, nn, idx) - - # evaluate classification results - Yh = e.run(Xts) - Yts1 = np.argmax(Yts, 1) - Yh1 = np.argmax(Yh, 1) - acc.append(float(np.sum(Yh1 == Yts1)) / Yts1.shape[0]) - - # show plot - Z.append(e.run(D)) - - Z = np.array(Z).mean(0) - print "acc:", np.mean(acc) - - I = Z.copy() - Z[Z<0] = 0 - I[I<0] = 0 - I = I.reshape(n,n,4) - I = I / I.max(axis=2)[:,:,None] - - I = I[::-1, :, :3] - - - plt.imshow(I, extent=[-sz, sz, -sz, sz]) - plt.xlim([-sz, sz]) - plt.ylim([-sz, sz]) - #cl = 1 - #plt.contour(xm, ym, Z[:,cl].reshape(n,n), colors='k') - #plt.contourf(xm, ym, Z[:,cl].reshape(n,n), cmap=plt.cm.bone) - #plt.scatter(D[:,0], D[:,1], s=Z[:,0]) - - #Xa = np.vstack((Xtr, Xts)) - #Ya = np.vstack((Ytr, Yts)) - #plt.scatter(Xa[:,0], Xa[:,1], c=Ya) - #plt.scatter(Xtr[:,0], Xtr[:,1], c=Ytr) - plt.scatter(Xtr[Ytr[:,0]==1,0], Xtr[Ytr[:,0]==1,1], c=Ytr[Ytr[:,0]==1]) - plt.scatter(Xtr[Ytr[:,1]==1,0], Xtr[Ytr[:,1]==1,1], c=Ytr[Ytr[:,1]==1]) - #plt.scatter(Xtr[idx,0], Xtr[idx,1], c=Ytr[idx]) - plt.scatter(Xtr[Ytr[:,2]==1,0], Xtr[Ytr[:,2]==1,1], c=Ytr[Ytr[:,2]==1]) - plt.scatter(Xtr[Ytr[:,3]==1,0], Xtr[Ytr[:,3]==1,1], marker='+', c=[0,0,0]) - plt.show() - - - - - -if __name__ == "__main__": - nn = 7 - #m = [] - #for _ in range(100): - # acc = code(nn) - # m.append(np.mean(acc)) - #m = np.array(m)*100 - #print "%.1f+-%.1f" % (np.mean(m), np.std(m)) - - code_show(nn, 0) - - - - - - - - - - - - - - - - - - - - - - - - - +# -*- coding: utf-8 -*- +""" +Created on Fri Feb 27 05:16:53 2015 + +@author: Anton +""" + +import numpy as np +from scipy.spatial.distance import cdist +import numexpr as ne +import os +from matplotlib import pyplot as plt + + +class elm(object): + + def __init__(self): + self.sigm = lambda a: ne.evaluate("1/(1+exp(-a))") + + + def train(self, X, T, nn, idx): + n,d = X.shape + np.random.seed() + W = np.random.randn(d, nn) * 3**0.5 + bias = np.random.randn(nn) + self.W = W + self.bias = bias + + + H = np.dot(X,W) + bias # random projection + H = self.sigm(H) # non-linear transformation + #self.B = np.dot(np.linalg.pinv(H), T) # linear regression + + ################################################## + + + Hneg = H[T[:,3]==1] + Tneg = T[T[:,3]==1] + HHneg = np.dot(Hneg.T, Hneg) + 1E-6*np.eye(Hneg.shape[1]) + HTneg = np.dot(Hneg.T, Tneg) + + H1 = H[T[:,0]==1] + T1 = T[T[:,0]==1] + HH1 = np.dot(H1.T, H1) + 1E-6*np.eye(H1.shape[1]) + HT1 = np.dot(H1.T, T1) + + H2 = H[T[:,1]==1] + T2 = T[T[:,1]==1] + #H2 = H[idx] + #T2 = T[idx] + HH2 = np.dot(H2.T, H2) + 1E-6*np.eye(H2.shape[1]) + HT2 = np.dot(H2.T, T2) + + """ + ### RESAMPLING + Nsampl = H2.shape[0] + s = (np.std(X[T[:,0]==1], axis=0) + np.std(X[idx], axis=0) + np.std(X[T[:,2]==1], axis=0)) / 3 + Nres = (np.sum(T[:,0]==1) + np.sum(T[:,2]==1)) / 2 + Xres = np.zeros((Nres, d)) + for i in xrange(Nres): + sampl = X[idx][np.random.randint(Nsampl)] + Xres[i] = sampl + np.random.randn(1,d)*s + H2res = np.dot(Xres,W) + bias + H2res = self.sigm(H2res) + T2res = np.tile(T2[0], (Nres,1)) + H2 = np.vstack((H2, H2res)) + T2 = np.vstack((T2, T2res)) + HH2 = np.dot(H2.T, H2) + 1E-6*np.eye(H2.shape[1]) + HT2 = np.dot(H2.T, T2) + #""" + #Xres=np.zeros((3,2)) + + + H3 = H[T[:,2]==1] + T3 = T[T[:,2]==1] + HH3 = np.dot(H3.T, H3) + 1E-6*np.eye(H3.shape[1]) + HT3 = np.dot(H3.T, T3) + + + N = n*1.0 + #k = np.array([1, 1, 1, 1], dtype=np.float64) + k = np.array([N/H1.shape[0], N/H2.shape[0], N/H3.shape[0]]).astype(np.float64) + k = k / np.sum(k) + HH = k[0]*HH1 + k[1]*HH2 + k[2]*HH3 + 0.01*HHneg + HT = k[0]*HT1 + k[1]*HT2 + k[2]*HT3 + 0.01*HTneg + + + ################################################## + + #HH = H.T.dot(H) + 1E-6*np.eye(H.shape[1]) + #HT = H.T.dot(T) + self.B = np.linalg.lstsq(HH, HT)[0] + + + + + def run(self, X): + H = np.dot(X, self.W) + self.bias + H = self.sigm(H) + return np.dot(H, self.B) + + + +def code(nn): + folder = 'Classification-Iris' + folder = os.path.join(os.path.dirname(__file__), "../datasets", folder) + acc = np.zeros((10,)) + for i in range(10): # 10-fold cross-validation + # get file names + Xtr = np.load(os.path.join(folder, "xtrain_%d.npy" % (i + 1))) + Xts = np.load(os.path.join(folder, "xtest_%d.npy" % (i + 1))) + Ytr = np.load(os.path.join(folder, "ytrain_%d.npy" % (i + 1))) + Yts = np.load(os.path.join(folder, "ytest_%d.npy" % (i + 1))) + # train ELM + Xtr = Xtr[:,2:] + Xts = Xts[:,2:] + Ytr = np.hstack((Ytr[:,:2], Ytr[:,3][:,None])) + Yts = np.hstack((Yts[:,:2], Yts[:,3][:,None])) + + e = elm() + e.train(Xtr, Ytr, nn) + Yh = e.run(Xts) + + # evaluate classification results + Yts = np.argmax(Yts, 1) + Yh = np.argmax(Yh, 1) + acc[i] = float(np.sum(Yh == Yts)) / Yts.shape[0] + return acc + + +def code_show(nn, i): + folder = 'Classification-Iris' + folder = os.path.join(os.path.dirname(__file__), "../datasets", folder) + acc = np.zeros((10,)) + # get file names + Xtr = np.load(os.path.join(folder, "xtrain_%d.npy" % (i + 1))) + Xts = np.load(os.path.join(folder, "xtest_%d.npy" % (i + 1))) + Ytr = np.load(os.path.join(folder, "ytrain_%d.npy" % (i + 1))) + Yts = np.load(os.path.join(folder, "ytest_%d.npy" % (i + 1))) + # train ELM + #Xtr = Xtr[:,2:] + #Xts = Xts[:,2:] + i1 = 0 + i2 = 3 + Xtr = np.vstack((Xtr[:,i1], Xtr[:,i2])).T + Xts = np.vstack((Xts[:,i1], Xts[:,i2])).T + + Ytr = np.hstack((Ytr[:,:2], Ytr[:,3][:,None])) + Yts = np.hstack((Yts[:,:2], Yts[:,3][:,None])) + + #print '1' + #print Xtr[Ytr[:,0]==1].std(axis=0)**2 + #print Xtr[Ytr[:,1]==1].std(axis=0)**2 + + ############################################################ + ### NEGATIVE CLASS SAMPLES + n,d = Xtr.shape + Nneg = n*10 + Yneg = np.tile(np.array([[0,0,0,1]]), (Nneg,1)) + Xneg = np.zeros((Nneg, d)) + s = (np.std(Xtr[Ytr[:,0]==1]) + np.std(Xtr[Ytr[:,1]==1]) + np.std(Xtr[Ytr[:,2]==1])) / 3 + for i in xrange(Nneg): + sample = Xtr[np.random.randint(n)] + np.random.randn(1,2)*0.1 + Xneg[i] = sample + #while True: + #dist = cdist(sample, Xtr, "euclidean") + #if np.min(dist) > s: + #if np.sum(sample**2)**0.5 > 3: + # Xneg[i] = sample + # break + + Ytr = np.hstack((Ytr, np.zeros((n,1)))) + Ytr = np.vstack((Ytr, Yneg)) + Xtr = np.vstack((Xtr, Xneg)) + m2 = Xtr.mean(0) + s2 = Xtr.std(0) + #Xtr = (Xtr - m2) / s2 + + ############################################################ + + # prepare mesh grid + sz = 8 + x = np.arange(-sz, sz, 0.1) + y = np.arange(-sz, sz, 0.1) + n = x.shape[0] + xm, ym = np.meshgrid(x, y) + D = np.vstack((xm.ravel(), ym.ravel())).T + + # reduce number of samples of one class + N2 = 2 + idx = np.where(Ytr[:,1]==1)[0] + np.random.shuffle(idx) + idx = idx[:N2] + idx = np.array([21, 76]) + print idx + + # average over many runs + Z = [] + acc = [] + for _ in range(1000): + + e = elm() + e.train(Xtr, Ytr, nn, idx) + + # evaluate classification results + Yh = e.run(Xts) + Yts1 = np.argmax(Yts, 1) + Yh1 = np.argmax(Yh, 1) + acc.append(float(np.sum(Yh1 == Yts1)) / Yts1.shape[0]) + + # show plot + Z.append(e.run(D)) + + Z = np.array(Z).mean(0) + print "acc:", np.mean(acc) + + I = Z.copy() + Z[Z<0] = 0 + I[I<0] = 0 + I = I.reshape(n,n,4) + I = I / I.max(axis=2)[:,:,None] + + I = I[::-1, :, :3] + + + plt.imshow(I, extent=[-sz, sz, -sz, sz]) + plt.xlim([-sz, sz]) + plt.ylim([-sz, sz]) + #cl = 1 + #plt.contour(xm, ym, Z[:,cl].reshape(n,n), colors='k') + #plt.contourf(xm, ym, Z[:,cl].reshape(n,n), cmap=plt.cm.bone) + #plt.scatter(D[:,0], D[:,1], s=Z[:,0]) + + #Xa = np.vstack((Xtr, Xts)) + #Ya = np.vstack((Ytr, Yts)) + #plt.scatter(Xa[:,0], Xa[:,1], c=Ya) + #plt.scatter(Xtr[:,0], Xtr[:,1], c=Ytr) + plt.scatter(Xtr[Ytr[:,0]==1,0], Xtr[Ytr[:,0]==1,1], c=Ytr[Ytr[:,0]==1]) + plt.scatter(Xtr[Ytr[:,1]==1,0], Xtr[Ytr[:,1]==1,1], c=Ytr[Ytr[:,1]==1]) + #plt.scatter(Xtr[idx,0], Xtr[idx,1], c=Ytr[idx]) + plt.scatter(Xtr[Ytr[:,2]==1,0], Xtr[Ytr[:,2]==1,1], c=Ytr[Ytr[:,2]==1]) + plt.scatter(Xtr[Ytr[:,3]==1,0], Xtr[Ytr[:,3]==1,1], marker='+', c=[0,0,0]) + plt.show() + + + + + +if __name__ == "__main__": + nn = 7 + #m = [] + #for _ in range(100): + # acc = code(nn) + # m.append(np.mean(acc)) + #m = np.array(m)*100 + #print "%.1f+-%.1f" % (np.mean(m), np.std(m)) + + code_show(nn, 0) + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/develop_os/OS-ELM/HardlimActFun.m b/develop_os/OS-ELM/HardlimActFun.m index 904149e..e296d7a 100755 --- a/develop_os/OS-ELM/HardlimActFun.m +++ b/develop_os/OS-ELM/HardlimActFun.m @@ -1,7 +1,7 @@ -function H = HardlimActFun(P,IW,Bias); - -%%%%%%%% Feedforward neural network using hardlim activation function -V=P*IW'; ind=ones(1,size(P,1)); -BiasMatrix=Bias(ind,:); -V=V+BiasMatrix; +function H = HardlimActFun(P,IW,Bias); + +%%%%%%%% Feedforward neural network using hardlim activation function +V=P*IW'; ind=ones(1,size(P,1)); +BiasMatrix=Bias(ind,:); +V=V+BiasMatrix; H = hardlim(V); \ No newline at end of file diff --git a/develop_os/OS-ELM/OSELM.m b/develop_os/OS-ELM/OSELM.m index 301bb08..e539e16 100755 --- a/develop_os/OS-ELM/OSELM.m +++ b/develop_os/OS-ELM/OSELM.m @@ -1,205 +1,205 @@ -function [TrainingTime, TestingTime, TrainingAccuracy, TestingAccuracy] = OSELM(TrainingData_File, TestingData_File, Elm_Type, nHiddenNeurons, ActivationFunction, N0, Block) - -% Usage: OSELM(TrainingData_File, TestingData_File, Elm_Type, NumberofHiddenNeurons, ActivationFunction, N0, Block) -% OR: [TrainingTime, TestingTime, TrainingAccuracy, TestingAccuracy] = OSELM(TrainingData_File, TestingData_File, Elm_Type, NumberofHiddenNeurons, ActivationFunction, N0, Block) -% -% Input: -% TrainingData_File - Filename of training data set -% TestingData_File - Filename of testing data set -% Elm_Type - 0 for regression; 1 for (both binary and multi-classes) classification -% nHiddenNeurons - Number of hidden neurons assigned to the OSELM -% ActivationFunction - Type of activation function: -% 'rbf' for radial basis function, G(a,b,x) = exp(-b||x-a||^2) -% 'sig' for sigmoidal function, G(a,b,x) = 1/(1+exp(-(ax+b))) -% 'sin' for sine function, G(a,b,x) = sin(ax+b) -% 'hardlim' for hardlim function, G(a,b,x) = hardlim(ax+b) -% N0 - Number of initial training data used in the initial phase of OSLEM, which is not less than the number of hidden neurons -% Block - Size of block of data learned by OSELM in each step -% -% Output: -% TrainingTime - Time (seconds) spent on training OSELM -% TestingTime - Time (seconds) spent on predicting all testing data -% TrainingAccuracy - Training accuracy: -% RMSE for regression or correct classification rate for classifcation -% TestingAccuracy - Testing accuracy: -% RMSE for regression or correct classification rate for classifcation -% -% MULTI-CLASSE CLASSIFICATION: NUMBER OF OUTPUT NEURONS WILL BE AUTOMATICALLY SET EQUAL TO NUMBER OF CLASSES -% FOR EXAMPLE, if there are 7 classes in all, there will have 7 output -% neurons; neuron 5 has the highest output means input belongs to 5-th class -% -% Sample1 regression: OSELM('mpg_train', 'mpg_test', 0, 25, 'rbf', 75, 1); -% Sample2 classification: OSELM('segment_train', 'segment_test', 1, 180, 'sig', 280, 20); - - %%%% Authors: - %%%% NANYANG TECHNOLOGICAL UNIVERSITY, SINGAPORE - %%%% EMAIL: - %%%% WEBSITE: - %%%% DATE: - -%%%%%%%%%%% Macro definition -REGRESSION=0; -CLASSIFICATION=1; - -%%%%%%%%%%% Load dataset -train_data=load(TrainingData_File); test_data=load(TestingData_File); -T=train_data(:,1); P=train_data(:,2:size(train_data,2)); -TV.T=test_data(:,1); TV.P=test_data(:,2:size(test_data,2)); -clear train_data test_data; - -nTrainingData=size(P,1); -nTestingData=size(TV.P,1); -nInputNeurons=size(P,2); - -%%%%%%%%%%%% Preprocessing T in the case of CLASSIFICATION -if Elm_Type==CLASSIFICATION - sorted_target=sort(cat(1,T,TV.T),1); - label=zeros(1,1); % Find and save in 'label' class label from training and testing data sets - label(1,1)=sorted_target(1,1); - j=1; - for i = 2:(nTrainingData+nTestingData) - if sorted_target(i,1) ~= label(j,1) - j=j+1; - label(j,1) = sorted_target(i,1); - end - end - nClass=j; - nOutputNeurons=nClass; - - %%%%%%%%%% Processing the targets of training - temp_T=zeros(nTrainingData,nClass); - for i = 1:nTrainingData - for j = 1:nClass - if label(j,1) == T(i,1) - break; - end - end - temp_T(i,j)=1; - end - T=temp_T*2-1; - - %%%%%%%%%% Processing the targets of testing - temp_TV_T=zeros(nTestingData,nClass); - for i = 1:nTestingData - for j = 1:nClass - if label(j,1) == TV.T(i,1) - break; - end - end - temp_TV_T(i,j)=1; - end - TV.T=temp_TV_T*2-1; -end -clear temp_T temp_TV_T sorted_target - -start_time_train=cputime; -%%%%%%%%%%% step 1 Initialization Phase -P0=P(1:N0,:); -T0=T(1:N0,:); - -IW = rand(nHiddenNeurons,nInputNeurons)*2-1; -switch lower(ActivationFunction) - case{'rbf'} - Bias = rand(1,nHiddenNeurons); -% Bias = rand(1,nHiddenNeurons)*1/3+1/11; %%%%%%%%%%%%% for the cases of Image Segment and Satellite Image -% Bias = rand(1,nHiddenNeurons)*1/20+1/60; %%%%%%%%%%%%% for the case of DNA - H0 = RBFun(P0,IW,Bias); - case{'sig'} - Bias = rand(1,nHiddenNeurons)*2-1; - H0 = SigActFun(P0,IW,Bias); - case{'sin'} - Bias = rand(1,nHiddenNeurons)*2-1; - H0 = SinActFun(P0,IW,Bias); - case{'hardlim'} - Bias = rand(1,nHiddenNeurons)*2-1; - H0 = HardlimActFun(P0,IW,Bias); - H0 = double(H0); -end - -M = pinv(H0' * H0); -beta = pinv(H0) * T0; -clear P0 T0 H0; - -%%%%%%%%%%%%% step 2 Sequential Learning Phase -for n = N0 : Block : nTrainingData - if (n+Block-1) > nTrainingData - Pn = P(n:nTrainingData,:); Tn = T(n:nTrainingData,:); - Block = size(Pn,1); %%%% correct the block size - clear V; %%%% correct the first dimention of V - else - Pn = P(n:(n+Block-1),:); Tn = T(n:(n+Block-1),:); - end - - switch lower(ActivationFunction) - case{'rbf'} - H = RBFun(Pn,IW,Bias); - case{'sig'} - H = SigActFun(Pn,IW,Bias); - case{'sin'} - H = SinActFun(Pn,IW,Bias); - case{'hardlim'} - H = HardlimActFun(Pn,IW,Bias); - end - M = M - M * H' * (eye(Block) + H * M * H')^(-1) * H * M; - beta = beta + M * H' * (Tn - H * beta); -end -end_time_train=cputime; -TrainingTime=end_time_train-start_time_train -clear Pn Tn H M; - -switch lower(ActivationFunction) - case{'rbf'} - HTrain = RBFun(P, IW, Bias); - case{'sig'} - HTrain = SigActFun(P, IW, Bias); - case{'sin'} - HTrain = SinActFun(P, IW, Bias); - case{'hardlim'} - HTrain = HardlimActFun(P, IW, Bias); -end -Y=HTrain * beta; -clear HTrain; - -%%%%%%%%%%% Performance Evaluation -start_time_test=cputime; -switch lower(ActivationFunction) - case{'rbf'} - HTest = RBFun(TV.P, IW, Bias); - case{'sig'} - HTest = SigActFun(TV.P, IW, Bias); - case{'sin'} - HTest = SinActFun(TV.P, IW, Bias); - case{'hardlim'} - HTest = HardlimActFun(TV.P, IW, Bias); -end -TY=HTest * beta; -clear HTest; -end_time_test=cputime; -TestingTime=end_time_test-start_time_test - -if Elm_Type == REGRESSION - %%%%%%%%%%%%%% Calculate RMSE in the case of REGRESSION - TrainingAccuracy=sqrt(mse(T - Y)) - TestingAccuracy=sqrt(mse(TV.T - TY)) -elseif Elm_Type == CLASSIFICATION -%%%%%%%%%% Calculate correct classification rate in the case of CLASSIFICATION - MissClassificationRate_Training=0; - MissClassificationRate_Testing=0; - - for i = 1 : nTrainingData - [x, label_index_expected]=max(T(i,:)); - [x, label_index_actual]=max(Y(i,:)); - if label_index_actual~=label_index_expected - MissClassificationRate_Training=MissClassificationRate_Training+1; - end - end - TrainingAccuracy=1-MissClassificationRate_Training/nTrainingData - for i = 1 : nTestingData - [x, label_index_expected]=max(TV.T(i,:)); - [x, label_index_actual]=max(TY(i,:)); - if label_index_actual~=label_index_expected - MissClassificationRate_Testing=MissClassificationRate_Testing+1; - end - end - TestingAccuracy=1-MissClassificationRate_Testing/nTestingData +function [TrainingTime, TestingTime, TrainingAccuracy, TestingAccuracy] = OSELM(TrainingData_File, TestingData_File, Elm_Type, nHiddenNeurons, ActivationFunction, N0, Block) + +% Usage: OSELM(TrainingData_File, TestingData_File, Elm_Type, NumberofHiddenNeurons, ActivationFunction, N0, Block) +% OR: [TrainingTime, TestingTime, TrainingAccuracy, TestingAccuracy] = OSELM(TrainingData_File, TestingData_File, Elm_Type, NumberofHiddenNeurons, ActivationFunction, N0, Block) +% +% Input: +% TrainingData_File - Filename of training data set +% TestingData_File - Filename of testing data set +% Elm_Type - 0 for regression; 1 for (both binary and multi-classes) classification +% nHiddenNeurons - Number of hidden neurons assigned to the OSELM +% ActivationFunction - Type of activation function: +% 'rbf' for radial basis function, G(a,b,x) = exp(-b||x-a||^2) +% 'sig' for sigmoidal function, G(a,b,x) = 1/(1+exp(-(ax+b))) +% 'sin' for sine function, G(a,b,x) = sin(ax+b) +% 'hardlim' for hardlim function, G(a,b,x) = hardlim(ax+b) +% N0 - Number of initial training data used in the initial phase of OSLEM, which is not less than the number of hidden neurons +% Block - Size of block of data learned by OSELM in each step +% +% Output: +% TrainingTime - Time (seconds) spent on training OSELM +% TestingTime - Time (seconds) spent on predicting all testing data +% TrainingAccuracy - Training accuracy: +% RMSE for regression or correct classification rate for classifcation +% TestingAccuracy - Testing accuracy: +% RMSE for regression or correct classification rate for classifcation +% +% MULTI-CLASSE CLASSIFICATION: NUMBER OF OUTPUT NEURONS WILL BE AUTOMATICALLY SET EQUAL TO NUMBER OF CLASSES +% FOR EXAMPLE, if there are 7 classes in all, there will have 7 output +% neurons; neuron 5 has the highest output means input belongs to 5-th class +% +% Sample1 regression: OSELM('mpg_train', 'mpg_test', 0, 25, 'rbf', 75, 1); +% Sample2 classification: OSELM('segment_train', 'segment_test', 1, 180, 'sig', 280, 20); + + %%%% Authors: + %%%% NANYANG TECHNOLOGICAL UNIVERSITY, SINGAPORE + %%%% EMAIL: + %%%% WEBSITE: + %%%% DATE: + +%%%%%%%%%%% Macro definition +REGRESSION=0; +CLASSIFICATION=1; + +%%%%%%%%%%% Load dataset +train_data=load(TrainingData_File); test_data=load(TestingData_File); +T=train_data(:,1); P=train_data(:,2:size(train_data,2)); +TV.T=test_data(:,1); TV.P=test_data(:,2:size(test_data,2)); +clear train_data test_data; + +nTrainingData=size(P,1); +nTestingData=size(TV.P,1); +nInputNeurons=size(P,2); + +%%%%%%%%%%%% Preprocessing T in the case of CLASSIFICATION +if Elm_Type==CLASSIFICATION + sorted_target=sort(cat(1,T,TV.T),1); + label=zeros(1,1); % Find and save in 'label' class label from training and testing data sets + label(1,1)=sorted_target(1,1); + j=1; + for i = 2:(nTrainingData+nTestingData) + if sorted_target(i,1) ~= label(j,1) + j=j+1; + label(j,1) = sorted_target(i,1); + end + end + nClass=j; + nOutputNeurons=nClass; + + %%%%%%%%%% Processing the targets of training + temp_T=zeros(nTrainingData,nClass); + for i = 1:nTrainingData + for j = 1:nClass + if label(j,1) == T(i,1) + break; + end + end + temp_T(i,j)=1; + end + T=temp_T*2-1; + + %%%%%%%%%% Processing the targets of testing + temp_TV_T=zeros(nTestingData,nClass); + for i = 1:nTestingData + for j = 1:nClass + if label(j,1) == TV.T(i,1) + break; + end + end + temp_TV_T(i,j)=1; + end + TV.T=temp_TV_T*2-1; +end +clear temp_T temp_TV_T sorted_target + +start_time_train=cputime; +%%%%%%%%%%% step 1 Initialization Phase +P0=P(1:N0,:); +T0=T(1:N0,:); + +IW = rand(nHiddenNeurons,nInputNeurons)*2-1; +switch lower(ActivationFunction) + case{'rbf'} + Bias = rand(1,nHiddenNeurons); +% Bias = rand(1,nHiddenNeurons)*1/3+1/11; %%%%%%%%%%%%% for the cases of Image Segment and Satellite Image +% Bias = rand(1,nHiddenNeurons)*1/20+1/60; %%%%%%%%%%%%% for the case of DNA + H0 = RBFun(P0,IW,Bias); + case{'sig'} + Bias = rand(1,nHiddenNeurons)*2-1; + H0 = SigActFun(P0,IW,Bias); + case{'sin'} + Bias = rand(1,nHiddenNeurons)*2-1; + H0 = SinActFun(P0,IW,Bias); + case{'hardlim'} + Bias = rand(1,nHiddenNeurons)*2-1; + H0 = HardlimActFun(P0,IW,Bias); + H0 = double(H0); +end + +M = pinv(H0' * H0); +beta = pinv(H0) * T0; +clear P0 T0 H0; + +%%%%%%%%%%%%% step 2 Sequential Learning Phase +for n = N0 : Block : nTrainingData + if (n+Block-1) > nTrainingData + Pn = P(n:nTrainingData,:); Tn = T(n:nTrainingData,:); + Block = size(Pn,1); %%%% correct the block size + clear V; %%%% correct the first dimention of V + else + Pn = P(n:(n+Block-1),:); Tn = T(n:(n+Block-1),:); + end + + switch lower(ActivationFunction) + case{'rbf'} + H = RBFun(Pn,IW,Bias); + case{'sig'} + H = SigActFun(Pn,IW,Bias); + case{'sin'} + H = SinActFun(Pn,IW,Bias); + case{'hardlim'} + H = HardlimActFun(Pn,IW,Bias); + end + M = M - M * H' * (eye(Block) + H * M * H')^(-1) * H * M; + beta = beta + M * H' * (Tn - H * beta); +end +end_time_train=cputime; +TrainingTime=end_time_train-start_time_train +clear Pn Tn H M; + +switch lower(ActivationFunction) + case{'rbf'} + HTrain = RBFun(P, IW, Bias); + case{'sig'} + HTrain = SigActFun(P, IW, Bias); + case{'sin'} + HTrain = SinActFun(P, IW, Bias); + case{'hardlim'} + HTrain = HardlimActFun(P, IW, Bias); +end +Y=HTrain * beta; +clear HTrain; + +%%%%%%%%%%% Performance Evaluation +start_time_test=cputime; +switch lower(ActivationFunction) + case{'rbf'} + HTest = RBFun(TV.P, IW, Bias); + case{'sig'} + HTest = SigActFun(TV.P, IW, Bias); + case{'sin'} + HTest = SinActFun(TV.P, IW, Bias); + case{'hardlim'} + HTest = HardlimActFun(TV.P, IW, Bias); +end +TY=HTest * beta; +clear HTest; +end_time_test=cputime; +TestingTime=end_time_test-start_time_test + +if Elm_Type == REGRESSION + %%%%%%%%%%%%%% Calculate RMSE in the case of REGRESSION + TrainingAccuracy=sqrt(mse(T - Y)) + TestingAccuracy=sqrt(mse(TV.T - TY)) +elseif Elm_Type == CLASSIFICATION +%%%%%%%%%% Calculate correct classification rate in the case of CLASSIFICATION + MissClassificationRate_Training=0; + MissClassificationRate_Testing=0; + + for i = 1 : nTrainingData + [x, label_index_expected]=max(T(i,:)); + [x, label_index_actual]=max(Y(i,:)); + if label_index_actual~=label_index_expected + MissClassificationRate_Training=MissClassificationRate_Training+1; + end + end + TrainingAccuracy=1-MissClassificationRate_Training/nTrainingData + for i = 1 : nTestingData + [x, label_index_expected]=max(TV.T(i,:)); + [x, label_index_actual]=max(TY(i,:)); + if label_index_actual~=label_index_expected + MissClassificationRate_Testing=MissClassificationRate_Testing+1; + end + end + TestingAccuracy=1-MissClassificationRate_Testing/nTestingData end \ No newline at end of file diff --git a/develop_os/OS-ELM/OSELM_VARY.m b/develop_os/OS-ELM/OSELM_VARY.m index af8645f..12948a1 100755 --- a/develop_os/OS-ELM/OSELM_VARY.m +++ b/develop_os/OS-ELM/OSELM_VARY.m @@ -1,206 +1,206 @@ -function [TrainingTime, TestingTime, TrainingAccuracy, TestingAccuracy] = OSELM_VARY(TrainingData_File, TestingData_File, Elm_Type, nHiddenNeurons, ActivationFunction, N0, Block_Range) - -% Usage: OSELM_VARY(TrainingData_File, TestingData_File, Elm_Type, NumberofHiddenNeurons, ActivationFunction, N0, Block_Range) -% OR: [TrainingTime, TestingTime, TrainingAccuracy, TestingAccuracy] = OSELM_VARY(TrainingData_File, TestingData_File, Elm_Type, NumberofHiddenNeurons, ActivationFunction, N0, Block_Range) -% -% Input: -% TrainingData_File - Filename of training data set -% TestingData_File - Filename of testing data set -% Elm_Type - 0 for regression; 1 for (both binary and multi-classes) classification -% nHiddenNeurons - Number of hidden neurons assigned to the OSELM -% ActivationFunction - Type of activation function: -% 'rbf' for radial basis function, G(a,b,x) = exp(-b||x-a||^2) -% 'sig' for sigmoidal function, G(a,b,x) = 1/(1+exp(-(ax+b))) -% 'sin' for sine function, G(a,b,x) = sin(ax+b) -% 'hardlim' for hardlim function, G(a,b,x) = hardlim(ax+b) -% N0 - Number of initial training data used in the initial phase of OSLEM, which is not less than the number of hidden neurons -% Block_Range - Range from wich the size of data block randomly generated in each iteration of sequential learning phase -% -% Output: -% TrainingTime - Time (seconds) spent on training OSELM -% TestingTime - Time (seconds) spent on predicting all testing data -% TrainingAccuracy - Training accuracy: -% RMSE for regression or correct classification rate for classifcation -% TestingAccuracy - Testing accuracy: -% RMSE for regression or correct classification rate for classifcation -% -% MULTI-CLASSE CLASSIFICATION: NUMBER OF OUTPUT NEURONS WILL BE AUTOMATICALLY SET EQUAL TO NUMBER OF CLASSES -% FOR EXAMPLE, if there are 7 classes in all, there will have 7 output -% neurons; neuron 5 has the highest output means input belongs to 5-th class -% -% Sample1 regression: OSELM_VARY('mpg_train', 'mpg_test', 0, 25, 'rbf', 75, [10,30]); -% Sample2 classification: OSELM_VARY('segment_train', 'segment_test', 1, 180, 'sig', 280, [10,30]); - - %%%% Authors: - %%%% NANYANG TECHNOLOGICAL UNIVERSITY, SINGAPORE - %%%% EMAIL: - %%%% WEBSITE: - %%%% DATE: - -%%%%%%%%%%% Macro definition -REGRESSION=0; -CLASSIFICATION=1; - -%%%%%%%%%%% Load dataset -train_data=load(TrainingData_File); test_data=load(TestingData_File); -T=train_data(:,1); P=train_data(:,2:size(train_data,2)); -TV.T=test_data(:,1); TV.P=test_data(:,2:size(test_data,2)); -clear train_data test_data; - -nTrainingData=size(P,1); -nTestingData=size(TV.P,1); -nInputNeurons=size(P,2); - -%%%%%%%%%%%% Preprocessing T in the case of CLASSIFICATION -if Elm_Type==CLASSIFICATION - sorted_target=sort(cat(1,T,TV.T),1); - label=zeros(1,1); % Find and save in 'label' class label from training and testing data sets - label(1,1)=sorted_target(1,1); - j=1; - for i = 2:(nTrainingData+nTestingData) - if sorted_target(i,1) ~= label(j,1) - j=j+1; - label(j,1) = sorted_target(i,1); - end - end - nClass=j; - nOutputNeurons=nClass; - - %%%%%%%%%% Processing the targets of training - temp_T=zeros(nTrainingData,nClass); - for i = 1:nTrainingData - for j = 1:nClass - if label(j,1) == T(i,1) - break; - end - end - temp_T(i,j)=1; - end - T=temp_T*2-1; - - %%%%%%%%%% Processing the targets of testing - temp_TV_T=zeros(nTestingData,nClass); - for i = 1:nTestingData - for j = 1:nClass - if label(j,1) == TV.T(i,1) - break; - end - end - temp_TV_T(i,j)=1; - end - TV.T=temp_TV_T*2-1; -end -clear temp_T temp_TV_T sorted_target - -start_time_train=cputime; -%%%%%%%%%%% step 1 Initialization Phase -P0=P(1:N0,:); -T0=T(1:N0,:); - -IW = rand(nHiddenNeurons,nInputNeurons)*2-1; -switch lower(ActivationFunction) - case{'rbf'} - Bias = rand(1,nHiddenNeurons); -% Bias = rand(1,nHiddenNeurons)*1/3+1/11; %%%%%%%%%%%%% for the cases of Image Segment and Satellite Image -% Bias = rand(1,nHiddenNeurons)*1/20+1/60; %%%%%%%%%%%%% for the case of DNA - H0 = RBFun(P0,IW,Bias); - case{'sig'} - Bias = rand(1,nHiddenNeurons)*2-1; - H0 = SigActFun(P0,IW,Bias); - case{'sin'} - Bias = rand(1,nHiddenNeurons)*2-1; - H0 = SinActFun(P0,IW,Bias); - case{'hardlim'} - Bias = rand(1,nHiddenNeurons)*2-1; - H0 = HardlimActFun(P0,IW,Bias); - H0 = double(H0); -end - -M = pinv(H0' * H0); -beta = pinv(H0) * T0; -clear P0 T0 H0; - -%%%%%%%%%%%%% step 2 Sequential Learning Phase -n = N0 + 1; -while n <= nTrainingData - Block = randint(1,1,Block_Range); - if (n+Block-1) > nTrainingData - Pn = P(n:nTrainingData,:); Tn = T(n:nTrainingData,:); - Block = size(Pn,1); %%%% correct the block size - else - Pn = P(n:(n+Block-1),:); Tn = T(n:(n+Block-1),:); - end - switch lower(ActivationFunction) - case{'rbf'} - H = RBFun(Pn,IW,Bias); - case{'sig'} - H = SigActFun(Pn,IW,Bias); - case{'sin'} - H = SinActFun(Pn,IW,Bias); - case{'hardlim'} - H = HardlimActFun(Pn,IW,Bias); - end - M = M - M * H' * (eye(Block) + H * M * H')^(-1) * H * M; - beta = beta + M * H' * (Tn - H * beta); - n = n + Block; -end -end_time_train=cputime; -TrainingTime=end_time_train-start_time_train -clear Pn Tn H M; - -switch lower(ActivationFunction) - case{'rbf'} - HTrain = RBFun(P, IW, Bias); - case{'sig'} - HTrain = SigActFun(P, IW, Bias); - case{'sin'} - HTrain = SinActFun(P, IW, Bias); - case{'hardlim'} - HTrain = HardlimActFun(P, IW, Bias); -end -Y=HTrain * beta; -clear HTrain; - -%%%%%%%%%%% Performance Evaluation -start_time_test=cputime; -switch lower(ActivationFunction) - case{'rbf'} - HTest = RBFun(TV.P, IW, Bias); - case{'sig'} - HTest = SigActFun(TV.P, IW, Bias); - case{'sin'} - HTest = SinActFun(TV.P, IW, Bias); - case{'hardlim'} - HTest = HardlimActFun(TV.P, IW, Bias); -end -TY=HTest * beta; -clear HTest; -end_time_test=cputime; -TestingTime=end_time_test-start_time_test - -if Elm_Type == REGRESSION - %%%%%%%%%%%%%% Calculate RMSE in the case of REGRESSION - TrainingAccuracy=sqrt(mse(T - Y)) - TestingAccuracy=sqrt(mse(TV.T - TY)) -elseif Elm_Type == CLASSIFICATION -%%%%%%%%%% Calculate correct classification rate in the case of CLASSIFICATION - MissClassificationRate_Training=0; - MissClassificationRate_Testing=0; - - for i = 1 : nTrainingData - [x, label_index_expected]=max(T(i,:)); - [x, label_index_actual]=max(Y(i,:)); - if label_index_actual~=label_index_expected - MissClassificationRate_Training=MissClassificationRate_Training+1; - end - end - TrainingAccuracy=1-MissClassificationRate_Training/nTrainingData - for i = 1 : nTestingData - [x, label_index_expected]=max(TV.T(i,:)); - [x, label_index_actual]=max(TY(i,:)); - if label_index_actual~=label_index_expected - MissClassificationRate_Testing=MissClassificationRate_Testing+1; - end - end - TestingAccuracy=1-MissClassificationRate_Testing/nTestingData +function [TrainingTime, TestingTime, TrainingAccuracy, TestingAccuracy] = OSELM_VARY(TrainingData_File, TestingData_File, Elm_Type, nHiddenNeurons, ActivationFunction, N0, Block_Range) + +% Usage: OSELM_VARY(TrainingData_File, TestingData_File, Elm_Type, NumberofHiddenNeurons, ActivationFunction, N0, Block_Range) +% OR: [TrainingTime, TestingTime, TrainingAccuracy, TestingAccuracy] = OSELM_VARY(TrainingData_File, TestingData_File, Elm_Type, NumberofHiddenNeurons, ActivationFunction, N0, Block_Range) +% +% Input: +% TrainingData_File - Filename of training data set +% TestingData_File - Filename of testing data set +% Elm_Type - 0 for regression; 1 for (both binary and multi-classes) classification +% nHiddenNeurons - Number of hidden neurons assigned to the OSELM +% ActivationFunction - Type of activation function: +% 'rbf' for radial basis function, G(a,b,x) = exp(-b||x-a||^2) +% 'sig' for sigmoidal function, G(a,b,x) = 1/(1+exp(-(ax+b))) +% 'sin' for sine function, G(a,b,x) = sin(ax+b) +% 'hardlim' for hardlim function, G(a,b,x) = hardlim(ax+b) +% N0 - Number of initial training data used in the initial phase of OSLEM, which is not less than the number of hidden neurons +% Block_Range - Range from wich the size of data block randomly generated in each iteration of sequential learning phase +% +% Output: +% TrainingTime - Time (seconds) spent on training OSELM +% TestingTime - Time (seconds) spent on predicting all testing data +% TrainingAccuracy - Training accuracy: +% RMSE for regression or correct classification rate for classifcation +% TestingAccuracy - Testing accuracy: +% RMSE for regression or correct classification rate for classifcation +% +% MULTI-CLASSE CLASSIFICATION: NUMBER OF OUTPUT NEURONS WILL BE AUTOMATICALLY SET EQUAL TO NUMBER OF CLASSES +% FOR EXAMPLE, if there are 7 classes in all, there will have 7 output +% neurons; neuron 5 has the highest output means input belongs to 5-th class +% +% Sample1 regression: OSELM_VARY('mpg_train', 'mpg_test', 0, 25, 'rbf', 75, [10,30]); +% Sample2 classification: OSELM_VARY('segment_train', 'segment_test', 1, 180, 'sig', 280, [10,30]); + + %%%% Authors: + %%%% NANYANG TECHNOLOGICAL UNIVERSITY, SINGAPORE + %%%% EMAIL: + %%%% WEBSITE: + %%%% DATE: + +%%%%%%%%%%% Macro definition +REGRESSION=0; +CLASSIFICATION=1; + +%%%%%%%%%%% Load dataset +train_data=load(TrainingData_File); test_data=load(TestingData_File); +T=train_data(:,1); P=train_data(:,2:size(train_data,2)); +TV.T=test_data(:,1); TV.P=test_data(:,2:size(test_data,2)); +clear train_data test_data; + +nTrainingData=size(P,1); +nTestingData=size(TV.P,1); +nInputNeurons=size(P,2); + +%%%%%%%%%%%% Preprocessing T in the case of CLASSIFICATION +if Elm_Type==CLASSIFICATION + sorted_target=sort(cat(1,T,TV.T),1); + label=zeros(1,1); % Find and save in 'label' class label from training and testing data sets + label(1,1)=sorted_target(1,1); + j=1; + for i = 2:(nTrainingData+nTestingData) + if sorted_target(i,1) ~= label(j,1) + j=j+1; + label(j,1) = sorted_target(i,1); + end + end + nClass=j; + nOutputNeurons=nClass; + + %%%%%%%%%% Processing the targets of training + temp_T=zeros(nTrainingData,nClass); + for i = 1:nTrainingData + for j = 1:nClass + if label(j,1) == T(i,1) + break; + end + end + temp_T(i,j)=1; + end + T=temp_T*2-1; + + %%%%%%%%%% Processing the targets of testing + temp_TV_T=zeros(nTestingData,nClass); + for i = 1:nTestingData + for j = 1:nClass + if label(j,1) == TV.T(i,1) + break; + end + end + temp_TV_T(i,j)=1; + end + TV.T=temp_TV_T*2-1; +end +clear temp_T temp_TV_T sorted_target + +start_time_train=cputime; +%%%%%%%%%%% step 1 Initialization Phase +P0=P(1:N0,:); +T0=T(1:N0,:); + +IW = rand(nHiddenNeurons,nInputNeurons)*2-1; +switch lower(ActivationFunction) + case{'rbf'} + Bias = rand(1,nHiddenNeurons); +% Bias = rand(1,nHiddenNeurons)*1/3+1/11; %%%%%%%%%%%%% for the cases of Image Segment and Satellite Image +% Bias = rand(1,nHiddenNeurons)*1/20+1/60; %%%%%%%%%%%%% for the case of DNA + H0 = RBFun(P0,IW,Bias); + case{'sig'} + Bias = rand(1,nHiddenNeurons)*2-1; + H0 = SigActFun(P0,IW,Bias); + case{'sin'} + Bias = rand(1,nHiddenNeurons)*2-1; + H0 = SinActFun(P0,IW,Bias); + case{'hardlim'} + Bias = rand(1,nHiddenNeurons)*2-1; + H0 = HardlimActFun(P0,IW,Bias); + H0 = double(H0); +end + +M = pinv(H0' * H0); +beta = pinv(H0) * T0; +clear P0 T0 H0; + +%%%%%%%%%%%%% step 2 Sequential Learning Phase +n = N0 + 1; +while n <= nTrainingData + Block = randint(1,1,Block_Range); + if (n+Block-1) > nTrainingData + Pn = P(n:nTrainingData,:); Tn = T(n:nTrainingData,:); + Block = size(Pn,1); %%%% correct the block size + else + Pn = P(n:(n+Block-1),:); Tn = T(n:(n+Block-1),:); + end + switch lower(ActivationFunction) + case{'rbf'} + H = RBFun(Pn,IW,Bias); + case{'sig'} + H = SigActFun(Pn,IW,Bias); + case{'sin'} + H = SinActFun(Pn,IW,Bias); + case{'hardlim'} + H = HardlimActFun(Pn,IW,Bias); + end + M = M - M * H' * (eye(Block) + H * M * H')^(-1) * H * M; + beta = beta + M * H' * (Tn - H * beta); + n = n + Block; +end +end_time_train=cputime; +TrainingTime=end_time_train-start_time_train +clear Pn Tn H M; + +switch lower(ActivationFunction) + case{'rbf'} + HTrain = RBFun(P, IW, Bias); + case{'sig'} + HTrain = SigActFun(P, IW, Bias); + case{'sin'} + HTrain = SinActFun(P, IW, Bias); + case{'hardlim'} + HTrain = HardlimActFun(P, IW, Bias); +end +Y=HTrain * beta; +clear HTrain; + +%%%%%%%%%%% Performance Evaluation +start_time_test=cputime; +switch lower(ActivationFunction) + case{'rbf'} + HTest = RBFun(TV.P, IW, Bias); + case{'sig'} + HTest = SigActFun(TV.P, IW, Bias); + case{'sin'} + HTest = SinActFun(TV.P, IW, Bias); + case{'hardlim'} + HTest = HardlimActFun(TV.P, IW, Bias); +end +TY=HTest * beta; +clear HTest; +end_time_test=cputime; +TestingTime=end_time_test-start_time_test + +if Elm_Type == REGRESSION + %%%%%%%%%%%%%% Calculate RMSE in the case of REGRESSION + TrainingAccuracy=sqrt(mse(T - Y)) + TestingAccuracy=sqrt(mse(TV.T - TY)) +elseif Elm_Type == CLASSIFICATION +%%%%%%%%%% Calculate correct classification rate in the case of CLASSIFICATION + MissClassificationRate_Training=0; + MissClassificationRate_Testing=0; + + for i = 1 : nTrainingData + [x, label_index_expected]=max(T(i,:)); + [x, label_index_actual]=max(Y(i,:)); + if label_index_actual~=label_index_expected + MissClassificationRate_Training=MissClassificationRate_Training+1; + end + end + TrainingAccuracy=1-MissClassificationRate_Training/nTrainingData + for i = 1 : nTestingData + [x, label_index_expected]=max(TV.T(i,:)); + [x, label_index_actual]=max(TY(i,:)); + if label_index_actual~=label_index_expected + MissClassificationRate_Testing=MissClassificationRate_Testing+1; + end + end + TestingAccuracy=1-MissClassificationRate_Testing/nTestingData end \ No newline at end of file diff --git a/develop_os/OS-ELM/RBFun.m b/develop_os/OS-ELM/RBFun.m index d97bbcc..7950d77 100755 --- a/develop_os/OS-ELM/RBFun.m +++ b/develop_os/OS-ELM/RBFun.m @@ -1,12 +1,12 @@ -function H = RBFun(P,IW,Bias); - -%%%%%%%% RBF network using Gaussian kernel -ind=ones(size(P,1),1); -for i=1:size(IW,1) - Weight=IW(i,:); - WeightMatrix=Weight(ind,:); - V(:,i)=-sum((P-WeightMatrix).^2,2); -end -BiasMatrix=Bias(ind,:); -V=V.*BiasMatrix; +function H = RBFun(P,IW,Bias); + +%%%%%%%% RBF network using Gaussian kernel +ind=ones(size(P,1),1); +for i=1:size(IW,1) + Weight=IW(i,:); + WeightMatrix=Weight(ind,:); + V(:,i)=-sum((P-WeightMatrix).^2,2); +end +BiasMatrix=Bias(ind,:); +V=V.*BiasMatrix; H=exp(V); \ No newline at end of file diff --git a/develop_os/OS-ELM/SigActFun.m b/develop_os/OS-ELM/SigActFun.m index aba5de2..5a34025 100755 --- a/develop_os/OS-ELM/SigActFun.m +++ b/develop_os/OS-ELM/SigActFun.m @@ -1,7 +1,7 @@ -function H = SigActFun(P,IW,Bias); - -%%%%%%%% Feedforward neural network using sigmoidal activation function -V=P*IW'; ind=ones(1,size(P,1)); -BiasMatrix=Bias(ind,:); -V=V+BiasMatrix; +function H = SigActFun(P,IW,Bias); + +%%%%%%%% Feedforward neural network using sigmoidal activation function +V=P*IW'; ind=ones(1,size(P,1)); +BiasMatrix=Bias(ind,:); +V=V+BiasMatrix; H = 1./(1+exp(-V)); \ No newline at end of file diff --git a/develop_os/OS-ELM/SinActFun.m b/develop_os/OS-ELM/SinActFun.m index c9b836c..a4dc7ad 100755 --- a/develop_os/OS-ELM/SinActFun.m +++ b/develop_os/OS-ELM/SinActFun.m @@ -1,7 +1,7 @@ -function H = SinActFun(P,IW,Bias); - -%%%%%%%% Feedforward neural network using sine activation function -V=P*IW'; ind=ones(1,size(P,1)); -BiasMatrix=Bias(ind,:); -V=V+BiasMatrix; +function H = SinActFun(P,IW,Bias); + +%%%%%%%% Feedforward neural network using sine activation function +V=P*IW'; ind=ones(1,size(P,1)); +BiasMatrix=Bias(ind,:); +V=V+BiasMatrix; H = sin(V); \ No newline at end of file diff --git a/develop_solver/When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings - EVGA Forums.htm b/develop_solver/When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings - EVGA Forums.htm index 44e7848..261871c 100644 --- a/develop_solver/When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings - EVGA Forums.htm +++ b/develop_solver/When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings - EVGA Forums.htm @@ -1,1643 +1,1643 @@ - - - - - - - - - When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings - EVGA Forums - - - - - - - - - -
-
- - - - - -
- - - - - - - - - - - - - - - - - - -
- - - -
- - - -
- - - -
- -
- -
- - - - - -
-
- - -
- -
- -
- - - -
- -
    -
  • Forums
  • -
  • Posts -
    -
    -
    Latest Posts
    -
    Active Posts
    -
    Recently Visited
    -
    Search Results
    - -
    - -
    -
  • -
  • Blog -
    -
    -
    Recent Blog Posts
    - -
    -
    -
  • - -
  • Photos -
    -
    -
    Recent Photos
    -
    My Favorites
    - -
    -
    -
  • - -
  • PMs - -
    -
    -
    Unread PMs
    -
    Inbox
    - -
    -
    -
  • -
  • Page Extras
  • -
  • Menu -
      -
    • -
      - - Forum Themes - - -
      -
    • - -
    -
  • -
  • Back to Mobile 
-
-
-
    - -
-
- -
- - -
- - - - - - - - - - - - - - -
- - - -
- - - - - -
-
-

- Hot!When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings -

-
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
Author
- -
- - - Post - - - -
- - -
- -
- - - -
- bcavnaugh - -
-
- - - -
-
- Omnipotent Enthusiast -
- -
- -
    -
  • Total Posts : 9382
  • - -
  • Reward points : 0
  • -
  • Joined: 9/19/2012
  • Location: Colorado Affiliate Code: E5L3CTGE12
  • -
  • Status: offline
  • -
  • Ribbons : 50
  • -
  • - -
-
-
-
- -
- - - -
- -
- - - - Monday, November 17, 2014 1:42 AM - - (permalink) - - - -
-
- - - -
- -
- - For Crunching or Folding on Titans, I noted a new setting in under the NVIDIA Control Panel Manage 3D Settings.
When would we want to use this setting? The Default is None.
 



 
-
post edited by bcavnaugh - Monday, November 17, 2014 1:45 AM
-

Attached Image(s)

-
-
- - - -
-

Dark Titan  IV Formula  IV Formula  V Extreme  2P   4P  X99GTX980Cruncher  HFM  E5L3CTGE12

 [
-
- -
- - - - - - - #1 -
- -
- -
- - - -
- - - -

6 Replies - - Related Threads

- -
- -
    -
    -
    - -
    - -
    - - - -
    - cuarc001 - -
    -
    - - - -
    -
    - ACX Member -
    - -
    - -
      -
    • Total Posts : 253
    • - -
    • Reward points : 0
    • -
    • Joined: 9/14/2012
    • -
    • Status: offline
    • -
    • Ribbons : 5
    • - - -
    -
    -
    -
    - -
    - - - -
    - -
    - Re: When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings - - - Monday, November 17, 2014 2:51 AM - - (permalink) - - - -
    -
    - - - -
    - -
    - - PrimeGrid's GFN work units and Milkyway's work units for - GPU's would require double precision. However, I don't have any Titan's - and therefore don't know if you really have to toggle it or not.
    - - -
    -
    - - - -
    -

    Coleslaw - BOINC
    Gilthanis - HardForums [H] DC'er of the Month 7/13, 7/14 and [H] DC'er of the Year 2014
    Coleslaw - DC-Vault

    My Primes: 6827121898575*2^666668-1, 1107*2^1157095+1, and 1842164752965*2^1290000-1
    EVGA Affiliate Code LSBAU9GE7A
    -
    - -
    - - - - - - - #2 -
    - -
    - - - -
    - -
    - - - -
    - bcavnaugh - -
    -
    - - - -
    -
    - Omnipotent Enthusiast -
    - -
    - -
      -
    • Total Posts : 9382
    • - -
    • Reward points : 0
    • -
    • Joined: 9/19/2012
    • Location: Colorado Affiliate Code: E5L3CTGE12
    • -
    • Status: offline
    • -
    • Ribbons : 50
    • -
    • - -
    -
    -
    -
    - -
    - - - -
    - -
    - Re: When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings - - - Monday, November 17, 2014 3:15 AM - - (permalink) - - - -
    -
    - - - -
    - -
    - -
    cuarc001
    PrimeGrid's - GFN work units and Milkyway's work units for GPU's would require double - precision. However, I don't have any Titan's and therefore don't know -if you really have to toggle it or not.


    Thanks,
    I run both now but gave never added more with this toggle.
    For Milkyway I really would not see any real change but maybe for GFN I would.
    I will have to test this then:
     
    Down to only 100 Hours.

     
    Looks like it settled Down to only 95 Hours.

     
    Generalized Fermat Prime Search n=20 (GFN-Short)
    b1048576+1 (or b220+1)
    Recent average GPU time: 15:55:10
     
    Generalized Fermat Prime Search World Record n=22 (GFN-WR)
    b4194304+1 (or b222+1)
    Recent average GPU time: 129:43:43
    CUDA Run

     
    Next I will run only OpenCL and now the wait and see starts.
     
     
    -
    post edited by bcavnaugh - Monday, November 17, 2014 5:00 AM
    -

    Attached Image(s)

    -
    -
    - - - -
    -

    Dark Titan  IV Formula  IV Formula  V Extreme  2P   4P  X99GTX980Cruncher  HFM  E5L3CTGE12

     [
    -
    - -
    - - - - - - - #3 -
    - -
    - - - -
    - -
    - - - -
    - bcavnaugh - -
    -
    - - - -
    -
    - Omnipotent Enthusiast -
    - -
    - -
      -
    • Total Posts : 9382
    • - -
    • Reward points : 0
    • -
    • Joined: 9/19/2012
    • Location: Colorado Affiliate Code: E5L3CTGE12
    • -
    • Status: offline
    • -
    • Ribbons : 50
    • -
    • - -
    -
    -
    -
    - -
    - - - -
    - -
    - Re: When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings - - - Monday, November 17, 2014 3:34 AM - - (permalink) - - - -
    -
    - - - -
    - -
    - - Some More Info:
     
     
    I see no real CPU Usage.

    -
    post edited by bcavnaugh - Monday, November 17, 2014 3:39 AM
    -

    Attached Image(s)

    -
    -
    - - - -
    -

    Dark Titan  IV Formula  IV Formula  V Extreme  2P   4P  X99GTX980Cruncher  HFM  E5L3CTGE12

     [
    -
    - -
    - - - - - - - #4 -
    - -
    - - - -
    - -
    - - - -
    - linuxrouter - -
    -
    - - - -
    -
    - Omnipotent Enthusiast -
    - -
    - -
      -
    • Total Posts : 8038
    • - -
    • Reward points : 0
    • -
    • Joined: 2/28/2008
    • -
    • Status: offline
    • -
    • Ribbons : 102
    • - - -
    -
    -
    -
    - -
    - - - -
    - -
    - Re: When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings - - - Wednesday, November 19, 2014 11:15 PM - - (permalink) - - - -
    -
    - - - -
    - -
    - - I recall a post from a user on Milkyway@Home who tested -the Titan with double precision mode enabled. He or she had to run -multiple tasks at a time with an app_info.xml to see closer to full -benefit of what the Titan could do. For some reason, running a single -task did not scale well like it does with the AMD 7970.
    - - -
    -
    - - - -
    -

    CaseLabs Mercury S8 - ASRock X99 Professional - Intel 5960x @ 4.1 - G.Skill 16GB 2666 MHz CL13 - 2x EVGA 980 Ti Hybrid - EVGA 1600w Titanium PSU
    HP LP3065
    Affiliate Code: OZJ-0TQ-41NJ
    -
    - -
    - - - - - - - #5 -
    - -
    - - - -
    - -
    - - - -
    - bcavnaugh - -
    -
    - - - -
    -
    - Omnipotent Enthusiast -
    - -
    - -
      -
    • Total Posts : 9382
    • - -
    • Reward points : 0
    • -
    • Joined: 9/19/2012
    • Location: Colorado Affiliate Code: E5L3CTGE12
    • -
    • Status: offline
    • -
    • Ribbons : 50
    • -
    • - -
    -
    -
    -
    - -
    - - - -
    - -
    - Re: When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings - - - Wednesday, November 19, 2014 11:23 PM - - (permalink) - - - -
    -
    - - - -
    - -
    - - I have to LONG running tasks running but they only run 10 to 12 hours a day.

    I might be able to add Milkyway@Home to my 3rd card and split it in to 3 Tasks at once.
     
    Will Post what I see.
    I will say I remember that before it would take 11-12 minutes to complete and now they start at less the 7 minutes.
    First Run Completed in 6.02 minutes. But also I have no real use of my computer when running all three cards.

     
    I to might be that I am using Driver 344.75 now.
    -
    post edited by bcavnaugh - Wednesday, November 19, 2014 11:37 PM
    -

    Attached Image(s)

    -
    -
    - - - -
    -

    Dark Titan  IV Formula  IV Formula  V Extreme  2P   4P  X99GTX980Cruncher  HFM  E5L3CTGE12

     [
    -
    - -
    - - - - - - - #6 -
    - -
    - - - -
    - -
    - - - -
    - bcavnaugh - -
    -
    - - - -
    -
    - Omnipotent Enthusiast -
    - -
    - -
      -
    • Total Posts : 9382
    • - -
    • Reward points : 0
    • -
    • Joined: 9/19/2012
    • Location: Colorado Affiliate Code: E5L3CTGE12
    • -
    • Status: offline
    • -
    • Ribbons : 50
    • -
    • - -
    -
    -
    -
    - -
    - - - -
    - -
    - Re: When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings - - - Thursday, November 20, 2014 0:17 PM - - (permalink) - - - -
    -
    - - - -
    - -
    - - First Run Completed in 3.07 minutes.
    -
    post edited by bcavnaugh - Thursday, November 20, 2014 0:18 PM
    -

    Attached Image(s)

    -
    -
    - - - -
    -

    Dark Titan  IV Formula  IV Formula  V Extreme  2P   4P  X99GTX980Cruncher  HFM  E5L3CTGE12

     [
    -
    - -
    - - - - - - - #7 -
    - -
    - - - -
    - - - - - - -
    -
    - - - - - - -
    - - - - - -
    -
    - Jump to: - -
    -
    -
    - - - - - - - - - -
    - - -
    - - -
    -
    - -
    - - - - - - - -
    - - - - - - - - + + + + + + + + + When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings - EVGA Forums + + + + + + + + + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + +
    + + + +
    + +
    + +
    + + + + + +
    +
    + + +
    + +
    + +
    + + + +
    + +
      +
    • Forums
    • +
    • Posts +
      +
      +
      Latest Posts
      +
      Active Posts
      +
      Recently Visited
      +
      Search Results
      + +
      + +
      +
    • +
    • Blog +
      +
      +
      Recent Blog Posts
      + +
      +
      +
    • + +
    • Photos +
      +
      +
      Recent Photos
      +
      My Favorites
      + +
      +
      +
    • + +
    • PMs + +
      +
      +
      Unread PMs
      +
      Inbox
      + +
      +
      +
    • +
    • Page Extras
    • +
    • Menu +
        +
      • +
        + + Forum Themes + + +
        +
      • + +
      +
    • +
    • Back to Mobile 
    +
    +
    +
      + +
    +
    + +
    + + +
    + + + + + + + + + + + + + + +
    + + + +
    + + + + + +
    +
    +

    + Hot!When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings +

    +
    + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    Author
    + +
    + + + Post + + + +
    + + +
    + +
    + + + +
    + bcavnaugh + +
    +
    + + + +
    +
    + Omnipotent Enthusiast +
    + +
    + +
      +
    • Total Posts : 9382
    • + +
    • Reward points : 0
    • +
    • Joined: 9/19/2012
    • Location: Colorado Affiliate Code: E5L3CTGE12
    • +
    • Status: offline
    • +
    • Ribbons : 50
    • +
    • + +
    +
    +
    +
    + +
    + + + +
    + +
    + + + + Monday, November 17, 2014 1:42 AM + + (permalink) + + + +
    +
    + + + +
    + +
    + + For Crunching or Folding on Titans, I noted a new setting in under the NVIDIA Control Panel Manage 3D Settings.
    When would we want to use this setting? The Default is None.
     



     
    +
    post edited by bcavnaugh - Monday, November 17, 2014 1:45 AM
    +

    Attached Image(s)

    +
    +
    + + + +
    +

    Dark Titan  IV Formula  IV Formula  V Extreme  2P   4P  X99GTX980Cruncher  HFM  E5L3CTGE12

     [
    +
    + +
    + + + + + + + #1 +
    + +
    + +
    + + + +
    + + + +

    6 Replies + + Related Threads

    + +
    + +
      +
      +
      + +
      + +
      + + + +
      + cuarc001 + +
      +
      + + + +
      +
      + ACX Member +
      + +
      + +
        +
      • Total Posts : 253
      • + +
      • Reward points : 0
      • +
      • Joined: 9/14/2012
      • +
      • Status: offline
      • +
      • Ribbons : 5
      • + + +
      +
      +
      +
      + +
      + + + +
      + +
      + Re: When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings + + + Monday, November 17, 2014 2:51 AM + + (permalink) + + + +
      +
      + + + +
      + +
      + + PrimeGrid's GFN work units and Milkyway's work units for + GPU's would require double precision. However, I don't have any Titan's + and therefore don't know if you really have to toggle it or not.
      + + +
      +
      + + + +
      +

      Coleslaw - BOINC
      Gilthanis - HardForums [H] DC'er of the Month 7/13, 7/14 and [H] DC'er of the Year 2014
      Coleslaw - DC-Vault

      My Primes: 6827121898575*2^666668-1, 1107*2^1157095+1, and 1842164752965*2^1290000-1
      EVGA Affiliate Code LSBAU9GE7A
      +
      + +
      + + + + + + + #2 +
      + +
      + + + +
      + +
      + + + +
      + bcavnaugh + +
      +
      + + + +
      +
      + Omnipotent Enthusiast +
      + +
      + +
        +
      • Total Posts : 9382
      • + +
      • Reward points : 0
      • +
      • Joined: 9/19/2012
      • Location: Colorado Affiliate Code: E5L3CTGE12
      • +
      • Status: offline
      • +
      • Ribbons : 50
      • +
      • + +
      +
      +
      +
      + +
      + + + +
      + +
      + Re: When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings + + + Monday, November 17, 2014 3:15 AM + + (permalink) + + + +
      +
      + + + +
      + +
      + +
      cuarc001
      PrimeGrid's + GFN work units and Milkyway's work units for GPU's would require double + precision. However, I don't have any Titan's and therefore don't know +if you really have to toggle it or not.


      Thanks,
      I run both now but gave never added more with this toggle.
      For Milkyway I really would not see any real change but maybe for GFN I would.
      I will have to test this then:
       
      Down to only 100 Hours.

       
      Looks like it settled Down to only 95 Hours.

       
      Generalized Fermat Prime Search n=20 (GFN-Short)
      b1048576+1 (or b220+1)
      Recent average GPU time: 15:55:10
       
      Generalized Fermat Prime Search World Record n=22 (GFN-WR)
      b4194304+1 (or b222+1)
      Recent average GPU time: 129:43:43
      CUDA Run

       
      Next I will run only OpenCL and now the wait and see starts.
       
       
      +
      post edited by bcavnaugh - Monday, November 17, 2014 5:00 AM
      +

      Attached Image(s)

      +
      +
      + + + +
      +

      Dark Titan  IV Formula  IV Formula  V Extreme  2P   4P  X99GTX980Cruncher  HFM  E5L3CTGE12

       [
      +
      + +
      + + + + + + + #3 +
      + +
      + + + +
      + +
      + + + +
      + bcavnaugh + +
      +
      + + + +
      +
      + Omnipotent Enthusiast +
      + +
      + +
        +
      • Total Posts : 9382
      • + +
      • Reward points : 0
      • +
      • Joined: 9/19/2012
      • Location: Colorado Affiliate Code: E5L3CTGE12
      • +
      • Status: offline
      • +
      • Ribbons : 50
      • +
      • + +
      +
      +
      +
      + +
      + + + +
      + +
      + Re: When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings + + + Monday, November 17, 2014 3:34 AM + + (permalink) + + + +
      +
      + + + +
      + +
      + + Some More Info:
       
       
      I see no real CPU Usage.

      +
      post edited by bcavnaugh - Monday, November 17, 2014 3:39 AM
      +

      Attached Image(s)

      +
      +
      + + + +
      +

      Dark Titan  IV Formula  IV Formula  V Extreme  2P   4P  X99GTX980Cruncher  HFM  E5L3CTGE12

       [
      +
      + +
      + + + + + + + #4 +
      + +
      + + + +
      + +
      + + + +
      + linuxrouter + +
      +
      + + + +
      +
      + Omnipotent Enthusiast +
      + +
      + +
        +
      • Total Posts : 8038
      • + +
      • Reward points : 0
      • +
      • Joined: 2/28/2008
      • +
      • Status: offline
      • +
      • Ribbons : 102
      • + + +
      +
      +
      +
      + +
      + + + +
      + +
      + Re: When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings + + + Wednesday, November 19, 2014 11:15 PM + + (permalink) + + + +
      +
      + + + +
      + +
      + + I recall a post from a user on Milkyway@Home who tested +the Titan with double precision mode enabled. He or she had to run +multiple tasks at a time with an app_info.xml to see closer to full +benefit of what the Titan could do. For some reason, running a single +task did not scale well like it does with the AMD 7970.
      + + +
      +
      + + + +
      +

      CaseLabs Mercury S8 - ASRock X99 Professional - Intel 5960x @ 4.1 - G.Skill 16GB 2666 MHz CL13 - 2x EVGA 980 Ti Hybrid - EVGA 1600w Titanium PSU
      HP LP3065
      Affiliate Code: OZJ-0TQ-41NJ
      +
      + +
      + + + + + + + #5 +
      + +
      + + + +
      + +
      + + + +
      + bcavnaugh + +
      +
      + + + +
      +
      + Omnipotent Enthusiast +
      + +
      + +
        +
      • Total Posts : 9382
      • + +
      • Reward points : 0
      • +
      • Joined: 9/19/2012
      • Location: Colorado Affiliate Code: E5L3CTGE12
      • +
      • Status: offline
      • +
      • Ribbons : 50
      • +
      • + +
      +
      +
      +
      + +
      + + + +
      + +
      + Re: When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings + + + Wednesday, November 19, 2014 11:23 PM + + (permalink) + + + +
      +
      + + + +
      + +
      + + I have to LONG running tasks running but they only run 10 to 12 hours a day.

      I might be able to add Milkyway@Home to my 3rd card and split it in to 3 Tasks at once.
       
      Will Post what I see.
      I will say I remember that before it would take 11-12 minutes to complete and now they start at less the 7 minutes.
      First Run Completed in 6.02 minutes. But also I have no real use of my computer when running all three cards.

       
      I to might be that I am using Driver 344.75 now.
      +
      post edited by bcavnaugh - Wednesday, November 19, 2014 11:37 PM
      +

      Attached Image(s)

      +
      +
      + + + +
      +

      Dark Titan  IV Formula  IV Formula  V Extreme  2P   4P  X99GTX980Cruncher  HFM  E5L3CTGE12

       [
      +
      + +
      + + + + + + + #6 +
      + +
      + + + +
      + +
      + + + +
      + bcavnaugh + +
      +
      + + + +
      +
      + Omnipotent Enthusiast +
      + +
      + +
        +
      • Total Posts : 9382
      • + +
      • Reward points : 0
      • +
      • Joined: 9/19/2012
      • Location: Colorado Affiliate Code: E5L3CTGE12
      • +
      • Status: offline
      • +
      • Ribbons : 50
      • +
      • + +
      +
      +
      +
      + +
      + + + +
      + +
      + Re: When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings + + + Thursday, November 20, 2014 0:17 PM + + (permalink) + + + +
      +
      + + + +
      + +
      + + First Run Completed in 3.07 minutes.
      +
      post edited by bcavnaugh - Thursday, November 20, 2014 0:18 PM
      +

      Attached Image(s)

      +
      +
      + + + +
      +

      Dark Titan  IV Formula  IV Formula  V Extreme  2P   4P  X99GTX980Cruncher  HFM  E5L3CTGE12

       [
      +
      + +
      + + + + + + + #7 +
      + +
      + + + +
      + + + + + + +
      +
      + + + + + + +
      + + + + + +
      +
      + Jump to: + +
      +
      +
      + + + + + + + + + +
      + + +
      + + +
      +
      + +
      + + + + + + + +
      + + + + + + + + \ No newline at end of file diff --git a/develop_solver/When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings - EVGA Forums_files/Javascript.js b/develop_solver/When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings - EVGA Forums_files/Javascript.js index 66176b7..8785350 100644 --- a/develop_solver/When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings - EVGA Forums_files/Javascript.js +++ b/develop_solver/When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings - EVGA Forums_files/Javascript.js @@ -1,4 +1,4 @@ -/* START Telerik.Web.UI.Common.Core.js */ +/* START Telerik.Web.UI.Common.Core.js */ (function(Q,o,P){var x,L=Object.prototype,q=Function.prototype,h=Array.prototype,e=L.toString,b=L.hasOwnProperty,d=h.slice,K="[object Object]",r="[object Function]",n="div",N="span",t="input",i="audio",O="type"; var B=h.forEach,G=h.map,H=h.reduce,I=h.reduceRight,A=h.filter,z=h.every,J=h.some,C=h.indexOf,F=h.lastIndexOf,D=Array.isArray,E=Object.keys,y=q.bind; var a=function(W,T,R){if(W==null){return; @@ -1280,9 +1280,9 @@ if(f.node===e){return c; }this.callback=null; }}; })(Telerik.Web.UI); - -/* END Telerik.Web.UI.Common.Core.js */ -/* START Telerik.Web.UI.Common.jQueryPlugins.js */ + +/* END Telerik.Web.UI.Common.Core.js */ +/* START Telerik.Web.UI.Common.jQueryPlugins.js */ if(typeof $telerik.$==="undefined"){$telerik.$=jQuery; /* * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ @@ -1502,9 +1502,9 @@ b=setTimeout(function(k){if(f!=null&&typeof f=="function"){f(k); }); }; })($telerik.$); - -/* END Telerik.Web.UI.Common.jQueryPlugins.js */ -/* START Telerik.Web.UI.Common.TouchScrollExtender.js */ + +/* END Telerik.Web.UI.Common.jQueryPlugins.js */ +/* START Telerik.Web.UI.Common.TouchScrollExtender.js */ (function(a){Type.registerNamespace("Telerik.Web.UI"); var b=Telerik.Web.UI; Telerik.Web.UI.TouchScrollExtender=function(c){this._containerElements=a(c); @@ -1685,9 +1685,9 @@ c.preventDefault(); }}; Telerik.Web.UI.TouchScrollExtender.registerClass("Telerik.Web.UI.TouchScrollExtender",null,Sys.IDisposable); })($telerik.$); - -/* END Telerik.Web.UI.Common.TouchScrollExtender.js */ -/* START Telerik.Web.UI.XmlHttpPanel.RadXmlHttpPanel.js */ + +/* END Telerik.Web.UI.Common.TouchScrollExtender.js */ +/* START Telerik.Web.UI.XmlHttpPanel.RadXmlHttpPanel.js */ Type.registerNamespace("Telerik.Web.UI"); (function(a,b){$telerik.toXmlHttpPanel=function(c){return c; }; @@ -1817,16 +1817,16 @@ b.RadXmlHttpPanelErrorEventArgs.prototype={get_errorMessage:function(){return th }}; b.RadXmlHttpPanelErrorEventArgs.registerClass("Telerik.Web.UI.RadXmlHttpPanelErrorEventArgs",Sys.EventArgs); })($telerik.$,Telerik.Web.UI); - -/* END Telerik.Web.UI.XmlHttpPanel.RadXmlHttpPanel.js */ -if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded(); -(function() { - function loadHandler() { - var hf = $get('RadScriptManager1_TSM'); - if (!hf) return; - if (!hf._RSM_init) { hf._RSM_init = true; hf.value = ''; } - hf.value += ';;Telerik.Web.UI, Version=2013.3.1324.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4:en-US:597c6a37-3447-4509-ba46-0faaa25cf6f9:16e4e7cd:24ee1bba:f46195d3:9cdfc6e7'; - Sys.Application.remove_load(loadHandler); - }; - Sys.Application.add_load(loadHandler); -})(); + +/* END Telerik.Web.UI.XmlHttpPanel.RadXmlHttpPanel.js */ +if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded(); +(function() { + function loadHandler() { + var hf = $get('RadScriptManager1_TSM'); + if (!hf) return; + if (!hf._RSM_init) { hf._RSM_init = true; hf.value = ''; } + hf.value += ';;Telerik.Web.UI, Version=2013.3.1324.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4:en-US:597c6a37-3447-4509-ba46-0faaa25cf6f9:16e4e7cd:24ee1bba:f46195d3:9cdfc6e7'; + Sys.Application.remove_load(loadHandler); + }; + Sys.Application.add_load(loadHandler); +})(); diff --git a/develop_solver/When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings - EVGA Forums_files/Javascript_002.js b/develop_solver/When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings - EVGA Forums_files/Javascript_002.js index 0acb014..80d0cd8 100644 --- a/develop_solver/When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings - EVGA Forums_files/Javascript_002.js +++ b/develop_solver/When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings - EVGA Forums_files/Javascript_002.js @@ -1,29 +1,29 @@ -/* START MicrosoftAjax.js */ -//---------------------------------------------------------- -// Copyright (C) Microsoft Corporation. All rights reserved. -//---------------------------------------------------------- -// MicrosoftAjax.js -Function.__typeName="Function";Function.__class=true;Function.createCallback=function(b,a){return function(){var e=arguments.length;if(e>0){var d=[];for(var c=0;c=d)break;a=Function._validateParameter(g[b],f,h);if(a){a.popStackFrame();return a}}return null};Function._validateParameterCount=function(j,d,i){var a,c,b=d.length,e=j.length;if(eb){c=true;for(a=0;a0&&(d=0};Array.dequeue=function(a){return a.shift()};Array.forEach=function(b,e,d){for(var a=0,f=b.length;a=0)b.splice(a,1);return a>=0};Array.removeAt=function(a,b){a.splice(b,1)};Sys._indexOf=function(d,e,a){if(typeof e==="undefined")return -1;var c=d.length;if(c!==0){a=a-0;if(isNaN(a))a=0;else{if(isFinite(a))a=a-a%1;if(a<0)a=Math.max(0,c+a)}for(var b=a;b-1){Sys.Browser.agent=Sys.Browser.InternetExplorer;Sys.Browser.version=parseFloat(navigator.userAgent.match(/MSIE (\d+\.\d+)/)[1]);if(Sys.Browser.version>=8)if(document.documentMode>=7)Sys.Browser.documentMode=document.documentMode;Sys.Browser.hasDebuggerStatement=true}else if(navigator.userAgent.indexOf(" Firefox/")>-1){Sys.Browser.agent=Sys.Browser.Firefox;Sys.Browser.version=parseFloat(navigator.userAgent.match(/Firefox\/(\d+\.\d+)/)[1]);Sys.Browser.name="Firefox";Sys.Browser.hasDebuggerStatement=true}else if(navigator.userAgent.indexOf(" AppleWebKit/")>-1){Sys.Browser.agent=Sys.Browser.Safari;Sys.Browser.version=parseFloat(navigator.userAgent.match(/AppleWebKit\/(\d+(\.\d+)?)/)[1]);Sys.Browser.name="Safari"}else if(navigator.userAgent.indexOf("Opera/")>-1)Sys.Browser.agent=Sys.Browser.Opera;Sys.EventArgs=function(){};Sys.EventArgs.registerClass("Sys.EventArgs");Sys.EventArgs.Empty=new Sys.EventArgs;Sys.CancelEventArgs=function(){Sys.CancelEventArgs.initializeBase(this);this._cancel=false};Sys.CancelEventArgs.prototype={get_cancel:function(){return this._cancel},set_cancel:function(a){this._cancel=a}};Sys.CancelEventArgs.registerClass("Sys.CancelEventArgs",Sys.EventArgs);Type.registerNamespace("Sys.UI");Sys._Debug=function(){};Sys._Debug.prototype={_appendConsole:function(a){if(typeof Debug!=="undefined"&&Debug.writeln)Debug.writeln(a);if(window.console&&window.console.log)window.console.log(a);if(window.opera)window.opera.postError(a);if(window.debugService)window.debugService.trace(a)},_appendTrace:function(b){var a=document.getElementById("TraceConsole");if(a&&a.tagName.toUpperCase()==="TEXTAREA")a.value+=b+"\n"},assert:function(c,a,b){if(!c){a=b&&this.assert.caller?String.format(Sys.Res.assertFailedCaller,a,this.assert.caller):String.format(Sys.Res.assertFailed,a);if(confirm(String.format(Sys.Res.breakIntoDebugger,a)))this.fail(a)}},clearTrace:function(){var a=document.getElementById("TraceConsole");if(a&&a.tagName.toUpperCase()==="TEXTAREA")a.value=""},fail:function(message){this._appendConsole(message);if(Sys.Browser.hasDebuggerStatement)eval("debugger")},trace:function(a){this._appendConsole(a);this._appendTrace(a)},traceDump:function(a,b){var c=this._traceDump(a,b,true)},_traceDump:function(a,c,f,b,d){c=c?c:"traceDump";b=b?b:"";if(a===null){this.trace(b+c+": null");return}switch(typeof a){case "undefined":this.trace(b+c+": Undefined");break;case "number":case "string":case "boolean":this.trace(b+c+": "+a);break;default:if(Date.isInstanceOfType(a)||RegExp.isInstanceOfType(a)){this.trace(b+c+": "+a.toString());break}if(!d)d=[];else if(Array.contains(d,a)){this.trace(b+c+": ...");return}Array.add(d,a);if(a==window||a===document||window.HTMLElement&&a instanceof HTMLElement||typeof a.nodeName==="string"){var k=a.tagName?a.tagName:"DomElement";if(a.id)k+=" - "+a.id;this.trace(b+c+" {"+k+"}")}else{var i=Object.getTypeName(a);this.trace(b+c+(typeof i==="string"?" {"+i+"}":""));if(b===""||f){b+=" ";var e,j,l,g,h;if(Array.isInstanceOfType(a)){j=a.length;for(e=0;e=0;d--){var k=h[d].trim();b=a[k];if(typeof b!=="number")throw Error.argument("value",String.format(Sys.Res.enumInvalidValue,c.split(",")[d].trim(),this.__typeName));j|=b}return j}}function Sys$Enum$toString(c){if(typeof c==="undefined"||c===null)return this.__string;var d=this.prototype,a;if(!this.__flags||c===0){for(a in d)if(d[a]===c)return a}else{var b=this.__sortedValues;if(!b){b=[];for(a in d)b[b.length]={key:a,value:d[a]};b.sort(function(a,b){return a.value-b.value});this.__sortedValues=b}var e=[],g=c;for(a=b.length-1;a>=0;a--){var h=b[a],f=h.value;if(f===0)continue;if((f&c)===f){e[e.length]=h.key;g-=f;if(g===0)break}}if(e.length&&g===0)return e.reverse().join(", ")}return ""}Type.prototype.registerEnum=function(b,c){Sys.__upperCaseTypes[b.toUpperCase()]=this;for(var a in this.prototype)this[a]=this.prototype[a];this.__typeName=b;this.parse=Sys$Enum$parse;this.__string=this.toString();this.toString=Sys$Enum$toString;this.__flags=c;this.__enum=true};Type.isEnum=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__enum};Type.isFlags=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__flags};Sys.CollectionChange=function(e,a,c,b,d){this.action=e;if(a)if(!(a instanceof Array))a=[a];this.newItems=a||null;if(typeof c!=="number")c=-1;this.newStartingIndex=c;if(b)if(!(b instanceof Array))b=[b];this.oldItems=b||null;if(typeof d!=="number")d=-1;this.oldStartingIndex=d};Sys.CollectionChange.registerClass("Sys.CollectionChange");Sys.NotifyCollectionChangedAction=function(){throw Error.notImplemented()};Sys.NotifyCollectionChangedAction.prototype={add:0,remove:1,reset:2};Sys.NotifyCollectionChangedAction.registerEnum("Sys.NotifyCollectionChangedAction");Sys.NotifyCollectionChangedEventArgs=function(a){this._changes=a;Sys.NotifyCollectionChangedEventArgs.initializeBase(this)};Sys.NotifyCollectionChangedEventArgs.prototype={get_changes:function(){return this._changes||[]}};Sys.NotifyCollectionChangedEventArgs.registerClass("Sys.NotifyCollectionChangedEventArgs",Sys.EventArgs);Sys.Observer=function(){};Sys.Observer.registerClass("Sys.Observer");Sys.Observer.makeObservable=function(a){var c=a instanceof Array,b=Sys.Observer;if(a.setValue===b._observeMethods.setValue)return a;b._addMethods(a,b._observeMethods);if(c)b._addMethods(a,b._arrayMethods);return a};Sys.Observer._addMethods=function(c,b){for(var a in b)c[a]=b[a]};Sys.Observer._addEventHandler=function(c,a,b){Sys.Observer._getContext(c,true).events._addHandler(a,b)};Sys.Observer.addEventHandler=function(c,a,b){Sys.Observer._addEventHandler(c,a,b)};Sys.Observer._removeEventHandler=function(c,a,b){Sys.Observer._getContext(c,true).events._removeHandler(a,b)};Sys.Observer.removeEventHandler=function(c,a,b){Sys.Observer._removeEventHandler(c,a,b)};Sys.Observer.raiseEvent=function(b,e,d){var c=Sys.Observer._getContext(b);if(!c)return;var a=c.events.getHandler(e);if(a)a(b,d)};Sys.Observer.addPropertyChanged=function(b,a){Sys.Observer._addEventHandler(b,"propertyChanged",a)};Sys.Observer.removePropertyChanged=function(b,a){Sys.Observer._removeEventHandler(b,"propertyChanged",a)};Sys.Observer.beginUpdate=function(a){Sys.Observer._getContext(a,true).updating=true};Sys.Observer.endUpdate=function(b){var a=Sys.Observer._getContext(b);if(!a||!a.updating)return;a.updating=false;var d=a.dirty;a.dirty=false;if(d){if(b instanceof Array){var c=a.changes;a.changes=null;Sys.Observer.raiseCollectionChanged(b,c)}Sys.Observer.raisePropertyChanged(b,"")}};Sys.Observer.isUpdating=function(b){var a=Sys.Observer._getContext(b);return a?a.updating:false};Sys.Observer._setValue=function(a,j,g){var b,f,k=a,d=j.split(".");for(var i=0,m=d.length-1;i-1&&ac.Calendar.TwoDigitYearMax)a-=100}return a};Date._getEra=function(e,c){if(!c)return 0;var b,d=e.getTime();for(var a=0,f=c.length;a=b)return a}return 0};Date._getEraYear=function(d,b,e,c){var a=d.getFullYear();if(!c&&b.eras)a-=b.eras[e+3];return a};Date._getParseRegExp=function(b,e){if(!b._parseRegExp)b._parseRegExp={};else if(b._parseRegExp[e])return b._parseRegExp[e];var c=Date._expandFormat(b,e);c=c.replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g,"\\\\$1");var a=new Sys.StringBuilder("^"),j=[],f=0,i=0,h=Date._getTokenRegExp(),d;while((d=h.exec(c))!==null){var l=c.slice(f,d.index);f=h.lastIndex;i+=Date._appendPreOrPostMatch(l,a);if(i%2===1){a.append(d[0]);continue}switch(d[0]){case "dddd":case "ddd":case "MMMM":case "MMM":case "gg":case "g":a.append("(\\D+)");break;case "tt":case "t":a.append("(\\D*)");break;case "yyyy":a.append("(\\d{4})");break;case "fff":a.append("(\\d{3})");break;case "ff":a.append("(\\d{2})");break;case "f":a.append("(\\d)");break;case "dd":case "d":case "MM":case "M":case "yy":case "y":case "HH":case "H":case "hh":case "h":case "mm":case "m":case "ss":case "s":a.append("(\\d\\d?)");break;case "zzz":a.append("([+-]?\\d\\d?:\\d{2})");break;case "zz":case "z":a.append("([+-]?\\d\\d?)");break;case "/":a.append("(\\"+b.DateSeparator+")")}Array.add(j,d[0])}Date._appendPreOrPostMatch(c.slice(f),a);a.append("$");var k=a.toString().replace(/\s+/g,"\\s+"),g={"regExp":k,"groups":j};b._parseRegExp[e]=g;return g};Date._getTokenRegExp=function(){return /\/|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z|gg|g/g};Date.parseLocale=function(a){return Date._parse(a,Sys.CultureInfo.CurrentCulture,arguments)};Date.parseInvariant=function(a){return Date._parse(a,Sys.CultureInfo.InvariantCulture,arguments)};Date._parse=function(h,d,i){var a,c,b,f,e,g=false;for(a=1,c=i.length;a31)return null;break;case "MMMM":c=k._getMonthIndex(a);if(c<0||c>11)return null;break;case "MMM":c=k._getAbbrMonthIndex(a);if(c<0||c>11)return null;break;case "M":case "MM":c=parseInt(a,10)-1;if(c<0||c>11)return null;break;case "y":case "yy":e=Date._expandYear(g,parseInt(a,10));if(e<0||e>9999)return null;break;case "yyyy":e=parseInt(a,10);if(e<0||e>9999)return null;break;case "h":case "hh":d=parseInt(a,10);if(d===12)d=0;if(d<0||d>11)return null;break;case "H":case "HH":d=parseInt(a,10);if(d<0||d>23)return null;break;case "m":case "mm":p=parseInt(a,10);if(p<0||p>59)return null;break;case "s":case "ss":q=parseInt(a,10);if(q<0||q>59)return null;break;case "tt":case "t":var z=a.toUpperCase();v=z===g.PMDesignator.toUpperCase();if(!v&&z!==g.AMDesignator.toUpperCase())return null;break;case "f":f=parseInt(a,10)*100;if(f<0||f>999)return null;break;case "ff":f=parseInt(a,10)*10;if(f<0||f>999)return null;break;case "fff":f=parseInt(a,10);if(f<0||f>999)return null;break;case "dddd":i=k._getDayIndex(a);if(i<0||i>6)return null;break;case "ddd":i=k._getAbbrDayIndex(a);if(i<0||i>6)return null;break;case "zzz":var u=a.split(/:/);if(u.length!==2)return null;h=parseInt(u[0],10);if(h<-12||h>13)return null;var m=parseInt(u[1],10);if(m<0||m>59)return null;l=h*60+(a.startsWith("-")?-m:m);break;case "z":case "zz":h=parseInt(a,10);if(h<-12||h>13)return null;l=h*60;break;case "g":case "gg":var o=a;if(!o||!g.eras)return null;o=o.toLowerCase().trim();for(var r=0,F=g.eras.length;r0)return this.toLocaleString();else return this.toString();var o=["n %","n%","%n"],n=["-n %","-n%","-%n"],p=["(n)","-n","- n","n-","n -"],m=["$n","n$","$ n","n $"],l=["($n)","-$n","$-n","$n-","(n$)","-n$","n-$","n$-","-n $","-$ n","n $-","$ n-","$ -n","n- $","($ n)","(n $)"];function g(a,c,d){for(var b=a.length;b1?parseInt(e[1]):0;e=b.split(".");b=e[0];a=e.length>1?e[1]:"";var q;if(c>0){a=g(a,c,false);b+=a.slice(0,c);a=a.substr(c)}else if(c<0){c=-c;b=g(b,c+1,true);a=b.slice(-c,b.length)+a;b=b.slice(0,-c)}if(i>0){if(a.length>i)a=a.slice(0,i);else a=g(a,i,false);a=p+a}else a="";var d=b.length-1,f="";while(d>=0){if(h===0||h>d)if(f.length>0)return b.slice(0,d+1)+n+f+a;else return b.slice(0,d+1)+a;if(f.length>0)f=b.slice(d-h+1,d+1)+n+f;else f=b.slice(d-h+1,d+1);d-=h;if(k1)b=parseInt(e.slice(1),10);var c;switch(e.charAt(0)){case "d":case "D":c="n";if(b!==-1)d=g(""+d,b,true);if(this<0)d=-d;break;case "c":case "C":if(this<0)c=l[a.CurrencyNegativePattern];else c=m[a.CurrencyPositivePattern];if(b===-1)b=a.CurrencyDecimalDigits;d=i(Math.abs(this),b,a.CurrencyGroupSizes,a.CurrencyGroupSeparator,a.CurrencyDecimalSeparator);break;case "n":case "N":if(this<0)c=p[a.NumberNegativePattern];else c="n";if(b===-1)b=a.NumberDecimalDigits;d=i(Math.abs(this),b,a.NumberGroupSizes,a.NumberGroupSeparator,a.NumberDecimalSeparator);break;case "p":case "P":if(this<0)c=n[a.PercentNegativePattern];else c=o[a.PercentPositivePattern];if(b===-1)b=a.PercentDecimalDigits;d=i(Math.abs(this)*100,b,a.PercentGroupSizes,a.PercentGroupSeparator,a.PercentDecimalSeparator);break;default:throw Error.format(Sys.Res.formatBadFormatSpecifier)}var k=/n|\$|-|%/g,f="";for(;true;){var q=k.lastIndex,h=k.exec(c);f+=c.slice(q,h?h.index:c.length);if(!h)break;switch(h[0]){case "n":f+=d;break;case "$":f+=a.CurrencySymbol;break;case "-":if(/[1-9]/.test(d))f+=a.NegativeSign;break;case "%":f+=a.PercentSymbol}}return f};Sys.CultureInfo=function(c,b,a){this.name=c;this.numberFormat=b;this.dateTimeFormat=a};Sys.CultureInfo.prototype={_getDateTimeFormats:function(){if(!this._dateTimeFormats){var a=this.dateTimeFormat;this._dateTimeFormats=[a.MonthDayPattern,a.YearMonthPattern,a.ShortDatePattern,a.ShortTimePattern,a.LongDatePattern,a.LongTimePattern,a.FullDateTimePattern,a.RFC1123Pattern,a.SortableDateTimePattern,a.UniversalSortableDateTimePattern]}return this._dateTimeFormats},_getIndex:function(c,d,e){var b=this._toUpper(c),a=Array.indexOf(d,b);if(a===-1)a=Array.indexOf(e,b);return a},_getMonthIndex:function(a){if(!this._upperMonths){this._upperMonths=this._toUpperArray(this.dateTimeFormat.MonthNames);this._upperMonthsGenitive=this._toUpperArray(this.dateTimeFormat.MonthGenitiveNames)}return this._getIndex(a,this._upperMonths,this._upperMonthsGenitive)},_getAbbrMonthIndex:function(a){if(!this._upperAbbrMonths){this._upperAbbrMonths=this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames);this._upperAbbrMonthsGenitive=this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthGenitiveNames)}return this._getIndex(a,this._upperAbbrMonths,this._upperAbbrMonthsGenitive)},_getDayIndex:function(a){if(!this._upperDays)this._upperDays=this._toUpperArray(this.dateTimeFormat.DayNames);return Array.indexOf(this._upperDays,this._toUpper(a))},_getAbbrDayIndex:function(a){if(!this._upperAbbrDays)this._upperAbbrDays=this._toUpperArray(this.dateTimeFormat.AbbreviatedDayNames);return Array.indexOf(this._upperAbbrDays,this._toUpper(a))},_toUpperArray:function(c){var b=[];for(var a=0,d=c.length;a0)a.append(",");Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(b[c],a,false,g)}a.append("]")}else{if(Date.isInstanceOfType(b)){a.append('"\\/Date(');a.append(b.getTime());a.append(')\\/"');break}var d=[],f=0;for(var e in b){if(e.startsWith("$"))continue;if(e===Sys.Serialization.JavaScriptSerializer._serverTypeFieldName&&f!==0){d[f++]=d[0];d[0]=e}else d[f++]=e}if(i)d.sort();a.append("{");var j=false;for(c=0;c=0;c--){var f=d[c];if(!g||f.autoRemove)$removeHandler(a,b,f.handler)}}a._events=null}};Sys.UI.DomEvent._disposeHandlers=function(){Sys.UI.DomEvent._clearHandlers(this,true);var b=this._chainDispose,a=typeof b;if(a!=="undefined"){this.dispose=b;this._chainDispose=null;if(a==="function")this.dispose()}};var $removeHandler=Sys.UI.DomEvent.removeHandler=function(b,a,c){Sys.UI.DomEvent._removeHandler(b,a,c)};Sys.UI.DomEvent._removeHandler=function(a,e,f){var d=null,c=a._events[e];for(var b=0,g=c.length;b=3){d+=parseInt(b.borderLeftWidth);e+=parseInt(b.borderTopWidth)}}b=Sys.UI.DomElement._getCurrentStyle(c);var h=b?b.position:null;if(!h||h!=="absolute")for(a=c.parentNode;a;a=a.parentNode){f=a.tagName?a.tagName.toUpperCase():null;if(f!=="BODY"&&f!=="HTML"&&(a.scrollLeft||a.scrollTop)){d-=a.scrollLeft||0;e-=a.scrollTop||0}b=Sys.UI.DomElement._getCurrentStyle(a);var i=b?b.position:null;if(i&&i==="absolute")break}return new Sys.UI.Point(d,e)};else Sys.UI.DomElement.getLocation=function(d){if(d.window&&d.window===d||d.nodeType===9)return new Sys.UI.Point(0,0);var e=0,f=0,a,i=null,g=null,b=null;for(a=d;a;i=a,(g=b,a=a.offsetParent)){var c=a.tagName?a.tagName.toUpperCase():null;b=Sys.UI.DomElement._getCurrentStyle(a);if((a.offsetLeft||a.offsetTop)&&!(c==="BODY"&&(!g||g.position!=="absolute"))){e+=a.offsetLeft;f+=a.offsetTop}if(i!==null&&b){if(c!=="TABLE"&&c!=="TD"&&c!=="HTML"){e+=parseInt(b.borderLeftWidth)||0;f+=parseInt(b.borderTopWidth)||0}if(c==="TABLE"&&(b.position==="relative"||b.position==="absolute")){e+=parseInt(b.marginLeft)||0;f+=parseInt(b.marginTop)||0}}}b=Sys.UI.DomElement._getCurrentStyle(d);var h=b?b.position:null;if(!h||h!=="absolute")for(a=d.parentNode;a;a=a.parentNode){c=a.tagName?a.tagName.toUpperCase():null;if(c!=="BODY"&&c!=="HTML"&&(a.scrollLeft||a.scrollTop)){e-=a.scrollLeft||0;f-=a.scrollTop||0;b=Sys.UI.DomElement._getCurrentStyle(a);if(b){e+=parseInt(b.borderLeftWidth)||0;f+=parseInt(b.borderTopWidth)||0}}}return new Sys.UI.Point(e,f)};Sys.UI.DomElement.isDomElement=function(a){return Sys._isDomElement(a)};Sys.UI.DomElement.removeCssClass=function(d,c){var a=" "+d.className+" ",b=a.indexOf(" "+c+" ");if(b>=0)d.className=(a.substr(0,b)+" "+a.substring(b+c.length+1,a.length)).trim()};Sys.UI.DomElement.resolveElement=function(b,c){var a=b;if(!a)return null;if(typeof a==="string")a=Sys.UI.DomElement.getElementById(a,c);return a};Sys.UI.DomElement.raiseBubbleEvent=function(c,d){var b=c;while(b){var a=b.control;if(a&&a.onBubbleEvent&&a.raiseBubbleEvent){Sys.UI.DomElement._raiseBubbleEventFromControl(a,c,d);return}b=b.parentNode}};Sys.UI.DomElement._raiseBubbleEventFromControl=function(a,b,c){if(!a.onBubbleEvent(b,c))a._raiseBubbleEvent(b,c)};Sys.UI.DomElement.setLocation=function(b,c,d){var a=b.style;a.position="absolute";a.left=c+"px";a.top=d+"px"};Sys.UI.DomElement.toggleCssClass=function(b,a){if(Sys.UI.DomElement.containsCssClass(b,a))Sys.UI.DomElement.removeCssClass(b,a);else Sys.UI.DomElement.addCssClass(b,a)};Sys.UI.DomElement.getVisibilityMode=function(a){return a._visibilityMode===Sys.UI.VisibilityMode.hide?Sys.UI.VisibilityMode.hide:Sys.UI.VisibilityMode.collapse};Sys.UI.DomElement.setVisibilityMode=function(a,b){Sys.UI.DomElement._ensureOldDisplayMode(a);if(a._visibilityMode!==b){a._visibilityMode=b;if(Sys.UI.DomElement.getVisible(a)===false)if(a._visibilityMode===Sys.UI.VisibilityMode.hide)a.style.display=a._oldDisplayMode;else a.style.display="none";a._visibilityMode=b}};Sys.UI.DomElement.getVisible=function(b){var a=b.currentStyle||Sys.UI.DomElement._getCurrentStyle(b);if(!a)return true;return a.visibility!=="hidden"&&a.display!=="none"};Sys.UI.DomElement.setVisible=function(a,b){if(b!==Sys.UI.DomElement.getVisible(a)){Sys.UI.DomElement._ensureOldDisplayMode(a);a.style.visibility=b?"visible":"hidden";if(b||a._visibilityMode===Sys.UI.VisibilityMode.hide)a.style.display=a._oldDisplayMode;else a.style.display="none"}};Sys.UI.DomElement._ensureOldDisplayMode=function(a){if(!a._oldDisplayMode){var b=a.currentStyle||Sys.UI.DomElement._getCurrentStyle(a);a._oldDisplayMode=b?b.display:null;if(!a._oldDisplayMode||a._oldDisplayMode==="none")switch(a.tagName.toUpperCase()){case "DIV":case "P":case "ADDRESS":case "BLOCKQUOTE":case "BODY":case "COL":case "COLGROUP":case "DD":case "DL":case "DT":case "FIELDSET":case "FORM":case "H1":case "H2":case "H3":case "H4":case "H5":case "H6":case "HR":case "IFRAME":case "LEGEND":case "OL":case "PRE":case "TABLE":case "TD":case "TH":case "TR":case "UL":a._oldDisplayMode="block";break;case "LI":a._oldDisplayMode="list-item";break;default:a._oldDisplayMode="inline"}}};Sys.UI.DomElement._getWindow=function(a){var b=a.ownerDocument||a.document||a;return b.defaultView||b.parentWindow};Sys.UI.DomElement._getCurrentStyle=function(a){if(a.nodeType===3)return null;var c=Sys.UI.DomElement._getWindow(a);if(a.documentElement)a=a.documentElement;var b=c&&a!==c&&c.getComputedStyle?c.getComputedStyle(a,null):a.currentStyle||a.style;if(!b&&Sys.Browser.agent===Sys.Browser.Safari&&a.style){var g=a.style.display,f=a.style.position;a.style.position="absolute";a.style.display="block";var e=c.getComputedStyle(a,null);a.style.display=g;a.style.position=f;b={};for(var d in e)b[d]=e[d];b.display="none"}return b};Sys.IContainer=function(){};Sys.IContainer.prototype={};Sys.IContainer.registerInterface("Sys.IContainer");Sys.ApplicationLoadEventArgs=function(b,a){Sys.ApplicationLoadEventArgs.initializeBase(this);this._components=b;this._isPartialLoad=a};Sys.ApplicationLoadEventArgs.prototype={get_components:function(){return this._components},get_isPartialLoad:function(){return this._isPartialLoad}};Sys.ApplicationLoadEventArgs.registerClass("Sys.ApplicationLoadEventArgs",Sys.EventArgs);Sys._Application=function(){Sys._Application.initializeBase(this);this._disposableObjects=[];this._components={};this._createdComponents=[];this._secondPassComponents=[];this._unloadHandlerDelegate=Function.createDelegate(this,this._unloadHandler);Sys.UI.DomEvent.addHandler(window,"unload",this._unloadHandlerDelegate);this._domReady()};Sys._Application.prototype={_creatingComponents:false,_disposing:false,_deleteCount:0,get_isCreatingComponents:function(){return this._creatingComponents},get_isDisposing:function(){return this._disposing},add_init:function(a){if(this._initialized)a(this,Sys.EventArgs.Empty);else this.get_events().addHandler("init",a)},remove_init:function(a){this.get_events().removeHandler("init",a)},add_load:function(a){this.get_events().addHandler("load",a)},remove_load:function(a){this.get_events().removeHandler("load",a)},add_unload:function(a){this.get_events().addHandler("unload",a)},remove_unload:function(a){this.get_events().removeHandler("unload",a)},addComponent:function(a){this._components[a.get_id()]=a},beginCreateComponents:function(){this._creatingComponents=true},dispose:function(){if(!this._disposing){this._disposing=true;if(this._timerCookie){window.clearTimeout(this._timerCookie);delete this._timerCookie}if(this._endRequestHandler){Sys.WebForms.PageRequestManager.getInstance().remove_endRequest(this._endRequestHandler);delete this._endRequestHandler}if(this._beginRequestHandler){Sys.WebForms.PageRequestManager.getInstance().remove_beginRequest(this._beginRequestHandler);delete this._beginRequestHandler}if(window.pageUnload)window.pageUnload(this,Sys.EventArgs.Empty);var c=this.get_events().getHandler("unload");if(c)c(this,Sys.EventArgs.Empty);var b=Array.clone(this._disposableObjects);for(var a=0,f=b.length;a=0;b--){var d=i[b],f=d.dispose;if(f&&typeof f==="function")d.dispose();else{var e=d.control;if(e&&typeof e.dispose==="function")e.dispose()}var a=d._behaviors;if(a)this._disposeComponents(a);a=d._components;if(a){this._disposeComponents(a);d._components=null}}if(!j){var f=c.dispose;if(f&&typeof f==="function")c.dispose();else{var e=c.control;if(e&&typeof e.dispose==="function")e.dispose()}var a=c._behaviors;if(a)this._disposeComponents(a);a=c._components;if(a){this._disposeComponents(a);c._components=null}}}},endCreateComponents:function(){var b=this._secondPassComponents;for(var a=0,d=b.length;a1000){var c=[];for(var d=0,f=b.length;d=0;b--){var c=a[b];if(typeof c.dispose==="function")c.dispose()}},_domReady:function(){var a,g,f=this;function b(){f.initialize()}var c=function(){Sys.UI.DomEvent.removeHandler(window,"load",c);b()};Sys.UI.DomEvent.addHandler(window,"load",c);if(document.addEventListener)try{document.addEventListener("DOMContentLoaded",a=function(){document.removeEventListener("DOMContentLoaded",a,false);b()},false)}catch(h){}else if(document.attachEvent)if(window==window.top&&document.documentElement.doScroll){var e,d=document.createElement("div");a=function(){try{d.doScroll("left")}catch(c){e=window.setTimeout(a,0);return}d=null;b()};a()}else document.attachEvent("onreadystatechange",a=function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",a);b()}})},_raiseInit:function(){var a=this.get_events().getHandler("init");if(a){this.beginCreateComponents();a(this,Sys.EventArgs.Empty);this.endCreateComponents()}},_unloadHandler:function(){this.dispose()}};Sys._Application.registerClass("Sys._Application",Sys.Component,Sys.IContainer);Sys.Application=new Sys._Application;var $find=Sys.Application.findComponent;Sys.UI.Behavior=function(b){Sys.UI.Behavior.initializeBase(this);this._element=b;var a=b._behaviors;if(!a)b._behaviors=[this];else a[a.length]=this};Sys.UI.Behavior.prototype={_name:null,get_element:function(){return this._element},get_id:function(){var a=Sys.UI.Behavior.callBaseMethod(this,"get_id");if(a)return a;if(!this._element||!this._element.id)return "";return this._element.id+"$"+this.get_name()},get_name:function(){if(this._name)return this._name;var a=Object.getTypeName(this),b=a.lastIndexOf(".");if(b!==-1)a=a.substr(b+1);if(!this.get_isInitialized())this._name=a;return a},set_name:function(a){this._name=a},initialize:function(){Sys.UI.Behavior.callBaseMethod(this,"initialize");var a=this.get_name();if(a)this._element[a]=this},dispose:function(){Sys.UI.Behavior.callBaseMethod(this,"dispose");var a=this._element;if(a){var c=this.get_name();if(c)a[c]=null;var b=a._behaviors;Array.remove(b,this);if(b.length===0)a._behaviors=null;delete this._element}}};Sys.UI.Behavior.registerClass("Sys.UI.Behavior",Sys.Component);Sys.UI.Behavior.getBehaviorByName=function(b,c){var a=b[c];return a&&Sys.UI.Behavior.isInstanceOfType(a)?a:null};Sys.UI.Behavior.getBehaviors=function(a){if(!a._behaviors)return [];return Array.clone(a._behaviors)};Sys.UI.Behavior.getBehaviorsByType=function(d,e){var a=d._behaviors,c=[];if(a)for(var b=0,f=a.length;b0&&a.charAt(0)==="#")a=a.substring(1);return a};Sys._Application.prototype.get_enableHistory=function(){return this._enableHistory};Sys._Application.prototype.set_enableHistory=function(a){this._enableHistory=a};Sys._Application.prototype.add_navigate=function(a){this.get_events().addHandler("navigate",a)};Sys._Application.prototype.remove_navigate=function(a){this.get_events().removeHandler("navigate",a)};Sys._Application.prototype.addHistoryPoint=function(c,f){this._ensureHistory();var b=this._state;for(var a in c){var d=c[a];if(d===null){if(typeof b[a]!=="undefined")delete b[a]}else b[a]=d}var e=this._serializeState(b);this._historyPointIsNew=true;this._setState(e,f);this._raiseNavigate()};Sys._Application.prototype.setServerId=function(a,b){this._clientId=a;this._uniqueId=b};Sys._Application.prototype.setServerState=function(a){this._ensureHistory();this._state.__s=a;this._updateHiddenField(a)};Sys._Application.prototype._deserializeState=function(a){var e={};a=a||"";var b=a.indexOf("&&");if(b!==-1&&b+27){var e=document.title;document.title=c;this._setState(a);document.title=e}else this._setState(a);this._raiseNavigate()}else{this._setState(a);this._raiseNavigate()}}};Sys._Application.prototype._raiseNavigate=function(){var d=this._historyPointIsNew,c=this.get_events().getHandler("navigate"),b={};for(var a in this._state)if(a!=="__s")b[a]=this._state[a];var e=new Sys.HistoryEventArgs(b);if(c)c(this,e);if(!d){var f;try{if(Sys.Browser.agent===Sys.Browser.Firefox&&window.location.hash&&(!window.frameElement||window.top.location.hash))Sys.Browser.version<3.5?window.history.go(0):(location.hash=this.get_stateString())}catch(g){}}};Sys._Application.prototype._serializeState=function(d){var b=[];for(var a in d){var e=d[a];if(a==="__s")var c=e;else b[b.length]=a+"="+encodeURIComponent(e)}return b.join("&")+(c?"&&"+c:"")};Sys._Application.prototype._setState=function(a,b){if(this._enableHistory){a=a||"";if(a!==this._currentEntry){if(window.theForm){var d=window.theForm.action,e=d.indexOf("#");window.theForm.action=(e!==-1?d.substring(0,e):d)+"#"+a}if(this._historyFrame&&this._historyPointIsNew){var f=document.createElement("div");f.appendChild(document.createTextNode(b||document.title));var g=f.innerHTML;this._ignoreIFrame=true;var c=this._historyFrame.contentWindow.document;c.open("javascript:''");c.write(""+g+"parent.Sys.Application._onIFrameLoad('+Sys.Serialization.JavaScriptSerializer.serialize(a)+");");c.close()}this._ignoreTimer=false;this._currentEntry=a;if(this._historyFrame||this._historyPointIsNew){var h=this.get_stateString();if(a!==h){window.location.hash=a;this._currentEntry=this.get_stateString();if(typeof b!=="undefined"&&b!==null)document.title=b}}this._historyPointIsNew=false}}};Sys._Application.prototype._updateHiddenField=function(b){if(this._clientId){var a=document.getElementById(this._clientId);if(a)a.value=b}};if(!window.XMLHttpRequest)window.XMLHttpRequest=function(){var b=["Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP"];for(var a=0,c=b.length;a0)this._timer=window.setTimeout(Function.createDelegate(this,this._onTimeout),d);this._xmlHttpRequest.send(c);this._started=true},getResponseHeader:function(b){var a;try{a=this._xmlHttpRequest.getResponseHeader(b)}catch(c){}if(!a)a="";return a},getAllResponseHeaders:function(){return this._xmlHttpRequest.getAllResponseHeaders()},get_responseData:function(){return this._xmlHttpRequest.responseText},get_statusCode:function(){var a=0;try{a=this._xmlHttpRequest.status}catch(b){}return a},get_statusText:function(){return this._xmlHttpRequest.statusText},get_xml:function(){var a=this._xmlHttpRequest.responseXML;if(!a||!a.documentElement){a=Sys.Net.XMLDOM(this._xmlHttpRequest.responseText);if(!a||!a.documentElement)return null}else if(navigator.userAgent.indexOf("MSIE")!==-1&&typeof a.setProperty!="undefined")a.setProperty("SelectionLanguage","XPath");if(a.documentElement.namespaceURI==="http://www.mozilla.org/newlayout/xml/parsererror.xml"&&a.documentElement.tagName==="parsererror")return null;if(a.documentElement.firstChild&&a.documentElement.firstChild.tagName==="parsererror")return null;return a},abort:function(){if(this._aborted||this._responseAvailable||this._timedOut)return;this._aborted=true;this._clearTimer();if(this._xmlHttpRequest&&!this._responseAvailable){this._xmlHttpRequest.onreadystatechange=Function.emptyMethod;this._xmlHttpRequest.abort();this._xmlHttpRequest=null;this._webRequest.completed(Sys.EventArgs.Empty)}}};Sys.Net.XMLHttpExecutor.registerClass("Sys.Net.XMLHttpExecutor",Sys.Net.WebRequestExecutor);Sys.Net._WebRequestManager=function(){this._defaultTimeout=0;this._defaultExecutorType="Sys.Net.XMLHttpExecutor"};Sys.Net._WebRequestManager.prototype={add_invokingRequest:function(a){this._get_eventHandlerList().addHandler("invokingRequest",a)},remove_invokingRequest:function(a){this._get_eventHandlerList().removeHandler("invokingRequest",a)},add_completedRequest:function(a){this._get_eventHandlerList().addHandler("completedRequest",a)},remove_completedRequest:function(a){this._get_eventHandlerList().removeHandler("completedRequest",a)},_get_eventHandlerList:function(){if(!this._events)this._events=new Sys.EventHandlerList;return this._events},get_defaultTimeout:function(){return this._defaultTimeout},set_defaultTimeout:function(a){this._defaultTimeout=a},get_defaultExecutorType:function(){return this._defaultExecutorType},set_defaultExecutorType:function(a){this._defaultExecutorType=a},executeRequest:function(webRequest){var executor=webRequest.get_executor();if(!executor){var failed=false;try{var executorType=eval(this._defaultExecutorType);executor=new executorType}catch(a){failed=true}webRequest.set_executor(executor)}if(executor.get_aborted())return;var evArgs=new Sys.Net.NetworkRequestEventArgs(webRequest),handler=this._get_eventHandlerList().getHandler("invokingRequest");if(handler)handler(this,evArgs);if(!evArgs.get_cancel())executor.executeRequest()}};Sys.Net._WebRequestManager.registerClass("Sys.Net._WebRequestManager");Sys.Net.WebRequestManager=new Sys.Net._WebRequestManager;Sys.Net.NetworkRequestEventArgs=function(a){Sys.Net.NetworkRequestEventArgs.initializeBase(this);this._webRequest=a};Sys.Net.NetworkRequestEventArgs.prototype={get_webRequest:function(){return this._webRequest}};Sys.Net.NetworkRequestEventArgs.registerClass("Sys.Net.NetworkRequestEventArgs",Sys.CancelEventArgs);Sys.Net.WebRequest=function(){this._url="";this._headers={};this._body=null;this._userContext=null;this._httpVerb=null;this._executor=null;this._invokeCalled=false;this._timeout=0};Sys.Net.WebRequest.prototype={add_completed:function(a){this._get_eventHandlerList().addHandler("completed",a)},remove_completed:function(a){this._get_eventHandlerList().removeHandler("completed",a)},completed:function(b){var a=Sys.Net.WebRequestManager._get_eventHandlerList().getHandler("completedRequest");if(a)a(this._executor,b);a=this._get_eventHandlerList().getHandler("completed");if(a)a(this._executor,b)},_get_eventHandlerList:function(){if(!this._events)this._events=new Sys.EventHandlerList;return this._events},get_url:function(){return this._url},set_url:function(a){this._url=a},get_headers:function(){return this._headers},get_httpVerb:function(){if(this._httpVerb===null){if(this._body===null)return "GET";return "POST"}return this._httpVerb},set_httpVerb:function(a){this._httpVerb=a},get_body:function(){return this._body},set_body:function(a){this._body=a},get_userContext:function(){return this._userContext},set_userContext:function(a){this._userContext=a},get_executor:function(){return this._executor},set_executor:function(a){this._executor=a;this._executor._set_webRequest(this)},get_timeout:function(){if(this._timeout===0)return Sys.Net.WebRequestManager.get_defaultTimeout();return this._timeout},set_timeout:function(a){this._timeout=a},getResolvedUrl:function(){return Sys.Net.WebRequest._resolveUrl(this._url)},invoke:function(){Sys.Net.WebRequestManager.executeRequest(this);this._invokeCalled=true}};Sys.Net.WebRequest._resolveUrl=function(b,a){if(b&&b.indexOf("://")!==-1)return b;if(!a||a.length===0){var d=document.getElementsByTagName("base")[0];if(d&&d.href&&d.href.length>0)a=d.href;else a=document.URL}var c=a.indexOf("?");if(c!==-1)a=a.substr(0,c);c=a.indexOf("#");if(c!==-1)a=a.substr(0,c);a=a.substr(0,a.lastIndexOf("/")+1);if(!b||b.length===0)return a;if(b.charAt(0)==="/"){var e=a.indexOf("://"),g=a.indexOf("/",e+3);return a.substr(0,g)+b}else{var f=a.lastIndexOf("/");return a.substr(0,f+1)+b}};Sys.Net.WebRequest._createQueryString=function(c,b,f){b=b||encodeURIComponent;var h=0,e,g,d,a=new Sys.StringBuilder;if(c)for(d in c){e=c[d];if(typeof e==="function")continue;g=Sys.Serialization.JavaScriptSerializer.serialize(e);if(h++)a.append("&");a.append(d);a.append("=");a.append(b(g))}if(f){if(h)a.append("&");a.append(f)}return a.toString()};Sys.Net.WebRequest._createUrl=function(a,b,c){if(!b&&!c)return a;var d=Sys.Net.WebRequest._createQueryString(b,null,c);return d.length?a+(a&&a.indexOf("?")>=0?"&":"?")+d:a};Sys.Net.WebRequest.registerClass("Sys.Net.WebRequest");Sys._ScriptLoaderTask=function(b,a){this._scriptElement=b;this._completedCallback=a};Sys._ScriptLoaderTask.prototype={get_scriptElement:function(){return this._scriptElement},dispose:function(){if(this._disposed)return;this._disposed=true;this._removeScriptElementHandlers();Sys._ScriptLoaderTask._clearScript(this._scriptElement);this._scriptElement=null},execute:function(){if(this._ensureReadyStateLoaded())this._executeInternal()},_executeInternal:function(){this._addScriptElementHandlers();document.getElementsByTagName("head")[0].appendChild(this._scriptElement)},_ensureReadyStateLoaded:function(){if(this._useReadyState()&&this._scriptElement.readyState!=="loaded"&&this._scriptElement.readyState!=="complete"){this._scriptDownloadDelegate=Function.createDelegate(this,this._executeInternal);$addHandler(this._scriptElement,"readystatechange",this._scriptDownloadDelegate);return false}return true},_addScriptElementHandlers:function(){if(this._scriptDownloadDelegate){$removeHandler(this._scriptElement,"readystatechange",this._scriptDownloadDelegate);this._scriptDownloadDelegate=null}this._scriptLoadDelegate=Function.createDelegate(this,this._scriptLoadHandler);if(this._useReadyState())$addHandler(this._scriptElement,"readystatechange",this._scriptLoadDelegate);else $addHandler(this._scriptElement,"load",this._scriptLoadDelegate);if(this._scriptElement.addEventListener){this._scriptErrorDelegate=Function.createDelegate(this,this._scriptErrorHandler);this._scriptElement.addEventListener("error",this._scriptErrorDelegate,false)}},_removeScriptElementHandlers:function(){if(this._scriptLoadDelegate){var a=this.get_scriptElement();if(this._scriptDownloadDelegate){$removeHandler(this._scriptElement,"readystatechange",this._scriptDownloadDelegate);this._scriptDownloadDelegate=null}if(this._useReadyState()&&this._scriptLoadDelegate)$removeHandler(a,"readystatechange",this._scriptLoadDelegate);else $removeHandler(a,"load",this._scriptLoadDelegate);if(this._scriptErrorDelegate){this._scriptElement.removeEventListener("error",this._scriptErrorDelegate,false);this._scriptErrorDelegate=null}this._scriptLoadDelegate=null}},_scriptErrorHandler:function(){if(this._disposed)return;this._completedCallback(this.get_scriptElement(),false)},_scriptLoadHandler:function(){if(this._disposed)return;var a=this.get_scriptElement();if(this._useReadyState()&&a.readyState!=="complete")return;this._completedCallback(a,true)},_useReadyState:function(){return Sys.Browser.agent===Sys.Browser.InternetExplorer&&(Sys.Browser.version<9||(document.documentMode||0)<9)}};Sys._ScriptLoaderTask.registerClass("Sys._ScriptLoaderTask",null,Sys.IDisposable);Sys._ScriptLoaderTask._clearScript=function(a){if(!Sys.Debug.isDebug&&a.parentNode)a.parentNode.removeChild(a)};Type.registerNamespace("Sys.Net");Sys.Net.WebServiceProxy=function(){};Sys.Net.WebServiceProxy.prototype={get_timeout:function(){return this._timeout||0},set_timeout:function(a){if(a<0)throw Error.argumentOutOfRange("value",a,Sys.Res.invalidTimeout);this._timeout=a},get_defaultUserContext:function(){return typeof this._userContext==="undefined"?null:this._userContext},set_defaultUserContext:function(a){this._userContext=a},get_defaultSucceededCallback:function(){return this._succeeded||null},set_defaultSucceededCallback:function(a){this._succeeded=a},get_defaultFailedCallback:function(){return this._failed||null},set_defaultFailedCallback:function(a){this._failed=a},get_enableJsonp:function(){return !!this._jsonp},set_enableJsonp:function(a){this._jsonp=a},get_path:function(){return this._path||null},set_path:function(a){this._path=a},get_jsonpCallbackParameter:function(){return this._callbackParameter||"callback"},set_jsonpCallbackParameter:function(a){this._callbackParameter=a},_invoke:function(d,e,g,f,c,b,a){c=c||this.get_defaultSucceededCallback();b=b||this.get_defaultFailedCallback();if(a===null||typeof a==="undefined")a=this.get_defaultUserContext();return Sys.Net.WebServiceProxy.invoke(d,e,g,f,c,b,a,this.get_timeout(),this.get_enableJsonp(),this.get_jsonpCallbackParameter())}};Sys.Net.WebServiceProxy.registerClass("Sys.Net.WebServiceProxy");Sys.Net.WebServiceProxy.invoke=function(q,a,m,l,j,b,g,e,w,p){var i=w!==false?Sys.Net.WebServiceProxy._xdomain.exec(q):null,c,n=i&&i.length===3&&(i[1]!==location.protocol||i[2]!==location.host);m=n||m;if(n){p=p||"callback";c="_jsonp"+Sys._jsonp++}if(!l)l={};var r=l;if(!m||!r)r={};var s,h,f=null,k,o=null,u=Sys.Net.WebRequest._createUrl(a?q+"/"+encodeURIComponent(a):q,r,n?p+"=Sys."+c:null);if(n){s=document.createElement("script");s.src=u;k=new Sys._ScriptLoaderTask(s,function(d,b){if(!b||c)t({Message:String.format(Sys.Res.webServiceFailedNoMsg,a)},-1)});function v(){if(f===null)return;f=null;h=new Sys.Net.WebServiceError(true,String.format(Sys.Res.webServiceTimedOut,a));k.dispose();delete Sys[c];if(b)b(h,g,a)}function t(d,e){if(f!==null){window.clearTimeout(f);f=null}k.dispose();delete Sys[c];c=null;if(typeof e!=="undefined"&&e!==200){if(b){h=new Sys.Net.WebServiceError(false,d.Message||String.format(Sys.Res.webServiceFailedNoMsg,a),d.StackTrace||null,d.ExceptionType||null,d);h._statusCode=e;b(h,g,a)}}else if(j)j(d,g,a)}Sys[c]=t;e=e||Sys.Net.WebRequestManager.get_defaultTimeout();if(e>0)f=window.setTimeout(v,e);k.execute();return null}var d=new Sys.Net.WebRequest;d.set_url(u);d.get_headers()["Content-Type"]="application/json; charset=utf-8";if(!m){o=Sys.Serialization.JavaScriptSerializer.serialize(l);if(o==="{}")o=""}d.set_body(o);d.add_completed(x);if(e&&e>0)d.set_timeout(e);d.invoke();function x(d){if(d.get_responseAvailable()){var f=d.get_statusCode(),c=null;try{var e=d.getResponseHeader("Content-Type");if(e.startsWith("application/json"))c=d.get_object();else if(e.startsWith("text/xml"))c=d.get_xml();else c=d.get_responseData()}catch(m){}var k=d.getResponseHeader("jsonerror"),h=k==="true";if(h){if(c)c=new Sys.Net.WebServiceError(false,c.Message,c.StackTrace,c.ExceptionType,c)}else if(e.startsWith("application/json"))c=!c||typeof c.d==="undefined"?c:c.d;if(f<200||f>=300||h){if(b){if(!c||!h)c=new Sys.Net.WebServiceError(false,String.format(Sys.Res.webServiceFailedNoMsg,a));c._statusCode=f;b(c,g,a)}}else if(j)j(c,g,a)}else{var i;if(d.get_timedOut())i=String.format(Sys.Res.webServiceTimedOut,a);else i=String.format(Sys.Res.webServiceFailedNoMsg,a);if(b)b(new Sys.Net.WebServiceError(d.get_timedOut(),i,"",""),g,a)}}return d};Sys.Net.WebServiceProxy._generateTypedConstructor=function(a){return function(b){if(b)for(var c in b)this[c]=b[c];this.__type=a}};Sys._jsonp=0;Sys.Net.WebServiceProxy._xdomain=/^\s*([a-zA-Z0-9\+\-\.]+\:)\/\/([^?#\/]+)/;Sys.Net.WebServiceError=function(d,e,c,a,b){this._timedOut=d;this._message=e;this._stackTrace=c;this._exceptionType=a;this._errorObject=b;this._statusCode=-1};Sys.Net.WebServiceError.prototype={get_timedOut:function(){return this._timedOut},get_statusCode:function(){return this._statusCode},get_message:function(){return this._message},get_stackTrace:function(){return this._stackTrace||""},get_exceptionType:function(){return this._exceptionType||""},get_errorObject:function(){return this._errorObject||null}};Sys.Net.WebServiceError.registerClass("Sys.Net.WebServiceError"); -Type.registerNamespace('Sys');Sys.Res={ -"argumentInteger":"Value must be an integer.","invokeCalledTwice":"Cannot call invoke more than once.","webServiceFailed":"The server method \u0027{0}\u0027 failed with the following error: {1}","argumentType":"Object cannot be converted to the required type.","argumentNull":"Value cannot be null.","scriptAlreadyLoaded":"The script \u0027{0}\u0027 has been referenced multiple times. If referencing Microsoft AJAX scripts explicitly, set the MicrosoftAjaxMode property of the ScriptManager to Explicit.","scriptDependencyNotFound":"The script \u0027{0}\u0027 failed to load because it is dependent on script \u0027{1}\u0027.","formatBadFormatSpecifier":"Format specifier was invalid.","requiredScriptReferenceNotIncluded":"\u0027{0}\u0027 requires that you have included a script reference to \u0027{1}\u0027.","webServiceFailedNoMsg":"The server method \u0027{0}\u0027 failed.","argumentDomElement":"Value must be a DOM element.","invalidExecutorType":"Could not create a valid Sys.Net.WebRequestExecutor from: {0}.","cannotCallBeforeResponse":"Cannot call {0} when responseAvailable is false.","actualValue":"Actual value was {0}.","enumInvalidValue":"\u0027{0}\u0027 is not a valid value for enum {1}.","scriptLoadFailed":"The script \u0027{0}\u0027 could not be loaded.","parameterCount":"Parameter count mismatch.","cannotDeserializeEmptyString":"Cannot deserialize empty string.","formatInvalidString":"Input string was not in a correct format.","invalidTimeout":"Value must be greater than or equal to zero.","cannotAbortBeforeStart":"Cannot abort when executor has not started.","argument":"Value does not fall within the expected range.","cannotDeserializeInvalidJson":"Cannot deserialize. The data does not correspond to valid JSON.","invalidHttpVerb":"httpVerb cannot be set to an empty or null string.","nullWebRequest":"Cannot call executeRequest with a null webRequest.","eventHandlerInvalid":"Handler was not added through the Sys.UI.DomEvent.addHandler method.","cannotSerializeNonFiniteNumbers":"Cannot serialize non finite numbers.","argumentUndefined":"Value cannot be undefined.","webServiceInvalidReturnType":"The server method \u0027{0}\u0027 returned an invalid type. Expected type: {1}","servicePathNotSet":"The path to the web service has not been set.","argumentTypeWithTypes":"Object of type \u0027{0}\u0027 cannot be converted to type \u0027{1}\u0027.","cannotCallOnceStarted":"Cannot call {0} once started.","badBaseUrl1":"Base URL does not contain ://.","badBaseUrl2":"Base URL does not contain another /.","badBaseUrl3":"Cannot find last / in base URL.","setExecutorAfterActive":"Cannot set executor after it has become active.","paramName":"Parameter name: {0}","nullReferenceInPath":"Null reference while evaluating data path: \u0027{0}\u0027.","cannotCallOutsideHandler":"Cannot call {0} outside of a completed event handler.","cannotSerializeObjectWithCycle":"Cannot serialize object with cyclic reference within child properties.","format":"One of the identified items was in an invalid format.","assertFailedCaller":"Assertion Failed: {0}\r\nat {1}","argumentOutOfRange":"Specified argument was out of the range of valid values.","webServiceTimedOut":"The server method \u0027{0}\u0027 timed out.","notImplemented":"The method or operation is not implemented.","assertFailed":"Assertion Failed: {0}","invalidOperation":"Operation is not valid due to the current state of the object.","breakIntoDebugger":"{0}\r\n\r\nBreak into debugger?"}; -/* END MicrosoftAjax.js */ -/* START MicrosoftAjaxWebForms.js */ -//---------------------------------------------------------- -// Copyright (C) Microsoft Corporation. All rights reserved. -//---------------------------------------------------------- -// MicrosoftAjaxWebForms.js -Type._registerScript("MicrosoftAjaxWebForms.js",["MicrosoftAjaxCore.js","MicrosoftAjaxSerialization.js","MicrosoftAjaxNetwork.js","MicrosoftAjaxComponentModel.js"]);Type.registerNamespace("Sys.WebForms");Sys.WebForms.BeginRequestEventArgs=function(c,b,a){Sys.WebForms.BeginRequestEventArgs.initializeBase(this);this._request=c;this._postBackElement=b;this._updatePanelsToUpdate=a};Sys.WebForms.BeginRequestEventArgs.prototype={get_postBackElement:function(){return this._postBackElement},get_request:function(){return this._request},get_updatePanelsToUpdate:function(){return this._updatePanelsToUpdate?Array.clone(this._updatePanelsToUpdate):[]}};Sys.WebForms.BeginRequestEventArgs.registerClass("Sys.WebForms.BeginRequestEventArgs",Sys.EventArgs);Sys.WebForms.EndRequestEventArgs=function(c,a,b){Sys.WebForms.EndRequestEventArgs.initializeBase(this);this._errorHandled=false;this._error=c;this._dataItems=a||{};this._response=b};Sys.WebForms.EndRequestEventArgs.prototype={get_dataItems:function(){return this._dataItems},get_error:function(){return this._error},get_errorHandled:function(){return this._errorHandled},set_errorHandled:function(a){this._errorHandled=a},get_response:function(){return this._response}};Sys.WebForms.EndRequestEventArgs.registerClass("Sys.WebForms.EndRequestEventArgs",Sys.EventArgs);Sys.WebForms.InitializeRequestEventArgs=function(c,b,a){Sys.WebForms.InitializeRequestEventArgs.initializeBase(this);this._request=c;this._postBackElement=b;this._updatePanelsToUpdate=a};Sys.WebForms.InitializeRequestEventArgs.prototype={get_postBackElement:function(){return this._postBackElement},get_request:function(){return this._request},get_updatePanelsToUpdate:function(){return this._updatePanelsToUpdate?Array.clone(this._updatePanelsToUpdate):[]},set_updatePanelsToUpdate:function(a){this._updated=true;this._updatePanelsToUpdate=a}};Sys.WebForms.InitializeRequestEventArgs.registerClass("Sys.WebForms.InitializeRequestEventArgs",Sys.CancelEventArgs);Sys.WebForms.PageLoadedEventArgs=function(b,a,c){Sys.WebForms.PageLoadedEventArgs.initializeBase(this);this._panelsUpdated=b;this._panelsCreated=a;this._dataItems=c||{}};Sys.WebForms.PageLoadedEventArgs.prototype={get_dataItems:function(){return this._dataItems},get_panelsCreated:function(){return this._panelsCreated},get_panelsUpdated:function(){return this._panelsUpdated}};Sys.WebForms.PageLoadedEventArgs.registerClass("Sys.WebForms.PageLoadedEventArgs",Sys.EventArgs);Sys.WebForms.PageLoadingEventArgs=function(b,a,c){Sys.WebForms.PageLoadingEventArgs.initializeBase(this);this._panelsUpdating=b;this._panelsDeleting=a;this._dataItems=c||{}};Sys.WebForms.PageLoadingEventArgs.prototype={get_dataItems:function(){return this._dataItems},get_panelsDeleting:function(){return this._panelsDeleting},get_panelsUpdating:function(){return this._panelsUpdating}};Sys.WebForms.PageLoadingEventArgs.registerClass("Sys.WebForms.PageLoadingEventArgs",Sys.EventArgs);Sys._ScriptLoader=function(){this._scriptsToLoad=null;this._sessions=[];this._scriptLoadedDelegate=Function.createDelegate(this,this._scriptLoadedHandler)};Sys._ScriptLoader.prototype={dispose:function(){this._stopSession();this._loading=false;if(this._events)delete this._events;this._sessions=null;this._currentSession=null;this._scriptLoadedDelegate=null},loadScripts:function(d,b,c,a){var e={allScriptsLoadedCallback:b,scriptLoadFailedCallback:c,scriptLoadTimeoutCallback:a,scriptsToLoad:this._scriptsToLoad,scriptTimeout:d};this._scriptsToLoad=null;this._sessions[this._sessions.length]=e;if(!this._loading)this._nextSession()},queueCustomScriptTag:function(a){if(!this._scriptsToLoad)this._scriptsToLoad=[];Array.add(this._scriptsToLoad,a)},queueScriptBlock:function(a){if(!this._scriptsToLoad)this._scriptsToLoad=[];Array.add(this._scriptsToLoad,{text:a})},queueScriptReference:function(a,b){if(!this._scriptsToLoad)this._scriptsToLoad=[];Array.add(this._scriptsToLoad,{src:a,fallback:b})},_createScriptElement:function(c){var a=document.createElement("script");a.type="text/javascript";for(var b in c)a[b]=c[b];return a},_loadScriptsInternal:function(){var c=this._currentSession;if(c.scriptsToLoad&&c.scriptsToLoad.length>0){var b=Array.dequeue(c.scriptsToLoad),f=this._scriptLoadedDelegate;if(b.fallback){var g=b.fallback;delete b.fallback;var d=this;f=function(b,a){a||function(){var a=d._createScriptElement({src:g});d._currentTask=new Sys._ScriptLoaderTask(a,d._scriptLoadedDelegate);d._currentTask.execute()}()}}var a=this._createScriptElement(b);if(a.text&&Sys.Browser.agent===Sys.Browser.Safari){a.innerHTML=a.text;delete a.text}if(typeof b.src==="string"){this._currentTask=new Sys._ScriptLoaderTask(a,f);this._currentTask.execute()}else{document.getElementsByTagName("head")[0].appendChild(a);Sys._ScriptLoaderTask._clearScript(a);this._loadScriptsInternal()}}else{this._stopSession();var e=c.allScriptsLoadedCallback;if(e)e(this);this._nextSession()}},_nextSession:function(){if(this._sessions.length===0){this._loading=false;this._currentSession=null;return}this._loading=true;var a=Array.dequeue(this._sessions);this._currentSession=a;if(a.scriptTimeout>0)this._timeoutCookie=window.setTimeout(Function.createDelegate(this,this._scriptLoadTimeoutHandler),a.scriptTimeout*1000);this._loadScriptsInternal()},_raiseError:function(){var b=this._currentSession.scriptLoadFailedCallback,a=this._currentTask.get_scriptElement();this._stopSession();if(b){b(this,a);this._nextSession()}else{this._loading=false;throw Sys._ScriptLoader._errorScriptLoadFailed(a.src)}},_scriptLoadedHandler:function(a,b){if(b){Array.add(Sys._ScriptLoader._getLoadedScripts(),a.src);this._currentTask.dispose();this._currentTask=null;this._loadScriptsInternal()}else this._raiseError()},_scriptLoadTimeoutHandler:function(){var a=this._currentSession.scriptLoadTimeoutCallback;this._stopSession();if(a)a(this);this._nextSession()},_stopSession:function(){if(this._timeoutCookie){window.clearTimeout(this._timeoutCookie);this._timeoutCookie=null}if(this._currentTask){this._currentTask.dispose();this._currentTask=null}}};Sys._ScriptLoader.registerClass("Sys._ScriptLoader",null,Sys.IDisposable);Sys._ScriptLoader.getInstance=function(){var a=Sys._ScriptLoader._activeInstance;if(!a)a=Sys._ScriptLoader._activeInstance=new Sys._ScriptLoader;return a};Sys._ScriptLoader.isScriptLoaded=function(b){var a=document.createElement("script");a.src=b;return Array.contains(Sys._ScriptLoader._getLoadedScripts(),a.src)};Sys._ScriptLoader.readLoadedScripts=function(){if(!Sys._ScriptLoader._referencedScripts){var c=Sys._ScriptLoader._referencedScripts=[],d=document.getElementsByTagName("script");for(var b=d.length-1;b>=0;b--){var e=d[b],a=e.src;if(a.length)if(!Array.contains(c,a))Array.add(c,a)}}};Sys._ScriptLoader._errorScriptLoadFailed=function(b){var a;a=Sys.Res.scriptLoadFailed;var d="Sys.ScriptLoadFailedException: "+String.format(a,b),c=Error.create(d,{name:"Sys.ScriptLoadFailedException","scriptUrl":b});c.popStackFrame();return c};Sys._ScriptLoader._getLoadedScripts=function(){if(!Sys._ScriptLoader._referencedScripts){Sys._ScriptLoader._referencedScripts=[];Sys._ScriptLoader.readLoadedScripts()}return Sys._ScriptLoader._referencedScripts};Sys.WebForms.PageRequestManager=function(){this._form=null;this._activeDefaultButton=null;this._activeDefaultButtonClicked=false;this._updatePanelIDs=null;this._updatePanelClientIDs=null;this._updatePanelHasChildrenAsTriggers=null;this._asyncPostBackControlIDs=null;this._asyncPostBackControlClientIDs=null;this._postBackControlIDs=null;this._postBackControlClientIDs=null;this._scriptManagerID=null;this._pageLoadedHandler=null;this._additionalInput=null;this._onsubmit=null;this._onSubmitStatements=[];this._originalDoPostBack=null;this._originalDoPostBackWithOptions=null;this._originalFireDefaultButton=null;this._originalDoCallback=null;this._isCrossPost=false;this._postBackSettings=null;this._request=null;this._onFormSubmitHandler=null;this._onFormElementClickHandler=null;this._onWindowUnloadHandler=null;this._asyncPostBackTimeout=null;this._controlIDToFocus=null;this._scrollPosition=null;this._processingRequest=false;this._scriptDisposes={};this._transientFields=["__VIEWSTATEENCRYPTED","__VIEWSTATEFIELDCOUNT"];this._textTypes=/^(text|password|hidden|search|tel|url|email|number|range|color|datetime|date|month|week|time|datetime-local)$/i};Sys.WebForms.PageRequestManager.prototype={_get_eventHandlerList:function(){if(!this._events)this._events=new Sys.EventHandlerList;return this._events},get_isInAsyncPostBack:function(){return this._request!==null},add_beginRequest:function(a){this._get_eventHandlerList().addHandler("beginRequest",a)},remove_beginRequest:function(a){this._get_eventHandlerList().removeHandler("beginRequest",a)},add_endRequest:function(a){this._get_eventHandlerList().addHandler("endRequest",a)},remove_endRequest:function(a){this._get_eventHandlerList().removeHandler("endRequest",a)},add_initializeRequest:function(a){this._get_eventHandlerList().addHandler("initializeRequest",a)},remove_initializeRequest:function(a){this._get_eventHandlerList().removeHandler("initializeRequest",a)},add_pageLoaded:function(a){this._get_eventHandlerList().addHandler("pageLoaded",a)},remove_pageLoaded:function(a){this._get_eventHandlerList().removeHandler("pageLoaded",a)},add_pageLoading:function(a){this._get_eventHandlerList().addHandler("pageLoading",a)},remove_pageLoading:function(a){this._get_eventHandlerList().removeHandler("pageLoading",a)},abortPostBack:function(){if(!this._processingRequest&&this._request){this._request.get_executor().abort();this._request=null}},beginAsyncPostBack:function(c,a,f,d,e){if(d&&typeof Page_ClientValidate==="function"&&!Page_ClientValidate(e||null))return;this._postBackSettings=this._createPostBackSettings(true,c,a);var b=this._form;b.__EVENTTARGET.value=a||"";b.__EVENTARGUMENT.value=f||"";this._isCrossPost=false;this._additionalInput=null;this._onFormSubmit()},_cancelPendingCallbacks:function(){for(var a=0,e=window.__pendingCallbacks.length;a0)theForm.action=a.actionUrl;if(a.trackFocus){var c=theForm.elements["__LASTFOCUS"];if(typeof c!="undefined"&&c!=null)if(typeof document.activeElement=="undefined")c.value=a.eventTarget;else{var b=document.activeElement;if(typeof b!="undefined"&&b!=null)if(typeof b.id!="undefined"&&b.id!=null&&b.id.length>0)c.value=b.id;else if(typeof b.name!="undefined")c.value=b.name}}}if(a.clientSubmit)this._doPostBack(a.eventTarget,a.eventArgument)},_elementContains:function(b,a){while(a){if(a===b)return true;a=a.parentNode}return false},_endPostBack:function(a,d,f){if(this._request===d.get_webRequest()){this._processingRequest=false;this._additionalInput=null;this._request=null}var e=this._get_eventHandlerList().getHandler("endRequest"),b=false;if(e){var c=new Sys.WebForms.EndRequestEventArgs(a,f?f.dataItems:{},d);e(this,c);b=c.get_errorHandled()}if(a&&!b)throw a},_ensureUniqueIds:function(a){if(!a)return a;a=a instanceof Array?a:[a];var c=[];for(var b=0,f=a.length;b-1?this._updatePanelIDs[d]:e)}return c},_findNearestElement:function(a){while(a.length>0){var d=this._uniqueIDToClientID(a),c=document.getElementById(d);if(c)return c;var b=a.lastIndexOf("$");if(b===-1)return null;a=a.substring(0,b)}return null},_findText:function(b,a){var c=Math.max(0,a-20),d=Math.min(b.length,a+20);return b.substring(c,d)},_fireDefaultButton:function(a,d){if(a.keyCode===13){var c=a.srcElement||a.target;if(!c||c.tagName.toLowerCase()!=="textarea"){var b=document.getElementById(d);if(b&&typeof b.click!=="undefined"){this._activeDefaultButton=b;this._activeDefaultButtonClicked=false;try{b.click()}finally{this._activeDefaultButton=null}a.cancelBubble=true;if(typeof a.stopPropagation==="function")a.stopPropagation();return false}}}return true},_getPageLoadedEventArgs:function(n,c){var m=[],l=[],k=c?c.version4:false,d=c?c.updatePanelData:null,e,g,h,b;if(!d){e=this._updatePanelIDs;g=this._updatePanelClientIDs;h=null;b=null}else{e=d.updatePanelIDs;g=d.updatePanelClientIDs;h=d.childUpdatePanelIDs;b=d.panelsToRefreshIDs}var a,f,j,i;if(b)for(a=0,f=b.length;a-1))Array.add(i,document.getElementById(l[a]))}return new Sys.WebForms.PageLoadingEventArgs(j,i,f.dataItems)},_getPostBackSettings:function(a,c){var d=a,b=null;while(a){if(a.id){if(!b&&Array.contains(this._asyncPostBackControlClientIDs,a.id))b=this._createPostBackSettings(true,null,c,d);else if(!b&&Array.contains(this._postBackControlClientIDs,a.id))return this._createPostBackSettings(false);else{var e=Array.indexOf(this._updatePanelClientIDs,a.id);if(e!==-1)if(this._updatePanelHasChildrenAsTriggers[e])return this._createPostBackSettings(true,[this._updatePanelIDs[e]],c,d);else return this._createPostBackSettings(true,null,c,d)}if(!b&&this._matchesParentIDInList(a.id,this._asyncPostBackControlClientIDs))b=this._createPostBackSettings(true,null,c,d);else if(!b&&this._matchesParentIDInList(a.id,this._postBackControlClientIDs))return this._createPostBackSettings(false)}a=a.parentNode}if(!b)return this._createPostBackSettings(false);else return b},_getScrollPosition:function(){var a=document.documentElement;if(a&&(this._validPosition(a.scrollLeft)||this._validPosition(a.scrollTop)))return {x:a.scrollLeft,y:a.scrollTop};else{a=document.body;if(a&&(this._validPosition(a.scrollLeft)||this._validPosition(a.scrollTop)))return {x:a.scrollLeft,y:a.scrollTop};else if(this._validPosition(window.pageXOffset)||this._validPosition(window.pageYOffset))return {x:window.pageXOffset,y:window.pageYOffset};else return {x:0,y:0}}},_initializeInternal:function(f,g,a,b,e,c,d){if(this._prmInitialized)throw Error.invalidOperation(Sys.WebForms.Res.PRM_CannotRegisterTwice);this._prmInitialized=true;this._masterPageUniqueID=d;this._scriptManagerID=f;this._form=Sys.UI.DomElement.resolveElement(g);this._onsubmit=this._form.onsubmit;this._form.onsubmit=null;this._onFormSubmitHandler=Function.createDelegate(this,this._onFormSubmit);this._onFormElementClickHandler=Function.createDelegate(this,this._onFormElementClick);this._onWindowUnloadHandler=Function.createDelegate(this,this._onWindowUnload);Sys.UI.DomEvent.addHandler(this._form,"submit",this._onFormSubmitHandler);Sys.UI.DomEvent.addHandler(this._form,"click",this._onFormElementClickHandler);Sys.UI.DomEvent.addHandler(window,"unload",this._onWindowUnloadHandler);this._originalDoPostBack=window.__doPostBack;if(this._originalDoPostBack)window.__doPostBack=Function.createDelegate(this,this._doPostBack);this._originalDoPostBackWithOptions=window.WebForm_DoPostBackWithOptions;if(this._originalDoPostBackWithOptions)window.WebForm_DoPostBackWithOptions=Function.createDelegate(this,this._doPostBackWithOptions);this._originalFireDefaultButton=window.WebForm_FireDefaultButton;if(this._originalFireDefaultButton)window.WebForm_FireDefaultButton=Function.createDelegate(this,this._fireDefaultButton);this._originalDoCallback=window.WebForm_DoCallback;if(this._originalDoCallback)window.WebForm_DoCallback=Function.createDelegate(this,this._doCallback);this._pageLoadedHandler=Function.createDelegate(this,this._pageLoadedInitialLoad);Sys.UI.DomEvent.addHandler(window,"load",this._pageLoadedHandler);if(a)this._updateControls(a,b,e,c,true)},_matchesParentIDInList:function(c,b){for(var a=0,d=b.length;a=c.length){e=this._findText(c,c.length);break}D=c.substr(b,i);b+=i;if(c.charAt(b)!=="|"){e=this._findText(c,b);break}b++;Array.add(k,{type:E,id:F,content:D})}if(e){this._endPostBack(this._createPageRequestManagerParserError(String.format(Sys.WebForms.Res.PRM_ParserErrorDetails,e)),h,null);return null}var x=[],w=[],q=[],j=[],t=[],C=[],A=[],z=[],v=[],s=[],m,p,u,n,o,r,y,g;for(var l=0,G=k.length;l=4)a.content=unescape(a.content);if(Sys.Browser.agent===Sys.Browser.InternetExplorer){var f=document.createElement("a");f.style.display="none";f.attachEvent("onclick",B);f.href=a.content;this._form.parentNode.insertBefore(f,this._form);f.click();f.detachEvent("onclick",B);this._form.parentNode.removeChild(f);function B(a){a.cancelBubble=true}}else window.location.href=a.content;return null;case "error":this._endPostBack(this._createPageRequestManagerServerError(Number.parseInvariant(a.id),a.content),h,null);return null;case "pageTitle":document.title=a.content;break;case "focus":this._controlIDToFocus=a.content;break;default:this._endPostBack(this._createPageRequestManagerParserError(String.format(Sys.WebForms.Res.PRM_UnknownToken,a.type)),h,null);return null}}return {version4:g?parseFloat(g.content)>=4:false,executor:h,updatePanelNodes:x,hiddenFieldNodes:w,arrayDeclarationNodes:q,scriptBlockNodes:j,scriptStartupNodes:t,expandoNodes:C,onSubmitNodes:A,dataItemNodes:z,dataItemJsonNodes:v,scriptDisposeNodes:s,asyncPostBackControlIDsNode:m,postBackControlIDsNode:p,updatePanelIDsNode:u,asyncPostBackTimeoutNode:n,childUpdatePanelIDsNode:o,panelsToRefreshNode:r,formActionNode:y}},_processUpdatePanelArrays:function(e,q,r,f){var d,c,b;if(e){var i=e.length,j=f?2:1;d=new Array(i/j);c=new Array(i/j);b=new Array(i/j);for(var g=0,h=0;g0){var d=[];for(var c=0;c=d)break;a=Function._validateParameter(g[b],f,h);if(a){a.popStackFrame();return a}}return null};Function._validateParameterCount=function(j,d,i){var a,c,b=d.length,e=j.length;if(eb){c=true;for(a=0;a0&&(d=0};Array.dequeue=function(a){return a.shift()};Array.forEach=function(b,e,d){for(var a=0,f=b.length;a=0)b.splice(a,1);return a>=0};Array.removeAt=function(a,b){a.splice(b,1)};Sys._indexOf=function(d,e,a){if(typeof e==="undefined")return -1;var c=d.length;if(c!==0){a=a-0;if(isNaN(a))a=0;else{if(isFinite(a))a=a-a%1;if(a<0)a=Math.max(0,c+a)}for(var b=a;b-1){Sys.Browser.agent=Sys.Browser.InternetExplorer;Sys.Browser.version=parseFloat(navigator.userAgent.match(/MSIE (\d+\.\d+)/)[1]);if(Sys.Browser.version>=8)if(document.documentMode>=7)Sys.Browser.documentMode=document.documentMode;Sys.Browser.hasDebuggerStatement=true}else if(navigator.userAgent.indexOf(" Firefox/")>-1){Sys.Browser.agent=Sys.Browser.Firefox;Sys.Browser.version=parseFloat(navigator.userAgent.match(/Firefox\/(\d+\.\d+)/)[1]);Sys.Browser.name="Firefox";Sys.Browser.hasDebuggerStatement=true}else if(navigator.userAgent.indexOf(" AppleWebKit/")>-1){Sys.Browser.agent=Sys.Browser.Safari;Sys.Browser.version=parseFloat(navigator.userAgent.match(/AppleWebKit\/(\d+(\.\d+)?)/)[1]);Sys.Browser.name="Safari"}else if(navigator.userAgent.indexOf("Opera/")>-1)Sys.Browser.agent=Sys.Browser.Opera;Sys.EventArgs=function(){};Sys.EventArgs.registerClass("Sys.EventArgs");Sys.EventArgs.Empty=new Sys.EventArgs;Sys.CancelEventArgs=function(){Sys.CancelEventArgs.initializeBase(this);this._cancel=false};Sys.CancelEventArgs.prototype={get_cancel:function(){return this._cancel},set_cancel:function(a){this._cancel=a}};Sys.CancelEventArgs.registerClass("Sys.CancelEventArgs",Sys.EventArgs);Type.registerNamespace("Sys.UI");Sys._Debug=function(){};Sys._Debug.prototype={_appendConsole:function(a){if(typeof Debug!=="undefined"&&Debug.writeln)Debug.writeln(a);if(window.console&&window.console.log)window.console.log(a);if(window.opera)window.opera.postError(a);if(window.debugService)window.debugService.trace(a)},_appendTrace:function(b){var a=document.getElementById("TraceConsole");if(a&&a.tagName.toUpperCase()==="TEXTAREA")a.value+=b+"\n"},assert:function(c,a,b){if(!c){a=b&&this.assert.caller?String.format(Sys.Res.assertFailedCaller,a,this.assert.caller):String.format(Sys.Res.assertFailed,a);if(confirm(String.format(Sys.Res.breakIntoDebugger,a)))this.fail(a)}},clearTrace:function(){var a=document.getElementById("TraceConsole");if(a&&a.tagName.toUpperCase()==="TEXTAREA")a.value=""},fail:function(message){this._appendConsole(message);if(Sys.Browser.hasDebuggerStatement)eval("debugger")},trace:function(a){this._appendConsole(a);this._appendTrace(a)},traceDump:function(a,b){var c=this._traceDump(a,b,true)},_traceDump:function(a,c,f,b,d){c=c?c:"traceDump";b=b?b:"";if(a===null){this.trace(b+c+": null");return}switch(typeof a){case "undefined":this.trace(b+c+": Undefined");break;case "number":case "string":case "boolean":this.trace(b+c+": "+a);break;default:if(Date.isInstanceOfType(a)||RegExp.isInstanceOfType(a)){this.trace(b+c+": "+a.toString());break}if(!d)d=[];else if(Array.contains(d,a)){this.trace(b+c+": ...");return}Array.add(d,a);if(a==window||a===document||window.HTMLElement&&a instanceof HTMLElement||typeof a.nodeName==="string"){var k=a.tagName?a.tagName:"DomElement";if(a.id)k+=" - "+a.id;this.trace(b+c+" {"+k+"}")}else{var i=Object.getTypeName(a);this.trace(b+c+(typeof i==="string"?" {"+i+"}":""));if(b===""||f){b+=" ";var e,j,l,g,h;if(Array.isInstanceOfType(a)){j=a.length;for(e=0;e=0;d--){var k=h[d].trim();b=a[k];if(typeof b!=="number")throw Error.argument("value",String.format(Sys.Res.enumInvalidValue,c.split(",")[d].trim(),this.__typeName));j|=b}return j}}function Sys$Enum$toString(c){if(typeof c==="undefined"||c===null)return this.__string;var d=this.prototype,a;if(!this.__flags||c===0){for(a in d)if(d[a]===c)return a}else{var b=this.__sortedValues;if(!b){b=[];for(a in d)b[b.length]={key:a,value:d[a]};b.sort(function(a,b){return a.value-b.value});this.__sortedValues=b}var e=[],g=c;for(a=b.length-1;a>=0;a--){var h=b[a],f=h.value;if(f===0)continue;if((f&c)===f){e[e.length]=h.key;g-=f;if(g===0)break}}if(e.length&&g===0)return e.reverse().join(", ")}return ""}Type.prototype.registerEnum=function(b,c){Sys.__upperCaseTypes[b.toUpperCase()]=this;for(var a in this.prototype)this[a]=this.prototype[a];this.__typeName=b;this.parse=Sys$Enum$parse;this.__string=this.toString();this.toString=Sys$Enum$toString;this.__flags=c;this.__enum=true};Type.isEnum=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__enum};Type.isFlags=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__flags};Sys.CollectionChange=function(e,a,c,b,d){this.action=e;if(a)if(!(a instanceof Array))a=[a];this.newItems=a||null;if(typeof c!=="number")c=-1;this.newStartingIndex=c;if(b)if(!(b instanceof Array))b=[b];this.oldItems=b||null;if(typeof d!=="number")d=-1;this.oldStartingIndex=d};Sys.CollectionChange.registerClass("Sys.CollectionChange");Sys.NotifyCollectionChangedAction=function(){throw Error.notImplemented()};Sys.NotifyCollectionChangedAction.prototype={add:0,remove:1,reset:2};Sys.NotifyCollectionChangedAction.registerEnum("Sys.NotifyCollectionChangedAction");Sys.NotifyCollectionChangedEventArgs=function(a){this._changes=a;Sys.NotifyCollectionChangedEventArgs.initializeBase(this)};Sys.NotifyCollectionChangedEventArgs.prototype={get_changes:function(){return this._changes||[]}};Sys.NotifyCollectionChangedEventArgs.registerClass("Sys.NotifyCollectionChangedEventArgs",Sys.EventArgs);Sys.Observer=function(){};Sys.Observer.registerClass("Sys.Observer");Sys.Observer.makeObservable=function(a){var c=a instanceof Array,b=Sys.Observer;if(a.setValue===b._observeMethods.setValue)return a;b._addMethods(a,b._observeMethods);if(c)b._addMethods(a,b._arrayMethods);return a};Sys.Observer._addMethods=function(c,b){for(var a in b)c[a]=b[a]};Sys.Observer._addEventHandler=function(c,a,b){Sys.Observer._getContext(c,true).events._addHandler(a,b)};Sys.Observer.addEventHandler=function(c,a,b){Sys.Observer._addEventHandler(c,a,b)};Sys.Observer._removeEventHandler=function(c,a,b){Sys.Observer._getContext(c,true).events._removeHandler(a,b)};Sys.Observer.removeEventHandler=function(c,a,b){Sys.Observer._removeEventHandler(c,a,b)};Sys.Observer.raiseEvent=function(b,e,d){var c=Sys.Observer._getContext(b);if(!c)return;var a=c.events.getHandler(e);if(a)a(b,d)};Sys.Observer.addPropertyChanged=function(b,a){Sys.Observer._addEventHandler(b,"propertyChanged",a)};Sys.Observer.removePropertyChanged=function(b,a){Sys.Observer._removeEventHandler(b,"propertyChanged",a)};Sys.Observer.beginUpdate=function(a){Sys.Observer._getContext(a,true).updating=true};Sys.Observer.endUpdate=function(b){var a=Sys.Observer._getContext(b);if(!a||!a.updating)return;a.updating=false;var d=a.dirty;a.dirty=false;if(d){if(b instanceof Array){var c=a.changes;a.changes=null;Sys.Observer.raiseCollectionChanged(b,c)}Sys.Observer.raisePropertyChanged(b,"")}};Sys.Observer.isUpdating=function(b){var a=Sys.Observer._getContext(b);return a?a.updating:false};Sys.Observer._setValue=function(a,j,g){var b,f,k=a,d=j.split(".");for(var i=0,m=d.length-1;i-1&&ac.Calendar.TwoDigitYearMax)a-=100}return a};Date._getEra=function(e,c){if(!c)return 0;var b,d=e.getTime();for(var a=0,f=c.length;a=b)return a}return 0};Date._getEraYear=function(d,b,e,c){var a=d.getFullYear();if(!c&&b.eras)a-=b.eras[e+3];return a};Date._getParseRegExp=function(b,e){if(!b._parseRegExp)b._parseRegExp={};else if(b._parseRegExp[e])return b._parseRegExp[e];var c=Date._expandFormat(b,e);c=c.replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g,"\\\\$1");var a=new Sys.StringBuilder("^"),j=[],f=0,i=0,h=Date._getTokenRegExp(),d;while((d=h.exec(c))!==null){var l=c.slice(f,d.index);f=h.lastIndex;i+=Date._appendPreOrPostMatch(l,a);if(i%2===1){a.append(d[0]);continue}switch(d[0]){case "dddd":case "ddd":case "MMMM":case "MMM":case "gg":case "g":a.append("(\\D+)");break;case "tt":case "t":a.append("(\\D*)");break;case "yyyy":a.append("(\\d{4})");break;case "fff":a.append("(\\d{3})");break;case "ff":a.append("(\\d{2})");break;case "f":a.append("(\\d)");break;case "dd":case "d":case "MM":case "M":case "yy":case "y":case "HH":case "H":case "hh":case "h":case "mm":case "m":case "ss":case "s":a.append("(\\d\\d?)");break;case "zzz":a.append("([+-]?\\d\\d?:\\d{2})");break;case "zz":case "z":a.append("([+-]?\\d\\d?)");break;case "/":a.append("(\\"+b.DateSeparator+")")}Array.add(j,d[0])}Date._appendPreOrPostMatch(c.slice(f),a);a.append("$");var k=a.toString().replace(/\s+/g,"\\s+"),g={"regExp":k,"groups":j};b._parseRegExp[e]=g;return g};Date._getTokenRegExp=function(){return /\/|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z|gg|g/g};Date.parseLocale=function(a){return Date._parse(a,Sys.CultureInfo.CurrentCulture,arguments)};Date.parseInvariant=function(a){return Date._parse(a,Sys.CultureInfo.InvariantCulture,arguments)};Date._parse=function(h,d,i){var a,c,b,f,e,g=false;for(a=1,c=i.length;a31)return null;break;case "MMMM":c=k._getMonthIndex(a);if(c<0||c>11)return null;break;case "MMM":c=k._getAbbrMonthIndex(a);if(c<0||c>11)return null;break;case "M":case "MM":c=parseInt(a,10)-1;if(c<0||c>11)return null;break;case "y":case "yy":e=Date._expandYear(g,parseInt(a,10));if(e<0||e>9999)return null;break;case "yyyy":e=parseInt(a,10);if(e<0||e>9999)return null;break;case "h":case "hh":d=parseInt(a,10);if(d===12)d=0;if(d<0||d>11)return null;break;case "H":case "HH":d=parseInt(a,10);if(d<0||d>23)return null;break;case "m":case "mm":p=parseInt(a,10);if(p<0||p>59)return null;break;case "s":case "ss":q=parseInt(a,10);if(q<0||q>59)return null;break;case "tt":case "t":var z=a.toUpperCase();v=z===g.PMDesignator.toUpperCase();if(!v&&z!==g.AMDesignator.toUpperCase())return null;break;case "f":f=parseInt(a,10)*100;if(f<0||f>999)return null;break;case "ff":f=parseInt(a,10)*10;if(f<0||f>999)return null;break;case "fff":f=parseInt(a,10);if(f<0||f>999)return null;break;case "dddd":i=k._getDayIndex(a);if(i<0||i>6)return null;break;case "ddd":i=k._getAbbrDayIndex(a);if(i<0||i>6)return null;break;case "zzz":var u=a.split(/:/);if(u.length!==2)return null;h=parseInt(u[0],10);if(h<-12||h>13)return null;var m=parseInt(u[1],10);if(m<0||m>59)return null;l=h*60+(a.startsWith("-")?-m:m);break;case "z":case "zz":h=parseInt(a,10);if(h<-12||h>13)return null;l=h*60;break;case "g":case "gg":var o=a;if(!o||!g.eras)return null;o=o.toLowerCase().trim();for(var r=0,F=g.eras.length;r0)return this.toLocaleString();else return this.toString();var o=["n %","n%","%n"],n=["-n %","-n%","-%n"],p=["(n)","-n","- n","n-","n -"],m=["$n","n$","$ n","n $"],l=["($n)","-$n","$-n","$n-","(n$)","-n$","n-$","n$-","-n $","-$ n","n $-","$ n-","$ -n","n- $","($ n)","(n $)"];function g(a,c,d){for(var b=a.length;b1?parseInt(e[1]):0;e=b.split(".");b=e[0];a=e.length>1?e[1]:"";var q;if(c>0){a=g(a,c,false);b+=a.slice(0,c);a=a.substr(c)}else if(c<0){c=-c;b=g(b,c+1,true);a=b.slice(-c,b.length)+a;b=b.slice(0,-c)}if(i>0){if(a.length>i)a=a.slice(0,i);else a=g(a,i,false);a=p+a}else a="";var d=b.length-1,f="";while(d>=0){if(h===0||h>d)if(f.length>0)return b.slice(0,d+1)+n+f+a;else return b.slice(0,d+1)+a;if(f.length>0)f=b.slice(d-h+1,d+1)+n+f;else f=b.slice(d-h+1,d+1);d-=h;if(k1)b=parseInt(e.slice(1),10);var c;switch(e.charAt(0)){case "d":case "D":c="n";if(b!==-1)d=g(""+d,b,true);if(this<0)d=-d;break;case "c":case "C":if(this<0)c=l[a.CurrencyNegativePattern];else c=m[a.CurrencyPositivePattern];if(b===-1)b=a.CurrencyDecimalDigits;d=i(Math.abs(this),b,a.CurrencyGroupSizes,a.CurrencyGroupSeparator,a.CurrencyDecimalSeparator);break;case "n":case "N":if(this<0)c=p[a.NumberNegativePattern];else c="n";if(b===-1)b=a.NumberDecimalDigits;d=i(Math.abs(this),b,a.NumberGroupSizes,a.NumberGroupSeparator,a.NumberDecimalSeparator);break;case "p":case "P":if(this<0)c=n[a.PercentNegativePattern];else c=o[a.PercentPositivePattern];if(b===-1)b=a.PercentDecimalDigits;d=i(Math.abs(this)*100,b,a.PercentGroupSizes,a.PercentGroupSeparator,a.PercentDecimalSeparator);break;default:throw Error.format(Sys.Res.formatBadFormatSpecifier)}var k=/n|\$|-|%/g,f="";for(;true;){var q=k.lastIndex,h=k.exec(c);f+=c.slice(q,h?h.index:c.length);if(!h)break;switch(h[0]){case "n":f+=d;break;case "$":f+=a.CurrencySymbol;break;case "-":if(/[1-9]/.test(d))f+=a.NegativeSign;break;case "%":f+=a.PercentSymbol}}return f};Sys.CultureInfo=function(c,b,a){this.name=c;this.numberFormat=b;this.dateTimeFormat=a};Sys.CultureInfo.prototype={_getDateTimeFormats:function(){if(!this._dateTimeFormats){var a=this.dateTimeFormat;this._dateTimeFormats=[a.MonthDayPattern,a.YearMonthPattern,a.ShortDatePattern,a.ShortTimePattern,a.LongDatePattern,a.LongTimePattern,a.FullDateTimePattern,a.RFC1123Pattern,a.SortableDateTimePattern,a.UniversalSortableDateTimePattern]}return this._dateTimeFormats},_getIndex:function(c,d,e){var b=this._toUpper(c),a=Array.indexOf(d,b);if(a===-1)a=Array.indexOf(e,b);return a},_getMonthIndex:function(a){if(!this._upperMonths){this._upperMonths=this._toUpperArray(this.dateTimeFormat.MonthNames);this._upperMonthsGenitive=this._toUpperArray(this.dateTimeFormat.MonthGenitiveNames)}return this._getIndex(a,this._upperMonths,this._upperMonthsGenitive)},_getAbbrMonthIndex:function(a){if(!this._upperAbbrMonths){this._upperAbbrMonths=this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames);this._upperAbbrMonthsGenitive=this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthGenitiveNames)}return this._getIndex(a,this._upperAbbrMonths,this._upperAbbrMonthsGenitive)},_getDayIndex:function(a){if(!this._upperDays)this._upperDays=this._toUpperArray(this.dateTimeFormat.DayNames);return Array.indexOf(this._upperDays,this._toUpper(a))},_getAbbrDayIndex:function(a){if(!this._upperAbbrDays)this._upperAbbrDays=this._toUpperArray(this.dateTimeFormat.AbbreviatedDayNames);return Array.indexOf(this._upperAbbrDays,this._toUpper(a))},_toUpperArray:function(c){var b=[];for(var a=0,d=c.length;a0)a.append(",");Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(b[c],a,false,g)}a.append("]")}else{if(Date.isInstanceOfType(b)){a.append('"\\/Date(');a.append(b.getTime());a.append(')\\/"');break}var d=[],f=0;for(var e in b){if(e.startsWith("$"))continue;if(e===Sys.Serialization.JavaScriptSerializer._serverTypeFieldName&&f!==0){d[f++]=d[0];d[0]=e}else d[f++]=e}if(i)d.sort();a.append("{");var j=false;for(c=0;c=0;c--){var f=d[c];if(!g||f.autoRemove)$removeHandler(a,b,f.handler)}}a._events=null}};Sys.UI.DomEvent._disposeHandlers=function(){Sys.UI.DomEvent._clearHandlers(this,true);var b=this._chainDispose,a=typeof b;if(a!=="undefined"){this.dispose=b;this._chainDispose=null;if(a==="function")this.dispose()}};var $removeHandler=Sys.UI.DomEvent.removeHandler=function(b,a,c){Sys.UI.DomEvent._removeHandler(b,a,c)};Sys.UI.DomEvent._removeHandler=function(a,e,f){var d=null,c=a._events[e];for(var b=0,g=c.length;b=3){d+=parseInt(b.borderLeftWidth);e+=parseInt(b.borderTopWidth)}}b=Sys.UI.DomElement._getCurrentStyle(c);var h=b?b.position:null;if(!h||h!=="absolute")for(a=c.parentNode;a;a=a.parentNode){f=a.tagName?a.tagName.toUpperCase():null;if(f!=="BODY"&&f!=="HTML"&&(a.scrollLeft||a.scrollTop)){d-=a.scrollLeft||0;e-=a.scrollTop||0}b=Sys.UI.DomElement._getCurrentStyle(a);var i=b?b.position:null;if(i&&i==="absolute")break}return new Sys.UI.Point(d,e)};else Sys.UI.DomElement.getLocation=function(d){if(d.window&&d.window===d||d.nodeType===9)return new Sys.UI.Point(0,0);var e=0,f=0,a,i=null,g=null,b=null;for(a=d;a;i=a,(g=b,a=a.offsetParent)){var c=a.tagName?a.tagName.toUpperCase():null;b=Sys.UI.DomElement._getCurrentStyle(a);if((a.offsetLeft||a.offsetTop)&&!(c==="BODY"&&(!g||g.position!=="absolute"))){e+=a.offsetLeft;f+=a.offsetTop}if(i!==null&&b){if(c!=="TABLE"&&c!=="TD"&&c!=="HTML"){e+=parseInt(b.borderLeftWidth)||0;f+=parseInt(b.borderTopWidth)||0}if(c==="TABLE"&&(b.position==="relative"||b.position==="absolute")){e+=parseInt(b.marginLeft)||0;f+=parseInt(b.marginTop)||0}}}b=Sys.UI.DomElement._getCurrentStyle(d);var h=b?b.position:null;if(!h||h!=="absolute")for(a=d.parentNode;a;a=a.parentNode){c=a.tagName?a.tagName.toUpperCase():null;if(c!=="BODY"&&c!=="HTML"&&(a.scrollLeft||a.scrollTop)){e-=a.scrollLeft||0;f-=a.scrollTop||0;b=Sys.UI.DomElement._getCurrentStyle(a);if(b){e+=parseInt(b.borderLeftWidth)||0;f+=parseInt(b.borderTopWidth)||0}}}return new Sys.UI.Point(e,f)};Sys.UI.DomElement.isDomElement=function(a){return Sys._isDomElement(a)};Sys.UI.DomElement.removeCssClass=function(d,c){var a=" "+d.className+" ",b=a.indexOf(" "+c+" ");if(b>=0)d.className=(a.substr(0,b)+" "+a.substring(b+c.length+1,a.length)).trim()};Sys.UI.DomElement.resolveElement=function(b,c){var a=b;if(!a)return null;if(typeof a==="string")a=Sys.UI.DomElement.getElementById(a,c);return a};Sys.UI.DomElement.raiseBubbleEvent=function(c,d){var b=c;while(b){var a=b.control;if(a&&a.onBubbleEvent&&a.raiseBubbleEvent){Sys.UI.DomElement._raiseBubbleEventFromControl(a,c,d);return}b=b.parentNode}};Sys.UI.DomElement._raiseBubbleEventFromControl=function(a,b,c){if(!a.onBubbleEvent(b,c))a._raiseBubbleEvent(b,c)};Sys.UI.DomElement.setLocation=function(b,c,d){var a=b.style;a.position="absolute";a.left=c+"px";a.top=d+"px"};Sys.UI.DomElement.toggleCssClass=function(b,a){if(Sys.UI.DomElement.containsCssClass(b,a))Sys.UI.DomElement.removeCssClass(b,a);else Sys.UI.DomElement.addCssClass(b,a)};Sys.UI.DomElement.getVisibilityMode=function(a){return a._visibilityMode===Sys.UI.VisibilityMode.hide?Sys.UI.VisibilityMode.hide:Sys.UI.VisibilityMode.collapse};Sys.UI.DomElement.setVisibilityMode=function(a,b){Sys.UI.DomElement._ensureOldDisplayMode(a);if(a._visibilityMode!==b){a._visibilityMode=b;if(Sys.UI.DomElement.getVisible(a)===false)if(a._visibilityMode===Sys.UI.VisibilityMode.hide)a.style.display=a._oldDisplayMode;else a.style.display="none";a._visibilityMode=b}};Sys.UI.DomElement.getVisible=function(b){var a=b.currentStyle||Sys.UI.DomElement._getCurrentStyle(b);if(!a)return true;return a.visibility!=="hidden"&&a.display!=="none"};Sys.UI.DomElement.setVisible=function(a,b){if(b!==Sys.UI.DomElement.getVisible(a)){Sys.UI.DomElement._ensureOldDisplayMode(a);a.style.visibility=b?"visible":"hidden";if(b||a._visibilityMode===Sys.UI.VisibilityMode.hide)a.style.display=a._oldDisplayMode;else a.style.display="none"}};Sys.UI.DomElement._ensureOldDisplayMode=function(a){if(!a._oldDisplayMode){var b=a.currentStyle||Sys.UI.DomElement._getCurrentStyle(a);a._oldDisplayMode=b?b.display:null;if(!a._oldDisplayMode||a._oldDisplayMode==="none")switch(a.tagName.toUpperCase()){case "DIV":case "P":case "ADDRESS":case "BLOCKQUOTE":case "BODY":case "COL":case "COLGROUP":case "DD":case "DL":case "DT":case "FIELDSET":case "FORM":case "H1":case "H2":case "H3":case "H4":case "H5":case "H6":case "HR":case "IFRAME":case "LEGEND":case "OL":case "PRE":case "TABLE":case "TD":case "TH":case "TR":case "UL":a._oldDisplayMode="block";break;case "LI":a._oldDisplayMode="list-item";break;default:a._oldDisplayMode="inline"}}};Sys.UI.DomElement._getWindow=function(a){var b=a.ownerDocument||a.document||a;return b.defaultView||b.parentWindow};Sys.UI.DomElement._getCurrentStyle=function(a){if(a.nodeType===3)return null;var c=Sys.UI.DomElement._getWindow(a);if(a.documentElement)a=a.documentElement;var b=c&&a!==c&&c.getComputedStyle?c.getComputedStyle(a,null):a.currentStyle||a.style;if(!b&&Sys.Browser.agent===Sys.Browser.Safari&&a.style){var g=a.style.display,f=a.style.position;a.style.position="absolute";a.style.display="block";var e=c.getComputedStyle(a,null);a.style.display=g;a.style.position=f;b={};for(var d in e)b[d]=e[d];b.display="none"}return b};Sys.IContainer=function(){};Sys.IContainer.prototype={};Sys.IContainer.registerInterface("Sys.IContainer");Sys.ApplicationLoadEventArgs=function(b,a){Sys.ApplicationLoadEventArgs.initializeBase(this);this._components=b;this._isPartialLoad=a};Sys.ApplicationLoadEventArgs.prototype={get_components:function(){return this._components},get_isPartialLoad:function(){return this._isPartialLoad}};Sys.ApplicationLoadEventArgs.registerClass("Sys.ApplicationLoadEventArgs",Sys.EventArgs);Sys._Application=function(){Sys._Application.initializeBase(this);this._disposableObjects=[];this._components={};this._createdComponents=[];this._secondPassComponents=[];this._unloadHandlerDelegate=Function.createDelegate(this,this._unloadHandler);Sys.UI.DomEvent.addHandler(window,"unload",this._unloadHandlerDelegate);this._domReady()};Sys._Application.prototype={_creatingComponents:false,_disposing:false,_deleteCount:0,get_isCreatingComponents:function(){return this._creatingComponents},get_isDisposing:function(){return this._disposing},add_init:function(a){if(this._initialized)a(this,Sys.EventArgs.Empty);else this.get_events().addHandler("init",a)},remove_init:function(a){this.get_events().removeHandler("init",a)},add_load:function(a){this.get_events().addHandler("load",a)},remove_load:function(a){this.get_events().removeHandler("load",a)},add_unload:function(a){this.get_events().addHandler("unload",a)},remove_unload:function(a){this.get_events().removeHandler("unload",a)},addComponent:function(a){this._components[a.get_id()]=a},beginCreateComponents:function(){this._creatingComponents=true},dispose:function(){if(!this._disposing){this._disposing=true;if(this._timerCookie){window.clearTimeout(this._timerCookie);delete this._timerCookie}if(this._endRequestHandler){Sys.WebForms.PageRequestManager.getInstance().remove_endRequest(this._endRequestHandler);delete this._endRequestHandler}if(this._beginRequestHandler){Sys.WebForms.PageRequestManager.getInstance().remove_beginRequest(this._beginRequestHandler);delete this._beginRequestHandler}if(window.pageUnload)window.pageUnload(this,Sys.EventArgs.Empty);var c=this.get_events().getHandler("unload");if(c)c(this,Sys.EventArgs.Empty);var b=Array.clone(this._disposableObjects);for(var a=0,f=b.length;a=0;b--){var d=i[b],f=d.dispose;if(f&&typeof f==="function")d.dispose();else{var e=d.control;if(e&&typeof e.dispose==="function")e.dispose()}var a=d._behaviors;if(a)this._disposeComponents(a);a=d._components;if(a){this._disposeComponents(a);d._components=null}}if(!j){var f=c.dispose;if(f&&typeof f==="function")c.dispose();else{var e=c.control;if(e&&typeof e.dispose==="function")e.dispose()}var a=c._behaviors;if(a)this._disposeComponents(a);a=c._components;if(a){this._disposeComponents(a);c._components=null}}}},endCreateComponents:function(){var b=this._secondPassComponents;for(var a=0,d=b.length;a1000){var c=[];for(var d=0,f=b.length;d=0;b--){var c=a[b];if(typeof c.dispose==="function")c.dispose()}},_domReady:function(){var a,g,f=this;function b(){f.initialize()}var c=function(){Sys.UI.DomEvent.removeHandler(window,"load",c);b()};Sys.UI.DomEvent.addHandler(window,"load",c);if(document.addEventListener)try{document.addEventListener("DOMContentLoaded",a=function(){document.removeEventListener("DOMContentLoaded",a,false);b()},false)}catch(h){}else if(document.attachEvent)if(window==window.top&&document.documentElement.doScroll){var e,d=document.createElement("div");a=function(){try{d.doScroll("left")}catch(c){e=window.setTimeout(a,0);return}d=null;b()};a()}else document.attachEvent("onreadystatechange",a=function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",a);b()}})},_raiseInit:function(){var a=this.get_events().getHandler("init");if(a){this.beginCreateComponents();a(this,Sys.EventArgs.Empty);this.endCreateComponents()}},_unloadHandler:function(){this.dispose()}};Sys._Application.registerClass("Sys._Application",Sys.Component,Sys.IContainer);Sys.Application=new Sys._Application;var $find=Sys.Application.findComponent;Sys.UI.Behavior=function(b){Sys.UI.Behavior.initializeBase(this);this._element=b;var a=b._behaviors;if(!a)b._behaviors=[this];else a[a.length]=this};Sys.UI.Behavior.prototype={_name:null,get_element:function(){return this._element},get_id:function(){var a=Sys.UI.Behavior.callBaseMethod(this,"get_id");if(a)return a;if(!this._element||!this._element.id)return "";return this._element.id+"$"+this.get_name()},get_name:function(){if(this._name)return this._name;var a=Object.getTypeName(this),b=a.lastIndexOf(".");if(b!==-1)a=a.substr(b+1);if(!this.get_isInitialized())this._name=a;return a},set_name:function(a){this._name=a},initialize:function(){Sys.UI.Behavior.callBaseMethod(this,"initialize");var a=this.get_name();if(a)this._element[a]=this},dispose:function(){Sys.UI.Behavior.callBaseMethod(this,"dispose");var a=this._element;if(a){var c=this.get_name();if(c)a[c]=null;var b=a._behaviors;Array.remove(b,this);if(b.length===0)a._behaviors=null;delete this._element}}};Sys.UI.Behavior.registerClass("Sys.UI.Behavior",Sys.Component);Sys.UI.Behavior.getBehaviorByName=function(b,c){var a=b[c];return a&&Sys.UI.Behavior.isInstanceOfType(a)?a:null};Sys.UI.Behavior.getBehaviors=function(a){if(!a._behaviors)return [];return Array.clone(a._behaviors)};Sys.UI.Behavior.getBehaviorsByType=function(d,e){var a=d._behaviors,c=[];if(a)for(var b=0,f=a.length;b0&&a.charAt(0)==="#")a=a.substring(1);return a};Sys._Application.prototype.get_enableHistory=function(){return this._enableHistory};Sys._Application.prototype.set_enableHistory=function(a){this._enableHistory=a};Sys._Application.prototype.add_navigate=function(a){this.get_events().addHandler("navigate",a)};Sys._Application.prototype.remove_navigate=function(a){this.get_events().removeHandler("navigate",a)};Sys._Application.prototype.addHistoryPoint=function(c,f){this._ensureHistory();var b=this._state;for(var a in c){var d=c[a];if(d===null){if(typeof b[a]!=="undefined")delete b[a]}else b[a]=d}var e=this._serializeState(b);this._historyPointIsNew=true;this._setState(e,f);this._raiseNavigate()};Sys._Application.prototype.setServerId=function(a,b){this._clientId=a;this._uniqueId=b};Sys._Application.prototype.setServerState=function(a){this._ensureHistory();this._state.__s=a;this._updateHiddenField(a)};Sys._Application.prototype._deserializeState=function(a){var e={};a=a||"";var b=a.indexOf("&&");if(b!==-1&&b+27){var e=document.title;document.title=c;this._setState(a);document.title=e}else this._setState(a);this._raiseNavigate()}else{this._setState(a);this._raiseNavigate()}}};Sys._Application.prototype._raiseNavigate=function(){var d=this._historyPointIsNew,c=this.get_events().getHandler("navigate"),b={};for(var a in this._state)if(a!=="__s")b[a]=this._state[a];var e=new Sys.HistoryEventArgs(b);if(c)c(this,e);if(!d){var f;try{if(Sys.Browser.agent===Sys.Browser.Firefox&&window.location.hash&&(!window.frameElement||window.top.location.hash))Sys.Browser.version<3.5?window.history.go(0):(location.hash=this.get_stateString())}catch(g){}}};Sys._Application.prototype._serializeState=function(d){var b=[];for(var a in d){var e=d[a];if(a==="__s")var c=e;else b[b.length]=a+"="+encodeURIComponent(e)}return b.join("&")+(c?"&&"+c:"")};Sys._Application.prototype._setState=function(a,b){if(this._enableHistory){a=a||"";if(a!==this._currentEntry){if(window.theForm){var d=window.theForm.action,e=d.indexOf("#");window.theForm.action=(e!==-1?d.substring(0,e):d)+"#"+a}if(this._historyFrame&&this._historyPointIsNew){var f=document.createElement("div");f.appendChild(document.createTextNode(b||document.title));var g=f.innerHTML;this._ignoreIFrame=true;var c=this._historyFrame.contentWindow.document;c.open("javascript:''");c.write(""+g+"parent.Sys.Application._onIFrameLoad('+Sys.Serialization.JavaScriptSerializer.serialize(a)+");");c.close()}this._ignoreTimer=false;this._currentEntry=a;if(this._historyFrame||this._historyPointIsNew){var h=this.get_stateString();if(a!==h){window.location.hash=a;this._currentEntry=this.get_stateString();if(typeof b!=="undefined"&&b!==null)document.title=b}}this._historyPointIsNew=false}}};Sys._Application.prototype._updateHiddenField=function(b){if(this._clientId){var a=document.getElementById(this._clientId);if(a)a.value=b}};if(!window.XMLHttpRequest)window.XMLHttpRequest=function(){var b=["Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP"];for(var a=0,c=b.length;a0)this._timer=window.setTimeout(Function.createDelegate(this,this._onTimeout),d);this._xmlHttpRequest.send(c);this._started=true},getResponseHeader:function(b){var a;try{a=this._xmlHttpRequest.getResponseHeader(b)}catch(c){}if(!a)a="";return a},getAllResponseHeaders:function(){return this._xmlHttpRequest.getAllResponseHeaders()},get_responseData:function(){return this._xmlHttpRequest.responseText},get_statusCode:function(){var a=0;try{a=this._xmlHttpRequest.status}catch(b){}return a},get_statusText:function(){return this._xmlHttpRequest.statusText},get_xml:function(){var a=this._xmlHttpRequest.responseXML;if(!a||!a.documentElement){a=Sys.Net.XMLDOM(this._xmlHttpRequest.responseText);if(!a||!a.documentElement)return null}else if(navigator.userAgent.indexOf("MSIE")!==-1&&typeof a.setProperty!="undefined")a.setProperty("SelectionLanguage","XPath");if(a.documentElement.namespaceURI==="http://www.mozilla.org/newlayout/xml/parsererror.xml"&&a.documentElement.tagName==="parsererror")return null;if(a.documentElement.firstChild&&a.documentElement.firstChild.tagName==="parsererror")return null;return a},abort:function(){if(this._aborted||this._responseAvailable||this._timedOut)return;this._aborted=true;this._clearTimer();if(this._xmlHttpRequest&&!this._responseAvailable){this._xmlHttpRequest.onreadystatechange=Function.emptyMethod;this._xmlHttpRequest.abort();this._xmlHttpRequest=null;this._webRequest.completed(Sys.EventArgs.Empty)}}};Sys.Net.XMLHttpExecutor.registerClass("Sys.Net.XMLHttpExecutor",Sys.Net.WebRequestExecutor);Sys.Net._WebRequestManager=function(){this._defaultTimeout=0;this._defaultExecutorType="Sys.Net.XMLHttpExecutor"};Sys.Net._WebRequestManager.prototype={add_invokingRequest:function(a){this._get_eventHandlerList().addHandler("invokingRequest",a)},remove_invokingRequest:function(a){this._get_eventHandlerList().removeHandler("invokingRequest",a)},add_completedRequest:function(a){this._get_eventHandlerList().addHandler("completedRequest",a)},remove_completedRequest:function(a){this._get_eventHandlerList().removeHandler("completedRequest",a)},_get_eventHandlerList:function(){if(!this._events)this._events=new Sys.EventHandlerList;return this._events},get_defaultTimeout:function(){return this._defaultTimeout},set_defaultTimeout:function(a){this._defaultTimeout=a},get_defaultExecutorType:function(){return this._defaultExecutorType},set_defaultExecutorType:function(a){this._defaultExecutorType=a},executeRequest:function(webRequest){var executor=webRequest.get_executor();if(!executor){var failed=false;try{var executorType=eval(this._defaultExecutorType);executor=new executorType}catch(a){failed=true}webRequest.set_executor(executor)}if(executor.get_aborted())return;var evArgs=new Sys.Net.NetworkRequestEventArgs(webRequest),handler=this._get_eventHandlerList().getHandler("invokingRequest");if(handler)handler(this,evArgs);if(!evArgs.get_cancel())executor.executeRequest()}};Sys.Net._WebRequestManager.registerClass("Sys.Net._WebRequestManager");Sys.Net.WebRequestManager=new Sys.Net._WebRequestManager;Sys.Net.NetworkRequestEventArgs=function(a){Sys.Net.NetworkRequestEventArgs.initializeBase(this);this._webRequest=a};Sys.Net.NetworkRequestEventArgs.prototype={get_webRequest:function(){return this._webRequest}};Sys.Net.NetworkRequestEventArgs.registerClass("Sys.Net.NetworkRequestEventArgs",Sys.CancelEventArgs);Sys.Net.WebRequest=function(){this._url="";this._headers={};this._body=null;this._userContext=null;this._httpVerb=null;this._executor=null;this._invokeCalled=false;this._timeout=0};Sys.Net.WebRequest.prototype={add_completed:function(a){this._get_eventHandlerList().addHandler("completed",a)},remove_completed:function(a){this._get_eventHandlerList().removeHandler("completed",a)},completed:function(b){var a=Sys.Net.WebRequestManager._get_eventHandlerList().getHandler("completedRequest");if(a)a(this._executor,b);a=this._get_eventHandlerList().getHandler("completed");if(a)a(this._executor,b)},_get_eventHandlerList:function(){if(!this._events)this._events=new Sys.EventHandlerList;return this._events},get_url:function(){return this._url},set_url:function(a){this._url=a},get_headers:function(){return this._headers},get_httpVerb:function(){if(this._httpVerb===null){if(this._body===null)return "GET";return "POST"}return this._httpVerb},set_httpVerb:function(a){this._httpVerb=a},get_body:function(){return this._body},set_body:function(a){this._body=a},get_userContext:function(){return this._userContext},set_userContext:function(a){this._userContext=a},get_executor:function(){return this._executor},set_executor:function(a){this._executor=a;this._executor._set_webRequest(this)},get_timeout:function(){if(this._timeout===0)return Sys.Net.WebRequestManager.get_defaultTimeout();return this._timeout},set_timeout:function(a){this._timeout=a},getResolvedUrl:function(){return Sys.Net.WebRequest._resolveUrl(this._url)},invoke:function(){Sys.Net.WebRequestManager.executeRequest(this);this._invokeCalled=true}};Sys.Net.WebRequest._resolveUrl=function(b,a){if(b&&b.indexOf("://")!==-1)return b;if(!a||a.length===0){var d=document.getElementsByTagName("base")[0];if(d&&d.href&&d.href.length>0)a=d.href;else a=document.URL}var c=a.indexOf("?");if(c!==-1)a=a.substr(0,c);c=a.indexOf("#");if(c!==-1)a=a.substr(0,c);a=a.substr(0,a.lastIndexOf("/")+1);if(!b||b.length===0)return a;if(b.charAt(0)==="/"){var e=a.indexOf("://"),g=a.indexOf("/",e+3);return a.substr(0,g)+b}else{var f=a.lastIndexOf("/");return a.substr(0,f+1)+b}};Sys.Net.WebRequest._createQueryString=function(c,b,f){b=b||encodeURIComponent;var h=0,e,g,d,a=new Sys.StringBuilder;if(c)for(d in c){e=c[d];if(typeof e==="function")continue;g=Sys.Serialization.JavaScriptSerializer.serialize(e);if(h++)a.append("&");a.append(d);a.append("=");a.append(b(g))}if(f){if(h)a.append("&");a.append(f)}return a.toString()};Sys.Net.WebRequest._createUrl=function(a,b,c){if(!b&&!c)return a;var d=Sys.Net.WebRequest._createQueryString(b,null,c);return d.length?a+(a&&a.indexOf("?")>=0?"&":"?")+d:a};Sys.Net.WebRequest.registerClass("Sys.Net.WebRequest");Sys._ScriptLoaderTask=function(b,a){this._scriptElement=b;this._completedCallback=a};Sys._ScriptLoaderTask.prototype={get_scriptElement:function(){return this._scriptElement},dispose:function(){if(this._disposed)return;this._disposed=true;this._removeScriptElementHandlers();Sys._ScriptLoaderTask._clearScript(this._scriptElement);this._scriptElement=null},execute:function(){if(this._ensureReadyStateLoaded())this._executeInternal()},_executeInternal:function(){this._addScriptElementHandlers();document.getElementsByTagName("head")[0].appendChild(this._scriptElement)},_ensureReadyStateLoaded:function(){if(this._useReadyState()&&this._scriptElement.readyState!=="loaded"&&this._scriptElement.readyState!=="complete"){this._scriptDownloadDelegate=Function.createDelegate(this,this._executeInternal);$addHandler(this._scriptElement,"readystatechange",this._scriptDownloadDelegate);return false}return true},_addScriptElementHandlers:function(){if(this._scriptDownloadDelegate){$removeHandler(this._scriptElement,"readystatechange",this._scriptDownloadDelegate);this._scriptDownloadDelegate=null}this._scriptLoadDelegate=Function.createDelegate(this,this._scriptLoadHandler);if(this._useReadyState())$addHandler(this._scriptElement,"readystatechange",this._scriptLoadDelegate);else $addHandler(this._scriptElement,"load",this._scriptLoadDelegate);if(this._scriptElement.addEventListener){this._scriptErrorDelegate=Function.createDelegate(this,this._scriptErrorHandler);this._scriptElement.addEventListener("error",this._scriptErrorDelegate,false)}},_removeScriptElementHandlers:function(){if(this._scriptLoadDelegate){var a=this.get_scriptElement();if(this._scriptDownloadDelegate){$removeHandler(this._scriptElement,"readystatechange",this._scriptDownloadDelegate);this._scriptDownloadDelegate=null}if(this._useReadyState()&&this._scriptLoadDelegate)$removeHandler(a,"readystatechange",this._scriptLoadDelegate);else $removeHandler(a,"load",this._scriptLoadDelegate);if(this._scriptErrorDelegate){this._scriptElement.removeEventListener("error",this._scriptErrorDelegate,false);this._scriptErrorDelegate=null}this._scriptLoadDelegate=null}},_scriptErrorHandler:function(){if(this._disposed)return;this._completedCallback(this.get_scriptElement(),false)},_scriptLoadHandler:function(){if(this._disposed)return;var a=this.get_scriptElement();if(this._useReadyState()&&a.readyState!=="complete")return;this._completedCallback(a,true)},_useReadyState:function(){return Sys.Browser.agent===Sys.Browser.InternetExplorer&&(Sys.Browser.version<9||(document.documentMode||0)<9)}};Sys._ScriptLoaderTask.registerClass("Sys._ScriptLoaderTask",null,Sys.IDisposable);Sys._ScriptLoaderTask._clearScript=function(a){if(!Sys.Debug.isDebug&&a.parentNode)a.parentNode.removeChild(a)};Type.registerNamespace("Sys.Net");Sys.Net.WebServiceProxy=function(){};Sys.Net.WebServiceProxy.prototype={get_timeout:function(){return this._timeout||0},set_timeout:function(a){if(a<0)throw Error.argumentOutOfRange("value",a,Sys.Res.invalidTimeout);this._timeout=a},get_defaultUserContext:function(){return typeof this._userContext==="undefined"?null:this._userContext},set_defaultUserContext:function(a){this._userContext=a},get_defaultSucceededCallback:function(){return this._succeeded||null},set_defaultSucceededCallback:function(a){this._succeeded=a},get_defaultFailedCallback:function(){return this._failed||null},set_defaultFailedCallback:function(a){this._failed=a},get_enableJsonp:function(){return !!this._jsonp},set_enableJsonp:function(a){this._jsonp=a},get_path:function(){return this._path||null},set_path:function(a){this._path=a},get_jsonpCallbackParameter:function(){return this._callbackParameter||"callback"},set_jsonpCallbackParameter:function(a){this._callbackParameter=a},_invoke:function(d,e,g,f,c,b,a){c=c||this.get_defaultSucceededCallback();b=b||this.get_defaultFailedCallback();if(a===null||typeof a==="undefined")a=this.get_defaultUserContext();return Sys.Net.WebServiceProxy.invoke(d,e,g,f,c,b,a,this.get_timeout(),this.get_enableJsonp(),this.get_jsonpCallbackParameter())}};Sys.Net.WebServiceProxy.registerClass("Sys.Net.WebServiceProxy");Sys.Net.WebServiceProxy.invoke=function(q,a,m,l,j,b,g,e,w,p){var i=w!==false?Sys.Net.WebServiceProxy._xdomain.exec(q):null,c,n=i&&i.length===3&&(i[1]!==location.protocol||i[2]!==location.host);m=n||m;if(n){p=p||"callback";c="_jsonp"+Sys._jsonp++}if(!l)l={};var r=l;if(!m||!r)r={};var s,h,f=null,k,o=null,u=Sys.Net.WebRequest._createUrl(a?q+"/"+encodeURIComponent(a):q,r,n?p+"=Sys."+c:null);if(n){s=document.createElement("script");s.src=u;k=new Sys._ScriptLoaderTask(s,function(d,b){if(!b||c)t({Message:String.format(Sys.Res.webServiceFailedNoMsg,a)},-1)});function v(){if(f===null)return;f=null;h=new Sys.Net.WebServiceError(true,String.format(Sys.Res.webServiceTimedOut,a));k.dispose();delete Sys[c];if(b)b(h,g,a)}function t(d,e){if(f!==null){window.clearTimeout(f);f=null}k.dispose();delete Sys[c];c=null;if(typeof e!=="undefined"&&e!==200){if(b){h=new Sys.Net.WebServiceError(false,d.Message||String.format(Sys.Res.webServiceFailedNoMsg,a),d.StackTrace||null,d.ExceptionType||null,d);h._statusCode=e;b(h,g,a)}}else if(j)j(d,g,a)}Sys[c]=t;e=e||Sys.Net.WebRequestManager.get_defaultTimeout();if(e>0)f=window.setTimeout(v,e);k.execute();return null}var d=new Sys.Net.WebRequest;d.set_url(u);d.get_headers()["Content-Type"]="application/json; charset=utf-8";if(!m){o=Sys.Serialization.JavaScriptSerializer.serialize(l);if(o==="{}")o=""}d.set_body(o);d.add_completed(x);if(e&&e>0)d.set_timeout(e);d.invoke();function x(d){if(d.get_responseAvailable()){var f=d.get_statusCode(),c=null;try{var e=d.getResponseHeader("Content-Type");if(e.startsWith("application/json"))c=d.get_object();else if(e.startsWith("text/xml"))c=d.get_xml();else c=d.get_responseData()}catch(m){}var k=d.getResponseHeader("jsonerror"),h=k==="true";if(h){if(c)c=new Sys.Net.WebServiceError(false,c.Message,c.StackTrace,c.ExceptionType,c)}else if(e.startsWith("application/json"))c=!c||typeof c.d==="undefined"?c:c.d;if(f<200||f>=300||h){if(b){if(!c||!h)c=new Sys.Net.WebServiceError(false,String.format(Sys.Res.webServiceFailedNoMsg,a));c._statusCode=f;b(c,g,a)}}else if(j)j(c,g,a)}else{var i;if(d.get_timedOut())i=String.format(Sys.Res.webServiceTimedOut,a);else i=String.format(Sys.Res.webServiceFailedNoMsg,a);if(b)b(new Sys.Net.WebServiceError(d.get_timedOut(),i,"",""),g,a)}}return d};Sys.Net.WebServiceProxy._generateTypedConstructor=function(a){return function(b){if(b)for(var c in b)this[c]=b[c];this.__type=a}};Sys._jsonp=0;Sys.Net.WebServiceProxy._xdomain=/^\s*([a-zA-Z0-9\+\-\.]+\:)\/\/([^?#\/]+)/;Sys.Net.WebServiceError=function(d,e,c,a,b){this._timedOut=d;this._message=e;this._stackTrace=c;this._exceptionType=a;this._errorObject=b;this._statusCode=-1};Sys.Net.WebServiceError.prototype={get_timedOut:function(){return this._timedOut},get_statusCode:function(){return this._statusCode},get_message:function(){return this._message},get_stackTrace:function(){return this._stackTrace||""},get_exceptionType:function(){return this._exceptionType||""},get_errorObject:function(){return this._errorObject||null}};Sys.Net.WebServiceError.registerClass("Sys.Net.WebServiceError"); +Type.registerNamespace('Sys');Sys.Res={ +"argumentInteger":"Value must be an integer.","invokeCalledTwice":"Cannot call invoke more than once.","webServiceFailed":"The server method \u0027{0}\u0027 failed with the following error: {1}","argumentType":"Object cannot be converted to the required type.","argumentNull":"Value cannot be null.","scriptAlreadyLoaded":"The script \u0027{0}\u0027 has been referenced multiple times. If referencing Microsoft AJAX scripts explicitly, set the MicrosoftAjaxMode property of the ScriptManager to Explicit.","scriptDependencyNotFound":"The script \u0027{0}\u0027 failed to load because it is dependent on script \u0027{1}\u0027.","formatBadFormatSpecifier":"Format specifier was invalid.","requiredScriptReferenceNotIncluded":"\u0027{0}\u0027 requires that you have included a script reference to \u0027{1}\u0027.","webServiceFailedNoMsg":"The server method \u0027{0}\u0027 failed.","argumentDomElement":"Value must be a DOM element.","invalidExecutorType":"Could not create a valid Sys.Net.WebRequestExecutor from: {0}.","cannotCallBeforeResponse":"Cannot call {0} when responseAvailable is false.","actualValue":"Actual value was {0}.","enumInvalidValue":"\u0027{0}\u0027 is not a valid value for enum {1}.","scriptLoadFailed":"The script \u0027{0}\u0027 could not be loaded.","parameterCount":"Parameter count mismatch.","cannotDeserializeEmptyString":"Cannot deserialize empty string.","formatInvalidString":"Input string was not in a correct format.","invalidTimeout":"Value must be greater than or equal to zero.","cannotAbortBeforeStart":"Cannot abort when executor has not started.","argument":"Value does not fall within the expected range.","cannotDeserializeInvalidJson":"Cannot deserialize. The data does not correspond to valid JSON.","invalidHttpVerb":"httpVerb cannot be set to an empty or null string.","nullWebRequest":"Cannot call executeRequest with a null webRequest.","eventHandlerInvalid":"Handler was not added through the Sys.UI.DomEvent.addHandler method.","cannotSerializeNonFiniteNumbers":"Cannot serialize non finite numbers.","argumentUndefined":"Value cannot be undefined.","webServiceInvalidReturnType":"The server method \u0027{0}\u0027 returned an invalid type. Expected type: {1}","servicePathNotSet":"The path to the web service has not been set.","argumentTypeWithTypes":"Object of type \u0027{0}\u0027 cannot be converted to type \u0027{1}\u0027.","cannotCallOnceStarted":"Cannot call {0} once started.","badBaseUrl1":"Base URL does not contain ://.","badBaseUrl2":"Base URL does not contain another /.","badBaseUrl3":"Cannot find last / in base URL.","setExecutorAfterActive":"Cannot set executor after it has become active.","paramName":"Parameter name: {0}","nullReferenceInPath":"Null reference while evaluating data path: \u0027{0}\u0027.","cannotCallOutsideHandler":"Cannot call {0} outside of a completed event handler.","cannotSerializeObjectWithCycle":"Cannot serialize object with cyclic reference within child properties.","format":"One of the identified items was in an invalid format.","assertFailedCaller":"Assertion Failed: {0}\r\nat {1}","argumentOutOfRange":"Specified argument was out of the range of valid values.","webServiceTimedOut":"The server method \u0027{0}\u0027 timed out.","notImplemented":"The method or operation is not implemented.","assertFailed":"Assertion Failed: {0}","invalidOperation":"Operation is not valid due to the current state of the object.","breakIntoDebugger":"{0}\r\n\r\nBreak into debugger?"}; +/* END MicrosoftAjax.js */ +/* START MicrosoftAjaxWebForms.js */ +//---------------------------------------------------------- +// Copyright (C) Microsoft Corporation. All rights reserved. +//---------------------------------------------------------- +// MicrosoftAjaxWebForms.js +Type._registerScript("MicrosoftAjaxWebForms.js",["MicrosoftAjaxCore.js","MicrosoftAjaxSerialization.js","MicrosoftAjaxNetwork.js","MicrosoftAjaxComponentModel.js"]);Type.registerNamespace("Sys.WebForms");Sys.WebForms.BeginRequestEventArgs=function(c,b,a){Sys.WebForms.BeginRequestEventArgs.initializeBase(this);this._request=c;this._postBackElement=b;this._updatePanelsToUpdate=a};Sys.WebForms.BeginRequestEventArgs.prototype={get_postBackElement:function(){return this._postBackElement},get_request:function(){return this._request},get_updatePanelsToUpdate:function(){return this._updatePanelsToUpdate?Array.clone(this._updatePanelsToUpdate):[]}};Sys.WebForms.BeginRequestEventArgs.registerClass("Sys.WebForms.BeginRequestEventArgs",Sys.EventArgs);Sys.WebForms.EndRequestEventArgs=function(c,a,b){Sys.WebForms.EndRequestEventArgs.initializeBase(this);this._errorHandled=false;this._error=c;this._dataItems=a||{};this._response=b};Sys.WebForms.EndRequestEventArgs.prototype={get_dataItems:function(){return this._dataItems},get_error:function(){return this._error},get_errorHandled:function(){return this._errorHandled},set_errorHandled:function(a){this._errorHandled=a},get_response:function(){return this._response}};Sys.WebForms.EndRequestEventArgs.registerClass("Sys.WebForms.EndRequestEventArgs",Sys.EventArgs);Sys.WebForms.InitializeRequestEventArgs=function(c,b,a){Sys.WebForms.InitializeRequestEventArgs.initializeBase(this);this._request=c;this._postBackElement=b;this._updatePanelsToUpdate=a};Sys.WebForms.InitializeRequestEventArgs.prototype={get_postBackElement:function(){return this._postBackElement},get_request:function(){return this._request},get_updatePanelsToUpdate:function(){return this._updatePanelsToUpdate?Array.clone(this._updatePanelsToUpdate):[]},set_updatePanelsToUpdate:function(a){this._updated=true;this._updatePanelsToUpdate=a}};Sys.WebForms.InitializeRequestEventArgs.registerClass("Sys.WebForms.InitializeRequestEventArgs",Sys.CancelEventArgs);Sys.WebForms.PageLoadedEventArgs=function(b,a,c){Sys.WebForms.PageLoadedEventArgs.initializeBase(this);this._panelsUpdated=b;this._panelsCreated=a;this._dataItems=c||{}};Sys.WebForms.PageLoadedEventArgs.prototype={get_dataItems:function(){return this._dataItems},get_panelsCreated:function(){return this._panelsCreated},get_panelsUpdated:function(){return this._panelsUpdated}};Sys.WebForms.PageLoadedEventArgs.registerClass("Sys.WebForms.PageLoadedEventArgs",Sys.EventArgs);Sys.WebForms.PageLoadingEventArgs=function(b,a,c){Sys.WebForms.PageLoadingEventArgs.initializeBase(this);this._panelsUpdating=b;this._panelsDeleting=a;this._dataItems=c||{}};Sys.WebForms.PageLoadingEventArgs.prototype={get_dataItems:function(){return this._dataItems},get_panelsDeleting:function(){return this._panelsDeleting},get_panelsUpdating:function(){return this._panelsUpdating}};Sys.WebForms.PageLoadingEventArgs.registerClass("Sys.WebForms.PageLoadingEventArgs",Sys.EventArgs);Sys._ScriptLoader=function(){this._scriptsToLoad=null;this._sessions=[];this._scriptLoadedDelegate=Function.createDelegate(this,this._scriptLoadedHandler)};Sys._ScriptLoader.prototype={dispose:function(){this._stopSession();this._loading=false;if(this._events)delete this._events;this._sessions=null;this._currentSession=null;this._scriptLoadedDelegate=null},loadScripts:function(d,b,c,a){var e={allScriptsLoadedCallback:b,scriptLoadFailedCallback:c,scriptLoadTimeoutCallback:a,scriptsToLoad:this._scriptsToLoad,scriptTimeout:d};this._scriptsToLoad=null;this._sessions[this._sessions.length]=e;if(!this._loading)this._nextSession()},queueCustomScriptTag:function(a){if(!this._scriptsToLoad)this._scriptsToLoad=[];Array.add(this._scriptsToLoad,a)},queueScriptBlock:function(a){if(!this._scriptsToLoad)this._scriptsToLoad=[];Array.add(this._scriptsToLoad,{text:a})},queueScriptReference:function(a,b){if(!this._scriptsToLoad)this._scriptsToLoad=[];Array.add(this._scriptsToLoad,{src:a,fallback:b})},_createScriptElement:function(c){var a=document.createElement("script");a.type="text/javascript";for(var b in c)a[b]=c[b];return a},_loadScriptsInternal:function(){var c=this._currentSession;if(c.scriptsToLoad&&c.scriptsToLoad.length>0){var b=Array.dequeue(c.scriptsToLoad),f=this._scriptLoadedDelegate;if(b.fallback){var g=b.fallback;delete b.fallback;var d=this;f=function(b,a){a||function(){var a=d._createScriptElement({src:g});d._currentTask=new Sys._ScriptLoaderTask(a,d._scriptLoadedDelegate);d._currentTask.execute()}()}}var a=this._createScriptElement(b);if(a.text&&Sys.Browser.agent===Sys.Browser.Safari){a.innerHTML=a.text;delete a.text}if(typeof b.src==="string"){this._currentTask=new Sys._ScriptLoaderTask(a,f);this._currentTask.execute()}else{document.getElementsByTagName("head")[0].appendChild(a);Sys._ScriptLoaderTask._clearScript(a);this._loadScriptsInternal()}}else{this._stopSession();var e=c.allScriptsLoadedCallback;if(e)e(this);this._nextSession()}},_nextSession:function(){if(this._sessions.length===0){this._loading=false;this._currentSession=null;return}this._loading=true;var a=Array.dequeue(this._sessions);this._currentSession=a;if(a.scriptTimeout>0)this._timeoutCookie=window.setTimeout(Function.createDelegate(this,this._scriptLoadTimeoutHandler),a.scriptTimeout*1000);this._loadScriptsInternal()},_raiseError:function(){var b=this._currentSession.scriptLoadFailedCallback,a=this._currentTask.get_scriptElement();this._stopSession();if(b){b(this,a);this._nextSession()}else{this._loading=false;throw Sys._ScriptLoader._errorScriptLoadFailed(a.src)}},_scriptLoadedHandler:function(a,b){if(b){Array.add(Sys._ScriptLoader._getLoadedScripts(),a.src);this._currentTask.dispose();this._currentTask=null;this._loadScriptsInternal()}else this._raiseError()},_scriptLoadTimeoutHandler:function(){var a=this._currentSession.scriptLoadTimeoutCallback;this._stopSession();if(a)a(this);this._nextSession()},_stopSession:function(){if(this._timeoutCookie){window.clearTimeout(this._timeoutCookie);this._timeoutCookie=null}if(this._currentTask){this._currentTask.dispose();this._currentTask=null}}};Sys._ScriptLoader.registerClass("Sys._ScriptLoader",null,Sys.IDisposable);Sys._ScriptLoader.getInstance=function(){var a=Sys._ScriptLoader._activeInstance;if(!a)a=Sys._ScriptLoader._activeInstance=new Sys._ScriptLoader;return a};Sys._ScriptLoader.isScriptLoaded=function(b){var a=document.createElement("script");a.src=b;return Array.contains(Sys._ScriptLoader._getLoadedScripts(),a.src)};Sys._ScriptLoader.readLoadedScripts=function(){if(!Sys._ScriptLoader._referencedScripts){var c=Sys._ScriptLoader._referencedScripts=[],d=document.getElementsByTagName("script");for(var b=d.length-1;b>=0;b--){var e=d[b],a=e.src;if(a.length)if(!Array.contains(c,a))Array.add(c,a)}}};Sys._ScriptLoader._errorScriptLoadFailed=function(b){var a;a=Sys.Res.scriptLoadFailed;var d="Sys.ScriptLoadFailedException: "+String.format(a,b),c=Error.create(d,{name:"Sys.ScriptLoadFailedException","scriptUrl":b});c.popStackFrame();return c};Sys._ScriptLoader._getLoadedScripts=function(){if(!Sys._ScriptLoader._referencedScripts){Sys._ScriptLoader._referencedScripts=[];Sys._ScriptLoader.readLoadedScripts()}return Sys._ScriptLoader._referencedScripts};Sys.WebForms.PageRequestManager=function(){this._form=null;this._activeDefaultButton=null;this._activeDefaultButtonClicked=false;this._updatePanelIDs=null;this._updatePanelClientIDs=null;this._updatePanelHasChildrenAsTriggers=null;this._asyncPostBackControlIDs=null;this._asyncPostBackControlClientIDs=null;this._postBackControlIDs=null;this._postBackControlClientIDs=null;this._scriptManagerID=null;this._pageLoadedHandler=null;this._additionalInput=null;this._onsubmit=null;this._onSubmitStatements=[];this._originalDoPostBack=null;this._originalDoPostBackWithOptions=null;this._originalFireDefaultButton=null;this._originalDoCallback=null;this._isCrossPost=false;this._postBackSettings=null;this._request=null;this._onFormSubmitHandler=null;this._onFormElementClickHandler=null;this._onWindowUnloadHandler=null;this._asyncPostBackTimeout=null;this._controlIDToFocus=null;this._scrollPosition=null;this._processingRequest=false;this._scriptDisposes={};this._transientFields=["__VIEWSTATEENCRYPTED","__VIEWSTATEFIELDCOUNT"];this._textTypes=/^(text|password|hidden|search|tel|url|email|number|range|color|datetime|date|month|week|time|datetime-local)$/i};Sys.WebForms.PageRequestManager.prototype={_get_eventHandlerList:function(){if(!this._events)this._events=new Sys.EventHandlerList;return this._events},get_isInAsyncPostBack:function(){return this._request!==null},add_beginRequest:function(a){this._get_eventHandlerList().addHandler("beginRequest",a)},remove_beginRequest:function(a){this._get_eventHandlerList().removeHandler("beginRequest",a)},add_endRequest:function(a){this._get_eventHandlerList().addHandler("endRequest",a)},remove_endRequest:function(a){this._get_eventHandlerList().removeHandler("endRequest",a)},add_initializeRequest:function(a){this._get_eventHandlerList().addHandler("initializeRequest",a)},remove_initializeRequest:function(a){this._get_eventHandlerList().removeHandler("initializeRequest",a)},add_pageLoaded:function(a){this._get_eventHandlerList().addHandler("pageLoaded",a)},remove_pageLoaded:function(a){this._get_eventHandlerList().removeHandler("pageLoaded",a)},add_pageLoading:function(a){this._get_eventHandlerList().addHandler("pageLoading",a)},remove_pageLoading:function(a){this._get_eventHandlerList().removeHandler("pageLoading",a)},abortPostBack:function(){if(!this._processingRequest&&this._request){this._request.get_executor().abort();this._request=null}},beginAsyncPostBack:function(c,a,f,d,e){if(d&&typeof Page_ClientValidate==="function"&&!Page_ClientValidate(e||null))return;this._postBackSettings=this._createPostBackSettings(true,c,a);var b=this._form;b.__EVENTTARGET.value=a||"";b.__EVENTARGUMENT.value=f||"";this._isCrossPost=false;this._additionalInput=null;this._onFormSubmit()},_cancelPendingCallbacks:function(){for(var a=0,e=window.__pendingCallbacks.length;a0)theForm.action=a.actionUrl;if(a.trackFocus){var c=theForm.elements["__LASTFOCUS"];if(typeof c!="undefined"&&c!=null)if(typeof document.activeElement=="undefined")c.value=a.eventTarget;else{var b=document.activeElement;if(typeof b!="undefined"&&b!=null)if(typeof b.id!="undefined"&&b.id!=null&&b.id.length>0)c.value=b.id;else if(typeof b.name!="undefined")c.value=b.name}}}if(a.clientSubmit)this._doPostBack(a.eventTarget,a.eventArgument)},_elementContains:function(b,a){while(a){if(a===b)return true;a=a.parentNode}return false},_endPostBack:function(a,d,f){if(this._request===d.get_webRequest()){this._processingRequest=false;this._additionalInput=null;this._request=null}var e=this._get_eventHandlerList().getHandler("endRequest"),b=false;if(e){var c=new Sys.WebForms.EndRequestEventArgs(a,f?f.dataItems:{},d);e(this,c);b=c.get_errorHandled()}if(a&&!b)throw a},_ensureUniqueIds:function(a){if(!a)return a;a=a instanceof Array?a:[a];var c=[];for(var b=0,f=a.length;b-1?this._updatePanelIDs[d]:e)}return c},_findNearestElement:function(a){while(a.length>0){var d=this._uniqueIDToClientID(a),c=document.getElementById(d);if(c)return c;var b=a.lastIndexOf("$");if(b===-1)return null;a=a.substring(0,b)}return null},_findText:function(b,a){var c=Math.max(0,a-20),d=Math.min(b.length,a+20);return b.substring(c,d)},_fireDefaultButton:function(a,d){if(a.keyCode===13){var c=a.srcElement||a.target;if(!c||c.tagName.toLowerCase()!=="textarea"){var b=document.getElementById(d);if(b&&typeof b.click!=="undefined"){this._activeDefaultButton=b;this._activeDefaultButtonClicked=false;try{b.click()}finally{this._activeDefaultButton=null}a.cancelBubble=true;if(typeof a.stopPropagation==="function")a.stopPropagation();return false}}}return true},_getPageLoadedEventArgs:function(n,c){var m=[],l=[],k=c?c.version4:false,d=c?c.updatePanelData:null,e,g,h,b;if(!d){e=this._updatePanelIDs;g=this._updatePanelClientIDs;h=null;b=null}else{e=d.updatePanelIDs;g=d.updatePanelClientIDs;h=d.childUpdatePanelIDs;b=d.panelsToRefreshIDs}var a,f,j,i;if(b)for(a=0,f=b.length;a-1))Array.add(i,document.getElementById(l[a]))}return new Sys.WebForms.PageLoadingEventArgs(j,i,f.dataItems)},_getPostBackSettings:function(a,c){var d=a,b=null;while(a){if(a.id){if(!b&&Array.contains(this._asyncPostBackControlClientIDs,a.id))b=this._createPostBackSettings(true,null,c,d);else if(!b&&Array.contains(this._postBackControlClientIDs,a.id))return this._createPostBackSettings(false);else{var e=Array.indexOf(this._updatePanelClientIDs,a.id);if(e!==-1)if(this._updatePanelHasChildrenAsTriggers[e])return this._createPostBackSettings(true,[this._updatePanelIDs[e]],c,d);else return this._createPostBackSettings(true,null,c,d)}if(!b&&this._matchesParentIDInList(a.id,this._asyncPostBackControlClientIDs))b=this._createPostBackSettings(true,null,c,d);else if(!b&&this._matchesParentIDInList(a.id,this._postBackControlClientIDs))return this._createPostBackSettings(false)}a=a.parentNode}if(!b)return this._createPostBackSettings(false);else return b},_getScrollPosition:function(){var a=document.documentElement;if(a&&(this._validPosition(a.scrollLeft)||this._validPosition(a.scrollTop)))return {x:a.scrollLeft,y:a.scrollTop};else{a=document.body;if(a&&(this._validPosition(a.scrollLeft)||this._validPosition(a.scrollTop)))return {x:a.scrollLeft,y:a.scrollTop};else if(this._validPosition(window.pageXOffset)||this._validPosition(window.pageYOffset))return {x:window.pageXOffset,y:window.pageYOffset};else return {x:0,y:0}}},_initializeInternal:function(f,g,a,b,e,c,d){if(this._prmInitialized)throw Error.invalidOperation(Sys.WebForms.Res.PRM_CannotRegisterTwice);this._prmInitialized=true;this._masterPageUniqueID=d;this._scriptManagerID=f;this._form=Sys.UI.DomElement.resolveElement(g);this._onsubmit=this._form.onsubmit;this._form.onsubmit=null;this._onFormSubmitHandler=Function.createDelegate(this,this._onFormSubmit);this._onFormElementClickHandler=Function.createDelegate(this,this._onFormElementClick);this._onWindowUnloadHandler=Function.createDelegate(this,this._onWindowUnload);Sys.UI.DomEvent.addHandler(this._form,"submit",this._onFormSubmitHandler);Sys.UI.DomEvent.addHandler(this._form,"click",this._onFormElementClickHandler);Sys.UI.DomEvent.addHandler(window,"unload",this._onWindowUnloadHandler);this._originalDoPostBack=window.__doPostBack;if(this._originalDoPostBack)window.__doPostBack=Function.createDelegate(this,this._doPostBack);this._originalDoPostBackWithOptions=window.WebForm_DoPostBackWithOptions;if(this._originalDoPostBackWithOptions)window.WebForm_DoPostBackWithOptions=Function.createDelegate(this,this._doPostBackWithOptions);this._originalFireDefaultButton=window.WebForm_FireDefaultButton;if(this._originalFireDefaultButton)window.WebForm_FireDefaultButton=Function.createDelegate(this,this._fireDefaultButton);this._originalDoCallback=window.WebForm_DoCallback;if(this._originalDoCallback)window.WebForm_DoCallback=Function.createDelegate(this,this._doCallback);this._pageLoadedHandler=Function.createDelegate(this,this._pageLoadedInitialLoad);Sys.UI.DomEvent.addHandler(window,"load",this._pageLoadedHandler);if(a)this._updateControls(a,b,e,c,true)},_matchesParentIDInList:function(c,b){for(var a=0,d=b.length;a=c.length){e=this._findText(c,c.length);break}D=c.substr(b,i);b+=i;if(c.charAt(b)!=="|"){e=this._findText(c,b);break}b++;Array.add(k,{type:E,id:F,content:D})}if(e){this._endPostBack(this._createPageRequestManagerParserError(String.format(Sys.WebForms.Res.PRM_ParserErrorDetails,e)),h,null);return null}var x=[],w=[],q=[],j=[],t=[],C=[],A=[],z=[],v=[],s=[],m,p,u,n,o,r,y,g;for(var l=0,G=k.length;l=4)a.content=unescape(a.content);if(Sys.Browser.agent===Sys.Browser.InternetExplorer){var f=document.createElement("a");f.style.display="none";f.attachEvent("onclick",B);f.href=a.content;this._form.parentNode.insertBefore(f,this._form);f.click();f.detachEvent("onclick",B);this._form.parentNode.removeChild(f);function B(a){a.cancelBubble=true}}else window.location.href=a.content;return null;case "error":this._endPostBack(this._createPageRequestManagerServerError(Number.parseInvariant(a.id),a.content),h,null);return null;case "pageTitle":document.title=a.content;break;case "focus":this._controlIDToFocus=a.content;break;default:this._endPostBack(this._createPageRequestManagerParserError(String.format(Sys.WebForms.Res.PRM_UnknownToken,a.type)),h,null);return null}}return {version4:g?parseFloat(g.content)>=4:false,executor:h,updatePanelNodes:x,hiddenFieldNodes:w,arrayDeclarationNodes:q,scriptBlockNodes:j,scriptStartupNodes:t,expandoNodes:C,onSubmitNodes:A,dataItemNodes:z,dataItemJsonNodes:v,scriptDisposeNodes:s,asyncPostBackControlIDsNode:m,postBackControlIDsNode:p,updatePanelIDsNode:u,asyncPostBackTimeoutNode:n,childUpdatePanelIDsNode:o,panelsToRefreshNode:r,formActionNode:y}},_processUpdatePanelArrays:function(e,q,r,f){var d,c,b;if(e){var i=e.length,j=f?2:1;d=new Array(i/j);c=new Array(i/j);b=new Array(i/j);for(var g=0,h=0;g 0)) { - theForm.action = options.actionUrl; - } - if (options.trackFocus) { - var lastFocus = theForm.elements["__LASTFOCUS"]; - if ((typeof(lastFocus) != "undefined") && (lastFocus != null)) { - if (typeof(document.activeElement) == "undefined") { - lastFocus.value = options.eventTarget; - } - else { - var active = document.activeElement; - if ((typeof(active) != "undefined") && (active != null)) { - if ((typeof(active.id) != "undefined") && (active.id != null) && (active.id.length > 0)) { - lastFocus.value = active.id; - } - else if (typeof(active.name) != "undefined") { - lastFocus.value = active.name; - } - } - } - } - } - } - if (options.clientSubmit) { - __doPostBack(options.eventTarget, options.eventArgument); - } -} -var __pendingCallbacks = new Array(); -var __synchronousCallBackIndex = -1; -function WebForm_DoCallback(eventTarget, eventArgument, eventCallback, context, errorCallback, useAsync) { - var postData = __theFormPostData + - "__CALLBACKID=" + WebForm_EncodeCallback(eventTarget) + - "&__CALLBACKPARAM=" + WebForm_EncodeCallback(eventArgument); - if (theForm["__EVENTVALIDATION"]) { - postData += "&__EVENTVALIDATION=" + WebForm_EncodeCallback(theForm["__EVENTVALIDATION"].value); - } - var xmlRequest,e; - try { - xmlRequest = new XMLHttpRequest(); - } - catch(e) { - try { - xmlRequest = new ActiveXObject("Microsoft.XMLHTTP"); - } - catch(e) { - } - } - var setRequestHeaderMethodExists = true; - try { - setRequestHeaderMethodExists = (xmlRequest && xmlRequest.setRequestHeader); - } - catch(e) {} - var callback = new Object(); - callback.eventCallback = eventCallback; - callback.context = context; - callback.errorCallback = errorCallback; - callback.async = useAsync; - var callbackIndex = WebForm_FillFirstAvailableSlot(__pendingCallbacks, callback); - if (!useAsync) { - if (__synchronousCallBackIndex != -1) { - __pendingCallbacks[__synchronousCallBackIndex] = null; - } - __synchronousCallBackIndex = callbackIndex; - } - if (setRequestHeaderMethodExists) { - xmlRequest.onreadystatechange = WebForm_CallbackComplete; - callback.xmlRequest = xmlRequest; - // e.g. http: - var action = theForm.action || document.location.pathname, fragmentIndex = action.indexOf('#'); - if (fragmentIndex !== -1) { - action = action.substr(0, fragmentIndex); - } - if (!__nonMSDOMBrowser) { - var queryIndex = action.indexOf('?'); - if (queryIndex !== -1) { - var path = action.substr(0, queryIndex); - if (path.indexOf("%") === -1) { - action = encodeURI(path) + action.substr(queryIndex); - } - } - else if (action.indexOf("%") === -1) { - action = encodeURI(action); - } - } - xmlRequest.open("POST", action, true); - xmlRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8"); - xmlRequest.send(postData); - return; - } - callback.xmlRequest = new Object(); - var callbackFrameID = "__CALLBACKFRAME" + callbackIndex; - var xmlRequestFrame = document.frames[callbackFrameID]; - if (!xmlRequestFrame) { - xmlRequestFrame = document.createElement("IFRAME"); - xmlRequestFrame.width = "1"; - xmlRequestFrame.height = "1"; - xmlRequestFrame.frameBorder = "0"; - xmlRequestFrame.id = callbackFrameID; - xmlRequestFrame.name = callbackFrameID; - xmlRequestFrame.style.position = "absolute"; - xmlRequestFrame.style.top = "-100px" - xmlRequestFrame.style.left = "-100px"; - try { - if (callBackFrameUrl) { - xmlRequestFrame.src = callBackFrameUrl; - } - } - catch(e) {} - document.body.appendChild(xmlRequestFrame); - } - var interval = window.setInterval(function() { - xmlRequestFrame = document.frames[callbackFrameID]; - if (xmlRequestFrame && xmlRequestFrame.document) { - window.clearInterval(interval); - xmlRequestFrame.document.write(""); - xmlRequestFrame.document.close(); - xmlRequestFrame.document.write('
      '); - xmlRequestFrame.document.close(); - xmlRequestFrame.document.forms[0].action = theForm.action; - var count = __theFormPostCollection.length; - var element; - for (var i = 0; i < count; i++) { - element = __theFormPostCollection[i]; - if (element) { - var fieldElement = xmlRequestFrame.document.createElement("INPUT"); - fieldElement.type = "hidden"; - fieldElement.name = element.name; - fieldElement.value = element.value; - xmlRequestFrame.document.forms[0].appendChild(fieldElement); - } - } - var callbackIdFieldElement = xmlRequestFrame.document.createElement("INPUT"); - callbackIdFieldElement.type = "hidden"; - callbackIdFieldElement.name = "__CALLBACKID"; - callbackIdFieldElement.value = eventTarget; - xmlRequestFrame.document.forms[0].appendChild(callbackIdFieldElement); - var callbackParamFieldElement = xmlRequestFrame.document.createElement("INPUT"); - callbackParamFieldElement.type = "hidden"; - callbackParamFieldElement.name = "__CALLBACKPARAM"; - callbackParamFieldElement.value = eventArgument; - xmlRequestFrame.document.forms[0].appendChild(callbackParamFieldElement); - if (theForm["__EVENTVALIDATION"]) { - var callbackValidationFieldElement = xmlRequestFrame.document.createElement("INPUT"); - callbackValidationFieldElement.type = "hidden"; - callbackValidationFieldElement.name = "__EVENTVALIDATION"; - callbackValidationFieldElement.value = theForm["__EVENTVALIDATION"].value; - xmlRequestFrame.document.forms[0].appendChild(callbackValidationFieldElement); - } - var callbackIndexFieldElement = xmlRequestFrame.document.createElement("INPUT"); - callbackIndexFieldElement.type = "hidden"; - callbackIndexFieldElement.name = "__CALLBACKINDEX"; - callbackIndexFieldElement.value = callbackIndex; - xmlRequestFrame.document.forms[0].appendChild(callbackIndexFieldElement); - xmlRequestFrame.document.forms[0].submit(); - } - }, 10); -} -function WebForm_CallbackComplete() { - for (var i = 0; i < __pendingCallbacks.length; i++) { - callbackObject = __pendingCallbacks[i]; - if (callbackObject && callbackObject.xmlRequest && (callbackObject.xmlRequest.readyState == 4)) { - if (!__pendingCallbacks[i].async) { - __synchronousCallBackIndex = -1; - } - __pendingCallbacks[i] = null; - var callbackFrameID = "__CALLBACKFRAME" + i; - var xmlRequestFrame = document.getElementById(callbackFrameID); - if (xmlRequestFrame) { - xmlRequestFrame.parentNode.removeChild(xmlRequestFrame); - } - WebForm_ExecuteCallback(callbackObject); - } - } -} -function WebForm_ExecuteCallback(callbackObject) { - var response = callbackObject.xmlRequest.responseText; - if (response.charAt(0) == "s") { - if ((typeof(callbackObject.eventCallback) != "undefined") && (callbackObject.eventCallback != null)) { - callbackObject.eventCallback(response.substring(1), callbackObject.context); - } - } - else if (response.charAt(0) == "e") { - if ((typeof(callbackObject.errorCallback) != "undefined") && (callbackObject.errorCallback != null)) { - callbackObject.errorCallback(response.substring(1), callbackObject.context); - } - } - else { - var separatorIndex = response.indexOf("|"); - if (separatorIndex != -1) { - var validationFieldLength = parseInt(response.substring(0, separatorIndex)); - if (!isNaN(validationFieldLength)) { - var validationField = response.substring(separatorIndex + 1, separatorIndex + validationFieldLength + 1); - if (validationField != "") { - var validationFieldElement = theForm["__EVENTVALIDATION"]; - if (!validationFieldElement) { - validationFieldElement = document.createElement("INPUT"); - validationFieldElement.type = "hidden"; - validationFieldElement.name = "__EVENTVALIDATION"; - theForm.appendChild(validationFieldElement); - } - validationFieldElement.value = validationField; - } - if ((typeof(callbackObject.eventCallback) != "undefined") && (callbackObject.eventCallback != null)) { - callbackObject.eventCallback(response.substring(separatorIndex + validationFieldLength + 1), callbackObject.context); - } - } - } - } -} -function WebForm_FillFirstAvailableSlot(array, element) { - var i; - for (i = 0; i < array.length; i++) { - if (!array[i]) break; - } - array[i] = element; - return i; -} -var __nonMSDOMBrowser = (window.navigator.appName.toLowerCase().indexOf('explorer') == -1); -var __theFormPostData = ""; -var __theFormPostCollection = new Array(); -var __callbackTextTypes = /^(text|password|hidden|search|tel|url|email|number|range|color|datetime|date|month|week|time|datetime-local)$/i; -function WebForm_InitCallback() { - var formElements = theForm.elements, - count = formElements.length, - element; - for (var i = 0; i < count; i++) { - element = formElements[i]; - var tagName = element.tagName.toLowerCase(); - if (tagName == "input") { - var type = element.type; - if ((__callbackTextTypes.test(type) || ((type == "checkbox" || type == "radio") && element.checked)) - && (element.id != "__EVENTVALIDATION")) { - WebForm_InitCallbackAddField(element.name, element.value); - } - } - else if (tagName == "select") { - var selectCount = element.options.length; - for (var j = 0; j < selectCount; j++) { - var selectChild = element.options[j]; - if (selectChild.selected == true) { - WebForm_InitCallbackAddField(element.name, element.value); - } - } - } - else if (tagName == "textarea") { - WebForm_InitCallbackAddField(element.name, element.value); - } - } -} -function WebForm_InitCallbackAddField(name, value) { - var nameValue = new Object(); - nameValue.name = name; - nameValue.value = value; - __theFormPostCollection[__theFormPostCollection.length] = nameValue; - __theFormPostData += WebForm_EncodeCallback(name) + "=" + WebForm_EncodeCallback(value) + "&"; -} -function WebForm_EncodeCallback(parameter) { - if (encodeURIComponent) { - return encodeURIComponent(parameter); - } - else { - return escape(parameter); - } -} -var __disabledControlArray = new Array(); -function WebForm_ReEnableControls() { - if (typeof(__enabledControlArray) == 'undefined') { - return false; - } - var disabledIndex = 0; - for (var i = 0; i < __enabledControlArray.length; i++) { - var c; - if (__nonMSDOMBrowser) { - c = document.getElementById(__enabledControlArray[i]); - } - else { - c = document.all[__enabledControlArray[i]]; - } - if ((typeof(c) != "undefined") && (c != null) && (c.disabled == true)) { - c.disabled = false; - __disabledControlArray[disabledIndex++] = c; - } - } - setTimeout("WebForm_ReDisableControls()", 0); - return true; -} -function WebForm_ReDisableControls() { - for (var i = 0; i < __disabledControlArray.length; i++) { - __disabledControlArray[i].disabled = true; - } -} -function WebForm_SimulateClick(element, event) { - var clickEvent; - if (element) { - if (element.click) { - element.click(); - } else { - clickEvent = document.createEvent("MouseEvents"); - clickEvent.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); - if (!element.dispatchEvent(clickEvent)) { - return true; - } - } - event.cancelBubble = true; - if (event.stopPropagation) { - event.stopPropagation(); - } - return false; - } - return true; -} -function WebForm_FireDefaultButton(event, target) { - if (event.keyCode == 13) { - var src = event.srcElement || event.target; - if (src && - ((src.tagName.toLowerCase() == "input") && - (src.type.toLowerCase() == "submit" || src.type.toLowerCase() == "button")) || - ((src.tagName.toLowerCase() == "a") && - (src.href != null) && (src.href != "")) || - (src.tagName.toLowerCase() == "textarea")) { - return true; - } - var defaultButton; - if (__nonMSDOMBrowser) { - defaultButton = document.getElementById(target); - } - else { - defaultButton = document.all[target]; - } - if (defaultButton) { - return WebForm_SimulateClick(defaultButton, event); - } - } - return true; -} -function WebForm_GetScrollX() { - if (__nonMSDOMBrowser) { - return window.pageXOffset; - } - else { - if (document.documentElement && document.documentElement.scrollLeft) { - return document.documentElement.scrollLeft; - } - else if (document.body) { - return document.body.scrollLeft; - } - } - return 0; -} -function WebForm_GetScrollY() { - if (__nonMSDOMBrowser) { - return window.pageYOffset; - } - else { - if (document.documentElement && document.documentElement.scrollTop) { - return document.documentElement.scrollTop; - } - else if (document.body) { - return document.body.scrollTop; - } - } - return 0; -} -function WebForm_SaveScrollPositionSubmit() { - if (__nonMSDOMBrowser) { - theForm.elements['__SCROLLPOSITIONY'].value = window.pageYOffset; - theForm.elements['__SCROLLPOSITIONX'].value = window.pageXOffset; - } - else { - theForm.__SCROLLPOSITIONX.value = WebForm_GetScrollX(); - theForm.__SCROLLPOSITIONY.value = WebForm_GetScrollY(); - } - if ((typeof(this.oldSubmit) != "undefined") && (this.oldSubmit != null)) { - return this.oldSubmit(); - } - return true; -} -function WebForm_SaveScrollPositionOnSubmit() { - theForm.__SCROLLPOSITIONX.value = WebForm_GetScrollX(); - theForm.__SCROLLPOSITIONY.value = WebForm_GetScrollY(); - if ((typeof(this.oldOnSubmit) != "undefined") && (this.oldOnSubmit != null)) { - return this.oldOnSubmit(); - } - return true; -} -function WebForm_RestoreScrollPosition() { - if (__nonMSDOMBrowser) { - window.scrollTo(theForm.elements['__SCROLLPOSITIONX'].value, theForm.elements['__SCROLLPOSITIONY'].value); - } - else { - window.scrollTo(theForm.__SCROLLPOSITIONX.value, theForm.__SCROLLPOSITIONY.value); - } - if ((typeof(theForm.oldOnLoad) != "undefined") && (theForm.oldOnLoad != null)) { - return theForm.oldOnLoad(); - } - return true; -} -function WebForm_TextBoxKeyHandler(event) { - if (event.keyCode == 13) { - var target; - if (__nonMSDOMBrowser) { - target = event.target; - } - else { - target = event.srcElement; - } - if ((typeof(target) != "undefined") && (target != null)) { - if (typeof(target.onchange) != "undefined") { - target.onchange(); - event.cancelBubble = true; - if (event.stopPropagation) event.stopPropagation(); - return false; - } - } - } - return true; -} -function WebForm_TrimString(value) { - return value.replace(/^\s+|\s+$/g, '') -} -function WebForm_AppendToClassName(element, className) { - var currentClassName = ' ' + WebForm_TrimString(element.className) + ' '; - className = WebForm_TrimString(className); - var index = currentClassName.indexOf(' ' + className + ' '); - if (index === -1) { - element.className = (element.className === '') ? className : element.className + ' ' + className; - } -} -function WebForm_RemoveClassName(element, className) { - var currentClassName = ' ' + WebForm_TrimString(element.className) + ' '; - className = WebForm_TrimString(className); - var index = currentClassName.indexOf(' ' + className + ' '); - if (index >= 0) { - element.className = WebForm_TrimString(currentClassName.substring(0, index) + ' ' + - currentClassName.substring(index + className.length + 1, currentClassName.length)); - } -} -function WebForm_GetElementById(elementId) { - if (document.getElementById) { - return document.getElementById(elementId); - } - else if (document.all) { - return document.all[elementId]; - } - else return null; -} -function WebForm_GetElementByTagName(element, tagName) { - var elements = WebForm_GetElementsByTagName(element, tagName); - if (elements && elements.length > 0) { - return elements[0]; - } - else return null; -} -function WebForm_GetElementsByTagName(element, tagName) { - if (element && tagName) { - if (element.getElementsByTagName) { - return element.getElementsByTagName(tagName); - } - if (element.all && element.all.tags) { - return element.all.tags(tagName); - } - } - return null; -} -function WebForm_GetElementDir(element) { - if (element) { - if (element.dir) { - return element.dir; - } - return WebForm_GetElementDir(element.parentNode); - } - return "ltr"; -} -function WebForm_GetElementPosition(element) { - var result = new Object(); - result.x = 0; - result.y = 0; - result.width = 0; - result.height = 0; - if (element.offsetParent) { - result.x = element.offsetLeft; - result.y = element.offsetTop; - var parent = element.offsetParent; - while (parent) { - result.x += parent.offsetLeft; - result.y += parent.offsetTop; - var parentTagName = parent.tagName.toLowerCase(); - if (parentTagName != "table" && - parentTagName != "body" && - parentTagName != "html" && - parentTagName != "div" && - parent.clientTop && - parent.clientLeft) { - result.x += parent.clientLeft; - result.y += parent.clientTop; - } - parent = parent.offsetParent; - } - } - else if (element.left && element.top) { - result.x = element.left; - result.y = element.top; - } - else { - if (element.x) { - result.x = element.x; - } - if (element.y) { - result.y = element.y; - } - } - if (element.offsetWidth && element.offsetHeight) { - result.width = element.offsetWidth; - result.height = element.offsetHeight; - } - else if (element.style && element.style.pixelWidth && element.style.pixelHeight) { - result.width = element.style.pixelWidth; - result.height = element.style.pixelHeight; - } - return result; -} -function WebForm_GetParentByTagName(element, tagName) { - var parent = element.parentNode; - var upperTagName = tagName.toUpperCase(); - while (parent && (parent.tagName.toUpperCase() != upperTagName)) { - parent = parent.parentNode ? parent.parentNode : parent.parentElement; - } - return parent; -} -function WebForm_SetElementHeight(element, height) { - if (element && element.style) { - element.style.height = height + "px"; - } -} -function WebForm_SetElementWidth(element, width) { - if (element && element.style) { - element.style.width = width + "px"; - } -} -function WebForm_SetElementX(element, x) { - if (element && element.style) { - element.style.left = x + "px"; - } -} -function WebForm_SetElementY(element, y) { - if (element && element.style) { - element.style.top = y + "px"; - } +function WebForm_PostBackOptions(eventTarget, eventArgument, validation, validationGroup, actionUrl, trackFocus, clientSubmit) { + this.eventTarget = eventTarget; + this.eventArgument = eventArgument; + this.validation = validation; + this.validationGroup = validationGroup; + this.actionUrl = actionUrl; + this.trackFocus = trackFocus; + this.clientSubmit = clientSubmit; +} +function WebForm_DoPostBackWithOptions(options) { + var validationResult = true; + if (options.validation) { + if (typeof(Page_ClientValidate) == 'function') { + validationResult = Page_ClientValidate(options.validationGroup); + } + } + if (validationResult) { + if ((typeof(options.actionUrl) != "undefined") && (options.actionUrl != null) && (options.actionUrl.length > 0)) { + theForm.action = options.actionUrl; + } + if (options.trackFocus) { + var lastFocus = theForm.elements["__LASTFOCUS"]; + if ((typeof(lastFocus) != "undefined") && (lastFocus != null)) { + if (typeof(document.activeElement) == "undefined") { + lastFocus.value = options.eventTarget; + } + else { + var active = document.activeElement; + if ((typeof(active) != "undefined") && (active != null)) { + if ((typeof(active.id) != "undefined") && (active.id != null) && (active.id.length > 0)) { + lastFocus.value = active.id; + } + else if (typeof(active.name) != "undefined") { + lastFocus.value = active.name; + } + } + } + } + } + } + if (options.clientSubmit) { + __doPostBack(options.eventTarget, options.eventArgument); + } +} +var __pendingCallbacks = new Array(); +var __synchronousCallBackIndex = -1; +function WebForm_DoCallback(eventTarget, eventArgument, eventCallback, context, errorCallback, useAsync) { + var postData = __theFormPostData + + "__CALLBACKID=" + WebForm_EncodeCallback(eventTarget) + + "&__CALLBACKPARAM=" + WebForm_EncodeCallback(eventArgument); + if (theForm["__EVENTVALIDATION"]) { + postData += "&__EVENTVALIDATION=" + WebForm_EncodeCallback(theForm["__EVENTVALIDATION"].value); + } + var xmlRequest,e; + try { + xmlRequest = new XMLHttpRequest(); + } + catch(e) { + try { + xmlRequest = new ActiveXObject("Microsoft.XMLHTTP"); + } + catch(e) { + } + } + var setRequestHeaderMethodExists = true; + try { + setRequestHeaderMethodExists = (xmlRequest && xmlRequest.setRequestHeader); + } + catch(e) {} + var callback = new Object(); + callback.eventCallback = eventCallback; + callback.context = context; + callback.errorCallback = errorCallback; + callback.async = useAsync; + var callbackIndex = WebForm_FillFirstAvailableSlot(__pendingCallbacks, callback); + if (!useAsync) { + if (__synchronousCallBackIndex != -1) { + __pendingCallbacks[__synchronousCallBackIndex] = null; + } + __synchronousCallBackIndex = callbackIndex; + } + if (setRequestHeaderMethodExists) { + xmlRequest.onreadystatechange = WebForm_CallbackComplete; + callback.xmlRequest = xmlRequest; + // e.g. http: + var action = theForm.action || document.location.pathname, fragmentIndex = action.indexOf('#'); + if (fragmentIndex !== -1) { + action = action.substr(0, fragmentIndex); + } + if (!__nonMSDOMBrowser) { + var queryIndex = action.indexOf('?'); + if (queryIndex !== -1) { + var path = action.substr(0, queryIndex); + if (path.indexOf("%") === -1) { + action = encodeURI(path) + action.substr(queryIndex); + } + } + else if (action.indexOf("%") === -1) { + action = encodeURI(action); + } + } + xmlRequest.open("POST", action, true); + xmlRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8"); + xmlRequest.send(postData); + return; + } + callback.xmlRequest = new Object(); + var callbackFrameID = "__CALLBACKFRAME" + callbackIndex; + var xmlRequestFrame = document.frames[callbackFrameID]; + if (!xmlRequestFrame) { + xmlRequestFrame = document.createElement("IFRAME"); + xmlRequestFrame.width = "1"; + xmlRequestFrame.height = "1"; + xmlRequestFrame.frameBorder = "0"; + xmlRequestFrame.id = callbackFrameID; + xmlRequestFrame.name = callbackFrameID; + xmlRequestFrame.style.position = "absolute"; + xmlRequestFrame.style.top = "-100px" + xmlRequestFrame.style.left = "-100px"; + try { + if (callBackFrameUrl) { + xmlRequestFrame.src = callBackFrameUrl; + } + } + catch(e) {} + document.body.appendChild(xmlRequestFrame); + } + var interval = window.setInterval(function() { + xmlRequestFrame = document.frames[callbackFrameID]; + if (xmlRequestFrame && xmlRequestFrame.document) { + window.clearInterval(interval); + xmlRequestFrame.document.write(""); + xmlRequestFrame.document.close(); + xmlRequestFrame.document.write('
      '); + xmlRequestFrame.document.close(); + xmlRequestFrame.document.forms[0].action = theForm.action; + var count = __theFormPostCollection.length; + var element; + for (var i = 0; i < count; i++) { + element = __theFormPostCollection[i]; + if (element) { + var fieldElement = xmlRequestFrame.document.createElement("INPUT"); + fieldElement.type = "hidden"; + fieldElement.name = element.name; + fieldElement.value = element.value; + xmlRequestFrame.document.forms[0].appendChild(fieldElement); + } + } + var callbackIdFieldElement = xmlRequestFrame.document.createElement("INPUT"); + callbackIdFieldElement.type = "hidden"; + callbackIdFieldElement.name = "__CALLBACKID"; + callbackIdFieldElement.value = eventTarget; + xmlRequestFrame.document.forms[0].appendChild(callbackIdFieldElement); + var callbackParamFieldElement = xmlRequestFrame.document.createElement("INPUT"); + callbackParamFieldElement.type = "hidden"; + callbackParamFieldElement.name = "__CALLBACKPARAM"; + callbackParamFieldElement.value = eventArgument; + xmlRequestFrame.document.forms[0].appendChild(callbackParamFieldElement); + if (theForm["__EVENTVALIDATION"]) { + var callbackValidationFieldElement = xmlRequestFrame.document.createElement("INPUT"); + callbackValidationFieldElement.type = "hidden"; + callbackValidationFieldElement.name = "__EVENTVALIDATION"; + callbackValidationFieldElement.value = theForm["__EVENTVALIDATION"].value; + xmlRequestFrame.document.forms[0].appendChild(callbackValidationFieldElement); + } + var callbackIndexFieldElement = xmlRequestFrame.document.createElement("INPUT"); + callbackIndexFieldElement.type = "hidden"; + callbackIndexFieldElement.name = "__CALLBACKINDEX"; + callbackIndexFieldElement.value = callbackIndex; + xmlRequestFrame.document.forms[0].appendChild(callbackIndexFieldElement); + xmlRequestFrame.document.forms[0].submit(); + } + }, 10); +} +function WebForm_CallbackComplete() { + for (var i = 0; i < __pendingCallbacks.length; i++) { + callbackObject = __pendingCallbacks[i]; + if (callbackObject && callbackObject.xmlRequest && (callbackObject.xmlRequest.readyState == 4)) { + if (!__pendingCallbacks[i].async) { + __synchronousCallBackIndex = -1; + } + __pendingCallbacks[i] = null; + var callbackFrameID = "__CALLBACKFRAME" + i; + var xmlRequestFrame = document.getElementById(callbackFrameID); + if (xmlRequestFrame) { + xmlRequestFrame.parentNode.removeChild(xmlRequestFrame); + } + WebForm_ExecuteCallback(callbackObject); + } + } +} +function WebForm_ExecuteCallback(callbackObject) { + var response = callbackObject.xmlRequest.responseText; + if (response.charAt(0) == "s") { + if ((typeof(callbackObject.eventCallback) != "undefined") && (callbackObject.eventCallback != null)) { + callbackObject.eventCallback(response.substring(1), callbackObject.context); + } + } + else if (response.charAt(0) == "e") { + if ((typeof(callbackObject.errorCallback) != "undefined") && (callbackObject.errorCallback != null)) { + callbackObject.errorCallback(response.substring(1), callbackObject.context); + } + } + else { + var separatorIndex = response.indexOf("|"); + if (separatorIndex != -1) { + var validationFieldLength = parseInt(response.substring(0, separatorIndex)); + if (!isNaN(validationFieldLength)) { + var validationField = response.substring(separatorIndex + 1, separatorIndex + validationFieldLength + 1); + if (validationField != "") { + var validationFieldElement = theForm["__EVENTVALIDATION"]; + if (!validationFieldElement) { + validationFieldElement = document.createElement("INPUT"); + validationFieldElement.type = "hidden"; + validationFieldElement.name = "__EVENTVALIDATION"; + theForm.appendChild(validationFieldElement); + } + validationFieldElement.value = validationField; + } + if ((typeof(callbackObject.eventCallback) != "undefined") && (callbackObject.eventCallback != null)) { + callbackObject.eventCallback(response.substring(separatorIndex + validationFieldLength + 1), callbackObject.context); + } + } + } + } +} +function WebForm_FillFirstAvailableSlot(array, element) { + var i; + for (i = 0; i < array.length; i++) { + if (!array[i]) break; + } + array[i] = element; + return i; +} +var __nonMSDOMBrowser = (window.navigator.appName.toLowerCase().indexOf('explorer') == -1); +var __theFormPostData = ""; +var __theFormPostCollection = new Array(); +var __callbackTextTypes = /^(text|password|hidden|search|tel|url|email|number|range|color|datetime|date|month|week|time|datetime-local)$/i; +function WebForm_InitCallback() { + var formElements = theForm.elements, + count = formElements.length, + element; + for (var i = 0; i < count; i++) { + element = formElements[i]; + var tagName = element.tagName.toLowerCase(); + if (tagName == "input") { + var type = element.type; + if ((__callbackTextTypes.test(type) || ((type == "checkbox" || type == "radio") && element.checked)) + && (element.id != "__EVENTVALIDATION")) { + WebForm_InitCallbackAddField(element.name, element.value); + } + } + else if (tagName == "select") { + var selectCount = element.options.length; + for (var j = 0; j < selectCount; j++) { + var selectChild = element.options[j]; + if (selectChild.selected == true) { + WebForm_InitCallbackAddField(element.name, element.value); + } + } + } + else if (tagName == "textarea") { + WebForm_InitCallbackAddField(element.name, element.value); + } + } +} +function WebForm_InitCallbackAddField(name, value) { + var nameValue = new Object(); + nameValue.name = name; + nameValue.value = value; + __theFormPostCollection[__theFormPostCollection.length] = nameValue; + __theFormPostData += WebForm_EncodeCallback(name) + "=" + WebForm_EncodeCallback(value) + "&"; +} +function WebForm_EncodeCallback(parameter) { + if (encodeURIComponent) { + return encodeURIComponent(parameter); + } + else { + return escape(parameter); + } +} +var __disabledControlArray = new Array(); +function WebForm_ReEnableControls() { + if (typeof(__enabledControlArray) == 'undefined') { + return false; + } + var disabledIndex = 0; + for (var i = 0; i < __enabledControlArray.length; i++) { + var c; + if (__nonMSDOMBrowser) { + c = document.getElementById(__enabledControlArray[i]); + } + else { + c = document.all[__enabledControlArray[i]]; + } + if ((typeof(c) != "undefined") && (c != null) && (c.disabled == true)) { + c.disabled = false; + __disabledControlArray[disabledIndex++] = c; + } + } + setTimeout("WebForm_ReDisableControls()", 0); + return true; +} +function WebForm_ReDisableControls() { + for (var i = 0; i < __disabledControlArray.length; i++) { + __disabledControlArray[i].disabled = true; + } +} +function WebForm_SimulateClick(element, event) { + var clickEvent; + if (element) { + if (element.click) { + element.click(); + } else { + clickEvent = document.createEvent("MouseEvents"); + clickEvent.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); + if (!element.dispatchEvent(clickEvent)) { + return true; + } + } + event.cancelBubble = true; + if (event.stopPropagation) { + event.stopPropagation(); + } + return false; + } + return true; +} +function WebForm_FireDefaultButton(event, target) { + if (event.keyCode == 13) { + var src = event.srcElement || event.target; + if (src && + ((src.tagName.toLowerCase() == "input") && + (src.type.toLowerCase() == "submit" || src.type.toLowerCase() == "button")) || + ((src.tagName.toLowerCase() == "a") && + (src.href != null) && (src.href != "")) || + (src.tagName.toLowerCase() == "textarea")) { + return true; + } + var defaultButton; + if (__nonMSDOMBrowser) { + defaultButton = document.getElementById(target); + } + else { + defaultButton = document.all[target]; + } + if (defaultButton) { + return WebForm_SimulateClick(defaultButton, event); + } + } + return true; +} +function WebForm_GetScrollX() { + if (__nonMSDOMBrowser) { + return window.pageXOffset; + } + else { + if (document.documentElement && document.documentElement.scrollLeft) { + return document.documentElement.scrollLeft; + } + else if (document.body) { + return document.body.scrollLeft; + } + } + return 0; +} +function WebForm_GetScrollY() { + if (__nonMSDOMBrowser) { + return window.pageYOffset; + } + else { + if (document.documentElement && document.documentElement.scrollTop) { + return document.documentElement.scrollTop; + } + else if (document.body) { + return document.body.scrollTop; + } + } + return 0; +} +function WebForm_SaveScrollPositionSubmit() { + if (__nonMSDOMBrowser) { + theForm.elements['__SCROLLPOSITIONY'].value = window.pageYOffset; + theForm.elements['__SCROLLPOSITIONX'].value = window.pageXOffset; + } + else { + theForm.__SCROLLPOSITIONX.value = WebForm_GetScrollX(); + theForm.__SCROLLPOSITIONY.value = WebForm_GetScrollY(); + } + if ((typeof(this.oldSubmit) != "undefined") && (this.oldSubmit != null)) { + return this.oldSubmit(); + } + return true; +} +function WebForm_SaveScrollPositionOnSubmit() { + theForm.__SCROLLPOSITIONX.value = WebForm_GetScrollX(); + theForm.__SCROLLPOSITIONY.value = WebForm_GetScrollY(); + if ((typeof(this.oldOnSubmit) != "undefined") && (this.oldOnSubmit != null)) { + return this.oldOnSubmit(); + } + return true; +} +function WebForm_RestoreScrollPosition() { + if (__nonMSDOMBrowser) { + window.scrollTo(theForm.elements['__SCROLLPOSITIONX'].value, theForm.elements['__SCROLLPOSITIONY'].value); + } + else { + window.scrollTo(theForm.__SCROLLPOSITIONX.value, theForm.__SCROLLPOSITIONY.value); + } + if ((typeof(theForm.oldOnLoad) != "undefined") && (theForm.oldOnLoad != null)) { + return theForm.oldOnLoad(); + } + return true; +} +function WebForm_TextBoxKeyHandler(event) { + if (event.keyCode == 13) { + var target; + if (__nonMSDOMBrowser) { + target = event.target; + } + else { + target = event.srcElement; + } + if ((typeof(target) != "undefined") && (target != null)) { + if (typeof(target.onchange) != "undefined") { + target.onchange(); + event.cancelBubble = true; + if (event.stopPropagation) event.stopPropagation(); + return false; + } + } + } + return true; +} +function WebForm_TrimString(value) { + return value.replace(/^\s+|\s+$/g, '') +} +function WebForm_AppendToClassName(element, className) { + var currentClassName = ' ' + WebForm_TrimString(element.className) + ' '; + className = WebForm_TrimString(className); + var index = currentClassName.indexOf(' ' + className + ' '); + if (index === -1) { + element.className = (element.className === '') ? className : element.className + ' ' + className; + } +} +function WebForm_RemoveClassName(element, className) { + var currentClassName = ' ' + WebForm_TrimString(element.className) + ' '; + className = WebForm_TrimString(className); + var index = currentClassName.indexOf(' ' + className + ' '); + if (index >= 0) { + element.className = WebForm_TrimString(currentClassName.substring(0, index) + ' ' + + currentClassName.substring(index + className.length + 1, currentClassName.length)); + } +} +function WebForm_GetElementById(elementId) { + if (document.getElementById) { + return document.getElementById(elementId); + } + else if (document.all) { + return document.all[elementId]; + } + else return null; +} +function WebForm_GetElementByTagName(element, tagName) { + var elements = WebForm_GetElementsByTagName(element, tagName); + if (elements && elements.length > 0) { + return elements[0]; + } + else return null; +} +function WebForm_GetElementsByTagName(element, tagName) { + if (element && tagName) { + if (element.getElementsByTagName) { + return element.getElementsByTagName(tagName); + } + if (element.all && element.all.tags) { + return element.all.tags(tagName); + } + } + return null; +} +function WebForm_GetElementDir(element) { + if (element) { + if (element.dir) { + return element.dir; + } + return WebForm_GetElementDir(element.parentNode); + } + return "ltr"; +} +function WebForm_GetElementPosition(element) { + var result = new Object(); + result.x = 0; + result.y = 0; + result.width = 0; + result.height = 0; + if (element.offsetParent) { + result.x = element.offsetLeft; + result.y = element.offsetTop; + var parent = element.offsetParent; + while (parent) { + result.x += parent.offsetLeft; + result.y += parent.offsetTop; + var parentTagName = parent.tagName.toLowerCase(); + if (parentTagName != "table" && + parentTagName != "body" && + parentTagName != "html" && + parentTagName != "div" && + parent.clientTop && + parent.clientLeft) { + result.x += parent.clientLeft; + result.y += parent.clientTop; + } + parent = parent.offsetParent; + } + } + else if (element.left && element.top) { + result.x = element.left; + result.y = element.top; + } + else { + if (element.x) { + result.x = element.x; + } + if (element.y) { + result.y = element.y; + } + } + if (element.offsetWidth && element.offsetHeight) { + result.width = element.offsetWidth; + result.height = element.offsetHeight; + } + else if (element.style && element.style.pixelWidth && element.style.pixelHeight) { + result.width = element.style.pixelWidth; + result.height = element.style.pixelHeight; + } + return result; +} +function WebForm_GetParentByTagName(element, tagName) { + var parent = element.parentNode; + var upperTagName = tagName.toUpperCase(); + while (parent && (parent.tagName.toUpperCase() != upperTagName)) { + parent = parent.parentNode ? parent.parentNode : parent.parentElement; + } + return parent; +} +function WebForm_SetElementHeight(element, height) { + if (element && element.style) { + element.style.height = height + "px"; + } +} +function WebForm_SetElementWidth(element, width) { + if (element && element.style) { + element.style.width = width + "px"; + } +} +function WebForm_SetElementX(element, x) { + if (element && element.style) { + element.style.left = x + "px"; + } +} +function WebForm_SetElementY(element, y) { + if (element && element.style) { + element.style.top = y + "px"; + } } \ No newline at end of file diff --git a/develop_solver/When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings - EVGA Forums_files/absolutebm.htm b/develop_solver/When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings - EVGA Forums_files/absolutebm.htm index 4a9e515..1721083 100644 --- a/develop_solver/When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings - EVGA Forums_files/absolutebm.htm +++ b/develop_solver/When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings - EVGA Forums_files/absolutebm.htm @@ -1,2 +1,2 @@ - + \ No newline at end of file diff --git a/develop_solver/When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings - EVGA Forums_files/combinedCss_002.css b/develop_solver/When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings - EVGA Forums_files/combinedCss_002.css index fda3c1d..76f757e 100644 --- a/develop_solver/When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings - EVGA Forums_files/combinedCss_002.css +++ b/develop_solver/When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings - EVGA Forums_files/combinedCss_002.css @@ -1,4 +1,4 @@ -/*~/App_Themes/EVGA_CLASSIC_V2/jqUI/_key*/ +/*~/App_Themes/EVGA_CLASSIC_V2/jqUI/_key*/ /*! jQuery UI - v1.10.2 - 2013-04-07 * http://jqueryui.com * Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.autocomplete.css, jquery.ui.menu.css, jquery.ui.tabs.css @@ -668,7 +668,7 @@ filter: Alpha(Opacity=60); border-radius: 0px; } - + /* AnythingSlider v1.7+ Default (base) theme By Chris Coyier: http://css-tricks.com @@ -872,11 +872,11 @@ div.anythingSlider, div.anythingSlider .anythingWindow, div.anythingSlider .anyt -o-transition-duration: 0; -moz-transition-duration: 0; -webkit-transition-duration: 0; -} +} -#slider -{ - width: 930px; +#slider +{ + width: 930px; height: 275px; list-style: none; /* Prevent FOUC (see FAQ page) and keep things readable if javascript is disabled */ @@ -886,8 +886,8 @@ div.anythingSlider, div.anythingSlider .anythingWindow, div.anythingSlider .anyt /* Extra - replace defaults */ div.anythingSlider-elegant { - border-radius: 10px; - padding: 3px; + border-radius: 10px; + padding: 3px; } /****** SET COLORS HERE *******/ @@ -950,7 +950,7 @@ div.anythingSlider-elegant .back a:hover, div.anythingSlider-elegant .back a.hov /* Navigation Links */ div.anythingSlider-elegant .anythingControls { position: absolute; - right: 3%; + right: 3%; top: 3%; z-index: 100; opacity: 0.90; @@ -1031,7 +1031,7 @@ div.anythingSlider-elegant .arrow a span, div.anythingSlider-elegant ul.thumbNav line-height: 1px; /* needed for IE7 */ text-indent: -9999px; } - + /* * imgAreaSelect animated border style */ @@ -1072,58 +1072,58 @@ div.anythingSlider-elegant .arrow a span, div.anythingSlider-elegant ul.thumbNav } .imgareaselect-selection { -} -/* Lettering --------------*/ -.char1, .char2, .char3, .char4, .char5, .char6, -.char7, .char8, .char9, .char10, .char11, .char12, -.char13, .char14, .char15, .char16, .char17, .char18 -{position: relative; display: inline-block;font-size: 30px; font-family: Adamina,Georgia,"Times New Roman",Times,serif; - letter-spacing: 0.1em; text-transform: capitalize;box-shadow: 2px 2px 5px #454545;} - -.char1:hover, .char2:hover, .char3:hover, .char4:hover, .char5:hover, .char6:hover, -.char7:hover, .char8:hover, .char9:hover, .char10:hover, .char11:hover, .char12:hover, -.char13:hover, .char14:hover, .char15:hover, .char16:hover, .char17:hover, .char18:hover -{ top: -2px;} - -.char14 {box-shadow: 0 0 0} - -.char1, .char3, .char5, .char7, .char9, .char11, .char13, .char15, .char17 -{ - -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=1, M12=0, M21=-0.26794919243112214, M22=1, SizingMethod='auto expand')"; - filter: progid:DXImageTransform.Microsoft.Matrix(M11=1, M12=0, M21=-0.26794919243112214, M22=1, SizingMethod='auto expand'); - transform: scale(1) skewY(-15deg); - -moz-transform: scale(1) skewY(-15deg); - -ms-transform: scale(1) skewY(-15deg); - -webkit-transform: scale(1) skewY(-15deg); - background-color: #E24B3B; - padding: 2px; - text-shadow: 2px 2px 2px #454545; -} - -.char2, .char4, .char6, .char8, .char10, .char12, .char16 -{ - -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=1, M12=0, M21=0.26794919243112264, M22=1, SizingMethod='auto expand')"; - filter: progid:DXImageTransform.Microsoft.Matrix(M11=1, M12=0, M21=0.26794919243112264, M22=1, SizingMethod='auto expand'); - transform: scale(1) skewY(15deg); - -moz-transform: scale(1) skewY(15deg); - -ms-transform: scale(1) skewY(15deg); - -webkit-transform: scale(1) skewY(15deg); - background-color: #A93629; - text-shadow: 0 2px 2px #454545; -} - -.char14 { margin-left: 10px;} - -.ie9 .char1, .ie9 .char2, .ie9 .char3, .ie9 .char4, .ie9 .char5, .ie9 .char6, -.ie9 .char7, .ie9 .char8, .ie9 .char9, .ie9 .char10, .ie9 .char11, .ie9 .char12, -.ie9 .char13, .ie9 .char14, .ie9 .char15, .ie9 .char16, .ie9 .char17, .ie9 .char18 { filter: none } - -body.mobile .char1, body.mobile .char2, body.mobile .char3, body.mobile .char4, body.mobile .char5, body.mobile .char6, -body.mobile .char7, body.mobile .char8, body.mobile .char9, body.mobile .char10, body.mobile .char11, body.mobile .char12, -body.mobile .char13, body.mobile .char14, body.mobile .char15, body.mobile .char16, body.mobile .char17, body.mobile .char18 { box-shadow: none } +} +/* Lettering +-------------*/ +.char1, .char2, .char3, .char4, .char5, .char6, +.char7, .char8, .char9, .char10, .char11, .char12, +.char13, .char14, .char15, .char16, .char17, .char18 +{position: relative; display: inline-block;font-size: 30px; font-family: Adamina,Georgia,"Times New Roman",Times,serif; + letter-spacing: 0.1em; text-transform: capitalize;box-shadow: 2px 2px 5px #454545;} + +.char1:hover, .char2:hover, .char3:hover, .char4:hover, .char5:hover, .char6:hover, +.char7:hover, .char8:hover, .char9:hover, .char10:hover, .char11:hover, .char12:hover, +.char13:hover, .char14:hover, .char15:hover, .char16:hover, .char17:hover, .char18:hover +{ top: -2px;} + +.char14 {box-shadow: 0 0 0} + +.char1, .char3, .char5, .char7, .char9, .char11, .char13, .char15, .char17 +{ + -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=1, M12=0, M21=-0.26794919243112214, M22=1, SizingMethod='auto expand')"; + filter: progid:DXImageTransform.Microsoft.Matrix(M11=1, M12=0, M21=-0.26794919243112214, M22=1, SizingMethod='auto expand'); + transform: scale(1) skewY(-15deg); + -moz-transform: scale(1) skewY(-15deg); + -ms-transform: scale(1) skewY(-15deg); + -webkit-transform: scale(1) skewY(-15deg); + background-color: #E24B3B; + padding: 2px; + text-shadow: 2px 2px 2px #454545; +} + +.char2, .char4, .char6, .char8, .char10, .char12, .char16 +{ + -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=1, M12=0, M21=0.26794919243112264, M22=1, SizingMethod='auto expand')"; + filter: progid:DXImageTransform.Microsoft.Matrix(M11=1, M12=0, M21=0.26794919243112264, M22=1, SizingMethod='auto expand'); + transform: scale(1) skewY(15deg); + -moz-transform: scale(1) skewY(15deg); + -ms-transform: scale(1) skewY(15deg); + -webkit-transform: scale(1) skewY(15deg); + background-color: #A93629; + text-shadow: 0 2px 2px #454545; +} + +.char14 { margin-left: 10px;} + +.ie9 .char1, .ie9 .char2, .ie9 .char3, .ie9 .char4, .ie9 .char5, .ie9 .char6, +.ie9 .char7, .ie9 .char8, .ie9 .char9, .ie9 .char10, .ie9 .char11, .ie9 .char12, +.ie9 .char13, .ie9 .char14, .ie9 .char15, .ie9 .char16, .ie9 .char17, .ie9 .char18 { filter: none } + +body.mobile .char1, body.mobile .char2, body.mobile .char3, body.mobile .char4, body.mobile .char5, body.mobile .char6, +body.mobile .char7, body.mobile .char8, body.mobile .char9, body.mobile .char10, body.mobile .char11, body.mobile .char12, +body.mobile .char13, body.mobile .char14, body.mobile .char15, body.mobile .char16, body.mobile .char17, body.mobile .char18 { box-shadow: none } /* qTip2 v2.0.1-65- basic css3 | qtip2.com | Licensed MIT, GPL | Sat Apr 06 2013 07:50:12 */ -.qtip{position:absolute;left:-28000px;top:-28000px;display:none;max-width:280px;min-width:50px;font-size:10.5px;line-height:12px;direction:ltr;box-shadow:none;padding:0}.qtip-content{position:relative;padding:5px 9px;overflow:hidden;text-align:left;word-wrap:break-word}.qtip-titlebar{position:relative;padding:5px 35px 5px 10px;overflow:hidden;border-width:0 0 1px;font-weight:700}.qtip-titlebar+.qtip-content{border-top-width:0!important}.qtip-close{position:absolute;right:-9px;top:-9px;cursor:pointer;outline:medium none;border-width:1px;border-style:solid;border-color:transparent}.qtip-titlebar .qtip-close{right:4px;top:50%;margin-top:-9px}* html .qtip-titlebar .qtip-close{top:16px}.qtip-titlebar .ui-icon,.qtip-icon .ui-icon{display:block;text-indent:-1000em;direction:ltr}.qtip-icon,.qtip-icon .ui-icon{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;text-decoration:none}.qtip-icon .ui-icon{width:18px;height:14px;line-height:14px;text-align:center;text-indent:0;font:400 bold 10px/13px Tahoma,sans-serif;color:inherit;background:transparent none no-repeat -100em -100em}.qtip-focus{}.qtip-hover{}.qtip-default{border-width:1px;border-style:solid;border-color:#F1D031;background-color:#FFFFA3;color:#555}.qtip-default .qtip-titlebar{background-color:#FFEF93}.qtip-default .qtip-icon{border-color:#CCC;background:#F1F1F1;color:#777}.qtip-default .qtip-titlebar .qtip-close{border-color:#AAA;color:#111} .qtip-light{background-color:#fff;border-color:#E2E2E2;color:#454545}.qtip-light .qtip-titlebar{background-color:#f1f1f1} .qtip-dark{background-color:#505050;border-color:#303030;color:#f3f3f3}.qtip-dark .qtip-titlebar{background-color:#404040}.qtip-dark .qtip-icon{border-color:#444}.qtip-dark .qtip-titlebar .ui-state-hover{border-color:#303030} .qtip-cream{background-color:#FBF7AA;border-color:#F9E98E;color:#A27D35}.qtip-cream .qtip-titlebar{background-color:#F0DE7D}.qtip-cream .qtip-close .qtip-icon{background-position:-82px 0} .qtip-red{background-color:#F78B83;border-color:#D95252;color:#912323}.qtip-red .qtip-titlebar{background-color:#F06D65}.qtip-red .qtip-close .qtip-icon{background-position:-102px 0}.qtip-red .qtip-icon{border-color:#D95252}.qtip-red .qtip-titlebar .ui-state-hover{border-color:#D95252} .qtip-green{background-color:#CAED9E;border-color:#90D93F;color:#3F6219}.qtip-green .qtip-titlebar{background-color:#B0DE78}.qtip-green .qtip-close .qtip-icon{background-position:-42px 0} .qtip-blue{background-color:#E5F6FE;border-color:#ADD9ED;color:#5E99BD}.qtip-blue .qtip-titlebar{background-color:#D0E9F5}.qtip-blue .qtip-close .qtip-icon{background-position:-2px 0}.qtip-shadow{-webkit-box-shadow:1px 1px 3px 1px rgba(0,0,0,.15);-moz-box-shadow:1px 1px 3px 1px rgba(0,0,0,.15);box-shadow:1px 1px 3px 1px rgba(0,0,0,.15)}.qtip-rounded,.qtip-tipsy,.qtip-bootstrap{-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.qtip-rounded .qtip-titlebar{-moz-border-radius:5px 5px 0 0;-webkit-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.qtip-youtube{-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 0 3px #333;-moz-box-shadow:0 0 3px #333;box-shadow:0 0 3px #333;color:#fff;border-width:0;background:#4A4A4A;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#4A4A4A),color-stop(100%,#000));background-image:-webkit-linear-gradient(top,#4A4A4A 0,#000 100%);background-image:-moz-linear-gradient(top,#4A4A4A 0,#000 100%);background-image:-ms-linear-gradient(top,#4A4A4A 0,#000 100%);background-image:-o-linear-gradient(top,#4A4A4A 0,#000 100%)}.qtip-youtube .qtip-titlebar{background-color:#4A4A4A;background-color:rgba(0,0,0,0)}.qtip-youtube .qtip-content{padding:.75em;font:12px arial,sans-serif;filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#4a4a4a, EndColorStr=#000000);-ms-filter:"progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#4a4a4a, EndColorStr=#000000);"}.qtip-youtube .qtip-icon{border-color:#222}.qtip-youtube .qtip-titlebar .ui-state-hover{border-color:#303030}.qtip-jtools{background:#232323;background:rgba(0,0,0,.7);background-image:-webkit-gradient(linear,left top,left bottom,from(#717171),to(#232323));background-image:-moz-linear-gradient(top,#717171,#232323);background-image:-webkit-linear-gradient(top,#717171,#232323);background-image:-ms-linear-gradient(top,#717171,#232323);background-image:-o-linear-gradient(top,#717171,#232323);border:2px solid #ddd;border:2px solid rgba(241,241,241,1);-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 0 12px #333;-moz-box-shadow:0 0 12px #333;box-shadow:0 0 12px #333}.qtip-jtools .qtip-titlebar{background-color:transparent;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171, endColorstr=#4A4A4A);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171, endColorstr=#4A4A4A)"}.qtip-jtools .qtip-content{filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A, endColorstr=#232323);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A, endColorstr=#232323)"}.qtip-jtools .qtip-titlebar,.qtip-jtools .qtip-content{background:transparent;color:#fff;border:0 dashed transparent}.qtip-jtools .qtip-icon{border-color:#555}.qtip-jtools .qtip-titlebar .ui-state-hover{border-color:#333}.qtip-cluetip{-webkit-box-shadow:4px 4px 5px rgba(0,0,0,.4);-moz-box-shadow:4px 4px 5px rgba(0,0,0,.4);box-shadow:4px 4px 5px rgba(0,0,0,.4);background-color:#D9D9C2;color:#111;border:0 dashed transparent}.qtip-cluetip .qtip-titlebar{background-color:#87876A;color:#fff;border:0 dashed transparent}.qtip-cluetip .qtip-icon{border-color:#808064}.qtip-cluetip .qtip-titlebar .ui-state-hover{border-color:#696952;color:#696952}.qtip-tipsy{background:#000;background:rgba(0,0,0,.87);color:#fff;border:0 solid transparent;font-size:11px;font-family:'Lucida Grande',sans-serif;font-weight:700;line-height:16px;text-shadow:0 1px #000}.qtip-tipsy .qtip-titlebar{padding:6px 35px 0 10;background-color:transparent}.qtip-tipsy .qtip-content{padding:6px 10}.qtip-tipsy .qtip-icon{border-color:#222;text-shadow:none}.qtip-tipsy .qtip-titlebar .ui-state-hover{border-color:#303030}.qtip-tipped{border:3px solid #959FA9;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background-color:#F9F9F9;color:#454545;font-weight:400;font-family:serif}.qtip-tipped .qtip-titlebar{border-bottom-width:0;color:#fff;background:#3A79B8;background-image:-webkit-gradient(linear,left top,left bottom,from(#3A79B8),to(#2E629D));background-image:-webkit-linear-gradient(top,#3A79B8,#2E629D);background-image:-moz-linear-gradient(top,#3A79B8,#2E629D);background-image:-ms-linear-gradient(top,#3A79B8,#2E629D);background-image:-o-linear-gradient(top,#3A79B8,#2E629D);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8, endColorstr=#2E629D);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8, endColorstr=#2E629D)"}.qtip-tipped .qtip-icon{border:2px solid #285589;background:#285589}.qtip-tipped .qtip-icon .ui-icon{background-color:#FBFBFB;color:#555}.qtip-bootstrap{font-size:14px;line-height:20px;color:#333;padding:1px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.qtip-bootstrap .qtip-titlebar{padding:8px 14px;margin:0;font-size:14px;font-weight:400;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.qtip-bootstrap .qtip-titlebar .qtip-close{right:11px;top:45%;border-style:none}.qtip-bootstrap .qtip-content{padding:9px 14px}.qtip-bootstrap .qtip-icon{background:transparent}.qtip-bootstrap .qtip-icon .ui-icon{width:auto;height:auto;float:right;font-size:20px;font-weight:700;line-height:18px;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.qtip-bootstrap .qtip-icon .ui-icon:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.4;filter:alpha(opacity=40)}.qtip:not(.ie9haxors) div.qtip-content,.qtip:not(.ie9haxors) div.qtip-titlebar{filter:none;-ms-filter:none}.qtip .qtip-tip{margin:0 auto;overflow:hidden;z-index:10}x:-o-prefocus,.qtip .qtip-tip{visibility:hidden}.qtip .qtip-tip,.qtip .qtip-tip .qtip-vml,.qtip .qtip-tip canvas{position:absolute;color:#123456;background:transparent;border:0 dashed transparent}.qtip .qtip-tip canvas{top:0;left:0}.qtip .qtip-tip .qtip-vml{behavior:url(#default#VML);display:inline-block;visibility:visible}#qtip-overlay{position:fixed;left:-10000em;top:-10000em}#qtip-overlay.blurs{cursor:pointer}#qtip-overlay div{position:absolute;left:0;top:0;width:100%;height:100%;background-color:#000;opacity:.7;filter:alpha(opacity=70);-ms-filter:"alpha(Opacity=70)"}.qtipmodal-ie6fix{position:absolute!important} +.qtip{position:absolute;left:-28000px;top:-28000px;display:none;max-width:280px;min-width:50px;font-size:10.5px;line-height:12px;direction:ltr;box-shadow:none;padding:0}.qtip-content{position:relative;padding:5px 9px;overflow:hidden;text-align:left;word-wrap:break-word}.qtip-titlebar{position:relative;padding:5px 35px 5px 10px;overflow:hidden;border-width:0 0 1px;font-weight:700}.qtip-titlebar+.qtip-content{border-top-width:0!important}.qtip-close{position:absolute;right:-9px;top:-9px;cursor:pointer;outline:medium none;border-width:1px;border-style:solid;border-color:transparent}.qtip-titlebar .qtip-close{right:4px;top:50%;margin-top:-9px}* html .qtip-titlebar .qtip-close{top:16px}.qtip-titlebar .ui-icon,.qtip-icon .ui-icon{display:block;text-indent:-1000em;direction:ltr}.qtip-icon,.qtip-icon .ui-icon{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;text-decoration:none}.qtip-icon .ui-icon{width:18px;height:14px;line-height:14px;text-align:center;text-indent:0;font:400 bold 10px/13px Tahoma,sans-serif;color:inherit;background:transparent none no-repeat -100em -100em}.qtip-focus{}.qtip-hover{}.qtip-default{border-width:1px;border-style:solid;border-color:#F1D031;background-color:#FFFFA3;color:#555}.qtip-default .qtip-titlebar{background-color:#FFEF93}.qtip-default .qtip-icon{border-color:#CCC;background:#F1F1F1;color:#777}.qtip-default .qtip-titlebar .qtip-close{border-color:#AAA;color:#111} .qtip-light{background-color:#fff;border-color:#E2E2E2;color:#454545}.qtip-light .qtip-titlebar{background-color:#f1f1f1} .qtip-dark{background-color:#505050;border-color:#303030;color:#f3f3f3}.qtip-dark .qtip-titlebar{background-color:#404040}.qtip-dark .qtip-icon{border-color:#444}.qtip-dark .qtip-titlebar .ui-state-hover{border-color:#303030} .qtip-cream{background-color:#FBF7AA;border-color:#F9E98E;color:#A27D35}.qtip-cream .qtip-titlebar{background-color:#F0DE7D}.qtip-cream .qtip-close .qtip-icon{background-position:-82px 0} .qtip-red{background-color:#F78B83;border-color:#D95252;color:#912323}.qtip-red .qtip-titlebar{background-color:#F06D65}.qtip-red .qtip-close .qtip-icon{background-position:-102px 0}.qtip-red .qtip-icon{border-color:#D95252}.qtip-red .qtip-titlebar .ui-state-hover{border-color:#D95252} .qtip-green{background-color:#CAED9E;border-color:#90D93F;color:#3F6219}.qtip-green .qtip-titlebar{background-color:#B0DE78}.qtip-green .qtip-close .qtip-icon{background-position:-42px 0} .qtip-blue{background-color:#E5F6FE;border-color:#ADD9ED;color:#5E99BD}.qtip-blue .qtip-titlebar{background-color:#D0E9F5}.qtip-blue .qtip-close .qtip-icon{background-position:-2px 0}.qtip-shadow{-webkit-box-shadow:1px 1px 3px 1px rgba(0,0,0,.15);-moz-box-shadow:1px 1px 3px 1px rgba(0,0,0,.15);box-shadow:1px 1px 3px 1px rgba(0,0,0,.15)}.qtip-rounded,.qtip-tipsy,.qtip-bootstrap{-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.qtip-rounded .qtip-titlebar{-moz-border-radius:5px 5px 0 0;-webkit-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.qtip-youtube{-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 0 3px #333;-moz-box-shadow:0 0 3px #333;box-shadow:0 0 3px #333;color:#fff;border-width:0;background:#4A4A4A;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#4A4A4A),color-stop(100%,#000));background-image:-webkit-linear-gradient(top,#4A4A4A 0,#000 100%);background-image:-moz-linear-gradient(top,#4A4A4A 0,#000 100%);background-image:-ms-linear-gradient(top,#4A4A4A 0,#000 100%);background-image:-o-linear-gradient(top,#4A4A4A 0,#000 100%)}.qtip-youtube .qtip-titlebar{background-color:#4A4A4A;background-color:rgba(0,0,0,0)}.qtip-youtube .qtip-content{padding:.75em;font:12px arial,sans-serif;filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#4a4a4a, EndColorStr=#000000);-ms-filter:"progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#4a4a4a, EndColorStr=#000000);"}.qtip-youtube .qtip-icon{border-color:#222}.qtip-youtube .qtip-titlebar .ui-state-hover{border-color:#303030}.qtip-jtools{background:#232323;background:rgba(0,0,0,.7);background-image:-webkit-gradient(linear,left top,left bottom,from(#717171),to(#232323));background-image:-moz-linear-gradient(top,#717171,#232323);background-image:-webkit-linear-gradient(top,#717171,#232323);background-image:-ms-linear-gradient(top,#717171,#232323);background-image:-o-linear-gradient(top,#717171,#232323);border:2px solid #ddd;border:2px solid rgba(241,241,241,1);-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 0 12px #333;-moz-box-shadow:0 0 12px #333;box-shadow:0 0 12px #333}.qtip-jtools .qtip-titlebar{background-color:transparent;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171, endColorstr=#4A4A4A);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171, endColorstr=#4A4A4A)"}.qtip-jtools .qtip-content{filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A, endColorstr=#232323);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A, endColorstr=#232323)"}.qtip-jtools .qtip-titlebar,.qtip-jtools .qtip-content{background:transparent;color:#fff;border:0 dashed transparent}.qtip-jtools .qtip-icon{border-color:#555}.qtip-jtools .qtip-titlebar .ui-state-hover{border-color:#333}.qtip-cluetip{-webkit-box-shadow:4px 4px 5px rgba(0,0,0,.4);-moz-box-shadow:4px 4px 5px rgba(0,0,0,.4);box-shadow:4px 4px 5px rgba(0,0,0,.4);background-color:#D9D9C2;color:#111;border:0 dashed transparent}.qtip-cluetip .qtip-titlebar{background-color:#87876A;color:#fff;border:0 dashed transparent}.qtip-cluetip .qtip-icon{border-color:#808064}.qtip-cluetip .qtip-titlebar .ui-state-hover{border-color:#696952;color:#696952}.qtip-tipsy{background:#000;background:rgba(0,0,0,.87);color:#fff;border:0 solid transparent;font-size:11px;font-family:'Lucida Grande',sans-serif;font-weight:700;line-height:16px;text-shadow:0 1px #000}.qtip-tipsy .qtip-titlebar{padding:6px 35px 0 10;background-color:transparent}.qtip-tipsy .qtip-content{padding:6px 10}.qtip-tipsy .qtip-icon{border-color:#222;text-shadow:none}.qtip-tipsy .qtip-titlebar .ui-state-hover{border-color:#303030}.qtip-tipped{border:3px solid #959FA9;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background-color:#F9F9F9;color:#454545;font-weight:400;font-family:serif}.qtip-tipped .qtip-titlebar{border-bottom-width:0;color:#fff;background:#3A79B8;background-image:-webkit-gradient(linear,left top,left bottom,from(#3A79B8),to(#2E629D));background-image:-webkit-linear-gradient(top,#3A79B8,#2E629D);background-image:-moz-linear-gradient(top,#3A79B8,#2E629D);background-image:-ms-linear-gradient(top,#3A79B8,#2E629D);background-image:-o-linear-gradient(top,#3A79B8,#2E629D);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8, endColorstr=#2E629D);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8, endColorstr=#2E629D)"}.qtip-tipped .qtip-icon{border:2px solid #285589;background:#285589}.qtip-tipped .qtip-icon .ui-icon{background-color:#FBFBFB;color:#555}.qtip-bootstrap{font-size:14px;line-height:20px;color:#333;padding:1px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.qtip-bootstrap .qtip-titlebar{padding:8px 14px;margin:0;font-size:14px;font-weight:400;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.qtip-bootstrap .qtip-titlebar .qtip-close{right:11px;top:45%;border-style:none}.qtip-bootstrap .qtip-content{padding:9px 14px}.qtip-bootstrap .qtip-icon{background:transparent}.qtip-bootstrap .qtip-icon .ui-icon{width:auto;height:auto;float:right;font-size:20px;font-weight:700;line-height:18px;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.qtip-bootstrap .qtip-icon .ui-icon:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.4;filter:alpha(opacity=40)}.qtip:not(.ie9haxors) div.qtip-content,.qtip:not(.ie9haxors) div.qtip-titlebar{filter:none;-ms-filter:none}.qtip .qtip-tip{margin:0 auto;overflow:hidden;z-index:10}x:-o-prefocus,.qtip .qtip-tip{visibility:hidden}.qtip .qtip-tip,.qtip .qtip-tip .qtip-vml,.qtip .qtip-tip canvas{position:absolute;color:#123456;background:transparent;border:0 dashed transparent}.qtip .qtip-tip canvas{top:0;left:0}.qtip .qtip-tip .qtip-vml{behavior:url(#default#VML);display:inline-block;visibility:visible}#qtip-overlay{position:fixed;left:-10000em;top:-10000em}#qtip-overlay.blurs{cursor:pointer}#qtip-overlay div{position:absolute;left:0;top:0;width:100%;height:100%;background-color:#000;opacity:.7;filter:alpha(opacity=70);-ms-filter:"alpha(Opacity=70)"}.qtipmodal-ie6fix{position:absolute!important} /* qTip Custom Styling */ @@ -1167,63 +1167,63 @@ body.mobile .char13, body.mobile .char14, body.mobile .char15, body.mobile .char color: #454545; } -.qtip-apgpop .qtip-titlebar { - background-color: #E3E3E3; +.qtip-apgpop .qtip-titlebar { + background-color: #E3E3E3; font-size: 15px; - padding: 8px 35px 10px 10px; - color: #454545; - border-radius: 0; + padding: 8px 35px 10px 10px; + color: #454545; + border-radius: 0; } - .qtip-apgpop .qtip-content{ - box-shadow: 0 1px 2px #AAA inset; + .qtip-apgpop .qtip-content{ + box-shadow: 0 1px 2px #AAA inset; line-height: 1.6; } - .qtip-apgpop.qtip-draggable .qtip-titlebar { - cursor: move; + .qtip-apgpop.qtip-draggable .qtip-titlebar { + cursor: move; } /* ASPPG Top Nav & small menu style */ -.qtip-apgmenu.qtip-draggable .qtip-titlebar, -.qtip-apgsmallmenu.qtip-draggable .qtip-titlebar { - cursor: move; +.qtip-apgmenu.qtip-draggable .qtip-titlebar, +.qtip-apgsmallmenu.qtip-draggable .qtip-titlebar { + cursor: move; } .qtip-apgmenu, .qtip-apgsmallmenu{ - border: 1px solid #aaa; + border: 1px solid #aaa; border-radius: 5px; background-color: #FCFCFC; color: #454545; } .qtip-apgsmallmenu .qtip-titlebar{ - background-color: #FCFCFC; + background-color: #FCFCFC; margin: 1px; } .qtip-apgmenu .qtip-titlebar{ font-size: 16px; background-color: #FCFCFC; - margin: 7px 15px -10px 0; + margin: 7px 15px -10px 0; padding: 8px 45px 15px 10px; } - .qtip-apgmenu .qtip-content, - .qtip-apgsmallmenu .qtip-content{ - line-height: 1.4; + .qtip-apgmenu .qtip-content, + .qtip-apgsmallmenu .qtip-content{ + line-height: 1.4; } - .qtip-apgsmallmenu .qtip-content{ - padding: 5px; + .qtip-apgsmallmenu .qtip-content{ + padding: 5px; } - .qtip-apgsmallmenu a.postButtonDropdown { - color: #444; + .qtip-apgsmallmenu a.postButtonDropdown { + color: #444; } /* ASPPG Top Popup Login style */ .qtip-apglogin{ - border: 1px solid #aaa; + border: 1px solid #aaa; border-radius: 5px; /*border-color: rgba(0,0,0, 0.2); background-clip: padding-box;*/ @@ -1235,22 +1235,22 @@ body.mobile .char13, body.mobile .char14, body.mobile .char15, body.mobile .char font-size: 18px; background-color: #FCFCFC; border-bottom: 1px solid #CCCCCC; - margin: 7px 15px -10px; + margin: 7px 15px -10px; padding: 8px 45px 15px 10px; } - .qtip-apglogin .qtip-content{ + .qtip-apglogin .qtip-content{ line-height: 1.4; } /*! tinymce tooltip style */ -.qtip-mce.qtip-draggable .qtip-titlebar { - cursor: move; +.qtip-mce.qtip-draggable .qtip-titlebar { + cursor: move; } .qtip-mce{ border: 5px solid #B6B6B6; border-radius: 8px; - border-color: rgba(0,0,0, 0.2); + border-color: rgba(0,0,0, 0.2); background-clip: padding-box; background-color: #FCFCFC; color: #454545; @@ -1263,73 +1263,73 @@ body.mobile .char13, body.mobile .char14, body.mobile .char15, body.mobile .char border-radius: 8px 8px 0 0; } - .qtip-mce .qtip-content{ + .qtip-mce .qtip-content{ line-height: 1.4; } - .qtip-mce a.postButtonDropdown { - color: #444; + .qtip-mce a.postButtonDropdown { + color: #444; } /* Add shadows to IE 9, 10 menu */ -.qtip-iemenushadow { - border-color: #C2C2C2; +.qtip-iemenushadow { + border-color: #C2C2C2; border-color: rgba(0,0,0, 0.15); - background-clip: padding-box; - border-width: 5px 5px 5px 5px; - border-style: solid; -} - -.qtip-wideshadow{ - box-shadow: 0 8px 16px 4px rgba(0, 0, 0, 0.5); -} - + background-clip: padding-box; + border-width: 5px 5px 5px 5px; + border-style: solid; +} + +.qtip-wideshadow{ + box-shadow: 0 8px 16px 4px rgba(0, 0, 0, 0.5); +} + /* Youtube tooltip style */ - - .qtip-youtube .qtip-content{ - font: 14px/24px arial,sans-serif; + + .qtip-youtube .qtip-content{ + font: 14px/24px arial,sans-serif; + } + + .qtip-youtube .qtip-titlebar .qtip-close{ + right: 10px;top: 15px; } +.ui-rating .ui-rating-star, .ui-rating .ui-rating-cancel{ + width:16px; + height:16px; + font-size:2px; + float:left; + text-decoration:none; + vertical-align:bottom; + background-image:url(../image/rstar.gif); + background-repeat:no-repeat; +} +.ui-rating a { + cursor: pointer; +} +.ui-rating-full { + background-position:left top; +} + +.ui-rating-half { + background-position:left -16px; +} + +.ui-rating-empty { + background-position:left -32px; +} + +.ui-rating-cancel-empty { + background-position:left -64px; +} + +.ui-rating-cancel-full { + background-position:left -80px; +} + +.ui-rating-hover { + background-position:left -48px; +} - .qtip-youtube .qtip-titlebar .qtip-close{ - right: 10px;top: 15px; - } -.ui-rating .ui-rating-star, .ui-rating .ui-rating-cancel{ - width:16px; - height:16px; - font-size:2px; - float:left; - text-decoration:none; - vertical-align:bottom; - background-image:url(../image/rstar.gif); - background-repeat:no-repeat; -} -.ui-rating a { - cursor: pointer; -} -.ui-rating-full { - background-position:left top; -} - -.ui-rating-half { - background-position:left -16px; -} - -.ui-rating-empty { - background-position:left -32px; -} - -.ui-rating-cancel-empty { - background-position:left -64px; -} - -.ui-rating-cancel-full { - background-position:left -80px; -} - -.ui-rating-hover { - background-position:left -48px; -} - ul.tagit { padding: 1px 3px 0; overflow: auto; @@ -1338,7 +1338,7 @@ ul.tagit { margin-right: inherit; margin-top: 3px; margin-bottom: 3px; - border: 1px solid #BBBBBB; + border: 1px solid #BBBBBB; box-shadow: -1px 1px 2px #DDDDDD inset; border-radius: 2px; width: 80%; @@ -1350,7 +1350,7 @@ ul.tagit li { } ul.tagit li.tagit-choice { position: relative; - margin-top: 2px; + margin-top: 2px; padding: 2px 18px 2px 6px; } ul.tagit li.tagit-new { @@ -1392,7 +1392,7 @@ ul.tagit input[type="text"] { background-color: inherit; outline: none; } - + /* Simple OpenID Plugin http://code.google.com/p/openid-selector/ @@ -1461,4 +1461,4 @@ a.openid_large_btn:focus { .openid_selected { border: 4px solid #DDD; -} +} diff --git a/develop_solver/When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings - EVGA Forums_files/combinedJs.js b/develop_solver/When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings - EVGA Forums_files/combinedJs.js index 141b9ad..c573dfc 100644 --- a/develop_solver/When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings - EVGA Forums_files/combinedJs.js +++ b/develop_solver/When to Use Double Precision under NVIDIA Control Panel Manage 3D Settings - EVGA Forums_files/combinedJs.js @@ -1,4 +1,4 @@ -/*tm_key*/ +/*tm_key*/ /* http://www.kryogenix.org/code/browser/searchhi/ */ @@ -19,8 +19,8 @@ function highlightWord(node,word) { // And do this node itself if (node.nodeType == 3) { // text node - tempNodeVal = node.nodeValue.toLowerCase(); - tempWordVal = new RegExp('\\b' + word.toLowerCase() + '\\b', "g"); + tempNodeVal = node.nodeValue.toLowerCase(); + tempWordVal = new RegExp('\\b' + word.toLowerCase() + '\\b', "g"); if (tempNodeVal.search(tempWordVal) != -1) { pn = node.parentNode; // check if we're inside a "nosearchhi" zone @@ -33,7 +33,7 @@ function highlightWord(node,word) { } if (pn.className != ASPPG_searchQuery) { // word has not already been highlighted! - nv = node.nodeValue; + nv = node.nodeValue; ni = tempNodeVal.search(tempWordVal); // Create a load of replacement nodes before = document.createTextNode(nv.substr(0,ni)); @@ -50,2403 +50,2403 @@ function highlightWord(node,word) { } } } -} - -function searchHighlight() { - var qs = getQueryString(ASPPG_searchQuery); - var highlitewords = (qs) ? qs.trim() : ''; - - highlitewords = highlitewords.replace(document.location.hash, ''); - - if (typeof highlitewords != 'undefined' && highlitewords != '') { - var wordList = highlitewords.replace(/\s/gi, ',').split(','); - var nodes = $(".msg, .excerpt"); - - for (var j = 0; j < nodes.length; j++) { - highlightWord(nodes[j], highlitewords); - - for (var i = 0; i < wordList.length; i++) { - highlightWord(nodes[j], wordList[i]); - } - } - } -} - -$doc.ready(function () { searchHighlight(); }); - - - function RegisterMsgSideHover() { - - if (cMemberInfo.usingMobileTheme || cMemberInfo.isMobileDevice) return; - - $body.on('mouseenter', 'div.msgcontent', function () { - - var winHeight = $win.height(), distanceToShowFactor = 1.5; - var $msgside = $(this); - - if ($msgside.height() < (winHeight * distanceToShowFactor)) return false; - - var $btnsPanel = $msgside.find('.msgButtonsPanel'); - var fixedClass = 'halfhidden'; - - if ($btnsPanel.hasClass(fixedClass)) return false; - - var btnOffset = $btnsPanel.offset(); - - if ($win.scrollTop() + (winHeight * distanceToShowFactor) <= btnOffset.top) { - - var $fixPanel = $btnsPanel.clone(); - - $fixPanel.addClass(fixedClass).css({ left: btnOffset.left - 5 }).appendTo($msgside); - - $win.bind('scrollstop.btnpanel', function () { - - var winScrollTop = $win.scrollTop(); - - if (winScrollTop + winHeight > btnOffset.top || winScrollTop + winHeight < $msgside.offset().top) { - $fixPanel.remove(); - $win.unbind('scrollstop.btnpanel'); - } - }); - } - - return true; - }); - } - - function RegisterMemberHover() { - - if (cMemberInfo.usingMobileTheme || cMemberInfo.isMobileDevice) return; - - var timeout; - - $body - .on('mouseenter', '.authorcontent a.titlehead', function () { - - var $titleHeadLink = $(this); - - timeout = setTimeout(function () { - - var $parentDiv = $titleHeadLink.closest('div.authorcontent'); - - var $overallDiv = $('
      ').addClass('titleheadHoverDiv'); - - var $div = $('
      ').addClass('titleheadOriginalDiv'); - - $div.html($parentDiv.html()); - $div.find('.msgAuthorInfo').remove(); // full mode - $div.find('.msgStatus').remove(); // essential mode - - $overallDiv.html($div); - - var offset = $parentDiv.offset(); - - $overallDiv.css({ - 'top': (offset.top - 10) + 'px', - 'left': offset.left + 'px' - }); - - $div.css({ - 'width': $parentDiv.width(), - 'height': $parentDiv.height() + 15 - $parentDiv.find('.msgAuthorInfo').height(), // full mode - 'max-width': 250 - }); - - CreateMemberMenu($titleHeadLink, $overallDiv); - - $overallDiv.appendTo('body'); - - }, 500); - - }) - .on('mouseleave', '.authorcontent a.titlehead', function () { - clearTimeout(timeout); - }) - .on('mouseleave', 'div.titleheadHoverDiv', function () { - var $container = $(this); - setTimeout(function () { - $container.detach(); - }, 200); - }); - - } - - var _attachmentImageUrls = []; - var _clickedThumbLink; - function RegisterToolTipAttachmentImages() { - - if (cMemberInfo.usingMobileTheme || cMemberInfo.isMobileDevice) return; - - $body.on('click', '.attachments a.attachedImages', function (e) { - e.preventDefault(); - - _clickedThumbLink = this; - var $this = $(this); - - getImgsIntoArray($this.parent().find('a.attachedImages')); - toolTipWin(produceImgSrc($this)); - - }).on('click', 'img.toolTipWin', function (e) { - e.preventDefault(); - var $thisImg = $(this); - var nextI = findAttachmentIndex($thisImg.attr('src'))[1]; - $thisImg.attr('src', _attachmentImageUrls[nextI].src); - $thisImg.nextAll('.filename').text(_attachmentImageUrls[nextI].filename); - setTimeout(function () { $thisImg.closest('div.qtip').qtip('api').reposition(); }, 100); - - }).on('click', 'a.toolTipExtlink', function () { - var $this = $(this); - $this.attr('href', $this.prev().attr('src')); - - }).on('click', 'a.toolTipRefreshlink', function () { - var $thisImg = $(this).prevAll('img.toolTipWin'); - var src = $thisImg.attr('src'); - var random = randomString(5); - var reloadSrc = src + '&refresh=' + random; - - $thisImg.attr('src', reloadSrc); - - getImgsIntoArray($(_clickedThumbLink).parent().find('.attachedImages'), random); - - }); - - - - $body.on('mousewheel', 'img.toolTipWin', function(e, delta, deltaX, deltaY) { - - e.preventDefault(); - var $thisImg = $(this); - //consoleLog(delta, deltaX, deltaY); - var nextI = findAttachmentIndex($thisImg.attr('src'))[(deltaY < 0 ? 1 : 2)]; - //consoleLog(nextI); - if (_attachmentImageUrls[nextI]) { - $thisImg.attr('src', _attachmentImageUrls[nextI].src); - $thisImg.nextAll('.filename').text(_attachmentImageUrls[nextI].filename); - - setTimeout(function() { $thisImg.closest('div.qtip').qtip('api').reposition(); }, 100); - } - - }); - } - - function getImgsIntoArray($links, random) { - _attachmentImageUrls = []; - - $links.each(function () { - var $thisLink = $(this); - var imgObj = {}; - imgObj.filename = $thisLink.data('filename'); - imgObj.src = produceImgSrc($thisLink) + (random ? '&refresh=' + random : ''); - _attachmentImageUrls[_attachmentImageUrls.length] = imgObj; - }); - } - - function produceImgSrc($link) { - return $link.attr('href') + '&filename=' + $link.data('filename'); - } - - function toolTipWin(url) { - var winSizes = getViewportSize(); - var maxHeight = winSizes[1] - 80; - qtip.pop(url, null, false, true, 7000, - '' + - ' ' + - ' ' + - '
      ', - { - style: { classes: 'qtip-rounded qtip-wideshadow qtip-youtube' }, - position: { effect: false }, - hide: { - event: 'unfocus' - }, - events: { - render: function(event, api) { - $win.bind('keydown', function(e) { - if(e.keyCode === 27) { api.hide(e); } - }); - }, - visible: function (e, api) { - var $this = $(this); - //$this.draggable(); - api.reposition(); - var $thisImg = $this.find('img.toolTipWin'); - var thisI = findAttachmentIndex($thisImg.attr('src'))[0]; - - if (_attachmentImageUrls[thisI]) - $thisImg.nextAll('div.filename').text(_attachmentImageUrls[thisI].filename); - }, - hide: function (e, api) { - api.destroy(); - } - } - }); - } - - function findAttachmentIndex(src) { - var nextI = 0; - var prevI = _attachmentImageUrls.length - 1; - var thisI = 0; - for (var i = 0; i < _attachmentImageUrls.length; i++) { - if (_attachmentImageUrls[i].src == src) { - thisI = i; - if (i != (_attachmentImageUrls.length - 1)) { - nextI = i + 1; - } - if (i != 0) { - prevI = i - 1; - } - break; - } - } - - return [thisI, nextI, prevI]; - } - - function RefreshClick(val, id) { // val: reply / edit; id = msgID - - var setXmlHttpVal = ''; - - switch (val) { - - case 'reply': - // compare CurrentPageRecordCount value, if exceeding mpg, redirect - if (parseInt($get('CurrentPageRecordCount').value) == tm.mpg) { - self.location.href = cPathInfo.ForumDir + 'FindPost/' + id.toString(); - return false; - } else { - setEditorContent(''); - } - case 'edit': - // simply refresh - - default: - - } - - tmRefreshMessageList((tm.inTreeMode ? $get(tm.msgTreeHiddenField).value : setXmlHttpVal)); - - if(typeof id != 'undefined') { - _scrollToMsgId = id; - } - - return false; - } - - function tmRefreshMessageList(val) { - $('#ResultXmlPanel').css('opacity', 0.4); - $find('ResultXmlPanel').set_value(val); - } - - var _scrollToMsgId = 0; - - function afterRefresh() { // called from tm.aspx.vb; also executed on initial load - - var $itemToScrollTo = $('#msg' + _scrollToMsgId.toString()); - if ($itemToScrollTo.length > 0) $.scrollTo($itemToScrollTo); - _scrollToMsgId = 0; - - // update pageLastGenerated - this and in tm.js is the only place where we make such change, - // for marking forum / thread read we cannot rely on server's now() - pageLastGenerated = new Date().addHours(-_userTimeOffset); - - trackMessageRead($('.msgcontent span.msgDate').filter(':not(.none)').children('span.performdateformat'), - function () { var mid = $(this).parent().data('mid'); - return $('#Avatar' + mid.toString()); }); - } - - function changeTmSort(value){ - if (isNaN(value)) return; - SaveSortCookie(value, function (){tm.refreshButton.click();}); - } - - - function reloadParent(arg) { - - if(typeof(arg) == 'string'){ - if (arg == '') { - return; - } - else if (arg == 'true') { - tm.refreshButton.click(); - } - else if (arg == 'del') { - RefreshAfterDelete(); - } - else if (arg == 'reload') { - self.location.replace(cPathInfo.Url); - } - else if (!isNaN(arg)) { - self.location.replace(cPathInfo.ForumDir + 'tt.aspx?forumID=' + arg); - } - - } - - } - - function RefreshAfterDelete() { - $get(tm.msgLastMessageForPostHiddenField).value = '0'; // to force rebinding of the posting interface; - - if (!tm.inTreeMode) { - tm.refreshButton.click(); - } else { - treeProcessAfterDelete(); - } - } - - function qtipPopupCloseHandler() { - reloadParent($(this).data('args')); - } - - function switchMsgDivOnOff(msgID, link) { // called in ItemTemplate.ascx - $(link).parent().fadeOut('fast', function () { - - var $link = $(this); - - if (tm.inEssentialMode) { - $link.closest('.msgtable').find('.msgcontent div').filter('.none').fadeIn('fast'); - } else { - $link.siblings().fadeIn('fast'); - } - }); - - return false; - } - - var multiQuoteIDs = []; - - function AddMultiQuote(msgID) { - - if (isNaN(msgID)) return; - - for (var i =0; i
      ", 'URL'); - } - - function RegisterNextPrevLinkInHeader() {//called directly in tm.aspx - - var html = String.format( - '
      {4} {1}
      ' + - '
      {2} {5}
      ' + - '
      ', - currentThreadID, ln.tmPrevThread, ln.tmNextThread, cPathInfo.ForumDir + 'FindPost/', - ln.entUpArrow, ln.entDownArrow); - - var $nxtprv = $('div.nxtprv'); - - - if (!(cMemberInfo.usingMobileTheme || cMemberInfo.isMobileDevice)) { - var timeout; - - $nxtprv - .on('mouseenter', 'a', function () { - var $link = $(this); - if ($link.data('retrieved')) return; - var linkDir = $link.data('dir'); - timeout = setTimeout(function () { - $link.fadeOut('fast', function () { - JQCallWebService('ws/Message.aspx/GetNextPrev', - { msgID: currentThreadID, dir: linkDir }, - function (r) { - var returnedVal = r.d; - - if (returnedVal.text != '') { - $link.text(returnedVal.text); - $link.attr('href', returnedVal.url); - } else { - $link.attr('href', '#'); - $link.click(function () { return false; }); - qtip.notice($link, ln.NoDataWarning, - { - position: { - my: 'middle ' + (linkDir == 'prev' ? 'left' : 'right'), - at: 'middle ' + (linkDir == 'prev' ? 'right' : 'left') - } - }); - } - - $link.data('retrieved', true); - $link.fadeIn(); - - }, JQOnCallError - ); - }); - - }, 100); - }).on('mouseleave', '.nxtprv a', function () { - clearTimeout(timeout); - }); - } - - $nxtprv.html(html); - } - - function RegisterShowMarkTrack() { - - if (cMemberInfo.usingMobileTheme || cMemberInfo.isMobileDevice) return; - - var additionalOptions = { - style: { classes: 'qtip-apgsmallmenu qtip-shadow' }, - hide: { delay: 600, event: 'unfocus mouseleave' }, - position: { my: 'top right', at: 'bottom right', adjust: { x: -10} }, - events: { - render: function (e, api) { - var $tip = $(this); - $tip.find("a").click(function () { api.hide(); }); - } - } - }; - - var func = function () { - var $mark = $(this); - var $markTrack = $mark.next('span'); - if ($markTrack.hasClass('msgMarkTrack')) { - qtip.notice($mark, - $markTrack.html(), additionalOptions); - - } - }; - - $body.on('mouseenter', '.tmanswered, .tmhelpful', func); - } - - $doc.ready(function () { - if (typeof wysiwygAsTextarea != 'undefined') - wysiwygAsTextarea.TextareaSelector = 'div#postdiv textarea:first'; - - if (cMemberInfo.usingMobileTheme) - $('#postdiv').css({ 'width': '95%', 'margin': '15px auto' }).find('textarea').css('width', '100%'); - }); - - - $doc.ready(function () { - $(tm.refreshButton).click(RefreshClick); - RegisterMsgSideHover(); - RegisterMemberHover(); - RegisterToolTipAttachmentImages(); - RegisterShowMarkTrack(); - RegisterMouseUpTextSelect(); - performOnPageGetScrollTo(); - }); - - function performOnPageGetScrollTo() { - var $initialScrollTo = $('#msg' + document.location.hash.replace('#', '')); - - if ($initialScrollTo[0]) { - - $initialScrollTo - .effect('highlight', {}, 3000) - .find('div.item, div.altItem') - .effect('highlight', {}, 3000); - - $.scrollTo($initialScrollTo); - } - } - - var tmSelectString; - - function RegisterMouseUpTextSelect() { - - if (cMemberInfo.usingMobileTheme || cMemberInfo.isMobileDevice) return; - - $body.bind('mouseup', function() { - if (window.getSelection) { - tmSelectString = window.getSelection().toString(); - } - else if (window.document.selection) { - var rng = window.document.selection.createRange(); - tmSelectString = rng.text; - } - else { - tmSelectString = ""; - } - }); - - } - -var _xmlPanelSel = '#ResultXmlPanel'; -var _oriSearhcIDDataKey = 'orisearchid'; -var _orisearchtermDataKey = 'orisearchterm'; -var _relatedTopicULSel = '#relatedTopicsList'; -var _relatedlnkSel = '#relatedSearch'; -var _relatedResultDivSel = '#relatedTopics'; -var _relatedRecordCount = 10; - -function registerRelatedSearch(on, andExecute) { // registered in footertemplate - var eToHandle = 'click.relatedSearch'; - - if (on) { - - $(_xmlPanelSel).off(eToHandle, _relatedlnkSel).on(eToHandle, _relatedlnkSel, function () { - - var $lnk = $(this); - var orisearchid = $lnk.data(_oriSearhcIDDataKey); - - if (orisearchid != 0) { - getRelatedTopicsBySearchID(orisearchid, $lnk, true); - } else { - - var termInLinkData = $lnk.data(_orisearchtermDataKey); - - var finalSearchString = termInLinkData != '' ? termInLinkData : ProduceSearchPhraseFromString(document.title, 4); - - initiateRelatedTopicSearch(finalSearchString, currentForumID, function (r) { - var result = r.d; //[asyncID, server now, highlight] or [Integer delay, "" ,""] - var aid = result[0]; - - if (aid == 'reentersearch') { - performNoRelatedTopicAction($lnk); - return false; - } else { - showNoticeToFilterSearchbox($lnk, ln.tmRelatedTopicsWaiting); - trackRelatedByAid(aid, result[1], $lnk); - } - - return true; - }, _relatedRecordCount); - } - - return false; - }); - - //if (andExecute) setTimeout(function() { $(_relatedlnkSel).click(); }, 0); - - if (andExecute) { - - setTimeout(function () { - var $link = $(_relatedlnkSel); - - if (!$link[0]) return; - - var relatedLinkOffsetTop = $link.offset().top; - var relatedLinkHeight = $link.height(); - $win.bind('scrollstop.relatedTopics', function () { - - var winScrollTop = $win.scrollTop(); - var visibleLimit = winScrollTop + $win.height(); - - if (visibleLimit > relatedLinkOffsetTop && winScrollTop < (relatedLinkOffsetTop + relatedLinkHeight)) { - $link.data('notip', true); - $link.click(); - $win.unbind('scrollstop.relatedTopics'); - } - - }); - }, 3000); - } - - } else { - - $(_xmlPanelSel).off(eToHandle, _relatedlnkSel).on(eToHandle, _relatedlnkSel, function () { - var $ulRelatedList = $(_relatedTopicULSel); - var $lnk = $(this); - - if ($ulRelatedList.length == 0) { - //consoleLog('from off'); - displayNoRecordNotice($lnk); - } - else { - //$.scrollTo($lnk); - } - - return false; - }); - } -} - -function trackRelatedByAid(aid, beginTime, $lnk) { - var relatedIntval = setInterval(function () { - searchCheckIfComplete(aid, beginTime, function (result) { - switch (result.d) { - case 0: // keep checking - break; - case -1: - clearInterval(relatedIntval); - performNoRelatedTopicAction($lnk); - - break; - default: - clearInterval(relatedIntval); - $lnk.qtip('hide'); - storeRelatedSearchResults(result.d, function () { - getRelatedTopicsBySearchID(result.d, $lnk, false); - }); - break; - } - }); - }, 1000); -} - -var _relatedSearchRedoCount = 0; - -function getRelatedTopicsBySearchID(searchID, $lnk, fromStorage) { - - //consoleLog(String.format('searchID: {0}, fromStorage: {1}', searchID, fromStorage)); - - var ws = 'Message.aspx/RetrieveRelatedTopics'; - var ajaxData = { threadID: currentThreadID, top: _relatedRecordCount }; - - JQCallWebService('ws/' + ws, ajaxData, function (r) { - var sResults = r.d; - - var lis = ''; - for (var s = 0; s < sResults.length; s++) { - - var sResult = sResults[s]; - - if (currentThreadID == sResult.MessageID) - continue; - - lis += String.format('
    • ', - cPathInfo.ForumDir, sResult.MessageID, sResult.Subject, - (Modernizr.borderimage ? '' : '')); //Modernizr.borderimage as a test for IE all versions - } - - if (lis == '') { // no data - - if (fromStorage && sResults.length == 0) { // re-search from subject - - if (_relatedSearchRedoCount == 0) { - $lnk.data(_oriSearhcIDDataKey, 0); // removed the data so that we can re-search - $lnk.click(); - _relatedSearchRedoCount += 1; - } - - } else { - performNoRelatedTopicAction($lnk); - } - - } else { - - var $relatedResultDiv = $(_relatedResultDivSel); - - $relatedResultDiv - .find('ul') - .replaceWith('
        ' + lis + '
      ') - .end().fadeIn(); - - $lnk.toggleClass('relatedTopics', true); - - registerRelatedSearch(false); - } - - }, JQOnCallError); -} - -function performNoRelatedTopicAction($lnk) { - registerRelatedSearch(false); - displayNoRecordNotice($lnk); -} - -function displayNoRecordNotice($lnk) { - - var $relatedDiv = $(_relatedResultDivSel); - - $relatedDiv.show() - .find('ul') - .attr('id', _relatedTopicULSel.replace('#', '')) - .html('
    • ' + ln.tmRelatedTopicsNotFound + '
    • '); - - $lnk.toggleClass('relatedTopics', true); -} - -function storeRelatedSearchResults(searchID, callback) { // searchID = 0 =deleteonly - //this performs 2 functions: 1) cache search results 2) if search results are fewer than 15, perform tag search - JQCallWebService('ws/Message.aspx/StoreRelatedSearch', - { msgID: currentThreadID, searchID: searchID, top: _relatedRecordCount }, - ($.isFunction(callback) ? callback : null), JQOnCallError); -} - -function registerRelatedCustomization() { - var $lnk = $(_relatedlnkSel); - var $tip; - - $(_xmlPanelSel).on('click', '#relatedCustomization', function () { - - var orisearchterm = $lnk.data(_orisearchtermDataKey); - - $tip = - qtip.prompt($(this), 450, ln.tmRelatedTopicsCustomize, - (orisearchterm != '' ? orisearchterm : ProduceSearchPhraseFromString(document.title, 4)), - ln.buttonUpdateValue, '', function (val) { - registerRelatedSearch(true); - - $lnk - .data('notip', false) - .data(_oriSearhcIDDataKey, 0) - .data(_orisearchtermDataKey, val) - .click(); - - $tip.qtip('hide'); - }, null, {position:{at: 'top right'}}); - - return false; - }); - -} - -$doc.ready(function () { - registerRelatedCustomization(); -}); - -function essentialModeToggle(on) { - // Save to database by calling WS - JQCallWebService( - 'ws/MessageList.aspx/SaveReadingPreference', - { essentialsOnly: on, isThread: false }, - function () { tm.refreshButton.click(); }, - JQOnCallError); - - return false; -} - -function quickQuote(msgID) { - - var $postDiv = $('#postdiv'); - - if ($postDiv.length==0) { - self.location.href = cPathInfo.ForumDir + 'post.aspx?quote=true&messageID=' + msgID; - return false; - } - - $get(tm.msgLastMessageForPostHiddenField).value = msgID; - - JQCallWebService("ws/Message.aspx/QuickQuote", - { msgID: msgID }, - function (r) { - if (typeof tinyMCE != 'undefined') { //WYSIWYG - tinyMCE.activeEditor.insertHtml(r.d.WYSIWYG); - tinyMCE.activeEditor.getBody().scrollTop = 0; - - } else { // textbox - $(wysiwygAsTextarea.TextareaSelector).val(r.d.Text); - } - $.scrollTo($postDiv); - }); - - return false; -} - -function quickReplyAjax() { - - var draftId = parseInt($get(autoSave.ClientID).value) || 0; - - var $captchaControl = $('input[name$="captcha$txt"], input[id=recaptcha_response_field]').first(); - var captcha = $captchaControl.val() || ''; - - var $reCaptchaChallenge = $('input[id=recaptcha_challenge_field]'); - var challenge = $reCaptchaChallenge.val() || ''; - - JQCallWebService("ws/Message.aspx/QuickReply", - { toMessageId: parseInt($get(tm.msgLastMessageForPostHiddenField).value), - draftId: draftId, - body: getEditorContent(), - attachmentID : '', - captchaVal: captcha, - challenge: challenge - }, - function (r) { - var returnedVal = r.d; - switch (returnedVal.returnCode) { - - case 0: - - KillSolutionOnlyCookie(); - $('#previewdiv').hide(); - window.clearInterval(_previewInterval); // defined in preview.js - - if (returnedVal.requiresApproval) { - sendFailureAlert(ln.postResultPendingApprovalDesc, 1500); - setTimeout(function() { self.location.replace(self.location.href); }, 3000); - } else { - setEditorContent(''); - - if (tm.inTreeMode) { - treeReload(returnedVal.newMsgID); - } else { - RefreshClick('reply', returnedVal.newMsgID); - } - - } - break; - - default: - ///condensed all error messages here - var alerts = ['', - ln.postResultFailedFloodDesc, - ln.postResultFailedTopicLockedDesc, - ln.RightViolationMessage, - ln.formVerificationFailureMsg, - ln.warnRequiredDesc, - ln.postResultFailedExceedsPerDay]; - - sendFailureAlert(alerts[Math.abs(returnedVal.returnCode)]); - break; - } - - if ($captchaControl.length == 1) { - $captchaControl.next('img').click(); - if (typeof Recaptcha != 'undefined') Recaptcha.reload(); - if (returnedVal.returnCode != 0) $captchaControl.focus(); - } - } - ); -} - -function sendFailureAlert(txt, ms) { - popTip(txt, null, true, false, ms || 4000); -} - -function SaveSortCookie(sortDir, action) { - JQCallWebService('ws/Message.aspx/SaveSortCookie', { sortDir: sortDir }, function () { - if ($.isFunction(action)) action.call(); - }, JQOnCallError); -} - -function SaveSolutionOnlyCookie(action) { - JQCallWebService('ws/Message.aspx/SaveSolutionPreferenceCookie', { msgID: currentThreadID }, function () { - if ($.isFunction(action)) action.call(); - }, JQOnCallError); -} - -function KillSolutionOnlyCookie(action) { - JQCallWebService('ws/Message.aspx/DeleteSolutionOnlyCookie', {}, function () { - if ($.isFunction(action)) action.call(); - }, JQOnCallError); -} - -var JQMenuLink; -var OptionalMenu; - -function threadReadToggle(linkSelf, read) { - $(linkSelf).css('cursor', 'progress'); - - var data = { threadID: currentThreadID }; - - if (read) data.mark = pageLastGenerated.format('s'); - - JQCallWebService("ws/TrackRead.aspx/" + (read ? 'MarkThreadRead' : 'MarkThreadUnRead'), data, - function (r) { - setTimeout(function () { $(linkSelf).css('cursor', 'pointer'); }, 200); - if (!r.d && !read) { qtip.alert(ln.tmOptionMarkUnReadUnAvailable); } - } - - ); - - return false; -} - -function markApproval(msg, linkSelf) { - - $(linkSelf).css('cursor', 'progress'); - - JQCallWebService("ws/Management.aspx/ApproveMessage", { msgIDs: [msg] }, - function(rtn) { - var returnedResult = rtn.d; - if (returnedResult === true) { - if (msg == currentThreadID) { - self.location.replace(self.location.href.replace(location.hash, '')); - } else { - tm.refreshButton.click(); - } - } - }, JQOnCallError); - -} - -function tmRestoreMessage(msgID) { - var d = {}; - d.msgIDs = [msgID]; - tmCallManagementWS('RestoreMessage', d); - return false; -} - -function tmRecycleMessage(msgID, isPostOwner) { - var d = {}; - d.msgIDs = [msgID]; - d.reason = ''; - - deleteRecycleConfirmBox('RecycleMessage', d, isPostOwner); - return false; -} - -function tmDeleteMessage(msgID, isPostOwner) { - var d = {}; - d.msgIDs = [msgID]; - d.deleteBranch = false; - deleteRecycleConfirmBox('DeleteMessage', d, isPostOwner); - return false; -} - -function deleteRecycleConfirmBox(wsMethod, data, isPostOwner) { - data.sendMail = false; - qtip.confirm(ln.deleteMessageWarning, - ln.buttonSubmitValue, (isPostOwner ? '' : ln.buttonSubmitNotifyValue), ln.buttonCancelValue, - function () { tmCallManagementWS(wsMethod, data); }, - function () { data.sendMail = true; tmCallManagementWS(wsMethod, data); }); -} - -function tmCallManagementWS(method, data) { - JQCallWebService('ws/Management.aspx/' + method, data, - function (rtn) { - var returnedResult = rtn.d; - - if (returnedResult === true) { - - if (method == 'DeleteMessage' && data.msgIDs[0] == currentThreadID) { - // delete thread must redirect to forum - self.location.replace(cPathInfo.ForumDir + 'tt.aspx?forumid=' + currentForumID.toString()); - } else { - RefreshAfterDelete(); - } - - - } - - }, JQOnCallError); - -// consoleLog(method); -// consoleLog(data); -} - -function markHelpful(msgID, self) { - $(self).css('cursor', 'progress'); - ajaxMarkHelpfulRewardRequest(msgID, false); -} - -function markAnswer(msgID, self) { - $(self).css('cursor', 'progress'); - ajaxMarkHelpfulRewardRequest(msgID, true); -} - -function ajaxMarkHelpfulRewardRequest(msgID, markAsAnswer) { - JQCallWebService("ws/Management.aspx/MarkMessageHelpful", - { msgID: msgID, markAsAnswer: markAsAnswer }, - function(rtn) { - var returnedResult = rtn.d; - if (returnedResult === true) tm.refreshButton.click(); - }, JQOnCallError); -} - -function findRewardMsg(msg) { - - var $rewardMsg = $('.rewardMsg'); - - if ($rewardMsg.length>0) { - $.scrollTo($rewardMsg); - return; - } - - JQCallWebService("ws/Message.aspx/FindRewardMsg", { 'msgID': msg }, - function(rtn) { - var returnedMsgID = rtn.d; - - if (returnedMsgID == 0) return; - - if ($get(returnedMsgID)) { - $.scrollTo($get(returnedMsgID)); - } else { - self.location.href = cPathInfo.ForumDir + 'FindPost/' + returnedMsgID; - } - }, - JQOnCallError - ); - -} - -function listSolution(msgID, bool, self) { - - $(self).css('cursor', 'progress'); - - var func = function() { - if (!tm.inTreeMode) - tm.refreshButton.click(); - else - self.location.replace(cPathInfo.Url); - }; - - if (bool) { - SaveSolutionOnlyCookie(func); - } else { - KillSolutionOnlyCookie(func); - } - - return false; - // maybe a scroll to first solution after postback is complete? -} - -function scrollToFirstReply() { // called in tm.aspx.vb - $.scrollTo($('.msgRepliesDiv').get(0)); -} - - -function MarkFriendOrIgnore(cmd, userid, self) { - - $(self).css('cursor', 'progress'); - - JQCallWebService("ws/Contact.aspx/MarkFriendOrIgnore", { command: cmd, contactID: userid }, - function (rtn) { - var returnedResult = rtn.d; - if (returnedResult == 'success') { - tm.refreshButton.click(); //refreshButton must be defined on pages that calls this method (Page that contains RadMenu) - } - }); - -} - - -function RegisterRatingControl() { - - $('select.ratingSelect') - .rating({ showCancel: false }) - .bind('change.ajaxhandle', HandlerRatingBegin); - - $body - .off('click.ajaxhandle', 'a.thumb') - .on('click.ajaxhandle', 'a.thumb', HandlerRatingBegin); - - $('a.thumbdisabled').fadeTo(300, 0.25); -} - -function HandlerRatingBegin() { - var $ratingTool = $(this); - - var msgID = parseInt($ratingTool.attr('id').replace(/[^\d]/gi, '')); - var rating; - - if (this.tagName.toLowerCase() == 'select') { - rating = parseInt($ratingTool.val()); - } - else { - rating = ($ratingTool.hasClass('up')) ? 1 : -1; - } - - JQCallWebService("ws/Message.aspx/RateMessage", { msgID: msgID, rating: rating }, - function (rtn) { - var returnedVal = rtn.d; - var successFailureFlag = returnedVal[0]; - var newRatingOption = { showCancel: false, disabled: true }; - var $resultSpan = $('#ratingResult' + msgID); - var $_stars = $(this); - var $_thumbs = $('#ratingThumbs' + msgID).find('a'); - - if (successFailureFlag == 'fail') { - - qtip.notice($resultSpan, ln.rateFailure, - { position: { target: $resultSpan, at: 'left center', my: 'right center' }, - hide : {inactive : 2000} }); - - if (this.tagName.toLowerCase() == 'select') { - - // unbind handler - $_stars.unbind('change.ajaxhandle'); - - // remove current - $_stars.next().remove(); - $_stars.prop('hasProcessed', false); // new setting to allow re-evaluation of select - - // disable the select - - if ($_stars.attr('disabled') != 'disabled') $_stars.attr('disabled', 'disabled'); - - // retrieve original value - - var originalSelectValue; - - if ($resultSpan.children('a').size() == 0) { // not admin or mod so no link - originalSelectValue = $resultSpan.text(); - } else { - originalSelectValue = $resultSpan.children('a').text(); - } - - // restart rating - $_stars.rating(newRatingOption); - - //return to original value - $_stars.val((Math.round(originalSelectValue) - 3)).change(); - - $_stars.next().fadeTo(300, 0.25); - - } else { - - // disable onclick handler - $_thumbs.unbind('click.ajaxhandle'); - $_thumbs.fadeTo(300, 0.25); - - } - - return; - } - - // end of failed attempts - - var totalRating = parseInt(returnedVal[1]); - var totalRateCount = parseInt(returnedVal[2]); - var avgRating; - - if (totalRateCount == 0) totalRateCount = 1; - - if (this.tagName.toLowerCase() == 'select') { - - // calculate the avgValue for star - avgRating = (totalRating / totalRateCount).toFixed(2); - var selectValueToSet = Math.round(avgRating) - 3; - - // prevent repeating the ajax action - $_stars.unbind('change.ajaxhandle'); - - // set select to disabled - if ($_stars.attr('disabled') != 'disabled') $_stars.attr('disabled', 'disabled'); - - // remove current stars - $_stars.next().fadeOut('slow', function () { - - $(this).remove(); - $_stars.prop('hasProcessed', false); // new setting to allow re-evaluation of select - - // rebuild the star; set select to avgRating; - $_stars.rating(newRatingOption); - $_stars.val(selectValueToSet).change(); - - $_stars.next().fadeTo(300, 0.25); - }); - - } else { - - // prevent repeating the ajax action - $_thumbs.unbind('click.ajaxhandle'); - $_thumbs.fadeTo(300, 0.25); - - // set avgRating - avgRating = ((totalRating > 0) ? '+' : '') + totalRating.toString(); - - } - - // set text - - if ($resultSpan.children('a').size() == 0) { // not admin or mod so no link - $resultSpan.text(avgRating); - } else { - $resultSpan.children('a').text(avgRating); - } - - //setting rate count to the div - $('#ratingDiv' + msgID).attr('title', - String.format(((totalRateCount > 1) ? ln.tmRateCount_pl : ln.tmRateCount_sing), totalRateCount)); - - }, - JQOnCallError, this // this refers to the event target passed to as context of the Ajax framework - ); -} - - - - -function ProduceSearchPhraseFromString(str, top, useAnd) { - var cleanedTitle = str.trim().replace(/[^\w\s\.\-]/gi, ''); - var arrToRemove = cleanedTitle.split(' '); - - arrToRemove.sort(function (a, b) { return (b.length - a.length); }); - - if (!top) top = 4; - - var arrLongestWords = new Array(); - - for (var j = 0; j < arrToRemove.length; j++) { - if (arrLongestWords.indexOf(arrToRemove[j]) == -1) { - arrLongestWords.push(arrToRemove[j]); - - if (arrLongestWords.length == (arrToRemove.length < top ? arrToRemove.length : top)) - break; - } - } - - var arrFresh = cleanedTitle.split(' '); - var arrFinal = new Array(); - - for (var i = 0; i < arrFresh.length; i++) { - var currentWord = arrFresh[i]; - if (arrLongestWords.indexOf(currentWord) != -1 && arrFinal.indexOf(currentWord) == -1) { - if (currentWord.match(/[^\w]/gi)) currentWord = '"' + currentWord + '"'; - arrFinal.push(currentWord); - } - - } - - return arrFinal.join((useAnd ? ' ' : ' OR ')).trim(); -} - -function getSearchTermSuggestionFromWiki(phrase, onComplete) { - $.ajax( - { url: "http://en.wikipedia.org/w/api.php", - dataType: "jsonp", - data: { action: "opensearch", - search: phrase, - format: "json" - }, - success: function (data, textStatus, xhr) { - onComplete(data[1]); -// $("#results").empty(); -// $.each(data[1], function (_, result) { -// $("#results").append("
    • " + result + "
    • "); -// }); - }, - error: function (xhr, textStatus, errorThrown) { - onComplete(errorThrown); - } - }); - -} -var _searchSuggest = ''; - -function getSearchTermSuggestion(phrase, onComplete) { - if (_searchSuggest!= phrase.trim()){ - JQCallWebService("ws/Search.aspx/SearchSuggestion", - { searchPhrase: phrase }, - function (rtn) { - var returnedData = rtn.d; - _searchSuggest = phrase; - onComplete(returnedData); - }); - } -} - -function initiateRelatedTopicSearch(phrase, forumSpec, onComplete, topN) { - JQCallWebService("ws/Search.aspx/SearchRelatedTopics", - { - sRequest: { - Phrase: phrase.trim(), - ForumIDs: forumSpec, - TopNResults: topN, - Precision: ['Normal'] - } - }, - onComplete, - JQOnCallError); -} - -function initiateSearchSimilarThreads(phrase, forumSpec, onComplete, topN, searchPrecision) { - - if (typeof searchPrecision == 'undefined') searchPrecision = ['Exact']; - - JQCallWebService("ws/Search.aspx/SearchSimilarThreads", - { - sRequest: { - Phrase: phrase.trim(), - ForumIDs: forumSpec, - TopNResults: (!topN ? 30 : topN), - Precision: searchPrecision - } - }, - onComplete, - JQOnCallError); - -} - -function initiateSearchRegular(phrase, forumIDs, threadID, topN, phraseIn, resultAs, - searchPrecision, onComplete) { - - // resultAs: TopicsOnly RepliesOnly Both Combined - // searchPrecision: Fuzzy Normal Exact ExactOnly - - if (typeof topN == 'undefined') topN = 300; - if (typeof resultAs == 'undefined') resultAs = 'Combined'; - if (typeof searchPrecision == 'undefined') searchPrecision = 'Exact'; - - JQCallWebService("ws/Search.aspx/BeginSearch", - { - sRequest: { - Phrase: phrase, - ForumIDs: forumIDs, - ThreadID: threadID, - TopNResults: topN, - ListResultAs: resultAs, - Precision: searchPrecision, - PhraseFoundIn: phraseIn - } - }, - onComplete, - JQOnCallError); - -} - -function searchCheckIfComplete(aid, initialSearchTime, onComplete) { - - var data = { theAID: aid, beginTime: initialSearchTime }; - - JQCallWebService("ws/Search.aspx/CheckIfStepOneCompleted", data, onComplete, JQOnCallError); -} - - -function beginRetrieveingSimpleSearchResults(searchID, onBeforeRetrieving, onFinishRetrieving) { - onBeforeRetrieving(); - - var data = { searchID: searchID, top : -1 }; - - JQCallWebService("ws/Search.aspx/RetrieveSimpleSearchResults", data, onFinishRetrieving, JQOnCallError); - -} - - -$doc.ready(function () { - registerSubscriptionMenuHover(); -}); - -var _subMenuLinkSel = '#subscriptionMenuLink'; -var _subsDataKey = 'currentlevel'; -var _subMenuDatakey = 'sublevel'; - -function registerSubscriptionMenuHover() { - var $subMenuLink = $(_subMenuLinkSel); - - $subMenuLink.qtip({ - overwrite: false, - content: { text: $('#subOptions').html() }, - position: { my: 'top left', at: 'bottom left', adjust: { y: 5, x:-15} }, - show: { event: ($subMenuLink.data(_subsDataKey) != -1 ? 'mouseenter' : 'click') }, - hide: { fixed: true, delay: 600, event: 'unfocus mouseleave' }, - style: { width: '250px', tip: false, classes: 'qtip-apgsmallmenu qtip-shadow' } - }); -} - -function HandleSubscription(self, isForum, id) { - var currentLevel = $(self).data(_subsDataKey); - - if (currentLevel != -1) { - return SetSubscription(self, -1, isForum, id); - } else { - return false; - } -} - -function SetSubscription(self, action, isForum, id) { - var $link = $(self); - - $link.css('cursor', 'progress'); - $('.subOption').removeClass('bold'); - - var subscribeLinkText = (isForum ? ln.ttOptionSubscribeToForum : ln.tmOptionSubscribeToThread); - var unsubscribeLinkText = (isForum ? ln.ttOptionUnSubscribeToForum : ln.tmOptionUnSubscribeToThread); - - JQCallWebService( - "ws/Subscription.aspx/SubscribeTo" + (isForum ? 'Forum' : 'Thread'), - { id: id, action: action }, - function () { - - setTimeout(function () { $link.css('cursor', 'pointer'); }, 200); - - var $subMenuLink = $(_subMenuLinkSel); - var qtipapi = $subMenuLink.data('qtip'); - - if (action != -1) { - $subMenuLink.text(unsubscribeLinkText); - qtipapi.set('show.event', 'mouseenter'); - } else { - $subMenuLink.text(subscribeLinkText); - qtipapi.set('show.event', 'click'); - } - - setTimeout(function () { qtipapi.hide(); }, (action != -1? 500 : 150)); - - $subMenuLink.data(_subsDataKey, action); - - // from drop down - instead of from menu link - if ($link.hasClass('subOption')) $link.addClass('bold'); - } - - ); - - return false; -} -// Tree loading - -var treeDivASelector = 'div#treeIframeDiv a.msg'; -var treeDivSelector = 'div#treeIframeDiv'; -var currentRequestTreeMsgID = 0; - -$(function() { - if (tm.inTreeMode) { - setTreeDivResizable(); - setPrevNextLinkHandler(); - $('#' + tm.msgTreeHiddenField).val(currentThreadID); // this is required otherwise on initial load the hidden field is empty - } -}); - -$(function () { - - setTimeout(function () { // setTimeout 100ms required because server side AddResponseScript/Format happens later - if (tm.inTreeMode) { - - if (currentRequestTreeMsgID == 0) { loadTree(currentThreadID, currentThreadID); } // load tree regular mode - - if (currentRequestTreeMsgID != 0) performFindMsg(currentRequestTreeMsgID, false); //find msg mode, ie when tree m is specified - - $(treeDivSelector).delegate('a.msg', 'click', treeMsgClick); - - setTimeout(function () { // need delaying, as append is kind of slow in loadTree - $(treeDivASelector + ':first').addClass('bold'); - readyToPerformScroll = true; - - }, 1000); - - setScrollHandler(); - } - }, 100); -}); - -function performFindMsg(msgID, rebindScrollHandler) { - - loadTree(msgID, currentThreadID, null, true); - //console.log('loadTree'); - - //click to load the first msg - setTimeout(function() { $(treeDivSelector + ' a#treelink' + msgID.toString()).click(); }, 1500); - //console.log('first setTimeout'); - - //load the tree above the clicked msg - setTimeout(function () { loadTree(msgID, currentThreadID, null, false, true); }, 1800); - //consoleLog('ln52'); - //console.log('second setTimeout'); - - if (rebindScrollHandler === true) { // this is when we find msg after delete - //console.log('rebindScrollHandler === true'); - dontCheckScrollDown = false; - dontCheckScrollUp = false; - setScrollHandler(); - } -} - -function setTreeDivResizable() { - var $treeContainer, currentHeight, currentWidth; - $treeContainer = $('#' + tm.treeIframeContainment); - - if ($treeContainer.size() == 0) return; - - currentHeight = $treeContainer.height(); - currentWidth = $treeContainer.width(); - - $treeContainer.resizable( - { - alsoResize: treeDivSelector, - distance: 10, - delay: 20, - containment: '#main', - minHeight: currentHeight, - maxHeight: $win.height() / 2, - maxWidth: currentWidth, minWidth: currentWidth, - start: function(e, ui) { - readyToPerformScroll = false; - }, - stop: function(e, ui) { - setTimeout(function() { - readyToPerformScroll = true; - }, 2000); - } - } - ); - - setDivResizingBehavior(); - -} - -function setDivResizingBehavior() { - var tempCounter = 0; - var windowResizeTimeout; - - window.onresize = function() { - window.clearTimeout(windowResizeTimeout); - windowResizeTimeout = window.setTimeout(DelayedResize, 100); - }; - - /* - elaborated windows Resize test to enure consistent cross browser behavior - */ - var sizeBeforeResize = 0; - var $iframeContainment = $('#' + tm.treeIframeContainment); - var iframeSizeDiff = $iframeContainment.width() - $(treeDivSelector).width(); - - function DelayedResize() { - window.status = ++tempCounter; - // Add your original window.onresize implementation here - - var mainWidth = $('div#main').children('div:first').width(); - - if (mainWidth != sizeBeforeResize) { // size is changed on the resize event - - setTimeout(function() { - // set new minwidth and maxwidth for the resizable element due to change in window size - $iframeContainment.resizable("option", "minWidth", mainWidth) - .resizable("option", "maxWidth", mainWidth); - }, 100); - - setTimeout(function() { - // resize the resizable element - $iframeContainment.animate({ width: mainWidth.toString() + 'px' }, 200); - }, 400); - - setTimeout(function() { - //resize the div and the iframe - $(treeDivSelector).animate( - { width: ($iframeContainment.width() - iframeSizeDiff).toString() + 'px' }, 200); - }, 700); - - sizeBeforeResize = mainWidth; - } - - } -} - -function setPrevNextLinkHandler() { - $('a#treePrevLink').click(function(e) { treeNavigateTo('prev'); e.preventDefault(); }); - $('a#treeNextLink').click(function(e) { treeNavigateTo('next'); e.preventDefault(); }); - $('a#treeReloadLink').click(function(e) { treeReload(); e.preventDefault(); }); -} - -var readyToPerformScroll = false; - -var newScrollTimeout; - -function setScrollHandler() { - $(treeDivSelector).unbind('scroll').scroll(function() { - var _self = this; - window.clearTimeout(newScrollTimeout); - newScrollTimeout = setTimeout(function() { checkScroll($(_self)); }, 400); - }); -} - -var dontCheckScrollDown = false; -var dontCheckScrollUp = false; - -function checkScroll($treeDiv) { - // this function performs 2 checks - // 1) when scrolled to bottom, check if 'last' is present and if so, auto fetch - // 2) when scrolled to top, check if 'first' is present and if NOT, auto fetch - // if while fetching, we do nothing - - //console.log('checkScroll'); - - if (!readyToPerformScroll || stillInAjaxProgress) return false; - - if (!dontCheckScrollDown && $treeDiv[0].scrollHeight - $treeDiv.height() - $treeDiv.scrollTop() <= 14) { - - var $lastLink = $treeDiv.find('a.last'); - - if ($lastLink.size() != 0) { - fetchNextTreePage(parseInt($lastLink.attr('id').replace('treelink', '')), $lastLink); // supply jqTarget to rid of the last on existing link, simulating click - } else { - dontCheckScrollDown = true; - } - } - - else if (!dontCheckScrollUp && $treeDiv.scrollTop() <= 14) { - - var $firstLink = $treeDiv.find('a.msg:first'); - - if (!$firstLink.hasClass('first')) { - signalTreeState('loading'); - $treeDiv.css({'overflow':'hidden', 'visibility' : 'hidden'}); - loadTree(parseInt($firstLink.attr('id').replace('treelink', '')), currentThreadID, null, false, true); - //consoleLog('ln192'); - } else { - dontCheckScrollUp = true; - } - } - - if (dontCheckScrollUp && dontCheckScrollDown) { - $(treeDivSelector).unbind('scroll'); - } - -} - -var stillInAjaxProgress = false; - -function loadTree(msgID, threadID, jqTarget, findmsg, prepend) { - /* - We are treating the last and first designation differently. when there is a class='last' link, - it means we can still try to find if there is more links in the thread. If there is no class='last', then we reached the end. - - the 'first' designation is only given to the first post. when there is no first in the entire link list, then we can go look for - "previous page" in the tree. - - jqTarget is only used when fetching next page. - */ - - stillInAjaxProgress = true; - - JQCallWebService("ws/Message.aspx/GetTree", - { 'msgID': msgID, 'threadID': threadID, 'findmsg': (findmsg ? findmsg : false), - 'direction': (prepend === true ? 1 : 0)}, - function (rtn) { - var returnedVal = rtn.d; - - var finalLinksHTML = buildTreeHTML(returnedVal); - - if (jqTarget && prepend !== true) jqTarget.removeClass('last'); // there can be more so the 'last' designation is gonna change - - if (finalLinksHTML != '') { - var $treeDiv = $(treeDivSelector); - - if (prepend === true) $treeDiv.prepend(finalLinksHTML); else $treeDiv.append(finalLinksHTML); - if (prepend !== true && returnedVal.length == tm.tpg) $(treeDivASelector + ':last').addClass('last'); //there is still possibility to have more pages - - if (prepend === true) { - // scroll the found msg into view - setTimeout(function () { - var $theFirstLinkBeforeFetch = $(treeDivSelector + ' a#treelink' + msgID.toString()); - $treeDiv.scrollTo($theFirstLinkBeforeFetch, 1000, { margin: true }); - //console.log('new tree scroll'); - $theFirstLinkBeforeFetch.focus(); - }, 1000); - } - - setTimeout(function () { - $treeDiv.css({ 'overflow': 'auto', 'visibility': 'visible' }); - performDateFormat(false); - - JQCallWebService('ws/TrackRead.aspx/GetThreadLastRead', { threadID: threadID }, function (r) { // check read - var referenceDate = new Date(r.d); - $treeDiv.find('.checkDate span.performdateformat').each(function () { - var $this = $(this); - var thisdate = new Date($this.data('date') || cMemberInfo.lastVisit); - - if (thisdate.getTime() - referenceDate.getTime() > 0) { - var id = $this.parent().data('trackmid'); - if (!$('#treelink' + id).hasClass('bold')) - $('#newimg_' + id).attr('src', pageThemeImageURL + 'newestmsg.gif'); - } - }); - }); - - }, 1100); - } - - setTimeout(function () { stillInAjaxProgress = false; }, 2000); - - }, JQOnCallError); -} - -function buildTreeHTML(listdata) { - var linkTemplate = "
      " + - "{3} " + - "{9} {11} {13} " + - "{8} {5} - {6}" + - "
      "; - - var totalLinks = []; - - for (var i = 0; i < listdata.length; i++) { - - var currentMsg = listdata[i]; - // messageID llevel subject msgIcons dateCreated login mem Ignored isAnswer isRewarded moderated Deleted - - totalLinks[totalLinks.length] = String.format(linkTemplate, - currentMsg.messageID, //0 - 15 + 20 * parseInt(currentMsg.llevel), // 1 - pageThemeImageURL + 'mIcons/m' + currentMsg.msgIcons + '.gif', // 2 - currentMsg.subject.replace(//, '>'), //3 - currentMsg.mem, //4 - currentMsg.login, //5 - currentMsg.dateCreated, //6 - ((currentMsg.Ignored == '1') ? 'class="ignored" title="' + ln.ttMemberIgnored + '"' : ''), //7 - ln.byDesc,//8 - ((currentMsg.isRewarded == 1) ? '' + ln.tmIsAnswer + '' : ((currentMsg.isAnswer == 1) ? '' + ln.tmIsHelpful + '' : '')), //9 - ((currentMsg.Deleted == 1) ? 'text-decoration: line-through;' : ''), //10 - ((currentMsg.Moderated == 1) ? '' + ln.tmMessageRequireModerationDesc + '' : ''), //11 - ((currentMsg.llevel == 0) ? 'first' : ''), //12 - ((currentMsg.HasAttachment == 1) ? '' : ''), //13 - pageThemeImageURL - ); - } - - return totalLinks.join(''); -} - -function treeMsgClick(e) { - - //consoleLog('treeMsgClick'); - - var $target = $(this); - - $(treeDivASelector + '.bold').removeClass('bold'); - - $target.addClass('bold'); - - var currMsgID = parseInt($target.attr('id').replace('treelink', '')); - - $('#' + tm.msgTreeHiddenField).val(currMsgID); - - $target.focus(); - - tm.refreshButton.click(); - - if ($target.hasClass('last')) fetchNextTreePage(currMsgID, $target); - - // mark message read: - var id = $target.data('trackmid'); - $('#newimg_' + id).attr('src', pageThemeImageURL + 'blank.gif'); - - return false; -} - -function treeNavigateTo(dir) { // handler for the previous / next link on tm.aspx - - var $currMsgLink = $(treeDivASelector + '.bold:first'); - - if (dir == 'next') { - - var $next = $currMsgLink.parent().next().find('a.msg'); - - if ($next.length == 0) { - signalTreeState('last'); - } else { - $next.click(); - } - - } else { - - var $prev = $currMsgLink.parent().prev().find('a.msg'); - - if ($prev.length == 0) { - signalTreeState('first'); - } else { - $prev.click(); - } - } - -} - -function treeReload(msgID) { - //consoleLog('treeReload ' + msgID); - - if (isNaN(msgID)) { - msgID = parseInt($(treeDivASelector + '.bold:first').attr('id').replace('treelink', '')); - } - - signalTreeState('loading'); - $(treeDivSelector).html('').css({'visibility' : 'visible' }); - performFindMsg(msgID, true); -} - -function fetchNextTreePage(currentMsgID, jqTarget) { - loadTree(currentMsgID, currentThreadID, jqTarget); - //consoleLog('ln359'); -} - -function signalTreeState(state) { - - var signal = '
      ' - var finalStringSelector = 'div#treePrevNextLinks div.endOfTreeNotice'; - var treePrevNextLinkSelector = 'div#treePrevNextLinks'; - - if ($(finalStringSelector).size() == 0) { - $(signal).prependTo(treePrevNextLinkSelector); - } - - var $finalString = $(finalStringSelector); - - $finalString.text(function() { - return ((state == 'first') ? ln.tmReachFirstInTreeDesc : ((state == 'last') ? ln.tmReachLastInTreeDesc : ln.loadingDesc)); - }) - .css({ - 'top': function() { - var $treeDiv = $(treeDivSelector); - var finalTop = '-' + ($(treePrevNextLinkSelector).offset().top - ($treeDiv.offset().top + $treeDiv.height()) + ($treeDiv.height() / 2)).toString() + 'px'; - return finalTop; - } - , - 'left': function() { - var finalLeft = ($(treeDivSelector).width() - $finalString.width()) / 2; - return finalLeft.toString() + 'px'; - } - }) - .fadeIn('normal', function() { setTimeout(function() { $finalString.fadeOut(); }, ((state == 'loading') ? 750 : 1500)); }); -} - -function treeProcessAfterDelete() { - - var $firstLinkInTree = $(treeDivASelector).eq(0); - - if ($firstLinkInTree.hasClass('bold') && $firstLinkInTree.hasClass('first')) { // topic message deleted - - self.location.replace(cPathInfo.ForumDir + 'tt.aspx?forumID=' + currentForumID.toString()); - //console.log('self.location.replace'); - } else { - - var $prevLink = $(treeDivASelector).filter('.bold').parent().prev().children('a.msg'); - var msgID = parseInt($prevLink.attr('id').replace('treelink', '')); - //console.log('deleted msgID = ' + msgID.toString()); - treeReload(msgID); - } - -} -var _previewContent, _previewInterval, _previewIntervalMs = 5000; - -function openPreview(manual) { - - var upfileValue = _.isUndefined(window.postingInterface) ? '' : window.postingInterface.attInfo.attachmentKey; - - var msgContent = getEditorContent(); - var editorDim = getEditorDimension(); - - var $previewDiv = $('#previewdiv'); - var $previewContent = $previewDiv.find('.previewcontent'); - - if (manual) { - $.scrollTo($previewDiv); - $previewContent.show(); - } - - if (_previewContent == msgContent || (!manual && !$previewContent.is(':visible'))) return false; - - window.clearInterval(_previewInterval); - - JQCallWebService("ws/Message.aspx/Preview", - { message: msgContent, attachmentID: upfileValue, forPage: getForPage() }, - function (r) { - - $previewContent.html(r.d); - $previewContent.css({ 'max-height': editorDim.h, 'padding': '10px' }); - $previewDiv.css('width', editorDim.w); - $previewDiv.fadeIn(); - - if (manual) { - $.scrollTo($previewDiv); - } - //$previewContent.scrollTo({ top: 0, left: 0 }, { duration: 0 }); - //$previewContent.effect('highlight', {}, 1500); - - var imgTmpl = ''; - - var $allAttachedImg = $previewContent.find('span.mceNonEditable'); - - for (var i = 0; i < $allAttachedImg.length; i++) { - var $attached = $allAttachedImg.eq(i); - var attachedText = $attached.text(); - var imgIndex = window.postingInterface.attachmentsArray[attachedText]; - $attached.replaceWith( - String.format(imgTmpl, cPathInfo.ForumDir, imgIndex, upfileValue, - (wysiwygHelper.forPage == 1 ? 'msg' : (wysiwygHelper.forPage == 2 ? 'pm' : 'event')), attachedText)); - } - - _previewContent = msgContent; - startPreviewInterval(); - }); - - return false; -} - -function getForPage() { - if (typeof tinyMCE != 'undefined') { //WYSIWYG - return wysiwygHelper.forPage; - } else { // textbox - return wysiwygAsTextarea.forPage; - } -} - -function getEditorDimension() { - var editorWidth, editorHeight; - - if (typeof tinyMCE != 'undefined') { //WYSIWYG - var $mceLayout = $('table.mceLayout'); - editorWidth = $mceLayout.width(); - editorHeight = $mceLayout.find('td.mceIframeContainer').height(); - - } else { // textbox - var $editor = $(wysiwygAsTextarea.TextareaSelector); - editorWidth = $editor.width(); - editorHeight = $editor.height(); - } - - return { w: editorWidth, h: editorHeight }; -} - -function regPreviewToggleClick() { - $('#previewdiv').on('click', 'a.toggler', function () { - - var $link = $(this); - var $previewContent = $('div.previewcontent'); - - $previewContent.slideToggle('fast', function () { - var isContentOpen = $previewContent.is(':visible'); - var innerHtml = ln.buttonPreviewValue + ' ' + - (isContentOpen ? ln.entUpArrow : ln.entDownArrow); - $link.html(innerHtml); - - if (isContentOpen) openPreview(false); // not from the buttons, so false - }); - - return false; - }); -} - -var _previewIni = false; -var _previewAutoStart = false; - -function displayPreviewDiv() { // called in NewRTECustomJS.js - if (_previewIni) return; - var $previewDiv = $('#previewdiv'); - var editorDim = getEditorDimension(); - - $previewDiv.css('width', editorDim.w).fadeIn(); - _previewContent = ''; // prevent sending of blank initially to preveiw - - if (_previewAutoStart) { - setTimeout(function () { $previewDiv.find('a.toggler').trigger('click'); }, _previewIntervalMs); - startPreviewInterval(); - } - - _previewIni = true; -} - -function startPreviewInterval() { - _previewInterval = setInterval(function () { openPreview(false); }, _previewIntervalMs); -} - -$doc.ready(function () { - regPreviewToggleClick(); - - if (typeof wysiwygAsTextarea != 'undefined') { // tinyMCE's focus handler defined in NewRTECustomJS - $(wysiwygAsTextarea.TextareaSelector).one('focus', function () { - displayPreviewDiv(); - }); - } else { - var previewIni = - setInterval(function () { - if (typeof tinyMCE != 'undefined') { - - tinyMCE.activeEditor.onMouseUp.add(displayPreviewDiv); - tinyMCE.activeEditor.onKeyDown.add(displayPreviewDiv); -/* - tinyMCE.activeEditor.onChange.add(function () { - openPreview(false); - }); -*/ - - setTimeout(function () { - window.clearInterval(previewIni); - }, 500); - - } - }, 1000); - - } -}); - -$doc.ready(function () { - api_init(); -}); - -var _api_init = false; - -function api_init(forcedExec) { - if (!forcedExec && _api_init) return; - api_registerSignupbox(); - api_registerAlternativeLoginLinks(); - api_registerPollIndividualVote(); - //consoleLog('api_init'); - _api_init = true; -} - -var _onsiteApi_qtipNoticeOption = { position: { at: 'middle right', my: 'middle left', adjust: { x: 2} }, hide: { inactive: 3000} }; - -function api_registerPollIndividualVote() { - var $surveyDiv = $('div.api_surveybox'); - - if (!$surveyDiv[0]) return; - - _api_loadSurvey($surveyDiv); - - $body.on('click', '.castvote', function () { - var $btn = $(this); - var $api_box = $btn.closest('.api_surveybox'); - - var $polls = $api_box.find('div.voteInterface'); - var atLeastOneSubmitted = false; - var submittedCount = 0; - for (var i = 0; i < $polls.length; i++) { - var $poll = $polls.eq(i); - - var $checkedBoxes = $poll.find('input[type=checkbox]:checked'); - var $radio = $poll.find('input[type=radio]:checked'); - var votes = []; - - if ($checkedBoxes[0]) { - $checkedBoxes.each(function () { - votes.push($(this).val()); - }); - } else if ($radio[0]) { - votes.push($radio.val()); - } - - if (votes.length == 0) continue; - - submittedCount += 1; - - atLeastOneSubmitted = true; - - JQCallWebService('ws/Poll.aspx/CastVote', { pollID: $poll.data('pollid'), votes: votes }, function (r) { - - if (r.d) { - - } - }, JQOnCallError); - - } - - if (atLeastOneSubmitted) { - $btn.effect('highlight', submittedCount * 400); - - setTimeout(function () { - _api_loadSurvey($surveyDiv); - $btn.hide(); - }, submittedCount * 300); - } - - return false; - }); -} - -function _api_loadSurvey($surveyDiv) { - var pollids = $surveyDiv.data('pollids'); - - $('
      ').load(cPathInfo.ForumDir + 'ws/Poll.aspx?pollid=' + pollids + ' #AllPolls div', function (r) { - var $div = $(this); - - $div.find('.voteResultRow, .voteBtnRow').remove(); - $div.find('.voteresultHead').removeClass('center'); - $div.find('.voteresults td').css('border-bottom', '1px dashed #DDD'); - - $surveyDiv.find('div:first').replaceWith($div); - - if ($surveyDiv.find('input')[0]) - $surveyDiv.find('.castvote').show(); - - $surveyDiv.show(); - - }); -} - -function api_registerSignupbox() { - var $signupDiv = $('div.api_signupbox'); - - if (!$signupDiv[0]) return; - - if (cMemberInfo.memID != -1) { - $signupDiv.remove(); - return; - } else { - $signupDiv.show(); - } - - var $1stsignupdiv = $signupDiv.eq(0); - - var $name = $1stsignupdiv.find('input.signup_name'); - var $email = $1stsignupdiv.find('input.signup_email'); - var $pass = $1stsignupdiv.find('input.signup_pass'); - var $cptaimg = $1stsignupdiv.find('img.signup_cptaimg'); - var $cpta = $1stsignupdiv.find('input.signup_cptainput'); - var $signupbutton = $1stsignupdiv.find('.signup_button'); - - $cpta.focus(function () { - _api_resetCaptcha($cptaimg, $cpta); - }); - - $signupbutton.click(function () { - - var neededFields = [$name, $email, $pass, $cpta]; - - if (_api_requiredFieldFailedNotice(neededFields)) return false; - - var data = {}; - data.username = $name.val(); - data.email = $email.val(); - data.pass = ($pass[0] ? $pass.val() : ''); - data.captchaVal = ($cpta[0] ? $cpta.val() : ''); - - JQCallWebService('ws/Login.aspx/RegisterUser', data, function (r) { - //{.Success, .SuccessResponse, .FailedReason, .NewMemberID, .RegStatus, .RegisterResult} - var regResult = r.d; - - if (regResult.RegisterResult == 0 && regResult.NewMemberID > 0) { - - if (regResult.SuccessRedirectTo != '') { - self.location.href = regResult.SuccessRedirectTo; - return true; - } - - var handleOk; - - if (regResult.RegStatus == 0) { - handleOk = function () { - self.location.reload(); - }; - - } else { - handleOk = function () { - _api_blankOutAllInput(neededFields); - }; - } - - qtip.confirm(regResult.SuccessResponse, ln.buttonSubmitValue, '', '', handleOk); - - } else { - var $noticeEle = (regResult.RegisterResult == 1 ? $name : - (regResult.RegisterResult == 2 ? $email : (regResult.RegisterResult == 3 ? $signupbutton : $cpta))); - - qtip.notice($noticeEle, regResult.FailedReason, _onsiteApi_qtipNoticeOption); - - if ($noticeEle.prop('tagName') == 'INPUT') { - $noticeEle.val(''); - }; - - } - - _api_resetCaptcha($cptaimg, $cpta); - - }); - - return true; - }); - - $signupDiv.filter(':gt(0)').remove(); -} - -function _api_requiredFieldFailedNotice($fields) { - var failed = false; - for (var i = 0; i < $fields.length; i++) { - if ($fields[i][0] && $fields[i].val().trim() == '') { - failed = true; - qtip.notice($fields[i], ln.warnRequiredDesc, _onsiteApi_qtipNoticeOption); - } - } - return failed; -} - -function _api_resetCaptcha($img, $input) { - $img.attr('src', pageThemeImageURL + 'CaptchaImage.axd?p=' + randomString(5)); - $input.val(''); -} - -function _api_blankOutAllInput($fields) { - for (var i = 0; i < $fields.length; i++) { - if ($fields[i][0]) { - $fields[i].val(''); - } - } -} - -function api_registerAlternativeLoginLinks() { - var $topLoginLink = $('#subnav-login'); - - if (!$topLoginLink[0]) return; - - $('a.clickToOpenLogin') - .html($topLoginLink.html()) - .click(function () { - $topLoginLink.triggerHandler('click'); //, - //[$(this), { position: { my: 'bottom right', at: 'top right', adjust: { y: -15}}}]); - return false; - } - ); -} - -function CreateMemberMenu($dataLink, $div) { - var isownpost = $dataLink.data('isownpost'), - login = $dataLink.data('login'), - isfriend = $dataLink.data('isfriend'), - isignored = $dataLink.data('isignored'), - viewerisguest = $dataLink.data('viewerisguest'), - showpmlink = $dataLink.data('showpmlink'), - isrecycled = $dataLink.data('isrecycled'), - canTempBan = $dataLink.data('tempban'), - messageID = $dataLink.data('messageid'), - ip = $dataLink.data('ip'), - mem = $dataLink.data('mem'), - isguest = (mem == -1); - - var str = '
        '; - - var friendBlockTempl = '
      • {1}
      • '; - - if (!isownpost && !viewerisguest && !isfriend && !isguest) - str += String.format(friendBlockTempl, mem, ln.tmMenuAddFriend, 'friend'); - - if (!isownpost && !viewerisguest && !isguest) { - - var blockItemText = isignored ? ln.tmMenuUnblock : ln.tmMenuBlock; - var blockItemCommand = isignored ? 'unignore' : 'ignore'; - - str += String.format(friendBlockTempl, mem, blockItemText, blockItemCommand); - } - - if (!isownpost && !viewerisguest && showpmlink && !isguest) { - var gotoURL = cPathInfo.ForumDir + 'pmsend.aspx?toMemId=' + mem; - var onclick = ''; - - if (cMemberInfo.popupPosting) { - onclick = String.format('popRadWin(\'{0}&pop=true\'); return false;', gotoURL); - } - - str += String.format('
      • {1}
      • ', gotoURL, ln.tmMenuSendPM, onclick); - } - - if (!isignored && !isrecycled && !isguest) - str += String.format('
      • {1}
      • ', - cPathInfo.ForumDir + 'posts/' + escape(login), ln.profRecentPosts); - - if (canTempBan && mem != 0 && !isguest) - str += String.format('
      • {1}
      • ', - messageID, ln.tmMenuTempBan); - - if (ip) - str += String.format('
      •  
      • {0}
      • ', ip); - - str += '
      '; - - $div.append(str); - - $div.on('click', 'a', function () { - setTimeout(function() { $div.remove(); }, 100); - }); -} - -$doc.ready(function () { - setupBottomBreadCrumb(); - - if (cMemberInfo.usingMobileTheme || cMemberInfo.isMobileDevice) return; - - var totalSize = $('div.breadcrumb a').size(); - // select the breadcrumb a items first, and on mouseover of the links, produce - // the lorder value from the select menu - - if (totalSize <= 1) return; // error handling when only All Forums is present - - var timeout; - - $('div.breadcrumb').on('mouseenter', '.breadcrumbitem', function () { - var $link = $(this); - - if (!$link.data('dropdown')) return false; - - timeout = setTimeout(function () { - var theLinkText = $link.text().trim(); - - var $theSelectMenuOptions = $('select[id$=ForumJumpMenu]').children('option'); - - //now first of all, get the lorder - var theLorderForCurrent; - - $theSelectMenuOptions.each(function () { - if (this.text.trim().endsWith(theLinkText)) { - theLorderForCurrent = $(this).attr('lorder'); - return false; - } - }); - - if (typeof theLorderForCurrent == "undefined") return true; // error handling - - //now collect a list of related by take away last 3 digits, and find those who starts the remaining and with same length; - var parentLorder = theLorderForCurrent.substr(0, (theLorderForCurrent.length - 3)); - - var $theOptionsCollections = $theSelectMenuOptions.filter(function (i) { - var $option = $(this); - var lorder = $option.attr('lorder'); - if (typeof lorder == "undefined") return false; - return (lorder.startsWith(parentLorder) && lorder.length == theLorderForCurrent.length && !$option.get(0).text.endsWith(theLinkText)); - }); - - if ($theOptionsCollections.length == 0) return false; - - $link.qtip({ - overwrite: false, - content: { text: createLinksFromOptions($theOptionsCollections) }, - position: { my: 'top left', at: 'bottom left', adjust: { y: 5} }, - show: { event: 'mouseenter', ready: true }, - hide: { fixed: true, delay: 200, event: 'mouseleave' }, - style: { tip: false, classes: 'qtip-apgsmallmenu qtip-shadow' } - }); - - }, 100); - - }).on('mouseleave', '.breadcrumbitem', function () { clearTimeout(timeout); }); - -}); - -function createLinksFromOptions($options) { - var val = '
        '; - - for (var i = 0; i < $options.length; i++) { - var link = $options.get(i); - val += '
      • ' + String.format('{1}
      • ', - link.value, link.text.replace(/^(\-\s)+/gi, '')); - } - - return val + '
      '; -} - -function setupBottomBreadCrumb() { // this is using add_load due to the use of drop down menu on the breadcrumb; - $('#bottomItemsConsolidator').before($('div.breadcrumb:first').parent().html()).css('min-height', '30px'); - $('div.breadcrumb:last').addClass('altItem').css({ 'padding': '8px 10px', 'border-bottom': '0' }); -} -(function (c) { c.fn.rating = function (h) { var d = { showCancel: !0, cancelValue: null, cancelTitle: "Cancel", startValue: null, disabled: !1 }, e = { hoverOver: function (a) { a = c(a.target); a.hasClass("ui-rating-cancel") ? a.addClass("ui-rating-cancel-full") : a.prevAll().addBack().not(".ui-rating-cancel").addClass("ui-rating-hover") }, hoverOut: function (a) { a = c(a.target); a.hasClass("ui-rating-cancel") ? a.addClass("ui-rating-cancel-empty").removeClass("ui-rating-cancel-full") : a.prevAll().addBack().not(".ui-rating-cancel").removeClass("ui-rating-hover") }, click: function (a) { var b = c(a.target), f = d.cancelValue; b.parents(".content-box-content:first").removeClass("formerror"); b.hasClass("ui-rating-cancel") ? e.empty(b, b.parent()) : (b.closest(".ui-rating-star").prevAll().addBack().not(".ui-rating-cancel").prop("className", "ui-rating-star ui-rating-full"), b.closest(".ui-rating-star").nextAll().not(".ui-rating-cancel").prop("className", "ui-rating-star ui-rating-empty"), b.siblings(".ui-rating-cancel").prop("className", "ui-rating-cancel ui-rating-cancel-empty"), f = b.val()); a.data.hasChanged || c(a.data.selectBox).val(f).trigger("change") }, change: function (a) { var b = c(this).val(); e.setValue(b, a.data.container, a.data.selectBox) }, setValue: function (a, b, d) { var g = { target: null, data: {} }; g.target = c(".ui-rating-star[value=" + a + "]", b); g.data.selectBox = d; g.data.hasChanged = !0; e.click(g) }, empty: function (a, b) { b.find(".ui-rating-star").removeClass("ui-rating-full"); b.find(".ui-rating-star").addClass("ui-rating-empty"); a.prop("className", "ui-rating-cancel ui-rating-cancel-empty").nextAll().prop("className", "ui-rating-star ui-rating-empty") } }; return this.each(function () { var a = c(this), b, f; "select-one" !== this.type || a.prop("hasProcessed") || (h && c.extend(d, h), a.hide(), a.prop("hasProcessed", !0), b = c("
      ").prop({ title: this.title, className: "ui-rating" }), a.children("option").each(function () { if ("" != this.value) { var a = c(""); a.prop({ className: "ui-rating-star ui-rating-empty", title: c(this).text(), value: this.value }).appendTo(b); c(this).is(":selected") && a.prevAll().addBack().removeClass("ui-rating-empty").addClass("ui-rating-full") } }), !0 == d.showCancel && c("").prop({ className: "ui-rating-cancel ui-rating-cancel-empty", title: d.cancelTitle }).appendTo(b), 0 !== a.children("option:selected").size() ? e.setValue(a.val(), b, a) : (f = null !== d.startValue ? d.startValue : d.cancelValue, e.setValue(f, b, a), a.val(f)), !0 !== d.disabled && !0 !== a.prop("disabled") ? b.bind("mouseover", e.hoverOver).bind("mouseout", e.hoverOut).bind("click", { selectBox: a }, e.click) : b.find("a").css("cursor", "not-allowed"), b.insertAfter(a), a.bind("change", { selectBox: a, container: b }, e.change)) }) } })(jQuery); -/*prettifier_~/js/prettifier/prettify.js~/js/prettifier/lang-vb.js~/js/prettifier/lang-sql.js~/js/prettifier/lang-css.js_key*/ +} + +function searchHighlight() { + var qs = getQueryString(ASPPG_searchQuery); + var highlitewords = (qs) ? qs.trim() : ''; + + highlitewords = highlitewords.replace(document.location.hash, ''); + + if (typeof highlitewords != 'undefined' && highlitewords != '') { + var wordList = highlitewords.replace(/\s/gi, ',').split(','); + var nodes = $(".msg, .excerpt"); + + for (var j = 0; j < nodes.length; j++) { + highlightWord(nodes[j], highlitewords); + + for (var i = 0; i < wordList.length; i++) { + highlightWord(nodes[j], wordList[i]); + } + } + } +} + +$doc.ready(function () { searchHighlight(); }); + + + function RegisterMsgSideHover() { + + if (cMemberInfo.usingMobileTheme || cMemberInfo.isMobileDevice) return; + + $body.on('mouseenter', 'div.msgcontent', function () { + + var winHeight = $win.height(), distanceToShowFactor = 1.5; + var $msgside = $(this); + + if ($msgside.height() < (winHeight * distanceToShowFactor)) return false; + + var $btnsPanel = $msgside.find('.msgButtonsPanel'); + var fixedClass = 'halfhidden'; + + if ($btnsPanel.hasClass(fixedClass)) return false; + + var btnOffset = $btnsPanel.offset(); + + if ($win.scrollTop() + (winHeight * distanceToShowFactor) <= btnOffset.top) { + + var $fixPanel = $btnsPanel.clone(); + + $fixPanel.addClass(fixedClass).css({ left: btnOffset.left - 5 }).appendTo($msgside); + + $win.bind('scrollstop.btnpanel', function () { + + var winScrollTop = $win.scrollTop(); + + if (winScrollTop + winHeight > btnOffset.top || winScrollTop + winHeight < $msgside.offset().top) { + $fixPanel.remove(); + $win.unbind('scrollstop.btnpanel'); + } + }); + } + + return true; + }); + } + + function RegisterMemberHover() { + + if (cMemberInfo.usingMobileTheme || cMemberInfo.isMobileDevice) return; + + var timeout; + + $body + .on('mouseenter', '.authorcontent a.titlehead', function () { + + var $titleHeadLink = $(this); + + timeout = setTimeout(function () { + + var $parentDiv = $titleHeadLink.closest('div.authorcontent'); + + var $overallDiv = $('
      ').addClass('titleheadHoverDiv'); + + var $div = $('
      ').addClass('titleheadOriginalDiv'); + + $div.html($parentDiv.html()); + $div.find('.msgAuthorInfo').remove(); // full mode + $div.find('.msgStatus').remove(); // essential mode + + $overallDiv.html($div); + + var offset = $parentDiv.offset(); + + $overallDiv.css({ + 'top': (offset.top - 10) + 'px', + 'left': offset.left + 'px' + }); + + $div.css({ + 'width': $parentDiv.width(), + 'height': $parentDiv.height() + 15 - $parentDiv.find('.msgAuthorInfo').height(), // full mode + 'max-width': 250 + }); + + CreateMemberMenu($titleHeadLink, $overallDiv); + + $overallDiv.appendTo('body'); + + }, 500); + + }) + .on('mouseleave', '.authorcontent a.titlehead', function () { + clearTimeout(timeout); + }) + .on('mouseleave', 'div.titleheadHoverDiv', function () { + var $container = $(this); + setTimeout(function () { + $container.detach(); + }, 200); + }); + + } + + var _attachmentImageUrls = []; + var _clickedThumbLink; + function RegisterToolTipAttachmentImages() { + + if (cMemberInfo.usingMobileTheme || cMemberInfo.isMobileDevice) return; + + $body.on('click', '.attachments a.attachedImages', function (e) { + e.preventDefault(); + + _clickedThumbLink = this; + var $this = $(this); + + getImgsIntoArray($this.parent().find('a.attachedImages')); + toolTipWin(produceImgSrc($this)); + + }).on('click', 'img.toolTipWin', function (e) { + e.preventDefault(); + var $thisImg = $(this); + var nextI = findAttachmentIndex($thisImg.attr('src'))[1]; + $thisImg.attr('src', _attachmentImageUrls[nextI].src); + $thisImg.nextAll('.filename').text(_attachmentImageUrls[nextI].filename); + setTimeout(function () { $thisImg.closest('div.qtip').qtip('api').reposition(); }, 100); + + }).on('click', 'a.toolTipExtlink', function () { + var $this = $(this); + $this.attr('href', $this.prev().attr('src')); + + }).on('click', 'a.toolTipRefreshlink', function () { + var $thisImg = $(this).prevAll('img.toolTipWin'); + var src = $thisImg.attr('src'); + var random = randomString(5); + var reloadSrc = src + '&refresh=' + random; + + $thisImg.attr('src', reloadSrc); + + getImgsIntoArray($(_clickedThumbLink).parent().find('.attachedImages'), random); + + }); + + + + $body.on('mousewheel', 'img.toolTipWin', function(e, delta, deltaX, deltaY) { + + e.preventDefault(); + var $thisImg = $(this); + //consoleLog(delta, deltaX, deltaY); + var nextI = findAttachmentIndex($thisImg.attr('src'))[(deltaY < 0 ? 1 : 2)]; + //consoleLog(nextI); + if (_attachmentImageUrls[nextI]) { + $thisImg.attr('src', _attachmentImageUrls[nextI].src); + $thisImg.nextAll('.filename').text(_attachmentImageUrls[nextI].filename); + + setTimeout(function() { $thisImg.closest('div.qtip').qtip('api').reposition(); }, 100); + } + + }); + } + + function getImgsIntoArray($links, random) { + _attachmentImageUrls = []; + + $links.each(function () { + var $thisLink = $(this); + var imgObj = {}; + imgObj.filename = $thisLink.data('filename'); + imgObj.src = produceImgSrc($thisLink) + (random ? '&refresh=' + random : ''); + _attachmentImageUrls[_attachmentImageUrls.length] = imgObj; + }); + } + + function produceImgSrc($link) { + return $link.attr('href') + '&filename=' + $link.data('filename'); + } + + function toolTipWin(url) { + var winSizes = getViewportSize(); + var maxHeight = winSizes[1] - 80; + qtip.pop(url, null, false, true, 7000, + '' + + ' ' + + ' ' + + '
      ', + { + style: { classes: 'qtip-rounded qtip-wideshadow qtip-youtube' }, + position: { effect: false }, + hide: { + event: 'unfocus' + }, + events: { + render: function(event, api) { + $win.bind('keydown', function(e) { + if(e.keyCode === 27) { api.hide(e); } + }); + }, + visible: function (e, api) { + var $this = $(this); + //$this.draggable(); + api.reposition(); + var $thisImg = $this.find('img.toolTipWin'); + var thisI = findAttachmentIndex($thisImg.attr('src'))[0]; + + if (_attachmentImageUrls[thisI]) + $thisImg.nextAll('div.filename').text(_attachmentImageUrls[thisI].filename); + }, + hide: function (e, api) { + api.destroy(); + } + } + }); + } + + function findAttachmentIndex(src) { + var nextI = 0; + var prevI = _attachmentImageUrls.length - 1; + var thisI = 0; + for (var i = 0; i < _attachmentImageUrls.length; i++) { + if (_attachmentImageUrls[i].src == src) { + thisI = i; + if (i != (_attachmentImageUrls.length - 1)) { + nextI = i + 1; + } + if (i != 0) { + prevI = i - 1; + } + break; + } + } + + return [thisI, nextI, prevI]; + } + + function RefreshClick(val, id) { // val: reply / edit; id = msgID + + var setXmlHttpVal = ''; + + switch (val) { + + case 'reply': + // compare CurrentPageRecordCount value, if exceeding mpg, redirect + if (parseInt($get('CurrentPageRecordCount').value) == tm.mpg) { + self.location.href = cPathInfo.ForumDir + 'FindPost/' + id.toString(); + return false; + } else { + setEditorContent(''); + } + case 'edit': + // simply refresh + + default: + + } + + tmRefreshMessageList((tm.inTreeMode ? $get(tm.msgTreeHiddenField).value : setXmlHttpVal)); + + if(typeof id != 'undefined') { + _scrollToMsgId = id; + } + + return false; + } + + function tmRefreshMessageList(val) { + $('#ResultXmlPanel').css('opacity', 0.4); + $find('ResultXmlPanel').set_value(val); + } + + var _scrollToMsgId = 0; + + function afterRefresh() { // called from tm.aspx.vb; also executed on initial load + + var $itemToScrollTo = $('#msg' + _scrollToMsgId.toString()); + if ($itemToScrollTo.length > 0) $.scrollTo($itemToScrollTo); + _scrollToMsgId = 0; + + // update pageLastGenerated - this and in tm.js is the only place where we make such change, + // for marking forum / thread read we cannot rely on server's now() + pageLastGenerated = new Date().addHours(-_userTimeOffset); + + trackMessageRead($('.msgcontent span.msgDate').filter(':not(.none)').children('span.performdateformat'), + function () { var mid = $(this).parent().data('mid'); + return $('#Avatar' + mid.toString()); }); + } + + function changeTmSort(value){ + if (isNaN(value)) return; + SaveSortCookie(value, function (){tm.refreshButton.click();}); + } + + + function reloadParent(arg) { + + if(typeof(arg) == 'string'){ + if (arg == '') { + return; + } + else if (arg == 'true') { + tm.refreshButton.click(); + } + else if (arg == 'del') { + RefreshAfterDelete(); + } + else if (arg == 'reload') { + self.location.replace(cPathInfo.Url); + } + else if (!isNaN(arg)) { + self.location.replace(cPathInfo.ForumDir + 'tt.aspx?forumID=' + arg); + } + + } + + } + + function RefreshAfterDelete() { + $get(tm.msgLastMessageForPostHiddenField).value = '0'; // to force rebinding of the posting interface; + + if (!tm.inTreeMode) { + tm.refreshButton.click(); + } else { + treeProcessAfterDelete(); + } + } + + function qtipPopupCloseHandler() { + reloadParent($(this).data('args')); + } + + function switchMsgDivOnOff(msgID, link) { // called in ItemTemplate.ascx + $(link).parent().fadeOut('fast', function () { + + var $link = $(this); + + if (tm.inEssentialMode) { + $link.closest('.msgtable').find('.msgcontent div').filter('.none').fadeIn('fast'); + } else { + $link.siblings().fadeIn('fast'); + } + }); + + return false; + } + + var multiQuoteIDs = []; + + function AddMultiQuote(msgID) { + + if (isNaN(msgID)) return; + + for (var i =0; i
      ", 'URL'); + } + + function RegisterNextPrevLinkInHeader() {//called directly in tm.aspx + + var html = String.format( + '
      {4} {1}
      ' + + '
      {2} {5}
      ' + + '
      ', + currentThreadID, ln.tmPrevThread, ln.tmNextThread, cPathInfo.ForumDir + 'FindPost/', + ln.entUpArrow, ln.entDownArrow); + + var $nxtprv = $('div.nxtprv'); + + + if (!(cMemberInfo.usingMobileTheme || cMemberInfo.isMobileDevice)) { + var timeout; + + $nxtprv + .on('mouseenter', 'a', function () { + var $link = $(this); + if ($link.data('retrieved')) return; + var linkDir = $link.data('dir'); + timeout = setTimeout(function () { + $link.fadeOut('fast', function () { + JQCallWebService('ws/Message.aspx/GetNextPrev', + { msgID: currentThreadID, dir: linkDir }, + function (r) { + var returnedVal = r.d; + + if (returnedVal.text != '') { + $link.text(returnedVal.text); + $link.attr('href', returnedVal.url); + } else { + $link.attr('href', '#'); + $link.click(function () { return false; }); + qtip.notice($link, ln.NoDataWarning, + { + position: { + my: 'middle ' + (linkDir == 'prev' ? 'left' : 'right'), + at: 'middle ' + (linkDir == 'prev' ? 'right' : 'left') + } + }); + } + + $link.data('retrieved', true); + $link.fadeIn(); + + }, JQOnCallError + ); + }); + + }, 100); + }).on('mouseleave', '.nxtprv a', function () { + clearTimeout(timeout); + }); + } + + $nxtprv.html(html); + } + + function RegisterShowMarkTrack() { + + if (cMemberInfo.usingMobileTheme || cMemberInfo.isMobileDevice) return; + + var additionalOptions = { + style: { classes: 'qtip-apgsmallmenu qtip-shadow' }, + hide: { delay: 600, event: 'unfocus mouseleave' }, + position: { my: 'top right', at: 'bottom right', adjust: { x: -10} }, + events: { + render: function (e, api) { + var $tip = $(this); + $tip.find("a").click(function () { api.hide(); }); + } + } + }; + + var func = function () { + var $mark = $(this); + var $markTrack = $mark.next('span'); + if ($markTrack.hasClass('msgMarkTrack')) { + qtip.notice($mark, + $markTrack.html(), additionalOptions); + + } + }; + + $body.on('mouseenter', '.tmanswered, .tmhelpful', func); + } + + $doc.ready(function () { + if (typeof wysiwygAsTextarea != 'undefined') + wysiwygAsTextarea.TextareaSelector = 'div#postdiv textarea:first'; + + if (cMemberInfo.usingMobileTheme) + $('#postdiv').css({ 'width': '95%', 'margin': '15px auto' }).find('textarea').css('width', '100%'); + }); + + + $doc.ready(function () { + $(tm.refreshButton).click(RefreshClick); + RegisterMsgSideHover(); + RegisterMemberHover(); + RegisterToolTipAttachmentImages(); + RegisterShowMarkTrack(); + RegisterMouseUpTextSelect(); + performOnPageGetScrollTo(); + }); + + function performOnPageGetScrollTo() { + var $initialScrollTo = $('#msg' + document.location.hash.replace('#', '')); + + if ($initialScrollTo[0]) { + + $initialScrollTo + .effect('highlight', {}, 3000) + .find('div.item, div.altItem') + .effect('highlight', {}, 3000); + + $.scrollTo($initialScrollTo); + } + } + + var tmSelectString; + + function RegisterMouseUpTextSelect() { + + if (cMemberInfo.usingMobileTheme || cMemberInfo.isMobileDevice) return; + + $body.bind('mouseup', function() { + if (window.getSelection) { + tmSelectString = window.getSelection().toString(); + } + else if (window.document.selection) { + var rng = window.document.selection.createRange(); + tmSelectString = rng.text; + } + else { + tmSelectString = ""; + } + }); + + } + +var _xmlPanelSel = '#ResultXmlPanel'; +var _oriSearhcIDDataKey = 'orisearchid'; +var _orisearchtermDataKey = 'orisearchterm'; +var _relatedTopicULSel = '#relatedTopicsList'; +var _relatedlnkSel = '#relatedSearch'; +var _relatedResultDivSel = '#relatedTopics'; +var _relatedRecordCount = 10; + +function registerRelatedSearch(on, andExecute) { // registered in footertemplate + var eToHandle = 'click.relatedSearch'; + + if (on) { + + $(_xmlPanelSel).off(eToHandle, _relatedlnkSel).on(eToHandle, _relatedlnkSel, function () { + + var $lnk = $(this); + var orisearchid = $lnk.data(_oriSearhcIDDataKey); + + if (orisearchid != 0) { + getRelatedTopicsBySearchID(orisearchid, $lnk, true); + } else { + + var termInLinkData = $lnk.data(_orisearchtermDataKey); + + var finalSearchString = termInLinkData != '' ? termInLinkData : ProduceSearchPhraseFromString(document.title, 4); + + initiateRelatedTopicSearch(finalSearchString, currentForumID, function (r) { + var result = r.d; //[asyncID, server now, highlight] or [Integer delay, "" ,""] + var aid = result[0]; + + if (aid == 'reentersearch') { + performNoRelatedTopicAction($lnk); + return false; + } else { + showNoticeToFilterSearchbox($lnk, ln.tmRelatedTopicsWaiting); + trackRelatedByAid(aid, result[1], $lnk); + } + + return true; + }, _relatedRecordCount); + } + + return false; + }); + + //if (andExecute) setTimeout(function() { $(_relatedlnkSel).click(); }, 0); + + if (andExecute) { + + setTimeout(function () { + var $link = $(_relatedlnkSel); + + if (!$link[0]) return; + + var relatedLinkOffsetTop = $link.offset().top; + var relatedLinkHeight = $link.height(); + $win.bind('scrollstop.relatedTopics', function () { + + var winScrollTop = $win.scrollTop(); + var visibleLimit = winScrollTop + $win.height(); + + if (visibleLimit > relatedLinkOffsetTop && winScrollTop < (relatedLinkOffsetTop + relatedLinkHeight)) { + $link.data('notip', true); + $link.click(); + $win.unbind('scrollstop.relatedTopics'); + } + + }); + }, 3000); + } + + } else { + + $(_xmlPanelSel).off(eToHandle, _relatedlnkSel).on(eToHandle, _relatedlnkSel, function () { + var $ulRelatedList = $(_relatedTopicULSel); + var $lnk = $(this); + + if ($ulRelatedList.length == 0) { + //consoleLog('from off'); + displayNoRecordNotice($lnk); + } + else { + //$.scrollTo($lnk); + } + + return false; + }); + } +} + +function trackRelatedByAid(aid, beginTime, $lnk) { + var relatedIntval = setInterval(function () { + searchCheckIfComplete(aid, beginTime, function (result) { + switch (result.d) { + case 0: // keep checking + break; + case -1: + clearInterval(relatedIntval); + performNoRelatedTopicAction($lnk); + + break; + default: + clearInterval(relatedIntval); + $lnk.qtip('hide'); + storeRelatedSearchResults(result.d, function () { + getRelatedTopicsBySearchID(result.d, $lnk, false); + }); + break; + } + }); + }, 1000); +} + +var _relatedSearchRedoCount = 0; + +function getRelatedTopicsBySearchID(searchID, $lnk, fromStorage) { + + //consoleLog(String.format('searchID: {0}, fromStorage: {1}', searchID, fromStorage)); + + var ws = 'Message.aspx/RetrieveRelatedTopics'; + var ajaxData = { threadID: currentThreadID, top: _relatedRecordCount }; + + JQCallWebService('ws/' + ws, ajaxData, function (r) { + var sResults = r.d; + + var lis = ''; + for (var s = 0; s < sResults.length; s++) { + + var sResult = sResults[s]; + + if (currentThreadID == sResult.MessageID) + continue; + + lis += String.format('
    • ', + cPathInfo.ForumDir, sResult.MessageID, sResult.Subject, + (Modernizr.borderimage ? '' : '')); //Modernizr.borderimage as a test for IE all versions + } + + if (lis == '') { // no data + + if (fromStorage && sResults.length == 0) { // re-search from subject + + if (_relatedSearchRedoCount == 0) { + $lnk.data(_oriSearhcIDDataKey, 0); // removed the data so that we can re-search + $lnk.click(); + _relatedSearchRedoCount += 1; + } + + } else { + performNoRelatedTopicAction($lnk); + } + + } else { + + var $relatedResultDiv = $(_relatedResultDivSel); + + $relatedResultDiv + .find('ul') + .replaceWith('
        ' + lis + '
      ') + .end().fadeIn(); + + $lnk.toggleClass('relatedTopics', true); + + registerRelatedSearch(false); + } + + }, JQOnCallError); +} + +function performNoRelatedTopicAction($lnk) { + registerRelatedSearch(false); + displayNoRecordNotice($lnk); +} + +function displayNoRecordNotice($lnk) { + + var $relatedDiv = $(_relatedResultDivSel); + + $relatedDiv.show() + .find('ul') + .attr('id', _relatedTopicULSel.replace('#', '')) + .html('
    • ' + ln.tmRelatedTopicsNotFound + '
    • '); + + $lnk.toggleClass('relatedTopics', true); +} + +function storeRelatedSearchResults(searchID, callback) { // searchID = 0 =deleteonly + //this performs 2 functions: 1) cache search results 2) if search results are fewer than 15, perform tag search + JQCallWebService('ws/Message.aspx/StoreRelatedSearch', + { msgID: currentThreadID, searchID: searchID, top: _relatedRecordCount }, + ($.isFunction(callback) ? callback : null), JQOnCallError); +} + +function registerRelatedCustomization() { + var $lnk = $(_relatedlnkSel); + var $tip; + + $(_xmlPanelSel).on('click', '#relatedCustomization', function () { + + var orisearchterm = $lnk.data(_orisearchtermDataKey); + + $tip = + qtip.prompt($(this), 450, ln.tmRelatedTopicsCustomize, + (orisearchterm != '' ? orisearchterm : ProduceSearchPhraseFromString(document.title, 4)), + ln.buttonUpdateValue, '', function (val) { + registerRelatedSearch(true); + + $lnk + .data('notip', false) + .data(_oriSearhcIDDataKey, 0) + .data(_orisearchtermDataKey, val) + .click(); + + $tip.qtip('hide'); + }, null, {position:{at: 'top right'}}); + + return false; + }); + +} + +$doc.ready(function () { + registerRelatedCustomization(); +}); + +function essentialModeToggle(on) { + // Save to database by calling WS + JQCallWebService( + 'ws/MessageList.aspx/SaveReadingPreference', + { essentialsOnly: on, isThread: false }, + function () { tm.refreshButton.click(); }, + JQOnCallError); + + return false; +} + +function quickQuote(msgID) { + + var $postDiv = $('#postdiv'); + + if ($postDiv.length==0) { + self.location.href = cPathInfo.ForumDir + 'post.aspx?quote=true&messageID=' + msgID; + return false; + } + + $get(tm.msgLastMessageForPostHiddenField).value = msgID; + + JQCallWebService("ws/Message.aspx/QuickQuote", + { msgID: msgID }, + function (r) { + if (typeof tinyMCE != 'undefined') { //WYSIWYG + tinyMCE.activeEditor.insertHtml(r.d.WYSIWYG); + tinyMCE.activeEditor.getBody().scrollTop = 0; + + } else { // textbox + $(wysiwygAsTextarea.TextareaSelector).val(r.d.Text); + } + $.scrollTo($postDiv); + }); + + return false; +} + +function quickReplyAjax() { + + var draftId = parseInt($get(autoSave.ClientID).value) || 0; + + var $captchaControl = $('input[name$="captcha$txt"], input[id=recaptcha_response_field]').first(); + var captcha = $captchaControl.val() || ''; + + var $reCaptchaChallenge = $('input[id=recaptcha_challenge_field]'); + var challenge = $reCaptchaChallenge.val() || ''; + + JQCallWebService("ws/Message.aspx/QuickReply", + { toMessageId: parseInt($get(tm.msgLastMessageForPostHiddenField).value), + draftId: draftId, + body: getEditorContent(), + attachmentID : '', + captchaVal: captcha, + challenge: challenge + }, + function (r) { + var returnedVal = r.d; + switch (returnedVal.returnCode) { + + case 0: + + KillSolutionOnlyCookie(); + $('#previewdiv').hide(); + window.clearInterval(_previewInterval); // defined in preview.js + + if (returnedVal.requiresApproval) { + sendFailureAlert(ln.postResultPendingApprovalDesc, 1500); + setTimeout(function() { self.location.replace(self.location.href); }, 3000); + } else { + setEditorContent(''); + + if (tm.inTreeMode) { + treeReload(returnedVal.newMsgID); + } else { + RefreshClick('reply', returnedVal.newMsgID); + } + + } + break; + + default: + ///condensed all error messages here + var alerts = ['', + ln.postResultFailedFloodDesc, + ln.postResultFailedTopicLockedDesc, + ln.RightViolationMessage, + ln.formVerificationFailureMsg, + ln.warnRequiredDesc, + ln.postResultFailedExceedsPerDay]; + + sendFailureAlert(alerts[Math.abs(returnedVal.returnCode)]); + break; + } + + if ($captchaControl.length == 1) { + $captchaControl.next('img').click(); + if (typeof Recaptcha != 'undefined') Recaptcha.reload(); + if (returnedVal.returnCode != 0) $captchaControl.focus(); + } + } + ); +} + +function sendFailureAlert(txt, ms) { + popTip(txt, null, true, false, ms || 4000); +} + +function SaveSortCookie(sortDir, action) { + JQCallWebService('ws/Message.aspx/SaveSortCookie', { sortDir: sortDir }, function () { + if ($.isFunction(action)) action.call(); + }, JQOnCallError); +} + +function SaveSolutionOnlyCookie(action) { + JQCallWebService('ws/Message.aspx/SaveSolutionPreferenceCookie', { msgID: currentThreadID }, function () { + if ($.isFunction(action)) action.call(); + }, JQOnCallError); +} + +function KillSolutionOnlyCookie(action) { + JQCallWebService('ws/Message.aspx/DeleteSolutionOnlyCookie', {}, function () { + if ($.isFunction(action)) action.call(); + }, JQOnCallError); +} + +var JQMenuLink; +var OptionalMenu; + +function threadReadToggle(linkSelf, read) { + $(linkSelf).css('cursor', 'progress'); + + var data = { threadID: currentThreadID }; + + if (read) data.mark = pageLastGenerated.format('s'); + + JQCallWebService("ws/TrackRead.aspx/" + (read ? 'MarkThreadRead' : 'MarkThreadUnRead'), data, + function (r) { + setTimeout(function () { $(linkSelf).css('cursor', 'pointer'); }, 200); + if (!r.d && !read) { qtip.alert(ln.tmOptionMarkUnReadUnAvailable); } + } + + ); + + return false; +} + +function markApproval(msg, linkSelf) { + + $(linkSelf).css('cursor', 'progress'); + + JQCallWebService("ws/Management.aspx/ApproveMessage", { msgIDs: [msg] }, + function(rtn) { + var returnedResult = rtn.d; + if (returnedResult === true) { + if (msg == currentThreadID) { + self.location.replace(self.location.href.replace(location.hash, '')); + } else { + tm.refreshButton.click(); + } + } + }, JQOnCallError); + +} + +function tmRestoreMessage(msgID) { + var d = {}; + d.msgIDs = [msgID]; + tmCallManagementWS('RestoreMessage', d); + return false; +} + +function tmRecycleMessage(msgID, isPostOwner) { + var d = {}; + d.msgIDs = [msgID]; + d.reason = ''; + + deleteRecycleConfirmBox('RecycleMessage', d, isPostOwner); + return false; +} + +function tmDeleteMessage(msgID, isPostOwner) { + var d = {}; + d.msgIDs = [msgID]; + d.deleteBranch = false; + deleteRecycleConfirmBox('DeleteMessage', d, isPostOwner); + return false; +} + +function deleteRecycleConfirmBox(wsMethod, data, isPostOwner) { + data.sendMail = false; + qtip.confirm(ln.deleteMessageWarning, + ln.buttonSubmitValue, (isPostOwner ? '' : ln.buttonSubmitNotifyValue), ln.buttonCancelValue, + function () { tmCallManagementWS(wsMethod, data); }, + function () { data.sendMail = true; tmCallManagementWS(wsMethod, data); }); +} + +function tmCallManagementWS(method, data) { + JQCallWebService('ws/Management.aspx/' + method, data, + function (rtn) { + var returnedResult = rtn.d; + + if (returnedResult === true) { + + if (method == 'DeleteMessage' && data.msgIDs[0] == currentThreadID) { + // delete thread must redirect to forum + self.location.replace(cPathInfo.ForumDir + 'tt.aspx?forumid=' + currentForumID.toString()); + } else { + RefreshAfterDelete(); + } + + + } + + }, JQOnCallError); + +// consoleLog(method); +// consoleLog(data); +} + +function markHelpful(msgID, self) { + $(self).css('cursor', 'progress'); + ajaxMarkHelpfulRewardRequest(msgID, false); +} + +function markAnswer(msgID, self) { + $(self).css('cursor', 'progress'); + ajaxMarkHelpfulRewardRequest(msgID, true); +} + +function ajaxMarkHelpfulRewardRequest(msgID, markAsAnswer) { + JQCallWebService("ws/Management.aspx/MarkMessageHelpful", + { msgID: msgID, markAsAnswer: markAsAnswer }, + function(rtn) { + var returnedResult = rtn.d; + if (returnedResult === true) tm.refreshButton.click(); + }, JQOnCallError); +} + +function findRewardMsg(msg) { + + var $rewardMsg = $('.rewardMsg'); + + if ($rewardMsg.length>0) { + $.scrollTo($rewardMsg); + return; + } + + JQCallWebService("ws/Message.aspx/FindRewardMsg", { 'msgID': msg }, + function(rtn) { + var returnedMsgID = rtn.d; + + if (returnedMsgID == 0) return; + + if ($get(returnedMsgID)) { + $.scrollTo($get(returnedMsgID)); + } else { + self.location.href = cPathInfo.ForumDir + 'FindPost/' + returnedMsgID; + } + }, + JQOnCallError + ); + +} + +function listSolution(msgID, bool, self) { + + $(self).css('cursor', 'progress'); + + var func = function() { + if (!tm.inTreeMode) + tm.refreshButton.click(); + else + self.location.replace(cPathInfo.Url); + }; + + if (bool) { + SaveSolutionOnlyCookie(func); + } else { + KillSolutionOnlyCookie(func); + } + + return false; + // maybe a scroll to first solution after postback is complete? +} + +function scrollToFirstReply() { // called in tm.aspx.vb + $.scrollTo($('.msgRepliesDiv').get(0)); +} + + +function MarkFriendOrIgnore(cmd, userid, self) { + + $(self).css('cursor', 'progress'); + + JQCallWebService("ws/Contact.aspx/MarkFriendOrIgnore", { command: cmd, contactID: userid }, + function (rtn) { + var returnedResult = rtn.d; + if (returnedResult == 'success') { + tm.refreshButton.click(); //refreshButton must be defined on pages that calls this method (Page that contains RadMenu) + } + }); + +} + + +function RegisterRatingControl() { + + $('select.ratingSelect') + .rating({ showCancel: false }) + .bind('change.ajaxhandle', HandlerRatingBegin); + + $body + .off('click.ajaxhandle', 'a.thumb') + .on('click.ajaxhandle', 'a.thumb', HandlerRatingBegin); + + $('a.thumbdisabled').fadeTo(300, 0.25); +} + +function HandlerRatingBegin() { + var $ratingTool = $(this); + + var msgID = parseInt($ratingTool.attr('id').replace(/[^\d]/gi, '')); + var rating; + + if (this.tagName.toLowerCase() == 'select') { + rating = parseInt($ratingTool.val()); + } + else { + rating = ($ratingTool.hasClass('up')) ? 1 : -1; + } + + JQCallWebService("ws/Message.aspx/RateMessage", { msgID: msgID, rating: rating }, + function (rtn) { + var returnedVal = rtn.d; + var successFailureFlag = returnedVal[0]; + var newRatingOption = { showCancel: false, disabled: true }; + var $resultSpan = $('#ratingResult' + msgID); + var $_stars = $(this); + var $_thumbs = $('#ratingThumbs' + msgID).find('a'); + + if (successFailureFlag == 'fail') { + + qtip.notice($resultSpan, ln.rateFailure, + { position: { target: $resultSpan, at: 'left center', my: 'right center' }, + hide : {inactive : 2000} }); + + if (this.tagName.toLowerCase() == 'select') { + + // unbind handler + $_stars.unbind('change.ajaxhandle'); + + // remove current + $_stars.next().remove(); + $_stars.prop('hasProcessed', false); // new setting to allow re-evaluation of select + + // disable the select + + if ($_stars.attr('disabled') != 'disabled') $_stars.attr('disabled', 'disabled'); + + // retrieve original value + + var originalSelectValue; + + if ($resultSpan.children('a').size() == 0) { // not admin or mod so no link + originalSelectValue = $resultSpan.text(); + } else { + originalSelectValue = $resultSpan.children('a').text(); + } + + // restart rating + $_stars.rating(newRatingOption); + + //return to original value + $_stars.val((Math.round(originalSelectValue) - 3)).change(); + + $_stars.next().fadeTo(300, 0.25); + + } else { + + // disable onclick handler + $_thumbs.unbind('click.ajaxhandle'); + $_thumbs.fadeTo(300, 0.25); + + } + + return; + } + + // end of failed attempts + + var totalRating = parseInt(returnedVal[1]); + var totalRateCount = parseInt(returnedVal[2]); + var avgRating; + + if (totalRateCount == 0) totalRateCount = 1; + + if (this.tagName.toLowerCase() == 'select') { + + // calculate the avgValue for star + avgRating = (totalRating / totalRateCount).toFixed(2); + var selectValueToSet = Math.round(avgRating) - 3; + + // prevent repeating the ajax action + $_stars.unbind('change.ajaxhandle'); + + // set select to disabled + if ($_stars.attr('disabled') != 'disabled') $_stars.attr('disabled', 'disabled'); + + // remove current stars + $_stars.next().fadeOut('slow', function () { + + $(this).remove(); + $_stars.prop('hasProcessed', false); // new setting to allow re-evaluation of select + + // rebuild the star; set select to avgRating; + $_stars.rating(newRatingOption); + $_stars.val(selectValueToSet).change(); + + $_stars.next().fadeTo(300, 0.25); + }); + + } else { + + // prevent repeating the ajax action + $_thumbs.unbind('click.ajaxhandle'); + $_thumbs.fadeTo(300, 0.25); + + // set avgRating + avgRating = ((totalRating > 0) ? '+' : '') + totalRating.toString(); + + } + + // set text + + if ($resultSpan.children('a').size() == 0) { // not admin or mod so no link + $resultSpan.text(avgRating); + } else { + $resultSpan.children('a').text(avgRating); + } + + //setting rate count to the div + $('#ratingDiv' + msgID).attr('title', + String.format(((totalRateCount > 1) ? ln.tmRateCount_pl : ln.tmRateCount_sing), totalRateCount)); + + }, + JQOnCallError, this // this refers to the event target passed to as context of the Ajax framework + ); +} + + + + +function ProduceSearchPhraseFromString(str, top, useAnd) { + var cleanedTitle = str.trim().replace(/[^\w\s\.\-]/gi, ''); + var arrToRemove = cleanedTitle.split(' '); + + arrToRemove.sort(function (a, b) { return (b.length - a.length); }); + + if (!top) top = 4; + + var arrLongestWords = new Array(); + + for (var j = 0; j < arrToRemove.length; j++) { + if (arrLongestWords.indexOf(arrToRemove[j]) == -1) { + arrLongestWords.push(arrToRemove[j]); + + if (arrLongestWords.length == (arrToRemove.length < top ? arrToRemove.length : top)) + break; + } + } + + var arrFresh = cleanedTitle.split(' '); + var arrFinal = new Array(); + + for (var i = 0; i < arrFresh.length; i++) { + var currentWord = arrFresh[i]; + if (arrLongestWords.indexOf(currentWord) != -1 && arrFinal.indexOf(currentWord) == -1) { + if (currentWord.match(/[^\w]/gi)) currentWord = '"' + currentWord + '"'; + arrFinal.push(currentWord); + } + + } + + return arrFinal.join((useAnd ? ' ' : ' OR ')).trim(); +} + +function getSearchTermSuggestionFromWiki(phrase, onComplete) { + $.ajax( + { url: "http://en.wikipedia.org/w/api.php", + dataType: "jsonp", + data: { action: "opensearch", + search: phrase, + format: "json" + }, + success: function (data, textStatus, xhr) { + onComplete(data[1]); +// $("#results").empty(); +// $.each(data[1], function (_, result) { +// $("#results").append("
    • " + result + "
    • "); +// }); + }, + error: function (xhr, textStatus, errorThrown) { + onComplete(errorThrown); + } + }); + +} +var _searchSuggest = ''; + +function getSearchTermSuggestion(phrase, onComplete) { + if (_searchSuggest!= phrase.trim()){ + JQCallWebService("ws/Search.aspx/SearchSuggestion", + { searchPhrase: phrase }, + function (rtn) { + var returnedData = rtn.d; + _searchSuggest = phrase; + onComplete(returnedData); + }); + } +} + +function initiateRelatedTopicSearch(phrase, forumSpec, onComplete, topN) { + JQCallWebService("ws/Search.aspx/SearchRelatedTopics", + { + sRequest: { + Phrase: phrase.trim(), + ForumIDs: forumSpec, + TopNResults: topN, + Precision: ['Normal'] + } + }, + onComplete, + JQOnCallError); +} + +function initiateSearchSimilarThreads(phrase, forumSpec, onComplete, topN, searchPrecision) { + + if (typeof searchPrecision == 'undefined') searchPrecision = ['Exact']; + + JQCallWebService("ws/Search.aspx/SearchSimilarThreads", + { + sRequest: { + Phrase: phrase.trim(), + ForumIDs: forumSpec, + TopNResults: (!topN ? 30 : topN), + Precision: searchPrecision + } + }, + onComplete, + JQOnCallError); + +} + +function initiateSearchRegular(phrase, forumIDs, threadID, topN, phraseIn, resultAs, + searchPrecision, onComplete) { + + // resultAs: TopicsOnly RepliesOnly Both Combined + // searchPrecision: Fuzzy Normal Exact ExactOnly + + if (typeof topN == 'undefined') topN = 300; + if (typeof resultAs == 'undefined') resultAs = 'Combined'; + if (typeof searchPrecision == 'undefined') searchPrecision = 'Exact'; + + JQCallWebService("ws/Search.aspx/BeginSearch", + { + sRequest: { + Phrase: phrase, + ForumIDs: forumIDs, + ThreadID: threadID, + TopNResults: topN, + ListResultAs: resultAs, + Precision: searchPrecision, + PhraseFoundIn: phraseIn + } + }, + onComplete, + JQOnCallError); + +} + +function searchCheckIfComplete(aid, initialSearchTime, onComplete) { + + var data = { theAID: aid, beginTime: initialSearchTime }; + + JQCallWebService("ws/Search.aspx/CheckIfStepOneCompleted", data, onComplete, JQOnCallError); +} + + +function beginRetrieveingSimpleSearchResults(searchID, onBeforeRetrieving, onFinishRetrieving) { + onBeforeRetrieving(); + + var data = { searchID: searchID, top : -1 }; + + JQCallWebService("ws/Search.aspx/RetrieveSimpleSearchResults", data, onFinishRetrieving, JQOnCallError); + +} + + +$doc.ready(function () { + registerSubscriptionMenuHover(); +}); + +var _subMenuLinkSel = '#subscriptionMenuLink'; +var _subsDataKey = 'currentlevel'; +var _subMenuDatakey = 'sublevel'; + +function registerSubscriptionMenuHover() { + var $subMenuLink = $(_subMenuLinkSel); + + $subMenuLink.qtip({ + overwrite: false, + content: { text: $('#subOptions').html() }, + position: { my: 'top left', at: 'bottom left', adjust: { y: 5, x:-15} }, + show: { event: ($subMenuLink.data(_subsDataKey) != -1 ? 'mouseenter' : 'click') }, + hide: { fixed: true, delay: 600, event: 'unfocus mouseleave' }, + style: { width: '250px', tip: false, classes: 'qtip-apgsmallmenu qtip-shadow' } + }); +} + +function HandleSubscription(self, isForum, id) { + var currentLevel = $(self).data(_subsDataKey); + + if (currentLevel != -1) { + return SetSubscription(self, -1, isForum, id); + } else { + return false; + } +} + +function SetSubscription(self, action, isForum, id) { + var $link = $(self); + + $link.css('cursor', 'progress'); + $('.subOption').removeClass('bold'); + + var subscribeLinkText = (isForum ? ln.ttOptionSubscribeToForum : ln.tmOptionSubscribeToThread); + var unsubscribeLinkText = (isForum ? ln.ttOptionUnSubscribeToForum : ln.tmOptionUnSubscribeToThread); + + JQCallWebService( + "ws/Subscription.aspx/SubscribeTo" + (isForum ? 'Forum' : 'Thread'), + { id: id, action: action }, + function () { + + setTimeout(function () { $link.css('cursor', 'pointer'); }, 200); + + var $subMenuLink = $(_subMenuLinkSel); + var qtipapi = $subMenuLink.data('qtip'); + + if (action != -1) { + $subMenuLink.text(unsubscribeLinkText); + qtipapi.set('show.event', 'mouseenter'); + } else { + $subMenuLink.text(subscribeLinkText); + qtipapi.set('show.event', 'click'); + } + + setTimeout(function () { qtipapi.hide(); }, (action != -1? 500 : 150)); + + $subMenuLink.data(_subsDataKey, action); + + // from drop down - instead of from menu link + if ($link.hasClass('subOption')) $link.addClass('bold'); + } + + ); + + return false; +} +// Tree loading + +var treeDivASelector = 'div#treeIframeDiv a.msg'; +var treeDivSelector = 'div#treeIframeDiv'; +var currentRequestTreeMsgID = 0; + +$(function() { + if (tm.inTreeMode) { + setTreeDivResizable(); + setPrevNextLinkHandler(); + $('#' + tm.msgTreeHiddenField).val(currentThreadID); // this is required otherwise on initial load the hidden field is empty + } +}); + +$(function () { + + setTimeout(function () { // setTimeout 100ms required because server side AddResponseScript/Format happens later + if (tm.inTreeMode) { + + if (currentRequestTreeMsgID == 0) { loadTree(currentThreadID, currentThreadID); } // load tree regular mode + + if (currentRequestTreeMsgID != 0) performFindMsg(currentRequestTreeMsgID, false); //find msg mode, ie when tree m is specified + + $(treeDivSelector).delegate('a.msg', 'click', treeMsgClick); + + setTimeout(function () { // need delaying, as append is kind of slow in loadTree + $(treeDivASelector + ':first').addClass('bold'); + readyToPerformScroll = true; + + }, 1000); + + setScrollHandler(); + } + }, 100); +}); + +function performFindMsg(msgID, rebindScrollHandler) { + + loadTree(msgID, currentThreadID, null, true); + //console.log('loadTree'); + + //click to load the first msg + setTimeout(function() { $(treeDivSelector + ' a#treelink' + msgID.toString()).click(); }, 1500); + //console.log('first setTimeout'); + + //load the tree above the clicked msg + setTimeout(function () { loadTree(msgID, currentThreadID, null, false, true); }, 1800); + //consoleLog('ln52'); + //console.log('second setTimeout'); + + if (rebindScrollHandler === true) { // this is when we find msg after delete + //console.log('rebindScrollHandler === true'); + dontCheckScrollDown = false; + dontCheckScrollUp = false; + setScrollHandler(); + } +} + +function setTreeDivResizable() { + var $treeContainer, currentHeight, currentWidth; + $treeContainer = $('#' + tm.treeIframeContainment); + + if ($treeContainer.size() == 0) return; + + currentHeight = $treeContainer.height(); + currentWidth = $treeContainer.width(); + + $treeContainer.resizable( + { + alsoResize: treeDivSelector, + distance: 10, + delay: 20, + containment: '#main', + minHeight: currentHeight, + maxHeight: $win.height() / 2, + maxWidth: currentWidth, minWidth: currentWidth, + start: function(e, ui) { + readyToPerformScroll = false; + }, + stop: function(e, ui) { + setTimeout(function() { + readyToPerformScroll = true; + }, 2000); + } + } + ); + + setDivResizingBehavior(); + +} + +function setDivResizingBehavior() { + var tempCounter = 0; + var windowResizeTimeout; + + window.onresize = function() { + window.clearTimeout(windowResizeTimeout); + windowResizeTimeout = window.setTimeout(DelayedResize, 100); + }; + + /* + elaborated windows Resize test to enure consistent cross browser behavior + */ + var sizeBeforeResize = 0; + var $iframeContainment = $('#' + tm.treeIframeContainment); + var iframeSizeDiff = $iframeContainment.width() - $(treeDivSelector).width(); + + function DelayedResize() { + window.status = ++tempCounter; + // Add your original window.onresize implementation here + + var mainWidth = $('div#main').children('div:first').width(); + + if (mainWidth != sizeBeforeResize) { // size is changed on the resize event + + setTimeout(function() { + // set new minwidth and maxwidth for the resizable element due to change in window size + $iframeContainment.resizable("option", "minWidth", mainWidth) + .resizable("option", "maxWidth", mainWidth); + }, 100); + + setTimeout(function() { + // resize the resizable element + $iframeContainment.animate({ width: mainWidth.toString() + 'px' }, 200); + }, 400); + + setTimeout(function() { + //resize the div and the iframe + $(treeDivSelector).animate( + { width: ($iframeContainment.width() - iframeSizeDiff).toString() + 'px' }, 200); + }, 700); + + sizeBeforeResize = mainWidth; + } + + } +} + +function setPrevNextLinkHandler() { + $('a#treePrevLink').click(function(e) { treeNavigateTo('prev'); e.preventDefault(); }); + $('a#treeNextLink').click(function(e) { treeNavigateTo('next'); e.preventDefault(); }); + $('a#treeReloadLink').click(function(e) { treeReload(); e.preventDefault(); }); +} + +var readyToPerformScroll = false; + +var newScrollTimeout; + +function setScrollHandler() { + $(treeDivSelector).unbind('scroll').scroll(function() { + var _self = this; + window.clearTimeout(newScrollTimeout); + newScrollTimeout = setTimeout(function() { checkScroll($(_self)); }, 400); + }); +} + +var dontCheckScrollDown = false; +var dontCheckScrollUp = false; + +function checkScroll($treeDiv) { + // this function performs 2 checks + // 1) when scrolled to bottom, check if 'last' is present and if so, auto fetch + // 2) when scrolled to top, check if 'first' is present and if NOT, auto fetch + // if while fetching, we do nothing + + //console.log('checkScroll'); + + if (!readyToPerformScroll || stillInAjaxProgress) return false; + + if (!dontCheckScrollDown && $treeDiv[0].scrollHeight - $treeDiv.height() - $treeDiv.scrollTop() <= 14) { + + var $lastLink = $treeDiv.find('a.last'); + + if ($lastLink.size() != 0) { + fetchNextTreePage(parseInt($lastLink.attr('id').replace('treelink', '')), $lastLink); // supply jqTarget to rid of the last on existing link, simulating click + } else { + dontCheckScrollDown = true; + } + } + + else if (!dontCheckScrollUp && $treeDiv.scrollTop() <= 14) { + + var $firstLink = $treeDiv.find('a.msg:first'); + + if (!$firstLink.hasClass('first')) { + signalTreeState('loading'); + $treeDiv.css({'overflow':'hidden', 'visibility' : 'hidden'}); + loadTree(parseInt($firstLink.attr('id').replace('treelink', '')), currentThreadID, null, false, true); + //consoleLog('ln192'); + } else { + dontCheckScrollUp = true; + } + } + + if (dontCheckScrollUp && dontCheckScrollDown) { + $(treeDivSelector).unbind('scroll'); + } + +} + +var stillInAjaxProgress = false; + +function loadTree(msgID, threadID, jqTarget, findmsg, prepend) { + /* + We are treating the last and first designation differently. when there is a class='last' link, + it means we can still try to find if there is more links in the thread. If there is no class='last', then we reached the end. + + the 'first' designation is only given to the first post. when there is no first in the entire link list, then we can go look for + "previous page" in the tree. + + jqTarget is only used when fetching next page. + */ + + stillInAjaxProgress = true; + + JQCallWebService("ws/Message.aspx/GetTree", + { 'msgID': msgID, 'threadID': threadID, 'findmsg': (findmsg ? findmsg : false), + 'direction': (prepend === true ? 1 : 0)}, + function (rtn) { + var returnedVal = rtn.d; + + var finalLinksHTML = buildTreeHTML(returnedVal); + + if (jqTarget && prepend !== true) jqTarget.removeClass('last'); // there can be more so the 'last' designation is gonna change + + if (finalLinksHTML != '') { + var $treeDiv = $(treeDivSelector); + + if (prepend === true) $treeDiv.prepend(finalLinksHTML); else $treeDiv.append(finalLinksHTML); + if (prepend !== true && returnedVal.length == tm.tpg) $(treeDivASelector + ':last').addClass('last'); //there is still possibility to have more pages + + if (prepend === true) { + // scroll the found msg into view + setTimeout(function () { + var $theFirstLinkBeforeFetch = $(treeDivSelector + ' a#treelink' + msgID.toString()); + $treeDiv.scrollTo($theFirstLinkBeforeFetch, 1000, { margin: true }); + //console.log('new tree scroll'); + $theFirstLinkBeforeFetch.focus(); + }, 1000); + } + + setTimeout(function () { + $treeDiv.css({ 'overflow': 'auto', 'visibility': 'visible' }); + performDateFormat(false); + + JQCallWebService('ws/TrackRead.aspx/GetThreadLastRead', { threadID: threadID }, function (r) { // check read + var referenceDate = new Date(r.d); + $treeDiv.find('.checkDate span.performdateformat').each(function () { + var $this = $(this); + var thisdate = new Date($this.data('date') || cMemberInfo.lastVisit); + + if (thisdate.getTime() - referenceDate.getTime() > 0) { + var id = $this.parent().data('trackmid'); + if (!$('#treelink' + id).hasClass('bold')) + $('#newimg_' + id).attr('src', pageThemeImageURL + 'newestmsg.gif'); + } + }); + }); + + }, 1100); + } + + setTimeout(function () { stillInAjaxProgress = false; }, 2000); + + }, JQOnCallError); +} + +function buildTreeHTML(listdata) { + var linkTemplate = "
      " + + "{3} " + + "{9} {11} {13} " + + "{8} {5} - {6}" + + "
      "; + + var totalLinks = []; + + for (var i = 0; i < listdata.length; i++) { + + var currentMsg = listdata[i]; + // messageID llevel subject msgIcons dateCreated login mem Ignored isAnswer isRewarded moderated Deleted + + totalLinks[totalLinks.length] = String.format(linkTemplate, + currentMsg.messageID, //0 + 15 + 20 * parseInt(currentMsg.llevel), // 1 + pageThemeImageURL + 'mIcons/m' + currentMsg.msgIcons + '.gif', // 2 + currentMsg.subject.replace(//, '>'), //3 + currentMsg.mem, //4 + currentMsg.login, //5 + currentMsg.dateCreated, //6 + ((currentMsg.Ignored == '1') ? 'class="ignored" title="' + ln.ttMemberIgnored + '"' : ''), //7 + ln.byDesc,//8 + ((currentMsg.isRewarded == 1) ? '' + ln.tmIsAnswer + '' : ((currentMsg.isAnswer == 1) ? '' + ln.tmIsHelpful + '' : '')), //9 + ((currentMsg.Deleted == 1) ? 'text-decoration: line-through;' : ''), //10 + ((currentMsg.Moderated == 1) ? '' + ln.tmMessageRequireModerationDesc + '' : ''), //11 + ((currentMsg.llevel == 0) ? 'first' : ''), //12 + ((currentMsg.HasAttachment == 1) ? '' : ''), //13 + pageThemeImageURL + ); + } + + return totalLinks.join(''); +} + +function treeMsgClick(e) { + + //consoleLog('treeMsgClick'); + + var $target = $(this); + + $(treeDivASelector + '.bold').removeClass('bold'); + + $target.addClass('bold'); + + var currMsgID = parseInt($target.attr('id').replace('treelink', '')); + + $('#' + tm.msgTreeHiddenField).val(currMsgID); + + $target.focus(); + + tm.refreshButton.click(); + + if ($target.hasClass('last')) fetchNextTreePage(currMsgID, $target); + + // mark message read: + var id = $target.data('trackmid'); + $('#newimg_' + id).attr('src', pageThemeImageURL + 'blank.gif'); + + return false; +} + +function treeNavigateTo(dir) { // handler for the previous / next link on tm.aspx + + var $currMsgLink = $(treeDivASelector + '.bold:first'); + + if (dir == 'next') { + + var $next = $currMsgLink.parent().next().find('a.msg'); + + if ($next.length == 0) { + signalTreeState('last'); + } else { + $next.click(); + } + + } else { + + var $prev = $currMsgLink.parent().prev().find('a.msg'); + + if ($prev.length == 0) { + signalTreeState('first'); + } else { + $prev.click(); + } + } + +} + +function treeReload(msgID) { + //consoleLog('treeReload ' + msgID); + + if (isNaN(msgID)) { + msgID = parseInt($(treeDivASelector + '.bold:first').attr('id').replace('treelink', '')); + } + + signalTreeState('loading'); + $(treeDivSelector).html('').css({'visibility' : 'visible' }); + performFindMsg(msgID, true); +} + +function fetchNextTreePage(currentMsgID, jqTarget) { + loadTree(currentMsgID, currentThreadID, jqTarget); + //consoleLog('ln359'); +} + +function signalTreeState(state) { + + var signal = '
      ' + var finalStringSelector = 'div#treePrevNextLinks div.endOfTreeNotice'; + var treePrevNextLinkSelector = 'div#treePrevNextLinks'; + + if ($(finalStringSelector).size() == 0) { + $(signal).prependTo(treePrevNextLinkSelector); + } + + var $finalString = $(finalStringSelector); + + $finalString.text(function() { + return ((state == 'first') ? ln.tmReachFirstInTreeDesc : ((state == 'last') ? ln.tmReachLastInTreeDesc : ln.loadingDesc)); + }) + .css({ + 'top': function() { + var $treeDiv = $(treeDivSelector); + var finalTop = '-' + ($(treePrevNextLinkSelector).offset().top - ($treeDiv.offset().top + $treeDiv.height()) + ($treeDiv.height() / 2)).toString() + 'px'; + return finalTop; + } + , + 'left': function() { + var finalLeft = ($(treeDivSelector).width() - $finalString.width()) / 2; + return finalLeft.toString() + 'px'; + } + }) + .fadeIn('normal', function() { setTimeout(function() { $finalString.fadeOut(); }, ((state == 'loading') ? 750 : 1500)); }); +} + +function treeProcessAfterDelete() { + + var $firstLinkInTree = $(treeDivASelector).eq(0); + + if ($firstLinkInTree.hasClass('bold') && $firstLinkInTree.hasClass('first')) { // topic message deleted + + self.location.replace(cPathInfo.ForumDir + 'tt.aspx?forumID=' + currentForumID.toString()); + //console.log('self.location.replace'); + } else { + + var $prevLink = $(treeDivASelector).filter('.bold').parent().prev().children('a.msg'); + var msgID = parseInt($prevLink.attr('id').replace('treelink', '')); + //console.log('deleted msgID = ' + msgID.toString()); + treeReload(msgID); + } + +} +var _previewContent, _previewInterval, _previewIntervalMs = 5000; + +function openPreview(manual) { + + var upfileValue = _.isUndefined(window.postingInterface) ? '' : window.postingInterface.attInfo.attachmentKey; + + var msgContent = getEditorContent(); + var editorDim = getEditorDimension(); + + var $previewDiv = $('#previewdiv'); + var $previewContent = $previewDiv.find('.previewcontent'); + + if (manual) { + $.scrollTo($previewDiv); + $previewContent.show(); + } + + if (_previewContent == msgContent || (!manual && !$previewContent.is(':visible'))) return false; + + window.clearInterval(_previewInterval); + + JQCallWebService("ws/Message.aspx/Preview", + { message: msgContent, attachmentID: upfileValue, forPage: getForPage() }, + function (r) { + + $previewContent.html(r.d); + $previewContent.css({ 'max-height': editorDim.h, 'padding': '10px' }); + $previewDiv.css('width', editorDim.w); + $previewDiv.fadeIn(); + + if (manual) { + $.scrollTo($previewDiv); + } + //$previewContent.scrollTo({ top: 0, left: 0 }, { duration: 0 }); + //$previewContent.effect('highlight', {}, 1500); + + var imgTmpl = ''; + + var $allAttachedImg = $previewContent.find('span.mceNonEditable'); + + for (var i = 0; i < $allAttachedImg.length; i++) { + var $attached = $allAttachedImg.eq(i); + var attachedText = $attached.text(); + var imgIndex = window.postingInterface.attachmentsArray[attachedText]; + $attached.replaceWith( + String.format(imgTmpl, cPathInfo.ForumDir, imgIndex, upfileValue, + (wysiwygHelper.forPage == 1 ? 'msg' : (wysiwygHelper.forPage == 2 ? 'pm' : 'event')), attachedText)); + } + + _previewContent = msgContent; + startPreviewInterval(); + }); + + return false; +} + +function getForPage() { + if (typeof tinyMCE != 'undefined') { //WYSIWYG + return wysiwygHelper.forPage; + } else { // textbox + return wysiwygAsTextarea.forPage; + } +} + +function getEditorDimension() { + var editorWidth, editorHeight; + + if (typeof tinyMCE != 'undefined') { //WYSIWYG + var $mceLayout = $('table.mceLayout'); + editorWidth = $mceLayout.width(); + editorHeight = $mceLayout.find('td.mceIframeContainer').height(); + + } else { // textbox + var $editor = $(wysiwygAsTextarea.TextareaSelector); + editorWidth = $editor.width(); + editorHeight = $editor.height(); + } + + return { w: editorWidth, h: editorHeight }; +} + +function regPreviewToggleClick() { + $('#previewdiv').on('click', 'a.toggler', function () { + + var $link = $(this); + var $previewContent = $('div.previewcontent'); + + $previewContent.slideToggle('fast', function () { + var isContentOpen = $previewContent.is(':visible'); + var innerHtml = ln.buttonPreviewValue + ' ' + + (isContentOpen ? ln.entUpArrow : ln.entDownArrow); + $link.html(innerHtml); + + if (isContentOpen) openPreview(false); // not from the buttons, so false + }); + + return false; + }); +} + +var _previewIni = false; +var _previewAutoStart = false; + +function displayPreviewDiv() { // called in NewRTECustomJS.js + if (_previewIni) return; + var $previewDiv = $('#previewdiv'); + var editorDim = getEditorDimension(); + + $previewDiv.css('width', editorDim.w).fadeIn(); + _previewContent = ''; // prevent sending of blank initially to preveiw + + if (_previewAutoStart) { + setTimeout(function () { $previewDiv.find('a.toggler').trigger('click'); }, _previewIntervalMs); + startPreviewInterval(); + } + + _previewIni = true; +} + +function startPreviewInterval() { + _previewInterval = setInterval(function () { openPreview(false); }, _previewIntervalMs); +} + +$doc.ready(function () { + regPreviewToggleClick(); + + if (typeof wysiwygAsTextarea != 'undefined') { // tinyMCE's focus handler defined in NewRTECustomJS + $(wysiwygAsTextarea.TextareaSelector).one('focus', function () { + displayPreviewDiv(); + }); + } else { + var previewIni = + setInterval(function () { + if (typeof tinyMCE != 'undefined') { + + tinyMCE.activeEditor.onMouseUp.add(displayPreviewDiv); + tinyMCE.activeEditor.onKeyDown.add(displayPreviewDiv); +/* + tinyMCE.activeEditor.onChange.add(function () { + openPreview(false); + }); +*/ + + setTimeout(function () { + window.clearInterval(previewIni); + }, 500); + + } + }, 1000); + + } +}); + +$doc.ready(function () { + api_init(); +}); + +var _api_init = false; + +function api_init(forcedExec) { + if (!forcedExec && _api_init) return; + api_registerSignupbox(); + api_registerAlternativeLoginLinks(); + api_registerPollIndividualVote(); + //consoleLog('api_init'); + _api_init = true; +} + +var _onsiteApi_qtipNoticeOption = { position: { at: 'middle right', my: 'middle left', adjust: { x: 2} }, hide: { inactive: 3000} }; + +function api_registerPollIndividualVote() { + var $surveyDiv = $('div.api_surveybox'); + + if (!$surveyDiv[0]) return; + + _api_loadSurvey($surveyDiv); + + $body.on('click', '.castvote', function () { + var $btn = $(this); + var $api_box = $btn.closest('.api_surveybox'); + + var $polls = $api_box.find('div.voteInterface'); + var atLeastOneSubmitted = false; + var submittedCount = 0; + for (var i = 0; i < $polls.length; i++) { + var $poll = $polls.eq(i); + + var $checkedBoxes = $poll.find('input[type=checkbox]:checked'); + var $radio = $poll.find('input[type=radio]:checked'); + var votes = []; + + if ($checkedBoxes[0]) { + $checkedBoxes.each(function () { + votes.push($(this).val()); + }); + } else if ($radio[0]) { + votes.push($radio.val()); + } + + if (votes.length == 0) continue; + + submittedCount += 1; + + atLeastOneSubmitted = true; + + JQCallWebService('ws/Poll.aspx/CastVote', { pollID: $poll.data('pollid'), votes: votes }, function (r) { + + if (r.d) { + + } + }, JQOnCallError); + + } + + if (atLeastOneSubmitted) { + $btn.effect('highlight', submittedCount * 400); + + setTimeout(function () { + _api_loadSurvey($surveyDiv); + $btn.hide(); + }, submittedCount * 300); + } + + return false; + }); +} + +function _api_loadSurvey($surveyDiv) { + var pollids = $surveyDiv.data('pollids'); + + $('
      ').load(cPathInfo.ForumDir + 'ws/Poll.aspx?pollid=' + pollids + ' #AllPolls div', function (r) { + var $div = $(this); + + $div.find('.voteResultRow, .voteBtnRow').remove(); + $div.find('.voteresultHead').removeClass('center'); + $div.find('.voteresults td').css('border-bottom', '1px dashed #DDD'); + + $surveyDiv.find('div:first').replaceWith($div); + + if ($surveyDiv.find('input')[0]) + $surveyDiv.find('.castvote').show(); + + $surveyDiv.show(); + + }); +} + +function api_registerSignupbox() { + var $signupDiv = $('div.api_signupbox'); + + if (!$signupDiv[0]) return; + + if (cMemberInfo.memID != -1) { + $signupDiv.remove(); + return; + } else { + $signupDiv.show(); + } + + var $1stsignupdiv = $signupDiv.eq(0); + + var $name = $1stsignupdiv.find('input.signup_name'); + var $email = $1stsignupdiv.find('input.signup_email'); + var $pass = $1stsignupdiv.find('input.signup_pass'); + var $cptaimg = $1stsignupdiv.find('img.signup_cptaimg'); + var $cpta = $1stsignupdiv.find('input.signup_cptainput'); + var $signupbutton = $1stsignupdiv.find('.signup_button'); + + $cpta.focus(function () { + _api_resetCaptcha($cptaimg, $cpta); + }); + + $signupbutton.click(function () { + + var neededFields = [$name, $email, $pass, $cpta]; + + if (_api_requiredFieldFailedNotice(neededFields)) return false; + + var data = {}; + data.username = $name.val(); + data.email = $email.val(); + data.pass = ($pass[0] ? $pass.val() : ''); + data.captchaVal = ($cpta[0] ? $cpta.val() : ''); + + JQCallWebService('ws/Login.aspx/RegisterUser', data, function (r) { + //{.Success, .SuccessResponse, .FailedReason, .NewMemberID, .RegStatus, .RegisterResult} + var regResult = r.d; + + if (regResult.RegisterResult == 0 && regResult.NewMemberID > 0) { + + if (regResult.SuccessRedirectTo != '') { + self.location.href = regResult.SuccessRedirectTo; + return true; + } + + var handleOk; + + if (regResult.RegStatus == 0) { + handleOk = function () { + self.location.reload(); + }; + + } else { + handleOk = function () { + _api_blankOutAllInput(neededFields); + }; + } + + qtip.confirm(regResult.SuccessResponse, ln.buttonSubmitValue, '', '', handleOk); + + } else { + var $noticeEle = (regResult.RegisterResult == 1 ? $name : + (regResult.RegisterResult == 2 ? $email : (regResult.RegisterResult == 3 ? $signupbutton : $cpta))); + + qtip.notice($noticeEle, regResult.FailedReason, _onsiteApi_qtipNoticeOption); + + if ($noticeEle.prop('tagName') == 'INPUT') { + $noticeEle.val(''); + }; + + } + + _api_resetCaptcha($cptaimg, $cpta); + + }); + + return true; + }); + + $signupDiv.filter(':gt(0)').remove(); +} + +function _api_requiredFieldFailedNotice($fields) { + var failed = false; + for (var i = 0; i < $fields.length; i++) { + if ($fields[i][0] && $fields[i].val().trim() == '') { + failed = true; + qtip.notice($fields[i], ln.warnRequiredDesc, _onsiteApi_qtipNoticeOption); + } + } + return failed; +} + +function _api_resetCaptcha($img, $input) { + $img.attr('src', pageThemeImageURL + 'CaptchaImage.axd?p=' + randomString(5)); + $input.val(''); +} + +function _api_blankOutAllInput($fields) { + for (var i = 0; i < $fields.length; i++) { + if ($fields[i][0]) { + $fields[i].val(''); + } + } +} + +function api_registerAlternativeLoginLinks() { + var $topLoginLink = $('#subnav-login'); + + if (!$topLoginLink[0]) return; + + $('a.clickToOpenLogin') + .html($topLoginLink.html()) + .click(function () { + $topLoginLink.triggerHandler('click'); //, + //[$(this), { position: { my: 'bottom right', at: 'top right', adjust: { y: -15}}}]); + return false; + } + ); +} + +function CreateMemberMenu($dataLink, $div) { + var isownpost = $dataLink.data('isownpost'), + login = $dataLink.data('login'), + isfriend = $dataLink.data('isfriend'), + isignored = $dataLink.data('isignored'), + viewerisguest = $dataLink.data('viewerisguest'), + showpmlink = $dataLink.data('showpmlink'), + isrecycled = $dataLink.data('isrecycled'), + canTempBan = $dataLink.data('tempban'), + messageID = $dataLink.data('messageid'), + ip = $dataLink.data('ip'), + mem = $dataLink.data('mem'), + isguest = (mem == -1); + + var str = '
        '; + + var friendBlockTempl = '
      • {1}
      • '; + + if (!isownpost && !viewerisguest && !isfriend && !isguest) + str += String.format(friendBlockTempl, mem, ln.tmMenuAddFriend, 'friend'); + + if (!isownpost && !viewerisguest && !isguest) { + + var blockItemText = isignored ? ln.tmMenuUnblock : ln.tmMenuBlock; + var blockItemCommand = isignored ? 'unignore' : 'ignore'; + + str += String.format(friendBlockTempl, mem, blockItemText, blockItemCommand); + } + + if (!isownpost && !viewerisguest && showpmlink && !isguest) { + var gotoURL = cPathInfo.ForumDir + 'pmsend.aspx?toMemId=' + mem; + var onclick = ''; + + if (cMemberInfo.popupPosting) { + onclick = String.format('popRadWin(\'{0}&pop=true\'); return false;', gotoURL); + } + + str += String.format('
      • {1}
      • ', gotoURL, ln.tmMenuSendPM, onclick); + } + + if (!isignored && !isrecycled && !isguest) + str += String.format('
      • {1}
      • ', + cPathInfo.ForumDir + 'posts/' + escape(login), ln.profRecentPosts); + + if (canTempBan && mem != 0 && !isguest) + str += String.format('
      • {1}
      • ', + messageID, ln.tmMenuTempBan); + + if (ip) + str += String.format('
      •  
      • {0}
      • ', ip); + + str += '
      '; + + $div.append(str); + + $div.on('click', 'a', function () { + setTimeout(function() { $div.remove(); }, 100); + }); +} + +$doc.ready(function () { + setupBottomBreadCrumb(); + + if (cMemberInfo.usingMobileTheme || cMemberInfo.isMobileDevice) return; + + var totalSize = $('div.breadcrumb a').size(); + // select the breadcrumb a items first, and on mouseover of the links, produce + // the lorder value from the select menu + + if (totalSize <= 1) return; // error handling when only All Forums is present + + var timeout; + + $('div.breadcrumb').on('mouseenter', '.breadcrumbitem', function () { + var $link = $(this); + + if (!$link.data('dropdown')) return false; + + timeout = setTimeout(function () { + var theLinkText = $link.text().trim(); + + var $theSelectMenuOptions = $('select[id$=ForumJumpMenu]').children('option'); + + //now first of all, get the lorder + var theLorderForCurrent; + + $theSelectMenuOptions.each(function () { + if (this.text.trim().endsWith(theLinkText)) { + theLorderForCurrent = $(this).attr('lorder'); + return false; + } + }); + + if (typeof theLorderForCurrent == "undefined") return true; // error handling + + //now collect a list of related by take away last 3 digits, and find those who starts the remaining and with same length; + var parentLorder = theLorderForCurrent.substr(0, (theLorderForCurrent.length - 3)); + + var $theOptionsCollections = $theSelectMenuOptions.filter(function (i) { + var $option = $(this); + var lorder = $option.attr('lorder'); + if (typeof lorder == "undefined") return false; + return (lorder.startsWith(parentLorder) && lorder.length == theLorderForCurrent.length && !$option.get(0).text.endsWith(theLinkText)); + }); + + if ($theOptionsCollections.length == 0) return false; + + $link.qtip({ + overwrite: false, + content: { text: createLinksFromOptions($theOptionsCollections) }, + position: { my: 'top left', at: 'bottom left', adjust: { y: 5} }, + show: { event: 'mouseenter', ready: true }, + hide: { fixed: true, delay: 200, event: 'mouseleave' }, + style: { tip: false, classes: 'qtip-apgsmallmenu qtip-shadow' } + }); + + }, 100); + + }).on('mouseleave', '.breadcrumbitem', function () { clearTimeout(timeout); }); + +}); + +function createLinksFromOptions($options) { + var val = '
        '; + + for (var i = 0; i < $options.length; i++) { + var link = $options.get(i); + val += '
      • ' + String.format('{1}
      • ', + link.value, link.text.replace(/^(\-\s)+/gi, '')); + } + + return val + '
      '; +} + +function setupBottomBreadCrumb() { // this is using add_load due to the use of drop down menu on the breadcrumb; + $('#bottomItemsConsolidator').before($('div.breadcrumb:first').parent().html()).css('min-height', '30px'); + $('div.breadcrumb:last').addClass('altItem').css({ 'padding': '8px 10px', 'border-bottom': '0' }); +} +(function (c) { c.fn.rating = function (h) { var d = { showCancel: !0, cancelValue: null, cancelTitle: "Cancel", startValue: null, disabled: !1 }, e = { hoverOver: function (a) { a = c(a.target); a.hasClass("ui-rating-cancel") ? a.addClass("ui-rating-cancel-full") : a.prevAll().addBack().not(".ui-rating-cancel").addClass("ui-rating-hover") }, hoverOut: function (a) { a = c(a.target); a.hasClass("ui-rating-cancel") ? a.addClass("ui-rating-cancel-empty").removeClass("ui-rating-cancel-full") : a.prevAll().addBack().not(".ui-rating-cancel").removeClass("ui-rating-hover") }, click: function (a) { var b = c(a.target), f = d.cancelValue; b.parents(".content-box-content:first").removeClass("formerror"); b.hasClass("ui-rating-cancel") ? e.empty(b, b.parent()) : (b.closest(".ui-rating-star").prevAll().addBack().not(".ui-rating-cancel").prop("className", "ui-rating-star ui-rating-full"), b.closest(".ui-rating-star").nextAll().not(".ui-rating-cancel").prop("className", "ui-rating-star ui-rating-empty"), b.siblings(".ui-rating-cancel").prop("className", "ui-rating-cancel ui-rating-cancel-empty"), f = b.val()); a.data.hasChanged || c(a.data.selectBox).val(f).trigger("change") }, change: function (a) { var b = c(this).val(); e.setValue(b, a.data.container, a.data.selectBox) }, setValue: function (a, b, d) { var g = { target: null, data: {} }; g.target = c(".ui-rating-star[value=" + a + "]", b); g.data.selectBox = d; g.data.hasChanged = !0; e.click(g) }, empty: function (a, b) { b.find(".ui-rating-star").removeClass("ui-rating-full"); b.find(".ui-rating-star").addClass("ui-rating-empty"); a.prop("className", "ui-rating-cancel ui-rating-cancel-empty").nextAll().prop("className", "ui-rating-star ui-rating-empty") } }; return this.each(function () { var a = c(this), b, f; "select-one" !== this.type || a.prop("hasProcessed") || (h && c.extend(d, h), a.hide(), a.prop("hasProcessed", !0), b = c("
      ").prop({ title: this.title, className: "ui-rating" }), a.children("option").each(function () { if ("" != this.value) { var a = c(""); a.prop({ className: "ui-rating-star ui-rating-empty", title: c(this).text(), value: this.value }).appendTo(b); c(this).is(":selected") && a.prevAll().addBack().removeClass("ui-rating-empty").addClass("ui-rating-full") } }), !0 == d.showCancel && c("").prop({ className: "ui-rating-cancel ui-rating-cancel-empty", title: d.cancelTitle }).appendTo(b), 0 !== a.children("option:selected").size() ? e.setValue(a.val(), b, a) : (f = null !== d.startValue ? d.startValue : d.cancelValue, e.setValue(f, b, a), a.val(f)), !0 !== d.disabled && !0 !== a.prop("disabled") ? b.bind("mouseover", e.hoverOver).bind("mouseout", e.hoverOut).bind("click", { selectBox: a }, e.click) : b.find("a").css("cursor", "not-allowed"), b.insertAfter(a), a.bind("change", { selectBox: a, container: b }, e.change)) }) } })(jQuery); +/*prettifier_~/js/prettifier/prettify.js~/js/prettifier/lang-vb.js~/js/prettifier/lang-sql.js~/js/prettifier/lang-css.js_key*/ var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; (function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a= [],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;c=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]); - -/*regularmaster_key*/ - -function RegisterBackToTopScroller() { - - if (cMemberInfo.usingMobileTheme || cMemberInfo.isMobileDevice) return; - - var $backtotop = $('div.backtotop'); - var $main = $('#main'); - - $backtotop.click(function () { - $.scrollTo(0, { duration: 200 }); - return false; - }); - - var firstScrolled = false; - - $win.bind('scrollstop', function () { - - if ($win.scrollTop() > 500) { - if (!firstScrolled) { - - var marginLeft = (($win.width() - $main.width()) / 2) > 35 ? 10 : -45; - - $backtotop.css('margin-left', $main.width() + marginLeft); - firstScrolled = true; - } - $backtotop.fadeIn('fast'); - } else { - $backtotop.fadeOut('fast'); - } - }); -} - -function RegisterUniversalMessageMemberHover() { - - if (cMemberInfo.usingMobileTheme || cMemberInfo.isMobileDevice) return; - - $body - .on('mouseenter', 'a.messagelink', function () { - - var $lnk = $(this); - var options = { - overwrite: false, - position: { at: 'middle left', my: 'bottom left', adjust: { x: 0, y: -18 }, viewport: $win }, - style: { tip: false }, - show: { - delay: 500, - effect: function () { - $(this).fadeIn(150); - } - }, - hide: { delay: 100, fixed: false, inactive: 5000, event: 'click mouseleave' }, - events: { - render: function () { - $(this).css({ 'max-width': '450px', 'line-height': 1.6 }); - }, - hide: null - } - }; - - var title = $lnk.attr('title'); - if (title) - qtip.notice($lnk, title.replace(/\/gi, '>'), options); - - return false; - }) - .on('mouseover', 'a.authorlink', function () { - var $lnk = $(this); - var memID = $lnk.data('memid'); - - if (memID < 0) { - $lnk.attr('href', 'javascript:void(0)'); - return false; - } - - var adjustx = $lnk.data('adjustx'); - - var options = { - position: { at: 'right middle', my: 'left middle', adjust: { x: (adjustx ? adjustx : 5) }, viewport: $win }, - show: { delay: 500 }, - hide: { delay: 200, event: 'click mouseleave', fixed: true }, - style: { tip: false } - }; - - var pmlinktmpl = '{0}pmsend.aspx?toMemId={1}'; - - if (cMemberInfo.popupPosting) - pmlinktmpl = 'javascript:void(popRadWin(\'' + pmlinktmpl + '&pop=true\'))'; - - var linkContent = String.format( - '{4}{3}' + - (cFeatureInfo.galleryActive ? '{5}{3}' : '') + - (cMemberInfo.memID != memID && cMemberInfo.memID != -1 && cMemberInfo.pmAllowed ? - '{6}{3}' + - '{7}' : ''), - cPathInfo.ForumDir, memID, 'medium postButtonDropdown', '
      ', - ln.profRecentPosts, ln.galListAlbumsByMember, ln.pmListPMsByAuthor, ln.tmMenuSendPM); - - qtip.notice($lnk, linkContent, options); - - // if ($lnk.hasClass('pmMemberLink')) else if ($lnk.hasClass('photoMemberLink')) - - }); -} - -$doc.ready(function () { - RegisterBackToTopScroller(); - RegisterUniversalMessageMemberHover(); -}); -/*topNavigation_key*/ - -function registerSearchBoxes() { - - $('#masterSearchButton').click(function () { - performTopSearch($('#masterphrase')); - return false; - }); - - $('#masterphrase').keypress(function (e) { - - if (isEnterKeyPressed(e)) { - performTopSearch($(this)); - return false; - } - return true; - }); - -} - -function performTopSearch($theTextbox) { - - var phrase = $theTextbox.val().trim(); - - if (phrase.length < 3) { - showNoticeToFilterSearchbox($theTextbox, ln.srTermTooShort); - return false; - } - - showNoticeToFilterSearchbox($theTextbox, ln.srSearchWaitingMsg); - - initiateSearchSimilarThreads(phrase, 'ALL', function (r) { - var result = r.d; //[asyncID, server now, highlight] or [Integer delay, "" ,""] - var aid = result[0]; - - if (!isNaN(aid)) { - showNoticeToFilterSearchbox($theTextbox, ln.srSearchWaitAbit); - return false; - } - - if (aid == 'reentersearch') { - showNoticeToFilterSearchbox($theTextbox, ln.srSearchNoResultMsg); - return false; - } else { // start tracking - trackSearchByAid(aid, result[1], $theTextbox); - } - - return true; - }, 200, ['Normal', 'Exact']); - - return true; -} - -function trackSearchByAid(aid, beginTime, $theTextbox) { - window.dropdownfilterInterval = setInterval(function () { - searchCheckIfComplete(aid, beginTime, function (result) { - var searchid = result.d; - switch (searchid) { - case 0: // not done, keep checking at interval - break; - case -1: // no result - clearInterval(window.dropdownfilterInterval); - showNoticeToFilterSearchbox($theTextbox, ln.srSearchNoResultMsg); - break; - default: - clearInterval(window.dropdownfilterInterval); - $theTextbox.qtip('hide'); - $theTextbox.blur(); - - loadSearchResultOnMasterPhrase($theTextbox, searchid); - - break; - } - }); - }, 1000); -} - -function loadSearchResultOnMasterPhrase($theTextbox, searchid) { - var options = $.extend(true, getTopNavDropDownTipOptions(), { - style: { width: 'auto' }, - events: { - render: function (e, api) { - var $thistip = $(this); - var $content = $thistip.children(qtip.contentSelector); - $content.css({ 'overflow': 'auto' }) - .load(cPathInfo.ForumDir + 'ws/TopNav.aspx?s=' + searchid.toString() + ' #navdata', function () { - api.set('position.my', 'top right'); - api.set('position.at', 'bottom right'); - - $content.append(String.format( - '', - cPathInfo.ForumDir, searchid, encodeURIComponent($theTextbox.val()), ln.viewMoreDesc)); - }); - - }, - visible: function () { - var $thistip = $(this); - var $content = $thistip.children(qtip.contentSelector); - var maxHeight = getTopNavDropDownContentMaxHeight(); - $content.css({ 'max-height': maxHeight }); - } - } - }); - - $theTextbox.qtip(options); -} - -function showNoticeToFilterSearchbox($theTextbox, content) { - if ($theTextbox.data('notip') === true) return; - qtip.notice($theTextbox, content, { position: { adjust: { x: -10}} }); -} - -/*function sendMasterSearchString() { - var masterPhrase = $('#masterphrase').val().trim(); - if (masterPhrase == '') return; - - self.location.href = cPathInfo.ForumDir + 'search.aspx?phrase=' + - escape(masterPhrase.replace(/\= 0 ? '&' : '?') + - 'ReturnUrl=' + escape(cPathInfo.Url); - }); - return; - } - - if (cMemberInfo.isMobileDevice) return; // don't use popup for mobile devices - - var $loginTbl = $('#subnav-loginbox-div'); - var html = $loginTbl.html(); - - $loginTbl.remove(); - - $theLink.click(function (e, showtarget, additionalOptions) { - /* - consoleLog(showtarget); - consoleLog((showtarget ? $(showtarget) : $theLink)); - */ - var oriQtipOptions = { - content: { text: html, title: { text: ln.logTitleDesc, button: true} }, - position: { my: 'top center', at: 'top center', - adjust: { y: (cMemberInfo.isMobileDevice ? 10 : 190) }, // mobile keyboard will hide input - target: $win - }, - show: { event: 'click', ready: true, modal: false }, - hide: { fixed: true, delay: 1000, event: 'unfocus' }, - style: { classes: 'qtip-apglogin qtip-wideshadow ', tip: false, width:620 }, - events: { - visible: function (e, api) { - var $thisTip = $(this); - $thisTip.find('input:first').focus(); - blankRefreshCaptchaForLogin(); - }, - render: function (e, api) { - var $thisTip = $(this); - - $thisTip.find('.fbLogin, .twitterLogin').attr('href', function (ind, attr) { - return attr + '&ReturnUrl=' + escape(cPathInfo.Url.replace(/^.*\/\/[^\/]+/, '')); - }); - - $body - .delegate('.subnav-loginbox input', 'keydown', function (ev) { - var code = (ev.keyCode ? ev.keyCode : ev.which); - if (code == 13) { - $("#subnav-loginbox-submit").click(); - } - }) - .delegate('#subnav-loginbox-submit', 'click', function () { - var ajaxData = { - username: $('#subnav-loginbox-u').val().trim(), - password: $('#subnav-loginbox-p').val().trim(), - captchaVal: $('#subnav-loginbox-c').val().trim(), - remember: $('#subnav-loginbox-r').prop('checked') - }; - JQCallWebService('ws/Login.aspx/SignIn', ajaxData, - function (r) { - var returnedVal = r.d; - - if (returnedVal.success) { - var selfhref = self.location.href; - - if (selfhref.indexOf('/login') > 0 || - selfhref.indexOf('/social') > 0 || - selfhref.indexOf('/register') > 0 || - selfhref.indexOf('/confirmation') > 0) { //prevent reloading of wrong page - - self.location.replace(cPathInfo.ForumDir); - } else { - self.location.replace(location.href.split("#")[0]); - } - } else { - //consoleLog(returnedVal.resultCode); - switch (returnedVal.resultCode) { - // only display error on captcha, as we need a way to show the various "forget features" - case -6: - blankRefreshCaptchaForLogin(); - qtip.notice($('#subnav-loginbox-c'), ln.formVerificationFailureMsg); - break; - default: // all errors - self.location.href = String.format('{0}login?err={1}&username={2}', - cPathInfo.ForumDir, returnedVal.resultCode, ajaxData.username); - break; - } - - } - }, null, this); - - return false; - }); - } - } - }; - - $theLink.qtip($.extend(true, {}, oriQtipOptions, additionalOptions)); - - return false; - }); - -} - -function blankRefreshCaptchaForLogin() { - $('#subnav-loginbox-c').val(''); - $('#subnav-loginbox-captcha:visible') - .attr('src', pageThemeImageURL + 'CaptchaImage.axd?p=' + randomString(5)); -} - -function registerGplusButtonClick() { - $body.on('click', 'a.googleLogin', function () { - $('#form1') - .attr('action', cPathInfo.ForumDir + 'sociallogin.aspx?ReturnUrl=' + escape(cPathInfo.Url.replace(/^.*\/\/[^\/]+/, ''))) - .append('') - .submit(); - return false; - }); -} - - var _paneClass = 'individualSection'; - var _topNavLiDistance = 0; - - function getTopNavDropDownContentMaxHeight() { - if (cMemberInfo.isMobileDevice) - _topNavLiDistance = 1E5; - - if (_topNavLiDistance == 0) { - var $li = $('ul.topnavTabList').find('li:first'); - _topNavLiDistance = $li.offset().top + $li.innerHeight(); - } - - return $win.height() - _topNavLiDistance - 30; - } - - function getTopNavDropDownTipOptions() { - return { - overwrite: false, - content: { text: ln.loadingDesc + '.' }, //extra dot to make sure if ln is not available, tip still renders - position: { my: 'top left', at: 'bottom left'}, - style: { classes: ' qtip-apgmenu ' + (Modernizr.borderimage ? ' qtip-wideshadow ' : ' qtip-iemenushadow '), //Modernizr.borderimage as a test for IE all versions - widget: false, tip: false }, - show: { ready: true, event: _mobileAwareEventName, modal: { on: false }, effect: false }, - hide: { fixed: true, delay: 300, event: ((typeof cMemberInfo != 'undefined' && !cMemberInfo.isMobileDevice) ? 'unfocus' : 'mouseleave'), effect: false }, - events : { - hide: function (e, api) { api.elements.target.removeClass('selected'); } - } - }; - } - - function registerTopNavDropDowns() { - - var topTabLiSel = 'ul.topnavTabList > li'; // each top menu button - - // add a down triangle - var $topLis = $(topTabLiSel); - $topLis.append(''); - - $('div.topnavTabs').on(_mobileAwareEventName, topTabLiSel, function () { - - var topTabLiSelClass = 'selected'; - var $thisLi = $(this); - - if ($thisLi.hasClass(topTabLiSelClass)) { // click again close - $thisLi.removeClass(topTabLiSelClass); - $thisLi.qtip('hide'); - return true; - } - - // deselect all other buttons - $thisLi - .siblings('li').removeClass(topTabLiSelClass) - .end().addClass(topTabLiSelClass); - - if (typeof $thisLi.attr('id') != 'undefined') return true; - - var options = $.extend(true, getTopNavDropDownTipOptions(), { - position: { target: $thisLi.parent().find('li:first') }, - events: { - render: function (e, api) { - var $thistip = $(this); - - api.set('content.text', GetHiddenTopMenuContent($thisLi)); - - var filterType = getFilterTypeFromLi($thisLi); - - if (filterType == 'pm') { - api.set('position.target', $thisLi); - } - - $thistip.data('fortype', filterType); - - registerEventsForTopNavContent($thistip); - - //$thistip - - }, - visible: function (e, api) { - var $thisTip = $(this); - - var $content = $thisTip.children(qtip.contentSelector); - - $content.css('max-height', getTopNavDropDownContentMaxHeight()); - - var filterType = $thisTip.data('fortype'); - - if (filterType == 'pm') { - $thisTip.css('width', 500); - } else { - $thisTip.css('width', $('#main').width()); - } - - setMenuDivsWidth($thisTip); - - var $prevShownPane = restoreMenuScrollPosition(findMenuContainerInsideTip($thisTip)); - - var $topFilterButtons = $thisTip.find('.resultTopFilter'); - var $selectedFilter = $topFilterButtons.filter('.selected'); - - if ($selectedFilter.length == 0) { // no filter loaded. load the first one - reloadPaneByFilterButton($topFilterButtons.eq(0)); - } else if ($prevShownPane.length > 0 && paneLoadedToolongAgo($prevShownPane)) { - reloadPaneByFilterButton($selectedFilter); - } - } - } - }); - - $thisLi.qtip(options); - - }); - - $body - .on('mousedown', '.resultTopFilter', function () { // a or div are possible - var $filterButton = $(this); - $filterButton.siblings().removeClass('selected').end().addClass('selected'); - - }); - - if (getQueryString('sidebar') == "1") // from tag approval notice - setTimeout(function () { $('#extrabarOpener').trigger(_mobileAwareEventName); }, 1000); - } - - function registerEventsForTopNavContent($topNavMenu) { - var viewMoreE = cMemberInfo.isMobileDevice ? 'mousedown' : 'mousedown'; // any touch event will slow down page scroll - - $topNavMenu - .on(viewMoreE, '.resultTopFilter', function () { // a or div are possible, need to skip a few things when not in topnav - var $filterButton = $(this); - var topFilterType = $filterButton.parent().data('topfiltertype'); - - if (topFilterType) { // inside topnav as filter - - var filter = $filterButton.data('filter'); - - var menuContentSel = '.topnav-menuContent.' + topFilterType; - var paneID = topFilterType + '-' + filter; - var $pane = $('#' + paneID); - - if ($pane.length == 0) { // filter content not loaded yet - $pane = $('
      ').appendTo($(menuContentSel + ' .scrollingPane')); - - if (filter != 'SearchResult') ajaxLoadPane($pane, filter); - - } else if (paneLoadedToolongAgo($pane)) { // filter loaded 5 min ago - if (filter != 'SearchResult') ajaxLoadPane($pane, filter); - - } else { - scrollPaneIntoView($pane); - } - } - - }) - .on(viewMoreE, 'div.topnav-extraLinks.posts span.reload', function () { - - var $thisLink = $(this); - var $filterButton = findSelectedFilterButtonByContent($thisLink); - - $thisLink.css({ cursor: 'progress' }); - setTimeout(function () { $thisLink.css({ cursor: 'pointer' }); }, 500); - - reloadPaneByFilterButton($filterButton); - - return false; - }) - .on(viewMoreE, 'div.topnav-extraLinks.posts a.viewmore', function () { - - var $thisLink = $(this); - var $filterButton = findSelectedFilterButtonByContent($thisLink); - var filter = $filterButton.data('filter'); - - if (filter == 'RecentVisits') { - qtip.notice($thisLink, ln.NoDataWarning); - return false; - } - - $thisLink.attr('href', cPathInfo.ForumDir + filter); - }) - .on(viewMoreE, 'div.topnav-extraLinks.blog a.viewmore', function () { - - var $thisLink = $(this); - - $thisLink.attr('href', cPathInfo.BlogRootDir); - - }) - .on(viewMoreE, 'div.topnav-extraLinks.pm a.viewmore', function () { - - var $thisLink = $(this); - var $filterButton = findSelectedFilterButtonByContent($thisLink); - var filter = $filterButton.data('filter'); - - $thisLink.attr('href', cPathInfo.ForumDir + 'pm.aspx' + - (filter == 'pminbox' ? '?FolderID=0' : '')); - - }) - .on(viewMoreE, 'div.topnav-extraLinks.gallery a.viewmore', function () { - - var $thisLink = $(this); - var $filterButton = findSelectedFilterButtonByContent($thisLink); - var filter = $filterButton.data('filter'); - - $thisLink.attr('href', cPathInfo.ForumDir + 'gallery.aspx?scrolltophoto=true&myfavorites=' + - (filter == 'recentphotos' ? 'false' : 'true')); - - }); - } - - function GetHiddenTopMenuContent($thisLi) { - //only called when the qtip is first rendered. content defined in page. - var $thisLiTopmenu = $thisLi.find('div.topnav-menu'); - - if ($thisLiTopmenu.length == 0) return ''; - - var thisFilterType = getFilterTypeFromLi($thisLi); - - if (thisFilterType == 'pm' && !$thisLi.find('.unreadPMHead')[0]) { - $thisLi.find('.resultTopFilter:first').remove(); - } - - var filter = $thisLi.find('.resultTopFilter:first').data('filter'); - var indSectionId = thisFilterType + '-' + filter; - - var $menuContentDiv = $('
      ').addClass('topnav-menuContent ' + thisFilterType); - - $menuContentDiv.html('
      ' + - '
      '); - - $thisLiTopmenu.detach().append($menuContentDiv); - - var finalContent = $thisLiTopmenu.html(); - - //content finally stored in tip.content.text - return finalContent; - } - - function setMenuDivsWidth($qtip) { // when filter content loaded / shown, we need to set its width for successful scrolling effect - var $subDivs = $qtip.find('.' + _paneClass); - var qtipWidth = $qtip.children(qtip.contentSelector).width() - 2; - $subDivs.css('width', qtipWidth.toString() + 'px'); // standardize all content divs width; - } - - function setMenuDivHeight($pane) { - var $qtip = findQtipByContent($pane); - var qtipHeight = $qtip.find('.topnav-menuTopFilters').innerHeight() + $pane.innerHeight(); - - var $content = $qtip.children(qtip.contentSelector); - - if (getTopNavDropDownContentMaxHeight() < qtipHeight) { - $content.css('overflow', 'auto'); - } - else { - $content.css('overflow', 'hidden'); - } - - $content.animate({ 'height': (qtipHeight).toString() + 'px' }, 400, forumThemeInfo.jQueryEasing); - } - - function restoreMenuScrollPosition($menuContent) { // when window is resized and then filter menu reopened - var storedScrollToEle = $menuContent.data('scrollTo'); - - if (storedScrollToEle) { - $menuContent.scrollTo(storedScrollToEle, {duration:0}); - } - - var $scrollTo = $(storedScrollToEle); - setMenuDivHeight($scrollTo); - - return $scrollTo; - } - - function paneLoadedToolongAgo($pane) { - return ($pane.data('loaded') < (new Date().getTime() - 3E5)); // 5 min - } - - function reloadPaneByFilterButton($filterButton) { //for reloading a filter - var filter = $filterButton.data('filter'); - var topfiltertype = $filterButton.parent().data('topfiltertype'); - var $paneToLoad = $('#' + topfiltertype + '-' + filter); - - ajaxLoadPane($paneToLoad, filter, $filterButton.data('searchID')); - - $filterButton.addClass('selected'); - } - - function ajaxLoadPane($pane, filter, searchID) { //the actual ajax loading of a filter - - var urlToLoad = cPathInfo.ForumDir + 'ws/TopNav.aspx?' + - (filter == 'SearchResult' ? 's=' + searchID.toString() : 't=' + filter) + - ' #navdata .newActiveRepeaterWrap'; - -/* var $loadingPane = - $('
      ') - .css({ 'position': 'absolute', 'left': '10px', 'top': '10px' }) - .text(ln.loadingDesc);*/ - - var $filterBtnDiv = $pane.closest('.topnav-menuContent').prev(); - $filterBtnDiv.css('opacity', 0.4); - - //$pane.after($loadingPane); - - $pane.load(urlToLoad, function (r) { - $filterBtnDiv.css('opacity', 1); - //$loadingPane.detach(); - trackThreadRead($pane.selector); - - var $qtip = findQtipByContent($pane); - - setMenuDivsWidth($qtip); - performDateFormat(false); - - $pane.data('loaded', new Date().getTime()); // for auto reload later on after 5 min - - if (searchID) { - var $theFilterButton = findTipContainerByContent($pane).find('.resultTopFilter[data-filter=SearchResult]'); - $theFilterButton.show().data('searchID', searchID); // for reload & view more links - } - - scrollPaneIntoView($pane); - }); - - } - - function scrollPaneIntoView($pane) { // scroll the desired filter content - findMenuContainerByPane($pane) - .scrollTo($pane, - { duration: 800, easing: forumThemeInfo.topNavScrollEasing, - onAfter: function (scrollToEle) {$(this).data('scrollTo', scrollToEle); // store the last scrolled To pane - } - }); - - setMenuDivHeight($pane); - } - - function findMenuContainerByPane($pane) { - return $pane.closest('.topnav-menuContent'); - } - - function findMenuContainerInsideTip($qtip) { - return $qtip.find('.topnav-menuContent'); - } - - function findQtipByContent($pane) { - return $pane.closest('.qtip'); - } - - function findTipContainerByContent($anyContent) { - return $anyContent.closest(qtip.contentSelector); - } - - function findSelectedFilterButtonByContent($anyContent) { - return findTipContainerByContent($anyContent).find('.resultTopFilter.selected'); - } - - function getFilterTypeFromLi($thisLi) { - return $thisLi.data('filtertype'); - } - - function injectHiddenTopMenu() { - var menulis = $('#hiddenTopMenu').children('li').toArray().sort(function (a, b) { - return $(a).data('listindex') - $(b).data('listindex'); - }); - - var $primarymenu = $('ul.topnavTabList').children('li'); - - for (var i = 0; i < menulis.length; i++) { - var $li = $(menulis[i]); - $li.insertBefore($primarymenu.eq($li.data('listindex') - i)); - } - - } -/* HTML structure: ------------------ - qTip for the respective top LI - - qtip-content area - - menuTopFilters w/ data-topfiltertype matching the top LI - - filter button (w/ a matching pane w/ data-filter specified) - - filter button - - etc. - - menu-content - horizontal scrolling pane holder - - pane (w/ a matching filter button) - - pane - - etc. -*/ - -$doc.ready(function () { - - var $extrabarOpener = $('#extrabarOpener'); - - if ($extrabarOpener.length != 0) { - - var options = $.extend(true, getTopNavDropDownTipOptions(), { - style: { width: 400 }, - events: { - render: function (e, api) { - var $thistip = $(this); - var $content = $thistip.children(qtip.contentSelector); - $content - .css({ 'overflow': 'auto' }) - .load($extrabarOpener.data('extrabar'), function () { - trackThreadRead(); - performDateFormat(false); - - //if (!cMemberInfo.isMobileDevice) - produceTagCloud(); - - bindTagApprovalLinks(api.elements.target); - - setupTopFilterSelect(); - }); - }, - visible: function () { - var $thistip = $(this); - var $content = $thistip.children(qtip.contentSelector); - var maxHeight = getTopNavDropDownContentMaxHeight(); - $content.css({ 'max-height': maxHeight }); - } - } - }); - - $extrabarOpener.bind(_mobileAwareEventName, function () { - $extrabarOpener.qtip(options); - }); - } else { - $extrabarOpener.hide(); - } -}); - - -function setupTopFilterSelect() { - $('.sidebarTopStatsFilter').off('mousedown', 'a').on('mousedown', 'a', function () { - var $link = $(this); - var filter = $link.data('filter'); - - if (filter == null) { - var $selected = $link.siblings('.selected'); - var selFilter = $selected.data('filter'); - - if (!selFilter) return true; - - $link.attr('href', cPathInfo.ForumDir + 'Stats.aspx?t=' + selFilter); - return true; - } - - var thefid = (typeof currentForumID != 'undefined' ? currentForumID : 0); - var $stats = $('#topStats'); - - $stats.fadeTo('fast', 0.4, function () { - $stats.load(cPathInfo.ForumDir + - String.format('ws/extrabar.aspx?c=true&fid={0}&range={1} #topStats', thefid, filter), null, function () { - $stats.fadeTo('fast', 1); - }); - }); - - }); -} - -function bindTagApprovalLinks($tiptarget) { - $('.sidebarTagAdditional').on('click', 'a.tagapprovelink', function () { - var $link = $(this); - var wsName; - - switch ($link.attr('id')) { - case 'approveTag': - wsName = 'ApproveTags'; - break; - case 'disapproveTag': - wsName = 'DisapproveTags'; - break; - default: - wsName = 'DisapproveAndDeleteTags'; - } - - var checkedBoxes = []; - - var sidebarCheckboxesSel = '.sidebarTagCheckboxes'; - - var $checkboxesDiv = $(sidebarCheckboxesSel); - $checkboxesDiv.find('input[type=checkbox]:checked').each(function () { - checkedBoxes[checkedBoxes.length] = parseInt($(this).val()); - }); - - if (checkedBoxes.length == 0) return false; - - JQCallWebService('ws/Tag.aspx/' + wsName, { tagIDs: checkedBoxes }, function () { - $checkboxesDiv.load($tiptarget.data('extrabar') + ' ' + sidebarCheckboxesSel); - }); - - return false; - }); -} - -function produceTagCloud() { - var $tagArea = $('#sidebarTagsList'); - var $tagitems = $tagArea.find('.tagitem'); - - var needsUpdate = false; - - var tagCanvasOptions = { - textColour: '#444', - outlineColour: '#DADADA', - shadow: '#888', - shadowBlur: 2, - shadowOffset: [0, 1], - reverse: true, - weight: true, - weightFrom : 'data-weight', - maxSpeed : 0.02, - wheelZoom: false - }; - - var $canvas = $('#tagCanvas'); - - if ($tagitems.length == 0) { - needsUpdate = true; - } else { - if ($tagitems.length == 1 && $tagitems.eq(0).data('weight') == 0) { - $tagitems.text(ln.NoDataWarning).attr('href', ''); - } else { - $canvas.show().tagcanvas(tagCanvasOptions, 'tagLinks'); - } - } - - $tagitems.each(function () { - //consoleLog(new Date($(this).data('lastgen'))); - if (new Date().getTime() > new Date($(this).data('lastgen')).addDays(1).getTime()) { - needsUpdate = true; - return false; - } - return true; - }); - - if (needsUpdate) { - setTimeout(function () { - JQCallWebService('ws/Tag.aspx/UpdateForumTagStats', - { forumID: $canvas.data('forumid') }, null, JQOnCallError); - }, 1000); - } -} - -$doc.ready(function () { - var $forumMenuOpener = $('#forumMenuOpener'); - - if ($forumMenuOpener.length != 0) { - - var options = $.extend(true, getTopNavDropDownTipOptions(), { - style: { width: 'auto' }, - events: { - render: function (e, api) { - var $thistip = $(this); - var $content = $thistip.children(qtip.contentSelector); - $content - .css({ 'overflow': 'auto' }) - .load(cPathInfo.ForumDir + 'ws/TopNav.aspx?t=forums #navdata', function () { - $content.find('ul.allforums').find('li.forum').filter(':has(ul)') // the subscription forums and li without childrend ul don't need arrow - .append(' '); - }); - - $body.on('mouseenter', '.forumTopMenu li.forum', function () { - - var $li = $(this); - - var $childforumLinks = $li.children('ul'); - - if ($childforumLinks.length == 0) return false; - - var existingQtip = $li.qtip('api'); - - if (existingQtip) { - existingQtip.show(); - return false; - } - - var $allLinksHTML = $('
      ').append( - $childforumLinks.clone().addClass('forumTopMenu').removeClass('none')); - - var finalOptions = $.extend(true, {}, getTopNavDropDownTipOptions(), { - //overwrite: true, do not destroy. - content: { text: $allLinksHTML.html() }, - //style: { classes: ' qtip-shadow' }, - position: { target: $li, my: 'left top', at: ($li.data('depth') > 2 ? 'bottom left' : 'right top'), adjust: { x: -15, y: -5} }, - show: { delay: 200 }, - hide: { event: 'mouseleave unfocus', delay: 100, inactive: false }, - events: { - visible: function (ae, aapi) { - var $tip = $(this); - - $tip.on('mousedown', 'li', function (eee) { - // necessary to prevent leaving the parent tip visible (needed for the unfocus hide event) - // and to make a clickable. - eee.stopImmediatePropagation(); - }); - - aapi.focus(); - } - } - }); - - $li.qtip(finalOptions); - - return false; - }); - }, - visible: function () { - var $thistip = $(this); - var $content = $thistip.children(qtip.contentSelector); - var maxHeight = getTopNavDropDownContentMaxHeight(); - $content.css({ 'max-height': maxHeight }); - } - } - }); - - $forumMenuOpener.bind(_mobileAwareEventName, function () { - $forumMenuOpener - .qtip(options); - //.addClass('selected'); - }); - } else { - $forumMenuOpener.hide(); - } - -}); - -$doc.ready(function () { - - registerTopCustomMenu('li.topCustomMenu'); - - registerTopCustomMenu('#rightOptionTopMenu'); - - if (cMemberInfo.isBMan || cMemberInfo.isUMan || cMemberInfo.isFMan) - registerAdminMenus(); - - registerSubCustomMenus(); -}); - -function registerTopCustomMenu(topLiSel) { - var $allCustomMenus = $(topLiSel); - - for (var i = 0; i < $allCustomMenus.length; i++) { - - var $currTopMenu = $allCustomMenus.eq(i); - - var $subOptions = $currTopMenu.children('ul'); - - var isRightAligned = $currTopMenu.hasClass('right'); - - if ($subOptions.find('li')[0]) { - - appendPrependArrowForLi($subOptions, isRightAligned); - - var subMenuOptions = $.extend(true, getTopNavDropDownTipOptions(), { - show: { ready: false }, - style: { width: 'auto' }, - position: (isRightAligned ? { my: 'top right', at: 'bottom right'} : { my: 'top left', at: 'bottom left' }), - events: { - render: function (e, api) { - var $target = api.get('show.target'); - - $(this).children(qtip.contentSelector) - .css({ 'overflow': 'auto' }) - .html(String.format('
        {1}
      ', - ($target.hasClass('right') ? 'rightOptionMenu' : 'leftOptionMenu'), - $target.children('ul').html())); - - }, - visible: function () { - var $content = $(this).children(qtip.contentSelector); - var maxHeight = getTopNavDropDownContentMaxHeight(); - $content.css({ 'max-height': maxHeight }); - } - } - }); - - $currTopMenu.qtip(subMenuOptions); - - } else { - $currTopMenu.hide(); - } - } -} - -function registerSubCustomMenus() { - - $body.on('mouseenter', 'ul.rightOptionMenu li, ul.leftOptionMenu li', function () { - - var $theLi = $(this); - var isRightAligned = $theLi.parent().hasClass('rightOptionMenu'); - - var $childMenu = $theLi.children('ul'); - - if ($childMenu.length == 0) { - return false; - } - - var existingQtip = $theLi.qtip('api'); - - if (existingQtip) { - existingQtip.show(); - return false; - } - - var $allLinksHTML = $('
      ').append( - $childMenu.clone().addClass((isRightAligned ? 'rightOptionMenu' : 'leftOptionMenu')).removeClass('none') - ); - - var finalOptions = $.extend(true, {}, getTopNavDropDownTipOptions(), { - //overwrite: true, do not destroy. - content: { text: $allLinksHTML.html() }, - //style: { classes: ' qtip-shadow' }, - position: { - target: $theLi.children('a,span').eq(0), - my: 'top ' + (isRightAligned ? 'right' : 'left'), - at: ($theLi.data('depth') > 2 ? 'bottom ' + (isRightAligned ? 'left' : 'right') : (isRightAligned ? 'left' : 'right') + ' top'), - adjust: { x: (isRightAligned ? -20 : 20), y: -20 } - }, - show: { delay: 200 }, - hide: { - event: 'mouseleave ' + ((typeof cMemberInfo != 'undefined' && !cMemberInfo.isMobileDevice) ? 'unfocus' : ''), - delay: 100, inactive: false - }, - events: { - visible: function (ae, aapi) { - var $tip = $(this); - - $tip.on(_mobileAwareEventName, 'li', function (eee) { - // necessary to prevent leaving the parent tip visible (needed for the unfocus hide event) - // and to make a clickable. - eee.stopPropagation(); - eee.stopImmediatePropagation(); - }); - - aapi.focus(); - } - } - }); - - $theLi.qtip(finalOptions); - - return false; - }); -} - -function registerAdminMenus() { - var mTitles = [ln.forumMenuSiteCPDesc, 'Pages & Announcements', 'Forum Management', 'User Management', 'Security Related Options', - 'Gallery Options', 'System Related Options', 'All Server Messages', 'Software Activation']; - - var mURLs = ['Default.aspx?tabval=site', 'news.aspx?tabval=editnews', 'forummanager.aspx?tabval=forum', 'user.aspx?tabval=user', - 'akismet.aspx?tabval=akismet', 'gallery.aspx?tabval=gallery', 'maintenance.aspx?tabval=maintain', 'allsrvmsg.aspx?tabval=allsrvmsg', - 'activation.aspx?tabval=activate']; - - var subTitleUrls = { - admin0: { titles: ["Site Parameters", "Email Settings", "Theme & Display Options", "Home, Forums, Menu & Breadcrumb", "Posts, List View & Search Display", "Default Posting Options", - "Social Integration / Sharing", "Search Engine Optimization", "Upload & Download Processing", "Mobile Device Detection", "Valid RegEx Patterns"], - urls: ["Default.aspx?tabval=site", "email.aspx?tabval=email", "theme.aspx?tabval=theme", "homepage.aspx?tabval=home", "mview.aspx?tabval=mview", "posting.aspx?tabval=posting", - "social.aspx?tabval=social", "seo.aspx?tabval=seo", "upload.aspx?tabval=upload", "mobile.aspx?tabval=mobile", "regex.aspx?tabval=regex" ] - }, - admin2: { titles: ["Forum Management", "Moderator & Group Permissions", "Blogging Integration", "Google Authorship", "Subscription Options", - "Thread Labels", "Post Tagging", "PGDCode (BBCode)", "Smilies / Emoticons", "Delete Posts", "Related Server Messages"], - urls: ["forummanager.aspx?tabval=forum", "forumpermission.aspx?tabval=permission", "blog.aspx?tabval=blog", "authorship.aspx?tabval=author", "subscription.aspx?tabval=subscription", - "topictype.aspx?tabval=topictype", "tags.aspx?tabval=tags", "pgdcode.aspx?tabval=pgdcode", "smiley.aspx?tabval=smiley", "mdelete.aspx?tabval=prune", "fsrvmsg.aspx?tabval=fsrvmsg"] - }, - admin3: { titles: ["User Management", "Registration / Login", "Custom Registration Fields", "User Groups", "Private Message (PM)", - "User Profile & Member List", "Stock Avatar Upload", "Delete User", "User Rankings", "Bot Detection", "Create Mailing List", "Batch Member Import"], - urls: ["user.aspx?tabval=user", "reg.aspx?tabval=reg", "customreg.aspx?tabval=customreg", "ugroup.aspx?tabval=group", "pm.aspx?tabval=pm", "profile.aspx?tabval=profile", - "avatarupload.aspx?tabval=avatar", "udelete.aspx?tabval=udelete", "urank.aspx?tabval=rank", "bot.aspx?tabval=bot", "maillist.aspx?tabval=maillist", - "memimport.aspx?tabval=memimport"] - }, - admin4: { titles: ["Akismet Spam Filter", "Report Tickets", "Post Flagging & Auto Ban", "Bad words, IP and Name Filters", "Captcha & ReCaptcha", "Link & PM Spam Prevention"], - urls: ["akismet.aspx?tabval=akismet", "modticket.aspx?tabval=moderator", "warn.aspx?tabval=warn", "forumfilter.aspx?tabval=filters", "captcha.aspx?tabval=captcha", "linkpmspam.aspx?tabval=lpspam"] - }, - admin6: { titles: ["Custom Stats", "Basic Maintenance", "Admin / Moderator Log", "Mail / Async Tasks Log", - "Error Log", "Scheduled Tasks", "Server Checker", "Config Editor"], - urls: ["stats.aspx?tabval=stats", "maintenance.aspx?tabval=maintain", "logs.aspx?tabval=logs", "maillog.aspx?tabval=mlog", - "errorlog.aspx?tabval=error", "schedule.aspx?tabval=sch", "serverchecker.aspx?tabval=srvcehck", "configedit.aspx?tabval=config"] - } - }; - - var $rightTopMenu = $('#rightOptionTopMenu'); - var $rootAdminLi = $rightTopMenu.find('li.admin'); - - function addItem($ItemsUL, $cli, $ca) { - $ItemsUL.append($cli.append($ca)); - } - - var $ul = $('
        '); - - for (var i = 0; i < mTitles.length; i++) { - - if (!cMemberInfo.isBMan) { - if (cMemberInfo.isUMan && cMemberInfo.isFMan) { - if (i != 2 && i != 3) continue; - } - else if (cMemberInfo.isUMan && i != 3) { - continue; - } - else if (cMemberInfo.isFMan && i != 2) { - continue; - } - } - - var $li = $('
      • ').data('depth', 1).addClass('admin' + i.toString()); - var $a = $('').text(mTitles[i]).attr('href', cPathInfo.ForumDir + 'admincp/' + mURLs[i]); - - if (i == (mTitles.length - 1)) { // activation - if (cMemberInfo.memID == 0) addItem($ul, $li, $a); - } else { - addItem($ul, $li, $a); - } - - } - - for (var key in subTitleUrls) { - var $subLi = $ul.find('li.' + key); - - if ($subLi.size() == 1) { - - var $subsubUL = $('
          '); - - for (var ii = 0; ii < subTitleUrls[key].titles.length; ii++) { - - if ((key == 'admin6' && ii == 0) && - !(cMemberInfo.memID == 0) && - !(cMemberInfo.isBMan && !cFeatureInfo.isDemoMode)) continue; // custom stats - - if ((key == 'admin6' && ii == 7) && - !(cMemberInfo.memID == 0)) continue; // config editor - - var $subsubLi = $('
        • ').data('depth', 2); - var $subsuba = $('') - .text(subTitleUrls[key].titles[ii]) - .attr('href', cPathInfo.ForumDir + 'admincp/' + subTitleUrls[key].urls[ii]); - - addItem($subsubUL, $subsubLi, $subsuba); - } - - $subLi.append($subsubUL); - } - } - - $rootAdminLi.append($ul); - - appendPrependArrowForLi($rightTopMenu, true); - -} - -function appendPrependArrowForLi($container, isRightAligned) { - var iconHtml = ''; - - $container.find('li:has(ul)').each(function () { - if (isRightAligned) { - $(this).prepend(String.format(iconHtml, 'w')); - } - else { - $(this).append(String.format(iconHtml, 'e')); - } - }); -} - -/*splitbutton_key*/ - -function registerPostbutton() { - - var additionalOptions = { - style: { tip: false }, - hide: { delay: 600, event: 'unfocus' }, - show: { effect: false}, - events: { - render: function(e, api) { - var $tip = $(this); - $tip.find("a").click(function() { api.hide(); }); - } - } - }; - - function menuOpener(forSplit) { - var $link = $(this); - - if ($link.data('menuusesecondary')) { - $link.next().trigger('mousedown'); - return false; - } - - var menu = eval($link.data('menu')); - - if ($.isArray(menu)) { - - var menustyle = $link.data('menustyle'); - var menuclasses = {}; - - if (menustyle) { - menuclasses = { style: { classes: menustyle} }; - } - - var menuUpExpand = $link.data('menuupexpand'); - var expandDirection = menuUpExpand ? ['bottom', 'top'] : ['top', 'bottom']; - var menuXAlign = forSplit ? ' right' : ' left'; - - qtip.notice($link, - resolveAdditionalLinks(menu, forSplit), - $.extend(true, {}, additionalOptions, - { position: { my: expandDirection[0] + menuXAlign, at: expandDirection[1] + menuXAlign, - adjust: { x: (forSplit ? 2 : -2), y: (menuUpExpand ? -2 : 2) } - } - }, menuclasses)); - return false; - } - - return true; - } - - $body - .off('mousedown', '.splitsecondary') - .on('mousedown', '.splitsecondary', function () { return menuOpener.call(this, true); }) - .on('click', '.splitsecondary', function () { return $(this).hasClass('postButtonDropdown'); }) - .off('mousedown', '.splitprimary') - .on('mousedown', '.splitprimary', function () { return menuOpener.call(this, false); }) - .on('click', '.splitprimary', function () { - var $lnk = $(this); - return $lnk.data('menu') === '' && $lnk.data('menuusesecondary') !== true; - }); - - } - -function resolveAdditionalLinks(additionalLinks, fromsplit) { - - var val = ''; -} - -registerPostbutton(); - - -/*ForumHeaderJs_key*/ - /* Category Show/Hide Functions */ - -function CatStateToggler(theid) { - - ToggleCatState(theid, true); - - return false; -} - -function ToggleCatState(catId, animated) { - - var $CatTable = $('#' + catId + '_mainTable'); - - if (!animated) { - $CatTable.hide(); - AfterCatToggle(catId); - } else { - $CatTable.slideToggle('fast', forumThemeInfo.jQueryEasing, - function () { AfterCatToggle(catId); }); - } - -} - -function AfterCatToggle(catId) { - - var $CatTable = $('#' + catId + '_mainTable'); - var isVisible = $CatTable.is(':visible'); - - if ($CatTable.length == 0) return; - - $('#' + catId + '_img').attr('src', pageThemeImageURL + - (isVisible ? ImageCloseFile : ImageOpenFile)); - - RecordCatState(catId, isVisible); -} - -var _catStateCookie = 'catState'; - -function RecordCatState(catId, state) { - - var currCookieValue = $.storage.get(_catStateCookie); - - if (currCookieValue=="null" || currCookieValue== null) currCookieValue = ""; - - currCookieValue = currCookieValue.replace("|" + catId, "").replace("null", ""); - - if (!state) currCookieValue += "|" + catId; - - $.storage.set(_catStateCookie, currCookieValue); -} - -function RestoreCatState(){ - var currCookieValue = $.storage.get(_catStateCookie); - - if (currCookieValue=="" || currCookieValue=="null" || currCookieValue== null) return; - - var arrCurrCookieValue = currCookieValue.split("|"); - - if (typeof pageThemeImageURL != 'undefined') { - for (var i = 0; i < arrCurrCookieValue.length; i++) { - - if (arrCurrCookieValue[i] == '') continue; - - ToggleCatState(arrCurrCookieValue[i], false); - - } - } -} -/*cssHackEVGA_CLASSIC_V2_key*/ - -var $_letteringDivSel; -$doc.ready(function () { - $('html.ie7 table.maintable').attr('cellspacing', '1'); - - $_letteringDivSel = $('div.ForumHeaderRow'); - $_letteringDivSel.find('.head').lettering(); - $_letteringDivSel.removeClass('hidden'); - -}); - -$win.load(function () { - if (cMemberInfo.isMobileDevice) return; - $('ul.topnavTabList').lavaLamp({ easing: 'easeOutBack' }); -}); - -forumThemeInfo.forumIcons.forumUnRead = 'document_copies.png'; -forumThemeInfo.forumIcons.forumRead = 'document_empty.png'; -forumThemeInfo.forumIcons.forumLink = 'document_redirect.png'; -forumThemeInfo.forumIcons.subforumRead = 'blank.gif'; -forumThemeInfo.forumIcons.subforumUnRead = 'document_copies_small.png'; -forumThemeInfo.forumIcons.subforumLink = 'document_redirect_small.png'; -forumThemeInfo.forumIcons.threadUnRead = 'page.png'; -forumThemeInfo.forumIcons.threadRead = 'page_white.png'; -forumThemeInfo.forumIcons.threadNewestArrow = 'newestmsg.gif'; -forumThemeInfo.forumIcons.threadLatestArrow = 'latestmsg.gif'; - -forumThemeInfo.forumIcons.subforumClose = 'bullet_toggle_minus.png'; -forumThemeInfo.forumIcons.subforumOpen = 'bullet_toggle_plus.png'; - -$.fn.qtip.defaults.style.classes = 'qtip-youtube qtip-rounded qtip-shadow'; - -if (typeof $.elastislide != 'undefined') { - $.extend(true, $.elastislide.defaults, { - imageW: 80, - minItems: 3, - border: 4, - margin: 10, - easing: forumThemeInfo.jQueryEasing - }); -} - - -document.write(' - - - - - -
          - - - - -
          - - - - - - -
          -
          -
          - -
          -
          -
          - -

          Source code for hpelm.elm

          -# -*- coding: utf-8 -*-
          -"""
          -Created on Mon Oct 27 17:48:33 2014
          -
          -@author: akusok
          -"""
          -
          -import numpy as np
          -import cPickle
          -from tables import open_file
          -#from nnets.slfn import SLFN
          -from nnets.slfn_skcuda import SLFNSkCUDA as SLFN
          -# TODO: known bugs - GPU memory not released completely until Python interpreter closed (approx 200MB taken)
          -#from nnets.slfn_python import SLFNPython as SLFN
          -from hpelm.modules import mrsr, mrsr2
          -from mss_v import train_v
          -from mss_cv import train_cv
          -from mss_loo import train_loo
          -
          -
          -
          [docs]class ELM(object): - """Interface for training Extreme Learning Machines (ELM). - - Args: - inputs (int): dimensionality of input data, or number of data features - outputs (int): dimensionality of output data, or number of classes - classification ('c'/'wc'/'ml', optional): train ELM for classfication ('c') / weighted classification ('wc') / - multi-label classification ('ml'). For weighted classification you can provide weights in `w`. ELM will - compute and use the corresponding classification error instead of Mean Squared Error. - w (vector, optional): weights vector for weighted classification, lenght (`outputs` * 1). - batch (int, optional): batch size for data processing in ELM, reduces memory requirements. Does not work - for model structure selection (validation, cross-validation, Leave-One-Out). Can be changed later directly - as a class attribute. - accelerator (string, optional): type of accelerated ELM to use: None, 'GPU', ... - precision (optional): data precision to use, supports signle ('single', '32' or numpy.float32) or double - ('double', '64' or numpy.float64). Single precision is faster but may cause numerical errors. Majority - of GPUs work in single precision. Default: **double**. - norm (double, optinal): L2-normalization parameter, **None** gives the default value. - tprint (int, optional): ELM reports its progess every `tprint` seconds or after every batch, - whatever takes longer. - - Class attributes; attributes that simply store initialization or `train()` parameters are omitted. - - Attributes: - nnet (object): Implementation of neural network with computational methods, but without - complex logic. Different implementations are given by different classes: for Python, for GPU, etc. - See ``hpelm.nnets`` folder for particular files. You can implement your own computational algorithm - by inheriting from ``hpelm.nnets.SLFN`` and overwriting some methods. - flist (list of strings): Awailable types of neurons, use them when adding new neurons. - - Note: - Below the 'matrix' type means a 2-dimensional Numpy.ndarray. - """ - # TODO: note about HDF5 instead of matrix for Matlab compatibility - - def __init__(self, inputs, outputs, classification="", w=None, batch=1000, accelerator=None, - precision='double', norm=None, tprint=5): - assert isinstance(inputs, (int, long)), "Number of inputs must be integer" - assert isinstance(outputs, (int, long)), "Number of outputs must be integer" - assert batch > 0, "Batch should be positive" - - self.batch = int(batch) - self.precision = np.float64 - - if precision in (np.float32, np.float64): - self.precision = precision - elif 'double' in precision.lower() or '64' in precision: - self.precision = np.float64 - elif 'single' in precision or '32' in precision: - self.precision = np.float32 - else: - print "Unknown precision parameter: %s, using double precision" % precision - - # create SLFN solver to do actual computations - self.accelerator = accelerator - if accelerator is "GPU": - raise NotImplementedError - else: # double precision Numpy solver - self.nnet = SLFN(inputs, outputs, precision=self.precision, norm=norm) - # TODO: add advanced and GPU nnets, in load also - - # init other stuff - self.classification = None # train ELM for classification - if classification.lower() in ("c", "wc", "ml", "mc"): # allow 'mc'=='ml' for compatibility - self.classification = classification.replace("mc", "ml") - self.wc = None # weighted classification weights - if w is not None: - w = np.array(w) - assert len(w) == outputs, "Number of class weights must be equal to the number of classes" - self.wc = w - self.opened_hdf5 = [] # list of opened HDF5 files, they are closed in ELM descructor - self.ranking = None - self.kmax_op = None - self.tprint = tprint # time intervals in seconds to report ETA - self.flist = ("lin", "sigm", "tanh", "rbf_l1", "rbf_l2", "rbf_linf") # supported neuron types - - def __str__(self): - s = "ELM with %d inputs and %d outputs\n" % (self.nnet.inputs, self.nnet.outputs) - s += "Hidden layer neurons: " - for n, func, _, _ in self.nnet.neurons: - s += "%d %s, " % (n, func) - s = s[:-2] - return s - - def _train_parse_args(self, args, kwargs): - """Parse training args and set corresponding class variables.""" - assert len(self.nnet.neurons) > 0, "Add neurons to ELM before training it" - args = [a.upper() for a in args] # make all arguments upper case - - # reset parameters - self.nnet.reset() # remove previous training - self.ranking = None - self.kmax_op = None - self.classification = None # c / wc / ml - self.wc = None # weigths for weighted classification - - # check exclusive parameters - assert len(set(args).intersection({"V", "CV", "LOO"})) <= 1, "Use only one of V / CV / LOO" - msg = "Use only one of: C (classification) / WC (weighted classification) / ML (multi-label classification)" - assert len(set(args).intersection({"C", "WC", "ML", "MC"})) <= 1, msg - - # parse parameters - for a in args: - if a == "OP": - self.ranking = "OP" - if "kmax" in kwargs.keys(): - self.kmax_op = int(kwargs["kmax"]) - if a == "C": - assert self.nnet.outputs > 1, "Classification outputs must have 1 output per class" - self.classification = "c" - if a == "WC": - assert self.nnet.outputs > 1, "Classification outputs must have 1 output per class" - self.classification = "wc" - if 'w' in kwargs.keys(): - w = np.array(kwargs['w']) - assert len(w) == self.nnet.outputs, "Number of class weights must be equal to the number of classes" - self.wc = w - if a == "ML" or a == "MC": - assert self.nnet.outputs > 1, "Classification outputs must have 1 output per class" - self.classification = "ml" - if a == "R": - self.classification = None # reset to regression - - if "batch" in kwargs.keys(): - self.batch = int(kwargs["batch"]) - -
          [docs] def train(self, X, T, *args, **kwargs): - """Universal training interface for ELM model with model structure selection. - - Model structure selection takes more time and requires all data to fit into memory. Optimal pruning ('OP', - effectively an L1-regularization) takes the most time but gives the smallest and best performing model. - Choosing a classification forces ELM to use classification error in model structure selection, - and in `error()` method output. - - Args: - X (matrix): input data matrix, size (N * `inputs`) - T (matrix): outputs data matrix, size (N * `outputs`) - 'V'/'CV'/'LOO' (sting, choose one): model structure selection: select optimal number of neurons using - a validation set ('V'), cross-validation ('CV') or Leave-One-Out ('LOO') - 'OP' (string, use with 'V'/'CV'/'LOO'): choose best neurons instead of random ones, training takes longer; - equivalent to L1-regularization - 'c'/'wc'/'ml'/'r' (string, choose one): train ELM for classification ('c'), classification with weighted - classes ('wc'), multi-label classification ('ml') with several correct classes per data sample, or - regression ('r') without any classification. In classification, number of `outputs` is the number - of classes; correct class(es) for each sample has value 1 and incorrect classes have 0. - Overwrites parameters given an ELM initialization time. - - Keyword Args: - Xv (matrix, use with 'V'): validation set input data, size (Nv * `inputs`) - Tv (matrix, use with 'V'): validation set outputs data, size (Nv * `outputs`) - k (int, use with 'CV'): number of splits for cross-validation, k>=3 - kmax (int, optional, use with 'OP'): maximum number of neurons to keep in ELM - batch (int, optional): batch size for ELM, overwrites batch size from the initialization - """ - X, T = self._checkdata(X, T) - self._train_parse_args(args, kwargs) - - # TODO: test upper case and lower case 'V', ... - # train ELM with desired model structure selection - if "V" in args: # use validation set - assert "Xv" in kwargs.keys(), "Provide validation dataset (Xv)" - assert "Tv" in kwargs.keys(), "Provide validation outputs (Tv)" - Xv = kwargs['Xv'] - Tv = kwargs['Tv'] - Xv, Tv = self._checkdata(Xv, Tv) - train_v(self, X, T, Xv, Tv) - elif "CV" in args: # use cross-validation - assert "k" in kwargs.keys(), "Provide Cross-Validation number of splits (k)" - k = kwargs['k'] - assert k >= 3, "Use at least k=3 splits for Cross-Validation" - train_cv(self, X, T, k) - elif "LOO" in args: # use Leave-One-Out error on training set - train_loo(self, X, T) - else: # basic training algorithm - self.add_data(X, T) - self.nnet.solve() - # TODO: Adaptive ELM model for timeseries (someday) -
          -
          [docs] def add_data(self, X, T): - """Feed new training data (X,T) to ELM model in batches; does not solve ELM itself. - - Helper method that updates intermediate solution parameters HH and HT, which are used for solving ELM later. - Updates accumulate, so this method can be called multiple times with different parts of training data. - To reset accumulated training data, use `ELM.nnet.reset()`. - - For training an ELM use `ELM.train()` instead. - - Args: - X (matrix): input training data - T (matrix): output training data - """ - # initialize batch size - nb = int(np.ceil(float(X.shape[0]) / self.batch)) - wc_vector = None - - # find automatic weights if none are given - if self.classification == "wc" and self.wc is None: - ns = T.sum(axis=0).astype(self.precision) # number of samples in classes - self.wc = ns.sum() / ns # weights of classes - - for X0, T0 in zip(np.array_split(X, nb, axis=0), - np.array_split(T, nb, axis=0)): - if self.classification == "wc": - wc_vector = self.wc[np.where(T0 == 1)[1]] # weights for samples in the batch - self.nnet.add_batch(X0, T0, wc_vector) -
          -
          [docs] def add_neurons(self, number, func, W=None, B=None): - """Adds neurons to ELM model. ELM is created empty, and needs some neurons to work. - - Add neurons to an empty ELM model, or add more neurons to a model that already has some. - - Random weights `W` and biases `B` are generated automatically if not provided explicitly. - Maximum number of neurons is limited by the available RAM and computational power, a sensible limit - would be 1000 neurons for an average size dataset and 15000 for the largest datasets. ELM becomes slower after - 3000 neurons because computational complexity is proportional to a qube of number of neurons. - - This method checks and prepares neurons, they are actually stored in `solver` object. - - Args: - number (int): number of neurons to add - func (string): type of neurons: "lin" for linear, "sigm" or "tanh" for non-linear, - "rbf_l1", "rbf_l2" or "rbf_linf" for radial basis function neurons. - W (matrix, optional): random projection matrix size (`inputs` * `number`). For 'rbf_' neurons, - W stores centroids of radial basis functions in transposed form. - B (vector, optional): bias vector of size (`number` * 1), a 1-dimensional Numpy.ndarray object. - For 'rbf_' neurons, B gives widths of radial basis functions. - """ - assert isinstance(number, int), "Number of neurons must be integer" - assert (func in self.flist or isinstance(func, np.ufunc)),\ - "'%s' neurons not suppored: use a standard neuron function or a custom <numpy.ufunc>" % func - assert isinstance(W, (np.ndarray, type(None))), "Projection matrix (W) must be a Numpy ndarray" - assert isinstance(B, (np.ndarray, type(None))), "Bias vector (B) must be a Numpy ndarray" - inputs = self.nnet.inputs - - # default neuron initializer - if W is None: - if func == "lin": # copying input features for linear neurons - number = min(number, inputs) # cannot have more linear neurons than features - W = np.eye(inputs, number) - else: - W = np.random.randn(inputs, number) - if func not in ("rbf_l1", "rbf_l2", "rbf_linf"): - W *= 3.0 / inputs**0.5 # high dimensionality fix - if B is None: - B = np.random.randn(number) - if func in ("rbf_l2", "rbf_l1", "rbf_linf"): - B = np.abs(B) - B *= inputs - if func == "lin": - B = np.zeros((number,)) - msg = "W must be size [inputs, neurons] (expected [%d,%d])" % (inputs, number) - assert W.shape == (inputs, number), msg - assert B.shape == (number,), "B must be size [neurons] (expected [%d])" % number - # set to correct precision - W = W.astype(self.precision) - B = B.astype(self.precision) - - # add prepared neurons to the model - self.nnet.add_neurons(number, func, W, B) -
          -
          [docs] def error(self, T, Y): - """Calculate error of model predictions. - - Computes Mean Squared Error (MSE) between model predictions Y and true outputs T. - For classification, computes mis-classification error. - For multi-label classification, correct classes are all with Y>0.5. - - For weighted classification the error is an average weighted True Positive Rate, - or percentage of correctly predicted samples for each class, multiplied by weight - of that class and averaged. If you want something else, just write it yourself :) - See https://en.wikipedia.org/wiki/Confusion_matrix for details. - - Another option is to use scikit-learn's performance metrics. Transform `Y` and `T` into scikit's - format by ``y_true = T.argmax[1]``, ``y_pred = Y.argmax[1]``. - http://scikit-learn.org/stable/modules/classes.html#module-sklearn.metrics - - Args: - T (matrix): true outputs. - Y (matrix): ELM model predictions, can be computed with `predict()` function. - - Returns: - e (double): MSE for regression / classification error for classification. - """ - _, T = self._checkdata(None, T) - _, Y = self._checkdata(None, Y) - return self._error(T, Y) -
          -
          [docs] def confusion(self, T, Y): - """Computes confusion matrix for classification. - - Confusion matrix :math:`C` such that element :math:`C_{i,j}` equals to the number of observations known - to be class :math:`i` but predicted to be class :math:`j`. - - Args: - T (matrix): true outputs or classes, size (N * `outputs`) - Y (matrix): predicted outputs by ELM model, size (N * `outputs`) - - Returns: - conf (matrix): confusion matrix, size (`outputs` * `outputs`) - """ - # TODO: ELM type can be assigned at creation time: "c", "wc", "ml" - assert self.classification in ("c", "wc", "ml"), "Confusion matrix works only for regression" - _, T = self._checkdata(None, T) - _, Y = self._checkdata(None, Y) - N = T.shape[0] - nb = int(np.ceil(float(N) / self.batch)) # number of batches - - C = self.nnet.outputs - conf = np.zeros((C, C)) - - if self.classification in ("c", "wc"): - for b in xrange(nb): - start = b*self.batch - stop = min((b+1)*self.batch, N) - Tb = np.array(T[start:stop]).argmax(1) - Yb = np.array(Y[start:stop]).argmax(1) - for c1 in xrange(C): - for c1h in xrange(C): - conf[c1, c1h] += np.logical_and(Tb == c1, Yb == c1h).sum() - elif self.classification == "ml": - for b in xrange(nb): - start = b*self.batch - stop = min((b+1)*self.batch, N) - Tb = np.array(T[start:stop]) > 0.5 - Yb = np.array(Y[start:stop]) > 0.5 - for c1 in xrange(C): - for c1h in xrange(C): - conf[c1, c1h] += np.sum(Tb[:, c1] * Yb[:, c1h]) - return conf -
          -
          [docs] def project(self, X): - """Get ELM's hidden layer representation of input data. - - Args: - X (matrix): input data, size (N * `inputs`) - - Returns: - H (matrix): hidden layer representation matrix, size (N * number_of_neurons) - """ - X, _ = self._checkdata(X, None) - H = self.nnet._project(X) - return H -
          -
          [docs] def predict(self, X): - """Predict outputs Y for the given input data X. - - Args: - X (matrix): input data of size (N * `inputs`) - - Returns: - Y (matrix): output data or predicted classes, size (N * `outputs`). - """ - X, _ = self._checkdata(X, None) - Y = self.nnet._predict(X) - return Y -
          -
          [docs] def save(self, fname): - """Save ELM model with current parameters. - - Model does not save a particular solver, precision batch size. They are obtained from - a new ELM when loading the model (so one can switch to another solver, for instance). - - Also ranking and max number of neurons are not saved, because they - are runtime training info irrelevant after the training completes. - - Args: - fname (string): filename to save model into. - """ - assert isinstance(fname, basestring), "Model file name must be a string" - m = {"inputs": self.nnet.inputs, - "outputs": self.nnet.outputs, - "Classification": self.classification, - "Weights_WC": self.wc, - "neurons": self.nnet.neurons, - "norm": self.nnet.norm, # W and bias are here - "Beta": self.nnet.get_B()} - try: - cPickle.dump(m, open(fname, "wb"), -1) - except IOError: - raise IOError("Cannot create a model file at: %s" % fname) -
          -
          [docs] def load(self, fname): - """Load ELM model data from a file. - - Load requires an ``ELM`` object, and it uses solver type, precision and batch size from that ELM object. - - Args: - fname (string): filename to load model from. - """ - assert isinstance(fname, basestring), "Model file name must be a string" - try: - m = cPickle.load(open(fname, "rb")) - except IOError: - raise IOError("Model file not found: %s" % fname) - inputs = m["inputs"] - outputs = m["outputs"] - self.classification = m["Classification"] - self.wc = m["Weights_WC"] - - # create a new solver and load neurons / Beta into it with correct precision - if self.accelerator is None: - self.nnet = SLFN(inputs, outputs, precision=self.precision) - for number, func, W, B in m["neurons"]: - self.nnet.add_neurons(number, func, W.astype(self.precision), B.astype(self.precision)) - self.nnet.norm = m["norm"] - self.nnet.set_B(np.array(m["Beta"], dtype=self.precision)) -
          - def __del__(self): - # Closes any HDF5 files opened during HPELM usage. - for h5 in self.opened_hdf5: - h5.close() - - def _error(self, T, Y, R=None): - """Returns regression/classification/multiclass error, also for PRESS. - - An ELM-specific error with PRESS support. - """ - if R is None: # normal classification error - if self.classification == "c": - err = np.not_equal(Y.argmax(1), T.argmax(1)).mean() - elif self.classification == "wc": # weighted classification - c = T.shape[1] - errc = np.zeros(c) - for i in xrange(c): # per-class MSE - idx = np.where(T[:, i] == 1)[0] - if len(idx) > 0: - errc[i] = np.not_equal(Y[idx].argmax(1), i).mean() - err = np.sum(errc * self.wc) / np.sum(self.wc) - elif self.classification == "ml": - err = np.not_equal(Y > 0.5, T > 0.5).mean() - else: - err = np.mean((Y - T)**2) - else: # LOO_PRESS error - if self.classification == "c": - err = np.not_equal(Y.argmax(1), T.argmax(1)) / R.ravel() - err = np.mean(err**2) - elif self.classification == "wc": # balanced classification - c = T.shape[1] - errc = np.zeros(c) - for i in xrange(c): # per-class MSE - idx = np.where(T[:, i] == 1)[0] - if len(idx) > 0: - t = np.not_equal(Y[idx].argmax(1), i) / R[idx].ravel() - errc[i] = np.mean(t**2) - err = np.mean(errc * self.wc) - elif self.classification == "ml": - err = np.not_equal(Y > 0.5, T > 0.5) / R.reshape((-1, 1)) - err = np.mean(err**2) - else: - err = (Y - T) / R.reshape((-1, 1)) - err = np.mean(err**2) - assert not np.isnan(err), "Error is NaN at %s" % self.classification - return np.float64(err) - - def _ranking(self, L, H=None, T=None): - """Return ranking of hidden neurons; random or OP. - - Args: - L (int): number of neurons - H (matrix): hidden layer representation matrix needed for optimal pruning - T (matrix): outputs matrix needed for optimal pruning - - Returns: - rank (vector): ranking of neurons - L (int): number of selected neurons, can be changed by `self.kmax_op` - """ - if self.ranking == "OP": # optimal ranking (L1 normalization) - assert H is not None and T is not None, "Need H and T to perform optimal pruning" - if self.kmax_op is not None: # apply maximum number of neurons - L = min(self.kmax_op, L) - if T.shape[1] < 10: # fast mrsr for less outputs but O(2^t) in outputs - rank = mrsr(H, T, L) - else: # slow mrsr for many outputs but O(t) in outputs - rank = mrsr2(H, T, L) - else: # random ranking - rank = np.arange(L) - np.random.shuffle(rank) - return rank, L - - def _checkdata(self, X, T): - """Checks data variables and fixes matrix dimensionality issues. - """ - if X is not None: - if isinstance(X, basestring): # open HDF5 file - try: - h5 = open_file(X, "r") - except: - raise IOError("Cannot read HDF5 file at %s" % X) - self.opened_hdf5.append(h5) - node = None - for node in h5.walk_nodes(): - pass # find a node with whatever name - if node: - X = node - else: - raise IOError("Empty HDF5 file at %s" % X) - else: - # assert isinstance(X, np.ndarray) and - assert X.dtype.kind not in "OSU", "X must be a numerical numpy array" - if len(X.shape) == 1: - X = X.reshape(-1, 1) - assert len(X.shape) == 2, "X must have 2 dimensions" - assert X.shape[1] == self.nnet.inputs, "X has wrong dimensionality: expected %d, found %d" % \ - (self.nnet.inputs, X.shape[1]) - - if T is not None: - if isinstance(T, basestring): # open HDF5 file - try: - h5 = open_file(T, "r") - except IOError: - raise IOError("Cannot read HDF5 file at %s" % T) - self.opened_hdf5.append(h5) - node = None - for node in h5.walk_nodes(): - pass # find a node with whatever name - if node: - T = node - else: - raise IOError("Empty HDF5 file at %s" % X) - else: - # assert isinstance(T, np.ndarray) and - assert T.dtype.kind not in "OSU", "T must be a numerical numpy array" - if len(T.shape) == 1: - T = T.reshape(-1, 1) - assert len(T.shape) == 2, "T must have 2 dimensions" - - assert T.shape[1] == self.nnet.outputs, "T has wrong dimensionality: expected %d, found %d" % \ - (self.nnet.outputs, T.shape[1]) - - if (X is not None) and (T is not None): - assert X.shape[0] == T.shape[0], "X and T cannot have different number of samples" - - return X, T
          -
          - -
          - -
          -
          - -
          - -
          - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/_build/html/_modules/hpelm/hp_elm.html b/docs/_build/html/_modules/hpelm/hp_elm.html deleted file mode 100644 index 1342f9c..0000000 --- a/docs/_build/html/_modules/hpelm/hp_elm.html +++ /dev/null @@ -1,803 +0,0 @@ - - - - - - - - - - hpelm.hp_elm — hpelm 0.6.22 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          - - - - -
          - - - - - - -
          -
          -
          - -
          -
          -
          - -

          Source code for hpelm.hp_elm

          -# -*- coding: utf-8 -*-
          -"""
          -Created on Mon Oct 27 17:48:33 2014
          -
          -@author: akusok
          -"""
          -
          -import numpy as np
          -import multiprocessing as mp
          -from time import time
          -from hpelm.modules import make_hdf5, ireader, iwriter, _prepare_fHH, _write_fHH
          -from tables import open_file
          -from elm import ELM
          -
          -
          -
          [docs]class HPELM(ELM): - """Interface for training High-Performance Extreme Learning Machines (HP-ELM). - - Args: - inputs (int): dimensionality of input data, or number of data features - outputs (int): dimensionality of output data, or number of classes - classification ('c'/'wc'/'ml', optional): train ELM for classfication ('c') / weighted classification ('wc') / - multi-label classification ('ml'). For weighted classification you can provide weights in `w`. ELM will - compute and use the corresponding classification error instead of Mean Squared Error. - w (vector, optional): weights vector for weighted classification, lenght (`outputs` * 1). - batch (int, optional): batch size for data processing in ELM, reduces memory requirements. Does not work - for model structure selection (validation, cross-validation, Leave-One-Out). Can be changed later directly - as a class attribute. - accelerator (string, optional): type of accelerated ELM to use: None, 'GPU', ... - precision (optional): data precision to use, supports signle ('single', '32' or numpy.float32) or double - ('double', '64' or numpy.float64). Single precision is faster but may cause numerical errors. Majority - of GPUs work in single precision. Default: **double**. - norm (double, optinal): L2-normalization parameter, **None** gives the default value. - tprint (int, optional): ELM reports its progess every `tprint` seconds or after every batch, - whatever takes longer. - - Class attributes; attributes that simply store initialization or `train()` parameters are omitted. - - Attributes: - nnet (object): Implementation of neural network with computational methods, but without - complex logic. Different implementations are given by different classes: for Python, for GPU, etc. - See ``hpelm.nnets`` folder for particular files. You can implement your own computational algorithm - by inheriting from ``hpelm.nnets.SLFN`` and overwriting some methods. - flist (list of strings): Awailable types of neurons, use them when adding new neurons. - - Note: - The 'hdf5' type denotes a name of HDF5 file type with a single 2-dimensional array inside. HPELM uses PyTables - interface to HDF5: http://www.pytables.org/. For HDF5 array examples, see - http://www.pytables.org/usersguide/libref/homogenous_storage.html. Array name is irrelevant, - but there must be **only one array per HDF5 file**. - - A 2-dimensional Numpy.ndarray can also be used. - """ - -
          [docs] def train(self, fX, fT, *args, **kwargs): - """Universal training interface for HP-ELM model. - - Always trains a basic ELM model without model structure selection. - L2-regularization is available as `norm` parameter at HPELM initialization. - Number of neurons selection with validation set for trained HPELM is available in `train_hpv()` method. - - Args: - fX (hdf5): input data on disk, size (N * `inputs`) - fT (hdf5): outputs data on disk, size (N * `outputs`) - 'c'/'wc'/'ml' (string, choose one): train HPELM for classification ('c'), classification with weighted - classes ('wc') or multi-label classification ('ml') with several correct classes per data sample. - In classification, number of `outputs` is the number of classes; correct class(es) for each sample - has value 1 and incorrect classes have 0. - - Keyword Args: - istart (int, optional): index of first data sample to use from `fX`, `istart` < N. If not given, - all data from `fX` is used. Sample with index `istart` is used for training, indexing is 0-based. - icount (int, optional): number of data samples to use from `fX`, starting from `istart`, automatically - adjusted to `istart` + `icount` <= N. If not given, all data starting from `start` is used. - The last sample used for training is `istart`+`icount`-1, so you can index data as: - istart_1=0, icount_1=1000; istart_2=1000, icount_2=1000; istart_3=2000, icount_3=1000, ... - batch (int, optional): batch size for ELM, overwrites batch size from the initialization - """ - # TODO: move to h5py, because I don't need pyTables features - # TODO: move to h5py with MPI async IO (driver='mpio') - # TODO: explain why I don't support parallel processing (huge amount of data to transfer, or fast enough) - X, T = self._checkdata(fX, fT) - self._train_parse_args(args, kwargs) - - istart = 0 - icount = np.inf - if "istart" in kwargs.keys(): - istart = max(0, int(kwargs["istart"])) - if "icount" in kwargs.keys(): - icount = kwargs["icount"] - self.add_data(X, T, istart=istart, icount=icount) - self.nnet.solve() -
          -
          [docs] def add_data(self, fX, fT, istart=0, icount=np.inf, fHH=None, fHT=None): - """Feed new training data (X,T) to HP-ELM model in batches: does not solve ELM itself. - - This method prepares an intermediate solution data, that takes the most time. After that, obtaining - the solution is fast. - - The intermediate solution consists of two matrices: `HH` and `HT`. They can be in memory for a model computed - at once, or stored on disk for a model computed in parts or in parallel. - - For iterative solution, provide file names for on-disk matrices in the input parameters `fHH` and `fHT`. - They will be created if they don't exist, or new results will be merged with the existing ones. This method is - multiprocess-safe for parallel writing into files `fHH` and `fHT`, that allows you to easily compute ELM - in parallel. The multiprocess-safeness uses Python module 'fasteners' and a lock file, which is named - fHH+'.lock' and fHT+'.lock'. - - Args: - fX (hdf5): (part of) input training data size (N * `inputs`) - fT (hdf5) (part of) output training data size (N * `outputs`) - istart (int, optional): index of first data sample to use from `fX`, `istart` < N. If not given, - all data from `fX` is used. Sample with index `istart` is used for training, indexing is 0-based. - icount (int, optional): number of data samples to use from `fX`, starting from `istart`, automatically - adjusted to `istart` + `icount` <= N. If not given, all data starting from `start` is used. - The last sample used for training is `istart`+`icount`-1, so you can index data as: - istart_1=0, icount_1=1000; istart_2=1000, icount_2=1000; istart_3=2000, icount_3=1000, ... - fHH, fHT (string, optional): file names for storing HH and HT matrices. Files are created if they don't - exist, or new result is added to the existing files if they exist. Parallel writing to the same - `fHH`, `fHT` files is multiprocess-safe, made specially for parallel training of HP-ELM. Another use - is to split a very long training of huge ELM into smaller parts, so the training can be interrupted - and resumed later. - - """ - # initialize - assert len(self.nnet.neurons) > 0, "Add neurons to ELM before using it" - X, T = self._checkdata(fX, fT) - N = X.shape[0] - _prepare_fHH(fHH, fHT, self.nnet, self.precision) - # custom range adjustments - icount = min(istart + icount, N) - nb = int(np.ceil(float(icount) / self.batch)) # number of batches - - # weighted classification initialization - if self.classification == "wc" and self.wc is None: - ns = np.zeros((self.nnet.outputs,)) - for b in xrange(nb): # batch sum is much faster - start = b*self.batch + istart - stop = min((b+1)*self.batch + istart, icount + istart) - ns += T[start:stop].sum(axis=0) - ns = ns.astype(self.precision) - self.wc = ns.sum() / ns # class weights normalized to number of samples - - # main loop over all the data - t = time() - t0 = time() - eta = 0 - wc_vector = None - for b in xrange(nb): - start = b*self.batch + istart - stop = min((b+1)*self.batch + istart, icount + istart) - Xb = X[start:stop] - Tb = T[start:stop] - if self.classification == "wc": - wc_vector = self.wc[np.where(Tb == 1)[1]] # weights for samples in the batch - - self.nnet.add_batch(Xb, Tb, wc_vector) - - # report time - eta = int(((time()-t0) / (b+1)) * (nb-b-1)) - if time() - t > self.tprint: - print "processing batch %d/%d, eta %d:%02d:%02d" % (b+1, nb, eta/3600, (eta % 3600)/60, eta % 60) - t = time() - - # if storing output to disk - if fHH is not None and fHT is not None: - HH, HT = self.nnet.get_corr() - HH[np.diag_indices_from(HH)] -= self.nnet.norm # norm is already included - _write_fHH(fHH, fHT, HH, HT) -
          -
          [docs] def solve_corr(self, fHH, fHT): - """Solves an ELM model with the given (covariance) fHH and (correlation) fHT HDF5 files. - - Args: - fHH (hdf5): an hdf5 file with intermediate solution data - fHT (hdf5): an hdf5 file with intermediate solution data - """ - HH, HT = self._checkcorr(fHH, fHT) - B = self.nnet.solve_corr(HH, HT) - self.nnet.set_B(B) -
          -
          [docs] def predict(self, fX, fY, istart=0, icount=np.inf): - """Iterative predict outputs and save them to HDF5, can use custom range. - - Args: - fX (hdf5): hdf5 filename with input data from which outputs are predicted - fY (hdf5): hdf5 filename to store output data into - istart (int, optional): index of first data sample to use from `fX`, `istart` < N. If not given, - all data from `fX` is used. Sample with index `istart` is used for training, indexing is 0-based. - icount (int, optional): number of data samples to use from `fX`, starting from `istart`, automatically - adjusted to `istart` + `icount` <= N. If not given, all data starting from `start` is used. - The last sample used for training is `istart`+`icount`-1, so you can index data as: - istart_1=0, icount_1=1000; istart_2=1000, icount_2=1000; istart_3=2000, icount_3=1000, ... - """ - assert len(self.nnet.neurons) > 0, "Add neurons to ELM and train it before using" - assert self.nnet.B is not None, "Train ELM before predicting" - X, _ = self._checkdata(fX, None) - N = X.shape[0] - # custom range adjustments - icount = min(istart + icount, N) - nb = int(np.ceil(float(icount) / self.batch)) # number of batches - # make file to store results - make_hdf5((icount, self.nnet.outputs), fY, dtype=self.precision) - h5 = open_file(fY, "a") - for Y in h5.walk_nodes(): - pass # find a node with whatever name - - t = time() - t0 = time() - eta = 0 - for b in xrange(0, nb): - start = b*self.batch + istart - stop = min((b+1)*self.batch + istart, icount + istart) - - # get data - Xb = X[start:stop] - # process data - Yb = self.nnet._predict(Xb) - # write data - Y[start-istart:stop-istart] = Yb - - # report time - eta = int(((time()-t0) / (b+1)) * (nb-b-1)) - if time() - t > self.tprint: - print "processing batch %d/%d, eta %d:%02d:%02d" % (b+1, nb, eta/3600, (eta % 3600)/60, eta % 60) - t = time() - - h5.flush() - h5.close() -
          -
          [docs] def project(self, fX, fH, istart=0, icount=np.inf): - """Iteratively project input data from HDF5 into HPELM hidden layer, and save in another HDF5. - - Args: - fX (hdf5): hdf5 filename with input data from which outputs are predicted - fH (hdf5): hdf5 filename to store output data into - istart (int, optional): index of first data sample to use from `fX`, `istart` < N. If not given, - all data from `fX` is used. Sample with index `istart` is used for training, indexing is 0-based. - icount (int, optional): number of data samples to use from `fX`, starting from `istart`, automatically - adjusted to `istart` + `icount` <= N. If not given, all data starting from `start` is used. - The last sample used for training is `istart`+`icount`-1, so you can index data as: - istart_1=0, icount_1=1000; istart_2=1000, icount_2=1000; istart_3=2000, icount_3=1000, ... - """ - assert len(self.nnet.neurons) > 0, "Add neurons to ELM before using it" - X, _ = self._checkdata(fX, None) - N = X.shape[0] - # custom range adjustments - icount = min(istart + icount, N) - nb = int(np.ceil(float(icount) / self.batch)) # number of batches - # make file to store results - make_hdf5((icount, self.nnet.L), fH, dtype=self.precision) - h5 = open_file(fH, "a") - for H in h5.walk_nodes(): - pass # find a node with whatever name - - t = time() - t0 = time() - for b in xrange(0, nb): - start = b*self.batch + istart - stop = min((b+1)*self.batch + istart, icount + istart) - - # get data - Xb = X[start:stop] - # process data - Hb = self.nnet._project(Xb) - # write data - H[start-start:stop-istart] = Hb - - # report time - eta = int(((time()-t0) / (b+1)) * (nb-b-1)) - if time() - t > self.tprint: - print "processing batch %d/%d, eta %d:%02d:%02d" % (b+1, nb, eta/3600, (eta % 3600)/60, eta % 60) - t = time() - - h5.flush() - h5.close() -
          -
          [docs] def error(self, fT, fY, istart=0, icount=np.inf): - """Calculate error of model predictions of HPELM. - - Computes Mean Squared Error (MSE) between model predictions Y and true outputs T. - For classification, computes mis-classification error. - For multi-label classification, correct classes are all with Y>0.5. - - For weighted classification the error is an average weighted True Positive Rate, - or percentage of correctly predicted samples for each class, multiplied by weight - of that class and averaged. If you want something else, just write it yourself :) - See https://en.wikipedia.org/wiki/Confusion_matrix for details. - - Args: - fT (hdf5): hdf5 filename with true outputs - fY (hdf5): hdf5 filename with predicted outputs - istart (int, optional): index of first data sample to use from `fX`, `istart` < N. If not given, - all data from `fX` is used. Sample with index `istart` is used for training, indexing is 0-based. - icount (int, optional): number of data samples to use from `fX`, starting from `istart`, automatically - adjusted to `istart` + `icount` <= N. If not given, all data starting from `start` is used. - The last sample used for training is `istart`+`icount`-1, so you can index data as: - istart_1=0, icount_1=1000; istart_2=1000, icount_2=1000; istart_3=2000, icount_3=1000, ... - - Returns: - e (double): MSE for regression / classification error for classification. - """ - _, T = self._checkdata(None, fT) - _, Y = self._checkdata(None, fY) - return self._error(T, Y, istart=istart, icount=icount) -
          - def _error(self, T, Y, istart=0, icount=np.inf): - """Iterative batch error calcualtion. - - Args: - T (matrix): true outputs for error calculation - Y (matrix): predicted outputs for error calculation - istart (int): index of first sample to process - icount (int): number of samples to process - """ - N = T.shape[0] - icount = min(istart + icount, N) - nb = int(np.ceil(float(icount) / self.batch)) # number of batches - - if self.classification == "c": - err = 0 - for b in xrange(nb): - start = b*self.batch + istart - stop = min((b+1)*self.batch + istart, icount + istart) - Tb = np.array(T[start:stop]) - Yb = np.array(Y[start:stop]) - errb = np.mean(Yb.argmax(1) != Tb.argmax(1)) - err += errb * float(stop-start)/icount - - elif self.classification == "wc": # weighted classification - c = T.shape[1] - errc = np.zeros(c) - countc = np.zeros(c) - for b in xrange(nb): - start = b*self.batch + istart - stop = min((b+1)*self.batch + istart, icount + istart) - Tb = np.array(T[start:stop]) - Yb = np.array(Y[start:stop]) - for i in xrange(c): # per-class MSE - idx = np.where(Tb[:, i] == 1)[0] - if len(idx) > 0: - err1 = np.not_equal(Yb[idx].argmax(1), i) - errc[i] += err1.sum() - countc[i] += len(idx) - errc = errc / countc # get mean value - err = np.sum(errc * self.wc) / np.sum(self.wc) - - elif self.classification == "ml": - err = 0 - for b in xrange(nb): - start = b*self.batch + istart - stop = min((b+1)*self.batch + istart, icount + istart) - Tb = np.array(T[start:stop]) - Yb = np.array(Y[start:stop]) - errb = np.not_equal(Yb > 0.5, Tb > 0.5).mean() - err += errb * float(stop-start)/icount - - else: # MSE error - err = 0 - for b in xrange(nb): - start = b*self.batch + istart - stop = min((b+1)*self.batch + istart, icount + istart) - Tb = T[start:stop] - Yb = Y[start:stop] - errb = np.mean((Tb - Yb)**2) - err += errb * float(stop-start)/icount - - return err - -
          [docs] def validation_corr(self, fHH, fHT, fXv, fTv, steps=10): - """Quick batch error evaluation with different numbers of neurons on a validation set. - - Only feasible implementation of model structure selection with HP-ELM. This method makes a single pass - over the validation data, computing errors for all numbers of neurons at once. It requires HDF5 files with - matrices HH and HT: `fHH` and `fHT`, obtained from `add_data(..., fHH, fHT)` method. - - The method writes the best solution to the HPELM model. - - Args: - fHH (string): name of HDF5 file with HH matrix - fHT (string): name of HDF5 file with HT matrix - fXv (string): name of HDF5 file with validation dataset inputs - fTv (string): name of HDF5 file with validation dataset outputs - steps (int or vector): amount of different numbers of neurons to test, choosen uniformly on a logarithmic - scale from 3 to number of neurons in HPELM. Can be given exactly as a vector. - - Returns: - Ls (vector): numbers of neurons used by `validation_corr()` method - errs (vector): corresponding errors for number of neurons in `Ls`, with classification error if model - is run for classification - confs (list of matrix): list of confusion matrices corresponding to elements in Ls (empty for regression) - """ - X, T = self._checkdata(fXv, fTv) - HH, HT = self._checkcorr(fHH, fHT) - N = X.shape[0] - L = self.nnet.L - classification = self.classification is not None - - Ls = np.logspace(np.log(3), np.log(L), steps, base=np.e, endpoint=True) - Ls = np.ceil(Ls).astype(np.int) - Ls = np.unique(Ls) # numbers of neurons to check - k = Ls.shape[0] - errs = np.zeros((k,)) # errors for these numbers of neurons - nb = int(np.ceil(float(N) / self.batch)) - - Betas = [] # keep all betas in memory - confs = [] - for l in Ls: - Betas.append(self.nnet.solve_corr(HH[:l, :l], HT[:l, :])) - if classification: confs.append(np.zeros((self.nnet.outputs, self.nnet.outputs))) - - t = time() - t0 = time() - for b in xrange(nb): - start = b*self.batch - stop = min((b+1)*self.batch, N) - Tb = np.array(T[start:stop]) - Xb = np.array(X[start:stop]) - Hb = self.nnet._project(Xb) - for i in xrange(k): - hb1 = Hb[:, :Ls[i]] - Yb = np.dot(hb1, Betas[i]) - errs[i] += self._error(Tb, Yb) * float(stop-start)/N - if classification: confs[i] += self.confusion(Tb, Yb) - # report time - eta = int(((time()-t0) / (b+1)) * (nb-b-1)) - if time() - t > self.tprint: - print "processing batch %d/%d, eta %d:%02d:%02d" % (b+1, nb, eta/3600, (eta % 3600)/60, eta % 60) - t = time() - - k_opt = np.argmin(errs) - best_L = Ls[k_opt] - self.nnet._prune(np.arange(best_L)) - self.nnet.set_B(Betas[k_opt]) - del Betas - print "%d of %d neurons selected with a validation set" % (best_L, L) - if best_L > L*0.9: - print "Hint: try re-training with more hidden neurons" - return Ls, errs, confs - - # async-IO versions of methods -
          -
          [docs] def train_async(self, fX, fT, *args, **kwargs): - """Training HPELM with asyncronous I/O, good for network drives, etc. See `train()` for reference. - - Spawns new processes using Python's `multiprocessing` module. - """ - X, T = self._checkdata(fX, fT) - self._train_parse_args(args, kwargs) - - istart = 0 - icount = np.inf - if "istart" in kwargs.keys(): - istart = max(0, int(kwargs["istart"])) - if "icount" in kwargs.keys(): - icount = kwargs["icount"] - self.add_data_async(fX, fT, istart=istart, icount=icount) - self.nnet.solve() -
          -
          [docs] def add_data_async(self, fX, fT, istart=0, icount=np.inf, fHH=None, fHT=None): - """Version of `add_data()` with asyncronous I/O. See `add_data()` for reference. - - Spawns new processes using Python's `multiprocessing` module, and requires more memory than non-async version. - """ - # initialize - assert len(self.nnet.neurons) > 0, "Add neurons to ELM before using it" - X, T = self._checkdata(fX, fT) - N = X.shape[0] - # TODO: adapt for GPU solver - _prepare_fHH(fHH, fHT, self.nnet, self.precision) - # custom range adjustments - icount = min(istart + icount, N) - nb = int(np.ceil(float(icount) / self.batch)) - - # weighted classification initialization - if self.classification == "wc" and self.wc is None: - ns = np.zeros((self.nnet.outputs,)) - for b in xrange(nb): # batch sum is much faster - start = b*self.batch + istart - stop = min((b+1)*self.batch + istart, icount + istart) - ns += T[start:stop].sum(axis=0) - ns = ns.astype(self.precision) - self.wc = ns.sum() / ns # class weights normalized to number of samples - - # close X and T files opened by _checkdata() - h5 = self.opened_hdf5.pop() - h5.close() - h5 = self.opened_hdf5.pop() - h5.close() - - # start async reader and writer for HDF5 files - qX_in = mp.Queue() - qX_out = mp.Queue(1) - readerX = mp.Process(target=ireader, args=(fX, qX_in, qX_out)) - readerX.daemon = True - readerX.start() - qT_in = mp.Queue() - qT_out = mp.Queue(1) - readerT = mp.Process(target=ireader, args=(fT, qT_in, qT_out)) - readerT.daemon = True - readerT.start() - - # main loop over all the data - t = time() - t0 = time() - eta = 0 - wc_vector = None - for b in xrange(0, nb+1): - start_next = b*self.batch + istart - stop_next = min((b+1)*self.batch + istart, icount + istart) - # prefetch data - qX_in.put((start_next, stop_next)) # asyncronous reading of next data batch - qT_in.put((start_next, stop_next)) - - if b > 0: # first iteration only prefetches data - Xb = qX_out.get() - Tb = qT_out.get() - if self.classification == "wc": - wc_vector = self.wc[np.where(Tb == 1)[1]] # weights for samples in the batch - - self.nnet.add_batch(Xb, Tb, wc_vector) - - # report time - eta = int(((time()-t0) / (b+1)) * (nb-b-1)) - if time() - t > self.tprint: - print "processing batch %d/%d, eta %d:%02d:%02d" % (b+1, nb, eta/3600, (eta % 3600)/60, eta % 60) - t = time() - - # close async reader and writer - readerX.join() - readerT.join() - - # if storing output to disk - if fHH is not None and fHT is not None: - HH, HT = self.nnet.get_corr() - HH[np.diag_indices_from(HH)] -= self.nnet.norm # norm is already included - _write_fHH(fHH, fHT, HH, HT) -
          -
          [docs] def predict_async(self, fX, fY, istart=0, icount=np.inf): - """Version of `predict()` with asyncronous I/O. See `predict()` for reference. - - Spawns new processes using Python's `multiprocessing` module, and requires more memory than non-async version. - """ - assert len(self.nnet.neurons) > 0, "Add neurons to ELM and train it before using" - assert self.nnet.B is not None, "Train ELM before predicting" - X, _ = self._checkdata(fX, None) - N = X.shape[0] - # custom range adjustments - icount = min(istart + icount, N) - nb = int(np.ceil(float(icount) / self.batch)) # number of batches - # make file to store results - make_hdf5((icount, self.nnet.outputs), fY) - - # start async reader and writer for HDF5 files - qr_in = mp.Queue() - qr_out = mp.Queue(1) - reader = mp.Process(target=ireader, args=(fX, qr_in, qr_out)) - reader.daemon = True - reader.start() - qw_in = mp.Queue(1) - writer = mp.Process(target=iwriter, args=(fY, qw_in)) - writer.daemon = True - writer.start() - - t = time() - t0 = time() - eta = 0 - for b in xrange(0, nb+1): - start_next = b*self.batch + istart - stop_next = min((b+1)*self.batch + istart, icount + istart) - # prefetch data - qr_in.put((start_next, stop_next)) # asyncronous reading of next data batch - - if b > 0: # first iteration only prefetches data - # get data - Xb = qr_out.get() - # process data - Yb = self.nnet._predict(Xb) - # save data - qw_in.put((Yb, start-istart, stop-istart)) - - start = start_next - stop = stop_next - # report time - eta = int(((time()-t0) / (b+1)) * (nb-b-1)) - if time() - t > self.tprint: - print "processing batch %d/%d, eta %d:%02d:%02d" % (b+1, nb, eta/3600, (eta % 3600)/60, eta % 60) - t = time() - - qw_in.put(None) - reader.join() - writer.join() -
          - def _checkcorr(self, fHH, fHT): - """Analog of `_checkdata()` for correlation matrices. - """ - try: - h5 = open_file(fHH, "r") - except: - raise IOError("Cannot read HDF5 file at %s" % fHH) - node = None - for node in h5.walk_nodes(): - pass # find a node with whatever name - if node: - HH = node[:] - else: - raise IOError("Empty HDF5 file at %s" % fHH) - h5.close() - - try: - h5 = open_file(fHT, "r") - except: - raise IOError("Cannot read HDF5 file at %s" % fHT) - node = None - for node in h5.walk_nodes(): - pass # find a node with whatever name - if node: - HT = node[:] - else: - raise IOError("Empty HDF5 file at %s" % fHT) - h5.close() - - L = self.nnet.L - c = self.nnet.outputs - assert len(self.nnet.neurons) > 0, "Cannot solve ELM without neurons" - assert HH.shape[0] == L and HH.shape[1] == L, "HH has wrong shape: (%d,%d) expected, (%d,%d) found" \ - % (L, L, HH.shape[0], HH.shape[1]) - assert HT.shape[0] == L and HT.shape[1] == c, "HT has wrong shape: (%d,%d) expected, (%d,%d) found" \ - % (L, c, HH.shape[0], HH.shape[1]) - return HH, HT
          -
          - -
          - -
          -
          - -
          - -
          - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/_build/html/_modules/hpelm/modules/hdf5_tools.html b/docs/_build/html/_modules/hpelm/modules/hdf5_tools.html deleted file mode 100644 index b57d258..0000000 --- a/docs/_build/html/_modules/hpelm/modules/hdf5_tools.html +++ /dev/null @@ -1,439 +0,0 @@ - - - - - - - - - - hpelm.modules.hdf5_tools — hpelm 0.6.22 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          - - - - -
          - - - - - - -
          -
          -
          - -
          -
          -
          - -

          Source code for hpelm.modules.hdf5_tools

          -# -*- coding: utf-8 -*-
          -"""
          -Created on Thu Apr  2 21:12:46 2015
          -
          -@author: akusok
          -"""
          -
          -import numpy as np
          -import csv
          -from tables import open_file, Atom, Filters
          -import os
          -import fasteners  # inter-process file lock
          -
          -
          -def _prepare_fHH(fHH, fHT, nnet, precision):
          -    """Prepares files for fHH, fHT if they are needed.
          -
          -    Args:
          -        fHH (string): hdf5 filename to store HH, None for ignore disk storage
          -        fHT (string): hdf5 filename to store HT, None for ignore disk storage
          -        nent (nnets Object): neural network implementation from HPELM
          -        precision (np.float32/64): precision
          -    """
          -    if (fHH is not None) and (fHT is not None):
          -        # reset accumulated data in ELM
          -        nnet.reset()
          -        L = nnet.L
          -        outputs = nnet.outputs
          -        norm = nnet.norm
          -
          -        # process fHH
          -        if os.path.isfile(fHH):
          -            h5 = open_file(fHH, 'r')
          -            node = None
          -            for node in h5.walk_nodes():
          -                pass  # find a node with whatever name
          -            try:
          -                assert node is not None, "Matrix in %d does not exist" % fHH
          -                assert node is not None and node.shape[0] == L and node.shape[1] == L, \
          -                       "Matrix in %d has a wrong shape: (%d, %d) expected, (%d, %d) found" % \
          -                       (fHH, L, L, node.shape[0], node.shape[1])
          -            except AssertionError as e:
          -                raise  # re-raise same error
          -            finally:
          -                h5.close()
          -        else:
          -            make_hdf5(np.eye(L, L, dtype=precision)*norm, fHH, precision)
          -
          -        # process fHT
          -        if os.path.isfile(fHT):
          -            h5 = open_file(fHT, 'r')
          -            node = None
          -            for node in h5.walk_nodes():
          -                pass  # find a node with whatever name
          -            try:
          -                assert node is not None, "Matrix in %d does not exist" % fHT
          -                assert node is not None and node.shape[0] == L and node.shape[1] == outputs, \
          -                       "Matrix in %d has a wrong shape: (%d, %d) expected, (%d, %d) found" % \
          -                       (fHT, L, outputs, node.shape[0], node.shape[1])
          -            except AssertionError as e:
          -                raise  # re-raise same error
          -            finally:
          -                h5.close()
          -        else:
          -            make_hdf5((L, outputs), fHT, precision)
          -
          -def _write_fHH(fHH, fHT, HH, HT):
          -    """Writes HH,HT data into fHH,fHT files, multi-process safe with lock file.
          -
          -    Lock file has the same name as fHH,fHT, but with '.lock' extension.
          -    """
          -    fHH_lock = fHH + ".lock"
          -    with fasteners.InterProcessLock(fHH_lock):
          -        h5 = open_file(fHH, "a")
          -        for node in h5.walk_nodes():
          -            pass  # find a node with whatever name
          -        node[:] += HH
          -        h5.flush()
          -        h5.close()
          -
          -    fHT_lock = fHT + ".lock"
          -    with fasteners.InterProcessLock(fHT_lock):
          -        h5 = open_file(fHT, "a")
          -        for node in h5.walk_nodes():
          -            pass  # find a node with whatever name
          -        node[:] += HT
          -        h5.flush()
          -        h5.close()
          -
          -
          -
          [docs]def normalize_hdf5(h5file, mean=None, std=None, batch=None): - """Calculates and applies normalization to data in HDF5 file. - - :param mean: - known vector of mean values - :param std: - known vector of standard deviations - :param batch: - number of rows to read at once, default is a native batch size - """ - - h5 = open_file(h5file, "a") - for node in h5.walk_nodes(): - pass # find a node with whatever name - dt = node.dtype - N, d = node.shape # HDF5 files are transposed, for Matlab compatibility - if batch is None: - batch = node.chunkshape[0] - nb = N/batch - if N > nb*batch: - nb += 1 # add last incomplete step - - if mean is None or std is None: - if node.attrs.mean is None: # data was not normalized before - print "calculating mean and standard deviation of data" - E_x = np.zeros((d,), dtype=np.float64) - E_x2 = np.zeros((d,), dtype=np.float64) - for b in xrange(nb): - start = b*batch - step = min(batch, N-start) - X1 = node[start: start+step, :].astype(np.float64) - E_x += np.mean(X1, 0) * (1.0*step/N) - E_x2 += np.mean(X1**2, 0) * (1.0*step/N) - mean = E_x - E2_x = E_x**2 - std = (E_x2 - E2_x)**0.5 - node.attrs.mean = mean - node.attrs.std = std - return mean, std - else: # data is already normalized - print "data was already normalized, returning 'mean', 'std' parameters" - print "if you want to run normalization anyway, call the function with 'mean' and 'std' params" - return node.attrs.mean, node.attrs.std - else: - assert len(mean) == d, "Incorrect lenght of a vector of means: %d expected, %d found" % (d, len(mean)) - assert len(std) == d, "Incorrect lenght of a vector of standard deviations: %d expected, %d found" % (d, len(std)) - node.attrs.mean = mean - node.attrs.std = std - std[std == 0] = 1 # prevent division by zero for std=0 - - print "applying normalization" - for b in xrange(nb): - start = b*batch - step = min(batch, N-start) - X = node[start: start+step].astype(np.float64) - X = (X - mean) / std - node[start: start+step] = X.astype(dt) - - h5.close() # closing file - return mean, std - - -#def oversample(data, targets, classes): -# pass - -
          -
          [docs]def make_hdf5(data, h5file, dtype=np.float64, delimiter=" ", skiprows=0, comp_level=0): - """Makes an HDF5 file from whatever given data. - - :param data: - input data in Numpy.ndarray or filename, or a shape tuple - :param h5file: - name (and path) of the output HDF5 file - :param delimiter: - data delimiter for text, csv files - :param comp_level: - compression level of the HDF5 file - """ - assert comp_level < 10, "Compression level must be 0-9 (0 for no compression)" - fill = "" - - # open data file - if isinstance(data, np.ndarray): - X = data - elif isinstance(data, basestring) and data[-3:] in ['npy']: - X = np.load(data) - elif isinstance(data, basestring) and data[-3:] in ['.gz', 'bz2']: - X = np.loadtxt(data, dtype=dtype, delimiter=delimiter, skiprows=skiprows) - elif isinstance(data, basestring) and data[-3:] in ['txt', 'csv']: - # iterative out-of-memory loader for huge .csv/.txt files - fill = "iter" - # check data dimensionality - with open(data, "rU") as f: - for _ in xrange(skiprows): - f.readline() - reader = csv.reader(f, delimiter=delimiter) - for line in reader: - X = np.fromiter(line, dtype=dtype) - break - elif isinstance(data, tuple) and len(data) == 2: - X = np.empty((1, 1)) - fill = "empty" - else: - assert False, "Input data must be Numpy ndarray, .npy file, or .txt/.csv text file (compressed .gz/.bz2)" - - # process data - if len(X.shape) == 1: - X = X[:, np.newaxis] - assert len(X.shape) == 2, "Data in Numpy ndarray must have 2 dimensions" - # create hdf5 file - if comp_level > 0: - flt = Filters(complevel=comp_level, shuffle=True) - else: - flt = Filters(complevel=0) - h5 = open_file(h5file, "w") - a = Atom.from_dtype(np.dtype(dtype), dflt=0) - # write data to hdf5 file - if fill == "iter": # iteratively fill the data - h5data = h5.create_earray(h5.root, "data", a, (0, X.shape[0]), filters=flt) - with open(data, "rU") as f: - for _ in xrange(skiprows): - f.readline() - reader = csv.reader(f, delimiter=delimiter) - for line in reader: - row = np.fromiter(line, dtype=dtype) - h5data.append(row[np.newaxis, :]) - elif fill == "empty": # no fill at all - h5data = h5.create_carray(h5.root, "data", a, data, filters=flt) - else: # write whole data matrix - h5data = h5.create_carray(h5.root, "data", a, X.shape, filters=flt) - h5data[:] = X - # close the file - h5data.attrs.mean = None - h5data.attrs.std = None - h5.flush() - h5.close() - -
          -
          [docs]def ireader(fX, q_in, q_out): - """Asyncronous reader for an HDF5 file. - - q_in - a (start, stop) tuple of read indexes; if start >= stop then reader terminates - q_out - a queue for chunks red from a disk - """ - assert isinstance(fX, basestring), "Asyncronous I/O only supported with HDF5 data files" - hX = open_file(fX, "r") - for X in hX.walk_nodes(): - pass # find a node with whatever name - - while True: # returning data chunks on demand - start, stop = q_in.get() - if start >= stop: - break - q_out.put(X[start:stop]) - hX.close() - -
          -
          [docs]def iwriter(fX, q_in): - """Asyncronous writer for an HDF5 file. - - q_in - a (Xbatch, start, stop) tuple of data to write indexes; if q_in is None then writer terminates - """ - assert isinstance(fX, basestring), "Asyncronous I/O only supported with HDF5 data files" - hX = open_file(fX, "a") - for X in hX.walk_nodes(): - pass # find a node with whatever name - - while True: # returning data chunks on demand - data = q_in.get() - if data is None: - break - Xb, start, stop = data - X[start:stop] = Xb - X.flush() - hX.close() - -
          -if __name__ == "__main__": - # def make_hdf5(data, h5file, dtype=np.float64, delimiter=" ", skiprows=0, comp_level=0): - # make_hdf5("textfile.txt", "text.h5") - # make_hdf5("textfile.txt", "textz.h5", comp_level=3) - normalize_hdf5("text.h5") - print "Done!" -
          - -
          - -
          -
          - -
          - -
          - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/_build/html/_modules/hpelm/modules/mrsr.html b/docs/_build/html/_modules/hpelm/modules/mrsr.html deleted file mode 100644 index 83447df..0000000 --- a/docs/_build/html/_modules/hpelm/modules/mrsr.html +++ /dev/null @@ -1,316 +0,0 @@ - - - - - - - - - - hpelm.modules.mrsr — hpelm 0.6.22 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          - - - - -
          - - - - - - -
          -
          -
          - -
          -
          -
          - -

          Source code for hpelm.modules.mrsr

          -# -*- coding: utf-8 -*-
          -"""Multiresponse Sparse Regression algorithm in Python
          -
          -Uses np library from Python
          -
          -| Input:
          -| **T**    is an (n x p) matrix of targets. The columns of T should
          -      have zero mean and same scale (e.g. equal variance).
          -| **X**    is an (n x m) matrix of regressors. The columns of X should
          -      have zero mean and same scale (e.g. equal variance).
          -| **kmax** is an integer fixing the number of steps to be run, which
          -      equals to the maximum number of regressors in the model.
          -  
          -| Output:
          -| **W**    is an (m x p*kmax) sparse matrix of regression
          -      coefficients. It can be converted to full matrix by command   
          -      full(W). Regression coefficients of the k:th step are given
          -      by W(:,(k-1)*p+1:k*p).
          -| **i1**   is a (1 x kmax) vector of indices revealing the order in
          -      which the regressors enter model. 
          - 
          -The estimates for T may be obtained by Y = X*W, where the k:th
          -estimate Y(:,(k-1)*p+1:k*p) uses k regressors.
          -  
          -| Reference: 
          -| Timo Simila, Jarkko Tikka. Multiresponse sparse regression with
          - application to multidimensional scaling. International Conference
          - on Artificial Neural Networks (ICANN). Warsaw, Poland. September
          - 11-15, 2005. LNCS 3697, pp. 97-102.
          -
          -Copyright (C) 2005 by Timo Simila and Jarkko Tikka.
          -
          -This function is free software; you can redistribute it and/or
          -modify it under the terms of the GNU General Public License as
          -published by the Free Software Foundation; either version 2 of
          -the License, or any later version.   
          -
          -The function is distributed in the hope that it will be useful,
          -but WITHOUT ANY WARRANTY; without even the implied warranty of
          -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the `GNU
          -General Public License  <http://www.gnu.org/copyleft/gpl.html>`_  
          -for more details.
          -"""
          -
          -import numpy as np
          -
          -
          -
          [docs]def mrsr(X, T, kmax): - - n,m = X.shape - n,p = T.shape - kmax = min(kmax, m) - if p > 15: - print "Too many targets (%d) - MRSR has O(2^targets) complexity" - """ print "Reducing to 15 randomly selected targets (6x slowdown)" - print "Using max 10 targets (1.08x slowdown) recommended" - ti = np.arange(p) - np.random.shuffle(ti) - ti = ti[:15] - T = T[:,ti] - p = 15 - """ - i1 = np.array([], dtype = np.int32) - i2 = np.arange(m).astype(np.int32) - XT = np.dot(X.T,T) - XX = np.zeros([m, m]) - - S = np.ones([2**p, p]) - S[0:2**(p-1), 0] = -1 - for j in np.arange(1, p): - S[:, j] = np.concatenate((S[np.arange(1, 2**p, 2), j-1], S[np.arange(1, 2**p, 2), j-1])) - - - - # Make the first step - - A = np.transpose(XT) - cmax = np.amax(abs(A).sum(0), 0) - cind = np.argmax(abs(A).sum(0), 0) - A = np.delete(A, cind, 1) - ind = int(i2[cind]) - i2 = np.delete(i2, cind) - i1 = np.append(i1, ind) - # here Xi1 and Xi2 are just faster alternatives to X[:,i1] and X[:,i2] - Xi2 = X.copy(order='F') # column-contiguous copy of X - Xi2[:, cind:-1] = Xi2[:, cind+1:]; Xi2 = Xi2[:,:-1] # delete <cind> col - Xi1 = X[:,ind].reshape((n,1)) # add 1 column at a time - - XX[np.ix_([ind], [ind])] = np.dot(X[:,ind], X[:,ind]) - - invXX = 1 / XX[ind, :][ind] - Wols = invXX * XT[ind, :] - Yols = np.dot(Xi1, np.reshape(Wols, (1,-1))) - B = np.dot(Yols.T, Xi2) - G = (cmax+np.dot(S,A))/(cmax+np.dot(S,B)) - g = G[G>=0].min() - Y = g*Yols - - # Rest of the steps - for k in np.arange(2,kmax+1): - #print "calculating rank %d/%d" % (k-1, kmax) - #print "mrsr %d/%d" % (k+1, kmax) - - A = np.dot((T-Y).T, Xi2) # true slow - cmax = np.amax(abs(A).sum(0), 0) - cind = np.argmax(abs(A).sum(0), 0) - A = np.delete(A, cind, 1) - ind = int(i2[cind]) - i2 = np.delete(i2, cind) - i1 = np.append(i1, ind) - #Xi1 = np.hstack((Xi1, X[:,ind].reshape((n,1), order='C'))) # slow for large k - Xi1 = np.hstack((Xi1, X[:,ind].reshape((-1,1)))) # slow for large k - xX = np.dot(X[:, ind].T, Xi1) - - XX[np.ix_([ind], i1)] = xX - XX[np.ix_(i1, [ind])] = np.reshape(xX, (i1.size, -1)) - - v3 = XX.take(i1,axis=0).take(i1,axis=1) # XX[i1, :][:, i1] - #v3 = XX[i1, :][:, i1] - try: - invXX = np.linalg.inv(v3) - except np.linalg.linalg.LinAlgError: - print 'got singular matrix, using pinv()', i1 - invXX = np.linalg.pinv(v3) - - Wols = np.dot(invXX, XT.take(i1,axis=0)) - Yols = np.dot(Xi1, Wols) # true slow - # deletes [cind] row, slow for large k - Xi2[:, cind:-1] = Xi2[:, cind+1:]; Xi2 = Xi2[:,:-1] - - B = np.dot((Yols-Y).T, Xi2) # true slow - - G = (cmax + S.dot(A)) / (cmax + S.dot(B)) # true slow for many outputs - # now we remove that line using a condition: - # G = numpy.concatenate(([2*(k==m)-1], G.flatten()), 1) - if k == kmax: # G[G>=0] is empty if k==kmax; empty.min() will give error - Y = Yols - else: - g = G[G>=0].min() - Y = (1-g)*Y+g*Yols - - return i1 -
          -
          - -
          - -
          -
          - -
          - -
          - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/_build/html/_modules/hpelm/modules/mrsr2.html b/docs/_build/html/_modules/hpelm/modules/mrsr2.html deleted file mode 100644 index 0e5746b..0000000 --- a/docs/_build/html/_modules/hpelm/modules/mrsr2.html +++ /dev/null @@ -1,299 +0,0 @@ - - - - - - - - - - hpelm.modules.mrsr2 — hpelm 0.6.22 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          - - - - -
          - - - - - - -
          -
          -
          - -
          -
          -
          - -

          Source code for hpelm.modules.mrsr2

          -# -*- coding: utf-8 -*-
          -"""Multi-Responce Sparse Regression with linear scaling in number of outputs.
          -
          -Basically an L1-regularized regression with multiple outputs, regularization considers all outputs together,
          -method returns the best input features one by one and can be stopped early. Compared to an original MRSR this method
          -is slower for small problems, but has a linear complexity in the number of outputs instead of exponential one,
          -so it is suitable for auto-encoders and other tasks with large output dimensionality.
          -
          -Better MRSR implementation according to:
          -'Common subset selection of inputs in multiresponse regression" by
          -Timo Similä and Jarkko Tikka, 
          -International Joint Conference on Neural Networks 2006
          -
          -Created on Sun Jan 26 13:48:54 2014
          -@author: Anton Akusok
          -"""
          -
          -import numpy as np
          -from scipy import optimize
          -from scipy.linalg import lu_factor, lu_solve
          -
          -
          -
          [docs]def mrsr2(X, T, kmax, norm=2): - - # initializing - ins = X.shape[1] - outs = T.shape[1] - X = np.array(X, order='F') # Fortran ordering is good for operating columns - XA = np.empty(X.shape, order='F') - XX = np.dot(X.T, X) - XT = np.dot(X.T, T) - rank = [] # active inputs list - nonrank = range(ins) - W = np.zeros((ins, outs)) # current projection estimator - Y = np.zeros(T.shape) # current target estimator - Yk1 = np.zeros(T.shape) - Wk1 = np.zeros((1, outs)) - j_current = None # currently added input dimension - kmax = min(kmax, X.shape[0]) - - # get ranking - for _ in xrange(kmax): - - # first step - if len(rank) == 0: - c_max = -1 - for j in nonrank: - c_kj = np.linalg.norm(np.dot(T.T, X[:,j]), norm) - if c_kj > c_max: - c_max = c_kj - j_max = j - j_current = j_max - # save new input - rank.append(j_current) - nonrank.remove(j_current) - # swap columns - idx = len(rank)-1 - XA[:,idx] = X[:, j_current] - y_min = 1 - - # last step - elif len(nonrank) == 0: - Y = Yk1 - W[rank] = Wk1 - y_min = 1 - - # intermediate step - else: - Yk2 = (Yk1 - Y).T - T2 = (T - Y).T - - X9 = X[:, j_current] - c_max = np.linalg.norm(np.dot(T2, X9), norm) - #c_max = np.linalg.norm(np.dot(T2, X[:, j_current]), norm) - - #fun = lambda y,x_new: (1-y)*c_max - np.linalg.norm(T2.dot(x_new) - y*Yk2.dot(x_new)) - fun_p = lambda y,p1,p2: (1-y)*c_max - np.linalg.norm(p1 - y*p2) # super fast parametrized function - - # find optimal step (minimum over possible additional inputs) - y_min = 1 # upper interval - for j_new in nonrank: - x_new = X[:,j_new] - # pre-calculate constant parts of the optimization function for the given x_new - p1 = T2.dot(x_new) - p2 = Yk2.dot(x_new) - if (1-y_min)*c_max < np.linalg.norm(p1 - y_min*p2): # skip optimization if min(fun) > y_min - try: - zero = 1E-15 # finding a value greater than zero - y_kj = optimize.brentq(fun_p, zero, y_min, xtol=1E-6, args=(p1,p2)) - y_min = y_kj - j_min = j_new - except ValueError: - # ValueError: f(a) and f(b) must have different signs - # here f(a) < 0 and f(b) < 0; does not fit our purposes anyway - # ignoring this case - pass - - if y_min == 1: # if no suitable solution was found - j_min = j_new - j_current = j_min - - # add new input into model - rank.append(j_current) - nonrank.remove(j_current) - # add new input to X matrix - idx = len(rank)-1 - XA[:,idx] = X[:,j_current] - - # post-update ELM estimation with current set of inputs, with LU-ELM - XtX = XX[rank,:][:,rank] - XtT = XT[rank,:] - LU, piv = lu_factor(XtX)#, overwrite_a=True) - Wk1 = lu_solve((LU, piv), XtT)#, overwrite_b=True) - X1 = XA[:,:len(rank)] # replace fancy indexing with simple one - Yk1 = np.dot(X1, Wk1) - - if len(rank) > 1: - # perform variable length step - Y = (1-y_min)*Y + y_min*Yk1 - W = (1-y_min)*W - W[rank] += y_min*Wk1 - - # done, return ranking - return rank - - -
          - -
          - -
          -
          - - - -
      - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/_build/html/_modules/hpelm/modules/rbf_param.html b/docs/_build/html/_modules/hpelm/modules/rbf_param.html deleted file mode 100644 index bf11f4c..0000000 --- a/docs/_build/html/_modules/hpelm/modules/rbf_param.html +++ /dev/null @@ -1,236 +0,0 @@ - - - - - - - - - - hpelm.modules.rbf_param — hpelm 0.6.22 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      - - - - -
      - - - - - - -
      -
      -
      - -
      -
      -
      - -

      Source code for hpelm.modules.rbf_param

      -# -*- coding: utf-8 -*-
      -"""
      -Created on Thu Apr 16 12:10:02 2015
      -
      -@author: akusok
      -"""
      -
      -from tables import open_file
      -import numpy as np
      -from scipy.spatial.distance import cdist
      -
      -# TODO: use these parameters, or remove them
      -
      -
      [docs]def rbf_param(data, k, kind="sqeuclidean"): - """Calculates parameters for RBF neurons. - - :param data: - a matrix or an HDF5 file - """ - if "l1" in kind: - kind = "cityblock" - elif "inf" in kind: - kind = "chebyshev" - else: - kind = "sqeuclidean" - if isinstance(data, basestring): - h5 = open_file(data, "r") - X = h5.root.data - else: - X = np.array(data) - assert len(X.shape) == 2, "Data must be a 2-dim matrix" - N = X.shape[0] - Nk = min(10*k, N-1) - dist = np.zeros((Nk,)) - - ix = np.random.choice(N, size=Nk) - for i in xrange(Nk): - j = ix[i] - if i == j: - j += 1 - dist[i] = cdist(X[i][None, :], X[j][None, :], kind) - m = dist.mean() - s = dist.std() - - # fill centroids as random points - ix = np.random.choice(N, size=k) - W = np.empty((X.shape[1], k)) - for i in range(len(ix)): - W[:, i] = X[ix[i]] - - # fill bias - B = np.zeros((k,)) - i = 0 - while True: - b0 = (np.random.rand()-0.5)*2*s + m - if b0 > 0: - B[i] = b0 - i += 1 - if i == k: - break - if isinstance(data, basestring): - h5.close() - - return W, B
      -
      - -
      - -
      -
      - -
      - -
      - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/_build/html/_modules/hpelm/mss_cv.html b/docs/_build/html/_modules/hpelm/mss_cv.html deleted file mode 100644 index 16fbd2c..0000000 --- a/docs/_build/html/_modules/hpelm/mss_cv.html +++ /dev/null @@ -1,300 +0,0 @@ - - - - - - - - - - hpelm.mss_cv — hpelm 0.6.22 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      - - - - -
      - - - - - - -
      -
      -
      - -
      -
      -
      - -

      Source code for hpelm.mss_cv

      -# -*- coding: utf-8 -*-
      -"""
      -Created on Mon Oct 27 17:48:33 2014
      -
      -@author: akusok
      -"""
      -
      -import numpy as np
      -
      -
      -
      [docs]def train_cv(self, X, T, k): - """Model structure selection with cross-validation. - - Trains ELM, cross-validates model and sets an optimal validated solution. - - Args: - self (ELM): ELM object that calls `train_v()` - X (matrix): training set inputs - T (matrix): training set outputs - k (int): number of parts to split the dataset into, k-2 parts are used for training and 2 parts are - left out: 1 for validation and 1 for test; repeated k times until all parts have been left out for - validation and test, and results averaged over these k repetitions. - - Returns: - err_t (double): error for the optimal model, computed in the 'cross-testing' manner on data part - which is not used for training or validation - """ - N = X.shape[0] - L = self.nnet.L - c = self.nnet.outputs - - idxk = [] - for i in range(k): - idxk.append(np.arange(N)[i::k]) - - datak = [] - for i in range(k): - items = [(i+j) % k for j in range(k)] - idx_tr = np.hstack([idxk[j] for j in items[:-2]]) - idx_vl = idxk[items[-2]] - idx_ts = idxk[items[-1]] - Xtr = X[idx_tr] - Ttr = T[idx_tr] - Xvl = X[idx_vl] - Tvl = T[idx_vl] - Xts = X[idx_ts] - Tts = T[idx_ts] - self.nnet.reset() - self.nnet.add_batch(Xtr, Ttr) - HH, HT = self.nnet.get_corr() - Hvl = self.nnet._project(Xvl) - Hts = self.nnet._project(Xts) - rank, L = self._ranking(Hvl.shape[1], Hvl, Tvl) - datak.append((HH, HT, Hvl, Tvl, Hts, Tts, rank)) - - e = np.ones((L+1,)) * -1 # errors for all numbers of neurons - - err = 0 - for HH, HT, Hvl, Tvl, _, _, _ in datak: - B = self.nnet.solve_corr(HH, HT) - Yvl = np.dot(Hvl, B) - err += self._error(Tvl, Yvl) / k - penalty = err * 0.01 / L # penalty is 1% of error at max(L) - e[L] = err + L * penalty - - # MYOPT function - # [iA iB iC iD iE] interval points, - # halve the interval each time - - # initialize intervals - iA = 3 - iE = L - l = iE - iA - iB = iA + l/4 - iC = iA + l/2 - iD = iA + 3*l/4 - - # TODO: tell about single-letter matrix notations in the whole code - l = 1000 # run the while loop at least once - while l > 2: - # calculate errors at points - for idx in [iA, iB, iC, iD, iE]: - if e[idx] == -1: # skip already calculated errors - err = 0 - for HH, HT, Hvl, Tvl, _, _, rank in datak: - rank1 = rank[:idx] - HH1 = HH[rank1, :][:, rank1] - HT1 = HT[rank1, :] - B = self.nnet.solve_corr(HH1, HT1) - Yvl = np.dot(Hvl[:, rank1], B) - err += self._error(Tvl, Yvl) / k - e[idx] = err + idx * penalty - - m = min(e[iA], e[iB], e[iC], e[iD], e[iE]) # find minimum element - - # halve the search interval - if m in (e[iA], e[iB]): - iE = iC - iC = iB - elif m in (e[iD], e[iE]): - iA = iC - iC = iD - else: - iA = iB - iE = iD - l = iE - iA - iB = iA + l/4 - iD = iA + (3*l)/4 - - k_opt = [n1 for n1 in [iA, iB, iC, iD, iE] if e[n1] == m][0] # find minimum index - best_L = rank[:k_opt] - - # get test error - err_t = 0 - for HH, HT, _, _, Hts, Tts, _ in datak: - B = self.nnet.solve_corr(HH, HT) - Yts = np.dot(Hts, B) - err_t += self._error(Tts, Yts) / k - - self.nnet._prune(best_L) - self.nnet.add_batch(X, T) - self.nnet.solve() -# print "%d of %d neurons selected with a Cross-Validation" % (len(best_nn), nn) -# print "the Cross-Validation test error is %f" % err_ts -# if len(best_nn) > nn*0.9: -# print "Hint: try re-training with more hidden neurons" - return err_t -
      - -
      - -
      -
      - - - -
      - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/_build/html/_modules/hpelm/mss_hpv.html b/docs/_build/html/_modules/hpelm/mss_hpv.html deleted file mode 100644 index 6d1f291..0000000 --- a/docs/_build/html/_modules/hpelm/mss_hpv.html +++ /dev/null @@ -1,245 +0,0 @@ - - - - - - - - - - hpelm.mss_hpv — hpelm 0.6.22 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      - - - - -
      - - - - - - -
      -
      -
      - -
      -
      -
      - -

      Source code for hpelm.mss_hpv

      -# -*- coding: utf-8 -*-
      -"""
      -Created on Mon Oct 27 17:48:33 2014
      -
      -@author: akusok
      -"""
      -
      -import numpy as np
      -
      -
      -
      [docs]def train_hpv(self, HH, HT, Xv, Tv, Yv): - Beta = self._ - - HH, HT, Beta = self._project(X, T, solve=True) - Hv = self._project(Xv) - nn = Hv.shape[1] - e = np.ones((nn+1,)) * -1 # errors for all numbers of neurons - rank, nn = self._ranking(nn, Hv, Tv) # create ranking of neurons - - Yv = np.dot(Hv, Beta) - err = self._error(Yv, Tv) - penalty = err * 0.01 / nn # penalty is 1% of error at max(nn) - e[nn] = err + nn * penalty - - # MYOPT function - # [A B C D E] interval points, - # halve the interval each time - - # initialize intervals - A = 1 - E = nn - l = E - A - B = A + l/4 - C = A + l/2 - D = A + 3*l/4 - - l = 3 # run the while loop at least once - while l > 2: - # calculate errors at points - for idx in [A, B, C, D, E]: - if e[idx] == -1: # skip already calculated errors - rank1 = rank[:idx] - HH1 = HH[rank1, :][:, rank1] - HT1 = HT[rank1, :] - Beta = self._solve_corr(HH1, HT1) - Yv = np.dot(Hv[:, rank1], Beta) - e[idx] = self._error(Yv, Tv) + idx * penalty - - m = min(e[A], e[B], e[C], e[D], e[E]) # find minimum element - - # halve the search interval - if m in (e[A], e[B]): - E = C - C = B - elif m in (e[D], e[E]): - A = C - C = D - else: - A = B - E = D - l = E - A - B = A + l/4 - D = A + (3*l)/4 - - k_opt = [n1 for n1 in [A, B, C, D, E] if e[n1] == m][0] # find minimum index - best_nn = rank[:k_opt] - - self._prune(best_nn) - self.Beta = self._project(X, T, solve=True)[2] - print "%d of %d neurons selected with a validation set" % (len(best_nn), nn) - if len(best_nn) > nn*0.9: - print "Hint: try re-training with more hidden neurons" -
      - -
      - -
      -
      - - - -
      - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/_build/html/_modules/hpelm/mss_loo.html b/docs/_build/html/_modules/hpelm/mss_loo.html deleted file mode 100644 index e1a8cff..0000000 --- a/docs/_build/html/_modules/hpelm/mss_loo.html +++ /dev/null @@ -1,270 +0,0 @@ - - - - - - - - - - hpelm.mss_loo — hpelm 0.6.22 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      - - - - -
      - - - - - - -
      -
      -
      - -
      -
      -
      - -

      Source code for hpelm.mss_loo

      -# -*- coding: utf-8 -*-
      -"""
      -Created on Mon Oct 27 17:48:33 2014
      -
      -@author: akusok
      -"""
      -
      -import numpy as np
      -from numpy.linalg import inv
      -
      -
      -
      [docs]def train_loo(self, X, T): - """Model structure selection with Leave-One-Out (LOO) validation. - - Trains ELM, validates model with LOO and sets an optimal validated solution. Effect is similar to - cross-validation with k==N, but ELM has explicit formula of solution for LOO without iterating k times. - - Args: - self (ELM): ELM object that calls `train_v()` - X (matrix): training set inputs - T (matrix): training set outputs - """ - - H = self.nnet._project(X) - self.add_data(X, T) - HH, HT = self.nnet.get_corr() - - N = X.shape[0] - L = self.nnet.L - e = np.ones((L+1,)) * -1 # errors for all numbers of neurons - rank, L = self._ranking(L, H, T) # create ranking of neurons - - # PRESS_LOO - P = inv(HH) - Bt = np.dot(P, HT) - R = np.ones((N,)) - np.einsum('ij,ji->i', np.dot(H, P), H.T) - Y = np.dot(H, Bt) - err = self._error(T, Y, R) - - penalty = err * 0.01 / L # penalty is 1% of error at max(L) - e[L] = err + L * penalty - - # MYOPT function - # [iA iB iC iD iE] interval points, - # halve the interval each time - - # initialize intervals - iA = 1 - iE = L - l = iE - iA - iB = iA + l/4 - iC = iA + l/2 - iD = iA + 3*l/4 - - l = 1000 # run the while loop at least once - while l > 2: - # calculate errors at points - for idx in [iA, iB, iC, iD, iE]: - if e[idx] == -1: # skip already calculated errors - rank1 = rank[:idx] - # H1 = H[:, rank1] - H1 = np.take(H, rank1, 1) - HH1 = HH[rank1, :][:, rank1] - HT1 = HT[rank1, :] - - P = inv(HH1) - Bt1 = np.dot(P, HT1) - R = np.ones((N,)) - np.einsum('ij,ji->i', np.dot(H1, P), H1.T) - Y1 = np.dot(H1, Bt1) - err = self._error(T, Y1, R) - e[idx] = err + idx * penalty - - m = min(e[iA], e[iB], e[iC], e[iD], e[iE]) # find minimum element - - # halve the search interval - if m in (e[iA], e[iB]): - iE = iC - iC = iB - elif m in (e[iD], e[iE]): - iA = iC - iC = iD - else: - iA = iB - iE = iD - l = iE - iA - iB = iA + l/4 - iD = iA + (3*l)/4 - - k_opt = [n1 for n1 in [iA, iB, iC, iD, iE] if e[n1] == m][0] # find minimum index - best_L = rank[:k_opt] - - self.nnet._prune(best_L) - self.nnet.add_batch(X, T) - self.nnet.solve() -# print "%d of %d neurons selected with a LOO validation" % (len(best_nn), nn) -# if len(best_nn) > nn*0.9: -# print "Hint: try re-training with more hidden neurons" -
      - -
      - -
      -
      - - - -
      - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/_build/html/_modules/hpelm/mss_v.html b/docs/_build/html/_modules/hpelm/mss_v.html deleted file mode 100644 index 7563988..0000000 --- a/docs/_build/html/_modules/hpelm/mss_v.html +++ /dev/null @@ -1,258 +0,0 @@ - - - - - - - - - - hpelm.mss_v — hpelm 0.6.22 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      - - - - -
      - - - - - - -
      -
      -
      - -
      -
      -
      - -

      Source code for hpelm.mss_v

      -# -*- coding: utf-8 -*-
      -"""
      -Created on Mon Oct 27 17:48:33 2014
      -
      -@author: akusok
      -"""
      -
      -import numpy as np
      -
      -
      -
      [docs]def train_v(self, X, T, Xv, Tv): - """Model structure selection with a validation set. - - Trains ELM, validates model and sets an optimal validated solution. - - Args: - self (ELM): ELM object that calls `train_v()` - X (matrix): training set inputs - T (matrix): training set outputs - Xv (matrix): validation set inputs - Tv (matrix): validation set outputs - """ - self.add_data(X, T) - HH, HT = self.nnet.get_corr() - B = self.nnet.solve_corr(HH, HT) - Hv = self.nnet._project(Xv) - L = self.nnet.L - e = np.ones((L+1,)) * -1 # errors for all numbers of neurons - rank, L = self._ranking(L, Hv, Tv) # create ranking of neurons - - Yv = np.dot(Hv, B) - err = self._error(Tv, Yv) - # TODO: replace penalty by Akaike-BIC criterion - penalty = err*0.01 / L # penalty is 1% of error at max(L) - e[L] = err + L*penalty - - # MYOPT function - # [iA iB iC iD iE] interval points, - # halve the interval each time - - # initialize intervals - iA = 1 - iE = L - l = iE - iA - iB = iA + l/4 - iC = iA + l/2 - iD = iA + 3*l/4 - - l = 3 # run the while loop at least once - while l > 2: - # calculate errors at points - for idx in [iA, iB, iC, iD, iE]: - if e[idx] == -1: # skip already calculated errors - rank1 = rank[:idx] - HH1 = HH[rank1, :][:, rank1] - HT1 = HT[rank1, :] - B = self.nnet.solve_corr(HH1, HT1) - Yv = np.dot(Hv[:, rank1], B) - e[idx] = self._error(Tv, Yv) + idx*penalty - - m = min(e[iA], e[iB], e[iC], e[iD], e[iE]) # find minimum element - - # halve the search interval - if m in (e[iA], e[iB]): - iE = iC - iC = iB - elif m in (e[iD], e[iE]): - iA = iC - iC = iD - else: - iA = iB - iE = iD - l = iE - iA - iB = iA + l/4 - iD = iA + (3*l)/4 - - k_opt = [n1 for n1 in [iA, iB, iC, iD, iE] if e[n1] == m][0] # find minimum index - best_L = rank[:k_opt] - - self.nnet._prune(best_L) - self.nnet.add_batch(X, T) - self.nnet.solve() -# print "%d of %d neurons selected with a validation set" % (len(best_nn), nn) -# if len(best_nn) > nn*0.9: -# print "Hint: try re-training with more hidden neurons" -
      - -
      - -
      -
      - - - -
      - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/_build/html/_modules/hpelm/tests/test_acceptance.html b/docs/_build/html/_modules/hpelm/tests/test_acceptance.html deleted file mode 100644 index fab15d3..0000000 --- a/docs/_build/html/_modules/hpelm/tests/test_acceptance.html +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - - - - - hpelm.tests.test_acceptance — hpelm 0.6.22 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      - - - - -
      - - - - - - -
      -
      -
      - -
      -
      -
      - -

      Source code for hpelm.tests.test_acceptance

      -# -*- coding: utf-8 -*-
      -"""
      -Created on Mon Oct 27 14:12:41 2014
      -
      -@author: akusok
      -"""
      -
      -from unittest import TestCase
      -import numpy as np
      -
      -import hpelm
      -
      -
      -# noinspection PyArgumentList
      -
      [docs]class TestAcceptance(TestCase): - -
      [docs] def test_basic_elm_single_machine(self): - """Just run an ELM with sine function and check training MSE. - """ - n = 1000 - err = 0.2 - Y = np.linspace(-1, 1, num=n) - X = np.sin(16 * Y) * Y + np.random.randn(n) * err - - elm = hpelm.ELM(1, 1) - elm.add_neurons(3, "sigm") - print elm.nnet.get_B() - elm.train(X, Y) - print elm.nnet.get_B() - Yt = elm.predict(X) - - MSE = np.mean((Y - Yt) ** 2) - self.assertLess(MSE, 0.5) -
      -
      [docs] def test_xor_one_neuron_solved(self): - """ELM should be able to solve XOR problem. - """ - X = np.array([[0, 0], - [1, 1], - [1, 0], - [0, 1]]) - Y = np.array([1, 1, -1, -1]) - for _ in range(100): # try 100 random initializations to solve XOR problem - try: - elm = hpelm.ELM(2, 1) - elm.add_neurons(1, "sigm") - elm.train(X, Y) - Yh = elm.predict(X) - self.assertGreater(Yh[0], 0) - self.assertGreater(Yh[1], 0) - self.assertLess(Y[2], 0) - self.assertLess(Y[3], 0) - nn = sum([n[0] for n in elm.nnet.neurons]) - self.assertEqual(nn, 1) # one neuron in the ELM - return - except AssertionError: - pass - self.fail("Cannot train 1 neuron to solve XOR problem in 100 re-initializations")
      -
      - -
      - -
      -
      - -
      - -
      - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/_build/html/_modules/hpelm/tests/test_corr_hpelm.html b/docs/_build/html/_modules/hpelm/tests/test_corr_hpelm.html deleted file mode 100644 index 361c2c9..0000000 --- a/docs/_build/html/_modules/hpelm/tests/test_corr_hpelm.html +++ /dev/null @@ -1,602 +0,0 @@ - - - - - - - - - - hpelm.tests.test_corr_hpelm — hpelm 0.6.22 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      - - - - -
      - - - - - - -
      -
      -
      - -
      -
      -
      - -

      Source code for hpelm.tests.test_corr_hpelm

      -# -*- coding: utf-8 -*-
      -"""Copy of test_correctness.py
      -Created on Wed Sep 23 21:15:18 2015
      -
      -@author: akusok
      -"""
      -
      -
      -from unittest import TestCase
      -import numpy as np
      -import tempfile
      -import os
      -
      -from hpelm import HPELM
      -from hpelm.modules.hdf5_tools import make_hdf5
      -
      -
      -# noinspection PyArgumentList
      -
      [docs]class TestCorrectness(TestCase): - tfiles = None - -
      [docs] def makeh5(self, data): - f, fname = tempfile.mkstemp() - os.close(f) - self.tfiles.append(fname) - make_hdf5(data, fname) - return fname -
      -
      [docs] def makefile(self): - f, fname = tempfile.mkstemp() - os.close(f) - os.remove(fname) - self.tfiles.append(fname) - return fname -
      -
      [docs] def setUp(self): - self.tfiles = [] -
      -
      [docs] def tearDown(self): - for fname in self.tfiles: - os.remove(fname) -
      -
      [docs] def test_NonNumpyInputs_RaiseError(self): - X = np.array([['1', '2'], ['3', '4'], ['5', '6']]) - T = self.makeh5(np.array([[1], [2], [3]])) - hpelm = HPELM(2, 1) - hpelm.add_neurons(1, "lin") - self.assertRaises(AssertionError, hpelm.train, X, T) -
      -
      [docs] def test_NonNumpyTargets_RaiseError(self): - X = self.makeh5(np.array([[1, 2], [3, 4], [5, 6]])) - T = np.array([['a'], ['b'], ['c']]) - hpelm = HPELM(2, 1) - hpelm.add_neurons(1, "lin") - self.assertRaises(AssertionError, hpelm.train, X, T) -
      -
      [docs] def test_OneDimensionInputs_RunsCorrectly(self): - X = self.makeh5(np.array([1, 2, 3])) - T = self.makeh5(np.array([[1], [2], [3]])) - hpelm = HPELM(1, 1) - hpelm.add_neurons(1, "lin") - hpelm.train(X, T) -
      -
      [docs] def test_OneDimensionTargets_RunsCorrectly(self): - X = self.makeh5(np.array([1, 2, 3])) - T = self.makeh5(np.array([1, 2, 3])) - hpelm = HPELM(1, 1) - hpelm.add_neurons(1, "lin") - hpelm.train(X, T) -
      -
      [docs] def test_WrongDimensionalityInputs_RaiseError(self): - X = self.makeh5(np.array([[1, 2], [3, 4], [5, 6]])) - T = self.makeh5(np.array([[1], [2], [3]])) - hpelm = HPELM(1, 1) - hpelm.add_neurons(1, "lin") - self.assertRaises(AssertionError, hpelm.train, X, T) -
      -
      [docs] def test_WrongDimensionalityTargets_RaiseError(self): - X = self.makeh5(np.array([[1, 2], [3, 4], [5, 6]])) - T = self.makeh5(np.array([[1], [2], [3]])) - hpelm = HPELM(1, 2) - hpelm.add_neurons(1, "lin") - self.assertRaises(AssertionError, hpelm.train, X, T) -
      -
      [docs] def test_ZeroInputs_RunsCorrectly(self): - X = self.makeh5(np.array([[0, 0], [0, 0], [0, 0]])) - T = self.makeh5(np.array([1, 2, 3])) - hpelm = HPELM(2, 1) - hpelm.add_neurons(1, "lin") - hpelm.train(X, T) -
      -
      [docs] def test_OneDimensionTargets2_RunsCorrectly(self): - X = self.makeh5(np.array([[1, 2], [3, 4], [5, 6]])) - T = self.makeh5(np.array([[0], [0], [0]])) - hpelm = HPELM(2, 1) - hpelm.add_neurons(1, "lin") - hpelm.train(X, T) -
      -
      [docs] def test_TrainWithoutNeurons_RaiseError(self): - X = self.makeh5(np.array([1, 2, 3])) - T = self.makeh5(np.array([1, 2, 3])) - hpelm = HPELM(1, 1) - self.assertRaises(AssertionError, hpelm.train, X, T) -
      -
      [docs] def test_DifferentNumberOfSamples_RaiseError(self): - X = self.makeh5(np.array([[1, 2], [3, 4], [5, 6]])) - T = self.makeh5(np.array([[1], [2]])) - hpelm = HPELM(2, 1) - self.assertRaises(AssertionError, hpelm.train, X, T) -
      -
      [docs] def test_LinearNeurons_MoreThanInputs_Truncated(self): - hpelm = HPELM(2, 1) - hpelm.add_neurons(3, "lin") - self.assertEqual(2, hpelm.nnet.get_neurons()[0][0]) -
      -
      [docs] def test_LinearNeurons_DefaultMatrix_Identity(self): - hpelm = HPELM(4, 1) - hpelm.add_neurons(3, "lin") - np.testing.assert_array_almost_equal(np.eye(4, 3), hpelm.nnet.get_neurons()[0][2]) -
      -
      [docs] def test_SLFN_AddLinearNeurons_GotThem(self): - hpelm = HPELM(1, 1) - hpelm.add_neurons(1, "lin") - self.assertEquals("lin", hpelm.nnet.get_neurons()[0][1]) -
      -
      [docs] def test_SLFN_AddSigmoidalNeurons_GotThem(self): - hpelm = HPELM(1, 1) - hpelm.add_neurons(1, "sigm") - self.assertEquals("sigm", hpelm.nnet.get_neurons()[0][1]) -
      -
      [docs] def test_SLFN_AddTanhNeurons_GotThem(self): - hpelm = HPELM(1, 1) - hpelm.add_neurons(1, "tanh") - self.assertEquals("tanh", hpelm.nnet.get_neurons()[0][1]) -
      -
      [docs] def test_SLFN_AddRbfL1Neurons_GotThem(self): - hpelm = HPELM(1, 1) - hpelm.add_neurons(1, "rbf_l1") - self.assertEquals("rbf_l1", hpelm.nnet.get_neurons()[0][1]) -
      -
      [docs] def test_SLFN_AddRbfL2Neurons_GotThem(self): - hpelm = HPELM(1, 1) - hpelm.add_neurons(1, "rbf_l2") - self.assertEquals("rbf_l2", hpelm.nnet.get_neurons()[0][1]) -
      -
      [docs] def test_SLFN_AddRbfLinfNeurons_GotThem(self): - hpelm = HPELM(1, 1) - hpelm.add_neurons(1, "rbf_linf") - self.assertEquals("rbf_linf", hpelm.nnet.get_neurons()[0][1]) -
      -
      [docs] def test_SLFN_AddUfuncNeurons_GotThem(self): - hpelm = HPELM(1, 1) - func = np.frompyfunc(lambda a: a+1, 1, 1) - hpelm.add_neurons(1, func) - self.assertIs(func, hpelm.nnet.get_neurons()[0][1]) -
      -
      [docs] def test_SLFN_AddTwoNeuronTypes_GotThem(self): - hpelm = HPELM(1, 1) - hpelm.add_neurons(1, "lin") - hpelm.add_neurons(1, "sigm") - self.assertEquals(2, len(hpelm.nnet.get_neurons())) - ntypes = [nr[1] for nr in hpelm.nnet.get_neurons()] - self.assertIn("lin", ntypes) - self.assertIn("sigm", ntypes) -
      -
      [docs] def test_SLFN_AddNeuronsTwice_GotThem(self): - hpelm = HPELM(1, 1) - hpelm.add_neurons(1, "lin") - hpelm.add_neurons(1, "lin") - self.assertEquals(1, len(hpelm.nnet.get_neurons())) - self.assertEquals(2, hpelm.nnet.get_neurons()[0][0]) -
      -
      [docs] def test_AddNeurons_InitBias_BiasInModel(self): - hpelm = HPELM(1, 1) - bias = np.array([1, 2, 3]) - hpelm.add_neurons(3, "sigm", None, bias) - neurons = hpelm.nnet.get_neurons() - np.testing.assert_array_almost_equal(bias, neurons[0][3]) -
      -
      [docs] def test_AddNeurons_InitW_WInModel(self): - hpelm = HPELM(2, 1) - W = np.array([[1, 2, 3], [4, 5, 6]]) - hpelm.add_neurons(3, "sigm", W, None) - np.testing.assert_array_almost_equal(W, hpelm.nnet.get_neurons()[0][2]) -
      -
      [docs] def test_AddNeurons_InitDefault_BiasWNotZero(self): - hpelm = HPELM(2, 1) - hpelm.add_neurons(3, "sigm") - W = hpelm.nnet.get_neurons()[0][2] - bias = hpelm.nnet.get_neurons()[0][3] - self.assertGreater(np.sum(np.abs(W)), 0.001) - self.assertGreater(np.sum(np.abs(bias)), 0.001) -
      -
      [docs] def test_AddNeurons_InitTwiceBiasW_CorrectlyMerged(self): - hpelm = HPELM(2, 1) - W1 = np.random.rand(2, 3) - W2 = np.random.rand(2, 4) - bias1 = np.random.rand(3,) - bias2 = np.random.rand(4,) - hpelm.add_neurons(3, "sigm", W1, bias1) - hpelm.add_neurons(4, "sigm", W2, bias2) - np.testing.assert_array_almost_equal(np.hstack((W1, W2)), hpelm.nnet.get_neurons()[0][2]) - np.testing.assert_array_almost_equal(np.hstack((bias1, bias2)), hpelm.nnet.get_neurons()[0][3]) -
      -
      [docs] def test_TrainIstart_Works(self): - X = self.makeh5(np.array([[1, 2], [3, 4], [5, 6]])) - T = self.makeh5(np.array([[1], [2], [3]])) - hpelm = HPELM(2, 1) - hpelm.add_neurons(1, "lin") - hpelm.train(X, T, istart=1) -
      -
      [docs] def test_TrainIcount_Works(self): - X = self.makeh5(np.array([[1, 2], [3, 4], [5, 6]])) - T = self.makeh5(np.array([[1], [2], [3]])) - hpelm = HPELM(2, 1) - hpelm.add_neurons(1, "lin") - hpelm.train(X, T, icount=2) -
      -
      [docs] def test_TrainIstart_HasEffect(self): - X = self.makeh5(np.array([[1, 2], [3, 4], [5, 6]])) - T = self.makeh5(np.array([[3], [2], [3]])) - hpelm = HPELM(2, 1) - hpelm.add_neurons(1, "lin") - hpelm.train(X, T) - B1 = hpelm.nnet.get_B() - hpelm.train(X, T, istart=1) - B2 = hpelm.nnet.get_B() - self.assertFalse(np.allclose(B1, B2), "iStart index does not work") -
      -
      [docs] def test_TrainIcount_HasEffect(self): - X = self.makeh5(np.array([[1, 2], [3, 4], [5, 6]])) - T = self.makeh5(np.array([[3], [2], [3]])) - hpelm = HPELM(2, 1) - hpelm.add_neurons(1, "lin") - hpelm.train(X, T) - B1 = hpelm.nnet.get_B() - hpelm.train(X, T, icount=2) - B2 = hpelm.nnet.get_B() - self.assertFalse(np.allclose(B1, B2), "iCount index does not work") -
      -
      [docs] def test_TrainAsync_Works(self): - X = self.makeh5(np.array([[1, 2], [3, 4], [5, 6]])) - T = self.makeh5(np.array([[1], [2], [3]])) - hpelm = HPELM(2, 1) - hpelm.add_neurons(1, "lin") - hpelm.train_async(X, T) -
      -
      [docs] def test_TrainAsyncWeighted_Works(self): - X = self.makeh5(np.array([1, 2, 3, 1, 2, 3])) - T = self.makeh5(np.array([[1, 0], [1, 0], [1, 0], [0, 1], [0, 1], [0, 1]])) - hpelm = HPELM(1, 2) - hpelm.add_neurons(1, "lin") - hpelm.train_async(X, T, 'wc', wc=(1,2)) -
      -
      [docs] def test_TrainAsyncIndexed_Works(self): - X = self.makeh5(np.array([[1, 2], [3, 4], [5, 6], [7, 8]])) - T = self.makeh5(np.array([[1], [2], [3], [4]])) - hpelm = HPELM(2, 1) - hpelm.add_neurons(1, "lin") - hpelm.train_async(X, T, istart=1, icount=2) -
      -
      [docs] def test_WeightedClassification_Works(self): - X = self.makeh5(np.array([1, 2, 3, 1, 2, 3])) - T = self.makeh5(np.array([[1, 0], [1, 0], [1, 0], [0, 1], [0, 1], [0, 1]])) - hpelm = HPELM(1, 2) - hpelm.add_neurons(1, "lin") - hpelm.train(X, T, 'wc', w=(1, 1)) -
      -
      [docs] def test_WeightedClassification_DefaultWeightsWork(self): - X = self.makeh5(np.array([1, 2, 3, 1, 2, 3])) - T = self.makeh5(np.array([[1, 0], [1, 0], [1, 0], [0, 1], [0, 1], [0, 1]])) - hpelm = HPELM(1, 2) - hpelm.add_neurons(1, "lin") - hpelm.train(X, T, 'wc') -
      -
      [docs] def test_HPELM_tprint(self): - X = self.makeh5(np.array([1, 2, 3, 1, 2, 3])) - T = self.makeh5(np.array([[1, 0], [1, 0], [1, 0], [0, 1], [0, 1], [0, 1]])) - hpelm = HPELM(1, 2, batch=2, tprint=0) - hpelm.add_neurons(1, "lin") - hpelm.train(X, T) -
      -
      [docs] def test_AddDataToFile_SingleAddition(self): - X = self.makeh5(np.array([[1, 2], [3, 4], [5, 6], [7, 8]])) - T = self.makeh5(np.array([[1], [2], [3], [4]])) - hpelm = HPELM(2, 1) - hpelm.add_neurons(3, "lin") - fHH = self.makefile() - fHT = self.makefile() - hpelm.add_data(X, T, fHH=fHH, fHT=fHT) -
      -
      [docs] def test_AddDataToFile_MultipleAdditions(self): - X = self.makeh5(np.array([[1, 2], [3, 4], [5, 6], [7, 8]])) - T = self.makeh5(np.array([[1], [2], [3], [4]])) - hpelm = HPELM(2, 1) - hpelm.add_neurons(3, "lin") - fHH = self.makefile() - fHT = self.makefile() - hpelm.add_data(X, T, fHH=fHH, fHT=fHT) - hpelm.add_data(X, T, fHH=fHH, fHT=fHT) -
      -
      [docs] def test_AddDataAsyncToFile_SingleAddition(self): - X = self.makeh5(np.array([[1, 2], [3, 4], [5, 6], [7, 8]])) - T = self.makeh5(np.array([[1], [2], [3], [4]])) - hpelm = HPELM(2, 1) - hpelm.add_neurons(3, "lin") - fHH = self.makefile() - fHT = self.makefile() - hpelm.add_data_async(X, T, fHH=fHH, fHT=fHT) -
      -
      [docs] def test_AddDataAsyncToFile_MultipleAdditions(self): - X = self.makeh5(np.array([[1, 2], [3, 4], [5, 6], [7, 8]])) - T = self.makeh5(np.array([[1], [2], [3], [4]])) - hpelm = HPELM(2, 1) - hpelm.add_neurons(3, "lin") - fHH = self.makefile() - fHT = self.makefile() - hpelm.add_data_async(X, T, fHH=fHH, fHT=fHT) - hpelm.add_data_async(X, T, fHH=fHH, fHT=fHT) -
      -
      [docs] def test_AddDataToFile_MixedSequentialAsync(self): - X = self.makeh5(np.array([[1, 2], [3, 4], [5, 6], [7, 8]])) - T = self.makeh5(np.array([[1], [2], [3], [4]])) - hpelm = HPELM(2, 1) - hpelm.add_neurons(3, "lin") - fHH = self.makefile() - fHT = self.makefile() - hpelm.add_data(X, T, fHH=fHH, fHT=fHT) - hpelm.add_data_async(X, T, fHH=fHH, fHT=fHT) -
      -
      [docs] def test_SolveCorr_Works(self): - X = self.makeh5(np.array([[1, 2], [3, 4], [5, 6], [7, 8]])) - T = self.makeh5(np.array([[1], [2], [3], [4]])) - hpelm = HPELM(2, 1) - hpelm.add_neurons(3, "lin") - fHH = self.makefile() - fHT = self.makefile() - hpelm.add_data(X, T, fHH=fHH, fHT=fHT) - hpelm.solve_corr(fHH, fHT) - self.assertIsNot(hpelm.nnet.get_B(), None) -
      -
      [docs] def test_ValidationCorr_Works(self): - X = self.makeh5(np.random.rand(30, 3)) - T = self.makeh5(np.random.rand(30, 2)) - hpelm = HPELM(3, 2, norm=1e-6) - hpelm.add_neurons(6, "tanh") - fHH = self.makefile() - fHT = self.makefile() - hpelm.add_data(X, T, fHH=fHH, fHT=fHT) - nns, err, confs = hpelm.validation_corr(fHH, fHT, X, T, steps=3) - self.assertGreater(err[0], err[-1]) -
      -
      [docs] def test_ValidationCorr_ReturnsConfusion(self): - X = self.makeh5(np.random.rand(10, 3)) - T = self.makeh5(np.random.rand(10, 2)) - hpelm = HPELM(3, 2, classification="c") - hpelm.add_neurons(6, "tanh") - fHH = self.makefile() - fHT = self.makefile() - hpelm.add_data(X, T, fHH=fHH, fHT=fHT) - _, _, confs = hpelm.validation_corr(fHH, fHT, X, T, steps=3) - self.assertGreater(np.sum(confs[0]), 1) -
      -
      [docs] def test_Predict_Works(self): - X = self.makeh5(np.array([[1, 2], [3, 4], [5, 6], [7, 8]])) - T = self.makeh5(np.array([[1], [2], [3], [4]])) - hpelm = HPELM(2, 1) - hpelm.add_neurons(1, "lin") - hpelm.train(X, T) - fY = self.makefile() - hpelm.predict(X, fY) -
      -
      [docs] def test_PredictAsync_Works(self): - X = self.makeh5(np.array([[1, 2], [3, 4], [5, 6], [7, 8]])) - T = self.makeh5(np.array([[1], [2], [3], [4]])) - hpelm = HPELM(2, 1) - hpelm.add_neurons(1, "lin") - hpelm.train(X, T) - fY = self.makefile() - hpelm.predict_async(X, fY) -
      -
      [docs] def test_Project_Works(self): - X = self.makeh5(np.array([[1, 2], [3, 4], [5, 6], [7, 8]])) - T = self.makeh5(np.array([[1], [2], [3], [4]])) - hpelm = HPELM(2, 1) - hpelm.add_neurons(1, "lin") - hpelm.train(X, T) - fH = self.makefile() - hpelm.project(X, fH) -
      -
      [docs] def test_RegressionError_Works(self): - T = np.array([1, 2, 3]) - Y = np.array([1.1, 2.2, 3.3]) - err1 = np.mean((T - Y) ** 2) - fT = self.makeh5(T) - fY = self.makeh5(Y) - hpelm = HPELM(1, 1) - e = hpelm.error(fT, fY) - np.testing.assert_allclose(e, err1) -
      -
      [docs] def test_ClassificationError_Works(self): - T = self.makeh5(np.array([[0, 1], [0, 1], [1, 0]])) - Y = self.makeh5(np.array([[0, 1], [0.4, 0.6], [0, 1]])) - hpelm = HPELM(1, 2) - hpelm.add_neurons(1, "lin") - hpelm.classification = "c" - e = hpelm.error(T, Y) - np.testing.assert_allclose(e, 1.0 / 3) -
      -
      [docs] def test_WeightedClassError_Works(self): - X = self.makeh5(np.array([1, 2, 3])) - T = self.makeh5(np.array([[0, 1], [0, 1], [1, 0]])) - Y = self.makeh5(np.array([[0, 1], [0.4, 0.6], [0, 1]])) - # here class 0 is totally incorrect, and class 1 is totally correct - w = (9, 1) - hpelm = HPELM(1, 2) - hpelm.add_neurons(1, "lin") - hpelm.train(X, T, "wc", w=w) - e = hpelm.error(T, Y) - np.testing.assert_allclose(e, 0.9) -
      -
      [docs] def test_MultiLabelClassError_Works(self): - T = self.makeh5(np.array([[0, 1], [1, 1], [1, 0]])) - Y = self.makeh5(np.array([[0.4, 0.6], [0.8, 0.6], [1, 1]])) - hpelm = HPELM(1, 2) - hpelm.add_neurons(1, "lin") - hpelm.classification = "ml" - e = hpelm.error(T, Y) - np.testing.assert_allclose(e, 1.0 / 6) -
      - -
      - -
      -
      - - - -
      - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/_build/html/_modules/hpelm/tests/test_correctness.html b/docs/_build/html/_modules/hpelm/tests/test_correctness.html deleted file mode 100644 index 4312a3e..0000000 --- a/docs/_build/html/_modules/hpelm/tests/test_correctness.html +++ /dev/null @@ -1,563 +0,0 @@ - - - - - - - - - - hpelm.tests.test_correctness — hpelm 0.6.22 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      - - - - -
      - - - - - - -
      -
      -
      - -
      -
      -
      - -

      Source code for hpelm.tests.test_correctness

      -# -*- coding: utf-8 -*-
      -"""
      -Created on Mon Oct 27 14:12:41 2014
      -
      -@author: akusok
      -"""
      -
      -import os
      -import tempfile
      -from unittest import TestCase
      -
      -import numpy as np
      -
      -from hpelm import ELM
      -
      -
      -
      [docs]class TestCorrectness(TestCase): -
      [docs] def test_NonNumpyInputs_RaiseError(self): - X = np.array([['1', '2'], ['3', '4'], ['5', '6']]) - T = np.array([[1], [2], [3]]) - elm = ELM(2, 1) - elm.add_neurons(1, "lin") - self.assertRaises(AssertionError, elm.train, X, T) -
      -
      [docs] def test_NonNumpyTargets_RaiseError(self): - X = np.array([[1, 2], [3, 4], [5, 6]]) - T = np.array([['a'], ['b'], ['c']]) - elm = ELM(2, 1) - elm.add_neurons(1, "lin") - self.assertRaises(AssertionError, elm.train, X, T) -
      -
      [docs] def test_OneDimensionInputs_RunsCorrectly(self): - X = np.array([1, 2, 3]) - T = np.array([[1], [2], [3]]) - elm = ELM(1, 1) - elm.add_neurons(1, "lin") - elm.train(X, T) -
      -
      [docs] def test_OneDimensionTargets_RunsCorrectly(self): - X = np.array([1, 2, 3]) - T = np.array([1, 2, 3]) - elm = ELM(1, 1) - elm.add_neurons(1, "lin") - elm.train(X, T) -
      -
      [docs] def test_WrongDimensionalityInputs_RaiseError(self): - X = np.array([[1, 2], [3, 4], [5, 6]]) - T = np.array([[1], [2], [3]]) - elm = ELM(1, 1) - elm.add_neurons(1, "lin") - self.assertRaises(AssertionError, elm.train, X, T) -
      -
      [docs] def test_WrongDimensionalityTargets_RaiseError(self): - X = np.array([[1, 2], [3, 4], [5, 6]]) - T = np.array([[1], [2], [3]]) - elm = ELM(1, 2) - elm.add_neurons(1, "lin") - self.assertRaises(AssertionError, elm.train, X, T) -
      -
      [docs] def test_ZeroInputs_RunsCorrectly(self): - X = np.array([[0, 0], [0, 0], [0, 0]]) - T = np.array([1, 2, 3]) - elm = ELM(2, 1) - elm.add_neurons(1, "lin") - elm.train(X, T) -
      -
      [docs] def test_OneDimensionTargets2_RunsCorrectly(self): - X = np.array([[1, 2], [3, 4], [5, 6]]) - T = np.array([[0], [0], [0]]) - elm = ELM(2, 1) - elm.add_neurons(1, "lin") - elm.train(X, T) -
      -
      [docs] def test_TrainWithoutNeurons_RaiseError(self): - X = np.array([1, 2, 3]) - T = np.array([1, 2, 3]) - elm = ELM(1, 1) - self.assertRaises(AssertionError, elm.train, X, T) -
      -
      [docs] def test_DifferentNumberOfSamples_RaiseError(self): - X = np.array([[1, 2], [3, 4], [5, 6]]) - T = np.array([[1], [2]]) - elm = ELM(2, 1) - self.assertRaises(AssertionError, elm.train, X, T) -
      -
      [docs] def test_LinearNeurons_MoreThanInputs_Truncated(self): - elm = ELM(2, 1) - elm.add_neurons(3, "lin") - self.assertEqual(2, elm.nnet.get_neurons()[0][0]) -
      -
      [docs] def test_LinearNeurons_DefaultMatrix_Identity(self): - elm = ELM(4, 1) - elm.add_neurons(3, "lin") - np.testing.assert_array_almost_equal(np.eye(4, 3), elm.nnet.get_neurons()[0][2]) -
      -
      [docs] def test_SLFN_AddLinearNeurons_GotThem(self): - elm = ELM(1, 1) - elm.add_neurons(1, "lin") - self.assertEquals("lin", elm.nnet.get_neurons()[0][1]) -
      -
      [docs] def test_SLFN_AddSigmoidalNeurons_GotThem(self): - elm = ELM(1, 1) - elm.add_neurons(1, "sigm") - self.assertEquals("sigm", elm.nnet.get_neurons()[0][1]) -
      -
      [docs] def test_SLFN_AddTanhNeurons_GotThem(self): - elm = ELM(1, 1) - elm.add_neurons(1, "tanh") - self.assertEquals("tanh", elm.nnet.get_neurons()[0][1]) -
      -
      [docs] def test_SLFN_AddRbfL1Neurons_GotThem(self): - elm = ELM(1, 1) - elm.add_neurons(1, "rbf_l1") - self.assertEquals("rbf_l1", elm.nnet.get_neurons()[0][1]) -
      -
      [docs] def test_SLFN_AddRbfL2Neurons_GotThem(self): - elm = ELM(1, 1) - elm.add_neurons(1, "rbf_l2") - self.assertEquals("rbf_l2", elm.nnet.get_neurons()[0][1]) -
      -
      [docs] def test_SLFN_AddRbfLinfNeurons_GotThem(self): - elm = ELM(1, 1) - elm.add_neurons(1, "rbf_linf") - self.assertEquals("rbf_linf", elm.nnet.get_neurons()[0][1]) -
      -
      [docs] def test_SLFN_AddUfuncNeurons_GotThem(self): - elm = ELM(1, 1) - func = np.frompyfunc(lambda a: a + 1, 1, 1) - elm.add_neurons(1, func) - self.assertIs(func, elm.nnet.get_neurons()[0][1]) -
      -
      [docs] def test_SLFN_AddTwoNeuronTypes_GotThem(self): - elm = ELM(1, 1) - elm.add_neurons(1, "lin") - elm.add_neurons(1, "sigm") - self.assertEquals(2, len(elm.nnet.get_neurons())) - ntypes = [nr[1] for nr in elm.nnet.get_neurons()] - self.assertIn("lin", ntypes) - self.assertIn("sigm", ntypes) -
      -
      [docs] def test_SLFN_AddNeuronsTwice_GotThem(self): - elm = ELM(1, 1) - elm.add_neurons(1, "lin") - elm.add_neurons(1, "lin") - self.assertEquals(1, len(elm.nnet.get_neurons())) - self.assertEquals(2, elm.nnet.get_neurons()[0][0]) -
      -
      [docs] def test_AddNeurons_InitBias_BiasInModel(self): - elm = ELM(1, 1) - bias = np.array([1, 2, 3]) - elm.add_neurons(3, "sigm", None, bias) - np.testing.assert_array_almost_equal(bias, elm.nnet.get_neurons()[0][3]) -
      -
      [docs] def test_AddNeurons_InitW_WInModel(self): - elm = ELM(2, 1) - W = np.array([[1, 2, 3], [4, 5, 6]]) - elm.add_neurons(3, "sigm", W, None) - np.testing.assert_array_almost_equal(W, elm.nnet.get_neurons()[0][2]) -
      -
      [docs] def test_AddNeurons_InitDefault_BiasWNotZero(self): - elm = ELM(2, 1) - elm.add_neurons(3, "sigm") - W = elm.nnet.get_neurons()[0][2] - bias = elm.nnet.get_neurons()[0][3] - self.assertGreater(np.sum(np.abs(W)), 0.001) - self.assertGreater(np.sum(np.abs(bias)), 0.001) -
      -
      [docs] def test_AddNeurons_InitTwiceBiasW_CorrectlyMerged(self): - elm = ELM(2, 1) - W1 = np.random.rand(2, 3) - W2 = np.random.rand(2, 4) - bias1 = np.random.rand(3, ) - bias2 = np.random.rand(4, ) - elm.add_neurons(3, "sigm", W1, bias1) - elm.add_neurons(4, "sigm", W2, bias2) - np.testing.assert_array_almost_equal(np.hstack((W1, W2)), elm.nnet.get_neurons()[0][2]) - np.testing.assert_array_almost_equal(np.hstack((bias1, bias2)), elm.nnet.get_neurons()[0][3]) -
      -
      [docs] def test_Str_Works(self): - elm = ELM(1, 1) - s = "%s" % elm - self.assertIn("ELM with 1 inputs and 1 output", s) -
      -
      [docs] def test_StrCustomNeurons_DisplaysName(self): - elm = ELM(1, 1) - func = np.sin - elm.add_neurons(1, func) - s_elm = "%s" % elm - self.assertIn("sin", s_elm) -
      -
      [docs] def test_ELMWithBatch_SetsBatch(self): - elm = ELM(1, 1, batch=123) - self.assertEqual(123, elm.batch) -
      -
      [docs] def test_TrainWithBatch_OverwritesBatch(self): - elm = ELM(1, 1, batch=123) - X = np.array([1, 2, 3]) - T = np.array([1, 2, 3]) - elm.add_neurons(1, "lin") - elm.train(X, T, batch=234) - self.assertEqual(234, elm.batch) -
      -
      [docs] def test_Classification_Works(self): - elm = ELM(1, 2) - X = np.array([1, 2, 3, 4, 5, 6]) - T = np.array([[1, 0], [1, 0], [1, 0], [0, 1], [0, 1], [0, 1]]) - elm.add_neurons(1, "lin") - elm.train(X, T, 'c') -
      -
      [docs] def test_Classification_WorksCorreclty(self): - elm = ELM(1, 2) - X = np.array([-1, -0.6, -0.3, 0.3, 0.6, 1]) - T = np.array([[1, 0], [1, 0], [1, 0], [0, 1], [0, 1], [0, 1]]) - elm.add_neurons(1, "lin") - elm.train(X, T, 'c') - Y = elm.predict(X) - print Y - self.assertGreater(Y[0, 0], Y[0, 1]) - self.assertLess(Y[5, 0], Y[5, 1]) -
      -
      [docs] def test_MultiLabelClassification_Works(self): - elm = ELM(1, 2) - X = np.array([1, 2, 3, 4, 5, 6]) - T = np.array([[1, 1], [1, 0], [1, 0], [0, 1], [0, 1], [1, 1]]) - elm.add_neurons(1, "lin") - elm.train(X, T, 'ml') - elm.train(X, T, 'mc') -
      -
      [docs] def test_WeightedClassification_Works(self): - elm = ELM(1, 2) - X = np.array([1, 2, 3, 1, 2, 3]) - T = np.array([[1, 0], [1, 0], [1, 0], [0, 1], [0, 1], [0, 1]]) - elm.add_neurons(1, "lin") - elm.train(X, T, 'wc', w=(1, 1)) -
      -
      [docs] def test_WeightedClassification_DefaultWeightsWork(self): - elm = ELM(1, 2) - X = np.array([1, 2, 3, 1, 2, 3]) - T = np.array([[1, 0], [1, 0], [1, 0], [0, 1], [0, 1], [0, 1]]) - elm.add_neurons(1, "lin") - elm.train(X, T, 'wc') -
      -
      [docs] def test_WeightedClassification_ClassWithLargerWeightWins(self): - elm = ELM(1, 2) - X = np.array([1, 2, 3, 1, 2, 3]) - T = np.array([[1, 0], [1, 0], [1, 0], [0, 1], [0, 1], [0, 1]]) - elm.add_neurons(1, "lin") - elm.train(X, T, 'wc', w=(1, 0.1)) - Y = elm.predict(X) - self.assertGreater(Y[0, 0], Y[0, 1]) - self.assertGreater(Y[1, 0], Y[1, 1]) - self.assertGreater(Y[2, 0], Y[2, 1]) -
      -
      [docs] def test_RegressionError_Works(self): - T = np.array([1, 2, 3]) - Y = np.array([1.1, 2.2, 3.3]) - err1 = np.mean((T - Y) ** 2) - elm = ELM(1, 1) - e = elm.error(T, Y) - np.testing.assert_allclose(e, err1) -
      -
      [docs] def test_ClassificationError_Works(self): - X = np.array([1, 2, 3]) - T = np.array([[0, 1], [0, 1], [1, 0]]) - Y = np.array([[0, 1], [0.4, 0.6], [0, 1]]) - elm = ELM(1, 2, classification='c') - elm.add_neurons(1, "lin") - e = elm.error(T, Y) - np.testing.assert_allclose(e, 1.0 / 3) -
      -
      [docs] def test_WeightedClassError_Works(self): - T = np.array([[0, 1], [0, 1], [1, 0]]) - Y = np.array([[0, 1], [0.4, 0.6], [0, 1]]) - # here class 0 is totally incorrect, and class 1 is totally correct - w = (9, 1) - elm = ELM(1, 2, classification="wc", w=w) - elm.add_neurons(1, "lin") - e = elm.error(T, Y) - np.testing.assert_allclose(e, 0.9) -
      -
      [docs] def test_MultiLabelClassError_Works(self): - X = np.array([1, 2, 3]) - T = np.array([[0, 1], [1, 1], [1, 0]]) - Y = np.array([[0.4, 0.6], [0.8, 0.6], [1, 1]]) - elm = ELM(1, 2, classification="ml") - elm.add_neurons(1, "lin") - e = elm.error(T, Y) - np.testing.assert_allclose(e, 1.0 / 6) -
      -
      [docs] def test_ProjectELM_WorksCorrectly(self): - X = np.array([[1], [2], [3]]) - elm = ELM(1, 1) - elm.add_neurons(1, "tanh", np.array([[1]]), np.array([0])) - H = elm.project(X) - np.testing.assert_allclose(H, np.tanh(X)) -
      -
      [docs] def test_InitELM_SetNorm(self): - nr = 0.03 - elm = ELM(1, 1, norm=nr) - self.assertEqual(nr, elm.nnet.norm) -
      -
      [docs] def test_PrecisionELM_UsesPrecision(self): - elm1 = ELM(1, 1, precision='32') - self.assertIs(elm1.nnet.precision, np.float32) - elm2 = ELM(1, 1, precision='single') - self.assertIs(elm2.nnet.precision, np.float32) - elm3 = ELM(1, 1, precision=np.float32) - self.assertIs(elm3.nnet.precision, np.float32) - elm4 = ELM(1, 1, precision='64') - self.assertIs(elm4.nnet.precision, np.float64) - elm5 = ELM(1, 1, precision='double') - self.assertIs(elm5.nnet.precision, np.float64) - elm6 = ELM(1, 1, precision=np.float64) - self.assertIs(elm6.nnet.precision, np.float64) - elm7 = ELM(1, 1) # default double precision - self.assertIs(elm7.nnet.precision, np.float64) - elm8 = ELM(1, 1, precision="lol") # default double precision - self.assertIs(elm8.nnet.precision, np.float64) -
      -
      [docs] def test_ELM_SaveLoad(self): - X = np.array([1, 2, 3, 1, 2, 3]) - T = np.array([[1, 0], [1, 0], [1, 0], [0, 1], [0, 1], [0, 1]]) - elm = ELM(1, 2, precision='32', norm=0.02) - elm.add_neurons(1, "lin") - elm.add_neurons(2, "tanh") - elm.train(X, T, "wc", w=(0.7, 0.3)) - B1 = elm.nnet.get_B() - try: - f, fname = tempfile.mkstemp() - elm.save(fname) - elm2 = ELM(3, 3) - elm2.load(fname) - finally: - os.close(f) - self.assertEqual(elm2.nnet.inputs, 1) - self.assertEqual(elm2.nnet.outputs, 2) - self.assertEqual(elm2.classification, "wc") - self.assertIs(elm.precision, np.float32) - self.assertIs(elm2.precision, np.float64) # precision has changed - np.testing.assert_allclose(np.array([0.7, 0.3]), elm2.wc) - np.testing.assert_allclose(0.02, elm2.nnet.norm) - np.testing.assert_allclose(B1, elm2.nnet.get_B()) - self.assertEqual(elm2.nnet.get_neurons()[0][1], "lin") - self.assertEqual(elm2.nnet.get_neurons()[1][1], "tanh") -
      -
      [docs] def test_SaveELM_WrongFile(self): - elm = ELM(1, 1) - try: - f, fname = tempfile.mkstemp() - self.assertRaises(IOError, elm.save, os.path.dirname(fname) + "olo/lo") - finally: - os.close(f) -
      -
      [docs] def test_LoadELM_WrongFile(self): - elm = ELM(1, 1) - try: - f, fname = tempfile.mkstemp() - self.assertRaises(IOError, elm.load, fname + "ololo2") - finally: - os.close(f) -
      -
      [docs] def test_ConfusionELM_Classification(self): - T = np.array([[1, 0], [1, 0], [0, 1], [0, 1]]) - Y = np.array([[0, 1], [0, 1], [1, 0], [0, 1]]) - elm = ELM(1, 2) - elm.classification = "c" - C = elm.confusion(T, Y) - np.testing.assert_allclose(C, np.array([[0, 2], [1, 1]])) -
      -
      [docs] def test_ConfusionELM_Multilabel(self): - T = np.array([[1, 0], [1, 0], [0, 1], [0, 1]]) - Y = np.array([[1, 1], [1, 0], [0, 1], [0, 1]]) - elm = ELM(1, 2) - elm.classification = "ml" - C = elm.confusion(T, Y) - np.testing.assert_allclose(C, np.array([[2, 1], [0, 2]])) -
      -
      [docs] def test_MRSR_Works(self): - X = np.random.rand(10, 3) - T = np.random.rand(10, 2) - elm = ELM(3, 2) - elm.add_neurons(5, "tanh") - elm.train(X, T, "LOO", "OP") -
      -
      [docs] def test_MRSR2_Works(self): - X = np.random.rand(20, 9) - T = np.random.rand(20, 12) - elm = ELM(9, 12) - elm.add_neurons(5, "tanh") - elm.train(X, T, "LOO", "OP") -
      - -
      - -
      -
      - - - -
      - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/_build/html/_modules/index.html b/docs/_build/html/_modules/index.html deleted file mode 100644 index eea9370..0000000 --- a/docs/_build/html/_modules/index.html +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - - - - Overview: module code — hpelm 0.6.22 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      - - - - -
      - - - - - - -
      -
      -
      -
        -
      • Docs »
      • - -
      • Overview: module code
      • -
      • - -
      • -
      -
      -
      - - -
      -
      - -
      - -
      - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/_build/html/_sources/hpelm.modules.txt b/docs/_build/html/_sources/hpelm.modules.txt deleted file mode 100644 index a794de7..0000000 --- a/docs/_build/html/_sources/hpelm.modules.txt +++ /dev/null @@ -1,46 +0,0 @@ -hpelm.modules package -===================== - -Submodules ----------- - -hpelm.modules.hdf5_tools module -------------------------------- - -.. automodule:: hpelm.modules.hdf5_tools - :members: - :undoc-members: - :show-inheritance: - -hpelm.modules.mrsr module -------------------------- - -.. automodule:: hpelm.modules.mrsr - :members: - :undoc-members: - :show-inheritance: - -hpelm.modules.mrsr2 module --------------------------- - -.. automodule:: hpelm.modules.mrsr2 - :members: - :undoc-members: - :show-inheritance: - -hpelm.modules.rbf_param module ------------------------------- - -.. automodule:: hpelm.modules.rbf_param - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: hpelm.modules - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_build/html/_sources/hpelm.tests.txt b/docs/_build/html/_sources/hpelm.tests.txt deleted file mode 100644 index 017fbf4..0000000 --- a/docs/_build/html/_sources/hpelm.tests.txt +++ /dev/null @@ -1,38 +0,0 @@ -hpelm.tests package -=================== - -Submodules ----------- - -hpelm.tests.test_acceptance module ----------------------------------- - -.. automodule:: hpelm.tests.test_acceptance - :members: - :undoc-members: - :show-inheritance: - -hpelm.tests.test_corr_hpelm module ----------------------------------- - -.. automodule:: hpelm.tests.test_corr_hpelm - :members: - :undoc-members: - :show-inheritance: - -hpelm.tests.test_correctness module ------------------------------------ - -.. automodule:: hpelm.tests.test_correctness - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: hpelm.tests - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_build/html/_sources/hpelm.txt b/docs/_build/html/_sources/hpelm.txt deleted file mode 100644 index 29f8d9e..0000000 --- a/docs/_build/html/_sources/hpelm.txt +++ /dev/null @@ -1,71 +0,0 @@ -hpelm package -============= - -Subpackages ------------ - -.. toctree:: - - hpelm.modules - hpelm.nnets - hpelm.tests - -Submodules ----------- - -hpelm.elm module ----------------- - -.. automodule:: hpelm.elm - :members: - :undoc-members: - :show-inheritance: - -hpelm.hp_elm module -------------------- - -.. automodule:: hpelm.hp_elm - :members: - :undoc-members: - :show-inheritance: - -hpelm.mss_cv module -------------------- - -.. automodule:: hpelm.mss_cv - :members: - :undoc-members: - :show-inheritance: - -hpelm.mss_hpv module --------------------- - -.. automodule:: hpelm.mss_hpv - :members: - :undoc-members: - :show-inheritance: - -hpelm.mss_loo module --------------------- - -.. automodule:: hpelm.mss_loo - :members: - :undoc-members: - :show-inheritance: - -hpelm.mss_v module ------------------- - -.. automodule:: hpelm.mss_v - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: hpelm - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_build/html/_sources/index.txt b/docs/_build/html/_sources/index.txt deleted file mode 100644 index 229e685..0000000 --- a/docs/_build/html/_sources/index.txt +++ /dev/null @@ -1,23 +0,0 @@ -.. hpelm documentation master file, created by - sphinx-quickstart on Sun Nov 1 20:13:17 2015. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -Welcome to hpelm's documentation! -================================= - -Contents: - -.. toctree:: - :maxdepth: 2 - - hpelm - - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` - diff --git a/docs/_build/html/_sources/modules.txt b/docs/_build/html/_sources/modules.txt deleted file mode 100644 index a112878..0000000 --- a/docs/_build/html/_sources/modules.txt +++ /dev/null @@ -1,7 +0,0 @@ -hpelm -===== - -.. toctree:: - :maxdepth: 4 - - hpelm diff --git a/docs/_build/html/_static/ajax-loader.gif b/docs/_build/html/_static/ajax-loader.gif deleted file mode 100644 index 61faf8c..0000000 Binary files a/docs/_build/html/_static/ajax-loader.gif and /dev/null differ diff --git a/docs/_build/html/_static/basic.css b/docs/_build/html/_static/basic.css deleted file mode 100644 index 9fa77d8..0000000 --- a/docs/_build/html/_static/basic.css +++ /dev/null @@ -1,599 +0,0 @@ -/* - * basic.css - * ~~~~~~~~~ - * - * Sphinx stylesheet -- basic theme. - * - * :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -/* -- main layout ----------------------------------------------------------- */ - -div.clearer { - clear: both; -} - -/* -- relbar ---------------------------------------------------------------- */ - -div.related { - width: 100%; - font-size: 90%; -} - -div.related h3 { - display: none; -} - -div.related ul { - margin: 0; - padding: 0 0 0 10px; - list-style: none; -} - -div.related li { - display: inline; -} - -div.related li.right { - float: right; - margin-right: 5px; -} - -/* -- sidebar --------------------------------------------------------------- */ - -div.sphinxsidebarwrapper { - padding: 10px 5px 0 10px; -} - -div.sphinxsidebar { - float: left; - width: 230px; - margin-left: -100%; - font-size: 90%; -} - -div.sphinxsidebar ul { - list-style: none; -} - -div.sphinxsidebar ul ul, -div.sphinxsidebar ul.want-points { - margin-left: 20px; - list-style: square; -} - -div.sphinxsidebar ul ul { - margin-top: 0; - margin-bottom: 0; -} - -div.sphinxsidebar form { - margin-top: 10px; -} - -div.sphinxsidebar input { - border: 1px solid #98dbcc; - font-family: sans-serif; - font-size: 1em; -} - -div.sphinxsidebar #searchbox input[type="text"] { - width: 170px; -} - -div.sphinxsidebar #searchbox input[type="submit"] { - width: 30px; -} - -img { - border: 0; - max-width: 100%; -} - -/* -- search page ----------------------------------------------------------- */ - -ul.search { - margin: 10px 0 0 20px; - padding: 0; -} - -ul.search li { - padding: 5px 0 5px 20px; - background-image: url(file.png); - background-repeat: no-repeat; - background-position: 0 7px; -} - -ul.search li a { - font-weight: bold; -} - -ul.search li div.context { - color: #888; - margin: 2px 0 0 30px; - text-align: left; -} - -ul.keywordmatches li.goodmatch a { - font-weight: bold; -} - -/* -- index page ------------------------------------------------------------ */ - -table.contentstable { - width: 90%; -} - -table.contentstable p.biglink { - line-height: 150%; -} - -a.biglink { - font-size: 1.3em; -} - -span.linkdescr { - font-style: italic; - padding-top: 5px; - font-size: 90%; -} - -/* -- general index --------------------------------------------------------- */ - -table.indextable { - width: 100%; -} - -table.indextable td { - text-align: left; - vertical-align: top; -} - -table.indextable dl, table.indextable dd { - margin-top: 0; - margin-bottom: 0; -} - -table.indextable tr.pcap { - height: 10px; -} - -table.indextable tr.cap { - margin-top: 10px; - background-color: #f2f2f2; -} - -img.toggler { - margin-right: 3px; - margin-top: 3px; - cursor: pointer; -} - -div.modindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -div.genindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -/* -- general body styles --------------------------------------------------- */ - -a.headerlink { - visibility: hidden; -} - -h1:hover > a.headerlink, -h2:hover > a.headerlink, -h3:hover > a.headerlink, -h4:hover > a.headerlink, -h5:hover > a.headerlink, -h6:hover > a.headerlink, -dt:hover > a.headerlink, -caption:hover > a.headerlink, -p.caption:hover > a.headerlink, -div.code-block-caption:hover > a.headerlink { - visibility: visible; -} - -div.body p.caption { - text-align: inherit; -} - -div.body td { - text-align: left; -} - -.field-list ul { - padding-left: 1em; -} - -.first { - margin-top: 0 !important; -} - -p.rubric { - margin-top: 30px; - font-weight: bold; -} - -img.align-left, .figure.align-left, object.align-left { - clear: left; - float: left; - margin-right: 1em; -} - -img.align-right, .figure.align-right, object.align-right { - clear: right; - float: right; - margin-left: 1em; -} - -img.align-center, .figure.align-center, object.align-center { - display: block; - margin-left: auto; - margin-right: auto; -} - -.align-left { - text-align: left; -} - -.align-center { - text-align: center; -} - -.align-right { - text-align: right; -} - -/* -- sidebars -------------------------------------------------------------- */ - -div.sidebar { - margin: 0 0 0.5em 1em; - border: 1px solid #ddb; - padding: 7px 7px 0 7px; - background-color: #ffe; - width: 40%; - float: right; -} - -p.sidebar-title { - font-weight: bold; -} - -/* -- topics ---------------------------------------------------------------- */ - -div.topic { - border: 1px solid #ccc; - padding: 7px 7px 0 7px; - margin: 10px 0 10px 0; -} - -p.topic-title { - font-size: 1.1em; - font-weight: bold; - margin-top: 10px; -} - -/* -- admonitions ----------------------------------------------------------- */ - -div.admonition { - margin-top: 10px; - margin-bottom: 10px; - padding: 7px; -} - -div.admonition dt { - font-weight: bold; -} - -div.admonition dl { - margin-bottom: 0; -} - -p.admonition-title { - margin: 0px 10px 5px 0px; - font-weight: bold; -} - -div.body p.centered { - text-align: center; - margin-top: 25px; -} - -/* -- tables ---------------------------------------------------------------- */ - -table.docutils { - border: 0; - border-collapse: collapse; -} - -table caption span.caption-number { - font-style: italic; -} - -table caption span.caption-text { -} - -table.docutils td, table.docutils th { - padding: 1px 8px 1px 5px; - border-top: 0; - border-left: 0; - border-right: 0; - border-bottom: 1px solid #aaa; -} - -table.field-list td, table.field-list th { - border: 0 !important; -} - -table.footnote td, table.footnote th { - border: 0 !important; -} - -th { - text-align: left; - padding-right: 5px; -} - -table.citation { - border-left: solid 1px gray; - margin-left: 1px; -} - -table.citation td { - border-bottom: none; -} - -/* -- figures --------------------------------------------------------------- */ - -div.figure { - margin: 0.5em; - padding: 0.5em; -} - -div.figure p.caption { - padding: 0.3em; -} - -div.figure p.caption span.caption-number { - font-style: italic; -} - -div.figure p.caption span.caption-text { -} - - -/* -- other body styles ----------------------------------------------------- */ - -ol.arabic { - list-style: decimal; -} - -ol.loweralpha { - list-style: lower-alpha; -} - -ol.upperalpha { - list-style: upper-alpha; -} - -ol.lowerroman { - list-style: lower-roman; -} - -ol.upperroman { - list-style: upper-roman; -} - -dl { - margin-bottom: 15px; -} - -dd p { - margin-top: 0px; -} - -dd ul, dd table { - margin-bottom: 10px; -} - -dd { - margin-top: 3px; - margin-bottom: 10px; - margin-left: 30px; -} - -dt:target, .highlighted { - background-color: #fbe54e; -} - -dl.glossary dt { - font-weight: bold; - font-size: 1.1em; -} - -.field-list ul { - margin: 0; - padding-left: 1em; -} - -.field-list p { - margin: 0; -} - -.optional { - font-size: 1.3em; -} - -.sig-paren { - font-size: larger; -} - -.versionmodified { - font-style: italic; -} - -.system-message { - background-color: #fda; - padding: 5px; - border: 3px solid red; -} - -.footnote:target { - background-color: #ffa; -} - -.line-block { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} - -.line-block .line-block { - margin-top: 0; - margin-bottom: 0; - margin-left: 1.5em; -} - -.guilabel, .menuselection { - font-family: sans-serif; -} - -.accelerator { - text-decoration: underline; -} - -.classifier { - font-style: oblique; -} - -abbr, acronym { - border-bottom: dotted 1px; - cursor: help; -} - -/* -- code displays --------------------------------------------------------- */ - -pre { - overflow: auto; - overflow-y: hidden; /* fixes display issues on Chrome browsers */ -} - -td.linenos pre { - padding: 5px 0px; - border: 0; - background-color: transparent; - color: #aaa; -} - -table.highlighttable { - margin-left: 0.5em; -} - -table.highlighttable td { - padding: 0 0.5em 0 0.5em; -} - -div.code-block-caption { - padding: 2px 5px; - font-size: small; -} - -div.code-block-caption code { - background-color: transparent; -} - -div.code-block-caption + div > div.highlight > pre { - margin-top: 0; -} - -div.code-block-caption span.caption-number { - padding: 0.1em 0.3em; - font-style: italic; -} - -div.code-block-caption span.caption-text { -} - -div.literal-block-wrapper { - padding: 1em 1em 0; -} - -div.literal-block-wrapper div.highlight { - margin: 0; -} - -code.descname { - background-color: transparent; - font-weight: bold; - font-size: 1.2em; -} - -code.descclassname { - background-color: transparent; -} - -code.xref, a code { - background-color: transparent; - font-weight: bold; -} - -h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { - background-color: transparent; -} - -.viewcode-link { - float: right; -} - -.viewcode-back { - float: right; - font-family: sans-serif; -} - -div.viewcode-block:target { - margin: -1px -10px; - padding: 0 10px; -} - -/* -- math display ---------------------------------------------------------- */ - -img.math { - vertical-align: middle; -} - -div.body div.math p { - text-align: center; -} - -span.eqno { - float: right; -} - -/* -- printout stylesheet --------------------------------------------------- */ - -@media print { - div.document, - div.documentwrapper, - div.bodywrapper { - margin: 0 !important; - width: 100%; - } - - div.sphinxsidebar, - div.related, - div.footer, - #top-link { - display: none; - } -} \ No newline at end of file diff --git a/docs/_build/html/_static/comment-bright.png b/docs/_build/html/_static/comment-bright.png deleted file mode 100644 index 551517b..0000000 Binary files a/docs/_build/html/_static/comment-bright.png and /dev/null differ diff --git a/docs/_build/html/_static/comment-close.png b/docs/_build/html/_static/comment-close.png deleted file mode 100644 index 09b54be..0000000 Binary files a/docs/_build/html/_static/comment-close.png and /dev/null differ diff --git a/docs/_build/html/_static/comment.png b/docs/_build/html/_static/comment.png deleted file mode 100644 index 92feb52..0000000 Binary files a/docs/_build/html/_static/comment.png and /dev/null differ diff --git a/docs/_build/html/_static/css/badge_only.css b/docs/_build/html/_static/css/badge_only.css deleted file mode 100644 index 7e17fb1..0000000 --- a/docs/_build/html/_static/css/badge_only.css +++ /dev/null @@ -1,2 +0,0 @@ -.fa:before{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-weight:normal;font-style:normal;src:url("../font/fontawesome_webfont.eot");src:url("../font/fontawesome_webfont.eot?#iefix") format("embedded-opentype"),url("../font/fontawesome_webfont.woff") format("woff"),url("../font/fontawesome_webfont.ttf") format("truetype"),url("../font/fontawesome_webfont.svg#FontAwesome") format("svg")}.fa:before{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:normal;line-height:1;text-decoration:inherit}a .fa{display:inline-block;text-decoration:inherit}li .fa{display:inline-block}li .fa-large:before,li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-0.8em}ul.fas li .fa{width:0.8em}ul.fas li .fa-large:before,ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before{content:""}.icon-book:before{content:""}.fa-caret-down:before{content:""}.icon-caret-down:before{content:""}.fa-caret-up:before{content:""}.icon-caret-up:before{content:""}.fa-caret-left:before{content:""}.icon-caret-left:before{content:""}.fa-caret-right:before{content:""}.icon-caret-right:before{content:""}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;border-top:solid 10px #343131;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;z-index:400}.rst-versions a{color:#2980B9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27AE60;*zoom:1}.rst-versions .rst-current-version:before,.rst-versions .rst-current-version:after{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst-versions .rst-current-version .fa-book{float:left}.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#E74C3C;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#F1C40F;color:#000}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:gray;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:solid 1px #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px}.rst-versions.rst-badge .icon-book{float:none}.rst-versions.rst-badge .fa-book{float:none}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book{float:left}.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge .rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width: 768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}img{width:100%;height:auto}} -/*# sourceMappingURL=badge_only.css.map */ diff --git a/docs/_build/html/_static/css/theme.css b/docs/_build/html/_static/css/theme.css deleted file mode 100644 index 390d706..0000000 --- a/docs/_build/html/_static/css/theme.css +++ /dev/null @@ -1,5 +0,0 @@ -*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none}[hidden]{display:none}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}a:hover,a:active{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}blockquote{margin:0}dfn{font-style:italic}ins{background:#ff9;color:#000;text-decoration:none}mark{background:#ff0;color:#000;font-style:italic;font-weight:bold}pre,code,.rst-content tt,kbd,samp{font-family:monospace,serif;_font-family:"courier new",monospace;font-size:1em}pre{white-space:pre}q{quotes:none}q:before,q:after{content:"";content:none}small{font-size:85%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}ul,ol,dl{margin:0;padding:0;list-style:none;list-style-image:none}li{list-style:none}dd{margin:0}img{border:0;-ms-interpolation-mode:bicubic;vertical-align:middle;max-width:100%}svg:not(:root){overflow:hidden}figure{margin:0}form{margin:0}fieldset{border:0;margin:0;padding:0}label{cursor:pointer}legend{border:0;*margin-left:-7px;padding:0;white-space:normal}button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}button,input{line-height:normal}button,input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button;*overflow:visible}button[disabled],input[disabled]{cursor:default}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0;*width:13px;*height:13px}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top;resize:vertical}table{border-collapse:collapse;border-spacing:0}td{vertical-align:top}.chromeframe{margin:0.2em 0;background:#ccc;color:#000;padding:0.2em 0}.ir{display:block;border:0;text-indent:-999em;overflow:hidden;background-color:transparent;background-repeat:no-repeat;text-align:left;direction:ltr;*line-height:0}.ir br{display:none}.hidden{display:none !important;visibility:hidden}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.visuallyhidden.focusable:active,.visuallyhidden.focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}.invisible{visibility:hidden}.relative{position:relative}big,small{font-size:100%}@media print{html,body,section{background:none !important}*{box-shadow:none !important;text-shadow:none !important;filter:none !important;-ms-filter:none !important}a,a:visited{text-decoration:underline}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}}.fa:before,.rst-content .admonition-title:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content dl dt .headerlink:before,.icon:before,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-alert,.rst-content .note,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .warning,.rst-content .seealso,.rst-content .admonition-todo,.btn,input[type="text"],input[type="password"],input[type="email"],input[type="url"],input[type="date"],input[type="month"],input[type="time"],input[type="datetime"],input[type="datetime-local"],input[type="week"],input[type="number"],input[type="search"],input[type="tel"],input[type="color"],select,textarea,.wy-menu-vertical li.on a,.wy-menu-vertical li.current>a,.wy-side-nav-search>a,.wy-side-nav-search .wy-dropdown>a,.wy-nav-top a{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}/*! - * Font Awesome 4.2.0 by @davegandy - http://fontawesome.io - @fontawesome - * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) - */@font-face{font-family:'FontAwesome';src:url("../fonts/fontawesome-webfont.eot?v=4.2.0");src:url("../fonts/fontawesome-webfont.eot?#iefix&v=4.2.0") format("embedded-opentype"),url("../fonts/fontawesome-webfont.woff?v=4.2.0") format("woff"),url("../fonts/fontawesome-webfont.ttf?v=4.2.0") format("truetype"),url("../fonts/fontawesome-webfont.svg?v=4.2.0#fontawesomeregular") format("svg");font-weight:normal;font-style:normal}.fa,.rst-content .admonition-title,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content dl dt .headerlink,.icon{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333em;line-height:0.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14286em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14286em;width:2.14286em;top:0.14286em;text-align:center}.fa-li.fa-lg{left:-1.85714em}.fa-border{padding:.2em .25em .15em;border:solid 0.08em #eee;border-radius:.1em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left,.rst-content .pull-left.admonition-title,.rst-content h1 .pull-left.headerlink,.rst-content h2 .pull-left.headerlink,.rst-content h3 .pull-left.headerlink,.rst-content h4 .pull-left.headerlink,.rst-content h5 .pull-left.headerlink,.rst-content h6 .pull-left.headerlink,.rst-content dl dt .pull-left.headerlink,.pull-left.icon{margin-right:.3em}.fa.pull-right,.rst-content .pull-right.admonition-title,.rst-content h1 .pull-right.headerlink,.rst-content h2 .pull-right.headerlink,.rst-content h3 .pull-right.headerlink,.rst-content h4 .pull-right.headerlink,.rst-content h5 .pull-right.headerlink,.rst-content h6 .pull-right.headerlink,.rst-content dl dt .pull-right.headerlink,.pull-right.icon{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0);-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:""}.fa-music:before{content:""}.fa-search:before,.icon-search:before{content:""}.fa-envelope-o:before{content:""}.fa-heart:before{content:""}.fa-star:before{content:""}.fa-star-o:before{content:""}.fa-user:before{content:""}.fa-film:before{content:""}.fa-th-large:before{content:""}.fa-th:before{content:""}.fa-th-list:before{content:""}.fa-check:before{content:""}.fa-remove:before,.fa-close:before,.fa-times:before{content:""}.fa-search-plus:before{content:""}.fa-search-minus:before{content:""}.fa-power-off:before{content:""}.fa-signal:before{content:""}.fa-gear:before,.fa-cog:before{content:""}.fa-trash-o:before{content:""}.fa-home:before,.icon-home:before{content:""}.fa-file-o:before{content:""}.fa-clock-o:before{content:""}.fa-road:before{content:""}.fa-download:before{content:""}.fa-arrow-circle-o-down:before{content:""}.fa-arrow-circle-o-up:before{content:""}.fa-inbox:before{content:""}.fa-play-circle-o:before{content:""}.fa-rotate-right:before,.fa-repeat:before{content:""}.fa-refresh:before{content:""}.fa-list-alt:before{content:""}.fa-lock:before{content:""}.fa-flag:before{content:""}.fa-headphones:before{content:""}.fa-volume-off:before{content:""}.fa-volume-down:before{content:""}.fa-volume-up:before{content:""}.fa-qrcode:before{content:""}.fa-barcode:before{content:""}.fa-tag:before{content:""}.fa-tags:before{content:""}.fa-book:before,.icon-book:before{content:""}.fa-bookmark:before{content:""}.fa-print:before{content:""}.fa-camera:before{content:""}.fa-font:before{content:""}.fa-bold:before{content:""}.fa-italic:before{content:""}.fa-text-height:before{content:""}.fa-text-width:before{content:""}.fa-align-left:before{content:""}.fa-align-center:before{content:""}.fa-align-right:before{content:""}.fa-align-justify:before{content:""}.fa-list:before{content:""}.fa-dedent:before,.fa-outdent:before{content:""}.fa-indent:before{content:""}.fa-video-camera:before{content:""}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:""}.fa-pencil:before{content:""}.fa-map-marker:before{content:""}.fa-adjust:before{content:""}.fa-tint:before{content:""}.fa-edit:before,.fa-pencil-square-o:before{content:""}.fa-share-square-o:before{content:""}.fa-check-square-o:before{content:""}.fa-arrows:before{content:""}.fa-step-backward:before{content:""}.fa-fast-backward:before{content:""}.fa-backward:before{content:""}.fa-play:before{content:""}.fa-pause:before{content:""}.fa-stop:before{content:""}.fa-forward:before{content:""}.fa-fast-forward:before{content:""}.fa-step-forward:before{content:""}.fa-eject:before{content:""}.fa-chevron-left:before{content:""}.fa-chevron-right:before{content:""}.fa-plus-circle:before{content:""}.fa-minus-circle:before{content:""}.fa-times-circle:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before{content:""}.fa-check-circle:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before{content:""}.fa-question-circle:before{content:""}.fa-info-circle:before{content:""}.fa-crosshairs:before{content:""}.fa-times-circle-o:before{content:""}.fa-check-circle-o:before{content:""}.fa-ban:before{content:""}.fa-arrow-left:before{content:""}.fa-arrow-right:before{content:""}.fa-arrow-up:before{content:""}.fa-arrow-down:before{content:""}.fa-mail-forward:before,.fa-share:before{content:""}.fa-expand:before{content:""}.fa-compress:before{content:""}.fa-plus:before{content:""}.fa-minus:before{content:""}.fa-asterisk:before{content:""}.fa-exclamation-circle:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.rst-content .admonition-title:before{content:""}.fa-gift:before{content:""}.fa-leaf:before{content:""}.fa-fire:before,.icon-fire:before{content:""}.fa-eye:before{content:""}.fa-eye-slash:before{content:""}.fa-warning:before,.fa-exclamation-triangle:before{content:""}.fa-plane:before{content:""}.fa-calendar:before{content:""}.fa-random:before{content:""}.fa-comment:before{content:""}.fa-magnet:before{content:""}.fa-chevron-up:before{content:""}.fa-chevron-down:before{content:""}.fa-retweet:before{content:""}.fa-shopping-cart:before{content:""}.fa-folder:before{content:""}.fa-folder-open:before{content:""}.fa-arrows-v:before{content:""}.fa-arrows-h:before{content:""}.fa-bar-chart-o:before,.fa-bar-chart:before{content:""}.fa-twitter-square:before{content:""}.fa-facebook-square:before{content:""}.fa-camera-retro:before{content:""}.fa-key:before{content:""}.fa-gears:before,.fa-cogs:before{content:""}.fa-comments:before{content:""}.fa-thumbs-o-up:before{content:""}.fa-thumbs-o-down:before{content:""}.fa-star-half:before{content:""}.fa-heart-o:before{content:""}.fa-sign-out:before{content:""}.fa-linkedin-square:before{content:""}.fa-thumb-tack:before{content:""}.fa-external-link:before{content:""}.fa-sign-in:before{content:""}.fa-trophy:before{content:""}.fa-github-square:before{content:""}.fa-upload:before{content:""}.fa-lemon-o:before{content:""}.fa-phone:before{content:""}.fa-square-o:before{content:""}.fa-bookmark-o:before{content:""}.fa-phone-square:before{content:""}.fa-twitter:before{content:""}.fa-facebook:before{content:""}.fa-github:before,.icon-github:before{content:""}.fa-unlock:before{content:""}.fa-credit-card:before{content:""}.fa-rss:before{content:""}.fa-hdd-o:before{content:""}.fa-bullhorn:before{content:""}.fa-bell:before{content:""}.fa-certificate:before{content:""}.fa-hand-o-right:before{content:""}.fa-hand-o-left:before{content:""}.fa-hand-o-up:before{content:""}.fa-hand-o-down:before{content:""}.fa-arrow-circle-left:before,.icon-circle-arrow-left:before{content:""}.fa-arrow-circle-right:before,.icon-circle-arrow-right:before{content:""}.fa-arrow-circle-up:before{content:""}.fa-arrow-circle-down:before{content:""}.fa-globe:before{content:""}.fa-wrench:before{content:""}.fa-tasks:before{content:""}.fa-filter:before{content:""}.fa-briefcase:before{content:""}.fa-arrows-alt:before{content:""}.fa-group:before,.fa-users:before{content:""}.fa-chain:before,.fa-link:before,.icon-link:before{content:""}.fa-cloud:before{content:""}.fa-flask:before{content:""}.fa-cut:before,.fa-scissors:before{content:""}.fa-copy:before,.fa-files-o:before{content:""}.fa-paperclip:before{content:""}.fa-save:before,.fa-floppy-o:before{content:""}.fa-square:before{content:""}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:""}.fa-list-ul:before{content:""}.fa-list-ol:before{content:""}.fa-strikethrough:before{content:""}.fa-underline:before{content:""}.fa-table:before{content:""}.fa-magic:before{content:""}.fa-truck:before{content:""}.fa-pinterest:before{content:""}.fa-pinterest-square:before{content:""}.fa-google-plus-square:before{content:""}.fa-google-plus:before{content:""}.fa-money:before{content:""}.fa-caret-down:before,.wy-dropdown .caret:before,.icon-caret-down:before{content:""}.fa-caret-up:before{content:""}.fa-caret-left:before{content:""}.fa-caret-right:before{content:""}.fa-columns:before{content:""}.fa-unsorted:before,.fa-sort:before{content:""}.fa-sort-down:before,.fa-sort-desc:before{content:""}.fa-sort-up:before,.fa-sort-asc:before{content:""}.fa-envelope:before{content:""}.fa-linkedin:before{content:""}.fa-rotate-left:before,.fa-undo:before{content:""}.fa-legal:before,.fa-gavel:before{content:""}.fa-dashboard:before,.fa-tachometer:before{content:""}.fa-comment-o:before{content:""}.fa-comments-o:before{content:""}.fa-flash:before,.fa-bolt:before{content:""}.fa-sitemap:before{content:""}.fa-umbrella:before{content:""}.fa-paste:before,.fa-clipboard:before{content:""}.fa-lightbulb-o:before{content:""}.fa-exchange:before{content:""}.fa-cloud-download:before{content:""}.fa-cloud-upload:before{content:""}.fa-user-md:before{content:""}.fa-stethoscope:before{content:""}.fa-suitcase:before{content:""}.fa-bell-o:before{content:""}.fa-coffee:before{content:""}.fa-cutlery:before{content:""}.fa-file-text-o:before{content:""}.fa-building-o:before{content:""}.fa-hospital-o:before{content:""}.fa-ambulance:before{content:""}.fa-medkit:before{content:""}.fa-fighter-jet:before{content:""}.fa-beer:before{content:""}.fa-h-square:before{content:""}.fa-plus-square:before{content:""}.fa-angle-double-left:before{content:""}.fa-angle-double-right:before{content:""}.fa-angle-double-up:before{content:""}.fa-angle-double-down:before{content:""}.fa-angle-left:before{content:""}.fa-angle-right:before{content:""}.fa-angle-up:before{content:""}.fa-angle-down:before{content:""}.fa-desktop:before{content:""}.fa-laptop:before{content:""}.fa-tablet:before{content:""}.fa-mobile-phone:before,.fa-mobile:before{content:""}.fa-circle-o:before{content:""}.fa-quote-left:before{content:""}.fa-quote-right:before{content:""}.fa-spinner:before{content:""}.fa-circle:before{content:""}.fa-mail-reply:before,.fa-reply:before{content:""}.fa-github-alt:before{content:""}.fa-folder-o:before{content:""}.fa-folder-open-o:before{content:""}.fa-smile-o:before{content:""}.fa-frown-o:before{content:""}.fa-meh-o:before{content:""}.fa-gamepad:before{content:""}.fa-keyboard-o:before{content:""}.fa-flag-o:before{content:""}.fa-flag-checkered:before{content:""}.fa-terminal:before{content:""}.fa-code:before{content:""}.fa-mail-reply-all:before,.fa-reply-all:before{content:""}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:""}.fa-location-arrow:before{content:""}.fa-crop:before{content:""}.fa-code-fork:before{content:""}.fa-unlink:before,.fa-chain-broken:before{content:""}.fa-question:before{content:""}.fa-info:before{content:""}.fa-exclamation:before{content:""}.fa-superscript:before{content:""}.fa-subscript:before{content:""}.fa-eraser:before{content:""}.fa-puzzle-piece:before{content:""}.fa-microphone:before{content:""}.fa-microphone-slash:before{content:""}.fa-shield:before{content:""}.fa-calendar-o:before{content:""}.fa-fire-extinguisher:before{content:""}.fa-rocket:before{content:""}.fa-maxcdn:before{content:""}.fa-chevron-circle-left:before{content:""}.fa-chevron-circle-right:before{content:""}.fa-chevron-circle-up:before{content:""}.fa-chevron-circle-down:before{content:""}.fa-html5:before{content:""}.fa-css3:before{content:""}.fa-anchor:before{content:""}.fa-unlock-alt:before{content:""}.fa-bullseye:before{content:""}.fa-ellipsis-h:before{content:""}.fa-ellipsis-v:before{content:""}.fa-rss-square:before{content:""}.fa-play-circle:before{content:""}.fa-ticket:before{content:""}.fa-minus-square:before{content:""}.fa-minus-square-o:before{content:""}.fa-level-up:before{content:""}.fa-level-down:before{content:""}.fa-check-square:before{content:""}.fa-pencil-square:before{content:""}.fa-external-link-square:before{content:""}.fa-share-square:before{content:""}.fa-compass:before{content:""}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:""}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:""}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:""}.fa-euro:before,.fa-eur:before{content:""}.fa-gbp:before{content:""}.fa-dollar:before,.fa-usd:before{content:""}.fa-rupee:before,.fa-inr:before{content:""}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:""}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:""}.fa-won:before,.fa-krw:before{content:""}.fa-bitcoin:before,.fa-btc:before{content:""}.fa-file:before{content:""}.fa-file-text:before{content:""}.fa-sort-alpha-asc:before{content:""}.fa-sort-alpha-desc:before{content:""}.fa-sort-amount-asc:before{content:""}.fa-sort-amount-desc:before{content:""}.fa-sort-numeric-asc:before{content:""}.fa-sort-numeric-desc:before{content:""}.fa-thumbs-up:before{content:""}.fa-thumbs-down:before{content:""}.fa-youtube-square:before{content:""}.fa-youtube:before{content:""}.fa-xing:before{content:""}.fa-xing-square:before{content:""}.fa-youtube-play:before{content:""}.fa-dropbox:before{content:""}.fa-stack-overflow:before{content:""}.fa-instagram:before{content:""}.fa-flickr:before{content:""}.fa-adn:before{content:""}.fa-bitbucket:before,.icon-bitbucket:before{content:""}.fa-bitbucket-square:before{content:""}.fa-tumblr:before{content:""}.fa-tumblr-square:before{content:""}.fa-long-arrow-down:before{content:""}.fa-long-arrow-up:before{content:""}.fa-long-arrow-left:before{content:""}.fa-long-arrow-right:before{content:""}.fa-apple:before{content:""}.fa-windows:before{content:""}.fa-android:before{content:""}.fa-linux:before{content:""}.fa-dribbble:before{content:""}.fa-skype:before{content:""}.fa-foursquare:before{content:""}.fa-trello:before{content:""}.fa-female:before{content:""}.fa-male:before{content:""}.fa-gittip:before{content:""}.fa-sun-o:before{content:""}.fa-moon-o:before{content:""}.fa-archive:before{content:""}.fa-bug:before{content:""}.fa-vk:before{content:""}.fa-weibo:before{content:""}.fa-renren:before{content:""}.fa-pagelines:before{content:""}.fa-stack-exchange:before{content:""}.fa-arrow-circle-o-right:before{content:""}.fa-arrow-circle-o-left:before{content:""}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:""}.fa-dot-circle-o:before{content:""}.fa-wheelchair:before{content:""}.fa-vimeo-square:before{content:""}.fa-turkish-lira:before,.fa-try:before{content:""}.fa-plus-square-o:before{content:""}.fa-space-shuttle:before{content:""}.fa-slack:before{content:""}.fa-envelope-square:before{content:""}.fa-wordpress:before{content:""}.fa-openid:before{content:""}.fa-institution:before,.fa-bank:before,.fa-university:before{content:""}.fa-mortar-board:before,.fa-graduation-cap:before{content:""}.fa-yahoo:before{content:""}.fa-google:before{content:""}.fa-reddit:before{content:""}.fa-reddit-square:before{content:""}.fa-stumbleupon-circle:before{content:""}.fa-stumbleupon:before{content:""}.fa-delicious:before{content:""}.fa-digg:before{content:""}.fa-pied-piper:before{content:""}.fa-pied-piper-alt:before{content:""}.fa-drupal:before{content:""}.fa-joomla:before{content:""}.fa-language:before{content:""}.fa-fax:before{content:""}.fa-building:before{content:""}.fa-child:before{content:""}.fa-paw:before{content:""}.fa-spoon:before{content:""}.fa-cube:before{content:""}.fa-cubes:before{content:""}.fa-behance:before{content:""}.fa-behance-square:before{content:""}.fa-steam:before{content:""}.fa-steam-square:before{content:""}.fa-recycle:before{content:""}.fa-automobile:before,.fa-car:before{content:""}.fa-cab:before,.fa-taxi:before{content:""}.fa-tree:before{content:""}.fa-spotify:before{content:""}.fa-deviantart:before{content:""}.fa-soundcloud:before{content:""}.fa-database:before{content:""}.fa-file-pdf-o:before{content:""}.fa-file-word-o:before{content:""}.fa-file-excel-o:before{content:""}.fa-file-powerpoint-o:before{content:""}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:""}.fa-file-zip-o:before,.fa-file-archive-o:before{content:""}.fa-file-sound-o:before,.fa-file-audio-o:before{content:""}.fa-file-movie-o:before,.fa-file-video-o:before{content:""}.fa-file-code-o:before{content:""}.fa-vine:before{content:""}.fa-codepen:before{content:""}.fa-jsfiddle:before{content:""}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:""}.fa-circle-o-notch:before{content:""}.fa-ra:before,.fa-rebel:before{content:""}.fa-ge:before,.fa-empire:before{content:""}.fa-git-square:before{content:""}.fa-git:before{content:""}.fa-hacker-news:before{content:""}.fa-tencent-weibo:before{content:""}.fa-qq:before{content:""}.fa-wechat:before,.fa-weixin:before{content:""}.fa-send:before,.fa-paper-plane:before{content:""}.fa-send-o:before,.fa-paper-plane-o:before{content:""}.fa-history:before{content:""}.fa-circle-thin:before{content:""}.fa-header:before{content:""}.fa-paragraph:before{content:""}.fa-sliders:before{content:""}.fa-share-alt:before{content:""}.fa-share-alt-square:before{content:""}.fa-bomb:before{content:""}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:""}.fa-tty:before{content:""}.fa-binoculars:before{content:""}.fa-plug:before{content:""}.fa-slideshare:before{content:""}.fa-twitch:before{content:""}.fa-yelp:before{content:""}.fa-newspaper-o:before{content:""}.fa-wifi:before{content:""}.fa-calculator:before{content:""}.fa-paypal:before{content:""}.fa-google-wallet:before{content:""}.fa-cc-visa:before{content:""}.fa-cc-mastercard:before{content:""}.fa-cc-discover:before{content:""}.fa-cc-amex:before{content:""}.fa-cc-paypal:before{content:""}.fa-cc-stripe:before{content:""}.fa-bell-slash:before{content:""}.fa-bell-slash-o:before{content:""}.fa-trash:before{content:""}.fa-copyright:before{content:""}.fa-at:before{content:""}.fa-eyedropper:before{content:""}.fa-paint-brush:before{content:""}.fa-birthday-cake:before{content:""}.fa-area-chart:before{content:""}.fa-pie-chart:before{content:""}.fa-line-chart:before{content:""}.fa-lastfm:before{content:""}.fa-lastfm-square:before{content:""}.fa-toggle-off:before{content:""}.fa-toggle-on:before{content:""}.fa-bicycle:before{content:""}.fa-bus:before{content:""}.fa-ioxhost:before{content:""}.fa-angellist:before{content:""}.fa-cc:before{content:""}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:""}.fa-meanpath:before{content:""}.fa,.rst-content .admonition-title,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content dl dt .headerlink,.icon,.wy-dropdown .caret,.wy-inline-validate.wy-inline-validate-success .wy-input-context,.wy-inline-validate.wy-inline-validate-danger .wy-input-context,.wy-inline-validate.wy-inline-validate-warning .wy-input-context,.wy-inline-validate.wy-inline-validate-info .wy-input-context{font-family:inherit}.fa:before,.rst-content .admonition-title:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content dl dt .headerlink:before,.icon:before,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before{font-family:"FontAwesome";display:inline-block;font-style:normal;font-weight:normal;line-height:1;text-decoration:inherit}a .fa,a .rst-content .admonition-title,.rst-content a .admonition-title,a .rst-content h1 .headerlink,.rst-content h1 a .headerlink,a .rst-content h2 .headerlink,.rst-content h2 a .headerlink,a .rst-content h3 .headerlink,.rst-content h3 a .headerlink,a .rst-content h4 .headerlink,.rst-content h4 a .headerlink,a .rst-content h5 .headerlink,.rst-content h5 a .headerlink,a .rst-content h6 .headerlink,.rst-content h6 a .headerlink,a .rst-content dl dt .headerlink,.rst-content dl dt a .headerlink,a .icon{display:inline-block;text-decoration:inherit}.btn .fa,.btn .rst-content .admonition-title,.rst-content .btn .admonition-title,.btn .rst-content h1 .headerlink,.rst-content h1 .btn .headerlink,.btn .rst-content h2 .headerlink,.rst-content h2 .btn .headerlink,.btn .rst-content h3 .headerlink,.rst-content h3 .btn .headerlink,.btn .rst-content h4 .headerlink,.rst-content h4 .btn .headerlink,.btn .rst-content h5 .headerlink,.rst-content h5 .btn .headerlink,.btn .rst-content h6 .headerlink,.rst-content h6 .btn .headerlink,.btn .rst-content dl dt .headerlink,.rst-content dl dt .btn .headerlink,.btn .icon,.nav .fa,.nav .rst-content .admonition-title,.rst-content .nav .admonition-title,.nav .rst-content h1 .headerlink,.rst-content h1 .nav .headerlink,.nav .rst-content h2 .headerlink,.rst-content h2 .nav .headerlink,.nav .rst-content h3 .headerlink,.rst-content h3 .nav .headerlink,.nav .rst-content h4 .headerlink,.rst-content h4 .nav .headerlink,.nav .rst-content h5 .headerlink,.rst-content h5 .nav .headerlink,.nav .rst-content h6 .headerlink,.rst-content h6 .nav .headerlink,.nav .rst-content dl dt .headerlink,.rst-content dl dt .nav .headerlink,.nav .icon{display:inline}.btn .fa.fa-large,.btn .rst-content .fa-large.admonition-title,.rst-content .btn .fa-large.admonition-title,.btn .rst-content h1 .fa-large.headerlink,.rst-content h1 .btn .fa-large.headerlink,.btn .rst-content h2 .fa-large.headerlink,.rst-content h2 .btn .fa-large.headerlink,.btn .rst-content h3 .fa-large.headerlink,.rst-content h3 .btn .fa-large.headerlink,.btn .rst-content h4 .fa-large.headerlink,.rst-content h4 .btn .fa-large.headerlink,.btn .rst-content h5 .fa-large.headerlink,.rst-content h5 .btn .fa-large.headerlink,.btn .rst-content h6 .fa-large.headerlink,.rst-content h6 .btn .fa-large.headerlink,.btn .rst-content dl dt .fa-large.headerlink,.rst-content dl dt .btn .fa-large.headerlink,.btn .fa-large.icon,.nav .fa.fa-large,.nav .rst-content .fa-large.admonition-title,.rst-content .nav .fa-large.admonition-title,.nav .rst-content h1 .fa-large.headerlink,.rst-content h1 .nav .fa-large.headerlink,.nav .rst-content h2 .fa-large.headerlink,.rst-content h2 .nav .fa-large.headerlink,.nav .rst-content h3 .fa-large.headerlink,.rst-content h3 .nav .fa-large.headerlink,.nav .rst-content h4 .fa-large.headerlink,.rst-content h4 .nav .fa-large.headerlink,.nav .rst-content h5 .fa-large.headerlink,.rst-content h5 .nav .fa-large.headerlink,.nav .rst-content h6 .fa-large.headerlink,.rst-content h6 .nav .fa-large.headerlink,.nav .rst-content dl dt .fa-large.headerlink,.rst-content dl dt .nav .fa-large.headerlink,.nav .fa-large.icon{line-height:0.9em}.btn .fa.fa-spin,.btn .rst-content .fa-spin.admonition-title,.rst-content .btn .fa-spin.admonition-title,.btn .rst-content h1 .fa-spin.headerlink,.rst-content h1 .btn .fa-spin.headerlink,.btn .rst-content h2 .fa-spin.headerlink,.rst-content h2 .btn .fa-spin.headerlink,.btn .rst-content h3 .fa-spin.headerlink,.rst-content h3 .btn .fa-spin.headerlink,.btn .rst-content h4 .fa-spin.headerlink,.rst-content h4 .btn .fa-spin.headerlink,.btn .rst-content h5 .fa-spin.headerlink,.rst-content h5 .btn .fa-spin.headerlink,.btn .rst-content h6 .fa-spin.headerlink,.rst-content h6 .btn .fa-spin.headerlink,.btn .rst-content dl dt .fa-spin.headerlink,.rst-content dl dt .btn .fa-spin.headerlink,.btn .fa-spin.icon,.nav .fa.fa-spin,.nav .rst-content .fa-spin.admonition-title,.rst-content .nav .fa-spin.admonition-title,.nav .rst-content h1 .fa-spin.headerlink,.rst-content h1 .nav .fa-spin.headerlink,.nav .rst-content h2 .fa-spin.headerlink,.rst-content h2 .nav .fa-spin.headerlink,.nav .rst-content h3 .fa-spin.headerlink,.rst-content h3 .nav .fa-spin.headerlink,.nav .rst-content h4 .fa-spin.headerlink,.rst-content h4 .nav .fa-spin.headerlink,.nav .rst-content h5 .fa-spin.headerlink,.rst-content h5 .nav .fa-spin.headerlink,.nav .rst-content h6 .fa-spin.headerlink,.rst-content h6 .nav .fa-spin.headerlink,.nav .rst-content dl dt .fa-spin.headerlink,.rst-content dl dt .nav .fa-spin.headerlink,.nav .fa-spin.icon{display:inline-block}.btn.fa:before,.rst-content .btn.admonition-title:before,.rst-content h1 .btn.headerlink:before,.rst-content h2 .btn.headerlink:before,.rst-content h3 .btn.headerlink:before,.rst-content h4 .btn.headerlink:before,.rst-content h5 .btn.headerlink:before,.rst-content h6 .btn.headerlink:before,.rst-content dl dt .btn.headerlink:before,.btn.icon:before{opacity:0.5;-webkit-transition:opacity 0.05s ease-in;-moz-transition:opacity 0.05s ease-in;transition:opacity 0.05s ease-in}.btn.fa:hover:before,.rst-content .btn.admonition-title:hover:before,.rst-content h1 .btn.headerlink:hover:before,.rst-content h2 .btn.headerlink:hover:before,.rst-content h3 .btn.headerlink:hover:before,.rst-content h4 .btn.headerlink:hover:before,.rst-content h5 .btn.headerlink:hover:before,.rst-content h6 .btn.headerlink:hover:before,.rst-content dl dt .btn.headerlink:hover:before,.btn.icon:hover:before{opacity:1}.btn-mini .fa:before,.btn-mini .rst-content .admonition-title:before,.rst-content .btn-mini .admonition-title:before,.btn-mini .rst-content h1 .headerlink:before,.rst-content h1 .btn-mini .headerlink:before,.btn-mini .rst-content h2 .headerlink:before,.rst-content h2 .btn-mini .headerlink:before,.btn-mini .rst-content h3 .headerlink:before,.rst-content h3 .btn-mini .headerlink:before,.btn-mini .rst-content h4 .headerlink:before,.rst-content h4 .btn-mini .headerlink:before,.btn-mini .rst-content h5 .headerlink:before,.rst-content h5 .btn-mini .headerlink:before,.btn-mini .rst-content h6 .headerlink:before,.rst-content h6 .btn-mini .headerlink:before,.btn-mini .rst-content dl dt .headerlink:before,.rst-content dl dt .btn-mini .headerlink:before,.btn-mini .icon:before{font-size:14px;vertical-align:-15%}.wy-alert,.rst-content .note,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .warning,.rst-content .seealso,.rst-content .admonition-todo{padding:12px;line-height:24px;margin-bottom:24px;background:#e7f2fa}.wy-alert-title,.rst-content .admonition-title{color:#fff;font-weight:bold;display:block;color:#fff;background:#6ab0de;margin:-12px;padding:6px 12px;margin-bottom:12px}.wy-alert.wy-alert-danger,.rst-content .wy-alert-danger.note,.rst-content .wy-alert-danger.attention,.rst-content .wy-alert-danger.caution,.rst-content .danger,.rst-content .error,.rst-content .wy-alert-danger.hint,.rst-content .wy-alert-danger.important,.rst-content .wy-alert-danger.tip,.rst-content .wy-alert-danger.warning,.rst-content .wy-alert-danger.seealso,.rst-content .wy-alert-danger.admonition-todo{background:#fdf3f2}.wy-alert.wy-alert-danger .wy-alert-title,.rst-content .wy-alert-danger.note .wy-alert-title,.rst-content .wy-alert-danger.attention .wy-alert-title,.rst-content .wy-alert-danger.caution .wy-alert-title,.rst-content .danger .wy-alert-title,.rst-content .error .wy-alert-title,.rst-content .wy-alert-danger.hint .wy-alert-title,.rst-content .wy-alert-danger.important .wy-alert-title,.rst-content .wy-alert-danger.tip .wy-alert-title,.rst-content .wy-alert-danger.warning .wy-alert-title,.rst-content .wy-alert-danger.seealso .wy-alert-title,.rst-content .wy-alert-danger.admonition-todo .wy-alert-title,.wy-alert.wy-alert-danger .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-danger .admonition-title,.rst-content .wy-alert-danger.note .admonition-title,.rst-content .wy-alert-danger.attention .admonition-title,.rst-content .wy-alert-danger.caution .admonition-title,.rst-content .danger .admonition-title,.rst-content .error .admonition-title,.rst-content .wy-alert-danger.hint .admonition-title,.rst-content .wy-alert-danger.important .admonition-title,.rst-content .wy-alert-danger.tip .admonition-title,.rst-content .wy-alert-danger.warning .admonition-title,.rst-content .wy-alert-danger.seealso .admonition-title,.rst-content .wy-alert-danger.admonition-todo .admonition-title{background:#f29f97}.wy-alert.wy-alert-warning,.rst-content .wy-alert-warning.note,.rst-content .attention,.rst-content .caution,.rst-content .wy-alert-warning.danger,.rst-content .wy-alert-warning.error,.rst-content .wy-alert-warning.hint,.rst-content .wy-alert-warning.important,.rst-content .wy-alert-warning.tip,.rst-content .warning,.rst-content .wy-alert-warning.seealso,.rst-content .admonition-todo{background:#ffedcc}.wy-alert.wy-alert-warning .wy-alert-title,.rst-content .wy-alert-warning.note .wy-alert-title,.rst-content .attention .wy-alert-title,.rst-content .caution .wy-alert-title,.rst-content .wy-alert-warning.danger .wy-alert-title,.rst-content .wy-alert-warning.error .wy-alert-title,.rst-content .wy-alert-warning.hint .wy-alert-title,.rst-content .wy-alert-warning.important .wy-alert-title,.rst-content .wy-alert-warning.tip .wy-alert-title,.rst-content .warning .wy-alert-title,.rst-content .wy-alert-warning.seealso .wy-alert-title,.rst-content .admonition-todo .wy-alert-title,.wy-alert.wy-alert-warning .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-warning .admonition-title,.rst-content .wy-alert-warning.note .admonition-title,.rst-content .attention .admonition-title,.rst-content .caution .admonition-title,.rst-content .wy-alert-warning.danger .admonition-title,.rst-content .wy-alert-warning.error .admonition-title,.rst-content .wy-alert-warning.hint .admonition-title,.rst-content .wy-alert-warning.important .admonition-title,.rst-content .wy-alert-warning.tip .admonition-title,.rst-content .warning .admonition-title,.rst-content .wy-alert-warning.seealso .admonition-title,.rst-content .admonition-todo .admonition-title{background:#f0b37e}.wy-alert.wy-alert-info,.rst-content .note,.rst-content .wy-alert-info.attention,.rst-content .wy-alert-info.caution,.rst-content .wy-alert-info.danger,.rst-content .wy-alert-info.error,.rst-content .wy-alert-info.hint,.rst-content .wy-alert-info.important,.rst-content .wy-alert-info.tip,.rst-content .wy-alert-info.warning,.rst-content .seealso,.rst-content .wy-alert-info.admonition-todo{background:#e7f2fa}.wy-alert.wy-alert-info .wy-alert-title,.rst-content .note .wy-alert-title,.rst-content .wy-alert-info.attention .wy-alert-title,.rst-content .wy-alert-info.caution .wy-alert-title,.rst-content .wy-alert-info.danger .wy-alert-title,.rst-content .wy-alert-info.error .wy-alert-title,.rst-content .wy-alert-info.hint .wy-alert-title,.rst-content .wy-alert-info.important .wy-alert-title,.rst-content .wy-alert-info.tip .wy-alert-title,.rst-content .wy-alert-info.warning .wy-alert-title,.rst-content .seealso .wy-alert-title,.rst-content .wy-alert-info.admonition-todo .wy-alert-title,.wy-alert.wy-alert-info .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-info .admonition-title,.rst-content .note .admonition-title,.rst-content .wy-alert-info.attention .admonition-title,.rst-content .wy-alert-info.caution .admonition-title,.rst-content .wy-alert-info.danger .admonition-title,.rst-content .wy-alert-info.error .admonition-title,.rst-content .wy-alert-info.hint .admonition-title,.rst-content .wy-alert-info.important .admonition-title,.rst-content .wy-alert-info.tip .admonition-title,.rst-content .wy-alert-info.warning .admonition-title,.rst-content .seealso .admonition-title,.rst-content .wy-alert-info.admonition-todo .admonition-title{background:#6ab0de}.wy-alert.wy-alert-success,.rst-content .wy-alert-success.note,.rst-content .wy-alert-success.attention,.rst-content .wy-alert-success.caution,.rst-content .wy-alert-success.danger,.rst-content .wy-alert-success.error,.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .wy-alert-success.warning,.rst-content .wy-alert-success.seealso,.rst-content .wy-alert-success.admonition-todo{background:#dbfaf4}.wy-alert.wy-alert-success .wy-alert-title,.rst-content .wy-alert-success.note .wy-alert-title,.rst-content .wy-alert-success.attention .wy-alert-title,.rst-content .wy-alert-success.caution .wy-alert-title,.rst-content .wy-alert-success.danger .wy-alert-title,.rst-content .wy-alert-success.error .wy-alert-title,.rst-content .hint .wy-alert-title,.rst-content .important .wy-alert-title,.rst-content .tip .wy-alert-title,.rst-content .wy-alert-success.warning .wy-alert-title,.rst-content .wy-alert-success.seealso .wy-alert-title,.rst-content .wy-alert-success.admonition-todo .wy-alert-title,.wy-alert.wy-alert-success .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-success .admonition-title,.rst-content .wy-alert-success.note .admonition-title,.rst-content .wy-alert-success.attention .admonition-title,.rst-content .wy-alert-success.caution .admonition-title,.rst-content .wy-alert-success.danger .admonition-title,.rst-content .wy-alert-success.error .admonition-title,.rst-content .hint .admonition-title,.rst-content .important .admonition-title,.rst-content .tip .admonition-title,.rst-content .wy-alert-success.warning .admonition-title,.rst-content .wy-alert-success.seealso .admonition-title,.rst-content .wy-alert-success.admonition-todo .admonition-title{background:#1abc9c}.wy-alert.wy-alert-neutral,.rst-content .wy-alert-neutral.note,.rst-content .wy-alert-neutral.attention,.rst-content .wy-alert-neutral.caution,.rst-content .wy-alert-neutral.danger,.rst-content .wy-alert-neutral.error,.rst-content .wy-alert-neutral.hint,.rst-content .wy-alert-neutral.important,.rst-content .wy-alert-neutral.tip,.rst-content .wy-alert-neutral.warning,.rst-content .wy-alert-neutral.seealso,.rst-content .wy-alert-neutral.admonition-todo{background:#f3f6f6}.wy-alert.wy-alert-neutral .wy-alert-title,.rst-content .wy-alert-neutral.note .wy-alert-title,.rst-content .wy-alert-neutral.attention .wy-alert-title,.rst-content .wy-alert-neutral.caution .wy-alert-title,.rst-content .wy-alert-neutral.danger .wy-alert-title,.rst-content .wy-alert-neutral.error .wy-alert-title,.rst-content .wy-alert-neutral.hint .wy-alert-title,.rst-content .wy-alert-neutral.important .wy-alert-title,.rst-content .wy-alert-neutral.tip .wy-alert-title,.rst-content .wy-alert-neutral.warning .wy-alert-title,.rst-content .wy-alert-neutral.seealso .wy-alert-title,.rst-content .wy-alert-neutral.admonition-todo .wy-alert-title,.wy-alert.wy-alert-neutral .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-neutral .admonition-title,.rst-content .wy-alert-neutral.note .admonition-title,.rst-content .wy-alert-neutral.attention .admonition-title,.rst-content .wy-alert-neutral.caution .admonition-title,.rst-content .wy-alert-neutral.danger .admonition-title,.rst-content .wy-alert-neutral.error .admonition-title,.rst-content .wy-alert-neutral.hint .admonition-title,.rst-content .wy-alert-neutral.important .admonition-title,.rst-content .wy-alert-neutral.tip .admonition-title,.rst-content .wy-alert-neutral.warning .admonition-title,.rst-content .wy-alert-neutral.seealso .admonition-title,.rst-content .wy-alert-neutral.admonition-todo .admonition-title{color:#404040;background:#e1e4e5}.wy-alert.wy-alert-neutral a,.rst-content .wy-alert-neutral.note a,.rst-content .wy-alert-neutral.attention a,.rst-content .wy-alert-neutral.caution a,.rst-content .wy-alert-neutral.danger a,.rst-content .wy-alert-neutral.error a,.rst-content .wy-alert-neutral.hint a,.rst-content .wy-alert-neutral.important a,.rst-content .wy-alert-neutral.tip a,.rst-content .wy-alert-neutral.warning a,.rst-content .wy-alert-neutral.seealso a,.rst-content .wy-alert-neutral.admonition-todo a{color:#2980B9}.wy-alert p:last-child,.rst-content .note p:last-child,.rst-content .attention p:last-child,.rst-content .caution p:last-child,.rst-content .danger p:last-child,.rst-content .error p:last-child,.rst-content .hint p:last-child,.rst-content .important p:last-child,.rst-content .tip p:last-child,.rst-content .warning p:last-child,.rst-content .seealso p:last-child,.rst-content .admonition-todo p:last-child{margin-bottom:0}.wy-tray-container{position:fixed;bottom:0px;left:0;z-index:600}.wy-tray-container li{display:block;width:300px;background:transparent;color:#fff;text-align:center;box-shadow:0 5px 5px 0 rgba(0,0,0,0.1);padding:0 24px;min-width:20%;opacity:0;height:0;line-height:56px;overflow:hidden;-webkit-transition:all 0.3s ease-in;-moz-transition:all 0.3s ease-in;transition:all 0.3s ease-in}.wy-tray-container li.wy-tray-item-success{background:#27AE60}.wy-tray-container li.wy-tray-item-info{background:#2980B9}.wy-tray-container li.wy-tray-item-warning{background:#E67E22}.wy-tray-container li.wy-tray-item-danger{background:#E74C3C}.wy-tray-container li.on{opacity:1;height:56px}@media screen and (max-width: 768px){.wy-tray-container{bottom:auto;top:0;width:100%}.wy-tray-container li{width:100%}}button{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle;cursor:pointer;line-height:normal;-webkit-appearance:button;*overflow:visible}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}button[disabled]{cursor:default}.btn{display:inline-block;border-radius:2px;line-height:normal;white-space:nowrap;text-align:center;cursor:pointer;font-size:100%;padding:6px 12px 8px 12px;color:#fff;border:1px solid rgba(0,0,0,0.1);background-color:#27AE60;text-decoration:none;font-weight:normal;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;box-shadow:0px 1px 2px -1px rgba(255,255,255,0.5) inset,0px -2px 0px 0px rgba(0,0,0,0.1) inset;outline-none:false;vertical-align:middle;*display:inline;zoom:1;-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all 0.1s linear;-moz-transition:all 0.1s linear;transition:all 0.1s linear}.btn-hover{background:#2e8ece;color:#fff}.btn:hover{background:#2cc36b;color:#fff}.btn:focus{background:#2cc36b;outline:0}.btn:active{box-shadow:0px -1px 0px 0px rgba(0,0,0,0.05) inset,0px 2px 0px 0px rgba(0,0,0,0.1) inset;padding:8px 12px 6px 12px}.btn:visited{color:#fff}.btn:disabled{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:0.4;cursor:not-allowed;box-shadow:none}.btn-disabled{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:0.4;cursor:not-allowed;box-shadow:none}.btn-disabled:hover,.btn-disabled:focus,.btn-disabled:active{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:0.4;cursor:not-allowed;box-shadow:none}.btn::-moz-focus-inner{padding:0;border:0}.btn-small{font-size:80%}.btn-info{background-color:#2980B9 !important}.btn-info:hover{background-color:#2e8ece !important}.btn-neutral{background-color:#f3f6f6 !important;color:#404040 !important}.btn-neutral:hover{background-color:#e5ebeb !important;color:#404040}.btn-neutral:visited{color:#404040 !important}.btn-success{background-color:#27AE60 !important}.btn-success:hover{background-color:#295 !important}.btn-danger{background-color:#E74C3C !important}.btn-danger:hover{background-color:#ea6153 !important}.btn-warning{background-color:#E67E22 !important}.btn-warning:hover{background-color:#e98b39 !important}.btn-invert{background-color:#222}.btn-invert:hover{background-color:#2f2f2f !important}.btn-link{background-color:transparent !important;color:#2980B9;box-shadow:none;border-color:transparent !important}.btn-link:hover{background-color:transparent !important;color:#409ad5 !important;box-shadow:none}.btn-link:active{background-color:transparent !important;color:#409ad5 !important;box-shadow:none}.btn-link:visited{color:#9B59B6}.wy-btn-group .btn,.wy-control .btn{vertical-align:middle}.wy-btn-group{margin-bottom:24px;*zoom:1}.wy-btn-group:before,.wy-btn-group:after{display:table;content:""}.wy-btn-group:after{clear:both}.wy-dropdown{position:relative;display:inline-block}.wy-dropdown-active .wy-dropdown-menu{display:block}.wy-dropdown-menu{position:absolute;left:0;display:none;float:left;top:100%;min-width:100%;background:#fcfcfc;z-index:100;border:solid 1px #cfd7dd;box-shadow:0 2px 2px 0 rgba(0,0,0,0.1);padding:12px}.wy-dropdown-menu>dd>a{display:block;clear:both;color:#404040;white-space:nowrap;font-size:90%;padding:0 12px;cursor:pointer}.wy-dropdown-menu>dd>a:hover{background:#2980B9;color:#fff}.wy-dropdown-menu>dd.divider{border-top:solid 1px #cfd7dd;margin:6px 0}.wy-dropdown-menu>dd.search{padding-bottom:12px}.wy-dropdown-menu>dd.search input[type="search"]{width:100%}.wy-dropdown-menu>dd.call-to-action{background:#e3e3e3;text-transform:uppercase;font-weight:500;font-size:80%}.wy-dropdown-menu>dd.call-to-action:hover{background:#e3e3e3}.wy-dropdown-menu>dd.call-to-action .btn{color:#fff}.wy-dropdown.wy-dropdown-up .wy-dropdown-menu{bottom:100%;top:auto;left:auto;right:0}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu{background:#fcfcfc;margin-top:2px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a{padding:6px 12px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a:hover{background:#2980B9;color:#fff}.wy-dropdown.wy-dropdown-left .wy-dropdown-menu{right:0;left:auto;text-align:right}.wy-dropdown-arrow:before{content:" ";border-bottom:5px solid #f5f5f5;border-left:5px solid transparent;border-right:5px solid transparent;position:absolute;display:block;top:-4px;left:50%;margin-left:-3px}.wy-dropdown-arrow.wy-dropdown-arrow-left:before{left:11px}.wy-form-stacked select{display:block}.wy-form-aligned input,.wy-form-aligned textarea,.wy-form-aligned select,.wy-form-aligned .wy-help-inline,.wy-form-aligned label{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-form-aligned .wy-control-group>label{display:inline-block;vertical-align:middle;width:10em;margin:6px 12px 0 0;float:left}.wy-form-aligned .wy-control{float:left}.wy-form-aligned .wy-control label{display:block}.wy-form-aligned .wy-control select{margin-top:6px}fieldset{border:0;margin:0;padding:0}legend{display:block;width:100%;border:0;padding:0;white-space:normal;margin-bottom:24px;font-size:150%;*margin-left:-7px}label{display:block;margin:0 0 0.3125em 0;color:#333;font-size:90%}input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}.wy-control-group{margin-bottom:24px;*zoom:1;max-width:68em;margin-left:auto;margin-right:auto;*zoom:1}.wy-control-group:before,.wy-control-group:after{display:table;content:""}.wy-control-group:after{clear:both}.wy-control-group:before,.wy-control-group:after{display:table;content:""}.wy-control-group:after{clear:both}.wy-control-group.wy-control-group-required>label:after{content:" *";color:#E74C3C}.wy-control-group .wy-form-full,.wy-control-group .wy-form-halves,.wy-control-group .wy-form-thirds{padding-bottom:12px}.wy-control-group .wy-form-full select,.wy-control-group .wy-form-halves select,.wy-control-group .wy-form-thirds select{width:100%}.wy-control-group .wy-form-full input[type="text"],.wy-control-group .wy-form-full input[type="password"],.wy-control-group .wy-form-full input[type="email"],.wy-control-group .wy-form-full input[type="url"],.wy-control-group .wy-form-full input[type="date"],.wy-control-group .wy-form-full input[type="month"],.wy-control-group .wy-form-full input[type="time"],.wy-control-group .wy-form-full input[type="datetime"],.wy-control-group .wy-form-full input[type="datetime-local"],.wy-control-group .wy-form-full input[type="week"],.wy-control-group .wy-form-full input[type="number"],.wy-control-group .wy-form-full input[type="search"],.wy-control-group .wy-form-full input[type="tel"],.wy-control-group .wy-form-full input[type="color"],.wy-control-group .wy-form-halves input[type="text"],.wy-control-group .wy-form-halves input[type="password"],.wy-control-group .wy-form-halves input[type="email"],.wy-control-group .wy-form-halves input[type="url"],.wy-control-group .wy-form-halves input[type="date"],.wy-control-group .wy-form-halves input[type="month"],.wy-control-group .wy-form-halves input[type="time"],.wy-control-group .wy-form-halves input[type="datetime"],.wy-control-group .wy-form-halves input[type="datetime-local"],.wy-control-group .wy-form-halves input[type="week"],.wy-control-group .wy-form-halves input[type="number"],.wy-control-group .wy-form-halves input[type="search"],.wy-control-group .wy-form-halves input[type="tel"],.wy-control-group .wy-form-halves input[type="color"],.wy-control-group .wy-form-thirds input[type="text"],.wy-control-group .wy-form-thirds input[type="password"],.wy-control-group .wy-form-thirds input[type="email"],.wy-control-group .wy-form-thirds input[type="url"],.wy-control-group .wy-form-thirds input[type="date"],.wy-control-group .wy-form-thirds input[type="month"],.wy-control-group .wy-form-thirds input[type="time"],.wy-control-group .wy-form-thirds input[type="datetime"],.wy-control-group .wy-form-thirds input[type="datetime-local"],.wy-control-group .wy-form-thirds input[type="week"],.wy-control-group .wy-form-thirds input[type="number"],.wy-control-group .wy-form-thirds input[type="search"],.wy-control-group .wy-form-thirds input[type="tel"],.wy-control-group .wy-form-thirds input[type="color"]{width:100%}.wy-control-group .wy-form-full{float:left;display:block;margin-right:2.35765%;width:100%;margin-right:0}.wy-control-group .wy-form-full:last-child{margin-right:0}.wy-control-group .wy-form-halves{float:left;display:block;margin-right:2.35765%;width:48.82117%}.wy-control-group .wy-form-halves:last-child{margin-right:0}.wy-control-group .wy-form-halves:nth-of-type(2n){margin-right:0}.wy-control-group .wy-form-halves:nth-of-type(2n+1){clear:left}.wy-control-group .wy-form-thirds{float:left;display:block;margin-right:2.35765%;width:31.76157%}.wy-control-group .wy-form-thirds:last-child{margin-right:0}.wy-control-group .wy-form-thirds:nth-of-type(3n){margin-right:0}.wy-control-group .wy-form-thirds:nth-of-type(3n+1){clear:left}.wy-control-group.wy-control-group-no-input .wy-control{margin:6px 0 0 0;font-size:90%}.wy-control-no-input{display:inline-block;margin:6px 0 0 0;font-size:90%}.wy-control-group.fluid-input input[type="text"],.wy-control-group.fluid-input input[type="password"],.wy-control-group.fluid-input input[type="email"],.wy-control-group.fluid-input input[type="url"],.wy-control-group.fluid-input input[type="date"],.wy-control-group.fluid-input input[type="month"],.wy-control-group.fluid-input input[type="time"],.wy-control-group.fluid-input input[type="datetime"],.wy-control-group.fluid-input input[type="datetime-local"],.wy-control-group.fluid-input input[type="week"],.wy-control-group.fluid-input input[type="number"],.wy-control-group.fluid-input input[type="search"],.wy-control-group.fluid-input input[type="tel"],.wy-control-group.fluid-input input[type="color"]{width:100%}.wy-form-message-inline{display:inline-block;padding-left:0.3em;color:#666;vertical-align:middle;font-size:90%}.wy-form-message{display:block;color:#999;font-size:70%;margin-top:0.3125em;font-style:italic}.wy-form-message p{font-size:inherit;font-style:italic;margin-bottom:6px}.wy-form-message p:last-child{margin-bottom:0}input{line-height:normal}input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;*overflow:visible}input[type="text"],input[type="password"],input[type="email"],input[type="url"],input[type="date"],input[type="month"],input[type="time"],input[type="datetime"],input[type="datetime-local"],input[type="week"],input[type="number"],input[type="search"],input[type="tel"],input[type="color"]{-webkit-appearance:none;padding:6px;display:inline-block;border:1px solid #ccc;font-size:80%;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;box-shadow:inset 0 1px 3px #ddd;border-radius:0;-webkit-transition:border 0.3s linear;-moz-transition:border 0.3s linear;transition:border 0.3s linear}input[type="datetime-local"]{padding:0.34375em 0.625em}input[disabled]{cursor:default}input[type="checkbox"],input[type="radio"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0;margin-right:0.3125em;*height:13px;*width:13px}input[type="search"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}input[type="text"]:focus,input[type="password"]:focus,input[type="email"]:focus,input[type="url"]:focus,input[type="date"]:focus,input[type="month"]:focus,input[type="time"]:focus,input[type="datetime"]:focus,input[type="datetime-local"]:focus,input[type="week"]:focus,input[type="number"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="color"]:focus{outline:0;outline:thin dotted \9;border-color:#333}input.no-focus:focus{border-color:#ccc !important}input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted #333;outline:1px auto #129FEA}input[type="text"][disabled],input[type="password"][disabled],input[type="email"][disabled],input[type="url"][disabled],input[type="date"][disabled],input[type="month"][disabled],input[type="time"][disabled],input[type="datetime"][disabled],input[type="datetime-local"][disabled],input[type="week"][disabled],input[type="number"][disabled],input[type="search"][disabled],input[type="tel"][disabled],input[type="color"][disabled]{cursor:not-allowed;background-color:#fafafa}input:focus:invalid,textarea:focus:invalid,select:focus:invalid{color:#E74C3C;border:1px solid #E74C3C}input:focus:invalid:focus,textarea:focus:invalid:focus,select:focus:invalid:focus{border-color:#E74C3C}input[type="file"]:focus:invalid:focus,input[type="radio"]:focus:invalid:focus,input[type="checkbox"]:focus:invalid:focus{outline-color:#E74C3C}input.wy-input-large{padding:12px;font-size:100%}textarea{overflow:auto;vertical-align:top;width:100%;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif}select,textarea{padding:0.5em 0.625em;display:inline-block;border:1px solid #ccc;font-size:80%;box-shadow:inset 0 1px 3px #ddd;-webkit-transition:border 0.3s linear;-moz-transition:border 0.3s linear;transition:border 0.3s linear}select{border:1px solid #ccc;background-color:#fff}select[multiple]{height:auto}select:focus,textarea:focus{outline:0}select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{cursor:not-allowed;background-color:#fafafa}input[type="radio"][disabled],input[type="checkbox"][disabled]{cursor:not-allowed}.wy-checkbox,.wy-radio{margin:6px 0;color:#404040;display:block}.wy-checkbox input,.wy-radio input{vertical-align:baseline}.wy-form-message-inline{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-input-prefix,.wy-input-suffix{white-space:nowrap;padding:6px}.wy-input-prefix .wy-input-context,.wy-input-suffix .wy-input-context{line-height:27px;padding:0 8px;display:inline-block;font-size:80%;background-color:#f3f6f6;border:solid 1px #ccc;color:#999}.wy-input-suffix .wy-input-context{border-left:0}.wy-input-prefix .wy-input-context{border-right:0}.wy-switch{width:36px;height:12px;margin:12px 0;position:relative;border-radius:4px;background:#ccc;cursor:pointer;-webkit-transition:all 0.2s ease-in-out;-moz-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out}.wy-switch:before{position:absolute;content:"";display:block;width:18px;height:18px;border-radius:4px;background:#999;left:-3px;top:-3px;-webkit-transition:all 0.2s ease-in-out;-moz-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out}.wy-switch:after{content:"false";position:absolute;left:48px;display:block;font-size:12px;color:#ccc}.wy-switch.active{background:#1e8449}.wy-switch.active:before{left:24px;background:#27AE60}.wy-switch.active:after{content:"true"}.wy-switch.disabled,.wy-switch.active.disabled{cursor:not-allowed}.wy-control-group.wy-control-group-error .wy-form-message,.wy-control-group.wy-control-group-error>label{color:#E74C3C}.wy-control-group.wy-control-group-error input[type="text"],.wy-control-group.wy-control-group-error input[type="password"],.wy-control-group.wy-control-group-error input[type="email"],.wy-control-group.wy-control-group-error input[type="url"],.wy-control-group.wy-control-group-error input[type="date"],.wy-control-group.wy-control-group-error input[type="month"],.wy-control-group.wy-control-group-error input[type="time"],.wy-control-group.wy-control-group-error input[type="datetime"],.wy-control-group.wy-control-group-error input[type="datetime-local"],.wy-control-group.wy-control-group-error input[type="week"],.wy-control-group.wy-control-group-error input[type="number"],.wy-control-group.wy-control-group-error input[type="search"],.wy-control-group.wy-control-group-error input[type="tel"],.wy-control-group.wy-control-group-error input[type="color"]{border:solid 1px #E74C3C}.wy-control-group.wy-control-group-error textarea{border:solid 1px #E74C3C}.wy-inline-validate{white-space:nowrap}.wy-inline-validate .wy-input-context{padding:0.5em 0.625em;display:inline-block;font-size:80%}.wy-inline-validate.wy-inline-validate-success .wy-input-context{color:#27AE60}.wy-inline-validate.wy-inline-validate-danger .wy-input-context{color:#E74C3C}.wy-inline-validate.wy-inline-validate-warning .wy-input-context{color:#E67E22}.wy-inline-validate.wy-inline-validate-info .wy-input-context{color:#2980B9}.rotate-90{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.rotate-180{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.rotate-270{-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg)}.mirror{-webkit-transform:scaleX(-1);-moz-transform:scaleX(-1);-ms-transform:scaleX(-1);-o-transform:scaleX(-1);transform:scaleX(-1)}.mirror.rotate-90{-webkit-transform:scaleX(-1) rotate(90deg);-moz-transform:scaleX(-1) rotate(90deg);-ms-transform:scaleX(-1) rotate(90deg);-o-transform:scaleX(-1) rotate(90deg);transform:scaleX(-1) rotate(90deg)}.mirror.rotate-180{-webkit-transform:scaleX(-1) rotate(180deg);-moz-transform:scaleX(-1) rotate(180deg);-ms-transform:scaleX(-1) rotate(180deg);-o-transform:scaleX(-1) rotate(180deg);transform:scaleX(-1) rotate(180deg)}.mirror.rotate-270{-webkit-transform:scaleX(-1) rotate(270deg);-moz-transform:scaleX(-1) rotate(270deg);-ms-transform:scaleX(-1) rotate(270deg);-o-transform:scaleX(-1) rotate(270deg);transform:scaleX(-1) rotate(270deg)}@media only screen and (max-width: 480px){.wy-form button[type="submit"]{margin:0.7em 0 0}.wy-form input[type="text"],.wy-form input[type="password"],.wy-form input[type="email"],.wy-form input[type="url"],.wy-form input[type="date"],.wy-form input[type="month"],.wy-form input[type="time"],.wy-form input[type="datetime"],.wy-form input[type="datetime-local"],.wy-form input[type="week"],.wy-form input[type="number"],.wy-form input[type="search"],.wy-form input[type="tel"],.wy-form input[type="color"]{margin-bottom:0.3em;display:block}.wy-form label{margin-bottom:0.3em;display:block}.wy-form input[type="password"],.wy-form input[type="email"],.wy-form input[type="url"],.wy-form input[type="date"],.wy-form input[type="month"],.wy-form input[type="time"],.wy-form input[type="datetime"],.wy-form input[type="datetime-local"],.wy-form input[type="week"],.wy-form input[type="number"],.wy-form input[type="search"],.wy-form input[type="tel"],.wy-form input[type="color"]{margin-bottom:0}.wy-form-aligned .wy-control-group label{margin-bottom:0.3em;text-align:left;display:block;width:100%}.wy-form-aligned .wy-control{margin:1.5em 0 0 0}.wy-form .wy-help-inline,.wy-form-message-inline,.wy-form-message{display:block;font-size:80%;padding:6px 0}}@media screen and (max-width: 768px){.tablet-hide{display:none}}@media screen and (max-width: 480px){.mobile-hide{display:none}}.float-left{float:left}.float-right{float:right}.full-width{width:100%}.wy-table,.rst-content table.docutils,.rst-content table.field-list{border-collapse:collapse;border-spacing:0;empty-cells:show;margin-bottom:24px}.wy-table caption,.rst-content table.docutils caption,.rst-content table.field-list caption{color:#000;font:italic 85%/1 arial,sans-serif;padding:1em 0;text-align:center}.wy-table td,.rst-content table.docutils td,.rst-content table.field-list td,.wy-table th,.rst-content table.docutils th,.rst-content table.field-list th{font-size:90%;margin:0;overflow:visible;padding:8px 16px}.wy-table td:first-child,.rst-content table.docutils td:first-child,.rst-content table.field-list td:first-child,.wy-table th:first-child,.rst-content table.docutils th:first-child,.rst-content table.field-list th:first-child{border-left-width:0}.wy-table thead,.rst-content table.docutils thead,.rst-content table.field-list thead{color:#000;text-align:left;vertical-align:bottom;white-space:nowrap}.wy-table thead th,.rst-content table.docutils thead th,.rst-content table.field-list thead th{font-weight:bold;border-bottom:solid 2px #e1e4e5}.wy-table td,.rst-content table.docutils td,.rst-content table.field-list td{background-color:transparent;vertical-align:middle}.wy-table td p,.rst-content table.docutils td p,.rst-content table.field-list td p{line-height:18px}.wy-table td p:last-child,.rst-content table.docutils td p:last-child,.rst-content table.field-list td p:last-child{margin-bottom:0}.wy-table .wy-table-cell-min,.rst-content table.docutils .wy-table-cell-min,.rst-content table.field-list .wy-table-cell-min{width:1%;padding-right:0}.wy-table .wy-table-cell-min input[type=checkbox],.rst-content table.docutils .wy-table-cell-min input[type=checkbox],.rst-content table.field-list .wy-table-cell-min input[type=checkbox],.wy-table .wy-table-cell-min input[type=checkbox],.rst-content table.docutils .wy-table-cell-min input[type=checkbox],.rst-content table.field-list .wy-table-cell-min input[type=checkbox]{margin:0}.wy-table-secondary{color:gray;font-size:90%}.wy-table-tertiary{color:gray;font-size:80%}.wy-table-odd td,.wy-table-striped tr:nth-child(2n-1) td,.rst-content table.docutils:not(.field-list) tr:nth-child(2n-1) td{background-color:#f3f6f6}.wy-table-backed{background-color:#f3f6f6}.wy-table-bordered-all,.rst-content table.docutils{border:1px solid #e1e4e5}.wy-table-bordered-all td,.rst-content table.docutils td{border-bottom:1px solid #e1e4e5;border-left:1px solid #e1e4e5}.wy-table-bordered-all tbody>tr:last-child td,.rst-content table.docutils tbody>tr:last-child td{border-bottom-width:0}.wy-table-bordered{border:1px solid #e1e4e5}.wy-table-bordered-rows td{border-bottom:1px solid #e1e4e5}.wy-table-bordered-rows tbody>tr:last-child td{border-bottom-width:0}.wy-table-horizontal tbody>tr:last-child td{border-bottom-width:0}.wy-table-horizontal td,.wy-table-horizontal th{border-width:0 0 1px 0;border-bottom:1px solid #e1e4e5}.wy-table-horizontal tbody>tr:last-child td{border-bottom-width:0}.wy-table-responsive{margin-bottom:24px;max-width:100%;overflow:auto}.wy-table-responsive table{margin-bottom:0 !important}.wy-table-responsive table td,.wy-table-responsive table th{white-space:nowrap}a{color:#2980B9;text-decoration:none;cursor:pointer}a:hover{color:#3091d1}a:visited{color:#9B59B6}html{height:100%;overflow-x:hidden}body{font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;font-weight:normal;color:#404040;min-height:100%;overflow-x:hidden;background:#edf0f2}.wy-text-left{text-align:left}.wy-text-center{text-align:center}.wy-text-right{text-align:right}.wy-text-large{font-size:120%}.wy-text-normal{font-size:100%}.wy-text-small,small{font-size:80%}.wy-text-strike{text-decoration:line-through}.wy-text-warning{color:#E67E22 !important}a.wy-text-warning:hover{color:#eb9950 !important}.wy-text-info{color:#2980B9 !important}a.wy-text-info:hover{color:#409ad5 !important}.wy-text-success{color:#27AE60 !important}a.wy-text-success:hover{color:#36d278 !important}.wy-text-danger{color:#E74C3C !important}a.wy-text-danger:hover{color:#ed7669 !important}.wy-text-neutral{color:#404040 !important}a.wy-text-neutral:hover{color:#595959 !important}h1,h2,h3,h4,h5,h6,legend{margin-top:0;font-weight:700;font-family:"Roboto Slab","ff-tisa-web-pro","Georgia",Arial,sans-serif}p{line-height:24px;margin:0;font-size:16px;margin-bottom:24px}h1{font-size:175%}h2{font-size:150%}h3{font-size:125%}h4{font-size:115%}h5{font-size:110%}h6{font-size:100%}hr{display:block;height:1px;border:0;border-top:1px solid #e1e4e5;margin:24px 0;padding:0}code,.rst-content tt{white-space:nowrap;max-width:100%;background:#fff;border:solid 1px #e1e4e5;font-size:75%;padding:0 5px;font-family:Consolas,"Andale Mono WT","Andale Mono","Lucida Console","Lucida Sans Typewriter","DejaVu Sans Mono","Bitstream Vera Sans Mono","Liberation Mono","Nimbus Mono L",Monaco,"Courier New",Courier,monospace;color:#E74C3C;overflow-x:auto}code.code-large,.rst-content tt.code-large{font-size:90%}.wy-plain-list-disc,.rst-content .section ul,.rst-content .toctree-wrapper ul,article ul{list-style:disc;line-height:24px;margin-bottom:24px}.wy-plain-list-disc li,.rst-content .section ul li,.rst-content .toctree-wrapper ul li,article ul li{list-style:disc;margin-left:24px}.wy-plain-list-disc li p:last-child,.rst-content .section ul li p:last-child,.rst-content .toctree-wrapper ul li p:last-child,article ul li p:last-child{margin-bottom:0}.wy-plain-list-disc li ul,.rst-content .section ul li ul,.rst-content .toctree-wrapper ul li ul,article ul li ul{margin-bottom:0}.wy-plain-list-disc li li,.rst-content .section ul li li,.rst-content .toctree-wrapper ul li li,article ul li li{list-style:circle}.wy-plain-list-disc li li li,.rst-content .section ul li li li,.rst-content .toctree-wrapper ul li li li,article ul li li li{list-style:square}.wy-plain-list-disc li ol li,.rst-content .section ul li ol li,.rst-content .toctree-wrapper ul li ol li,article ul li ol li{list-style:decimal}.wy-plain-list-decimal,.rst-content .section ol,.rst-content ol.arabic,article ol{list-style:decimal;line-height:24px;margin-bottom:24px}.wy-plain-list-decimal li,.rst-content .section ol li,.rst-content ol.arabic li,article ol li{list-style:decimal;margin-left:24px}.wy-plain-list-decimal li p:last-child,.rst-content .section ol li p:last-child,.rst-content ol.arabic li p:last-child,article ol li p:last-child{margin-bottom:0}.wy-plain-list-decimal li ul,.rst-content .section ol li ul,.rst-content ol.arabic li ul,article ol li ul{margin-bottom:0}.wy-plain-list-decimal li ul li,.rst-content .section ol li ul li,.rst-content ol.arabic li ul li,article ol li ul li{list-style:disc}.codeblock-example{border:1px solid #e1e4e5;border-bottom:none;padding:24px;padding-top:48px;font-weight:500;background:#fff;position:relative}.codeblock-example:after{content:"Example";position:absolute;top:0px;left:0px;background:#9B59B6;color:#fff;padding:6px 12px}.codeblock-example.prettyprint-example-only{border:1px solid #e1e4e5;margin-bottom:24px}.codeblock,pre.literal-block,.rst-content .literal-block,.rst-content pre.literal-block,div[class^='highlight']{border:1px solid #e1e4e5;padding:0px;overflow-x:auto;background:#fff;margin:1px 0 24px 0}.codeblock div[class^='highlight'],pre.literal-block div[class^='highlight'],.rst-content .literal-block div[class^='highlight'],div[class^='highlight'] div[class^='highlight']{border:none;background:none;margin:0}div[class^='highlight'] td.code{width:100%}.linenodiv pre{border-right:solid 1px #e6e9ea;margin:0;padding:12px 12px;font-family:Consolas,"Andale Mono WT","Andale Mono","Lucida Console","Lucida Sans Typewriter","DejaVu Sans Mono","Bitstream Vera Sans Mono","Liberation Mono","Nimbus Mono L",Monaco,"Courier New",Courier,monospace;font-size:12px;line-height:1.5;color:#d9d9d9}div[class^='highlight'] pre{white-space:pre;margin:0;padding:12px 12px;font-family:Consolas,"Andale Mono WT","Andale Mono","Lucida Console","Lucida Sans Typewriter","DejaVu Sans Mono","Bitstream Vera Sans Mono","Liberation Mono","Nimbus Mono L",Monaco,"Courier New",Courier,monospace;font-size:12px;line-height:1.5;display:block;overflow:auto;color:#404040}@media print{.codeblock,pre.literal-block,.rst-content .literal-block,.rst-content pre.literal-block,div[class^='highlight'],div[class^='highlight'] pre{white-space:pre-wrap}}.hll{background-color:#ffc;margin:0 -12px;padding:0 12px;display:block}.c{color:#998;font-style:italic}.err{color:#a61717;background-color:#e3d2d2}.k{font-weight:bold}.o{font-weight:bold}.cm{color:#998;font-style:italic}.cp{color:#999;font-weight:bold}.c1{color:#998;font-style:italic}.cs{color:#999;font-weight:bold;font-style:italic}.gd{color:#000;background-color:#fdd}.gd .x{color:#000;background-color:#faa}.ge{font-style:italic}.gr{color:#a00}.gh{color:#999}.gi{color:#000;background-color:#dfd}.gi .x{color:#000;background-color:#afa}.go{color:#888}.gp{color:#555}.gs{font-weight:bold}.gu{color:purple;font-weight:bold}.gt{color:#a00}.kc{font-weight:bold}.kd{font-weight:bold}.kn{font-weight:bold}.kp{font-weight:bold}.kr{font-weight:bold}.kt{color:#458;font-weight:bold}.m{color:#099}.s{color:#d14}.n{color:#333}.na{color:teal}.nb{color:#0086b3}.nc{color:#458;font-weight:bold}.no{color:teal}.ni{color:purple}.ne{color:#900;font-weight:bold}.nf{color:#900;font-weight:bold}.nn{color:#555}.nt{color:navy}.nv{color:teal}.ow{font-weight:bold}.w{color:#bbb}.mf{color:#099}.mh{color:#099}.mi{color:#099}.mo{color:#099}.sb{color:#d14}.sc{color:#d14}.sd{color:#d14}.s2{color:#d14}.se{color:#d14}.sh{color:#d14}.si{color:#d14}.sx{color:#d14}.sr{color:#009926}.s1{color:#d14}.ss{color:#990073}.bp{color:#999}.vc{color:teal}.vg{color:teal}.vi{color:teal}.il{color:#099}.gc{color:#999;background-color:#EAF2F5}.wy-breadcrumbs li{display:inline-block}.wy-breadcrumbs li.wy-breadcrumbs-aside{float:right}.wy-breadcrumbs li a{display:inline-block;padding:5px}.wy-breadcrumbs li a:first-child{padding-left:0}.wy-breadcrumbs-extra{margin-bottom:0;color:#b3b3b3;font-size:80%;display:inline-block}@media screen and (max-width: 480px){.wy-breadcrumbs-extra{display:none}.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}@media print{.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}.wy-affix{position:fixed;top:1.618em}.wy-menu a:hover{text-decoration:none}.wy-menu-horiz{*zoom:1}.wy-menu-horiz:before,.wy-menu-horiz:after{display:table;content:""}.wy-menu-horiz:after{clear:both}.wy-menu-horiz ul,.wy-menu-horiz li{display:inline-block}.wy-menu-horiz li:hover{background:rgba(255,255,255,0.1)}.wy-menu-horiz li.divide-left{border-left:solid 1px #404040}.wy-menu-horiz li.divide-right{border-right:solid 1px #404040}.wy-menu-horiz a{height:32px;display:inline-block;line-height:32px;padding:0 16px}.wy-menu-vertical header{height:32px;display:inline-block;line-height:32px;padding:0 1.618em;display:block;font-weight:bold;text-transform:uppercase;font-size:80%;color:#2980B9;white-space:nowrap}.wy-menu-vertical ul{margin-bottom:0}.wy-menu-vertical li.divide-top{border-top:solid 1px #404040}.wy-menu-vertical li.divide-bottom{border-bottom:solid 1px #404040}.wy-menu-vertical li.current{background:#e3e3e3}.wy-menu-vertical li.current a{color:gray;border-right:solid 1px #c9c9c9;padding:0.4045em 2.427em}.wy-menu-vertical li.current a:hover{background:#d6d6d6}.wy-menu-vertical li.on a,.wy-menu-vertical li.current>a{color:#404040;padding:0.4045em 1.618em;font-weight:bold;position:relative;background:#fcfcfc;border:none;border-bottom:solid 1px #c9c9c9;border-top:solid 1px #c9c9c9;padding-left:1.618em -4px}.wy-menu-vertical li.on a:hover,.wy-menu-vertical li.current>a:hover{background:#fcfcfc}.wy-menu-vertical li.toctree-l2.current>a{background:#c9c9c9;padding:0.4045em 2.427em}.wy-menu-vertical li.current ul{display:block}.wy-menu-vertical li ul{margin-bottom:0;display:none}.wy-menu-vertical .local-toc li ul{display:block}.wy-menu-vertical li ul li a{margin-bottom:0;color:#b3b3b3;font-weight:normal}.wy-menu-vertical a{display:inline-block;line-height:18px;padding:0.4045em 1.618em;display:block;position:relative;font-size:90%;color:#b3b3b3}.wy-menu-vertical a:hover{background-color:#4e4a4a;cursor:pointer}.wy-menu-vertical a:active{background-color:#2980B9;cursor:pointer;color:#fff}.wy-side-nav-search{z-index:200;background-color:#2980B9;text-align:center;padding:0.809em;display:block;color:#fcfcfc;margin-bottom:0.809em}.wy-side-nav-search input[type=text]{width:100%;border-radius:50px;padding:6px 12px;border-color:#2472a4}.wy-side-nav-search img{display:block;margin:auto auto 0.809em auto;height:45px;width:45px;background-color:#2980B9;padding:5px;border-radius:100%}.wy-side-nav-search>a,.wy-side-nav-search .wy-dropdown>a{color:#fcfcfc;font-size:100%;font-weight:bold;display:inline-block;padding:4px 6px;margin-bottom:0.809em}.wy-side-nav-search>a:hover,.wy-side-nav-search .wy-dropdown>a:hover{background:rgba(255,255,255,0.1)}.wy-nav .wy-menu-vertical header{color:#2980B9}.wy-nav .wy-menu-vertical a{color:#b3b3b3}.wy-nav .wy-menu-vertical a:hover{background-color:#2980B9;color:#fff}[data-menu-wrap]{-webkit-transition:all 0.2s ease-in;-moz-transition:all 0.2s ease-in;transition:all 0.2s ease-in;position:absolute;opacity:1;width:100%;opacity:0}[data-menu-wrap].move-center{left:0;right:auto;opacity:1}[data-menu-wrap].move-left{right:auto;left:-100%;opacity:0}[data-menu-wrap].move-right{right:-100%;left:auto;opacity:0}.wy-body-for-nav{background:left repeat-y #fcfcfc;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxOERBMTRGRDBFMUUxMUUzODUwMkJCOThDMEVFNURFMCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxOERBMTRGRTBFMUUxMUUzODUwMkJCOThDMEVFNURFMCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjE4REExNEZCMEUxRTExRTM4NTAyQkI5OEMwRUU1REUwIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjE4REExNEZDMEUxRTExRTM4NTAyQkI5OEMwRUU1REUwIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+EwrlwAAAAA5JREFUeNpiMDU0BAgwAAE2AJgB9BnaAAAAAElFTkSuQmCC);background-size:300px 1px}.wy-grid-for-nav{position:absolute;width:100%;height:100%}.wy-nav-side{position:absolute;top:0;left:0;width:300px;overflow:hidden;min-height:100%;background:#343131;z-index:200}.wy-nav-top{display:none;background:#2980B9;color:#fff;padding:0.4045em 0.809em;position:relative;line-height:50px;text-align:center;font-size:100%;*zoom:1}.wy-nav-top:before,.wy-nav-top:after{display:table;content:""}.wy-nav-top:after{clear:both}.wy-nav-top a{color:#fff;font-weight:bold}.wy-nav-top img{margin-right:12px;height:45px;width:45px;background-color:#2980B9;padding:5px;border-radius:100%}.wy-nav-top i{font-size:30px;float:left;cursor:pointer}.wy-nav-content-wrap{margin-left:300px;background:#fcfcfc;min-height:100%}.wy-nav-content{padding:1.618em 3.236em;height:100%;max-width:800px;margin:auto}.wy-body-mask{position:fixed;width:100%;height:100%;background:rgba(0,0,0,0.2);display:none;z-index:499}.wy-body-mask.on{display:block}footer{color:#999}footer p{margin-bottom:12px}.rst-footer-buttons{*zoom:1}.rst-footer-buttons:before,.rst-footer-buttons:after{display:table;content:""}.rst-footer-buttons:after{clear:both}#search-results .search li{margin-bottom:24px;border-bottom:solid 1px #e1e4e5;padding-bottom:24px}#search-results .search li:first-child{border-top:solid 1px #e1e4e5;padding-top:24px}#search-results .search li a{font-size:120%;margin-bottom:12px;display:inline-block}#search-results .context{color:gray;font-size:90%}@media screen and (max-width: 768px){.wy-body-for-nav{background:#fcfcfc}.wy-nav-top{display:block}.wy-nav-side{left:-300px}.wy-nav-side.shift{width:85%;left:0}.wy-nav-content-wrap{margin-left:0}.wy-nav-content-wrap .wy-nav-content{padding:1.618em}.wy-nav-content-wrap.shift{position:fixed;min-width:100%;left:85%;top:0;height:100%;overflow:hidden}}@media screen and (min-width: 1400px){.wy-nav-content-wrap{background:rgba(0,0,0,0.05)}.wy-nav-content{margin:0;background:#fcfcfc}}@media print{.rst-versions,footer,.wy-nav-side{display:none}.wy-nav-content-wrap{margin-left:0}}nav.stickynav{position:fixed;top:0}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;border-top:solid 10px #343131;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;z-index:400}.rst-versions a{color:#2980B9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27AE60;*zoom:1}.rst-versions .rst-current-version:before,.rst-versions .rst-current-version:after{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-versions .rst-current-version .fa,.rst-versions .rst-current-version .rst-content .admonition-title,.rst-content .rst-versions .rst-current-version .admonition-title,.rst-versions .rst-current-version .rst-content h1 .headerlink,.rst-content h1 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h2 .headerlink,.rst-content h2 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h3 .headerlink,.rst-content h3 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h4 .headerlink,.rst-content h4 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h5 .headerlink,.rst-content h5 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h6 .headerlink,.rst-content h6 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content dl dt .headerlink,.rst-content dl dt .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .icon{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#E74C3C;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#F1C40F;color:#000}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:gray;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:solid 1px #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px}.rst-versions.rst-badge .icon-book{float:none}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge .rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width: 768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}img{width:100%;height:auto}}.rst-content img{max-width:100%;height:auto !important}.rst-content div.figure{margin-bottom:24px}.rst-content div.figure.align-center{text-align:center}.rst-content .section>img,.rst-content .section>a>img{margin-bottom:24px}.rst-content blockquote{margin-left:24px;line-height:24px;margin-bottom:24px}.rst-content .note .last,.rst-content .attention .last,.rst-content .caution .last,.rst-content .danger .last,.rst-content .error .last,.rst-content .hint .last,.rst-content .important .last,.rst-content .tip .last,.rst-content .warning .last,.rst-content .seealso .last,.rst-content .admonition-todo .last{margin-bottom:0}.rst-content .admonition-title:before{margin-right:4px}.rst-content .admonition table{border-color:rgba(0,0,0,0.1)}.rst-content .admonition table td,.rst-content .admonition table th{background:transparent !important;border-color:rgba(0,0,0,0.1) !important}.rst-content .section ol.loweralpha,.rst-content .section ol.loweralpha li{list-style:lower-alpha}.rst-content .section ol.upperalpha,.rst-content .section ol.upperalpha li{list-style:upper-alpha}.rst-content .section ol p,.rst-content .section ul p{margin-bottom:12px}.rst-content .line-block{margin-left:24px}.rst-content .topic-title{font-weight:bold;margin-bottom:12px}.rst-content .toc-backref{color:#404040}.rst-content .align-right{float:right;margin:0px 0px 24px 24px}.rst-content .align-left{float:left;margin:0px 24px 24px 0px}.rst-content .align-center{margin:auto;display:block}.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content dl dt .headerlink{display:none;visibility:hidden;font-size:14px}.rst-content h1 .headerlink:after,.rst-content h2 .headerlink:after,.rst-content h3 .headerlink:after,.rst-content h4 .headerlink:after,.rst-content h5 .headerlink:after,.rst-content h6 .headerlink:after,.rst-content dl dt .headerlink:after{visibility:visible;content:"";font-family:FontAwesome;display:inline-block}.rst-content h1:hover .headerlink,.rst-content h2:hover .headerlink,.rst-content h3:hover .headerlink,.rst-content h4:hover .headerlink,.rst-content h5:hover .headerlink,.rst-content h6:hover .headerlink,.rst-content dl dt:hover .headerlink{display:inline-block}.rst-content .sidebar{float:right;width:40%;display:block;margin:0 0 24px 24px;padding:24px;background:#f3f6f6;border:solid 1px #e1e4e5}.rst-content .sidebar p,.rst-content .sidebar ul,.rst-content .sidebar dl{font-size:90%}.rst-content .sidebar .last{margin-bottom:0}.rst-content .sidebar .sidebar-title{display:block;font-family:"Roboto Slab","ff-tisa-web-pro","Georgia",Arial,sans-serif;font-weight:bold;background:#e1e4e5;padding:6px 12px;margin:-24px;margin-bottom:24px;font-size:100%}.rst-content .highlighted{background:#F1C40F;display:inline-block;font-weight:bold;padding:0 6px}.rst-content .footnote-reference,.rst-content .citation-reference{vertical-align:super;font-size:90%}.rst-content table.docutils.citation,.rst-content table.docutils.footnote{background:none;border:none;color:#999}.rst-content table.docutils.citation td,.rst-content table.docutils.citation tr,.rst-content table.docutils.footnote td,.rst-content table.docutils.footnote tr{border:none;background-color:transparent !important;white-space:normal}.rst-content table.docutils.citation td.label,.rst-content table.docutils.footnote td.label{padding-left:0;padding-right:0;vertical-align:top}.rst-content table.field-list{border:none}.rst-content table.field-list td{border:none;padding-top:5px}.rst-content table.field-list td>strong{display:inline-block;margin-top:3px}.rst-content table.field-list .field-name{padding-right:10px;text-align:left;white-space:nowrap}.rst-content table.field-list .field-body{text-align:left;padding-left:0}.rst-content tt{color:#000}.rst-content tt big,.rst-content tt em{font-size:100% !important;line-height:normal}.rst-content tt .xref,a .rst-content tt{font-weight:bold}.rst-content a tt{color:#2980B9}.rst-content dl{margin-bottom:24px}.rst-content dl dt{font-weight:bold}.rst-content dl p,.rst-content dl table,.rst-content dl ul,.rst-content dl ol{margin-bottom:12px !important}.rst-content dl dd{margin:0 0 12px 24px}.rst-content dl:not(.docutils){margin-bottom:24px}.rst-content dl:not(.docutils) dt{display:inline-block;margin:6px 0;font-size:90%;line-height:normal;background:#e7f2fa;color:#2980B9;border-top:solid 3px #6ab0de;padding:6px;position:relative}.rst-content dl:not(.docutils) dt:before{color:#6ab0de}.rst-content dl:not(.docutils) dt .headerlink{color:#404040;font-size:100% !important}.rst-content dl:not(.docutils) dl dt{margin-bottom:6px;border:none;border-left:solid 3px #ccc;background:#f0f0f0;color:gray}.rst-content dl:not(.docutils) dl dt .headerlink{color:#404040;font-size:100% !important}.rst-content dl:not(.docutils) dt:first-child{margin-top:0}.rst-content dl:not(.docutils) tt{font-weight:bold}.rst-content dl:not(.docutils) tt.descname,.rst-content dl:not(.docutils) tt.descclassname{background-color:transparent;border:none;padding:0;font-size:100% !important}.rst-content dl:not(.docutils) tt.descname{font-weight:bold}.rst-content dl:not(.docutils) .optional{display:inline-block;padding:0 4px;color:#000;font-weight:bold}.rst-content dl:not(.docutils) .property{display:inline-block;padding-right:8px}.rst-content .viewcode-link,.rst-content .viewcode-back{display:inline-block;color:#27AE60;font-size:80%;padding-left:24px}.rst-content .viewcode-back{display:block;float:right}.rst-content p.rubric{margin-bottom:12px;font-weight:bold}@media screen and (max-width: 480px){.rst-content .sidebar{width:100%}}span[id*='MathJax-Span']{color:#404040}.math{text-align:center} -/*# sourceMappingURL=theme.css.map */ diff --git a/docs/_build/html/_static/doctools.js b/docs/_build/html/_static/doctools.js deleted file mode 100644 index c7bfe76..0000000 --- a/docs/_build/html/_static/doctools.js +++ /dev/null @@ -1,263 +0,0 @@ -/* - * doctools.js - * ~~~~~~~~~~~ - * - * Sphinx JavaScript utilities for all documentation. - * - * :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -/** - * select a different prefix for underscore - */ -$u = _.noConflict(); - -/** - * make the code below compatible with browsers without - * an installed firebug like debugger -if (!window.console || !console.firebug) { - var names = ["log", "debug", "info", "warn", "error", "assert", "dir", - "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", - "profile", "profileEnd"]; - window.console = {}; - for (var i = 0; i < names.length; ++i) - window.console[names[i]] = function() {}; -} - */ - -/** - * small helper function to urldecode strings - */ -jQuery.urldecode = function(x) { - return decodeURIComponent(x).replace(/\+/g, ' '); -}; - -/** - * small helper function to urlencode strings - */ -jQuery.urlencode = encodeURIComponent; - -/** - * This function returns the parsed url parameters of the - * current request. Multiple values per key are supported, - * it will always return arrays of strings for the value parts. - */ -jQuery.getQueryParameters = function(s) { - if (typeof s == 'undefined') - s = document.location.search; - var parts = s.substr(s.indexOf('?') + 1).split('&'); - var result = {}; - for (var i = 0; i < parts.length; i++) { - var tmp = parts[i].split('=', 2); - var key = jQuery.urldecode(tmp[0]); - var value = jQuery.urldecode(tmp[1]); - if (key in result) - result[key].push(value); - else - result[key] = [value]; - } - return result; -}; - -/** - * highlight a given string on a jquery object by wrapping it in - * span elements with the given class name. - */ -jQuery.fn.highlightText = function(text, className) { - function highlight(node) { - if (node.nodeType == 3) { - var val = node.nodeValue; - var pos = val.toLowerCase().indexOf(text); - if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { - var span = document.createElement("span"); - span.className = className; - span.appendChild(document.createTextNode(val.substr(pos, text.length))); - node.parentNode.insertBefore(span, node.parentNode.insertBefore( - document.createTextNode(val.substr(pos + text.length)), - node.nextSibling)); - node.nodeValue = val.substr(0, pos); - } - } - else if (!jQuery(node).is("button, select, textarea")) { - jQuery.each(node.childNodes, function() { - highlight(this); - }); - } - } - return this.each(function() { - highlight(this); - }); -}; - -/* - * backward compatibility for jQuery.browser - * This will be supported until firefox bug is fixed. - */ -if (!jQuery.browser) { - jQuery.uaMatch = function(ua) { - ua = ua.toLowerCase(); - - var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || - /(webkit)[ \/]([\w.]+)/.exec(ua) || - /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || - /(msie) ([\w.]+)/.exec(ua) || - ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || - []; - - return { - browser: match[ 1 ] || "", - version: match[ 2 ] || "0" - }; - }; - jQuery.browser = {}; - jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; -} - -/** - * Small JavaScript module for the documentation. - */ -var Documentation = { - - init : function() { - this.fixFirefoxAnchorBug(); - this.highlightSearchWords(); - this.initIndexTable(); - }, - - /** - * i18n support - */ - TRANSLATIONS : {}, - PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; }, - LOCALE : 'unknown', - - // gettext and ngettext don't access this so that the functions - // can safely bound to a different name (_ = Documentation.gettext) - gettext : function(string) { - var translated = Documentation.TRANSLATIONS[string]; - if (typeof translated == 'undefined') - return string; - return (typeof translated == 'string') ? translated : translated[0]; - }, - - ngettext : function(singular, plural, n) { - var translated = Documentation.TRANSLATIONS[singular]; - if (typeof translated == 'undefined') - return (n == 1) ? singular : plural; - return translated[Documentation.PLURALEXPR(n)]; - }, - - addTranslations : function(catalog) { - for (var key in catalog.messages) - this.TRANSLATIONS[key] = catalog.messages[key]; - this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); - this.LOCALE = catalog.locale; - }, - - /** - * add context elements like header anchor links - */ - addContextElements : function() { - $('div[id] > :header:first').each(function() { - $('\u00B6'). - attr('href', '#' + this.id). - attr('title', _('Permalink to this headline')). - appendTo(this); - }); - $('dt[id]').each(function() { - $('\u00B6'). - attr('href', '#' + this.id). - attr('title', _('Permalink to this definition')). - appendTo(this); - }); - }, - - /** - * workaround a firefox stupidity - * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075 - */ - fixFirefoxAnchorBug : function() { - if (document.location.hash) - window.setTimeout(function() { - document.location.href += ''; - }, 10); - }, - - /** - * highlight the search words provided in the url in the text - */ - highlightSearchWords : function() { - var params = $.getQueryParameters(); - var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; - if (terms.length) { - var body = $('div.body'); - if (!body.length) { - body = $('body'); - } - window.setTimeout(function() { - $.each(terms, function() { - body.highlightText(this.toLowerCase(), 'highlighted'); - }); - }, 10); - $('') - .appendTo($('#searchbox')); - } - }, - - /** - * init the domain index toggle buttons - */ - initIndexTable : function() { - var togglers = $('img.toggler').click(function() { - var src = $(this).attr('src'); - var idnum = $(this).attr('id').substr(7); - $('tr.cg-' + idnum).toggle(); - if (src.substr(-9) == 'minus.png') - $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); - else - $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); - }).css('display', ''); - if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { - togglers.click(); - } - }, - - /** - * helper function to hide the search marks again - */ - hideSearchWords : function() { - $('#searchbox .highlight-link').fadeOut(300); - $('span.highlighted').removeClass('highlighted'); - }, - - /** - * make the url absolute - */ - makeURL : function(relativeURL) { - return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; - }, - - /** - * get the current relative url - */ - getCurrentURL : function() { - var path = document.location.pathname; - var parts = path.split(/\//); - $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { - if (this == '..') - parts.pop(); - }); - var url = parts.join('/'); - return path.substring(url.lastIndexOf('/') + 1, path.length - 1); - } -}; - -// quick alias for translations -_ = Documentation.gettext; - -$(document).ready(function() { - Documentation.init(); -}); diff --git a/docs/_build/html/_static/down-pressed.png b/docs/_build/html/_static/down-pressed.png deleted file mode 100644 index 7c30d00..0000000 Binary files a/docs/_build/html/_static/down-pressed.png and /dev/null differ diff --git a/docs/_build/html/_static/down.png b/docs/_build/html/_static/down.png deleted file mode 100644 index f48098a..0000000 Binary files a/docs/_build/html/_static/down.png and /dev/null differ diff --git a/docs/_build/html/_static/file.png b/docs/_build/html/_static/file.png deleted file mode 100644 index 254c60b..0000000 Binary files a/docs/_build/html/_static/file.png and /dev/null differ diff --git a/docs/_build/html/_static/fonts/fontawesome-webfont.eot b/docs/_build/html/_static/fonts/fontawesome-webfont.eot deleted file mode 100644 index 7c79c6a..0000000 Binary files a/docs/_build/html/_static/fonts/fontawesome-webfont.eot and /dev/null differ diff --git a/docs/_build/html/_static/fonts/fontawesome-webfont.svg b/docs/_build/html/_static/fonts/fontawesome-webfont.svg deleted file mode 100644 index 45fdf33..0000000 --- a/docs/_build/html/_static/fonts/fontawesome-webfont.svg +++ /dev/null @@ -1,414 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/_build/html/_static/fonts/fontawesome-webfont.ttf b/docs/_build/html/_static/fonts/fontawesome-webfont.ttf deleted file mode 100644 index e89738d..0000000 Binary files a/docs/_build/html/_static/fonts/fontawesome-webfont.ttf and /dev/null differ diff --git a/docs/_build/html/_static/fonts/fontawesome-webfont.woff b/docs/_build/html/_static/fonts/fontawesome-webfont.woff deleted file mode 100644 index 8c1748a..0000000 Binary files a/docs/_build/html/_static/fonts/fontawesome-webfont.woff and /dev/null differ diff --git a/docs/_build/html/_static/jquery-1.11.1.js b/docs/_build/html/_static/jquery-1.11.1.js deleted file mode 100644 index d4b67f7..0000000 --- a/docs/_build/html/_static/jquery-1.11.1.js +++ /dev/null @@ -1,10308 +0,0 @@ -/*! - * jQuery JavaScript Library v1.11.1 - * http://jquery.com/ - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * - * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors - * Released under the MIT license - * http://jquery.org/license - * - * Date: 2014-05-01T17:42Z - */ - -(function( global, factory ) { - - if ( typeof module === "object" && typeof module.exports === "object" ) { - // For CommonJS and CommonJS-like environments where a proper window is present, - // execute the factory and get jQuery - // For environments that do not inherently posses a window with a document - // (such as Node.js), expose a jQuery-making factory as module.exports - // This accentuates the need for the creation of a real window - // e.g. var jQuery = require("jquery")(window); - // See ticket #14549 for more info - module.exports = global.document ? - factory( global, true ) : - function( w ) { - if ( !w.document ) { - throw new Error( "jQuery requires a window with a document" ); - } - return factory( w ); - }; - } else { - factory( global ); - } - -// Pass this if window is not defined yet -}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { - -// Can't do this because several apps including ASP.NET trace -// the stack via arguments.caller.callee and Firefox dies if -// you try to trace through "use strict" call chains. (#13335) -// Support: Firefox 18+ -// - -var deletedIds = []; - -var slice = deletedIds.slice; - -var concat = deletedIds.concat; - -var push = deletedIds.push; - -var indexOf = deletedIds.indexOf; - -var class2type = {}; - -var toString = class2type.toString; - -var hasOwn = class2type.hasOwnProperty; - -var support = {}; - - - -var - version = "1.11.1", - - // Define a local copy of jQuery - jQuery = function( selector, context ) { - // The jQuery object is actually just the init constructor 'enhanced' - // Need init if jQuery is called (just allow error to be thrown if not included) - return new jQuery.fn.init( selector, context ); - }, - - // Support: Android<4.1, IE<9 - // Make sure we trim BOM and NBSP - rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, - - // Matches dashed string for camelizing - rmsPrefix = /^-ms-/, - rdashAlpha = /-([\da-z])/gi, - - // Used by jQuery.camelCase as callback to replace() - fcamelCase = function( all, letter ) { - return letter.toUpperCase(); - }; - -jQuery.fn = jQuery.prototype = { - // The current version of jQuery being used - jquery: version, - - constructor: jQuery, - - // Start with an empty selector - selector: "", - - // The default length of a jQuery object is 0 - length: 0, - - toArray: function() { - return slice.call( this ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - return num != null ? - - // Return just the one element from the set - ( num < 0 ? this[ num + this.length ] : this[ num ] ) : - - // Return all the elements in a clean array - slice.call( this ); - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems ) { - - // Build a new jQuery matched element set - var ret = jQuery.merge( this.constructor(), elems ); - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - ret.context = this.context; - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - // (You can seed the arguments with an array of args, but this is - // only used internally.) - each: function( callback, args ) { - return jQuery.each( this, callback, args ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map(this, function( elem, i ) { - return callback.call( elem, i, elem ); - })); - }, - - slice: function() { - return this.pushStack( slice.apply( this, arguments ) ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - eq: function( i ) { - var len = this.length, - j = +i + ( i < 0 ? len : 0 ); - return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); - }, - - end: function() { - return this.prevObject || this.constructor(null); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: push, - sort: deletedIds.sort, - splice: deletedIds.splice -}; - -jQuery.extend = jQuery.fn.extend = function() { - var src, copyIsArray, copy, name, options, clone, - target = arguments[0] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - - // skip the boolean and the target - target = arguments[ i ] || {}; - i++; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction(target) ) { - target = {}; - } - - // extend jQuery itself if only one argument is passed - if ( i === length ) { - target = this; - i--; - } - - for ( ; i < length; i++ ) { - // Only deal with non-null/undefined values - if ( (options = arguments[ i ]) != null ) { - // Extend the base object - for ( name in options ) { - src = target[ name ]; - copy = options[ name ]; - - // Prevent never-ending loop - if ( target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { - if ( copyIsArray ) { - copyIsArray = false; - clone = src && jQuery.isArray(src) ? src : []; - - } else { - clone = src && jQuery.isPlainObject(src) ? src : {}; - } - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend({ - // Unique for each copy of jQuery on the page - expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), - - // Assume jQuery is ready without the ready module - isReady: true, - - error: function( msg ) { - throw new Error( msg ); - }, - - noop: function() {}, - - // See test/unit/core.js for details concerning isFunction. - // Since version 1.3, DOM methods and functions like alert - // aren't supported. They return false on IE (#2968). - isFunction: function( obj ) { - return jQuery.type(obj) === "function"; - }, - - isArray: Array.isArray || function( obj ) { - return jQuery.type(obj) === "array"; - }, - - isWindow: function( obj ) { - /* jshint eqeqeq: false */ - return obj != null && obj == obj.window; - }, - - isNumeric: function( obj ) { - // parseFloat NaNs numeric-cast false positives (null|true|false|"") - // ...but misinterprets leading-number strings, particularly hex literals ("0x...") - // subtraction forces infinities to NaN - return !jQuery.isArray( obj ) && obj - parseFloat( obj ) >= 0; - }, - - isEmptyObject: function( obj ) { - var name; - for ( name in obj ) { - return false; - } - return true; - }, - - isPlainObject: function( obj ) { - var key; - - // Must be an Object. - // Because of IE, we also have to check the presence of the constructor property. - // Make sure that DOM nodes and window objects don't pass through, as well - if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { - return false; - } - - try { - // Not own constructor property must be Object - if ( obj.constructor && - !hasOwn.call(obj, "constructor") && - !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { - return false; - } - } catch ( e ) { - // IE8,9 Will throw exceptions on certain host objects #9897 - return false; - } - - // Support: IE<9 - // Handle iteration over inherited properties before own properties. - if ( support.ownLast ) { - for ( key in obj ) { - return hasOwn.call( obj, key ); - } - } - - // Own properties are enumerated firstly, so to speed up, - // if last one is own, then all properties are own. - for ( key in obj ) {} - - return key === undefined || hasOwn.call( obj, key ); - }, - - type: function( obj ) { - if ( obj == null ) { - return obj + ""; - } - return typeof obj === "object" || typeof obj === "function" ? - class2type[ toString.call(obj) ] || "object" : - typeof obj; - }, - - // Evaluates a script in a global context - // Workarounds based on findings by Jim Driscoll - // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context - globalEval: function( data ) { - if ( data && jQuery.trim( data ) ) { - // We use execScript on Internet Explorer - // We use an anonymous function so that context is window - // rather than jQuery in Firefox - ( window.execScript || function( data ) { - window[ "eval" ].call( window, data ); - } )( data ); - } - }, - - // Convert dashed to camelCase; used by the css and data modules - // Microsoft forgot to hump their vendor prefix (#9572) - camelCase: function( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); - }, - - nodeName: function( elem, name ) { - return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); - }, - - // args is for internal usage only - each: function( obj, callback, args ) { - var value, - i = 0, - length = obj.length, - isArray = isArraylike( obj ); - - if ( args ) { - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback.apply( obj[ i ], args ); - - if ( value === false ) { - break; - } - } - } else { - for ( i in obj ) { - value = callback.apply( obj[ i ], args ); - - if ( value === false ) { - break; - } - } - } - - // A special, fast, case for the most common use of each - } else { - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback.call( obj[ i ], i, obj[ i ] ); - - if ( value === false ) { - break; - } - } - } else { - for ( i in obj ) { - value = callback.call( obj[ i ], i, obj[ i ] ); - - if ( value === false ) { - break; - } - } - } - } - - return obj; - }, - - // Support: Android<4.1, IE<9 - trim: function( text ) { - return text == null ? - "" : - ( text + "" ).replace( rtrim, "" ); - }, - - // results is for internal usage only - makeArray: function( arr, results ) { - var ret = results || []; - - if ( arr != null ) { - if ( isArraylike( Object(arr) ) ) { - jQuery.merge( ret, - typeof arr === "string" ? - [ arr ] : arr - ); - } else { - push.call( ret, arr ); - } - } - - return ret; - }, - - inArray: function( elem, arr, i ) { - var len; - - if ( arr ) { - if ( indexOf ) { - return indexOf.call( arr, elem, i ); - } - - len = arr.length; - i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; - - for ( ; i < len; i++ ) { - // Skip accessing in sparse arrays - if ( i in arr && arr[ i ] === elem ) { - return i; - } - } - } - - return -1; - }, - - merge: function( first, second ) { - var len = +second.length, - j = 0, - i = first.length; - - while ( j < len ) { - first[ i++ ] = second[ j++ ]; - } - - // Support: IE<9 - // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists) - if ( len !== len ) { - while ( second[j] !== undefined ) { - first[ i++ ] = second[ j++ ]; - } - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, invert ) { - var callbackInverse, - matches = [], - i = 0, - length = elems.length, - callbackExpect = !invert; - - // Go through the array, only saving the items - // that pass the validator function - for ( ; i < length; i++ ) { - callbackInverse = !callback( elems[ i ], i ); - if ( callbackInverse !== callbackExpect ) { - matches.push( elems[ i ] ); - } - } - - return matches; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var value, - i = 0, - length = elems.length, - isArray = isArraylike( elems ), - ret = []; - - // Go through the array, translating each of the items to their new values - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - - // Go through every key on the object, - } else { - for ( i in elems ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - } - - // Flatten any nested arrays - return concat.apply( [], ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // Bind a function to a context, optionally partially applying any - // arguments. - proxy: function( fn, context ) { - var args, proxy, tmp; - - if ( typeof context === "string" ) { - tmp = fn[ context ]; - context = fn; - fn = tmp; - } - - // Quick check to determine if target is callable, in the spec - // this throws a TypeError, but we will just return undefined. - if ( !jQuery.isFunction( fn ) ) { - return undefined; - } - - // Simulated bind - args = slice.call( arguments, 2 ); - proxy = function() { - return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); - }; - - // Set the guid of unique handler to the same of original handler, so it can be removed - proxy.guid = fn.guid = fn.guid || jQuery.guid++; - - return proxy; - }, - - now: function() { - return +( new Date() ); - }, - - // jQuery.support is not used in Core but other projects attach their - // properties to it so it needs to exist. - support: support -}); - -// Populate the class2type map -jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); -}); - -function isArraylike( obj ) { - var length = obj.length, - type = jQuery.type( obj ); - - if ( type === "function" || jQuery.isWindow( obj ) ) { - return false; - } - - if ( obj.nodeType === 1 && length ) { - return true; - } - - return type === "array" || length === 0 || - typeof length === "number" && length > 0 && ( length - 1 ) in obj; -} -var Sizzle = -/*! - * Sizzle CSS Selector Engine v1.10.19 - * http://sizzlejs.com/ - * - * Copyright 2013 jQuery Foundation, Inc. and other contributors - * Released under the MIT license - * http://jquery.org/license - * - * Date: 2014-04-18 - */ -(function( window ) { - -var i, - support, - Expr, - getText, - isXML, - tokenize, - compile, - select, - outermostContext, - sortInput, - hasDuplicate, - - // Local document vars - setDocument, - document, - docElem, - documentIsHTML, - rbuggyQSA, - rbuggyMatches, - matches, - contains, - - // Instance-specific data - expando = "sizzle" + -(new Date()), - preferredDoc = window.document, - dirruns = 0, - done = 0, - classCache = createCache(), - tokenCache = createCache(), - compilerCache = createCache(), - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - } - return 0; - }, - - // General-purpose constants - strundefined = typeof undefined, - MAX_NEGATIVE = 1 << 31, - - // Instance methods - hasOwn = ({}).hasOwnProperty, - arr = [], - pop = arr.pop, - push_native = arr.push, - push = arr.push, - slice = arr.slice, - // Use a stripped-down indexOf if we can't use a native one - indexOf = arr.indexOf || function( elem ) { - var i = 0, - len = this.length; - for ( ; i < len; i++ ) { - if ( this[i] === elem ) { - return i; - } - } - return -1; - }, - - booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", - - // Regular expressions - - // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace - whitespace = "[\\x20\\t\\r\\n\\f]", - // http://www.w3.org/TR/css3-syntax/#characters - characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", - - // Loosely modeled on CSS identifier characters - // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors - // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier - identifier = characterEncoding.replace( "w", "w#" ), - - // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors - attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace + - // Operator (capture 2) - "*([*^$|!~]?=)" + whitespace + - // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" - "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + - "*\\]", - - pseudos = ":(" + characterEncoding + ")(?:\\((" + - // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: - // 1. quoted (capture 3; capture 4 or capture 5) - "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + - // 2. simple (capture 6) - "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + - // 3. anything else (capture 2) - ".*" + - ")\\)|)", - - // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter - rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), - - rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), - rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), - - rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), - - rpseudo = new RegExp( pseudos ), - ridentifier = new RegExp( "^" + identifier + "$" ), - - matchExpr = { - "ID": new RegExp( "^#(" + characterEncoding + ")" ), - "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), - "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), - "ATTR": new RegExp( "^" + attributes ), - "PSEUDO": new RegExp( "^" + pseudos ), - "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + - "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + - "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), - "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), - // For use in libraries implementing .is() - // We use this for POS matching in `select` - "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + - whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) - }, - - rinputs = /^(?:input|select|textarea|button)$/i, - rheader = /^h\d$/i, - - rnative = /^[^{]+\{\s*\[native \w/, - - // Easily-parseable/retrievable ID or TAG or CLASS selectors - rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, - - rsibling = /[+~]/, - rescape = /'|\\/g, - - // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters - runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), - funescape = function( _, escaped, escapedWhitespace ) { - var high = "0x" + escaped - 0x10000; - // NaN means non-codepoint - // Support: Firefox<24 - // Workaround erroneous numeric interpretation of +"0x" - return high !== high || escapedWhitespace ? - escaped : - high < 0 ? - // BMP codepoint - String.fromCharCode( high + 0x10000 ) : - // Supplemental Plane codepoint (surrogate pair) - String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); - }; - -// Optimize for push.apply( _, NodeList ) -try { - push.apply( - (arr = slice.call( preferredDoc.childNodes )), - preferredDoc.childNodes - ); - // Support: Android<4.0 - // Detect silently failing push.apply - arr[ preferredDoc.childNodes.length ].nodeType; -} catch ( e ) { - push = { apply: arr.length ? - - // Leverage slice if possible - function( target, els ) { - push_native.apply( target, slice.call(els) ); - } : - - // Support: IE<9 - // Otherwise append directly - function( target, els ) { - var j = target.length, - i = 0; - // Can't trust NodeList.length - while ( (target[j++] = els[i++]) ) {} - target.length = j - 1; - } - }; -} - -function Sizzle( selector, context, results, seed ) { - var match, elem, m, nodeType, - // QSA vars - i, groups, old, nid, newContext, newSelector; - - if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { - setDocument( context ); - } - - context = context || document; - results = results || []; - - if ( !selector || typeof selector !== "string" ) { - return results; - } - - if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { - return []; - } - - if ( documentIsHTML && !seed ) { - - // Shortcuts - if ( (match = rquickExpr.exec( selector )) ) { - // Speed-up: Sizzle("#ID") - if ( (m = match[1]) ) { - if ( nodeType === 9 ) { - elem = context.getElementById( m ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document (jQuery #6963) - if ( elem && elem.parentNode ) { - // Handle the case where IE, Opera, and Webkit return items - // by name instead of ID - if ( elem.id === m ) { - results.push( elem ); - return results; - } - } else { - return results; - } - } else { - // Context is not a document - if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && - contains( context, elem ) && elem.id === m ) { - results.push( elem ); - return results; - } - } - - // Speed-up: Sizzle("TAG") - } else if ( match[2] ) { - push.apply( results, context.getElementsByTagName( selector ) ); - return results; - - // Speed-up: Sizzle(".CLASS") - } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { - push.apply( results, context.getElementsByClassName( m ) ); - return results; - } - } - - // QSA path - if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { - nid = old = expando; - newContext = context; - newSelector = nodeType === 9 && selector; - - // qSA works strangely on Element-rooted queries - // We can work around this by specifying an extra ID on the root - // and working up from there (Thanks to Andrew Dupont for the technique) - // IE 8 doesn't work on object elements - if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { - groups = tokenize( selector ); - - if ( (old = context.getAttribute("id")) ) { - nid = old.replace( rescape, "\\$&" ); - } else { - context.setAttribute( "id", nid ); - } - nid = "[id='" + nid + "'] "; - - i = groups.length; - while ( i-- ) { - groups[i] = nid + toSelector( groups[i] ); - } - newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context; - newSelector = groups.join(","); - } - - if ( newSelector ) { - try { - push.apply( results, - newContext.querySelectorAll( newSelector ) - ); - return results; - } catch(qsaError) { - } finally { - if ( !old ) { - context.removeAttribute("id"); - } - } - } - } - } - - // All others - return select( selector.replace( rtrim, "$1" ), context, results, seed ); -} - -/** - * Create key-value caches of limited size - * @returns {Function(string, Object)} Returns the Object data after storing it on itself with - * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) - * deleting the oldest entry - */ -function createCache() { - var keys = []; - - function cache( key, value ) { - // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) - if ( keys.push( key + " " ) > Expr.cacheLength ) { - // Only keep the most recent entries - delete cache[ keys.shift() ]; - } - return (cache[ key + " " ] = value); - } - return cache; -} - -/** - * Mark a function for special use by Sizzle - * @param {Function} fn The function to mark - */ -function markFunction( fn ) { - fn[ expando ] = true; - return fn; -} - -/** - * Support testing using an element - * @param {Function} fn Passed the created div and expects a boolean result - */ -function assert( fn ) { - var div = document.createElement("div"); - - try { - return !!fn( div ); - } catch (e) { - return false; - } finally { - // Remove from its parent by default - if ( div.parentNode ) { - div.parentNode.removeChild( div ); - } - // release memory in IE - div = null; - } -} - -/** - * Adds the same handler for all of the specified attrs - * @param {String} attrs Pipe-separated list of attributes - * @param {Function} handler The method that will be applied - */ -function addHandle( attrs, handler ) { - var arr = attrs.split("|"), - i = attrs.length; - - while ( i-- ) { - Expr.attrHandle[ arr[i] ] = handler; - } -} - -/** - * Checks document order of two siblings - * @param {Element} a - * @param {Element} b - * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b - */ -function siblingCheck( a, b ) { - var cur = b && a, - diff = cur && a.nodeType === 1 && b.nodeType === 1 && - ( ~b.sourceIndex || MAX_NEGATIVE ) - - ( ~a.sourceIndex || MAX_NEGATIVE ); - - // Use IE sourceIndex if available on both nodes - if ( diff ) { - return diff; - } - - // Check if b follows a - if ( cur ) { - while ( (cur = cur.nextSibling) ) { - if ( cur === b ) { - return -1; - } - } - } - - return a ? 1 : -1; -} - -/** - * Returns a function to use in pseudos for input types - * @param {String} type - */ -function createInputPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for buttons - * @param {String} type - */ -function createButtonPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for positionals - * @param {Function} fn - */ -function createPositionalPseudo( fn ) { - return markFunction(function( argument ) { - argument = +argument; - return markFunction(function( seed, matches ) { - var j, - matchIndexes = fn( [], seed.length, argument ), - i = matchIndexes.length; - - // Match elements found at the specified indexes - while ( i-- ) { - if ( seed[ (j = matchIndexes[i]) ] ) { - seed[j] = !(matches[j] = seed[j]); - } - } - }); - }); -} - -/** - * Checks a node for validity as a Sizzle context - * @param {Element|Object=} context - * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value - */ -function testContext( context ) { - return context && typeof context.getElementsByTagName !== strundefined && context; -} - -// Expose support vars for convenience -support = Sizzle.support = {}; - -/** - * Detects XML nodes - * @param {Element|Object} elem An element or a document - * @returns {Boolean} True iff elem is a non-HTML XML node - */ -isXML = Sizzle.isXML = function( elem ) { - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = elem && (elem.ownerDocument || elem).documentElement; - return documentElement ? documentElement.nodeName !== "HTML" : false; -}; - -/** - * Sets document-related variables once based on the current document - * @param {Element|Object} [doc] An element or document object to use to set the document - * @returns {Object} Returns the current document - */ -setDocument = Sizzle.setDocument = function( node ) { - var hasCompare, - doc = node ? node.ownerDocument || node : preferredDoc, - parent = doc.defaultView; - - // If no document and documentElement is available, return - if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { - return document; - } - - // Set our document - document = doc; - docElem = doc.documentElement; - - // Support tests - documentIsHTML = !isXML( doc ); - - // Support: IE>8 - // If iframe document is assigned to "document" variable and if iframe has been reloaded, - // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936 - // IE6-8 do not support the defaultView property so parent will be undefined - if ( parent && parent !== parent.top ) { - // IE11 does not have attachEvent, so all must suffer - if ( parent.addEventListener ) { - parent.addEventListener( "unload", function() { - setDocument(); - }, false ); - } else if ( parent.attachEvent ) { - parent.attachEvent( "onunload", function() { - setDocument(); - }); - } - } - - /* Attributes - ---------------------------------------------------------------------- */ - - // Support: IE<8 - // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans) - support.attributes = assert(function( div ) { - div.className = "i"; - return !div.getAttribute("className"); - }); - - /* getElement(s)By* - ---------------------------------------------------------------------- */ - - // Check if getElementsByTagName("*") returns only elements - support.getElementsByTagName = assert(function( div ) { - div.appendChild( doc.createComment("") ); - return !div.getElementsByTagName("*").length; - }); - - // Check if getElementsByClassName can be trusted - support.getElementsByClassName = rnative.test( doc.getElementsByClassName ) && assert(function( div ) { - div.innerHTML = "
      "; - - // Support: Safari<4 - // Catch class over-caching - div.firstChild.className = "i"; - // Support: Opera<10 - // Catch gEBCN failure to find non-leading classes - return div.getElementsByClassName("i").length === 2; - }); - - // Support: IE<10 - // Check if getElementById returns elements by name - // The broken getElementById methods don't pick up programatically-set names, - // so use a roundabout getElementsByName test - support.getById = assert(function( div ) { - docElem.appendChild( div ).id = expando; - return !doc.getElementsByName || !doc.getElementsByName( expando ).length; - }); - - // ID find and filter - if ( support.getById ) { - Expr.find["ID"] = function( id, context ) { - if ( typeof context.getElementById !== strundefined && documentIsHTML ) { - var m = context.getElementById( id ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - return m && m.parentNode ? [ m ] : []; - } - }; - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - return elem.getAttribute("id") === attrId; - }; - }; - } else { - // Support: IE6/7 - // getElementById is not reliable as a find shortcut - delete Expr.find["ID"]; - - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); - return node && node.value === attrId; - }; - }; - } - - // Tag - Expr.find["TAG"] = support.getElementsByTagName ? - function( tag, context ) { - if ( typeof context.getElementsByTagName !== strundefined ) { - return context.getElementsByTagName( tag ); - } - } : - function( tag, context ) { - var elem, - tmp = [], - i = 0, - results = context.getElementsByTagName( tag ); - - // Filter out possible comments - if ( tag === "*" ) { - while ( (elem = results[i++]) ) { - if ( elem.nodeType === 1 ) { - tmp.push( elem ); - } - } - - return tmp; - } - return results; - }; - - // Class - Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { - if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) { - return context.getElementsByClassName( className ); - } - }; - - /* QSA/matchesSelector - ---------------------------------------------------------------------- */ - - // QSA and matchesSelector support - - // matchesSelector(:active) reports false when true (IE9/Opera 11.5) - rbuggyMatches = []; - - // qSa(:focus) reports false when true (Chrome 21) - // We allow this because of a bug in IE8/9 that throws an error - // whenever `document.activeElement` is accessed on an iframe - // So, we allow :focus to pass through QSA all the time to avoid the IE error - // See http://bugs.jquery.com/ticket/13378 - rbuggyQSA = []; - - if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) { - // Build QSA regex - // Regex strategy adopted from Diego Perini - assert(function( div ) { - // Select is set to empty string on purpose - // This is to test IE's treatment of not explicitly - // setting a boolean content attribute, - // since its presence should be enough - // http://bugs.jquery.com/ticket/12359 - div.innerHTML = ""; - - // Support: IE8, Opera 11-12.16 - // Nothing should be selected when empty strings follow ^= or $= or *= - // The test attribute must be unknown in Opera but "safe" for WinRT - // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section - if ( div.querySelectorAll("[msallowclip^='']").length ) { - rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); - } - - // Support: IE8 - // Boolean attributes and "value" are not treated correctly - if ( !div.querySelectorAll("[selected]").length ) { - rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); - } - - // Webkit/Opera - :checked should return selected option elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - // IE8 throws error here and will not see later tests - if ( !div.querySelectorAll(":checked").length ) { - rbuggyQSA.push(":checked"); - } - }); - - assert(function( div ) { - // Support: Windows 8 Native Apps - // The type and name attributes are restricted during .innerHTML assignment - var input = doc.createElement("input"); - input.setAttribute( "type", "hidden" ); - div.appendChild( input ).setAttribute( "name", "D" ); - - // Support: IE8 - // Enforce case-sensitivity of name attribute - if ( div.querySelectorAll("[name=d]").length ) { - rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); - } - - // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) - // IE8 throws error here and will not see later tests - if ( !div.querySelectorAll(":enabled").length ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Opera 10-11 does not throw on post-comma invalid pseudos - div.querySelectorAll("*,:x"); - rbuggyQSA.push(",.*:"); - }); - } - - if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || - docElem.webkitMatchesSelector || - docElem.mozMatchesSelector || - docElem.oMatchesSelector || - docElem.msMatchesSelector) )) ) { - - assert(function( div ) { - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9) - support.disconnectedMatch = matches.call( div, "div" ); - - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( div, "[s!='']:x" ); - rbuggyMatches.push( "!=", pseudos ); - }); - } - - rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); - rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); - - /* Contains - ---------------------------------------------------------------------- */ - hasCompare = rnative.test( docElem.compareDocumentPosition ); - - // Element contains another - // Purposefully does not implement inclusive descendent - // As in, an element does not contain itself - contains = hasCompare || rnative.test( docElem.contains ) ? - function( a, b ) { - var adown = a.nodeType === 9 ? a.documentElement : a, - bup = b && b.parentNode; - return a === bup || !!( bup && bup.nodeType === 1 && ( - adown.contains ? - adown.contains( bup ) : - a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 - )); - } : - function( a, b ) { - if ( b ) { - while ( (b = b.parentNode) ) { - if ( b === a ) { - return true; - } - } - } - return false; - }; - - /* Sorting - ---------------------------------------------------------------------- */ - - // Document order sorting - sortOrder = hasCompare ? - function( a, b ) { - - // Flag for duplicate removal - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - // Sort on method existence if only one input has compareDocumentPosition - var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; - if ( compare ) { - return compare; - } - - // Calculate position if both inputs belong to the same document - compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? - a.compareDocumentPosition( b ) : - - // Otherwise we know they are disconnected - 1; - - // Disconnected nodes - if ( compare & 1 || - (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { - - // Choose the first element that is related to our preferred document - if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { - return -1; - } - if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { - return 1; - } - - // Maintain original order - return sortInput ? - ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : - 0; - } - - return compare & 4 ? -1 : 1; - } : - function( a, b ) { - // Exit early if the nodes are identical - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - var cur, - i = 0, - aup = a.parentNode, - bup = b.parentNode, - ap = [ a ], - bp = [ b ]; - - // Parentless nodes are either documents or disconnected - if ( !aup || !bup ) { - return a === doc ? -1 : - b === doc ? 1 : - aup ? -1 : - bup ? 1 : - sortInput ? - ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : - 0; - - // If the nodes are siblings, we can do a quick check - } else if ( aup === bup ) { - return siblingCheck( a, b ); - } - - // Otherwise we need full lists of their ancestors for comparison - cur = a; - while ( (cur = cur.parentNode) ) { - ap.unshift( cur ); - } - cur = b; - while ( (cur = cur.parentNode) ) { - bp.unshift( cur ); - } - - // Walk down the tree looking for a discrepancy - while ( ap[i] === bp[i] ) { - i++; - } - - return i ? - // Do a sibling check if the nodes have a common ancestor - siblingCheck( ap[i], bp[i] ) : - - // Otherwise nodes in our document sort first - ap[i] === preferredDoc ? -1 : - bp[i] === preferredDoc ? 1 : - 0; - }; - - return doc; -}; - -Sizzle.matches = function( expr, elements ) { - return Sizzle( expr, null, null, elements ); -}; - -Sizzle.matchesSelector = function( elem, expr ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - // Make sure that attribute selectors are quoted - expr = expr.replace( rattributeQuotes, "='$1']" ); - - if ( support.matchesSelector && documentIsHTML && - ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && - ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { - - try { - var ret = matches.call( elem, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || support.disconnectedMatch || - // As well, disconnected nodes are said to be in a document - // fragment in IE 9 - elem.document && elem.document.nodeType !== 11 ) { - return ret; - } - } catch(e) {} - } - - return Sizzle( expr, document, null, [ elem ] ).length > 0; -}; - -Sizzle.contains = function( context, elem ) { - // Set document vars if needed - if ( ( context.ownerDocument || context ) !== document ) { - setDocument( context ); - } - return contains( context, elem ); -}; - -Sizzle.attr = function( elem, name ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - var fn = Expr.attrHandle[ name.toLowerCase() ], - // Don't get fooled by Object.prototype properties (jQuery #13807) - val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? - fn( elem, name, !documentIsHTML ) : - undefined; - - return val !== undefined ? - val : - support.attributes || !documentIsHTML ? - elem.getAttribute( name ) : - (val = elem.getAttributeNode(name)) && val.specified ? - val.value : - null; -}; - -Sizzle.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); -}; - -/** - * Document sorting and removing duplicates - * @param {ArrayLike} results - */ -Sizzle.uniqueSort = function( results ) { - var elem, - duplicates = [], - j = 0, - i = 0; - - // Unless we *know* we can detect duplicates, assume their presence - hasDuplicate = !support.detectDuplicates; - sortInput = !support.sortStable && results.slice( 0 ); - results.sort( sortOrder ); - - if ( hasDuplicate ) { - while ( (elem = results[i++]) ) { - if ( elem === results[ i ] ) { - j = duplicates.push( i ); - } - } - while ( j-- ) { - results.splice( duplicates[ j ], 1 ); - } - } - - // Clear input after sorting to release objects - // See https://github.com/jquery/sizzle/pull/225 - sortInput = null; - - return results; -}; - -/** - * Utility function for retrieving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -getText = Sizzle.getText = function( elem ) { - var node, - ret = "", - i = 0, - nodeType = elem.nodeType; - - if ( !nodeType ) { - // If no nodeType, this is expected to be an array - while ( (node = elem[i++]) ) { - // Do not traverse comment nodes - ret += getText( node ); - } - } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { - // Use textContent for elements - // innerText usage removed for consistency of new lines (jQuery #11153) - if ( typeof elem.textContent === "string" ) { - return elem.textContent; - } else { - // Traverse its children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - // Do not include comment or processing instruction nodes - - return ret; -}; - -Expr = Sizzle.selectors = { - - // Can be adjusted by the user - cacheLength: 50, - - createPseudo: markFunction, - - match: matchExpr, - - attrHandle: {}, - - find: {}, - - relative: { - ">": { dir: "parentNode", first: true }, - " ": { dir: "parentNode" }, - "+": { dir: "previousSibling", first: true }, - "~": { dir: "previousSibling" } - }, - - preFilter: { - "ATTR": function( match ) { - match[1] = match[1].replace( runescape, funescape ); - - // Move the given value to match[3] whether quoted or unquoted - match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); - - if ( match[2] === "~=" ) { - match[3] = " " + match[3] + " "; - } - - return match.slice( 0, 4 ); - }, - - "CHILD": function( match ) { - /* matches from matchExpr["CHILD"] - 1 type (only|nth|...) - 2 what (child|of-type) - 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) - 4 xn-component of xn+y argument ([+-]?\d*n|) - 5 sign of xn-component - 6 x of xn-component - 7 sign of y-component - 8 y of y-component - */ - match[1] = match[1].toLowerCase(); - - if ( match[1].slice( 0, 3 ) === "nth" ) { - // nth-* requires argument - if ( !match[3] ) { - Sizzle.error( match[0] ); - } - - // numeric x and y parameters for Expr.filter.CHILD - // remember that false/true cast respectively to 0/1 - match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); - match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); - - // other types prohibit arguments - } else if ( match[3] ) { - Sizzle.error( match[0] ); - } - - return match; - }, - - "PSEUDO": function( match ) { - var excess, - unquoted = !match[6] && match[2]; - - if ( matchExpr["CHILD"].test( match[0] ) ) { - return null; - } - - // Accept quoted arguments as-is - if ( match[3] ) { - match[2] = match[4] || match[5] || ""; - - // Strip excess characters from unquoted arguments - } else if ( unquoted && rpseudo.test( unquoted ) && - // Get excess from tokenize (recursively) - (excess = tokenize( unquoted, true )) && - // advance to the next closing parenthesis - (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { - - // excess is a negative index - match[0] = match[0].slice( 0, excess ); - match[2] = unquoted.slice( 0, excess ); - } - - // Return only captures needed by the pseudo filter method (type and argument) - return match.slice( 0, 3 ); - } - }, - - filter: { - - "TAG": function( nodeNameSelector ) { - var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); - return nodeNameSelector === "*" ? - function() { return true; } : - function( elem ) { - return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; - }; - }, - - "CLASS": function( className ) { - var pattern = classCache[ className + " " ]; - - return pattern || - (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && - classCache( className, function( elem ) { - return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" ); - }); - }, - - "ATTR": function( name, operator, check ) { - return function( elem ) { - var result = Sizzle.attr( elem, name ); - - if ( result == null ) { - return operator === "!="; - } - if ( !operator ) { - return true; - } - - result += ""; - - return operator === "=" ? result === check : - operator === "!=" ? result !== check : - operator === "^=" ? check && result.indexOf( check ) === 0 : - operator === "*=" ? check && result.indexOf( check ) > -1 : - operator === "$=" ? check && result.slice( -check.length ) === check : - operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : - operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : - false; - }; - }, - - "CHILD": function( type, what, argument, first, last ) { - var simple = type.slice( 0, 3 ) !== "nth", - forward = type.slice( -4 ) !== "last", - ofType = what === "of-type"; - - return first === 1 && last === 0 ? - - // Shortcut for :nth-*(n) - function( elem ) { - return !!elem.parentNode; - } : - - function( elem, context, xml ) { - var cache, outerCache, node, diff, nodeIndex, start, - dir = simple !== forward ? "nextSibling" : "previousSibling", - parent = elem.parentNode, - name = ofType && elem.nodeName.toLowerCase(), - useCache = !xml && !ofType; - - if ( parent ) { - - // :(first|last|only)-(child|of-type) - if ( simple ) { - while ( dir ) { - node = elem; - while ( (node = node[ dir ]) ) { - if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { - return false; - } - } - // Reverse direction for :only-* (if we haven't yet done so) - start = dir = type === "only" && !start && "nextSibling"; - } - return true; - } - - start = [ forward ? parent.firstChild : parent.lastChild ]; - - // non-xml :nth-child(...) stores cache data on `parent` - if ( forward && useCache ) { - // Seek `elem` from a previously-cached index - outerCache = parent[ expando ] || (parent[ expando ] = {}); - cache = outerCache[ type ] || []; - nodeIndex = cache[0] === dirruns && cache[1]; - diff = cache[0] === dirruns && cache[2]; - node = nodeIndex && parent.childNodes[ nodeIndex ]; - - while ( (node = ++nodeIndex && node && node[ dir ] || - - // Fallback to seeking `elem` from the start - (diff = nodeIndex = 0) || start.pop()) ) { - - // When found, cache indexes on `parent` and break - if ( node.nodeType === 1 && ++diff && node === elem ) { - outerCache[ type ] = [ dirruns, nodeIndex, diff ]; - break; - } - } - - // Use previously-cached element index if available - } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { - diff = cache[1]; - - // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) - } else { - // Use the same loop as above to seek `elem` from the start - while ( (node = ++nodeIndex && node && node[ dir ] || - (diff = nodeIndex = 0) || start.pop()) ) { - - if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { - // Cache the index of each encountered element - if ( useCache ) { - (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; - } - - if ( node === elem ) { - break; - } - } - } - } - - // Incorporate the offset, then check against cycle size - diff -= last; - return diff === first || ( diff % first === 0 && diff / first >= 0 ); - } - }; - }, - - "PSEUDO": function( pseudo, argument ) { - // pseudo-class names are case-insensitive - // http://www.w3.org/TR/selectors/#pseudo-classes - // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters - // Remember that setFilters inherits from pseudos - var args, - fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || - Sizzle.error( "unsupported pseudo: " + pseudo ); - - // The user may use createPseudo to indicate that - // arguments are needed to create the filter function - // just as Sizzle does - if ( fn[ expando ] ) { - return fn( argument ); - } - - // But maintain support for old signatures - if ( fn.length > 1 ) { - args = [ pseudo, pseudo, "", argument ]; - return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? - markFunction(function( seed, matches ) { - var idx, - matched = fn( seed, argument ), - i = matched.length; - while ( i-- ) { - idx = indexOf.call( seed, matched[i] ); - seed[ idx ] = !( matches[ idx ] = matched[i] ); - } - }) : - function( elem ) { - return fn( elem, 0, args ); - }; - } - - return fn; - } - }, - - pseudos: { - // Potentially complex pseudos - "not": markFunction(function( selector ) { - // Trim the selector passed to compile - // to avoid treating leading and trailing - // spaces as combinators - var input = [], - results = [], - matcher = compile( selector.replace( rtrim, "$1" ) ); - - return matcher[ expando ] ? - markFunction(function( seed, matches, context, xml ) { - var elem, - unmatched = matcher( seed, null, xml, [] ), - i = seed.length; - - // Match elements unmatched by `matcher` - while ( i-- ) { - if ( (elem = unmatched[i]) ) { - seed[i] = !(matches[i] = elem); - } - } - }) : - function( elem, context, xml ) { - input[0] = elem; - matcher( input, null, xml, results ); - return !results.pop(); - }; - }), - - "has": markFunction(function( selector ) { - return function( elem ) { - return Sizzle( selector, elem ).length > 0; - }; - }), - - "contains": markFunction(function( text ) { - return function( elem ) { - return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; - }; - }), - - // "Whether an element is represented by a :lang() selector - // is based solely on the element's language value - // being equal to the identifier C, - // or beginning with the identifier C immediately followed by "-". - // The matching of C against the element's language value is performed case-insensitively. - // The identifier C does not have to be a valid language name." - // http://www.w3.org/TR/selectors/#lang-pseudo - "lang": markFunction( function( lang ) { - // lang value must be a valid identifier - if ( !ridentifier.test(lang || "") ) { - Sizzle.error( "unsupported lang: " + lang ); - } - lang = lang.replace( runescape, funescape ).toLowerCase(); - return function( elem ) { - var elemLang; - do { - if ( (elemLang = documentIsHTML ? - elem.lang : - elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { - - elemLang = elemLang.toLowerCase(); - return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; - } - } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); - return false; - }; - }), - - // Miscellaneous - "target": function( elem ) { - var hash = window.location && window.location.hash; - return hash && hash.slice( 1 ) === elem.id; - }, - - "root": function( elem ) { - return elem === docElem; - }, - - "focus": function( elem ) { - return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); - }, - - // Boolean properties - "enabled": function( elem ) { - return elem.disabled === false; - }, - - "disabled": function( elem ) { - return elem.disabled === true; - }, - - "checked": function( elem ) { - // In CSS3, :checked should return both checked and selected elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - var nodeName = elem.nodeName.toLowerCase(); - return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); - }, - - "selected": function( elem ) { - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - // Contents - "empty": function( elem ) { - // http://www.w3.org/TR/selectors/#empty-pseudo - // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), - // but not by others (comment: 8; processing instruction: 7; etc.) - // nodeType < 6 works because attributes (2) do not appear as children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - if ( elem.nodeType < 6 ) { - return false; - } - } - return true; - }, - - "parent": function( elem ) { - return !Expr.pseudos["empty"]( elem ); - }, - - // Element/input types - "header": function( elem ) { - return rheader.test( elem.nodeName ); - }, - - "input": function( elem ) { - return rinputs.test( elem.nodeName ); - }, - - "button": function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === "button" || name === "button"; - }, - - "text": function( elem ) { - var attr; - return elem.nodeName.toLowerCase() === "input" && - elem.type === "text" && - - // Support: IE<8 - // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" - ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); - }, - - // Position-in-collection - "first": createPositionalPseudo(function() { - return [ 0 ]; - }), - - "last": createPositionalPseudo(function( matchIndexes, length ) { - return [ length - 1 ]; - }), - - "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { - return [ argument < 0 ? argument + length : argument ]; - }), - - "even": createPositionalPseudo(function( matchIndexes, length ) { - var i = 0; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "odd": createPositionalPseudo(function( matchIndexes, length ) { - var i = 1; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; --i >= 0; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; ++i < length; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }) - } -}; - -Expr.pseudos["nth"] = Expr.pseudos["eq"]; - -// Add button/input type pseudos -for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { - Expr.pseudos[ i ] = createInputPseudo( i ); -} -for ( i in { submit: true, reset: true } ) { - Expr.pseudos[ i ] = createButtonPseudo( i ); -} - -// Easy API for creating new setFilters -function setFilters() {} -setFilters.prototype = Expr.filters = Expr.pseudos; -Expr.setFilters = new setFilters(); - -tokenize = Sizzle.tokenize = function( selector, parseOnly ) { - var matched, match, tokens, type, - soFar, groups, preFilters, - cached = tokenCache[ selector + " " ]; - - if ( cached ) { - return parseOnly ? 0 : cached.slice( 0 ); - } - - soFar = selector; - groups = []; - preFilters = Expr.preFilter; - - while ( soFar ) { - - // Comma and first run - if ( !matched || (match = rcomma.exec( soFar )) ) { - if ( match ) { - // Don't consume trailing commas as valid - soFar = soFar.slice( match[0].length ) || soFar; - } - groups.push( (tokens = []) ); - } - - matched = false; - - // Combinators - if ( (match = rcombinators.exec( soFar )) ) { - matched = match.shift(); - tokens.push({ - value: matched, - // Cast descendant combinators to space - type: match[0].replace( rtrim, " " ) - }); - soFar = soFar.slice( matched.length ); - } - - // Filters - for ( type in Expr.filter ) { - if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || - (match = preFilters[ type ]( match ))) ) { - matched = match.shift(); - tokens.push({ - value: matched, - type: type, - matches: match - }); - soFar = soFar.slice( matched.length ); - } - } - - if ( !matched ) { - break; - } - } - - // Return the length of the invalid excess - // if we're just parsing - // Otherwise, throw an error or return tokens - return parseOnly ? - soFar.length : - soFar ? - Sizzle.error( selector ) : - // Cache the tokens - tokenCache( selector, groups ).slice( 0 ); -}; - -function toSelector( tokens ) { - var i = 0, - len = tokens.length, - selector = ""; - for ( ; i < len; i++ ) { - selector += tokens[i].value; - } - return selector; -} - -function addCombinator( matcher, combinator, base ) { - var dir = combinator.dir, - checkNonElements = base && dir === "parentNode", - doneName = done++; - - return combinator.first ? - // Check against closest ancestor/preceding element - function( elem, context, xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - return matcher( elem, context, xml ); - } - } - } : - - // Check against all ancestor/preceding elements - function( elem, context, xml ) { - var oldCache, outerCache, - newCache = [ dirruns, doneName ]; - - // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching - if ( xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - if ( matcher( elem, context, xml ) ) { - return true; - } - } - } - } else { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - outerCache = elem[ expando ] || (elem[ expando ] = {}); - if ( (oldCache = outerCache[ dir ]) && - oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { - - // Assign to newCache so results back-propagate to previous elements - return (newCache[ 2 ] = oldCache[ 2 ]); - } else { - // Reuse newcache so results back-propagate to previous elements - outerCache[ dir ] = newCache; - - // A match means we're done; a fail means we have to keep checking - if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { - return true; - } - } - } - } - } - }; -} - -function elementMatcher( matchers ) { - return matchers.length > 1 ? - function( elem, context, xml ) { - var i = matchers.length; - while ( i-- ) { - if ( !matchers[i]( elem, context, xml ) ) { - return false; - } - } - return true; - } : - matchers[0]; -} - -function multipleContexts( selector, contexts, results ) { - var i = 0, - len = contexts.length; - for ( ; i < len; i++ ) { - Sizzle( selector, contexts[i], results ); - } - return results; -} - -function condense( unmatched, map, filter, context, xml ) { - var elem, - newUnmatched = [], - i = 0, - len = unmatched.length, - mapped = map != null; - - for ( ; i < len; i++ ) { - if ( (elem = unmatched[i]) ) { - if ( !filter || filter( elem, context, xml ) ) { - newUnmatched.push( elem ); - if ( mapped ) { - map.push( i ); - } - } - } - } - - return newUnmatched; -} - -function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { - if ( postFilter && !postFilter[ expando ] ) { - postFilter = setMatcher( postFilter ); - } - if ( postFinder && !postFinder[ expando ] ) { - postFinder = setMatcher( postFinder, postSelector ); - } - return markFunction(function( seed, results, context, xml ) { - var temp, i, elem, - preMap = [], - postMap = [], - preexisting = results.length, - - // Get initial elements from seed or context - elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), - - // Prefilter to get matcher input, preserving a map for seed-results synchronization - matcherIn = preFilter && ( seed || !selector ) ? - condense( elems, preMap, preFilter, context, xml ) : - elems, - - matcherOut = matcher ? - // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, - postFinder || ( seed ? preFilter : preexisting || postFilter ) ? - - // ...intermediate processing is necessary - [] : - - // ...otherwise use results directly - results : - matcherIn; - - // Find primary matches - if ( matcher ) { - matcher( matcherIn, matcherOut, context, xml ); - } - - // Apply postFilter - if ( postFilter ) { - temp = condense( matcherOut, postMap ); - postFilter( temp, [], context, xml ); - - // Un-match failing elements by moving them back to matcherIn - i = temp.length; - while ( i-- ) { - if ( (elem = temp[i]) ) { - matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); - } - } - } - - if ( seed ) { - if ( postFinder || preFilter ) { - if ( postFinder ) { - // Get the final matcherOut by condensing this intermediate into postFinder contexts - temp = []; - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) ) { - // Restore matcherIn since elem is not yet a final match - temp.push( (matcherIn[i] = elem) ); - } - } - postFinder( null, (matcherOut = []), temp, xml ); - } - - // Move matched elements from seed to results to keep them synchronized - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) && - (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { - - seed[temp] = !(results[temp] = elem); - } - } - } - - // Add elements to results, through postFinder if defined - } else { - matcherOut = condense( - matcherOut === results ? - matcherOut.splice( preexisting, matcherOut.length ) : - matcherOut - ); - if ( postFinder ) { - postFinder( null, results, matcherOut, xml ); - } else { - push.apply( results, matcherOut ); - } - } - }); -} - -function matcherFromTokens( tokens ) { - var checkContext, matcher, j, - len = tokens.length, - leadingRelative = Expr.relative[ tokens[0].type ], - implicitRelative = leadingRelative || Expr.relative[" "], - i = leadingRelative ? 1 : 0, - - // The foundational matcher ensures that elements are reachable from top-level context(s) - matchContext = addCombinator( function( elem ) { - return elem === checkContext; - }, implicitRelative, true ), - matchAnyContext = addCombinator( function( elem ) { - return indexOf.call( checkContext, elem ) > -1; - }, implicitRelative, true ), - matchers = [ function( elem, context, xml ) { - return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( - (checkContext = context).nodeType ? - matchContext( elem, context, xml ) : - matchAnyContext( elem, context, xml ) ); - } ]; - - for ( ; i < len; i++ ) { - if ( (matcher = Expr.relative[ tokens[i].type ]) ) { - matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; - } else { - matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); - - // Return special upon seeing a positional matcher - if ( matcher[ expando ] ) { - // Find the next relative operator (if any) for proper handling - j = ++i; - for ( ; j < len; j++ ) { - if ( Expr.relative[ tokens[j].type ] ) { - break; - } - } - return setMatcher( - i > 1 && elementMatcher( matchers ), - i > 1 && toSelector( - // If the preceding token was a descendant combinator, insert an implicit any-element `*` - tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) - ).replace( rtrim, "$1" ), - matcher, - i < j && matcherFromTokens( tokens.slice( i, j ) ), - j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), - j < len && toSelector( tokens ) - ); - } - matchers.push( matcher ); - } - } - - return elementMatcher( matchers ); -} - -function matcherFromGroupMatchers( elementMatchers, setMatchers ) { - var bySet = setMatchers.length > 0, - byElement = elementMatchers.length > 0, - superMatcher = function( seed, context, xml, results, outermost ) { - var elem, j, matcher, - matchedCount = 0, - i = "0", - unmatched = seed && [], - setMatched = [], - contextBackup = outermostContext, - // We must always have either seed elements or outermost context - elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), - // Use integer dirruns iff this is the outermost matcher - dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), - len = elems.length; - - if ( outermost ) { - outermostContext = context !== document && context; - } - - // Add elements passing elementMatchers directly to results - // Keep `i` a string if there are no elements so `matchedCount` will be "00" below - // Support: IE<9, Safari - // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id - for ( ; i !== len && (elem = elems[i]) != null; i++ ) { - if ( byElement && elem ) { - j = 0; - while ( (matcher = elementMatchers[j++]) ) { - if ( matcher( elem, context, xml ) ) { - results.push( elem ); - break; - } - } - if ( outermost ) { - dirruns = dirrunsUnique; - } - } - - // Track unmatched elements for set filters - if ( bySet ) { - // They will have gone through all possible matchers - if ( (elem = !matcher && elem) ) { - matchedCount--; - } - - // Lengthen the array for every element, matched or not - if ( seed ) { - unmatched.push( elem ); - } - } - } - - // Apply set filters to unmatched elements - matchedCount += i; - if ( bySet && i !== matchedCount ) { - j = 0; - while ( (matcher = setMatchers[j++]) ) { - matcher( unmatched, setMatched, context, xml ); - } - - if ( seed ) { - // Reintegrate element matches to eliminate the need for sorting - if ( matchedCount > 0 ) { - while ( i-- ) { - if ( !(unmatched[i] || setMatched[i]) ) { - setMatched[i] = pop.call( results ); - } - } - } - - // Discard index placeholder values to get only actual matches - setMatched = condense( setMatched ); - } - - // Add matches to results - push.apply( results, setMatched ); - - // Seedless set matches succeeding multiple successful matchers stipulate sorting - if ( outermost && !seed && setMatched.length > 0 && - ( matchedCount + setMatchers.length ) > 1 ) { - - Sizzle.uniqueSort( results ); - } - } - - // Override manipulation of globals by nested matchers - if ( outermost ) { - dirruns = dirrunsUnique; - outermostContext = contextBackup; - } - - return unmatched; - }; - - return bySet ? - markFunction( superMatcher ) : - superMatcher; -} - -compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { - var i, - setMatchers = [], - elementMatchers = [], - cached = compilerCache[ selector + " " ]; - - if ( !cached ) { - // Generate a function of recursive functions that can be used to check each element - if ( !match ) { - match = tokenize( selector ); - } - i = match.length; - while ( i-- ) { - cached = matcherFromTokens( match[i] ); - if ( cached[ expando ] ) { - setMatchers.push( cached ); - } else { - elementMatchers.push( cached ); - } - } - - // Cache the compiled function - cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); - - // Save selector and tokenization - cached.selector = selector; - } - return cached; -}; - -/** - * A low-level selection function that works with Sizzle's compiled - * selector functions - * @param {String|Function} selector A selector or a pre-compiled - * selector function built with Sizzle.compile - * @param {Element} context - * @param {Array} [results] - * @param {Array} [seed] A set of elements to match against - */ -select = Sizzle.select = function( selector, context, results, seed ) { - var i, tokens, token, type, find, - compiled = typeof selector === "function" && selector, - match = !seed && tokenize( (selector = compiled.selector || selector) ); - - results = results || []; - - // Try to minimize operations if there is no seed and only one group - if ( match.length === 1 ) { - - // Take a shortcut and set the context if the root selector is an ID - tokens = match[0] = match[0].slice( 0 ); - if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && - support.getById && context.nodeType === 9 && documentIsHTML && - Expr.relative[ tokens[1].type ] ) { - - context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; - if ( !context ) { - return results; - - // Precompiled matchers will still verify ancestry, so step up a level - } else if ( compiled ) { - context = context.parentNode; - } - - selector = selector.slice( tokens.shift().value.length ); - } - - // Fetch a seed set for right-to-left matching - i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; - while ( i-- ) { - token = tokens[i]; - - // Abort if we hit a combinator - if ( Expr.relative[ (type = token.type) ] ) { - break; - } - if ( (find = Expr.find[ type ]) ) { - // Search, expanding context for leading sibling combinators - if ( (seed = find( - token.matches[0].replace( runescape, funescape ), - rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context - )) ) { - - // If seed is empty or no tokens remain, we can return early - tokens.splice( i, 1 ); - selector = seed.length && toSelector( tokens ); - if ( !selector ) { - push.apply( results, seed ); - return results; - } - - break; - } - } - } - } - - // Compile and execute a filtering function if one is not provided - // Provide `match` to avoid retokenization if we modified the selector above - ( compiled || compile( selector, match ) )( - seed, - context, - !documentIsHTML, - results, - rsibling.test( selector ) && testContext( context.parentNode ) || context - ); - return results; -}; - -// One-time assignments - -// Sort stability -support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; - -// Support: Chrome<14 -// Always assume duplicates if they aren't passed to the comparison function -support.detectDuplicates = !!hasDuplicate; - -// Initialize against the default document -setDocument(); - -// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) -// Detached nodes confoundingly follow *each other* -support.sortDetached = assert(function( div1 ) { - // Should return 1, but returns 4 (following) - return div1.compareDocumentPosition( document.createElement("div") ) & 1; -}); - -// Support: IE<8 -// Prevent attribute/property "interpolation" -// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx -if ( !assert(function( div ) { - div.innerHTML = ""; - return div.firstChild.getAttribute("href") === "#" ; -}) ) { - addHandle( "type|href|height|width", function( elem, name, isXML ) { - if ( !isXML ) { - return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); - } - }); -} - -// Support: IE<9 -// Use defaultValue in place of getAttribute("value") -if ( !support.attributes || !assert(function( div ) { - div.innerHTML = ""; - div.firstChild.setAttribute( "value", "" ); - return div.firstChild.getAttribute( "value" ) === ""; -}) ) { - addHandle( "value", function( elem, name, isXML ) { - if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { - return elem.defaultValue; - } - }); -} - -// Support: IE<9 -// Use getAttributeNode to fetch booleans when getAttribute lies -if ( !assert(function( div ) { - return div.getAttribute("disabled") == null; -}) ) { - addHandle( booleans, function( elem, name, isXML ) { - var val; - if ( !isXML ) { - return elem[ name ] === true ? name.toLowerCase() : - (val = elem.getAttributeNode( name )) && val.specified ? - val.value : - null; - } - }); -} - -return Sizzle; - -})( window ); - - - -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; -jQuery.expr[":"] = jQuery.expr.pseudos; -jQuery.unique = Sizzle.uniqueSort; -jQuery.text = Sizzle.getText; -jQuery.isXMLDoc = Sizzle.isXML; -jQuery.contains = Sizzle.contains; - - - -var rneedsContext = jQuery.expr.match.needsContext; - -var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/); - - - -var risSimple = /^.[^:#\[\.,]*$/; - -// Implement the identical functionality for filter and not -function winnow( elements, qualifier, not ) { - if ( jQuery.isFunction( qualifier ) ) { - return jQuery.grep( elements, function( elem, i ) { - /* jshint -W018 */ - return !!qualifier.call( elem, i, elem ) !== not; - }); - - } - - if ( qualifier.nodeType ) { - return jQuery.grep( elements, function( elem ) { - return ( elem === qualifier ) !== not; - }); - - } - - if ( typeof qualifier === "string" ) { - if ( risSimple.test( qualifier ) ) { - return jQuery.filter( qualifier, elements, not ); - } - - qualifier = jQuery.filter( qualifier, elements ); - } - - return jQuery.grep( elements, function( elem ) { - return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not; - }); -} - -jQuery.filter = function( expr, elems, not ) { - var elem = elems[ 0 ]; - - if ( not ) { - expr = ":not(" + expr + ")"; - } - - return elems.length === 1 && elem.nodeType === 1 ? - jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : - jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { - return elem.nodeType === 1; - })); -}; - -jQuery.fn.extend({ - find: function( selector ) { - var i, - ret = [], - self = this, - len = self.length; - - if ( typeof selector !== "string" ) { - return this.pushStack( jQuery( selector ).filter(function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( self[ i ], this ) ) { - return true; - } - } - }) ); - } - - for ( i = 0; i < len; i++ ) { - jQuery.find( selector, self[ i ], ret ); - } - - // Needed because $( selector, context ) becomes $( context ).find( selector ) - ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); - ret.selector = this.selector ? this.selector + " " + selector : selector; - return ret; - }, - filter: function( selector ) { - return this.pushStack( winnow(this, selector || [], false) ); - }, - not: function( selector ) { - return this.pushStack( winnow(this, selector || [], true) ); - }, - is: function( selector ) { - return !!winnow( - this, - - // If this is a positional/relative selector, check membership in the returned set - // so $("p:first").is("p:last") won't return true for a doc with two "p". - typeof selector === "string" && rneedsContext.test( selector ) ? - jQuery( selector ) : - selector || [], - false - ).length; - } -}); - - -// Initialize a jQuery object - - -// A central reference to the root jQuery(document) -var rootjQuery, - - // Use the correct document accordingly with window argument (sandbox) - document = window.document, - - // A simple way to check for HTML strings - // Prioritize #id over to avoid XSS via location.hash (#9521) - // Strict HTML recognition (#11290: must start with <) - rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, - - init = jQuery.fn.init = function( selector, context ) { - var match, elem; - - // HANDLE: $(""), $(null), $(undefined), $(false) - if ( !selector ) { - return this; - } - - // Handle HTML strings - if ( typeof selector === "string" ) { - if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { - // Assume that strings that start and end with <> are HTML and skip the regex check - match = [ null, selector, null ]; - - } else { - match = rquickExpr.exec( selector ); - } - - // Match html or make sure no context is specified for #id - if ( match && (match[1] || !context) ) { - - // HANDLE: $(html) -> $(array) - if ( match[1] ) { - context = context instanceof jQuery ? context[0] : context; - - // scripts is true for back-compat - // Intentionally let the error be thrown if parseHTML is not present - jQuery.merge( this, jQuery.parseHTML( - match[1], - context && context.nodeType ? context.ownerDocument || context : document, - true - ) ); - - // HANDLE: $(html, props) - if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { - for ( match in context ) { - // Properties of context are called as methods if possible - if ( jQuery.isFunction( this[ match ] ) ) { - this[ match ]( context[ match ] ); - - // ...and otherwise set as attributes - } else { - this.attr( match, context[ match ] ); - } - } - } - - return this; - - // HANDLE: $(#id) - } else { - elem = document.getElementById( match[2] ); - - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE and Opera return items - // by name instead of ID - if ( elem.id !== match[2] ) { - return rootjQuery.find( selector ); - } - - // Otherwise, we inject the element directly into the jQuery object - this.length = 1; - this[0] = elem; - } - - this.context = document; - this.selector = selector; - return this; - } - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return ( context || rootjQuery ).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return this.constructor( context ).find( selector ); - } - - // HANDLE: $(DOMElement) - } else if ( selector.nodeType ) { - this.context = this[0] = selector; - this.length = 1; - return this; - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( jQuery.isFunction( selector ) ) { - return typeof rootjQuery.ready !== "undefined" ? - rootjQuery.ready( selector ) : - // Execute immediately if ready is not present - selector( jQuery ); - } - - if ( selector.selector !== undefined ) { - this.selector = selector.selector; - this.context = selector.context; - } - - return jQuery.makeArray( selector, this ); - }; - -// Give the init function the jQuery prototype for later instantiation -init.prototype = jQuery.fn; - -// Initialize central reference -rootjQuery = jQuery( document ); - - -var rparentsprev = /^(?:parents|prev(?:Until|All))/, - // methods guaranteed to produce a unique set when starting from a unique set - guaranteedUnique = { - children: true, - contents: true, - next: true, - prev: true - }; - -jQuery.extend({ - dir: function( elem, dir, until ) { - var matched = [], - cur = elem[ dir ]; - - while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { - if ( cur.nodeType === 1 ) { - matched.push( cur ); - } - cur = cur[dir]; - } - return matched; - }, - - sibling: function( n, elem ) { - var r = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - r.push( n ); - } - } - - return r; - } -}); - -jQuery.fn.extend({ - has: function( target ) { - var i, - targets = jQuery( target, this ), - len = targets.length; - - return this.filter(function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( this, targets[i] ) ) { - return true; - } - } - }); - }, - - closest: function( selectors, context ) { - var cur, - i = 0, - l = this.length, - matched = [], - pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? - jQuery( selectors, context || this.context ) : - 0; - - for ( ; i < l; i++ ) { - for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { - // Always skip document fragments - if ( cur.nodeType < 11 && (pos ? - pos.index(cur) > -1 : - - // Don't pass non-elements to Sizzle - cur.nodeType === 1 && - jQuery.find.matchesSelector(cur, selectors)) ) { - - matched.push( cur ); - break; - } - } - } - - return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched ); - }, - - // Determine the position of an element within - // the matched set of elements - index: function( elem ) { - - // No argument, return index in parent - if ( !elem ) { - return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; - } - - // index in selector - if ( typeof elem === "string" ) { - return jQuery.inArray( this[0], jQuery( elem ) ); - } - - // Locate the position of the desired element - return jQuery.inArray( - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[0] : elem, this ); - }, - - add: function( selector, context ) { - return this.pushStack( - jQuery.unique( - jQuery.merge( this.get(), jQuery( selector, context ) ) - ) - ); - }, - - addBack: function( selector ) { - return this.add( selector == null ? - this.prevObject : this.prevObject.filter(selector) - ); - } -}); - -function sibling( cur, dir ) { - do { - cur = cur[ dir ]; - } while ( cur && cur.nodeType !== 1 ); - - return cur; -} - -jQuery.each({ - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return jQuery.dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, i, until ) { - return jQuery.dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return sibling( elem, "nextSibling" ); - }, - prev: function( elem ) { - return sibling( elem, "previousSibling" ); - }, - nextAll: function( elem ) { - return jQuery.dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return jQuery.dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, i, until ) { - return jQuery.dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, i, until ) { - return jQuery.dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); - }, - children: function( elem ) { - return jQuery.sibling( elem.firstChild ); - }, - contents: function( elem ) { - return jQuery.nodeName( elem, "iframe" ) ? - elem.contentDocument || elem.contentWindow.document : - jQuery.merge( [], elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var ret = jQuery.map( this, fn, until ); - - if ( name.slice( -5 ) !== "Until" ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - ret = jQuery.filter( selector, ret ); - } - - if ( this.length > 1 ) { - // Remove duplicates - if ( !guaranteedUnique[ name ] ) { - ret = jQuery.unique( ret ); - } - - // Reverse order for parents* and prev-derivatives - if ( rparentsprev.test( name ) ) { - ret = ret.reverse(); - } - } - - return this.pushStack( ret ); - }; -}); -var rnotwhite = (/\S+/g); - - - -// String to Object options format cache -var optionsCache = {}; - -// Convert String-formatted options into Object-formatted ones and store in cache -function createOptions( options ) { - var object = optionsCache[ options ] = {}; - jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { - object[ flag ] = true; - }); - return object; -} - -/* - * Create a callback list using the following parameters: - * - * options: an optional list of space-separated options that will change how - * the callback list behaves or a more traditional option object - * - * By default a callback list will act like an event callback list and can be - * "fired" multiple times. - * - * Possible options: - * - * once: will ensure the callback list can only be fired once (like a Deferred) - * - * memory: will keep track of previous values and will call any callback added - * after the list has been fired right away with the latest "memorized" - * values (like a Deferred) - * - * unique: will ensure a callback can only be added once (no duplicate in the list) - * - * stopOnFalse: interrupt callings when a callback returns false - * - */ -jQuery.Callbacks = function( options ) { - - // Convert options from String-formatted to Object-formatted if needed - // (we check in cache first) - options = typeof options === "string" ? - ( optionsCache[ options ] || createOptions( options ) ) : - jQuery.extend( {}, options ); - - var // Flag to know if list is currently firing - firing, - // Last fire value (for non-forgettable lists) - memory, - // Flag to know if list was already fired - fired, - // End of the loop when firing - firingLength, - // Index of currently firing callback (modified by remove if needed) - firingIndex, - // First callback to fire (used internally by add and fireWith) - firingStart, - // Actual callback list - list = [], - // Stack of fire calls for repeatable lists - stack = !options.once && [], - // Fire callbacks - fire = function( data ) { - memory = options.memory && data; - fired = true; - firingIndex = firingStart || 0; - firingStart = 0; - firingLength = list.length; - firing = true; - for ( ; list && firingIndex < firingLength; firingIndex++ ) { - if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { - memory = false; // To prevent further calls using add - break; - } - } - firing = false; - if ( list ) { - if ( stack ) { - if ( stack.length ) { - fire( stack.shift() ); - } - } else if ( memory ) { - list = []; - } else { - self.disable(); - } - } - }, - // Actual Callbacks object - self = { - // Add a callback or a collection of callbacks to the list - add: function() { - if ( list ) { - // First, we save the current length - var start = list.length; - (function add( args ) { - jQuery.each( args, function( _, arg ) { - var type = jQuery.type( arg ); - if ( type === "function" ) { - if ( !options.unique || !self.has( arg ) ) { - list.push( arg ); - } - } else if ( arg && arg.length && type !== "string" ) { - // Inspect recursively - add( arg ); - } - }); - })( arguments ); - // Do we need to add the callbacks to the - // current firing batch? - if ( firing ) { - firingLength = list.length; - // With memory, if we're not firing then - // we should call right away - } else if ( memory ) { - firingStart = start; - fire( memory ); - } - } - return this; - }, - // Remove a callback from the list - remove: function() { - if ( list ) { - jQuery.each( arguments, function( _, arg ) { - var index; - while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { - list.splice( index, 1 ); - // Handle firing indexes - if ( firing ) { - if ( index <= firingLength ) { - firingLength--; - } - if ( index <= firingIndex ) { - firingIndex--; - } - } - } - }); - } - return this; - }, - // Check if a given callback is in the list. - // If no argument is given, return whether or not list has callbacks attached. - has: function( fn ) { - return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); - }, - // Remove all callbacks from the list - empty: function() { - list = []; - firingLength = 0; - return this; - }, - // Have the list do nothing anymore - disable: function() { - list = stack = memory = undefined; - return this; - }, - // Is it disabled? - disabled: function() { - return !list; - }, - // Lock the list in its current state - lock: function() { - stack = undefined; - if ( !memory ) { - self.disable(); - } - return this; - }, - // Is it locked? - locked: function() { - return !stack; - }, - // Call all callbacks with the given context and arguments - fireWith: function( context, args ) { - if ( list && ( !fired || stack ) ) { - args = args || []; - args = [ context, args.slice ? args.slice() : args ]; - if ( firing ) { - stack.push( args ); - } else { - fire( args ); - } - } - return this; - }, - // Call all the callbacks with the given arguments - fire: function() { - self.fireWith( this, arguments ); - return this; - }, - // To know if the callbacks have already been called at least once - fired: function() { - return !!fired; - } - }; - - return self; -}; - - -jQuery.extend({ - - Deferred: function( func ) { - var tuples = [ - // action, add listener, listener list, final state - [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], - [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], - [ "notify", "progress", jQuery.Callbacks("memory") ] - ], - state = "pending", - promise = { - state: function() { - return state; - }, - always: function() { - deferred.done( arguments ).fail( arguments ); - return this; - }, - then: function( /* fnDone, fnFail, fnProgress */ ) { - var fns = arguments; - return jQuery.Deferred(function( newDefer ) { - jQuery.each( tuples, function( i, tuple ) { - var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; - // deferred[ done | fail | progress ] for forwarding actions to newDefer - deferred[ tuple[1] ](function() { - var returned = fn && fn.apply( this, arguments ); - if ( returned && jQuery.isFunction( returned.promise ) ) { - returned.promise() - .done( newDefer.resolve ) - .fail( newDefer.reject ) - .progress( newDefer.notify ); - } else { - newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); - } - }); - }); - fns = null; - }).promise(); - }, - // Get a promise for this deferred - // If obj is provided, the promise aspect is added to the object - promise: function( obj ) { - return obj != null ? jQuery.extend( obj, promise ) : promise; - } - }, - deferred = {}; - - // Keep pipe for back-compat - promise.pipe = promise.then; - - // Add list-specific methods - jQuery.each( tuples, function( i, tuple ) { - var list = tuple[ 2 ], - stateString = tuple[ 3 ]; - - // promise[ done | fail | progress ] = list.add - promise[ tuple[1] ] = list.add; - - // Handle state - if ( stateString ) { - list.add(function() { - // state = [ resolved | rejected ] - state = stateString; - - // [ reject_list | resolve_list ].disable; progress_list.lock - }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); - } - - // deferred[ resolve | reject | notify ] - deferred[ tuple[0] ] = function() { - deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); - return this; - }; - deferred[ tuple[0] + "With" ] = list.fireWith; - }); - - // Make the deferred a promise - promise.promise( deferred ); - - // Call given func if any - if ( func ) { - func.call( deferred, deferred ); - } - - // All done! - return deferred; - }, - - // Deferred helper - when: function( subordinate /* , ..., subordinateN */ ) { - var i = 0, - resolveValues = slice.call( arguments ), - length = resolveValues.length, - - // the count of uncompleted subordinates - remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, - - // the master Deferred. If resolveValues consist of only a single Deferred, just use that. - deferred = remaining === 1 ? subordinate : jQuery.Deferred(), - - // Update function for both resolve and progress values - updateFunc = function( i, contexts, values ) { - return function( value ) { - contexts[ i ] = this; - values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; - if ( values === progressValues ) { - deferred.notifyWith( contexts, values ); - - } else if ( !(--remaining) ) { - deferred.resolveWith( contexts, values ); - } - }; - }, - - progressValues, progressContexts, resolveContexts; - - // add listeners to Deferred subordinates; treat others as resolved - if ( length > 1 ) { - progressValues = new Array( length ); - progressContexts = new Array( length ); - resolveContexts = new Array( length ); - for ( ; i < length; i++ ) { - if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { - resolveValues[ i ].promise() - .done( updateFunc( i, resolveContexts, resolveValues ) ) - .fail( deferred.reject ) - .progress( updateFunc( i, progressContexts, progressValues ) ); - } else { - --remaining; - } - } - } - - // if we're not waiting on anything, resolve the master - if ( !remaining ) { - deferred.resolveWith( resolveContexts, resolveValues ); - } - - return deferred.promise(); - } -}); - - -// The deferred used on DOM ready -var readyList; - -jQuery.fn.ready = function( fn ) { - // Add the callback - jQuery.ready.promise().done( fn ); - - return this; -}; - -jQuery.extend({ - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // A counter to track how many items to wait for before - // the ready event fires. See #6781 - readyWait: 1, - - // Hold (or release) the ready event - holdReady: function( hold ) { - if ( hold ) { - jQuery.readyWait++; - } else { - jQuery.ready( true ); - } - }, - - // Handle when the DOM is ready - ready: function( wait ) { - - // Abort if there are pending holds or we're already ready - if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { - return; - } - - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( !document.body ) { - return setTimeout( jQuery.ready ); - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.resolveWith( document, [ jQuery ] ); - - // Trigger any bound ready events - if ( jQuery.fn.triggerHandler ) { - jQuery( document ).triggerHandler( "ready" ); - jQuery( document ).off( "ready" ); - } - } -}); - -/** - * Clean-up method for dom ready events - */ -function detach() { - if ( document.addEventListener ) { - document.removeEventListener( "DOMContentLoaded", completed, false ); - window.removeEventListener( "load", completed, false ); - - } else { - document.detachEvent( "onreadystatechange", completed ); - window.detachEvent( "onload", completed ); - } -} - -/** - * The ready event handler and self cleanup method - */ -function completed() { - // readyState === "complete" is good enough for us to call the dom ready in oldIE - if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { - detach(); - jQuery.ready(); - } -} - -jQuery.ready.promise = function( obj ) { - if ( !readyList ) { - - readyList = jQuery.Deferred(); - - // Catch cases where $(document).ready() is called after the browser event has already occurred. - // we once tried to use readyState "interactive" here, but it caused issues like the one - // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 - if ( document.readyState === "complete" ) { - // Handle it asynchronously to allow scripts the opportunity to delay ready - setTimeout( jQuery.ready ); - - // Standards-based browsers support DOMContentLoaded - } else if ( document.addEventListener ) { - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", completed, false ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", completed, false ); - - // If IE event model is used - } else { - // Ensure firing before onload, maybe late but safe also for iframes - document.attachEvent( "onreadystatechange", completed ); - - // A fallback to window.onload, that will always work - window.attachEvent( "onload", completed ); - - // If IE and not a frame - // continually check to see if the document is ready - var top = false; - - try { - top = window.frameElement == null && document.documentElement; - } catch(e) {} - - if ( top && top.doScroll ) { - (function doScrollCheck() { - if ( !jQuery.isReady ) { - - try { - // Use the trick by Diego Perini - // http://javascript.nwbox.com/IEContentLoaded/ - top.doScroll("left"); - } catch(e) { - return setTimeout( doScrollCheck, 50 ); - } - - // detach all dom ready events - detach(); - - // and execute any waiting functions - jQuery.ready(); - } - })(); - } - } - } - return readyList.promise( obj ); -}; - - -var strundefined = typeof undefined; - - - -// Support: IE<9 -// Iteration over object's inherited properties before its own -var i; -for ( i in jQuery( support ) ) { - break; -} -support.ownLast = i !== "0"; - -// Note: most support tests are defined in their respective modules. -// false until the test is run -support.inlineBlockNeedsLayout = false; - -// Execute ASAP in case we need to set body.style.zoom -jQuery(function() { - // Minified: var a,b,c,d - var val, div, body, container; - - body = document.getElementsByTagName( "body" )[ 0 ]; - if ( !body || !body.style ) { - // Return for frameset docs that don't have a body - return; - } - - // Setup - div = document.createElement( "div" ); - container = document.createElement( "div" ); - container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; - body.appendChild( container ).appendChild( div ); - - if ( typeof div.style.zoom !== strundefined ) { - // Support: IE<8 - // Check if natively block-level elements act like inline-block - // elements when setting their display to 'inline' and giving - // them layout - div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1"; - - support.inlineBlockNeedsLayout = val = div.offsetWidth === 3; - if ( val ) { - // Prevent IE 6 from affecting layout for positioned elements #11048 - // Prevent IE from shrinking the body in IE 7 mode #12869 - // Support: IE<8 - body.style.zoom = 1; - } - } - - body.removeChild( container ); -}); - - - - -(function() { - var div = document.createElement( "div" ); - - // Execute the test only if not already executed in another module. - if (support.deleteExpando == null) { - // Support: IE<9 - support.deleteExpando = true; - try { - delete div.test; - } catch( e ) { - support.deleteExpando = false; - } - } - - // Null elements to avoid leaks in IE. - div = null; -})(); - - -/** - * Determines whether an object can have data - */ -jQuery.acceptData = function( elem ) { - var noData = jQuery.noData[ (elem.nodeName + " ").toLowerCase() ], - nodeType = +elem.nodeType || 1; - - // Do not set data on non-element DOM nodes because it will not be cleared (#8335). - return nodeType !== 1 && nodeType !== 9 ? - false : - - // Nodes accept data unless otherwise specified; rejection can be conditional - !noData || noData !== true && elem.getAttribute("classid") === noData; -}; - - -var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, - rmultiDash = /([A-Z])/g; - -function dataAttr( elem, key, data ) { - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - - var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); - - data = elem.getAttribute( name ); - - if ( typeof data === "string" ) { - try { - data = data === "true" ? true : - data === "false" ? false : - data === "null" ? null : - // Only convert to a number if it doesn't change the string - +data + "" === data ? +data : - rbrace.test( data ) ? jQuery.parseJSON( data ) : - data; - } catch( e ) {} - - // Make sure we set the data so it isn't changed later - jQuery.data( elem, key, data ); - - } else { - data = undefined; - } - } - - return data; -} - -// checks a cache object for emptiness -function isEmptyDataObject( obj ) { - var name; - for ( name in obj ) { - - // if the public data object is empty, the private is still empty - if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { - continue; - } - if ( name !== "toJSON" ) { - return false; - } - } - - return true; -} - -function internalData( elem, name, data, pvt /* Internal Use Only */ ) { - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var ret, thisCache, - internalKey = jQuery.expando, - - // We have to handle DOM nodes and JS objects differently because IE6-7 - // can't GC object references properly across the DOM-JS boundary - isNode = elem.nodeType, - - // Only DOM nodes need the global jQuery cache; JS object data is - // attached directly to the object so GC can occur automatically - cache = isNode ? jQuery.cache : elem, - - // Only defining an ID for JS objects if its cache already exists allows - // the code to shortcut on the same path as a DOM node with no cache - id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; - - // Avoid doing any more work than we need to when trying to get data on an - // object that has no data at all - if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) { - return; - } - - if ( !id ) { - // Only DOM nodes need a new unique ID for each element since their data - // ends up in the global cache - if ( isNode ) { - id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++; - } else { - id = internalKey; - } - } - - if ( !cache[ id ] ) { - // Avoid exposing jQuery metadata on plain JS objects when the object - // is serialized using JSON.stringify - cache[ id ] = isNode ? {} : { toJSON: jQuery.noop }; - } - - // An object can be passed to jQuery.data instead of a key/value pair; this gets - // shallow copied over onto the existing cache - if ( typeof name === "object" || typeof name === "function" ) { - if ( pvt ) { - cache[ id ] = jQuery.extend( cache[ id ], name ); - } else { - cache[ id ].data = jQuery.extend( cache[ id ].data, name ); - } - } - - thisCache = cache[ id ]; - - // jQuery data() is stored in a separate object inside the object's internal data - // cache in order to avoid key collisions between internal data and user-defined - // data. - if ( !pvt ) { - if ( !thisCache.data ) { - thisCache.data = {}; - } - - thisCache = thisCache.data; - } - - if ( data !== undefined ) { - thisCache[ jQuery.camelCase( name ) ] = data; - } - - // Check for both converted-to-camel and non-converted data property names - // If a data property was specified - if ( typeof name === "string" ) { - - // First Try to find as-is property data - ret = thisCache[ name ]; - - // Test for null|undefined property data - if ( ret == null ) { - - // Try to find the camelCased property - ret = thisCache[ jQuery.camelCase( name ) ]; - } - } else { - ret = thisCache; - } - - return ret; -} - -function internalRemoveData( elem, name, pvt ) { - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var thisCache, i, - isNode = elem.nodeType, - - // See jQuery.data for more information - cache = isNode ? jQuery.cache : elem, - id = isNode ? elem[ jQuery.expando ] : jQuery.expando; - - // If there is already no cache entry for this object, there is no - // purpose in continuing - if ( !cache[ id ] ) { - return; - } - - if ( name ) { - - thisCache = pvt ? cache[ id ] : cache[ id ].data; - - if ( thisCache ) { - - // Support array or space separated string names for data keys - if ( !jQuery.isArray( name ) ) { - - // try the string as a key before any manipulation - if ( name in thisCache ) { - name = [ name ]; - } else { - - // split the camel cased version by spaces unless a key with the spaces exists - name = jQuery.camelCase( name ); - if ( name in thisCache ) { - name = [ name ]; - } else { - name = name.split(" "); - } - } - } else { - // If "name" is an array of keys... - // When data is initially created, via ("key", "val") signature, - // keys will be converted to camelCase. - // Since there is no way to tell _how_ a key was added, remove - // both plain key and camelCase key. #12786 - // This will only penalize the array argument path. - name = name.concat( jQuery.map( name, jQuery.camelCase ) ); - } - - i = name.length; - while ( i-- ) { - delete thisCache[ name[i] ]; - } - - // If there is no data left in the cache, we want to continue - // and let the cache object itself get destroyed - if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) { - return; - } - } - } - - // See jQuery.data for more information - if ( !pvt ) { - delete cache[ id ].data; - - // Don't destroy the parent cache unless the internal data object - // had been the only thing left in it - if ( !isEmptyDataObject( cache[ id ] ) ) { - return; - } - } - - // Destroy the cache - if ( isNode ) { - jQuery.cleanData( [ elem ], true ); - - // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) - /* jshint eqeqeq: false */ - } else if ( support.deleteExpando || cache != cache.window ) { - /* jshint eqeqeq: true */ - delete cache[ id ]; - - // When all else fails, null - } else { - cache[ id ] = null; - } -} - -jQuery.extend({ - cache: {}, - - // The following elements (space-suffixed to avoid Object.prototype collisions) - // throw uncatchable exceptions if you attempt to set expando properties - noData: { - "applet ": true, - "embed ": true, - // ...but Flash objects (which have this classid) *can* handle expandos - "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" - }, - - hasData: function( elem ) { - elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; - return !!elem && !isEmptyDataObject( elem ); - }, - - data: function( elem, name, data ) { - return internalData( elem, name, data ); - }, - - removeData: function( elem, name ) { - return internalRemoveData( elem, name ); - }, - - // For internal use only. - _data: function( elem, name, data ) { - return internalData( elem, name, data, true ); - }, - - _removeData: function( elem, name ) { - return internalRemoveData( elem, name, true ); - } -}); - -jQuery.fn.extend({ - data: function( key, value ) { - var i, name, data, - elem = this[0], - attrs = elem && elem.attributes; - - // Special expections of .data basically thwart jQuery.access, - // so implement the relevant behavior ourselves - - // Gets all values - if ( key === undefined ) { - if ( this.length ) { - data = jQuery.data( elem ); - - if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { - i = attrs.length; - while ( i-- ) { - - // Support: IE11+ - // The attrs elements can be null (#14894) - if ( attrs[ i ] ) { - name = attrs[ i ].name; - if ( name.indexOf( "data-" ) === 0 ) { - name = jQuery.camelCase( name.slice(5) ); - dataAttr( elem, name, data[ name ] ); - } - } - } - jQuery._data( elem, "parsedAttrs", true ); - } - } - - return data; - } - - // Sets multiple values - if ( typeof key === "object" ) { - return this.each(function() { - jQuery.data( this, key ); - }); - } - - return arguments.length > 1 ? - - // Sets one value - this.each(function() { - jQuery.data( this, key, value ); - }) : - - // Gets one value - // Try to fetch any internally stored data first - elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined; - }, - - removeData: function( key ) { - return this.each(function() { - jQuery.removeData( this, key ); - }); - } -}); - - -jQuery.extend({ - queue: function( elem, type, data ) { - var queue; - - if ( elem ) { - type = ( type || "fx" ) + "queue"; - queue = jQuery._data( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !queue || jQuery.isArray(data) ) { - queue = jQuery._data( elem, type, jQuery.makeArray(data) ); - } else { - queue.push( data ); - } - } - return queue || []; - } - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - startLength = queue.length, - fn = queue.shift(), - hooks = jQuery._queueHooks( elem, type ), - next = function() { - jQuery.dequeue( elem, type ); - }; - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - startLength--; - } - - if ( fn ) { - - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift( "inprogress" ); - } - - // clear up the last queue stop function - delete hooks.stop; - fn.call( elem, next, hooks ); - } - - if ( !startLength && hooks ) { - hooks.empty.fire(); - } - }, - - // not intended for public consumption - generates a queueHooks object, or returns the current one - _queueHooks: function( elem, type ) { - var key = type + "queueHooks"; - return jQuery._data( elem, key ) || jQuery._data( elem, key, { - empty: jQuery.Callbacks("once memory").add(function() { - jQuery._removeData( elem, type + "queue" ); - jQuery._removeData( elem, key ); - }) - }); - } -}); - -jQuery.fn.extend({ - queue: function( type, data ) { - var setter = 2; - - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - setter--; - } - - if ( arguments.length < setter ) { - return jQuery.queue( this[0], type ); - } - - return data === undefined ? - this : - this.each(function() { - var queue = jQuery.queue( this, type, data ); - - // ensure a hooks for this queue - jQuery._queueHooks( this, type ); - - if ( type === "fx" && queue[0] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - }); - }, - dequeue: function( type ) { - return this.each(function() { - jQuery.dequeue( this, type ); - }); - }, - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - }, - // Get a promise resolved when queues of a certain type - // are emptied (fx is the type by default) - promise: function( type, obj ) { - var tmp, - count = 1, - defer = jQuery.Deferred(), - elements = this, - i = this.length, - resolve = function() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - }; - - if ( typeof type !== "string" ) { - obj = type; - type = undefined; - } - type = type || "fx"; - - while ( i-- ) { - tmp = jQuery._data( elements[ i ], type + "queueHooks" ); - if ( tmp && tmp.empty ) { - count++; - tmp.empty.add( resolve ); - } - } - resolve(); - return defer.promise( obj ); - } -}); -var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source; - -var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; - -var isHidden = function( elem, el ) { - // isHidden might be called from jQuery#filter function; - // in that case, element will be second argument - elem = el || elem; - return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); - }; - - - -// Multifunctional method to get and set values of a collection -// The value/s can optionally be executed if it's a function -var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) { - var i = 0, - length = elems.length, - bulk = key == null; - - // Sets many values - if ( jQuery.type( key ) === "object" ) { - chainable = true; - for ( i in key ) { - jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); - } - - // Sets one value - } else if ( value !== undefined ) { - chainable = true; - - if ( !jQuery.isFunction( value ) ) { - raw = true; - } - - if ( bulk ) { - // Bulk operations run against the entire set - if ( raw ) { - fn.call( elems, value ); - fn = null; - - // ...except when executing function values - } else { - bulk = fn; - fn = function( elem, key, value ) { - return bulk.call( jQuery( elem ), value ); - }; - } - } - - if ( fn ) { - for ( ; i < length; i++ ) { - fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); - } - } - } - - return chainable ? - elems : - - // Gets - bulk ? - fn.call( elems ) : - length ? fn( elems[0], key ) : emptyGet; -}; -var rcheckableType = (/^(?:checkbox|radio)$/i); - - - -(function() { - // Minified: var a,b,c - var input = document.createElement( "input" ), - div = document.createElement( "div" ), - fragment = document.createDocumentFragment(); - - // Setup - div.innerHTML = "
      a"; - - // IE strips leading whitespace when .innerHTML is used - support.leadingWhitespace = div.firstChild.nodeType === 3; - - // Make sure that tbody elements aren't automatically inserted - // IE will insert them into empty tables - support.tbody = !div.getElementsByTagName( "tbody" ).length; - - // Make sure that link elements get serialized correctly by innerHTML - // This requires a wrapper element in IE - support.htmlSerialize = !!div.getElementsByTagName( "link" ).length; - - // Makes sure cloning an html5 element does not cause problems - // Where outerHTML is undefined, this still works - support.html5Clone = - document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav>"; - - // Check if a disconnected checkbox will retain its checked - // value of true after appended to the DOM (IE6/7) - input.type = "checkbox"; - input.checked = true; - fragment.appendChild( input ); - support.appendChecked = input.checked; - - // Make sure textarea (and checkbox) defaultValue is properly cloned - // Support: IE6-IE11+ - div.innerHTML = ""; - support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; - - // #11217 - WebKit loses check when the name is after the checked attribute - fragment.appendChild( div ); - div.innerHTML = ""; - - // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3 - // old WebKit doesn't clone checked state correctly in fragments - support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; - - // Support: IE<9 - // Opera does not clone events (and typeof div.attachEvent === undefined). - // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() - support.noCloneEvent = true; - if ( div.attachEvent ) { - div.attachEvent( "onclick", function() { - support.noCloneEvent = false; - }); - - div.cloneNode( true ).click(); - } - - // Execute the test only if not already executed in another module. - if (support.deleteExpando == null) { - // Support: IE<9 - support.deleteExpando = true; - try { - delete div.test; - } catch( e ) { - support.deleteExpando = false; - } - } -})(); - - -(function() { - var i, eventName, - div = document.createElement( "div" ); - - // Support: IE<9 (lack submit/change bubble), Firefox 23+ (lack focusin event) - for ( i in { submit: true, change: true, focusin: true }) { - eventName = "on" + i; - - if ( !(support[ i + "Bubbles" ] = eventName in window) ) { - // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) - div.setAttribute( eventName, "t" ); - support[ i + "Bubbles" ] = div.attributes[ eventName ].expando === false; - } - } - - // Null elements to avoid leaks in IE. - div = null; -})(); - - -var rformElems = /^(?:input|select|textarea)$/i, - rkeyEvent = /^key/, - rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/, - rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, - rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; - -function returnTrue() { - return true; -} - -function returnFalse() { - return false; -} - -function safeActiveElement() { - try { - return document.activeElement; - } catch ( err ) { } -} - -/* - * Helper functions for managing events -- not part of the public interface. - * Props to Dean Edwards' addEvent library for many of the ideas. - */ -jQuery.event = { - - global: {}, - - add: function( elem, types, handler, data, selector ) { - var tmp, events, t, handleObjIn, - special, eventHandle, handleObj, - handlers, type, namespaces, origType, - elemData = jQuery._data( elem ); - - // Don't attach events to noData or text/comment nodes (but allow plain objects) - if ( !elemData ) { - return; - } - - // Caller can pass in an object of custom data in lieu of the handler - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - selector = handleObjIn.selector; - } - - // Make sure that the handler has a unique ID, used to find/remove it later - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure and main handler, if this is the first - if ( !(events = elemData.events) ) { - events = elemData.events = {}; - } - if ( !(eventHandle = elemData.handle) ) { - eventHandle = elemData.handle = function( e ) { - // Discard the second event of a jQuery.event.trigger() and - // when an event is called after a page has unloaded - return typeof jQuery !== strundefined && (!e || jQuery.event.triggered !== e.type) ? - jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : - undefined; - }; - // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events - eventHandle.elem = elem; - } - - // Handle multiple events separated by a space - types = ( types || "" ).match( rnotwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[t] ) || []; - type = origType = tmp[1]; - namespaces = ( tmp[2] || "" ).split( "." ).sort(); - - // There *must* be a type, no attaching namespace-only handlers - if ( !type ) { - continue; - } - - // If event changes its type, use the special event handlers for the changed type - special = jQuery.event.special[ type ] || {}; - - // If selector defined, determine special event api type, otherwise given type - type = ( selector ? special.delegateType : special.bindType ) || type; - - // Update special based on newly reset type - special = jQuery.event.special[ type ] || {}; - - // handleObj is passed to all event handlers - handleObj = jQuery.extend({ - type: type, - origType: origType, - data: data, - handler: handler, - guid: handler.guid, - selector: selector, - needsContext: selector && jQuery.expr.match.needsContext.test( selector ), - namespace: namespaces.join(".") - }, handleObjIn ); - - // Init the event handler queue if we're the first - if ( !(handlers = events[ type ]) ) { - handlers = events[ type ] = []; - handlers.delegateCount = 0; - - // Only use addEventListener/attachEvent if the special events handler returns false - if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - // Bind the global event handler to the element - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle, false ); - - } else if ( elem.attachEvent ) { - elem.attachEvent( "on" + type, eventHandle ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add to the element's handler list, delegates in front - if ( selector ) { - handlers.splice( handlers.delegateCount++, 0, handleObj ); - } else { - handlers.push( handleObj ); - } - - // Keep track of which events have ever been used, for event optimization - jQuery.event.global[ type ] = true; - } - - // Nullify elem to prevent memory leaks in IE - elem = null; - }, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, selector, mappedTypes ) { - var j, handleObj, tmp, - origCount, t, events, - special, handlers, type, - namespaces, origType, - elemData = jQuery.hasData( elem ) && jQuery._data( elem ); - - if ( !elemData || !(events = elemData.events) ) { - return; - } - - // Once for each type.namespace in types; type may be omitted - types = ( types || "" ).match( rnotwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[t] ) || []; - type = origType = tmp[1]; - namespaces = ( tmp[2] || "" ).split( "." ).sort(); - - // Unbind all events (on this namespace, if provided) for the element - if ( !type ) { - for ( type in events ) { - jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); - } - continue; - } - - special = jQuery.event.special[ type ] || {}; - type = ( selector ? special.delegateType : special.bindType ) || type; - handlers = events[ type ] || []; - tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); - - // Remove matching events - origCount = j = handlers.length; - while ( j-- ) { - handleObj = handlers[ j ]; - - if ( ( mappedTypes || origType === handleObj.origType ) && - ( !handler || handler.guid === handleObj.guid ) && - ( !tmp || tmp.test( handleObj.namespace ) ) && - ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { - handlers.splice( j, 1 ); - - if ( handleObj.selector ) { - handlers.delegateCount--; - } - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - } - - // Remove generic event handler if we removed something and no more handlers exist - // (avoids potential for endless recursion during removal of special event handlers) - if ( origCount && !handlers.length ) { - if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { - jQuery.removeEvent( elem, type, elemData.handle ); - } - - delete events[ type ]; - } - } - - // Remove the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - delete elemData.handle; - - // removeData also checks for emptiness and clears the expando if empty - // so use it instead of delete - jQuery._removeData( elem, "events" ); - } - }, - - trigger: function( event, data, elem, onlyHandlers ) { - var handle, ontype, cur, - bubbleType, special, tmp, i, - eventPath = [ elem || document ], - type = hasOwn.call( event, "type" ) ? event.type : event, - namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; - - cur = tmp = elem = elem || document; - - // Don't do events on text and comment nodes - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - // focus/blur morphs to focusin/out; ensure we're not firing them right now - if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { - return; - } - - if ( type.indexOf(".") >= 0 ) { - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split("."); - type = namespaces.shift(); - namespaces.sort(); - } - ontype = type.indexOf(":") < 0 && "on" + type; - - // Caller can pass in a jQuery.Event object, Object, or just an event type string - event = event[ jQuery.expando ] ? - event : - new jQuery.Event( type, typeof event === "object" && event ); - - // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) - event.isTrigger = onlyHandlers ? 2 : 3; - event.namespace = namespaces.join("."); - event.namespace_re = event.namespace ? - new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : - null; - - // Clean up the event in case it is being reused - event.result = undefined; - if ( !event.target ) { - event.target = elem; - } - - // Clone any incoming data and prepend the event, creating the handler arg list - data = data == null ? - [ event ] : - jQuery.makeArray( data, [ event ] ); - - // Allow special events to draw outside the lines - special = jQuery.event.special[ type ] || {}; - if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { - return; - } - - // Determine event propagation path in advance, per W3C events spec (#9951) - // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) - if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { - - bubbleType = special.delegateType || type; - if ( !rfocusMorph.test( bubbleType + type ) ) { - cur = cur.parentNode; - } - for ( ; cur; cur = cur.parentNode ) { - eventPath.push( cur ); - tmp = cur; - } - - // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( tmp === (elem.ownerDocument || document) ) { - eventPath.push( tmp.defaultView || tmp.parentWindow || window ); - } - } - - // Fire handlers on the event path - i = 0; - while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { - - event.type = i > 1 ? - bubbleType : - special.bindType || type; - - // jQuery handler - handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); - if ( handle ) { - handle.apply( cur, data ); - } - - // Native handler - handle = ontype && cur[ ontype ]; - if ( handle && handle.apply && jQuery.acceptData( cur ) ) { - event.result = handle.apply( cur, data ); - if ( event.result === false ) { - event.preventDefault(); - } - } - } - event.type = type; - - // If nobody prevented the default action, do it now - if ( !onlyHandlers && !event.isDefaultPrevented() ) { - - if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && - jQuery.acceptData( elem ) ) { - - // Call a native DOM method on the target with the same name name as the event. - // Can't use an .isFunction() check here because IE6/7 fails that test. - // Don't do default actions on window, that's where global variables be (#6170) - if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { - - // Don't re-trigger an onFOO event when we call its FOO() method - tmp = elem[ ontype ]; - - if ( tmp ) { - elem[ ontype ] = null; - } - - // Prevent re-triggering of the same event, since we already bubbled it above - jQuery.event.triggered = type; - try { - elem[ type ](); - } catch ( e ) { - // IE<9 dies on focus/blur to hidden element (#1486,#12518) - // only reproducible on winXP IE8 native, not IE9 in IE8 mode - } - jQuery.event.triggered = undefined; - - if ( tmp ) { - elem[ ontype ] = tmp; - } - } - } - } - - return event.result; - }, - - dispatch: function( event ) { - - // Make a writable jQuery.Event from the native event object - event = jQuery.event.fix( event ); - - var i, ret, handleObj, matched, j, - handlerQueue = [], - args = slice.call( arguments ), - handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], - special = jQuery.event.special[ event.type ] || {}; - - // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[0] = event; - event.delegateTarget = this; - - // Call the preDispatch hook for the mapped type, and let it bail if desired - if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { - return; - } - - // Determine handlers - handlerQueue = jQuery.event.handlers.call( this, event, handlers ); - - // Run delegates first; they may want to stop propagation beneath us - i = 0; - while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { - event.currentTarget = matched.elem; - - j = 0; - while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { - - // Triggered event must either 1) have no namespace, or - // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). - if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { - - event.handleObj = handleObj; - event.data = handleObj.data; - - ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) - .apply( matched.elem, args ); - - if ( ret !== undefined ) { - if ( (event.result = ret) === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - } - } - } - - // Call the postDispatch hook for the mapped type - if ( special.postDispatch ) { - special.postDispatch.call( this, event ); - } - - return event.result; - }, - - handlers: function( event, handlers ) { - var sel, handleObj, matches, i, - handlerQueue = [], - delegateCount = handlers.delegateCount, - cur = event.target; - - // Find delegate handlers - // Black-hole SVG instance trees (#13180) - // Avoid non-left-click bubbling in Firefox (#3861) - if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { - - /* jshint eqeqeq: false */ - for ( ; cur != this; cur = cur.parentNode || this ) { - /* jshint eqeqeq: true */ - - // Don't check non-elements (#13208) - // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) - if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { - matches = []; - for ( i = 0; i < delegateCount; i++ ) { - handleObj = handlers[ i ]; - - // Don't conflict with Object.prototype properties (#13203) - sel = handleObj.selector + " "; - - if ( matches[ sel ] === undefined ) { - matches[ sel ] = handleObj.needsContext ? - jQuery( sel, this ).index( cur ) >= 0 : - jQuery.find( sel, this, null, [ cur ] ).length; - } - if ( matches[ sel ] ) { - matches.push( handleObj ); - } - } - if ( matches.length ) { - handlerQueue.push({ elem: cur, handlers: matches }); - } - } - } - } - - // Add the remaining (directly-bound) handlers - if ( delegateCount < handlers.length ) { - handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); - } - - return handlerQueue; - }, - - fix: function( event ) { - if ( event[ jQuery.expando ] ) { - return event; - } - - // Create a writable copy of the event object and normalize some properties - var i, prop, copy, - type = event.type, - originalEvent = event, - fixHook = this.fixHooks[ type ]; - - if ( !fixHook ) { - this.fixHooks[ type ] = fixHook = - rmouseEvent.test( type ) ? this.mouseHooks : - rkeyEvent.test( type ) ? this.keyHooks : - {}; - } - copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; - - event = new jQuery.Event( originalEvent ); - - i = copy.length; - while ( i-- ) { - prop = copy[ i ]; - event[ prop ] = originalEvent[ prop ]; - } - - // Support: IE<9 - // Fix target property (#1925) - if ( !event.target ) { - event.target = originalEvent.srcElement || document; - } - - // Support: Chrome 23+, Safari? - // Target should not be a text node (#504, #13143) - if ( event.target.nodeType === 3 ) { - event.target = event.target.parentNode; - } - - // Support: IE<9 - // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) - event.metaKey = !!event.metaKey; - - return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; - }, - - // Includes some event props shared by KeyEvent and MouseEvent - props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), - - fixHooks: {}, - - keyHooks: { - props: "char charCode key keyCode".split(" "), - filter: function( event, original ) { - - // Add which for key events - if ( event.which == null ) { - event.which = original.charCode != null ? original.charCode : original.keyCode; - } - - return event; - } - }, - - mouseHooks: { - props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), - filter: function( event, original ) { - var body, eventDoc, doc, - button = original.button, - fromElement = original.fromElement; - - // Calculate pageX/Y if missing and clientX/Y available - if ( event.pageX == null && original.clientX != null ) { - eventDoc = event.target.ownerDocument || document; - doc = eventDoc.documentElement; - body = eventDoc.body; - - event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); - event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); - } - - // Add relatedTarget, if necessary - if ( !event.relatedTarget && fromElement ) { - event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; - } - - // Add which for click: 1 === left; 2 === middle; 3 === right - // Note: button is not normalized, so don't use it - if ( !event.which && button !== undefined ) { - event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); - } - - return event; - } - }, - - special: { - load: { - // Prevent triggered image.load events from bubbling to window.load - noBubble: true - }, - focus: { - // Fire native event if possible so blur/focus sequence is correct - trigger: function() { - if ( this !== safeActiveElement() && this.focus ) { - try { - this.focus(); - return false; - } catch ( e ) { - // Support: IE<9 - // If we error on focus to hidden element (#1486, #12518), - // let .trigger() run the handlers - } - } - }, - delegateType: "focusin" - }, - blur: { - trigger: function() { - if ( this === safeActiveElement() && this.blur ) { - this.blur(); - return false; - } - }, - delegateType: "focusout" - }, - click: { - // For checkbox, fire native event so checked state will be right - trigger: function() { - if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { - this.click(); - return false; - } - }, - - // For cross-browser consistency, don't fire native .click() on links - _default: function( event ) { - return jQuery.nodeName( event.target, "a" ); - } - }, - - beforeunload: { - postDispatch: function( event ) { - - // Support: Firefox 20+ - // Firefox doesn't alert if the returnValue field is not set. - if ( event.result !== undefined && event.originalEvent ) { - event.originalEvent.returnValue = event.result; - } - } - } - }, - - simulate: function( type, elem, event, bubble ) { - // Piggyback on a donor event to simulate a different one. - // Fake originalEvent to avoid donor's stopPropagation, but if the - // simulated event prevents default then we do the same on the donor. - var e = jQuery.extend( - new jQuery.Event(), - event, - { - type: type, - isSimulated: true, - originalEvent: {} - } - ); - if ( bubble ) { - jQuery.event.trigger( e, null, elem ); - } else { - jQuery.event.dispatch.call( elem, e ); - } - if ( e.isDefaultPrevented() ) { - event.preventDefault(); - } - } -}; - -jQuery.removeEvent = document.removeEventListener ? - function( elem, type, handle ) { - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle, false ); - } - } : - function( elem, type, handle ) { - var name = "on" + type; - - if ( elem.detachEvent ) { - - // #8545, #7054, preventing memory leaks for custom events in IE6-8 - // detachEvent needed property on element, by name of that event, to properly expose it to GC - if ( typeof elem[ name ] === strundefined ) { - elem[ name ] = null; - } - - elem.detachEvent( name, handle ); - } - }; - -jQuery.Event = function( src, props ) { - // Allow instantiation without the 'new' keyword - if ( !(this instanceof jQuery.Event) ) { - return new jQuery.Event( src, props ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = src.defaultPrevented || - src.defaultPrevented === undefined && - // Support: IE < 9, Android < 4.0 - src.returnValue === false ? - returnTrue : - returnFalse; - - // Event type - } else { - this.type = src; - } - - // Put explicitly provided properties onto the event object - if ( props ) { - jQuery.extend( this, props ); - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || jQuery.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; -}; - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse, - - preventDefault: function() { - var e = this.originalEvent; - - this.isDefaultPrevented = returnTrue; - if ( !e ) { - return; - } - - // If preventDefault exists, run it on the original event - if ( e.preventDefault ) { - e.preventDefault(); - - // Support: IE - // Otherwise set the returnValue property of the original event to false - } else { - e.returnValue = false; - } - }, - stopPropagation: function() { - var e = this.originalEvent; - - this.isPropagationStopped = returnTrue; - if ( !e ) { - return; - } - // If stopPropagation exists, run it on the original event - if ( e.stopPropagation ) { - e.stopPropagation(); - } - - // Support: IE - // Set the cancelBubble property of the original event to true - e.cancelBubble = true; - }, - stopImmediatePropagation: function() { - var e = this.originalEvent; - - this.isImmediatePropagationStopped = returnTrue; - - if ( e && e.stopImmediatePropagation ) { - e.stopImmediatePropagation(); - } - - this.stopPropagation(); - } -}; - -// Create mouseenter/leave events using mouseover/out and event-time checks -jQuery.each({ - mouseenter: "mouseover", - mouseleave: "mouseout", - pointerenter: "pointerover", - pointerleave: "pointerout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = { - delegateType: fix, - bindType: fix, - - handle: function( event ) { - var ret, - target = this, - related = event.relatedTarget, - handleObj = event.handleObj; - - // For mousenter/leave call the handler if related is outside the target. - // NB: No relatedTarget if the mouse left/entered the browser window - if ( !related || (related !== target && !jQuery.contains( target, related )) ) { - event.type = handleObj.origType; - ret = handleObj.handler.apply( this, arguments ); - event.type = fix; - } - return ret; - } - }; -}); - -// IE submit delegation -if ( !support.submitBubbles ) { - - jQuery.event.special.submit = { - setup: function() { - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Lazy-add a submit handler when a descendant form may potentially be submitted - jQuery.event.add( this, "click._submit keypress._submit", function( e ) { - // Node name check avoids a VML-related crash in IE (#9807) - var elem = e.target, - form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; - if ( form && !jQuery._data( form, "submitBubbles" ) ) { - jQuery.event.add( form, "submit._submit", function( event ) { - event._submit_bubble = true; - }); - jQuery._data( form, "submitBubbles", true ); - } - }); - // return undefined since we don't need an event listener - }, - - postDispatch: function( event ) { - // If form was submitted by the user, bubble the event up the tree - if ( event._submit_bubble ) { - delete event._submit_bubble; - if ( this.parentNode && !event.isTrigger ) { - jQuery.event.simulate( "submit", this.parentNode, event, true ); - } - } - }, - - teardown: function() { - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Remove delegated handlers; cleanData eventually reaps submit handlers attached above - jQuery.event.remove( this, "._submit" ); - } - }; -} - -// IE change delegation and checkbox/radio fix -if ( !support.changeBubbles ) { - - jQuery.event.special.change = { - - setup: function() { - - if ( rformElems.test( this.nodeName ) ) { - // IE doesn't fire change on a check/radio until blur; trigger it on click - // after a propertychange. Eat the blur-change in special.change.handle. - // This still fires onchange a second time for check/radio after blur. - if ( this.type === "checkbox" || this.type === "radio" ) { - jQuery.event.add( this, "propertychange._change", function( event ) { - if ( event.originalEvent.propertyName === "checked" ) { - this._just_changed = true; - } - }); - jQuery.event.add( this, "click._change", function( event ) { - if ( this._just_changed && !event.isTrigger ) { - this._just_changed = false; - } - // Allow triggered, simulated change events (#11500) - jQuery.event.simulate( "change", this, event, true ); - }); - } - return false; - } - // Delegated event; lazy-add a change handler on descendant inputs - jQuery.event.add( this, "beforeactivate._change", function( e ) { - var elem = e.target; - - if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { - jQuery.event.add( elem, "change._change", function( event ) { - if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { - jQuery.event.simulate( "change", this.parentNode, event, true ); - } - }); - jQuery._data( elem, "changeBubbles", true ); - } - }); - }, - - handle: function( event ) { - var elem = event.target; - - // Swallow native change events from checkbox/radio, we already triggered them above - if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { - return event.handleObj.handler.apply( this, arguments ); - } - }, - - teardown: function() { - jQuery.event.remove( this, "._change" ); - - return !rformElems.test( this.nodeName ); - } - }; -} - -// Create "bubbling" focus and blur events -if ( !support.focusinBubbles ) { - jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { - - // Attach a single capturing handler on the document while someone wants focusin/focusout - var handler = function( event ) { - jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); - }; - - jQuery.event.special[ fix ] = { - setup: function() { - var doc = this.ownerDocument || this, - attaches = jQuery._data( doc, fix ); - - if ( !attaches ) { - doc.addEventListener( orig, handler, true ); - } - jQuery._data( doc, fix, ( attaches || 0 ) + 1 ); - }, - teardown: function() { - var doc = this.ownerDocument || this, - attaches = jQuery._data( doc, fix ) - 1; - - if ( !attaches ) { - doc.removeEventListener( orig, handler, true ); - jQuery._removeData( doc, fix ); - } else { - jQuery._data( doc, fix, attaches ); - } - } - }; - }); -} - -jQuery.fn.extend({ - - on: function( types, selector, data, fn, /*INTERNAL*/ one ) { - var type, origFn; - - // Types can be a map of types/handlers - if ( typeof types === "object" ) { - // ( types-Object, selector, data ) - if ( typeof selector !== "string" ) { - // ( types-Object, data ) - data = data || selector; - selector = undefined; - } - for ( type in types ) { - this.on( type, selector, data, types[ type ], one ); - } - return this; - } - - if ( data == null && fn == null ) { - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - if ( fn === false ) { - fn = returnFalse; - } else if ( !fn ) { - return this; - } - - if ( one === 1 ) { - origFn = fn; - fn = function( event ) { - // Can use an empty set, since event contains the info - jQuery().off( event ); - return origFn.apply( this, arguments ); - }; - // Use same guid so caller can remove using origFn - fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); - } - return this.each( function() { - jQuery.event.add( this, types, fn, data, selector ); - }); - }, - one: function( types, selector, data, fn ) { - return this.on( types, selector, data, fn, 1 ); - }, - off: function( types, selector, fn ) { - var handleObj, type; - if ( types && types.preventDefault && types.handleObj ) { - // ( event ) dispatched jQuery.Event - handleObj = types.handleObj; - jQuery( types.delegateTarget ).off( - handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, - handleObj.selector, - handleObj.handler - ); - return this; - } - if ( typeof types === "object" ) { - // ( types-object [, selector] ) - for ( type in types ) { - this.off( type, selector, types[ type ] ); - } - return this; - } - if ( selector === false || typeof selector === "function" ) { - // ( types [, fn] ) - fn = selector; - selector = undefined; - } - if ( fn === false ) { - fn = returnFalse; - } - return this.each(function() { - jQuery.event.remove( this, types, fn, selector ); - }); - }, - - trigger: function( type, data ) { - return this.each(function() { - jQuery.event.trigger( type, data, this ); - }); - }, - triggerHandler: function( type, data ) { - var elem = this[0]; - if ( elem ) { - return jQuery.event.trigger( type, data, elem, true ); - } - } -}); - - -function createSafeFragment( document ) { - var list = nodeNames.split( "|" ), - safeFrag = document.createDocumentFragment(); - - if ( safeFrag.createElement ) { - while ( list.length ) { - safeFrag.createElement( - list.pop() - ); - } - } - return safeFrag; -} - -var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + - "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", - rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, - rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), - rleadingWhitespace = /^\s+/, - rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, - rtagName = /<([\w:]+)/, - rtbody = /\s*$/g, - - // We have to close these tags to support XHTML (#13200) - wrapMap = { - option: [ 1, "" ], - legend: [ 1, "
      ", "
      " ], - area: [ 1, "", "" ], - param: [ 1, "", "" ], - thead: [ 1, "", "
      " ], - tr: [ 2, "", "
      " ], - col: [ 2, "", "
      " ], - td: [ 3, "", "
      " ], - - // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, - // unless wrapped in a div with non-breaking characters in front of it. - _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X
      ", "
      " ] - }, - safeFragment = createSafeFragment( document ), - fragmentDiv = safeFragment.appendChild( document.createElement("div") ); - -wrapMap.optgroup = wrapMap.option; -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -function getAll( context, tag ) { - var elems, elem, - i = 0, - found = typeof context.getElementsByTagName !== strundefined ? context.getElementsByTagName( tag || "*" ) : - typeof context.querySelectorAll !== strundefined ? context.querySelectorAll( tag || "*" ) : - undefined; - - if ( !found ) { - for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { - if ( !tag || jQuery.nodeName( elem, tag ) ) { - found.push( elem ); - } else { - jQuery.merge( found, getAll( elem, tag ) ); - } - } - } - - return tag === undefined || tag && jQuery.nodeName( context, tag ) ? - jQuery.merge( [ context ], found ) : - found; -} - -// Used in buildFragment, fixes the defaultChecked property -function fixDefaultChecked( elem ) { - if ( rcheckableType.test( elem.type ) ) { - elem.defaultChecked = elem.checked; - } -} - -// Support: IE<8 -// Manipulating tables requires a tbody -function manipulationTarget( elem, content ) { - return jQuery.nodeName( elem, "table" ) && - jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? - - elem.getElementsByTagName("tbody")[0] || - elem.appendChild( elem.ownerDocument.createElement("tbody") ) : - elem; -} - -// Replace/restore the type attribute of script elements for safe DOM manipulation -function disableScript( elem ) { - elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type; - return elem; -} -function restoreScript( elem ) { - var match = rscriptTypeMasked.exec( elem.type ); - if ( match ) { - elem.type = match[1]; - } else { - elem.removeAttribute("type"); - } - return elem; -} - -// Mark scripts as having already been evaluated -function setGlobalEval( elems, refElements ) { - var elem, - i = 0; - for ( ; (elem = elems[i]) != null; i++ ) { - jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); - } -} - -function cloneCopyEvent( src, dest ) { - - if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { - return; - } - - var type, i, l, - oldData = jQuery._data( src ), - curData = jQuery._data( dest, oldData ), - events = oldData.events; - - if ( events ) { - delete curData.handle; - curData.events = {}; - - for ( type in events ) { - for ( i = 0, l = events[ type ].length; i < l; i++ ) { - jQuery.event.add( dest, type, events[ type ][ i ] ); - } - } - } - - // make the cloned public data object a copy from the original - if ( curData.data ) { - curData.data = jQuery.extend( {}, curData.data ); - } -} - -function fixCloneNodeIssues( src, dest ) { - var nodeName, e, data; - - // We do not need to do anything for non-Elements - if ( dest.nodeType !== 1 ) { - return; - } - - nodeName = dest.nodeName.toLowerCase(); - - // IE6-8 copies events bound via attachEvent when using cloneNode. - if ( !support.noCloneEvent && dest[ jQuery.expando ] ) { - data = jQuery._data( dest ); - - for ( e in data.events ) { - jQuery.removeEvent( dest, e, data.handle ); - } - - // Event data gets referenced instead of copied if the expando gets copied too - dest.removeAttribute( jQuery.expando ); - } - - // IE blanks contents when cloning scripts, and tries to evaluate newly-set text - if ( nodeName === "script" && dest.text !== src.text ) { - disableScript( dest ).text = src.text; - restoreScript( dest ); - - // IE6-10 improperly clones children of object elements using classid. - // IE10 throws NoModificationAllowedError if parent is null, #12132. - } else if ( nodeName === "object" ) { - if ( dest.parentNode ) { - dest.outerHTML = src.outerHTML; - } - - // This path appears unavoidable for IE9. When cloning an object - // element in IE9, the outerHTML strategy above is not sufficient. - // If the src has innerHTML and the destination does not, - // copy the src.innerHTML into the dest.innerHTML. #10324 - if ( support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { - dest.innerHTML = src.innerHTML; - } - - } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) { - // IE6-8 fails to persist the checked state of a cloned checkbox - // or radio button. Worse, IE6-7 fail to give the cloned element - // a checked appearance if the defaultChecked value isn't also set - - dest.defaultChecked = dest.checked = src.checked; - - // IE6-7 get confused and end up setting the value of a cloned - // checkbox/radio button to an empty string instead of "on" - if ( dest.value !== src.value ) { - dest.value = src.value; - } - - // IE6-8 fails to return the selected option to the default selected - // state when cloning options - } else if ( nodeName === "option" ) { - dest.defaultSelected = dest.selected = src.defaultSelected; - - // IE6-8 fails to set the defaultValue to the correct value when - // cloning other types of input fields - } else if ( nodeName === "input" || nodeName === "textarea" ) { - dest.defaultValue = src.defaultValue; - } -} - -jQuery.extend({ - clone: function( elem, dataAndEvents, deepDataAndEvents ) { - var destElements, node, clone, i, srcElements, - inPage = jQuery.contains( elem.ownerDocument, elem ); - - if ( support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { - clone = elem.cloneNode( true ); - - // IE<=8 does not properly clone detached, unknown element nodes - } else { - fragmentDiv.innerHTML = elem.outerHTML; - fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); - } - - if ( (!support.noCloneEvent || !support.noCloneChecked) && - (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { - - // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 - destElements = getAll( clone ); - srcElements = getAll( elem ); - - // Fix all IE cloning issues - for ( i = 0; (node = srcElements[i]) != null; ++i ) { - // Ensure that the destination node is not null; Fixes #9587 - if ( destElements[i] ) { - fixCloneNodeIssues( node, destElements[i] ); - } - } - } - - // Copy the events from the original to the clone - if ( dataAndEvents ) { - if ( deepDataAndEvents ) { - srcElements = srcElements || getAll( elem ); - destElements = destElements || getAll( clone ); - - for ( i = 0; (node = srcElements[i]) != null; i++ ) { - cloneCopyEvent( node, destElements[i] ); - } - } else { - cloneCopyEvent( elem, clone ); - } - } - - // Preserve script evaluation history - destElements = getAll( clone, "script" ); - if ( destElements.length > 0 ) { - setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); - } - - destElements = srcElements = node = null; - - // Return the cloned set - return clone; - }, - - buildFragment: function( elems, context, scripts, selection ) { - var j, elem, contains, - tmp, tag, tbody, wrap, - l = elems.length, - - // Ensure a safe fragment - safe = createSafeFragment( context ), - - nodes = [], - i = 0; - - for ( ; i < l; i++ ) { - elem = elems[ i ]; - - if ( elem || elem === 0 ) { - - // Add nodes directly - if ( jQuery.type( elem ) === "object" ) { - jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); - - // Convert non-html into a text node - } else if ( !rhtml.test( elem ) ) { - nodes.push( context.createTextNode( elem ) ); - - // Convert html into DOM nodes - } else { - tmp = tmp || safe.appendChild( context.createElement("div") ); - - // Deserialize a standard representation - tag = (rtagName.exec( elem ) || [ "", "" ])[ 1 ].toLowerCase(); - wrap = wrapMap[ tag ] || wrapMap._default; - - tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1>" ) + wrap[2]; - - // Descend through wrappers to the right content - j = wrap[0]; - while ( j-- ) { - tmp = tmp.lastChild; - } - - // Manually add leading whitespace removed by IE - if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { - nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); - } - - // Remove IE's autoinserted from table fragments - if ( !support.tbody ) { - - // String was a , *may* have spurious - elem = tag === "table" && !rtbody.test( elem ) ? - tmp.firstChild : - - // String was a bare or - wrap[1] === "
      " && !rtbody.test( elem ) ? - tmp : - 0; - - j = elem && elem.childNodes.length; - while ( j-- ) { - if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { - elem.removeChild( tbody ); - } - } - } - - jQuery.merge( nodes, tmp.childNodes ); - - // Fix #12392 for WebKit and IE > 9 - tmp.textContent = ""; - - // Fix #12392 for oldIE - while ( tmp.firstChild ) { - tmp.removeChild( tmp.firstChild ); - } - - // Remember the top-level container for proper cleanup - tmp = safe.lastChild; - } - } - } - - // Fix #11356: Clear elements from fragment - if ( tmp ) { - safe.removeChild( tmp ); - } - - // Reset defaultChecked for any radios and checkboxes - // about to be appended to the DOM in IE 6/7 (#8060) - if ( !support.appendChecked ) { - jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); - } - - i = 0; - while ( (elem = nodes[ i++ ]) ) { - - // #4087 - If origin and destination elements are the same, and this is - // that element, do not do anything - if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { - continue; - } - - contains = jQuery.contains( elem.ownerDocument, elem ); - - // Append to fragment - tmp = getAll( safe.appendChild( elem ), "script" ); - - // Preserve script evaluation history - if ( contains ) { - setGlobalEval( tmp ); - } - - // Capture executables - if ( scripts ) { - j = 0; - while ( (elem = tmp[ j++ ]) ) { - if ( rscriptType.test( elem.type || "" ) ) { - scripts.push( elem ); - } - } - } - } - - tmp = null; - - return safe; - }, - - cleanData: function( elems, /* internal */ acceptData ) { - var elem, type, id, data, - i = 0, - internalKey = jQuery.expando, - cache = jQuery.cache, - deleteExpando = support.deleteExpando, - special = jQuery.event.special; - - for ( ; (elem = elems[i]) != null; i++ ) { - if ( acceptData || jQuery.acceptData( elem ) ) { - - id = elem[ internalKey ]; - data = id && cache[ id ]; - - if ( data ) { - if ( data.events ) { - for ( type in data.events ) { - if ( special[ type ] ) { - jQuery.event.remove( elem, type ); - - // This is a shortcut to avoid jQuery.event.remove's overhead - } else { - jQuery.removeEvent( elem, type, data.handle ); - } - } - } - - // Remove cache only if it was not already removed by jQuery.event.remove - if ( cache[ id ] ) { - - delete cache[ id ]; - - // IE does not allow us to delete expando properties from nodes, - // nor does it have a removeAttribute function on Document nodes; - // we must handle all of these cases - if ( deleteExpando ) { - delete elem[ internalKey ]; - - } else if ( typeof elem.removeAttribute !== strundefined ) { - elem.removeAttribute( internalKey ); - - } else { - elem[ internalKey ] = null; - } - - deletedIds.push( id ); - } - } - } - } - } -}); - -jQuery.fn.extend({ - text: function( value ) { - return access( this, function( value ) { - return value === undefined ? - jQuery.text( this ) : - this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); - }, null, value, arguments.length ); - }, - - append: function() { - return this.domManip( arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.appendChild( elem ); - } - }); - }, - - prepend: function() { - return this.domManip( arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.insertBefore( elem, target.firstChild ); - } - }); - }, - - before: function() { - return this.domManip( arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this ); - } - }); - }, - - after: function() { - return this.domManip( arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this.nextSibling ); - } - }); - }, - - remove: function( selector, keepData /* Internal Use Only */ ) { - var elem, - elems = selector ? jQuery.filter( selector, this ) : this, - i = 0; - - for ( ; (elem = elems[i]) != null; i++ ) { - - if ( !keepData && elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem ) ); - } - - if ( elem.parentNode ) { - if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { - setGlobalEval( getAll( elem, "script" ) ); - } - elem.parentNode.removeChild( elem ); - } - } - - return this; - }, - - empty: function() { - var elem, - i = 0; - - for ( ; (elem = this[i]) != null; i++ ) { - // Remove element nodes and prevent memory leaks - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - } - - // Remove any remaining nodes - while ( elem.firstChild ) { - elem.removeChild( elem.firstChild ); - } - - // If this is a select, ensure that it displays empty (#12336) - // Support: IE<9 - if ( elem.options && jQuery.nodeName( elem, "select" ) ) { - elem.options.length = 0; - } - } - - return this; - }, - - clone: function( dataAndEvents, deepDataAndEvents ) { - dataAndEvents = dataAndEvents == null ? false : dataAndEvents; - deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; - - return this.map(function() { - return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); - }); - }, - - html: function( value ) { - return access( this, function( value ) { - var elem = this[ 0 ] || {}, - i = 0, - l = this.length; - - if ( value === undefined ) { - return elem.nodeType === 1 ? - elem.innerHTML.replace( rinlinejQuery, "" ) : - undefined; - } - - // See if we can take a shortcut and just use innerHTML - if ( typeof value === "string" && !rnoInnerhtml.test( value ) && - ( support.htmlSerialize || !rnoshimcache.test( value ) ) && - ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && - !wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) { - - value = value.replace( rxhtmlTag, "<$1>" ); - - try { - for (; i < l; i++ ) { - // Remove element nodes and prevent memory leaks - elem = this[i] || {}; - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - elem.innerHTML = value; - } - } - - elem = 0; - - // If using innerHTML throws an exception, use the fallback method - } catch(e) {} - } - - if ( elem ) { - this.empty().append( value ); - } - }, null, value, arguments.length ); - }, - - replaceWith: function() { - var arg = arguments[ 0 ]; - - // Make the changes, replacing each context element with the new content - this.domManip( arguments, function( elem ) { - arg = this.parentNode; - - jQuery.cleanData( getAll( this ) ); - - if ( arg ) { - arg.replaceChild( elem, this ); - } - }); - - // Force removal if there was no new content (e.g., from empty arguments) - return arg && (arg.length || arg.nodeType) ? this : this.remove(); - }, - - detach: function( selector ) { - return this.remove( selector, true ); - }, - - domManip: function( args, callback ) { - - // Flatten any nested arrays - args = concat.apply( [], args ); - - var first, node, hasScripts, - scripts, doc, fragment, - i = 0, - l = this.length, - set = this, - iNoClone = l - 1, - value = args[0], - isFunction = jQuery.isFunction( value ); - - // We can't cloneNode fragments that contain checked, in WebKit - if ( isFunction || - ( l > 1 && typeof value === "string" && - !support.checkClone && rchecked.test( value ) ) ) { - return this.each(function( index ) { - var self = set.eq( index ); - if ( isFunction ) { - args[0] = value.call( this, index, self.html() ); - } - self.domManip( args, callback ); - }); - } - - if ( l ) { - fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this ); - first = fragment.firstChild; - - if ( fragment.childNodes.length === 1 ) { - fragment = first; - } - - if ( first ) { - scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); - hasScripts = scripts.length; - - // Use the original fragment for the last item instead of the first because it can end up - // being emptied incorrectly in certain situations (#8070). - for ( ; i < l; i++ ) { - node = fragment; - - if ( i !== iNoClone ) { - node = jQuery.clone( node, true, true ); - - // Keep references to cloned scripts for later restoration - if ( hasScripts ) { - jQuery.merge( scripts, getAll( node, "script" ) ); - } - } - - callback.call( this[i], node, i ); - } - - if ( hasScripts ) { - doc = scripts[ scripts.length - 1 ].ownerDocument; - - // Reenable scripts - jQuery.map( scripts, restoreScript ); - - // Evaluate executable scripts on first document insertion - for ( i = 0; i < hasScripts; i++ ) { - node = scripts[ i ]; - if ( rscriptType.test( node.type || "" ) && - !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { - - if ( node.src ) { - // Optional AJAX dependency, but won't run scripts if not present - if ( jQuery._evalUrl ) { - jQuery._evalUrl( node.src ); - } - } else { - jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); - } - } - } - } - - // Fix #11809: Avoid leaking memory - fragment = first = null; - } - } - - return this; - } -}); - -jQuery.each({ - appendTo: "append", - prependTo: "prepend", - insertBefore: "before", - insertAfter: "after", - replaceAll: "replaceWith" -}, function( name, original ) { - jQuery.fn[ name ] = function( selector ) { - var elems, - i = 0, - ret = [], - insert = jQuery( selector ), - last = insert.length - 1; - - for ( ; i <= last; i++ ) { - elems = i === last ? this : this.clone(true); - jQuery( insert[i] )[ original ]( elems ); - - // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() - push.apply( ret, elems.get() ); - } - - return this.pushStack( ret ); - }; -}); - - -var iframe, - elemdisplay = {}; - -/** - * Retrieve the actual display of a element - * @param {String} name nodeName of the element - * @param {Object} doc Document object - */ -// Called only from within defaultDisplay -function actualDisplay( name, doc ) { - var style, - elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), - - // getDefaultComputedStyle might be reliably used only on attached element - display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ? - - // Use of this method is a temporary fix (more like optmization) until something better comes along, - // since it was removed from specification and supported only in FF - style.display : jQuery.css( elem[ 0 ], "display" ); - - // We don't have any data stored on the element, - // so use "detach" method as fast way to get rid of the element - elem.detach(); - - return display; -} - -/** - * Try to determine the default display value of an element - * @param {String} nodeName - */ -function defaultDisplay( nodeName ) { - var doc = document, - display = elemdisplay[ nodeName ]; - - if ( !display ) { - display = actualDisplay( nodeName, doc ); - - // If the simple way fails, read from inside an iframe - if ( display === "none" || !display ) { - - // Use the already-created iframe if possible - iframe = (iframe || jQuery( "