//dynamicCSS.js v1.0 <http://www.bobbyvandersluis.com/articles/dynamicCSS.php>
function createStyleRule(selector, declaration) {
	if (!document.getElementsByTagName || !(document.createElement || document.createElementNS)) return false;
	var agt = navigator.userAgent.toLowerCase();
	var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
	var is_iewin = (is_ie && (agt.indexOf("win") != -1));
	var is_iemac = (is_ie && (agt.indexOf("mac") != -1));
	if (is_iemac) return false;
	var head = document.getElementsByTagName("head")[0]; 
	var style = ((typeof document.createElementNS != "undefined") ?  document.createElementNS("http://www.w3.org/1999/xhtml", "style") : document.createElement("style"));
	if (!is_iewin) {
		var styleRule = document.createTextNode(selector + " {" + declaration + "}");
		style.appendChild(styleRule);
	}
	style.setAttribute("type", "text/css");
	style.setAttribute("media", "screen"); 
	if (head) head.appendChild(style);
	if (is_iewin && document.styleSheets && document.styleSheets.length > 0) {
		var lastStyle = document.styleSheets[document.styleSheets.length - 1];
		if (typeof lastStyle.addRule == "object") {
			lastStyle.addRule(selector, declaration);
		}
	}
}
/* jflash */
;(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:($.browser.msie?'ActiveX':'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={height:240,flashvars:{},pluginspage:'http://www.adobe.com/go/getflashplayer',src:'#',type:'application/x-shockwave-flash',width:320};$$.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+'='+escape(this[key])+'&';return s.replace(/&$/,'');};
$$.transform = function(htmlOptions) {
	if(htmlOptions.flashvars) htmlOptions.flashvars.toString = toFlashvarsString;
	if (typeof htmlOptions.id == 'undefined') htmlOptions.id = 'flash-'+$('object').length;
	var object = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" align="middle" width="'+htmlOptions.width+'" height="'+htmlOptions.height+'" id="'+htmlOptions.id+'">';
	$.each(htmlOptions, function(i,e) {
		if (i != 'type' && i != 'pluginspage' && i != 'width' && i!= 'height' && i!='id') {
			if (i=='src') i = 'movie';
			object += '<param name="'+i+'" value="'+e+'" />';
		}
	});
	object += '</object>';
	htmlOptions.name = htmlOptions.id;
	
	htmlOptions.toString = toAttributeString;
	var embed = '<embed ' + String(htmlOptions) + '/>';

	if ($.browser.msie) return object;
	return embed;
};
if(window.attachEvent){window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};});}})();
$.fn.flash.replace = function(htmlOptions) {
	jQuery(this)
		.empty()
		.addClass('flash-replaced')
		.prepend(jQuery.fn.flash.transform(htmlOptions));
};
/**/
String.prototype.wordWrap = function(m, b, c){
	var i, j, l, s, r = this.split(" ");
	if(m > 0) for(i = -1, l = r.length; ++i < l;){
			for(s = r[i], r[i] = ""; s.length > m;
					j = c ? m : (j = s.substr(0, m).match(/\S*$/)).input.length - j[0].length
					|| j.input.length + (j = s.substr(m).match(/^\S*/)).input.length + j[0].length,
					r[i] += s.substr(0, j) + ((s = s.substr(j)).length ? b : "")
			);
			r[i] += s;
	}
	return r.join(" ");
};
//preload imagez
jQuery.preloadImages=function(){
for(var i=0;i<arguments.length;i++){
jQuery("<img>").attr("src",arguments[i]);
}};
// scrollTo
;(function( $ ){
		  
	$.scrollTo = function( target, settings ){
		return $('html,body').scrollTo( target, settings );
	};
	
	$.scrollTo.defaults = {
		axis:'y',
		speed:1
	};
	
	$.fn.scrollTo = function( target, settings ){
		settings = $.extend( {}, $.scrollTo.defaults, settings );
		settings.queue = settings.queue && settings.axis.length == 2;
		if( settings.queue )
			settings.speed = Math.ceil( settings.speed / 2 );
		if( typeof settings.offset == 'number' )
			settings.offset = { left: settings.offset, top: settings.offset };
		
		return this.each(function(){
			var $elem = $(this), t = target, toff, attr = {};
			switch( typeof t ){
				case 'number':
				case 'string':
					if( /^([+-]=)?\d+(px)?$/.test(t) ){
						t = { top:t, left:t };
						break;
					}
					t = $(t,this);
				case 'object':
					if( t.is || t.style )
						toff = (t = $(t)).offset();
			}
			
			if (settings.onBefore) settings.onBefore.call($elem[0], 'arg1', 'arg2', $elem );
			$.each( settings.axis.split(''), parse );			
			animate( settings.onAfter );			
			
			function parse( i, axis ){
				var Pos	= axis == 'x' ? 'Left' : 'Top',
					pos = Pos.toLowerCase(),
					key = 'scroll' + Pos,
					act = $elem[0][key];
					
				attr[key] = toff ? toff[pos] + ( $elem.is('html,body') ? 0 : act - $elem.offset()[pos] ) : t[pos];
				
				if( settings.margin && t.css )//if it's a dom element,reduce the margin
					attr[key] -= parseInt( t.css('margin'+Pos) ) || 0;
				
				if( settings.offset && settings.offset[pos] )
					attr[key] += settings.offset[pos];
				
				if( !i && settings.queue ){		
					if( act != attr[key] && Math.abs(act-attr[key]) > 1 )
						animate( settings.onAfterFirst );
					delete attr[key];
				}
			};
			function animate( callback ){
				$elem.animate( attr, settings.speed, settings.easing, function(){
					if( callback )
						callback.call(this, $elem, attr, t );
				});
			};
		});
	};

})( jQuery );
/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
  */
