/*
SUMMARY of included javascript files: 

/var/www/vhosts/ymca-ywca.com/httpdocs/nfw2/browserincludes/scripts/jquery-1.3.1.min.js
/var/www/vhosts/ymca-ywca.com/httpdocs/nfw2/browserincludes/scripts/jquery-nfw-extensions.js
/var/www/vhosts/ymca-ywca.com/httpdocs/nfw2/browserincludes/scripts/jquery.innerfade.js
/var/www/vhosts/ymca-ywca.com/httpdocs/nfw2/browserincludes/scripts/nfw.js.php
/var/www/vhosts/ymca-ywca.com/httpdocs/templates/ymca-ywca/scripts/scripts.js
/var/www/vhosts/ymca-ywca.com/httpdocs/nfw2/browserincludes/scripts/swfobject.js
/var/www/vhosts/ymca-ywca.com/httpdocs/nfw2/browserincludes/scripts/pngfix.js
/var/www/vhosts/ymca-ywca.com/httpdocs/nfw2/browserincludes/scripts/jquery.pager.js
/var/www/vhosts/ymca-ywca.com/httpdocs/nfw2/browserincludes/scripts/superfish.js
/var/www/vhosts/ymca-ywca.com/httpdocs/nfw2/browserincludes/scripts/hoverIntent.js
/var/www/vhosts/ymca-ywca.com/httpdocs/nfw2/browserincludes/scripts/jquery.bgiframe.js
/var/www/vhosts/ymca-ywca.com/httpdocs/nfw2/browserincludes/scripts/simplemenugenerator.js
/var/www/vhosts/ymca-ywca.com/httpdocs/nfw2/browserincludes/scripts/simpleeventcontroller.js
/var/www/vhosts/ymca-ywca.com/httpdocs/nfw2/browserincludes/scripts/simplelink.js
/var/www/vhosts/ymca-ywca.com/httpdocs/nfw2/browserincludes/scripts/simplebanner.js
/var/www/vhosts/ymca-ywca.com/httpdocs/nfw2/browserincludes/scripts/simplesearch.js
/var/www/vhosts/ymca-ywca.com/httpdocs/nfw2/browserincludes/scripts/thickbox.js
/var/www/vhosts/ymca-ywca.com/httpdocs/nfw2/browserincludes/scripts/jquery.jmap.min-r72.js

*/
/*
 * jQuery JavaScript Library v1.3.1
 * http://jquery.com/
 *
 * Copyright (c) 2009 John Resig
 * Dual licensed under the MIT and GPL licenses.
 * http://docs.jquery.com/License
 *
 * Date: 2009-01-21 20:42:16 -0500 (Wed, 21 Jan 2009)
 * Revision: 6158
 */
(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.makeArray(E))},selector:"",jquery:"1.3.1",size:function(){return this.length},get:function(E){return E===g?o.makeArray(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,find:function(E){if(this.length===1&&!/,/.test(E)){var G=this.pushStack([],"find",E);G.length=0;o.find(E,this[0],G);return G}else{var F=o.map(this,function(H){return o.find(E,H)});return this.pushStack(/[^+>] [^+>]/.test(E)?o.unique(F):F,"find",E)}},clone:function(F){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.cloneNode(true),H=document.createElement("div");H.appendChild(I);return o.clean([H.innerHTML])[0]}else{return this.cloneNode(true)}});var G=E.find("*").andSelf().each(function(){if(this[h]!==g){this[h]=null}});if(F===true){this.find("*").andSelf().each(function(I){if(this.nodeType==3){return}var H=o.data(this,"events");for(var K in H){for(var J in H[K]){o.event.add(G[I],K,H[K][J],H[K][J].data)}}})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var F=o.expr.match.POS.test(E)?o(E):null;return this.map(function(){var G=this;while(G&&G.ownerDocument){if(F?F.index(G)>-1:o(G).is(E)){return G}G=G.parentNode}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML:null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(K,N,M){if(this[0]){var J=(this[0].ownerDocument||this[0]).createDocumentFragment(),G=o.clean(K,(this[0].ownerDocument||this[0]),J),I=J.firstChild,E=this.length>1?J.cloneNode(true):J;if(I){for(var H=0,F=this.length;H<F;H++){M.call(L(this[H],I),H>0?E.cloneNode(true):J)}}if(G){o.each(G,z)}}return this;function L(O,P){return N&&o.nodeName(O,"table")&&o.nodeName(P,"tr")?(O.getElementsByTagName("tbody")[0]||O.appendChild(O.ownerDocument.createElement("tbody"))):O}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){G=o.trim(G);if(G){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(G,E,I){if(E=="width"||E=="height"){var K,F={position:"absolute",visibility:"hidden",display:"block"},J=E=="width"?["Left","Right"]:["Top","Bottom"];function H(){K=E=="width"?G.offsetWidth:G.offsetHeight;var M=0,L=0;o.each(J,function(){M+=parseFloat(o.curCSS(G,"padding"+this,true))||0;L+=parseFloat(o.curCSS(G,"border"+this+"Width",true))||0});K-=Math.round(M+L)}if(o(G).is(":visible")){H()}else{o.swap(G,F,H)}return Math.max(0,K)}return o.curCSS(G,E,I)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,R){if(typeof R==="number"){R+=""}if(!R){return}if(typeof R==="string"){R=R.replace(/(<(\w+)[^>]*?)\/>/g,function(T,U,S){return S.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?T:U+"></"+S+">"});var O=o.trim(R).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+R+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var N=!O.indexOf("<table")&&O.indexOf("<tbody")<0?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&O.indexOf("<tbody")<0?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(R)){L.insertBefore(K.createTextNode(R.match(/^\s*/)[0]),L.firstChild)}R=o.makeArray(L.childNodes)}if(R.nodeType){G.push(R)}else{G=o.merge(G,R)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(){var G=arguments;return this.each(function(){for(var H=0,I=G.length;H<I;H++){o(G[H])[F](this)}})}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(">*",this).remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
/*
 * 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 Q=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]+['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[]+)+|[>+~])(\s*,\s*)?/g,K=0,G=Object.prototype.toString;var F=function(X,T,aa,ab){aa=aa||[];T=T||document;if(T.nodeType!==1&&T.nodeType!==9){return[]}if(!X||typeof X!=="string"){return aa}var Y=[],V,ae,ah,S,ac,U,W=true;Q.lastIndex=0;while((V=Q.exec(X))!==null){Y.push(V[1]);if(V[2]){U=RegExp.rightContext;break}}if(Y.length>1&&L.exec(X)){if(Y.length===2&&H.relative[Y[0]]){ae=I(Y[0]+Y[1],T)}else{ae=H.relative[Y[0]]?[T]:F(Y.shift(),T);while(Y.length){X=Y.shift();if(H.relative[X]){X+=Y.shift()}ae=I(X,ae)}}}else{var ad=ab?{expr:Y.pop(),set:E(ab)}:F.find(Y.pop(),Y.length===1&&T.parentNode?T.parentNode:T,P(T));ae=F.filter(ad.expr,ad.set);if(Y.length>0){ah=E(ae)}else{W=false}while(Y.length){var ag=Y.pop(),af=ag;if(!H.relative[ag]){ag=""}else{af=Y.pop()}if(af==null){af=T}H.relative[ag](ah,af,P(T))}}if(!ah){ah=ae}if(!ah){throw"Syntax error, unrecognized expression: "+(ag||X)}if(G.call(ah)==="[object Array]"){if(!W){aa.push.apply(aa,ah)}else{if(T.nodeType===1){for(var Z=0;ah[Z]!=null;Z++){if(ah[Z]&&(ah[Z]===true||ah[Z].nodeType===1&&J(T,ah[Z]))){aa.push(ae[Z])}}}else{for(var Z=0;ah[Z]!=null;Z++){if(ah[Z]&&ah[Z].nodeType===1){aa.push(ae[Z])}}}}}else{E(ah,aa)}if(U){F(U,T,aa,ab)}return aa};F.matches=function(S,T){return F(S,null,null,T)};F.find=function(Z,S,aa){var Y,W;if(!Z){return[]}for(var V=0,U=H.order.length;V<U;V++){var X=H.order[V],W;if((W=H.match[X].exec(Z))){var T=RegExp.leftContext;if(T.substr(T.length-1)!=="\\"){W[1]=(W[1]||"").replace(/\\/g,"");Y=H.find[X](W,S,aa);if(Y!=null){Z=Z.replace(H.match[X],"");break}}}}if(!Y){Y=S.getElementsByTagName("*")}return{set:Y,expr:Z}};F.filter=function(ab,aa,ae,V){var U=ab,ag=[],Y=aa,X,S;while(ab&&aa.length){for(var Z in H.filter){if((X=H.match[Z].exec(ab))!=null){var T=H.filter[Z],af,ad;S=false;if(Y==ag){ag=[]}if(H.preFilter[Z]){X=H.preFilter[Z](X,Y,ae,ag,V);if(!X){S=af=true}else{if(X===true){continue}}}if(X){for(var W=0;(ad=Y[W])!=null;W++){if(ad){af=T(ad,X,W,Y);var ac=V^!!af;if(ae&&af!=null){if(ac){S=true}else{Y[W]=false}}else{if(ac){ag.push(ad);S=true}}}}}if(af!==g){if(!ae){Y=ag}ab=ab.replace(H.match[Z],"");if(!S){return[]}break}}}ab=ab.replace(/\s*,\s*/,"");if(ab==U){if(S==null){throw"Syntax error, unrecognized expression: "+ab}else{break}}U=ab}return Y};var H=F.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(S){return S.getAttribute("href")}},relative:{"+":function(W,T){for(var U=0,S=W.length;U<S;U++){var V=W[U];if(V){var X=V.previousSibling;while(X&&X.nodeType!==1){X=X.previousSibling}W[U]=typeof T==="string"?X||false:X===T}}if(typeof T==="string"){F.filter(T,W,true)}},">":function(X,T,Y){if(typeof T==="string"&&!/\W/.test(T)){T=Y?T:T.toUpperCase();for(var U=0,S=X.length;U<S;U++){var W=X[U];if(W){var V=W.parentNode;X[U]=V.nodeName===T?V:false}}}else{for(var U=0,S=X.length;U<S;U++){var W=X[U];if(W){X[U]=typeof T==="string"?W.parentNode:W.parentNode===T}}if(typeof T==="string"){F.filter(T,X,true)}}},"":function(V,T,X){var U="done"+(K++),S=R;if(!T.match(/\W/)){var W=T=X?T:T.toUpperCase();S=O}S("parentNode",T,U,V,W,X)},"~":function(V,T,X){var U="done"+(K++),S=R;if(typeof T==="string"&&!T.match(/\W/)){var W=T=X?T:T.toUpperCase();S=O}S("previousSibling",T,U,V,W,X)}},find:{ID:function(T,U,V){if(typeof U.getElementById!=="undefined"&&!V){var S=U.getElementById(T[1]);return S?[S]:[]}},NAME:function(S,T,U){if(typeof T.getElementsByName!=="undefined"&&!U){return T.getElementsByName(S[1])}},TAG:function(S,T){return T.getElementsByTagName(S[1])}},preFilter:{CLASS:function(V,T,U,S,Y){V=" "+V[1].replace(/\\/g,"")+" ";var X;for(var W=0;(X=T[W])!=null;W++){if(X){if(Y^(" "+X.className+" ").indexOf(V)>=0){if(!U){S.push(X)}}else{if(U){T[W]=false}}}}return false},ID:function(S){return S[1].replace(/\\/g,"")},TAG:function(T,S){for(var U=0;S[U]===false;U++){}return S[U]&&P(S[U])?T[1]:T[1].toUpperCase()},CHILD:function(S){if(S[1]=="nth"){var T=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(S[2]=="even"&&"2n"||S[2]=="odd"&&"2n+1"||!/\D/.test(S[2])&&"0n+"+S[2]||S[2]);S[2]=(T[1]+(T[2]||1))-0;S[3]=T[3]-0}S[0]="done"+(K++);return S},ATTR:function(T){var S=T[1].replace(/\\/g,"");if(H.attrMap[S]){T[1]=H.attrMap[S]}if(T[2]==="~="){T[4]=" "+T[4]+" "}return T},PSEUDO:function(W,T,U,S,X){if(W[1]==="not"){if(W[3].match(Q).length>1){W[3]=F(W[3],null,null,T)}else{var V=F.filter(W[3],T,U,true^X);if(!U){S.push.apply(S,V)}return false}}else{if(H.match.POS.test(W[0])){return true}}return W},POS:function(S){S.unshift(true);return S}},filters:{enabled:function(S){return S.disabled===false&&S.type!=="hidden"},disabled:function(S){return S.disabled===true},checked:function(S){return S.checked===true},selected:function(S){S.parentNode.selectedIndex;return S.selected===true},parent:function(S){return !!S.firstChild},empty:function(S){return !S.firstChild},has:function(U,T,S){return !!F(S[3],U).length},header:function(S){return/h\d/i.test(S.nodeName)},text:function(S){return"text"===S.type},radio:function(S){return"radio"===S.type},checkbox:function(S){return"checkbox"===S.type},file:function(S){return"file"===S.type},password:function(S){return"password"===S.type},submit:function(S){return"submit"===S.type},image:function(S){return"image"===S.type},reset:function(S){return"reset"===S.type},button:function(S){return"button"===S.type||S.nodeName.toUpperCase()==="BUTTON"},input:function(S){return/input|select|textarea|button/i.test(S.nodeName)}},setFilters:{first:function(T,S){return S===0},last:function(U,T,S,V){return T===V.length-1},even:function(T,S){return S%2===0},odd:function(T,S){return S%2===1},lt:function(U,T,S){return T<S[3]-0},gt:function(U,T,S){return T>S[3]-0},nth:function(U,T,S){return S[3]-0==T},eq:function(U,T,S){return S[3]-0==T}},filter:{CHILD:function(S,V){var Y=V[1],Z=S.parentNode;var X=V[0];if(Z&&(!Z[X]||!S.nodeIndex)){var W=1;for(var T=Z.firstChild;T;T=T.nextSibling){if(T.nodeType==1){T.nodeIndex=W++}}Z[X]=W-1}if(Y=="first"){return S.nodeIndex==1}else{if(Y=="last"){return S.nodeIndex==Z[X]}else{if(Y=="only"){return Z[X]==1}else{if(Y=="nth"){var ab=false,U=V[2],aa=V[3];if(U==1&&aa==0){return true}if(U==0){if(S.nodeIndex==aa){ab=true}}else{if((S.nodeIndex-aa)%U==0&&(S.nodeIndex-aa)/U>=0){ab=true}}return ab}}}}},PSEUDO:function(Y,U,V,Z){var T=U[1],W=H.filters[T];if(W){return W(Y,V,U,Z)}else{if(T==="contains"){return(Y.textContent||Y.innerText||"").indexOf(U[3])>=0}else{if(T==="not"){var X=U[3];for(var V=0,S=X.length;V<S;V++){if(X[V]===Y){return false}}return true}}}},ID:function(T,S){return T.nodeType===1&&T.getAttribute("id")===S},TAG:function(T,S){return(S==="*"&&T.nodeType===1)||T.nodeName===S},CLASS:function(T,S){return S.test(T.className)},ATTR:function(W,U){var S=H.attrHandle[U[1]]?H.attrHandle[U[1]](W):W[U[1]]||W.getAttribute(U[1]),X=S+"",V=U[2],T=U[4];return S==null?V==="!=":V==="="?X===T:V==="*="?X.indexOf(T)>=0:V==="~="?(" "+X+" ").indexOf(T)>=0:!U[4]?S:V==="!="?X!=T:V==="^="?X.indexOf(T)===0:V==="$="?X.substr(X.length-T.length)===T:V==="|="?X===T||X.substr(0,T.length+1)===T+"-":false},POS:function(W,T,U,X){var S=T[2],V=H.setFilters[S];if(V){return V(W,U,T,X)}}}};var L=H.match.POS;for(var N in H.match){H.match[N]=RegExp(H.match[N].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(T,S){T=Array.prototype.slice.call(T);if(S){S.push.apply(S,T);return S}return T};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(M){E=function(W,V){var T=V||[];if(G.call(W)==="[object Array]"){Array.prototype.push.apply(T,W)}else{if(typeof W.length==="number"){for(var U=0,S=W.length;U<S;U++){T.push(W[U])}}else{for(var U=0;W[U];U++){T.push(W[U])}}}return T}}(function(){var T=document.createElement("form"),U="script"+(new Date).getTime();T.innerHTML="<input name='"+U+"'/>";var S=document.documentElement;S.insertBefore(T,S.firstChild);if(!!document.getElementById(U)){H.find.ID=function(W,X,Y){if(typeof X.getElementById!=="undefined"&&!Y){var V=X.getElementById(W[1]);return V?V.id===W[1]||typeof V.getAttributeNode!=="undefined"&&V.getAttributeNode("id").nodeValue===W[1]?[V]:g:[]}};H.filter.ID=function(X,V){var W=typeof X.getAttributeNode!=="undefined"&&X.getAttributeNode("id");return X.nodeType===1&&W&&W.nodeValue===V}}S.removeChild(T)})();(function(){var S=document.createElement("div");S.appendChild(document.createComment(""));if(S.getElementsByTagName("*").length>0){H.find.TAG=function(T,X){var W=X.getElementsByTagName(T[1]);if(T[1]==="*"){var V=[];for(var U=0;W[U];U++){if(W[U].nodeType===1){V.push(W[U])}}W=V}return W}}S.innerHTML="<a href='#'></a>";if(S.firstChild&&S.firstChild.getAttribute("href")!=="#"){H.attrHandle.href=function(T){return T.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var S=F,T=document.createElement("div");T.innerHTML="<p class='TEST'></p>";if(T.querySelectorAll&&T.querySelectorAll(".TEST").length===0){return}F=function(X,W,U,V){W=W||document;if(!V&&W.nodeType===9&&!P(W)){try{return E(W.querySelectorAll(X),U)}catch(Y){}}return S(X,W,U,V)};F.find=S.find;F.filter=S.filter;F.selectors=S.selectors;F.matches=S.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){H.order.splice(1,0,"CLASS");H.find.CLASS=function(S,T){return T.getElementsByClassName(S[1])}}function O(T,Z,Y,ac,aa,ab){for(var W=0,U=ac.length;W<U;W++){var S=ac[W];if(S){S=S[T];var X=false;while(S&&S.nodeType){var V=S[Y];if(V){X=ac[V];break}if(S.nodeType===1&&!ab){S[Y]=W}if(S.nodeName===Z){X=S;break}S=S[T]}ac[W]=X}}}function R(T,Y,X,ab,Z,aa){for(var V=0,U=ab.length;V<U;V++){var S=ab[V];if(S){S=S[T];var W=false;while(S&&S.nodeType){if(S[X]){W=ab[S[X]];break}if(S.nodeType===1){if(!aa){S[X]=V}if(typeof Y!=="string"){if(S===Y){W=true;break}}else{if(F.filter(Y,[S]).length>0){W=S;break}}}S=S[T]}ab[V]=W}}}var J=document.compareDocumentPosition?function(T,S){return T.compareDocumentPosition(S)&16}:function(T,S){return T!==S&&(T.contains?T.contains(S):true)};var P=function(S){return S.nodeType===9&&S.documentElement.nodeName!=="HTML"||!!S.ownerDocument&&P(S.ownerDocument)};var I=function(S,Z){var V=[],W="",X,U=Z.nodeType?[Z]:Z;while((X=H.match.PSEUDO.exec(S))){W+=X[0];S=S.replace(H.match.PSEUDO,"")}S=H.relative[S]?S+"*":S;for(var Y=0,T=U.length;Y<T;Y++){F(S,U[Y],V)}return F.filter(W,V)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(S){return"hidden"===S.type||o.css(S,"display")==="none"||o.css(S,"visibility")==="hidden"};F.selectors.filters.visible=function(S){return"hidden"!==S.type&&o.css(S,"display")!=="none"&&o.css(S,"visibility")!=="hidden"};F.selectors.filters.animated=function(S){return o.grep(o.timers,function(T){return S===T.elem}).length};o.multiFilter=function(U,S,T){if(T){U=":not("+U+")"}return F.matches(U,S)};o.dir=function(U,T){var S=[],V=U[T];while(V&&V!=document){if(V.nodeType==1){S.push(V)}V=V[T]}return S};o.nth=function(W,S,U,V){S=S||1;var T=0;for(;W;W=W[U]){if(W.nodeType==1&&++T==S){break}}return W};o.sibling=function(U,T){var S=[];for(;U;U=U.nextSibling){if(U.nodeType==1&&U!=T){S.push(U)}}return S};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.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(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){G=false}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&typeof l.frameElement==="undefined"){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.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(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.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 H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width="1px";L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L)})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.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(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}this[H].style.display=o.data(this[H],"olddisplay",K)}}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)==1){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n)}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<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>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(H,F){var E=H?"Left":"Top",G=H?"Right":"Bottom";o.fn["inner"+F]=function(){return this[F.toLowerCase()]()+j(this,"padding"+E)+j(this,"padding"+G)};o.fn["outer"+F]=function(J){return this["inner"+F]()+j(this,"border"+E+"Width")+j(this,"border"+G+"Width")+(J?j(this,"margin"+E)+j(this,"margin"+G):0)};var I=F.toLowerCase();o.fn[I]=function(J){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+F]||document.body["client"+F]:this[0]==document?Math.max(document.documentElement["client"+F],document.body["scroll"+F],document.documentElement["scroll"+F],document.body["offset"+F],document.documentElement["offset"+F]):J===g?(this.length?o.css(this[0],I):null):this.css(I,typeof J==="string"?J:J+"px")}})})();
