/* * Date prototype extensions. Doesn't depend on any * other code. Doens't overwrite existing methods. * * Adds dayNames, abbrDayNames, monthNames and abbrMonthNames static properties and isLeapYear, * isWeekend, isWeekDay, getDaysInMonth, getDayName, getMonthName, getDayOfYear, getWeekOfYear, * setDayOfYear, addYears, addMonths, addDays, addHours, addMinutes, addSeconds methods * * Copyright (c) 2006 Jörn Zaefferer and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net) * * Additional methods and properties added by Kelvin Luck: firstDayOfWeek, dateFormat, zeroTime, asString, fromString - * I've added my name to these methods so you know who to blame if they are broken! * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * */ /** * An Array of day names starting with Sunday. * * @example dayNames[0] * @result 'Sunday' * * @name dayNames * @type Array * @cat Plugins/Methods/Date */ Date.dayNames = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; /** * An Array of abbreviated day names starting with Sun. * * @example abbrDayNames[0] * @result 'Sun' * * @name abbrDayNames * @type Array * @cat Plugins/Methods/Date */ Date.abbrDayNames = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; /** * An Array of month names starting with Janurary. * * @example monthNames[0] * @result 'January' * * @name monthNames * @type Array * @cat Plugins/Methods/Date */ Date.monthNames = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; /** * An Array of abbreviated month names starting with Jan. * * @example abbrMonthNames[0] * @result 'Jan' * * @name monthNames * @type Array * @cat Plugins/Methods/Date */ Date.abbrMonthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; /** * The first day of the week for this locale. * * @name firstDayOfWeek * @type Number * @cat Plugins/Methods/Date * @author Kelvin Luck */ Date.firstDayOfWeek = 1; /** * The format that string dates should be represented as (e.g. 'dd/mm/yyyy' for UK, 'mm/dd/yyyy' for US, 'yyyy-mm-dd' for Unicode etc). * * @name format * @type String * @cat Plugins/Methods/Date * @author Kelvin Luck */ Date.format = 'dd/mm/yyyy'; //Date.format = 'mm/dd/yyyy'; //Date.format = 'yyyy-mm-dd'; //Date.format = 'dd mmm yy'; /** * The first two numbers in the century to be used when decoding a two digit year. Since a two digit year is ambiguous (and date.setYear * only works with numbers < 99 and so doesn't allow you to set years after 2000) we need to use this to disambiguate the two digit year codes. * * @name format * @type String * @cat Plugins/Methods/Date * @author Kelvin Luck */ Date.fullYearStart = '20'; (function() { /** * Adds a given method under the given name * to the Date prototype if it doesn't * currently exist. * * @private */ function add(name, method) { if( !Date.prototype[name] ) { Date.prototype[name] = method; } }; /** * Checks if the year is a leap year. * * @example var dtm = new Date("01/12/2008"); * dtm.isLeapYear(); * @result true * * @name isLeapYear * @type Boolean * @cat Plugins/Methods/Date */ add("isLeapYear", function() { var y = this.getFullYear(); return (y%4==0 && y%100!=0) || y%400==0; }); /** * Checks if the day is a weekend day (Sat or Sun). * * @example var dtm = new Date("01/12/2008"); * dtm.isWeekend(); * @result false * * @name isWeekend * @type Boolean * @cat Plugins/Methods/Date */ add("isWeekend", function() { return this.getDay()==0 || this.getDay()==6; }); /** * Check if the day is a day of the week (Mon-Fri) * * @example var dtm = new Date("01/12/2008"); * dtm.isWeekDay(); * @result false * * @name isWeekDay * @type Boolean * @cat Plugins/Methods/Date */ add("isWeekDay", function() { return !this.isWeekend(); }); /** * Gets the number of days in the month. * * @example var dtm = new Date("01/12/2008"); * dtm.getDaysInMonth(); * @result 31 * * @name getDaysInMonth * @type Number * @cat Plugins/Methods/Date */ add("getDaysInMonth", function() { return [31,(this.isLeapYear() ? 29:28),31,30,31,30,31,31,30,31,30,31][this.getMonth()]; }); /** * Gets the name of the day. * * @example var dtm = new Date("01/12/2008"); * dtm.getDayName(); * @result 'Saturday' * * @example var dtm = new Date("01/12/2008"); * dtm.getDayName(true); * @result 'Sat' * * @param abbreviated Boolean When set to true the name will be abbreviated. * @name getDayName * @type String * @cat Plugins/Methods/Date */ add("getDayName", function(abbreviated) { return abbreviated ? Date.abbrDayNames[this.getDay()] : Date.dayNames[this.getDay()]; }); /** * Gets the name of the month. * * @example var dtm = new Date("01/12/2008"); * dtm.getMonthName(); * @result 'Janurary' * * @example var dtm = new Date("01/12/2008"); * dtm.getMonthName(true); * @result 'Jan' * * @param abbreviated Boolean When set to true the name will be abbreviated. * @name getDayName * @type String * @cat Plugins/Methods/Date */ add("getMonthName", function(abbreviated) { return abbreviated ? Date.abbrMonthNames[this.getMonth()] : Date.monthNames[this.getMonth()]; }); /** * Get the number of the day of the year. * * @example var dtm = new Date("01/12/2008"); * dtm.getDayOfYear(); * @result 11 * * @name getDayOfYear * @type Number * @cat Plugins/Methods/Date */ add("getDayOfYear", function() { var tmpdtm = new Date("1/1/" + this.getFullYear()); return Math.floor((this.getTime() - tmpdtm.getTime()) / 86400000); }); /** * Get the number of the week of the year. * * @example var dtm = new Date("01/12/2008"); * dtm.getWeekOfYear(); * @result 2 * * @name getWeekOfYear * @type Number * @cat Plugins/Methods/Date */ add("getWeekOfYear", function() { return Math.ceil(this.getDayOfYear() / 7); }); /** * Set the day of the year. * * @example var dtm = new Date("01/12/2008"); * dtm.setDayOfYear(1); * dtm.toString(); * @result 'Tue Jan 01 2008 00:00:00' * * @name setDayOfYear * @type Date * @cat Plugins/Methods/Date */ add("setDayOfYear", function(day) { this.setMonth(0); this.setDate(day); return this; }); /** * Add a number of years to the date object. * * @example var dtm = new Date("01/12/2008"); * dtm.addYears(1); * dtm.toString(); * @result 'Mon Jan 12 2009 00:00:00' * * @name addYears * @type Date * @cat Plugins/Methods/Date */ add("addYears", function(num) { this.setFullYear(this.getFullYear() + num); return this; }); /** * Add a number of months to the date object. * * @example var dtm = new Date("01/12/2008"); * dtm.addMonths(1); * dtm.toString(); * @result 'Tue Feb 12 2008 00:00:00' * * @name addMonths * @type Date * @cat Plugins/Methods/Date */ add("addMonths", function(num) { var tmpdtm = this.getDate(); this.setMonth(this.getMonth() + num); if (tmpdtm > this.getDate()) this.addDays(-this.getDate()); return this; }); /** * Add a number of days to the date object. * * @example var dtm = new Date("01/12/2008"); * dtm.addDays(1); * dtm.toString(); * @result 'Sun Jan 13 2008 00:00:00' * * @name addDays * @type Date * @cat Plugins/Methods/Date */ add("addDays", function(num) { //this.setDate(this.getDate() + num); this.setTime(this.getTime() + (num*86400000) ); return this; }); /** * Add a number of hours to the date object. * * @example var dtm = new Date("01/12/2008"); * dtm.addHours(24); * dtm.toString(); * @result 'Sun Jan 13 2008 00:00:00' * * @name addHours * @type Date * @cat Plugins/Methods/Date */ add("addHours", function(num) { this.setHours(this.getHours() + num); return this; }); /** * Add a number of minutes to the date object. * * @example var dtm = new Date("01/12/2008"); * dtm.addMinutes(60); * dtm.toString(); * @result 'Sat Jan 12 2008 01:00:00' * * @name addMinutes * @type Date * @cat Plugins/Methods/Date */ add("addMinutes", function(num) { this.setMinutes(this.getMinutes() + num); return this; }); /** * Add a number of seconds to the date object. * * @example var dtm = new Date("01/12/2008"); * dtm.addSeconds(60); * dtm.toString(); * @result 'Sat Jan 12 2008 00:01:00' * * @name addSeconds * @type Date * @cat Plugins/Methods/Date */ add("addSeconds", function(num) { this.setSeconds(this.getSeconds() + num); return this; }); /** * Sets the time component of this Date to zero for cleaner, easier comparison of dates where time is not relevant. * * @example var dtm = new Date(); * dtm.zeroTime(); * dtm.toString(); * @result 'Sat Jan 12 2008 00:01:00' * * @name zeroTime * @type Date * @cat Plugins/Methods/Date * @author Kelvin Luck */ add("zeroTime", function() { this.setMilliseconds(0); this.setSeconds(0); this.setMinutes(0); this.setHours(0); return this; }); /** * Returns a string representation of the date object according to Date.format. * (Date.toString may be used in other places so I purposefully didn't overwrite it) * * @example var dtm = new Date("01/12/2008"); * dtm.asString(); * @result '12/01/2008' // (where Date.format == 'dd/mm/yyyy' * * @name asString * @type Date * @cat Plugins/Methods/Date * @author Kelvin Luck */ add("asString", function(format) { var r = format || Date.format; return r .split('yyyy').join(this.getFullYear()) .split('yy').join((this.getFullYear() + '').substring(2)) .split('mmmm').join(this.getMonthName(false)) .split('mmm').join(this.getMonthName(true)) .split('mm').join(_zeroPad(this.getMonth()+1)) .split('dd').join(_zeroPad(this.getDate())) .split('hh').join(_zeroPad(this.getHours())) .split('min').join(_zeroPad(this.getMinutes())) .split('ss').join(_zeroPad(this.getSeconds())); }); /** * Returns a new date object created from the passed String according to Date.format or false if the attempt to do this results in an invalid date object * (We can't simple use Date.parse as it's not aware of locale and I chose not to overwrite it incase it's functionality is being relied on elsewhere) * * @example var dtm = Date.fromString("12/01/2008"); * dtm.toString(); * @result 'Sat Jan 12 2008 00:00:00' // (where Date.format == 'dd/mm/yyyy' * * @name fromString * @type Date * @cat Plugins/Methods/Date * @author Kelvin Luck */ Date.fromString = function(s, format) { var f = format || Date.format; var d = new Date('01/01/1977'); var mLength = 0; var iM = f.indexOf('mmmm'); if (iM > -1) { for (var i=0; i -1) { var mStr = s.substr(iM, 3); for (var i=0; i -1) { if (iM < iY) { iY += mLength; } d.setFullYear(Number(s.substr(iY, 4))); } else { if (iM < iY) { iY += mLength; } // TODO - this doesn't work very well - are there any rules for what is meant by a two digit year? d.setFullYear(Number(Date.fullYearStart + s.substr(f.indexOf('yy'), 2))); } var iD = f.indexOf('dd'); if (iM < iD) { iD += mLength; } d.setDate(Number(s.substr(iD, 2))); if (isNaN(d.getTime())) { return false; } return d; }; // utility method var _zeroPad = function(num) { var s = '0'+num; return s.substring(s.length-2) //return ('0'+num).substring(-2); // doesn't work on IE :( }; })(); // EInsert.js // // This Javascript is provided by Mike Williams // Community Church Javascript Team // http://www.bisphamchurch.org.uk/ // http://econym.org.uk/gmap/ // // This work is licenced under a Creative Commons Licence // http://creativecommons.org/licenses/by/2.0/uk/ // // Version 0.0 Experimental Version - no transparent PNG support in IE // Version 0.1 Initial release version - AlphaImageLoader for IE added // Version 0.2 Wasn't positioning to the centre of the insert correctly // Version 0.3 Add zindex parameter // Version 1.0 Add .makeDraggable() [requires API v2.59] // Version 1.1 18/10/2006 use pane 1 instead of G_MAP_MAP_PANE so as to be above GTileLayerOverlay()s // Version 1.2 02/04/2007 work with MarkerManager // Version 1.3 16/05/2007 Add isHidden(), supportsHide(), setImage(), setZindex(), setSize() and setPoint() // Version 1.4 17/09/2007 Remove direct reference to the "map" variable (thanks to Philippe Matet) // Version 1.5 21/01/2008 EInsert.groundOverlay() // Version 1.6 29/10/2009 Fix EInsert.groundOverlay() bug: didn't cope with bounds that crossed the dateline function EInsert(point, image, size, basezoom, zindex) { this.point = point; this.image = image; this.size = size; this.basezoom = basezoom; this.zindex=zindex||0; // Is this IE, if so we need to use AlphaImageLoader var agent = navigator.userAgent.toLowerCase(); if ((agent.indexOf("msie") > -1) && (agent.indexOf("opera") < 1)){this.ie = true} else {this.ie = false} this.hidden = false; } EInsert.prototype = new GOverlay(); EInsert.prototype.initialize = function(map) { var div = document.createElement("div"); div.style.position = "absolute"; div.style.zIndex=this.zindex; if (this.zindex < 0) { map.getPane(G_MAP_MAP_PANE).appendChild(div); } else { map.getPane(1).appendChild(div); } this.map_ = map; this.div_ = div; } EInsert.prototype.makeDraggable = function() { this.dragZoom_ = this.map_.getZoom(); this.dragObject = new GDraggableObject(this.div_); this.dragObject.parent = this; GEvent.addListener(this.dragObject, "dragstart", function() { this.parent.left=this.left; this.parent.top=this.top; }); GEvent.addListener(this.dragObject, "dragend", function() { var pixels = this.parent.map_.fromLatLngToDivPixel(this.parent.point); var newpixels = new GPoint(pixels.x + this.left - this.parent.left, pixels.y +this.top -this.parent.top); this.parent.point = this.parent.map_.fromDivPixelToLatLng(newpixels); this.parent.redraw(true); GEvent.trigger(this.parent, "dragend", this.parent.point); }); } EInsert.prototype.remove = function() { this.div_.parentNode.removeChild(this.div_); } EInsert.prototype.copy = function() { return new EInsert(this.point, this.image, this.size, this.basezoom); } EInsert.prototype.redraw = function(force) { if (force) { var p = this.map_.fromLatLngToDivPixel(this.point); var z = this.map_.getZoom(); var scale = Math.pow(2,(z - this.basezoom)); var h=this.size.height * scale; var w=this.size.width * scale; this.div_.style.left = (p.x - w/2) + "px"; this.div_.style.top = (p.y - h/2) + "px"; if (this.ie) { var loader = "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.image+"', sizingMethod='scale');"; this.div_.innerHTML = '
'; } else { this.div_.innerHTML = ''; } // Only draggable if current zoom = the initial zoom if (this.dragObject) { if (z != this.dragZoom_) {this.dragObject.disable();} } } } EInsert.prototype.show = function() { this.div_.style.display=""; this.hidden = false; } EInsert.prototype.hide = function() { this.div_.style.display="none"; this.hidden = true; } EInsert.prototype.getPoint = function() { return this.point; } EInsert.prototype.supportsHide = function() { return true; } EInsert.prototype.isHidden = function() { return this.hidden; } EInsert.prototype.setPoint = function(a) { this.point = a; this.redraw(true); } EInsert.prototype.setImage = function(a) { this.image = a; this.redraw(true); } EInsert.prototype.setZindex = function(a) { this.div_.style.zIndex=a; } EInsert.prototype.setSize = function(a) { this.size = a; this.redraw(true); } EInsert.groundOverlay = function(image, bounds, zIndex, proj,z) { var proj = proj||G_NORMAL_MAP.getProjection(); var z = z||17; var sw = proj.fromLatLngToPixel(bounds.getSouthWest(),z); var ne = proj.fromLatLngToPixel(bounds.getNorthEast(),z); if (sw.x <= ne.x) {var nex=ne.x} else {var nex=ne.x+(256*Math.pow(2,z))} var cPixel = new GPoint((sw.x+nex)/2, (sw.y+ne.y)/2); var c = proj.fromPixelToLatLng(cPixel,z); var s = new GSize(nex-sw.x, sw.y-ne.y); return new EInsert(c, image, s, z, zIndex); } // ELabel.js // // This Javascript is provided by Mike Williams // Community Church Javascript Team // http://www.bisphamchurch.org.uk/ // http://econym.org.uk/gmap/ // // This work is licenced under a Creative Commons Licence // http://creativecommons.org/licenses/by/2.0/uk/ // // Version 0.2 the .copy() parameters were wrong // version 1.0 added .show() .hide() .setContents() .setPoint() .setOpacity() .overlap // version 1.1 Works with GMarkerManager in v2.67, v2.68, v2.69, v2.70 and v2.71 // version 1.2 Works with GMarkerManager in v2.72, v2.73, v2.74 and v2.75 // version 1.3 add .isHidden() // version 1.4 permit .hide and .show to be used before addOverlay() // version 1.5 fix positioning bug while label is hidden // version 1.6 added .supportsHide() // version 1.7 fix .supportsHide() // version 1.8 remove the old GMarkerManager support due to clashes with v2.143 function ELabel(point, html, classname, pixelOffset, percentOpacity, overlap) { // Mandatory parameters this.point = point; this.html = html; // Optional parameters this.classname = classname||""; this.pixelOffset = pixelOffset||new GSize(0,0); if (percentOpacity) { if(percentOpacity<0){percentOpacity=0;} if(percentOpacity>100){percentOpacity=100;} } this.percentOpacity = percentOpacity; this.overlap=overlap||false; this.hidden = false; } ELabel.prototype = new GOverlay(); ELabel.prototype.initialize = function(map) { var div = document.createElement("div"); div.style.position = "absolute"; div.innerHTML = '
' + this.html + '
' ; map.getPane(G_MAP_FLOAT_SHADOW_PANE).appendChild(div); this.map_ = map; this.div_ = div; if (this.percentOpacity) { if(typeof(div.style.filter)=='string'){div.style.filter='alpha(opacity:'+this.percentOpacity+')';} if(typeof(div.style.KHTMLOpacity)=='string'){div.style.KHTMLOpacity=this.percentOpacity/100;} if(typeof(div.style.MozOpacity)=='string'){div.style.MozOpacity=this.percentOpacity/100;} if(typeof(div.style.opacity)=='string'){div.style.opacity=this.percentOpacity/100;} } if (this.overlap) { var z = GOverlay.getZIndex(this.point.lat()); this.div_.style.zIndex = z; } if (this.hidden) { this.hide(); } } ELabel.prototype.remove = function() { this.div_.parentNode.removeChild(this.div_); } ELabel.prototype.copy = function() { return new ELabel(this.point, this.html, this.classname, this.pixelOffset, this.percentOpacity, this.overlap); } ELabel.prototype.redraw = function(force) { var p = this.map_.fromLatLngToDivPixel(this.point); var h = parseInt(this.div_.clientHeight); this.div_.style.left = (p.x + this.pixelOffset.width) + "px"; this.div_.style.top = (p.y +this.pixelOffset.height - h) + "px"; } ELabel.prototype.show = function() { if (this.div_) { this.div_.style.display=""; this.redraw(); } this.hidden = false; } ELabel.prototype.hide = function() { if (this.div_) { this.div_.style.display="none"; } this.hidden = true; } ELabel.prototype.isHidden = function() { return this.hidden; } ELabel.prototype.supportsHide = function() { return true; } ELabel.prototype.setContents = function(html) { this.html = html; this.div_.innerHTML = '
' + this.html + '
' ; this.redraw(true); } ELabel.prototype.setPoint = function(point) { this.point = point; if (this.overlap) { var z = GOverlay.getZIndex(this.point.lat()); this.div_.style.zIndex = z; } this.redraw(true); } ELabel.prototype.setOpacity = function(percentOpacity) { if (percentOpacity) { if(percentOpacity<0){percentOpacity=0;} if(percentOpacity>100){percentOpacity=100;} } this.percentOpacity = percentOpacity; if (this.percentOpacity) { if(typeof(this.div_.style.filter)=='string'){this.div_.style.filter='alpha(opacity:'+this.percentOpacity+')';} if(typeof(this.div_.style.KHTMLOpacity)=='string'){this.div_.style.KHTMLOpacity=this.percentOpacity/100;} if(typeof(this.div_.style.MozOpacity)=='string'){this.div_.style.MozOpacity=this.percentOpacity/100;} if(typeof(this.div_.style.opacity)=='string'){this.div_.style.opacity=this.percentOpacity/100;} } } ELabel.prototype.getPoint = function() { return this.point; } function askPopup(title, msg, actionuri){ $.fancybox('

