├── .gitignore ├── images ├── gradient-top.png └── gradient-bottom.png ├── TODO ├── templates ├── single_lyric.html ├── index.html ├── artist.html ├── lyric.html ├── new_lyric.html ├── edit_lyric.html └── base.html ├── app.yaml ├── models.py ├── betterhandler.py ├── tests └── __init__.py ├── javascripts ├── app.js ├── jquery.dimensions.min.js ├── jquery.inputHintBox.js └── jquery-1.2.3.min.js ├── lyrics.py └── stylesheets └── screen.css /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | index.yaml -------------------------------------------------------------------------------- /images/gradient-top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/lyrics/master/images/gradient-top.png -------------------------------------------------------------------------------- /images/gradient-bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/lyrics/master/images/gradient-bottom.png -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | BUGS 2 | - 4/29/2008 edit page doesn't seem to understand that a user owns a song, redirects to / 3 | 4 | FEATURES 5 | - album search 6 | - song search 7 | - user view 8 | - favorites -------------------------------------------------------------------------------- /templates/single_lyric.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% block pageheader %} 4 |

a lyric by {{ lyric.artist|striptags }}

5 | {% endblock %} 6 | 7 | {% block content %} 8 | {% include "lyric.html" %} 9 | {% endblock %} -------------------------------------------------------------------------------- /templates/index.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% block pageheader %} 4 |

recent lyrics

5 | {% endblock %} 6 | 7 | {% block content %} 8 | {% for lyric in lyrics %} 9 | {% include "lyric.html" %} 10 | {% endfor %} 11 | {% endblock %} -------------------------------------------------------------------------------- /app.yaml: -------------------------------------------------------------------------------- 1 | application: lyricswelove 2 | version: 1 3 | runtime: python 4 | api_version: 1 5 | 6 | handlers: 7 | - url: /stylesheets 8 | static_dir: stylesheets 9 | 10 | - url: /images 11 | static_dir: images 12 | 13 | - url: /javascripts 14 | static_dir: javascripts 15 | 16 | - url: /.* 17 | script: lyrics.py -------------------------------------------------------------------------------- /templates/artist.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% block pageheader %} 4 |

lyrics by {{ artist|striptags }}

5 | {% endblock %} 6 | 7 | {% block content %} 8 | {% if artist and lyrics %} 9 | {% for lyric in lyrics %} 10 | {% include "lyric.html" %} 11 | {% endfor %} 12 | {% else %} 13 |
No lyrics found by that artist.
14 | {% endif %} 15 | {% endblock %} -------------------------------------------------------------------------------- /models.py: -------------------------------------------------------------------------------- 1 | from google.appengine.ext import db 2 | from google.appengine.api import users 3 | 4 | class Lyric(db.Model): 5 | body = db.TextProperty() 6 | artist = db.StringProperty() 7 | album = db.StringProperty() 8 | ASIN = db.StringProperty() 9 | song = db.StringProperty() 10 | user = db.UserProperty() 11 | key_id = db.IntegerProperty() 12 | date = db.DateTimeProperty(auto_now_add=True) 13 | 14 | class Favorite(db.Model): 15 | user = db.UserProperty(required=True) 16 | lyric = db.ReferenceProperty(Lyric) 17 | date = db.DateTimeProperty(auto_now_add=True) 18 | -------------------------------------------------------------------------------- /betterhandler.py: -------------------------------------------------------------------------------- 1 | from google.appengine.ext import webapp 2 | from google.appengine.api import users 3 | import os 4 | 5 | class BetterHandler(webapp.RequestHandler): 6 | def template_path(self, filename): 7 | return os.path.join(os.path.dirname(__file__), 'templates', filename) 8 | 9 | def template_values(self, extra_dict=None): 10 | standard_values = { 11 | 'user': users.get_current_user(), 12 | 'login_url': users.create_login_url('/'), 13 | 'logout_url': users.create_logout_url('/'), 14 | } 15 | 16 | if extra_dict: 17 | standard_values.update(extra_dict) 18 | 19 | return standard_values -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | lyricswelove test suite 3 | 4 | The test suite requires the following:: 5 | 6 | easy_install nose WebTest http://nose-gae.googlecode.com/svn/trunk/ 7 | 8 | The last one is a path to the noseGAE plugin (see http://code.google.com/p/nose-gae/) and it must be revision 25 or higher (currently 0.1.3a). 9 | noseGAE sets up everything you need to run the pypione app in a simulated Google App Engine environment. 10 | 11 | NOTE: as of this writing, issue6 (http://code.google.com/p/nose-gae/issues/detail?id=6) means you'll have to manually delete WebOb from your site-packages to get noseGAE to work. 12 | 13 | Run the test suite with the nosetests (or nosetests-2.5) command from the root directory. 14 | """ -------------------------------------------------------------------------------- /javascripts/app.js: -------------------------------------------------------------------------------- 1 | var LWL; 2 | 3 | if (!LWL) LWL = {}; 4 | 5 | /* 6 | Text used in the help tooltips for the form 7 | */ 8 | LWL.help = { 9 | body :"The lyrics you would like to share", 10 | artist :"The artist who wrote these lyrics", 11 | song :"The song in which these lyrics appear", 12 | album :"Optional. The album where the song appears", 13 | ASIN :"Optional. The Amazon ASIN code for the album or song", 14 | } 15 | 16 | 17 | LWL.initFormHelp = function() { 18 | 19 | for (fieldname in LWL.help) { 20 | $("#"+fieldname+"-field").attr('title', LWL.help[fieldname]); 21 | $("#"+fieldname+"-field").inputHintBox({ 22 | className:'tooltip', 23 | source:'attr', 24 | attr:'title', 25 | incrementLeft:100, 26 | incrementTop:37, 27 | attachTo:'#wrapper'}); 28 | } 29 | 30 | } -------------------------------------------------------------------------------- /templates/lyric.html: -------------------------------------------------------------------------------- 1 |
2 |
{{ lyric.body|linebreaks }}
3 | 4 |
5 | from "{{ lyric.song }}"
6 | 7 | {% if lyric.album %} 8 | {% if lyric.ASIN %} 9 | on {{ lyric.album }}
10 | {% else %} 11 | on {{ lyric.album }}
12 | {% endif %} 13 | {% endif %} 14 | 15 | by {{ lyric.artist }}
16 | shared by {{ lyric.user }}
17 | {{ lyric.date|timesince }} ago
18 | 19 |
20 | permalink 21 | {% ifequal lyric.user user %} 22 | • edit 23 | • delete 24 | {% endifequal %} 25 |
26 |
27 | 28 |
29 |
-------------------------------------------------------------------------------- /templates/new_lyric.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% block pageheader %} 4 |

