Commits

Cao Li committed 1378613

new files

  • Participants
  • Parent commits be5de1d

Comments (0)

Files changed (158)

images/in206.jpg

Added
New image

javascripts/fancybox.js

+/*
+ * FancyBox - jQuery Plugin
+ * Simple and fancy lightbox alternative
+ *
+ * Examples and documentation at: http://fancybox.net
+ * 
+ * Copyright (c) 2008 - 2010 Janis Skarnelis
+ * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
+ * 
+ * Version: 1.3.4 (11/11/2010)
+ * Requires: jQuery v1.3+
+ *
+ * Dual licensed under the MIT and GPL licenses:
+ *   http://www.opensource.org/licenses/mit-license.php
+ *   http://www.gnu.org/licenses/gpl.html
+ */
+
+;(function(b){var m,t,u,f,D,j,E,n,z,A,q=0,e={},o=[],p=0,d={},l=[],G=null,v=new Image,J=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,W=/[^\.]\.(swf)\s*$/i,K,L=1,y=0,s="",r,i,h=false,B=b.extend(b("<div/>")[0],{prop:0}),M=b.browser.msie&&b.browser.version<7&&!window.XMLHttpRequest,N=function(){t.hide();v.onerror=v.onload=null;G&&G.abort();m.empty()},O=function(){if(false===e.onError(o,q,e)){t.hide();h=false}else{e.titleShow=false;e.width="auto";e.height="auto";m.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>');
+F()}},I=function(){var a=o[q],c,g,k,C,P,w;N();e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));w=e.onStart(o,q,e);if(w===false)h=false;else{if(typeof w=="object")e=b.extend(e,w);k=e.title||(a.nodeName?b(a).attr("title"):a.title)||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(k===""&&e.orig&&e.titleFromAlt)k=e.orig.attr("alt");c=e.href||(a.nodeName?b(a).attr("href"):a.href)||null;if(/^(?:javascript)/i.test(c)||
+c=="#")c=null;if(e.type){g=e.type;if(!c)c=e.content}else if(e.content)g="html";else if(c)g=c.match(J)?"image":c.match(W)?"swf":b(a).hasClass("iframe")?"iframe":c.indexOf("#")===0?"inline":"ajax";if(g){if(g=="inline"){a=c.substr(c.indexOf("#"));g=b(a).length>0?"inline":"ajax"}e.type=g;e.href=c;e.title=k;if(e.autoDimensions)if(e.type=="html"||e.type=="inline"||e.type=="ajax"){e.width="auto";e.height="auto"}else e.autoDimensions=false;if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=
+false;e.enableEscapeButton=false;e.showCloseButton=false}e.padding=parseInt(e.padding,10);e.margin=parseInt(e.margin,10);m.css("padding",e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(j.children())});switch(g){case "html":m.html(e.content);F();break;case "inline":if(b(a).parent().is("#fancybox-content")===true){h=false;break}b('<div class="fancybox-inline-tmp" />').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(j.children())}).bind("fancybox-cancel",
+function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity();v=new Image;v.onerror=function(){O()};v.onload=function(){h=true;v.onerror=v.onload=null;e.width=v.width;e.height=v.height;b("<img />").attr({id:"fancybox-img",src:v.src,alt:e.title}).appendTo(m);Q()};v.src=c;break;case "swf":e.scrolling="no";C='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+c+
+'"></param>';P="";b.each(e.swf,function(x,H){C+='<param name="'+x+'" value="'+H+'"></param>';P+=" "+x+'="'+H+'"'});C+='<embed src="'+c+'" type="application/x-shockwave-flash" width="'+e.width+'" height="'+e.height+'"'+P+"></embed></object>";m.html(C);F();break;case "ajax":h=false;b.fancybox.showActivity();e.ajax.win=e.ajax.success;G=b.ajax(b.extend({},e.ajax,{url:c,data:e.ajax.data||{},error:function(x){x.status>0&&O()},success:function(x,H,R){if((typeof R=="object"?R:G).status==200){if(typeof e.ajax.win==
+"function"){w=e.ajax.win(c,x,H,R);if(w===false){t.hide();return}else if(typeof w=="string"||typeof w=="object")x=w}m.html(x);F()}}}));break;case "iframe":Q()}}else O()}},F=function(){var a=e.width,c=e.height;a=a.toString().indexOf("%")>-1?parseInt((b(window).width()-e.margin*2)*parseFloat(a)/100,10)+"px":a=="auto"?"auto":a+"px";c=c.toString().indexOf("%")>-1?parseInt((b(window).height()-e.margin*2)*parseFloat(c)/100,10)+"px":c=="auto"?"auto":c+"px";m.wrapInner('<div style="width:'+a+";height:"+c+
+";overflow: "+(e.scrolling=="auto"?"auto":e.scrolling=="yes"?"scroll":"hidden")+';position:relative;"></div>');e.width=m.width();e.height=m.height();Q()},Q=function(){var a,c;t.hide();if(f.is(":visible")&&false===d.onCleanup(l,p,d)){b.event.trigger("fancybox-cancel");h=false}else{h=true;b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");f.is(":visible")&&d.titlePosition!=="outside"&&f.css("height",f.height());l=o;p=q;d=e;if(d.overlayShow){u.css({"background-color":d.overlayColor,
+opacity:d.overlayOpacity,cursor:d.hideOnOverlayClick?"pointer":"auto",height:b(document).height()});if(!u.is(":visible")){M&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});u.show()}}else u.hide();i=X();s=d.title||"";y=0;n.empty().removeAttr("style").removeClass();if(d.titleShow!==false){if(b.isFunction(d.titleFormat))a=d.titleFormat(s,l,p,d);else a=s&&s.length?
+d.titlePosition=="float"?'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+s+'</td><td id="fancybox-title-float-right"></td></tr></table>':'<div id="fancybox-title-'+d.titlePosition+'">'+s+"</div>":false;s=a;if(!(!s||s==="")){n.addClass("fancybox-title-"+d.titlePosition).html(s).appendTo("body").show();switch(d.titlePosition){case "inside":n.css({width:i.width-d.padding*2,marginLeft:d.padding,marginRight:d.padding});
+y=n.outerHeight(true);n.appendTo(D);i.height+=y;break;case "over":n.css({marginLeft:d.padding,width:i.width-d.padding*2,bottom:d.padding}).appendTo(D);break;case "float":n.css("left",parseInt((n.width()-i.width-40)/2,10)*-1).appendTo(f);break;default:n.css({width:i.width-d.padding*2,paddingLeft:d.padding,paddingRight:d.padding}).appendTo(f)}}}n.hide();if(f.is(":visible")){b(E.add(z).add(A)).hide();a=f.position();r={top:a.top,left:a.left,width:f.width(),height:f.height()};c=r.width==i.width&&r.height==
+i.height;j.fadeTo(d.changeFade,0.3,function(){var g=function(){j.html(m.contents()).fadeTo(d.changeFade,1,S)};b.event.trigger("fancybox-change");j.empty().removeAttr("filter").css({"border-width":d.padding,width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2});if(c)g();else{B.prop=0;b(B).animate({prop:1},{duration:d.changeSpeed,easing:d.easingChange,step:T,complete:g})}})}else{f.removeAttr("style");j.css("border-width",d.padding);if(d.transitionIn=="elastic"){r=V();j.html(m.contents());
+f.show();if(d.opacity)i.opacity=0;B.prop=0;b(B).animate({prop:1},{duration:d.speedIn,easing:d.easingIn,step:T,complete:S})}else{d.titlePosition=="inside"&&y>0&&n.show();j.css({width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2}).html(m.contents());f.css(i).fadeIn(d.transitionIn=="none"?0:d.speedIn,S)}}}},Y=function(){if(d.enableEscapeButton||d.enableKeyboardNav)b(document).bind("keydown.fb",function(a){if(a.keyCode==27&&d.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if((a.keyCode==
+37||a.keyCode==39)&&d.enableKeyboardNav&&a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.target.tagName!=="SELECT"){a.preventDefault();b.fancybox[a.keyCode==37?"prev":"next"]()}});if(d.showNavArrows){if(d.cyclic&&l.length>1||p!==0)z.show();if(d.cyclic&&l.length>1||p!=l.length-1)A.show()}else{z.hide();A.hide()}},S=function(){if(!b.support.opacity){j.get(0).style.removeAttribute("filter");f.get(0).style.removeAttribute("filter")}e.autoDimensions&&j.css("height","auto");f.css("height","auto");
+s&&s.length&&n.show();d.showCloseButton&&E.show();Y();d.hideOnContentClick&&j.bind("click",b.fancybox.close);d.hideOnOverlayClick&&u.bind("click",b.fancybox.close);b(window).bind("resize.fb",b.fancybox.resize);d.centerOnScroll&&b(window).bind("scroll.fb",b.fancybox.center);if(d.type=="iframe")b('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" '+(b.browser.msie?'allowtransparency="true""':"")+' scrolling="'+e.scrolling+'" src="'+d.href+'"></iframe>').appendTo(j);
+f.show();h=false;b.fancybox.center();d.onComplete(l,p,d);var a,c;if(l.length-1>p){a=l[p+1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}if(p>0){a=l[p-1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}},T=function(a){var c={width:parseInt(r.width+(i.width-r.width)*a,10),height:parseInt(r.height+(i.height-r.height)*a,10),top:parseInt(r.top+(i.top-r.top)*a,10),left:parseInt(r.left+(i.left-r.left)*a,10)};if(typeof i.opacity!=="undefined")c.opacity=a<0.5?0.5:a;f.css(c);
+j.css({width:c.width-d.padding*2,height:c.height-y*a-d.padding*2})},U=function(){return[b(window).width()-d.margin*2,b(window).height()-d.margin*2,b(document).scrollLeft()+d.margin,b(document).scrollTop()+d.margin]},X=function(){var a=U(),c={},g=d.autoScale,k=d.padding*2;c.width=d.width.toString().indexOf("%")>-1?parseInt(a[0]*parseFloat(d.width)/100,10):d.width+k;c.height=d.height.toString().indexOf("%")>-1?parseInt(a[1]*parseFloat(d.height)/100,10):d.height+k;if(g&&(c.width>a[0]||c.height>a[1]))if(e.type==
+"image"||e.type=="swf"){g=d.width/d.height;if(c.width>a[0]){c.width=a[0];c.height=parseInt((c.width-k)/g+k,10)}if(c.height>a[1]){c.height=a[1];c.width=parseInt((c.height-k)*g+k,10)}}else{c.width=Math.min(c.width,a[0]);c.height=Math.min(c.height,a[1])}c.top=parseInt(Math.max(a[3]-20,a[3]+(a[1]-c.height-40)*0.5),10);c.left=parseInt(Math.max(a[2]-20,a[2]+(a[0]-c.width-40)*0.5),10);return c},V=function(){var a=e.orig?b(e.orig):false,c={};if(a&&a.length){c=a.offset();c.top+=parseInt(a.css("paddingTop"),
+10)||0;c.left+=parseInt(a.css("paddingLeft"),10)||0;c.top+=parseInt(a.css("border-top-width"),10)||0;c.left+=parseInt(a.css("border-left-width"),10)||0;c.width=a.width();c.height=a.height();c={width:c.width+d.padding*2,height:c.height+d.padding*2,top:c.top-d.padding-20,left:c.left-d.padding-20}}else{a=U();c={width:d.padding*2,height:d.padding*2,top:parseInt(a[3]+a[1]*0.5,10),left:parseInt(a[2]+a[0]*0.5,10)}}return c},Z=function(){if(t.is(":visible")){b("div",t).css("top",L*-40+"px");L=(L+1)%12}else clearInterval(K)};
+b.fn.fancybox=function(a){if(!b(this).length)return this;b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(c){c.preventDefault();if(!h){h=true;b(this).blur();o=[];q=0;c=b(this).attr("rel")||"";if(!c||c==""||c==="nofollow")o.push(this);else{o=b("a[rel="+c+"], area[rel="+c+"]");q=o.index(this)}I()}});return this};b.fancybox=function(a,c){var g;if(!h){h=true;g=typeof c!=="undefined"?c:{};o=[];q=parseInt(g.index,10)||0;if(b.isArray(a)){for(var k=
+0,C=a.length;k<C;k++)if(typeof a[k]=="object")b(a[k]).data("fancybox",b.extend({},g,a[k]));else a[k]=b({}).data("fancybox",b.extend({content:a[k]},g));o=jQuery.merge(o,a)}else{if(typeof a=="object")b(a).data("fancybox",b.extend({},g,a));else a=b({}).data("fancybox",b.extend({content:a},g));o.push(a)}if(q>o.length||q<0)q=0;I()}};b.fancybox.showActivity=function(){clearInterval(K);t.show();K=setInterval(Z,66)};b.fancybox.hideActivity=function(){t.hide()};b.fancybox.next=function(){return b.fancybox.pos(p+
+1)};b.fancybox.prev=function(){return b.fancybox.pos(p-1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a);o=l;if(a>-1&&a<l.length){q=a;I()}else if(d.cyclic&&l.length>1){q=a>=l.length?0:l.length-1;I()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");N();e.onCancel(o,q,e);h=false}};b.fancybox.close=function(){function a(){u.fadeOut("fast");n.empty().hide();f.hide();b.event.trigger("fancybox-cleanup");j.empty();d.onClosed(l,p,d);l=e=[];p=q=0;d=e={};h=false}if(!(h||f.is(":hidden"))){h=
+true;if(d&&false===d.onCleanup(l,p,d))h=false;else{N();b(E.add(z).add(A)).hide();b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");j.find("iframe").attr("src",M&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");d.titlePosition!=="inside"&&n.empty();f.stop();if(d.transitionOut=="elastic"){r=V();var c=f.position();i={top:c.top,left:c.left,width:f.width(),height:f.height()};if(d.opacity)i.opacity=1;n.empty().hide();B.prop=1;
+b(B).animate({prop:0},{duration:d.speedOut,easing:d.easingOut,step:T,complete:a})}else f.fadeOut(d.transitionOut=="none"?0:d.speedOut,a)}}};b.fancybox.resize=function(){u.is(":visible")&&u.css("height",b(document).height());b.fancybox.center(true)};b.fancybox.center=function(a){var c,g;if(!h){g=a===true?1:0;c=U();!g&&(f.width()>c[0]||f.height()>c[1])||f.stop().animate({top:parseInt(Math.max(c[3]-20,c[3]+(c[1]-j.height()-40)*0.5-d.padding)),left:parseInt(Math.max(c[2]-20,c[2]+(c[0]-j.width()-40)*0.5-
+d.padding))},typeof a=="number"?a:200)}};b.fancybox.init=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b('<div id="fancybox-tmp"></div>'),t=b('<div id="fancybox-loading"><div></div></div>'),u=b('<div id="fancybox-overlay"></div>'),f=b('<div id="fancybox-wrap"></div>'));D=b('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(f);
+D.append(j=b('<div id="fancybox-content"></div>'),E=b('<a id="fancybox-close"></a>'),n=b('<div id="fancybox-title"></div>'),z=b('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),A=b('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));E.click(b.fancybox.close);t.click(b.fancybox.cancel);z.click(function(a){a.preventDefault();b.fancybox.prev()});A.click(function(a){a.preventDefault();b.fancybox.next()});
+b.fn.mousewheel&&f.bind("mousewheel.fb",function(a,c){if(h)a.preventDefault();else if(b(a.target).get(0).clientHeight==0||b(a.target).get(0).scrollHeight===b(a.target).get(0).clientHeight){a.preventDefault();b.fancybox[c>0?"prev":"next"]()}});b.support.opacity||f.addClass("fancybox-ie");if(M){t.addClass("fancybox-ie6");f.addClass("fancybox-ie6");b('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank")+'" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(D)}}};
+b.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",
+easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};b(document).ready(function(){b.fancybox.init()})})(jQuery);