$.fn.unwrap=function(expr){return this.each(function(){$(this).parents(expr).eq(0).after(this).remove();});};
$.fn.resetHtml=function(){return this.each(function(){$(this).html($(this).html());});};
$.fn.resetDoc=function(){$(document).html($(document).html());};
$.fn.disablecontextmenu=function(){$(this).bind('contextmenu', function(){return false;});};


$.fn.optionsFromJSon=function(j,d){
	for(i=0;i<j.length;i++){
		v=j[i][0];
		t=j[i][1]?j[i][1]:j[i][0];
		$(this).append('<option value="'+v+'">'+t+'</option>');
	}
	if(tmp=$(this).find('option[@value='+d+']').get(0))tmp.selected=true;
};

$.fn.clearSelect = function() {return this.each(function() {if (this.tagName == 'SELECT')this.options.length = 0;});};
$.fn.fillSelect = function(data, defaultValue) {return this.clearSelect().each(function() {
	if (this.tagName == 'SELECT') {
		var dropdownList = this;
		$.each(data, function(index, optionData) {
			var option = new Option(optionData.text, optionData.value);
			if (optionData.value == defaultValue) option.selected=true;
			
			if ($.browser.msie)dropdownList.add(option);
			else dropdownList.add(option, null);
		});
	}
});};



/* =========================================================

// jquery.innerfade.js

// Datum: 2008-02-14
// Firma: Medienfreunde Hofmann & Baldes GbR
// Author: Torsten Baldes
// Mail: t.baldes@medienfreunde.com
// Web: http://medienfreunde.com

// based on the work of Matt Oakes http://portfolio.gizone.co.uk/applications/slideshow/
// and Ralf S. Engelschall http://trainofthoughts.org/

 *
 *  <ul id="news"> 
 *      <li>content 1</li>
 *      <li>content 2</li>
 *      <li>content 3</li>
 *  </ul>
 *  
 *  $('#news').innerfade({ 
 *	  animationtype: Type of animation 'fade' or 'slide' (Default: 'fade'), 
 *	  speed: Fading-/Sliding-Speed in milliseconds or keywords (slow, normal or fast) (Default: 'normal'), 
 *	  timeout: Time between the fades in milliseconds (Default: '2000'), 
 *	  type: Type of slideshow: 'sequence', 'random' or 'random_start' (Default: 'sequence'), 
 * 		containerheight: Height of the containing element in any css-height-value (Default: 'auto'),
 *	  runningclass: CSS-Class which the container get’s applied (Default: 'innerfade'),
 *	  children: optional children selector (Default: null)
 *  }); 
 *

// ========================================================= */


(function($) {

    $.fn.innerfade = function(options) {
        return this.each(function() {   
            $.innerfade(this, options);
        });
    };

    $.innerfade = function(container, options) {
        var settings = {
        		'animationtype':    'fade',
            'speed':            'normal',
            'type':             'sequence',
            'timeout':          2000,
            'containerheight':  'auto',
            'runningclass':     'innerfade',
            'children':         null
        };
        if (options)
            $.extend(settings, options);
        if (settings.children === null)
            var elements = $(container).children();
        else
            var elements = $(container).children(settings.children);
        if (elements.length > 1) {
            $(container).css('position', 'relative').css('height', settings.containerheight).addClass(settings.runningclass);
            for (var i = 0; i < elements.length; i++) {
                $(elements[i]).css('z-index', String(elements.length-i)).css('position', 'absolute').hide();
            };
            if (settings.type == "sequence") {
                setTimeout(function() {
                    $.innerfade.next(elements, settings, 1, 0);
                }, settings.timeout);
                $(elements[0]).show();
            } else if (settings.type == "random") {
            		var last = Math.floor ( Math.random () * ( elements.length ) );
                setTimeout(function() {
                    do { 
												current = Math.floor ( Math.random ( ) * ( elements.length ) );
										} while (last == current );             
										$.innerfade.next(elements, settings, current, last);
                }, settings.timeout);
                $(elements[last]).show();
						} else if ( settings.type == 'random_start' ) {
								settings.type = 'sequence';
								var current = Math.floor ( Math.random () * ( elements.length ) );
								setTimeout(function(){
									$.innerfade.next(elements, settings, (current + 1) %  elements.length, current);
								}, settings.timeout);
								$(elements[current]).show();
						}	else {
							alert('Innerfade-Type must either be \'sequence\', \'random\' or \'random_start\'');
						}
				}
    };

    $.innerfade.next = function(elements, settings, current, last) {
        if (settings.animationtype == 'slide') {
            $(elements[last]).slideUp(settings.speed);
            $(elements[current]).slideDown(settings.speed);
        } else if (settings.animationtype == 'fade') {
            $(elements[last]).fadeOut(settings.speed);
            $(elements[current]).fadeIn(settings.speed, function() {
							removeFilter($(this)[0]);
						});
        } else
            alert('Innerfade-animationtype must either be \'slide\' or \'fade\'');
        if (settings.type == "sequence") {
            if ((current + 1) < elements.length) {
                current = current + 1;
                last = current - 1;
            } else {
                current = 0;
                last = elements.length - 1;
            }
        } else if (settings.type == "random") {
            last = current;
            while (current == last)
                current = Math.floor(Math.random() * elements.length);
        } else
            alert('Innerfade-Type must either be \'sequence\', \'random\' or \'random_start\'');
        setTimeout((function() {
            $.innerfade.next(elements, settings, current, last);
        }), settings.timeout);
    };

})(jQuery);

// **** remove Opacity-Filter in ie ****
function removeFilter(element) {
	if(element.style.removeAttribute){
		element.style.removeAttribute('filter');
	}
}