jQuery.easing['jswing'] = jQuery.easing['swing'];

jQuery.extend( jQuery.easing,
{
	def: 'easeOutQuad',
	swing: function (x, t, b, c, d) {
		return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
	},
	easeInQuad: function (x, t, b, c, d) {
		return c*(t/=d)*t + b;
	},
	easeOutQuad: function (x, t, b, c, d) {
		return -c *(t/=d)*(t-2) + b;
	},
	easeInOutQuad: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t + b;
		return -c/2 * ((--t)*(t-2) - 1) + b;
	},
	easeInCubic: function (x, t, b, c, d) {
		return c*(t/=d)*t*t + b;
	},
	easeOutCubic: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t + 1) + b;
	},
	easeInOutCubic: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t + b;
		return c/2*((t-=2)*t*t + 2) + b;
	},
	easeInQuart: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t + b;
	},
	easeOutQuart: function (x, t, b, c, d) {
		return -c * ((t=t/d-1)*t*t*t - 1) + b;
	},
	easeInOutQuart: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
		return -c/2 * ((t-=2)*t*t*t - 2) + b;
	},
	easeInQuint: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t*t + b;
	},
	easeOutQuint: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t*t*t + 1) + b;
	},
	easeInOutQuint: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
		return c/2*((t-=2)*t*t*t*t + 2) + b;
	},
	easeInSine: function (x, t, b, c, d) {
		return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
	},
	easeOutSine: function (x, t, b, c, d) {
		return c * Math.sin(t/d * (Math.PI/2)) + b;
	},
	easeInOutSine: function (x, t, b, c, d) {
		return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
	},
	easeInExpo: function (x, t, b, c, d) {
		return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
	},
	easeOutExpo: function (x, t, b, c, d) {
		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
	},
	easeInOutExpo: function (x, t, b, c, d) {
		if (t==0) return b;
		if (t==d) return b+c;
		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
	},
	easeInCirc: function (x, t, b, c, d) {
		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
	},
	easeOutCirc: function (x, t, b, c, d) {
		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
	},
	easeInOutCirc: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
		return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
	},
	easeInElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
	},
	easeOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
	},
	easeInOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
		return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
	},
	easeInBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*(t/=d)*t*((s+1)*t - s) + b;
	},
	easeOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
	},
	easeInOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158; 
		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
	},
	easeInBounce: function (x, t, b, c, d) {
		return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
	},
	easeOutBounce: function (x, t, b, c, d) {
		if ((t/=d) < (1/2.75)) {
			return c*(7.5625*t*t) + b;
		} else if (t < (2/2.75)) {
			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
		} else if (t < (2.5/2.75)) {
			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
		} else {
			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
		}
	},
	easeInOutBounce: function (x, t, b, c, d) {
		if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
		return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
	}
});
;(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);
;(function($){
	$.fn.jNice = function(options){
		options = $.extend({}, {items: '*'}, options);
		var $self = this;
		var safari = $.browser.safari; 
		var hideSelect = function(){
			$('.jNiceSelectWrapper ul:visible').hide();
		};
		var checkExternalClick = function(event) {
			if ($(event.target).parents('.jNiceSelectWrapper').length === 0) { hideSelect(); }
		};
		$(document).mousedown(checkExternalClick);
		var jReset = function(f){
			var sel;
			$('.jNiceSelectWrapper select', f).each(function(){sel = (this.selectedIndex<0) ? 0 : this.selectedIndex; $('ul', $(this).parent()).each(function(){$('a:eq('+ sel +')', this).click();});});
			$('a.jNiceCheckbox, a.jNiceRadio', f).removeClass('jNiceChecked');
			$('input:checkbox, input:radio', f).each(function(){if(this.checked){$('a', $(this).parent()).addClass('jNiceChecked');}});
		};
		this.bind('reset',function(){var action = function(){jReset(this);}; window.setTimeout(action, 10);});
	
		/* each form */
		return this.each(function(){
			var self = da_form = this;
			if (!self.processed) {
				var setButton = function(){
					var self = this;
					var $button = $('<button type="'+ this.type +'" class="'+ this.className +'"><span><span>'+ $(this).attr('value') +'</span></span>')
						.hover(function(){
							$(this).addClass('hover');
						}, function(){
							$(this).removeClass('hover');
						}).click(function(){
							$(self).click();
							return false;
						});
					$(this).addClass('jNiceHidden').after($button);
				};
				$('input:submit, input:reset', this).filter(options.items).each(setButton);
				var setText = function(){
					var $input = $(this);
					var the_class = 'jNiceInputWrapper';
					if ($input.is('.error')) the_class += 'Error';
					$input.addClass("jNiceInput").wrap('<div class="'+the_class+'"><div class="jNiceInputInner"><div></div></div></div>');
					var $wrapper = $input.parents('div.' + the_class);
					$wrapper.css("width", $(this).width()+10);
					$input.focus(function(){
						$wrapper.addClass("jNiceInputWrapper_hover");
					}).blur(function(){
						$wrapper.removeClass("jNiceInputWrapper_hover");
					});
				};
				$('input:text:visible, input:password', this).filter(options.items).each(setText);
				if (safari){$('.jNiceInputWrapper').each(function(){$(this).addClass('jNiceSafari').find('input').css('width', $(this).width()+11);});}
				$('input:checkbox', this).filter(options.items).each(function(){
					$(this).addClass('jNiceHidden').wrap('<span></span>');
					var $wrapper = $(this).parent();
					$wrapper.prepend('<a href="#" class="jNiceCheckbox"></a>');
					if ($(this).attr('disabled')) $(this).siblings('a.jNiceCheckbox').addClass('disabled');
					$(this).siblings('a.jNiceCheckbox').click(function(){
							var $a = $(this), $input = $a.siblings('input');
							if ($input.attr('disabled')) return false;
							$input[0].checked = !$input[0].checked;
							$input.trigger('change');
							return false;
					});
					if (this.checked){$('a.jNiceCheckbox', $wrapper).addClass('jNiceChecked');}
				}).bind('change', function(){
					var $this = $(this), $a = $this.parents('span').find('a.jNiceCheckbox');
					if (this.checked == true) checkbox_toggle($a, $this, true);
					else checkbox_toggle($a, $this, false);
				});
				
				function checkbox_toggle($a, $checkbox, state) {
					if (!state) {
						$checkbox[0].checked = false;
						$a.removeClass('jNiceChecked');
					} else {
						$checkbox[0].checked = true;
						$a.addClass('jNiceChecked');
					}
				}
				$('input:radio', this).filter(options.items).each(function(){
					$input = $(this);
					$input.addClass('jNiceHidden').wrap('<span class="jRadioWrapper"></span>');
					var $wrapper = $input.parent();
					$wrapper.prepend('<a href="#" class="jNiceRadio" rel="'+ this.name +'"></a>');
					$('a.jNiceRadio', $wrapper).click(function(){
							var $a = $(this);
							$a.siblings('input')[0].checked = true;
							$a.addClass('jNiceChecked');
							$('a[rel="'+ $a.attr('rel') +'"]').not($a).each(function(){
								$(this).removeClass('jNiceChecked').siblings('input')[0].checked=false;
							});
							return false;
					});
					if (this.checked){$('a.jNiceRadio', $wrapper).addClass('jNiceChecked');}
				});
		
				$('select', this).filter(options.items).each(function(index){
					var $select = $(this);
					$(this).addClass('jNiceHidden').wrap('<div class="jNiceSelectWrapper"></div>');
					var $wrapper = $(this).parent().css({zIndex: 100-index});
					$wrapper.prepend('<div><span></span><a href="#" class="jNiceSelectOpen"></a></div><ul></ul>');
					var $ul = $('ul', $wrapper);
					$('option', this).each(function(i){
						var the_text;
						if (self.id && self.id == 'connect_content_filter') {
							the_text = this.text.split('/');
							the_text = the_text[0] + '/<strong>' + the_text[1] + '</strong>';
						} else the_text = this.text;
						$ul.append('<li><a href="#" index="'+ i +'">'+ the_text +'</a></li>');
					});
					$ul.hide().find('a').click(function(){
							$('a.selected', $wrapper).removeClass('selected');
							$(this).addClass('selected');	
							$select[0].selectedIndex = $(this).attr('index');
							$('span:eq(0)', $wrapper).html($(this).html());
							$ul.hide();
							$select.trigger('change');
							return false;
					});
					$('a:eq('+ this.selectedIndex +')', $ul).click();
					var $liz;
					/*
					if (($liz = $('li', $ul)).length < 6) {
						$ul.height($liz.length * 22);
					}
					*/
				});
				$('a.jNiceSelectOpen', this).unbind('click').click(function(){
						var $ul = $(this).parent().siblings('ul');
						if ($ul.css('display')=='none'){hideSelect();}
							$ul.toggle();
						var offSet = ($('a.selected', $ul).offset().top - $ul.offset().top);
						//$ul.animate({scrollTop: offSet});
						$ul[0].scrollTop = offSet;
						return false;
				});
				self.processed = true;
			} 
		}); 
	};

})(jQuery);
;(function($) {
      
  $.fn.example = function(text, args) {
    var options = $.extend({}, $.fn.example.defaults, args);
    var callback = $.isFunction(text);
    if (!$.fn.example.bound_class_names[options.class_name]) {
      $(window).unload(function() {
        $('.' + options.class_name).val('');
      });
      $('form .submit').click(function() {
        $(this).parents('form').find('.' + options.class_name).val('');
      });
      $.fn.example.bound_class_names[options.class_name] = true;      
    }
    
    return this.each(function() {
      var $this = $(this);
      if ($.browser.msie && !$this.attr('defaultValue') &&
          (callback ? $this.val() != '' : $this.val() == text)) {
        $this.val('');
      }
      if (options.hide_label) {
        var label = $('label[@for=' + $this.attr('id') + ']');
        var text = label.html();
        label.next('br').hide();
        label.hide();
      }
      if ($this.val() == '') {
        $this.addClass(options.class_name);
        $this.val(callback ? text.call(this) : text);
      }
      $this.focus(function() {
        if ($(this).is('.' + options.class_name)) {
          $(this).val('');
          $(this).removeClass(options.class_name);
        }
      });
      $this.blur(function() {
        if ($(this).val() == '') {
          $(this).addClass(options.class_name);
          $(this).val(callback ? text.call(this) : text);
        }
      });
    });
  };
  $.fn.example.defaults = {
    class_name: 'example',
    hide_label: true
  };
  $.fn.example.bound_class_names = [];  
})(jQuery);

