
var autoSearchUnavailableTimes_xh=true;
var isFireFox = (navigator.appName == "Netscape") ? true : false;
var clientPC=navigator.userAgent.toLowerCase();
var is_ie6=((clientPC.indexOf("msie 6")!=-1)&&(clientPC.indexOf("opera")==-1))?true:false;
var Prototype = {Version: '1.5.0_rc0',
ScriptFragment:'(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)',
emptyFunction: function() {},
K: function(x) {return x}
}
var Class = {create: function() {return function() {this.initialize.apply(this, arguments);}
}
}
var Abstract = new Object();Object.extend = function(destination, source) {for (var property in source) {destination[property] = source[property];}
return destination;}
Object.inspect = function(object) {try {if (object == undefined) return 'undefined';if (object == null) return 'null';return object.inspect ? object.inspect() : object.toString();} catch (e) {if (e instanceof RangeError) return '...';throw e;}
}
Function.prototype.bind = function() {var __method = this, args = $A(arguments), object = args.shift();return function() {return __method.apply(object, args.concat($A(arguments)));}
}
Function.prototype.bindAsEventListener = function(object) {var __method = this;return function(event) {return __method.call(object, event || window.event);}
}
Object.extend(Number.prototype, {toColorPart: function() {var digits = this.toString(16);if (this < 16) return '0' + digits;return digits;},
succ: function() {return this + 1;},
times: function(iterator) {$R(0, this, true).each(iterator);return this;}
});var Try = {these: function() {var returnValue;for (var i = 0; i < arguments.length; i++) {var lambda = arguments[i];try {returnValue = lambda();break;} catch (e) {}
}
return returnValue;}
}
/*--------------------------------------------------------------------------*/
var PeriodicalExecuter = Class.create();PeriodicalExecuter.prototype = {initialize: function(callback, frequency) {this.callback = callback;this.frequency = frequency;this.currentlyExecuting = false;this.registerCallback();},
registerCallback: function() {setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);},
onTimerEvent: function() {if (!this.currentlyExecuting) {try {this.currentlyExecuting = true;this.callback();} finally {this.currentlyExecuting = false;}
}
}
}
Object.extend(String.prototype, {gsub: function(pattern, replacement) {var result = '', source = this, match;replacement = arguments.callee.prepareReplacement(replacement);while (source.length > 0) {if (match = source.match(pattern)) {result += source.slice(0, match.index);result += (replacement(match) || '').toString();source = source.slice(match.index + match[0].length);} else {result += source, source = '';}
}
return result;},
sub: function(pattern, replacement, count) {replacement = this.gsub.prepareReplacement(replacement);count = count === undefined ? 1 : count;return this.gsub(pattern, function(match) {if (--count < 0) return match[0];return replacement(match);});},
scan: function(pattern, iterator) {this.gsub(pattern, iterator);return this;},
truncate: function(length, truncation) {length = length || 30;truncation = truncation === undefined ? '...' : truncation;return this.length > length ?
this.slice(0, length - truncation.length) + truncation : this;},
strip: function() {return this.replace(/^\s+/, '').replace(/\s+$/, '');},
stripTags: function() {return this.replace(/<\/?[^>]+>/gi, '');},
stripScripts: function() {return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), '');},
extractScripts: function() {var matchAll = new RegExp(Prototype.ScriptFragment, 'img'); var matchOne = new RegExp(Prototype.ScriptFragment, 'im');return (this.match(matchAll) || []).map(function(scriptTag) {return (scriptTag.match(matchOne) || ['', ''])[1];});},
extractXHScripts: function() {
    if(isFireFox)
    {
        var objBody = document.getElementsByTagName("body").item(0);
        var xhDiv = document.createElement('div');
        objBody.appendChild(xhDiv);
            xhDiv.innerHTML=this;
        var allScr=xhDiv.getElementsByTagName('script');
        var allScrArr=new Array();
        for(var i=0;i<allScr.length;i++)
            allScrArr.push(allScr[i].innerHTML);
        objBody.removeChild(xhDiv);
        return allScrArr;
    }
    else
        return this.extractScripts();
},
evalScripts: function() { return this.extractXHScripts().map(function(script) {return eval(script) });},
escapeHTML: function() {var div = document.createElement('div');var text = document.createTextNode(this);div.appendChild(text);return div.innerHTML;},
unescapeHTML: function() {var div = document.createElement('div');div.innerHTML = this.stripTags();return div.childNodes[0] ? div.childNodes[0].nodeValue : '';},
toQueryParams: function() {var pairs = this.match(/^\??(.*)$/)[1].split('&');return pairs.inject({}, function(params, pairString) {var pair = pairString.split('=');params[pair[0]] = pair[1];return params;});},
toArray: function() {return this.split('');},
camelize: function() {var oStringList = this.split('-');if (oStringList.length == 1) return oStringList[0];var camelizedString = this.indexOf('-') == 0
? oStringList[0].charAt(0).toUpperCase() + oStringList[0].substring(1)
: oStringList[0];for (var i = 1, len = oStringList.length; i < len; i++) {var s = oStringList[i];camelizedString += s.charAt(0).toUpperCase() + s.substring(1);}
return camelizedString;},
inspect: function() {return "'" + this.replace(/\\/g, '\\\\').replace(/'/g, '\\\'') + "'";}
});String.prototype.gsub.prepareReplacement = function(replacement) {if (typeof replacement == 'function') return replacement;var template = new Template(replacement);return function(match) { return template.evaluate(match) };}
String.prototype.parseQuery = String.prototype.toQueryParams;var Template = Class.create();Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/;Template.prototype = {initialize: function(template, pattern) {this.template = template.toString();this.pattern = pattern || Template.Pattern;},
evaluate: function(object) {return this.template.gsub(this.pattern, function(match) {var before = match[1];if (before == '\\') return match[2];return before + (object[match[3]] || '').toString();});}
}
var $break = new Object();var $continue = new Object();var Enumerable = {each: function(iterator) {var index = 0;try {this._each(function(value) {try {iterator(value, index++);} catch (e) {if (e != $continue) throw e;}
});} catch (e) {if (e != $break) throw e;}
},
all: function(iterator) {var result = true;this.each(function(value, index) {result = result && !!(iterator || Prototype.K)(value, index);if (!result) throw $break;});return result;},
any: function(iterator) {var result = true;this.each(function(value, index) {if (result = !!(iterator || Prototype.K)(value, index))
throw $break;});return result;},
collect: function(iterator) {var results = [];this.each(function(value, index) {results.push(iterator(value, index));});return results;},
detect: function (iterator) {var result;this.each(function(value, index) {if (iterator(value, index)) {result = value;throw $break;}
});return result;},
findAll: function(iterator) {var results = [];this.each(function(value, index) {if (iterator(value, index))
results.push(value);});return results;},
grep: function(pattern, iterator) {var results = [];this.each(function(value, index) {var stringValue = value.toString();if (stringValue.match(pattern))
results.push((iterator || Prototype.K)(value, index));})
return results;},
include: function(object) {var found = false;this.each(function(value) {if (value == object) {found = true;throw $break;}
});return found;},
inject: function(memo, iterator) {this.each(function(value, index) {memo = iterator(memo, value, index);});return memo;},
invoke: function(method) {var args = $A(arguments).slice(1);return this.collect(function(value) {return value[method].apply(value, args);});},
max: function(iterator) {var result;this.each(function(value, index) {value = (iterator || Prototype.K)(value, index);if (result == undefined || value >= result)
result = value;});return result;},
min: function(iterator) {var result;this.each(function(value, index) {value = (iterator || Prototype.K)(value, index);if (result == undefined || value < result)
result = value;});return result;},
partition: function(iterator) {var trues = [], falses = [];this.each(function(value, index) {((iterator || Prototype.K)(value, index) ?
trues : falses).push(value);});return [trues, falses];},
pluck: function(property) {var results = [];this.each(function(value, index) {results.push(value[property]);});return results;},
reject: function(iterator) {var results = [];this.each(function(value, index) {if (!iterator(value, index))
results.push(value);});return results;},
sortBy: function(iterator) {return this.collect(function(value, index) {return {value: value, criteria: iterator(value, index)};}).sort(function(left, right) {var a = left.criteria, b = right.criteria;return a < b ? -1 : a > b ? 1 : 0;}).pluck('value');},
toArray: function() {return this.collect(Prototype.K);},
zip: function() {var iterator = Prototype.K, args = $A(arguments);if (typeof args.last() == 'function')
iterator = args.pop();var collections = [this].concat(args).map($A);return this.map(function(value, index) {return iterator(collections.pluck(index));});},
inspect: function() {return '#<Enumerable:' + this.toArray().inspect() + '>';}
}
Object.extend(Enumerable, {map: Enumerable.collect,
find: Enumerable.detect,
select: Enumerable.findAll,
member: Enumerable.include,
entries: Enumerable.toArray
});var $A = Array.from = function(iterable) {if (!iterable) return [];if (iterable.toArray) {return iterable.toArray();} else {var results = [];for (var i = 0; i < iterable.length; i++)
results.push(iterable[i]);return results;}
}
Object.extend(Array.prototype, Enumerable);if (!Array.prototype._reverse)
Array.prototype._reverse = Array.prototype.reverse;Object.extend(Array.prototype, {_each: function(iterator) {for (var i = 0; i < this.length; i++)
iterator(this[i]);},
clear: function() {this.length = 0;return this;},
first: function() {return this[0];},
last: function() {return this[this.length - 1];},
compact: function() {return this.select(function(value) {return value != undefined || value != null;});},
flatten: function() {return this.inject([], function(array, value) {return array.concat(value && value.constructor == Array ?
value.flatten() : [value]);});},
without: function() {var values = $A(arguments);return this.select(function(value) {return !values.include(value);});},
indexOf: function(object) {for (var i = 0; i < this.length; i++)
if (this[i] == object) return i;return -1;},
reverse: function(inline) {return (inline !== false ? this : this.toArray())._reverse();},
inspect: function() {return '[' + this.map(Object.inspect).join(', ') + ']';}
});var Hash = {_each: function(iterator) {for (var key in this) {var value = this[key];if (typeof value == 'function') continue;var pair = [key, value];pair.key = key;pair.value = value;iterator(pair);}
},
keys: function() {return this.pluck('key');},
values: function() {return this.pluck('value');},
merge: function(hash) {return $H(hash).inject($H(this), function(mergedHash, pair) {mergedHash[pair.key] = pair.value;return mergedHash;});},
toQueryString: function() {return this.map(function(pair) {return pair.map(encodeURIComponent).join('=');}).join('&');},
inspect: function() {return '#<Hash:{' + this.map(function(pair) {return pair.map(Object.inspect).join(': ');}).join(', ') + '}>';}
}
function $H(object) {var hash = Object.extend({}, object || {});Object.extend(hash, Enumerable);Object.extend(hash, Hash);return hash;}
ObjectRange = Class.create();Object.extend(ObjectRange.prototype, Enumerable);Object.extend(ObjectRange.prototype, {initialize: function(start, end, exclusive) {this.start = start;this.end = end;this.exclusive = exclusive;},
_each: function(iterator) {var value = this.start;do {iterator(value);value = value.succ();} while (this.include(value));},
include: function(value) {if (value < this.start)
return false;if (this.exclusive)
return value < this.end;return value <= this.end;}
});var $R = function(start, end, exclusive) {return new ObjectRange(start, end, exclusive);}
var Ajax = {getTransport: function() {return Try.these(
function() {return new XMLHttpRequest()},
function() {return new ActiveXObject('Msxml2.XMLHTTP')},
function() {return new ActiveXObject('Microsoft.XMLHTTP')}
) || false;},
activeRequestCount: 0
}
Ajax.Responders = {responders: [],
_each: function(iterator) {this.responders._each(iterator);},
register: function(responderToAdd) {if (!this.include(responderToAdd))
this.responders.push(responderToAdd);},
unregister: function(responderToRemove) {this.responders = this.responders.without(responderToRemove);},
dispatch: function(callback, request, transport, json) {this.each(function(responder) {if (responder[callback] && typeof responder[callback] == 'function') {try {responder[callback].apply(responder, [request, transport, json]);} catch (e) {}
}
});}
};Object.extend(Ajax.Responders, Enumerable);Ajax.Responders.register({onCreate: function() {Ajax.activeRequestCount++;},
onComplete: function() {Ajax.activeRequestCount--;}
});Ajax.Base = function() {};Ajax.Base.prototype = {setOptions: function(options) {this.options = {method: 'post',
asynchronous: true,
contentType: 'application/x-www-form-urlencoded',
parameters: ''
}
Object.extend(this.options, options || {});},
responseIsSuccess: function() {return this.transport.status == undefined
|| this.transport.status == 0
|| (this.transport.status >= 200 && this.transport.status < 300);},
responseIsFailure: function() {return !this.responseIsSuccess();}
}
Ajax.Request = Class.create();Ajax.Request.Events =
['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];Ajax.Request.prototype = Object.extend(new Ajax.Base(), {initialize: function(url, options) {this.transport = Ajax.getTransport();this.setOptions(options);this.request(url);},
request: function(url) {var parameters = this.options.parameters || '';if (parameters.length > 0) parameters += '&_=';try {this.url = url;if (this.options.method == 'get' && parameters.length > 0)
this.url += (this.url.match(/\?/) ? '&' : '?') + parameters;Ajax.Responders.dispatch('onCreate', this, this.transport);this.transport.open(this.options.method, this.url,
this.options.asynchronous);if (this.options.asynchronous) {this.transport.onreadystatechange = this.onStateChange.bind(this);setTimeout((function() {this.respondToReadyState(1)}).bind(this), 10);}
this.setRequestHeaders();var body = this.options.postBody ? this.options.postBody : parameters;this.transport.send(this.options.method == 'post' ? body : null);} catch (e) {this.dispatchException(e);}
},
setRequestHeaders: function() {var requestHeaders =
['X-Requested-With', 'XMLHttpRequest',
'X-Prototype-Version', Prototype.Version,
'Accept', 'text/javascript, text/html, application/xml, text/xml, */*'];if (this.options.method == 'post') {requestHeaders.push('Content-type', this.options.contentType);/* Force "Connection: close" for Mozilla browsers to work around
* a bug where XMLHttpReqeuest sends an incorrect Content-length
* header. See Mozilla Bugzilla #246651.
*/
if (this.transport.overrideMimeType)
requestHeaders.push('Connection', 'close');}
if (this.options.requestHeaders)
requestHeaders.push.apply(requestHeaders, this.options.requestHeaders);for (var i = 0; i < requestHeaders.length; i += 2)
this.transport.setRequestHeader(requestHeaders[i], requestHeaders[i+1]);},
onStateChange: function() {var readyState = this.transport.readyState;if (readyState != 1)
this.respondToReadyState(this.transport.readyState);},
header: function(name) {try {return this.transport.getResponseHeader(name);} catch (e) {}
},
evalJSON: function() {try {return eval('(' + this.header('X-JSON') + ')');} catch (e) {}
},
evalResponse: function() {try {return eval(this.transport.responseText);} catch (e) {this.dispatchException(e);}
},
respondToReadyState: function(readyState) {var event = Ajax.Request.Events[readyState];var transport = this.transport, json = this.evalJSON();if (event == 'Complete') {try {(this.options['on' + this.transport.status]
|| this.options['on' + (this.responseIsSuccess() ? 'Success' : 'Failure')]
|| Prototype.emptyFunction)(transport, json);} catch (e) {this.dispatchException(e);}
if ((this.header('Content-type') || '').match(/^text\/javascript/i))
this.evalResponse();}
try {(this.options['on' + event] || Prototype.emptyFunction)(transport, json);Ajax.Responders.dispatch('on' + event, this, transport, json);} catch (e) {this.dispatchException(e);}
/* Avoid memory leak in MSIE: clean up the oncomplete event handler */
if (event == 'Complete')
this.transport.onreadystatechange = Prototype.emptyFunction;},
dispatchException: function(exception) {(this.options.onException || Prototype.emptyFunction)(this, exception);Ajax.Responders.dispatch('onException', this, exception);}
});Ajax.Updater = Class.create();Object.extend(Object.extend(Ajax.Updater.prototype, Ajax.Request.prototype), {initialize: function(container, url, options) {this.containers = {success: container.success ? $(container.success) : $(container),
failure: container.failure ? $(container.failure) :
(container.success ? null : $(container))
}
this.transport = Ajax.getTransport();this.setOptions(options);var onComplete = this.options.onComplete || Prototype.emptyFunction;this.options.onComplete = (function(transport, object) {this.updateContent();onComplete(transport, object);}).bind(this);this.request(url);},
updateContent: function() {var receiver = this.responseIsSuccess() ?
this.containers.success : this.containers.failure;var response = this.transport.responseText;if (!this.options.evalScripts)
response = response.stripScripts();if (receiver) {if (this.options.insertion) {new this.options.insertion(receiver, response);} else {Element.update(receiver, response);}
}
if (this.responseIsSuccess()) {if (this.onComplete)
setTimeout(this.onComplete.bind(this), 10);}
}
});Ajax.PeriodicalUpdater = Class.create();Ajax.PeriodicalUpdater.prototype = Object.extend(new Ajax.Base(), {initialize: function(container, url, options) {this.setOptions(options);this.onComplete = this.options.onComplete;this.frequency = (this.options.frequency || 2);this.decay = (this.options.decay || 1);this.updater = {};this.container = container;this.url = url;this.start();},
start: function() {this.options.onComplete = this.updateComplete.bind(this);this.onTimerEvent();},
stop: function() {this.updater.onComplete = undefined;clearTimeout(this.timer);(this.onComplete || Prototype.emptyFunction).apply(this, arguments);},
updateComplete: function(request) {if (this.options.decay) {this.decay = (request.responseText == this.lastText ?
this.decay * this.options.decay : 1);this.lastText = request.responseText;}
this.timer = setTimeout(this.onTimerEvent.bind(this),
this.decay * this.frequency * 1000);},
onTimerEvent: function() {this.updater = new Ajax.Updater(this.container, this.url, this.options);}
});function $() {var results = [], element;for (var i = 0; i < arguments.length; i++) {element = arguments[i];if (typeof element == 'string')
element = document.getElementById(element);results.push(Element.extend(element));}
return results.length < 2 ? results[0] : results;}
document.getElementsByClassName = function(className, parentElement) {var children = ($(parentElement) || document.body).getElementsByTagName('*');return $A(children).inject([], function(elements, child) {if (child.className.match(new RegExp("(^|\\s)" + className + "(\\s|$)")))
elements.push(Element.extend(child));return elements;});}
/*--------------------------------------------------------------------------*/
if (!window.Element)
var Element = new Object();Element.extend = function(element) {if (!element) return;if (_nativeExtensions) return element;if (!element._extended && element.tagName && element != window) {var methods = Element.Methods, cache = Element.extend.cache;for (property in methods) {var value = methods[property];if (typeof value == 'function')
element[property] = cache.findOrStore(value);}
}
element._extended = true;return element;}
Element.extend.cache = {findOrStore: function(value) {return this[value] = this[value] || function() {return value.apply(null, [this].concat($A(arguments)));}
}
}
Element.Methods = {visible: function(element) {return $(element).style.display != 'none';},
toggle: function() {for (var i = 0; i < arguments.length; i++) {var element = $(arguments[i]);Element[Element.visible(element) ? 'hide' : 'show'](element);}
},
hide: function() {for (var i = 0; i < arguments.length; i++) {var element = $(arguments[i]);element.style.display = 'none';}
},
show: function() {for (var i = 0; i < arguments.length; i++) {var element = $(arguments[i]);element.style.display = '';}
},
remove: function(element) {element = $(element);element.parentNode.removeChild(element);},
update: function(element, html) {$(element).innerHTML = html.stripScripts();setTimeout(function() {html.evalScripts()}, 10);},
replace: function(element, html) {element = $(element);if (element.outerHTML) {element.outerHTML = html.stripScripts();} else {var range = element.ownerDocument.createRange();range.selectNodeContents(element);element.parentNode.replaceChild(
range.createContextualFragment(html.stripScripts()), element);}
setTimeout(function() {html.evalScripts()}, 10);},
getHeight: function(element) {element = $(element);return element.offsetHeight;},
classNames: function(element) {return new Element.ClassNames(element);},
hasClassName: function(element, className) {if (!(element = $(element))) return;return Element.classNames(element).include(className);},
addClassName: function(element, className) {if (!(element = $(element))) return;return Element.classNames(element).add(className);},
removeClassName: function(element, className) {if (!(element = $(element))) return;return Element.classNames(element).remove(className);},
cleanWhitespace: function(element) {element = $(element);for (var i = 0; i < element.childNodes.length; i++) {var node = element.childNodes[i];if (node.nodeType == 3 && !/\S/.test(node.nodeValue))
Element.remove(node);}
},
empty: function(element) {return $(element).innerHTML.match(/^\s*$/);},
childOf: function(element, ancestor) {element = $(element), ancestor = $(ancestor);while (element = element.parentNode)
if (element == ancestor) return true;return false;},
scrollTo: function(element) {element = $(element);var x = element.x ? element.x : element.offsetLeft,
y = element.y ? element.y : element.offsetTop;window.scrollTo(x, y);},
getStyle: function(element, style) {element = $(element);var value = element.style[style.camelize()];if (!value) {if (document.defaultView && document.defaultView.getComputedStyle) {var css = document.defaultView.getComputedStyle(element, null);value = css ? css.getPropertyValue(style) : null;} else if (element.currentStyle) {value = element.currentStyle[style.camelize()];}
}
if (window.opera && ['left', 'top', 'right', 'bottom'].include(style))
if (Element.getStyle(element, 'position') == 'static') value = 'auto';return value == 'auto' ? null : value;},
setStyle: function(element, style) {element = $(element);for (var name in style)
element.style[name.camelize()] = style[name];},
getDimensions: function(element) {element = $(element);if (Element.getStyle(element, 'display') != 'none')
return {width: element.offsetWidth, height: element.offsetHeight};var els = element.style;var originalVisibility = els.visibility;var originalPosition = els.position;els.visibility = 'hidden';els.position = 'absolute';els.display = '';var originalWidth = element.clientWidth;var originalHeight = element.clientHeight;els.display = 'none';els.position = originalPosition;els.visibility = originalVisibility;return {width: originalWidth, height: originalHeight};},
makePositioned: function(element) {element = $(element);var pos = Element.getStyle(element, 'position');if (pos == 'static' || !pos) {element._madePositioned = true;element.style.position = 'relative';if (window.opera) {element.style.top = 0;element.style.left = 0;}
}
},
undoPositioned: function(element) {element = $(element);if (element._madePositioned) {element._madePositioned = undefined;element.style.position =
element.style.top =
element.style.left =
element.style.bottom =
element.style.right = '';}
},
makeClipping: function(element) {element = $(element);if (element._overflow) return;element._overflow = element.style.overflow;if ((Element.getStyle(element, 'overflow') || 'visible') != 'hidden')
element.style.overflow = 'hidden';},
undoClipping: function(element) {element = $(element);if (element._overflow) return;element.style.overflow = element._overflow;element._overflow = undefined;}
}
Object.extend(Element, Element.Methods);var _nativeExtensions = false;if(!HTMLElement && /Konqueror|Safari|KHTML/.test(navigator.userAgent)) {var HTMLElement = {}
HTMLElement.prototype = document.createElement('div').__proto__;}
Element.addMethods = function(methods) {Object.extend(Element.Methods, methods || {});if(typeof HTMLElement != 'undefined') {var methods = Element.Methods, cache = Element.extend.cache;for (property in methods) {var value = methods[property];if (typeof value == 'function')
HTMLElement.prototype[property] = cache.findOrStore(value);}
_nativeExtensions = true;}
}
Element.addMethods();var Toggle = new Object();Toggle.display = Element.toggle;/*--------------------------------------------------------------------------*/
Abstract.Insertion = function(adjacency) {this.adjacency = adjacency;}
Abstract.Insertion.prototype = {initialize: function(element, content) {this.element = $(element);this.content = content.stripScripts();if (this.adjacency && this.element.insertAdjacentHTML) {try {this.element.insertAdjacentHTML(this.adjacency, this.content);} catch (e) {var tagName = this.element.tagName.toLowerCase();if (tagName == 'tbody' || tagName == 'tr') {this.insertContent(this.contentFromAnonymousTable());} else {throw e;}
}
} else {this.range = this.element.ownerDocument.createRange();if (this.initializeRange) this.initializeRange();this.insertContent([this.range.createContextualFragment(this.content)]);}
setTimeout(function() {content.evalScripts()}, 10);},
contentFromAnonymousTable: function() {var div = document.createElement('div');div.innerHTML = '<table><tbody>' + this.content + '</tbody></table>';return $A(div.childNodes[0].childNodes[0].childNodes);}
}
var Insertion = new Object();Insertion.Before = Class.create();Insertion.Before.prototype = Object.extend(new Abstract.Insertion('beforeBegin'), {initializeRange: function() {this.range.setStartBefore(this.element);},
insertContent: function(fragments) {fragments.each((function(fragment) {this.element.parentNode.insertBefore(fragment, this.element);}).bind(this));}
});Insertion.Top = Class.create();Insertion.Top.prototype = Object.extend(new Abstract.Insertion('afterBegin'), {initializeRange: function() {this.range.selectNodeContents(this.element);this.range.collapse(true);},
insertContent: function(fragments) {fragments.reverse(false).each((function(fragment) {this.element.insertBefore(fragment, this.element.firstChild);}).bind(this));}
});Insertion.Bottom = Class.create();Insertion.Bottom.prototype = Object.extend(new Abstract.Insertion('beforeEnd'), {initializeRange: function() {this.range.selectNodeContents(this.element);this.range.collapse(this.element);},
insertContent: function(fragments) {fragments.each((function(fragment) {this.element.appendChild(fragment);}).bind(this));}
});Insertion.After = Class.create();Insertion.After.prototype = Object.extend(new Abstract.Insertion('afterEnd'), {initializeRange: function() {this.range.setStartAfter(this.element);},
insertContent: function(fragments) {fragments.each((function(fragment) {this.element.parentNode.insertBefore(fragment,
this.element.nextSibling);}).bind(this));}
});/*--------------------------------------------------------------------------*/
Element.ClassNames = Class.create();Element.ClassNames.prototype = {initialize: function(element) {this.element = $(element);},
_each: function(iterator) {this.element.className.split(/\s+/).select(function(name) {return name.length > 0;})._each(iterator);},
set: function(className) {this.element.className = className;},
add: function(classNameToAdd) {if (this.include(classNameToAdd)) return;this.set(this.toArray().concat(classNameToAdd).join(' '));},
remove: function(classNameToRemove) {if (!this.include(classNameToRemove)) return;this.set(this.select(function(className) {return className != classNameToRemove;}).join(' '));},
toString: function() {return this.toArray().join(' ');}
}
Object.extend(Element.ClassNames.prototype, Enumerable);var Selector = Class.create();Selector.prototype = {initialize: function(expression) {this.params = {classNames: []};this.expression = expression.toString().strip();this.parseExpression();this.compileMatcher();},
parseExpression: function() {function abort(message) { throw 'Parse error in selector: ' + message; }
if (this.expression == '') abort('empty expression');var params = this.params, expr = this.expression, match, modifier, clause, rest;while (match = expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)) {params.attributes = params.attributes || [];params.attributes.push({name: match[2], operator: match[3], value: match[4] || match[5] || ''});expr = match[1];}
if (expr == '*') return this.params.wildcard = true;while (match = expr.match(/^([^a-z0-9_-])?([a-z0-9_-]+)(.*)/i)) {modifier = match[1], clause = match[2], rest = match[3];switch (modifier) {case '#': params.id = clause; break;case '.': params.classNames.push(clause); break;case '':
case undefined: params.tagName = clause.toUpperCase(); break;default: abort(expr.inspect());}
expr = rest;}
if (expr.length > 0) abort(expr.inspect());},
buildMatchExpression: function() {var params = this.params, conditions = [], clause;if (params.wildcard)
conditions.push('true');if (clause = params.id)
conditions.push('element.id == ' + clause.inspect());if (clause = params.tagName)
conditions.push('element.tagName.toUpperCase() == ' + clause.inspect());if ((clause = params.classNames).length > 0)
for (var i = 0; i < clause.length; i++)
conditions.push('Element.hasClassName(element, ' + clause[i].inspect() + ')');if (clause = params.attributes) {clause.each(function(attribute) {var value = 'element.getAttribute(' + attribute.name.inspect() + ')';var splitValueBy = function(delimiter) {return value + ' && ' + value + '.split(' + delimiter.inspect() + ')';}
switch (attribute.operator) {case '=': conditions.push(value + ' == ' + attribute.value.inspect()); break;case '~=': conditions.push(splitValueBy(' ') + '.include(' + attribute.value.inspect() + ')'); break;case '|=': conditions.push(
splitValueBy('-') + '.first().toUpperCase() == ' + attribute.value.toUpperCase().inspect()
); break;case '!=': conditions.push(value + ' != ' + attribute.value.inspect()); break;case '':
case undefined: conditions.push(value + ' != null'); break;default: throw 'Unknown operator ' + attribute.operator + ' in selector';}
});}
return conditions.join(' && ');},
compileMatcher: function() {this.match = new Function('element', 'if (!element.tagName) return false; \
return ' + this.buildMatchExpression());},
findElements: function(scope) {var element;if (element = $(this.params.id))
if (this.match(element))
if (!scope || Element.childOf(element, scope))
return [element];scope = (scope || document).getElementsByTagName(this.params.tagName || '*');var results = [];for (var i = 0; i < scope.length; i++)
if (this.match(element = scope[i]))
results.push(Element.extend(element));return results;},
toString: function() {return this.expression;}
}
function $$() {return $A(arguments).map(function(expression) {return expression.strip().split(/\s+/).inject([null], function(results, expr) {var selector = new Selector(expr);return results.map(selector.findElements.bind(selector)).flatten();});}).flatten();}
var Field = {clear: function() {for (var i = 0; i < arguments.length; i++)
$(arguments[i]).value = '';},
focus: function(element) {$(element).focus();},
present: function() {for (var i = 0; i < arguments.length; i++)
if ($(arguments[i]).value == '') return false;return true;},
select: function(element) {$(element).select();},
activate: function(element) {element = $(element);element.focus();if (element.select)
element.select();}
}
/*--------------------------------------------------------------------------*/
var Form = {serialize: function(form) {var elements = Form.getElements($(form));var queryComponents = new Array();for (var i = 0; i < elements.length; i++) {var queryComponent = Form.Element.serialize(elements[i]);if (queryComponent)
queryComponents.push(queryComponent);}
return queryComponents.join('&');},
getElements: function(form) {form = $(form);var elements = new Array();for (var tagName in Form.Element.Serializers) {var tagElements = form.getElementsByTagName(tagName);for (var j = 0; j < tagElements.length; j++)
elements.push(tagElements[j]);}
return elements;},
getInputs: function(form, typeName, name) {form = $(form);var inputs = form.getElementsByTagName('input');if (!typeName && !name)
return inputs;var matchingInputs = new Array();for (var i = 0; i < inputs.length; i++) {var input = inputs[i];if ((typeName && input.type != typeName) ||
(name && input.name != name))
continue;matchingInputs.push(input);}
return matchingInputs;},
disable: function(form) {var elements = Form.getElements(form);for (var i = 0; i < elements.length; i++) {var element = elements[i];element.blur();element.disabled = 'true';}
},
enable: function(form) {var elements = Form.getElements(form);for (var i = 0; i < elements.length; i++) {var element = elements[i];element.disabled = '';}
},
findFirstElement: function(form) {return Form.getElements(form).find(function(element) {return element.type != 'hidden' && !element.disabled &&
['input', 'select', 'textarea'].include(element.tagName.toLowerCase());});},
focusFirstElement: function(form) {Field.activate(Form.findFirstElement(form));},
reset: function(form) {$(form).reset();}
}
Form.Element = {serialize: function(element) {element = $(element);var method = element.tagName.toLowerCase();var parameter = Form.Element.Serializers[method](element);if (parameter) {var key = encodeURIComponent(parameter[0]);if (key.length == 0) return;if (parameter[1].constructor != Array)
parameter[1] = [parameter[1]];return parameter[1].map(function(value) {return key + '=' + encodeURIComponent(value);}).join('&');}
},
getValue: function(element) {element = $(element);var method = element.tagName.toLowerCase();var parameter = Form.Element.Serializers[method](element);if (parameter)
return parameter[1];}
}
Form.Element.Serializers = {input: function(element) {switch (element.type.toLowerCase()) {case 'submit':
case 'hidden':
case 'password':
case 'text':
return Form.Element.Serializers.textarea(element);case 'checkbox':
case 'radio':
return Form.Element.Serializers.inputSelector(element);}
return false;},
inputSelector: function(element) {if (element.checked)
return [element.name, element.value];},
textarea: function(element) {return [element.name, element.value];},
select: function(element) {return Form.Element.Serializers[element.type == 'select-one' ?
'selectOne' : 'selectMany'](element);},
selectOne: function(element) {var value = '', opt, index = element.selectedIndex;if (index >= 0) {opt = element.options[index];value = opt.value || opt.text;}
return [element.name, value];},
selectMany: function(element) {var value = [];for (var i = 0; i < element.length; i++) {var opt = element.options[i];if (opt.selected)
value.push(opt.value || opt.text);}
return [element.name, value];}
}
/*--------------------------------------------------------------------------*/
var $F = Form.Element.getValue;/*--------------------------------------------------------------------------*/
Abstract.TimedObserver = function() {}
Abstract.TimedObserver.prototype = {initialize: function(element, frequency, callback) {this.frequency = frequency;this.element = $(element);this.callback = callback;this.lastValue = this.getValue();this.registerCallback();},
registerCallback: function() {setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);},
onTimerEvent: function() {var value = this.getValue();if (this.lastValue != value) {this.callback(this.element, value);this.lastValue = value;}
}
}
Form.Element.Observer = Class.create();Form.Element.Observer.prototype = Object.extend(new Abstract.TimedObserver(), {getValue: function() {return Form.Element.getValue(this.element);}
});Form.Observer = Class.create();Form.Observer.prototype = Object.extend(new Abstract.TimedObserver(), {getValue: function() {return Form.serialize(this.element);}
});/*--------------------------------------------------------------------------*/
Abstract.EventObserver = function() {}
Abstract.EventObserver.prototype = {initialize: function(element, callback) {this.element = $(element);this.callback = callback;this.lastValue = this.getValue();if (this.element.tagName.toLowerCase() == 'form')
this.registerFormCallbacks();else
this.registerCallback(this.element);},
onElementEvent: function() {var value = this.getValue();if (this.lastValue != value) {this.callback(this.element, value);this.lastValue = value;}
},
registerFormCallbacks: function() {var elements = Form.getElements(this.element);for (var i = 0; i < elements.length; i++)
this.registerCallback(elements[i]);},
registerCallback: function(element) {if (element.type) {switch (element.type.toLowerCase()) {case 'checkbox':
case 'radio':
Event.observe(element, 'click', this.onElementEvent.bind(this));break;case 'password':
case 'text':
case 'textarea':
case 'select-one':
case 'select-multiple':
Event.observe(element, 'change', this.onElementEvent.bind(this));break;}
}
}
}
Form.Element.EventObserver = Class.create();Form.Element.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), {getValue: function() {return Form.Element.getValue(this.element);}
});Form.EventObserver = Class.create();Form.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), {getValue: function() {return Form.serialize(this.element);}
});if (!window.Event) {var Event = new Object();}
Object.extend(Event, {KEY_BACKSPACE: 8,
KEY_TAB: 9,
KEY_RETURN: 13,
KEY_ESC: 27,
KEY_LEFT: 37,
KEY_UP: 38,
KEY_RIGHT: 39,
KEY_DOWN: 40,
KEY_DELETE: 46,
element: function(event) {return event.target || event.srcElement;},
isLeftClick: function(event) {return (((event.which) && (event.which == 1)) ||
((event.button) && (event.button == 1)));},
pointerX: function(event) {return event.pageX || (event.clientX +
(document.documentElement.scrollLeft || document.body.scrollLeft));},
pointerY: function(event) {return event.pageY || (event.clientY +
(document.documentElement.scrollTop || document.body.scrollTop));},
stop: function(event) {if (event.preventDefault) {event.preventDefault();event.stopPropagation();} else {event.returnValue = false;event.cancelBubble = true;}
},
findElement: function(event, tagName) {var element = Event.element(event);while (element.parentNode && (!element.tagName ||
(element.tagName.toUpperCase() != tagName.toUpperCase())))
element = element.parentNode;return element;},
observers: false,
_observeAndCache: function(element, name, observer, useCapture) {if (!this.observers) this.observers = [];if (element.addEventListener) {this.observers.push([element, name, observer, useCapture]);element.addEventListener(name, observer, useCapture);} else if (element.attachEvent) {this.observers.push([element, name, observer, useCapture]);element.attachEvent('on' + name, observer);}
},
unloadCache: function() {if (!Event.observers) return;for (var i = 0; i < Event.observers.length; i++) {Event.stopObserving.apply(this, Event.observers[i]);Event.observers[i][0] = null;}
Event.observers = false;},
observe: function(element, name, observer, useCapture) {var element = $(element);useCapture = useCapture || false;if (name == 'keypress' &&
(navigator.appVersion.match(/Konqueror|Safari|KHTML/)
|| element.attachEvent))
name = 'keydown';this._observeAndCache(element, name, observer, useCapture);},
stopObserving: function(element, name, observer, useCapture) {var element = $(element);useCapture = useCapture || false;if (name == 'keypress' &&
(navigator.appVersion.match(/Konqueror|Safari|KHTML/)
|| element.detachEvent))
name = 'keydown';if (element.removeEventListener) {element.removeEventListener(name, observer, useCapture);} else if (element.detachEvent) {element.detachEvent('on' + name, observer);}
}
});if (navigator.appVersion.match(/\bMSIE\b/))
Event.observe(window, 'unload', Event.unloadCache, false);var Position = {
includeScrollOffsets: false,
prepare: function() {this.deltaX = window.pageXOffset
|| document.documentElement.scrollLeft
|| document.body.scrollLeft
|| 0;this.deltaY = window.pageYOffset
|| document.documentElement.scrollTop
|| document.body.scrollTop
|| 0;},
realOffset: function(element) {var valueT = 0, valueL = 0;do {valueT += element.scrollTop || 0;valueL += element.scrollLeft || 0;element = element.parentNode;} while (element);return [valueL, valueT];},
cumulativeOffset: function(element) {var valueT = 0, valueL = 0;do {valueT += element.offsetTop || 0;valueL += element.offsetLeft || 0;element = element.offsetParent;} while (element);return [valueL, valueT];},
positionedOffset: function(element) {var valueT = 0, valueL = 0;do {valueT += element.offsetTop || 0;valueL += element.offsetLeft || 0;element = element.offsetParent;if (element) {p = Element.getStyle(element, 'position');if (p == 'relative' || p == 'absolute') break;}
} while (element);return [valueL, valueT];},
offsetParent: function(element) {if (element.offsetParent) return element.offsetParent;if (element == document.body) return element;while ((element = element.parentNode) && element != document.body)
if (Element.getStyle(element, 'position') != 'static')
return element;return document.body;},
within: function(element, x, y) {
if (this.includeScrollOffsets)
    return this.withinIncludingScrolloffsets(element, x, y);

this.xcomp = x;
this.ycomp = y;
this.offset = this.cumulativeOffset(element);
return (y >= this.offset[1] && y < this.offset[1] + element.offsetHeight && x >= this.offset[0] && x < this.offset[0] + element.offsetWidth);
},

withinIncludingScrolloffsets: function(element, x, y) {var offsetcache = this.realOffset(element);this.xcomp = x + offsetcache[0] - this.deltaX;this.ycomp = y + offsetcache[1] - this.deltaY;this.offset = this.cumulativeOffset(element);return (this.ycomp >= this.offset[1] &&
this.ycomp < this.offset[1] + element.offsetHeight &&
this.xcomp >= this.offset[0] &&
this.xcomp < this.offset[0] + element.offsetWidth);},
overlap: function(mode, element) {if (!mode) return 0;if (mode == 'vertical')
return ((this.offset[1] + element.offsetHeight) - this.ycomp) /
element.offsetHeight;if (mode == 'horizontal')
return ((this.offset[0] + element.offsetWidth) - this.xcomp) /
element.offsetWidth;},
clone: function(source, target) {source = $(source);target = $(target);target.style.position = 'absolute';var offsets = this.cumulativeOffset(source);target.style.top = offsets[1] + 'px';target.style.left = offsets[0] + 'px';target.style.width = source.offsetWidth + 'px';target.style.height = source.offsetHeight + 'px';},
page: function(forElement) {var valueT = 0, valueL = 0;var element = forElement;do {valueT += element.offsetTop || 0;valueL += element.offsetLeft || 0;if (element.offsetParent==document.body)
if (Element.getStyle(element,'position')=='absolute') break;} while (element = element.offsetParent);element = forElement;do {valueT -= element.scrollTop || 0;valueL -= element.scrollLeft || 0;} while (element = element.parentNode);return [valueL, valueT];},
clone: function(source, target) {var options = Object.extend({setLeft: true,
setTop: true,
setWidth: true,
setHeight: true,
offsetTop: 0,
offsetLeft: 0
}, arguments[2] || {})
source = $(source);var p = Position.page(source);target = $(target);var delta = [0, 0];var parent = null;if (Element.getStyle(target,'position') == 'absolute') {parent = Position.offsetParent(target);delta = Position.page(parent);}
if (parent == document.body) {delta[0] -= document.body.offsetLeft;delta[1] -= document.body.offsetTop;}
if(options.setLeft) target.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px';if(options.setTop) target.style.top = (p[1] - delta[1] + options.offsetTop) + 'px';if(options.setWidth) target.style.width = source.offsetWidth + 'px';if(options.setHeight) target.style.height = source.offsetHeight + 'px';},
absolutize: function(element) {element = $(element);if (element.style.position == 'absolute') return;Position.prepare();var offsets = Position.positionedOffset(element);var top = offsets[1];var left = offsets[0];var width = element.clientWidth;var height = element.clientHeight;element._originalLeft = left - parseFloat(element.style.left || 0);element._originalTop = top - parseFloat(element.style.top || 0);element._originalWidth = element.style.width;element._originalHeight = element.style.height;element.style.position = 'absolute';element.style.top = top + 'px';;element.style.left = left + 'px';;element.style.width = width + 'px';;element.style.height = height + 'px';;},
relativize: function(element) {element = $(element);if (element.style.position == 'relative') return;Position.prepare();element.style.position = 'relative';var top = parseFloat(element.style.top || 0) - (element._originalTop || 0);var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0);element.style.top = top + 'px';element.style.left = left + 'px';element.style.height = element._originalHeight;element.style.width = element._originalWidth;}
}
if (/Konqueror|Safari|KHTML/.test(navigator.userAgent)) {Position.cumulativeOffset = function(element) {var valueT = 0, valueL = 0;do {valueT += element.offsetTop || 0;valueL += element.offsetLeft || 0;if (element.offsetParent == document.body)
if (Element.getStyle(element, 'position') == 'absolute') break;element = element.offsetParent;} while (element);return [valueL, valueT];}
}
function left(str, n){if (n <= 0)
return "";else if (n > String(str).length)
return str;else
return String(str).substring(0,n);}
function right(str, n){if (n <= 0)
return "";else if (n > String(str).length)
return str;else {var iLen = String(str).length;return String(str).substring(iLen, iLen - n);}
}


String.prototype.parseColor = function() { 
var color = '#'; 
if(this.slice(0,4) == 'rgb(') { 
var cols = this.slice(4,this.length-1).split(','); 
var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3); 
} else { 
if(this.slice(0,1) == '#') { 
if(this.length==4) for(var i=1;i<4;i++) color += (this.charAt(i) + this.charAt(i)).toLowerCase(); 
if(this.length==7) color = this.toLowerCase(); 
} 
} 
return(color.length==7 ? color : (arguments[0] || this)); 
};Element.collectTextNodes = function(element) { 
return $A($(element).childNodes).collect( function(node) {return (node.nodeType==3 ? node.nodeValue : 
(node.hasChildNodes() ? Element.collectTextNodes(node) : ''));}).flatten().join('');};Element.collectTextNodesIgnoreClass = function(element, className) { 
return $A($(element).childNodes).collect( function(node) {return (node.nodeType==3 ? node.nodeValue : 
((node.hasChildNodes() && !Element.hasClassName(node,className)) ? 
Element.collectTextNodesIgnoreClass(node, className) : ''));}).flatten().join('');}
Element.setContentZoom = function(element, percent) {element = $(element); 
Element.setStyle(element, {fontSize: (percent/100) + 'em'}); 
if(navigator.appVersion.indexOf('AppleWebKit')>0) window.scrollBy(0,0);}
Element.getOpacity = function(element){ 
var opacity;if (opacity = Element.getStyle(element, 'opacity')) 
return parseFloat(opacity); 
if (opacity = (Element.getStyle(element, 'filter') || '').match(/alpha\(opacity=(.*)\)/)) 
if(opacity[1]) return parseFloat(opacity[1]) / 100; 
return 1.0; 
}
Element.setOpacity = function(element, value){ 
element= $(element); 
if (value == 1){Element.setStyle(element, { opacity: 
(/Gecko/.test(navigator.userAgent) && !/Konqueror|Safari|KHTML/.test(navigator.userAgent)) ? 
0.999999 : null });if(/MSIE/.test(navigator.userAgent)) 
Element.setStyle(element, {filter: Element.getStyle(element,'filter').replace(/alpha\([^\)]*\)/gi,'')}); 
} else { 
if(value < 0.00001) value = 0; 
Element.setStyle(element, {opacity: value});if(/MSIE/.test(navigator.userAgent)) 
Element.setStyle(element, 
{ filter: Element.getStyle(element,'filter').replace(/alpha\([^\)]*\)/gi,'') +
'alpha(opacity='+value*100+')' }); 
}
} 

Element.getInlineOpacity = function(element){ 
return $(element).style.opacity || '';} 
Element.childrenWithClassName = function(element, className, findFirst) {var classNameRegExp = new RegExp("(^|\\s)" + className + "(\\s|$)");var results = $A($(element).getElementsByTagName('*'))[findFirst ? 'detect' : 'select']( function(c) { 
return (c.className && c.className.match(classNameRegExp));});if(!results) results = [];return results;}
Element.forceRerendering = function(element) {try {element = $(element);var n = document.createTextNode(' ');element.appendChild(n);element.removeChild(n);} catch(e) { }
};/*--------------------------------------------------------------------------*/
Array.prototype.call = function() {var args = arguments;this.each(function(f){ f.apply(this, args) });}
/*--------------------------------------------------------------------------*/
var Effect = {tagifyText: function(element) {var tagifyStyle = 'position:relative';if(/MSIE/.test(navigator.userAgent)) tagifyStyle += ';zoom:1';element = $(element);$A(element.childNodes).each( function(child) {if(child.nodeType==3) {child.nodeValue.toArray().each( function(character) {element.insertBefore(
Builder.node('span',{style: tagifyStyle},
character == ' ' ? String.fromCharCode(160) : character), 
child);});Element.remove(child);}
});},
multiple: function(element, effect) {var elements;if(((typeof element == 'object') || 
(typeof element == 'function')) && 
(element.length))
elements = element;else
elements = $(element).childNodes;
var options = Object.extend({speed: 0.1,
delay: 0.0
}, arguments[2] || {});var masterDelay = options.delay;$A(elements).each( function(element, index) {new effect(element, Object.extend(options, { delay: index * options.speed + masterDelay }));});},
PAIRS: {'slide': ['SlideDown','SlideUp'],
'blind': ['BlindDown','BlindUp'],
'appear': ['Appear','Fade']
},
toggle: function(element, effect) {element = $(element);effect = (effect || 'appear').toLowerCase();var options = Object.extend({queue: { position:'end', scope:(element.id || 'global'), limit: 1 }
}, arguments[2] || {});Effect[element.visible() ? 
Effect.PAIRS[effect][1] : Effect.PAIRS[effect][0]](element, options);}
};var Effect2 = Effect; 
/* ------------- transitions ------------- */
Effect.Transitions = {}
Effect.Transitions.linear = function(pos) {return pos;}
Effect.Transitions.sinoidal = function(pos) {return (-Math.cos(pos*Math.PI)/2) + 0.5;}
Effect.Transitions.reverse = function(pos) {return 1-pos;}
Effect.Transitions.flicker = function(pos) {return ((-Math.cos(pos*Math.PI)/4) + 0.75) + Math.random()/4;}
Effect.Transitions.wobble = function(pos) {return (-Math.cos(pos*Math.PI*(9*pos))/2) + 0.5;}
Effect.Transitions.pulse = function(pos) {return (Math.floor(pos*10) % 2 == 0 ? 
(pos*10-Math.floor(pos*10)) : 1-(pos*10-Math.floor(pos*10)));}
Effect.Transitions.none = function(pos) {return 0;}
Effect.Transitions.full = function(pos) {return 1;}
/* ------------- core effects ------------- */
Effect.ScopedQueue = Class.create();Object.extend(Object.extend(Effect.ScopedQueue.prototype, Enumerable), {initialize: function() {this.effects = [];this.interval = null;},
_each: function(iterator) {this.effects._each(iterator);},
add: function(effect) {var timestamp = new Date().getTime();
var position = (typeof effect.options.queue == 'string') ? 
effect.options.queue : effect.options.queue.position;
switch(position) {case 'front': 
this.effects.findAll(function(e){ return e.state=='idle' }).each( function(e) {e.startOn += effect.finishOn;e.finishOn += effect.finishOn;});break;case 'end':
timestamp = this.effects.pluck('finishOn').max() || timestamp;break;}

effect.startOn += timestamp;effect.finishOn += timestamp;if(!effect.options.queue.limit || (this.effects.length < effect.options.queue.limit))
this.effects.push(effect);
if(!this.interval) 
this.interval = setInterval(this.loop.bind(this), 40);},
remove: function(effect) {this.effects = this.effects.reject(function(e) { return e==effect });if(this.effects.length == 0) {clearInterval(this.interval);this.interval = null;}
},
loop: function() {var timePos = new Date().getTime();this.effects.invoke('loop', timePos);}
});Effect.Queues = {instances: $H(),
get: function(queueName) {if(typeof queueName != 'string') return queueName;
if(!this.instances[queueName])
this.instances[queueName] = new Effect.ScopedQueue();
return this.instances[queueName];}
}
Effect.Queue = Effect.Queues.get('global');Effect.DefaultOptions = {transition: Effect.Transitions.sinoidal,
duration: 1.0, 
fps: 25.0, 
sync: false, 
from: 0.0,
to: 1.0,
delay: 0.0,
queue: 'parallel'
}
Effect.Base = function() {};Effect.Base.prototype = {position: null,
start: function(options) {this.options = Object.extend(Object.extend({},Effect.DefaultOptions), options || {});this.currentFrame = 0;this.state = 'idle';this.startOn = this.options.delay*1000;this.finishOn = this.startOn + (this.options.duration*1000);this.event('beforeStart');if(!this.options.sync)
Effect.Queues.get(typeof this.options.queue == 'string' ? 
'global' : this.options.queue.scope).add(this);},
loop: function(timePos) {if(timePos >= this.startOn) {if(timePos >= this.finishOn) {this.render(1.0);this.cancel();this.event('beforeFinish');if(this.finish) this.finish(); 
this.event('afterFinish');return; 
}
var pos = (timePos - this.startOn) / (this.finishOn - this.startOn);var frame = Math.round(pos * this.options.fps * this.options.duration);if(frame > this.currentFrame) {this.render(pos);this.currentFrame = frame;}
}
},
render: function(pos) {if(this.state == 'idle') {this.state = 'running';this.event('beforeSetup');if(this.setup) this.setup();this.event('afterSetup');}
if(this.state == 'running') {if(this.options.transition) pos = this.options.transition(pos);pos *= (this.options.to-this.options.from);pos += this.options.from;this.position = pos;this.event('beforeUpdate');if(this.update) this.update(pos);this.event('afterUpdate');}
},
cancel: function() {if(!this.options.sync)
Effect.Queues.get(typeof this.options.queue == 'string' ? 
'global' : this.options.queue.scope).remove(this);this.state = 'finished';},
event: function(eventName) {if(this.options[eventName + 'Internal']) this.options[eventName + 'Internal'](this);if(this.options[eventName]) this.options[eventName](this);},
inspect: function() {return '#<Effect:' + $H(this).inspect() + ',options:' + $H(this.options).inspect() + '>';}
}
Effect.Opacity = Class.create();Object.extend(Object.extend(Effect.Opacity.prototype, Effect.Base.prototype), {initialize: function(element) {this.element = $(element);if(/MSIE/.test(navigator.userAgent) && (!this.element.hasLayout))
this.element.setStyle({zoom: 1});var options = Object.extend({from: this.element.getOpacity() || 0.0,
to: 1.0
}, arguments[1] || {});this.start(options);},
update: function(position) {this.element.setOpacity(position);}
});

Effect.Scale = Class.create();
Object.extend(Object.extend(Effect.Scale.prototype, Effect.Base.prototype), {
  initialize: function(element, percent) {
    this.element = $(element)
    var options = Object.extend({
      scaleX: true,
      scaleY: true,
      scaleContent: true,
      scaleFromCenter: false,
      scaleMode: 'box',        // 'box' or 'contents' or {} with provided values
      scaleFrom: 100.0,
      scaleTo:   percent
    }, arguments[2] || {});
    this.start(options);
  },
  setup: function() {
    this.restoreAfterFinish = this.options.restoreAfterFinish || false;
    this.elementPositioning = this.element.getStyle('position');
    
    this.originalStyle = {};
    ['top','left','width','height','fontSize'].each( function(k) {
      this.originalStyle[k] = this.element.style[k];
    }.bind(this));
      
    this.originalTop  = this.element.offsetTop;
    this.originalLeft = this.element.offsetLeft;
    
    var fontSize = this.element.getStyle('font-size') || '100%';
    ['em','px','%'].each( function(fontSizeType) {
      if(fontSize.indexOf(fontSizeType)>0) {
        this.fontSize     = parseFloat(fontSize);
        this.fontSizeType = fontSizeType;
      }
    }.bind(this));
    
    this.factor = (this.options.scaleTo - this.options.scaleFrom)/100;
    
    this.dims = null;
    if(this.options.scaleMode=='box')
      this.dims = [this.element.offsetHeight, this.element.offsetWidth];
    if(/^content/.test(this.options.scaleMode))
      this.dims = [this.element.scrollHeight, this.element.scrollWidth];
    if(!this.dims)
      this.dims = [this.options.scaleMode.originalHeight,
                   this.options.scaleMode.originalWidth];
  },
  update: function(position) {
    var currentScale = (this.options.scaleFrom/100.0) + (this.factor * position);
    if(this.options.scaleContent && this.fontSize)
      this.element.setStyle({fontSize: this.fontSize * currentScale + this.fontSizeType });
    this.setDimensions(this.dims[0] * currentScale, this.dims[1] * currentScale);
  },
  finish: function(position) {
    if (this.restoreAfterFinish) this.element.setStyle(this.originalStyle);
  },
  setDimensions: function(height, width) {
    var d = {};
    if(this.options.scaleX) d.width = width + 'px';
    if(this.options.scaleY) d.height = height + 'px';
    if(this.options.scaleFromCenter) {
      var topd  = (height - this.dims[0])/2;
      var leftd = (width  - this.dims[1])/2;
      if(this.elementPositioning == 'absolute') {
        if(this.options.scaleY) d.top = this.originalTop-topd + 'px';
        if(this.options.scaleX) d.left = this.originalLeft-leftd + 'px';
      } else {
        if(this.options.scaleY) d.top = -topd + 'px';
        if(this.options.scaleX) d.left = -leftd + 'px';
      }
    }
    this.element.setStyle(d);
  }
});
Effect.Highlight = Class.create();Object.extend(Object.extend(Effect.Highlight.prototype, Effect.Base.prototype), {initialize: function(element) {this.element = $(element);var options = Object.extend({ startcolor: '#ffff99' }, arguments[1] || {});this.start(options);},setup: function() {if(this.element.getStyle('display')=='none') { this.cancel(); return; } this.oldStyle = {backgroundImage: this.element.getStyle('background-image') }; this.element.setStyle({backgroundImage: 'none'}); if(!this.options.endcolor)this.options.endcolor = this.element.getStyle('background-color').parseColor('#ffffff');if(!this.options.restorecolor)this.options.restorecolor = this.element.getStyle('background-color'); this._base  = $R(0,2).map(function(i){ return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16) }.bind(this)); this._delta = $R(0,2).map(function(i){ return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i] }.bind(this));}, update: function(position) { this.element.setStyle({backgroundColor: $R(0,2).inject('#',function(m,v,i){return m+(Math.round(this._base[i]+(this._delta[i]*position)).toColorPart()); }.bind(this)) });},finish: function() {this.element.setStyle(Object.extend(this.oldStyle, {backgroundColor: this.options.restorecolor}));}});Effect.Fade = function(element) {element = $(element);var oldOpacity = element.getInlineOpacity();var options = Object.extend({from: element.getOpacity() || 1.0,
to: 0.0,
afterFinishInternal: function(effect) { 
if(effect.options.to!=0) return;effect.element.hide();effect.element.setStyle({opacity: oldOpacity}); 
}}, arguments[1] || {});return new Effect.Opacity(element,options);}



Effect.SlideDown = function(element) {
  element = $(element);
  element.cleanWhitespace();
  // SlideDown need to have the content of the element wrapped in a container element with fixed height!
  var oldInnerBottom = $(element.firstChild).getStyle('bottom');
  var elementDimensions = element.getDimensions();
  return new Effect.Scale(element, 100, Object.extend({ 
    scaleContent: false, 
    scaleX: false, 
    scaleFrom: window.opera ? 0 : 1,
    scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width},
    restoreAfterFinish: true,
    afterSetup: function(effect) {
      effect.element.makePositioned();
      effect.element.firstChild.makePositioned();
      if(window.opera) effect.element.setStyle({top: ''});
      effect.element.makeClipping();
      effect.element.setStyle({height: '0px'});
      effect.element.show(); },
    afterUpdateInternal: function(effect) {
      effect.element.firstChild.setStyle({bottom:
        (effect.dims[0] - effect.element.clientHeight) + 'px' }); 
    },
    afterFinishInternal: function(effect) {
      effect.element.undoClipping(); 
      // IE will crash if child is undoPositioned first
      if(/MSIE/.test(navigator.userAgent)){
        effect.element.undoPositioned();
        effect.element.firstChild.undoPositioned();
      }else{
        effect.element.firstChild.undoPositioned();
        effect.element.undoPositioned();
      }
      effect.element.firstChild.setStyle({bottom: oldInnerBottom}); }
    }, arguments[1] || {})
  );
}
  
Effect.SlideUp = function(element) {
  element = $(element);
  element.cleanWhitespace();
  var oldInnerBottom = $(element.firstChild).getStyle('bottom');
  return new Effect.Scale(element, window.opera ? 0 : 1,
   Object.extend({ scaleContent: false, 
    scaleX: false, 
    scaleMode: 'box',
    scaleFrom: 100,
    restoreAfterFinish: true,
    beforeStartInternal: function(effect) {
      effect.element.makePositioned();
      effect.element.firstChild.makePositioned();
      if(window.opera) effect.element.setStyle({top: ''});
      effect.element.makeClipping();
      effect.element.show(); },  
    afterUpdateInternal: function(effect) {
      effect.element.firstChild.setStyle({bottom:
        (effect.dims[0] - effect.element.clientHeight) + 'px' }); },
    afterFinishInternal: function(effect) {
      effect.element.hide();
      effect.element.undoClipping();
      effect.element.firstChild.undoPositioned();
      effect.element.undoPositioned();
      effect.element.setStyle({bottom: oldInnerBottom}); }
   }, arguments[1] || {})
  );
}

Effect.BlindUp = function(element) {
  element = $(element);
  Element.makeClipping(element);
  return new Effect.Scale(element, 0, 
    Object.extend({ scaleContent: false, 
      scaleX: false, 
      restoreAfterFinish: true,
      afterFinishInternal: function(effect)
        { 
          Element.hide(effect.element);
          Element.undoClipping(effect.element);
        } 
    }, arguments[1] || {})
  );
}

Effect.BlindDown = function(element) {
  element = $(element);
  var oldHeight = element.style.height;
  var elementDimensions = Element.getDimensions(element);
  return new Effect.Scale(element, 100, 
    Object.extend({ scaleContent: false, 
      scaleX: false,
      scaleFrom: 0,
      scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width},
      restoreAfterFinish: true,
      afterSetup: function(effect) {
        Element.makeClipping(effect.element);
        effect.element.style.height = "0px";
        Element.show(effect.element); 
      },  
      afterFinishInternal: function(effect) {
        Element.undoClipping(effect.element);
        effect.element.style.height = oldHeight;
      }
    }, arguments[1] || {})
  );
}

Effect.Appear = function(element) {element = $(element);var options = Object.extend({from: (element.getStyle('display') == 'none' ? 0.0 : element.getOpacity() || 0.0),
to: 1.0,
afterFinishInternal: function(effect) {effect.element.forceRerendering();},
beforeSetup: function(effect) {effect.element.setOpacity(effect.options.from);effect.element.show(); 
}}, arguments[1] || {});return new Effect.Opacity(element,options);}
Effect.Pulsate = function(element) {element = $(element);var options = arguments[1] || {};var oldOpacity = element.getInlineOpacity();var transition = options.transition || Effect.Transitions.sinoidal;var reverser = function(pos){ return transition(1-Effect.Transitions.pulse(pos)) };reverser.bind(transition);return new Effect.Opacity(element, 
Object.extend(Object.extend({ duration: 3.0, from: 0,
afterFinishInternal: function(effect) { effect.element.setStyle({opacity: oldOpacity}); }
}, options), {transition: reverser}));}
;['setOpacity','getOpacity','getInlineOpacity','forceRerendering','setContentZoom',
'collectTextNodes','collectTextNodesIgnoreClass','childrenWithClassName'].each( 
function(f) { Element.Methods[f] = Element[f]; }
);Element.Methods.visualEffect = function(element, effect, options) {s = effect.gsub(/_/, '-').camelize();effect_class = s.charAt(0).toUpperCase() + s.substring(1);new Effect[effect_class](element, options);return $(element);};Element.addMethods();

var MESSAGES = {"format.date": "MM/dd/yyyy",
"format.time": "h:mm a",
"photoviewer.toolbar.first": "Go to Start (Home)",
"photoviewer.toolbar.prev": "Previous Photo (Left arrow)",
"photoviewer.toolbar.slideShow": "Start/Pause Slide Show (Space)",
"photoviewer.toolbar.next": "Next Photo (Right arrow)",
"photoviewer.toolbar.last": "Go to End (End)",
"photoviewer.toolbar.email": "Email Photo",
"photoviewer.toolbar.permalink": "Link to Photo",
"photoviewer.toolbar.close": "Close (Esc)",
"photoviewer.email.subject.photo": "Photo",
"gallery.nophotos": "No photos",
"gallery.thumbs.start": "Start",
"gallery.thumbs.end": "End",
"gallery.toolbar.first": "First Photo",
"gallery.toolbar.prev": "Previous Photo",
"gallery.toolbar.view": "View Photo",
"gallery.toolbar.next": "Next Photo",
"gallery.toolbar.last": "Last Photo",
"gallery.view.full": "Maximize Window",
"gallery.view.photo": "Show Photo Only",
"gallery.view.text": "Show Description Only",
"gallery.view.close": "Close Window"
};var agent=navigator.userAgent.toLowerCase();var IE=(agent.indexOf("msie")!=-1&&agent.indexOf("opera")==-1);var IE7=(agent.indexOf("msie 7")!=-1);var OPERA=(agent.indexOf("opera")!=-1);var SAFARI=(agent.indexOf("safari")!=-1);var FIREFOX=(agent.indexOf("gecko")!=-1);var STRICT_MODE=(document.compatMode=="CSS1Compat");var _DOMAIN=undefined;var GALLERY_W=650;var GALLERY_H=530;if(USE_GOOGLE_MAPS==undefined)
{var USE_GOOGLE_MAPS=true;}
var USE_OLD_MAPS=!USE_GOOGLE_MAPS;var TESTING=false;var log=getLogger();if(document.location.href.indexOf("#jslog")!=-1)
log.enable();function Logger()
{this.enable=loggerEnable;this.clear=loggerClear;this.log=loggerLog;this.debug=loggerDebug;this.info=loggerInfo;this.error=loggerError;var console=undefined;try{console=document.createElement("textarea");console.style.display="none";console.style.position="absolute";console.style.right="2px";console.style.bottom="2px";console.style.width="23em";console.style.height="40em";console.style.fontFamily="monospace";console.style.fontSize="9px";console.style.color="#000000";setOpacity(console,0.7);console.border="1px solid #808080";console.ondblclick=clearLogger;}
catch(e){}
this.console=console;this.enabled=false;this.logTimeStart=getTimeMillis();}
function getLogger()
{var log=undefined;var win=window;while(log==undefined){try{log=win.document.log;}
catch(e){break;}
if(win==win.parent)
break;win=win.parent;}
if(log==undefined)
{log=new Logger();document.log=log;}
return log;}
function clearLogger(){getLogger().clear();}
function loggerEnable(){if(this.enabled||this.console==undefined)
return;if(window.document.body!=undefined){window.document.body.appendChild(this.console);this.console.style.display="";this.enabled=true;}
}
function loggerDebug(msg){this.log("DEBUG",msg);}
function loggerInfo(msg){this.log("INFO",msg);}
function loggerError(msg,e){this.log("ERROR",msg,e);}
function loggerLog(level,msg,e){if(!this.enabled||this.console==undefined)
return;var millis=(getTimeMillis()-this.logTimeStart)+"";while(millis.length<6)
millis+=" ";var m=millis+" ";if(msg!=undefined)
m+=msg+" ";if(e!=undefined)
m+=e.name+": "+e.message;this.console.value+=m+"\n";}
function loggerClear(){if(!this.enabled||this.console==undefined)
return;this.console.value="";}
function getTimeMillis(){var t=new Date();return Date.UTC(t.getFullYear(),t.getMonth(),t.getDay(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds());}
function getEvent(event){return(event!=undefined?event:window.event);}
function preventDefault(event){if(event.preventDefault){event.preventDefault();event.stopPropagation();}else{event.returnValue=false;event.cancelBubble=true;}}
function getEventTarget(event){if(event==undefined)
return undefined;if(event.srcElement!=undefined)
return event.srcElement;else
return event.target;}
function getResponse(url,async,getXML,callback,data){var req=undefined;try{req=new ActiveXObject("Msxml2.XMLHTTP");}catch(e1){try{req=new ActiveXObject("Microsoft.XMLHTTP");}catch(e2){req=new XMLHttpRequest();}}
if(req==undefined){log.error("Failed to initialize XML/HTTP");return undefined;}
req.open("GET",url,async);if(!async){req.send(undefined);if(req.readyState!=4){log.error("Request failed: "+req.readyState);return undefined;}
if(!getXML)
return req.responseText;else
return req.responseXML;}else{pollResponse(req,callback,data);req.send(undefined);return undefined;}}
function pollResponse(req,callback,data){if(req.readyState!=4)
window.setTimeout(function(){pollResponse(req,callback,data);},100);else
callback(req,data);}
function getElementsByTagName(node,tag){if(node==undefined)
return undefined;if(IE){return node.getElementsByTagName(tag);}
if(tag.indexOf(":")!=-1){tag=tag.split(":")[1];}
return node.getElementsByTagNameNS("*",tag);}
function getFirstElementsValue(node,tag){if(node==undefined)
return undefined;var nodes=getElementsByTagName(node,tag);if(nodes.length===0)
return undefined;else
return getElementValue(nodes[0]);}
function getElementValue(node){var i;var val="";for(i=0;i<node.childNodes.length;i++){if(node.childNodes[i].nodeValue!==null)
val+=node.childNodes[i].nodeValue;}
return val;}
function trim(str){if(str==undefined)
return undefined;return str.replace(/^\s*([\s\S]*\S+)\s*$|^\s*$/,'$1');}
function trimToLen(str,len){if(str==undefined){return undefined;}
if(str.length>len){str=str.substring(0,len)+"...";}
return str;}
function getRootWindow(){var win=window;while(win!=undefined){try{if(win===win.parent){break;}else if(win.parent!=undefined&&win.parent.document.location.href.indexOf("/selenium-server/")!=-1){break;}
win=win.parent;}catch(e){break;}}
return win;}
function getURLParams(){var i,params=[];var url=window.location.search;if(url==undefined||url.length===0)
return undefined;url=url.substring(1);var namevals=url.replace(/\+/g," ").split("&");for(i=0;i<namevals.length;i++){var name,val;var pos=namevals[i].indexOf("=");if(pos!=-1){name=namevals[i].substring(0,pos);val=unescape(namevals[i].substring(pos+1));}else{name=namevals[i];val=undefined;}
params[name]=val;}
return params;}
function joinLists(list1,list2){var i;var size=0;var result=[];if(list1!=undefined&&list1.length>0){for(i=0;i<list1.length;i++)
result[i]=list1[i];size=list1.length;}
if(list2!=undefined&&list2.length>0){for(i=0;i<list2.length;i++)
result[i+size]=list2[i];}
return result;}
function setCookie(name,value,expire){var expiry=(expire==undefined)?"":("; expires="+expire.toGMTString());document.cookie=name+"="+value+expiry;}
function getCookie(name){if(document.cookie==undefined||document.cookie.length===0)
return undefined;var search=name+"=";var index=document.cookie.indexOf(search);if(index!=-1){index+=search.length;var end=document.cookie.indexOf(";",index);if(end==-1)
end=document.cookie.length;return unescape(document.cookie.substring(index,end));}}
function removeCookie(name){var today=new Date();var expires=new Date();expires.setTime(today.getTime()-1);setCookie(name,"",expires);}
function getMessage(id){if(MESSAGES[id]==undefined){return"("+id+")";}else{return MESSAGES[id];}}
function localizeNodeAttribs(node){var i;if(node==undefined)
return;if(node.alt!=undefined&&node.alt.indexOf("#")===0){node.alt=getMessage(node.alt.substring(1));}
if(node.title!=undefined&&node.title.indexOf("#")===0){node.title=getMessage(node.title.substring(1));}
if(node.childNodes!=undefined){for(i=0;i<node.childNodes.length;i++){localizeNodeAttribs(node.childNodes[i]);}}}
function padNumber(n,pad){n=n+"";while(n.length<pad){n="0"+n;}
return n;}
function isArray(obj){if(obj instanceof Array)
return true;else
return false;}
function simpleDateFormatter(date,pattern){var d=pattern;d=d.replace(/yyyy/g,date.getFullYear());d=d.replace(/yy/g,padNumber(date.getFullYear()%100,2));d=d.replace(/MM/g,padNumber(date.getMonth()+1,2));d=d.replace(/M/g,date.getMonth()+1);d=d.replace(/dd/g,padNumber(date.getDate(),2));d=d.replace(/d/g,date.getDate());d=d.replace(/HH/g,padNumber(date.getHours(),2));d=d.replace(/H/g,date.getHours());d=d.replace(/hh/g,padNumber(date.getHours()%12,2));d=d.replace(/h/g,date.getHours()%12);d=d.replace(/mm/g,padNumber(date.getMinutes(),2));d=d.replace(/m/g,date.getMinutes());d=d.replace(/ss/g,padNumber(date.getSeconds(),2));d=d.replace(/s/g,date.getSeconds());var am=(date.getHours()<12?"AM":"PM");d=d.replace(/a/g,am);return d;}
function formatDateTime(date){if(date==undefined)
return undefined;return formatDate(date)+" "+formatTime(date);}
function formatDate(date){var datePattern=getMessage("format.date");return simpleDateFormatter(date,datePattern);}
function formatTime(date){var timePattern=getMessage("format.time");return simpleDateFormatter(date,timePattern);}
function parseISOTime(strTime){if(strTime==undefined)
return undefined;var isoRE=/^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)(\.\d{3})?([Z+-])?(\d\d)?:?(\d\d)?$/;if(!isoRE.test(strTime)){return undefined;}else{return new Date(RegExp.$1,RegExp.$2-1,RegExp.$3,RegExp.$4,RegExp.$5,RegExp.$6);}}
function setOpacity(elt,opacity){if(IE){elt.style.filter="alpha(opacity="+parseInt(opacity*100)+")";}
elt.style.KhtmlOpacity=opacity;elt.style.opacity=opacity;}
function validCoordinates(lat,lon){if(Math.abs(lat)>90||Math.abs(lon)>180){return false;}
if(lat===0.0&&lon===0.0){return false;}
return true;}
function isHosted(){var host=document.location.host;if(host==undefined)
host="";return(host.indexOf("triptracker.net")==-1&&host.indexOf("rtvslo.si")==-1&&!checkDomain());}
function checkDomain(){try{if(_DOMAIN==undefined)
return false;var protocol=document.location.protocol;if(protocol==undefined)
protocol="http:";var host=document.location.host;if(host==undefined)
host="";host=host.toLowerCase();if(protocol.toLowerCase().indexOf("file")===0){return true;}
var pos=host.lastIndexOf(":");if(pos!=-1){host=host.substring(0,pos);}
if(host.indexOf("www.")===0){host=host.substring(4);}
if(host===""||host=="localhost"||host=="127.0.0.1")
return true;var domain=_DOMAIN.toLowerCase();pos=domain.indexOf("://");if(pos!=-1){domain=domain.substring(pos+3);}
pos=domain.indexOf("/");if(pos!=-1){domain=domain.substring(0,pos);}
if(domain.indexOf("www.")===0){domain=domain.substring(4);}
if(host==domain){return true;}else if(new RegExp(domain).test(host)){return true;}
return false;}catch(e){return true;}}
function getWindowSize(win){var availW=win.innerWidth;if(availW==undefined||availW===0||isNaN(availW))
availW=win.document.documentElement.clientWidth;if(availW==undefined||availW===0||isNaN(availW))
availW=win.document.body.clientWidth;var availH=win.innerHeight;if(availH==undefined||availH===0||isNaN(availH))
availH=win.document.documentElement.clientHeight;if(availH==undefined||availH===0||isNaN(availH))
availH=win.document.body.clientHeight;return{w:availW,h:availH};}
function getDocumentSize(win){var winSize=getWindowSize(win);var scrollPos=getScrollPos(win);var w=winSize.w+scrollPos.left;var h=winSize.h+scrollPos.top;w=Math.max(w,win.document.body.offsetWidth);h=Math.max(h,win.document.body.offsetHeight);w=Math.max(w,win.document.body.scrollWidth);h=Math.max(h,win.document.body.scrollHeight);return{w:w,h:h};}
function getScrollPos(win){var scrollTop=win.pageYOffset;if(scrollTop==undefined||scrollTop===0)
scrollTop=win.document.documentElement.scrollTop;if(scrollTop==undefined||scrollTop===0)
scrollTop=win.document.body.scrollTop;var scrollLeft=win.pageXOffset;if(scrollLeft==undefined||scrollLeft===0)
scrollLeft=win.document.documentElement.scrollLeft;if(scrollLeft==undefined||scrollLeft===0)
scrollLeft=win.document.body.scrollLeft;return{top:scrollTop,left:scrollLeft};}
var CLEAR_EVENTS=["onclick","ondblclick","onkeydown","onkeypress","onmousedown","onmouseup","onmousemove","onmouseover","onmouseout","onmousewheeldown","oncontextmenu"];function clearEvents(){var i,j;var count=0;if(document.all==undefined)
return;for(i=0;i<document.all.length;i++){for(j=0;j<CLEAR_EVENTS.length;j++){var event=document.all[i][CLEAR_EVENTS[j]];if(event!=undefined){document.all[i][CLEAR_EVENTS[j]]=null;count++;}}}}
if(window.attachEvent)
window.attachEvent("onunload",clearEvents);function getGallery(){var gallery=undefined;var win=window;while(gallery==undefined){try{gallery=win.document.gallery;}catch(e){break;}
var tmpWin=win;win=win.parent;if(tmpWin===win){break;}}
return gallery;}
function viewerCloseCallback(photoIndex){var i,j,n=0;var gallery=getGallery();for(i=0;i<gallery.sets.length;i++){for(j=0;j<gallery.sets[i].photos.length;j++){var p=gallery.sets[i].photos[j];if(p==undefined||p.orig==undefined||p.orig.src==undefined)
continue;if(n==photoIndex){gallery.setIndex=i;gallery.photoIndex=j;gallery.renderPhotos();gallery.win.focus();return;}
n++;}}}
var VIEWER_INDEX=0;var SLIDE_DURATION=4000;var SLIDE_OFFSET=50;var SLIDE_PHOTOS=true;var FADE_BORDER=false;var FADE_STEPS=10;var MOVE_STEP=1;var PRELOAD_TIMEOUT=60000;var BORDER_WIDTH=5;var FONT_SIZE=10;var OFFSET_LEFT=0;var OFFSET_TOP=0;var REST_URL="/rest/";var P_IMG_ROOT="images";var TOOLBAR_IMG="toolbar.png";var TOOLBAR_IMG_RUNNING="toolbar2.png";var TOOLBAR_IMG_BACK="toolbar-back";var TOOLBAR_IMG_MASK="toolbar-mask.png";var TOOLBAR_IMG_LOADING="loading-anim.gif";var TOOLBAR_W=440;var TOOLBAR_H=75;var TOOLBAR_IMG_W=420;var TOOLBAR_IMG_H=44;var TOOLBAR_LINK="http://slideshow.triptracker.net";var TOOLBAR_FONT_COLOR="#c0c0c0";var TOOLBAR_FONT_STYLE="tahoma, verdana, arial, helvetica, sans-serif";var VIEWER_ID_PREFIX="PhotoViewer";var VIEWER_ID_BACK=VIEWER_ID_PREFIX+"Back";var VIEWER_ID_TOOLBAR=VIEWER_ID_PREFIX+"Toolbar";var VIEWER_ID_TOOLBAR_MAP=VIEWER_ID_PREFIX+"ToolbarMap";var VIEWER_ID_TOOLBAR_IMG=VIEWER_ID_PREFIX+"ToolbarImg";var VIEWER_ID_LOADING=VIEWER_ID_PREFIX+"Loading";var VIEWER_ID_TIME=VIEWER_ID_PREFIX+"Time";var VIEWER_ID_TITLE=VIEWER_ID_PREFIX+"Title";var VIEWER_ID_BYLINE=VIEWER_ID_PREFIX+"Byline";var TITLE_MAX_LENGTH=140;function PhotoViewer(win,handleKeys){this.setImageRoot=setImageRoot;this.add=addPhoto;this.show=showPhoto;this.close=closePhoto;this.isShown=isPhotoShown;this.setBackground=setPhotoBackground;this.setShowToolbar=setShowToolbar;this.setToolbarImage=setToolbarImage;this.setShowCallback=setShowCallback;this.setCloseCallback=setCloseCallback;this.setEndCallback=setEndCallback;this.setLoading=setPhotoLoading;this.addBackShade=addBackShade;this.addToolbar=addToolbar;this.addCaptions=addCaptions;this.next=nextPhoto;this.prev=prevPhoto;this.first=firstPhoto;this.last=lastPhoto;this.slideShow=slideShow;this.slideShowStop=slideShowStop;this.startSlideShow=startSlideShow;this.handleKey=viewerHandleKey;this.checkStartFragmentIdentifier=checkStartFragmentIdentifier;this.checkStopFragmentIdentifier=checkStopFragmentIdentifier;this.setStartFragmentIdentifier=setStartFragmentIdentifier;this.setStopFragmentIdentifier=setStopFragmentIdentifier;this.email=emailPhoto;this.favorite=favoritePhoto;this.permalink=linkPhoto;this.setBackgroundColor=setBackgroundColor;this.setBorderWidth=setBorderWidth;this.setSlideDuration=setSlideDuration;this.disablePanning=disablePanning;this.enablePanning=enablePanning;this.disableFading=disableFading;this.enableFading=enableFading;this.disableShade=disableShade;this.enableShade=enableShade;this.setShadeColor=setShadeColor;this.setShadeOpacity=setShadeOpacity;this.setFontSize=setFontSize;this.setFont=setFont;this.enableAutoPlay=enableAutoPlay;this.disableAutoPlay=disableAutoPlay;this.enableEmailLink=enableEmailLink;this.disableEmailLink=disableEmailLink;this.enablePhotoLink=enablePhotoLink;this.disablePhotoLink=disablePhotoLink;this.setOnClickEvent=setOnClickEvent;this.enableLoop=enableLoop;this.disableLoop=disableLoop;this.hideOverlappingElements=hideOverlappingElements;this.showOverlappingElements=showOverlappingElements;this.id=VIEWER_ID_PREFIX+VIEWER_INDEX;VIEWER_INDEX++;this.photos=[];this.index=0;this.win=(win!=undefined?win:window);this.shown=false;this.showToolbar=true;this.backgroundColor="#000000";this.shadeColor="#000000";this.shadeOpacity=0.7;this.borderColor="#000000";this.shadeColor="#000000";this.shadeOpacity=0.7;this.borderWidth=BORDER_WIDTH;this.backgroundShade=true;this.fadePhotos=true;this.autoPlay=false;this.enableEmailLink=true;this.enablePhotoLink=true;this.slideDuration=SLIDE_DURATION;this.panPhotos=SLIDE_PHOTOS;this.fontSize=FONT_SIZE;this.font=undefined;if(handleKeys==undefined||handleKeys){if(this.win.addEventListener){this.win.addEventListener("keydown",viewerHandleKey,false);}else{this.win.document.attachEvent("onkeydown",viewerHandleKey);}}
this.win.document.viewer=this;if(OPERA)
this.disableFading();}
function PhotoImg(id,src,w,h,time,title,byline){this.id=id;this.src=src;this.w=parseInt(w);this.h=parseInt(h);this.time=time;this.title=title;this.byline=byline;}
function getViewer(){var viewer=undefined;var win=window;while(viewer==undefined){try{viewer=win.document.viewer;}catch(e){break;}
if(win===win.parent){break;}
win=win.parent;}
return viewer;}
function setImageRoot(root){P_IMG_ROOT=root;}
function addPhoto(photo,title,time,byline){var type=typeof photo;if(typeof photo=="string"){photo=new PhotoImg(undefined,photo,undefined,undefined,time,title,byline);}
this.photos.push(photo);}
function setPhotoBackground(color,border,doShade){if(color!=undefined)
this.backgroundColor=color;if(border!=undefined)
this.borderColor=border;if(doShade!=undefined)
this.backgroundShade=doShade;}
function setPhotoLoading(isLoading){this.isLoading=isLoading;var elt=this.win.document.getElementById(VIEWER_ID_LOADING);if(elt==undefined)
return;elt.style.display=isLoading?"":"none";}
function setBackgroundColor(color){this.backgroundColor=color;this.borderColor=color;}
function setBorderWidth(width){this.borderWidth=width;}
function setSlideDuration(duration){this.slideDuration=duration;}
function disableShade(){this.backgroundShade=false;}
function enableShade(){this.backgroundShade=true;}
function setShadeColor(color){this.shadeColor=color;}
function setShadeOpacity(opacity){this.shadeOpacity=opacity;}
function disableFading(){this.fadePhotos=false;}
function enableFading(){this.fadePhotos=true;}
function disablePanning(){this.panPhotos=false;}
function enablePanning(){this.panPhotos=true;}
function setFontSize(size){this.fontSize=size;}
function setFont(font){this.font=font;}
function enableAutoPlay(){this.autoPlay=true;}
function disableAutoPlay(){this.autoPlay=false;}
function enableEmailLink(){this.enableEmailLink=true;}
function disableEmailLink(){this.enableEmailLink=false;}
function enablePhotoLink(){this.enablePhotoLink=true;}
function disablePhotoLink(){this.enablePhotoLink=false;}
function setOnClickEvent(newfunc){this.customOnClickEvent=newfunc;}
function enableLoop(){this.loop=true;}
function disableLoop(){this.loop=false;}
function showPhoto(index,cropWidth,opacity){if(this.photos.length===0){return true;}
if(getRootWindow().permissionDenied){this.setStartFragmentIdentifier(index);return true;}
if(index!=undefined)
this.index=index;if(this.index<0||this.index>=this.photos.length){log.error("Invalid photo index");return true;}
var doc=this.win.document;var firstShow=false;if(!this.shown){firstShow=true;doc.viewer=this;try{this.hideOverlappingElements();}catch(e){}}
var zIndex=16384;var winSize=getWindowSize(this.win);var availW=winSize.w-20;var availH=winSize.h-20;var scrollPos=getScrollPos(this.win);var scrollLeft=scrollPos.left;var scrollTop=scrollPos.top;this.addBackShade(zIndex);if(this.showToolbar){this.addToolbar(availW,zIndex);this.addCaptions();}
var photo=this.photos[this.index];if(isNaN(photo.w)||isNaN(photo.h)){if(photo.preloadImage!=undefined){if(isNaN(photo.w)&&photo.preloadImage.width>0)
photo.w=photo.preloadImage.width;if(isNaN(photo.h)&&photo.preloadImage.height>0)
photo.h=photo.preloadImage.height;}else{this.index--;this.next();return false;}}
this.shown=true;var offset=20;var pw=-1;var ph=-1;if(parseInt(photo.w)>availW||parseInt(photo.h)>availH){if(parseInt(photo.w)/availW>parseInt(photo.h)/availH){pw=availW-offset;ph=parseInt(pw*photo.h/photo.w);}else{ph=availH-offset;pw=parseInt(ph*photo.w/photo.h);}}else{pw=parseInt(photo.w);ph=parseInt(photo.h);}
if(pw<=0||ph<=0){if(!this.showToolbar)
throw"Missing photo dimension";}
if(cropWidth==undefined)
cropWidth=0;var photoDiv=doc.createElement("div");photoDiv.style.visibility="hidden";photoDiv.style.position="absolute";photoDiv.style.zIndex=zIndex;photoDiv.style.overflow="hidden";photoDiv.style.border=this.borderWidth+"px solid "+this.borderColor;photoDiv.style.textAlign="center";photoDiv.style.backgroundColor=this.backgroundColor;var photoElt=doc.createElement("img");photoElt.style.visibility="hidden";photoElt.style.position="relative";photoElt.style.backgroundColor=this.backgroundColor;photoElt.style.border="none";photoElt.style.cursor="pointer";photoElt.style.zIndex=(parseInt(photoDiv.style.zIndex)+1)+"";photoElt.onclick=onClickEvent;if(opacity!=undefined&&this.fadePhotos){var fadeElt=(FADE_BORDER?photoDiv:photoElt);setOpacity(fadeElt,opacity);}
var left=parseInt((availW-pw)/2)+OFFSET_LEFT;photoDiv.style.left=(left+scrollLeft+cropWidth/2)+"px";var top=parseInt((availH-ph)/2)+OFFSET_TOP;photoDiv.style.top=(top+scrollTop)+"px";photoElt.style.visibility="hidden";photoDiv.style.width=(pw-cropWidth)+"px";photoDiv.style.height=ph+"px";photoElt.style.width=pw+"px";photoElt.style.height=ph+"px";photoElt.src=photo.src;photoDiv.style.visibility="visible";photoElt.style.visibility="visible";photoDiv.appendChild(photoElt);doc.body.appendChild(photoDiv);if(this.photoDiv!=undefined){try{doc.body.removeChild(this.photoDiv);}catch(e){}}
this.photoDiv=photoDiv;this.photoImg=photoElt;this.setLoading(false);if(this.showCallback!=undefined)
this.showCallback(this.index);if(firstShow&&this.autoPlay){this.slideShow(true);}
return false;}
function isPhotoShown(){return this.shown;}
function closeViewer(){getViewer().close();}
function onPhotoLoad(event){var viewer=getViewer();if(viewer!=undefined){if(flickrHack(viewer,viewer.index)){viewer.setLoading(false);viewer.index--;viewer.next();return;}
viewer.show();}}
function closePhoto(){var win=this.win;if(win==undefined)
win=window;var doc=win.document;var elt=this.photoDiv;if(elt!=undefined)
doc.body.removeChild(elt);elt=doc.getElementById(VIEWER_ID_BACK);if(elt!=undefined)
doc.body.removeChild(elt);elt=doc.getElementById(VIEWER_ID_TOOLBAR);if(elt!=undefined)
doc.body.removeChild(elt);this.shown=false;this.slideShowRunning=false;this.slideShowPaused=false;try{this.showOverlappingElements();}catch(e){}
if(this.closeCallback!=undefined)
this.closeCallback(this.index);}
function nextPhoto(n){if(this.isLoading)
return;if(n==undefined)
n=1;var oldIndex=this.index;if(this.index+n>=this.photos.length){if(this.loop&&n!=this.photos.length){this.index=0;}else{this.index=this.photos.length-1;}}else if(this.index+n<0){if(n<-1)
this.index=0;else if(this.loop)
this.index=this.photos.length-1;else
return;}else{this.index+=n;}
if(this.index==oldIndex)
return;this.slideShowStop();var img=new Image();this.photos[this.index].preloadImage=img;this.setLoading(true);img.onload=onPhotoLoad;img.onerror=onPhotoLoad;if(this.photos[this.index].src!=undefined){img.src=this.photos[this.index].src;}else{onPhotoLoad();}}
function prevPhoto(n){if(n==undefined)
n=1;this.next(-n);}
function firstPhoto(){this.prev(this.photos.length);}
function lastPhoto(){this.next(this.photos.length);}
function startSlideShow(){getViewer().slideShow(true);}
var slideTimeout;var slidePreloadImageLoaded=false;var slidePreloadTime=undefined;function slideShow(start){var nextIndex=this.index+1;if(nextIndex>=this.photos.length){if(this.loop)
nextIndex=0;else if(!this.slideShowPaused&&!this.slideShowRunning){this.setToolbarImage(P_IMG_ROOT+"/"+TOOLBAR_IMG);return;}}
var doc=this.win.document;var viewer=this;var photoElt=this.photoImg;if(photoElt==undefined)
return;var photoDiv=this.photoDiv;var fadeElt=(FADE_BORDER?photoDiv:photoElt);if(start!=undefined&&start===true){if(this.slideShowPaused){this.slideShowPaused=false;this.setToolbarImage(P_IMG_ROOT+"/"+TOOLBAR_IMG_RUNNING);return;}else if(this.slideShowRunning){this.slideShowPaused=true;this.setToolbarImage(P_IMG_ROOT+"/"+TOOLBAR_IMG);return;}else{this.slideShowRunning=true;this.slideShowPaused=false;this.slideFirstPhoto=true;this.setToolbarImage(P_IMG_ROOT+"/"+TOOLBAR_IMG_RUNNING);}
if(this.isLoading||this.index>=this.photos.length-1){return;}}else if(this.slideShowPaused){window.setTimeout(function(){viewer.slideShow(false);},200);return;}else if(!this.slideShowRunning){this.setToolbarImage(P_IMG_ROOT+"/"+TOOLBAR_IMG);return;}
var left=0;if(photoElt.leftOffset!=undefined){left=parseFloat(photoElt.leftOffset);}
if(left===0){if(nextIndex<this.photos.length){slidePreloadImageLoaded=false;var slidePreloadImage=new Image();this.photos[nextIndex].preloadImage=slidePreloadImage;slidePreloadTime=getTimeMillis();slidePreloadImage.onload=onSlideLoad;slidePreloadImage.onerror=onSlideLoad;slidePreloadImage.src=this.photos[nextIndex].src;}}
if(left>-SLIDE_OFFSET){left-=MOVE_STEP;if(-left<=FADE_STEPS){if(fadeElt.style.opacity!=undefined&&parseFloat(fadeElt.style.opacity)<1){if(this.fadePhotos&&this.photos[this.index].src!=undefined)
setOpacity(fadeElt,-left/FADE_STEPS);}}else if(left+SLIDE_OFFSET<FADE_STEPS){if(nextIndex<this.photos.length&&!slidePreloadImageLoaded){if(slidePreloadTime!=undefined&&getTimeMillis()-slidePreloadTime>PRELOAD_TIMEOUT)
slidePreloadImageLoaded=true;left++;this.setLoading(true);}else{if(nextIndex<this.photos.length&&this.fadePhotos&&this.photos[this.index].src!=undefined)
setOpacity(fadeElt,(left+SLIDE_OFFSET)/FADE_STEPS);}}
photoElt.leftOffset=left;if(this.panPhotos&&!this.slideFirstPhoto){photoElt.style.left=left+"px";}}else{if(nextIndex>=this.photos.length){this.slideShowRunning=false;this.slideShowPaused=false;this.setToolbarImage(P_IMG_ROOT+"/"+TOOLBAR_IMG);if(this.endCallback!=undefined)
this.endCallback();return;}
this.index=nextIndex;this.slideFirstPhoto=false;this.show(undefined,(this.panPhotos?SLIDE_OFFSET:0),0);fadeElt=(FADE_BORDER?this.photoDiv:this.photoImg);if(this.fadePhotos)
setOpacity(fadeElt,0);this.photoImg.leftOffset=0;if(this.panPhotos)
this.photoImg.style.left="0px";}
var pause=this.slideDuration/SLIDE_OFFSET;if(this.slideFirstPhoto){pause/=2;}
slideTimeout=window.setTimeout(function(){viewer.slideShow(false);},pause);}
function onSlideLoad(event){var viewer=getViewer();if(viewer!=undefined){if(flickrHack(viewer,viewer.index+1)){var slidePreloadImage=viewer.photos[viewer.index+1].preloadImage;slidePreloadImage.src=viewer.photos[viewer.index+1].src;slidePreloadTime=getTimeMillis();return;}
slidePreloadImageLoaded=true;viewer.setLoading(false);}}
function slideShowStop(){this.slideShowRunning=false;this.slideShowPaused=false;var doc=this.win.document;var photoElt=this.photoImg;if(photoElt!=undefined){if(this.fadePhotos){var fadeElt=(FADE_BORDER?this.photoDiv:photoElt);setOpacity(fadeElt,1);}
photoElt.style.left="0px";}}
function addBackShade(zIndex){var doc=this.win.document;if(doc.getElementById(VIEWER_ID_BACK)!=undefined){return;}
var photoBack=doc.createElement("div");photoBack.id=VIEWER_ID_BACK;photoBack.style.top="0px";photoBack.style.left="0px";photoBack.style.bottom="0px";photoBack.style.right="0px";photoBack.style.margin="0";photoBack.style.padding="0";photoBack.style.border="none";photoBack.style.cursor="pointer";if(IE&&!(IE7&&STRICT_MODE)){photoBack.style.position="absolute";var docSize=getDocumentSize(this.win);photoBack.style.width=(docSize.w-21)+"px";photoBack.style.height=(docSize.h-4)+"px";}else{photoBack.style.position="fixed";photoBack.style.width="100%";photoBack.style.height="100%";}
photoBack.style.zIndex=zIndex-1;photoBack.style.backgroundColor=this.shadeColor;if(this.backgroundShade)
setOpacity(photoBack,this.shadeOpacity);else
setOpacity(photoBack,0.0);photoBack.onclick=onClickEvent;doc.body.appendChild(photoBack);}
function addToolbar(availW,zIndex){var doc=this.win.document;var i;if(doc.getElementById(VIEWER_ID_TOOLBAR)!=undefined)
return;var photoToolbar=doc.createElement("div");photoToolbar.id=VIEWER_ID_TOOLBAR;var bottom=10;if(IE&&!(IE7&&STRICT_MODE)){photoToolbar.style.position="absolute";if(IE7){var top=getWindowSize(this.win).h+getScrollPos(this.win).top;photoToolbar.style.top=(top-TOOLBAR_H-10)+"px";}else{photoToolbar.style.bottom=bottom+"px";}}else{photoToolbar.style.position="fixed";photoToolbar.style.bottom=bottom+"px";}
photoToolbar.style.left=(availW-TOOLBAR_W+10)/2+"px";photoToolbar.style.width=TOOLBAR_W+"px";photoToolbar.style.height=TOOLBAR_H+"px";photoToolbar.style.textAlign="center";setOpacity(photoToolbar,0.7);photoToolbar.style.zIndex=zIndex+1;var imgBack=TOOLBAR_IMG_BACK;if(!isHosted()){imgBack+="-nologo";}
if(IE&&!IE7){imgBack+="-indexed";}
imgBack+=".png";photoToolbar.style.backgroundImage="url(\'"+P_IMG_ROOT+"/"+imgBack+"\')";photoToolbar.style.backgroundPosition="50% 0%";photoToolbar.style.backgroundRepeat="no-repeat";if(STRICT_MODE){photoToolbar.style.lineHeight="0.8em";}
var toolbarMask=undefined;if(!this.enableEmailLink){toolbarMask=doc.createElement("img");toolbarMask.style.position="absolute";toolbarMask.style.width=44;toolbarMask.style.height=44;toolbarMask.style.left="289px";toolbarMask.style.top="0px";toolbarMask.src=P_IMG_ROOT+"/"+TOOLBAR_IMG_MASK;photoToolbar.appendChild(toolbarMask);}
if(!this.enablePhotoLink){toolbarMask=doc.createElement("img");toolbarMask.style.position="absolute";toolbarMask.style.width=44;toolbarMask.style.height=44;toolbarMask.style.left="339px";toolbarMask.style.top="0px";toolbarMask.src=P_IMG_ROOT+"/"+TOOLBAR_IMG_MASK;photoToolbar.appendChild(toolbarMask);}
var imgMap=doc.createElement("map");imgMap.name=VIEWER_ID_TOOLBAR_MAP;imgMap.id=VIEWER_ID_TOOLBAR_MAP;var areas=[];areas.push(["getViewer().first()","17",getMessage("photoviewer.toolbar.first")]);areas.push(["getViewer().prev()","68",getMessage("photoviewer.toolbar.prev")]);areas.push(["getViewer().slideShow(true)","122",getMessage("photoviewer.toolbar.slideShow")]);areas.push(["getViewer().next()","175",getMessage("photoviewer.toolbar.next")]);areas.push(["getViewer().last()","227",getMessage("photoviewer.toolbar.last")]);areas.push(["getViewer().close()","402",getMessage("photoviewer.toolbar.close")]);for(i=0;i<areas.length;i++){var area=doc.createElement("area");area.href="javascript:void(0)";area.alt=areas[i][2];area.title=area.alt;area.shape="circle";area.coords=areas[i][1]+", 21, 22";area.onclick=buildAreaMapClosure(areas[i][0]);imgMap.appendChild(area);}
var img=doc.createElement("img");img.id=VIEWER_ID_TOOLBAR_IMG;img.src=P_IMG_ROOT+"/"+TOOLBAR_IMG;img.width=TOOLBAR_IMG_W;img.height=TOOLBAR_IMG_H;img.style.border="none";img.style.background="none";img.style.margin="4px";img.useMap="#"+VIEWER_ID_TOOLBAR_MAP;photoToolbar.appendChild(imgMap);photoToolbar.appendChild(img);
var loadingIcon=doc.createElement("img");loadingIcon.id=VIEWER_ID_LOADING;loadingIcon.width=16;loadingIcon.height=16;loadingIcon.style.display="none";loadingIcon.style.position="absolute";loadingIcon.style.left=(273-8)+"px";loadingIcon.style.top=(24-8)+"px";loadingIcon.src=P_IMG_ROOT+"/"+TOOLBAR_IMG_LOADING;loadingIcon.style.border="none";loadingIcon.style.background="none";photoToolbar.appendChild(loadingIcon);photoToolbar.appendChild(doc.createElement("br"));var photoTime=doc.createElement("span");photoTime.id=VIEWER_ID_TIME;photoTime.position="relative";photoTime.style.color=TOOLBAR_FONT_COLOR;photoTime.style.fontFamily=TOOLBAR_FONT_STYLE;photoTime.style.fontSize=this.fontSize+"px";if(STRICT_MODE){photoTime.style.lineHeight=this.fontSize+"px";}
if(this.font!=undefined){photoTime.style.font=this.font;}
photoTime.style.cssFloat="none";photoTime.style.textAlign="right";photoTime.style.padding="0px 10px";photoTime.appendChild(doc.createTextNode(" "));photoToolbar.appendChild(photoTime);var photoTitle=doc.createElement("span");photoTitle.id=VIEWER_ID_TITLE;photoTitle.position="relative";photoTitle.style.color=TOOLBAR_FONT_COLOR;photoTitle.style.fontFamily=TOOLBAR_FONT_STYLE;photoTitle.style.fontSize=this.fontSize+"px";if(STRICT_MODE){photoTitle.style.lineHeight=this.fontSize+"px";}
if(this.font!=undefined){photoTitle.style.font=this.font;}
photoTitle.style.cssFloat="none";photoTitle.style.textAlign="left";photoTitle.style.paddingRight="20px";photoTitle.appendChild(doc.createTextNode(" "));photoToolbar.appendChild(photoTitle);doc.body.appendChild(photoToolbar);var photoByline=doc.createElement("div");photoByline.appendChild(doc.createTextNode(""));photoByline.style.color=TOOLBAR_FONT_COLOR;photoByline.style.fontFamily=TOOLBAR_FONT_STYLE;photoByline.style.fontSize=this.fontSize+"px";if(this.font!=undefined){photoByline.style.font=this.font;}
photoByline.id=VIEWER_ID_BYLINE;photoByline.style.position="absolute";photoByline.style.right="5px";photoByline.style.bottom="5px";photoByline.style.zIndex=zIndex+1;photoByline.appendChild(doc.createTextNode(" "));doc.body.appendChild(photoByline);}
function buildAreaMapClosure(func){return function(event){eval(func);blurElement(event);return false;};}
function blurElement(event){var target=getEventTarget(getEvent(event));if(target!=undefined)
target.blur();}
function setToolbarImage(img){var doc=this.win.document;var elt=doc.getElementById(VIEWER_ID_TOOLBAR_IMG);if(elt!=undefined)
elt.src=img;}
function setShowToolbar(doShow){this.showToolbar=doShow;}
function addCaptions(){var photo=this.photos[this.index];var doc=this.win.document;var photoTime=doc.getElementById(VIEWER_ID_TIME);var photoTitle=doc.getElementById(VIEWER_ID_TITLE);var photoByline=doc.getElementById(VIEWER_ID_BYLINE);var time=(this.index+1)+"/"+this.photos.length;if(photo.time!=undefined){time+=" ["+photo.time+"]";}
photoTime.firstChild.nodeValue=time;var title=(photo.title!=undefined?photo.title:"");photoTitle.title="";photoTitle.alt="";if(title.length>TITLE_MAX_LENGTH){photoTitle.title=title;photoTitle.alt=title;title=title.substring(0,TITLE_MAX_LENGTH)+" ...";}
if(title.indexOf("\n")!==0){title=title.replace("\n","<br />");photoTitle.innerHTML=title;}else{photoTitle.nodeValue=title;}
if(photo.byline!=undefined&&photo.byline.length>0){photoByline.firstChild.nodeValue=photo.byline;}else{photoByline.firstChild.nodeValue="";}}
function setCloseCallback(callback){this.closeCallback=callback;}
function setShowCallback(callback){this.showCallback=callback;}
function setEndCallback(callback){this.endCallback=callback;}
function emailPhoto(){var photo=this.photos[this.index];var doc=this.win.document;var title=(photo.title!=undefined?photo.title:getMessage("photoviewer.email.subject.photo"));var mailtoLink="mailto:?subject="+title+"&body="+
getPhotoURL(photo.src);doc.location.href=mailtoLink;}
function getPhotoURL(url){var loc=document.location;if(/\w+:\/\/.+/.test(url)){return url;}else if(url.indexOf("/")===0){return loc.protocol+"//"+loc.host+url;}else{var path=loc.pathname;var pos=path.lastIndexOf("/");if(pos!=-1){path=path.substring(0,pos);}
return loc.protocol+"//"+loc.host+path+"/"+url;}}
function linkPhoto(){var photo=this.photos[this.index];window.open(photo.src);}
function favoritePhoto(){var photo=this.photos[this.index];var doc=this.win.document;var restURL=REST_URL+"markfeatured?id"+photo.id;try{var res=getResponse(restURL,false,true);}catch(e){return;}}
function hideOverlappingElements(node){if(node==undefined){node=this.win.document.body;this.hideOverlappingElements(node);return;}
if(node.style!=undefined&&node.style.visibility!="hidden"){var nodeName=node.nodeName.toLowerCase();if((node.className!=undefined&&node.className.indexOf("SlideshowDoHide")!=-1)||(IE&&(nodeName=="select"||nodeName=="object"||nodeName=="embed"))){node.style.visibility="hidden";if(this.hiddenElements==undefined)
this.hiddenElements=[];this.hiddenElements.push(node);}}
if(node.childNodes!=undefined){var i;for(i=0;i<node.childNodes.length;i++){this.hideOverlappingElements(node.childNodes[i]);}}}
function showOverlappingElements(){var i;if(this.hiddenElements!=undefined){for(i=0;i<this.hiddenElements.length;i++){this.hiddenElements[i].style.visibility="visible";}
this.hiddenElements=[];}}
function viewerHandleKey(event){if(!getViewer)
return true;var viewer=getViewer();if(viewer==undefined||!viewer.shown)
return true;event=getEvent(event);if(event.ctrlKey||event.altKey)
return true;var keyCode=event.keyCode;switch(keyCode){case 37:case 38:viewer.prev();break;case 39:case 40:viewer.next();break;case 33:viewer.prev(10);break;case 34:viewer.next(10);break;case 36:viewer.first();break;case 35:viewer.last();break;case 32:case 13:viewer.slideShow(true);break;case 27:viewer.close();break;default:return true;}
preventDefault(event);return false;}
function flickrHack(viewer,index){if(viewer.photos[index]!=undefined){var preloadPhoto=viewer.photos[index].preloadImage;if(preloadPhoto!=undefined&&preloadPhoto.width==500&&preloadPhoto.height==375){var flickrRE=/.+static\.flickr\.com.+_b\.jpg/;if(flickrRE.test(preloadPhoto.src)){viewer.photos[index].src=viewer.photos[index].src.replace(/_b\.jpg/,"_o.jpg");return true;}}}
return false;}
function findPhotosTT(viewer,node){var i;if(node.nodeName.toLowerCase()=="a"){var onclick=node.getAttribute("onclick");if(onclick==undefined){onclick=node.onclick;}
if(onclick!=undefined&&new String(onclick).indexOf("popupImg")!=-1){var popupRE=/.*popupImg\((.+?),(.+?),(.+?)\).*/;if(popupRE.test(onclick)){var url,w,h;if(node.photoUrl!=undefined){url=node.photoUrl;w=node.photoW;h=node.photoH;}
else{url=RegExp.$1;if(url.charAt(0)=="'"&&url.charAt(url.length-1)=="'")
url=url.substring(1,url.length-1);w=parseInt(RegExp.$2);h=parseInt(RegExp.$3);}
var photo=new PhotoImg(undefined,url,w,h);var found=false;for(i=0;i<viewer.photos.length;i++){if(viewer.photos[i].src==photo.src){found=true;break;}}
if(!found)
viewer.add(photo);}}}
if(node.childNodes!=undefined){for(i=0;i<node.childNodes.length;i++){findPhotosTT(viewer,node.childNodes[i]);}
}
}
var defaultViewer=undefined;function popupImg(url,w,h,backColor,showToolbar){var i;if(defaultViewer==undefined)
defaultViewer=new PhotoViewer();else{defaultViewer.photos=[];defaultViewer.index=0;}
if(backColor!=undefined)
defaultViewer.setBackground(backColor,backColor,false);if(showToolbar==undefined||showToolbar){findPhotosTT(defaultViewer,window.document.body);for(i=0;i<defaultViewer.photos.length;i++){if(defaultViewer.photos[i].src==url){defaultViewer.show(i);}
}
}
if(defaultViewer.photos===undefined||defaultViewer.photos.length===0){defaultViewer.setShowToolbar(false);defaultViewer.add(new PhotoImg(undefined,url,w,h));defaultViewer.show();}
return false;}
function onClickEvent()
{ 
var v=getViewer();if(v.customOnClickEvent!=undefined)
v.customOnClickEvent();else
closeViewer();}
function setupFragmentIdentifierModePhotoViewer(iframeLocation,iframename,viewerJSONArray){var viewer=new PhotoViewer();viewer.origRootLocation=document.location.href;viewer.origIFrameLocation=iframeLocation;viewer.iframename=iframename;viewer.setCloseCallback(viewer.setStopFragmentIdentifier);for(var i=0;i<viewerJSONArray.length;i++){viewer.add(viewerJSONArray[i].url,viewerJSONArray[i].title,viewerJSONArray[i].date,viewerJSONArray[i].byline);}
window.frames[viewer.iframename].location=viewer.origIFrameLocation+"#"+viewer.origRootLocation;viewer.checkStartFragmentIdentifier();}
function checkStartFragmentIdentifier(){var href=document.location.href;if(href.indexOf("#startphoto=")==-1){window.setTimeout(checkStartFragmentIdentifier,500);}
else{var startPhoto=parseInt(href.substring(href.lastIndexOf("=")+1));var viewer=getViewer();if(viewer.origRootLocation.indexOf("#")==-1)
viewer.origRootLocation+="#";if(FIREFOX){window.history.back();}
else{document.location.href=viewer.origRootLocation;}
viewer.show(startPhoto);}
}
function setStopFragmentIdentifier(index){window.frames[getViewer().iframename].location=this.origIFrameLocation+"#stopphoto="+index;checkStartFragmentIdentifier();}
function setStartFragmentIdentifier(index){var rootWin=getRootWindow();if(this.origIFrameLocation==undefined)
this.origIFrameLocation=rootWin.location.href.substring(0,rootWin.location.href.indexOf("#"));if(this.origRootLocation==undefined)
this.origRootLocation=rootWin.location.href.substring(rootWin.location.href.indexOf("#")+1);this.checkStopFragmentIdentifier();var frIdentifier="#startphoto="+index;rootWin.parent.location=this.origRootLocation+frIdentifier;}
function checkStopFragmentIdentifier(){var href=getRootWindow().location.href;if(href.indexOf("#stopphoto")==-1){window.setTimeout(checkStopFragmentIdentifier,500);}
else{var viewer=getViewer();var index=href.substring(href.lastIndexOf("=")+1);if(viewer.origIFrameLocation.indexOf("#")==-1)
viewer.origIFrameLocation+="#";if(FIREFOX){window.history.back();}
else{getRootWindow().location.href=viewer.origIFrameLocation;}
viewerCloseCallback(index);}
}




/*!
 * jQuery JavaScript Library v1.4.2
 * http://jquery.com/
 *
 * Copyright 2010, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2010, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: Sat Feb 13 22:33:48 2010 -0500
 */
(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o<i;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,j);return a}return i?
e(a[0],b):w}function J(){return(new Date).getTime()}function Y(){return false}function Z(){return true}function na(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function oa(a){var b,d=[],f=[],e=arguments,j,i,o,k,n,r;i=c.data(this,"events");if(!(a.liveFired===this||!i||!i.live||a.button&&a.type==="click")){a.liveFired=this;var u=i.live.slice(0);for(k=0;k<u.length;k++){i=u[k];i.origType.replace(O,"")===a.type?f.push(i.selector):u.splice(k--,1)}j=c(a.target).closest(f,a.currentTarget);n=0;for(r=
j.length;n<r;n++)for(k=0;k<u.length;k++){i=u[k];if(j[n].selector===i.selector){o=j[n].elem;f=null;if(i.preType==="mouseenter"||i.preType==="mouseleave")f=c(a.relatedTarget).closest(i.selector)[0];if(!f||f!==o)d.push({elem:o,handleObj:i})}}n=0;for(r=d.length;n<r;n++){j=d[n];a.currentTarget=j.elem;a.data=j.handleObj.data;a.handleObj=j.handleObj;if(j.handleObj.origHandler.apply(j.elem,e)===false){b=false;break}}return b}}function pa(a,b){return"live."+(a&&a!=="*"?a+".":"")+b.replace(/\./g,"`").replace(/ /g,
"&")}function qa(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function ra(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var j in f)for(var i in f[j])c.event.add(this,j,f[j][i],f[j][i].data)}}})}function sa(a,b,d){var f,e,j;b=b&&b[0]?b[0].ownerDocument||b[0]:s;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===s&&!ta.test(a[0])&&(c.support.checkClone||!ua.test(a[0]))){e=
true;if(j=c.fragments[a[0]])if(j!==1)f=j}if(!f){f=b.createDocumentFragment();c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=j?f:1;return{fragment:f,cacheable:e}}function K(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a});return d}function wa(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Ra=A.jQuery,Sa=A.$,s=A.document,T,Ta=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/,
Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&&
(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this,
a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b===
"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,
function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(j in e){i=a[j];o=e[j];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){i=i&&(c.isPlainObject(i)||
c.isArray(i))?i:c.isArray(o)?[]:{};a[j]=c.extend(f,i,o)}else if(o!==w)a[j]=o}return a};c.extend({noConflict:function(a){A.$=Sa;if(a)A.jQuery=Ra;return c},isReady:false,ready:function(){if(!c.isReady){if(!s.body)return setTimeout(c.ready,13);c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];)a.call(s,c);Q=null}c.fn.triggerHandler&&c(s).triggerHandler("ready")}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete")return c.ready();if(s.addEventListener){s.addEventListener("DOMContentLoaded",
L,false);A.addEventListener("load",c.ready,false)}else if(s.attachEvent){s.attachEvent("onreadystatechange",L);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null}catch(b){}s.documentElement.doScroll&&a&&ma()}}},isFunction:function(a){return $.call(a)==="[object Function]"},isArray:function(a){return $.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype,
"isPrototypeOf"))return false;var b;for(b in a);return b===w||aa.call(a,b)},isEmptyObject:function(a){for(var b in a)return false;return true},error:function(a){throw a;},parseJSON:function(a){if(typeof a!=="string"||!a)return null;a=c.trim(a);if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+
a))();else c.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&Va.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,j=a.length,i=j===w||c.isFunction(a);if(d)if(i)for(f in a){if(b.apply(a[f],
d)===false)break}else for(;e<j;){if(b.apply(a[e++],d)===false)break}else if(i)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];e<j&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Wa,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=0,f=b.length;d<f;d++)if(b[d]===
a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,j=a.length;e<j;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,j=0,i=a.length;j<i;j++){e=b(a[j],j,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b==="string"){d=a;a=d[b];b=w}else if(b&&
!c.isFunction(b)){d=b;b=w}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version}if(c.browser.webkit)c.browser.safari=
true;if(ya)c.inArray=function(a,b){return ya.call(b,a)};T=c(s);if(s.addEventListener)L=function(){s.removeEventListener("DOMContentLoaded",L,false);c.ready()};else if(s.attachEvent)L=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",L);c.ready()}};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+J();d.style.display="none";d.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected,
parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent=
false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n=
s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true,
applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando];
else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,
a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===
w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i,
cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className){for(var j=" "+e.className+" ",
i=e.className,o=0,k=b.length;o<k;o++)if(j.indexOf(" "+b[o]+" ")<0)i+=" "+b[o];e.className=c.trim(i)}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(k){var n=c(this);n.removeClass(a.call(this,k,n.attr("class")))});if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var j=(" "+e.className+" ").replace(Aa," "),i=0,o=b.length;i<o;i++)j=j.replace(" "+b[i]+" ",
" ");e.className=c.trim(j)}else e.className=""}return this},toggleClass:function(a,b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var j=c(this);j.toggleClass(a.call(this,e,j.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,j=0,i=c(this),o=b,k=a.split(ca);e=k[j++];){o=f?o:!i.hasClass(e);i[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=
this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(Aa," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j<d;j++){var i=
e[j];if(i.selected){a=c(i).val();if(b)return a;f.push(a)}}return f}if(Ba.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Za,"")}return w}var o=c.isFunction(a);return this.each(function(k){var n=c(this),r=a;if(this.nodeType===1){if(o)r=a.call(this,k,n.val());if(typeof r==="number")r+="";if(c.isArray(r)&&Ba.test(this.type))this.checked=c.inArray(n.val(),r)>=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected=
c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");
a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g,
function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split(".");
k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a),
C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B<r.length;B++){u=r[B];if(d.guid===u.guid){if(i||k.test(u.namespace)){f==null&&r.splice(B--,1);n.remove&&n.remove.call(a,u)}if(f!=
null)break}}if(r.length===0||f!=null&&r.length===1){if(!n.teardown||n.teardown.call(a,o)===false)Ca(a,e,z.handle);delete C[e]}}else for(var B=0;B<r.length;B++){u=r[B];if(i||k.test(u.namespace)){c.event.remove(a,n,u.handler,B);r.splice(B--,1)}}}if(c.isEmptyObject(C)){if(b=z.handle)b.elem=null;delete z.events;delete z.handle;c.isEmptyObject(z)&&c.removeData(a)}}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type=
e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&&
f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;
if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e<j;e++){var i=d[e];if(b||f.test(i.namespace)){a.handler=i.handler;a.data=i.data;a.handleObj=i;i=i.handler.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
fix:function(a){if(a[G])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||s;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,a.origType,c.extend({},a,{handler:oa}))},remove:function(a){var b=true,d=a.origType.replace(O,"");c.each(c.data(this,
"events").live||[],function(){if(d===this.origType.replace(O,""))return b=false});b&&c.event.remove(this,a.origType,oa)}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};var Ca=s.removeEventListener?function(a,b,d){a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=
a;this.type=a.type}else this.type=a;this.timeStamp=J();this[G]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y,
isImmediatePropagationStopped:Y};var Da=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},Ea=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ea:Da,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ea:Da)}}});if(!c.support.submitBubbles)c.event.special.submit=
{setup:function(){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length)return na("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13)return na("submit",this,arguments)})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};
if(!c.support.changeBubbles){var da=/textarea|input|select/i,ea,Fa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",
e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,
"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a,
d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j<o;j++)c.event.add(this[j],d,i,f)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&
!a.preventDefault)for(var d in a)this.unbind(d,a[d]);else{d=0;for(var f=this.length;d<f;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,f){return this.live(b,d,f,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}},
toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Ga={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e,j){var i,o=0,k,n,r=j||this.selector,
u=j?this:c(this.context);if(c.isFunction(f)){e=f;f=w}for(d=(d||"").split(" ");(i=d[o++])!=null;){j=O.exec(i);k="";if(j){k=j[0];i=i.replace(O,"")}if(i==="hover")d.push("mouseenter"+k,"mouseleave"+k);else{n=i;if(i==="focus"||i==="blur"){d.push(Ga[i]+k);i+=k}else i=(Ga[i]||i)+k;b==="live"?u.each(function(){c.event.add(this,pa(i,r),{data:f,selector:r,handler:e,origType:i,origHandler:e,preType:n})}):u.unbind(pa(i,r),e)}}return this}});c.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".split(" "),
function(a,b){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",l,m=0;g[m];m++){l=g[m];if(l.nodeType===3||l.nodeType===4)h+=l.nodeValue;else if(l.nodeType!==8)h+=a(l.childNodes)}return h}function b(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];
if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1&&!p){t.sizcache=l;t.sizset=q}if(t.nodeName.toLowerCase()===h){y=t;break}t=t[g]}m[q]=y}}}function d(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1){if(!p){t.sizcache=l;t.sizset=q}if(typeof h!=="string"){if(t===h){y=true;break}}else if(k.filter(h,[t]).length>0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift();
t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D||
g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};k.matches=function(g,h){return k(g,null,null,h)};k.find=function(g,h,l){var m,q;if(!g)return[];
for(var p=0,v=n.order.length;p<v;p++){var t=n.order[p];if(q=n.leftMatch[t].exec(g)){var y=q[1];q.splice(1,1);if(y.substr(y.length-1)!=="\\"){q[1]=(q[1]||"").replace(/\\/g,"");m=n.find[t](q,h,l);if(m!=null){g=g.replace(n.match[t],"");break}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g}};k.filter=function(g,h,l,m){for(var q=g,p=[],v=h,t,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var H in n.filter)if((t=n.leftMatch[H].exec(g))!=null&&t[2]){var M=n.filter[H],I,D;D=t[1];y=false;t.splice(1,1);if(D.substr(D.length-
1)!=="\\"){if(v===p)p=[];if(n.preFilter[H])if(t=n.preFilter[H](t,v,l,p,m,S)){if(t===true)continue}else y=I=true;if(t)for(var U=0;(D=v[U])!=null;U++)if(D){I=M(D,t,U,v);var Ha=m^!!I;if(l&&I!=null)if(Ha)y=true;else v[U]=false;else if(Ha){p.push(D);y=true}}if(I!==w){l||(v=p);g=g.replace(n.match[H],"");if(!y)return[];break}}}if(g===q)if(y==null)k.error(g);else break;q=g}return v};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var n=k.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|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},
relative:{"+":function(g,h){var l=typeof h==="string",m=l&&!/\W/.test(h);l=l&&!m;if(m)h=h.toLowerCase();m=0;for(var q=g.length,p;m<q;m++)if(p=g[m]){for(;(p=p.previousSibling)&&p.nodeType!==1;);g[m]=l||p&&p.nodeName.toLowerCase()===h?p||false:p===h}l&&k.filter(h,g,true)},">":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m<q;m++){var p=g[m];if(p){l=p.parentNode;g[m]=l.nodeName.toLowerCase()===h?l:false}}}else{m=0;for(q=g.length;m<q;m++)if(p=g[m])g[m]=
l?p.parentNode:p.parentNode===h;l&&k.filter(h,g,true)}},"":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("parentNode",h,m,g,p,l)},"~":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("previousSibling",h,m,g,p,l)}},find:{ID:function(g,h,l){if(typeof h.getElementById!=="undefined"&&!l)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var l=[];
h=h.getElementsByName(g[1]);for(var m=0,q=h.length;m<q;m++)h[m].getAttribute("name")===g[1]&&l.push(h[m]);return l.length===0?null:l}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,l,m,q,p){g=" "+g[1].replace(/\\/g,"")+" ";if(p)return g;p=0;for(var v;(v=h[p])!=null;p++)if(v)if(q^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},
CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m,
g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},
text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},
setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return h<l[3]-0},gt:function(g,h,l){return h>l[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h=
h[3];l=0;for(m=h.length;l<m;l++)if(h[l]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+q)},CHILD:function(g,h){var l=h[1],m=g;switch(l){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(l==="first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":l=h[2];var q=h[3];if(l===1&&q===0)return true;h=h[0];var p=g.parentNode;if(p&&(p.sizcache!==h||!g.nodeIndex)){var v=0;for(m=p.firstChild;m;m=
m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;p.sizcache=h}g=g.nodeIndex-q;return l===0?g===0:g%l===0&&g/l>=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m===
"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g,
h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l<m;l++)h.push(g[l]);else for(l=0;g[l];l++)h.push(g[l]);return h}}var B;if(s.documentElement.compareDocumentPosition)B=function(g,h){if(!g.compareDocumentPosition||
!h.compareDocumentPosition){if(g==h)i=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0)i=true;return g};else if("sourceIndex"in s.documentElement)B=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)i=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)i=true;return g};else if(s.createRange)B=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)i=true;return g.ownerDocument?-1:1}var l=g.ownerDocument.createRange(),m=
h.ownerDocument.createRange();l.setStart(g,0);l.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=l.compareBoundaryPoints(Range.START_TO_END,m);if(g===0)i=true;return g};(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&&
q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML="<a href='#'></a>";
if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}();
(function(){var g=s.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}:
function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q<p;q++)k(g,h[q],l);return k.filter(m,l)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=a;c.isXMLDoc=x;c.contains=E})();var eb=/Until$/,fb=/^(?:parents|prevUntil|prevAll)/,
gb=/,/;R=Array.prototype.slice;var Ia=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,j){return!!b.call(e,j,e)===d});else if(b.nodeType)return c.grep(a,function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Ua.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length;
c.find(a,this[f],b);if(f>0)for(var j=d;j<b.length;j++)for(var i=0;i<d;i++)if(b[i]===b[j]){b.splice(j--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ia(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ia(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j=
{},i;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){i=a[e];j[i]||(j[i]=c.expr.match.POS.test(i)?c(i,b||this.context):i)}for(;f&&f.ownerDocument&&f!==b;){for(i in j){e=j[i];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a===
"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",
d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?
a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType===
1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/<tbody/i,jb=/<|&#?\w+;/,ta=/<script|<object|<embed|<option|<style/i,ua=/checked\s*(?:[^=]|=\s*.checked.)/i,Ma=function(a,b,d){return hb.test(d)?
a:b+"></"+d+">"},F={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=
c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},
prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,
this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);
return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja,
""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}}else c.isFunction(a)?this.each(function(e){var j=c(this),i=j.html();j.empty().append(function(){return a.call(this,e,i)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&
this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),f=d.html();d.replaceWith(a.call(this,b,f))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(u){return c.nodeName(u,"table")?u.getElementsByTagName("tbody")[0]||
u.appendChild(u.ownerDocument.createElement("tbody")):u}var e,j,i=a[0],o=[],k;if(!c.support.checkClone&&arguments.length===3&&typeof i==="string"&&ua.test(i))return this.each(function(){c(this).domManip(a,b,d,true)});if(c.isFunction(i))return this.each(function(u){var z=c(this);a[0]=i.call(this,u,b?z.html():w);z.domManip(a,b,d)});if(this[0]){e=i&&i.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:sa(a,this,o);k=e.fragment;if(j=k.childNodes.length===
1?(k=k.firstChild):k.firstChild){b=b&&c.nodeName(j,"tr");for(var n=0,r=this.length;n<r;n++)d.call(b?f(this[n],j):this[n],n>0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]);
return this}else{e=0;for(var j=d.length;e<j;e++){var i=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["",
""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]==="<table>"&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e=
c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]?
c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja=
function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter=
Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,
"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f=
a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=
a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=/<script(.|\s)*?\/script>/gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!==
"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("<div />").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this},
serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),
function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,
global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&&
e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)?
"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache===
false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B=
false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since",
c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E||
d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x);
g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===
1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b===
"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional;
if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");
this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(la[d])f=la[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a||a===0)return this.animate(K("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a],
"olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(K("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)},
animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var j=c.extend({},e),i,o=this.nodeType===1&&c(this).is(":hidden"),k=this;for(i in a){var n=i.replace(ia,ja);if(i!==n){a[n]=a[i];delete a[i];i=n}if(a[i]==="hide"&&o||a[i]==="show"&&!o)return j.complete.call(this);if((i==="height"||i==="width")&&this.style){j.display=c.css(this,"display");j.overflow=this.style.overflow}if(c.isArray(a[i])){(j.specialEasing=
j.specialEasing||{})[i]=a[i][1];a[i]=a[i][0]}}if(j.overflow!=null)this.style.overflow="hidden";j.curAnim=c.extend({},a);c.each(a,function(r,u){var z=new c.fx(k,j,r);if(Ab.test(u))z[u==="toggle"?o?"show":"hide":u](a);else{var C=Bb.exec(u),B=z.cur(true)||0;if(C){u=parseFloat(C[2]);var E=C[3]||"px";if(E!=="px"){k.style[r]=(u||1)+E;B=(u||1)/z.cur(true)*B;k.style[r]=B+E}if(C[1])u=(C[1]==="-="?-1:1)*u+B;z.custom(B,u,E)}else z.custom(B,u,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);
this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration===
"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||
c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;
this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=
this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem,
e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||
c.fx.stop()},stop:function(){clearInterval(W);W=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in s.documentElement?
function(a){var b=this[0];if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b=
this[0];if(a)return this.each(function(r){c.offset.setOffset(this,a,r)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=b,e=b.ownerDocument,j,i=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var k=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==i;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;j=e?e.getComputedStyle(b,null):b.currentStyle;
k-=b.scrollTop;n-=b.scrollLeft;if(b===d){k+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&j.overflow!=="visible"){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=j}if(f.position==="relative"||f.position==="static"){k+=o.offsetTop;n+=o.offsetLeft}if(c.offset.supportsFixedPosition&&
f.position==="fixed"){k+=Math.max(i.scrollTop,o.scrollTop);n+=Math.max(i.scrollLeft,o.scrollLeft)}return{top:k,left:n}};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),d,f,e,j=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b);
c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a,
d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top-
f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset":
"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in
e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window);


 $.noConflict();

/************** form  Validation ****************/

var allValObj=new Array();
var my_=true;
var mz_;
var parentObj;
var na_;
var nb_='';
var nc_ = {

    _sp: function(obj, errMsgBy) {
        //obj=document.getElementById(obj);	
        if (typeof (obj) == 'string')
            obj = document.getElementById(obj);
        parentObj = obj;
        na_ = errMsgBy;
        my_ = true;
        nb_ = '';
        nc_._sq();
        if (nb_ != '' && na_ == 'alert') {
            alert(nb_);
        }

        return my_;
    },

    _sq: function() {
        var i;
        var nd_ = new Array('input', 'select', 'textarea');
        for (var j = 0; j < 3; j++) {
            var ne_ = parentObj.getElementsByTagName(nd_[j]);
            objLen = ne_.length;
            for (i = 0; i < objLen; i++) {
                var nf_ = String(ne_[i].getAttribute('rel'));
                if (nf_ != '' && nf_ != null && nf_ != 'null') {
                    allValObj.push(new Array(nd_[j], ne_[i], nf_));
                    if (nd_[j] == 'input')
                        var val = nc_._sr(ne_[i]);
                    if (nd_[j] == 'select')
                        var val = nc_._td(ne_[i], nf_);
                    if (nd_[j] == 'textarea')
                        var val = nc_._ss(ne_[i], nf_);

                }
            }
        }

    },

    _sr: function(elNo) {
        //var ng_=allValObj[elNo][1];
        var ng_ = elNo;
        switch (ng_.type.toLowerCase()) {
            case 'submit':
            case 'hidden':
            case 'password':
            case 'text':
                return nc_.__acc(ng_);
            case 'checkbox':
                // return nc_._tc(ng_);
            case 'radio':
                return nc_._tb(ng_);
        }

    },
    __acc: function(element) {

        var nh_ = String(element.getAttribute('rel')).split(',');
        mz_ = element.value;
        if (parseInt(nh_[1]) == 1 && mz_ == '') {
            nc_._tg(element);
            my_ = false;
            nc_._tf(element, nh_[0]); return true;
        }
        if (parseInt(nh_[1]) == 0 && mz_ == '') {
            nc_._tg(element);
            return true;
        }
        switch (nh_[2]) {
            case 's':
                nc_._st(element, nh_);
                break;
            case 'n':
                nc_._su(element, nh_);
                break;
            case 'f':
                nc_._sv(element, nh_);
                break;
            case 'a':
                nc_._sw(element, nh_);
                break;
            case 'd':
                nc_._sx(element, nh_);
                break;
            case 't':
                nc_._sy();
                break;
            case 'e':
                nc_._sz(element, nh_);
                break;
            case 'c':
                nc_._ta(element, nh_);
                break;
        }
    },
    _st: function(el, val) {
        nc_._tg(el);
        var ni_ = new RegExp("^[a-zA-Z]+$")
        var nj_ = ni_.test(mz_);
        if (!nj_) { my_ = false; nc_._tf(el, val[0]); return true; }
        if (val[3] && mz_.length < val[3]) { my_ = false; nc_._tf(el, val[0]); return true; }
        if (val[4] && mz_.length > val[4]) { my_ = false; nc_._tf(el, val[0]); return true; }
    },
    _su: function(el, val) {
        nc_._tg(el);
        var ni_ = new RegExp("^\\d+$");
        var nj_ = ni_.test(mz_);
        if (!nj_) { my_ = false; nc_._tf(el, val[0]); return true; }
        if (val[3] && parseInt(mz_) < parseInt(val[3])) { my_ = false; nc_._tf(el, val[0]); return true; }
        if (val[4] && parseInt(mz_) > parseInt(val[4])) { my_ = false; nc_._tf(el, val[0]); return true; }
    },
    _sv: function(el, val) {
        nc_._tg(el);
        var ni_ = new RegExp("^\\d+$");
        var nj_ = isNaN(mz_);
        // alert(nj_)
        if (nj_) { my_ = false; nc_._tf(el, val[0]); return true; }
        if (val[3] && parseInt(mz_) < parseInt(val[3])) { my_ = false; nc_._tf(el, val[0]); return true; }
        if (val[4] && parseInt(mz_) > parseInt(val[4])) { my_ = false; nc_._tf(el, val[0]); return true; }
    },
    _sw: function(el, val) {
        nc_._tg(el);
        //var ni_  = new RegExp("^[\\w]+$");
        //var nj_=ni_.test(mz_);
        // if(!nj_){my_=false;nc_._tf(el,val[0]);return true;}		
        if (val[3] && mz_.length < val[3]) { my_ = false; nc_._tf(el, val[0]); return true; }
        if (val[4] && mz_.length > val[4]) { my_ = false; nc_._tf(el, val[0]); return true; }
    },
    _sx: function(el, relVal) {
        nc_._tg(el);
        var nk_ = relVal[3];
        var ni_;
        var nl_ = new Array();
        switch (nk_) {
            case 'mm/dd/yyyy':
                nl_ = new Array(2, 1, 3);
                ni_ = new RegExp("^\([0-9][0-9]\)\/\([0-9][0-9]\)\/\([0-9]{4}\)$");
                break;
            case 'dd/mm/yyyy':
                ni_ = new RegExp("^\([0-9][0-9]\)\/\([0-9][0-9]\)\/\([0-9]{4}\)$");
                nl_ = new Array(1, 2, 3);
                break;
        }
        var nj_ = mz_.match(ni_);
        if (nj_) {
            var myD = (nj_[nl_[0]]) ? nj_[nl_[0]] : 1; var myM = nj_[nl_[1]] - 1; var myY = nj_[nl_[2]];
            var nm_ = new Date(myY, myM, myD);
            if (nm_.getFullYear() != myY || nm_.getDate() != myD || nm_.getMonth() != myM) { my_ = false; nc_._tf(el, relVal[0]); }
        } else { my_ = false; nc_._tf(el, relVal[0]); }
    },
    _sy: function() {

    },
    _sz: function(el, relVal) {
        nc_._tg(el);
        var ni_ = new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-z]{2,4}$");
        nj_ = ni_.test(mz_);
        if (!nj_) { my_ = false; nc_._tf(el, relVal[0]); }
    },

    _ta: function(el, relVal) {
        nc_._tg(el);
        obj = document.getElementById(relVal[3]);
        var nn_ = obj.value;
        if (mz_ != nn_) { my_ = false; nc_._tf(el, relVal[0]); }
    },

    _tb: function(el) {
        var no_ = document.getElementsByName(el.name);
        var val = String(el.getAttribute('rel')).split(',');
        var np_ = true;
        for (var i = 0; i < no_.length; i++)
            if (no_[i].checked)
        { np_ = false; }
        nc_._tg(no_[no_.length - 1]);
        if (np_) { my_ = false; nc_._tf(no_[no_.length - 1], val[0]); }
    },

    _tc: function(el) {
        nc_._tg(el);
        var val = String(el.getAttribute('rel')).split(',');
        if (val[2]) {
            var ne_ = parentObj.getElementsByTagName('input');
            var objLen = ne_.length;
            no_ = new Array();
            for (i = 0; i < objLen; i++) {
                if (ne_[i].type == 'checkbox') {
                    var nf_ = String(ne_[i].getAttribute('rel'));
                    if (nf_ != '' && nf_ != null && nf_ != 'null') {
                        nf_ = nf_.split(',')
                        if (nf_[2] && nf_[2] == val[2])
                            no_.push(ne_[i]);

                    }
                }
            }
            var np_ = true;
            for (var i = 0; i < no_.length; i++)
                if (no_[i].checked) { np_ = false; }
            nc_._tg(no_[no_.length - 1]);
            if (np_) { my_ = false; nc_._tf(no_[no_.length - 1], val[0]); }

        }
        else if (!el.checked)
        { my_ = false; nc_._tf(el, val[0]); };
    },

    _td: function(el, val) {
        nc_._tg(el);
        val = val.split(',');
        var i = el.selectedIndex;
        if (val[1] == 'i') {
            if (parseInt(val[2]) == i)
            { my_ = false; nc_._tf(el, val[0]); }
        }
        if (val[1] == 'v') {
            v = el.options[i].text;
            if (val[2] == v)
            { my_ = false; nc_._tf(el, val[0]); }
        }
    },

    _ss: function(el, val) {
        nc_._tg(el);
        val = val.split(',');
        if (val[1] == 1) {
            v = el.value;
            if (v == '')
            { my_ = false; nc_._tf(el, val[0]); }
            if (val[2] && val[2] > v.length)
            { my_ = false; nc_._tf(el, val[0]); }
            if (val[3] && val[3] < v.length)
            { my_ = false; nc_._tf(el, val[0]); }
        }

    },
    _tf: function(p, msg) {
        if (na_ == 'alert') {
            nb_ += msg + '\n';
        }
        else {
            p = p.parentNode;
            var m;
            m = document.createElement('span');

            if (na_ == 'bottom') {
                m.style.display = 'block';
            }

            m.innerHTML += msg;
            m.className = 'errMsg';
            p.appendChild(m);
        }
    },
    _tg: function(p) {
        p = p.parentNode;
        var preEl = nc_._th('errMsg', p);
        for (var i = 0; i < preEl.length; i++)
            preEl[i].parentNode.removeChild(preEl[i]);
    },
    _th: function(clsName, parentEl) {
        var retVal = new Array();
        if (parentEl)
            var elements = parentEl.getElementsByTagName("*");
        else
            var elements = document.getElementsByTagName("*");
        for (var i = 0; i < elements.length; i++) {
            if (elements[i].className.indexOf(" ") >= 0) {
                var classes = elements[i].className.split(" ");
                for (var j = 0; j < classes.length; j++) {
                    if (classes[j] == clsName)
                        retVal.push(elements[i]);
                }
            }
            else if (elements[i].className == clsName)
                retVal.push(elements[i]);
        }
        return retVal;
    }


}

_ti=function(obj,errMsgBy)
{
	return nc_._sp(obj,errMsgBy);
}

function _tj(StaffId,ServiceId,ServiceDay,ServiceStartTime,ServiceEndTime)
{
    if(typeof(kb_[ServiceDay +'/'+ StaffId +'/'+ServiceId ])=='undefined')
    {
        kb_[ServiceDay +'/'+StaffId +'/'+ServiceId ]=new Array();
    }    
    kb_[ServiceDay +'/'+ StaffId +'/'+ServiceId ].push(new Array(StaffId ,ServiceId ,ServiceDay ,ServiceStartTime,ServiceEndTime));

}

function __aco(num) {
    num = num.toString().replace(/\$|\,/g,'');
    if(isNaN(num))
        num = "0";
    sign = (num == (num = Math.abs(num)));
    num = Math.floor(num*100+0.50000000001);
    cents = num%100;
    num = Math.floor(num/100).toString();
    if(cents<10)
        cents = "0" + cents;
    for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
    num = num.substring(0,num.length-(4*i+3))+rg_+
    num.substring(num.length-(4*i+3));
    return (((sign)?'':'-') + '' + num + rh_ + cents);
}


var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{
			string: navigator.userAgent,
			subString: "Chrome",
			identity: "Chrome"
		},
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari",
			versionSearch: "Version"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			   string: navigator.userAgent,
			   subString: "iPhone",
			   identity: "iPhone/iPod"
	    },
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();



function __amc()
{
    var timeDiff=1440;
    
    for(var i in e_)
    {
        if (e_[i][5] != 'False')
            continue;
            
        if(e_[i][2] != 0 && timeDiff > e_[i][2])
                timeDiff=e_[i][2];
                
        for(var j in e_)
        {
            if (e_[j][5] != 'False')
                continue;
            
            var abcVal=Math.abs(e_[j][2]-e_[i][2]);
            if(abcVal != 0 && timeDiff > abcVal)
                timeDiff=abcVal;
        }
    }
    return timeDiff;
    
}function checkTimeAndService(){

    if(er_!='week'&&er_!='month' && er_!='day')
    {
        _ev(1);_gb(0);
    }
    if(er_=='week'||er_=='month' || er_=='day')
    {
        if(er_=='day')
            noOfDay=0;
        else if(er_=='week')
            noOfDay=7;
        else 
            noOfDay=42;
        var t,s;t=true;s=true;
        for(var i=1;i<=noOfDay;i++)
        {
            if($('availD'+i)){
                $('availD'+i).style.zIndex=0;
                $('availD'+i).style.display='none';
                $('notAvailD'+i).style.display='none';
                $('notAvailD'+i).style.zIndex=2;
                $('daysAllAppointment'+i).style.zIndex=0;
                $('daysAllAppointment'+i).style.display='none';
                $('daysAllAppointmentText'+i).innerHTML='';
            }
        }
        if(dj_.length==0)
        {
            _ex(iu_[5]);
            s=false;
        }
        else if(ks_ && dl_.length==0)
        {
            _ex(iu_[6]);
            s=false;
        }
        else
        {
            $("seachGif").style.display="block";
            var a=$('appointTime').value;
            if(a==kh_['Morning']||a==kh_['Afternoon']||a==kh_['Evening']||a==kh_['Night']||a==kh_['FullDay'])
            {
                setTimeout("_fz()",1)
            }
            else{
                setTimeout("_gy()",1)
            }
        }
        _ib()
    }
};
function clearArry(a,b){var c=(b.length);var d=a.length;b[c]=new Array(d);for(var k=0;k<d;k++){b[c][k]=a[k]}for(var k=0;k<d;k++){a.pop()}};Object.extend(Element,{getWidth:function(a){a=$(a);return a.offsetWidth},setWidth:function(a,w){a=$(a);a.style.width=w+"px"},setHeight:function(a,h){a=$(a);a.style.height=h+"px"},setTop:function(a,t){a=$(a);a.style.top=t+"px"},setSrc:function(a,b){a=$(a);a.src=b},setHref:function(a,b){a=$(a);a.href=b},setInnerHTML:function(a,b){a=$(a);a.innerHTML=b}});function overlay(){var a=getPageSize();Element.setHeight('overlay',a[1]);$("overlay").style.display='block';$("addEBody").style.display='block';arrowMove=0};function overlayLogin(){var a=getPageSize();Element.setHeight('overlay',a[1]);$("overlay").style.display='block';$("addEBody").style.display='block';arrowMove=0};function noOverlay(){if(arrowMove=1){$("overlay").style.display='none';$("addEBody").style.display='none';arrowMove=1;$('addE').innerHTML='Loading...<img src="images/indicator_flower.gif">'}if(fc_)fc_.stop();if(ev_){_gr('checkUserSession.aspx','','','get','_mg')}};
function getPageSize(){
var a,yScroll;
if(window.innerHeight&&window.scrollMaxY){
a=document.body.scrollWidth;
yScroll=window.innerHeight+window.scrollMaxY
}
else if(document.body.scrollHeight>document.body.offsetHeight){
a=document.body.scrollWidth;
yScroll=document.body.scrollHeight
}
else
{
a=document.body.offsetWidth;
yScroll=document.body.offsetHeight
}
var b,windowHeight;
if(self.innerHeight){
b=self.innerWidth;
windowHeight=self.innerHeight
}
else if(document.documentElement&&document.documentElement.clientHeight){
b=document.documentElement.clientWidth;
windowHeight=document.documentElement.clientHeight
}
else if(document.body){
b=document.body.clientWidth;
windowHeight=document.body.clientHeight
}
if(yScroll<windowHeight){
pageHeight=windowHeight
}
else{
pageHeight=yScroll
}
if(a<b){
pageWidth=b
}
else{
pageWidth=a
}

arrayPageSize=new Array(pageWidth,pageHeight,b,windowHeight);
return arrayPageSize;
};

function overlayLoginAvail(){var a=getPageSize();Element.setHeight('overlay',a[1]);$("overlay").style.display='block';$("monthAppointmentDiv").style.display='block'};function noOverlayAvail(){if(arrowMove=1){$("overlay").style.display='none';$("monthAppointmentDiv").style.display='none';arrowMove=1;$('monthAppointmentDiv').innerHTML='Loading...<img src="images/indicator_flower.gif">'}};function overlayX(){var a=document.getElementsByTagName("body").item(0);var b=document.createElement("div");b.setAttribute('id','overlay');b.style.display='none';a.appendChild(b);var c=getPageSize();Element.setHeight('overlay',c[1]);$("overlay").style.display='block'};function noOverlayX(){$("overlay").style.display='none'};function overlayWizard(){var a=document.getElementsByTagName("body").item(0);var b=document.createElement("div");b.setAttribute('id','overlay1');b.style.display='none';a.appendChild(b);var c=getPageSize();Element.setHeight('overlay1',c[1]);new Effect.Appear('overlay1',{duration:0.2,from:0.0,to:0.4})};function noOverlayWizard(){new Effect.Fade('overlay1',{duration:0.1,from:0.1,to:0.0})};var Behaviour={list:new Array,register:function(a){Behaviour.list.push(a)},start:function(){Behaviour.addLoadEvent(function(){Behaviour.apply()})},apply:function(){for(h=0;sheet=Behaviour.list[h];h++){for(selector in sheet){list=document.getElementsBySelector(selector);if(!list){continue}for(i=0;element=list[i];i++){sheet[selector](element)}}}},addLoadEvent:function(a){var b=window.onload;if(typeof window.onload!='function'){window.onload=a}else{window.onload=function(){b();a()}}}};Behaviour.start();function getAllChildren(e){return e.all?e.all:e.getElementsByTagName('*')};document.getElementsBySelector=function(a){if(!document.getElementsByTagName){return new Array()}var b=a.split(' ');var c=new Array(document);for(var i=0;i<b.length;i++){token=b[i].replace(/^\s+/,'').replace(/\s+$/,'');if(token.indexOf('#')>-1){var d=token.split('#');var f=d[0];var g=d[1];var l=document.getElementById(g);if((f&&l.nodeName.toLowerCase()!=f)||!l){return new Array()}c=new Array(l);continue}if(token.indexOf('.')>-1){var d=token.split('.');var f=d[0];var m=d[1];if(!f){f='*'}var n=new Array;var o=0;for(var h=0;h<c.length;h++){var p;if(f=='*'){p=getAllChildren(c[h])}else{p=c[h].getElementsByTagName(f)}for(var j=0;j<p.length;j++){n[o++]=p[j]}}c=new Array;var q=0;for(var k=0;k<n.length;k++){if(n[k].className&&n[k].className.match(new RegExp('\\b'+m+'\\b'))){c[q++]=n[k]}}continue}if(token.match(/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/)){var f=RegExp.$1;var r=RegExp.$2;var s=RegExp.$3;var t=RegExp.$4;if(!f){f='*'}var n=new Array;var o=0;for(var h=0;h<c.length;h++){var p;if(f=='*'){p=getAllChildren(c[h])}else{p=c[h].getElementsByTagName(f)}for(var j=0;j<p.length;j++){n[o++]=p[j]}}c=new Array;var q=0;var u;switch(s){case'=':u=function(e){return(e.getAttribute(r)==t)};break;case'~':u=function(e){return(e.getAttribute(r).match(new RegExp('\\b'+t+'\\b')))};break;case'|':u=function(e){return(e.getAttribute(r).match(new RegExp('^'+t+'-?')))};break;case'^':u=function(e){return(e.getAttribute(r).indexOf(t)==0)};break;case'$':u=function(e){return(e.getAttribute(r).lastIndexOf(t)==e.getAttribute(r).length-t.length)};break;case'*':u=function(e){return(e.getAttribute(r).indexOf(t)>-1)};break;default:u=function(e){return e.getAttribute(r)}}c=new Array;var q=0;for(var k=0;k<n.length;k++){if(u(n[k])){c[q++]=n[k]}}continue}if(!c[0]){return}f=token;var n=new Array;var o=0;for(var h=0;h<c.length;h++){var p=c[h].getElementsByTagName(f);for(var j=0;j<p.length;j++){n[o++]=p[j]}}c=n}return c};function Left(a,n){if(n<=0)return"";else if(n>String(a).length)return a;else return String(a).substring(0,n)};function Right(a,n){if(n<=0)return"";else if(n>String(a).length)return a;else{var b=String(a).length;return String(a).substring(b,b-n)}};
var en_=0;
var eo_=0;
var ep_=false;
var eq_=true;
var ae_;
var er_='week';
var es_='day';
var et_;
var eu_;
var ev_=false;
var ew_='';
var ex_ = '';
var ey_ = '';
var ez_=0;
var fa_=0;
var fb_='Even';
var fc_;
var fd_='';
var fe_=1;					
var ff_=1;  				
var fg_=1;					
var fh_=1;					
var fi_=1;				
var fj_=1;				
var fk_=1;				
var fl_=1;				
var fm_=1;				
var fn_=1;			
var fo_='';
var fp_;
var fq_;
var fr_=1;
var adminApproveAllApp;
var fs_;
var ft_;
var fu_;
var fv_;
var fw_;
var q_;
var fx_;
var fy_;
var fz_;
var ga_;
var gb_;
var gc_;
var gd_;
var ge_;

var gf_;
var gg_;
var gh_;
var gi_;

var gj_;
var gk_;
var gl_;
var gm_;
var DateBeforAppCanBook;
var gn_;
var go_;

var gp_;
var gq_;
var gr_;
var gs_;
var gt_;
var gu_;
var gv_;
var gw_;
var gx_;



var gy_;
var gz_;
var userName;


var appointyServerDate;

var ha_;
var hb_;

var hc_ = 0;
var hd_ = 0;
var he_;
var hf_ = '0';

//var hg_="<img src='images/red arrow.gif'>";
var hg_="&nbsp;";
var hh_;
var hi_;
var hj_;
var hk_;
var hl_;
var hm_;
var hn_='srvAT1';
var ho_=true;
var is_op=(navigator.userAgent.indexOf('Opera')!=-1)?true:false;


var hp_;
var hq_;

var qx_;
var qy_;

var hr_;
var hs_;
var ht_;
var hu_;

var hv_;
var hw_;
var hx_;

var hy_;
var hz_;
var ia_;
var ib_;

var ic_;
var id_;

var ie_;
var if_;

var rg_;
var rh_;


var ig_='';
var ih_='';
var ii_='';
var ij_='';

var ri_;
var rj_;

var ik_=0;
var il_;
var im_;
var in_=0;

var rk_='';
var rl_ = '';

var sr_=true;

var bookVerified;
var bookNonVerified;
var sd_;

var wo_=0;
var wp_=1;
var wq_=true;
var wr_=true;

var io_=new Array();
var ip_=new Array();
var iq_=new Array();
var ir_=new Array();
var is_=new Array();
var it_=new Array();
var iu_=new Array();
var iv_=new Array();
var iw_=new Array();
var ix_=new Array();
var iy_=new Array();
var  iz_=new Array();
var ja_ = new Array();
var n_ = new Array();
qm_=new Array();
var jb_=new Array();
var jc_ = new Array();
var m_=new Array();
var jd_=new Array();
var o_=new Array();
var je_=new Array();
var p_=new Array();
var jf_=new Array();
var jg_=new Array();
var jh_ = new Array();
var ji_=new Array();
var jj_=new Array();
var jk_ = new Array();
var jl_ = new Array();
var jm_ = new Array();
var jn_=new Array();
var jo_ = new Array();
var jp_ = new Array();
var temp =new Array();
var jq_ = new Array();
var jr_ = new Array();
var js_=new Array();
var jt_=new Array();
var ju_=new Array();
var jv_=new Array();
var jw_=new Array();
var jx_=new Array();
var wId=new Array();
var jy_=new Array();
var jz_=new Array();
var ka_=new Array();
var kb_=new Array();
var kc_=new Array();
var kd_=new Array();
var ke_=new Array();
var kf_=new Array();
var kg_=new Array();
//var kh_=new Array();
var getEventArr=new Array();
var ki_=new Array();
var getEventBookingArr=new Array();
var kj_=new Array();
var specificStaffWorkingday = new Array();

var kk_=new Array();
var rm_ = new Array();
var se_=new Array();
var wf_=new Array();


var ws_=new Array();
var wt_=new Array();

var g_ = new Array( kh_['monthJanuary'], kh_['monthFebruary'], kh_['monthMarch'], kh_['monthApril'], kh_['monthMay'], kh_['monthJune'], kh_['monthJuly'], kh_['monthAugust'], kh_['monthSeptember'], kh_['monthOctober'], kh_['monthNovember'], kh_['monthDecember'] );
var h_ = new Array( kh_['monthJan'], kh_['monthFeb'], kh_['monthMar'], kh_['monthApr'], kh_['monthMa'], kh_['monthJun'], kh_['monthJul'], kh_['monthAug'], kh_['monthSep'], kh_['monthOct'], kh_['monthNov'], kh_['monthDec'] );
var i_ = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 );
var j_ = new Array( kh_['weekSunday'], kh_['weekMonday'], kh_['weekTuesday'], kh_['weekWednesday'], kh_['weekThursday'], kh_['weekFriday'], kh_['weekSaturday'] );
var k_ = new Array( kh_['weeksun'], kh_['weekmon'], kh_['weekthe'], kh_['weekwed'], kh_['weekthu'], kh_['weekfri'], kh_['weeksat']);
var l_ = new Array( 'S', 'M', 'T', 'W', 'T', 'F', 'S');
var kl_=new Date();
var km_=new Date();
var kn_=new Date();
var ko_=new Date();

var overlayHelpText='';

var overlayTextMessage='';
var sessionMobVari1;
var sessionHomeVari1;
var sessionWorkVari1;
var kp_=true;
var kq_=0;
var kr_=1;
var ks_=false;
var kt_=true;
var rf_; function _ah() { if ($("startTime").value=="") { alert("Select Start Time"); } else { _ai(); if($("apointmentText").value=="") { alert("Select any service ."); } else { $('helpMsg').style.display='none'; _ak(600,200); $("back").style.display='block'; $("selectSrv").style.display='none'; var tDate = new Date(); var tDay = tDate.getDate(); var tMon = tDate.getMonth(); var tYear = tDate.getFullYear(); var newtDate = tMon+1 + '/' + tDay + '/' + tYear; hj_ = new Date($('appointmentDate').value + ' ' + $('startTime').value); var startString=$('apointmentText').value; startAllServiceArray=startString.split(","); var abc=$('apointmentTime').value; startAllTimeArray=abc.split(","); jt_.clear(); ju_.clear(); jv_.clear(); jx_.clear(); jw_.clear(); jn_=startString.split(","); _bc(jn_); var asd=_bb(); hk_=new Array(); for(var i=0;i<jw_.length;i++) { var changD=new Date(jw_[i]); hk_.push(changD._cn()); } _aj(asd); } } }; function _ai() { if(jh_.length!=0) { var serviceTextStr = $('serviceText'+right(jh_[0].id, jh_[0].id.length-7)).value; var serviceTimeStr = $('serviceTime'+right(jh_[0].id, jh_[0].id.length-7)).value; var serviceCostStr = $('serviceCost'+right(jh_[0].id, jh_[0].id.length-7)).value; for(i=1;i<jh_.length;i++) { serviceTextStr += ', '+$('serviceText'+right(jh_[i].id, jh_[i].id.length-7)).value; serviceTimeStr += ', '+$('serviceTime'+right(jh_[i].id, jh_[i].id.length-7)).value; serviceCostStr += ', '+$('serviceCost'+right(jh_[i].id, jh_[i].id.length-7)).value; } $('apointmentText').value=serviceTextStr; $('apointmentTime').value=serviceTimeStr; $('apointmentCost').value=serviceCostStr; } }; function _ak(w,h) { $("textSchedule").innerHTML='<table width="'+(w-10)+'" height="'+(h-10)+'" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="center" valign="middle">Loading... <img src="images/indicator_flower.gif"></td> </tr></table>'; }; function _am(allAvailableTimeslot1) { var tDate = new Date(); var tDay = tDate.getDate(); var tMon = tDate.getMonth(); var tYear = tDate.getFullYear(); var newtDate = $('appointmentDate').value; var s=0; var divid=40-Math.floor(hc_/15)-3; var searchStartTime=new Date(newtDate+' '+hp_); var searchEndTime=new Date(newtDate+' '+hq_); var pqr=searchStartTime.getMinutes(); ka_.clear(); for(var i=0;i<divid;i++) { s+=timeDifferenceOfSlot; hj_ = new Date($('appointmentDate').value + ' ' + $('startTime').value); hj_.setMinutes(searchStartTime.getMinutes()); hj_.setSeconds(searchStartTime.getSeconds()); hj_.setHours(searchStartTime.getHours()); hj_.setMinutes(pqr); if(hj_>searchEndTime) break; var startString=$('apointmentText').value; startAllServiceArray=startString.split(","); var abc=$('apointmentTime').value; startAllTimeArray=abc.split(","); jt_.clear(); ju_.clear(); jv_.clear(); jx_.clear(); jw_.clear(); jn_=startString.split(","); _bc(jn_); var asd=_bb(); if(asd) { hj_.setMinutes(searchStartTime.getMinutes()); hj_.setSeconds(searchStartTime.getSeconds()); hj_.setHours(searchStartTime.getHours()); hj_.setMinutes(pqr); allAvailableTimeslot1.push(hj_._cn()); } pqr=hj_.getMinutes()+s; } return allAvailableTimeslot1; }; function _an(availableTimeslotforSevenDays1) { availableTimeslotforSevenDays1.clear(); var tDate = new Date(); var tDay = tDate.getDate(); var tMon = tDate.getMonth(); var tYear = tDate.getFullYear(); var newtDate = tMon+1 + '/' + tDay + '/' + tYear; var s=0; for(var i=0;i<7;i++) { hj_ = new Date($('appointmentDate').value + ' ' + $('startTime').value); s+=1; var pqr=hj_.getDate()+s; hj_.setDate(pqr); var startString=$('apointmentText').value; startAllServiceArray=startString.split(","); var abc=$('apointmentTime').value; startAllTimeArray=abc.split(","); jt_.clear(); ju_.clear(); jv_.clear(); jx_.clear(); jw_.clear(); jn_=startString.split(","); _bc(jn_); var asd=_bb(); if(asd) { hj_.setMinutes(hj_.getMinutes()-hc_); ka_.push(hj_.getMonth()+1+"/"+hj_.getDate()+"/"+hj_.getFullYear()); availableTimeslotforSevenDays1.push(j_[(hj_.getDay())]); } } return availableTimeslotforSevenDays1; }; function _ao(d) { hj_ = new Date(d+" "+$('startTime').value); var startString=$('apointmentText').value; startAllServiceArray=startString.split(","); var abc=$('apointmentTime').value; startAllTimeArray=abc.split(","); jt_.clear(); ju_.clear(); jv_.clear(); jx_.clear(); jw_.clear(); jn_=startString.split(","); _bc(jn_); var asd=_bb(); hk_.clear(); for(var i=0;i<jw_.length;i++) { var changD=new Date(jw_[i]); hk_.push(changD._cn()); } $('appointmentDate').value=hj_.getMonth()+1+'/'+hj_.getDate()+'/'+hj_.getFullYear(); $('datetimeformat').innerHTML=j_[(hj_.getDay())]+','+g_[(hj_.getMonth())]+' '+hj_.getDate(); _aj(asd); }; function _ap(t) { $('startTime').value=t; hj_ = new Date($('appointmentDate').value + ' ' + t); var startString=$('apointmentText').value; startAllServiceArray=startString.split(","); var abc=$('apointmentTime').value; startAllTimeArray=abc.split(","); jt_.clear(); ju_.clear(); jv_.clear(); jx_.clear(); jw_.clear(); jn_=startString.split(","); _bc(jn_); var asd=_bb(); hk_.clear(); for(var i=0;i<jw_.length;i++) { var changD=new Date(jw_[i]); hk_.push(changD._cn()); } _aj(asd); }; function _aq() { var appComment = document.getElementById("commentTextArea").value; var insertStartTime=new Array(); var payWith=""; if($('paymentType')) { payradio=document.getElementsByName("PPmodule"); for(var i=0;i<payradio.length;i++) { if(payradio[i].checked) payWith=payradio[i].value; } if(payWith=="") { alert('Select Payment Type'); return false; } } for(var i=0;i<jw_.length;i++) { var newDate=new Date(jw_[i]); insertStartTime.push((newDate.getMonth()+1)+'/'+newDate.getDate()+'/'+newDate.getFullYear()+' '+newDate.getHours()+':'+newDate.getMinutes()+':'+newDate.getSeconds()); } var url='insertAppointmentAvail.aspx'; var par='serviceId='+jt_+'&staffId='+ju_+'&startTime='+insertStartTime+'&totalTime='+hc_+'&appointmentDate='+$('appointmentDate').value+'&apointmentTime='+$('apointmentTime').value+'&startT='+$('startTime').value+'&appComm='+appComment+'&payWith='+payWith; var ajx=new Ajax.Updater( 'testaddE', url, { methd:'post', evalScripts:true, parameters:par, onComplete:_ar, onFailure: _kb }); }; function _ar(req) { if(req.responseText=='login') { _oe(); } else { $("closeONcom").innerHTML=req.responseText; } }; function _as(sDate) { _hg(); var divdate=new Date(sDate); var idD=divdate.getDate(); var idM=divdate.getMonth()+1;   }; function _at(req) { var divdate=new Date(hm_); var idD=divdate.getDate(); var idM=divdate.getMonth()+1; $(idM+'d'+idD).innerHTML = req.responseText;   _bt(); _hg(); }; function _au(url, divID) { if(divID) { var myAjax = new Ajax.Updater( divID, url, { method: 'post', evalScripts: true });} }; function _av() { _cb(); var serv = $('textSchedule').getElementsByTagName('input'); var servAll = new Array(); jh_.clear(); for(i=0;i<serv.length;i++) { if((serv[i].type=='checkbox')&&(left(serv[i].id, 7)=='service')){servAll.push(serv[i]);} } for(j=0;j<servAll.length;j++) { if(servAll[j].checked==true){jh_.push(servAll[j]);} } hc_ = 0; hd_ = 0; for(k=0;k<jh_.length;k++) { hc_+=parseInt(jh_[k].value); hd_+=parseInt($('serviceCost'+(right(jh_[k].id, (jh_[k].id.length-7)))).value); } $('sumDuration').innerHTML=hc_+'mins.'; $('sumCost').innerHTML='$'+hd_; }; function _lf(appID,sn,st,et,flg) { he_ = appID; _gr('delete-appointments.aspx?appointmentID='+appID+'&sn='+sn+'&st='+st+'&et='+et+'&flg='+flg, '', 'testaddE', 'get', '_lh'); }; function _lg(valShow) { if(valShow==1) { $('appointment').style.display='block'; $('policy').style.display='none'; } else { $('policy').style.display='block'; $('appointment').style.display='none'; } }; function _lh(originalRequest) { if(originalRequest.responseText=='0') { alert('Sorry, You can\'t delete appointment when\n less than 24 hrs are left.'); } else { new Effect.Fade('dltId'+he_,{duration:1.0}); } }; function _ax(m, d, y, blocked) { _hu(eval(m)+'/'+eval(d)+'/'+eval(y)); var cn_ = new Date(eval(m)+'/'+eval(d)+'/'+eval(y)); var appAllowedDate = new Date(DateBeforAppCanBook); if(cn_<appAllowedDate) { overlay(); _hq(620,434); if((appointmentApproval==2)&&(ft_=='False')&&(sessionMobVari==0)&&(sessionHomeVari==0)&&(sessionWorkVari==0)) { _mu(1); } else { for (var i=1;i<=42;i++) { $('availD'+i).style.zIndex=0; $('availD'+i).style.display='none'; $('notAvailD'+i).style.display='none'; $('notAvailD'+i).style.zIndex=2; } _by(d,m); var url = 'test_appointment.aspx'; var pars = 'currentDate='+eval(m)+'/'+eval(d)+'/'+eval(y)+'&blocked='+blocked+'&currentDate1='+eval(y)+'/'+eval(m)+'/'+eval(d); var myAjax = new Ajax.Updater( 'addE', url, { method: 'get', parameters: pars, evalScripts: true, onComplete: _ba }); } } else { overlay(); _hq(250,80); $('addE').innerHTML = $('appNotAll').innerHTML; $('addEBody').style.display = 'block'; } }; function _li() { noOverlay(); }; function _ay(m, d, y, blocked) { _hq(620,434); var url = 'test_appointment.aspx'; var pars = 'currentDate='+eval(m)+'/'+eval(d)+'/'+eval(y)+'&blocked='+blocked+'&currentDate1='+eval(y)+'/'+eval(m)+'/'+eval(d); var myAjax = new Ajax.Updater( 'addE', url, { method: 'get', parameters: pars, evalScripts: true, onComplete: _ba }); }; function _az() { for(var i=0;i<dj_.length;i++){ $('service'+dj_[i]).checked=true;} for(var i=0;i<dl_.length;i++){ $('staffNo'+dl_[i]).checked=true;} _av(); if($("appointTime").value!="Select Time"&&$("appointTime").value!="") { $('startTime').value=$("appointTime").value; } }; function _ba(originalRequest) { $('addE').innerHTML = originalRequest.responseText; if($('back')) { $("back").style.display='none'; } if($('selectSrv')) { $("selectSrv").style.display='block'; } if ($('memberLoginEmail')) { $('loginHead').innerHTML = kh_['LogIn']; $('memberLoginEmail').innerHTML = kh_['EmailId']; $('memberLoginPassword').innerHTML = kh_['Password']; $('memberLoginSignUp').innerHTML = kh_['SignUp']; $('memberLoginForgotPass').innerHTML = kh_['ForgotPass']; $('subm').value = ' '+kh_['LogInArrow']+' '; $('LogInCancel').value = ' '+kh_['Cancel']+' x'; } _iq(); }; function _bb() { var currentTimeBreak=new Date(serverDate.toString());   currentTimeBreak.setMinutes(currentTimeBreak.getMinutes()+parseInt(minutesBeforeAppBooked));   if(hs_==1) { currentTimeBreak.setHours(0); currentTimeBreak.setMinutes(0); currentTimeBreak.setSeconds(0); } var givenTimeBreak=new Date(); givenTimeBreak=hj_; if(currentTimeBreak>givenTimeBreak) {return false;} if(DateBeforAppCanBook>givenTimeBreak) { if(jn_.length==0) {return true;} else { _bc(jn_); var checkFlag=_bd(js_,hj_.toString()); if(checkFlag) { var ijk=_bb(); if (ijk){return true;} else {return false;} } else { return false; } } } else {return false;} }; function _bc(strService) { if(!eval(gu_)) { js_.clear(); js_.push(strService.toString()); } else { js_.clear(); var valueIndex; var sizeOfservice; for(var k=0;k<strService.length;k++) { valueIndex=jq_.indexOf(strService[k]); sizeOfservice=0; if(valueIndex>=0) { sizeOfservice=jr_[valueIndex].length; }   if(sizeOfservice==0) { js_.push(strService[k]); } else { var inArrayCheck=true; for(var inner=0;inner<sizeOfservice;inner++) { if(strService._cp(jr_[valueIndex][inner],false)) { inArrayCheck=false; break; } } if(inArrayCheck) { js_.push(strService[k]); } } }   } }; var aj_=''; function _bd(zeroLevelArray,zeroStarTime) { var compairLength=ju_.length; var sizeOfPeople,valueIndex; var inTime1=0; var zlrLen=zeroLevelArray.length; for(var i=0;i<zlrLen;i++) { valueIndex=jo_.indexOf(zeroLevelArray[i]); if(typeof(it_[cs_+'/'+zeroLevelArray[i]])=='undefined') break; var tempServiceStaff=it_[cs_+'/'+zeroLevelArray[i]]; sizeOfPeople=tempServiceStaff.length; continueFlag=false; if(sizeOfPeople==0) { break; } for(var k=0;k<jv_.length;k++) { if(jv_[k]==zeroLevelArray[i]) { checkPopedStartTime=Date.parse(jx_[k]); givenStartTime=Date.parse(zeroStarTime); if(checkPopedStartTime==givenStartTime) { continueFlag=true; } } } if(continueFlag) { continue; } else { var servTime=startAllTimeArray[startAllServiceArray.indexOf(zeroLevelArray[i])]; for(var freeP=0;freeP<sizeOfPeople;freeP++) { var workerCheck=tempServiceStaff[freeP]; if((dl_.length)==0||dl_._cp(workerCheck.toString(),true)) { var checkFlag=_be(workerCheck,zeroStarTime.toString(),servTime,zeroLevelArray[i]); if(checkFlag) { jt_.push(zeroLevelArray[i]); ju_.push(workerCheck); jw_.push(zeroStarTime.toString()); jn_._co(zeroLevelArray[i]); inTime1=servTime; inTime=hj_.getMinutes()+parseInt(inTime1); hj_.setMinutes(inTime); return true; } } } } } if(ju_.length!=0) { popApoint=jt_.pop(); inTime1=startAllTimeArray[startAllServiceArray.indexOf(popApoint)]; inTime=hj_.getMinutes()-eval(inTime1); hj_.setMinutes(inTime); jn_.push(popApoint); ju_.pop(); jv_.push(popApoint); var temp = new Date(); temp=jw_.pop(); jx_.push(temp.toString()); var pLength=jx_.length; for(var j=0;j<pLength;j++) { var cpopedStartTime = new Date(); cpopedStartTime=jx_[j]; if(cpopedStartTime>temp) { jx_._cs(j); jv_._cs(j); } } return true; } return false; }; function _be(workerName,workerTime,t,fx_) { var sStartTime=Date.parse(workerTime); var sEndTime=Date.parse(workerTime); sEndTime=sEndTime+(parseInt(t)-1)*60*1000; var availStaffPath=cs_+'/'+workerName+'/'+fx_+'/'+aj_; if(_bf(workerName,sStartTime,sEndTime,fx_)) { return false; } if(_bg(workerName)) { return false; } if(_bh(workerName)) { return false; } if(_bi(workerName,sStartTime,sEndTime)==false) { if(_bl(sStartTime,sEndTime,workerName)) { return false; } if(__ali(sStartTime,sEndTime,workerName,fx_)) return false; if(__alj(sStartTime,sEndTime,workerName,fx_)) return false; if(typeof(jg_[cr_+'/'+workerName])!='undefined') { var stDateAp=jg_[cr_+'/'+workerName]; var j=stDateAp.length; var ak_=parseInt(e_['ser'+fx_][11]); var al_=0; for(var i=0;i<j;i++) { var testStartTime=Date.parse(stDateAp[i][0]); var testEndTime=Date.parse(stDateAp[i][1]); if(stDateAp[i][2]==fx_ && testStartTime==sStartTime && testEndTime==sEndTime) { al_++; if(al_<ak_) continue; } if(((testStartTime<=sStartTime && testEndTime>=sStartTime)||(testStartTime<=sEndTime && testEndTime>=sEndTime)||(testStartTime<=sEndTime && testStartTime>=sStartTime)||(testEndTime<=sEndTime && testEndTime>=sStartTime))) { return false; } } } return true; } return false; }; var am_=0; function _bf(workerName,sStartTime,sEndTime,fx_) { var para=cs_+'/'+workerName+'/'+fx_; if(typeof(kb_[para+'/'+sStartTime])!='undefined') { return kb_[para+'/'+sStartTime][0]; } sStartTime=parseInt(sStartTime); sEndTime=parseInt(sEndTime); kb_[para+'/'+sStartTime]=new Array(); if(typeof(kb_[para])!='undefined') { var ssdArr=kb_[para]; var j=ssdArr.length; do { staffAvailabeForServiceStCom=Date.parse(cr_+' '+ssdArr[j-1][3]); staffAvailabeForServiceEtCom=Date.parse(cr_+' '+ssdArr[j-1][4]); if(staffAvailabeForServiceStCom<=sStartTime&&staffAvailabeForServiceStCom<=sStartTime&&staffAvailabeForServiceEtCom>=sEndTime&&staffAvailabeForServiceEtCom>=sEndTime) { kb_[para+'/'+sStartTime].push(false); return false; } }while(--j) ; } kb_[para+'/'+sStartTime].push(true); return true; }; function _bg(staffId,staffDay) { for(var i=0;i<specificStaffBlockday.length;i++) { d=specificStaffBlockday[i][1].split("/"); if(staffId==specificStaffBlockday[i][0]&&(cx_+1)==d[0]&&(cw_)==d[1]&&(cy_)==d[2]) { return true; } } return false; }; function _bh(staffId) { var staffWorkinD=new Array(); if(typeof(specificStaffWorkingday['wkStDate'+staffId])!='undefined') staffWorkinD=specificStaffWorkingday['wkStDate'+staffId]; if(staffWorkinD.length>0) { for(var i=0;i<staffWorkinD.length;i++) { d=staffWorkinD[i][1].split("/"); if(staffId==staffWorkinD[i][0]&&(cx_+1)==d[0]&&(cw_)==d[1]&&(cy_)==d[2]) { return false; } } return true; } return false; }; function _bi(staffId,sT,eT) { for(var i=0;i<o_.length;i++) { innerSt=Date.parse(o_[i][1]+' '+o_[i][2]); innerEt=Date.parse(o_[i][1]+' '+o_[i][3]); innerEt=innerEt-60*1000; if(staffId==o_[i][0] && ((innerSt<=sT && innerEt>=sT)||(innerSt<=eT && innerEt>=eT)||(innerSt<=eT && innerSt>=sT)||(innerEt<=eT && innerEt>=sT))) { return true; } } return false; }; function _bj(staffId,staffTime) { var newTime=new Date(staffTime); newTimeStr=newTime.getMonth()+1 + "/" + newTime.getDate() + "/" + newTime.getFullYear(); for(var i=0;i<staffAvailableTiming.length;i++) { var newBtimeFrom=new Date(newTimeStr + ' ' + staffAvailableTiming[i][3]); var newBtimeTo=new Date(newTimeStr + ' ' + staffAvailableTiming[i][2]); if(newBtimeTo == 'NaN') { newBtimeTo=new Date(staffAvailableTiming[i][2]); newBtimeFrom=new Date(staffAvailableTiming[i][3]); newBtimeTo.setFullYear(newTime.getFullYear()); newBtimeTo.setMonth(newTime.getMonth()); newBtimeTo.setDate(newTime.getDate()); newBtimeFrom.setFullYear(newTime.getFullYear()); newBtimeFrom.setMonth(newTime.getMonth()); newBtimeFrom.setDate(newTime.getDate()); } if(staffId==staffAvailableTiming[i][0]&&newTime.getDay()==staffAvailableTiming[i][1]&&newTime>=newBtimeTo&&newTime<newBtimeFrom) { return true; } } return false; }; function _bk(bDate) { for(i=0;i<je_.length;i++) { var asd=new Date(je_[i][1]); bDate=new Date(bDate); if(je_[i][0]==1&&asd.getDate()==bDate.getDate()&&asd.getMonth()==bDate.getMonth()&&asd.getYear()==bDate.getYear()) { return true; } if(je_[i][0]==2&&asd.getDay()==bDate.getDay()&&asd.getMonth()==bDate.getMonth()&&asd.getYear()==bDate.getYear()) { return true; } } return false; }; function _bl(bTime,eTime,sId) { for(var i=0;i<n_.length;i++) { if(n_[i][0]==sId) { var newBtimeFrom=Date.parse(cr_+' ' +n_[i][2]); var newBtimeTo=Date.parse(cr_+' ' +n_[i][3]); newBtimeTo=newBtimeTo-60*1000; if(n_[i][1]==cs_&&(bTime<=newBtimeTo&&bTime>=newBtimeFrom||eTime<=newBtimeTo&&eTime>=newBtimeFrom||newBtimeFrom<=eTime&&newBtimeFrom>=bTime||newBtimeTo<=eTime&&newBtimeTo>=bTime)) return true; } } return false; }; function _bm(arrName,value) { var ind=-1; for(var i=0;i<arrName.length;i++) { var chdate=new Date(arrName[i][0]); if(arrName[i][0]==value) { ind=i; break; } } return ind; };  var ie = document.all; var dom = document.getElementById; var ns4 = document.layers; var r_ = false; var s_; function _bo() { overlayTextMessage = '<div id="innerText"><div id="yregptxt"><p style="color: #333333; font-weight: bold; ">' + kh_['memberOverlayText1'] + '</p><h2 style="font-family: Arial, Helvetica, sans-serif">' + kh_['memberOverlayText2'] + '<hr /></h2><ul><li style="color: #333333;"><strong>' + kh_['SelectService'] + '(s)</strong> ' + kh_['memberOverlayText3'] + '<br /></li><li style="color: #333333;">' + kh_['memberOverlayText4'] + '</li><li style="font-family: Arial, Helvetica, sans-serif"><span style="color: #333333">' + kh_['memberOverlayText5'] + '</span><br /></li></ul><hr /><div id="yregpmtxt"><h3 style="font-family: Arial, Helvetica, sans-serif">' + kh_['memberOverlayText6'] + ' </h3><p style="font-family: Arial, Helvetica, sans-serif"><span style="color: #333333">' + kh_['memberOverlayText7'] + '<br /><br />' + kh_['memberOverlayText8'] + ' <a href="#">support@appointy.com</a></span></p></div></div></div>'; _in(); _pf(); ae_ = getPageSize(); var firstofmonth = serverDate._cg(); var table = ''; table += '<html id="mainHtml"><head><link rel="shortcut icon" href="favicon.ico" >'; table += '<title>Appointy | ' + formattedDate + ' </title>'; table += '</head><body id="calmainBody" >'; table += '<div class="nav-loading" id="seachGif" > Searching . . . Please wait</div>'; table += '<div id="ap_body">'; if ((eval(fi_)) == true) { table += '<div id="ap_header">'; table += '<div id="navBar">'; if (Islogoimage == 0) { table += '<div id="monthDiv"><span style="float:left"><img src="' + logopath + '" id="logoImg"/></span> <span id="user"></span></div>'; } else { table += '<div id="monthDiv"><div class="logoOutter"><div class="logoInner"><span style="float:left" class="MyappointyLogo">' + logopath + ' </span> <span id="user" style="display:none"></span></div></div></div>'; } table += '<div id="topMenu">'; if (sessionRole != "" && sessionRole != "Administrator" && sessionRole != "Staff" && sessionUID != 0) { var strAffiliateLink = '<a href="Affiliate/Campaign/Dashboard.aspx">' + kh_['Affiliate'] + '</a>'; if (userAffiliateId != 0) { table += strAffiliateLink; } table += '<a href="javascript:void(0);" onmousedown="overlay();_mv()">' + kh_['Mashups'] + '</a>'; table += '<a href="javascript:void(0);" id="myAppLink" >' + kh_['MyAppointments'] + '</a>'; table += '<a href="javascript:void(0);" onmousedown="_hq(430,455);_gr(\'member-update-info.aspx\',\'\',\'addE\',\'get\',\'_mw\');overlay();">' + kh_['ModifyMyInformation'] + '</a>'; table += '<a onmousedown="_gr(\'logout.aspx\',\'\',\'\',\'get\', \'_mr\')" href="javascript:void(0);">' + kh_['LogOut'] + '</a>';        if(hz_!='') { var langOption = hz_.split('#||#'); var cultureTitleArray; var culture, countryTitle; for(var i=0;i<langOption.length-1;i++) { cultureTitle = langOption[i].split('||'); culture = ''; countryTitle = ''; if(cultureTitle[0]) culture = cultureTitle[0]; if(cultureTitle[1]) countryTitle = cultureTitle[1]; table += '<a href="ChangeLanguage.aspx?lan='+culture+'" title="'+countryTitle+'" style="padding-left: 0px; padding-right: 0px;"><img src="Images/Flags/'+culture+'.png" border="0" /></a>'; } } } else { table += '<a onmousedown="_hq(456,250);_ma();" href="javascript:void(0);">' + kh_['LogIn'] + '</a>'; table += '<a href="javascript:void(0);" onmousedown="overlay();_mu()">' + kh_['NewUser'] + '?</a>'; if(hz_!='') { var langOption = hz_.split('#||#'); var cultureTitleArray; var culture, countryTitle; for(var i=0;i<langOption.length-1;i++) { cultureTitle = langOption[i].split('||'); culture = ''; countryTitle = ''; if(cultureTitle[0]) culture = cultureTitle[0]; if(cultureTitle[1]) countryTitle = cultureTitle[1]; table += '<a href="ChangeLanguage.aspx?lan='+culture+'" title="'+countryTitle+'" style="padding-left: 0px; padding-right: 0px;"><img src="Images/Flags/'+culture+'.png" border="0" /></a>'; } } } table += ''; var yr = (now.getFullYear()).toString(); table += '</div>'; table += '</div>'; table += ' </div>'; } table += ' <table style="width: 100%;" id="ap_motherDiv" border="0" cellspacing="0" cellpadding="0">'; table += ' <tr>'; table += ' <td id="ap_mother_left_td" valign="top" >'; var kv_='style="background-position:right 59px;"'; if(eval(hw_)) kv_=''; table += ' <div id="ap_mother_left_header" '+kv_+'>'; table += ' <div id="ap_mother_left_header_user">';     if(1<rm_.length){ table += '<div id="locationTpDId" class="locationTpDCl">'; table += ' <table cellspacing="0" cellpadding="0" style="width: 100%;"><tr> <td class="currentLocation"><div class="currentLocationD" >'+rl_+'</div></td><td style="width: 20px; text-align: center;" class="currentLocationDImg">&nbsp;</td> <td>&nbsp;</td> </tr></table>'; table += '<div id="locationList" class="ListOfServiceWhenNoLeftBar"> <table cellspacing="0" cellpadding="0" border="0">'; var j=0; for(var i=0;i<rm_.length;i++) { if(rl_==rm_[i][1]) continue; if(j%2==0) table+=' <tr> <td class="ListOfServiceWhenNoLeftBarData1"><a id="sld169" href="http:\/\/'+rm_[i][0]+'.appointy.com">'+rm_[i][1]+' </a></td> </tr> '; else table+=' <tr> <td class="ListOfServiceWhenNoLeftBarData2"><a id="sld2535" href="http:\/\/'+rm_[i][0]+'.appointy.com">'+rm_[i][1]+' </a></td> </tr>'; j++; } table += ' </table> '; table += ' </div> '; table += ' </div> '; } table += ' </div>'; table += ' </div>'; var m = 1; table += ' <div id="ap_mother_left_service">'; table += ' <div class="topStepLeft1">'; table += ' </div>'; table += ' <div class="topStepLeft2">'; table += ' </div>'; table += ' <div id="left_service_selection">'; var chCat = 0; var numOfCat = 0; for (i in e_) {   if (e_[i][5] == 'False') { ez_ += 1; } if (chCat != e_[i][7]) { chCat = e_[i][7]; numOfCat += 1; } } table += ' <div id="left_serviceSelection_Header">'; if (ez_ != 1) table += kh_['Select'] + ' '; table += fx_; table += ' </div>'; table += ' <div id="left_serviceSelection_body">'; table += ' <div id="barService">'; table += '<table id="leftserviceHeader" width="100%" border="0" cellspacing="0" class="appointBoxTable" cellpadding="0">'; table += '<tr>'; table += '<td width="13">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>'; table += '<td >' + fx_ + '</td>'; table += '<td width="35" align="left"><span id="serviceTimeTh">Time</span></td>'; table += '<td width="20"><span id="serviceCostTh"></span></td>'; table += '</tr>'; table += '</table>'; table += '<div id="barServicetext" style="display:block;">'; table += '<table width="100%" border="0" cellspacing="0" class="appointBoxTable" cellpadding="0">'; chCat = 0; for (i in e_) { if (e_[i][5] == 'False') { if (chCat != e_[i][7] && numOfCat != 1) { chCat = e_[i][7]; table += '<tr class="catHeader">'; table += '<td colspan="4">' + e_[i][8] + '</td>'; table += '</tr>'; } if (m == 1) { m = 0; table += '<tr class="upperTd srTxSd" id="srTxSd' + i + '">'; } else { m = 1; table += ' <tr class="lowerTd srTxSd" id="srTxSd' + i + '">'; } if (ez_ == 1) { fl_ = true; } var classOnServiceAndStaff = "serviceNDCNotBold"; if (eval(fl_)) { classOnServiceAndStaff = "serviceNDCBold"; } else { classOnServiceAndStaff = "serviceNDCNotBold"; } table += '<td '; if (ez_ != 1) table += 'width="13">'; else table += 'width="1">'; table += '<input type="checkbox" name="checkbox" id="serviceCheck' + e_[i][0] + '" value="' + e_[i][0] + '" />'; table += '<input type="hidden" name="' + e_[i][0] + '" id="fx_' + e_[i][0] + '" value="' + e_[i][1] + '" /> <input type="hidden" name=serviceTime"' + e_[i][0] + '" id="serviceTime' + e_[i][0] + '" value="' + e_[i][2] + '" /> </td>'; table += '<td class="' + classOnServiceAndStaff + '" ><a id="ld' + e_[i][0] + '" style="cursor:pointer">' + e_[i][1] + '</a></td>'; table += '<td width="20" class="' + classOnServiceAndStaff + '"><span id="serviceTimeTd' + i + '">' + _qz(e_[i][2]) + ' </span></td>'; if(parseFloat(e_[i][3])==0) table += '<td width="20" style="text-align: right;" class="' + classOnServiceAndStaff + '"><span id="serviceCostTd' + i + '">-</span></td>'; else table += '<td width="20" style="text-align: right;" class="' + classOnServiceAndStaff + '"><span id="serviceCostTd' + i + '">' + __aco(e_[i][3]) + '</span></td>'; table += '</tr>';                 } } table += ' </table>'; table += ' </div>'; table += ' </div>'; table += ' </div>'; table += ' </div>'; table += ' <div class="topStepLeft2">'; table += ' </div>'; table += ' <div class="topStepLeft1">'; table += ' </div>'; table += ' </div>'; table += ' <div id="ap_mother_left_time">'; table += ' <div class="topStepLeft1">'; table += ' </div>'; table += ' <div class="topStepLeft2">'; table += ' </div>'; table += ' <div id="left_time_selection">'; table += ' <div id="left_time_header">' + kh_['SelectTime'] + '<span class="optional">(' + kh_['optional'] + ')</span>'; table += ' </div>'; table += ' <div id="left_time_body">'; table += ' <input name="appointTime" readonly="readonly" size=14 type="text" id="appointTime" value="'+kh_['FullDay']+'" />'; table += ' </div>'; table += ' </div>'; table += ' <div class="topStepLeft2">'; table += ' </div>'; table += ' <div class="topStepLeft1">'; table += ' </div>'; table += ' </div>'; table += ' <div id="stSelection">'; table += ' <div class="topStepLeft1">'; table += ' </div>'; table += ' <div class="topStepLeft2">'; table += ' </div>'; table += ' <div id="staffSelection">'; for (i = 0; i < p_.length; i++) { if (p_[i][2] == 'False') { fa_ += 1; } } table += ' <div id="staffSelectionHeader">'; if (fa_ != 1) table += kh_['Select'] + ' '; table += q_; if (!ks_&&fa_ != 1) table += '<span class="optional">(' + kh_['optional'] + ')</span>'; table += ' </div>'; table += ' <div id="staffSelectionBody">'; table += ' <table width="100%" id="staffSelectionHeaderTB" border="0" cellspacing="0" cellpadding="0">'; m = 1; for (i = 0; i < p_.length; i++) { if (p_[i][2] == 'False') { if (m == 1) { m = 0; table += '<tr class="upperTd">'; } else { m = 1; table += ' <tr class="lowerTd">'; } table += ' <td width="13">'; if (fa_ != 1) table += ' <input type="checkbox" name="checkbox" value="' + p_[i][0] + '" /> '; table += ' </td>'; table += ' <td class="staffNDCNotBold"><a href="javascript:void(0);" id="sld' + p_[i][0] + '">' + p_[i][1]; table += ' </a></td>'; table += ' </tr>'; } } table += ' </table>'; table += ' </div>'; table += ' </div>'; table += ' <div class="topStepLeft2">'; table += ' </div>'; table += ' <div class="topStepLeft1">'; table += ' </div>'; table += ' </div>'; table += ' </td>'; table += ' <td valign="top" align="left" id="ap_mother_right_td">'; table += ' <div id="leftAdd">'; table += ' <div id="ap_mother_right">'; table += ' <div id="ap_right_header">'; table += ' <table cellspacing="0" cellpadding="0" style="width: 100%;" id="chrome_main1">'; var chkServiceOnTop = 0; var tableTempSerOnTop = ''; var tempChkActiveService = 0; var tempChkActiveStaff = 0; if ((eval(fi_)) == false) { fi_ = 0; for (i in e_) { if (e_[i][5] == 'False') { tempChkActiveService += 1; } } for (i = 0; i < p_.length; i++) { if (p_[i][2] == 'False') { tempChkActiveStaff += 1; } } if (tempChkActiveService == 1) { for (i in e_) { if (e_[i][5] == 'False') { chkServiceOnTop = 1; if ((eval(fg_))&&(eval(fh_))) sevClassonOne= 'SingaleSevWithCandT'; else if ((eval(fg_))||(eval(fh_))) sevClassonOne= 'SingaleSevWithCorT'; else sevClassonOne= 'SingaleSev'; tableTempSerOnTop += ' <td class="serviceNameNoLeftPane '+sevClassonOne+'" title="' + e_[i][1] + '"><div id="choseServiceSpan" style="width:100%" class="onmouseoutChoose" onmouseover="showserviceWhenNoLeftBar();" onmouseout="hideserviceWhenNoLeftBar();">'; tableTempSerOnTop += '' + left(e_[i][1],15) + ''; if (eval(fg_)) tableTempSerOnTop += ' <span class="serviceTimeCostTop">' + e_[i][2] + ' Min</span>'; if (eval(fh_)) tableTempSerOnTop += ' &nbsp;<span class="serviceTimeCostTop">' + fo_ + '' + __aco(e_[i][3]) + '</span>'; tableTempSerOnTop += ' </div> </td>'; } } } else { tableTempSerOnTop += ' <td class="serviceNameNoLeftPane" style="padding-left: 5px;width:177px;">'; tableTempSerOnTop += ' <table cellspacing="0" cellpadding="0" style="width: 100%;"><tr>'; tableTempSerOnTop += ' <td class="selectionTypeName" ><div id="choseServiceSpan" class="onmouseoutChoose" onmouseover="showserviceWhenNoLeftBar();showserviceListWhenNoLeftBar()" onmouseout="hideserviceWhenNoLeftBar();_ln()">'+kh_['Select']+' ' + fx_ + '</div></td><td class="onmouseoutChooseImg" id="choseServiceImage" style="width:20px;text-align:center;" onmouseover="showserviceWhenNoLeftBar();showserviceListWhenNoLeftBar()" onmouseout="hideserviceWhenNoLeftBar();_ln()"><img src="Images/menu_arrow_hover.gif" alt="" /></td>'; tableTempSerOnTop += ' </tr></table>'; tableTempSerOnTop += ' </td>'; } if (eval(ff_)) { if (tempChkActiveStaff == 1) { for (i = 0; i < p_.length; i++) { if (p_[i][2] == 'False') { tableTempSerOnTop += ' <td class="serviceNameNoLeftPane" style="padding-left: 15px;">'; tableTempSerOnTop += '' + p_[i][1] + ''; tableTempSerOnTop += ' </td>'; } } } else { tableTempSerOnTop += ' <td class="serviceNameNoLeftPane" style="padding-left: 5px;width:177px;">'; tableTempSerOnTop += ' <table cellspacing="0" cellpadding="0" style="width: 100%;"><tr>'; tableTempSerOnTop += ' <td class="selectionTypeName" ><div id="choseStaffSpan" class="onmouseoutChoose" onmouseover="_lk();_lm()" onmouseout="_ll();_lp()">'+kh_['Select']+' ' + q_ + '</div></td><td class="onmouseoutChooseImg" id="choseStaffImage" style="width:20px;text-align:center;" onmouseover="_lk();_lm()" onmouseout="_ll();_lp()"><img src="Images/menu_arrow_hover.gif" alt="" /></td>'; tableTempSerOnTop += ' <td>&nbsp;</td>'; tableTempSerOnTop += ' </tr></table>'; tableTempSerOnTop += ' </td>'; } } tempChkActiveService = 0; tempChkActiveStaff = 0; if(1<rm_.length){ tableTempSerOnTop += ' <td class="serviceNameNoLeftPane" style="padding-left: 5px;">'; tableTempSerOnTop += '<div id="locationTpDId" class="locationTpDCl">'; tableTempSerOnTop += ' <table cellspacing="0" cellpadding="0" style="width: 100%;"><tr> <td class="currentLocation"><div class="currentLocationD" >'+rl_+'</div></td><td style="width: 20px; text-align: center;" class="currentLocationDImg">&nbsp;</td> <td>&nbsp;</td> </tr></table>'; tableTempSerOnTop += '<div id="locationList" class="ListOfServiceWhenNoLeftBar"> <table cellspacing="0" cellpadding="0" border="0">'; var j=0; for(var i=0;i<rm_.length;i++) { if(rl_==rm_[i][1]) continue; if(j%2==0) tableTempSerOnTop+=' <tr> <td class="ListOfServiceWhenNoLeftBarData1"><a id="sld169" href="http:\/\/'+rm_[i][0]+'.appointy.com">'+rm_[i][1]+' </a></td> </tr> '; else tableTempSerOnTop+=' <tr> <td class="ListOfServiceWhenNoLeftBarData2"><a id="sld2535" href="http:\/\/'+rm_[i][0]+'.appointy.com">'+rm_[i][1]+' </a></td> </tr>'; j++; } tableTempSerOnTop += ' </table> '; tableTempSerOnTop += ' </div> '; tableTempSerOnTop += ' </div> '; tableTempSerOnTop += ' </td>'; } tableTempSerOnTop += ' <td class="topMenuNoLeftBar">'; tableTempSerOnTop += '<div id="ap_header">'; tableTempSerOnTop += '<div id="navBar">'; tableTempSerOnTop += '<div id="topMenu">'; if (sessionRole != "" && sessionRole != "Administrator" && sessionRole != "Staff" && sessionUID != 0) { var strAffiliateLink = '<a href="Affiliate/Campaign/Dashboard.aspx">' + kh_['Affiliate'] + '</a>'; if (userAffiliateId != 0) { tableTempSerOnTop += strAffiliateLink; } tableTempSerOnTop += '<a href="javascript:void(0);" onmousedown="overlay();_mv()">' + kh_['Mashups'] + '</a>'; tableTempSerOnTop += '<a href="javascript:void(0);" id="myAppLink" >' + kh_['MyAppointments'] + '</a>'; tableTempSerOnTop += '<a href="javascript:void(0);" onmousedown="_hq(430,455);_gr(\'member-update-info.aspx\',\'\',\'addE\',\'get\',\'_mw\');overlay();">' + kh_['ModifyMyInformation'] + '</a>'; tableTempSerOnTop += '<a onmousedown="_gr(\'logout.aspx\',\'\',\'\',\'get\', \'_mr\')" href="javascript:void(0);">' + kh_['LogOut'] + '</a>';        if(hz_!='') { var langOption = hz_.split('#||#'); var cultureTitleArray; var culture, countryTitle; for(var i=0;i<langOption.length-1;i++) { cultureTitle = langOption[i].split('||'); culture = ''; countryTitle = ''; if(cultureTitle[0]) culture = cultureTitle[0]; if(cultureTitle[1]) countryTitle = cultureTitle[1]; tableTempSerOnTop += '<a href="ChangeLanguage.aspx?lan='+culture+'" title="'+countryTitle+'" style="padding-left: 0px; padding-right: 0px;"><img src="Images/Flags/'+culture+'.png" border="0" /></a>'; } } } else { tableTempSerOnTop += '<a onmousedown="_hq(456,250);_ma();" href="javascript:void(0);">' + kh_['LogIn'] + '</a>'; tableTempSerOnTop += '<a href="javascript:void(0);" onmousedown="overlay();_mu()">' + kh_['NewUser'] + '?</a>'; if(hz_!='') { var langOption = hz_.split('#||#'); var cultureTitleArray; var culture, countryTitle; for(var i=0;i<langOption.length-1;i++) { cultureTitle = langOption[i].split('||'); culture = ''; countryTitle = ''; if(cultureTitle[0]) culture = cultureTitle[0]; if(cultureTitle[1]) countryTitle = cultureTitle[1]; tableTempSerOnTop += '<a href="ChangeLanguage.aspx?lan='+culture+'" title="'+countryTitle+'" style="padding-left: 0px; padding-right: 0px;"><img src="Images/Flags/'+culture+'.png" border="0" /></a>'; } } } tableTempSerOnTop += ''; var yr = (now.getFullYear()).toString(); tableTempSerOnTop += '</div>'; tableTempSerOnTop += '</div>'; tableTempSerOnTop += ' </div>'; tableTempSerOnTop += ' </td>'; } table += '<tr><td colspan="3"><table cellspacing="0" cellpadding="0" style="width: 100%;"><tr>' + tableTempSerOnTop + '</tr></table></td></tr>'; table += ' <tr>'; table += ' <td style="width:65%" valign="bottom" id="ap_right_header_leftMenu" >'; table += ' <div>'; table += ' <table cellspacing="0" cellpadding="0" border="0">'; table += ' <tr>'; table += ' <td valign="bottom" valign="bottom" >'; table += ' <div id="tb11" class="topStepBoth1">'; table += ' </div>'; table += ' <div id="tb21" class="topStepBoth2">'; table += ' </div>'; table += ' <div id="tbT1" class="modelinkOn">'; table += ' ' + kh_['Week'] + ''; table += ' </div>'; table += ' </td>'; table += ' <td>'; table += ' <div id="tb12" class="topStepBoth1Off">'; table += ' </div>'; table += ' <div id="tb22" class="topStepBoth2Off">'; table += ' </div>'; table += ' <div id="tbT2" class="modelinkOff">'; table += ' ' + kh_['Month'] + '</div>'; table += ' </td>'; table += ' <td>'; table += ' <div id="tb13" class="topStepBoth1Off">'; table += ' </div>'; table += ' <div id="tb23" class="topStepBoth2Off">'; table += ' </div>'; table += ' <div id="tbT3" class="modelinkOff">'; table += ' ' + kh_['Detail'] + '</div>'; table += ' </td>'; table += ' <td valign="bottom" style="font-size: 11px;color: #0000FF;text-transform: capitalize;text-align:center;">'; table += ' ';              table += hv_; table += '</td>'; table += ' </tr>'; table += ' </table>'; table += ' </div>'; table += ' </td>'; table += ' <td valign="bottom" >'; table += ' <div id="pDate">'; table += ' </div>'; table += ' </td>'; table += ' <td>'; table += ' <div id="ap_right_header_rightMenu">'; table += ' </div>'; table += ' </td>'; table += ' </tr>'; table += ' </table>'; table += ' </div>'; table += ' <div>'; table += ' <div class="topStepBoth1">'; table += ' </div>'; table += ' <div class="topStepBoth2">'; table += ' </div>'; table += ' <div id="ap_right_body">'; table += ' <div id="ap_right_body_header">'; table += ' </div>'; table += ' <div id="ap_right_body_text">'; table += ' <div id="rightBr">'; table += ' </div>'; table += '<div id="helpRunTimeText">'; table += '</div>'; table += ' <table width="100%" cellspacing="0" cellpadding="0" border="0">'; table += ' <tr>'; table += ' <td align="right" valign="bottom" style="padding-top:5px;" >'; table += '<div id="allBottomLink">'; table += ' <a href="'+if_+'" target="_blank"> <img src="images/twitIcon.jpeg" border="0"></a>'; table += ' <a href="'+ie_+'" target="_blank"> <img src="images/fbIcon.jpeg" border="0"></a>'; if(eval(hw_)) { if(AffiliateId!=0) table += ' <a href="http:\/\/www.appointy.com/quickUserSignUp.aspx?aid='+appointyId_xh+'" target="_blank"> <img src="images/appointycal.jpg" border="0"></a>'; else table += ' <a href="http:\/\/www.appointy.com" target="_blank"> <img src="images/appointycal.jpg" border="0"></a>'; } table += '</div>'; table += '<div id="allBookingOrder" style="display:none">'; table += '<div id="allBookingOrder1">'; table += '<span id="orderCountMsg">5 order</span> <span id="orderBook">Book it</span> '; table += '</div>'; table += '</div>'; table += '<div class="clear"></div>'; table += ' </td>'; table += ' </tr>'; table += ' </table>'; table += ' </div>'; table += ' </div>'; table += ' <div class="topStepBoth2">'; table += ' </div>'; table += ' <div class="topStepBoth1">'; table += ' </div>'; table += ' </div>'; table += ' </div>'; table += ' </div>';       table += ' </td>'; table += ' </tr>'; table += ' </table>'; table += ' <div>'; table += ' </div>'; table += '<div id="addEBody" class="single" style="display: none" ><table BORDER=0 CELLPADDING=0 CELLSPACING=0> <tr><td class="topleft"> </td> <td class="topright"></td></tr> <tr><td class="leftborder"> <div id="addE" name="addE" > </div> </td><td class="rightborder"></td></tr> <tr><td class="bottomleft"></td><td class="bottomright"></td></tr> </table></div>';   table += '<div id="addMoreTime" style="display: none"></div>'; table += '<div id="allMoreTimeBox" style="display: none" ></div>'; table += '<div id="overlay" name="overlay" style="display:none"></div>'; table += '<div id="div1" name="div1" ></div>'; table += '<div id="div2" name="div2" ></div>'; table += '<div style="display:none" id="appointyOverlayText" name="appointyOverlayText" onmouseover="hideOverlayHelp_xh=false;" onmouseout="hideOverlayHelp_xh=true;" >' + overlayTextMessage + ' </div>'; table += '<div style="display:none" id="appointyOverlayTextIn" name="appointyOverlayTextIn" > </div>'; table += '<div id="testaddE" name="testaddE" style="display:none"></div>'; table += '<div style="display:block" id="dateChangeDD" onmouseover="_hx()" onmouseout="_hy()"></div><div id="staffAppointmentDiv"></div><div id="monthAppointmentDiv" style="display:none"></div><div id="appSettingDiv" style="display:none"></div>'; table += '<div id="myappointmentday" style="display:none">&nbsp;'; table += '</div>'; table += '<div id="overlayLoadingEffect">&nbsp;'; table += '</div>'; table += '<div id="appNotAll" style="display:none;"><table class="userNoAppointmentMessage" border="0" cellspacing="0" cellpadding="0" width="100%"> <tr><td class="userNoAppointmentMessageClose"><img src="Images/buttonClose1.gif" onClick="_li()" /><td/> </tr> <tr> <td class="userNoAppointmentMessageText">Appointment can be taken only till ' + h_[DateBeforAppCanBook.getMonth()] + ' ' + DateBeforAppCanBook.getDate() + ' ' + DateBeforAppCanBook.getFullYear() + '</td> </tr></table></div>'; table += '<div id="staffServiceDetail" style="display:none"><div id="framDetail" class="framDetail"></div></div>'; table += '<div id="callCenterDetail" style="display:none"></div>'; table += '<div id="SelectionContainer" onmouseover="this.style.display=\'block\'" onmouseout="_nr();" style="display:none"><div id="SelectionText"></div><div class="SelectionBoth2"></div><div class="SelectionBoth1"></div></div>'; table += '<div id="helpContainer" style="display:none;"><table border="0" cellspacing="0" cellpadding="0"> <tr> <td class="leftT" id="leftBarHelp"></td> <td class="rightT" align="right" valign="top"><a href="javascript:void(0);" onclick="_j();" class="closeServiceHelp" />X</a></td> </tr> <tr> <td class="leftB">&nbsp;</td> <td class="rightB">&nbsp;</td> </tr></table></div>'; table += '<div id="loadingOnAnyClick" style="display:none">Loading...</div>'; table += '<div id="loadingOnAnyClickInner" style="display:none"> </div>';   table += '<div id="serviceStaffDetailOnOver" style="top: 392px; left: -500px; width: 210px; visibility: visible;"><div style="width: 210px;"><div style="float: left; position: relative; left: 1px; width: 7px;" id="detailIndicator"><img width="1" height="10" src="images/trans.gif"/><br/><img width="7" height="13" src="images/htip_arrow.gif"/></div><div style="float: left; z-index: 2;"><div style="width: 203px; float: left;"><div style="float: left;"><img width="10" height="10" src="images/htip_top_left.gif"/></div><div style="float: left; background-image: url(images/htip_top_line.gif); width: 183px; height: 10px;"><img width="143" height="10" src="images/trans.gif"/></div><div style="float: left;"><img width="10" height="10" src="images/htip_top_right.gif"/></div></div><div style="clear: both;"/><div style="border-left: 1px solid rgb(207, 207, 207); border-right: 1px solid rgb(207, 207, 207); float: left; width: 201px ! important;"><div class="smalltxt" style="background-color: rgb(255, 255, 255); padding-left: 10px; padding-right: 10px;" id="serviceStaffDetailOnOverTX"></div></div><div style="clear: both;"/><div style="float: left;"><div style="float: left; width: 10px;"><img width="10" height="10" src="images/htip_bottom_left.gif"/></div><div style="float: left; background-image: url(images/htip_bottom_line.gif); width: 183px; height: 10px;"><img width="143" height="10" src="images/trans.gif"/></div><div style="float: left; width: 10px;"><img width="10" height="10" src="images/htip_bottom_right.gif"/></div></div></div></div></div></div></div></div>'; table += ' <div class="ListOfServiceWhenNoLeftBar" style="display:none;" id="serviceListWhenNoLeftBar" onmouseover="_lo();overSelectionFlag = false;" onmouseout="_ln();overSelectionFlag = true;">'; table += ' <table cellspacing="0" cellpadding="0" border="0">'; if ((fh_) || (fg_)) { table += ' <tr>'; table += ' <td class="ListOfServiceWhenNoLeftBarHD">&nbsp;</td>'; table += ' <td class="ListOfServiceWhenNoLeftBarHD">&nbsp;</td>'; if (fg_) { table += ' <td class="ListOfServiceWhenNoLeftBarHD">Time</td>'; } if (fh_) { table += ' <td class="ListOfServiceWhenNoLeftBarHD">' + fo_ + '</td>'; } table += ' </tr>'; } var chkAltColor = 0; var chkAltColorClass = ''; for (i in e_) { if (e_[i][5] == 'False') { if (chCat != e_[i][7] && numOfCat != 1) { chCat = e_[i][7]; table += '<tr class="catHeader">'; table += '<td colspan="4">' + e_[i][8] + '</td>'; table += '</tr>'; } if (chkAltColor == 0) { chkAltColor = 1; chkAltColorClass = 'ListOfServiceWhenNoLeftBarData1'; } else { chkAltColor = 0; chkAltColorClass = 'ListOfServiceWhenNoLeftBarData2'; } table += ' <tr class="srTxSd" id="srTxSd' + i + '">'; table += ' <td class="' + chkAltColorClass + '"><input type="checkbox" name="checkbox" id="serviceCheck' + e_[i][0] + '" value="' + e_[i][0] + '" onclick="_gj(\'cz_\')" /><input type="hidden" name="' + e_[i][0] + '" id="fx_' + e_[i][0] + '" value="' + e_[i][1] + '" /> <input type="hidden" name=serviceTime"' + e_[i][0] + '" id="serviceTime' + e_[i][0] + '" value="' + e_[i][2] + '" />'; table += ' </td>'; table += ' <td class="' + chkAltColorClass + '"><a id="ld' + e_[i][0] + '" style="cursor:pointer">' + e_[i][1] + '</a>'; table += ' </td>'; if (fg_) { table += ' <td class="' + chkAltColorClass + '">' + _qz( e_[i][2]) + '</td>'; } if (fh_) { if(parseFloat(e_[i][3])==0) table += ' <td class="' + chkAltColorClass + '" style="text-align: right;">-</td>'; else table += ' <td class="' + chkAltColorClass + '" style="text-align: right;">' + __aco(e_[i][3]) + '</td>'; } table += ' </tr>'; } } table += ' </table>'; table += ' </div>'; table += ' <div class="ListOfServiceWhenNoLeftBar" style="display:none;" id="staffListWhenNoLeftBar" onmouseover="_lq();overSelectionFlag = false;" onmouseout="_lp();overSelectionFlag = true;">'; table += ' <table cellspacing="0" cellpadding="0" border="0">'; var chkAltColor = 0; var chkAltColorClass = ''; for (i = 0; i < p_.length; i++) { if (p_[i][2] == 'False') { if (chkAltColor == 0) { chkAltColor = 1; chkAltColorClass = 'ListOfServiceWhenNoLeftBarData1'; } else { chkAltColor = 0; chkAltColorClass = 'ListOfServiceWhenNoLeftBarData2'; } table += ' <tr>'; table += ' <td class="' + chkAltColorClass + '" width="13">'; if (fa_ != 1) table += ' <input type="checkbox" name="checkbox" value="' + p_[i][0] + '" /> '; table += ' </td>'; table += ' <td class="' + chkAltColorClass + '"><a href="javascript:void(0);" id="sld' + p_[i][0] + '">' + p_[i][1]; table += ' </a></td>'; table += ' </tr>'; } } table += ' </table>'; table += ' </div>';   table += ' <div id="recAllAvailableTime" style="display:none">'; table += ' <div class="recAllAvailableTimeTopArrow"></div>'; table += ' <div class="recAllAvailableTimeCon">'; table += ' <div id="recAllAvailableTimeTopScroll">&nbsp;</div>'; table += ' <div id="recAllAvailableTimeText"></div>'; table += ' <div id="recAllAvailableTimeBottomScroll">&nbsp;</div>'; table += ' </div>'; table += ' </div>';   table += ' <div id="recRemoveTime" style="display:none">'; table += ' <div class="recAllAvailableTimeTopArrow"></div>'; table += ' <div class="removeMsg">Do you want to remove this appointment from the list?</div>'; table += ' <div id="recRemoveTimeDecision"><span class="removeYN removeY">Yes</span><span class="removeYN removeN">No<span></div>'; table += ' </div>'; table += '</body></html> '; document.writeln(table); $('ap_body').style.visibility = 'hidden';     __acm(); km_ = paraCalDate; if(eval(ge_)) { _im(paraCalDate, 0); } else _gi(paraCalDate, 0); }; function _bp(totalDaysInMonth) {   $(hi_ + "cursor" + hh_).innerHTML = hg_; }; var ed_ = 0; var ee_ = 0; var ef_ = 0; function _bq() { var timeH = $('ap_mother_left_time').offsetHeight; var headerH = $('ap_mother_left_header').offsetHeight; var rightBrH = $('rightBr').offsetHeight; var serviceH = $('ap_mother_left_service').offsetHeight; var serviceHeaderH = $('left_serviceSelection_Header').offsetHeight; var staffH = $('stSelection').offsetHeight; var staffHeaderH = $('staffSelectionHeader').offsetHeight; var serviceTextHeading = $('leftserviceHeader').offsetHeight; var setH = rightBrH - timeH - headerH - 10; var staffExH = 0; var servcieEx = 0; if ($("barServicetext").offsetHeight < (setH / 2 - serviceHeaderH - 5)) servcieEx = setH / 2 - serviceHeaderH - 5 - $("barServicetext").offsetHeight; if ($("staffSelectionBody").offsetHeight < setH / 2 - serviceHeaderH - 5) staffExH = setH / 2 - serviceHeaderH - 5 - $("staffSelectionBody").offsetHeight; if (eval(ff_)) { if (servcieEx == 0 && staffExH == 0) { $("staffSelectionBody").style.height = setH / 2 - staffHeaderH - 5; $("barServicetext").style.height = setH / 2 - serviceTextHeading - serviceHeaderH - 5; } else if (servcieEx == 0) { if ($("barServicetext").offsetHeight > (setH / 2 - serviceHeaderH - 5 + staffExH)) $("barServicetext").style.height = setH / 2 - serviceHeaderH - serviceTextHeading - 5 + staffExH; } else if (staffExH == 0) { if ($("staffSelectionBody").offsetHeight > setH / 2 - serviceHeaderH - 5 + servcieEx) $("staffSelectionBody").style.height = setH / 2 - serviceHeaderH - 5 + servcieEx; } } else { servcieEx = 0; if ($("barServicetext").offsetHeight < (setH - serviceHeaderH - 5)) servcieEx = setH - serviceHeaderH - 5 - $("barServicetext").offsetHeight; if (servcieEx == 0) $("barServicetext").style.height = setH - serviceHeaderH - 5; } if ($("barServicetext").offsetHeight < $("barServicetext").scrollHeight) $('leftserviceHeader').style.width = $('barServicetext').offsetWidth - 15; if ($('ap_mother_left_td').style.display != 'none') { var tbWidth = $('ap_motherDiv').offsetWidth; var temWidth = tbWidth * 25 / 100 - 7; if (temWidth > 300) $('ap_mother_left_td').style.width = temWidth; } $('ap_body').style.visibility = 'visible';     if (ez_ != 1) setTimeout('_ky();', 500); if (ed_ == 0) { setTimeout("_jh()", 200); } $("loading").style.display = "none"; var noOftime = ae_[0] + 90;   leftPotion = $('overlayLoadingEffect').offsetLeft;   _ft(); if ($('serviceStaffDetailOnOver')) _qs(); }; function _jh() { ef_ = $("rightBr").offsetHeight; $("rightBr").style.minHeight = ef_; ed_ = ef_ - 6 * $(km_.getMonth() + 1 + "dh" + km_.getDate()).offsetHeight - _br("right_cal_table") + 2; ee_ = ef_ - $(km_.getMonth() + 1 + "dh" + km_.getDate()).offsetHeight - _br("right_cal_table"); }; function _lj(w, l) { $('overlayLoadingEffect').style.width = w; $('overlayLoadingEffect').style.left = l; l += 15; w -= 15; if (w > 0) setTimeout('_lj(' + w + ',' + l + ')', 1); else $('overlayLoadingEffect').style.display = 'none'; }; function _br(id) { var bdB = 0, bdT = 0, bdW = 0; y = $(id); if (y.currentStyle) { bdT = y.currentStyle['borderTopWidth']; bdB = y.currentStyle['borderBottomWidth']; } else { bdT = window.getComputedStyle(y, "").getPropertyValue('border-top-width'); bdB = window.getComputedStyle(y, "").getPropertyValue('border-bottom-width'); } bdT = bdT.split('px'); bdB = bdB.split('px'); if (!isNaN(bdT[0])) bdW += parseInt(bdT[0]); if (!isNaN(bdB[0])) bdW += parseInt(bdB[0]); return bdW; }; function _bs() { if (eval(ff_)) { $('stSelection').style.display = 'block'; } else { $('stSelection').style.display = 'none'; ks_=false; } if (!eval(gc_) && ez_ == 1) $('ap_mother_left_service').style.display = 'none'; if (!eval(gd_)||parseInt(kq_)!=0) $('ap_mother_left_time').style.display = 'none'; if (!fi_) { $('ap_mother_left_td').style.display = 'none'; $('ap_mother_right_td').style.paddingLeft = 5 + 'px'; } if ($('ap_mother_left_service').style.display == 'none' && $('ap_mother_left_time').style.display == 'none' && $('stSelection').style.display == 'none') { $('ap_mother_left_td').style.display = 'none'; $('ap_mother_right_td').style.paddingLeft = 5 + 'px'; } for (i in e_) { if (e_[i][5] == 'False') { if (eval(fg_)) { if (eval(fh_)) { $('serviceCostTh').innerHTML = fo_; $('serviceCostTd' + i).style.display = 'block'; $("serviceTimeTh").style.width = 55 + 'px'; $("serviceTimeTd" + i).style.width = 55 + 'px'; $("serviceTimeTd" + i).style.fontSize = 11 + 'px'; } $('serviceTimeTh').innerHTML = '&nbsp;'; $('serviceTimeTd' + i).style.display = 'block'; } else { $('serviceTimeTh').innerHTML = '&nbsp;'; $('serviceTimeTd' + i).style.display = 'none'; } if (!(eval(fh_))) { $('serviceCostTh').innerHTML = '&nbsp;'; $('serviceCostTd' + i).style.display = 'none'; } else { $('serviceCostTh').innerHTML = fo_; $('serviceCostTd' + i).style.display = 'block'; } } } if (ed_ == 0) _bq(); }; function _bt() { var datePar = now.getMonth() + 1 + '/' + now.getDate() + '/' + now.getFullYear(); var url = 'searchAppointment.aspx'; var par = 'currentDate=' + datePar; var myAjax = new Ajax.Updater( 'testaddE', url, { method: 'post', parameters: par, evalScripts: true }); }; function _bu() { if (eval(fi_)) { $('leftBar').style.display = 'block'; $('rightBar').style.width = 69 + '%'; } else { $('leftBar').style.display = 'none'; $('rightBar').style.width = 100 + '%'; } }; function _bw() {    }; function _bx() {    }; function _by(d, m) { _bx(); hi_ = m; hh_ = d; _bw(); }; function _bz(Id, wStart, wEnd) { wId.clear(); jy_.clear(); jz_.clear(); wId = Id.split(","); jy_ = wStart.split(","); jz_ = wEnd.split(","); }; function _ca(Id, wStart, wEnd) { wId.clear(); jy_.clear(); jz_.clear(); wId = Id.split(","); jy_ = wStart.split(","); jz_ = wEnd.split(","); }; function _cb() { var serv = document.getElementsByTagName('input'); var flagService = false; var servAll = new Array(); for (i = 0; i < serv.length; i++) { if ((serv[i].type == 'checkbox') && (left(serv[i].id, 7) == 'service')) { servAll.push(serv[i]); } } for (j = 0; j < servAll.length; j++) { if (servAll[j].checked == true) { flagService = true; } } if (flagService && $('startTime').value != "") { $('helpMsg').innerHTML = ' ' + kh_['memberHelpArr16']; new Effect.Highlight('helpMsg'); } if (flagService && $('startTime').value == "") { $('helpMsg').innerHTML = kh_['memberHelpArr17']; new Effect.Highlight('helpMsg'); } if (!flagService && $('startTime').value != "") { $('helpMsg').innerHTML = kh_['memberHelpArr18']; new Effect.Highlight('helpMsg'); } if (!flagService && $('startTime').value == "") { $('helpMsg').innerHTML = kh_['memberHelpArr19']; new Effect.Highlight('helpMsg'); } }; function _cc(id) { if ($('description' + id).style.display == 'none') { $('description' + id).style.display = 'block'; } else { $('description' + id).style.display = 'none'; } }; var kw_; var kx_ = false; function _cd(dt) { kx_ = false; var yr = (now.getFullYear()).toString(); var tdd = new Date(dt); if (todaydate.getDate() == tdd.getDate() && todaydate.getMonth() == tdd.getMonth() && todaydate.getFullYear() == tdd.getFullYear()) tdd = todaydate; if (er_ == 'week') { var dtStr = ''; var tempDT = new Date(dt); var calLastDate = new Date(dt); calLastDate.setDate(calLastDate.getDate() + 6); if (calLastDate.getMonth() == tempDT.getMonth()) dtStr = h_[tempDT.getMonth()] + ' ' + tempDT.getDate() + ' - ' + calLastDate.getDate() + ', ' + calLastDate.getFullYear(); else dtStr = h_[tempDT.getMonth()] + ' ' + tempDT.getDate() + ', ' + tempDT.getFullYear() + ' - ' + h_[calLastDate.getMonth()] + ' ' + calLastDate.getDate() + ', ' + calLastDate.getFullYear(); if (todaydate < tdd && calLastDate < DateBeforAppCanBook) $('pDate').innerHTML = '<table id="showDateWeekformat" ><tr><td><span class="normalDate" id="dateValue">' + dtStr + '</span></td><td class="topCalPre" >&nbsp;</td><td class="topCalnext" >&nbsp;</td><td><input type="button" id="todayDateCal" value="' + kh_['Today'] + '"/></td></tr></table>'; else if (calLastDate < DateBeforAppCanBook) $('pDate').innerHTML = '<table id="showDateWeekformat" ><tr><td><span class="normalDate" id="dateValue">' + dtStr + '</span></td><td>&nbsp;</td><td class="topCalnext" >&nbsp;</td><td><input type="button" id="todayDateCal" disabled="disabled" value="' + kh_['Today'] + '"/></td></tr></table>'; else if (todaydate < tdd) { kx_ = true; $('pDate').innerHTML = '<table id="showDateWeekformat" ><tr><td><span class="normalDate" id="dateValue">' + dtStr + '</span></td><td class="topCalPre" >&nbsp;</td><td >&nbsp;</td><td><input type="button" id="todayDateCal" value="' + kh_['Today'] + '" /></td></tr></table>'; } else { kx_ = true; $('pDate').innerHTML = '<table id="showDateWeekformat" ><tr><td><span class="normalDate" id="dateValue">' + dtStr + '</span></td><td>&nbsp;</td><td >&nbsp;</td><td><input type="button" id="todayDateCal" disabled="disabled" value="' + kh_['Today'] + '"/></td></tr></table>'; } } else { var calLastDate = new Date(tdd); calLastDate.setDate(calLastDate.getDate() + 41); if (todaydate < tdd && calLastDate < DateBeforAppCanBook) $('pDate').innerHTML = '<table id="showDateMonthformat" ><tr><td><span class="normalDate" id="dateValue">' + h_[tdd.getMonth()] + '-' + tdd.getDate() + ' To ' + h_[calLastDate.getMonth()] + '-' + calLastDate.getDate() + '</span></td><td class="topCalPre" >&nbsp;</td><td class="topCalnext">&nbsp;</td><td><input type="button" id="todayDateCal" value="' + kh_['Today'] + '" /></td></tr></table>'; else if (calLastDate < DateBeforAppCanBook) $('pDate').innerHTML = '<table id="showDateMonthformat" ><tr><td><span class="normalDate" id="dateValue">' + h_[tdd.getMonth()] + '-' + tdd.getDate() + ' To ' + h_[calLastDate.getMonth()] + '-' + calLastDate.getDate() + '</span></td><td >&nbsp;</td><td class="topCalnext" >&nbsp;</td><td><input type="button" id="todayDateCal" disabled="disabled" value="' + kh_['Today'] + '"/></td></tr></table>'; else if (todaydate < tdd) { kx_ = true; $('pDate').innerHTML = '<table id="showDateMonthformat" ><tr><td><span class="normalDate" id="dateValue">' + h_[tdd.getMonth()] + '-' + tdd.getDate() + ' To ' + h_[calLastDate.getMonth()] + '-' + calLastDate.getDate() + '</span></td><td class="topCalPre" ></td><td >&nbsp;</td><td><input type="button" id="todayDateCal" value="' + kh_['Today'] + '" /></td></tr></table>'; } else { kx_ = true; $('pDate').innerHTML = '<table id="showDateMonthformat" ><tr><td><span class="normalDate" id="dateValue">' + h_[tdd.getMonth()] + '-' + tdd.getDate() + ' To ' + h_[calLastDate.getMonth()] + '-' + calLastDate.getDate() + '</span></td><td ></td><td >&nbsp;</td><td><input type="button" id="todayDateCal" disabled="disabled" value="' + kh_['Today'] + '"/></td></tr></table>'; } } $('dateValue').className = 'onChangeDate'; clearTimeout(kw_); kw_ = setTimeout("$('dateValue').className='normalDate'", 1000); ir_["moveCalByNPT"] = dt; _gj(de_); }; function showserviceWhenNoLeftBar() { $('choseServiceSpan').className = 'onmouseoverChoose'; if($('choseServiceImage')) $('choseServiceImage').className = 'onmouseoverChooseImg'; }; function hideserviceWhenNoLeftBar() { $('choseServiceSpan').className = 'onmouseoutChoose'; if($('choseServiceImage')) $('choseServiceImage').className = 'onmouseoutChooseImg'; }; function showserviceListWhenNoLeftBar() { var leftpos = 0; var toppos = 0; aTag = document.getElementById('choseServiceSpan'); do { aTag = aTag.offsetParent; leftpos += aTag.offsetLeft; toppos += aTag.offsetTop; if (aTag.offsetParent == null) break } while (aTag.tagName != "BODY"); document.getElementById('serviceListWhenNoLeftBar').style.left = leftpos + $('choseServiceSpan').offsetLeft + 'px'; document.getElementById('serviceListWhenNoLeftBar').style.top = (document.getElementById('choseServiceSpan').offsetTop + toppos + document.getElementById('choseServiceSpan').offsetHeight) + 'px';   $('serviceListWhenNoLeftBar').style.display = 'block'; $('serviceListWhenNoLeftBar').style.height='auto'; var stListH=$('serviceListWhenNoLeftBar').offsetHeight; if(stListH>$('rightBr').offsetHeight+60) $('serviceListWhenNoLeftBar').style.height=$('rightBr').offsetHeight+60+'px'; overSelectionFlag = false; }; function _lk() { $('choseStaffSpan').className = 'onmouseoverChoose'; $('choseStaffImage').className = 'onmouseoverChooseImg'; }; function _ll() { $('choseStaffSpan').className = 'onmouseoutChoose'; $('choseStaffImage').className = 'onmouseoutChooseImg'; }; function _lm() { var leftpos = 0; var toppos = 0; aTag = document.getElementById('choseStaffSpan'); do { aTag = aTag.offsetParent; leftpos += aTag.offsetLeft; toppos += aTag.offsetTop; if (aTag.offsetParent == null) break } while (aTag.tagName != "BODY"); document.getElementById('staffListWhenNoLeftBar').style.left = leftpos + $('choseStaffSpan').offsetLeft + 'px'; document.getElementById('staffListWhenNoLeftBar').style.top = (document.getElementById('choseStaffSpan').offsetTop + toppos + document.getElementById('choseStaffSpan').offsetHeight) + 'px';   $('staffListWhenNoLeftBar').style.display = 'block'; $('staffListWhenNoLeftBar').style.height='auto'; var stListH=$('staffListWhenNoLeftBar').offsetHeight; if(stListH>$('rightBr').offsetHeight+60) $('staffListWhenNoLeftBar').style.height=$('rightBr').offsetHeight+60+'px'; overSelectionFlag = false; }; function _ln() {   $('serviceListWhenNoLeftBar').style.display = 'none';   overSelectionFlag = false; }; function _lo() {   $('serviceListWhenNoLeftBar').style.display = 'block';  }; function _lp() {   $('staffListWhenNoLeftBar').style.display = 'none';   overSelectionFlag = false; }; function _lq() {   $('staffListWhenNoLeftBar').style.display = 'block'; $('helpContainer').style.display = 'none'; }; var protoDate=new Date(); Date.prototype._lr=function(s) { this.value=s; }; Date.prototype._ce=function(){ year = this.getFullYear(); return (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) ? true : false; }; Date.prototype._cf=function() { switch(this.getMonth()) { case 10 : return 30; case 3 : return 30; case 5 : return 30; case 8 : return 30; case 1 : if (this._ce()) {return 29;} else {return 28;} default : return 31; } }; Date.prototype._cg=function() { var firstofmonth = (this.getDay() - (this.getDate()%7))+1; if (firstofmonth < 0) {firstofmonth += 7;} return firstofmonth; }; Date.prototype._ch=function(weekDay) { monthdays = this._cf(); firstdayofmonth = this._cg(); if (weekDay >= firstdayofmonth) { firstdateofrequiredvalue = 1 + (weekDay - firstdayofmonth); } else { firstdateofrequiredvalue = 1 + (7 - firstdayofmonth + parseInt(weekDay)); } var aSpecificdaydatesinamonth = new Array(); while ((firstdateofrequiredvalue)<=(monthdays)) { aSpecificdaydatesinamonth.push(firstdateofrequiredvalue); firstdateofrequiredvalue +=7; } return aSpecificdaydatesinamonth; }; Date.prototype._ci=function(){ var toDate=new Date(); this.setDate(1); this.setMonth(this.getMonth()-1); if(this.getMonth()==toDate.getMonth()) dd=toDate.getDate(); else dd=this.getDate(); mm=this.getMonth(); yy=this.getFullYear(); this.setMonth(this.getMonth()+1); return (mm+1)+'/'+dd+'/'+yy; }; Date.prototype._cj=function(){ var toDate=new Date(); this.setDate(1); this.setMonth(this.getMonth()+1); if(this.getMonth()==toDate.getMonth()) dd=toDate.getDate(); else dd=this.getDate(); mm=this.getMonth(); yy=this.getFullYear(); this.setMonth(this.getMonth()-1); return (mm+1)+'/'+dd+'/'+yy; }; Date.prototype._ck=function(){ dd=this.getDate(); mm=this.getMonth(); yy=this.getFullYear(); return (mm+1)+'/'+dd+'/'+yy; }; Date.prototype._cl=function() { var rt=''; var md=new Date(); rt=this.getMonth()+1; if(this.getMonth()==md.getMonth() && this.getFullYear()==md.getFullYear()) rt+='/'+this.getDate(); else rt+='/'+1; rt+='/'+this.getFullYear(); return rt; }; Date.prototype._cm=function () { var rt=''; var md=new Date(); rt=this.getMonth()+1; rt+='/'+this.getDate(); rt+='/'+this.getFullYear(); return rt; }; Date.prototype._cn=function() { hour = this.getHours(); minute = this.getMinutes(); second = this.getSeconds(); return hour + ':' + minute + ':' + second; }; Array.prototype._co = function (element) { var result = false; var array = []; for (var i = 0; i < this.length; i++) { if (this[i] == element) { result = true; } else { array.push(this[i]); } } this.clear(); for (var i = 0; i < array.length; i++) { this.push(array[i]); } array = null; return result; }; Array.prototype._cp = function (value,caseSensitive) { var i; for (i=0; i < this.length; i++) { if(caseSensitive) { if (this[i].toLowerCase() == value.toLowerCase()) { return true;} } else { if (this[i] == value) {return true;} } } return false; }; _cq = function (value,arr) { var dayDate=new Date(value); for (i=0; i < arr.length; i++) { var tepDate=new Date(arr[i]); if(dayDate.getDate()==tepDate.getDate() && dayDate.getMonth()== tepDate.getMonth() && dayDate.getFullYear() == tepDate.getFullYear()) { return true; } } return false; }; Array.prototype._cr=function(){ for(var i=0;i<this.length;i) this.pop(); }; Array.prototype._cs=function(element) { var result = false; var array = []; for (var i = 0; i < this.length; i++) { if (i == element) { result = true; } else { array.push(this[i]); } } this.clear(); for (var i = 0; i < array.length; i++) { this.push(array[i]); } array .length=0; return result; }; function _ls() { ae_ = getPageSize(); if(ae_[0]-30<720) $("ap_motherDiv").style.width=720+'px'; else $("ap_motherDiv").style.width=100+'%'; if(er_=='week' || er_=='month') { ed_=0; ee_=0; $("rightBr").style.minHeight=10+'px'; $("rightBr").style.height='auto'; if($("staffSelectionBody")) $("staffSelectionBody").style.height='auto'; if($("barServicetext")) $("barServicetext").style.height='auto'; if(er_=='week') hieghtOfTd=(ae_[3]-167); else hieghtOfTd=(ae_[3]-260)/6; kl_=new Date(km_); if(er_=='week') noOfDay=7; else noOfDay=42; for(ii=1;ii<=noOfDay;ii++) { var tDay = kl_.getDate(); var tMon = kl_.getMonth()+1; $("dateContainer"+ii).style.height=hieghtOfTd-1; $(tMon+"d"+tDay).style.height=hieghtOfTd-1; $("availD"+ii).style.height=hieghtOfTd-1; $("notAvailD"+ii).style.height=hieghtOfTd-1; $("daysAllAppointment"+ii).style.height=hieghtOfTd-1; $("daysAllAppointmentText"+ii).style.height=hieghtOfTd-40; kl_.setDate(kl_.getDate()+1); }   _bs(); } }; function _rf(obj) {   im_=obj.value; in_=im_-il_; checkTimeAndService();  }; function _ct () { _eg(); _bo(serverDate); _hg(); refreshTimePicker(0); refreshTimePicker1(0);   setTimeout(function(){checkDiscountCouponSet(ig_,ih_,ii_,ij_);},2000); } window.onresize=_ls; function _cx(allDAtaArray) { var newStaffArray=new Array(),newStartSevriceArray=new Array(),newEndSevriceArray=new Array(),stAndEt=new Array(); var DayVar=0,StaffVar=0; jg_.length=0; iy_.length=0; for (i in iy_) { iy_[i].length=0; } for (i in jg_) { jg_[i].length=0; } var j=allDAtaArray.length; for(var i=0;i<j;i++) { apDt=new Date(allDAtaArray[i][2]); var dtPath=apDt.getMonth()+1+'/'+ apDt.getDate()+'/'+apDt.getFullYear(); apDt=new Date(allDAtaArray[i][2]); apDt.setHours(apDt.getHours()+parseInt(kq_)); var dtPath1=apDt.getMonth()+1+'/'+ apDt.getDate()+'/'+apDt.getFullYear(); if(typeof(iy_[dtPath1+'/'+allDAtaArray[i][4]])=='undefined') { iy_[dtPath1+'/'+allDAtaArray[i][4]]=new Array(); } iy_[dtPath1+'/'+allDAtaArray[i][4]].push(new Array(allDAtaArray[i][2],allDAtaArray[i][4],allDAtaArray[i][5],allDAtaArray[i][6],allDAtaArray[i][7],allDAtaArray[i][8],allDAtaArray[i][9])); if(typeof(jg_[dtPath+'/'+allDAtaArray[i][1]])=='undefined') { jg_[dtPath+'/'+allDAtaArray[i][1]]=new Array(); } jg_[dtPath+'/'+allDAtaArray[i][1]].push(new Array(allDAtaArray[i][2],allDAtaArray[i][3],allDAtaArray[i][10])); } _gg(); };  function Epoch(name,mode,targetelement,multiselect) { var self = this;   function calConfig() { self.versionNumber = '2.0.1'; self.displayYearInitial = self.curDate.getFullYear();   self.displayMonthInitial = self.curDate.getMonth();   self.displayYear = self.displayYearInitial; self.displayMonth = self.displayMonthInitial; self.minDate = new Date(1940,3,1); self.maxDate = new Date(2059,6,31); self.startDay = 0;   self.showWeeks = true;   self.selCurMonthOnly = true;   } function setLang() { self.daylist = new Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat','Sun','Mon','Tue','Wed','Thu','Fri','Sat'); self.months_sh = new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'); self.monthup_title = 'Go to the next month'; self.monthdn_title = 'Go to the previous month'; self.clearbtn_caption = 'Clear'; self.clearbtn_title = 'Clears any dates selected on the calendar'; self.maxrange_caption = 'This is the maximum range'; self.closebtn_caption = 'Close'; self.closebtn_title = 'Close the calendar'; } function setDays() { self.daynames = new Array(); var j=0; for(var i=self.startDay;i<self.startDay + 7;i++) { self.daynames[j++] = self.daylist[i]; } self.monthDayCount = new Array(31,((self.curDate.getFullYear() - 2000) % 4 ? 28 : 29),31,30,31,30,31,31,30,31,30,31); } function createCalendar() { var tbody, tr, td; self.calendar = document.createElement('table'); self.calendar.setAttribute('id',self.name+'_calendar'); setClass(self.calendar,'calendar'); self.calendar.style.display = 'none';     addEventHandler(self.calendar,'selectstart', function() {return false;}); addEventHandler(self.calendar,'drag', function() {return false;}); tbody = document.createElement('tbody');   tr = document.createElement('tr'); td = document.createElement('td'); td.appendChild(createMainHeading()); tr.appendChild(td); tbody.appendChild(tr);   tr = document.createElement('tr'); td = document.createElement('td'); self.calendar.celltable = document.createElement('table'); setClass(self.calendar.celltable,'cells'); self.calendar.celltable.appendChild(createDayHeading()); self.calendar.celltable.appendChild(createCalCells()); td.appendChild(self.calendar.celltable); tr.appendChild(td); tbody.appendChild(tr);   tr = document.createElement('tr'); td = document.createElement('td'); td.appendChild(createFooter()); tr.appendChild(td); tbody.appendChild(tr);   self.calendar.appendChild(tbody);   addEventHandler(self.calendar,'mouseover',cal_onmouseover); addEventHandler(self.calendar,'mouseout',cal_onmouseout); } function createMainHeading() {   var container = document.createElement('div'); setClass(container,'mainheading');   self.monthSelect = document.createElement('select'); self.yearSelect = document.createElement('select'); var monthDn = document.createElement('input'), monthUp = document.createElement('input'); var opt, i;   for(i=0;i<12;i++) { opt = document.createElement('option'); opt.setAttribute('value',i); if(self.displayMonth == i) { opt.setAttribute('selected','selected'); } opt.appendChild(document.createTextNode(self.months_sh[i])); self.monthSelect.appendChild(opt); }   var yrMax = self.maxDate.getFullYear(), yrMin = self.minDate.getFullYear(); for(i=yrMin;i<=yrMax;i++) { opt = document.createElement('option'); opt.setAttribute('value',i); if(self.displayYear == i) { opt.setAttribute('selected','selected'); } opt.appendChild(document.createTextNode(i)); self.yearSelect.appendChild(opt); }   monthUp.setAttribute('type','button'); monthUp.setAttribute('value','>'); monthUp.setAttribute('title',self.monthup_title); monthDn.setAttribute('type','button'); monthDn.setAttribute('value','<'); monthDn.setAttribute('title',self.monthdn_title); self.monthSelect.owner = self.yearSelect.owner = monthUp.owner = monthDn.owner = self;     function selectonchange() { if(self.goToMonth(self.yearSelect.value,self.monthSelect.value)) { self.displayMonth = self.monthSelect.value; self.displayYear = self.yearSelect.value; } else { self.monthSelect.value = self.displayMonth; self.yearSelect.value = self.displayYear; } } addEventHandler(monthUp,'click',function(){self.nextMonth();}); addEventHandler(monthDn,'click',function(){self.prevMonth();}); addEventHandler(self.monthSelect,'change',selectonchange); addEventHandler(self.yearSelect,'change',selectonchange);   container.appendChild(monthDn); container.appendChild(self.monthSelect); container.appendChild(self.yearSelect); container.appendChild(monthUp); return container; } function createFooter() { var container = document.createElement('div'); var clearSelected = document.createElement('input'); clearSelected.setAttribute('type','button'); clearSelected.setAttribute('value',self.clearbtn_caption); clearSelected.setAttribute('title',self.clearbtn_title); clearSelected.owner = self; addEventHandler(clearSelected,'click',function() {self.resetSelections(false);}); container.appendChild(clearSelected); if(self.mode == 'popup') { var closeBtn = document.createElement('input'); closeBtn.setAttribute('type','button'); closeBtn.setAttribute('value',self.closebtn_caption); closeBtn.setAttribute('title',self.closebtn_title); addEventHandler(closeBtn,'click',function(){self.hide();}); setClass(closeBtn,'closeBtn'); container.appendChild(closeBtn); } return container; } function createDayHeading() {   self.calHeading = document.createElement('thead'); setClass(self.calHeading,'caldayheading'); var tr = document.createElement('tr'), th; self.cols = new Array(false,false,false,false,false,false,false);   if(self.showWeeks) { th = document.createElement('th'); setClass(th,'wkhead'); tr.appendChild(th); }   for(var dow=0;dow<7;dow++) { th = document.createElement('th'); th.appendChild(document.createTextNode(self.daynames[dow])); if(self.selectMultiple) {   th.headObj = new CalHeading(self,th,(dow + self.startDay < 7 ? dow + self.startDay : dow + self.startDay - 7)); } tr.appendChild(th); } self.calHeading.appendChild(tr); return self.calHeading; }     function createCalCells() { self.rows = new Array(false,false,false,false,false,false); self.cells = new Array(); var row = -1, totalCells = (self.showWeeks ? 48 : 42); var beginDate = new Date(self.displayYear,self.displayMonth,1); var endDate = new Date(self.displayYear,self.displayMonth,self.monthDayCount[self.displayMonth]); var sdt = new Date(beginDate); sdt.setDate(sdt.getDate() + (self.startDay - beginDate.getDay()) - (self.startDay - beginDate.getDay() > 0 ? 7 : 0) );   self.calCells = document.createElement('tbody'); var tr,td; var cellIdx = 0, cell, week, dayval; for(var i=0;i<totalCells;i++) { if(self.showWeeks) {   if(i % 8 == 0) { row++; week = sdt.getWeek(self.startDay); tr = document.createElement('tr'); td = document.createElement('td'); if(self.selectMultiple) {   td.weekObj = new WeekHeading(self,td,week,row) } else {  setClass(td,'wkhead'); } td.appendChild(document.createTextNode(week)); tr.appendChild(td); i++; } } else if(i % 7 == 0) {   row++; week = sdt.getWeek(self.startDay); tr = document.createElement('tr'); }   dayval = sdt.getDate(); td = document.createElement('td'); td.appendChild(document.createTextNode(dayval)); cell = new CalCell(self,td,sdt,row,week);  self.cells[cellIdx] = cell; td.cellObj = cell; tr.appendChild(td); self.calCells.appendChild(tr); self.reDraw(cellIdx++);   sdt.setDate(dayval + 1);   } return self.calCells; }     function setMode(targetelement) { if(self.mode == 'popup') {   self.calendar.style.position = 'absolute'; }   if(targetelement) { switch(self.mode) { case 'flat': self.tgt = targetelement; self.tgt.appendChild(self.calendar); self.visible = true; break; case 'popup': self.calendar.style.position = 'absolute'; document.body.appendChild(self.calendar); self.setTarget(targetelement,false); break; } } else {   document.body.appendChild(self.calendar); self.visible = false; } }     function deleteCells() { self.calendar.celltable.removeChild(self.calendar.celltable.childNodes[1]);   }     function setClass(element,className) { element.setAttribute('class',className); element.setAttribute('className',className);   }   function setCellProperties(cellindex) { var cell = self.cells[cellindex]; var date; idx = self.dateInArray(self.dates,cell.date); if(idx > -1) { date = self.dates[idx];   cell.date.selected = date.selected || false; cell.date.type = date.type; cell.date.canSelect = date.canSelect; cell.setTitle(date.title); cell.setURL(date.href); cell.setHTML(date.cellHTML); } else { cell.date.selected = false;   }   if(cell.date.getTime() < self.minDate.getTime() || cell.date.getTime() > self.maxDate.getTime()) { cell.date.canSelect = false; } cell.setClass(); }   function cal_onmouseover() { self.mousein = true; }   function cal_onmouseout() { self.mousein = false; }     function updateSelectedDates() { var idx = 0; self.selectedDates = new Array(); for(i=0;i<self.dates.length;i++) { if(self.dates[i].selected) { self.selectedDates[idx++] = self.dates[i]; } } }       self.dateInArray = function(arr,searchVal,startIndex) { startIndex = (startIndex != null ? startIndex : 0);   for(var i=startIndex;i<arr.length;i++) { if(searchVal.getUeDay() == arr[i].getUeDay()) { return i; } } return -1; };     self.setTarget = function (targetelement, focus) {   if(self.mode == 'popup') {   function popupFocus() { self.show(); } function popupBlur() { if(!self.mousein){ self.hide(); } } function popupKeyDown() { self.hide(); }   if(self.tgt) { removeEventHandler(self.tgt,'focus',popupFocus); removeEventHandler(self.tgt,'blur',popupBlur); removeEventHandler(self.tgt,'keydown',popupKeyDown); }   self.tgt = targetelement;   var dto = self.tgt.dateObj,pdateArr = new Array;   if(dto) { if(self.tgt.value.length) {   pdateArr[0] = dto; } self.goToMonth(dto.getFullYear(),dto.getMonth());   } self.selectDates(pdateArr,true,true,true); self.topOffset = self.tgt.offsetHeight;   self.leftOffset = 0;   self.updatePos(self.tgt);   addEventHandler(self.tgt,'focus',popupFocus); addEventHandler(self.tgt,'blur',popupBlur); addEventHandler(self.tgt,'keydown',popupKeyDown); if(focus !== false) {   popupFocus(); } } else {     if(self.tgt) { self.tgt.removeChild(self.calendar); }   self.tgt = targetelement; self.tgt.appendChild(self.calendar); self.show(); } };     self.nextMonth = function () { var month = self.displayMonth; var year = self.displayYear;   if(self.displayMonth < 11) {   month++; } else if(self.yearSelect.value < self.maxDate.getFullYear()) {   month = 0; year++; } return self.goToMonth(year,month); };     self.prevMonth = function () { var month = self.displayMonth; var year = self.displayYear;   if(self.displayMonth > 0) {   month--; } else {   month = 11; year--; } return self.goToMonth(year,month); };     self.goToMonth = function (year,month) { var testdatemin = new Date(year, month, 31); var testdatemax = new Date(year, month, 1); if(testdatemin >= self.minDate && testdatemax <= self.maxDate) { self.monthSelect.value = self.displayMonth = month; self.yearSelect.value = self.displayYear = year;   createCalCells(); deleteCells(); self.calendar.celltable.appendChild(self.calCells); return true; } else { alert(self.maxrange_caption); return false; } };     self.updatePos = function (target) { if(self.mode == 'popup') { self.calendar.style.display = 'block';     if(getTop(target) + self.topOffset -self.calendar.offsetHeight>0){ if($('ap_right_appDetail')) self.calendar.style.top = getTop(target) + self.topOffset -self.calendar.offsetHeight-$('ap_right_appDetail').scrollTop+ 'px'; else self.calendar.style.top = getTop(target) + self.topOffset -self.calendar.offsetHeight+ 'px'; } else{ if($('ap_right_appDetail')) self.calendar.style.top = getTop(target) + self.topOffset-$('ap_right_appDetail').scrollTop+ 'px'; else self.calendar.style.top = getTop(target) + self.topOffset+ 'px'; } self.calendar.style.left = getLeft(target) + self.leftOffset + 'px'; } };     self.show = function () { self.updatePos(self.tgt);   self.calendar.style.display = 'block';   self.visible = true; };     self.hide = function () { self.calendar.style.display = 'none'; self.visible = false; };     self.toggle = function () { self.visible ? self.hide() : self.show(); };     self.addDates = function (dates,redraw) { var i; for(i=0;i<dates.length;i++) { if(self.dateInArray(self.dates,dates[i]) == -1) {   self.dates[self.dates.length] = dates[i]; } }   updateSelectedDates(); if(redraw != false) {   self.reDraw(); } };     self.removeDates = function (dates,redraw) { var idx; for(var i=0;i<dates.length;i++) { idx = self.dateInArray(self.dates,dates[i]); if(idx != -1) {   self.dates.splice(idx,1); } } updateSelectedDates(); if(redraw != false) {   self.reDraw(); } };     self.selectDates = function (inpdates,selectVal,redraw,removeothers) { var i, idx; if(removeothers == true) { for(i=0;i<self.dates.length;i++) { self.dates[i].selected = false; } } for(i=0;i<inpdates.length;i++) { idx = self.dateInArray(self.dates,inpdates[i]); if(selectVal == true) { inpdates[i].selected = true; if(idx == -1) {   self.dates[self.dates.length] = inpdates[i]; } else {   self.dates[idx].selected = true; } } else {   if(idx > -1) {   self.dates[idx].selected = inpdates[i].selected = false; if(self.dates[idx].type == 'normal') {   self.dates.splice(idx,1); } } } }   updateSelectedDates(); if(redraw != false) {   self.reDraw(); } };     self.sendForm = function(form,inputname) { var inp = inputname || 'epochdates'; for(var i=0;i<self.dates.length;i++) { inp = document.createElement('input'); inp.setAttribute('type','hidden'); inp.setAttribute('name',inputname + '[]'); inp.setAttribute('value',encodeURIComponent(self.dates[i].dateFormat('Y-m-d')));   form.appendChild(inp); } };     self.resetSelections = function (retMonth) { var dateArray = new Array(); var dt = self.dates; for(var i=0;i<dt.length;i++) { if(dt[i].selected) { dateArray[dateArray.length] = dt[i]; } } self.selectDates(dateArray,false,false); self.rows = new Array(false,false,false,false,false,false,false); self.cols = new Array(false,false,false,false,false,false,false); if(self.mode == 'popup') {   self.tgt.value = ''; self.hide(); } retMonth == true ? self.goToMonth(self.displayYearInitial,self.displayMonthInitial) : self.reDraw(); };     self.reDraw = function (index) { self.state = 1; var len = index ? index + 1 : self.cells.length; for(var i = index || 0;i<len;i++) { setCellProperties(i); } self.state = 2; };     self.getCellIndex = function(date) { for(var i=0;i<self.cells.length;i++) { if(self.cells[i].date.getUeDay() == date.getUeDay()) { return i; } } return -1; };       self.state = 0; self.name = name; if(targetelement.value=='') self.curDate = new Date(); else self.curDate = new Date(targetelement.value); self.mode = mode; self.selectMultiple = (multiselect == true);     self.dates = new Array();   self.selectedDates = new Array(); self.calendar; self.calHeading; self.calCells; self.rows; self.cols; self.cells = new Array();   self.monthSelect; self.yearSelect; self.mousein = false;   calConfig(); setLang(); setDays(); createCalendar();   setMode(targetelement); self.state = 2;   self.visible ? self.show() : self.hide(); }      function CalHeading(owner,tableCell,dayOfWeek) {   function DayHeadingonclick() {    var sdates = owner.dates; var cells = owner.cells; var dateArray = new Array(); owner.cols[dayOfWeek] = !owner.cols[dayOfWeek]; for(var i=0;i<cells.length;i++) {   if(cells[i].dayOfWeek == dayOfWeek && cells[i].date.canSelect && (!owner.selCurMonthOnly || cells[i].date.getMonth() == owner.displayMonth && cells[i].date.getFullYear() == owner.displayYear)) {   dateArray[dateArray.length] = cells[i].date; } } owner.selectDates(dateArray,owner.cols[dayOfWeek],true); }   var self = this; self.dayOfWeek = dayOfWeek; addEventHandler(tableCell,'mouseup',DayHeadingonclick); }     function WeekHeading(owner,tableCell,week,tableRow) {   function weekHeadingonclick() {   var cells = owner.cells; var sdates = owner.dates; var dateArray = new Array(); owner.rows[tableRow] = !owner.rows[tableRow]; for(var i=0;i<cells.length;i++) { if(cells[i].tableRow == tableRow && cells[i].date.canSelect && (!owner.selCurMonthOnly || cells[i].date.getMonth() == owner.displayMonth && cells[i].date.getFullYear() == owner.displayYear)) {   dateArray[dateArray.length] = cells[i].date; } } owner.selectDates(dateArray,owner.rows[tableRow],true); }   var self = this; self.week = week; tableCell.setAttribute('class','wkhead'); tableCell.setAttribute('className','wkhead');   addEventHandler(tableCell,'mouseup',weekHeadingonclick); }       function CalCell(owner,tableCell,dateObj,row,week) { var self = this;   function calCellonclick() { if(self.date.canSelect) { if(owner.selectMultiple == true) {   owner.selectDates(new Array(self.date),!self.date.selected,false); self.setClass();   } else {   owner.selectDates(new Array(self.date),true,false,true); if(owner.mode == 'popup') {   owner.tgt.value = self.date.dateFormat();   owner.tgt.dateObj = new Date(self.date);   owner.hide(); } owner.reDraw();   } } }     function calCellonmouseover() { if(self.date.canSelect) { tableCell.setAttribute('class',self.cellClass + ' hover'); tableCell.setAttribute('className',self.cellClass + ' hover'); } }     function calCellonmouseout() { self.setClass(); }     self.setClass = function () { if(self.date.canSelect !== false) { if(self.date.selected) { self.cellClass = 'cell_selected'; } else if(owner.displayMonth != self.date.getMonth() ) { self.cellClass = 'notmnth'; } else if(self.date.type == 'holiday') { self.cellClass = 'hlday'; } else if(self.dayOfWeek > 0 && self.dayOfWeek < 6) { self.cellClass = 'wkday'; } else { self.cellClass = 'wkend'; } } else { self.cellClass = 'noselect'; }   if(self.date.getUeDay() == owner.curDate.getUeDay()) { self.cellClass = self.cellClass + ' curdate'; } tableCell.setAttribute('class',self.cellClass); tableCell.setAttribute('className',self.cellClass);   };     self.setURL = function(href,type) { if(href) { if(type == 'js') {   addEventHandler(self.tableCell,'mousedown',function(){window.location.href = href;}); } else {   var url = document.createElement('a'); url.setAttribute('href',href); url.appendChild(document.createTextNode(self.date.getDate())); self.tableCell.replaceChild(url,self.tableCell.firstChild);   } } };     self.setTitle = function(titleStr) { if(titleStr && titleStr.length > 0) { self.title = titleStr; self.tableCell.setAttribute('title',titleStr); } };     self.setHTML = function(html) { if(html && html.length > 0) { if(self.tableCell.childNodes[1]) { self.tableCell.childNodes[1].innerHTML = html; } else { var htmlCont = document.createElement('div'); htmlCont.innerHTML = html; self.tableCell.appendChild(htmlCont); } } };   self.cellClass;   self.tableRow = row; self.tableCell = tableCell; self.date = new Date(dateObj); self.date.canSelect = true;   self.date.type = 'normal';   self.date.selected = false;   self.date.cellHTML = ''; self.dayOfWeek = self.date.getDay(); self.week = week;   addEventHandler(tableCell,'click', calCellonclick); addEventHandler(tableCell,'mouseover', calCellonmouseover); addEventHandler(tableCell,'mouseout', calCellonmouseout); self.setClass(); }   Date.prototype.getDayOfYear = function ()  { return parseInt((this.getTime() - new Date(this.getFullYear(),0,1).getTime())/86400000 + 1); };    Date.prototype.getWeek = function (dowOffset) { dowOffset = typeof(dowOffset) == 'int' ? dowOffset : 0;   var newYear = new Date(this.getFullYear(),0,1); var day = newYear.getDay() - dowOffset;   day = (day >= 0 ? day : day + 7); var weeknum, daynum = Math.floor((this.getTime() - newYear.getTime() - (this.getTimezoneOffset()-newYear.getTimezoneOffset())*60000)/86400000) + 1;   if(day < 4) { weeknum = Math.floor((daynum+day-1)/7) + 1; if(weeknum > 52) { nYear = new Date(this.getFullYear() + 1,0,1); nday = nYear.getDay() - dowOffset; nday = nday >= 0 ? nday : nday + 7; weeknum = nday < 4 ? 1 : 53;   } } else { weeknum = Math.floor((daynum+day-1)/7); } return weeknum; };  Date.prototype.getUeDay = function ()  { return parseInt(Math.floor((this.getTime() - this.getTimezoneOffset() * 60000)/86400000));  };  Date.prototype.dateFormat = function(format) { if(!format) {   format = 'm/d/Y'; } LZ = function(x) {return(x < 0 || x > 9 ? '' : '0') + x}; var MONTH_NAMES = new Array('January','February','March','April','May','June','July','August','September','October','November','December','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'); var DAY_NAMES = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sun','Mon','Tue','Wed','Thu','Fri','Sat'); var result=""; var i_format=0; var c=""; var token=""; var y=this.getFullYear().toString(); var M=this.getMonth()+1; var d=this.getDate(); var E=this.getDay(); var H=this.getHours(); var m=this.getMinutes(); var s=this.getSeconds(); value = { Y: y.toString(), y: y.substring(2), n: M, m: LZ(M), F: MONTH_NAMES[M-1], M: MONTH_NAMES[M+11], j: d, d: LZ(d), D: DAY_NAMES[E+7], l: DAY_NAMES[E], G: H, H: LZ(H) }; if (H==0) {value['g']=12;} else if (H>12){value['g']=H-12;} else {value['g']=H;} value['h']=LZ(value['g']); if (H > 11) {value['a']='pm'; value['A'] = 'PM';} else { value['a']='am'; value['A'] = 'AM';} value['i']=LZ(m); value['s']=LZ(s);   while (i_format < format.length) { c=format.charAt(i_format); token=""; while ((format.charAt(i_format)==c) && (i_format < format.length)) { token += format.charAt(i_format++); } if (value[token] != null) { result=result + value[token]; } else { result=result + token; } } return result; };    function addEventHandler(element, type, func) {   if(element.addEventListener) { element.addEventListener(type,func,false); } else if (element.attachEvent) { element.attachEvent('on'+type,func); } }  function removeEventHandler(element, type, func) {   if(element.removeEventListener) { element.removeEventListener(type,func,false); } else if (element.attachEvent) { element.detachEvent('on'+type,func); } }  function getTop(element) {  var oNode = element; var iTop = 0; while(oNode.tagName != 'HTML') { iTop += oNode.offsetTop || 0; if(oNode.offsetParent) {   oNode = oNode.offsetParent; } else { break; } } return iTop; }  function getLeft(element) {   var oNode = element; var iLeft = 0; while(oNode.tagName != 'HTML') { iLeft += oNode.offsetLeft || 0; if(oNode.offsetParent) {   oNode = oNode.offsetParent; } else { break; } } return iLeft; }  function _eg() {   iu_['slotAvailableInWeek']=kh_['memberHelpArr1']; iu_['noSlotAvailableInFull DayInWeek']=kh_['AppHelpArr2']+'&nbsp;&nbsp;<a href="#" onclick="_gb(7);">'+kh_['AppHelpArr3']+'</a>'; iu_['noSlotAvailableInMorningInWeek']=kh_['AppHelpArr4']+' &nbsp;&nbsp; <a href="#" onclick="_pg();">'+kh_['AppHelpArr5']+'</a> &nbsp;&nbsp; <a href="#">'+kh_['AppHelpArr6']+'</a>'; iu_['noSlotAvailableInAfternoonInWeek']=kh_['AppHelpArr7']+' &nbsp;&nbsp; <a href="#" onclick="_pg();">'+kh_['AppHelpArr5']+'</a> &nbsp;&nbsp; <a href="#">'+kh_['AppHelpArr8']+'</a>'; iu_['noSlotAvailableInEveningInWeek']=kh_['AppHelpArr9']+' &nbsp;&nbsp; <a href="#" onclick="_pg();">'+kh_['AppHelpArr5']+'</a> &nbsp;&nbsp; <a href="#">'+kh_['AppHelpArr10']+'</a>'; iu_['noSlotAvailableInNightInWeek']=kh_['AppHelpArr9']+' &nbsp;&nbsp; <a href="#" onclick="_pg();">'+kh_['AppHelpArr5']+'</a> &nbsp;&nbsp; <a href="#">'+kh_['AppHelpArr12']+'</a>'; iu_['noSlotAvailableInFull DayInWeekStaffSelected']=kh_['AppHelpArr13']+' &nbsp;&nbsp;<a href="#" onclick="_gb(7);">'+kh_['AppHelpArr14']+'</a>'; iu_['noSlotAvailableInMorningInWeekStaffSelected']=kh_['AppHelpArr15']+' &nbsp;&nbsp;<a href="#" onclick="_pg();">'+kh_['AppHelpArr5']+'</a> &nbsp;&nbsp;<a href="#" onclick="_gb(7);">'+kh_['AppHelpArr14']+'</a>'; iu_['noSlotAvailableInAfternoonInWeekStaffSelected']=kh_['AppHelpArr16']+' &nbsp;&nbsp;<a href="#" onclick="_pg();">'+kh_['AppHelpArr5']+'</a> &nbsp;&nbsp;<a href="#" onclick="_gb(7);">'+kh_['AppHelpArr6']+'</a>'; iu_['noSlotAvailableInEveningInWeekStaffSelected']=kh_['AppHelpArr18']+' &nbsp;&nbsp;<a href="#" onclick="_pg();">'+kh_['AppHelpArr5']+'</a> &nbsp;&nbsp;<a href="#" onclick="_gb(7);">'+kh_['AppHelpArr10']+'</a>'; iu_['noSlotAvailableInNightInWeekStaffSelected']=kh_['AppHelpArr19']+' &nbsp;&nbsp;<a href="#" onclick="_pg();">'+kh_['AppHelpArr5']+'</a> &nbsp;&nbsp;<a href="#" onclick="_gb(7);">'+kh_['AppHelpArr12']+'</a>'; iu_['noSlotAvailableInSelectedTimeInWeek']=kh_['AppHelpArr20']+' &nbsp;&nbsp;<a href="#" onclick="_pg();">'+kh_['memberHelpArr2']+'</a> &nbsp;&nbsp;<a href="#" onclick="_gb(7);"> '+kh_['memberHelpArr3']+'</a>'; iu_['noSlotAvailableInSelectedTimeInWeekStaffSelected']=kh_['AppHelpArr21']+' &nbsp;&nbsp;<a href="#" onclick="_pg();">'+kh_['memberHelpArr2']+'</a> &nbsp;&nbsp;<a href="#" onclick="_gb(7);"> '+kh_['AppHelpArr17']+'</a>'; iu_['noSlotAvailableInFull DayInWeekLast']=kh_['AppHelpArr2']+'&nbsp;&nbsp;'; iu_['noSlotAvailableInMorningInWeekLast']=kh_['AppHelpArr4']+' &nbsp;&nbsp; <a href="#" onclick="_pg();">'+kh_['memberHelpArr2']+'</a> &nbsp;&nbsp;'; iu_['noSlotAvailableInAfternoonInWeekLast']=kh_['AppHelpArr7']+' &nbsp;&nbsp; <a href="#" onclick="_pg();">'+kh_['memberHelpArr2']+'</a> &nbsp;&nbsp; '; iu_['noSlotAvailableInEveningInWeekLast']=kh_['AppHelpArr9']+' &nbsp;&nbsp; <a href="#" onclick="_pg();">'+kh_['memberHelpArr2']+'</a> &nbsp;&nbsp; '; iu_['noSlotAvailableInNightInWeekLast']=kh_['AppHelpArr11']+' &nbsp;&nbsp; <a href="#" onclick="_pg();">'+kh_['memberHelpArr2']+'</a> &nbsp;&nbsp; '; iu_['noSlotAvailableInFull DayInWeekStaffSelectedLast']=kh_['AppHelpArr13']+' &nbsp;&nbsp;'; iu_['noSlotAvailableInMorningInWeekStaffSelectedLast']=kh_['AppHelpArr15']+' &nbsp;&nbsp;<a href="#" onclick="_pg();">'+kh_['memberHelpArr2']+'</a> &nbsp;&nbsp;'; iu_['noSlotAvailableInAfternoonInWeekStaffSelectedLast']=kh_['AppHelpArr16']+' &nbsp;&nbsp;<a href="#" onclick="_pg();">'+kh_['memberHelpArr2']+'</a> &nbsp;&nbsp;'; iu_['noSlotAvailableInEveningInWeekStaffSelectedLast']=kh_['AppHelpArr18']+' &nbsp;&nbsp;<a href="#" onclick="_pg();">'+kh_['memberHelpArr2']+'</a> &nbsp;&nbsp;'; iu_['noSlotAvailableInNightInWeekStaffSelectedLast']=kh_['AppHelpArr19']+' &nbsp;&nbsp;<a href="#" onclick="_pg();">'+kh_['memberHelpArr2']+'</a> &nbsp;&nbsp;'; iu_['noSlotAvailableInSelectedTimeInWeekLast']=kh_['AppHelpArr20']+' &nbsp;&nbsp;<a href="#" onclick="_pg();">'+kh_['memberHelpArr2']+'</a> &nbsp;&nbsp;'; iu_['noSlotAvailableInSelectedTimeInWeekStaffSelectedLast']=kh_['AppHelpArr21']+' &nbsp;&nbsp;<a href="#" onclick="_pg();">'+kh_['memberHelpArr2']+'</a> &nbsp;&nbsp;';   iu_['slotAvailableInMonth']=kh_['memberHelpArr4']; iu_['noSlotAvailableInFull DayInMonth']=kh_['AppHelpArr2']+' &nbsp;&nbsp;<a href="#" onclick="_oz(42);">'+kh_['memberHelpArr5']+'</a>'; iu_['noSlotAvailableInMorningInMonth']=kh_['AppHelpArr4']+' &nbsp;&nbsp;<a href="#" onclick="_pg();">'+kh_['AppHelpArr5']+'</a> &nbsp;&nbsp;<a href="#" onclick="_oz(42);">'+kh_['memberHelpArr5']+'</a>'; iu_['noSlotAvailableInAfternoonInMonth']=kh_['AppHelpArr7']+' &nbsp;&nbsp;<a href="#" onclick="_pg();">'+kh_['AppHelpArr5']+'</a> &nbsp;&nbsp;<a href="#" onclick="_oz(42);">'+kh_['memberHelpArr6']+'</a>'; iu_['noSlotAvailableInEveningInMonth']=kh_['AppHelpArr9']+'&nbsp;&nbsp;<a href="#" onclick="_pg();">'+kh_['AppHelpArr5']+'</a> &nbsp;&nbsp;<a href="#" onclick="_oz(42);">'+kh_['memberHelpArr7']+'</a>'; iu_['noSlotAvailableInNightInMonth']=kh_['AppHelpArr11']+' &nbsp;&nbsp;<a href="#" onclick="_pg();">'+kh_['AppHelpArr5']+'</a> &nbsp;&nbsp;<a href="#" onclick="_oz(42);">'+kh_['memberHelpArr8']+'</a>'; iu_['noSlotAvailableInFull DayInMonthStaffSelected']=kh_['AppHelpArr13']+' &nbsp;&nbsp;<a href="#" onclick="_oz(42);">'+kh_['memberHelpArr5']+'</a>'; iu_['noSlotAvailableInMorningInMonthStaffSelected']=kh_['AppHelpArr15']+' &nbsp;&nbsp;<a href="#" onclick="_pg();">'+kh_['AppHelpArr5']+'</a> &nbsp;&nbsp;<a href="#" onclick="_oz(42);">'+kh_['memberHelpArr6']+'</a>'; iu_['noSlotAvailableInAfternoonInMonthStaffSelected']=kh_['AppHelpArr16']+' &nbsp;&nbsp;<a href="#" onclick="_pg();">'+kh_['AppHelpArr5']+'</a> &nbsp;&nbsp;<a href="#" onclick="_oz(42);">'+kh_['memberHelpArr7']+'</a>'; iu_['noSlotAvailableInEveningInMonthStaffSelected']=kh_['AppHelpArr18']+' &nbsp;&nbsp;<a href="#" onclick="_pg();">'+kh_['AppHelpArr5']+'</a> &nbsp;&nbsp;<a href="#" onclick="_oz(42);">'+kh_['memberHelpArr7']+'</a>'; iu_['noSlotAvailableInNightInMonthStaffSelected']=kh_['AppHelpArr19']+'&nbsp;&nbsp;<a href="#" onclick="_pg();">'+kh_['AppHelpArr5']+'</a> &nbsp;&nbsp;<a href="#" onclick="_oz(42);">'+kh_['memberHelpArr8']+'</a>'; iu_['noSlotAvailableInSelectedTimeInMonth']=kh_['AppHelpArr20']+' &nbsp;&nbsp;<a href="#" onclick="_pg();">'+kh_['AppHelpArr5']+'</a> &nbsp;&nbsp;<a href="#" onclick="_oz(42);"> '+kh_['memberHelpArr9']+'</a>'; iu_['noSlotAvailableInSelectedTimeInMonthStaffSelected']=kh_['AppHelpArr21']+' &nbsp;&nbsp;<a href="#" onclick="_pg();">'+kh_['AppHelpArr5']+'</a> &nbsp;&nbsp;<a href="#" onclick="_oz(42);"> '+kh_['memberHelpArr9']+'</a>'; iu_['noSlotAvailableInFull DayInMonthLast']=kh_['AppHelpArr2']+' &nbsp;&nbsp;'; iu_['noSlotAvailableInMorningInMonthLast']=kh_['AppHelpArr4']+' &nbsp;&nbsp;<a href="#" onclick="_pg();">'+kh_['AppHelpArr5']+'</a> &nbsp;&nbsp; '; iu_['noSlotAvailableInAfternoonInMonthLast']=kh_['AppHelpArr7']+' &nbsp;&nbsp;<a href="#" onclick="_pg();">'+kh_['AppHelpArr5']+'</a> &nbsp;&nbsp;'; iu_['noSlotAvailableInEveningInMonthLast']=kh_['AppHelpArr9']+'&nbsp;&nbsp;<a href="#" onclick="_pg();">'+kh_['AppHelpArr5']+'</a> &nbsp;&nbsp;'; iu_['noSlotAvailableInNightInMonthLast']=kh_['AppHelpArr11']+' &nbsp;&nbsp;<a href="#" onclick="_pg();">'+kh_['AppHelpArr5']+'</a> &nbsp;&nbsp;'; iu_['noSlotAvailableInFull DayInMonthStaffSelectedLast']=kh_['AppHelpArr13']+' &nbsp;&nbsp;'; iu_['noSlotAvailableInMorningInMonthStaffSelectedLast']=kh_['AppHelpArr15']+' &nbsp;&nbsp;<a href="#" onclick="_pg();">'+kh_['AppHelpArr5']+'</a> &nbsp;&nbsp;'; iu_['noSlotAvailableInAfternoonInMonthStaffSelectedLast']=kh_['AppHelpArr16']+' &nbsp;&nbsp;<a href="#" onclick="_pg();">'+kh_['AppHelpArr5']+'</a> &nbsp;&nbsp;'; iu_['noSlotAvailableInEveningInMonthStaffSelectedLast']=kh_['AppHelpArr18']+' &nbsp;&nbsp;<a href="#" onclick="_pg();">'+kh_['AppHelpArr5']+'</a> &nbsp;&nbsp;'; iu_['noSlotAvailableInNightInMonthStaffSelectedLast']=kh_['AppHelpArr19']+'&nbsp;&nbsp;<a href="#" onclick="_pg();">'+kh_['AppHelpArr5']+'</a> &nbsp;&nbsp;'; iu_['noSlotAvailableInSelectedTimeInMonthLast']=kh_['AppHelpArr20']+' &nbsp;&nbsp;<a href="#" onclick="_pg();">'+kh_['AppHelpArr5']+'</a> &nbsp;&nbsp;'; iu_['noSlotAvailableInSelectedTimeInMonthStaffSelectedLast']=kh_['AppHelpArr21']+' &nbsp;&nbsp;<a href="#" onclick="_pg();">'+kh_['AppHelpArr5']+'</a> &nbsp;&nbsp;';   iu_['slotAvailableInDay']=kh_['memberHelpArr10']; iu_['noSlotAvailableInFull DayInDay']=kh_['AppHelpArr2']; iu_['noSlotAvailableInSelectedTimeInDay']=kh_['memberHelpArr11']; iu_['noSlotAvailableInMorningInDay']=kh_['AppHelpArr4']+' '+kh_['memberHelpArr12']; iu_['noSlotAvailableInAfternoonInDay']=kh_['AppHelpArr7']+' '+kh_['memberHelpArr12']; iu_['noSlotAvailableInEveningInDay']=kh_['AppHelpArr9']+' '+kh_['memberHelpArr12']; iu_['noSlotAvailableInNightInDay']=kh_['AppHelpArr11']+' '+kh_['memberHelpArr12']; iu_['Loading']='Loading...'; iu_[5]=kh_['memberHelpArr13']+' '+fx_+'(s) '+kh_['memberHelpArr20']; iu_[6]=kh_['memberHelpArr13']+' '+q_+'(s) '+kh_['memberHelpArr20']; iu_['serviceDetail']=kh_['memberHelpArr14']; iu_['staffDetail']=kh_['memberHelpArr15']; iu_['shopDetail']='&nbsp;'; }   jQuery(document).ready(function(){ var wv_=jQuery('div#allBookingOrder'); var ww_=jQuery('#allMoreTimeBox'); wv_.mouseover(function(){ wv_=jQuery(this); var wx_=wv_.offset(); ww_.css({'left':wx_.left,'top':wx_.top-ww_.height()-6}).show(); }); wv_.mouseout(function(){ ww_.hide(); }); }); function __ale() { __alk(); __alh(); var wv_=jQuery('#addEBody'); wv_.css({'width':'auto','height':'auto'}); jQuery('#overlay').hide(); var ww_=jQuery('div#allBookingOrder'); ww_.show(); var htmlH=ww_.offset(); wv_.animate({ width: ww_[0].offsetWidth, height: ww_[0].offsetHeight,   top: htmlH.top, left: htmlH.left }, 500,function(){ wv_.hide(); wv_.css({'width':'auto','height':'auto'}); checkTimeAndService(); } ); }; function __alf(obj,d) { d = new Date(d); tt = _x(d, true); var tempT = $('appointTime').value; $('appointTime').value = tt; __alg(d.getDate(), d.getMonth(), d.getFullYear()); __alk(); __alh(); $('appointTime').value = tempT; obj=jQuery(obj); var objPos=obj.offset(); var wv_=jQuery('#addMoreTime'); wv_.html(obj.html()); wv_.css({'width':obj.width(), 'height':obj.height(), 'top':objPos.top, 'left':objPos.left}); jQuery('#overlay').hide(); var ww_=jQuery('div#allBookingOrder'); ww_.show(); var htmlH=ww_.offset(); wv_.animate({ width: ww_[0].offsetWidth, height: ww_[0].offsetHeight,   top: htmlH.top, left: htmlH.left }, 500,function(){ wv_.hide(); wv_.css({'width':'auto','height':'auto'}); checkTimeAndService();     } );     }; function __alg(i, m, y) { var cn_ = new Date(eval(m + 1) + '/' + eval(i) + '/' + eval(y)); var appAllowedDate = new Date(DateBeforAppCanBook); if (cn_ < appAllowedDate) { _by(i, eval(m + 1)); cw_ = i; cx_ = m; cy_ = y; cr_ = cx_ + 1 + '/' + cw_ + '/' + cy_; var newtDate = cr_ + ' ' + $('appointTime').value; var tempdate = new Date(newtDate); cs_ = tempdate.getDay(); _hu(cr_); hj_ = new Date(tempdate); jt_.clear(); ju_.clear(); jv_.clear(); jx_.clear(); jw_.clear(); jn_ = (dj_.toString()).split(','); var asd = _bb(); if (asd) { var sendTime = new Array(); for (var j = 0; j < jw_.length; j++) { var changD = new Date(jw_[j]); sendTime.push(changD._cn()); } var serviceNameOnBook = new Array(); var serviceCostOnBook = new Array(); for (j = 0; j < jt_.length; j++) { var nm = e_['ser' + jt_[j]][1]; nm = nm.replace(/,/g, "~~>"); serviceNameOnBook.push(nm); serviceCostOnBook.push(e_['ser' + jt_[j]][3]); } dp_ = cr_; ws_.push(new Array(jt_ , ju_, sendTime, dp_ , serviceNameOnBook , serviceCostOnBook , urlDisC_xh)); } } }; function __alh() { wt_.length=0; for(var i=0;i<ws_.length;i++) {   var wy_=ws_[i][0]; var wz_=ws_[i][2]; for(j=0;j<wy_.length;j++) { if(wy_[j]=='') continue; var xa_=parseInt(e_['ser'+wy_[j]][2])-1; var xb_=new Date( ws_[i][3] + ' ' + wz_[j]); var xc_=new Date( ws_[i][3] + ' ' + wz_[j]); xc_.setMinutes(xc_.getMinutes()+xa_); wt_.push(new Array(xb_.toString(), xc_.toString())); } } }; function __ali(sStartTime,sEndTime,workerName,fx_) { var stDateAp=wt_; var j=stDateAp.length; var ak_=parseInt(e_['ser'+fx_][11]); var al_=0; for(var i=0;i<j;i++) { var testStartTime=Date.parse(stDateAp[i][0]); var testEndTime=Date.parse(stDateAp[i][1]); if(stDateAp[i][2]==fx_ && testStartTime==sStartTime && testEndTime==sEndTime) { al_++; if(al_<ak_) continue; } if(((testStartTime<=sStartTime && testEndTime>=sStartTime)||(testStartTime<=sEndTime && testEndTime>=sEndTime)||(testStartTime<=sEndTime && testStartTime>=sStartTime)||(testEndTime<=sEndTime && testEndTime>=sStartTime))) { return true; } } return false; }; function __alj(sStartTime,sEndTime,workerName,fx_) { var appArr=new Array(); if (typeof (iy_[cr_+'/'+sessionUID]) != 'undefined') appArr = iy_[cr_+'/'+sessionUID];   var stDateAp=appArr; var j=stDateAp.length; var ak_=parseInt(e_['ser'+fx_][11]); var al_=0; for(var i=0;i<j;i++) { var xd_=new Date(cr_ +' '+setTimeOverNight_xh(appArr[i][3],true)); var xe_=new Date(cr_ +' '+setTimeOverNight_xh(appArr[i][4],true));     if(wo_!=0) { if(wp_==1) { xd_.setDate(xd_.getDate()-wo_); xe_.setDate(xe_.getDate()+wo_); } else if(wp_==2) { xd_.setHours(xd_.getHours()-wo_); xe_.setHours(xe_.getHours()+wo_); } } else { return false; }     var testStartTime=Date.parse(xd_.toString()); var testEndTime=Date.parse(xe_.toString()); if(stDateAp[i][2]==fx_ && testStartTime==sStartTime && testEndTime==sEndTime) { al_++; if(al_<ak_) continue; }   if(((testStartTime<=sStartTime && testEndTime>=sStartTime)||(testStartTime<=sEndTime && testEndTime>=sEndTime)||(testStartTime<=sEndTime && testStartTime>=sStartTime)||(testEndTime<=sEndTime && testEndTime>=sStartTime))) { return true; } } return false; }; function __alk() { jQuery('#orderCountMsg').html(ws_.length+' order'); jQuery('#allMoreTimeBox').html(); };  var recSetTime; var xf_=''; var xg_=''; var xh_=''; var xi_=''; function __all() { var xj_=''; var xk_ = jQuery('#recurType option:selected'); var xl_ = jQuery('#recurRepEv option:selected').val(); var xm_ = jQuery('input.recurDays:checked'); var xn_ = new Date(jQuery('#recurStartDt').val()); var xo_ = new Date(jQuery('#recurEndDt').val()); __alx(); xj_+=xk_.text(); var xp_=xk_.val(); jQuery('#recurTypeAllCondition, #recRepContainObj').hide(); jQuery('#recurAllWeekDays').hide(); if(xk_.val()>0) { jQuery('#recurTypeAllCondition, #recRepContainObj').show(); } if(xp_==1) { jQuery('#recRepEv').html('day'); } else if(xp_==2) jQuery('#recRepEv').html('week'); else if(xp_==3) jQuery('#recRepEv').html('month'); if(xl_>1) { if(xk_.val()==1) { xj_='Every '+xl_+' days'; jQuery('#recRepEv').html('days'); } else if(xk_.val()==2) { xj_='Every '+xl_+' weeks'; jQuery('#recRepEv').html('weeks'); } else if(xk_.val()==3) { xj_='Every '+xl_+' months'; jQuery('#recRepEv').html('months'); } } if(xk_.val()==2) { jQuery('#recurAllWeekDays').show(); xj_ += ' on '; var daysLen=xm_.length; if(daysLen>0) { var locLen=0; xm_.each(function(){ locLen++; xj_ += j_[this.value]; if(locLen!=daysLen) xj_ +=', ' }); } else { xj_ += j_[xn_.getDay()]; } } if(jQuery('#recurEndDt').val()!='') { var enDt=new Date(jQuery('#recurEndDt').val()); var enDtNo=enDt.getDate(); var remDt=enDtNo%10; if(remDt==1) enDtNo+='st'; else if(remDt==2) enDtNo+='nd'; else if(remDt==3) enDtNo+='rd'; else enDtNo+='th'; xj_+=' till '+enDtNo+' '+h_[enDt.getMonth()]; } jQuery('#recurMsg').html(xj_); clearTimeout(recSetTime); recSetTime=setTimeout(function(){__aln();},500); }; function __alm() { jQuery('td.wkday, td.wkend, td.notmnth').click(function(){__all();}); }; var xq_ =new Array(); function __aln() {   wt_.length=0; var xk_ = jQuery('#recurType option:selected'); var xl_ = parseInt(jQuery('#recurRepEv option:selected').val()); var xm_ = jQuery('input.recurDays:checked'); var xn_ = new Date(jQuery('#recurStartDt').val()); var xo_ = new Date(jQuery('#recurEndDt').val()); kl_ = new Date(xn_.toString()); var xp_ =parseInt(xk_.val()); jQuery('#recAvaiApDTL').hide(); jQuery('#recurAppointment').show(); jQuery('#recurAppointment').html('').height('auto'); if(xp_==0|| jQuery('#recurEndDt').val()=='') { jQuery('#recAvaiApDTL').show(); jQuery('#recurAppointment').hide(); __alo(); return true; } var xr_=new Array(); if(xp_==2) { var daysLen=xm_.length; if(daysLen>0) { xm_.each(function(){ xr_ .push( parseInt(this.value)); }); } else { xr_ .push(xn_.getDay()); } }   var xs_=(jQuery('#dis_serviceId').val()).split(','); var xt_=(jQuery('#startTime').val()).split(','); var xu_=(jQuery('#dis_SerCostStr').val()).split(','); xq_.length=0; var xv_=''; var checkWeekDayLen=0; if(xp_==2) { kl_.setDate(kl_.getDate()-kl_.getDay()+xr_[checkWeekDayLen]) ; checkWeekDayLen++; } var checkIsCurrentMonthApp= new Date(paraCalDate.toString()); checkIsCurrentMonthApp.setDate(checkIsCurrentMonthApp.getDate()+42); while(kl_<=xo_) { if(checkIsCurrentMonthApp<kl_ && DateBeforAppCanBook>kl_) { var dtF=checkIsCurrentMonthApp.getMonth() + 1 + '/' + checkIsCurrentMonthApp.getDate() + '/' + checkIsCurrentMonthApp.getFullYear(); checkIsCurrentMonthApp.setDate(checkIsCurrentMonthApp.getDate()+42); var checkAvail=false; for (i in iz_) { if (i == dtF) { checkAvail = true; break; } } if (checkAvail) { _cx(iz_[dtF]);     } else { var url = 'getAppointmentForReuring.aspx'; var par = 'calDate=' + dtF + '&jscalDate=' + dtF + ' ' + km_.getHours() + ':' + km_.getMinutes() + ':' + km_.getSeconds(); var ajx = new Ajax.Updater( 'testaddE', url, { method: 'post', parameters: par, evalScripts: true, onComplete:function(){ setTimeout(function(){__aln();},50);}, onFailure: _kb }); return true; } } cw_ = kl_.getDate(); cx_ = kl_.getMonth(); cy_ = kl_.getFullYear(); cr_ = cx_ + 1 + '/' + cw_ + '/' + cy_; _hu(cr_); for(var i=0;i<xs_.length;i++) { if(xt_[i]=='') continue; var newtDate = cr_ + ' ' + xt_[i]; var tempdate = new Date(newtDate); tempdate.setHours(tempdate.getHours() - parseInt(kq_)); cs_ = tempdate.getDay(); hj_ = new Date(tempdate); jt_.clear(); ju_.clear(); jv_.clear(); jx_.clear(); jw_.clear(); jn_ = (xs_[i]).split(','); var xw_=e_['ser'+xs_[i]]; var asd = _bb(); if (asd) { xq_.push(new Array(xs_[i], ju_[0], cr_, xt_[i], 0)); } else { xq_.push(new Array(xs_[i], ju_[0], cr_, xt_[i], 1)); } } if(xp_==1) kl_.setDate(kl_.getDate() + xl_); else if(xp_==2) { if(checkWeekDayLen==xr_.length) { checkWeekDayLen=0; kl_.setDate(kl_.getDate()+7*xl_); } kl_.setDate(kl_.getDate()-kl_.getDay()+xr_[checkWeekDayLen]) ;   checkWeekDayLen++; } else if(xp_==3) { kl_.setMonth(kl_.getMonth() + xl_); } } var dtF=paraCalDate.getMonth() + 1 + '/' + paraCalDate.getDate() + '/' + paraCalDate.getFullYear(); _cx(iz_[dtF]); __alp(); }; function __alo() { xq_.length=0; for(var i=0;i<xf_.length;i++) { if(xf_[i]=='') continue; xq_.push(new Array(xf_[i], xg_[i], xi_, xh_[i], 0)); } }; function __alp() { __alx(); var xv_ = ''; var xx_=''; var scrTop=0; scrTop=jQuery('#recurAppointment').scrollTop(); xv_ += '<table width="100%" cellspacing="0" cellpadding="0" border="0" class="userSelectedAppointment">'; wt_.length=0; for(var i=0;i<xq_.length;i++) { if(xq_[i][2]!=xx_) { xx_=xq_[i][2]; var xy_=new Date(xx_); xv_ += '<tr><td class="recurDateHD" colspan="5">'+k_[xy_.getDay()]+', '+h_[xy_.getMonth()]+' '+xy_.getDate()+', '+ xy_.getFullYear() +'</td></tr>'; } var xz_=''; if(xq_[i][4]==1) xz_='ontAvailCl'; var xw_=e_['ser'+xq_[i][0]]; xv_ += '<tr id="rNo'+i+'" class="' + xz_ + '"><td class="userSelectedAppointmentTextBl"><div class="recServiceName">'+ xw_[1] +'</div><div class="recServiceDtl">@ '+ _x(xq_[i][2]+' '+ xq_[i][3]) +' '; if(xq_[i][4]==0) { var ya_=''; if(eval(ff_)) { for(var j=0;j<p_.length;j++) { if(parseInt(xq_[i][1])==parseInt(p_[j][0])) { ya_ = ' with '+p_[j][1]; } } } xv_ += '<span class="recStaffName">'+ya_+'</span></div></td>'; xv_ += '<td class="talignRight userSelectedAppointmentTextBr"><span class="recAvail"></span></td>'; var xa_=parseInt(xw_[2])-1; var xb_=new Date( xq_[i][2] + ' ' + xq_[i][3]); var xc_=new Date( xq_[i][2] + ' ' + xq_[i][3]); xc_.setMinutes(xc_.getMinutes()+xa_); wt_.push(new Array(xb_.toString(), xc_.toString())); } else { xv_ += '<span id="recStaffName"></span></div></td>'; xv_ += '<td style="width: 87px;" class="talignRight userSelectedAppointmentTextBr"><span class="recNotAvail">-NA-</span></td>'; } xv_ += '<td class="talignRight userSelectedAppointmentTextBr"><a href="javascript:void(0)" onclick="__alq(this, '+ i +')">Edit</a></td>'; xv_ += '<td class="talignRight userSelectedAppointmentTextBr"><a href="javascript:void(0)" onclick="__alt(this, '+ i +')">Remove</a></td>'; xv_ += '<td style="width: 87px;" class="talignRight userSelectedAppointmentTextBl">'+xw_[3]+'</td></tr>'; } xv_ += '</table>'; jQuery('#recurAppointment').css({'height':'auto'}).html(xv_); jQuery('#recAvaiApDTL').hide(); jQuery('#recurAppointment').show(); if(xq_.length==0) { jQuery('#recAvaiApDTL').show(); jQuery('#recurAppointment').hide(); __alo(); return true; } if(jQuery('#recurAppointment').height()>150) { jQuery('#recurAppointment').css({'height':150}); } jQuery('#recurAppointment').scrollTop(scrTop); }; var yb_=new Array(); function __alq(obj, appNo) { var yc_=xq_[appNo]; ct_=dl_.toString(); ct_=ct_.split(','); if(dl_.length==0) { ct_.pop(); for(var l=0;l<p_.length;l++) { if(p_[l][2]=='False') ct_.push(p_[l][0]); } } cu_=ct_.length; cv_=1; var givenStartT=''; var givenEndT=''; var givenStartD=''; var givenEndD=''; var tval=$('appointTime').value; givenStartT=hp_; givenEndT=hq_; var tDate = new Date(yc_[2]); cw_ = tDate.getDate(); cx_ = tDate.getMonth(); cy_ = tDate.getFullYear(); cr_=cx_+1+'/'+cw_+'/'+cy_; var cn_ = new Date(tDate); cs_=cn_.getDay(); var appAllowedDate = new Date(DateBeforAppCanBook); var checkIsCurrentMonthApp= new Date(paraCalDate.toString()); while(checkIsCurrentMonthApp<cn_) { checkIsCurrentMonthApp.setDate(checkIsCurrentMonthApp.getDate()+42); } checkIsCurrentMonthApp.setDate(checkIsCurrentMonthApp.getDate()-42); var dtF=checkIsCurrentMonthApp.getMonth() + 1 + '/' + checkIsCurrentMonthApp.getDate() + '/' + checkIsCurrentMonthApp.getFullYear(); var checkAvail=false; for (i in iz_) { if (i == dtF) { checkAvail = true; break; } } if (checkAvail) { _cx(iz_[dtF]);     } if(cn_<appAllowedDate) { var newtDate = cr_; var tempStartT=' 23:59:00'; var tempEndT=' 00:00:00'; var tempSDate=Date.parse(newtDate+tempStartT); var tempEDate=Date.parse(newtDate+tempEndT); var s=0; var divid=96; _hu(cr_); for(var k=0;k<cv_;k++) { for(l=0;l<cu_;l++) { para=cs_+'/'+ct_[l]+'/'+yc_[0]; if(typeof(kb_[para])!='undefined') { var ssdArr=kb_[para]; var m=ssdArr.length; do { var comST= Date.parse(newtDate+' '+ssdArr[m-1][3]); var comET= Date.parse(newtDate+' '+ssdArr[m-1][4]); if(comST<tempSDate) { tempSDate=comST; tempStartT=ssdArr[m-1][3]; } if(comET>tempEDate) { tempEDate=comET; tempEndT=ssdArr[m-1][4]; } }while(--m); } } } givenStartD=Date.parse(newtDate+' '+givenStartT); givenEndD=Date.parse(newtDate+' '+givenEndT); tempEDate=tempEDate-(hc_*60*1000); if(givenStartD<tempSDate) givenStartT=tempStartT; if(givenEndD>tempEDate) givenEndT=tempEndT; searchStartTime=new Date(newtDate+' '+givenStartT); searchEndTime=new Date(newtDate+' '+givenEndT); if(givenEndD>tempEDate) searchEndTime.setMinutes(searchEndTime.getMinutes()-hc_); yb_.length=0; var pqr=searchStartTime.getMinutes(); var isAppAvail=true; for(var i=0;i<divid;i++) {   hj_ = new Date(yc_[2]); hj_.setMinutes(searchStartTime.getMinutes()); hj_.setSeconds(searchStartTime.getSeconds()); hj_.setHours(searchStartTime.getHours()); hj_.setMinutes(pqr); if(hj_>searchEndTime) break; jt_.clear(); ju_.clear(); jv_.clear(); jx_.clear(); jw_.clear(); jn_=(yc_[0].toString()).split(','); _bc(jn_); var asd=_bb(); hj_.setMinutes(searchStartTime.getMinutes()); hj_.setSeconds(searchStartTime.getSeconds()); hj_.setHours(searchStartTime.getHours()); hj_.setMinutes(pqr); if(asd) { isAppAvail=true; yb_.push(_x(hj_)); } else { isAppAvail=false;     } if(isAppAvail || timeDifferenceOfSlot<15 || autoSearchUnavailableTimes_xh) s+=timeDifferenceOfSlot; else s+=15; pqr=searchStartTime.getMinutes()+s; } var timeStr=''; if(yb_.length==0) timeStr+='<span class="recNotAvail">-NA-</span>'; for(var tm=0;tm<yb_.length;tm++) { timeStr+='<div class="recAvailTimeListDv">'+yb_[tm]+'</div>'; } var objPar=jQuery(obj.parentNode); var objPos=jQuery(objPar).offset(); jQuery('#recAllAvailableTime').show().css({'left':objPos.left + objPar.width()/2 - 50, 'top':objPos.top + objPar.height() +10}); jQuery('#recAllAvailableTimeText').html(timeStr); jQuery('div.recAvailTimeListDv').click(function(){__als(this,appNo)}); yd_=false; jQuery(document).unbind('click', __alr).bind('click', __alr); } else { alert('Appointment can be taken only till '+ h_[appAllowedDate.getMonth()] +' '+ appAllowedDate.getDate() +' '+appAllowedDate.getFullYear()); } var dtF=paraCalDate.getMonth() + 1 + '/' + paraCalDate.getDate() + '/' + paraCalDate.getFullYear(); _cx(iz_[dtF]); }; var yd_=true; function __alr() { if(yd_ && !jQuery('#recAllAvailableTime').is(":hidden")) { jQuery('#recAllAvailableTime').hide(); jQuery(document).unbind('click', __alr); } yd_=true; }; function __als(obj, appNo) { var mkDt = new Date('12/12/2000 '+ jQuery(obj).html()); var mkTm = mkDt._cn() ; var cn_ = new Date(xq_[appNo][2]); var appAllowedDate = new Date(DateBeforAppCanBook); cw_ = cn_.getDate(); cx_ = cn_.getMonth(); cy_ = cn_.getFullYear(); cr_ = cx_ + 1 + '/' + cw_ + '/' + cy_; var newtDate = cr_ + ' ' + jQuery(obj).html(); var tempdate = new Date(newtDate); cs_ = tempdate.getDay(); _hu(cr_); hj_ = new Date(tempdate); jt_.clear(); ju_.clear(); jv_.clear(); jx_.clear(); jw_.clear(); jn_ = (xq_[appNo][0]).split(','); var asd = _bb(); if (asd) { xq_[appNo][3]=mkTm; xq_[appNo][1]=ju_; xq_[appNo][4]=0; } __alp(); }; function __alt(obj,appNo) { jQuery('#recRemoveTime').show(); var objPar=jQuery(obj.parentNode); var objPos=jQuery(objPar).offset(); jQuery('#recRemoveTime').show().css({'left':objPos.left + objPar.width()/2 - 50, 'top':objPos.top + objPar.height() +10});   jQuery('div#recRemoveTimeDecision span.removeY').unbind('click').click(function(){__alv(appNo)}); jQuery('div#recRemoveTimeDecision span.removeN').click(function(){jQuery('#recRemoveTime').hide();}); recurIsRemovePopupHide_xh=false; jQuery(document).unbind('click', __alu).bind('click', __alu); } recurIsRemovePopupHide_xh=true; function __alu() { if(recurIsRemovePopupHide_xh && !jQuery('#recRemoveTime').is(":hidden")) { jQuery('#recRemoveTime').hide(); jQuery(document).unbind('click', __alu); } recurIsRemovePopupHide_xh=true; }; function __alv(appNo) {     xq_._cs(appNo); __alp(); if(xq_.length==0) { jQuery('#recAvaiApDTL').show(); jQuery('#recurAppointment').hide(); jQuery('#recurAppointment').html(''); } }; function __alw() { var ye_=false; var yf_=0; for(var i=0;i<xq_.length;i++) { if(xq_[i][4]==1) { ye_=true; yf_++; continue; } } if(yf_==xq_.length) { alert('Please select at least one available time for booking.'); return true; } if(ye_) {    jQuery('#gotoNextForBook').hide(); jQuery('#redMsgBlock').show(); var posN=jQuery('#redMsgBlock span.sendCheckIngReq').position(); var msgObj=jQuery('#redMsgBlock div.redMsg:eq(0)'); msgObj.css({'right':20,'top':posN.top-msgObj[0].offsetHeight-20}); jQuery('#redMsgBlock span.sendCheckIngReq').unbind('click').click(function(){__aly()}); jQuery('#redMsgBlock span.notsendCheckIngReq').unbind('click').click(function(){__alx();}); jQuery('#recurAppointment')[0].scrollTop=(0); var divOffset = jQuery('#recurAppointment').offset().top; var pOffset = jQuery('#recurAppointment tr.ontAvailCl:eq(0)').offset().top; var pScroll = pOffset - divOffset;   jQuery('#recurAppointment').animate({scrollTop: pScroll-23 + 'px'}, 500);   } else { __aly(); } }; function __alx() { jQuery('#gotoNextForBook').show(); jQuery('#redMsgBlock').hide(); } function __aly() { var yg_=new Array(); var ye_=false; var yf_=0; for(var i=0;i<xq_.length;i++) { if(xq_[i][4]==1) { ye_=true; yf_++; continue; } if(typeof(yg_['app'+xq_[i][0]])=='undefined') yg_['app'+xq_[i][0]]=new Array(); yg_['app'+xq_[i][0]].push(xq_[i]); } if(yf_==xq_.length) { alert('Please select at least one available time for booking.'); return true; } for(var i=0;i<xq_.length;i++) { if(xq_[i][4]==1) { xq_._cs(i); } } var yh_ = new Array(); var yi_ = new Array(); var yj_ = new Array(); for(x in yg_) { if(!yg_.hasOwnProperty(x)) continue; 

var yk_=e_['ser'+yg_[x][0][0]]; 

var nm = yk_[1];
        nm = nm.replace(/,/g, "~~>");
        //serviceNameOnBook.push(nm);
        yh_.push(nm);

//yh_.push(yk_[1]); 


yi_.push(yk_[3]); yj_.push(yg_[x].length); }   _hq(650, 378); var url='showRecuringAppointmentForChecking.aspx'; var par='serviceNameOnBook= '+yh_+'&serviceCostOnBook= '+ yi_ +'&serviceQuantityOnBook= '+ yj_; var ajx=new Ajax.Updater( 'addE', url, { method:'post', parameters:par, evalScripts:true }); } 

function __alz() { 
	//Code for terms and condition
    if($('termAndCondition'))
    {
        if(!($('termAndCondition').checked))
        {
            $('termConditionMess').className = 'termConditionErr';
            return false;
        }
    }
var customField = $$(".custominput"); var appComment = '';   var optField; var comQu = AliasForEtcInfoString_xh.split("#||#"); for (var i = 0, j = 0; i <= comQu.length - 1 && j < customField.length; i++) { optField = comQu[i].split('#||||#'); comQuString = optField[0].split('||');   if (comQuString.length > 1 && comQuString[1] != 'note' && comQuString[0] != '') { if(comQuString[1]=='r') { if(optField.length>1) { for(var k=1;k<optField.length;k++) { if(customField[j].checked) appComment += encodeURIComponent(comQuString[0]) + ' - ' + encodeURIComponent(customField[j].value) + '#||#'; j++; } } } else if(comQuString[1]=='c') { if(customField[j].checked) appComment += encodeURIComponent(comQuString[0]) + ' - Yes#||#'; else appComment += encodeURIComponent(comQuString[0]) + ' - No#||#'; j++; } else { appComment += encodeURIComponent(comQuString[0]) + ' - ' + encodeURIComponent(customField[j].value) + '#||#'; j++; } } } if (!_ti('appCommentSPAN', 'left')) return true; if (eval(go_)) { if ((appComment == '') || (appComment == gn_)) { $('etcInfoReq').style.display = 'block'; return false; } } var totSerCost = document.getElementById("totalServiceCost").value; var insertStartTime = new Array(); for (var i = 0; i < jw_.length; i++) { var newDate = new Date(jw_[i]); insertStartTime.push((newDate.getMonth() + 1) + '/' + newDate.getDate() + '/' + newDate.getFullYear() + ' ' + newDate.getHours() + ':' + newDate.getMinutes() + ':' + newDate.getSeconds()); } var payWith = ""; if (($('paymentType') || $('paymentType2'))) { payradio = document.getElementsByName("PPmodule"); for (var i = 0; i < payradio.length; i++) { if (payradio[i].checked) { payWith = payradio[i].value; } } if ($('userPayLater')) { if (!($('userPayLater').checked)) { if (payWith == "") { alert('Select Payment Type'); return false; } } } else { if (payWith == "") { alert('Select Payment Type'); return false; } } } var chkUserPayLater, payLaterOrNow; if ($('userPayLater')) { chkUserPayLater = 1; if ($('userPayLater').checked) { payLaterOrNow = 1; } else { payLaterOrNow = 0; } } else { chkUserPayLater = 0; } _hq(650, 378); var yl_=new Array(); var ym_=new Array(); var yn_=new Array(); var yo_=new Array(); for(var i=0;i<xq_.length;i++) { if(xq_[i][4]==1)   continue; yl_.push(xq_[i][0]); ym_.push(xq_[i][1]); yn_.push(xq_[i][2]+' '+xq_[i][3]); yo_.push(xq_[i][2]); } var url = 'insertAvailableAppointmentForRecur.aspx'; var par = 'serviceId=' + yl_ + '&staffId=' + ym_ + '&startTime=' + yn_ + '&appointmentDate=' + yo_ + '&appComm=' + appComment + '&payWith=' + payWith + '&chkUserPayLaterInput=' + chkUserPayLater + '&payLaterOrNowCon=' + payLaterOrNow + '&totalServiceCost=' + totSerCost; lk_ = par; var ajx = new Ajax.Updater( 'testaddE', url, { methd: 'post', evalScripts: true, parameters: par, onSuccess: _ha, onFailure: _kb } ); }; function __ama(str) { var yp_=str.split('#||#'); var yq_=0; var yr_=''; yr_+=''; for(var i=0; i<yp_.length; i++) { if(yp_[i]!=0) { yq_++; xq_[i][4]=1; }                            }  }; function __amb() { } function _lt() { var calDateDisplayVar=new Date(paraCalDate); var table='';     var appBgImg=''; if(hx_!='') { var imgbj=new Image(); appBgImg='style="background-image:url('+hx_+');"' } table+='<table id="right_cal_table" '+appBgImg+' border="0" cellpedding="0" cellspacing="0" class="go_table" > \n'; table += '<tr> \n'; var i = 0; var checkWeek=true; var hieghtOfTd; if(ed_==0) hieghtOfTd=(ae_[3]-270)/6; else hieghtOfTd=ed_/6;   calDateDisplayVar.setDate(calDateDisplayVar.getDate()-1); var stD=true; for(var monthdays = 1 ; monthdays <= 42 ; monthdays++) { calDateDisplayVar.setDate(calDateDisplayVar.getDate()+1); if(i==0) table += '<tr> \n'; i += 1; var weekName=''; if(checkWeek) { bWeekClass=''; if ((jl_._cp(i-1, false))) bWeekClass='blockWeek'; weekName=k_[calDateDisplayVar.getDay()]; if(i==7) checkWeek=false; } table += '<td width="14%" '; if((now.getMonth()!=todaydate.getMonth())) af = 1; else { if (todaydate.getDate() == calDateDisplayVar.getDate() && todaydate.getMonth() == calDateDisplayVar.getMonth()) { table += ' class=todayBox '; } } var xhmonth = calDateDisplayVar.getMonth()+1; var xhdate = calDateDisplayVar.getDate(); var xhyear = calDateDisplayVar.getFullYear(); if(stD) { hh_ = xhdate; hi_=xhmonth; stD=false; } var boxDate='\''+xhmonth+'/'+calDateDisplayVar.getDate()+'/'+xhyear+'\''; if(calDateDisplayVar.getDate()==1) { if(fb_=='Even') fb_='Odd'; else fb_='Even'; } if (calDateDisplayVar<serverDate || _cq(calDateDisplayVar, jk_)) { table += '><div id="'+xhmonth+'dh'+xhdate+'" class = "dateboxheadBlock dateboxheadBlock'+fb_+'"><span id='+xhmonth+'app'+xhdate+'> </span>'; table += weekName+' '; table += xhdate + ' <span class=cursor id='+xhmonth+'cursor'+xhdate+'> </span></div>'; if(calDateDisplayVar.getDate()==1||monthdays==1) { table+='<div id="dateContainer'+monthdays+'" style="height:'+eval(hieghtOfTd-1)+'px; background-image:url(images/month/'+kh_['monthImageFolderName']+'/month'+calDateDisplayVar.getMonth()+'.png); background-repeat: no-repeat; background-position: left bottom;" class="mnDateContainer">'; table+='<a href="#" ><div style="height:'+eval(hieghtOfTd-1)+'px; background-image:url(images/month/'+kh_['monthImageFolderName']+'/month'+calDateDisplayVar.getMonth()+'.png); background-repeat: no-repeat; background-position: left bottom;" class="dateunitblocked dateunitblocked'+fb_+'" id="'+xhmonth+'d'+xhdate+'" onmouseover="_rd(\''+xhmonth+'\',\''+xhdate+'\')" onmouseout="_la(\''+xhmonth+'\',\''+xhdate+'\')" > </div></a>'; table+='<div style="height:'+eval(hieghtOfTd/2)+'px;" class="availDateunitBlocked"><div style="margin-top:'+eval(hieghtOfTd/2-10)+'px;" >&ndash; '+kh_['Blocked']+' &ndash;</div></div>'; table+='<div class="availDateunit" id="availD'+monthdays+'"></div>'; table+='<div class="notAvailDateunit" id="notAvailD'+monthdays+'"></div>'; } else { table+='<div id="dateContainer'+monthdays+'" style="height:'+eval(hieghtOfTd-1)+'px" class="mnDateContainer">'; table+='<a href="#" ><div style="height:'+eval(hieghtOfTd-1)+'px;" class="dateunitblocked dateunitblocked'+fb_+'" id="'+xhmonth+'d'+xhdate+'" onmouseover="_rd(\''+xhmonth+'\',\''+xhdate+'\')" onmouseout="_la(\''+xhmonth+'\',\''+xhdate+'\')" > </div></a>'; table+='<div style="height:'+eval(hieghtOfTd/2)+'px;" class="availDateunitBlocked"><div style="margin-top:'+eval(hieghtOfTd/2-10)+'px;">&ndash; '+kh_['Blocked']+' &ndash;</div></div>'; table+='<div class="availDateunit" id="availD'+monthdays+'"></div>'; table+='<div class="notAvailDateunit" id="notAvailD'+monthdays+'"></div>'; } } else { table += '><div id="'+xhmonth+'dh'+xhdate+'" class = "dateboxhead dateboxhead'+fb_+'"><span id='+xhmonth+'app'+xhdate+'> </span>'; table += weekName+' '; table += xhdate + ' <span class=cursor id='+xhmonth+'cursor'+xhdate+'> </span></div>'; if(calDateDisplayVar.getDate()==1||monthdays==1) { table+='<div id="dateContainer'+monthdays+'" style="height:'+eval(hieghtOfTd-1)+'px; background-image:url(images/month/'+kh_['monthImageFolderName']+'/month'+calDateDisplayVar.getMonth()+'.png); background-repeat: no-repeat; background-position: left bottom;" class="mnDateContainer">'; table+='<a href="#" onclick="_pc();"><div style="height:'+eval(hieghtOfTd-1)+'px; background-image:url(images/month/'+kh_['monthImageFolderName']+'/month'+calDateDisplayVar.getMonth()+'.png); background-repeat: no-repeat; background-position: left bottom;" class="dateunit dateunit'+fb_+'" id="'+xhmonth+'d'+xhdate+'" onmouseover="_rd(\''+xhmonth+'\',\''+xhdate+'\')" onmouseout="_la(\''+xhmonth+'\',\''+xhdate+'\')" > </div></a>'; table+='<div style="height:'+eval(hieghtOfTd-1)+'px; background-image:url(images/month/'+kh_['monthImageFolderName']+'/month'+calDateDisplayVar.getMonth()+'.png); background-repeat: no-repeat; background-position: left bottom;" class="availDateunit" id="availD'+monthdays+'" onmouseover="_rd(\''+xhmonth+'\',\''+xhdate+'\')" onmouseout="_la(\''+xhmonth+'\',\''+xhdate+'\')"><div id="availabletext" style="margin-top:'+eval(hieghtOfTd-35)+'px">'+kh_['Clickhereto']+' <br> '+kh_['booknow1']+'</div></div>'; table+='<div style="height:'+eval(hieghtOfTd-1)+'px; background-image:url(images/month/'+kh_['monthImageFolderName']+'/month'+calDateDisplayVar.getMonth()+'.gif; background-repeat: no-repeat; background-position: left bottom;)" class="notAvailDateunit" id="notAvailD'+monthdays+'" onmouseover="_rd(\''+xhmonth+'\',\''+xhdate+'\')" onmouseout="_la(\''+xhmonth+'\',\''+xhdate+'\')"><div id="notAvailabletext" style="margin-top:'+eval(hieghtOfTd-35)+'px" >'+kh_['NotAvailable']+'<br> '+kh_['Seeothertime']+' </div></div>'; } else { table+='<div id="dateContainer'+monthdays+'" style="height:'+eval(hieghtOfTd-1)+'px" class="mnDateContainer">'; table+='<a href="#" onclick="_pc();"><div style="height:'+eval(hieghtOfTd-1)+'px" class="dateunit dateunit'+fb_+'" id="'+xhmonth+'d'+xhdate+'" onmouseover="_rd(\''+xhmonth+'\',\''+xhdate+'\')" onmouseout="_la(\''+xhmonth+'\',\''+xhdate+'\')" > </div></a>'; table+='<div style="height:'+eval(hieghtOfTd-1)+'px" class="availDateunit" id="availD'+monthdays+'" onmouseover="_rd(\''+xhmonth+'\',\''+xhdate+'\')" onmouseout="_la(\''+xhmonth+'\',\''+xhdate+'\')"><div id="availabletext" style="margin-top:'+eval(hieghtOfTd-35)+'px">'+kh_['Clickhereto']+' <br> '+kh_['booknow1']+'</div></div>'; table+='<div style="height:'+eval(hieghtOfTd-1)+'px" class="notAvailDateunit" id="notAvailD'+monthdays+'" onmouseover="_rd(\''+xhmonth+'\',\''+xhdate+'\')" onmouseout="_la(\''+xhmonth+'\',\''+xhdate+'\')"><div id="notAvailabletext" style="margin-top:'+eval(hieghtOfTd-35)+'px" >'+kh_['NotAvailable']+'<br> '+kh_['Seeothertime']+' </div></div>'; } } table+='<div style="height:'+eval(hieghtOfTd-1)+'px" class="daysAllAppointment" id="daysAllAppointment'+monthdays+'"><div id="daysAllAppointmentUp'+monthdays+'" class="availTimescrollUp" onmousedown="up=true;_y('+monthdays+')" onmouseup="up=false;">&nbsp;</div><div style="height:'+eval(hieghtOfTd-1)+'px;margin-top:'+eval(hieghtOfTd-35)+'px" class="daysAllAppointmentText daysAllAppointmentTextInMonth" id="daysAllAppointmentText'+monthdays+'"></div><div id="daysAllAppointmentDown'+monthdays+'" class="availTimescrollDown" onmousedown="down=true;_z('+monthdays+')" onmouseup="down=false;">&nbsp;</div></div>'; ir_['dateContainer'+monthdays]=calDateDisplayVar.toString(); table+='</div></td>'; if (i==7) { i=0; table += '</tr>'; } } table += '</TABLE>'; $('rightBr').innerHTML=table; _bp(now._cf()); _cd(paraCalDate); _bs(); clearTimeout(do_); do_=setTimeout("checkTimeAndService()",200); if(sessionRole =='Member') _ob(); }; function _ft() { var leftpos=0; var toppos=0; aTag = $('rightBr'); do { aTag = aTag.offsetParent; leftpos += aTag.offsetLeft; toppos += aTag.offsetTop; if(aTag.offsetParent==null) break; } while(aTag.tagName!="BODY"); $('loadingOnAnyClick').style.left=$('rightBr').offsetLeft+leftpos; $('loadingOnAnyClick').style.top=$('rightBr').offsetTop+toppos; $('loadingOnAnyClick').style.width=$('rightBr').offsetWidth; $('loadingOnAnyClick').style.height=$('rightBr').offsetHeight; $('loadingOnAnyClickInner').style.left=$('rightBr').offsetLeft+leftpos; $('loadingOnAnyClickInner').style.top=$('rightBr').offsetTop+toppos; $('loadingOnAnyClickInner').style.width=$('rightBr').offsetWidth; $('loadingOnAnyClickInner').style.height=$('rightBr').offsetHeight; } function _zy() { $('loadingOnAnyClick').style.display='block'; $('loadingOnAnyClickInner').style.display='block'; }; function _k() { $('loadingOnAnyClick').style.display='none'; $('loadingOnAnyClickInner').style.display='none'; }; function _lu(id) { var leftpos=0; var toppos=0; var desId=id.id.split('srTxSd'); id = $(id); aTag = id; do { aTag = aTag.offsetParent; leftpos += aTag.offsetLeft; toppos += aTag.offsetTop; if(aTag.offsetParent==null) break; } while(aTag.tagName!="BODY"); aTag = id; var scrMl=1; if(ie && (BrowserDetect.version)<7) scrMl=2; do { aTag = aTag.parentNode; leftpos -= aTag.scrollLeft; toppos -= scrMl*aTag.scrollTop; if(aTag.offsetParent==null) break; } while(aTag.tagName!="BODY"); if (e_[desId[1]][4] != '') $('serviceStaffDetailOnOver').style.display='block'; $('serviceStaffDetailOnOver').style.left=id.offsetLeft+id.offsetWidth+leftpos+'px'; $('serviceStaffDetailOnOver').style.top=id.offsetTop+toppos-10+'px'; Element.addClassName(id.id,'overRowColor'); $('serviceStaffDetailOnOverTX').innerHTML=e_[desId[1]][4]; if(ae_[1]<($('serviceStaffDetailOnOver').offsetHeight+$('serviceStaffDetailOnOver').offsetTop)) if($('serviceStaffDetailOnOver').offsetTop-(($('serviceStaffDetailOnOver').offsetHeight+$('serviceStaffDetailOnOver').offsetTop)-ae_[1])>0) $('serviceStaffDetailOnOver').style.top=$('serviceStaffDetailOnOver').offsetTop-(($('serviceStaffDetailOnOver').offsetHeight+$('serviceStaffDetailOnOver').offsetTop)-ae_[1])+'px'; else $('serviceStaffDetailOnOver').style.top='0px'; var ext=id.offsetTop+toppos-$('serviceStaffDetailOnOver').offsetTop; $('detailIndicator').style.top=ext-10+'px'; }; function _lv(id) { Element.removeClassName(id.id,'overRowColor'); $('serviceStaffDetailOnOver').style.display='none'; }; function _lw(id) { var leftpos=0; var toppos=0; var desId=id.id.split('srTxSd'); id = $(id); aTag = id; do { aTag = aTag.offsetParent; leftpos += aTag.offsetLeft; toppos += aTag.offsetTop+aTag.scrollTop; if(aTag.offsetParent==null) break; } while(aTag.tagName!="BODY"); aTag = id; var scrMl=1; if(ie && (BrowserDetect.version)<7) scrMl=2; do { aTag = aTag.parentNode; leftpos -= aTag.scrollLeft; toppos -= scrMl*aTag.scrollTop; if(aTag.offsetParent==null) break; } while(aTag.tagName!="BODY"); if (p_[desId[1]][3] != '') $('serviceStaffDetailOnOver').style.display='block'; $('serviceStaffDetailOnOver').style.left=id.offsetLeft+id.offsetWidth+leftpos; $('serviceStaffDetailOnOver').style.top=id.offsetTop+toppos; Element.addClassName(id.id,'overRowColor'); $('serviceStaffDetailOnOverTX').innerHTML=p_[desId[1]][3]; };function _lx() { var calDateDisplayVar=new Date(km_); var table='';     var appBgImg=''; if(hx_!='') { var imgbj=new Image(); appBgImg='style="background-image:url('+hx_+');"' } table+='<table id="right_cal_table" '+appBgImg+' border="0" cellpedding="0" cellspacing="0" class="go_table" > \n'; table += '<tr> \n'; var i = 0; var checkWeek=true; if(ee_==0) hieghtOfTd=(ae_[3]-167); else hieghtOfTd=ee_;   calDateDisplayVar.setDate(calDateDisplayVar.getDate()-1); var stD=true; var tomorrowDt=new Date(serverDate); tomorrowDt.setDate(tomorrowDt.getDate()+1); for(var monthdays = 1 ; monthdays <= 7 ; monthdays++) { calDateDisplayVar.setDate(calDateDisplayVar.getDate()+1); i += 1; var weekName=''; if(checkWeek) { bWeekClass=''; if ((jl_._cp(i-1, false))) bWeekClass='blockWeek'; if(serverDate.getDate() == calDateDisplayVar.getDate() && serverDate.getMonth() == calDateDisplayVar.getMonth()&& serverDate.getFullYear() == calDateDisplayVar.getFullYear()) weekName=kh_['Today']; else if(tomorrowDt.getDate() == calDateDisplayVar.getDate() && tomorrowDt.getMonth() == calDateDisplayVar.getMonth()&& tomorrowDt.getFullYear() == calDateDisplayVar.getFullYear()) weekName=kh_['Tomorrow']; else weekName=k_[calDateDisplayVar.getDay()]; if(i==7) checkWeek=false; } table += '<td width="14%" '; if((now.getMonth()!=todaydate.getMonth())) af = 1; else { if (todaydate.getDate() == calDateDisplayVar.getDate() && todaydate.getMonth() == calDateDisplayVar.getMonth()) { table += ' class=todayBox '; } } var xhmonth = calDateDisplayVar.getMonth()+1; var xhdate = calDateDisplayVar.getDate(); var xhyear = calDateDisplayVar.getFullYear(); if(stD) { hh_ = xhdate; hi_=xhmonth; stD=false; } var boxDate='\''+xhmonth+'/'+calDateDisplayVar.getDate()+'/'+xhyear+'\''; if(calDateDisplayVar.getDate()==1) { if(fb_=='Even') fb_='Odd'; else fb_='Even'; } if (calDateDisplayVar<serverDate || _cq(calDateDisplayVar, jk_)) { table += '><div id="'+xhmonth+'dh'+xhdate+'" class = "dateboxheadBlock dateboxheadBlock'+fb_+'"><span id='+xhmonth+'app'+xhdate+'> </span>'; table += weekName+' '; table += calDateDisplayVar.getDate() + ' <span class=cursor id='+xhmonth+'cursor'+xhdate+'> </span></div>'; if(calDateDisplayVar.getDate()==1||monthdays==1) { table+='<div id="dateContainer'+monthdays+'" style="height:'+eval(hieghtOfTd-1)+'px; background-image:url(images/month/'+kh_['monthImageFolderName']+'/month'+calDateDisplayVar.getMonth()+'.png); background-repeat: no-repeat; background-position: left bottom;" class="mnDateContainer">'; table+='<a href="javascript:void(0);" ><div style="height:'+eval(hieghtOfTd-1)+'px; background-image:url(images/month/'+kh_['monthImageFolderName']+'/month'+calDateDisplayVar.getMonth()+'.png); background-repeat: no-repeat; background-position: left bottom;" class="dateunitblocked dateunitblocked'+fb_+'" id="'+xhmonth+'d'+xhdate+'" onmouseover="_rd(\''+xhmonth+'\',\''+xhdate+'\')" onmouseout="_la(\''+xhmonth+'\',\''+xhdate+'\')" > </div></a>'; table+='<div style="height:'+eval(hieghtOfTd/2)+'px;" class="availDateunitBlocked"><div style="margin-top:'+eval(hieghtOfTd/2-10)+'px;" >&ndash; '+kh_['Blocked']+' &ndash;</div></div>'; table+='<div class="availDateunitWeek" id="availD'+monthdays+'"></div>'; table+='<div class="notAvailDateunitWeek" id="notAvailD'+monthdays+'"></div>'; } else { table+='<div id="dateContainer'+monthdays+'" style="height:'+eval(hieghtOfTd-1)+'px" class="mnDateContainer">'; table+='<a href="javascript:void(0);" ><div style="height:'+eval(hieghtOfTd-1)+'px;" class="dateunitblocked dateunitblocked'+fb_+'" id="'+xhmonth+'d'+xhdate+'" onmouseover="_rd(\''+xhmonth+'\',\''+xhdate+'\')" onmouseout="_la(\''+xhmonth+'\',\''+xhdate+'\')" > </div></a>'; table+='<div style="height:'+eval(hieghtOfTd/2)+'px;" class="availDateunitBlocked"><div style="margin-top:'+eval(hieghtOfTd/2-10)+'px;">&ndash; '+kh_['Blocked']+' &ndash;</div></div>'; table+='<div class="availDateunitWeek" id="availD'+monthdays+'"></div>'; table+='<div class="notAvailDateunitWeek" id="notAvailD'+monthdays+'"></div>'; } } else { table += '><div id="'+xhmonth+'dh'+xhdate+'" class = "dateboxhead dateboxhead'+fb_+'"><span id='+xhmonth+'app'+xhdate+'> </span>'; table += weekName+' '; table += calDateDisplayVar.getDate() + ' <span class=cursor id='+xhmonth+'cursor'+xhdate+'> </span></div>'; if(calDateDisplayVar.getDate()==1||monthdays==1) { table+='<div id="dateContainer'+monthdays+'" style="height:'+eval(hieghtOfTd-1)+'px; background-image:url(images/month/'+kh_['monthImageFolderName']+'/month'+calDateDisplayVar.getMonth()+'.png); background-repeat: no-repeat; background-position: left bottom;" class="mnDateContainer">'; table+='<a onclick="_pc();" href="javascript:void(0);"><div style="height:'+eval(hieghtOfTd-1)+'px; background-image:url(images/month/'+kh_['monthImageFolderName']+'/month'+calDateDisplayVar.getMonth()+'.png); background-repeat: no-repeat; background-position: left bottom;" class="dateunit dateunit'+fb_+'" id="'+xhmonth+'d'+xhdate+'" onmouseover="_rd(\''+xhmonth+'\',\''+xhdate+'\')" onmouseout="_la(\''+xhmonth+'\',\''+xhdate+'\')" > </div></a>'; table+='<div style="height:'+eval(hieghtOfTd-1)+'px; background-image:url(images/month/'+kh_['monthImageFolderName']+'/month'+calDateDisplayVar.getMonth()+'.png); background-repeat: no-repeat; background-position: left bottom;" class="availDateunitWeek" id="availD'+monthdays+'" onmouseover="_rd(\''+xhmonth+'\',\''+xhdate+'\')" onmouseout="_la(\''+xhmonth+'\',\''+xhdate+'\')"><div id="availabletext" style="margin-top:'+eval(hieghtOfTd/2-17)+'px">'+kh_['Clickhereto']+' <br> '+kh_['booknow1']+'</div></div>'; table+='<div style="height:'+eval(hieghtOfTd-1)+'px; background-image:url(images/month/'+kh_['monthImageFolderName']+'/month'+calDateDisplayVar.getMonth()+'.png; background-repeat: no-repeat; background-position: left bottom;)" class="notAvailDateunitWeek" id="notAvailD'+monthdays+'" onmouseover="_rd(\''+xhmonth+'\',\''+xhdate+'\')" onmouseout="_la(\''+xhmonth+'\',\''+xhdate+'\')"><div id="notAvailabletext" style="margin-top:'+eval(hieghtOfTd/2-17)+'px" >'+kh_['NotAvailable']+'<br> '+kh_['Seeothertime']+' </div></div>'; } else { table+='<div id="dateContainer'+monthdays+'" style="height:'+eval(hieghtOfTd-1)+'px" class="mnDateContainer">'; table+='<a onclick="_pc();" href="javascript:void(0);"><div style="height:'+eval(hieghtOfTd-1)+'px" class="dateunit dateunit'+fb_+'" id="'+xhmonth+'d'+xhdate+'" onmouseover="_rd(\''+xhmonth+'\',\''+xhdate+'\')" onmouseout="_la(\''+xhmonth+'\',\''+xhdate+'\')" > </div></a>'; table+='<div style="height:'+eval(hieghtOfTd-1)+'px" class="availDateunitWeek" id="availD'+monthdays+'" onmouseover="_rd(\''+xhmonth+'\',\''+xhdate+'\')" onmouseout="_la(\''+xhmonth+'\',\''+xhdate+'\')"><div id="availabletext" style="margin-top:'+eval(hieghtOfTd/2-17)+'px">'+kh_['Clickhereto']+' <br> '+kh_['booknow1']+'</div></div>'; table+='<div style="height:'+eval(hieghtOfTd-1)+'px" class="notAvailDateunitWeek" id="notAvailD'+monthdays+'" onmouseover="_rd(\''+xhmonth+'\',\''+xhdate+'\')" onmouseout="_la(\''+xhmonth+'\',\''+xhdate+'\')"><div id="notAvailabletext" style="margin-top:'+eval(hieghtOfTd/2-17)+'px" >'+kh_['NotAvailable']+'<br> '+kh_['Seeothertime']+' </div></div>'; } ir_['dateContainer'+monthdays]=calDateDisplayVar.toString(); } table+='<div style="height:'+eval(hieghtOfTd-1)+'px" class="daysAllAppointment" id="daysAllAppointment'+monthdays+'"><div id="daysAllAppointmentUp'+monthdays+'" class="availTimescrollUp" >&nbsp;</div><div style="height:'+eval(hieghtOfTd-40)+'px" class="daysAllAppointmentText" id="daysAllAppointmentText'+monthdays+'"></div><div id="daysAllAppointmentDown'+monthdays+'" class="availTimescrollDown" >&nbsp;</div></div>'; table+='</div></td>'; } table += '</tr>'; table += '</TABLE>'; $('rightBr').innerHTML=table; er_='week'; _bp(now._cf()); _cd(km_); _bs(); clearTimeout(do_); do_=setTimeout("checkTimeAndService()",200); if(sessionRole =='Member') _ob(); }; var cz_ = { '#topMenu #myAppLink': function(el) { el.onclick = function() { _hq(660, 325); _au('my-appointments.aspx', 'addE'); overlay(); } }, '#barServicetext input': function(el) { el.onclick = function() { _gw(this); } }, '#serviceListWhenNoLeftBar input': function(el) { el.onclick = function() { _gw(this); } },   '#barServicetext .srTxSd': function(el) { el.onmouseover = function() { if (!ez_) return false; var sid = this.id; _lu(this); return false; }, el.onmouseout = function() { _lv(this); return false; } }, '#serviceListWhenNoLeftBar .srTxSd': function(el) { el.onmouseover = function() { if (!ez_) return false; var sid = this.id; $('serviceListWhenNoLeftBar').style.display='block'; _lu(this); return false; }, el.onmouseout = function() { _lv(this); return false; } }, '#staffListWhenNoLeftBar .srTxSd': function(el) { el.onmouseover = function() { if (!ez_) return false; var sid = this.id; $('staffListWhenNoLeftBar').style.display='block'; _lw(this); return false; }, el.onmouseout = function() { _lv(this); return false; } }, '#left_time_body input': function(el) { el.onclick = function() { selectTime1(this, appointTime); } }, '#staffListWhenNoLeftBar input': function(el) { el.onclick = function() { _gv(this); } }, '#stSelection input': function(el) { el.onclick = function() { _gv(this); } }, '#stSelection a': function(el) { el.onclick = function() { var sid = this.id; sid = sid.split('sld'); _lb(sid[1]); return false; } }, '#staffListWhenNoLeftBar a': function(el) { el.onclick = function() { var sid = this.id; sid = sid.split('sld'); _lb(sid[1]); return false; } }, '#ap_right_header_leftMenu #tbT1': function(el) { el.onclick = function() { if (er_ != 'week') {   _ev(1); dh_.tPush(_zy, _gb, _k); dh_.tStart(); } return false; } }, '#ap_right_header_leftMenu #tbT2': function(el) { el.onclick = function() { if (er_ != 'month') {   _ev(2); dh_.tPush(_zy, _oz, _k); dh_.tStart(); } return false; } }, '#ap_right_header_leftMenu #tbT3': function(el) { el.onclick = function() { if (er_ != 'detail') {   _ev(3); dh_.tPush(_zy, _pd, _k); dh_.tStart(); } return false; } }, '#recAllAvailableTimeTopScroll':function(el){ el.onmouseover=function(){ down=true; _z('recAllAvailableTimeText'); return false; }, el.onmouseout=function(){ down=false; } }, '#recAllAvailableTimeBottomScroll':function(el){ el.onmouseover=function(){ up=true; _y('recAllAvailableTimeText'); return false; }, el.onmouseout=function(){ up=false; } } }; var db_={ '.daysAllAppointment .availTimescrollUp':function(el){ el.onmouseover=function(){ var sid=this.id; sid=sid.split('daysAllAppointmentUp'); down=true; _z('daysAllAppointmentText'+sid[1]); return false; }, el.onmouseout=function(){ down=false; } }, '.daysAllAppointment .availTimescrollDown':function(el){ el.onmouseover=function(){ var sid=this.id; sid=sid.split('daysAllAppointmentDown'); up=true; _y('daysAllAppointmentText'+sid[1]); return false; }, el.onmouseout=function(){ up=false; } }, '.upperDivTime':function(el){ el.onclick=function(){ if($('allBookingOrder').style.display!='none') __alf(this,ir_[this.id]); else _gd(ir_[this.id]); return false; } }, '.lowerDivTime':function(el){ el.onclick=function(){ if($('allBookingOrder').style.display!='none') __alf(this,ir_[this.id]); else _gd(ir_[this.id]); return false; } }, '.availableDate':function(el){ el.onclick=function(){ var sid=this.id; sid=sid.split('daysAllAppointmentText'); _jy(ir_['dateContainer'+sid[1]]); return false; } }, '.notAvailableDate':function(el){ el.onclick=function(){ var sid=this.id; if(sid=='') sid=this.parentNode.id; sid=sid.split('daysAllAppointmentText'); _jy(ir_['dateContainer'+sid[1]]); return false; } } }; var ei_={ '.availDateunitWeek': function(el){ el.onclick=function(){ var sid=this.id; sid=sid.split('availD'); var tempD=new Date(ir_['dateContainer'+sid[1]]); _gf(tempD.getDate(),tempD.getMonth(),tempD.getFullYear()); return false; } }, '.notAvailDateunitWeek':function(el){ el.onclick=function(){ var sid=this.id; sid=sid.split('notAvailD'); _jy(ir_['dateContainer'+sid[1]]); return false; } }, '.availDateunit': function(el){ el.onclick=function(){ var sid=this.id; sid=sid.split('availD'); var tempD=new Date(ir_['dateContainer'+sid[1]]); _gf(tempD.getDate(),tempD.getMonth(),tempD.getFullYear()); return false; } }, '.notAvailDateunit':function(el){ el.onclick=function(){ var sid=this.id; sid=sid.split('notAvailD'); _jy(ir_['dateContainer'+sid[1]]); return false; } } }; var ej_ ={ '#availTimeSlot table a.BookIt':function(el){ el.onclick=function(){ var sid=this.id; ir_[sid][0]; var dtStr=ir_[sid][1] +' '+ir_[sid][0]; _gd(dtStr); return false; } } }; var dc_={ '#bookB':function(el){ el.onclick=function(){ _hb(); return false; } }, '#bookMore':function(el){ el.onclick=function(){ __ale(); return false; } } }; var yt_={ '#bookRecur':function(el){ el.onclick=function(){ __alz(); return false; } } }; var ky_={ '.signupTableDataTd #saveBtnSpanId #saveBtn':function(el){ el.onclick=function(){ _oj('emailId','pwd','cPwd','fname','lname','dob','CountryDdl'); return false; } }, '#loginOnInsertApp':function(el){ el.onclick=function(){ if(_ne()) _nf(); return false; } } }; var mx_={ '.signupTableDataTd #saveBtnSpanId #saveBtn':function(el){ el.onclick=function(){ _oj('emailId','pwd','cPwd','fname','lname','dob','CountryDdl',true); return false; } }, '#loginOnInsertApp':function(el){ el.onclick=function(){ if(_ne()) _rg(); return false; } } }; var kz_={ '.signupTableDataTd #saveBtnSpanId #saveBtn':function(el){ el.onclick=function(){ _oi('pwd','cPwd','fname','lname','dob','CountryDdl',true); return false; } } }; var de_ ={ '#pDate #showDateWeekformat .topCalnext':function(el){ el.onclick=function(){   dh_.tPush(_zy,_gn,_k); dh_.tStart(); return false; } }, '#pDate #showDateWeekformat .topCalPre':function(el){ el.onclick=function(){   dh_.tPush(_zy,_go,_k); dh_.tStart(); return false; } }, '#pDate #showDateWeekformat #todayDateCal':function(el){ el.onclick=function(){   dh_.tPush(_zy,_ly,_k); dh_.tStart(); return false; } }, '#pDate #showDateMonthformat .topCalnext':function(el){ el.onclick=function(){   dh_.tPush(_zy,_gp,_k); dh_.tStart(); return false; } }, '#pDate #showDateMonthformat .topCalPre':function(el){ el.onclick=function(){   dh_.tPush(_zy,_gq,_k); dh_.tStart(); return false; } }, '#pDate #showDateMonthformat #todayDateCal':function(el){ el.onclick=function(){   dh_.tPush(_zy,_lz,_k); dh_.tStart(); return false; } } }; var dd_={ 'div.updateTmdiv':function(el){ el.onmousedown=function(){ setValueInBox(this);   }, el.onmouseover=function(){ Element.addClassName(this,'updateTmdivOver'); return false; }, el.onmouseout=function(){ Element.removeClassName(this,'updateTmdivOver'); return false; } }, '#AdminUpdateTimeButton':function(el){ el.onclick=function() { _du(); } } }; Behaviour.register(cz_); function _gj(Arr){ list=new Array(); list.push(Arr); for (h=0;sheet=list[h];h++){ for (selector in sheet){ list = document.getElementsBySelector(selector); if (!list){ continue; } for (i=0;element=list[i];i++){ if(typeof(sheet[selector])=='function') sheet[selector](element); } } } };  var showImages=3; var scrollimages=1; var imageObj=new Array(); var imageContainer="xhContainer"; var objLeftG; var objBodyG; var objRightG; var objImg; var objTd; var scrollInterval; var setScrolltime=2000; var refHeight=.30; var refOpacity=.30; var xGallery={ defaultHeight : 0.4, defaultOpacity: 0.5, initialize:function(){ if (!document.getElementsByTagName){ return; } var objMain =document.getElementById(imageContainer); var anchors = objMain.getElementsByTagName('a'); var anchorsLen=anchors.length; if(anchorsLen==0) return false; var objDiv = document.createElement("div"); objDiv.setAttribute('id','galleryLeft'); objDiv.onclick = function () {xGallery.xhPrevious(); return false;}; objMain.appendChild(objDiv); objDiv = document.createElement("div"); objDiv.setAttribute('id','galleryBody'); objMain.appendChild(objDiv); objTb = document.createElement("table"); objTb.setAttribute('border','0'); objTb.setAttribute('cellSpacing','0'); objTb.setAttribute('cellPadding','0'); var tblBody = document.createElement("tbody"); objTr = document.createElement("tr"); objDiv.appendChild(objTb); objTb.appendChild(tblBody); tblBody.appendChild(objTr); var objgalleryBody=document.getElementById('galleryBody'); objDiv = document.createElement("div"); objDiv.setAttribute('id','galleryRight'); objDiv.onclick = function () {xGallery.xhNext(); return false;}; objMain.appendChild(objDiv); for (var i=0; i<anchorsLen; i++){ var anchor = anchors[0]; var relAttribute = String(anchor.getAttribute('xh')); if (anchor.getAttribute('href') && (relAttribute.toLowerCase().match('xgallery'))){   objTd = document.createElement("td"); objTr.appendChild(objTd); objChDiv = document.createElement("div"); objTd.appendChild(objChDiv); objChDiv.appendChild(anchor); imageObj.push(anchor); var objImg=anchor.getElementsByTagName('img')[0]; xGallery.add(objImg, { height: objImg*refHeight/100, opacity : refOpacity}); } } xGallery.setObj(); if(anchorsLen>showImages) xGallery.xhSetWH(); else{ objLeftG.style.display='none'; objRightG.style.display='none'; } }, setObj:function(){ objLeftG=document.getElementById('galleryLeft'); objBodyG=document.getElementById('galleryBody'); objRightG=document.getElementById('galleryRight'); objImg=imageObj[0].getElementsByTagName('img')[0]; }, xhSetWH:function(){ var maxH=0;maxW=0; var elList=objBodyG.getElementsByTagName('div'); for(var i=0;i<elList.length;i++) { if(maxW<elList[i].offsetWidth) maxW=elList[i].offsetWidth; if(maxH<elList[i].offsetHeight) maxH=elList[i].offsetHeight; } for(var i=0;i<elList.length;i++) { elList[i].style.width=maxW+'px';   } var elList=objBodyG.getElementsByTagName('td'); objTd=elList[0]; setProp.setH(objLeftG,elList[0],0); setProp.setH(objBodyG,elList[0],0); setProp.setH(objRightG,elList[0],0); objBodyG.style.width=(objTd.offsetWidth)*showImages+'px'; objBodyG.scrollLeft=0; xGallery.xhStrat(); }, xhStrat:function(){ clearInterval(scrollInterval); scrollInterval=setInterval('xGallery.xhNext()',setScrolltime); }, xhStop:function(){ clearInterval(scrollInterval); }, xhPause:function(){ }, xhNext:function(){ for(var i=0;i<scrollimages;i++) { var getTd=objBodyG.getElementsByTagName('td'); if(!getTd[0]) { clearInterval(scrollInterval); return false; } var getTdP=getTd[0].parentNode; var objRm=getTdP.removeChild(getTd[0]); getTdP.appendChild(objRm);   } }, xhPrevious:function(){ for(var i=0;i<scrollimages;i++) { var getTd=objBodyG.getElementsByTagName('td'); var getTdP=getTd[0].parentNode; var objRm=getTdP.removeChild(getTd[getTd.length-1]); getTdP.insertBefore(objRm,getTd[0]);   } }, add: function(image, options) { xGallery.remove(image); doptions = { "height" : xGallery.defaultHeight, "opacity" : xGallery.defaultOpacity }; if (options) { for (var i in doptions) { if (!options[i]) { options[i] = doptions[i]; } } } else { options = doptions; } try { var d = document.createElement('div'); var p = image; var classes = p.className.split(' '); var newClasses = ''; for (j=0;j<classes.length;j++) { if (classes[j] != "reflect") { if (newClasses) { newClasses += ' '; } newClasses += classes[j]; } } var reflectionHeight = Math.floor(p.height*options['height']); var divHeight = Math.floor(p.height*(1+options['height'])); var reflectionWidth = p.width; if (document.all && !window.opera) {   if(p.parentElement.tagName == 'A') { var d = document.createElement('a'); d.href = p.parentElement.href; }           var reflection = document.createElement('img'); reflection.src = p.src; reflection.style.width = reflectionWidth+'px'; reflection.style.display = 'block'; reflection.style.border = '0px'; reflection.style.height = p.height+"px"; reflection.style.marginBottom = "-"+(p.height-reflectionHeight)+'px'; reflection.style.filter = 'flipv progid:DXImageTransform.Microsoft.Alpha(opacity='+(options['opacity']*100)+', style=1, finishOpacity=0, startx=0, starty=0, finishx=0, finishy='+(options['height']*100)+')';     p.parentNode.replaceChild(d, p); d.appendChild(p); d.appendChild(reflection); } else { var canvas = document.createElement('canvas'); if (canvas.getContext) {           var context = canvas.getContext("2d"); canvas.style.height = reflectionHeight+'px'; canvas.style.width = reflectionWidth+'px'; canvas.height = reflectionHeight; canvas.width = reflectionWidth;     p.parentNode.replaceChild(d, p); d.appendChild(p); d.appendChild(canvas); context.save(); context.translate(0,image.height-1); context.scale(1,-1); context.drawImage(image, 0, 0, reflectionWidth, image.height); context.restore(); context.globalCompositeOperation = "destination-out"; var gradient = context.createLinearGradient(0, 0, 0, reflectionHeight); gradient.addColorStop(1, "rgba(255, 255, 255, 1.0)"); gradient.addColorStop(0, "rgba(255, 255, 255, "+(1-options['opacity'])+")"); context.fillStyle = gradient; if (navigator.appVersion.indexOf('WebKit') != -1) { context.fill(); } else { context.fillRect(0, 0, reflectionWidth, reflectionHeight*2); } } } } catch (e) { } }, remove : function(image) { if (image.className == "reflected") { image.className = image.parentNode.className; image.parentNode.parentNode.replaceChild(image, image.parentNode); } } }; var setProp={ setH:function(s,t,e){ s.style.height=t.offsetHeight+e+'px'; } }; function initXGallery(flag) { xGallery.initialize(); };    var dg_=new Array(); var dh_={ tPush:function(){ var args = dh_.tPush.arguments; for(var i=0;i<args.length;i++) {   dg_.push(args[i]); } }, tStart:function(){ if(dg_.length>0) { dg_[0].call(); dg_.shift(); setTimeout("dh_.tStart()",10); } } }; function _ly() { _gi(todaydate,0); }; function _gn() { _gi(ir_["moveCalByNPT"],7); }; function _go() { _gi(ir_["moveCalByNPT"],-7); }; function _lz() { _im(todaydate,0); }; function _gp() { _im(ir_["moveCalByNPT"],42); }; function _gq() { _im(ir_["moveCalByNPT"],-42); };  var imagePath='Timepicker/Images/'; var ie=document.all; var dom=document.getElementById; var ns4=document.layers; var r_=false; var s_; var t_=8; var u_=0; var v_='AM'; var w_=25; var x_=new Date(); var y_=new Date(); var z_; var aa_; function resetVariabl1(appST,appET,aSlot) { x_=new Date('12/12/2007 '+appST); y_=new Date('12/12/2007 '+appET); t_=x_.getHours(); u_=x_.getMinutes(); v_='AM'; if(t_>12) v_='PM'; w_=parseInt(aSlot); refreshTimePicker1(0); }; function setTimePicker1(t) { $(s_.id).value=t; closeTimePicker1(); }; function setTimePickerMonth(t) { $(s_.id).value=t; closeTimePickerMonth(); }; var ab_ = 0; function refreshTimePicker1(mode) { var morningTimeStart=new Date('12/12/2007 12:00:00 AM'); var morningTimeEnd=new Date('12/12/2007 11:59:00 AM'); var afternoonTimeStart=new Date('12/12/2007 12:00:00 PM'); var afternoonTimeEnd=new Date('12/12/2007 3:59:00 PM'); var eveningTimeStart=new Date('12/12/2007 4:00:00 PM'); var eveningTimeEnd=new Date('12/12/2007 7:59:00 PM'); var nightTimeStart=new Date('12/12/2007 8:00:00 PM'); var nightTimeEnd=new Date('12/12/2007 11:59:00 PM'); ab_ = ab_+1; var chkTimeText; if (mode==0) suffix="AM"; else suffix="PM"; sHTML = "<table width='100%'><tr><td><table width='100%' cellpadding=3 cellspacing=0 bgcolor='#f0f0f0'>"; var k=8; sHTML+="<tr align=right>"; sHTML+="<td colspan='4' class='timeTD' style='height:18px' onmouseover='this.className=\"timeTDmouseOver\"' onmouseout='this.className=\"timeTD\"' onclick='setTimePicker1(\""+kh_['FullDay']+"\");checkTimeAndService();'><a class='timeLink' href='#'>"+kh_['FullDay']+"</a></td>"; sHTML+="</tr>"; var chkVarForUpperSlot = 0; sHTML+="<tr align=right>"; sHTML+="<td colspan='4' style='width:100%' align=right id='tableForUpperSlot'>"; sHTML+= "<table width='100%' cellpadding='0' cellspacing='0' border='0'>"; sHTML+="<tr align=right>"; if(((x_>=morningTimeStart)&&(x_<=morningTimeEnd))||((x_<=morningTimeStart)&&(y_>=morningTimeStart))) { chkVarForUpperSlot = chkVarForUpperSlot + 1; sHTML+="<td class='timeTD' onmouseover='this.className=\"timeTDmouseOver\"' onmouseout='this.className=\"timeTD\"' onclick='setTimePicker1(\""+kh_['Morning']+"\");checkTimeAndService();'><a class='timeLink' href='#'>"+kh_['Morning']+"</a></td>"; } if(((x_<=afternoonTimeStart)&&(y_>=afternoonTimeStart))||((afternoonTimeStart<=x_)&&(afternoonTimeEnd>=x_))) { chkVarForUpperSlot = chkVarForUpperSlot + 1; sHTML+="<td class='timeTD' onmouseover='this.className=\"timeTDmouseOver\"' onmouseout='this.className=\"timeTD\"' onclick='setTimePicker1(\""+kh_['Afternoon']+"\");checkTimeAndService();'><a class='timeLink' href='#'>"+kh_['Afternoon']+"</a></td>"; } if(((x_>=eveningTimeStart)&&(x_<=eveningTimeEnd))||((x_<=eveningTimeStart)&&(y_>=eveningTimeStart))) { chkVarForUpperSlot = chkVarForUpperSlot + 1; sHTML+="<td class='timeTD' onmouseover='this.className=\"timeTDmouseOver\"' onmouseout='this.className=\"timeTD\"' onclick='setTimePicker1(\""+kh_['Evening']+"\");checkTimeAndService();'><a class='timeLink' href='#'>"+kh_['Evening']+"</a></td>"; } if(((x_>=nightTimeStart)&&(x_<=nightTimeEnd))||((x_<=nightTimeStart)&&(y_>=nightTimeStart))) { chkVarForUpperSlot = chkVarForUpperSlot + 1; sHTML+="<td class='timeTD' onmouseover='this.className=\"timeTDmouseOver\"' onmouseout='this.className=\"timeTD\"' onclick='setTimePicker1(\""+kh_['Night']+"\");checkTimeAndService();'><a class='timeLink' href='#'>"+kh_['Night']+"</a></td>"; } sHTML+="</tr>"; sHTML+="</table>"; sHTML+="</td>"; sHTML+="</tr>"; for (i=0;i<=1;) { sHTML+="<tr align=right>"; k+=1; if(k>12) hr=k-12; else hr=k; if(k>=12) suffix='PM'; else suffix='AM'; for (j=0;j<4;j++) { while(u_>=60) { u_-=60; t_+=1; } if(t_>12) t_-=12; if(x_.getHours()>=12) v_='PM'; else v_='AM'; chkTimeText = t_ + ":" + padZero(u_) +":00"+ " " + v_; if(chkTimeText==z_) sHTML+="<td class='timeTDmouseOver' onmouseover='this.className=\"timeTDmouseOver\"' onclick='setTimePicker1(\""+ t_ + ":" + padZero(u_) +""+ " " + v_ + "\");checkTimeAndService();'><a class='timeLink'href='#'>" + t_ + ":"+padZero(u_) + "<font class='ampm'>" + v_ + "</font></a></td>"; else sHTML+="<td class='timeTD' onmouseover='this.className=\"timeTDmouseOver\"' onmouseout='this.className=\"timeTD\"' onclick='setTimePicker1(\""+ t_ + ":" + padZero(u_) +""+ " " + v_ + "\");checkTimeAndService();'><a class='timeLink'href='#'>" + t_ + ":"+padZero(u_) + "<font class='ampm'>" + v_ + "</font></a></td>"; u_+=w_; x_.setMinutes(x_.getMinutes()+w_); if(x_>y_) break; } sHTML+="</tr>"; if(x_>y_) break; } sHTML += "</table></td></tr></table>"; document.getElementById("timePickerContent1").innerHTML = sHTML; if(chkVarForUpperSlot<2) { document.getElementById('tableForUpperSlot').style.display = 'none'; } }; document.write ("<div id='timepicker1' style='z-index:+999;position:absolute;display:none;'><table id='mainTable' cellpadding=0 width='100%'><tr class='headingBackColorTR'><td><table cellpadding='0' cellspacing='0' class='headingBackImageTABLE' width='100%'><tr valign='bottom'><td class='headingTextTD'>Select a Time</td><td></td><td></td><td class='headingTextCloseTD'><a href='javascript:void(0);' class='headingTextCloseLink' onclick='closeTimePicker1()' border='0'>X</a></td></tr></table></td></tr><tr><td colspan='2' class='TDcontainerTime'><span id='timePickerContent1'></span></td></tr></table></div>");  var ac_=(dom)?document.getElementById("timepicker1").style : ie? document.all.timepicker1 : document.timepicker1; var ad_; function selectTime1(ctl,ctl2) { var leftpos=0; var toppos=0; z_ = ctl2.value; s_=ctl2; ad_ = ctl; ad_.src=imagePath + "timepicker2.gif"; aTag = document.getElementById(ctl.id); do { aTag = aTag.offsetParent; leftpos += aTag.offsetLeft; toppos += aTag.offsetTop; if(aTag.offsetParent==null) break; } while(aTag.tagName!="BODY"); ac_.display='block'; ac_.left = ctl.offsetLeft + leftpos+'px'; resetVariabl1(hp_,hq_,timeDifferenceOfSlot); if((ctl.offsetTop-document.getElementById("timepicker1").offsetHeight + toppos + 2)<0) ac_.top = ctl.offsetTop+ctl.offsetHeight + toppos + 2 +'px'; else ac_.top = ctl.offsetTop-document.getElementById("timepicker1").offsetHeight + toppos + 2 +'px'; if(document.getElementById("timepicker1")) { hideElement( 'SELECT', document.getElementById("timepicker1") ); hideElement( 'APPLET', document.getElementById("timepicker1") ); } r_ = true; }; function hideElement( elmID, overDiv ){ if( ie ){ for( i = 0; i < document.all.tags( elmID ).length; i++ ){ obj = document.all.tags( elmID )[i]; if( !obj || !obj.offsetParent ) continue; objLeft = obj.offsetLeft; objTop = obj.offsetTop; objParent = obj.offsetParent; while( objParent.tagName.toUpperCase() != "BODY" ) { objLeft += objParent.offsetLeft; objTop += objParent.offsetTop; objParent = objParent.offsetParent; if(objParent.offsetParent==null) break; } objHeight = obj.offsetHeight; objWidth = obj.offsetWidth; if(( overDiv.offsetLeft + overDiv.offsetWidth ) <= objLeft ); else if(( overDiv.offsetTop + overDiv.offsetHeight ) <= objTop ); else if( overDiv.offsetTop >= ( objTop + objHeight + obj.height )); else if( overDiv.offsetLeft >= ( objLeft + objWidth )); else obj.style.visibility = "hidden"; } } }; function showElement( elmID ){ if( ie ){ for( i = 0; i < document.all.tags( elmID ).length; i++ ){ obj = document.all.tags( elmID )[i]; if( !obj || !obj.offsetParent ) continue; obj.style.display = "block"; } } }; function closeTimePicker1() { ac_.display="none"; showElement( 'SELECT' ); showElement( 'APPLET' ); ad_.src=imagePath + "timepicker.gif"; }; function isDigit(c) { return ((c=='0')||(c=='1')||(c=='2')||(c=='3')||(c=='4')||(c=='5')||(c=='6')||(c=='7')||(c=='8')||(c=='9')); }; function isNumeric(n) { num = parseInt(n,10); return !isNaN(num); }; function padZero(n) { v=""; if (n<10) return ('0'+n); else return n; }; function validateDatePicker1(ctl) { var mode=''; t=ctl.value.toLowerCase(); t=t.replace(" ",""); t=t.replace(".",":"); t=t.replace("-",""); if ((isNumeric(t))&&(t.length==4)) { t=t.charAt(0)+t.charAt(1)+":"+t.charAt(2)+t.charAt(3); } var t=new String(t); tl=t.length; if (tl==1 ){ if (isDigit(t)) { ctl.value=t+":00 AM"; } else { return false; } } else if (tl==2) { if (isNumeric(t)) { if (parseInt(t,10)<13){ if (t.charAt(1)!=":") ctl.value= t + ':00 AM'; else ctl.value= t + '00 AM'; } else if (parseInt(t,10)==24) ctl.value= "0:00 AM"; else if (parseInt(t,10)<24) { if (t.charAt(1)!=":") ctl.value= (t-12) + ':00 PM'; else ctl.value= (t-12) + '00 PM'; } else if (parseInt(t,10)<=60) ctl.value= '0:'+padZero(t)+' AM'; else ctl.value= '1:'+padZero(t%60)+' AM'; } else { if ((t.charAt(0)==":")&&(isDigit(t.charAt(1)))) ctl.value = "0:" + padZero(parseInt(t.charAt(1),10)) + " AM"; else return false; } } else if (tl>=3) { var arr = t.split(":"); if (t.indexOf(":") > 0) { hr=parseInt(arr[0],10); mn=parseInt(arr[1],10); if (t.indexOf("PM")>0) mode="PM"; else mode="AM"; if (isNaN(hr)) hr=0; else { if (hr>24) return false; else if (hr==24) { mode="AM"; hr=0; } else if (hr>12) { mode="PM"; hr-=12; } } if (isNaN(mn)) { mn=0; } else { if (mn>60) { mn=mn%60; hr+=1; } } } else { hr=parseInt(arr[0],10); if (isNaN(hr)) hr=0; else { if (hr>24) return false; else if (hr==24) { mode="AM"; hr=0; } else if (hr>12) { mode="PM"; hr-=12; } } mn = 0; } if (hr==24) { hr=0; mode="AM"; } ctl.value=hr+":"+padZero(mn)+" "+mode; } }; function setTimePicker(t) { $(s_.id).value=t; closeTimePicker(); }; function resetVariabl(appST,appET,aSlot) { x_=new Date('12/12/2007 '+appST); y_=new Date('12/12/2007 '+appET); t_=x_.getHours(); u_=x_.getMinutes(); v_='am'; if(t_>12) v_='pm'; w_=parseInt(aSlot); refreshTimePicker(0); }; var ab_ = 0; function refreshTimePicker(mode) { ab_ = ab_+1; var chkTimeText; if (mode==0) suffix="AM"; else suffix="PM"; sHTML = "<table width='100%'><tr><td><table width='100%' cellpadding=3 cellspacing=0 bgcolor='#f0f0f0'>"; var k=8; for (i=0;i<=1;) { sHTML+="<tr align=right>"; k+=1; if(k>12) hr=k-12; else hr=k; if(k>=12) suffix='PM'; else suffix='AM'; for (j=0;j<4;j++) { while(u_>=60) { u_-=60; t_+=1; } if(t_>12) t_-=12; if(x_.getHours()>=12) v_='pm'; else v_='am'; chkTimeText = t_ + ":" + padZero(u_) +":00"+ " " + v_; if(chkTimeText==z_) sHTML+="<td class='timeTDmouseOver' onmouseover='this.className=\"timeTDmouseOver\"' onclick='setTimePicker(\""+ t_ + ":" + padZero(u_) + " " + v_ + "\");'><a class='timeLink' onclick='setTimePicker(\""+ t_ + ":00 " + padZero(u_) + " " + v_ + "\");' href='#'>" + t_ + ":"+padZero(u_) + "<font class='ampm'>" + v_ + "</font></a></td>"; else sHTML+="<td class='timeTD' onmouseover='this.className=\"timeTDmouseOver\"' onmouseout='this.className=\"timeTD\"' onclick='setTimePicker(\""+ t_ + ":" + padZero(u_) + " " + v_ + "\");'><a class='timeLink' onclick='setTimePicker(\""+ t_ + ":00 " + padZero(u_) + " " + v_ + "\");' href='#'>" + t_ + ":"+padZero(u_) + "<font class='ampm'>" + v_ + "</font></a></td>"; u_+=w_; x_.setMinutes(x_.getMinutes()+w_); if(x_>y_) break; } sHTML+="</tr>"; if(x_>y_) break; } sHTML += "</table></td></tr></table>"; document.getElementById("timePickerContent").innerHTML = sHTML; }; document.write ("<div id='timepicker' style='z-index:+999;position:absolute;display:none;'><table id='mainTable' cellpadding=0 width='100%'><tr class='headingBackColorTR'><td><table cellpadding='0' cellspacing='0' class='headingBackImageTABLE' width='100%'><tr valign='bottom'><td class='headingTextTD'>Select a Time</td><td></td><td></td><td class='headingTextCloseTD'><a href='javascript:void(0);' onclick='closeTimePicker()' border='0'>X</a></td></tr></table></td></tr><tr><td colspan='2' class='TDcontainerTime'><span id='timePickerContent'></span></td></tr></table></div>");  var crossobj=(dom)?document.getElementById("timepicker").style : ie? document.all.timepicker : document.timepicker; var ad_; function selectTime(ctl,ctl2) { var leftpos=0; var toppos=0; z_ = ctl2.value; s_=ctl2; ad_ = ctl; ad_.src=imagePath + "timepicker2.gif"; aTag = ctl; do { aTag = aTag.offsetParent; leftpos += aTag.offsetLeft; toppos += aTag.offsetTop; if(aTag.offsetParent==null) break; } while(aTag.tagName!="BODY"); crossobj.left = ctl.offsetLeft + leftpos+2+'px'; crossobj.top = ctl.offsetTop + toppos + ctl.offsetHeight + 2 +'px'; crossobj.display= "block"; if(document.getElementById("timepicker")) { hideElement( 'SELECT', document.getElementById("timepicker") ); hideElement( 'APPLET', document.getElementById("timepicker") ); } r_ = true; resetVariabl(hp_,hq_,timeDifferenceOfSlot); }; function closeTimePicker() { crossobj.display="none"; showElement( 'SELECT' ); showElement( 'APPLET' ); ad_.src=imagePath + "timepicker.gif"; }; function validateDatePicker(ctl) { var mode=''; t=ctl.value.toLowerCase(); t=t.replace(" ",""); t=t.replace(".",":"); t=t.replace("-",""); if ((isNumeric(t))&&(t.length==4)) t=t.charAt(0)+t.charAt(1)+":"+t.charAt(2)+t.charAt(3); var t=new String(t); tl=t.length; if (tl==1 ) { if (isDigit(t)) { ctl.value=t+":00 AM"; } else { return false; } } else if (tl==2) { if (isNumeric(t)) { if (parseInt(t,10)<13){ if (t.charAt(1)!=":") { ctl.value= t + ':00 AM'; } else { ctl.value= t + '00 AM'; } } else if (parseInt(t,10)==24) { ctl.value= "0:00 AM"; } else if (parseInt(t,10)<24) { if (t.charAt(1)!=":") { ctl.value= (t-12) + ':00 PM'; } else { ctl.value= (t-12) + '00 PM'; } } else if (parseInt(t,10)<=60) { ctl.value= '0:'+padZero(t)+' AM'; } else { ctl.value= '1:'+padZero(t%60)+' AM'; } } else { if ((t.charAt(0)==":")&&(isDigit(t.charAt(1)))) { ctl.value = "0:" + padZero(parseInt(t.charAt(1),10)) + " AM"; } else { return false; } } } else if (tl>=3) { var arr = t.split(":"); if (t.indexOf(":") > 0) { hr=parseInt(arr[0],10); mn=parseInt(arr[1],10); if (t.indexOf("PM")>0) { mode="PM"; } else { mode="AM"; } if (isNaN(hr)) { hr=0; } else { if (hr>24) { return false; } else if (hr==24) { mode="AM"; hr=0; } else if (hr>12) { mode="PM"; hr-=12; } } if (isNaN(mn)) { mn=0; } else { if (mn>60) { mn=mn%60; hr+=1; } } } else { hr=parseInt(arr[0],10); if (isNaN(hr)) { hr=0; } else { if (hr>24) { return false; } else if (hr==24) { mode="AM"; hr=0; } else if (hr>12) { mode="PM"; hr-=12; } } mn = 0; } if (hr==24) { hr=0; mode="AM"; } ctl.value=hr+":"+padZero(mn)+" "+mode; } }; function NiftyCheck(){ if(!document.getElementById || !document.createElement) return(false); aa_=/html\:/.test(document.getElementsByTagName('body')[0].nodeName); if(Array.prototype.push==null){ Array.prototype.push=function(){ this[this.length]=arguments[0]; return(this.length); } } return(true); }; function Rounded(selector,wich,bk,color,opt){ var i,prefixt,prefixb,cn="r",ecolor="",edges=false,eclass="",b=false,t=false; if(color=="transparent"){ cn=cn+"x"; ecolor=bk; bk="transparent"; } else if(opt && opt.indexOf("border")>=0){ var optar=opt.split(" "); for(i=0;i<optar.length;i++) if(optar[i].indexOf("#")>=0) ecolor=optar[i]; if(ecolor=="") ecolor="#666"; cn+="e"; edges=true; } else if(opt && opt.indexOf("smooth")>=0){ cn+="a"; ecolor=Mix(bk,color); } if(opt && opt.indexOf("small")>=0) cn+="s"; prefixt=cn; prefixb=cn; if(wich.indexOf("all")>=0){ t=true; b=true; } else if(wich.indexOf("top")>=0) t="true"; else if(wich.indexOf("tl")>=0){ t="true"; if(wich.indexOf("tr")<0) prefixt+="l"; } else if(wich.indexOf("tr")>=0){ t="true"; prefixt+="r"; } if(wich.indexOf("bottom")>=0) b=true; else if(wich.indexOf("bl")>=0){ b="true"; if(wich.indexOf("br")<0) prefixb+="l"; } else if(wich.indexOf("br")>=0){ b="true"; prefixb+="r"; } var v=getElementsBySelector(selector); var l=v.length; for(i=0;i<l;i++){ if(edges) AddBorder(v[i],ecolor); if(t) AddTop(v[i],bk,color,ecolor,prefixt); if(b) AddBottom(v[i],bk,color,ecolor,prefixb); } }; function AddBorder(el,bc){ var i; if(!el.passed){ if(el.childNodes.length==1 && el.childNodes[0].nodeType==3){ var t=el.firstChild.nodeValue; el.removeChild(el.lastChild); var d=CreateEl("span"); d.style.display="block"; d.appendChild(document.createTextNode(t)); el.appendChild(d); } for(i=0;i<el.childNodes.length;i++){ if(el.childNodes[i].nodeType==1){ el.childNodes[i].style.borderLeft="1px solid "+bc; el.childNodes[i].style.borderRight="1px solid "+bc; } } } el.passed=true; }; function AddTop(el,bk,color,bc,cn){ var i,lim=4,d=CreateEl("b"); if(cn.indexOf("s")>=0) lim=2; if(bc) d.className="artop"; else d.className="rtop"; d.style.backgroundColor=bk; for(i=1;i<=lim;i++){ var x=CreateEl("b"); x.className=cn + i; x.style.backgroundColor=color; if(bc) x.style.borderColor=bc; d.appendChild(x); } el.style.paddingTop=0; el.insertBefore(d,el.firstChild); }; function AddBottom(el,bk,color,bc,cn){ var i,lim=4,d=CreateEl("b"); if(cn.indexOf("s")>=0) lim=2; if(bc) d.className="artop"; else d.className="rtop"; d.style.backgroundColor=bk; for(i=lim;i>0;i--){ var x=CreateEl("b"); x.className=cn + i; x.style.backgroundColor=color; if(bc) x.style.borderColor=bc; d.appendChild(x); } el.style.paddingBottom=0; el.appendChild(d); }; function CreateEl(x){ if(aa_) return(document.createElementNS('http:\/\/www.w3.org/1999/xhtml',x)); else return(document.createElement(x)); }; function getElementsBySelector(selector){ var i,selid="",selclass="",tag=selector,f,s=[],objlist=[]; if(selector.indexOf(" ")>0){ s=selector.split(" "); var fs=s[0].split("#"); if(fs.length==1) return(objlist); f=document.getElementById(fs[1]); if(f) return(f.getElementsByTagName(s[1])); return(objlist); } if(selector.indexOf("#")>0){ s=selector.split("#"); tag=s[0]; selid=s[1]; } if(selid!=""){ f=document.getElementById(selid); if(f) objlist.push(f); return(objlist); } if(selector.indexOf(".")>0){ s=selector.split("."); tag=s[0]; selclass=s[1]; } var v=document.getElementsByTagName(tag); if(selclass=="") return(v); for(i=0;i<v.length;i++){ if(v[i].className.indexOf(selclass)>=0) objlist.push(v[i]); } return(objlist); }; function Mix(c1,c2){ var i,step1,step2,x,y,r=new Array(3); if(c1.length==4) step1=1; else step1=2; if(c2.length==4) step2=1; else step2=2; for(i=0;i<3;i++){ x=parseInt(c1.substr(1+step1*i,step1),16); if(step1==1) x=16*x+x; y=parseInt(c2.substr(1+step2*i,step2),16); if(step2==1) y=16*y+y; r[i]=Math.floor((x*50+y*50)/100); } return("#"+r[0].toString(16)+r[1].toString(16)+r[2].toString(16)); }; if(ab_==1) { if(NiftyCheck()) Rounded("div#timepicker","bottom bl br","#FFF","#000000","smooth"); resetVariabl(hp_,hq_,timeDifferenceOfSlot); Rounded("div#timepicker1","bottom tl tr","#FFF","#000000","smooth"); resetVariabl1(hp_,hq_,timeDifferenceOfSlot); }; var la_; function _gr(pageName, formName, containerName, methodType, functionName){ var url = pageName; var pars = formName != '' ? Form.serialize(formName) : '' ; if (containerName != ''){ la_ = new Ajax.Updater( containerName,url, { method: 'post', parameters: pars, evalScripts:true, onSuccess: eval(functionName), onFailure: _kb }); } else { la_ = new Ajax.Request( url, { method: methodType, parameters: pars, onSuccess: eval(functionName), onFailure: _kb }); } }; function _ma() { overlayLogin(); _hq(456,250); _gr('LoginAndSignupDirect.aspx?isLogInBox=1', '', 'addE', 'get', '_ba'); }; function _rg() { var par = 'uname='+trim($('uname').value)+'&passwd='+$('passwd').value;     _gr('checklogin.aspx?'+par, '', 'testaddE', 'post', '_md'); }; function _mb() { var url = 'forgotPassword.aspx'; la_ = new Ajax.Updater( 'addE', url, { method: 'post', evalScripts:true, onFailure: _kb }); }; function _mc() { overlayLogin(); _gr('changeEmail.asp', '', '', 'get', '_ba'); }; function _md(req) { if((req.responseText=='Incorrect password. Try Again.')||(req.responseText=='No user found. Try Again.')||(req.responseText=='Please Verify your Account Sign up. Check your mailbox.')) { if (req.responseText=='Please Verify your Account Sign up. Check your mailbox.') { var show = confirm(kh_['verifyConfirmBox']); if(show) { _mh(); } else { document.loginForm.Button.value = kh_['LogInArrow']; document.loginForm.Button.disabled = false; $('passwd').disabled = false; } } else { if(req.responseText=='Incorrect password. Try Again.') alert( kh_['IncorrectPass']); else alert( kh_['NoUserFound']); document.loginForm.Button.value = kh_['LogInArrow']; document.loginForm.Button.disabled = false; $('passwd').disabled = false; } } else { if(req.responseText=='verifycellNoforUS') { ev_=true; fc_=new Ajax.PeriodicalUpdater('addE', 'verifiedCellNoForUS.aspx?uName='+$('uname').value, {asynchronous:true,evalScripts:true, frequency:2}); } else { if(req.responseText=='verifycellNo') { ev_=true; var ajx=new Ajax.Updater('addE', 'verifiedCellNo.aspx?uName='+$('uname').value + '&LoginFlag=1', {asynchronous:true,evalScripts:true, frequency:2}); } else { noOverlay(); } } } }; function _me(id,role,name,mobVari,homeVari,workVari,mobVariCode,homeVariCode,workVariCode,userFirstName,usrAffiliateId) { sessionUID =id; sessionRole =role; sessionName =name; sessionMobVari1 = mobVari; sessionHomeVari1 = homeVari; sessionWorkVari1 = workVari; sessionMobVariCode = mobVariCode; sessionHomeVariCode = homeVariCode; sessionWorkVariCode = workVariCode; sessionuserFirstName = userFirstName; userAffiliateId=usrAffiliateId;   _mm(); _ob(); _bp(now._cf()); }; function _mf(req) { if((req.responseText=='Incorrect E-mail. Try Again.')||(req.responseText=='No user found. Try Again.')) { if(req.responseText=='Incorrect E-mail. Try Again.') alert( kh_['incorrectEmailTryAgain']); else alert( kh_['NoUserFound']); $('subm').innerHTML = 'Change my password'; $('subm').disabled = false; $('email').disabled = false; } if((req.responseText=='Please check your email, a link has been sent on your email, please click it to confirm your email.')) { alert(kh_['forgotPassLink']); $('subm').innerHTML = 'Send me my password'; $('subm').disabled = false; $('email').disabled = false; _gr('login.aspx', '', '', 'get', '_ba'); } }; function _mg(req) { et_ = req.responseText; $('user').innerHTML="&nbsp;"+et_+"&nbsp;"; for(var i=0;i<4;i++) new Effect.Highlight('user',{duration:0.4, delay: 0.2, queue: 'front', startcolor: '#CBCBE4'}); _gr('checkRoleSession.aspx','','','get', '_mk'); _gr('checkSessionId.aspx','','','get', '_ml'); }; function _mh(){ uname=$('uname').value; _gr('sendEmailToVarify.aspx?uname='+uname,'','','post', '_mi'); }; function _mi(){ alert(kh_['confirmMailSend']); noOverlay(); }; function _mj(req){ if (req.responseText == 'Your email has changed successfully. An email has been sent to your account. Please verify your account by clicking on the link provided in your email.') { noOverlay(); } alert(req.responseText); document.loginForm.Button.value = 'Go >>'; document.loginForm.Button.disabled = false; }; function _mk(req) { sessionRole = req.responseText; _mm(); }; function _ml(req) { sessionUID=req.responseText; _ob(); _bp(now._cf()); }; function _mm() { var topMenuString=''; var affiliateString='<a href="Affiliate/Campaign/Dashboard.aspx">'+kh_['Affiliate']+'</a>'; topMenuString += '<a href="javascript:void(0);" onmousedown="overlay();_mv()">' + kh_['Mashups'] + '</a>';    topMenuString+='<a href="javascript:void(0);" id="myAppLink">'+kh_['MyAppointments']+'</a> <a href="javascript:void(0);" onmousedown="_hq(430,455);_gr(\'member-update-info.aspx\',\'\',\'addE\',\'get\',\'_mw\');overlay();">'+kh_['ModifyMyInformation']+'</a> <a onmousedown="_gr(\'logout.aspx\',\'\',\'\',\'get\', \'_mr\')" href="javascript:void(0);">'+kh_['LogOut']+'</a>';        if(hz_!='') { var langOption = hz_.split('#||#'); var cultureTitleArray; var culture, countryTitle; for(var i=0;i<langOption.length-1;i++) { cultureTitle = langOption[i].split('||'); culture = ''; countryTitle = ''; if(cultureTitle[0]) culture = cultureTitle[0]; if(cultureTitle[1]) countryTitle = cultureTitle[1]; topMenuString += '<a href="ChangeLanguage.aspx?lan='+culture+'" title="'+countryTitle+'" style="padding-left: 0px; padding-right: 0px;"><img src="Images/Flags/'+culture+'.png" border="0" /></a>'; } } if(userAffiliateId!=0) { topMenuString=affiliateString + topMenuString; } $('topMenu').innerHTML =topMenuString; Behaviour.apply(); }; function _mn() { if(hz_!='') { var flagOption = ''; var langOption = hz_.split('#||#'); var cultureTitleArray; var culture, countryTitle; for(var i=0;i<langOption.length-1;i++) { cultureTitle = langOption[i].split('||'); culture = ''; countryTitle = ''; if(cultureTitle[0]) culture = cultureTitle[0]; if(cultureTitle[1]) countryTitle = cultureTitle[1]; flagOption += '<a href="ChangeLanguage.aspx?lan='+culture+'" title="'+countryTitle+'" style="padding-left: 0px; padding-right: 0px;"><img src="Images/Flags/'+culture+'.png" border="0" /></a>'; } } $('topMenu').innerHTML = '<a href="javascript:void(0);" id="myAppLink">'+kh_['MyAppointments']+'</a> <a href="javascript:void(0);" onmousedown="_hq(430,455);_gr(\'member-update-info.aspx\',\'\',\'addE\',\'get\',\'_mw\');overlay();">'+kh_['ModifyMyInformation']+'</a> <a onmousedown="_gr(\'logout.aspx\',\'\',\'\',\'get\', \'_mr\')" href="javascript:void(0);">'+kh_['LogOut']+'</a> <label id="veri"> </label>'+flagOption; new Effect.Pulsate('veri',{duration:1.0, delay: 0.1}, 3); Behaviour.apply() ; }; function _mo(originalRequest) { $('addE').innerHTML = originalRequest.responseText; var flagOption = ''; if(hz_!='') { var langOption = hz_.split('#||#'); var cultureTitleArray; var culture, countryTitle; for(var i=0;i<langOption.length-1;i++) { cultureTitle = langOption[i].split('||'); culture = ''; countryTitle = ''; if(cultureTitle[0]) culture = cultureTitle[0]; if(cultureTitle[1]) countryTitle = cultureTitle[1]; flagOption += '<a href="ChangeLanguage.aspx?lan='+culture+'" title="'+countryTitle+'" style="padding-left: 0px; padding-right: 0px;"><img src="Images/Flags/'+culture+'.png" border="0" /></a>'; } } if (gy_=='' && gz_=='') $('topMenu').innerHTML = '<a href="javascript:void(0);" onmousedown="_hq(430,455);_gr(\'member-update-info.aspx\',\'\',\'addE\',\'get\',\'_mw\');overlay();">'+kh_['ModifyMyInformation']+'</a> <a onmousedown="_gr(\'logout.aspx\',\'\',\'\',\'get\', \'_mr\')" href="javascript:void(0);">'+kh_['LogOut']+'</a>'+flagOption; else $('topMenu').innerHTML = '<a href="javascript:void(0);" onmousedown="_hq(310,250);_gr(\'verifiedCellNo.aspx?uName=' + userName + '&LoginFlag=1\',\'\',\'\',\'get\',\'_mo\');overlay();">Verify Me</a> <a href="javascript:void(0);" onmousedown="_hq(430,455);_gr(\'member-update-info.aspx\',\'\',\'addE\',\'get\',\'_mw\');overlay();">'+kh_['ModifyMyInformation']+'</a> <a onmousedown="_gr(\'logout.aspx\',\'\',\'\',\'get\', \'_mr\')" href="javascript:void(0);">'+kh_['LogOut']+'</a>'+flagOption; }; function _mp(reqAppntApproval,SMSver,userSmsVer,reqClientSmsApprv,usrName) { ha_=reqAppntApproval; hb_=SMSver; gy_=userSmsVer; gz_=reqClientSmsApprv; userName=usrName; }; function _mq() { gy_=''; gz_=''; ev_=false; var flagOption = ''; if(hz_!='') { var langOption = hz_.split('#||#'); var cultureTitleArray; var culture, countryTitle; for(var i=0;i<langOption.length-1;i++) { cultureTitle = langOption[i].split('||'); culture = ''; countryTitle = ''; if(cultureTitle[0]) culture = cultureTitle[0]; if(cultureTitle[1]) countryTitle = cultureTitle[1]; flagOption += '<a href="ChangeLanguage.aspx?lan='+culture+'" title="'+countryTitle+'" style="padding-left: 0px; padding-right: 0px;"><img src="Images/Flags/'+culture+'.png" border="0" /></a>'; } } $('topMenu').innerHTML = '<a href="javascript:void(0);" onmousedown="_hq(430,455);_gr(\'member-update-info.aspx\',\'\',\'addE\',\'get\',\'_mw\');overlay();">'+kh_['ModifyMyInformation']+'</a> <a onmousedown="_gr(\'logout.aspx\',\'\',\'\',\'get\', \'_mr\')" href="javascript:void(0);">'+kh_['LogOut']+'</a>'+flagOption+'Hi '+sessionuserFirstName+' '; }; function _mr(originalRequest) { fi_ = fj_; if(dv_!="") $('rightBr').innerHTML=dv_; if ($('user')) $('user').innerHTML = ''; var flagOption = ''; if(hz_!='') { var langOption = hz_.split('#||#'); var cultureTitleArray; var culture, countryTitle; for(var i=0;i<langOption.length-1;i++) { cultureTitle = langOption[i].split('||'); culture = ''; countryTitle = ''; if(cultureTitle[0]) culture = cultureTitle[0]; if(cultureTitle[1]) countryTitle = cultureTitle[1]; flagOption += '<a href="ChangeLanguage.aspx?lan='+culture+'" title="'+countryTitle+'" style="padding-left: 0px; padding-right: 0px;"><img src="Images/Flags/'+culture+'.png" border="0" /></a>'; } } $('topMenu').innerHTML='<a onmousedown="_hq(456,250);_ma();" href="javascript:void(0);">'+kh_['LogIn']+'</a><a href="javascript:void(0);" onmousedown="_mu();overlay();">'+kh_['NewUser']+'?</a>'+flagOption; $('topMenu').innerHTML+=''; sessionUID=""; sessionRole="";   se_.length=0; _ob(); }; function _ms() { var url = 'update-signup-action.aspx'; var pars = Form.serialize('updateForm'); var myAjax = new Ajax.Request( url, { method: 'get', parameters: pars, onSuccess: _mt, onFailure: _kb }); }; function _kb(r) {   var errStr = ''; errStr+='There was a problem in performing the operation. Please try again.\n\n'; errStr+='If the problem persists then please check your string for illegal characters or your session is still active.\n'; errStr+='If you get this error frequently then please email us at support@appointy.com\n'; alert(errStr); }; function _mt(req) { noOverlay(); }; function _mu(chk) { var chkVal; if(chk) { chkVal = parseInt(chk); } else { chkVal = 0; } _hq(530,540); familymem = 1; var url = 'LoginAndSignupDirect.aspx'; var pars ='valChk='+chkVal+'&isLogInBox=0'; var myAjax = new Ajax.Updater( 'addE', url, { method: 'post', parameters: pars, evalScripts:true, onSuccess: _mw, onFailure: _kb }); }; function _mv() { _hq(530, 540); familymem = 1; var url = 'mashupIframe.aspx'; var myAjax = new Ajax.Updater( 'addE', url, { method: 'post', evalScripts: true, onSuccess: _mw, onFailure: _kb }); }; function _mw(originalRequest) { $('addE').innerHTML = originalRequest.responseText; }; function _mx() { _gr('sign-up-action.aspx','signUpForm','','get','_my'); }; var fc_; function _my(req) { if(req.responseText!='Username Already Exists. Please, choose another username.') { alert("Congratulations! you are registered now as a user. Please check your email for the confirmation link."); if(countryCode==1) fc_=new Ajax.PeriodicalUpdater('addE', 'verifiedCellNoForUS.aspx?uName='+$('uname').value, {asynchronous:true, frequency:2}); else var ajx=new Ajax.Updater('addE', 'verifiedCellNo.aspx?uName='+$('uname').value, {method:'get'}); } else alert(req.responseText+"!"); }; function _mz(uname,comingFrom) { fc_=new Ajax.PeriodicalUpdater('addE', 'verifiedCellNoForUS.aspx?uName='+uname +'&comingFrom='+comingFrom, {asynchronous:true, frequency:2}); }; function _na(cNo,uId) { var url='checkCellphonPassword.aspx'; var par='cellPassword='+cNo+'&userName='+uId; var ajx=new Ajax.Updater( 'addE', url, { method:'post', parameters:par, onFailure: _kb }); }; function _nb() { $('esubject').value=$('services').options[$('services').selectedIndex].text; fillHidden('From'); }; function _nc(m, d, y) { var returnDate = new Date(m+'/'+d+'/'+y); return returnDate; }; function _nd(uName,ComingFrom) { var url='updateCellSmsAlert.aspx'; var par='userName='+uName + '&ComingFrom=' + ComingFrom; var ajx=new Ajax.Updater( 'addE', url, { method:'post', parameters:par, onFailure: _kb }); }; function _gu(serviceID,startTime,appApprove,oid) { if (!oid) { oid = 0; } url='sendEmailToUserAfterAppointment.aspx'; var par = 'serviceId=' + serviceID + '&startTime=' + startTime + '&appointmentApp=' + appApprove + '&orderId=' + oid; var ajx=new Ajax.Request( url, { method:'post', parameters:par, onFailure: _kb }); }; function _ne() { var aleStr=''; if($('uname').value=='') aleStr+=kh_['EmailNotValid']+'\n'; if($('passwd').value=='') aleStr+=kh_['PasswordNotValid']+'\n'; if(aleStr=='') return true; else alert(aleStr); return false; }; function _nf() { var url = 'checklogin.aspx'; var par = 'uname='+trim($('uname').value)+'&passwd='+$('passwd').value; var ajx=new Ajax.Updater( 'testaddE', url, { method:'post', parameters:par, evalScripts:true, onSuccess:_ng, onFailure: _kb }); }; function _ng(req) { if((req.responseText=='Incorrect password. Try Again.')||(req.responseText=='No user found. Try Again.')||(req.responseText=='Please Verify your Account Sign up. Check your mailbox.')) { if (req.responseText=='Please Verify your Account Sign up. Check your mailbox.') { var show = confirm( kh_['verifyConfirmBox'] ); if(show) { var unam = $('uname').value; url = "sendEmailToVarify.aspx?uname="+unam; var ajx = new Ajax.Request( url, { method: 'post', onSuccess: _mi, onFailure: _kb }); } } else { if(req.responseText=='Incorrect password. Try Again.') alert( kh_['IncorrectPass']); else alert( kh_['NoUserFound']); } } else { if(wq_) setTimeout(function(){ _gd(); },50); else _ov(); } }; function _nh() { var url = 'createIsContactNumbersVerifiedSessions.aspx'; var ajx=new Ajax.Updater( 'testaddE', url, { method:'get', evalScripts:true, onFailure: _kb }); }; function _ni() { $('subm').innerHTML = kh_['Checking']+".."; var unmForPass = $('email').value;   var errMess = ''; rxmail=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-zA-Z]{1,4}$");   if(unmForPass=='') { chkEdit = 1; errMess = kh_['enterValidEmail']; } else { if(!(rxmail.test(unmForPass))) { chkEdit = 1; errMess = kh_['enterValidEmail']; } }   if(errMess=='') { return true; } else { alert(errMess); $('subm').innerHTML = kh_['Changemypassword']; return false; } }; var lb_= "/"; var lc_=1900; var ld_=2100; function _a(s){ var i; for (i = 0; i < s.length; i++){ var c = s.charAt(i); if (((c < "0") || (c > "9"))) return false; } return true; }; function _nj(s, bag){ var i; var returnString = ""; for (i = 0; i < s.length; i++){ var c = s.charAt(i); if (bag.indexOf(c) == -1) returnString += c; } return returnString; }; function _nk (year){ return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 ); }; function _nl(n) { for (var i = 1; i <= n; i++) { this[i] = 31; if (i==4 || i==6 || i==9 || i==11) {this[i] = 30} if (i==2) {this[i] = 29} } return this; }; function _nm(dtStr){ var i_ = _nl(12); var pos1=dtStr.indexOf(lb_); var pos2=dtStr.indexOf(lb_,pos1+1); var strMonth=dtStr.substring(0,pos1); var strDay=dtStr.substring(pos1+1,pos2); var strYear=dtStr.substring(pos2+1); strYr=strYear; if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1); if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1); for (var i = 1; i <= 3; i++) { if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1); } month=parseInt(strMonth); day=parseInt(strDay); year=parseInt(strYr); if (pos1==-1 || pos2==-1){ return false; } if (strMonth.length<1 || month<1 || month>12){ return false; } if (strDay.length<1 || day<1 || day>31 || (month==2 && day>_nk(year)) || day > i_[month]){ return false; } if (strYear.length != 4 || year==0 || year<lc_ || year>ld_){ return false; } if (dtStr.indexOf(lb_,pos2+1)!=-1 || _a(_nj(dtStr, lb_))==false){ return false; } return true; }; function _nn(){ var dt=document.frmSample.txtDate; if (_nm(dt.value)==false){ dt.focus(); return false; } return true; }; function to_rfc3986 (tmp) { matchAll = new RegExp("%", 'g'); tmp = tmp.replace(matchAll,'%25'); matchAll = new RegExp('!', 'g'); tmp = tmp.replace(matchAll,'%21'); matchAll = new RegExp('"', 'g'); tmp = tmp.replace(matchAll,'%22'); matchAll = new RegExp('#', 'g'); tmp = tmp.replace(matchAll,'%23'); tmp = tmp.replace(/\$/g,'%24'); matchAll = new RegExp("&", 'g'); tmp = tmp.replace(matchAll,'%26'); matchAll = new RegExp("\'", 'g'); tmp = tmp.replace(matchAll,'%27'); tmp = tmp.replace(/\(/g,'%28'); tmp = tmp.replace(/\)/g,'%29'); tmp = tmp.replace(/\*/g,'%2A'); tmp = tmp.replace(/\+/g,'%2B'); matchAll = new RegExp(",", 'g'); tmp = tmp.replace(matchAll,'%2C'); matchAll = new RegExp("-", 'g'); tmp = tmp.replace(matchAll,'%2D'); tmp = tmp.replace(/\./g,'%2E'); matchAll = new RegExp("/", 'g'); tmp = tmp.replace(matchAll,'%2F'); matchAll = new RegExp(":", 'g'); tmp = tmp.replace(matchAll,'%3A'); matchAll = new RegExp(";", 'g'); tmp = tmp.replace(matchAll,'%3B'); matchAll = new RegExp("<", 'g'); tmp = tmp.replace(matchAll,'%3C'); matchAll = new RegExp("=", 'g'); tmp = tmp.replace(matchAll,'%3D'); matchAll = new RegExp(">", 'g'); tmp = tmp.replace(matchAll,'%3E'); tmp = tmp.replace(/\?/g,'%3F'); matchAll = new RegExp("@", 'g'); tmp = tmp.replace(matchAll,'%40'); tmp = tmp.replace(/\[/g,'%5B'); tmp = tmp.replace(/\\/g,'%5C'); tmp = tmp.replace(/\]/g,'%5D'); matchAll = new RegExp("^", 'g'); tmp = tmp.replace(/\^/g,'%5E'); matchAll = new RegExp("_", 'g'); tmp = tmp.replace(matchAll,'%5F'); matchAll = new RegExp("`", 'g'); tmp = tmp.replace(matchAll,'%60'); tmp = tmp.replace(/\{/g,'%7B'); matchAll = new RegExp("|", 'g'); tmp = tmp.replace(/\|/,'%7C'); tmp = tmp.replace(/\}/g,'%7D'); tmp = tmp.replace(/\~/g,'%7E'); return tmp; }var xdd = new Date(); var timeZonOfsetDiff = xdd.getTimezoneOffset(); var di_ = false; var dj_ = new Array(); var dk_ = new Array(); var dl_ = new Array(); var dm_ = new Array(); var dn_ = new Array(); var le_ = false; var lf_ = false; var lg_ = 0; var lh_ = 0; var li_ = 0; var lj_ = 0; var do_; var overSelectionFlag = false; var ratioOFEff = 10; function _gv(id) { if ($(id).checked == true) dl_.push($(id).value); else dl_._co($(id).value); if (er_ != 'week' && er_ != 'month') { _ev(1); _gb(0); } if (er_ == 'week') noOfDay = 7; else noOfDay = 42; for (var i = 1; i <= noOfDay; i++) { if($('availD' + i)) { $('availD' + i).style.zIndex = 0; $('availD' + i).style.display = 'none'; $('notAvailD' + i).style.display = 'none'; $('notAvailD' + i).style.zIndex = 2; $('daysAllAppointment' + i).style.zIndex = 0; $('daysAllAppointment' + i).style.display = 'none'; } } clearTimeout(do_); displayStaffNameOnselectionBox(); _ib(); do_ = setTimeout("checkTimeAndService()", 1000); }; function displayStaffNameOnselectionBox() { if (!$('choseStaffSpan')) return true; var serviceNameOnBook = new Array(); for (i = 0; i < p_.length; i++) { for (j = 0; j < dl_.length; j++) { if (dl_[j] == p_[i][0]) { var nm = p_[i][1]; serviceNameOnBook.push(nm); } } } if (dl_.length == 0) $('choseStaffSpan').innerHTML = 'Select ' + q_; else if (dl_.length == 1) $('choseStaffSpan').innerHTML = serviceNameOnBook[0]; else $('choseStaffSpan').innerHTML = dl_.length + ' Staffs Selected'; }; function _gw(id) { var selectedSS; if ($('ap_mother_left_td').style.display != 'none') selectedSS = $$('#barServicetext input'); else selectedSS = $$('#serviceListWhenNoLeftBar input'); var textStr = ''; dj_.clear(); dk_.clear(); var m = 1; hc_ = 0; for (var i = 0; i < selectedSS.length; i++) { if ($(selectedSS[i]).checked == true && $(selectedSS[i]).type == 'checkbox') { dj_.push($(selectedSS[i]).value); dk_.push($('serviceTime' + $(selectedSS[i]).value).value); hc_ += parseInt($('serviceTime' + $(selectedSS[i]).value).value); } } var selectNoOfSer = 0; if (eval(gu_)) { selectNoOfSer = 5; } if (dj_.length > selectNoOfSer) { for (var i = 0; i < selectedSS.length; i++) {   { if ($(selectedSS[i]).checked == false && $(selectedSS[i]).type == 'checkbox') $(selectedSS[i]).disabled = true; } } } else { for (var i = 0; i < selectedSS.length; i++) {   { if ($(selectedSS[i]).type == 'checkbox') $(selectedSS[i]).disabled = false; } } } if (er_ != 'week' && er_ != 'month') { _ev(1); _gb(0); } if (er_ == 'week') noOfDay = 7; else noOfDay = 42; for (var i = 1; i <= noOfDay; i++) { if($('availD' + i)) { $('availD' + i).style.zIndex = 0; $('availD' + i).style.display = 'none'; $('notAvailD' + i).style.display = 'none'; $('notAvailD' + i).style.zIndex = 2; $('daysAllAppointment' + i).style.zIndex = 0; $('daysAllAppointment' + i).style.display = 'none'; } } clearTimeout(do_);   displayServiceNameOnselectionBox(); do_ = setTimeout(function() { checkTimeAndService() }, 1000); }; function displayServiceNameOnselectionBox() { if (!$('choseServiceSpan')) return true; var serviceNameOnBook = new Array(); for (j = 0; j < dj_.length; j++) { serviceNameOnBook.push(e_['ser' + dj_[j]][1]); } if (dj_.length == 0) $('choseServiceSpan').innerHTML = 'Select ' + fx_; else if (dj_.length == 1) $('choseServiceSpan').innerHTML = serviceNameOnBook[0]; else $('choseServiceSpan').innerHTML = dj_.length + ' Services Selected'; }; function _no() { var table = ''; table += '<table width="100%" border="0" cellspacing="0" class="appointBoxTable" cellpadding="0">'; var selCat = $('categorySelArea').getElementsByTagName('input'); var m = 0; for (j = 0; j < selCat.length; j++) { if (selCat[j].checked) { var selcatServ = new Array(); selcatServ = ip_[selCat[j].value]; table += '<tr class="catHeader">'; table += '<td colspan="4">' + selcatServ[0][6] + '</td>'; table += '</tr>'; for (i = 0; i < selcatServ.length; i++) { if (selcatServ[i][5] == 'False') { if (m == 1) { m = 0; table += '<tr class="upperTd srTxSd" id="srTxSd' + i + '">'; } else { m = 1; table += ' <tr class="lowerTd srTxSd" id="srTxSd' + i + '">'; } if (ez_ == 1) { fl_ = true; } var classOnServiceAndStaff = "serviceNDCNotBold"; if (eval(fl_)) { classOnServiceAndStaff = "serviceNDCBold"; } else { classOnServiceAndStaff = "serviceNDCNotBold"; } table += '<td '; if (ez_ != 1) table += 'width="13">'; else table += 'width="1">'; table += '<input type="checkbox" name="checkbox" id="serviceCheck' + selcatServ[i][0] + '" value="' + selcatServ[i][0] + '" />'; table += '<input type="hidden" name="' + selcatServ[i][0] + '" id="serviceName' + selcatServ[i][0] + '" value="' + selcatServ[i][1] + '" /> <input type="hidden" name=serviceTime"' + selcatServ[i][0] + '" id="serviceTime' + selcatServ[i][0] + '" value="' + selcatServ[i][2] + '" /> </td>'; table += '<td class="' + classOnServiceAndStaff + '" ><a id="ld' + selcatServ[i][0] + '" style="cursor:pointer">' + selcatServ[i][1] + '</a></td>'; table += '<td width="20" class="' + classOnServiceAndStaff + '"><span id="serviceTimeTd' + i + '">' + selcatServ[i][2] + '�</span></td>'; table += '<td width="20" class="' + classOnServiceAndStaff + '"><span id="serviceCostTd' + i + '">' + selcatServ[i][3] + '</span></td>'; table += '</tr>'; if (ez_ == 1) { if (m == 0) { table += '<tr class="upperTdOtherText">'; } else { table += ' <tr class="lowerTdOtherText">'; } table += '<td'; if (ez_ != 1) table += ' width="13">'; else table += ' width="1">'; table += '</td><td colspan="3" class="serviceDesc">' + selcatServ[i][4] + '</td>'; table += '</tr>'; } } } } } table += ' </table>'; $('barServicetext').innerHTML = table; }; function _np() { if ($('left_category_selectionBody').style.display != 'none') { $('left_category_selectionBody').style.display = 'none'; } else { $('left_category_selectionBody').style.display = 'block'; } }; function _nq(moveDiv) { var leftpos = 0; var toppos = 0; aTag = moveDiv; do { aTag = aTag.offsetParent; leftpos += aTag.offsetLeft; toppos += aTag.offsetTop; if (aTag.offsetParent == null) break; } while (aTag.tagName != "BODY"); $('SelectionContainer').style.left = moveDiv.offsetLeft + leftpos + 'px'; $('SelectionContainer').style.top = moveDiv.offsetTop + toppos + moveDiv.offsetHeight + 'px'; $('SelectionContainer').style.display = 'block'; var serviceText = ''; serviceText += '<table width="250" border="0" cellspacing="0" cellpadding="0">'; serviceText += ' <tr>'; serviceText += ' <td>&nbsp;</td>'; serviceText += ' <td>Service</td>'; serviceText += ' <td>Time</td>'; serviceText += ' <td>Cost</td>'; serviceText += ' </tr>'; var m = 1; for (i in e_) { if (e_[i][5] == 'False') { if (m == 1) { m = 0; serviceText += '<tr class="upperTd">'; } else { m = 1; serviceText += ' <tr class="lowerTd">'; } if (ez_ == 1) { fl_ = true; } if (eval(fl_)) { var classOnServiceAndStaff = "serviceNDCBold"; } else { var classOnServiceAndStaff = "serviceNDCNotBold"; } serviceText += ' <td>'; serviceText += ' <input type="checkbox" name="checkbox" id="serviceCheck' + e_[i][0] + '" value="' + e_[i][0] + '" onClick="_gw(this);" />'; serviceText += ' <input type="hidden" name="' + e_[i][0] + '" id="serviceName' + e_[i][0] + '" value="' + e_[i][1] + '" /> <input type="hidden" name=serviceTime"' + e_[i][0] + '" id="serviceTime' + e_[i][0] + '" value="' + e_[i][2] + '" />'; serviceText += ' </td>'; serviceText += ' <td>' + e_[i][1] + '</td>'; serviceText += ' <td>' + e_[i][2] + '</td>'; serviceText += ' <td>' + e_[i][3] + '</td>'; serviceText += ' </tr>'; if (eval(fl_)) { if (m == 0) serviceText += '<tr class="upperTdOtherText">'; else serviceText += ' <tr class="lowerTdOtherText">'; serviceText += '<td colspan="4" class="serviceDesc">' + e_[i][4] + '</td>'; serviceText += '</tr>'; } } } serviceText += '</table>'; $('SelectionText').innerHTML = serviceText; for (var i = 0; i < dj_.length; i++) { $('serviceCheck' + dj_[i]).checked = true; } lg_ = $('SelectionContainer').offsetTop - moveDiv.offsetHeight; lh_ = moveDiv.offsetLeft + leftpos; li_ = $('SelectionContainer').offsetWidth; lj_ = $('SelectionContainer').offsetHeight + moveDiv.offsetHeight; lf_ = true; }; function _nr() { document.onmousemove = _ns; }; function _ns(e) { if (lf_) { curevent = (typeof event == 'undefined' ? e : event); if (curevent.clientX < lh_ || curevent.clientX > lh_ + li_ || curevent.clientY < lg_ || curevent.clientY > lg_ + lj_) { $('SelectionContainer').style.display = 'none'; if (le_) checkTimeAndService(); le_ = false; lf_ = false; } } }; function _gy() { dn_.clear(); var anyAvail = false; if (($('appointTime').value != 'Select Time')) { startAllServiceArray = (dj_.toString()).split(',');   startAllTimeArray = (dk_.toString()).split(',');   dm_.clear(); if (er_ == 'week') noOfDay = 7; else noOfDay = 42; kl_ = new Date(km_); for (var i = 1; i <= noOfDay; i++) { cw_ = kl_.getDate(); cx_ = kl_.getMonth(); cy_ = kl_.getFullYear(); cr_ = cx_ + 1 + '/' + cw_ + '/' + cy_; var newtDate = cr_ + ' ' + $('appointTime').value; var tempdate = new Date(newtDate); tempdate.setHours(tempdate.getHours() - parseInt(kq_)); cs_ = tempdate.getDay(); hj_ = new Date(tempdate); jt_.clear(); ju_.clear(); jv_.clear(); jx_.clear(); jw_.clear(); jn_ = (dj_.toString()).split(','); $('availD' + i).style.zIndex = 0; $('availD' + i).style.display = 'none'; $('notAvailD' + i).style.zIndex = 0; $('notAvailD' + i).style.display = 'none'; $('daysAllAppointment' + i).style.zIndex = 0; $('daysAllAppointment' + i).style.display = 'none'; var asd = _bb(); if (asd) { anyAvail = true; dm_.push((i)); $('availD' + i).style.display = 'block'; $('availD' + i).style.zIndex = 2; $(tempdate.getMonth() + 1 + 'd' + tempdate.getDate()).style.zIndex = 1; dn_.push('availD' + i); } else { dm_.push((i)); $('notAvailD' + i).style.display = 'block'; $('notAvailD' + i).style.zIndex = 2; $(tempdate.getMonth() + 1 + 'd' + tempdate.getDate()).style.zIndex = 1; } kl_.setDate(kl_.getDate() + 1); } } if (er_ == 'week') if (anyAvail) _ex(iu_['slotAvailableInWeek']); else if (dl_.length == 0) if (kx_) _ex(iu_['noSlotAvailableInSelectedTimeInWeekLast']); else _ex(iu_['noSlotAvailableInSelectedTimeInWeek']); else if (kx_) _ex(iu_['noSlotAvailableInSelectedTimeInWeekStaffSelectedLast']); else _ex(iu_['noSlotAvailableInSelectedTimeInWeekStaffSelected']); else if (anyAvail) _ex(iu_['slotAvailableInMonth']); else if (dl_.length == 0) if (kx_) _ex(iu_['noSlotAvailableInSelectedTimeInMonthLast']); else _ex(iu_['noSlotAvailableInSelectedTimeInMonth']); else if (kx_) _ex(iu_['noSlotAvailableInSelectedTimeInMonthStaffSelectedLast']); else _ex(iu_['noSlotAvailableInSelectedTimeInMonthStaffSelected']); $("seachGif").style.display = "none"; _gj(ei_); di_ = true; }; var dp_ = new String(); var dq_; var yu_=false; function _gf(i, m, y) { var cn_ = new Date(eval(m + 1) + '/' + eval(i) + '/' + eval(y)); var appAllowedDate = new Date(DateBeforAppCanBook); if (cn_ < appAllowedDate) { _hq(600, 350); overlay(); _by(i, eval(m + 1)); cw_ = i; cx_ = m; cy_ = y; cr_ = cx_ + 1 + '/' + cw_ + '/' + cy_; var newtDate = cr_ + ' ' + $('appointTime').value; var tempdate = new Date(newtDate); cs_ = tempdate.getDay(); _hu(cr_); hj_ = new Date(tempdate); jt_.clear(); ju_.clear(); jv_.clear(); jx_.clear(); jw_.clear(); jn_ = (dj_.toString()).split(','); var asd = _bb(); if (asd || yu_) { var sendTime = new Array(); for (var j = 0; j < jw_.length; j++) { var changD = new Date(jw_[j]); sendTime.push(changD._cn()); } var serviceNameOnBook = new Array(); var serviceCostOnBook = new Array(); for (j = 0; j < jt_.length; j++) { var nm = e_['ser' + jt_[j]][1]; nm = nm.replace(/,/g, "~~>"); serviceNameOnBook.push(nm); serviceCostOnBook.push(e_['ser' + jt_[j]][3]); } dp_ = cr_; if(wr_) { ws_.push(new Array(jt_ , ju_, sendTime, dp_ , serviceNameOnBook , serviceCostOnBook , urlDisC_xh)); var url = 'checkAvalableAppointmentForRecuring.aspx'; } else { var url = 'checkAvalableAppointment.aspx'; } par = 'apointmentText=' + jt_ + '&staffId=' + ju_ + '&startTime=' + sendTime + '&currentDate=' + dp_ + '&serviceNameOnBook=' + serviceNameOnBook + '&serviceCostOnBook=' + serviceCostOnBook + '&urlDisC=' + urlDisC_xh+'&gIsReturnVAlFromInsertPage='+yu_; yu_=false; dq_ = i; var ajx = new Ajax.Updater( 'addE', url, { method: 'post', parameters: par, evalScripts: true, onComplete:function(r){if (r.responseText == 'login'){ $('addE').innerHTML=''; _oe();}}, onFailure: _kb } ); } else { alert("Sorry.\n Someone else booked this time while you were selecting time slot. Go back and check other time.");         noOverlay(); do_ = setTimeout("checkTimeAndService()", 50); $('addEBody').style.display = 'none'; } } else { _hq(250, 80); overlay(); $('addE').innerHTML = $('appNotAll').innerHTML; $('addEBody').style.display = 'block'; } }; function _nt(req) { if (req.responseText == 'login') { _oe(); } }; function _gz(req) { _hq(456, 250); overlay(); $('addE').innerHTML = req.responseText; }; function _jy(d) { overlay(); ct_=dl_.toString(); ct_=ct_.split(','); if(dl_.length==0) { ct_.pop(); for(var l=0;l<p_.length;l++) { if(p_[l][2]=='False') ct_.push(p_[l][0]); } } cu_=ct_.length; cv_=dj_.length; var givenStartT=''; var givenEndT=''; var givenStartD=''; var givenEndD=''; var tval=$('appointTime').value; givenStartT=hp_; givenEndT=hq_; var tDate = new Date(d); cw_ = tDate.getDate(); cx_ = tDate.getMonth(); cy_ = tDate.getFullYear(); cr_=cx_+1+'/'+cw_+'/'+cy_; var cn_ = new Date(tDate); cs_=cn_.getDay(); var appAllowedDate = new Date(DateBeforAppCanBook); if(cn_<appAllowedDate) { _hq(610,360); _by(cw_,cx_+1); var newtDate = cr_; var tempStartT=' 23:59:00'; var tempEndT=' 00:00:00'; var tempSDate=Date.parse(newtDate+tempStartT); var tempEDate=Date.parse(newtDate+tempEndT); var s=0; var divid=96; for(var k=0;k<cv_;k++) { for(l=0;l<cu_;l++) { para=cs_+'/'+ct_[l]+'/'+dj_[k]; if(typeof(kb_[para])!='undefined') { var ssdArr=kb_[para]; var m=ssdArr.length; do { var comST= Date.parse(newtDate+' '+ssdArr[m-1][3]); var comET= Date.parse(newtDate+' '+ssdArr[m-1][4]); if(comST<tempSDate) { tempSDate=comST; tempStartT=ssdArr[m-1][3]; } if(comET>tempEDate) { tempEDate=comET; tempEndT=ssdArr[m-1][4]; } }while(--m); } } } givenStartD=Date.parse(newtDate+' '+givenStartT); givenEndD=Date.parse(newtDate+' '+givenEndT); tempEDate=tempEDate-(hc_*60*1000); if(givenStartD<tempSDate) givenStartT=tempStartT; if(givenEndD>tempEDate) givenEndT=tempEndT; searchStartTime=new Date(newtDate+' '+givenStartT); searchEndTime=new Date(newtDate+' '+givenEndT); if(givenEndD>tempEDate) searchEndTime.setMinutes(searchEndTime.getMinutes()-hc_); var allAvailableTimeslot=new Array(); startAllServiceArray=(dj_.toString()).split(',');   startAllTimeArray=(dk_.toString()).split(','); var pqr=searchStartTime.getMinutes(); var isAppAvail= true; for(var i=0;i<divid;i++) { hj_ = new Date(d); hj_.setMinutes(searchStartTime.getMinutes()); hj_.setSeconds(searchStartTime.getSeconds()); hj_.setHours(searchStartTime.getHours()); hj_.setMinutes(pqr); if(hj_>searchEndTime) break; jt_.clear(); ju_.clear(); jv_.clear(); jx_.clear(); jw_.clear(); jn_=(dj_.toString()).split(','); _bc(jn_); var asd=_bb(); hj_.setMinutes(searchStartTime.getMinutes()); hj_.setSeconds(searchStartTime.getSeconds()); hj_.setHours(searchStartTime.getHours()); hj_.setMinutes(pqr); if(asd) { allAvailableTimeslot.push(hj_._cn()+'||1'); isAppAvail=true; } else { if(sr_) allAvailableTimeslot.push(hj_._cn()+'||0'); isAppAvail=false; } if(isAppAvail || timeDifferenceOfSlot<15 || autoSearchUnavailableTimes_xh) s+=timeDifferenceOfSlot; else s+=15; pqr=searchStartTime.getMinutes()+s; } var url='checkAvalableAppointmentforDay.aspx'; var par ='allAvailableTimeslot='+allAvailableTimeslot+'&serviceDate='+newtDate; dq_=i; var ajx=new Ajax.Updater( 'addE', url, { method:'get', parameters:par, evalScripts:true, onFailure: _kb } ); } else { _hq(250,80); $('addE').innerHTML = $('appNotAll').innerHTML; $('addEBody').style.display = 'block'; } }; function _ka(d) { d = new Date(d); tt = _x(d, true); var tempT = $('appointTime').value; $('appointTime').value = tt; noOverlay(); _gf(parseInt(d.getDate()), d.getMonth(), d.getFullYear()); $('appointTime').value = tempT; }; function _ha(req) { if (req.responseText == 'login') { _oe(); } else { $("addE").innerHTML = req.responseText; } }; function _nu() { document.payp.submit(); }; function _nv() { if ($('userPayLater').checked) { if ($('paymentType') || $('paymentType2')) { payradio = document.getElementsByName("PPmodule"); for (var i = 0; i < payradio.length; i++) { if (payradio[i].checked) payradio[i].checked = false; } } } else { payradio = document.getElementsByName("PPmodule"); payradio[0].checked = true; } } function _nw() { if ($('userPayLater')) { $('userPayLater').checked = false; } } 

var lk_; 
function _hb() { 
	//Code for terms and condition
    if($('termAndCondition'))
    {
        if(!($('termAndCondition').checked))
        {
            $('termConditionMess').className = 'termConditionErr';
            return false;
        }
    }
var customField = $$(".custominput"); var appComment = '';   var optField; var comQu = AliasForEtcInfoString_xh.split("#||#"); for (var i = 0, j = 0; i <= comQu.length - 1 && j < customField.length; i++) { optField = comQu[i].split('#||||#'); comQuString = optField[0].split('||');   if (comQuString.length > 1 && comQuString[1] != 'note' && comQuString[0] != '') { if(comQuString[1]=='r') { if(optField.length>1) { for(var k=1;k<optField.length;k++) { if(customField[j].checked) appComment += encodeURIComponent(comQuString[0]) + ' - ' + encodeURIComponent(customField[j].value) + '#||#'; j++; } } } else if(comQuString[1]=='c') { if(customField[j].checked) appComment += encodeURIComponent(comQuString[0]) + ' - Yes#||#'; else appComment += encodeURIComponent(comQuString[0]) + ' - No#||#'; j++; } else { appComment += encodeURIComponent(comQuString[0]) + ' - ' + encodeURIComponent(customField[j].value) + '#||#'; j++; } } } if (!_ti('appCommentSPAN', 'left')) return true; if (eval(go_)) { if ((appComment == '') || (appComment == gn_)) { $('etcInfoReq').style.display = 'block'; return false; } } var totSerCost = document.getElementById("totalServiceCost").value; var insertStartTime = new Array(); for (var i = 0; i < jw_.length; i++) { var newDate = new Date(jw_[i]); insertStartTime.push((newDate.getMonth() + 1) + '/' + newDate.getDate() + '/' + newDate.getFullYear() + ' ' + newDate.getHours() + ':' + newDate.getMinutes() + ':' + newDate.getSeconds()); } var payWith = ""; if (($('paymentType') || $('paymentType2'))) { payradio = document.getElementsByName("PPmodule"); for (var i = 0; i < payradio.length; i++) { if (payradio[i].checked) { payWith = payradio[i].value; } } if ($('userPayLater')) { if (!($('userPayLater').checked)) { if (payWith == "") { alert('Select Payment Type'); return false; } } } else { if (payWith == "") { alert('Select Payment Type'); return false; } } } var chkUserPayLater, payLaterOrNow; if ($('userPayLater')) { chkUserPayLater = 1; if ($('userPayLater').checked) { payLaterOrNow = 1; } else { payLaterOrNow = 0; } } else { chkUserPayLater = 0; } _hq(650, 378); var url = 'insertAvailableAppointment.aspx'; var par = 'serviceId=' + jt_ + '&staffId=' + ju_ + '&startTime=' + insertStartTime + '&appointmentDate=' + dp_ + '&appComm=' + appComment + '&payWith=' + payWith + '&chkUserPayLaterInput=' + chkUserPayLater + '&payLaterOrNowCon=' + payLaterOrNow + '&totalServiceCost=' + totSerCost; lk_ = par;   var ajx = new Ajax.Updater( 'testaddE', url, { methd: 'post', evalScripts: true, parameters: par, onSuccess: _ha, onFailure: _kb } ); }; function _he() { noOverlay(); wt_.length=0; }; function _hf() { if (er_ == 'week') noOfDay = 7; else noOfDay = 42; noOverlay(); for (var i = 1; i <= noOfDay; i++) { $('availD' + i).style.zIndex = 0; $('availD' + i).style.display = 'none'; $('notAvailD' + i).style.display = 'none'; $('notAvailD' + i).style.zIndex = 2; $('daysAllAppointment' + i).style.zIndex = 0; $('daysAllAppointment' + i).style.display = 'none'; } }; function _hg() { if ($('appointTime')) $('appointTime').value = kh_['FullDay']; var ch = document.getElementsByTagName('input'); for (var i = 0; i < ch.length; i++) { $(ch[i]).checked = false; $(ch[i]).disabled = false; } dj_.clear(); dl_.clear(); if (fa_ == 1) { ks_ = false; } if (ez_ == 1) { var selectedSS; if ($('ap_mother_left_td').style.display != 'none') selectedSS = $$('#barServicetext input'); else selectedSS = $$('#serviceListWhenNoLeftBar input'); for (var i = 0; i < selectedSS.length; i++) { if ($(selectedSS[i]).type == 'checkbox') { $(selectedSS[i]).checked = true; $(selectedSS[i]).style.display = 'none'; dj_.push($(selectedSS[i]).value); dk_.push($('serviceTime' + $(selectedSS[i]).value).value); clearTimeout(do_); do_ = setTimeout("checkTimeAndService()", 200); } } } }; var ds_; function _hh(id, inDiv) { var arrA = $(inDiv).getElementsByTagName("div"); for (var i = 0; i < arrA.length; i++) if ($(arrA[i]).className == 'beforeClick') $(arrA[i]).className = 'afterClick'; $(id).className = 'beforeClick'; ds_ = $(id).className; }; function _hi(id) { ds_ = $(id).className; $(id).className = 'beforeClick'; }; function _hj(id) { $(id).className = ds_; }; var dt_ = ""; function _hk() { if (dt_ != "") { $('changeContainer').innerHTML = dt_; } }; var du_ = ''; function _hl() { var url = "photoGallery.aspx"; var ajx = new Ajax.Updater( 'photoGalleryOnStaffDetailNGallery', url, { method: 'get', evalScripts: true, onFailure: _kb }); }; function _nx() { var url = 'photoGalleryShow.aspx'; var ajx = new Ajax.Updater( 'onloadImageGallery', url, { method: 'get', evalScripts: true, onFailure: _kb }); }; function _ny() { document.getElementById("settingWizard").style.display = 'none'; $('leftBar').innerHTML = pp_; _hw(); _hs(); noOverlayWizard(); parent.frames['wizardiframe'].location = 'shopDetail.aspx'; }; function _hm() { if (dt_ == "") { dt_ = $('changeContainer').innerHTML; } var url = "shopDetail.aspx"; var ajx = new Ajax.Updater( 'changeContainer', url, { method: 'get', evalScripts: true, onSuccess: _ho, onFailure: _kb }); }; var dv_ = ''; function _hn(req) { du_ = req.responseText; $('photoGalleryDiv').style.height = $("rightBr").offsetHeight - 30; }; function _ho(req) { $('detailDiv').style.height = $("rightBr").offsetHeight - 30; }; function _hq(w, h) { $('addE').style.width = 300 + 'px'; $('addE').style.height = 150 + 'px'; $('addEBody').style.left = ae_[2] / 2 - 150 + 'px'; $('addEBody').style.top = ae_[3] / 2 - 75 + 'px';             $("addE").innerHTML = '<table width="' + 300 + '" height="' + 150 + '" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="center" valign="middle">Loading... <img src="images/indicator_flower.gif"></td> </tr></table>'; }; function _hr() { $('addEBody').style.marginLeft = -$('addEBody').offsetWidth / 2; }; function sortMultiDimensional(a,b) { return a[0] - b[0]; }; function _hu(d) { var yv_=new Array(); for (i = 0; i < p_.length; i++) { if(typeof(jg_[d+'/'+p_[i][0]])!='undefined') { var stDateAp=jg_[d+'/'+p_[i][0]]; var j=stDateAp.length; var totMs=0; for(var k=0;k<j;k++) { var testStartTime=Date.parse(stDateAp[k][0]); var testEndTime=Date.parse(stDateAp[k][1]); totMs+=testEndTime-testStartTime; } yv_.push(new Array(totMs,p_[i][0])); } else yv_.push(new Array(0,p_[i][0])); } yv_.sort(sortMultiDimensional); var yw_=new Array(); for (i = 0; i < yv_.length; i++) { yw_.push(yv_[i][1]); }   _hv(yw_);            }; function _hv(arr) { var tempFill = new Array(); var tempFill2 = new Array(); for (k in it_) { if (typeof (it_[k]) == 'object') { tempFill.clear(); tempFill2.clear(); for (var i = 0; i < arr.length; i++) { if (it_[k]._cp(arr[i], false)) tempFill.push(arr[i]); } for (var j = 0; j < it_[k].length; j++) { if (!(tempFill._cp(it_[k][j], false))) tempFill2.push(it_[k][j]); } tempFill2 = tempFill2.concat(tempFill); it_[k] = (tempFill2.toString()).split(","); } } }; function _hw() { $('leftBar').style.display = 'block'; $('rightBar').style.width = 69 + '%'; _bp(now._cf()); }; function _hz() { if (dt_ != "") { $('changeContainer').innerHTML = dt_; } dt_ = ""; var arrA = $('upperTab').getElementsByTagName("li"); for (var i = 0; i < arrA.length; i++) { $(arrA[i]).className = 'afterClick'; } $('leftStaffLi').className = 'beforeClick'; ds_ = $('leftStaffLi').className; }; function _nz() { $('myframe').style.height = 300 + 'px'; $('addEBody').style.marginTop = -300 / 2; }; function _oa() { var datePar = paraCalDate.getMonth() + 1 + '/' + paraCalDate.getDate() + '/' + paraCalDate.getFullYear(); var url = 'getUserAppintment.aspx'; var par = 'currentdate=' + datePar; var ajx = new Ajax.Updater( 'testaddE', url, { method: 'post', parameters: par, evalScripts: true, onFailure: _kb }); }; function _ob() { var showInBox; if (er_ == 'week') noOfDay = 7; else noOfDay = 42; kl_ = new Date(km_); for (i = 1; i <= noOfDay; i++) { var tDay = kl_.getDate(); var tMon = kl_.getMonth() + 1; if (!$(tMon + "app" + tDay)) return false; $(tMon + "app" + tDay).innerHTML = ''; kl_.setDate(kl_.getDate() + 1); } kl_ = new Date(km_); for (i = 1; i <= noOfDay; i++) { tDay = kl_.getDate(); tMon = kl_.getMonth() + 1; tYear = kl_.getFullYear(); var searchPath = tMon + '/' + tDay + '/' + tYear;   if (typeof (iy_[searchPath + '/' + sessionUID]) != 'undefined') { var appArr = iy_[searchPath + '/' + sessionUID]; if (appArr.length > 0) $(tMon + "app" + tDay).innerHTML += '<img src="images/redpopup.png" onmousedown="_oc(\'' + searchPath + '/' + sessionUID + '\',\'' + tMon + "dh" + tDay + '\',\'' + kl_ + '\')" />'; } kl_.setDate(kl_.getDate() + 1); } }; function _oc(path, id, dt) { if (typeof (iy_[path]) != 'undefined') { var appArr = iy_[path]; var appDayText = ''; dt = new Date(dt); var hd = g_[dt.getMonth()] + ' ' + dt.getDate() + ' <span class="dayWeekDay"> (' + k_[dt.getDay()] + ')</span>'; appDayText += '<table width="100%" border="0" cellspacing="0" cellpadding="0">'; appDayText += '<tr>'; appDayText += '<td class="dayHead">' + hd; appDayText += '</td>'; appDayText += '<td class="dayHead">'; appDayText += '</td>'; appDayText += '<td class="dayHead"><img onclick="_od()" style="margin: 2px 2px 0pt 0pt; float: right; cursor: pointer;" src="images/close.gif"/>'; appDayText += '</td>'; appDayText += '</tr>'; for (var i = 0; i < appArr.length; i++) { appDayText += '<tr>'; appDayText += '<td width="50%" class="daySerName">'; appDayText += appArr[i][2]; appDayText += '</td>'; appDayText += '<td class="daySerTime">::'; appDayText += setTimeOverNight_xh(appArr[i][3]); appDayText += ' '; appDayText += 'To '; appDayText += setTimeOverNight_xh(appArr[i][4]); appDayText += '</td>'; appDayText += '<td class="daySerTime">'; if (appArr[i][5] == 'True') appDayText += '<img src="Images/temporary.png" title="Temporary booking. It will be removed after 5 minutes." /> '; if (appArr[i][6] == 'true') appDayText += '<img src="Images/paid.png" title="Paid" /> '; appDayText += '</td>'; appDayText += '</tr>'; appDayText += '</tr>'; } appDayText += '</table>'; var leftpos = 0; var toppos = 0; aTag = $(id); do { aTag = aTag.offsetParent; leftpos += aTag.offsetLeft; toppos += aTag.offsetTop; if (aTag.offsetParent == null) break; } while (aTag.tagName != "BODY"); $('myappointmentday').innerHTML = appDayText; $('myappointmentday').style.display = 'block'; var overLeft = 0; if (ae_[2] < ($(id).offsetLeft + leftpos + $('myappointmentday').offsetWidth)) overLeft = 5 + ($(id).offsetLeft + leftpos + $('myappointmentday').offsetWidth) - ae_[2]; var overTop = 0; if ((ae_[3] + document.body.scrollTop) < ($(id).offsetTop + toppos + $('myappointmentday').offsetHeight)) overTop = 5 + ($(id).offsetTop + toppos + $('myappointmentday').offsetHeight) - (ae_[3] + document.body.scrollTop); $('myappointmentday').style.left = $(id).offsetLeft + leftpos - overLeft + 'px'; $('myappointmentday').style.top = $(id).offsetTop + toppos - overTop + 'px';   } }; function _od() { $('myappointmentday').style.display = 'none'; }; function _kf(id) { var tmp = new Image; tmp.src = 'AppointyImages/' + appointyIdSession + '/staffImages/' + p_[id][0] + '.jpg'; if (tmp.complete) { $('framDetail').innerHTML = '<table width="100%" border="0" cellspacing="0" cellpadding="0" > <tr> <th>&nbsp;<img src="AppointyImages/' + appointyIdSession + '/staffImages/' + p_[id][0] + '.jpg" width="40" height="40" /></th> <th>' + p_[id][1] + '</th><th align="right" valign="top"><img src="images/buttonClose1.gif" onclick="_kg();" width="17" height="17" /></th> </tr> <tr> <td colspan="3" align="center"><table width="90%" align="center" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="tl"></td> <td class="tr"></td> </tr> <tr> <td class="bl">' + p_[id][3] + '</td> <td class="br" ></td> </tr></table></td> </tr></table>'; } else { $('framDetail').innerHTML = '<table width="100%" border="0" cellspacing="0" cellpadding="0" > <tr> <td>&nbsp;<img src="images/staffImg/default_large.png" width="40" height="40" valign="top"/></td> <td>' + p_[id][1] + '</td><td align="right"><img src="images/buttonClose1.gif" onclick="_kg();" width="17" height="17" /></td> </tr> <tr> <td colspan="3" align="center"><table width="90%" border="0" cellspacing="0" align="center" cellpadding="0"> <tr> <td class="tl"></td> <td class="tr" ></td> </tr> <tr> <td class="bl" >' + p_[id][3] + '</td> <td class="br" ></td> </tr></table></td> </tr></table>'; } var leftpos = 0; var toppos = 0; aTag = $('staffDT' + p_[id][0]); do { aTag = aTag.offsetParent; leftpos += aTag.offsetLeft; toppos += aTag.offsetTop; if (aTag.offsetParent == null) break; } while (aTag.tagName != "BODY"); $('staffServiceDetail').style.display = 'block'; $('staffServiceDetail').style.left = $('staffDT' + p_[id][0]).offsetLeft + leftpos + 2 + $('staffDT' + p_[id][0]).offsetWidth + 'px'; $('staffServiceDetail').style.top = $('staffDT' + p_[id][0]).offsetTop + toppos + ($('staffDT' + p_[id][0]).offsetHeight / 2) - 15 + 'px'; }; function _kg() { $('staffServiceDetail').style.display = 'none'; }; var ll_ = false; function _ib() { var leftpos = 0; var toppos = 0; var tFlag = true; serFlag = true, stFlag = true; var followDiv; if ($('leftBarHelp').innerHTML == 'Select Time') { tFlag = false; followDiv = 'barTime'; $('leftBarHelp').innerHTML = 'Select Time'; } if (dj_.length == 0 && tFlag) { serFlag = false; followDiv = 'barService'; $('leftBarHelp').innerHTML = kh_['Select'] + ' ' + fx_ + '(s) ' + kh_['memberHelpArr20']; } if (ks_ && eval(ff_) && serFlag && tFlag && dl_.length < 1 && fa_ != 1) { followDiv = 'staffSelectionBody'; serFlag = false; $('leftBarHelp').innerHTML = kh_['Select'] + ' ' + q_ + '(s) ' + kh_['memberHelpArr20']; } if ($(followDiv) && fi_) { aTag = $(followDiv); do { aTag = aTag.offsetParent; leftpos += aTag.offsetLeft; toppos += aTag.offsetTop; if (aTag.offsetParent == null) break; } while (aTag.tagName != "BODY"); $('helpContainer').style.left = $(followDiv).offsetLeft + $(followDiv).offsetWidth + leftpos + 'px'; $('helpContainer').style.top = $(followDiv).offsetTop + toppos + ($(followDiv).offsetHeight / 2) - 32 + 'px'; $('helpContainer').style.display = 'block'; } else { $('helpContainer').style.display = 'none'; } document.onmousedown = _j; ll_ = true; }; function _j() { if (ll_) $('helpContainer').style.display = 'none'; ll_ = false; }; function _oe() { var url = 'loginAndSignupScreen.aspx'; var ajx = new Ajax.Request ( url, { method: 'post', evalScripts: true, onSuccess: _of, onFailure: _kb }); }; function _c(countryID, regionID) { var rId = 0; if (regionID) { rId = regionID; } if ($('regionddl')) { $('regionddl').options[$('regionddl').selectedIndex].text = '--Loading--'; $('regionddl').className = 'dropDownLoading'; } var url = "fillRegion.aspx?cId=" + countryID + "&rIndex=" + rId; var ajx = new Ajax.Updater( 'RegionSelectBox', url, { method: 'get', evalScripts: true }); }; function _d(RegionID, cityId) { var cId = 0; if (cityId) { cId = cityId; } if ($('cityddl')) { $('cityddl').options[$('cityddl').selectedIndex].text = '--Loading--'; $('cityddl').className = 'dropDownLoading'; } var url = "fillCity.aspx?rId=" + RegionID + "&cIndex=" + cId; var ajx = new Ajax.Updater( 'CitySelectBox', url, { method: 'get', evalScripts: true }); } function _of(req) { document.getElementById("addE").innerHTML = req.responseText; if (hy_.indexOf('Location#||#') == -1) { $('chkLocation').style.display = 'none'; } if (hy_.indexOf('Zip#||#') == -1) { $('chkZipShow').style.display = 'none'; } if (hy_.indexOf('Address#||#') == -1) { $('chkAddShow').style.display = 'none'; } if (fu_ == 'False') { $('CountryDdl').disabled = 'disabled'; } if (!ib_) { initSignupEff(0); $('LoginEffTd').className = ''; $('uname').focus(); } else { initSignupEff(1); $('SignupEffTd').className = ''; $('fname').focus(); } _gj(ky_); $('loginOnInsertApp').value = kh_['LogInBook']; $('saveBtn').value = kh_['RegisterBook']; _c(gx_, gw_); var couDDVal = $('CountryDdl').options[$('CountryDdl').selectedIndex].value; _oh(couDDVal); _iq(); }; var lm_; function _rc(val) { if (val == 1) { lm_ = 1; } else if (val == 2) { lm_ = 0; } }; function _og(id1, errSpanId) { if ($(id1).type == 'password') { var str1; str1 = $(id1).value; if (str1 == '') { $(errSpanId).innerHTML = kh_['cannotbeblank']; } else if (str1 != '') { $(errSpanId).innerHTML = ''; if (str1.length < 6) { $(errSpanId).innerHTML = kh_['atleast6digit']; } else { $(errSpanId).innerHTML = ''; } } } }; var ln_ = "-1"; var lo_; var lp_ = ''; function _oh(val) { tmpCntryData = new Array(); if (val != -1) { $('cntryErrddl').innerHTML = ''; } if (val != '') { tmpCntryData = val.split(","); } ln_ = tmpCntryData[0]; $("ziptxt").maxLength = tmpCntryData[1];   if (tmpCntryData[2] == 'True') { lo_ = /[0-9a-zA-Z\s]/; lp_ = kh_['zipShouldAlphaNumeric']; } else { lo_ = /^\d+$/; lp_ = kh_['zipShouldNumeric']; } _qx(ln_); }; function _e() { if ($('cityddl').value != -1) { $('cityErrddl').innerHTML = ""; } }; function _b(errTxtId) { $(errTxtId).innerHTML = ""; }; var lq_, lr_, gpass_xh; function _oi( pwd, cPwd, fname, lname, dob, CountryDdl,isDirect) { var pswd = to_rfc3986($(pwd).value); var cpswd = to_rfc3986($(cPwd).value); var fn = to_rfc3986($(fname).value); var ln = to_rfc3986($(lname).value); var dofb = "MM/DD/YYYY";   var ln_ = $('CountryDdl').value; var region = $('regionddl').value; var city = $('cityddl').value; var zipcd; var address;   if (fn == kh_['Fname'] || ln == kh_['LName']) { if (fn == kh_['Fname'] && ln == kh_['LName']) { alert(kh_['newUserValidation1']); return false; } else if (fn == kh_['Fname'] && ln != kh_['LName']) { alert(kh_['enterFname']); return false; } else if (fn != kh_['Fname'] && ln == kh_['LName']) { alert(kh_['enterLname']); return false; } } var alertErrMess = ''; if (ln_ == -1) { alertErrMess = kh_['SelectConStaCit']; } else { if (region == -1) { alertErrMess += kh_['SelectStaCit']; } else { if (city == -1) { alertErrMess += kh_['SelectCity']; } } } address = to_rfc3986($('address').value); zipcd = $('ziptxt').value; lo_ = /[0-9a-zA-Z\s]/; rxzip = new RegExp(lo_); if ((zipcd == '') || (zipcd == kh_['Zip'])) { alertErrMess += '\n' + kh_['enterZipcode']; } else { if (!($('ziptxt').value.match(lo_))) { alertErrMess += '\n' + lp_; } } if (pswd != cpswd) { alertErrMess += '\n' + kh_['passordMatch']; } else if (pswd!=''&&pswd.length < 6) { alertErrMess += '\n' + kh_['password6digit']; } if (!validateContact()) { alertErrMess += '\n' + checkContactNo; } var mobileNum = $('mobile').value; var homeNum = $('homeph').value; var workNum = $('workph').value; var homeCode = $('hCode').value; var workCode = $('wCode').value; if (alertErrMess != '') { alert(alertErrMess); return false; } lq_ = fn; gpass_xh = pswd; $('emailErr').innerHTML = ''; $('cntryErrddl').innerHTML = ''; $('saveBtnSpanId').style.display = 'none'; $('waitForsendMaiSpsnId').style.display = ''; var url = 'userUpdateProcess.aspx'; var par = "pswd=" + pswd + "&fn=" + fn + "&ln=" + ln + "&ctryId=" + ln_ + "&zip=" + zipcd + "&city=" + city + "&address=" + address + "&mob=" + mobileNum + "&home=" + homeNum + "&work=" + workNum + "&hCode=" + homeCode + "&wCode=" + workCode; var ajx = new Ajax.Request ( url, { method: 'post', parameters: par, onSuccess: function (req){noOverlay();}, onFailure: _kb }); }; function _oj(emailId, pwd, cPwd, fname, lname, dob, CountryDdl,isDirect) { var email = trim($(emailId).value); var pswd = trim(to_rfc3986($(pwd).value)); var cpswd = trim(to_rfc3986($(cPwd).value)); var fn = trim(to_rfc3986($(fname).value)); var ln = trim(to_rfc3986($(lname).value)); var dofb = "MM/DD/YYYY";   var region = $('regionddl').options[$('regionddl').selectedIndex].value; var city = $('cityddl').options[$('cityddl').selectedIndex].value; var zipcd; var address;   if (fn == kh_['Fname'] || ln == kh_['LName']) { if (fn == kh_['Fname'] && ln == kh_['LName']) { alert(kh_['newUserValidation1']); return false; } else if (fn == kh_['Fname'] && ln != kh_['LName']) { alert(kh_['enterFname']); return false; } else if (fn != kh_['Fname'] && ln == kh_['LName']) { alert(kh_['enterLname']); return false; } } var alertErrMess = ''; if (ln_ == -1) { alertErrMess = kh_['SelectConStaCit']; } else { if (region == -1) { alertErrMess += kh_['SelectStaCit']; } else { if (city == -1) { alertErrMess += kh_['SelectCity']; } } } if (hy_.indexOf('Address#||#') != -1) address = to_rfc3986($('address').value); else address = ''; if (hy_.indexOf('Zip#||#') != -1) { zipcd = trim($('ziptxt').value); rxzip = new RegExp(lo_); if ((zipcd == '') || (zipcd == kh_['Zip'])) { alertErrMess += '\n' + kh_['enterZipcode']; } else { if (!($('ziptxt').value.match(lo_))) { alertErrMess += '\n' + lp_; } } } else { zipcd = ''; } if (dofb == "MM/DD/YYYY") dofb = "01/01/1900"; if (_ot(dofb) == false) { alertErrMess += '\n' + kh_['birthDateFormat']; } _os(emailId); if (pswd == '') { alertErrMess += '\n' + kh_['blankPassword']; } else { if (pswd != cpswd) { alertErrMess += '\n' + kh_['passordMatch']; } else if (pswd.length < 6) { alertErrMess += '\n' + kh_['password6digit']; } } if (_os(emailId) == false) { alertErrMess += '\n' + kh_['enterValidEmail']; } if (!validateContact()) { alertErrMess += '\n' + checkContactNo; } var mobileNum = trim($('mobile').value); var homeNum = trim($('homeph').value); var workNum = trim($('workph').value); var homeCode = trim($('hCode').value); var workCode = trim($('wCode').value); lm_ = $('mORf').options[$('mORf').selectedIndex].value; if (alertErrMess != '') { alert(alertErrMess); return false; } lq_ = fn; lr_ = email; gpass_xh = pswd; $('emailErr').innerHTML = ''; $('cntryErrddl').innerHTML = ''; $('saveBtnSpanId').style.display = 'none'; $('waitForsendMaiSpsnId').style.display = 'block';
 var url = 'userSignupProcessWtLogin.aspx'; 
 var par = "emailId=" + email + "&pswd=" + pswd + "&fn=" + fn + "&ln=" + ln + "&dofb=" + dofb + "&ctryId=" + ln_ + "&mOrf=" + lm_ + "&zip=" + zipcd + "&city=" + city + "&address=" + address + "&mob=" + mobileNum + "&home=" + homeNum + "&work=" + workNum + "&hCode=" + homeCode + "&wCode=" + workCode;

 var ajx = new Ajax.Request ( url, { method: 'post', parameters: par, onSuccess: function (req){if(isDirect)_rh(req);else{if(wq_ && req.responseText != 3) setTimeout(function(){ _gd(); },50); else _ok(req);}}, onFailure: _kb }); }; function _rh(req) { if (req.responseText == 3) { var url = 'checklogin.aspx'; var par = 'uname=' + lr_ + '&passwd=' + gpass_xh; var ajx = new Ajax.Updater( 'testaddE', url, { method: 'post', parameters: par, evalScripts: true, onSuccess: _ri, onFailure: _kb }); } else { alert(kh_['confirmMailSend']); noOverlay(); } }; function _ri(req) { if ((req.responseText == 'Incorrect password. Try Again.') || (req.responseText == 'Please Verify your Account Sign up. Check your mailbox.')) { if (req.responseText == 'Please Verify your Account Sign up. Check your mailbox.') { var show = confirm(kh_['verifyConfirmBox']); if (show) { var unam = lr_; url = "sendEmailToVarify.aspx?uname=" + unam; var ajx = new Ajax.Request( url, { method: 'post', onSuccess: _om, onFailure: _kb }); } else { $('emailErr').innerHTML = kh_['signupverificationWarning']; $('saveBtnSpanId').style.display = 'block'; $('waitForsendMaiSpsnId').style.display = 'none'; } } else { if (req.responseText == 'Incorrect password. Try Again.') $('emailErr').innerHTML = kh_['signupincorrectpassword1'] + ' <a href="javascript:void(0);" onclick="_on(\'' + lr_ + '\');">' + kh_['signupincorrectpassword2'] + '</a> ' + kh_['signupincorrectpassword3']; $('saveBtnSpanId').style.display = 'block'; $('waitForsendMaiSpsnId').style.display = 'none'; } } else { noOverlay(); } lq_ = ''; lr_ = ''; gpass_xh = ''; }; function _ok(req) { if (req.responseText == 3) { var url = 'checklogin.aspx'; var par = 'uname=' + lr_ + '&passwd=' + gpass_xh; var ajx = new Ajax.Updater( 'testaddE', url, { method: 'post', parameters: par, evalScripts: true, onSuccess: _ol, onFailure: _kb }); } else { if(kh_['Dear']) { alert(kh_['Dear'] + ' ' + lq_ + '! ' + kh_['memberValidatePhoneNote4'] + ' ' + lr_ + '. ' + kh_['memberValidatePhoneNote5']); } else { alert(window.parent.kh_['Dear'] + ' ' + lq_ + '! ' + window.parent.kh_['memberValidatePhoneNote4'] + ' ' + lr_ + '. ' + window.parent.kh_['memberValidatePhoneNote5']); } lq_ = ''; lr_ = ''; gpass_xh = ''; _ov(); overlay(); } }; function _ol(req) { if ((req.responseText == 'Incorrect password. Try Again.') || (req.responseText == 'Please Verify your Account Sign up. Check your mailbox.')) { if (req.responseText == 'Please Verify your Account Sign up. Check your mailbox.') { var show = confirm(kh_['verifyConfirmBox']); if (show) { var unam = $('uname').value; url = "sendEmailToVarify.aspx?uname=" + unam; var ajx = new Ajax.Request( url, { method: 'post', onSuccess: _om, onFailure: _kb }); } else { $('emailErr').innerHTML = kh_['signupverificationWarning']; $('saveBtnSpanId').style.display = 'block'; $('waitForsendMaiSpsnId').style.display = 'none'; } } else { if (req.responseText == 'Incorrect password. Try Again.') $('emailErr').innerHTML = kh_['signupincorrectpassword1'] + ' <a href="javascript:void(0);" onclick="_on(\'' + lr_ + '\');">' + kh_['signupincorrectpassword2'] + '</a> ' + kh_['signupincorrectpassword3']; $('saveBtnSpanId').style.display = 'block'; $('waitForsendMaiSpsnId').style.display = 'none'; } } 
 
 else { 
        if(wq_) 
            setTimeout(function(){ _gd(); },50); 
        else
		_ov(); } lq_ = ''; lr_ = ''; gpass_xh = ''; }; 
 function _om() { alert(kh_['confirmMailSend']); $('emailErr').innerHTML = kh_['signupverificationSend']; $('saveBtnSpanId').style.display = 'block'; $('waitForsendMaiSpsnId').style.display = 'none'; }; function _on(emailOfUser) { $('saveBtnSpanId').style.display = 'none'; $('waitForsendMaiSpsnId').style.display = 'block'; $('emailErr').style.display = 'none'; var url = 'checkForgotpassword.aspx'; var par = 'email=' + emailOfUser; var ajx = new Ajax.Updater( 'testaddE', url, { method: 'post', parameters: par, evalScripts: true, onSuccess: _oo, onFailure: _kb }); }; function _oo(req) { if ((req.responseText == 'Incorrect E-mail. Try Again.') || (req.responseText == 'No user found. Try Again.')) { $('emailErr').style.display = 'block'; if (req.responseText == 'Incorrect E-mail. Try Again.') alert(kh_['incorrectEmailTryAgain']); else alert(kh_['NoUserFound']); } if ((req.responseText == 'Please check your email, a link has been sent on your email, please click it to confirm your email.')) { $('emailErr').innerHTML = ''; $('emailErr').style.display = 'none'; alert(kh_['forgotPassLink']); } $('saveBtnSpanId').style.display = 'block'; $('waitForsendMaiSpsnId').style.display = 'none'; }; function _op(id) { var fieldVal = $(id).value; if (fieldVal == 'First Name' || fieldVal == 'Last Name' || fieldVal == 'mm/dd/yyyy') { $(id).value = ''; } }; function _oq(id) { if (id == 'fname') { if ($(id).value == '') { $(id).value = 'First Name'; } }; if (id == 'lname') { if ($(id).value == '') { $(id).value = 'Last Name'; } }; if (id == 'dob') { if ($(id).value == '') { $(id).value = 'mm/dd/yyyy'; } }; };  function _or(str) { var at = "@"; var dot = "."; var lat = str.indexOf(at); var lstr = str.length; var ldot = str.indexOf(dot); if (str.indexOf(at) == -1) { return false; } if (str.indexOf(at) == -1 || str.indexOf(at) == 0 || str.indexOf(at) == lstr) { return false; } if (str.indexOf(dot) == -1 || str.indexOf(dot) == 0 || str.indexOf(dot) == lstr) { return false; } if (str.indexOf(at, (lat + 1)) != -1) { return false; } if (str.substring(lat - 1, lat) == dot || str.substring(lat + 1, lat + 2) == dot) { return false; } if (str.indexOf(dot, (lat + 2)) == -1) { return false; } if (str.indexOf(" ") != -1) { return false; }; return true; }; function _os(eId) { var emailID = eId; if ((trim($(emailID).value) == null) || (trim($(emailID).value) == "")) { return false; } if (_or(trim($(emailID).value)) == false) { return false; } return true; };   function _ot(datefield) {   if (datefield == "") {     return false; }   var valid = "0123456789/";   var slashcount = 0;   if (datefield.length != 10) {     return false; }   for (var i = 0; i < datefield.length; i++) { temp = "" + datefield.substring(i, i + 1);   if (temp == "/") slashcount++; }   if (valid.indexOf(temp) == "-1") {     return false; }   if (slashcount != 2) {   return false; } else { var dateArry = new Array(); dateArry = datefield.split("/"); if (dateArry[0] < 1 || dateArry[0] > 12) {   return false; } else if (dateArry[1] < 1 || dateArry[1] > 31) {   return false; } } if ((datefield.charAt(2) != '/') || (datefield.charAt(5) != '/')) {   return false; } return true; };   function _ou() { _hq(620, 434); if(wr_) var url = 'insertAppointmentAfterloginForRecur.aspx'; else var url = 'insertAppointmentAfterlogin.aspx'; var par = 'wtLogin=2'; var ajx = new Ajax.Updater( 'addE', url, { method: 'post', evalScripts: true, parameters: par, onFailure: _kb }); }; function _ov() { _hq(620, 434); var url = 'appointmentBookingOptions.aspx'; var ajx = new Ajax.Updater( 'addE', url, { method: 'post', evalScripts: true, onFailure: _kb }); }; var ls_; function _ow(varmsgId) { ls_ = varmsgId; var url = 'isUsersContactNumberVerified.aspx'; var ajx = new Ajax.Request ( url, { method: 'post', onSuccess: _ox, onFailure: _kb }); }; function _ox(req) { var mssg = ''; if (ls_ == '1') { mssg = "you have not verified any of your contact number. Your appointment will not be booked. Are you sure?"; } else if (ls_ == '2') { mssg = "you have not verified any of your contact number.Your appointment will not be confirmed until admin approval. Are you sure?"; } if (req.responseText == 1) { _ou(); } else { var ans1 = confirm(mssg); if (ans1) { if (ls_ == '1') { noOverlay(); } else { _ou(); } } } }; function _oy(ls_) { var msg;   if (ls_ == 1) { msg = ""; } if (msg == false) { return false; } }; function _kj() { var vW = 300;   var vH = 200;     var fullBussinessAddress; fullBussinessAddress = gp_ + ',' + gr_ + ',' + gq_ + ',' + gt_ + gs_;   $("mapFram").src = 'shopAddressMap.aspx?w=' + vW + '&h=' + vH + '&address=' + fullBussinessAddress; $("mapFram").style.width = 300;   $("mapFram").style.height = 200;    }; function _im(dt, no) { _ex(iu_['Loading']); er_ = 'month'; _ev(2); _lc(); dt = new Date(dt); dt.setDate(dt.getDate() + no); var checkAvailableDate = new Date(dt); km_ = new Date(dt); dt = dt.getMonth() + 1 + '/' + dt.getDate() + '/' + dt.getFullYear(); var checkAvail = false; for (i in iz_) { if (i == checkAvailableDate.getMonth() + 1 + '/' + checkAvailableDate.getDate() + '/' + checkAvailableDate.getFullYear()) { checkAvail = true; break; } } if (checkAvail) { if (serverDate.getDate() == checkAvailableDate.getDate() && serverDate.getMonth() == checkAvailableDate.getMonth() && serverDate.getFullYear() == checkAvailableDate.getFullYear()) paraCalDate = new Date(serverDate.toString()); else paraCalDate = new Date(checkAvailableDate);               _cx(iz_[checkAvailableDate.getMonth() + 1 + '/' + checkAvailableDate.getDate() + '/' + checkAvailableDate.getFullYear()]); _lt(); } else { var url = 'rendercal.aspx'; var par = 'calDate=' + dt + '&jscalDate=' + dt + ' ' + km_.getHours() + ':' + km_.getMinutes() + ':' + km_.getSeconds(); var ajx = new Ajax.Updater( 'rightBr', url, { method: 'post', parameters: par, evalScripts: true, onFailure: _kb }); } }; function _in() { for (j = 0; j < jl_.length; j++) { var tempWDate = new Date(jl_[j]); var c = tempWDate._ch(tempWDate.getDay()); for (i = 0; i < c.length; i++) { jm_.push(c[i]); tempWDate.setDate(c[i]); jk_.push(tempWDate.toString()); } } }; function _rd(m, d) { $(m + 'd' + d).className = 'selectedBoxColor'; $(m + 'dh' + d).className = 'dateboxheadOver'; }; function _la(m, d) { $(m + 'd' + d).className = 'unselectedBoxColor'; $(m + 'dh' + d).className = 'dateboxhead'; }; function _kr() { if (ez_ == 1) $('selectSrv').innerHTML = 'Service &raquo;'; var ScreenText = ''; ScreenText += '<table width="100%" border="0" cellspacing="0" class="appointBoxTable" cellpadding="0">'; ScreenText += '<tr>'; ScreenText += '<td valign="top" >'; ScreenText += '<table width="100%" border="0" cellspacing="0" class="appointBoxTable" cellpadding="0">'; var m = 1; for (i in e_) { if (m == 1) { m = 0; ScreenText += '<tr class="upperTd">'; } else { m = 1; ScreenText += ' <tr class="lowerTd">'; } ScreenText += '<td width="15">'; if (ez_ == 1) ScreenText += '<div style="display:none">'; else ScreenText += '<div style="display:block">'; ScreenText += '<input type="checkbox" name="service' + e_[i][0] + '" id="service' + e_[i][0] + '" value="' + e_[i][0] + '" onclick="_av();" /> <input type="hidden" name="' + e_[i][0] + '" id="serviceName' + e_[i][0] + '" value="' + e_[i][1] + '" /> <input type="hidden" name=serviceTime"' + e_[i][0] + '" id="serviceTime' + e_[i][0] + '" value="' + e_[i][2] + '" />'; ScreenText += '<input name="serviceText" type="hidden" id="serviceText' + e_[i][0] + '" value="' + e_[i][0] + '" />'; ScreenText += '<input name="serviceTime" type="hidden" id="serviceTime' + e_[i][0] + '" value="' + e_[i][2] + '" />'; ScreenText += '<input name="serviceCost' + e_[i][0] + '" type="hidden" id="serviceCost' + e_[i][0] + '" value="' + e_[i][3] + '" /></div> </td>'; ScreenText += '<td width="154" class="' + classOnServiceAndStaff + '" style="cursor:pointer;" onclick="_cc(' + e_[i][0] + ')" ><div><a style="cursor:pointer" title="' + e_[i][4] + '">' + e_[i][1] + '</a></div></td>'; ScreenText += '<td class="' + classOnServiceAndStaff + '"><span id="serviceTimeTd' + i + '">' + e_[i][2] + 'mins.</span></td>'; ScreenText += '<td class="' + classOnServiceAndStaff + '"><span id="serviceCostTd' + i + '">' + e_[i][3] + '</span></td>'; ScreenText += '</tr>'; if (m == 0) { ScreenText += '<tr class="upperTdOtherText">'; } else { ScreenText += ' <tr class="lowerTdOtherText">'; } if (ez_ == 1) ScreenText += '<td>'; else ScreenText += '<td>&nbsp;'; ScreenText += '</td><td colspan="3"><span style="display:none;" id="description' + e_[i][0] + '">&nbsp;' + e_[i][4] + '</span></td>'; ScreenText += '</tr>'; } ScreenText += '<tr>'; if (ez_ == 1) ScreenText += '<td>'; else ScreenText += '<td>&nbsp;'; ScreenText += '</td>'; ScreenText += '<td align="right" style="border-top:#444 solid 1px;">Total&nbsp;&nbsp;</td>'; ScreenText += '<td style="border-top:#444 solid 1px;"><span id="sumDuration">&nbsp;</span></td>'; ScreenText += '<td style="border-top:#444 solid 1px;"><span id="sumCost">&nbsp;</span></td>'; ScreenText += '</tr>'; ScreenText += '</table>'; ScreenText += '</td>'; ScreenText += '<td valign="top">'; if ($('barStaff').style.display == 'block') { ScreenText += '<table width="100%" border="0" cellspacing="0" class="appointBoxTable" cellpadding="0">'; for (var i = 0; i < p_.length; i++) { if (p_[i][2] == 'False') { if (m == 1) { m = 0; ScreenText += '<tr class="upperTd">'; } else { m = 1; ScreenText += ' <tr class="lowerTd">'; } if (eval(fn_)) { if (eval(fm_)) { var showPhotoRowSpan = 2; } var tmp = new Image; tmp.src = 'AppointyImages/' + appointyIdSession + '/staffImages/' + p_[i][0] + '.jpg'; if (tmp.complete) { var showPhotoImage = '<img src="AppointyImages\/' + appointyIdSession + '\/staffImages\/' + p_[i][0] + '.jpg" \/>'; } else { var showPhotoImage = '<img src="images/staffImg/default_large.png" width="40" height="40" valign="top"/>'; } } else { var showPhotoImage = '&nbsp;'; } if (eval(fm_)) { var classOnServiceAndStaff = "serviceNDCBold"; } else { var classOnServiceAndStaff = "serviceNDCNotBold"; } ScreenText += ' <td width="13"><em> <label> <input type="checkbox" name="staffNo' + p_[i][0] + '" id="staffNo' + p_[i][0] + '" value="' + p_[i][0] + '" onClick="_gv(this);" /> <input name="staffName' + p_[i][0] + '" type="hidden" id="staffName' + p_[i][0] + '" value="' + p_[i][1] + '" /> </label> </em></td> <td class="' + classOnServiceAndStaff + '" id="staffDT' + p_[i][0] + '" onclick="_kf(\'' + i + '\')" >' + p_[i][1] + '</td> <td width="44" style="vertical-align:top" rowspan="' + showPhotoRowSpan + '">' + showPhotoImage + '</td> </tr> '; if (eval(fm_)) { if (m == 0) ScreenText += '<tr class="upperTdOtherText">'; else ScreenText += ' <tr class="lowerTdOtherText">'; if (eval(fn_)) var showPhotoColSpan = 1; else var showPhotoColSpan = 2; ScreenText += '<td>&nbsp;</td><td colspan="' + showPhotoColSpan + '">' + p_[i][3] + '</td>'; ScreenText += '</tr>'; } } } ScreenText += '</table>'; } ScreenText += '</td>'; ScreenText += '</tr>'; ScreenText += '</table>'; $('textSchedule').innerHTML = ScreenText; }; var cr_; var cs_; var ct_ = new Array(); var cu_ = 0; var cv_ = 0; var cw_; var cx_; var cy_; function _fz() { ct_ = dl_.toString(); ct_ = ct_.split(','); var appBookTimeVar = 0; if (dl_.length == 0) { ct_.pop(); for (var l = 0; l < p_.length; l++) { if (p_[l][2] == 'False') ct_.push(p_[l][0]); } } cu_ = ct_.length; cv_ = dj_.length; if (er_ == 'week') noOfDay = 7; else noOfDay = 42; var tval = $('appointTime').value; if ((tval == kh_['Morning'] || tval == kh_['Afternoon'] || tval == kh_['Evening'] || tval == kh_['Night'] || tval == kh_['FullDay']) && dj_.length > 0) { startAllServiceArray = (dj_.toString()).split(',');   startAllTimeArray = (dk_.toString()).split(',');   dm_.clear(); kl_ = new Date(km_); kl_.setDate(kl_.getDate() - 1); var givenStartT = ''; var givenEndT = ''; var givenStartD = ''; var givenEndD = ''; var helpVal=''; switch (tval) { case kh_['Morning']: givenStartT = '12:00 AM'; givenEndT = '11:59 AM'; helpVal = 'Morning'; break; case kh_['Afternoon']: givenStartT = '12:00 PM'; givenEndT = '3:59 PM'; helpVal = 'Afternoon'; break; case kh_['Evening']: givenStartT = '4:00 PM'; givenEndT = '7:59 PM'; helpVal = 'Evening'; break; case kh_['Night']: givenStartT = '8:00 PM'; givenEndT = '11:59 PM'; helpVal = 'Night'; break; default: givenStartT = hp_; givenEndT = hq_; helpVal = 'Full Day'; } var giveTestST = givenStartT; var giveTestET = givenEndT; var checkatleastone = 0; for (var i = 0; i <= noOfDay; i++) { if (kl_ < serverDate || _cq(kl_, jk_)) { kl_.setDate(kl_.getDate() + 1); continue; } givenStartT = giveTestST; givenEndT = giveTestET; cw_ = kl_.getDate(); cx_ = kl_.getMonth(); cy_ = kl_.getFullYear(); var newtDate = cx_ + 1 + '/' + cw_ + '/' + cy_; var tempStartT = ' 23:59:00'; var tempEndT = ' 00:00:00'; var tempSDate = Date.parse(newtDate + tempStartT); var tempEDate = Date.parse(newtDate + tempEndT); var s = 0; var divid = 96; var searchDay = kl_.getDay(); cs_ = searchDay; for (var k = 0; k < cv_; k++) { for (l = 0; l < cu_; l++) { para = searchDay + '/' + ct_[l] + '/' + dj_[k]; if (typeof (kb_[para]) != 'undefined') { var ssdArr = kb_[para]; var m = ssdArr.length; do { var comST = Date.parse(newtDate + ' ' + ssdArr[m - 1][3]); var comET = Date.parse(newtDate + ' ' + ssdArr[m - 1][4]); if (comST < tempSDate) { tempSDate = comST; tempStartT = ssdArr[m - 1][3]; } if (comET > tempEDate) { tempEDate = comET; tempEndT = ssdArr[m - 1][4]; } } while (--m); } } } givenStartD = Date.parse(newtDate + ' ' + givenStartT); givenEndD = Date.parse(newtDate + ' ' + givenEndT); tempEDate = tempEDate - (hc_ * 60 * 1000); if (givenStartD < tempSDate) givenStartT = tempStartT; if (givenEndD > tempEDate) givenEndT = tempEndT; searchStartTime = new Date(newtDate + ' ' + givenStartT); searchEndTime = new Date(newtDate + ' ' + givenEndT); if (givenEndD > tempEDate) searchEndTime.setMinutes(searchEndTime.getMinutes() - hc_); var pqr = searchStartTime.getMinutes(); if ($('daysAllAppointment' + i)) { $('daysAllAppointment' + i).style.zIndex = 2; $('daysAllAppointment' + i).style.display = 'block';   if (er_ == 'week') { $('daysAllAppointmentUp' + i).style.visibility = 'hidden'; $('daysAllAppointmentDown' + i).style.visibility = 'hidden'; } else { $('daysAllAppointmentUp' + i).style.display = 'none'; $('daysAllAppointmentDown' + i).style.display = 'none'; } $('availD' + i).style.zIndex = 0; $('availD' + i).style.display = 'none'; $('notAvailD' + i).style.zIndex = 0; $('notAvailD' + i).style.display = 'none'; if (noOfDay > 7) { $('daysAllAppointmentText' + i).className = 'notAvailableDate'; $('daysAllAppointmentText' + i).innerHTML = '<span onclick="_ex(\' ' + kh_['memberHelpArr21'] + '\')"> ' + kh_['notavailable1'] + '<br></span>'; ; } } var alter = 1; cr_ = cx_ + 1 + '/' + cw_ + '/' + cy_; var isAppAvail=true; var yy_=new Date(searchStartTime.toString()); var yz_=0; var za_=pqr; for (var j = 0; j < divid; j++) { var zb_=true;             hj_ = new Date(searchStartTime); hj_.setMinutes(searchStartTime.getMinutes()); hj_.setSeconds(searchStartTime.getSeconds()); hj_.setHours(searchStartTime.getHours()); hj_.setMinutes(pqr); if (hj_ > searchEndTime) break; if (_ge(hj_.toString())) { if(timeDifferenceOfSlot<15 || autoSearchUnavailableTimes_xh) s+=timeDifferenceOfSlot; else s+=15; pqr = searchStartTime.getMinutes() + s; continue; } jt_.clear(); ju_.clear(); jv_.clear(); jx_.clear(); jw_.clear(); jn_ = (dj_.toString()).split(','); var asd = _bb();   if(asd) { isAppAvail=true; checkatleastone=1; hj_.setMinutes(searchStartTime.getMinutes()); hj_.setSeconds(searchStartTime.getSeconds()); hj_.setHours(searchStartTime.getHours()); hj_.setMinutes(pqr); var newDtOvNt =i; if (noOfDay == 7) newDtOvNt = setDateOverNight_xh(hj_, i); if(noOfDay==7) { if(alter==1) { alter=0; divClass='upperDivTime'; } else { alter=1; divClass='lowerDivTime'; } var divText=''; divText=_x(hj_); appBookTimeVar+=1; if($('daysAllAppointmentText'+newDtOvNt)) $('daysAllAppointmentText'+newDtOvNt).innerHTML+='<div id="appBooktime'+appBookTimeVar+'" class="'+divClass+'">'+divText+'</div>'; ir_['appBooktime'+appBookTimeVar]=hj_.toString(); } else if($('daysAllAppointmentText'+newDtOvNt)) { $('daysAllAppointmentText'+newDtOvNt).className ='availableDate'; $('daysAllAppointmentText'+newDtOvNt).innerHTML='<span> '+kh_['Appointmentavailable']+'<br></span>'; } if(noOfDay>7)break; } else { isAppAvail=false; if(noOfDay==7 && sr_ && zb_) { checkatleastone=1; hj_.setMinutes(searchStartTime.getMinutes()); hj_.setSeconds(searchStartTime.getSeconds()); hj_.setHours(searchStartTime.getHours()); hj_.setMinutes(pqr); var newDtOvNt =i; newDtOvNt = setDateOverNight_xh(hj_, i); var divText=''; divText=_x(hj_); appBookTimeVar+=1; if($('daysAllAppointmentText'+newDtOvNt)) $('daysAllAppointmentText'+newDtOvNt).innerHTML+='<span class="BookedCrossTime" style="display:block">'+divText+'</span>'; } } if(isAppAvail || timeDifferenceOfSlot<15 || autoSearchUnavailableTimes_xh) s+=timeDifferenceOfSlot; else s+=15; pqr=searchStartTime.getMinutes()+s; } if (noOfDay == 7 && $('daysAllAppointmentText' + i)) { if ($('daysAllAppointmentText' + i).innerHTML == '') { $('daysAllAppointmentText' + i).innerHTML = '<div class="notAvailableDate" onclick="_ex(\' ' + kh_['memberHelpArr21'] + '\')">' + kh_['notavailable1'] + '<br></div>'; } if ($('daysAllAppointmentText' + i).scrollHeight > $('daysAllAppointmentText' + i).offsetHeight) { $('daysAllAppointmentUp' + i).style.visibility = 'visible'; $('daysAllAppointmentDown' + i).style.visibility = 'visible'; } } kl_.setDate(kl_.getDate() + 1); } _ga(checkatleastone, helpVal); } else { for (var i = 1; i <= noOfDay; i++) { $('daysAllAppointment' + i).style.zIndex = 0; $('daysAllAppointment' + i).style.display = 'none'; $('daysAllAppointmentText' + i).innerHTML = ''; } } $("seachGif").style.display = "none"; _gj(db_); di_ = true; }; var up = true, down = true; function _y(no) { objDiv = document.getElementById(no); if (objDiv.scrollTop == objDiv.scrollHeight) up = false; if (up) { objDiv.scrollTop = objDiv.scrollTop + 4; setTimeout('_y(\'' + no + '\')', 1); } }; function _z(no) { objDiv = document.getElementById(no); if (objDiv.scrollTop == 0) down = false; if (down) { objDiv.scrollTop = objDiv.scrollTop - 4; setTimeout('_z(\'' + no + '\')', 1); } }; function _gc(d, isCheck) { dt = Date.parse(d.toString()); var temp = 1000 * 3600 * parseInt(kq_); if (!isCheck) dt += temp; dt -= timeZonOfsetDiff * 60000; var temp2 = 1000 * 3600 * 24; dt %= temp2; dt /= 1000; var todayH = parseInt(dt / (60 * 60)); var todayM = parseInt((dt % (60 * 60)) / 60); var todayS = parseInt((dt % (60 * 60)) % 60); if (todayH > 12) t = todayH - 12; else t = todayH; if (todayH < 10) t = '0' + t; t += ':' + todayM; if (todayM == 0) t += '0'; if (todayH > 11) t += ' PM'; else t += ' AM'; return t; }; function _x(d, isCheck) { var dt = new Date(d.toString()); if (!isCheck) { dt.setHours(dt.getHours() + parseInt(kq_));   } var todayH = parseInt(dt.getHours()); var todayM = parseInt(dt.getMinutes()); if (!defaultTimeFormat_xh) { if (todayH > 12) t = todayH - 12; else t = todayH; } else t = todayH; if (todayH < 10) t = '0' + t; if (todayM < 10) todayM='0'+todayM; t += ':' + todayM;     if (!defaultTimeFormat_xh) { if (todayH > 11) t += ' PM'; else t += ' AM'; } return t; }; var sq_=''; function _gd(d) { if(d) sq_=d; d=sq_; d = new Date(d); tt = _x(d, true); var tempT = $('appointTime').value; $('appointTime').value = tt; _gf(d.getDate(), d.getMonth(), d.getFullYear()); $('appointTime').value = tempT; }; function _gi(dt, no) { _ex(iu_['Loading']); er_ = 'week'; _ev(1); _lc(); dt = new Date(dt); dt.setDate(dt.getDate() + no); km_ = new Date(dt); var comDate = new Date(paraCalDate.toString()); var prevMDate = new Date(paraCalDate.toString()); var prevMDateSet = new Date(paraCalDate.toString()); prevMDateSet.setDate(prevMDateSet.getDate() - 42); prevMDate.setDate(prevMDate.getDate() - 6); comDate.setDate(comDate.getDate() + 41); if (comDate < km_) var checkAvailableDate = new Date(dt); else if (prevMDate > km_) var checkAvailableDate = new Date(prevMDateSet); else var checkAvailableDate = new Date(paraCalDate);   dt = dt.getMonth() + 1 + '/' + dt.getDate() + '/' + dt.getFullYear(); var checkAvail = false; for (i in iz_) { if (i == checkAvailableDate.getMonth() + 1 + '/' + checkAvailableDate.getDate() + '/' + checkAvailableDate.getFullYear()) { checkAvail = true; break; } } if (checkAvail) { paraCalDate = new Date(checkAvailableDate); var allDAtaArray = new Array();             _cx(iz_[checkAvailableDate.getMonth() + 1 + '/' + checkAvailableDate.getDate() + '/' + checkAvailableDate.getFullYear()]); _lx(); } else { var url = 'rendercal.aspx'; var par = 'calDate=' + dt + '&jscalDate=' + dt + ' ' + km_.getHours() + ':' + km_.getMinutes() + ':' + km_.getSeconds(); var ajx = new Ajax.Updater( 'rightBr', url, { method: 'post', parameters: par, evalScripts: true, onFailure: _kb }); } }; function _gb(no) { if (!no) no = 0; _gi(km_, no); }; function _oz(no) { if (!no) no = 0; _im(paraCalDate, no); }; function _pa() { var newtDate = '12/12/2007'; for (k in e_) { for (l = 0; l < p_.length; l++) { for (var m = 0; m < 7; m++) { para = m + '/' + p_[l][0] + '/' + e_[k][0]; if (typeof (kb_[para]) != 'undefined') { var ssdArr = kb_[para]; var n = ssdArr.length; do { var comST = new Date(newtDate + ' ' + ssdArr[n - 1][3]); var comET = new Date(newtDate + ' ' + ssdArr[n - 1][4]); comET.setMinutes(comET.getMinutes() - e_[k][2]); if (comST <= comET) { do { var paraAvail = comST.getHours() + ':' + comST.getMinutes(); if (typeof (iw_[para + '/' + paraAvail]) == 'undefined') { iw_[para + '/' + paraAvail] = new Array(); } iw_[para + '/' + paraAvail].push(paraAvail); comST.setMinutes(comST.getMinutes() + 5); } while (comST <= comET); } } while (--n); } } } } }; function _ge(st) { if (dk_.length != 3) return false; var searchTimeArr = new Array(); searchTimeArr[0] = new Array(0, dk_[1], dk_[1], parseInt(dk_[1]) + parseInt(dk_[2])); searchTimeArr[1] = new Array(0, dk_[0], dk_[2], parseInt(dk_[0]) + parseInt(dk_[2])); searchTimeArr[2] = new Array(0, dk_[0], dk_[1], parseInt(dk_[0]) + parseInt(dk_[1])); var returnValue; for (var i = 0; i < cv_; i++) { returnValue = true; for (var j = 0; j < cu_; j++) { for (var k = 0; k < 4; k++) { workerTime = Date.parse(st); sEndTime = Date.parse(st); workerTime = workerTime + parseInt(searchTimeArr[i][k] * 60 * 1000); sEndTime = sEndTime + (parseInt(searchTimeArr[i][k]) + parseInt(dk_[i]) - 1) * 60 * 1000; if (!_bf(ct_[j], workerTime, sEndTime, dj_[i])) { returnValue = false; break; } } if (!returnValue) break; } if (returnValue) return true; } return false; }; var lt_ = 0; var lu_ = 0; function _ex(txt) { $('helpRunTimeText').style.display = 'block'; $('helpRunTimeText').innerHTML = '<div id="highLightHelpText">' + txt + '</div>'; }; function _pb(txt) { $('helpRunTimeText').style.display = 'block'; $('helpRunTimeText').innerHTML = '<div class="helpBoth1"></div><div class="helpBoth2"></div><div id="highLightHelpText">' + txt + '</div><div class="helpBoth2"></div><div class="helpBoth1"></div>'; $('helpRunTimeTexttable').style.marginLeft = -($('helpRunTimeTexttable').offsetWidth / 2) + 100; $('helpRunTimeTexttable').style.top = 50 + '%'; }; function _ga(appAvail, searchValue) { if (er_ == 'week') { if (appAvail) _ex(iu_['slotAvailableInWeek']); else if (dl_.length == 0) if (kx_) _ex(iu_['noSlotAvailableIn' + searchValue + 'InWeekLast']); else _ex(iu_['noSlotAvailableIn' + searchValue + 'InWeek']); else if (kx_) _ex(iu_['noSlotAvailableIn' + searchValue + 'InWeekStaffSelectedLast']); else _ex(iu_['noSlotAvailableIn' + searchValue + 'InWeekStaffSelected']); } else { if (appAvail) _ex(iu_['slotAvailableInMonth']); else if (dl_.length == 0) if (kx_) _ex(iu_['noSlotAvailableIn' + searchValue + 'InMonthLast']); else _ex(iu_['noSlotAvailableIn' + searchValue + 'InMonth']); else if (kx_) _ex(iu_['noSlotAvailableIn' + searchValue + 'InMonthStaffSelectedLast']); else _ex(iu_['noSlotAvailableIn' + searchValue + 'InMonthStaffSelected']); } }; function _jz(avail) { var str = ''; var searchValueTime = $('appointTime').value; if (avail) { if ($(searchValueTime + 'slot')) { if ($(searchValueTime + 'slot').innerHTML == '&nbsp;') str = iu_['noSlotAvailableIn' + searchValueTime + 'InDay']; else str = iu_['slotAvailableInDay']; } else if (searchValueTime == kh_['FullDay']) str = iu_['slotAvailableInDay']; else str = iu_['noSlotAvailableInSelectedTimeInDay']; } else { str = iu_['noSlotAvailableInFull DayInDay']; } $('slotBottomHelp').innerHTML = str; }; function _pc() { _ex('Select Service'); _ib(); }; eq_ = true; hideOverlayHelp_xh = true; function _ky() { return true; if (eq_) { var leftpos = 0; var toppos = 0; aTag = $('right_cal_table'); do { aTag = aTag.offsetParent; leftpos += aTag.offsetLeft; toppos += aTag.offsetTop; if (aTag.offsetParent == null) break; } while (aTag.tagName != "BODY"); $('appointyOverlayText').style.display = 'block'; $('appointyOverlayTextIn').style.display = 'block'; $('appointyOverlayTextIn').setOpacity(.75); $('appointyOverlayText').style.height = $('right_cal_table').offsetHeight; $('appointyOverlayText').style.width = $('right_cal_table').offsetWidth; $('appointyOverlayText').style.top = toppos + $('right_cal_table').offsetTop; $('appointyOverlayText').style.left = leftpos + $('right_cal_table').offsetLeft; $('appointyOverlayTextIn').style.height = $('right_cal_table').offsetHeight; $('appointyOverlayTextIn').style.width = $('right_cal_table').offsetWidth; $('appointyOverlayTextIn').style.top = toppos + $('right_cal_table').offsetTop; $('appointyOverlayTextIn').style.left = leftpos + $('right_cal_table').offsetLeft; } document.onmouseup = _kz; }; function _kz() { if (hideOverlayHelp_xh) { eq_ = false; $('appointyOverlayText').style.display = 'none'; $('appointyOverlayTextIn').style.display = 'none'; } }; function _ev(no) { for (var i = 1; i <= 3; i++) { $('tb1' + i).className = 'topStepBoth1Off'; $('tb2' + i).className = 'topStepBoth2Off'; $('tbT' + i).className = 'modelinkOff'; } $('tb1' + no).className = 'topStepBoth1'; $('tb2' + no).className = 'topStepBoth2'; $('tbT' + no).className = 'modelinkOn'; }; function _pd() { er_ = 'detail'; if (ez_ != 1) _hg(); _lc(); var url = 'showDetailAndGallery.aspx'; var ajx = new Ajax.Updater( 'rightBr', url, { method: 'post', evalScripts: true, onFailure: _kb }); }; function _lb(sId) { _ev(3); er_ = 'Staffdetail'; if (ez_ != 1) _hg(); _lc(); var url = 'StaffSetting/staffDetailPageOnClient.aspx'; var par = 'sId=' + sId; var ajx = new Ajax.Updater( 'rightBr', url, { method: 'post', parameters: par, evalScripts: true, onFailure: _kb }); }; function _pe(sId) { _ev(3); er_ = 'servicedetail'; if (ez_ != 1) _hg(); _lc(); var url = 'serviceDetailOnClient.aspx'; var par = 'sId=' + sId; var ajx = new Ajax.Updater( 'rightBr', url, { method: 'post', parameters: par, evalScripts: true, onFailure: _kb }); }; function _pf() { io_.length = 0; for (s in ip_) { ip_[s].length = 0; } for (j in e_) { if (typeof (ip_[e_[j][7]]) == 'undefined') { ip_[e_[j][7]] = new Array(); io_.push(new Array(e_[j][7], e_[j][8])); } ip_[e_[j][7]].push(new Array(e_[j][0], e_[j][1], e_[j][2], e_[j][3], e_[j][4], e_[j][5], e_[j][8])); } }; function _gg() { for (s in it_) { it_[s].length = 0; } for (var i = 0; i < 7; i++) { for (j in e_) { for (var k = 0; k < p_.length; k++) { if (p_[k][2] == 'False') { var para = i + '/' + p_[k][0] + '/' + e_[j][0]; if (typeof (kb_[para]) != 'undefined') { if (typeof (it_[i + '/' + e_[j][0]]) == 'undefined') { it_[i + '/' + e_[j][0]] = new Array(); } it_[i + '/' + e_[j][0]].push(p_[k][0]); } } } } } }; function _lc() { var rh = ee_ + 15; $("rightBr").innerHTML = '<table width="100%" class="rightBodyloading" height="' + rh + '" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="center" valign="middle">Loading... <img src="images/indicator_flower.gif"></td> </tr></table>'; }; function _pg() { $('appointTime').value = kh_['FullDay']; checkTimeAndService(); }; function _ph() {   var url1; url1 = 'insertAvailableAppointment.aspx?proceedto=1&paywithOpt='; _pj(url1); }; function _pi() {   var url1; var payWith = ""; payradio = document.getElementsByName("PPmodule"); for (var i = 0; i < payradio.length; i++) { if (payradio[i].checked) payWith = payradio[i].value; } if (payWith == '') { alert("please choose the payment method."); return false; } if(wr_) url1 = 'insertAvailableAppointmentForRecur.aspx?proceedto=2&paywithOpt=' + payWith; else url1 = 'insertAvailableAppointment.aspx?proceedto=2&paywithOpt=' + payWith; _pj(url1); }; function _pj(url)  { _hq(610, 360); var ajx = new Ajax.Updater( 'testaddE', url, { methd: 'post', evalScripts: true, parameters: lk_, onSuccess: _ha, onFailure: _kb } ); }; var lv_ = 0; var lw_ = 0; function _pk(val1) { lv_ = 0; $('prePayLnk').blur(); if (lw_ == 0) {   new Effect.Appear('paymentGtWayDiv'); if (payradio[0]) { payradio[0].checked = true; } lw_ = 1; } else if (lw_ == 1) {   new Effect.Fade('paymentGtWayDiv'); lw_ = 0; } if ($('phoneVerificationDiv')) { $('phoneVerificationDiv').style.display = 'none'; } }; function _pl() { lw_ = 0; $('verifyContentLnk').blur(); if (lv_ == 0) {   new Effect.Appear('phoneVerificationDiv'); lv_ = 1; } else if (lv_ == 1) {   new Effect.Fade('phoneVerificationDiv'); lv_ = 0; } if ($('paymentGtWayDiv')) { $('paymentGtWayDiv').style.display = 'none'; } }; function _pm(ctryCD) { p7 = ctryCD; };  var lx_; var ly_; var lz_; var ma_; var sessionuserFirstName; var mb_; function _pn(prmt, sessionusr) { ma_ = prmt; sessionuserFirstName = sessionusr; }; function _po(TopmenupFlg) { mb_ = TopmenupFlg; }; function _pp(hm, wk, mob) { lx_ = hm; ly_ = wk; lz_ = mob; if (ma_ == 1) { _pq('home'); _pq('work'); _pq('mobile'); } }; function _pq(typ) { if (typ == 'home') { if (lx_ == 'True') { $('homeVerifiedSpan').style.display = 'inline'; $('linkhomeVerify').style.display = 'none'; } else { $('homeVerifiedSpan').style.display = 'none'; $('linkhomeVerify').style.display = 'inline'; } } else if (typ == 'work') { if (ly_ == 'True') { $('workVerifiedSpan').style.display = 'inline'; $('linkworkVerify').style.display = 'none'; } else { $('workVerifiedSpan').style.display = 'none'; $('linkworkVerify').style.display = 'inline'; } } else if (typ == 'mobile') { if (lz_ == 'True') { $('mobileVerifiedSpan').style.display = 'inline'; $('linkmobileVerify').style.display = 'none'; } else { $('mobileVerifiedSpan').style.display = 'none'; $('linkmobileVerify').style.display = 'inline'; } } }; function _pr(ph_cat) { _pu(ph_cat); enableTextBoxes(ph_cat); _qh(ph_cat); $('edit' + ph_cat + 'Span').style.display = 'none'; $('save' + ph_cat + 'Span').style.display = 'inline'; $('link' + ph_cat + 'Verify').style.display = 'none'; }; function _ps(ph_cat) { if (ph_cat == 'home') { $('editmobileSpan').style.display = 'inline'; $('savemobileSpan').style.display = 'none'; $('editworkSpan').style.display = 'inline'; $('saveworkSpan').style.display = 'none'; } else if (ph_cat == 'work') { $('editmobileSpan').style.display = 'inline'; $('savemobileSpan').style.display = 'none'; $('edithomeSpan').style.display = 'inline'; $('savehomeSpan').style.display = 'none'; } else if (ph_cat == 'mobile') { $('edithomeSpan').style.display = 'inline'; $('savehomeSpan').style.display = 'none'; $('editworkSpan').style.display = 'inline'; $('saveworkSpan').style.display = 'none'; } }; var mc_ = "";  var md_ = "";  var me_ = "";  function _pt(ptyp) { if (($(ptyp + 'TxtAreaCode').value).length < 3 || ($(ptyp + 'Txt').value).length < 7) { if (($(ptyp + 'TxtAreaCode').value).length < 3) { alert("Area code should contain atleast 3 digits."); } if (($(ptyp + 'Txt').value).length < 7) { alert(ptyp + " phone number should contain atleast 7 digits."); } return false; } else { return true; } }; function _pu(ph_cat) { if (ph_cat == 'home' || ph_cat == 'work') { if (ph_cat == 'home') { mc_ = $('homeTxtAreaCode').value + '-' + $('homeTxt').value; } else if (ph_cat == 'work') { md_ = $('workTxtAreaCode').value + '-' + $('workTxt').value; } } else if (ph_cat == 'mobile') { me_ = $('mobileTxt').value; } }; var mf_; function _pv(phno_typ, ctryCode, nmOfusr, phpwd, callOrsms, ln_, unm) { var phnumber; var par; var ph_pwd; mf_ = phno_typ; if (phno_typ == 1)   { $('homeCallSpan').style.display = 'none'; $('waithomeMsgSpan').style.display = 'inline'; phnumber = $('homeTxtAreaCode').value + '-' + $('homeTxt').value; ph_pwd = "&hmpwd=" + phpwd + "&mobopts=0"; } else if (phno_typ == 2)   { $('workCallSpan').style.display = 'none'; $('waitworkMsgSpan').style.display = 'inline'; phnumber = $('workTxtAreaCode').value + '-' + $('workTxt').value; ph_pwd = "&wrkPwd=" + phpwd + "&mobopts=0"; } else if (phno_typ == 3)   { $('mobileCallSpan').style.display = 'none'; $('waitmobileMsgSpan').style.display = 'inline'; phnumber = $('mobileTxt').value; ph_pwd = "&mobPwd=" + phpwd + "&mobopts=1";   callOrsms = 2; } if (phno_typ == 3 && ln_ == 2) { return false; } else { par = "phNumber=" + phnumber + "&phoneType=" + phno_typ + "&countrycode=" + ctryCode + "&username=" + unm + "&nameofUser=" + nmOfusr + "&countryId=" + ln_ + "&callOrSms=" + callOrsms + ph_pwd; var url = "verificationCall.aspx"; var ajx = new Ajax.Request ( url, { method: 'post', parameters: par, onSuccess: _pw, onFailure: _kb }); } }; function _pw(req) {   if (mf_ == 1) { typ = 'home'; } else if (mf_ == 2) { typ = 'work'; } else if (mf_ == 3) { typ = 'mobile'; } if (req.responseText == 0) { $('wait' + typ + 'MsgSpan').style.display = 'none'; $('sorry' + typ + 'MsgSpan').style.display = 'inline'; } }; var mg_; var mh_; function _px(codTxtId, pType, pwd) { mg_ = codTxtId; mh_ = pType; var url = "verifyPhNumber.aspx"; var phonePwd; phonePwd = $(codTxtId).value; var par; var p_pwd; if (pType == 1) { p_pwd = "&hmpwd=" + pwd; } else if (pType == 2) { p_pwd = "&wrkpwd=" + pwd; } else if (pType == 3) { p_pwd = "&mobpwd=" + pwd; } par = "phonePwd=" + phonePwd + "&phoneType=" + pType + p_pwd; if (isNaN(phonePwd) == false) { if (phonePwd != '') { var ajx = new Ajax.Request ( url, { method: 'post', parameters: par, onSuccess: _py, onFailure: _kb }); } else { alert("Verification Code can not be left blank."); return false; } } else { alert("Please enter numeric value only."); return false; } }; function _py(req) { var val1; val1 = req.responseText; userVerified = req.responseText; var ph_tp; if (val1 == 1) { if (mh_ == 1) { ph_tp = 'home'; lx_ = 'True'; } else if (mh_ == 2) { ph_tp = 'work'; ly_ = 'True'; } else if (mh_ == 3) { ph_tp = 'mobile'; lz_ = 'True'; } } if (val1 == 1) { alert("Congratulations!!! Now you are a verified user."); $('link' + ph_tp + 'Verify').style.display = 'none'; $(ph_tp + 'VerifiedSpan').style.display = 'inline'; $('linkTo' + ph_tp + 'VerifiedOrNot').style.display = 'inline';   _pq(ph_tp); _qa(ph_tp + 'Div', 'editSave' + ph_tp + 'Span'); _ou(); _pz(); } else if (val1 == 0) { document.getElementById(mg_).value = 'Invalid Code!'; } }; function _pz() { if (mb_ == 1) { if (lx_ == 'True' || ly_ == 'True' || lz_ == 'True') {   $('topMenu').innerHTML = '<a href="javascript:void(0);" id="myAppLink">' + kh_['MyAppointments'] + '</a> <a href="javascript:void(0);" onmousedown="_hq(430,455);_gr(\'update-signup.aspx\',\'\',\'addE\',\'get\',\'_mw\');overlay();">' + kh_['ModifyMyInformation'] + '</a> <a onmousedown="_gr(\'logout.aspx\',\'\',\'\',\'get\', \'_mr\')" href="javascript:void(0);">' + kh_['LogOut'] + '</a><a href="javascript:void(0);" onmousedown="_mu(1);overlay();">' + kh_['Verified'] + '</a>'; } else {   $('topMenu').innerHTML = '<a href="javascript:void(0);" id="myAppLink">' + kh_['MyAppointments'] + '</a> <a href="javascript:void(0);" onmousedown="_hq(430,455);_gr(\'update-signup.aspx\',\'\',\'addE\',\'get\',\'_mw\');overlay();">' + kh_['ModifyMyInformation'] + '</a> <a onmousedown="_gr(\'logout.aspx\',\'\',\'\',\'get\', \'_mr\')" href="javascript:void(0);">' + kh_['LogOut'] + '</a><a href="javascript:void(0);" onmousedown="_mu(1);overlay();">' + kh_['Unverified'] + '!</a>'; } } Behaviour.apply(); }; function _qa(divToClose, shweditSave) { var str1; str1 = divToClose.substring(0, (divToClose.length - 3)); $(divToClose).style.display = 'none';   $('wait' + str1 + 'MsgSpan').style.display = 'none'; $('sorry' + str1 + 'MsgSpan').style.display = 'none'; $(str1 + 'CallSpan').style.display = 'inline'; }; function _f(e) { var evt = e || window.event; var keynum; if (window.event)   { keynum = e.keyCode; if ((keynum < 47) || (keynum > 57)) { return false; } } if (evt.charCode != 0) { if (isNaN(String.fromCharCode(evt.charCode))) { return false; } } }; function _qb(msgVal, controlId) { if (msgVal == 'Invalid Code!') { document.getElementById(controlId).value = ''; } };   var mi_; var mj_; var mk_; function _qc(h1, w2, m3) { mi_ = h1; mj_ = w2; mk_ = m3; _qd(); }; function _qd() { if (mi_ != '-') { _qj('home'); } else { _qe('home'); } if (mj_ != '-') { _qj('work'); } else { _qe('work'); } if (mk_ != '') { _qj('mobile'); } else { _qe('mobile'); } }; function _qe(val) { if ($('link' + val + 'Verify')) $('link' + val + 'Verify').style.display = 'inline'; if ($(val + 'VerifiedSpan')) $(val + 'VerifiedSpan').style.display = 'none'; if ($('linkTo' + val + 'VerifiedOrNot')) $('linkTo' + val + 'VerifiedOrNot').style.display = 'none'; }; function _qf(ph_cat) {                 _qg(ph_cat);   _qh(ph_cat); if (ph_cat == 'home' || ph_cat == 'work') {   new Effect.Appear(ph_cat + 'Div'); $('linkTo' + ph_cat + 'VerifiedOrNot').style.display = 'none'; $('editSave' + ph_cat + 'Span').style.display = 'none'; } else if (ph_cat == 'mobile') {   new Effect.Appear('mobileDiv'); $('linkTomobileVerifiedOrNot').style.display = 'none'; $('editSavemobileSpan').style.display = 'none'; } }; function _qg(pty) { if (pty == 'home' || pty == 'work') { $('wait' + pty + 'MsgSpan').style.display = 'none'; $('sorry' + pty + 'MsgSpan').style.display = 'none'; $(pty + 'CallSpan').style.display = 'inline'; } else if (pty == 'mobile') { $('waitmobileMsgSpan').style.display = 'none'; $('sorrymobileMsgSpan').style.display = 'none'; $('mobileCallSpan').style.display = 'inline'; } }; function _qh(ph_cat) { if (ph_cat == 'home') { $('workDiv').style.display = 'none';   $('mobileDiv').style.display = 'none';   } else if (ph_cat == 'work') { $('homeDiv').style.display = 'none';   $('mobileDiv').style.display = 'none';   } else if (ph_cat == 'mobile') { $('homeDiv').style.display = 'none';   $('workDiv').style.display = 'none';   } }; function _qi(divToClose, shweditSave, lnk2Vry) { var str1 = divToClose.substring(0, (divToClose.length - 3));   new Effect.Fade(divToClose);   $(lnk2Vry).style.display = 'inline'; $('wait' + str1 + 'MsgSpan').style.display = 'none'; $('sorry' + str1 + 'MsgSpan').style.display = 'none'; $(str1 + 'CallSpan').style.display = 'inline'; }; function _qj(val) { if ($('link' + val + 'Verify')) $('link' + val + 'Verify').style.display = 'inline'; if ($(val + 'VerifiedSpan')) $(val + 'VerifiedSpan').style.display = 'none'; if ($('linkTo' + val + 'VerifiedOrNot')) $('linkTo' + val + 'VerifiedOrNot').style.display = 'inline'; }; function _qk(val) { $('editSave' + val + 'Span').style.display = 'inline'; $('linkTo' + val + 'VerifiedOrNot').style.display = 'none'; if ($(val + 'TxtAreaCode')) {   } }; var ml_; function save(val) { ml_ = val; var currentPhoneNumber; if (val == 'home') { currentPhoneNumber = $('homeTxtAreaCode').value + '-' + $('homeTxt').value; if (mi_ != currentPhoneNumber) { if (_qo(val)) { _ql(1, currentPhoneNumber); } } } else if (val == 'work') { currentPhoneNumber = $('workTxtAreaCode').value + '-' + $('workTxt').value; if (mj_ != currentPhoneNumber) { if (_qo(val)) { _ql(2, currentPhoneNumber); } } } else if (val == 'mobile') { currentPhoneNumber = $('mobileTxt').value; if (mk_ != currentPhoneNumber) { if (_qo(val)) { _ql(3, currentPhoneNumber); } } } }; function _ql(typ, phno1) { var mm_; if (typ == 3) { mm_ = 2; } else { mm_ = 0; } _qm(typ, phno1, mm_); _qp(); }; var mn_; function _qm(phone_Type, Number, mobOpt) { var url = "updateUsersPhoneInfo.aspx"; mn_ = phone_Type; var par = "phNum=" + Number + "&phoneType=" + phone_Type + "&mobopts=" + mobOpt; var ajx = new Ajax.Request ( url, { method: 'post', parameters: par, onSuccess: _qn, onFailure: _kb }); }; function _qn(req) { if (req.responseText == 1) { alert(kh_['updatedSuccessfully'] + "!"); if (mn_ == '1') { lx_ = 'False'; _pq('home'); } else if (mn_ == '2') { ly_ = 'False'; _pq('mobile'); } else if (mn_ == '3') { lz_ = 'False'; _pq('work'); } _pz(); } else if (req.responseText == 0) { alert(kh_['NumberCannotBeUpdated']); } }; function _qo(val) { var flg = 0; if (val != 'mobile') {   var areaCodeLen = ($(val + 'TxtAreaCode').value).length; var landLineNumLen = ($(val + 'Txt').value).length; if (areaCodeLen == 0) { alert('Area code cannot be empty'); return false; } if (areaCodeLen > 6) { alert('Maximum length for area code is 6'); return false; } if (landLineNumLen == 0) { alert('Phone number cannot be empty'); return false; } if (landLineNumLen > 15) { alert('Maximum length for phone number is 15'); return false; } } else {   var mobNumberLen = ($(val + 'Txt').value).length; if (mobNumberLen == 0) { alert('Mobile number cannot be empty'); return false; } if (mobNumberLen > 15) { alert('Maximum length for mobile number is 15'); return false; } } if (flg == 1) { return false; } else { return true; } }; function _qp() { if (ml_ != 'mobile') { if (ml_ == 'home') { if ($(ml_ + 'TxtAreaCode').value == '' && $(ml_ + 'Txt').value == '') { mi_ = '' + '-' + ''; } else { mi_ = $(ml_ + 'TxtAreaCode').value + '-' + $(ml_ + 'Txt').value; } } else if (ml_ == 'work') { if ($(ml_ + 'TxtAreaCode').value == '' && $(ml_ + 'Txt').value == '') { mj_ = '' + '-' + ''; } else { mj_ = $(ml_ + 'TxtAreaCode').value + '-' + $(ml_ + 'Txt').value; } } } else { mk_ = $(ml_ + 'Txt').value; } $('editSave' + ml_ + 'Span').style.display = 'none';   _qd(); }; function cancel(val) { $('editSave' + val + 'Span').style.display = 'none'; var tempPhAry = new Array(); if (val == 'home') { if (mi_ != '') { tempPhAry = mi_.split("-"); } else { tempPhAry = ['', '']; } } else if (val == 'work') { if (mj_ != '') { tempPhAry = mj_.split("-"); } else { tempPhAry = ['', '']; } } else if (val == 'mobile') { tempPhAry = ['', mk_]; } if ($(val + 'TxtAreaCode')) { $(val + 'TxtAreaCode').value = tempPhAry[0]; } $(val + 'Txt').value = tempPhAry[1]; $('linkTo' + val + 'VerifiedOrNot').style.display = 'inline';   _qq(val); }; function _qq(val) { if ($(val + 'TxtAreaCode')) { if ($(val + 'TxtAreaCode').value == '' && $(val + 'Txt').value == '') { $('editSave' + val + 'Span').style.display = 'none'; $('linkTo' + val + 'VerifiedOrNot').style.display = 'none'; } } else { if ($(val + 'Txt').value == '') { $('editSave' + val + 'Span').style.display = 'none'; $('linkTo' + val + 'VerifiedOrNot').style.display = 'none'; } } }; function _io(numberToRound) { var rnum = numberToRound; var rlength = 2;   if (rnum > 8191 && rnum < 10485) { rnum = rnum - 5000; var newnumber = Math.round(rnum * Math.pow(10, rlength)) / Math.pow(10, rlength); newnumber = newnumber + 5000; } else { var newnumber = Math.round(rnum * Math.pow(10, rlength)) / Math.pow(10, rlength); } newnumber = newnumber.toFixed(2); return newnumber; }; function changeSignupLoginButton(id) { obj=$(id); if (Element.hasClassName(obj,'formOnAppButtonMover')){ obj.addClassName('formOnAppButton'); obj.removeClassName('formOnAppButtonMover');   } else{ obj.addClassName('formOnAppButtonMover'); obj.removeClassName('formOnAppButton'); } }; function _qr() { $('leftBarHelp').innerHTML = ''; for (i in e_) { if (dj_.indexOf(e_[i][0]) != -1) { $('leftBarHelp').innerHTML += '&gt;' + e_[i][1] + '<br />'; } } if ($('leftBarHelp').innerHTML != '') { leftpos = 0; toppos = 0; followDiv = document.getElementById('choseServiceSpan'); aTag = followDiv; do { aTag = aTag.offsetParent; leftpos += aTag.offsetLeft; toppos += aTag.offsetTop; if (aTag.offsetParent == null) break; } while (aTag.tagName != "BODY"); $('helpContainer').style.left = followDiv.offsetLeft + followDiv.offsetWidth + leftpos + 25 + 'px'; $('helpContainer').style.top = followDiv.offsetTop + toppos + 'px'; $('helpContainer').style.display = 'block'; } else { $('helpContainer').style.display = 'none'; }   ll_ = true; }; function _qs() { var mo_ = getPageSize(); $('serviceListWhenNoLeftBar').style.display = 'block'; $('serviceListWhenNoLeftBar').style.height = 'auto'; if ($('serviceListWhenNoLeftBar').offsetWidth > 320) $('serviceListWhenNoLeftBar').style.width = '320px'; if ($('serviceListWhenNoLeftBar').offsetHeight > mo_[3]) $('serviceListWhenNoLeftBar').style.height = mo_[3] - 100 + 'px'; $('serviceListWhenNoLeftBar').style.display = 'none'; }; function _qt(id, val) { var chkValInput = trim($(id).value); if ((chkValInput == '') || (chkValInput == val)) { $(id).value = val; } }; function _qu(id, val) { var chkValInput = trim($(id).value); if ((chkValInput != '') && (chkValInput == val)) { $(id).value = ''; } }; function _qv(id, val) { var chkValInput = trim($(id).value); if ((chkValInput == '') || (chkValInput == val)) { $(id).innerHTML = val; } }; function _qw(id, val) { var chkValInput = trim($(id).value); if ((chkValInput != '') && (chkValInput == val)) { $(id).innerHTML = ''; } }; function setTimeOverNight_xh(t) { var d = ('12/12/2000 ' + t); var t = _x(d); return (t); }; function setDateOverNight_xh(d, i) { dt = Date.parse(d.toString()); var temp = 1000 * 3600 * parseInt(kq_); dt += temp; dt -= timeZonOfsetDiff * 60000; var temp2 = 1000 * 3600 * 24; dt %= temp2; if (dt < temp) i += 1; return i; }; function setDateTimeZoneDeff_xh(d, i) {             return i; }; var checkContactNo = ''; function validateContact() { var mobNO = trim($('mobile').value); var homeNO = trim($('homeph').value); var workNO = trim($('workph').value); var hCode = trim($('hCode').value); var wCode = trim($('wCode').value); if (((mobNO == '') || (mobNO == kh_['mobile'])) && ((homeNO == '') || (homeNO == kh_['imputHome'])) && ((workNO == '') || (workNO == kh_['inputWork']))) { checkContactNo = kh_['newUserPhValidation3']; return false; } if ((mobNO != '') && (mobNO != kh_['mobile'])) { if (funCheckdigit(mobNO)) { checkContactNo = kh_['newUserPhValidation1']; return false; } else { return true; } } if ((homeNO != '') && (homeNO != kh_['imputHome'])) { if (funCheckdigit(homeNO)) { checkContactNo = kh_['newUserPhValidation1']; return false; } else { if ((hCode == '') || (hCode == kh_['AreaCode'])) { checkContactNo = kh_['newUserPhValidation2']; return false; } else { if (funCheckdigit(hCode)) { checkContactNo = kh_['newUserPhValidation1']; return false; } else { return true; } } } } if ((workNO != '') && (workNO != kh_['inputWork'])) { if (funCheckdigit(workNO)) { checkContactNo = kh_['newUserPhValidation1']; return false; } else { if ((wCode == '') || (wCode == kh_['AreaCode'])) { checkContactNo = kh_['newUserPhValidation2']; return false; } else { if (funCheckdigit(wCode)) { checkContactNo = kh_['newUserPhValidation1']; return false; } else { return true; } } } } }; function funCheckdigit(textBoxVal) { var digitRegx = /^\d+$/; if (!(textBoxVal.match(digitRegx))) { return 1; } else { return 0; } }; var dx_ = 10 / ratioOFEff; function _iq() { objBody = $('addEBody'); obj = $('addE'); obj.style.visibility = 'hidden'; $('addE').style.width = 'auto'; $('addE').style.height = 'auto'; obj.style.visibility = 'visible'; var curH = obj.offsetHeight; var curW = obj.offsetWidth; var curSH = obj.scrollHeight; var curSW = obj.scrollWidth; var difW = parseInt((curSW - curW) / ratioOFEff); var difH = parseInt((curSH - curH) / ratioOFEff); var curL = objBody.offsetLeft; var curT = objBody.offsetTop; curW += parseInt((curSW - curW) % ratioOFEff); curH += parseInt((curSH - curH) % ratioOFEff);                     $('addEBody').style.left = ae_[2] / 2 - curW / 2 + 'px'; $('addEBody').style.top = ae_[3] / 2 - curH / 2 + 'px';  }; function _ir(objBody, obj, curW, curH, curSW, curSH, difW, difH, curL, curT) {         dx_ += 10 / ratioOFEff;     if (curW < curSW || curH < curSH) {     obj.style.width = curW + difW + 'px'; objBody.style.left = curL - difW / 2 + 'px';         obj.style.height = curH + difH + 'px'; objBody.style.top = curT - difH / 2 + 'px';     curW += difW; curH += difH; curL -= difW / 2; curT -= difH / 2; setTimeout(function() { _ir(objBody, obj, curW, curH, curSW, curSH, difW, difH, curL, curT); }, 10); } else { obj.style.visibility = 'visible'; $('addE').style.width = 'auto'; $('addE').style.height = 'auto'; dx_ = 10 / ratioOFEff; } }; function setEffectOpacity(obj, value) { obj.style.opacity = value / 10; obj.style.filter = 'alpha(opacity=' + value * 10 + ')'; }; function initSignupEff(LR) { $('SignupEffTd').className = 'signupScrollEff'; $('LoginEffTd').className = 'signupScrollEff'; $('SignupEffTdText').className = 'SignupEffTdTextHd'; $('LoginEffTdText').className = 'SignupEffTdTextHd'; if (LR == 1) { $('LoginEffTd').style.width = '1px'; $('LoginEffTdText').className = '';   } else { $('SignupEffTd').style.width = '1px'; $('SignupEffTdText').className = '';   } }; function showSignupEff() { initSignupEff(0); $('SignupEffTdText').className = 'SignupEffTdTextHd'; $('LoginEffTdText').className = 'SignupEffTdTextHd'; showEffect('LoginEffTd', 'SignupEffTd'); $('fname').focus(); }; function showLoginEff() { initSignupEff(1); $('SignupEffTdText').className = 'SignupEffTdTextHd'; $('LoginEffTdText').className = 'SignupEffTdTextHd'; showEffect('SignupEffTd', 'LoginEffTd'); $('uname').focus(); }; function showEffect(hDiv, sDiv) { sWd = $(sDiv).offsetWidth; hWd = $(hDiv).offsetWidth;     { $(hDiv + 'Text').className = ''; $(sDiv).className = '';     } $(hDiv).style.width = 1 + 'px';   if (hWd - 30 == 0) { $(hDiv).style.width = 1 + 'px'; }     $(sDiv).style.width = 480 + 'px';    }; function _qx(countryId) { if ($('CountryDdl')) { var countryCode = countryId; var countryC = allCountryCode_xh['Code' + countryCode]; if (countryC != 0) { $('mccode').innerHTML = countryC[0]; $('hccode').innerHTML = countryC[0]; $('wccode').innerHTML = countryC[0]; } else { $('mccode').innerHTML = ''; $('hccode').innerHTML = ''; $('wccode').innerHTML = ''; } } } function checkDiscountCouponSet(dt, tm, sr, st) { if (sr != '') { if ($('ap_mother_left_td').style.display != 'none') selectedSSAuto = $$('#barServicetext input[value="' + sr + '"]')[0]; else selectedSSAuto = $$('#serviceListWhenNoLeftBar input[value="' + sr + '"]')[0]; if (selectedSSAuto) { selectedSSAuto.checked = true; _gw(selectedSSAuto); } } if (st != '') { if ($('ap_mother_left_td').style.display != 'none') selectedSSTAuto = $$('#staffSelectionBody input[value="' + st + '"]')[0]; else selectedSSTAuto = $$('#staffListWhenNoLeftBar input[value="' + st + '"]')[0]; if (selectedSSTAuto) { var Obj = selectedSSTAuto; Obj.checked = true; _gv(Obj); } } if (tm != '') { $('appointTime').value = tm; clearTimeout(do_); do_ = setTimeout("checkTimeAndService()", 1000); } if (dt != '') { clearTimeout(do_); if (tm != '') { startAllServiceArray = (dj_.toString()).split(',');   startAllTimeArray = (dk_.toString()).split(',');   _gd(dt + ' ' + tm); $('appointTime').value = kh_['FullDay'];   } else _jy(dt) }  }; function _re(dt, tm, sr, st) {   var cn_ = new Date(dt); var i = cn_.getDate(); var m = cn_.getMonth(); var y = cn_.getFullYear(); var appAllowedDate = new Date(DateBeforAppCanBook); if (cn_ < appAllowedDate) { _hq(600, 350); overlay(); _by(i, eval(m + 1)); cw_ = i; cx_ = m; cy_ = y; cr_ = cx_ + 1 + '/' + cw_ + '/' + cy_; var newtDate = cr_ + ' ' + $('appointTime').value; var newtDate = cr_ + ' ' + tm; var tempdate = new Date(newtDate); cs_ = tempdate.getDay(); _hu(cr_); hj_ = new Date(tempdate); jt_.clear(); ju_.clear(); jv_.clear(); jx_.clear(); jw_.clear(); jn_ = (dj_.toString()).split(','); var asd = _bb(); if (asd) { var sendTime = new Array(); for (var j = 0; j < jw_.length; j++) { var changD = new Date(jw_[j]); sendTime.push(changD._cn()); } var serviceNameOnBook = new Array(); var serviceCostOnBook = new Array(); for (j = 0; j < jt_.length; j++) { var nm = e_['ser' + jt_[j]][1]; nm = nm.replace(/,/g, "~~>"); serviceNameOnBook.push(nm); serviceCostOnBook.push(e_['ser' + jt_[j]][3]); } dp_ = cr_; var url = 'checkAvalableAppointment.aspx'; par = 'apointmentText=' + jt_ + '&staffId=' + ju_ + '&startTime=' + sendTime + '&currentDate=' + dp_ + '&serviceNameOnBook=' + serviceNameOnBook + '&serviceCostOnBook=' + serviceCostOnBook; dq_ = i; var ajx = new Ajax.Updater( 'addE', url, { method: 'post', parameters: par, evalScripts: true, onFailure: _kb } ); } else { alert("Sorry.\n Someone else booked this time while you were selecting time slot. Go back and check other time.");         noOverlay(); $('addEBody').style.display = 'none'; } } else { _hq(250, 80); overlay(); $('addE').innerHTML = $('appNotAll').innerHTML; $('addEBody').style.display = 'block'; } }; function _qy() { $('applyDisLink').style.display = 'none'; $('applyDisLoad').innerHTML = kh_['PleaseWait'] + '...<img src="Images/rotatingArrow.gif" />'; $('applyDisLoad').style.display = 'inline'; if(wr_) { var yl_=new Array(); var ym_=new Array(); var yn_=new Array(); var yo_=new Array(); var yx_=new Array(); for(var i=0;i<xq_.length;i++) { if(xq_[i][4]==1) continue; yl_.push(xq_[i][0]); ym_.push(xq_[i][1]); yn_.push(xq_[i][3]); yo_.push(xq_[i][2]); var yk_=e_['ser'+xq_[i][0]]; yx_.push(yk_[3]); } var mp_ = yl_; var mq_ = ym_; var mr_ = yn_; var ms_ = yo_; var mt_ = $('dis_TotCost').value; var mu_ = $('discountCodeOnBook').value; var mv_ = yx_; var url = 'checkDiscountCodeNewForRecuring.aspx'; } else { var mp_ = $('dis_serviceId').value; var mq_ = $('dis_staffId').value; var mr_ = $('dis_Stime').value; var ms_ = $('dis_AppDate').value; var mt_ = $('dis_TotCost').value; var mu_ = $('discountCodeOnBook').value; var mv_ = $('dis_SerCostStr').value; var url = 'checkDiscountCodeNew.aspx'; } par = 'apointmentText=' + mp_ + '&staffId=' + mq_ + '&startTime=' + mr_ + '&currentDate=' + ms_ + '&costOfService=' + mt_ + '&dis_Code=' + mu_ + '&dis_serCost=' + mv_; var ajx = new Ajax.Updater( 'discountTempDiv', url, { method: 'post', parameters: par, evalScripts: true, onFailure: _kb } ); }; function _qz(serviceDuration) { var durationStr = ''; if (serviceDuration >= 60) { if ((serviceDuration % 60) != 0) { durationStr = (parseInt(serviceDuration / 60)) + 'h ' + (serviceDuration % 60) + 'm'; } else { durationStr = (parseInt(serviceDuration / 60)) + 'h'; } } else { durationStr = serviceDuration + 'm'; } return durationStr; }; function _rj() {   var url = 'PostTwitter.aspx'; var par = ''; _rm(); var ajx = new Ajax.Updater( 'mashuppanel', url, { method: 'post', parameters: par, evalScripts: true, onFailure: _kb } ); } function _rk(Ischeked) {   var chkdontask = ''; if (Ischeked) { chkdontask = Ischeked; } var url = 'PostTwitter.aspx'; var par = 'action=posttweet' + '&chkdontask=' + chkdontask; _rm(); var ajx = new Ajax.Updater( 'mashuppanel', url, { method: 'post', parameters: par, evalScripts: true, onFailure: _kb } ); } function _rl() {   var username = $('username').value; var password = $('password').value; var chkdontask = $('chkdontask').checked; var url = 'PostTwitter.aspx'; var par = 'action=savetwitterinfo&username=' + username + '&password=' + password + '&chkdontask=' + chkdontask; var ajx = new Ajax.Updater( 'mashuppanel', url, { method: 'post', parameters: par, evalScripts: true, onFailure: _kb } ); _rm(); } function _rm() { $("mashuppanel").innerHTML = "<img src='Images/loading-anim.gif' />"; $("mashuppanel").style.display = "block"; }; function _ra() { overlay(); var str=''; str+='<div class="macErr">'; str+=' <table cellpadding="0" cellspacing="0" border="0" width="100%">'; str+=' <tr>'; str+=' <td>'; str+=' OOPS ! It seems that third party cookies are not enabled on your browser. It generally'; str+=' happens on MAC.<br />'; str+=' <br />'; str+=' <b>Do the following to fix it.</b>'; str+=' <br />'; str+=' <br />'; str+=' <b>1.</b> Select to accept third party cookies from websites from browser preferences'; str+=' or'; str+=' <br />'; str+=' <br />'; str+=' <b>2.</b> Go to our direct scheduling page <a href="http:\/\/'+document.domain+'"'; str+=' target="_parent">http:\/\/'+document.domain+'</a> and book your appointment.'; str+=' </td>'; str+=' </tr>'; str+=' </table>'; str+='</div>'; $('addE').innerHTML = str; _iq(); }; function __acn(obj) { window.location.href=('http:\/\/'+obj.value+'.appointy.com'); } function __acm() { $$('div.locationTpDCl').each(function(obj) { $(obj).onmouseover= function() { obj.addClassName('locationTpD'); }; $(obj).onmouseout= function() { obj.removeClassName('locationTpD'); }; }); } function __ael() { if(se_.length>0) { var rz_ = $$('.custominput'); if(rz_.length>0) { var sa_=rz_[0]; var initVal=''; if(sa_.tagName.toLowerCase()=='input') { if(sa_.type.toLowerCase()=='text') { sa_.onclick=function(){__aem(se_,sa_)}; } else if(sa_.type.toLowerCase()=='radio') { var rdObj=document.getElementsByName(sa_.name); for(var k=0;k<rdObj.length;k++) { rdObj[k].onclick=function(){__aeo(this.value);}; } } else if(sa_.type.toLowerCase()=='checkbox') { initVal='no'; sa_.onclick=function(){ if(sa_.checked) __aeo('yes'); else __aeo('no'); }; } } else if(sa_.tagName.toLowerCase()=='select') { initVal=sa_.value; sa_.onchange=function(){ __aeo(this.value); } } __aeo(initVal); } } } var gObj=''; var gArr; function __aem(arr,obj) { __aen(); _aba(); gArr=arr; gObj=obj; var searchVal=obj.value; pat='(^'+searchVal+')|([\b]*'+searchVal+')';   var patt1=new RegExp(pat,'ig'); var i=0; var len=arr.length; var ddStr=''; var isNorArr=false; var testStr=''; var isFirst=true; for(;i<len;i++) { isNorArr=true; testStr=arr[i][3]; if(searchVal==''||patt1.test(testStr)) { var extCl=''; if(isFirst) extCl='activeSearchRst'; isFirst=false; if(searchVal!='') testStr= testStr.replace(patt1, '<span class="searchStr">'+searchVal+'</span>'); ddStr+='<div class="updateTmdiv '+extCl+'" id="updateTmdivsN'+i+'" >'+testStr+'</div>'; } } if(!isNorArr) { for(i in arr) { if(!arr.hasOwnProperty(i)) continue; testStr=arr[i][1]; if(searchVal==''||patt1.test(testStr)) { var extCl=''; if(isFirst) extCl='activeSearchRst'; isFirst=false; if(searchVal!='') testStr= testStr.replace(patt1, '<span class="searchStr">'+searchVal+'</span>'); ddStr+='<div class="updateTmdiv '+extCl+'" id="updateTmdiv'+arr[i][0]+'sN'+i+'" >'+testStr+'</div>'; } } } _abb(obj); _aaz(); if(ddStr=='') _aba(); $("ddParentBox").innerHTML=ddStr; $("ddParentBox").style.height='auto'; $("ddParentBox").style.width='auto'; if($("ddParentBox").offsetHeight>100) { $("ddParentBox").style.height=100+'px'; } if($("ddParentBox").offsetWidth<150) { $("ddParentBox").style.width=150+'px'; }   Event.stopObserving(obj, 'blur', _aav);   Event.observe(obj, 'blur', _aav, false); obj.onkeyup=function(e){ var e = (window.event) ? event : e; return _aaw(e); }; obj.onkeydown=function(e){ var KeyID = (window.event) ? event.keyCode : e.keyCode; if(KeyID==13) { _aau(); return false; } }; _gj(dd_); }; function _aav() {           _aba(); __aeo(gObj.value); }; function _aau() { setObj=$$('div.activeSearchRst')[0]; if(setObj) setValueInBox($$('div.activeSearchRst')[0]); _aba(); gObj.blur(); }; function setValueInBox(obj){ var oId=((obj.id).split('updateTmdiv')[1]).split('sN'); gObj.value=gArr[oId[1]][3];    _aba(); }; function _aaz() { $("ddParentBox").style.display=''; }; function _aba() { $("ddParentBox").style.display='none'; }; function _aaw(e) { var KeyID = (window.event) ? event.keyCode : e.keyCode; switch(KeyID) { case 38: _aax(); break; case 40: _aay(); break; default: __aem(gArr,gObj); } }; function _aax() { var actObj=$$('div.activeSearchRst')[0]; if(actObj) { var pObj=actObj.previousSibling; if(pObj) { Element.removeClassName(actObj,'activeSearchRst'); Element.addClassName(pObj,'activeSearchRst'); if(pObj.offsetTop-$("ddParentBox").scrollTop<0) { $("ddParentBox").scrollTop+=pObj.offsetTop-$("ddParentBox").scrollTop; } } } }; function _aay() { var actObj=$$('div.activeSearchRst')[0]; if(actObj) { var nObj=actObj.nextSibling; if(nObj) { Element.removeClassName(actObj,'activeSearchRst'); Element.addClassName(nObj,'activeSearchRst'); if(nObj.offsetTop-($("ddParentBox").scrollTop+$("ddParentBox").offsetHeight-2)>=0) { $("ddParentBox").scrollTop+=nObj.offsetHeight+nObj.offsetTop-($("ddParentBox").scrollTop+$("ddParentBox").offsetHeight-2); } } } }; function _abb(obj) { var leftpos = 0; var toppos = 0; aTag = obj; do { aTag = aTag.offsetParent; leftpos += aTag.offsetLeft; toppos += aTag.offsetTop; if (aTag.offsetParent == null) break; } while (aTag.id != "body"); $('ddParentBox').style.left = obj.offsetLeft + leftpos + 'px'; $('ddParentBox').style.top = obj.offsetTop + obj.offsetHeight + toppos + 'px'; $('ddParentBox').style.display = 'block'; }; function __aen() { if(!$("ddParentBox")) { var objBody = document.getElementsByTagName("body").item(0); var objddParent = document.createElement("div"); objddParent.setAttribute('id', 'ddParentBox'); objddParent.style.display = 'none'; objBody.appendChild(objddParent); } }; function __aeo(val) { if(se_.length>0) { var rz_ = $$('.custominput'); for(var i=0;i<se_.length;i++) { if(se_[i][3].toLowerCase()==val.toLowerCase()) { var optVal=se_[i][4].split('#||#'); for(var j=0,k=0;j<rz_.length && k<optVal.length;k++) { sa_=rz_[j]; var sb_=trim(optVal[k].split('-')[1]); if(sa_.tagName.toLowerCase()=='input') { if(sa_.type.toLowerCase()=='text') { sa_.value=sb_; j++; } else if(sa_.type.toLowerCase()=='radio') { var sc_=document.getElementsByName(sa_.name); for(var l=0;l<sc_.length;l++) { if(sb_==sc_[l].value) sc_[l].checked=true; j++; } } else if(sa_.type.toLowerCase()=='checkbox') { if(sb_.toLowerCase()=='yes') sa_.checked=true; else sa_.checked=false; j++; } } else if(sa_.tagName.toLowerCase()=='select') { var mylen=sa_.getElementsByTagName('option').length; for (var x = 0; x < mylen; x++) { if (sa_.options[x].value == sb_) { sa_.selectedIndex = x; } } j++; } } } } } }; function __aeb(appId) { var w = screen.width; var h = screen.height; var url = "printOrderReceiptByAppointmentId.aspx?appId="+appId; window.open (url,"mywindow","menubar=0,resizable=0,width="+w+",height="+h+",top=0,left=0"); }; function MM_findObj(n, d) { var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; }; function YY_checkform() { var a=YY_checkform.arguments,oo=true,v='',s='',err=false,r,o,at,o1,t,i,j,ma,rx,cd,cm,cy,dte,at; for (i=1; i<a.length;i=i+4){ if (a[i+1].charAt(0)=='#'){r=true; a[i+1]=a[i+1].substring(1);}else{r=false} o=MM_findObj(a[i].replace(/\[\d+\]/ig,"")); o1=MM_findObj(a[i+1].replace(/\[\d+\]/ig,"")); if(o==null){continue;} v=o.value;t=a[i+2]; if (o.type=='text'||o.type=='password'||o.type=='hidden'){ if (r&&v.length==0){err=true} if (v.length>0) if (t==1){ ma=a[i+1].split('_');if(isNaN(v)||v<ma[0]/1||v > ma[1]/1){err=true} } else if (t==2){ rx=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-zA-Z]{2,4}$");if(!rx.test(v))err=true; } else if (t==3){ ma=a[i+1].split("#");at=v.match(ma[0]); if(at){ cd=(at[ma[1]])?at[ma[1]]:1;cm=at[ma[2]]-1;cy=at[ma[3]]; dte=new Date(cy,cm,cd); if(dte.getFullYear()!=cy||dte.getDate()!=cd||dte.getMonth()!=cm){err=true}; }else{err=true} } else if (t==4){ ma=a[i+1].split("#");at=v.match(ma[0]);if(!at){err=true} } else if (t==5){ if(o1.length)o1=o1[a[i+1].replace(/(.*\[)|(\].*)/ig,"")]; if(!o1.checked){err=true} } else if (t==6){ if(v!=MM_findObj(a[i+1]).value){err=true} } } else if (!o.type&&o.length>0&&o[0].type=='radio'){ at = a[i].match(/(.*)\[(\d+)\].*/i); o2=(o.length>1)?o[at[2]]:o; if (t==1&&o2&&o2.checked&&o1&&o1.value.length/1==0){err=true} if (t==2){ oo=false; for(j=0;j<o.length;j++){oo=oo||o[j].checked} if(!oo){s+='* '+a[i+3]+'\n'} } } else if (o.type=='checkbox'){ if((t==1&&o.checked==false)||(t==2&&o.checked&&o1&&o1.value.length/1==0)){err=true} } else if (o.type=='select-one'||o.type=='select-multiple'){ if(t==1&&o.selectedIndex/1==0){err=true} }else if (o.type=='textarea'){ if(v.length<a[i+1]){err=true} } if (err){s+='* '+a[i+3]+'\n'; err=false} } if (s!=''){alert('The required information is incomplete or contains errors:\t\t\t\t\t\n\n'+s)} document.MM_returnValue = (s==''); if (document.MM_returnValue==true) _mx(); }; function YY_checkformUpdate() { var a=YY_checkformUpdate.arguments,oo=true,v='',s='',err=false,r,o,at,o1,t,i,j,ma,rx,cd,cm,cy,dte,at; for (i=1; i<a.length;i=i+4){ if (a[i+1].charAt(0)=='#'){r=true; a[i+1]=a[i+1].substring(1);}else{r=false} o=MM_findObj(a[i].replace(/\[\d+\]/ig,"")); o1=MM_findObj(a[i+1].replace(/\[\d+\]/ig,"")); v=o.value;t=a[i+2]; if (o.type=='text'||o.type=='password'||o.type=='hidden'){ if (r&&v.length==0){err=true} if (v.length>0) if (t==1){ ma=a[i+1].split('_');if(isNaN(v)||v<ma[0]/1||v > ma[1]/1){err=true} } else if (t==2){ rx=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-zA-Z]{2,4}$");if(!rx.test(v))err=true; } else if (t==3){ ma=a[i+1].split("#");at=v.match(ma[0]); if(at){ cd=(at[ma[1]])?at[ma[1]]:1;cm=at[ma[2]]-1;cy=at[ma[3]]; dte=new Date(cy,cm,cd); if(dte.getFullYear()!=cy||dte.getDate()!=cd||dte.getMonth()!=cm){err=true}; }else{err=true} } else if (t==4){ ma=a[i+1].split("#");at=v.match(ma[0]);if(!at){err=true} } else if (t==5){ if(o1.length)o1=o1[a[i+1].replace(/(.*\[)|(\].*)/ig,"")]; if(!o1.checked){err=true} } else if (t==6){ if(v!=MM_findObj(a[i+1]).value){err=true} } } else if (!o.type&&o.length>0&&o[0].type=='radio'){ at = a[i].match(/(.*)\[(\d+)\].*/i); o2=(o.length>1)?o[at[2]]:o; if (t==1&&o2&&o2.checked&&o1&&o1.value.length/1==0){err=true} if (t==2){ oo=false; for(j=0;j<o.length;j++){oo=oo||o[j].checked} if(!oo){s+='* '+a[i+3]+'\n'} } } else if (o.type=='checkbox'){ if((t==1&&o.checked==false)||(t==2&&o.checked&&o1&&o1.value.length/1==0)){err=true} } else if (o.type=='select-one'||o.type=='select-multiple'){ if(t==1&&o.selectedIndex/1==0){err=true} }else if (o.type=='textarea'){ if(v.length<a[i+1]){err=true} } if (err){s+='* '+a[i+3]+'\n'; err=false} } if (s!=''){alert('The required information is incomplete or contains errors:\t\t\t\t\t\n\n'+s)} document.MM_returnValue = (s==''); if (document.MM_returnValue==true) _ms(); }; 
 
 
function xh_toggleAppAndTerm()
{
    if($('appointmentScreen').style.display=='block')
    {
        $('appointmentScreen').style.display='none';
        $('termsAndConditionScreen').style.display='block';
    }
    else
    {
        $('appointmentScreen').style.display='block';
        $('termsAndConditionScreen').style.display='none';
    }
};