/*
 * jQuery JavaScript Library v1.3.2
 * http://jquery.com/
 *
 * Copyright (c) 2009 John Resig
 * Dual licensed under the MIT and GPL licenses.
 * http://docs.jquery.com/License
 *
 * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
 * Revision: 6246
 */
(function(){var window=this,undefined,_jQuery=window.jQuery,_$=window.$,jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context)
},quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,isSimple=/^.[^:#\[\.,]*$/;
jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;
if(selector.nodeType){this[0]=selector;
this.length=1;
this.context=selector;
return this
}if(typeof selector==="string"){var match=quickExpr.exec(selector);
if(match&&(match[1]||!context)){if(match[1]){selector=jQuery.clean([match[1]],context)
}else{var elem=document.getElementById(match[3]);
if(elem&&elem.id!=match[3]){return jQuery().find(selector)
}var ret=jQuery(elem||[]);
ret.context=document;
ret.selector=selector;
return ret
}}else{return jQuery(context).find(selector)
}}else{if(jQuery.isFunction(selector)){return jQuery(document).ready(selector)
}}if(selector.selector&&selector.context){this.selector=selector.selector;
this.context=selector.context
}return this.setArray(jQuery.isArray(selector)?selector:jQuery.makeArray(selector))
},selector:"",jquery:"1.3.2",size:function(){return this.length
},get:function(num){return num===undefined?Array.prototype.slice.call(this):this[num]
},pushStack:function(elems,name,selector){var ret=jQuery(elems);
ret.prevObject=this;
ret.context=this.context;
if(name==="find"){ret.selector=this.selector+(this.selector?" ":"")+selector
}else{if(name){ret.selector=this.selector+"."+name+"("+selector+")"
}}return ret
},setArray:function(elems){this.length=0;
Array.prototype.push.apply(this,elems);
return this
},each:function(callback,args){return jQuery.each(this,callback,args)
},index:function(elem){return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this)
},attr:function(name,value,type){var options=name;
if(typeof name==="string"){if(value===undefined){return this[0]&&jQuery[type||"attr"](this[0],name)
}else{options={};
options[name]=value
}}return this.each(function(i){for(name in options){jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name))
}})
},css:function(key,value){if((key=="width"||key=="height")&&parseFloat(value)<0){value=undefined
}return this.attr(key,value,"curCSS")
},text:function(text){if(typeof text!=="object"&&text!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text))
}var ret="";
jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8){ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this])
}})
});
return ret
},wrapAll:function(html){if(this[0]){var wrap=jQuery(html,this[0].ownerDocument).clone();
if(this[0].parentNode){wrap.insertBefore(this[0])
}wrap.map(function(){var elem=this;
while(elem.firstChild){elem=elem.firstChild
}return elem
}).append(this)
}return this
},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html)
})
},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html)
})
},append:function(){return this.domManip(arguments,true,function(elem){if(this.nodeType==1){this.appendChild(elem)
}})
},prepend:function(){return this.domManip(arguments,true,function(elem){if(this.nodeType==1){this.insertBefore(elem,this.firstChild)
}})
},before:function(){return this.domManip(arguments,false,function(elem){this.parentNode.insertBefore(elem,this)
})
},after:function(){return this.domManip(arguments,false,function(elem){this.parentNode.insertBefore(elem,this.nextSibling)
})
},end:function(){return this.prevObject||jQuery([])
},push:[].push,sort:[].sort,splice:[].splice,find:function(selector){if(this.length===1){var ret=this.pushStack([],"find",selector);
ret.length=0;
jQuery.find(selector,this[0],ret);
return ret
}else{return this.pushStack(jQuery.unique(jQuery.map(this,function(elem){return jQuery.find(selector,elem)
})),"find",selector)
}},clone:function(events){var ret=this.map(function(){if(!jQuery.support.noCloneEvent&&!jQuery.isXMLDoc(this)){var html=this.outerHTML;
if(!html){var div=this.ownerDocument.createElement("div");
div.appendChild(this.cloneNode(true));
html=div.innerHTML
}return jQuery.clean([html.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]
}else{return this.cloneNode(true)
}});
if(events===true){var orig=this.find("*").andSelf(),i=0;
ret.find("*").andSelf().each(function(){if(this.nodeName!==orig[i].nodeName){return 
}var events=jQuery.data(orig[i],"events");
for(var type in events){for(var handler in events[type]){jQuery.event.add(this,type,events[type][handler],events[type][handler].data)
}}i++
})
}return ret
},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i)
})||jQuery.multiFilter(selector,jQuery.grep(this,function(elem){return elem.nodeType===1
})),"filter",selector)
},closest:function(selector){var pos=jQuery.expr.match.POS.test(selector)?jQuery(selector):null,closer=0;
return this.map(function(){var cur=this;
while(cur&&cur.ownerDocument){if(pos?pos.index(cur)>-1:jQuery(cur).is(selector)){jQuery.data(cur,"closest",closer);
return cur
}cur=cur.parentNode;
closer++
}})
},not:function(selector){if(typeof selector==="string"){if(isSimple.test(selector)){return this.pushStack(jQuery.multiFilter(selector,this,true),"not",selector)
}else{selector=jQuery.multiFilter(selector,this)
}}var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;
return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector
})
},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector==="string"?jQuery(selector):jQuery.makeArray(selector))))
},is:function(selector){return !!selector&&jQuery.multiFilter(selector,this).length>0
},hasClass:function(selector){return !!selector&&this.is("."+selector)
},val:function(value){if(value===undefined){var elem=this[0];
if(elem){if(jQuery.nodeName(elem,"option")){return(elem.attributes.value||{}).specified?elem.value:elem.text
}if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";
if(index<0){return null
}for(var i=one?index:0,max=one?index+1:options.length;
i<max;
i++){var option=options[i];
if(option.selected){value=jQuery(option).val();
if(one){return value
}values.push(value)
}}return values
}return(elem.value||"").replace(/\r/g,"")
}return undefined
}if(typeof value==="number"){value+=""
}return this.each(function(){if(this.nodeType!=1){return 
}if(jQuery.isArray(value)&&/radio|checkbox/.test(this.type)){this.checked=(jQuery.inArray(this.value,value)>=0||jQuery.inArray(this.name,value)>=0)
}else{if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);
jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0)
});
if(!values.length){this.selectedIndex=-1
}}else{this.value=value
}}})
},html:function(value){return value===undefined?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(value)
},replaceWith:function(value){return this.after(value).remove()
},eq:function(i){return this.slice(i,+i+1)
},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))
},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem)
}))
},andSelf:function(){return this.add(this.prevObject)
},domManip:function(args,table,callback){if(this[0]){var fragment=(this[0].ownerDocument||this[0]).createDocumentFragment(),scripts=jQuery.clean(args,(this[0].ownerDocument||this[0]),fragment),first=fragment.firstChild;
if(first){for(var i=0,l=this.length;
i<l;
i++){callback.call(root(this[i],first),this.length>1||i>0?fragment.cloneNode(true):fragment)
}}if(scripts){jQuery.each(scripts,evalScript)
}}return this;
function root(elem,cur){return table&&jQuery.nodeName(elem,"table")&&jQuery.nodeName(cur,"tr")?(elem.getElementsByTagName("tbody")[0]||elem.appendChild(elem.ownerDocument.createElement("tbody"))):elem
}}};
jQuery.fn.init.prototype=jQuery.fn;
function evalScript(i,elem){if(elem.src){jQuery.ajax({url:elem.src,async:false,dataType:"script"})
}else{jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"")
}if(elem.parentNode){elem.parentNode.removeChild(elem)
}}function now(){return +new Date
}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;
if(typeof target==="boolean"){deep=target;
target=arguments[1]||{};
i=2
}if(typeof target!=="object"&&!jQuery.isFunction(target)){target={}
}if(length==i){target=this;
--i
}for(;
i<length;
i++){if((options=arguments[i])!=null){for(var name in options){var src=target[name],copy=options[name];
if(target===copy){continue
}if(deep&&copy&&typeof copy==="object"&&!copy.nodeType){target[name]=jQuery.extend(deep,src||(copy.length!=null?[]:{}),copy)
}else{if(copy!==undefined){target[name]=copy
}}}}}return target
};
var exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,defaultView=document.defaultView||{},toString=Object.prototype.toString;
jQuery.extend({noConflict:function(deep){window.$=_$;
if(deep){window.jQuery=_jQuery
}return jQuery
},isFunction:function(obj){return toString.call(obj)==="[object Function]"
},isArray:function(obj){return toString.call(obj)==="[object Array]"
},isXMLDoc:function(elem){return elem.nodeType===9&&elem.documentElement.nodeName!=="HTML"||!!elem.ownerDocument&&jQuery.isXMLDoc(elem.ownerDocument)
},globalEval:function(data){if(data&&/\S/.test(data)){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");
script.type="text/javascript";
if(jQuery.support.scriptEval){script.appendChild(document.createTextNode(data))
}else{script.text=data
}head.insertBefore(script,head.firstChild);
head.removeChild(script)
}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase()
},each:function(object,callback,args){var name,i=0,length=object.length;
if(args){if(length===undefined){for(name in object){if(callback.apply(object[name],args)===false){break
}}}else{for(;
i<length;
){if(callback.apply(object[i++],args)===false){break
}}}}else{if(length===undefined){for(name in object){if(callback.call(object[name],name,object[name])===false){break
}}}else{for(var value=object[0];
i<length&&callback.call(value,i,value)!==false;
value=object[++i]){}}}return object
},prop:function(elem,value,type,i,name){if(jQuery.isFunction(value)){value=value.call(elem,i)
}return typeof value==="number"&&type=="curCSS"&&!exclude.test(name)?value+"px":value
},className:{add:function(elem,classNames){jQuery.each((classNames||"").split(/\s+/),function(i,className){if(elem.nodeType==1&&!jQuery.className.has(elem.className,className)){elem.className+=(elem.className?" ":"")+className
}})
},remove:function(elem,classNames){if(elem.nodeType==1){elem.className=classNames!==undefined?jQuery.grep(elem.className.split(/\s+/),function(className){return !jQuery.className.has(classNames,className)
}).join(" "):""
}},has:function(elem,className){return elem&&jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1
}},swap:function(elem,options,callback){var old={};
for(var name in options){old[name]=elem.style[name];
elem.style[name]=options[name]
}callback.call(elem);
for(var name in options){elem.style[name]=old[name]
}},css:function(elem,name,force,extra){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];
function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;
if(extra==="border"){return 
}jQuery.each(which,function(){if(!extra){val-=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0
}if(extra==="margin"){val+=parseFloat(jQuery.curCSS(elem,"margin"+this,true))||0
}else{val-=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0
}})
}if(elem.offsetWidth!==0){getWH()
}else{jQuery.swap(elem,props,getWH)
}return Math.max(0,Math.round(val))
}return jQuery.curCSS(elem,name,force)
},curCSS:function(elem,name,force){var ret,style=elem.style;
if(name=="opacity"&&!jQuery.support.opacity){ret=jQuery.attr(style,"opacity");
return ret==""?"1":ret
}if(name.match(/float/i)){name=styleFloat
}if(!force&&style&&style[name]){ret=style[name]
}else{if(defaultView.getComputedStyle){if(name.match(/float/i)){name="float"
}name=name.replace(/([A-Z])/g,"-$1").toLowerCase();
var computedStyle=defaultView.getComputedStyle(elem,null);
if(computedStyle){ret=computedStyle.getPropertyValue(name)
}if(name=="opacity"&&ret==""){ret="1"
}}else{if(elem.currentStyle){var camelCase=name.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase()
});
ret=elem.currentStyle[name]||elem.currentStyle[camelCase];
if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;
elem.runtimeStyle.left=elem.currentStyle.left;
style.left=ret||0;
ret=style.pixelLeft+"px";
style.left=left;
elem.runtimeStyle.left=rsLeft
}}}}return ret
},clean:function(elems,context,fragment){context=context||document;
if(typeof context.createElement==="undefined"){context=context.ownerDocument||context[0]&&context[0].ownerDocument||document
}if(!fragment&&elems.length===1&&typeof elems[0]==="string"){var match=/^<(\w+)\s*\/?>$/.exec(elems[0]);
if(match){return[context.createElement(match[1])]
}}var ret=[],scripts=[],div=context.createElement("div");
jQuery.each(elems,function(i,elem){if(typeof elem==="number"){elem+=""
}if(!elem){return 
}if(typeof elem==="string"){elem=elem.replace(/(<(\w+)[^>]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+"></"+tag+">"
});
var tags=elem.replace(/^\s+/,"").substring(0,10).toLowerCase();
var wrap=!tags.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!tags.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!tags.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!tags.indexOf("<td")||!tags.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!jQuery.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];
div.innerHTML=wrap[1]+elem+wrap[2];
while(wrap[0]--){div=div.lastChild
}if(!jQuery.support.tbody){var hasBody=/<tbody/i.test(elem),tbody=!tags.indexOf("<table")&&!hasBody?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&!hasBody?div.childNodes:[];
for(var j=tbody.length-1;
j>=0;
--j){if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length){tbody[j].parentNode.removeChild(tbody[j])
}}}if(!jQuery.support.leadingWhitespace&&/^\s/.test(elem)){div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild)
}elem=jQuery.makeArray(div.childNodes)
}if(elem.nodeType){ret.push(elem)
}else{ret=jQuery.merge(ret,elem)
}});
if(fragment){for(var i=0;
ret[i];
i++){if(jQuery.nodeName(ret[i],"script")&&(!ret[i].type||ret[i].type.toLowerCase()==="text/javascript")){scripts.push(ret[i].parentNode?ret[i].parentNode.removeChild(ret[i]):ret[i])
}else{if(ret[i].nodeType===1){ret.splice.apply(ret,[i+1,0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))))
}fragment.appendChild(ret[i])
}}return scripts
}return ret
},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8){return undefined
}var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined;
name=notxml&&jQuery.props[name]||name;
if(elem.tagName){var special=/href|src|style/.test(name);
if(name=="selected"&&elem.parentNode){elem.parentNode.selectedIndex
}if(name in elem&&notxml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode){throw"type property can't be changed"
}elem[name]=value
}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name)){return elem.getAttributeNode(name).nodeValue
}if(name=="tabIndex"){var attributeNode=elem.getAttributeNode("tabIndex");
return attributeNode&&attributeNode.specified?attributeNode.value:elem.nodeName.match(/(button|input|object|select|textarea)/i)?0:elem.nodeName.match(/^(a|area)$/i)&&elem.href?0:undefined
}return elem[name]
}if(!jQuery.support.style&&notxml&&name=="style"){return jQuery.attr(elem.style,"cssText",value)
}if(set){elem.setAttribute(name,""+value)
}var attr=!jQuery.support.hrefNormalized&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);
return attr===null?undefined:attr
}if(!jQuery.support.opacity&&name=="opacity"){if(set){elem.zoom=1;
elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+""=="NaN"?"":"alpha(opacity="+value*100+")")
}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+"":""
}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase()
});
if(set){elem[name]=value
}return elem[name]
},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"")
},makeArray:function(array){var ret=[];
if(array!=null){var i=array.length;
if(i==null||typeof array==="string"||jQuery.isFunction(array)||array.setInterval){ret[0]=array
}else{while(i){ret[--i]=array[i]
}}}return ret
},inArray:function(elem,array){for(var i=0,length=array.length;
i<length;
i++){if(array[i]===elem){return i
}}return -1
},merge:function(first,second){var i=0,elem,pos=first.length;
if(!jQuery.support.getAll){while((elem=second[i++])!=null){if(elem.nodeType!=8){first[pos++]=elem
}}}else{while((elem=second[i++])!=null){first[pos++]=elem
}}return first
},unique:function(array){var ret=[],done={};
try{for(var i=0,length=array.length;
i<length;
i++){var id=jQuery.data(array[i]);
if(!done[id]){done[id]=true;
ret.push(array[i])
}}}catch(e){ret=array
}return ret
},grep:function(elems,callback,inv){var ret=[];
for(var i=0,length=elems.length;
i<length;
i++){if(!inv!=!callback(elems[i],i)){ret.push(elems[i])
}}return ret
},map:function(elems,callback){var ret=[];
for(var i=0,length=elems.length;
i<length;
i++){var value=callback(elems[i],i);
if(value!=null){ret[ret.length]=value
}}return ret.concat.apply([],ret)
}});
var userAgent=navigator.userAgent.toLowerCase();
jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};
jQuery.each({parent:function(elem){return elem.parentNode
},parents:function(elem){return jQuery.dir(elem,"parentNode")
},next:function(elem){return jQuery.nth(elem,2,"nextSibling")
},prev:function(elem){return jQuery.nth(elem,2,"previousSibling")
},nextAll:function(elem){return jQuery.dir(elem,"nextSibling")
},prevAll:function(elem){return jQuery.dir(elem,"previousSibling")
},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem)
},children:function(elem){return jQuery.sibling(elem.firstChild)
},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes)
}},function(name,fn){jQuery.fn[name]=function(selector){var ret=jQuery.map(this,fn);
if(selector&&typeof selector=="string"){ret=jQuery.multiFilter(selector,ret)
}return this.pushStack(jQuery.unique(ret),name,selector)
}
});
jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(selector){var ret=[],insert=jQuery(selector);
for(var i=0,l=insert.length;
i<l;
i++){var elems=(i>0?this.clone(true):this).get();
jQuery.fn[original].apply(jQuery(insert[i]),elems);
ret=ret.concat(elems)
}return this.pushStack(ret,name,selector)
}
});
jQuery.each({removeAttr:function(name){jQuery.attr(this,name,"");
if(this.nodeType==1){this.removeAttribute(name)
}},addClass:function(classNames){jQuery.className.add(this,classNames)
},removeClass:function(classNames){jQuery.className.remove(this,classNames)
},toggleClass:function(classNames,state){if(typeof state!=="boolean"){state=!jQuery.className.has(this,classNames)
}jQuery.className[state?"add":"remove"](this,classNames)
},remove:function(selector){if(!selector||jQuery.filter(selector,[this]).length){jQuery("*",this).add([this]).each(function(){jQuery.event.remove(this);
jQuery.removeData(this)
});
if(this.parentNode){this.parentNode.removeChild(this)
}}},empty:function(){jQuery(this).children().remove();
while(this.firstChild){this.removeChild(this.firstChild)
}}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments)
}
});
function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0
}var expando="jQuery"+now(),uuid=0,windowData={};
jQuery.extend({cache:{},data:function(elem,name,data){elem=elem==window?windowData:elem;
var id=elem[expando];
if(!id){id=elem[expando]=++uuid
}if(name&&!jQuery.cache[id]){jQuery.cache[id]={}
}if(data!==undefined){jQuery.cache[id][name]=data
}return name?jQuery.cache[id][name]:id
},removeData:function(elem,name){elem=elem==window?windowData:elem;
var id=elem[expando];
if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];
name="";
for(name in jQuery.cache[id]){break
}if(!name){jQuery.removeData(elem)
}}}else{try{delete elem[expando]
}catch(e){if(elem.removeAttribute){elem.removeAttribute(expando)
}}delete jQuery.cache[id]
}},queue:function(elem,type,data){if(elem){type=(type||"fx")+"queue";
var q=jQuery.data(elem,type);
if(!q||jQuery.isArray(data)){q=jQuery.data(elem,type,jQuery.makeArray(data))
}else{if(data){q.push(data)
}}}return q
},dequeue:function(elem,type){var queue=jQuery.queue(elem,type),fn=queue.shift();
if(!type||type==="fx"){fn=queue[0]
}if(fn!==undefined){fn.call(elem)
}}});
jQuery.fn.extend({data:function(key,value){var parts=key.split(".");
parts[1]=parts[1]?"."+parts[1]:"";
if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);
if(data===undefined&&this.length){data=jQuery.data(this[0],key)
}return data===undefined&&parts[1]?this.data(parts[0]):data
}else{return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value)
})
}},removeData:function(key){return this.each(function(){jQuery.removeData(this,key)
})
},queue:function(type,data){if(typeof type!=="string"){data=type;
type="fx"
}if(data===undefined){return jQuery.queue(this[0],type)
}return this.each(function(){var queue=jQuery.queue(this,type,data);
if(type=="fx"&&queue.length==1){queue[0].call(this)
}})
},dequeue:function(type){return this.each(function(){jQuery.dequeue(this,type)
})
}});
/*
 * Sizzle CSS Selector Engine - v0.9.3
 *  Copyright 2009, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
(function(){var chunker=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,done=0,toString=Object.prototype.toString;
var Sizzle=function(selector,context,results,seed){results=results||[];
context=context||document;
if(context.nodeType!==1&&context.nodeType!==9){return[]
}if(!selector||typeof selector!=="string"){return results
}var parts=[],m,set,checkSet,check,mode,extra,prune=true;
chunker.lastIndex=0;
while((m=chunker.exec(selector))!==null){parts.push(m[1]);
if(m[2]){extra=RegExp.rightContext;
break
}}if(parts.length>1&&origPOS.exec(selector)){if(parts.length===2&&Expr.relative[parts[0]]){set=posProcess(parts[0]+parts[1],context)
}else{set=Expr.relative[parts[0]]?[context]:Sizzle(parts.shift(),context);
while(parts.length){selector=parts.shift();
if(Expr.relative[selector]){selector+=parts.shift()
}set=posProcess(selector,set)
}}}else{var ret=seed?{expr:parts.pop(),set:makeArray(seed)}:Sizzle.find(parts.pop(),parts.length===1&&context.parentNode?context.parentNode:context,isXML(context));
set=Sizzle.filter(ret.expr,ret.set);
if(parts.length>0){checkSet=makeArray(set)
}else{prune=false
}while(parts.length){var cur=parts.pop(),pop=cur;
if(!Expr.relative[cur]){cur=""
}else{pop=parts.pop()
}if(pop==null){pop=context
}Expr.relative[cur](checkSet,pop,isXML(context))
}}if(!checkSet){checkSet=set
}if(!checkSet){throw"Syntax error, unrecognized expression: "+(cur||selector)
}if(toString.call(checkSet)==="[object Array]"){if(!prune){results.push.apply(results,checkSet)
}else{if(context.nodeType===1){for(var i=0;
checkSet[i]!=null;
i++){if(checkSet[i]&&(checkSet[i]===true||checkSet[i].nodeType===1&&contains(context,checkSet[i]))){results.push(set[i])
}}}else{for(var i=0;
checkSet[i]!=null;
i++){if(checkSet[i]&&checkSet[i].nodeType===1){results.push(set[i])
}}}}}else{makeArray(checkSet,results)
}if(extra){Sizzle(extra,context,results,seed);
if(sortOrder){hasDuplicate=false;
results.sort(sortOrder);
if(hasDuplicate){for(var i=1;
i<results.length;
i++){if(results[i]===results[i-1]){results.splice(i--,1)
}}}}}return results
};
Sizzle.matches=function(expr,set){return Sizzle(expr,null,null,set)
};
Sizzle.find=function(expr,context,isXML){var set,match;
if(!expr){return[]
}for(var i=0,l=Expr.order.length;
i<l;
i++){var type=Expr.order[i],match;
if((match=Expr.match[type].exec(expr))){var left=RegExp.leftContext;
if(left.substr(left.length-1)!=="\\"){match[1]=(match[1]||"").replace(/\\/g,"");
set=Expr.find[type](match,context,isXML);
if(set!=null){expr=expr.replace(Expr.match[type],"");
break
}}}}if(!set){set=context.getElementsByTagName("*")
}return{set:set,expr:expr}
};
Sizzle.filter=function(expr,set,inplace,not){var old=expr,result=[],curLoop=set,match,anyFound,isXMLFilter=set&&set[0]&&isXML(set[0]);
while(expr&&set.length){for(var type in Expr.filter){if((match=Expr.match[type].exec(expr))!=null){var filter=Expr.filter[type],found,item;
anyFound=false;
if(curLoop==result){result=[]
}if(Expr.preFilter[type]){match=Expr.preFilter[type](match,curLoop,inplace,result,not,isXMLFilter);
if(!match){anyFound=found=true
}else{if(match===true){continue
}}}if(match){for(var i=0;
(item=curLoop[i])!=null;
i++){if(item){found=filter(item,match,i,curLoop);
var pass=not^!!found;
if(inplace&&found!=null){if(pass){anyFound=true
}else{curLoop[i]=false
}}else{if(pass){result.push(item);
anyFound=true
}}}}}if(found!==undefined){if(!inplace){curLoop=result
}expr=expr.replace(Expr.match[type],"");
if(!anyFound){return[]
}break
}}}if(expr==old){if(anyFound==null){throw"Syntax error, unrecognized expression: "+expr
}else{break
}}old=expr
}return curLoop
};
var Expr=Sizzle.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\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\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(elem){return elem.getAttribute("href")
}},relative:{"+":function(checkSet,part,isXML){var isPartStr=typeof part==="string",isTag=isPartStr&&!/\W/.test(part),isPartStrNotTag=isPartStr&&!isTag;
if(isTag&&!isXML){part=part.toUpperCase()
}for(var i=0,l=checkSet.length,elem;
i<l;
i++){if((elem=checkSet[i])){while((elem=elem.previousSibling)&&elem.nodeType!==1){}checkSet[i]=isPartStrNotTag||elem&&elem.nodeName===part?elem||false:elem===part
}}if(isPartStrNotTag){Sizzle.filter(part,checkSet,true)
}},">":function(checkSet,part,isXML){var isPartStr=typeof part==="string";
if(isPartStr&&!/\W/.test(part)){part=isXML?part:part.toUpperCase();
for(var i=0,l=checkSet.length;
i<l;
i++){var elem=checkSet[i];
if(elem){var parent=elem.parentNode;
checkSet[i]=parent.nodeName===part?parent:false
}}}else{for(var i=0,l=checkSet.length;
i<l;
i++){var elem=checkSet[i];
if(elem){checkSet[i]=isPartStr?elem.parentNode:elem.parentNode===part
}}if(isPartStr){Sizzle.filter(part,checkSet,true)
}}},"":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck;
if(!part.match(/\W/)){var nodeCheck=part=isXML?part:part.toUpperCase();
checkFn=dirNodeCheck
}checkFn("parentNode",part,doneName,checkSet,nodeCheck,isXML)
},"~":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck;
if(typeof part==="string"&&!part.match(/\W/)){var nodeCheck=part=isXML?part:part.toUpperCase();
checkFn=dirNodeCheck
}checkFn("previousSibling",part,doneName,checkSet,nodeCheck,isXML)
}},find:{ID:function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);
return m?[m]:[]
}},NAME:function(match,context,isXML){if(typeof context.getElementsByName!=="undefined"){var ret=[],results=context.getElementsByName(match[1]);
for(var i=0,l=results.length;
i<l;
i++){if(results[i].getAttribute("name")===match[1]){ret.push(results[i])
}}return ret.length===0?null:ret
}},TAG:function(match,context){return context.getElementsByTagName(match[1])
}},preFilter:{CLASS:function(match,curLoop,inplace,result,not,isXML){match=" "+match[1].replace(/\\/g,"")+" ";
if(isXML){return match
}for(var i=0,elem;
(elem=curLoop[i])!=null;
i++){if(elem){if(not^(elem.className&&(" "+elem.className+" ").indexOf(match)>=0)){if(!inplace){result.push(elem)
}}else{if(inplace){curLoop[i]=false
}}}}return false
},ID:function(match){return match[1].replace(/\\/g,"")
},TAG:function(match,curLoop){for(var i=0;
curLoop[i]===false;
i++){}return curLoop[i]&&isXML(curLoop[i])?match[1]:match[1].toUpperCase()
},CHILD:function(match){if(match[1]=="nth"){var test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(match[2]=="even"&&"2n"||match[2]=="odd"&&"2n+1"||!/\D/.test(match[2])&&"0n+"+match[2]||match[2]);
match[2]=(test[1]+(test[2]||1))-0;
match[3]=test[3]-0
}match[0]=done++;
return match
},ATTR:function(match,curLoop,inplace,result,not,isXML){var name=match[1].replace(/\\/g,"");
if(!isXML&&Expr.attrMap[name]){match[1]=Expr.attrMap[name]
}if(match[2]==="~="){match[4]=" "+match[4]+" "
}return match
},PSEUDO:function(match,curLoop,inplace,result,not){if(match[1]==="not"){if(match[3].match(chunker).length>1||/^\w/.test(match[3])){match[3]=Sizzle(match[3],null,null,curLoop)
}else{var ret=Sizzle.filter(match[3],curLoop,inplace,true^not);
if(!inplace){result.push.apply(result,ret)
}return false
}}else{if(Expr.match.POS.test(match[0])||Expr.match.CHILD.test(match[0])){return true
}}return match
},POS:function(match){match.unshift(true);
return match
}},filters:{enabled:function(elem){return elem.disabled===false&&elem.type!=="hidden"
},disabled:function(elem){return elem.disabled===true
},checked:function(elem){return elem.checked===true
},selected:function(elem){elem.parentNode.selectedIndex;
return elem.selected===true
},parent:function(elem){return !!elem.firstChild
},empty:function(elem){return !elem.firstChild
},has:function(elem,i,match){return !!Sizzle(match[3],elem).length
},header:function(elem){return/h\d/i.test(elem.nodeName)
},text:function(elem){return"text"===elem.type
},radio:function(elem){return"radio"===elem.type
},checkbox:function(elem){return"checkbox"===elem.type
},file:function(elem){return"file"===elem.type
},password:function(elem){return"password"===elem.type
},submit:function(elem){return"submit"===elem.type
},image:function(elem){return"image"===elem.type
},reset:function(elem){return"reset"===elem.type
},button:function(elem){return"button"===elem.type||elem.nodeName.toUpperCase()==="BUTTON"
},input:function(elem){return/input|select|textarea|button/i.test(elem.nodeName)
}},setFilters:{first:function(elem,i){return i===0
},last:function(elem,i,match,array){return i===array.length-1
},even:function(elem,i){return i%2===0
},odd:function(elem,i){return i%2===1
},lt:function(elem,i,match){return i<match[3]-0
},gt:function(elem,i,match){return i>match[3]-0
},nth:function(elem,i,match){return match[3]-0==i
},eq:function(elem,i,match){return match[3]-0==i
}},filter:{PSEUDO:function(elem,match,i,array){var name=match[1],filter=Expr.filters[name];
if(filter){return filter(elem,i,match,array)
}else{if(name==="contains"){return(elem.textContent||elem.innerText||"").indexOf(match[3])>=0
}else{if(name==="not"){var not=match[3];
for(var i=0,l=not.length;
i<l;
i++){if(not[i]===elem){return false
}}return true
}}}},CHILD:function(elem,match){var type=match[1],node=elem;
switch(type){case"only":case"first":while(node=node.previousSibling){if(node.nodeType===1){return false
}}if(type=="first"){return true
}node=elem;
case"last":while(node=node.nextSibling){if(node.nodeType===1){return false
}}return true;
case"nth":var first=match[2],last=match[3];
if(first==1&&last==0){return true
}var doneName=match[0],parent=elem.parentNode;
if(parent&&(parent.sizcache!==doneName||!elem.nodeIndex)){var count=0;
for(node=parent.firstChild;
node;
node=node.nextSibling){if(node.nodeType===1){node.nodeIndex=++count
}}parent.sizcache=doneName
}var diff=elem.nodeIndex-last;
if(first==0){return diff==0
}else{return(diff%first==0&&diff/first>=0)
}}},ID:function(elem,match){return elem.nodeType===1&&elem.getAttribute("id")===match
},TAG:function(elem,match){return(match==="*"&&elem.nodeType===1)||elem.nodeName===match
},CLASS:function(elem,match){return(" "+(elem.className||elem.getAttribute("class"))+" ").indexOf(match)>-1
},ATTR:function(elem,match){var name=match[1],result=Expr.attrHandle[name]?Expr.attrHandle[name](elem):elem[name]!=null?elem[name]:elem.getAttribute(name),value=result+"",type=match[2],check=match[4];
return result==null?type==="!=":type==="="?value===check:type==="*="?value.indexOf(check)>=0:type==="~="?(" "+value+" ").indexOf(check)>=0:!check?value&&result!==false:type==="!="?value!=check:type==="^="?value.indexOf(check)===0:type==="$="?value.substr(value.length-check.length)===check:type==="|="?value===check||value.substr(0,check.length+1)===check+"-":false
},POS:function(elem,match,i,array){var name=match[2],filter=Expr.setFilters[name];
if(filter){return filter(elem,i,match,array)
}}}};
var origPOS=Expr.match.POS;
for(var type in Expr.match){Expr.match[type]=RegExp(Expr.match[type].source+/(?![^\[]*\])(?![^\(]*\))/.source)
}var makeArray=function(array,results){array=Array.prototype.slice.call(array);
if(results){results.push.apply(results,array);
return results
}return array
};
try{Array.prototype.slice.call(document.documentElement.childNodes)
}catch(e){makeArray=function(array,results){var ret=results||[];
if(toString.call(array)==="[object Array]"){Array.prototype.push.apply(ret,array)
}else{if(typeof array.length==="number"){for(var i=0,l=array.length;
i<l;
i++){ret.push(array[i])
}}else{for(var i=0;
array[i];
i++){ret.push(array[i])
}}}return ret
}
}var sortOrder;
if(document.documentElement.compareDocumentPosition){sortOrder=function(a,b){var ret=a.compareDocumentPosition(b)&4?-1:a===b?0:1;
if(ret===0){hasDuplicate=true
}return ret
}
}else{if("sourceIndex" in document.documentElement){sortOrder=function(a,b){var ret=a.sourceIndex-b.sourceIndex;
if(ret===0){hasDuplicate=true
}return ret
}
}else{if(document.createRange){sortOrder=function(a,b){var aRange=a.ownerDocument.createRange(),bRange=b.ownerDocument.createRange();
aRange.selectNode(a);
aRange.collapse(true);
bRange.selectNode(b);
bRange.collapse(true);
var ret=aRange.compareBoundaryPoints(Range.START_TO_END,bRange);
if(ret===0){hasDuplicate=true
}return ret
}
}}}(function(){var form=document.createElement("form"),id="script"+(new Date).getTime();
form.innerHTML="<input name='"+id+"'/>";
var root=document.documentElement;
root.insertBefore(form,root.firstChild);
if(!!document.getElementById(id)){Expr.find.ID=function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);
return m?m.id===match[1]||typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id").nodeValue===match[1]?[m]:undefined:[]
}};
Expr.filter.ID=function(elem,match){var node=typeof elem.getAttributeNode!=="undefined"&&elem.getAttributeNode("id");
return elem.nodeType===1&&node&&node.nodeValue===match
}
}root.removeChild(form)
})();
(function(){var div=document.createElement("div");
div.appendChild(document.createComment(""));
if(div.getElementsByTagName("*").length>0){Expr.find.TAG=function(match,context){var results=context.getElementsByTagName(match[1]);
if(match[1]==="*"){var tmp=[];
for(var i=0;
results[i];
i++){if(results[i].nodeType===1){tmp.push(results[i])
}}results=tmp
}return results
}
}div.innerHTML="<a href='#'></a>";
if(div.firstChild&&typeof div.firstChild.getAttribute!=="undefined"&&div.firstChild.getAttribute("href")!=="#"){Expr.attrHandle.href=function(elem){return elem.getAttribute("href",2)
}
}})();
if(document.querySelectorAll){(function(){var oldSizzle=Sizzle,div=document.createElement("div");
div.innerHTML="<p class='TEST'></p>";
if(div.querySelectorAll&&div.querySelectorAll(".TEST").length===0){return 
}Sizzle=function(query,context,extra,seed){context=context||document;
if(!seed&&context.nodeType===9&&!isXML(context)){try{return makeArray(context.querySelectorAll(query),extra)
}catch(e){}}return oldSizzle(query,context,extra,seed)
};
Sizzle.find=oldSizzle.find;
Sizzle.filter=oldSizzle.filter;
Sizzle.selectors=oldSizzle.selectors;
Sizzle.matches=oldSizzle.matches
})()
}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var div=document.createElement("div");
div.innerHTML="<div class='test e'></div><div class='test'></div>";
if(div.getElementsByClassName("e").length===0){return 
}div.lastChild.className="e";
if(div.getElementsByClassName("e").length===1){return 
}Expr.order.splice(1,0,"CLASS");
Expr.find.CLASS=function(match,context,isXML){if(typeof context.getElementsByClassName!=="undefined"&&!isXML){return context.getElementsByClassName(match[1])
}}
})()
}function dirNodeCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){var sibDir=dir=="previousSibling"&&!isXML;
for(var i=0,l=checkSet.length;
i<l;
i++){var elem=checkSet[i];
if(elem){if(sibDir&&elem.nodeType===1){elem.sizcache=doneName;
elem.sizset=i
}elem=elem[dir];
var match=false;
while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];
break
}if(elem.nodeType===1&&!isXML){elem.sizcache=doneName;
elem.sizset=i
}if(elem.nodeName===cur){match=elem;
break
}elem=elem[dir]
}checkSet[i]=match
}}}function dirCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){var sibDir=dir=="previousSibling"&&!isXML;
for(var i=0,l=checkSet.length;
i<l;
i++){var elem=checkSet[i];
if(elem){if(sibDir&&elem.nodeType===1){elem.sizcache=doneName;
elem.sizset=i
}elem=elem[dir];
var match=false;
while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];
break
}if(elem.nodeType===1){if(!isXML){elem.sizcache=doneName;
elem.sizset=i
}if(typeof cur!=="string"){if(elem===cur){match=true;
break
}}else{if(Sizzle.filter(cur,[elem]).length>0){match=elem;
break
}}}elem=elem[dir]
}checkSet[i]=match
}}}var contains=document.compareDocumentPosition?function(a,b){return a.compareDocumentPosition(b)&16
}:function(a,b){return a!==b&&(a.contains?a.contains(b):true)
};
var isXML=function(elem){return elem.nodeType===9&&elem.documentElement.nodeName!=="HTML"||!!elem.ownerDocument&&isXML(elem.ownerDocument)
};
var posProcess=function(selector,context){var tmpSet=[],later="",match,root=context.nodeType?[context]:context;
while((match=Expr.match.PSEUDO.exec(selector))){later+=match[0];
selector=selector.replace(Expr.match.PSEUDO,"")
}selector=Expr.relative[selector]?selector+"*":selector;
for(var i=0,l=root.length;
i<l;
i++){Sizzle(selector,root[i],tmpSet)
}return Sizzle.filter(later,tmpSet)
};
jQuery.find=Sizzle;
jQuery.filter=Sizzle.filter;
jQuery.expr=Sizzle.selectors;
jQuery.expr[":"]=jQuery.expr.filters;
Sizzle.selectors.filters.hidden=function(elem){return elem.offsetWidth===0||elem.offsetHeight===0
};
Sizzle.selectors.filters.visible=function(elem){return elem.offsetWidth>0||elem.offsetHeight>0
};
Sizzle.selectors.filters.animated=function(elem){return jQuery.grep(jQuery.timers,function(fn){return elem===fn.elem
}).length
};
jQuery.multiFilter=function(expr,elems,not){if(not){expr=":not("+expr+")"
}return Sizzle.matches(expr,elems)
};
jQuery.dir=function(elem,dir){var matched=[],cur=elem[dir];
while(cur&&cur!=document){if(cur.nodeType==1){matched.push(cur)
}cur=cur[dir]
}return matched
};
jQuery.nth=function(cur,result,dir,elem){result=result||1;
var num=0;
for(;
cur;
cur=cur[dir]){if(cur.nodeType==1&&++num==result){break
}}return cur
};
jQuery.sibling=function(n,elem){var r=[];
for(;
n;
n=n.nextSibling){if(n.nodeType==1&&n!=elem){r.push(n)
}}return r
};
return ;
window.Sizzle=Sizzle
})();
jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8){return 
}if(elem.setInterval&&elem!=window){elem=window
}if(!handler.guid){handler.guid=this.guid++
}if(data!==undefined){var fn=handler;
handler=this.proxy(fn);
handler.data=data
}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){return typeof jQuery!=="undefined"&&!jQuery.event.triggered?jQuery.event.handle.apply(arguments.callee.elem,arguments):undefined
});
handle.elem=elem;
jQuery.each(types.split(/\s+/),function(index,type){var namespaces=type.split(".");
type=namespaces.shift();
handler.type=namespaces.slice().sort().join(".");
var handlers=events[type];
if(jQuery.event.specialAll[type]){jQuery.event.specialAll[type].setup.call(elem,data,namespaces)
}if(!handlers){handlers=events[type]={};
if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem,data,namespaces)===false){if(elem.addEventListener){elem.addEventListener(type,handle,false)
}else{if(elem.attachEvent){elem.attachEvent("on"+type,handle)
}}}}handlers[handler.guid]=handler;
jQuery.event.global[type]=true
});
elem=null
},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8){return 
}var events=jQuery.data(elem,"events"),ret,index;
if(events){if(types===undefined||(typeof types==="string"&&types.charAt(0)==".")){for(var type in events){this.remove(elem,type+(types||""))
}}else{if(types.type){handler=types.handler;
types=types.type
}jQuery.each(types.split(/\s+/),function(index,type){var namespaces=type.split(".");
type=namespaces.shift();
var namespace=RegExp("(^|\\.)"+namespaces.slice().sort().join(".*\\.")+"(\\.|$)");
if(events[type]){if(handler){delete events[type][handler.guid]
}else{for(var handle in events[type]){if(namespace.test(events[type][handle].type)){delete events[type][handle]
}}}if(jQuery.event.specialAll[type]){jQuery.event.specialAll[type].teardown.call(elem,namespaces)
}for(ret in events[type]){break
}if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem,namespaces)===false){if(elem.removeEventListener){elem.removeEventListener(type,jQuery.data(elem,"handle"),false)
}else{if(elem.detachEvent){elem.detachEvent("on"+type,jQuery.data(elem,"handle"))
}}}ret=null;
delete events[type]
}}})
}for(ret in events){break
}if(!ret){var handle=jQuery.data(elem,"handle");
if(handle){handle.elem=null
}jQuery.removeData(elem,"events");
jQuery.removeData(elem,"handle")
}}},trigger:function(event,data,elem,bubbling){var type=event.type||event;
if(!bubbling){event=typeof event==="object"?event[expando]?event:jQuery.extend(jQuery.Event(type),event):jQuery.Event(type);
if(type.indexOf("!")>=0){event.type=type=type.slice(0,-1);
event.exclusive=true
}if(!elem){event.stopPropagation();
if(this.global[type]){jQuery.each(jQuery.cache,function(){if(this.events&&this.events[type]){jQuery.event.trigger(event,data,this.handle.elem)
}})
}}if(!elem||elem.nodeType==3||elem.nodeType==8){return undefined
}event.result=undefined;
event.target=elem;
data=jQuery.makeArray(data);
data.unshift(event)
}event.currentTarget=elem;
var handle=jQuery.data(elem,"handle");
if(handle){handle.apply(elem,data)
}if((!elem[type]||(jQuery.nodeName(elem,"a")&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false){event.result=false
}if(!bubbling&&elem[type]&&!event.isDefaultPrevented()&&!(jQuery.nodeName(elem,"a")&&type=="click")){this.triggered=true;
try{elem[type]()
}catch(e){}}this.triggered=false;
if(!event.isPropagationStopped()){var parent=elem.parentNode||elem.ownerDocument;
if(parent){jQuery.event.trigger(event,data,parent,true)
}}},handle:function(event){var all,handlers;
event=arguments[0]=jQuery.event.fix(event||window.event);
event.currentTarget=this;
var namespaces=event.type.split(".");
event.type=namespaces.shift();
all=!namespaces.length&&!event.exclusive;
var namespace=RegExp("(^|\\.)"+namespaces.slice().sort().join(".*\\.")+"(\\.|$)");
handlers=(jQuery.data(this,"events")||{})[event.type];
for(var j in handlers){var handler=handlers[j];
if(all||namespace.test(handler.type)){event.handler=handler;
event.data=handler.data;
var ret=handler.apply(this,arguments);
if(ret!==undefined){event.result=ret;
if(ret===false){event.preventDefault();
event.stopPropagation()
}}if(event.isImmediatePropagationStopped()){break
}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(event){if(event[expando]){return event
}var originalEvent=event;
event=jQuery.Event(originalEvent);
for(var i=this.props.length,prop;
i;
){prop=this.props[--i];
event[prop]=originalEvent[prop]
}if(!event.target){event.target=event.srcElement||document
}if(event.target.nodeType==3){event.target=event.target.parentNode
}if(!event.relatedTarget&&event.fromElement){event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement
}if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;
event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);
event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0)
}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode)){event.which=event.charCode||event.keyCode
}if(!event.metaKey&&event.ctrlKey){event.metaKey=event.ctrlKey
}if(!event.which&&event.button){event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)))
}return event
},proxy:function(fn,proxy){proxy=proxy||function(){return fn.apply(this,arguments)
};
proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;
return proxy
},special:{ready:{setup:bindReady,teardown:function(){}}},specialAll:{live:{setup:function(selector,namespaces){jQuery.event.add(this,namespaces[0],liveHandler)
},teardown:function(namespaces){if(namespaces.length){var remove=0,name=RegExp("(^|\\.)"+namespaces[0]+"(\\.|$)");
jQuery.each((jQuery.data(this,"events").live||{}),function(){if(name.test(this.type)){remove++
}});
if(remove<1){jQuery.event.remove(this,namespaces[0],liveHandler)
}}}}}};
jQuery.Event=function(src){if(!this.preventDefault){return new jQuery.Event(src)
}if(src&&src.type){this.originalEvent=src;
this.type=src.type
}else{this.type=src
}this.timeStamp=now();
this[expando]=true
};
function returnFalse(){return false
}function returnTrue(){return true
}jQuery.Event.prototype={preventDefault:function(){this.isDefaultPrevented=returnTrue;
var e=this.originalEvent;
if(!e){return 
}if(e.preventDefault){e.preventDefault()
}e.returnValue=false
},stopPropagation:function(){this.isPropagationStopped=returnTrue;
var e=this.originalEvent;
if(!e){return 
}if(e.stopPropagation){e.stopPropagation()
}e.cancelBubble=true
},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=returnTrue;
this.stopPropagation()
},isDefaultPrevented:returnFalse,isPropagationStopped:returnFalse,isImmediatePropagationStopped:returnFalse};
var withinElement=function(event){var parent=event.relatedTarget;
while(parent&&parent!=this){try{parent=parent.parentNode
}catch(e){parent=this
}}if(parent!=this){event.type=event.data;
jQuery.event.handle.apply(this,arguments)
}};
jQuery.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(orig,fix){jQuery.event.special[fix]={setup:function(){jQuery.event.add(this,orig,withinElement,fix)
},teardown:function(){jQuery.event.remove(this,orig,withinElement)
}}
});
jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data)
})
},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);
return(fn||data).apply(this,arguments)
});
return this.each(function(){jQuery.event.add(this,type,one,fn&&data)
})
},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn)
})
},trigger:function(type,data){return this.each(function(){jQuery.event.trigger(type,data,this)
})
},triggerHandler:function(type,data){if(this[0]){var event=jQuery.Event(type);
event.preventDefault();
event.stopPropagation();
jQuery.event.trigger(event,data,this[0]);
return event.result
}},toggle:function(fn){var args=arguments,i=1;
while(i<args.length){jQuery.event.proxy(fn,args[i++])
}return this.click(jQuery.event.proxy(fn,function(event){this.lastToggle=(this.lastToggle||0)%i;
event.preventDefault();
return args[this.lastToggle++].apply(this,arguments)||false
}))
},hover:function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut)
},ready:function(fn){bindReady();
if(jQuery.isReady){fn.call(document,jQuery)
}else{jQuery.readyList.push(fn)
}return this
},live:function(type,fn){var proxy=jQuery.event.proxy(fn);
proxy.guid+=this.selector+type;
jQuery(document).bind(liveConvert(type,this.selector),this.selector,proxy);
return this
},die:function(type,fn){jQuery(document).unbind(liveConvert(type,this.selector),fn?{guid:fn.guid+this.selector+type}:null);
return this
}});
function liveHandler(event){var check=RegExp("(^|\\.)"+event.type+"(\\.|$)"),stop=true,elems=[];
jQuery.each(jQuery.data(this,"events").live||[],function(i,fn){if(check.test(fn.type)){var elem=jQuery(event.target).closest(fn.data)[0];
if(elem){elems.push({elem:elem,fn:fn})
}}});
elems.sort(function(a,b){return jQuery.data(a.elem,"closest")-jQuery.data(b.elem,"closest")
});
jQuery.each(elems,function(){if(this.fn.call(this.elem,event,this.fn.data)===false){return(stop=false)
}});
return stop
}function liveConvert(type,selector){return["live",type,selector.replace(/\./g,"`").replace(/ /g,"|")].join(".")
}jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;
if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.call(document,jQuery)
});
jQuery.readyList=null
}jQuery(document).triggerHandler("ready")
}}});
var readyBound=false;
function bindReady(){if(readyBound){return 
}readyBound=true;
if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);
jQuery.ready()
},false)
}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);
jQuery.ready()
}});
if(document.documentElement.doScroll&&window==window.top){(function(){if(jQuery.isReady){return 
}try{document.documentElement.doScroll("left")
}catch(error){setTimeout(arguments.callee,0);
return 
}jQuery.ready()
})()
}}}jQuery.event.add(window,"load",jQuery.ready)
}jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name)
}
});
jQuery(window).bind("unload",function(){for(var id in jQuery.cache){if(id!=1&&jQuery.cache[id].handle){jQuery.event.remove(jQuery.cache[id].handle.elem)
}}});
(function(){jQuery.support={};
var root=document.documentElement,script=document.createElement("script"),div=document.createElement("div"),id="script"+(new Date).getTime();
div.style.display="none";
div.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';
var all=div.getElementsByTagName("*"),a=div.getElementsByTagName("a")[0];
if(!all||!all.length||!a){return 
}jQuery.support={leadingWhitespace:div.firstChild.nodeType==3,tbody:!div.getElementsByTagName("tbody").length,objectAll:!!div.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!div.getElementsByTagName("link").length,style:/red/.test(a.getAttribute("style")),hrefNormalized:a.getAttribute("href")==="/a",opacity:a.style.opacity==="0.5",cssFloat:!!a.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};
script.type="text/javascript";
try{script.appendChild(document.createTextNode("window."+id+"=1;"))
}catch(e){}root.insertBefore(script,root.firstChild);
if(window[id]){jQuery.support.scriptEval=true;
delete window[id]
}root.removeChild(script);
if(div.attachEvent&&div.fireEvent){div.attachEvent("onclick",function(){jQuery.support.noCloneEvent=false;
div.detachEvent("onclick",arguments.callee)
});
div.cloneNode(true).fireEvent("onclick")
}jQuery(function(){var div=document.createElement("div");
div.style.width=div.style.paddingLeft="1px";
document.body.appendChild(div);
jQuery.boxModel=jQuery.support.boxModel=div.offsetWidth===2;
document.body.removeChild(div).style.display="none"
})
})();
var styleFloat=jQuery.support.cssFloat?"cssFloat":"styleFloat";
jQuery.props={"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};
jQuery.fn.extend({_load:jQuery.fn.load,load:function(url,params,callback){if(typeof url!=="string"){return this._load(url)
}var off=url.indexOf(" ");
if(off>=0){var selector=url.slice(off,url.length);
url=url.slice(0,off)
}var type="GET";
if(params){if(jQuery.isFunction(params)){callback=params;
params=null
}else{if(typeof params==="object"){params=jQuery.param(params);
type="POST"
}}}var self=this;
jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified"){self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText)
}if(callback){self.each(callback,[res.responseText,status,res])
}}});
return this
},serialize:function(){return jQuery.param(this.serializeArray())
},serializeArray:function(){return this.map(function(){return this.elements?jQuery.makeArray(this.elements):this
}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))
}).map(function(i,elem){var val=jQuery(this).val();
return val==null?null:jQuery.isArray(val)?jQuery.map(val,function(val,i){return{name:elem.name,value:val}
}):{name:elem.name,value:val}
}).get()
}});
jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f)
}
});
var jsc=now();
jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;
data=null
}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type})
},getScript:function(url,callback){return jQuery.get(url,null,callback,"script")
},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json")
},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;
data={}
}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type})
},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings)
},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()
},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));
var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();
if(s.data&&s.processData&&typeof s.data!=="string"){s.data=jQuery.param(s.data)
}if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre)){s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?"
}}else{if(!s.data||!s.data.match(jsre)){s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?"
}}s.dataType="json"
}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;
if(s.data){s.data=(s.data+"").replace(jsre,"="+jsonp+"$1")
}s.url=s.url.replace(jsre,"="+jsonp+"$1");
s.dataType="script";
window[jsonp]=function(tmp){data=tmp;
success();
complete();
window[jsonp]=undefined;
try{delete window[jsonp]
}catch(e){}if(head){head.removeChild(script)
}}
}if(s.dataType=="script"&&s.cache==null){s.cache=false
}if(s.cache===false&&type=="GET"){var ts=now();
var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");
s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"")
}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;
s.data=null
}if(s.global&&!jQuery.active++){jQuery.event.trigger("ajaxStart")
}var parts=/^(\w+:)?\/\/([^\/?#]+)/.exec(s.url);
if(s.dataType=="script"&&type=="GET"&&parts&&(parts[1]&&parts[1]!=location.protocol||parts[2]!=location.host)){var head=document.getElementsByTagName("head")[0];
var script=document.createElement("script");
script.src=s.url;
if(s.scriptCharset){script.charset=s.scriptCharset
}if(!jsonp){var done=false;
script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;
success();
complete();
script.onload=script.onreadystatechange=null;
head.removeChild(script)
}}
}head.appendChild(script);
return undefined
}var requestDone=false;
var xhr=s.xhr();
if(s.username){xhr.open(type,s.url,s.async,s.username,s.password)
}else{xhr.open(type,s.url,s.async)
}try{if(s.data){xhr.setRequestHeader("Content-Type",s.contentType)
}if(s.ifModified){xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT")
}xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");
xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default)
}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){if(s.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop")
}xhr.abort();
return false
}if(s.global){jQuery.event.trigger("ajaxSend",[xhr,s])
}var onreadystatechange=function(isTimeout){if(xhr.readyState==0){if(ival){clearInterval(ival);
ival=null;
if(s.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop")
}}}else{if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;
if(ival){clearInterval(ival);
ival=null
}status=isTimeout=="timeout"?"timeout":!jQuery.httpSuccess(xhr)?"error":s.ifModified&&jQuery.httpNotModified(xhr,s.url)?"notmodified":"success";
if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s)
}catch(e){status="parsererror"
}}if(status=="success"){var modRes;
try{modRes=xhr.getResponseHeader("Last-Modified")
}catch(e){}if(s.ifModified&&modRes){jQuery.lastModified[s.url]=modRes
}if(!jsonp){success()
}}else{jQuery.handleError(s,xhr,status)
}complete();
if(isTimeout){xhr.abort()
}if(s.async){xhr=null
}}}};
if(s.async){var ival=setInterval(onreadystatechange,13);
if(s.timeout>0){setTimeout(function(){if(xhr&&!requestDone){onreadystatechange("timeout")
}},s.timeout)
}}try{xhr.send(s.data)
}catch(e){jQuery.handleError(s,xhr,null,e)
}if(!s.async){onreadystatechange()
}function success(){if(s.success){s.success(data,status)
}if(s.global){jQuery.event.trigger("ajaxSuccess",[xhr,s])
}}function complete(){if(s.complete){s.complete(xhr,status)
}if(s.global){jQuery.event.trigger("ajaxComplete",[xhr,s])
}if(s.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop")
}}return xhr
},handleError:function(s,xhr,status,e){if(s.error){s.error(xhr,status,e)
}if(s.global){jQuery.event.trigger("ajaxError",[xhr,s,e])
}},active:0,httpSuccess:function(xhr){try{return !xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223
}catch(e){}return false
},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");
return xhr.status==304||xhrRes==jQuery.lastModified[url]
}catch(e){}return false
},httpData:function(xhr,type,s){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;
if(xml&&data.documentElement.tagName=="parsererror"){throw"parsererror"
}if(s&&s.dataFilter){data=s.dataFilter(data,type)
}if(typeof data==="string"){if(type=="script"){jQuery.globalEval(data)
}if(type=="json"){data=window["eval"]("("+data+")")
}}return data
},param:function(a){var s=[];
function add(key,value){s[s.length]=encodeURIComponent(key)+"="+encodeURIComponent(value)
}if(jQuery.isArray(a)||a.jquery){jQuery.each(a,function(){add(this.name,this.value)
})
}else{for(var j in a){if(jQuery.isArray(a[j])){jQuery.each(a[j],function(){add(j,this)
})
}else{add(j,jQuery.isFunction(a[j])?a[j]():a[j])
}}}return s.join("&").replace(/%20/g,"+")
}});
var elemdisplay={},timerId,fxAttrs=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];
function genFx(type,num){var obj={};
jQuery.each(fxAttrs.concat.apply([],fxAttrs.slice(0,num)),function(){obj[this]=type
});
return obj
}jQuery.fn.extend({show:function(speed,callback){if(speed){return this.animate(genFx("show",3),speed,callback)
}else{for(var i=0,l=this.length;
i<l;
i++){var old=jQuery.data(this[i],"olddisplay");
this[i].style.display=old||"";
if(jQuery.css(this[i],"display")==="none"){var tagName=this[i].tagName,display;
if(elemdisplay[tagName]){display=elemdisplay[tagName]
}else{var elem=jQuery("<"+tagName+" />").appendTo("body");
display=elem.css("display");
if(display==="none"){display="block"
}elem.remove();
elemdisplay[tagName]=display
}jQuery.data(this[i],"olddisplay",display)
}}for(var i=0,l=this.length;
i<l;
i++){this[i].style.display=jQuery.data(this[i],"olddisplay")||""
}return this
}},hide:function(speed,callback){if(speed){return this.animate(genFx("hide",3),speed,callback)
}else{for(var i=0,l=this.length;
i<l;
i++){var old=jQuery.data(this[i],"olddisplay");
if(!old&&old!=="none"){jQuery.data(this[i],"olddisplay",jQuery.css(this[i],"display"))
}}for(var i=0,l=this.length;
i<l;
i++){this[i].style.display="none"
}return this
}},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){var bool=typeof fn==="boolean";
return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn==null||bool?this.each(function(){var state=bool?fn:jQuery(this).is(":hidden");
jQuery(this)[state?"show":"hide"]()
}):this.animate(genFx("toggle",3),fn,fn2)
},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback)
},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);
return this[optall.queue===false?"each":"queue"](function(){var opt=jQuery.extend({},optall),p,hidden=this.nodeType==1&&jQuery(this).is(":hidden"),self=this;
for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden){return opt.complete.call(this)
}if((p=="height"||p=="width")&&this.style){opt.display=jQuery.css(this,"display");
opt.overflow=this.style.overflow
}}if(opt.overflow!=null){this.style.overflow="hidden"
}opt.curAnim=jQuery.extend({},prop);
jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);
if(/toggle|show|hide/.test(val)){e[val=="toggle"?hidden?"show":"hide":val](prop)
}else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;
if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";
if(unit!="px"){self.style[name]=(end||1)+unit;
start=((end||1)/e.cur(true))*start;
self.style[name]=start+unit
}if(parts[1]){end=((parts[1]=="-="?-1:1)*end)+start
}e.custom(start,end,unit)
}else{e.custom(start,val,"")
}}});
return true
})
},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;
if(clearQueue){this.queue([])
}this.each(function(){for(var i=timers.length-1;
i>=0;
i--){if(timers[i].elem==this){if(gotoEnd){timers[i](true)
}timers.splice(i,1)
}}});
if(!gotoEnd){this.dequeue()
}return this
}});
jQuery.each({slideDown:genFx("show",1),slideUp:genFx("hide",1),slideToggle:genFx("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(name,props){jQuery.fn[name]=function(speed,callback){return this.animate(props,speed,callback)
}
});
jQuery.extend({speed:function(speed,easing,fn){var opt=typeof speed==="object"?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&!jQuery.isFunction(easing)&&easing};
opt.duration=jQuery.fx.off?0:typeof opt.duration==="number"?opt.duration:jQuery.fx.speeds[opt.duration]||jQuery.fx.speeds._default;
opt.old=opt.complete;
opt.complete=function(){if(opt.queue!==false){jQuery(this).dequeue()
}if(jQuery.isFunction(opt.old)){opt.old.call(this)
}};
return opt
},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p
},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum
}},timers:[],fx:function(elem,options,prop){this.options=options;
this.elem=elem;
this.prop=prop;
if(!options.orig){options.orig={}
}}});
jQuery.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)
}(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);
if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"
}},cur:function(force){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]
}var r=parseFloat(jQuery.css(this.elem,this.prop,force));
return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0
},custom:function(from,to,unit){this.startTime=now();
this.start=from;
this.end=to;
this.unit=unit||this.unit||"px";
this.now=this.start;
this.pos=this.state=0;
var self=this;
function t(gotoEnd){return self.step(gotoEnd)
}t.elem=this.elem;
if(t()&&jQuery.timers.push(t)&&!timerId){timerId=setInterval(function(){var timers=jQuery.timers;
for(var i=0;
i<timers.length;
i++){if(!timers[i]()){timers.splice(i--,1)
}}if(!timers.length){clearInterval(timerId);
timerId=undefined
}},13)
}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);
this.options.show=true;
this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());
jQuery(this.elem).show()
},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);
this.options.hide=true;
this.custom(this.cur(),0)
},step:function(gotoEnd){var t=now();
if(gotoEnd||t>=this.options.duration+this.startTime){this.now=this.end;
this.pos=this.state=1;
this.update();
this.options.curAnim[this.prop]=true;
var done=true;
for(var i in this.options.curAnim){if(this.options.curAnim[i]!==true){done=false
}}if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;
this.elem.style.display=this.options.display;
if(jQuery.css(this.elem,"display")=="none"){this.elem.style.display="block"
}}if(this.options.hide){jQuery(this.elem).hide()
}if(this.options.hide||this.options.show){for(var p in this.options.curAnim){jQuery.attr(this.elem.style,p,this.options.orig[p])
}}this.options.complete.call(this.elem)
}return false
}else{var n=t-this.startTime;
this.state=n/this.options.duration;
this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);
this.now=this.start+((this.end-this.start)*this.pos);
this.update()
}return true
}};
jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now)
},_default:function(fx){if(fx.elem.style&&fx.elem.style[fx.prop]!=null){fx.elem.style[fx.prop]=fx.now+fx.unit
}else{fx.elem[fx.prop]=fx.now
}}}});
if(document.documentElement.getBoundingClientRect){jQuery.fn.offset=function(){if(!this[0]){return{top:0,left:0}
}if(this[0]===this[0].ownerDocument.body){return jQuery.offset.bodyOffset(this[0])
}var box=this[0].getBoundingClientRect(),doc=this[0].ownerDocument,body=doc.body,docElem=doc.documentElement,clientTop=docElem.clientTop||body.clientTop||0,clientLeft=docElem.clientLeft||body.clientLeft||0,top=box.top+(self.pageYOffset||jQuery.boxModel&&docElem.scrollTop||body.scrollTop)-clientTop,left=box.left+(self.pageXOffset||jQuery.boxModel&&docElem.scrollLeft||body.scrollLeft)-clientLeft;
return{top:top,left:left}
}
}else{jQuery.fn.offset=function(){if(!this[0]){return{top:0,left:0}
}if(this[0]===this[0].ownerDocument.body){return jQuery.offset.bodyOffset(this[0])
}jQuery.offset.initialized||jQuery.offset.initialize();
var elem=this[0],offsetParent=elem.offsetParent,prevOffsetParent=elem,doc=elem.ownerDocument,computedStyle,docElem=doc.documentElement,body=doc.body,defaultView=doc.defaultView,prevComputedStyle=defaultView.getComputedStyle(elem,null),top=elem.offsetTop,left=elem.offsetLeft;
while((elem=elem.parentNode)&&elem!==body&&elem!==docElem){computedStyle=defaultView.getComputedStyle(elem,null);
top-=elem.scrollTop,left-=elem.scrollLeft;
if(elem===offsetParent){top+=elem.offsetTop,left+=elem.offsetLeft;
if(jQuery.offset.doesNotAddBorder&&!(jQuery.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(elem.tagName))){top+=parseInt(computedStyle.borderTopWidth,10)||0,left+=parseInt(computedStyle.borderLeftWidth,10)||0
}prevOffsetParent=offsetParent,offsetParent=elem.offsetParent
}if(jQuery.offset.subtractsBorderForOverflowNotVisible&&computedStyle.overflow!=="visible"){top+=parseInt(computedStyle.borderTopWidth,10)||0,left+=parseInt(computedStyle.borderLeftWidth,10)||0
}prevComputedStyle=computedStyle
}if(prevComputedStyle.position==="relative"||prevComputedStyle.position==="static"){top+=body.offsetTop,left+=body.offsetLeft
}if(prevComputedStyle.position==="fixed"){top+=Math.max(docElem.scrollTop,body.scrollTop),left+=Math.max(docElem.scrollLeft,body.scrollLeft)
}return{top:top,left:left}
}
}jQuery.offset={initialize:function(){if(this.initialized){return 
}var body=document.body,container=document.createElement("div"),innerDiv,checkDiv,table,td,rules,prop,bodyMarginTop=body.style.marginTop,html='<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>';
rules={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};
for(prop in rules){container.style[prop]=rules[prop]
}container.innerHTML=html;
body.insertBefore(container,body.firstChild);
innerDiv=container.firstChild,checkDiv=innerDiv.firstChild,td=innerDiv.nextSibling.firstChild.firstChild;
this.doesNotAddBorder=(checkDiv.offsetTop!==5);
this.doesAddBorderForTableAndCells=(td.offsetTop===5);
innerDiv.style.overflow="hidden",innerDiv.style.position="relative";
this.subtractsBorderForOverflowNotVisible=(checkDiv.offsetTop===-5);
body.style.marginTop="1px";
this.doesNotIncludeMarginInBodyOffset=(body.offsetTop===0);
body.style.marginTop=bodyMarginTop;
body.removeChild(container);
this.initialized=true
},bodyOffset:function(body){jQuery.offset.initialized||jQuery.offset.initialize();
var top=body.offsetTop,left=body.offsetLeft;
if(jQuery.offset.doesNotIncludeMarginInBodyOffset){top+=parseInt(jQuery.curCSS(body,"marginTop",true),10)||0,left+=parseInt(jQuery.curCSS(body,"marginLeft",true),10)||0
}return{top:top,left:left}
}};
jQuery.fn.extend({position:function(){var left=0,top=0,results;
if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();
offset.top-=num(this,"marginTop");
offset.left-=num(this,"marginLeft");
parentOffset.top+=num(offsetParent,"borderTopWidth");
parentOffset.left+=num(offsetParent,"borderLeftWidth");
results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left}
}return results
},offsetParent:function(){var offsetParent=this[0].offsetParent||document.body;
while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,"position")=="static")){offsetParent=offsetParent.offsetParent
}return jQuery(offsetParent)
}});
jQuery.each(["Left","Top"],function(i,name){var method="scroll"+name;
jQuery.fn[method]=function(val){if(!this[0]){return null
}return val!==undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val
}):this[0]==window||this[0]==document?self[i?"pageYOffset":"pageXOffset"]||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method]
}
});
jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom",lower=name.toLowerCase();
jQuery.fn["inner"+name]=function(){return this[0]?jQuery.css(this[0],lower,false,"padding"):null
};
jQuery.fn["outer"+name]=function(margin){return this[0]?jQuery.css(this[0],lower,false,margin?"margin":"border"):null
};
var type=name.toLowerCase();
jQuery.fn[type]=function(size){return this[0]==window?document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(document.documentElement["client"+name],document.body["scroll"+name],document.documentElement["scroll"+name],document.body["offset"+name],document.documentElement["offset"+name]):size===undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,typeof size==="string"?size:size+"px")
}
})
})();
jQuery.ui||(function($){var _remove=$.fn.remove,isFF2=$.browser.mozilla&&(parseFloat($.browser.version)<1.9);
$.ui={version:"1.7",plugin:{add:function(module,option,set){var proto=$.ui[module].prototype;
for(var i in set){proto.plugins[i]=proto.plugins[i]||[];
proto.plugins[i].push([option,set[i]])
}},call:function(instance,name,args){var set=instance.plugins[name];
if(!set||!instance.element[0].parentNode){return 
}for(var i=0;
i<set.length;
i++){if(instance.options[set[i][0]]){set[i][1].apply(instance.element,args)
}}}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)
},hasScroll:function(el,a){if($(el).css("overflow")=="hidden"){return false
}var scroll=(a&&a=="left")?"scrollLeft":"scrollTop",has=false;
if(el[scroll]>0){return true
}el[scroll]=1;
has=(el[scroll]>0);
el[scroll]=0;
return has
},isOverAxis:function(x,reference,size){return(x>reference)&&(x<(reference+size))
},isOver:function(y,x,top,left,height,width){return $.ui.isOverAxis(y,top,height)&&$.ui.isOverAxis(x,left,width)
},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};
if(isFF2){var attr=$.attr,removeAttr=$.fn.removeAttr,ariaNS="http://www.w3.org/2005/07/aaa",ariaState=/^aria-/,ariaRole=/^wairole:/;
$.attr=function(elem,name,value){var set=value!==undefined;
return(name=="role"?(set?attr.call(this,elem,name,"wairole:"+value):(attr.apply(this,arguments)||"").replace(ariaRole,"")):(ariaState.test(name)?(set?elem.setAttributeNS(ariaNS,name.replace(ariaState,"aaa:"),value):attr.call(this,elem,name.replace(ariaState,"aaa:"))):attr.apply(this,arguments)))
};
$.fn.removeAttr=function(name){return(ariaState.test(name)?this.each(function(){this.removeAttributeNS(ariaNS,name.replace(ariaState,""))
}):removeAttr.call(this,name))
}
}$.fn.extend({remove:function(){$("*",this).add(this).each(function(){$(this).triggerHandler("remove")
});
return _remove.apply(this,arguments)
},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")
},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false
})
},scrollParent:function(){var scrollParent;
if(($.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){scrollParent=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test($.curCSS(this,"position",1))&&(/(auto|scroll)/).test($.curCSS(this,"overflow",1)+$.curCSS(this,"overflow-y",1)+$.curCSS(this,"overflow-x",1))
}).eq(0)
}else{scrollParent=this.parents().filter(function(){return(/(auto|scroll)/).test($.curCSS(this,"overflow",1)+$.curCSS(this,"overflow-y",1)+$.curCSS(this,"overflow-x",1))
}).eq(0)
}return(/fixed/).test(this.css("position"))||!scrollParent.length?$(document):scrollParent
}});
$.extend($.expr[":"],{data:function(elem,i,match){return !!$.data(elem,match[3])
},focusable:function(element){var nodeName=element.nodeName.toLowerCase(),tabIndex=$.attr(element,"tabindex");
return(/input|select|textarea|button|object/.test(nodeName)?!element.disabled:"a"==nodeName||"area"==nodeName?element.href||!isNaN(tabIndex):!isNaN(tabIndex))&&!$(element)["area"==nodeName?"parents":"closest"](":hidden").length
},tabbable:function(element){var tabIndex=$.attr(element,"tabindex");
return(isNaN(tabIndex)||tabIndex>=0)&&$(element).is(":focusable")
}});
function getter(namespace,plugin,method,args){function getMethods(type){var methods=$[namespace][plugin][type]||[];
return(typeof methods=="string"?methods.split(/,?\s+/):methods)
}var methods=getMethods("getter");
if(args.length==1&&typeof args[0]=="string"){methods=methods.concat(getMethods("getterSetter"))
}return($.inArray(method,methods)!=-1)
}$.widget=function(name,prototype){var namespace=name.split(".")[0];
name=name.split(".")[1];
$.fn[name]=function(options){var isMethodCall=(typeof options=="string"),args=Array.prototype.slice.call(arguments,1);
if(isMethodCall&&options.substring(0,1)=="_"){return this
}if(isMethodCall&&getter(namespace,name,options,args)){var instance=$.data(this[0],name);
return(instance?instance[options].apply(instance,args):undefined)
}return this.each(function(){var instance=$.data(this,name);
(!instance&&!isMethodCall&&$.data(this,name,new $[namespace][name](this,options))._init());
(instance&&isMethodCall&&$.isFunction(instance[options])&&instance[options].apply(instance,args))
})
};
$[namespace]=$[namespace]||{};
$[namespace][name]=function(element,options){var self=this;
this.namespace=namespace;
this.widgetName=name;
this.widgetEventPrefix=$[namespace][name].eventPrefix||name;
this.widgetBaseClass=namespace+"-"+name;
this.options=$.extend({},$.widget.defaults,$[namespace][name].defaults,$.metadata&&$.metadata.get(element)[name],options);
this.element=$(element).bind("setData."+name,function(event,key,value){if(event.target==element){return self._setData(key,value)
}}).bind("getData."+name,function(event,key){if(event.target==element){return self._getData(key)
}}).bind("remove",function(){return self.destroy()
})
};
$[namespace][name].prototype=$.extend({},$.widget.prototype,prototype);
$[namespace][name].getterSetter="option"
};
$.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")
},option:function(key,value){var options=key,self=this;
if(typeof key=="string"){if(value===undefined){return this._getData(key)
}options={};
options[key]=value
}$.each(options,function(key,value){self._setData(key,value)
})
},_getData:function(key){return this.options[key]
},_setData:function(key,value){this.options[key]=value;
if(key=="disabled"){this.element[value?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",value)
}},enable:function(){this._setData("disabled",false)
},disable:function(){this._setData("disabled",true)
},_trigger:function(type,event,data){var callback=this.options[type],eventName=(type==this.widgetEventPrefix?type:this.widgetEventPrefix+type);
event=$.Event(event);
event.type=eventName;
if(event.originalEvent){for(var i=$.event.props.length,prop;
i;
){prop=$.event.props[--i];
event[prop]=event.originalEvent[prop]
}}this.element.trigger(event,data);
return !($.isFunction(callback)&&callback.call(this.element[0],event,data)===false||event.isDefaultPrevented())
}};
$.widget.defaults={disabled:false};
$.ui.mouse={_mouseInit:function(){var self=this;
this.element.bind("mousedown."+this.widgetName,function(event){return self._mouseDown(event)
}).bind("click."+this.widgetName,function(event){if(self._preventClickEvent){self._preventClickEvent=false;
event.stopImmediatePropagation();
return false
}});
if($.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");
this.element.attr("unselectable","on")
}this.started=false
},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);
($.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))
},_mouseDown:function(event){event.originalEvent=event.originalEvent||{};
if(event.originalEvent.mouseHandled){return 
}(this._mouseStarted&&this._mouseUp(event));
this._mouseDownEvent=event;
var self=this,btnIsLeft=(event.which==1),elIsCancel=(typeof this.options.cancel=="string"?$(event.target).parents().add(event.target).filter(this.options.cancel).length:false);
if(!btnIsLeft||elIsCancel||!this._mouseCapture(event)){return true
}this.mouseDelayMet=!this.options.delay;
if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){self.mouseDelayMet=true
},this.options.delay)
}if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=(this._mouseStart(event)!==false);
if(!this._mouseStarted){event.preventDefault();
return true
}}this._mouseMoveDelegate=function(event){return self._mouseMove(event)
};
this._mouseUpDelegate=function(event){return self._mouseUp(event)
};
$(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);
($.browser.safari||event.preventDefault());
event.originalEvent.mouseHandled=true;
return true
},_mouseMove:function(event){if($.browser.msie&&!event.button){return this._mouseUp(event)
}if(this._mouseStarted){this._mouseDrag(event);
return event.preventDefault()
}if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,event)!==false);
(this._mouseStarted?this._mouseDrag(event):this._mouseUp(event))
}return !this._mouseStarted
},_mouseUp:function(event){$(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);
if(this._mouseStarted){this._mouseStarted=false;
this._preventClickEvent=(event.target==this._mouseDownEvent.target);
this._mouseStop(event)
}return false
},_mouseDistanceMet:function(event){return(Math.max(Math.abs(this._mouseDownEvent.pageX-event.pageX),Math.abs(this._mouseDownEvent.pageY-event.pageY))>=this.options.distance)
},_mouseDelayMet:function(event){return this.mouseDelayMet
},_mouseStart:function(event){},_mouseDrag:function(event){},_mouseStop:function(event){},_mouseCapture:function(event){return true
}};
$.ui.mouse.defaults={cancel:null,distance:1,delay:0}
})(jQuery);
(function($){var setDataSwitch={dragStart:"start.draggable",drag:"drag.draggable",dragStop:"stop.draggable",maxHeight:"maxHeight.resizable",minHeight:"minHeight.resizable",maxWidth:"maxWidth.resizable",minWidth:"minWidth.resizable",resizeStart:"start.resizable",resize:"drag.resizable",resizeStop:"stop.resizable"},uiDialogClasses="ui-dialog ui-widget ui-widget-content ui-corner-all ";
$.widget("ui.dialog",{_init:function(){this.originalTitle=this.element.attr("title");
var self=this,options=this.options,title=options.title||this.originalTitle||"&nbsp;",titleId=$.ui.dialog.getTitleId(this.element),uiDialog=(this.uiDialog=$("<div/>")).appendTo(document.body).hide().addClass(uiDialogClasses+options.dialogClass).css({position:"absolute",overflow:"hidden",zIndex:options.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(event){(options.closeOnEscape&&event.keyCode&&event.keyCode==$.ui.keyCode.ESCAPE&&self.close(event))
}).attr({role:"dialog","aria-labelledby":titleId}).mousedown(function(event){self.moveToTop(false,event)
}),uiDialogContent=this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(uiDialog),uiDialogTitlebar=(this.uiDialogTitlebar=$("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(uiDialog),uiDialogTitlebarClose=$('<a href="#"/>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){uiDialogTitlebarClose.addClass("ui-state-hover")
},function(){uiDialogTitlebarClose.removeClass("ui-state-hover")
}).focus(function(){uiDialogTitlebarClose.addClass("ui-state-focus")
}).blur(function(){uiDialogTitlebarClose.removeClass("ui-state-focus")
}).mousedown(function(ev){ev.stopPropagation()
}).click(function(event){self.close(event);
return false
}).appendTo(uiDialogTitlebar),uiDialogTitlebarCloseText=(this.uiDialogTitlebarCloseText=$("<span/>")).addClass("ui-icon ui-icon-closethick").text(options.closeText).appendTo(uiDialogTitlebarClose),uiDialogTitle=$("<span/>").addClass("ui-dialog-title").attr("id",titleId).html(title).prependTo(uiDialogTitlebar);
uiDialogTitlebar.find("*").add(uiDialogTitlebar).disableSelection();
(options.draggable&&$.fn.draggable&&this._makeDraggable());
(options.resizable&&$.fn.resizable&&this._makeResizable());
this._createButtons(options.buttons);
this._isOpen=false;
(options.bgiframe&&$.fn.bgiframe&&uiDialog.bgiframe());
(options.autoOpen&&this.open())
},destroy:function(){(this.overlay&&this.overlay.destroy());
this.uiDialog.hide();
this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");
this.uiDialog.remove();
(this.originalTitle&&this.element.attr("title",this.originalTitle))
},close:function(event){var self=this;
if(false===self._trigger("beforeclose",event)){return 
}(self.overlay&&self.overlay.destroy());
self.uiDialog.unbind("keypress.ui-dialog");
(self.options.hide?self.uiDialog.hide(self.options.hide,function(){self._trigger("close",event)
}):self.uiDialog.hide()&&self._trigger("close",event));
$.ui.dialog.overlay.resize();
self._isOpen=false
},isOpen:function(){return this._isOpen
},moveToTop:function(force,event){if((this.options.modal&&!force)||(!this.options.stack&&!this.options.modal)){return this._trigger("focus",event)
}if(this.options.zIndex>$.ui.dialog.maxZ){$.ui.dialog.maxZ=this.options.zIndex
}(this.overlay&&this.overlay.$el.css("z-index",$.ui.dialog.overlay.maxZ=++$.ui.dialog.maxZ));
var saveScroll={scrollTop:this.element.attr("scrollTop"),scrollLeft:this.element.attr("scrollLeft")};
this.uiDialog.css("z-index",++$.ui.dialog.maxZ);
this.element.attr(saveScroll);
this._trigger("focus",event)
},open:function(){if(this._isOpen){return 
}var options=this.options,uiDialog=this.uiDialog;
this.overlay=options.modal?new $.ui.dialog.overlay(this):null;
(uiDialog.next().length&&uiDialog.appendTo("body"));
this._size();
this._position(options.position);
uiDialog.show(options.show);
this.moveToTop(true);
(options.modal&&uiDialog.bind("keypress.ui-dialog",function(event){if(event.keyCode!=$.ui.keyCode.TAB){return 
}var tabbables=$(":tabbable",this),first=tabbables.filter(":first")[0],last=tabbables.filter(":last")[0];
if(event.target==last&&!event.shiftKey){setTimeout(function(){first.focus()
},1)
}else{if(event.target==first&&event.shiftKey){setTimeout(function(){last.focus()
},1)
}}}));
$([]).add(uiDialog.find(".ui-dialog-content :tabbable:first")).add(uiDialog.find(".ui-dialog-buttonpane :tabbable:first")).add(uiDialog).filter(":first").focus();
this._trigger("open");
this._isOpen=true
},_createButtons:function(buttons){var self=this,hasButtons=false,uiDialogButtonPane=$("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");
this.uiDialog.find(".ui-dialog-buttonpane").remove();
(typeof buttons=="object"&&buttons!==null&&$.each(buttons,function(){return !(hasButtons=true)
}));
if(hasButtons){$.each(buttons,function(name,fn){$('<button type="button"></button>').addClass("ui-state-default ui-corner-all").text(name).click(function(){fn.apply(self.element[0],arguments)
}).hover(function(){$(this).addClass("ui-state-hover")
},function(){$(this).removeClass("ui-state-hover")
}).focus(function(){$(this).addClass("ui-state-focus")
}).blur(function(){$(this).removeClass("ui-state-focus")
}).appendTo(uiDialogButtonPane)
});
uiDialogButtonPane.appendTo(this.uiDialog)
}},_makeDraggable:function(){var self=this,options=this.options,heightBeforeDrag;
this.uiDialog.draggable({cancel:".ui-dialog-content",handle:".ui-dialog-titlebar",containment:"document",start:function(){heightBeforeDrag=options.height;
$(this).height($(this).height()).addClass("ui-dialog-dragging");
(options.dragStart&&options.dragStart.apply(self.element[0],arguments))
},drag:function(){(options.drag&&options.drag.apply(self.element[0],arguments))
},stop:function(){$(this).removeClass("ui-dialog-dragging").height(heightBeforeDrag);
(options.dragStop&&options.dragStop.apply(self.element[0],arguments));
$.ui.dialog.overlay.resize()
}})
},_makeResizable:function(handles){handles=(handles===undefined?this.options.resizable:handles);
var self=this,options=this.options,resizeHandles=typeof handles=="string"?handles:"n,e,s,w,se,sw,ne,nw";
this.uiDialog.resizable({cancel:".ui-dialog-content",alsoResize:this.element,maxWidth:options.maxWidth,maxHeight:options.maxHeight,minWidth:options.minWidth,minHeight:options.minHeight,start:function(){$(this).addClass("ui-dialog-resizing");
(options.resizeStart&&options.resizeStart.apply(self.element[0],arguments))
},resize:function(){(options.resize&&options.resize.apply(self.element[0],arguments))
},handles:resizeHandles,stop:function(){$(this).removeClass("ui-dialog-resizing");
options.height=$(this).height();
options.width=$(this).width();
(options.resizeStop&&options.resizeStop.apply(self.element[0],arguments));
$.ui.dialog.overlay.resize()
}}).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")
},_position:function(pos){var wnd=$(window),doc=$(document),pTop=doc.scrollTop(),pLeft=doc.scrollLeft(),minTop=pTop;
if($.inArray(pos,["center","top","right","bottom","left"])>=0){pos=[pos=="right"||pos=="left"?pos:"center",pos=="top"||pos=="bottom"?pos:"middle"]
}if(pos.constructor!=Array){pos=["center","middle"]
}if(pos[0].constructor==Number){pLeft+=pos[0]
}else{switch(pos[0]){case"left":pLeft+=0;
break;
case"right":pLeft+=wnd.width()-this.uiDialog.outerWidth();
break;
default:case"center":pLeft+=(wnd.width()-this.uiDialog.outerWidth())/2
}}if(pos[1].constructor==Number){pTop+=pos[1]
}else{switch(pos[1]){case"top":pTop+=0;
break;
case"bottom":pTop+=wnd.height()-this.uiDialog.outerHeight();
break;
default:case"middle":pTop+=(wnd.height()-this.uiDialog.outerHeight())/2
}}pTop=Math.max(pTop,minTop);
this.uiDialog.css({top:pTop,left:pLeft})
},_setData:function(key,value){(setDataSwitch[key]&&this.uiDialog.data(setDataSwitch[key],value));
switch(key){case"buttons":this._createButtons(value);
break;
case"closeText":this.uiDialogTitlebarCloseText.text(value);
break;
case"dialogClass":this.uiDialog.removeClass(this.options.dialogClass).addClass(uiDialogClasses+value);
break;
case"draggable":(value?this._makeDraggable():this.uiDialog.draggable("destroy"));
break;
case"height":this.uiDialog.height(value);
break;
case"position":this._position(value);
break;
case"resizable":var uiDialog=this.uiDialog,isResizable=this.uiDialog.is(":data(resizable)");
(isResizable&&!value&&uiDialog.resizable("destroy"));
(isResizable&&typeof value=="string"&&uiDialog.resizable("option","handles",value));
(isResizable||this._makeResizable(value));
break;
case"title":$(".ui-dialog-title",this.uiDialogTitlebar).html(value||"&nbsp;");
break;
case"width":this.uiDialog.width(value);
break
}$.widget.prototype._setData.apply(this,arguments)
},_size:function(){var options=this.options;
this.element.css({height:0,minHeight:0,width:"auto"});
var nonContentHeight=this.uiDialog.css({height:"auto",width:options.width}).height();
this.element.css({minHeight:Math.max(options.minHeight-nonContentHeight,0),height:options.height=="auto"?"auto":Math.max(options.height-nonContentHeight,0)})
}});
$.extend($.ui.dialog,{version:"1.7",defaults:{autoOpen:true,bgiframe:false,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:"center",resizable:true,show:null,stack:true,title:"",width:300,zIndex:1000},getter:"isOpen",uuid:0,maxZ:0,getTitleId:function($el){return"ui-dialog-title-"+($el.attr("id")||++this.uuid)
},overlay:function(dialog){this.$el=$.ui.dialog.overlay.create(dialog)
}});
$.extend($.ui.dialog.overlay,{instances:[],maxZ:0,events:$.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(event){return event+".dialog-overlay"
}).join(" "),create:function(dialog){if(this.instances.length===0){setTimeout(function(){$(document).bind($.ui.dialog.overlay.events,function(event){var dialogZ=$(event.target).parents(".ui-dialog").css("zIndex")||0;
return(dialogZ>$.ui.dialog.overlay.maxZ)
})
},1);
$(document).bind("keydown.dialog-overlay",function(event){(dialog.options.closeOnEscape&&event.keyCode&&event.keyCode==$.ui.keyCode.ESCAPE&&dialog.close(event))
});
$(window).bind("resize.dialog-overlay",$.ui.dialog.overlay.resize)
}var $el=$("<div></div>").appendTo(document.body).addClass("ui-widget-overlay").css({width:this.width(),height:this.height()});
(dialog.options.bgiframe&&$.fn.bgiframe&&$el.bgiframe());
this.instances.push($el);
return $el
},destroy:function($el){this.instances.splice($.inArray(this.instances,$el),1);
if(this.instances.length===0){$([document,window]).unbind(".dialog-overlay")
}$el.remove()
},height:function(){if($.browser.msie&&$.browser.version<7){var scrollHeight=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);
var offsetHeight=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);
if(scrollHeight<offsetHeight){return $(window).height()+"px"
}else{return scrollHeight+"px"
}}else{return $(document).height()+"px"
}},width:function(){if($.browser.msie&&$.browser.version<7){var scrollWidth=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);
var offsetWidth=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);
if(scrollWidth<offsetWidth){return $(window).width()+"px"
}else{return scrollWidth+"px"
}}else{return $(document).width()+"px"
}},resize:function(){var $overlays=$([]);
$.each($.ui.dialog.overlay.instances,function(){$overlays=$overlays.add(this)
});
$overlays.css({width:0,height:0}).css({width:$.ui.dialog.overlay.width(),height:$.ui.dialog.overlay.height()})
}});
$.extend($.ui.dialog.overlay.prototype,{destroy:function(){$.ui.dialog.overlay.destroy(this.$el)
}})
})(jQuery);
/*
 * jQuery UI 1.7.2
 *
 * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI
 */
