// FROM: http://v2.lettingsearch.co.uk/javascript/jquery.selectBox.min.js


if(jQuery)(function(a){a.extend(a.fn,{selectBox:function(b,c){var d,e="";var f=function(b,c){if(navigator.userAgent.match(/iPad|iPhone/i))return false;if(b.tagName.toLowerCase()!=="select")return false;b=a(b);if(b.data("selectBox-control"))return false;var d=a('<a class="selectBox" />'),e=b.attr("multiple")||parseInt(b.attr("size"))>1;var f=c||{};d.addClass(b.attr("class")).attr("style",b.attr("style")||"").attr("title",b.attr("title")||"").attr("tabindex",parseInt(b.attr("tabindex"))).css("display","inline-block").bind("focus.selectBox",function(){if(this!==document.activeElement)a(document.activeElement).blur();if(d.hasClass("selectBox-active"))return;d.addClass("selectBox-active");b.trigger("focus")}).bind("blur.selectBox",function(){if(!d.hasClass("selectBox-active"))return;d.removeClass("selectBox-active");b.trigger("blur")});if(b.attr("disabled"))d.addClass("selectBox-disabled");if(e){var h=g(b,"inline");d.append(h).data("selectBox-options",h).addClass("selectBox-inline").addClass("selectBox-menuShowing").bind("keydown.selectBox",function(a){o(b,a)}).bind("keypress.selectBox",function(a){p(b,a)}).bind("mousedown.selectBox",function(b){if(a(b.target).is("A.selectBox-inline"))b.preventDefault();if(!d.hasClass("selectBox-focus"))d.focus()}).insertAfter(b);if(!b[0].style.height){var k=b.attr("size")?parseInt(b.attr("size")):5;var l=d.clone().removeAttr("id").css({position:"absolute",top:"-9999em"}).show().appendTo("body");l.find(".selectBox-options").html("<li><a> </a></li>");optionHeight=parseInt(l.find(".selectBox-options A:first").html(" ").outerHeight());l.remove();d.height(optionHeight*k)}u(d)}else{var m=a('<span class="selectBox-label" />'),n=a('<span class="selectBox-arrow" />');m.text(a(b).find("OPTION:selected").text()||" ");var h=g(b,"dropdown");h.appendTo("BODY");d.data("selectBox-options",h).addClass("selectBox-dropdown").append(m).append(n).bind("mousedown.selectBox",function(a){if(d.hasClass("selectBox-menuShowing")){j()}else{a.stopPropagation();h.data("selectBox-down-at-x",a.screenX).data("selectBox-down-at-y",a.screenY);i(b)}}).bind("keydown.selectBox",function(a){o(b,a)}).bind("keypress.selectBox",function(a){p(b,a)}).insertAfter(b);u(d)}b.addClass("selectBox").data("selectBox-control",d).data("selectBox-settings",f).hide()};var g=function(b,c){var d;switch(c){case"inline":d=a('<ul class="selectBox-options" />');if(b.find("OPTGROUP").length){b.find("OPTGROUP").each(function(){var b=a('<li class="selectBox-optgroup" />');b.text(a(this).attr("label"));d.append(b);a(this).find("OPTION").each(function(){var b=a("<li />"),c=a("<a />");b.addClass(a(this).attr("class"));c.attr("rel",a(this).val()).text(a(this).text());b.append(c);if(a(this).attr("disabled"))b.addClass("selectBox-disabled");if(a(this).attr("selected"))b.addClass("selectBox-selected");d.append(b)})})}else{b.find("OPTION").each(function(){var b=a("<li />"),c=a("<a />");b.addClass(a(this).attr("class"));c.attr("rel",a(this).val()).text(a(this).text());b.append(c);if(a(this).attr("disabled"))b.addClass("selectBox-disabled");if(a(this).attr("selected"))b.addClass("selectBox-selected");d.append(b)})}d.find("A").bind("mouseover.selectBox",function(c){l(b,a(this).parent())}).bind("mouseout.selectBox",function(c){m(b,a(this).parent())}).bind("mousedown.selectBox",function(a){a.preventDefault();if(!b.selectBox("control").hasClass("selectBox-active"))b.selectBox("control").focus()}).bind("mouseup.selectBox",function(c){j();k(b,a(this).parent(),c)});u(d);return d;case"dropdown":d=a('<ul class="selectBox-dropdown-menu selectBox-options" />');if(b.find("OPTGROUP").length){b.find("OPTGROUP").each(function(){var b=a('<li class="selectBox-optgroup" />');b.text(a(this).attr("label"));d.append(b);a(this).find("OPTION").each(function(){var b=a("<li />"),c=a("<a />");b.addClass(a(this).attr("class"));c.attr("rel",a(this).val()).text(a(this).text());b.append(c);if(a(this).attr("disabled"))b.addClass("selectBox-disabled");if(a(this).attr("selected"))b.addClass("selectBox-selected");d.append(b)})})}else{if(b.find("OPTION").length>0){b.find("OPTION").each(function(){var b=a("<li />"),c=a("<a />");b.addClass(a(this).attr("class"));c.attr("rel",a(this).val()).text(a(this).text());b.append(c);if(a(this).attr("disabled"))b.addClass("selectBox-disabled");if(a(this).attr("selected"))b.addClass("selectBox-selected");d.append(b)})}else{d.append("<li> </li>")}}d.data("selectBox-select",b).css("display","none").appendTo("BODY").find("A").bind("mousedown.selectBox",function(a){a.preventDefault();if(a.screenX===d.data("selectBox-down-at-x")&&a.screenY===d.data("selectBox-down-at-y")){d.removeData("selectBox-down-at-x").removeData("selectBox-down-at-y");j()}}).bind("mouseup.selectBox",function(c){if(c.screenX===d.data("selectBox-down-at-x")&&c.screenY===d.data("selectBox-down-at-y")){return}else{d.removeData("selectBox-down-at-x").removeData("selectBox-down-at-y")}k(b,a(this).parent());j()}).bind("mouseover.selectBox",function(c){l(b,a(this).parent())}).bind("mouseout.selectBox",function(c){m(b,a(this).parent())});u(d);return d}};var h=function(b){b=a(b);var c=b.data("selectBox-control");if(!c)return;var d=c.data("selectBox-options");d.remove();c.remove();b.removeClass("selectBox").removeData("selectBox-control").removeData("selectBox-settings").show()};var i=function(b){b=a(b);var c=b.data("selectBox-control"),d=b.data("selectBox-settings"),e=c.data("selectBox-options");if(c.hasClass("selectBox-disabled"))return false;j();e.css({width:c.outerWidth()-(parseInt(c.css("borderLeftWidth"))+parseInt(c.css("borderLeftWidth"))),top:c.offset().top+c.outerHeight()-parseInt(c.css("borderBottomWidth")),left:c.offset().left});switch(d.menuTransition){case"fade":e.fadeIn(d.menuSpeed);break;case"slide":e.slideDown(d.menuSpeed);break;default:e.show(d.menuSpeed);break}var f=e.find(".selectBox-selected:first");n(b,f,true);l(b,f);c.addClass("selectBox-menuShowing");a(document).bind("mousedown.selectBox",function(b){if(a(b.target).parents().andSelf().hasClass("selectBox-options"))return;j()})};var j=function(){if(a(".selectBox-dropdown-menu").length===0)return;a(document).unbind("mousedown.selectBox");a(".selectBox-dropdown-menu").each(function(){var b=a(this),c=b.data("selectBox-select"),d=c.data("selectBox-control"),e=c.data("selectBox-settings");switch(e.menuTransition){case"fade":b.fadeOut(e.menuSpeed);break;case"slide":b.slideUp(e.menuSpeed);break;default:b.hide(e.menuSpeed);break}d.removeClass("selectBox-menuShowing")})};var k=function(b,c,d){b=a(b);c=a(c);var e=b.data("selectBox-control"),f=b.data("selectBox-settings");if(e.hasClass("selectBox-disabled"))return false;if(c.length===0||c.hasClass("selectBox-disabled"))return false;if(b.attr("multiple")){if(d.shiftKey&&e.data("selectBox-last-selected")){c.toggleClass("selectBox-selected");var g;if(c.index()>e.data("selectBox-last-selected").index()){g=c.siblings().slice(e.data("selectBox-last-selected").index(),c.index())}else{g=c.siblings().slice(c.index(),e.data("selectBox-last-selected").index())}g=g.not(".selectBox-optgroup, .selectBox-disabled");if(c.hasClass("selectBox-selected")){g.addClass("selectBox-selected")}else{g.removeClass("selectBox-selected")}}else if(d.metaKey){c.toggleClass("selectBox-selected")}else{c.siblings().removeClass("selectBox-selected");c.addClass("selectBox-selected")}}else{c.siblings().removeClass("selectBox-selected");c.addClass("selectBox-selected")}if(e.hasClass("selectBox-dropdown")){e.find(".selectBox-label").text(c.text())}var h=0,i=[];if(b.attr("multiple")){e.find(".selectBox-selected A").each(function(){i[h++]=a(this).attr("rel")})}else{i=c.find("A").attr("rel")}e.data("selectBox-last-selected",c);if(b.val()!==i){b.val(i);b.trigger("change")}return true};var l=function(b,c){b=a(b);c=a(c);var d=b.data("selectBox-control"),e=d.data("selectBox-options");e.find(".selectBox-hover").removeClass("selectBox-hover");c.addClass("selectBox-hover")};var m=function(b,c){b=a(b);c=a(c);var d=b.data("selectBox-control"),e=d.data("selectBox-options");e.find(".selectBox-hover").removeClass("selectBox-hover")};var n=function(b,c,d){if(!c||c.length===0)return;b=a(b);var e=b.data("selectBox-control"),f=e.data("selectBox-options"),g=e.hasClass("selectBox-dropdown")?f:f.parent(),h=parseInt(c.offset().top-g.position().top),i=parseInt(h+c.outerHeight());if(d){g.scrollTop(c.offset().top-g.offset().top+g.scrollTop()-g.height()/2)}else{if(h<0){g.scrollTop(c.offset().top-g.offset().top+g.scrollTop())}if(i>g.height()){g.scrollTop(c.offset().top+c.outerHeight()-g.offset().top+g.scrollTop()-g.height())}}};var o=function(b,c){b=a(b);var d=b.data("selectBox-control"),f=d.data("selectBox-options"),g=0,h=0;if(d.hasClass("selectBox-disabled"))return;switch(c.keyCode){case 8:c.preventDefault();e="";break;case 9:case 27:j();m(b);break;case 13:if(d.hasClass("selectBox-menuShowing")){k(b,f.find("LI.selectBox-hover:first"),c);if(d.hasClass("selectBox-dropdown"))j()}else{i(b)}break;case 38:case 37:c.preventDefault();if(d.hasClass("selectBox-menuShowing")){var o=f.find(".selectBox-hover").prev("LI");g=f.find("LI:not(.selectBox-optgroup)").length;h=0;while(o.length===0||o.hasClass("selectBox-disabled")||o.hasClass("selectBox-optgroup")){o=o.prev("LI");if(o.length===0)o=f.find("LI:last");if(++h>=g)break}l(b,o);n(b,o)}else{i(b)}break;case 40:case 39:c.preventDefault();if(d.hasClass("selectBox-menuShowing")){var p=f.find(".selectBox-hover").next("LI");g=f.find("LI:not(.selectBox-optgroup)").length;h=0;while(p.length===0||p.hasClass("selectBox-disabled")||p.hasClass("selectBox-optgroup")){p=p.next("LI");if(p.length===0)p=f.find("LI:first");if(++h>=g)break}l(b,p);n(b,p)}else{i(b)}break}};var p=function(b,c){b=a(b);var f=b.data("selectBox-control"),g=f.data("selectBox-options");if(f.hasClass("selectBox-disabled"))return;switch(c.keyCode){case 9:case 27:case 13:case 38:case 37:case 40:case 39:break;default:if(!f.hasClass("selectBox-menuShowing"))i(b);c.preventDefault();clearTimeout(d);e+=String.fromCharCode(c.charCode||c.keyCode);g.find("A").each(function(){if(a(this).text().substr(0,e.length).toLowerCase()===e.toLowerCase()){l(b,a(this).parent());n(b,a(this).parent());return false}});d=setTimeout(function(){e=""},1e3);break}};var q=function(b){b=a(b);b.attr("disabled",false);var c=b.data("selectBox-control");if(!c)return;c.removeClass("selectBox-disabled")};var r=function(b){b=a(b);b.attr("disabled",true);var c=b.data("selectBox-control");if(!c)return;c.addClass("selectBox-disabled")};var s=function(b,c){b=a(b);b.val(c);c=b.val();var d=b.data("selectBox-control");if(!d)return;var e=b.data("selectBox-settings"),f=d.data("selectBox-options");d.find(".selectBox-label").text(a(b).find("OPTION:selected").text()||" ");f.find(".selectBox-selected").removeClass("selectBox-selected");f.find("A").each(function(){if(typeof c==="object"){for(var b=0;b<c.length;b++){if(a(this).attr("rel")==c[b]){a(this).parent().addClass("selectBox-selected")}}}else{if(a(this).attr("rel")==c){a(this).parent().addClass("selectBox-selected")}}});if(e.change)e.change.call(b)};var t=function(b,d){b=a(b);var e=b.data("selectBox-control"),f=b.data("selectBox-settings");switch(typeof c){case"string":b.html(c);break;case"object":b.html("");for(var h in c){if(c[h]===null)continue;if(typeof c[h]==="object"){var i=a('<optgroup label="'+h+'" />');for(var j in c[h]){i.append('<option value="'+j+'">'+c[h][j]+"</option>")}b.append(i)}else{var k=a('<option value="'+h+'">'+c[h]+"</option>");b.append(k)}}break}if(!e)return;e.data("selectBox-options").remove();var l=e.hasClass("selectBox-dropdown")?"dropdown":"inline",d=g(b,l);e.data("selectBox-options",d);switch(l){case"inline":e.append(d);break;case"dropdown":e.find(".selectBox-label").text(a(b).find("OPTION:selected").text()||" ");a("BODY").append(d);break}};var u=function(b){a(b).css("MozUserSelect","none").bind("selectstart",function(a){a.preventDefault()})};switch(b){case"control":return a(this).data("selectBox-control");break;case"settings":if(!c)return a(this).data("selectBox-settings");a(this).each(function(){a(this).data("selectBox-settings",a.extend(true,a(this).data("selectBox-settings"),c))});break;case"options":a(this).each(function(){t(this,c)});break;case"value":if(!c)return a(this).val();a(this).each(function(){s(this,c)});break;case"enable":a(this).each(function(){q(this)});break;case"disable":a(this).each(function(){r(this)});break;case"destroy":a(this).each(function(){h(this)});break;default:a(this).each(function(){f(this,b)});break}return a(this)}})})(jQuery);


