
//
// SOFTWARE NAME: eZ Publish
// COPYRIGHT NOTICE: Copyright (C) 1999-2008 eZ Systems AS
// NOTICE: >
//   modify it under the terms of version 2.0  of the GNU General
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   GNU General Public License for more details.
//   Public License along with this program; if not, write to the Free
//   MA 02110-1301, USA.
//
function ezjs_toggleCheckboxes( formname, checkboxname )
{
with( formname )
{
for( var i=0; i<elements.length; i++ )
{
if( elements[i].type == 'checkbox' && elements[i].name == checkboxname && elements[i].disabled == "" )
{
if( elements[i].checked == true )
{
elements[i].checked = false;
}
else
{
elements[i].checked = true;
}
}
}
}
}
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(b($){$.m.E=$.m.g=b(s){h($.x.10&&/6.0/.I(D.B)){s=$.w({c:\'3\',5:\'3\',8:\'3\',d:\'3\',k:M,e:\'F:i;\'},s||{});C a=b(n){f n&&n.t==r?n+\'4\':n},p=\'<o Y="g"W="0"R="-1"e="\'+s.e+\'"\'+\'Q="P:O;N:L;z-H:-1;\'+(s.k!==i?\'G:J(K=\\\'0\\\');\':\'\')+\'c:\'+(s.c==\'3\'?\'7(((l(2.9.j.A)||0)*-1)+\\\'4\\\')\':a(s.c))+\';\'+\'5:\'+(s.5==\'3\'?\'7(((l(2.9.j.y)||0)*-1)+\\\'4\\\')\':a(s.5))+\';\'+\'8:\'+(s.8==\'3\'?\'7(2.9.S+\\\'4\\\')\':a(s.8))+\';\'+\'d:\'+(s.d==\'3\'?\'7(2.9.v+\\\'4\\\')\':a(s.d))+\';\'+\'"/>\';f 2.T(b(){h($(\'> o.g\',2).U==0)2.V(q.X(p),2.u)})}f 2}})(Z);',62,63,'||this|auto|px|left||expression|width|parentNode||function|top|height|src|return|bgiframe|if|false|currentStyle|opacity|parseInt|fn||iframe|html|document|Number||constructor|firstChild|offsetHeight|extend|browser|borderLeftWidth||borderTopWidth|userAgent|var|navigator|bgIframe|javascript|filter|index|test|Alpha|Opacity|absolute|true|position|block|display|style|tabindex|offsetWidth|each|length|insertBefore|frameborder|createElement|class|jQuery|msie'.split('|'),0,{}))
;(function($) {
$.fn.extend({
autocomplete: function(urlOrData, options) {
var isUrl = typeof urlOrData == "string";
options = $.extend({}, $.Autocompleter.defaults, {
url: isUrl ? urlOrData : null,
data: isUrl ? null : urlOrData,
delay: isUrl ? $.Autocompleter.defaults.delay : 10,
max: options && !options.scroll ? 10 : 150
}, options);
options.highlight = options.highlight || function(value) { return value; };
options.formatMatch = options.formatMatch || options.formatItem;
return this.each(function() {
new $.Autocompleter(this, options);
});
},
result: function(handler) {
return this.bind("result", handler);
},
search: function(handler) {
return this.trigger("search", [handler]);
},
flushCache: function() {
return this.trigger("flushCache");
},
setOptions: function(options){
return this.trigger("setOptions", [options]);
},
unautocomplete: function() {
return this.trigger("unautocomplete");
}
});
$.Autocompleter = function(input, options) {
var KEY = {
UP: 38,
DOWN: 40,
DEL: 46,
TAB: 9,
RETURN: 13,
ESC: 27,
COMMA: 188,
PAGEUP: 33,
PAGEDOWN: 34,
BACKSPACE: 8
};
var $input = $(input).attr("autocomplete", "off").addClass(options.inputClass);
var timeout;
var previousValue = "";
var cache = $.Autocompleter.Cache(options);
var hasFocus = 0;
var lastKeyPressCode;
var config = {
mouseDownOnSelect: false
};
var select = $.Autocompleter.Select(options, input, selectCurrent, config);
$input.keydown(function(event) {
lastKeyPressCode = event.keyCode;
switch(event.keyCode) {
case KEY.UP:
event.preventDefault();
if ( select.visible() ) {
select.prev();
} else {
onChange(0, true);
}
break;
case KEY.DOWN:
event.preventDefault();
if ( select.visible() ) {
select.next();
} else {
onChange(0, true);
}
break;
case KEY.PAGEUP:
event.preventDefault();
if ( select.visible() ) {
select.pageUp();
} else {
onChange(0, true);
}
break;
case KEY.PAGEDOWN:
event.preventDefault();
if ( select.visible() ) {
select.pageDown();
} else {
onChange(0, true);
}
break;
case options.multiple && $.trim(options.multipleSeparator) == "," && KEY.COMMA:
case KEY.TAB:
case KEY.RETURN:
if( selectCurrent() ){
event.preventDefault();
}
break;
case KEY.ESC:
select.hide();
break;
default:
clearTimeout(timeout);
timeout = setTimeout(onChange, options.delay);
break;
}
}).keypress(function() {
}).focus(function(){
// results if the field no longer has focus
hasFocus++;
}).blur(function() {
hasFocus = 0;
if (!config.mouseDownOnSelect) {
hideResults();
}
}).click(function() {
if ( hasFocus++ > 1 && !select.visible() ) {
onChange(0, true);
}
}).bind("search", function() {
var fn = (arguments.length > 1) ? arguments[1] : null;
function findValueCallback(q, data) {
var result;
if( data && data.length ) {
for (var i=0; i < data.length; i++) {
if( data[i].result.toLowerCase() == q.toLowerCase() ) {
result = data[i];
break;
}
}
}
if( typeof fn == "function" ) fn(result);
else $input.trigger("result", result && [result.data, result.value]);
}
$.each(trimWords($input.val()), function(i, value) {
request(value, findValueCallback, findValueCallback);
});
}).bind("flushCache", function() {
cache.flush();
}).bind("setOptions", function() {
$.extend(options, arguments[1]);
if ( "data" in arguments[1] )
cache.populate();
}).bind("unautocomplete", function() {
select.unbind();
$input.unbind();
});
function selectCurrent() {
var selected = select.selected();
if( !selected )
return false;
var v = selected.result;
previousValue = v;
if ( options.multiple ) {
var words = trimWords($input.val());
if ( words.length > 1 ) {
v = words.slice(0, words.length - 1).join( options.multipleSeparator ) + options.multipleSeparator + v;
}
v += options.multipleSeparator;
}
$input.val(v);
hideResultsNow();
$input.trigger("result", [selected.data, selected.value]);
return true;
}
function onChange(crap, skipPrevCheck) {
if( lastKeyPressCode == KEY.DEL ) {
select.hide();
return;
}
var currentValue = $input.val();
if ( !skipPrevCheck && currentValue == previousValue )
return;
previousValue = currentValue;
currentValue = lastWord(currentValue);
if ( currentValue.length >= options.minChars) {
$input.addClass(options.loadingClass);
if (!options.matchCase)
currentValue = currentValue.toLowerCase();
request(currentValue, receiveData, hideResultsNow);
} else {
stopLoading();
select.hide();
}
};
function trimWords(value) {
if ( !value ) {
return [""];
}
var words = value.split( options.multipleSeparator );
var result = [];
$.each(words, function(i, value) {
if ( $.trim(value) )
result[i] = $.trim(value);
});
return result;
}
function lastWord(value) {
if ( !options.multiple )
return value;
var words = trimWords(value);
return words[words.length - 1];
}
// q: the term entered
function autoFill(q, sValue){
// if the last user key pressed was backspace, don't autofill
if( options.autoFill && (lastWord($input.val()).toLowerCase() == q.toLowerCase()) && lastKeyPressCode != KEY.BACKSPACE ) {
$input.val($input.val() + sValue.substring(lastWord(previousValue).length));
$.Autocompleter.Selection(input, previousValue.length, previousValue.length + sValue.length);
}
};
function hideResults() {
clearTimeout(timeout);
timeout = setTimeout(hideResultsNow, 200);
};
function hideResultsNow() {
select.hide();
clearTimeout(timeout);
stopLoading();
if (options.mustMatch) {
$input.search(
function (result){
if( !result ) $input.val("");
}
);
}
};
function receiveData(q, data) {
if ( data && data.length && hasFocus ) {
stopLoading();
select.display(data, q);
autoFill(q, data[0].value);
select.show();
} else {
hideResultsNow();
}
};
function request(term, success, failure) {
if (!options.matchCase)
term = term.toLowerCase();
var data = cache.load(term);
if (data && data.length) {
success(term, data);
} else if( (typeof options.url == "string") && (options.url.length > 0) ){
var extraParams = {
timestamp: +new Date()
};
$.each(options.extraParams, function(key, param) {
extraParams[key] = typeof param == "function" ? param() : param;
});
$.ajax({
mode: "abort",
port: "autocomplete" + input.name,
dataType: options.dataType,
url: options.url,
data: $.extend({
q: lastWord(term),
limit: options.max
}, extraParams),
success: function(data) {
var parsed = options.parse && options.parse(data) || parse(data);
cache.add(term, parsed);
success(term, parsed);
}
});
} else {
select.emptyList();
failure(term);
}
};
function parse(data) {
var parsed = [];
var rows = data.split("\n");
for (var i=0; i < rows.length; i++) {
var row = $.trim(rows[i]);
if (row) {
row = row.split("|");
parsed[parsed.length] = {
data: row,
value: row[0],
result: options.formatResult && options.formatResult(row, row[0]) || row[0]
};
}
}
return parsed;
};
function stopLoading() {
$input.removeClass(options.loadingClass);
};
};
$.Autocompleter.defaults = {
inputClass: "ac_input",
resultsClass: "ac_results",
loadingClass: "ac_loading",
minChars: 1,
delay: 400,
matchCase: false,
matchSubset: true,
matchContains: false,
cacheLength: 10,
max: 100,
mustMatch: false,
extraParams: {},
selectFirst: true,
formatItem: function(row) { return row[0]; },
formatMatch: null,
autoFill: false,
width: 0,
multiple: false,
multipleSeparator: ", ",
highlight: function(value, term) {
return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>");
},
scroll: true,
scrollHeight: 180
};
$.Autocompleter.Cache = function(options) {
var data = {};
var length = 0;
function matchSubset(s, sub) {
if (!options.matchCase)
s = s.toLowerCase();
var i = s.indexOf(sub);
if (i == -1) return false;
return i == 0 || options.matchContains;
};
function add(q, value) {
if (length > options.cacheLength){
flush();
}
if (!data[q]){
length++;
}
data[q] = value;
}
function populate(){
if( !options.data ) return false;
var stMatchSets = {},
nullData = 0;
if( !options.url ) options.cacheLength = 1;
stMatchSets[""] = [];
for ( var i = 0, ol = options.data.length; i < ol; i++ ) {
var rawValue = options.data[i];
rawValue = (typeof rawValue == "string") ? [rawValue] : rawValue;
var value = options.formatMatch(rawValue, i+1, options.data.length);
if ( value === false )
continue;
var firstChar = value.charAt(0).toLowerCase();
if( !stMatchSets[firstChar] )
stMatchSets[firstChar] = [];
var row = {
value: value,
data: rawValue,
result: options.formatResult && options.formatResult(rawValue) || value
};
stMatchSets[firstChar].push(row);
if ( nullData++ < options.max ) {
stMatchSets[""].push(row);
}
};
$.each(stMatchSets, function(i, value) {
options.cacheLength++;
add(i, value);
});
}
setTimeout(populate, 25);
function flush(){
data = {};
length = 0;
}
return {
flush: flush,
add: add,
populate: populate,
load: function(q) {
if (!options.cacheLength || !length)
return null;
if( !options.url && options.matchContains ){
var csub = [];
for( var k in data ){
// this prevents duplicates
if( k.length > 0 ){
var c = data[k];
$.each(c, function(i, x) {
if (matchSubset(x.value, q)) {
csub.push(x);
}
});
}
}
return csub;
} else
if (data[q]){
return data[q];
} else
if (options.matchSubset) {
for (var i = q.length - 1; i >= options.minChars; i--) {
var c = data[q.substr(0, i)];
if (c) {
var csub = [];
$.each(c, function(i, x) {
if (matchSubset(x.value, q)) {
csub[csub.length] = x;
}
});
return csub;
}
}
}
return null;
}
};
};
$.Autocompleter.Select = function (options, input, select, config) {
var CLASSES = {
ACTIVE: "ac_over"
};
var listItems,
active = -1,
data,
term = "",
needsInit = true,
element,
list;
function init() {
if (!needsInit)
return;
element = $("<div/>")
.hide()
.addClass(options.resultsClass)
.css("position", "absolute")
.appendTo(document.body);
list = $("<ul>").appendTo(element).mouseover( function(event) {
if(target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') {
active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event));
$(target(event)).addClass(CLASSES.ACTIVE);
}
}).click(function(event) {
$(target(event)).addClass(CLASSES.ACTIVE);
select();
input.focus();
return false;
}).mousedown(function() {
config.mouseDownOnSelect = true;
}).mouseup(function() {
config.mouseDownOnSelect = false;
});
if( options.width > 0 )
element.css("width", options.width);
needsInit = false;
}
function target(event) {
var element = event.target;
while(element && element.tagName != "LI")
element = element.parentNode;
if(!element)
return [];
return element;
}
function moveSelect(step) {
listItems.slice(active, active + 1).removeClass(CLASSES.ACTIVE);
movePosition(step);
var activeItem = listItems.slice(active, active + 1).addClass(CLASSES.ACTIVE);
if(options.scroll) {
var offset = 0;
listItems.slice(0, active).each(function() {
offset += this.offsetHeight;
});
if((offset + activeItem[0].offsetHeight - list.scrollTop()) > list[0].clientHeight) {
list.scrollTop(offset + activeItem[0].offsetHeight - list.innerHeight());
} else if(offset < list.scrollTop()) {
list.scrollTop(offset);
}
}
};
function movePosition(step) {
active += step;
if (active < 0) {
active = listItems.size() - 1;
} else if (active >= listItems.size()) {
active = 0;
}
}
function limitNumberOfItems(available) {
return options.max && options.max < available
? options.max
: available;
}
function fillList() {
list.empty();
var max = limitNumberOfItems(data.length);
for (var i=0; i < max; i++) {
if (!data[i])
continue;
var formatted = options.formatItem(data[i].data, i+1, max, data[i].value, term);
if ( formatted === false )
continue;
var li = $("<li>").html( options.highlight(formatted, term) ).addClass(i%2 == 0 ? "ac_event" : "ac_odd").appendTo(list)[0];
$.data(li, "ac_data", data[i]);
}
listItems = list.find("li");
if ( options.selectFirst ) {
listItems.slice(0, 1).addClass(CLASSES.ACTIVE);
active = 0;
}
list.bgiframe();
}
return {
display: function(d, q) {
init();
data = d;
term = q;
fillList();
},
next: function() {
moveSelect(1);
},
prev: function() {
moveSelect(-1);
},
pageUp: function() {
if (active != 0 && active - 8 < 0) {
moveSelect( -active );
} else {
moveSelect(-8);
}
},
pageDown: function() {
if (active != listItems.size() - 1 && active + 8 > listItems.size()) {
moveSelect( listItems.size() - 1 - active );
} else {
moveSelect(8);
}
},
hide: function() {
element && element.hide();
active = -1;
},
visible : function() {
return element && element.is(":visible");
},
current: function() {
return this.visible() && (listItems.filter("." + CLASSES.ACTIVE)[0] || options.selectFirst && listItems[0]);
},
show: function() {
var offset = $(input).offset();
element.css({
width: typeof options.width == "string" || options.width > 0 ? options.width : $(input).width(),
top: offset.top + input.offsetHeight,
left: offset.left
}).show();
if(options.scroll) {
list.scrollTop(0);
list.css({
maxHeight: options.scrollHeight,
overflow: 'auto'
});
if($.browser.msie && typeof document.body.style.maxHeight === "undefined") {
var listHeight = 0;
listItems.each(function() {
listHeight += this.offsetHeight;
});
var scrollbarsVisible = listHeight > options.scrollHeight;
list.css('height', scrollbarsVisible ? options.scrollHeight : listHeight );
if (!scrollbarsVisible) {
listItems.width( list.width() - parseInt(listItems.css("padding-left")) - parseInt(listItems.css("padding-right")) );
}
}
}
},
selected: function() {
var selected = listItems && listItems.filter("." + CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);
return selected && selected.length && $.data(selected[0], "ac_data");
},
emptyList: function (){
list && list.empty();
},
unbind: function() {
element && element.remove();
}
};
};
$.Autocompleter.Selection = function(field, start, end) {
if( field.createTextRange ){
var selRange = field.createTextRange();
selRange.collapse(true);
selRange.moveStart("character", start);
selRange.moveEnd("character", end);
selRange.select();
} else if( field.setSelectionRange ){
field.setSelectionRange(start, end);
} else {
if( field.selectionStart ){
field.selectionStart = start;
field.selectionEnd = end;
}
}
field.focus();
};
})(jQuery);
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(s($){3.1s.1k=s(j){j=3.1a({12:\'1m.1j\'},j);8 k=(n.P=="r 10 Z"&&U(n.v)==4&&n.v.E("14 5.5")!=-1);8 l=(n.P=="r 10 Z"&&U(n.v)==4&&n.v.E("14 6.0")!=-1);o(3.17.16&&(k||l)){3(2).L("1r[@m$=.M]").z(s(){3(2).7(\'q\',3(2).q());3(2).7(\'p\',3(2).p());8 a=\'\';8 b=\'\';8 c=(3(2).7(\'K\'))?\'K="\'+3(2).7(\'K\')+\'" \':\'\';8 d=(3(2).7(\'A\'))?\'A="\'+3(2).7(\'A\')+\'" \':\'\';8 e=(3(2).7(\'C\'))?\'C="\'+3(2).7(\'C\')+\'" \':\'\';8 f=(3(2).7(\'B\'))?\'B="\'+3(2).7(\'B\')+\'" \':\'\';8 g=(3(2).7(\'R\'))?\'1d:\'+3(2).7(\'R\')+\';\':\'\';8 h=(3(2).1c().7(\'1b\'))?\'19:18;\':\'\';o(2.9.y){a+=\'y:\'+2.9.y+\';\';2.9.y=\'\'}o(2.9.t){a+=\'t:\'+2.9.t+\';\';2.9.t=\'\'}o(2.9.w){a+=\'w:\'+2.9.w+\';\';2.9.w=\'\'}8 i=(2.9.15);b+=\'<x \'+c+d+e+f;b+=\'9="13:11;1q-1p:1o-1n;O:W-V;N:1l;\'+g+h;b+=\'q:\'+3(2).q()+\'u;\'+\'p:\'+3(2).p()+\'u;\';b+=\'J:I:H.r.G\'+\'(m=\\\'\'+3(2).7(\'m\')+\'\\\', D=\\\'F\\\');\';b+=i+\'"></x>\';o(a!=\'\'){b=\'<x 9="13:11;O:W-V;\'+a+h+\'q:\'+3(2).q()+\'u;\'+\'p:\'+3(2).p()+\'u;\'+\'">\'+b+\'</x>\'}3(2).1i();3(2).1h(b)});3(2).L("*").z(s(){8 a=3(2).T(\'N-S\');o(a.E(".M")!=-1){8 b=a.X(\'1g("\')[1].X(\'")\')[0];3(2).T(\'N-S\',\'1f\');3(2).Q(0).Y.J="I:H.r.G(m=\'"+b+"\',D=\'F\')"}});3(2).L("1e[@m$=.M]").z(s(){8 a=3(2).7(\'m\');3(2).Q(0).Y.J=\'I:H.r.G\'+\'(m=\\\'\'+a+\'\\\', D=\\\'F\\\');\';3(2).7(\'m\',j.12)})}1t 3}})(3);',62,92,'||this|jQuery||||attr|var|style|||||||||||||src|navigator|if|height|width|Microsoft|function|padding|px|appVersion|margin|span|border|each|class|alt|title|sizingMethod|indexOf|scale|AlphaImageLoader|DXImageTransform|progid|filter|id|find|png|background|display|appName|get|align|image|css|parseInt|block|inline|split|runtimeStyle|Explorer|Internet|relative|blankgif|position|MSIE|cssText|msie|browser|hand|cursor|extend|href|parent|float|input|none|url|after|hide|gif|pngFix|transparent|blank|line|pre|space|white|img|fn|return'.split('|'),0,{}))
;(function(){var $$;$$=jQuery.fn.flash=function(htmlOptions,pluginOptions,replace,update){var block=replace||$$.replace;pluginOptions=$$.copy($$.pluginOptions,pluginOptions);if(!$$.hasFlash(pluginOptions.version)){if(pluginOptions.expressInstall&&$$.hasFlash(6,0,65)){var expressInstallOptions={flashvars:{MMredirectURL:location,MMplayerType:'PlugIn',MMdoctitle:jQuery('title').text()}};}else if(pluginOptions.update){block=update||$$.update;}else{return this;}}htmlOptions=$$.copy($$.htmlOptions,expressInstallOptions,htmlOptions);return this.each(function(){block.call(this,$$.copy(htmlOptions));});};$$.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);if(arg.flashvars==undefined)continue;jQuery.extend(flashvars,arg.flashvars);}options.flashvars=flashvars;return options;};$$.hasFlash=function(){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);if(pv[i]<rv[i])return false;if(pv[i]>rv[i])return true;}return true;};$$.hasFlash.playerVersion=function(){try{try{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];}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';};$$.htmlOptions={flashvars:{},pluginspage:'http://www.adobe.com/go/getflashplayer',src:'#',type:'application/x-shockwave-flash'};$$.pluginOptions={expressInstall:false,update:true,version:'6.0.65'};$$.replace=function(htmlOptions){this.innerHTML='<div class="alt">'+this.innerHTML+'</div>';jQuery(this).addClass('flash-replaced').prepend($$.transform(htmlOptions));};$$.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);};function toAttributeString(){var s='';for(var key in this)if(typeof this[key]!='function')s+=key+'="'+this[key]+'" ';return s;};function toFlashvarsString(){var s='';for(var key in this)if(typeof this[key]!='function')s+=key+'='+encodeURIComponent(this[key])+'&';return s.replace(/&$/,'');};$$.transform=function(htmlOptions){htmlOptions.toString=toAttributeString;if(htmlOptions.flashvars)htmlOptions.flashvars.toString=toFlashvarsString;return'<embed '+String(htmlOptions)+'/>';};if(window.attachEvent){window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};});}})();
(function($){$.fn.sifr=function(prefs){var t=true,u=undefined,s,p;s=arguments.callee.prefs=arguments.callee.prefs||{asHex:function(x){var d=['0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'];return isNaN(x)?'00':d[(x-x%16)/16]+d[x%16];},colors:{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]},toHex:function(color){var rgb;if(!color){return u;}return(rgb=color.match(/rgb\(([0-9]+),\s([0-9]+),\s([0-9]+)\)/))?'#'+this.asHex(rgb[1])+this.asHex(rgb[2])+this.asHex(rgb[3]):(rgb=this.colors[color])?'#'+this.asHex(rgb[0])+this.asHex(rgb[1])+this.asHex(rgb[2]):(color.length===4)?color.replace(/\#([0-9a-z])([0-9a-z])([0-9a-z])/,'#$1$1$2$2$3$3'):color;}};p=$.extend({},s,(prefs===false)?{unsifr:true}:prefs);if(p.save===t){arguments.callee.prefs=$.extend(p,{save:false});}if(this[0]===document){return;}if(!p.unsifr&&typeof p.before==='function'){p.before.apply(this,[p]);}this.each(function(){var ele=$(this),txt,alt,fir,embedOptions;fir=ele.children('.sIFR-alternate');if(fir){ele.html(fir.html());if(p.unsifr){return;}}if(typeof p.beforeEach==='function'){p.beforeEach.apply(this,[t,p]);}fir=ele.addClass('sIFR-replaced').wrapInner('<span class="sIFR-alternate" style="position: absolute; "></span>').children('.sIFR-alternate');alt=ele.append('<span class="sIFR-jquery" style="">'+$.trim(fir.text())+'</span>').children('.sIFR-jquery');txt=$.trim(fir.html()).replace(/(>)\s+|\s+(<)/g,'$1$2').replace(/(id|name)=[A-Za-z0-9]+/g,'');if(p.textTransform){p.textTransform=p.textTransform.toLowerCase();if(p.textTransform==='uppercase'){txt=txt.toUpperCase();}if(p.textTransform==='lowercase'){txt=txt.html().toLowerCase();}if(p.textTransform==='capitalize'){var cap=txt.split(/(\s|\>)/);txt='';for(var i in cap){txt+=cap[i].charAt(0).toUpperCase()+cap[i].substr(1);}}}txt=ele.attr('href')?'<a href="'+ele.attr('href')+'">'+txt+'</a>':txt;embedOptions={flashvars:$.extend({h:alt.height()*(p.zoom||1),offsetLeft:p.offsetLeft||u,offsetTop:p.offsetTop||u,textAlign:p.textAlign||ele.css('textAlign').match(/left|center|right/)||'center',textColor:p.toHex(p.color||ele.css('color'))||u,txt:p.content||txt,underline:(p.underline===t||ele.css('textDecoration')==='underline')?t:u,w:alt.width()*(p.zoom||1)},p.flashvars),height:p.height||alt.height(),src:(p.path||'').replace(/([^\/])$/,'$1/')+(p.font||ele.css('fontFamily').replace(/^\s+|\s+$|,[\S|\s]+|'|"|(,)\s+/g,'$1')).replace(/([^\.][^s][^w][^f])$/,'$1.swf'),style:'margin: 1px 0 0; position: absolute; vertical-align: text-top;',width:p.width||alt.width(),wmode:'transparent'};embedOptions.flashvars.linkColor=p.toHex(p.link||ele.find('a').css('color'))||embedOptions.flashvars.textColor;embedOptions.flashvars.hoverColor=p.toHex(p.hover)||embedOptions.flashvars.linkColor;if(p.zoom){embedOptions.flashvars.offsetTop=((p.offsetTop||0)+((alt.height()-(alt.height()*p.zoom))/2))*(p.zoomTop||1);embedOptions.flashvars.offsetLeft=((p.offsetLeft||0)+((alt.width()-(alt.width()*p.zoom))/2))*(p.zoomLeft||1);}$().flash($.extend(embedOptions,p.embedOptions),$.extend({expressInstall:p.expressInstall||false,version:p.version||7,update:p.update||false},p.pluginOptions),function(options){fir.attr('style','visibility: hidden;');alt.remove();ele.prepend($.fn.flash.transform(options));});if(typeof p.afterEach==='function'){p.afterEach.apply(this,[t,p]);}});if(!p.unsifr&&typeof p.after==='function'){p.after.apply(this,[p]);}};$.fn.unsifr=function(){return this.each(function(){$(this).sifr(false);});};$.sifr=function(prefs){$(document).sifr($.extend({save:true},prefs));};$.sifr();})(jQuery);
(function($) {
var elements;
var settings;
var glast;
var current;
$.fn.innerfade = function(options) {
return this.each(function() {
$.innerfade(this, options);
});
};
$.innerfade = function(container, options) {
settings = {
'animationtype':    'fade',
'speed':            'normal',
'type':             'sequence',
'timeout':          2000,
'containerheight':  'auto',
'runningclass':     'innerfade',
'children':         null
};
if (options)
$.extend(settings, options);
if (settings.children === null)
elements = $(container).children();
else
elements = $(container).children(settings.children);
if (elements.length > 1) {
$(container).css('position', 'relative').css('height', settings.containerheight).addClass(settings.runningclass);
for (var i = 0; i < elements.length; i++) {
$(elements[i]).css('z-index', String(elements.length-i)).css('position', 'absolute').hide();
};
if (settings.type == "sequence") {
a = setTimeout(function() {
$.innerfade.next(elements, settings, 1, 0);
}, settings.timeout);
$(elements[0]).show();
} else if (settings.type == "random") {
last = Math.floor ( Math.random () * ( elements.length ) );
a = setTimeout(function() {
do {
current = Math.floor ( Math.random ( ) * ( elements.length ) );
} while (last == current );
$.innerfade.next(elements, settings, current, last);
}, settings.timeout);
$(elements[last]).show();
} else if ( settings.type == 'random_start' ) {
settings.type = 'sequence';
current = Math.floor ( Math.random () * ( elements.length ) );
a = setTimeout(function(){
$.innerfade.next(elements, settings, (current + 1) %  elements.length, current);
}, settings.timeout);
$(elements[current]).show();
}	else {
alert('Innerfade-Type must either be \'sequence\', \'random\' or \'random_start\'');
}
}
};
$.innerfade.next = function(elements, settings, current, last, sto) {
if (settings.animationtype == 'slide') {
$(elements[last]).slideUp(settings.speed);
$(elements[current]).slideDown(settings.speed);
} else if (settings.animationtype == 'fade') {
$(elements[last]).fadeOut(settings.speed);
$(elements[current]).fadeIn(settings.speed, function() {
removeFilter($(this)[0]);
});
} else
alert('Innerfade-animationtype must either be \'slide\' or \'fade\'');
if (settings.type == "sequence") {
if ((current + 1) < elements.length) {
current = current + 1;
last = current - 1;
} else {
current = 0;
last = elements.length - 1;
}
} else if (settings.type == "random") {
last = current;
while (current == last)
current = Math.floor(Math.random() * elements.length);
} else
alert('Innerfade-Type must either be \'sequence\', \'random\' or \'random_start\'');
timeOut = ( sto>0 ) ? sto : settings.timeout;
glast = last;
$('#headerpagination').removeClass();
$('#headerpagination').addClass('hp'+(last+1));
a = setTimeout((function() {
$.innerfade.next(elements, settings, current, last);
}), timeOut);
};
$.innerfade.fadeTo = function(to) {
clearTimeout(a);
if (glast == undefined) {
glast = 0;
}
if( glast != to )
$.innerfade.next(elements, settings, to, glast, (settings.timeout*2));
else
a = setTimeout((function() {
$.innerfade.next(elements, settings, current, glast);
}), (settings.timeout*2));
};
})(jQuery);
function removeFilter(element) {
if(element.style.removeAttribute){
element.style.removeAttribute('filter');
}
}
;(function($){
$.superfish = {};
$.superfish.o = [];
$.superfish.op = {};
$.superfish.defaults = {
hoverClass	: 'sfHover',
pathClass	: 'overideThisToUse',
delay		: 800,
animation	: {opacity:'show'},
speed		: 'normal',
oldJquery	: false,
disableHI	: false,
onInit		: function(){},
onBeforeShow: function(){},
onShow		: function(){},
onHide		: function(){}
};
$.fn.superfish = function(op){
var bcClass = 'sfbreadcrumb',
over = function(){
var $$ = $(this), menu = getMenu($$);
getOpts(menu,true);
clearTimeout(menu.sfTimer);
$$.showSuperfishUl().siblings().hideSuperfishUl();
},
out = function(){
var $$ = $(this), menu = getMenu($$);
var o = getOpts(menu,true);
clearTimeout(menu.sfTimer);
if ( !$$.is('.'+bcClass) ) {
menu.sfTimer=setTimeout(function(){
$$.hideSuperfishUl();
if (o.$path.length){over.call(o.$path);}
},o.delay);
}
},
getMenu = function($el){ return $el.parents('ul.superfish:first')[0]; },
getOpts = function(el,menuFound){ el = menuFound ? el : getMenu(el); return $.superfish.op = $.superfish.o[el.serial]; },
hasUl = function(){ return $.superfish.op.oldJquery ? 'li[ul]' : 'li:has(ul)'; };
return this.each(function() {
var s = this.serial = $.superfish.o.length;
var o = $.extend({},$.superfish.defaults,op);
o.$path = $('li.'+o.pathClass,this).each(function(){
$(this).addClass(o.hoverClass+' '+bcClass)
.filter(hasUl()).removeClass(o.pathClass);
});
$.superfish.o[s] = $.superfish.op = o;
$(hasUl(),this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out)
.not('.'+bcClass)
.hideSuperfishUl();
var $a = $('a',this);
$a.each(function(i){
var $li = $a.eq(i).parents('li');
$a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});
});
o.onInit.call(this);
}).addClass('superfish');
};
$.fn.extend({
hideSuperfishUl : function(){
var o = $.superfish.op,
$ul = $('li.'+o.hoverClass,this).add(this).removeClass(o.hoverClass)
.find('>ul').hide().css('visibility','hidden');
o.onHide.call($ul);
return this;
},
showSuperfishUl : function(){
var o = $.superfish.op,
$ul = this.addClass(o.hoverClass)
.find('>ul:hidden').css('visibility','visible');
o.onBeforeShow.call($ul);
$ul.animate(o.animation,o.speed,function(){ o.onShow.call(this); });
return this;
}
});
$(window).unload(function(){
$('ul.superfish').each(function(){
$('li',this).unbind('mouseover','mouseout','mouseenter','mouseleave');
});
});
})(jQuery);
function makeSublist(parent,child,isSubselectOptional,childVal)
{
$("body").append("<select style='display:none' id='"+parent+child+"'></select>");
$('#'+parent+child).html($("#"+child+" option"));
var parentValue = $('#'+parent).attr('value');
$('#'+child).html($("#"+parent+child+" .sub_"+parentValue).clone());
childVal = (typeof childVal == "undefined")? "" : childVal ;
$("#"+child+' option[@value="'+ childVal +'"]').attr('selected','selected');
$('#'+parent).change(
function()
{
var parentValue = $('#'+parent).attr('value');
$('#'+child).html($("#"+parent+child+" .sub_"+parentValue).clone());
if(isSubselectOptional) $('#'+child).prepend("<option value='none'> -- Select -- </option>");
$('#'+child).trigger("change");
$('#'+child).focus();
}
);
}
$(document).ready(function()
{
makeSublist('child','grandsun', true, '');
makeSublist('parent','child', false, '1');
});
// Developed under license to FotoNotes LLC
// See the bottom of this file for configuration.
var aeOL = [];
function addEvent(o, n, f, l){
var a = 'addEventListener', h = 'on' + n, b = '', s = '';
if (o[a] && !l)
return o[a](n, f, false);
o._c |= 0;
if (o[h]) {
b = '_f' + o._c++;
o[b] = o[h];
}
s = '_f' + o._c++;
o[s] = f;
o[h] = function(e){
e = e || window.event;
var r = true;
if (b)
r = o[b](e) != false && r;
r = o[s](e) != false && r;
return r;
};
aeOL[aeOL.length] = {
o: o,
h: h
};
};
addEvent(window, 'unload', function(){
for (var i = 0; i < aeOL.length; i++)
with (aeOL[i]) {
o[h] = null;
for (var c = 0; o['_f' + c]; c++)
o['_f' + c] = null;
}
});
function cancelEvent(e, c){
e.returnValue = false;
if (e.preventDefault)
e.preventDefault();
if (c) {
e.cancelBubble = true;
if (e.stopPropagation)
e.stopPropagation();
}
};
// (c) 2005 Angus Turnbull http://www.twinhelix.come
function DragResize(myName, config){
var props = {
myName: myName, // Name of the object.
enabled: true, // Global toggle of drag/resize.
handles: ['tl', 'tm', 'tr', 'ml', 'mr', 'bl', 'bm', 'br'], // Array of drag handles: top/mid/.
isElement: null, // Function ref to test for an element.
isHandle: null, // Function ref to test for move handle.
element: null, // The currently selected element.
dragging: null, // Active handle reference of the element.
minWidth: 10,
minHeight: 10, // Minimum pixel size of elements.
minLeft: 0,
maxRight: 9999, // Bounding box area.
minTop: 0,
maxBottom: 9999,
zIndex: 1, // The highest Z-Index yet allocated.
mouseX: 0,
mouseY: 0, // Current mouse position, recorded live.
lastMouseX: 0,
lastMouseY: 0, // Last processed mouse positions.
mOffX: 0,
mOffY: 0, // A known offset between position & mouse.
elmX: 0,
elmY: 0, // Element position.
elmW: 0,
elmH: 0, // Element size.
allowBlur: true, // Whether to allow automatic blur onclick.
ondragfocus: null, // Event handler functions.
ondragstart: null,
ondragmove: null,
ondragend: null,
ondragblur: null
};
for (var p in props) {
this[p] = (typeof config[p] == 'undefined') ? props[p] : config[p];
}
};
DragResize.prototype.apply = function(node){
var obj = this;
addEvent(node, 'mousedown', function(e){
obj.mouseDown(e)
});
addEvent(node, 'mousemove', function(e){
obj.mouseMove(e)
});
addEvent(node, 'mouseup', function(e){
obj.mouseUp(e)
});
};
DragResize.prototype.handleSet = function(elm, show){
with (this) {
// If we're showing them, and no handles have been created, create 4 new ones.
if (!elm._handle_tr) {
for (var h = 0; h < handles.length; h++) {
var hDiv = document.createElement('div');
hDiv.className = myName + ' ' + myName + '-' + handles[h];
elm['_handle_' + handles[h]] = elm.appendChild(hDiv);
}
}
for (var h = 0; h < handles.length; h++) {
elm['_handle_' + handles[h]].style.visibility = show ? 'inherit' : 'hidden';
}
}
};
DragResize.prototype.select = function(newElement){
with (this) {
if (!document.getElementById || !enabled)
return;
if (newElement && (newElement != element) && enabled) {
element = newElement;
element.style.zIndex = ++zIndex;
handleSet(element, true);
elmX = parseInt(element.style.left);
elmY = parseInt(element.style.top);
elmW = element.offsetWidth;
elmH = element.offsetHeight;
if (ondragfocus)
this.ondragfocus();
}
}
};
DragResize.prototype.deselect = function(keepHandles){
with (this) {
// remove the handles from the element and clears the element flag,
if (!document.getElementById || !enabled)
return;
if (!keepHandles) {
if (ondragblur)
this.ondragblur();
handleSet(element, false);
element = null;
}
dragging = null;
mOffX = 0;
mOffY = 0;
}
};
DragResize.prototype.mouseDown = function(e){
with (this) {
// We also initialise the resize boxes, and drag parameters like mouse position etc.
if (!document.getElementById || !enabled)
return true;
var elm = e.target || e.srcElement, newElement = null, newHandle = null, hRE = new RegExp(myName + '-([trmbl]{2})', '');
while (elm) {
if (elm.className) {
if (!newHandle && (hRE.test(elm.className) || isHandle(elm)))
newHandle = elm;
if (isElement(elm)) {
newElement = elm;
break
}
}
elm = elm.parentNode;
}
// which will hide its handles and clear element.
if (element && (element != newElement) && allowBlur)
deselect(false);
if (newElement && (!element || (newElement == element))) {
cancelEvent(e);
select(newElement, newHandle);
dragging = newHandle;
if (dragging && ondragstart)
this.ondragstart();
}
}
};
DragResize.prototype.mouseMove = function(e){
with (this) {
// last recorded mouse position (mouseX/Y) and the current mouse position.
if (!document.getElementById || !enabled)
return true;
mouseX = e.pageX || e.clientX + document.documentElement.scrollLeft;
mouseY = e.pageY || e.clientY + document.documentElement.scrollTop;
// Add any previously stored&ignored offset to the calculations.
var diffX = mouseX - lastMouseX + mOffX;
var diffY = mouseY - lastMouseY + mOffY;
mOffX = mOffY = 0;
lastMouseX = mouseX;
lastMouseY = mouseY;
if (!dragging)
return true;
var hClass = dragging && dragging.className &&
dragging.className.match(new RegExp(myName + '-([tmblr]{2})')) ? RegExp.$1 : '';
// Bounds checking is the hard bit -- basically for each edge, check that the
var rs = 0, dY = diffY, dX = diffX;
if (hClass.indexOf('t') >= 0) {
rs = 1;
if (elmH - dY < minHeight)
mOffY = (dY - (diffY = elmH - minHeight));
else
if (elmY + dY < minTop)
mOffY = (dY - (diffY = minTop - elmY));
elmY += diffY;
elmH -= diffY;
}
if (hClass.indexOf('b') >= 0) {
rs = 1;
if (elmH + dY < minHeight)
mOffY = (dY - (diffY = minHeight - elmH));
else
if (elmY + elmH + dY > maxBottom)
mOffY = (dY - (diffY = maxBottom - elmY - elmH));
elmH += diffY;
}
if (hClass.indexOf('l') >= 0) {
rs = 1;
if (elmW - dX < minWidth)
mOffX = (dX - (diffX = elmW - minWidth));
else
if (elmX + dX < minLeft)
mOffX = (dX - (diffX = minLeft - elmX));
elmX += diffX;
elmW -= diffX;
}
if (hClass.indexOf('r') >= 0) {
rs = 1;
if (elmW + dX < minWidth)
mOffX = (dX - (diffX = minWidth - elmW));
else
if (elmX + elmW + dX > maxRight)
mOffX = (dX - (diffX = maxRight - elmX - elmW));
elmW += diffX;
}
if (dragging && !rs) {
if (elmX + dX < minLeft)
mOffX = (dX - (diffX = minLeft - elmX));
else
if (elmX + elmW + dX > maxRight)
mOffX = (dX - (diffX = maxRight - elmX - elmW));
if (elmY + dY < minTop)
mOffY = (dY - (diffY = minTop - elmY));
else
if (elmY + elmH + dY > maxBottom)
mOffY = (dY - (diffY = maxBottom - elmY - elmH));
elmX += diffX;
elmY += diffY;
}
with (element.style) {
left = elmX + 'px';
width = elmW + 'px';
top = elmY + 'px';
height = elmH + 'px';
}
if (window.opera && document.documentElement) {
var oDF = document.getElementById('op-drag-fix');
if (!oDF) {
var oDF = document.createElement('input');
oDF.id = 'op-drag-fix';
oDF.style.display = 'none';
document.body.appendChild(oDF);
}
oDF.focus();
}
if (ondragmove)
this.ondragmove();
cancelEvent(e);
}
};
DragResize.prototype.mouseUp = function(e){
with (this) {
if (!document.getElementById || !enabled)
return;
if (ondragend)
this.ondragend();
deselect(true);
}
};
var _f_idcount = 1;
function fnElementFade(elm, show){
var speed = show ? 20 : 10;
elm._f_count |= 0;
elm._f_timer |= null;
clearTimeout(elm._f_timer);
if (show && !elm._f_count)
elm.style.visibility = 'inherit';
elm._f_count = Math.max(0, Math.min(100, elm._f_count + speed * (show ? 1 : -1)));
var f = elm.filters, done = (elm._f_count == 100);
if (f) {
if (!done && elm.style.filter.indexOf("alpha") == -1)
elm.style.filter += ' alpha(opacity=' + elm._f_count + ')';
else
if (f.length && f.alpha)
with (f.alpha) {
if (done)
enabled = false;
else {
opacity = elm._f_count;
enabled = true
}
}
}
else
elm.style.opacity = elm.style.MozOpacity = elm._f_count / 100.1;
if (!show && !elm._f_count)
elm.style.visibility = 'hidden';
if (elm._f_count % 100) {
var id = elm.id;
if (!id) {
while (!id || document.getElementById(id))
id = '_f_id_' + _f_idcount++;
elm.id = id;
}
elm._f_timer = setTimeout('fnElementFade(document.getElementById("' + id +
'"), ' +
show +
')', 50);
}
};
function fnClassSet(elm, active){
elm.className = elm.className.replace((active ? (/-inactive/) : (/-active/)), (active ? '-active' : '-inactive'));
};
function fnGetContainer(node){
var container = node;
while (container) {
if ((/fn-container/).test(container.className))
break;
container = container.parentNode;
}
return container;
};
function fnGetControlBar(container){
var controlBar = null;
for (var i = 0; i < container.childNodes.length; i++) {
if ((/fn-controlbar/).test(container.childNodes.item(i).className)) {
controlBar = container.childNodes.item(i);
break;
}
}
return controlBar;
};
function fnContainerSet(container, active){
// the appropriate "toggle" item in its control bar.
var controlBar = fnGetControlBar(container);
for (var i = 0; i < controlBar.childNodes.length; i++) {
if ((/fn-controlbar-toggle/).test(controlBar.childNodes.item(i).className)) {
fnClassSet(controlBar.childNodes.item(i), !active);
break;
}
}
fnClassSet(container, active);
};
function fnAction(action, trigger){
// Control the state of the trigger buttons, and set the global fnActionVerb variable.
if (fnActionVerb != action) {
if (fnActionTrigger && fnActionVerb)
fnClassSet(fnActionTrigger, false);
fnActionVerb = action;
fnActionTrigger = trigger;
if (trigger)
fnClassSet(trigger, true);
}
else {
fnActionVerb = '';
if (trigger)
fnClassSet(trigger, false);
}
};
function fnMouseOverOutHandler(evt, isOver){
var node = evt.target || evt.srcElement;
if (node.nodeType != 1)
node = node.parentNode;
while (node && !((node.className || '').indexOf('fn-container') > -1)) {
// No mouseovers if fnActionVerb is set (i.e. editing/deleting/adding/etc).
if (node && ((node.className || '').indexOf('fn-area') > -1) && !fnActionVerb) {
var area = node;
var note = area.firstChild;
while (note && note.nodeType != 1)
note = note.nextSibling;
if (!note)
return;
// We record the currently active note for the hide timer to work, and also elevate
clearTimeout(fnHideTimer);
if (isOver) {
if (fnActiveNote && (note != fnActiveNote))
fnElementFade(fnActiveNote, false);
fnElementFade(note, true);
if (fnActiveNote)
fnActiveNote.parentNode.style.zIndex = 1;
note.parentNode.style.zIndex = 2;
fnActiveNote = note;
}
else {
fnHideTimer = setTimeout('if (fnActiveNote) { ' +
'fnElementFade(fnActiveNote, false); fnActiveNote = null }', 200);
}
}
node = node.parentNode;
}
};
function fnClickHandler(evt){
var node = evt.target || evt.srcElement;
if (node.nodeType != 1)
node = node.parentNode;
while (node && !((node.className || '').indexOf('fn-container') > -1)) {
if ((/fn-editbar-ok/).test(node.className))
return fnEditButtonHandler(true);
if ((/fn-editbar-cancel/).test(node.className))
return fnEditButtonHandler(false);
if (fnEditingData)
return;
// has been clicked, check if we're editing/deleting it.
if ((/fn-area/).test(node.className)) {
var area = node;
if (fnActionVerb == 'del')
fnDelNote(area);
if (fnActionVerb == 'edit') {
var note = area.firstChild;
while (note && note.nodeType != 1)
note = note.nextSibling;
if (note)
fnEditNote(note);
}
return;
}
if ((/fn-controlbar-logo/).test(node.className)) {
var isActive = ((/fn-controlbar-active/).test(node.parentNode.className));
fnClassSet(node.parentNode, !isActive);
return;
}
if ((/fn-controlbar-credits/).test(node.className)) {
alert(FN_CREDITS);
return;
}
if ((/fn-controlbar-del/).test(node.className)) {
if (!fnXMLHTTP)
return alert(FN_POST_UNSUPPORTED);
if (FN_DELETE == 'deny')
return alert(FN_DISALLOWED);
return fnAction('del', node);
}
if ((/fn-controlbar-edit/).test(node.className)) {
if (!fnXMLHTTP)
return alert(FN_POST_UNSUPPORTED);
if (FN_MODIFY == 'deny')
return alert(FN_DISALLOWED);
return fnAction('edit', node);
}
if ((/fn-controlbar-add/).test(node.className)) {
if (!fnXMLHTTP)
return alert(FN_POST_UNSUPPORTED);
if (FN_ADD == 'deny')
return alert(FN_DISALLOWED);
return fnAddNote(node);
}
if ((/fn-controlbar-toggle/).test(node.className)) {
var container = fnGetContainer(node);
if (container) {
var isActive = ((/fn-container-active/).test(container.className));
fnContainerSet(container, !isActive);
}
}
node = node.parentNode;
}
};
function fnEditUISet(show){
if (!fnEditingData)
return;
with (fnEditingData) {
if (show)
dragresize.select(area, area);
else
dragresize.deselect();
area.className = show ? 'fn-area-editing' : 'fn-area';
fnElementFade(form, show);
fnClassSet(form, show);
fnContainerSet(container, !show);
fnClassSet(fnGetControlBar(container), !show);
}
};
function fnAddNote(node){
// Find the parent container of this node.
var container = fnGetContainer(node);
if (!container)
return;
fnAction('add', node);
var newArea = document.createElement('div');
newArea.className = 'fn-area';
newArea.style.left = (container.offsetWidth / 2 - 25) + 'px';
newArea.style.top = (container.offsetHeight / 2 - 25) + 'px';
newArea.style.width = '50px';
newArea.style.height = '50px';
var newNote = document.createElement('div');
newNote.className = 'fn-note';
newArea.appendChild(newNote);
var newTitle = document.createElement('span');
newTitle.className = 'fn-note-title';
newNote.appendChild(newTitle);
var newContent = document.createElement('span');
newContent.className = 'fn-note-content';
newNote.appendChild(newContent);
var newAuthor = document.createElement('span');
newAuthor.className = 'fn-note-author';
newNote.appendChild(newAuthor);
var newID = document.createElement('span');
newID.className = 'fn-note-id';
newID.title = '';
newArea.appendChild(newID);
container.appendChild(newArea);
fnEditingData = {
area: newArea,
note: newNote
};
fnEditNote();
};
function fnEditNote(note){
var area = null;
if (note) {
area = note.parentNode;
fnEditingData = {
area: area,
note: note
};
}
else {
area = fnEditingData.area;
note = fnEditingData.note;
}
var container = fnGetContainer(area);
if (!container)
return;
var form = container.getElementsByTagName('form');
if (!form)
return;
form = form.item(0);
var oldTitle = '', oldAuthor = '', oldContent = '', noteID = '';
var fields = area.getElementsByTagName('span');
for (var n = 0; n < fields.length; n++) {
var field = fields.item(n);
if (field.className == 'fn-note-id')
noteID = field.getAttribute('title');
if (field.className == 'fn-note-title')
oldTitle = field.innerHTML;
if (field.className == 'fn-note-author')
oldAuthor = field.innerHTML;
if (field.className == 'fn-note-content')
oldContent = field.innerHTML;
}
// It already has the .note and .area properties.
fnEditingData.container = container;
fnEditingData.form = form;
fnEditingData.noteID = noteID;
fnEditingData.oldTitle = oldTitle;
fnEditingData.oldAuthor = oldAuthor;
fnEditingData.oldContent = oldContent;
fnEditingData.oldLeft = parseInt(area.style.left);
fnEditingData.oldTop = parseInt(area.style.top);
fnEditingData.oldWidth = area.offsetWidth;
fnEditingData.oldHeight = area.offsetHeight;
fnEditingData.newTitle = fnEditingData.newAuthor = fnEditingData.newContent = '';
fnEditingData.newLeft = fnEditingData.newTop = 0;
fnEditingData.newWidth = fnEditingData.newHeight = 0;
var inputs = form.getElementsByTagName('input');
for (var i = 0; i < inputs.length; i++) {
if ((/title/).test(inputs[i].className))
inputs[i].value = oldTitle;
if ((/author/).test(inputs[i].className))
inputs[i].value = oldAuthor;
}
var textarea = form.getElementsByTagName('textarea');
if (textarea && (/content/).test(textarea.item(0).className))
textarea.item(0).value = br2nl(oldContent);
fnEditUISet(true);
};
function fnEscapeHTML(html){
//return html.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;');
return html;
};
function fnEditButtonHandler(ok){
// Pass a boolean value indicating if the OK button was clicked (so save should proceed).
if (!fnEditingData)
return;
with (fnEditingData) {
if (ok) {
var inputs = form.getElementsByTagName('input');
for (var i = 0; i < inputs.length; i++) {
if ((/title/).test(inputs[i].className))
newTitle = inputs[i].value;
if ((/author/).test(inputs[i].className))
newAuthor = inputs[i].value;
}
var textarea = form.getElementsByTagName('textarea');
if (textarea && (/content/).test(textarea.item(0).className))
newContent = textarea.item(0).value;
newLeft = parseInt(area.style.left);
newTop = parseInt(area.style.top);
newWidth = area.offsetWidth;
newHeight = area.offsetHeight;
var sFact = 1;
for (var n = 0; n < container.childNodes.length; n++) {
if ((/fn-scalefactor/).test(container.childNodes.item(n).className))
sFact = parseFloat(container.childNodes.item(n).getAttribute('title'));
}
fnPostXML('<feed><entry>' +
(fnActionVerb == 'edit' ? '<id>' + noteID + '</id>' : '') +
'<fn:selection><fn:boundingBox>' +
(newLeft / sFact) +
',' +
(newTop / sFact) +
',' +
((newLeft + newWidth) / sFact) +
',' +
((newTop + newHeight) / sFact) +
'</fn:boundingBox></fn:selection>' +
'<title>' +
fnEscapeHTML(newTitle) +
'</title>' +
'<issued></issued>' +
'<created></created>' +
'<fn:tag></fn:tag>' +
'<summary></summary>' +
'<author>' +
fnEscapeHTML(newAuthor) +
'</author>' +
'<content type="text/html" mode="escaped">' +
fnEscapeHTML(newContent) +
'</content>' +
'</entry></feed>');
}
else {
if (fnActionVerb == 'add') {
area.parentNode.removeChild(area);
}
else {
area.style.left = oldLeft + 'px';
area.style.top = oldTop + 'px';
area.style.width = oldWidth + 'px';
area.style.height = oldHeight + 'px';
}
fnEditUISet(false);
fnAction('', null);
fnEditingData = null;
}
}
};
function fnDelNote(area){
// Find the ID of this note.
var noteID = '', fields = area.getElementsByTagName('span');
for (var n = 0; n < fields.length; n++)
if (fields.item(n).className == 'fn-note-id')
noteID = fields.item(n).getAttribute('title');
if (!noteID)
alert(FN_SAVE_FAIL);
if (noteID && confirm(FN_DELETE_CONFIRM)) {
fnEditingData = {
area: area,
note: null,
container: fnGetContainer(area)
};
fnPostXML('<feed><entry>' +
'<id>' +
noteID +
'</id>' +
'</entry></feed>');
}
else {
fnAction('', null);
}
};
function fnModalDialog(message){
// Pass a message to show, or an empty string to hide the dialog.
var dialog = document.getElementById('fn-modaldialog');
if (!dialog) {
dialog = document.createElement('div');
dialog.setAttribute('id', 'fn-modaldialog');
document.body.appendChild(dialog);
}
dialog.style.position = (window.ActiveXObject ? 'absolute' : 'fixed');
dialog.style.zIndex = '100000';
dialog.style.top = (window.activeXObject ? document.documentElement.scrollTop + (document.documentElement.clientHeight / 2) + 'px' : '0');
dialog.style.left = '0';
dialog.style.width = '100%';
dialog.style.height = (window.ActiveXObject ? document.documentElement.scrollHeight : '100%');
dialog._setupDone = true;
dialog.innerHTML = '<span>' + message + '</span>';
dialog.style.visibility = message ? 'visible' : 'hidden';
};
function fnPostXML(xml){
// Hopefully my auto-detect-fu powers are strong. I'll use the Crouching Regex Style.
var image = fnEditingData.container.getElementsByTagName('img').item(0);
var imageID = image.getAttribute('id');
var imageFile = image.getAttribute('src');
var imageLanguage = document.getElementById('lang' + imageID).getAttribute('title');
var imageVersion = document.getElementById('version' + imageID).getAttribute('title');
var imageName = document.getElementById('name' + imageID).getAttribute('title');
if (!imageFile)
return alert(FN_SAVE_FAIL);
var password = '', password_req = false;
switch (fnActionVerb) {
case 'add':{
if (FN_ADD == 'prompt')
password_req = false;
break
}
;
case 'edit':{
if (FN_MODIFY == 'prompt')
password_req = false;
break
}
;
case 'del':{
if (FN_DELETE == 'prompt')
password_req = false;
break
}
;
}
if (password_req) {
password = prompt('Please enter your password', '');
}
var actVerbs = {
add: 'add',
edit: 'modify',
del: 'delete'
};
var postContent = 'image=' + escape(imageID) + '&language=' + escape(imageLanguage) +
'&imageVersion=' +
escape(imageVersion) +
'&imageName=' +
escape(imageName) +
'&action=' +
actVerbs[fnActionVerb] +
(password ? '&password=' + escape(password) : '') +
'&xml=' +
escape(xml);
if (fnDebugMode)
alert('SENDING TO FNSERVER:\n\n' + postContent);
fnXMLHTTP.open('POST', fnServer, true);
fnXMLHTTP.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; charset=utf-8');
fnXMLHTTP.setRequestHeader('Content-length', postContent.length);
var cookies = document.cookie.split(';');
for (var c = 0; c < cookies.length; c++) {
fnXMLHTTP.setRequestHeader('Cookie', cookies[c]);
}
fnXMLHTTP.onreadystatechange = function(){
if (fnXMLHTTP.readyState == 4)
fnEditComplete(true);
};
fnModalDialog(FN_SAVE_WAIT);
fnXMLHTTP.send(postContent);
};
function fnEditComplete(ok){
if (fnDebugMode)
alert('RECEIVED FROM FNSERVER:\n\n' + fnXMLHTTP.responseText);
if (!ok || (fnXMLHTTP.responseText != 'success=ok')) {
fnModalDialog('');
alert(FN_SAVE_FAIL);
// (Failed edits/adds: UI and data persist).
if (fnActionVerb == 'del') {
fnEditingData = null;
fnAction('', null);
}
}
else
with (fnEditingData) {
if (fnActionVerb == 'add' || fnActionVerb == 'edit') {
for (var n = 0; n < note.childNodes.length; n++) {
var field = note.childNodes.item(n);
if (field.className == 'fn-note-title')
field.innerHTML = newTitle;
if (field.className == 'fn-note-author')
field.innerHTML = newAuthor;
if (field.className == 'fn-note-content')
field.innerHTML = nl2br(newContent);
}
fnEditUISet(false);
}
else {
area.parentNode.removeChild(area);
}
// and clear the editing data store.
fnModalDialog(FN_SAVE_SUCCESS);
setTimeout('fnModalDialog("")', 500);
fnAction('', null);
fnEditingData = null;
}
};
// Address of fotonoter.php on the server (this auto-detect should work):
var fnServer = '/admin/ezfotonotesimage/store/';
var fnXMLHTTP = null;
if (window.ActiveXObject) {
try {
fnXMLHTTP = new ActiveXObject('Microsoft.XMLHTTP');
}
catch (e) {
}
}
else
if (window.XMLHttpRequest) {
fnXMLHTTP = new XMLHttpRequest();
}
// Allowed values are 'allow', 'prompt', 'deny'.
if (!window.FN_ADD)
var FN_ADD = 'allow';
if (!window.FN_MODIFY)
var FN_MODIFY = 'allow';
if (!window.FN_DELETE)
var FN_DELETE = 'allow';
var FN_CREDITS = 'Fotonotes DHTML Viewer\n\n' +
'(c) 2004-2005 Angus Turnbull, http://www.twinhelix.com\n\n' +
'Provided under license to Fotonotes LLC';
var FN_DISALLOWED = 'Sorry, that action is not permitted.\n\n' +
'Please login under a different account.';
var FN_POST_UNSUPPORTED = 'Sorry, your browser does not support editing notes.';
var FN_DELETE_CONFIRM = 'Are you sure you want to delete this note?';
var FN_SAVE_WAIT = 'Please wait...';
var FN_SAVE_FAIL = 'An error occurred, and your changes could not be saved.';
var FN_SAVE_SUCCESS = 'Changes saved!';
var fnDebugMode = false; // Set to true to show XML sent/received.
var fnHideTimer = null; // Hide notes after timeout.
var fnActiveNote = null; // Currently visible note.
var fnActionVerb = ''; // Control bar's current action.
var fnActionTrigger = null; // Control bar's lit item.
var fnEditingData = null; // Data store during note editing process.
if (document.getElementById) {
// We apply to the whole document to interoperate with blinds.
var dragresize = new DragResize('dragresize', {
allowBlur: false
});
dragresize.isElement = function(elm){
if (!(/(add|edit)/).test(fnActionVerb))
return false;
if ((/fn-area-editing/).test(elm.className)) {
var container = fnGetContainer(elm);
this.maxRight = container.offsetWidth - 2;
this.maxBottom = container.offsetHeight - 2;
return true;
}
};
dragresize.isHandle = function(elm){
if (!(/(add|edit)/).test(fnActionVerb))
return false;
if ((/fn-area-editing/).test(elm.className))
return true;
};
dragresize.ondragfocus = function(){
this.element.style.cursor = 'move';
};
dragresize.ondragblur = function(){
this.element.style.cursor = 'default';
};
dragresize.apply(document);
// These are global, rather than assigned to individual notes, to work with the "blind" code.
addEvent(document, 'mouseover', new Function('e', 'fnMouseOverOutHandler(e, 1)'));
addEvent(document, 'mouseout', new Function('e', 'fnMouseOverOutHandler(e, 0)'));
if (document.createElement && document.documentElement) {
//addEvent(document, 'mouseup', fnMouseUpHandler);
addEvent(document, 'click', fnClickHandler);
}
}
function nl2br(str){
return str.replace(/(.*)\n/g, '$1<br>\n');
}
function br2nl(str){
str = str.replace(/(.*)<br \/>\n/g, '$1\n');
str = str.replace(/(.*)<br\/>\n/g, '$1\n');
return str.replace(/(.*)<br>\n/g, '$1\n');
}
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;