javascripts/jquery.placeholder.min.js

+/*
+* Placeholder plugin for jQuery
+* ---
+* Copyright 2010, Daniel Stocks (http://webcloud.se)
+* Released under the MIT, BSD, and GPL Licenses.
+*/
+
+(function(b){function d(a){this.input=a;a.attr("type")=="password"&&this.handlePassword();b(a[0].form).submit(function(){if(a.hasClass("placeholder")&&a[0].value==a.attr("placeholder"))a[0].value=""})}d.prototype={show:function(a){if(this.input[0].value===""||a&&this.valueIsPlaceholder()){if(this.isPassword)try{this.input[0].setAttribute("type","text")}catch(b){this.input.before(this.fakePassword.show()).hide()}this.input.addClass("placeholder");this.input[0].value=this.input.attr("placeholder")}},
+hide:function(){if(this.valueIsPlaceholder()&&this.input.hasClass("placeholder")&&(this.input.removeClass("placeholder"),this.input[0].value="",this.isPassword)){try{this.input[0].setAttribute("type","password")}catch(a){}this.input.show();this.input[0].focus()}},valueIsPlaceholder:function(){return this.input[0].value==this.input.attr("placeholder")},handlePassword:function(){var a=this.input;a.attr("realType","password");this.isPassword=!0;if(b.browser.msie&&a[0].outerHTML){var c=b(a[0].outerHTML.replace(/type=(['"])?password\1/gi,
+"type=$1text$1"));this.fakePassword=c.val(a.attr("placeholder")).addClass("placeholder").focus(function(){a.trigger("focus");b(this).hide()});b(a[0].form).submit(function(){c.remove();a.show()})}}};var e=!!("placeholder"in document.createElement("input"));b.fn.placeholder=function(){return e?this:this.each(function(){var a=b(this),c=new d(a);c.show(!0);a.focus(function(){c.hide()});a.blur(function(){c.show(!1)});b.browser.msie&&(b(window).load(function(){a.val()&&a.removeClass("placeholder");c.show(!0)}),
+a.focus(function(){if(this.value==""){var a=this.createTextRange();a.collapse(!0);a.moveStart("character",0);a.select()}}))})}})(jQuery);

javascripts/lib.js

+/**
+* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
+* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
+* 
+* @param  f  onMouseOver function || An object with configuration options
+* @param  g  onMouseOut function  || Nothing (use configuration options object)
+* @author    Brian Cherne <brian@cherne.net>
+*/
+(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);
+
+/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
+ * Licensed under the MIT License (LICENSE.txt).
+ *
+ * Version 2.1.2
+ */
+
+(function($){
+
+$.fn.bgiframe = ($.browser.msie && /msie 6\.0/i.test(navigator.userAgent) ? function(s) {
+    s = $.extend({
+        top     : 'auto', // auto == .currentStyle.borderTopWidth
+        left    : 'auto', // auto == .currentStyle.borderLeftWidth
+        width   : 'auto', // auto == offsetWidth
+        height  : 'auto', // auto == offsetHeight
+        opacity : true,
+        src     : 'javascript:false;'
+    }, s);
+    var html = '<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"'+
+                   'style="display:block;position:absolute;z-index:-1;'+
+                       (s.opacity !== false?'filter:Alpha(Opacity=\'0\');':'')+
+                       'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))+';'+
+                       'left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))+';'+
+                       'width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';'+
+                       'height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';'+
+                '"/>';
+    return this.each(function() {
+        if ( $(this).children('iframe.bgiframe').length === 0 )
+            this.insertBefore( document.createElement(html), this.firstChild );
+    });
+} : function() { return this; });
+
+// old alias
+$.fn.bgIframe = $.fn.bgiframe;
+
+function prop(n) {
+    return n && n.constructor === Number ? n + 'px' : n;
+}
+
+})(jQuery);
+
+/**
+ * jQuery.ScrollTo - Easy element scrolling using jQuery.
+ * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
+ * Dual licensed under MIT and GPL.
+ * Date: 5/25/2009
+ * @author Ariel Flesler
+ * @version 1.4.2
+ *
+ * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
+ */
+;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);
+
+/*
+ * jQuery throttle / debounce - v1.1 - 3/7/2010
+ * http://benalman.com/projects/jquery-throttle-debounce-plugin/
+ * 
+ * Copyright (c) 2010 "Cowboy" Ben Alman
+ * Dual licensed under the MIT and GPL licenses.
+ * http://benalman.com/about/license/
+ */
+(function(b,c){var $=b.jQuery||b.Cowboy||(b.Cowboy={}),a;$.throttle=a=function(e,f,j,i){var h,d=0;if(typeof f!=="boolean"){i=j;j=f;f=c}function g(){var o=this,m=+new Date()-d,n=arguments;function l(){d=+new Date();j.apply(o,n)}function k(){h=c}if(i&&!h){l()}h&&clearTimeout(h);if(i===c&&m>e){l()}else{if(f!==true){h=setTimeout(i?k:l,i===c?e-m:e)}}}if($.guid){g.guid=j.guid=j.guid||$.guid++}return g};$.debounce=function(d,e,f){return f===c?a(d,e,false):a(d,f,e!==false)}})(this);
+
+/* Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
+ * Dual licensed under the MIT (MIT_LICENSE.txt)
+ * and GPL Version 2 (GPL_LICENSE.txt) licenses.
+ *
+ * Version: 1.1.1
+ * Requires jQuery 1.3+
+ * Docs: http://docs.jquery.com/Plugins/livequery
+ */
+(function(a){a.extend(a.fn,{livequery:function(e,d,c){var b=this,f;if(a.isFunction(e)){c=d,d=e,e=undefined}a.each(a.livequery.queries,function(g,h){if(b.selector==h.selector&&b.context==h.context&&e==h.type&&(!d||d.$lqguid==h.fn.$lqguid)&&(!c||c.$lqguid==h.fn2.$lqguid)){return(f=h)&&false}});f=f||new a.livequery(this.selector,this.context,e,d,c);f.stopped=false;f.run();return this},expire:function(e,d,c){var b=this;if(a.isFunction(e)){c=d,d=e,e=undefined}a.each(a.livequery.queries,function(f,g){if(b.selector==g.selector&&b.context==g.context&&(!e||e==g.type)&&(!d||d.$lqguid==g.fn.$lqguid)&&(!c||c.$lqguid==g.fn2.$lqguid)&&!this.stopped){a.livequery.stop(g.id)}});return this}});a.livequery=function(b,d,f,e,c){this.selector=b;this.context=d;this.type=f;this.fn=e;this.fn2=c;this.elements=[];this.stopped=false;this.id=a.livequery.queries.push(this)-1;e.$lqguid=e.$lqguid||a.livequery.guid++;if(c){c.$lqguid=c.$lqguid||a.livequery.guid++}return this};a.livequery.prototype={stop:function(){var b=this;if(this.type){this.elements.unbind(this.type,this.fn)}else{if(this.fn2){this.elements.each(function(c,d){b.fn2.apply(d)})}}this.elements=[];this.stopped=true},run:function(){if(this.stopped){return}var d=this;var e=this.elements,c=a(this.selector,this.context),b=c.not(e);this.elements=c;if(this.type){b.bind(this.type,this.fn);if(e.length>0){a.each(e,function(f,g){if(a.inArray(g,c)<0){a.event.remove(g,d.type,d.fn)}})}}else{b.each(function(){d.fn.apply(this)});if(this.fn2&&e.length>0){a.each(e,function(f,g){if(a.inArray(g,c)<0){d.fn2.apply(g)}})}}}};a.extend(a.livequery,{guid:0,queries:[],queue:[],running:false,timeout:null,checkQueue:function(){if(a.livequery.running&&a.livequery.queue.length){var b=a.livequery.queue.length;while(b--){a.livequery.queries[a.livequery.queue.shift()].run()}}},pause:function(){a.livequery.running=false},play:function(){a.livequery.running=true;a.livequery.run()},registerPlugin:function(){a.each(arguments,function(c,d){if(!a.fn[d]){return}var b=a.fn[d];a.fn[d]=function(){var e=b.apply(this,arguments);a.livequery.run();return e}})},run:function(b){if(b!=undefined){if(a.inArray(b,a.livequery.queue)<0){a.livequery.queue.push(b)}}else{a.each(a.livequery.queries,function(c){if(a.inArray(c,a.livequery.queue)<0){a.livequery.queue.push(c)}})}if(a.livequery.timeout){clearTimeout(a.livequery.timeout)}a.livequery.timeout=setTimeout(a.livequery.checkQueue,20)},stop:function(b){if(b!=undefined){a.livequery.queries[b].stop()}else{a.each(a.livequery.queries,function(c){a.livequery.queries[c].stop()})}}});a.livequery.registerPlugin("append","prepend","after","before","wrap","attr","removeAttr","addClass","removeClass","toggleClass","empty","remove","html");a(function(){a.livequery.play()})})(jQuery);
+
+/*
+ * Copyright (C) 1999-2009 Jive Software. All rights reserved.
+ *
+ * This software is the proprietary information of Jive Software. Use is subject to license terms.
+ */
+
+/*
+* $ lightbox_me
+* By: Buck Wilson
+* Version : 2.2
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+
+(function($) {
+
+    $.fn.lightbox_me = function(options) {
+
+        return this.each(function() {
+
+            var
+                opts = $.extend({}, $.fn.lightbox_me.defaults, options),
+                $overlay = $('div.' + opts.classPrefix + '_overlay'),
+                $self = $(this),
+                $iframe = $('iframe#lb_iframe'),
+                ie6 = ($.browser.msie && $.browser.version < 7);
+            
+            if ($overlay.length > 0) {
+                $overlay[0].removeModal(); // if the overlay exists, then a modal probably exists. Ditch it!
+            } else {
+                $overlay =  $('<div class="' + opts.classPrefix + '_overlay" style="display:none;"/>'); // otherwise just create an all new overlay. 
+            }
+
+            $iframe = ($iframe.length > 0) ? $iframe : $iframe = $('<iframe id="lb_iframe" style="z-index: ' + (opts.zIndex + 1) + '; display: none; border: none; margin: 0; padding: 0; position: absolute; width: 100%; height: 100%; top: 0; left: 0;"/>');
+
+            /*----------------------------------------------------
+               DOM Building
+            ---------------------------------------------------- */
+            if (ie6) {
+                var src = /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank';
+                $iframe.attr('src', src);
+                $('body').append($iframe);
+            } // iframe shim for ie6, to hide select elements
+            $('body').append($self).append($overlay);
+
+            /*----------------------------------------------------
+               CSS stuffs
+            ---------------------------------------------------- */
+
+            // set css of the modal'd window
+
+            setSelfPosition();
+            $self.css({left: '50%', marginLeft: ($self.outerWidth() / 2) * -1,  zIndex: (opts.zIndex + 3) });
+
+            // set css of the overlay
+
+            setOverlayHeight(); // pulled this into a function because it is called on window resize.
+            $overlay.css({ position: 'absolute', width: '100%', top: 0, left: 0, right: 0, bottom: 0, zIndex: (opts.zIndex + 2) })
+                    .css(opts.overlayCSS);
+
+            /*----------------------------------------------------
+               Animate it in.
+            ---------------------------------------------------- */
+
+            if ($overlay.is(":hidden")) {
+                $overlay.fadeIn(opts.overlaySpeed, function() {
+                    $self[opts.appearEffect](opts.lightboxSpeed, function() { setOverlayHeight(); opts.onLoad()});
+                });
+            } else {
+                $self[opts.appearEffect](opts.lightboxSpeed, function() { setOverlayHeight(); opts.onLoad()});
+            }
+
+            /*----------------------------------------------------
+               Bind Events
+            ---------------------------------------------------- */
+
+            $(window).resize(setOverlayHeight)
+                     .resize(setSelfPosition)
+                     .scroll(setSelfPosition)
+                     .keydown(observeEscapePress);
+                     
+            $self.find(opts.closeSelector).click(function() { removeModal(true); return false; });
+            $overlay.click(function() { if(opts.closeClick){ removeModal(true); return false;} });
+
+            
+            $self.bind('close', function() { removeModal(true) });
+            $self.bind('resize', setSelfPosition);
+            $overlay[0].removeModal = removeModal;
+
+            /*----------------------------------------------------------------------------------------------------------------------------------------
+              ---------------------------------------------------------------------------------------------------------------------------------------- */
+
+            /*----------------------------------------------------
+               Private Functions
+            ---------------------------------------------------- */
+
+
+            function removeModal(removeO) {
+                // fades & removes modal, then unbinds events
+                $self[opts.disappearEffect](opts.lightboxDisappearSpeed, function() {
+                    
+                    if (removeO) {
+                      removeOverlay();  
+                    } 
+                    
+                    opts.destroyOnClose ? $self.remove() : $self.hide()
+                    
+                    
+                    $self.find(opts.closeSelector).unbind('click');
+                    $self.unbind('close');
+                    $self.unbind('resize');
+                    $(window).unbind('scroll', setSelfPosition);
+                    $(window).unbind('resize', setSelfPosition);
+                    
+                    
+                });
+            }
+            
+            
+            function removeOverlay() {
+                // fades & removes overlay, then unbinds events
+                $overlay.fadeOut(opts.overlayDisappearSpeed, function() {
+                    $(window).unbind('resize', setOverlayHeight);
+
+                    $overlay.remove();
+                    $overlay.unbind('click');
+                    
+                    
+                    opts.onClose();
+
+                })
+            }
+            
+
+
+            /* Function to bind to the window to observe the escape key press */
+            function observeEscapePress(e) {
+                if((e.keyCode == 27 || (e.DOM_VK_ESCAPE == 27 && e.which==0)) && opts.closeEsc) removeModal(true);
+            }
+
+            /* Set the height of the overlay
+                    : if the document height is taller than the window, then set the overlay height to the document height.
+                    : otherwise, just set overlay height: 100%
+            */
+            function setOverlayHeight() {
+                if ($(window).height() < $(document).height()) {
+                    $overlay.css({height: $(document).height() + 'px'});
+                } else {
+                    $overlay.css({height: '100%'});
+                    if (ie6) {$('html,body').css('height','100%'); } // ie6 hack for height: 100%; TODO: handle this in IE7
+                }
+            }
+
+            /* Set the position of the modal'd window ($self)
+                    : if $self is taller than the window, then make it absolutely positioned
+                    : otherwise fixed
+            */
+            function setSelfPosition() {
+                var s = $self[0].style;
+
+                if (($self.height() + 80  >= $(window).height()) && ($self.css('position') != 'absolute' || ie6)) {
+                    var topOffset = $(document).scrollTop() + 40;
+                    $self.css({position: 'absolute', top: topOffset + 'px', marginTop: 0})
+                    if (ie6) {
+                        s.removeExpression('top');
+                    }
+                } else if ($self.height()+ 80  < $(window).height()) {
+                    if (ie6) {
+                        s.position = 'absolute';
+                        if (opts.centered) {
+                            s.setExpression('top', '(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"')
+                            s.marginTop = 0;
+                        } else {
+                            var top = (opts.modalCSS && opts.modalCSS.top) ? parseInt(opts.modalCSS.top) : 0;
+                            s.setExpression('top', '((blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"')
+                        }
+                    } else {
+                        if (opts.centered) {
+                            $self.css({ position: 'fixed', top: '50%', marginTop: ($self.outerHeight() / 2) * -1})
+                        } else {
+                            $self.css({ position: 'fixed'}).css(opts.modalCSS);
+                        }
+                    }
+                }
+            }
+        });
+    };
+
+
+    $.fn.lightbox_me.defaults = {
+
+        // animation when appears
+        appearEffect: "fadeIn",
+        overlaySpeed: 300,
+        lightboxSpeed: "fast",
+        
+        // animation when dissapears
+        disappearEffect: "fadeOut",
+        overlayDisappearSpeed: 300,
+        lightboxDisappearSpeed: "fast",
+
+        // close
+        closeSelector: ".close",
+        closeClick: true,
+        closeEsc: true,
+
+        // behavior
+        destroyOnClose: false,
+
+        // callbacks
+        onLoad: function() {},
+        onClose: function() {},
+
+        // style
+        classPrefix: 'lb',
+        zIndex: 999,
+        centered: false,
+        modalCSS: {top: '40px'},
+        overlayCSS: {background: 'black', opacity: .6}
+    }
+
+
+})(jQuery);
+
+
+function buffer(fun, ms, context){
+   var buffer;
+   return function(){
+  	if(buffer) return;
+	buffer = setTimeout(function(){
+	   fun.call(this)
+	   buffer = undefined;
+	}, ms);
+   };
+}
+
+(function(){
+	var oDiv=document.getElementById("float");
+	if ( oDiv == undefined ) return false;
+	var H=0,iE6;
+	var Y=oDiv;
+	while(Y){H+=Y.offsetTop;Y=Y.offsetParent};
+	iE6=window.ActiveXObject&&!window.XMLHttpRequest;
+	function myscroll(){
+		var s=document.body.scrollTop||document.documentElement.scrollTop;
+		if (s >H ){
+			oDiv.className = "div1 div2";
+			if(iE6){oDiv.style.top=(s-H)+"px";}
+		}
+		else
+			oDiv.className = "div1";	
+	}
+	if(!iE6 || true){
+		window.onscroll= buffer(myscroll,150,this );
+	}
+	
+
+})();
+

