
/* Merged Plone Javascript file
 * This file is dynamically assembled from separate parts.
 * Some of these parts have 3rd party licenses or copyright information attached
 * Such information is valid for that section,
 * not for the entire composite file
 * originating files are separated by - filename.js -
 */

/* - ++resource++freitag.theme.javascripts/jquery.wysiwyg.pack.js - */
(function($){$.fn.document=function(){var element=this[0];if(element.nodeName.toLowerCase()=='iframe')return element.contentWindow.document;else return $(this)};$.fn.documentSelection=function(){var element=this[0];if(element.contentWindow.document.selection)return element.contentWindow.document.selection.createRange().text;else return element.contentWindow.getSelection().toString()};$.fn.wysiwyg=function(options){if(arguments.length>0&&arguments[0].constructor==String){var action=arguments[0].toString();var params=[];for(var i=1;i<arguments.length;i++)params[i-1]=arguments[i];if(action in Wysiwyg){return this.each(function(){$.data(this,'wysiwyg').designMode();Wysiwyg[action].apply(this,params)})}else return this}var controls={};if(options&&options.controls){var controls=options.controls;delete options.controls}var options=$.extend({html:'<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">STYLE_SHEET</head><body>INITIAL_CONTENT</body></html>',css:{},debug:false,autoSave:true,rmUnwantedBr:true,brIE:true,controls:{},messages:{}},options);options.messages=$.extend(true,options.messages,Wysiwyg.MSGS_EN);options.controls=$.extend(true,options.controls,Wysiwyg.TOOLBAR);for(var control in controls){if(control in options.controls)$.extend(options.controls[control],controls[control]);else options.controls[control]=controls[control]}return this.each(function(){Wysiwyg(this,options)})};function Wysiwyg(element,options){return this instanceof Wysiwyg?this.init(element,options):new Wysiwyg(element,options)}$.extend(Wysiwyg,{insertImage:function(szURL,attributes){var self=$.data(this,'wysiwyg');if(self.constructor==Wysiwyg&&szURL&&szURL.length>0){if(attributes){self.editorDoc.execCommand('insertImage',false,'#jwysiwyg#');var img=self.getElementByAttributeValue('img','src','#jwysiwyg#');if(img){img.src=szURL;for(var attribute in attributes){img.setAttribute(attribute,attributes[attribute])}}}else{self.editorDoc.execCommand('insertImage',false,szURL)}}},createLink:function(szURL){var self=$.data(this,'wysiwyg');if(self.constructor==Wysiwyg&&szURL&&szURL.length>0){var selection=$(self.editor).documentSelection();if(selection.length>0){self.editorDoc.execCommand('unlink',false,[]);self.editorDoc.execCommand('createLink',false,szURL)}else if(self.options.messages.nonSelection)alert(self.options.messages.nonSelection)}},setContent:function(newContent){var self=$.data(this,'wysiwyg');self.setContent(newContent);self.saveContent()},clear:function(){var self=$.data(this,'wysiwyg');self.setContent('');self.saveContent()},MSGS_EN:{nonSelection:'select the text you wish to link'},TOOLBAR:{bold:{visible:true,tags:['b','strong'],css:{fontWeight:'bold'}},italic:{visible:true,tags:['i','em'],css:{fontStyle:'italic'}},strikeThrough:{visible:false,tags:['s','strike'],css:{textDecoration:'line-through'}},underline:{visible:false,tags:['u'],css:{textDecoration:'underline'}},separator00:{visible:false,separator:true},justifyLeft:{visible:false,css:{textAlign:'left'}},justifyCenter:{visible:false,tags:['center'],css:{textAlign:'center'}},justifyRight:{visible:false,css:{textAlign:'right'}},justifyFull:{visible:false,css:{textAlign:'justify'}},separator01:{visible:false,separator:true},indent:{visible:false},outdent:{visible:false},separator02:{visible:false,separator:true},subscript:{visible:false,tags:['sub']},superscript:{visible:false,tags:['sup']},separator03:{visible:false,separator:true},undo:{visible:false},redo:{visible:false},separator04:{visible:false,separator:true},insertOrderedList:{visible:false,tags:['ol']},insertUnorderedList:{visible:false,tags:['ul']},insertHorizontalRule:{visible:false,tags:['hr']},separator05:{separator:true},createLink:{visible:true,exec:function(){var selection=$(this.editor).documentSelection();if(selection.length>0){if($.browser.msie)this.editorDoc.execCommand('createLink',true,null);else{var szURL=prompt('URL','http://');if(szURL&&szURL.length>0){this.editorDoc.execCommand('unlink',false,[]);this.editorDoc.execCommand('createLink',false,szURL)}}}else if(this.options.messages.nonSelection)alert(this.options.messages.nonSelection)},tags:['a']},insertImage:{visible:true,exec:function(){if($.browser.msie)this.editorDoc.execCommand('insertImage',true,null);else{var szURL=prompt('URL','http://');if(szURL&&szURL.length>0)this.editorDoc.execCommand('insertImage',false,szURL)}},tags:['img']},separator06:{separator:true},h1mozilla:{visible:true&&$.browser.mozilla,className:'h1',command:'heading',arguments:['h1'],tags:['h1']},h2mozilla:{visible:true&&$.browser.mozilla,className:'h2',command:'heading',arguments:['h2'],tags:['h2']},h3mozilla:{visible:true&&$.browser.mozilla,className:'h3',command:'heading',arguments:['h3'],tags:['h3']},h1:{visible:true&&!($.browser.mozilla),className:'h1',command:'formatBlock',arguments:['Heading 1'],tags:['h1']},h2:{visible:true&&!($.browser.mozilla),className:'h2',command:'formatBlock',arguments:['Heading 2'],tags:['h2']},h3:{visible:true&&!($.browser.mozilla),className:'h3',command:'formatBlock',arguments:['Heading 3'],tags:['h3']},separator07:{visible:false,separator:true},cut:{visible:false},copy:{visible:false},paste:{visible:false},separator08:{separator:true&&!($.browser.msie)},increaseFontSize:{visible:true&&!($.browser.msie),tags:['big']},decreaseFontSize:{visible:true&&!($.browser.msie),tags:['small']},separator09:{separator:true},html:{visible:false,exec:function(){if(this.viewHTML){this.setContent($(this.original).val());$(this.original).hide()}else{this.saveContent();$(this.original).show()}this.viewHTML=!(this.viewHTML)}},removeFormat:{visible:true,exec:function(){this.editorDoc.execCommand('removeFormat',false,[]);this.editorDoc.execCommand('unlink',false,[])}}}});$.extend(Wysiwyg.prototype,{original:null,options:{},element:null,editor:null,init:function(element,options){var self=this;this.editor=element;this.options=options||{};$.data(element,'wysiwyg',this);var newX=element.width||element.clientWidth;var newY=element.height||element.clientHeight;if(element.nodeName.toLowerCase()=='textarea'){this.original=element;if(newX==0&&element.cols)newX=(element.cols*8)+21;if(newY==0&&element.rows)newY=(element.rows*16)+16;var editor=this.editor=$('<iframe></iframe>').css({minHeight:(newY-6).toString()+'px',width:(newX-8).toString()+'px'}).attr('id',$(element).attr('id')+'IFrame');if($.browser.msie){this.editor.css('height',(newY).toString()+'px')}}var panel=this.panel=$('<ul></ul>').addClass('panel');this.appendControls();this.element=$('<div></div>').css({width:(newX>0)?(newX).toString()+'px':'100%'}).addClass('wysiwyg').append(panel).append($('<div><!-- --></div>').css({clear:'both'})).append(editor);$(element).hide().before(this.element);this.viewHTML=false;this.initialHeight=newY-8;this.initialContent=$(element).val();this.initFrame();if(this.initialContent.length==0)this.setContent('');if(this.options.autoSave)$('form').submit(function(){self.saveContent()});$('form').bind('reset',function(){self.setContent(self.initialContent);self.saveContent()})},initFrame:function(){var self=this;var style='';if(this.options.css&&this.options.css.constructor==String)style='<link rel="stylesheet" type="text/css" media="screen" href="'+this.options.css+'" />';this.editorDoc=$(this.editor).document();this.editorDoc_designMode=false;try{this.editorDoc.designMode='on';this.editorDoc_designMode=true}catch(e){$(this.editorDoc).focus(function(){self.designMode()})}this.editorDoc.open();this.editorDoc.write(this.options.html.replace(/INITIAL_CONTENT/,this.initialContent).replace(/STYLE_SHEET/,style));this.editorDoc.close();this.editorDoc.contentEditable='true';if($.browser.msie){setTimeout(function(){$(self.editorDoc.body).css('border','none')},0)}$(this.editorDoc).click(function(event){self.checkTargets(event.target?event.target:event.srcElement)});$(this.original).focus(function(){$(self.editorDoc.body).focus()});if(this.options.autoSave){$(this.editorDoc).keydown(function(){self.saveContent()}).keyup(function(){self.saveContent()}).mousedown(function(){self.saveContent()})}if(this.options.css){setTimeout(function(){if(self.options.css.constructor==String){}else $(self.editorDoc).find('body').css(self.options.css)},0)}$(this.editorDoc).keydown(function(event){if($.browser.msie&&self.options.brIE&&event.keyCode==13){var rng=self.getRange();rng.pasteHTML('<br />');rng.collapse(false);rng.select();return false}})},designMode:function(){if(!(this.editorDoc_designMode)){try{this.editorDoc.designMode='on';this.editorDoc_designMode=true}catch(e){}}},getSelection:function(){return(window.getSelection)?window.getSelection():document.selection},getRange:function(){var selection=this.getSelection();if(!(selection))return null;return(selection.rangeCount>0)?selection.getRangeAt(0):selection.createRange()},getContent:function(){return $($(this.editor).document()).find('body').html()},setContent:function(newContent){$($(this.editor).document()).find('body').html(newContent)},saveContent:function(){if(this.original){var content=this.getContent();if(this.options.rmUnwantedBr)content=(content.substr(-4)=='<br>')?content.substr(0,content.length-4):content;$(this.original).val(content)}},appendMenu:function(cmd,args,className,fn){var self=this;var args=args||[];$('<li></li>').append($('<a><!-- --></a>').addClass(className||cmd)).mousedown(function(){if(fn)fn.apply(self);else self.editorDoc.execCommand(cmd,false,args);if(self.options.autoSave)self.saveContent()}).appendTo(this.panel)},appendMenuSeparator:function(){$('<li class="separator"></li>').appendTo(this.panel)},appendControls:function(){for(var name in this.options.controls){var control=this.options.controls[name];if(control.separator){if(control.visible!==false)this.appendMenuSeparator()}else if(control.visible){this.appendMenu(control.command||name,control.arguments||[],control.className||control.command||name||'empty',control.exec)}}},checkTargets:function(element){for(var name in this.options.controls){var control=this.options.controls[name];var className=control.className||control.command||name||'empty';$('.'+className,this.panel).removeClass('active');if(control.tags){var elm=element;do{if(elm.nodeType!=1)break;if($.inArray(elm.tagName.toLowerCase(),control.tags)!=-1)$('.'+className,this.panel).addClass('active')}while(elm=elm.parentNode)}if(control.css){var elm=$(element);do{if(elm[0].nodeType!=1)break;for(var cssProperty in control.css)if(elm.css(cssProperty).toString().toLowerCase()==control.css[cssProperty])$('.'+className,this.panel).addClass('active')}while(elm=elm.parent())}}},getElementByAttributeValue:function(tagName,attributeName,attributeValue){var elements=this.editorDoc.getElementsByTagName(tagName);for(var i=0;i<elements.length;i++){var value=elements[i].getAttribute(attributeName);if($.browser.msie){value=value.substr(value.length-attributeValue.length)}if(value==attributeValue)return elements[i]}return false}})})(jQuery);

