;(function($) {
if (/1\.(0|1|2)\.(0|1|2)/.test($.fn.jquery) || /^1.1/.test($.fn.jquery)) {
alert('blockUI requires jQuery v1.2.3 or later! You are using v' + $.fn.jquery);
return;
}
$.blockUI = function(opts) { install(window, opts); };
$.unblockUI = function(opts) { remove(window, opts); };
$.fn.block = function(opts) {
return this.each(function() {
if ($.css(this,'position') == 'static')
this.style.position = 'relative';
if ($.browser.msie)
this.style.zoom = 1; // force 'hasLayout'
install(this, opts);
});
};
$.fn.unblock = function(opts) {
return this.each(function() {
remove(this, opts);
});
};
$.blockUI.version = 2.09; // 2nd generation blocking at no extra cost!
$.blockUI.defaults = {
message: '<h1>Please wait...</h1>',
css: {
padding: 0,
margin: 0,
width: '30%',
top: '40%',
left: '35%',
textAlign: 'center',
color: '#000',
border: '3px solid #aaa',
backgroundColor:'#fff'
},
overlayCSS: {
backgroundColor:'#000',
opacity: '0.6'
},
baseZ: 1000,
centerX: true, // <-- only effects element blocking (page block controlled via css above)
centerY: true,
allowBodyStretch: true,
constrainTabKey: true,
fadeOut: 400,
focusInput: true,
applyPlatformOpacityRules: true,
onUnblock: null,
quirksmodeOffsetHack: 4
};
var ie6 = $.browser.msie && /MSIE 6.0/.test(navigator.userAgent);
var pageBlock = null;
var pageBlockEls = [];
function install(el, opts) {
var full = (el == window);
var msg = opts && opts.message !== undefined ? opts.message : undefined;
opts = $.extend({}, $.blockUI.defaults, opts || {});
opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {});
var css = $.extend({}, $.blockUI.defaults.css, opts.css || {});
msg = msg === undefined ? opts.message : msg;
if (full && pageBlock)
remove(window, {fadeOut:0});
if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) {
var node = msg.jquery ? msg[0] : msg;
var data = {};
$(el).data('blockUI.history', data);
data.el = node;
data.parent = node.parentNode;
data.display = node.style.display;
data.position = node.style.position;
data.parent.removeChild(node);
}
var z = opts.baseZ;
var lyr1 = ($.browser.msie) ? $('<iframe class="blockUI" style="z-index:'+ z++ +';border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="javascript:false;"></iframe>')
: $('<div class="blockUI" style="display:none"></div>');
var lyr2 = $('<div class="blockUI blockOverlay" style="z-index:'+ z++ +';border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');
var lyr3 = full ? $('<div class="blockUI blockMsg blockPage" style="z-index:'+z+';position:fixed"></div>')
: $('<div class="blockUI blockMsg blockElement" style="z-index:'+z+';display:none;position:absolute"></div>');
if (msg)
lyr3.css(css);
if (!opts.applyPlatformOpacityRules || !($.browser.mozilla && /Linux/.test(navigator.platform)))
lyr2.css(opts.overlayCSS);
lyr2.css('position', full ? 'fixed' : 'absolute');
if ($.browser.msie)
lyr1.css('opacity','0.0');
$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el);
var expr = $.browser.msie && (!$.boxModel || $('object,embed', full ? null : el).length > 0);
if (ie6 || expr) {
if (full && opts.allowBodyStretch && $.boxModel)
$('html,body').css('height','100%');
if ((ie6 || !$.boxModel) && !full) {
var t = sz(el,'borderTopWidth'), l = sz(el,'borderLeftWidth');
var fixT = t ? '(0 - '+t+')' : 0;
var fixL = l ? '(0 - '+l+')' : 0;
}
$.each([lyr1,lyr2,lyr3], function(i,o) {
var s = o[0].style;
s.position = 'absolute';
if (i < 2) {
full ? s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"')
: s.setExpression('height','this.parentNode.offsetHeight + "px"');
full ? s.setExpression('width','jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"')
: s.setExpression('width','this.parentNode.offsetWidth + "px"');
if (fixL) s.setExpression('left', fixL);
if (fixT) s.setExpression('top', fixT);
}
else if (opts.centerY) {
if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');
s.marginTop = 0;
}
});
}
lyr3.append(msg).show();
if (msg && (msg.jquery || msg.nodeType))
$(msg).show();
bind(1, el, opts);
if (full) {
pageBlock = lyr3[0];
pageBlockEls = $(':input:enabled:visible',pageBlock);
if (opts.focusInput)
setTimeout(focus, 20);
}
else
center(lyr3[0], opts.centerX, opts.centerY);
};
function remove(el, opts) {
var full = el == window;
var data = $(el).data('blockUI.history');
opts = $.extend({}, $.blockUI.defaults, opts || {});
bind(0, el, opts); // unbind events
var els = full ? $('body').children().filter('.blockUI') : $('.blockUI', el);
if (full)
pageBlock = pageBlockEls = null;
if (opts.fadeOut) {
els.fadeOut(opts.fadeOut);
setTimeout(function() { reset(els,data,opts,el); }, opts.fadeOut);
}
else
reset(els, data, opts, el);
};
function reset(els,data,opts,el) {
els.each(function(i,o) {
if (this.parentNode)
this.parentNode.removeChild(this);
});
if (data && data.el) {
data.el.style.display = data.display;
data.el.style.position = data.position;
data.parent.appendChild(data.el);
$(data.el).removeData('blockUI.history');
}
if (typeof opts.onUnblock == 'function')
opts.onUnblock(el,opts);
};
function bind(b, el, opts) {
var full = el == window, $el = $(el);
if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked')))
return;
if (!full)
$el.data('blockUI.isBlocked', b);
var events = 'mousedown mouseup keydown keypress click';
b ? $(document).bind(events, opts, handler) : $(document).unbind(events, handler);
};
function handler(e) {
if (e.keyCode && e.keyCode == 9) {
if (pageBlock && e.data.constrainTabKey) {
var els = pageBlockEls;
var fwd = !e.shiftKey && e.target == els[els.length-1];
var back = e.shiftKey && e.target == els[0];
if (fwd || back) {
setTimeout(function(){focus(back)},10);
return false;
}
}
}
if ($(e.target).parents('div.blockMsg').length > 0)
return true;
return $(e.target).parents().children().filter('div.blockUI').length == 0;
};
function focus(back) {
if (!pageBlockEls)
return;
var e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0];
if (e)
e.focus();
};
function center(el, x, y) {
var p = el.parentNode, s = el.style;
var l = ((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth');
var t = ((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth');
if (x) s.left = l > 0 ? (l+'px') : '0';
if (y) s.top = t > 0 ? (t+'px') : '0';
};
function sz(el, p) {
return parseInt($.css(el,p))||0;
};
})(jQuery);
eval(function(p,a,c,k,e,d){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--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[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}('(2($){$.c.f=2(p){p=$.d({g:"!@#$%^&*()+=[]\\\\\\\';,/{}|\\":<>?~`.- ",4:"",9:""},p);7 3.b(2(){5(p.G)p.4+="Q";5(p.w)p.4+="n";s=p.9.z(\'\');x(i=0;i<s.y;i++)5(p.g.h(s[i])!=-1)s[i]="\\\\"+s[i];p.9=s.O(\'|\');6 l=N M(p.9,\'E\');6 a=p.g+p.4;a=a.H(l,\'\');$(3).J(2(e){5(!e.r)k=o.q(e.K);L k=o.q(e.r);5(a.h(k)!=-1)e.j();5(e.u&&k==\'v\')e.j()});$(3).B(\'D\',2(){7 F})})};$.c.I=2(p){6 8="n";8+=8.P();p=$.d({4:8},p);7 3.b(2(){$(3).f(p)})};$.c.t=2(p){6 m="A";p=$.d({4:m},p);7 3.b(2(){$(3).f(p)})}})(C);',53,53,'||function|this|nchars|if|var|return|az|allow|ch|each|fn|extend||alphanumeric|ichars|indexOf||preventDefault||reg|nm|abcdefghijklmnopqrstuvwxyz|String||fromCharCode|charCode||alpha|ctrlKey||allcaps|for|length|split|1234567890|bind|jQuery|contextmenu|gi|false|nocaps|replace|numeric|keypress|which|else|RegExp|new|join|toUpperCase|ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('|'),0,{}));

$(document).ready(function() {
$('#slideshow').cycle({
cleartype: true,
timeout: 8000,
pause: true,
before: function() {
$('#slideshow span.slw_caption').css('display','none');
$('div#slw_content_hover .slw_item').each(function() {
var allItems = '#' + $(this).attr('id');
$(allItems).removeClass('slw_item_hover');
})
},
after: function() {
$('span.slw_caption', this).css({opacity: '0.7'}).slideDown();
var callerItem = '#slw_content_hover div#slw_call_' + $(this).attr('id').substr($(this).attr('id').length-1,1);
$(callerItem).addClass('slw_item_hover');
}
});
$('div#slw_content_hover .slw_item').hover(function(){
$(this).addClass('slw_item_hover');
$('#slideshow').cycle('pause');
$('div#slw_content_hover .slw_item').each(function() {
var allItems = '#' + $(this).attr('id').replace('call_', '');
$(allItems).css({
'z-index' : '0',
opacity : '0',
'display' : 'none'
});
})
$('#slideshow span.slw_caption').css('display','none');
$('#slideshow span.slw_caption').css({opacity : '0.7', 'display' : 'block'}).slideDown();
var callItem = '#' + $(this).attr('id').replace('call_', '');
$(callItem).css({
'z-index' : '4',
opacity : '1',
'display' : 'block'
});
},
function(){
$('div#slw_content_hover .slw_item').each(function() {
var allItems = '#' + $(this).attr('id');
$(allItems).removeClass('slw_item_hover');
})
$('#slideshow').cycle('resume');
});
});
(function($) {
var ver = '2.22';
var ie6 = $.browser.msie && /MSIE 6.0/.test(navigator.userAgent);
function log() {
if (window.console && window.console.log)
window.console.log('[cycle] ' + Array.prototype.join.call(arguments,''));
};
$.fn.cycle = function(options) {
return this.each(function() {
options = options || {};
if (options.constructor == String) {
switch(options) {
case 'stop':
if (this.cycleTimeout) clearTimeout(this.cycleTimeout);
this.cycleTimeout = 0;
return;
case 'pause':
this.cyclePause = 1;
return;
case 'resume':
this.cyclePause = 0;
return;
default:
options = { fx: options };
};
}
if (this.cycleTimeout) clearTimeout(this.cycleTimeout);
this.cycleTimeout = 0;
this.cyclePause = 0;
var $cont = $(this);
var $slides = options.slideExpr ? $(options.slideExpr, this) : $cont.children();
var els = $slides.get();
if (els.length < 2) {
log('terminating; too few slides: ' + els.length);
return; // don't bother
}
var opts = $.extend({}, $.fn.cycle.defaults, options || {}, $.metadata ? $cont.metadata() : $.meta ? $cont.data() : {});
if (opts.autostop)
opts.countdown = opts.autostopCount || els.length;
opts.before = opts.before ? [opts.before] : [];
opts.after = opts.after ? [opts.after] : [];
opts.after.unshift(function(){ opts.busy=0; });
if (opts.continuous)
opts.after.push(function() { go(els,opts,0,!opts.rev); });
if (ie6 && opts.cleartype && !opts.cleartypeNoBg)
clearTypeFix($slides);
var cls = this.className;
opts.width = parseInt((cls.match(/w:(\d+)/)||[])[1]) || opts.width;
opts.height = parseInt((cls.match(/h:(\d+)/)||[])[1]) || opts.height;
opts.timeout = parseInt((cls.match(/t:(\d+)/)||[])[1]) || opts.timeout;
if ($cont.css('position') == 'static')
$cont.css('position', 'relative');
if (opts.width)
$cont.width(opts.width);
if (opts.height && opts.height != 'auto')
$cont.height(opts.height);
if (opts.random) {
opts.randomMap = [];
for (var i = 0; i < els.length; i++)
opts.randomMap.push(i);
opts.randomMap.sort(function(a,b) {return Math.random() - 0.5;});
opts.randomIndex = 0;
opts.startingSlide = opts.randomMap[0];
}
else if (opts.startingSlide >= els.length)
opts.startingSlide = 0; // catch bogus input
var first = opts.startingSlide || 0;
$slides.css({position: 'absolute'}).hide().each(function(i) {
var z = first ? i >= first ? els.length - (i-first) : first-i : els.length-i;
$(this).css('z-index', z)
});
$(els[first]).css('opacity',1).show(); // opacity bit needed to handle reinit case
if ($.browser.msie) els[first].style.removeAttribute('filter');
if (opts.fit && opts.width)
$slides.width(opts.width);
if (opts.fit && opts.height && opts.height != 'auto')
$slides.height(opts.height);
if (opts.pause)
$cont.hover(function(){this.cyclePause=1;}, function(){this.cyclePause=0;});
var init = $.fn.cycle.transitions[opts.fx];
if ($.isFunction(init))
init($cont, $slides, opts);
else if (opts.fx != 'custom')
log('unknown transition: ' + opts.fx);
$slides.each(function() {
var $el = $(this);
this.cycleH = (opts.fit && opts.height) ? opts.height : $el.height();
this.cycleW = (opts.fit && opts.width) ? opts.width : $el.width();
});
opts.cssBefore = opts.cssBefore || {};
opts.animIn = opts.animIn || {};
opts.animOut = opts.animOut || {};
$slides.not(':eq('+first+')').css(opts.cssBefore);
if (opts.cssFirst)
$($slides[first]).css(opts.cssFirst);
if (opts.timeout) {
if (opts.speed.constructor == String)
opts.speed = {slow: 600, fast: 200}[opts.speed] || 400;
if (!opts.sync)
opts.speed = opts.speed / 2;
while((opts.timeout - opts.speed) < 250)
opts.timeout += opts.speed;
}
if (opts.easing)
opts.easeIn = opts.easeOut = opts.easing;
if (!opts.speedIn)
opts.speedIn = opts.speed;
if (!opts.speedOut)
opts.speedOut = opts.speed;
opts.slideCount = els.length;
opts.currSlide = first;
if (opts.random) {
opts.nextSlide = opts.currSlide;
if (++opts.randomIndex == els.length)
opts.randomIndex = 0;
opts.nextSlide = opts.randomMap[opts.randomIndex];
}
else
opts.nextSlide = opts.startingSlide >= (els.length-1) ? 0 : opts.startingSlide+1;
var e0 = $slides[first];
if (opts.before.length)
opts.before[0].apply(e0, [e0, e0, opts, true]);
if (opts.after.length > 1)
opts.after[1].apply(e0, [e0, e0, opts, true]);
if (opts.click && !opts.next)
opts.next = opts.click;
if (opts.next)
$(opts.next).bind('click', function(){return advance(els,opts,opts.rev?-1:1)});
if (opts.prev)
$(opts.prev).bind('click', function(){return advance(els,opts,opts.rev?1:-1)});
if (opts.pager)
buildPager(els,opts);
opts.addSlide = function(newSlide) {
var $s = $(newSlide), s = $s[0];
if (!opts.autostopCount)
opts.countdown++;
els.push(s);
if (opts.els)
opts.els.push(s); // shuffle needs this
opts.slideCount = els.length;
$s.css('position','absolute').appendTo($cont);
if (ie6 && opts.cleartype && !opts.cleartypeNoBg)
clearTypeFix($s);
if (opts.fit && opts.width)
$s.width(opts.width);
if (opts.fit && opts.height && opts.height != 'auto')
$slides.height(opts.height);
s.cycleH = (opts.fit && opts.height) ? opts.height : $s.height();
s.cycleW = (opts.fit && opts.width) ? opts.width : $s.width();
$s.css(opts.cssBefore);
if (typeof opts.onAddSlide == 'function')
opts.onAddSlide($s);
};
if (opts.timeout || opts.continuous)
this.cycleTimeout = setTimeout(
function(){go(els,opts,0,!opts.rev)},
opts.continuous ? 10 : opts.timeout + (opts.delay||0));
});
};
function go(els, opts, manual, fwd) {
if (opts.busy) return;
var p = els[0].parentNode, curr = els[opts.currSlide], next = els[opts.nextSlide];
if (p.cycleTimeout === 0 && !manual)
return;
if (!manual && !p.cyclePause &&
((opts.autostop && (--opts.countdown <= 0)) ||
(opts.nowrap && !opts.random && opts.nextSlide < opts.currSlide))) {
if (opts.end)
opts.end(opts);
return;
}
if (manual || !p.cyclePause) {
if (opts.before.length)
$.each(opts.before, function(i,o) { o.apply(next, [curr, next, opts, fwd]); });
var after = function() {
if ($.browser.msie && opts.cleartype)
this.style.removeAttribute('filter');
$.each(opts.after, function(i,o) { o.apply(next, [curr, next, opts, fwd]); });
};
if (opts.nextSlide != opts.currSlide) {
opts.busy = 1;
if (opts.fxFn)
opts.fxFn(curr, next, opts, after, fwd);
else if ($.isFunction($.fn.cycle[opts.fx]))
$.fn.cycle[opts.fx](curr, next, opts, after);
else
$.fn.cycle.custom(curr, next, opts, after);
}
if (opts.random) {
opts.currSlide = opts.nextSlide;
if (++opts.randomIndex == els.length)
opts.randomIndex = 0;
opts.nextSlide = opts.randomMap[opts.randomIndex];
}
else { // sequence
var roll = (opts.nextSlide + 1) == els.length;
opts.nextSlide = roll ? 0 : opts.nextSlide+1;
opts.currSlide = roll ? els.length-1 : opts.nextSlide-1;
}
if (opts.pager)
$.fn.cycle.updateActivePagerLink(opts.pager, opts.currSlide);
}
if (opts.timeout && !opts.continuous)
p.cycleTimeout = setTimeout(function() { go(els,opts,0,!opts.rev) }, opts.timeout);
else if (opts.continuous && p.cyclePause)
p.cycleTimeout = setTimeout(function() { go(els,opts,0,!opts.rev) }, 10);
};
$.fn.cycle.updateActivePagerLink = function(pager, currSlide) {
$(pager).find('a').removeClass('activeSlide').filter('a:eq('+currSlide+')').addClass('activeSlide');
};
function advance(els, opts, val) {
var p = els[0].parentNode, timeout = p.cycleTimeout;
if (timeout) {
clearTimeout(timeout);
p.cycleTimeout = 0;
}
opts.nextSlide = opts.currSlide + val;
if (opts.nextSlide < 0) {
if (opts.nowrap) return false;
opts.nextSlide = els.length - 1;
}
else if (opts.nextSlide >= els.length) {
if (opts.nowrap) return false;
opts.nextSlide = 0;
}
if (opts.prevNextClick && typeof opts.prevNextClick == 'function')
opts.prevNextClick(val > 0, opts.nextSlide, els[opts.nextSlide]);
go(els, opts, 1, val>=0);
return false;
};
function buildPager(els, opts) {
var $p = $(opts.pager);
$.each(els, function(i,o) {
var $a = (typeof opts.pagerAnchorBuilder == 'function')
? $(opts.pagerAnchorBuilder(i,o))
: $('<a href="#">'+(i+1)+'</a>');
if ($a.parents('body').length == 0)
$a.appendTo($p);
$a.bind(opts.pagerEvent, function() {
opts.nextSlide = i;
var p = els[0].parentNode, timeout = p.cycleTimeout;
if (timeout) {
clearTimeout(timeout);
p.cycleTimeout = 0;
}
if (typeof opts.pagerClick == 'function')
opts.pagerClick(opts.nextSlide, els[opts.nextSlide]);
go(els,opts,1,!opts.rev);
return false;
});
});
$.fn.cycle.updateActivePagerLink(opts.pager, opts.startingSlide);
};
function clearTypeFix($slides) {
function hex(s) {
var s = parseInt(s).toString(16);
return s.length < 2 ? '0'+s : s;
};
function getBg(e) {
for ( ; e && e.nodeName.toLowerCase() != 'html'; e = e.parentNode) {
var v = $.css(e,'background-color');
if (v.indexOf('rgb') >= 0 ) {
var rgb = v.match(/\d+/g);
return '#'+ hex(rgb[0]) + hex(rgb[1]) + hex(rgb[2]);
}
if (v && v != 'transparent')
return v;
}
return '#ffffff';
};
$slides.each(function() { $(this).css('background-color', getBg(this)); });
};
$.fn.cycle.custom = function(curr, next, opts, cb) {
var $l = $(curr), $n = $(next);
$n.css(opts.cssBefore);
var fn = function() {$n.animate(opts.animIn, opts.speedIn, opts.easeIn, cb)};
$l.animate(opts.animOut, opts.speedOut, opts.easeOut, function() {
if (opts.cssAfter) $l.css(opts.cssAfter);
if (!opts.sync) fn();
});
if (opts.sync) fn();
};
$.fn.cycle.transitions = {
fade: function($cont, $slides, opts) {
$slides.not(':eq('+opts.startingSlide+')').css('opacity',0);
opts.before.push(function() { $(this).show() });
opts.animIn = { opacity: 1 };
opts.animOut = { opacity: 0 };
opts.cssBefore = { opacity: 0 };
opts.cssAfter = { display: 'none' };
}
};
$.fn.cycle.ver = function() { return ver; };
$.fn.cycle.defaults = {
fx: 'fade', // one of: fade, shuffle, zoom, scrollLeft, etc
timeout: 4000, // milliseconds between slide transitions (0 to disable auto advance)
continuous: 0, // true to start next transition immediately after current one completes
speed: 1000, // speed of the transition (any valid fx speed value)
speedIn: null, // speed of the 'in' transition
speedOut: null, // speed of the 'out' transition
next: null, // id of element to use as click trigger for next slide
prev: null, // id of element to use as click trigger for previous slide
prevNextClick: null, // callback fn for prev/next clicks: function(isNext, zeroBasedSlideIndex, slideElement)
pager: null, // id of element to use as pager container
pagerClick: null, // callback fn for pager clicks: function(zeroBasedSlideIndex, slideElement)
pagerEvent: 'click', // event which drives the pager navigation
pagerAnchorBuilder: null, // callback fn for building anchor links
before: null, // transition callback (scope set to element to be shown)
after: null, // transition callback (scope set to element that was shown)
end: null, // callback invoked when the slideshow terminates (use with autostop or nowrap options)
easing: null, // easing method for both in and out transitions
easeIn: null, // easing for "in" transition
easeOut: null, // easing for "out" transition
shuffle: null, // coords for shuffle animation, ex: { top:15, left: 200 }
animIn: null, // properties that define how the slide animates in
animOut: null, // properties that define how the slide animates out
cssBefore: null, // properties that define the initial state of the slide before transitioning in
cssAfter: null, // properties that defined the state of the slide after transitioning out
fxFn: null, // function used to control the transition
height: 'auto', // container height
startingSlide: 0, // zero-based index of the first slide to be displayed
sync: 1, // true if in/out transitions should occur simultaneously
random: 0, // true for random, false for sequence (not applicable to shuffle fx)
fit: 0, // force slides to fit container
pause: 0, // true to enable "pause on hover"
autostop: 0, // true to end slideshow after X transitions (where X == slide count)
autostopCount: 0, // number of transitions (optionally used with autostop to define X)
delay: 0, // additional delay (in ms) for first transition (hint: can be negative)
slideExpr: null, // expression for selecting slides (if something other than all children is required)
cleartype: 0, // true if clearType corrections should be applied (for IE)
nowrap: 0 // true to prevent slideshow from wrapping
};
})(jQuery);
var loginMsg="Per effettuare questa operazione devi eseguire prima il login!";
var dialogIDs=new Array();
gotoHomepage= function(){
window.location=path;
}
var uimanager = {
search:function(){
var q=document.getElementById('q');
window.location=path+'?m=searchresult&q='+q.value;
},
blockUI:function(){
$.blockUI({ css: {
border: 'none',
padding: '15px',
backgroundColor: '#cccccc',
'-webkit-border-radius': '10px',
'-moz-border-radius': '10px',
opacity: '.5',
color: '#fff'
} });
setTimeout($.unblockUI, 2000);
},
showMessage:function(m,formID){
var time = 3000;
$.blockUI(
{ css : {border: 'none',padding: '15px',backgroundColor: '#333','-webkit-border-radius': '10px','-moz-border-radius': '10px',opacity: '.8',color: '#fff'},
message : '<h3 style="color:#fff">'+m+'</h3>' ,
overlayCSS: {backgroundColor:'#333',opacity:'0.6'}
}
);
setTimeout($.unblockUI, time);
}
}
ThumbRotator = {
slices : 8, // number of thumbs per video
frameRate : 500, // frameRate in milliseconds for changing the thumbs
timer : null,
slice : 0,
change : function (o, i) {
slice = i % this.slices;
var src = o.attr("src");
src = src.replace(/_(\d+)_(\w)\.jpg/, "_" + slice + "_$2.jpg");
o.attr("src", src);
i++;
this.timer = setTimeout(function () { ThumbRotator.change(o, i) }, this.frameRate);
},
start : function (o) // reset the timer and show the first thumb
{
clearTimeout(this.timer);
this.change(o, 1);
},
end : function (o) // reset the timer and restore the base thumb
{
slice=0;
var src = o.attr("src");
src = src.replace(/_(\d+)_(\w)\.jpg/, "_" + slice + "_$2.jpg");
o.attr("src", src);
clearTimeout(this.timer);
}
};
function changeThumb(o) {
if(o == undefined)
return;
var n = (o.attr("index") == undefined ? 1 : o.attr("index"));
var src = o.attr("src");
src = src.replace(/_(\d+)_(\w)\.jpg/, "_" + n + "_$2.jpg");
o.attr("src", src);
n = ++n % 8;
o.attr("index", n);
}
$(document).ready(function () {
return;
$(".video").each(function(i) {
$this = $(this);
try {
$this.mouseover(function() {
$img = $(this).children("a").children("img");
ThumbRotator.start($img);
});
$this.mouseout(function() {
$img = $(this).children("a").children("img");
ThumbRotator.end($img);
});
} catch(e) {
alert(e);
}
}
);
}
);
var logged=false;
var auth = {
onFacebookConnectReady: function(FB,url) {
if (!logged){
window.location=url;
}
},
logout : function(isFacebookUser) {
var logoutPage=path+'logout/logout.php' ;
window.location=logoutPage;
},
login : function() {
var username =document.getElementById("user_name").value;
var password =document.getElementById("password").value;
if (username.length==0){
uimanager.showMessage("Inserisci l\'email ...");
return;
}
if (password.length==0){
uimanager.showMessage("Inserisci la password ...");
return;
}
uimanager.blockUI();
var parameters = "user_name=" + username + "&password=" + password;
var url = path+'/php/users/doLogin.php';
request = uimanager._get_request ();
request.open("POST", url, true);
request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
request.setRequestHeader("Content-length", parameters.length);
request.setRequestHeader("Connection", "close");
request.send(parameters);
request.onreadystatechange = function(){
if (request.readyState == 4) {
if (request.status == 200) {
alert(request.responseText);
try{
var i=request.responseText.indexOf('success: true');
if (i>0){
var s=window.location.toString();
var i=s.indexOf('=login');
var j=s.indexOf('=register');
if (i>=0 || j>=0){
window.location=path+'?modulo=profile';
}else{
window.location=window.location;
}
}else{
uimanager.showMessage("Username o password non validi");
}
}catch(e){
alert(e);
}
}
}
};
},
changePassword : function() {
var password =document.getElementById("password").value;
var confirm_password =document.getElementById("confirm_password").value;
if (password.length==0){
uimanager.showMessage("Inserisci una password ...");
document.getElementById("password").setFocus();
return;
}
if (password != confirm_password){
uimanager.showMessage("Le password non coincidono ...");
return;
}
uimanager.blockUI();
var parameters = "password=" + password;
var url = path+'/php/users/changePassword.php';
request = uimanager._get_request ();
request.open("POST", url, true);
request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
request.setRequestHeader("Content-length", parameters.length);
request.setRequestHeader("Connection", "close");
request.send(parameters);
request.onreadystatechange = function(){
if (request.readyState == 4) {
if (request.status == 200) {
try{
var i=request.responseText.indexOf('success: true');
if (i>0){
window.location=path+'?modulo=profile';
}else{
uimanager.showMessage("Si è verificato un errore.");
}
}catch(e){
alert(e);
}
}
}
};
}
}
$(window).load(function() {
$('.thumb_cont').live ('mouseover', function() {
if (!$(this).hasClass('view'))
$(this).children('.overlay').slideDown(100);
});
$('.thumb_cont .overlay').live ('mouseover', function() {
$(this).show();
});
$('.thumb_cont').live ('mouseout', function() {
if (!$(this).hasClass('view')) {
$('.thumb_cont .overlay').hide();
$('.view .overlay').show();
}
});
$('#rightConcorsiTop a').hide();
var last = $('#rightConcorsiTop a:last-child');
last.show();
var active = last;
var timec = 5000;
slideContest = function() {
active.slideUp('slow').hide();
active.prev().slideDown('slow').show();
if (active.prev().length){
active = active.prev();
}else {
active.slideUp('slow').hide();
active = last;
active.slideDown('slow').show();
}
}
$(function() {
setInterval( "slideContest()", timec);
});
});
function setOverlay(type,id){
var idelement='#'+type+id;
$(idelement).parent().parent().children().children('a').removeClass('selected');
$(idelement).addClass('selected');
}
$(window).load(function() {
$('ul.sub_evd').hide();
$('li.hide').hover(
function () {
$(this).find("ul.sub_evd").slideDown('fast').show();
},
function () {
$(this).find("ul.sub_evd").slideUp('fast').hide();
}
);
$('li.hide ul.sub_evd li a').click(function () {
$(this).parent().parent().parent().find('span.curr_selection').html($(this).html());
$(this).parent().parent().hide();
});
});
var historyCallbacks=[];
$(function() {
function historyMainCallback(hash){
$.each(historyCallbacks,function (i,f){
f(hash);
});
}
$.historyInit(historyMainCallback);
});
$(window).load(function() {
try{
$(".date").datepicker({changeYear: true,changeMonth: true,yearRange: '1900:2012'});
$('.date').datepicker('option','dateFormat','dd/mm/yy');
}catch(e){
}
$("ul.subnav").parent().find('a').addClass('bg');
$("ul.subnav").parent().hover(function() { //When trigger is clicked...
$(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click
$(this).parent().hover(function() {
}, function(){
$(this).parent().find("ul.subnav").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
});
}).hover(function() {
$(this).addClass("subhover"); //On hover over, add class "subhover"
$(this).parent().addClass('bgli');
}, function(){ //On Hover Out
$(this).removeClass("subhover"); //On hover out, remove class "subhover"
$(this).parent().removeClass('bgli');
});
});
function checkSearch(){
return $('#q').val()!='' ;
}
function isValidDate(dateStr) {
var datePat = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{4})$/; // requires 4 digit year
var matchArray = dateStr.match(datePat); // is the format ok?
if (matchArray == null) {
alert("La data non e' in un formato valido")
return false;
}
month = matchArray[1]; // parse date into variables
day = matchArray[3];
year = matchArray[4];
if (day < 1 || day > 31) {
alert("Il valore del giorno deve essere compreso tra 1 e 31");
return false;
}
if (month < 1 || month > 12) { // check month range
alert("Il valore del mese deve essere compreso tra 1 e 12");
return false;
}
if ((month==4 || month==6 || month==9 || month==11) && day==31) {
if (month==4) {var qualeMese = 'Aprile';}
else if (month==6) {var qualeMese = 'Giugno';}
else if (month==9) {var qualeMese = 'Settembre';}
else if (month==11) {var qualeMese = 'Novembre';}
alert(qualeMese+" non ha 31 giorni!")
return false;
}
if (month == 2) { // check for february 29th
var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
if (day>29 || (day==29 && !isleap)) {
alert("Febbraio " + year + " non ha " + day + " giorni!");
return false;
}
}
return true;
}
function dispDate(dateObj) {
month = dateObj.getMonth()+1;
month = (month < 10) ? "0" + month : month;
day = dateObj.getDate();
day = (day < 10) ? "0" + day : day;
year = dateObj.getYear();
if (year < 2000) year += 1900;
return (month + "/" + day + "/" + year);
}
function pregnancyCalc(pregform) {
menstrual = new Date(); // creates new date objects
ovulation = new Date();
duedate = new Date();
today = new Date();
cycle = 0, luteal = 0; // sets variables to invalid state ==> 0
pregform.menstrual.value = pregform.mese.value + '/' + pregform.giorno.value + '/' + pregform.anno.value;
if (isValidDate(pregform.menstrual.value)) { // Validates menstual date
menstrualinput = new Date(pregform.menstrual.value);
menstrual.setTime(menstrualinput.getTime())
}
else return false; // otherwise exits
cycle = (pregform.cycle.value == "" ? 28 : pregform.cycle.value); // defaults to 28
if (pregform.cycle.value != "" && (pregform.cycle.value < 22 || pregform.cycle.value > 45)) {
alert("La durata del ciclo e' troppo breve o troppo lunga affinche' i calcoli possano essere esatti.\n"
+ "Si procedera' comunque ad una stima con il valore inserito.");
}
luteal = (pregform.luteal.value == "" ? 14 : pregform.luteal.value); // defaults to 14
if (pregform.luteal.value != "" && (pregform.luteal.value < 9 || pregform.luteal.value > 16)) {
alert("La durata della fase dopo l'ovulazione e' troppo breve o troppo lunga affinche' i calcoli possano essere esatti.\n"
+ "Si procedera' comunque ad una stima con il valore inserito.");
}
ovulation.setTime(menstrual.getTime() + (cycle*86400000) - (luteal*86400000));
pregform.conceptionH.value = dispDate(ovulation);
pregform.conception.value = pregform.conceptionH.value.substr(3, 2) + "/" + pregform.conceptionH.value.substr(0, 2) + "/" + pregform.conceptionH.value.substr(6, pregform.conceptionH.value.length);
duedate.setTime(ovulation.getTime() + 266*86400000);
pregform.conceptionH.value = dispDate(duedate);
pregform.duedate.value = pregform.conceptionH.value.substr(3, 2) + "/" + pregform.conceptionH.value.substr(0, 2) + "/" + pregform.conceptionH.value.substr(6, pregform.conceptionH.value.length);
var fetalage = 14 + 266 - ((duedate - today) / 86400000);
weeks = parseInt(fetalage / 7); // sets weeks to whole number of weeks
days = Math.floor(fetalage % 7); // sets days to the whole number remainder
fetalage = weeks + " settimane" + (weeks > 1 ? "" : "") + " + " + days + " giorni";
pregform.fetalage.value = fetalage;
if (weeks>42)
{
pregform.fetalage.value = '';
pregform.conception.value = '';
pregform.duedate.value = '';
alert("La data inserita non e' valida");
}
return false; // form should never submit, returns false
}
function esegui()
{
document.dataParto.submit();
}
function esegui2()
{
document.dataParto2.giorno.value = document.dataParto.giorno.value;
document.dataParto2.mese.value = document.dataParto.mese.value;
document.dataParto2.anno.value = document.dataParto.anno.value;
return pregnancyCalc(document.dataParto2);
}