jQuery.ui||(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7.2",plugin:{add:function(k,l,n){var m=c.ui[k].prototype;for(var j in n){m.plugins[j]=m.plugins[j]||[];m.plugins[j].push([l,n[j]])}},call:function(j,l,k){var n=j.plugins[l];if(!n||!j.element[0].parentNode){return}for(var m=0;m<n.length;m++){if(j.options[n[m][0]]){n[m][1].apply(j.element,k)}}}},contains:function(k,j){return document.compareDocumentPosition?k.compareDocumentPosition(j)&16:k!==j&&k.contains(j)},hasScroll:function(m,k){if(c(m).css("overflow")=="hidden"){return false}var j=(k&&k=="left")?"scrollLeft":"scrollTop",l=false;if(m[j]>0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return i.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);;/*
 * jQuery UI Slider 1.7.2
 *
 * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Slider
 *
 * Depends:
 *	ui.core.js
 */
(function(a){a.widget("ui.slider",a.extend({},a.ui.mouse,{_init:function(){var b=this,c=this.options;this._keySliding=false;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all");this.range=a([]);if(c.range){if(c.range===true){this.range=a("<div></div>");if(!c.values){c.values=[this._valueMin(),this._valueMin()]}if(c.values.length&&c.values.length!=2){c.values=[c.values[0],c.values[0]]}}else{this.range=a("<div></div>")}this.range.appendTo(this.element).addClass("ui-slider-range");if(c.range=="min"||c.range=="max"){this.range.addClass("ui-slider-range-"+c.range)}this.range.addClass("ui-widget-header")}if(a(".ui-slider-handle",this.element).length==0){a('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle")}if(c.values&&c.values.length){while(a(".ui-slider-handle",this.element).length<c.values.length){a('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle")}}this.handles=a(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(d){d.preventDefault()}).hover(function(){if(!c.disabled){a(this).addClass("ui-state-hover")}},function(){a(this).removeClass("ui-state-hover")}).focus(function(){if(!c.disabled){a(".ui-slider .ui-state-focus").removeClass("ui-state-focus");a(this).addClass("ui-state-focus")}else{a(this).blur()}}).blur(function(){a(this).removeClass("ui-state-focus")});this.handles.each(function(d){a(this).data("index.ui-slider-handle",d)});this.handles.keydown(function(i){var f=true;var e=a(this).data("index.ui-slider-handle");if(b.options.disabled){return}switch(i.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:f=false;if(!b._keySliding){b._keySliding=true;a(this).addClass("ui-state-active");b._start(i,e)}break}var g,d,h=b._step();if(b.options.values&&b.options.values.length){g=d=b.values(e)}else{g=d=b.value()}switch(i.keyCode){case a.ui.keyCode.HOME:d=b._valueMin();break;case a.ui.keyCode.END:d=b._valueMax();break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(g==b._valueMax()){return}d=g+h;break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(g==b._valueMin()){return}d=g-h;break}b._slide(i,e,d);return f}).keyup(function(e){var d=a(this).data("index.ui-slider-handle");if(b._keySliding){b._stop(e,d);b._change(e,d);b._keySliding=false;a(this).removeClass("ui-state-active")}});this._refreshValue()},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy()},_mouseCapture:function(d){var e=this.options;if(e.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();var h={x:d.pageX,y:d.pageY};var j=this._normValueFromMouse(h);var c=this._valueMax()-this._valueMin()+1,f;var k=this,i;this.handles.each(function(l){var m=Math.abs(j-k.values(l));if(c>m){c=m;f=a(this);i=l}});if(e.range==true&&this.values(1)==e.min){f=a(this.handles[++i])}this._start(d,i);k._handleIndex=i;f.addClass("ui-state-active").focus();var g=f.offset();var b=!a(d.target).parents().andSelf().is(".ui-slider-handle");this._clickOffset=b?{left:0,top:0}:{left:d.pageX-g.left-(f.width()/2),top:d.pageY-g.top-(f.height()/2)-(parseInt(f.css("borderTopWidth"),10)||0)-(parseInt(f.css("borderBottomWidth"),10)||0)+(parseInt(f.css("marginTop"),10)||0)};j=this._normValueFromMouse(h);this._slide(d,i,j);return true},_mouseStart:function(b){return true},_mouseDrag:function(d){var b={x:d.pageX,y:d.pageY};var c=this._normValueFromMouse(b);this._slide(d,this._handleIndex,c);return false},_mouseStop:function(b){this.handles.removeClass("ui-state-active");this._stop(b,this._handleIndex);this._change(b,this._handleIndex);this._handleIndex=null;this._clickOffset=null;return false},_detectOrientation:function(){this.orientation=this.options.orientation=="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(d){var c,h;if("horizontal"==this.orientation){c=this.elementSize.width;h=d.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{c=this.elementSize.height;h=d.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}var f=(h/c);if(f>1){f=1}if(f<0){f=0}if("vertical"==this.orientation){f=1-f}var e=this._valueMax()-this._valueMin(),i=f*e,b=i%this.options.step,g=this._valueMin()+i-b;if(b>(this.options.step/2)){g+=this.options.step}return parseFloat(g.toFixed(5))},_start:function(d,c){var b={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){b.value=this.values(c);b.values=this.values()}this._trigger("start",d,b)},_slide:function(f,e,d){var g=this.handles[e];if(this.options.values&&this.options.values.length){var b=this.values(e?0:1);if((this.options.values.length==2&&this.options.range===true)&&((e==0&&d>b)||(e==1&&d<b))){d=b}if(d!=this.values(e)){var c=this.values();c[e]=d;var h=this._trigger("slide",f,{handle:this.handles[e],value:d,values:c});var b=this.values(e?0:1);if(h!==false){this.values(e,d,(f.type=="mousedown"&&this.options.animate),true)}}}else{if(d!=this.value()){var h=this._trigger("slide",f,{handle:this.handles[e],value:d});if(h!==false){this._setData("value",d,(f.type=="mousedown"&&this.options.animate))}}}},_stop:function(d,c){var b={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){b.value=this.values(c);b.values=this.values()}this._trigger("stop",d,b)},_change:function(d,c){var b={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){b.value=this.values(c);b.values=this.values()}this._trigger("change",d,b)},value:function(b){if(arguments.length){this._setData("value",b);this._change(null,0)}return this._value()},values:function(b,e,c,d){if(arguments.length>1){this.options.values[b]=e;this._refreshValue(c);if(!d){this._change(null,b)}}if(arguments.length){if(this.options.values&&this.options.values.length){return this._values(b)}else{return this.value()}}else{return this._values()}},_setData:function(b,d,c){a.widget.prototype._setData.apply(this,arguments);switch(b){case"disabled":if(d){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled")}else{this.handles.removeAttr("disabled")}case"orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue(c);break;case"value":this._refreshValue(c);break}},_step:function(){var b=this.options.step;return b},_value:function(){var b=this.options.value;if(b<this._valueMin()){b=this._valueMin()}if(b>this._valueMax()){b=this._valueMax()}return b},_values:function(b){if(arguments.length){var c=this.options.values[b];if(c<this._valueMin()){c=this._valueMin()}if(c>this._valueMax()){c=this._valueMax()}return c}else{return this.options.values}},_valueMin:function(){var b=this.options.min;return b},_valueMax:function(){var b=this.options.max;return b},_refreshValue:function(c){var f=this.options.range,d=this.options,l=this;if(this.options.values&&this.options.values.length){var i,h;this.handles.each(function(p,n){var o=(l.values(p)-l._valueMin())/(l._valueMax()-l._valueMin())*100;var m={};m[l.orientation=="horizontal"?"left":"bottom"]=o+"%";a(this).stop(1,1)[c?"animate":"css"](m,d.animate);if(l.options.range===true){if(l.orientation=="horizontal"){(p==0)&&l.range.stop(1,1)[c?"animate":"css"]({left:o+"%"},d.animate);(p==1)&&l.range[c?"animate":"css"]({width:(o-lastValPercent)+"%"},{queue:false,duration:d.animate})}else{(p==0)&&l.range.stop(1,1)[c?"animate":"css"]({bottom:(o)+"%"},d.animate);(p==1)&&l.range[c?"animate":"css"]({height:(o-lastValPercent)+"%"},{queue:false,duration:d.animate})}}lastValPercent=o})}else{var j=this.value(),g=this._valueMin(),k=this._valueMax(),e=k!=g?(j-g)/(k-g)*100:0;var b={};b[l.orientation=="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[c?"animate":"css"](b,d.animate);(f=="min")&&(this.orientation=="horizontal")&&this.range.stop(1,1)[c?"animate":"css"]({width:e+"%"},d.animate);(f=="max")&&(this.orientation=="horizontal")&&this.range[c?"animate":"css"]({width:(100-e)+"%"},{queue:false,duration:d.animate});(f=="min")&&(this.orientation=="vertical")&&this.range.stop(1,1)[c?"animate":"css"]({height:e+"%"},d.animate);(f=="max")&&(this.orientation=="vertical")&&this.range[c?"animate":"css"]({height:(100-e)+"%"},{queue:false,duration:d.animate})}}}));a.extend(a.ui.slider,{getter:"value values",version:"1.7.2",eventPrefix:"slide",defaults:{animate:false,delay:0,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null}})})(jQuery);;
function adjustIframeModalHeight(el){
    if ( $(".modalWindow").length > 0 || $(".modalDialog").length > 0 ){
        var height = $("body").height();
        window.parent.setIframeModalHeight( el, height );
        
        height = $("body").height();
        window.parent.setIframeModalHeight( el, height );
    }
}
function setIframeModalHeight(el, height){
    $(el).height(height);
}

//To increase or decrease the height to iframe as per needed.
function autoAdjustIframeModalHeight(){
    if ( $(".modalWindow").length > 0 || $(".modalDialog").length > 0 ){
		var height = $("body").height();
		try { window.parent.setAllIframeModalHeight( height ); } catch (e){}
		
        $(window).load(function(){
            var height = $("body").height();
            try { window.parent.setAllIframeModalHeight( height ); } catch (e){}
        });
    }
}
function setAllIframeModalHeight(height){
    $("body > .ui-dialog > .ui-dialog-content:visible").each(function(){
        if ( !$(this).find("iframe").hasClass("modalNoResize") ){
            $(this).height(height);
            if ( $(this).find("iframe").length > 0 ){
                $(this).find("iframe").height(height);
            }
        }
    });
}

function closeModalWindow( sel ){
    if ( window.parent == window ){
        try {
            $( sel ).dialog( 'close' );
        } catch (e) {}
    } else {
        try {
            window.parent.$( sel ).dialog( 'close' );
        } catch (e) {}
    }
}

function closeAllModalWindows(){
    $("body > .ui-dialog > .ui-dialog-content").each(function(){
        $(this).dialog("close");
    });
}

function hideAllModalWindows(){
    $(".ui-widget-overlay, .ui-dialog").css("display", "none");
}

function pageRefresh(){
    document.location.href = document.location.href;
}

var polygon;
var map;
var map2
var neighborhood;
var neighborhoodsArray = new Array();
var merchantArray = new Array();
var selectedIcon;
var _isUberMap = false;
var _displayedMarkerCount = 0;
var gdir;
var geocoder = null;
var addressMarker;
var openMerchantTypes = new Array();
var imgPath = '/VailResorts/sites/keystone/assets/img/';
var timeDelay = 0;

function loadMap(_xmlPath) {

    if ($.browser.msie6 == true && _xmlPath.indexOf('merchantType') > -1 ) {
  
        timeDelay = 7000;
    }
    else if (jQuery.browser.msie && _xmlPath.indexOf('merchantType') && (jQuery.browser.version >= 7)) {
        timeDelay = 3000;
    }
    else {
        timeDelay = 100;
        
    }
   
        //timeDelay = 7000;
    setTimeout(function() {
        if (GBrowserIsCompatible()) {
        
            var mapGMap = document.getElementById("map");
            if (mapGMap) {
                map = new GMap2(mapGMap);
                // bind a search control to the map, suppress result list
                //map.addControl(new google.maps.LocalSearch(), new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(10,20)))
                map.setUIToDefault();
                map.disableDoubleClickZoom();
                map.disableScrollWheelZoom();
                map2 = new GMap2(document.getElementById("map2"));
                map2.addControl(new GSmallMapControl());
                gdir = new GDirections(map2, document.getElementById("directions"));
                GEvent.addListener(gdir, "error", handleErrors);
                GEvent.addListener(gdir, "addoverlay", onGDirectionsLoad);
                selectedIcon = new GIcon();
                selectedIcon.shadow = imgPath + "marker_shadow.png";
                selectedIcon.iconSize = new GSize(25, 30);
                selectedIcon.shadowSize = new GSize(39, 12);
                selectedIcon.iconAnchor = new GPoint(19, 26);
                selectedIcon.infoWindowAnchor = new GPoint(15, 2);
                selectedIcon.infoShadowAnchor = new GPoint(22, 8);
                selectedIcon.image = imgPath + "marker_selected.png";

                GDownloadUrl(_xmlPath, buildMarkers);
            }
        }
    }, timeDelay);
}


function buildMarkers(data, responseCode) {
    merchantArray = new Array();
    
    var xml = GXml.parse(data);

    var docRootNode = xml.documentElement;
    if (docRootNode.getAttribute("IsUberMap") == "true") {
        _isUberMap = true;
        // TODO: if this isn't an uber map??
    }

    var merchantTypes = xml.documentElement.getElementsByTagName("MerchantType");
    if (_isUberMap) {
        var neighborhoods = xml.documentElement.getElementsByTagName("Neighborhood");
        map.setCenter(new GLatLng(parseFloat(docRootNode.getAttribute("CenterLatitude")), parseFloat(docRootNode.getAttribute("CenterLongitude"))), parseInt(docRootNode.getAttribute("ZoomLevel")));
        map2.setCenter(new GLatLng(parseFloat(docRootNode.getAttribute("CenterLatitude")), parseFloat(docRootNode.getAttribute("CenterLongitude"))), parseInt(docRootNode.getAttribute("ZoomLevel")));
    }

    switch (docRootNode.getAttribute("MapType")) {
        case "Hybrid":
            map.setMapType(G_HYBRID_MAP);
            break;
        case "Normal":
            map.setMapType(G_NORMAL_MAP);
            break;
        case "Physical":
            map.setMapType(G_PHYSICAL_MAP);
            break;
        case "Satellite":
            map.setMapType(G_SATELLITE_MAP);
            break;
    }

    if (_isUberMap) {
        // the map icon in the location filter section
        document.getElementById("mapThumbnailImg").src = docRootNode.getAttribute("MapImage");
        // map instructions
        document.getElementById("mapInstructions").innerHTML = GXml.value(docRootNode.getElementsByTagName("MapInstructions")[0]);


        if (neighborhoods.length == 0) {
            document.getElementById("neighborhoods").style.display = "none";
        }
        else {
            document.getElementById("neighborhoods").style.display = "block";
            for (i = 0; i < neighborhoods.length; i++) {
                var thisHood = neighborhoods[i];
                var points = new Array();
                for (p = 0; p < thisHood.getElementsByTagName("Point").length; p++) {
                    var thisPoint = thisHood.getElementsByTagName("Point")[p];
                    points.push(new GLatLng(parseFloat(thisPoint.getAttribute("Latitude")), parseFloat(thisPoint.getAttribute("Longitude"))));
                }
                var neighborhood = {
                
                    name: thisHood.getAttribute("Name"),
                    icon: thisHood.getAttribute("Icon")+"?x=.png",
                    markerWidth: thisHood.getAttribute("MarkerWidth"),
                    markerHeight: thisHood.getAttribute("MarkerHeight"),
                    center: new GLatLng(parseFloat(thisHood.getAttribute("CenterLatitude")), parseFloat(thisHood.getAttribute("CenterLongitude"))),
                    fillColor: thisHood.getAttribute("FillColor"),
                    lineColor: thisHood.getAttribute("LineColor"),
                    opacity: thisHood.getAttribute("Opacity"),
                    polyPoints: points
                };
                neighborhood.marker = createNeighborhoodMarker(neighborhood);
                neighborhood.polygon = createNeighborhoodPolygon(neighborhood)
                neighborhoodsArray.push(neighborhood);
            }
            drawNeighborhoods();
        }
    }
    else {
        // nothing, because the neighborhood section is hidden here
    }

    for (i = 0; i < merchantTypes.length; i++) {
        var thisType = merchantTypes[i];
        var merchantType = thisType.getAttribute("Name");
        var merchantTypeNoSpaces = xreplace(merchantType, " ", "");
        var merchants = thisType.getElementsByTagName("Merchant");
        var markerImage = thisType.getAttribute("Marker")+"?x=.png";
        var markerWidth = thisType.getAttribute("MarkerWidth");
        var markerHeight = thisType.getAttribute("MarkerHeight");
        var merchantIcon = thisType.getAttribute("Icon")+"?x=.png";
        var icon = buildIcon(markerImage, markerWidth, markerHeight);

        var merchantTypeMerchantArray = new Array();

        var merchantTypeObj = {
            name: merchantType,
            nameNoSpaces: merchantTypeNoSpaces,
            markerImage: markerImage,
            markerWidth: markerWidth,
            markerHeight: markerHeight,
            merchantTypeIcon: merchantIcon,
            icon: icon
        };

        // what are we filtering on?
        var filterTypeArray = new Array();
        var filterTypes = thisType.getElementsByTagName("Filter");
        for (f = 0; f < filterTypes.length; f++) {
            var thisType = {
                name: filterTypes[f].getAttribute("Name"),
                displayName: filterTypes[f].getAttribute("DisplayName")
            };
            filterTypeArray.push(thisType);
        }

        //old: 
        //var filterType = thisType.getElementsByTagName("Filter")[0].getAttribute("Name");
        var filterType = filterTypes[0].getAttribute("Name");

        // now, the subdivs for each filter type will come from the merchants themselves
        var filterOpts = new Array();
       
        for (m = 0; m < merchants.length; m++) {
            var thisMerchant = merchants[m];
            
            if (thisMerchant.getAttribute("Latitude") != "0" && thisMerchant.getAttribute("Longitude") != "0") {
            
				var merchant = {
					name: thisMerchant.getAttribute("Name"),
					address: trim(GXml.value(thisMerchant.getElementsByTagName("Address")[0])),
					description: GXml.value(thisMerchant.getElementsByTagName("Description")[0]),
					shortDescription: thisMerchant.getAttribute("ShortDescription"),
					location: thisMerchant.getAttribute("Location"),
					type: merchantType,
					typeNoSpaces: merchantTypeNoSpaces,
					typeMarker: markerImage,
					typeIcon: merchantIcon,
					photo: thisMerchant.getAttribute("Photo"),
					filterValues: thisMerchant.getAttribute(filterType).split("|"),
					phone: trim(thisMerchant.getAttribute("Phone")),
					latitude: thisMerchant.getAttribute("Latitude"),
					longitude: thisMerchant.getAttribute("Longitude"),
					point: new GLatLng(parseFloat(thisMerchant.getAttribute("Latitude")), parseFloat(thisMerchant.getAttribute("Longitude"))),
					currentlyDisplayedByFilters: true,
					currentlyDisplayedByLocation: true,
					currentlyDisplayedByMerchantType: true,
					allowDrivingDirections: thisMerchant.getAttribute("AllowDrivingDirections"),
					merchantType: merchantTypeObj,
					Amenities: thisMerchant.getAttribute("Amenities"),
					UnitSize: thisMerchant.getAttribute("UnitSize"),
					merchantDetailUrl: thisMerchant.getAttribute("MerchantDetailUrl"),
					merchantSaveUrl: thisMerchant.getAttribute("MerchantSaveUrl"),
					merchantBookUrl: thisMerchant.getAttribute("MerchantBookUrl"),               
					website: thisMerchant.getAttribute("WebSiteUrl"),
					hours: thisMerchant.getAttribute("Hours"),
					reservationLink: thisMerchant.getAttribute("ReservationLink"),
					reservationLinkInternal: thisMerchant.getAttribute("IsReservationLinkInternal"),
					featuredMerchant: thisMerchant.getAttribute("IsFeaturedMerchant"),
					price: thisMerchant.getAttribute("Expense"),
					systemName: thisMerchant.getAttribute("SystemName"),
					ratingImageUrl : thisMerchant.getAttribute("RatingImageUrl"),
					myTripFolderGUID: thisMerchant.getAttribute("MyTripFolderGUID")
				};

				// dynamically create properties for each of our filter types
				for (fil = 0; fil < filterTypeArray.length; fil++) {
					merchant[filterTypeArray[fil].name] = thisMerchant.getAttribute(filterTypeArray[fil].name);
				}

				merchant.infoWindowHtml = createInfoWindow(merchant);
				var markerOptions = { icon: icon };
				var marker = new GMarker(merchant.point, markerOptions);
				//marker.bindInfoWindowHtml(merchant.infoWindowHtml);
				if (merchant.allowDrivingDirections != "False") {

					var tab1 = new GInfoWindowTab("Details", merchant.infoWindowHtml);
					var tab2 = new GInfoWindowTab("Directions", buildDirectionsTab(merchant));
					var arrTabs = new Array();
					arrTabs.push(tab1);
					arrTabs.push(tab2);
					marker.bindInfoWindowTabsHtml(arrTabs);
					merchant.hasTabs = true;
					merchant.infoWindowTabs = arrTabs;
				}
				else {

					marker.bindInfoWindowHtml(merchant.infoWindowHtml);
					merchant.hasTabs = false;
				}
				merchant.marker = marker;
				map.addOverlay(marker);

				merchantArray.push(merchant);
				merchantTypeMerchantArray.push(merchant);				
			}
        }

        // add an object to the merchantTypeObj that has all of the filter types and options
        merchantTypeObj.filterTypes = filterTypeArray;
        merchantTypeObj.merchants = merchantTypeMerchantArray;
        if (_isUberMap) {
            createMerchantTypeTab(merchantTypeObj);
        }
    }

    if (_isUberMap) {
        setupFilterTabs();
        setupLocations();
    }
    drawResults();

    setupSlider();

}

function buildDirectionsTab(merchant) {
    var addr = xreplace(trim(merchant.address), "<br />", ", ");
    addr = xreplace(addr, "<br>", ", ");
    addr = xreplace(addr, "<br/>", ", ");

    var retHtml = "";

    if (merchant.merchantDetailUrl != null)
        var merchantDetailUrl = merchant.merchantDetailUrl;
    var currentUrl = (location.pathname + location.search).split('#')[0];
    if ((merchant.merchantDetailUrl != null) && (merchant.merchantDetailUrl != currentUrl)) {
        retHtml += "<div class='popupMerchantName'><a href='" + merchant.merchantDetailUrl + "'>" + merchant.name + "</a></div>";
    }
    else {
        retHtml += "<div class='popupMerchantName'><a href='#'>" + merchant.name + "</a></div>";
    }

    //var retHtml = "<form action='#' onsubmit=''>";
    retHtml += "<div class='dirHeader'>Get Directions ";
    retHtml += "<a id='dirTo' href='javascript:setDirectionsTo()'>To</a>";
    retHtml += "<span id='spnDirTo' class='dirSel'>To</span>";
    retHtml += " | ";
    retHtml += "<a id='dirFrom' href='javascript:setDirectionsFrom()'>From</a>";
    retHtml += "<span id='spnDirFrom' class='dirSel'>From</span>";
    retHtml += "&nbsp;&nbsp;" + merchant.name + "</div>";
    retHtml += "<br class='clear' />";
    retHtml += "<div class='dirLabel'>From:</div>";
    retHtml += "<div class='dirInput' id='dirInputFromForm'><input type='text' autocomplete='off' class='directions' id='fromAddress' name='from' value='' onkeypress='doDirectionSearchKeyPress(event);'/></div>";
    retHtml += "<div class='dirInput' id='dirInputFromLabel'>" + merchant.name + "</div>";
    retHtml += "<br class='clear'/>";
    retHtml += "<div class='dirLabel'>To:</div>";
    retHtml += "<div class='dirInput' id='dirInputToForm'><input type='text' autocomplete='off' class='directions' id='toAddress' name='to' value='' onkeypress='doDirectionSearchKeyPress(event);'/></div>";
    //retHtml += "<div class='dirInput'><input type='text' class='directions' id='toAddress' name='to' value='" + merchant.latitude + ", " + merchant.longitude + "'></div>";
    retHtml += "<div class='dirInput' id='dirInputToLabel'>" + merchant.name + "</div>";
    retHtml += "<br class='clear' />";
    //retHtml += "<input type='submit' value='Get Directions'>";
    retHtml += "<input type='hidden' id='direction' value='To' />";
    //retHtml += "<input type='hidden' id='merchantGeocode' value='" + merchant.latitude + ", " + merchant.longitude + "' />";
    //710 N Summit Blvd # 101, Frisco, CO (Starbucks) @39.576783,-106.092512
    retHtml += "<input type='hidden' id='merchantGeocode' value='";
    
    if (merchant.address != "") {
          
        retHtml += xreplace(merchant.address, "<br />", ", ");
    }
    retHtml += " (" + merchant.name + ") @" + merchant.latitude + "," + merchant.longitude + "' />";
    retHtml += "<br />";
    retHtml += "<span class='button'><a href='javascript:setDirections()' class='btnPlus'>Get Directions</a></span>";
    return retHtml;
}
function setDirectionsTo() {
    document.getElementById("dirTo").style.display = "none";
    document.getElementById("dirFrom").style.display = "inline";
    document.getElementById("spnDirTo").style.display = "inline";
    document.getElementById("spnDirFrom").style.display = "none";
    document.getElementById("direction").value = "To";
    document.getElementById("dirInputFromForm").style.display = "block";
    document.getElementById("dirInputToForm").style.display = "none";
    document.getElementById("dirInputFromLabel").style.display = "none";
    document.getElementById("dirInputToLabel").style.display = "block";
}
function setDirectionsFrom() {
    document.getElementById("dirTo").style.display = "inline";
    document.getElementById("dirFrom").style.display = "none";
    document.getElementById("spnDirTo").style.display = "none";
    document.getElementById("spnDirFrom").style.display = "inline";
    document.getElementById("direction").value = "From";
    document.getElementById("dirInputFromForm").style.display = "none";
    document.getElementById("dirInputToForm").style.display = "block";
    document.getElementById("dirInputFromLabel").style.display = "block";
    document.getElementById("dirInputToLabel").style.display = "none";
}
function drawResults() {
    _displayedMarkerCount = 0;
    if (document.getElementById("resultsContainerContents").hasChildNodes()) {
        while (document.getElementById("resultsContainerContents").childNodes.length >= 1) {
            document.getElementById("resultsContainerContents").removeChild(document.getElementById("resultsContainerContents").firstChild);
        }
    }
    var lastType = "";
    var merchantTypeResultContainer = document.createElement("div");
    merchantTypeResultContainer.className = "resultMerchantTypeContainer";
    var merchantTypeResultListContainer = document.createElement("div");
    merchantTypeResultListContainer.className = "merchantTypeResultListContainer";
    var merchantCount = 0;

    for (i = 0; i < merchantArray.length; i++) {
        if (merchantArray[i].currentlyDisplayedByFilters == true &&
			merchantArray[i].currentlyDisplayedByMerchantType == true &&
			merchantArray[i].currentlyDisplayedByLocation == true) {

            if (lastType != merchantArray[i].type) {
                lastType = merchantArray[i].type;

                if (merchantTypeResultContainer.getElementsByTagName("div").length > 0) {
                    typeNameDiv.innerHTML += " (" + merchantCount + ")";
                    merchantTypeResultContainer.appendChild(merchantTypeResultListContainer);
                    document.getElementById("resultsContainerContents").appendChild(merchantTypeResultContainer);
                    merchantTypeResultContainer = document.createElement("div");
                    merchantTypeResultContainer.className = "resultMerchantTypeContainer";

                    merchantTypeResultListContainer = document.createElement("div");
                    merchantTypeResultListContainer.className = "merchantTypeResultListContainer";
                }

                merchantTypeResultListContainer.id = "resultList_" + merchantArray[i].typeNoSpaces;

                var typeNameContainer = document.createElement("div");
                typeNameContainer.className = "resultMerchantTypeNameContainer";

                var typeNameDiv = document.createElement("div");
                typeNameDiv.className = "resultMerchantTypeName";
                var typeName = document.createTextNode(lastType);
                typeNameDiv.appendChild(typeName);
                typeNameContainer.appendChild(typeNameDiv);

                var typeCollapseExpandDiv = document.createElement("div");
                typeCollapseExpandDiv.className = "resultMerchantTypeCollapseExpand";

                var typeCollapseExpandImg = document.createElement("img");
                typeCollapseExpandImg.id = "resultImg_" + merchantArray[i].typeNoSpaces;
                typeCollapseExpandImg.onclick = function() { showHideTypeResults(this, true); }
                typeCollapseExpandImg.src = imgPath + "resultMerchantTypePlus.gif";
                typeCollapseExpandDiv.appendChild(typeCollapseExpandImg);

                typeNameContainer.appendChild(typeCollapseExpandDiv);

                merchantTypeResultContainer.appendChild(typeNameContainer);

                merchantCount = 0;
            }

            merchantCount++;
            _displayedMarkerCount++;

            //Identify and highlight featured merchants 
            var resultDiv = document.createElement("div");
            var isFeatured = merchantArray[i].featuredMerchant;
            //if ( i == 0 ) resultDiv.className = "resultMerchantDetailContainer first-child";
            //else resultDiv.className = "resultMerchantDetailContainer";
            if (i == 0 && isFeatured == "true") {
                resultDiv.className = "resultMerchantDetailContainer resortMapFeaturedFirstChild";
            }
            else if (i == 0) {
                resultDiv.className = "resultMerchantDetailContainer first-child";
            }
            else if (isFeatured == "true") {
                resultDiv.className = "resultMerchantDetailContainer resortMapFeatured";
            }
            else {
                resultDiv.className = "resultMerchantDetailContainer";
            }

            var resultDetailsDiv = document.createElement("div");
            resultDetailsDiv.className = "resultMerchantDetailCopy";
            //resultDetailsDiv.style.background = "url(" + merchantArray[i].typeIcon + ")";
            //alert(merchantArray[i].merchantType.merchantTypeIcon);
            //resultDetailsDiv.style.background = "url('" + imgPath + merchantArray[i].merchantType.merchantTypeIcon + "')";
            resultDetailsDiv.style.background = "url('" + merchantArray[i].merchantType.merchantTypeIcon + "')";
            resultDetailsDiv.style.backgroundRepeat = "no-repeat";

            var resultHyperlink = document.createElement("a");
            resultHyperlink.id = "result" + i;
            resultHyperlink.href = "javascript:showMerchantInfo(" + i + ")";
            resultHyperlink.className = "resultMerchantName";
            resultHyperlink.onmouseover = function() { setSelectedIcon(this) };
            resultHyperlink.onmouseout = function() { setNormalIcon(this) };
            var resultNode = document.createTextNode(merchantArray[i].name);
            resultHyperlink.appendChild(resultNode);
            resultDetailsDiv.appendChild(resultHyperlink);

            var sdText = "";
            if (merchantArray[i].type == "Lodging") {
                sdText = buildLodgingFeatureBlurb(merchantArray[i]);
            }
            else if (merchantArray[i].shortDescription != null && merchantArray[i].shortDescription != "") {
                sdText = merchantArray[i].shortDescription;
            }
            if (sdText != "") {
                var shortDescriptionDiv = document.createElement("div");
                shortDescriptionDiv.className = "resultMerchantShortDescription";
                shortDescriptionDiv.innerHTML = sdText;
                resultDetailsDiv.appendChild(shortDescriptionDiv);
            }

            var addressDiv = document.createElement("div");
            addressDiv.className = "resultMerchantAddress";
            addressDiv.innerHTML = merchantArray[i].address;
            if (merchantArray[i].phone != "") {
                if (merchantArray[i].address != "") {
                    addressDiv.innerHTML += "<br />";
                }
                addressDiv.innerHTML += merchantArray[i].phone;
            }
            resultDetailsDiv.appendChild(addressDiv);

            var linksDiv = document.createElement("div");
            linksDiv.className = "resultMerchantLinks";

            // details hyperlink
            var detailsHyperlink = document.createElement("a");
            var detailsText = document.createTextNode("Details");
            detailsHyperlink.appendChild(detailsText);
            if (merchantArray[i].merchantDetailUrl != null) {
                detailsHyperlink.href = merchantArray[i].merchantDetailUrl;
                linksDiv.appendChild(detailsHyperlink);
            }            


            // view on map hyperlink
            var viewOnMapHyperlink = document.createElement("a");
            var viewOnMapText = document.createTextNode("View on Map");
            viewOnMapHyperlink.appendChild(viewOnMapText);
            viewOnMapHyperlink.href = "javascript:showMerchantInfo(" + i + ")";
            viewOnMapHyperlink.className = "second";
            linksDiv.appendChild(viewOnMapHyperlink);

            resultDetailsDiv.appendChild(linksDiv);

            resultDiv.appendChild(resultDetailsDiv);

            merchantTypeResultListContainer.appendChild(resultDiv);
        }
    }
    if (typeNameDiv) {
        typeNameDiv.innerHTML += " (" + merchantCount + ")";
    }
    merchantTypeResultContainer.appendChild(merchantTypeResultListContainer);
    document.getElementById("pleaseWaitResults").style.display = "none";
    document.getElementById("pleaseWaitMapOverlay").style.display = "none";
    document.getElementById("resultsContainerContents").appendChild(merchantTypeResultContainer);

    if (_isUberMap) {
        document.getElementById("viewAllResults").style.display = (_displayedMarkerCount > 0) ? "block" : "none";
    }
    // re-open any sections we need to
    var typesToKeep = new Array();
    for (arl = 0; arl < openMerchantTypes.length; arl++) {
        if (document.getElementById("resultImg_" + openMerchantTypes[arl])) {
            showHideTypeResults(document.getElementById("resultImg_" + openMerchantTypes[arl]), false);
            typesToKeep.push(openMerchantTypes[arl]);
        }
    }
    openMerchantTypes.length = 0;
    for (omt = 0; omt < typesToKeep.length; omt++) {
        openMerchantTypes.push(typesToKeep[omt]);
    }

    // if not an ubermap, then zoom/center the map
    if (_isUberMap == false) {
        showAll();
    }
}



function setupLocations() {
    var locationArray = new Array();

    for (i = 0; i < merchantArray.length; i++) {
        if (merchantArray[i].location != null && trim(merchantArray[i].location) != "") {
            var found = false;
            for (x = 0; x < locationArray.length; x++) {
                if (locationArray[x] == merchantArray[i].location) {
                    found = true;
                }
            }
            if (found == false) {
                locationArray.push(merchantArray[i].location);
            }
        }
    }
    locationArray.sort();
	var listLeft = $("#neighborhoodListLeft");
	if ( listLeft.length == 0 ){
		listLeft = $("<div id='neighborhoodListLeft'></div>").prependTo("#neighborhoodListContainer");
	}
	var listRight = $("#neighborhoodListRight");
	if ( listRight.length == 0 ){
		listRight = $("<div id='neighborhoodListRight'></div>").prependTo("#neighborhoodListContainer");
	}
	
    var locationsOnLeftCount = Math.ceil(locationArray.length / 2);

	var strHtmlLeft = ["<ul>"];
	var strHtmlRight = ["<ul>"];
    for (i = 0; i < locationArray.length; i++) {
		if(i < locationsOnLeftCount)
		{
			strHtmlLeft.push([""
				,"<li>"
				,	"<input type='checkbox' value='" + locationArray[i] + "' onclick='filterByLocation(this.value, this.checked, true);' checked>"
				,	"<span> " + locationArray[i] + "</span>"
				,"</li>"
			].join(""));
		}
		else
		{
			strHtmlRight.push([""
				,"<li>"
				,	"<input type='checkbox' value='" + locationArray[i] + "' onclick='filterByLocation(this.value, this.checked, true);' checked>"
				,	"<span> " + locationArray[i] + "</span>"
				,"</li>"
			].join(""));
		}
    }
	strHtmlLeft.push("</ul>");
	listLeft.append(strHtmlLeft.join(""));
  
	strHtmlRight.push("</ul>");
	listRight.append(strHtmlRight.join(""));
	
    document.getElementById("pleaseWaitLocationFilter").style.display = "none";
    document.getElementById("mapThumbnailImg").style.display = "block";
    document.getElementById("neighborhoodListContainer").style.display = "block";
    document.getElementById("mapInstructions").style.display = "block";
}
/*

function setupLocations() {
	var locationArray = new Array();
	
	for (i = 0; i < merchantArray.length; i++) {
		if (merchantArray[i].location != null && trim(merchantArray[i].location) != "") {
			var found = false;
			for (x = 0; x < locationArray.length; x++) {
				if (locationArray[x] == merchantArray[i].location) {
					found = true;
				}
			}
			if (found == false) {
				locationArray.push(merchantArray[i].location);
			}
		}
	}
	locationArray.sort();
	var locationsOnLeftCount = Math.ceil(locationArray.length / 2);
	var locationsOnRightCount = locationArray.length - locationsOnLeftCount;
	
	for (i = 0; i < locationArray.length; i++) {
		var parentDiv;
		if (i < locationsOnLeftCount) {
			parentDiv = document.getElementById("neighborhoodListLeft");
		}
		else {
			parentDiv = document.getElementById("neighborhoodListRight");
		}
		var cb = document.createElement("input");
		cb.type = "checkbox";
		cb.value = locationArray[i];
		cb.onclick = function() { filterByLocation(this.value, this.checked, true); };
		parentDiv.appendChild(cb);
		cb.checked = true;
		// label
		var cbLabel = document.createTextNode(" " + locationArray[i]);
		parentDiv.appendChild(cbLabel);
		var br = document.createElement("br");
		parentDiv.appendChild(br);
	}
	document.getElementById("pleaseWaitLocationFilter").style.display = "none";
	document.getElementById("mapThumbnailImg").style.display = "block";
	document.getElementById("neighborhoodListContainer").style.display = "block";
}

*/
function checkAllLocations(b) {
    document.getElementById("pleaseWaitResults").style.display = "block";
    document.getElementById("pleaseWaitMapOverlay").style.display = "block";
    for (c = 0; c < document.getElementById("neighborhoodListContainer").getElementsByTagName("input").length; c++) {
        if (document.getElementById("neighborhoodListContainer").getElementsByTagName("input")[c].id != "cbNeighborhoods") {
            document.getElementById("neighborhoodListContainer").getElementsByTagName("input")[c].checked = b;
            filterByLocation(document.getElementById("neighborhoodListContainer").getElementsByTagName("input")[c].value, b, false);
        }
    }
    // finally, redraw the results

    drawResults();
}
function createMerchantTypeTab(merchantType) {

    // get the unordered list container
    var tabsUL = document.getElementById("vailTabsList");
    // create the new <li> tag
    var merchantTypeLI = document.createElement("li");
    // set the id
    merchantTypeLI.id = "li_" + merchantType.nameNoSpaces;
    // create the hyperlink
    var merchantTypeHyperlink = document.createElement("a");
    // these have to be of class name "tab" to style appropriately
    merchantTypeHyperlink.className = "tab";
    // add the icon
    var merchantTypeIcon = document.createElement("img");
    merchantTypeIcon.src = merchantType.merchantTypeIcon;

    merchantTypeIcon.align = "absmiddle";
    merchantTypeHyperlink.appendChild(merchantTypeIcon);
    // set the text
    var merchantTypeText = document.createTextNode(" " + merchantType.name);
    merchantTypeHyperlink.appendChild(merchantTypeText);
    // mouseover functionality
    merchantTypeHyperlink.onmouseover = function() { enableFilterTab(merchantType.nameNoSpaces); };
    merchantTypeHyperlink.onmouseout = function() { startTimer(); };
    // append the hyperlink to the <li>
    merchantTypeLI.appendChild(merchantTypeHyperlink);
    // create a <br> to clear things
    var br = document.createElement("br");
    br.className = "clear";
    merchantTypeLI.appendChild(br);
    // create the filter container div
    var filterContainerDiv = document.createElement("div");
    filterContainerDiv.className = "filterContainer";
    filterContainerDiv.id = "filter_" + merchantType.nameNoSpaces;

    // our filter container wrapper div that handles spacing
    var filterContainerContentsDiv = document.createElement("div");
    filterContainerContentsDiv.className = "filterContainerContents";
    // build the title div on the filter container
    var filterMerchantTypeNameDiv = document.createElement("div");
    filterMerchantTypeNameDiv.className = "filterMerchantTypeName";
    var filterMerchantTypeNameDivText = document.createTextNode(merchantType.name + " Filters");
    filterMerchantTypeNameDiv.appendChild(filterMerchantTypeNameDivText);
    // add the name to the container contents div
    filterContainerContentsDiv.appendChild(filterMerchantTypeNameDiv);

    // the "show on map" section
    var showHideDiv = document.createElement("div");
    showHideDiv.className = "filterMerchantTypeShowHide";
    var cbShowHide = document.createElement("input");
    cbShowHide.type = "checkbox";
    cbShowHide.value = merchantType.name;
    cbShowHide.onclick = function() { showHideMerchantType(merchantType.name, this.checked); };
    showHideDiv.appendChild(cbShowHide);
    cbShowHide.checked = true; // have to check it after appending it in IE
    // the text
    var showHideText = document.createTextNode("Show on Map");
    showHideDiv.appendChild(showHideText);
    // append the show/hide checkbox and crap to the container
    filterContainerContentsDiv.appendChild(showHideDiv);

    // build a wrapper div to hold the filter groups
    var filterGroupWrapper = document.createElement("div");
    filterGroupWrapper.id = merchantType.nameNoSpaces + "_filterGroupWrapper";

    // add the filter value sections 
    var theLength = merchantType.filterTypes.length;
    for (x = 0; x < theLength; x++) {
        var thisFilterName = merchantType.filterTypes[x].name;
        var filterOptionsArray = new Array();
        // the container
        var filterGroupContainer = document.createElement("div");
        filterGroupContainer.className = "filterMerchantTypeFilterGroup";
        // display name
        var filterNameDiv = document.createElement("div");
        filterNameDiv.className = "filterMerchantTypeFilterGroupName";
        var filterNameText = document.createTextNode(merchantType.filterTypes[x].displayName);
        filterNameDiv.appendChild(filterNameText);
        // add the name div to the container
        filterGroupContainer.appendChild(filterNameDiv);
        // select all div
        var selectAllDiv = document.createElement("div");
        selectAllDiv.className = "filterMerchantTypeFilterGroupSelectAll";
        var selectAllHyperlink = document.createElement("a");
        selectAllHyperlink.href = "javascript:selectAllFilterValues('filterValues_" + merchantType.nameNoSpaces + "_" + merchantType.filterTypes[x].name + "')";
        var selectAllText = document.createTextNode("Select All");
        selectAllHyperlink.appendChild(selectAllText);
        selectAllDiv.appendChild(selectAllHyperlink);
        // append select all div to container
        filterGroupContainer.appendChild(selectAllDiv);

        // add a br to clear it
        var br = document.createElement("br");
        br.className = "clear";
        filterGroupContainer.appendChild(br);

        var merchantCount = merchantType.merchants.length;
        for (m = 0; m < merchantCount; m++) { // looping each merchant in this type
            // each merchant has a value for each filter, but it may be pipe-delimited
            // like "CuisineType='American|Steaks'"
            // so we need to loop over the filter values, and see if each one
            // is already in our array.  if not, add it
            var filterOpts = merchantType.merchants[m][thisFilterName].split("|");
            for (fo = 0; fo < filterOpts.length; fo++) {
                var found = false;
                for (a = 0; a < filterOptionsArray.length; a++) {
                    if (filterOptionsArray[a] == filterOpts[fo]) {
                        found = true;
                        break;
                    }
                }
                if (found == false) {
                    filterOptionsArray.push(filterOpts[fo]);
                }
            }
        }
        filterOptionsArray.sort();

        if (merchantType.nameNoSpaces == 'Lodging') {
            if (merchantType.filterTypes[x].name == "Rating") {

                filterOptionsArray = [0, 1, 2, 3, 4, 5]
            }
        }

        // now we loop over each of the filter options and append those
        var filterOptionsContainerDiv = document.createElement("div");
        filterOptionsContainerDiv.id = "filterValues_" + merchantType.nameNoSpaces + "_" + merchantType.filterTypes[x].name;

        for (foa = 0; foa < filterOptionsArray.length; foa++) {

            var cbDiv = document.createElement("div");
            cbDiv.className = "filterValueCheckbox";
            var cb = document.createElement("input");
            cb.type = "checkbox";
            cb.id = merchantType.nameNoSpaces + "|" + merchantType.filterTypes[x].name + "|" + filterOptionsArray[foa];
            cb.value = filterOptionsArray[foa];
            //cb.onclick = function() { showHideMerchantsByFilter(this.value, this.checked); };
            cb.onclick = function() { showHideMerchantsByFilter(this, true); };
            cbDiv.appendChild(cb);
            cb.checked = true;
            filterOptionsContainerDiv.appendChild(cbDiv);

            // the checkbox label
            var cbLabelDiv = document.createElement("div");
            cbLabelDiv.className = "filterValueName";

            if (merchantType.filterTypes[x].name == "Rating") {

                for (rx = 0; rx < parseInt(filterOptionsArray[foa]); rx++) {
                    var star = document.createElement("img");
                    star.src = imgPath + "star.png";
                    cbLabelDiv.appendChild(star);
                }
            }
            else {
                var cbLabel = document.createTextNode(filterOptionsArray[foa]);
                cbLabelDiv.appendChild(cbLabel);
            }
            filterOptionsContainerDiv.appendChild(cbLabelDiv);
            // and finally, a br to clear
            var br = document.createElement("br");
            br.className = "clear";
            filterOptionsContainerDiv.appendChild(br);
        }

        filterGroupContainer.appendChild(filterOptionsContainerDiv);

        // append the filter group container
        filterGroupWrapper.appendChild(filterGroupContainer);
        //filterContainerContentsDiv.appendChild(filterGroupContainer);

        // add a br to clear it all
        /*
        var br = document.createElement("br");
        br.className = "clear";
        filterContainerContentsDiv.appendChild(br);
        */
    }

    filterContainerContentsDiv.appendChild(filterGroupWrapper);

    // add the container contents div to the container
    filterContainerDiv.appendChild(filterContainerContentsDiv);

    // finally, append all of this crap to the <li>
    merchantTypeLI.appendChild(filterContainerDiv);

    // append the <li> to the <ul>
    tabsUL.appendChild(merchantTypeLI);
}

function showHideTypeResults(img, alterArray) {
    // TODO: make this a real accordion instead of this
    // TODO: don't hardcode the image paths.
    var merchantType = xreplace(img.id, "resultImg_", "");
    var typeResultList = document.getElementById("resultList_" + merchantType);
    if (typeResultList.style.display == "block") {
        typeResultList.style.display = "none";
        img.src = imgPath + "resultMerchantTypePlus.gif";

        if (alterArray) {
            for (al = 0; al < openMerchantTypes.length; al++) {
                if (openMerchantTypes[al] == merchantType) {
                    openMerchantTypes.splice(al, 1);
                    break;
                }
            }
        }
    }
    else {
        typeResultList.style.display = "block";
        img.src = imgPath + "resultMerchantTypeMinus.gif";
        if (alterArray) {
            openMerchantTypes.push(merchantType);
        }
    }

}
function selectAllFilterValues(containerDiv) {
    document.getElementById("pleaseWaitResults").style.display = "block";
    document.getElementById("pleaseWaitMapOverlay").style.display = "block";
    var checkedBoxes = 0;
    var doCheck = true;
    var cbCount = document.getElementById(containerDiv).getElementsByTagName("input").length;
    for (i = 0; i < cbCount; i++) {
        if (document.getElementById(containerDiv).getElementsByTagName("input")[i].checked == true) {
            checkedBoxes++;
        }
    }
    if (checkedBoxes == cbCount) {
        // they're all checked, so uncheck them all
        doCheck = false;
    }
    // actually do it
    for (safv = 0; safv < cbCount; safv++) {
        var thisCb = document.getElementById(containerDiv).getElementsByTagName("input")[safv];
        if (thisCb.checked != doCheck) {
            // no need to re-check and re-filter if it's already in the state it needs to be in
            thisCb.checked = doCheck;
            showHideMerchantsByFilter(thisCb, false);
        }
    }
    // finally, redraw the results
    drawResults();
}
function setSelectedIcon(hyperlink) {
    var x = xreplace(hyperlink.id, "result", "");
    merchantArray[x].marker.setImage(imgPath + "marker_selected.png");
}
function setNormalIcon(hyperlink) {
    var x = xreplace(hyperlink.id, "result", "");
    merchantArray[x].marker.setImage(merchantArray[x].typeMarker);
}

function showMerchantInfo(x) {
    if (merchantArray[x].hasTabs == true) {
        merchantArray[x].marker.openInfoWindowTabsHtml(merchantArray[x].infoWindowTabs);
    }
    else {
        merchantArray[x].marker.openInfoWindowHtml(merchantArray[x].infoWindowHtml);
    }

    // Reset the text box in the From/To popup.
    if ($('#fromAddress').length) $('#fromAddress').val('');
    if ($('#toAddress').length) $('#toAddress').val('');

}
function showHideMerchantsByFilter(cb, doRedraw) {

    document.getElementById("pleaseWaitResults").style.display = "block";
    document.getElementById("pleaseWaitMapOverlay").style.display = "block";

    // the id of this checkbox will be in the following format:
    // Dining|CuisineType|Italian
    // so split it to get the merchant type, filter group, and filter value
    var merchantType = cb.id.split("|")[0];
    var filterGroup = cb.id.split("|")[1];
    var filterValue = cb.id.split("|")[2];
    var show = cb.checked;

    for (i = 0; i < merchantArray.length; i++) {
        var thisMerchant = merchantArray[i];
        if (thisMerchant.typeNoSpaces == merchantType) {
            //var selectedFilters = 0;

            // we want to keep a merchant on the map if it has at least one value checked
            // for any given filter group.  So, for example, for dining, in the price category
            // as soon as its $ sign is un-checked, remove that marker since it no longer matches
            // any values in the price category/type.  
            var selectedFilterTypes = 0;

            // we know what type of merchant this is, and we know what filter types this merchan type has
            // so, loop over each of those and see how many filters we have checked.			
            var filterTypeCount = thisMerchant.merchantType.filterTypes.length;
            for (ft = 0; ft < filterTypeCount; ft++) {
                var selectedFilters = 0;
                //alert(thisMerchant.merchantType.filterTypes[ft].name);
                // we know that each filter value collection is stored in a div that is named like this:
                // filterValues_Services_Type
                // so get those divs, loop over the cb's, and see if we have matches
                var thisFilterType = thisMerchant.merchantType.filterTypes[ft].name;
                var filterGroupDiv = document.getElementById("filterValues_" + merchantType + "_" + thisFilterType);
                for (c = 0; c < filterGroupDiv.getElementsByTagName("input").length; c++) {
                    var thisCheckbox = filterGroupDiv.getElementsByTagName("input")[c];
                    if (thisCheckbox.type == "checkbox") {
                        // we have a checkbox.  get its value if it's checked to compare to our merchant
                        if (thisCheckbox.checked == true) {
                            // it's checked, so we need to loop over our merchant's values
                            // for this filter type and see if we have a match
                            // remembering that the value of this filter type could contain multiple values, pipe-delimited
                            // e.g. "American|Italian"
                            for (fv = 0; fv < thisMerchant[thisFilterType].split("|").length; fv++) {
                                var thisFV = thisMerchant[thisFilterType].split("|")[fv];
                                if (thisFV == thisCheckbox.value) {
                                    selectedFilters++;
                                    break;
                                }
                            }
                        }
                    }
                }
                // here is we now can look and see if this merchant matched any values in this type
                if (selectedFilters > 0) {
                    selectedFilterTypes++
                }
            }

            if (selectedFilterTypes == filterTypeCount) {
                if (thisMerchant.currentlyDisplayedByLocation == true &&
					thisMerchant.currentlyDisplayedByMerchantType == true &&
					thisMerchant.currentlyDisplayedByFilters == false) {
                    map.addOverlay(thisMerchant.marker);


                }
                thisMerchant.currentlyDisplayedByFilters = true;
            }
            else {
                map.removeOverlay(thisMerchant.marker);
                thisMerchant.currentlyDisplayedByFilters = false;
            }
        }
    }
    if (doRedraw) {
        drawResults();
    }
}

function filterByLocation(location, show, doRedraw) {
    document.getElementById("pleaseWaitResults").style.display = "block";
    document.getElementById("pleaseWaitMapOverlay").style.display = "block";
    for (i = 0; i < merchantArray.length; i++) {
        var thisMerchant = merchantArray[i];
        if (thisMerchant.location == location) {
            if (show) {
                if (thisMerchant.currentlyDisplayedByMerchantType == true &&
					thisMerchant.currentlyDisplayedByFilters == true &&
					thisMerchant.currentlyDisplayedByLocation == false) {
                    map.addOverlay(thisMerchant.marker);



                }
                thisMerchant.currentlyDisplayedByLocation = true;
            }
            else {
                map.removeOverlay(thisMerchant.marker);
                thisMerchant.currentlyDisplayedByLocation = false;
            }
        }
    }
    if (doRedraw) {
        drawResults();
    }
}
function showHideMerchantType(type, show) {
    document.getElementById("pleaseWaitResults").style.display = "block";
    document.getElementById("pleaseWaitMapOverlay").style.display = "block";
    var filterGroupWrapper = document.getElementById(xreplace(type, " ", "") + "_filterGroupWrapper");
    for (i = 0; i < merchantArray.length; i++) {
        var thisMerchant = merchantArray[i];
        if (thisMerchant.type == type) {
            if (show) {
                if (thisMerchant.currentlyDisplayedByLocation == true &&
					thisMerchant.currentlyDisplayedByFilters == true &&
					thisMerchant.currentlyDisplayedByMerchantType == false) {
                    map.addOverlay(thisMerchant.marker);

                }
                thisMerchant.currentlyDisplayedByMerchantType = true;
            }
            else {
                map.removeOverlay(thisMerchant.marker);
                thisMerchant.currentlyDisplayedByMerchantType = false;
            }
        }
    }
    if (show) {
        filterGroupWrapper.style.display = "block";
    }
    else {
        filterGroupWrapper.style.display = "none";
    }
    drawResults();
}
function buildIcon(markerImage, width, height) {
    icon = new GIcon();
    icon.shadow = imgPath + "marker_shadow.png";
    icon.iconSize = new GSize(width, height);
    //var shadowWidth = parseInt(1.25 * parseInt(width));
    var shadowWidth = 38;
    icon.shadowSize = new GSize(shadowWidth, height);
    //var anchorCenter = parseInt(parseInt(width) / 2);
    var anchorCenter = 19;
    icon.iconAnchor = new GPoint(anchorCenter, height);
    icon.infoWindowAnchor = new GPoint(anchorCenter, 2);
    icon.infoShadowAnchor = new GPoint(width, 8);
    icon.image = markerImage;
    return icon;
}
function drawNeighborhoods() {
    for (i = 0; i < neighborhoodsArray.length; i++) {
        map.addOverlay(neighborhoodsArray[i].marker);
        map.addOverlay(neighborhoodsArray[i].polygon);
    }
}
function createNeighborhoodMarker(hood) {
    var hood_icon = new GIcon();
    hood_icon.image = hood.icon;
    hood_icon.iconSize = new GSize(hood.markerWidth, hood.markerHeight);
    hood_icon.iconAnchor = new GPoint(parseInt(parseInt(hood.markerWidth) / 2), parseInt(parseInt(hood.markerHeight) / 2));
    
    var markerOpts = { zIndexProcess: zindex, clickable: false };
    markerOpts.icon = hood_icon;
    var hood_marker = new GMarker(hood.center, markerOpts);

    return hood_marker;
}
function zindex() {
    return 1000;
}
function createNeighborhoodPolygon(hood) {
    var polygon = new GPolygon(hood.polyPoints, hood.lineColor, 1, 1, hood.fillColor, hood.opacity);
    return polygon;
}
function createInfoWindow(merchant) {
    var hasPhoto = (merchant.photo && trim(merchant.photo) != "") ? true : false;
// Add class in Popup | Anuj Rastogi
var detailsHTML = "<div class='popup clearfix'>";
    if (merchant.merchantDetailUrl != null)
        var merchantDetailUrl = merchant.merchantDetailUrl;

    var currentUrl = (location.pathname + location.search).split('#')[0];

    if ((merchant.merchantDetailUrl != null) && (merchant.merchantDetailUrl != currentUrl)) {
        detailsHTML += "<div class='popupMerchantName'><a href='" + merchant.merchantDetailUrl + "'>" + merchant.name + "</a></div>";
    }
    else {
        detailsHTML += "<div class='popupMerchantName'><a href='#'>" + merchant.name + "</a></div>";
    }
    detailsHTML += (hasPhoto == true) ? "<div class='popupMerchantDetails'>" : "<div class='popupMerchantDetailsNoPhoto'>";
    if (trim(merchant.description) != "") {
        merchant.description = merchant.description.replace(/<\!\[CDATA\[/, '');
        merchant.description = merchant.description.replace(/\]\]>/,'');    
        detailsHTML += "<div class='popupMerchantDescription'>" + merchant.description + "</div>";
    }

    if (merchant.type == "Lodging") {
        detailsHTML += "<div class='popupMerchantLodgingType'>";
        detailsHTML += buildLodgingFeatureBlurb(merchant);
        detailsHTML += "</div>";
    }

    if (merchant.address != null && merchant.address != "") {
        merchant.address = merchant.address.replace(/<\!\[CDATA\[/, '');
        merchant.address = merchant.address.replace(/\]\]>/, '');
        detailsHTML += merchant.address + "<br />";
    }

    if (merchant.hours != null && merchant.hours != "") {
        detailsHTML += merchant.hours + "<br />";
    }
    if (merchant.phone == '0000000000')
        merchant.phone = '';
    detailsHTML += merchant.phone;
    detailsHTML += "</div>"; // end popupMerchantDetails
    if (hasPhoto) {
        detailsHTML += "<div class='popupMerchantPhoto'><img src='" + merchant.photo + "'></div>";
    }
    detailsHTML += "<br class='clear' />";

    // Set URL to save activity to Trip Folder    
    //var urlSaveToTrip = merchant.merchantSaveUrl + "?ProductName=" + merchant.name  //Comment by Naveen to remove product name from savetotrip url ;
    var urlSaveToTrip = merchant.merchantSaveUrl;
    if (merchant.type == "Activities") {
        urlSaveToTrip += "?ProductName=" + merchant.name + "&ProductDescription=" + merchant.description + "&ProductTypeId=" + merchant.type + "&SystemName=" + merchant.systemName +
        "&Search=NoData" + "&IsBookable=" + (merchant.merchantBookUrl != "#") + "&TargetURL=" + merchant.myTripFolderGUID + "&IsSaveTrip=1";
    }
    if (merchant.type == "Dining") {
        urlSaveToTrip += "?ProductName=" + merchant.name + "&ProductLocation=" + merchant.location +
        "&ProductTypeId=" + merchant.type + "&Search=NoData" + "&SystemName=" + merchant.systemName +
        "&IsBookable=" + (merchant.reservationLink != "#") + "&TargetURL=" + merchant.myTripFolderGUID + "&IsSaveTrip=1";
    }
    if (merchant.type == "Shopping") {
        urlSaveToTrip += "?ProductName=" + merchant.name + "&ProductTypeId=" + merchant.type + "&Search=NoData" + "&SystemName=" + merchant.systemName + "&TargetURL=" + merchant.myTripFolderGUID + "&IsSaveTrip=1";
    }
// Added Div with Class (popupMerchantButtonTabs) by Anuj Rastogi
detailsHTML += "<div class='popupMerchantButtonTabs'><div class='popupMerchantSaveToTripFolder'>";

    //detailsHTML += "<a href='" + urlSaveToTrip + "' title='Save' class='saveLink'>Save</a></div>";
    if (merchant.type != "Services") {
        detailsHTML += "<a href='" + urlSaveToTrip + "' title='Save' class='saveLink uberMapSaveModalLink' onclick='bindModalEvent(event);'>Save</a></div>";
    }



    // Display Price for Dining
    if (merchant.type == "Dining") {
        var expense = merchant.price;
        if (expense != null && expense.length > 0) {
            var tooltip = "";
            switch (expense) {
                case "1":
                    tooltip = "under $20";
                    break;
                case "2":
                    tooltip = "Between $21-$30";
                    break;
                case "3":
                    tooltip = "Between $31-$40";
                    break;
                case "4":
                    tooltip = "Greater $40";
                    break;
            }

            detailsHTML += "<div class = 'details' title ='" + tooltip + "'><span class='priceBg resortMapPriceBg priceIcon priceTier" + expense + "'/></div>";
        }
    }

    //detailsHTML += "<div class='popupMerchantLearnMore'><img src='btnLearnMore.gif'></div>";

    //var currentUrl = (location.pathname + location.search).split('#')[0];

    if ((merchant.merchantDetailUrl != null) && (merchant.merchantDetailUrl != currentUrl)) {
        detailsHTML += "<a class='diningInfo' href='" + merchant.merchantDetailUrl + "'>" + "More Info</a>";
    }
    else {
        if(!(merchant.merchantType.nameNoSpaces == "Transportation" || merchant.merchantType.nameNoSpaces == "MtnFacilities"))  {	        
			//if($('#middleTabsContainer ul li.first span').length > 0)
			if($('#middleTabsContainer ul li.first span').html() == "Info")
			{
				detailsHTML += "<a class='diningInfo' href='javascript:switchTabs()'>" + "More Info</a>";
			}

	    }
        
    }

    //	// Displaying website address of merchant if exist
    //	if (merchant.website != null && merchant.website != '#')
    //	{
    //	    detailsHTML += "<a href='" + merchant.website +"'>" + merchant.website + "</a>";    
    //	}

    // Display Book it button if ActivityBookingURL field for Activities is defined
    if ((merchant.type == "Activities")) {
        if (merchant.merchantBookUrl != null) {
            var activityBookUrl = merchant.merchantBookUrl;
            var idx = activityBookUrl.indexOf("#");
            if (idx != 0) {
                detailsHTML += "<a href='" + merchant.merchantBookUrl + "' title='Book' class='linkPrimary openResortMapModalLink' onclick='bindBookItModalEvent(event);'>Book It</a>";
            }
        }
    }

    // Display Book it button if ReservationLink field for dining is defined
    if (merchant.type == "Dining") {
        if (merchant.reservationLink != null) {
            var reservationLinkUrl = merchant.reservationLink;
            var idx = reservationLinkUrl.indexOf("#");

            if (idx == -1) {
                if (merchant.reservationLinkInternal == "true") {
                    detailsHTML += "<a href='" + merchant.reservationLink + "' title='Book' class='linkPrimary openResortMapModalLink' onclick='bindBookItModalEvent(event);'>Book It</a>";
                }
                else {
                    detailsHTML += "<a href='" + merchant.reservationLink + "' title='Book' class='bookItButton'>Book It</a>";
                }
            }
        }
    }

    detailsHTML += "</div></div>";
    return detailsHTML;

}
function buildLodgingFeatureBlurb(merchant) {
    var lodgingRet = "";
	//for (rate = 0; rate < parseInt(merchant.Rating); rate++) {
		//lodgingRet += "<img src='" + imgPath + "star.png'>";
		
		lodgingRet += "<img src='" + merchant.ratingImageUrl + "'>";
	//}	

    lodgingRet += "<br />" + xreplace(merchant.type, "|", ", ") + " - ";

    lodgingRet += xreplace(merchant.UnitSize, "|", ", ");
    lodgingRet += "<br />";

    var am = merchant.Amenities;

    am = xreplace(am, "|", " ");
    am = xreplace(am, "Close to Slopes", "<img src='" + imgPath + "slopes.gif' alt='Close to Slopes'>");
    am = xreplace(am, "Hot Tub", "<img src='" + imgPath + "hottub.gif' alt='Hot Tub'>");
    am = xreplace(am, "Pool", "<img src='" + imgPath + "pool.gif' alt='Pool'>");
    am = xreplace(am, "On Shuttle Route", "<img src='" + imgPath + "shuttle.gif' alt='On Shuttle Route'>");
    lodgingRet += am;
    return lodgingRet;
}
function showHideHoods() {
    var doShow = document.getElementById("cbNeighborhoods").checked;
    if (document.getElementById("cbNeighborhoods").checked == true) {
        for (i = 0; i < neighborhoodsArray.length; i++) {
            map.addOverlay(neighborhoodsArray[i].marker);
            map.addOverlay(neighborhoodsArray[i].polygon);

        }
    }
    else {
        for (i = 0; i < neighborhoodsArray.length; i++) {
            map.removeOverlay(neighborhoodsArray[i].marker);
            map.removeOverlay(neighborhoodsArray[i].polygon);
        }
    }
}
function xreplace(checkMe, toberep, repwith) {
    var temp = checkMe;
	
	if(temp==null)
	{
	temp="";
	}
	
    var i = temp.indexOf(toberep);
    while (i > -1) {
        temp = temp.replace(toberep, repwith);
        i = temp.indexOf(toberep, i + repwith.length + 1);
    }
    return temp;
}
function trim(str) {
    if (str != "") {
        return str.replace(/^\s*|\s*$/g, "");
    }
    else {
        return "";
    }
}
function showAll() {
    bounds = new GLatLngBounds();
    for (i = 0; i < merchantArray.length; i++) {
        if (merchantArray[i].currentlyDisplayedByLocation == true &&
			merchantArray[i].currentlyDisplayedByMerchantType == true &&
			merchantArray[i].currentlyDisplayedByFilters == true) {
            bounds.extend(merchantArray[i].point);
        }
    }
    map.setCenter(bounds.getCenter(), map.getBoundsZoomLevel(bounds));
}

var filterTimer = null;
function setupFilterTabs() {
    for (i = 0; i < document.getElementById("vailTabsList").getElementsByTagName("li").length; i++) {
        var filterDiv = document.getElementById("vailTabsList").getElementsByTagName("li")[i].getElementsByTagName("div")[0];
        filterDiv.onmouseover = function() {
            cancelTimer();
        }
        filterDiv.onmouseout = function() {
            startTimer();
        }
    }
    document.getElementById("filterInstructions").style.display = "block";
}
function enableFilterTab(merchantType) {
    clearTimeout(filterTimer);
    turnOffAllFilterTabs();
    document.getElementById("li_" + merchantType).className = "on";
    var filterDiv = document.getElementById("filter_" + merchantType);
    filterDiv.style.display = "block";
    filterDiv.style.visibility = "visible";
}
function turnOffAllFilterTabs() {
    // todo: move this into an iteration over an array of known filters
    for (i = 0; i < document.getElementById("vailTabsList").getElementsByTagName("li").length; i++) {
        document.getElementById("vailTabsList").getElementsByTagName("li")[i].className = "";
        var filterDiv = document.getElementById("vailTabsList").getElementsByTagName("li")[i].getElementsByTagName("div")[0];
        filterDiv.style.display = "none";
        filterDiv.style.visibility = "hidden";
    }
}
function cancelTimer() {
    clearTimeout(filterTimer);
}
function startTimer() {
    filterTimer = setTimeout(turnOffAllFilterTabs, 500);
}
function handleErrors() {
    if (gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS)
        alert("No corresponding geographic location could be found for one of the specified addresses. This may be due to the fact that the address is relatively new, or it may be incorrect.\nError code: " + gdir.getStatus().code);
    else if (gdir.getStatus().code == G_GEO_SERVER_ERROR)
        alert("A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known.\n Error code: " + gdir.getStatus().code);
    else if (gdir.getStatus().code == G_GEO_MISSING_QUERY)
        alert("The HTTP q parameter was either missing or had no value. For geocoder requests, this means that an empty address was specified as input. For directions requests, this means that no query was specified in the input.\n Error code: " + gdir.getStatus().code);
    else if (gdir.getStatus().code == G_GEO_BAD_KEY)
        alert("The given key is either invalid or does not match the domain for which it was given. \n Error code: " + gdir.getStatus().code);
    else if (gdir.getStatus().code == G_GEO_BAD_REQUEST)
        alert("A directions request could not be successfully parsed.\n Error code: " + gdir.getStatus().code);
    else alert("An unknown error occurred.");
}

function onGDirectionsLoad() {

    document.getElementById("directionsOverlay").style.visibility = "visible";
}
function setDirections() {
    var from;
    var to;
    if (document.getElementById("direction").value == "To") {
        to = document.getElementById("merchantGeocode").value;
        from = document.getElementById("fromAddress").value;
    }
    else {
        from = document.getElementById("merchantGeocode").value;
        to = document.getElementById("toAddress").value;
    }
  
   
    //gdir.load("from: " + document.getElementById("fromAddress").value + " to: " + document.getElementById("toAddress").value, { "locale": "en_US" });
    gdir.load("from: " + from + " to: " + to, { "locale": "en_US" });
}
function addImg(url, id) {
    var img = document.createElement("img");
    img.src = url;
    document.getElementById(id).innerHTML = "";
    document.getElementById(id).appendChild(img);
}
function closeDirections() {
    document.getElementById("directionsOverlay").style.visibility = "hidden";
}

function doDirectionSearchKeyPress(e) {
    //the purpose of this function is to allow the enter key to 

    //point to the correct button to click.

    var key;

    if (window.event)
        key = window.event.keyCode;     //IE

    else
        key = e.which;     //firefox

    if (key == 13) {
        stopEvent(e);
        setDirections();
    }
}
function stopEvent(e) {
    if (!e) var e = window.event;

    //e.cancelBubble is supported by IE - this will kill the bubbling process.
    e.cancelBubble = true;
    e.returnValue = false;
    //e.stopPropagation works only in Firefox.
    if (e.stopPropagation) {
        e.stopPropagation();
        e.preventDefault();
    }
    return false;
}
function switchTabs() {
    if ($("ul.middleTabs li.first a").length) $("ul.middleTabs li.first a").trigger("click");
	//$('#map').html('');
}
function modalWin(url) {
    window.showModalDialog(url, "name", "dialogWidth:255px;dialogHeight:250px");
}

function setupSlider() {

    if ((jQuery.browser.msie) && (parseInt(jQuery.browser.version) == 6)) {
        $('.filterContainer input[type=checkbox]').attr('checked', true);
		$('#neighborhoodListLeft input[type=checkbox]').attr('checked', true);
    }
	
	//pn artf996451 
    $('#li_Lodging .filterMerchantTypeFilterGroupSelectAll').hide();

    //hide checkboxes. filter states will still be maintained by these checkboxes
    $('#filterValues_Lodging_Rating .filterValueCheckbox, #filterValues_Lodging_Rating .filterValueName, #filterValues_Lodging_Rating br.clear').hide();

    var defaultSliderVal;
    //set default state of filters
    if ($('#filterValues_Lodging_Rating .filterValueCheckbox input[type=checkbox]').length)
    { defaultSliderVal = parseInt($('#filterValues_Lodging_Rating .filterValueCheckbox:first-child input[type=checkbox]').val()); }
    else { defaultSliderVal = 1; }

    //create slider element
    $('#filterValues_Lodging_Rating').append('<div id="sliderBg"><div id="slider"></div><br/></div>');

    //set default trigger
    //$('#filterValues_Lodging_Rating .filterValueCheckbox input[type=checkbox][value!=' + defaultSliderVal + ']').trigger('click');

    //slider mechanism

    $("#slider").slider({
        value: defaultSliderVal,
        range: true,
        min: 0,
        max: 5,
        step: 1,
        values: [0, 5],
        stop: function(event, ui) {

            var cb = $('#filterValues_Lodging_Rating .filterValueCheckbox input:checkbox');
            for (var i = 0; i <= 5; i++) {
                // Check if the value of filters lies between the slider range
                if ((i >= ui.values[0]) && (i <= ui.values[1])) {
                    // Check only unchecked boxes and redraw map
                    if (cb.eq(i).attr('checked') == false) {
                        cb.eq(i).attr('checked', true);
                        showHideMerchantsByFilter(cb[i], true);
                    }
                }
                else {
                    // Uncheck only checked boxes and redraw map
                    if (cb.eq(i).attr('checked') == true) {
                        cb.eq(i).attr('checked', false);
                        showHideMerchantsByFilter(cb[i], true);
                    }
                }
            }
        }
    });
}

function bindModalEvent(event) {
    stopEvent(event);

    if ($("div.ubermapSaveToTripDialog").length == 0) {
        $("<div class='ubermapSaveToTripDialog'></div>")
	        .append("<iframe src='' width='950px' height='690px' frameborder='0' marginheight='0' marginwidth='0'></iframe>")
	        .appendTo("body");
    }

    if ($('.ubermapSaveToTripDialog').length > 0 && $('body > .ui-dialog .ubermapSaveToTripDialog').length == 0) {
        $('.ubermapSaveToTripDialog').eq(0).dialog({
            bgiframe: true,
            autoOpen: false,
            width: 950,
            height: 690,
            modal: true,
            resizable: false,
            position: 'center',
            zIndex: 9999,
            closeOnEscape: true,
            draggable: false
        });
    }
    var objDialog = $(' .ui-dialog .ubermapSaveToTripDialog');

    var urlContent = $(" .uberMapSaveModalLink").attr('href');

    $('iframe', objDialog)
		.attr('src', urlContent)
		.attr('width', '100%')
		.attr('height', '100%')
		.attr('scrolling', 'no');
    try {
        objDialog.dialog('open');
    } catch (e) { }

    return false;


}

function bindBookItModalEvent(event) {
    stopEvent(event);

    if ($("div.ubermapBookItDialog").length == 0) {
        $("<div class='ubermapBookItDialog'></div>")
	        .append("<iframe src='' width='950px' height='800px' frameborder='0' marginheight='0' marginwidth='0'></iframe>")
	        .appendTo("body");
    }

    if ($('.ubermapBookItDialog').length > 0 && $('body > .ui-dialog .ubermapBookItDialog').length == 0) {
        $('.ubermapBookItDialog').eq(0).dialog({
            bgiframe: true,
            autoOpen: false,
            width: 950,
            height: 800,
            modal: true,
            resizable: false,
            position: 'center',
            zIndex: 9999,
            closeOnEscape: true,
            draggable: false
        });
    }
    var objDialog = $(' .ui-dialog .ubermapBookItDialog');

    var urlContent = $(" .openResortMapModalLink").attr('href');

    $('iframe', objDialog)
		.attr('src', urlContent)
		.attr('width', '100%')
		.attr('height', '100%')
		.attr('scrolling', 'no');
    try {
        objDialog.dialog('open');
    } catch (e) { }

    return false;


}