/* - ++resource++freitag.theme.javascripts/jquery.countdown.min.js - */
/* http://keith-wood.name/countdown.html
   Countdown for jQuery v1.4.2.
   Written by Keith Wood (kbwood@virginbroadband.com.au) January 2008.
   Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
   MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
   Please attribute the author if you use it. */
(function(jq){function Countdown(){this.regional=[];this.regional['']={labels:['Years','Months','Weeks','Days','Hours','Minutes','Seconds'],labels1:['Year','Month','Week','Day','Hour','Minute','Second'],compactLabels:['y','m','w','d'],timeSeparator:':',isRTL:false};this._defaults={format:'dHMS',layout:'',compact:false,description:'',expiryUrl:null,alwaysExpire:false,onExpiry:null,onTick:null,serverTime:null};jq.extend(this._defaults,this.regional[''])}var q='countdown';var Y=0;var O=1;var W=2;var D=3;var H=4;var M=5;var S=6;jq.extend(Countdown.prototype,{markerClassName:'hasCountdown',setDefaults:function(a){this._resetExtraLabels(this._defaults,a);extendRemove(this._defaults,a||{})},_attachCountdown:function(a,b){a=jq(a);if(a.is('.'+this.markerClassName)){return}a.addClass(this.markerClassName);if(!a[0].id){a[0].id='cdn'+new Date().getTime()}var c={};c.options=jq.extend({},b);c._periods=[0,0,0,0,0,0,0];this._adjustSettings(c);jq.data(a[0],q,c);this._updateCountdown(a,c)},_updateCountdown:function(a,b){var c=jq(a);b=b||jq.data(c[0],q);if(!b){return}c.html(this._generateHTML(b));c[(this._get(b,'isRTL')?'add':'remove')+'Class']('countdown_rtl');var d=this._get(b,'onTick');if(d){d.apply(c[0],[b._hold!='lap'?b._periods:this._calculatePeriods(b,b._show,new Date())])}var e=b._hold!='pause'&&(b._since?b._now.getTime()<=b._since.getTime():b._now.getTime()>=b._until.getTime());if(e){if(b._timer||this._get(b,'alwaysExpire')){var f=this._get(b,'onExpiry');if(f){f.apply(c[0],[])}var g=this._get(b,'expiryUrl');if(g){window.location=g}}b._timer=null}else if(b._hold=='pause'){b._time=null}else{var h=this._get(b,'format');b._timer=setTimeout('jq.countdown._updateCountdown("#'+c[0].id+'")',(h.match('s|S')?1:(h.match('m|M')?30:600))*980)}jq.data(c[0],q,b)},_changeCountdown:function(a,b){var c=jq.data(a,q);if(c){this._resetExtraLabels(c.options,b);extendRemove(c.options,b||{});this._adjustSettings(c);jq.data(a,q,c);this._updateCountdown(a,c)}},_resetExtraLabels:function(a,b){var c=false;for(var n in b){if(n.match(/[Ll]abels/)){c=true;break}}if(c){for(var n in a){if(n.match(/[Ll]abels[0-9]/)){a[n]=null}}}},_destroyCountdown:function(a){a=jq(a);if(!a.is('.'+this.markerClassName)){return}a.removeClass(this.markerClassName).empty();var b=jq.data(a[0],q);if(b._timer){clearTimeout(b._timer)}jq.removeData(a[0],q)},_pauseCountdown:function(a){this._hold(a,'pause')},_lapCountdown:function(a){this._hold(a,'lap')},_resumeCountdown:function(a){this._hold(a,null)},_hold:function(a,b){var c=jq.data(a,q);if(c){if(c._hold=='pause'&&!b){c._periods=c._savePeriods;var d=(c._since?'-':'+');c[c._since?'_since':'_until']=this._determineTime(d+c._periods[0]+'Y'+d+c._periods[1]+'O'+d+c._periods[2]+'W'+d+c._periods[3]+'D'+d+c._periods[4]+'H'+d+c._periods[5]+'M'+d+c._periods[6]+'S')}c._hold=b;c._savePeriods=(b=='pause'?c._periods:null);jq.data(a,q,c);this._updateCountdown(a,c)}},_getTimesCountdown:function(a){var b=jq.data(a,q);return(!b?null:(!b._hold?b._periods:this._calculatePeriods(b,b._show,new Date())))},_get:function(a,b){return(a.options[b]!=null?a.options[b]:jq.countdown._defaults[b])},_adjustSettings:function(a){var b=new Date();var c=this._get(a,'serverTime');a._offset=(c?c.getTime()-b.getTime():0);a._since=this._get(a,'since');if(a._since){a._since=this._determineTime(a._since,null)}a._until=this._determineTime(this._get(a,'until'),b);a._show=this._determineShow(a)},_determineTime:function(k,l){var m=function(a){var b=new Date();b.setTime(b.getTime()+a*1000);return b};var n=function(a,b){return 32-new Date(a,b,32).getDate()};var o=function(a){var b=new Date();var c=b.getFullYear();var d=b.getMonth();var e=b.getDate();var f=b.getHours();var g=b.getMinutes();var h=b.getSeconds();var i=/([+-]?[0-9]+)\s*(s|S|m|M|h|H|d|D|w|W|o|O|y|Y)?/g;var j=i.exec(a);while(j){switch(j[2]||'s'){case's':case'S':h+=parseInt(j[1]);break;case'm':case'M':g+=parseInt(j[1]);break;case'h':case'H':f+=parseInt(j[1]);break;case'd':case'D':e+=parseInt(j[1]);break;case'w':case'W':e+=parseInt(j[1])*7;break;case'o':case'O':d+=parseInt(j[1]);e=Math.min(e,n(c,d));break;case'y':case'Y':c+=parseInt(j[1]);e=Math.min(e,n(c,d));break}j=i.exec(a)}b=new Date(c,d,e,f,g,h,0);return b};var p=(k==null?l:(typeof k=='string'?o(k):(typeof k=='number'?m(k):k)));if(p)p.setMilliseconds(0);return p},_generateHTML:function(c){c._periods=periods=(c._hold?c._periods:this._calculatePeriods(c,c._show,new Date()));var d=false;var e=0;for(var f=0;f<c._show.length;f++){d|=(c._show[f]=='?'&&periods[f]>0);c._show[f]=(c._show[f]=='?'&&!d?null:c._show[f]);e+=(c._show[f]?1:0)}var g=this._get(c,'compact');var h=this._get(c,'layout');var i=(g?this._get(c,'compactLabels'):this._get(c,'labels'));var j=this._get(c,'timeSeparator');var k=this._get(c,'description')||'';var l=function(a){return(a<10?'0':'')+a};var m=function(a){var b=jq.countdown._get(c,'compactLabels'+periods[a]);return(c._show[a]?periods[a]+(b?b[a]:i[a])+' ':'')};var n=function(a){var b=jq.countdown._get(c,'labels'+periods[a]);return(c._show[a]?'<div class="countdown_section"><span class="countdown_amount">'+periods[a]+'</span><br/>'+(b?b[a]:i[a])+'</div>':'')};return(h?this._buildLayout(c,h,g):((g?'<div class="countdown_row countdown_amount'+(c._hold?' countdown_holding':'')+'">'+m(Y)+m(O)+m(W)+m(D)+(c._show[H]?l(periods[H]):'')+(c._show[M]?(c._show[H]?j:'')+l(periods[M]):'')+(c._show[S]?(c._show[H]||c._show[M]?j:'')+l(periods[S]):''):'<div class="countdown_row countdown_show'+e+(c._hold?' countdown_holding':'')+'">'+n(Y)+n(O)+n(W)+n(D)+n(H)+n(M)+n(S))+'</div>'+(k?'<div class="countdown_row countdown_descr">'+k+'</div>':'')))},_buildLayout:function(f,g,h){var i=(h?this._get(f,'compactLabels'):this._get(f,'labels'));var j=g;var k=function(a,b){var c=new RegExp('%'+a+'.*%'+a);var d=new RegExp('%'+a+'.*');while(true){var e=c.exec(j);if(!e){break}e[0]=e[0].substr(0,2)+e[0].substr(2).replace(d,'%'+a);j=j.replace(e[0],f._show[b]?l(e[0],a,b):'')}};var l=function(a,b,c){var d=jq.countdown._get(f,(h?'compactLabels':'labels')+f._periods[c]);return a.substr(2,a.length-4).replace(/%nn/g,(f._periods[c]<10?'0':'')+f._periods[c]).replace(/%n/g,f._periods[c]).replace(/%l/g,(d?d[c]:i[c]))};k('Y',Y);k('O',O);k('W',W);k('D',D);k('H',H);k('M',M);k('S',S);return j},_determineShow:function(a){var b=this._get(a,'format');var c=[];c[Y]=(b.match('y')?'?':(b.match('Y')?'!':null));c[O]=(b.match('o')?'?':(b.match('O')?'!':null));c[W]=(b.match('w')?'?':(b.match('W')?'!':null));c[D]=(b.match('d')?'?':(b.match('D')?'!':null));c[H]=(b.match('h')?'?':(b.match('H')?'!':null));c[M]=(b.match('m')?'?':(b.match('M')?'!':null));c[S]=(b.match('s')?'?':(b.match('S')?'!':null));return c},_calculatePeriods:function(c,d,e){c._now=e;c._now.setMilliseconds(0);var f=new Date(c._now.getTime());if(c._since&&e.getTime()<c._since.getTime()){c._now=e=f}else if(c._since){e=c._since}else{f.setTime(c._until.getTime());if(e.getTime()>c._until.getTime()){c._now=e=f}}f.setTime(f.getTime()-c._offset);var g=[0,0,0,0,0,0,0];if(d[Y]||d[O]){var h=Math.max(0,(f.getFullYear()-e.getFullYear())*12+f.getMonth()-e.getMonth()+(f.getDate()<e.getDate()?-1:0));g[Y]=(d[Y]?Math.floor(h/12):0);g[O]=(d[O]?h-g[Y]*12:0);if(c._since){f.setFullYear(f.getFullYear()-g[Y]);f.setMonth(f.getMonth()-g[O])}else{e=new Date(e.getTime());e.setFullYear(e.getFullYear()+g[Y]);e.setMonth(e.getMonth()+g[O])}}var i=Math.floor((f.getTime()-e.getTime())/1000);var j=function(a,b){g[a]=(d[a]?Math.floor(i/b):0);i-=g[a]*b};j(W,604800);j(D,86400);j(H,3600);j(M,60);j(S,1);return g}});function extendRemove(a,b){jq.extend(a,b);for(var c in b){if(b[c]==null){a[c]=null}}return a}jq.fn.countdown=function(a){var b=Array.prototype.slice.call(arguments,1);if(a=='getTimes'){return jq.countdown['_'+a+'Countdown'].apply(jq.countdown,[this[0]].concat(b))}return this.each(function(){if(typeof a=='string'){jq.countdown['_'+a+'Countdown'].apply(jq.countdown,[this].concat(b))}else{jq.countdown._attachCountdown(this,a)}})};jq.countdown=new Countdown()})(jQuery);


