//
// $Id: seminarhotels.js 1043 2008-12-29 20:19:37Z  $
//
// COMMUNITOR SiteWare 2.0 Site Server
// Copyright by COMMUNITOR Internetservice GmbH, 2001-2008
//

var SWtoggleOn = function (item) {
  item.setImage(item.getImage().replace("-b","-a"));
};
var SWtoggleOff = function (item) {
  item.setImage(item.getImage().replace("-a","-b"));
};
var SWtoggle = function (btn,fktn) {
  $(btn).rolloverHandlers.invoke(fktn);
};
var SWshowGeo = function (mode,fast) {
  if (this.showGeo == mode) return;
  this.showGeo = mode;
  if (fast) {
    mode ? $('idGeoSearch1').setOpacity(1).setStyle({zIndex: 100}).show() : $('idGeoSearch1').hide();
    mode ? $('idGeoSearch2').setOpacity(1).setStyle({visibility:'visible'}) : $('idGeoSearch2').setStyle({visibility:'hidden'}).setOpacity(0);
    if (!$('geosuche').rolloverHandlers) {
      setTimeout("SWtoggle('geosuche',"+(mode ? SWtoggleOn : SWtoggleOff)+")", 500);
    } else {
      SWtoggle('geosuche', mode ? SWtoggleOn : SWtoggleOff);
    }
  } else {
    new Effect.Opacity('idGeoSearch1',mode?{beforeStart:function(){$('idGeoSearch1').setOpacity(0.2).setStyle({zIndex: 100}).show()},from:0.2,to:1.0,afterFinish:function(){$('geosuche').rolloverHandlers.map(SWtoggleOn);}}:{from:1.0,to:0.2,beforeStart:function(){$('idGeoSearch1').setStyle({zIndex: 1})},afterFinish:function(){$('idGeoSearch1').hide();$('geosuche').rolloverHandlers.map(SWtoggleOff);}});
    new Effect.Opacity('idGeoSearch2',mode?{beforeStart:function(){$('idGeoSearch2').setOpacity(0.2).setStyle({visibility:'visible'})},from:0.2,to:1.0}:{from:1.0,to:0.2,afterFinish:function(){$('idGeoSearch2').setStyle({visibility:'hidden'})}});
  }
};
var SWshowDetail = function (mode,fast) {
  if (this.showDetail == mode) return;
  this.showDetail = mode;
  if (fast) {
    mode ? $('idDetailSearch1').setOpacity(1).setStyle({zIndex: 100}).show() : $('idDetailSearch1').hide();
    if (!$('detailsuche').rolloverHandlers) {
      setTimeout("SWtoggle('detailsuche',"+(mode ? SWtoggleOn : SWtoggleOff)+")", 500);
    } else {
      SWtoggle('detailsuche', mode ? SWtoggleOn : SWtoggleOff);
    }
  } else {
    new Effect.Opacity('idDetailSearch1',mode?{beforeStart:function(){$('idDetailSearch1').setOpacity(0.2).setStyle({zIndex: 100}).show()},from:0.2,to:1.0,afterFinish:function(){$('detailsuche').rolloverHandlers.map(SWtoggleOn);}}:{from:1.0,to:0.2,beforeStart:function(){$('idDetailSearch1').setStyle({zIndex: 1})},afterFinish:function(){$('idDetailSearch1').hide();$('detailsuche').rolloverHandlers.map(SWtoggleOff);}});
  }
};
var SWselectSearch = function (what,fast) {
  if (what == "geo") {
    SWshowGeo(true,fast);
    SWshowDetail(false,fast);
  } else {
    SWshowGeo(false,fast);
    SWshowDetail(true,fast);
  }
}
