(function(c){var d=[];c.tools=c.tools||{};c.tools.tooltip={version:"1.1.2",conf:{effect:"toggle",fadeOutSpeed:"fast",tip:null,predelay:0,delay:30,opacity:1,lazy:undefined,position:["top","center"],offset:[0,0],cancelDefault:true,relative:false,oneInstance:true,events:{def:"mouseover,mouseout",input:"focus,blur",widget:"focus mouseover,blur mouseout",tooltip:"mouseover,mouseout"},api:false},addEffect:function(e,g,f){b[e]=[g,f]}};var b={toggle:[function(e){var f=this.getConf(),g=this.getTip(),h=f.opacity;if(h<1){g.css({opacity:h})}g.show();e.call()},function(e){this.getTip().hide();e.call()}],fade:[function(e){this.getTip().fadeIn(this.getConf().fadeInSpeed,e)},function(e){this.getTip().fadeOut(this.getConf().fadeOutSpeed,e)}]};function a(f,g){var p=this,k=c(this);f.data("tooltip",p);var l=f.next();if(g.tip){l=c(g.tip);if(l.length>1){l=f.nextAll(g.tip).eq(0);if(!l.length){l=f.parent().nextAll(g.tip).eq(0)}}}function o(u){var t=g.relative?f.position().top:f.offset().top,s=g.relative?f.position().left:f.offset().left,v=g.position[0];t-=l.outerHeight()-g.offset[0];s+=f.outerWidth()+g.offset[1];var q=l.outerHeight()+f.outerHeight();if(v=="center"){t+=q/2}if(v=="bottom"){t+=q}v=g.position[1];var r=l.outerWidth()+f.outerWidth();if(v=="center"){s-=r/2}if(v=="left"){s-=r}return{top:t,left:s}}var i=f.is(":input"),e=i&&f.is(":checkbox, :radio, select, :button"),h=f.attr("type"),n=g.events[h]||g.events[i?(e?"widget":"input"):"def"];n=n.split(/,\s*/);if(n.length!=2){throw"Tooltip: bad events configuration for "+h}f.bind(n[0],function(r){if(g.oneInstance){c.each(d,function(){this.hide()})}var q=l.data("trigger");if(q&&q[0]!=this){l.hide().stop(true,true)}r.target=this;p.show(r);n=g.events.tooltip.split(/,\s*/);l.bind(n[0],function(){p.show(r)});if(n[1]){l.bind(n[1],function(){p.hide(r)})}});f.bind(n[1],function(q){p.hide(q)});if(!c.browser.msie&&!i&&!g.predelay){f.mousemove(function(){if(!p.isShown()){f.triggerHandler("mouseover")}})}if(g.opacity<1){l.css("opacity",g.opacity)}var m=0,j=f.attr("title");if(j&&g.cancelDefault){f.removeAttr("title");f.data("title",j)}c.extend(p,{show:function(r){if(r){f=c(r.target)}clearTimeout(l.data("timer"));if(l.is(":animated")||l.is(":visible")){return p}function q(){l.data("trigger",f);var t=o(r);if(g.tip&&j){l.html(f.data("title"))}r=r||c.Event();r.type="onBeforeShow";k.trigger(r,[t]);if(r.isDefaultPrevented()){return p}t=o(r);l.css({position:"absolute",top:t.top,left:t.left});var s=b[g.effect];if(!s){throw'Nonexistent effect "'+g.effect+'"'}s[0].call(p,function(){r.type="onShow";k.trigger(r)})}if(g.predelay){clearTimeout(m);m=setTimeout(q,g.predelay)}else{q()}return p},hide:function(r){clearTimeout(l.data("timer"));clearTimeout(m);if(!l.is(":visible")){return}function q(){r=r||c.Event();r.type="onBeforeHide";k.trigger(r);if(r.isDefaultPrevented()){return}b[g.effect][1].call(p,function(){r.type="onHide";k.trigger(r)})}if(g.delay&&r){l.data("timer",setTimeout(q,g.delay))}else{q()}return p},isShown:function(){return l.is(":visible, :animated")},getConf:function(){return g},getTip:function(){return l},getTrigger:function(){return f},bind:function(q,r){k.bind(q,r);return p},onHide:function(q){return this.bind("onHide",q)},onBeforeShow:function(q){return this.bind("onBeforeShow",q)},onShow:function(q){return this.bind("onShow",q)},onBeforeHide:function(q){return this.bind("onBeforeHide",q)},unbind:function(q){k.unbind(q);return p}});c.each(g,function(q,r){if(c.isFunction(r)){p.bind(q,r)}})}c.prototype.tooltip=function(e){var f=this.eq(typeof e=="number"?e:0).data("tooltip");if(f){return f}var g=c.extend(true,{},c.tools.tooltip.conf);if(c.isFunction(e)){e={onBeforeShow:e}}else{if(typeof e=="string"){e={tip:e}}}e=c.extend(true,g,e);if(typeof e.position=="string"){e.position=e.position.split(/,?\s/)}if(e.lazy!==false&&(e.lazy===true||this.length>20)){this.one("mouseover",function(h){f=new a(c(this),e);f.show(h);d.push(f)})}else{this.each(function(){f=new a(c(this),e);d.push(f)})}return e.api?f:this}})(jQuery);
(function(b){var a=b.tools.tooltip;a.effects=a.effects||{};a.effects.slide={version:"1.0.0"};b.extend(a.conf,{direction:"up",bounce:false,slideOffset:10,slideInSpeed:200,slideOutSpeed:200,slideFade:!b.browser.msie});var c={up:["-","top"],down:["+","top"],left:["-","left"],right:["+","left"]};b.tools.tooltip.addEffect("slide",function(d){var f=this.getConf(),g=this.getTip(),h=f.slideFade?{opacity:f.opacity}:{},e=c[f.direction]||c.up;h[e[1]]=e[0]+"="+f.slideOffset;if(f.slideFade){g.css({opacity:0})}g.show().animate(h,f.slideInSpeed,d)},function(e){var g=this.getConf(),i=g.slideOffset,h=g.slideFade?{opacity:0}:{},f=c[g.direction]||c.up;var d=""+f[0];if(g.bounce){d=d=="+"?"-":"+"}h[f[1]]=d+"="+i;this.getTip().animate(h,g.slideOutSpeed,function(){b(this).hide();e.call()})})})(jQuery);
(function(d){var c=d.tools.tooltip;c.plugins=c.plugins||{};c.plugins.dynamic={version:"1.0.1",conf:{api:false,classNames:"top right bottom left"}};function b(h){var e=d(window);var g=e.width()+e.scrollLeft();var f=e.height()+e.scrollTop();return[h.offset().top<=e.scrollTop(),g<=h.offset().left+h.width(),f<=h.offset().top+h.height(),e.scrollLeft()>=h.offset().left]}function a(f){var e=f.length;while(e--){if(f[e]){return false}}return true}d.fn.dynamic=function(g){var h=d.extend({},c.plugins.dynamic.conf),f;if(typeof g=="number"){g={speed:g}}g=d.extend(h,g);var e=g.classNames.split(/\s/),i;this.each(function(){if(d(this).tooltip().jquery){throw"Lazy feature not supported by dynamic plugin. set lazy: false for tooltip"}var j=d(this).tooltip().onBeforeShow(function(n,o){var m=this.getTip(),l=this.getConf();if(!i){i=[l.position[0],l.position[1],l.offset[0],l.offset[1],d.extend({},l)]}d.extend(l,i[4]);l.position=[i[0],i[1]];l.offset=[i[2],i[3]];m.css({visibility:"hidden",position:"absolute",top:o.top,left:o.left}).show();var k=b(m);if(!a(k)){if(k[2]){d.extend(l,g.top);l.position[0]="top";m.addClass(e[0])}if(k[3]){d.extend(l,g.right);l.position[1]="right";m.addClass(e[1])}if(k[0]){d.extend(l,g.bottom);l.position[0]="bottom";m.addClass(e[2])}if(k[1]){d.extend(l,g.left);l.position[1]="left";m.addClass(e[3])}if(k[0]||k[2]){l.offset[0]*=-1}if(k[1]||k[3]){l.offset[1]*=-1}}m.css({visibility:"visible"}).hide()});j.onShow(function(){var l=this.getConf(),k=this.getTip();l.position=[i[0],i[1]];l.offset=[i[2],i[3]]});j.onHide(function(){var k=this.getTip();k.removeClass(g.classNames)});f=j});return g.api?f:this}})(jQuery);
(function(b){b.tools=b.tools||{};b.tools.expose={version:"1.0.5",conf:{maskId:null,loadSpeed:"slow",closeSpeed:"fast",closeOnClick:true,closeOnEsc:true,zIndex:9998,opacity:0.8,color:"#456",api:false}};function a(){if(b.browser.msie){var f=b(document).height(),e=b(window).height();return[window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,f-e<20?e:f]}return[b(window).width(),b(document).height()]}function c(h,g){var e=this,j=b(this),d=null,f=false,i=0;b.each(g,function(k,l){if(b.isFunction(l)){j.bind(k,l)}});b(window).resize(function(){e.fit()});b.extend(this,{getMask:function(){return d},getExposed:function(){return h},getConf:function(){return g},isLoaded:function(){return f},load:function(n){if(f){return e}i=h.eq(0).css("zIndex");if(g.maskId){d=b("#"+g.maskId)}if(!d||!d.length){var l=a();d=b("<div/>").css({position:"absolute",top:0,left:0,width:l[0],height:l[1],display:"none",opacity:0,zIndex:g.zIndex});if(g.maskId){d.attr("id",g.maskId)}b("body").append(d);var k=d.css("backgroundColor");if(!k||k=="transparent"||k=="rgba(0, 0, 0, 0)"){d.css("backgroundColor",g.color)}if(g.closeOnEsc){b(document).bind("keydown.unexpose",function(o){if(o.keyCode==27){e.close()}})}if(g.closeOnClick){d.bind("click.unexpose",function(o){e.close(o)})}}n=n||b.Event();n.type="onBeforeLoad";j.trigger(n);if(n.isDefaultPrevented()){return e}b.each(h,function(){var o=b(this);if(!/relative|absolute|fixed/i.test(o.css("position"))){o.css("position","relative")}});h.css({zIndex:Math.max(g.zIndex+1,i=="auto"?0:i)});var m=d.height();if(!this.isLoaded()){d.css({opacity:0,display:"block"}).fadeTo(g.loadSpeed,g.opacity,function(){if(d.height()!=m){d.css("height",m)}n.type="onLoad";j.trigger(n)})}f=true;return e},close:function(k){if(!f){return e}k=k||b.Event();k.type="onBeforeClose";j.trigger(k);if(k.isDefaultPrevented()){return e}d.fadeOut(g.closeSpeed,function(){k.type="onClose";j.trigger(k);h.css({zIndex:b.browser.msie?i:null})});f=false;return e},fit:function(){if(d){var k=a();d.css({width:k[0],height:k[1]})}},bind:function(k,l){j.bind(k,l);return e},unbind:function(k){j.unbind(k);return e}});b.each("onBeforeLoad,onLoad,onBeforeClose,onClose".split(","),function(k,l){e[l]=function(m){return e.bind(l,m)}})}b.fn.expose=function(d){var e=this.eq(typeof d=="number"?d:0).data("expose");if(e){return e}if(typeof d=="string"){d={color:d}}var f=b.extend({},b.tools.expose.conf);d=b.extend(f,d);this.each(function(){e=new c(b(this),d);b(this).data("expose",e)});return d.api?e:this}})(jQuery);
(function($) {
  $.facebox = function(data, klass) {
    $.facebox.loading()

    if (data.ajax) fillFaceboxFromAjax(data.ajax)
    else if (data.image) fillFaceboxFromImage(data.image)
    else if (data.div) fillFaceboxFromHref(data.div)
    else if ($.isFunction(data)) data.call($)
    else $.facebox.reveal(data, klass)
  }

  /*
   * Public, $.facebox methods
   */

  $.extend($.facebox, {
    settings: {
      opacity      : 0,
      overlay      : true,
      loadingImage : 'styles/facebox/loading.gif',
      closeImage   : 'styles/facebox/closelabel.gif',
      imageTypes   : [ 'png', 'jpg', 'jpeg', 'gif' ],
      faceboxHtml  : '\
    <div id="facebox" style="display:none;"> \
      <div class="popup"> \
        <table> \
          <tbody> \
            <tr> \
              <td class="tl"/><td class="b"/><td class="tr"/> \
            </tr> \
            <tr> \
              <td class="b"/> \
              <td class="body"> \
                <div class="content"> \
                </div> \
                <div class="footer"> \
                  <a href="#" class="close"> \
                    <img src="styles/facebox/closelabel.gif" title="close" class="close_image" /> \
                  </a> \
                </div> \
              </td> \
              <td class="b"/> \
            </tr> \
            <tr> \
              <td class="bl"/><td class="b"/><td class="br"/> \
            </tr> \
          </tbody> \
        </table> \
      </div> \
    </div>'
    },

    loading: function() {
      init()
      if ($('#facebox .loading').length == 1) return true
      showOverlay()

      $('#facebox .content').empty()
      $('#facebox .body').children().hide().end().
        append('<div class="loading"><img src="'+$.facebox.settings.loadingImage+'"/></div>')

      $('#facebox').css({
        top:	getPageScroll()[1] + (getPageHeight() / 10),
        left:   ($(window).width() - $('#facebox').width()) / 2
      }).show()

      $(document).bind('keydown.facebox', function(e) {
        if (e.keyCode == 27) $.facebox.close()
        return true
      })
      $(document).trigger('loading.facebox')
    },

    reveal: function(data, klass) {
      $(document).trigger('beforeReveal.facebox')
      if (klass) $('#facebox .content').addClass(klass)
      $('#facebox .content').append(data)
      $('#facebox .loading').remove()
      $('#facebox .body').children().fadeIn('normal')
      $('#facebox').css('left', $(window).width() / 2 - ($('#facebox table').width() / 2))
      $(document).trigger('reveal.facebox').trigger('afterReveal.facebox')
    },

    close: function() {
      $(document).trigger('close.facebox')
      return false
    }
  })

  /*
   * Public, $.fn methods
   */

  $.fn.facebox = function(settings) {
    init(settings)

    function clickHandler() {
      $.facebox.loading(true)

      // support for rel="facebox.inline_popup" syntax, to add a class
      // also supports deprecated "facebox[.inline_popup]" syntax
      var klass = this.rel.match(/facebox\[?\.(\w+)\]?/)
      if (klass) klass = klass[1]

      fillFaceboxFromHref(this.href, klass)
      return false
    }

    return this.click(clickHandler)
  }

  /*
   * Private methods
   */

  // called one time to setup facebox on this page
  function init(settings) {
    if ($.facebox.settings.inited) return true
    else $.facebox.settings.inited = true

    $(document).trigger('init.facebox')
    makeCompatible()

    var imageTypes = $.facebox.settings.imageTypes.join('|')
    $.facebox.settings.imageTypesRegexp = new RegExp('\.' + imageTypes + '$', 'i')

    if (settings) $.extend($.facebox.settings, settings)
    $('body').append($.facebox.settings.faceboxHtml)

    var preload = [ new Image(), new Image() ]
    preload[0].src = $.facebox.settings.closeImage
    preload[1].src = $.facebox.settings.loadingImage

    $('#facebox').find('.b:first, .bl, .br, .tl, .tr').each(function() {
      preload.push(new Image())
      preload.slice(-1).src = $(this).css('background-image').replace(/url\((.+)\)/, '$1')
    })

    $('#facebox .close').click($.facebox.close)
    $('#facebox .close_image').attr('src', $.facebox.settings.closeImage)
  }

  // getPageScroll() by quirksmode.com
  function getPageScroll() {
    var xScroll, yScroll;
    if (self.pageYOffset) {
      yScroll = self.pageYOffset;
      xScroll = self.pageXOffset;
    } else if (document.documentElement && document.documentElement.scrollTop) {	 // Explorer 6 Strict
      yScroll = document.documentElement.scrollTop;
      xScroll = document.documentElement.scrollLeft;
    } else if (document.body) {// all other Explorers
      yScroll = document.body.scrollTop;
      xScroll = document.body.scrollLeft;
    }
    return new Array(xScroll,yScroll)
  }

  // Adapted from getPageSize() by quirksmode.com
  function getPageHeight() {
    var windowHeight
    if (self.innerHeight) {	// all except Explorer
      windowHeight = self.innerHeight;
    } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
      windowHeight = document.documentElement.clientHeight;
    } else if (document.body) { // other Explorers
      windowHeight = document.body.clientHeight;
    }
    return windowHeight
  }

  // Backwards compatibility
  function makeCompatible() {
    var $s = $.facebox.settings

    $s.loadingImage = $s.loading_image || $s.loadingImage
    $s.closeImage = $s.close_image || $s.closeImage
    $s.imageTypes = $s.image_types || $s.imageTypes
    $s.faceboxHtml = $s.facebox_html || $s.faceboxHtml
  }

  // Figures out what you want to display and displays it
  // formats are:
  //     div: #id
  //   image: blah.extension
  //    ajax: anything else
  function fillFaceboxFromHref(href, klass) {
    // div
    if (href.match(/#/)) {
      var url    = window.location.href.split('#')[0]
      var target = href.replace(url,'')
      $.facebox.reveal($(target).clone().show(), klass)

    // image
    } else if (href.match($.facebox.settings.imageTypesRegexp)) {
      fillFaceboxFromImage(href, klass)
    // ajax
    } else {
      fillFaceboxFromAjax(href, klass)
    }
  }

  function fillFaceboxFromImage(href, klass) {
    var image = new Image()
    image.onload = function() {
      $.facebox.reveal('<div class="image"><img src="' + image.src + '" /></div>', klass)
    }
    image.src = href
  }

  function fillFaceboxFromAjax(href, klass) {
    $.get(href, function(data) { $.facebox.reveal(data, klass) })
  }

  function skipOverlay() {
    return $.facebox.settings.overlay == false || $.facebox.settings.opacity === null
  }

  function showOverlay() {
    if (skipOverlay()) return

    if ($('facebox_overlay').length == 0)
      $("body").append('<div id="facebox_overlay" class="facebox_hide"></div>')

    $('#facebox_overlay').hide().addClass("facebox_overlayBG")
      .css('opacity', $.facebox.settings.opacity)
      .click(function() { $(document).trigger('close.facebox') })
      .fadeIn(200)
    return false
  }

  function hideOverlay() {
    if (skipOverlay()) return

    $('#facebox_overlay').fadeOut(200, function(){
      $("#facebox_overlay").removeClass("facebox_overlayBG")
      $("#facebox_overlay").addClass("facebox_hide")
      $("#facebox_overlay").remove()
    })

    return false
  }
  $(document).bind('close.facebox', function() {
    $(document).unbind('keydown.facebox')
    $('#facebox').fadeOut(function() {
      $('#facebox .content').removeClass().addClass('content')
      hideOverlay()
      $('#facebox .loading').remove()
    })
  })

})(jQuery);