javascripts/lib2nd.js

+// vote-records
+// application
+// app.js
+// report
+// ajaxlogin
+// jquery.poshytip.min
+var l = window.location.href;
+var currentUser;
+var VoteHistory = {
+	_Historys : null,
+	_IsValid  : null,
+	// set/get state for article
+	// return 1,0,-1 for state up, normal, down
+	voteState : function (article_id,state){
+		if (!this.isValid()) return 0;
+		if(state == null){
+			return this._Historys[article_id];
+		}else{
+			this._Historys[article_id] = state;	//TODO: state 0(currently not available)
+			this.saveHistory();
+		}
+	},
+
+	isValid : function(){
+		if(this._IsValid == null)
+			this._IsValid = window.localStorage ? true : false;
+		return this._IsValid;
+	},
+
+	// only read once
+	readHistory : function(){
+		this._Historys = window.localStorage.getItem('vote_history')
+		this._Historys = JSON.parse(this._Historys)
+		if(this._Historys == null) this._Historys ={}
+	},
+
+	saveHistory : function(){
+		if ( this._Historys == null) return
+		var maxItems = 500;
+		var getKeys = function(obj){
+		   var keys = [];
+		   for(var key in obj){
+		      keys.push(key);
+		   }
+		   return keys;
+		}
+		var keys = getKeys(this._Historys);
+		if(keys.length > maxItems){
+			var removes = keys.length - maxItems;
+			for(i =0;i<removes;i++)
+				delete this._Historys[keys[i]];
+		}
+		var data = JSON.stringify(this._Historys);
+		window.localStorage.setItem('vote_history',data);
+	},
+
+	_init : function(){
+		if(this.isValid() ) this.readHistory();
+	},
+
+	updateArticleStates : function(){
+		if(! this.isValid() ) return;
+		articles = [];
+		$.each($('div[id^=qiushi_counts_]'),function(){articles.push(+this.id.replace('qiushi_counts_',''))});
+		$.each(articles, function(i){
+			var id = articles[i];
+			var v = VoteHistory.voteState(id);
+			if (v != undefined ){
+				  var posscore = parseInt($('#up-'+id).text()),
+			          negscore = parseInt($('#dn-'+id).text()),
+			          d = (v>0?'up':'dn');
+			      v>0 ? posscore++ : negscore--;
+			      hidevotelink(id, d, posscore, negscore);
+			}
+
+		});
+	}
+};
+
+VoteHistory._init();
+//$(document).ready(function(){ VoteHistory._init(); VoteHistory.updateArticleStates();});
+
+// application.js
+(function($){$.setCookie=function(name,value,options){if(typeof name==='undefined'||typeof value==='undefined')
+return false;var str=name+'='+encodeURIComponent(value);if(options.domain)str+='; domain='+options.domain;if(options.path)str+='; path='+options.path;if(options.duration){var date=new Date();date.setTime(date.getTime()+options.duration*24*60*60*1000);str+='; expires='+date.toGMTString();}
+if(options.secure)str+='; secure';return document.cookie=str;};$.delCookie=function(name){return $.setCookie(name,'',{duration:-1});};$.readCookie=function(name){var value=document.cookie.match('(?:^|;)\\s*'+name.replace(/([-.*+?^${}()|[\]\/\\])/g,'\\$1')+'=([^;]*)');return(value)?decodeURIComponent(value[1]):null;};$.CooQueryVersion='v 2.0';})(jQuery);
+function shareToSina(id){
+  var s=screen,d=document,e=encodeURIComponent,a=$('#article'+id),u=$('.permlink', '#qiushi_counts_'+id).attr('href');
+  var f='http://v.t.sina.com.cn/share/share.php?',p=['url=',e(u),'&title=',e('糗事'+id),'&appkey=2924220432'].join('');
+  var a=function(){
+    if(!window.open(f+p,'mb',['toolbar=0,status=0,resizable=1,width=620,height=450,left=',(s.width-620)/2,',top=',(s.height-450)/2].join('')))u=f+p;
+  };
+  if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}
+}
+new function($) {
+  $.fn.setCursorPosition = function(pos) {
+    if ($(this).get(0).setSelectionRange) {
+      $(this).get(0).setSelectionRange(pos, pos);
+    } else if ($(this).get(0).createTextRange) {
+      var range = $(this).get(0).createTextRange();
+      range.collapse(true);
+      range.moveEnd('character', pos);
+      range.moveStart('character', pos);
+      range.select();
+    }
+  }
+}(jQuery);
+
+
+function showAnimation(containerId, actionValue){
+    var obj = $('#'+containerId),
+        pos = obj.offset(),
+        ani = $('<div id="vote-ani" class="'+(actionValue > 0 ? "pos" : "neg")+'" style="font-size:10px;z-index:1000">'+(actionValue > 0 ? "+1" : "-1")+"</div>");
+    ani.appendTo('body');
+//    pos.top += $(document).scrollTop()+5;
+//    pos.left += $(document).scrollLeft()+30;
+	  pos.top += 7;
+	  pos.left += 30;
+	  if(actionValue < 0 )
+	     pos.left += 5;
+    ani.offset(pos).css('display', 'block').animate({'font-size': '64px', opacity: 0, left: "-=40px"}, 350, 'linear', function(){ani.remove()});
+}
+
+function SelfXY(){
+    var yScrolltop;
+    var xScrollleft;
+    if (self.pageYOffset || self.pageXOffset) {
+        yScrolltop = self.pageYOffset;
+        xScrollleft = self.pageXOffset;
+    } else if (document.documentElement && document.documentElement.scrollTop || document.documentElement.scrollLeft ){     // Explorer 6 Strict
+        yScrolltop = document.documentElement.scrollTop;
+        xScrollleft = document.documentElement.scrollLeft;
+    } else if (document.body) {// all other Explorers
+        yScrolltop = document.body.scrollTop;
+        xScrollleft = document.body.scrollLeft;
+    }
+    arrayPageScroll = new Array(xScrollleft + event.clientX ,yScrolltop + event.clientY)
+    return arrayPageScroll;
+}
+
+var _Base64 = {
+
+	// private property
+_keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
+
+	 // private method for UTF-8 encoding
+_utf8_encode : function (string) {
+		       string = string.replace(/\r\n/g,"\n");
+		       var utftext = "";
+
+		       for (var n = 0; n < string.length; n++) {
+
+			       var c = string.charCodeAt(n);
+
+			       if (c < 128) {
+				       utftext += String.fromCharCode(c);
+			       }
+			       else if((c > 127) && (c < 2048)) {
+				       utftext += String.fromCharCode((c >> 6) | 192);
+				       utftext += String.fromCharCode((c & 63) | 128);
+			       }
+			       else {
+				       utftext += String.fromCharCode((c >> 12) | 224);
+				       utftext += String.fromCharCode(((c >> 6) & 63) | 128);
+				       utftext += String.fromCharCode((c & 63) | 128);
+			       }
+
+		       }
+
+		       return utftext;
+	       },
+        // private method for UTF-8 decoding
+        _utf8_decode : function (utftext) {
+                var string = [];
+        var i = 0, l = utftext.length;
+                var c = 0, c1 = 0, c2 = 0, c3 = 0;
+                while(i < l) {
+                        c = utftext.charCodeAt(i);
+                        if (c < 128) {
+                                string.push(String.fromCharCode(c));
+                                i++;
+                        }else if((c > 191) && (c < 224)) {
+                                c2 = utftext.charCodeAt(i+1);
+                                string.push(String.fromCharCode(((c & 31) << 6) | (c2 & 63)));
+                                i += 2;
+                        }else{
+                                c2 = utftext.charCodeAt(i+1);
+                                c3 = utftext.charCodeAt(i+2);
+                                string.push(String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)));
+                                i += 3;
+                        }
+
+                }
+
+                return string.join('');
+        },
+	  // public method for encoding
+	  encode : function (input) {
+		  var output = "";
+		  var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
+		  var i = 0;
+
+		  input = _Base64._utf8_encode(input);
+
+		  while (i < input.length) {
+
+			  chr1 = input.charCodeAt(i++);
+			  chr2 = input.charCodeAt(i++);
+			  chr3 = input.charCodeAt(i++);
+
+			  enc1 = chr1 >> 2;
+			  enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
+			  enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
+			  enc4 = chr3 & 63;
+
+			  if (isNaN(chr2)) {
+				  enc3 = enc4 = 64;
+			  } else if (isNaN(chr3)) {
+				  enc4 = 64;
+			  }
+
+			  output = output +
+				  this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +
+				  this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
+
+		  }
+
+		  return output;
+	  },
+	  // public method for decoding
+        decode : function (input) {
+                var output = [];
+                var chr1, chr2, chr3;
+                var enc1, enc2, enc3, enc4;
+                var i = 0;
+
+                input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
+        var l = input.length;
+                while (i < l) {
+                        enc1 = this._keyStr.indexOf(input.charAt(i++));
+                        enc2 = this._keyStr.indexOf(input.charAt(i++));
+                        enc3 = this._keyStr.indexOf(input.charAt(i++));
+                        enc4 = this._keyStr.indexOf(input.charAt(i++));
+
+                        chr1 = (enc1 << 2) | (enc2 >> 4);
+                        chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
+                        chr3 = ((enc3 & 3) << 6) | enc4;
+
+                        output.push(String.fromCharCode(chr1));
+
+                        if (enc3 != 64) {
+                                output.push(String.fromCharCode(chr2));
+                        }
+                        if (enc4 != 64) {
+                                output.push(String.fromCharCode(chr3));
+                        }
+                }
+
+                return this._utf8_decode(output.join(''));
+
+        }
+}
+
+/**
+ *  速度标记
+ *
+ */
+
+function SpeedTester(){
+    this.displayControlId = "divSpeed";
+
+    this.goodColor = "#33CC33";
+    this.averageColor = "#3300FF";
+    this.badColor = "#FF0033";
+
+    this.goodMessage = "仅用{0}秒就载入了整个页面,您的网络真棒";
+    this.averageMessage = "载入整个页面用了{0}秒,您的网络马马虎虎";
+    this.badMessage = "居然用了{0}秒才把整个页面载入进来,实在是抱歉";
+    this.goodSpeed = 10000;
+    this.averageSpeed = 50000;
+    this.badSpeed = 100000;
+
+    this.beginTest = function()    {
+        this.startTime = new Date();
+
+        window.onload = function(){
+            var displayControl =document.getElementById(SpeedTester.displayControlId);
+            if(!displayControl)return;
+            SpeedTester.endTime = new Date();
+
+            var spentTime = SpeedTester.endTime - SpeedTester.startTime;
+
+            if (spentTime <= SpeedTester.goodSpeed){
+                displayControl.style.backgroundColor = SpeedTester.goodColor;
+                displayControl.title = SpeedTester.goodMessage.replace("{0}", spentTime / 1000);
+            }else if (spentTime <= SpeedTester.averageSpeed){
+                displayControl.style.backgroundColor = SpeedTester.averageColor;
+                displayControl.title = SpeedTester.averageMessage.replace ("{0}", spentTime / 1000);
+            }else{
+                displayControl.style.backgroundColor = SpeedTester.badColor;
+                displayControl.title = SpeedTester.badMessage.replace("{0}", spentTime / 1000);
+            }
+        }
+    }
+}
+
+SpeedTester = new SpeedTester();
+SpeedTester.beginTest();
+
+function addBookmark(title,url) {
+    if (window.sidebar) {
+        window.sidebar.addPanel(title, url,"");
+    } else if( document.all ) {
+        window.external.AddFavorite( url, title);
+    } else if( window.opera && window.print ) {
+        return true;
+    }
+    return false;
+}
+
+function watch(id){
+  $('#favorite-'+id).children('a').attr('href', '/articles/remove_favorite/'+id).html('取消围观').removeClass('star').addClass('stared');
+}
+
+function unwatch(id){
+  $('#favorite-'+id).children('a').attr('href', '/articles/add_favorite/'+id).html('围观').removeClass('stared').addClass('star');
+}
+
+$(function(){
+    $('.favorite-button').click(function(){
+      if ( $(this).children('a').attr('href')!="/login" ){
+        new $(this).load($(this).children('a').attr('href'));
+        return false;}
+    else
+        return true;
+    });
+    $('input.numeric').keydown(function(e){
+        var k = e.keyCode;
+        if(((k>47)&&(k<58)) ||
+            (k == 8) ||
+            (k == 46)||
+            (k == 13)||
+            (k>=96 && k<=105)){
+            //            event.returnValue = true;
+            return true;
+        } else {
+            e.returnValue = false;
+            return false;
+        }
+    });
+});
+
+function open_form(id){
+    $('#quickform-' + id).show();
+    $('#reply-'+id).hide();
+}
+
+function close_form(id){
+    $('#quickform-' + id).hide();
+    $('#reply-'+id).show();
+}
+
+function reply(id){
+    var f = $('#quickform-' + id);
+    $.ajax({
+        type: "POST",
+        url: f.attr('action'),
+        data: f.serialize(),
+        success: function(){
+            $('#comment-'+id)
+        }
+    })
+    close_form(id);
+    return false;
+}
+
+
+function hidevotelink(id, d, p, n){
+    var posscore,negscore;
+    if(typeof p === 'undefined'){
+        posscore = parseInt($('#up-'+id).text());
+    }else{
+        posscore = p;
+    }
+    if(typeof n === 'undefined'){
+        negscore = parseInt($('#dn-'+id).text());
+    }else{
+        negscore = n;
+    }
+
+	$('#up-'+id).html(posscore) ;
+	$('#dn-'+id).html(negscore) ;
+	if( d == 'up')
+		$('#vote-up-'+id).find('a').addClass('voted');
+	else
+		$('#vote-dn-'+id).find('a').addClass('voted');
+	$('#vote-up-'+id).find('a').addClass('disable');
+	$('#vote-dn-'+id).find('a').addClass('disable');
+}
+
+var voteQueue=[];
+function vote2(id, v){
+    if($('#up-'+id).hasClass('disable') || $('#dn-'+id).hasClass('disable') )  return;
+    if(currentUser){
+      var posscore = parseInt($('#up-'+id).text()),
+          negscore = parseInt($('#dn-'+id).text()),
+          d = (v>0?'up':'dn');
+      showAnimation('vote-'+d+'-'+id, v);
+      $.getJSON('/articles/' + id + '/' + d);
+      v>0 ? posscore++ : negscore--;
+      hidevotelink(id, d,posscore, negscore);
+      VoteHistory.voteState(id,v);
+    }else{
+      //voteQueue.push(v>0?id:-id);
+      showLoginForm();
+      $(document).bind('after_logged_in', function(){
+        vote2(id, v);
+      })
+    }
+}
+
+
+function getCurUsr( data )
+{
+
+  if(data && data.user)
+    currentUser=data.user;
+  else
+	currentUser = null;
+  vote2m( curId, curV );
+}
+function mkvotestr( aid, uid , v )
+{
+	return v>0?_Base64.encode(aid+'+'+uid) : _Base64.encode(aid+'-'+uid);
+}
+
+var	curId;
+var	curV;
+function vote2m(id, v){
+     	if( !currentUser )
+    	{
+		if( $.readCookie('auth_token') )
+		{
+			curId = id;
+			curV = v;
+			$.getJSON('/session.js?'+(new Date().getTime()), getCurUsr);
+		}
+		else
+			window.location.href = '/login';
+	}
+      else{
+	var posscore = parseInt($('#pos-score-'+id).text()),
+       negscore = parseInt($('#neg-score-'+id).text()),
+          d = (v>0?'up':'dn');
+      showAnimation(d+'-'+id, v);
+    //  $.get('/articles/'+id+'/'+d);
+      v>0 ? posscore++ : negscore--;
+      hidevotelink(id, posscore, negscore);
+	$.get( '/new3/vote/='+mkvotestr(id,currentUser.id,v) ) ;
+	}
+
+      //voteQueue.push(v>0?id:-id);
+}
+
+var COMMENT_WARNING=    '请不要发表与本内容无关的评论,您有了账号就是有身份的人了,我们可认识您。';
+function clear_warning(e){
+    var t = $(this);
+    t.focus();
+    if($.trim(t.val()) == COMMENT_WARNING){
+        t.val('');
+	t.removeClass('original');
+    }
+    t.blur(function(){
+        var t=$(this);
+        if($.trim(t.val())==''){
+            t.val(COMMENT_WARNING);
+            t.addClass('original');
+        }
+    });
+}
+
+function postComment(){
+    var e =$(this),f = this.form, fe = $(f);
+    var v = $.trim(fe.find('.comment_input').val());
+    if(v == '' || v == COMMENT_WARNING){
+        return false;
+    }
+
+    $.post(f.action, fe.serialize(), function(data){
+        e.val('发表评论').attr('disabled', false);
+        fe.find(".comment_input").val('').height('50px');
+        var u = $('#r'+fe.attr('data-article_id'));
+        if(u.size()>0){
+			u.append(data);
+		}
+        else{
+          $(data).insertBefore(fe);
+        }
+    });
+    this.value = ('正在发表');
+    this.disabled = true;
+
+    return false;
+}
+
+function showall(id){
+  $('.hide', '#qiushi_comments_'+id).toggle();
+}
+$(function(){
+    $('#comment_submit').live('click', postComment);
+    $('.comment_input').live('click', clear_warning).live('mouseover', clear_warning);
+    var hash=window.location.hash;
+    if(hash.indexOf('#c-') === 0){
+        $(hash).click();
+    }
+});
+
+$(document).keypress(function(e){
+  if(e.ctrlKey && e.which == 13 || e.which == 10) {
+    var o=e.target;
+    if(o.form){
+        var f=$(o.form).find('input.comment_submit');
+        postComment.call(f[0]);
+    }
+  }
+});
+
+
+function loadScores(){
+    var ids=[];
+    $('.article').each(function(i,e){
+        var id = parseInt($(e).attr('id').replace('article', ''));
+        if(!isNaN(id) && id > 0){
+            ids.push(id);
+        }
+    })
+    if(ids.length == 0)return;
+    $.getJSON('/scores', {ids:ids.join(' ')}, function(data, status){
+        $.each(data, function(id, value){
+            var s = value.score;
+            $('#pos-score-'+id).text(s.pos);
+            $('#neg-score-'+id).text(s.neg);
+            if(value.rated){
+                hidevotelink(id,s.pos,s.neg);
+            }
+            if(typeof value.watched != 'undefined'){
+              if(value.watched){watch(id);}else{unwatch(id);}
+            }
+            if(s.public_comments_count==0){
+                $('#c-'+id).text('暂无评论');
+            }else{
+                $('#c-'+id).text(s.public_comments_count+'条评论');
+            }
+        });
+    })
+}
+$(loadScores);
+
+/*
+$(function(){
+$('.comment').live('mouseenter', function(){
+  $('.comment-score a', this).attr('visibility', 'display');
+}).live('mouseleave', function(){
+  $('.comment-score a', this).attr('visibility', 'hidden');
+})
+})*/
+function comment_vote(id,s){
+  var se = $('#comment-'+id+' .score');
+  se.text(parseInt(se.text())+s);
+  $('#comment-score-'+id+' a').css('visibility', 'hidden');
+  if('jStore' in jQuery){
+    if(jQuery.jStore.CurrentEngine.get('c'+id)){return}
+    jQuery.jStore.CurrentEngine.set('c'+id, true);
+  }
+  $.post('/comments/'+id+(s > 0 ? '/up' : '/dn'));
+  //return false;
+}
+
+$(function(){
+  $('.comment').live('mouseenter', function(){
+    $(this).addClass('hover');
+    if(currentUser){
+      $(this).children('.reply').css('visibility','visible');
+      $(this).children('.report').css('display','inline');
+    }
+  }).live('mouseleave', function(){
+    $(this).removeClass('hover');
+    $(this).children('.reply').css('visibility', 'hidden')
+    $(this).children('.report').css('display','none');
+  })
+})
+function replyComment(comment_id, article_id, floor){
+  var form = $('form', '#qiushi_comments_'+article_id), c = $('#comment-'+comment_id);
+  $('input[name=comment[parent_id]]',form).val(comment_id);
+
+  var t = $('textarea', form),o = t.val();
+  nv = '回复'+floor+'L:'+ (o == COMMENT_WARNING ? '' : o);
+  t.val(nv);
+  $.scrollTo(form, 1000);
+  t.focus();
+  t.setCursorPosition(nv.length);
+}
+
+//floorlink support
+function gotofloor(id,fl){
+  var comment=$('#comment-'+id),f=comment.siblings('.floor-'+fl);
+  if(f.size() > 0){ $.scrollTo(f, 1000) }
+}
+
+var createFloorLink=function (id, fi){
+ $('#fl-'+id+'-'+fi).click(function(e){
+   var a = $(this).attr('id').split('-');
+   gotofloor(parseInt(a[1]),parseInt(a[2]));
+   e.preventDefault();
+ }).poshytip({
+   className: 'tip-twitter',
+ 	alignX: 'center',
+	showTimeout: 1,
+	allowTipHover: false,
+	fade: false,
+	slide: false,
+//	hideTimeout: 50000,
+    content: function(){
+       var htmlc = $('#comment-'+id).parents('div').contents('.floor-'+fi).html() ;
+	return htmlc;
+   }
+ })
+}
+
+function floorLink(){
+    $('.comment-block').each(function(i,e){
+      e = $(e);
+      lz = $(this.parentNode.parentNode.parentNode).find('.author>a');
+      lx = e.find(".userlogin>a")
+      if (lz.length>0 && lx.length>0)
+	if(lx[0].href==lz[0].href){
+		e.find(".userlogin").attr('class','userlogin hostname')
+	}
+      
+      var b = e.find('.body');
+      var content = b.html();
+ 	  var id = parseInt(e.attr('id').replace('comment-',''));
+      content=content.replace(/(\d+)(f|F|L|l|楼)/g, function(o,i){
+        if($.browser.msie){
+        setTimeout("createFloorLink("+id+", "+i+")", 200);
+        }else{
+        setTimeout(createFloorLink, 200, id, i);
+        }
+        return "<a href='#comment-"+id+"' id='fl-"+id+"-"+i+"'>"+o+"</a>";
+      });
+
+      b.html(content);
+    });
+}
+
+//$(floorLink);
+
+//app.js
+function article_comments_path(id){
+  return '/articles/'+id+'/comments';
+}
+function loadComments(e){
+  var l=$(this);
+  var id = /\d+/.exec(l.attr('id'));
+  if(!id) return;
+  id=id[0];
+  var comments_el = $('#qiushi_comments_'+id);
+  if(comments_el.size() == 0){
+      var xx = l.html();
+      l.text('...');
+      $.get(article_comments_path(id), null, function(data){
+
+	      $('#qiushi_counts_'+id).after(data).toggleClass('qiushi_counts_afterclick');
+		$("#l"+id).height( $('#r'+id).height() ) ;
+          comments_el.show();
+          l.html(xx).trigger('loaded');
+          // l.html(xx);
+          if(typeof decrypt == 'function'){l.ready(decrypt)}
+          l.ready(floorLink);
+      });
+  }else{
+      comments_el.toggle();
+	$('#qiushi_counts_'+id).toggleClass('qiushi_counts_afterclick');
+  }
+//  window.location.hash = l.attr('id');
+  l.blur();
+  e.preventDefault();
+}
+function showall(id){
+  $('.hide', '#qiushi_comments_'+id).toggle();
+}
+function closeComments(e){
+	var l = $(this) ;
+	var id = /\d+/.exec( l.attr('id' )) ;
+	id = id[0];
+	$('#qiushi_comments_'+id).toggle() ;
+	window.location.hash = '#qiushi_counts_'+id;
+}
+
+
+function dbclose(e)
+{
+	$(this).toggle();
+	var l = $(this) ;
+	var id = /\d+/.exec( l.attr('id' )) ;
+	id = id[0];
+	window.location.hash = '#qiushi_counts_'+id;
+}
+
+var	qiushiMap = {};
+var	qiushiOff = 2;
+var	theme = 'hot' ;
+var	bMore = true;
+
+function tagRepl()
+{
+	var	ret = 0 ;
+	$(".untagged").each( function(i){
+
+		$(this).toggleClass('untagged') ;
+		if( qiushiMap[$(this).attr("id")] )
+			$(this).hide();
+		else {
+			qiushiMap[$(this).attr("id")] = 1;
+			ret ++ ;
+		}
+
+	});
+}
+
+function showMore()
+{
+	$("#loadingBar").show();
+	$("#loadError").hide();
+
+
+	$.ajax( {
+		type :"GET" ,
+		url :  '/new2/'+theme+'/5/page/'+ qiushiOff++ +'?more',
+		dataType : "html",
+
+		success:function( data ) {
+			$(".qiushiData").append(data);
+			$("#loadingBar").hide();
+			if( tagRepl() <= 0 )
+				$("#loadError").show();
+		},
+		 error:function (xhr, ajaxOptions, thrownError){
+			qiushiOff -- ;
+			$("#loadingBar").hide();
+			$("#loadError").show();
+                }
+	});
+
+}
+function truncTitle( text )
+{
+	var i = 0 ;
+	var ret = 0;
+	var str = text.replace( /[ \-=\n]+/g, ' ' );
+	return  str.substring(0,20) ;
+
+}
+function shareQiushi()
+{
+	var l = $(this) ;
+	var id = /\d+/.exec( l.attr('id' )) ;
+	id = id[0];
+	var node = $('#qiushi_tag_'+id+' div.content' ) ;
+	var pic = $('#qiushi_tag_'+id+' div.thumb img' ) ;
+	var title = truncTitle( node.text() ) ;
+
+	var msg = {msg:title, title:"糗事百科", pic: pic?"":pic.attr("src"),
+		desc:node.text(), param:"" };
+	qplus.system.shareApp( msg );
+
+	alert( title ) ;
+}
+$(function(){
+    $('a.qiushi_comments').live( "click", loadComments);
+	$('a.more').click( showMore ) ;
+    $('a.closebtn').live( "click", closeComments) ;
+    $('div.comments-close').live( "click", closeComments) ;
+    $('a.sharebtn').live( "click", shareQiushi) ;
+    $('div#loadError').live( "click", showMore) ;
+    $("div.block").hover(function(){
+	$(this).find("li.uptip span").fadeIn(300);}, function(){$(this).find( "li.uptip span" ).fadeOut(300);});
+    // $('div.comments').live("dblclick",  dbclose );
+//	$('a#logintop').click( showLoginForm ) ;
+});
+
+$(document).ready(function (){
+	$("a").bind("focus",function() {
+		if(this.blur) {this.blur()};
+	});
+	//$("#loadingBar").hide();
+	//$("#loadError").hide();
+	var regex = /\/new2\/(\w+)/.exec( document.URL ) ;
+	if( regex )
+		theme = regex[1];
+	/*
+    $(".col2").scroll(function(){
+	  if( qiushiOff > 95 )
+		bMore = false ;
+          if( bMore && $(this)[0].scrollTop + $(this).height() == $(this)[0].scrollHeight )
+		showMore();
+	 });
+	*/
+});
+
+//report
+var showReport;
+$(function(){
+  showReport = function(comment_id){
+    var el = $('#comment-'+comment_id+' .report'), o = el.offset(), cmt=$('#comment-'+comment_id);
+    o.top += el.height();
+    o.left += el.width();
+    $('#report-form').trigger('close');
+    cmt.addClass('highlight');
+    $('#report-form input[name=comment_id]').val(comment_id);
+    $('#report-form').css('display', 'block').offset(o);
+  }
+  $('#report-form').bind('close', function(){
+    $(this).css('display', 'none');
+    $('.highlight').removeClass('highlight');
+  });
+  $('#report-form form').submit(function(){
+    var cmt_id = this.comment_id.value, a = this.action = 'http://n17.qiushibaike.com/comments/'+ cmt_id + '/report',
+        f = $(this);
+    submit_button=$('button[type=submit]', this).attr('disabled', 'disabled');
+    $.post(a, f.serialize(), function(){
+     // submit_button.attr('disabled', '');
+	submit_button.removeAttr( 'disabled' ) ;
+      $('#report-form').trigger('close');
+	$('#report-form').find('input[type=radio]').prop('checked',false);
+    });
+   submit_button.removeAttr( 'disabled' ) ;
+   $('#report-form').trigger('close');
+   $('#report-form').find('input[type=radio]').prop('checked',false);
+    return false;
+  });
+  $('#close-form').click(function(event){
+    event.preventDefault();
+    $('#report-form').trigger('close');
+  });
+});
+
+
+//ajax login
+/* after logged in, the document will receive 'after_logged_in' event */
+function showLogin(){
+	
+  if($.browser.msie){
+    document.styleSheets[0].addRule('.login', 'display:block !important');
+  }else{
+    document.styleSheets[0].insertRule('.login{display:block !important;}',0);
+  }
+  
+  showLogout('none');
+}
+
+function showSuggest(){
+  if($.browser.msie){
+    document.styleSheets[0].addRule('.suggest-form', 'display:inline !important');
+  }else{
+    document.styleSheets[0].insertRule('.suggest-form{display:inline !important;}',0);
+  }
+}
+
+function showLogout(type){
+  type = type || 'inherited';
+  if($.browser.msie){
+    document.styleSheets[0].addRule('.logout', 'display:'+type+' !important');
+  }else{
+    document.styleSheets[0].insertRule('.logout {display:'+type+' !important;}',0);
+  }
+}
+
+function loadLoginCookie(){
+    var user = $.readCookie('user');
+    if(user){
+        try{
+          //user = '{"unread_messages_count": 0, "user": {"login": "'+_Base64.decode(user)+'"}}';
+          user = eval('('+user+')');
+          loadLogin(user);
+          return user;
+        }catch(e){
+
+        }
+    }
+    if($.readCookie('auth_token') || $.readCookie('_session_id'))
+        return $.getJSON('/session.js?'+(new Date().getTime()), loadLogin);
+    else
+        return '{}'
+}
+function loadLogin(data){
+  if(data){
+    currentUser = data;
+    $('.username').text(currentUser.login);
+    //$('.login').toggleClass( "hidden" );
+    showLogout('none');
+    if(data.unread_messages_count > 0){
+	$('#unread_messages_count').text(data.unread_messages_count);
+	document.title = '您收到'+data.unread_messages_count+'个小纸条 | '+document.title;
+	$('#unread_messages_count').css('display','');
+    }
+    else{
+	$('#unread_messages_count').hide();
+    }
+    if(data.unread_notifications_count && data.unread_notifications_count > 0){
+      $('#unread_notifications_count').text(data.unread_notifications_count);
+    }
+    showLogin();
+    VoteHistory.updateArticleStates();
+    queryNewMessage();
+  }else{
+    currentUser=null;
+    showLogout();
+  }
+}
+$(loadLoginCookie);
+
+function showLoginForm(){
+  $('#login-form').lightbox_me({
+  centered: true,
+  onLoad: function() {
+      $('#login').focus()
+      }
+  });
+}
+function showSuggestForm(){
+  $('#suggest-form').lightbox_me({
+  centered: true,
+  onLoad: function() {
+      $('#suggest-text').focus()
+      }
+  });
+}
+function startQueryNewMessage()
+{
+	$(document).ready(function() {
+		setInterval('queryNewMessage()',5*60*1000);
+	});
+}
+var msg_regexp = new RegExp('您收到\\d+个小纸条');
+function queryNewMessage(){
+	if(currentUser){	
+        	$.ajax({
+                    type: "GET",
+                    url: "/new4/messages?query_new_msg=" + Math.floor(Math.random()*316661),
+                    dataType: "text",
+                    success: function(msg) {
+			newmsg = parseInt(msg);
+                    	if(newmsg && newmsg>0){
+				$('#unread_messages_count').text(newmsg);
+				reg_result = msg_regexp.exec(document.title)
+				if(reg_result){
+					document.title = document.title.replace(reg_result,'您收到'+newmsg+'个小纸条')
+				}
+				else{
+					document.title = '您收到'+newmsg+'个小纸条 | '+document.title;
+				}
+				$('#unread_messages_count').css('display','');
+			}
+                    }
+        	});
+	}
+}
+$(startQueryNewMessage);
+$(function(){
+  $('.need-login').click(function(e){
+    e.preventDefault();
+    showLoginForm();
+  });
+  $('#login-form button[type=submit]').click(function(e){
+    e.preventDefault();
+    var form = $(this);
+    var name = $(this.form).find('input#login').val();
+    var pass = $(this.form).find('input#password').val();
+    if(name.length ==0 || pass.length ==0) return false;
+    this.disabled=true;
+    this.value='正在登录...';
+    $(this.form).submit();
+    return false
+  });
+
+  $('#suggest-form button[type=submit]').click(function(e){
+    e.preventDefault();
+    this.disabled=true;
+    this.value='正在提交...';
+    $(this.form).submit();
+    return false
+  });
+
+  $('#suggest-form form').submit(function(e){
+    e.preventDefault();
+    var form = $(this);
+    $.post('/new2/suggest', form.serialize(), function(data){
+
+	$('#suggest-form').trigger('close');
+      $('button[type=submit]', form).attr('disabled', '').val('提交建议');
+      $('#suggest-text')[0].value = '';
+  	$('#suggest-form button[type=submit]').attr("disabled", false ) ;
+
+    }, 'json')
+    return false;
+  })
+  $('#login-form form').submit(function(e){
+    e.preventDefault();
+    var form = $(this);
+    $.post('/session.js', form.serialize(), function(data){
+      $('button[type=submit]', form).attr('disabled', '').val('登录');
+
+    	$('#login-form button[type=submit]').attr("disabled",false);
+      if('error' in data){
+        form.children('#error').text(data['error']);
+	form.find('.inputbox input').addClass('error');
+	$('#login-form').effect("shake",{times:3,distance:10},100);
+      }else{
+        /*
+        if($.browser.msie){
+          document.styleSheets[0].removeRule('.logout');
+        }else{
+          if(document.styleSheets[0].cssRules[0].selectorText == '.logout'){
+            document.styleSheets[0].deleteRule(0);
+          }
+        }*/
+        loadLogin(data);
+        $('#login-form').trigger('close');
+        $(document).trigger('after_logged_in');
+      }
+    }, 'json')
+    return false;
+  })
+});
+
+/*
+ * Poshy Tip jQuery plugin v1.1
+ * http://vadikom.com/tools/poshy-tip-jquery-plugin-for-stylish-tooltips/
+ * Copyright 2010-2011, Vasil Dinkov, http://vadikom.com/
+ */
+
+(function(e){var a=[],d=/^url\(["']?([^"'\)]*)["']?\);?$/i,c=/\.png$/i,b=e.browser.msie&&e.browser.version==6;function f(){e.each(a,function(){this.refresh(true)})}e(window).resize(f);e.Poshytip=function(h,g){this.$elm=e(h);this.opts=e.extend({},e.fn.poshytip.defaults,g);this.$tip=e(['<div class="',this.opts.className,'">','<div class="tip-inner tip-bg-image"></div>','<div class="tip-arrow tip-arrow-top tip-arrow-right tip-arrow-bottom tip-arrow-left"></div>',"</div>"].join("")).appendTo(document.body);this.$arrow=this.$tip.find("div.tip-arrow");this.$inner=this.$tip.find("div.tip-inner");this.disabled=false;this.content=null;this.init()};e.Poshytip.prototype={init:function(){a.push(this);var g=this.$elm.attr("title");this.$elm.data("title.poshytip",g!==undefined?g:null).data("poshytip",this);if(this.opts.showOn!="none"){this.$elm.bind({"mouseenter.poshytip":e.proxy(this.mouseenter,this),"mouseleave.poshytip":e.proxy(this.mouseleave,this)});switch(this.opts.showOn){case"hover":if(this.opts.alignTo=="cursor"){this.$elm.bind("mousemove.poshytip",e.proxy(this.mousemove,this))}if(this.opts.allowTipHover){this.$tip.hover(e.proxy(this.clearTimeouts,this),e.proxy(this.mouseleave,this))}break;case"focus":this.$elm.bind({"focus.poshytip":e.proxy(this.show,this),"blur.poshytip":e.proxy(this.hide,this)});break}}},mouseenter:function(g){if(this.disabled){return true}this.$elm.attr("title","");if(this.opts.showOn=="focus"){return true}this.clearTimeouts();this.showTimeout=setTimeout(e.proxy(this.show,this),this.opts.showTimeout)},mouseleave:function(g){if(this.disabled||this.asyncAnimating&&(this.$tip[0]===g.relatedTarget||jQuery.contains(this.$tip[0],g.relatedTarget))){return true}var h=this.$elm.data("title.poshytip");if(h!==null){this.$elm.attr("title",h)}if(this.opts.showOn=="focus"){return true}this.clearTimeouts();this.hideTimeout=setTimeout(e.proxy(this.hide,this),this.opts.hideTimeout)},mousemove:function(g){if(this.disabled){return true}this.eventX=g.pageX;this.eventY=g.pageY;if(this.opts.followCursor&&this.$tip.data("active")){this.calcPos();this.$tip.css({left:this.pos.l,top:this.pos.t});if(this.pos.arrow){this.$arrow[0].className="tip-arrow tip-arrow-"+this.pos.arrow}}},show:function(){if(this.disabled||this.$tip.data("active")){return}this.reset();this.update();this.display();if(this.opts.timeOnScreen){setTimeout(e.proxy(this.hide,this),this.opts.timeOnScreen)}},hide:function(){if(this.disabled||!this.$tip.data("active")){return}this.display(true)},reset:function(){this.$tip.queue([]).detach().css("visibility","hidden").data("active",false);this.$inner.find("*").poshytip("hide");if(this.opts.fade){this.$tip.css("opacity",this.opacity)}this.$arrow[0].className="tip-arrow tip-arrow-top tip-arrow-right tip-arrow-bottom tip-arrow-left";this.asyncAnimating=false},update:function(j,k){if(this.disabled){return}var i=j!==undefined;if(i){if(!k){this.opts.content=j}if(!this.$tip.data("active")){return}}else{j=this.opts.content}var h=this,g=typeof j=="function"?j.call(this.$elm[0],function(l){h.update(l)}):j=="[title]"?this.$elm.data("title.poshytip"):j;if(this.content!==g){this.$inner.empty().append(g);this.content=g}this.refresh(i)},refresh:function(h){if(this.disabled){return}if(h){if(!this.$tip.data("active")){return}var k={left:this.$tip.css("left"),top:this.$tip.css("top")}}this.$tip.css({left:0,top:0}).appendTo(document.body);if(this.opacity===undefined){this.opacity=this.$tip.css("opacity")}var l=this.$tip.css("background-image").match(d),m=this.$arrow.css("background-image").match(d);if(l){var i=c.test(l[1]);if(b&&i){this.$tip.css("background-image","none");this.$inner.css({margin:0,border:0,padding:0});l=i=false}else{this.$tip.prepend('<table border="0" cellpadding="0" cellspacing="0"><tr><td class="tip-top tip-bg-image" colspan="2"><span></span></td><td class="tip-right tip-bg-image" rowspan="2"><span></span></td></tr><tr><td class="tip-left tip-bg-image" rowspan="2"><span></span></td><td></td></tr><tr><td class="tip-bottom tip-bg-image" colspan="2"><span></span></td></tr></table>').css({border:0,padding:0,"background-image":"none","background-color":"transparent"}).find(".tip-bg-image").css("background-image",'url("'+l[1]+'")').end().find("td").eq(3).append(this.$inner)}if(i&&!e.support.opacity){this.opts.fade=false}}if(m&&!e.support.opacity){if(b&&c.test(m[1])){m=false;this.$arrow.css("background-image","none")}this.opts.fade=false}var o=this.$tip.find("table");if(b){this.$tip[0].style.width="";o.width("auto").find("td").eq(3).width("auto");var n=this.$tip.width(),j=parseInt(this.$tip.css("min-width")),g=parseInt(this.$tip.css("max-width"));if(!isNaN(j)&&n<j){n=j}else{if(!isNaN(g)&&n>g){n=g}}this.$tip.add(o).width(n).eq(0).find("td").eq(3).width("100%")}else{if(o[0]){o.width("auto").find("td").eq(3).width("auto").end().end().width(document.defaultView&&document.defaultView.getComputedStyle&&parseFloat(document.defaultView.getComputedStyle(this.$tip[0],null).width)||this.$tip.width()).find("td").eq(3).width("100%")}}this.tipOuterW=this.$tip.outerWidth();this.tipOuterH=this.$tip.outerHeight();this.calcPos();if(m&&this.pos.arrow){this.$arrow[0].className="tip-arrow tip-arrow-"+this.pos.arrow;this.$arrow.css("visibility","inherit")}if(h){this.asyncAnimating=true;var p=this;this.$tip.css(k).animate({left:this.pos.l,top:this.pos.t},200,function(){p.asyncAnimating=false})}else{this.$tip.css({left:this.pos.l,top:this.pos.t})}},display:function(h){var i=this.$tip.data("active");if(i&&!h||!i&&h){return}this.$tip.stop();if((this.opts.slide&&this.pos.arrow||this.opts.fade)&&(h&&this.opts.hideAniDuration||!h&&this.opts.showAniDuration)){var m={},l={};if(this.opts.slide&&this.pos.arrow){var k,g;if(this.pos.arrow=="bottom"||this.pos.arrow=="top"){k="top";g="bottom"}else{k="left";g="right"}var j=parseInt(this.$tip.css(k));m[k]=j+(h?0:(this.pos.arrow==g?-this.opts.slideOffset:this.opts.slideOffset));l[k]=j+(h?(this.pos.arrow==g?this.opts.slideOffset:-this.opts.slideOffset):0)+"px"}if(this.opts.fade){m.opacity=h?this.$tip.css("opacity"):0;l.opacity=h?0:this.opacity}this.$tip.css(m).animate(l,this.opts[h?"hideAniDuration":"showAniDuration"])}h?this.$tip.queue(e.proxy(this.reset,this)):this.$tip.css("visibility","inherit");this.$tip.data("active",!i)},disable:function(){this.reset();this.disabled=true},enable:function(){this.disabled=false},destroy:function(){this.reset();this.$tip.remove();delete this.$tip;this.content=null;this.$elm.unbind(".poshytip").removeData("title.poshytip").removeData("poshytip");a.splice(e.inArray(this,a),1)},clearTimeouts:function(){if(this.showTimeout){clearTimeout(this.showTimeout);this.showTimeout=0}if(this.hideTimeout){clearTimeout(this.hideTimeout);this.hideTimeout=0}},calcPos:function(){var n={l:0,t:0,arrow:""},h=e(window),k={l:h.scrollLeft(),t:h.scrollTop(),w:h.width(),h:h.height()},p,j,m,i,q,g;if(this.opts.alignTo=="cursor"){p=j=m=this.eventX;i=q=g=this.eventY}else{var o=this.$elm.offset(),l={l:o.left,t:o.top,w:this.$elm.outerWidth(),h:this.$elm.outerHeight()};p=l.l+(this.opts.alignX!="inner-right"?0:l.w);j=p+Math.floor(l.w/2);m=p+(this.opts.alignX!="inner-left"?l.w:0);i=l.t+(this.opts.alignY!="inner-bottom"?0:l.h);q=i+Math.floor(l.h/2);g=i+(this.opts.alignY!="inner-top"?l.h:0)}switch(this.opts.alignX){case"right":case"inner-left":n.l=m+this.opts.offsetX;if(n.l+this.tipOuterW>k.l+k.w){n.l=k.l+k.w-this.tipOuterW}if(this.opts.alignX=="right"||this.opts.alignY=="center"){n.arrow="left"}break;case"center":n.l=j-Math.floor(this.tipOuterW/2);if(n.l+this.tipOuterW>k.l+k.w){n.l=k.l+k.w-this.tipOuterW}else{if(n.l<k.l){n.l=k.l}}break;default:n.l=p-this.tipOuterW-this.opts.offsetX;if(n.l<k.l){n.l=k.l}if(this.opts.alignX=="left"||this.opts.alignY=="center"){n.arrow="right"}}switch(this.opts.alignY){case"bottom":case"inner-top":n.t=g+this.opts.offsetY;if(!n.arrow||this.opts.alignTo=="cursor"){n.arrow="top"}if(n.t+this.tipOuterH>k.t+k.h){n.t=i-this.tipOuterH-this.opts.offsetY;if(n.arrow=="top"){n.arrow="bottom"}}break;case"center":n.t=q-Math.floor(this.tipOuterH/2);if(n.t+this.tipOuterH>k.t+k.h){n.t=k.t+k.h-this.tipOuterH}else{if(n.t<k.t){n.t=k.t}}break;default:n.t=i-this.tipOuterH-this.opts.offsetY;if(!n.arrow||this.opts.alignTo=="cursor"){n.arrow="bottom"}if(n.t<k.t){n.t=g+this.opts.offsetY;if(n.arrow=="bottom"){n.arrow="top"}}}this.pos=n}};e.fn.poshytip=function(h){if(typeof h=="string"){var g=arguments,k=h;Array.prototype.shift.call(g);if(k=="destroy"){this.die("mouseenter.poshytip").die("focus.poshytip")}return this.each(function(){var l=e(this).data("poshytip");if(l&&l[k]){l[k].apply(l,g)}})}var i=e.extend({},e.fn.poshytip.defaults,h);if(!e("#poshytip-css-"+i.className)[0]){e(['<style id="poshytip-css-',i.className,'" type="text/css">',"div.",i.className,"{visibility:hidden;position:absolute;top:0;left:0;}","div.",i.className," table, div.",i.className," td{margin:0;font-family:inherit;font-size:inherit;font-weight:inherit;font-style:inherit;font-variant:inherit;}","div.",i.className," td.tip-bg-image span{display:block;font:1px/1px sans-serif;height:",i.bgImageFrameSize,"px;width:",i.bgImageFrameSize,"px;overflow:hidden;}","div.",i.className," td.tip-right{background-position:100% 0;}","div.",i.className," td.tip-bottom{background-position:100% 100%;}","div.",i.className," td.tip-left{background-position:0 100%;}","div.",i.className," div.tip-inner{background-position:-",i.bgImageFrameSize,"px -",i.bgImageFrameSize,"px;}","div.",i.className," div.tip-arrow{visibility:hidden;position:absolute;overflow:hidden;font:1px/1px sans-serif;}","</style>"].join("")).appendTo("head")}if(i.liveEvents&&i.showOn!="none"){var j=e.extend({},i,{liveEvents:false});switch(i.showOn){case"hover":this.live("mouseenter.poshytip",function(){var l=e(this);if(!l.data("poshytip")){l.poshytip(j).poshytip("mouseenter")}});break;case"focus":this.live("focus.poshytip",function(){var l=e(this);if(!l.data("poshytip")){l.poshytip(j).poshytip("show")}});break}return this}return this.each(function(){new e.Poshytip(this,i)})};e.fn.poshytip.defaults={content:"[title]",className:"tip-yellow",bgImageFrameSize:10,showTimeout:500,hideTimeout:100,timeOnScreen:0,showOn:"hover",liveEvents:false,alignTo:"cursor",alignX:"right",alignY:"top",offsetX:-22,offsetY:18,allowTipHover:true,followCursor:false,fade:true,slide:true,slideOffset:8,showAniDuration:300,hideAniDuration:300}})(jQuery);
+
+$(function(){
+    $('a.picture').fancybox();
+})