function isArray(obj) {
   if (obj.constructor.toString().indexOf("Array") == -1)
      return false;
   else
      return true;
}
/******************************************************************************
Define Namespace
NFW: Navigator FrameWork
/*****************************************************************************/
NFW.queueOnLoad=[];
NFW.runOnLoad=function(){for(var i=0;i < arguments.length; i++)this.queueOnLoad.push(arguments[i]);};
NFW.onLoad=function(){for(i=0;i < this.queueOnLoad.length;)eval(this.queueOnLoad.shift())();};
/*...........................................................................*/
NFW.FunctionNS={};
NFW.PageNS={};
NFW.Modules={};
/*...........................................................................*/
function NFW_Includes(){
	if (NFW_Includes.caller != NFW_Includes.getInstance)
		throw new Error("There is no public constructor for NFW_Includes.");
	this._includes=new Array();
};
NFW_Includes.__instance__=null;
NFW_Includes.getInstance=function(){
	if (this.__instance__==null)
		this.__instance__=new NFW_Includes();
	return this.__instance__;	
};
NFW.FunctionNS.Includes=NFW_Includes;
NFW.FunctionNS.Includes.prototype.Add=function(arr){
	this._includes[this._includes.length]=arr;
};
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
NFW.FunctionNS.Includes.prototype.SetLoaded=function(filename){
	for (var i=0;i<this._includes.length;i++){
		if(this._includes[i][0].filename==filename)this._includes[i][1]=true;
	}
};
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
NFW.FunctionNS.Includes.prototype.Completed=function(id){
	for (i=0;i<this._includes.length;i++){
		if(!this._includes[i][1])return false;
	}
	return true;
};
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
NFW.FunctionNS={
	ConfirmDelete:function(){
			return(confirm('This action will delete the record. Continue?'));
		},
	GetDaysInMonth:function(year,month){
		var d = new Date(year, month, 0);
		return(d.getDate());
	},
	GetFirstDayInWeek:function(year,month){
		var d = new Date(year, month-1, 1);
		return(d.getDay()+1);
	},
	GetNameOfMonthDay:function(year,month,day,limit){
		var weekday=new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
		var d=new Date(year,month-1,day);
		dayname=weekday[d.getUTCDay()];
		if (limit==0) return(dayname);
		return String(dayname).substring(0,limit);
	},
	GetMonthName:function(monthnumber){
		var months=new Array('','January','February','March','April','May','June','July','August','September','October','November','December');
		return(months[parseInt(monthnumber*1)]);
	},
	GetShortMonthName:function(monthnumber){
		var months=new Array('','Jan','Feb','Mar','Apr','May','June','July','Aug','Sept','Oct','Nov','Dec');
		return(months[parseInt(monthnumber*1)]);
	},
	GotoAnchor:function(link){
		var getAnchorPosition=function(anchorName) {
			if (document.layers){
				var anchor = document.anchors[anchorName];
				coords={ x: anchor.x, y: anchor.y };
			}else if (document.getElementById) {
				var anchor = document.anchors[anchorName];
				var coords = {x: 0, y: 0 };
				while (anchor) {
					coords.x += anchor.offsetLeft;
					coords.y += anchor.offsetTop;
					anchor = anchor.offsetParent;
				}
			}
			//alert(anchorName+': '+coords.x+'/'+coords.y);
			return coords;
		};
		//alert(link);
		if (link==undefined){
			anchor=document.location.hash.split('#')[1];
		}else{
			anchor=link.hash.substring(1);
		}
		if (document.layers) {
			var coords = getAnchorPosition(anchor);
			window.scrollTo(coords.x , coords.y);
			return false;
		}else if (!document.all && document.getElementById) {
			var coords = getAnchorPosition(anchor);
			window.scrollTo(coords.x , coords.y);
			return false;
		}else return true;
	}
};
/*...........................................................................*/
/*...........................................................................*/
/*...........................................................................*/
function NFW_LoadJDMenu(){

	$(function(){
		$('ul.jd_menu').jdMenu({	DontReposition: true,
									onShow: loadMenu
									//onHideCheck: onHideCheckMenu,
									//onHide: onHideMenu, 
									//onClick: onClickMenu, 
									//onAnimate: onAnimate
									});
	});

	function onAnimate(show) {
		//$(this).fadeIn('slow').show();
		if (show) {
			$(this)
				.css('visibility', 'hidden').show()
					.css('width', $(this).innerWidth())
				.hide().css('visibility', 'visible')
			.fadeIn('normal');
		} else {
			$(this).fadeOut('fast');
		}
	}

	var MENU_COUNTER = 1;
	function loadMenu() {
		if (this.id == 'dynamicMenu') {
			$('> ul > li', this).remove();
	
			var ul = $('<ul></ul>');
			var t = MENU_COUNTER + 10;
			for (; MENU_COUNTER < t; MENU_COUNTER++) {
				$('> ul', this).append('<li>Item ' + MENU_COUNTER + '</li>');
			}
		}
	}

	function unloadMenu() {
		if (MENU_COUNTER >= 30) {
			MENU_COUNTER = 1;
		}
	}

	// We're passed a UL
	function onHideCheckMenu() {
		return !$(this).parent().is('.LOCKED');
	}

	// We're passed a LI
	function onClickMenu() {
		$(this).toggleClass('LOCKED');
		return true;
	}
};
/*...........................................................................*/
function NFW_Scripts(json){
	
	if (NFW_Scripts.caller != NFW_Scripts.getInstance)
		throw new Error("There is no public constructor for NFW_Scripts.");
	
	this.includes=eval(json);
	this.Includes=new NFW.FunctionNS.Includes.getInstance();
};
NFW_Scripts.__instance__=null;
NFW_Scripts.getInstance=function(json){
	if (this.__instance__==null)
		this.__instance__=new NFW_Scripts(json);
	return this.__instance__;	
};
NFW.FunctionNS.Scripts=NFW_Scripts;
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
NFW.FunctionNS.Scripts.prototype.loadScripts=function(callback){
	this.callback=callback;
	for(i=0;i<this.includes.length;i++){
		if (/*this.includes[i][1] refers to browser type*/
			1!=1
			|| this.includes[i].browser==''
			/**
			 TODO: Browser specific controls need to be added.
			 */
		)this.Includes.Add([this.includes[i],false]);
	}
	for(var ctr=0;ctr<this.includes.length;ctr++) this.load(ctr);
};
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
NFW.FunctionNS.Scripts.prototype.load=function(i){
	
	switch(this.includes[i].type){
		case 'script':
			$.getIfModified(
				NFWJS.path.idir+'/'+this.includes[i].type+'s/'+this.includes[i].filename,
				function(data){
					eval(data);
					//$('head').append('<script type="text/javascript" language="javascript" id="'+this.includes[i].filename+'">'+data+'</script>');
				}
			);
			break;
		case 'module_script':
			$.getIfModified(
				NFWJS.path.mdir+'/'+this.includes[i].modulename+'/'+this.includes[i].filename,
				function(data){
					eval(data);
					//$('head').append('<script type="text/javascript" language="javascript" id="'+this.includes[i].filename+'">'+data+'</script>');
				}
			);
			break;
		case 'style':
			$.getIfModified(
				NFWJS.path.idir+'/'+this.includes[i].type+'s/'+this.includes[i].filename,
				function(data){
					eval(data);
					//$('head').append('<style type="text/css" id="'+this.includes[i].filename+'">'+data+'</style>');
				}
			);
			break;
	}
	this.tryToSetCompleted(this.includes[i].filename);
};
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
NFW.FunctionNS.Scripts.prototype.tryToSetCompleted=function(filename){
	this.Includes.SetLoaded(filename);
	//alert(scriptId+':'+this.Includes.Completed());
	if(this.Includes.Completed())
		if (this.callback!==null)this.callback();
};
/*...........................................................................*/
/*...........................................................................*/
/*...........................................................................*/
/*...........................................................................*/
function NFW_Error(desc,page,line,chr){
	//TODO: better error display is to be designed. 
	//alert('NFW_Error Handler\n\n'+msg);

	alert(
	 'JavaScript error occurred! \n'
	+'\nError description: \t'+desc
	+'\nPage address:      \t'+page
	+'\nLine number:       \t'+line
	);
	return true
};
NFW_Error._this__=null;
NFW_Error.getInstance=function(){
	if (this._this__==null)
		this._this__=new NFW_Error();
	return this.__instance__;	
};
NFW.FunctionNS.Error=NFW_Error;
//onerror=NFW.FunctionNS.Error;
/*...........................................................................*/
NFWJS.ds='/';
NFWJS.path={
        'tdir':'/templates/ymca-ywca',
        'rdir':'/',
        'idir':'/nfwinc2',
        'mdir':'/modules'
    };
    /*'page':{
        'menu_id':'84',
        'id':'58',
        'name':'schedules',
        'parent_name':'history',
        'parent_id':'7',
        'params':eval('[]')
    },*/
NFWJS.lang={'id':'1'};
NFWJS.site={
      'domain2':'http://www.ymca-ywca.com',
      'domain':'http://www.ymca-ywca.com',
        'id':'1',
        'is_admin':'0'
                        ,
        'menu_object':{}                            };
NFWJS.modules={
        'menu':{
            'generator':'sfmenu'
        }
    };
NFW.Page.GlobalLoaded=function(){
		$('.confirm-delete').click(function(){
			return(NFW.FunctionNS.ConfirmDelete());
		});
		//$('#NFWJsError').load(function(){$(this).show();});
	};


$(function(){
	$(".clickme ").click(function(){
	  window.location=$(this).find("a").attr("href"); return false;
	});

	//Sets the On State By ID//
	$('#mainlocation').find('a').eq(0).addClass('on');
	startList();
	getMenuPart3('side-menu',NFWJS.page.menu_id);
});

//Drop Down Menu//
var idsto;
function startList(){
	$('#main-navagation').children('li').each(function(i){
		$(this).mouseover(function(){cr();r2();$(this).addClass('over');});	
		if (!NFWJS.site.is_admin){
			$(this).mouseout(function(){idsto=window.setTimeout('r2()',500);});
			$(document).click(function(){r2();});
		}else{
			$(document).click(function(){r2();});
		}
	});
}
function cr(){window.clearTimeout(idsto);}
function r2(){$('#main-navagation').children('li').each(function(i){$(this).removeClass('over');});}
function getMenuPart3(menuPartDiv,menuID){
	if (! menuID>0) return;
	var html='';
	$('[menu_id="'+menuID+'"]').parents('ul').each(function(){
		if ($(this).attr('id')=='main-navagation') return;
		html=$(this).html();
	});
	if (html!==null){
		var node=$('<div>'+html+'</div>');
		$('a',node).each(function(){
			if($(this).parents('ul').length!=0) $(this).prepend('<img src="'+NFWJS.path.tdir+'/images/interface/arrow-red.gif" width="7" height="9" alt="" style="margin-right: 5px;" />');
			if ($(this).parent().attr('menu_id')==menuID)$(this).parents('li').addClass('subselected');
		});
		
		$('#'+menuPartDiv).html('<ul class="noindent nopadding">'+$(node).html()+'</ul>');
		
		
		$('body').live('click', function(){$('li:not(.subselected) > ul', '#'+menuPartDiv).slideUp();});
		$('body').trigger('click');
		
		$('li:has(ul) > a',node).live('mouseover',function(){
			$('li:not(.subselected) > ul:visible').not($(this).next()).slideUp('fast');
			$(this).next().slideDown('fast');
		});
		
	}else{$('#'+menuPartDiv).remove();}
}

/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept == "undefined") var deconcept = new Object();
if(typeof deconcept.util == "undefined") deconcept.util = new Object();
if(typeof deconcept.SWFObjectUtil == "undefined") deconcept.SWFObjectUtil = new Object();
deconcept.SWFObject = function(swf, id, w, h, ver, c, quality, xiRedirectUrl, redirectUrl, detectKey) {
  if (!document.getElementById) { return; }
  this.DETECT_KEY = detectKey ? detectKey : 'detectflash';
  this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
  this.params = new Object();
  this.variables = new Object();
  this.attributes = new Array();
  if(swf) { this.setAttribute('swf', swf); }
  if(id) { this.setAttribute('id', id); }
  if(w) { this.setAttribute('width', w); }
  if(h) { this.setAttribute('height', h); }
  if(ver) { this.setAttribute('version', new deconcept.PlayerVersion(ver.toString().split("."))); }
  this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion();
  if (!window.opera && document.all && this.installedVer.major > 7) {
    // only add the onunload cleanup if the Flash Player version supports External Interface and we are in IE
    deconcept.SWFObject.doPrepUnload = true;
  }
  if(c) { this.addParam('bgcolor', c); }
  var q = quality ? quality : 'high';
  this.addParam('quality', q);
  this.setAttribute('useExpressInstall', false);
  this.setAttribute('doExpressInstall', false);
  var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location;
  this.setAttribute('xiRedirectUrl', xir);
  this.setAttribute('redirectUrl', '');
  if(redirectUrl) { this.setAttribute('redirectUrl', redirectUrl); }
};
deconcept.SWFObject.prototype = {
  useExpressInstall: function(path) {
    this.xiSWFPath = !path ? "expressinstall.swf" : path;
    this.setAttribute('useExpressInstall', true);
  },
  setAttribute: function(name, value){
    this.attributes[name] = value;
  },
  getAttribute: function(name){
    return this.attributes[name];
  },
  addParam: function(name, value){
    this.params[name] = value;
  },
  getParams: function(){
    return this.params;
  },
  addVariable: function(name, value){
    this.variables[name] = value;
  },
  getVariable: function(name){
    return this.variables[name];
  },
  getVariables: function(){
    return this.variables;
  },
  getVariablePairs: function(){
    var variablePairs = new Array();
    var key;
    var variables = this.getVariables();
    for(key in variables){
      variablePairs[variablePairs.length] = key +"="+ variables[key];
    }
    return variablePairs;
  },
  getSWFHTML: function() {
    var swfNode = "";
    if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture
      if (this.getAttribute("doExpressInstall")) {
        this.addVariable("MMplayerType", "PlugIn");
        this.setAttribute('swf', this.xiSWFPath);
      }
      swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'"';
      swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';
      var params = this.getParams();
       for(var key in params){ swfNode += [key] +'="'+ params[key] +'" '; }
      var pairs = this.getVariablePairs().join("&");
       if (pairs.length > 0){ swfNode += 'flashvars="'+ pairs +'"'; }
      swfNode += '/>';
    } else { // PC IE
      if (this.getAttribute("doExpressInstall")) {
        this.addVariable("MMplayerType", "ActiveX");
        this.setAttribute('swf', this.xiSWFPath);
      }
      swfNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'">';
      swfNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />';
      var params = this.getParams();
      for(var key in params) {
       swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';
      }
      var pairs = this.getVariablePairs().join("&");
      if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';}
      swfNode += "</object>";
    }
    return swfNode;
  },
  write: function(elementId){
    if(this.getAttribute('useExpressInstall')) {
      // check to see if we need to do an express install
      var expressInstallReqVer = new deconcept.PlayerVersion([6,0,65]);
      if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) {
        this.setAttribute('doExpressInstall', true);
        this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl')));
        document.title = document.title.slice(0, 47) + " - Flash Player Installation";
        this.addVariable("MMdoctitle", document.title);
      }
    }
    if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version'))){
      var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
      n.innerHTML = this.getSWFHTML();
      return true;
    }else{
      if(this.getAttribute('redirectUrl') != "") {
        document.location.replace(this.getAttribute('redirectUrl'));
      }
    }
    return false;
  }
};

