
 
/* Dynamically Load CSS */
 
 function loadcssfile(filename){
  var fileref=document.createElement("link")
  fileref.setAttribute("rel", "stylesheet")
  fileref.setAttribute("type", "text/css")
  fileref.setAttribute("media", "screen")
  fileref.setAttribute("href", filename)
  if (typeof fileref!="undefined")
  document.getElementsByTagName("head")[0].appendChild(fileref)
}

/*
	jquery.flash.js
*/
(function(){var g;g=jQuery.fn.flash=function(a,b,c,d){if(this.length>0){var e=c||g.replace;b=g.copy(g.pluginOptions,b);if(!g.hasFlash(b.version)){if(b.expressInstall&&g.hasFlash(6,0,65)){var f={flashvars:{MMredirectURL:location,MMplayerType:'PlugIn',MMdoctitle:jQuery('title').text()}}}else if(b.update){e=d||g.update}else{return this}}a=g.copy(g.htmlOptions,f,a);return this.each(function(){e.call(this,g.copy(a))})}};g.copy=function(){var a={},flashvars={};for(var i=0;i<arguments.length;i++){var b=arguments[i];if(b==undefined){continue}jQuery.extend(a,b);if(b.flashvars==undefined){continue}jQuery.extend(flashvars,b.flashvars)}a.flashvars=flashvars;return a};g.hasFlash=function(){if(/hasFlash\=true/.test(location)){return true}if(/hasFlash\=false/.test(location)){return false}var a=g.hasFlash.playerVersion().match(/\d+/g);var b=String([arguments[0],arguments[1],arguments[2]]).match(/\d+/g)||String(g.pluginOptions.version).match(/\d+/g);for(var i=0;i<3;i++){a[i]=parseInt(a[i]||0);b[i]=parseInt(b[i]||0);if(a[i]<b[i]){return false}if(a[i]>b[i]){return true}}return true};g.hasFlash.playerVersion=function(){try{try{var a=new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6');try{a.AllowScriptAccess='always'}catch(e){return'6,0,0'}}catch(e){}return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g,',').match(/^,?(.+),?$/)[1]}catch(e){try{if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){return(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g,",").match(/^,?(.+),?$/)[1]}}catch(e){}}return'0,0,0'};g.htmlOptions={height:240,flashvars:{},pluginspage:'http://www.adobe.com/go/getflashplayer',src:'#',type:'application/x-shockwave-flash',width:320};g.pluginOptions={expressInstall:false,update:false,version:'6.0.65'};g.replace=function(a){this.innerHTML='<div class="alt">'+this.innerHTML+'</div>';jQuery(this).addClass('flash-replaced').prepend(g.transform(a))};g.update=function(a){var b=String(location).split('?');b.splice(1,0,'?hasFlash=true&');b=b.join('');var c='<p>This content requires the Flash Player. <a href="http://www.adobe.com/go/getflashplayer">Download Flash Player</a>. Already have Flash Player? <a href="'+b+'">Click here.</a></p>';this.innerHTML='<span class="alt">'+this.innerHTML+'</span>';jQuery(this).addClass('flash-update').prepend(c)};function toAttributeString(){var s='';for(var a in this){if(typeof this[a]!='function'){s+=a+'="'+this[a]+'" '}}return s};function toFlashvarsString(){var s='';for(var a in this){if(typeof this[a]!='function'){s+=a+'='+arb.text.percentEncode(this[a])+'&'}}return s.replace(/&$/,'')};g.transform=function(a){if(a.flashvars){a.flashvars.toString=toFlashvarsString}if(!$.browser.msie){a.toString=toAttributeString;return'<embed '+String(a)+'/>'}else{var b="";var c="";if(typeof(a.id)!="undefined"){c='id="'+a.id+'"'}b='<object '+c+' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+a.width+'" height="'+a.height+'">';b+='<param name="movie" value="'+a.src+'" />';delete(a.id);delete(a.width);delete(a.height);delete(a.src);delete(a.type);delete(a.pluginspage);for(var d in a){b+='<param name="'+d+'" value="'+String(a[d])+'" />'}b+="</object>";return b}};if(window.attachEvent){window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){}})}})();function RGBColor(l){this.ok=false;if(l.charAt(0)=='#'){l=l.substr(1,6)}l=l.replace(/ /g,'');l=l.toLowerCase();var m={aliceblue:'f0f8ff',antiquewhite:'faebd7',aqua:'00ffff',aquamarine:'7fffd4',azure:'f0ffff',beige:'f5f5dc',bisque:'ffe4c4',black:'000000',blanchedalmond:'ffebcd',blue:'0000ff',blueviolet:'8a2be2',brown:'a52a2a',burlywood:'deb887',cadetblue:'5f9ea0',chartreuse:'7fff00',chocolate:'d2691e',coral:'ff7f50',cornflowerblue:'6495ed',cornsilk:'fff8dc',crimson:'dc143c',cyan:'00ffff',darkblue:'00008b',darkcyan:'008b8b',darkgoldenrod:'b8860b',darkgray:'a9a9a9',darkgreen:'006400',darkkhaki:'bdb76b',darkmagenta:'8b008b',darkolivegreen:'556b2f',darkorange:'ff8c00',darkorchid:'9932cc',darkred:'8b0000',darksalmon:'e9967a',darkseagreen:'8fbc8f',darkslateblue:'483d8b',darkslategray:'2f4f4f',darkturquoise:'00ced1',darkviolet:'9400d3',deeppink:'ff1493',deepskyblue:'00bfff',dimgray:'696969',dodgerblue:'1e90ff',feldspar:'d19275',firebrick:'b22222',floralwhite:'fffaf0',forestgreen:'228b22',fuchsia:'ff00ff',gainsboro:'dcdcdc',ghostwhite:'f8f8ff',gold:'ffd700',goldenrod:'daa520',gray:'808080',green:'008000',greenyellow:'adff2f',honeydew:'f0fff0',hotpink:'ff69b4',indianred:'cd5c5c',indigo:'4b0082',ivory:'fffff0',khaki:'f0e68c',lavender:'e6e6fa',lavenderblush:'fff0f5',lawngreen:'7cfc00',lemonchiffon:'fffacd',lightblue:'add8e6',lightcoral:'f08080',lightcyan:'e0ffff',lightgoldenrodyellow:'fafad2',lightgrey:'d3d3d3',lightgreen:'90ee90',lightpink:'ffb6c1',lightsalmon:'ffa07a',lightseagreen:'20b2aa',lightskyblue:'87cefa',lightslateblue:'8470ff',lightslategray:'778899',lightsteelblue:'b0c4de',lightyellow:'ffffe0',lime:'00ff00',limegreen:'32cd32',linen:'faf0e6',magenta:'ff00ff',maroon:'800000',mediumaquamarine:'66cdaa',mediumblue:'0000cd',mediumorchid:'ba55d3',mediumpurple:'9370d8',mediumseagreen:'3cb371',mediumslateblue:'7b68ee',mediumspringgreen:'00fa9a',mediumturquoise:'48d1cc',mediumvioletred:'c71585',midnightblue:'191970',mintcream:'f5fffa',mistyrose:'ffe4e1',moccasin:'ffe4b5',navajowhite:'ffdead',navy:'000080',oldlace:'fdf5e6',olive:'808000',olivedrab:'6b8e23',orange:'ffa500',orangered:'ff4500',orchid:'da70d6',palegoldenrod:'eee8aa',palegreen:'98fb98',paleturquoise:'afeeee',palevioletred:'d87093',papayawhip:'ffefd5',peachpuff:'ffdab9',peru:'cd853f',pink:'ffc0cb',plum:'dda0dd',powderblue:'b0e0e6',purple:'800080',red:'ff0000',rosybrown:'bc8f8f',royalblue:'4169e1',saddlebrown:'8b4513',salmon:'fa8072',sandybrown:'f4a460',seagreen:'2e8b57',seashell:'fff5ee',sienna:'a0522d',silver:'c0c0c0',skyblue:'87ceeb',slateblue:'6a5acd',slategray:'708090',snow:'fffafa',springgreen:'00ff7f',steelblue:'4682b4',tan:'d2b48c',teal:'008080',thistle:'d8bfd8',tomato:'ff6347',turquoise:'40e0d0',violet:'ee82ee',violetred:'d02090',wheat:'f5deb3',white:'ffffff',whitesmoke:'f5f5f5',yellow:'ffff00',yellowgreen:'9acd32'};for(var n in m){if(l==n){l=m[n]}}var o=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:['rgb(123, 234, 45)','rgb(255,234,245)'],process:function(a){return[parseInt(a[1]),parseInt(a[2]),parseInt(a[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:['#00ff00','336699'],process:function(a){return[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:['#fb0','f0f'],process:function(a){return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)]}}];for(var i=0;i<o.length;i++){var p=o[i].re;var q=o[i].process;var s=p.exec(l);if(s){channels=q(s);this.r=channels[0];this.g=channels[1];this.b=channels[2];this.ok=true}}this.r=(this.r<0||isNaN(this.r))?0:((this.r>255)?255:this.r);this.g=(this.g<0||isNaN(this.g))?0:((this.g>255)?255:this.g);this.b=(this.b<0||isNaN(this.b))?0:((this.b>255)?255:this.b);this.toRGB=function(){return'rgb('+this.r+', '+this.g+', '+this.b+')'};this.toHex=function(){var r=this.r.toString(16);var g=this.g.toString(16);var b=this.b.toString(16);if(r.length==1)r='0'+r;if(g.length==1)g='0'+g;if(b.length==1)b='0'+b;return'#'+r+g+b};this.getHelpXML=function(){var a=new Array();for(var i=0;i<o.length;i++){var b=o[i].example;for(var j=0;j<b.length;j++){a[a.length]=b[j]}}for(var c in m){a[a.length]=c}var d=document.createElement('ul');d.setAttribute('id','rgbcolor-examples');for(var i=0;i<a.length;i++){try{var f=document.createElement('li');var g=new RGBColor(a[i]);var h=document.createElement('div');h.style.cssText='margin: 3px; '+'border: 1px solid black; '+'background:'+g.toHex()+'; '+'color:'+g.toHex();h.appendChild(document.createTextNode('test'));var k=document.createTextNode(' '+a[i]+' -> '+g.toRGB()+' -> '+g.toHex());f.appendChild(h);f.appendChild(k);d.appendChild(f)}catch(e){}}return d}}jQuery.fn.flashText=function(l){this.flash(l,{version:8},function(b){$('html').addClass('flash-text-has-flash');if(!$(this).is('.flash-text-replaced')){b.flashvars.txt=this.innerHTML.replace(/%/,"%25").trim();b.wMode='transparent';this.innerHTML="<span class='alt'>"+this.innerHTML+"</span>";var c=$(this.firstChild);var d=$('a',c).not('[href]');d.after(d.html());d.html("");$(this).prepend(d);b.height=c.height();b.width=c.width();if(typeof(b.flashvars)=='undefined'){b.flashvars={}}if(typeof(b.flashvars.css)=='undefined'){b.flashvars.css=""}var e=[c,$('a',c[0])];var f=['font-style','text-align','text-decoration'];for(var i=0;i<e.length;i++){var g=e[i];if(g.length>0){var h="{ color: "+(new RGBColor(g.css('color'))).toHex()+"; ";var k=g.css("font-weight");if(typeof(k)=="number"){k=k>400?"bold":"normal"}h+="font-weight: "+k+"; ";for(var j=0;j<f.length;j++){h+=f[j]+": "+g.css(f[j])+"; "}h+="} ";if(g!==c){h+="a:hover { text-decoration: "+((g.css('text-decoration')=='none')?'underline':'none')+"} ";h="a "+h}else{h="* "+h}b.flashvars.css+=h}}if(!jQuery.fn.flashText.debug){$(this).addClass('flash-text-replaced');$(this).append($.fn.flash.transform(b))}else{$(this).bind('click',flashReplace)}}function flashReplace(a){a=(a==null)?a:this;$(a).addClass('flash-text-replaced');$(a).prepend($.fn.flash.transform(b));$(a).unbind('click',flashReplace)}})};jQuery.fn.resizeFlashText=function(){return this.each(function(){var a=$("span.alt",this);var b=$("object,embed",this);b.css('position','absolute');a.css({position:'static',visibility:'hidden'});b.height(a.height());b.width(a.width());b.css('position','static');a.css({position:'absolute',visibility:'visible'})})};

jQuery.fn.flash.replace=function(a){if(typeof(a.width)=='undefined'){a.width=$(this).width()}if(typeof(a.height)=='undefined'){a.height=$(this).height()}a.wMode='transparent';var b=typeof(a.id)=="undefined"?"":a.id;this.innerHTML=$.fn.flash.transform(a)+'<div class="alt">'+this.innerHTML+'</div>';if($.browser.msie&&b!=""&&$(this).parents("form").length>0){window[b]=document.forms[0][b]}$(this).addClass('flash-replaced')};jQuery.fn.flashText.debug=false;



/*
	arb.packed.js
*/
var arb={};arb.prefs={promptText:true,focusHighlighting:true,popupHelp:false,tableStriping:true};arb.init=function(a){a=$.extend(arb.prefs,a);arb.element.addClass(document.body.parentNode,"js");if(a.promptText){arb.form.initPromptText()}if(a.focusHighlighting){arb.form.initFocusHighlighting()}if(a.popupHelp){arb.form.initPopupHelp()}if(a.tableStriping){arb.functions.stripeTables()}};arb.event={addHandler:function(a,b,c){var d=function(e){e=e?e:window.event;a.__f=c;var s=a.__f(e);a.__f=null;return s};var f=a['on'+b];if(typeof(f)=='function'){a['on'+b]=function(e){var x=f(e);var y=d(e);return x&&y}}else{a['on'+b]=d}}};arb.event.standardHandler={hover:function(a,b){b=(b!=null)?b:'arb-hover';arb.event.addHandler(a,'mouseover',function(){arb.element.addClass(this,'arb-hover')});arb.event.addHandler(a,'mouseout',function(){arb.element.removeClass(this,'arb-hover')})},hoverFns:function(a,f,g){function handleHover(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=a)p=p.parentNode;if(p==a)return false;a.__g=(e.type=="mouseover"?f:g);var s=a.__g(e);a.__g=null;return s}arb.event.addHandler(a,'mouseover',handleHover);arb.event.addHandler(a,'mouseout',handleHover)}};arb.element={addClass:function(a,b){if(a.className==''){a.className=b}else{a.className+=' '+b}},removeClass:function(a,b){var c=a.className;var d=new RegExp('\\s?\\b'+b+'\\b');if(c.match(d)!=null){a.className=c.replace(d,'')}},hasClass:function(a,b){var c=new RegExp('\\b'+b+'\\b');return(a.className.match(c)!=null)},getCSSProperty:function(a,b){if(document.defaultView){return document.defaultView.getComputedStyle(a,null).getPropertyValue(b)}else if(a.currentStyle){for(var c=/-([a-z])/;c.test(b);b=b.replace(c,RegExp.$1.toUpperCase())){}return a.currentStyle[b]}else{return null}},moveChildren:function(a,b){var c;for(var d=a.childNodes[0];d!=null;d=c){var c=d.nextSibling;a.removeChild(d);b.appendChild(d)}}};arb.element.position={left:function(a){var l=a.offsetLeft;while((a=a.parentNode)&&a!=document)l+=a.offsetLeft;return l},top:function(a){var t=a.offsetTop;while((a=a.parentNode)&&a!=document)t+=a.offsetTop||0;return t}};arb.form={initPromptText:function(){function _cleanupPromptTextOnSubmit(e){var a=this.getElementsByTagName('input');for(var j=0;j<a.length;j++){_clearPromptText(a[j])}}function _clearPromptText(a){if(a.value==a.getAttribute("title")){a.value="";arb.element.removeClass(a,'displayingPromptValue')}}function _addPromptText(a){if((a.getAttribute('disabled')==null||a.getAttribute('disabled')==false)&&(!a.value||a.value==""||a.value==a.getAttribute("title"))){a.value=a.getAttribute("title");arb.element.addClass(a,'displayingPromptValue')}}function _clearPromptTextHandler(e){_clearPromptText(this)}function _replacePromptText(e){_addPromptText(this)}if(!document.getElementsByTagName)return false;var b=document.getElementsByTagName('form');for(var i=(b.length-1);i>-1;i--){var c=b[i].getElementsByTagName('input');arb.event.addHandler(b[i],'submit',_cleanupPromptTextOnSubmit);for(var j=0;j<c.length;j++){var d=c[j];if(d.getAttribute("title")){var f;if(typeof document.selection!="undefined"&&document.selection!=null&&typeof window.opera=="undefined"){f=document.selection.createRange().parentElement()}if(f!=d){_addPromptText(d)}arb.event.addHandler(d,'focus',_clearPromptTextHandler);arb.event.addHandler(d,'blur',_replacePromptText)}}}},initFocusHighlighting:function(){function _focus(e){if(arb.element.hasClass(this,'arbHasFocus'))return true;arb.element.addClass(this,'arbHasFocus');for(var i=0;i<this._labels.length;i++){arb.element.addClass(this._labels[i],'arbHasFocus')}}function _blur(e){arb.element.removeClass(this,'arbHasFocus');for(var i=0;i<this._labels.length;i++){arb.element.removeClass(this._labels[i],'arbHasFocus')}}if(!document.getElementsByTagName)return true;var a=document.getElementsByTagName('label');for(var i=(a.length-1);i>-1;i--){var b=a[i].getAttribute('for')?a[i].getAttribute('for'):a[i].getAttribute('htmlFor');if(b){var c=document.getElementById(b);if(!c._labels)c._labels=new Array();c._labels.push(a[i]);$(c).bind('focus',_focus);$(c).bind('blur',_blur)}}}};arb.debug={debugCounter:0,log:function(a){var b=document.getElementById('debugBox');var c=document.createElement('DIV');if(typeof(a)=='object'){var d=a;a=d+'';for(var e in d){a+="<br />"+e+' => '+d[e]}}c.innerHTML=arb.debug.debugCounter+': '+a;arb.debug.debugCounter++;if(!b){b=document.createElement('DIV');b.style.position='absolute';b.style.zIndex='3000';b.style.width='280px';b.style.height='280px';b.style.top='0';b.style.right='0';b.style.backgroundColor="#dddddd";b.style.overflow='auto';b.onclick=function(){this.style.display='none'};b.id='debugBox';document.body.appendChild(b)}b.style.display='block';b.insertBefore(c,b.firstChild)}};arb.url={equal:function(a,b){a=arb.url.normalise(a);b=arb.url.normalise(b);return a==b},normalise:function(a){a=a.toLowerCase();a=a.replace(/^(.*)\?.*$/,"$1");a=a.replace(/^(.*)#.*$/,"$1");a=a.replace(/^(.*)\/(default|index)\.(aspx|htm(l?))$/i,"$1");a=a.replace(/^(.*)\/$/i,"$1");return a},parentPage:function(a){a=arb.url.normalise(a);if(a.match(/^.*\/.*?\.(aspx|htm(l?))$/i)){return a.replace(/^(.*)\/.*?$/i,"$1")}else if(a.match(/^http(s)?:\/\/.+\/.*$/)){return a.replace(/^(http(s)?:\/\/.+)\/.*?$/i,"$1")}return""},getParam:function(a){var b=window.location.search.substring(1);var c=b.split("&");for(var i=0;i<c.length;i++){var d=c[i].split("=");if(d[0]==a){return d[1]}}return null}};arb.text={percentEncode:function(a){var c=0;var n=0;CPstring='';for(var i=0;i<a.length;i++){var b=a.charCodeAt(i);if(b<0||b>0xFFFF){CPstring+='Error '+arb.text.dec2hex(b)+'!'}if(c!=0){if(0xDC00<=b&&b<=0xDFFF){CPstring+=arb.text.dec2hex(0x10000+((c-0xD800)<<10)+(b-0xDC00))+' ';c=0;continue}else{CPstring+='!erreur '+arb.text.dec2hex(c)+'!';c=0}}if(0xD800<=b&&b<=0xDBFF){c=b}else{CPstring+=arb.text.dec2hex(b)+' '}}a=CPstring.substring(0,CPstring.length-1);var d="";a=a.replace(/^\s+/,'');if(a.length==0){return""}a=a.replace(/\s+/g,' ');var e=a.split(' ');for(var i=0;i<e.length;i++){var n=parseInt(e[i],16);if(n==0x20){d+='%20'}else if(n>=0x41&&n<=0x5A){d+=String.fromCharCode(n)}else if(n>=0x61&&n<=0x7A){d+=String.fromCharCode(n)}else if(n>=0x30&&n<=0x39){d+=String.fromCharCode(n)}else if(n==0x2D||n==0x2E||n==0x5F||n==0x7E){d+=String.fromCharCode(n)}else if(n<=0x7F){d+='%'+arb.text.dec2hex2(n)}else if(n<=0x7FF){d+='%'+arb.text.dec2hex2(0xC0|((n>>6)&0x1F))+'%'+arb.text.dec2hex2(0x80|(n&0x3F))}else if(n<=0xFFFF){d+='%'+arb.text.dec2hex2(0xE0|((n>>12)&0x0F))+'%'+arb.text.dec2hex2(0x80|((n>>6)&0x3F))+'%'+arb.text.dec2hex2(0x80|(n&0x3F))}else if(n<=0x10FFFF){d+='%'+arb.text.dec2hex2(0xF0|((n>>18)&0x07))+'%'+arb.text.dec2hex2(0x80|((n>>12)&0x3F))+'%'+arb.text.dec2hex2(0x80|((n>>6)&0x3F))+'%'+arb.text.dec2hex2(0x80|(n&0x3F))}else{d+='!Error '+arb.text.dec2hex(n)+'!'}}return(d)},dec2hex2:function(a){var b=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F");return b[(a>>4)&0xF]+b[a&0xF]},dec2hex:function(a){return(a+0).toString(16).toUpperCase()}};arb.functions={expandMenu:function(a){if(!document.getElementById){return}var b=document.getElementById(a);if(!b){return}var c=b.getElementsByTagName("a");var d;var e=document.location.href;var f=document.createElement('div');arb.element.addClass(f,'menus-expanded');arb.element.moveChildren(b,f);b.appendChild(f);do{for(var i=0;i<c.length;i++){if(c[i].href&&arb.url.equal(c[i].href,e)){d=c[i];break}}if(!d){e=arb.url.parentPage(e)}}while(!d&&e);if(d){var g=d.parentNode;arb.element.addClass(g,'active');while(g!=b){if(g.nodeName=="LI"||g.nodeName=="UL"){arb.element.addClass(g,'expanded');if(g.id!=""){arb.element.addClass(g,g.id+"-expanded")}}g=g.parentNode}}},dropdownMenus:function(a){function _showMenu(e){arb.element.addClass(this,"arb-hover");if(typeof(jQuery)!="undefined"){$("ul",this).slideDown('fast')}}function _hideMenu(e){arb.element.removeClass(this,"arb-hover")}var b=document.getElementById(a).getElementsByTagName("LI");for(var i=0;i<b.length;i++){arb.event.standardHandler.hoverFns(b[i],_showMenu,_hideMenu);arb.event.addHandler(b[i],"focus",_showMenu);arb.event.addHandler(b[i],"blur",_hideMenu)}},stripeTables:function(){if(typeof(jQuery)!="undefined"){$(document).ready(function(){$("#content tr").hover(function(){$(this).addClass("arb-hover")},function(){$(this).removeClass("arb-hover")});$("#content tr:even").addClass("arb-even")})}},linkButtons:function(d,e){e=(e==null)?defaultCallback:e;$(d).each(function(){var a=$(this);var b=a.val();var c=$('<a href="#" class="link-button"><span>'+b+'</span></a>');a.before(c).hide();if(!a.is(":disabled")){c.click(function(){e(c,a);return false})}else{c.click(function(){return false}).attr("href","")}});function defaultCallback(a,b){b.click()}},enhanceTextareas:function(){$('textarea:not([@wysiwyg-textarea=true])').each(function(){$(this).wrap("<div class=\"enhanced-textarea\"></div>").parent().append($("<div class=\"textarea-footer\"></div>"));arb.functions.expandableTextarea($(this).parent());arb.functions.maxlengthTextarea($(this).parent())})},expandableTextarea:function(a){var b=null;var c=$("textarea",a);$(".textarea-footer",a).addClass("grippie").mousedown(startDrag);var d=$(".textarea-footer",a)[0];$(d).css("margin-right",d.offsetWidth-c[0].offsetWidth+"px");function startDrag(e){b=c.height()-arb.functions.mousePosition(e).y;c.css("opacity",0.25);$(document).bind("mousemove",performDrag).bind("mouseup",endDrag);return false}function performDrag(e){c.height(Math.max(32,b+arb.functions.mousePosition(e).y)+"px");return false}function endDrag(e){$(document).unbind("mousemove",performDrag).unbind("mouseup",endDrag);c.css("opacity",1)}},mousePosition:function(e){return{x:e.clientX+document.documentElement.scrollLeft,y:e.clientY+document.documentElement.scrollTop}},maxlengthTextarea:function(d){$("textarea[@maxlength]",d).each(function(){var a=$(this).attr('maxlength');var b=$(this).val().length;var c=$("<div class=\"textarea-length-counter\"><span>"+b+"</span>/"+a+" characters</div>");$(".textarea-footer",d).append(c);this.relatedElement=$('span',c)}).keyup(function(){var a=$(this).attr('maxlength');var b=$(this).val().length;if(b>=a){this.value=this.value.substring(0,a-1)}this.relatedElement.html(b)})},fontSizing:function(c,d){var d=$.extend({printText:'Print page',maxFontSize:140,minFontSize:70,fontIncrement:16.66,decreaseFontSizeText:'Decrease font size',increaseFontSize:'Increase font size'},d);function incrementFontSize(a){var b=parseFloat(arb.cookie.get("font-size"))+a;if(b>d.minFontSize&&b<d.maxFontSize){setBodyFontSize(b);arb.cookie.set("font-size",b,{path:"/"});$.jqem.trigger(true)}}function setBodyFontSize(a){$("#content").css("font-size",a+"%");if(((a*1)-d.fontIncrement)<d.minFontSize){$("#font-size-down-control").css("opacity",0.5);$("#font-size-up-control").css("opacity",1)}else if(((a*1)+d.fontIncrement)>d.maxFontSize){$("#font-size-down-control").css("opacity",1);$("#font-size-up-control").css("opacity",0.5)}else{$("#font-size-down-control").css("opacity",1);$("#font-size-up-control").css("opacity",1)}}var e=arb.cookie.get("font-size");if(!e){arb.cookie.set("font-size","100",{path:"/"});e=arb.cookie.get("font-size")}if(window.print&&e){$(c).prepend('<li id="font-size-down-control" title="'+d.decreaseFontSizeText+'"><span>A-</span></li><li id="font-size-up-control" title="'+d.increaseFontSize+'"><span>A+</span></li><li class="print-link" title="'+d.printText+'"><a href="#">'+d.printText+'</a></li>');setBodyFontSize(e);$("#print-control").click(function(){window.print()});$("#font-size-down-control").click(function(){incrementFontSize(-d.fontIncrement)});$("#font-size-up-control").click(function(){incrementFontSize(d.fontIncrement)});$("#page-controls li").hover(function(){$(this).addClass("arb-hover")},function(){$(this).removeClass("arb-hover")})}}};arb.cookie={set:function(a,b,c){c=c||{};var d='';c.expires=c.expires||356;var e=new Date();e.setTime(e.getTime()+(c.expires*24*60*60*1000));var d="; expires="+e.toGMTString();var f=c.path?'; path='+c.path:'';var g=c.domain?'; domain='+c.domain:'';var h=c.secure?'; secure':'';document.cookie=[a,'=',encodeURIComponent(b),d,f,g,h].join('')},get:function(a){var b=null;if(document.cookie&&document.cookie!=''){var c=document.cookie.split(';');for(var i=0;i<c.length;i++){var d=c[i].trim();if(d.substring(0,a.length+1)==(a+'=')){b=decodeURIComponent(d.substring(a.length+1));break}}}return b},remove:function(a){arb.cookie.set(a,"",{expires:-1})}};arb.event.addHandler(window,'load',arb.init);if(Array.prototype.push==null){Array.prototype.push=function(a){this[this.length]=a;return this.length}};if(String.prototype.trim==null){String.prototype.trim=function(){return this.replace(/^\s+|\s+$/,'')}}$(function(){if(typeof(ValidatorUpdateDisplay)=='function'){ValidatorUpdateDisplay=function(a){if(typeof(a.display)=="string"){if(a.display=="Dynamic"){if(a.isvalid&&$(a).is(':visible')){$(a).animate({height:'hide',opacity:'hide'},'slow',function(){if(!$(a).siblings('.error-message').is(':visible')){$(a).parent('.error-messages').parent('.form-item').removeClass('error-form-item')}})}else if(!a.isvalid&&!$(a).is(':visible')){$(a).animate({height:'show',opacity:'show'},'slow').parent('.error-messages').parent('.form-item').addClass('error-form-item')}}}}}});




/*
	dom-dropdown.js
*/
sfHover = function() {
	if (!document.getElementsByTagName) return false;
	if (!document.getElementById) return false;
	if (!document.getElementById("primary-navigation")) return false;
	
	var sfEls = document.getElementById("primary-navigation").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		
		sfEls[i].onmouseover=function() {
			if(this.className == "") {
				this.className+="arb-hover";
			} else {
				this.className+=" arb-hover";
			}
			//add a specific class for IE6 to style
			var liID = $(this).attr('id');
			this.className+= " " + liID + "-hover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp("\\barb-hover\\b"), "");
			//remove the specific class that IE6 needed
			var liID = $(this).attr('id');
			var replaceClass = "\\b" + liID + "-hover\\b";
			this.className=this.className.replace(new RegExp(replaceClass), "");
		}
	}
}

// load for IE 5+ (Win) and IE 5 (Mac)
if (document.all) { //MS IE
	if (window.attachEvent) window.attachEvent("onload", sfHover);
	else { //IE 5.2 Mac does not support attachEvent
		var old = window.onload;
		window.onload = function() { if (old) old(); sfHover(); }
	}
}

/*
	thickbox.js
*/
var tb_pathToImage="/loadingAnimation.gif";$(document).ready(function(){tb_init('a.thickbox, area.thickbox, input.thickbox');imgLoader=new Image();imgLoader.src=tb_pathToImage});function tb_init(b){$(b).click(function(){var t=this.title||this.name||null;var a=this.href||this.alt;var g=this.rel||false;tb_show(t,a,g);this.blur();return false})}function tb_show(d,f,g){try{if(typeof document.body.style.maxHeight==="undefined"){$("body","html").css({height:"100%",width:"100%"});$("html").css("overflow","hidden");if(document.getElementById("TB_HideSelect")===null){$("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");$("#TB_overlay").click(tb_remove)}}else{if(document.getElementById("TB_overlay")===null){$("body").append("<div id='TB_overlay'></div><div id='TB_window'></div>");$("#TB_overlay").click(tb_remove)}}if(tb_detectMacXFF()){$("#TB_overlay").addClass("TB_overlayMacFFBGHack")}else{$("#TB_overlay").addClass("TB_overlayBG")}if(d===null){d=""}$("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");$('#TB_load').show();var h;if(f.indexOf("?")!==-1){h=f.substr(0,f.indexOf("?"))}else{h=f}var i=/\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/;var j=h.toLowerCase().match(i);if(j=='.jpg'||j=='.jpeg'||j=='.png'||j=='.gif'||j=='.bmp'){TB_PrevCaption="";TB_PrevURL="";TB_PrevHTML="";TB_NextCaption="";TB_NextURL="";TB_NextHTML="";TB_imageCount="";TB_FoundURL=false;if(g){TB_TempArray=$("a[@rel="+g+"]").get();for(TB_Counter=0;((TB_Counter<TB_TempArray.length)&&(TB_NextHTML===""));TB_Counter++){var k=TB_TempArray[TB_Counter].href.toLowerCase().match(i);if(!(TB_TempArray[TB_Counter].href==f)){if(TB_FoundURL){TB_NextCaption=TB_TempArray[TB_Counter].title;TB_NextURL=TB_TempArray[TB_Counter].href;TB_NextHTML="<span id='TB_next'>&nbsp;&nbsp;<a href='#'>Next &gt;</a></span>"}else{TB_PrevCaption=TB_TempArray[TB_Counter].title;TB_PrevURL=TB_TempArray[TB_Counter].href;TB_PrevHTML="<span id='TB_prev'>&nbsp;&nbsp;<a href='#'>&lt; Prev</a></span>"}}else{TB_FoundURL=true;TB_imageCount="Image "+(TB_Counter+1)+" of "+(TB_TempArray.length)}}}imgPreloader=new Image();imgPreloader.onload=function(){imgPreloader.onload=null;var a=tb_getPageSize();var x=a[0]-150;var y=a[1]-150;var b=imgPreloader.width;var c=imgPreloader.height;if(b>x){c=c*(x/b);b=x;if(c>y){b=b*(y/c);c=y}}else if(c>y){b=b*(y/c);c=y;if(b>x){c=c*(x/b);b=x}}TB_WIDTH=b+30;TB_HEIGHT=c+60;$("#TB_window").append("<a href='' id='TB_ImageOff' title='"+thickBoxClose+"'><img id='TB_Image' src='"+f+"' width='"+b+"' height='"+c+"' alt='"+d+"'/></a>"+"<div id='TB_caption'>"+d+"<div id='TB_secondLine'>"+TB_imageCount+TB_PrevHTML+TB_NextHTML+"</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='"+thickBoxClose+"'>"+thickBoxClose+"</a> "+thickBoxOrEscKey+"</div>");$("#TB_closeWindowButton").click(tb_remove);if(!(TB_PrevHTML==="")){function goPrev(){if($(document).unbind("click",goPrev)){$(document).unbind("click",goPrev)}$("#TB_window").remove();$("body").append("<div id='TB_window'></div>");tb_show(TB_PrevCaption,TB_PrevURL,g);return false}$("#TB_prev").click(goPrev)}if(!(TB_NextHTML==="")){function goNext(){$("#TB_window").remove();$("body").append("<div id='TB_window'></div>");tb_show(TB_NextCaption,TB_NextURL,g);return false}$("#TB_next").click(goNext)}document.onkeydown=function(e){if(e==null){keycode=event.keyCode}else{keycode=e.which}if(keycode==27){tb_remove()}else if(keycode==190){if(!(TB_NextHTML=="")){document.onkeydown="";goNext()}}else if(keycode==188){if(!(TB_PrevHTML=="")){document.onkeydown="";goPrev()}}};tb_position();$("#TB_load").remove();$("#TB_ImageOff").click(tb_remove);$("#TB_window").css({display:"block"})};imgPreloader.src=f}else{var l=f.replace(/^[^\?]+\??/,'');var m=tb_parseQuery(l);TB_WIDTH=(m['width']*1)+30||630;TB_HEIGHT=(m['height']*1)+40||440;ajaxContentW=TB_WIDTH-30;ajaxContentH=TB_HEIGHT-45;if(f.indexOf('TB_iframe')!=-1){urlNoQuery=f.split('TB_');$("#TB_iframeContent").remove();if(m['modal']!="true"){$("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+d+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='"+thickBoxClose+"'>"+thickBoxClose+"</a> "+thickBoxOrEscKey+"</div></div><iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW+29)+"px;height:"+(ajaxContentH+17)+"px;' > </iframe>")}else{$("#TB_overlay").unbind();$("#TB_window").append("<iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW+29)+"px;height:"+(ajaxContentH+17)+"px;'> </iframe>")}}else{if($("#TB_window").css("display")!="block"){if(m['modal']!="true"){$("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+d+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'>"+thickBoxClose+"</a> "+thickBoxOrEscKey+"</div></div><div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px'></div>")}else{$("#TB_overlay").unbind();$("#TB_window").append("<div id='TB_ajaxContent' class='TB_modal' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>")}}else{$("#TB_ajaxContent")[0].style.width=ajaxContentW+"px";$("#TB_ajaxContent")[0].style.height=ajaxContentH+"px";$("#TB_ajaxContent")[0].scrollTop=0;$("#TB_ajaxWindowTitle").html(d)}}$("#TB_closeWindowButton").click(tb_remove);if(f.indexOf('TB_inline')!=-1){$("#TB_ajaxContent").append($('#'+m['inlineId']).children());$("#TB_window").unload(function(){$('#'+m['inlineId']).append($("#TB_ajaxContent").children())});tb_position();$("#TB_load").remove();$("#TB_window").css({display:"block"})}else if(f.indexOf('TB_iframe')!=-1){tb_position();if($.browser.safari){$("#TB_load").remove();$("#TB_window").css({display:"block"})}}else{$("#TB_ajaxContent").load(f+="&random="+(new Date().getTime()),function(){tb_position();$("#TB_load").remove();tb_init("#TB_ajaxContent a.thickbox");$("#TB_window").css({display:"block"})})}}if(!m['modal']){document.onkeyup=function(e){if(e==null){keycode=event.keyCode}else{keycode=e.which}if(keycode==27){tb_remove()}}}}catch(e){}}function tb_showIframe(){$("#TB_load").remove();$("#TB_window").css({display:"block"})}function tb_remove(){$("#TB_imageOff").unbind("click");$("#TB_closeWindowButton").unbind("click");$("#TB_window").fadeOut("fast",function(){$('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload").unbind().remove()});$("#TB_load").remove();if(typeof document.body.style.maxHeight=="undefined"){$("body","html").css({height:"auto",width:"auto"});$("html").css("overflow","")}document.onkeydown="";document.onkeyup="";return false}function tb_position(){$("#TB_window").css({marginLeft:'-'+parseInt((TB_WIDTH/2),10)+'px',width:TB_WIDTH+'px'});if(!(jQuery.browser.msie&&jQuery.browser.version<7)){$("#TB_window").css({marginTop:'-'+parseInt((TB_HEIGHT/2),10)+'px'})}}function tb_parseQuery(a){var b={};if(!a){return b}var c=a.split(/[;&]/);for(var i=0;i<c.length;i++){var d=c[i].split('=');if(!d||d.length!=2){continue}var e=unescape(d[0]);var f=unescape(d[1]);f=f.replace(/\+/g,' ');b[e]=f}return b}function tb_getPageSize(){var a=document.documentElement;var w=window.innerWidth||self.innerWidth||(a&&a.clientWidth)||document.body.clientWidth;var h=window.innerHeight||self.innerHeight||(a&&a.clientHeight)||document.body.clientHeight;arrayPageSize=[w,h];return arrayPageSize}function tb_detectMacXFF(){var a=navigator.userAgent.toLowerCase();if(a.indexOf('mac')!=-1&&a.indexOf('firefox')!=-1){return true}}



/*
	jquery.dimensions.pack.js
*/
(function($){$.dimensions={version:'1.2'};$.each(['Height','Width'],function(i,d){$.fn['inner'+d]=function(){if(!this[0])return;var a=d=='Height'?'Top':'Left',borr=d=='Height'?'Bottom':'Right';return this.is(':visible')?this[0]['client'+d]:num(this,d.toLowerCase())+num(this,'padding'+a)+num(this,'padding'+borr)};$.fn['outer'+d]=function(a){if(!this[0])return;var b=d=='Height'?'Top':'Left',borr=d=='Height'?'Bottom':'Right';a=$.extend({margin:false},a||{});var c=this.is(':visible')?this[0]['offset'+d]:num(this,d.toLowerCase())+num(this,'border'+b+'Width')+num(this,'border'+borr+'Width')+num(this,'padding'+b)+num(this,'padding'+borr);return c+(a.margin?(num(this,'margin'+b)+num(this,'margin'+borr)):0)}});$.each(['Left','Top'],function(i,b){$.fn['scroll'+b]=function(a){if(!this[0])return;return a!=undefined?this.each(function(){this==window||this==document?window.scrollTo(b=='Left'?a:$(window)['scrollLeft'](),b=='Top'?a:$(window)['scrollTop']()):this['scroll'+b]=a}):this[0]==window||this[0]==document?self[(b=='Left'?'pageXOffset':'pageYOffset')]||$.boxModel&&document.documentElement['scroll'+b]||document.body['scroll'+b]:this[0]['scroll'+b]}});$.fn.extend({position:function(){var a=0,top=0,elem=this[0],offset,parentOffset,offsetParent,results;if(elem){offsetParent=this.offsetParent();offset=this.offset();parentOffset=offsetParent.offset();offset.top-=num(elem,'marginTop');offset.left-=num(elem,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left}}return results},offsetParent:function(){var a=this[0].offsetParent;while(a&&(!/^body|html$/i.test(a.tagName)&&$.css(a,'position')=='static'))a=a.offsetParent;return $(a)}});function num(a,b){return parseInt($.curCSS(a.jquery?a[0]:a,b,true))||0}})(jQuery);



/*
	 jquery.em.js
*/
new function(){var c={'auto':function(a){return a!=undefined?d.auto=a:d.auto},'init':function(){return d.init()},'bind':function(a){return d.bind(a)},'unbind':function(a){return d.unbind(a)},'trigger':function(a,b){return d.trigger(a,b)},'active':function(){return d.active},'delay':function(a){return a?d.delay=a:d.delay},'start':function(){return d.start()},'stop':function(){return d.stop()},'current':function(){return d.current},'previous':function(){return d.previous}};$.jqem=c;var d={'$em':$(document.createElement('i')),'active':false,'canExp':undefined,'current':undefined,'delay':100,'iid':undefined,'previous':undefined,'auto':true,'init':init,'bind':bind,'unbind':unbind,'trigger':trigger,'update':function(){d.trigger(false);return'1em'},'start':start,'stop':stop};$(document).ready(function(){if(d.auto)init()});function init(){$('body').prepend(d.$em.css({'display':'block','left':'-1em','position':'absolute','visibility':'hidden','width':'1em'}));d.canExp=(d.$em.style!=undefined&&d.$em.style.setExpression!=undefined);d.start()};function bind(a){d.$em.bind('emchange',a)};function unbind(a){d.$em.unbind('emchange',a)};function trigger(a,b){if(a==undefined)a=false;if(a||d.$em.width()!=d.current){d.previous=d.current;d.current=d.$em.width();$.event.trigger('emchange',b)}};function start(){if(d.active)return;d.current=d.previous=d.$em.width();if(d.canExp){d.$em.style.setExpression('width','$.jqem.update();')}else{d.iid=window.setInterval(d.update,d.delay)}d.active=true};function stop(){if(!d.active)return;if(d.canExp){d.$em.style.removeExpression('width')}else{window.removeInterval(d.iid)}}}();



/*
 * jquery.defuscate.js
 */
(function($){jQuery.fn.defuscate=function(b){b=jQuery.extend({link:true},b);var c=/\b([A-Z0-9._%-]+)\([^)]+\)((?:[A-Z0-9-]+\.)+[A-Z]{2,6})\b/gi;return this.each(function(){if($(this).is('a[@href]')){$(this).attr('href',$(this).attr('href').replace(c,'$1@$2'));var a=true}$(this).html($(this).html().replace(c,(b.link&&!a?'<a href="mailto:$1@$2">$1@$2</a>':'$1@$2')))})}})(jQuery);



/*
 * jquery.pngfix.js
 */
(function($) {
	
	$.fn.pngfix = function(options) {
		
		// ECMA scope fix
		var elements 	= this;
		// Plug-in values
		var settings 	= $.extend({
			imageFixSrc: 	false
		}, options);
		
		if(!$.browser.msie || ($.browser.msie &&  $.browser.version >= 7)) {
			return(elements); // Kill
		}
		
		function setFilter(el, path, mode) {
			// Apply filter to element, setting the MSDN properties:
			//		:src
			//		:enabled
			//		:sizingMethod  
			var fs 			= el.attr("filters");
			var alpha 		= "DXImageTransform.Microsoft.AlphaImageLoader";
			if (fs[alpha]) {
				with (fs[alpha]) { 
					enabled = true;
					src = path; 
					sizingMethod = mode;
			 	}
			} else {
				el.css("filter", 'progid:' + alpha + '(enabled="true", sizingMethod="' + mode + '", src="' + path + '")');			
			}
		}
		
		function forceWidth(el) {
			if(el.css("width") == "auto" & el.css("height") == "auto") {
				// Only force width of element if it's set to auto
				el.css("width", el.attr("offsetWidth") + "px");
			}
		}
		
		// __APPLY__
		
		return(
			elements.each(function() {
				
				var el = $(this);
				
				if(el.attr("tagName").toUpperCase() == "IMG" && (/.png"?$/).test(el.attr("src"))) {
					
					if(!settings.imageFixSrc) {
						// Wrap the <img> in a <span> then apply style/filters, 
						// removing the <img> tag from the final render 
						el.wrap("<span></span>");
						var par = el.parent();
						par.css({
							height: 	el.height(),
							width: 		el.width(),
							display: 	"inline-block"
						});
						setFilter(par, el.attr("src"), "scale");
						el.remove();
					} else if((/.gif$/).test(settings.imageFixSrc)) {
						// Replace the current image with a transparent GIF
						// and apply the filter to the background of the 
						// <img> tag (not the preferred route)
						forceWidth(el);
						setFilter(el, el.attr("src"), "image");
						el.attr("src", settings.imageFixSrc);
					}					
				} else {
					var bg = el.css("backgroundImage");
					var matches = bg.match(/^url\("(.*)"\)$/);
					if(matches && matches.length) {
						// Elements with a PNG as a backgroundImage have the
						// filter applied with a sizing method relevant to the 
						// background repeat type
						forceWidth(el);
						el.css("backgroundImage", "none");
						
						// Restrict scaling methods to valid MSDN defintions (or one custom)
						if(el.css("backgroundRepeat").indexOf("repeat") > -1) {
							var sc = settings.repeatMethod == "repeat" ? "repeat" : "scale";
						} else {
							var sc = "crop";
						}
						setFilter(el, matches[1], sc);
						
						// IE peek-a-boo for internal links
						el.find("a").each(function() {
							$(this).css("position", "relative");
						});
					}
				}		
			}) // __END__
		);
	}
})(jQuery);

/*
	longwood.js
*/

<!--//---------------------------------+
//  Mouseover Accordian Script Developed by Roshan Bhattarai 
//  Visit http://roshanbh.com.np for this script and more.
//  This notice MUST stay intact for legal use
// --------------------------------->

$(document).ready(function(){	
	
	$("#accordionArea h3.tab:last").addClass("last");
	$("#accordionArea div.accordion_tab:last").addClass("last");

	$("#accordionArea h3.tab").click(function()
	{	
	if ($(this).css("backgroundImage").indexOf('icon_triangle_down.gif')>0) {
		$(this).css({backgroundImage:"url(/assets/icon_triangle_left.gif)", backgroundColor:"#FFE182", backgroundRepeat:"no-repeat"});
		$(this).hover(function () {$(this).css({backgroundColor:"#FFC510"});}, function () {$(this).css({backgroundColor:"#FFE182"});});
	} else {
		$(this).css({backgroundImage:"url(/assets/icon_triangle_down.gif)", backgroundColor:"#FFC510", backgroundRepeat:"no-repeat"});	
		$(this).hover(function () {$(this).css({backgroundColor:"#FFC510"});}, function () {$(this).css({backgroundColor:"#FFC510"});});
	}
    $(this).next("div.accordion_tab").slideToggle(300).siblings("div.accordion_tab").slideUp("slow");
    $(this).siblings(".tab").css({backgroundImage:"url(/assets/icon_triangle_left.gif)", backgroundColor:"#FFE182"});
	$(this).siblings(".tab").hover(function () {$(this).css({backgroundColor:"#FFC510"});}, function () {$(this).css({backgroundColor:"#FFE182"});});
     
    });
});


	
(function($){function initSelectRegion(){if($('#select-region a').length==0)return;var a=$('#select-region a');var b=a.attr('href');var c='select-region-active';var d='slow';var f='';$(b).hide();$(a).click(function(){$(b).stop();f=a.offset();if($(b).is(':visible')){$(this).parent().parent().removeClass('select-region-active');$('body').unbind('click');$(b).css('opacity',1).fadeOut(d,function(){$(this).toggleClass(c)})}else{removeRegionSelect();$(b).addClass(c).fadeIn(d).css('left',f.left-10);$(this).parent().parent().toggleClass('select-region-active')}return false});function removeRegionSelect(){$('body').click(function(e){if(!$(e.target).parents("#select-region-content").length>0){$(a).click()}})}}function sidebarBoxes(a){var b=$(a);var c=b.size();var d=Math.floor(Math.random()*(c));jQuery.each(b,function(i){if(i!=d){$(this).hide()}else{$(this).show()}})} 
																																																																																																																																																																																																																																																																																																																																																			

																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																			})(jQuery);

/* http://dev.jquery.com/view/tags/ui/latest/ui/ui.core.js
 * jQuery UI @VERSION
 *
 * Copyright (c) 2008 Paul Bakaus (ui.jquery.com)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI
 */
;(function($) {

$.ui = {
	plugin: {
		add: function(module, option, set) {
			var proto = $.ui[module].prototype;
			for(var i in set) {
				proto.plugins[i] = proto.plugins[i] || [];
				proto.plugins[i].push([option, set[i]]);
			}
		},
		call: function(instance, name, args) {
			var set = instance.plugins[name];
			if(!set) { return; }
			
			for (var i = 0; i < set.length; i++) {
				if (instance.options[set[i][0]]) {
					set[i][1].apply(instance.element, args);
				}
			}
		}	
	},
	cssCache: {},
	css: function(name) {
		if ($.ui.cssCache[name]) { return $.ui.cssCache[name]; }
		var tmp = $('<div class="ui-gen">').addClass(name).css({position:'absolute', top:'-5000px', left:'-5000px', display:'block'}).appendTo('body');
		
		//if (!$.browser.safari)
			//tmp.appendTo('body'); 
		
		//Opera and Safari set width and height to 0px instead of auto
		//Safari returns rgba(0,0,0,0) when bgcolor is not set
		$.ui.cssCache[name] = !!(
			(!(/auto|default/).test(tmp.css('cursor')) || (/^[1-9]/).test(tmp.css('height')) || (/^[1-9]/).test(tmp.css('width')) || 
			!(/none/).test(tmp.css('backgroundImage')) || !(/transparent|rgba\(0, 0, 0, 0\)/).test(tmp.css('backgroundColor')))
		);
		try { $('body').get(0).removeChild(tmp.get(0));	} catch(e){}
		return $.ui.cssCache[name];
	},
	disableSelection: function(e) {
		e.unselectable = "on";
		e.onselectstart = function() { return false; };
		if (e.style) { e.style.MozUserSelect = "none"; }
	},
	enableSelection: function(e) {
		e.unselectable = "off";
		e.onselectstart = function() { return true; };
		if (e.style) { e.style.MozUserSelect = ""; }
	},
	hasScroll: function(e, a) {
		var scroll = /top/.test(a||"top") ? 'scrollTop' : 'scrollLeft', has = false;
		if (e[scroll] > 0) return true; e[scroll] = 1;
		has = e[scroll] > 0 ? true : false; e[scroll] = 0;
		return has;
	}
};


/** jQuery core modifications and additions **/

var _remove = $.fn.remove;
$.fn.remove = function() {
	$("*", this).add(this).trigger("remove");
	return _remove.apply(this, arguments );
};

// $.widget is a factory to create jQuery plugins
// taking some boilerplate code out of the plugin code
// created by Scott González and Jörn Zaefferer
function getter(namespace, plugin, method) {
	var methods = $[namespace][plugin].getter || [];
	methods = (typeof methods == "string" ? methods.split(/,?\s+/) : methods);
	return ($.inArray(method, methods) != -1);
}

$.widget = function(name, prototype) {
	var namespace = name.split(".")[0];
	name = name.split(".")[1];
	
	// create plugin method
	$.fn[name] = function(options) {
		var isMethodCall = (typeof options == 'string'),
			args = Array.prototype.slice.call(arguments, 1);
		
		if (isMethodCall && getter(namespace, name, options)) {
			var instance = $.data(this[0], name);
			return (instance ? instance[options].apply(instance, args)
				: undefined);
		}
		
		return this.each(function() {
			var instance = $.data(this, name);
			if (isMethodCall && instance && $.isFunction(instance[options])) {
				instance[options].apply(instance, args);
			} else if (!isMethodCall) {
				$.data(this, name, new $[namespace][name](this, options));
			}
		});
	};
	
	// create widget constructor
	$[namespace][name] = function(element, options) {
		var self = this;
		
		this.widgetName = name;
		this.widgetBaseClass = namespace + '-' + name;
		
		this.options = $.extend({}, $.widget.defaults, $[namespace][name].defaults, options);
		this.element = $(element)
			.bind('setData.' + name, function(e, key, value) {
				return self.setData(key, value);
			})
			.bind('getData.' + name, function(e, key) {
				return self.getData(key);
			})
			.bind('remove', function() {
				return self.destroy();
			});
		this.init();
	};
	
	// add widget prototype
	$[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype);
};

$.widget.prototype = {
	init: function() {},
	destroy: function() {
		this.element.removeData(this.widgetName);
	},
	
	getData: function(key) {
		return this.options[key];
	},
	setData: function(key, value) {
		this.options[key] = value;
		
		if (key == 'disabled') {
			this.element[value ? 'addClass' : 'removeClass'](
				this.widgetBaseClass + '-disabled');
		}
	},
	
	enable: function() {
		this.setData('disabled', false);
	},
	disable: function() {
		this.setData('disabled', true);
	}
};

$.widget.defaults = {
	disabled: false
};


/** Mouse Interaction Plugin **/

$.ui.mouse = {
	mouseInit: function() {
		var self = this;
	
		this.element.bind('mousedown.'+this.widgetName, function(e) {
			return self.mouseDown(e);
		});
		
		// Prevent text selection in IE
		if ($.browser.msie) {
			this._mouseUnselectable = this.element.attr('unselectable');
			this.element.attr('unselectable', 'on');
		}
		
		this.started = false;
	},
	
	// TODO: make sure destroying one instance of mouse doesn't mess with
	// other instances of mouse
	mouseDestroy: function() {
		this.element.unbind('.'+this.widgetName);
		
		// Restore text selection in IE
		($.browser.msie
			&& this.element.attr('unselectable', this._mouseUnselectable));
	},
	
	mouseDown: function(e) {
		// we may have missed mouseup (out of window)
		(this._mouseStarted && this.mouseUp(e));
		
		this._mouseDownEvent = e;
		
		var self = this,
			btnIsLeft = (e.which == 1),
			elIsCancel = (typeof this.options.cancel == "string" ? $(e.target).is(this.options.cancel) : false);
		if (!btnIsLeft || elIsCancel || !this.mouseCapture(e)) {
			return true;
		}
		
		this._mouseDelayMet = !this.options.delay;
		if (!this._mouseDelayMet) {
			this._mouseDelayTimer = setTimeout(function() {
				self._mouseDelayMet = true;
			}, this.options.delay);
		}
		
		if (this.mouseDistanceMet(e) && this.mouseDelayMet(e)) {
			this._mouseStarted = (this.mouseStart(e) !== false);
			if (!this._mouseStarted) {
				e.preventDefault();
				return true;
			}
		}
		
		// these delegates are required to keep context
		this._mouseMoveDelegate = function(e) {
			return self.mouseMove(e);
		};
		this._mouseUpDelegate = function(e) {
			return self.mouseUp(e);
		};
		$(document)
			.bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
			.bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
		
		return false;
	},
	
	mouseMove: function(e) {
		// IE mouseup check - mouseup happened when mouse was out of window
		if ($.browser.msie && !e.button) {
			return this.mouseUp(e);
		}
		
		if (this._mouseStarted) {
			this.mouseDrag(e);
			return false;
		}
		
		if (this.mouseDistanceMet(e) && this.mouseDelayMet(e)) {
			this._mouseStarted =
				(this.mouseStart(this._mouseDownEvent, e) !== false);
			(this._mouseStarted ? this.mouseDrag(e) : this.mouseUp(e));
		}
		
		return !this._mouseStarted;
	},
	
	mouseUp: function(e) {
		$(document)
			.unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
			.unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
		
		if (this._mouseStarted) {
			this._mouseStarted = false;
			this.mouseStop(e);
		}
		
		return false;
	},
	
	mouseDistanceMet: function(e) {
		return (Math.max(
				Math.abs(this._mouseDownEvent.pageX - e.pageX),
				Math.abs(this._mouseDownEvent.pageY - e.pageY)
			) >= this.options.distance
		);
	},
	
	mouseDelayMet: function(e) {
		return this._mouseDelayMet;
	},
	
	// These are placeholder methods, to be overriden by extending plugin
	mouseStart: function(e) {},
	mouseDrag: function(e) {},
	mouseStop: function(e) {},
	mouseCapture: function(e) { return true; }
};

$.ui.mouse.defaults = {
	cancel: null,
	distance: 1,
	delay: 0
};

})(jQuery);

/* http://dev.jquery.com/view/tags/ui/latest/ui/ui.accordion.js
 * jQuery UI Accordion
 * 
 * Copyright (c) 2007, 2008 Jörn Zaefferer
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Accordion
 *
 * Depends:
 *	ui.core.js
 */
(function($) {

$.widget("ui.accordion", {
	init: function() {
		var options = this.options;
		
		if ( options.navigation ) {
			var current = this.element.find("a").filter(options.navigationFilter);
			if ( current.length ) {
				if ( current.filter(options.header).length ) {
					options.active = current;
				} else {
					options.active = current.parent().parent().prev();
					current.addClass("current");
				}
			}
		}
		
		// calculate active if not specified, using the first header
		options.headers = this.element.find(options.header);
		options.active = findActive(options.headers, options.active);
		
		// IE7-/Win - Extra vertical space in Lists fixed
		if ($.browser.msie) {
			this.element.find('a').css('zoom', '1');
		}
		
		if (!this.element.hasClass("ui-accordion")) {
			this.element.addClass("ui-accordion");
			$("<span class='ui-accordion-left'/>").insertBefore(options.headers);
			$("<span class='ui-accordion-right'/>").appendTo(options.headers);
			options.headers.addClass("ui-accordion-header").attr("tabindex", "0");
		}
		
		var maxHeight;
		if ( options.fillSpace ) {
			maxHeight = this.element.parent().height();
			options.headers.each(function() {
				maxHeight -= $(this).outerHeight();
			});
			var maxPadding = 0;
			options.headers.next().each(function() {
				maxPadding = Math.max(maxPadding, $(this).innerHeight() - $(this).height());
			}).height(maxHeight - maxPadding);
		} else if ( options.autoHeight ) {
			maxHeight = 0;
			options.headers.next().each(function() {
				maxHeight = Math.max(maxHeight, $(this).outerHeight());
			}).height(maxHeight);
		}
	
		options.headers
			.not(options.active || "")
			.next()
			.hide();
		options.active.parent().andSelf().addClass(options.selectedClass);
		
		if (options.event) {
			this.element.bind((options.event) + ".accordion", clickHandler);
		}
	},
	activate: function(index) {
		// call clickHandler with custom event
		clickHandler.call(this.element[0], {
			target: findActive( this.options.headers, index )[0]
		});
	},
	destroy: function() {
		this.options.headers.next().css("display", "");
		if ( this.options.fillSpace || this.options.autoHeight ) {
			this.options.headers.next().css("height", "");
		}
		$.removeData(this.element[0], "accordion");
		this.element.removeClass("ui-accordion").unbind(".accordion");
	}
});

function scopeCallback(callback, scope) {
	return function() {
		return callback.apply(scope, arguments);
	};
};

function completed(cancel) {
	// if removed while animated data can be empty
	if (!$.data(this, "accordion")) {
		return;
	}
	
	var instance = $.data(this, "accordion");
	var options = instance.options;
	options.running = cancel ? 0 : --options.running;
	if ( options.running ) {
		return;
	}
	if ( options.clearStyle ) {
		options.toShow.add(options.toHide).css({
			height: "",
			overflow: ""
		});
	}
	$(this).triggerHandler("accordionchange", [null, options.data], options.change);
}

function toggle(toShow, toHide, data, clickedActive, down) {
	var options = $.data(this, "accordion").options;
	options.toShow = toShow;
	options.toHide = toHide;
	options.data = data;
	var complete = scopeCallback(completed, this);
	
	// count elements to animate
	options.running = toHide.size() === 0 ? toShow.size() : toHide.size();
	
	if ( options.animated ) {
		if ( !options.alwaysOpen && clickedActive ) {
			$.ui.accordion.animations[options.animated]({
				toShow: jQuery([]),
				toHide: toHide,
				complete: complete,
				down: down,
				autoHeight: options.autoHeight
			});
		} else {
			$.ui.accordion.animations[options.animated]({
				toShow: toShow,
				toHide: toHide,
				complete: complete,
				down: down,
				autoHeight: options.autoHeight
			});
		}
	} else {
		if ( !options.alwaysOpen && clickedActive ) {
			toShow.toggle();
		} else {
			toHide.hide();
			toShow.show();
		}
		complete(true);
	}
}

function clickHandler(event) {
	var options = $.data(this, "accordion").options;
	if (options.disabled) {
		return false;
	}
	
	// called only when using activate(false) to close all parts programmatically
	if ( !event.target && !options.alwaysOpen ) {
		options.active.parent().andSelf().toggleClass(options.selectedClass);
		var toHide = options.active.next(),
			data = {
				options: options,
				newHeader: jQuery([]),
				oldHeader: options.active,
				newContent: jQuery([]),
				oldContent: toHide
			},
			toShow = (options.active = $([]));
		toggle.call(this, toShow, toHide, data );
		return false;
	}
	// get the click target
	var clicked = $(event.target);
	
	// due to the event delegation model, we have to check if one
	// of the parent elements is our actual header, and find that
	// otherwise stick with the initial target
	clicked = $( clicked.parents(options.header)[0] || clicked );
	
	var clickedActive = clicked[0] == options.active[0];
	
	// if animations are still active, or the active header is the target, ignore click
	if (options.running || (options.alwaysOpen && clickedActive)) {
		return false;
	}
	if (!clicked.is(options.header)) {
		return;
	}
	
	// switch classes
	options.active.parent().andSelf().toggleClass(options.selectedClass);
	if ( !clickedActive ) {
		clicked.parent().andSelf().addClass(options.selectedClass);
	}
	
	// find elements to show and hide
	var toShow = clicked.next(),
		toHide = options.active.next(),
		//data = [clicked, options.active, toShow, toHide],
		data = {
			options: options,
			newHeader: clicked,
			oldHeader: options.active,
			newContent: toShow,
			oldContent: toHide
		},
		down = options.headers.index( options.active[0] ) > options.headers.index( clicked[0] );
	
	options.active = clickedActive ? $([]) : clicked;
	toggle.call(this, toShow, toHide, data, clickedActive, down );

	return false;
};

function findActive(headers, selector) {
	return selector != undefined
		? typeof selector == "number"
			? headers.filter(":eq(" + selector + ")")
			: headers.not(headers.not(selector))
		: selector === false
			? $([])
			: headers.filter(":eq(0)");
}

$.extend($.ui.accordion, {
	defaults: {
		selectedClass: "selected",
		alwaysOpen: true,
		animated: 'slide',
		event: "click",
		header: "a",
		autoHeight: true,
		running: 0,
		navigationFilter: function() {
			return this.href.toLowerCase() == location.href.toLowerCase();
		}
	},
	animations: {
		slide: function(options, additions) {
			options = $.extend({
				easing: "swing",
				duration: 300
			}, options, additions);
			if ( !options.toHide.size() ) {
				options.toShow.animate({height: "show"}, options);
				return;
			}
			var hideHeight = options.toHide.height(),
				showHeight = options.toShow.height(),
				difference = showHeight / hideHeight;
			options.toShow.css({ height: 0, overflow: 'hidden' }).show();
			options.toHide.filter(":hidden").each(options.complete).end().filter(":visible").animate({height:"hide"},{
				step: function(now) {
					var current = (hideHeight - now) * difference;
					if ($.browser.msie || $.browser.opera) {
						current = Math.ceil(current);
					}
					options.toShow.height( current );
				},
				duration: options.duration,
				easing: options.easing,
				complete: function() {
					if ( !options.autoHeight ) {
						options.toShow.css("height", "auto");
					}
					options.complete();
				}
			});
		},
		bounceslide: function(options) {
			this.slide(options, {
				easing: options.down ? "bounceout" : "swing",
				duration: options.down ? 1000 : 200
			});
		},
		easeslide: function(options) {
			this.slide(options, {
				easing: "easeinout",
				duration: 700
			});
		}
	}
});

// deprecated, use accordion("activate", index) instead
$.fn.activate = function(index) {
	return this.accordion("activate", index);
};

})(jQuery);


/* ------------------------------------------------------------------------
	Class: prettyPhoto
	Use: Lightbox clone for jQuery
	Author: Stephane Caron (http://www.no-margin-for-errors.com)
	Version: 3.1.3
------------------------------------------------------------------------- */

(function($){loadcssfile("/css/prettyPhoto.css");$.prettyPhoto={version:'3.1.3'};$.fn.prettyPhoto=function(pp_settings){pp_settings=jQuery.extend({animation_speed:'fast',slideshow:5000,autoplay_slideshow:false,opacity:0.80,show_title:true,allow_resize:true,default_width:500,default_height:344,counter_separator_label:'/',theme:'pp_default',horizontal_padding:20,hideflash:false,wmode:'opaque',autoplay:true,modal:false,deeplinking:true,overlay_gallery:true,keyboard_shortcuts:true,changepicturecallback:function(){},callback:function(){},ie6_fallback:true,markup:'<div class="pp_pic_holder"> \
      <div class="ppt">&nbsp;</div> \
      <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"> \
           <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> \
           <p class="pp_description"></p> \
           <div class="pp_social">{pp_social}</div> \
           <a class="pp_close" href="#">Close</a> \
          </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>',gallery_markup:'<div class="pp_gallery"> \
        <a href="#" class="pp_arrow_previous">Previous</a> \
        <div> \
         <ul> \
          {gallery} \
         </ul> \
        </div> \
        <a href="#" class="pp_arrow_next">Next</a> \
       </div>',image_markup:'<img id="fullResImage" src="{path}" />',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">{content}</div>',custom_markup:'',social_tools:'<div class="twitter"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="facebook"><iframe src="http://www.facebook.com/plugins/like.php?locale=en_US&href={location_href}&amp;layout=button_count&amp;show_faces=true&amp;width=500&amp;action=like&amp;font&amp;colorscheme=light&amp;height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowTransparency="true"></iframe></div>'},pp_settings);var matchedObjects=this,percentBased=false,pp_dimensions,pp_open,pp_contentHeight,pp_contentWidth,pp_containerHeight,pp_containerWidth,windowHeight=$(window).height(),windowWidth=$(window).width(),pp_slideshow;doresize=true,scroll_pos=_get_scroll();$(window).unbind('resize.prettyphoto').bind('resize.prettyphoto',function(){_center_overlay();_resize_overlay();});if(pp_settings.keyboard_shortcuts){$(document).unbind('keydown.prettyphoto').bind('keydown.prettyphoto',function(e){if(typeof $pp_pic_holder!='undefined'){if($pp_pic_holder.is(':visible')){switch(e.keyCode){case 37:$.prettyPhoto.changePage('previous');e.preventDefault();break;case 39:$.prettyPhoto.changePage('next');e.preventDefault();break;case 27:if(!settings.modal)
$.prettyPhoto.close();e.preventDefault();break;};};};});};$.prettyPhoto.initialize=function(){settings=pp_settings;if(settings.theme=='pp_default')settings.horizontal_padding=16;if(settings.ie6_fallback&&$.browser.msie&&parseInt($.browser.version)==6)settings.theme="light_square";theRel=$(this).attr('rel');galleryRegExp=/\[(?:.*)\]/;isSet=(galleryRegExp.exec(theRel))?true:false;pp_images=(isSet)?jQuery.map(matchedObjects,function(n,i){if($(n).attr('rel').indexOf(theRel)!=-1)return $(n).attr('href');}):$.makeArray($(this).attr('href'));pp_titles=(isSet)?jQuery.map(matchedObjects,function(n,i){if($(n).attr('rel').indexOf(theRel)!=-1)return($(n).find('img').attr('alt'))?$(n).find('img').attr('alt'):"";}):$.makeArray($(this).find('img').attr('alt'));pp_descriptions=(isSet)?jQuery.map(matchedObjects,function(n,i){if($(n).attr('rel').indexOf(theRel)!=-1)return($(n).attr('title'))?$(n).attr('title'):"";}):$.makeArray($(this).attr('title'));if(pp_images.length>30)settings.overlay_gallery=false;set_position=jQuery.inArray($(this).attr('href'),pp_images);rel_index=(isSet)?set_position:$("a[rel^='"+theRel+"']").index($(this));_build_overlay(this);if(settings.allow_resize)
$(window).bind('scroll.prettyphoto',function(){_center_overlay();});$.prettyPhoto.open();return false;}
$.prettyPhoto.open=function(event){if(typeof settings=="undefined"){settings=pp_settings;if($.browser.msie&&$.browser.version==6)settings.theme="light_square";pp_images=$.makeArray(arguments[0]);pp_titles=(arguments[1])?$.makeArray(arguments[1]):$.makeArray("");pp_descriptions=(arguments[2])?$.makeArray(arguments[2]):$.makeArray("");isSet=(pp_images.length>1)?true:false;set_position=0;_build_overlay(event.target);}
if($.browser.msie&&$.browser.version==6)$('select').css('visibility','hidden');if(settings.hideflash)$('object,embed,iframe[src*=youtube],iframe[src*=vimeo]').css('visibility','hidden');_checkPosition($(pp_images).size());$('.pp_loaderIcon').show();if(settings.deeplinking)
setHashtag();if(settings.social_tools){facebook_like_link=settings.social_tools.replace('{location_href}',encodeURIComponent(location.href));$pp_pic_holder.find('.pp_social').html(facebook_like_link);}
if($ppt.is(':hidden'))$ppt.css('opacity',0).show();$pp_overlay.show().fadeTo(settings.animation_speed,settings.opacity);$pp_pic_holder.find('.currentTextHolder').text((set_position+1)+settings.counter_separator_label+$(pp_images).size());if(pp_descriptions[set_position]!=""){$pp_pic_holder.find('.pp_description').show().html(unescape(pp_descriptions[set_position]));}else{$pp_pic_holder.find('.pp_description').hide();}
movie_width=(parseFloat(getParam('width',pp_images[set_position])))?getParam('width',pp_images[set_position]):settings.default_width.toString();movie_height=(parseFloat(getParam('height',pp_images[set_position])))?getParam('height',pp_images[set_position]):settings.default_height.toString();percentBased=false;if(movie_height.indexOf('%')!=-1){movie_height=parseFloat(($(window).height()*parseFloat(movie_height)/100)-150);percentBased=true;}
if(movie_width.indexOf('%')!=-1){movie_width=parseFloat(($(window).width()*parseFloat(movie_width)/100)-150);percentBased=true;}
$pp_pic_holder.fadeIn(function(){(settings.show_title&&pp_titles[set_position]!=""&&typeof pp_titles[set_position]!="undefined")?$ppt.html(unescape(pp_titles[set_position])):$ppt.html('&nbsp;');imgPreloader="";skipInjection=false;switch(_getFileType(pp_images[set_position])){case'image':imgPreloader=new Image();nextImage=new Image();if(isSet&&set_position<$(pp_images).size()-1)nextImage.src=pp_images[set_position+1];prevImage=new Image();if(isSet&&pp_images[set_position-1])prevImage.src=pp_images[set_position-1];$pp_pic_holder.find('#pp_full_res')[0].innerHTML=settings.image_markup.replace(/{path}/g,pp_images[set_position]);imgPreloader.onload=function(){pp_dimensions=_fitToViewport(imgPreloader.width,imgPreloader.height);_showContent();};imgPreloader.onerror=function(){alert('Image cannot be loaded. Make sure the path is correct and image exist.');$.prettyPhoto.close();};imgPreloader.src=pp_images[set_position];break;case'youtube':pp_dimensions=_fitToViewport(movie_width,movie_height);movie_id=getParam('v',pp_images[set_position]);if(movie_id==""){movie_id=pp_images[set_position].split('youtu.be/');movie_id=movie_id[1];if(movie_id.indexOf('?')>0)
movie_id=movie_id.substr(0,movie_id.indexOf('?'));if(movie_id.indexOf('&')>0)
movie_id=movie_id.substr(0,movie_id.indexOf('&'));}
movie='http://www.youtube.com/embed/'+movie_id;(getParam('rel',pp_images[set_position]))?movie+="?rel="+getParam('rel',pp_images[set_position]):movie+="?rel=1";if(settings.autoplay)movie+="&autoplay=1";toInject=settings.iframe_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);break;case'vimeo':pp_dimensions=_fitToViewport(movie_width,movie_height);movie_id=pp_images[set_position];var regExp=/http:\/\/(www\.)?vimeo.com\/(\d+)/;var match=movie_id.match(regExp);movie='http://player.vimeo.com/video/'+match[2]+'?title=0&amp;byline=0&amp;portrait=0';if(settings.autoplay)movie+="&autoplay=1;";vimeo_width=pp_dimensions['width']+'/embed/?moog_width='+pp_dimensions['width'];toInject=settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,pp_dimensions['height']).replace(/{path}/g,movie);break;case'quicktime':pp_dimensions=_fitToViewport(movie_width,movie_height);pp_dimensions['height']+=15;pp_dimensions['contentHeight']+=15;pp_dimensions['containerHeight']+=15;toInject=settings.quicktime_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay);break;case'flash':pp_dimensions=_fitToViewport(movie_width,movie_height);flash_vars=pp_images[set_position];flash_vars=flash_vars.substring(pp_images[set_position].indexOf('flashvars')+10,pp_images[set_position].length);filename=pp_images[set_position];filename=filename.substring(0,filename.indexOf('?'));toInject=settings.flash_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+'?'+flash_vars);break;case'iframe':pp_dimensions=_fitToViewport(movie_width,movie_height);frame_url=pp_images[set_position];frame_url=frame_url.substr(0,frame_url.indexOf('iframe')-1);toInject=settings.iframe_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{path}/g,frame_url);break;case'ajax':doresize=false;pp_dimensions=_fitToViewport(movie_width,movie_height);doresize=true;skipInjection=true;$.get(pp_images[set_position],function(responseHTML){toInject=settings.inline_markup.replace(/{content}/g,responseHTML);$pp_pic_holder.find('#pp_full_res')[0].innerHTML=toInject;_showContent();});break;case'custom':pp_dimensions=_fitToViewport(movie_width,movie_height);toInject=settings.custom_markup;break;case'inline':myClone=$(pp_images[set_position]).clone().append('<br clear="all" />').css({'width':settings.default_width}).wrapInner('<div id="pp_full_res"><div class="pp_inline"></div></div>').appendTo($('body')).show();doresize=false;pp_dimensions=_fitToViewport($(myClone).width(),$(myClone).height());doresize=true;$(myClone).remove();toInject=settings.inline_markup.replace(/{content}/g,$(pp_images[set_position]).html());break;};if(!imgPreloader&&!skipInjection){$pp_pic_holder.find('#pp_full_res')[0].innerHTML=toInject;_showContent();};});return false;};$.prettyPhoto.changePage=function(direction){currentGalleryPage=0;if(direction=='previous'){set_position--;if(set_position<0)set_position=$(pp_images).size()-1;}else if(direction=='next'){set_position++;if(set_position>$(pp_images).size()-1)set_position=0;}else{set_position=direction;};rel_index=set_position;if(!doresize)doresize=true;$('.pp_contract').removeClass('pp_contract').addClass('pp_expand');_hideContent(function(){$.prettyPhoto.open();});};$.prettyPhoto.changeGalleryPage=function(direction){if(direction=='next'){currentGalleryPage++;if(currentGalleryPage>totalPage)currentGalleryPage=0;}else if(direction=='previous'){currentGalleryPage--;if(currentGalleryPage<0)currentGalleryPage=totalPage;}else{currentGalleryPage=direction;};slide_speed=(direction=='next'||direction=='previous')?settings.animation_speed:0;slide_to=currentGalleryPage*(itemsPerPage*itemWidth);$pp_gallery.find('ul').animate({left:-slide_to},slide_speed);};$.prettyPhoto.startSlideshow=function(){if(typeof pp_slideshow=='undefined'){$pp_pic_holder.find('.pp_play').unbind('click').removeClass('pp_play').addClass('pp_pause').click(function(){$.prettyPhoto.stopSlideshow();return false;});pp_slideshow=setInterval($.prettyPhoto.startSlideshow,settings.slideshow);}else{$.prettyPhoto.changePage('next');};}
$.prettyPhoto.stopSlideshow=function(){$pp_pic_holder.find('.pp_pause').unbind('click').removeClass('pp_pause').addClass('pp_play').click(function(){$.prettyPhoto.startSlideshow();return false;});clearInterval(pp_slideshow);pp_slideshow=undefined;}
$.prettyPhoto.close=function(){if($pp_overlay.is(":animated"))return;$.prettyPhoto.stopSlideshow();$pp_pic_holder.stop().find('object,embed').css('visibility','hidden');$('div.pp_pic_holder,div.ppt,.pp_fade').fadeOut(settings.animation_speed,function(){$(this).remove();});$pp_overlay.fadeOut(settings.animation_speed,function(){if($.browser.msie&&$.browser.version==6)$('select').css('visibility','visible');if(settings.hideflash)$('object,embed,iframe[src*=youtube],iframe[src*=vimeo]').css('visibility','visible');$(this).remove();$(window).unbind('scroll.prettyphoto');clearHashtag();settings.callback();doresize=true;pp_open=false;delete settings;});};function _showContent(){$('.pp_loaderIcon').hide();projectedTop=scroll_pos['scrollTop']+((windowHeight/2)-(pp_dimensions['containerHeight']/2));if(projectedTop<0)projectedTop=0;$ppt.fadeTo(settings.animation_speed,1);$pp_pic_holder.find('.pp_content').animate({height:pp_dimensions['contentHeight'],width:pp_dimensions['contentWidth']},settings.animation_speed);$pp_pic_holder.animate({'top':projectedTop,'left':(windowWidth/2)-(pp_dimensions['containerWidth']/2),width:pp_dimensions['containerWidth']},settings.animation_speed,function(){$pp_pic_holder.find('.pp_hoverContainer,#fullResImage').height(pp_dimensions['height']).width(pp_dimensions['width']);$pp_pic_holder.find('.pp_fade').fadeIn(settings.animation_speed);if(isSet&&_getFileType(pp_images[set_position])=="image"){$pp_pic_holder.find('.pp_hoverContainer').show();}else{$pp_pic_holder.find('.pp_hoverContainer').hide();}
if(pp_dimensions['resized']){$('a.pp_expand,a.pp_contract').show();}else{$('a.pp_expand').hide();}
if(settings.autoplay_slideshow&&!pp_slideshow&&!pp_open)$.prettyPhoto.startSlideshow();settings.changepicturecallback();pp_open=true;});_insert_gallery();};function _hideContent(callback){$pp_pic_holder.find('#pp_full_res object,#pp_full_res embed').css('visibility','hidden');$pp_pic_holder.find('.pp_fade').fadeOut(settings.animation_speed,function(){$('.pp_loaderIcon').show();callback();});};function _checkPosition(setCount){(setCount>1)?$('.pp_nav').show():$('.pp_nav').hide();};function _fitToViewport(width,height){resized=false;_getDimensions(width,height);imageWidth=width,imageHeight=height;if(((pp_containerWidth>windowWidth)||(pp_containerHeight>windowHeight))&&doresize&&settings.allow_resize&&!percentBased){resized=true,fitting=false;while(!fitting){if((pp_containerWidth>windowWidth)){imageWidth=(windowWidth-200);imageHeight=(height/width)*imageWidth;}else if((pp_containerHeight>windowHeight)){imageHeight=(windowHeight-200);imageWidth=(width/height)*imageHeight;}else{fitting=true;};pp_containerHeight=imageHeight,pp_containerWidth=imageWidth;};_getDimensions(imageWidth,imageHeight);if((pp_containerWidth>windowWidth)||(pp_containerHeight>windowHeight)){_fitToViewport(pp_containerWidth,pp_containerHeight)};};return{width:Math.floor(imageWidth),height:Math.floor(imageHeight),containerHeight:Math.floor(pp_containerHeight),containerWidth:Math.floor(pp_containerWidth)+(settings.horizontal_padding*2),contentHeight:Math.floor(pp_contentHeight),contentWidth:Math.floor(pp_contentWidth),resized:resized};};function _getDimensions(width,height){width=parseFloat(width);height=parseFloat(height);$pp_details=$pp_pic_holder.find('.pp_details');$pp_details.width(width);detailsHeight=parseFloat($pp_details.css('marginTop'))+parseFloat($pp_details.css('marginBottom'));$pp_details=$pp_details.clone().addClass(settings.theme).width(width).appendTo($('body')).css({'position':'absolute','top':-10000});detailsHeight+=$pp_details.height();detailsHeight=(detailsHeight<=34)?36:detailsHeight;if($.browser.msie&&$.browser.version==7)detailsHeight+=8;$pp_details.remove();$pp_title=$pp_pic_holder.find('.ppt');$pp_title.width(width);titleHeight=parseFloat($pp_title.css('marginTop'))+parseFloat($pp_title.css('marginBottom'));$pp_title=$pp_title.clone().appendTo($('body')).css({'position':'absolute','top':-10000});titleHeight+=$pp_title.height();$pp_title.remove();pp_contentHeight=height+detailsHeight;pp_contentWidth=width;pp_containerHeight=pp_contentHeight+titleHeight+$pp_pic_holder.find('.pp_top').height()+$pp_pic_holder.find('.pp_bottom').height();pp_containerWidth=width;}
function _getFileType(itemSrc){if(itemSrc.match(/youtube\.com\/watch/i)||itemSrc.match(/youtu\.be/i)){return'youtube';}else if(itemSrc.match(/vimeo\.com/i)){return'vimeo';}else if(itemSrc.match(/\b.mov\b/i)){return'quicktime';}else if(itemSrc.match(/\b.swf\b/i)){return'flash';}else if(itemSrc.match(/\biframe=true\b/i)){return'iframe';}else if(itemSrc.match(/\bajax=true\b/i)){return'ajax';}else if(itemSrc.match(/\bcustom=true\b/i)){return'custom';}else if(itemSrc.substr(0,1)=='#'){return'inline';}else{return'image';};};function _center_overlay(){if(doresize&&typeof $pp_pic_holder!='undefined'){scroll_pos=_get_scroll();contentHeight=$pp_pic_holder.height(),contentwidth=$pp_pic_holder.width();projectedTop=(windowHeight/2)+scroll_pos['scrollTop']-(contentHeight/2);if(projectedTop<0)projectedTop=0;if(contentHeight>windowHeight)
return;$pp_pic_holder.css({'top':projectedTop,'left':(windowWidth/2)+scroll_pos['scrollLeft']-(contentwidth/2)});};};function _get_scroll(){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 _resize_overlay(){windowHeight=$(window).height(),windowWidth=$(window).width();if(typeof $pp_overlay!="undefined")$pp_overlay.height($(document).height()).width(windowWidth);};function _insert_gallery(){if(isSet&&settings.overlay_gallery&&_getFileType(pp_images[set_position])=="image"&&(settings.ie6_fallback&&!($.browser.msie&&parseInt($.browser.version)==6))){itemWidth=52+5;navWidth=(settings.theme=="facebook"||settings.theme=="pp_default")?50:30;itemsPerPage=Math.floor((pp_dimensions['containerWidth']-100-navWidth)/itemWidth);itemsPerPage=(itemsPerPage<pp_images.length)?itemsPerPage:pp_images.length;totalPage=Math.ceil(pp_images.length/itemsPerPage)-1;if(totalPage==0){navWidth=0;$pp_gallery.find('.pp_arrow_next,.pp_arrow_previous').hide();}else{$pp_gallery.find('.pp_arrow_next,.pp_arrow_previous').show();};galleryWidth=itemsPerPage*itemWidth;fullGalleryWidth=pp_images.length*itemWidth;$pp_gallery.css('margin-left',-((galleryWidth/2)+(navWidth/2))).find('div:first').width(galleryWidth+5).find('ul').width(fullGalleryWidth).find('li.selected').removeClass('selected');goToPage=(Math.floor(set_position/itemsPerPage)<totalPage)?Math.floor(set_position/itemsPerPage):totalPage;$.prettyPhoto.changeGalleryPage(goToPage);$pp_gallery_li.filter(':eq('+set_position+')').addClass('selected');}else{$pp_pic_holder.find('.pp_content').unbind('mouseenter mouseleave');}}
function _build_overlay(caller){if(settings.social_tools)
facebook_like_link=settings.social_tools.replace('{location_href}',encodeURIComponent(location.href));settings.markup=settings.markup.replace('{pp_social}',(settings.social_tools)?facebook_like_link:'');$('body').append(settings.markup);$pp_pic_holder=$('.pp_pic_holder'),$ppt=$('.ppt'),$pp_overlay=$('div.pp_overlay');if(isSet&&settings.overlay_gallery){currentGalleryPage=0;toInject="";for(var i=0;i<pp_images.length;i++){if(!pp_images[i].match(/\b(jpg|jpeg|png|gif)\b/gi)){classname='default';img_src='';}else{classname='';img_src=pp_images[i];}
toInject+="<li class='"+classname+"'><a href='#'><img src='"+img_src+"' width='50' alt='' /></a></li>";};toInject=settings.gallery_markup.replace(/{gallery}/g,toInject);$pp_pic_holder.find('#pp_full_res').after(toInject);$pp_gallery=$('.pp_pic_holder .pp_gallery'),$pp_gallery_li=$pp_gallery.find('li');$pp_gallery.find('.pp_arrow_next').click(function(){$.prettyPhoto.changeGalleryPage('next');$.prettyPhoto.stopSlideshow();return false;});$pp_gallery.find('.pp_arrow_previous').click(function(){$.prettyPhoto.changeGalleryPage('previous');$.prettyPhoto.stopSlideshow();return false;});$pp_pic_holder.find('.pp_content').hover(function(){$pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeIn();},function(){$pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeOut();});itemWidth=52+5;$pp_gallery_li.each(function(i){$(this).find('a').click(function(){$.prettyPhoto.changePage(i);$.prettyPhoto.stopSlideshow();return false;});});};if(settings.slideshow){$pp_pic_holder.find('.pp_nav').prepend('<a href="#" class="pp_play">Play</a>')
$pp_pic_holder.find('.pp_nav .pp_play').click(function(){$.prettyPhoto.startSlideshow();return false;});}
$pp_pic_holder.attr('class','pp_pic_holder '+settings.theme);$pp_overlay.css({'opacity':0,'height':$(document).height(),'width':$(window).width()}).bind('click',function(){if(!settings.modal)$.prettyPhoto.close();});$('a.pp_close').bind('click',function(){$.prettyPhoto.close();return false;});$('a.pp_expand').bind('click',function(e){if($(this).hasClass('pp_expand')){$(this).removeClass('pp_expand').addClass('pp_contract');doresize=false;}else{$(this).removeClass('pp_contract').addClass('pp_expand');doresize=true;};_hideContent(function(){$.prettyPhoto.open();});return false;});$pp_pic_holder.find('.pp_previous, .pp_nav .pp_arrow_previous').bind('click',function(){$.prettyPhoto.changePage('previous');$.prettyPhoto.stopSlideshow();return false;});$pp_pic_holder.find('.pp_next, .pp_nav .pp_arrow_next').bind('click',function(){$.prettyPhoto.changePage('next');$.prettyPhoto.stopSlideshow();return false;});_center_overlay();};if(!pp_alreadyInitialized&&getHashtag()){pp_alreadyInitialized=true;hashIndex=getHashtag();hashRel=hashIndex;hashIndex=hashIndex.substring(hashIndex.indexOf('/')+1,hashIndex.length-1);hashRel=hashRel.substring(0,hashRel.indexOf('/'));setTimeout(function(){$("a[rel^='"+hashRel+"']:eq("+hashIndex+")").trigger('click');},50);}
return this.unbind('click.prettyphoto').bind('click.prettyphoto',$.prettyPhoto.initialize);};function getHashtag(){url=location.href;hashtag=(url.indexOf('#!')!=-1)?decodeURI(url.substring(url.indexOf('#!')+2,url.length)):false;return hashtag;};function setHashtag(){if(typeof theRel=='undefined')return;location.hash='!'+theRel+'/'+rel_index+'/';};function clearHashtag(){url=location.href;hashtag=(url.indexOf('#!prettyPhoto'))?true:false;if(hashtag)location.hash="!prettyPhoto";}
function getParam(name,url){name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(url);return(results==null)?"":results[1];}})(jQuery);var pp_alreadyInitialized=false;

/*
 * 	Easy Slider 1.8 - jQuery plugin
 *	written by Alen Grakalic (modified by Kyle Florence - kyle.florence@gmail.com)
 *	http://cssglobe.com/post/4004/easy-slider-15-the-easiest-jquery-plugin-for-sliding
 *
 *	Copyright (c) 2009 Alen Grakalic (http://cssglobe.com)
 *	Dual licensed under the MIT (MIT-LICENSE.txt)
 *	and GPL (GPL-LICENSE.txt) licenses.
 *
 *	Built for jQuery library
 *	http://jquery.com
 *
 */

/*
 *	markup example for $("#slider").easySlider();
 *
 * 	<div id="slider">
 *		<ul>
 *			<li><img src="images/01.jpg" alt="" /></li>
 *			<li><img src="images/02.jpg" alt="" /></li>
 *			<li><img src="images/03.jpg" alt="" /></li>
 *			<li><img src="images/04.jpg" alt="" /></li>
 *			<li><img src="images/05.jpg" alt="" /></li>
 *		</ul>
 *	</div>
 *
 */

(function($)
{
    $.fn.easySlider = function(options)
    {
        // default configuration properties
        var defaults = {
            prevId:         'prevBtn',
            prevText:       'Previous',
			prevImg:		'easySlider_buttons_prevBtn.png',
            nextId:         'nextBtn',
            nextText:       'Next',
			nextImg:		'easySlider_buttons_nextBtn.png',
			pauseId:         'pauseBtn',
            pauseText:       'Pause',
			pauseImg:		'easySlider_buttons_pauseBtn.png',
			resumeImg:		'easySlider_buttons_pauseBtn_r.png',
            controlsShow:   true,
            controlsBefore: '',
            controlsAfter:  '',
            controlsFade:   true,
            insertAfter:    false,
            firstId:        'firstBtn',
            firstText:      'First',
            firstShow:      false,
            lastId:         'lastBtn',
            lastText:       'Last',
            lastShow:       false,
            vertical:       false,
            speed:          800,
            ease:           'swing',
            auto:           false,
            pause:          2000,
            continuous:     false,
            prevNext:       true,
            numeric:        false,
            numericId:      'controls'
			
        };

        var options = $.extend(defaults, options);

        this.each(function()
        {
            var obj = $(this);

            // Fix for nested list items
            var ul = obj.children("ul");
            var li = ul.children("li");

            var s = li.length;
            var w = obj.width();
            var h = obj.height();

            var t = 0;
            var ts = s-1;
            var clickable = true;

            // Set obj overflow to hidden
            obj.css("overflow","hidden");

            // Set width/height of list items based on width/height of obj
            li.each(function() {
               if(options.vertical) $(this).height(h);
                else $(this).width(w);
            });

            // Float items to the left
            li.css('float', 'left');

            // Set width/height of ul
            if(options.vertical) ul.height(s*w);
            else ul.width(s*h);

            // Clone elements for continuous scrolling
            if(options.continuous)
            {
                if(options.vertical)
                {
                    ul.prepend(li.filter(":last-child").clone().css("margin-top","-"+ h +"px"));
                    ul.append(li.filter(":nth-child(2)").clone());
                    ul.height((s+1)*h);
                } else {
                    ul.prepend(li.filter(":last-child").clone().css("margin-left","-"+ w +"px"));
                    ul.append(li.filter(":nth-child(2)").clone());
                    ul.width((s+1)*w);
                }
            };

            if(options.controlsShow)
            {
                var html = options.controlsBefore;
                if(options.numeric){
                    html += '<ol id="'+ options.numericId +'"></ol>';
                }
                if(options.firstShow) {
                    html += '<span id="'+ options.firstId +'"><a href="#">'+ options.firstText +'</a></span>';
                }
                if(options.prevNext){
                    html += '<span id="'+ options.prevId +'"><a href="#"><img src="http://www.longwood.edu/assets/'+ options.prevImg +'" border=0/></a></span>';
					html += '<span id="'+ options.pauseId +'"><a href="#"><img src="http://www.longwood.edu/assets/'+ options.pauseImg +'" border=0/></a></span>';
                    html += '<span id="'+ options.nextId +'"><a href="#"><img src="http://www.longwood.edu/assets/'+ options.nextImg +'" border=0/></a></span>';
                }
                if(options.lastShow) {
                    html += '<span id="'+ options.lastId +'"><a href="#">'+ options.lastText +'</a></span>';
                }
                html += options.controlsAfter;

                if (options.insertAfter) $(obj).after(html);
                else $(obj).before(html);
            };

            if(options.numeric)
            {
                for(var i=0;i<s;i++)
                {
                    $(document.createElement("li"))
                        .attr('id',options.numericId + (i+1))
                        //.html('<a rel="'+ i +'" href="#"><span>'+ (i+1) +'</span></a>')
						.html('<a rel="'+ i +'" href="#"><img width="60px" height="60px" src="images/slider/'+(i+1)+'-thumb.png" /></a>')
                        .appendTo($("#"+ options.numericId))
                        .click(function(){
                            animate($("a",$(this)).attr('rel'),true);
                            return false;
                        });
                };
                
            }

            if(options.prevNext)
            {
                $("a","#"+options.pauseId).toggle(function(){
					var resumeImg = options.resumeImg;
					$(this).html("<img src='http://www.longwood.edu/assets/"+resumeImg+"' border=0/>");
					clearTimeout(timeout); 
					return false;
				},
				function(){
					var pauseImg = options.pauseImg;
					$(this).html("<img src='http://www.longwood.edu/assets/"+pauseImg+"' border=0/>");
					animate("next",false);
					return false;
				});
				
				$("a","#"+options.nextId).click(function(){
                    animate("next",true); return false;
                });
                $("a","#"+options.prevId).click(function(){
                    animate("prev",true); return false;
                });
                $("a","#"+options.firstId).click(function(){
                    animate("first",true); return false;
                });
                $("a","#"+options.lastId).click(function(){
                    animate("last",true); return false;
                });
				
            };

            function setCurrent(i)
            {
                i = parseInt(i)+1;
                $("li", "#" + options.numericId).removeClass("current");
                $("li#" + options.numericId + i).addClass("current");
            };

            function adjust()
            {
                if(t>ts) t=0;
                if(t<0) t=ts;
                if(!options.vertical) {
                    ul.css("margin-left",(t*w*-1));
                } else {
                    ul.css("margin-top",(t*h*-1));
                }
                clickable = true;
                if(options.numeric) setCurrent(t);
            };

            function animate(dir,clicked)
            {
                if (clickable)
                {
                    clickable = false;
                    var ot = t;
                    switch(dir)
                    {
                        case "next":
                            t = (ot>=ts) ? (options.continuous ? t+1 : ts) : t+1;
                            break;
                        case "prev":
                            t = (t<=0) ? (options.continuous ? t-1 : 0) : t-1;
                            break;
                        case "first":
                            t = 0;
                            break;
                        case "last":
                            t = ts;
                            break;
                        default:
                            t = parseInt(dir);
                            break;
                    };

                    var diff = Math.abs(ot-t);
                    var speed = diff*options.speed;
                    if(!options.vertical) {
                        p = (t*w*-1);
                        ul.animate(
                            { marginLeft: p },
                            {
                                queue:false,
                                duration:speed,
                                easing:options.ease,
                                complete:adjust
                            }
                        );
                    } else {
                        p = (t*h*-1);
                        ul.animate(
                            { marginTop: p },
                            {
                                queue:false,
                                duration:speed,
                                easing:options.ease,
                                complete:adjust
                            }
                        );
                    };

                    if(!options.continuous && options.controlsFade)
                    {
                        if(t==0){
                            $("a","#"+options.prevId).fadeOut('slow');
                            $("a","#"+options.firstId).fadeOut('slow');
                        } else if(t==ts){
                            $("a","#"+options.nextId).fadeOut('slow');
                            $("a","#"+options.lastId).fadeOut('slow');
                        } else {
                            $("a","#"+options.prevId).fadeIn('slow');
                            $("a","#"+options.firstId).fadeIn('slow');
                            $("a","#"+options.nextId).fadeIn('slow');
                            $("a","#"+options.lastId).fadeIn('slow');
                        };
                    };

                    if(clicked) clearTimeout(timeout);
                    if(options.auto && dir=="next" && !clicked){;
                        timeout = setTimeout(function(){
                            animate("next",false);
                        },diff*options.speed+options.pause);
                    };

                };
            };
            // init
            var timeout;
            if(options.auto){;
                timeout = setTimeout(function(){
                    animate("next",false);
                },options.pause);
            };

            if(options.numeric) setCurrent(0);

            if(!options.continuous && options.controlsFade){
                $("a","#"+options.prevId).hide();
                $("a","#"+options.firstId).hide();
            };

        });

    };
})(jQuery);

$(document).ready(function(){
	
$('.noscript').remove();

$('.nivoSlider').show();

$('<div style="clear:both"></div>').insertAfter('#rotatingArea');
$('.styledevents li').each(function () {
	var oldHTML = $(this).html();
	var newHTML = oldHTML.replace("[", "<span class='date'>").replace("]", "</span>");
	$(this).html(newHTML);
});
$('.styledevents span.date').each(function () {
    $(this).parent().parent().prepend(this);
	var oldHtml = $(this).html();
	var finalHtml = oldHtml.replace(" - ", "<br />-<br />");
	$(this).html(finalHtml);
	var new_height = $(this).next('a').height();
	$(this).css('height', new_height);
});

$('<div style="clear:both"></div>').insertAfter('#rotatingArea'); 

$('.rotatingArea_content').easySlider({

        prevText:'Prev',

        nextText:'Next',

        auto: true,

        continuous: true,

        pause: 6000,

        speed: 200,

        controlsBefore: '<div id="easySlider_controls">',

        controlsAfter:  '<\/div>'

        });
});(jQuery);
