$(function(){ // IE6 Background image flicker remove. try { document.execCommand('BackgroundImageCache', false, true); } catch(e) {} // DATEPICKER settings $.datepicker.setDefaults({ closeAtTop:false, dateFormat:'dd/mm/yy', speed:'' }); //German $.datepicker.regional['de'] = { clearText:'Löschen', closeText:'Schließen', prevText:'<Zurück', nextText:'Vor>', currentText:'Heute', dayNames:['So','Mo','Di','Mi','Do','Fr','Sa'], monthNames:['Januar','Februar','März','April','Mai','Juni','Juli','August','September','Oktober','November','Dezember'], firstDay:0 }; if (language() != 'uk') { $.datepicker.setDefaults($.datepicker.regional[language()]); } $('#locale-chn select').change(function() { $('#locale-chn').submit(); }); $('#lango').remove(); $('.lbox').click(function() { return openFrame($(this).attr('href')); }); $('#impress a').click(function() { window.open(this.href,'',$(this).attr('rel')); return false; }); backTop(); }); function go() { if (language()) location.href = destination; } function language() { return "uk"; } function shitBrowser() { return ($.browser.msie && $.browser.version < 7); } function openFrame(lboxLink) { var lbox = lboxLink.split('='); if (lbox.length > 1) { var startHtml = '
'; var endHtml = 'Close
'; if (shitBrowser()) { $.get('/'+ language() + '/lbox/'+lbox[1]+'.php','',function(txt) { $('body').append(startHtml + txt + endHtml); $('#lbox-shade').bgiframe(); var wholeHeight = ($(document).height() > $(window).height() ? $(document).height() : $(window).height()); if (shitBrowser()) { $('#lbox-shade').height(wholeHeight); } var lboxOffset = (($(window).height() - $('.lboxwin').height()) / 2) + 'px'; $('.lboxwin').css({ top : lboxOffset }); }); } else { $.get('/'+ language() + '/lbox/'+lbox[1]+'.php','',function(txt) { $('body').append(startHtml + txt + endHtml); $('#lbox-shade').bgiframe(); }); var wholeHeight = ($(document).height() > $(window).height() ? $(document).height() : $(window).height()); if (shitBrowser()) { $('#lbox-shade').height(wholeHeight); } var lboxOffset = (($(window).height() - $('.lboxwin').height()) / 2) + 'px'; $('.lboxwin').css({ top : lboxOffset }); } return false; } } function closeFrame() { $('#lbox-shade').remove(); return false; } function printButton() { var copy = 'Print'; if (language() == 'de') { copy = 'Drucken'; } $('h2:first').before(''+copy+''); } function backTop() { var copy = 'Back to top'; if (language() == 'de') { copy = 'Nach oben'; } if (shitBrowser()) { $('#back_top').remove(); $('#textstuff h4').after(''+copy+''); } else { if (($(document).height() + ($(window).height()/2)) < $(window).height()) { $('#back_top').css({ display : 'none' }); } $('#back_top').click(function() { window.scroll(0,0); return false; }); } } function showMap(loc,lat,lng,zoom,lab) { if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById(loc)); map.setCenter(new GLatLng(lat,lng),zoom); } var baseIcon = new GIcon(); baseIcon.iconSize = new GSize(20,15); baseIcon.iconAnchor = new GPoint(0,0); var hertzIcon = new GIcon(baseIcon); hertzIcon.image = '/img/graph/map-marker.png'; markerOptions = { icon:hertzIcon }; var point = new GLatLng(lat,lng); map.addOverlay(new GMarker(point,markerOptions)); } function loadPhoto(carousel,photo) { switch (carousel) { case 'alicante' : $('#alicante').load('/libs/ajax/photo.php',{ carousel : carousel, photo : photo }); break; case 'benidorm' : $('#benidorm').load('/libs/ajax/photo.php',{ carousel : carousel, photo : photo }); break; case 'elche' : $('#elche').load('/libs/ajax/photo.php',{ carousel : carousel, photo : photo }); break; case 'malaga' : $('#malaga').load('/libs/ajax/photo.php',{ carousel : carousel, photo : photo }); break; case 'torremolinos' : $('#torremolinos').load('/libs/ajax/photo.php',{ carousel : carousel, photo : photo }); break; case 'fuengirola' : $('#fuengirola').load('/libs/ajax/photo.php',{ carousel : carousel, photo : photo }); break; } return false; }