'+title+'

'); } function tt_move(e){ w = $("#tooltip").outerWidth(); $("#tooltip").offset({ left:e.pageX - (w/2), top:e.pageY + 30 }); } function tt_show(msg){ $("#tooltip").html(msg); $(document).bind("mousemove", tt_move); $("#tooltip").fadeIn('fast'); } function tt_hide(){ $("#tooltip").fadeOut('fast', function(){ $(window).unbind("mousemove", tt_move); }); } function updateClock(){ var now = new Date(); var hh = now.getHours(); var mm = now.getMinutes(); if(hh<10)hh="0"+hh; if(mm<10)mm="0"+mm; $('#time').html(hh + ':' + mm); } function checkPM(){ $.getJSON(base_uri + '/json/community/checkpm/', function(data){ $('.numMessages').html(data.num); }); } var cur_slide = null; var now = new Date(); var h = now.getHours(); var noon = true; if(h > 6 && h < 18){ var slideshow = [ ["#bdd2e7","header-0-0.jpg"], ["#c6a579","header-0-2.jpg"], ["#fcdbab","header-0-3.jpg"], ["#65a5ce","header-0-4.jpg"], ["#858333","header-0-5.jpg"], ["#839eba","header-0-6.jpg"], ["#e3e4e4","header-0-7.jpg"], ["#67727d","header-0-15.jpg"], ["#afc662","header-0-18.jpg"], ["#78c5e3","header-0-19.jpg"] ]; } else { var slideshow = [ ["#274583","header-1-0.jpg"], ["#ffc666","header-1-1.jpg"], ["#a68667","header-1-2.jpg"], ["#d59e4a","header-1-3.jpg"], ["#664d3b","header-0-16.jpg"], ["#115e86","header-1-4.jpg"], ["#988367","header-1-5.jpg"], ["#a9a9a9","header-1-6.jpg"], ["#d59e4a","header-1-3.jpg"], ["#e2bc7e","header-0-17.jpg"] ]; } //while(slideshow.length < 59) slideshow = slideshow.concat(slideshow); function do_slideshow(init){ var now = new Date(); var mm = now.getMinutes(); mm = mm+''; if(mm.length > 1) var m = mm.substr(1,2); else var m = mm; var val = parseInt(m); if(cur_slide != val){ if(init) $('.slide:visible').hide(); else $('.slide:visible').fadeOut(4990); if(init) $('#slide-'+val).show(); else $('#slide-'+val).fadeIn(5000); var color = $('#slide-'+val).attr('rel'); if(init) $('body').css({ backgroundColor:color }); else $('body').animate({ backgroundColor:color },10000); cur_slide = val; } } function formCheck(){ $('form input').each(function(){ if($(this).attr('pholder')){ if($(this).val()=='') $(this).val($(this).attr('pholder')); $(this).focus(function(){ if($(this).val() == $(this).attr('pholder')) $(this).val(''); }); $(this).blur(function(){ if( $(this).val() == '') $(this).val($(this).attr('pholder')); }); } }); $('form').submit(function(e){ var thisform = this; $(thisform).addClass('notokay'); var err = false; $(this).find(':input').each(function(){ if($(this).attr('pholder')){ if($(this).val() == $(this).attr('pholder')) $(this).val(''); } if($(this).hasClass('required')){ if($(this).val() == '' || ($(this).is('input:checkbox') == true && $(this).attr('checked') == false)){ err = true; $(this).css({ outline:'2px solid #F29400' }); if($(this).attr('pholder')) $(this).val($(this).attr('pholder')); } else $(this).css({outline:'none'}); } if(err){ e.preventDefault(); }else $(thisform).removeClass('notokay'); }); }); } $(function(){ $('body').append(''); $('.search_result:even').addClass('even'); $('.floater label:even').addClass('even'); $('#content #events li:even').addClass('even'); $('table tr td:first-child').addClass('first'); $('.sidebar-left .thumbs a:nth-child(3n)').addClass('third'); $('.feedbody').each(function(){ var me = $(this); var img = me.children('img.caption'); if ($(me).hasClass('frontpage')) me.prev('h2').after(img); else me.prev('h2').before(img); var ratio = img.width() / img.height(); img.width(80); img.height(80/ratio); $(img).wrap('
'); }); $('ul#comments > li:even').addClass('even'); $('ul#comments > li:odd').addClass('odd'); $('.hide_next').next().hide(); $('.toggle_next').click(function(){ $(this).next().slideToggle(); }); $('.rating').each(function(){ var val = $(this).attr('rel'); if(val > 0){ for(var i = 0;i
'); } var rest = 5-i; for(i = 0;i'); } } }); $('#launcher a').attr('target', '_blank'); /*$('#clock').css({ opacity : .7 });*/ for(var i in slideshow){ $("#header").prepend('
'); } do_slideshow(true); /* window.setTimeout(do_slideshow, 500); window.setTimeout(do_slideshow, 1000); window.setTimeout(do_slideshow, 2000); window.setTimeout(do_slideshow, 3000); */ updateClock(); $('a.break_friend').click(function(e){ e.preventDefault(); askPopup("Freundschaft aufheben", "Wollen Sie die Freundschaft wirklich aufheben?", $(this).attr('href')); }); $('span.del_comment a').click(function(e){ e.preventDefault(); askPopup("Kommentar löschen?", "Wollen Sie den Eintrag wirklich löschen?", $(this).attr('href')); }); $('a.sendprofile').click(function(e){ e.preventDefault(); askPopup("Zugangsdaten versenden?", "Wollen sie den Partnern dieses Partnerhauses die Zugangsdaten per E-Mail übermitteln?
(Achtung: Dabei wird für diesen Partnerhaus-Login ein neues Passwort erzeugt!)
", $(this).attr('href')); }); $('.delete_pm').submit(function(){ Check = confirm("Wollen Sie die Nachricht(en) wirklich löschen?"); if (Check == true) return (true); else return (false); }); $('a.popup_delete').click(function(e){ e.preventDefault(); askPopup("Wirklich löschen?", "Wollen Sie diesen Eintrag wirklich löschen?", $(this).attr('href')); }); $('.tab:gt(0)').hide(); $('#tabs > a:first').addClass('active'); $('#tabs > a').click(function(e){ e.preventDefault(); $('.tab').hide(); $('#tabs > a.active').removeClass('active'); $(this).addClass('active'); $($(this).attr('href')).show(); }); window.setInterval(function(){ do_slideshow(); updateClock(); },5000); $("a.fb").fancybox(); formCheck(); //$('form').ketchup(); //$('form input[type="text"]').placeholder(); /* $('form input').each(function(){ if($(this).attr('pholder') && $(this).val()==''){ //var offset = $(this).offset(); //console.log(offset); var span = $('' + $(this).attr('pholder').replace(/ /g,' ') + ''); var placeholder = $(''); placeholder.css({position:'relative'}); placeholder.width($(this).width()); placeholder.height($(this).height()); $(this).wrap(placeholder).after(span); span.css({ position: 'absolute', lineHeight : $(this).outerHeight() + 'px', left:0, top:0 }); span.width(1); span.height($(this).height()); $(this).focus(function(){$(this).next('span').hide();}); $(this).blur(function(){ if($(this).val() == '') $(this).next('span').show(); }); } }); */ $('tr:odd').addClass('odd'); $('tr:even').addClass('even'); $('.text ul li:even').addClass('even'); $('.text ul li:odd').addClass('odd'); $('.date-pick').datePicker({ clickInput:true, createButton:false }); $('.ajax_popup').click(function(e){ e.preventDefault(); var href = $(this).attr('href'); href = href.replace(base_uri, base_uri + '/ajax'); $.get(href, function(data){ $.fancybox(data); }); }); $('.ajax_popup_form').live('click', function(e){ e.preventDefault(); var href = $(this).attr('href'); href = href.replace(base_uri, base_uri + '/ajax'); $.get(href, function(data){ $.fancybox('
' + data + '
'); $('.floater label:even').addClass('even'); var form = $('.ajax_form').find('form'); formCheck(); form.submit(function(e){ if($('#rating_form').length > 0){ if($(form).find('input[name="firstname"]').val() == '' || $(form).find('input[name="surname"]').val() == '' || $(form).find('textarea[name="comment"]').val() == '') $(form).addClass('notokay'); } e.preventDefault(); if (!$(this).hasClass('notokay')) { var action = $(this).attr('action').replace('ajax', ''); action = action.replace(base_uri, base_uri+'/json'); $.post(action, $(this).serializeArray(), function(data){ if(data.info_message){ $.fancybox(data.info_message); } }); } }); }); }); $('#select-country').change(function(){ $('#select-region').attr("disabled", true); $('#select-region').html(''); $.getJSON(base_uri+'/json/location/region/'+$(this).val(), function(data){ $('#select-region').append(''); for(var i in data){ $('#select-region').append(''); } $('#select-region').removeAttr("disabled"); }); }); /* $('#rate').click(function(e){ e.preventDefault(); $('#rating_form').slideToggle(function(){ //$('form').ketchup(); }); }); */ if ($.browser.msie && $.browser.version.substr(0,1)<8) { $('#sidebar').css({marginTop:0}); } }); var markers = []; var mc; var bbIcon = new GIcon(G_DEFAULT_ICON); bbIcon.image = theme_uri+'/img/bb-dot.png'; bbIcon.iconSize = new GSize(20, 34); var markerOptions = { icon:bbIcon }; var marker_options = markerOptions; var bbCountry = new GIcon(G_DEFAULT_ICON); bbCountry.image = theme_uri+'/img/bb-country.png'; bbCountry.iconSize = new GSize(80, 23); bbCountry.shadowSize = new GSize(0, 0); bbCountry.iconAnchor = new GPoint(12, 12); var markerOptionsCountry = { icon:bbCountry }; var bbRegion = new GIcon(G_DEFAULT_ICON); bbRegion.image = theme_uri+'/img/bb-region.png'; bbRegion.iconSize = new GSize(13, 13); bbRegion.shadowSize = new GSize(0, 0); bbRegion.iconAnchor = new GPoint(6, 6); var markerOptionsRegion = { icon:bbRegion }; var styles = [{ url: theme_uri+'/img/bubble-s.png', height: 26, width: 28, opt_anchor: [3, 0], opt_textColor: '#FFFFFF' }, { url: theme_uri+'/img/bubble-m.png', height: 33, width: 35, opt_anchor: [6, 0], opt_textColor: '#FFFFFF' }, { url: theme_uri+'/img/bubble-l.png', width: 44, height: 41, opt_anchor: [8, 0], opt_textColor: '#FFFFFF' }]; function createMarker(lat,lon,type,value,title) { mo = markerOptions; if(type == 'region') mo = markerOptionsRegion; if(type == 'country') mo = markerOptionsCountry; var marker = new GMarker(new GLatLng(lat,lon),mo); marker.value = value; marker.type = type; marker.title = title; markers.push(marker); return marker; } function zoomfit(bounds){ var sw = bounds.getSouthWest(); var nw = bounds.getNorthEast(); if (sw.x == nw.x && sw.y == nw.y) newzoom = 8; else newzoom = map.getBoundsZoomLevel(bounds); newcenter = bounds.getCenter(); map.setCenter (newcenter,newzoom); } /*! * jQuery UI 1.8 * * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI */ /* * jQuery UI 1.8 * * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI */ jQuery.ui||(function(a){a.ui={version:"1.8",plugin:{add:function(c,d,f){var e=a.ui[c].prototype;for(var b in f){e.plugins[b]=e.plugins[b]||[];e.plugins[b].push([d,f[b]])}},call:function(b,d,c){var f=b.plugins[d];if(!f||!b.element[0].parentNode){return}for(var e=0;e0){return true}e[b]=1;d=(e[b]>0);e[b]=0;return d},isOverAxis:function(c,b,d){return(c>b)&&(c<(b+d))},isOver:function(g,c,f,e,b,d){return a.ui.isOverAxis(g,f,b)&&a.ui.isOverAxis(c,e,d)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};a.fn.extend({_focus:a.fn.focus,focus:function(b,c){return typeof b==="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus();(c&&c.call(d))},b)}):this._focus.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var b;if((a.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){b=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(a.curCSS(this,"position",1))&&(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}else{b=this.parents().filter(function(){return(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!b.length?a(document):b},zIndex:function(e){if(e!==undefined){return this.css("zIndex",e)}if(this.length){var c=a(this[0]),b,d;while(c.length&&c[0]!==document){b=c.css("position");if(b=="absolute"||b=="relative"||b=="fixed"){d=parseInt(c.css("zIndex"));if(!isNaN(d)&&d!=0){return d}}c=c.parent()}}return 0}});a.extend(a.expr[":"],{data:function(d,c,b){return !!a.data(d,b[3])},focusable:function(c){var d=c.nodeName.toLowerCase(),b=a.attr(c,"tabindex");return(/input|select|textarea|button|object/.test(d)?!c.disabled:"a"==d||"area"==d?c.href||!isNaN(b):!isNaN(b))&&!a(c)["area"==d?"parents":"closest"](":hidden").length},tabbable:function(c){var b=a.attr(c,"tabindex");return(isNaN(b)||b>=0)&&a(c).is(":focusable")}})})(jQuery);;/* * jQuery UI Effects 1.8 * * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI/Effects/ */ jQuery.effects||(function(g){g.effects={};g.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(l,k){g.fx.step[k]=function(m){if(!m.colorInit){m.start=j(m.elem,k);m.end=i(m.end);m.colorInit=true}m.elem.style[k]="rgb("+Math.max(Math.min(parseInt((m.pos*(m.end[0]-m.start[0]))+m.start[0],10),255),0)+","+Math.max(Math.min(parseInt((m.pos*(m.end[1]-m.start[1]))+m.start[1],10),255),0)+","+Math.max(Math.min(parseInt((m.pos*(m.end[2]-m.start[2]))+m.start[2],10),255),0)+")"}});function i(l){var k;if(l&&l.constructor==Array&&l.length==3){return l}if(k=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(l)){return[parseInt(k[1],10),parseInt(k[2],10),parseInt(k[3],10)]}if(k=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(l)){return[parseFloat(k[1])*2.55,parseFloat(k[2])*2.55,parseFloat(k[3])*2.55]}if(k=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(l)){return[parseInt(k[1],16),parseInt(k[2],16),parseInt(k[3],16)]}if(k=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(l)){return[parseInt(k[1]+k[1],16),parseInt(k[2]+k[2],16),parseInt(k[3]+k[3],16)]}if(k=/rgba\(0, 0, 0, 0\)/.exec(l)){return a.transparent}return a[g.trim(l).toLowerCase()]}function j(m,k){var l;do{l=g.curCSS(m,k);if(l!=""&&l!="transparent"||g.nodeName(m,"body")){break}k="backgroundColor"}while(m=m.parentNode);return i(l)}var a={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};var e=["add","remove","toggle"],c={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};function f(){var n=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,o={},l,m;if(n&&n.length&&n[0]&&n[n[0]]){var k=n.length;while(k--){l=n[k];if(typeof n[l]=="string"){m=l.replace(/\-(\w)/g,function(p,q){return q.toUpperCase()});o[m]=n[l]}}}else{for(l in n){if(typeof n[l]==="string"){o[l]=n[l]}}}return o}function b(l){var k,m;for(k in l){m=l[k];if(m==null||g.isFunction(m)||k in c||(/scrollbar/).test(k)||(!(/color/i).test(k)&&isNaN(parseFloat(m)))){delete l[k]}}return l}function h(k,m){var n={_:0},l;for(l in m){if(k[l]!=m[l]){n[l]=m[l]}}return n}g.effects.animateClass=function(k,l,n,m){if(g.isFunction(n)){m=n;n=null}return this.each(function(){var r=g(this),o=r.attr("style")||" ",s=b(f.call(this)),q,p=r.attr("className");g.each(e,function(t,u){if(k[u]){r[u+"Class"](k[u])}});q=b(f.call(this));r.attr("className",p);r.animate(h(s,q),l,n,function(){g.each(e,function(t,u){if(k[u]){r[u+"Class"](k[u])}});if(typeof r.attr("style")=="object"){r.attr("style").cssText="";r.attr("style").cssText=o}else{r.attr("style",o)}if(m){m.apply(this,arguments)}})})};g.fn.extend({_addClass:g.fn.addClass,addClass:function(l,k,n,m){return k?g.effects.animateClass.apply(this,[{add:l},k,n,m]):this._addClass(l)},_removeClass:g.fn.removeClass,removeClass:function(l,k,n,m){return k?g.effects.animateClass.apply(this,[{remove:l},k,n,m]):this._removeClass(l)},_toggleClass:g.fn.toggleClass,toggleClass:function(m,l,k,o,n){if(typeof l=="boolean"||l===undefined){if(!k){return this._toggleClass(m,l)}else{return g.effects.animateClass.apply(this,[(l?{add:m}:{remove:m}),k,o,n])}}else{return g.effects.animateClass.apply(this,[{toggle:m},l,k,o])}},switchClass:function(k,m,l,o,n){return g.effects.animateClass.apply(this,[{add:m,remove:k},l,o,n])}});g.extend(g.effects,{version:"1.8",save:function(l,m){for(var k=0;k").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0});k.wrap(m);m=k.parent();if(k.css("position")=="static"){m.css({position:"relative"});k.css({position:"relative"})}else{g.extend(l,{position:k.css("position"),zIndex:k.css("z-index")});g.each(["top","left","bottom","right"],function(n,o){l[o]=k.css(o);if(isNaN(parseInt(l[o],10))){l[o]="auto"}});k.css({position:"relative",top:0,left:0})}return m.css(l).show()},removeWrapper:function(k){if(k.parent().is(".ui-effects-wrapper")){return k.parent().replaceWith(k)}return k},setTransition:function(l,n,k,m){m=m||{};g.each(n,function(p,o){unit=l.cssUnit(o);if(unit[0]>0){m[o]=unit[0]*k+unit[1]}});return m}});function d(l,k,m,n){if(typeof l=="object"){n=k;m=null;k=l;l=k.effect}if(g.isFunction(k)){n=k;m=null;k={}}if(g.isFunction(m)){n=m;m=null}if(typeof k=="number"||g.fx.speeds[k]){n=m;m=k;k={}}k=k||{};m=m||k.duration;m=g.fx.off?0:typeof m=="number"?m:g.fx.speeds[m]||g.fx.speeds._default;n=n||k.complete;return[l,k,m,n]}g.fn.extend({effect:function(n,m,p,q){var l=d.apply(this,arguments),o={options:l[1],duration:l[2],callback:l[3]},k=g.effects[n];return k&&!g.fx.off?k.call(this,o):this},_show:g.fn.show,show:function(l){if(!l||typeof l=="number"||g.fx.speeds[l]){return this._show.apply(this,arguments)}else{var k=d.apply(this,arguments);k[1].mode="show";return this.effect.apply(this,k)}},_hide:g.fn.hide,hide:function(l){if(!l||typeof l=="number"||g.fx.speeds[l]){return this._hide.apply(this,arguments)}else{var k=d.apply(this,arguments);k[1].mode="hide";return this.effect.apply(this,k)}},__toggle:g.fn.toggle,toggle:function(l){if(!l||typeof l=="number"||g.fx.speeds[l]||typeof l=="boolean"||g.isFunction(l)){return this.__toggle.apply(this,arguments)}else{var k=d.apply(this,arguments);k[1].mode="toggle";return this.effect.apply(this,k)}},cssUnit:function(k){var l=this.css(k),m=[];g.each(["em","px","%","pt"],function(n,o){if(l.indexOf(o)>0){m=[parseFloat(l),o]}});return m}});g.easing.jswing=g.easing.swing;g.extend(g.easing,{def:"easeOutQuad",swing:function(l,m,k,o,n){return g.easing[g.easing.def](l,m,k,o,n)},easeInQuad:function(l,m,k,o,n){return o*(m/=n)*m+k},easeOutQuad:function(l,m,k,o,n){return -o*(m/=n)*(m-2)+k},easeInOutQuad:function(l,m,k,o,n){if((m/=n/2)<1){return o/2*m*m+k}return -o/2*((--m)*(m-2)-1)+k},easeInCubic:function(l,m,k,o,n){return o*(m/=n)*m*m+k},easeOutCubic:function(l,m,k,o,n){return o*((m=m/n-1)*m*m+1)+k},easeInOutCubic:function(l,m,k,o,n){if((m/=n/2)<1){return o/2*m*m*m+k}return o/2*((m-=2)*m*m+2)+k},easeInQuart:function(l,m,k,o,n){return o*(m/=n)*m*m*m+k},easeOutQuart:function(l,m,k,o,n){return -o*((m=m/n-1)*m*m*m-1)+k},easeInOutQuart:function(l,m,k,o,n){if((m/=n/2)<1){return o/2*m*m*m*m+k}return -o/2*((m-=2)*m*m*m-2)+k},easeInQuint:function(l,m,k,o,n){return o*(m/=n)*m*m*m*m+k},easeOutQuint:function(l,m,k,o,n){return o*((m=m/n-1)*m*m*m*m+1)+k},easeInOutQuint:function(l,m,k,o,n){if((m/=n/2)<1){return o/2*m*m*m*m*m+k}return o/2*((m-=2)*m*m*m*m+2)+k},easeInSine:function(l,m,k,o,n){return -o*Math.cos(m/n*(Math.PI/2))+o+k},easeOutSine:function(l,m,k,o,n){return o*Math.sin(m/n*(Math.PI/2))+k},easeInOutSine:function(l,m,k,o,n){return -o/2*(Math.cos(Math.PI*m/n)-1)+k},easeInExpo:function(l,m,k,o,n){return(m==0)?k:o*Math.pow(2,10*(m/n-1))+k},easeOutExpo:function(l,m,k,o,n){return(m==n)?k+o:o*(-Math.pow(2,-10*m/n)+1)+k},easeInOutExpo:function(l,m,k,o,n){if(m==0){return k}if(m==n){return k+o}if((m/=n/2)<1){return o/2*Math.pow(2,10*(m-1))+k}return o/2*(-Math.pow(2,-10*--m)+2)+k},easeInCirc:function(l,m,k,o,n){return -o*(Math.sqrt(1-(m/=n)*m)-1)+k},easeOutCirc:function(l,m,k,o,n){return o*Math.sqrt(1-(m=m/n-1)*m)+k},easeInOutCirc:function(l,m,k,o,n){if((m/=n/2)<1){return -o/2*(Math.sqrt(1-m*m)-1)+k}return o/2*(Math.sqrt(1-(m-=2)*m)+1)+k},easeInElastic:function(l,n,k,u,r){var o=1.70158;var q=0;var m=u;if(n==0){return k}if((n/=r)==1){return k+u}if(!q){q=r*0.3}if(m1){J-=7}var O=Math.ceil(((-1*J+1)+K.getDaysInMonth())/7);K.addDays(J-1);var V=function(){if(P.hoverClass){D(this).addClass(P.hoverClass)}};var G=function(){if(P.hoverClass){D(this).removeClass(P.hoverClass)}};var L=0;while(L++'+D.dpText.TEXT_CHOOSE_DATE+"").bind("click",function(){G.dpDisplay(this);this.blur();return false});G.after(F.button)}if(!I&&G.is(":text")){G.bind("dateSelected",function(K,J,L){this.value=J.asString()}).bind("change",function(){if(this.value!=""){var J=Date.fromString(this.value);if(J){F.setSelected(J,true,true)}}});if(E.clickInput){G.bind("click",function(){G.dpDisplay()})}var H=Date.fromString(this.value);if(this.value!=""&&H){F.setSelected(H,true,true)}}G.addClass("dp-applied")})},dpSetDisabled:function(E){return B.call(this,"setDisabled",E)},dpSetStartDate:function(E){return B.call(this,"setStartDate",E)},dpSetEndDate:function(E){return B.call(this,"setEndDate",E)},dpGetSelected:function(){var E=C(this[0]);if(E){return E.getSelected()}return null},dpSetSelected:function(G,F,E){if(F==undefined){F=true}if(E==undefined){E=true}return B.call(this,"setSelected",Date.fromString(G),F,E,true)},dpSetDisplayedMonth:function(E,F){return B.call(this,"setDisplayedMonth",Number(E),Number(F),true)},dpDisplay:function(E){return B.call(this,"display",E)},dpSetRenderCallback:function(E){return B.call(this,"setRenderCallback",E)},dpSetPosition:function(E,F){return B.call(this,"setPosition",E,F)},dpSetOffset:function(E,F){return B.call(this,"setOffset",E,F)},dpClose:function(){return B.call(this,"_closeCalendar",false,this[0])},_dpDestroy:function(){}});var B=function(G,F,E,I,H){return this.each(function(){var J=C(this);if(J){J[G](F,E,I,H)}})};function A(E){this.ele=E;this.displayedMonth=null;this.displayedYear=null;this.startDate=null;this.endDate=null;this.showYearNavigation=null;this.closeOnSelect=null;this.displayClose=null;this.selectMultiple=null;this.verticalPosition=null;this.horizontalPosition=null;this.verticalOffset=null;this.horizontalOffset=null;this.button=null;this.renderCallback=[];this.selectedDates={};this.inline=null;this.context="#dp-popup"}D.extend(A.prototype,{init:function(E){this.setStartDate(E.startDate);this.setEndDate(E.endDate);this.setDisplayedMonth(Number(E.month),Number(E.year));this.setRenderCallback(E.renderCallback);this.showYearNavigation=E.showYearNavigation;this.closeOnSelect=E.closeOnSelect;this.displayClose=E.displayClose;this.selectMultiple=E.selectMultiple;this.verticalPosition=E.verticalPosition;this.horizontalPosition=E.horizontalPosition;this.hoverClass=E.hoverClass;this.setOffset(E.verticalOffset,E.horizontalOffset);this.inline=E.inline;if(this.inline){this.context=this.ele;this.display()}},setStartDate:function(E){if(E){this.startDate=Date.fromString(E)}if(!this.startDate){this.startDate=(new Date()).zeroTime()}this.setDisplayedMonth(this.displayedMonth,this.displayedYear)},setEndDate:function(E){if(E){this.endDate=Date.fromString(E)}if(!this.endDate){this.endDate=(new Date("12/31/2999"))}if(this.endDate.getTime()K.getTime()){G=K}}var F=this.displayedMonth;var J=this.displayedYear;this.displayedMonth=G.getMonth();this.displayedYear=G.getFullYear();if(I&&(this.displayedMonth!=F||this.displayedYear!=J)){this._rerenderCalendar();D(this.ele).trigger("dpMonthChanged",[this.displayedMonth,this.displayedYear])}},setSelected:function(K,E,F,H){if(E==this.isSelected(K)){return}if(this.selectMultiple==false){this.selectedDates={};D("td.selected",this.context).removeClass("selected")}if(F&&this.displayedMonth!=K.getMonth()){this.setDisplayedMonth(K.getMonth(),K.getFullYear(),true)}this.selectedDates[K.toString()]=E;var I="td.";I+=K.getMonth()==this.displayedMonth?"current-month":"other-month";I+=':contains("'+K.getDate()+'")';var J;D(I,this.ele).each(function(){if(D(this).text()==K.getDate()){J=D(this);J[E?"addClass":"removeClass"]("selected")}});if(H){var G=this.isSelected(K);$e=D(this.ele);$e.trigger("dateSelected",[K,J,G]);$e.trigger("change")}},isSelected:function(E){return this.selectedDates[E.toString()]},getSelected:function(){var E=[];for(s in this.selectedDates){if(this.selectedDates[s]==true){E.push(Date.parse(s))}}return E},display:function(E){if(D(this.ele).is(".dp-disabled")){return}E=E||this.ele;var L=this;var H=D(E);var K=H.offset();var M;var N;var G;var I;if(L.inline){M=D(this.ele);N={id:"calendar-"+this.ele._dpId,className:"dp-popup dp-popup-inline"};I={}}else{M=D("body");N={id:"dp-popup",className:"dp-popup"};I={top:K.top+L.verticalOffset,left:K.left+L.horizontalOffset};var J=function(Q){var O=Q.target;var P=D("#dp-popup")[0];while(true){if(O==P){return true}else{if(O==document){L._closeCalendar();return false}else{O=D(O).parent()[0]}}}};this._checkMouse=J;this._closeCalendar(true)}M.append(D("
").attr(N).css(I).append(D("

"),D('
').append(D('<<').bind("click",function(){return L._displayNewMonth.call(L,this,0,-1)}),D('<').bind("click",function(){return L._displayNewMonth.call(L,this,-1,0)})),D('
').append(D('>>').bind("click",function(){return L._displayNewMonth.call(L,this,0,1)}),D('>').bind("click",function(){return L._displayNewMonth.call(L,this,1,0)})),D("
").attr("className","dp-calendar")).bgIframe());var F=this.inline?D(".dp-popup",this.context):D("#dp-popup");if(this.showYearNavigation==false){D(".dp-nav-prev-year, .dp-nav-next-year",L.context).css("display","none")}if(this.displayClose){F.append(D(''+D.dpText.TEXT_CLOSE+"").bind("click",function(){L._closeCalendar();return false}))}L._renderCalendar();D(this.ele).trigger("dpDisplayed",F);if(!L.inline){if(this.verticalPosition==D.dpConst.POS_BOTTOM){F.css("top",K.top+H.height()-F.height()+L.verticalOffset)}if(this.horizontalPosition==D.dpConst.POS_RIGHT){F.css("left",K.left+H.width()-F.width()+L.horizontalOffset)}D(document).bind("mousedown",this._checkMouse)}},setRenderCallback:function(E){if(E==null){return}if(E&&typeof(E)=="function"){E=[E]}this.renderCallback=this.renderCallback.concat(E)},cellRender:function(J,E,H,G){var K=this.dpController;var I=new Date(E.getTime());J.bind("click",function(){var L=D(this);if(!L.is(".disabled")){K.setSelected(I,!L.is(".selected")||!K.selectMultiple,false,true);if(K.closeOnSelect){K._closeCalendar()}}});if(K.isSelected(I)){J.addClass("selected")}for(var F=0;F20){H.addClass("disabled")}});var G=this.startDate.getDate();D(".dp-calendar td.current-month",this.context).each(function(){var H=D(this);if(Number(H.text())20){var F=new Date(this.startDate.getTime());F.addMonths(1);if(this.displayedYear==F.getFullYear()&&this.displayedMonth==F.getMonth()){D("dp-calendar td.other-month",this.context).each(function(){var H=D(this);if(Number(H.text())G){H.addClass("disabled")}})}else{D(".dp-nav-next-year",this.context).removeClass("disabled");D(".dp-nav-next-month",this.context).removeClass("disabled");var G=this.endDate.getDate();if(G<13){var E=new Date(this.endDate.getTime());E.addMonths(-1);if(this.displayedYear==E.getFullYear()&&this.displayedMonth==E.getMonth()){D(".dp-calendar td.other-month",this.context).each(function(){var H=D(this);if(Number(H.text())>G){H.addClass("disabled")}})}}}},_closeCalendar:function(E,F){if(!F||F==this.ele){D(document).unbind("mousedown",this._checkMouse);this._clearCalendar();D("#dp-popup a").unbind();D("#dp-popup").empty().remove();if(!E){D(this.ele).trigger("dpClosed",[this.getSelected()])}}},_clearCalendar:function(){D(".dp-calendar td",this.context).unbind();D(".dp-calendar",this.context).empty()}});D.dpConst={SHOW_HEADER_NONE:0,SHOW_HEADER_SHORT:1,SHOW_HEADER_LONG:2,POS_TOP:0,POS_BOTTOM:1,POS_LEFT:0,POS_RIGHT:1};D.dpText={TEXT_PREV_YEAR:"Previous year",TEXT_PREV_MONTH:"Previous month",TEXT_NEXT_YEAR:"Next year",TEXT_NEXT_MONTH:"Next month",TEXT_CLOSE:"Close",TEXT_CHOOSE_DATE:"Choose date"};D.dpVersion="$Id: jquery.datePicker.js 15 2008-12-17 04:40:18Z kelvin.luck $";D.fn.datePicker.defaults={month:undefined,year:undefined,showHeader:D.dpConst.SHOW_HEADER_SHORT,startDate:undefined,endDate:undefined,inline:false,renderCallback:null,createButton:true,showYearNavigation:true,closeOnSelect:true,displayClose:false,selectMultiple:false,clickInput:false,verticalPosition:D.dpConst.POS_TOP,horizontalPosition:D.dpConst.POS_LEFT,verticalOffset:0,horizontalOffset:0,hoverClass:"dp-hover"};function C(E){if(E._dpId){return D.event._dpCache[E._dpId]}return false}if(D.fn.bgIframe==undefined){D.fn.bgIframe=function(){return this}}D(window).bind("unload",function(){var F=D.event._dpCache||[];for(var E in F){D(F[E].ele)._dpDestroy()}})})(jQuery); /* * FancyBox - jQuery Plugin * Simple and fancy lightbox alternative * * Examples and documentation at: http://fancybox.net * * Copyright (c) 2008 - 2010 Janis Skarnelis * * Version: 1.3.1 (05/03/2010) * Requires: jQuery v1.3+ * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html */ (function($) { var tmp, loading, overlay, wrap, outer, inner, close, nav_left, nav_right, selectedIndex = 0, selectedOpts = {}, selectedArray = [], currentIndex = 0, currentOpts = {}, currentArray = [], ajaxLoader = null, imgPreloader = new Image(), imgRegExp = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i, swfRegExp = /[^\.]\.(swf)\s*$/i, loadingTimer, loadingFrame = 1, start_pos, final_pos, busy = false, shadow = 20, fx = $.extend($('
')[0], { prop: 0 }), titleh = 0, isIE6 = !$.support.opacity && !window.XMLHttpRequest, /* * Private methods */ fancybox_abort = function() { loading.hide(); imgPreloader.onerror = imgPreloader.onload = null; if (ajaxLoader) { ajaxLoader.abort(); } tmp.empty(); }, fancybox_error = function() { $.fancybox('

The requested content cannot be loaded.
Please try again later.

', { 'scrolling' : 'no', 'padding' : 20, 'transitionIn' : 'none', 'transitionOut' : 'none' }); }, fancybox_get_viewport = function() { return [ $(window).width(), $(window).height(), $(document).scrollLeft(), $(document).scrollTop() ]; }, fancybox_get_zoom_to = function () { var view = fancybox_get_viewport(), to = {}, margin = currentOpts.margin, resize = currentOpts.autoScale, horizontal_space = (shadow + margin) * 2, vertical_space = (shadow + margin) * 2, double_padding = (currentOpts.padding * 2), ratio; if (currentOpts.width.toString().indexOf('%') > -1) { to.width = ((view[0] * parseFloat(currentOpts.width)) / 100) - (shadow * 2) ; resize = false; } else { to.width = currentOpts.width + double_padding; } if (currentOpts.height.toString().indexOf('%') > -1) { to.height = ((view[1] * parseFloat(currentOpts.height)) / 100) - (shadow * 2); resize = false; } else { to.height = currentOpts.height + double_padding; } if (resize && (to.width > (view[0] - horizontal_space) || to.height > (view[1] - vertical_space))) { if (selectedOpts.type == 'image' || selectedOpts.type == 'swf') { horizontal_space += double_padding; vertical_space += double_padding; ratio = Math.min(Math.min( view[0] - horizontal_space, currentOpts.width) / currentOpts.width, Math.min( view[1] - vertical_space, currentOpts.height) / currentOpts.height); to.width = Math.round(ratio * (to.width - double_padding)) + double_padding; to.height = Math.round(ratio * (to.height - double_padding)) + double_padding; } else { to.width = Math.min(to.width, (view[0] - horizontal_space)); to.height = Math.min(to.height, (view[1] - vertical_space)); } } to.top = view[3] + ((view[1] - (to.height + (shadow * 2 ))) * 0.5); to.left = view[2] + ((view[0] - (to.width + (shadow * 2 ))) * 0.5); if (currentOpts.autoScale === false) { to.top = Math.max(view[3] + margin, to.top); to.left = Math.max(view[2] + margin, to.left); } return to; }, fancybox_format_title = function(title) { if (title && title.length) { switch (currentOpts.titlePosition) { case 'inside': return title; case 'over': return '' + title + ''; default: return '' + title + ''; } } return false; }, fancybox_process_title = function() { var title = currentOpts.title, width = final_pos.width - (currentOpts.padding * 2), titlec = 'fancybox-title-' + currentOpts.titlePosition; $('#fancybox-title').remove(); titleh = 0; if (currentOpts.titleShow === false) { return; } title = $.isFunction(currentOpts.titleFormat) ? currentOpts.titleFormat(title, currentArray, currentIndex, currentOpts) : fancybox_format_title(title); if (!title || title === '') { return; } $('
').css({ 'width' : width, 'paddingLeft' : currentOpts.padding, 'paddingRight' : currentOpts.padding }).html(title).appendTo('body'); switch (currentOpts.titlePosition) { case 'inside': titleh = $("#fancybox-title").outerHeight(true) - currentOpts.padding; final_pos.height += titleh; break; case 'over': $('#fancybox-title').css('bottom', currentOpts.padding); break; default: $('#fancybox-title').css('bottom', $("#fancybox-title").outerHeight(true) * -1); break; } $('#fancybox-title').appendTo( outer ).hide(); }, fancybox_set_navigation = function() { $(document).unbind('keydown.fb').bind('keydown.fb', function(e) { if (e.keyCode == 27 && currentOpts.enableEscapeButton) { e.preventDefault(); $.fancybox.close(); } else if (e.keyCode == 37) { e.preventDefault(); $.fancybox.prev(); } else if (e.keyCode == 39) { e.preventDefault(); $.fancybox.next(); } }); if ($.fn.mousewheel) { wrap.unbind('mousewheel.fb'); if (currentArray.length > 1) { wrap.bind('mousewheel.fb', function(e, delta) { e.preventDefault(); if (busy || delta === 0) { return; } if (delta > 0) { $.fancybox.prev(); } else { $.fancybox.next(); } }); } } if (!currentOpts.showNavArrows) { return; } if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex !== 0) { nav_left.show(); } if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex != (currentArray.length -1)) { nav_right.show(); } }, fancybox_preload_images = function() { var href, objNext; if ((currentArray.length -1) > currentIndex) { href = currentArray[ currentIndex + 1 ].href; if (typeof href !== 'undefined' && href.match(imgRegExp)) { objNext = new Image(); objNext.src = href; } } if (currentIndex > 0) { href = currentArray[ currentIndex - 1 ].href; if (typeof href !== 'undefined' && href.match(imgRegExp)) { objNext = new Image(); objNext.src = href; } } }, _finish = function () { inner.css('overflow', (currentOpts.scrolling == 'auto' ? (currentOpts.type == 'image' || currentOpts.type == 'iframe' || currentOpts.type == 'swf' ? 'hidden' : 'auto') : (currentOpts.scrolling == 'yes' ? 'auto' : 'visible'))); if (!$.support.opacity) { inner.get(0).style.removeAttribute('filter'); wrap.get(0).style.removeAttribute('filter'); } $('#fancybox-title').show(); if (currentOpts.hideOnContentClick) { inner.one('click', $.fancybox.close); } if (currentOpts.hideOnOverlayClick) { overlay.one('click', $.fancybox.close); } if (currentOpts.showCloseButton) { close.show(); } fancybox_set_navigation(); $(window).bind("resize.fb", $.fancybox.center); if (currentOpts.centerOnScroll) { $(window).bind("scroll.fb", $.fancybox.center); } else { $(window).unbind("scroll.fb"); } if ($.isFunction(currentOpts.onComplete)) { currentOpts.onComplete(currentArray, currentIndex, currentOpts); } busy = false; fancybox_preload_images(); }, fancybox_draw = function(pos) { var width = Math.round(start_pos.width + (final_pos.width - start_pos.width) * pos), height = Math.round(start_pos.height + (final_pos.height - start_pos.height) * pos), top = Math.round(start_pos.top + (final_pos.top - start_pos.top) * pos), left = Math.round(start_pos.left + (final_pos.left - start_pos.left) * pos); wrap.css({ 'width' : width + 'px', 'height' : height + 'px', 'top' : top + 'px', 'left' : left + 'px' }); width = Math.max(width - currentOpts.padding * 2, 0); height = Math.max(height - (currentOpts.padding * 2 + (titleh * pos)), 0); inner.css({ 'width' : width + 'px', 'height' : height + 'px' }); if (typeof final_pos.opacity !== 'undefined') { wrap.css('opacity', (pos < 0.5 ? 0.5 : pos)); } }, fancybox_get_obj_pos = function(obj) { var pos = obj.offset(); pos.top += parseFloat( obj.css('paddingTop') ) || 0; pos.left += parseFloat( obj.css('paddingLeft') ) || 0; pos.top += parseFloat( obj.css('border-top-width') ) || 0; pos.left += parseFloat( obj.css('border-left-width') ) || 0; pos.width = obj.width(); pos.height = obj.height(); return pos; }, fancybox_get_zoom_from = function() { var orig = selectedOpts.orig ? $(selectedOpts.orig) : false, from = {}, pos, view; if (orig && orig.length) { pos = fancybox_get_obj_pos(orig); from = { width : (pos.width + (currentOpts.padding * 2)), height : (pos.height + (currentOpts.padding * 2)), top : (pos.top - currentOpts.padding - shadow), left : (pos.left - currentOpts.padding - shadow) }; } else { view = fancybox_get_viewport(); from = { width : 1, height : 1, top : view[3] + view[1] * 0.5, left : view[2] + view[0] * 0.5 }; } return from; }, fancybox_show = function() { loading.hide(); if (wrap.is(":visible") && $.isFunction(currentOpts.onCleanup)) { if (currentOpts.onCleanup(currentArray, currentIndex, currentOpts) === false) { $.event.trigger('fancybox-cancel'); busy = false; return; } } currentArray = selectedArray; currentIndex = selectedIndex; currentOpts = selectedOpts; inner.get(0).scrollTop = 0; inner.get(0).scrollLeft = 0; if (currentOpts.overlayShow) { if (isIE6) { $('select:not(#fancybox-tmp select)').filter(function() { return this.style.visibility !== 'hidden'; }).css({'visibility':'hidden'}).one('fancybox-cleanup', function() { this.style.visibility = 'inherit'; }); } overlay.css({ 'background-color' : currentOpts.overlayColor, 'opacity' : currentOpts.overlayOpacity }).unbind().show(); } final_pos = fancybox_get_zoom_to(); fancybox_process_title(); if (wrap.is(":visible")) { $( close.add( nav_left ).add( nav_right ) ).hide(); var pos = wrap.position(), equal; start_pos = { top : pos.top , left : pos.left, width : wrap.width(), height : wrap.height() }; equal = (start_pos.width == final_pos.width && start_pos.height == final_pos.height); inner.fadeOut(currentOpts.changeFade, function() { var finish_resizing = function() { inner.html( tmp.contents() ).fadeIn(currentOpts.changeFade, _finish); }; $.event.trigger('fancybox-change'); inner.empty().css('overflow', 'hidden'); if (equal) { inner.css({ top : currentOpts.padding, left : currentOpts.padding, width : Math.max(final_pos.width - (currentOpts.padding * 2), 1), height : Math.max(final_pos.height - (currentOpts.padding * 2) - titleh, 1) }); finish_resizing(); } else { inner.css({ top : currentOpts.padding, left : currentOpts.padding, width : Math.max(start_pos.width - (currentOpts.padding * 2), 1), height : Math.max(start_pos.height - (currentOpts.padding * 2), 1) }); fx.prop = 0; $(fx).animate({ prop: 1 }, { duration : currentOpts.changeSpeed, easing : currentOpts.easingChange, step : fancybox_draw, complete : finish_resizing }); } }); return; } wrap.css('opacity', 1); if (currentOpts.transitionIn == 'elastic') { start_pos = fancybox_get_zoom_from(); inner.css({ top : currentOpts.padding, left : currentOpts.padding, width : Math.max(start_pos.width - (currentOpts.padding * 2), 1), height : Math.max(start_pos.height - (currentOpts.padding * 2), 1) }) .html( tmp.contents() ); wrap.css(start_pos).show(); if (currentOpts.opacity) { final_pos.opacity = 0; } fx.prop = 0; $(fx).animate({ prop: 1 }, { duration : currentOpts.speedIn, easing : currentOpts.easingIn, step : fancybox_draw, complete : _finish }); } else { inner.css({ top : currentOpts.padding, left : currentOpts.padding, width : Math.max(final_pos.width - (currentOpts.padding * 2), 1), height : Math.max(final_pos.height - (currentOpts.padding * 2) - titleh, 1) }) .html( tmp.contents() ); wrap.css( final_pos ).fadeIn( currentOpts.transitionIn == 'none' ? 0 : currentOpts.speedIn, _finish ); } }, fancybox_process_inline = function() { tmp.width( selectedOpts.width ); tmp.height( selectedOpts.height ); if (selectedOpts.width == 'auto') { selectedOpts.width = tmp.width(); } if (selectedOpts.height == 'auto') { selectedOpts.height = tmp.height(); } fancybox_show(); }, fancybox_process_image = function() { busy = true; selectedOpts.width = imgPreloader.width; selectedOpts.height = imgPreloader.height; $("").attr({ 'id' : 'fancybox-img', 'src' : imgPreloader.src, 'alt' : selectedOpts.title }).appendTo( tmp ); fancybox_show(); }, fancybox_start = function() { fancybox_abort(); var obj = selectedArray[ selectedIndex ], href, type, title, str, emb, selector, data; selectedOpts = $.extend({}, $.fn.fancybox.defaults, (typeof $(obj).data('fancybox') == 'undefined' ? selectedOpts : $(obj).data('fancybox'))); title = obj.title || $(obj).title || selectedOpts.title || ''; if (obj.nodeName && !selectedOpts.orig) { selectedOpts.orig = $(obj).children("img:first").length ? $(obj).children("img:first") : $(obj); } if (title === '' && selectedOpts.orig) { title = selectedOpts.orig.attr('alt'); } if (obj.nodeName && (/^(?:javascript|#)/i).test(obj.href)) { href = selectedOpts.href || null; } else { href = selectedOpts.href || obj.href || null; } if (selectedOpts.type) { type = selectedOpts.type; if (!href) { href = selectedOpts.content; } } else if (selectedOpts.content) { type = 'html'; } else if (href) { if (href.match(imgRegExp)) { type = 'image'; } else if (href.match(swfRegExp)) { type = 'swf'; } else if ($(obj).hasClass("iframe")) { type = 'iframe'; } else if (href.match(/#/)) { obj = href.substr(href.indexOf("#")); type = $(obj).length > 0 ? 'inline' : 'ajax'; } else { type = 'ajax'; } } else { type = 'inline'; } selectedOpts.type = type; selectedOpts.href = href; selectedOpts.title = title; if (selectedOpts.autoDimensions && selectedOpts.type !== 'iframe' && selectedOpts.type !== 'swf') { selectedOpts.width = 'auto'; selectedOpts.height = 'auto'; } if (selectedOpts.modal) { selectedOpts.overlayShow = true; selectedOpts.hideOnOverlayClick = false; selectedOpts.hideOnContentClick = false; selectedOpts.enableEscapeButton = false; selectedOpts.showCloseButton = false; } if ($.isFunction(selectedOpts.onStart)) { if (selectedOpts.onStart(selectedArray, selectedIndex, selectedOpts) === false) { busy = false; return; } } tmp.css('padding', (shadow + selectedOpts.padding + selectedOpts.margin)); $('.fancybox-inline-tmp').unbind('fancybox-cancel').bind('fancybox-change', function() { $(this).replaceWith(inner.children()); }); switch (type) { case 'html' : tmp.html( selectedOpts.content ); fancybox_process_inline(); break; case 'inline' : $('
').hide().insertBefore( $(obj) ).bind('fancybox-cleanup', function() { $(this).replaceWith(inner.children()); }).bind('fancybox-cancel', function() { $(this).replaceWith(tmp.children()); }); $(obj).appendTo(tmp); fancybox_process_inline(); break; case 'image': busy = false; $.fancybox.showActivity(); imgPreloader = new Image(); imgPreloader.onerror = function() { fancybox_error(); }; imgPreloader.onload = function() { imgPreloader.onerror = null; imgPreloader.onload = null; fancybox_process_image(); }; imgPreloader.src = href; break; case 'swf': str = ''; emb = ''; $.each(selectedOpts.swf, function(name, val) { str += ''; emb += ' ' + name + '="' + val + '"'; }); str += ''; tmp.html(str); fancybox_process_inline(); break; case 'ajax': selector = href.split('#', 2); data = selectedOpts.ajax.data || {}; if (selector.length > 1) { href = selector[0]; if (typeof data == "string") { data += '&selector=' + selector[1]; } else { data.selector = selector[1]; } } busy = false; $.fancybox.showActivity(); ajaxLoader = $.ajax($.extend(selectedOpts.ajax, { url : href, data : data, error : fancybox_error, success : function(data, textStatus, XMLHttpRequest) { if (ajaxLoader.status == 200) { tmp.html( data ); fancybox_process_inline(); } } })); break; case 'iframe' : $('').appendTo(tmp); fancybox_show(); break; } }, fancybox_animate_loading = function() { if (!loading.is(':visible')){ clearInterval(loadingTimer); return; } $('div', loading).css('top', (loadingFrame * -40) + 'px'); loadingFrame = (loadingFrame + 1) % 12; }, fancybox_init = function() { if ($("#fancybox-wrap").length) { return; } $('body').append( tmp = $('
'), loading = $('
'), overlay = $('
'), wrap = $('
') ); if (!$.support.opacity) { wrap.addClass('fancybox-ie'); loading.addClass('fancybox-ie'); } outer = $('
') .append('
') .appendTo( wrap ); outer.append( inner = $('
'), close = $(''), nav_left = $(''), nav_right = $('') ); close.click($.fancybox.close); loading.click($.fancybox.cancel); nav_left.click(function(e) { e.preventDefault(); $.fancybox.prev(); }); nav_right.click(function(e) { e.preventDefault(); $.fancybox.next(); }); if (isIE6) { overlay.get(0).style.setExpression('height', "document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'"); loading.get(0).style.setExpression('top', "(-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px'"); outer.prepend(''); } }; /* * Public methods */ $.fn.fancybox = function(options) { $(this) .data('fancybox', $.extend({}, options, ($.metadata ? $(this).metadata() : {}))) .unbind('click.fb').bind('click.fb', function(e) { e.preventDefault(); if (busy) { return; } busy = true; $(this).blur(); selectedArray = []; selectedIndex = 0; var rel = $(this).attr('rel') || ''; if (!rel || rel == '' || rel === 'nofollow') { selectedArray.push(this); } else { selectedArray = $("a[rel=" + rel + "], area[rel=" + rel + "]"); selectedIndex = selectedArray.index( this ); } fancybox_start(); return false; }); return this; }; $.fancybox = function(obj) { if (busy) { return; } busy = true; var opts = typeof arguments[1] !== 'undefined' ? arguments[1] : {}; selectedArray = []; selectedIndex = opts.index || 0; if ($.isArray(obj)) { for (var i = 0, j = obj.length; i < j; i++) { if (typeof obj[i] == 'object') { $(obj[i]).data('fancybox', $.extend({}, opts, obj[i])); } else { obj[i] = $({}).data('fancybox', $.extend({content : obj[i]}, opts)); } } selectedArray = jQuery.merge(selectedArray, obj); } else { if (typeof obj == 'object') { $(obj).data('fancybox', $.extend({}, opts, obj)); } else { obj = $({}).data('fancybox', $.extend({content : obj}, opts)); } selectedArray.push(obj); } if (selectedIndex > selectedArray.length || selectedIndex < 0) { selectedIndex = 0; } fancybox_start(); }; $.fancybox.showActivity = function() { clearInterval(loadingTimer); loading.show(); loadingTimer = setInterval(fancybox_animate_loading, 66); }; $.fancybox.hideActivity = function() { loading.hide(); }; $.fancybox.next = function() { return $.fancybox.pos( currentIndex + 1); }; $.fancybox.prev = function() { return $.fancybox.pos( currentIndex - 1); }; $.fancybox.pos = function(pos) { if (busy) { return; } pos = parseInt(pos, 10); if (pos > -1 && currentArray.length > pos) { selectedIndex = pos; fancybox_start(); } if (currentOpts.cyclic && currentArray.length > 1 && pos < 0) { selectedIndex = currentArray.length - 1; fancybox_start(); } if (currentOpts.cyclic && currentArray.length > 1 && pos >= currentArray.length) { selectedIndex = 0; fancybox_start(); } return; }; $.fancybox.cancel = function() { if (busy) { return; } busy = true; $.event.trigger('fancybox-cancel'); fancybox_abort(); if (selectedOpts && $.isFunction(selectedOpts.onCancel)) { selectedOpts.onCancel(selectedArray, selectedIndex, selectedOpts); } busy = false; }; // Note: within an iframe use - parent.$.fancybox.close(); $.fancybox.close = function() { if (busy || wrap.is(':hidden')) { return; } busy = true; if (currentOpts && $.isFunction(currentOpts.onCleanup)) { if (currentOpts.onCleanup(currentArray, currentIndex, currentOpts) === false) { busy = false; return; } } fancybox_abort(); $(close.add( nav_left ).add( nav_right )).hide(); $('#fancybox-title').remove(); wrap.add(inner).add(overlay).unbind(); $(window).unbind("resize.fb scroll.fb"); $(document).unbind('keydown.fb'); function _cleanup() { overlay.fadeOut('fast'); wrap.hide(); $.event.trigger('fancybox-cleanup'); inner.empty(); if ($.isFunction(currentOpts.onClosed)) { currentOpts.onClosed(currentArray, currentIndex, currentOpts); } currentArray = selectedOpts = []; currentIndex = selectedIndex = 0; currentOpts = selectedOpts = {}; busy = false; } inner.css('overflow', 'hidden'); if (currentOpts.transitionOut == 'elastic') { start_pos = fancybox_get_zoom_from(); var pos = wrap.position(); final_pos = { top : pos.top , left : pos.left, width : wrap.width(), height : wrap.height() }; if (currentOpts.opacity) { final_pos.opacity = 1; } fx.prop = 1; $(fx).animate({ prop: 0 }, { duration : currentOpts.speedOut, easing : currentOpts.easingOut, step : fancybox_draw, complete : _cleanup }); } else { wrap.fadeOut( currentOpts.transitionOut == 'none' ? 0 : currentOpts.speedOut, _cleanup); } }; $.fancybox.resize = function() { var c, h; if (busy || wrap.is(':hidden')) { return; } busy = true; c = inner.wrapInner("
").children(); h = c.height(); wrap.css({height: h + (currentOpts.padding * 2) + titleh}); inner.css({height: h}); c.replaceWith(c.children()); $.fancybox.center(); }; $.fancybox.center = function() { busy = true; var view = fancybox_get_viewport(), margin = currentOpts.margin, to = {}; to.top = view[3] + ((view[1] - ((wrap.height() - titleh) + (shadow * 2 ))) * 0.5); to.left = view[2] + ((view[0] - (wrap.width() + (shadow * 2 ))) * 0.5); to.top = Math.max(view[3] + margin, to.top); to.left = Math.max(view[2] + margin, to.left); wrap.css(to); busy = false; }; $.fn.fancybox.defaults = { padding : 10, margin : 20, opacity : false, modal : false, cyclic : false, scrolling : 'no', // 'auto', 'yes' or 'no' width : 635, //560, height : 425,//340, autoScale : true, autoDimensions : false, centerOnScroll : false, ajax : {}, swf : { wmode: 'transparent' }, hideOnOverlayClick : true, hideOnContentClick : false, overlayShow : true, overlayOpacity : 0.3, overlayColor : '#666', titleShow : false, titlePosition : 'outside', // 'outside', 'inside' or 'over' titleFormat : null, transitionIn : 'fade', // 'elastic', 'fade' or 'none' transitionOut : 'fade', // 'elastic', 'fade' or 'none' speedIn : 300, speedOut : 300, changeSpeed : 300, changeFade : 'fast', easingIn : 'swing', easingOut : 'swing', showCloseButton : true, showNavArrows : true, enableEscapeButton : true, onStart : null, onCancel : null, onComplete : null, onCleanup : null, onClosed : null }; $(document).ready(function() { fancybox_init(); }); })(jQuery); /* * jQuery history plugin * * sample page: http://www.serpere.info/jquery-history-plugin/samples/ * * Copyright (c) 2006-2009 Taku Sano (Mikage Sawatari) * Copyright (c) 2010 Takayuki Miwa * Licensed under the MIT License: * http://www.opensource.org/licenses/mit-license.php * * Modified by Lincoln Cooper to add Safari support and only call the callback once during initialization * for msie when no initial hash supplied. */ (function($) { var locationWrapper = { put: function(hash, win) { (win || window).location.hash = hash; }, get: function(win) { var hash = ((win || window).location.hash).replace(/^#\!/, ''); return $.browser.mozilla ? hash : hash; } }; var iframeWrapper = { id: "__jQuery_history", init: function() { var html = '