(function($){$.extend({progressBar:new function(){this.defaults={steps:20,stepDuration:20,max:100,showText:true,textFormat:'percentage',width:120,height:12,callback:null,boxImage:'images/progressbar.gif',barImage:{0:'images/progressbg_red.gif',30:'images/progressbg_orange.gif',70:'images/progressbg_green.gif'},running_value:0,value:0,image:null};this.construct=function(arg1,arg2){var argvalue=null;var argconfig=null;if(arg1!=null){if(!isNaN(arg1)){argvalue=arg1;if(arg2!=null){argconfig=arg2;}}else{argconfig=arg1;}}
return this.each(function(child){var pb=this;var config=this.config;if(argvalue!=null&&this.bar!=null&&this.config!=null){this.config.value=parseInt(argvalue)
if(argconfig!=null)
pb.config=$.extend(this.config,argconfig);config=pb.config;}else{var $this=$(this);var config=$.extend({},$.progressBar.defaults,argconfig);config.id=$this.attr('id')?$this.attr('id'):Math.ceil(Math.random()*100000);if(argvalue==null)
argvalue=$this.html().replace("%","")
config.value=parseInt(argvalue);config.running_value=0;config.image=getBarImage(config);var numeric=['steps','stepDuration','max','width','height','running_value','value'];for(var i=0;i<numeric.length;i++)
config[numeric[i]]=parseInt(config[numeric[i]]);$this.html("");var bar=document.createElement('img');var text=document.createElement('span');var $bar=$(bar);var $text=$(text);pb.bar=$bar;$bar.attr('id',config.id+"_pbImage");$text.attr('id',config.id+"_pbText");$text.html(getText(config));$bar.attr('title',getText(config));$bar.attr('alt',getText(config));$bar.attr('src',config.boxImage);$bar.attr('width',config.width);$bar.css("width",config.width+"px");$bar.css("height",config.height+"px");$bar.css("background-image","url("+config.image+")");$bar.css("background-position",((config.width*-1))+'px 50%');$bar.css("padding","0");$bar.css("margin","0");$this.append($bar);$this.append($text);}
function getPercentage(config){return config.running_value*100/config.max;}
function getBarImage(config){var image=config.barImage;if(typeof(config.barImage)=='object'){for(var i in config.barImage){if(config.running_value>=parseInt(i)){image=config.barImage[i];}else{break;}}}
return image;}
function getText(config){if(config.showText){if(config.textFormat=='percentage'){return" "+Math.round(config.running_value)+"%";}else if(config.textFormat=='fraction'){return" "+config.running_value+'/'+config.max;}}}
config.increment=Math.round((config.value-config.running_value)/config.steps);if(config.increment<0)
config.increment*=-1;if(config.increment<1)
config.increment=1;var t=setInterval(function(){var pixels=config.width/100;if(config.running_value>config.value){if(config.running_value-config.increment<config.value){config.running_value=config.value;}else{config.running_value-=config.increment;}}
else if(config.running_value<config.value){if(config.running_value+config.increment>config.value){config.running_value=config.value;}else{config.running_value+=config.increment;}}
if(config.running_value==config.value)
clearInterval(t);var $bar=$("#"+config.id+"_pbImage");var $text=$("#"+config.id+"_pbText");var image=getBarImage(config);if(image!=config.image){$bar.css("background-image","url("+image+")");config.image=image;}
$bar.css("background-position",(((config.width*-1))+(getPercentage(config)*pixels))+'px 50%');$bar.attr('title',getText(config));$text.html(getText(config));if(config.callback!=null&&typeof(config.callback)=='function')
config.callback(config);pb.config=config;},config.stepDuration);});};}});$.fn.extend({progressBar:$.progressBar.construct});})(jQuery);


