;
/* AGGREGATED JS FILE: misc/jquery.js */
/*
 * jQuery 1.2.6 - New Wave Javascript
 *
 * Copyright (c) 2008 John Resig (jquery.com)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * $Date: 2008/09/12 15:33:12 $
 * $Rev: 5685 $
 */
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(H(){J w=1b.4M,3m$=1b.$;J D=1b.4M=1b.$=H(a,b){I 2B D.17.5j(a,b)};J u=/^[^<]*(<(.|\\s)+>)[^>]*$|^#(\\w+)$/,62=/^.[^:#\\[\\.]*$/,12;D.17=D.44={5j:H(d,b){d=d||S;G(d.16){7[0]=d;7.K=1;I 7}G(1j d=="23"){J c=u.2D(d);G(c&&(c[1]||!b)){G(c[1])d=D.4h([c[1]],b);N{J a=S.61(c[3]);G(a){G(a.2v!=c[3])I D().2q(d);I D(a)}d=[]}}N I D(b).2q(d)}N G(D.1D(d))I D(S)[D.17.27?"27":"43"](d);I 7.6Y(D.2d(d))},5w:"1.2.6",8G:H(){I 7.K},K:0,3p:H(a){I a==12?D.2d(7):7[a]},2I:H(b){J a=D(b);a.5n=7;I a},6Y:H(a){7.K=0;2p.44.1p.1w(7,a);I 7},P:H(a,b){I D.P(7,a,b)},5i:H(b){J a=-1;I D.2L(b&&b.5w?b[0]:b,7)},1K:H(c,a,b){J d=c;G(c.1q==56)G(a===12)I 7[0]&&D[b||"1K"](7[0],c);N{d={};d[c]=a}I 7.P(H(i){R(c 1n d)D.1K(b?7.V:7,c,D.1i(7,d[c],b,i,c))})},1g:H(b,a){G((b==\'2h\'||b==\'1Z\')&&3d(a)<0)a=12;I 7.1K(b,a,"2a")},1r:H(b){G(1j b!="49"&&b!=U)I 7.4E().3v((7[0]&&7[0].2z||S).5F(b));J a="";D.P(b||7,H(){D.P(7.3t,H(){G(7.16!=8)a+=7.16!=1?7.76:D.17.1r([7])})});I a},5z:H(b){G(7[0])D(b,7[0].2z).5y().39(7[0]).2l(H(){J a=7;1B(a.1x)a=a.1x;I a}).3v(7);I 7},8Y:H(a){I 7.P(H(){D(7).6Q().5z(a)})},8R:H(a){I 7.P(H(){D(7).5z(a)})},3v:H(){I 7.3W(19,M,Q,H(a){G(7.16==1)7.3U(a)})},6F:H(){I 7.3W(19,M,M,H(a){G(7.16==1)7.39(a,7.1x)})},6E:H(){I 7.3W(19,Q,Q,H(a){7.1d.39(a,7)})},5q:H(){I 7.3W(19,Q,M,H(a){7.1d.39(a,7.2H)})},3l:H(){I 7.5n||D([])},2q:H(b){J c=D.2l(7,H(a){I D.2q(b,a)});I 7.2I(/[^+>] [^+>]/.11(b)||b.1h("..")>-1?D.4r(c):c)},5y:H(e){J f=7.2l(H(){G(D.14.1f&&!D.4n(7)){J a=7.6o(M),5h=S.3h("1v");5h.3U(a);I D.4h([5h.4H])[0]}N I 7.6o(M)});J d=f.2q("*").5c().P(H(){G(7[E]!=12)7[E]=U});G(e===M)7.2q("*").5c().P(H(i){G(7.16==3)I;J c=D.L(7,"3w");R(J a 1n c)R(J b 1n c[a])D.W.1e(d[i],a,c[a][b],c[a][b].L)});I f},1E:H(b){I 7.2I(D.1D(b)&&D.3C(7,H(a,i){I b.1k(a,i)})||D.3g(b,7))},4Y:H(b){G(b.1q==56)G(62.11(b))I 7.2I(D.3g(b,7,M));N b=D.3g(b,7);J a=b.K&&b[b.K-1]!==12&&!b.16;I 7.1E(H(){I a?D.2L(7,b)<0:7!=b})},1e:H(a){I 7.2I(D.4r(D.2R(7.3p(),1j a==\'23\'?D(a):D.2d(a))))},3F:H(a){I!!a&&D.3g(a,7).K>0},7T:H(a){I 7.3F("."+a)},6e:H(b){G(b==12){G(7.K){J c=7[0];G(D.Y(c,"2A")){J e=c.64,63=[],15=c.15,2V=c.O=="2A-2V";G(e<0)I U;R(J i=2V?e:0,2f=2V?e+1:15.K;i<2f;i++){J d=15[i];G(d.2W){b=D.14.1f&&!d.at.2x.an?d.1r:d.2x;G(2V)I b;63.1p(b)}}I 63}N I(7[0].2x||"").1o(/\\r/g,"")}I 12}G(b.1q==4L)b+=\'\';I 7.P(H(){G(7.16!=1)I;G(b.1q==2p&&/5O|5L/.11(7.O))7.4J=(D.2L(7.2x,b)>=0||D.2L(7.34,b)>=0);N G(D.Y(7,"2A")){J a=D.2d(b);D("9R",7).P(H(){7.2W=(D.2L(7.2x,a)>=0||D.2L(7.1r,a)>=0)});G(!a.K)7.64=-1}N 7.2x=b})},2K:H(a){I a==12?(7[0]?7[0].4H:U):7.4E().3v(a)},7b:H(a){I 7.5q(a).21()},79:H(i){I 7.3s(i,i+1)},3s:H(){I 7.2I(2p.44.3s.1w(7,19))},2l:H(b){I 7.2I(D.2l(7,H(a,i){I b.1k(a,i,a)}))},5c:H(){I 7.1e(7.5n)},L:H(d,b){J a=d.1R(".");a[1]=a[1]?"."+a[1]:"";G(b===12){J c=7.5C("9z"+a[1]+"!",[a[0]]);G(c===12&&7.K)c=D.L(7[0],d);I c===12&&a[1]?7.L(a[0]):c}N I 7.1P("9u"+a[1]+"!",[a[0],b]).P(H(){D.L(7,d,b)})},3b:H(a){I 7.P(H(){D.3b(7,a)})},3W:H(g,f,h,d){J e=7.K>1,3x;I 7.P(H(){G(!3x){3x=D.4h(g,7.2z);G(h)3x.9o()}J b=7;G(f&&D.Y(7,"1T")&&D.Y(3x[0],"4F"))b=7.3H("22")[0]||7.3U(7.2z.3h("22"));J c=D([]);D.P(3x,H(){J a=e?D(7).5y(M)[0]:7;G(D.Y(a,"1m"))c=c.1e(a);N{G(a.16==1)c=c.1e(D("1m",a).21());d.1k(b,a)}});c.P(6T)})}};D.17.5j.44=D.17;H 6T(i,a){G(a.4d)D.3Y({1a:a.4d,31:Q,1O:"1m"});N D.5u(a.1r||a.6O||a.4H||"");G(a.1d)a.1d.37(a)}H 1z(){I+2B 8J}D.1l=D.17.1l=H(){J b=19[0]||{},i=1,K=19.K,4x=Q,15;G(b.1q==8I){4x=b;b=19[1]||{};i=2}G(1j b!="49"&&1j b!="H")b={};G(K==i){b=7;--i}R(;i<K;i++)G((15=19[i])!=U)R(J c 1n 15){J a=b[c],2w=15[c];G(b===2w)6M;G(4x&&2w&&1j 2w=="49"&&!2w.16)b[c]=D.1l(4x,a||(2w.K!=U?[]:{}),2w);N G(2w!==12)b[c]=2w}I b};J E="4M"+1z(),6K=0,5r={},6G=/z-?5i|8B-?8A|1y|6B|8v-?1Z/i,3P=S.3P||{};D.1l({8u:H(a){1b.$=3m$;G(a)1b.4M=w;I D},1D:H(a){I!!a&&1j a!="23"&&!a.Y&&a.1q!=2p&&/^[\\s[]?H/.11(a+"")},4n:H(a){I a.1C&&!a.1c||a.2j&&a.2z&&!a.2z.1c},5u:H(a){a=D.3k(a);G(a){J b=S.3H("6w")[0]||S.1C,1m=S.3h("1m");1m.O="1r/4t";G(D.14.1f)1m.1r=a;N 1m.3U(S.5F(a));b.39(1m,b.1x);b.37(1m)}},Y:H(b,a){I b.Y&&b.Y.2r()==a.2r()},1Y:{},L:H(c,d,b){c=c==1b?5r:c;J a=c[E];G(!a)a=c[E]=++6K;G(d&&!D.1Y[a])D.1Y[a]={};G(b!==12)D.1Y[a][d]=b;I d?D.1Y[a][d]:a},3b:H(c,b){c=c==1b?5r:c;J a=c[E];G(b){G(D.1Y[a]){2U D.1Y[a][b];b="";R(b 1n D.1Y[a])1X;G(!b)D.3b(c)}}N{1U{2U c[E]}1V(e){G(c.5l)c.5l(E)}2U D.1Y[a]}},P:H(d,a,c){J e,i=0,K=d.K;G(c){G(K==12){R(e 1n d)G(a.1w(d[e],c)===Q)1X}N R(;i<K;)G(a.1w(d[i++],c)===Q)1X}N{G(K==12){R(e 1n d)G(a.1k(d[e],e,d[e])===Q)1X}N R(J b=d[0];i<K&&a.1k(b,i,b)!==Q;b=d[++i]){}}I d},1i:H(b,a,c,i,d){G(D.1D(a))a=a.1k(b,i);I a&&a.1q==4L&&c=="2a"&&!6G.11(d)?a+"2X":a},1F:{1e:H(c,b){D.P((b||"").1R(/\\s+/),H(i,a){G(c.16==1&&!D.1F.3T(c.1F,a))c.1F+=(c.1F?" ":"")+a})},21:H(c,b){G(c.16==1)c.1F=b!=12?D.3C(c.1F.1R(/\\s+/),H(a){I!D.1F.3T(b,a)}).6s(" "):""},3T:H(b,a){I D.2L(a,(b.1F||b).6r().1R(/\\s+/))>-1}},6q:H(b,c,a){J e={};R(J d 1n c){e[d]=b.V[d];b.V[d]=c[d]}a.1k(b);R(J d 1n c)b.V[d]=e[d]},1g:H(d,e,c){G(e=="2h"||e=="1Z"){J b,3X={30:"5x",5g:"1G",18:"3I"},35=e=="2h"?["5e","6k"]:["5G","6i"];H 5b(){b=e=="2h"?d.8f:d.8c;J a=0,2C=0;D.P(35,H(){a+=3d(D.2a(d,"57"+7,M))||0;2C+=3d(D.2a(d,"2C"+7+"4b",M))||0});b-=29.83(a+2C)}G(D(d).3F(":4j"))5b();N D.6q(d,3X,5b);I 29.2f(0,b)}I D.2a(d,e,c)},2a:H(f,l,k){J e,V=f.V;H 3E(b){G(!D.14.2k)I Q;J a=3P.54(b,U);I!a||a.52("3E")==""}G(l=="1y"&&D.14.1f){e=D.1K(V,"1y");I e==""?"1":e}G(D.14.2G&&l=="18"){J d=V.50;V.50="0 7Y 7W";V.50=d}G(l.1I(/4i/i))l=y;G(!k&&V&&V[l])e=V[l];N G(3P.54){G(l.1I(/4i/i))l="4i";l=l.1o(/([A-Z])/g,"-$1").3y();J c=3P.54(f,U);G(c&&!3E(f))e=c.52(l);N{J g=[],2E=[],a=f,i=0;R(;a&&3E(a);a=a.1d)2E.6h(a);R(;i<2E.K;i++)G(3E(2E[i])){g[i]=2E[i].V.18;2E[i].V.18="3I"}e=l=="18"&&g[2E.K-1]!=U?"2F":(c&&c.52(l))||"";R(i=0;i<g.K;i++)G(g[i]!=U)2E[i].V.18=g[i]}G(l=="1y"&&e=="")e="1"}N G(f.4g){J h=l.1o(/\\-(\\w)/g,H(a,b){I b.2r()});e=f.4g[l]||f.4g[h];G(!/^\\d+(2X)?$/i.11(e)&&/^\\d/.11(e)){J j=V.1A,66=f.65.1A;f.65.1A=f.4g.1A;V.1A=e||0;e=V.aM+"2X";V.1A=j;f.65.1A=66}}I e},4h:H(l,h){J k=[];h=h||S;G(1j h.3h==\'12\')h=h.2z||h[0]&&h[0].2z||S;D.P(l,H(i,d){G(!d)I;G(d.1q==4L)d+=\'\';G(1j d=="23"){d=d.1o(/(<(\\w+)[^>]*?)\\/>/g,H(b,a,c){I c.1I(/^(aK|4f|7E|aG|4T|7A|aB|3n|az|ay|av)$/i)?b:a+"></"+c+">"});J f=D.3k(d).3y(),1v=h.3h("1v");J e=!f.1h("<au")&&[1,"<2A 7w=\'7w\'>","</2A>"]||!f.1h("<ar")&&[1,"<7v>","</7v>"]||f.1I(/^<(aq|22|am|ak|ai)/)&&[1,"<1T>","</1T>"]||!f.1h("<4F")&&[2,"<1T><22>","</22></1T>"]||(!f.1h("<af")||!f.1h("<ad"))&&[3,"<1T><22><4F>","</4F></22></1T>"]||!f.1h("<7E")&&[2,"<1T><22></22><7q>","</7q></1T>"]||D.14.1f&&[1,"1v<1v>","</1v>"]||[0,"",""];1v.4H=e[1]+d+e[2];1B(e[0]--)1v=1v.5T;G(D.14.1f){J g=!f.1h("<1T")&&f.1h("<22")<0?1v.1x&&1v.1x.3t:e[1]=="<1T>"&&f.1h("<22")<0?1v.3t:[];R(J j=g.K-1;j>=0;--j)G(D.Y(g[j],"22")&&!g[j].3t.K)g[j].1d.37(g[j]);G(/^\\s/.11(d))1v.39(h.5F(d.1I(/^\\s*/)[0]),1v.1x)}d=D.2d(1v.3t)}G(d.K===0&&(!D.Y(d,"3V")&&!D.Y(d,"2A")))I;G(d[0]==12||D.Y(d,"3V")||d.15)k.1p(d);N k=D.2R(k,d)});I k},1K:H(d,f,c){G(!d||d.16==3||d.16==8)I 12;J e=!D.4n(d),40=c!==12,1f=D.14.1f;f=e&&D.3X[f]||f;G(d.2j){J g=/5Q|4d|V/.11(f);G(f=="2W"&&D.14.2k)d.1d.64;G(f 1n d&&e&&!g){G(40){G(f=="O"&&D.Y(d,"4T")&&d.1d)7p"O a3 a1\'t 9V 9U";d[f]=c}G(D.Y(d,"3V")&&d.7i(f))I d.7i(f).76;I d[f]}G(1f&&e&&f=="V")I D.1K(d.V,"9T",c);G(40)d.9Q(f,""+c);J h=1f&&e&&g?d.4G(f,2):d.4G(f);I h===U?12:h}G(1f&&f=="1y"){G(40){d.6B=1;d.1E=(d.1E||"").1o(/7f\\([^)]*\\)/,"")+(3r(c)+\'\'=="9L"?"":"7f(1y="+c*7a+")")}I d.1E&&d.1E.1h("1y=")>=0?(3d(d.1E.1I(/1y=([^)]*)/)[1])/7a)+\'\':""}f=f.1o(/-([a-z])/9H,H(a,b){I b.2r()});G(40)d[f]=c;I d[f]},3k:H(a){I(a||"").1o(/^\\s+|\\s+$/g,"")},2d:H(b){J a=[];G(b!=U){J i=b.K;G(i==U||b.1R||b.4I||b.1k)a[0]=b;N 1B(i)a[--i]=b[i]}I a},2L:H(b,a){R(J i=0,K=a.K;i<K;i++)G(a[i]===b)I i;I-1},2R:H(a,b){J i=0,T,2S=a.K;G(D.14.1f){1B(T=b[i++])G(T.16!=8)a[2S++]=T}N 1B(T=b[i++])a[2S++]=T;I a},4r:H(a){J c=[],2o={};1U{R(J i=0,K=a.K;i<K;i++){J b=D.L(a[i]);G(!2o[b]){2o[b]=M;c.1p(a[i])}}}1V(e){c=a}I c},3C:H(c,a,d){J b=[];R(J i=0,K=c.K;i<K;i++)G(!d!=!a(c[i],i))b.1p(c[i]);I b},2l:H(d,a){J c=[];R(J i=0,K=d.K;i<K;i++){J b=a(d[i],i);G(b!=U)c[c.K]=b}I c.7d.1w([],c)}});J v=9B.9A.3y();D.14={5B:(v.1I(/.+(?:9y|9x|9w|9v)[\\/: ]([\\d.]+)/)||[])[1],2k:/75/.11(v),2G:/2G/.11(v),1f:/1f/.11(v)&&!/2G/.11(v),42:/42/.11(v)&&!/(9s|75)/.11(v)};J y=D.14.1f?"7o":"72";D.1l({71:!D.14.1f||S.70=="6Z",3X:{"R":"9n","9k":"1F","4i":y,72:y,7o:y,9h:"9f",9e:"9d",9b:"99"}});D.P({6W:H(a){I a.1d},97:H(a){I D.4S(a,"1d")},95:H(a){I D.3a(a,2,"2H")},91:H(a){I D.3a(a,2,"4l")},8Z:H(a){I D.4S(a,"2H")},8X:H(a){I D.4S(a,"4l")},8W:H(a){I D.5v(a.1d.1x,a)},8V:H(a){I D.5v(a.1x)},6Q:H(a){I D.Y(a,"8U")?a.8T||a.8S.S:D.2d(a.3t)}},H(c,d){D.17[c]=H(b){J a=D.2l(7,d);G(b&&1j b=="23")a=D.3g(b,a);I 7.2I(D.4r(a))}});D.P({6P:"3v",8Q:"6F",39:"6E",8P:"5q",8O:"7b"},H(c,b){D.17[c]=H(){J a=19;I 7.P(H(){R(J i=0,K=a.K;i<K;i++)D(a[i])[b](7)})}});D.P({8N:H(a){D.1K(7,a,"");G(7.16==1)7.5l(a)},8M:H(a){D.1F.1e(7,a)},8L:H(a){D.1F.21(7,a)},8K:H(a){D.1F[D.1F.3T(7,a)?"21":"1e"](7,a)},21:H(a){G(!a||D.1E(a,[7]).r.K){D("*",7).1e(7).P(H(){D.W.21(7);D.3b(7)});G(7.1d)7.1d.37(7)}},4E:H(){D(">*",7).21();1B(7.1x)7.37(7.1x)}},H(a,b){D.17[a]=H(){I 7.P(b,19)}});D.P(["6N","4b"],H(i,c){J b=c.3y();D.17[b]=H(a){I 7[0]==1b?D.14.2G&&S.1c["5t"+c]||D.14.2k&&1b["5s"+c]||S.70=="6Z"&&S.1C["5t"+c]||S.1c["5t"+c]:7[0]==S?29.2f(29.2f(S.1c["4y"+c],S.1C["4y"+c]),29.2f(S.1c["2i"+c],S.1C["2i"+c])):a==12?(7.K?D.1g(7[0],b):U):7.1g(b,a.1q==56?a:a+"2X")}});H 25(a,b){I a[0]&&3r(D.2a(a[0],b,M),10)||0}J C=D.14.2k&&3r(D.14.5B)<8H?"(?:[\\\\w*3m-]|\\\\\\\\.)":"(?:[\\\\w\\8F-\\8E*3m-]|\\\\\\\\.)",6L=2B 4v("^>\\\\s*("+C+"+)"),6J=2B 4v("^("+C+"+)(#)("+C+"+)"),6I=2B 4v("^([#.]?)("+C+"*)");D.1l({6H:{"":H(a,i,m){I m[2]=="*"||D.Y(a,m[2])},"#":H(a,i,m){I a.4G("2v")==m[2]},":":{8D:H(a,i,m){I i<m[3]-0},8C:H(a,i,m){I i>m[3]-0},3a:H(a,i,m){I m[3]-0==i},79:H(a,i,m){I m[3]-0==i},3o:H(a,i){I i==0},3S:H(a,i,m,r){I i==r.K-1},6D:H(a,i){I i%2==0},6C:H(a,i){I i%2},"3o-4u":H(a){I a.1d.3H("*")[0]==a},"3S-4u":H(a){I D.3a(a.1d.5T,1,"4l")==a},"8z-4u":H(a){I!D.3a(a.1d.5T,2,"4l")},6W:H(a){I a.1x},4E:H(a){I!a.1x},8y:H(a,i,m){I(a.6O||a.8x||D(a).1r()||"").1h(m[3])>=0},4j:H(a){I"1G"!=a.O&&D.1g(a,"18")!="2F"&&D.1g(a,"5g")!="1G"},1G:H(a){I"1G"==a.O||D.1g(a,"18")=="2F"||D.1g(a,"5g")=="1G"},8w:H(a){I!a.3R},3R:H(a){I a.3R},4J:H(a){I a.4J},2W:H(a){I a.2W||D.1K(a,"2W")},1r:H(a){I"1r"==a.O},5O:H(a){I"5O"==a.O},5L:H(a){I"5L"==a.O},5p:H(a){I"5p"==a.O},3Q:H(a){I"3Q"==a.O},5o:H(a){I"5o"==a.O},6A:H(a){I"6A"==a.O},6z:H(a){I"6z"==a.O},2s:H(a){I"2s"==a.O||D.Y(a,"2s")},4T:H(a){I/4T|2A|6y|2s/i.11(a.Y)},3T:H(a,i,m){I D.2q(m[3],a).K},8t:H(a){I/h\\d/i.11(a.Y)},8s:H(a){I D.3C(D.3O,H(b){I a==b.T}).K}}},6x:[/^(\\[) *@?([\\w-]+) *([!*$^~=]*) *(\'?"?)(.*?)\\4 *\\]/,/^(:)([\\w-]+)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/,2B 4v("^([:.#]*)("+C+"+)")],3g:H(a,c,b){J d,1t=[];1B(a&&a!=d){d=a;J f=D.1E(a,c,b);a=f.t.1o(/^\\s*,\\s*/,"");1t=b?c=f.r:D.2R(1t,f.r)}I 1t},2q:H(t,o){G(1j t!="23")I[t];G(o&&o.16!=1&&o.16!=9)I[];o=o||S;J d=[o],2o=[],3S,Y;1B(t&&3S!=t){J r=[];3S=t;t=D.3k(t);J l=Q,3j=6L,m=3j.2D(t);G(m){Y=m[1].2r();R(J i=0;d[i];i++)R(J c=d[i].1x;c;c=c.2H)G(c.16==1&&(Y=="*"||c.Y.2r()==Y))r.1p(c);d=r;t=t.1o(3j,"");G(t.1h(" ")==0)6M;l=M}N{3j=/^([>+~])\\s*(\\w*)/i;G((m=3j.2D(t))!=U){r=[];J k={};Y=m[2].2r();m=m[1];R(J j=0,3i=d.K;j<3i;j++){J n=m=="~"||m=="+"?d[j].2H:d[j].1x;R(;n;n=n.2H)G(n.16==1){J g=D.L(n);G(m=="~"&&k[g])1X;G(!Y||n.Y.2r()==Y){G(m=="~")k[g]=M;r.1p(n)}G(m=="+")1X}}d=r;t=D.3k(t.1o(3j,""));l=M}}G(t&&!l){G(!t.1h(",")){G(o==d[0])d.4s();2o=D.2R(2o,d);r=d=[o];t=" "+t.6v(1,t.K)}N{J h=6J;J m=h.2D(t);G(m){m=[0,m[2],m[3],m[1]]}N{h=6I;m=h.2D(t)}m[2]=m[2].1o(/\\\\/g,"");J f=d[d.K-1];G(m[1]=="#"&&f&&f.61&&!D.4n(f)){J p=f.61(m[2]);G((D.14.1f||D.14.2G)&&p&&1j p.2v=="23"&&p.2v!=m[2])p=D(\'[@2v="\'+m[2]+\'"]\',f)[0];d=r=p&&(!m[3]||D.Y(p,m[3]))?[p]:[]}N{R(J i=0;d[i];i++){J a=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];G(a=="*"&&d[i].Y.3y()=="49")a="3n";r=D.2R(r,d[i].3H(a))}G(m[1]==".")r=D.5m(r,m[2]);G(m[1]=="#"){J e=[];R(J i=0;r[i];i++)G(r[i].4G("2v")==m[2]){e=[r[i]];1X}r=e}d=r}t=t.1o(h,"")}}G(t){J b=D.1E(t,r);d=r=b.r;t=D.3k(b.t)}}G(t)d=[];G(d&&o==d[0])d.4s();2o=D.2R(2o,d);I 2o},5m:H(r,m,a){m=" "+m+" ";J c=[];R(J i=0;r[i];i++){J b=(" "+r[i].1F+" ").1h(m)>=0;G(!a&&b||a&&!b)c.1p(r[i])}I c},1E:H(t,r,h){J d;1B(t&&t!=d){d=t;J p=D.6x,m;R(J i=0;p[i];i++){m=p[i].2D(t);G(m){t=t.8r(m[0].K);m[2]=m[2].1o(/\\\\/g,"");1X}}G(!m)1X;G(m[1]==":"&&m[2]=="4Y")r=62.11(m[3])?D.1E(m[3],r,M).r:D(r).4Y(m[3]);N G(m[1]==".")r=D.5m(r,m[2],h);N G(m[1]=="["){J g=[],O=m[3];R(J i=0,3i=r.K;i<3i;i++){J a=r[i],z=a[D.3X[m[2]]||m[2]];G(z==U||/5Q|4d|2W/.11(m[2]))z=D.1K(a,m[2])||\'\';G((O==""&&!!z||O=="="&&z==m[5]||O=="!="&&z!=m[5]||O=="^="&&z&&!z.1h(m[5])||O=="$="&&z.6v(z.K-m[5].K)==m[5]||(O=="*="||O=="~=")&&z.1h(m[5])>=0)^h)g.1p(a)}r=g}N G(m[1]==":"&&m[2]=="3a-4u"){J e={},g=[],11=/(-?)(\\d*)n((?:\\+|-)?\\d*)/.2D(m[3]=="6D"&&"2n"||m[3]=="6C"&&"2n+1"||!/\\D/.11(m[3])&&"8q+"+m[3]||m[3]),3o=(11[1]+(11[2]||1))-0,d=11[3]-0;R(J i=0,3i=r.K;i<3i;i++){J j=r[i],1d=j.1d,2v=D.L(1d);G(!e[2v]){J c=1;R(J n=1d.1x;n;n=n.2H)G(n.16==1)n.4q=c++;e[2v]=M}J b=Q;G(3o==0){G(j.4q==d)b=M}N G((j.4q-d)%3o==0&&(j.4q-d)/3o>=0)b=M;G(b^h)g.1p(j)}r=g}N{J f=D.6H[m[1]];G(1j f=="49")f=f[m[2]];G(1j f=="23")f=6u("Q||H(a,i){I "+f+";}");r=D.3C(r,H(a,i){I f(a,i,m,r)},h)}}I{r:r,t:t}},4S:H(b,c){J a=[],1t=b[c];1B(1t&&1t!=S){G(1t.16==1)a.1p(1t);1t=1t[c]}I a},3a:H(a,e,c,b){e=e||1;J d=0;R(;a;a=a[c])G(a.16==1&&++d==e)1X;I a},5v:H(n,a){J r=[];R(;n;n=n.2H){G(n.16==1&&n!=a)r.1p(n)}I r}});D.W={1e:H(f,i,g,e){G(f.16==3||f.16==8)I;G(D.14.1f&&f.4I)f=1b;G(!g.24)g.24=7.24++;G(e!=12){J h=g;g=7.3M(h,H(){I h.1w(7,19)});g.L=e}J j=D.L(f,"3w")||D.L(f,"3w",{}),1H=D.L(f,"1H")||D.L(f,"1H",H(){G(1j D!="12"&&!D.W.5k)I D.W.1H.1w(19.3L.T,19)});1H.T=f;D.P(i.1R(/\\s+/),H(c,b){J a=b.1R(".");b=a[0];g.O=a[1];J d=j[b];G(!d){d=j[b]={};G(!D.W.2t[b]||D.W.2t[b].4p.1k(f)===Q){G(f.3K)f.3K(b,1H,Q);N G(f.6t)f.6t("4o"+b,1H)}}d[g.24]=g;D.W.26[b]=M});f=U},24:1,26:{},21:H(e,h,f){G(e.16==3||e.16==8)I;J i=D.L(e,"3w"),1L,5i;G(i){G(h==12||(1j h=="23"&&h.8p(0)=="."))R(J g 1n i)7.21(e,g+(h||""));N{G(h.O){f=h.2y;h=h.O}D.P(h.1R(/\\s+/),H(b,a){J c=a.1R(".");a=c[0];G(i[a]){G(f)2U i[a][f.24];N R(f 1n i[a])G(!c[1]||i[a][f].O==c[1])2U i[a][f];R(1L 1n i[a])1X;G(!1L){G(!D.W.2t[a]||D.W.2t[a].4A.1k(e)===Q){G(e.6p)e.6p(a,D.L(e,"1H"),Q);N G(e.6n)e.6n("4o"+a,D.L(e,"1H"))}1L=U;2U i[a]}}})}R(1L 1n i)1X;G(!1L){J d=D.L(e,"1H");G(d)d.T=U;D.3b(e,"3w");D.3b(e,"1H")}}},1P:H(h,c,f,g,i){c=D.2d(c);G(h.1h("!")>=0){h=h.3s(0,-1);J a=M}G(!f){G(7.26[h])D("*").1e([1b,S]).1P(h,c)}N{G(f.16==3||f.16==8)I 12;J b,1L,17=D.1D(f[h]||U),W=!c[0]||!c[0].32;G(W){c.6h({O:h,2J:f,32:H(){},3J:H(){},4C:1z()});c[0][E]=M}c[0].O=h;G(a)c[0].6m=M;J d=D.L(f,"1H");G(d)b=d.1w(f,c);G((!17||(D.Y(f,\'a\')&&h=="4V"))&&f["4o"+h]&&f["4o"+h].1w(f,c)===Q)b=Q;G(W)c.4s();G(i&&D.1D(i)){1L=i.1w(f,b==U?c:c.7d(b));G(1L!==12)b=1L}G(17&&g!==Q&&b!==Q&&!(D.Y(f,\'a\')&&h=="4V")){7.5k=M;1U{f[h]()}1V(e){}}7.5k=Q}I b},1H:H(b){J a,1L,38,5f,4m;b=19[0]=D.W.6l(b||1b.W);38=b.O.1R(".");b.O=38[0];38=38[1];5f=!38&&!b.6m;4m=(D.L(7,"3w")||{})[b.O];R(J j 1n 4m){J c=4m[j];G(5f||c.O==38){b.2y=c;b.L=c.L;1L=c.1w(7,19);G(a!==Q)a=1L;G(1L===Q){b.32();b.3J()}}}I a},6l:H(b){G(b[E]==M)I b;J d=b;b={8o:d};J c="8n 8m 8l 8k 2s 8j 47 5d 6j 5E 8i L 8h 8g 4K 2y 5a 59 8e 8b 58 6f 8a 88 4k 87 86 84 6d 2J 4C 6c O 82 81 35".1R(" ");R(J i=c.K;i;i--)b[c[i]]=d[c[i]];b[E]=M;b.32=H(){G(d.32)d.32();d.80=Q};b.3J=H(){G(d.3J)d.3J();d.7Z=M};b.4C=b.4C||1z();G(!b.2J)b.2J=b.6d||S;G(b.2J.16==3)b.2J=b.2J.1d;G(!b.4k&&b.4K)b.4k=b.4K==b.2J?b.6c:b.4K;G(b.58==U&&b.5d!=U){J a=S.1C,1c=S.1c;b.58=b.5d+(a&&a.2e||1c&&1c.2e||0)-(a.6b||0);b.6f=b.6j+(a&&a.2c||1c&&1c.2c||0)-(a.6a||0)}G(!b.35&&((b.47||b.47===0)?b.47:b.5a))b.35=b.47||b.5a;G(!b.59&&b.5E)b.59=b.5E;G(!b.35&&b.2s)b.35=(b.2s&1?1:(b.2s&2?3:(b.2s&4?2:0)));I b},3M:H(a,b){b.24=a.24=a.24||b.24||7.24++;I b},2t:{27:{4p:H(){55();I},4A:H(){I}},3D:{4p:H(){G(D.14.1f)I Q;D(7).2O("53",D.W.2t.3D.2y);I M},4A:H(){G(D.14.1f)I Q;D(7).4e("53",D.W.2t.3D.2y);I M},2y:H(a){G(F(a,7))I M;a.O="3D";I D.W.1H.1w(7,19)}},3N:{4p:H(){G(D.14.1f)I Q;D(7).2O("51",D.W.2t.3N.2y);I M},4A:H(){G(D.14.1f)I Q;D(7).4e("51",D.W.2t.3N.2y);I M},2y:H(a){G(F(a,7))I M;a.O="3N";I D.W.1H.1w(7,19)}}}};D.17.1l({2O:H(c,a,b){I c=="4X"?7.2V(c,a,b):7.P(H(){D.W.1e(7,c,b||a,b&&a)})},2V:H(d,b,c){J e=D.W.3M(c||b,H(a){D(7).4e(a,e);I(c||b).1w(7,19)});I 7.P(H(){D.W.1e(7,d,e,c&&b)})},4e:H(a,b){I 7.P(H(){D.W.21(7,a,b)})},1P:H(c,a,b){I 7.P(H(){D.W.1P(c,a,7,M,b)})},5C:H(c,a,b){I 7[0]&&D.W.1P(c,a,7[0],Q,b)},2m:H(b){J c=19,i=1;1B(i<c.K)D.W.3M(b,c[i++]);I 7.4V(D.W.3M(b,H(a){7.4Z=(7.4Z||0)%i;a.32();I c[7.4Z++].1w(7,19)||Q}))},7X:H(a,b){I 7.2O(\'3D\',a).2O(\'3N\',b)},27:H(a){55();G(D.2Q)a.1k(S,D);N D.3A.1p(H(){I a.1k(7,D)});I 7}});D.1l({2Q:Q,3A:[],27:H(){G(!D.2Q){D.2Q=M;G(D.3A){D.P(D.3A,H(){7.1k(S)});D.3A=U}D(S).5C("27")}}});J x=Q;H 55(){G(x)I;x=M;G(S.3K&&!D.14.2G)S.3K("69",D.27,Q);G(D.14.1f&&1b==1S)(H(){G(D.2Q)I;1U{S.1C.7V("1A")}1V(3e){3B(19.3L,0);I}D.27()})();G(D.14.2G)S.3K("69",H(){G(D.2Q)I;R(J i=0;i<S.4W.K;i++)G(S.4W[i].3R){3B(19.3L,0);I}D.27()},Q);G(D.14.2k){J a;(H(){G(D.2Q)I;G(S.3f!="68"&&S.3f!="1J"){3B(19.3L,0);I}G(a===12)a=D("V, 7A[7U=7S]").K;G(S.4W.K!=a){3B(19.3L,0);I}D.27()})()}D.W.1e(1b,"43",D.27)}D.P(("7R,7Q,43,85,4y,4X,4V,7P,"+"7O,7N,89,53,51,7M,2A,"+"5o,7L,7K,8d,3e").1R(","),H(i,b){D.17[b]=H(a){I a?7.2O(b,a):7.1P(b)}});J F=H(a,c){J b=a.4k;1B(b&&b!=c)1U{b=b.1d}1V(3e){b=c}I b==c};D(1b).2O("4X",H(){D("*").1e(S).4e()});D.17.1l({67:D.17.43,43:H(g,d,c){G(1j g!=\'23\')I 7.67(g);J e=g.1h(" ");G(e>=0){J i=g.3s(e,g.K);g=g.3s(0,e)}c=c||H(){};J f="2P";G(d)G(D.1D(d)){c=d;d=U}N{d=D.3n(d);f="6g"}J h=7;D.3Y({1a:g,O:f,1O:"2K",L:d,1J:H(a,b){G(b=="1W"||b=="7J")h.2K(i?D("<1v/>").3v(a.4U.1o(/<1m(.|\\s)*?\\/1m>/g,"")).2q(i):a.4U);h.P(c,[a.4U,b,a])}});I 7},aL:H(){I D.3n(7.7I())},7I:H(){I 7.2l(H(){I D.Y(7,"3V")?D.2d(7.aH):7}).1E(H(){I 7.34&&!7.3R&&(7.4J||/2A|6y/i.11(7.Y)||/1r|1G|3Q/i.11(7.O))}).2l(H(i,c){J b=D(7).6e();I b==U?U:b.1q==2p?D.2l(b,H(a,i){I{34:c.34,2x:a}}):{34:c.34,2x:b}}).3p()}});D.P("7H,7G,7F,7D,7C,7B".1R(","),H(i,o){D.17[o]=H(f){I 7.2O(o,f)}});J B=1z();D.1l({3p:H(d,b,a,c){G(D.1D(b)){a=b;b=U}I D.3Y({O:"2P",1a:d,L:b,1W:a,1O:c})},aE:H(b,a){I D.3p(b,U,a,"1m")},aD:H(c,b,a){I D.3p(c,b,a,"3z")},aC:H(d,b,a,c){G(D.1D(b)){a=b;b={}}I D.3Y({O:"6g",1a:d,L:b,1W:a,1O:c})},aA:H(a){D.1l(D.60,a)},60:{1a:5Z.5Q,26:M,O:"2P",2T:0,7z:"4R/x-ax-3V-aw",7x:M,31:M,L:U,5Y:U,3Q:U,4Q:{2N:"4R/2N, 1r/2N",2K:"1r/2K",1m:"1r/4t, 4R/4t",3z:"4R/3z, 1r/4t",1r:"1r/as",4w:"*/*"}},4z:{},3Y:H(s){s=D.1l(M,s,D.1l(M,{},D.60,s));J g,2Z=/=\\?(&|$)/g,1u,L,O=s.O.2r();G(s.L&&s.7x&&1j s.L!="23")s.L=D.3n(s.L);G(s.1O=="4P"){G(O=="2P"){G(!s.1a.1I(2Z))s.1a+=(s.1a.1I(/\\?/)?"&":"?")+(s.4P||"7u")+"=?"}N G(!s.L||!s.L.1I(2Z))s.L=(s.L?s.L+"&":"")+(s.4P||"7u")+"=?";s.1O="3z"}G(s.1O=="3z"&&(s.L&&s.L.1I(2Z)||s.1a.1I(2Z))){g="4P"+B++;G(s.L)s.L=(s.L+"").1o(2Z,"="+g+"$1");s.1a=s.1a.1o(2Z,"="+g+"$1");s.1O="1m";1b[g]=H(a){L=a;1W();1J();1b[g]=12;1U{2U 1b[g]}1V(e){}G(i)i.37(h)}}G(s.1O=="1m"&&s.1Y==U)s.1Y=Q;G(s.1Y===Q&&O=="2P"){J j=1z();J k=s.1a.1o(/(\\?|&)3m=.*?(&|$)/,"$ap="+j+"$2");s.1a=k+((k==s.1a)?(s.1a.1I(/\\?/)?"&":"?")+"3m="+j:"")}G(s.L&&O=="2P"){s.1a+=(s.1a.1I(/\\?/)?"&":"?")+s.L;s.L=U}G(s.26&&!D.4O++)D.W.1P("7H");J n=/^(?:\\w+:)?\\/\\/([^\\/?#]+)/;G(s.1O=="1m"&&O=="2P"&&n.11(s.1a)&&n.2D(s.1a)[1]!=5Z.al){J i=S.3H("6w")[0];J h=S.3h("1m");h.4d=s.1a;G(s.7t)h.aj=s.7t;G(!g){J l=Q;h.ah=h.ag=H(){G(!l&&(!7.3f||7.3f=="68"||7.3f=="1J")){l=M;1W();1J();i.37(h)}}}i.3U(h);I 12}J m=Q;J c=1b.7s?2B 7s("ae.ac"):2B 7r();G(s.5Y)c.6R(O,s.1a,s.31,s.5Y,s.3Q);N c.6R(O,s.1a,s.31);1U{G(s.L)c.4B("ab-aa",s.7z);G(s.5S)c.4B("a9-5R-a8",D.4z[s.1a]||"a7, a6 a5 a4 5N:5N:5N a2");c.4B("X-9Z-9Y","7r");c.4B("9W",s.1O&&s.4Q[s.1O]?s.4Q[s.1O]+", */*":s.4Q.4w)}1V(e){}G(s.7m&&s.7m(c,s)===Q){s.26&&D.4O--;c.7l();I Q}G(s.26)D.W.1P("7B",[c,s]);J d=H(a){G(!m&&c&&(c.3f==4||a=="2T")){m=M;G(f){7k(f);f=U}1u=a=="2T"&&"2T"||!D.7j(c)&&"3e"||s.5S&&D.7h(c,s.1a)&&"7J"||"1W";G(1u=="1W"){1U{L=D.6X(c,s.1O,s.9S)}1V(e){1u="5J"}}G(1u=="1W"){J b;1U{b=c.5I("7g-5R")}1V(e){}G(s.5S&&b)D.4z[s.1a]=b;G(!g)1W()}N D.5H(s,c,1u);1J();G(s.31)c=U}};G(s.31){J f=4I(d,13);G(s.2T>0)3B(H(){G(c){c.7l();G(!m)d("2T")}},s.2T)}1U{c.9P(s.L)}1V(e){D.5H(s,c,U,e)}G(!s.31)d();H 1W(){G(s.1W)s.1W(L,1u);G(s.26)D.W.1P("7C",[c,s])}H 1J(){G(s.1J)s.1J(c,1u);G(s.26)D.W.1P("7F",[c,s]);G(s.26&&!--D.4O)D.W.1P("7G")}I c},5H:H(s,a,b,e){G(s.3e)s.3e(a,b,e);G(s.26)D.W.1P("7D",[a,s,e])},4O:0,7j:H(a){1U{I!a.1u&&5Z.9O=="5p:"||(a.1u>=7e&&a.1u<9N)||a.1u==7c||a.1u==9K||D.14.2k&&a.1u==12}1V(e){}I Q},7h:H(a,c){1U{J b=a.5I("7g-5R");I a.1u==7c||b==D.4z[c]||D.14.2k&&a.1u==12}1V(e){}I Q},6X:H(a,c,b){J d=a.5I("9J-O"),2N=c=="2N"||!c&&d&&d.1h("2N")>=0,L=2N?a.9I:a.4U;G(2N&&L.1C.2j=="5J")7p"5J";G(b)L=b(L,c);G(c=="1m")D.5u(L);G(c=="3z")L=6u("("+L+")");I L},3n:H(a){J s=[];G(a.1q==2p||a.5w)D.P(a,H(){s.1p(3u(7.34)+"="+3u(7.2x))});N R(J j 1n a)G(a[j]&&a[j].1q==2p)D.P(a[j],H(){s.1p(3u(j)+"="+3u(7))});N s.1p(3u(j)+"="+3u(D.1D(a[j])?a[j]():a[j]));I s.6s("&").1o(/%20/g,"+")}});D.17.1l({1N:H(c,b){I c?7.2g({1Z:"1N",2h:"1N",1y:"1N"},c,b):7.1E(":1G").P(H(){7.V.18=7.5D||"";G(D.1g(7,"18")=="2F"){J a=D("<"+7.2j+" />").6P("1c");7.V.18=a.1g("18");G(7.V.18=="2F")7.V.18="3I";a.21()}}).3l()},1M:H(b,a){I b?7.2g({1Z:"1M",2h:"1M",1y:"1M"},b,a):7.1E(":4j").P(H(){7.5D=7.5D||D.1g(7,"18");7.V.18="2F"}).3l()},78:D.17.2m,2m:H(a,b){I D.1D(a)&&D.1D(b)?7.78.1w(7,19):a?7.2g({1Z:"2m",2h:"2m",1y:"2m"},a,b):7.P(H(){D(7)[D(7).3F(":1G")?"1N":"1M"]()})},9G:H(b,a){I 7.2g({1Z:"1N"},b,a)},9F:H(b,a){I 7.2g({1Z:"1M"},b,a)},9E:H(b,a){I 7.2g({1Z:"2m"},b,a)},9D:H(b,a){I 7.2g({1y:"1N"},b,a)},9M:H(b,a){I 7.2g({1y:"1M"},b,a)},9C:H(c,a,b){I 7.2g({1y:a},c,b)},2g:H(k,j,i,g){J h=D.77(j,i,g);I 7[h.36===Q?"P":"36"](H(){G(7.16!=1)I Q;J f=D.1l({},h),p,1G=D(7).3F(":1G"),46=7;R(p 1n k){G(k[p]=="1M"&&1G||k[p]=="1N"&&!1G)I f.1J.1k(7);G(p=="1Z"||p=="2h"){f.18=D.1g(7,"18");f.33=7.V.33}}G(f.33!=U)7.V.33="1G";f.45=D.1l({},k);D.P(k,H(c,a){J e=2B D.28(46,f,c);G(/2m|1N|1M/.11(a))e[a=="2m"?1G?"1N":"1M":a](k);N{J b=a.6r().1I(/^([+-]=)?([\\d+-.]+)(.*)$/),2b=e.1t(M)||0;G(b){J d=3d(b[2]),2M=b[3]||"2X";G(2M!="2X"){46.V[c]=(d||1)+2M;2b=((d||1)/e.1t(M))*2b;46.V[c]=2b+2M}G(b[1])d=((b[1]=="-="?-1:1)*d)+2b;e.3G(2b,d,2M)}N e.3G(2b,a,"")}});I M})},36:H(a,b){G(D.1D(a)||(a&&a.1q==2p)){b=a;a="28"}G(!a||(1j a=="23"&&!b))I A(7[0],a);I 7.P(H(){G(b.1q==2p)A(7,a,b);N{A(7,a).1p(b);G(A(7,a).K==1)b.1k(7)}})},9X:H(b,c){J a=D.3O;G(b)7.36([]);7.P(H(){R(J i=a.K-1;i>=0;i--)G(a[i].T==7){G(c)a[i](M);a.7n(i,1)}});G(!c)7.5A();I 7}});J A=H(b,c,a){G(b){c=c||"28";J q=D.L(b,c+"36");G(!q||a)q=D.L(b,c+"36",D.2d(a))}I q};D.17.5A=H(a){a=a||"28";I 7.P(H(){J q=A(7,a);q.4s();G(q.K)q[0].1k(7)})};D.1l({77:H(b,a,c){J d=b&&b.1q==a0?b:{1J:c||!c&&a||D.1D(b)&&b,2u:b,41:c&&a||a&&a.1q!=9t&&a};d.2u=(d.2u&&d.2u.1q==4L?d.2u:D.28.5K[d.2u])||D.28.5K.74;d.5M=d.1J;d.1J=H(){G(d.36!==Q)D(7).5A();G(D.1D(d.5M))d.5M.1k(7)};I d},41:{73:H(p,n,b,a){I b+a*p},5P:H(p,n,b,a){I((-29.9r(p*29.9q)/2)+0.5)*a+b}},3O:[],48:U,28:H(b,c,a){7.15=c;7.T=b;7.1i=a;G(!c.3Z)c.3Z={}}});D.28.44={4D:H(){G(7.15.2Y)7.15.2Y.1k(7.T,7.1z,7);(D.28.2Y[7.1i]||D.28.2Y.4w)(7);G(7.1i=="1Z"||7.1i=="2h")7.T.V.18="3I"},1t:H(a){G(7.T[7.1i]!=U&&7.T.V[7.1i]==U)I 7.T[7.1i];J r=3d(D.1g(7.T,7.1i,a));I r&&r>-9p?r:3d(D.2a(7.T,7.1i))||0},3G:H(c,b,d){7.5V=1z();7.2b=c;7.3l=b;7.2M=d||7.2M||"2X";7.1z=7.2b;7.2S=7.4N=0;7.4D();J e=7;H t(a){I e.2Y(a)}t.T=7.T;D.3O.1p(t);G(D.48==U){D.48=4I(H(){J a=D.3O;R(J i=0;i<a.K;i++)G(!a[i]())a.7n(i--,1);G(!a.K){7k(D.48);D.48=U}},13)}},1N:H(){7.15.3Z[7.1i]=D.1K(7.T.V,7.1i);7.15.1N=M;7.3G(0,7.1t());G(7.1i=="2h"||7.1i=="1Z")7.T.V[7.1i]="9m";D(7.T).1N()},1M:H(){7.15.3Z[7.1i]=D.1K(7.T.V,7.1i);7.15.1M=M;7.3G(7.1t(),0)},2Y:H(a){J t=1z();G(a||t>7.15.2u+7.5V){7.1z=7.3l;7.2S=7.4N=1;7.4D();7.15.45[7.1i]=M;J b=M;R(J i 1n 7.15.45)G(7.15.45[i]!==M)b=Q;G(b){G(7.15.18!=U){7.T.V.33=7.15.33;7.T.V.18=7.15.18;G(D.1g(7.T,"18")=="2F")7.T.V.18="3I"}G(7.15.1M)7.T.V.18="2F";G(7.15.1M||7.15.1N)R(J p 1n 7.15.45)D.1K(7.T.V,p,7.15.3Z[p])}G(b)7.15.1J.1k(7.T);I Q}N{J n=t-7.5V;7.4N=n/7.15.2u;7.2S=D.41[7.15.41||(D.41.5P?"5P":"73")](7.4N,n,0,1,7.15.2u);7.1z=7.2b+((7.3l-7.2b)*7.2S);7.4D()}I M}};D.1l(D.28,{5K:{9l:9j,9i:7e,74:9g},2Y:{2e:H(a){a.T.2e=a.1z},2c:H(a){a.T.2c=a.1z},1y:H(a){D.1K(a.T.V,"1y",a.1z)},4w:H(a){a.T.V[a.1i]=a.1z+a.2M}}});D.17.2i=H(){J b=0,1S=0,T=7[0],3q;G(T)ao(D.14){J d=T.1d,4a=T,1s=T.1s,1Q=T.2z,5U=2k&&3r(5B)<9c&&!/9a/i.11(v),1g=D.2a,3c=1g(T,"30")=="3c";G(T.7y){J c=T.7y();1e(c.1A+29.2f(1Q.1C.2e,1Q.1c.2e),c.1S+29.2f(1Q.1C.2c,1Q.1c.2c));1e(-1Q.1C.6b,-1Q.1C.6a)}N{1e(T.5X,T.5W);1B(1s){1e(1s.5X,1s.5W);G(42&&!/^t(98|d|h)$/i.11(1s.2j)||2k&&!5U)2C(1s);G(!3c&&1g(1s,"30")=="3c")3c=M;4a=/^1c$/i.11(1s.2j)?4a:1s;1s=1s.1s}1B(d&&d.2j&&!/^1c|2K$/i.11(d.2j)){G(!/^96|1T.*$/i.11(1g(d,"18")))1e(-d.2e,-d.2c);G(42&&1g(d,"33")!="4j")2C(d);d=d.1d}G((5U&&(3c||1g(4a,"30")=="5x"))||(42&&1g(4a,"30")!="5x"))1e(-1Q.1c.5X,-1Q.1c.5W);G(3c)1e(29.2f(1Q.1C.2e,1Q.1c.2e),29.2f(1Q.1C.2c,1Q.1c.2c))}3q={1S:1S,1A:b}}H 2C(a){1e(D.2a(a,"6V",M),D.2a(a,"6U",M))}H 1e(l,t){b+=3r(l,10)||0;1S+=3r(t,10)||0}I 3q};D.17.1l({30:H(){J a=0,1S=0,3q;G(7[0]){J b=7.1s(),2i=7.2i(),4c=/^1c|2K$/i.11(b[0].2j)?{1S:0,1A:0}:b.2i();2i.1S-=25(7,\'94\');2i.1A-=25(7,\'aF\');4c.1S+=25(b,\'6U\');4c.1A+=25(b,\'6V\');3q={1S:2i.1S-4c.1S,1A:2i.1A-4c.1A}}I 3q},1s:H(){J a=7[0].1s;1B(a&&(!/^1c|2K$/i.11(a.2j)&&D.1g(a,\'30\')==\'93\'))a=a.1s;I D(a)}});D.P([\'5e\',\'5G\'],H(i,b){J c=\'4y\'+b;D.17[c]=H(a){G(!7[0])I;I a!=12?7.P(H(){7==1b||7==S?1b.92(!i?a:D(1b).2e(),i?a:D(1b).2c()):7[c]=a}):7[0]==1b||7[0]==S?46[i?\'aI\':\'aJ\']||D.71&&S.1C[c]||S.1c[c]:7[0][c]}});D.P(["6N","4b"],H(i,b){J c=i?"5e":"5G",4f=i?"6k":"6i";D.17["5s"+b]=H(){I 7[b.3y()]()+25(7,"57"+c)+25(7,"57"+4f)};D.17["90"+b]=H(a){I 7["5s"+b]()+25(7,"2C"+c+"4b")+25(7,"2C"+4f+"4b")+(a?25(7,"6S"+c)+25(7,"6S"+4f):0)}})})();',62,669,'|||||||this|||||||||||||||||||||||||||||||||||if|function|return|var|length|data|true|else|type|each|false|for|document|elem|null|style|event||nodeName|||test|undefined||browser|options|nodeType|fn|display|arguments|url|window|body|parentNode|add|msie|css|indexOf|prop|typeof|call|extend|script|in|replace|push|constructor|text|offsetParent|cur|status|div|apply|firstChild|opacity|now|left|while|documentElement|isFunction|filter|className|hidden|handle|match|complete|attr|ret|hide|show|dataType|trigger|doc|split|top|table|try|catch|success|break|cache|height||remove|tbody|string|guid|num|global|ready|fx|Math|curCSS|start|scrollTop|makeArray|scrollLeft|max|animate|width|offset|tagName|safari|map|toggle||done|Array|find|toUpperCase|button|special|duration|id|copy|value|handler|ownerDocument|select|new|border|exec|stack|none|opera|nextSibling|pushStack|target|html|inArray|unit|xml|bind|GET|isReady|merge|pos|timeout|delete|one|selected|px|step|jsre|position|async|preventDefault|overflow|name|which|queue|removeChild|namespace|insertBefore|nth|removeData|fixed|parseFloat|error|readyState|multiFilter|createElement|rl|re|trim|end|_|param|first|get|results|parseInt|slice|childNodes|encodeURIComponent|append|events|elems|toLowerCase|json|readyList|setTimeout|grep|mouseenter|color|is|custom|getElementsByTagName|block|stopPropagation|addEventListener|callee|proxy|mouseleave|timers|defaultView|password|disabled|last|has|appendChild|form|domManip|props|ajax|orig|set|easing|mozilla|load|prototype|curAnim|self|charCode|timerId|object|offsetChild|Width|parentOffset|src|unbind|br|currentStyle|clean|float|visible|relatedTarget|previousSibling|handlers|isXMLDoc|on|setup|nodeIndex|unique|shift|javascript|child|RegExp|_default|deep|scroll|lastModified|teardown|setRequestHeader|timeStamp|update|empty|tr|getAttribute|innerHTML|setInterval|checked|fromElement|Number|jQuery|state|active|jsonp|accepts|application|dir|input|responseText|click|styleSheets|unload|not|lastToggle|outline|mouseout|getPropertyValue|mouseover|getComputedStyle|bindReady|String|padding|pageX|metaKey|keyCode|getWH|andSelf|clientX|Left|all|visibility|container|index|init|triggered|removeAttribute|classFilter|prevObject|submit|file|after|windowData|inner|client|globalEval|sibling|jquery|absolute|clone|wrapAll|dequeue|version|triggerHandler|oldblock|ctrlKey|createTextNode|Top|handleError|getResponseHeader|parsererror|speeds|checkbox|old|00|radio|swing|href|Modified|ifModified|lastChild|safari2|startTime|offsetTop|offsetLeft|username|location|ajaxSettings|getElementById|isSimple|values|selectedIndex|runtimeStyle|rsLeft|_load|loaded|DOMContentLoaded|clientTop|clientLeft|toElement|srcElement|val|pageY|POST|unshift|Bottom|clientY|Right|fix|exclusive|detachEvent|cloneNode|removeEventListener|swap|toString|join|attachEvent|eval|substr|head|parse|textarea|reset|image|zoom|odd|even|before|prepend|exclude|expr|quickClass|quickID|uuid|quickChild|continue|Height|textContent|appendTo|contents|open|margin|evalScript|borderTopWidth|borderLeftWidth|parent|httpData|setArray|CSS1Compat|compatMode|boxModel|cssFloat|linear|def|webkit|nodeValue|speed|_toggle|eq|100|replaceWith|304|concat|200|alpha|Last|httpNotModified|getAttributeNode|httpSuccess|clearInterval|abort|beforeSend|splice|styleFloat|throw|colgroup|XMLHttpRequest|ActiveXObject|scriptCharset|callback|fieldset|multiple|processData|getBoundingClientRect|contentType|link|ajaxSend|ajaxSuccess|ajaxError|col|ajaxComplete|ajaxStop|ajaxStart|serializeArray|notmodified|keypress|keydown|change|mouseup|mousedown|dblclick|focus|blur|stylesheet|hasClass|rel|doScroll|black|hover|solid|cancelBubble|returnValue|wheelDelta|view|round|shiftKey|resize|screenY|screenX|relatedNode|mousemove|prevValue|originalTarget|offsetHeight|keyup|newValue|offsetWidth|eventPhase|detail|currentTarget|cancelable|bubbles|attrName|attrChange|altKey|originalEvent|charAt|0n|substring|animated|header|noConflict|line|enabled|innerText|contains|only|weight|font|gt|lt|uFFFF|u0128|size|417|Boolean|Date|toggleClass|removeClass|addClass|removeAttr|replaceAll|insertAfter|prependTo|wrap|contentWindow|contentDocument|iframe|children|siblings|prevAll|wrapInner|nextAll|outer|prev|scrollTo|static|marginTop|next|inline|parents|able|cellSpacing|adobeair|cellspacing|522|maxLength|maxlength|readOnly|400|readonly|fast|600|class|slow|1px|htmlFor|reverse|10000|PI|cos|compatible|Function|setData|ie|ra|it|rv|getData|userAgent|navigator|fadeTo|fadeIn|slideToggle|slideUp|slideDown|ig|responseXML|content|1223|NaN|fadeOut|300|protocol|send|setAttribute|option|dataFilter|cssText|changed|be|Accept|stop|With|Requested|Object|can|GMT|property|1970|Jan|01|Thu|Since|If|Type|Content|XMLHTTP|th|Microsoft|td|onreadystatechange|onload|cap|charset|colg|host|tfoot|specified|with|1_|thead|leg|plain|attributes|opt|embed|urlencoded|www|area|hr|ajaxSetup|meta|post|getJSON|getScript|marginLeft|img|elements|pageYOffset|pageXOffset|abbr|serialize|pixelLeft'.split('|'),0,{}))
;
/* AGGREGATED JS FILE: misc/drupal.js */
// $Id: drupal.js,v 1.1 2008/08/28 19:06:04 akumar Exp $

var Drupal = Drupal || {};

/**
 * Set the variable that indicates if JavaScript behaviors should be applied
 */
Drupal.jsEnabled = document.getElementsByTagName && document.createElement && document.createTextNode && document.documentElement && document.getElementById;

/**
 * Extends the current object with the parameter. Works recursively.
 */
Drupal.extend = function(obj) {
  for (var i in obj) {
    if (this[i]) {
      Drupal.extend.apply(this[i], [obj[i]]);
    }
    else {
      this[i] = obj[i];
    }
  }
};

/**
 * Redirects a button's form submission to a hidden iframe and displays the result
 * in a given wrapper. The iframe should contain a call to
 * window.parent.iframeHandler() after submission.
 */
Drupal.redirectFormButton = function (uri, button, handler) {
  // Trap the button
  button.onmouseover = button.onfocus = function() {
    button.onclick = function() {
      // Create target iframe
      Drupal.createIframe();

      // Prepare variables for use in anonymous function.
      var button = this;
      var action = button.form.action;
      var target = button.form.target;

      // Redirect form submission to iframe
      this.form.action = uri;
      this.form.target = 'redirect-target';

      handler.onsubmit();

      // Set iframe handler for later
      window.iframeHandler = function () {
        var iframe = $('#redirect-target').get(0);
        // Restore form submission
        button.form.action = action;
        button.form.target = target;

        // Get response from iframe body
        try {
          response = (iframe.contentWindow || iframe.contentDocument || iframe).document.body.innerHTML;
          // Firefox 1.0.x hack: Remove (corrupted) control characters
          response = response.replace(/[\f\n\r\t]/g, ' ');
          if (window.opera) {
            // Opera-hack: it returns innerHTML sanitized.
            response = response.replace(/&quot;/g, '"');
          }
        }
        catch (e) {
          response = null;
        }

        response = Drupal.parseJson(response);
        // Check response code
        if (response.status == 0) {
          handler.onerror(response.data);
          return;
        }
        handler.oncomplete(response.data);

        return true;
      }

      return true;
    }
  }
  button.onmouseout = button.onblur = function() {
    button.onclick = null;
  }
};

/**
 * Retrieves the absolute position of an element on the screen
 */
Drupal.absolutePosition = function (el) {
  var sLeft = 0, sTop = 0;
  var isDiv = /^div$/i.test(el.tagName);
  if (isDiv && el.scrollLeft) {
    sLeft = el.scrollLeft;
  }
  if (isDiv && el.scrollTop) {
    sTop = el.scrollTop;
  }
  var r = { x: el.offsetLeft - sLeft, y: el.offsetTop - sTop };
  if (el.offsetParent) {
    var tmp = Drupal.absolutePosition(el.offsetParent);
    r.x += tmp.x;
    r.y += tmp.y;
  }
  return r;
};

/**
 * Return the dimensions of an element on the screen
 */
Drupal.dimensions = function (el) {
  return { width: el.offsetWidth, height: el.offsetHeight };
};

/**
 *  Returns the position of the mouse cursor based on the event object passed
 */
Drupal.mousePosition = function(e) {
  return { x: e.clientX + document.documentElement.scrollLeft, y: e.clientY + document.documentElement.scrollTop };
};

/**
 * Parse a JSON response.
 *
 * The result is either the JSON object, or an object with 'status' 0 and 'data' an error message.
 */
Drupal.parseJson = function (data) {
  if ((data.substring(0, 1) != '{') && (data.substring(0, 1) != '[')) {
    return { status: 0, data: data.length ? data : 'Unspecified error' };
  }
  return eval('(' + data + ');');
};

/**
 * Create an invisible iframe for form submissions.
 */
Drupal.createIframe = function () {
  if ($('#redirect-holder').size()) {
    return;
  }
  // Note: some browsers require the literal name/id attributes on the tag,
  // some want them set through JS. We do both.
  window.iframeHandler = function () {};
  var div = document.createElement('div');
  div.id = 'redirect-holder';
  $(div).html('<iframe name="redirect-target" id="redirect-target" class="redirect" onload="window.iframeHandler();"></iframe>');
  var iframe = div.firstChild;
  $(iframe)
    .attr({
      name: 'redirect-target',
      id: 'redirect-target'
    })
    .css({
      position: 'absolute',
      height: '1px',
      width: '1px',
      visibility: 'hidden'
    });
  $('body').append(div);
};

/**
 * Delete the invisible iframe
 */
Drupal.deleteIframe = function () {
  $('#redirect-holder').remove();
};

/**
 * Freeze the current body height (as minimum height). Used to prevent
 * unnecessary upwards scrolling when doing DOM manipulations.
 */
Drupal.freezeHeight = function () {
  Drupal.unfreezeHeight();
  var div = document.createElement('div');
  $(div).css({
    position: 'absolute',
    top: '0px',
    left: '0px',
    width: '1px',
    height: $('body').css('height')
  }).attr('id', 'freeze-height');
  $('body').append(div);
};

/**
 * Unfreeze the body height
 */
Drupal.unfreezeHeight = function () {
  $('#freeze-height').remove();
};

/**
 * Wrapper to address the mod_rewrite url encoding bug
 * (equivalent of drupal_urlencode() in PHP).
 */
Drupal.encodeURIComponent = function (item, uri) {
  uri = uri || location.href;
  item = encodeURIComponent(item).replace(/%2F/g, '/');
  return (uri.indexOf('?q=') != -1) ? item : item.replace(/%26/g, '%2526').replace(/%23/g, '%2523').replace(/\/\//g, '/%252F');
};

// Global Killswitch on the <html> element
if (Drupal.jsEnabled) {
  document.documentElement.className = 'js';
}

;
/* AGGREGATED JS FILE: sites/all/modules/miadella/js/validate2.js */

function ToggleMediaFormat(currentobject,current_format_id)
{

    current_format_index=0;
   for(var i=0;i<MediaArray.length;i++)
    if(MediaArray[i].formatid==current_format_id)
                current_format_index=i;
    
		if($('#edit-media-format-'+current_format_id).attr('checked')==true)
		    enableDisableTextBox(current_format_index,"");     
		else
		{
		    enableDisableTextBox(current_format_index,"disabled")
		    for(var i=0;i<MediaArray.length;i++)
		    {
				    if(MediaArray[i].formatid!=current_format_id && ($('#edit-media-format-'+MediaArray[i].formatid).attr('checked')==false))
				    {$('#edit-media-format-'+MediaArray[i].formatid).attr('checked','checked')
				      enableDisableTextBox(i,"");
				      }
		    }
		}
}

function enableDisableTextBox(i,attrb_value)
{
        for(var j=0;j<=MediaArray[i].packages.length-1;j++)
            {
            $('#'+MediaArray[i].packages[j].element).attr("disabled",attrb_value);
            }
                for( e=0;e<=MediaArray[i].extension.length-1;e++)
                {
                $('#'+MediaArray[i].extension[e].element).attr("disabled",attrb_value);
                
                }
                for( e=0;e<=MediaArray[i].tou.length-1;e++)
                    {
                        $('#'+MediaArray[i].tou[e].element).attr("disabled",attrb_value);
                    }
                    }
function calcTotalPrice(ischecked,pricevalue)
{
	 var objPrice=document.getElementById('License_Total_Price');
        	 	if(ischecked)
	 		    {
	 			objPrice.attributes[0].value=parseFloat(objPrice.attributes[0].value)  +parseFloat(pricevalue)  ;
	 			}
	 			else
	 			{
	 			objPrice.attributes[0].value=parseFloat(objPrice.attributes[0].value)  -pricevalue;
	 			}
	 			objPrice.innerHTML='$' +  Math.round(((objPrice.attributes[0].value) *100))/100; 
}

function validateLicenseForm(){
var min_price="0.00";
var item_price="0.00";
var defualt_price="0.00";
for(var i=0;i<MediaArray.length;i++)
{
        if($('#edit-media-format-'+MediaArray[i].formatid).attr('checked')==true)
        {
	for(var j=0;j<=MediaArray[i].packages.length-1;j++)
		{/**if package value is less than default value then show message.*/
			//alert(MediaArray[i].packages[j].element);
			//alert(MediaArray[i].packages[j].defaultprice);
			
			if(document.getElementById(MediaArray[i].packages[j].element).value=="")
				document.getElementById(MediaArray[i].packages[j].element).value="0.00";
				
				item_price=parseFloat(document.getElementById(MediaArray[i].packages[j].element).value);
				defualt_price=parseFloat(MediaArray[i].packages[j].defaultprice);
			if(item_price<defualt_price )//&& item_price>min_price 
										{
											alert('Value should be  greater than or equal to default price. $' +MediaArray[i].packages[j].defaultprice ); //+ ' OR equal to Zero (0.00)'
										 	document.getElementById(MediaArray[i].packages[j].element).focus();
										 	return false;
										}
			}
		for( e=0;e<=MediaArray[i].extension.length-1;e++)
		{
		//if extension price is less than default value and it is checked show message
				// if element2 is checked then check default value
				if(document.getElementById(MediaArray[i].extension[e].element).value=="")
				document.getElementById(MediaArray[i].extension[e].element).value="0.00";
							if(document.getElementById(MediaArray[i].extension[e].element2).checked)
							{
								item_price=parseFloat(document.getElementById(MediaArray[i].extension[e].element).value);
								defualt_price=parseFloat(MediaArray[i].extension[e].defaultprice);		
										if(item_price<defualt_price) // && item_price>min_price 
										{
										alert('Value should be  greater than or equal to default price. $' +MediaArray[i].extension[e].defaultprice );//+ ' OR equal to Zero (0.00)'
										 	document.getElementById(MediaArray[i].extension[e].element).focus();
										 	return false;
										}
							} 
			}				
				//alert(MediaArray[i].extension[e].element);
				//alert(MediaArray[i].extension[e].defaultprice);
//if extension price is less than default value and it is checked show message
				// if element2 is checked then check default value
					for( e=0;e<=MediaArray[i].tou.length-1;e++)
					{
				if(document.getElementById(MediaArray[i].tou[e].element).value=="")
				document.getElementById(MediaArray[i].tou[e].element).value="0.00";
							if(document.getElementById(MediaArray[i].tou[e].element2).checked)
							{
							
										if(parseFloat(document.getElementById(MediaArray[i].tou[e].element).value)<parseFloat(MediaArray[i].tou[e].defaultprice))
										{
											alert('Extension Value is less than default price. $' +MediaArray[i].tou[e].defaultprice);
										 	document.getElementById(MediaArray[i].tou[e].element).focus();
										 	return false;
										}
							} 
						}	
		}	
}
return true;
}

// version: beta
// created: 2005-08-30
// updated: 2005-08-31
// mredkj.com
function extractNumber(obj, decimalPlaces, allowNegative)
{
	var temp = obj.value;
	
	// avoid changing things if already formatted correctly
	var reg0Str = '[0-9]*';
	if (decimalPlaces > 0) {
		reg0Str += '\\.?[0-9]{0,' + decimalPlaces + '}';
	} else if (decimalPlaces < 0) {
		reg0Str += '\\.?[0-9]*';
	}
	reg0Str = allowNegative ? '^-?' + reg0Str : '^' + reg0Str;
	reg0Str = reg0Str + '$';
	var reg0 = new RegExp(reg0Str);
	if (reg0.test(temp)) return true;

	// first replace all non numbers
	var reg1Str = '[^0-9' + (decimalPlaces != 0 ? '.' : '') + (allowNegative ? '-' : '') + ']';
	var reg1 = new RegExp(reg1Str, 'g');
	temp = temp.replace(reg1, '');

	if (allowNegative) {
		// replace extra negative
		var hasNegative = temp.length > 0 && temp.charAt(0) == '-';
		var reg2 = /-/g;
		temp = temp.replace(reg2, '');
		if (hasNegative) temp = '-' + temp;
	}
	
	if (decimalPlaces != 0) {
		var reg3 = /\./g;
		var reg3Array = reg3.exec(temp);
		if (reg3Array != null) {
			// keep only first occurrence of .
			//  and the number of places specified by decimalPlaces or the entire string if decimalPlaces < 0
			var reg3Right = temp.substring(reg3Array.index + reg3Array[0].length);
			reg3Right = reg3Right.replace(reg3, '');
			reg3Right = decimalPlaces > 0 ? reg3Right.substring(0, decimalPlaces) : reg3Right;
			temp = temp.substring(0,reg3Array.index) + '.' + reg3Right;
		}
	}
	
	obj.value = temp;
}
function blockNonNumbers(obj, e, allowDecimal, allowNegative)
{
	var key;
	var isCtrl = false;
	var keychar;
	var reg;
		
	if(window.event) {
		key = e.keyCode;
		isCtrl = window.event.ctrlKey
	}
	else if(e.which) {
		key = e.which;
		isCtrl = e.ctrlKey;
	}
	
	if (isNaN(key)) return true;
	
	keychar = String.fromCharCode(key);
	
	// check for backspace or delete, or if Ctrl was pressed
	if (key == 8 || isCtrl)
	{
		return true;
	}

	reg = /\d/;
	var isFirstN = allowNegative ? keychar == '-' && obj.value.indexOf('-') == -1 : false;
	var isFirstD = allowDecimal ? keychar == '.' && obj.value.indexOf('.') == -1 : false;
	
	return isFirstN || isFirstD || reg.test(keychar);
}
;
/* AGGREGATED JS FILE: sites/all/modules/miadella/js/miadella_jquery.js */
  // thumb jquery plugin related
    $(document).ready(function() {
    if($("#work_items_block_image")!=null)
    $("#work_items_block_image").ImageDefault();
    if($("#work_items_block")!=null)
    $("#work_items_block").TextDefault();
    $("a.popupWindow").popupWindow();
        $("a.thumb, img.thumb").jThumb(); // the wrapping function
        $("a.thumb img, img.thumb").jThumbImg(); // the img positioning function (optional)
         $('.adorn').corner("");
         $('.list_box').corner("tl,tr");
         $('.selection_box').corner("tl,tr");
         $('.itemheaderLeft').corner("tl,tr");
         $('.itemheaderRight').corner("tr");
         //$('.work_item_control').corner("");
    });

//change the checkbox status and the replacement image
function checkChange(chkImg ,chkobjectname) {
alert('checkChange');
    img_path=$('#'+chkImg).attr('img_path');
    alert(img_path);
    checked_img="imgChecked.png";
    unchecked_img="imgUnChecked.png";
    alert($('#'+chkobjectname).attr('checked'));
  if($('#'+chkobjectname).attr('checked')==true){
      $('#'+chkobjectname).attr('checked','')
      $('#'+chkImg).attr('src',img_path+unchecked_img);
        
    } else {
      $('#'+chkobjectname).attr('checked','checked')
      $('#'+chkImg).attr('src',img_path+checked_img);
        
    }
}


function fill_picasa_form(album_id,album_name,link)
{
$("#edit-work-title").attr('value',album_name);
$("#edit-work-location-url").attr('value',link);
$("#edit-work-screen-name").attr('value',$("#edit-picasaname").attr('value'));
$("#edit-work-identifier").attr('value',album_id);

if(album_id!='')
{// clearType handling for IE. lousy bug

    $('#WorkDetailsDiv').fadeIn(function() {
    if ($.browser.msie)
        this.style.removeAttribute('filter');
        }
        );
}
else
$("#WorkDetailsDiv").fadeOut("fast");
}
/* Image check box code ends here */
function build_FileFormatlist(default_extension,selectList_id)
{
if(default_ext==null)
defualt_ext="";

var arr_extension=new Array("mov","flv","swf","wmv","avi","mpg","3g2","ram","");
var arr_extension_name=new Array("MOV File (video)","FLV File","SWF File","WMV File","AVI File","MPG File","3G2 File (cell phone video)","RAM File","Other");
for (i=0;i<arr_extension.lenght;i++)
{
if(arr_extension.lenght==default_extension)
options += '<option value="' + arr_extension[i] + '">' + arr_extension_name[i] + '</option>';
else
options += '<option value="' + arr_extension[i] + '">' + arr_extension_name[i] + '</option>';
}

$("select#" +selectList_id).html(options);

}


function getVideoClass(ext_type)
{
if(ext_type=='ram' || ext_type=='rm')
return  "media {width:150,height:150,params: {controls:\'imagewindow,controlpanel\'},type:\'"+ext_type+"\'}";
else 
return "media {width:150,height:150,type:\'"+ext_type+"\'}";
}

function getAudioClass(ext_type)
{

if(ext_type=='ram' || ext_type=='rm')
return  "media {width:150,height:100,params: {controls:\'imagewindow,controlpanel\'},type:\'"+ext_type+"\'}";
else
return "media {width:150,height:100,type:\'"+ext_type+"\'}";
}

 function getJQMediaClass(Mtype)
 {
         switch(Mtype)
         {
            case "MOV File (video)":
                {return 'class="media {width:150, height:150 , type:\'mov\'}"';break;}
            case "FLV File":
                {return 'class="media {width:150, height:150}';break;}
            case "SWF with FLV (mediaplayer.swf?file=curtain.flv)":
                {return 'class="media {width:150, height:150, type:\'flv\'}"';break;} 
            case "SWF File":
                {return 'class="media {width:150, height:150, type:\'swf\'}"';break;}
            case "Youtube Video (SWF)":
                {return 'class="media {width:150, height:150, type:\'swf\'}"';break;} 
            case "WMV File":
                {return 'class="media {width:150, height:150, type:\'wmv\'}"';break;}
            case "AVI File":
                {return 'class="media {width:150, height:150, type:\'avi\'}"';break;}
            case "MPG File":
                {return 'class="media {width:150, height:150, type:\'mpg\'}"';break;}
            case "3G2 File (cell phone video)":
                {return 'class="media {width:150, height:150, type:\'3g2\'}"';break;}
            case "RAM File":
                {return 'class="media {width:150, height:150, type:\'ram\'}"';break;}
           case "Line Rider!":
                {return 'class="media {width:150, height:150, type:\'swf\'}"';break;}
            default:
                {return 'class="media {width:150, height:150}"';break;}
         
         
         }
 }
 function ThumbThemByID(id)
 {
    $("img#"+id).jThumb();
    $("img#"+id).jThumbImg(); // the img positioning function (optional)
    $("a#"+id).jThumb();
    $("a#"+id).jThumbImg();
 //alert($(id).jThumbID(id));
 //$(id).jThumbID(id); 
 //jThumbID(id); // the wrapping function
    //  $(id).jThumbImg(); // the img positioning function (optional)
 }
 function ThumbThem()
 {
 $("a.thumb, img.thumb").jThumb(); // the wrapping function
        $("a.thumb img, img.thumb").jThumbImg(); // the img positioning function (optional)
 }
 
 
  function bindPopUp()
 {
  $("a.popupWindow").popupWindow();
 }
 
 function bindMedia()
 {
 $("a.media").media();
 }
 
 
  
 function limitChars(limit)
 {
 var text = $('#TB_window #edit-work-items-desc').val(); 
 var textlength = text.length;
 if(textlength > limit)
    {
        $('#TB_window #charlimitinfo').html('You cannot write more then '+limit+ ' characters!');
        $('#TB_window #edit-work-items-desc').val(text.substr(0,limit));
        return false;
    }
    else
    {
     $('#TB_window #charlimitinfo').html('You have '+ (limit - textlength) +' characters left.');
    return true;
     }
 }
 
 function show_photosets(method_name,param)
 {
 $('div#image-display-photosets').html( 'Loading feed ,please wait...<img src="files/images/wait.gif" alt="alt"/>' );
 
 $('div#image-display-photosets').load('remotecall/getImages.php?fnName='+method_name+'&param='+param);
 
 }
 
 function deleteWorkItem(item_id,mediaType)
 {
  $.ozmo_media.init({id:item_id,media_type:mediaType,url:"",thumb_url:"",date:"",desc:"",file_ext:"",operation:"delete"});
 return false;
 }
 function editWorkItem(item_id,mediaType)
 {
 $.ozmo_media.init({id:item_id,media_type:mediaType,url:"",thumb_url:"",date:"",desc:"",file_ext:"",operation:"edit"});
    
 }
 function updateWorkItem(item_id,mediaType)
 {
 $.ozmo_media.init({id:item_id,media_type:mediaType,url:"",thumb_url:"",date:"",desc:"",file_ext:"",operation:"update"});
 }
 function createNewWorkItem(mediaType,fnType)
 {
 $.ozmo_media.init({id:0,media_type:mediaType,url:"",thumb_url:"",date:"",desc:"",file_ext:"",operation:"create",functionType:fnType});
 }
 
 function loadFavIcon(url,fav_image_id)
 {
 $("#"+fav_image_id).load()
 }
 function showItemImage(url,media_type)
 {
 tb_show('',  url +'?keepThis=true&TB_iframe=true&height=300&width=500', null);
 }
 function showPrintThickbox(title,url)
 {
 tb_show(title,  url +'?mode=print&keepThis=true&TB_iframe=true&height=450&width=550', null);
 }
 
 function addNewWorkItem(mediaType)
 {
 $.ozmo_media.init({id:0,media_type:mediaType,url:"",thumb_url:"",date:"",desc:"",file_ext:"",operation:"add"});
 
    
 }
 
 function URLGetDomain(url_value)
 {
 if(url_value.indexOf("http://")==-1){
                            baseURL = url_value.substr(0, url_value.indexOf("/"));
                            baseURL="http://" + baseURL;
                            
                            return baseURL;
                    }
                    else {
                            baseURL = url_value.substr(0, url_value.indexOf("/",7));
                            
                            return baseURL;
                            
                    }   
            
 }
 function validateThickBox(type)
 {
 var baseURL;
 errormsg="";
 name_value=$("#TB_window #edit-work-items-name").val();
 url_value=$("#TB_window #edit-work-items-url").val();
 if(name_value==null)
 name_value='';
 
 if(url_value==null)
 url_value='';
 
 
 $("#TB_window #newWorkItemMessage").html('');
 
        if(name_value=='')
            errormsg="<font color='red'>*</font>Lable/Title field is required";
            
        if(url_value=='')
            errormsg=errormsg +"<br/><font color='red'>*</font>URL field is required";
            if(url_value!='')
            {
                    if(url_value.indexOf("http://")==-1){
                            url_value="http://" + url_value;
                            $("#TB_window #edit-work-items-url").val(url_value);
                    }   
            
            if(type=='image')
            {
                        if(url_value.indexOf("?")!==-1){ //ff there is a query string involved
                            baseURL = url_value.substr(0, url_value.indexOf("?"));
                        }else{
                                baseURL = url_value;
                        }
                        
                     var urlString = /\.jpg|\.jpeg|\.png|\.gif|\.bmp/g;
                        var urlType = url_value.toLowerCase().match(urlString);
            
                    if(urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif' || urlType == '.bmp')//code to show images
                        errormsg=errormsg;          
                    else
                    errormsg=errormsg +"<br/> Image url should be jpeg,jpg,png,gif,bmp only";
             }
             }
     
     
 
 // display error message
             if(errormsg!='')
             {
             $("#TB_window #newWorkItemMessage").html(errormsg);
             return false;
             }
             else
             return true;
 }
 
 
     
 
 function miadella_insertspace(string,space_number)
{
  // YOUR TEXT
//$string

//EMPTY ARRAY
var txt_array=new Array();

// GET string LENGHT
var len=string.length;

// WANT TO ADD space AFTER X CHARACTER
//$space_number="5"; // here, 5 character

//COUNT FOR LOOP BELOW
if(space_number<len)
count=len/space_number;
else
return string;


count=parseInt(count);

//SHOW SOME RESULT
//echo 'CALCUL: '.$len.'/'.$space_number.'='.$count.'<br><br>';

//LOOP
i=0;

while(i<=count) {

if(i==0) {ib=0;} else {ib=(i*space_number);}
txt_array[i]=string.substring(ib,(ib+space_number));
i++;}



//GET FINAL TEXT
count_array=txt_array.length-1; i=0;

while (i<=count_array) {
if (i==0) {string=txt_array[i] +' '; } else {string =string+''+txt_array[i]+' ';}
i++;}

return string;
}

function displayHTML(objname) {
  var inf =document.getElementById(objname).value;

  filter_html=js_filter_xss(inf)

  win = window.open(", ", 'popup', 'width=300,height=300,resizable=yes');
  win.document.write(filter_html);
 
}

function creativecommons_cctext(nc_object,summary_object,source_object)
{

if($('#'+nc_object).attr('checked')==true)
$('#'+summary_object).html($('#'+source_object).attr('title'));
else 
$('#'+summary_object).html($('#'+source_object).attr('nc_title'));
}

function creativecommons_ccnctext(nc_value,summary_txt_object,summary_img_object,source_collection)
{
    cc_colection_objects=source_collection.split(",")
    
    var nc_txt="";
    var nc_image="";
    for(var i=0;i<cc_colection_objects.length;i++)
    {
                if($('#'+cc_colection_objects[i]).attr('checked'))
                {
                    if(nc_value==0)// commercial use
                    {nc_txt=$('#'+cc_colection_objects[i]).attr('nc_title');
                    nc_image=$('#'+cc_colection_objects[i]).attr('img_nc_url');}
                    else
                    {nc_txt=$('#'+cc_colection_objects[i]).attr('title');
                    nc_image=$('#'+cc_colection_objects[i]).attr('img_url');}
                        $('#'+summary_txt_object).html(nc_txt);
                        $('#'+summary_img_object).attr('src',nc_image);
                }
    }
}

function creativecommons_ccimages(nc_object,summary_object,source_object)
{

if($('#'+nc_object).attr('checked')==true)
$('#'+summary_object).attr('src',$('#'+source_object).attr('img_url'));
else 
$('#'+summary_object).attr('src',$('#'+source_object).attr('img_nc_url'));
}
/* bulk load xml reading*/
function BulkLoadImageXML(xmlString)
{
media_type='image';
//xmlString='<?xml version="1.0" encoding="iso-8859-1"?><images><image><title>abc</title><url><![CDATA[http://images.orkut.com/orkut/albums2/ATgAAAD1SqieyPyXl6CVlmW_W0czb3cHCMHGJ2u2J_B6tJNV0LT_GMv5tGuFhcP8EAR4cC0TMEuwJNvyuDVKi7l1ML3hAJtU9VB1rDoUIpBZeWH0Cqj4WKsqVBjlzQ.jpg]]></url><desc>asasas</desc><date><![CDATA[11/11/1111]]></date><file_ext>jpg</file_ext></image><image><title>abc2</title><url><![CDATA[http://www.web2.com]]></url><desc>a2sasas</desc><date><![CDATA[22/11/1111]]></date><file_ext>jpg</file_ext></image></images>';
try //Internet Explorer
  {
  xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
  xmlDoc.async="false";
  xmlDoc.loadXML(xmlString);
  }
catch(e)
  {
  try //Firefox, Mozilla, Opera, etc.
      {
      parser=new DOMParser();
      xmlDoc=parser.parseFromString(xmlString,"text/xml");    
      }
  catch(e)
      {
      alert(e.message);
      return;
      }
}   
      
   var tree=xmlDoc.documentElement;
 if(tree.hasChildNodes()) {
        clearAllWorkItem(media_type);
              for(var i=0; i<tree.childNodes.length; i++)
                                    {
                                    nodes=tree.childNodes[i].childNodes;
                                    id=$('#work-item-count').val();
                                    id=(id-1)+2;
                                    $('#work-item-count').val(id);
                                    xmlid=nodes[0].childNodes[0].nodeValue;
                                    title=nodes[1].childNodes[0].nodeValue;
                                    url=nodes[2].childNodes[0].nodeValue;
                                    thumb_url=nodes[3].childNodes[0].nodeValue;
                                    date=nodes[4].childNodes[0].nodeValue;
                                    desc=nodes[5].childNodes[0].nodeValue;
                                    //ext_type=nodes[5].childNodes[0].nodeValue;
                                    ext_type="";
                                    crateWorkItemFromXML(id,media_type,title,url,thumb_url,desc,date,ext_type);
                                    }
                        }
        bindThickBox();

}

function clearAllWorkItem(media_type)
{
/*
  if (confirm("Are you sure you want to delete?")) {
    $(id).remove();
   if(media_type=='image')
   {
   $("#work_items_block_image").ImageDefault();
   */
   item_found='false';
    if(media_type=='image')
    {
            $('#work_items_block_image').find('td').each(function(){
                  var id_text = $(this).attr('id')
                     $("#"+id_text).remove();
                item_found=true;
                });
                if(item_found==true)
                         $("#work_items_block_image").ImageDefault();       
                    item_found='false'; 
    }

//deleteWorkItem(id,media_type)

}
function crateWorkItemFromXML(ID,mediaType,Title,URL,thumb_URL,Desc,Date,Ext_type)
{

   if(thumb_URL=='')
    thumb_URL=url;
    $.ozmo_media.init({id:ID,media_type:mediaType,title:Title,url:URL,thumb_url:thumb_URL,date:Date,desc:Desc,file_ext:Ext_type,operation:'createfromxml',functionType:''});
    
return true;
}


function OpenBulkOpsPage(bulkURL,media_type,Source_URL)
{
    if(media_type=='image' && Source_URL=="")
    Source_URL=$("#edit-work-location-url").val();  
    
    if(Source_URL=="")
    {   alert("You need to tell us where is your content? ");
        $("#edit-work-location-url").focus();
        return false;
    }
    if(Source_URL.indexOf("http://")==-1)
                            Source_URL="http://" + Source_URL;
                            
    url_ext="&keepThis=true&TB_iframe=true&modal=true&height=450&width=800";
    //alert( bulkURL+'?url='+Source_URL+'&'+url_ext);
  $.blockUI({ css: { 
            border: 'none', 
            padding: '15px', 
            backgroundColor: '#000', 
            '-webkit-border-radius': '10px', 
            '-moz-border-radius': '10px', 
            opacity: '.5', 
            color: '#fff' 
        } }); 
    tb_show('',  bulkURL+'?url='+Source_URL+ url_ext, null);
    $.unblockUI(); 
    $("#TB_window").append('<div style="background-color:gray;text-align:right"><input id ="btn_submit" type="button" value=" Select Images " onclick=\"javascript:CloseBulkOpsPage(\''+media_type+'\');\"</div>');
    
}
function CloseBulkOpsPage(media_type)
{
    Iframe_name=$('#TB_iframeContent').attr("name");
        returnXML= window.frames[Iframe_name].getContentXML();// read from IFRAM file
        if(returnXML!=false)
            {tb_remove();
             BulkLoadImageXML(returnXML);
            }
}


/* picasa methods move to picasa javascript */
function show_picasa_content(album_id,album_name,user_name)
{

//$.picasaAlbums.photoinit({id:album_id,album_name:album_name,albumnaccount:user_name,initTime:"3000",selectText:"Please select the albums",loadingMsg:"Loading...",operation:"showphotos"});
clearAllWorkItem('image');
}
String.format = function()
{

    if( arguments.length == 0 )
    {
        return null; 
    }
    
    var str = arguments[0]; 

    for(var i=1;i<arguments.length;i++)
    {

        var re = new RegExp('\\{' + (i-1) + '\\}','gm');
        str = str.replace(re, arguments[i]);
    }
    return str;
};



    

var tb_pathToImage = "files/images/loading_animation.gif";

        function bindThickBox()
        {
        $('a.thickbox').click(function(){
        var t = this.title || this.name || null;
        var a = this.href || this.alt;
        var g = this.rel || false;
        tb_show(t,a,g);
        this.blur();
        return false;
        });
        }
        
        $(document).ready(function() {
         bindThickBox();
        });
        
function showhelp(control_id,media_type,control_type,help_url)
{
$("#TB_window #"+control_id).html("");
//380 350
html_header='<div style="background-color:gray;font-color:white;"><a  id="slideleft" href="javascript:void(0);" onclick=\'javascript:closehelp("'+control_id+'" );return false;\'><a/></div>'
$("div#TB_window").css('width','600px');
$("div#TB_ajaxContent").css('width','570px');
$.ajax({
  url: help_url,
  cache: false,
  success: function(html){
    $("#TB_window #"+control_id).append(html_header+html);
  }
});


//$("#TB_window #"+control_id).fadeIn();
   $("#TB_window #"+control_id).fadeIn(function() {
    if ($.browser.msie)
        this.style.removeAttribute('filter');
        });
}
function closehelp(control_id)
{
$("div#TB_ajaxContent").css('width','350px');
$("div#TB_window").css('width','380px');

$("#TB_window #"+control_id).fadeOut();
}

function ClosePicasaPage()
{  

       returnXML= $.picasaAlbums.createBulkXML();// read from IFRAM file
        if(returnXML!=false)
            {
          
             BulkLoadImageXML(returnXML);
             $("#picasa_bulk_images").html('');
            }
           
            
$.unblockUI();
 tb_remove();
            
}
   function OpenPicasaItems(p_album_id,p_album_name,p_user_name)
   {

    if(p_user_name=="" || p_album_name=="" || p_album_id=='')
   {
    picasa_album_name=$("#edit-work-title").val();
    picasa_user_name=$("#edit-work-screen-name").val();
    picasa_album_id=$("#edit-work-identifier").val();
   }
   else
   {
   picasa_album_name=p_album_name;
   picasa_user_name=p_user_name;
   picasa_album_id=p_album_id
   }
   if(picasa_user_name=="" && picasa_album_name=="" && picasa_album_id=="")
   alert('required paramters are missing');
   else 
   $.picasaAlbums.photoinit({id:picasa_album_id,album_name:picasa_album_name,albumnaccount:picasa_user_name,initTime:"3000",selectText:"",loadingMsg:"Loading...",albumlink:"",operation:"loadphotos"});
   }

      
   
   
   // future change add all utlity function inside this
   $.ozmo_utility={
   fadeIn:function(control_id)
   {
      $("#"+control_id).fadeIn(function() {
         if ($.browser.msie)
        this.style.removeAttribute('filter');
        });
    },
     toggle:function(control_id)
   {
      $("#"+control_id).toggle(function() {
         if ($.browser.msie)
        this.style.removeAttribute('filter');
        });
    }
   
   };
   

;
/* AGGREGATED JS FILE: sites/all/modules/miadella/js/ozmo_media.js */

/* Media ozmo thickbox function */
$.ozmo_media={
        settings:{
                id:0,
                media_type:"",
                title:"",
                url:"",
                thumb_url:"",
                date:"",
                desc:"",
                file_ext:"",
                operation:"add",
                functionType:""
                },
  init:function(options){
        if (typeof options != undefined) {
            $.extend($.ozmo_media.settings, options);
            }
            if($.ozmo_media.settings.operation=='delete')
            $.ozmo_media.remove();
            else if($.ozmo_media.settings.operation=='edit')
            $.ozmo_media.edit();
            else if($.ozmo_media.settings.operation=='update')
            $.ozmo_media.update();
            else if($.ozmo_media.settings.operation=='add')
            $.ozmo_media.add();
            else if($.ozmo_media.settings.operation=='create')
            $.ozmo_media.create($.ozmo_media.settings.functionType);
            else if($.ozmo_media.settings.operation=='createfromxml')
            $.ozmo_media.createfromxml();
            
            },
remove:function()
{
if (confirm("Are you sure you want to delete?")) {
    $($.ozmo_media.settings.id).remove();
     if($.ozmo_media.settings.media_type=='image')
      $("#work_items_block_image").ImageDefault();
    else if($.ozmo_media.settings.media_type=='video')
   $("#work_items_block_video").VideoDefault();
   else if($.ozmo_media.settings.media_type=='audio')
   $("#work_items_block_audio").AudioDefault();
   else 
   $("#work_items_block").TextDefault();
  }
   return false;
},
showhidecontrol:function(id,style)
{
$("#edit-"+id).css('display',style);
$("#delete-"+id).css('display',style);
},
 edit:function ()
 {
 $("#pop-work-item-controls").html('<a href="javascript:void(0)" onclick="tb_remove();"><b>Close</b></a>&nbsp;&nbsp; <a href="javascript:void(0)" onclick=updateWorkItem('+$.ozmo_media.settings.id+',"'+$.ozmo_media.settings.media_type+'");return false;><b>Update</b></a>');
    name_value=$("#work-items-name-"+ $.ozmo_media.settings.id).val();
    desc_value=$("#work-items-desc-"+ $.ozmo_media.settings.id).val();
    url_value=$("#work-items-url-"+ $.ozmo_media.settings.id).val();
    thumb_url_value='';
    
   if($.ozmo_media.settings.media_type=='image')
    thumb_url_value=$("#work-items-thumb-url-"+ $.ozmo_media.settings.id).val();
    
    if(thumb_url_value=='')
    thumb_url_value=url_value;
    
    date_value=$("#work-items-date-"+ $.ozmo_media.settings.id).val();
    if($.ozmo_media.settings.media_type=='video' || $.ozmo_media.settings.media_type=='audio')
    file_ext_value=$("#work-items-file-ext-"+ $.ozmo_media.settings.id).val();
    
 
 tb_show('Edit items',  '#TB_inline?height=400&amp;width=350&inlineId=hiddenModalContent&modal=true', null);
 $("#TB_window #edit-work-items-date").unmask();
 $("#TB_window #edit-work-items-date").mask("99/99/9999");
 $("#TB_window #edit-work-items-name").val(name_value);
 $("#TB_window #edit-work-items-desc").val(desc_value);
 $("#TB_window #edit-work-items-url").val(url_value);
 if($.ozmo_media.settings.media_type=='image')
 $("#TB_window #edit-work-items-thumb-url").val(thumb_url_value);
 $("#TB_window #edit-work-items-date").val(date_value);
 if($.ozmo_media.settings.media_type=='video' || $.ozmo_media.settings.media_type=='audio')
 {
 $("#TB_window select[@name='edit_work_items_file_ext'] option[@selected='selected']").removeAttr("selected");;//remove any selected items (alternative method)
 $("#TB_window select[@name='edit_work_items_file_ext'] option[@value='"+file_ext_value+"']").attr("selected","selected");//select beta
 }
 //$("#TB_window  #hiddenModalFormtable").fadeIn('slow');
  $("#TB_window  #hiddenModalFormtable").fadeIn(function() {
    if ($.browser.msie)
        this.style.removeAttribute('filter');
        });
 $("#TB_window  #newWorkItemMessage").fadeOut('slow');
   
 },
  update:function()
 {
 if(!validateThickBox($.ozmo_media.media_type))
 return false;
 thumb_url_value='';
    name_value=$("#TB_window #edit-work-items-name").val();
    desc_value=$("#TB_window #edit-work-items-desc").val();
    url_value=$("#TB_window #edit-work-items-url").val();
    if($.ozmo_media.settings.media_type=='image')
    thumb_url_value=$("#TB_window #edit-work-items-thumb-url").val();
    
    if(thumb_url_value=='')
    thumb_url_value=url_value;
    
    date_value=$("#TB_window #edit-work-items-date").val();
    
    ext_type='';
    
    $("#TB_window #edit-work-items-date").unmask();
    
    if($.ozmo_media.settings.media_type=='image')
    {
    object_id='work-items-image-'+ $.ozmo_media.settings.id;
    displaytxt=$.ozmo_media.displayText($.ozmo_media.settings.id,name_value,url_value,thumb_url_value,date_value,desc_value,ext_type,object_id)
    $("#display-content-"+ $.ozmo_media.settings.id).html(displaytxt);   
    $("#image-desc-"+ $.ozmo_media.settings.id).html(desc_value.substr(0,100)+'..');
    
    }
     else if($.ozmo_media.settings.media_type=='video')
    {
    ext_type=$("#TB_window #edit-work-items-file-ext").val();
    object_id='work-item-video-url-'+ $.ozmo_media.settings.id;
    displaytxt=$.ozmo_media.displayText($.ozmo_media.settings.id,name_value,url_value,thumb_url,date_value,desc_value,ext_type,object_id)
    $("#display-content-"+ $.ozmo_media.settings.id).html(displaytxt);   
    $("#image-desc-"+ $.ozmo_media.settings.id).html(desc_value.substr(0,100)+'..');
    $("#work-items-file-ext-"+ $.ozmo_media.settings.id).val(ext_type);
    }
     else if($.ozmo_media.settings.media_type=='audio')
    {
    ext_type=$("#TB_window #edit-work-items-file-ext").val();
    object_id='work-item-audio-url-'+ $.ozmo_media.settings.id;
    displaytxt=$.ozmo_media.displayText($.ozmo_media.settings.id,name_value,url_value,thumb_url,date_value,desc_value,ext_type,object_id)
        $("#display-content-"+ $.ozmo_media.settings.id).html(displaytxt);   
    $("#image-desc-"+ $.ozmo_media.settings.id).html(desc_value.substr(0,100)+'..');
    $("#work-items-file-ext-"+$.ozmo_media.settings.id).val(ext_type);
    }
    else
    {
    object_id='work-item-text-url-'+ $.ozmo_media.settings.id;
    displaytxt=$.ozmo_media.displayText($.ozmo_media.settings.id,name_value,url_value,thumb_url_value,date_value,desc_value,ext_type,object_id)
        $("#work-item-display-"+ $.ozmo_media.settings.id).html(displaytxt);
    }   
            $("#work-items-name-"+ $.ozmo_media.settings.id).val(name_value);
            $("#work-items-desc-"+ $.ozmo_media.settings.id).val(desc_value);
            $("#work-items-url-"+ $.ozmo_media.settings.id).val(url_value);
            $("#work-items-thumb-url-"+ $.ozmo_media.settings.id).val(thumb_url_value);
            $("#work-items-date-"+ $.ozmo_media.settings.id).val(date_value);
    tb_remove();
    
    
   // bind jquery popups etcs
   if($.ozmo_media.settings.media_type=='video')
   $('#work-item-video-url-'+$.ozmo_media.settings.id).media();
   else  if($.ozmo_media.settings.media_type=='audio')
   $('#work-item-audio-url-'+$.ozmo_media.settings.id).media();
   else if($.ozmo_media.settings.media_type=='image')
      ThumbThemByID('work-items-image-'+ $.ozmo_media.settings.id);
   else if($.ozmo_media.settings.media_type=='text')
   bindPopUp();  
   
            //on page load call tb_init  
    bindThickBox();
    
   
 },
 
 createfromxml:function()
 {
    object_id="work-items-"+$.ozmo_media.settings.media_type+"-"+ $.ozmo_media.settings.id; 
    displaytxt=$.ozmo_media.displayText($.ozmo_media.settings.id,$.ozmo_media.settings.title,$.ozmo_media.settings.url,$.ozmo_media.settings.thumb_url,$.ozmo_media.settings.date,$.ozmo_media.settings.desc,$.ozmo_media.settings.file_ext,object_id)
    $.ozmo_media.build($.ozmo_media.settings.id,$.ozmo_media.settings.title,$.ozmo_media.settings.url,$.ozmo_media.settings.thumb_url,$.ozmo_media.settings.file_ext,$.ozmo_media.settings.date,$.ozmo_media.settings.desc)
     //on page load call tb_init  
    
 },
 create:function(fnType)
 {
 if(!validateThickBox($.ozmo_media.settings.media_type))
 {
 $("#TB_window  #newWorkItemMessage").fadeIn('slow');
 return false;
 }
 
        $.ozmo_media.settings.id=$('#work-item-count').val();
        $.ozmo_media.settings.id=($.ozmo_media.settings.id-1)+2;
        $('#work-item-count').val($.ozmo_media.settings.id);
    
    
    ext_type='';
    thumb_url_value='';
    title_value=$("#TB_window #edit-work-items-name").val();
    desc_value=$("#TB_window #edit-work-items-desc").val();
    url_value=$("#TB_window #edit-work-items-url").val();
    if($.ozmo_media.settings.media_type=='image') 
    thumb_url_value=$("#TB_window #edit-work-items-thumb-url").val();
    
    if(thumb_url_value=='')
    thumb_url_value=url_value;
    date_value=$("#TB_window #edit-work-items-date").val();
    if($.ozmo_media.settings.media_type=='video' || $.ozmo_media.settings.media_type=='audio')
    ext_type=$("#TB_window #edit-work-items-file-ext").val();

    object_id="work-items-"+$.ozmo_media.settings.media_type+"-"+ $.ozmo_media.settings.id; 
    displaytxt=$.ozmo_media.displayText($.ozmo_media.settings.id,title_value,url_value,thumb_url_value,date_value,desc_value,ext_type,object_id)
    $.ozmo_media.build($.ozmo_media.settings.id,title_value,url_value,thumb_url_value,ext_type,date_value,desc_value)
     //on page load call tb_init  
       bindThickBox();
    
    
    // clear all old itmes
   
 if(fnType=='close')
 {tb_remove();
    $("#TB_window #edit-work-items-name").val("");
    $("#TB_window #edit-work-items-desc").val("");
    $("#TB_window #edit-work-items-url").val("");
    if($.ozmo_media.settings.media_type=='image')
    $("#TB_window #edit-work-items-thumb-url").val(""); 
    $("#TB_window #edit-work-items-date").unmask();
 }
 else
    $("#TB_window #edit-work-items-name").val("");
 
 
 },
build:function(ID,title_value,url_value,thumb_url_value,ext_type,date_value,desc_value)
{
 if($.ozmo_media.settings.media_type=='image')
    {
    work_item_html='<td width="100px" align="left" id="work-item-' + ID +'" class="work-items" >'+
    $.ozmo_media.form_template(ID,title_value,url_value,thumb_url_value,ext_type,date_value,desc_value)+
    $.ozmo_media.item_template(ID,displaytxt,desc_value) +
    '</td>';
    $('#work_items_block_image').append(work_item_html);
    $("#work_items_block_image").ImageDefault();
    ThumbThemByID('work-items-image-'+ ID);
    }
    else if($.ozmo_media.settings.media_type=='video')
    {
    work_item_html='<td width="100px" align="left" id="work-item-' + ID +'" class="work-items" >'+
    $.ozmo_media.form_template(ID,title_value,url_value,thumb_url_value,ext_type,date_value,desc_value)+
    $.ozmo_media.item_template(ID,displaytxt,desc_value) +
    '</td>';
    
    $('#work_items_block_video').append(work_item_html);
    $("#work_items_block_video").VideoDefault();
    $('#work-item-video-url-'+ID).media();

    }
        else if($.ozmo_media.settings.media_type=='audio')
    {
    work_item_html='<td width="100px" align="left" id="work-item-' + ID +'" class="work-items" >'+
    $.ozmo_media.form_template(ID,title_value,url_value,thumb_url_value,ext_type,date_value,desc_value)+
    $.ozmo_media.item_template(ID,displaytxt,desc_value) +
    '</td>';
    $('#work_items_block_audio').append(work_item_html);
    $("#work_items_block_audio").AudioDefault();
    $('#work-item-audio-url-'+ID).media();
    }
    else if($.ozmo_media.settings.media_type=='text')
    {
    work_item_html='<tr id="work-item-' + ID +'"><td align="left" width="90%" valign="top">'+
    $.ozmo_media.form_template(ID,title_value,url_value,thumb_url_value,ext_type,date_value,desc_value)+
    $.ozmo_media.item_template(ID,displaytxt,desc_value) +
    '</td></tr>';
    $('#work_items_block').append(work_item_html);
    $("#work_items_block").TextDefault();
       // bind jquery popups etcs
   
   bindPopUp(); 
    }
},
 add:function()
 {
 $("#pop-work-item-controls").html(' <a href="javascript:void(0)" onclick=\'createNewWorkItem("'+$.ozmo_media.settings.media_type+'","close");return false;\'><b>[ Save & Close ]</b></a>&nbsp;&nbsp;'+
' <a class="adorn" href="javascript:void(0)" onclick=\'createNewWorkItem("'+$.ozmo_media.settings.media_type+'","more");return false;\'><b>[ Save & Add more.. ]</b></a>&nbsp;&nbsp;'+
'<a href="javascript:void(0)" onclick="tb_remove();"><b>[ Close ]</b></a>'
);
   //$('#hiddenModalContent').modal();      
 tb_show('Add new items',  '#TB_inline?height=350&amp;width=350&inlineId=hiddenModalContent&modal=true', null);
 $('#TB_window a.whatsthis-img').cluetip({
           activation: 'click',
           cluetipClass: 'jtip', arrows: true, 
          dropShadow: true, 
          height: '350px',
          width: '450px', 
          sticky: true,
          positionBy: 'auto',
           hoverClass: 'highlight'
});
          $('#TB_window a.thickbox').click(function(){
        var t = this.title || this.name || null;
        var a = this.href || this.alt;
        var g = this.rel || false;
        tb_show(t,a,g);
        this.blur();
        return false;
        });
  $("#TB_window #edit-work-items-date").unmask();
   $("#TB_window  #hiddenModalFormtable").fadeIn(function() {
    if ($.browser.msie)
        this.style.removeAttribute('filter');
        });
        
 $("#TB_window  #newWorkItemMessage").fadeOut('slow');
 
 
 $("#TB_window #edit-work-items-date").mask("99/99/9999");
 },
 
form_template:function(ID,title_value,url_value,thumb_url_value,file_ext_value,date_value,keywords_value)
 {
 
 hidden_fields='<input type="hidden" name="work_item_ids['+ID+']" value="'+ID+'" />';
    if($.ozmo_media.settings.media_type=='image'){
 hidden_fields=hidden_fields+'<div id="work-item-form-'+ ID +'" style="display:none;">'+
    '<b>Title :</b><br/><input type="text"  value="{0}" name="work_items_name_'+ ID +'" id="work-items-name-'+ ID +'" ><br/>'+
    '<b>Image URL:</b><br/><input type="text" value="{1}"  name="work_items_url_'+ ID +'" id="work-items-url-'+ ID +'"><br/>'+
    '<b>Thumb URL:</b><br/><input type="text" value="{2}"  name="work_items_thumb_url_'+ ID +'" id="work-items-thumb-url-'+ ID +'"><br/>'+
    '<b>Date:</b><br/><input type="text" value="{3}"  name="work_items_date_'+ ID +'" id="work-items-date-'+ ID +'"><br/>'+
    '<b>Keywords:</b><br/><textarea  name="work_items_desc_'+ ID +'" id="work-items-desc-'+ ID +'">{4}</textarea><br/>'+
     '<input type="hidden" id="work-items-new-'+ ID +'" name="work_items_new_'+ ID +'" value="1"/>'+
    '</div>';
    
    return String.format(hidden_fields,title_value,url_value,thumb_url_value,date_value,keywords_value);
    }
    else if($.ozmo_media.settings.media_type=='text'){
     hidden_fields=hidden_fields+'<div id="work-item-form-'+ ID +'" style="display:none;">'+
    '<b>Title :</b><br/><input type="text"  value="{0}" name="work_items_name_'+ ID +'" id="work-items-name-'+ ID +'" ><br/>'+
    '<b>URL:</b><br/><input type="text" value="{1}"  name="work_items_url_'+ ID +'" id="work-items-url-'+ ID +'"><br/>'+
    '<b>Date:</b><br/><input type="text" value="{2}"  name="work_items_date_'+ ID +'" id="work-items-date-'+ ID +'"><br/>'+
    '<b>Keywords:</b><br/><textarea  name="work_items_desc_'+ ID +'" id="work-items-desc-'+ ID +'">{3}</textarea><br/>'+
     '<input type="hidden" id="work-items-new-'+ ID +'" name="work_items_new_'+ ID +'" value="1"/>'+
    '</div>';
    return String.format(hidden_fields,title_value,url_value,date_value,keywords_value);
    }
    else    if($.ozmo_media.settings.media_type=='audio'){
     hidden_fields=hidden_fields+'<div id="work-item-form-'+ ID +'" style="display:none;">'+
    '<b>Title :</b><br/><input type="text"  value="{0}" name="work_items_name_'+ ID +'" id="work-items-name-'+ ID +'" ><br/>'+
    '<b>Audio URL:</b><br/><input type="text" value="{1}"  name="work_items_url_'+ ID +'" id="work-items-url-'+ ID +'"><br/>'+
    '<b>Type:</b><br/><input type="text" value="{2}"  name="work_items_file_ext_'+ id +'" id="work-items-file-ext-'+ id +'"><br/>'+  
    '<b>Date:</b><br/><input type="text" value="{3}"  name="work_items_date_'+ ID +'" id="work-items-date-'+ ID +'"><br/>'+
    '<b>Keywords:</b><br/><textarea  name="work_items_desc_'+ ID +'" id="work-items-desc-'+ ID +'">{4}</textarea><br/>'+
     '<input type="hidden" id="work-items-new-'+ ID +'" name="work_items_new_'+ ID +'" value="1"/>'+
    '</div>';
    return String.format(hidden_fields,title_value,url_value,file_ext_value,date_value,keywords_value);
    }
    else    if($.ozmo_media.settings.media_type=='video'){
    hidden_fields=hidden_fields+'<div id="work-item-form-'+ ID +'" style="display:none;">'+
    '<b>Title :</b><br/><input type="text"  value="{0}" name="work_items_name_'+ ID +'" id="work-items-name-'+ ID +'" ><br/>'+
    '<b>Video URL:</b><br/><input type="text" value="{1}"  name="work_items_url_'+ ID +'" id="work-items-url-'+ ID +'"><br/>'+
    '<b>Type:</b><br/><input type="text" value="{2}"  name="work_items_file_ext_'+ id +'" id="work-items-file-ext-'+ id +'"><br/>'+  
    '<b>Date:</b><br/><input type="text" value="{3}"  name="work_items_date_'+ ID +'" id="work-items-date-'+ ID +'"><br/>'+
    '<b>Keywords:</b><br/><textarea  name="work_items_desc_'+ ID +'" id="work-items-desc-'+ ID +'">{4}</textarea><br/>'+
     '<input type="hidden" id="work-items-new-'+ ID +'" name="work_items_new_'+ ID +'" value="1"/>'+
    '</div>';
    return String.format(hidden_fields,title_value,url_value,file_ext_value,date_value,keywords_value);
    }
},

  item_template:function(ID,displaytxt,desc_value)
  {
   if($.ozmo_media.settings.media_type=='image'){
          item_html=   '<div id="work-item-display-'+ ID+'" style="display:block;" >'+
            '<div id="edit-work-item-controls-top" class="work_item_control" >'+
            '<b><div class="item_image_edit" onclick=\'javascript:editWorkItem('+ID+',"'+ $.ozmo_media.settings.media_type +'");return false;\' title="Edit">&nbsp;</div></b></div>'+
            '<div id="display-content-'+ ID +'"  style="display:block;width:150px;text-align:center;">{0}</div>'+
            '<div id="edit-work-item-controls-bot" class="work_item_control" ><b>'+
            '<div  class="item_image_delete" onclick=\'javascript:deleteWorkItem("#work-item-' + ID +'","'+ $.ozmo_media.settings.media_type +'");\' title="Delete">&nbsp;</div></b></div>'+
            '<div id="image-desc-'+ID+'"  style="width:100px;overflow:auto;">{1}..</div>'; 
            '</div>';
            return String.format(item_html,displaytxt,desc_value.substr(0,10));
    }
    if($.ozmo_media.settings.media_type=='text'){
         item_html= '<div id="work-item-display-'+ ID +'" style="width:75%;display:block;" >{0}</div>'+
         '</td><td  align="right"><div id="edit-work-item-controls-top" class="work_item_control" >'+
        '<b><div  class="item_link_edit" onclick=\'javascript:editWorkItem('+ID+',"'+  $.ozmo_media.settings.media_type +'");return false;\'  title="Edit">&nbsp;</div></b></div>'+
        '<div id="edit-work-item-controls-bot" class="work_item_control" ><b><div class="item_link_delete" onclick=\'javascript:deleteWorkItem("#work-item-' + ID +'","text");\' title="Delete">&nbsp;</div></b></div>';
         return String.format(item_html,displaytxt);

    }
    if($.ozmo_media.settings.media_type=='video'){
     item_html ='<div id="work-item-display-'+ ID+'" style="display:block;" >'+
    '<div id="edit-work-item-controls-top" class="work_item_control" >'+
    '<b><div class="item_image_edit" onclick=\'javascript:editWorkItem('+ID+',"'+ $.ozmo_media.settings.media_type +'");return false;\' title="Edit">&nbsp;</div></b></div><br/>'+
    '<div id="display-content-'+ ID +'" style="display:block;width:150px;text-align:center;">{0}</div>'+
    '<br/><div id="edit-work-item-controls-bot" class="work_item_control" ><b>'+
    '<div  class="item_image_delete" onclick=\'javascript:deleteWorkItem("#work-item-' + ID +'","'+ $.ozmo_media.settings.media_type +'");\' title="Delete">&nbsp;</div></b></div>'+
    '<div id="image-desc-'+id+'"  style="width:100px;overflow:auto;">{1}..</div>'+
    '</div>'; 
    return String.format(item_html,displaytxt,desc_value.substr(0,100));
    }
    if($.ozmo_media.settings.media_type=='audio'){
     item_html ='<div id="work-item-display-'+ ID +'" style="display:block;" >'+
    '<div id="edit-work-item-controls-top" class="work_item_control" >'+
    '<b><div class="item_image_edit" onclick=\'javascript:editWorkItem('+ID+',"'+ $.ozmo_media.settings.media_type +'");return false;\' title="Edit">&nbsp;</div></b></div><br/><br/>'+
    '<div id="display-content-'+ ID +'" style="display:block;width:150px;text-align:center;">{0}</div>'+
    '<br/><div id="edit-work-item-controls-bot" class="work_item_control" ><b>'+
    '<div  class="item_image_delete" onclick=\'javascript:deleteWorkItem("#work-item-' + ID +'","'+ $.ozmo_media.settings.media_type +'");\' title="Delete">&nbsp;</div></b></div>'+
    '<div id="image-desc-'+ID+'"  style="width:100px;overflow:auto;">{1}..</div>'; 
    '</div>';
    return String.format(item_html,displaytxt,desc_value.substr(0,100));
    }
  },
  

displayText:function(id_value,title_value,url_value,thumb_url_value,date_value,desc_value,file_ext_value,object_id)
{
if($.ozmo_media.settings.media_type=='image')
    return title_value.substr(0,10) +String.format('<a class="thickbox"  rel="ozmo-gallery" href="{0}" title="{1}"><img id="{2}" class="thumb" alt="Add image url with http://" src="{3}" width="100px" /></a>',url_value,title_value.substr(0,20),object_id,thumb_url_value);
else if($.ozmo_media.settings.media_type=='text')
return  String.format('<b>Title:</b>&nbsp;{0}<br/><b>URL:</b>&nbsp;<a class="thickbox"  href="{1}?keepThis=true&TB_iframe=true&height=300&width=500" title="{2}" id="{3}">{4}</a><br/><b>Keywords:</b><br/>{5}',title_value,url_value,title_value,object_id,miadella_insertspace(url_value,75),desc_value);
else if($.ozmo_media.settings.media_type=='audio')
    return title_value.substr(0,10) +String.format('<a href="{0}" class="{1}" id="{2}"  title="{3}">{4}</a>',url_value,getAudioClass(file_ext_value),object_id,title_value,title_value);
else if($.ozmo_media.settings.media_type=='video')
    return title_value.substr(0,10) +String.format('<a href="{0}" class="{1}" id="{2}"  title="{3}">{4}</a>',url_value,getVideoClass(file_ext_value),object_id,title_value);



}

};
;
/* AGGREGATED JS FILE: sites/all/modules/miadella/js/ozmo_picasa.js */
$.picasaAlbums = {
    settings : {
        id: null, //the picasaAlbums object id
        initTime:8000, //the albums of intial time
        albumn_name:0,
        albumnaccount:'', //your picasa account name
        loadingImg:"files/images/loadingAnimation.gif",
        loadingMsg:"...", //the select text
        selectText:"",
        selectImage:"http://www.ozmo.com/files/images/select.png",
        albumlink:"",
        operation:"showphotos"
    },
    
    actId:null,
    ddlObj:null,
    initsec:null,
    photos_from_album_array:null,
    photoinit:function(options){
    if (typeof options != undefined) {
            $.extend($.picasaAlbums.settings, options);
            }
            
            /*if($.picasaAlbums.settings.operation=='showphotos')
                $.picasaAlbums.requestphoto();
               else*/
                if($.picasaAlbums.settings.operation=='loadphotos') 
               $.picasaAlbums.requestphoto();
       } ,
    init: function(options){
        if (typeof options != undefined) {
            $.extend($.picasaAlbums.settings, options);
            }
            
        $.picasaAlbums.requestCss($.picasaAlbums.settings.cssUrl);  
        //document.write('<div id="'+$.picasaAlbums.settings.id+'" style="margin:0 0 0 14px;"><div class="myalbums"><img src="'+$.picasaAlbums.settings.loadingImg+'" /><br/><span class="loadingMessage" style=" font-size:16px;"></span></div><br/><div class="myphotos"></div></div>');
        $("#"+$.picasaAlbums.settings.id).html('<div class="myalbums"><img src="'+$.picasaAlbums.settings.loadingImg+'" /><br/><span class="loadingMessage" style=" font-size:16px;"></span></div><br/><div class="myphotos"></div>');
        $.picasaAlbums.initsec=$.picasaAlbums.settings.initTime/1000;
        $(".loadingMessage",$("#"+$.picasaAlbums.settings.id)).html($.picasaAlbums.settings.loadingMsg+"("+$.picasaAlbums.initsec+")");

        $.picasaAlbums.actId=setInterval($.picasaAlbums.callrequestcontent,1000);
        
    },
    
  
    
    callrequestcontent : function (){
        
        if($.picasaAlbums.initsec<=2)  
        {
            
            $.picasaAlbums.requestContent('http://picasaweb.google.com/data/feed/api/user/'+$.picasaAlbums.settings.albumnaccount+'?kind=album&access=public&alt=json-in-script&callback=$.picasaAlbums.showalbums');        
        }
            
        $(".loadingMessage",$("#"+$.picasaAlbums.settings.id)).html($.picasaAlbums.settings.loadingMsg+"("+($.picasaAlbums.initsec--)+")");  
          
    },
    
    showalbums : function (json){   
       
       $.picasaAlbums.ddlObj=$(".myalbums",$("#"+$.picasaAlbums.settings.id)).finalselect({id:$.picasaAlbums.settings.id+"ddlAlbums",viewHeight:"180px",selectText:$.picasaAlbums.settings.selectText ,selectImage:$.picasaAlbums.settings.selectImage});
       $.picasaAlbums.ddlObj.onClick($.picasaAlbums.requestphoto);
        
        
        var template="<table><tr><td style='width: 37px;'><img src='{0}' style='width:50px;height:50px;' /></td><td><span class='thistext'>{1}</span></td></tr></table>";
        
        var numentries = json.feed.entry.length;   
        for (var i = 0; i < numentries; i++) {
                 
            var entry = json.feed.entry[i];
            
            $.picasaAlbums.ddlObj.addItem(String.format(template,entry.media$group.media$thumbnail[0].url,entry.title.$t),entry.gphoto$name.$t);


        }//end for     
        
        clearInterval($.picasaAlbums.actId);
        
    },    
    
    requestphoto : function(){
        
         $.blockUI({ css: { 
            border: 'none', 
            padding: '15px', 
            backgroundColor: '#000', 
            '-webkit-border-radius': '10px', 
            '-moz-border-radius': '10px', 
            opacity: '.5', 
            color: '#fff' 
        } }); 
       
       
        $.picasaAlbums.requestContent(String.format('http://picasaweb.google.com/data/feed/api/user/{0}/albumid/{1}?kind=photo&access=public&alt=json-in-script&callback=$.picasaAlbums.showPhotos'
        ,$.picasaAlbums.settings.albumnaccount,$.picasaAlbums.settings.id));
    },    
createBulkXML:function()
{


        $.blockUI({ css: { 
            border: 'none', 
            padding: '15px', 
            backgroundColor: '#000', 
            '-webkit-border-radius': '10px', 
            '-moz-border-radius': '10px', 
            opacity: '.5', 
            color: '#fff' 
        } });
      
    var returnXML="";
    var item_title=new Array();
    var item_url=new Array();
    var item_thumb_url=new Array();
    var item_date=new Array();
    var item_desc=new Array();
    var item_control_value=new Array();
    
    
    
    
    var validate=true; // set this to false when condition fails
     try{
     //  $("#picasa_bulk_images").each(function () {
                    //$('div#TB_window input:hidden').each( function() {
                    var index=0
                    
                    
                    $('div#TB_window').find("input[@type$='checkbox']").each( function() {
                           if(this.checked==true && this.name!='')
                           {
                            var hidden_control_name = this.name;
                              var hidden_control_value = this.value;
                              
                                    item_title[index]=$("div#TB_window #picasa-work-items-name-"+hidden_control_value).val();
                                    item_url[index]=$("div#TB_window #picasa-work-items-url-"+hidden_control_value).val();
                                    item_thumb_url[index]=$("div#TB_window #picasa-work-items-thumb-url-"+hidden_control_value).val();
                                    item_date[index]=$("div#TB_window #picasa-work-items-date-"+hidden_control_value).val();
                                    item_desc[index]=$("div#TB_window #picasa-work-items-desc-"+hidden_control_value).val();
                                    item_control_value[index]=hidden_control_value;
                                    //validateion
                                     if(item_title[index]=='')
                                    {
                                    alert("Please enter image title for the selected item.");
                                        $("div#TB_window #picasa-work-items-name-"+hidden_control_value).focus();
                                        throw true;
                                    }
                                    if(item_url[index]=='')
                                    {alert("Please enter valid image url for the selected item.");
                                        $("div#TB_window #picasa-work-items-url-"+hidden_control_value).focus();
                                        throw true;
                                    }
                                    if(item_thumb_url[index]=='')
                                            item_thumb_url[index]=item_url[index];
                                    
                                    index++;
                           }
                    
                    });
                    index=0;
                    
                    for(index=0;index<item_title.length;index++)
                    {
                    $('#TB_window #picasa-row-'+item_control_value[index]).remove();
                                            returnXML=returnXML+"<image><id>"+ item_control_value[index]+"</id><title><![CDATA["+item_title[index]+"]]></title><url><![CDATA["+item_url[index]+"]]></url><thumb_url><![CDATA["+item_thumb_url[index]+"]]></thumb_url><date><![CDATA["+item_date[index]+"]]></date><desc><![CDATA["+item_desc[index]+"]]></desc><ext_type></ext_type></image>";
                    }
                    
                   
    
    }
    catch(e)
    {
    return false;
    }
    rootXML =   "<\?xml version=\"1.0\" encoding=\"iso-8859-1\"?><images>";
    footerXML='</images>';
    
    
    returnXML=rootXML+returnXML+footerXML;
  
    return returnXML;
},
    
    showPhotos : function (json){
        var galleryTemplate="<a class='thickbox' rel='ozmo-gallery' href='{0}' title='{1}'><img src='{2}' alt='' /></a>";    
              
        var htmlStr="";   
        
        var numentries = json.feed.entry.length;
        
        if($.picasaAlbums.settings.operation=='loadphotos'){
        var loadTemplate="<table align='center' cellspacing=0 cellpadding=3><tr bgcolor=\"#d1d3da\"><td valign=top align=right><strong>Select All</strong> </td><td><input type=checkbox checked onclick='javascript:$.picasaAlbums.selectAllPicasaItems(this);'> <td>Total no of images :" +numentries+"</td></tr>";
        var row = 1;
        var id=0;}
        else
        {
        clearAllWorkItem('image');
        }
        for (var i = 0; i < numentries; i++) {
           
            var entry = json.feed.entry[i];
            
            var thumbnail=entry.media$group.media$thumbnail[1];
            var thumbnail_2=entry.media$group.media$thumbnail[2];
            var caption=entry.media$group.media$description.$t;
            var dt = new Date(parseInt(entry.gphoto$timestamp.$t));
          var date_published= dt.getMonth()+'/'+dt.getDate()+'/'+dt.getFullYear()
            //dateFormat("2008-09-01T21:25:10.000Z")
            //var date_published=publisheddate.dateFormat("mm/dd/yyyy");
                    if($.picasaAlbums.settings.operation=='loadphotos')
                    {
                                        if (row % 2) 
                                        {
                                            backcolor = "#e6e9ef";
                                            } else {
                                            backcolor = "#d1d3da";
                                        }
                                        loadTemplate=loadTemplate+ '<tr id="picasa-row-'+id +'" bgcolor="' +backcolor+ '"><td valign=middle align=right>';
                                        
                                        loadTemplate=loadTemplate+ '<table cellspacing=0 cellpadding=2  id="content_table">';
                                        
                                        loadTemplate=loadTemplate+ '<tr bgcolor="' +backcolor+ '"><td>&nbsp;</td><td valign=top align=right></td></tr>';
                                        loadTemplate=loadTemplate+ '<tr><td valign=top align=right><b>Title :</b></td><td><input type="text" size=38 name="picasa_work_items_name['+id+']" id="picasa-work-items-name-'+id+'" value="'+entry.title.$t+'"/></td></tr>';
                                        loadTemplate=loadTemplate+ '<tr><td valign=top align=right><b>image URL:</b></td><td><input type="text" size=38 name="picasa_work_items_url['+id+']" id="picasa-work-items-url-'+id+'" value="'+entry.media$group.media$content[0].url+'?imgmax=800" /></td></tr>';
                                        loadTemplate=loadTemplate+ '<tr><td valign=top align=right><b>Thumb URL:</b></td><td><input type="text" size=38 name="picasa_work_items_thumb_url['+id+']" id="picasa-work-items-thumb-url-'+id+'" value="'+thumbnail.url+'" /></td></tr>';
                                        loadTemplate=loadTemplate+ '<tr><td valign=top align=right><b>Date :</b></td><td><input type="text" size=10 name="picasa_work_items_date['+id+']" id="picasa-work-items-date-'+id+'" value="'+date_published+'" /></td></tr>';
                                        loadTemplate=loadTemplate+ '<tr><td valign=top align=right><b>Keywords:</b></td><td><textarea name="picasa_work_items_desc['+id+']" onkeyup="limitChars(250)" id="picasa-work-items-desc-'+id+'" rows="5" cols="20" style="width:250px;">'+caption+ '</textarea></td></tr>';      
                                        loadTemplate=loadTemplate+ '</table>';
                                        loadTemplate=loadTemplate+ '</td><td valign="top"><input type=checkbox checked id="picasa-work-items-check-'+id+'" value="'+id+'" name="picasa_work_items_check['+id+']" ></td><td valign=top align=left>';
                                        loadTemplate=loadTemplate+ '<a target="picasapop" href="javascript:void(0);" onclick=\'javascript:window.open("'+entry.media$group.media$content[0].url+'","popup","width=500,height=300,resizable=yes");\'><img border=0 src="' +thumbnail_2.url+ '"></a>';
                                        loadTemplate=loadTemplate+ "</td></tr>";
                                        row++;
                                        id++;
                                    
                                    
                                
                                    
                    }
                    else
                    crateWorkItemFromXML(i,'image',entry.title.$t,entry.media$group.media$content[0].url,thumbnail.url,caption,'','')
           // htmlStr=htmlStr+String.format(galleryTemplate, entry.media$group.media$content[0].url+'?imgmax=576' ,entry.title.$t,thumbnail.url);    
        }
         if($.picasaAlbums.settings.operation=='loadphotos')
                                    {loadTemplate=loadTemplate+ "</table>";
                                    $("#picasa_bulk_images").html(loadTemplate);
                                     
                                    tb_show($.picasaAlbums.settings.albumnaccount, '#TB_inline?height=450&width=800&modal=true&inlineId=picasa_bulk_images', null);
                                    $("#TB_window").append('<div style="background-color:gray;text-align:right"><input type="button" id="btn_close" value="Cancel" onclick=\'javascript:$("#picasa_bulk_images").html(\"\");tb_remove();\'/><input id ="btn_submit" type="button" value=" Select Images " onclick=\"javascript:ClosePicasaPage();\"</div>');}
        $.unblockUI();
         //on page load call tb_init  
      bindThickBox();
    
         // $('#work_items_block_image').append(htmlStr);
        /*$(".myphotos",$("#"+$.picasaAlbums.settings.id)).html(""); 
        $(".myphotos",$("#"+$.picasaAlbums.settings.id)).html("<span class='finalevilalbum'>"+htmlStr+"</span>");
        */
       

    },

    
    requestContent : function ( url ){
        var script = document.createElement('script');
        script.src = url;
        document.getElementsByTagName('head')[0].appendChild(script);
    },
    
   selectAllPicasaItems:function (obj)
    {
      
    var checked=false;
        if(obj.checked)
        checked=true;//"checked";
        $.blockUI({ css: { 
            border: 'none', 
            padding: '15px', 
            backgroundColor: '#000', 
            '-webkit-border-radius': '10px', 
            '-moz-border-radius': '10px', 
            opacity: '.5', 
            color: '#fff' 
        } });
              //$("div#TB_window").each(function () {
                    //$(this).children
                    //$('div#TB_window input:hidden').each( function() {
                  $('div#TB_window').find("input[@type$='checkbox']").each( function() {
                  this.checked=checked;
                                      //var hidden_control_name = this.name;
                                    //  var hidden_control_value = this.value;
                                    //this.attr('checked',checked);
                                    
                                      /*if(hidden_control_name=='picasa_work_item_count['+hidden_control_value+']')
                                      {
                                      $("div#TB_window #picasa-work-items-check-"+hidden_control_value).attr('checked',checked);
                                      }*/
                                      });
                                    // });
                                      $.unblockUI();
    } 
};

;
/* AGGREGATED JS FILE: sites/all/modules/cluetip/cluetip/jquery.dimensions.js */
/* Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * $LastChangedDate: 2007-08-17 14:14:11 -0400 (Fri, 17 Aug 2007) $
 * $Rev: 2759 $
 *
 * Version: 1.1.2
 *
 * Requires: jQuery 1.1.3+
 */

(function($){

// store a copy of the core height and width methods
var height = $.fn.height,
    width  = $.fn.width;

$.fn.extend({
	/**
	 * If used on document, returns the document's height (innerHeight).
	 * If used on window, returns the viewport's (window) height.
	 * See core docs on height() to see what happens when used on an element.
	 *
	 * @example $("#testdiv").height()
	 * @result 200
	 *
	 * @example $(document).height()
	 * @result 800
	 *
	 * @example $(window).height()
	 * @result 400
	 *
	 * @name height
	 * @type Number
	 * @cat Plugins/Dimensions
	 */
	height: function() {
		if ( !this[0] ) error();
		if ( this[0] == window )
			if ( $.browser.opera || ($.browser.safari && parseInt($.browser.version) > 520) )
				return self.innerHeight - (($(document).height() > self.innerHeight) ? getScrollbarWidth() : 0);

			else if ( $.browser.safari )
				return self.innerHeight;
			else
          //return $.boxModel && Math.min(document.documentElement.clientHeight,document.body.clientHeight);
      		return $.boxModel && document.documentElement.clientHeight || document.body.clientHeight;
		if ( this[0] == document ) 
			return Math.max( ($.boxModel && document.documentElement.scrollHeight || document.body.scrollHeight), document.body.offsetHeight );
		
		return height.apply(this, arguments);
	},
	
	/**
	 * If used on document, returns the document's width (innerWidth).
	 * If used on window, returns the viewport's (window) width.
	 * See core docs on width() to see what happens when used on an element.
	 *
	 * @example $("#testdiv").width()
	 * @result 200
	 *
	 * @example $(document).width()
	 * @result 800
	 *
	 * @example $(window).width()
	 * @result 400
	 *
	 * @name width
	 * @type Number
	 * @cat Plugins/Dimensions
	 */
	width: function() {
		if (!this[0]) error();
		if ( this[0] == window )
			if ( $.browser.opera || ($.browser.safari && parseInt($.browser.version) > 520) )
				return self.innerWidth - (($(document).width() > self.innerWidth) ? getScrollbarWidth() : 0);
			else if ( $.browser.safari )
				return self.innerWidth;
			else
                return $.boxModel && document.documentElement.clientWidth || document.body.clientWidth;

		if ( this[0] == document )
			if ($.browser.mozilla) {
				// mozilla reports scrollWidth and offsetWidth as the same
				var scrollLeft = self.pageXOffset;
				self.scrollTo(99999999, self.pageYOffset);
				var scrollWidth = self.pageXOffset;
				self.scrollTo(scrollLeft, self.pageYOffset);
				return document.body.offsetWidth + scrollWidth;
			}
			else 
				return Math.max( (($.boxModel && !$.browser.safari) && document.documentElement.scrollWidth || document.body.scrollWidth), document.body.offsetWidth );

		return width.apply(this, arguments);
	},
	
	/**
	 * Gets the inner height (excludes the border and includes the padding) for the first matched element.
	 * If used on document, returns the document's height (innerHeight).
	 * If used on window, returns the viewport's (window) height.
	 *
	 * @example $("#testdiv").innerHeight()
	 * @result 210
	 *
	 * @name innerHeight
	 * @type Number
	 * @cat Plugins/Dimensions
	 */
	innerHeight: function() {
		if (!this[0]) error();
		return this[0] == window || this[0] == document ?
			this.height() :
			this.is(':visible') ?
				this[0].offsetHeight - num(this, 'borderTopWidth') - num(this, 'borderBottomWidth') :
				this.height() + num(this, 'paddingTop') + num(this, 'paddingBottom');
	},
	
	/**
	 * Gets the inner width (excludes the border and includes the padding) for the first matched element.
	 * If used on document, returns the document's width (innerWidth).
	 * If used on window, returns the viewport's (window) width.
	 *
	 * @example $("#testdiv").innerWidth()
	 * @result 210
	 *
	 * @name innerWidth
	 * @type Number
	 * @cat Plugins/Dimensions
	 */
	innerWidth: function() {
		if (!this[0]) error();
		return this[0] == window || this[0] == document ?
			this.width() :
			this.is(':visible') ?
				this[0].offsetWidth - num(this, 'borderLeftWidth') - num(this, 'borderRightWidth') :
				this.width() + num(this, 'paddingLeft') + num(this, 'paddingRight');
	},
	
	/**
	 * Gets the outer height (includes the border and padding) for the first matched element.
	 * If used on document, returns the document's height (innerHeight).
	 * If used on window, returns the viewport's (window) height.
	 *
	 * The margin can be included in the calculation by passing an options map with margin
	 * set to true.
	 *
	 * @example $("#testdiv").outerHeight()
	 * @result 220
	 *
	 * @example $("#testdiv").outerHeight({ margin: true })
	 * @result 240
	 *
	 * @name outerHeight
	 * @type Number
	 * @param Map options Optional settings to configure the way the outer height is calculated.
	 * @cat Plugins/Dimensions
	 */
	outerHeight: function(options) {
		if (!this[0]) error();
		options = $.extend({ margin: false }, options || {});
		return this[0] == window || this[0] == document ?
			this.height() :
			this.is(':visible') ?
				this[0].offsetHeight + (options.margin ? (num(this, 'marginTop') + num(this, 'marginBottom')) : 0) :
				this.height() 
					+ num(this,'borderTopWidth') + num(this, 'borderBottomWidth') 
					+ num(this, 'paddingTop') + num(this, 'paddingBottom')
					+ (options.margin ? (num(this, 'marginTop') + num(this, 'marginBottom')) : 0);
	},
	
	/**
	 * Gets the outer width (including the border and padding) for the first matched element.
	 * If used on document, returns the document's width (innerWidth).
	 * If used on window, returns the viewport's (window) width.
	 *
	 * The margin can be included in the calculation by passing an options map with margin
	 * set to true.
	 *
	 * @example $("#testdiv").outerWidth()
	 * @result 1000
	 *
	 * @example $("#testdiv").outerWidth({ margin: true })
	 * @result 1020
	 * 
	 * @name outerHeight
	 * @type Number
	 * @param Map options Optional settings to configure the way the outer width is calculated.
	 * @cat Plugins/Dimensions
	 */
	outerWidth: function(options) {
		if (!this[0]) error();
		options = $.extend({ margin: false }, options || {});
		return this[0] == window || this[0] == document ?
			this.width() :
			this.is(':visible') ?
				this[0].offsetWidth + (options.margin ? (num(this, 'marginLeft') + num(this, 'marginRight')) : 0) :
				this.width() 
					+ num(this, 'borderLeftWidth') + num(this, 'borderRightWidth') 
					+ num(this, 'paddingLeft') + num(this, 'paddingRight')
					+ (options.margin ? (num(this, 'marginLeft') + num(this, 'marginRight')) : 0);
	},
	
	/**
	 * Gets how many pixels the user has scrolled to the right (scrollLeft).
	 * Works on containers with overflow: auto and window/document.
	 *
	 * @example $(window).scrollLeft()
	 * @result 100
	 *
	 * @example $(document).scrollLeft()
	 * @result 100
	 * 
	 * @example $("#testdiv").scrollLeft()
	 * @result 100
	 *
	 * @name scrollLeft
	 * @type Number
	 * @cat Plugins/Dimensions
	 */
	/**
	 * Sets the scrollLeft property for each element and continues the chain.
	 * Works on containers with overflow: auto and window/document.
	 *
	 * @example $(window).scrollLeft(100).scrollLeft()
	 * @result 100
	 * 
	 * @example $(document).scrollLeft(100).scrollLeft()
	 * @result 100
	 *
	 * @example $("#testdiv").scrollLeft(100).scrollLeft()
	 * @result 100
	 *
	 * @name scrollLeft
	 * @param Number value A positive number representing the desired scrollLeft.
	 * @type jQuery
	 * @cat Plugins/Dimensions
	 */
	scrollLeft: function(val) {
		if (!this[0]) error();
		if ( val != undefined )
			// set the scroll left
			return this.each(function() {
				if (this == window || this == document)
					window.scrollTo( val, $(window).scrollTop() );
				else
					this.scrollLeft = val;
			});
		
		// return the scroll left offest in pixels
		if ( this[0] == window || this[0] == document )
			return self.pageXOffset ||
				$.boxModel && document.documentElement.scrollLeft ||
				document.body.scrollLeft;
				
		return this[0].scrollLeft;
	},
	
	/**
	 * Gets how many pixels the user has scrolled to the bottom (scrollTop).
	 * Works on containers with overflow: auto and window/document.
	 *
	 * @example $(window).scrollTop()
	 * @result 100
	 *
	 * @example $(document).scrollTop()
	 * @result 100
	 * 
	 * @example $("#testdiv").scrollTop()
	 * @result 100
	 *
	 * @name scrollTop
	 * @type Number
	 * @cat Plugins/Dimensions
	 */
	/**
	 * Sets the scrollTop property for each element and continues the chain.
	 * Works on containers with overflow: auto and window/document.
	 *
	 * @example $(window).scrollTop(100).scrollTop()
	 * @result 100
	 * 
	 * @example $(document).scrollTop(100).scrollTop()
	 * @result 100
	 *
	 * @example $("#testdiv").scrollTop(100).scrollTop()
	 * @result 100
	 *
	 * @name scrollTop
	 * @param Number value A positive number representing the desired scrollTop.
	 * @type jQuery
	 * @cat Plugins/Dimensions
	 */
	scrollTop: function(val) {
		if (!this[0]) error();
		if ( val != undefined )
			// set the scroll top
			return this.each(function() {
				if (this == window || this == document)
					window.scrollTo( $(window).scrollLeft(), val );
				else
					this.scrollTop = val;
			});
		
		// return the scroll top offset in pixels
		if ( this[0] == window || this[0] == document )
			return self.pageYOffset ||
				$.boxModel && document.documentElement.scrollTop ||
				document.body.scrollTop;

		return this[0].scrollTop;
	},
	
	/** 
	 * Gets the top and left positioned offset in pixels.
	 * The positioned offset is the offset between a positioned
	 * parent and the element itself.
	 *
	 * For accurate calculations make sure to use pixel values for margins, borders and padding.
	 *
	 * @example $("#testdiv").position()
	 * @result { top: 100, left: 100 }
	 *
	 * @example var position = {};
	 * $("#testdiv").position(position)
	 * @result position = { top: 100, left: 100 }
	 * 
	 * @name position
	 * @param Object returnObject Optional An object to store the return value in, so as not to break the chain. If passed in the
	 *                            chain will not be broken and the result will be assigned to this object.
	 * @type Object
	 * @cat Plugins/Dimensions
	 */
	position: function(returnObject) {
		return this.offset({ margin: false, scroll: false, relativeTo: this.offsetParent() }, returnObject);
	},
	
	/**
	 * Gets the location of the element in pixels from the top left corner of the viewport.
	 * The offset method takes an optional map of key value pairs to configure the way
	 * the offset is calculated. Here are the different options.
	 *
	 * (Boolean) margin - Should the margin of the element be included in the calculations? True by default.
	 * (Boolean) border - Should the border of the element be included in the calculations? False by default. 
	 * (Boolean) padding - Should the padding of the element be included in the calculations? False by default. 
	 * (Boolean) scroll - Should the scroll offsets of the parent elements be included in the calculations? True by default.
	 *                    When true it adds the total scroll offsets of all parents to the total offset and also adds two
	 *                    properties to the returned object, scrollTop and scrollLeft.
	 * (Boolean) lite - When true it will use the offsetLite method instead of the full-blown, slower offset method. False by default.
	 *                  Only use this when margins, borders and padding calculations don't matter.
	 * (HTML Element) relativeTo - This should be a parent of the element and should have position (like absolute or relative).
	 *                             It will retreive the offset relative to this parent element. By default it is the body element.
	 *
	 * Also an object can be passed as the second paramater to
	 * catch the value of the return and continue the chain.
	 *
	 * For accurate calculations make sure to use pixel values for margins, borders and padding.
	 * 
	 * Known issues:
	 *  - Issue: A div positioned relative or static without any content before it and its parent will report an offsetTop of 0 in Safari
	 *    Workaround: Place content before the relative div ... and set height and width to 0 and overflow to hidden
	 *
	 * @example $("#testdiv").offset()
	 * @result { top: 100, left: 100, scrollTop: 10, scrollLeft: 10 }
	 *
	 * @example $("#testdiv").offset({ scroll: false })
	 * @result { top: 90, left: 90 }
	 *
	 * @example var offset = {}
	 * $("#testdiv").offset({ scroll: false }, offset)
	 * @result offset = { top: 90, left: 90 }
	 *
	 * @name offset
	 * @param Map options Optional settings to configure the way the offset is calculated.
	 * @param Object returnObject An object to store the return value in, so as not to break the chain. If passed in the
	 *                            chain will not be broken and the result will be assigned to this object.
	 * @type Object
	 * @cat Plugins/Dimensions
	 */
	offset: function(options, returnObject) {
		if (!this[0]) error();
		var x = 0, y = 0, sl = 0, st = 0,
		    elem = this[0], parent = this[0], op, parPos, elemPos = $.css(elem, 'position'),
		    mo = $.browser.mozilla, ie = $.browser.msie, oa = $.browser.opera,
		    sf = $.browser.safari, sf3 = $.browser.safari && parseInt($.browser.version) > 520,
		    absparent = false, relparent = false, 
		    options = $.extend({ margin: true, border: false, padding: false, scroll: true, lite: false, relativeTo: document.body }, options || {});
		
		// Use offsetLite if lite option is true
		if (options.lite) return this.offsetLite(options, returnObject);
		// Get the HTMLElement if relativeTo is a jquery collection
		if (options.relativeTo.jquery) options.relativeTo = options.relativeTo[0];
		
		if (elem.tagName == 'BODY') {
			// Safari 2 is the only one to get offsetLeft and offsetTop properties of the body "correct"
			// Except they all mess up when the body is positioned absolute or relative
			x = elem.offsetLeft;
			y = elem.offsetTop;
			// Mozilla ignores margin and subtracts border from body element
			if (mo) {
				x += num(elem, 'marginLeft') + (num(elem, 'borderLeftWidth')*2);
				y += num(elem, 'marginTop')  + (num(elem, 'borderTopWidth') *2);
			} else
			// Opera ignores margin
			if (oa) {
				x += num(elem, 'marginLeft');
				y += num(elem, 'marginTop');
			} else
			// IE does not add the border in Standards Mode
			if ((ie && jQuery.boxModel)) {
				x += num(elem, 'borderLeftWidth');
				y += num(elem, 'borderTopWidth');
			} else
			// Safari 3 doesn't not include border or margin
			if (sf3) {
				x += num(elem, 'marginLeft') + num(elem, 'borderLeftWidth');
				y += num(elem, 'marginTop')  + num(elem, 'borderTopWidth');
			}
		} else {
			do {
				parPos = $.css(parent, 'position');
			
				x += parent.offsetLeft;
				y += parent.offsetTop;

				// Mozilla and IE do not add the border
				// Mozilla adds the border for table cells
				if ((mo && !parent.tagName.match(/^t[d|h]$/i)) || ie || sf3) {
					// add borders to offset
					x += num(parent, 'borderLeftWidth');
					y += num(parent, 'borderTopWidth');

					// Mozilla does not include the border on body if an element isn't positioned absolute and is without an absolute parent
					if (mo && parPos == 'absolute') absparent = true;
					// IE does not include the border on the body if an element is position static and without an absolute or relative parent
					if (ie && parPos == 'relative') relparent = true;
				}

				op = parent.offsetParent || document.body;
				if (options.scroll || mo) {
					do {
						if (options.scroll) {
							// get scroll offsets
							sl += parent.scrollLeft;
							st += parent.scrollTop;
						}
						
						// Opera sometimes incorrectly reports scroll offset for elements with display set to table-row or inline
						if (oa && ($.css(parent, 'display') || '').match(/table-row|inline/)) {
							sl = sl - ((parent.scrollLeft == parent.offsetLeft) ? parent.scrollLeft : 0);
							st = st - ((parent.scrollTop == parent.offsetTop) ? parent.scrollTop : 0);
						}
				
						// Mozilla does not add the border for a parent that has overflow set to anything but visible
						if (mo && parent != elem && $.css(parent, 'overflow') != 'visible') {
							x += num(parent, 'borderLeftWidth');
							y += num(parent, 'borderTopWidth');
						}
				
						parent = parent.parentNode;
					} while (parent != op);
				}
				parent = op;
				
				// exit the loop if we are at the relativeTo option but not if it is the body or html tag
				if (parent == options.relativeTo && !(parent.tagName == 'BODY' || parent.tagName == 'HTML'))  {
					// Mozilla does not add the border for a parent that has overflow set to anything but visible
					if (mo && parent != elem && $.css(parent, 'overflow') != 'visible') {
						x += num(parent, 'borderLeftWidth');
						y += num(parent, 'borderTopWidth');
					}
					// Safari 2 and opera includes border on positioned parents
					if ( ((sf && !sf3) || oa) && parPos != 'static' ) {
						x -= num(op, 'borderLeftWidth');
						y -= num(op, 'borderTopWidth');
					}
					break;
				}
				if (parent.tagName == 'BODY' || parent.tagName == 'HTML') {
					// Safari 2 and IE Standards Mode doesn't add the body margin for elments positioned with static or relative
					if (((sf && !sf3) || (ie && $.boxModel)) && elemPos != 'absolute' && elemPos != 'fixed') {
						x += num(parent, 'marginLeft');
						y += num(parent, 'marginTop');
					}
					// Safari 3 does not include the border on body
					// Mozilla does not include the border on body if an element isn't positioned absolute and is without an absolute parent
					// IE does not include the border on the body if an element is positioned static and without an absolute or relative parent
					if ( sf3 || (mo && !absparent && elemPos != 'fixed') || 
					     (ie && elemPos == 'static' && !relparent) ) {
						x += num(parent, 'borderLeftWidth');
						y += num(parent, 'borderTopWidth');
					}
					break; // Exit the loop
				}
			} while (parent);
		}

		var returnValue = handleOffsetReturn(elem, options, x, y, sl, st);

		if (returnObject) { $.extend(returnObject, returnValue); return this; }
		else              { return returnValue; }
	},
	
	/**
	 * Gets the location of the element in pixels from the top left corner of the viewport.
	 * This method is much faster than offset but not as accurate when borders and margins are
	 * on the element and/or its parents. This method can be invoked
	 * by setting the lite option to true in the offset method.
	 * The offsetLite method takes an optional map of key value pairs to configure the way
	 * the offset is calculated. Here are the different options.
	 *
	 * (Boolean) margin - Should the margin of the element be included in the calculations? True by default.
	 * (Boolean) border - Should the border of the element be included in the calculations? False by default. 
	 * (Boolean) padding - Should the padding of the element be included in the calcuations? False by default. 
	 * (Boolean) scroll - Sould the scroll offsets of the parent elements be included int he calculations? True by default.
	 *                    When true it adds the total scroll offsets of all parents to the total offset and also adds two
	 *                    properties to the returned object, scrollTop and scrollLeft.
	 * (HTML Element) relativeTo - This should be a parent of the element and should have position (like absolute or relative).
	 *                             It will retreive the offset relative to this parent element. By default it is the body element.
	 *
	 * @name offsetLite
	 * @param Map options Optional settings to configure the way the offset is calculated.
	 * @param Object returnObject An object to store the return value in, so as not to break the chain. If passed in the
	 *                            chain will not be broken and the result will be assigned to this object.
	 * @type Object
	 * @cat Plugins/Dimensions
	 */
	offsetLite: function(options, returnObject) {
		if (!this[0]) error();
		var x = 0, y = 0, sl = 0, st = 0, parent = this[0], offsetParent, 
		    options = $.extend({ margin: true, border: false, padding: false, scroll: true, relativeTo: document.body }, options || {});
				
		// Get the HTMLElement if relativeTo is a jquery collection
		if (options.relativeTo.jquery) options.relativeTo = options.relativeTo[0];
		
		do {
			x += parent.offsetLeft;
			y += parent.offsetTop;

			offsetParent = parent.offsetParent || document.body;
			if (options.scroll) {
				// get scroll offsets
				do {
					sl += parent.scrollLeft;
					st += parent.scrollTop;
					parent = parent.parentNode;
				} while(parent != offsetParent);
			}
			parent = offsetParent;
		} while (parent && parent.tagName != 'BODY' && parent.tagName != 'HTML' && parent != options.relativeTo);

		var returnValue = handleOffsetReturn(this[0], options, x, y, sl, st);

		if (returnObject) { $.extend(returnObject, returnValue); return this; }
		else              { return returnValue; }
	},
	
	/**
	 * Returns a jQuery collection with the positioned parent of 
	 * the first matched element. This is the first parent of 
	 * the element that has position (as in relative or absolute).
	 *
	 * @name offsetParent
	 * @type jQuery
	 * @cat Plugins/Dimensions
	 */
	offsetParent: function() {
		if (!this[0]) error();
		var offsetParent = this[0].offsetParent;
		while ( offsetParent && (offsetParent.tagName != 'BODY' && $.css(offsetParent, 'position') == 'static') )
			offsetParent = offsetParent.offsetParent;
		return $(offsetParent);
	}
});

/**
 * Throws an error message when no elements are in the jQuery collection
 * @private
 */
var error = function() {
	throw "Dimensions: jQuery collection is empty";
};

/**
 * Handles converting a CSS Style into an Integer.
 * @private
 */
var num = function(el, prop) {
	return parseInt($.css(el.jquery?el[0]:el,prop))||0;
};

/**
 * Handles the return value of the offset and offsetLite methods.
 * @private
 */
var handleOffsetReturn = function(elem, options, x, y, sl, st) {
	if ( !options.margin ) {
		x -= num(elem, 'marginLeft');
		y -= num(elem, 'marginTop');
	}

	// Safari and Opera do not add the border for the element
	if ( options.border && (($.browser.safari && parseInt($.browser.version) < 520) || $.browser.opera) ) {
		x += num(elem, 'borderLeftWidth');
		y += num(elem, 'borderTopWidth');
	} else if ( !options.border && !(($.browser.safari && parseInt($.browser.version) < 520) || $.browser.opera) ) {
		x -= num(elem, 'borderLeftWidth');
		y -= num(elem, 'borderTopWidth');
	}

	if ( options.padding ) {
		x += num(elem, 'paddingLeft');
		y += num(elem, 'paddingTop');
	}
	
	// do not include scroll offset on the element ... opera sometimes reports scroll offset as actual offset
	if ( options.scroll && (!$.browser.opera || elem.offsetLeft != elem.scrollLeft && elem.offsetTop != elem.scrollLeft) ) {
		sl -= elem.scrollLeft;
		st -= elem.scrollTop;
	}

	return options.scroll ? { top: y - st, left: x - sl, scrollTop:  st, scrollLeft: sl }
	                      : { top: y, left: x };
};

/**
 * Gets the width of the OS scrollbar
 * @private
 */
var scrollbarWidth = 0;
var getScrollbarWidth = function() {
	if (!scrollbarWidth) {
		var testEl = $('<div>')
				.css({
					width: 100,
					height: 100,
					overflow: 'auto',
					position: 'absolute',
					top: -1000,
					left: -1000
				})
				.appendTo('body');
		scrollbarWidth = 100 - testEl
			.append('<div>')
			.find('div')
				.css({
					width: '100%',
					height: 200
				})
				.width();
		testEl.remove();
	}
	return scrollbarWidth;
};

})(jQuery);
;
/* AGGREGATED JS FILE: sites/all/modules/cluetip/cluetip/jquery.hoverIntent.js */
ď»ż/**
* hoverIntent is similar to jQuery's built-in "hover" function except that
* instead of firing the onMouseOver event immediately, hoverIntent checks
* to see if the user's mouse has slowed down (beneath the sensitivity
* threshold) before firing the onMouseOver event.
* 
* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
* 
* hoverIntent is currently available for use in all personal or commercial 
* projects under both MIT and GPL licenses. This means that you can choose 
* the license that best suits your project, and use it accordingly.
* 
* // basic usage (just like .hover) receives onMouseOver and onMouseOut functions
* $("ul li").hoverIntent( showNav , hideNav );
* 
* // advanced usage receives configuration object only
* $("ul li").hoverIntent({
*	sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)
*	interval: 50,   // number = milliseconds of polling interval
*	over: showNav,  // function = onMouseOver callback (required)
*	timeout: 100,   // number = milliseconds delay before onMouseOut function call
*	out: hideNav    // function = onMouseOut callback (required)
* });
* 
* @param  f  onMouseOver function || An object with configuration options
* @param  g  onMouseOut function  || Nothing (use configuration options object)
* @return    The object (aka "this") that called hoverIntent, and the event object
* @author    Brian Cherne <brian@cherne.net>
*/
(function($) {
	$.fn.hoverIntent = function(f,g) {
		// default configuration options
		var cfg = {
			sensitivity: 7,
			interval: 100,
			timeout: 0
		};
		// override configuration options with user supplied object
		cfg = $.extend(cfg, g ? { over: f, out: g } : f );

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

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

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

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

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

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

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

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

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

		// bind the function to the two event listeners
		return this.mouseover(handleHover).mouseout(handleHover);
	};
})(jQuery);
;
/* AGGREGATED JS FILE: sites/all/modules/cluetip/cluetip/jquery.cluetip.js */
/*
 * jQuery clueTip plugin
 * Version 0.9.6  (02/02/2008)
 * @requires jQuery v1.1.1+
 * @requires Dimensions plugin 
 *
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */
(function($) { 
/*
 * @name clueTip
 * @type jQuery
 * @cat Plugins/tooltip
 * @return jQuery
 * @author Karl Swedberg
 *
 * @credit Inspired by Cody Lindley's jTip (http://www.codylindley.com)
 * @credit Thanks to the following people for their many and varied contributions:
      Shelane Enos, Glen Lipka, Hector Santos, Torben Schreiter, Dan G. Switzer, JĂ¶rn Zaefferer 
 * @credit Thanks to Jonathan Chaffer, as always, for help with the hard parts. :-)
 */

 /**
 * 
 * Displays a highly customizable tooltip when the user hovers (default) or clicks (optional) the matched element. 
 * By default, the clueTip plugin loads a page indicated by the "rel" attribute via ajax and displays its contents.
 * If a "title" attribute is specified, its value is used as the clueTip's heading.
 * The attribute to be used for both the body and the heading of the clueTip is user-configurable. 
 * Optionally, the clueTip's body can display content from an element on the same page.
 * * Just indicate the element's id (e.g. "#some-id") in the rel attribute.
 * Optionally, the clueTip's body can display content from the title attribute, when a delimiter is indicated. 
 * * The string before the first instance of the delimiter is set as the clueTip's heading.
 * * All subsequent strings are wrapped in separate DIVs and placed in the clueTip's body.
 * The clueTip plugin allows for many, many more options. Pleasee see the examples and the option descriptions below...
 * 
 * 
 * @example $('#tip).cluetip();
 * @desc This is the most basic clueTip. It displays a 275px-wide clueTip on mouseover of the element with an ID of "tip." On mouseout of the element, the clueTip is hidden.
 *
 *
 * @example $('a.clue').cluetip({
 *  hoverClass: 'highlight',
 *  sticky: true,
 *  closePosition: 'bottom',
 *  closeText: '<img src="cross.png" alt="close" />',
 *  truncate: 60,
 *  ajaxSettings: {
 *    type: 'POST'
 *  }
 * });
 * @desc Displays a clueTip on mouseover of all <a> elements with class="clue". The hovered element gets a class of "highlight" added to it (so that it can be styled appropriately. This is esp. useful for non-anchor elements.). The clueTip is "sticky," which means that it will not be hidden until the user either clicks on its "close" text/graphic or displays another clueTip. The "close" text/graphic is set to diplay at the bottom of the clueTip (default is top) and display an image rather than the default "Close" text. Moreover, the body of the clueTip is truncated to the first 60 characters, which are followed by an ellipsis (...). Finally, the clueTip retrieves the content using POST rather than the $.ajax method's default "GET."
 * 
 * More examples can be found at http://plugins.learningjquery.com/cluetip/demo/
 * 
 * Full list of options/settings can be found at the bottom of this file and at http://plugins.learningjquery.com/cluetip/
 */

  var $cluetip, $cluetipInner, $cluetipOuter, $cluetipTitle, $cluetipArrows, $dropShadow, imgCount;
  $.fn.cluetip = function(options) {

    var opts = $.extend({},$.fn.cluetip.defaults, options);

    if (options && options.ajaxSettings) {
      $.extend(opts.ajaxSettings, options.ajaxSettings);
      delete options.ajaxSettings;
    }
    
    if (options && options.hoverIntent) {
      $.extend(opts.hoverIntent, options.hoverIntent);
      delete options.hoverIntent;
    }    

    if (options && options.fx) {
      $.extend(opts.fx, options.fx);
      delete options.fx;
    }
    
    return this.each(function(index) {
      // start out with no contents (for ajax activation)
      var cluetipContents = false;
      var cluezIndex = parseInt(opts.cluezIndex, 10)-1;
      var isActive = false, closeOnDelay = 0;

      // create the cluetip divs
      if (!$cluetip) {
        $cluetipInner = $('<div id="cluetip-inner"></div>');
        $cluetipTitle = $('<h3 id="cluetip-title"></h3>');        
        $cluetipOuter = $('<div id="cluetip-outer"></div>').append($cluetipInner).prepend($cluetipTitle);
        $cluetip = $('<div id="cluetip"></div>').css({zIndex: opts.cluezIndex})
        .append($cluetipOuter).append('<div id="cluetip-extra"></div>')[insertionType](insertionElement).hide();
        $('<div id="cluetip-waitimage"></div>').css({position: 'absolute', zIndex: cluezIndex-1})
        .insertBefore('#cluetip').hide();
        $cluetip.css({position: 'absolute', zIndex: cluezIndex});
        $cluetipOuter.css({position: 'relative', zIndex: cluezIndex+1});
        $cluetipArrows = $('<div id="cluetip-arrows" class="cluetip-arrows"></div>').css({zIndex: cluezIndex+1}).appendTo('#cluetip');
      }
      var dropShadowSteps = (opts.dropShadow) ? +opts.dropShadowSteps : 0;
      if (!$dropShadow) {
        $dropShadow = $([]);
        for (var i=0; i < dropShadowSteps; i++) {
          $dropShadow = $dropShadow.add($('<div></div>').css({zIndex: cluezIndex-i-1, opacity:.1, top: 1+i, left: 1+i}));
        };
        $dropShadow.css({position: 'absolute', backgroundColor: '#000'})
        .prependTo($cluetip);
      }
      var $this = $(this);
      var tipAttribute = $this.attr(opts.attribute), ctClass = opts.cluetipClass;
      if (!tipAttribute && !opts.splitTitle) return true;
      // if hideLocal is set to true, on DOM ready hide the local content that will be displayed in the clueTip
      if (opts.local && opts.hideLocal) { $(tipAttribute + ':first').hide(); }
      var tOffset = parseInt(opts.topOffset, 10), lOffset = parseInt(opts.leftOffset, 10);
      // vertical measurement variables
      var tipHeight, wHeight;
      var defHeight = isNaN(parseInt(opts.height, 10)) ? 'auto' : (/\D/g).test(opts.height) ? opts.height : opts.height + 'px';
      var sTop, linkTop, posY, tipY, mouseY, baseline;
      // horizontal measurement variables
      var tipInnerWidth = isNaN(parseInt(opts.width, 10)) ? 275 : parseInt(opts.width, 10);
 

      var tipWidth = tipInnerWidth + (parseInt($cluetip.css('paddingLeft'))||0) + (parseInt($cluetip.css('paddingRight'))||0) + dropShadowSteps;
      var linkWidth = this.offsetWidth;
      var linkLeft, posX, tipX, mouseX, winWidth;
            
      // parse the title
      var tipParts;
      var tipTitle = (opts.attribute != 'title') ? $this.attr(opts.titleAttribute) : '';
      if (opts.splitTitle) {
        if(tipTitle == undefined) {tipTitle = '';}
        tipParts = tipTitle.split(opts.splitTitle);
        tipTitle = tipParts.shift();
      }
      var localContent;
      

/***************************************      
* ACTIVATION
****************************************/
    
//activate clueTip
    var activate = function(event) {
      if (!opts.onActivate($this)) {
        return false;
      }
      isActive = true;
      $cluetip.removeClass().css({width: tipInnerWidth});
      if (tipAttribute == $this.attr('href')) {
        $this.css('cursor', opts.cursor);
      }
      $this.attr('title','');
      if (opts.hoverClass) {
        $this.addClass(opts.hoverClass);
      }
      linkTop = posY = $this.offset().top;
      linkLeft = $this.offset().left;
      mouseX = event.pageX;
      mouseY = event.pageY;
      if ($this[0].tagName.toLowerCase() != 'area') {
        sTop = $(document).scrollTop();
        winWidth = $(window).width();
      }
// position clueTip horizontally
      if (opts.positionBy == 'fixed') {
        posX = linkWidth + linkLeft + lOffset;
        $cluetip.css({left: posX});
      } else {
        posX = (linkWidth > linkLeft && linkLeft > tipWidth)
          || linkLeft + linkWidth + tipWidth + lOffset > winWidth 
          ? linkLeft - tipWidth - lOffset 
          : linkWidth + linkLeft + lOffset;
        if ($this[0].tagName.toLowerCase() == 'area' || opts.positionBy == 'mouse' || linkWidth + tipWidth > winWidth) { // position by mouse
          if (mouseX + 20 + tipWidth > winWidth) {  
            $cluetip.addClass(' cluetip-' + ctClass);
            posX = (mouseX - tipWidth - lOffset) >= 0 ? mouseX - tipWidth - lOffset - parseInt($cluetip.css('marginLeft'),10) + parseInt($cluetipInner.css('marginRight'),10) :  mouseX - (tipWidth/2);
          } else {
            posX = mouseX + lOffset;
          }
        }
        var pY = posX < 0 ? event.pageY + tOffset : event.pageY;
        $cluetip.css({left: (posX > 0 && opts.positionBy != 'bottomTop') ? posX : (mouseX + (tipWidth/2) > winWidth) ? winWidth/2 - tipWidth/2 : Math.max(mouseX - (tipWidth/2),0)});
      }
        wHeight = $(window).height();

/***************************************
* load the title attribute only (or user-selected attribute). 
* clueTip title is the string before the first delimiter
* subsequent delimiters place clueTip body text on separate lines
***************************************/
      if (tipParts) {
        var tpl = tipParts.length;
        for (var i=0; i < tpl; i++){
          if (i == 0) {
            $cluetipInner.html(tipParts[i]);
          } else { 
            $cluetipInner.append('<div class="split-body">' + tipParts[i] + '</div>');
          }            
        };
        cluetipShow(pY);
      }
/***************************************
* load external file via ajax          
***************************************/
      else if (!opts.local && tipAttribute.indexOf('#') != 0) {
        if (cluetipContents && opts.ajaxCache) {
          $cluetipInner.html(cluetipContents);
          cluetipShow(pY);
        }
        else {
          var ajaxSettings = opts.ajaxSettings;
          ajaxSettings.url = tipAttribute;
          ajaxSettings.beforeSend = function() {
            $cluetipOuter.children().empty();
            if (opts.waitImage) {
              $('#cluetip-waitimage')
              .css({top: mouseY+20, left: mouseX+20})
              .show();
            }
          };
         ajaxSettings.error = function() {
            if (isActive) {
              $cluetipInner.html('<i>sorry, the contents could not be loaded</i>');
            }
          };
          ajaxSettings.success = function(data) {
            cluetipContents = opts.ajaxProcess(data);
            if (isActive) {
              $cluetipInner.html(cluetipContents);
            }
          };
          ajaxSettings.complete = function() {
          	imgCount = $('#cluetip-inner img').length;
        		if (imgCount) {
        		  $('#cluetip-inner img').load( function(){
          			imgCount--;
          			if (imgCount<1) {
          				$('#cluetip-waitimage').hide();
          			  if (isActive) cluetipShow(pY);
          			}
        		  }); 
        		} else {
      				$('#cluetip-waitimage').hide();
        		  if (isActive) cluetipShow(pY);    
        		} 
          };
          $.ajax(ajaxSettings);
        }

/***************************************
* load an element from the same page
***************************************/
      } else if (opts.local){
        var $localContent = $(tipAttribute + ':first');
        var localCluetip = $.fn.wrapInner ? $localContent.wrapInner('<div></div>').children().clone(true) : $localContent.html();
        $.fn.wrapInner ? $cluetipInner.empty().append(localCluetip) : $cluetipInner.html(localCluetip);
        cluetipShow(pY);
      }
    };

// get dimensions and options for cluetip and prepare it to be shown
    var cluetipShow = function(bpY) {
      $cluetip.addClass('cluetip-' + ctClass);
      
      if (opts.truncate) { 
        var $truncloaded = $cluetipInner.text().slice(0,opts.truncate) + '...';
        $cluetipInner.html($truncloaded);
      }
      function doNothing() {}; //empty function
      tipTitle ? $cluetipTitle.show().html(tipTitle) : (opts.showTitle) ? $cluetipTitle.show().html('&nbsp;') : $cluetipTitle.hide();
      if (opts.sticky) {
        var $closeLink = $('<div id="cluetip-close"><a href="#">' + opts.closeText + '</a></div>');
        (opts.closePosition == 'bottom') ? $closeLink.appendTo($cluetipInner) : (opts.closePosition == 'title') ? $closeLink.prependTo($cluetipTitle) : $closeLink.prependTo($cluetipInner);
        $closeLink.click(function() {
          cluetipClose();
          return false;
        });
        if (opts.mouseOutClose) {
          if ($.fn.hoverIntent && opts.hoverIntent) { 
            $cluetip.hoverIntent({
              over: doNothing, 
              timeout: opts.hoverIntent.timeout,  
              out: function() { $closeLink.trigger('click'); }
            });
          } else {
            $cluetip.hover(doNothing, 
            function() {$closeLink.trigger('click'); });
          }
        } else {
          $cluetip.unbind('mouseout');
        }
      }
// now that content is loaded, finish the positioning 
      var direction = '';
      $cluetipOuter.css({overflow: defHeight == 'auto' ? 'visible' : 'auto', height: defHeight});
      tipHeight = defHeight == 'auto' ? $cluetip.outerHeight() : parseInt(defHeight,10);   
      tipY = posY;
      baseline = sTop + wHeight;
      if (opts.positionBy == 'fixed') {
        tipY = posY - opts.dropShadowSteps + tOffset;
      } else if ( (posX < mouseX && Math.max(posX, 0) + tipWidth > mouseX) || opts.positionBy == 'bottomTop') {
        if (posY + tipHeight + tOffset > baseline && mouseY - sTop > tipHeight + tOffset) { 
          tipY = mouseY - tipHeight - tOffset;
          direction = 'top';
        } else { 
          tipY = mouseY + tOffset;
          direction = 'bottom';
        }
      } else if ( posY + tipHeight + tOffset > baseline ) {
        tipY = (tipHeight >= wHeight) ? sTop : baseline - tipHeight - tOffset;
      } else if ($this.css('display') == 'block' || $this[0].tagName.toLowerCase() == 'area' || opts.positionBy == "mouse") {
        tipY = bpY - tOffset;
      } else {
        tipY = posY - opts.dropShadowSteps;
      }
      if (direction == '') {
        posX < linkLeft ? direction = 'left' : direction = 'right';
      }
      $cluetip.css({top: tipY + 'px'}).removeClass().addClass('clue-' + direction + '-' + ctClass).addClass(' cluetip-' + ctClass);
      if (opts.arrows) { // set up arrow positioning to align with element
        var bgY = (posY - tipY - opts.dropShadowSteps);
        $cluetipArrows.css({top: (/(left|right)/.test(direction) && posX >=0 && bgY > 0) ? bgY + 'px' : /(left|right)/.test(direction) ? 0 : ''}).show();
      } else {
        $cluetipArrows.hide();
      }

// (first hide, then) ***SHOW THE CLUETIP***
      $dropShadow.hide();
      $cluetip.hide()[opts.fx.open](opts.fx.open != 'show' && opts.fx.openSpeed);
      if (opts.dropShadow) $dropShadow.css({height: tipHeight, width: tipInnerWidth}).show();
      if ($.fn.bgiframe) { $cluetip.bgiframe(); }
      // trigger the optional onShow function
      if (opts.delayedClose > 0) {
        closeOnDelay = setTimeout(cluetipClose, opts.delayedClose);
      }

      opts.onShow($cluetip, $cluetipInner);
      
    };

/***************************************
   =INACTIVATION
-------------------------------------- */
    var inactivate = function() {
      isActive = false;
      $('#cluetip-waitimage').hide();
      if (!opts.sticky || (/click|toggle/).test(opts.activation) ) {
        cluetipClose();
clearTimeout(closeOnDelay);        
      };
      if (opts.hoverClass) {
        $this.removeClass(opts.hoverClass);
      }
      $('.cluetip-clicked').removeClass('cluetip-clicked');
    };
// close cluetip and reset some things
    var cluetipClose = function() {
      $cluetipOuter 
      .parent().hide().removeClass().end()
      .children().empty();
      if (tipTitle) {
        $this.attr('title', tipTitle);
      }
      $this.css('cursor','');
      if (opts.arrows) $cluetipArrows.css({top: ''});
    };

/***************************************
   =BIND EVENTS
-------------------------------------- */
  // activate by click
      if ( (/click|toggle/).test(opts.activation) ) {
        $this.click(function(event) {
          if ($cluetip.is(':hidden') || !$this.is('.cluetip-clicked')) {
            activate(event);
            $('.cluetip-clicked').removeClass('cluetip-clicked');
            $this.addClass('cluetip-clicked');

          } else {
            inactivate(event);

          }
          this.blur();
          return false;
        });
  // activate by focus; inactivate by blur    
      } else if (opts.activation == 'focus') {
        $this.focus(function(event) {
          activate(event);
        });
        $this.blur(function(event) {
          inactivate(event);
        });
  // activate by hover
    // clicking is returned false if cluetip url is same as href url
      } else {
        $this.click(function() {
          if ($this.attr('href') && $this.attr('href') == tipAttribute && !opts.clickThrough) {
            return false;
          }
        });
        //set up mouse tracking
        var mouseTracks = function(evt) {
          if (opts.tracking == true) {
            var trackX = posX - evt.pageX;
            var trackY = tipY ? tipY - evt.pageY : posY - evt.pageY;
            $this.mousemove(function(evt) {
              $cluetip.css({left: evt.pageX + trackX, top: evt.pageY + trackY });
            });
          }
        };
        if ($.fn.hoverIntent && opts.hoverIntent) {
          $this.mouseover(function() {$this.attr('title',''); })
          .hoverIntent({
            sensitivity: opts.hoverIntent.sensitivity,
            interval: opts.hoverIntent.interval,  
            over: function(event) {
              activate(event);
              mouseTracks(event);
            }, 
            timeout: opts.hoverIntent.timeout,  
            out: function(event) {inactivate(event); $this.unbind('mousemove');}
          });           
        } else {
          $this.hover(function(event) {
            activate(event);
            mouseTracks(event);
          }, function(event) {
            inactivate(event);
            $this.unbind('mousemove');
          });
        }
      }
    });
  };
  
/*
 * options for clueTip
 *
 * each one can be explicitly overridden by changing its value. 
 * for example: $.fn.cluetip.defaults.width = 200; 
 * would change the default width for all clueTips to 200. 
 *
 * each one can also be overridden by passing an options map to the cluetip method.
 * for example: $('a.example').cluetip({width: 200}); 
 * would change the default width to 200 for clueTips invoked by a link with class of "example"
 *
 */
  
  $.fn.cluetip.defaults = {  // set up default options
    width:            275,      // The width of the clueTip
    height:           'auto',   // The height of the clueTip
    cluezIndex:       97,       // Sets the z-index style property of the clueTip
    positionBy:       'auto',   // Sets the type of positioning: 'auto', 'mouse','bottomTop', 'fixed'
    topOffset:        15,       // Number of px to offset clueTip from top of invoking element
    leftOffset:       15,       // Number of px to offset clueTip from left of invoking element
    local:            false,    // Whether to use content from the same page for the clueTip's body
    hideLocal:        true,     // If local option is set to true, this determines whether local content
                                // to be shown in clueTip should be hidden at its original location
    attribute:        'rel',    // the attribute to be used for fetching the clueTip's body content
    titleAttribute:   'title',  // the attribute to be used for fetching the clueTip's title
    splitTitle:       '',       // A character used to split the title attribute into the clueTip title and divs
                                // within the clueTip body. more info below [6]
    showTitle:        true,     // show title bar of the clueTip, even if title attribute not set
    cluetipClass:     'default',// class added to outermost clueTip div in the form of 'cluetip-' + clueTipClass.
    hoverClass:       '',       // class applied to the invoking element onmouseover and removed onmouseout
    waitImage:        true,     // whether to show a "loading" img, which is set in jquery.cluetip.css
    cursor:           'help',
    arrows:           false,    // if true, displays arrow on appropriate side of clueTip
    dropShadow:       true,     // set to false if you don't want the drop-shadow effect on the clueTip
    dropShadowSteps:  6,        // adjusts the size of the drop shadow
    sticky:           false,    // keep visible until manually closed
    mouseOutClose:    false,    // close when clueTip is moused out
    activation:       'hover',  // set to 'click' to force user to click to show clueTip
                                // set to 'focus' to show on focus of a form element and hide on blur
    clickThrough:     false,    // if true, and activation is not 'click', then clicking on link will take user to the link's href,
                                // even if href and tipAttribute are equal
    tracking:         false,    // if true, clueTip will track mouse movement (experimental)
    delayedClose:     0,        // close clueTip on a timed delay (experimental)
    closePosition:    'top',    // location of close text for sticky cluetips; can be 'top' or 'bottom' or 'title'
    closeText:        'Close',  // text (or HTML) to to be clicked to close sticky clueTips
    truncate:         0,        // number of characters to truncate clueTip's contents. if 0, no truncation occurs

    // effect and speed for opening clueTips
    fx: {             
                      open:       'show', // can be 'show' or 'slideDown' or 'fadeIn'
                      openSpeed:  ''
    },     

    // settings for when hoverIntent plugin is used             
    hoverIntent: {    
                      sensitivity:  3,
              			  interval:     50,
              			  timeout:      0
    },

    // function to run just before clueTip is shown.           
    onActivate:       function(e) {return true;},

    // function to run just after clueTip is shown.
    onShow:           function(ct, c){},
    
    // whether to cache results of ajax request to avoid unnecessary hits to server    
    ajaxCache:        true,  

    // process data retrieved via xhr before it's displayed
    ajaxProcess:      function(data) {
                        data = data.replace(/<s(cript|tyle)(.|\s)*?\/s(cript|tyle)>/g, '').replace(/<(link|title)(.|\s)*?\/(link|title)>/g,'');
                        return data;
    },                

    // can pass in standard $.ajax() parameters, not including error, complete, success, and url
    ajaxSettings: {   
                      dataType: 'html'
    }
  };


/*
 * Global defaults for clueTips. Apply to all calls to the clueTip plugin.
 *
 * @example $.cluetip.setup({
 *   insertionType: 'prependTo',
 *   insertionElement: '#container'
 * });
 * 
 * @property
 * @name $.cluetip.setup
 * @type Map
 * @cat Plugins/tooltip
 * @option String insertionType: Default is 'appendTo'. Determines the method to be used for inserting the clueTip into the DOM. Permitted values are 'appendTo', 'prependTo', 'insertBefore', and 'insertAfter'
 * @option String insertionElement: Default is 'body'. Determines which element in the DOM the plugin will reference when inserting the clueTip.
 *
 */
   
  var insertionType = 'appendTo', insertionElement = 'body';
  $.cluetip = {};
  $.cluetip.setup = function(options) {
    if (options && options.insertionType && (options.insertionType).match(/appendTo|prependTo|insertBefore|insertAfter/)) {
      insertionType = options.insertionType;
    }
    if (options && options.insertionElement) {
      insertionElement = options.insertionElement;
    }
  };
  
})(jQuery);
;
/* AGGREGATED JS FILE: sites/all/modules/cluetip/miadella_cluetip.js */

/* the next line is an example of how you can override default options globally (currently commented out) ... */
 // $.fn.cluetip.defaults.tracking = true;

$(document).ready(function() {

 // $.cluetip.setup({insertionType: 'insertBefore', insertionElement: 'div:first'});
 
$('a.title-scroll').cluetip({
cluetipClass: 'jtip', arrows: true, 
  dropShadow: false, 
  height: '150px', 
  sticky: true,
  positionBy: 'bottomTop',
  splitTitle: '|'
  })
  $('a.legaldocs').cluetip({
  		activation:'click',
  		cluetipClass: 'jtip', arrows: true, 
  		dropShadow: false, 
  		height: '350px',
  		width: '450px', 
  		sticky: true,
  		positionBy: 'auto'
	});
	$('a.license_preview').cluetip({
 	activation:'click',
   cluetipClass: 'jtip', 
   arrows: true, 
  dropShadow: true, 
  height: '350px',
  width: '450px', 
  sticky: true,
  positionBy: 'auto',
   hoverClass: 'highlight'
});  

	$('a.photos_preview').cluetip({
 	activation:'click',
   cluetipClass: 'jtip', 
   arrows: true, 
  dropShadow: false, 
  height: '350px',
  width: '450px', 
  sticky: true,
  positionBy: 'auto',
    hoverClass: 'highlight'
});
  
   $('a.whatsthis').cluetip({
		   activation: 'click',
		   cluetipClass: 'jtip', arrows: true, 
		  dropShadow: true, 
		  height: '350px',
		  width: '450px', 
		  sticky: true,
		  positionBy: 'auto',
		   hoverClass: 'highlight'
}); 
    $('a.whatsthis-img').cluetip({
		   activation: 'click',
		   cluetipClass: 'jtip', arrows: true, 
		  dropShadow: true, 
		  height: '350px',
		  width: '450px', 
		  sticky: true,
		  positionBy: 'auto',
		   hoverClass: 'highlight'
}); 
 
 

 $('a.sellerlist').cluetip({
           activation: 'click',
           cluetipClass: 'jtip', arrows: true, 
          dropShadow: true, 
          height: '250px',
          width: '580px', 
          sticky: true,
          positionBy: 'auto',
          hoverClass: 'highlight'
}); 
 
  
});
  





;
/* AGGREGATED JS FILE: sites/all/modules/miadellabuyer/js/miadellabuyer_jquery.js */
/*
 
 */
 /*$('#miadellabuyer-buylicense-form input#edit-submit-btn).click(function()
 {
 alert('heelo');
 }*/
 
 function jsLoadLicenseText(work_id,media_format_id,path)
 {
 //alert(work_id);
 //alert(media_format_id);
 if((work_id==0) || media_format_id==0) return false;
 path=path+'?work_id='+work_id+'&media_format_id='+media_format_id;
 
 $("#edit-submit-btn").attr("disabled","true");
 //document.getElementById('edit-submit-btn').disabled=true;
 
 
 $('div#license_template_text').html( 'Loading license content for selected format ,please wait...<img src="../files/images/wait.gif" alt="alt"/>' ); 
 $('div#license_template_text').load(path);
 
 
 }
 
 function show_selected_work_item(url,title)
 {
 $('#selected_item_image').html('<a target="_blank" class="thickbox" rel="ozmo_selected_image" href="'+ url+'"><img  width="100px"  src="'+url+'" alt="selected image" /></a>');
 $('#selected-item-location').html('<b>URL:</b> <a class="thickbox" rel="ozmo_selected_image"  href="'+url+'">'+miadella_insertspace(url,50)+'</a>');
 $('#selected-item-title').html('<b>Title: </b>'+ title);
 bindThickBox();
 }
 function show_selected_blog_item(item_placeholder,selected_item)
 {
 	 sel_value=selected_item.value;
 	tmp=sel_value.split('|||');
 	strout='<div class="incontent_right"><b>Title: </b>'+tmp[1]+'</div><div class="incontent_right"><b>URL :</b>'+miadella_insertspace(tmp[0],50)+'</b></div><div class="incontent_right">'+tmp[2] +'</div>';
 	item_placeholder.html(strout);
 	
 }
  function show_selected_photo_item(selected_item)
 {
   	sel_value=selected_item.value;
 	tmp=sel_value.split('|||');
 
 $('#selected_item_image').html('<a target="_blank" href="'+ tmp[0] +'"><img  width="100px"  src="'+tmp[3]+'" alt="selected image" /></a>');
 $('#selected-item-location').html('<b>URL:</b> <a href="'+tmp[0]+'">'+miadella_insertspace(tmp[0],50)+'</a>');
 $('#selected-item-title').html('<b>Title: </b>'+ tmp[1]);	
 	
 //$('#selected_item_title').html(tmp[1]);
 //$('#selected_item_image').html('<a target="_blank" href="'+ tmp[0]+'"><img  width="100px"  src="'+tmp[3]+'" alt="selected image" /></a>');	
 		
 }
 
 // ajax call for buyer's screen
function Getnewfeeddata()
{

//if($(document).find("#post_feed").attr('id')=='post_feed')
//{
	if($('#edit-post-search-url').val()=='')
	alert("Please enter valid post url");
	else{
	//$('#edit-post-search-submit').attr("disabled", true);
	$('div#post_feed').html( 'Loading feed ,please wait...<img src="../files/images/wait.gif" alt="alt"/>' ); 
	$('div#post_feed').load($('#edit-post-search-submit').attr('path')+ $('#edit-post-search-url').val());
	//$('#edit-post-search-submit').attr("disabled", false); 
	}
//}
}

$(document).ready(function() {

if($(document).find("#image-radio-selection").attr('id')=='image-radio-selection')
{
$('div#image-radio-selection').html( 'Loading images ,please wait...<img src="../files/images/wait.gif" alt="alt"/>' ); 
$('div#image-radio-selection').load(jQuery('div#image-radio-selection').attr('path'));
}

if($(document).find("#post_feed").attr('id')=='post_feed')
{
//$('#edit-post-search-submit').attr("disabled", true);
$('div#post_feed').html( 'Loading feed ,please wait...<img src="../files/images/wait.gif" alt="alt"/>' ); 
$('div#post_feed').load(jQuery('div#post_feed').attr('path'));
//$('#edit-post-search-submit').attr("disabled", false);
} 
 });
;
/* AGGREGATED JS FILE: sites/all/modules/compact_forms/compact_forms.js */
/* $Id: compact_forms.js,v 1.1 2007/07/29 17:20:58 tomsun Exp $

    Compact Forms jQuery plugin
    Copyright 2007 Tom Sundstršm

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License version 2 as
    published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public
    License along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/


(function($){
  $.fn.compactForm = function(stars, colons) {
    var stars = stars || 0;
    var colons = colons || 0;
    this.each(function(index) {
      $(this).find("label").each(function() {
        var label = $(this);
        var field = $("#" + label.attr("for"));
        if (field.attr("type") != "text" && field.attr("type") != "password") {
          return;
        }

        if($(field).val() != "") {
            $(label).fadeOut(1);
        }

        $(label).parent().addClass("compact-form-wrapper");
        label.addClass("compact-form-label");
        field.addClass("compact-form-field");

        if (stars === 0) {
          $(label).find(".form-required").hide();
        } else if (stars === 2) {
          $(label).find(".form-required").insertAfter(field).prepend("&nbsp;");
        }

        if (colons === 0) {
          var lbl = $(label).html();
          lbl = lbl.replace(/:/," ");
          $(label).html(lbl);
        }

        $(field).focus(function() {
          if($(this).val() === "") {
            $(label).fadeOut("fast");
          }
        });

        $(field).blur(function() {
          if($(this).val() === "") {
            $(label).fadeIn("slow");
          }
        });
      });
    });
  }
})(jQuery);

;
/* AGGREGATED JS FILE: sites/all/modules/jqueryplugins/js/jquery.thickbox.js */
/*
 * Thickbox 3.1 - One Box To Rule Them All.
 * By Cody Lindley (http://www.codylindley.com)
 * Copyright (c) 2007 cody lindley
 * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
*/
		  
var tb_pathToImage = "/files/images/loading_animation.gif";

/*!!!!!!!!!!!!!!!!! edit below this line at your own risk !!!!!!!!!!!!!!!!!!!!!!!*/

//on page load call tb_init
$(document).ready(function(){   
	tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
	imgLoader = new Image();// preload image
	imgLoader.src = tb_pathToImage;
});

//add thickbox to href & area elements that have a class of .thickbox
function tb_init(domChunk){
	$(domChunk).click(function(){
	var t = this.title || this.name || null;
	var a = this.href || this.alt;
	var g = this.rel || false;
	tb_show(t,a,g);
	this.blur();
	return false;
	});
}

function tb_show(caption, url, imageGroup) {//function called when the user clicks on a thickbox link
//if(url.indexOf("?")!==-1)
	try {
		if (typeof document.body.style.maxHeight === "undefined") {//if IE 6
			$("body","html").css({height: "100%", width: "100%"});
			$("html").css("overflow","hidden");
			if (document.getElementById("TB_HideSelect") === null) {//iframe to hide select elements in ie6
				$("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");
				$("#TB_overlay").click(tb_remove);
			}
		}else{//all others
			if(document.getElementById("TB_overlay") === null){
				$("body").append("<div id='TB_overlay'></div><div id='TB_window'>");
				$("#TB_overlay").click(tb_remove);
			}
		}
		
		if(tb_detectMacXFF()){
			$("#TB_overlay").addClass("TB_overlayMacFFBGHack");//use png overlay so hide flash
		}else{
			$("#TB_overlay").addClass("TB_overlayBG");//use background and opacity
		}
		
		if(caption===null){caption="";}
		$("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");//add loader to the page
		$('#TB_load').show();//show loader
		
		var baseURL;
	   if(url.indexOf("?")!==-1){ //ff there is a query string involved
			baseURL = url.substr(0, url.indexOf("?"));
	   }else{ 
	   		baseURL = url;
	   }
	   
	   var urlString = /\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/;
	   var urlType = baseURL.toLowerCase().match(urlString);
	   
		if(imageGroup || urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif' || urlType == '.bmp'){//code to show images
				
			TB_PrevCaption = "";
			TB_PrevURL = "";
			TB_PrevHTML = "";
			TB_NextCaption = "";
			TB_NextURL = "";
			TB_NextHTML = "";
			TB_imageCount = "";
			TB_FoundURL = false;
			if(imageGroup){
				TB_TempArray = $("a[@rel="+imageGroup+"]").get();
				for (TB_Counter = 0; ((TB_Counter < TB_TempArray.length) && (TB_NextHTML === "")); TB_Counter++) {
					var urlTypeTemp = TB_TempArray[TB_Counter].href.toLowerCase().match(urlString);
						if (!(TB_TempArray[TB_Counter].href == url)) {						
							if (TB_FoundURL) {
								TB_NextCaption = TB_TempArray[TB_Counter].title;
								TB_NextURL = TB_TempArray[TB_Counter].href;
								TB_NextHTML = "<span id='TB_next'>&nbsp;&nbsp;<a href='#'>Next &gt;</a></span>";
							} else {
								TB_PrevCaption = TB_TempArray[TB_Counter].title;
								TB_PrevURL = TB_TempArray[TB_Counter].href;
								TB_PrevHTML = "<span id='TB_prev'>&nbsp;&nbsp;<a href='#'>&lt; Prev</a></span>";
							}
						} else {
							TB_FoundURL = true;
							TB_imageCount = "Image " + (TB_Counter + 1) +" of "+ (TB_TempArray.length);											
						}
				}
			}

			imgPreloader = new Image();
			imgPreloader.onload = function(){		
			imgPreloader.onload = null;
				
			// Resizing large images - orginal by Christian Montoya edited by me.
			var pagesize = tb_getPageSize();
			var x = pagesize[0] - 150;
			var y = pagesize[1] - 150;
			var imageWidth = imgPreloader.width;
			var imageHeight = imgPreloader.height;
			if (imageWidth > x) {
				imageHeight = imageHeight * (x / imageWidth); 
				imageWidth = x; 
				if (imageHeight > y) { 
					imageWidth = imageWidth * (y / imageHeight); 
					imageHeight = y; 
				}
			} else if (imageHeight > y) { 
				imageWidth = imageWidth * (y / imageHeight); 
				imageHeight = y; 
				if (imageWidth > x) { 
					imageHeight = imageHeight * (x / imageWidth); 
					imageWidth = x;
				}
			}
			// End Resizing
			
			TB_WIDTH = imageWidth + 60;
			TB_HEIGHT = imageHeight + 120;
			$("#TB_window").append("<a href='' id='TB_ImageOff' title='Close'><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>" + "<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='Close'>close</a> or Esc Key</div>"); 		
			
			$("#TB_closeWindowButton").click(tb_remove);
			
			if (!(TB_PrevHTML === "")) {
				function goPrev(){
					if($(document).unbind("click",goPrev)){$(document).unbind("click",goPrev);}
					$("#TB_window").remove();
					$("body").append("<div id='TB_window'></div>");
					tb_show(TB_PrevCaption, TB_PrevURL, imageGroup);
					return false;	
				}
				$("#TB_prev").click(goPrev);
			}
			
			if (!(TB_NextHTML === "")) {		
				function goNext(){
					$("#TB_window").remove();
					$("body").append("<div id='TB_window'></div>");
					tb_show(TB_NextCaption, TB_NextURL, imageGroup);				
					return false;	
				}
				$("#TB_next").click(goNext);
				}else {
				$("#TB_ImageOff").click(tb_remove);
				
			}

			document.onkeydown = function(e){ 	
				if (e == null) { // ie
					keycode = event.keyCode;
				} else { // mozilla
					keycode = e.which;
				}
				if(keycode == 27){ // close
					tb_remove();
				} else if(keycode == 190){ // display previous image
					if(!(TB_NextHTML == "")){
						document.onkeydown = "";
						goNext();
					}
				} else if(keycode == 188){ // display next image
					if(!(TB_PrevHTML == "")){
						document.onkeydown = "";
						goPrev();
					}
				}	
			};
			
			tb_position();
			$("#TB_load").remove();
	
			$("#TB_window").css({display:"block"}); //for safari using css instead of show
			};
			
			imgPreloader.src = url;
		}else{//code to show html
			
			var queryString = url.replace(/^[^\?]+\??/,'');
			var params = tb_parseQuery( queryString );

			TB_WIDTH = (params['width']*1) + 30 || 630; //defaults to 630 if no paramaters were added to URL
			TB_HEIGHT = (params['height']*1) + 40 || 440; //defaults to 440 if no paramaters were added to URL
			ajaxContentW = TB_WIDTH - 30;
			ajaxContentH = TB_HEIGHT - 45;
	if(url.indexOf('TB_iframe') != -1){// either iframe or ajax window		
					urlNoQuery = url.split('TB_');
					$("#TB_iframeContent").remove();
					if(params['modal'] != "true"){//iframe no modal
						$("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='Close'>close</a> or Esc Key</div></div><iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;' > </iframe>");
					}else{//iframe modal
					$("#TB_overlay").unbind();
						$("#TB_window").append("<iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;'> </iframe>");
					}
			}else{// not an iframe, ajax
					if($("#TB_window").css("display") != "block"){
						if(params['modal'] != "true"){//ajax no modal
						$("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'>close</a> or Esc Key</div></div><div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px'></div>");
						}else{//ajax modal
						$("#TB_overlay").unbind();
						$("#TB_window").append("<div id='TB_ajaxContent' class='TB_modal' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>");	
						}
					}else{//this means the window is already up, we are just loading new content via ajax
						$("#TB_ajaxContent")[0].style.width = ajaxContentW +"px";
						$("#TB_ajaxContent")[0].style.height = ajaxContentH +"px";
						$("#TB_ajaxContent")[0].scrollTop = 0;
						$("#TB_ajaxWindowTitle").html(caption);
					}
			}
					
	$("#TB_closeWindowButton").click(tb_remove);

				if(url.indexOf('TB_inline') != -1){
				$("#TB_ajaxContent").html('');
					$("#TB_ajaxContent").append($('#' + params['inlineId']).html());
					//$("#TB_ajaxContent").append($('#' + params['inlineId']).children()); //if i remove this works popup inline works
					$("#TB_window").unload(function () {
						$('#' + params['inlineId']).append( $("#TB_ajaxContent").children() ); // move elements back when you're finished
					});
					tb_position();
					$("#TB_load").remove();
					$("#TB_window").css({display:"block"});
				}else if(url.indexOf('TB_iframe') != -1){
					tb_position();
					if($.browser.safari){//be nice to safari
						$("#TB_load").remove();
						$("#TB_window").css({display:"block"});
						$(document).keyup( function(e){ var key = e.keyCode; if(key == 27){tb_remove();}});
					}
				}else{
					$("#TB_ajaxContent").load(url += "&random=" + (new Date().getTime()),function(){//to do a post change this load method
						tb_position();
						$("#TB_load").remove();
						tb_init("#TB_ajaxContent a.thickbox");
						$("#TB_window").css({display:"block"});
					});
				}

		}

		if(!params['modal']){
			document.onkeyup = function(e){ 	
				if (e == null) { // ie
					keycode = event.keyCode;
				} else { // mozilla
					keycode = e.which;
				}
				if(keycode == 27){ // close
					tb_remove();
				}	
			};
		}
		
	} catch(e) {
		//nothing here
	}
}




//helper functions below
function tb_showIframe(){
	$("#TB_load").remove();
	$("#TB_window").css({display:"block"});
}

function tb_remove() {
 	$("#TB_imageOff").unbind("click");
	$("#TB_overlay").unbind("click");
	$("#TB_closeWindowButton").unbind("click");
	$("#TB_window").fadeOut("fast",function(){$('#TB_window,#TB_overlay,#TB_HideSelect').remove();});
	$("#TB_load").remove();
	if (typeof document.body.style.maxHeight == "undefined") {//if IE 6
		$("body","html").css({height: "auto", width: "auto"});
		$("html").css("overflow","");
	}
	document.onkeydown = "";
	return false;
}


	
	
	
function tb_position() {
$("#TB_window").css({marginLeft: '-' + parseInt((TB_WIDTH / 2),10) + 'px', width: TB_WIDTH + 'px'});
	if ( !(jQuery.browser.msie && jQuery.browser.version < 7)) { // take away IE6
		$("#TB_window").css({marginTop: '-' + parseInt((TB_HEIGHT / 2),10) + 'px'});
	}
}

function tb_parseQuery ( query ) {
   var Params = {};
   if ( ! query ) {return Params;}// return empty object
   var Pairs = query.split(/[;&]/);
   for ( var i = 0; i < Pairs.length; i++ ) {
      var KeyVal = Pairs[i].split('=');
      if ( ! KeyVal || KeyVal.length != 2 ) {continue;}
      var key = unescape( KeyVal[0] );
      var val = unescape( KeyVal[1] );
      val = val.replace(/\+/g, ' ');
      Params[key] = val;
   }
   return Params;
}

function tb_getPageSize(){
	var de = document.documentElement;
	var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
	var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
	arrayPageSize = [w,h];
	return arrayPageSize;
}

function tb_detectMacXFF() {
  var userAgent = navigator.userAgent.toLowerCase();
  if (userAgent.indexOf('mac') != -1 && userAgent.indexOf('firefox')!=-1) {
    return true;
  }
}



;
/* AGGREGATED JS FILE: sites/all/modules/jqueryplugins/js/jquery.thumbs.js */
/*
 *
 * Copyright (c) 2006 Sam Collett (http://www.texotela.co.uk)
 * Licensed under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 * 
 */

/*
 * Converts image and link elements to thumbnails
 *
 * @name     jThumb
 * @author   Joan Piedra (http://www.joanpiedra.com)
 * @example  $("a.thumb, img.thumb").thumbs();
 *
 */

 jQuery.fn.ImageDefault = function()
{ 
if($("#work_items_block_image").html()!=null)
{

link_text=$("#link-item-add").text();
 msg='<td  id="work-item-default-msg" style="width:650px;"><div style="width:645px;height:235px;align:center;color: #999999;text-align: center;"><br/><br/><br/>No images selected yet<br><br>Click the "<b>'+link_text+'</b>" link above</div></td>';
		if($("#work_items_block_image").html()==""  || $("#work_items_block_image").html()=="<tbody></tbody>" || $("#work_items_block_image").html()=="<TBODY></TBODY>")  
 			{$("#work_items_block_image").append(msg);
 			$("#work_items_outer_table").addClass("work-items-outer-table");
 			}
 			 else if($("#work_items_block_image").html()!=""){
				$("#work-item-default-msg").remove();
				$("#work_items_outer_table").removeClass("work-items-outer-table");
				}

}
}
 jQuery.fn.TextDefault = function()
{
 
if($("#work_items_block").html()!=null)
{
link_text=$("#link-item-add").text();
		msg='<tr id="work-item-default-msg" ><td align="center"  valign="top" style="width:648px;height:240px;align:center;color: #999999;text-align: center;"><br/><br/><br/>No articles added yet<br><br>Click the "<b>'+link_text+'</b>" link above<br></td></tr>';

				if($("#work_items_block").html()=="" || $("#work_items_block").html()=="<tbody></tbody>" || $("#work_items_block").html()=="<TBODY></TBODY>")  
 						{
 						$("#work_items_block").append(msg);
 						$("#work_items_outer_table").addClass("work-items-outer-table");
 						
 						}
 						else if($("#work_items_block").html()!=""){
 						$("#work-item-default-msg").remove();
 						$("#work_items_outer_table").removeClass("work-items-outer-table");
 						}
 }						
 }
 
 
 
 jQuery.fn.popupWindow = function()
{
this.bind("click",function() {
options='height=400,width=500,left=100,top=100,resizable=yes,scrollbars=yes,toolbar=yes,status=yes';
  window.open(this.href,'new',options);
    return false;
 }
 );

}
 
jQuery.fn.jThumb = function()
{
	return this.wrap('<div class="thumb-img"><div class="thumb-inner">' + '</div><div class="thumb-strip"></div><div class="thumb-zoom"></div></div>');
}

jQuery.fn.jThumbID = function(id)
{
	return $(id).wrap('<div class="thumb-img"><div class="thumb-inner">' + '</div><div class="thumb-strip"></div><div class="thumb-zoom"></div></div>');
}

/*
 * Absolute positions the image in the middle of the thumbnail frame
 *
 * @name     jThumbImg
 * @author   Joan Piedra (http://www.joanpiedra.com)
 * @example  $("a.thumb img, img.thumb").thumbsImg();
 *
 */
jQuery.fn.jThumbImg = function()
{
	return this.each(
		function()
		{
			/*jQuery(this).css('position','absolute');
			jQuery(this).left( '-' + ( parseInt( $(this).width() ) / 2 ) + 'px' );
			jQuery(this).top( '-' + ( parseInt( $(this).height() ) / 2 ) + 'px' );
			jQuery(this).css('margin-left', '50%' );
			jQuery(this).css('margin-top', '50%' );*/
		}
	)
}
;
/* AGGREGATED JS FILE: sites/all/modules/jqueryplugins/js/jquery.corner.js */
/*
 * jQuery corner plugin
 *
 * version 1.92 (12/18/2007)
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */

/**
 * The corner() method provides a simple way of styling DOM elements.  
 *
 * corner() takes a single string argument:  $().corner("effect corners width")
 *
 *   effect:  The name of the effect to apply, such as round or bevel. 
 *            If you don't specify an effect, rounding is used.
 *
 *   corners: The corners can be one or more of top, bottom, tr, tl, br, or bl. 
 *            By default, all four corners are adorned. 
 *
 *   width:   The width specifies the width of the effect; in the case of rounded corners this 
 *            will be the radius of the width. 
 *            Specify this value using the px suffix such as 10px, and yes it must be pixels.
 *
 * For more details see: http://methvin.com/jquery/jq-corner.html
 * For a full demo see:  http://malsup.com/jquery/corner/
 *
 *
 * @example $('.adorn').corner();
 * @desc Create round, 10px corners 
 *
 * @example $('.adorn').corner("25px");
 * @desc Create round, 25px corners 
 *
 * @example $('.adorn').corner("notch bottom");
 * @desc Create notched, 10px corners on bottom only
 *
 * @example $('.adorn').corner("tr dog 25px");
 * @desc Create dogeared, 25px corner on the top-right corner only
 *
 * @example $('.adorn').corner("round 8px").parent().css('padding', '4px').corner("round 10px");
 * @desc Create a rounded border effect by styling both the element and its parent
 * 
 * @name corner
 * @type jQuery
 * @param String options Options which control the corner style
 * @cat Plugins/Corner
 * @return jQuery
 * @author Dave Methvin (dave.methvin@gmail.com)
 * @author Mike Alsup (malsup@gmail.com)
 */
(function($) { 

$.fn.corner = function(o) {
    var ie6 = $.browser.msie && /MSIE 6.0/.test(navigator.userAgent);
    function sz(el, p) { return parseInt($.css(el,p))||0; };
    function hex2(s) {
        var s = parseInt(s).toString(16);
        return ( s.length < 2 ) ? '0'+s : s;
    };
    function gpc(node) {
        for ( ; node && node.nodeName.toLowerCase() != 'html'; node = node.parentNode ) {
            var v = $.css(node,'backgroundColor');
            if ( v.indexOf('rgb') >= 0 ) { 
                if ($.browser.safari && v == 'rgba(0, 0, 0, 0)')
                    continue;
                var rgb = v.match(/\d+/g); 
                return '#'+ hex2(rgb[0]) + hex2(rgb[1]) + hex2(rgb[2]);
            }
            if ( v && v != 'transparent' )
                return v;
        }
        return '#ffffff';
    };
    function getW(i) {
        switch(fx) {
        case 'round':  return Math.round(width*(1-Math.cos(Math.asin(i/width))));
        case 'cool':   return Math.round(width*(1+Math.cos(Math.asin(i/width))));
        case 'sharp':  return Math.round(width*(1-Math.cos(Math.acos(i/width))));
        case 'bite':   return Math.round(width*(Math.cos(Math.asin((width-i-1)/width))));
        case 'slide':  return Math.round(width*(Math.atan2(i,width/i)));
        case 'jut':    return Math.round(width*(Math.atan2(width,(width-i-1))));
        case 'curl':   return Math.round(width*(Math.atan(i)));
        case 'tear':   return Math.round(width*(Math.cos(i)));
        case 'wicked': return Math.round(width*(Math.tan(i)));
        case 'long':   return Math.round(width*(Math.sqrt(i)));
        case 'sculpt': return Math.round(width*(Math.log((width-i-1),width)));
        case 'dog':    return (i&1) ? (i+1) : width;
        case 'dog2':   return (i&2) ? (i+1) : width;
        case 'dog3':   return (i&3) ? (i+1) : width;
        case 'fray':   return (i%2)*width;
        case 'notch':  return width; 
        case 'bevel':  return i+1;
        }
    };
    o = (o||"").toLowerCase();
    var keep = /keep/.test(o);                       // keep borders?
    var cc = ((o.match(/cc:(#[0-9a-f]+)/)||[])[1]);  // corner color
    var sc = ((o.match(/sc:(#[0-9a-f]+)/)||[])[1]);  // strip color
    var width = parseInt((o.match(/(\d+)px/)||[])[1]) || 10; // corner width
    var re = /round|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dog/;
    var fx = ((o.match(re)||['round'])[0]);
    var edges = { T:0, B:1 };
    var opts = {
        TL:  /top|tl/.test(o),       TR:  /top|tr/.test(o),
        BL:  /bottom|bl/.test(o),    BR:  /bottom|br/.test(o)
    };
    if ( !opts.TL && !opts.TR && !opts.BL && !opts.BR )
        opts = { TL:1, TR:1, BL:1, BR:1 };
    var strip = document.createElement('div');
    strip.style.overflow = 'hidden';
    strip.style.height = '1px';
    strip.style.backgroundColor = sc || 'transparent';
    strip.style.borderStyle = 'solid';
    return this.each(function(index){
        var pad = {
            T: parseInt($.css(this,'paddingTop'))||0,     R: parseInt($.css(this,'paddingRight'))||0,
            B: parseInt($.css(this,'paddingBottom'))||0,  L: parseInt($.css(this,'paddingLeft'))||0
        };

        if ($.browser.msie) this.style.zoom = 1; // force 'hasLayout' in IE
        if (!keep) this.style.border = 'none';
        strip.style.borderColor = cc || gpc(this.parentNode);
        var cssHeight = $.curCSS(this, 'height');

        for (var j in edges) {
            var bot = edges[j];
            // only add stips if needed
            if ((bot && (opts.BL || opts.BR)) || (!bot && (opts.TL || opts.TR))) {
                strip.style.borderStyle = 'none '+(opts[j+'R']?'solid':'none')+' none '+(opts[j+'L']?'solid':'none');
                var d = document.createElement('div');
                $(d).addClass('jquery-corner');
                var ds = d.style;

                bot ? this.appendChild(d) : this.insertBefore(d, this.firstChild);

                if (bot && cssHeight != 'auto') {
                    if ($.css(this,'position') == 'static')
                        this.style.position = 'relative';
                    ds.position = 'absolute';
                    ds.bottom = ds.left = ds.padding = ds.margin = '0';
                    if ($.browser.msie)
                        ds.setExpression('width', 'this.parentNode.offsetWidth');
                    else
                        ds.width = '100%';
                }
                else if (!bot && $.browser.msie) {
                    if ($.css(this,'position') == 'static')
                        this.style.position = 'relative';
                    ds.position = 'absolute';
                    ds.top = ds.left = ds.right = ds.padding = ds.margin = '0';
                    
                    // fix ie6 problem when blocked element has a border width
                    var bw = 0;
                    if (ie6 || !$.boxModel)
                        bw = sz(this,'borderLeftWidth') + sz(this,'borderRightWidth');
                    ie6 ? ds.setExpression('width', 'this.parentNode.offsetWidth - '+bw+'+ "px"') : ds.width = '100%';
                }
                else {
                    ds.margin = !bot ? '-'+pad.T+'px -'+pad.R+'px '+(pad.T-width)+'px -'+pad.L+'px' : 
                                        (pad.B-width)+'px -'+pad.R+'px -'+pad.B+'px -'+pad.L+'px';                
                }

                for (var i=0; i < width; i++) {
                    var w = Math.max(0,getW(i));
                    var e = strip.cloneNode(false);
                    e.style.borderWidth = '0 '+(opts[j+'R']?w:0)+'px 0 '+(opts[j+'L']?w:0)+'px';
                    bot ? d.appendChild(e) : d.insertBefore(e, d.firstChild);
                }
            }
        }
    });
};

$.fn.uncorner = function(o) { return $('.jquery-corner', this).remove(); };
    
})(jQuery);

;
/* AGGREGATED JS FILE: sites/all/modules/jqueryplugins/js/jquery.maskedinput.js */
/*
 * Copyright (c) 2007 Josh Bush (digitalbush.com)
 * 
 * Permission is hereby granted, free of charge, to any person
 * obtaining a copy of this software and associated documentation
 * files (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use,
 * copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following
 * conditions:
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE. 
 */
 
/*
 * Version: 1.1.2
 * Release: 2007-11-29
 */ 
(function($) {

	//Helper Function for Caret positioning
	$.fn.caret=function(begin,end){	
		if(this.length==0) return;
		if (typeof begin == 'number') {
            end = (typeof end == 'number')?end:begin;  
			return this.each(function(){
				if(this.setSelectionRange){
					this.focus();
					this.setSelectionRange(begin,end);
				}else if (this.createTextRange){
					var range = this.createTextRange();
					range.collapse(true);
					range.moveEnd('character', end);
					range.moveStart('character', begin);
					range.select();
				}
			});
        } else {
            if (this[0].setSelectionRange){
				begin = this[0].selectionStart;
				end = this[0].selectionEnd;
			}else if (document.selection && document.selection.createRange){
				var range = document.selection.createRange();			
				begin = 0 - range.duplicate().moveStart('character', -100000);
				end = begin + range.text.length;
			}
			return {begin:begin,end:end};
        }       
	};

	//Predefined character definitions
	var charMap={
		'9':"[0-9]",
		'a':"[A-Za-z]",
		'*':"[A-Za-z0-9]"
	};
	
	//Helper method to inject character definitions
	$.mask={
		addPlaceholder : function(c,r){
			charMap[c]=r;
		}
	};
	
	$.fn.unmask=function(){
		return this.trigger("unmask");
	};
	
	//Main Method
	$.fn.mask = function(mask,settings) {	
		settings = $.extend({
			placeholder: "_",			
			completed: null
		}, settings);		
		
		//Build Regex for format validation
		var re = new RegExp("^"+	
		$.map( mask.split(""), function(c,i){		  		  
		  return charMap[c]||((/[A-Za-z0-9]/.test(c)?"":"\\")+c);
		}).join('')+				
		"$");		

		return this.each(function(){		
			var input=$(this);
			var buffer=new Array(mask.length);
			var locked=new Array(mask.length);
			var valid=false;   
			var ignore=false;  			//Variable for ignoring control keys
			var firstNonMaskPos=null; 
			
			//Build buffer layout from mask & determine the first non masked character			
			$.each( mask.split(""), function(i,c){				
				locked[i]=(charMap[c]==null);				
				buffer[i]=locked[i]?c:settings.placeholder;									
				if(!locked[i] && firstNonMaskPos==null)
					firstNonMaskPos=i;
			});		
			
			function focusEvent(){					
				checkVal();
				writeBuffer();
				setTimeout(function(){
					$(input[0]).caret(valid?mask.length:firstNonMaskPos);					
				},0);
			};
			
			function keydownEvent(e){				
				var pos=$(this).caret();
				var k = e.keyCode;
				ignore=(k < 16 || (k > 16 && k < 32 ) || (k > 32 && k < 41));
				
				//delete selection before proceeding
				if((pos.begin-pos.end)!=0 && (!ignore || k==8 || k==46)){
					clearBuffer(pos.begin,pos.end);
				}	
				//backspace and delete get special treatment
				if(k==8){//backspace					
					while(pos.begin-->=0){
						if(!locked[pos.begin]){								
							buffer[pos.begin]=settings.placeholder;
							if($.browser.opera){
								//Opera won't let you cancel the backspace, so we'll let it backspace over a dummy character.								
								s=writeBuffer();
								input.val(s.substring(0,pos.begin)+" "+s.substring(pos.begin));
								$(this).caret(pos.begin+1);								
							}else{
								writeBuffer();
								$(this).caret(Math.max(firstNonMaskPos,pos.begin));								
							}									
							return false;								
						}
					}						
				}else if(k==46){//delete
					clearBuffer(pos.begin,pos.begin+1);
					writeBuffer();
					$(this).caret(Math.max(firstNonMaskPos,pos.begin));					
					return false;
				}else if (k==27){//escape
					clearBuffer(0,mask.length);
					writeBuffer();
					$(this).caret(firstNonMaskPos);					
					return false;
				}									
			};
			
			function keypressEvent(e){					
				if(ignore){
					ignore=false;
					//Fixes Mac FF bug on backspace
					return (e.keyCode == 8)? false: null;
				}
				e=e||window.event;
				var k=e.charCode||e.keyCode||e.which;						
				var pos=$(this).caret();
								
				if(e.ctrlKey || e.altKey){//Ignore
					return true;
				}else if ((k>=41 && k<=122) ||k==32 || k>186){//typeable characters
					var p=seekNext(pos.begin-1);					
					if(p<mask.length){
						if(new RegExp(charMap[mask.charAt(p)]).test(String.fromCharCode(k))){
							buffer[p]=String.fromCharCode(k);									
							writeBuffer();
							var next=seekNext(p);
							$(this).caret(next);
							if(settings.completed && next == mask.length)
								settings.completed.call(input);
						}				
					}
				}				
				return false;				
			};
			
			function clearBuffer(start,end){
				for(var i=start;i<end&&i<mask.length;i++){
					if(!locked[i])
						buffer[i]=settings.placeholder;
				}				
			};
			
			function writeBuffer(){				
				return input.val(buffer.join('')).val();				
			};
			
			function checkVal(){	
				//try to place charcters where they belong
				var test=input.val();
				var pos=0;
				for(var i=0;i<mask.length;i++){
					if(!locked[i]){
						while(pos++<test.length){
							//Regex Test each char here.
							var reChar=new RegExp(charMap[mask.charAt(i)]);
							if(test.charAt(pos-1).match(reChar)){
								buffer[i]=test.charAt(pos-1);
								break;
							}									
						}
					}
				}
				var s=writeBuffer();
				if(!s.match(re)){							
					input.val("");	
					clearBuffer(0,mask.length);
					valid=false;
				}else
					valid=true;
			};
			
			function seekNext(pos){				
				while(++pos<mask.length){					
					if(!locked[pos])
						return pos;
				}
				return mask.length;
			};
			
			input.one("unmask",function(){
				//input.unbind("focus",focusEvent);
				//input.unbind("blur",checkVal);
				input.unbind("keydown",keydownEvent);
				input.unbind("keypress",keypressEvent);
				if ($.browser.msie) 
					this.onpaste= null;                     
				else if ($.browser.mozilla)
					this.removeEventListener('input',checkVal,false);
			});
			//input.bind("focus",focusEvent);
			//input.bind("blur",checkVal);
			input.bind("keydown",keydownEvent);
			input.bind("keypress",keypressEvent);
			//Paste events for IE and Mozilla thanks to Kristinn Sigmundsson
			if ($.browser.msie) 
				this.onpaste= function(){setTimeout(checkVal,0);};                     
			else if ($.browser.mozilla)
				this.addEventListener('input',checkVal,false);
				
			checkVal();//Perform initial check for existing values
		});
	};
})(jQuery);
;
/* AGGREGATED JS FILE: sites/all/modules/jqueryplugins/js/jquery.blockUI.js */
/*
 * jQuery blockUI plugin
 * Version 2.10 (10/22/2008)
 * @requires jQuery v1.2.3 or later
 *
 * Examples at: http://malsup.com/jquery/block/
 * Copyright (c) 2007-2008 M. Alsup
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 * 
 * Thanks to Amir-Hossein Sobhi for some excellent contributions!
 */

;(function($) {

if (/1\.(0|1|2)\.(0|1|2)/.test($.fn.jquery) || /^1.1/.test($.fn.jquery)) {
    alert('blockUI requires jQuery v1.2.3 or later!  You are using v' + $.fn.jquery);
    return;
}

// global $ methods for blocking/unblocking the entire page
$.blockUI   = function(opts) { install(window, opts); };
$.unblockUI = function(opts) { remove(window, opts); };

// plugin method for blocking element content
$.fn.block = function(opts) {
    return this.each(function() {
        if ($.css(this,'position') == 'static')
            this.style.position = 'relative';
        if ($.browser.msie) 
            this.style.zoom = 1; // force 'hasLayout'
        install(this, opts);
    });
};

// plugin method for unblocking element content
$.fn.unblock = function(opts) {
    return this.each(function() {
        remove(this, opts);
    });
};

$.blockUI.version = 2.09; // 2nd generation blocking at no extra cost!

// override these in your code to change the default behavior and style
$.blockUI.defaults = {
    // message displayed when blocking (use null for no message)
    message:  '<h1>Please wait...</h1>',
    
    // styles for the message when blocking; if you wish to disable
    // these and use an external stylesheet then do this in your code:
    // $.blockUI.defaults.css = {};
    css: { 
        padding:        0,
        margin:         0,
        width:          '30%', 
        top:            '40%', 
        left:           '35%', 
        textAlign:      'center', 
        color:          '#000', 
        border:         '3px solid #aaa',
        backgroundColor:'#fff',
        cursor:         'wait'
    },
    
    // styles for the overlay
    overlayCSS:  { 
        backgroundColor:'#000', 
        opacity:        '0.6' 
    },
    
    // z-index for the blocking overlay
    baseZ: 1000,
    
    // set these to true to have the message automatically centered
    centerX: true, // <-- only effects element blocking (page block controlled via css above)
    centerY: true,
    
    // allow body element to be stetched in ie6; this makes blocking look better
    // on "short" pages.  disable if you wish to prevent changes to the body height
    allowBodyStretch: true,
    
    // be default blockUI will supress tab navigation from leaving blocking content;
    constrainTabKey: true,
    
    // fadeOut time in millis; set to 0 to disable fadeout on unblock
    fadeOut:  400,
    
    // if true, focus will be placed in the first available input field when
    // page blocking
    focusInput: true,
    
    // suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity)
    applyPlatformOpacityRules: true,
    
    // callback method invoked when unblocking has completed; the callback is
    // passed the element that has been unblocked (which is the window object for page
    // blocks) and the options that were passed to the unblock call:
    //     onUnblock(element, options)
    onUnblock: null,
    
    // don't ask (if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493)
    quirksmodeOffsetHack: 4
};

// private data and functions follow...

var ie6 = $.browser.msie && /MSIE 6.0/.test(navigator.userAgent);
var pageBlock = null;
var pageBlockEls = [];

function install(el, opts) {
    var full = (el == window);
    var msg = opts && opts.message !== undefined ? opts.message : undefined;
    opts = $.extend({}, $.blockUI.defaults, opts || {});
    opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {});
    var css = $.extend({}, $.blockUI.defaults.css, opts.css || {});
    msg = msg === undefined ? opts.message : msg;

    // remove the current block (if there is one)
    if (full && pageBlock) 
        remove(window, {fadeOut:0}); 
    
    // if an existing element is being used as the blocking content then we capture
    // its current place in the DOM (and current display style) so we can restore
    // it when we unblock
    if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) {
        var node = msg.jquery ? msg[0] : msg;
        var data = {};
        $(el).data('blockUI.history', data);
        data.el = node;
        data.parent = node.parentNode;
        data.display = node.style.display;
        data.position = node.style.position;
        data.parent.removeChild(node);
    }
    
    var z = opts.baseZ;
    
    // blockUI uses 3 layers for blocking, for simplicity they are all used on every platform;
    // layer1 is the iframe layer which is used to supress bleed through of underlying content
    // layer2 is the overlay layer which has opacity and a wait cursor
    // layer3 is the message content that is displayed while blocking
    
    var lyr1 = ($.browser.msie) ? $('<iframe class="blockUI" style="z-index:'+ z++ +';border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="javascript:false;"></iframe>')
                                : $('<div class="blockUI" style="display:none"></div>');
    var lyr2 = $('<div class="blockUI blockOverlay" style="z-index:'+ z++ +';cursor:wait;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');
    var lyr3 = full ? $('<div class="blockUI blockMsg blockPage" style="z-index:'+z+';position:fixed"></div>')
                    : $('<div class="blockUI blockMsg blockElement" style="z-index:'+z+';display:none;position:absolute"></div>');

    // if we have a message, style it
    if (msg) 
        lyr3.css(css);

    // style the overlay
    if (!opts.applyPlatformOpacityRules || !($.browser.mozilla && /Linux/.test(navigator.platform))) 
        lyr2.css(opts.overlayCSS);
    lyr2.css('position', full ? 'fixed' : 'absolute');
    
    // make iframe layer transparent in IE
    if ($.browser.msie) 
        lyr1.css('opacity','0.0');

    $([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el);
    
    // ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling)
    var expr = $.browser.msie && (!$.boxModel || $('object,embed', full ? null : el).length > 0);
    if (ie6 || expr) {
        // give body 100% height
        if (full && opts.allowBodyStretch && $.boxModel)
            $('html,body').css('height','100%');

        // fix ie6 issue when blocked element has a border width
        if ((ie6 || !$.boxModel) && !full) {
            var t = sz(el,'borderTopWidth'), l = sz(el,'borderLeftWidth');
            var fixT = t ? '(0 - '+t+')' : 0;
            var fixL = l ? '(0 - '+l+')' : 0;
        }

        // simulate fixed position
        $.each([lyr1,lyr2,lyr3], function(i,o) {
            var s = o[0].style;
            s.position = 'absolute';
            if (i < 2) {
                full ? s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"')
                     : s.setExpression('height','this.parentNode.offsetHeight + "px"');
                full ? s.setExpression('width','jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"')
                     : s.setExpression('width','this.parentNode.offsetWidth + "px"');
                if (fixL) s.setExpression('left', fixL);
                if (fixT) s.setExpression('top', fixT);
            }
            else if (opts.centerY) {
                if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');
                s.marginTop = 0;
            }
        });
    }
    
    // show the message
    lyr3.append(msg).show();
    if (msg && (msg.jquery || msg.nodeType))
        $(msg).show();

    // bind key and mouse events
    bind(1, el, opts);
        
    if (full) {
        pageBlock = lyr3[0];
        pageBlockEls = $(':input:enabled:visible',pageBlock);
        if (opts.focusInput)
            setTimeout(focus, 20);
    }
    else
        center(lyr3[0], opts.centerX, opts.centerY);
};

// remove the block
function remove(el, opts) {
    var full = el == window;
    var data = $(el).data('blockUI.history');
    opts = $.extend({}, $.blockUI.defaults, opts || {});
    bind(0, el, opts); // unbind events
    var els = full ? $('body').children().filter('.blockUI') : $('.blockUI', el);
    
    if (full) 
        pageBlock = pageBlockEls = null;

    if (opts.fadeOut) {
        els.fadeOut(opts.fadeOut);
        setTimeout(function() { reset(els,data,opts,el); }, opts.fadeOut);
    }
    else
        reset(els, data, opts, el);
};

// move blocking element back into the DOM where it started
function reset(els,data,opts,el) {
    els.each(function(i,o) {
        // remove via DOM calls so we don't lose event handlers
        if (this.parentNode) 
            this.parentNode.removeChild(this);
    });
    if (data && data.el) {
        data.el.style.display = data.display;
        data.el.style.position = data.position;
        data.parent.appendChild(data.el);
        $(data.el).removeData('blockUI.history');
    }
    if (typeof opts.onUnblock == 'function')
        opts.onUnblock(el,opts);
};

// bind/unbind the handler
function bind(b, el, opts) {
    var full = el == window, $el = $(el);
    
    // don't bother unbinding if there is nothing to unbind
    if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked'))) 
        return;
    if (!full) 
        $el.data('blockUI.isBlocked', b);
        
    // bind anchors and inputs for mouse and key events
    var events = 'mousedown mouseup keydown keypress click';
    b ? $(document).bind(events, opts, handler) : $(document).unbind(events, handler);

// former impl...
//    var $e = $('a,:input');
//    b ? $e.bind(events, opts, handler) : $e.unbind(events, handler);
};

// event handler to suppress keyboard/mouse events when blocking
function handler(e) {
    // allow tab navigation (conditionally)
    if (e.keyCode && e.keyCode == 9) {
        if (pageBlock && e.data.constrainTabKey) {
            var els = pageBlockEls;
            var fwd = !e.shiftKey && e.target == els[els.length-1];
            var back = e.shiftKey && e.target == els[0];
            if (fwd || back) {
                setTimeout(function(){focus(back)},10);
                return false;
            }
        }
    }
    // allow events within the message content
    if ($(e.target).parents('div.blockMsg').length > 0)
        return true;
        
    // allow events for content that is not being blocked
    return $(e.target).parents().children().filter('div.blockUI').length == 0;
};

function focus(back) {
    if (!pageBlockEls) 
        return;
    var e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0];
    if (e) 
        e.focus();
};

function center(el, x, y) {
    var p = el.parentNode, s = el.style;
    var l = ((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth');
    var t = ((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth');
    if (x) s.left = l > 0 ? (l+'px') : '0';
    if (y) s.top  = t > 0 ? (t+'px') : '0';
};

function sz(el, p) { 
    return parseInt($.css(el,p))||0; 
};

})(jQuery);

;
/* AGGREGATED JS FILE: sites/all/modules/jquery_update/compat-1.0.js */
// UPGRADE: The following attribute helpers should now be used as:
// .attr("title") or .attr("title","new title")
jQuery.each(["id","title","name","href","src","rel"], function(i,n){
  jQuery.fn[ n ] = function(h) {
    return h == undefined ?
      this.length ? this[0][n] : null :
      this.attr( n, h );
  };
});

// UPGRADE: The following css helpers should now be used as:
// .css("top") or .css("top","30px")
jQuery.each("top,left,position,float,overflow,color,background".split(","), function(i,n){
  jQuery.fn[ n ] = function(h) {
    return h == undefined ?
      ( this.length ? jQuery.css( this[0], n ) : null ) :
      this.css( n, h );
  };
});

// UPGRADE: The following event helpers should now be used as such:
// .oneblur(fn) -> .one("blur",fn)
// .unblur(fn) -> .unbind("blur",fn)
var e = ("blur,focus,load,resize,scroll,unload,click,dblclick," +
  "mousedown,mouseup,mousemove,mouseover,mouseout,change,reset,select," + 
  "submit,keydown,keypress,keyup,error").split(",");

// Go through all the event names, but make sure that
// it is enclosed properly
for ( var i = 0; i < e.length; i++ ) new function(){
      
  var o = e[i];
    
  // Handle event unbinding
  jQuery.fn["un"+o] = function(f){ return this.unbind(o, f); };
    
  // Finally, handle events that only fire once
  jQuery.fn["one"+o] = function(f){
    // save cloned reference to this
    var element = jQuery(this);
    var handler = function() {
      // unbind itself when executed
      element.unbind(o, handler);
      element = null;
      // apply original handler with the same arguments
      return f.apply(this, arguments);
    };
    return this.bind(o, handler);
  };
      
};

// UPGRADE: .ancestors() was removed in favor of .parents()
jQuery.fn.ancestors = jQuery.fn.parents;

// UPGRADE: The CSS selector :nth-child() now starts at 1, instead of 0
jQuery.expr[":"]["nth-child"] = "jQuery.nth(a.parentNode.firstChild,parseInt(m[3])+1,'nextSibling')==a";

// UPGRADE: .filter(["div", "span"]) now becomes .filter("div, span")
jQuery.fn._filter = jQuery.fn.filter;
jQuery.fn.filter = function(arr){
  return this._filter( arr.constructor == Array ? arr.join(",") : arr );
};

;
/* AGGREGATED JS FILE: sites/all/modules/visibility_api/visibility_api.js */
/**
* Visibility API Accesss.
*
* Returns -1 if the key fails on the page load, otherwise
* an array of settings including selectors and method of inclusion or exlusion. 
*/
(function($){
  $.visibilityAccess = function(key) {
    if (!Drupal.settings){
      return -1;
    }
    
    var settings = Drupal.settings.visibility_api[key];
    
    if (!settings){
      return -1;
    }
    else if (!settings.visible){
      return -1;
    }
    else {
      return settings;
    }
  };
})(jQuery);

;
/* AGGREGATED JS FILE: misc/collapse.js */
// $Id: collapse.js,v 1.2 2008/09/12 15:33:12 akumar Exp $

/**
 * Toggle the visibility of a fieldset using smooth animations
 */
Drupal.toggleFieldset = function(fieldset) {
  if ($(fieldset).is('.collapsed')) {
    var content = $('> div', fieldset).hide();
    $(fieldset).removeClass('collapsed');
    content.slideDown({
      duration: 300,
      complete: function() {
        // Make sure we open to height auto
        $(this).css('height', 'auto');
        Drupal.collapseScrollIntoView(this.parentNode);
        this.parentNode.animating = false;
      },
      step: function() {
         // Scroll the fieldset into view
        Drupal.collapseScrollIntoView(this.parentNode);
      }
    });
    if (typeof Drupal.textareaAttach != 'undefined') {
      // Initialize resizable textareas that are now revealed
      Drupal.textareaAttach(null, fieldset);
    }
  }
  else {
    var content = $('> div', fieldset).slideUp('medium', function() {
      $(this.parentNode).addClass('collapsed');
      this.parentNode.animating = false;
    });
  }
}

/**
 * Scroll a given fieldset into view as much as possible.
 */
Drupal.collapseScrollIntoView = function (node) {
  var h = self.innerHeight || document.documentElement.clientHeight || $('body')[0].clientHeight || 0;
  var offset = self.pageYOffset || document.documentElement.scrollTop || $('body')[0].scrollTop || 0;
  var pos = Drupal.absolutePosition(node);
  var fudge = 55;
  if (pos.y + node.offsetHeight + fudge > h + offset) {
    if (node.offsetHeight > h) {
      window.scrollTo(0, pos.y);
    } else {
      window.scrollTo(0, pos.y + node.offsetHeight - h + fudge);
    }
  }
}

// Global Killswitch
if (Drupal.jsEnabled) {
  $(document).ready(function() {
    $('fieldset.collapsible > legend').each(function() {
      var fieldset = $(this.parentNode);
      // Expand if there are errors inside
      if ($('input.error, textarea.error, select.error', fieldset).size() > 0) {
        fieldset.removeClass('collapsed');
      }

      // Turn the legend into a clickable link and wrap the contents of the fieldset
      // in a div for easier animation
      var text = this.innerHTML;
      $(this).empty().append($('<a href="#">'+ text +'</a>').click(function() {
        var fieldset = $(this).parents('fieldset:first')[0];
        // Don't animate multiple times
        if (!fieldset.animating) {
          fieldset.animating = true;
          Drupal.toggleFieldset(fieldset);
        }
        return false;
      })).after($('<div class="fieldset-wrapper"></div>').append(fieldset.children(':not(legend)')));
      fieldset.filter('.collapsed').children('.fieldset-wrapper')
        .css({height: 'auto', display: 'inline'});
    });
  });
}

;
/* AGGREGATED JS FILE: sites/all/modules/jquery_update/collapse-fix.js */
// $Id: collapse-fix.js,v 1.1 2007/04/26 15:14:38 jjeff Exp $
// redefining toggleFieldset for compatibility with later versions of JQuery
Drupal.toggleFieldset = function(fieldset) {
  if ($(fieldset).is('.collapsed')) {
    var content = $('> div', fieldset).hide();
    $(fieldset).removeClass('collapsed');
    content.slideDown( {
    duration: 300, // THE FIX
      complete: function() {
        // Make sure we open to height auto
        $(this).css('height', 'auto');
        Drupal.collapseScrollIntoView(this.parentNode);
        this.parentNode.animating = false;
      },
      step: function() {
         // Scroll the fieldset into view
        Drupal.collapseScrollIntoView(this.parentNode);
      }
    });
    if (typeof Drupal.textareaAttach != 'undefined') {
      // Initialize resizable textareas that are now revealed
      Drupal.textareaAttach(null, fieldset);
    }
  }
  else {
    var content = $('> div', fieldset).slideUp('medium', function() {
      $(this.parentNode).addClass('collapsed');
      this.parentNode.animating = false;
    });
  }
}