/* - ++resource++freitag.theme.javascripts/jquery.flash.js - */
/**
 * Flash (http://jquery.lukelutman.com/plugins/flash)
 * A jQuery plugin for embedding Flash movies.
 * 
 * Version 1.0
 * November 9th, 2006
 *
 * Copyright (c) 2006 Luke Lutman (http://www.lukelutman.com)
 * Dual licensed under the MIT and GPL licenses.
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.opensource.org/licenses/gpl-license.php
 * 
 * Inspired by:
 * SWFObject (http://blog.deconcept.com/swfobject/)
 * UFO (http://www.bobbyvandersluis.com/ufo/)
 * sIFR (http://www.mikeindustries.com/sifr/)
 * 
 * IMPORTANT: 
 * The packed version of jQuery breaks ActiveX control
 * activation in Internet Explorer. Use JSMin to minifiy
 * jQuery (see: http://jquery.lukelutman.com/plugins/flash#activex).
 *
 **/ 
;(function(){
	
var $$;

/**
 * 
 * @desc Replace matching elements with a flash movie.
 * @author Luke Lutman
 * @version 1.0.1
 *
 * @name flash
 * @param Hash htmlOptions Options for the embed/object tag.
 * @param Hash pluginOptions Options for detecting/updating the Flash plugin (optional).
 * @param Function replace Custom block called for each matched element if flash is installed (optional).
 * @param Function update Custom block called for each matched if flash isn't installed (optional).
 * @type jQuery
 *
 * @cat plugins/flash
 * 
 * @example $('#hello').flash({ src: 'hello.swf' });
 * @desc Embed a Flash movie.
 *
 * @example $('#hello').flash({ src: 'hello.swf' }, { version: 8 });
 * @desc Embed a Flash 8 movie.
 *
 * @example $('#hello').flash({ src: 'hello.swf' }, { expressInstall: true });
 * @desc Embed a Flash movie using Express Install if flash isn't installed.
 *
 * @example $('#hello').flash({ src: 'hello.swf' }, { update: false });
 * @desc Embed a Flash movie, don't show an update message if Flash isn't installed.
 *
**/
$$ = jQuery.fn.flash = function(htmlOptions, pluginOptions, replace, update) {
	
	// Set the default block.
	var block = replace || $$.replace;
	
	// Merge the default and passed plugin options.
	pluginOptions = $$.copy($$.pluginOptions, pluginOptions);
	
	// Detect Flash.
	if(!$$.hasFlash(pluginOptions.version)) {
		// Use Express Install (if specified and Flash plugin 6,0,65 or higher is installed).
		if(pluginOptions.expressInstall && $$.hasFlash(9,0,115)) {
			// Add the necessary flashvars (merged later).
			var expressInstallOptions = {
				flashvars: {  	
					MMredirectURL: location,
					MMplayerType: 'PlugIn',
					MMdoctitle: jQuery('title').text() 
				}					
			};
		// Ask the user to update (if specified).
		} else if (pluginOptions.update) {
			// Change the block to insert the update message instead of the flash movie.
			block = update || $$.update;
		// Fail
		} else {
			// The required version of flash isn't installed.
			// Express Install is turned off, or flash 6,0,65 isn't installed.
			// Update is turned off.
			// Return without doing anything.
			return this;
		}
	}
	
	// Merge the default, express install and passed html options.
	htmlOptions = $$.copy($$.htmlOptions, expressInstallOptions, htmlOptions);
	
	// Invoke $block (with a copy of the merged html options) for each element.
	return this.each(function(){
		block.call(this, $$.copy(htmlOptions));
	});
	
};
/**
 *
 * @name flash.copy
 * @desc Copy an arbitrary number of objects into a new object.
 * @type Object
 * 
 * @example $$.copy({ foo: 1 }, { bar: 2 });
 * @result { foo: 1, bar: 2 };
 *
**/
$$.copy = function() {
	var options = {}, flashvars = {};
	for(var i = 0; i < arguments.length; i++) {
		var arg = arguments[i];
		if(arg == undefined) continue;
		jQuery.extend(options, arg);
		// don't clobber one flash vars object with another
		// merge them instead
		if(arg.flashvars == undefined) continue;
		jQuery.extend(flashvars, arg.flashvars);
	}
	options.flashvars = flashvars;
	return options;
};
/*
 * @name flash.hasFlash
 * @desc Check if a specific version of the Flash plugin is installed
 * @type Boolean
 *
**/
$$.hasFlash = function() {
	// look for a flag in the query string to bypass flash detection
	if(/hasFlash\=true/.test(location)) return true;
	if(/hasFlash\=false/.test(location)) return false;
	var pv = $$.hasFlash.playerVersion().match(/\d+/g);
	var rv = String([arguments[0], arguments[1], arguments[2]]).match(/\d+/g) || String($$.pluginOptions.version).match(/\d+/g);
	for(var i = 0; i < 3; i++) {
		pv[i] = parseInt(pv[i] || 0);
		rv[i] = parseInt(rv[i] || 0);
		// player is less than required
		if(pv[i] < rv[i]) return false;
		// player is greater than required
		if(pv[i] > rv[i]) return true;
	}
	// major version, minor version and revision match exactly
	return true;
};
/**
 *
 * @name flash.hasFlash.playerVersion
 * @desc Get the version of the installed Flash plugin.
 * @type String
 *
**/
$$.hasFlash.playerVersion = function() {
	// ie
	try {
		try {
			// avoid fp6 minor version lookup issues
			// see: http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
			var axo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6');
			try { axo.AllowScriptAccess = 'always';	} 
			catch(e) { return '6,0,0'; }				
		} catch(e) {}
		return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g, ',').match(/^,?(.+),?$/)[1];
	// other browsers
	} catch(e) {
		try {
			if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){
				return (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1];
			}
		} catch(e) {}		
	}
	return '0,0,0';
};
/**
 *
 * @name flash.htmlOptions
 * @desc The default set of options for the object or embed tag.
 *
**/
$$.htmlOptions = {
	height: 240,
	flashvars: {},
	pluginspage: 'http://www.adobe.com/go/getflashplayer',
	src: '#',
	type: 'application/x-shockwave-flash',
	width: 320		
};
/**
 *
 * @name flash.pluginOptions
 * @desc The default set of options for checking/updating the flash Plugin.
 *
**/
$$.pluginOptions = {
	expressInstall: false,
	update: true,
	version: '9.0.115'
};
/**
 *
 * @name flash.replace
 * @desc The default method for replacing an element with a Flash movie.
 *
**/
$$.replace = function(htmlOptions) {
	this.innerHTML = '<div class="alt">'+this.innerHTML+'</div>';
	jQuery(this)
		.addClass('flash-replaced')
		.prepend($$.transform(htmlOptions));
};
/**
 *
 * @name flash.update
 * @desc The default method for replacing an element with an update message.
 *
**/
$$.update = function(htmlOptions) {
	var url = String(location).split('?');
	url.splice(1,0,'?hasFlash=true&');
	url = url.join('');
	var msg = '<p>This content requires the Flash Player. <a href="http://www.adobe.com/go/getflashplayer">Download Flash Player</a>. Already have Flash Player? <a href="'+url+'">Click here.</a></p>';
	this.innerHTML = '<span class="alt">'+this.innerHTML+'</span>';
	jQuery(this)
		.addClass('flash-update')
		.prepend(msg);
};
/**
 *
 * @desc Convert a hash of html options to a string of attributes, using Function.apply(). 
 * @example toAttributeString.apply(htmlOptions)
 * @result foo="bar" foo="bar"
 *
**/
function toAttributeString() {
	var s = '';
	for(var key in this)
		if(typeof this[key] != 'function')
			s += key+'="'+this[key]+'" ';
	return s;		
};
/**
 *
 * @desc Convert a hash of flashvars to a url-encoded string, using Function.apply(). 
 * @example toFlashvarsString.apply(flashvarsObject)
 * @result foo=bar&foo=bar
 *
**/
function toFlashvarsString() {
	var s = '';
	for(var key in this)
		if(typeof this[key] != 'function')
			s += key+'='+encodeURIComponent(this[key])+'&';
	return s.replace(/&$/, '');		
};
/**
 *
 * @name flash.transform
 * @desc Transform a set of html options into an embed tag.
 * @type String 
 *
 * @example $$.transform(htmlOptions)
 * @result <embed src="foo.swf" ... />
 *
 * Note: The embed tag is NOT standards-compliant, but it 
 * works in all current browsers. flash.transform can be
 * overwritten with a custom function to generate more 
 * standards-compliant markup.
 *
**/
$$.transform = function(htmlOptions) {
	htmlOptions.toString = toAttributeString;
	if(htmlOptions.flashvars) htmlOptions.flashvars.toString = toFlashvarsString;
	return '<embed ' + String(htmlOptions) + '/>';		
};