javascripts/signin_up.js

+// register verify functions
+/*
+function signup_validation(pos,msg_pos,url,key, msg_success,msg_failed,msg_empty)
+{
+    var _error = "<span class='verifi-failed'></span>";
+    var _succe = "<span class='verifi-success'></span>";
+    $(pos).change( function(){
+        if(  (this).val().length == 0){
+                if( msg_empty ) $(msg_pos).html(_error + msg_empty);
+        }else{
+                var obj = {};
+                obj[key] = $(this).val();
+                $.get(url, obj, function(text){
+                  if(text == '1') $(msg_pos).html(_error + msg_failed);
+                  else $(msg_pos).html( _succe + msg_success);
+                });     
+        }
+    });
+}
+signup_validation('#user_login','#insertlogin', '/new4/signup_login', 'user_login', '', '已经使用','不能为空');
+*/
+
+
+$(function(){
+    $('#user_login').change(function(){
+           if( $(this).val().length == 0 ){
+                $('#insertlogin').html("<span class='verifi-failed'></span>不能为空");
+                return;
+           }
+           {$.get("/new4/signup_login",{user_login:$(this).val()},
+           function(text){
+                if( text=='1')$('#insertlogin').html("<span class='verifi-failed'></span>此用户名已被注册");
+                else
+                        $('#insertlogin').html("<span class='verifi-success'></span>");
+                });
+           }
+
+       });
+
+    $('#password').change( function(){
+        var length = $(this).val().length;
+        if(length == 0 ) $('#insertp1').html("<span class='verifi-failed'></span>密码不一致");
+        else $('#insertp1').html("<span class='verifi-success'></span>");
+    } );
+    $('#user_password_confirmation').change( function(){
+        var passcode1 = $(this).val();
+        var passcode2 = $('#password').val();
+        if( passcode1 == passcode2 ) $('#insertp2').html("<span class='verifi-success'></span>");
+        else $('#insertp2').html("<span class='verifi-failed'></span>两次密码不同");
+    } );
+});
+
+
+$(function(){
+    $('#user_email').change(function(){
+    var email=$('#user_email').val();
+        if( $('#user_email').val()  == 0 ) { $('#insertemail').html("<span class='verifi-failed'></span>不能为空");return}
+       if(isEmail(email)){$.get("/new4/signup_email",{user_email:$(this).val()},
+           function(text){
+             /*  if (text!="can_use"){ */
+              if( text=='1')$('#insertemail').html("<span class='verifi-failed'></span>此邮箱地址已被使用");
+                else
+                        $('#insertemail').html("<span class='verifi-success'></span>");
+       });
+         }
+       else
+           {$('#insertemail').html("<span class='verifi-failed'></span>邮箱格式不正确");
+           }
+
+       })})
+    function isEmail(str){
+       //var reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/;
+       var reg = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
+       return reg.test(str);
+}
+var code = "";
+$(function(){$('#invitation_code').live("focus",function(){
+        var s = setInterval(invitationchange,500);
+       })}
+)
+
+
+function invitationchange(){
+        inputcode = $('#invitation_code').val().toUpperCase().replace(/ /g,"");
+        if( inputcode.length!=16 ){
+                $(':submit').attr('disabled','true');
+                $('#reginfo').hide();
+                $('#insertinvitation_code').html("<span class='verifi-failed'></span>邀请码为16位英文字母");
+                return;
+        }
+        if(code==inputcode)return;
+        $('#insertinvitation_code').html("校验邀请码中...");
+            $.get("/new4/signup_code",{invitation_code:$('#invitation_code').val().toUpperCase().replace(/ /g,"")},
+           function(text){
+                code = $('#invitation_code').val().toUpperCase().replace(/ /g,"");
+                if( text=='-1')
+                {
+                        $('#insertinvitation_code').html("<span class='verifi-failed'></span>此邀请码已被使用");
+                        $(':submit').attr('disabled','true');
+                        $('#reginfo').hide();
+                }
+                else if( text=='1')
+                {
+                        $('#insertinvitation_code').html("<span class='verifi-success'></span>");
+                        $('#reginfo').show();
+                        $(':submit').prop("disabled",false);
+                }
+                else
+                {
+                        $('#insertinvitation_code').html("<span class='verifi-failed'></span>邀请码无效");
+                        $(':submit').attr('disabled','true');
+                        $('#reginfo').hide();
+                }
+                });
+}
+
+$(function(){
+	$('#new_user').submit( function(){
+		return $('span.verifi-failed').length == 0 ;
+	} );
+})