// FROM: http://v2.lettingsearch.co.uk/javascript/jquery.watermarkinput.js


/*
 * Copyright (c) 2007 Josh Bush (digitalbush.com)
 * 
 * Permission is hereby granted, free of charge, to any person
 * obtaining a copy of this software and associated documentation
 * files (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use,
 * copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following
 * conditions:

 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE. 
 */
 
/*
 * Version: Beta 1
 * Release: 2007-06-01
 */ 
(function($) {
	var map=new Array();
	$.Watermark = {
		ShowAll:function(){
			for (var i=0;i<map.length;i++){
				if(map[i].obj.val()==""){
					map[i].obj.val(map[i].text);					
					map[i].obj.css("color",map[i].WatermarkColor);
				}else{
				    map[i].obj.css("color",map[i].DefaultColor);
				}
			}
		},
		HideAll:function(){
			for (var i=0;i<map.length;i++){
				if(map[i].obj.val()==map[i].text)
					map[i].obj.val("");					
			}
		}
	}
	
	$.fn.Watermark = function(text,color) {
		if(!color)
			color="#aaa";
		return this.each(
			function(){		
				var input=$(this);
				var defaultColor=input.css("color");
				map[map.length]={text:text,obj:input,DefaultColor:defaultColor,WatermarkColor:color};
				function clearMessage(){
					if(input.val()==text)
						input.val("");
					input.css("color",defaultColor);
				}

				function insertMessage(){
					if(input.val().length==0 || input.val()==text){
						input.val(text);
						input.css("color",color);	
					}else
						input.css("color",defaultColor);				
				}

				input.focus(clearMessage);
				input.blur(insertMessage);								
				input.change(insertMessage);
				
				insertMessage();
			}
		);
	};
})(jQuery);


// FROM: http://v2.lettingsearch.co.uk/javascript/jquery.colorbox-min.js