var $j = jQuery.noConflict();
$j(document).ready(function() {
//
/*--- 13th december 2010 --- */
$j('#menuLocationsBody, #menuLife, #menuTen').hide();
    $j('.menulocations').hide();
/*function menuShow(id) {
	$j('.menulocations').hide();
	$j('#menuLocations'+id).show();
}
function menuHide() {
	$j('#menuLocationsBody').hide();
	$j('.menulocations').hide();
}*/
function moveSubLocation(linkPositionY) {
//alert(linkPositionY);
var tPosY = (linkPositionY - 216);
$j('#menuLocationsSubBody').css({top: tPosY});
}
$j("#menu_search").hover( function() {
    $j('#menuLife, #menuTen, #menuLocationsSubBody').hide();
    $j('#menuLocationsBody').show();
    $j('#menu_search').addClass("active");
    $j('#menu_life').removeClass("active");
});
$j("#menu_life").hover( function() {
    $j('#menuLocationsBody, #menuLocationsSubBody, #menuTen').hide();
    $j('#menuLife').show();
    $j('#menu_life').addClass("active");
    $j('#menu_search, #menu_tenbest').removeClass("active");
});
$j("#menu_tenbest").hover( function() {
    $j('#menuLocationsBody, #menuLocationsSubBody, #menuLife').hide();
    $j('#menuTen').show();
    $j('#menu_tenbest').addClass("active");
    $j('#menu_search, #menu_life').removeClass("active");
});
$j("#main, #header, .static").hover( function() {
    $j('#menuLocationsBody, #menuLife, #menuTen, #menuLocationsSubBody, .menuLocations').hide();
    $j('.menuLocations').hide();
    $j('#menuLocationsBody, #menuLocationsSubBody, #menuLife, #menuTen, #menu_life, #menu_tenbest, #menu_search').removeClass("active");
    /*$j('#menu_life a, #menu_search a').css("color", "#636363");
    $j('#menu_life a, #menu_search a').css("background-color", "#636363");*/
});
// there's individual menus flying out all over the place, guvnor
$j("#menuGB").hover( function() {
    $j('.menuLocations, .sub, #menuLocationsSubBody, #menuLife, #menuTen').hide();
    $j('#menuLocationsGB').show();
    $j('#menuLocationsBody a').removeClass("active");
    $j('#menuGB').addClass("active");
});
$j("#menuEU").hover( function() {
    $j('.menuLocations, .sub, #menuLocationsSubBody, #menuLife, #menuTen').hide();
    $j('#menuLocationsEU').show();
    $j('#menuLocationsBody a').removeClass("active");
    $j('#menuEU').addClass("active");
});
$j("#menuWORLDWIDE_CONTINENTS").hover( function() {
    $j('.menuLocations, .sub, #menuLocationsSubBody, #menuLife, #menuTen').hide();
    $j('#menuLocationsWORLDWIDE_CONTINENTS').show();
    $j('#menuLocationsBody a').removeClass("active");
    $j('#menuWORLDWIDE_CONTINENTS').addClass("active");
});
$j("a.menu_country").hover( function(e) {
    var countryid=$j(this).attr("id");
    var countrycode = countryid.split("main_");
    $j('.sub, #menuLocationsSubBody').hide();
    $j('#menuLocationsSubBody, #sub_'+countrycode[1]).show();
    moveSubLocation(e.pageY);
    $j('#menuLocationsBody a, .menuLocations ul li a').removeClass("active");
    $j('#main_'+countrycode[1]).addClass("active");
});
/*--- 13th december 2010 --- */


$j.facebox.settings.opacity = 0.5;
$j(".datepicker").datepicker({ dateFormat: 'dd/mm/yy', constrainInput: true, defaultDate: +1, gotoCurrent: true, minDate: +1 });
$j("#ui-datepicker-div").wrap("<div id='picker'></div>");
$j("#datepicker[title]").tooltip({tip: '#tooltiptwo', effect: 'slide', direction: 'left', bounce: 'true'});

/*---6th october 2010 - survey bar dynamic overall ratings from survey gizmo ---*/
var rating1 = $j('#rating1').html();
var rating2 = $j('#rating2').html();
var rating3 = $j('#rating3').html();
var rating4 = $j('#rating4').html();
var rating5 = $j('#rating5').html();
var rating6 = $j('#rating6').html();
var rating7 = $j('#rating7').html();
var rating8 = $j('#rating8').html();
var rating9 = $j('#rating9').html();
var rating10 = $j('#rating10').html();
var rating11 = $j('#rating11').html();
var rating12 = $j('#rating12').html();
var rating13 = $j('#rating13').html();
var rating14 = $j('#rating14').html();
var rating15 = $j('#rating15').html();
//alert($j("#overall5").length);
//alert(rating5);
// build dem bars
((($j("#overall1").length)>0) && rating1 > 0) ? $j("#overall1").progressBar(rating1,{barImage: 'images/progressbg_purple.png'}) : $j("#overall1").html('<span>Not yet rated</span>');
((($j("#overall2").length)>0) && rating2 > 0) ? $j("#overall2").progressBar(rating2,{barImage: 'images/progressbg_purple.png'}) : $j("#overall2").html('<span>Not yet rated</span>');
((($j("#overall3").length)>0) && rating3 > 0) ? $j("#overall3").progressBar(rating3,{barImage: 'images/progressbg_purple.png'}) : $j("#overall3").html('<span>Not yet rated</span>');
((($j("#overall4").length)>0) && rating4 > 0) ? $j("#overall4").progressBar(rating4,{barImage: 'images/progressbg_purple.png'}) : $j("#overall4").html('<span>Not yet rated</span>');
((($j("#overall5").length)>0) && rating5 > 0) ? $j("#overall5").progressBar(rating5,{barImage: 'images/progressbg_purple.png'}) : $j("#overall5").html('<span>Not yet rated</span>');
((($j("#overall6").length)>0) && rating6 > 0) ? $j("#overall6").progressBar(rating6,{barImage: 'images/progressbg_purple.png'}) : $j("#overall6").html('<span>Not yet rated</span>');
((($j("#overall7").length)>0) && rating7 > 0) ? $j("#overall7").progressBar(rating7,{barImage: 'images/progressbg_purple.png'}) : $j("#overall7").html('<span>Not yet rated</span>');
((($j("#overall8").length)>0) && rating8 > 0) ? $j("#overall8").progressBar(rating8,{barImage: 'images/progressbg_purple.png'}) : $j("#overall8").html('<span>Not yet rated</span>');
((($j("#overall9").length)>0) && rating9 > 0) ? $j("#overall9").progressBar(rating9,{barImage: 'images/progressbg_purple.png'}) : $j("#overall9").html('<span>Not yet rated</span>');
((($j("#overall10").length)>0) && rating10 > 0) ? $j("#overall10").progressBar(rating10,{barImage: 'images/progressbg_purple.png'}) : $j("#overall10").html('<span>Not yet rated</span>');
((($j("#overall11").length)>0) && rating11 > 0) ? $j("#overall11").progressBar(rating11,{barImage: 'images/progressbg_purple.png'}) : $j("#overall11").html('<span>Not yet rated</span>');
((($j("#overall12").length)>0) && rating12 > 0) ? $j("#overall12").progressBar(rating12,{barImage: 'images/progressbg_purple.png'}) : $j("#overall12").html('<span>Not yet rated</span>');
((($j("#overall13").length)>0) && rating13 > 0) ? $j("#overall13").progressBar(rating13,{barImage: 'images/progressbg_purple.png'}) : $j("#overall13").html('<span>Not yet rated</span>');
((($j("#overall14").length)>0) && rating14 > 0) ? $j("#overall14").progressBar(rating14,{barImage: 'images/progressbg_purple.png'}) : $j("#overall14").html('<span>Not yet rated</span>');
((($j("#overall15").length)>0) && rating15 > 0) ? $j("#overall15").progressBar(rating15,{barImage: 'images/progressbg_purple.png'}) : $j("#overall15").html('<span>Not yet rated</span>');
/*--- ende 6th october 2010 - survey bar dynamic overall ratings from survey gizmo ---*/



$j("#signup #newsletteremail").click(function() {
document.newslettersignup.newsletteremail.value='';
$j("#newsletteremail").css({"background-color" : "#f4f5c0"});
});
//
$j('.alert, #search_submit, #signup_submit').hide();
$j("#signupsubmit").click(function() {
var email = $j("input#newsletteremail").val();
if (email != "" && email != "enter your email here") {
dataString = 'email=' + email;
$j.ajax({
type: "POST",
url: "scripts/newsletter_signup.php",
data: dataString,
cache: false,
success: function(html) {
if (html == 01) {
$j.facebox("<p class='alert'>Error</p><p class='dialogtext'>Please check your email address is valid.</p>");
} else if (html == 02) {
$j.facebox("<p class='smallerror'>Thanks, but ...</p><p class='dialogtext'>You are already subscribed to our newsletter!<br>Thanks anyway.</p>");
} else if (html == 03) {
$j.facebox("<p class='alert'>Error</p><p class='dialogtext'>You've submitted an empty or invalid email address. Please check and try again.</p>");
} else if (html == 11) {
$j.facebox("<p class='success'>Thanks!</p><p class='dialogtext'>You have been added to the Baby-Friendly Boltholes Newsletter list.<br>Thank you.</p>");
}

}
});
return false;
}
else if (email == "" || email == "enter your email here") {
$j.facebox("<p class='alert'>Form Error</p><p class='dialogtext'>You haven't entered an email address yet.</p>");
$j("input#newsletteremail").focus();
return false;
}
});
$j.easing.bouncy = function (x, t, b, c, d) {
    var s = 1.70158;
    if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
    return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
}
$j.tools.tooltip.addEffect("bouncy",
    function(done) {
        this.getTip().animate({top: '+=15'}, 500, 'bouncy', done).show();
    },
    function(done) {
        this.getTip().animate({top: '-=15'}, 500, 'bouncy', function()  {
            $j(this).hide();
            done.call();
        });
    }
);
//
//
////var $j = jQuery.noConflict();
//$j(document).ready(function() {
$j(".searchelementcontent").show();
//$j(".specialoffer[title]").tooltip({tip: '#tooltiptwo', effect: 'slide', direction: 'left', bounce: 'true', lazy: 'false'});
$j(".resetbutton[title], a#shortlink[title]").tooltip({tip: '#tooltiptwo', effect: 'slide', direction: 'left', bounce: 'true', lazy: 'false'});
$j("#search_submit, #signup_submit, #datestrip").hide();
// ajax advanced search form submission
$j("#searchbutton.advanced, .go").click(function() {
var searchvalues = $j("#bfbsearch").serialize();
//console.log(searchvalues);
if(searchvalues=="search_country=&search_region=&search_sleeps=&search_propertyname=&search_arrivaldate=&search_numbernights=&formtype=detailedsearch" || searchvalues=="search_country=&search_region=&search_sleeps=&search_propertyname=&search_arrivaldate=click+for+arrival+date&search_numbernights=&formtype=detailedsearch") {
$j.facebox("<p class='alert'>Form Error</p><p class='dialogtext'>You haven't selected any search options yet.<br>Try selecting a country to start your search...</p>");
return false;
}
var arrival = $j("#search_arrivaldate").val();
var nights = $j("#search_numbernights").val();
if(arrival !="" && arrival!="click for arrival date" && (nights<1 || nights=="")) {
$j.facebox("<p class='alert'>Form Error</p><p class='dialogtext'>You've selected an Arrival Date for your search but left the Number of Nights field empty. <br>Please select the Number of Nights before submitting your search.</p>");
return false;
} else if(nights!="" && arrival=="") {
$j.facebox("<p class='alert'>Form Error</p><p class='dialogtext'>You've selected the Number of Nights for your search but left the Arrival Date field empty. <br>Please select the Arrival Date before submitting your search.</p>");
return false;
}
$j("#pages").empty();
$j("#loading").loading({img: 'elements/images/loader.gif'});
var sorttype = $j('#sorttype').val();
searchvalues+= "&search_orderby="+sorttype;
$j.ajax({
type: "POST",
url: "scripts/xhr_get_search2.php",
cache: false,
data: searchvalues,
success: function(html){
location.href="#listingtopstrip";
$j("#loading").loading(false).empty();
var newhtml = html.split("---");
var results = newhtml[2].split("###");
$j("#searchreturned").fadeOut(200).empty().html(newhtml[0]).fadeIn(250).show();
$j("#listing_displayresults").empty().html(newhtml[1]).fadeIn(400).show();
$j(".listingblock").effect("highlight", {}, 1500);
$j("#pages, #pages_bottom").empty().html(newhtml[4]).show();
$j("#results_checkin").empty().html(results[0]).show();
$j("#results_nights").empty().html(results[1]).show();
$j("#results_guests").empty().html(results[2]).show();
//$j("#bfbnocache").val(newhtml[5]);
//console.log(newhtml[5]);
$j("#datestrip").show();
/*---6th october 2010 - survey bar dynamic overall ratings from survey gizmo ---*/
var rating1 = $j('#rating1').html();
var rating2 = $j('#rating2').html();
var rating3 = $j('#rating3').html();
var rating4 = $j('#rating4').html();
var rating5 = $j('#rating5').html();
var rating6 = $j('#rating6').html();
var rating7 = $j('#rating7').html();
var rating8 = $j('#rating8').html();
var rating9 = $j('#rating9').html();
var rating10 = $j('#rating10').html();
var rating11 = $j('#rating11').html();
var rating12 = $j('#rating12').html();
var rating13 = $j('#rating13').html();
var rating14 = $j('#rating14').html();
var rating15 = $j('#rating15').html();
// build dem bars
((($j("#overall1").length)>0) && rating1 > 0) ? $j("#overall1").progressBar(rating1,{barImage: 'images/progressbg_purple.png'}) : $j("#overall1").html('<span>Not yet rated</span>');
((($j("#overall2").length)>0) && rating2 > 0) ? $j("#overall2").progressBar(rating2,{barImage: 'images/progressbg_purple.png'}) : $j("#overall2").html('<span>Not yet rated</span>');
((($j("#overall3").length)>0) && rating3 > 0) ? $j("#overall3").progressBar(rating3,{barImage: 'images/progressbg_purple.png'}) : $j("#overall3").html('<span>Not yet rated</span>');
((($j("#overall4").length)>0) && rating4 > 0) ? $j("#overall4").progressBar(rating4,{barImage: 'images/progressbg_purple.png'}) : $j("#overall4").html('<span>Not yet rated</span>');
((($j("#overall5").length)>0) && rating5 > 0) ? $j("#overall5").progressBar(rating5,{barImage: 'images/progressbg_purple.png'}) : $j("#overall5").html('<span>Not yet rated</span>');
((($j("#overall6").length)>0) && rating6 > 0) ? $j("#overall6").progressBar(rating6,{barImage: 'images/progressbg_purple.png'}) : $j("#overall6").html('<span>Not yet rated</span>');
((($j("#overall7").length)>0) && rating7 > 0) ? $j("#overall7").progressBar(rating7,{barImage: 'images/progressbg_purple.png'}) : $j("#overall7").html('<span>Not yet rated</span>');
((($j("#overall8").length)>0) && rating8 > 0) ? $j("#overall8").progressBar(rating8,{barImage: 'images/progressbg_purple.png'}) : $j("#overall8").html('<span>Not yet rated</span>');
((($j("#overall9").length)>0) && rating9 > 0) ? $j("#overall9").progressBar(rating9,{barImage: 'images/progressbg_purple.png'}) : $j("#overall9").html('<span>Not yet rated</span>');
((($j("#overall10").length)>0) && rating10 > 0) ? $j("#overall10").progressBar(rating10,{barImage: 'images/progressbg_purple.png'}) : $j("#overall10").html('<span>Not yet rated</span>');
((($j("#overall11").length)>0) && rating11 > 0) ? $j("#overall11").progressBar(rating11,{barImage: 'images/progressbg_purple.png'}) : $j("#overall11").html('<span>Not yet rated</span>');
((($j("#overall12").length)>0) && rating12 > 0) ? $j("#overall12").progressBar(rating12,{barImage: 'images/progressbg_purple.png'}) : $j("#overall12").html('<span>Not yet rated</span>');
((($j("#overall13").length)>0) && rating13 > 0) ? $j("#overall13").progressBar(rating13,{barImage: 'images/progressbg_purple.png'}) : $j("#overall13").html('<span>Not yet rated</span>');
((($j("#overall14").length)>0) && rating14 > 0) ? $j("#overall14").progressBar(rating14,{barImage: 'images/progressbg_purple.png'}) : $j("#overall14").html('<span>Not yet rated</span>');
((($j("#overall15").length)>0) && rating15 > 0) ? $j("#overall15").progressBar(rating15,{barImage: 'images/progressbg_purple.png'}) : $j("#overall15").html('<span>Not yet rated</span>');
/*--- ende 6th october 2010 - survey bar dynamic overall ratings from survey gizmo ---*/
}
});
return false;
});
// end ajax form search
//
// paging triggers search
$j('ul.paging li a').live("click",function() {
$j("#pages").empty();
$j("#loading").loading({img: 'elements/images/loader.gif'});
var searchvalues = $j("#bfbsearch").serialize();
var pagenumber = $j(this).html();
searchvalues+= "&showpage="+pagenumber;
var sorttype = $j('#sorttype').val();
searchvalues+= "&search_orderby="+sorttype;
$j.ajax({
type: "POST",
url: "scripts/xhr_get_search2.php",
cache: false,
data: searchvalues,
success: function(html){
location.href="#listingtopstrip";
$j("#loading").loading(false).empty();
var newhtml = html.split("---");
var results = newhtml[2].split("###");
$j("#searchreturned").fadeOut(200).empty().html(newhtml[0]).fadeIn(250).show();
$j("#listing_displayresults").empty().html(newhtml[1]).fadeIn(400).show()
$j(".listingblock").effect("highlight", {}, 1500);
$j("#pages, #pages_bottom").empty().html(newhtml[4]).show();
$j("#results_checkin").empty().html(results[0]).show();
$j("#results_nights").empty().html(results[1]).show();
$j("#results_guests").empty().html(results[2]).show();
//$j("#bfbnocache").val(newhtml[5]);
//console.log(newhtml[5]);
$j("#datestrip").show();
/*---6th october 2010 - survey bar dynamic overall ratings from survey gizmo ---*/
var rating1 = $j('#rating1').html();
var rating2 = $j('#rating2').html();
var rating3 = $j('#rating3').html();
var rating4 = $j('#rating4').html();
var rating5 = $j('#rating5').html();
var rating6 = $j('#rating6').html();
var rating7 = $j('#rating7').html();
var rating8 = $j('#rating8').html();
var rating9 = $j('#rating9').html();
var rating10 = $j('#rating10').html();
var rating11 = $j('#rating11').html();
var rating12 = $j('#rating12').html();
var rating13 = $j('#rating13').html();
var rating14 = $j('#rating14').html();
var rating15 = $j('#rating15').html();
// build dem bars
((($j("#overall1").length)>0) && rating1 > 0) ? $j("#overall1").progressBar(rating1,{barImage: 'images/progressbg_purple.png'}) : $j("#overall1").html('<span>Not yet rated</span>');
((($j("#overall2").length)>0) && rating2 > 0) ? $j("#overall2").progressBar(rating2,{barImage: 'images/progressbg_purple.png'}) : $j("#overall2").html('<span>Not yet rated</span>');
((($j("#overall3").length)>0) && rating3 > 0) ? $j("#overall3").progressBar(rating3,{barImage: 'images/progressbg_purple.png'}) : $j("#overall3").html('<span>Not yet rated</span>');
((($j("#overall4").length)>0) && rating4 > 0) ? $j("#overall4").progressBar(rating4,{barImage: 'images/progressbg_purple.png'}) : $j("#overall4").html('<span>Not yet rated</span>');
((($j("#overall5").length)>0) && rating5 > 0) ? $j("#overall5").progressBar(rating5,{barImage: 'images/progressbg_purple.png'}) : $j("#overall5").html('<span>Not yet rated</span>');
((($j("#overall6").length)>0) && rating6 > 0) ? $j("#overall6").progressBar(rating6,{barImage: 'images/progressbg_purple.png'}) : $j("#overall6").html('<span>Not yet rated</span>');
((($j("#overall7").length)>0) && rating7 > 0) ? $j("#overall7").progressBar(rating7,{barImage: 'images/progressbg_purple.png'}) : $j("#overall7").html('<span>Not yet rated</span>');
((($j("#overall8").length)>0) && rating8 > 0) ? $j("#overall8").progressBar(rating8,{barImage: 'images/progressbg_purple.png'}) : $j("#overall8").html('<span>Not yet rated</span>');
((($j("#overall9").length)>0) && rating9 > 0) ? $j("#overall9").progressBar(rating9,{barImage: 'images/progressbg_purple.png'}) : $j("#overall9").html('<span>Not yet rated</span>');
((($j("#overall10").length)>0) && rating10 > 0) ? $j("#overall10").progressBar(rating10,{barImage: 'images/progressbg_purple.png'}) : $j("#overall10").html('<span>Not yet rated</span>');
((($j("#overall11").length)>0) && rating11 > 0) ? $j("#overall11").progressBar(rating11,{barImage: 'images/progressbg_purple.png'}) : $j("#overall11").html('<span>Not yet rated</span>');
((($j("#overall12").length)>0) && rating12 > 0) ? $j("#overall12").progressBar(rating12,{barImage: 'images/progressbg_purple.png'}) : $j("#overall12").html('<span>Not yet rated</span>');
((($j("#overall13").length)>0) && rating13 > 0) ? $j("#overall13").progressBar(rating13,{barImage: 'images/progressbg_purple.png'}) : $j("#overall13").html('<span>Not yet rated</span>');
((($j("#overall14").length)>0) && rating14 > 0) ? $j("#overall14").progressBar(rating14,{barImage: 'images/progressbg_purple.png'}) : $j("#overall14").html('<span>Not yet rated</span>');
((($j("#overall15").length)>0) && rating15 > 0) ? $j("#overall15").progressBar(rating15,{barImage: 'images/progressbg_purple.png'}) : $j("#overall15").html('<span>Not yet rated</span>');
/*--- ende 6th october 2010 - survey bar dynamic overall ratings from survey gizmo ---*/
}
});
return false;
});
// sort
$j("#sorttype").change( function() {
$j("#pages").empty();
$j("#loading").loading({img: 'elements/images/loader.gif'});
var searchvalues = $j("#bfbsearch").serialize();
var sorttype = $j('#sorttype').val();
searchvalues+= "&search_orderby="+sorttype;
//var param_continent = $j('#param_continent').html();
//console.log(param_continent)
//alert (getparams);
/*if(param_continent!="") {
searchvalues+= "&search_continent="+param_continent;
}*/
$j.ajax({
type: "POST",
url: "scripts/xhr_get_search2.php",
cache: false,
data: searchvalues,
success: function(html){
location.href="#listingtopstrip";
$j("#loading").loading(false).empty();
var newhtml = html.split("---");
var results = newhtml[2].split("###");
$j("#searchreturned").fadeOut(200).empty().html(newhtml[0]).fadeIn(250).show();
$j("#listing_displayresults").empty().html(newhtml[1]).fadeIn(400).show()
$j(".listingblock").effect("highlight", {}, 1500);
$j("#pages, #pages_bottom").empty().html(newhtml[4]).show();
$j("#results_checkin").empty().html(results[0]).show();
$j("#results_nights").empty().html(results[1]).show();
$j("#results_guests").empty().html(results[2]).show();
//$j("#bfbnocache").val(newhtml[5]);
//console.log(newhtml[5]);
$j("#datestrip").show();
/*---6th october 2010 - survey bar dynamic overall ratings from survey gizmo ---*/
var rating1 = $j('#rating1').html();
var rating2 = $j('#rating2').html();
var rating3 = $j('#rating3').html();
var rating4 = $j('#rating4').html();
var rating5 = $j('#rating5').html();
var rating6 = $j('#rating6').html();
var rating7 = $j('#rating7').html();
var rating8 = $j('#rating8').html();
var rating9 = $j('#rating9').html();
var rating10 = $j('#rating10').html();
var rating11 = $j('#rating11').html();
var rating12 = $j('#rating12').html();
var rating13 = $j('#rating13').html();
var rating14 = $j('#rating14').html();
var rating15 = $j('#rating15').html();
// build dem bars
((($j("#overall1").length)>0) && rating1 > 0) ? $j("#overall1").progressBar(rating1,{barImage: 'images/progressbg_purple.png'}) : $j("#overall1").html('<span>Not yet rated</span>');
((($j("#overall2").length)>0) && rating2 > 0) ? $j("#overall2").progressBar(rating2,{barImage: 'images/progressbg_purple.png'}) : $j("#overall2").html('<span>Not yet rated</span>');
((($j("#overall3").length)>0) && rating3 > 0) ? $j("#overall3").progressBar(rating3,{barImage: 'images/progressbg_purple.png'}) : $j("#overall3").html('<span>Not yet rated</span>');
((($j("#overall4").length)>0) && rating4 > 0) ? $j("#overall4").progressBar(rating4,{barImage: 'images/progressbg_purple.png'}) : $j("#overall4").html('<span>Not yet rated</span>');
((($j("#overall5").length)>0) && rating5 > 0) ? $j("#overall5").progressBar(rating5,{barImage: 'images/progressbg_purple.png'}) : $j("#overall5").html('<span>Not yet rated</span>');
((($j("#overall6").length)>0) && rating6 > 0) ? $j("#overall6").progressBar(rating6,{barImage: 'images/progressbg_purple.png'}) : $j("#overall6").html('<span>Not yet rated</span>');
((($j("#overall7").length)>0) && rating7 > 0) ? $j("#overall7").progressBar(rating7,{barImage: 'images/progressbg_purple.png'}) : $j("#overall7").html('<span>Not yet rated</span>');
((($j("#overall8").length)>0) && rating8 > 0) ? $j("#overall8").progressBar(rating8,{barImage: 'images/progressbg_purple.png'}) : $j("#overall8").html('<span>Not yet rated</span>');
((($j("#overall9").length)>0) && rating9 > 0) ? $j("#overall9").progressBar(rating9,{barImage: 'images/progressbg_purple.png'}) : $j("#overall9").html('<span>Not yet rated</span>');
((($j("#overall10").length)>0) && rating10 > 0) ? $j("#overall10").progressBar(rating10,{barImage: 'images/progressbg_purple.png'}) : $j("#overall10").html('<span>Not yet rated</span>');
((($j("#overall11").length)>0) && rating11 > 0) ? $j("#overall11").progressBar(rating11,{barImage: 'images/progressbg_purple.png'}) : $j("#overall11").html('<span>Not yet rated</span>');
((($j("#overall12").length)>0) && rating12 > 0) ? $j("#overall12").progressBar(rating12,{barImage: 'images/progressbg_purple.png'}) : $j("#overall12").html('<span>Not yet rated</span>');
((($j("#overall13").length)>0) && rating13 > 0) ? $j("#overall13").progressBar(rating13,{barImage: 'images/progressbg_purple.png'}) : $j("#overall13").html('<span>Not yet rated</span>');
((($j("#overall14").length)>0) && rating14 > 0) ? $j("#overall14").progressBar(rating14,{barImage: 'images/progressbg_purple.png'}) : $j("#overall14").html('<span>Not yet rated</span>');
((($j("#overall15").length)>0) && rating15 > 0) ? $j("#overall15").progressBar(rating15,{barImage: 'images/progressbg_purple.png'}) : $j("#overall15").html('<span>Not yet rated</span>');
/*--- ende 6th october 2010 - survey bar dynamic overall ratings from survey gizmo ---*/
}
});
return false;
});

// shortlist finished 17th december 2010
$j('.propertyremove a').live("click",function() {
var propertycode = "";
var clickedproperty = $j(this).attr("id");
propertycode = clickedproperty.replace(/property/, '')
/*$j(".propertytick :checked").each(function() {
comparelist+= $j(this).attr("id") + ",";
});*/
alert("coda " + propertycode)
var removevalues = "removeproperty="+propertycode;
if(propertycode!="") {
$j.ajax({
type: "POST",
url: "scripts/xhr_shortlist.php",
cache: false,
data: removevalues,
success: function(html){
location.href="#listingtopstrip";
var newhtml = html.split("---");
//var results = newhtml[2].split("###");
//alert(newhtml);
$j("#searchreturned").fadeOut(200).empty().html(newhtml[0]).fadeIn(250).show();
$j("#listing_displayresults").empty().html(newhtml[1]).fadeIn(400).show();
$j("#pages, #pages_bottom").empty().html(newhtml[4]).fadeIn(400).show();
/*$j("#results_checkin").empty().html(results[0]).fadeIn(260).show();
$j("#results_nights").empty().html(results[1]).fadeIn(280).show();
$j("#results_guests").empty().html(results[2]).fadeIn(300).show();*/
}
});
}
return false;
});

// shortlist scoobing june 2010
$j('a#comparebutton').live("click",function() {
var comparelist = "";
$j(".propertytick :checked").each(function() {
comparelist+= $j(this).attr("id") + ",";
});
var searchvalues = "comparelist="+comparelist;
if(comparelist!="") {
$j.ajax({
type: "POST",
url: "scripts/xhr_get_search3.php",
cache: false,
data: searchvalues,
success: function(html){
location.href="#listingtopstrip";
var newhtml = html.split("---");
var results = newhtml[2].split("###");
$j("#searchreturned").fadeOut(200).empty().html(newhtml[0]).fadeIn(250).show();
$j("#listing_displayresults").empty().html(newhtml[1]).fadeIn(400).show();
$j("#pages, #pages_bottom").empty().html(newhtml[4]).fadeIn(400).show();
$j("#results_checkin").empty().html(results[0]).fadeIn(260).show();
$j("#results_nights").empty().html(results[1]).fadeIn(280).show();
$j("#results_guests").empty().html(results[2]).fadeIn(300).show();
}
});
}
return false;
});
// get regions when country changes
$j("#search_country").change( function() {
countrycode = $j('#search_country').val();
//alert(countrycode);
$j.ajax({
type: "GET",
url: "scripts/xhr_get_locations.php",
cache: false,
data: "countrycode=" + countrycode,
success: function(html){
$j('#search_region').empty();
$j('#search_region').html("<option value=\"\">any region</option>\n" + html);
$j("#search_region").css({
border: 'Solid #eaed7e 1px',
color: '#f4f5b8'
      });
}
});
});
$j(".resetbutton").click(function() {
$j('#bfbsearch')[0].reset();
$j("#searchbox").effect("highlight", "#b768a9", 1000);
});
// toggling
$j(".elementheader").click(function() {
$j(this).siblings(".searchelementcontent").toggle();
});

// toggling
$j(".searchelementcontent").hide();
$j("#searchblockadvanced .searchelementcontent").show();
$j("#nametrigger").click(function() {
$j("#nameblock").toggle();
$j("#nameblock").toggle();
if($j("#nameblock").is(":visible") && $j("#dateblock").is(":hidden")) {
$j("#quick").css("height", "297px");
} else if($j("#nameblock").is(":visible") && $j("#dateblock").is(":visible")) {
$j("#quick").css("height", "395px");
} else if($j("#nameblock").is(":hidden") && $j("#dateblock").is(":visible")) {
$j("#quick").css("height", "365px");
} else {
$j("#quick").css("height", "266px");
}
});
$j("#datetrigger").click(function() {
$j("#dateblock").toggle();
$j("#dateblock").toggle();
if($j("#nameblock").is(":visible") && $j("#dateblock").is(":hidden")) {
$j("#quick").css("height", "297px");
} else if($j("#nameblock").is(":visible") && $j("#dateblock").is(":visible")) {
$j("#quick").css("height", "395px");
} else if($j("#nameblock").is(":hidden") && $j("#dateblock").is(":visible")) {
$j("#quick").css("height", "365px");
} else {
$j("#quick").css("height", "266px");
}
});
// toggle advanced block
$j("#toggleadvanced").click(function() {
$j("#searchblockadvanced").toggle();
if($j("#searchblockadvanced").is(":hidden")) {
$j("#searchblock").css("height", "175px");
} else {
$j("#searchblock").css("height", "1550px");
}
});
$j('#bfbcomments').cycle({fx: 'fade', timeout: 7500});

/*$j("a.show_listingmap").click(function() {
var thisid = $j(this).attr("id");
var listingparts = thisid.split("listing");
var listingparts2 = listingparts[1].split("map");
var propertyID = listingparts2[0];
var propertyCode = listingparts2[1];
showBingMap('http://secure.supercontrol.co.uk/maps/vemap.asp?id='+propertyID, propertyCode);
return false;
});*/

// shortlist completion january 2011
/*$j('a#updateshortlist').live("click",function() {
var comparelist = "";
$j(".propertytick :checked").each(function() {
comparelist+= $j(this).attr("id") + ",";
});
var searchvalues = "comparelist="+comparelist;
if(comparelist!="") {
$j.ajax({
type: "POST",
url: "scripts/xhr_update_shortlist.php",
cache: false,
data: searchvalues,
success: function(html){
if (html == 0) {
$j.facebox("<p class='alert'>Error</p><p class='dialogtext'>Your BFB Shortlist is empty</p>");
} else if (html == 1) {
$j.facebox("<p class='success'>BFB Shortlist</p><p class='dialogtext'>Your shortlist of properties can be viewed, edited and emailed to you in the Shortlist page.</a>.</p>");
}
}
});
}
return false;
});*/


// shortlist amended version 19th january 2011
$j('.propertytick').live("click",function() {
var comparelist = "";
$j(".propertytick :checked").each(function() {
comparelist+= $j(this).attr("id") + ",";
});
var searchvalues = "comparelist="+comparelist;
if(comparelist!="") {
$j.ajax({
type: "POST",
url: "scripts/xhr_update_shortlist.php",
cache: false,
data: searchvalues,
success: function(html){
if (html == 0) {
$j.facebox("<p class='alert'>Error</p><p class='dialogtext'>Your BFB Shortlist is empty</p>");
} else if (html == 1) {
$j.facebox("<p class='success'>BFB Shortlist</p><p class='dialogtext'>Property added to your BFB Shortlist.</a>.</p>");
}
}
});
}
return false;
});

Shadowbox.init({
overlayOpacity: 0
});

// end of document ready
});