stylesheets/fancybox/blank.gif

Added
New image

stylesheets/fancybox/fancy_close.png

Added
New image

stylesheets/fancybox/fancy_loading.png

Added
New image

stylesheets/fancybox/fancy_nav_left.png

Added
New image

stylesheets/fancybox/fancy_nav_right.png

Added
New image

stylesheets/fancybox/fancy_shadow_e.png

Added
New image

stylesheets/fancybox/fancy_shadow_n.png

Added
New image

stylesheets/fancybox/fancy_shadow_ne.png

Added
New image

stylesheets/fancybox/fancy_shadow_nw.png

Added
New image

stylesheets/fancybox/fancy_shadow_s.png

Added
New image

stylesheets/fancybox/fancy_shadow_se.png

Added
New image

stylesheets/fancybox/fancy_shadow_sw.png

Added
New image

stylesheets/fancybox/fancy_shadow_w.png

Added
New image

stylesheets/fancybox/fancy_title_left.png

Added
New image

stylesheets/fancybox/fancy_title_main.png

Added
New image

stylesheets/fancybox/fancy_title_over.png

Added
New image

stylesheets/fancybox/fancy_title_right.png

Added
New image

stylesheets/fancybox/fancybox-x.png

Added
New image

stylesheets/fancybox/fancybox-y.png