// ColorBox v1.3.17.2 - a full featured, light-weight, customizable lightbox based on jQuery 1.3+
// Copyright (c) 2011 Jack Moore - jack@colorpowered.com
// Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
(function(a,b,c){function bc(b){if(!U){P=b,_(),y=a(P),Q=0,K.rel!=="nofollow"&&(y=a("."+g).filter(function(){var b=a.data(this,e).rel||this.rel;return b===K.rel}),Q=y.index(P),Q===-1&&(y=y.add(P),Q=y.length-1));if(!S){S=T=!0,r.show();if(K.returnFocus)try{P.blur(),a(P).one(l,function(){try{this.focus()}catch(a){}})}catch(c){}q.css({opacity:+K.opacity,cursor:K.overlayClose?"pointer":"auto"}).show(),K.w=Z(K.initialWidth,"x"),K.h=Z(K.initialHeight,"y"),X.position(),o&&z.bind("resize."+p+" scroll."+p,function(){q.css({width:z.width(),height:z.height(),top:z.scrollTop(),left:z.scrollLeft()})}).trigger("resize."+p),ba(h,K.onOpen),J.add(D).hide(),I.html(K.close).show()}X.load(!0)}}function bb(){var a,b=f+"Slideshow_",c="click."+f,d,e,g;K.slideshow&&y[1]?(d=function(){F.text(K.slideshowStop).unbind(c).bind(j,function(){if(Q<y.length-1||K.loop)a=setTimeout(X.next,K.slideshowSpeed)}).bind(i,function(){clearTimeout(a)}).one(c+" "+k,e),r.removeClass(b+"off").addClass(b+"on"),a=setTimeout(X.next,K.slideshowSpeed)},e=function(){clearTimeout(a),F.text(K.slideshowStart).unbind([j,i,k,c].join(" ")).one(c,d),r.removeClass(b+"on").addClass(b+"off")},K.slideshowAuto?d():e()):r.removeClass(b+"off "+b+"on")}function ba(b,c){c&&c.call(P),a.event.trigger(b)}function _(b){K=a.extend({},a.data(P,e));for(b in K)a.isFunction(K[b])&&b.substring(0,2)!=="on"&&(K[b]=K[b].call(P));K.rel=K.rel||P.rel||"nofollow",K.href=K.href||a(P).attr("href"),K.title=K.title||P.title,typeof K.href=="string"&&(K.href=a.trim(K.href))}function $(a){return K.photo||/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i.test(a)}function Z(a,b){return Math.round((/%/.test(a)?(b==="x"?z.width():z.height())/100:1)*parseInt(a,10))}function Y(c,d,e){e=b.createElement("div"),c&&(e.id=f+c),e.style.cssText=d||"";return a(e)}var d={transition:"elastic",speed:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,inline:!1,html:!1,iframe:!1,fastIframe:!0,photo:!1,href:!1,title:!1,rel:!1,opacity:.9,preloading:!0,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:!1,returnFocus:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:!1},e="colorbox",f="cbox",g=f+"Element",h=f+"_open",i=f+"_load",j=f+"_complete",k=f+"_cleanup",l=f+"_closed",m=f+"_purge",n=a.browser.msie&&!a.support.opacity,o=n&&a.browser.version<7,p=f+"_IE6",q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X;X=a.fn[e]=a[e]=function(b,c){var f=this;b=b||{};if(!f[0]){if(f.selector)return f;f=a("<a/>"),b.open=!0}c&&(b.onComplete=c),f.each(function(){a.data(this,e,a.extend({},a.data(this,e)||d,b)),a(this).addClass(g)}),(a.isFunction(b.open)&&b.open.call(f)||b.open)&&bc(f[0]);return f},X.init=function(){z=a(c),r=Y().attr({id:e,"class":n?f+(o?"IE6":"IE"):""}),q=Y("Overlay",o?"position:absolute":"").hide(),s=Y("Wrapper"),t=Y("Content").append(A=Y("LoadedContent","width:0; height:0; overflow:hidden"),C=Y("LoadingOverlay").add(Y("LoadingGraphic")),D=Y("Title"),E=Y("Current"),G=Y("Next"),H=Y("Previous"),F=Y("Slideshow").bind(h,bb),I=Y("Close")),s.append(Y().append(Y("TopLeft"),u=Y("TopCenter"),Y("TopRight")),Y(!1,"clear:left").append(v=Y("MiddleLeft"),t,w=Y("MiddleRight")),Y(!1,"clear:left").append(Y("BottomLeft"),x=Y("BottomCenter"),Y("BottomRight"))).children().children().css({"float":"left"}),B=Y(!1,"position:absolute; width:9999px; visibility:hidden; display:none"),a("body").prepend(q,r.append(s,B)),t.children().hover(function(){a(this).addClass("hover")},function(){a(this).removeClass("hover")}).addClass("hover"),L=u.height()+x.height()+t.outerHeight(!0)-t.height(),M=v.width()+w.width()+t.outerWidth(!0)-t.width(),N=A.outerHeight(!0),O=A.outerWidth(!0),r.css({"padding-bottom":L,"padding-right":M}).hide(),G.click(function(){X.next()}),H.click(function(){X.prev()}),I.click(function(){X.close()}),J=G.add(H).add(E).add(F),t.children().removeClass("hover"),q.click(function(){K.overlayClose&&X.close()}),a(b).bind("keydown."+f,function(a){var b=a.keyCode;S&&K.escKey&&b===27&&(a.preventDefault(),X.close()),S&&K.arrowKey&&y[1]&&(b===37?(a.preventDefault(),H.click()):b===39&&(a.preventDefault(),G.click()))})},X.remove=function(){r.add(q).remove(),a("."+g).removeData(e).removeClass(g)},X.position=function(a,c){function g(a){u[0].style.width=x[0].style.width=t[0].style.width=a.style.width,C[0].style.height=C[1].style.height=t[0].style.height=v[0].style.height=w[0].style.height=a.style.height}var d=0,e=0;z.unbind("resize."+f),r.hide(),K.fixed&&!o?r.css({position:"fixed"}):(d=z.scrollTop(),e=z.scrollLeft(),r.css({position:"absolute"})),K.right!==!1?e+=Math.max(z.width()-K.w-O-M-Z(K.right,"x"),0):K.left!==!1?e+=Z(K.left,"x"):e+=Math.round(Math.max(z.width()-K.w-O-M,0)/2),K.bottom!==!1?d+=Math.max(b.documentElement.clientHeight-K.h-N-L-Z(K.bottom,"y"),0):K.top!==!1?d+=Z(K.top,"y"):d+=Math.round(Math.max(b.documentElement.clientHeight-K.h-N-L,0)/2),r.show(),a=r.width()===K.w+O&&r.height()===K.h+N?0:a||0,s[0].style.width=s[0].style.height="9999px",r.dequeue().animate({width:K.w+O,height:K.h+N,top:d,left:e},{duration:a,complete:function(){g(this),T=!1,s[0].style.width=K.w+O+M+"px",s[0].style.height=K.h+N+L+"px",c&&c(),setTimeout(function(){z.bind("resize."+f,X.position)},1)},step:function(){g(this)}})},X.resize=function(a){if(S){a=a||{},a.width&&(K.w=Z(a.width,"x")-O-M),a.innerWidth&&(K.w=Z(a.innerWidth,"x")),A.css({width:K.w}),a.height&&(K.h=Z(a.height,"y")-N-L),a.innerHeight&&(K.h=Z(a.innerHeight,"y"));if(!a.innerHeight&&!a.height){var b=A.wrapInner("<div style='overflow:auto'></div>").children();K.h=b.height(),b.replaceWith(b.children())}A.css({height:K.h}),X.position(K.transition==="none"?0:K.speed)}},X.prep=function(b){function h(){K.h=K.h||A.height(),K.h=K.mh&&K.mh<K.h?K.mh:K.h;return K.h}function g(){K.w=K.w||A.width(),K.w=K.mw&&K.mw<K.w?K.mw:K.w;return K.w}if(!!S){var c,d=K.transition==="none"?0:K.speed;A.remove(),A=Y("LoadedContent").append(b),A.hide().appendTo(B.show()).css({width:g(),overflow:K.scrolling?"auto":"hidden"}).css({height:h()}).prependTo(t),B.hide(),a(R).css({"float":"none"}),o&&a("select").not(r.find("select")).filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one(k,function(){this.style.visibility="inherit"}),c=function(){function o(){n&&r[0].style.removeAttribute("filter")}var b,c,g,h,i=y.length,k,l;!S||(l=function(){clearTimeout(W),C.hide(),ba(j,K.onComplete)},n&&R&&A.fadeIn(100),D.html(K.title).add(A).show(),i>1?(typeof K.current=="string"&&E.html(K.current.replace("{current}",Q+1).replace("{total}",i)).show(),G[K.loop||Q<i-1?"show":"hide"]().html(K.next),H[K.loop||Q?"show":"hide"]().html(K.previous),b=Q?y[Q-1]:y[i-1],g=Q<i-1?y[Q+1]:y[0],K.slideshow&&F.show(),K.preloading&&(h=a.data(g,e).href||g.href,c=a.data(b,e).href||b.href,h=a.isFunction(h)?h.call(g):h,c=a.isFunction(c)?c.call(b):c,$(h)&&(a("<img/>")[0].src=h),$(c)&&(a("<img/>")[0].src=c))):J.hide(),K.iframe?(k=a("<iframe/>").addClass(f+"Iframe")[0],K.fastIframe?l():a(k).one("load",l),k.name=f+ +(new Date),k.src=K.href,K.scrolling||(k.scrolling="no"),n&&(k.frameBorder=0,k.allowTransparency="true"),a(k).appendTo(A).one(m,function(){k.src="//about:blank"})):l(),K.transition==="fade"?r.fadeTo(d,1,o):o())},K.transition==="fade"?r.fadeTo(d,0,function(){X.position(0,c)}):X.position(d,c)}},X.load=function(b){var c,d,e=X.prep;T=!0,R=!1,P=y[Q],b||_(),ba(m),ba(i,K.onLoad),K.h=K.height?Z(K.height,"y")-N-L:K.innerHeight&&Z(K.innerHeight,"y"),K.w=K.width?Z(K.width,"x")-O-M:K.innerWidth&&Z(K.innerWidth,"x"),K.mw=K.w,K.mh=K.h,K.maxWidth&&(K.mw=Z(K.maxWidth,"x")-O-M,K.mw=K.w&&K.w<K.mw?K.w:K.mw),K.maxHeight&&(K.mh=Z(K.maxHeight,"y")-N-L,K.mh=K.h&&K.h<K.mh?K.h:K.mh),c=K.href,W=setTimeout(function(){C.show()},100),K.inline?(Y().hide().insertBefore(a(c)[0]).one(m,function(){a(this).replaceWith(A.children())}),e(a(c))):K.iframe?e(" "):K.html?e(K.html):$(c)?(a(R=new Image).addClass(f+"Photo").error(function(){K.title=!1,e(Y("Error").text("This image could not be loaded"))}).load(function(){var a;R.onload=null,K.scalePhotos&&(d=function(){R.height-=R.height*a,R.width-=R.width*a},K.mw&&R.width>K.mw&&(a=(R.width-K.mw)/R.width,d()),K.mh&&R.height>K.mh&&(a=(R.height-K.mh)/R.height,d())),K.h&&(R.style.marginTop=Math.max(K.h-R.height,0)/2+"px"),y[1]&&(Q<y.length-1||K.loop)&&(R.style.cursor="pointer",R.onclick=function(){X.next()}),n&&(R.style.msInterpolationMode="bicubic"),setTimeout(function(){e(R)},1)}),setTimeout(function(){R.src=c},1)):c&&B.load(c,K.data,function(b,c,d){e(c==="error"?Y("Error").text("Request unsuccessful: "+d.statusText):a(this).contents())})},X.next=function(){!T&&y[1]&&(Q<y.length-1||K.loop)&&(Q=Q<y.length-1?Q+1:0,X.load())},X.prev=function(){!T&&y[1]&&(Q||K.loop)&&(Q=Q?Q-1:y.length-1,X.load())},X.close=function(){S&&!U&&(U=!0,S=!1,ba(k,K.onCleanup),z.unbind("."+f+" ."+p),q.fadeTo(200,0),r.stop().fadeTo(300,0,function(){r.add(q).css({opacity:1,cursor:"auto"}).hide(),ba(m),A.remove(),setTimeout(function(){U=!1,ba(l,K.onClosed)},1)}))},X.element=function(){return a(P)},X.settings=d,V=function(a){a.button!==0&&typeof a.button!="undefined"||a.ctrlKey||a.shiftKey||a.altKey||(a.preventDefault(),bc(this))},a.fn.delegate?a(b).delegate("."+g,"click",V):a("."+g).live("click",V),a(X.init)})(jQuery,document,this);