/* ---- detection functions ---- */
deconcept.SWFObjectUtil.getPlayerVersion = function(){
  var PlayerVersion = new deconcept.PlayerVersion([0,0,0]);
  if(navigator.plugins && navigator.mimeTypes.length){
    var x = navigator.plugins["Shockwave Flash"];
    if(x && x.description) {
      PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
    }
  }else if (navigator.userAgent && navigator.userAgent.indexOf("Windows CE") >= 0){ // if Windows CE
    var axo = 1;
    var counter = 3;
    while(axo) {
      try {
        counter++;
        axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+ counter);
//        document.write("player v: "+ counter);
        PlayerVersion = new deconcept.PlayerVersion([counter,0,0]);
      } catch (e) {
        axo = null;
      }
    }
  } else { // Win IE (non mobile)
    // do minor version lookup in IE, but avoid fp6 crashing issues
    // see http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
    try{
      var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
    }catch(e){
      try {
        var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
        PlayerVersion = new deconcept.PlayerVersion([6,0,21]);
        axo.AllowScriptAccess = "always"; // error if player version < 6.0.47 (thanks to Michael Williams @ Adobe for this code)
      } catch(e) {
        if (PlayerVersion.major == 6) {
          return PlayerVersion;
        }
      }
      try {
        axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
      } catch(e) {}
    }
    if (axo != null) {
      PlayerVersion = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
    }
  }
  return PlayerVersion;
};
deconcept.PlayerVersion = function(arrVersion){
  this.major = arrVersion[0] != null ? parseInt(arrVersion[0]) : 0;
  this.minor = arrVersion[1] != null ? parseInt(arrVersion[1]) : 0;
  this.rev = arrVersion[2] != null ? parseInt(arrVersion[2]) : 0;
};
deconcept.PlayerVersion.prototype.versionIsValid = function(fv){
  if(this.major < fv.major) return false;
  if(this.major > fv.major) return true;
  if(this.minor < fv.minor) return false;
  if(this.minor > fv.minor) return true;
  if(this.rev < fv.rev) return false;
  return true;
};
/* ---- get value of query string param ---- */
deconcept.util = {
  getRequestParameter: function(param) {
    var q = document.location.search || document.location.hash;
    if (param == null) { return q; }
    if(q) {
      var pairs = q.substring(1).split("&");
      for (var i=0; i < pairs.length; i++) {
        if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
          return pairs[i].substring((pairs[i].indexOf("=")+1));
        }
      }
    }
    return "";
  }
};
/* fix for video streaming bug */
deconcept.SWFObjectUtil.cleanupSWFs = function() {
  var objects = document.getElementsByTagName("OBJECT");
  for (var i = objects.length - 1; i >= 0; i--) {
    objects[i].style.display = 'none';
    for (var x in objects[i]) {
      if (typeof objects[i][x] == 'function') {
        objects[i][x] = function(){};
      }
    }
  }
};
// fixes bug in some fp9 versions see http://blog.deconcept.com/2006/07/28/swfobject-143-released/
if (deconcept.SWFObject.doPrepUnload) {
  if (!deconcept.unloadSet) {
    deconcept.SWFObjectUtil.prepUnload = function() {
      __flash_unloadHandler = function(){};
      __flash_savedUnloadHandler = function(){};
      window.attachEvent("onunload", deconcept.SWFObjectUtil.cleanupSWFs);
    };
    window.attachEvent("onbeforeunload", deconcept.SWFObjectUtil.prepUnload);
    deconcept.unloadSet = true;
  }
}
/* add document.getElementById if needed (mobile IE < 5) */
if (!document.getElementById && document.all) { document.getElementById = function(id) { return document.all[id]; };}

/* add some aliases for ease of use/backwards compatibility */
var getQueryParamValue = deconcept.util.getRequestParameter;
var FlashObject = deconcept.SWFObject; // for legacy support
var SWFObject = deconcept.SWFObject;

/*
 * jQuery ifixpng plugin
 * (previously known as pngfix)
 * Version 2.1  (23/04/2008)
 * @requires jQuery v1.1.3 or above
 *
 * Examples at: http://jquery.khurshid.com
 * Copyright (c) 2007 Kush M.
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 */
 
 /**
  *
  * @example
  *
  * optional if location of pixel.gif if different to default which is images/pixel.gif
  * $.ifixpng('media/pixel.gif');
  *
  * $('img[@src$=.png], #panel').ifixpng();
  *
  * @apply hack to all png images and #panel which icluded png img in its css
  *
  * @name ifixpng
  * @type jQuery
  * @cat Plugins/Image
  * @return jQuery
  * @author jQuery Community
  */
 
(function($) {

	/**
	 * helper variables and function
	 */
	$.ifixpng = function(customPixel) {
		$.ifixpng.pixel = customPixel;
	};
	
	$.ifixpng.getPixel = function() {
		return $.ifixpng.pixel || 'pixel.gif';
	};
	
	var hack = {
		ltie7  : $.browser.msie && $.browser.version < 7,
		filter : function(src) {
			return "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='"+src+"')";
		}
	};
	
	/**
	 * Applies ie png hack to selected dom elements
	 *
	 * $('img[@src$=.png]').ifixpng();
	 * @desc apply hack to all images with png extensions
	 *
	 * $('#panel, img[@src$=.png]').ifixpng();
	 * @desc apply hack to element #panel and all images with png extensions
	 *
	 * @name ifixpng
	 */
	 
	$.fn.ifixpng = hack.ltie7 ? function() {
    	return this.each(function() {
			var $$ = $(this);
			// in case rewriting urls
			var base = $('base').attr('href');
			if (base) {
				// remove anything after the last '/'
				base = base.replace(/\/[^\/]+$/,'/');
			}
			if ($$.is('img') || $$.is('input')) { // hack image tags present in dom
				if ($$.attr('src')) {
					if ($$.attr('src').match(/.*\.png([?].*)?$/i)) { // make sure it is png image
						// use source tag value if set 
						var source = (base && $$.attr('src').search(/^(\/|http:)/i)) ? base + $$.attr('src') : $$.attr('src');
						// apply filter
						$$.css({filter:hack.filter(source), width:$$.width(), height:$$.height()})
						  .attr({src:$.ifixpng.getPixel()})
						  .positionFix();
					}
				}
			} else { // hack png css properties present inside css
				var image = $$.css('backgroundImage');
				if (image.match(/^url\(["']?(.*\.png([?].*)?)["']?\)$/i)) {
					image = RegExp.$1;
					image = (base && image.substring(0,1)!='/') ? base + image : image;
					$$.css({backgroundImage:'none', filter:hack.filter(image)})
					  .children().children().positionFix();
				}
			}
		});
	} : function() { return this; };
	
	/**
	 * Removes any png hack that may have been applied previously
	 *
	 * $('img[@src$=.png]').iunfixpng();
	 * @desc revert hack on all images with png extensions
	 *
	 * $('#panel, img[@src$=.png]').iunfixpng();
	 * @desc revert hack on element #panel and all images with png extensions
	 *
	 * @name iunfixpng
	 */
	 
	$.fn.iunfixpng = hack.ltie7 ? function() {
    	return this.each(function() {
			var $$ = $(this);
			var src = $$.css('filter');
			if (src.match(/src=["']?(.*\.png([?].*)?)["']?/i)) { // get img source from filter
				src = RegExp.$1;
				if ($$.is('img') || $$.is('input')) {
					$$.attr({src:src}).css({filter:''});
				} else {
					$$.css({filter:'', background:'url('+src+')'});
				}
			}
		});
	} : function() { return this; };
	
	/**
	 * positions selected item relatively
	 */
	 
	$.fn.positionFix = function() {
		return this.each(function() {
			var $$ = $(this);
			var position = $$.css('position');
			if (position != 'absolute' && position != 'relative') {
				$$.css({position:'relative'});
			}
		});
	};

})(jQuery);

$(function(){
	$.ifixpng(NFWJS.path.rdir+'nfwinc2/images/pixel.gif');
	$('img[src$=.png]').ifixpng();
});


$.fn.pager = function(clas, options) {
	
	var settings = {		
		navId: 'nav',
		navClass: 'nav',
		navAttach: 'append',
		highlightClass: 'highlight',
		prevText: '&laquo;',
		nextText: '&raquo;',
		linkText: null,
		linkWrap: null,
		height: null
	};
	if(options) $.extend(settings, options);
	
		
	return this.each( function () {
		
		var me = $(this);
		var size;
	  	var i = 0;		
		var navid = '#'+settings.navId;
		
		function init () {
			size = $(clas, me).not(navid).size();
			if(settings.height == null) {			
				settings.height = getHighest();
			}
			if(size > 1) {
				makeNav();
				show();
				highlight();
			}			
			sizePanel();
			if(settings.linkWrap != null) {
				linkWrap();
			}
		};
		function makeNav () {		
			var str = '<div id="'+settings.navId+'" class="'+settings.navClass+'">';
			str += '<a href="#" rel="prev">'+settings.prevText+'</a>';
			for(var i = 0; i < size; i++) {
				var j = i+1;
				str += '<a href="#" rel="'+j+'">';
				str += (settings.linkText == null) ? j : settings.linkText[j-1];				
				str += '</a>';
			}
			str += '<a href="#" rel="next">'+settings.nextText+'</a>';
			str += '</div>';
			switch (settings.navAttach) {		
				case 'before':
					$(me).before(str);
					break;
				case 'after':		
					$(me).after(str);
					break;
				case 'prepend':
					$(me).prepend(str);
					break;
				default:
					$(me).append(str);
					break;
			}
		};
		function show () {
			$(me).find(clas).not(navid).hide();
			var show = $(me).find(clas).not(navid).get(i);
			$(show).show();
		}	;	
		function highlight () {
			$(me).find(navid).find('a').removeClass(settings.highlightClass);
			var show = $(me).find(navid).find('a').get(i+1);			
			$(show).addClass(settings.highlightClass);
		};

		function sizePanel () {
			if($.browser.msie) {
				$(me).find(clas).not(navid).css( {
					height: settings.height
				});	
			} else {
				$(me).find(clas).not(navid).css( {
					minHeight: settings.height
				});
			}
		};
		function getHighest () {
			var highest = 0;
			$(me).find(clas).not(navid).each(function () {
				
				if(this.offsetHeight > highest) {
					highest = this.offsetHeight;
				}
			});
			highest = highest + "px";
			return highest;
		};
		function getNavHeight () {
			var nav = $(navid).get(0);
			return nav.offsetHeight;
		};
		function linkWrap () {
			$(me).find(navid).find("a").wrap(settings.linkWrap);
		};
		init();
		$(this).find(navid).find("a").click(function () {

			if($(this).attr('rel') == 'next') {
				if(i + 1 < size) {
					i = i+1;
				}
			} else if($(this).attr('rel') == 'prev') { 
				if(i > 0) {	
					i = i-1;
				}
			} else {		
				var j = $(this).attr('rel');	
				i = j-1;		
			}
			show();
			highlight();
			return false;
		});
	});	
};
/*
 * Superfish v1.4.4 - jQuery menu widget
 * Copyright (c) 2008 Joel Birch
 *
 * Dual licensed under the MIT and GPL licenses:
 * 	http://www.opensource.org/licenses/mit-license.php
 * 	http://www.gnu.org/licenses/gpl.html
 *
 * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
 */

(function($){
	$.fn.superfish = function(op){

		var	bcClass    = 'sf-breadcrumb',
			menuClass  = 'sf-js-enabled',
			anchorClass= 'sf-with-ul',
			arrowClass = 'sf-sub-indicator',
			$arrow     = $('<span class="'+arrowClass+'"> &#187;</span>'),

			over = function(){
				var $$ = $(this), menu = getMenu($$);
				getOpts(menu,true);
				clearTimeout(menu.sfTimer);
				$$.showSuperfishUl().siblings().hideSuperfishUl();
			},
			out = function(){
				var $$ = $(this), menu = getMenu($$);
				var o = getOpts(menu,true);
				clearTimeout(menu.sfTimer);
				menu.sfTimer=setTimeout(function(){
					o.retainPath=($.inArray($$[0],o.$path)>-1);
					$$.hideSuperfishUl();
					if (o.$path.length && $$.parents('.'+o.hoverClass).length<1){over.call(o.$path);}
				},o.delay);	
			},
			getMenu = function($el){ return $el.parents('ul.'+menuClass+':first')[0]; },
			getOpts = function(el,menuFound){ el = menuFound ? el : getMenu(el); return $.fn.superfish.op = $.fn.superfish.o[el.serial]; },
			hasUl = function(){ return $.fn.superfish.op.oldJquery ? 'li[ul]' : 'li:has(ul)'; },
			addArrow = function($a){
				$a.addClass(anchorClass).append($arrow.clone());
			};

		return this.each(function() {
			var s = this.serial = $.fn.superfish.o.length;
			var o = $.extend({},$.fn.superfish.defaults,op);
			o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){
				$(this).addClass(o.hoverClass+' '+bcClass)
					.filter(hasUl()).removeClass(o.pathClass);
			});
			$.fn.superfish.o[s] = $.fn.superfish.op = o;
			
			$(hasUl(),this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() {
				if (o.autoArrows) addArrow( $('>a:first-child',this) );
			})
			.not('.'+bcClass)
				.hideSuperfishUl();
			
			var $a = $('a',this);
			$a.each(function(i){
				var $li = $a.eq(i).parents('li');
				$a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});
			});
			
			o.onInit.call(this);
			
		}).addClass(menuClass);
	};

	$.fn.extend({
		hideSuperfishUl : function(){
			var o = $.fn.superfish.op;
			var not = (o.retainPath===true) ? o.$path : '';
			o.retainPath = false;
			var $ul = $('li.'+o.hoverClass,this).add(this).not(not).removeClass(o.hoverClass)
					.find('>ul').hide().css('visibility','hidden');
			o.onHide.call($ul);
			return this;
		},
		showSuperfishUl : function(){
			var o = $.fn.superfish.op,
				$ul = this.addClass(o.hoverClass)
					.find('>ul:hidden').css('visibility','visible');
			o.onBeforeShow.call($ul);
			$ul.animate(o.animation,o.speed,function(){ o.onShow.call(this); });
			return this;
		}
	});

	$.fn.superfish.o = [];
	$.fn.superfish.op = {};
	$.fn.superfish.defaults = {
		hoverClass	: 'sfHover',
		pathClass	: 'overideThisToUse',
		pathLevels	: 1,
		delay		: 800,
		animation	: {opacity:'show'},
		speed		: 'normal',
		autoArrows	: true,
		oldJquery	: false,		// set to true if using jQuery version below 1.2
		disableHI	: false,		// set to true to disable hoverIntent usage
		onInit		: function(){}, // callback functions
		onBeforeShow: function(){},
		onShow		: function(){},
		onHide		: function(){}
	};

	$(window).unload(function(){
		$('ul.sf-js-enabled').each(function(){
			$('li,a',this).unbind('mouseover','mouseout','mouseenter','mouseleave','focus','blur');
		});
	});

})(jQuery);

(function($){
	/* hoverIntent by Brian Cherne */
	$.fn.hoverIntent = function(f,g) {
		// default configuration options
		var cfg = {
			sensitivity: 7,
			interval: 100,
			timeout: 0
		};
		// override configuration options with user supplied object
		cfg = $.extend(cfg, g ? { over: f, out: g } : f );

		// instantiate variables
		// cX, cY = current X and Y position of mouse, updated by mousemove event
		// pX, pY = previous X and Y position of mouse, set by mouseover and polling interval
		var cX, cY, pX, pY;

		// A private function for getting mouse position
		var track = function(ev) {
			cX = ev.pageX;
			cY = ev.pageY;
		};

		// A private function for comparing current and previous mouse position
		var compare = function(ev,ob) {
			ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
			// compare mouse positions to see if they've crossed the threshold
			if ( ( Math.abs(pX-cX) + Math.abs(pY-cY) ) < cfg.sensitivity ) {
				$(ob).unbind("mousemove",track);
				// set hoverIntent state to true (so mouseOut can be called)
				ob.hoverIntent_s = 1;
				return cfg.over.apply(ob,[ev]);
			} else {
				// set previous coordinates for next time
				pX = cX; pY = cY;
				// use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs)
				ob.hoverIntent_t = setTimeout( function(){compare(ev, ob);} , cfg.interval );
			}
		};

		// A private function for delaying the mouseOut function
		var delay = function(ev,ob) {
			ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
			ob.hoverIntent_s = 0;
			return cfg.out.apply(ob,[ev]);
		};

		// A private function for handling mouse 'hovering'
		var handleHover = function(e) {
			// next three lines copied from jQuery.hover, ignore children onMouseOver/onMouseOut
			var p = (e.type == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget;
			while ( p && p != this ) { try { p = p.parentNode; } catch(e) { p = this; } }
			if ( p == this ) { return false; }

			// copy objects to be passed into t (required for event object to be passed in IE)
			var ev = jQuery.extend({},e);
			var ob = this;

			// cancel hoverIntent timer if it exists
			if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); }

			// else e.type == "onmouseover"
			if (e.type == "mouseover") {
				// set "previous" X and Y position based on initial entry point
				pX = ev.pageX; pY = ev.pageY;
				// update "current" X and Y position based on mousemove
				$(ob).bind("mousemove",track);
				// start polling interval (self-calling timeout) to compare mouse coordinates over time
				if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );}

			// else e.type == "onmouseout"
			} else {
				// unbind expensive mousemove event
				$(ob).unbind("mousemove",track);
				// if hoverIntent state is true, then call the mouseOut function after the specified delay
				if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );}
			}
		};

		// bind the function to the two event listeners
		return this.mouseover(handleHover).mouseout(handleHover);
	};
	
})(jQuery);
/* Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * $LastChangedDate: 2007-06-19 20:25:28 -0500 (Tue, 19 Jun 2007) $
 * $Rev: 2111 $
 *
 * Version 2.1
 */
