ms-dropdown-rails 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. data/.document +5 -0
  2. data/.rspec +1 -0
  3. data/GPL-LICENSE.txt +278 -0
  4. data/Gemfile +9 -0
  5. data/Gemfile.lock +37 -0
  6. data/LICENSE.txt +20 -0
  7. data/MIT-LICENSE.txt +20 -0
  8. data/README.md +200 -0
  9. data/Rakefile +49 -0
  10. data/Readme.txt +10 -0
  11. data/VERSION +1 -0
  12. data/lib/ms-dropdown-rails.rb +7 -0
  13. data/ms-dropdown-rails.gemspec +130 -0
  14. data/spec/README +0 -0
  15. data/spec/ajax-cd.html +2 -0
  16. data/spec/ajax-date.html +2 -0
  17. data/spec/ajax-json.html +1 -0
  18. data/spec/ajax-main.html +142 -0
  19. data/spec/ajax-shoppingcart.html +2 -0
  20. data/spec/cssSprite.html +95 -0
  21. data/spec/getvalue.php +17 -0
  22. data/spec/icons/1273404841_tick_16.png +0 -0
  23. data/spec/icons/Thumbs.db +0 -0
  24. data/spec/icons/button-large.gif +0 -0
  25. data/spec/icons/demoaction.jpg +0 -0
  26. data/spec/icons/enabled.gif +0 -0
  27. data/spec/icons/giftlelo_dot_com.jpg +0 -0
  28. data/spec/icons/icon_calendar.gif +0 -0
  29. data/spec/icons/icon_cart.gif +0 -0
  30. data/spec/icons/icon_cd.gif +0 -0
  31. data/spec/icons/icon_email.gif +0 -0
  32. data/spec/icons/icon_faq.gif +0 -0
  33. data/spec/icons/icon_games.gif +0 -0
  34. data/spec/icons/icon_lockopen.gif +0 -0
  35. data/spec/icons/icon_music.gif +0 -0
  36. data/spec/icons/icon_phone.gif +0 -0
  37. data/spec/icons/icon_sales.gif +0 -0
  38. data/spec/icons/icon_secure.gif +0 -0
  39. data/spec/icons/icon_video.gif +0 -0
  40. data/spec/icons/jquery-msdropdown.gif +0 -0
  41. data/spec/icons/msDropDown.gif +0 -0
  42. data/spec/icons/preview.gif +0 -0
  43. data/spec/icons/sprite.gif +0 -0
  44. data/spec/icons/sprite.jpg +0 -0
  45. data/spec/icons/tick.gif +0 -0
  46. data/spec/images/Thumbs.db +0 -0
  47. data/spec/images/icon-arrow.gif +0 -0
  48. data/spec/images/icon-ok.gif +0 -0
  49. data/spec/images/msDropDown.gif +0 -0
  50. data/spec/index.html +85 -0
  51. data/spec/mouse-events.html +427 -0
  52. data/spec/ms-dropdown-rails_spec.rb +7 -0
  53. data/spec/msdropdown/Thumbs.db +0 -0
  54. data/spec/msdropdown/dd.css +172 -0
  55. data/spec/msdropdown/dd_arrow.gif +0 -0
  56. data/spec/msdropdown/js/jquery-1.3.2.min.js +19 -0
  57. data/spec/msdropdown/js/jquery-1.6.1.min.js +18 -0
  58. data/spec/msdropdown/js/jquery-1.7.1.min.js +4 -0
  59. data/spec/msdropdown/js/jquery-1.7.2.min.js +4 -0
  60. data/spec/msdropdown/js/jquery.dd.js +11 -0
  61. data/spec/msdropdown/js/jquery.dd.min.js +1 -0
  62. data/spec/msdropdown/js/test.js +79 -0
  63. data/spec/msdropdown/js/uncompressed.jquery.dd.js +1110 -0
  64. data/spec/multipleSkin.html +112 -0
  65. data/spec/normal.html +127 -0
  66. data/spec/objectOriented.html +200 -0
  67. data/spec/spec_helper.rb +12 -0
  68. data/spec/test-ui.html +131 -0
  69. data/updates.txt +7 -0
  70. data/vendor/assets/images/ms-dropdown/dd_arrow.gif +0 -0
  71. data/vendor/assets/images/ms-dropdown/icon-arrow.gif +0 -0
  72. data/vendor/assets/images/ms-dropdown/icon-ok.gif +0 -0
  73. data/vendor/assets/images/ms-dropdown/msDropDown.gif +0 -0
  74. data/vendor/assets/images/ms-dropdown/sprite.gif +0 -0
  75. data/vendor/assets/images/ms-dropdown/sprite.jpg +0 -0
  76. data/vendor/assets/javascripts/jquery.dd.js +11 -0
  77. data/vendor/assets/javascripts/jquery.dd.min.js +1 -0
  78. data/vendor/assets/javascripts/uncompressed.jquery.dd.js +1110 -0
  79. data/vendor/assets/stylesheets/ms-dropdown/dd.css +172 -0
  80. metadata +210 -0
