// Put all your code in your document ready area
jQuery(document).ready(function($){
/* Copyright (c) 2006 Mathias Bank (http://www.mathias-bank.de)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 * 
 * Thanks to Hinnerk Ruemenapf - http://hinnerk.ruemenapf.de/ for bug reporting and fixing.
 */
jQuery.extend({
/**
* Returns get parameters.
*
* If the desired param does not exist, null will be returned
*
* @example value = $.getURLParam("paramName");
*/ 
 getURLParam: function(strParamName){
		   var strReturn = "";
		   var strHref = window.location.href;
		   var bFound=false;
		   
		   var cmpstring = strParamName + "=";
		   var cmplen = cmpstring.length;

		   if ( strHref.indexOf("?") > -1 ){
		     var strQueryString = strHref.substr(strHref.indexOf("?")+1);
		     var aQueryString = strQueryString.split("&");
		     for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
		       if (aQueryString[iParam].substr(0,cmplen)==cmpstring){
		         var aParam = aQueryString[iParam].split("=");
		         strReturn = aParam[1];
		         bFound=true;
		         break;
		       }
		       
		     }
		   }
		   if (bFound==false) return null;
		   return strReturn;
		 }
});
/*
 * jqModal - Minimalist Modaling with jQuery
 *   (http://dev.iceburg.net/jquery/jqModal/)
 *
 * Copyright (c) 2007,2008 Brice Burgess <bhb@iceburg.net>
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 * 
 * $Version: 03/01/2009 +r14
 */
(function($) {
$.fn.jqm=function(o){
var p={
overlay: 30,
overlayClass: 'jqmOverlay',
closeClass: 'jqmClose',
trigger: '.jqModal',
ajax: F,
ajaxText: '',
target: F,
modal: F,
toTop: F,
onShow: F,
onHide: F,
onLoad: F
};
return this.each(function(){if(this._jqm)return H[this._jqm].c=$.extend({},H[this._jqm].c,o);s++;this._jqm=s;
H[s]={c:$.extend(p,$.jqm.params,o),a:F,w:$(this).addClass('jqmID'+s),s:s};
if(p.trigger)$(this).jqmAddTrigger(p.trigger);
});};
$.fn.jqmAddClose=function(e){return hs(this,e,'jqmHide');};
$.fn.jqmAddTrigger=function(e){return hs(this,e,'jqmShow');};
$.fn.jqmShow=function(t){return this.each(function(){t=t||window.event;$.jqm.open(this._jqm,t);});};
$.fn.jqmHide=function(t){return this.each(function(){t=t||window.event;$.jqm.close(this._jqm,t)});};
$.jqm = {
hash:{},
open:function(s,t){var h=H[s],c=h.c,cc='.'+c.closeClass,z=(parseInt(h.w.css('z-index'))),z=(z>0)?z:3000,o=$('<div></div>').css({height:'100%',width:'100%',position:'fixed',left:0,top:0,'z-index':z-1,opacity:c.overlay/100});if(h.a)return F;h.t=t;h.a=true;h.w.css('z-index',z);
 if(c.modal) {if(!A[0])L('bind');A.push(s);}
 else if(c.overlay > 0)h.w.jqmAddClose(o);
 else o=F;
 h.o=(o)?o.addClass(c.overlayClass).prependTo('body'):F;
 if(ie6){$('html,body').css({height:'100%',width:'100%'});if(o){o=o.css({position:'absolute'})[0];for(var y in {Top:1,Left:1})o.style.setExpression(y.toLowerCase(),"(_=(document.documentElement.scroll"+y+" || document.body.scroll"+y+"))+'px'");}}
 if(c.ajax) {var r=c.target||h.w,u=c.ajax,r=(typeof r == 'string')?$(r,h.w):$(r),u=(u.substr(0,1) == '@')?$(t).attr(u.substring(1)):u;
  r.html(c.ajaxText).load(u,function(){if(c.onLoad)c.onLoad.call(this,h);if(cc)h.w.jqmAddClose($(cc,h.w));e(h);});}
 else if(cc)h.w.jqmAddClose($(cc,h.w));
 if(c.toTop&&h.o)h.w.before('<span id="jqmP'+h.w[0]._jqm+'"></span>').insertAfter(h.o);	
 (c.onShow)?c.onShow(h):h.w.show();e(h);return F;
},
close:function(s){var h=H[s];if(!h.a)return F;h.a=F;
 if(A[0]){A.pop();if(!A[0])L('unbind');}
 if(h.c.toTop&&h.o)$('#jqmP'+h.w[0]._jqm).after(h.w).remove();
 if(h.c.onHide)h.c.onHide(h);else{h.w.hide();if(h.o)h.o.remove();} return F;
},
params:{}};
var s=0,H=$.jqm.hash,A=[],ie6=$.browser.msie&&($.browser.version == "6.0"),F=false,
i=$('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({opacity:0}),
e=function(h){if(ie6)if(h.o)h.o.html('<p style="width:100%;height:100%"/>').prepend(i);else if(!$('iframe.jqm',h.w)[0])h.w.prepend(i); f(h);},
f=function(h){try{$(':input:visible',h.w)[0].focus();}catch(_){}},
L=function(t){$()[t]("keypress",m)[t]("keydown",m)[t]("mousedown",m);},
m=function(e){var h=H[A[A.length-1]],r=(!$(e.target).parents('.jqmID'+h.s)[0]);if(r)f(h);return !r;},
hs=function(w,t,c){return w.each(function(){var s=this._jqm;$(t).each(function() {
 if(!this[c]){this[c]=[];$(this).click(function(){for(var i in {jqmShow:1,jqmHide:1})for(var s in this[i])if(H[this[i][s]])H[this[i][s]].w[i](this);return F;});}this[c].push(s);});});};
})(jQuery);
// javascript method: "pxToEm"
eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};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}('(4($){k.9.7=5.9.7=4(a){3 b=p;2(b.j==5)b=d(b);2(!a)3 a=$(\'g\');2($(a).6()>0){3 c=b*(1/(d($(a).r("n-6"))))+\'m\';8 c}l 8\'i: o h q f s a e t\'}})(u);',31,31,'||if|var|function|String|size|pxToEm|return|prototype||||parseInt|DOM|is|body|scope|Error|constructor|Number|else|em|font|Provided|this|argument|css|not|element|jQuery'.split('|'),0,{}));
/*--------------------------------------------------------------------
 * JQuery Plugin: "EqualHeights"
 * by:
   Scott Jehl (scott@filamentgroup.com)
   Todd Parker (todd@filamentgroup.com)
   http://www.filamentgroup.com
 *
 * Copyright (c) 2007 Filament Group
 * Licensed under GPL (http://www.opensource.org/licenses/gpl-license.php)
 *
 * Description: Compares the heights of the first-children of a provided element
 		 		 		 		 		 		 		 		   and sets their min-height to the tallest height. Sets in em units by default if pxToEm() method is available.
 * Dependencies: jQuery library, pxToEm method
 * Usage Example: $(element).equalHeights();
   		 		 		 		 		 		       Optional: to set min-height in px, pass a true argument: $(element).equalHeights(true);
 * Version: 1.0, 08.02.2007
 * Changelog:
 *  08.02.2007 initial Version 1.0
--------------------------------------------------------------------*/
$.fn.equalHeights = function(px) {
		 $(this).each(function(){
		 		 var currentTallest = 0;
		 		 $(this).children().each(function(i){
		 		 		 		 if($(this).height() > currentTallest) { currentTallest = $(this).height(); }
		 		 });
		 		 if(!px || !Number.prototype.pxToEm) currentTallest = currentTallest.pxToEm($(this)); //use ems unless px is specified or
		 		 // for ie6, set height since min-height isn't supported
		 		 var ie6 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 6.0") != -1);
		 		 if ($.browser.msie && (ie6)) { $(this).children().css({'height': currentTallest}); }
		 		 $(this).children().css({'min-height': currentTallest});
		 });
		 return $(this);
};
/*
 * jQuery Tooltip plugin 1.3
 *
 * http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/
 * http://docs.jquery.com/Plugins/Tooltip
 *
 * Copyright (c) 2006 - 2008 Jörn Zaefferer
 *
 * jQueryId: jquery.tooltip.js 5741 2008-06-21 15:22:16Z joern.zaefferer jQuery
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */;(function(jQuery){var helper={},current,title,tID,IE=jQuery.browser.msie&&/MSIE\s(5\.5|6\.)/.test(navigator.userAgent),track=false;jQuery.tooltip={blocked:false,defaults:{delay:200,fade:false,showURL:true,extraClass:"",top:15,left:15,id:"tooltip"},block:function(){jQuery.tooltip.blocked=!jQuery.tooltip.blocked;}};jQuery.fn.extend({tooltip:function(settings){settings=jQuery.extend({},jQuery.tooltip.defaults,settings);createHelper(settings);return this.each(function(){jQuery.data(this,"tooltip",settings);this.tOpacity=helper.parent.css("opacity");this.tooltipText=this.title;jQuery(this).removeAttr("title");this.alt="";}).mouseover(save).mouseout(hide).click(hide);},fixPNG:IE?function(){return this.each(function(){var image=jQuery(this).css('backgroundImage');if(image.match(/^url\(["']?(.*\.png)["']?\)jQuery/i)){image=RegExp.jQuery1;jQuery(this).css({'backgroundImage':'none','filter':"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+image+"')"}).each(function(){var position=jQuery(this).css('position');if(position!='absolute'&&position!='relative')jQuery(this).css('position','relative');});}});}:function(){return this;},unfixPNG:IE?function(){return this.each(function(){jQuery(this).css({'filter':'',backgroundImage:''});});}:function(){return this;},hideWhenEmpty:function(){return this.each(function(){jQuery(this)[jQuery(this).html()?"show":"hide"]();});},url:function(){return this.attr('href')||this.attr('src');}});function createHelper(settings){if(helper.parent)return;helper.parent=jQuery('<div id="'+settings.id+'"><h3></h3><div class="body"></div><div class="url"></div></div>').appendTo(document.body).hide();if(jQuery.fn.bgiframe)helper.parent.bgiframe();helper.title=jQuery('h3',helper.parent);helper.body=jQuery('div.body',helper.parent);helper.url=jQuery('div.url',helper.parent);}function settings(element){return jQuery.data(element,"tooltip");}function handle(event){if(settings(this).delay)tID=setTimeout(show,settings(this).delay);else
show();track=!!settings(this).track;jQuery(document.body).bind('mousemove',update);update(event);}function save(){if(jQuery.tooltip.blocked||this==current||(!this.tooltipText&&!settings(this).bodyHandler))return;current=this;title=this.tooltipText;if(settings(this).bodyHandler){helper.title.hide();var bodyContent=settings(this).bodyHandler.call(this);if(bodyContent.nodeType||bodyContent.jquery){helper.body.empty().append(bodyContent)}else{helper.body.html(bodyContent);}helper.body.show();}else if(settings(this).showBody){var parts=title.split(settings(this).showBody);helper.title.html(parts.shift()).show();helper.body.empty();for(var i=0,part;(part=parts[i]);i++){if(i>0)helper.body.append("<br/>");helper.body.append(part);}helper.body.hideWhenEmpty();}else{helper.title.html(title).show();helper.body.hide();}if(settings(this).showURL&&jQuery(this).url())helper.url.html(jQuery(this).url().replace('http://','')).show();else
helper.url.hide();helper.parent.addClass(settings(this).extraClass);if(settings(this).fixPNG)helper.parent.fixPNG();handle.apply(this,arguments);}function show(){tID=null;if((!IE||!jQuery.fn.bgiframe)&&settings(current).fade){if(helper.parent.is(":animated"))helper.parent.stop().show().fadeTo(settings(current).fade,current.tOpacity);else
helper.parent.is(':visible')?helper.parent.fadeTo(settings(current).fade,current.tOpacity):helper.parent.fadeIn(settings(current).fade);}else{helper.parent.show();}update();}function update(event){if(jQuery.tooltip.blocked)return;if(event&&event.target.tagName=="OPTION"){return;}if(!track&&helper.parent.is(":visible")){jQuery(document.body).unbind('mousemove',update)}if(current==null){jQuery(document.body).unbind('mousemove',update);return;}helper.parent.removeClass("viewport-right").removeClass("viewport-bottom");var left=helper.parent[0].offsetLeft;var top=helper.parent[0].offsetTop;if(event){left=event.pageX+settings(current).left;top=event.pageY+settings(current).top;var right='auto';if(settings(current).positionLeft){right=jQuery(window).width()-left;left='auto';}helper.parent.css({left:left,right:right,top:top});}var v=viewport(),h=helper.parent[0];if(v.x+v.cx<h.offsetLeft+h.offsetWidth){left-=h.offsetWidth+20+settings(current).left;helper.parent.css({left:left+'px'}).addClass("viewport-right");}if(v.y+v.cy<h.offsetTop+h.offsetHeight){top-=h.offsetHeight+20+settings(current).top;helper.parent.css({top:top+'px'}).addClass("viewport-bottom");}}function viewport(){return{x:jQuery(window).scrollLeft(),y:jQuery(window).scrollTop(),cx:jQuery(window).width(),cy:jQuery(window).height()};}function hide(event){if(jQuery.tooltip.blocked)return;if(tID)clearTimeout(tID);current=null;var tsettings=settings(this);function complete(){helper.parent.removeClass(tsettings.extraClass).hide().css("opacity","");}if((!IE||!jQuery.fn.bgiframe)&&tsettings.fade){if(helper.parent.is(':animated'))helper.parent.stop().fadeTo(tsettings.fade,0,complete);else
helper.parent.stop().fadeOut(tsettings.fade,complete);}else
complete();if(settings(this).fixPNG)helper.parent.unfixPNG();}})(jQuery);
/*
 * 		 loopedSlider 0.5.4 - jQuery plugin
 *		 written by Nathan Searles
 *		 http://nathansearles.com/loopedslider/
 *
 *		 Copyright (c) 2009 Nathan Searles (http://nathansearles.com/)
 *		 Dual licensed under the MIT (MIT-LICENSE.txt)
 *		 and GPL (GPL-LICENSE.txt) licenses.
 *
 *		 Built for jQuery library
 *		 http://jquery.com
 *
 */
(function($) {
		 $.fn.loopedSlider = function(options) {
		 var defaults = {
		 		 container: '.slideContainer',
		 		 slides: '.slideSlides',
		 		 pagination: '.slidePagination',
		 		 containerClick: false, // Click container for next slide
		 		 autoStart: 10000, // Set to positive number for auto interval and interval time
				 restart: 10000, // Set to positive number for restart and restart time
		 		 slidespeed: 1000, // Speed of slide animation
		 		 fadespeed: 300, // Speed of fade animation
		 		 autoHeight: false // Set to positive number for auto height and animation speed
		 };
		 this.each(function() {
		 		 var obj = $(this);
		 		 var o = $.extend(defaults, options);
		 		 var pagination = $(o.pagination+' li a',obj);
		 		 var m = 0;
		 		 var t = 1;
		 		 var s = $(o.slides,obj).children().size();
		 		 var w = $(o.slides,obj).children().outerWidth();
		 		 var p = 0;
		 		 var u = false;
		 		 var n = 0;
		 		 var interval=0;
		 		 var restart=0;
		 		 $(o.slides,obj).css({width:(s*w)});
		 		 $(o.slides,obj).children().each(function(){
		 		 		 $(this).css({position:'absolute',left:p,display:'block'});
		 		 		 p=p+w;
		 		 });
		 		 $(pagination,obj).each(function(){
		 		 		 n=n+1;
		 		 		 $(this).attr('rel',n);
		 		 		 $(pagination.eq(0),obj).parent().addClass('active');
		 		 });
		 		 $(o.slides,obj).children(':eq('+(s-1)+')').css({position:'absolute',left:-w});
		 		 if (s>3) {
		 		 		 $(o.slides,obj).children(':eq('+(s-1)+')').css({position:'absolute',left:-w});
		 		 }
		 		 if(o.autoHeight){autoHeight(t);}
		 		 $('.next',obj).click(function(){
		 		 		 if(u===false) {
		 		 		 		 animate('next',true);
		 		 		 		 if(o.autoStart){
		 		 		 		 		 if (o.restart) {autoStart();}
		 		 		 		 		 else {clearInterval(sliderIntervalID);}
		 		 		 		 }
		 		 		 } return false;
		 		 });
		 		 $('.previous',obj).click(function(){
		 		 		 if(u===false) {
		 		 		 		 animate('prev',true);
		 		 		 		 if(o.autoStart){
		 		 		 		 		 if (o.restart) {autoStart();}
		 		 		 		 		 else {clearInterval(sliderIntervalID);}
		 		 		 		 }
		 		 		 } return false;
		 		 });
		 		 if (o.containerClick) {
		 		 		 $(o.container ,obj).click(function(){
		 		 		 		 if(u===false) {
		 		 		 		 		 animate('next',true);
		 		 		 		 		 if(o.autoStart){
		 		 		 		 		 		 if (o.restart) {autoStart();}
		 		 		 		 		 		 else {clearInterval(sliderIntervalID);}
		 		 		 		 		 }
		 		 		 		 } return false;
		 		 		 });
		 		 }
		 		 $(pagination,obj).click(function(){
		 		 		 if ($(this).parent().hasClass('active')) {return false;}
		 		 		 else {
		 		 		 		 t = $(this).attr('rel');
		 		 		 		 $(pagination,obj).parent().siblings().removeClass('active');
		 		 		 		 $(this).parent().addClass('active');
		 		 		 		 animate('fade',t);
		 		 		 		 if(o.autoStart){
		 		 		 		 		 if (o.restart) {autoStart();}
		 		 		 		 		 else {clearInterval(sliderIntervalID);}
		 		 		 		 }
		 		 		 } return false;
		 		 });
		 		 if (o.autoStart) {
		 		 		 sliderIntervalID = setInterval(function(){
		 		 		 		 if(u===false) {animate('next',true);}
		 		 		 }, o.autoStart);
		 		 		 function autoStart() {
		 		 		 		 if (o.restart) {
		 		 		 		 clearInterval(sliderIntervalID);
		 		 		 		 clearInterval(interval);
		 		 		 		 clearTimeout(restart);
		 		 		 		 		 restart = setTimeout(function() {
		 		 		 		 		 		 interval = setInterval(		 function(){
		 		 		 		 		 		 		 animate('next',true);
		 		 		 		 		 		 },o.autoStart);
		 		 		 		 		 },o.restart);
		 		 		 		 } else {
		 		 		 		 		 sliderIntervalID = setInterval(function(){
		 		 		 		 		 		 if(u===false) {animate('next',true);}
		 		 		 		 		 },o.autoStart);
		 		 		 		 }
		 		 		 };
		 		 }
		 		 function current(t) {
		 		 		 if(t===s+1){t=1;}
		 		 		 if(t===0){t=s;}
		 		 		 $(pagination,obj).parent().siblings().removeClass('active');
		 		 		 $(pagination+'[rel="' + (t) + '"]',obj).parent().addClass('active');
		 		 };
		 		 function autoHeight(t) {
		 		 		 if(t===s+1){t=1;}
		 		 		 if(t===0){t=s;}
		 		 		 var getHeight = $(o.slides,obj).children(':eq('+(t-1)+')',obj).outerHeight();
		 		 		 $(o.container,obj).animate({height: getHeight},o.autoHeight);
		 		 };
		 		 function animate(dir,clicked){
		 		 		 u = true;
		 		 		 switch(dir){
		 		 		 		 case 'next':
		 		 		 		 		 t = t+1;
		 		 		 		 		 m = (-(t*w-w));
		 		 		 		 		 current(t);
		 		 		 		 		 if(o.autoHeight){autoHeight(t);}
		 		 		 		 		 if(s<3){
		 		 		 		 		 		 if (t===3){$(o.slides,obj).children(':eq(0)').css({left:(s*w)});}
		 		 		 		 		 		 if (t===2){$(o.slides,obj).children(':eq('+(s-1)+')').css({position:'absolute',left:(w)});}
		 		 		 		 		 }
		 		 		 		 		 $(o.slides,obj).animate({left: m}, o.slidespeed,function(){
		 		 		 		 		 		 if (t===s+1) {
		 		 		 		 		 		 		 t = 1;
		 		 		 		 		 		 		 $(o.slides,obj).css({left:0},function(){$(o.slides,obj).animate({left:m})});
		 		 		 		 		 		 		 $(o.slides,obj).children(':eq(0)').css({left: 0});
		 		 		 		 		 		 		 $(o.slides,obj).children(':eq('+(s-1)+')').css({ position:'absolute',left:-w});
		 		 		 		 		 		 }
		 		 		 		 		 		 if (t===s) $(o.slides,obj).children(':eq(0)').css({left:(s*w)});
		 		 		 		 		 		 if (t===s-1) $(o.slides,obj).children(':eq('+(s-1)+')').css({left:s*w-w});
		 		 		 		 		 		 u = false;
		 		 		 		 		 });
		 		 		 		 		 break;
		 		 		 		 case 'prev':
		 		 		 		 		 t = t-1;
		 		 		 		 		 m = (-(t*w-w));
		 		 		 		 		 current(t);
		 		 		 		 		 if(o.autoHeight){autoHeight(t);}
		 		 		 		 		 if (s<3){
		 		 		 		 		 		 if(t===0){$(o.slides,obj).children(':eq('+(s-1)+')').css({position:'absolute',left:(-w)});}
		 		 		 		 		 		 if(t===1){$(o.slides,obj).children(':eq(0)').css({position:'absolute',left:0});}
		 		 		 		 		 }
		 		 		 		 		 $(o.slides,obj).animate({left: m}, o.slidespeed,function(){
		 		 		 		 		 		 if (t===0) {
		 		 		 		 		 		 		 t = s;
		 		 		 		 		 		 		 $(o.slides,obj).children(':eq('+(s-1)+')').css({position:'absolute',left:(s*w-w)});
		 		 		 		 		 		 		 $(o.slides,obj).css({left: -(s*w-w)});
		 		 		 		 		 		 		 $(o.slides,obj).children(':eq(0)').css({left:(s*w)});
		 		 		 		 		 		 }
		 		 		 		 		 		 if (t===2 ) $(o.slides,obj).children(':eq(0)').css({position:'absolute',left:0});
		 		 		 		 		 		 if (t===1) $(o.slides,obj).children(':eq('+ (s-1) +')').css({position:'absolute',left:-w});
		 		 		 		 		 		 u = false;
		 		 		 		 		 });
		 		 		 		 		 break;
		 		 		 		 case 'fade':
		 		 		 		 		 t = [t]*1;
		 		 		 		 		 m = (-(t*w-w));
		 		 		 		 		 current(t);
		 		 		 		 		 if(o.autoHeight){autoHeight(t);}
		 		 		 		 		 $(o.slides,obj).children().fadeOut(o.fadespeed, function(){
		 		 		 		 		 		 $(o.slides,obj).css({left: m});
		 		 		 		 		 		 $(o.slides,obj).children(':eq('+(s-1)+')').css({left:s*w-w});
		 		 		 		 		 		 $(o.slides,obj).children(':eq(0)').css({left:0});
		 		 		 		 		 		 if(t===s){$(o.slides,obj).children(':eq(0)').css({left:(s*w)});}
		 		 		 		 		 		 if(t===1){$(o.slides,obj).children(':eq('+(s-1)+')').css({ position:'absolute',left:-w});}
		 		 		 		 		 		 $(o.slides,obj).children().fadeIn(o.fadespeed);
		 		 		 		 		 		 u = false;
		 		 		 		 		 });
		 		 		 		 		 break;
		 		 		 		 default:
		 		 		 		 		 break;
		 		 		 		 }
		 		 		 };
		 		 });
		 };
})(jQuery);
/*
 ### jQuery Star Rating Plugin v3.12 - 2009-04-16 ###
 * Home: http://www.fyneworks.com/jquery/star-rating/
 * Code: http://code.google.com/p/jquery-star-rating-plugin/
 *
		 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 ###
*/
/*# AVOID COLLISIONS #*/
;if(window.jQuery) (function($){
/*# AVOID COLLISIONS #*/
		 // IE6 Background Image Fix
		 if ($.browser.msie) try { document.execCommand("BackgroundImageCache", false, true)} catch(e) { };
		 // Thanks to http://www.visualjquery.com/rating/rating_redux.html
		 // plugin initialization
		 $.fn.rating = function(options){
		 		 if(this.length==0) return this; // quick fail
		 		 // Handle API methods
		 		 if(typeof arguments[0]=='string'){
		 		 		 // Perform API methods on individual elements
		 		 		 if(this.length>1){
		 		 		 		 var args = arguments;
		 		 		 		 return this.each(function(){
		 		 		 		 		 $.fn.rating.apply($(this), args);
    });
		 		 		 };
		 		 		 // Invoke API method handler
		 		 		 $.fn.rating[arguments[0]].apply(this, $.makeArray(arguments).slice(1) || []);
		 		 		 // Quick exit...
		 		 		 return this;
		 		 };
		 		 // Initialize options for this call
		 		 var options = $.extend(
		 		 		 {}/* new object */,
		 		 		 $.fn.rating.options/* default options */,
		 		 		 options || {} /* just-in-time options */
		 		 );
		 		 // Allow multiple controls with the same name by making each call unique
		 		 $.fn.rating.calls++;
		 		 // loop through each matched element
		 		 this
		 		  .not('.star-rating-applied')
		 		 		 .addClass('star-rating-applied')
		 		 .each(function(){
		 		 		 // Load control parameters / find context / etc
		 		 		 var control, input = $(this);
		 		 		 var eid = (this.name || 'unnamed-rating').replace(/\[|\]/g, '_').replace(/^\_+|\_+$/g,'');
		 		 		 var context = $(this.form || document.body);
		 		 		 // FIX: http://code.google.com/p/jquery-star-rating-plugin/issues/detail?id=23
		 		 		 var raters = context.data('rating');
		 		 		 if(!raters || raters.call!=$.fn.rating.calls) raters = { count:0, call:$.fn.rating.calls };
		 		 		 var rater = raters[eid];
		 		 		 // if rater is available, verify that the control still exists
		 		 		 if(rater) control = rater.data('rating');
		 		 		 if(rater && control)//{// save a byte!
		 		 		 		 // add star to control if rater is available and the same control still exists
		 		 		 		 control.count++;
		 		 		 //}// save a byte!
		 		 		 else{
		 		 		 		 // create new control if first star or control element was removed/replaced
		 		 		 		 // Initialize options for this raters
		 		 		 		 control = $.extend(
		 		 		 		 		 {}/* new object */,
		 		 		 		 		 options || {} /* current call options */,
		 		 		 		 		 ($.metadata? input.metadata(): ($.meta?input.data():null)) || {}, /* metadata options */
		 		 		 		 		 { count:0, stars: [], inputs: [] }
		 		 		 		 );
		 		 		 		 // increment number of rating controls
		 		 		 		 control.serial = raters.count++;
		 		 		 		 // create rating element
		 		 		 		 rater = $('<span class="star-rating-control"/>');
		 		 		 		 input.before(rater);
		 		 		 		 // Mark element for initialization (once all stars are ready)
		 		 		 		 rater.addClass('rating-to-be-drawn');
		 		 		 		 // Accept readOnly setting from 'disabled' property
		 		 		 		 if(input.attr('disabled')) control.readOnly = true;
		 		 		 		 // Create 'cancel' button
		 		 		 		 rater.append(
		 		 		 		 		 control.cancel = $('<div class="rating-cancel"><a title="' + control.cancel + '">' + control.cancelValue + '</a></div>')
		 		 		 		 		 .mouseover(function(){
		 		 		 		 		 		 $(this).rating('drain');
		 		 		 		 		 		 $(this).addClass('star-rating-hover');
		 		 		 		 		 		 //$(this).rating('focus');
		 		 		 		 		 })
		 		 		 		 		 .mouseout(function(){
		 		 		 		 		 		 $(this).rating('draw');
		 		 		 		 		 		 $(this).removeClass('star-rating-hover');
		 		 		 		 		 		 //$(this).rating('blur');
		 		 		 		 		 })
		 		 		 		 		 .click(function(){
		 		 		 		 		  $(this).rating('select');
		 		 		 		 		 })
		 		 		 		 		 .data('rating', control)
		 		 		 		 );
		 		 		 }; // first element of group
		 		 		 // insert rating star
		 		 		 var star = $('<div class="star-rating rater-'+ control.serial +'"><a title="' + (this.title || this.value) + '">' + this.value + '</a></div>');
		 		 		 rater.append(star);
		 		 		 // inherit attributes from input element
		 		 		 if(this.id) star.attr('id', this.id);
		 		 		 if(this.className) star.addClass(this.className);
		 		 		 // Half-stars?
		 		 		 if(control.half) control.split = 2;
		 		 		 // Prepare division control
		 		 		 if(typeof control.split=='number' && control.split>0){
		 		 		 		 var stw = ($.fn.width ? star.width() : 0) || control.starWidth;
		 		 		 		 var spi = (control.count % control.split), spw = Math.floor(stw/control.split);
		 		 		 		 star
		 		 		 		 // restrict star's width and hide overflow (already in CSS)
		 		 		 		 .width(spw)
		 		 		 		 // move the star left by using a negative margin
		 		 		 		 // this is work-around to IE's stupid box model (position:relative doesn't work)
		 		 		 		 .find('a').css({ 'margin-left':'-'+ (spi*spw) +'px' })
		 		 		 };
		 		 		 // readOnly?
		 		 		 if(control.readOnly)//{ //save a byte!
		 		 		 		 // Mark star as readOnly so user can customize display
		 		 		 		 star.addClass('star-rating-readonly');
		 		 		 //}  //save a byte!
		 		 		 else//{ //save a byte!
		 		 		  // Enable hover css effects
		 		 		 		 star.addClass('star-rating-live')
		 		 		 		  // Attach mouse events
		 		 		 		 		 .mouseover(function(){
		 		 		 		 		 		 $(this).rating('fill');
		 		 		 		 		 		 $(this).rating('focus');
		 		 		 		 		 })
		 		 		 		 		 .mouseout(function(){
		 		 		 		 		 		 $(this).rating('draw');
		 		 		 		 		 		 $(this).rating('blur');
		 		 		 		 		 })
		 		 		 		 		 .click(function(){
		 		 		 		 		 		 $(this).rating('select');
		 		 		 		 		 })
		 		 		 		 ;
		 		 		 //}; //save a byte!
		 		 		 // set current selection
		 		 		 if(this.checked)		 control.current = star;
		 		 		 // hide input element
		 		 		 input.hide();
		 		 		 // backward compatibility, form element to plugin
		 		 		 input.change(function(){
    $(this).rating('select');
   });
		 		 		 // attach reference to star to input element and vice-versa
		 		 		 star.data('rating.input', input.data('rating.star', star));
		 		 		 // store control information in form (or body when form not available)
		 		 		 control.stars[control.stars.length] = star[0];
		 		 		 control.inputs[control.inputs.length] = input[0];
		 		 		 control.rater = raters[eid] = rater;
		 		 		 control.context = context;
		 		 		 input.data('rating', control);
		 		 		 rater.data('rating', control);
		 		 		 star.data('rating', control);
		 		 		 context.data('rating', raters);
  }); // each element
		 		 // Initialize ratings (first draw)
		 		 $('.rating-to-be-drawn').rating('draw').removeClass('rating-to-be-drawn');
		 		 return this; // don't break the chain...
		 };
		 /*--------------------------------------------------------*/
		 /*
		 		 ### Core functionality and API ###
		 */
		 $.extend($.fn.rating, {
		 		 // Used to append a unique serial number to internal control ID
		 		 // each time the plugin is invoked so same name controls can co-exist
		 		 calls: 0,
		 		 focus: function(){
		 		 		 var control = this.data('rating'); if(!control) return this;
		 		 		 if(!control.focus) return this; // quick fail if not required
		 		 		 // find data for event
		 		 		 var input = $(this).data('rating.input') || $( this.tagName=='INPUT' ? this : null );
   // focus handler, as requested by focusdigital.co.uk
		 		 		 if(control.focus) control.focus.apply(input[0], [input.val(), $('a', input.data('rating.star'))[0]]);
		 		 }, // $.fn.rating.focus
		 		 blur: function(){
		 		 		 var control = this.data('rating'); if(!control) return this;
		 		 		 if(!control.blur) return this; // quick fail if not required
		 		 		 // find data for event
		 		 		 var input = $(this).data('rating.input') || $( this.tagName=='INPUT' ? this : null );
   // blur handler, as requested by focusdigital.co.uk
		 		 		 if(control.blur) control.blur.apply(input[0], [input.val(), $('a', input.data('rating.star'))[0]]);
		 		 }, // $.fn.rating.blur
		 		 fill: function(){ // fill to the current mouse position.
		 		 		 var control = this.data('rating'); if(!control) return this;
		 		 		 // do not execute when control is in read-only mode
		 		 		 if(control.readOnly) return;
		 		 		 // Reset all stars and highlight them up to this element
		 		 		 this.rating('drain');
		 		 		 this.prevAll().andSelf().filter('.rater-'+ control.serial).addClass('star-rating-hover');
		 		 },// $.fn.rating.fill
		 		 drain: function() { // drain all the stars.
		 		 		 var control = this.data('rating'); if(!control) return this;
		 		 		 // do not execute when control is in read-only mode
		 		 		 if(control.readOnly) return;
		 		 		 // Reset all stars
		 		 		 control.rater.children().filter('.rater-'+ control.serial).removeClass('star-rating-on').removeClass('star-rating-hover');
		 		 },// $.fn.rating.drain
		 		 draw: function(){ // set value and stars to reflect current selection
		 		 		 var control = this.data('rating'); if(!control) return this;
		 		 		 // Clear all stars
		 		 		 this.rating('drain');
		 		 		 // Set control value
		 		 		 if(control.current){
		 		 		 		 control.current.data('rating.input').attr('checked','checked');
		 		 		 		 control.current.prevAll().andSelf().filter('.rater-'+ control.serial).addClass('star-rating-on');
		 		 		 }
		 		 		 else
		 		 		  $(control.inputs).removeAttr('checked');
		 		 		 // Show/hide 'cancel' button
		 		 		 control.cancel[control.readOnly || control.required?'hide':'show']();
		 		 		 // Add/remove read-only classes to remove hand pointer
		 		 		 this.siblings()[control.readOnly?'addClass':'removeClass']('star-rating-readonly');
		 		 },// $.fn.rating.draw
		 		 select: function(value){ // select a value
		 		 		 var control = this.data('rating'); if(!control) return this;
		 		 		 // do not execute when control is in read-only mode
		 		 		 if(control.readOnly) return;
		 		 		 // clear selection
		 		 		 control.current = null;
		 		 		 // programmatically (based on user input)
		 		 		 if(typeof value!='undefined'){
		 		 		  // select by index (0 based)
		 		 		 		 if(typeof value=='number')
 		 		 		  return $(control.stars[value]).rating('select');
		 		 		 		 // select by literal value (must be passed as a string
		 		 		 		 if(typeof value=='string')
		 		 		 		 		 //return
		 		 		 		 		 $.each(control.stars, function(){
		 		 		 		 		 		 if($(this).data('rating.input').val()==value) $(this).rating('select');
		 		 		 		 		 });
		 		 		 }
		 		 		 else
		 		 		 		 control.current = this[0].tagName=='INPUT' ?
		 		 		 		  this.data('rating.star') :
		 		 		 		 		 (this.is('.rater-'+ control.serial) ? this : null);
		 		 		 // Update rating control state
		 		 		 this.data('rating', control);
		 		 		 // Update display
		 		 		 this.rating('draw');
		 		 		 // find data for event
		 		 		 var input = $( control.current ? control.current.data('rating.input') : null );
		 		 		 // click callback, as requested here: http://plugins.jquery.com/node/1655
		 		 		 if(control.callback) control.callback.apply(input[0], [input.val(), $('a', control.current)[0]]);// callback event
		 		 },// $.fn.rating.select
		 		 readOnly: function(toggle, disable){ // make the control read-only (still submits value)
		 		 		 var control = this.data('rating'); if(!control) return this;
		 		 		 // setread-only status
		 		 		 control.readOnly = toggle || toggle==undefined ? true : false;
		 		 		 // enable/disable control value submission
		 		 		 if(disable) $(control.inputs).attr("disabled", "disabled");
		 		 		 else     		 		 		 $(control.inputs).removeAttr("disabled");
		 		 		 // Update rating control state
		 		 		 this.data('rating', control);
		 		 		 // Update display
		 		 		 this.rating('draw');
		 		 },// $.fn.rating.readOnly
		 		 disable: function(){ // make read-only and never submit value
		 		 		 this.rating('readOnly', true, true);
		 		 },// $.fn.rating.disable
		 		 enable: function(){ // make read/write and submit value
		 		 		 this.rating('readOnly', false, false);
		 		 }// $.fn.rating.select
 });
		 /*--------------------------------------------------------*/
		 /*
		 		 ### Default Settings ###
		 		 eg.: You can override default control like this:
		 		 $.fn.rating.options.cancel = 'Clear';
		 */
		 $.fn.rating.options = { //$.extend($.fn.rating, { options: {
		 		 		 cancel: '',   // advisory title for the 'cancel' link
		 		 		 cancelValue: '',           // value to submit when user click the 'cancel' link
		 		 		 split: 0,                  // split the star into how many parts?
		 		 		 required: true,
		 		 		 // Width of star image in case the plugin can't work it out. This can happen if
		 		 		 // the jQuery.dimensions plugin is not available OR the image is hidden at installation
		 		 		 starWidth: 12//,
		 		 		 //NB.: These don't need to be pre-defined (can be undefined/null) so let's save some code!
		 		 		 //half:     false,         // just a shortcut to control.split = 2
		 		 		 //required: false,         // disables the 'cancel' button so user can only select one of the specified values
		 		 		 //readOnly: false,         // disable rating plugin interaction/ values cannot be changed
		 		 		 //focus:    function(){},  // executed when stars are focused
		 		 		 //blur:     function(){},  // executed when stars are focused
		 		 		 //callback: function(){},  // executed when a star is clicked
 }; //} });
		 /*--------------------------------------------------------*/
		 /*
		 		 ### Default implementation ###
		 		 The plugin will attach itself to file inputs
		 		 with the class 'multi' when the page loads
		 */
		 $(function(){
		  $('input[type=radio].star').rating();
		 });
/*# AVOID COLLISIONS #*/
})(jQuery);
/*# AVOID COLLISIONS #*/
$(document).ready(function()
	{
		var iFrames = document.getElementsByTagName('iframe');
		function iResize()
		{
			for (var i = 0, j = iFrames.length; i < j; i++)
			{
				iFrames[i].style.height = iFrames[i].contentWindow.document.body.offsetHeight + 'px';
			}
		}
		if ($.browser.safari || $.browser.opera)
		{
			$('iframe').load(function()
				{
					setTimeout(iResize, 0);
				}
			);
			for (var i = 0, j = iFrames.length; i < j; i++)
			{
				var iSource = iFrames[i].src;
				iFrames[i].src = '';
				iFrames[i].src = iSource;
			}
		}
		else
		{
			$('iframe').load(function()
				{
					this.style.height = this.contentWindow.document.body.offsetHeight + 'px';
				}
			);
		}
	}
);
jQuery(document).ready(function(){
// Vise og skjule spørsmål
	$('#question_list .answer').hide();
	$('#question_list h3').click(function() {
		var $nextDiv = $(this).next();
		var $visibleSiblings = $nextDiv.siblings('div.answer:visible');
		if ($visibleSiblings.length ) {
			$visibleSiblings.slideUp('fast', function() {
				$nextDiv.slideToggle('fast');
			});
		} else {
			$nextDiv.slideToggle('fast');
		}
	});
// Legge på hover-klasse på spørsmål
	$('#question_list h3').hover(function() {
		$(this).addClass('hover');
	}, function() {
		$(this).removeClass('hover');
	});
// vise les-kommentar-feltet når 'vis kommentarer klikkes'
	var lesKommentarToggled=false;
	$('div.comments').hide();
	$('div.read_comments').click(function(){
		if(lesKommentarToggled==false){
			$(this).children().text('Skjul kommentarer');
			lesKommentarToggled=true;
		}
		else{
			$(this).children().text('Vis kommentarer');
			lesKommentarToggled=false;
		}
		$(this).siblings('div.comments:first').slideToggle(400);
		$(this).siblings('div.make_comment:first').slideUp(400);
		$(this).next().children().text('Skriv kommentar');
		skrivKommentarToggled=false;
		return false;
	});
// vise skrive-kommentar-feltet når 'skriv kommentarer klikkes'
	var skrivKommentarToggled=false;
	$('div.make_comment').hide();
	$('div.write_comment').click(function(){
		if(skrivKommentarToggled==false){
			$(this).children().text('Avbryt skrive kommentar');
			skrivKommentarToggled=true;
		}
		else{
			$(this).children().text('Skriv kommentar');
			skrivKommentarToggled=false;
		}
		$(this).siblings('div.make_comment:first').slideToggle(400);
		$(this).siblings('div.comments:first').slideUp(400);
		$(this).prev().children().text('Vis kommentarer');
		lesKommentarToggled=false;
		return false;
	});
// Åpne riktig spørsmål fra URL - takk til reidarwiki.com
var openQuestion = $.getURLParam("q");
$("h3[id='" + openQuestion + "'] + div").show();
// slider
	$('#loopedSlider').loopedSlider({
});
// Tabs
 jQuery(".tab:not(:first)").hide();
 jQuery(".tab:first").show();
 jQuery(".htabs a").click(function(){
   jQuery(".htabs a").removeClass('active');
   jQuery(this).addClass('active');
   stringref = jQuery(this).attr("href").split('#')[1];
   jQuery('.tab:not(#'+stringref+')').hide();
   if (jQuery.browser.msie && jQuery.browser.version.substr(0,3) == "6.0") {
     jQuery('.tab#' + stringref).show();
   }
   else
     jQuery('.tab#' + stringref).show();
   return false;
 });
// Tooltips
	jQuery('#faqCategories a').tooltip({
		track: true,
		delay: 0,
		showURL: false,
		showBody: "-",
		fade: 200,
		left: 25,
		top: -6
	});
// Vise "takk" etter submittet spørsmål
$('#submit_question').click(function() {
  $('<div class="right clear thankyou"><h4>Takk for ditt sp&oslash;rsm&aring;l!</h4>Du vil f&aring; svar f&oslash;r du aner det!</div>')
  .insertAfter( $(this).parent().parent() )
  .slideDown('slow')
  .animate({opacity: 1.0}, 4000)
  .slideUp('slow', function() {
   $(this).remove();
  });
	return false;
});
// slideToggle still et spørsmål
	$("#askQuestionForm").hide();
		$("#askQuestionFormToggle").click(function() {
		$(this).parent().toggleClass("cleanBox");
		$("#askQuestionForm").slideToggle("400");
		return false;
	});
// clear søkeboks på fokus
	$("#searchinput").focus(function() {
		if( this.value == this.defaultValue ) {
			this.value = "";
		}
	}).blur(function() {
		if( !this.value.length ) {
			this.value = this.defaultValue;
		}
	});
// init beskjeder
$('#message1').jqm();
$('#message2').jqm();
$('#message3').jqm();
$('#message4').jqm();
$('#message5').jqm();
// Åpne beskjeder
if ($.getURLParam("m")=="1") {
	$('#message1').jqmShow();
}

if ($.getURLParam("m")=="2") {
	$('#message2').jqmShow();
}
if ($.getURLParam("m")=="3") {
	$('#message3').jqmShow();
}
if ($.getURLParam("m")=="4") {
	$('#message4').jqmShow();
}
if ($.getURLParam("m")=="5") {
	$('#message5').jqmShow();
}
// set source i iframe til pensjonskalkulatorer, slik at den lastes til slutt
$("#pensjonskalkulatorIframe").attr("src","http://www.storebrand.no/site/interaktiv.nsf/pensjonskalkulator_utvidet293?readForm");
// set source i ifram til pensjonsordboken ved klikk på tilhørende tab
$("#ordboktab").click(function () {
	$("#pensjonsordboken iframe").attr("src","/site/pensjonsskolen.nsf/Ordlisten?OpenView&#ob");
});

// slideToggle calc hva betyr reformen
//	$("#hiddenCalc").hide();
	$("#open_pensjonssreform_calc").click(function() {
		$(this).toggleClass("open");
		$("#hiddenCalc").slideToggle("400");
		return false;
	});
  });
});