please do share a lyric

5 | {% endblock %} 6 | 7 | {% block content %} 8 | 9 | 14 | 15 | 16 |
17 | 18 | 19 |
20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 |
32 | 33 | 34 | 35 |
36 | 37 | 38 | 39 |
40 | {% endblock %} -------------------------------------------------------------------------------- /templates/edit_lyric.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% block pageheader %} 4 |

please do edit this lyric

5 | {% endblock %} 6 | 7 | {% block content %} 8 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
31 | 32 | 33 | 34 |
35 | 36 | 37 | 38 |
39 | 40 | 41 | 42 |
43 | {% endblock %} -------------------------------------------------------------------------------- /templates/base.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Lyrics We Love 11 | 12 | 13 | 14 |
15 | 16 |
17 | 18 | 29 | 30 |
31 | 32 | 37 | 38 | {% block pageheader %}{% endblock %} 39 |
40 | {% block content %}{% endblock %} 41 |
42 | 43 |
44 | 45 | 48 | 49 |
50 | 51 |
52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /javascripts/jquery.dimensions.min.js: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net) 2 | * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 3 | * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. 4 | * 5 | * $LastChangedDate: 2007-12-20 08:43:48 -0600 (Thu, 20 Dec 2007) $ 6 | * $Rev: 4257 $ 7 | * 8 | * Version: 1.2 9 | * 10 | * Requires: jQuery 1.2+ 11 | */ 12 | (function($){$.dimensions={version:'1.2'};$.each(['Height','Width'],function(i,name){$.fn['inner'+name]=function(){if(!this[0])return;var torl=name=='Height'?'Top':'Left',borr=name=='Height'?'Bottom':'Right';return this.is(':visible')?this[0]['client'+name]:num(this,name.toLowerCase())+num(this,'padding'+torl)+num(this,'padding'+borr);};$.fn['outer'+name]=function(options){if(!this[0])return;var torl=name=='Height'?'Top':'Left',borr=name=='Height'?'Bottom':'Right';options=$.extend({margin:false},options||{});var val=this.is(':visible')?this[0]['offset'+name]:num(this,name.toLowerCase())+num(this,'border'+torl+'Width')+num(this,'border'+borr+'Width')+num(this,'padding'+torl)+num(this,'padding'+borr);return val+(options.margin?(num(this,'margin'+torl)+num(this,'margin'+borr)):0);};});$.each(['Left','Top'],function(i,name){$.fn['scroll'+name]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(name=='Left'?val:$(window)['scrollLeft'](),name=='Top'?val:$(window)['scrollTop']()):this['scroll'+name]=val;}):this[0]==window||this[0]==document?self[(name=='Left'?'pageXOffset':'pageYOffset')]||$.boxModel&&document.documentElement['scroll'+name]||document.body['scroll'+name]:this[0]['scroll'+name];};});$.fn.extend({position:function(){var left=0,top=0,elem=this[0],offset,parentOffset,offsetParent,results;if(elem){offsetParent=this.offsetParent();offset=this.offset();parentOffset=offsetParent.offset();offset.top-=num(elem,'marginTop');offset.left-=num(elem,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&$.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return $(offsetParent);}});function num(el,prop){return parseInt($.curCSS(el.jquery?el[0]:el,prop,true))||0;};})(jQuery); -------------------------------------------------------------------------------- /lyrics.py: -------------------------------------------------------------------------------- 1 | from betterhandler import * 2 | import cgi 3 | from google.appengine.ext import webapp 4 | from google.appengine.ext import db 5 | from google.appengine.api import users 6 | from google.appengine.ext.webapp import template 7 | from models import * 8 | import os 9 | import wsgiref.handlers 10 | 11 | class MainPage(BetterHandler): 12 | def get(self): 13 | lyrics = db.GqlQuery("SELECT * FROM Lyric ORDER BY date DESC LIMIT 10") 14 | 15 | for_template = { 16 | 'lyrics': lyrics, 17 | } 18 | 19 | self.response.out.write(template.render(self.template_path('index.html'), self.template_values(for_template))) 20 | 21 | 22 | class NewLyric(BetterHandler): 23 | def get(self): 24 | self.response.out.write(template.render(self.template_path('new_lyric.html'), self.template_values())) 25 | 26 | def post(self): 27 | body = cgi.escape(self.request.get('body')) 28 | song = cgi.escape(self.request.get('song')) 29 | artist = cgi.escape(self.request.get('artist')) 30 | album = cgi.escape(self.request.get('album')) 31 | ASIN = cgi.escape(self.request.get('ASIN')) 32 | 33 | lyric = Lyric() 34 | lyric.user = users.get_current_user() 35 | lyric.body = unicode(body) 36 | lyric.song = unicode(song) 37 | lyric.artist = unicode(artist) 38 | lyric.album = unicode(album) 39 | lyric.ASIN = unicode(ASIN) 40 | lyric.put() 41 | 42 | lyric.key_id = lyric.key().id() 43 | lyric.put() 44 | 45 | for_template = { 46 | 'lyric': lyric, 47 | } 48 | 49 | # @todo set some kind of flash variable here to show update message on next page 50 | self.redirect("/lyric?id=%s" % lyric.key_id) 51 | 52 | 53 | class ALyric(BetterHandler): 54 | def get(self): 55 | key_id = int(cgi.escape(self.request.get('id'))) 56 | lyric = Lyric.get_by_id(key_id) 57 | 58 | if lyric == None: 59 | self.redirect("/") 60 | 61 | for_template = { 62 | 'lyric': lyric, 63 | } 64 | 65 | self.response.out.write(template.render(self.template_path('single_lyric.html'), self.template_values(for_template))) 66 | 67 | 68 | class EditLyric(BetterHandler): 69 | def get(self): 70 | key_id = int(cgi.escape(self.request.get('id'))) 71 | lyric = Lyric.get_by_id(key_id) 72 | 73 | if (lyric == None) or ( cmp(lyric.user, users.get_current_user()) != 0 ): 74 | self.redirect("/") 75 | else : 76 | for_template = { 77 | 'lyric': lyric, 78 | } 79 | 80 | self.response.out.write(template.render(self.template_path('edit_lyric.html'), self.template_values(for_template))) 81 | 82 | def post(self): 83 | key_id = int(cgi.escape(self.request.get('id'))) 84 | body = cgi.escape(self.request.get('body')) 85 | song = cgi.escape(self.request.get('song')) 86 | artist = cgi.escape(self.request.get('artist')) 87 | album = cgi.escape(self.request.get('album')) 88 | ASIN = cgi.escape(self.request.get('ASIN')) 89 | 90 | lyric = Lyric.get_by_id(key_id) 91 | lyric.user = users.get_current_user() 92 | lyric.body = unicode(body) 93 | lyric.song = unicode(song) 94 | lyric.artist = unicode(artist) 95 | lyric.album = unicode(album) 96 | lyric.ASIN = unicode(ASIN) 97 | lyric.put() 98 | 99 | for_template = { 100 | 'lyric': lyric, 101 | } 102 | 103 | # @todo set some kind of flash variable here to show update message on next page 104 | self.response.out.write(template.render(self.template_path('single_lyric.html'), self.template_values(for_template))) 105 | 106 | 107 | class DeleteLyric(BetterHandler): 108 | def get(self): 109 | key_id = int(cgi.escape(self.request.get('id'))) 110 | lyric = Lyric.get_by_id(key_id) 111 | 112 | if (lyric == None) or ( cmp(lyric.user, users.get_current_user()) != 0 ): 113 | self.redirect("/") 114 | 115 | lyric.delete() 116 | 117 | # @todo redirect to a referrer in a safe way 118 | # @todo set some kind of flash variable here to show update message on next page 119 | self.redirect("/") 120 | 121 | 122 | class Artist(BetterHandler): 123 | def get(self): 124 | artist = cgi.escape(self.request.get('name')) 125 | lyrics = db.GqlQuery("SELECT * FROM Lyric WHERE artist = :1 ORDER BY date DESC", artist) 126 | 127 | if lyrics.count() < 1: 128 | lyrics = None; 129 | 130 | for_template = { 131 | 'artist': artist, 132 | 'lyrics': lyrics, 133 | } 134 | 135 | self.response.out.write(template.render(self.template_path('artist.html'), self.template_values(for_template))) 136 | 137 | 138 | def main(): 139 | application = webapp.WSGIApplication([ 140 | ('/', MainPage), 141 | ('/lyric', ALyric), 142 | ('/lyric/new', NewLyric), 143 | ('/lyric/edit', EditLyric), 144 | ('/lyric/delete', DeleteLyric), 145 | ('/artist', Artist), 146 | ], 147 | debug=True) 148 | 149 | wsgiref.handlers.CGIHandler().run(application) 150 | 151 | if __name__ == "__main__": 152 | main() -------------------------------------------------------------------------------- /stylesheets/screen.css: -------------------------------------------------------------------------------- 1 | 2 | body { 3 | background-color: #3E4046; 4 | color: #EEEFF6; 5 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 6 | margin: 0px; 7 | padding: 0px; 8 | background-image: url('/images/gradient-top.png'); 9 | background-repeat: repeat-x; 10 | height:100%; 11 | width: 100%; 12 | border-bottom:2px solid #000000; 13 | bottom:0px; 14 | } 15 | 16 | 17 | #wrapper-external { 18 | background-image: url('/images/gradient-bottom.png'); 19 | background-repeat: repeat-x; 20 | background-position: bottom left; 21 | bottom:0px; 22 | position:relative; 23 | height:100%; 24 | } 25 | 26 | #wrapper { 27 | width:760px; 28 | margin-left:auto; 29 | margin-right:auto; 30 | background-repeat: repeat-x; 31 | background-position: bottom-left; 32 | height:100%; 33 | position:relative; 34 | } 35 | 36 | #header { 37 | color: #eeeff6; 38 | position:relative; 39 | } 40 | 41 | 42 | #wrapper-inside { 43 | width: 611px; 44 | margin-left: auto; 45 | margin-right: auto; 46 | position:relative; 47 | } 48 | 49 | #nav { 50 | background-color: #4B5774; 51 | padding: 8px; 52 | text-align: right; 53 | -webkit-border-bottom-right-radius: 8px; 54 | -webkit-border-bottom-left-radius: 8px; 55 | -moz-border-radius-bottomright: 8px; 56 | -moz-border-radius-bottomleft: 8px; 57 | 58 | } 59 | 60 | #nav ul { 61 | font-size: .9em; 62 | list-style-type: none; 63 | padding: 0px; 64 | margin: 0px; 65 | } 66 | 67 | #nav li { 68 | display: inline; 69 | margin-right: 1em; 70 | 71 | } 72 | 73 | #nav li a { 74 | padding:2px; 75 | -webkit-border-radius:5px; 76 | -moz-border-radius:5px; 77 | } 78 | 79 | h1#title { 80 | font-size: 3em; 81 | letter-spacing: 3px; 82 | padding:0; 83 | margin-top:10px; 84 | } 85 | h1#title a:hover { background-color: #31343c; } 86 | h2#subtitle { 87 | color: #A8ADC5; 88 | text-align: right; 89 | font-size: 29px; 90 | letter-spacing: 2px; 91 | margin: 0; 92 | padding: 2px 4px 0 4px; 93 | } 94 | 95 | #content { 96 | clear: both; 97 | margin:1em 0 5em 0; 98 | } 99 | 100 | #content a { color: #485776; } 101 | #content a:hover { color: #eeeff6; } 102 | 103 | .lyric { 104 | min-height: 80px; 105 | padding: 0 0 0 0; 106 | -khtml-border-radius:8px; 107 | -moz-border-radius:8px; 108 | border-radius:8px; 109 | background-color:#EEEFF6; 110 | padding:20px; 111 | margin-bottom:2em; 112 | -webkit-box-shadow:0px 3px 5px #000000; 113 | -moz-box-shadow:0px 3px 5px #000000; 114 | } 115 | 116 | .lyric:hover { background-color: #dcdce5; } 117 | 118 | .lyric .verse { 119 | font-family: Georgia, 'Times New Roman', serif; 120 | font-size: 13pt; 121 | line-height:22pt; 122 | border-right: 1px solid #C5B1C6; 123 | color: #191919; 124 | width: 380px; 125 | letter-spacing: -1px; 126 | padding:0 10px 0 0 ; 127 | margin:0; 128 | float:left; 129 | 130 | } 131 | .lyric .verse p { 132 | padding:0px; 133 | margin: 0 0 .7em 0; 134 | } 135 | 136 | 137 | .lyric .lyric_details { 138 | 139 | color: #474b58; 140 | float: left; 141 | font-size: 9pt; 142 | line-height:13pt; 143 | padding-left:10px; 144 | width: 150px; 145 | padding-top:0; 146 | margin-top:0; 147 | } 148 | 149 | .lyric .actions { 150 | margin-top:10px; 151 | padding:2px 4px; 152 | background-color: #A8ADC5; 153 | -webkit-border-radius: 10px; 154 | -moz-border-radius: 10px; 155 | font-size:90%; 156 | text-align:center; 157 | opacity:.8; 158 | } 159 | .lyric .actions a { 160 | padding:0 2px; 161 | -webkit-border-radius: 5px; 162 | -moz-border-radius: 5px; 163 | 164 | } 165 | 166 | 167 | 168 | 169 | 170 | 171 | .lyricform br { clear: left; } 172 | 173 | .lyricform .static-field { 174 | clear:both; 175 | } 176 | 177 | .lyricform input[type=submit] { 178 | margin-right:20%; 179 | float:right; 180 | font-size:12pt; 181 | } 182 | 183 | .lyricform input[disabled=disabled] { 184 | background-color:#CEAFC8; 185 | } 186 | 187 | .lyricform label, .lyricform input[type=text], .lyricform textarea 188 | { 189 | display: block; 190 | width: 60%; 191 | float: left; 192 | margin-bottom: 10px; 193 | -webkit-border-radius: 12px; 194 | -moz-border-radius: 12px; 195 | font-size:12pt; 196 | padding:5px; 197 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 198 | } 199 | 200 | .lyricform input[type=text], textarea { 201 | border:4px solid #CEAFC8; 202 | vertical-align:20%; 203 | } 204 | .lyricform input[type=text]:focus, .lyricform textarea:focus { 205 | border:4px solid #A5ADC7; 206 | background-color:#EEEFF6; 207 | } 208 | 209 | 210 | 211 | .lyricform label { 212 | text-align: right; 213 | width: 100px; 214 | padding-right: 10px; 215 | } 216 | .lyricform textarea { 217 | height:200px; 218 | } 219 | 220 | .optional { color: #999; } 221 | 222 | 223 | 224 | #footer { 225 | background-color: #4B5774; 226 | padding: 8px; 227 | text-align: right; 228 | -webkit-border-top-right-radius: 8px; 229 | -webkit-border-top-left-radius: 8px; 230 | -moz-border-radius-topright: 8px; 231 | -moz-border-radius-topleft: 8px; 232 | font-size: 9pt; 233 | position: relative; 234 | bottom: 0px; 235 | } 236 | #footer a { 237 | padding:2px; 238 | -webkit-border-radius:5px; 239 | -moz-border-radius:5px; 240 | } 241 | 242 | 243 | 244 | 245 | 246 | h1, h2, h3, h4, h5 { 247 | font-family:"Century Gothic", 'Helvetica Neue', Helvetica, Arial, sans-serif; 248 | } 249 | 250 | a { 251 | color: #9FCACE; 252 | text-decoration: none; 253 | padding:0 1px; 254 | -webkit-border-radius:5px; 255 | -moz-border-radius:5px; 256 | 257 | } 258 | 259 | a:active, a:hover { 260 | background-color: #3E4046; 261 | color: #EEEFF6; 262 | } 263 | 264 | 265 | 266 | 267 | 268 | .clearer { clear: both; } 269 | 270 | .error { 271 | background-color: #FFEEEE; 272 | color: #CC6666; 273 | border: 1px solid #CC6666; 274 | padding: 8px; 275 | display: block; 276 | } 277 | 278 | .tooltip { 279 | background-color:#111111; 280 | color:#FFFFFF; 281 | -webkit-border-radius: 8px; 282 | -moz-border-radius: 8px; 283 | opacity: .8; 284 | -moz-opacity: .8; 285 | filter:alpha(opacity=8.8); 286 | padding:10px; 287 | max-width:150px; 288 | 289 | } 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | -------------------------------------------------------------------------------- /javascripts/jquery.inputHintBox.js: -------------------------------------------------------------------------------- 1 | /* 2 | This has been slightly modified to change the transitions (they were very slow) - Ed Finkler, 2008-05-05 3 | */ 4 | 5 | /* 6 | * Input Floating Hint Box - jQuery plugin 1.1 Beta 7 | * 8 | * Copyright (c) 2008 Nicolae Namolovan (nicolae.namolovan gmail.com) 9 | * 10 | * Dual licensed under the MIT and GPL licenses: 11 | * http://www.opensource.org/licenses/mit-license.php 12 | * http://www.gnu.org/licenses/gpl.html 13 | * 14 | * Revision: 20 15 | * 16 | */ 17 | /** 18 | * Home page http://nicolae.namolovan.googlepages.com/jquery.inputHintBox.html 19 | * Demo http://nicolae.namolovan.googlepages.com/jquery.inputHintBox.demo.html 20 | **/ 21 | 22 | /** 23 | * Provide an automatic box hint in the right side of a input when user click it, it disapear when focus change (blur) 24 | * 25 | * Depends on dimensions plugin's offset method for correct positioning of the hint box element 26 | * 27 | * The source(@source) of the text/html can be an attribute (title for example), or a pure html. 28 | * Attribute can contain escaped html, example: title="This will be <b>Bold</b>" 29 | * 30 | * All hints can use one div element(@div option) with your custom design, and only some subelement of 31 | * this @div will change (according to source). 32 | * 33 | * You can provide only the @className, and for each input a separate
element will be created 34 | * with @className as class. 35 | * 36 | * If user click on the box to select some text (for copy/paste for example), box will not disappear. 37 | * 38 | * If you need to make the box appear in more left, use incrementLeft, same for top - incrementTop, 39 | * you can use - sign if you want to decrement. 40 | **/ 41 | 42 | /** 43 | * Example, you have a shiny div and you want to use it as a Shell for hint messages 44 | *
45 | * 46 | *
47 | * 48 | *
49 | * 50 | * You have a inputs like: 51 | * 52 | * 53 | * 54 | * Here is an example of js to use: 55 | * $('.titleHintBox').inputHintBox({div:$('#shiny_box'),div_sub:'.shiny_box_body',source:'attr',attr:'title',incrementLeft:12,incrementTop:-12}); 56 | **/ 57 | 58 | /** 59 | * Provide a hint box near input as a absolute positioned div. 60 | * @name InputHintBox 61 | * @cat Plugins/Forms 62 | * @type $ 63 | * @param Map options Optional settings 64 | * @option jQueryDom @div box to show, if this is set then className do not apply 65 | * @option String @div_sub css selector, use this when you need to write the Dynamic html into a element Inside the @div box, 66 | example: .body, this will search for .body in context of @div 67 | * @option String @className This class will be added to the dynamic created div box. Default: "input_hint_box" 68 | * @option String @source Source of box message text html: attr | html, Default: "attr" 69 | * @option String @attr If @source = "attr" then html will be taken from the attribute named @attr. Default: "title" 70 | * @option String @html If @source = "html" them html will be taken from @html 71 | * @option Integer @incrementLeft This value will be incremented to the left property of the absolute positioned hint box. Default: 10 72 | * @option Integer @incrementTop This value will be incremented to the top property of the absolute positioned hint box. Default: 10 73 | * @option String @attachTo Hint box will be appended to this. Default: "body" 74 | */ 75 | 76 | (function($) { 77 | $.fn.inputHintBox = function(options) { 78 | options = $.extend({}, $.inputHintBoxer.defaults, options); 79 | 80 | this.each(function(){ 81 | new $.inputHintBoxer(this,options); 82 | }); 83 | return this; 84 | } 85 | 86 | $.inputHintBoxer = function(input, options) { 87 | var $guideObject,$input = $guideObject = $(input), box, boxMouseDown = false; 88 | 89 | //$guideObject - in left of this object hint box will be positioned 90 | 91 | // If @type=radio then it must be inside a label and we should put the hint box in the right side of the label 92 | if ( ($input.attr('type') == 'radio' || $input.attr('type') == 'checkbox') && $input.parent().is('label') ) { 93 | $guideObject = $( $input.parent() ); 94 | } 95 | 96 | 97 | function init() { 98 | var boxHtml = options.html != ''?options.html: 99 | options.source == 'attr'?$input.attr(options.attr): ''; 100 | 101 | if (typeof boxHtml === "undefined") boxHtml = ''; 102 | box = options.div != '' ? options.div.clone() : $("
").addClass(options.className); 103 | box = box.css('display','none').addClass('_hintBox').appendTo(options.attachTo); 104 | 105 | if (options.div_sub == '') box.html(boxHtml); 106 | else $(options.div_sub,box).html(boxHtml); 107 | 108 | $input.focus(function() { 109 | $('body').mousedown(global_mousedown_listener); 110 | show(); 111 | }).blur(function(){ 112 | prepare_hide(); 113 | }); 114 | } 115 | 116 | // This is evaluated each time to prevent probs with elements with display none 117 | function align() { 118 | var offsets = $guideObject.position(), 119 | left = offsets.left + $guideObject.width() + options.incrementLeft + 5 + ($.browser.safari?5:($.browser.msie?10:($.browser.mozilla?6:0))), 120 | top = offsets.top + options.incrementTop + ($.browser.msie?14:($.browser.mozilla?8:0)); 121 | box.css({position:"absolute",top:top,left:left}); 122 | } 123 | 124 | function show() { 125 | align(); 126 | box.fadeIn('fast'); 127 | } 128 | 129 | function prepare_hide() { 130 | // We want to allow user to select and copy/paste content from the box 131 | // So delay a bit to see where user click 132 | // $('body').click(global_click_listener); 133 | // if (boxMouseDown) return; 134 | // $.inputHintBoxer.mostRecentHideTimer = setTimeout(function(){hide()},300); 135 | hide(); 136 | } 137 | 138 | var global_click_listener = function(e) { 139 | var $e = $(e.target),c='._hintBox'; 140 | clearTimeout($.inputHintBoxer.mostRecentHideTimer); 141 | if ($e.parents(c).length == 0 && $e.is(c) == false) hide(); 142 | }; 143 | 144 | // Prevent hiding when selecting.. 145 | // When user Select a text to select, a Mousedown is fired BEFORE blur of input 146 | // This why we need to know when a Mousedown is done to our object 147 | var global_mousedown_listener = function(e) { 148 | var $e = $(e.target),c='._hintBox'; 149 | boxMouseDown = ($e.parents(c).length != 0 || $e.is(c) != false); 150 | } 151 | 152 | function hide() { 153 | $('body').unbind('click',global_click_listener); 154 | $('body').unbind('mousedown',global_mousedown_listener); 155 | align(); 156 | box.fadeOut('fast'); 157 | } 158 | 159 | init(); 160 | return {} 161 | }; 162 | 163 | $.inputHintBoxer.mostRecentHideTimer = 0; 164 | 165 | $.inputHintBoxer.defaults = { 166 | div: '', 167 | className: 'input_hint_box', 168 | source: 'attr', // attr or html 169 | div_sub: '', // Where to write 170 | attr: 'title', 171 | html: '', 172 | incrementLeft: 10, 173 | incrementTop: 0, 174 | attachTo: 'body' 175 | } 176 | 177 | })(jQuery); -------------------------------------------------------------------------------- /javascripts/jquery-1.2.3.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery 1.2.3 - New Wave Javascript 3 | * 4 | * Copyright (c) 2008 John Resig (jquery.com) 5 | * Dual licensed under the MIT (MIT-LICENSE.txt) 6 | * and GPL (GPL-LICENSE.txt) licenses. 7 | * 8 | * $Date: 2008-02-06 00:21:25 -0500 (Wed, 06 Feb 2008) $ 9 | * $Rev: 4663 $ 10 | */ 11 | (function(){if(window.jQuery)var _jQuery=window.jQuery;var jQuery=window.jQuery=function(selector,context){return new jQuery.prototype.init(selector,context);};if(window.$)var _$=window.$;window.$=jQuery;var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/;var isSimple=/^.[^:#\[\.]*$/;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}else if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem)if(elem.id!=match[3])return jQuery().find(selector);else{this[0]=elem;this.length=1;return this;}else 12 | selector=[];}}else 13 | return new jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return new jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(selector.constructor==Array&&selector||(selector.jquery||selector.length&&selector!=window&&!selector.nodeType&&selector[0]!=undefined&&selector[0].nodeType)&&jQuery.makeArray(selector)||[selector]);},jquery:"1.2.3",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;this.each(function(i){if(this==elem)ret=i;});return ret;},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value==undefined)return this.length&&jQuery[type||"attr"](this[0],name)||undefined;else{options={};options[name]=value;}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else 14 | return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));else 15 | selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return!selector?this:this.pushStack(jQuery.merge(this.get(),selector.constructor==String?jQuery(selector).get():selector.length!=undefined&&(!selector.nodeName||jQuery.nodeName(selector,"form"))?selector:[selector]));},is:function(selector){return selector?jQuery.multiFilter(selector,this).length>0:false;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=value.constructor==Array?value:[value];jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)this.selectedIndex=-1;}else 17 | this.value=value;});},html:function(value){return value==undefined?(this.length?this[0].innerHTML:null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value==null){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data==undefined&&this.length)data=jQuery.data(this[0],key);return data==null&&parts[1]?this.data(parts[0]):data;}else 18 | return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse)elems.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script")){scripts=scripts.add(elem);}else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).remove());callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.prototype.init.prototype=jQuery.prototype;function evalScript(i,elem){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else 19 | jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function")target={};if(length==1){target=this;i=0;}for(;i-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options)elem.style[name]=old[name];},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible"))getWH();else 23 | jQuery.swap(elem,props,getWH);return Math.max(0,val);}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret;function color(elem){if(!jQuery.browser.safari)return false;var ret=document.defaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(elem.style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=elem.style.outline;elem.style.outline="0 solid black";elem.style.outline=save;}if(name.match(/float/i))name=styleFloat;if(!force&&elem.style&&elem.style[name])ret=elem.style[name];else if(document.defaultView&&document.defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var getComputedStyle=document.defaultView.getComputedStyle(elem,null);if(getComputedStyle&&!color(elem))ret=getComputedStyle.getPropertyValue(name);else{var swap=[],stack=[];for(var a=elem;a&&color(a);a=a.parentNode)stack.unshift(a);for(var i=0;i]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+">";});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("",""]||!tags.indexOf("",""]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!tags.indexOf("",""]||(!tags.indexOf("",""]||!tags.indexOf("",""]||jQuery.browser.msie&&[1,"div
","
"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf(""&&tags.indexOf("=0;--j)if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)tbody[j].parentNode.removeChild(tbody[j]);if(/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else 24 | ret=jQuery.merge(ret,elem);});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var fix=jQuery.isXMLDoc(elem)?{}:jQuery.props;if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(fix[name]){if(value!=undefined)elem[fix[name]]=value;return elem[fix[name]];}else if(jQuery.browser.msie&&name=="style")return jQuery.attr(elem.style,"cssText",value);else if(value==undefined&&jQuery.browser.msie&&jQuery.nodeName(elem,"form")&&(name=="action"||name=="method"))return elem.getAttributeNode(name).nodeValue;else if(elem.tagName){if(value!=undefined){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem.setAttribute(name,""+value);}if(jQuery.browser.msie&&/href|src/.test(name)&&!jQuery.isXMLDoc(elem))return elem.getAttribute(name,2);return elem.getAttribute(name);}else{if(name=="opacity"&&jQuery.browser.msie){if(value!=undefined){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseFloat(value).toString()=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100).toString():"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(value!=undefined)elem[name]=value;return elem[name];}},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(typeof array!="array")for(var i=0,length=array.length;i*",this).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return im[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false;var re=quickChild;var m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[];var cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&(!elem||n!=elem))r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval!=undefined)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=function(){return fn.apply(this,arguments);};handler.data=data;handler.guid=fn.guid;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){var val;if(typeof jQuery=="undefined"||jQuery.event.triggered)return val;val=jQuery.event.handle.apply(arguments.callee.elem,arguments);return val;});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener)elem.addEventListener(type,handle,false);else if(elem.attachEvent)elem.attachEvent("on"+type,handle);}}handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)=="."))for(var type in events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else 27 | for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener)elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}ret=null;delete events[type];}}});}for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data||[]);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event)data.unshift(this.fix({type:type,target:elem}));data[0].type=type;if(exclusive)data[0].exclusive=true;if(jQuery.isFunction(jQuery.data(elem,"handle")))val=jQuery.data(elem,"handle").apply(elem,data);if(!fn&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val;event=jQuery.event.fix(event||window.event||{});var parts=event.type.split(".");event.type=parts[0];var handlers=jQuery.data(this,"events")&&jQuery.data(this,"events")[event.type],args=Array.prototype.slice.call(arguments,1);args.unshift(event);for(var j in handlers){var handler=handlers[j];args[0].handler=handler;args[0].data=handler.data;if(!parts[1]&&!event.exclusive||handler.type==parts[1]){var ret=handler.apply(this,args);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}if(jQuery.browser.msie)event.target=event.preventDefault=event.stopPropagation=event.handler=event.data=null;return val;},fix:function(event){var originalEvent=event;event=jQuery.extend({},originalEvent);event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=originalEvent.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this))return true;arguments[0].type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this))return true;arguments[0].type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){return this.each(function(){jQuery.event.add(this,type,function(event){jQuery(this).unbind(event);return(fn||data).apply(this,arguments);},fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){if(this[0])return jQuery.event.trigger(type,data,this[0],false,fn);return undefined;},toggle:function(){var args=arguments;return this.click(function(event){this.lastToggle=0==this.lastToggle?1:0;event.preventDefault();return args[this.lastToggle].apply(this,arguments)||false;});},hover:function(fnOver,fnOut){return this.bind('mouseenter',fnOver).bind('mouseleave',fnOut);},ready:function(fn){bindReady();if(jQuery.isReady)fn.call(document,jQuery);else 28 | jQuery.readyList.push(function(){return fn.call(this,jQuery);});return this;}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.apply(document);});jQuery.readyList=null;}jQuery(document).triggerHandler("ready");}}});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(document.addEventListener&&!jQuery.browser.opera)document.addEventListener("DOMContentLoaded",jQuery.ready,false);if(jQuery.browser.msie&&window==top)(function(){if(jQuery.isReady)return;try{document.documentElement.doScroll("left");}catch(error){setTimeout(arguments.callee,0);return;}jQuery.ready();})();if(jQuery.browser.opera)document.addEventListener("DOMContentLoaded",function(){if(jQuery.isReady)return;for(var i=0;i=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("
").append(res.responseText.replace(//g,"")).find(selector):res.responseText);self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=(new Date).getTime();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){var jsonp,jsre=/=\?(&|$)/g,status,data;s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(s.type.toLowerCase()=="get"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head)head.removeChild(script);};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&s.type.toLowerCase()=="get"){var ts=(new Date()).getTime();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&s.type.toLowerCase()=="get"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");if((!s.url.indexOf("http")||!s.url.indexOf("//"))&&s.dataType=="script"&&s.type.toLowerCase()=="get"){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xml=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();xml.open(s.type,s.url,s.async,s.username,s.password);try{if(s.data)xml.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xml.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xml.setRequestHeader("X-Requested-With","XMLHttpRequest");xml.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend)s.beforeSend(xml);if(s.global)jQuery.event.trigger("ajaxSend",[xml,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xml&&(xml.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xml)&&"error"||s.ifModified&&jQuery.httpNotModified(xml,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xml,s.dataType);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xml.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else 29 | jQuery.handleError(s,xml,status);complete();if(s.async)xml=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xml){xml.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xml.send(s.data);}catch(e){jQuery.handleError(s,xml,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xml,s]);}function complete(){if(s.complete)s.complete(xml,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xml,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xml;},handleError:function(s,xml,status,e){if(s.error)s.error(xml,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xml,s,e]);},active:0,httpSuccess:function(r){try{return!r.status&&location.protocol=="file:"||(r.status>=200&&r.status<300)||r.status==304||r.status==1223||jQuery.browser.safari&&r.status==undefined;}catch(e){}return false;},httpNotModified:function(xml,url){try{var xmlRes=xml.getResponseHeader("Last-Modified");return xml.status==304||xmlRes==jQuery.lastModified[url]||jQuery.browser.safari&&xml.status==undefined;}catch(e){}return false;},httpData:function(r,type){var ct=r.getResponseHeader("content-type");var xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0;var data=xml?r.responseXML:r.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else 30 | for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else 31 | s.push(encodeURIComponent(j)+"="+encodeURIComponent(a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle(fn,fn2):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall);var hidden=jQuery(this).is(":hidden"),self=this;for(var p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return jQuery.isFunction(opt.complete)&&opt.complete.apply(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else 32 | e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.apply(this);}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return this;}});var queue=function(elem,type,array){if(!elem)return undefined;type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",array?jQuery.makeArray(array):[]);return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].apply(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:{slow:600,fast:200}[opt.duration])||400;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.apply(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.apply(this.elem,[this.now,this]);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=(new Date()).getTime();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;ithis.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done&&jQuery.isFunction(this.options.complete))this.options.complete.apply(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.fx.step={scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}};jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),fixed=jQuery.css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&jQuery.css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(jQuery.css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&jQuery.css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||jQuery.css(offsetChild,"position")=="absolute"))||(mozilla&&jQuery.css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l)||0;top+=parseInt(t)||0;}return results;};})(); --------------------------------------------------------------------------------