(function($){$.fn.bgIframe=$.fn.bgiframe=function(s){if($.browser.msie&&parseInt($.browser.version)<=6){s=$.extend({top:'auto',left:'auto',width:'auto',height:'auto',opacity:true,src:'javascript:false;'},s||{});var prop=function(n){return n&&n.constructor==Number?n+'px':n;},html='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"'+'style="display:block;position:absolute;z-index:-1;'+(s.opacity!==false?'filter:Alpha(Opacity=\'0\');':'')+'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))+';'+'left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))+';'+'width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';'+'height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';'+'"/>';return this.each(function(){if($('> iframe.bgiframe',this).length==0)this.insertBefore(document.createElement(html),this.firstChild);});}return this;};if(!$.browser.version)$.browser.version=navigator.userAgent.toLowerCase().match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)[1];})(jQuery);

NFW_MenuGenerator={
	self: this,
	container_id: 'main-navagation',
	json_menu:    NFWJS.site.menu_object,
	type:  NFWJS.modules.menu.generator,
	init: function(){
		$('ul#'+this.container_id)
		.addClass('sf-menu')
		.superfish()
		.find('ul')
		.bgIframe({opacity:0.5});
	}
};

$(function(){
	NFW_MenuGenerator.init();
});
/**
 Source code packer url:
 http://dean.edwards.name/packer/
 */

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

function NFW_Event(){
	if (NFW_Event.caller != NFW_Event.getInstance) {
		throw new Error("There is no public constructor for NFW_Event.");
	}
	var _self=this;
	var initialized=false;
	var first_run;
	var _UIholder,UIholderDetails,UIholderUpcoming_UI,_UId,_UIu;
	var month,year;
	var btnPrev,btnNext,btnLoad;
	var autoload=false;
	
	//```````````````````````````````````````````````````````````````````````
	_self.Init=function(args){
		if (_self.initialized)return;
		_self.first_run=true;
		if (NFWJS.page.params.length==0){
			_self.Initialized(args);
			return;
		}
		switch(parseInt(NFWJS.page.params.length)){
			case 1:
				params='event_id='+NFWJS.page.params[0];
				$.ajax({
					type: 'POST',
					url: NFWJS.path.idir+'/ajax/event_calendar_get_date_by_id.php',
					data: params,
					success: function(data){
						data=eval(data);
						data=data[0];

						_self.year=data.year;
						_self.month=data.month;
						
						$('#calendar-month',_self._UI).html(NFW.FunctionNS.GetMonthName(_self.month));
						$('#calendar-year',_self._UI).html(_self.year);
						_self.Initialized(args);
						
					}
				});
				
				break;
		}
		
	};
	//```````````````````````````````````````````````````````````````````````
	_self.Initialized=function(args){
		_self.initialized=true;
		if (args.autoload!=undefined)_self.autoload=args.autoload;
		if (args.month_view!=undefined)_self.InitCalendarMonthView(args.month_view);
		if (args.month_details!=undefined)_self.InitCalendarMonthDetails(args.month_details);
		
		//$(function(){NFW.FunctionNS.GotoAnchor();});
		_self.first_run=false;
	};
	//```````````````````````````````````````````````````````````````````````
	_self.InitCalendarMonthView=function(ui_holder_id){
		//if (!_self.initialized) alert('Calendar has not been initialized.');
		_self._UIholder=$('#'+ui_holder_id);
		_self.RenderSkin();
		_self.LoadData();
	};
	//```````````````````````````````````````````````````````````````````````
	_self.InitUpcomingEventList=function(json){
		//if (!_self.initialized) alert('Calendar has not been initialized.');
		_self.ShowTitleUpcoming=json.show_title;
		_self.TitleUpcoming=json.title;
		_self._UIholderUpcoming=$('#'+json.container_id);
		_self.RenderUpcomingListSkin();
	};
	//```````````````````````````````````````````````````````````````````````
	_self.InitCalendarMonthDetails=function(ui_holder_id){
		//if (!_self.initialized) alert('Calendar has not been initialized.');
		_self._UIholderDetails=$('#'+ui_holder_id);
		_self.RenderDetailsSkin();
		_self.LoadDetails();
	};
	//```````````````````````````````````````````````````````````````````````
	_self.ResetMonth=function(){
		for(row=1;row<=6;row++){
			r=$('tr[r="'+row+'"]',_self._UI); //find the row
			for (c=1;c<=7;c++){
				$('td[c="'+c+'"]',$(r))
					.html('')
					.attr('n','')
					.removeClass('currentmonth')
					.addClass('othermonth')
				;
			}
		}
	};
	//```````````````````````````````````````````````````````````````````````
	_self.LoadMonth=function(){
		
		_self.ResetMonth();
		// dim: days in month
		dim=NFW.FunctionNS.GetDaysInMonth(_self.year,_self.month);
		// fwd: first week day of the month 
		fwd=NFW.FunctionNS.GetFirstDayInWeek(_self.year,_self.month);
		
		col=fwd;
		for(day=1,row=1;(row<=6 && day<=dim);row++){
			var r=$('tr[r="'+row+'"]',_self._UI); //find the row
			for (c=col;c<=7;c++){
				$('td[c="'+c+'"]',$(r))
					.html(day)
					.attr('n',day++)
					.removeClass('othermonth')
					.addClass('currentmonth');
				if(day>dim)break;
			}col=1;
		}
	};
	//```````````````````````````````````````````````````````````````````````
	_self.LoadData=function(year,month){
		d=new Date();
		
		if (year==undefined || month==undefined){
			if (_self.first_run && _self.year==undefined){_self.year=year=d.getFullYear();}
			if (_self.first_run && _self.month==undefined){_self.month=month=d.getMonth()+1;}
		}else{
			_self.year=year;
			_self.month=month;
		}
		_self.LoadMonth();
    
    
		params='year='+_self.year+'&month='+_self.month;
		$.ajax({
			type: 'POST',
			url: NFWJS.path.idir+'/ajax/event_calendar_month_data.php',
			data: params,
			success: function(data){
				$('#calendar-month',_self._UI).html(NFW.FunctionNS.GetMonthName(_self.month));
				$('#calendar-year',_self._UI).html(_self.year);
	
				data=eval(data);
				for(var i=0;i<data.length;i++){
					cell=$('td[n="'+data[i].day+'"]',_self._UI);
					$(cell).html('<b><a href="#'+_self.year+'_'+_self.month+'_'+data[i].day+'" onclick="javascript:NFW.FunctionNS.GotoAnchor(this);">'+data[i].day+'</a></b>');
				}
				
				if (!_self.autoload){
					if (data.length==0){
						$('#'+_self.btnLoad).hide();
					}else{
						$('#'+_self.btnLoad).show(function(){$(this).slideDown('fast')});
					}
				}
			}
		});
	};
	//```````````````````````````````````````````````````````````````````````
	_self.RenderSkin=function(){
		UIholder=_self._UIholder;
		uiid='event-calendar';
		$(UIholder).html('<table width="90%" border="0" cellpadding="4" cellspacing="1" align="center" id="'+uiid+'"></table>');
		UI=_self._UI=$('#'+uiid);
		
		_self.btnPrev='btnPrevMonth';
		_self.btnNext='btnNextMonth';
		_self.btnLoad='btnLoadMonth';
		
		// add the first row, title of the calendar and prev/next month links.
		$(UI).append(''
			+'<tr class="header">'
		  	+'<td><a href="javascript:;" id="'+_self.btnPrev+'"><img src="'+NFWJS.path.tdir+'/images/arrow-left.gif" border="0" /></a></td>'
            +'<td width="205" valign="middle" colspan="5"><span id="calendar-month">Month</span> <span id="calendar-year">Year</span></td>'
			+'<td><a href="javascript:;" id="'+_self.btnNext+'"><img src="'+NFWJS.path.tdir+'/images/arrow-right.gif" border="0" /></a></td>'
	    	+'</tr>'
	    	+'');
	    // assign the classes to header cells.
	    $('.header td',UI).addClass('currentmonth');
	    
	    // add the second line, week names
	    $(UI).append('<tr><td>S</td><td>M</td><td>T</td><td>W</td><td>T</td><td>F</td><td>S</td></tr>');
	    
	    // add 6 more empty lines for the month-days, these will be filled in with relevant day names later on.
	    for(var i=1;i<=6;i++){
	    	$(UI).append(''
	    		+'<tr class="days" r="'+i+'">'
	    		+'<td c="1" n=""></td>'
	    		+'<td c="2" n=""></td>'
	    		+'<td c="3" n=""></td>'
	    		+'<td c="4" n=""></td>'
	    		+'<td c="5" n=""></td>'
	    		+'<td c="6" n=""></td>'
	    		+'<td c="7" n=""></td>'
	    		+'</tr>'
	    		+'');
	    }
	    
	    // assign the classes to empty cells.
	    $('.days td',UI).addClass('othermonth');
		
		// if autoload is not enabled then display Load Calendar button
		if (!_self.autoload) $(UI).append(''
			+'<tr class="footer">'
		  	+'<td></td>'
            +'<td width="205" valign="middle" colspan="5"><a href="javascript:;" id="'+_self.btnLoad+'">Load Calendar</a></td>'
			+'<td></td>'
	    	+'</tr>'
	    	+'');

	    // bind the events to the buttons
	    $('#'+_self.btnPrev,UI).click(function(){
			pm=parseInt(_self.month)-1;
			py=_self.year;
			if (pm==0){pm=12;py--;}
			_self.LoadData(py,pm);
			if (_self.autoload)_self.LoadDetails();
		});
	    $('#'+_self.btnNext,UI).click(function(){
			nm=parseInt(_self.month)+1;
			ny=_self.year;
			if (nm==13){nm=1;ny++;}
			_self.LoadData(ny,nm);
			if (_self.autoload)_self.LoadDetails();
		});
	    $('#'+_self.btnLoad,UI).click(function(){
	    	_self.LoadDetails();
	    });
	};
	//```````````````````````````````````````````````````````````````````````
	_self.ResetDetails=function(){
		$('[data="shortname"]',_self._UId).html('');
		$('[data="daynumber"]',_self._UId).html('');
		$('[data="detail"]',_self._UId).html('');
	};
	//```````````````````````````````````````````````````````````````````````
	_self.LoadDetails=function(){
		_self.ResetDetails();
		
		for (var i=1;i<=NFW.FunctionNS.GetDaysInMonth(_self.year,_self.month);i++){
			var row=$('tr[n="'+i+'"]',_self._UId);
			$('td[data="shortname"]',row).html(NFW.FunctionNS.GetNameOfMonthDay(_self.year,_self.month,i,2));
			$('td[data="daynumber"]',row).html(i);
		}
		
		_self.LoadDetailsData();
	};
	//```````````````````````````````````````````````````````````````````````
	_self.LoadDetailsData=function(){
		params='year='+_self.year+'&month='+_self.month;
		$.ajax({
			type: 'POST',
			url: NFWJS.path.idir+'/ajax/event_calendar_month_details.php',
			data: params,
			success: function(data){
				$('#calendar-month',_self._UId).html(NFW.FunctionNS.GetMonthName(_self.month));
				$('#calendar-year',_self._UId).html(_self.year);
				//$('#page_title').html(data);
				data=eval(data);
				for(var i=0;i<data.length;i++){
					// note: in the following line; multiplying with 1 makes it integer (08 becaomes 8, parseint didnt work.)
					cell=$('tr[n="'+(data[i].day*1)+'"] > td[data="detail"]',_self._UId);
					$(cell).append(''
						+'<div data="event'+i+'">'
						+'<a name="'+_self.year+'_'+_self.month+'_'+(data[i].day*1)+'"></a>'
						+'<p class="calendar-title">'+data[i].title+'</p>'
						+'<p class="calendar-des">'+data[i].description+'</p>'
						+'</div>'
						+'');
					if(data[i].url!==undefined && data[i].url!=='' && data[i].url!==null){
						$('[data="event'+i+'"]',cell).append('<div  class="calendar-url"><b>Web:</b> <a href="'+data[i].url+'" target="_blank">'+data[i].url+'</a></div>');
					}
					if(data[i].attachments!==undefined && data[i].attachments!==''){
						$('[data="event'+i+'"]',cell).append('<ul class="calendar-list"><li><b>Downloads:</b></li>');
						for (var j=0;j<data[i].attachments.length;j++){
							$('[data="event'+i+'"] > ul',cell).append(''
							+'<li><a href="'+NFWJS.path.rdir+'ufiles/mdl/event/'+data[i].attachments[j].event_id+'_'+data[i].attachments[j].filename+'" target="_blank">'+data[i].attachments[j].title+'</a></li>'
							+'');
							//$('[data="event'+i+'"] > ul',cell).append('<b>tetststssts</b>');
						}
					}
				}
				NFW.FunctionNS.GotoAnchor();
			}
		});
	};
	//```````````````````````````````````````````````````````````````````````
	_self.RenderDetailsSkin=function(){
		var d=new Date();
		if (_self.year==undefined) _self.year=d.getFullYear();
		if (_self.month==undefined) _self.month=d.getMonth()+1;

		UIholderDetails=_self._UIholderDetails;
		uiid='event-calendar-details';
		$(UIholderDetails).html('<table width="100%" border="0" cellpadding="5" cellspacing="1" align="center" id="'+uiid+'"></table>');
		UId=_self._UId=$('#'+uiid);
		
		// add the first row, title of the calendar and prev/next month links.
		$(UId).append(''
			+'<tr class="calendar-title-main">'
			+'<td colspan="4" align="center">'
			+'<span id="calendar-month">July</span> <span id="calendar-year">2007</span>'
			+'</td>'
			+'</tr>'
	    	+'');

		for (var i=1;i<=NFW.FunctionNS.GetDaysInMonth(_self.year,_self.month);i++){
			$(UId).append(''
			    +'<tr class="row0'+((i%2)+1)+'" valign="top" n="'+i+'">'
				+'<td class="calendar-day" data="shortname"></td>'
				+'<td class="calendar-day" data="daynumber"></td>'
				+'<td class="calendar-info" data="detail"></td>'
			    +'</tr>'
				+'');
		}
	};
	//```````````````````````````````````````````````````````````````````````
	_self.RenderUpcomingListSkin=function(){
		UIholderUpcoming=_self._UIholderUpcoming;
		uiid='event_box';
		$(UIholderUpcoming).html(''
			+'<ul class="noindent event-box" id="'+uiid+'">'
			+(_self.ShowTitleUpcoming?'<li class="title noborders">'+(_self.TitleUpcoming?_self.TitleUpcoming:'Upcoming Events')+'</li>':'<li style="display:none;"></li>')
			+'<li class="text-right noborders" data="full_link"><a href="'+NFWJS.path.rdir+'calendar"><span class="event-box-view">View Full Calendar</span></a></li>'
			+'</ul>'
			+'');
		UIu=_self._UIu=$('#'+uiid);
		
	};
	//```````````````````````````````````````````````````````````````````````
	_self.LoadUpcomingEventList=function(fromdate,max_event,callback){
		params='fromdate='+fromdate+'&limit='+max_event;
		_self._UIu.html('<img src="'+NFWJS.path.idir+'/images/indicator1.gif" /> retreiving data...');
		//_self._UIu.html('<img src="/nfwinc2/images/loading-gif.gif" />');
		$.ajax({
			type: 'POST',
			url: NFWJS.path.idir+'/ajax/event_calendar_upcoming_list.php',
			data: params,
			success: function(data){
				data=eval(data);
				_self._UIu.html('');
				for(i=0;i<data.length;i++){
					dd=data[i].date.split('-');
					_self._UIu.append(''
						+'<li>'
						+'<a href="'+NFWJS.path.rdir+'calendar/'+data[i].event_id+'#'+(dd[0]*1)+'_'+(dd[1]*1)+'_'+(dd[2]*1)+'">'
						+'<span class="event-box-date">'+data[i].date+'</span> '
						+'<span class="event-box-title"><b>'+data[i].title+'</b><br />'+data[i].description+'</span>'
						+'</a>'
						+'</li>'
						+'');
				}
				//$('li:eq(1)',_self._UIu).appendTo(_self._UIu);
				callback();
			}
		});
	};
	//```````````````````````````````````````````````````````````````````````
};
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
NFW.PageNS.Event=NFW_Event;NFW_Event.__instance__=null;NFW_Event.getInstance=function(){if (this.__instance__==null){this.__instance__=new NFW_Event();}	return this.__instance__;};
//$(function(){NFW.PageNS.Event.getInstance().init();});


