/*(http://www.no-margin-for-errors.com)*/
(function(a){function s(b,v){b=b.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var w=(new RegExp("[\\?&]"+b+"=([^&#]*)")).exec(v);return w==null?"":w[1]}a.prettyPhoto={version:"2.5.6"};a.fn.prettyPhoto=function(b){function v(h){c.find("#pp_full_res object,#pp_full_res embed").css("visibility","hidden");c.find(".pp_fade").fadeOut(b.animationSpeed,function(){a(".pp_loaderIcon").show();h&&h()});l.fadeOut(b.animationSpeed)}function w(h){if(e==h-1){c.find("a.pp_next").css("visibility","hidden");c.find("a.pp_arrow_next").addClass("disabled").unbind("click")}else{c.find("a.pp_next").css("visibility",
"visible");c.find("a.pp_arrow_next.disabled").removeClass("disabled").bind("click",function(){a.prettyPhoto.changePage("next");return false})}if(e==0){c.find("a.pp_previous").css("visibility","hidden");c.find("a.pp_arrow_previous").addClass("disabled").unbind("click")}else{c.find("a.pp_previous").css("visibility","visible");c.find("a.pp_arrow_previous.disabled").removeClass("disabled").bind("click",function(){a.prettyPhoto.changePage("previous");return false})}h>1?a(".pp_nav").show():a(".pp_nav").hide()}
function m(h,o){hasBeenResized=false;z(h,o);imageWidth=h;imageHeight=o;if((k>q||p>r)&&f&&b.allowresize&&!x){for(notFitting=hasBeenResized=true;notFitting;){if(k>q){imageWidth=q-200;imageHeight=o/h*imageWidth}else if(p>r){imageHeight=r-200;imageWidth=h/o*imageHeight}else notFitting=false;p=imageHeight;k=imageWidth}z(imageWidth,imageHeight)}return{width:Math.floor(imageWidth),height:Math.floor(imageHeight),containerHeight:Math.floor(p),containerWidth:Math.floor(k)+40,contentHeight:Math.floor(y),contentWidth:Math.floor(t),
resized:hasBeenResized}}function z(h,o){h=parseFloat(h);o=parseFloat(o);$pp_details=c.find(".pp_details");$pp_details.width(h);detailsHeight=parseFloat($pp_details.css("marginTop"))+parseFloat($pp_details.css("marginBottom"));$pp_details=$pp_details.clone().appendTo(a("body")).css({position:"absolute",top:-10000});detailsHeight+=$pp_details.height();detailsHeight=detailsHeight<=34?36:detailsHeight;if(a.browser.msie&&a.browser.version==7)detailsHeight+=8;$pp_details.remove();y=o+detailsHeight;t=h;
p=y+l.height()+c.find(".pp_top").height()+c.find(".pp_bottom").height();k=h}function A(h){return h.match(/youtube\.com\/watch/i)?"youtube":h.match(/vimeo\.com/i)?"vimeo":h.indexOf(".mov")!=-1?"quicktime":h.indexOf(".swf")!=-1?"flash":h.indexOf("iframe")!=-1?"iframe":h.substr(0,1)=="#"?"inline":"image"}function j(){if(f){titleHeight=l.height();contentHeight=c.height();contentwidth=c.width();projectedTop=r/2+B.scrollTop-(contentHeight+titleHeight)/2;c.css({top:projectedTop,left:q/2+B.scrollLeft-contentwidth/
2});l.css({top:projectedTop-titleHeight,left:q/2+B.scrollLeft-contentwidth/2+20})}}function g(){if(self.pageYOffset)return{scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset};else if(document.documentElement&&document.documentElement.scrollTop)return{scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft};else if(document.body)return{scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft}}function i(){r=a(window).height();q=a(window).width();
u.css({height:a(document).height()})}function n(){a("body").append(b.markup);c=a(".pp_pic_holder");l=a(".ppt");u=a("div.pp_overlay");c.attr("class","pp_pic_holder "+b.theme);u.css({opacity:0,height:a(document).height()}).bind("click",function(){b.modal||a.prettyPhoto.close()});a("a.pp_close").bind("click",function(){a.prettyPhoto.close();return false});a("a.pp_expand").bind("click",function(){$this=a(this);if($this.hasClass("pp_expand")){$this.removeClass("pp_expand").addClass("pp_contract");f=false}else{$this.removeClass("pp_contract").addClass("pp_expand");
f=true}v(function(){a.prettyPhoto.open(images,titles,descriptions)});c.find(".pp_fade").fadeOut(b.animationSpeed);return false});c.find(".pp_previous, .pp_arrow_previous").bind("click",function(){a.prettyPhoto.changePage("previous");return false});c.find(".pp_next, .pp_arrow_next").bind("click",function(){a.prettyPhoto.changePage("next");return false})}b=jQuery.extend({animationSpeed:"normal",opacity:0.72,showTitle:true,allowresize:true,default_width:500,default_height:344,counter_separator_label:"/",
theme:"facebook",hideflash:false,wmode:"opaque",autoplay:true,modal:false,changepicturecallback:function(){},callback:function(){},markup:'<div class="pp_pic_holder"> <div class="pp_top"> <div class="pp_left"></div> <div class="pp_middle"></div> <div class="pp_right"></div> </div> <div class="pp_content_container"> <div class="pp_left"> <div class="pp_right"> <div class="pp_content"> <div class="pp_loaderIcon"></div> <div class="pp_fade"> <a href="#" class="pp_expand" title="Expand the image">Expand</a> <div class="pp_hoverContainer"> <a class="pp_next" href="#">next</a> <a class="pp_previous" href="#">previous</a> </div> <div id="pp_full_res"></div> <div class="pp_details clearfix"> <a class="pp_close" href="#">Close</a> <p class="pp_description"></p> <div class="pp_nav"> <a href="#" class="pp_arrow_previous">Previous</a> <p class="currentTextHolder">0/0</p> <a href="#" class="pp_arrow_next">Next</a> </div> </div> </div> </div> </div> </div> </div> <div class="pp_bottom"> <div class="pp_left"></div> <div class="pp_middle"></div> <div class="pp_right"></div> </div> </div> <div class="pp_overlay"></div> <div class="ppt"></div>',
image_markup:'<img id="fullResImage" src="" />',flash_markup:'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',
quicktime_markup:'<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>',iframe_markup:'<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',
inline_markup:'<div class="pp_inline clearfix">{content}</div>'},b);if(a.browser.msie&&parseInt(a.browser.version)==6)b.theme="light_square";a(".pp_overlay").size()==0&&n();var f=true,x=false,d,c,l,u,y,t,p,k,r=a(window).height(),q=a(window).width(),e=0,B=g();a(window).scroll(function(){B=g();j();i()});a(window).resize(function(){j();i()});a(document).keydown(function(h){if(c.is(":visible"))switch(h.keyCode){case 37:a.prettyPhoto.changePage("previous");break;case 39:a.prettyPhoto.changePage("next");
break;case 27:b.modal||a.prettyPhoto.close();break}});a(this).each(function(){a(this).bind("click",function(){_self=this;theRel=a(this).attr("rel");galleryRegExp=/\[(?:.*)\]/;theGallery=galleryRegExp.exec(theRel);var h=[],o=[],C=[];if(theGallery)a("a[rel*="+theGallery+"]").each(function(D){if(a(this)[0]===a(_self)[0])e=D;h.push(a(this).attr("href"));o.push(a(this).find("img").attr("alt"));C.push(a(this).attr("title"))});else{h=a(this).attr("href");o=a(this).find("img").attr("alt")?a(this).find("img").attr("alt"):
"";C=a(this).attr("title")?a(this).attr("title"):""}a.prettyPhoto.open(h,o,C);return false})});a.prettyPhoto.open=function(h,o,C){a.browser.msie&&a.browser.version==6&&a("select").css("visibility","hidden");b.hideflash&&a("object,embed").css("visibility","hidden");images=a.makeArray(h);titles=a.makeArray(o);descriptions=a.makeArray(C);image_set=a(images).size()>0?true:false;w(a(images).size());a(".pp_loaderIcon").show();u.show().fadeTo(b.animationSpeed,b.opacity);c.find(".currentTextHolder").text(e+
1+b.counter_separator_label+a(images).size());descriptions[e]?c.find(".pp_description").show().html(unescape(descriptions[e])):c.find(".pp_description").hide().text("");if(titles[e]&&b.showTitle){hasTitle=true;l.html(unescape(titles[e]))}else hasTitle=false;movie_width=parseFloat(s("width",images[e]))?s("width",images[e]):b.default_width.toString();movie_height=parseFloat(s("height",images[e]))?s("height",images[e]):b.default_height.toString();if(movie_width.indexOf("%")!=-1||movie_height.indexOf("%")!=
-1){movie_height=parseFloat(a(window).height()*parseFloat(movie_height)/100-100);movie_width=parseFloat(a(window).width()*parseFloat(movie_width)/100-100);x=true}c.fadeIn(function(){imgPreloader="";switch(A(images[e])){case "image":imgPreloader=new Image;nextImage=new Image;if(image_set&&e>a(images).size())nextImage.src=images[e+1];prevImage=new Image;if(image_set&&images[e-1])prevImage.src=images[e-1];c.find("#pp_full_res")[0].innerHTML=b.image_markup;c.find("#fullResImage").attr("src",images[e]);
imgPreloader.onload=function(){d=m(imgPreloader.width,imgPreloader.height);_showContent()};imgPreloader.onerror=function(){alert("Image cannot be loaded. Make sure the path is correct and image exist.");a.prettyPhoto.close()};imgPreloader.src=images[e];break;case "youtube":d=m(movie_width,movie_height);movie="http://www.youtube.com/v/"+s("v",images[e]);if(b.autoplay)movie+="&autoplay=1";toInject=b.flash_markup.replace(/{width}/g,d.width).replace(/{height}/g,d.height).replace(/{wmode}/g,b.wmode).replace(/{path}/g,
movie);break;case "vimeo":d=m(movie_width,movie_height);movie_id=images[e];movie="http://vimeo.com/moogaloop.swf?clip_id="+movie_id.replace("http://vimeo.com/","");if(b.autoplay)movie+="&autoplay=1";toInject=b.flash_markup.replace(/{width}/g,d.width).replace(/{height}/g,d.height).replace(/{wmode}/g,b.wmode).replace(/{path}/g,movie);break;case "quicktime":d=m(movie_width,movie_height);d.height+=15;d.contentHeight+=15;d.containerHeight+=15;toInject=b.quicktime_markup.replace(/{width}/g,d.width).replace(/{height}/g,
d.height).replace(/{wmode}/g,b.wmode).replace(/{path}/g,images[e]).replace(/{autoplay}/g,b.autoplay);break;case "flash":d=m(movie_width,movie_height);flash_vars=images[e];flash_vars=flash_vars.substring(images[e].indexOf("flashvars")+10,images[e].length);filename=images[e];filename=filename.substring(0,filename.indexOf("?"));toInject=b.flash_markup.replace(/{width}/g,d.width).replace(/{height}/g,d.height).replace(/{wmode}/g,b.wmode).replace(/{path}/g,filename+"?"+flash_vars);break;case "iframe":d=
m(movie_width,movie_height);frame_url=images[e];frame_url=frame_url.substr(0,frame_url.indexOf("iframe")-1);toInject=b.iframe_markup.replace(/{width}/g,d.width).replace(/{height}/g,d.height).replace(/{path}/g,frame_url);break;case "inline":myClone=a(images[e]).clone().css({width:b.default_width}).wrapInner('<div id="pp_full_res"><div class="pp_inline clearfix"></div></div>').appendTo(a("body"));d=m(a(myClone).width(),a(myClone).height());a(myClone).remove();toInject=b.inline_markup.replace(/{content}/g,
a(images[e]).html());break}if(!imgPreloader){c.find("#pp_full_res")[0].innerHTML=toInject;_showContent()}})};a.prettyPhoto.changePage=function(h){if(h=="previous"){e--;if(e<0){e=0;return}}else{if(a(".pp_arrow_next").is(".disabled"))return;e++}f||(f=true);v(function(){a.prettyPhoto.open(images,titles,descriptions)});a("a.pp_expand,a.pp_contract").fadeOut(b.animationSpeed)};a.prettyPhoto.close=function(){c.find("object,embed").css("visibility","hidden");a("div.pp_pic_holder,div.ppt,.pp_fade").fadeOut(b.animationSpeed);
u.fadeOut(b.animationSpeed,function(){a("#pp_full_res").html("");c.attr("style","").find("div:not(.pp_hoverContainer)").attr("style","");j();a.browser.msie&&a.browser.version==6&&a("select").css("visibility","visible");b.hideflash&&a("object,embed").css("visibility","visible");e=0;b.callback()});f=true};_showContent=function(){a(".pp_loaderIcon").hide();projectedTop=B.scrollTop+(r/2-d.containerHeight/2);if(projectedTop<0)projectedTop=0+l.height();c.find(".pp_content").animate({height:d.contentHeight},
b.animationSpeed);c.animate({top:projectedTop,left:q/2-d.containerWidth/2,width:d.containerWidth},b.animationSpeed,function(){c.find(".pp_hoverContainer,#fullResImage").height(d.height).width(d.width);c.find(".pp_fade").fadeIn(b.animationSpeed);image_set&&A(images[e])=="image"?c.find(".pp_hoverContainer").show():c.find(".pp_hoverContainer").hide();if(b.showTitle&&hasTitle){l.css({top:c.offset().top-25,left:c.offset().left+20,display:"none"});l.fadeIn(b.animationSpeed)}d.resized&&a("a.pp_expand,a.pp_contract").fadeIn(b.animationSpeed);
b.changepicturecallback()})};j()}})(jQuery);$(document).ready(function(){$("a[rel^='prettyPhoto']").prettyPhoto({animationSpeed:"normal",padding:40,opacity:0.72,showTitle:true,allowresize:true,counter_separator_label:"/",theme:"facebook",hideflash:false,wmode:"opaque",autoplay:true,modal:false,changepicturecallback:function(){},callback:function(){}})});
/* jQuery corner plugin : http://jquery.malsup.com/corner/ * version 2.01 (08-SEP-2009) */
(function(a){function s(j,g){return parseInt(a.css(j,g))||0}function b(j){j=parseInt(j).toString(16);return j.length<2?"0"+j:j}function v(j){for(;j&&j.nodeName.toLowerCase()!="html";j=j.parentNode){var g=a.css(j,"backgroundColor");if(g!="rgba(0, 0, 0, 0)"){if(g.indexOf("rgb")>=0){j=g.match(/\d+/g);return"#"+b(j[0])+b(j[1])+b(j[2])}if(g&&g!="transparent")return g}}return"#ffffff"}function w(j,g,i){switch(j){case "round":return Math.round(i*(1-Math.cos(Math.asin(g/i))));case "cool":return Math.round(i*
(1+Math.cos(Math.asin(g/i))));case "sharp":return Math.round(i*(1-Math.cos(Math.acos(g/i))));case "bite":return Math.round(i*Math.cos(Math.asin((i-g-1)/i)));case "slide":return Math.round(i*Math.atan2(g,i/g));case "jut":return Math.round(i*Math.atan2(i,i-g-1));case "curl":return Math.round(i*Math.atan(g));case "tear":return Math.round(i*Math.cos(g));case "wicked":return Math.round(i*Math.tan(g));case "long":return Math.round(i*Math.sqrt(g));case "sculpt":return Math.round(i*Math.log(i-g-1,i));case "dog":return g&
1?g+1:i;case "dog2":return g&2?g+1:i;case "dog3":return g&3?g+1:i;case "fray":return g%2*i;case "notch":return i;case "bevel":return g+1}}var m=a.browser.mozilla&&/gecko/i.test(navigator.userAgent),z=a.browser.safari&&a.browser.version>=3,A=a.browser.msie&&function(){var j=document.createElement("div");try{j.style.setExpression("width","0+0")}catch(g){return false}return true}();a.fn.corner=function(j){if(this.length==0){if(!a.isReady&&this.selector){var g=this.selector,i=this.context;a(function(){a(g,
i).corner(j)})}return this}return this.each(function(){var n=a(this),f=(j||n.attr(a.fn.corner.defaults.metaAttr)||"").toLowerCase(),x=/keep/.test(f),d=(f.match(/cc:(#[0-9a-f]+)/)||[])[1],c=(f.match(/sc:(#[0-9a-f]+)/)||[])[1],l=parseInt((f.match(/(\d+)px/)||[])[1])||10,u=(f.match(/round|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dog/)||["round"])[0],y={T:0,B:1};f={TL:/top|tl|left/.test(f),TR:/top|tr|right/.test(f),BL:/bottom|bl|left/.test(f),BR:/bottom|br|right/.test(f)};
if(!f.TL&&!f.TR&&!f.BL&&!f.BR)f={TL:1,TR:1,BL:1,BR:1};if(a.fn.corner.defaults.useNative&&u=="round"&&(m||z)&&!d&&!c){if(f.TL)n.css(m?"-moz-border-radius-topleft":"-webkit-border-top-left-radius",l+"px");if(f.TR)n.css(m?"-moz-border-radius-topright":"-webkit-border-top-right-radius",l+"px");if(f.BL)n.css(m?"-moz-border-radius-bottomleft":"-webkit-border-bottom-left-radius",l+"px");if(f.BR)n.css(m?"-moz-border-radius-bottomright":"-webkit-border-bottom-right-radius",l+"px")}else{n=document.createElement("div");
n.style.overflow="hidden";n.style.height="1px";n.style.backgroundColor=c||"transparent";n.style.borderStyle="solid";c={T:parseInt(a.css(this,"paddingTop"))||0,R:parseInt(a.css(this,"paddingRight"))||0,B:parseInt(a.css(this,"paddingBottom"))||0,L:parseInt(a.css(this,"paddingLeft"))||0};if(typeof this.style.zoom!=undefined)this.style.zoom=1;if(!x)this.style.border="none";n.style.borderColor=d||v(this.parentNode);x=a.curCSS(this,"height");for(var t in y)if((d=y[t])&&(f.BL||f.BR)||!d&&(f.TL||f.TR)){n.style.borderStyle=
"none "+(f[t+"R"]?"solid":"none")+" none "+(f[t+"L"]?"solid":"none");var p=document.createElement("div");a(p).addClass("jquery-corner");var k=p.style;d?this.appendChild(p):this.insertBefore(p,this.firstChild);if(d&&x!="auto"){if(a.css(this,"position")=="static")this.style.position="relative";k.position="absolute";k.bottom=k.left=k.padding=k.margin="0";if(A)k.setExpression("width","this.parentNode.offsetWidth");else k.width="100%"}else if(!d&&a.browser.msie){if(a.css(this,"position")=="static")this.style.position=
"relative";k.position="absolute";k.top=k.left=k.right=k.padding=k.margin="0";if(A){var r=s(this,"borderLeftWidth")+s(this,"borderRightWidth");k.setExpression("width","this.parentNode.offsetWidth - "+r+'+ "px"')}else k.width="100%"}else{k.position="relative";k.margin=!d?"-"+c.T+"px -"+c.R+"px "+(c.T-l)+"px -"+c.L+"px":c.B-l+"px -"+c.R+"px -"+c.B+"px -"+c.L+"px"}for(k=0;k<l;k++){r=Math.max(0,w(u,k,l));var q=n.cloneNode(false);q.style.borderWidth="0 "+(f[t+"R"]?r:0)+"px 0 "+(f[t+"L"]?r:0)+"px";d?p.appendChild(q):
p.insertBefore(q,p.firstChild)}}}})};a.fn.uncorner=function(){if(m||z)this.css(m?"-moz-border-radius":"-webkit-border-radius",0);a("div.jquery-corner",this).remove();return this};a.fn.corner.defaults={useNative:true,metaAttr:"data-corner"}})(jQuery);$().corner();$(function(){$("img.i-web,img.i").each(function(){var a=$("p",this).text();eval(a);$(this).corner("10px")})});