Added
New image

stylesheets/fancybox/fancybox.png

Added
New image

stylesheets/img/bj2.jpg

Added
New image

stylesheets/img/logo.jpg

Added
New image

stylesheets/img/st301.gif

Added
New image

stylesheets/img/st302.gif

Added
New image

stylesheets/img/st401.jpg

Added
New image

stylesheets/img/stbj.jpg

Added
New image

stylesheets/img/web15.png

Added
New image

stylesheets/img/web_icon.png

Added
New image

stylesheets/img/web_logo.png

Added
New image

stylesheets/jquery.fancybox-1.3.4.css

+/*
+ * FancyBox - jQuery Plugin
+ * Simple and fancy lightbox alternative
+ *
+ * Examples and documentation at: http://fancybox.net
+ * 
+ * Copyright (c) 2008 - 2010 Janis Skarnelis
+ * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
+ * 
+ * Version: 1.3.4 (11/11/2010)
+ * Requires: jQuery v1.3+
+ *
+ * Dual licensed under the MIT and GPL licenses:
+ *   http://www.opensource.org/licenses/mit-license.php
+ *   http://www.gnu.org/licenses/gpl.html
+ */
+
+#fancybox-loading {
+	position: fixed;
+	top: 50%;
+	left: 50%;
+	width: 40px;
+	height: 40px;
+	margin-top: -20px;
+	margin-left: -20px;
+	cursor: pointer;
+	overflow: hidden;
+	z-index: 1104;
+	display: none;
+}
+
+#fancybox-loading div {
+	position: absolute;
+	top: 0;
+	left: 0;
+	width: 40px;
+	height: 480px;
+	background-image: url('fancybox/fancybox.png');
+}
+
+#fancybox-overlay {
+	position: absolute;
+	top: 0;
+	left: 0;
+	width: 100%;
+	z-index: 1100;
+	display: none;
+}
+
+#fancybox-tmp {
+	padding: 0;
+	margin: 0;
+	border: 0;
+	overflow: auto;
+	display: none;
+}
+
+#fancybox-wrap {
+	position: absolute;
+	top: 0;
+	left: 0;
+	padding: 20px;
+	z-index: 1101;
+	outline: none;
+	display: none;
+}
+
+#fancybox-outer {
+	position: relative;
+	width: 100%;
+	height: 100%;
+	background: #fff;
+}
+
+#fancybox-content {
+	width: 0;
+	height: 0;
+	padding: 0;
+	outline: none;
+	position: relative;
+	overflow: hidden;
+	z-index: 1102;
+	border: 0px solid #fff;
+}
+
+#fancybox-hide-sel-frame {
+	position: absolute;
+	top: 0;
+	left: 0;
+	width: 100%;
+	height: 100%;
+	background: transparent;
+	z-index: 1101;
+}
+
+#fancybox-close {
+	position: absolute;
+	top: -15px;
+	right: -15px;
+	width: 30px;
+	height: 30px;
+	background: transparent url('fancybox/fancybox.png') -40px 0px;
+	cursor: pointer;
+	z-index: 1103;
+	display: none;
+}
+
+#fancybox-error {
+	color: #444;
+	font: normal 12px/20px Arial;
+	padding: 14px;
+	margin: 0;
+}
+
+#fancybox-img {
+	width: 100%;
+	height: 100%;
+	padding: 0;
+	margin: 0;
+	border: none;
+	outline: none;
+	line-height: 0;
+	vertical-align: top;
+}
+
+#fancybox-frame {
+	width: 100%;
+	height: 100%;
+	border: none;
+	display: block;
+}
+
+#fancybox-left, #fancybox-right {
+	position: absolute;
+	bottom: 0px;
+	height: 100%;
+	width: 35%;
+	cursor: pointer;
+	outline: none;