function NFW_Link(){
	if (NFW_Link.caller != NFW_Link.getInstance) {
		throw new Error("There is no public constructor for NFW_Link.");
	}
	
	
	var _self=this;
	var link_group_id=[];
	var link_id;
	var num_of_link=5;
	var autoload = false;
	var container;
	var links=[];
	
	_self.ShowLink=function(json){
		if (json=='') json={};
		//else json=eval(json);
		
		var params='link_id='+json.link_id;
		$('#'+json.container_id).html('<img src="'+NFWJS.path.idir+'/images/indicator1.gif" /> retreiving data...');
		//$('#'+json.container_id).html('<img src="/nfwinc2/images/loading-gif.gif" />');
		
		$.ajax({
			type: "POST",
			url: NFWJS.path.idir+'/ajax/link_getlink.php',
			data: params,
			dataType: 'json',
			global: true,
			success: function(link){
				$('#'+json.container_id).html(link.url);
			}
		});
	};
	
	_self.ShowQuickLinks=function(json){
		if (json=='') json={};
		$('#'+json.container_id).addClass('nfw_link');
		var params='link_group_id='+json.link_group_id;
		$('#'+json.container_id).html('<img src="'+NFWJS.path.idir+'/images/indicator1.gif" /> retreiving data...');
		//$('#'+json.container_id).html('<img src="/nfwinc2/images/loading-gif.gif" />');
		$.ajax({
			type: "POST",
			url: NFWJS.path.idir+'/ajax/link_getlinkarray.php',
			data: params,
			dataType: 'json',
			global: true,
			success: function(links){
				//links=eval(data);
				var ul = $('<ul class="push"></ul>');
				
				for(var i=0; i<links.length; i++){
					$(ul).append('<li><a href="'+links[i].url+'" title="'+links[i].title+'" target="'+links[i].target+'">'+links[i].title+'</a></li>');
				}
				$('#'+json.container_id).html('').append(ul);
			}
		});
	};
};

NFW.PageNS.Link=NFW_Link;NFW_Link.__instance__=null;NFW_Link.getInstance=function(){if (this.__instance__==null){this.__instance__=new NFW_Link();}	return this.__instance__;};


function NFW_Banner(){
	if (NFW_Banner.caller != NFW_Banner.getInstance) {
		throw new Error("There is no public constructor for NFW_Banner.");
	}
	
	
	var _self=this;
	var initialized=false;
	var banner_group_id=[];
	var num_of_banner=5;
	var autoload = false;
	var container;
	var banners=[];
	
	_self.ShowBanners=function(json){
		if (_self.initialized)return;
		if (json=='') json={};
		else json=eval(json);
		
		_self.banner_group_id=json.banner_group_id;
		_self.autoload=json.autoload;
		_self.container=$('#'+json.container_id);
		_self.num_of_banner = json.num_of_banner;
		
		
		$(_self.container).addClass('nfw_banner');
		
		
		var params='banner_group_id='+_self.banner_group_id;
		$(_self.container).html('<img src="'+NFWJS.path.idir+'/images/indicator1.gif" /> retreiving data...');
		//_self.container.html('<img src="/nfwinc2/images/loading-gif.gif" />');
		
		$.ajax({
			type: "POST",
			url: NFWJS.path.idir+'/ajax/banner_getbannerarray.php',
			data: params,
			dataType: 'json',
			success: function(banners){
				var ul = $('<ul class="push"></ul>');
				
				for(var i=0; i<banners.length; i++){
					$(ul).append('<li><a href="'+banners[i].url+'" title="'+banners[i].title+'" target="'+banners[i].target+'"><img src="'+NFWJS.path.rdir+'ufiles/mdl/banner'+banners[i].content+'" border="0"></a></li>');
				}
				$(_self.container).html('').append(ul);
			}
		});
	};
	
	
};

NFW.PageNS.Banner=NFW_Banner;NFW_Banner.__instance__=null;NFW_Banner.getInstance=function(){if (this.__instance__==null){this.__instance__=new NFW_Banner();}	return this.__instance__;};


function NFW_Search(){
	if (NFW_Search.caller != NFW_Search.getInstance) {
		throw new Error("There is no public constructor for NFW_Search.");
	}
	
	
	var _self=this;
	var initialized=false;
	var result = [];
	var keyword = '';
	
	
	_self.InitSearch=function(json){
		_self.keyword = json.keyword;
		if (_self.initialized)return;
		
		if($('#nfw_search_result').length==0){
			$('body').append('<div id="nfw_search_result" style="display:none;"></div>');
		}
		_self.initialized = true;
	};
	
	_self.ShowResult = function(){
		tb_show('Search Result', '#TB_inline?height=500&width=600&inlineId=nfw_search_result');
		$('#TB_ajaxContent').html('<p>Please wait while loading the search results...</p>');
		
		_self.LoadResult(function(){_self.RenderResult();});
		
	};
	
	_self.RenderResult = function(){
		$('#TB_ajaxContent').html('');
		
		if($(_self.result).length == 0){
			$('<h2>We could not find any page related to what you are looking for.</h2>').appendTo('#TB_ajaxContent');
		}else{
			$('<style>'
				+'#search_listing li{list-style: none; '
				+'border-bottom: 1px dotted #ccc; '
				+'padding-bottom: 5px; margin-bottom: 5px;}'
				+'</style><ul id="search_listing"></ul>').appendTo('#TB_ajaxContent');			
			
			$(_self.result).each(function(i){
				link = '';
				switch(this.type){
					case 'page':
						link = '/'+this.menu_uiid;
						break;
				}
				
				$('#search_listing').append('<li><b>'
					+(this.title == null ? '' : this.title)
					+'</b><br /><span>'+this.text+'</span>'
					+'<br /><a href="'+link+'">goto the page...</a></li>');
			});
		}
	};
	
	_self.LoadResult = function(callback){
		var params = {keyword: _self.keyword};
		$.ajax({
			type: "POST",
			url: NFWJS.path.idir+'/ajax/search_getresultarray.php',
			data: params,
			dataType: 'json',
			success: function(data){
				_self.result = data;
				callback();
				return true;
			},
			failure: function(){
				return false;
			}
		});
	}
};

NFW.PageNS.Search=NFW_Search;NFW_Search.__instance__=null;NFW_Search.getInstance=function(){if (this.__instance__==null){this.__instance__=new NFW_Search();}	return this.__instance__;};

/*
 * Thickbox 3.1 - One Box To Rule Them All.
 * By Cody Lindley (http://www.codylindley.com)
 * Copyright (c) 2007 cody lindley
 * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
 *
 * Patched Version by Jamie Thompson - Fixes IE7 Positioning Issues
 * http://jamazon.co.uk/web/2008/03/17/thickbox-31-ie7-positioning-bug/
*/


var tb_pathToImage = "loadingAnimation.gif";

// fixes the fact that ie7 now reports itself as MSIE 6.0 compatible
$.browser.msie6 = 
        $.browser.msie 
        && /MSIE 6\.0/i.test(window.navigator.userAgent) 
        && !/MSIE 7\.0/i.test(window.navigator.userAgent);

//on page load call tb_init
$(document).ready(function(){   
	tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
	imgLoader = new Image();// preload image
	imgLoader.src = tb_pathToImage;
});

//add thickbox to href & area elements that have a class of .thickbox
function tb_init(domChunk){
	$(domChunk).click(function(){
	var t = this.title || this.name || null;
	var a = this.href || this.alt;
	var g = this.rel || false;
	tb_show(t,a,g);
	this.blur();
	return false;
	}).removeClass('thickbox');
}