/**
 *
 * Flash Player 9 Fix (http://blog.deconcept.com/2006/07/28/swfobject-143-released/)
 *
**/
if (window.attachEvent) {
	window.attachEvent("onbeforeunload", function(){
		__flash_unloadHandler = function() {};
		__flash_savedUnloadHandler = function() {};
	});
}
	
})();

/* - ++resource++freitag.theme.javascripts/jclock.js - */
/*
 * jQuery jclock - Clock plugin - v 0.2.1
 * http://plugins.jquery.com/project/jclock
 *
 * Copyright (c) 2007-2008 Doug Sparling <http://www.dougsparling.com>
 * Licensed under the MIT License:
 *   http://www.opensource.org/licenses/mit-license.php
 */
(function($) {

  $.fn.jclock = function(options) {
    var version = '0.2.1';

    // options
    var opts = $.extend({}, $.fn.jclock.defaults, options);
         
    return this.each(function() {
      $this = $(this);
      $this.timerID = null;
      $this.running = false;

      var o = $.meta ? $.extend({}, opts, $this.data()) : opts;

      $this.timeNotation = o.timeNotation;
      $this.am_pm = o.am_pm;
      $this.utc = o.utc;
      $this.utc_offset = o.utc_offset;

      $this.css({
        fontFamily: o.fontFamily,
        fontSize: o.fontSize,
        backgroundColor: o.background,
        color: o.foreground
      });

      $.fn.jclock.startClock($this);

    });
  };
       
  $.fn.jclock.startClock = function(el) {
    $.fn.jclock.stopClock(el);
    $.fn.jclock.displayTime(el);
  }
  $.fn.jclock.stopClock = function(el) {
    if(el.running) {
      clearTimeout(el.timerID);
    }
    el.running = false;
  }
  $.fn.jclock.displayTime = function(el) {
    var time = $.fn.jclock.getTime(el);
    el.html(time);
    el.timerID = setTimeout(function(){$.fn.jclock.displayTime(el)},1000);
  }
  $.fn.jclock.getTime = function(el) {
    var now = new Date();
    var hours, minutes, seconds;

    if(el.utc == true) {
      if(el.utc_offset != 0) {
        now.setUTCHours(now.getUTCHours()+el.utc_offset);
      }
      hours = now.getUTCHours();
      minutes = now.getUTCMinutes();
      seconds = now.getUTCSeconds();
    } else {
      hours = now.getHours();
      minutes = now.getMinutes();
      seconds = now.getSeconds();
    }

    var am_pm_text = '';
    (hours >= 12) ? am_pm_text = " P.M." : am_pm_text = " A.M.";

    if (el.timeNotation == '12h') {
      hours = ((hours > 12) ? hours - 12 : hours);
    } else {
      hours   = ((hours <  10) ? "0" : "") + hours;
    }

    minutes = ((minutes <  10) ? "0" : "") + minutes;
    seconds = ((seconds <  10) ? "0" : "") + seconds;

    // var timeNow = hours + ":" + minutes + ":" + seconds;
    var timeNow = hours + ":" + minutes;
    if ( (el.timeNotation == '12h') && (el.am_pm == true) ) {
     timeNow += am_pm_text;
    }

    return timeNow;
  };
       
  // plugin defaults
  $.fn.jclock.defaults = {
    timeNotation: '24h',
    am_pm: false,
    utc: false,
    fontFamily: '',
    fontSize: '',
    foreground: '',
    background: '',
    utc_offset: 0
  };

})(jQuery);