var humanMsg = {
	numMsgs: 0,
	timer: 0,
	setup: function(appendTo, logName) {
		humanMsg.logID = 'humanMsgLog';

		var appendTo = 'body';

		jQuery(appendTo).append('<div id="'+humanMsg.logID+'"><ul></ul></div>')
		
		humanMsg.log = jQuery('#'+humanMsg.logID);
		humanMsg.logUL = jQuery('ul', humanMsg.log);
		if (!($.browser.msie && $.browser.version < 7)) humanMsg.logUL.hide();
		humanMsg.bindEvents();
		humanMsg.checkMsgs();
	},
	
	checkMsgs: function(){
		jQuery('ul.messages').each(function(i,e){
			var className = $.trim(this.className.replace('messages', ''));
			$('li', this).each(function(){
				humanMsg.addMsg($(this).html(), className);
			});
		});
		if (humanMsg.numMsgs>0) humanMsg.show('show');
	},

	addMsg: function(msg, type) {
		if (msg == '')	return;
	
		humanMsg.log.show().children('ul').prepend('<li'+(type ? ' class="'+type+'"' : '')+'>'+msg+'</li>').children('li:first').slideDown(200);
		humanMsg.numMsgs++;
		$('#humanMsgLog a[@target=messenger]').bind('click', function(){
			var popupWindowTest = window.open(this.href, "messenger_" + new Date().getTime(), "width=400,height=600,toolbar=0,directories=0,menubar=0,status=0,location=0,scrollbars=0,resizable=1");
			if(popupWindowTest) return false;
		});
	},
	
	clearMsgs: function(){
		humanMsg.logUL.empty();
		humanMsg.numMsgs = 0;
	},
	
	bindEvents : function(){
		if ($.browser.msie && $.browser.version < 7) {
			humanMsg.log.css({position: 'absolute', bottom: 0});
			jQuery(window).bind('resize', humanMsg.stickyFooter).bind('scroll', humanMsg.stickyFooter);
		}
	},
	
	stickyFooter : function(e) {
		var x, h = $(window).height(), s = $(window).scrollTop(), hh = humanMsg.log.height();
		x = s + h - hh;
		humanMsg.log.css({top: x});
	},
	
	show: function(to){
		if (to == 'show') {
			humanMsg.logUL.prepend('<li><strong>System messages <a href="#" title="Close" class="close">X</a></strong></li>').children('li:first').slideDown(200);	
			humanMsg.logUL.find('a.close').click(function(){
				humanMsg.show('hide');
				return false;
			});
			clearTimeout(humanMsg.timer);
			if (humanMsg.logUL.find('a:not(.close)').length == 0) humanMsg.timer = setTimeout(humanMsg.show, 5000, 'hide');
		}
		humanMsg.logUL.animate({height: to}, {duration: 'medium', step: humanMsg.step, complete: function(){
				if (humanMsg.logUL.is(':hidden')) {
					humanMsg.clearMsgs();
				}
				humanMsg.step();
			}
		});
	},
	
	step: function(){
		if ($.browser.msie && $.browser.version < 7) {
			humanMsg.stickyFooter();
		}
	}
};
;(function($) { 
  var $cluetip, $cluetipInner, $cluetipOuter, $cluetipTitle, $cluetipArrows, $dropShadow, imgCount;
  $.fn.cluetip = function(options) {

    var opts = $.extend({},$.fn.cluetip.defaults, options);

    if (options && options.ajaxSettings) {
      $.extend(opts.ajaxSettings, options.ajaxSettings);
      delete options.ajaxSettings;
    }
    
    if (options && options.hoverIntent) {
      $.extend(opts.hoverIntent, options.hoverIntent);
      delete options.hoverIntent;
    }    

    if (options && options.fx) {
      $.extend(opts.fx, options.fx);
      delete options.fx;
    }
    
    return this.each(function(index) {
      var cluetipContents = false;
      var cluezIndex = parseInt(opts.cluezIndex, 10)-1;
      var isActive = false, closeOnDelay = 0;
      if (!$cluetip) {
        $cluetipInner = $('<div id="cluetip-inner"></div>');
        $cluetipTitle = $('<h3 id="cluetip-title"></h3>');        
        $cluetipOuter = $('<div id="cluetip-outer"></div>').append($cluetipInner).prepend($cluetipTitle);
        $cluetip = $('<div id="cluetip"></div>').css({opacity: opts.opacity})
        .append($cluetipOuter).append('<div id="cluetip-extra"></div>')[insertionType](insertionElement).hide();
        $('<div id="cluetip-waitimage"></div>').css({position: 'absolute'})
        .insertBefore('#cluetip').hide();
        $cluetip.css({position: 'absolute'});
        $cluetipOuter.css({position: 'relative'});
        $cluetipArrows = $('<div id="cluetip-arrows" class="cluetip-arrows"></div>').appendTo('#cluetip');
      }
      var dropShadowSteps = (opts.dropShadow) ? +opts.dropShadowSteps : 0;
      if (!$dropShadow) {
        $dropShadow = $([]);
        for (var i=0; i < dropShadowSteps; i++) {
          $dropShadow = $dropShadow.add($('<div></div>').css({zIndex: cluezIndex-i-1, opacity:.1, top: 1+i, left: 1+i}));
        };
        $dropShadow.css({position: 'absolute', backgroundColor: '#000'})
        .prependTo($cluetip);
      }
      var $this = $(this);
      var tipAttribute = $this.attr(opts.attribute), ctClass = opts.cluetipClass;
      if (!tipAttribute && !opts.splitTitle) return true;
      if (opts.local && opts.hideLocal) { $(tipAttribute + ':first').hide(); }
      var tOffset = parseInt(opts.topOffset, 10), lOffset = parseInt(opts.leftOffset, 10);
      var tipHeight, wHeight;
      var defHeight = isNaN(parseInt(opts.height, 10)) ? 'auto' : (/\D/g).test(opts.height) ? opts.height : opts.height + 'px';
      var sTop, linkTop, posY, tipY, mouseY, baseline;
      var tipInnerWidth = isNaN(parseInt(opts.width, 10)) ? 275 : parseInt(opts.width, 10);
      var tipWidth = tipInnerWidth + (parseInt($cluetip.css('paddingLeft'))||0) + (parseInt($cluetip.css('paddingRight'))||0) + dropShadowSteps;
      var linkWidth = this.offsetWidth;
      var linkLeft, posX, tipX, mouseX, winWidth;
            
      var tipParts;
      var tipTitle = (opts.attribute != 'title') ? $this.attr(opts.titleAttribute) : '';
			if (tipTitle=='') tipTitle = $this[0].the_title;
      if (opts.splitTitle) {
        if(tipTitle == undefined) {tipTitle = '';}
        tipParts = tipTitle.split(opts.splitTitle);
        tipTitle = tipParts.shift();
      }
      var localContent;
      
    var activate = function(event) {
      if (!opts.onActivate($this)) {
        return false;
      }
      isActive = true;
      $cluetip.removeClass().css({width: tipInnerWidth});
      if (tipAttribute == $this.attr('href')) {
        $this.css('cursor', opts.cursor);
      }
      $this.attr('title','');
      if (opts.hoverClass) {
        $this.addClass(opts.hoverClass);
      }
      linkTop = posY = $this.offset().top;
      linkLeft = $this.offset().left;
      mouseX = event.pageX;
      mouseY = event.pageY;
      if ($this[0].tagName.toLowerCase() != 'area') {
        sTop = $(document).scrollTop();
        winWidth = $(window).width();
      }

      if (opts.positionBy == 'fixed') {
        posX = linkWidth + linkLeft + lOffset;
        $cluetip.css({left: posX});
      } else {
        posX = (linkWidth > linkLeft && linkLeft > tipWidth)
          || linkLeft + linkWidth + tipWidth + lOffset > winWidth 
          ? linkLeft - tipWidth - lOffset 
          : linkWidth + linkLeft + lOffset;
        if ($this[0].tagName.toLowerCase() == 'area' || opts.positionBy == 'mouse' || linkWidth + tipWidth > winWidth) { // position by mouse
          if (mouseX + 20 + tipWidth > winWidth) {  
            $cluetip.addClass(' cluetip-' + ctClass);
            posX = (mouseX - tipWidth - lOffset) >= 0 ? mouseX - tipWidth - lOffset - parseInt($cluetip.css('marginLeft'),10) + parseInt($cluetipInner.css('marginRight'),10) :  mouseX - (tipWidth/2);
          } else {
            posX = mouseX + lOffset;
          }
        }
        var pY = posX < 0 ? event.pageY + tOffset : event.pageY;
				var notEnoughRightSpace = ((linkWidth + linkLeft + tipWidth + lOffset) > winWidth);
        $cluetip.css({left: (posX > 0 && opts.positionBy != 'bottomTop') ? posX : notEnoughRightSpace ? (winWidth - tipWidth) : Math.max((linkWidth + linkLeft + lOffset),0)});
				$('#cluetip-arrows').css('left', notEnoughRightSpace ? (Math.abs(parseInt($cluetip.css('left')) - linkLeft) + (linkWidth/2)) + 'px' : '15%');
      }
        wHeight = $(window).height();

      if (tipParts) {
        var tpl = tipParts.length;
        for (var i=0; i < tpl; i++){
          if (i == 0) {
            $cluetipInner.html(tipParts[i]);
          } else { 
            $cluetipInner.append('<div class="split-body">' + tipParts[i] + '</div>');
          }            
        };
        cluetipShow(pY);
      }

      else if (!opts.local && tipAttribute.indexOf('#') != 0) {
        if (cluetipContents && opts.ajaxCache) {
          $cluetipInner.html(cluetipContents);
          cluetipShow(pY);
        }
        else {
          var ajaxSettings = opts.ajaxSettings;
          ajaxSettings.url = tipAttribute;
          ajaxSettings.beforeSend = function() {
            $cluetipOuter.children().empty();
            if (opts.waitImage) {
              $('#cluetip-waitimage')
              .css({top: mouseY+20, left: mouseX+20})
              .show();
            }
          };
         ajaxSettings.error = function() {
            if (isActive) {
              $cluetipInner.html('<i>sorry, the contents could not be loaded</i>');
            }
          };
          ajaxSettings.success = function(data) {
            cluetipContents = opts.ajaxProcess(data);
            if (isActive) {
              $cluetipInner.html(cluetipContents);
            }
          };
          ajaxSettings.complete = function() {
          	imgCount = $('#cluetip-inner img').length;
        		if (imgCount) {
        		  $('#cluetip-inner img').load( function(){
          			imgCount--;
          			if (imgCount<1) {
          				$('#cluetip-waitimage').hide();
          			  if (isActive) cluetipShow(pY);
          			}
        		  }); 
        		} else {
      				$('#cluetip-waitimage').hide();
        		  if (isActive) cluetipShow(pY);    
        		} 
          };
          $.ajax(ajaxSettings);
        }

      } else if (opts.local){
        var $localContent = $(tipAttribute + ':first');
        var localCluetip = $.fn.wrapInner ? $localContent.wrapInner('<div></div>').children().clone(true) : $localContent.html();
        $.fn.wrapInner ? $cluetipInner.empty().append(localCluetip) : $cluetipInner.html(localCluetip);
        cluetipShow(pY);
      }
    };

    var cluetipShow = function(bpY) {
      $cluetip.addClass('cluetip-' + ctClass);
      $('#cluetip-close').remove();
      if (opts.truncate) { 
        var $truncloaded = $cluetipInner.text().slice(0,opts.truncate) + '...';
        $cluetipInner.html($truncloaded);
      }
      function doNothing() {}; //empty function
      tipTitle ? $cluetipTitle.show().html(tipTitle) : (opts.showTitle) ? $cluetipTitle.show().html('&nbsp;') : $cluetipTitle.hide();
			
      if (opts.sticky) {
        var $closeLink = $('<div id="cluetip-close" class="clearfix"><a href="#">' + opts.closeText + '</a></div>');
        (opts.closePosition == 'bottom') ? $closeLink.appendTo($cluetipInner) : (opts.closePosition == 'title') ? $closeLink.prependTo($cluetipTitle) : $closeLink.prependTo($cluetipInner);
        $closeLink.find('a:first').click(function() {
          cluetipClose();
          return false;
        });
        if (opts.mouseOutClose) {
          if ($.fn.hoverIntent && opts.hoverIntent) { 
            $cluetip.hoverIntent({
              over: doNothing, 
              timeout: opts.hoverIntent.timeout,  
              out: function() { $closeLink.trigger('click'); }
            });
          } else {
            $cluetip.hover(doNothing, 
            function() {$closeLink.trigger('click'); });
          }
        } else {
          $cluetip.unbind('mouseout');
        }
      }
			
			if (opts.confirmer) {
				$closeLink.find('a:first').addClass('jtip-button');
				var $confirmLink = $('<a class="jtip-button" href="#">yes</a>').bind('click', function(){
					return opts.confirmer.apply($this, [inactivate]);
				}).prependTo($('#cluetip-close'));
			}

      var direction = '';
      $cluetipOuter.css({overflow: defHeight == 'auto' ? 'visible' : 'auto', height: defHeight});
      tipHeight = defHeight == 'auto' ? $cluetip.outerHeight() : parseInt(defHeight,10);   
      tipY = posY;
      baseline = sTop + wHeight;
      if (opts.positionBy == 'fixed') {
        tipY = posY - opts.dropShadowSteps + tOffset;
      } else if ( (posX < mouseX && Math.max(posX, 0) + tipWidth > mouseX) || opts.positionBy == 'bottomTop') {
        if (posY + tipHeight + tOffset > baseline && mouseY - sTop > tipHeight + tOffset) { 
          tipY = posY - tipHeight - tOffset;
          direction = 'top';
        } else { 
          tipY = posY + tOffset;
          direction = 'bottom';
        }
      } else if ( posY + tipHeight + tOffset > baseline ) {
        tipY = (tipHeight >= wHeight) ? sTop : baseline - tipHeight - tOffset;
      } else if ($this.css('display') == 'block' || $this[0].tagName.toLowerCase() == 'area' || opts.positionBy == "mouse") {
        tipY = bpY - tOffset;
      } else {
        tipY = posY - opts.dropShadowSteps;
      }
      if (direction == '') {
        posX < linkLeft ? direction = 'left' : direction = 'right';
      }
      $cluetip.css({top: tipY + 'px'}).removeClass().addClass('clue-' + direction + '-' + ctClass).addClass(' cluetip-' + ctClass);
      if (opts.arrows&&!$.browser.msie) { // set up arrow positioning to align with element
        var bgY = (posY - tipY - opts.dropShadowSteps);
        $cluetipArrows.css({top: (/(left|right)/.test(direction) && posX >=0 && bgY > 0) ? bgY + 'px' : /(left|right)/.test(direction) ? 0 : ''}).show();
      } else {
        $cluetipArrows.hide();
      }

      $dropShadow.hide();
      $cluetip.hide()[opts.fx.open](opts.fx.open != 'show' && opts.fx.openSpeed);
      if (opts.dropShadow) $dropShadow.css({height: tipHeight, width: tipInnerWidth}).show();
      if ($.fn.bgiframe) { $cluetip.bgiframe(); }
      // trigger the optional onShow function
      if (opts.delayedClose > 0) {
        closeOnDelay = setTimeout(cluetipClose, opts.delayedClose);
      }

      opts.onShow($cluetip, $cluetipInner);
      
    };

    var inactivate = function() {
      isActive = false;
      $('#cluetip-waitimage').hide();
      if (!opts.sticky || (/click|toggle/).test(opts.activation) ) {
        cluetipClose();
clearTimeout(closeOnDelay);        
      };
      if (opts.hoverClass) {
        $this.removeClass(opts.hoverClass);
      }
      $('.cluetip-clicked').removeClass('cluetip-clicked');
    };

    var cluetipClose = function() {
      $cluetipOuter 
      .parent().hide().removeClass().end()
      .children().empty();
      if (tipTitle) {
        $this.attr('title', tipTitle);
      }
      $this.css('cursor','');
      if (opts.arrows) $cluetipArrows.css({top: ''});
    };

      if ( (/click|toggle/).test(opts.activation) ) {
        $this.click(function(event) {
          if ($cluetip.is(':hidden') || !$this.is('.cluetip-clicked')) {
            activate(event);
            $('.cluetip-clicked').removeClass('cluetip-clicked');
            $this.addClass('cluetip-clicked');

          } else {
            inactivate(event);

          }
          this.blur();
          return false;
        });
      } else if (opts.activation == 'focus') {
        $this.focus(function(event) {
          activate(event);
        });
        $this.blur(function(event) {
          inactivate(event);
        });
      } else {
        $this.click(function() {
          if ($this.attr('href') && $this.attr('href') == tipAttribute && !opts.clickThrough) {
            return false;
          }
        });
        var mouseTracks = function(evt) {
          if (opts.tracking == true) {
            var trackX = posX - evt.pageX;
            var trackY = tipY ? tipY - evt.pageY : posY - evt.pageY;
            $this.mousemove(function(evt) {
              $cluetip.css({left: evt.pageX + trackX, top: evt.pageY + trackY });
            });
          }
        };
        if ($.fn.hoverIntent && opts.hoverIntent) {
          $this.mouseover(function() {$this.attr('title',''); })
          .hoverIntent({
            sensitivity: opts.hoverIntent.sensitivity,
            interval: opts.hoverIntent.interval,  
            over: function(event) {
              activate(event);
              mouseTracks(event);
            }, 
            timeout: opts.hoverIntent.timeout,  
            out: function(event) {inactivate(event); $this.unbind('mousemove');}
          });           
        } else {
          $this.hover(function(event) {
            activate(event);
            mouseTracks(event);
          }, function(event) {
            inactivate(event);
            $this.unbind('mousemove');
          });
        }
      }
    });
  };
  
  $.fn.cluetip.defaults = { 
    width:            275,     
    height:           'auto',  
    cluezIndex:       97,      
    positionBy:       'auto',  
    topOffset:        25,     
    leftOffset:       -35,  
    local:            false, 
    hideLocal:        true,   
    attribute:        'rel',   
    titleAttribute:   'title',
    splitTitle:       '',     
    showTitle:        true,    
    cluetipClass:     'default',
    hoverClass:       '',   
    waitImage:        true,    
    cursor:           'help',
    arrows:           false,    
    dropShadow:       true,    
    dropShadowSteps:  6,       
    sticky:           false,  
    mouseOutClose:    false,  
    activation:       'hover', 
    clickThrough:     false,   
    tracking:         false,    
    delayedClose:     0,     
    closePosition:    'top',   
    closeText:        'Close', 
    truncate:         0,       
		opacity:					1,			
		confirmer:				false,		// dingle dangle
    fx: {             
                      open:       'show',
                      openSpeed:  ''
    },     
 
    hoverIntent: {    
                      sensitivity:  3,
              			  interval:     50,
              			  timeout:      0
    },
    onActivate:       function(e) {return true;},
    onShow:           function(ct, c){},
    ajaxCache:        true,  
    ajaxProcess:      function(data) {
                        data = data.replace(/<s(cript|tyle)(.|\s)*?\/s(cript|tyle)>/g, '').replace(/<(link|title)(.|\s)*?\/(link|title)>/g,'');
                        return data;
    },                
    ajaxSettings: {   
                      dataType: 'html'
    }
  };
   
  var insertionType = 'appendTo', insertionElement = 'body';
  $.cluetip = {};
  $.cluetip.setup = function(options) {
    if (options && options.insertionType && (options.insertionType).match(/appendTo|prependTo|insertBefore|insertAfter/)) {
      insertionType = options.insertionType;
    }
    if (options && options.insertionElement) {
      insertionElement = options.insertionElement;
    }
  };
  
})(jQuery);