// FROM: http://v2.lettingsearch.co.uk/javascript/jquery.aw-showcase.min.js


/*
 
	Awkward Showcase - jQuery plugin 
	http://www.jquery.com
	http://www.awkwardgroup.com/sandbox/awkward-showcase-a-jquery-plugin
	http://demo.awkwardgroup.com/showcase
	Version: 1.1.1

	Copyright (C) 2011 Awkward Group (http://www.awkwardgroup.com)
	Licensed under Attribution-ShareAlike 3.0 Unported
	http://creativecommons.org/licenses/by-sa/3.0/

	Markup example for jQuery("#showcase").awShowcase();
 
	<div id="showcase" class="showcase">
		<!-- Each child div in #showcase represents a slide -->
		<div class="showcase-slide">
			<!-- Put the slide content in a div with the class .showcase-content -->
			<div class="showcase-content">
				<!-- If the slide contains multiple elements you should wrap them in a div with the class .showcase-content-wrapper. 
				We usually wrap even if there is only one element, because it looks better. :-) -->
				<div class="showcase-content-wrapper">
					<img src="images/01.jpg" alt="01" />
				</div>
			</div>
			<!-- Put the caption content in a div with the class .showcase-caption -->
			<div class="showcase-caption">
				The Caption
			</div>
			<!-- Put the tooltips in a div with the class .showcase-tooltips. -->
			<div class="showcase-tooltips">
				<!-- Each anchor in .showcase-tooltips represents a tooltip. The coords attribute represents the position of the tooltip. -->
				<a href="http://www.awkward.se" coords="634,130">
					<!-- The content of the anchor-tag is displayed in the tooltip. -->
					This is a tooltip that displays the anchor html in a nice way.
				</a>
				<a href="http://www.awkward.se" coords="356, 172">
					<!-- You can add multiple elements to the anchor-tag which are display in the tooltip. -->
					<img src="images/glasses.png" />
					<span style="display: block; font-weight: bold; padding: 3px 0 3px 0; text-align: center;">
						White Glasses: 500$
					</span>
				</a>
			</div>
		</div>
		<div class="showcase-slide">
			<div class="showcase-content">
				<div class="showcase-content-wrapper">
					Content...
				</div>
			</div>
		</div>
	</div>

*/