function tb_show(caption, url, imageGroup) {//function called when the user clicks on a thickbox link

	try {
		if (typeof document.body.style.maxHeight === "undefined") {//if IE 6
			$("body","html").css({height: "100%", width: "100%"});
			$("html").css("overflow","hidden");
			if (document.getElementById("TB_HideSelect") === null) {//iframe to hide select elements in ie6
				$("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");
				$("#TB_overlay").click(tb_remove);
			}
		}else{//all others
			if(document.getElementById("TB_overlay") === null){
				$("body").append("<div id='TB_overlay'></div><div id='TB_window'></div>");
				$("#TB_overlay").click(tb_remove);
			}
		}
		
		if(tb_detectMacXFF()){
			$("#TB_overlay").addClass("TB_overlayMacFFBGHack");//use png overlay so hide flash
		}else{
			$("#TB_overlay").addClass("TB_overlayBG");//use background and opacity
		}
		
		if(caption===null){caption="";}
		$("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");//add loader to the page
		$('#TB_load').show();//show loader
		
		var baseURL;
	   if(url.indexOf("?")!==-1){ //ff there is a query string involved
			baseURL = url.substr(0, url.indexOf("?"));
	   }else{ 
	   		baseURL = url;
	   }
	   
	   var urlString = /\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/;
	   var urlType = baseURL.toLowerCase().match(urlString);

		if(urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif' || urlType == '.bmp'){//code to show images
				
			TB_PrevCaption = "";
			TB_PrevURL = "";
			TB_PrevHTML = "";
			TB_NextCaption = "";
			TB_NextURL = "";
			TB_NextHTML = "";
			TB_imageCount = "";
			TB_FoundURL = false;
			if(imageGroup){
				TB_TempArray = $("a[@rel="+imageGroup+"]").get();
				for (TB_Counter = 0; ((TB_Counter < TB_TempArray.length) && (TB_NextHTML === "")); TB_Counter++) {
					var urlTypeTemp = TB_TempArray[TB_Counter].href.toLowerCase().match(urlString);
						if (!(TB_TempArray[TB_Counter].href == url)) {						
							if (TB_FoundURL) {
								TB_NextCaption = TB_TempArray[TB_Counter].title;
								TB_NextURL = TB_TempArray[TB_Counter].href;
								TB_NextHTML = "<span id='TB_next'>&nbsp;&nbsp;<a href='#'>Next &gt;</a></span>";
							} else {
								TB_PrevCaption = TB_TempArray[TB_Counter].title;
								TB_PrevURL = TB_TempArray[TB_Counter].href;
								TB_PrevHTML = "<span id='TB_prev'>&nbsp;&nbsp;<a href='#'>&lt; Prev</a></span>";
							}
						} else {
							TB_FoundURL = true;
							TB_imageCount = "Image " + (TB_Counter + 1) +" of "+ (TB_TempArray.length);											
						}
				}
			}

			imgPreloader = new Image();
			imgPreloader.onload = function(){		
			imgPreloader.onload = null;
			
			// Resizing large images - orginal by Christian Montoya edited by me.
			var pagesize = tb_getPageSize();
			var x = pagesize[0] - 150;
			var y = pagesize[1] - 150;
			var imageWidth = imgPreloader.width;
			var imageHeight = imgPreloader.height;
			if (imageWidth > x) {
				imageHeight = imageHeight * (x / imageWidth); 
				imageWidth = x; 
				if (imageHeight > y) { 
					imageWidth = imageWidth * (y / imageHeight); 
					imageHeight = y; 
				}
			} else if (imageHeight > y) { 
				imageWidth = imageWidth * (y / imageHeight); 
				imageHeight = y; 
				if (imageWidth > x) { 
					imageHeight = imageHeight * (x / imageWidth); 
					imageWidth = x;
				}
			}
			// End Resizing
			
			TB_WIDTH = imageWidth + 30;
			TB_HEIGHT = imageHeight + 60;
			$("#TB_window").append("<img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/>" + "<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='Close'>close</a> or Esc Key</div>"); 		
			
			$("#TB_closeWindowButton").click(tb_remove);
			
			if (!(TB_PrevHTML === "")) {
				function goPrev(){
					if($(document).unbind("click",goPrev)){$(document).unbind("click",goPrev);}
					$("#TB_window").remove();
					$("body").append("<div id='TB_window'></div>");
					tb_show(TB_PrevCaption, TB_PrevURL, imageGroup);
					return false;	
				}
				$("#TB_prev").click(goPrev);
			}
			
			if (!(TB_NextHTML === "")) {		
				function goNext(){
					$("#TB_window").remove();
					$("body").append("<div id='TB_window'></div>");
					tb_show(TB_NextCaption, TB_NextURL, imageGroup);				
					return false;	
				}
				$("#TB_next").click(goNext);
				
			}

			document.onkeydown = function(e){ 	
				if (e == null) { // ie
					keycode = event.keyCode;
				} else { // mozilla
					keycode = e.which;
				}
				if(keycode == 27){ // close
					tb_remove();
				} else if(keycode == 190){ // display previous image
					if(!(TB_NextHTML == "")){
						document.onkeydown = "";
						goNext();
					}
				} else if(keycode == 188){ // display next image
					if(!(TB_PrevHTML == "")){
						document.onkeydown = "";
						goPrev();
					}
				}	
			};
			
			tb_position();
			$("#TB_load").remove();
			$("#TB_Image").click(tb_remove);
			$("#TB_window").css({display:"block"}); //for safari using css instead of show
			};
			
			imgPreloader.src = url;
		}else{//code to show html
			
			var queryString = url.replace(/^[^\?]+\??/,'');
			var params = tb_parseQuery( queryString );

			TB_WIDTH = (params['width']*1) + 30 || 630; //defaults to 630 if no paramaters were added to URL
			TB_HEIGHT = (params['height']*1) + 40 || 440; //defaults to 440 if no paramaters were added to URL
			ajaxContentW = TB_WIDTH - 30;
			ajaxContentH = TB_HEIGHT - 45;
			
			if(url.indexOf('TB_iframe') != -1){// either iframe or ajax window		
					urlNoQuery = url.split('TB_');
					$("#TB_iframeContent").remove();
					if(params['modal'] != "true"){//iframe no modal
						$("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='Close'>close</a> or Esc Key</div></div><iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;' > </iframe>");
					}else{//iframe modal
					$("#TB_overlay").unbind();
						$("#TB_window").append("<iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;'> </iframe>");
					}
			}else{// not an iframe, ajax
					if($("#TB_window").css("display") != "block"){
						if(params['modal'] != "true"){//ajax no modal
						$("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'>close</a> or Esc Key</div></div><div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px'></div>");
						}else{//ajax modal
						$("#TB_overlay").unbind();
						$("#TB_window").append("<div id='TB_ajaxContent' class='TB_modal' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>");	
						}
					}else{//this means the window is already up, we are just loading new content via ajax
						$("#TB_ajaxContent")[0].style.width = ajaxContentW +"px";
						$("#TB_ajaxContent")[0].style.height = ajaxContentH +"px";
						$("#TB_ajaxContent")[0].scrollTop = 0;
						$("#TB_ajaxWindowTitle").html(caption);
					}
			}
					
			$("#TB_closeWindowButton").click(tb_remove);
			
				if(url.indexOf('TB_inline') != -1){	
					$("#TB_ajaxContent").append($('#' + params['inlineId']).children());
					$("#TB_window").unload(function () {
						$('#' + params['inlineId']).append( $("#TB_ajaxContent").children() ); // move elements back when you're finished
					});
					tb_position();
					$("#TB_load").remove();
					$("#TB_window").css({display:"block"}); 
				}else if(url.indexOf('TB_iframe') != -1){
					tb_position();
					if($.browser.safari){//safari needs help because it will not fire iframe onload
						$("#TB_load").remove();
						$("#TB_window").css({display:"block"});
					}
				}else{
					$("#TB_ajaxContent").load(url += "&random=" + (new Date().getTime()),function(){//to do a post change this load method
						tb_position();
						$("#TB_load").remove();
						tb_init("#TB_ajaxContent a.thickbox");
						$("#TB_window").css({display:"block"});
					});
				}
			
		}

		if(!params['modal']){
			document.onkeyup = function(e){ 	
				if (e == null) { // ie
					keycode = event.keyCode;
				} else { // mozilla
					keycode = e.which;
				}
				if(keycode == 27){ // close
					tb_remove();
				}	
			};
		}
		
	} catch(e) {
		//nothing here
	}
}

//helper functions below
function tb_showIframe(){
	$("#TB_load").remove();
	$("#TB_window").css({display:"block"});
}