@@ -0,0 +1,131 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
+ <title>Image Dropdown</title>
6
+ <link rel="stylesheet" type="text/css" href="msdropdown/dd.css" />
7
+ <script type="text/javascript" src="msdropdown/js/jquery-1.6.1.min.js"></script>
8
+ <script type="text/javascript" src="msdropdown/js/uncompressed.jquery.dd.js"></script>
9
+ <style type="text/css">
10
+ .toplinks{ font-family:Arial, Helvetica, sans-serif;
11
+ font-size:12px;
12
+ background-color: #777777;
13
+ color:#fff;
14
+ border-bottom:2px solid #c3c3c3;
15
+ margin-bottom:10px;
16
+ padding-bottom:10px;
17
+ }
18
+ .toplinks a, .toplinks a :visited{color:#FFF;}
19
+ .small{font-size:10px; line-height:12px; color:#006; font-weight:normal; font-family:Arial, Helvetica, sans-serif; position:relative; top:-10px}
20
+
21
+ </style>
22
+ <link rel="stylesheet" href="http://code.jquery.com/ui/1.8.18/themes/base/jquery-ui.css" type="text/css" media="all" />
23
+ <script src="http://code.jquery.com/ui/1.8.18/jquery-ui.min.js" type="text/javascript"></script>
24
+ </head>
25
+ <body>
26
+
27
+
28
+ <table width="100%" border="0" cellspacing="0" cellpadding="5" class="toplinks">
29
+ <tr>
30
+ <td width="11%"><strong><a href="normal.html">Simple</a></strong></td>
31
+ <td width="16%"><a href="cssSprite.html"><strong>CSS Sprite</strong></a></td>
32
+ <td width="18%"><a href="multipleSkin.html"><strong>Multiple Skin</strong></a></td>
33
+ <td width="17%"><a href="objectOriented.html"><strong>Object Oriented Approch</strong></a></td>
34
+ <td width="18%"><a href="ajax-main.html"><strong>Ajax Call</strong></a></td>
35
+ <td width="20%"><a href="mouse-events.html"><strong>Mouse Events</strong></a></td>
36
+ </tr>
37
+ </table>
38
+ <form name="myform" id="myform" action="getvalue.php" enctype="multipart/form-data" method="post">
39
+ <h1>Javascript image dropdown <span id="ver"></span> <a class="small" href="http://www.marghoobsuleman.com/jquery-image-dropdown" title="Download">Download</a> </h1>
40
+
41
+ <p>
42
+ <select style="width:200px" class="mydds" name="myimge">
43
+ <option value="calendar" selected="selected" title="icons/icon_calendar.gif">Calendar</option>
44
+ <option value="shopping_cart" title="icons/icon_cart.gif">Shopping Cart</option>
45
+ <option value="cd" title="icons/icon_cd.gif">CD</option>
46
+ <option value="email" title="icons/icon_email.gif">Email</option>
47
+ <option value="faq" title="icons/icon_faq.gif">FAQ</option>
48
+ <option value="games" title="icons/icon_games.gif">Games</option>
49
+ <option value="music" title="icons/icon_music.gif">Music</option>
50
+ <option value="phone" title="icons/icon_phone.gif">Phone</option>
51
+ <option value="graph" title="icons/icon_sales.gif">Graph</option>
52
+ <option value="secured" title="icons/icon_secure.gif">Secured</option>
53
+ <option value="video" title="icons/icon_video.gif">Video</option>
54
+ </select>
55
+ <br />
56
+ <br />
57
+ </p>
58
+ <p id="dpholder" >
59
+ <h3>With title: used json style in title attribute. ie: title="{image:'icons/icon_cart.gif', title:'Shopping Cart'}" </h3>
60
+ <select style="width:200px" class="mydds" name="myimge">
61
+ <option value="calendar" selected="selected" title="{image:'icons/icon_calendar.gif', title:'Calendar'}">Calendar</option>
62
+ <option value="shopping_cart" title="{image:'icons/icon_cart.gif', title:'Shopping Cart'}">Shopping Cart</option>
63
+ <option value="cd" title="{image:'icons/icon_cd.gif', title:'CD'}">CD</option>
64
+ <option value="email" title="{image:'icons/icon_email.gif', title:'Email'}">Email</option>
65
+ <option value="faq" title="{image:'icons/icon_faq.gif', title:'FAQ'}">FAQ</option>
66
+ <option value="games" title="{image:'icons/icon_games.gif', title:'Games'}">Games</option>
67
+ <option value="music" title="{image:'icons/icon_music.gif', title:'Music'}">Music</option>
68
+ <option value="phone" title="{image:'icons/icon_phone.gif', title:'Phone'}">Phone</option>
69
+ <option value="graph" title="{image:'icons/icon_sales.gif', title:'Graph'}">Graph</option>
70
+ <option value="secured" title="{image:'icons/icon_secure.gif', title:'Secured'}">Secured</option>
71
+ <option value="video" title="{image:'icons/icon_video.gif', title:'Video'}">Video</option>
72
+ </select>
73
+ <br />
74
+ <br />
75
+ </p>
76
+ <p style="clear:both">
77
+ <input type="submit" value="Submit Value" />
78
+ </p>
79
+
80
+
81
+ <div style="border:1px solid #c3c3c3; padding:50px; width:200px; background:#fff" id="draggable">
82
+ Used jQuery UI - Drag me
83
+ </div>
84
+
85
+
86
+
87
+ </form>
88
+ <script language="javascript" type="text/javascript">
89
+
90
+ function showvalue(arg) {
91
+ alert(arg);
92
+ //arg.visible(false);
93
+ }
94
+
95
+
96
+ $(document).ready(function() {
97
+
98
+ try {
99
+ oHandler = $(".mydds").msDropDown().data("dd");
100
+ //oHandler.visible(true);
101
+ //alert($.msDropDown.version);
102
+ //$.msDropDown.create("body select");
103
+ $("#ver").html($.msDropDown.version);
104
+ } catch(e) {
105
+ alert("Error: "+e.message);
106
+ }
107
+ $( "#draggable" ).draggable();
108
+ })
109
+ /*
110
+ $(document).bind("keydown", function() {
111
+ console.log("document keydown");
112
+ })
113
+ */
114
+
115
+ </script>
116
+ <div class="node-links" style="padding:10px; border:1px solid #c3c3c3;background:#222222; margin-top:40px">
117
+ <div class="adsense">
118
+ <script type="text/javascript"><!--
119
+ google_ad_client = "pub-7681689922712917";
120
+ /* 468x15 */
121
+ google_ad_slot = "4604426671";
122
+ google_ad_width = 468;
123
+ google_ad_height = 15;
124
+ //-->
125
+ </script>
126
+ <!--script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script-->
127
+ </div>
128
+ </div>
129
+
130
+ </body>
131
+ </html>
@@ -0,0 +1,7 @@
1
+ 1. document keydown/keyup bug fixed
2
+ 2. added json support in title. {image:'', title:''}
3
+ 3. onchange bug fixed on onclose
4
+
5
+
6
+
7
+
@@ -0,0 +1,11 @@
1
+ // MSDropDown - jquery.dd.js
2
+ // author: Marghoob Suleman - Search me on google
3
+ // Date: 12th Aug, 2009
4
+ // Version: 2.38.4
5
+ // Revision: 38
6
+ // web: www.giftlelo.com | www.marghoobsuleman.com
7
+ /*
8
+ // msDropDown is free jQuery Plugin: you can redistribute it and/or modify
9
+ // it under the terms of the either the MIT License or the Gnu General Public License (GPL) Version 2
10
+ */
11
+ ;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}(';(6($){3 1N="";3 3B=6(s,u){3 v=s;3 x=1b;3 u=$.3C({1c:4s,2w:7,2S:23,1O:9,1P:4t,3D:\'2g\',1J:10,3E:\'4u\',2T:\'\',2U:9,1k:\'\'},u);1b.1Z=21 3F();3 y="";3 z={};z.2V=9;z.2x=10;z.2y=1r;3 A=10;3 B={2W:\'4v\',1Q:\'4w\',1K:\'4x\',2h:\'4y\',1g:\'4z\',2X:\'4A\',2Y:\'4B\',4C:\'4D\',2z:\'4E\',3G:\'4F\'};3 C={2g:u.3D,2Z:\'2Z\',31:\'31\',32:\'32\',1w:\'1w\',1l:.30,1R:\'1R\',2A:\'2A\',2B:\'2B\',15:\'15\'};3 D={3H:"2C,33,34,1S,2D,2E,1s,1A,2F,1T,4G,22,35",1a:"1B,1x,1l,4H"};1b.1U=21 3F();3 E=$(v).1a("1d");5(1e(E)=="14"||E.18<=0){E="4I"+$.1V.3I++;$(v).2i("1d",E)};3 F=$(v).1a("1k");u.1k+=(F==14)?"":F;3 G=$(v).3J();A=($(v).1a("1B")>1||$(v).1a("1x")==9)?9:10;5(A){u.2w=$(v).1a("1B")};3 H={};3 I=0;3 J=10;3 K;3 L=10;3 M={};3 N="";3 O=6(a){5(1e(M[a])=="14"){M[a]=1o.4J(a)}11 M[a]};3 P=6(a){11 E+B[a]};3 Q=6(a){3 b=a;3 c=$(b).1a("1k");11(1e c=="14")?"":c.4K};3 R=6(a){3 b=$("#"+E+" 36:15");5(b.18>1){1C(3 i=0;i<b.18;i++){5(a==b[i].1j){11 9}}}19 5(b.18==1){5(b[0].1j==a){11 9}};11 10};3 S=6(a,b,c,d){3 e="";3 f=(d=="3a")?P("2Y"):P("2X");3 g=(d=="3a")?f+"3b"+(b)+"3b"+(c):f+"3b"+(b);3 h="";3 t="";3 i="";3 j="";5(u.1J!=10){i=\' \'+u.1J+\' \'+a.3K}19{h=$(a).1a("1p");3 k=21 3L(/^\\{.*\\}$/);3 l=k.3M(h);5(u.2U==9&&l==9){5(h.18!=0){3 m=24("["+h+"]");1W=(1e m[0].2j=="14")?"":m[0].2j;t=(1e m[0].1p=="14")?"":m[0].1p;j=(1e m[0].3N=="14")?"":m[0].3N;h=(1W.18==0)?"":\'<1W 2G="\'+1W+\'" 2H="2I" /> \'}}19{h=(h.18==0)?"":\'<1W 2G="\'+h+\'" 2H="2I" /> \'}};3 n=$(a).1t();3 o=$(a).4L();3 p=($(a).1a("1l")==9)?"1l":"3c";H[g]={1L:h+n,2k:o,1t:n,1j:a.1j,1d:g,1p:t};3 q=Q(a);5(R(a.1j)==9){e+=\'<a 3O="3P:3Q(0);" 1u="\'+C.15+\' \'+p+i+\'"\'}19{e+=\'<a 3O="3P:3Q(0);" 1u="\'+p+i+\'"\'};5(q!==10&&q!==14&&q.18!=0){e+=" 1k=\'"+q+"\'"};5(t!==""){e+=" 1p=\'"+t+"\'"};e+=\' 1d="\'+g+\'">\';e+=h+\'<1y 1u="\'+C.1w+\'">\'+n+\'</1y>\';5(j!==""){e+=j};e+=\'</a>\';11 e};3 T=6(t){3 b=t.3d();5(b.18==0)11-1;3 a="";1C(3 i 2l H){3 c=H[i].1t.3d();5(c.3R(0,b.18)==b){a+="#"+H[i].1d+", "}};11(a=="")?-1:a};3 U=6(){3 f=G;5(f.18==0)11"";3 g="";3 h=P("2X");3 i=P("2Y");f.3e(6(c){3 d=f[c];5(d.4M.4N().3d()=="4O"){g+="<1z 1u=\'4P\'>";g+="<1y 1k=\'3S-4Q:4R;3S-1k:4S;4T:4U;\'>"+$(d).1a("4V")+"</1y>";3 e=$(d).3J();e.3e(6(a){3 b=e[a];g+=S(b,c,a,"3a")});g+="</1z>"}19{g+=S(d,c,"","")}});11 g};3 V=6(){3 a=P("1Q");3 b=P("1g");3 c=u.1k;25="";25+=\'<1z 1d="\'+b+\'" 1u="\'+C.32+\'"\';5(!A){25+=(c!="")?\' 1k="\'+c+\'"\':\'\'}19{25+=(c!="")?\' 1k="2J-1D:4W 4X #4Y;1q:2m;1m:2K;\'+c+\'"\':\'\'};25+=\'>\';11 25};3 W=6(){3 a=P("1K");3 b=P("2z");3 c=P("2h");3 d=P("3G");3 e="";3 f="";5(O(E).1E.18>0){e=$("#"+E+" 36:15").1t();f=$("#"+E+" 36:15").1a("1p")};3 g="";3 t="";3 h=21 3L(/^\\{.*\\}$/);3 i=h.3M(f);5(u.2U==9&&i==9){5(f.18!=0){3 j=24("["+f+"]");g=(1e j[0].2j=="14")?"":j[0].2j;t=(1e j[0].1p=="14")?"":j[0].1p;f=(g.18==0||u.1O==10||u.1J!=10)?"":\'<1W 2G="\'+g+\'" 2H="2I" /> \'}}19{f=(f.18==0||f==14||u.1O==10||u.1J!=10)?"":\'<1W 2G="\'+f+\'" 2H="2I" /> \'};3 k=\'<1z 1d="\'+a+\'" 1u="\'+C.2Z+\'"\';k+=\'>\';k+=\'<1y 1d="\'+b+\'" 1u="\'+C.31+\'"></1y><1y 1u="\'+C.1w+\'" 1d="\'+c+\'">\'+f+\'<1y 1u="\'+C.1w+\'">\'+e+\'</1y></1y></1z>\';11 k};3 X=6(){3 c=P("1g");$("#"+c+" a.3c").1F("1S");$("#"+c+" a.3c").1f("1S",6(a){a.26();3f(1b);28();5(!A){$("#"+c).1F("1A");29(10);3 b=(u.1O==10)?$(1b).1t():$(1b).1L();1X(b);x.2n()}})};3 Y=6(){3 d=10;3 e=P("1Q");3 f=P("1K");3 g=P("2h");3 h=P("1g");3 i=P("2z");3 j=$("#"+E).4Z();3 k=u.1k;5($("#"+e).18>0){$("#"+e).2L();d=9};3 l=\'<1z 1d="\'+e+\'" 1u="\'+C.2g+\'"\';l+=(k!="")?\' 1k="\'+k+\'"\':\'\';l+=\'>\';l+=W();l+=V();l+=U();l+="</1z>";l+="</1z>";5(d==9){3 m=P("2W");$("#"+m).3g(l)}19{$("#"+E).3g(l)};5(A){3 f=P("1K");$("#"+f).2o()};$("#"+e).12("3T",j+"1v");$("#"+h).12("3T",(j-2)+"1v");5(G.18>u.2w){3 n=2p($("#"+h+" a:3h").12("2q-3U"))+2p($("#"+h+" a:3h").12("2q-1D"));3 o=((u.2S)*u.2w)-n;$("#"+h).12("1c",o+"1v")}19 5(A){3 o=$("#"+E).1c();$("#"+h).12("1c",o+"1v")};5(d==10){3V();3W(E)};5($("#"+E).1a("1l")==9){$("#"+e).12("2M",C.1l)};3X();$("#"+f).1f("1A",6(a){3i(1)});$("#"+f).1f("1T",6(a){3i(0)});X();$("#"+h+" a.1l").12("2M",C.1l);5(A){$("#"+h).1f("1A",6(c){5(!z.2x){z.2x=9;$(1o).1f("22",6(a){3 b=a.3Y;z.2y=b;5(b==39||b==40){a.26();a.2r();3j();28()};5(b==37||b==38){a.26();a.2r();3k();28()}})}})};$("#"+h).1f("1T",6(a){29(10);$(1o).1F("22",2N);z.2x=10;z.2y=1r});$("#"+f).1f("1S",6(b){29(10);5($("#"+h+":2a").18==1){$("#"+h).1F("1A")}19{$("#"+h).1f("1A",6(a){29(9)});x.3Z()}});$("#"+f).1f("1T",6(a){29(10)});5(u.1O&&u.1J!=10){2s()}};3 Z=6(a){1C(3 i 2l H){5(H[i].1j==a){11 H[i]}};11-1};3 3f=6(a){3 b=P("1g");5($("#"+b+" a."+C.15).18==1){y=$("#"+b+" a."+C.15).1t()};5(!A){$("#"+b+" a."+C.15).1M(C.15)};3 c=$("#"+b+" a."+C.15).1a("1d");5(c!=14){3 d=(z.2b==14||z.2b==1r)?H[c].1j:z.2b};5(a&&!A){$(a).1G(C.15)};5(A){3 e=z.2y;5($("#"+E).1a("1x")==9){5(e==17){z.2b=H[$(a).1a("1d")].1j;$(a).50(C.15)}19 5(e==16){$("#"+b+" a."+C.15).1M(C.15);$(a).1G(C.15);3 f=$(a).1a("1d");3 g=H[f].1j;1C(3 i=3l.51(d,g);i<=3l.52(d,g);i++){$("#"+Z(i).1d).1G(C.15)}}19{$("#"+b+" a."+C.15).1M(C.15);$(a).1G(C.15);z.2b=H[$(a).1a("1d")].1j}}19{$("#"+b+" a."+C.15).1M(C.15);$(a).1G(C.15);z.2b=H[$(a).1a("1d")].1j}}};3 3W=6(a){3 b=a;O(b).53=6(e){$("#"+b).1V(u)}};3 29=6(a){z.2V=a};3 41=6(){11 z.2V};3 3X=6(){3 b=P("1Q");3 c=D.3H.54(",");1C(3 d=0;d<c.18;d++){3 e=c[d];3 f=2c(e);5(f==9){2O(e){1h"2C":$("#"+b).1f("55",6(a){O(E).2C()});1i;1h"1S":$("#"+b).1f("1S",6(a){$("#"+E).1H("1S")});1i;1h"2D":$("#"+b).1f("2D",6(a){$("#"+E).1H("2D")});1i;1h"2E":$("#"+b).1f("2E",6(a){$("#"+E).1H("2E")});1i;1h"1s":$("#"+b).1f("1s",6(a){$("#"+E).1H("1s")});1i;1h"1A":$("#"+b).1f("1A",6(a){$("#"+E).1H("1A")});1i;1h"2F":$("#"+b).1f("2F",6(a){$("#"+E).1H("2F")});1i;1h"1T":$("#"+b).1f("1T",6(a){$("#"+E).1H("1T")});1i}}}};3 3V=6(){3 a=P("2W");$("#"+E).3g("<1z 1u=\'"+C.1R+"\' 1k=\'1c:3m;42:43;1m:2P;\' 1d=\'"+a+"\'></1z>");$("#"+E).56($("#"+a))};3 1X=6(a){3 b=P("2h");$("#"+b).1L(a)};3 3n=6(w){3 a=w;3 b=P("1g");3 c=$("#"+b+" a:2a");3 d=c.18;3 e=$("#"+b+" a:2a").1j($("#"+b+" a.15:2a"));3 f;2O(a){1h"3o":5(e<d-1){e++;f=c[e]};1i;1h"44":5(e<d&&e>0){e--;f=c[e]};1i};5(1e(f)=="14"){11 10};$("#"+b+" a."+C.15).1M(C.15);$(f).1G(C.15);3 g=f.1d;5(!A){3 h=(u.1O==10)?H[g].1t:$("#"+g).1L();1X(h);2s(H[g].1j)};5(a=="3o"){5(2p(($("#"+g).1m().1D+$("#"+g).1c()))>=2p($("#"+b).1c())){$("#"+b).2t(($("#"+b).2t())+$("#"+g).1c()+$("#"+g).1c())}}19{5(2p(($("#"+g).1m().1D+$("#"+g).1c()))<=0){$("#"+b).2t(($("#"+b).2t()-$("#"+b).1c())-$("#"+g).1c())}}};3 3j=6(){3n("3o")};3 3k=6(){3n("44")};3 2s=6(i){5(u.1J!=10){3 a=P("2h");3 b=(1e(i)=="14")?O(E).1n:i;3 c=O(E).1E[b].3K;5(c.18>0){3 d=P("1g");3 e=$("#"+d+" a."+c).1a("1d");3 f=$("#"+e).12("1Y-2j");3 g=$("#"+e).12("1Y-1m");5(g==14){g=$("#"+e).12("1Y-1m-x")+" "+$("#"+e).12("1Y-1m-y")};3 h=$("#"+e).12("2q-45");5(f!=14){$("#"+a).2u("."+C.1w).2i(\'1k\',"1Y:"+f)};5(g!=14){$("#"+a).2u("."+C.1w).12(\'1Y-1m\',g)};5(h!=14){$("#"+a).2u("."+C.1w).12(\'2q-45\',h)};$("#"+a).2u("."+C.1w).12(\'1Y-47\',\'57-47\');$("#"+a).2u("."+C.1w).12(\'2q-3U\',\'58\')}}};3 28=6(){3 a=P("1g");3 b=$("#"+a+" a."+C.15);5(b.18==1){3 c=$("#"+a+" a."+C.15).1t();3 d=$("#"+a+" a."+C.15).1a("1d");5(d!=14){3 e=H[d].2k;O(E).1n=H[d].1j};5(u.1O&&u.1J!=10)2s()}19 5(b.18>1){1C(3 i=0;i<b.18;i++){3 d=$(b[i]).1a("1d");3 f=H[d].1j;O(E).1E[f].15="15"}};3 g=O(E).1n;x.1Z["1n"]=g};3 2c=6(a){5($("#"+E).1a("59"+a)!=14){11 9};3 b=$("#"+E).3p("5a");5(b&&b[a]){11 9};11 10};3 3q=6(a){$("#"+E).2C();$("#"+E)[0].33();28();$(1o).1F("1s",2Q);$(1o).1F("1s",3q)};3 48=6(){3 a=P("1g");5(2c(\'34\')==9){3 b=H[$("#"+a+" a.15").1a("1d")].1t;5($.49(y)!==$.49(b)&&y!==""){$("#"+E).1H("34")}};5(2c(\'1s\')==9){$("#"+E).1H("1s")};5(2c(\'33\')==9){$(1o).1f("1s",3q)};11 10};3 3i=6(a){3 b=P("2z");5(a==1)$("#"+b).12({4a:\'0 5b%\'});19 $("#"+b).12({4a:\'0 0\'})};3 4b=6(){1C(3 i 2l O(E)){5(1e(O(E)[i])!==\'6\'&&1e(O(E)[i])!=="14"&&1e(O(E)[i])!=="1r"){x.1I(i,O(E)[i],9)}}};3 4c=6(a,b){5(Z(b)!=-1){O(E)[a]=b;3 c=P("1g");$("#"+c+" a."+C.15).1M(C.15);$("#"+Z(b).1d).1G(C.15);3 d=Z(O(E).1n).1L;1X(d)}};3 4d=6(i,a){5(a==\'d\'){1C(3 b 2l H){5(H[b].1j==i){5c H[b];1i}}};3 c=0;1C(3 b 2l H){H[b].1j=c;c++}};3 2R=6(){3 a=P("1g");3 b=P("1Q");3 c=$("#"+b).5d();3 d=$("#"+b).1c();3 e=$(4e).1c();3 f=$(4e).2t();3 g=$("#"+a).1c();3 h={1P:u.1P,1D:(d)+"1v",1q:"2d"};3 i=u.3E;3 j=10;3 k=C.2B;$("#"+a).1M(C.2B);$("#"+a).1M(C.2A);5((e+f)<3l.5e(g+d+c.1D)){3 l=g;h={1P:u.1P,1D:"-"+l+"1v",1q:"2d"};i="2e";j=9;k=C.2A};11{3r:j,4f:i,12:h,2J:k}};3 3s=6(){5(x.1U["4g"]!=1r){24(x.1U["4g"])(x)}};3 3t=6(){48();5(x.1U["4h"]!=1r){24(x.1U["4h"])(x)}};3 2N=6(a){3 b=P("1g");3 c=a.3Y;5(c==8){a.26();a.2r();N=(N.18==0)?"":N.3R(0,N.18-1)};2O(c){1h 39:1h 40:a.26();a.2r();3j();1i;1h 37:1h 38:a.26();a.2r();3k();1i;1h 27:1h 13:x.2n();28();1i;4i:5(c>46){N+=5f.5g(c)};3 d=T(N);5(d!=-1){$("#"+b).12({1c:\'5h\'});$("#"+b+" a").2o();$(d).2e();3 e=2R();$("#"+b).12(e.12);$("#"+b).12({1q:\'2m\'})}19{$("#"+b+" a").2e();$("#"+b).12({1c:K+\'1v\'})};1i};5(2c("22")==9){O(E).5i()};11 10};3 2Q=6(a){5(41()==10){x.2n()};11 10};3 3u=6(a){5($("#"+E).1a("4j")!=14){O(E).4j()};11 10};1b.3Z=6(){5((x.2f("1l",9)==9)||(x.2f("1E",9).18==0))11;3 a=P("1g");5(1N!=""&&a!=1N){$("#"+1N).4k("3v");$("#"+1N).12({1P:\'0\'})};5($("#"+a).12("1q")=="2d"){y=H[$("#"+a+" a.15").1a("1d")].1t;N="";K=$("#"+a).1c();$("#"+a+" a").2e();$(1o).1f("22",2N);$(1o).1f("35",3u);$(1o).1f("1s",2Q);3 b=2R();$("#"+a).12(b.12);5(b.3r==9){$("#"+a).12({1q:\'2m\'});$("#"+a).1G(b.2J);3s()}19{$("#"+a)[b.4f]("3v",6(){$("#"+a).1G(b.2J);3s()})};5(a!=1N){1N=a}}};1b.2n=6(){3 b=P("1g");5(!$("#"+b).4l(":2a")||L)11;L=9;5($("#"+b).12("1q")=="2d"){11 10};3 c=$("#"+P("1K")).1m().1D;3 d=2R();J=10;5(d.3r==9){$("#"+b).5j({1c:0,1D:c},6(){$("#"+b).12({1c:K+\'1v\',1q:\'2d\'});3t();L=10})}19{$("#"+b).4k("3v",6(a){3t();$("#"+b).12({1P:\'0\'});$("#"+b).12({1c:K+\'1v\'});L=10})};2s();$(1o).1F("22",2N);$(1o).1F("35",3u);$(1o).1F("1s",2Q)};1b.1n=6(i){5(1e(i)=="14"){11 x.2f("1n")}19{x.1I("1n",i)}};1b.4m=6(a){5(1e(a)=="14"||a==9){$("."+C.1R).5k("1k")}19{$("."+C.1R).2i("1k","1c:3m;42:43;1m:2P")}};1b.1I=6(a,b,c){5(1e a=="14"||1e b=="14")11 10;x.1Z[a]=b;5(c!=9){2O(a){1h"1n":4c(a,b);1i;1h"1l":x.1l(b,9);1i;1h"1x":O(E)[a]=b;A=($(v).1a("1B")>0||$(v).1a("1x")==9)?9:10;5(A){3 d=$("#"+E).1c();3 f=P("1g");$("#"+f).12("1c",d+"1v");3 g=P("1K");$("#"+g).2o();3 f=P("1g");$("#"+f).12({1q:\'2m\',1m:\'2K\'});X()};1i;1h"1B":O(E)[a]=b;5(b==0){O(E).1x=10};A=($(v).1a("1B")>0||$(v).1a("1x")==9)?9:10;5(b==0){3 g=P("1K");$("#"+g).2e();3 f=P("1g");$("#"+f).12({1q:\'2d\',1m:\'2P\'});3 h="";5(O(E).1n>=0){3 i=Z(O(E).1n);h=i.1L;3f($("#"+i.1d))};1X(h)}19{3 g=P("1K");$("#"+g).2o();3 f=P("1g");$("#"+f).12({1q:\'2m\',1m:\'2K\'})};1i;4i:4n{O(E)[a]=b}4o(e){};1i}}};1b.2f=6(a,b){5(a==14&&b==14){11 x.1Z};5(a!=14&&b==14){11(x.1Z[a]!=14)?x.1Z[a]:1r};5(a!=14&&b!=14){11 O(E)[a]}};1b.2a=6(a){3 b=P("1Q");5(a==9){$("#"+b).2e()}19 5(a==10){$("#"+b).2o()}19{11 $("#"+b).12("1q")}};1b.5l=6(a,b){3 c=a;3 d=c.1t;3 e=(c.2k==14||c.2k==1r)?d:c.2k;3 f=(c["1p"]==14||c["1p"]==1r)?\'\':c["1p"];3 i=(b==14||b==1r)?O(E).1E.18:b;O(E).1E[i]=21 5m(d,e);5(f!=\'\')O(E).1E[i]["1p"]=f;3 g=Z(i);5(g!=-1){3 h=S(O(E).1E[i],i,"","");$("#"+g.1d).1L(h)}19{3 h=S(O(E).1E[i],i,"","");3 j=P("1g");$("#"+j).5n(h);X()}};1b.2L=6(i){O(E).2L(i);5((Z(i))!=-1){$("#"+Z(i).1d).2L();4d(i,\'d\')};5(O(E).18==0){1X("")}19{3 a=Z(O(E).1n).1L;1X(a)};x.1I("1n",O(E).1n)};1b.1l=6(a,b){O(E).1l=a;3 c=P("1Q");5(a==9){$("#"+c).12("2M",C.1l);x.2n()}19 5(a==10){$("#"+c).12("2M",1)};5(b!=9){x.1I("1l",a)}};1b.3w=6(){11(O(E).3w==14)?1r:O(E).3w};1b.3x=6(){5(2v.18==1){11 O(E).3x(2v[0])}19 5(2v.18==2){11 O(E).3x(2v[0],2v[1])}19{5o{5p:"5q 1j 4l 5r!"}}};1b.4p=6(a){11 O(E).4p(a)};1b.1x=6(a){5(1e(a)=="14"){11 x.2f("1x")}19{x.1I("1x",a)}};1b.1B=6(a){5(1e(a)=="14"){11 x.2f("1B")}19{x.1I("1B",a)}};1b.5s=6(a,b){x.1U[a]=b};1b.5t=6(a){24(x.1U[a])(x)};1b.5u=6(r){5(1e r=="14"||r==0){11 10};3 a=P("1g");3 b=$("#"+a+" a:3h").1c();3 c=(b==0)?u.2S:b;3 d=r*c;$("#"+a).12("1c",d+"1v")};3 4q=6(){x.1I("3y",$.1V.3y);x.1I("3z",$.1V.3z)};3 4r=6(){Y();4b();4q();5(u.2T!=\'\'){24(u.2T)(x)}};4r()};$.1V={3y:\'2.38.4\',3z:"5v 5w",3I:20,4m:6(v){5(v==9){$(".1R").12({1c:\'5x\',1m:\'2K\'})}19{$(".1R").12({1c:\'3m\',1m:\'2P\'})}},5y:6(a,b){11 $(a).1V(b).3p("2g")}};$.3A.3C({1V:6(b){11 1b.3e(6(){3 a=21 3B(1b,b);$(1b).3p(\'2g\',a)})}});5(1e($.3A.1a)==\'14\'){$.3A.1a=6(w,v){5(1e v=="14"){11 $(1b).2i(w)};4n{$(1b).2i(w,v)}4o(e){}}}})(5z);',62,346,'|||var||if|function|||true|||||||||||||||||||||||||||||||||||||||||||||||||||||false|return|css||undefined|selected|||length|else|prop|this|height|id|typeof|bind|postChildID|case|break|index|style|disabled|position|selectedIndex|document|title|display|null|mouseup|text|class|px|ddTitleText|multiple|span|div|mouseover|size|for|top|options|unbind|addClass|trigger|set|useSprite|postTitleID|html|removeClass|bB|showIcon|zIndex|postID|ddOutOfVision|click|mouseout|onActions|msDropDown|img|bJ|background|ddProp||new|keydown||eval|sDiv|preventDefault||bO|bF|visible|oldIndex|bP|none|show|get|dd|postTitleTextID|attr|image|value|in|block|close|hide|parseInt|padding|stopPropagation|bN|scrollTop|find|arguments|visibleRows|keyboardAction|currentKey|postArrowID|borderTop|noBorderTop|focus|dblclick|mousedown|mousemove|src|align|absmiddle|border|relative|remove|opacity|bZ|switch|absolute|ca|bW|rowHeight|onInit|jsonTitle|insideWindow|postElementHolder|postAID|postOPTAID|ddTitle||arrow|ddChild|blur|change|keyup|option||||opt|_|enabled|toLowerCase|each|bD|after|first|bS|bL|bM|Math|0px|bK|next|data|bQ|opp|bX|bY|cb|fast|form|item|version|author|fn|bC|extend|mainCSS|animStyle|Object|postInputhidden|actions|counter|children|className|RegExp|test|postHTML|href|javascript|void|substr|font|width|bottom|bI|bE|bH|keyCode|open||bG|overflow|hidden|previous|left||repeat|bR|trim|backgroundPosition|bT|bU|bV|window|ani|onOpen|onClose|default|onkeyup|slideUp|is|debug|try|catch|namedItem|cc|cd|120|9999|slideDown|_msddHolder|_msdd|_title|_titletext|_child|_msa|_msopta|postInputID|_msinput|_arrow|_inp|keypress|tabindex|msdrpdd|getElementById|cssText|val|nodeName|toString|optgroup|opta|weight|bold|italic|clear|both|label|1px|solid|c3c3c3|outerWidth|toggleClass|min|max|refresh|split|mouseenter|appendTo|no|2px|on|events|100|delete|offset|floor|String|fromCharCode|auto|onkeydown|animate|removeAttr|add|Option|append|throw|message|An|required|addMyEvent|fireEvent|showRows|Marghoob|Suleman|20px|create|jQuery'.split('|'),0,{}));
@@ -0,0 +1 @@
1
+ eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(9($){3 1G="";3 1M=9(5k,n){3 10=5k;3 $c=c;n=$.4p({D:5B,2J:7,3z:23,1S:l,1K:5y,5e:\'1M\',1z:m,53:\'5s\',3C:\'\',3S:l,T:\'\'},n);c.1Y={};3 2w="";3 R={};R.41=l;R.2Q=m;R.2Y=1d;3 V=m;3 5g={3U:\'5z\',1P:\'5w\',1v:\'5u\',2o:\'5C\',M:\'5x\',3K:\'5Z\',3H:\'5T\',5X:\'5J\',2V:\'5I\',4H:\'5H\'};3 g={1M:n.5e,3I:\'3I\',E:\'E\',3W:\'3W\',1j:\'1j\',W:0.30,1J:\'1J\',1F:\'1F\',2T:\'2T\',s:\'s\'};3 4t={4u:"2U,3F,3y,1E,2X,2W,1c,1s,2S,1R,5K,1W,47",h:"1l,1e,W,5L"};c.1L={};3 b=$(10).h("f");5(H(b)=="p"||b.z<=0){b="5O"+$.1N.5j++;$(10).2z("f",b)}3 3r=$(10).h("T");n.T+=(3r===p)?"":3r;3 3M=$(10).4K();V=($(10).h("1l")>1||$(10).h("1e")===l)?l:m;5(V){n.2J=$(10).h("1l")}3 F={};3 1o=0;3 4C=m;3 2u;3 2s=m;3 3f={};3 1x="";3 q=9(2e){5(H(3f[2e])=="p"){3f[2e]=Z.5N(2e)}o 3f[2e]};3 j=9(f){o b+5g[f]};3 4l=9(2d){3 1H=2d;3 g=$(1H).h("T");o(H g=="p")?"":g.5U};3 4r=9(B){3 K=$("#"+b+" 2d:s");5(K.z>1){1n(3 i=0;i<K.z;i++){5(B==K[i].B){o l}}}A 5(K.z==1){5(K[0].B==B){o l}};o m};3 2A=9(1b,1Q,2j,2y){3 I="";3 3b=(2y=="1O")?j("3H"):j("3K");3 3i=(2y=="1O")?3b+"3s"+(1Q)+"3s"+(2j):3b+"3s"+(1Q);3 E="";3 t="";3 3g="";3 36="";5(n.1z!=m){3g=\' \'+n.1z+\' \'+1b.5q}A{E=$(1b).h("12");3 3k=35 4G(/^\\{.*\\}$/);3 2K=3k.4D(E);5(n.3S==l&&2K==l){5(E.z!=0){3 G=2b("["+E+"]");Y=(H G[0].2p=="p")?"":G[0].2p;t=(H G[0].12=="p")?"":G[0].12;36=(H G[0].4o=="p")?"":G[0].4o;E=(Y.z==0)?"":\'<Y 2L="\'+Y+\'" 2M="2P" /> \'}}A{E=(E.z==0)?"":\'<Y 2L="\'+E+\'" 2M="2P" /> \'}};3 C=$(1b).14();3 2F=$(1b).Q();3 3T=($(1b).h("W")==l)?"W":"3V";F[3i]={1A:E+C,2D:2F,14:C,B:1b.B,f:3i,12:t};3 2f=4l(1b);5(4r(1b.B)==l){I+=\'<a 4A="4v:4y(0);" 15="\'+g.s+\' \'+3T+3g+\'"\'}A{I+=\'<a 4A="4v:4y(0);" 15="\'+3T+3g+\'"\'};5(2f!==m&&2f!==p&&2f.z!=0){I+=" T=\'"+2f+"\'"};5(t!==""){I+=" 12=\'"+t+"\'"};I+=\' f="\'+3i+\'">\';I+=E+\'<1f 15="\'+g.1j+\'">\'+C+\'</1f>\';5(36!==""){I+=36};I+=\'</a>\';o I};3 4B=9(t){3 C=t.3J();5(C.z==0)o-1;3 a="";1n(3 i 2x F){3 4m=F[i].14.3J();5(4m.4X(0,C.z)==C){a+="#"+F[i].f+", "}};o(a=="")?-1:a};3 4R=9(){3 3h=3M;5(3h.z==0)o"";3 I="";3 5P=j("3K");3 3b=j("3H");3h.3O(9(1Q){3 1H=3h[1Q];5(1H.5Y.5V().3J()=="5F"){I+="<1g 15=\'5R\'>";I+="<1f T=\'4U-5S:5v;4U-T:5E;5A:5D;\'>"+$(1H).h("5t")+"</1f>";3 3Y=$(1H).4K();3Y.3O(9(2j){3 1b=3Y[2j];I+=2A(1b,1Q,2j,"1O")});I+="</1g>"}A{I+=2A(1H,1Q,"","")}});o I};3 4S=9(){3 f=j("1P");3 6=j("M");3 1w=n.T;L="";L+=\'<1g f="\'+6+\'" 15="\'+g.3W+\'"\';5(!V){L+=(1w!="")?\' T="\'+1w+\'"\':\'\'}A{L+=(1w!="")?\' T="2Z-1a:66 6y #6w;11:2G;U:33;\'+1w+\'"\':\'\'};L+=\'>\';o L};3 4V=9(){3 X=j("1v");3 1X=j("2V");3 18=j("2o");3 6q=j("4H");3 C="";3 E="";5(q(b).n.z>0){C=$("#"+b+" 2d:s").14();E=$("#"+b+" 2d:s").h("12")};3 Y="";3 t="";3 3k=35 4G(/^\\{.*\\}$/);3 2K=3k.4D(E);5(n.3S==l&&2K==l){5(E.z!=0){3 G=2b("["+E+"]");Y=(H G[0].2p=="p")?"":G[0].2p;t=(H G[0].12=="p")?"":G[0].12;E=(Y.z==0||n.1S==m||n.1z!=m)?"":\'<Y 2L="\'+Y+\'" 2M="2P" /> \'}}A{E=(E.z==0||E==p||n.1S==m||n.1z!=m)?"":\'<Y 2L="\'+E+\'" 2M="2P" /> \'};3 L=\'<1g f="\'+X+\'" 15="\'+g.3I+\'"\';L+=\'>\';L+=\'<1f f="\'+1X+\'" 15="\'+g.E+\'"></1f><1f 15="\'+g.1j+\'" f="\'+18+\'">\'+E+\'<1f 15="\'+g.1j+\'">\'+C+\'</1f></1f></1g>\';o L};3 3j=9(){3 6=j("M");$("#"+6+" a.3V").1m("1E");$("#"+6+" a.3V").J("1E",9(u){u.22();3D(c);21();5(!V){$("#"+6).1m("1s");1U(m);3 C=(n.1S==m)?$(c).14():$(c).1A();1I(C);$c.2H()}})};3 58=9(){3 34=m;3 f=j("1P");3 X=j("1v");3 18=j("2o");3 6=j("M");3 1X=j("2V");3 3P=$("#"+b).6t();3 1w=n.T;5($("#"+f).z>0){$("#"+f).3l();34=l};3 L=\'<1g f="\'+f+\'" 15="\'+g.1M+\'"\';L+=(1w!="")?\' T="\'+1w+\'"\':\'\';L+=\'>\';L+=4V();L+=4S();L+=4R();L+="</1g>";L+="</1g>";5(34==l){3 4N=j("3U");$("#"+4N).3G(L)}A{$("#"+b).3G(L)};5(V){3 X=j("1v");$("#"+X).2E()};$("#"+f).k("4O",3P+"19");$("#"+6).k("4O",(3P-2)+"19");5(3M.z>n.2J){3 4Q=2m($("#"+6+" a:3N").k("2r-5a"))+2m($("#"+6+" a:3N").k("2r-1a"));3 1u=((n.3z)*n.2J)-4Q;$("#"+6).k("D",1u+"19")}A 5(V){3 1u=$("#"+b).D();$("#"+6).k("D",1u+"19")};5(34==m){5l();4n(b)};5($("#"+b).h("W")==l){$("#"+f).k("2N",g.W)};4x();$("#"+X).J("1s",9(u){3q(1)});$("#"+X).J("1R",9(u){3q(0)});3j();$("#"+6+" a.W").k("2N",g.W);5(V){$("#"+6).J("1s",9(u){5(!R.2Q){R.2Q=l;$(Z).J("1W",9(u){3 S=u.S;R.2Y=S;5(S==39||S==40){u.22();u.2g();2c();21()};5(S==37||S==38){u.22();u.2g();2i();21()}})}})};$("#"+6).J("1R",9(u){1U(m);$(Z).1m("1W",3a);R.2Q=m;R.2Y=1d});$("#"+X).J("1E",9(u){1U(m);5($("#"+6+":1Z").z==1){$("#"+6).1m("1s")}A{$("#"+6).J("1s",9(u){1U(l)});$c.4F()}});$("#"+X).J("1R",9(4Z){1U(m)});5(n.1S&&n.1z!=m){2t()}};3 1i=9(B){1n(3 i 2x F){5(F[i].B==B){o F[i]}};o-1};3 3D=9(G){3 6=j("M");5($("#"+6+" a."+g.s).z==1){2w=$("#"+6+" a."+g.s).14()};5(!V){$("#"+6+" a."+g.s).1C(g.s)};3 O=$("#"+6+" a."+g.s).h("f");5(O!=p){3 1t=(R.1t==p||R.1t==1d)?F[O].B:R.1t};5(G&&!V){$(G).1k(g.s)};5(V){3 S=R.2Y;5($("#"+b).h("1e")==l){5(S==17){R.1t=F[$(G).h("f")].B;$(G).6v(g.s)}A 5(S==16){$("#"+6+" a."+g.s).1C(g.s);$(G).1k(g.s);3 4W=$(G).h("f");3 3Q=F[4W].B;1n(3 i=4e.6x(1t,3Q);i<=4e.6z(1t,3Q);i++){$("#"+1i(i).f).1k(g.s)}}A{$("#"+6+" a."+g.s).1C(g.s);$(G).1k(g.s);R.1t=F[$(G).h("f")].B}}A{$("#"+6+" a."+g.s).1C(g.s);$(G).1k(g.s);R.1t=F[$(G).h("f")].B}}};3 4n=9(f){3 3R=f;q(3R).6n=9(e){$("#"+3R).1N(n)}};3 1U=9(Q){R.41=Q};3 4T=9(){o R.41};3 4x=9(){3 1r=j("1P");3 3X=4t.4u.69(",");1n(3 32=0;32<3X.z;32++){3 2l=3X[32];3 4w=1V(2l);5(4w==l){3e(2l){N"2U":$("#"+1r).J("6o",9(u){q(b).2U()});P;N"1E":$("#"+1r).J("1E",9(u){$("#"+b).1q("1E")});P;N"2X":$("#"+1r).J("2X",9(u){$("#"+b).1q("2X")});P;N"2W":$("#"+1r).J("2W",9(u){$("#"+b).1q("2W")});P;N"1c":$("#"+1r).J("1c",9(u){$("#"+b).1q("1c")});P;N"1s":$("#"+1r).J("1s",9(u){$("#"+b).1q("1s")});P;N"2S":$("#"+1r).J("2S",9(u){$("#"+b).1q("2S")});P;N"1R":$("#"+1r).J("1R",9(u){$("#"+b).1q("1R")});P}}}};3 5l=9(){3 42=j("3U");$("#"+b).3G("<1g 15=\'"+g.1J+"\' T=\'D:3Z;4q:5h;U:31;\' f=\'"+42+"\'></1g>");$("#"+b).62($("#"+42))};3 1I=9(C){3 18=j("2o");$("#"+18).1A(C)};3 3n=9(w){3 3u=w;3 6=j("M");3 2R=$("#"+6+" a:1Z");3 43=2R.z;3 1o=$("#"+6+" a:1Z").B($("#"+6+" a.s:1Z"));3 2a;3e(3u){N"2c":5(1o<43-1){1o++;2a=2R[1o]};P;N"2i":5(1o<43&&1o>0){1o--;2a=2R[1o]};P};5(H(2a)=="p"){o m};$("#"+6+" a."+g.s).1C(g.s);$(2a).1k(g.s);3 O=2a.f;5(!V){3 C=(n.1S==m)?F[O].14:$("#"+O).1A();1I(C);2t(F[O].B)};5(3u=="2c"){5(2m(($("#"+O).U().1a+$("#"+O).D()))>=2m($("#"+6).D())){$("#"+6).2v(($("#"+6).2v())+$("#"+O).D()+$("#"+O).D())}}A{5(2m(($("#"+O).U().1a+$("#"+O).D()))<=0){$("#"+6).2v(($("#"+6).2v()-$("#"+6).D())-$("#"+O).D())}}};3 2c=9(){3n("2c")};3 2i=9(){3n("2i")};3 2t=9(i){5(n.1z!=m){3 18=j("2o");3 B=(H(i)=="p")?q(b).K:i;3 3o=q(b).n[B].5q;5(3o.z>0){3 6=j("M");3 f=$("#"+6+" a."+3o).h("f");3 3p=$("#"+f).k("1T-2p");3 1D=$("#"+f).k("1T-U");5(1D==p){1D=$("#"+f).k("1T-U-x")+" "+$("#"+f).k("1T-U-y")};3 3v=$("#"+f).k("2r-54");5(3p!=p){$("#"+18).2n("."+g.1j).2z(\'T\',"1T:"+3p)};5(1D!=p){$("#"+18).2n("."+g.1j).k(\'1T-U\',1D)};5(3v!=p){$("#"+18).2n("."+g.1j).k(\'2r-54\',3v)};$("#"+18).2n("."+g.1j).k(\'1T-50\',\'6j-50\');$("#"+18).2n("."+g.1j).k(\'2r-5a\',\'6k\')}}};3 21=9(){3 6=j("M");3 2h=$("#"+6+" a."+g.s);5(2h.z==1){3 C=$("#"+6+" a."+g.s).14();3 O=$("#"+6+" a."+g.s).h("f");5(O!=p){3 2F=F[O].2D;q(b).K=F[O].B};5(n.1S&&n.1z!=m)2t()}A 5(2h.z>1){1n(3 i=0;i<2h.z;i++){3 O=$(2h[i]).h("f");3 B=F[O].B;q(b).n[B].s="s"}};3 57=q(b).K;$c.1Y["K"]=57};3 1V=9(3A){5($("#"+b).h("6l"+3A)!=p){o l};3 3B=$("#"+b).3L("6m");5(3B&&3B[3A]){o l};o m};3 3x=9(4Z){$("#"+b).2U();$("#"+b)[0].3F();21();$(Z).1m("1c",3d);$(Z).1m("1c",3x)};3 5n=9(){3 6=j("M");5(1V(\'3y\')==l){3 5f=F[$("#"+6+" a.s").h("f")].14;5($.51(2w)!==$.51(5f)&&2w!==""){$("#"+b).1q("3y")}};5(1V(\'1c\')==l){$("#"+b).1q("1c")};5(1V(\'3F\')==l){$(Z).J("1c",3x)};o m};3 3q=9(5o){3 1X=j("2V");5(5o==1)$("#"+1X).k({1D:\'0 6g%\'});A $("#"+1X).k({1D:\'0 0\'})};3 5b=9(){1n(3 i 2x q(b)){5(H(q(b)[i])!==\'9\'&&H(q(b)[i])!=="p"&&H(q(b)[i])!=="1d"){$c.1p(i,q(b)[i],l)}}};3 5p=9(h,Q){5(1i(Q)!=-1){q(b)[h]=Q;3 6=j("M");$("#"+6+" a."+g.s).1C(g.s);$("#"+1i(Q).f).1k(g.s);3 C=1i(q(b).K).1A;1I(C)}};3 4E=9(i,2l){5(2l==\'d\'){1n(3 2k 2x F){5(F[2k].B==i){6f F[2k];P}}};3 4i=0;1n(3 2k 2x F){F[2k].B=4i;4i++}};3 3m=9(){3 6=j("M");3 4g=j("1P");3 5r=$("#"+4g).6i();3 44=$("#"+4g).D();3 4Y=$(55).D();3 52=$(55).2v();3 48=$("#"+6).D();3 k={1K:n.1K,1a:(44)+"19",11:"28"};3 2q=n.53;3 25=m;3 1F=g.2T;$("#"+6).1C(g.2T);$("#"+6).1C(g.1F);5((4Y+52)<4e.6c(48+44+5r.1a)){3 2y=48;k={1K:n.1K,1a:"-"+2y+"19",11:"28"};2q="24";25=l;1F=g.1F};o{25:25,2q:2q,k:k,2Z:1F}};3 4k=9(){5($c.1L["5i"]!=1d){2b($c.1L["5i"])($c)}};3 4c=9(){5n();5($c.1L["5m"]!=1d){2b($c.1L["5m"])($c)}};3 3a=9(u){3 6=j("M");3 S=u.S;5(S==8){u.22();u.2g();1x=(1x.z==0)?"":1x.4X(0,1x.z-1)};3e(S){N 39:N 40:u.22();u.2g();2c();P;N 37:N 38:u.22();u.2g();2i();P;N 27:N 13:$c.2H();21();P;4s:5(S>46){1x+=6r.6s(S)};3 4b=4B(1x);5(4b!=-1){$("#"+6).k({D:\'60\'});$("#"+6+" a").2E();$(4b).24();3 1h=3m();$("#"+6).k(1h.k);$("#"+6).k({11:\'2G\'})}A{$("#"+6+" a").24();$("#"+6).k({D:2u+\'19\'})};P};5(1V("1W")==l){q(b).6u()};o m};3 3d=9(u){5(4T()==m){$c.2H()};o m};3 4a=9(u){5($("#"+b).h("4L")!=p){q(b).4L()};o m};c.4F=9(){5(($c.29("W",l)==l)||($c.29("n",l).z==0))o;3 6=j("M");5(1G!=""&&6!=1G){$("#"+1G).4J("4j");$("#"+1G).k({1K:\'0\'})};5($("#"+6).k("11")=="28"){2w=F[$("#"+6+" a.s").h("f")].14;1x="";2u=$("#"+6).D();$("#"+6+" a").24();$(Z).J("1W",3a);$(Z).J("47",4a);$(Z).J("1c",3d);3 1h=3m();$("#"+6).k(1h.k);5(1h.25==l){$("#"+6).k({11:\'2G\'});$("#"+6).1k(1h.2Z);4k()}A{$("#"+6)[1h.2q]("4j",9(){$("#"+6).1k(1h.2Z);4k()})};5(6!=1G){1G=6}}};c.2H=9(){3 6=j("M");5(!$("#"+6).1B(":1Z")||2s)o;2s=l;5($("#"+6).k("11")=="28"){o m};3 1a=$("#"+j("1v")).U().1a;3 1h=3m();4C=m;5(1h.25==l){$("#"+6).5M({D:0,1a:1a},9(){$("#"+6).k({D:2u+\'19\',11:\'28\'});4c();2s=m})}A{$("#"+6).4J("4j",9(u){4c();$("#"+6).k({1K:\'0\'});$("#"+6).k({D:2u+\'19\'});2s=m})};2t();$(Z).1m("1W",3a);$(Z).1m("47",4a);$(Z).1m("1c",3d)};c.K=9(i){5(H(i)=="p"){o $c.29("K")}A{$c.1p("K",i)}};c.4P=9(1B){5(H(1B)=="p"||1B==l){$("."+g.1J).5G("T")}A{$("."+g.1J).2z("T","D:3Z;4q:5h;U:31")}};c.1p=9(h,Q,2O){5(H h=="p"||H Q=="p")o m;$c.1Y[h]=Q;5(2O!=l){3e(h){N"K":5p(h,Q);P;N"W":$c.W(Q,l);P;N"1e":q(b)[h]=Q;V=($(10).h("1l")>0||$(10).h("1e")==l)?l:m;5(V){3 1u=$("#"+b).D();3 6=j("M");$("#"+6).k("D",1u+"19");3 X=j("1v");$("#"+X).2E();3 6=j("M");$("#"+6).k({11:\'2G\',U:\'33\'});3j()};P;N"1l":q(b)[h]=Q;5(Q==0){q(b).1e=m};V=($(10).h("1l")>0||$(10).h("1e")==l)?l:m;5(Q==0){3 X=j("1v");$("#"+X).24();3 6=j("M");$("#"+6).k({11:\'28\',U:\'31\'});3 C="";5(q(b).K>=0){3 49=1i(q(b).K);C=49.1A;3D($("#"+49.f))};1I(C)}A{3 X=j("1v");$("#"+X).2E();3 6=j("M");$("#"+6).k({11:\'2G\',U:\'33\'})};P;4s:4I{q(b)[h]=Q}4z(e){};P}}};c.29=9(h,3c){5(h==p&&3c==p){o $c.1Y};5(h!=p&&3c==p){o($c.1Y[h]!=p)?$c.1Y[h]:1d};5(h!=p&&3c!=p){o q(b)[h]}};c.1Z=9(Q){3 f=j("1P");5(Q==l){$("#"+f).24()}A 5(Q==m){$("#"+f).2E()}A{o $("#"+f).k("11")}};c.5Q=9(1O,B){3 1y=1O;3 C=1y.14;3 2F=(1y.2D==p||1y.2D==1d)?C:1y.2D;3 Y=(1y["12"]==p||1y["12"]==1d)?\'\':1y["12"];3 i=(B==p||B==1d)?q(b).n.z:B;q(b).n[i]=35 5W(C,2F);5(Y!=\'\')q(b).n[i]["12"]=Y;3 4d=1i(i);5(4d!=-1){3 I=2A(q(b).n[i],i,"","");$("#"+4d.f).1A(I)}A{3 I=2A(q(b).n[i],i,"","");3 6=j("M");$("#"+6).6p(I);3j()}};c.3l=9(i){q(b).3l(i);5((1i(i))!=-1){$("#"+1i(i).f).3l();4E(i,\'d\')};5(q(b).z==0){1I("")}A{3 C=1i(q(b).K).1A;1I(C)};$c.1p("K",q(b).K)};c.W=9(2B,2O){q(b).W=2B;3 f=j("1P");5(2B==l){$("#"+f).k("2N",g.W);$c.2H()}A 5(2B==m){$("#"+f).k("2N",1)};5(2O!=l){$c.1p("W",2B)}};c.45=9(){o(q(b).45==p)?1d:q(b).45};c.4f=9(){5(2C.z==1){o q(b).4f(2C[0])}A 5(2C.z==2){o q(b).4f(2C[0],2C[1])}A{67{68:"6a B 1B 63!"}}};c.5c=9(26){o q(b).5c(26)};c.1e=9(1B){5(H(1B)=="p"){o $c.29("1e")}A{$c.1p("1e",1B)}};c.1l=9(4h){5(H(4h)=="p"){o $c.29("1l")}A{$c.1p("1l",4h)}};c.6h=9(26,2I){$c.1L[26]=2I};c.6d=9(26){2b($c.1L[26])($c)};c.6e=9(r){5(H r=="p"||r==0){o m};3 6=j("M");3 3E=$("#"+6+" a:3N").D();3 59=(3E==0)?n.3z:3E;3 1u=r*59;$("#"+6).k("D",1u+"19")};3 5d=9(){$c.1p("3w",$.1N.3w);$c.1p("3t",$.1N.3t)};3 56=9(){58();5b();5d();5(n.3C!=\'\'){2b(n.3C)($c)}};56()};$.1N={3w:\'2.38.4\',3t:"6b 61",5j:20,4P:9(v){5(v==l){$(".1J").k({D:\'65\',U:\'33\'})}A{$(".1J").k({D:\'3Z\',U:\'31\'})}},6A:9(f,1O){o $(f).1N(1O).3L("1M")}};$.2I.4p({1N:9(n){o c.3O(9(){3 4M=35 1M(c,n);$(c).3L(\'1M\',4M)})}});5(H($.2I.h)==\'p\'){$.2I.h=9(w,v){5(H v=="p"){o $(c).2z(w)};4I{$(c).2z(w,v)}4z(e){}}}})(64);',62,409,'|||var||if|childid|||function||elementid|this|||id|styles|prop||getPostID|css|true|false|options|return|undefined|getElement||selected||event|||||length|else|index|sText|height|arrow|a_array|obj|typeof|aTag|bind|selectedIndex|sDiv|postChildID|case|selectedA|break|val|actionSettings|keyCode|style|position|ddList|disabled|titleid|img|document|sElement|display|title||text|class|||titletextid|px|top|currentOptOption|mouseup|null|multiple|span|div|wf|getByIndex|ddTitleText|addClass|size|unbind|for|currentP|set|trigger|mainid|mouseover|oldIndex|iHeight|postTitleID|sStyle|inputText|objOpt|useSprite|html|is|removeClass|backgroundPosition|click|borderTop|msOldDiv|currentOption|setTitleText|ddOutOfVision|zIndex|onActions|dd|msDropDown|opt|postID|current|mouseout|showIcon|background|setInsideWindow|has_handler|keydown|arrowid|ddProp|visible||setValue|preventDefault||show|opp|nm||none|get|nextA|eval|next|option|ele|innerStyle|stopPropagation|allSelected|previous|currentopt|key|action|parseInt|find|postTitleTextID|image|ani|padding|isClosing|setTitleImageSprite|oldHeight|scrollTop|oldSelectedValue|in|tp|attr|createA|dis|arguments|value|hide|sValue|block|close|fn|visibleRows|isJson|src|align|opacity|isLocal|absmiddle|keyboardAction|visibleA|mousemove|noBorderTop|focus|postArrowID|mousedown|dblclick|currentKey|border||absolute|iCount|relative|changeInsertionPoint|new|pH||||d_onkeydown|aidoptfix|forceRefresh|d_onmouseup|switch|cacheElement|clsName|childnodes|aid|applyEventsOnA|reg|remove|shouldOpenOpposite|navigateA|sClassName|backgroundImg|hightlightArrow|inlineCSS|_|author|where|paddingLeft|version|blur_m|change|rowHeight|name|evs|onInit|manageSelection|fc|blur|after|postOPTAID|ddTitle|toLowerCase|postAID|data|allOptions|first|each|iWidth|currentIndex|objid|jsonTitle|sEnabledClass|postElementHolder|enabled|ddChild|actions_array|optChild|0px||insideWindow|sId|totalA|mH|form||keyup|cH|aObj|d_onkeyup|ind|fireCloseEvent|ifA|Math|item|main|sz|count|fast|fireOpenEvent|getOptionsProperties|a_text|addRefreshMethods|postHTML|extend|overflow|matchIndex|default|attributes|actions|javascript|actionFound|applyEvents|void|catch|href|in_array|isFilter|test|addRemoveFromIndex|open|RegExp|postInputhidden|try|slideUp|children|onkeyup|mydropdown|sid|width|debug|margin|createATags|createChildDiv|getInsideWindow|font|createTitleDiv|currentSelected|substr|wH|evt|repeat|trim|st|animStyle|left|window|init|sIndex|createDropDown|dh|bottom|setOriginalProperties|namedItem|updateCommonVars|mainCSS|currentSelectedValue|config|hidden|onOpen|counter|element|setOutOfVision|onClose|checkMethodAndApply|ison|setValueByIndex|className|pos|slideDown|label|_title|bold|_msdd|_child|9999|_msddHolder|clear|120|_titletext|both|italic|optgroup|removeAttr|_inp|_arrow|_msinput|keypress|tabindex|animate|getElementById|msdrpdd|aidfix|add|opta|weight|_msopta|cssText|toString|Option|postInputID|nodeName|_msa|auto|Suleman|appendTo|required|jQuery|20px|1px|throw|message|split|An|Marghoob|floor|fireEvent|showRows|delete|100|addMyEvent|offset|no|2px|on|events|refresh|mouseenter|append|inputhidden|String|fromCharCode|outerWidth|onkeydown|toggleClass|c3c3c3|min|solid|max|create'.split('|')))
@@ -0,0 +1,1110 @@
1
+ // MSDropDown - uncompressed.jquery.dd
2
+ // author: Marghoob Suleman - Search me on google
3
+ // Date: 12th Aug, 2009
4
+ // Version: 2.38.4
5
+ // Revision: 38
6
+ // web: www.giftlelo.com | www.marghoobsuleman.com
7
+ /*
8
+ // msDropDown is free jQuery Plugin: you can redistribute it and/or modify
9
+ // it under the terms of the either the MIT License or the Gnu General Public License (GPL) Version 2
10
+ */
11
+ (function($) {
12
+
13
+ var msOldDiv = "";
14
+ var dd = function(element, options)
15
+ {
16
+ var sElement = element;
17
+ var $this = this; //parent this
18
+ options = $.extend({
19
+ height:120,
20
+ visibleRows:7,
21
+ rowHeight:23,
22
+ showIcon:true,
23
+ zIndex:9999,
24
+ mainCSS:'dd',
25
+ useSprite:false,
26
+ animStyle:'slideDown',
27
+ onInit:'',
28
+ jsonTitle:true,
29
+ style:''
30
+ }, options);
31
+ this.ddProp = {};//storing propeties;
32
+ var oldSelectedValue = "";
33
+ var actionSettings ={};
34
+ actionSettings.insideWindow = true;
35
+ actionSettings.keyboardAction = false;
36
+ actionSettings.currentKey = null;
37
+ var ddList = false;
38
+ var config = {postElementHolder:'_msddHolder', postID:'_msdd', postTitleID:'_title',postTitleTextID:'_titletext',postChildID:'_child',postAID:'_msa',postOPTAID:'_msopta',postInputID:'_msinput', postArrowID:'_arrow', postInputhidden:'_inp'};
39
+ var styles = {dd:options.mainCSS, ddTitle:'ddTitle', arrow:'arrow', ddChild:'ddChild', ddTitleText:'ddTitleText', disabled:0.30, ddOutOfVision:'ddOutOfVision', borderTop:'borderTop', noBorderTop:'noBorderTop', selected:'selected'};
40
+ var attributes = {actions:"focus,blur,change,click,dblclick,mousedown,mouseup,mouseover,mousemove,mouseout,keypress,keydown,keyup", prop:"size,multiple,disabled,tabindex"};
41
+ this.onActions = {};
42
+ var elementid = $(sElement).prop("id");
43
+ if(typeof(elementid)=="undefined" || elementid.length<=0) {
44
+ //assign and id;
45
+ elementid = "msdrpdd"+$.msDropDown.counter++;//I guess it makes unique for the page.
46
+ $(sElement).attr("id", elementid);
47
+ }
48
+ var inlineCSS = $(sElement).prop("style");
49
+ options.style += (inlineCSS===undefined) ? "" : inlineCSS;
50
+ var allOptions = $(sElement).children();
51
+ ddList = ($(sElement).prop("size")>1 || $(sElement).prop("multiple")===true) ? true : false;
52
+ if(ddList) {options.visibleRows = $(sElement).prop("size");}
53
+ var a_array = {};//stores id, html & value etc
54
+ var currentP = 0;
55
+ var isFilter = false;
56
+ var oldHeight;
57
+ var isClosing = false;
58
+ var cacheElement = {};
59
+ var inputText = "";
60
+ var selectedItem;
61
+
62
+ var getElement = function(ele) {
63
+ if(typeof(cacheElement[ele])=="undefined") {
64
+ cacheElement[ele] = document.getElementById(ele);
65
+ }
66
+ return cacheElement[ele];
67
+ };
68
+ var getPostID = function (id) {
69
+ return elementid+config[id];
70
+ };
71
+ var getOptionsProperties = function (option) {
72
+ var currentOption = option;
73
+ var styles = $(currentOption).prop("style");
74
+ return (typeof styles=="undefined") ? "" : styles.cssText;
75
+ };
76
+ var matchIndex = function (index) {
77
+ // For performance, store last selected item once in a local variable rather than looking it up
78
+ // everytime matchIndex is called
79
+ if (typeof this.selectedItem === 'undefined')
80
+ this.selectedItem = $("#" + elementid + " option:selected");
81
+ if (this.selectedItem.length > 1) {
82
+ for (var i = 0; i < this.selectedItem.length; i++) {
83
+ if (index == this.selectedItem[i].index) {
84
+ return true;
85
+ };
86
+ };
87
+ } else if (this.selectedItem.length == 1) {
88
+ if (this.selectedItem[0].index == index) {
89
+ return true;
90
+ };
91
+ };
92
+ return false;
93
+ };
94
+ var createA = function(currentOptOption, current, currentopt, tp) {
95
+ var aTag = "";
96
+ //var aidfix = getPostID("postAID");
97
+ var aidoptfix = (tp=="opt") ? getPostID("postOPTAID") : getPostID("postAID");
98
+ var aid = (tp=="opt") ? aidoptfix+"_"+(current)+"_"+(currentopt) : aidoptfix+"_"+(current);
99
+ var arrow = "";
100
+ var t = "";
101
+ var clsName = "";
102
+ var pH = ""; //addition html
103
+ if(options.useSprite!=false) {
104
+ clsName = ' '+options.useSprite+' '+currentOptOption.className;
105
+ } else {
106
+ arrow = $(currentOptOption).prop("title");
107
+ var reg = new RegExp(/^\{.*\}$/);
108
+ var isJson = reg.test(arrow);
109
+ if(options.jsonTitle==true && isJson==true) {
110
+ if(arrow.length!=0) {
111
+ var obj = eval("["+arrow+"]");
112
+ img = (typeof obj[0].image=="undefined") ? "" : obj[0].image;
113
+ t = (typeof obj[0].title=="undefined") ? "" : obj[0].title;
114
+ pH = (typeof obj[0].postHTML=="undefined") ? "" : obj[0].postHTML;
115
+ arrow = (img.length==0) ? "" : '<img src="'+img+'" align="absmiddle" /> ';
116
+ };
117
+ } else {
118
+ arrow = (arrow.length==0) ? "" : '<img src="'+arrow+'" align="absmiddle" /> ';
119
+ };
120
+ };
121
+ var sText = $(currentOptOption).text();
122
+ var sValue = $(currentOptOption).val();
123
+ var sEnabledClass = ($(currentOptOption).prop("disabled")==true) ? "disabled" : "enabled";
124
+ a_array[aid] = {html:arrow + sText, value:sValue, text:sText, index:currentOptOption.index, id:aid, title:t};
125
+ var innerStyle = getOptionsProperties(currentOptOption);
126
+ if(matchIndex(currentOptOption.index)==true) {
127
+ aTag += '<a href="javascript:void(0);" class="'+styles.selected+' '+sEnabledClass+clsName+'"';
128
+ } else {
129
+ aTag += '<a href="javascript:void(0);" class="'+sEnabledClass+clsName+'"';
130
+ };
131
+ if(innerStyle!==false && innerStyle!==undefined && innerStyle.length!=0) {
132
+ aTag += " style='"+innerStyle+"'";
133
+ };
134
+ if(t!=="") {
135
+ aTag += " title='"+t+"'";
136
+ };
137
+ aTag += ' id="'+aid+'">';
138
+ aTag += arrow + '<span class="'+styles.ddTitleText+'">' +sText+'</span>';
139
+ if(pH!=="") {
140
+ aTag += pH;
141
+ };
142
+ aTag += '</a>';
143
+ return aTag;
144
+ };
145
+ var in_array = function(t) {
146
+ var sText = t.toLowerCase();
147
+ if(sText.length==0) return -1;
148
+ var a = "";
149
+ for(var i in a_array) {
150
+ var a_text = a_array[i].text.toLowerCase();
151
+ if(a_text.substr(0, sText.length) == sText) {
152
+ a += "#"+a_array[i].id+ ", ";
153
+ };
154
+ };
155
+ return (a=="") ? -1 : a;
156
+ };
157
+ var createATags = function () {
158
+ var childnodes = allOptions;
159
+ if(childnodes.length==0) return "";
160
+ var aTag = "";
161
+ var aidfix = getPostID("postAID");
162
+ var aidoptfix = getPostID("postOPTAID");
163
+ childnodes.each(function(current){
164
+ var currentOption = childnodes[current];
165
+ //OPTGROUP
166
+ if(currentOption.nodeName.toString().toLowerCase() == "optgroup") {
167
+ aTag += "<div class='opta'>";
168
+ aTag += "<span style='font-weight:bold;font-style:italic;clear:both;'>"+$(currentOption).prop("label")+"</span>";
169
+ var optChild = $(currentOption).children();
170
+ optChild.each(function(currentopt){
171
+ var currentOptOption = optChild[currentopt];
172
+ aTag += createA(currentOptOption, current, currentopt, "opt");
173
+ });
174
+ aTag += "</div>";
175
+
176
+ } else {
177
+ aTag += createA(currentOption, current, "", "");
178
+ };
179
+ });
180
+ return aTag;
181
+ };
182
+ var createChildDiv = function () {
183
+ var id = getPostID("postID");
184
+ var childid = getPostID("postChildID");
185
+ var sStyle = options.style;
186
+ sDiv = "";
187
+ sDiv += '<div id="'+childid+'" class="'+styles.ddChild+'"';
188
+ if(!ddList) {
189
+ sDiv += (sStyle!="") ? ' style="'+sStyle+'"' : '';
190
+ } else {
191
+ sDiv += (sStyle!="") ? ' style="border-top:1px solid #c3c3c3;display:block;position:relative;'+sStyle+'"' : '';
192
+ };
193
+ sDiv += '>';
194
+ return sDiv;
195
+ };
196
+
197
+ var createTitleDiv = function () {
198
+ var titleid = getPostID("postTitleID");
199
+ var arrowid = getPostID("postArrowID");
200
+ var titletextid = getPostID("postTitleTextID");
201
+ var inputhidden = getPostID("postInputhidden");
202
+ var sText = "";
203
+ var arrow = "";
204
+ if(getElement(elementid).options.length>0) {
205
+ sText = $("#"+elementid+" option:selected").text();
206
+ arrow = $("#"+elementid+" option:selected").prop("title");
207
+ };
208
+ var img = "";
209
+ var t = "";
210
+ var reg = new RegExp(/^\{.*\}$/);
211
+ var isJson = reg.test(arrow);
212
+ if(options.jsonTitle==true && isJson==true) {
213
+ if(arrow.length!=0) {
214
+ var obj = eval("["+arrow+"]");
215
+ img = (typeof obj[0].image=="undefined") ? "" : obj[0].image;
216
+ t = (typeof obj[0].title=="undefined") ? "" : obj[0].title;
217
+ arrow = (img.length==0 || options.showIcon==false || options.useSprite!=false) ? "" : '<img src="'+img+'" align="absmiddle" /> ';
218
+ };
219
+ } else {
220
+ arrow = (arrow.length==0 || arrow==undefined || options.showIcon==false || options.useSprite!=false) ? "" : '<img src="'+arrow+'" align="absmiddle" /> ';
221
+ };
222
+ var sDiv = '<div id="'+titleid+'" class="'+styles.ddTitle+'"';
223
+ sDiv += '>';
224
+ sDiv += '<span id="'+arrowid+'" class="'+styles.arrow+'"></span><span class="'+styles.ddTitleText+'" id="'+titletextid+'">'+arrow + '<span class="'+styles.ddTitleText+'">'+sText+'</span></span></div>';
225
+ return sDiv;
226
+ };
227
+ var applyEventsOnA = function() {
228
+ var childid = getPostID("postChildID");
229
+ $("#"+childid+ " a.enabled").unbind("click"); //remove old one
230
+ $("#"+childid+ " a.enabled").bind("click", function(event) {
231
+ event.preventDefault();
232
+ manageSelection(this);
233
+ setValue();
234
+ if(!ddList) {
235
+ $("#"+childid).unbind("mouseover");
236
+ setInsideWindow(false);
237
+ var sText = (options.showIcon==false) ? $(this).text() : $(this).html();
238
+ setTitleText(sText);
239
+ //$this.data("dd").close();
240
+ $this.close();
241
+ };
242
+ //actionSettings.oldIndex = a_array[$($this).prop("id")].index;
243
+ });
244
+ };
245
+ var createDropDown = function () {
246
+ var changeInsertionPoint = false;
247
+ var id = getPostID("postID");
248
+ var titleid = getPostID("postTitleID");
249
+ var titletextid = getPostID("postTitleTextID");
250
+ var childid = getPostID("postChildID");
251
+ var arrowid = getPostID("postArrowID");
252
+ var iWidth = $("#"+elementid).outerWidth();
253
+ var sStyle = options.style;
254
+ if($("#"+id).length>0) {
255
+ $("#"+id).remove();
256
+ changeInsertionPoint = true;
257
+ };
258
+ var sDiv = '<div id="'+id+'" class="'+styles.dd+'"';
259
+ sDiv += (sStyle!="") ? ' style="'+sStyle+'"' : '';
260
+ sDiv += '>';
261
+ //create title bar
262
+ sDiv += createTitleDiv();
263
+ //create child
264
+ sDiv += createChildDiv();
265
+ sDiv += createATags();
266
+ sDiv += "</div>";
267
+ sDiv += "</div>";
268
+ if(changeInsertionPoint==true) {
269
+ var sid =getPostID("postElementHolder");
270
+ $("#"+sid).after(sDiv);
271
+ } else {
272
+ $("#"+elementid).after(sDiv);
273
+ };
274
+ if(ddList) {
275
+ var titleid = getPostID("postTitleID");
276
+ $("#"+titleid).hide();
277
+ };
278
+
279
+ $("#"+id).css("width", iWidth+"px");
280
+ $("#"+childid).css("width", (iWidth-2)+"px");
281
+ if(allOptions.length>options.visibleRows) {
282
+ var margin = parseInt($("#"+childid+" a:first").css("padding-bottom")) + parseInt($("#"+childid+" a:first").css("padding-top"));
283
+ var iHeight = ((options.rowHeight)*options.visibleRows) - margin;
284
+ $("#"+childid).css("height", iHeight+"px");
285
+ } else if(ddList) {
286
+ var iHeight = $("#"+elementid).height();
287
+ $("#"+childid).css("height", iHeight+"px");
288
+ };
289
+ //set out of vision
290
+ if(changeInsertionPoint==false) {
291
+ setOutOfVision();
292
+ addRefreshMethods(elementid);
293
+ };
294
+ if($("#"+elementid).prop("disabled")==true) {
295
+ $("#"+id).css("opacity", styles.disabled);
296
+ };
297
+ applyEvents();
298
+ //add events
299
+ //arrow hightlight
300
+ $("#"+titleid).bind("mouseover", function(event) {
301
+ hightlightArrow(1);
302
+ });
303
+ $("#"+titleid).bind("mouseout", function(event) {
304
+ hightlightArrow(0);
305
+ });
306
+ //open close events
307
+ applyEventsOnA();
308
+ $("#"+childid+ " a.disabled").css("opacity", styles.disabled);
309
+ //alert("ddList "+ddList)
310
+ if(ddList) {
311
+ $("#"+childid).bind("mouseover", function(event) {if(!actionSettings.keyboardAction) {
312
+ actionSettings.keyboardAction = true;
313
+ $(document).bind("keydown", function(event) {
314
+ var keyCode = event.keyCode;
315
+ actionSettings.currentKey = keyCode;
316
+ if(keyCode==39 || keyCode==40) {
317
+ //move to next
318
+ event.preventDefault(); event.stopPropagation();
319
+ next();
320
+ setValue();
321
+ };
322
+ if(keyCode==37 || keyCode==38) {
323
+ event.preventDefault(); event.stopPropagation();
324
+ //move to previous
325
+ previous();
326
+ setValue();
327
+ };
328
+ });
329
+
330
+ }});
331
+ };
332
+ $("#"+childid).bind("mouseout", function(event) {setInsideWindow(false);$(document).unbind("keydown", d_onkeydown);actionSettings.keyboardAction = false;actionSettings.currentKey=null;});
333
+ $("#"+titleid).bind("click", function(event) {
334
+ setInsideWindow(false);
335
+ if($("#"+childid+":visible").length==1) {
336
+ $("#"+childid).unbind("mouseover");
337
+ } else {
338
+ $("#"+childid).bind("mouseover", function(event) {setInsideWindow(true);});
339
+ //alert("open "+elementid + $this);
340
+ //$this.data("dd").openMe();
341
+ $this.open();
342
+ };
343
+ });
344
+ $("#"+titleid).bind("mouseout", function(evt) {
345
+ setInsideWindow(false);
346
+ });
347
+ if(options.showIcon && options.useSprite!=false) {
348
+ setTitleImageSprite();
349
+ };
350
+ };
351
+ var getByIndex = function (index) {
352
+ for(var i in a_array) {
353
+ if(a_array[i].index==index) {
354
+ return a_array[i];
355
+ };
356
+ };
357
+ return -1;
358
+ };
359
+ var manageSelection = function (obj) {
360
+ var childid = getPostID("postChildID");
361
+ if($("#"+childid+ " a."+styles.selected).length==1) { //check if there is any selected
362
+ oldSelectedValue = $("#"+childid+ " a."+styles.selected).text(); //i should have value here. but sometime value is missing
363
+ //alert("oldSelectedValue "+oldSelectedValue);
364
+ };
365
+ if(!ddList) {
366
+ $("#"+childid+ " a."+styles.selected).removeClass(styles.selected);
367
+ };
368
+ var selectedA = $("#"+childid + " a."+styles.selected).prop("id");
369
+ if(selectedA!=undefined) {
370
+ var oldIndex = (actionSettings.oldIndex==undefined || actionSettings.oldIndex==null) ? a_array[selectedA].index : actionSettings.oldIndex;
371
+ };
372
+ if(obj && !ddList) {
373
+ $(obj).addClass(styles.selected);
374
+ };
375
+ if(ddList) {
376
+ var keyCode = actionSettings.currentKey;
377
+ if($("#"+elementid).prop("multiple")==true) {
378
+ if(keyCode == 17) {
379
+ //control
380
+ actionSettings.oldIndex = a_array[$(obj).prop("id")].index;
381
+ $(obj).toggleClass(styles.selected);
382
+ //multiple
383
+ } else if(keyCode==16) {
384
+ $("#"+childid+ " a."+styles.selected).removeClass(styles.selected);
385
+ $(obj).addClass(styles.selected);
386
+ //shift
387
+ var currentSelected = $(obj).prop("id");
388
+ var currentIndex = a_array[currentSelected].index;
389
+ for(var i=Math.min(oldIndex, currentIndex);i<=Math.max(oldIndex, currentIndex);i++) {
390
+ $("#"+getByIndex(i).id).addClass(styles.selected);
391
+ };
392
+ } else {
393
+ $("#"+childid+ " a."+styles.selected).removeClass(styles.selected);
394
+ $(obj).addClass(styles.selected);
395
+ actionSettings.oldIndex = a_array[$(obj).prop("id")].index;
396
+ };
397
+ } else {
398
+ $("#"+childid+ " a."+styles.selected).removeClass(styles.selected);
399
+ $(obj).addClass(styles.selected);
400
+ actionSettings.oldIndex = a_array[$(obj).prop("id")].index;
401
+ };
402
+ //isSingle
403
+ };
404
+ };
405
+ var addRefreshMethods = function (id) {
406
+ //deprecated
407
+ var objid = id;
408
+ getElement(objid).refresh = function(e) {
409
+ $("#"+objid).msDropDown(options);
410
+ };
411
+ };
412
+ var setInsideWindow = function (val) {
413
+ actionSettings.insideWindow = val;
414
+ };
415
+ var getInsideWindow = function () {
416
+ return actionSettings.insideWindow;
417
+ //will work on this
418
+ /*
419
+ var childid = getPostID("postChildID");
420
+ return ($("#"+childid + ":visible").length == 0) ? false : true;
421
+ */
422
+ };
423
+ var applyEvents = function () {
424
+ var mainid = getPostID("postID");
425
+ var actions_array = attributes.actions.split(",");
426
+ for(var iCount=0;iCount<actions_array.length;iCount++) {
427
+ var action = actions_array[iCount];
428
+ //var actionFound = $("#"+elementid).prop(action);
429
+ var actionFound = has_handler(action);
430
+ if(actionFound==true) {
431
+ switch(action) {
432
+ case "focus":
433
+ $("#"+mainid).bind("mouseenter", function(event) {
434
+ getElement(elementid).focus();
435
+ //$("#"+elementid).focus();
436
+ });
437
+ break;
438
+ case "click":
439
+ $("#"+mainid).bind("click", function(event) {
440
+ //getElement(elementid).onclick();
441
+ $("#"+elementid).trigger("click");
442
+ });
443
+ break;
444
+ case "dblclick":
445
+ $("#"+mainid).bind("dblclick", function(event) {
446
+ //getElement(elementid).ondblclick();
447
+ $("#"+elementid).trigger("dblclick");
448
+ });
449
+ break;
450
+ case "mousedown":
451
+ $("#"+mainid).bind("mousedown", function(event) {
452
+ //getElement(elementid).onmousedown();
453
+ $("#"+elementid).trigger("mousedown");
454
+ });
455
+ break;
456
+ case "mouseup":
457
+ //has in close mthod
458
+ $("#"+mainid).bind("mouseup", function(event) {
459
+ //getElement(elementid).onmouseup();
460
+ $("#"+elementid).trigger("mouseup");
461
+ //setValue();
462
+ });
463
+ break;
464
+ case "mouseover":
465
+ $("#"+mainid).bind("mouseover", function(event) {
466
+ //getElement(elementid).onmouseover();
467
+ $("#"+elementid).trigger("mouseover");
468
+ });
469
+ break;
470
+ case "mousemove":
471
+ $("#"+mainid).bind("mousemove", function(event) {
472
+ //getElement(elementid).onmousemove();
473
+ $("#"+elementid).trigger("mousemove");
474
+ });
475
+ break;
476
+ case "mouseout":
477
+ $("#"+mainid).bind("mouseout", function(event) {
478
+ //getElement(elementid).onmouseout();
479
+ $("#"+elementid).trigger("mouseout");
480
+ });
481
+ break;
482
+ };
483
+ };
484
+ };
485
+
486
+ };
487
+ var setOutOfVision = function () {
488
+ var sId = getPostID("postElementHolder");
489
+ $("#"+elementid).after("<div class='"+styles.ddOutOfVision+"' style='height:0px;overflow:hidden;position:absolute;' id='"+sId+"'></div>");
490
+ $("#"+elementid).appendTo($("#"+sId));
491
+ };
492
+ var setTitleText = function (sText) {
493
+ var titletextid = getPostID("postTitleTextID");
494
+ $("#"+titletextid).html(sText);
495
+ };
496
+ var navigateA = function(w) {
497
+ var where = w;
498
+ var childid = getPostID("postChildID");
499
+ var visibleA = $("#"+childid + " a:visible");
500
+ var totalA = visibleA.length;
501
+ var currentP = $("#"+childid +" a:visible").index($("#"+childid +" a.selected:visible"));
502
+ var nextA;
503
+ switch(where) {
504
+ case "next":
505
+ if(currentP < totalA-1) {
506
+ currentP++;
507
+ nextA = visibleA[currentP];
508
+ };
509
+ break;
510
+ case "previous":
511
+ if(currentP < totalA && currentP>0) {
512
+ currentP--;
513
+ nextA = visibleA[currentP];
514
+ };
515
+ break;
516
+ };
517
+ if(typeof(nextA)=="undefined") {
518
+ return false;
519
+ };
520
+ $("#"+childid + " a."+styles.selected).removeClass(styles.selected);
521
+ $(nextA).addClass(styles.selected);
522
+ var selectedA = nextA.id;
523
+ if(!ddList) {
524
+ var sText = (options.showIcon==false) ? a_array[selectedA].text : $("#"+selectedA).html();
525
+ setTitleText(sText);
526
+ setTitleImageSprite(a_array[selectedA].index);
527
+ };
528
+ if(where=="next") {
529
+ if(parseInt(($("#"+selectedA).position().top+$("#"+selectedA).height()))>=parseInt($("#"+childid).height())) {
530
+ $("#"+childid).scrollTop(($("#"+childid).scrollTop())+$("#"+selectedA).height()+$("#"+selectedA).height());
531
+ };
532
+ } else {
533
+ if(parseInt(($("#"+selectedA).position().top+$("#"+selectedA).height())) <=0) {
534
+ $("#"+childid).scrollTop(($("#"+childid).scrollTop()-$("#"+childid).height())-$("#"+selectedA).height());
535
+ };
536
+ };
537
+ };
538
+ var next = function () {
539
+ navigateA("next");
540
+ };
541
+ var previous = function () {
542
+ navigateA("previous");
543
+ };
544
+ var setTitleImageSprite = function(i) {
545
+ if(options.useSprite!=false) {
546
+ var titletextid = getPostID("postTitleTextID");
547
+ var index = (typeof(i)=="undefined") ? getElement(elementid).selectedIndex : i;
548
+ var sClassName = getElement(elementid).options[index].className;
549
+ if(sClassName.length>0) {
550
+ var childid = getPostID("postChildID");
551
+ var id = $("#"+childid + " a."+sClassName).prop("id");
552
+ var backgroundImg = $("#"+id).css("background-image");
553
+ var backgroundPosition = $("#"+id).css("background-position");
554
+ if(backgroundPosition == undefined){
555
+ backgroundPosition = $("#"+id).css("background-position-x") + " " + $("#"+id).css("background-position-y");
556
+ };
557
+ var paddingLeft = $("#"+id).css("padding-left");
558
+ if(backgroundImg!=undefined) {
559
+ $("#"+titletextid).find("."+styles.ddTitleText).attr('style', "background:"+backgroundImg);
560
+ };
561
+ if(backgroundPosition!=undefined) {
562
+ $("#"+titletextid).find("."+styles.ddTitleText).css('background-position', backgroundPosition);
563
+ };
564
+ if(paddingLeft!=undefined) {
565
+ $("#"+titletextid).find("."+styles.ddTitleText).css('padding-left', paddingLeft);
566
+ };
567
+ $("#"+titletextid).find("."+styles.ddTitleText).css('background-repeat', 'no-repeat');
568
+ $("#"+titletextid).find("."+styles.ddTitleText).css('padding-bottom', '2px');
569
+ };
570
+ };
571
+ };
572
+ var setValue = function () {
573
+ //alert("setValue "+elementid);
574
+ var childid = getPostID("postChildID");
575
+ var allSelected = $("#"+childid + " a."+styles.selected);
576
+ if(allSelected.length==1) {
577
+ var sText = $("#"+childid + " a."+styles.selected).text();
578
+ var selectedA = $("#"+childid + " a."+styles.selected).prop("id");
579
+ if(selectedA!=undefined) {
580
+ var sValue = a_array[selectedA].value;
581
+ getElement(elementid).selectedIndex = a_array[selectedA].index;
582
+ };
583
+ //set image on title if using sprite
584
+
585
+ if(options.showIcon && options.useSprite!=false)
586
+ setTitleImageSprite();
587
+ } else if(allSelected.length>1) {
588
+ //var alls = $("#"+elementid +" > option:selected").removeprop("selected");
589
+ for(var i=0;i<allSelected.length;i++) {
590
+ var selectedA = $(allSelected[i]).prop("id");
591
+ var index = a_array[selectedA].index;
592
+ getElement(elementid).options[index].selected = "selected";
593
+ };
594
+ };
595
+ //alert(getElement(elementid).selectedIndex);
596
+ var sIndex = getElement(elementid).selectedIndex;
597
+ $this.ddProp["selectedIndex"]= sIndex;
598
+ //alert("selectedIndex "+ $this.ddProp["selectedIndex"] + " sIndex "+sIndex);
599
+ };
600
+ var has_handler = function (name) {
601
+ // True if a handler has been added in the html.
602
+ if ($("#"+elementid).prop("on" + name) != undefined) {
603
+ return true;
604
+ };
605
+ // True if a handler has been added using jQuery.
606
+ var evs = $("#"+elementid).data("events");
607
+ if (evs && evs[name]) {
608
+ return true;
609
+ };
610
+ return false;
611
+ };
612
+ var blur_m = function(evt) {
613
+ $("#"+elementid).focus();
614
+ $("#"+elementid)[0].blur();
615
+ setValue();
616
+ $(document).unbind("mouseup", d_onmouseup);
617
+ $(document).unbind("mouseup", blur_m);
618
+ };
619
+ var checkMethodAndApply = function () {
620
+ //console.log("calling checkMethodAndApply");
621
+ var childid = getPostID("postChildID");
622
+ if(has_handler('change')==true) {
623
+ //alert(1);
624
+ var currentSelectedValue = a_array[$("#"+childid +" a.selected").prop("id")].text;
625
+ if($.trim(oldSelectedValue) !== $.trim(currentSelectedValue) && oldSelectedValue!==""){
626
+ $("#"+elementid).trigger("change");
627
+ };
628
+ };
629
+ if(has_handler('mouseup')==true) {
630
+ $("#"+elementid).trigger("mouseup");
631
+ };
632
+ if(has_handler('blur')==true) {
633
+ $(document).bind("mouseup", blur_m);
634
+ };
635
+ return false;
636
+ };
637
+ var hightlightArrow = function(ison) {
638
+ var arrowid = getPostID("postArrowID");
639
+ if(ison==1)
640
+ $("#"+arrowid).css({backgroundPosition:'0 100%'});
641
+ else
642
+ $("#"+arrowid).css({backgroundPosition:'0 0'});
643
+ };
644
+ var setOriginalProperties = function() {
645
+ //properties = {};
646
+ for(var i in getElement(elementid)) {
647
+ if(typeof(getElement(elementid)[i])!=='function' && typeof(getElement(elementid)[i])!=="undefined" && typeof(getElement(elementid)[i])!=="null") {
648
+ $this.set(i, getElement(elementid)[i], true);//true = setting local properties
649
+ };
650
+ };
651
+ };
652
+ var setValueByIndex = function(prop, val) {
653
+ if(getByIndex(val) != -1) {
654
+ getElement(elementid)[prop] = val;
655
+ var childid = getPostID("postChildID");
656
+ $("#"+childid+ " a."+styles.selected).removeClass(styles.selected);
657
+ $("#"+getByIndex(val).id).addClass(styles.selected);
658
+ var sText = getByIndex(getElement(elementid).selectedIndex).html;
659
+ setTitleText(sText);
660
+ };
661
+ };
662
+ var addRemoveFromIndex = function(i, action) {
663
+ if(action=='d') {
664
+ for(var key in a_array) {
665
+ if(a_array[key].index == i) {
666
+ delete a_array[key];
667
+ break;
668
+ };
669
+ };
670
+ };
671
+ //update index
672
+ var count = 0;
673
+ for(var key in a_array) {
674
+ a_array[key].index = count;
675
+ count++;
676
+ };
677
+ };
678
+ var shouldOpenOpposite = function() {
679
+ var childid = getPostID("postChildID");
680
+ var main = getPostID("postID");
681
+ var pos = $("#"+main).offset();
682
+ var mH = $("#"+main).height();
683
+ var wH = $(window).height();
684
+ var st = $(window).scrollTop();
685
+ var cH = $("#"+childid).height();
686
+ var css = {zIndex:options.zIndex, top:(mH)+"px", display:"none"};
687
+ var ani = options.animStyle;
688
+ var opp = false;
689
+ var borderTop = styles.noBorderTop;
690
+ $("#"+childid).removeClass(styles.noBorderTop);
691
+ $("#"+childid).removeClass(styles.borderTop);
692
+ if( (wH+st) < Math.floor(cH+mH+pos.top) ) {
693
+ var tp = cH;
694
+ css = {zIndex:options.zIndex, top:"-"+tp+"px", display:"none"};
695
+ ani = "show";
696
+ opp = true;
697
+ borderTop = styles.borderTop;
698
+ };
699
+ return {opp:opp, ani:ani, css:css, border:borderTop};
700
+ };
701
+ var fireOpenEvent = function() {
702
+ if($this.onActions["onOpen"]!=null) {
703
+ eval($this.onActions["onOpen"])($this);
704
+ };
705
+ };
706
+ var fireCloseEvent = function() {
707
+ checkMethodAndApply();
708
+ if($this.onActions["onClose"]!=null) {
709
+ eval($this.onActions["onClose"])($this);
710
+ };
711
+ };
712
+ var d_onkeydown = function(event) {
713
+ var childid = getPostID("postChildID");
714
+ var keyCode = event.keyCode;
715
+ //alert("keyCode "+keyCode);
716
+ if(keyCode==8) {
717
+ event.preventDefault(); event.stopPropagation();
718
+ //remove char
719
+ inputText = (inputText.length==0) ? "" : inputText.substr(0, inputText.length-1);
720
+ };
721
+ switch(keyCode) {
722
+ case 39:
723
+ case 40:
724
+ //move to next
725
+ event.preventDefault(); event.stopPropagation();
726
+ next();
727
+ break;
728
+ case 37:
729
+ case 38:
730
+ //move to previous
731
+ event.preventDefault(); event.stopPropagation();
732
+ previous();
733
+ break;
734
+ case 27:
735
+ case 13:
736
+ $this.close();
737
+ setValue();
738
+ break;
739
+ default:
740
+ if(keyCode>46) {
741
+ inputText += String.fromCharCode(keyCode);
742
+ };
743
+ var ind = in_array(inputText);
744
+ if(ind != -1) {
745
+ $("#"+childid).css({height:'auto'});
746
+ $("#"+childid +" a").hide();
747
+ $(ind).show();
748
+ var wf = shouldOpenOpposite();
749
+ $("#"+childid).css(wf.css);
750
+ $("#"+childid).css({display:'block'});
751
+ } else {
752
+ $("#"+childid +" a").show();
753
+ $("#"+childid).css({height:oldHeight+'px'});
754
+ };
755
+ break;
756
+ };
757
+ if(has_handler("keydown")==true) {
758
+ getElement(elementid).onkeydown();
759
+ };
760
+ return false;
761
+ };
762
+ var d_onmouseup = function(event) {
763
+ if(getInsideWindow()==false) {
764
+ //alert("evt.target: "+event.target);
765
+ //$this.data("dd").close();
766
+ $this.close();
767
+ };
768
+ return false;
769
+ };
770
+ var d_onkeyup = function(event) {
771
+ if($("#"+elementid).prop("onkeyup")!=undefined) {
772
+ //$("#"+elementid).keyup();
773
+ getElement(elementid).onkeyup();
774
+ };
775
+ return false;
776
+ };
777
+ /************* public methods *********************/
778
+ this.open = function() {
779
+ if(($this.get("disabled", true) == true) || ($this.get("options", true).length==0)) return;
780
+ var childid = getPostID("postChildID");
781
+ if(msOldDiv!="" && childid!=msOldDiv) {
782
+ $("#"+msOldDiv).slideUp("fast");
783
+ $("#"+msOldDiv).css({zIndex:'0'});
784
+ };
785
+ if($("#"+childid).css("display")=="none") {
786
+ oldSelectedValue = a_array[$("#"+childid +" a.selected").prop("id")].text;
787
+ //keyboard action
788
+ inputText = "";
789
+ oldHeight = $("#"+childid).height();
790
+ $("#"+childid +" a").show();
791
+ $(document).bind("keydown", d_onkeydown);
792
+ $(document).bind("keyup", d_onkeyup);
793
+ //end keyboard action
794
+
795
+ //close onmouseup
796
+ $(document).bind("mouseup", d_onmouseup);
797
+
798
+ //check open
799
+ var wf = shouldOpenOpposite();
800
+ $("#"+childid).css(wf.css);
801
+ if(wf.opp==true) {
802
+ $("#"+childid).css({display:'block'});
803
+ $("#"+childid).addClass(wf.border);
804
+ fireOpenEvent();
805
+ } else {
806
+ $("#"+childid)[wf.ani]("fast", function() {
807
+ $("#"+childid).addClass(wf.border);
808
+ fireOpenEvent();
809
+ });
810
+ };
811
+ if(childid != msOldDiv) {
812
+ msOldDiv = childid;
813
+ };
814
+ };
815
+ };
816
+ this.close = function() {
817
+ var childid = getPostID("postChildID");
818
+ if ( !$("#"+childid).is(":visible") || isClosing ) return;
819
+ isClosing = true;
820
+ //console.log("calling close " + $("#"+childid).css("display"));
821
+ if($("#"+childid).css("display")=="none") {return false;};
822
+ var top = $("#"+getPostID("postTitleID")).position().top;
823
+ var wf = shouldOpenOpposite();
824
+ //var oldHeight = $("#"+childid).height();
825
+ isFilter = false;
826
+ if(wf.opp==true) {
827
+ $("#"+childid).animate({
828
+ height:0,
829
+ top: top
830
+ }, function() {
831
+ $("#"+childid).css({height:oldHeight+'px', display:'none'});
832
+ fireCloseEvent();
833
+ isClosing = false;
834
+ });
835
+ }
836
+ else {
837
+ $("#"+childid).slideUp("fast", function(event) {
838
+ fireCloseEvent();
839
+ $("#"+childid).css({zIndex:'0'});
840
+ $("#"+childid).css({height:oldHeight+'px'});
841
+ isClosing = false;
842
+ });
843
+ };
844
+ setTitleImageSprite();
845
+ $(document).unbind("keydown", d_onkeydown);
846
+ $(document).unbind("keyup", d_onkeyup);
847
+ $(document).unbind("mouseup", d_onmouseup);
848
+ };
849
+ this.selectedIndex = function(i) {
850
+ if(typeof(i)=="undefined") {
851
+ return $this.get("selectedIndex");
852
+ } else {
853
+ $this.set("selectedIndex", i);
854
+ };
855
+ };
856
+ this.debug = function(is) {
857
+ if(typeof(is)=="undefined" || is==true) {
858
+ $("."+styles.ddOutOfVision).removeAttr("style");
859
+ } else {
860
+ $("."+styles.ddOutOfVision).attr("style", "height:0px;overflow:hidden;position:absolute");
861
+ };
862
+ };
863
+ //update properties
864
+ this.set = function(prop, val, isLocal) {
865
+ //alert("- set " + prop + " : "+val);
866
+ if(typeof prop=="undefined" || typeof val=="undefined") return false;
867
+ $this.ddProp[prop] = val;
868
+ if(isLocal!=true) {
869
+ switch(prop) {
870
+ case "selectedIndex":
871
+ setValueByIndex(prop, val);
872
+ break;
873
+ case "disabled":
874
+ $this.disabled(val, true);
875
+ break;
876
+ case "multiple":
877
+ getElement(elementid)[prop] = val;
878
+ ddList = ($(sElement).prop("size")>0 || $(sElement).prop("multiple")==true) ? true : false;
879
+ if(ddList) {
880
+ //do something
881
+ var iHeight = $("#"+elementid).height();
882
+ var childid = getPostID("postChildID");
883
+ $("#"+childid).css("height", iHeight+"px");
884
+ //hide titlebar
885
+ var titleid = getPostID("postTitleID");
886
+ $("#"+titleid).hide();
887
+ var childid = getPostID("postChildID");
888
+ $("#"+childid).css({display:'block',position:'relative'});
889
+ applyEventsOnA();
890
+ };
891
+ break;
892
+ case "size":
893
+ getElement(elementid)[prop] = val;
894
+ if(val==0) {
895
+ getElement(elementid).multiple = false;
896
+ };
897
+ ddList = ($(sElement).prop("size")>0 || $(sElement).prop("multiple")==true) ? true : false;
898
+ if(val==0) {
899
+ //show titlebar
900
+ var titleid = getPostID("postTitleID");
901
+ $("#"+titleid).show();
902
+ var childid = getPostID("postChildID");
903
+ $("#"+childid).css({display:'none',position:'absolute'});
904
+ var sText = "";
905
+ if(getElement(elementid).selectedIndex>=0) {
906
+ var aObj = getByIndex(getElement(elementid).selectedIndex);
907
+ sText = aObj.html;
908
+ manageSelection($("#"+aObj.id));
909
+ };
910
+ setTitleText(sText);
911
+ } else {
912
+ //hide titlebar
913
+ var titleid = getPostID("postTitleID");
914
+ $("#"+titleid).hide();
915
+ var childid = getPostID("postChildID");
916
+ $("#"+childid).css({display:'block',position:'relative'});
917
+ };
918
+ break;
919
+ default:
920
+ try{
921
+ //check if this is not a readonly properties
922
+ getElement(elementid)[prop] = val;
923
+ } catch(e) {
924
+ //silent
925
+ };
926
+ break;
927
+ };
928
+ };
929
+ //alert("get " + prop + " : "+$this.ddProp[prop]);
930
+ //$this.set("selectedIndex", 0);
931
+ };
932
+ this.get = function(prop, forceRefresh) {
933
+ if(prop==undefined && forceRefresh==undefined) {
934
+ //alert("c1 : " +$this.ddProp);
935
+ return $this.ddProp;
936
+ };
937
+ if(prop!=undefined && forceRefresh==undefined) {
938
+ //alert("c2 : " +$this.ddProp[prop]);
939
+ return ($this.ddProp[prop]!=undefined) ? $this.ddProp[prop] : null;
940
+ };
941
+ if(prop!=undefined && forceRefresh!=undefined) {
942
+ //alert("c3 : " +getElement(elementid)[prop]);
943
+ return getElement(elementid)[prop];
944
+ };
945
+ };
946
+ this.visible = function(val) {
947
+ var id = getPostID("postID");
948
+ if(val==true) {
949
+ $("#"+id).show();
950
+ } else if(val==false) {
951
+ $("#"+id).hide();
952
+ } else {
953
+ return $("#"+id).css("display");
954
+ };
955
+ };
956
+ this.add = function(opt, index) {
957
+ var objOpt = opt;
958
+ var sText = objOpt.text;
959
+ var sValue = (objOpt.value==undefined || objOpt.value==null) ? sText : objOpt.value;
960
+ var img = (objOpt["title"]==undefined || objOpt["title"]==null) ? '' : objOpt["title"];
961
+ var i = (index==undefined || index==null) ? getElement(elementid).options.length : index;
962
+ getElement(elementid).options[i] = new Option(sText, sValue);
963
+ if(img!='') getElement(elementid).options[i]["title"] = img;
964
+ //check if exist
965
+ var ifA = getByIndex(i);
966
+ if(ifA != -1) {
967
+ //replace
968
+ var aTag = createA(getElement(elementid).options[i], i, "", "");
969
+ $("#"+ifA.id).html(aTag);
970
+ //a_array[key]
971
+ } else {
972
+ var aTag = createA(getElement(elementid).options[i], i, "", "");
973
+ //add
974
+ var childid = getPostID("postChildID");
975
+ $("#"+childid).append(aTag);
976
+ applyEventsOnA();
977
+ };
978
+ };
979
+ this.remove = function(i) {
980
+ getElement(elementid).remove(i);
981
+ if((getByIndex(i))!= -1) { $("#"+getByIndex(i).id).remove();addRemoveFromIndex(i, 'd');};
982
+ //alert("a" +a);
983
+ if(getElement(elementid).length==0) {
984
+ setTitleText("");
985
+ } else {
986
+ var sText = getByIndex(getElement(elementid).selectedIndex).html;
987
+ setTitleText(sText);
988
+ };
989
+ $this.set("selectedIndex", getElement(elementid).selectedIndex);
990
+ };
991
+ this.disabled = function(dis, isLocal) {
992
+ getElement(elementid).disabled = dis;
993
+ //alert(getElement(elementid).disabled);
994
+ var id = getPostID("postID");
995
+ if(dis==true) {
996
+ $("#"+id).css("opacity", styles.disabled);
997
+ $this.close();
998
+ } else if(dis==false) {
999
+ $("#"+id).css("opacity", 1);
1000
+ };
1001
+ if(isLocal!=true) {
1002
+ $this.set("disabled", dis);
1003
+ };
1004
+ };
1005
+ //return form element
1006
+ this.form = function() {
1007
+ return (getElement(elementid).form == undefined) ? null : getElement(elementid).form;
1008
+ };
1009
+ this.item = function() {
1010
+ //index, subindex - use arguments.length
1011
+ if(arguments.length==1) {
1012
+ return getElement(elementid).item(arguments[0]);
1013
+ } else if(arguments.length==2) {
1014
+ return getElement(elementid).item(arguments[0], arguments[1]);
1015
+ } else {
1016
+ throw {message:"An index is required!"};
1017
+ };
1018
+ };
1019
+ this.namedItem = function(nm) {
1020
+ return getElement(elementid).namedItem(nm);
1021
+ };
1022
+ this.multiple = function(is) {
1023
+ if(typeof(is)=="undefined") {
1024
+ return $this.get("multiple");
1025
+ } else {
1026
+ $this.set("multiple", is);
1027
+ };
1028
+
1029
+ };
1030
+ this.size = function(sz) {
1031
+ if(typeof(sz)=="undefined") {
1032
+ return $this.get("size");
1033
+ } else {
1034
+ $this.set("size", sz);
1035
+ };
1036
+ };
1037
+ this.addMyEvent = function(nm, fn) {
1038
+ $this.onActions[nm] = fn;
1039
+ };
1040
+ this.fireEvent = function(nm) {
1041
+ eval($this.onActions[nm])($this);
1042
+ };
1043
+ this.showRows = function(r) {
1044
+ if(typeof r == "undefined" || r==0) {return false};
1045
+ var childid = getPostID("postChildID");
1046
+ var fc = $("#"+childid+" a:first").height();
1047
+ var dh = (fc==0) ? options.rowHeight : fc;
1048
+ var iHeight = r*dh;
1049
+ $("#"+childid).css("height", iHeight+"px");
1050
+ };
1051
+ //end
1052
+ var updateCommonVars = function() {
1053
+ $this.set("version", $.msDropDown.version);
1054
+ $this.set("author", $.msDropDown.author);
1055
+ };
1056
+ var init = function() {
1057
+ //create wrapper
1058
+ createDropDown();
1059
+ //update propties
1060
+ //alert("init");
1061
+ setOriginalProperties();
1062
+ updateCommonVars();
1063
+ if(options.onInit!='') {
1064
+ eval(options.onInit)($this);
1065
+ };
1066
+ };
1067
+ init();
1068
+ };
1069
+ //static
1070
+ $.msDropDown = {
1071
+ version: '2.38.4',
1072
+ author: "Marghoob Suleman",
1073
+ counter:20,
1074
+ debug: function(v) {
1075
+ if(v==true) {
1076
+ $(".ddOutOfVision").css({height:'20px', position:'relative'});
1077
+ } else {
1078
+ $(".ddOutOfVision").css({height:'0px', position:'absolute'});
1079
+ };
1080
+ },
1081
+ create: function(id, opt) {
1082
+ return $(id).msDropDown(opt).data("dd");
1083
+ }
1084
+ };
1085
+ $.fn.extend({
1086
+ msDropDown: function(options)
1087
+ {
1088
+ return this.each(function()
1089
+ {
1090
+ //if ($(this).data('dd')) return; // need to comment when using refresh method - will remove in next version
1091
+ var mydropdown = new dd(this, options);
1092
+ $(this).data('dd', mydropdown);
1093
+ });
1094
+ }
1095
+ });
1096
+ //fixed for prop
1097
+ if(typeof($.fn.prop)=='undefined') {
1098
+ $.fn.prop = function(w, v) {
1099
+ if(typeof v == "undefined") {
1100
+ return $(this).attr(w);
1101
+ };
1102
+ try {
1103
+ $(this).attr(w, v);
1104
+ } catch(e) {
1105
+ //some properties are read only.
1106
+ };
1107
+ };
1108
+ };
1109
+
1110
+ })(jQuery);