(function(jQuery){jQuery.fn.awShowcase=function(options){var defaults={content_width:560,content_height:300,fit_to_parent:false,auto:false,interval:3000,continuous:false,loading:true,tooltip_width:200,tooltip_icon_width:32,tooltip_icon_height:32,tooltip_offsetx:18,tooltip_offsety:0,arrows:true,buttons:true,btn_numbers:false,keybord_keys:false,mousetrace:false,pauseonover:true,stoponclick:true,transition:'hslide',transition_delay:300,transition_speed:500,show_caption:'onload',thumbnails:false,thumbnails_position:'outside-last',thumbnails_direction:'vertical',thumbnails_slidex:0,dynamic_height:false,speed_change:false,viewline:false,fullscreen_width_x:15,custom_function:null};options=jQuery.extend(defaults,options);var current_id=0;var previous_id=0;var break_loop=false;var pause_loop=false;var myInterval=null;var showcase=jQuery(this);var showcase_width=options.content_width;var animating=false;var content_viewline_width=10000;var animation_distance=0;var old_animation_distance=0;var remaining_width=0;var content_container=jQuery(document.createElement('div')).css('overflow','hidden').css('position','relative').addClass('showcase-content-container').prependTo(showcase);if(options.fit_to_parent){showcase_width=jQuery(showcase).width()+options.fullscreen_width_x}if(options.viewline){options.thumbnails=false;options.dynamic_height=false;content_container.css('width',content_viewline_width);showcase.css('overflow','hidden');$('.showcase-arrow-previous').hide()}var contentArray=[];var thumbnailArray=[];var content_count=0;showcase.children('.showcase-slide').each(function(){var object=jQuery(this);content_count++;if(options.thumbnails){var thumb=object.find('.showcase-thumbnail');thumbnailArray.push(thumb);thumb.remove()}var object_width=object.find('.showcase-content').children().width();var object_height=object.find('.showcase-content').children().height();contentArray.push(object.html());object.remove();var new_object=getContent(content_count-1);if(options.viewline||content_count===1){content_container.append(new_object)}if(options.viewline){new_object.css('position','relative');new_object.css('float','left');new_object.css('width',object_width)}if(options.dynamic_height){new_object.css('height',object_height);if(content_count===1){content_container.css('height',object_height)}}else{new_object.css('height',options.content_height);if(content_count===1){content_container.css('height',options.content_height)}}if(options.viewline||content_count===1){displayAnchors(new_object);displayCaption(new_object);if(options.show_caption==='show'){jQuery(new_object).find('.showcase-caption').show()}}});var thumb_wrapper;var thumbnailStretch=0;var thumbnailsPerPage=0;if(options.thumbnails){thumb_container=jQuery('<div />');thumb_restriction=jQuery('<div />');thumb_wrapper=jQuery('<div />');for(i=thumbnailArray.length-1;i>=0;--i){var thumbnail=jQuery(thumbnailArray[i]).css({'overflow':'hidden'});thumbnail.attr('id','showcase-thumbnail-'+i);thumbnail.addClass((i===0)?'active':'');thumbnail.click(function(a,b){return function(){if(myInterval){pause_loop=true;clearInterval(myInterval)}changeContent(a,b)}}(i,''));thumb_wrapper.prepend(thumbnail)}if(options.thumbnails_position==='outside-first'||options.thumbnails_position==='outside-last'){if(options.thumbnails_direction!=='horizontal'){content_container.css('float','left');content_container.css('width',options.content_width);thumb_container.css('float','left');thumb_container.css('height',options.content_height)}else{jQuery(thumb_wrapper).find('.showcase-thumbnail').css('float','left')}if(options.thumbnails_position==='outside-last'){showcase.append(thumb_container);if(options.thumbnails_direction!=='horizontal'){showcase.append(jQuery('<div />').addClass('clear'))}}else{showcase.prepend(thumb_container);if(options.thumbnails_direction!=='horizontal'){showcase.append(jQuery('<div />').addClass('clear'))}}}else{thumb_container.css({'position':'absolute','z-index':20});if(options.thumbnails_direction==='horizontal'){thumb_container.css({'left':0,'right':0});jQuery(thumb_wrapper).find('.showcase-thumbnail').css('float','left');jQuery(thumb_wrapper).append(jQuery('<div />').addClass('clear'));if(options.thumbnails_position==='inside-first'){thumb_container.css('top',0)}else{thumb_container.css('bottom',0)}}else{thumb_container.css({'top':0,'bottom':0});if(options.thumbnails_position==='inside-first'){thumb_container.css('left',0)}else{thumb_container.css('right',0)}}content_container.prepend(thumb_container)}thumb_container.addClass('showcase-thumbnail-container');thumb_container.css('overflow','hidden');thumb_restriction.addClass('showcase-thumbnail-restriction');thumb_restriction.css({'overflow':'hidden','position':'relative'});if(options.thumbnails_direction==='horizontal'){thumb_restriction.css({'float':'left'})}thumb_wrapper.addClass('showcase-thumbnail-wrapper');if(options.thumbnails_direction==='horizontal'){thumb_wrapper.addClass('showcase-thumbnail-wrapper-horizontal')}else{thumb_wrapper.addClass('showcase-thumbnail-wrapper-vertical')}thumb_wrapper.css('position','relative');thumb_restriction.append(thumb_wrapper);thumb_container.append(thumb_restriction);var buttonBackward=jQuery('<div class="showcase-thumbnail-button-backward" />');if(options.thumbnails_direction!=='horizontal'){buttonBackward.html('<span class="showcase-thumbnail-vertical"><span>Up</span></span>')}else{buttonBackward.css({'float':'left'});buttonBackward.html('<span class="showcase-thumbnail-horizontal"><span>Left</span></span>')}buttonBackward.click(function(){slideThumbnailWrapper('backward',false,true)});thumb_container.prepend(buttonBackward);var buttonForward=jQuery('<div class="showcase-thumbnail-button-forward" />');if(options.thumbnails_direction!=='horizontal'){buttonForward.html('<span class="showcase-thumbnail-vertical"><span>Down</span></span>')}else{buttonForward.css({'float':'left'});buttonForward.html('<span class="showcase-thumbnail-horizontal"><span>Right</span></span>')}buttonForward.click(function(){slideThumbnailWrapper('forward',false,true)});thumb_container.append(buttonForward);var thumbnailVisibleStretch=0;if(options.thumbnails_direction!=='horizontal'){thumbnailVisibleStretch=getElementHeight(thumb_wrapper,false);thumbnailVisibleStretch+=(getElementHeight(buttonBackward))+(getElementHeight(buttonForward));while(thumbnailVisibleStretch<options.content_height){thumbnailVisibleStretch+=getElementHeight(jQuery(thumbnailArray[0]));thumbnailsPerPage++}}else{thumbnailVisibleStretch=getElementWidth(thumb_wrapper,false);thumbnailVisibleStretch+=(getElementWidth(buttonBackward))+(getElementWidth(buttonForward));while(thumbnailVisibleStretch<showcase_width){thumbnailVisibleStretch+=getElementWidth(jQuery(thumbnailArray[0]));thumbnailsPerPage++}}if(thumbnailsPerPage+1>thumbnailArray.length){if(options.thumbnails_direction!=='horizontal'){thumb_restriction.css('margin-top',getElementHeight(buttonBackward))}else{thumb_restriction.css('margin-left',getElementWidth(buttonBackward))}buttonBackward.hide();buttonForward.hide()}if(options.thumbnails_direction!=='horizontal'){var buttonsHeight=(getElementHeight(buttonBackward))+(getElementHeight(buttonForward));thumb_restriction.css('height',options.content_height-buttonsHeight)}else{var buttonsWidth=(getElementWidth(buttonBackward))+(getElementWidth(buttonForward));thumb_restriction.css('width',showcase_width-buttonsWidth)}if(options.thumbnails_direction==='horizontal'){jQuery('.showcase-thumbnail').each(function(){thumbnailStretch+=getElementWidth(jQuery(this))});thumb_wrapper.css('width',thumbnailStretch)}else{jQuery('.showcase-thumbnail').each(function(){thumbnailStretch+=getElementHeight(jQuery(this))})}}if(options.thumbnails&&options.thumbnails_position.indexOf("outside")!==-1&&options.thumbnails_direction!=='horizontal'&&!options.viewline){showcase.css('width',showcase_width+getElementWidth(thumb_wrapper,true,false))}else if(!options.fit_to_parent){showcase.css('width',showcase_width)}if(content_count>1&&options.auto){myInterval=window.setInterval(autoChange,options.interval)}if(options.auto&&options.pauseonover){showcase.mouseenter(function(){break_loop=true;clearInterval(myInterval)});showcase.mouseleave(function(){if(!pause_loop){break_loop=false;myInterval=window.setInterval(autoChange,options.interval)}})}if(options.arrows&&content_count>1){jQuery(document.createElement('div')).addClass('showcase-arrow-previous').prependTo(showcase).click(function(){if(myInterval){if(options.stoponclick){pause_loop=true}clearInterval(myInterval)}changeContent((current_id===0)?content_count-1:parseInt(current_id)-1,'previous')});jQuery(document.createElement('div')).addClass('showcase-arrow-next').prependTo(showcase).click(function(){if(myInterval){if(options.stoponclick){pause_loop=true}clearInterval(myInterval)}changeContent(current_id+1,'next')});if(options.viewline){$('.showcase-arrow-previous').hide()}}if(options.buttons&&content_count>1){jQuery(document.createElement('div')).css('clear','both').addClass('showcase-button-wrapper').appendTo(showcase);i=0;while(i<content_count){jQuery(document.createElement('span')).attr('id','showcase-navigation-button-'+i).addClass((i===0)?'active':'').html((options.btn_numbers)?parseInt(i)+1:'&#9679;').click(function(a,b){return function(){if(myInterval){if(options.stoponclick){pause_loop=true}clearInterval(myInterval)}changeContent(a,b)}}(i,'')).appendTo(jQuery(showcase).find('.showcase-button-wrapper'));i++}}if(options.keybord_keys){jQuery(document).keydown(function(e){if(options.stoponclick){pause_loop=true}if(myInterval)clearInterval(myInterval);if(e.keyCode===37){changeContent((current_id===0)?content_count-1:parseInt(current_id)-1,'previous')}if(e.keyCode===39){changeContent((current_id===content_count-1)?0:parseInt(current_id)+1,'next')}})}function getContent(id){var new_content=jQuery(document.createElement('div')).attr('id','showcase-content-'+id).css('overflow','hidden').css('position','absolute').addClass('showcase-content').html(contentArray[id]);if(!options.viewline){new_content.css('width',options.content_width)}if(options.fit_to_parent&&!options.viewline){new_content.css('left',(showcase_width/2)-options.content_width/2)}return new_content}function autoChange(){var nextID=parseInt(current_id)+1;if(nextID===content_count&&options.continuous){nextID=0}else if(nextID===content_count&&!options.continuous){break_loop=true;clearInterval(myInterval)}if(!break_loop){changeContent(nextID,'next')}}function changeContent(id,direction){if(current_id!==id&&!animating){var obj;var obj2;var delay=0;var i;var lrpos=(options.fit_to_parent)?(showcase_width/2)-(options.content_width/2):0;if((id>current_id&&direction!=='previous')||direction==='next'){if(options.viewline){if(current_id<content_count-1){if(!options.speed_change){animating=true}updateContentViewlineWidth();if(options.pauseonover){window.clearInterval(myInterval)}remaining_width=0;for(i=current_id+1,len=content_count;i<len;++i){obj=addedContentArray[i];remaining_width+=obj.find('.showcase-content').children().width()}if(remaining_width>showcase_width){old_animation_distance=animation_distance;animation_distance-=addedContentArray[current_id].find('.showcase-content').children().width()}else if($('.showcase-arrow-next').is(':visible')){old_animation_distance=animation_distance;animation_distance=-(content_viewline_width-(remaining_width+(showcase_width-remaining_width)));$('.showcase-arrow-next').fadeOut(300)}content_container.animate({left:animation_distance+'px'},options.transition_speed,function(){animating=false});if($('.showcase-arrow-next').is(':visible')){current_id++}$('.showcase-arrow-previous').fadeIn(300)}}else{if(!options.speed_change){animating=true}obj=jQuery(showcase).find('#showcase-content-'+parseInt(current_id));obj2=getContent(id);content_container.append(obj2);if(options.dynamic_height){obj2.css('height',obj2.find('.showcase-content').children().height())}else{obj2.css('height',options.content_height)}if(obj.find('.showcase-content').children().height()>obj2.find('.showcase-content').children().height()&&options.dynamic_height){content_container.stop(true,true).animate({height:obj2.find('.showcase-content').children().height()},200);delay=100}if(options.transition==='hslide'){jQuery(obj).delay(delay).animate({left:-(options.content_width)},options.transition_speed+options.transition_delay,function(){obj.remove()})}else if(options.transition==='vslide'){jQuery(obj).delay(delay).animate({top:-(options.content_height)},options.transition_speed+options.transition_delay,function(){obj.remove()})}else{jQuery(obj).delay(delay).fadeOut(options.transition_speed,function(){obj.remove()})}displayAnchors(obj,true);displayCaption(obj,true);if(options.transition==='hslide'){obj2.css('left',showcase_width);jQuery(obj2).delay(delay).animate({left:lrpos},options.transition_speed,function(){displayAnchors(obj2);displayCaption(obj2);afterAnimation(obj2)})}else if(options.transition==='vslide'){obj2.css('top',showcase.height());jQuery(obj2).delay(delay).animate({top:'0px'},options.transition_speed,function(){displayAnchors(obj2);displayCaption(obj2);afterAnimation(obj2)})}else{obj2.css('left',lrpos);obj2.css('display','none');jQuery(obj2).delay(delay).fadeIn(options.transition_speed,function(){displayAnchors(obj2);displayCaption(obj2);afterAnimation(obj2)})}}}else if(id<current_id||direction==='previous'){if(options.viewline){if(current_id!==0){if(!options.speed_change){animating=true}updateContentViewlineWidth();if(options.pauseonover){window.clearInterval(myInterval)}content_container.animate({left:old_animation_distance+'px'},options.transition_speed,function(){animating=false});animation_distance=old_animation_distance;current_id--;if(current_id===0){$('.showcase-arrow-previous').fadeOut(300)}old_id=current_id-1;sub_width=jQuery(addedContentArray[old_id]).width();old_animation_distance=old_animation_distance+sub_width}$('.showcase-arrow-next').fadeIn(300)}else{if(!options.speed_change){animating=true}obj=jQuery(showcase).find('#showcase-content-'+parseInt(current_id));obj2=getContent(id);content_container.append(obj2);if(options.dynamic_height){obj2.css('height',obj2.find('.showcase-content').children().height())}else{obj2.css('height',options.content_height)}if(obj.find('.showcase-content').children().height()>obj2.find('.showcase-content').children().height()&&options.dynamic_height){content_container.stop(true,true).animate({height:obj2.find('.showcase-content').children().height()},200);delay=100}if(options.transition==='hslide'){jQuery(obj).delay(delay).animate({left:(showcase_width)+'px'},options.transition_speed+options.transition_delay,function(){displayAnchors(obj,true);displayCaption(obj,true);obj.remove()})}else if(options.transition==='vslide'){jQuery(obj).delay(delay).animate({top:(options.content_height)+'px'},options.transition_speed+options.transition_delay,function(){displayAnchors(obj,true);displayCaption(obj,true);obj.remove()})}else{jQuery(obj).delay(delay).fadeOut(options.transition_speed,function(){displayAnchors(obj,true);displayCaption(obj,true);obj.remove()})}if(options.transition==='hslide'){obj2.css('left','-'+options.content_width+'px');jQuery(obj2).delay(delay).animate({left:lrpos},options.transition_speed,function(){displayAnchors(obj2);displayCaption(obj2);afterAnimation(obj2)})}else if(options.transition==='vslide'){obj2.css('top','-'+showcase.height()+'px');jQuery(obj2).delay(delay).animate({top:'0px'},options.transition_speed,function(){displayAnchors(obj2);displayCaption(obj2);afterAnimation(obj2)})}else{obj2.css('left',lrpos);obj2.css('display','none');jQuery(obj2).delay(delay).fadeIn(options.transition_speed,function(){displayAnchors(obj2);displayCaption(obj2);afterAnimation(obj2)})}content_container.append(obj2)}}if(!options.viewline){previous_id=current_id;current_id=id;if(options.thumbnails){if((current_id>previous_id&&direction!=='previous')||direction==='next'){slideThumbnailWrapper('forward',true)}else if(current_id<previous_id||direction==='previous'){slideThumbnailWrapper('backward',true)}}if(options.arrows){jQuery(showcase).find('.showcase-arrow-previous').unbind('click').click(function(){if(myInterval){if(options.stoponclick){pause_loop=true}clearInterval(myInterval)}changeContent((current_id===0)?content_count-1:parseInt(current_id)-1,'previous')});jQuery(showcase).find('.showcase-arrow-next').unbind('click').click(function(){if(myInterval){if(options.stoponclick){pause_loop=true}clearInterval(myInterval)}changeContent((current_id===content_count-1)?0:parseInt(current_id)+1,'next')})}if(options.thumbnails){i=0;showcase.find('.showcase-thumbnail').each(function(){var object=jQuery(this);object.removeClass('active');if(i===current_id){object.addClass('active')}i++})}if(options.show_caption==='show'){jQuery(obj2).find('.showcase-caption').show()}}if(options.buttons){i=0;showcase.find('.showcase-button-wrapper span').each(function(){var object=jQuery(this);object.removeClass('active');if(i===current_id){object.addClass('active')}i++})}if(typeof options.custom_function=='function'){options.custom_function()}}}function afterAnimation(obj){if(options.dynamic_height){content_container.stop(true,true).animate({height:obj.find('.showcase-content').children().height()},200)}animating=false}var thumbnailSlidePosition=0;function slideThumbnailWrapper(direction,check,backwardforward){var doTheSlide=true;var thumbnailHeightOrWidth=getElementHeight(jQuery(thumb_wrapper).find('.showcase-thumbnail'));if(options.thumbnails_direction==='horizontal'){thumbnailHeightOrWidth=getElementWidth(jQuery(thumb_wrapper).find('.showcase-thumbnail'))}var multiplySlidePosition=1;if(options.thumbnails_slidex===0){options.thumbnails_slidex=thumbnailsPerPage}if(check){var thumbnailSlidePositionCopy=thumbnailSlidePosition;var thumbnailsScrolled=0;while(thumbnailSlidePositionCopy<0){if(options.thumbnails_direction==='horizontal'){thumbnailSlidePositionCopy+=getElementWidth(jQuery(thumbnailArray[0]))}else{thumbnailSlidePositionCopy+=getElementHeight(jQuery(thumbnailArray[0]))}thumbnailsScrolled++}var firstVisible=thumbnailsScrolled;var lastVisible=thumbnailsPerPage+thumbnailsScrolled-1;if(current_id>=firstVisible&&current_id<=lastVisible){doTheSlide=false}var distance;if((current_id-lastVisible)>options.thumbnails_slidex){distance=current_id-lastVisible;while(distance>options.thumbnails_slidex){distance-=options.thumbnails_slidex;multiplySlidePosition++}}else if((firstVisible-current_id)>options.thumbnails_slidex){distance=firstVisible-current_id;while(distance>options.thumbnails_slidex){distance-=options.thumbnails_slidex;multiplySlidePosition++}}else{multiplySlidePosition=1}}if(direction==='forward'&&doTheSlide){if(options.thumbnails_direction==='vertical'&&options.content_height<(thumbnailStretch+thumbnailSlidePosition)){thumbnailSlidePosition-=thumbnailHeightOrWidth*(options.thumbnails_slidex*multiplySlidePosition)}else if(options.thumbnails_direction==='horizontal'&&options.content_width<(thumbnailStretch+thumbnailSlidePosition)){thumbnailSlidePosition-=thumbnailHeightOrWidth*(options.thumbnails_slidex*multiplySlidePosition)}else if(current_id===0){if(!backwardforward){thumbnailSlidePosition=0}}if(options.thumbnails_direction==='horizontal'){thumb_wrapper.animate({left:thumbnailSlidePosition},300)}else{thumb_wrapper.animate({top:thumbnailSlidePosition},300)}}else if(doTheSlide){if(thumbnailSlidePosition<0){thumbnailSlidePosition+=thumbnailHeightOrWidth*(options.thumbnails_slidex*multiplySlidePosition)}else if(current_id===content_count-1){if(!backwardforward){thumbnailSlidePosition-=thumbnailHeightOrWidth*(options.thumbnails_slidex*multiplySlidePosition)}}else{thumbnailSlidePosition=0}if(options.thumbnails_direction==='horizontal'){thumb_wrapper.animate({left:thumbnailSlidePosition},300)}else{thumb_wrapper.animate({top:thumbnailSlidePosition},300)}}}function displayCaption(container,fadeOut){var caption=container.find('.showcase-caption');if(!fadeOut){if(options.show_caption==='onload'){caption.fadeIn(300)}else if(options.show_caption==='onhover'){jQuery(container).mouseenter(function(){caption.fadeIn(300)});jQuery(container).mouseleave(function(){caption.stop(true,true).fadeOut(100)})}}else{caption.stop(true,true).fadeOut(300)}}function displayAnchors(container,fadeOut){container.find('.showcase-tooltips a').each(function(){if(!fadeOut){var coords=jQuery(this).attr('coords');coords=coords.split(',');jQuery(this).addClass('showcase-plus-anchor');jQuery(this).css('position','absolute');jQuery(this).css('display','none');jQuery(this).css('width',options.tooltip_icon_width);jQuery(this).css('height',options.tooltip_icon_height);jQuery(this).css('left',parseInt(coords[0])-(parseInt(options.tooltip_icon_width)/2));jQuery(this).css('top',parseInt(coords[1])-(parseInt(options.tooltip_icon_height)/2));var content=jQuery(this).html();jQuery(this).mouseenter(function(){animateTooltip(container,coords[0],coords[1],content)});jQuery(this).mouseleave(function(){animateTooltip(container,coords[0],coords[1],content)});jQuery(this).html('');jQuery(this).fadeIn(300)}else{jQuery(this).stop(true,true).fadeOut(300)}})}var tooltip=null;function animateTooltip(container,x,y,content){if(tooltip===null){tooltip=jQuery(document.createElement('div')).addClass('showcase-tooltip').css('display','none').css('position','absolute').css('max-width',options.tooltip_width).html(content);container.append(tooltip);var tooltip_paddingx=parseInt(tooltip.css('padding-right'))*2+parseInt(tooltip.css('border-right-width'))*2;var tooltip_paddingy=parseInt(tooltip.css('padding-bottom'))*2+parseInt(tooltip.css('border-bottom-width'))*2;lastx=parseInt(x)+tooltip.width()+tooltip_paddingx;lasty=parseInt(y)+tooltip.height()+tooltip_paddingy;if(lastx<options.content_width){tooltip.css('left',parseInt(x)+parseInt(options.tooltip_offsetx))}else{tooltip.css('left',(parseInt(x)-parseInt(options.tooltip_offsetx))-(parseInt(tooltip.width())+parseInt(options.tooltip_offsetx)))}if(lasty<options.content_height){tooltip.css('top',parseInt(y)+parseInt(options.tooltip_offsety))}else{tooltip.css('top',(parseInt(y)-parseInt(options.tooltip_offsety))-(parseInt(tooltip.height())+parseInt(tooltip_paddingy)))}tooltip.fadeIn(400)}else{tooltip.fadeOut(400);tooltip.remove();tooltip=null}}function getElementHeight(el,incHeight,incMargin,incPadding,incBorders){incHeight=typeof(incHeight)!=='undefined'?incHeight:true;incMargin=typeof(incMargin)!=='undefined'?incMargin:true;incPadding=typeof(incPadding)!=='undefined'?incPadding:true;incBorders=typeof(incBorders)!=='undefined'?incBorders:true;var elHeight=(incHeight)?jQuery((el)).height():0;var elMargin=(incMargin)?parseFloat(jQuery((el)).css('margin-top'))+parseFloat(jQuery(el).css('margin-bottom')):0;var elPadding=(incPadding)?parseFloat(jQuery((el)).css('padding-top'))+parseFloat(jQuery(el).css('padding-bottom')):0;var elBorder=(incBorders)?parseFloat(jQuery((el)).css('border-top-width'))+parseFloat(jQuery((el)).css('border-bottom-width')):0;elHeight+=elMargin+elPadding+elBorder;return elHeight}function getElementWidth(el,incWidth,incMargin,incPadding,incBorders){incWidth=typeof(incWidth)!=='undefined'?incWidth:true;incMargin=typeof(incMargin)!=='undefined'?incMargin:true;incPadding=typeof(incPadding)!=='undefined'?incPadding:true;incBorders=typeof(incBorders)!=='undefined'?incBorders:true;var elWidth=(incWidth)?jQuery((el)).width():0;var elMargin=(incMargin)?parseFloat(jQuery((el)).css('margin-left'))+parseFloat(jQuery(el).css('margin-right')):0;var elPadding=(incPadding)?parseFloat(jQuery((el)).css('padding-left'))+parseFloat(jQuery((el)).css('padding-right')):0;var elBorder=(incBorders)?parseFloat(jQuery((el)).css('border-left-width'))+parseFloat(jQuery((el)).css('border-right-width')):0;elWidth+=elMargin+elPadding+elBorder;return elWidth}if(options.mousetrace){var mousetrace=jQuery(document.createElement('div')).css('position','absolute').css('top','0').css('background-color','#fff').css('color','#000').css('padding','3px 5px').css('x-index','30').html('X: 0 Y: 0');showcase.append(mousetrace);var offset=showcase.offset();content_container.mousemove(function(e){mousetrace.html('X: '+(e.pageX-offset.left)+' Y: '+(e.pageY-offset.top))})}$('#awOnePageButton').click(function showInOnePage(){if($('.view-page').is(':visible')){var temp_container=jQuery(document.createElement('div'));temp_container.addClass('showcase-onepage');showcase.before(temp_container);if(myInterval){pause_loop=true;clearInterval(myInterval)}$(this).find('.view-page').hide();$(this).find('.view-slide').show();showcase.hide();$.each(contentArray,function(index,value){obj=getContent(index);obj.css('position','relative');temp_container.append(obj);displayAnchors(obj);displayCaption(obj);if(options.dynamic_height){obj.css('height',obj.find('.showcase-content').children().height())}else{obj.css('height',options.content_height)}});var clear=jQuery(document.createElement('div'));clear.addClass('clear');temp_container.append(clear)}else{$('.showcase-onepage').remove();$(this).find('.view-page').show();$(this).find('.view-slide').hide();showcase.show()}return false});var addedContentArray=[];function updateContentViewlineWidth(){content_viewline_width=0;content_container.children('div').each(function(){content_viewline_width+=$(this).find('.showcase-content').children().width();addedContentArray.push($(this))})}showcase.removeClass('showcase-load')}})(jQuery);


