
Christmas_url = 'http://www.olcso.hu/korosztaly/';
GetSites_url = 'http://www.olcso.hu/Ajax/Getsites';
GetCategory_url = 'http://www.olcso.hu/Ajax/Getcategory';
GetCategoryTree_url = 'http://www.olcso.hu/Ajax/Getcategorytree';
GetCatalog_url = 'http://www.olcso.hu/Ajax/Getcatalog';
GetCatalogs_url = 'http://www.olcso.hu/Ajax/Getcatalogs';
ModifyCategory_url = 'http://www.olcso.hu/Ajax/Modifycategory';
AddCatalog_url = 'http://www.olcso.hu/Catalog/Add';




UserEdit_url = 'http://www.olcso.hu/User/Customers';
Setliststyle_url = 'http://www.olcso.hu/Ajax/Setliststyle';
Setfooterstate_url = 'http://www.olcso.hu/Ajax/Setfooterstate';
ChristmasList_url = 'http://www.olcso.hu/User/Info/open/0';
UserLogin_url = 'http://www.olcso.hu/Main/Login';

Getdictionary_url = 'http://www.olcso.hu/Ajax/Getdictionary';
Advisorzip_url = 'http://www.olcso.hu/Ajax/Advisorzip';
GetZipCode_url = 'http://www.olcso.hu/Ajax/Searchzipcode';

saveUserData_url	= 'http://www.olcso.hu/Ajax/Saveuser';
Getsenderinfo_url	= 'http://www.olcso.hu/Ajax/Getsenderinfo';
Getshippingprice_url	= 'http://www.olcso.hu/Ajax/Getshippingprice';


Saveusernewslettermail_url	= 'http://www.olcso.hu/Ajax/Saveusernewslettermail';

VoucherItem_url 	= 'http://www.olcso.hu//Ajax/Getvoucheriteminfo'; 
List_url = 'http://www.olcso.hu//Ajax/Searchuser';
ListVoucherItemType_url  = 'http://www.olcso.hu//Ajax/Searchvoucheritemtype';
ListVoucher_url  = 'http://www.olcso.hu//Ajax/Searchvoucher';
FormSelector_url  = 'http://www.olcso.hu//Client/Formselector';
SearchUser_url = 'http://www.olcso.hu/Ajax/Searchuser';
SearchRealUser_url = 'http://www.olcso.hu/Ajax/Searchrealuser';
GetUserInfo_url = 'http://www.olcso.hu//Ajax/Getuserinfo';
CostumerInfo_url = 'http://www.olcso.hu//Ajax/GetVoucherCostumerInfo';
VoucherKontir_url = 'http://www.olcso.hu//Ajax/Runkontir';
GetKontirVoucherInfo_url = 'http://www.olcso.hu//Ajax/GetKontirInfo';
GetBookkeepingList_url = 'http://www.olcso.hu//Ajax/GetBookkeepingList';
GetExplanationInfo_url = 'http://www.olcso.hu//Ajax/Explanation';
VoucherExtend_url = 'http://www.olcso.hu//Ajax/Runexplanation';
TransactionMenu_url = 'http://www.olcso.hu//Transaction/Menu';
ListTransaction_url = 'http://www.olcso.hu//Ajax/Searchtransaction';
ListObject_url = 'http://www.olcso.hu//Ajax/Searchobject';
setOfferActive_url = 'http://www.olcso.hu//Ajax/Setofferactive';
GetKontirInfo_url = 'http://www.olcso.hu//Ajax/Getkontirinfotoredemption';
RedemptionKontir_url = 'http://www.olcso.hu//Ajax/Runkontirredemption';
Getauthpages_url = 'http://www.olcso.hu/Ajax/Getauthpages';
Authgrouppage_url = 'http://www.olcso.hu/Ajax/Authgrouppage';
Authusergroup_url = 'http://www.olcso.hu/Ajax/Authusergroup';
OtherCustomer_url = 'http://www.olcso.hu/Ajax/Othercustometlist';
Freeapplication_url = 'http://www.olcso.hu/Ajax/Freeapplication';

Observer_url = 'http://www.olcso.hu/Ajax/Observer';
ObserverDelete_url = 'http://www.olcso.hu/Ajax/Observerdel';
Favouriteitems_url = 'http://www.olcso.hu/Ajax/Favouriteitems';
Favouriteslide_url = 'http://www.olcso.hu/Main/Favorite';
FavouriteitemsDelete_url = 'http://www.olcso.hu/Ajax/Favouriteitemsdel';
UserInfo_url = 'http://www.olcso.hu/Ajax/Getuserinfo';

CatalogMod_url = 'http://www.olcso.hu/Ajax/Setcatalogdone';

Setsitesession_url = 'http://www.olcso.hu/Ajax/Setsitesession';

CategorySelects_url = 'http://www.olcso.hu/Ajax/Getcategoryselects';

saveFacebookLike_url = 'http://www.olcso.hu/Ajax/Facebooklike';
saveFacebookLikeItem_url = 'http://www.olcso.hu/Ajax/Facebooklikeitem';

PublicFavList_url = 'http://www.olcso.hu/Ajax/Publicfavouritelist';

Teamlist_url = 'http://www.olcso.hu/Ajax/Teamlist';
Teamadd_url = 'http://www.olcso.hu/Ajax/Teamadd';
Teamdel_url = 'http://www.olcso.hu/Ajax/Teamdel';
NewObject_url= 'http://www.olcso.hu/Object/Base';
WEB_IMG_DIR = 'http://www.olcso.hu//public/imgs/';
WEB_DIR = 'http://www.olcso.hu/';
ModPg_url 			= 'http://www.olcso.hu//Gallery/Modifypicture';
Gallery_url 		= 'http://www.olcso.hu//Gallery/Main';
GetPic_url 			= 'http://www.olcso.hu//Gallery/Ajaxgallery';
DelPg_url 			= 'http://www.olcso.hu//Gallery/Deletepicture';
SearchUser_url 			= 'http://www.olcso.hu//Ajax/SearchUser';


ModArticle_url 			= 'http://www.olcso.hu//Ajax/Modifyarticle';
ModCampaign_url 			= 'http://www.olcso.hu//Ajax/Modifycampaign';
ModAdvert_url 			= 'http://www.olcso.hu//Ajax/Modifyadvert';

Checkshop_url 			= 'http://www.olcso.hu//Ajax/Checkshop';
Rate_url 			= 'http://www.olcso.hu//Ajax/Ratearticle';

DelPic_url = 'http://www.olcso.hu/Picture/Deletepicture';
GetVehiclePic_url = 'http://www.olcso.hu/Picture/Ajaxgallery';

/*!
 * jQuery JavaScript Library v1.4
 * http://jquery.com/
 *
 * Copyright 2010, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://docs.jquery.com/License
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2010, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: Wed Jan 13 15:23:05 2010 -0500
 */