/* - ++resource++freitag.theme.javascripts/jquery-tooltip.js - */
/*
 * jQuery Tooltip plugin 1.3
 *
 * http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/
 * http://docs.jquery.com/Plugins/Tooltip
 *
 * Copyright (c) 2006 - 2008 Jörn Zaefferer
 *
 * $Id: jquery.tooltip.js 5741 2008-06-21 15:22:16Z joern.zaefferer $
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */

;(function($) {

		// the tooltip element
	var helper = {},
		// the current tooltipped element
		current,
		// the title of the current element, used for restoring
		title,
		// timeout id for delayed tooltips
		tID,
		// IE 5.5 or 6
		IE = $.browser.msie && /MSIE\s(5\.5|6\.)/.test(navigator.userAgent),
		// flag for mouse tracking
		track = false;

	$.tooltip = {
		blocked: false,
		defaults: {
			delay: 200,
			fade: false,
			showURL: true,
			extraClass: "",
			top: 15,
			left: 15,
			id: "tooltip"
		},
		block: function() {
			$.tooltip.blocked = !$.tooltip.blocked;
		}
	};

	$.fn.extend({
		tooltip: function(settings) {
			settings = $.extend({}, $.tooltip.defaults, settings);
			createHelper(settings);
			return this.each(function() {
					$.data(this, "tooltip", settings);
					this.tOpacity = helper.parent.css("opacity");
					// copy tooltip into its own expando and remove the title
					this.tooltipText = this.title;
					$(this).removeAttr("title");
					// also remove alt attribute to prevent default tooltip in IE
					this.alt = "";
				})
				.mouseover(save)
				.mouseout(hide)
				.click(hide);
		},
		fixPNG: IE ? function() {
			return this.each(function () {
				var image = $(this).css('backgroundImage');
				if (image.match(/^url\(["']?(.*\.png)["']?\)$/i)) {
					image = RegExp.$1;
					$(this).css({
						'backgroundImage': 'none',
						'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='" + image + "')"
					}).each(function () {
						var position = $(this).css('position');
						if (position != 'absolute' && position != 'relative')
							$(this).css('position', 'relative');
					});
				}
			});
		} : function() { return this; },
		unfixPNG: IE ? function() {
			return this.each(function () {
				$(this).css({'filter': '', backgroundImage: ''});
			});
		} : function() { return this; },
		hideWhenEmpty: function() {
			return this.each(function() {
				$(this)[ $(this).html() ? "show" : "hide" ]();
			});
		},
		url: function() {
			return this.attr('href') || this.attr('src');
		}
	});

	function createHelper(settings) {
		// there can be only one tooltip helper
		if( helper.parent )
			return;
		// create the helper, h3 for title, div for url
		helper.parent = $('<div id="' + settings.id + '"><h3></h3><div class="body"></div><div class="url"></div></div>')
			// add to document
			.appendTo(document.body)
			// hide it at first
			.hide();

		// apply bgiframe if available
		if ( $.fn.bgiframe )
			helper.parent.bgiframe();

		// save references to title and url elements
		helper.title = $('h3', helper.parent);
		helper.body = $('div.body', helper.parent);
		helper.url = $('div.url', helper.parent);
	}

	function settings(element) {
		return $.data(element, "tooltip");
	}

	// main event handler to start showing tooltips
	function handle(event) {
		// show helper, either with timeout or on instant
		if( settings(this).delay )
			tID = setTimeout(show, settings(this).delay);
		else
			show();

		// if selected, update the helper position when the mouse moves
		track = !!settings(this).track;
		$(document.body).bind('mousemove', update);

		// update at least once
		update(event);
	}

	// save elements title before the tooltip is displayed
	function save() {
		// if this is the current source, or it has no title (occurs with click event), stop
		if ( $.tooltip.blocked || this == current || (!this.tooltipText && !settings(this).bodyHandler) )
			return;

		// save current
		current = this;
		title = this.tooltipText;

		if ( settings(this).bodyHandler ) {
			helper.title.hide();
			var bodyContent = settings(this).bodyHandler.call(this);
			if (bodyContent.nodeType || bodyContent.jquery) {
				helper.body.empty().append(bodyContent)
			} else {
				helper.body.html( bodyContent );
			}
			helper.body.show();
		} else if ( settings(this).showBody ) {
			var parts = title.split(settings(this).showBody);
			helper.title.html(parts.shift()).show();
			helper.body.empty();
			for(var i = 0, part; (part = parts[i]); i++) {
				if(i > 0)
					helper.body.append("<br/>");
				helper.body.append(part);
			}
			helper.body.hideWhenEmpty();
		} else {
			helper.title.html(title).show();
			helper.body.hide();
		}

		// if element has href or src, add and show it, otherwise hide it
		if( settings(this).showURL && $(this).url() )
			helper.url.html( $(this).url().replace('http://', '') ).show();
		else
			helper.url.hide();

		// add an optional class for this tip
		helper.parent.addClass(settings(this).extraClass);

		// fix PNG background for IE
		if (settings(this).fixPNG )
			helper.parent.fixPNG();

		handle.apply(this, arguments);
	}

	// delete timeout and show helper
	function show() {
		tID = null;
		if ((!IE || !$.fn.bgiframe) && settings(current).fade) {
			if (helper.parent.is(":animated"))
				helper.parent.stop().show().fadeTo(settings(current).fade, current.tOpacity);
			else
				helper.parent.is(':visible') ? helper.parent.fadeTo(settings(current).fade, current.tOpacity) : helper.parent.fadeIn(settings(current).fade);
		} else {
			helper.parent.show();
		}
		update();
	}

	/**
	 * callback for mousemove
	 * updates the helper position
	 * removes itself when no current element
	 */
	function update(event)	{
		if($.tooltip.blocked)
			return;

		if (event && event.target.tagName == "OPTION") {
			return;
		}

		// stop updating when tracking is disabled and the tooltip is visible
		if ( !track && helper.parent.is(":visible")) {
			$(document.body).unbind('mousemove', update)
		}

		// if no current element is available, remove this listener
		if( current == null ) {
			$(document.body).unbind('mousemove', update);
			return;
		}

		// remove position helper classes
		helper.parent.removeClass("viewport-right").removeClass("viewport-bottom");

		var left = helper.parent[0].offsetLeft;
		var top = helper.parent[0].offsetTop;
		if (event) {
			// position the helper 15 pixel to bottom right, starting from mouse position
			left = event.pageX + settings(current).left;
			top = event.pageY + settings(current).top;
			var right='auto';
			if (settings(current).positionLeft) {
				right = $(window).width() - left;
				left = 'auto';
			}
			helper.parent.css({
				left: left,
				right: right,
				top: top,
				'z-index': 1010
			});
		}

		var v = viewport(),
			h = helper.parent[0];
		// check horizontal position
		if (v.x + v.cx < h.offsetLeft + h.offsetWidth) {
			left -= h.offsetWidth + 20 + settings(current).left;
			helper.parent.css({left: left + 'px'}).addClass("viewport-right");
		}
		// check vertical position
		if (v.y + v.cy < h.offsetTop + h.offsetHeight) {
			top -= h.offsetHeight + 20 + settings(current).top;
			helper.parent.css({top: top + 'px'}).addClass("viewport-bottom");
		}
	}

	function viewport() {
		return {
			x: $(window).scrollLeft(),
			y: $(window).scrollTop(),
			cx: $(window).width(),
			cy: $(window).height()
		};
	}

	// hide helper and restore added classes and the title
	function hide(event) {
		if($.tooltip.blocked)
			return;
		// clear timeout if possible
		if(tID)
			clearTimeout(tID);
		// no more current element
		current = null;

		var tsettings = settings(this);
		function complete() {
			helper.parent.removeClass( tsettings.extraClass ).hide().css("opacity", "");
		}
		if ((!IE || !$.fn.bgiframe) && tsettings.fade) {
			if (helper.parent.is(':animated'))
				helper.parent.stop().fadeTo(tsettings.fade, 0, complete);
			else
				helper.parent.stop().fadeOut(tsettings.fade, complete);
		} else
			complete();

		if( settings(this).fixPNG )
			helper.parent.unfixPNG();
	}

})(jQuery);