// FROM: http://v2.lettingsearch.co.uk/javascript/organictabs.jquery.min.js


(function(a){a.organicTabs=function(b,c){var d=this;d.$el=a(b);d.$nav=d.$el.find(".nav");d.init=function(){d.options=a.extend({},a.organicTabs.defaultOptions,c);a(".hide").css({position:"relative",top:0,left:0,display:"none"});d.$nav.delegate("li > a","click",function(){var b=d.$el.find("a.current").attr("href").substring(1),c=a(this),e=c.attr("href").substring(1),f=d.$el.find(".list-wrap"),g=f.height();f.height(g);if(e!=b&&d.$el.find(":animated").length==0){d.$el.find("#"+b).fadeOut(d.options.speed,function(){d.$el.find("#"+e).fadeIn(d.options.speed);var a=d.$el.find("#"+e).height();f.animate({height:a});d.$el.find(".nav li a").removeClass("current");c.addClass("current")})}return false})};d.init()};a.organicTabs.defaultOptions={speed:300};a.fn.organicTabs=function(b){return this.each(function(){new a.organicTabs(this,b)})}})(jQuery);
/*
 * jQuery OpenX ad tags plugin
 *
 * Tested with OpenX Community Edition 2.8.8-rc6
 *
 * @version 1.1
 * @date Wed Aug 3 00:21:14 2011 +0400
 * @requires jQuery
 * @url http://plugins.jquery.com/project/openxtag
 *
 * @author Nikolay Morev <kolia@denivip.ru>
 * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
 *
 */(function($){function loadFlashObjectOnce(a,b){if(typeof window.org!="undefined"&&typeof window.org.openx!="undefined"&&typeof window.org.openx.SWFObject!="undefined")b();else{var c=(location.protocol=="https:"?a.deliverySSL:a.delivery)+"/"+a.swfObjectJS;$.getScript(c,b)}}function _buildStandardRequestParameters(a){var b={charset:a.charset,target:a.target,source:a.source,loc:window.location.href};typeof a.extra!="undefined"&&(b=$.extend(b,a.extra)),typeof a.block!="undefined"&&(b.block=a.block?1:0),typeof a.blockcampaign!="undefined"&&(b.blockcampaign=a.blockcampaign?1:0),document.referrer&&(b.referer=document.referrer);for(var c in b)typeof b[c]=="undefined"&&delete b[c];return b}function _validateSettings(a){location.protocol=="https:"?typeof a.deliverySSL!="string"&&$.error('please set "deliverySSL" option for openxtag'):typeof a.delivery!="string"&&$.error('please set "delivery" option for openxtag')}function _genericZoneCall(a,b,c,d){if(typeof b=="object"||typeof b=="function")d=c,c=b,b=null;typeof c=="function"&&(d=c,c=null);var e=$.extend(defaults,c);b!=null&&(e.zoneID=b);return a.apply(this,[b,e,d])}function _documentWriteSafeAppend(a,b){var c=0;(function(a){if(a.match(/document\.write|<script/)){var d=document.write,e="";document.write=function(a){e+=a},b.append(a),document.write=d,c++,c>_loopIterations&&$.error("openxtag: document.write loop stopped after "+_loopIterations+" iterations"),arguments.callee(e)}else b.append(a),typeof success=="function"&&setTimeout(success,0)})(a)}var _loopIterations=10,defaults={jsPrefix:"OA_",swfObjectJS:"fl.js",delivery:null,deliverySSL:null,jsTagScript:"ajs.php",spcTagScript:"spc.php",iframeTagScript:"afr.php",adViewScript:"avw.php",clickScript:"ck.php",charset:"UTF-8",zoneID:null,target:undefined,source:undefined,blockcampaign:undefined,block:undefined,forceAsync:!1,refresh:undefined,resize:undefined,allowtransparent:true,width:undefined,height:undefined,extra:undefined},init=function(a){defaults=$.extend(defaults,a)},jsZone=function(a,b,c){return this.each(function(){var a=$(this),c=$.extend({},b);typeof $.metadata!="undefined"&&(c=$.extend(c,a.metadata())),_validateSettings(c);var d=c.zoneID;d==null&&$.error('please set "zoneID" option for openxtag jsZone');var e=_buildStandardRequestParameters(c);e.zoneid=d,e.cb=Math.floor(Math.random()*99999999999),document.MAX_used||(document.MAX_used=","),document.MAX_used!=","&&(e.exclude=document.MAX_used),document.context&&(e.context=document.context),document.mmm_fo&&(e.mmm_fo=1);var f=(location.protocol=="https:"?c.deliverySSL:c.delivery)+"/"+c.jsTagScript;$.ajax({url:f,data:e,dataType:"html",async:c.forceAsync,success:function(b){_documentWriteSafeAppend('<script type="text/javascript">'+b+"</script>",a)}})})},iFrameZone=function(a,b,c){return this.each(function(){var a=$(this),c=$.extend({},b);typeof $.metadata!="undefined"&&(c=$.extend(c,a.metadata())),_validateSettings(c);var d=c.zoneID;d==null&&$.error('please set "zoneID" option for openxtag iframe');var e=_buildStandardRequestParameters(c);e.zoneid=d,e.cb=Math.floor(Math.random()*99999999999),typeof c.refresh!="undefined"&&(e.refresh=c.refresh),typeof c.resize!="undefined"&&(e.resize=c.resize?1:0),typeof c.width=="undefined"&&$.error("openxtag: width parameter is required for iframe tag");var f=c.width;typeof c.height=="undefined"&&$.error("openxtag: height parameter is required for iframe tag");var g=c.height,h="";typeof c.allowtransparent!="allowtransparent"&&c.allowtransparent&&(h=' allowtransparency="true" ');var i="a"+Math.floor(Math.random()*999999),j=typeof c.target=="undefined"?"_blank":c.target,k=location.protocol=="https:"?c.deliverySSL:c.delivery,l=k+"/"+c.iframeTagScript,m=k+"/"+c.clickScript,n=k+"/"+c.adViewScript;a.append("<iframe style='position:relative; z-index:1;' wmode='Opaque' id='"+i+"' name='"+i+"' src='"+l+"?"+$.param(e)+"' frameborder='0' scrolling='no' width='"+f+"' height='"+g+"'"+h+"><a href='"+m+"?n="+i+"&amp;cb="+e.cb+"' target='"+j+"'><img src='"+n+"?zoneid="+d+"&amp;cb="+e.cb+"&amp;n="+i+"' border='0' alt='' /></a></iframe>")})},spcTag=function(zoneID,settings,success){var zones={},i=0,chainObj=this.each(function(){var a=$(this),b=$.extend({},settings);typeof $.metadata!="undefined"&&(b=$.extend(b,a.metadata()));var c=b.zoneID;c==null&&$.error('please set "zoneID" option for openxtag jsZone');var d="z"+i;zones[d]=c,a.data("openxtag",{zn:d}),i++}),thesettings=$.extend({},settings);_validateSettings(thesettings);var data=_buildStandardRequestParameters(thesettings);data.zones=$.map(zones,function(a,b){return b+"="+a}).join("|"),data.nz=1;var scriptURL=(location.protocol=="https:"?thesettings.deliverySSL:thesettings.delivery)+"/"+thesettings.spcTagScript,that=this;$.ajax({url:scriptURL,data:data,dataType:"script",success:function(data){loadFlashObjectOnce(thesettings,function(){var output=eval("(function () {"+data+";return "+thesettings.jsPrefix+"output;})()");that.each(function(){var a=$(this);_documentWriteSafeAppend(output[a.data("openxtag").zn],a)})})}});return chainObj},fnMethods={zone:jsZone,jsZone:jsZone,spc:spcTag,iframe:iFrameZone};$.fn.extend({openxtag:function(a){if(fnMethods[a])return _genericZoneCall.apply(this,[fnMethods[a]].concat(Array.prototype.slice.call(arguments,1)));$.error("Method "+a+" does not exist on jQuery.openxtag")}});var methods={init:init};$.extend({openxtag:function(a){if(methods[a])return methods[a].apply(this,Array.prototype.slice.call(arguments,1));if(typeof a=="object"||!a)return methods.init.apply(this,arguments);$.error("Method "+a+" does not exist on jQuery.openxtag")}})})(jQuery)