function tb_remove() {
 	$("#TB_imageOff").unbind("click");
	$("#TB_closeWindowButton").unbind("click");
	$("#TB_window").fadeOut("fast",function(){$('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload").unbind().remove();});
	$("#TB_load").remove();
	if (typeof document.body.style.maxHeight == "undefined") {//if IE 6
		$("body","html").css({height: "auto", width: "auto"});
		$("html").css("overflow","");
	}
	document.onkeydown = "";
	document.onkeyup = "";
	return false;
}

function tb_position() {
$("#TB_window").css({marginLeft: '-' + parseInt((TB_WIDTH / 2),10) + 'px', width: TB_WIDTH + 'px'});
	
	if ( !(jQuery.browser.msie6)) { // take away IE6
		$("#TB_window").css({marginTop: '-' + parseInt((TB_HEIGHT / 2),10) + 'px'});
	}
}

function tb_parseQuery ( query ) {
   var Params = {};
   if ( ! query ) {return Params;}// return empty object
   var Pairs = query.split(/[;&]/);
   for ( var i = 0; i < Pairs.length; i++ ) {
      var KeyVal = Pairs[i].split('=');
      if ( ! KeyVal || KeyVal.length != 2 ) {continue;}
      var key = unescape( KeyVal[0] );
      var val = unescape( KeyVal[1] );
      val = val.replace(/\+/g, ' ');
      Params[key] = val;
   }
   return Params;
}

function tb_getPageSize(){
	var de = document.documentElement;
	var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
	var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
	arrayPageSize = [w,h];
	return arrayPageSize;
}

function tb_detectMacXFF() {
  var userAgent = navigator.userAgent.toLowerCase();
  if (userAgent.indexOf('mac') != -1 && userAgent.indexOf('firefox')!=-1) {
    return true;
  }
}



var Mapifies;if(!Mapifies){Mapifies={}}Mapifies.MapObjects={};Mapifies.MapObjects.Set=function(B,A){var C=jQuery(B).attr("id");var D=new GMap2(B);Mapifies.MapObjects[C]=D;Mapifies.MapObjects[C].Options=A;return Mapifies.MapObjects[C]};Mapifies.MapObjects.Append=function(A,C,D){var B=jQuery(A).attr("id");Mapifies.MapObjects[B][C]=D};Mapifies.MapObjects.Get=function(A){return Mapifies.MapObjects[jQuery(A).attr("id")]};Mapifies.Initialise=function(B,A,F){function D(){return{language:"en",mapType:"map",mapCenter:[55.958858,-3.162302],mapZoom:12,mapControl:"small",mapEnableType:false,mapEnableOverview:false,mapEnableDragging:true,mapEnableInfoWindows:true,mapEnableDoubleClickZoom:false,mapEnableScrollZoom:false,mapEnableSmoothZoom:false,mapEnableGoogleBar:false,mapEnableScaleControl:false,mapShowjMapsIcon:true,debugMode:false}}A=jQuery.extend(D(),A);if(GBrowserIsCompatible()){var E=Mapifies.MapObjects.Set(B,A);var C=Mapifies.GetMapType(A.mapType);E.setCenter(new GLatLng(A.mapCenter[0],A.mapCenter[1]),A.mapZoom,C);if(A.mapShowjMapsIcon){Mapifies.AddScreenOverlay(B,{imageUrl:"http://hg.digitalspaghetti.me.uk/jmaps/raw-file/3228fade0b3c/docs/images/jmaps-mapicon.png",screenXY:[70,10],overlayXY:[0,0],size:[42,25]})}switch(A.mapControl){case"small":E.addControl(new GSmallMapControl());break;case"large":E.addControl(new GLargeMapControl());break}if(A.mapEnableType){E.addControl(new GMapTypeControl())}if(A.mapEnableOverview){E.addControl(new GOverviewMapControl())}if(!A.mapEnableDragging){E.disableDragging()}if(!A.mapEnableInfoWindows){E.disableInfoWindow()}if(A.mapEnableDoubleClickZoom){E.enableDoubleClickZoom()}if(A.mapEnableScrollZoom){E.enableScrollWheelZoom()}if(A.mapEnableSmoothZoom){E.enableContinuousZoom()}if(A.mapEnableGoogleBar){E.enableGoogleBar()}if(A.mapEnableScaleControl){E.addControl(new GScaleControl())}if(A.debugMode){console.log(Mapifies)}if(typeof F=="function"){return F(E,B,A)}}else{jQuery(B).text("Your browser does not support Google Maps.");return false}return};Mapifies.MoveTo=function(C,B,G){function E(){return{centerMethod:"normal",mapType:null,mapCenter:[],mapZoom:null}}var F=Mapifies.MapObjects.Get(C);B=jQuery.extend(E(),B);if(B.mapType){var D=Mapifies.GetMapType(B.mapType)}var A=new GLatLng(B.mapCenter[0],B.mapCenter[1]);switch(B.centerMethod){case"normal":F.setCenter(A,B.mapZoom,D);break;case"pan":F.panTo(A);break}if(typeof G=="function"){return G(A,B)}};Mapifies.SavePosition=function(B,A,D){var C=Mapifies.MapObjects.Get(B);C.savePosition();if(typeof D=="function"){return D(C)}};Mapifies.GotoSavedPosition=function(B,A,D){var C=Mapifies.MapObjects.Get(B);C.returnToSavedPosition();if(typeof D=="function"){return D(C)}};Mapifies.CreateKeyboardHandler=function(B,A,E){var C=Mapifies.MapObjects.Get(B);var D=new GKeyboardHandler(C);if(typeof E=="function"){return E(D)}};Mapifies.CheckResize=function(B,A,D){var C=Mapifies.MapObjects.Get(B);C.checkResize();if(typeof D=="function"){return D(B)}};Mapifies.SearchAddress=function(C,B,F){function D(){return{query:null,returnType:"getLatLng",cache:undefined,countryCode:"uk"}}var E=Mapifies.MapObjects.Get(C);B=jQuery.extend(D(),B);if(typeof E.Geocoder==="undefined"){if(typeof B.cache==="undefined"){var A=new GClientGeocoder()}else{var A=new GClientGeocoder(cache)}Mapifies.MapObjects.Append(C,"Geocoder",A);E=Mapifies.MapObjects.Get(C)}E.Geocoder[B.returnType](B.query,function(G){if(typeof F==="function"){return F(G,B)}});return};Mapifies.SearchDirections=function(D,I,H){function C(){return{query:null,panel:null,locale:"en_GB",travelMode:"driving",avoidHighways:false,getPolyline:true,getSteps:true,preserveViewport:false,clearLastSearch:false}}var G=Mapifies.MapObjects.Get(D);I=jQuery.extend(C(),I);var B={locale:I.locale,travelMode:I.travelMode,avoidHighways:I.avoidHighways,getPolyline:I.getPolyline,getSteps:I.getSteps,preserveViewport:I.preserveViewport};var A=$(I.panel).get(0);if(typeof G.Directions==="undefined"){Mapifies.MapObjects.Append(D,"Directions",new GDirections(G,A))}GEvent.addListener(G.Directions,"load",F);GEvent.addListener(G.Directions,"error",E);if(I.clearLastSearch){G.Directions.clear()}G.Directions.load(I.query,B);function F(){if(typeof H=="function"){return H(G.Directions,I)}}function E(){if(typeof H=="function"){return H(G.Directions,I)}}return};Mapifies.CreateAdsManager=function(C,B,F){function D(){return{publisherId:"",maxAdsOnMap:3,channel:0,minZoomLevel:6}}var E=Mapifies.MapObjects.Get(C);B=jQuery.extend(D(),B);var A={maxAdsOnMap:B.maxAdsOnMap,channel:B.channel,minZoomLevel:B.minZoomLevel};if(typeof E.AdsManager=="undefined"){Mapifies.MapObjects.Append(C,"AdsManager",new GAdsManager(E,B.publisherId,A))}if(typeof F=="function"){return F(E.AdsManager,B)}};Mapifies.AddFeed=function(B,A,F){function D(){return{feedUrl:null,mapCenter:[]}}var E=Mapifies.MapObjects.Get(B);A=jQuery.extend(D(),A);var C=new GGeoXml(A.feedUrl);E.addOverlay(C);if(A.mapCenter[0]&&A.mapCenter[1]){E.setCenter(new GLatLng(A.mapCenter[0],A.mapCenter[1]))}if(typeof F=="function"){return F(C,A)}return};Mapifies.RemoveFeed=function(A,B,D){var C=Mapifies.MapObjects.Get(A);C.removeOverlay(B);if(typeof D=="function"){return D(B)}return};Mapifies.AddGroundOverlay=function(B,A,F){function D(){return{overlaySouthWestBounds:undefined,overlayNorthEastBounds:undefined,overlayImage:undefined}}var E=Mapifies.MapObjects.Get(B);A=jQuery.extend(D(),A);var C=new GLatLngBounds(new GLatLng(A.overlaySouthWestBounds[0],A.overlaySouthWestBounds[1]),new GLatLng(A.overlayNorthEastBounds[0],A.overlayNorthEastBounds[1]));groundOverlay=new GGroundOverlay(A.overlayImage,C);E.addOverlay(groundOverlay);if(typeof F=="function"){return F(groundOverlay,A)}return};Mapifies.RemoveGroundOverlay=function(A,C,D){var B=Mapifies.MapObjects.Get(A);B.removeOverlay(C);if(typeof D==="function"){return D(C)}return};Mapifies.AddMarker=function(D,C,G){function E(){var H={pointLatLng:undefined,pointHTML:undefined,pointOpenHTMLEvent:"click",pointIsDraggable:false,pointIsRemovable:false,pointRemoveEvent:"dblclick",pointMinZoom:4,pointMaxZoom:17,pointIcon:undefined,centerMap:false,centerMoveMethod:"normal"};return H}var F=Mapifies.MapObjects.Get(D);C=jQuery.extend({},E(),C);var B={};if(typeof C.pointIcon=="object"){jQuery.extend(B,{icon:C.pointIcon})}if(C.pointIsDraggable){jQuery.extend(B,{draggable:C.pointIsDraggable})}if(C.centerMap){switch(C.centerMoveMethod){case"normal":F.setCenter(new GLatLng(C.pointLatLng[0],C.pointLatLng[1]));break;case"pan":F.panTo(new GLatLng(C.pointLatLng[0],C.pointLatLng[1]));break}}var A=new GMarker(new GLatLng(C.pointLatLng[0],C.pointLatLng[1]),B);if(C.pointHTML){GEvent.addListener(A,C.pointOpenHTMLEvent,function(){A.openInfoWindowHtml(C.pointHTML,{maxContent:C.pointMaxContent,maxTitle:C.pointMaxTitle})})}if(C.pointIsRemovable){GEvent.addListener(A,C.pointRemoveEvent,function(){F.removeOverlay(A)})}if(F.MarkerManager){F.MarkerManager.addMarker(A,C.pointMinZoom,C.pointMaxZoom)}else{F.addOverlay(A)}if(typeof G=="function"){return G(A,C)}return};Mapifies.RemoveMarker=function(B,A,D){var C=Mapifies.MapObjects.Get(B);C.removeOverlay(A);if(typeof D==="function"){return D(A)}return};Mapifies.CreateMarkerManager=function(C,A,G){function D(){return{markerManager:"GMarkerManager",borderPadding:100,maxZoom:17,trackMarkers:false}}var F=Mapifies.MapObjects.Get(C);A=jQuery.extend(D(),A);var E={borderPadding:A.borderPadding,maxZoom:A.maxZoom,trackMarkers:A.trackMarkers};var B=new window[A.markerManager](F,A);Mapifies.MapObjects.Append(C,"MarkerManager",B);if(typeof G=="function"){return G(B,A)}};Mapifies.AddPolygon=function(E,C,H){function F(){return{polygonPoints:[],polygonStrokeColor:"#000000",polygonStrokeWeight:5,polygonStrokeOpacity:1,polygonFillColor:"#ff0000",polygonFillOpacity:1,mapCenter:undefined,polygonClickable:true}}var G=Mapifies.MapObjects.Get(E);C=jQuery.extend(F(),C);var A={};if(!C.polygonClickable){A=jQuery.extend(A,{clickable:false})}if(typeof C.mapCenter!=="undefined"&&C.mapCenter[0]&&C.mapCenter[1]){G.setCenter(new GLatLng(C.mapCenter[0],C.mapCenter[1]))}var B=[];jQuery.each(C.polygonPoints,function(J,I){B.push(new GLatLng(I[0],I[1]))});var D=new GPolygon(B,C.polygonStrokeColor,C.polygonStrokeWeight,C.polygonStrokeOpacity,C.polygonFillColor,C.polygonFillOpacity,A);G.addOverlay(D);if(typeof H=="function"){return H(D,A,C)}return};Mapifies.RemovePolygon=function(B,A,D){var C=Mapifies.MapObjects.Get(B);C.removeOverlay(A);if(typeof D==="function"){return D(A)}return};Mapifies.AddPolyline=function(D,C,H){function F(){return{polylinePoints:[],polylineStrokeColor:"#ff0000",polylineStrokeWidth:10,polylineStrokeOpacity:1,mapCenter:[],polylineGeodesic:false,polylineClickable:true}}var G=Mapifies.MapObjects.Get(D);C=jQuery.extend(F(),C);var E={};if(C.polylineGeodesic){jQuery.extend(E,{geodesic:true})}if(!C.polylineClickable){jQuery.extend(E,{clickable:false})}if(C.mapCenter[0]&&C.mapCenter[1]){G.setCenter(new GLatLng(C.mapCenter[0],C.mapCenter[1]))}var B=[];jQuery.each(C.polylinePoints,function(J,I){B.push(new GLatLng(I[0],I[1]))});var A=new GPolyline(B,C.polylineStrokeColor,C.polylineStrokeWidth,C.polylineStrokeOpacity,E);G.addOverlay(A);if(typeof H=="function"){return H(A,E,C)}return};Mapifies.RemovePolyline=function(B,A,D){var C=Mapifies.MapObjects.Get(B);C.removeOverlay(A);if(typeof D==="function"){return D(A)}return};Mapifies.AddScreenOverlay=function(C,B,F){function D(){return{imageUrl:"",screenXY:[],overlayXY:[],size:[]}}var E=Mapifies.MapObjects.Get(C);B=jQuery.extend(D(),B);var A=new GScreenOverlay(B.imageUrl,new GScreenPoint(B.screenXY[0],B.screenXY[1]),new GScreenPoint(B.overlayXY[0],B.overlayXY[1]),new GScreenSize(B.size[0],B.size[1]));E.addOverlay(A);if(typeof F=="function"){return F(A,B)}};Mapifies.RemoveScreenOverlay=function(B,A,D){var C=Mapifies.MapObjects.Get(B);C.removeOverlay(A);if(typeof D==="function"){return D(A)}return};Mapifies.CreateStreetviewPanorama=function(E,D,H){function F(){return{overideContainer:"",latlng:[40.75271883902363,-73.98262023925781],pov:[]}}var G=Mapifies.MapObjects.Get(E);D=jQuery.extend(F(),D);var A=null;if(D.overideContainer!==""){A=jQuery(D.overideContainer).get(0)}else{A=jQuery(E).get(0)}var B={};if(D.pov.length>0){jQuery.extend(B,{pov:new GPov(D.latlng[0],D.latlng[1],D.latlng[2])})}if(D.latlng.length>0){jQuery.extend(B,{latlng:new GLatLng(D.latlng[0],D.latlng[1])})}var C=new GStreetviewPanorama(A,B);if(typeof H=="function"){return H(C,D)}return};Mapifies.RemoveStreetviewPanorama=function(B,A,D){var C=Mapifies.MapObjects.Get(B);A.remove();if(typeof D=="function"){return D(A)}return};Mapifies.AddTrafficInfo=function(B,A,F){function D(){return{mapCenter:[]}}var E=Mapifies.MapObjects.Get(B);A=jQuery.extend(D(),A);var C=new GTrafficOverlay;E.addOverlay(C);if(A.mapCenter[0]&&A.mapCenter[1]){E.setCenter(new GLatLng(A.mapCenter[0],A.mapCenter[1]))}if(typeof F=="function"){return F(C,A)}};Mapifies.RemoveTrafficInfo=function(A,B,D){var C=Mapifies.MapObjects.Get(A);C.removeOverlay(B);if(typeof D==="function"){return D(B)}return};Mapifies.SearchCode=function(A){switch(A){case G_GEO_SUCCESS:return{code:G_GEO_SUCCESS,success:true,message:"Success"};case G_GEO_UNKNOWN_ADDRESS:return{code:G_GEO_UNKNOWN_ADDRESS,success:false,message:"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"};break;case G_GEO_SERVER_ERROR:return{code:G_GEO_UNKNOWN_ADDRESS,success:false,message:"A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known."};break;case G_GEO_MISSING_QUERY:return{code:G_GEO_UNKNOWN_ADDRESS,success:false,message:"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."};break;case G_GEO_BAD_KEY:return{code:G_GEO_UNKNOWN_ADDRESS,success:false,message:"The given key is either invalid or does not match the domain for which it was given."};break;case G_GEO_BAD_REQUEST:return{code:G_GEO_UNKNOWN_ADDRESS,success:false,message:"A directions request could not be successfully parsed."};break;default:return{code:null,success:false,message:"An unknown error occurred."};break}};Mapifies.GetMapType=function(A){switch(A){case"map":A=G_NORMAL_MAP;break;case"sat":A=G_SATELLITE_MAP;break;case"hybrid":A=G_HYBRID_MAP;break}return A};Mapifies.GetTravelMode=function(A){switch(A){case"driving":A=G_TRAVEL_MODE_DRIVING;break;case"walking":A=G_TRAVEL_MODE_WALKING;break}return A};Mapifies.createIcon=function(A){function C(){return{iconImage:undefined,iconShadow:undefined,iconSize:undefined,iconShadowSize:undefined,iconAnchor:undefined,iconInfoWindowAnchor:undefined,iconPrintImage:undefined,iconMozPrintImage:undefined,iconPrintShadow:undefined,iconTransparent:undefined}}A=jQuery.extend(C(),A);var B=new GIcon(G_DEFAULT_ICON);if(A.iconImage){B.image=A.iconImage}if(A.iconShadow){B.shadow=A.iconShadow}if(A.iconSize){B.iconSize=A.iconSize}if(A.iconShadowSize){B.shadowSize=A.iconShadowSize}if(A.iconAnchor){B.iconAnchor=A.iconAnchor}if(A.iconInfoWindowAnchor){B.infoWindowAnchor=A.iconInfoWindowAnchor}return B};Mapifies.getCenter=function(A){var B=Mapifies.MapObjects.Get(A);return B.getCenter()};Mapifies.getBounds=function(A){var B=Mapifies.MapObjects.Get(A);return B.getBounds()};var Mapifies;if(!Mapifies){Mapifies={}}(function(A){A.fn.jmap=function(D,B,C){return this.each(function(){if(D=="init"&&typeof B=="undefined"){new Mapifies.Initialise(this,{},null)}else{if(D=="init"&&typeof B=="object"){new Mapifies.Initialise(this,B,C)}else{if(D=="init"&&typeof B=="function"){new Mapifies.Initialise(this,{},B)}else{if(typeof D=="object"||D==null){new Mapifies.Initialise(this,D,B)}else{try{new Mapifies[D](this,B,C)}catch(E){throw Error("Mapifies Function Does Not Exist")}}}}}})}})(jQuery);