(function(A,w){function oa(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(oa,1);return}c.ready()}}function La(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function $(a,b,d,f,e,i){var j=a.length;if(typeof b==="object"){for(var o in b)$(a,o,b[o],f,e,d);return a}if(d!==w){f=!i&&f&&c.isFunction(d);for(o=0;o<j;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,i);return a}return j?
e(a[0],b):null}function K(){return(new Date).getTime()}function aa(){return false}function ba(){return true}function pa(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function qa(a){var b=true,d=[],f=[],e=arguments,i,j,o,p,n,t=c.extend({},c.data(this,"events").live);for(p in t){j=t[p];if(j.live===a.type||j.altLive&&c.inArray(a.type,j.altLive)>-1){i=j.data;i.beforeFilter&&i.beforeFilter[a.type]&&!i.beforeFilter[a.type](a)||f.push(j.selector)}else delete t[p]}i=c(a.target).closest(f,a.currentTarget);
n=0;for(l=i.length;n<l;n++)for(p in t){j=t[p];o=i[n].elem;f=null;if(i[n].selector===j.selector){if(j.live==="mouseenter"||j.live==="mouseleave")f=c(a.relatedTarget).closest(j.selector)[0];if(!f||f!==o)d.push({elem:o,fn:j})}}n=0;for(l=d.length;n<l;n++){i=d[n];a.currentTarget=i.elem;a.data=i.fn.data;if(i.fn.apply(i.elem,e)===false){b=false;break}}return b}function ra(a,b){return["live",a,b.replace(/\./g,"`").replace(/ /g,"&")].join(".")}function sa(a){return!a||!a.parentNode||a.parentNode.nodeType===
11}function ta(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var i in f)for(var j in f[i])c.event.add(this,i,f[i][j],f[i][j].data)}}})}function ua(a,b,d){var f,e,i;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&a[0].indexOf("<option")<0){e=true;if(i=c.fragments[a[0]])if(i!==1)f=i}if(!f){b=b&&b[0]?b[0].ownerDocument||b[0]:s;f=b.createDocumentFragment();c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=
i?f:1;return{fragment:f,cacheable:e}}function T(a){for(var b=0,d,f;(d=a[b])!=null;b++)if(!c.noData[d.nodeName.toLowerCase()]&&(f=d[H]))delete c.cache[f]}function L(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a});return d}function wa(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Ma=A.jQuery,Na=A.$,s=A.document,U,Oa=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Pa=/^.[^:#\[\.,]*$/,Qa=/\S/,
Ra=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Sa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],M,ca=Object.prototype.toString,da=Object.prototype.hasOwnProperty,ea=Array.prototype.push,R=Array.prototype.slice,V=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(typeof a==="string")if((d=Oa.exec(a))&&(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Sa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];
c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=ua([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return U.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a)}else return!b||b.jquery?(b||U).find(a):c(b).find(a);else if(c.isFunction(a))return U.ready(a);if(a.selector!==w){this.selector=a.selector;
this.context=a.context}return c.isArray(a)?this.setArray(a):c.makeArray(a,this)},selector:"",jquery:"1.4",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){a=c(a||null);a.prevObject=this;a.context=this.context;if(b==="find")a.selector=this.selector+(this.selector?" ":"")+d;else if(b)a.selector=this.selector+"."+b+"("+d+")";return a},setArray:function(a){this.length=
0;ea.apply(this,a);return this},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||
c(null)},push:ea,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,i,j,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(i in e){j=a[i];o=e[i];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){j=j&&(c.isPlainObject(j)||c.isArray(j))?j:c.isArray(o)?[]:{};a[i]=c.extend(f,j,o)}else if(o!==w)a[i]=
o}return a};c.extend({noConflict:function(a){A.$=Na;if(a)A.jQuery=Ma;return c},isReady:false,ready:function(){if(!c.isReady){if(!s.body)return setTimeout(c.ready,13);c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];)a.call(s,c);Q=null}c.fn.triggerHandler&&c(s).triggerHandler("ready")}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete")return c.ready();if(s.addEventListener){s.addEventListener("DOMContentLoaded",M,false);A.addEventListener("load",c.ready,false)}else if(s.attachEvent){s.attachEvent("onreadystatechange",
M);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null}catch(b){}s.documentElement.doScroll&&a&&oa()}}},isFunction:function(a){return ca.call(a)==="[object Function]"},isArray:function(a){return ca.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||ca.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!da.call(a,"constructor")&&!da.call(a.constructor.prototype,"isPrototypeOf"))return false;var b;for(b in a);return b===w||da.call(a,b)},
isEmptyObject:function(a){for(var b in a)return false;return true},noop:function(){},globalEval:function(a){if(a&&Qa.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,i=a.length,j=i===w||c.isFunction(a);
if(d)if(j)for(f in a){if(b.apply(a[f],d)===false)break}else for(;e<i;){if(b.apply(a[e++],d)===false)break}else if(j)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];e<i&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Ra,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ea.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=
0,f=b.length;d<f;d++)if(b[d]===a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,i=a.length;e<i;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,i=0,j=a.length;i<j;i++){e=b(a[i],i,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b===
"string"){d=a;a=d[b];b=w}else if(b&&!c.isFunction(b)){d=b;b=w}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){var b={browser:""};a=a.toLowerCase();if(/webkit/.test(a))b={browser:"webkit",version:/webkit[\/ ]([\w.]+)/};else if(/opera/.test(a))b={browser:"opera",version:/version/.test(a)?/version[\/ ]([\w.]+)/:/opera[\/ ]([\w.]+)/};else if(/msie/.test(a))b={browser:"msie",version:/msie ([\w.]+)/};else if(/mozilla/.test(a)&&
!/compatible/.test(a))b={browser:"mozilla",version:/rv:([\w.]+)/};b.version=(b.version&&b.version.exec(a)||[0,"0"])[1];return b},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version}if(c.browser.webkit)c.browser.safari=true;if(V)c.inArray=function(a,b){return V.call(b,a)};U=c(s);if(s.addEventListener)M=function(){s.removeEventListener("DOMContentLoaded",M,false);c.ready()};else if(s.attachEvent)M=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",
M);c.ready()}};if(V)c.inArray=function(a,b){return V.call(b,a)};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+K();d.style.display="none";d.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var e=d.getElementsByTagName("*"),i=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!i)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,
htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(i.getAttribute("style")),hrefNormalized:i.getAttribute("href")==="/a",opacity:/^0.55$/.test(i.style.opacity),cssFloat:!!i.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(j){}a.insertBefore(b,
a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function o(){c.support.noCloneEvent=false;d.detachEvent("onclick",o)});d.cloneNode(true).fireEvent("onclick")}c(function(){var o=s.createElement("div");o.style.width=o.style.paddingLeft="1px";s.body.appendChild(o);c.boxModel=c.support.boxModel=o.offsetWidth===2;s.body.removeChild(o).style.display="none"});a=function(o){var p=s.createElement("div");o="on"+o;var n=o in
p;if(!n){p.setAttribute(o,"return;");n=typeof p[o]==="function"}return n};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=i=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var H="jQuery"+K(),Ta=0,ya={},Ua={};c.extend({cache:{},expando:H,noData:{embed:true,object:true,applet:true},data:function(a,
b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?ya:a;var f=a[H],e=c.cache;if(!b&&!f)return null;f||(f=++Ta);if(typeof b==="object"){a[H]=f;e=e[f]=c.extend(true,{},b)}else e=e[f]?e[f]:typeof d==="undefined"?Ua:(e[f]={});if(d!==w){a[H]=f;e[b]=d}return typeof b==="string"?e[b]:e}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?ya:a;var d=a[H],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{try{delete a[H]}catch(i){a.removeAttribute&&
a.removeAttribute(H)}delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,
a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,
a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var za=/[\n\t]/g,fa=/\s+/,Va=/\r/g,Wa=/href|src|style/,Xa=/(button|input)/i,Ya=/(button|input|object|select|textarea)/i,Za=/^(a|area)$/i,Aa=/radio|checkbox/;c.fn.extend({attr:function(a,
b){return $(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(p){var n=c(this);n.addClass(a.call(this,p,n.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(fa),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className)for(var i=" "+e.className+" ",j=0,o=b.length;j<o;j++){if(i.indexOf(" "+b[j]+" ")<0)e.className+=
" "+b[j]}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(p){var n=c(this);n.removeClass(a.call(this,p,n.attr("class")))});if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(fa),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var i=(" "+e.className+" ").replace(za," "),j=0,o=b.length;j<o;j++)i=i.replace(" "+b[j]+" "," ");e.className=i.substring(1,i.length-1)}else e.className=""}return this},toggleClass:function(a,
b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var i=c(this);i.toggleClass(a.call(this,e,i.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,i=0,j=c(this),o=b,p=a.split(fa);e=p[i++];){o=f?o:!j.hasClass(e);j[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=
" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(za," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var i=b?d:0;for(d=b?d+1:e.length;i<d;i++){var j=e[i];if(j.selected){a=c(j).val();if(b)return a;f.push(a)}}return f}if(Aa.test(b.type)&&
!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Va,"")}return w}var o=c.isFunction(a);return this.each(function(p){var n=c(this),t=a;if(this.nodeType===1){if(o)t=a.call(this,p,n.val());if(typeof t==="number")t+="";if(c.isArray(t)&&Aa.test(this.type))this.checked=c.inArray(n.val(),t)>=0;else if(c.nodeName(this,"select")){var z=c.makeArray(t);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),z)>=0});if(!z.length)this.selectedIndex=
-1}else this.value=t}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var i=Wa.test(b);if(b in a&&f&&!i){if(e){if(b==="type"&&Xa.test(a.nodeName)&&a.parentNode)throw"type property can't be changed";a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;
if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:Ya.test(a.nodeName)||Za.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&i?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var $a=function(a){return a.replace(/[^\w\s\.\|`]/g,function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===
3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;if(!d.guid)d.guid=c.guid++;if(f!==w){d=c.proxy(d);d.data=f}var e=c.data(a,"events")||c.data(a,"events",{}),i=c.data(a,"handle"),j;if(!i){j=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(j.elem,arguments):w};i=c.data(a,"handle",j)}if(i){i.elem=a;b=b.split(/\s+/);for(var o,p=0;o=b[p++];){var n=o.split(".");o=n.shift();d.type=n.slice(0).sort().join(".");var t=e[o],z=this.special[o]||{};if(!t){t=e[o]={};
if(!z.setup||z.setup.call(a,f,n,d)===false)if(a.addEventListener)a.addEventListener(o,i,false);else a.attachEvent&&a.attachEvent("on"+o,i)}if(z.add)if((n=z.add.call(a,d,f,n,t))&&c.isFunction(n)){n.guid=n.guid||d.guid;d=n}t[d.guid]=d;this.global[o]=true}a=null}}},global:{},remove:function(a,b,d){if(!(a.nodeType===3||a.nodeType===8)){var f=c.data(a,"events"),e,i,j;if(f){if(b===w||typeof b==="string"&&b.charAt(0)===".")for(i in f)this.remove(a,i+(b||""));else{if(b.type){d=b.handler;b=b.type}b=b.split(/\s+/);
for(var o=0;i=b[o++];){var p=i.split(".");i=p.shift();var n=!p.length,t=c.map(p.slice(0).sort(),$a);t=new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.)?")+"(\\.|$)");var z=this.special[i]||{};if(f[i]){if(d){j=f[i][d.guid];delete f[i][d.guid]}else for(var B in f[i])if(n||t.test(f[i][B].type))delete f[i][B];z.remove&&z.remove.call(a,p,j);for(e in f[i])break;if(!e){if(!z.teardown||z.teardown.call(a,p)===false)if(a.removeEventListener)a.removeEventListener(i,c.data(a,"handle"),false);else a.detachEvent&&a.detachEvent("on"+
i,c.data(a,"handle"));e=null;delete f[i]}}}}for(e in f)break;if(!e){if(B=c.data(a,"handle"))B.elem=null;c.removeData(a,"events");c.removeData(a,"handle")}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[H]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type=e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();this.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===
8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;var i=c.data(d,"handle");i&&i.apply(d,b);var j,o;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()])){j=d[e];o=d["on"+e]}}catch(p){}i=c.nodeName(d,"a")&&e==="click";if(!f&&j&&!a.isDefaultPrevented()&&!i){this.triggered=true;try{d[e]()}catch(n){}}else if(o&&d["on"+e].apply(d,b)===false)a.result=false;this.triggered=false;if(!a.isPropagationStopped())(d=d.parentNode||d.ownerDocument)&&c.event.trigger(a,b,d,true)},
handle:function(a){var b,d;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;d=a.type.split(".");a.type=d.shift();b=!d.length&&!a.exclusive;var f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)");d=(c.data(this,"events")||{})[a.type];for(var e in d){var i=d[e];if(b||f.test(i.type)){a.handler=i;a.data=i.data;i=i.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}return a.result},
props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[H])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||
s;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&
a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a,b){c.extend(a,b||{});a.guid+=b.selector+b.live;c.event.add(this,b.live,qa,b)},remove:function(a){if(a.length){var b=0,d=new RegExp("(^|\\.)"+a[0]+"(\\.|$)");c.each(c.data(this,"events").live||{},function(){d.test(this.type)&&b++});b<1&&c.event.remove(this,a[0],qa)}},special:{}},beforeunload:{setup:function(a,
b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp=K();this[H]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=ba;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=
ba;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=ba;this.stopPropagation()},isDefaultPrevented:aa,isPropagationStopped:aa,isImmediatePropagationStopped:aa};var Ba=function(a){for(var b=a.relatedTarget;b&&b!==this;)try{b=b.parentNode}catch(d){break}if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}},Ca=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",
mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ca:Ba,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ca:Ba)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(a,b,d){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit."+d.guid,function(f){var e=f.target,i=e.type;if((i==="submit"||i==="image")&&c(e).closest("form").length)return pa("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit."+
d.guid,function(f){var e=f.target,i=e.type;if((i==="text"||i==="password")&&c(e).closest("form").length&&f.keyCode===13)return pa("submit",this,arguments)})}else return false},remove:function(a,b){c.event.remove(this,"click.specialSubmit"+(b?"."+b.guid:""));c.event.remove(this,"keypress.specialSubmit"+(b?"."+b.guid:""))}};if(!c.support.changeBubbles){var ga=/textarea|input|select/i;function Da(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>
-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d}function ha(a,b){var d=a.target,f,e;if(!(!ga.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Da(d);if(e!==f){if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",e);if(d.type!=="select"&&(f!=null||e)){a.type="change";return c.event.trigger(a,b,this)}}}}c.event.special.change={filters:{focusout:ha,click:function(a){var b=a.target,d=b.type;if(d===
"radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return ha.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return ha.call(this,a)},beforeactivate:function(a){a=a.target;a.nodeName.toLowerCase()==="input"&&a.type==="radio"&&c.data(a,"_change_data",Da(a))}},setup:function(a,b,d){for(var f in W)c.event.add(this,f+".specialChange."+d.guid,W[f]);return ga.test(this.nodeName)},
remove:function(a,b){for(var d in W)c.event.remove(this,d+".specialChange"+(b?"."+b.guid:""),W[d]);return ga.test(this.nodeName)}};var W=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a,d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,
f,e){if(typeof d==="object"){for(var i in d)this[b](i,f,d[i],e);return this}if(c.isFunction(f)){thisObject=e;e=f;f=w}var j=b==="one"?c.proxy(e,function(o){c(this).unbind(o,j);return e.apply(this,arguments)}):e;return d==="unload"&&b!=="one"?this.one(d,f,e,thisObject):this.each(function(){c.event.add(this,d,j,f)})}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&!a.preventDefault){for(var d in a)this.unbind(d,a[d]);return this}return this.each(function(){c.event.remove(this,a,b)})},trigger:function(a,
b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}},toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||
a)},live:function(a,b,d){if(c.isFunction(b)){d=b;b=w}c(this.context).bind(ra(a,this.selector),{data:b,selector:this.selector,live:a},d);return this},die:function(a,b){c(this.context).unbind(ra(a,this.selector),b?{guid:b.guid+this.selector+a}:null);return this}});c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){c.fn[b]=function(d){return d?
this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",k,m=0;g[m];m++){k=g[m];if(k.nodeType===3||k.nodeType===4)h+=k.nodeValue;else if(k.nodeType!==8)h+=a(k.childNodes)}return h}function b(g,h,k,m,r,q){r=0;for(var v=m.length;r<v;r++){var u=m[r];if(u){u=u[g];for(var y=false;u;){if(u.sizcache===
k){y=m[u.sizset];break}if(u.nodeType===1&&!q){u.sizcache=k;u.sizset=r}if(u.nodeName.toLowerCase()===h){y=u;break}u=u[g]}m[r]=y}}}function d(g,h,k,m,r,q){r=0;for(var v=m.length;r<v;r++){var u=m[r];if(u){u=u[g];for(var y=false;u;){if(u.sizcache===k){y=m[u.sizset];break}if(u.nodeType===1){if(!q){u.sizcache=k;u.sizset=r}if(typeof h!=="string"){if(u===h){y=true;break}}else if(p.filter(h,[u]).length>0){y=u;break}}u=u[g]}m[r]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
e=0,i=Object.prototype.toString,j=false,o=true;[0,0].sort(function(){o=false;return 0});var p=function(g,h,k,m){k=k||[];var r=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return k;for(var q=[],v,u,y,S,I=true,N=x(h),J=g;(f.exec(""),v=f.exec(J))!==null;){J=v[3];q.push(v[1]);if(v[2]){S=v[3];break}}if(q.length>1&&t.exec(g))if(q.length===2&&n.relative[q[0]])u=ia(q[0]+q[1],h);else for(u=n.relative[q[0]]?[h]:p(q.shift(),h);q.length;){g=q.shift();if(n.relative[g])g+=q.shift();
u=ia(g,u)}else{if(!m&&q.length>1&&h.nodeType===9&&!N&&n.match.ID.test(q[0])&&!n.match.ID.test(q[q.length-1])){v=p.find(q.shift(),h,N);h=v.expr?p.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:q.pop(),set:B(m)}:p.find(q.pop(),q.length===1&&(q[0]==="~"||q[0]==="+")&&h.parentNode?h.parentNode:h,N);u=v.expr?p.filter(v.expr,v.set):v.set;if(q.length>0)y=B(u);else I=false;for(;q.length;){var E=q.pop();v=E;if(n.relative[E])v=q.pop();else E="";if(v==null)v=h;n.relative[E](y,v,N)}}else y=[]}y||(y=u);if(!y)throw"Syntax error, unrecognized expression: "+
(E||g);if(i.call(y)==="[object Array]")if(I)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&F(h,y[g])))k.push(u[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&k.push(u[g]);else k.push.apply(k,y);else B(y,k);if(S){p(S,r,k,m);p.uniqueSort(k)}return k};p.uniqueSort=function(g){if(D){j=o;g.sort(D);if(j)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};p.matches=function(g,h){return p(g,null,null,h)};p.find=function(g,h,k){var m,r;if(!g)return[];
for(var q=0,v=n.order.length;q<v;q++){var u=n.order[q];if(r=n.leftMatch[u].exec(g)){var y=r[1];r.splice(1,1);if(y.substr(y.length-1)!=="\\"){r[1]=(r[1]||"").replace(/\\/g,"");m=n.find[u](r,h,k);if(m!=null){g=g.replace(n.match[u],"");break}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g}};p.filter=function(g,h,k,m){for(var r=g,q=[],v=h,u,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var I in n.filter)if((u=n.leftMatch[I].exec(g))!=null&&u[2]){var N=n.filter[I],J,E;E=u[1];y=false;u.splice(1,1);if(E.substr(E.length-
1)!=="\\"){if(v===q)q=[];if(n.preFilter[I])if(u=n.preFilter[I](u,v,k,q,m,S)){if(u===true)continue}else y=J=true;if(u)for(var X=0;(E=v[X])!=null;X++)if(E){J=N(E,u,X,v);var Ea=m^!!J;if(k&&J!=null)if(Ea)y=true;else v[X]=false;else if(Ea){q.push(E);y=true}}if(J!==w){k||(v=q);g=g.replace(n.match[I],"");if(!y)return[];break}}}if(g===r)if(y==null)throw"Syntax error, unrecognized expression: "+g;else break;r=g}return v};var n=p.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},
relative:{"+":function(g,h){var k=typeof h==="string",m=k&&!/\W/.test(h);k=k&&!m;if(m)h=h.toLowerCase();m=0;for(var r=g.length,q;m<r;m++)if(q=g[m]){for(;(q=q.previousSibling)&&q.nodeType!==1;);g[m]=k||q&&q.nodeName.toLowerCase()===h?q||false:q===h}k&&p.filter(h,g,true)},">":function(g,h){var k=typeof h==="string";if(k&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,r=g.length;m<r;m++){var q=g[m];if(q){k=q.parentNode;g[m]=k.nodeName.toLowerCase()===h?k:false}}}else{m=0;for(r=g.length;m<r;m++)if(q=g[m])g[m]=
k?q.parentNode:q.parentNode===h;k&&p.filter(h,g,true)}},"":function(g,h,k){var m=e++,r=d;if(typeof h==="string"&&!/\W/.test(h)){var q=h=h.toLowerCase();r=b}r("parentNode",h,m,g,q,k)},"~":function(g,h,k){var m=e++,r=d;if(typeof h==="string"&&!/\W/.test(h)){var q=h=h.toLowerCase();r=b}r("previousSibling",h,m,g,q,k)}},find:{ID:function(g,h,k){if(typeof h.getElementById!=="undefined"&&!k)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var k=[];
h=h.getElementsByName(g[1]);for(var m=0,r=h.length;m<r;m++)h[m].getAttribute("name")===g[1]&&k.push(h[m]);return k.length===0?null:k}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,k,m,r,q){g=" "+g[1].replace(/\\/g,"")+" ";if(q)return g;q=0;for(var v;(v=h[q])!=null;q++)if(v)if(r^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))k||m.push(v);else if(k)h[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},
CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,k,m,r,q){h=g[1].replace(/\\/g,"");if(!q&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,k,m,r){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=p(g[3],null,null,h);else{g=p.filter(g[3],h,k,true^r);k||m.push.apply(m,
g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,k){return!!p(k[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},
text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},
setFilters:{first:function(g,h){return h===0},last:function(g,h,k,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,k){return h<k[3]-0},gt:function(g,h,k){return h>k[3]-0},nth:function(g,h,k){return k[3]-0===h},eq:function(g,h,k){return k[3]-0===h}},filter:{PSEUDO:function(g,h,k,m){var r=h[1],q=n.filters[r];if(q)return q(g,k,h,m);else if(r==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(r==="not"){h=
h[3];k=0;for(m=h.length;k<m;k++)if(h[k]===g)return false;return true}else throw"Syntax error, unrecognized expression: "+r;},CHILD:function(g,h){var k=h[1],m=g;switch(k){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(k==="first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":k=h[2];var r=h[3];if(k===1&&r===0)return true;h=h[0];var q=g.parentNode;if(q&&(q.sizcache!==h||!g.nodeIndex)){var v=0;for(m=q.firstChild;m;m=
m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;q.sizcache=h}g=g.nodeIndex-r;return k===0?g===0:g%k===0&&g/k>=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var k=h[1];g=n.attrHandle[k]?n.attrHandle[k](g):g[k]!=null?g[k]:g.getAttribute(k);k=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m===
"="?k===h:m==="*="?k.indexOf(h)>=0:m==="~="?(" "+k+" ").indexOf(h)>=0:!h?k&&g!==false:m==="!="?k!==h:m==="^="?k.indexOf(h)===0:m==="$="?k.substr(k.length-h.length)===h:m==="|="?k===h||k.substr(0,h.length+1)===h+"-":false},POS:function(g,h,k,m){var r=n.setFilters[h[2]];if(r)return r(g,k,h,m)}}},t=n.match.POS;for(var z in n.match){n.match[z]=new RegExp(n.match[z].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[z]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[z].source.replace(/\\(\d+)/g,function(g,
h){return"\\"+(h-0+1)}))}var B=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){B=function(g,h){h=h||[];if(i.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var k=0,m=g.length;k<m;k++)h.push(g[k]);else for(k=0;g[k];k++)h.push(g[k]);return h}}var D;if(s.documentElement.compareDocumentPosition)D=function(g,h){if(!g.compareDocumentPosition||
!h.compareDocumentPosition){if(g==h)j=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0)j=true;return g};else if("sourceIndex"in s.documentElement)D=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)j=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)j=true;return g};else if(s.createRange)D=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)j=true;return g.ownerDocument?-1:1}var k=g.ownerDocument.createRange(),m=
h.ownerDocument.createRange();k.setStart(g,0);k.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=k.compareBoundaryPoints(Range.START_TO_END,m);if(g===0)j=true;return g};(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var k=s.documentElement;k.insertBefore(g,k.firstChild);if(s.getElementById(h)){n.find.ID=function(m,r,q){if(typeof r.getElementById!=="undefined"&&!q)return(r=r.getElementById(m[1]))?r.id===m[1]||typeof r.getAttributeNode!=="undefined"&&
r.getAttributeNode("id").nodeValue===m[1]?[r]:w:[]};n.filter.ID=function(m,r){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===r}}k.removeChild(g);k=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,k){k=k.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;k[m];m++)k[m].nodeType===1&&h.push(k[m]);k=h}return k};g.innerHTML="<a href='#'></a>";
if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=p,h=s.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){p=function(m,r,q,v){r=r||s;if(!v&&r.nodeType===9&&!x(r))try{return B(r.querySelectorAll(m),q)}catch(u){}return g(m,r,q,v)};for(var k in g)p[k]=g[k];h=null}}();
(function(){var g=s.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,k,m){if(typeof k.getElementsByClassName!=="undefined"&&!m)return k.getElementsByClassName(h[1])};g=null}}})();var F=s.compareDocumentPosition?function(g,h){return g.compareDocumentPosition(h)&16}:function(g,
h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ia=function(g,h){var k=[],m="",r;for(h=h.nodeType?[h]:h;r=n.match.PSEUDO.exec(g);){m+=r[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;r=0;for(var q=h.length;r<q;r++)p(g,h[r],k);return p.filter(m,k)};c.find=p;c.expr=p.selectors;c.expr[":"]=c.expr.filters;c.unique=p.uniqueSort;c.getText=a;c.isXMLDoc=x;c.contains=F})();var ab=/Until$/,bb=/^(?:parents|prevUntil|prevAll)/,
cb=/,/;R=Array.prototype.slice;var Fa=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,i){return!!b.call(e,i,e)===d});else if(b.nodeType)return c.grep(a,function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Pa.test(b))return c.filter(b,f,!d);else b=c.filter(b,a)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length;
c.find(a,this[f],b);if(f>0)for(var i=d;i<b.length;i++)for(var j=0;j<d;j++)if(b[j]===b[i]){b.splice(i--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Fa(this,a,false),"not",a)},filter:function(a){return this.pushStack(Fa(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,i=
{},j;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){j=a[e];i[j]||(i[j]=c.expr.match.POS.test(j)?c(j,b||this.context):j)}for(;f&&f.ownerDocument&&f!==b;){for(j in i){e=i[j];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:j,elem:f});delete i[j]}}f=f.parentNode}}return d}var p=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,t){for(;t&&t.ownerDocument&&t!==b;){if(p?p.index(t)>-1:c(t).is(a))return t;t=t.parentNode}return null})},index:function(a){if(!a||typeof a===
"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(sa(a[0])||sa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",
d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?
a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);ab.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||cb.test(f))&&bb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||!c(a).is(d));){a.nodeType===
1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ga=/ jQuery\d+="(?:\d+|null)"/g,Y=/^\s+/,db=/(<([\w:]+)[^>]*?)\/>/g,eb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,Ha=/<([\w:]+)/,fb=/<tbody/i,gb=/<|&\w+;/,hb=function(a,b,d){return eb.test(d)?a:b+"></"+d+">"},G={option:[1,"<select multiple='multiple'>","</select>"],
legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};G.optgroup=G.option;G.tbody=G.tfoot=G.colgroup=G.caption=G.thead;G.th=G.td;if(!c.support.htmlSerialize)G._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=c(this);
return d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.getText(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
wrapInner:function(a){return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&
this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,
"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ga,"").replace(Y,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ta(this,b);ta(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===
1?this[0].innerHTML.replace(Ga,""):null;else if(typeof a==="string"&&!/<script/i.test(a)&&(c.support.leadingWhitespace||!Y.test(a))&&!G[(Ha.exec(a)||["",""])[1].toLowerCase()])try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){T(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}else c.isFunction(a)?this.each(function(e){var i=c(this),j=i.html();i.empty().append(function(){return a.call(this,e,j)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&
this[0].parentNode){c.isFunction(a)||(a=c(a).detach());return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(t){return c.nodeName(t,"table")?t.getElementsByTagName("tbody")[0]||t.appendChild(t.ownerDocument.createElement("tbody")):t}var e,i,j=a[0],o=[];if(c.isFunction(j))return this.each(function(t){var z=
c(this);a[0]=j.call(this,t,b?z.html():w);return z.domManip(a,b,d)});if(this[0]){e=a[0]&&a[0].parentNode&&a[0].parentNode.nodeType===11?{fragment:a[0].parentNode}:ua(a,this,o);if(i=e.fragment.firstChild){b=b&&c.nodeName(i,"tr");for(var p=0,n=this.length;p<n;p++)d.call(b?f(this[p],i):this[p],e.cacheable||this.length>1||p>0?e.fragment.cloneNode(true):e.fragment)}o&&c.each(o,La)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},
function(a,b){c.fn[a]=function(d){var f=[];d=c(d);for(var e=0,i=d.length;e<i;e++){var j=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),j);f=f.concat(j)}return this.pushStack(f,a,d.selector)}});c.each({remove:function(a,b){if(!a||c.filter(a,[this]).length){if(!b&&this.nodeType===1){T(this.getElementsByTagName("*"));T([this])}this.parentNode&&this.parentNode.removeChild(this)}},empty:function(){for(this.nodeType===1&&T(this.getElementsByTagName("*"));this.firstChild;)this.removeChild(this.firstChild)}},
function(a,b){c.fn[a]=function(){return this.each(b,arguments)}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;var e=[];c.each(a,function(i,j){if(typeof j==="number")j+="";if(j){if(typeof j==="string"&&!gb.test(j))j=b.createTextNode(j);else if(typeof j==="string"){j=j.replace(db,hb);var o=(Ha.exec(j)||["",""])[1].toLowerCase(),p=G[o]||G._default,n=p[0];i=b.createElement("div");for(i.innerHTML=p[1]+j+p[2];n--;)i=i.lastChild;
if(!c.support.tbody){n=fb.test(j);o=o==="table"&&!n?i.firstChild&&i.firstChild.childNodes:p[1]==="<table>"&&!n?i.childNodes:[];for(p=o.length-1;p>=0;--p)c.nodeName(o[p],"tbody")&&!o[p].childNodes.length&&o[p].parentNode.removeChild(o[p])}!c.support.leadingWhitespace&&Y.test(j)&&i.insertBefore(b.createTextNode(Y.exec(j)[0]),i.firstChild);j=c.makeArray(i.childNodes)}if(j.nodeType)e.push(j);else e=c.merge(e,j)}});if(d)for(a=0;e[a];a++)if(f&&c.nodeName(e[a],"script")&&(!e[a].type||e[a].type.toLowerCase()===
"text/javascript"))f.push(e[a].parentNode?e[a].parentNode.removeChild(e[a]):e[a]);else{e[a].nodeType===1&&e.splice.apply(e,[a+1,0].concat(c.makeArray(e[a].getElementsByTagName("script"))));d.appendChild(e[a])}return e}});var ib=/z-?index|font-?weight|opacity|zoom|line-?height/i,Ia=/alpha\([^)]*\)/,Ja=/opacity=([^)]*)/,ja=/float/i,ka=/-([a-z])/ig,jb=/([A-Z])/g,kb=/^-?\d+(?:px)?$/i,lb=/^-?\d/,mb={position:"absolute",visibility:"hidden",display:"block"},nb=["Left","Right"],ob=["Top","Bottom"],pb=s.defaultView&&
s.defaultView.getComputedStyle,Ka=c.support.cssFloat?"cssFloat":"styleFloat",la=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return $(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!ib.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""===
"NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter=Ia.test(a)?a.replace(Ia,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Ja.exec(f.filter)[1])/100+"":""}if(ja.test(b))b=Ka;b=b.replace(ka,la);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,i=b==="width"?nb:ob;function j(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(i,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=
parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,"border"+this+"Width",true))||0})}a.offsetWidth!==0?j():c.swap(a,mb,j);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Ja.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ja.test(b))b=Ka;if(!d&&e&&e[b])f=e[b];else if(pb){if(ja.test(b))b="float";b=b.replace(jb,"-$1").toLowerCase();e=
a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f=a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ka,la);f=a.currentStyle[b]||a.currentStyle[d];if(!kb.test(f)&&lb.test(f)){b=e.left;var i=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=i}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=
f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var qb=K(),rb=/<script(.|\s)*?\/script>/gi,sb=/select|textarea/i,tb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,O=/=\?(&|$)/,ma=/\?/,ub=/(\?|&)_=.*?(&|$)/,vb=/^(\w+:)?\/\/([^\/?#]+)/,
wb=/%20/g;c.fn.extend({_load:c.fn.load,load:function(a,b,d){if(typeof a!=="string")return this._load(a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}c.ajax({url:a,type:f,dataType:"html",data:b,context:this,complete:function(i,j){if(j==="success"||j==="notmodified")this.html(e?c("<div />").append(i.responseText.replace(rb,
"")).find(e):i.responseText);d&&this.each(d,[i.responseText,j,i])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||sb.test(this.nodeName)||tb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});
c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},
ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",
text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&&e.success.call(p,o,j,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(p,x,j);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(r,q){(e.context?c(e.context):c.event).trigger(r,q)}var e=c.extend(true,{},c.ajaxSettings,a),i,j,o,p=e.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,
e.traditional);if(e.dataType==="jsonp"){if(n==="GET")O.test(e.url)||(e.url+=(ma.test(e.url)?"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!O.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&O.test(e.data)||O.test(e.url))){i=e.jsonpCallback||"jsonp"+qb++;if(e.data)e.data=(e.data+"").replace(O,"="+i+"$1");e.url=e.url.replace(O,"="+i+"$1");e.dataType="script";A[i]=A[i]||function(r){o=r;b();d();A[i]=w;try{delete A[i]}catch(q){}B&&
B.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache===false&&n==="GET"){var t=K(),z=e.url.replace(ub,"$1_="+t+"$2");e.url=z+(z===e.url?(ma.test(e.url)?"&":"?")+"_="+t:"")}if(e.data&&n==="GET")e.url+=(ma.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");t=(t=vb.exec(e.url))&&(t[1]&&t[1]!==location.protocol||t[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&t){var B=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");
C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!i){var D=false;C.onload=C.onreadystatechange=function(){if(!D&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){D=true;b();d();C.onload=C.onreadystatechange=null;B&&C.parentNode&&B.removeChild(C)}}}B.insertBefore(C,B.firstChild);return w}var F=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",
e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since",c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}t||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ia){}if(e.beforeSend&&e.beforeSend.call(p,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",
[x,e]);var g=x.onreadystatechange=function(r){if(!x||x.readyState===0){F||d();F=true;if(x)x.onreadystatechange=c.noop}else if(!F&&x&&(x.readyState===4||r==="timeout")){F=true;x.onreadystatechange=c.noop;j=r==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";if(j==="success")try{o=c.httpData(x,e.dataType,e)}catch(q){j="parsererror"}if(j==="success"||j==="notmodified")i||b();else c.handleError(e,x,j);d();r==="timeout"&&x.abort();if(e.async)x=
null}};try{var h=x.abort;x.abort=function(){if(x){h.call(x);if(x)x.readyState=0}g()}}catch(k){}e.async&&e.timeout>0&&setTimeout(function(){x&&!F&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||A,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol===
"file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;if(e&&a.documentElement.nodeName==="parsererror")throw"parsererror";if(d&&
d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&f.indexOf("json")>=0)if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))a=A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+a))();else throw"Invalid JSON: "+a;else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(e,i){i=
c.isFunction(i)?i():i;f[f.length]=encodeURIComponent(e)+"="+encodeURIComponent(i)}var f=[];if(b===w)b=c.ajaxSettings.traditional;c.isArray(a)||a.jquery?c.each(a,function(){d(this.name,this.value)}):c.each(a,function e(i,j){if(c.isArray(j))c.each(j,function(o,p){b?d(i,p):e(i+"["+(typeof p==="object"||c.isArray(p)?o:"")+"]",p)});else!b&&j!=null&&typeof j==="object"?c.each(j,function(o,p){e(i+"["+o+"]",p)}):d(i,j)});return f.join("&").replace(wb,"+")}});var na={},xb=/toggle|show|hide/,yb=/^([+-]=)?([\d+-.]+)(.*)$/,
Z,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a!=null)return this.animate(L("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(na[d])f=na[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();
na[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a!=null)return this.animate(L("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a],"olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&
c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(L("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)},animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var i=c.extend({},e),j,o=this.nodeType===1&&c(this).is(":hidden"),
p=this;for(j in a){var n=j.replace(ka,la);if(j!==n){a[n]=a[j];delete a[j];j=n}if(a[j]==="hide"&&o||a[j]==="show"&&!o)return i.complete.call(this);if((j==="height"||j==="width")&&this.style){i.display=c.css(this,"display");i.overflow=this.style.overflow}if(c.isArray(a[j])){(i.specialEasing=i.specialEasing||{})[j]=a[j][1];a[j]=a[j][0]}}if(i.overflow!=null)this.style.overflow="hidden";i.curAnim=c.extend({},a);c.each(a,function(t,z){var B=new c.fx(p,i,t);if(xb.test(z))B[z==="toggle"?o?"show":"hide":z](a);
else{var C=yb.exec(z),D=B.cur(true)||0;if(C){z=parseFloat(C[2]);var F=C[3]||"px";if(F!=="px"){p.style[t]=(z||1)+F;D=(z||1)/B.cur(true)*D;p.style[t]=D+F}if(C[1])z=(C[1]==="-="?-1:1)*z+D;B.custom(D,z,F)}else B.custom(D,z,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:L("show",1),slideUp:L("hide",1),slideToggle:L("toggle",
1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration==="number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,
b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==
null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(i){return e.step(i)}this.startTime=K();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!Z)Z=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop===
"width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=K(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=
this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem,e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=
c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||c.fx.stop()},stop:function(){clearInterval(Z);Z=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=
null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in s.documentElement?function(a){var b=this[0];if(!b||!b.ownerDocument)return null;if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),
f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b=this[0];if(!b||!b.ownerDocument)return null;if(a)return this.each(function(t){c.offset.setOffset(this,a,t)});if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=
b,e=b.ownerDocument,i,j=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var p=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==j;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;i=e?e.getComputedStyle(b,null):b.currentStyle;p-=b.scrollTop;n-=b.scrollLeft;if(b===d){p+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){p+=parseFloat(i.borderTopWidth)||
0;n+=parseFloat(i.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&i.overflow!=="visible"){p+=parseFloat(i.borderTopWidth)||0;n+=parseFloat(i.borderLeftWidth)||0}f=i}if(f.position==="relative"||f.position==="static"){p+=o.offsetTop;n+=o.offsetLeft}if(c.offset.supportsFixedPosition&&f.position==="fixed"){p+=Math.max(j.scrollTop,o.scrollTop);n+=Math.max(j.scrollLeft,o.scrollLeft)}return{top:p,left:n}};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),
d,f,e,i=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";a.insertBefore(b,a.firstChild);
d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i;a.removeChild(b);c.offset.initialize=c.noop},
bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),i=parseInt(c.curCSS(a,"top",true),10)||0,j=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a,d,e);d={top:b.top-e.top+i,left:b.left-
e.left+j};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top-f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=
this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],i;if(!e)return null;if(f!==w)return this.each(function(){if(i=wa(this))i.scrollTo(!a?f:c(i).scrollLeft(),a?f:c(i).scrollTop());else this[d]=f});else return(i=wa(e))?"pageXOffset"in i?i[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&i.document.documentElement[d]||i.document.body[d]:e[d]}});
c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;return"scrollTo"in e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+
b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window);

var supersleight	= function() {
	
	var root = false;
	var applyPositioning = true;
	
	// Path to a transparent GIF image
	var shim			= 'http://olcso.hu/public/images/design/spacer.gif';
	
	// RegExp to match above GIF image name
	var shim_pattern	= /x\.gif$/i;
	
	
	
	var fnLoadPngs = function() { 

		if (root) {
			root = document.getElementById(root);
		}else{
			root = document;
		}
	//css háttérképek
	 for (m=0; m<document.styleSheets.length; m++) { 
			 var pos = document.styleSheets[m].href.lastIndexOf("/"); 
			 var cssDir = (pos != -1) ? document.styleSheets[m].href.substring(0, pos + 1) : ""; 
			 for (j=0; j<document.styleSheets[m].rules.length; j++) { 
					var style = document.styleSheets[m].rules[j].style; 
					
					if (style.backgroundImage.toLowerCase().indexOf(".png") != -1) {
					var filename = style.backgroundImage.substring(4, style.backgroundImage.length - 1); 
					
							if (filename.indexOf("http://") != 0 && filename.indexOf("/") != 0){
								filename = cssDir + filename; style.backgroundImage = "none"; 
								
								style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + filename + "', sizingMethod='crop');"; 
							} 
						} 
				} 
				
		} 
		var els = document.getElementsByTagName("input"); 
		for (i=0; i<els.length; i++) { s = els[i].src; 
			 if (s.toLowerCase().indexOf(".png") != -1) {
			els[i].src = shim; els[i].style.filter += "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + s + "', sizingMethod=image);"; } 
		}	
		for (var i = root.all.length - 1, obj = null; (obj = root.all[i]); i--) {
			// background pngs
			if (obj.currentStyle.backgroundImage.match(/\.png/i) !== null) {
				bg_fnFixPng(obj);
			}
			// image elements
			if (obj.tagName=='IMG' && obj.src.match(/\.png$/i) !== null){
				el_fnFixPng(obj);
			}
	
			// apply position to 'active' elements
			if (applyPositioning && (obj.tagName=='A' || obj.tagName=='INPUT') && obj.style.position === ''){
				//obj.style.position = 'relative';
			}
		}
		/* for (i=0; i<document.styleSheets.length; i++) { 			
			 for (j=0; j<document.styleSheets[i].rules.length; j++) { 
					var style = document.styleSheets[i].rules[j].style; 
					if (style.backgroundImage.match(/\.png/i) !== null) {
						bg_fnFixPng1(style);
					}
				} 
		 }*/
		
	};

	var bg_fnFixPng = function(obj) {
		var mode = 'scale';
		var bg	= obj.currentStyle.backgroundImage;
		var src = bg.substring(5,bg.length-2);
		
		if (obj.currentStyle.backgroundRepeat == 'no-repeat') {
			mode = 'crop';
		}
		obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='" + mode + "')";
		obj.style.backgroundImage = 'url('+shim+')';
	};

	var bg_fnFixPng = function(obj) {
		var mode = 'scale';
		var bg	= obj.currentStyle.backgroundImage;
		var src = bg.substring(5,bg.length-2);
		
		if (obj.currentStyle.backgroundRepeat == 'no-repeat') {
			mode = 'crop';
		}
		obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='" + mode + "')";
		obj.style.backgroundImage = 'url('+shim+')';
	};

	

	var el_fnFixPng = function(img) {
		var src = img.src;
		img.style.width = img.width + "px";
		img.style.height = img.height + "px";
		img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='scale')";
		img.src = shim;
	};
	
	var addLoadEvent = function(func) {
		var oldonload = window.onload;
		if (typeof window.onload != 'function') {
			window.onload = func;
		} else {
			window.onload = function() {
				if (oldonload) {
					oldonload();
				}
				func();
			};
		}
	};
	
	return {
		init: function() { 
			addLoadEvent(fnLoadPngs);
		},
		
		limitTo: function(el) {
			root = el;
		},
		
		run: function() {
			fnLoadPngs();
		}
	};
}();

// limit to part of the page ... pass an ID to limitTo:
// supersleight.limitTo('header');
 if (navigator.userAgent.indexOf("MSIE") != -1 && navigator.userAgent.indexOf("Windows") != -1  && navigator.userAgent.indexOf("MSIE 8") == -1 && navigator.userAgent.indexOf("MSIE 7") == -1){
	supersleight.init();
 }
	/* v 1.3

	1.1 - Ajax Object - sima html ajaxolására, ugyanaz mint a Json Object
	1.2 - kissebb javitasok Smart_list 1.0
	1.21 - L_ist ie-ben is mukodik (setattributes)
	1.3  - smart_form - egy form-on belül minden input-ot textarea-t select-et elküld (2008.07.15.)
		 - hideShow_Button
	1.4 json 1s 
*/

function Request () {	
	this.url = null;
	this.successMethod = null;
	this.errorMethod = null;
	this.obj = null;
	this.setRequestData = function () {}; 

	this.method = 'POST';
	this.async = true;
	
	this.initXmlHTTP = function() {
		this.obj = false;
		// branch for native XMLHttpRequest object
		if(window.XMLHttpRequest) {
			try {
				this.obj = new XMLHttpRequest();
			} catch(e) {
				this.obj = false;
			}
		// branch for IE/Windows ActiveX version
		} else if(window.ActiveXObject) {
			try {
				this.obj = new ActiveXObject("Msxml2.XMLHTTP");
			} catch(e) {
				try {
					this.obj = new ActiveXObject("Microsoft.XMLHTTP");
				} catch(e) {
					this.obj = false;
				}
			}
		}
	};
	this.generateFunction = function(objName,method) {
		return function () {eval(objName+"."+method+"()");};
	};

	
	this.defaultErrorMethod = function (xmlhttpResp) {alert("ERROR("+xmlhttpResp.status+"):"+xmlhttpResp.responseText);};
	this.httpReturn = function (){			
		if ((typeof(this.request.obj)=='undefined')){		
			return true;
		}
		if (this.request.obj.readyState != 4) {
			return true;
		}
		if (this.request.obj.status != 200) {
			if (typeof(this.errorMethod)=='undefined')	{					
				this.defaultFailed(this.request.obj);
			} else {
				this.errorMethod(this.request.obj,this._params);
			}
		} else {
			var obj=this.request.obj;
			delete this.request.obj;
			this.successMethod(obj,this._params);				
		}
		return false;
	};
	this.arrayToRequest = function (params){
		var tmpstr="";
		var first=true;
		if (params=="")
		{
			return tmpstr;
		}	
		
		for (var i = 0; i<params.keys.length ; i++)
		{
			if (!first)	{
				tmpstr+="&";
			} else {
				first=false;
			}
			tmpstr+=params.keys[i]+"=";
			tmpstr+=params.values[i];
//			tmpstr+=escape(params.values[i]);
		}

		return tmpstr;
	};

	this.initXmlHTTP();
}

function XmlHTTP (objName) {
	this.request_data = null;
	this._params = null;

	this.xmlhttp=new Array();

	this.objName = objName;
	
	/*Inherit utils*/
	this.inheritFrom  = utils;
	this.inheritFrom();

	this.addRequest = function (){

		if (arguments.length>=1)
		{
			this.xmlhttp[arguments[0]] = new Request();
		} else {
			return;
		}

		if (arguments.length>=2)
		{
			this.xmlhttp[arguments[0]].url = arguments[1];
			
		}

		if (arguments.length>=3)
		{
			this.xmlhttp[arguments[0]].successMethod = arguments[2];
		}

		if (arguments.length>=4)
		{
			this.xmlhttp[arguments[0]].errorMethod = arguments[3];
		} else {
			this.xmlhttp[arguments[0]].errorMethod = this.defaultErrorMethod;
		}
	};

	this.getRequest = function (name){
		if (typeof this.xmlhttp[name] == 'undefined') { console.log('nincs '+name+' http object'); }
		return this.xmlhttp[name];
	};

	this.defaultErrorMethod = function (xmlhttpResp) {alert("ERROR("+xmlhttpResp.status+"):"+xmlhttpResp.responseText);};
	
	this.initRequestData = function (){
		this.request_data = {keys:[],values:[]};
	};

	this.setRequestFromIds = function (){

		for (var i=0;i<arguments.length ;i++ )
		{
			if (this.he(arguments[i]))
			{
				this.addFieldToRequestArray(this.ge(arguments[i]));
			}
		}
	};

	this.addFieldToRequestArray = function (formObj) {	
		if (formObj.tagName.toLowerCase()=='select')
		{			
			if (formObj.getAttribute("multiple") )
			{	
				for (var i=0;i<formObj.options.length ;i++ )
				{					
					if (formObj.options[i].selected)
					{
						this.request_data.keys.push(formObj.name+"[]");
						this.request_data.values.push(formObj.options[i].value);
					}
				}
				return false;				
			} else {				
				tmp=formObj.options[formObj.selectedIndex].value;
			}
		}
		if (formObj.tagName.toLowerCase()=='input' || formObj.tagName.toLowerCase()=='textarea')
		{
			tmp=formObj.value;	
		}			
			
		this.request_data.keys.push(formObj.name);
		this.request_data.values.push(tmp);		
	};

	this.generateFunction = function(objName,method) {
		return function () {eval(objName+"."+method+"()");};
	};

	this.httpReturn = function (){			
		for (var name in this.xmlhttp) {			
			if ((typeof(this.xmlhttp[name].obj)=='undefined')){		
				continue;
			}
			if (this.xmlhttp[name].obj.readyState != 4) {
				continue;
			}
			if (this.xmlhttp[name].obj.status != 200) {
				if (typeof(this.xmlhttp[name].errorMethod)=='undefined')	{					
					this.defaultFailed(xmlhttp[name].obj);
				} else {					
					this.xmlhttp[name].errorMethod(this.xmlhttp[name].obj,this.xmlhttp[name]._params);
				}
			} else {
				var obj=this.xmlhttp[name].obj;
				delete this.xmlhttp[name].obj;
				this.xmlhttp[name].successMethod(obj,this.xmlhttp[name]._params);				
			}

		}
		return false;
	};

	this.sendRequest = function (name,params) {		
		//if (this.xmlhttp[name].obj)
		//{
			if (typeof(params) == "undefined") {
				var params = this.request_data;
			}
			this.xmlhttp[name].initXmlHTTP();
			this.xmlhttp[name].obj.onreadystatechange = this.generateFunction(this.objName,"httpReturn");	
			this.xmlhttp[name].obj.open(this.xmlhttp[name].method, this.xmlhttp[name].url, this.xmlhttp[name].async);				
			this.xmlhttp[name].obj.setRequestHeader('Content-Type','application/x-www-form-urlencoded;');	
			this.xmlhttp[name].setRequestData();
			//this.xmlhttp[name].obj._params = this.xmlhttp[name]._params;
			this.xmlhttp[name].obj.send(this.arrayToRequest(params));
			this.initRequestData();
		//}
	};

	this.arrayToRequest = function (params){
		var tmpstr="";
		var first=true;
		if (params=="")
		{
			return tmpstr;
		}	
		
		for (var i = 0; i<params.keys.length ; i++)
		{
			if (!first)	{
				tmpstr+="&";
			} else {
				first=false;
			}
			tmpstr+=params.keys[i]+"=";
			tmpstr+=params.values[i];
//			tmpstr+=escape(params.values[i]);
		}

		return tmpstr;
	};

	this.initRequestData();
}

xmlhttp = new XmlHTTP('xmlhttp');

function utils () {
	this._valid = new Array();
	this.resetValid = function() {
		this._valid = new Array();
	}

	this.valid = function (action,text) {
		if (!action)	{
			this._valid.push(text);
		}
	}
	this.isValid = function () {
		return this._valid.length==0;
	}
	this.exec = function (array,command) {
		for (var i=0; i < array.length; i++) {
				command(array[i]);
		}
	};
	this.ge = function (name) { 
		if (typeof debug!='undefined' && debug<2) {
			Common.log('ge: '+name);
		}
		if (typeof name == 'object') {
			return name;
		}
		return document.getElementById(name);
	};
	this.he = function (name) {
		return (this.ge(name)!==null);
	};
	this.hideObj = function (obj) {
		if (obj==null) {
			console.log('nem tudtam eltüntetni');
			console.trace();
			return false;
		}		
		obj.style.display="none";
	};
	this.hide = function (name) {
		if (this.ge(name)==null) {
			console.log('nem tudtam eltüntetni a '+name+' -et!');
			console.trace();
			return false;
		}
		this.hideObj(this.ge(name));
	};
	this.showObj = function (obj) {
		if (obj==null) {
			console.log('nem tudtam megjeleníteni');
			return false;
		}
		obj.style.display="";
	};
	this.show = function (name) {
		if (this.ge(name)==null) {
			console.log('nem tudtam megjeleníteni a '+name+' -et!');
			console.trace();
			return false;
		}
		this.showObj(this.ge(name));
	};
	this.isHideObj = function (obj) {
		if (typeof obj == 'undefined')	{
			return;
		}
		if (obj.style.display == 'none') {
			return true;
		}
		return false;
	};
	this.showMessage = function (titleText, msgText, needReload) {
			$( "#user_msg" ).dialog({
			height: 200,
			width: 400,
			resizable:false,
			autoOpen: true,
			modal: true,
			title: titleText,
			//close:function(ev, ui) { $("#user_msg").dialog('close');},
			 beforeClose: function(event, ui) {if(needReload){ window.location.reload();}}
			});
		
		$("#user_msg").html('<p>'+msgText+'</p>');
		$("#user_msg").dialog('open');
	};
	this.showMessageNoModal = function (titleText, msgText, needReload) {
		
			//if($("#user_msg").dialog('isOpen')){$("#user_msg").dialog('close')}
			$( "#user_msg" ).dialog({
			height: 200,
			width: 400,
			resizable:false,
			autoOpen: false,
			modal: false,
			title: titleText
			//close:function(ev, ui) { $("#user_msg").dialog('close');},
			 //beforeClose: function(event, ui) {if(needReload){ window.location.reload();}}
			});
		
		$("#user_msg").html('<p>'+msgText+'</p>');
		$("#user_msg").dialog('open');
				
	};
	this.showMessageBig = function (titleText, msgText, needReload) {
			$( "#user_msg" ).dialog({
			height: 400,
			width: 500,
			resizable:false,
			autoOpen: true,
			modal: true,
			title: titleText,
			//close:function(ev, ui) { $("#user_msg").dialog('close');},
			 beforeClose: function(event, ui) {if(needReload){ window.location.reload();}}
			});
			
		$("#user_msg").html('<p>'+msgText+'</p>');
		$("#user_msg").dialog('open');
	};
	this.showMessageBigNoModal = function (titleText, msgText, needReload) {
			$( "#user_msg" ).dialog({
			height: 450,
			width: 520,
			resizable:true,
			autoOpen: true,
			modal: false,
			title: titleText,
			// close:function(ev, ui) { },
			 beforeClose: function(event, ui) {$(".selected_row").removeClass();}
			});
			
		$("#user_msg").html('<p>'+msgText+'</p>');
		$("#user_msg").dialog('open');
	};
		this.showMessageBigNoModal600 = function (titleText, msgText, needReload) {
			$( "#user_msg" ).dialog({
			height: 600,
			width: 600,
			resizable:true,
			autoOpen: true,
			modal: false,
			title: titleText,
			// close:function(ev, ui) { },
			 beforeClose: function(event, ui) {$(".selected_row").removeClass();}
			});
			
		$("#user_msg").html('<p>'+msgText+'</p>');
		$("#user_msg").dialog('open');
	};
	this.closeMessage = function () {
		$("#user_msg").dialog('close');
	};
	this.selectFromValue = function (obj,value) {for (var i=0;i<obj.options.length ;i++ ){if (value==obj.options[i].value){obj.options[i].selected=true;}}};
	this.getElementByAttribute = function (topObject,tag,attributes,values) {
		
		//tag.. kell lennie tegnak
		var elements = topObject.getElementsByTagName(tag);
		

		var found = false;
		for (var i=0; i < elements.length ; i++)
		{
			if (elements[i].nodeType==1)		
			{
				for (var j=0;j < attributes.length ; j++ )
				{
					if (elements[i].getAttribute(attributes[j])!=values[j])
					{
						found = false;
						break;
					} else {
						found = true;
					}
				}				

				if (found) {
					return elements[i];
				}
			}
		}
	};

	this.getElementsByAttribute = function (topObject,tag,attributes,values) {
		
		//tag.. kell lennie tagnak
		var elements = topObject.getElementsByTagName(tag);
		var retElements = new Array();

		var found = false;
		for (var i=0; i < elements.length ; i++)
		{
			if (elements[i].nodeType==1)		
			{
				for (var j=0;j < attributes.length ; j++ )
				{
					if (elements[i].getAttribute(attributes[j])!=values[j])
					{
						found = false;
						break;
					} else {
						found = true;
					}
				}				

				if (found) {
					retElements.push(elements[i]);
				}
			}
		}
		return retElements;
	};
/*
	this.setRequestArray = function (formObj,paramObj) {	
		return true;
		console.log('ehh');
		if (formObj.tagName.toLowerCase()=='select')
		{			
			if (formObj.getAttribute("multiple") )
			{	
				console.log(formObj.options.length);
				for (var i=0;i<formObj.options.length ;i++ )
				{					
					if (formObj.options[i].selected)
					{
						paramObj.keys.push(formObj.name+"[]");
						paramObj.values.push(formObj.options[i].value);
					}
				}
				return false;				
			} else {				
				tmp=formObj.options[formObj.selectedIndex].value;
			}
		}
		if (formObj.tagName.toLowerCase()=='input' || formObj.tagName.toLowerCase()=='textarea')
		{
			tmp=formObj.value;	
		}			
			
		paramObj.keys.push(formObj.name);
		paramObj.values.push(tmp);		
	}
*/
	this.removeClass = function (element, className) {
		element.className = element.className.replace( new RegExp( '\\b' + className + '\\b', 'g' ), '' );
	};
	this.addClass = function (element, className ) {
	    if( !element.className.match( '/\\b' + className + '\\b/' ) )
		    element.className += ' ' + className;
		};
	this.hasClass = function( element, className ) {
		return element.className.match( '\\b' + className + '\\b' );
	};
	this.deleteClasses = function (obj,_class,value) {
		var dels = this.getElementsByAttribute(obj,'*',[_class],[value]);
		for (var i = 0 ; i < dels.length ; i++) {
			this.destroy(dels[i]);
		}
	};
	this.getElementByClassName = function (obj,tagName,value) {
		var elems=obj.getElementsByTagName(tagName);
		for (var i=0;i<elems.length;i++) { 
			if (elems[i].className==value) {
				return elems[i];
			}
		}
	};
	this.getElementByClassName1 = function (obj,tagName,value) {
		var elems=document.getElementsByTagName(tagName);
		var valami = new Array();
		var j=0;
		for (var i=0;i<elems.length;i++) {
			if (elems[i].getAttribute('class')==value) {
				valami[j] = elems[i];
				j++;
			}
		}
		return valami;
	};
	this.getElementArrayByClassName = function (obj,tagName,value) {
		var elems=obj.getElementsByTagName(tagName);
		var valami = new Array();
		var j=0;
		for (var i=0;i<elems.length;i++) {
			if (elems[i].className==value) {
				valami[j] = elems[i];
				j++;
			}
		}
		return valami;
	};
	this.getElementsArrayByClassName = this.getElementArrayByClassName;

	this.getElementByClassNameSmart = function (obj,tagName,value) {
		var elems=obj.getElementsByTagName(tagName);
		for (var i=0;i<elems.length;i++) { 
			if (elems[i].className.indexOf(value) != -1) {
				return elems[i];
			}
		}
	};
	this.getElementsByClassNameSmart = function (className, tag, elm){
		var testClass = new RegExp("(^|\\s)" + className + "(\\s|$)");
		var tag = tag || "*";
		var elm = elm || document;
		var elements = (tag == "*" && elm.all)? elm.all : elm.getElementsByTagName(tag);
		var returnElements = [];
		var current;
		var length = elements.length;
		for(var i=0; i<length; i++){
			current = elements[i];
			if(testClass.test(current.className)){
				returnElements.push(current);
			}
		}
		return returnElements;
	};
	this.isObj = function (obj) {
		if (typeof obj=='undefined') {
			return false;
		} else {
			return true;
		}
	};
	this.addEvent = function (obj, evType, fn) {
		  if (obj.addEventListener) {
			obj.addEventListener(evType, fn, true);
			return true;
		  } else if (obj.attachEvent) {
			var r = obj.attachEvent("on"+evType, fn);
			return r;
		  } else {
			return false;
		  }
	};
	
	this.addEvent2 = function (objAttrib,handler,addFunction){
	   if ((!document.all)&&(document.getElementById)){
	       objAttrib.setAttribute(handler,addFunction);
	   }
	   //workaround for IE 5.x
	   if ((document.all)&&(document.getElementById)){
	       objAttrib[handler]=new Function(addFunction);
	   }
	   return objAttrib;
	};
	
	this.evalJson = function (json) {
		try	{
			eval("var ret = "+json+";");
		} catch (err) {
			if (err.name=='SyntaxError') {
				return false;
			}
		}
		return ret;
	};
	this.setError = function (msg,text) {
		// majd ha működik
		if (typeof Strip != 'undefined') {
			Strip.set('Error',msg,text);
		} else {
			if (typeof text == 'undefined')	{
				alert(msg);
			} else {
				alert(msg+' '+text);
			}
		}
		//alert(msg);
	};
	this.setMsg = this.setError;
	this.fillSelectJson = function (obj,json,value,text,attr){
		var depth = false;
		var _class = false;
		if (typeof attr == 'undefined') { attr = {'selected':""}; }
		if (typeof attr.text == 'undefined') { attr.text = false; attr.value = 0;}

		if (obj.getAttribute('_depth') == "true") {
			depth = true;
		}
		if (obj.getAttribute('_class') == "true") {
			_class = true;
		}
		var tx;
		//ha display=none akkor show
		//if (obj.style.display=='none') {
		//	obj.style.display='';
		//}

		this.emptyOption(obj);
		if (typeof json == 'undefined') {
			return false;
		}
		if (attr.text) {
			Utils.addOption(obj,attr.text,attr.value);
			obj.options[0].setAttribute('class','dirOption');
		}
		for (var i=0;i<json.length ;i++ ) {
			if (depth) { 
				tx=get_(json[i].de)+json[i][text];
			} else {
				tx=json[i][text];
			}
			if (attr.hidden) {
				if (json[i].hidden) {
					continue;
				}
			}
			Utils.addOption(obj,tx,json[i][value]);
			//Utils.addOption(obj,json[i][text],json[i][value]);
			var id=obj.options.length-1;
			if (json[i][value]==attr.selected) {
				obj.options[id].selected=true;
			}
			// <select _id="48"> -> ki lesz valasztva
			if (obj.getAttribute('_id') && json[i][value] == obj.getAttribute('_id')) {
				obj.options[id].selected=true;
			}
			if (_class) {
				if (json[i].di == true) {
					obj.options[id].setAttribute('class','dirOption');
				}
			}
			for (var j in json[i]) {
				if (j!=value || j!=text) {
					//obj.options[id].setAttribute(j,json[i][j]);
					//obj.options[id].value='read-only';
				}
			}
		}
	};

	this.emptyOption = function (obj){
		for (var i=obj.options.length;i>=0 ;i-- )
		{
			obj.remove(i);
		}
	};
	this.addOption = function (destObj,text,value,className){	
		_option=document.createElement("OPTION");	
		_option.value=value;
		//_option.className=className;
		_option.appendChild(document.createTextNode(text));

		destObj.appendChild(_option);
	};
	this.removeOption = function (destObj,value) {
		for (var i = 0 ; i < destObj.options.length ; i++ )	{
			if (destObj.options[i].value == value) {
				destObj.remove(i);
			}
		}
	};
	this.removeOptionWithout = function (obj,values,key) {
		for (var i = 0;i< obj.options.length ;i++ ) {
			var option = obj.options[i];
			var del = true;
			for (var j = 0; j < values.length ; j++) {
				if (option.value == eval("values[j]."+key)) {
					del = false;
				}
			}
			if (del) {
				obj.remove(i);
			}
		}
	};


	this.click = function (ev) {
		  ev || (ev = window.event);

		  // mely objektum váltotta ki az eseményt?
		  var source;
		  if (typeof ev.target != 'undefined') {
			source = ev.target;
		  } else if (typeof ev.srcElement != 'undefined') {
			source = ev.srcElement;
		  } else { return(true); }
		  return source;
	};
	this.keyEvent = function (e) {
			var keynum;
			var keychar;
			if(window.event) // IE
			{
			keynum = e.keyCode;
			}
			else if(e.which) // Netscape/Firefox/Opera
			{
			keynum = e.which;
			}
			keychar = String.fromCharCode(keynum);
		return {keyChar:keychar,keyNum:keynum};
	};
	this.generateFunctionEvent = function(objName,method) {
		return function (e) {
			var keynum;
			var keychar;
			if(window.event) // IE
			{
			keynum = e.keyCode;
			}
			else if(e.which) // Netscape/Firefox/Opera
			{
			keynum = e.which;
			}
			keychar = String.fromCharCode(keynum);
			eval(objName+"."+method+"(keychar,keynum)");
		};
	};


	this.setAttributes = function (obj,attributes,values){
		for (var i=0; i < attributes.length;i++ ) {
			if (attributes[i] == 'class'){
				obj.className = values[i];
			} else {
			    obj.setAttribute(attributes[i],values[i]);
				if (this.is_ie) {
					if (attributes[i] == 'style'){
						var value = values[i];
						var vs = value.split(';');
						var split;
						for (var j in vs) {
							if (vs[j] == '' || /(display|color|align)/i.test(vs[j])) {
								continue;
							}
							split = vs[j].split(':');
							//console.log(("obj.style."+split[0]+' = \''+split[1]+'\';'));
							try	{
								eval("obj.style['"+split[0]+'\'] = \''+split[1]+'\';');
							}
							catch (e) {
								console.log('setAttributes hiba!');
								console.log(split[0]);
								console.log(split[1]);
							}
						}
					}
				}
			}
		}
	};

	this.setRequestArray = function (formObj,paramObj) {		
		var tmp;
		
		if (formObj.tagName.toLowerCase()=='select')
		{			
			if (formObj.getAttribute("multiple") ) {
				for (var i=0;i<formObj.options.length ;i++ )
				{					
					if (formObj.options[i].selected)
					{
						paramObj.keys.push(formObj.name+"[]");
						paramObj.values.push(formObj.options[i].value);
					}
				}
				return false;				
			} else {		
				if (formObj.options.length == 0) {
					return true;
				} else {
					if (formObj.selectedIndex != -1) {
						tmp=formObj.options[formObj.selectedIndex].value;
					} else {
						return true;
					}
				}
			}
		}
		if (formObj.tagName.toLowerCase()=='input' || formObj.tagName.toLowerCase()=='textarea')
		{
			if (formObj.tagName.toLowerCase()=='input' && formObj.getAttribute('type')=='checkbox') {
				if (formObj.checked) {
					tmp=formObj.value;
				} else {
					// ha nincs bepipálva, akkor nem is küldjük át, mint ahogy a böngésző is csinálná
					return true;
				}
			} else {
				tmp=formObj.value;
			}
		}			
		if (formObj.name=='') {
			paramObj.keys.push(formObj.id);
		} else {
			paramObj.keys.push(formObj.name);
		}
		paramObj.values.push(tmp);		
	};
	this.addElement = function (parent,tag,attributes,values,id) {
		if (!parent) {
			console.trace();
		}
	    var el = document.createElement(tag);
		if (typeof attributes != 'undefined' && typeof values != 'undefined') {
			Utils.setAttributes(el,attributes,values);
		}
		if (typeof id != 'undefined') {
			el.id = id;
		}
		
		parent.appendChild(el);
		return el;
	};
	this.addText = function (obj,text) {
		if (typeof text == 'undefined') {
			return;
		}
		obj.appendChild(document.createTextNode(text));
	};
	this.setText = function (obj,text) {
		if (typeof obj == 'undefined')	{ this.setError('setText error'); console.trace(); return; }
		obj.innerHTML = '';
		if (typeof text == 'undefined' || text == null) {
			return;
		}
		obj.appendChild(document.createTextNode(text));
	};
	this.isFunction = function (func) {
		if (typeof func == 'function') {
			return true;
		} else {
			return false;
		}
	};
	this.addField = function (div, field, value) {
		var el = null;
		text = new Array();
		text_value = new Array();

		var i = 0;
		
		for (var k in field.attr)
		{			
			text[i] = k;
			text_value[i] = eval("field.attr."+text[i]);
			i++;
		}

		var el = Utils.addElement(div,field.tagName,text,text_value);
		
		this.setValue(el,value);

		//div.appendChild(document.createElement('br'));
		return el;
	};

	this.deleteObj = function (object,obj) {
		object.removeChild(obj)	;
	}
	this.addJs = function(filename) {
		this.addElement(document.getElementsByTagName("HEAD")[0],"SCRIPT",['src'],[filename]);
	}
	this.addBr = function (obj) {
		obj.appendChild(document.createElement('br'));
	};
	/*
	this.setValue = function (el,text) {
		console.log(el,text);
		if (typeof el == 'undefined') {
			if (typeof console != 'undefined') {
				console.trace();
			}
			return false;
		}
		if (typeof text == 'undefined') {
			return true;
		}
			console.log(2);
		if(el.tagName.toLowerCase() == "input") {
			el.value = text;
		} else if (el.tagName.toLowerCase() == "select") {
			console.log(1);
			console.log(text);
			for (var i = 0 ; i < el.options.length ; i++) {
				console.log(el.options[i].value);
				if (el.options[i].value == text) {
					el.options[i].selected = true;
				}
			}
		} else {
			Utils.addText(el, text);
		}
		//el.innerHTML = text;
	}
*/
	/// detect Opera browser
	this.is_opera = /opera/i.test(navigator.userAgent);

	/// detect a special case of "web browser"
	this.is_ie = ( /msie/i.test(navigator.userAgent) && !this.is_opera );
	/// detect IE5.0/Win
	this.is_ie5 = ( this.is_ie && /msie 5\.0/i.test(navigator.userAgent) );

	/// detect IE7.0/Win
	this.is_ie7 = ( this.is_ie && /msie 7\.0/i.test(navigator.userAgent) );

	/// detect IE for Macintosh
	this.is_mac_ie = ( /msie.*mac/i.test(navigator.userAgent) && !this.is_opera );

	/// detect KHTML-based browsers
	this.is_khtml = /Konqueror|Safari|KHTML/i.test(navigator.userAgent);

	/// detect Konqueror
	this.is_konqueror = /Konqueror/i.test(navigator.userAgent);

	/// detect Gecko
	this.is_gecko = /Gecko/i.test(navigator.userAgent);
  
	this.getTargetElement = function (ev) {
		  ev || (ev = window.event);

		  // mely objektum váltotta ki az eseményt?
		  var source;
		  if (typeof ev.target != 'undefined') {
			source = ev.target;
		  } else if (typeof ev.srcElement != 'undefined') {
			source = ev.srcElement;
		  } else { return(true); }
		  return source;
	};

	this.getParentNode = function (el,tag,key,value) {
		if (!el) { return null;	}
		el = el.parentNode;
		if (!tag) {
			return el;
		}
		tag = tag.toLowerCase();
		if (el.nodeType == 1) {
			if (el.tagName.toLowerCase() == tag && el.getAttribute(key) == value) {
				return el;
			}
		}
		return this.getParentNode(el, tag,key,value);
	};
	this.getFirstChild = function(el, tag, alternateTag) {
	  if (!el) {
		return null;
	  }
		el = el.firstChild;
	  if (!el) {
		return null;
	  }
		if (!tag) {
			return el;
		}
		tag = tag.toLowerCase();
		if (el.nodeType == 1) {
			if (el.tagName.toLowerCase() == tag) {
				return el;
			} else if (alternateTag) {
				alternateTag = alternateTag.toLowerCase();
				if (el.tagName.toLowerCase() == alternateTag) {
					return el;
				}
			}
		}
		return this.getNextSibling(el, tag, alternateTag);
	};

	this.getNextSibling = function(el, tag, alternateTag) {
		el = el.nextSibling;
		if (!tag) {
			return el;
		}
		tag = tag.toLowerCase();
		if (alternateTag) alternateTag = alternateTag.toLowerCase();
		while (el) {
			if (el.nodeType == 1 && (el.tagName.toLowerCase() == tag ||
			 (alternateTag && el.tagName.toLowerCase() == alternateTag))) {
				return el;
			}
			el = el.nextSibling;
		}
		return el;
	};
	this.destroy = function(el) {
		if (el && el.parentNode)
			el.parentNode.removeChild(el);
	};
	this.removeChilds = function (obj) {
		//console.log(obj.childNodes.length);
		for (var i=0;i<obj.childNodes.length ; i++) {
			this.destroy(obj.childNodes[i]);
			//obj.childNodes[i].innerHTML = '';
		}
		return;
		for (var i=0;i<obj.childNodes.length ; i++) {
			//obj.removeChild(obj.childNodes[i]);
			console.log(Utils.destroy(obj.childNodes[i]));
			//Utils.deleteObj(obj,obj.childNodes[i]);
		}
	}

	this.setValue = function (_el,value) {
		// obj megszerzese
		el = (typeof _el == 'string') ? document.getElementById(_el) : _el;
		// ha megsincs meg
		if (typeof el == 'undefined' || el == null) {
			if (typeof console != 'undefined') {
				console.log(_el);
				console.trace();
			}
			return false;
		}
		// ha undef jon, toroljuk
		if (typeof value == 'undefined' || value == null) {
			//return true;
			value = '';
		}
		if(el.tagName.toLowerCase() == "input"){			
			if (el.type == 'checkbox'){
				el.checked = (value) ? 'checked' : '';
			} else {
				el.value = value;
			}
		} else if (el.tagName.toLowerCase() == "img"){
			console.log(el);
		} else if (el.tagName.toLowerCase() == "select"){
			// végig megyünk az összes option-on és ahol value==value beállítjuk selected-re
			for (var i = 0;i < el.options.length ; i++ ) {
			//	console.log(el.options[i].value,value);
				if (el.options[i].value == value) {
					el.options[i].selected = 'selected';
				}
			}
		} else {
			this.removeChilds(el);
			Utils.addText(el, value);
		}
		//el.innerHTML = text;
	};
	this.getValue = function (_el) {
		el = (typeof _el == 'string') ? document.getElementById(_el) : _el;
		if (typeof el == 'undefined' || el == null) {
			if (typeof console != 'undefined') {
				console.trace();
			}
			return;
		}
		if (typeof value == 'undefined') {
			//return true;
			value = '';
		}
		if(el.tagName.toLowerCase() == "input"){			
			if (el.type == 'checkbox'){
				return (el.checked == true ? true : false);
			} else {
				return el.value;
			}
		} else if (el.tagName.toLowerCase() == "textarea"){
			return el.value;
		} else if (el.tagName.toLowerCase() == "img"){
			console.log(el);
		} else if (el.tagName.toLowerCase() == "select"){
			/* ki volt kommentezve, de nem tudom miért ehh */
			// multiselect-et még nem tudja
			for (var i = 0;i < el.options.length ; i++ ) {
				//console.log(el.options[i].value,value);
				if (el.options[i].selected) {
					return el.options[i].value;
				}
			}
			
			return false;
		}
		//el.innerHTML = text;
	};
	this.searchId = function (el,name) {
		while(el = el.parentNode) {
			if(el.hasAttribute(name)) {
				return el.getAttribute(name);
			}
		}
		return false;
	};
	this.searchElement = function (el,method,attribute,value,_class) {
		// td,parent,class,message_table_tr

		if (!el) return false;
		if (el.getAttribute('attribute') && el.getAttribute('attribute') == value ) return el;
		while(el = el.parentNode) {
			//if(el.getAttribute(attribute)) {
				
				if (typeof _class == 'undefined') {
					if (el.getAttribute(attribute) == value) 	{
						return el;
					}
				} else {
					if (el.className.match( '\\b' + value + '\\b' ))	{
						return el;
					}
				}
				
			//}
		}
		return false;
	}
	this.average = function (array) {
		var sum = 0;
		for (var i = 0; i < array.length ; i++) {
			sum += parseFloat(array[i]);
		}
		return sum/array.length;
	};
	this.round = function (num,point) {
		return Math.round(num*Math.pow(10,point))/Math.pow(10,point);
	};
	this.filter = function (id) {
		if (Utils.ge(id).checked) {
			return true;
		} 
		return false;
	};
	this.removeArray = function (obj,key) {
		var newArray = new Array();
		for (var i = 0; i < obj.length ; i++) {
			if (obj[i] != key) {
				newArray.push(obj[i]);
			}
		}
		return newArray;
	};
	this.removeArray2 = function (obj,key) {
		var newArray = new Array();
		for (var i = 0 ; i < obj.length; i++) {
			if (i != key) {
				newArray.push(obj[i]);
			}
		}
		return newArray;
	};
	this.getSelected = function (obj,key) {
		var newArray = new Array();
		for (var i = 0 ; i < obj.length; i++) {
			if (i == key) {
				newArray.push(obj[i]);
			}
		}
	//	console.log(newArray);
		return newArray;
	};
	this.money = function (num,sep) {
		num = num.toString().replace(/\$|\,/g,'');
		if (isNaN(num)) {
			num = "0";
		}
		sign = (num == (num = Math.abs(num)));
		num = Math.floor(num).toString();
		if (typeof sep == 'undefined') {
			sep = ',';
		}
		for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++) {
			num = num.substring(0,num.length-(4*i+3))+sep+ num.substring(num.length-(4*i+3));
		}
		return (((sign)?'':'-') +  num);
	};
	this.setCookie = function(name, value, expires, path, domain, secure) {
	    document.cookie= name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
	};
 
	this.getCookie = function(name) {
		var dc = document.cookie;
		var prefix = name + "=";
		var begin = dc.indexOf("; " + prefix);
		if (begin == -1) {
			begin = dc.indexOf(prefix);
			if (begin != 0) return null;
		} else {
			begin += 2;
		}
		var end = document.cookie.indexOf(";", begin);
		if (end == -1) {
			end = dc.length;
		}
		return unescape(dc.substring(begin + prefix.length, end));
	};
	this.SmartButtonClick = function (obj) {
		var href = '';
		if (obj.getAttribute('_href') != null) {
			href += obj.getAttribute('_href');
		}
		if (obj.getAttribute('_id') != null) {
			href += obj.getAttribute('_id');
		}

		if (href.length != 0) {
			window.location = href;
		}
	};
	this.fieldsetChange = function () {
		// ha a fieldset-en kattintani szeretnénk és a tartalma eltünjön/megjelenjen
		var els = Utils.getElementsByClassNameSmart('fieldsetChange','fieldset');
		for (var i in els) {
			var el = els[i];
			var div = document.createElement('div');
			var legend = false;
			for ( var i = 0 ; i < el.childNodes.length ; i++) {
				if (el.childNodes[i].nodeType == 1 && el.childNodes[i].tagName == 'LEGEND')	{
					legend = el.childNodes[i];
				} else {
					div.appendChild(el.childNodes[i].cloneNode(true));
				}
			}
			if (!legend) {
				legend = document.createElement('legend'); legend.appendChild(document.createTextNode('Legend'));
			}
			el.innerHTML = '';
			el.appendChild(legend);
			el.appendChild(div);

			legend.className += (Utils.hasClass(el,'_hide')) ? ' _hide' : ' _show';
			var parent = legend.parentNode
			if (Utils.hasClass(el,'_hide'))	{
				Utils.hide(el.getElementsByTagName('div')[0]);
				/*for (var i = 0 ; i < parent.childNodes.length; i++) {
					var el = parent.childNodes[i];
					if (el.nodeType == 1 && el.tagName != 'LEGEND') {
						Utils.hide(el);
					}
				}*/	
			}
		
			legend.style.cursor = 'pointer';
			Utils.addEvent(legend,'click',
				function (e) { 
					var obj = Utils.click(e); 
					var hided = false;
					if (Utils.hasClass(obj,'_hide')){
						hided = true;
						obj.className = obj.className.replace(/_hide/,'_show');
					} else {
						obj.className = obj.className.replace(/_show/,'_hide');
					}
					var parent = obj.parentNode;
					if (hided) {
						Utils.show(parent.getElementsByTagName('div')[0]);
					} else {
						Utils.hide(parent.getElementsByTagName('div')[0]);
					}
					/*
					for (var i = 0 ; i < parent.childNodes.length; i++) {
						var el = parent.childNodes[i];
						if (el.nodeType == 1 && el.tagName != 'LEGEND') {
							if (hided) {
								Utils.show(el);
							} else {
								Utils.hide(el);
							}
						}
					}
					*/
				})
		}	

		/*
		// nem volt jo, mert csak a nodyType1-eket tunteni
		for (var i in els) {
			var el = els[i];
			var legend = el.getElementsByTagName('legend')[0];
			legend.className += (Utils.hasClass(el,'_hide')) ? ' _hide' : ' _show';
			var parent = legend.parentNode
			if (Utils.hasClass(el,'_hide'))	{
				for (var i = 0 ; i < parent.childNodes.length; i++) {
					var el = parent.childNodes[i];
					if (el.nodeType == 1 && el.tagName != 'LEGEND') {
						Utils.hide(el);
					}
				}	
			}
		
			legend.style.cursor = 'pointer';
			Utils.addEvent(legend,'click',
				function (e) { 
					var obj = Utils.click(e); 
					var hided = false;
					if (Utils.hasClass(obj,'_hide')){
						hided = true;
						obj.className = obj.className.replace(/_hide/,'_show');
					} else {
						obj.className = obj.className.replace(/_show/,'_hide');
					}
					var parent = obj.parentNode;
					for (var i = 0 ; i < parent.childNodes.length; i++) {
						var el = parent.childNodes[i];
						if (el.nodeType == 1 && el.tagName != 'LEGEND') {
							if (hided) {
								Utils.show(el);
							} else {
								Utils.hide(el);
							}
						}
					}			
				})
		}	
		*/
	};
	this.otherFeatures = function() {
		var els = Utils.getElementsByClassNameSmart('hideShowButton');
		for (var i = 0; i<els.length ; i++)	{
			Utils.addEvent(els[i],'click',function(e) { Utils.hideShowButtonClick(Utils.click(e)); });
		}
		var els = Utils.getElementsByClassNameSmart('countInputLength');
		for (var i = 0; i<els.length ; i++)	{
			Utils.addEvent(els[i],'keyup',function(e) { Utils.countInputLength(Utils.click(e)); });
			Utils.addEvent(els[i],'keypress',function(e) { Utils.countInputLength(Utils.click(e)); });
		}
	};

	this.countInputLength = function (obj) {
		var el = Utils.ge(obj.getAttribute('name')+'_count');
		el.innerHTML = obj.value.length;
	}

/*

	- ha a otherFeatures változo aktiv, és van ilyen class-os button, akkor az _action-ben levo object-et megkeresi és hide/show-olja

	<input type="button" value="Új autó hozzáadása" class="hideShowButton" _action="inside_orders_form"><br>
	<div id = "inside_orders_form" style="display:none;"></div>

*/

	this.hideShowButtonClick = function (obj) {
		var el = obj.getAttribute('_action');
		el = Utils.ge(el);
		if (Utils.isHideObj(el)) {
			Utils.show(el);
		} else {
			Utils.hide(el);
		}
	};

	this.getElementsByXPath = function(expression, parentElement) {
	 if ( typeof document.evaluate === "function" ) { 
		 var results = []; 
		 var query = document.evaluate(expression, parentElement || document, 
			null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); 
		 for (var i = 0, length = query.snapshotLength; i < length; i++) 
			results.push(query.snapshotItem(i)); 
		 return results; 
	 } 
};

}


utils.prototype.execObject = function(array,object) {
		for (var i=0; i < array.length; i++) {
			new object(array[i]);
		}
		return array;
	};

Utils = new utils();


function Json (objectName,_params) {
	this.objectName = objectName;
	this._send = function () { return true; };
	this._return = function () {  };
	this.params_ = {"keys":[],"values":[]};
	this.lastParams = null;
	this.url = null;
	this.prefix = null;
	this.smartAjax = null;
	this.successMethod = function () {};
	
	this.sendable = function () {
		if (this.request.obj.readyState != 0){
			return false;
		} else {
			return true;
		}
	};
	this.send = function (obj) {

		// ha az előző nem fejezte be a futását, akkor újat indítunk
		if (this.request.obj.readyState != 0){
			//this.request.obj.abort();
			this.init();
		}
		if (this.smartAjax) {
			this.addParam('smartAction',this.objectName);
		}
		if (this.param) {
			this.addParam('param',this.param);
		}
		if (this._send(obj) === false) {
			return false;
		}
		// ha van box, akkor meghívjuk a loading függvényét
		if (typeof this.box == 'string' || typeof this.box == 'object')	{
			var object = (typeof this.box == 'object') ? this.box : eval(this.box);
			object.loading();
		}
		this.request.obj.open(this.request.method, this.url, this.request.async);				
		var object = this;
		this.request.obj.onreadystatechange = function () { object.httpReturn(); };
		this.request.obj.setRequestHeader('Content-Type','application/x-www-form-urlencoded;');	
		this.request.obj.send(this.request.arrayToRequest(this.params_));
		this.lastParams = this.params_;
		this.params_ = {"keys":[],"values":[]};
		return true;
	};
	this.refresh = function() {
		this.params_ = this.lastParams;
		// ha van box, akkor meghívjuk a loading függvényét
		if (typeof this.box == 'string' || typeof this.box == 'object')	{
			var object = (typeof this.box == 'object') ? this.box : eval(this.box);
			object.loading();
		}
		this.request.obj.open(this.request.method, this.url, this.request.async);				
		var object = this;
		this.request.obj.onreadystatechange = function () { object.httpReturn(); };
		this.request.obj.setRequestHeader('Content-Type','application/x-www-form-urlencoded;');	
		this.request.obj.send(this.request.arrayToRequest(this.params_));
		this.lastParams = this.params_;
		this.params_ = {"keys":[],"values":[]};
		return true;
	}
	this.defaultSuccessMethod = function (xmlhttpResp,_params) {
		var params_ = _params;
		var objectName = _params.objectName;
		var object = params_.object;
		if (json=Utils.evalJson(xmlhttpResp.responseText)) {
			if (json.status != 0) {
				// majd egyszer megkéne csinálni, hogy ne csak a 0. elemet írja ki.
				//Utils.setError('Hiba: '+json.errors[0] + ' Status: '+json.status+' | '+params.objectName+'.returnRequest(()) ', xmlhttpResp.responseText);
				
				Utils.setError('Hiba: '+json.errors[0]);
				return false;
			}
			// a beálított függvény meghívása
			object.successMethod(object.object,json,_params);
		} else {
		    Utils.setError('Hiba Json '+object.objectName+'.returnRequest('+xmlhttpResp._params.type+'()): ', xmlhttpResp.responseText);
		}
	};
	this.httpReturn = function (){			
		if (this.request.obj.readyState != 4) {
			return true;
		}
		if (this.request.obj.status != 200) {
			if (typeof(this.errorMethod)=='undefined')	{					
				this.defaultFailed(this.request.obj);
			} else {					
				this.errorMethod(this.request.obj,this._params);
			}
		} else {
			//var obj=this.request.obj;
			//delete this.request.obj;
			var oldObj = this.request.obj;
			var obj = oldObj;
			var box = this.box;
			this.init();
			//alert(oldObj.responseText);
			if (json=Utils.evalJson(oldObj.responseText)) {
				// itt kéne olyan, hogy ha status nem 0 (tehát hiba van) megnézni hogy van e error függvény
				// ha box, akkor a box-ot hajtjuk végre
				if (typeof this.SuccessMethodNoError != 'undefined') {
					this.SuccessMethodNoError(json);
				} else {
					if (typeof json.status == 'undefined' || json.status != 0 ) {
						if (typeof json.errors == 'undefined')	{
							Common.log('Json hiba, status: '+json.status);
						} else {
							//Common.log(uneval(json.errors));
							//Common.log(oldObj.responseText);
						}
					}
					if (typeof box == 'string' || typeof box == 'object')	{
						var object = (typeof box == 'object') ? box : eval(box);
						if (typeof json.pager != 'undefined') {
							object.pager = json.pager;
						}
						object.smartDraw(json.data);
					} else {
						if (typeof this.smartSuccessMethod != 'undefined') {
							this.smartSuccessMethod(json);
						} else {
							this.successMethod(oldObj);	
						}
					}
				}
				//if (json.status == 0) {
				//	this.smartSuccessMethod(json);
				//} else {
				//	alert('hiba:'+json.status);
				//}
			} else {
				alert('Ismeretlen hiba: nem json jött válaszként:');
				//alert(oldObj.responseText);
			}
		}
		this._return();
		this.init2();
		return false;
	};
	this.addParam = function (keys,values) {
		if (typeof values == 'object') {
			for (var i=0;i<values.length ;i++ ) {
				if (typeof values[i] == 'object') {
						this.params_.values.push(Utils.getValue(values[i]));
				} else {
						this.params_.values.push(values[i]);
				}
			}
		} else if (typeof values == 'string' || typeof values == 'number') {
			this.params_.values.push(values);
		} else {
			// ha véletlenül undefined jön át akkor is küldjünk valamit
			this.params_.values.push('');
		}
		// ha a values object, akkor az az eset áll fent pl: dates[] -> [2006],[2007],[2008]
		if (typeof keys == 'object') {
			for (var i=0;i<keys.length ;i++ ) {
				//this.params_.keys.push(keys[i]);
				this.addKey(keys[i]);
			}
		} else if (typeof keys == 'string' || typeof keys == 'number') {
			// tehát ha a values object, akkor ezt is megismételjük annyiszor
			if (typeof values == 'object') {
				for (var i=0;i<values.length ;i++ ) {
					//this.params_.keys.push(keys);
					this.addKey(keys+'[]');
				}
			} else {
				//this.params_.keys.push(keys);
				this.addKey(keys);
			}
		}

};
	this.addKey = function (key) {
		if (this.prefix == null) {
			this.params_.keys.push(key);
		} else {
			// kell prefix
			this.params_.keys.push(this.prefix+'['+key+']');
		}
	};
	this.clear = function () {
		this.params_ = {"keys":[],"values":[]};
	}
	for (var i in _params) {
		eval('this.' + i + ' = _params[\'' + i + '\'];');
	}
	this.init = function () {
		this.request = new Request();
		this.request.url = this.url;
		// ha egyszer box-ra jott a valasz akkor kov is arra lesz imho
		//delete this.box;
	};
	this.init2 = function () {
	};
	this.init();
}

function Ajax(objectName,_params) {
	this.objectName = objectName;
	this.successMethod = function () {};
	this.errorMethod = function () {};
	this._send = function () { return true; };
	this.params_ = {"keys":[],"values":[]};
	this.url = null;
	this.sendable = function () {
		if (this.request.obj.readyState != 0){
			return false;
		} else {
			return true;
		}
	};

	this.send = function (obj) {
		if (!this.sendable()){
			//this.request.obj.abort();
			this.init();
		}

		if (this._send(obj) === false) {
			return false;
		}

		this.request.obj.open(this.request.method, this.url, this.request.async);				
		this.request.obj.onreadystatechange = this.request.generateFunction(this.objectName,"httpReturn");
		this.request.obj.setRequestHeader('Content-Type','application/x-www-form-urlencoded;');	
		this.request.obj.send(this.request.arrayToRequest(this.params_));
		this.params_ = {"keys":[],"values":[]};
		return true;

	};

	this.httpReturn = function (){			
		if (this.request.obj.readyState != 4) {
			return true;
		}
		if (this.request.obj.status != 200) {
			this.errorMethod(this.request.obj,this._params);
		} else {
			this.successMethod(this.request.obj);	
			this.init();
		}
		return false;
	};

	this.addParam = function (keys,values) {
		// id paramétert új keretrendszerbe nem eszi meg, nem jön rá válasz, pedig igen, vagy mégsem
		if (typeof values == 'object') {
			for (var i=0;i<values.length ;i++ ) {
				this.params_.values.push(values[i]);
			}
		} else if (typeof values == 'string' || typeof values == 'number') {
			this.params_.values.push(values);
		}
		// ha a values object, akkor az az eset áll fent pl: dates[] -> [2006],[2007],[2008]
		if (typeof keys == 'object') {
			for (var i=0;i<keys.length ;i++ ) {
				//this.params_.keys.push(keys[i]);
				this.addKey(keys[i]);
			}
		} else if (typeof keys == 'string' || typeof keys == 'number') {
			// tehát ha a values object, akkor ezt is megismételjük annyiszor
			if (typeof values == 'object') {
				for (var i=0;i<values.length ;i++ ) {
					//this.params_.keys.push(keys);
					this.addKey(keys);
				}
			} else {
				//this.params_.keys.push(keys);
				this.addKey(keys);
			}
		}

	};
	this.addKey = function (key) {
		if (this.prefix == null) {
			this.params_.keys.push(key);
		} else {
			// kell prefix
			this.params_.keys.push(this.prefix+'['+key+']');
		}
	};

	this.init = function () {
		this.request = new Request();
		this.request.url = this.url;
	};
	this.init();


}
//var Ajax = new Ajax();

function List () {
	this.objectName = 'List';
	this.button_value = ['first','prev','next','last'];
	this.button_text = ['< Első','< Elöző','Következő >','Utolsó >'];
	//this.offset = 0;
	this.params = {"keys":[],"values":[]};
	this.url = null;
	this.container_id = null;
	this.container = null;
	this.el = {};
	this.item = null;
	this.item_fields_text = [];
	this.item_fields_id = [];
	this._change = true;
	this.loading = null;
	this.rs_id = '';
	this.params_id = [];
	this.successMethod = function (xmlhttpResp,_params) {
		if (this.loading != null) {
			Utils.hide(this.loading);
		}
		if (json=Utils.evalJson(xmlhttpResp.responseText)) {
			if (json.status != 0) {
				Utils.setError('Hiba: '+json.errors[0]+xmlhttpResp.responseText);
			} else {
				List.setData(json.data);
			}
		}
		//var html = xmlhttpResp.responseText;
		//Utils.ge(this.container).innerHTML = html;
	};
	this.httpReturn = function (){			
		if (this.request.obj.readyState != 4) {
			return true;
		}
		if (this.request.obj.status != 200) {
			if (typeof(this.errorMethod)=='undefined')	{					
				this.defaultFailed(this.request.obj);
			} else {					
				this.errorMethod(this.request.obj,this._params);
			}
		} else {
			//var obj=this.request.obj;
			//delete this.request.obj;
			this.successMethod(this.request.obj,this._params);				
		}
		return false;
	};
	this.change = function () {
		var els = this.el.change.getElementsByTagName('input');
		for (var i=0 ; i < els.length ; i++) {
			els[i].disabled = this._change;
		}
		var els = this.el.change.getElementsByTagName('select');
		for (var i=0 ; i < els.length ; i++) {
			els[i].disabled = this._change;
		}
		this._change = !this._change;
	};
	this.init = function () {
		this.container = Utils.ge(this.container_id);
		// disabled
		this.el.change = Utils.ge('filters_change');
		this.change();

		this.thead = Utils.ge('list_thead').getElementsByTagName('thead')[0];
		this.item = Utils.ge('list_item').getElementsByTagName('tr')[0];
		// addText
		var tags = this.item.getElementsByTagName('*');
		for (var i=0 ; i < tags.length ; i++) {
			if (tags[i].getAttribute('_action') != null && tags[i].getAttribute('_action') == 'setText') {
				this.item_fields_text.push(tags[i].className);
			}
		}
		// addId
		for (var i=0 ; i < tags.length ; i++) {
			if (tags[i].getAttribute('_action') != null && tags[i].getAttribute('_action') == 'setId') {
				this.item_fields_id.push(tags[i].className);
				
			}
		}
		//setMultipleParams
		for (var i=0 ; i < tags.length ; i++) {
			if (tags[i].getAttribute('_action') != null && tags[i].getAttribute('_action') == 'setMultipleParams') {
				this.item_fields_id.push(tags[i].className);
				
			}
		}
		
		// loading
		if (Utils.he('loading')) {
			this.loading = Utils.ge('loading');
		}
		this.request = new Request();
		this.request.url = this.url;
	};
	this.setData = function (data) {
		Utils.destroy(this.el.table);
		Utils.destroy(this.el.pager);
		this.el.pager = Utils.addElement(this.container,'div',['class','style'],['pager','text-align:center;']);
		this.setPager(data.pager);
		this.el.table = Utils.addElement(this.container,'table',['class'],['list']);
		this.el.table.appendChild(this.thead.cloneNode(true));
		this.el.table_tbody = Utils.addElement(this.el.table,'tbody');
		for (var i in data.data) {
			this.addRow(data.data[i]);
		}
	};
	this.setPager = function (pager) {
		this.el.title = Utils.addElement(this.el.pager,'div',['style'],['font-weight:bold;']);
		Utils.addText(this.el.title,pager.allNum + 'db találat');
		this.el.first = Utils.addElement(this.el.pager,'div');
		// first prev next last 
		for (var i = 0; i < this.button_value.length ; i++) {
			if (pager[this.button_value[i]].status) {
				// link-nek kell lennie
				Utils.addText(Utils.addElement(Utils.addElement(this.el.first,'span',['style'],['margin:0px 10px;']),'a',['href'],['javascript:List.send('+pager[this.button_value[i]].link+')']),this.button_text[i]);
			} else {
				Utils.addText(Utils.addElement(this.el.first,'span',['style'],['margin:0px 10px;']),this.button_text[i]);
			}
			if (this.button_value[i] == 'prev') {
				Utils.addElement(this.el.first,'span',['style'],['margin:0px 15px;']);
			}
		}
		//Utils.addText(this.el.first,pager.allNum);
		// a számok
		this.el.pages = Utils.addElement(this.el.pager,'div');
		for (var i in pager.pages) {
			var page = pager.pages[i];
			if (page.status) {
				// link-nek kell lennie
				Utils.addText(Utils.addElement(Utils.addElement(this.el.pages,'span',['style'],['margin:0px 3px;']),'a',['href'],['javascript:List.send('+page.link+')']),page.num);
			} else {
				Utils.addText(Utils.addElement(this.el.pages,'span',['style'],['margin:0px 3px;']),page.num);
			}
		
		}
	};
	this.addRow = function(data) { var field;
		var item = this.item.cloneNode(true);
		this.el.table_tbody.appendChild(item);
		for (var i in this.item_fields_text) {
			field = this.item_fields_text[i];
			Utils.addText(Utils.getElementByClassName(item,'*',field),data[field]);
		}
		for (var i = 0 ; i < this.item_fields_id.length ; i++) {
			field = this.item_fields_id[i];
			Utils.getElementByClassName(item,'*',field).setAttribute('_id',data[this.rs_id]);
		
		}
		if (Utils.isFunction(this._addRow)) {
			this._addRow(item,data);
		}
		/* hm? */
		for (var i = 0 ; i < this.item_fields_id.length ; i++) {
			field = this.item_fields_id[i];
			if(data[this.type] == true){
				//type = 1;
			}else{
				//type = 2;
			}
			Utils.getElementByClassName(item,'*',field).setAttribute('_type',data[this.type]);
		}
		if(Utils.ge('tr_id') != undefined){
			for (var i = 0 ; i < this.item_fields_id.length ; i++) {
				field = this.item_fields_id[i];
		
				Utils.getElementByClassName(item,'*',field).setAttribute('_tr_id',Utils.ge('tr_id').value);
			
			}
		}
	};
	this.send = function (offset) {
		// végig menni a meghatározott mezőkön... (ha disabled akkor ne adjuk hozzá)
		//this.addParam('limit',Utils.ge('filter').value);
		Utils.setRequestArray(Utils.ge('limit'),this.params);
		if (typeof role != 'undefined') {
			this.addParam('filter[role]',role);
		}
		
		if (Utils.isFunction(this._send)) {
			this._send();
		}
		if(Utils.ge('tr_id') != undefined){
			this.addParam('tr_id',Utils.ge('tr_id').value);
		}
		if (Utils.ge('filter').checked == true) {
			this.addParam('filter['+Utils.ge('filter_name').value+']',Utils.ge('filter_text').value);
		}

		
		if (offset != false) { // tehát ha nem false jött, akkor küldünk offset-et is
			this.params.keys.push('offset');
			this.params.values.push(offset);
		}
		if (this.loading != null) {
			Utils.show(this.loading);
		}
		this.request.obj.open(this.request.method, this.request.url, this.request.async);				
		this.request.obj.onreadystatechange = this.request.generateFunction(this.objectName,"httpReturn");
		this.request.obj.setRequestHeader('Content-Type','application/x-www-form-urlencoded;');	
		this.request.obj.send(this.request.arrayToRequest(this.params));
		//console.log(this.params);
		this.params = {"keys":[],"values":[]};
	};
/*
	for (var i in _params) {
		eval('this.' + i + ' = _params[\'' + i + '\'];');
	}	
*/
	this.addFilters = function (object) {
		var filters = object.filters;
		for (var i = 0; i < filters.length ; i++) {
			var filter = filters[i];
			var el = Utils.addElement(Utils.ge(this.filter_id),filter.tagName);
			this.filters.push(el);
			el.setAttribute('name','filters['+i+']');
			if (filter.tagName == 'select')	{
				for ( var j = 0;j < filter.texts.length ; j++) {
					Utils.addOption(el,filter.texts[j],j);
				}
			}
		}
	};
	this.addParam = function (keys,values) {
		if (typeof values == 'object') {
			for (var i=0;i<values.length ;i++ ) {
				this.params.values.push(values[i]);
			}
		} else if (typeof values == 'string' || typeof values == 'number') {
			this.params.values.push(values);
		}
		// ha a values object, akkor az az eset áll fent pl: dates[] -> [2006],[2007],[2008]
		if (typeof keys == 'object') {
			for (var i=0;i<keys.length ;i++ ) {
				//this.params.keys.push(keys[i]);
				this.addKey(keys[i]);
			}
		} else if (typeof keys == 'string' || typeof keys == 'number') {
			// tehát ha a values object, akkor ezt is megismételjük annyiszor
			if (typeof values == 'object') {
				for (var i=0;i<values.length ;i++ ) {
					//this.params.keys.push(keys);
					this.addKey(keys);
				}
			} else {
				//this.params.keys.push(keys);
				this.addKey(keys);
			}
		}

	};
	this.addKey = function (key) {
		if (this.prefix == null) {
			this.params.keys.push(key);
		} else {
			// kell prefix
			this.params.keys.push(this.prefix+'['+key+']');
		}
	}
	function setAttribs(element, attribs){  
	    //Végiglépkedünk az attribs objektum elemein  
		for (var i in attribs){  
			if (typeof attribs[i] == "object"){  
				//Az elem szintén objektum, meghívjuk erre is a függvényt  
				setAttribs(element, attribs[i]);  
			}else {  
				//Az elem adott tulajdonságának megváltoztatása.  
			try{ element[i] = attribs[i]; } catch(err){}  
			}  
		}  
	};
}
var List = new List();

function SmartList () {
	this.objectName = 'SmartList';
	this.button_value = ['first','prev','next','last'];
	this.button_text = ['< Első','< Elöző','Következő >','Utolsó >'];
	this.offset = 0;
	this.params = {"keys":[],"values":[]};
	this.filters = [];
	this.url = null;
	this.id = null;
	this.setLoading = null;
	this.container = null;
	this.el = {};
	this._limit = 10;
	this.item = null;
	this.item_fields_text = [];
	this.item_fields_id = [];
	this.data = null;
	this._change = true;
	this.rs_id = '';
	this.params_id = [];
	this._init = function () {}
	this._send = function () {}
	this.jsonError = function () {}
	this.loading = function () {
		if (this.setLoading) {
			// aktualis magassag beallitasa, mert a 100% nem jo
			this.el.loading.style.height = this.el.loading.parentNode.offsetHeight+'px';
			Utils.show(this.el.loading);
		}
	};
	this.loaded = function () {
		if (this.setLoading) {
			Utils.hide(this.el.loading);
		}
	};
	this.successMethod = function (xmlhttpResp,_params) {
		SmartList.loaded();
		if (json=Utils.evalJson(xmlhttpResp.responseText)) {
			if (json.status != 0) {
				Utils.setError('Hiba: '+json.errors[0]+xmlhttpResp.responseText);
			} else {
				SmartList.setData(json.data);
			}
		} else {
			this.jsonError();
		}
		//var html = xmlhttpResp.responseText;
		//Utils.ge(this.container).innerHTML = html;
	};
	this.httpReturn = function (){			
		if (this.request.obj.readyState != 4) {
			return true;
		}
		if (this.request.obj.status != 200) {
			if (typeof(this.errorMethod)=='undefined')	{					
				this.defaultFailed(this.request.obj);
			} else {					
				this.errorMethod(this.request.obj,this._params);
			}
		} else {
			//var obj=this.request.obj;
			//delete this.request.obj;
			this.successMethod(this.request.obj,this._params);				
		}
		return false;
	};
	this.init = function () {
		Utils.resetValid();
		Utils.valid(Utils.ge(this.id+'_container'),'Nincs meg a container');
		Utils.valid(Utils.ge(this.id+'_pager'),'Nincs meg a pager');
		Utils.valid(Utils.ge(this.id+'_table'),'Nincs meg a table');

		if (!Utils.isValid()) {
			console.log(Utils._valid);
			return false;
		}
		this.container = Utils.ge(this.id+'_container');
		this.el.pager = Utils.ge(this.id+'_pager');
		this.el.table = Utils.ge(this.id+'_table');

		if (Utils.isFunction(this.setElement)) {
			this.setElement();
		}

		if (this.setLoading) {
			var div = document.createElement('div');
			div.setAttribute('style','padding-top:50px;position:absolute;text-align:center;height:100%;width:830px;background-color:#aaa;opacity: 0.8;-moz-opacity:0.8;');
			div.innerHTML = '<img src="'+WEB_IMAGES_DIR+'loading4.gif">';
			Utils.hide(div);
			this.el.loading = div;
			//this.container.insertBefore(div,this.container.childNodes[0]);
			// a message_container elé
			this.container.parentNode.insertBefore(div,this.container);
		}

		this.thead = this.container.getElementsByTagName('thead')[0];
		if (this.container.getElementsByTagName('tfoot').length == 0) {
			this.el.tfoot = this.container.getElementsByTagName('tfoot');
		}
		this.item = this.el.table.getElementsByTagName('tbody')[0].getElementsByTagName('tr')[0].cloneNode(true);
		this.el.table_tbody = this.el.table.getElementsByTagName('tbody')[0];
		//Common.debug(2,this.el.table_tbody.innerHTML);
		//console.log(this.item);
		// addText
		var tags = this.item.getElementsByTagName('*');
		for (var i=0 ; i < tags.length ; i++) {
			if (tags[i].getAttribute('_action') != null && tags[i].getAttribute('_action') == 'setText') {
				this.item_fields_text.push(tags[i].className);
			}
		}
		// addId
		for (var i=0 ; i < tags.length ; i++) {
			if (tags[i].getAttribute('_action') != null && tags[i].getAttribute('_action') == 'setId') {
				this.item_fields_id.push(tags[i].className);
			}
		}
		this.loading();
		this.request = new Request();
		this.request.url = this.url;
		this._init();
	};
	this.setData = function (data) {
		if (Utils.isFunction(this._setData)) {
			this._setData(data);
		}
		this.data = data.data;
		Utils.show(this.container);
		//Common.debug(2,this.el.table.);
		Utils.destroy(this.el.table.getElementsByTagName('tbody')[0]);
		this.el.table_tbody = document.createElement('tbody');
		this.el.table.appendChild(this.el.table_tbody);
		//Utils.removeChilds(this.el.table_tbody);
		//console.log(this.el.table_tbody.innerHTML);
		//this.el.table_tbody.innerHTML = '';
		//var tbody = document.createElement('tbody');
		//Utils.destroy(this.el.table_tbody);
		//this.el.table.insertBefore(tbody,this.el.t
		this.setPager(data.pager);
		for (var i in data.data) {
			this.addRow(i,data.data[i]);
		}
		if (Utils.isFunction(this.setData_)) {
			this.setData_(data);
		}
	};
	this.setPager = function (pager) {
		this.el.pager.innerHTML  = '';
		this.el.title = Utils.addElement(this.el.pager,'div',['class'],['title']);
		Utils.addText(this.el.title,pager.allNum + 'db találat');
		this.el.first = Utils.addElement(this.el.pager,'div');
		// first prev next last 
		for (var i = 0; i < this.button_value.length ; i++) {
			if (pager[this.button_value[i]].status) {
				// link-nek kell lennie
				Utils.addText(Utils.addElement(Utils.addElement(this.el.first,'span',['style'],['margin:0px 10px;']),'a',['href'],['javascript:SmartList.send('+pager[this.button_value[i]].link+')']),this.button_text[i]);
			} else {
				Utils.addText(Utils.addElement(this.el.first,'span',['style'],['margin:0px 10px;']),this.button_text[i]);
			}
			if (this.button_value[i] == 'prev') {
				Utils.addElement(this.el.first,'span',['style'],['margin:0px 15px']);
			}
		}
		//Utils.addText(this.el.first,pager.allNum);
		// a számok
		this.el.pages = Utils.addElement(this.el.pager,'div');
		for (var i in pager.pages) {
			var page = pager.pages[i];
			if (page.status) {
				// link-nek kell lennie
				Utils.addText(Utils.addElement(Utils.addElement(this.el.pages,'span',['style'],['margin:0px 3px']),'a',['href'],['javascript:SmartList.send('+page.link+')']),page.num);
			} else {
				Utils.addText(Utils.addElement(this.el.pages,'span',['style','class'],['margin:0px 3px','active']),page.num);
			}
		
		}
	};
	this.addRow = function(num,data) { var field;
		var item = this.item.cloneNode(true);
		item.id = this.id + '_' + num;
		item.setAttribute('_id',num);
		Utils.addClass(item, (num % 2 == 1 ? 'even' : 'odd'));
		this.el.table_tbody.appendChild(item);
		for (var i in this.item_fields_text) {
			field = this.item_fields_text[i];
			Utils.setValue(Utils.getElementByClassName(item,'*',field),data[field]);
		}
		for (var i = 0 ; i < this.item_fields_id.length ; i++) {
			field = this.item_fields_id[i];
			Utils.getElementByClassName(item,'*',field).setAttribute('_id',data[this.rs_id]);
		}

		if (Utils.isFunction(this._addRow)) {
			this._addRow(item,data);
		}

	};
	this.send = function (offset) {
		this._send();
		// végig menni a meghatározott mezőkön... (ha disabled akkor ne adjuk hozzá)
		//this.addParam('limit',Utils.ge('filter').value);
		if (Utils.ge('limit')) {
			Utils.setRequestArray(Utils.ge('limit'),this.params);
		} else {
			this.addParam('limit',this._limit);
		}
		//this.addParam('filter[role]',role);
		//if (Utils.ge('filter').checked == true) {
		//	this.addParam('filter['+Utils.ge('filter_name').value+']',Utils.ge('filter_text').value);
		//}

/*		var el;
		for (var i in this.params_id) {
			el = Utils.ge(this.params_id[i]);
			if (el.disabled == false) {
				Utils.setRequestArray(el,this.params);
			}
		}*/
		if (this.smartAction) {
			this.addParam('smartAction',this.smartAction);
		}
		if (offset !== false) { // tehat ha nem false jott, akkor kuldunk offset-et is
			this.params.keys.push('offset');
			this.params.values.push(offset);
		} else {
			this.params.keys.push('offset');
			this.params.values.push(this.offset);
		}
		// a meghatározott filters-en végig menni és hozzáadni
		for (var i = 0 ; i < this.filters.length ; i++)	{
			this.addParam('filter['+this.filters[i].getAttribute('name')+']',Utils.getValue(this.filters[i]));
		}
		this.loading();
		this.request.obj.open(this.request.method, this.request.url, this.request.async);				
		this.request.obj.onreadystatechange = this.request.generateFunction(this.objectName,"httpReturn");
		this.request.obj.setRequestHeader('Content-Type','application/x-www-form-urlencoded;');	
		this.request.obj.send(this.request.arrayToRequest(this.params));
		//console.log(this.params);
		this.params = {"keys":[],"values":[]};
	};
/*
	for (var i in _params) {
		eval('this.' + i + ' = _params[\'' + i + '\'];');
	}	
*/
	this.addFilters = function (object) {
		var filters = object.filters;
		for (var i = 0; i < filters.length ; i++) {
			var filter = filters[i];
			var el = Utils.addElement(Utils.ge(this.filter_id),filter.tagName);
			this.filters.push(el);
			el.setAttribute('name','filters['+i+']');
			if (filter.tagName == 'select')	{
				for ( var j = 0;j < filter.texts.length ; j++) {
					Utils.addOption(el,filter.texts[j],j);
				}
			}
		}
	};
	this.addParam = function (keys,values) {
		if (typeof values == 'object') {
			for (var i=0;i<values.length ;i++ ) {
				this.params.values.push(values[i]);
			}
		} else if (typeof values == 'string' || typeof values == 'number') {
			this.params.values.push(values);
		}
		// ha a values object, akkor az az eset áll fent pl: dates[] -> [2006],[2007],[2008]
		if (typeof keys == 'object') {
			for (var i=0;i<keys.length ;i++ ) {
				//this.params.keys.push(keys[i]);
				this.addKey(keys[i]);
			}
		} else if (typeof keys == 'string' || typeof keys == 'number') {
			// tehát ha a values object, akkor ezt is megismételjük annyiszor
			if (typeof values == 'object') {
				for (var i=0;i<values.length ;i++ ) {
					//this.params.keys.push(keys);
					this.addKey(keys);
				}
			} else {
				//this.params.keys.push(keys);
				this.addKey(keys);
			}
		}

	};
	this.addKey = function (key) {
		if (this.prefix == null) {
			this.params.keys.push(key);
		} else {
			// kell prefix
			this.params.keys.push(this.prefix+'['+key+']');
		}
	}
	function setAttribs(element, attribs){  
	    //Végiglépkedünk az attribs objektum elemein  
		for (var i in attribs){  
			if (typeof attribs[i] == "object"){  
				//Az elem szintén objektum, meghívjuk erre is a függvényt  
				setAttribs(element, attribs[i]);  
			}else {  
				//Az elem adott tulajdonságának megváltoztatása.  
			try{ element[i] = attribs[i]; } catch(err){}  
			}  
		}  
	};
}
var SmartList = new SmartList();


var NOTICE = 1;
var NOERROR = 0;
function Errors() {
	//debug level
	this.fields = [];
	this.debug = 0;
	this._errors=new Array();
	this.validate = function (id,rule,msg) {
		//this.rules.push({id:id,rule:rule,msg:msg});
		if (!Utils.he(id)) {
			this._errors.push(msg);
			return true;
			Utils.setError('nincs ilyen id: ',id);
		}
		//console.log(rule);
		var value = Utils.ge(id).value;
		if (this.debug==NOTICE) {
			console.log(Utils.ge(id));
			console.log('value:"'+value+'"');
			console.log('eval:this.'+rule+'('+value+')');
		}
		// nem tudom miért, mind1... talán a NULL -t valamiért nem stringnek veszi
		if (value == 'NULL') {
			value = '';
		}
		if (!eval('this.'+rule+'(value)')) {
			if (this.debug==NOTICE) {
				console.log(msg);
			}
			this._errors.push(msg);
		}
	};
	

	this.hasError = function () {
		return this._errors.length==0;
	};
	this.hasErrors = this.hasError;
	this.getErrors = function () {
		var errors='';
		for (var i=0; i<this._errors.length;i++ ) {
			if (this.debug==NOTICE) {
				console.log('error'+i+': '+this._errors[i]);
			}
			errors+=this._errors[i]+"\n";
		}
		this._errors=new Array();
		return errors;
	};


	// Rules List //
	this.notEmpty = function (value) {
		if (this.debug==NOTICE) {
			console.log('notempty error value:'+value,value);
		}
		if (typeof value=='undefined') {
			return false
		}
		if (value=='') {
			return false;
		}
		return true;
	};
	this.date = function (sDate) {

	   var re =/^\d{4}\-\d{2}\-\d{2}$/
	   if (re.test(sDate)) {
			return true;
		}else {
			 return false;
		}
	};
	this.time = function (value) {

	   var re =/^\d{2}\:\d{2}$/
	   if (re.test(value)) {
			return true;
		}else {
			 return false;
		}
	};
	this.clearErrors = function () {
		//eltüntetni az esetleges hibákat
		var divs = Utils.getElementArrayByClassName(document,'div','private-form-errors');
		for (var i in divs) {
			Utils.destroy(divs[i]);
		}
	};
	this.setErrorsToElements = function (errors) {
		//"errors":{"ci[student]":["K\u00f6telez\u0151 megadni!","'' nem csak sz\u00e1mokat tartalmaz!"]}
		for (var i in errors) {
			var div = document.createElement('div');
			div.className = 'private-form-errors';
			//bekéne rakni az összes hibát
			eval('var error = errors[\''+i+'\']');
			for (var j in error) {
				div.innerHTML += error[j]+'<br>';
			}
			//div.innerHTML = eval('errors[\''+i+'\'][0]');
			Utils.ge(i).parentNode.insertBefore(div,Utils.ge(i).nextSibling);
		}
	};
}
Errors = new Errors();
Errors.debug = NOERROR;


function SmartHistory() {
	this.enable = false;
	this.timeOut_ = 200;
	this.timeOut = null;
	this.firstTime = true;
	this.hash = null;
	this.change = true;
	this.changeHash = function () {};
	this.start = function () {
		this.enable = true;
		this.timeOut = setTimeout(function () { SmartHistory.load(); },this.timeOut_);
	}
	this.load = function () {
		var old_hash = this.hash;
		this.hash = this.getHash();
		if (this.firstTime) {
			this.start();
			this.firstTime = false;
			return;
		}
		if (!this.change) {
			this.change = !this.change;
			this.start();
			return;
		}
		if (this.hash != old_hash)	{
			this.changeHash(this.hash);
		}
		this.start();

	}
	this.getHash = function() {
		var hashValue = window.location.hash;
      if (hashValue == null || hashValue == undefined)
         return null;
      else if (hashValue == "")
         return "";
      else if (hashValue.length == 1 && hashValue.charAt(0) == "#")
         return "";
      else if (hashValue.length > 1 && hashValue.charAt(0) == "#")
         return hashValue.substring(1);
      else
         return hashValue;     
   }     
   this.removeHash = function () {
		if (!this.enable) {	return false; }
		this.change = false;
		if (window.location.hash != '') {
			window.location.hash = '';
		}
   }
   this.setHash = function (hash) {
		if (!this.enable) {	return false; }
		this.change = false;
		window.location.hash = hash;
   }

}
var SmartHistory = new SmartHistory();

function SmartForm () {
	this.id = null;
	this.url = null;
	this.el = [];
	this.saved = function () {};
	this.init = function () {
		if (!Utils.ge(this.id))	{
			Common.log('Nincs meg a form');
			return false;
		}
		if (!this.url)	{
			Common.log('Url nincs beállítva');
			return false;
		}
		this.el.form = Utils.ge(this.id);

		this.json = new Json('SmartForm.json');
		this.json.url = this.url;
		this.json.smartSuccessMethod = function (json) { SmartForm.saved(json); };
	}
	this.send = function () {
		if (Utils.isFunction(this._send)) {
			if (this._send() === false)	{
				return;
			}
		}
		var form = this.el.form;
		var input = form.getElementsByTagName('input');
		for (var i = 0; i< input.length ; i++) {
			this.json.addParam(input[i].name,Utils.getValue(input[i]));
		}
		var textarea = form.getElementsByTagName('textarea');
		for (var i = 0; i< textarea.length ; i++) {
			this.json.addParam(textarea[i].name,Utils.getValue(textarea[i]));
		}
		this.json.send();
	}
}
var SmartForm = new SmartForm();

function SmartSelect() {
	var els = Utils.getElementsByClassNameSmart('smartSelect');
	for (var i = 0; i < els.length ; i++) {
		var el = els[i];
		eval('window.'+el.id+'Json = new Json(\''+el.id+'Json\')');
		var object = eval(el.id+'Json');
		object.smartSuccessMethod = function (resp) {
			Utils.fillSelectJson(el,resp.data,'id','text',{text:'Válasszon!',value:''});
		}

		//todo validalas
		object.url = el.getAttribute('url');
		object.send();

		if (el.getAttribute('to_select'))	{
			var onchange = function() {
				var object_name = el.getAttribute('to_select');
				var second_object = Utils.ge(object_name);
				eval('window.'+object_name+'Json = new Json(\''+object_name+'Json\')');
				var json = eval(object_name+'Json');
				json.addParam(second_object.getAttribute('param'),el.options[el.selectedIndex].value);
				json.url = second_object.getAttribute('url');
				json.smartSuccessMethod = function (resp) {
					Utils.fillSelectJson(second_object,resp.data,'id','text',{text:'Válasszon!',value:''});
					Heading.refresh();
				}
				json.send();
			};
			Utils.addEvent(el,'change',onchange)
			if (el.getAttribute('_id') && !isNaN(parseInt(el.getAttribute('_id')))) {
				setTimeout(onchange,1000);
			}
		}
	}
}

Utils.addEvent(window,'load',function () { 
	SmartSelect();
	//SaveText();
	if (typeof init_SearchUser != 'undefined' && Utils.isFunction(init_SearchUser))	{
		init_SearchUser();
	}
	if (typeof gallery_init != 'undefined' && Utils.isFunction(gallery_init))	{
		gallery_init();
	}
	if (typeof init != 'undefined' && Utils.isFunction(init)) {
		init();
	}
	if (typeof init1 != 'undefined' && Utils.isFunction(init1))	{
		init1();
	}
	if (typeof init2 != 'undefined' && Utils.isFunction(init2))	{
		init2();
	}
	if (typeof initdhtml != 'undefined' && Utils.isFunction(initdhtml))	{
		initdhtml();
	}
	
});

Common = {};
Common.alert = function (msg) {
	alert(msg);
}
Common.debug = function (num,text) {
	if (typeof debug != 'undefined' && debug == 2) {
		Common.log(text);
	}
}

Common.error = Common.alert;
Common.log = Common.alert;



function SaveText() {
	Utils.execObject(Utils.getElementsByClassNameSmart('SaveText'),SaveTextObject);
}

function SaveTextObject(obj) {
	this.text = null;
	this.input = null;
	this.init = function (obj) {
		//alert(obj.getAttribute('savetext'));
		if (obj.getAttribute('savetext') && obj.getAttribute('savetext')=='true') {
			return true;
		}
		this.obj = $(obj);
		if (this.text !== null) {
			this.obj.innerHTML = this.text;
		}
		this.obj.style.cursor = 'pointer';
		this.obj.setAttribute('savetext','true');
		this.obj.addEventObject(this,'click',function (obj,ref) { this.click(obj,ref); } );
	}

	this.click = function (obj,ref) {
		//console.log(obj.innerHTML);
		this.text = obj.innerHTML;
		//obj = $(obj);
		// add input
		obj.innerHTML = '';
		this.input = HTML('input').setValue(this.text).add(this.obj);
		//this.input = document.createElement('input');
		this.input.type = 'text';
		try {
			this.input.setAttribute('type','text');
		}
		catch (err){}
		this.input.focus();
		// remove event click
		if (ref) {
			this.obj.removeEventRef('click',ref);
		}
		// add event blur
		this.input.addEventObject(this,'blur',function (obj) { this.save(); } );
	}
	this.save = function (obj) {
		this.json = new Json();
		this.json.url = this.obj.getAttribute('_url');
		this.json.addParam('id',this.obj.getAttribute('_id'));
		// isti miatt kellett beleegetni
		// igazabol a tobbit is atkuldhetne ami van
		if (this.obj.getAttribute('_dir_id')) {
			this.json.addParam('dir_id',this.obj.getAttribute('_dir_id'));
		}
		this.json.addParam('text',this.input.value);
		var object = this;
		this.json.smartSuccessMethod = function() { object.saved(); };
		this.json.send();

		this.saved_text = this.input.value;

		// this.obj click event törlése
	}
	this.saved = function(json) {
		this.text = this.saved_text;
		this.obj.setAttribute('savetext','false');
		this.init(this.obj);
	}

	this.init(obj);
}

/*

function $(element) {
  if (arguments.length > 1) {
    for (var i = 0, elements = [], length = arguments.length; i < length; i++)
      elements.push($(arguments[i]));
    return elements;
  }
  if (typeof element == "string")
    element = document.getElementById(element);

  element.getElementsByClassNameSmart = function(className, tag, elm) {
	var testClass = new RegExp("(^|\\s)" + className + "(\\s|$)");
	var tag = tag || "*";
	var elm = elm || document;
	var elements = (tag == "*" && elm.all)? elm.all : elm.getElementsByTagName(tag);
	var returnElements = [];
	var current;
	var length = elements.length;
	for(var i=0; i<length; i++){
		current = elements[i];
		if(testClass.test(current.className)){
			returnElements.push(current);
		}
	}
	return returnElements;
	};

	element.exec = function(object,command) {
		for (var i=0; i < this.length; i++) {
			command.call(object,this[i]);
		}
	};

	element.addEvent = function (evType, fn) {
		if (this.addEventListener) {
			this.addEventListener(evType, function(event) { fn(this,event); }, true);
			return true;
		} else if (this.attachEvent) {
			var r = this.attachEvent("on"+evType, function(event) { fn(this,event); });
			return r;
		} else {
			return false;
		}
	};
	element.addEventObject = function (object,evType, fn) {
		if (this.addEventListener) {
			this.addEventListener(evType, function(event) { fn.call(object,this,arguments.callee,event); }, true);
			return true;
		} else if (this.attachEvent) {
			var r = this.attachEvent("on"+evType, function(event) { fn.call(object,Utils.click(event),arguments.callee,event); });
			//var r = this.attachEvent("on"+evType, function(event) { console.log(event); console.log(Utils.click(event)); });
			return r;
		} else {
			return false;
		}
	};
	element.removeEventRef = function (type,fn){
	  if(this.removeEventListener) { 
		  this.removeEventListener(type,fn,true);
	  } else if(this.detachEvent) {
		this.detachEvent("on"+type,fn);
		this[type+fn]=null;
		this["e"+type+fn]=null;
	  }
	}
	element.setText = function (value) {
		var value = document.createTextNode(value);
		this.appendChild(value);
		return this;
	};
	element.setValue = function (value) {
		this.value = value;
		return this;
	};
	element.add = function (el) {
		el.appendChild(this);
		return this;
	};
	element.show = function () {
	    this.style.display = '';
		return this;
	}
	element.hide = function () {
	    this.style.display = 'none';
		return this;
	}

  return element;
}


Array.prototype.exec = function(command) {
	for (var i=0; i < this.length; i++) {
		command(this[i]);
	}
};

function HTML (tag) {
	return $(document.createElement(tag));
};
*/
/*!
 * jQuery UI 1.8rc2
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI
 *//*
 * jQuery UI 1.8rc2
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI
 */
jQuery.ui||(function(b){var a=b.browser.mozilla&&(parseFloat(b.browser.version)<1.9);b.ui={version:"1.8rc2",plugin:{add:function(d,e,g){var f=b.ui[d].prototype;for(var c in g){f.plugins[c]=f.plugins[c]||[];f.plugins[c].push([e,g[c]])}},call:function(c,e,d){var g=c.plugins[e];if(!g||!c.element[0].parentNode){return}for(var f=0;f<g.length;f++){if(c.options[g[f][0]]){g[f][1].apply(c.element,d)}}}},contains:function(d,c){return document.compareDocumentPosition?d.compareDocumentPosition(c)&16:d!==c&&d.contains(c)},hasScroll:function(f,d){if(b(f).css("overflow")=="hidden"){return false}var c=(d&&d=="left")?"scrollLeft":"scrollTop",e=false;if(f[c]>0){return true}f[c]=1;e=(f[c]>0);f[c]=0;return e},isOverAxis:function(d,c,e){return(d>c)&&(d<(c+e))},isOver:function(h,d,g,f,c,e){return b.ui.isOverAxis(h,g,c)&&b.ui.isOverAxis(d,f,e)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};b.fn.extend({_focus:b.fn.focus,focus:function(c,d){return typeof c==="number"?this.each(function(){var e=this;setTimeout(function(){b(e).focus();(d&&d.call(e))},c)}):this._focus.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var c;if((b.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){c=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(b.curCSS(this,"position",1))&&(/(auto|scroll)/).test(b.curCSS(this,"overflow",1)+b.curCSS(this,"overflow-y",1)+b.curCSS(this,"overflow-x",1))}).eq(0)}else{c=this.parents().filter(function(){return(/(auto|scroll)/).test(b.curCSS(this,"overflow",1)+b.curCSS(this,"overflow-y",1)+b.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!c.length?b(document):c},zIndex:function(f){if(f!==undefined){return this.css("zIndex",f)}if(this.length){var d=b(this[0]),c,e;while(d.length&&d[0]!==document){c=d.css("position");if(c=="absolute"||c=="relative"||c=="fixed"){e=parseInt(d.css("zIndex"));if(!isNaN(e)&&e!=0){return e}}d=d.parent()}}return 0}});b.extend(b.expr[":"],{data:function(e,d,c){return !!b.data(e,c[3])},focusable:function(d){var e=d.nodeName.toLowerCase(),c=b.attr(d,"tabindex");return(/input|select|textarea|button|object/.test(e)?!d.disabled:"a"==e||"area"==e?d.href||!isNaN(c):!isNaN(c))&&!b(d)["area"==e?"parents":"closest"](":hidden").length},tabbable:function(d){var c=b.attr(d,"tabindex");return(isNaN(c)||c>=0)&&b(d).is(":focusable")}})})(jQuery);
/*!
 * jQuery UI Widget 1.8rc2
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Widget
 *//*
 * jQuery UI Widget 1.8rc2
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Widget
 */
(function(b){var a=b.fn.remove;b.fn.remove=function(c,d){return this.each(function(){if(!d){if(!c||b.filter(c,[this]).length){b("*",this).add(this).each(function(){b(this).triggerHandler("remove")})}}return a.call(b(this),c,d)})};b.widget=function(d,f,c){var e=d.split(".")[0],h;d=d.split(".")[1];h=e+"-"+d;if(!c){c=f;f=b.Widget}b.expr[":"][h]=function(i){return !!b.data(i,d)};b[e]=b[e]||{};b[e][d]=function(i,j){if(arguments.length){this._createWidget(i,j)}};var g=new f();g.options=b.extend({},g.options);b[e][d].prototype=b.extend(true,g,{namespace:e,widgetName:d,widgetEventPrefix:b[e][d].prototype.widgetEventPrefix||d,widgetBaseClass:h},c);b.widget.bridge(d,b[e][d])};b.widget.bridge=function(d,c){b.fn[d]=function(g){var e=typeof g==="string",f=Array.prototype.slice.call(arguments,1),h=this;g=!e&&f.length?b.extend.apply(null,[true,g].concat(f)):g;if(e&&g.substring(0,1)==="_"){return h}if(e){this.each(function(){var i=b.data(this,d),j=i&&b.isFunction(i[g])?i[g].apply(i,f):i;if(j!==i&&j!==undefined){h=j;return false}})}else{this.each(function(){var i=b.data(this,d);if(i){if(g){i.option(g)}i._init()}else{b.data(this,d,new c(g,this))}})}return h}};b.Widget=function(c,d){if(arguments.length){this._createWidget(c,d)}};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(d,e){this.element=b(e).data(this.widgetName,this);this.options=b.extend(true,{},this.options,b.metadata&&b.metadata.get(e)[this.widgetName],d);var c=this;this.element.bind("remove."+this.widgetName,function(){c.destroy()});this._create();this._init()},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled")},widget:function(){return this.element},option:function(e,f){var d=e,c=this;if(arguments.length===0){return b.extend({},c.options)}if(typeof e==="string"){if(f===undefined){return this.options[e]}d={};d[e]=f}b.each(d,function(g,h){c._setOption(g,h)});return c},_setOption:function(c,d){this.options[c]=d;if(c==="disabled"){this.widget()[d?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",d)}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(d,e,f){var h=this.options[d];e=b.Event(e);e.type=(d===this.widgetEventPrefix?d:this.widgetEventPrefix+d).toLowerCase();f=f||{};if(e.originalEvent){for(var c=b.event.props.length,g;c;){g=b.event.props[--c];e[g]=e.originalEvent[g]}}this.element.trigger(e,f);return !(b.isFunction(h)&&h.call(this.element[0],e,f)===false||e.isDefaultPrevented())}}})(jQuery);
/*!
 * jQuery UI Mouse 1.8rc2
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Mouse
 *
 * Depends:
 *	jquery.ui.widget.js
 *//*
 * jQuery UI Mouse 1.8rc2
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Mouse
 *
 * Depends:
 *	jquery.ui.widget.js
 */
(function(a){a.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var b=this;this.element.bind("mousedown."+this.widgetName,function(c){return b._mouseDown(c)}).bind("click."+this.widgetName,function(c){if(b._preventClickEvent){b._preventClickEvent=false;c.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(d){d.originalEvent=d.originalEvent||{};if(d.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(d));this._mouseDownEvent=d;var c=this,e=(d.which==1),b=(typeof this.options.cancel=="string"?a(d.target).parents().add(d.target).filter(this.options.cancel).length:false);if(!e||b||!this._mouseCapture(d)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){c.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(d)&&this._mouseDelayMet(d)){this._mouseStarted=(this._mouseStart(d)!==false);if(!this._mouseStarted){d.preventDefault();return true}}this._mouseMoveDelegate=function(f){return c._mouseMove(f)};this._mouseUpDelegate=function(f){return c._mouseUp(f)};a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(a.browser.safari||d.preventDefault());d.originalEvent.mouseHandled=true;return true},_mouseMove:function(b){if(a.browser.msie&&!b.button){return this._mouseUp(b)}if(this._mouseStarted){this._mouseDrag(b);return b.preventDefault()}if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,b)!==false);(this._mouseStarted?this._mouseDrag(b):this._mouseUp(b))}return !this._mouseStarted},_mouseUp:function(b){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(b.target==this._mouseDownEvent.target);this._mouseStop(b)}return false},_mouseDistanceMet:function(b){return(Math.max(Math.abs(this._mouseDownEvent.pageX-b.pageX),Math.abs(this._mouseDownEvent.pageY-b.pageY))>=this.options.distance)},_mouseDelayMet:function(b){return this.mouseDelayMet},_mouseStart:function(b){},_mouseDrag:function(b){},_mouseStop:function(b){},_mouseCapture:function(b){return true}})})(jQuery);
/*
 * jQuery UI Slider 1.8rc2
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Slider
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.mouse.js
 *	jquery.ui.widget.js
 */(function(b){var a=5;b.widget("ui.slider",b.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var c=this,d=this.options;this._keySliding=false;this._mouseSliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all");if(d.disabled){this.element.addClass("ui-slider-disabled ui-disabled")}this.range=b([]);if(d.range){if(d.range===true){this.range=b("<div></div>");if(!d.values){d.values=[this._valueMin(),this._valueMin()]}if(d.values.length&&d.values.length!=2){d.values=[d.values[0],d.values[0]]}}else{this.range=b("<div></div>")}this.range.appendTo(this.element).addClass("ui-slider-range");if(d.range=="min"||d.range=="max"){this.range.addClass("ui-slider-range-"+d.range)}this.range.addClass("ui-widget-header")}if(b(".ui-slider-handle",this.element).length==0){b('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle")}if(d.values&&d.values.length){while(b(".ui-slider-handle",this.element).length<d.values.length){b('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle")}}this.handles=b(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(e){e.preventDefault()}).hover(function(){if(!d.disabled){b(this).addClass("ui-state-hover")}},function(){b(this).removeClass("ui-state-hover")}).focus(function(){if(!d.disabled){b(".ui-slider .ui-state-focus").removeClass("ui-state-focus");b(this).addClass("ui-state-focus")}else{b(this).blur()}}).blur(function(){b(this).removeClass("ui-state-focus")});this.handles.each(function(e){b(this).data("index.ui-slider-handle",e)});this.handles.keydown(function(j){var g=true;var f=b(this).data("index.ui-slider-handle");if(c.options.disabled){return}switch(j.keyCode){case b.ui.keyCode.HOME:case b.ui.keyCode.END:case b.ui.keyCode.PAGE_UP:case b.ui.keyCode.PAGE_DOWN:case b.ui.keyCode.UP:case b.ui.keyCode.RIGHT:case b.ui.keyCode.DOWN:case b.ui.keyCode.LEFT:g=false;if(!c._keySliding){c._keySliding=true;b(this).addClass("ui-state-active");c._start(j,f)}break}var h,e,i=c._step();if(c.options.values&&c.options.values.length){h=e=c.values(f)}else{h=e=c.value()}switch(j.keyCode){case b.ui.keyCode.HOME:e=c._valueMin();break;case b.ui.keyCode.END:e=c._valueMax();break;case b.ui.keyCode.PAGE_UP:e=h+((c._valueMax()-c._valueMin())/a);break;case b.ui.keyCode.PAGE_DOWN:e=h-((c._valueMax()-c._valueMin())/a);break;case b.ui.keyCode.UP:case b.ui.keyCode.RIGHT:if(h==c._valueMax()){return}e=h+i;break;case b.ui.keyCode.DOWN:case b.ui.keyCode.LEFT:if(h==c._valueMin()){return}e=h-i;break}c._slide(j,f,e);return g}).keyup(function(f){var e=b(this).data("index.ui-slider-handle");if(c._keySliding){c._stop(f,e);c._change(f,e);c._keySliding=false;b(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy();return this},_mouseCapture:function(e){var f=this.options;if(f.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();var i={x:e.pageX,y:e.pageY};var k=this._normValueFromMouse(i);var d=this._valueMax()-this._valueMin()+1,g;var l=this,j;this.handles.each(function(m){var n=Math.abs(k-l.values(m));if(d>n){d=n;g=b(this);j=m}});if(f.range==true&&this.values(1)==f.min){g=b(this.handles[++j])}this._start(e,j);this._mouseSliding=true;l._handleIndex=j;g.addClass("ui-state-active").focus();var h=g.offset();var c=!b(e.target).parents().andSelf().is(".ui-slider-handle");this._clickOffset=c?{left:0,top:0}:{left:e.pageX-h.left-(g.width()/2),top:e.pageY-h.top-(g.height()/2)-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)};k=this._normValueFromMouse(i);this._slide(e,j,k);this._animateOff=true;return true},_mouseStart:function(c){return true},_mouseDrag:function(e){var c={x:e.pageX,y:e.pageY};var d=this._normValueFromMouse(c);this._slide(e,this._handleIndex,d);return false},_mouseStop:function(c){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(c,this._handleIndex);this._change(c,this._handleIndex);this._handleIndex=null;this._clickOffset=null;this._animateOff=false;return false},_detectOrientation:function(){this.orientation=this.options.orientation=="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(e){var d,i;if("horizontal"==this.orientation){d=this.elementSize.width;i=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{d=this.elementSize.height;i=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}var g=(i/d);if(g>1){g=1}if(g<0){g=0}if("vertical"==this.orientation){g=1-g}var f=this._valueMax()-this._valueMin(),j=g*f,c=j%this.options.step,h=this._valueMin()+j-c;if(c>(this.options.step/2)){h+=this.options.step}return parseFloat(h.toFixed(5))},_start:function(e,d){var c={handle:this.handles[d],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(d);c.values=this.values()}this._trigger("start",e,c)},_slide:function(g,f,e){var h=this.handles[f];if(this.options.values&&this.options.values.length){var c=this.values(f?0:1);if((this.options.values.length==2&&this.options.range===true)&&((f==0&&e>c)||(f==1&&e<c))){e=c}if(e!=this.values(f)){var d=this.values();d[f]=e;var i=this._trigger("slide",g,{handle:this.handles[f],value:e,values:d});var c=this.values(f?0:1);if(i!==false){this.values(f,e,true)}}}else{if(e!=this.value()){var i=this._trigger("slide",g,{handle:this.handles[f],value:e});if(i!==false){this.value(e)}}}},_stop:function(e,d){var c={handle:this.handles[d],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(d);c.values=this.values()}this._trigger("stop",e,c)},_change:function(e,d){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[d],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(d);c.values=this.values()}this._trigger("change",e,c)}},value:function(c){if(arguments.length){this.options.value=this._trimValue(c);this._refreshValue();this._change(null,0)}return this._value()},values:function(e,h){if(arguments.length>1){this.options.values[e]=this._trimValue(h);this._refreshValue();this._change(null,e)}if(arguments.length){if(b.isArray(arguments[0])){var g=this.options.values,d=arguments[0];for(var f=0,c=g.length;f<c;f++){g[f]=this._trimValue(d[f]);this._change(null,f)}this._refreshValue()}else{if(this.options.values&&this.options.values.length){return this._values(e)}else{return this.value()}}}else{return this._values()}},_setOption:function(c,d){b.Widget.prototype._setOption.apply(this,arguments);switch(c){case"disabled":if(d){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled");this.element.addClass("ui-disabled")}else{this.handles.removeAttr("disabled");this.element.removeClass("ui-disabled")}case"orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case"value":this._animateOff=true;this._refreshValue();this._animateOff=false;break;case"values":this._animateOff=true;this._refreshValue();this._animateOff=false;break}},_step:function(){var c=this.options.step;return c},_value:function(){var c=this.options.value;c=this._trimValue(c);return c},_values:function(d){if(arguments.length){var g=this.options.values[d];g=this._trimValue(g);return g}else{var f=this.options.values.slice();for(var e=0,c=f.length;e<c;e++){f[e]=this._trimValue(f[e])}return f}},_trimValue:function(c){if(c<this._valueMin()){c=this._valueMin()}if(c>this._valueMax()){c=this._valueMax()}return c},_valueMin:function(){var c=this.options.min;return c},_valueMax:function(){var c=this.options.max;return c},_refreshValue:function(){var g=this.options.range,e=this.options,m=this;var d=(!this._animateOff)?e.animate:false;if(this.options.values&&this.options.values.length){var j,i;this.handles.each(function(q,o){var p=(m.values(q)-m._valueMin())/(m._valueMax()-m._valueMin())*100;var n={};n[m.orientation=="horizontal"?"left":"bottom"]=p+"%";b(this).stop(1,1)[d?"animate":"css"](n,e.animate);if(m.options.range===true){if(m.orientation=="horizontal"){(q==0)&&m.range.stop(1,1)[d?"animate":"css"]({left:p+"%"},e.animate);(q==1)&&m.range[d?"animate":"css"]({width:(p-lastValPercent)+"%"},{queue:false,duration:e.animate})}else{(q==0)&&m.range.stop(1,1)[d?"animate":"css"]({bottom:(p)+"%"},e.animate);(q==1)&&m.range[d?"animate":"css"]({height:(p-lastValPercent)+"%"},{queue:false,duration:e.animate})}}lastValPercent=p})}else{var k=this.value(),h=this._valueMin(),l=this._valueMax(),f=l!=h?(k-h)/(l-h)*100:0;var c={};c[m.orientation=="horizontal"?"left":"bottom"]=f+"%";this.handle.stop(1,1)[d?"animate":"css"](c,e.animate);(g=="min")&&(this.orientation=="horizontal")&&this.range.stop(1,1)[d?"animate":"css"]({width:f+"%"},e.animate);(g=="max")&&(this.orientation=="horizontal")&&this.range[d?"animate":"css"]({width:(100-f)+"%"},{queue:false,duration:e.animate});(g=="min")&&(this.orientation=="vertical")&&this.range.stop(1,1)[d?"animate":"css"]({height:f+"%"},e.animate);(g=="max")&&(this.orientation=="vertical")&&this.range[d?"animate":"css"]({height:(100-f)+"%"},{queue:false,duration:e.animate})}}});b.extend(b.ui.slider,{version:"1.8rc2"})})(jQuery);
/*
 * jQuery UI Dialog 1.8rc2
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Dialog
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *  jquery.ui.button.js
 *	jquery.ui.draggable.js
 *	jquery.ui.mouse.js
 *	jquery.ui.position.js
 *	jquery.ui.resizable.js
 */(function(b){var a="ui-dialog ui-widget ui-widget-content ui-corner-all ";b.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:"center",resizable:true,show:null,stack:true,title:"",width:300,zIndex:1000},_create:function(){this.originalTitle=this.element.attr("title");var k=this,l=k.options,i=l.title||k.originalTitle||"&#160;",d=b.ui.dialog.getTitleId(k.element),j=(k.uiDialog=b("<div></div>")).appendTo(document.body).hide().addClass(a+l.dialogClass).css({zIndex:l.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(m){(l.closeOnEscape&&m.keyCode&&m.keyCode==b.ui.keyCode.ESCAPE&&k.close(m))}).attr({role:"dialog","aria-labelledby":d}).mousedown(function(m){k.moveToTop(false,m)}),f=k.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(j),e=(k.uiDialogTitlebar=b("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(j),h=b('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){h.addClass("ui-state-hover")},function(){h.removeClass("ui-state-hover")}).focus(function(){h.addClass("ui-state-focus")}).blur(function(){h.removeClass("ui-state-focus")}).click(function(m){k.close(m);return false}).appendTo(e),g=(k.uiDialogTitlebarCloseText=b("<span></span>")).addClass("ui-icon ui-icon-closethick").text(l.closeText).appendTo(h),c=b("<span></span>").addClass("ui-dialog-title").attr("id",d).html(i).prependTo(e);if(b.isFunction(l.beforeclose)&&!b.isFunction(l.beforeClose)){l.beforeClose=l.beforeclose}e.find("*").add(e).disableSelection();(l.draggable&&b.fn.draggable&&k._makeDraggable());(l.resizable&&b.fn.resizable&&k._makeResizable());k._createButtons(l.buttons);k._isOpen=false;(b.fn.bgiframe&&j.bgiframe())},_init:function(){if(this.options.autoOpen){this.open()}},destroy:function(){var c=this;(c.overlay&&c.overlay.destroy());c.uiDialog.hide();c.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");c.uiDialog.remove();(c.originalTitle&&c.element.attr("title",c.originalTitle));return c},widget:function(){return this.uiDialog},close:function(e){var c=this;if(false===c._trigger("beforeClose",e)){return}(c.overlay&&c.overlay.destroy());c.uiDialog.unbind("keypress.ui-dialog");c._isOpen=false;(c.options.hide?c.uiDialog.hide(c.options.hide,function(){c._trigger("close",e)}):c.uiDialog.hide()&&c._trigger("close",e));b.ui.dialog.overlay.resize();if(c.options.modal){var d=0;b(".ui-dialog").each(function(){if(this!=c.uiDialog[0]){d=Math.max(d,b(this).css("z-index"))}});b.ui.dialog.maxZ=d}return c},isOpen:function(){return this._isOpen},moveToTop:function(g,f){var c=this,e=c.options;if((e.modal&&!g)||(!e.stack&&!e.modal)){return c._trigger("focus",f)}if(e.zIndex>b.ui.dialog.maxZ){b.ui.dialog.maxZ=e.zIndex}(c.overlay&&c.overlay.$el.css("z-index",b.ui.dialog.overlay.maxZ=++b.ui.dialog.maxZ));var d={scrollTop:c.element.attr("scrollTop"),scrollLeft:c.element.attr("scrollLeft")};c.uiDialog.css("z-index",++b.ui.dialog.maxZ);c.element.attr(d);c._trigger("focus",f);return c},open:function(){if(this._isOpen){return}var d=this,e=d.options,c=d.uiDialog;d.overlay=e.modal?new b.ui.dialog.overlay(d):null;(c.next().length&&c.appendTo("body"));d._size();d._position(e.position);c.show(e.show);d.moveToTop(true);(e.modal&&c.bind("keypress.ui-dialog",function(h){if(h.keyCode!=b.ui.keyCode.TAB){return}var g=b(":tabbable",this),i=g.filter(":first"),f=g.filter(":last");if(h.target==f[0]&&!h.shiftKey){i.focus(1);return false}else{if(h.target==i[0]&&h.shiftKey){f.focus(1);return false}}}));b([]).add(c.find(".ui-dialog-content :tabbable:first")).add(c.find(".ui-dialog-buttonpane :tabbable:first")).add(c).filter(":first").focus();d._trigger("open");d._isOpen=true;return d},_createButtons:function(f){var e=this,c=false,d=b("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");e.uiDialog.find(".ui-dialog-buttonpane").remove();(typeof f=="object"&&f!==null&&b.each(f,function(){return !(c=true)}));if(c){b.each(f,function(g,i){var h=b('<button type="button"></button>').text(g).click(function(){i.apply(e.element[0],arguments)}).appendTo(d);(b.fn.button&&h.button())});d.appendTo(e.uiDialog)}},_makeDraggable:function(){var c=this,e=c.options,f=b(document),d;c.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(g){d=e.height;b(this).height(b(this).height()).addClass("ui-dialog-dragging");c._trigger("dragStart",g)},drag:function(g){c._trigger("drag",g)},stop:function(g,h){e.position=[h.position.left-f.scrollLeft(),h.position.top-f.scrollTop()];b(this).removeClass("ui-dialog-dragging").height(d);c._trigger("dragStop",g);b.ui.dialog.overlay.resize()}})},_makeResizable:function(g){g=(g===undefined?this.options.resizable:g);var d=this,f=d.options,c=d.uiDialog.css("position"),e=typeof g=="string"?g:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:f.maxWidth,maxHeight:f.maxHeight,minWidth:f.minWidth,minHeight:d._minHeight(),handles:e,start:function(h){b(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",h)},resize:function(h){d._trigger("resize",h)},stop:function(h){b(this).removeClass("ui-dialog-resizing");f.height=b(this).height();f.width=b(this).width();d._trigger("resizeStop",h);b.ui.dialog.overlay.resize()}}).css("position",c).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var c=this.options;return(c.height=="auto"?c.minHeight:Math.min(c.minHeight,c.height))},_position:function(d){var e=[],f=[0,0];d=d||b.ui.dialog.prototype.options.position;if(typeof d=="string"||(typeof d=="object"&&"0" in d)){e=d.split?d.split(" "):[d[0],d[1]];if(e.length==1){e[1]=e[0]}b.each(["left","top"],function(h,g){if(+e[h]==e[h]){f[h]=e[h];e[h]=g}})}else{if(typeof d=="object"){if("left" in d){e[0]="left";f[0]=d.left}else{if("right" in d){e[0]="right";f[0]=-d.right}}if("top" in d){e[1]="top";f[1]=d.top}else{if("bottom" in d){e[1]="bottom";f[1]=-d.bottom}}}}var c=this.uiDialog.is(":visible");if(!c){this.uiDialog.show()}this.uiDialog.css({top:0,left:0}).position({my:e.join(" "),at:e.join(" "),offset:f.join(" "),of:window,collision:"fit",using:function(h){var g=b(this).css(h).offset().top;if(g<0){b(this).css("top",h.top-g)}}});if(!c){this.uiDialog.hide()}},_setOption:function(f,g){var d=this,c=d.uiDialog,h=c.is(":data(resizable)"),e=false;switch(f){case"beforeclose":f="beforeClose";break;case"buttons":d._createButtons(g);break;case"closeText":d.uiDialogTitlebarCloseText.text(""+g);break;case"dialogClass":c.removeClass(d.options.dialogClass).addClass(a+g);break;case"disabled":(g?c.addClass("ui-dialog-disabled"):c.removeClass("ui-dialog-disabled"));break;case"draggable":(g?d._makeDraggable():c.draggable("destroy"));break;case"height":e=true;break;case"maxHeight":(h&&c.resizable("option","maxHeight",g));e=true;break;case"maxWidth":(h&&c.resizable("option","maxWidth",g));e=true;break;case"minHeight":(h&&c.resizable("option","minHeight",g));e=true;break;case"minWidth":(h&&c.resizable("option","minWidth",g));e=true;break;case"position":d._position(g);break;case"resizable":(h&&!g&&c.resizable("destroy"));(h&&typeof g=="string"&&c.resizable("option","handles",g));(h||(g!==false&&d._makeResizable(g)));break;case"title":b(".ui-dialog-title",d.uiDialogTitlebar).html(""+(g||"&#160;"));break;case"width":e=true;break}b.Widget.prototype._setOption.apply(d,arguments);(e&&d._size())},_size:function(){var d=this.options;this.element.css({height:0,minHeight:0,width:"auto"});var c=this.uiDialog.css({height:"auto",width:d.width}).height();this.element.css(d.height=="auto"?{minHeight:Math.max(d.minHeight-c,0),height:"auto"}:{height:Math.max(d.height-c,0)});(this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight()))}});b.extend(b.ui.dialog,{version:"1.8rc2",uuid:0,maxZ:0,getTitleId:function(c){return"ui-dialog-title-"+(c.attr("id")||++this.uuid)},overlay:function(c){this.$el=b.ui.dialog.overlay.create(c)}});b.extend(b.ui.dialog.overlay,{instances:[],maxZ:0,events:b.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(c){return c+".dialog-overlay"}).join(" "),create:function(d){if(this.instances.length===0){setTimeout(function(){if(b.ui.dialog.overlay.instances.length){b(document).bind(b.ui.dialog.overlay.events,function(e){return(b(e.target).zIndex()>=b.ui.dialog.overlay.maxZ)})}},1);b(document).bind("keydown.dialog-overlay",function(e){(d.options.closeOnEscape&&e.keyCode&&e.keyCode==b.ui.keyCode.ESCAPE&&d.close(e))});b(window).bind("resize.dialog-overlay",b.ui.dialog.overlay.resize)}var c=b("<div></div>").appendTo(document.body).addClass("ui-widget-overlay").css({width:this.width(),height:this.height()});(b.fn.bgiframe&&c.bgiframe());this.instances.push(c);return c},destroy:function(c){this.instances.splice(b.inArray(this.instances,c),1);if(this.instances.length===0){b([document,window]).unbind(".dialog-overlay")}c.remove();var d=0;b.each(this.instances,function(){d=Math.max(d,this.css("z-index"))});this.maxZ=d},height:function(){if(b.browser.msie&&b.browser.version<7){var d=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);var c=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(d<c){return b(window).height()+"px"}else{return d+"px"}}else{return b(document).height()+"px"}},width:function(){if(b.browser.msie&&b.browser.version<7){var c=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);var d=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);if(c<d){return b(window).width()+"px"}else{return c+"px"}}else{return b(document).width()+"px"}},resize:function(){var c=b([]);b.each(b.ui.dialog.overlay.instances,function(){c=c.add(this)});c.css({width:0,height:0}).css({width:b.ui.dialog.overlay.width(),height:b.ui.dialog.overlay.height()})}});b.extend(b.ui.dialog.overlay.prototype,{destroy:function(){b.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);
/*
 * jQuery UI Position 1.8rc2
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Position
 */(function(f){f.ui=f.ui||{};var c=/left|center|right/,e="center",d=/top|center|bottom/,g="center",a=f.fn.position;f.fn.position=function(i){if(!i||!i.of){return a.apply(this,arguments)}i=f.extend({},i);var l=f(i.of),n=(i.collision||"flip").split(" "),m=i.offset?i.offset.split(" "):[0,0],k,h,j;if(i.of.nodeType===9){k=l.width();h=l.height();j={top:0,left:0}}else{if(i.of.scrollTo&&i.of.document){k=l.width();h=l.height();j={top:l.scrollTop(),left:l.scrollLeft()}}else{if(i.of.preventDefault){i.at="left top";k=h=0;j={top:i.of.pageY,left:i.of.pageX}}else{k=l.outerWidth();h=l.outerHeight();j=l.offset()}}}f.each(["my","at"],function(){var o=(i[this]||"").split(" ");if(o.length===1){o=c.test(o[0])?o.concat([g]):d.test(o[0])?[e].concat(o):[e,g]}o[0]=c.test(o[0])?o[0]:e;o[1]=d.test(o[1])?o[1]:g;i[this]=o});if(n.length===1){n[1]=n[0]}m[0]=parseInt(m[0],10)||0;if(m.length===1){m[1]=m[0]}m[1]=parseInt(m[1],10)||0;if(i.at[0]==="right"){j.left+=k}else{if(i.at[0]===e){j.left+=k/2}}if(i.at[1]==="bottom"){j.top+=h}else{if(i.at[1]===g){j.top+=h/2}}j.left+=m[0];j.top+=m[1];return this.each(function(){var t=f(this),s=t.outerWidth(),r=t.outerHeight(),p=f.extend({},j),u,o,q;if(i.my[0]==="right"){p.left-=s}else{if(i.my[0]===e){p.left-=s/2}}if(i.my[1]==="bottom"){p.top-=r}else{if(i.my[1]===g){p.top-=r/2}}f.each(["left","top"],function(w,v){if(f.ui.position[n[w]]){f.ui.position[n[w]][v](p,{targetWidth:k,targetHeight:h,elemWidth:s,elemHeight:r,offset:m,my:i.my,at:i.at})}});if(f.fn.bgiframe){t.bgiframe()}t.offset(f.extend(p,{using:i.using}))})};f.ui.position={fit:{left:function(h,i){var k=f(window),j=h.left+i.elemWidth-k.width()-k.scrollLeft();h.left=j>0?h.left-j:Math.max(0,h.left)},top:function(h,i){var k=f(window),j=h.top+i.elemHeight-k.height()-k.scrollTop();h.top=j>0?h.top-j:Math.max(0,h.top)}},flip:{left:function(i,j){if(j.at[0]==="center"){return}var l=f(window),k=i.left+j.elemWidth-l.width()-l.scrollLeft(),h=j.my[0]==="left"?-j.elemWidth:j.my[0]==="right"?j.elemWidth:0,m=-2*j.offset[0];i.left+=i.left<0?h+j.targetWidth+m:k>0?h-j.targetWidth+m:0},top:function(i,k){if(k.at[1]==="center"){return}var m=f(window),l=i.top+k.elemHeight-m.height()-m.scrollTop(),h=k.my[1]==="top"?-k.elemHeight:k.my[1]==="bottom"?k.elemHeight:0,j=k.at[1]==="top"?k.targetHeight:-k.targetHeight,n=-2*k.offset[1];i.top+=i.top<0?h+k.targetHeight+n:l>0?h+j+n:0}}};if(!f.offset.setOffset){f.offset.setOffset=function(l,i){if(/static/.test(jQuery.curCSS(l,"position"))){l.style.position="relative"}var k=jQuery(l),n=k.offset(),h=parseInt(jQuery.curCSS(l,"top",true),10)||0,m=parseInt(jQuery.curCSS(l,"left",true),10)||0,j={top:(i.top-n.top)+h,left:(i.left-n.left)+m};if("using" in i){i.using.call(l,j)}else{k.css(j)}};var b=f.fn.offset;f.fn.offset=function(h){var i=this[0];if(!i||!i.ownerDocument){return null}if(h){return this.each(function(){f.offset.setOffset(this,h)})}return b.call(this)}}})(jQuery);
/* ------------------------------------------------------------------------
	Class: prettyPhoto
	Use: Lightbox clone for jQuery
	Author: Stephane Caron (http://www.no-margin-for-errors.com)
	Version: 3.0.1
------------------------------------------------------------------------- */

(function($) {
	$.prettyPhoto = {version: '3.0'};
	
	$.fn.prettyPhoto = function(pp_settings) {
		pp_settings = jQuery.extend({
			animation_speed: 'fast', /* fast/slow/normal */
			slideshow: false, /* false OR interval time in ms */
			autoplay_slideshow: false, /* true/false */
			opacity: 0.80, /* Value between 0 and 1 */
			show_title: true, /* true/false */
			allow_resize: true, /* Resize the photos bigger than viewport. true/false */
			default_width: 500,
			default_height: 344,
			counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
			theme: 'facebook', /* light_rounded / dark_rounded / light_square / dark_square / facebook */
			hideflash: false, /* Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto */
			wmode: 'opaque', /* Set the flash wmode attribute */
			autoplay: true, /* Automatically start videos: True/False */
			modal: false, /* If set to true, only the close button will close the window */
			overlay_gallery: true, /* If set to true, a gallery will overlay the fullscreen image on mouse over */
			keyboard_shortcuts: true, /* Set to false if you open forms inside prettyPhoto */
			changepicturecallback: function(){}, /* Called everytime an item is shown/changed */
			callback: function(){}, /* Called when prettyPhoto is closed */
			markup: '<div class="pp_pic_holder"> \
						<div class="ppt">&nbsp;</div> \
						<div class="pp_top"> \
							<div class="pp_left"></div> \
							<div class="pp_middle"></div> \
							<div class="pp_right"></div> \
						</div> \
						<div class="pp_content_container"> \
							<div class="pp_left"> \
							<div class="pp_right"> \
								<div class="pp_content"> \
									<div class="pp_loaderIcon"></div> \
									<div class="pp_fade"> \
										<a href="#" class="pp_expand" title="Expand the image">Expand</a> \
										<div class="pp_hoverContainer"> \
											<a class="pp_next" href="#">next</a> \
											<a class="pp_previous" href="#">previous</a> \
										</div> \
										<div id="pp_full_res"></div> \
										<div class="pp_details clearfix"> \
											<p class="pp_description"></p> \
											<a class="pp_close" href="#">Close</a> \
											<div class="pp_nav"> \
												<a href="#" class="pp_arrow_previous">Previous</a> \
												<p class="currentTextHolder">0/0</p> \
												<a href="#" class="pp_arrow_next">Next</a> \
											</div> \
										</div> \
									</div> \
								</div> \
							</div> \
							</div> \
						</div> \
						<div class="pp_bottom"> \
							<div class="pp_left"></div> \
							<div class="pp_middle"></div> \
							<div class="pp_right"></div> \
						</div> \
					</div> \
					<div class="pp_overlay"></div>',
			gallery_markup: '<div class="pp_gallery"> \
								<a href="#" class="pp_arrow_previous">Previous</a> \
								<ul> \
									{gallery} \
								</ul> \
								<a href="#" class="pp_arrow_next">Next</a> \
							</div>',
			image_markup: '<img id="fullResImage" src="" />',
			flash_markup: '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',
			quicktime_markup: '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>',
			iframe_markup: '<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',
			inline_markup: '<div class="pp_inline clearfix">{content}</div>',
			custom_markup: ''
		}, pp_settings);
		
		// Global variables accessible only by prettyPhoto
		var matchedObjects = this, percentBased = false, correctSizes, pp_open,
		
		// prettyPhoto container specific
		pp_contentHeight, pp_contentWidth, pp_containerHeight, pp_containerWidth,
		
		// Window size
		windowHeight = $(window).height(), windowWidth = $(window).width(),

		// Global elements
		pp_slideshow;
		
		doresize = true, scroll_pos = _get_scroll();
	
		// Window/Keyboard events
		$(window).unbind('resize').resize(function(){ _center_overlay(); _resize_overlay(); });
		
		if(pp_settings.keyboard_shortcuts) {
			$(document).unbind('keydown').keydown(function(e){
				if(typeof $pp_pic_holder != 'undefined'){
					if($pp_pic_holder.is(':visible')){
						switch(e.keyCode){
							case 37:
								$.prettyPhoto.changePage('previous');
								break;
							case 39:
								$.prettyPhoto.changePage('next');
								break;
							case 27:
								if(!settings.modal)
								$.prettyPhoto.close();
								break;
						};
						return false;
					};
				};
			});
		}
		
		
		/**
		* Initialize prettyPhoto.
		*/
		$.prettyPhoto.initialize = function() {
			settings = pp_settings;
			
			if($.browser.msie && parseInt($.browser.version) == 6) settings.theme = "light_square"; // Fallback to a supported theme for IE6
			
			_buildOverlay(this); // Build the overlay {this} being the caller
			
			if(settings.allow_resize)
				$(window).scroll(function(){ _center_overlay(); });
				
			_center_overlay();
			
			set_position = jQuery.inArray($(this).attr('href'), pp_images); // Define where in the array the clicked item is positionned
			
			$.prettyPhoto.open();
			
			return false;
		}


		/**
		* Opens the prettyPhoto modal box.
		* @param image {String,Array} Full path to the image to be open, can also be an array containing full images paths.
		* @param title {String,Array} The title to be displayed with the picture, can also be an array containing all the titles.
		* @param description {String,Array} The description to be displayed with the picture, can also be an array containing all the descriptions.
		*/
		$.prettyPhoto.open = function(event) {
			if(typeof settings == "undefined"){ // Means it's an API call, need to manually get the settings and set the variables
				settings = pp_settings;
				if($.browser.msie && $.browser.version == 6) settings.theme = "light_square"; // Fallback to a supported theme for IE6
				_buildOverlay(event.target); // Build the overlay {this} being the caller
				pp_images = $.makeArray(arguments[0]);
				pp_titles = (arguments[1]) ? $.makeArray(arguments[1]) : $.makeArray("");
				pp_descriptions = (arguments[2]) ? $.makeArray(arguments[2]) : $.makeArray("");
				isSet = (pp_images.length > 1) ? true : false;
				set_position = 0;
			}

			if($.browser.msie && $.browser.version == 6) $('select').css('visibility','hidden'); // To fix the bug with IE select boxes
			
			if(settings.hideflash) $('object,embed').css('visibility','hidden'); // Hide the flash

			_checkPosition($(pp_images).size()); // Hide the next/previous links if on first or last images.
		
			$('.pp_loaderIcon').show();
		
			// Fade the content in
			if($ppt.is(':hidden')) $ppt.css('opacity',0).show();
			$pp_overlay.show().fadeTo(settings.animation_speed,settings.opacity);

			// Display the current position
			$pp_pic_holder.find('.currentTextHolder').text((set_position+1) + settings.counter_separator_label + $(pp_images).size());

			// Set the description
			$pp_pic_holder.find('.pp_description').show().html(unescape(pp_descriptions[set_position]));

			// Set the title
			(settings.show_title && pp_titles[set_position] != "" && typeof pp_titles[set_position] != "undefined") ? $ppt.html(unescape(pp_titles[set_position])) : $ppt.html('&nbsp;');
			
			// Get the dimensions
			movie_width = ( parseFloat(grab_param('width',pp_images[set_position])) ) ? grab_param('width',pp_images[set_position]) : settings.default_width.toString();
			movie_height = ( parseFloat(grab_param('height',pp_images[set_position])) ) ? grab_param('height',pp_images[set_position]) : settings.default_height.toString();
			
			// If the size is % based, calculate according to window dimensions
			if(movie_width.indexOf('%') != -1 || movie_height.indexOf('%') != -1){
				movie_height = parseFloat(($(window).height() * parseFloat(movie_height) / 100) - 150);
				movie_width = parseFloat(($(window).width() * parseFloat(movie_width) / 100) - 150);
				percentBased = true;
			}else{
				percentBased = false;
			}
			
			// Fade the holder
			$pp_pic_holder.fadeIn(function(){
				imgPreloader = "";
				
				// Inject the proper content
				switch(_getFileType(pp_images[set_position])){
					case 'image':
						imgPreloader = new Image();

						// Preload the neighbour images
						nextImage = new Image();
						if(isSet && set_position > $(pp_images).size()) nextImage.src = pp_images[set_position + 1];
						prevImage = new Image();
						if(isSet && pp_images[set_position - 1]) prevImage.src = pp_images[set_position - 1];

						$pp_pic_holder.find('#pp_full_res')[0].innerHTML = settings.image_markup;
						$pp_pic_holder.find('#fullResImage').attr('src',pp_images[set_position]);

						imgPreloader.onload = function(){
							// Fit item to viewport
							correctSizes = _fitToViewport(imgPreloader.width,imgPreloader.height);

							_showContent();
						};

						imgPreloader.onerror = function(){
							alert('Image cannot be loaded. Make sure the path is correct and image exist.');
							$.prettyPhoto.close();
						};
					
						imgPreloader.src = pp_images[set_position];
					break;
				
					case 'youtube':
						correctSizes = _fitToViewport(movie_width,movie_height); // Fit item to viewport

						movie = 'http://www.youtube.com/v/'+grab_param('v',pp_images[set_position]);
						if(settings.autoplay) movie += "&autoplay=1";
					
						toInject = settings.flash_markup.replace(/{width}/g,correctSizes['width']).replace(/{height}/g,correctSizes['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);
					break;
				
					case 'vimeo':
						correctSizes = _fitToViewport(movie_width,movie_height); // Fit item to viewport
					
						movie_id = pp_images[set_position];
						var regExp = /http:\/\/(www\.)?vimeo.com\/(\d+)/;
						var match = movie_id.match(regExp);
						
						movie = 'http://player.vimeo.com/video/'+ match[2] +'?title=0&amp;byline=0&amp;portrait=0';
						if(settings.autoplay) movie += "&autoplay=1;";
				
						vimeo_width = correctSizes['width'] + '/embed/?moog_width='+ correctSizes['width'];
				
						toInject = settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,correctSizes['height']).replace(/{path}/g,movie);
					break;
				
					case 'quicktime':
						correctSizes = _fitToViewport(movie_width,movie_height); // Fit item to viewport
						correctSizes['height']+=15; correctSizes['contentHeight']+=15; correctSizes['containerHeight']+=15; // Add space for the control bar
				
						toInject = settings.quicktime_markup.replace(/{width}/g,correctSizes['width']).replace(/{height}/g,correctSizes['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay);
					break;
				
					case 'flash':
						correctSizes = _fitToViewport(movie_width,movie_height); // Fit item to viewport
					
						flash_vars = pp_images[set_position];
						flash_vars = flash_vars.substring(pp_images[set_position].indexOf('flashvars') + 10,pp_images[set_position].length);

						filename = pp_images[set_position];
						filename = filename.substring(0,filename.indexOf('?'));
					
						toInject =  settings.flash_markup.replace(/{width}/g,correctSizes['width']).replace(/{height}/g,correctSizes['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+'?'+flash_vars);
					break;
				
					case 'iframe':
						correctSizes = _fitToViewport(movie_width,movie_height); // Fit item to viewport
				
						frame_url = pp_images[set_position];
						frame_url = frame_url.substr(0,frame_url.indexOf('iframe')-1);
				
						toInject = settings.iframe_markup.replace(/{width}/g,correctSizes['width']).replace(/{height}/g,correctSizes['height']).replace(/{path}/g,frame_url);
					break;
					
					case 'custom':
						correctSizes = _fitToViewport(movie_width,movie_height); // Fit item to viewport
					
						toInject = settings.custom_markup;
					break;
				
					case 'inline':
						// to get the item height clone it, apply default width, wrap it in the prettyPhoto containers , then delete
						myClone = $(pp_images[set_position]).clone().css({'width':settings.default_width}).wrapInner('<div id="pp_full_res"><div class="pp_inline clearfix"></div></div>').appendTo($('body'));
						correctSizes = _fitToViewport($(myClone).width(),$(myClone).height());
						$(myClone).remove();
						toInject = settings.inline_markup.replace(/{content}/g,$(pp_images[set_position]).html());
					break;
				};

				if(!imgPreloader){
					$pp_pic_holder.find('#pp_full_res')[0].innerHTML = toInject;
				
					// Show content
					_showContent();
				};
			});

			return false;
		};

	
		/**
		* Change page in the prettyPhoto modal box
		* @param direction {String} Direction of the paging, previous or next.
		*/
		$.prettyPhoto.changePage = function(direction){
			currentGalleryPage = 0;
			
			if(direction == 'previous') {
				set_position--;
				if (set_position < 0){
					set_position = 0;
					return;
				};
			}else if(direction == 'next'){
				set_position++;
				if(set_position > $(pp_images).size()-1) {
					set_position = 0;
				}
			}else{
				set_position=direction;
			};

			if(!doresize) doresize = true; // Allow the resizing of the images
			$('.pp_contract').removeClass('pp_contract').addClass('pp_expand');

			_hideContent(function(){ $.prettyPhoto.open(); });
		};


		/**
		* Change gallery page in the prettyPhoto modal box
		* @param direction {String} Direction of the paging, previous or next.
		*/
		$.prettyPhoto.changeGalleryPage = function(direction){
			if(direction=='next'){
				currentGalleryPage ++;

				if(currentGalleryPage > totalPage){
					currentGalleryPage = 0;
				};
			}else if(direction=='previous'){
				currentGalleryPage --;

				if(currentGalleryPage < 0){
					currentGalleryPage = totalPage;
				};
			}else{
				currentGalleryPage = direction;
			};
			
			// Slide the pages, if we're on the last page, find out how many items we need to slide. To make sure we don't have an empty space.
			itemsToSlide = (currentGalleryPage == totalPage) ? pp_images.length - ((totalPage) * itemsPerPage) : itemsPerPage;
			
			$pp_pic_holder.find('.pp_gallery li').each(function(i){
				$(this).animate({
					'left': (i * itemWidth) - ((itemsToSlide * itemWidth) * currentGalleryPage)
				});
			});
		};


		/**
		* Start the slideshow...
		*/
		$.prettyPhoto.startSlideshow = function(){
			if(typeof pp_slideshow == 'undefined'){
				$pp_pic_holder.find('.pp_play').unbind('click').removeClass('pp_play').addClass('pp_pause').click(function(){
					$.prettyPhoto.stopSlideshow();
					return false;
				});
				pp_slideshow = setInterval($.prettyPhoto.startSlideshow,settings.slideshow);
			}else{
				$.prettyPhoto.changePage('next');	
			};
		}


		/**
		* Stop the slideshow...
		*/
		$.prettyPhoto.stopSlideshow = function(){
			$pp_pic_holder.find('.pp_pause').unbind('click').removeClass('pp_pause').addClass('pp_play').click(function(){
				$.prettyPhoto.startSlideshow();
				return false;
			});
			clearInterval(pp_slideshow);
			pp_slideshow=undefined;
		}


		/**
		* Closes prettyPhoto.
		*/
		$.prettyPhoto.close = function(){

			clearInterval(pp_slideshow);
			
			$pp_pic_holder.stop().find('object,embed').css('visibility','hidden');
			
			$('div.pp_pic_holder,div.ppt,.pp_fade').fadeOut(settings.animation_speed,function(){ $(this).remove(); });
			
			$pp_overlay.fadeOut(settings.animation_speed, function(){
				if($.browser.msie && $.browser.version == 6) $('select').css('visibility','visible'); // To fix the bug with IE select boxes
				
				if(settings.hideflash) $('object,embed').css('visibility','visible'); // Show the flash
				
				$(this).remove(); // No more need for the prettyPhoto markup
				
				$(window).unbind('scroll');
				
				settings.callback();
				
				doresize = true;
				
				pp_open = false;
				
				delete settings;
			});
		};
	
		/**
		* Set the proper sizes on the containers and animate the content in.
		*/
		_showContent = function(){
			$('.pp_loaderIcon').hide();
			
			$ppt.fadeTo(settings.animation_speed,1);

			// Calculate the opened top position of the pic holder
			projectedTop = scroll_pos['scrollTop'] + ((windowHeight/2) - (correctSizes['containerHeight']/2));
			if(projectedTop < 0) projectedTop = 0;

			// Resize the content holder
			$pp_pic_holder.find('.pp_content').animate({'height':correctSizes['contentHeight']},settings.animation_speed);
			
			// Resize picture the holder
			$pp_pic_holder.animate({
				'top': projectedTop,
				'left': (windowWidth/2) - (correctSizes['containerWidth']/2),
				'width': correctSizes['containerWidth']
			},settings.animation_speed,function(){
				$pp_pic_holder.find('.pp_hoverContainer,#fullResImage').height(correctSizes['height']).width(correctSizes['width']);

				$pp_pic_holder.find('.pp_fade').fadeIn(settings.animation_speed); // Fade the new content

				// Show the nav
				if(isSet && _getFileType(pp_images[set_position])=="image") { $pp_pic_holder.find('.pp_hoverContainer').show(); }else{ $pp_pic_holder.find('.pp_hoverContainer').hide(); }
			
				if(correctSizes['resized']) $('a.pp_expand,a.pp_contract').fadeIn(settings.animation_speed); // Fade the resizing link if the image is resized
				
				if(settings.autoplay_slideshow && !pp_slideshow && !pp_open) $.prettyPhoto.startSlideshow();
				
				settings.changepicturecallback(); // Callback!
				
				pp_open = true;
			});
			
			_insert_gallery();
		};
		
		/**
		* Hide the content...DUH!
		*/
		function _hideContent(callback){
			// Fade out the current picture
			$pp_pic_holder.find('#pp_full_res object,#pp_full_res embed').css('visibility','hidden');
			$pp_pic_holder.find('.pp_fade').fadeOut(settings.animation_speed,function(){
				$('.pp_loaderIcon').show();
				
				callback();
			});
		};
	
		/**
		* Check the item position in the gallery array, hide or show the navigation links
		* @param setCount {integer} The total number of items in the set
		*/
		function _checkPosition(setCount){
			// If at the end, hide the next link
			if(set_position == setCount-1) {
				$pp_pic_holder.find('a.pp_next').css('visibility','hidden');
				$pp_pic_holder.find('a.pp_next').addClass('disabled').unbind('click');
			}else{ 
				$pp_pic_holder.find('a.pp_next').css('visibility','visible');
				$pp_pic_holder.find('a.pp_next.disabled').removeClass('disabled').bind('click',function(){
					$.prettyPhoto.changePage('next');
					return false;
				});
			};
		
			// If at the beginning, hide the previous link
			if(set_position == 0) {
				$pp_pic_holder
					.find('a.pp_previous')
					.css('visibility','hidden')
					.addClass('disabled')
					.unbind('click');
			}else{
				$pp_pic_holder.find('a.pp_previous.disabled')
					.css('visibility','visible')
					.removeClass('disabled')
					.bind('click',function(){
						$.prettyPhoto.changePage('previous');
						return false;
					});
			};
			
			(setCount > 1) ? $('.pp_nav').show() : $('.pp_nav').hide(); // Hide the bottom nav if it's not a set.
		};
	
		/**
		* Resize the item dimensions if it's bigger than the viewport
		* @param width {integer} Width of the item to be opened
		* @param height {integer} Height of the item to be opened
		* @return An array containin the "fitted" dimensions
		*/
		function _fitToViewport(width,height){
			resized = false;

			_getDimensions(width,height);
			
			// Define them in case there's no resize needed
			imageWidth = width, imageHeight = height;

			if( ((pp_containerWidth > windowWidth) || (pp_containerHeight > windowHeight)) && doresize && settings.allow_resize && !percentBased) {
				resized = true, fitting = false;
			
				while (!fitting){
					if((pp_containerWidth > windowWidth)){
						imageWidth = (windowWidth - 200);
						imageHeight = (height/width) * imageWidth;
					}else if((pp_containerHeight > windowHeight)){
						imageHeight = (windowHeight - 200);
						imageWidth = (width/height) * imageHeight;
					}else{
						fitting = true;
					};

					pp_containerHeight = imageHeight, pp_containerWidth = imageWidth;
				};
			
				_getDimensions(imageWidth,imageHeight);
			};

			return {
				width:Math.floor(imageWidth),
				height:Math.floor(imageHeight),
				containerHeight:Math.floor(pp_containerHeight),
				containerWidth:Math.floor(pp_containerWidth) + 40, // 40 behind the side padding
				contentHeight:Math.floor(pp_contentHeight),
				contentWidth:Math.floor(pp_contentWidth),
				resized:resized
			};
		};
		
		/**
		* Get the containers dimensions according to the item size
		* @param width {integer} Width of the item to be opened
		* @param height {integer} Height of the item to be opened
		*/
		function _getDimensions(width,height){
			width = parseFloat(width);
			height = parseFloat(height);
			
			// Get the details height, to do so, I need to clone it since it's invisible
			$pp_details = $pp_pic_holder.find('.pp_details');
			$pp_details.width(width);
			detailsHeight = parseFloat($pp_details.css('marginTop')) + parseFloat($pp_details.css('marginBottom'));
			$pp_details = $pp_details.clone().appendTo($('body')).css({
				'position':'absolute',
				'top':-10000
			});
			detailsHeight += $pp_details.height();
			detailsHeight = (detailsHeight <= 34) ? 36 : detailsHeight; // Min-height for the details
			if($.browser.msie && $.browser.version==7) detailsHeight+=8;
			$pp_details.remove();
			
			// Get the container size, to resize the holder to the right dimensions
			pp_contentHeight = height + detailsHeight;
			pp_contentWidth = width;
			pp_containerHeight = pp_contentHeight + $ppt.height() + $pp_pic_holder.find('.pp_top').height() + $pp_pic_holder.find('.pp_bottom').height();
			pp_containerWidth = width;
		}
	
		function _getFileType(itemSrc){
			if (itemSrc.match(/youtube\.com\/watch/i)) {
				return 'youtube';
			}else if (itemSrc.match(/vimeo\.com/i)) {
				return 'vimeo';
			}else if(itemSrc.indexOf('.mov') != -1){ 
				return 'quicktime';
			}else if(itemSrc.indexOf('.swf') != -1){
				return 'flash';
			}else if(itemSrc.indexOf('iframe') != -1){
				return 'iframe';
			}else if(itemSrc.indexOf('custom') != -1){
				return 'custom';
			}else if(itemSrc.substr(0,1) == '#'){
				return 'inline';
			}else{
				return 'image';
			};
		};
	
		function _center_overlay(){
			if(doresize && typeof $pp_pic_holder != 'undefined') {
				scroll_pos = _get_scroll();
				
				titleHeight = $ppt.height(), contentHeight = $pp_pic_holder.height(), contentwidth = $pp_pic_holder.width();
				
				projectedTop = (windowHeight/2) + scroll_pos['scrollTop'] - (contentHeight/2);
				
				$pp_pic_holder.css({
					'top': projectedTop,
					'left': (windowWidth/2) + scroll_pos['scrollLeft'] - (contentwidth/2)
				});
			};
		};
	
		function _get_scroll(){
			if (self.pageYOffset) {
				return {scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset};
			} else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict
				return {scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft};
			} else if (document.body) {// all other Explorers
				return {scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft};
			};
		};
	
		function _resize_overlay() {
			windowHeight = $(window).height(), windowWidth = $(window).width();
			
			if(typeof $pp_overlay != "undefined") $pp_overlay.height($(document).height());
		};
	
		function _insert_gallery(){
			if(isSet && settings.overlay_gallery && _getFileType(pp_images[set_position])=="image") {
				itemWidth = 52+5; // 52 beign the thumb width, 5 being the right margin.
				navWidth = (settings.theme == "facebook") ? 58 : 38; // Define the arrow width depending on the theme
				
				itemsPerPage = Math.floor((correctSizes['containerWidth'] - 100 - navWidth) / itemWidth);
				itemsPerPage = (itemsPerPage < pp_images.length) ? itemsPerPage : pp_images.length;
				totalPage = Math.ceil(pp_images.length / itemsPerPage) - 1;

				// Hide the nav in the case there's no need for links
				if(totalPage == 0){
					navWidth = 0; // No nav means no width!
					$pp_pic_holder.find('.pp_gallery .pp_arrow_next,.pp_gallery .pp_arrow_previous').hide();
				}else{
					$pp_pic_holder.find('.pp_gallery .pp_arrow_next,.pp_gallery .pp_arrow_previous').show();
				};

				galleryWidth = itemsPerPage * itemWidth + navWidth;
				
				// Set the proper width to the gallery items
				$pp_pic_holder.find('.pp_gallery')
					.width(galleryWidth)
					.css('margin-left',-(galleryWidth/2));
					
				$pp_pic_holder
					.find('.pp_gallery ul')
					.width(itemsPerPage * itemWidth)
					.find('li.selected')
					.removeClass('selected');
				
				goToPage = (Math.floor(set_position/itemsPerPage) <= totalPage) ? Math.floor(set_position/itemsPerPage) : totalPage;
				
				
				if(itemsPerPage) {
					$pp_pic_holder.find('.pp_gallery').hide().show().removeClass('disabled');
				}else{
					$pp_pic_holder.find('.pp_gallery').hide().addClass('disabled');
				}
				
				$.prettyPhoto.changeGalleryPage(goToPage);
				
				$pp_pic_holder
					.find('.pp_gallery ul li:eq('+set_position+')')
					.addClass('selected');
			}else{
				$pp_pic_holder.find('.pp_content').unbind('mouseenter mouseleave');
				$pp_pic_holder.find('.pp_gallery').hide();
			}
		}
	
		function _buildOverlay(caller){
			// Find out if the picture is part of a set
			theRel = $(caller).attr('rel');
			galleryRegExp = /\[(?:.*)\]/;
			isSet = (galleryRegExp.exec(theRel)) ? true : false;
			
			// Put the SRCs, TITLEs, ALTs into an array.
			pp_images = (isSet) ? jQuery.map(matchedObjects, function(n, i){ if($(n).attr('rel').indexOf(theRel) != -1) return $(n).attr('href'); }) : $.makeArray($(caller).attr('href'));
			pp_titles = (isSet) ? jQuery.map(matchedObjects, function(n, i){ if($(n).attr('rel').indexOf(theRel) != -1) return ($(n).find('img').attr('alt')) ? $(n).find('img').attr('alt') : ""; }) : $.makeArray($(caller).find('img').attr('alt'));
			pp_descriptions = (isSet) ? jQuery.map(matchedObjects, function(n, i){ if($(n).attr('rel').indexOf(theRel) != -1) return ($(n).attr('title')) ? $(n).attr('title') : ""; }) : $.makeArray($(caller).attr('title'));
			
			$('body').append(settings.markup); // Inject the markup
			
			$pp_pic_holder = $('.pp_pic_holder') , $ppt = $('.ppt'), $pp_overlay = $('div.pp_overlay'); // Set my global selectors
			
			// Inject the inline gallery!
			if(isSet && settings.overlay_gallery) {
				currentGalleryPage = 0;
				toInject = "";
				for (var i=0; i < pp_images.length; i++) {
					var regex = new RegExp("(.*?)\.(jpg|jpeg|png|gif)$");
					var results = regex.exec( pp_images[i] );
					if(!results){
						classname = 'default';
					}else{
						classname = '';
					}
					toInject += "<li class='"+classname+"'><a href='#'><img src='" + pp_images[i] + "' width='50' alt='' /></a></li>";
				};
				
				toInject = settings.gallery_markup.replace(/{gallery}/g,toInject);
				
				$pp_pic_holder.find('#pp_full_res').after(toInject);
				
				$pp_pic_holder.find('.pp_gallery .pp_arrow_next').click(function(){
					$.prettyPhoto.changeGalleryPage('next');
					$.prettyPhoto.stopSlideshow();
					return false;
				});
				
				$pp_pic_holder.find('.pp_gallery .pp_arrow_previous').click(function(){
					$.prettyPhoto.changeGalleryPage('previous');
					$.prettyPhoto.stopSlideshow();
					return false;
				});
				
				$pp_pic_holder.find('.pp_content').hover(
					function(){
						$pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeIn();
					},
					function(){
						$pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeOut();
					});

				itemWidth = 52+5; // 52 beign the thumb width, 5 being the right margin.
				$pp_pic_holder.find('.pp_gallery ul li').each(function(i){
					$(this).css({
						'position':'absolute',
						'left': i * itemWidth
					});

					$(this).find('a').unbind('click').click(function(){
						$.prettyPhoto.changePage(i);
						$.prettyPhoto.stopSlideshow();
						return false;
					});
				});
			};
			
			
			// Inject the play/pause if it's a slideshow
			if(settings.slideshow){
				$pp_pic_holder.find('.pp_nav').prepend('<a href="#" class="pp_play">Play</a>')
				$pp_pic_holder.find('.pp_nav .pp_play').click(function(){
					$.prettyPhoto.startSlideshow();
					return false;
				});
			}
			
			$pp_pic_holder.attr('class','pp_pic_holder ' + settings.theme); // Set the proper theme
			
			$pp_overlay
				.css({
					'opacity':0,
					'height':$(document).height(),
					'width':$(document).width()
					})
				.bind('click',function(){
					if(!settings.modal) $.prettyPhoto.close();
				});

			$('a.pp_close').bind('click',function(){ $.prettyPhoto.close(); return false; });

			$('a.pp_expand').bind('click',function(e){
				// Expand the image
				if($(this).hasClass('pp_expand')){
					$(this).removeClass('pp_expand').addClass('pp_contract');
					doresize = false;
				}else{
					$(this).removeClass('pp_contract').addClass('pp_expand');
					doresize = true;
				};
			
				_hideContent(function(){ $.prettyPhoto.open(); });
		
				return false;
			});
		
			$pp_pic_holder.find('.pp_previous, .pp_nav .pp_arrow_previous').bind('click',function(){
				$.prettyPhoto.changePage('previous');
				$.prettyPhoto.stopSlideshow();
				return false;
			});
		
			$pp_pic_holder.find('.pp_next, .pp_nav .pp_arrow_next').bind('click',function(){
				$.prettyPhoto.changePage('next');
				$.prettyPhoto.stopSlideshow();
				return false;
			});
			
			_center_overlay(); // Center it
		};
		
		return this.unbind('click').click($.prettyPhoto.initialize); // Return the jQuery object for chaining. The unbind method is used to avoid click conflict when the plugin is called more than once
	};
	
	function grab_param(name,url){
	  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
	  var regexS = "[\\?&]"+name+"=([^&#]*)";
	  var regex = new RegExp( regexS );
	  var results = regex.exec( url );
	  return ( results == null ) ? "" : results[1];
	}
	
})(jQuery);
/*jslint browser: true */ /*global jQuery: true */

/**
 * jQuery Cookie plugin
 *
 * Copyright (c) 2010 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */

// TODO JsDoc

/**
 * Create a cookie with the given key and value and other optional parameters.
 *
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Set the value of a cookie.
 * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
 * @desc Create a cookie with all available options.
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Create a session cookie.
 * @example $.cookie('the_cookie', null);
 * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
 *       used when the cookie was set.
 *
 * @param String key The key of the cookie.
 * @param String value The value of the cookie.
 * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
 * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
 *                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
 *                             If set to null or omitted, the cookie will be a session cookie and will not be retained
 *                             when the the browser exits.
 * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
 * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
 * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
 *                        require a secure protocol (like HTTPS).
 * @type undefined
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */

/**
 * Get the value of a cookie with the given key.
 *
 * @example $.cookie('the_cookie');
 * @desc Get the value of a cookie.
 *
 * @param String key The key of the cookie.
 * @return The value of the cookie.
 * @type String
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */
jQuery.cookie = function (key, value, options) {
    
    // key and at least value given, set cookie...
    if (arguments.length > 1 && String(value) !== "[object Object]") {
        options = jQuery.extend({}, options);

        if (value === null || value === undefined) {
            options.expires = -1;
        }

        if (typeof options.expires === 'number') {
            var days = options.expires, t = options.expires = new Date();
            t.setDate(t.getDate() + days);
        }
        
        value = String(value);
        
        return (document.cookie = [
            encodeURIComponent(key), '=',
            options.raw ? value : encodeURIComponent(value),
            options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
            options.path ? '; path=' + options.path : '',
            options.domain ? '; domain=' + options.domain : '',
            options.secure ? '; secure' : ''
        ].join(''));
    }

    // key and possibly options given, get cookie...
    options = value || {};
    var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent;
    return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null;
};


