/**
* @author Remy Sharp
* @url http://remysharp.com/2007/01/25/jquery-tutorial-text-box-hints/
*/

(function ($) {

$.fn.hint = function (blurClass) {
  if (!blurClass) { 
    blurClass = 'blur';
  }
    
  return this.each(function () {
    // get jQuery version of 'this'
    var $input = $(this),
    
    // capture the rest of the variable to allow for reuse
      title = $input.attr('title'),
      $form = $(this.form),
      $win = $(window);

    function remove() {
      if ($input.val() === title && $input.hasClass(blurClass)) {
        $input.val('').removeClass(blurClass);
      }
    }

    // only apply logic if the element has the attribute
    if (title) { 
      // on blur, set value to title attr if text is blank
      $input.blur(function () {
        if (this.value === '') {
          $input.val(title).addClass(blurClass);
        }
      }).focus(remove).blur(); // now change all inputs to title
      
      // clear the pre-defined text when form is submitted
      $form.submit(remove);
      $win.unload(remove); // handles Firefox's autocomplete
    }
  });
};

})(jQuery);

/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
 * Licensed under the MIT License (LICENSE.txt).
 *
 * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
 * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
 * Thanks to: Seamus Leahy for adding deltaX and deltaY
 *
 * Version: 3.0.4
 * 
 * Requires: 1.2.2+
 */

(function($) {

var types = ['DOMMouseScroll', 'mousewheel'];

$.event.special.mousewheel = {
    setup: function() {
        if ( this.addEventListener ) {
            for ( var i=types.length; i; ) {
                this.addEventListener( types[--i], handler, false );
            }
        } else {
            this.onmousewheel = handler;
        }
    },
    
    teardown: function() {
        if ( this.removeEventListener ) {
            for ( var i=types.length; i; ) {
                this.removeEventListener( types[--i], handler, false );
            }
        } else {
            this.onmousewheel = null;
        }
    }
};

$.fn.extend({
    mousewheel: function(fn) {
        return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
    },
    
    unmousewheel: function(fn) {
        return this.unbind("mousewheel", fn);
    }
});


function handler(event) {
    var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0;
    event = $.event.fix(orgEvent);
    event.type = "mousewheel";
    
    // Old school scrollwheel delta
    if ( event.wheelDelta ) { delta = event.wheelDelta/120; }
    if ( event.detail     ) { delta = -event.detail/3; }
    
    // New school multidimensional scroll (touchpads) deltas
    deltaY = delta;
    
    // Gecko
    if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
        deltaY = 0;
        deltaX = -1*delta;
    }
    
    // Webkit
    if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; }
    if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; }
    
    // Add event and delta to the front of the arguments
    args.unshift(event, delta, deltaX, deltaY);
    
    return $.event.handle.apply(this, args);
}

})(jQuery);

/*
 * jScrollPane - v2.0.0beta6 - 2010-10-28
 * http://jscrollpane.kelvinluck.com/
 *
 * Copyright (c) 2010 Kelvin Luck
 * Dual licensed under the MIT and GPL licenses.
 */
(function(b,a,c){b.fn.jScrollPane=function(f){function d(C,L){var au,N=this,V,ah,v,aj,Q,W,y,q,av,aB,ap,i,H,h,j,X,R,al,U,t,A,am,ac,ak,F,l,ao,at,x,aq,aE,g,aA,ag=true,M=true,aD=false,k=false,Z=b.fn.mwheelIntent?"mwheelIntent.jsp":"mousewheel.jsp";aE=C.css("paddingTop")+" "+C.css("paddingRight")+" "+C.css("paddingBottom")+" "+C.css("paddingLeft");g=(parseInt(C.css("paddingLeft"))||0)+(parseInt(C.css("paddingRight"))||0);an(L);function an(aH){var aL,aK,aJ,aG,aF,aI;au=aH;if(V==c){C.css({overflow:"hidden",padding:0});ah=C.innerWidth()+g;v=C.innerHeight();C.width(ah);V=b('<div class="jspPane" />').wrap(b('<div class="jspContainer" />').css({width:ah+"px",height:v+"px"}));C.wrapInner(V.parent());aj=C.find(">.jspContainer");V=aj.find(">.jspPane");V.css("padding",aE)}else{C.css("width","");aI=C.outerWidth()+g!=ah||C.outerHeight()!=v;if(aI){ah=C.innerWidth()+g;v=C.innerHeight();aj.css({width:ah+"px",height:v+"px"})}aA=V.innerWidth();if(!aI&&V.outerWidth()==Q&&V.outerHeight()==W){if(aB||av){V.css("width",aA+"px");C.css("width",(aA+g)+"px")}return}V.css("width","");C.css("width",(ah)+"px");aj.find(">.jspVerticalBar,>.jspHorizontalBar").remove().end()}aL=V.clone().css("position","absolute");aK=b('<div style="width:1px; position: relative;" />').append(aL);b("body").append(aK);Q=Math.max(V.outerWidth(),aL.outerWidth());aK.remove();W=V.outerHeight();y=Q/ah;q=W/v;av=q>1;aB=y>1;if(!(aB||av)){C.removeClass("jspScrollable");V.css({top:0,width:aj.width()-g});n();D();O();w();af()}else{C.addClass("jspScrollable");aJ=au.maintainPosition&&(H||X);if(aJ){aG=ay();aF=aw()}aC();z();E();if(aJ){K(aG);J(aF)}I();ad();if(au.enableKeyboardNavigation){P()}if(au.clickOnTrack){p()}B();if(au.hijackInternalLinks){m()}}if(au.autoReinitialise&&!aq){aq=setInterval(function(){an(au)},au.autoReinitialiseDelay)}else{if(!au.autoReinitialise&&aq){clearInterval(aq)}}C.trigger("jsp-initialised",[aB||av])}function aC(){if(av){aj.append(b('<div class="jspVerticalBar" />').append(b('<div class="jspCap jspCapTop" />'),b('<div class="jspTrack" />').append(b('<div class="jspDrag" />').append(b('<div class="jspDragTop" />'),b('<div class="jspDragBottom" />'))),b('<div class="jspCap jspCapBottom" />')));R=aj.find(">.jspVerticalBar");al=R.find(">.jspTrack");ap=al.find(">.jspDrag");if(au.showArrows){am=b('<a class="jspArrow jspArrowUp" />').bind("mousedown.jsp",az(0,-1)).bind("click.jsp",ax);ac=b('<a class="jspArrow jspArrowDown" />').bind("mousedown.jsp",az(0,1)).bind("click.jsp",ax);if(au.arrowScrollOnHover){am.bind("mouseover.jsp",az(0,-1,am));ac.bind("mouseover.jsp",az(0,1,ac))}ai(al,au.verticalArrowPositions,am,ac)}t=v;aj.find(">.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow").each(function(){t-=b(this).outerHeight()});ap.hover(function(){ap.addClass("jspHover")},function(){ap.removeClass("jspHover")}).bind("mousedown.jsp",function(aF){b("html").bind("dragstart.jsp selectstart.jsp",function(){return false});ap.addClass("jspActive");var s=aF.pageY-ap.position().top;b("html").bind("mousemove.jsp",function(aG){S(aG.pageY-s,false)}).bind("mouseup.jsp mouseleave.jsp",ar);return false});o()}}function o(){al.height(t+"px");H=0;U=au.verticalGutter+al.outerWidth();V.width(ah-U-g);if(R.position().left==0){V.css("margin-left",U+"px")}}function z(){if(aB){aj.append(b('<div class="jspHorizontalBar" />').append(b('<div class="jspCap jspCapLeft" />'),b('<div class="jspTrack" />').append(b('<div class="jspDrag" />').append(b('<div class="jspDragLeft" />'),b('<div class="jspDragRight" />'))),b('<div class="jspCap jspCapRight" />')));ak=aj.find(">.jspHorizontalBar");F=ak.find(">.jspTrack");h=F.find(">.jspDrag");if(au.showArrows){at=b('<a class="jspArrow jspArrowLeft" />').bind("mousedown.jsp",az(-1,0)).bind("click.jsp",ax);x=b('<a class="jspArrow jspArrowRight" />').bind("mousedown.jsp",az(1,0)).bind("click.jsp",ax);if(au.arrowScrollOnHover){at.bind("mouseover.jsp",az(-1,0,at));
x.bind("mouseover.jsp",az(1,0,x))}ai(F,au.horizontalArrowPositions,at,x)}h.hover(function(){h.addClass("jspHover")},function(){h.removeClass("jspHover")}).bind("mousedown.jsp",function(aF){b("html").bind("dragstart.jsp selectstart.jsp",function(){return false});h.addClass("jspActive");var s=aF.pageX-h.position().left;b("html").bind("mousemove.jsp",function(aG){T(aG.pageX-s,false)}).bind("mouseup.jsp mouseleave.jsp",ar);return false});l=aj.innerWidth();ae()}else{}}function ae(){aj.find(">.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow").each(function(){l-=b(this).outerWidth()});F.width(l+"px");X=0}function E(){if(aB&&av){var aF=F.outerHeight(),s=al.outerWidth();t-=aF;b(ak).find(">.jspCap:visible,>.jspArrow").each(function(){l+=b(this).outerWidth()});l-=s;v-=s;ah-=aF;F.parent().append(b('<div class="jspCorner" />').css("width",aF+"px"));o();ae()}if(aB){V.width((aj.outerWidth()-g)+"px")}W=V.outerHeight();q=W/v;if(aB){ao=1/y*l;if(ao>au.horizontalDragMaxWidth){ao=au.horizontalDragMaxWidth}else{if(ao<au.horizontalDragMinWidth){ao=au.horizontalDragMinWidth}}h.width(ao+"px");j=l-ao;ab(X)}if(av){A=1/q*t;if(A>au.verticalDragMaxHeight){A=au.verticalDragMaxHeight}else{if(A<au.verticalDragMinHeight){A=au.verticalDragMinHeight}}ap.height(A+"px");i=t-A;aa(H)}}function ai(aG,aI,aF,s){var aK="before",aH="after",aJ;if(aI=="os"){aI=/Mac/.test(navigator.platform)?"after":"split"}if(aI==aK){aH=aI}else{if(aI==aH){aK=aI;aJ=aF;aF=s;s=aJ}}aG[aK](aF)[aH](s)}function az(aF,s,aG){return function(){G(aF,s,this,aG);this.blur();return false}}function G(aH,aF,aK,aJ){aK=b(aK).addClass("jspActive");var aI,s=function(){if(aH!=0){T(X+aH*au.arrowButtonSpeed,false)}if(aF!=0){S(H+aF*au.arrowButtonSpeed,false)}},aG=setInterval(s,au.arrowRepeatFreq);s();aI=aJ==c?"mouseup.jsp":"mouseout.jsp";aJ=aJ||b("html");aJ.bind(aI,function(){aK.removeClass("jspActive");clearInterval(aG);aJ.unbind(aI)})}function p(){w();if(av){al.bind("mousedown.jsp",function(aH){if(aH.originalTarget==c||aH.originalTarget==aH.currentTarget){var aG=b(this),s=setInterval(function(){var aI=aG.offset(),aJ=aH.pageY-aI.top;if(H+A<aJ){S(H+au.trackClickSpeed)}else{if(aJ<H){S(H-au.trackClickSpeed)}else{aF()}}},au.trackClickRepeatFreq),aF=function(){s&&clearInterval(s);s=null;b(document).unbind("mouseup.jsp",aF)};b(document).bind("mouseup.jsp",aF);return false}})}if(aB){F.bind("mousedown.jsp",function(aH){if(aH.originalTarget==c||aH.originalTarget==aH.currentTarget){var aG=b(this),s=setInterval(function(){var aI=aG.offset(),aJ=aH.pageX-aI.left;if(X+ao<aJ){T(X+au.trackClickSpeed)}else{if(aJ<X){T(X-au.trackClickSpeed)}else{aF()}}},au.trackClickRepeatFreq),aF=function(){s&&clearInterval(s);s=null;b(document).unbind("mouseup.jsp",aF)};b(document).bind("mouseup.jsp",aF);return false}})}}function w(){F&&F.unbind("mousedown.jsp");al&&al.unbind("mousedown.jsp")}function ar(){b("html").unbind("dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp");ap&&ap.removeClass("jspActive");h&&h.removeClass("jspActive")}function S(s,aF){if(!av){return}if(s<0){s=0}else{if(s>i){s=i}}if(aF==c){aF=au.animateScroll}if(aF){N.animate(ap,"top",s,aa)}else{ap.css("top",s);aa(s)}}function aa(aF){if(aF==c){aF=ap.position().top}aj.scrollTop(0);H=aF;var aI=H==0,aG=H==i,aH=aF/i,s=-aH*(W-v);if(ag!=aI||aD!=aG){ag=aI;aD=aG;C.trigger("jsp-arrow-change",[ag,aD,M,k])}u(aI,aG);V.css("top",s);C.trigger("jsp-scroll-y",[-s,aI,aG])}function T(aF,s){if(!aB){return}if(aF<0){aF=0}else{if(aF>j){aF=j}}if(s==c){s=au.animateScroll}if(s){N.animate(h,"left",aF,ab)}else{h.css("left",aF);ab(aF)}}function ab(aF){if(aF==c){aF=h.position().left}aj.scrollTop(0);X=aF;var aI=X==0,aH=X==j,aG=aF/j,s=-aG*(Q-ah);if(M!=aI||k!=aH){M=aI;k=aH;C.trigger("jsp-arrow-change",[ag,aD,M,k])}r(aI,aH);V.css("left",s);C.trigger("jsp-scroll-x",[-s,aI,aH])}function u(aF,s){if(au.showArrows){am[aF?"addClass":"removeClass"]("jspDisabled");ac[s?"addClass":"removeClass"]("jspDisabled")}}function r(aF,s){if(au.showArrows){at[aF?"addClass":"removeClass"]("jspDisabled");
x[s?"addClass":"removeClass"]("jspDisabled")}}function J(s,aF){var aG=s/(W-v);S(aG*i,aF)}function K(aF,s){var aG=aF/(Q-ah);T(aG*j,s)}function Y(aR,aM,aG){var aK,aH,aI,s=0,aQ=0,aF,aL,aO,aN,aP;try{aK=b(aR)}catch(aJ){return}aH=aK.outerHeight();aI=aK.outerWidth();aj.scrollTop(0);aj.scrollLeft(0);while(!aK.is(".jspPane")){s+=aK.position().top;aQ+=aK.position().left;aK=aK.offsetParent();if(/^body|html$/i.test(aK[0].nodeName)){return}}aF=aw();aL=aF+v;if(s<aF||aM){aN=s-au.verticalGutter}else{if(s+aH>aL){aN=s-v+aH+au.verticalGutter}}if(aN){J(aN,aG)}viewportLeft=ay();aO=viewportLeft+ah;if(aQ<viewportLeft||aM){aP=aQ-au.horizontalGutter}else{if(aQ+aI>aO){aP=aQ-ah+aI+au.horizontalGutter}}if(aP){K(aP,aG)}}function ay(){return -V.position().left}function aw(){return -V.position().top}function ad(){aj.unbind(Z).bind(Z,function(aI,aJ,aH,aF){var aG=X,s=H;T(X+aH*au.mouseWheelSpeed,false);S(H-aF*au.mouseWheelSpeed,false);return aG==X&&s==H})}function n(){aj.unbind(Z)}function ax(){return false}function I(){V.unbind("focusin.jsp").bind("focusin.jsp",function(s){if(s.target===V[0]){return}Y(s.target,false)})}function D(){V.unbind("focusin.jsp")}function P(){var aF,s;C.attr("tabindex",0).unbind("keydown.jsp").bind("keydown.jsp",function(aJ){if(aJ.target!==C[0]){return}var aH=X,aG=H,aI=aF?2:16;switch(aJ.keyCode){case 40:S(H+aI,false);break;case 38:S(H-aI,false);break;case 34:case 32:J(aw()+Math.max(32,v)-16);break;case 33:J(aw()-v+16);break;case 35:J(W-v);break;case 36:J(0);break;case 39:T(X+aI,false);break;case 37:T(X-aI,false);break}if(!(aH==X&&aG==H)){aF=true;clearTimeout(s);s=setTimeout(function(){aF=false},260);return false}});if(au.hideFocus){C.css("outline","none");if("hideFocus" in aj[0]){C.attr("hideFocus",true)}}else{C.css("outline","");if("hideFocus" in aj[0]){C.attr("hideFocus",false)}}}function O(){C.attr("tabindex","-1").removeAttr("tabindex").unbind("keydown.jsp")}function B(){if(location.hash&&location.hash.length>1){var aG,aF;try{aG=b(location.hash)}catch(s){return}if(aG.length&&V.find(aG)){if(aj.scrollTop()==0){aF=setInterval(function(){if(aj.scrollTop()>0){Y(location.hash,true);b(document).scrollTop(aj.position().top);clearInterval(aF)}},50)}else{Y(location.hash,true);b(document).scrollTop(aj.position().top)}}}}function af(){b("a.jspHijack").unbind("click.jsp-hijack").removeClass("jspHijack")}function m(){af();b("a[href^=#]").addClass("jspHijack").bind("click.jsp-hijack",function(){var s=this.href.split("#"),aF;if(s.length>1){aF=s[1];if(aF.length>0&&V.find("#"+aF).length>0){Y("#"+aF,true);return false}}})}b.extend(N,{reinitialise:function(aF){aF=b.extend({},aF,au);an(aF)},scrollToElement:function(aG,aF,s){Y(aG,aF,s)},scrollTo:function(aG,s,aF){K(aG,aF);J(s,aF)},scrollToX:function(aF,s){K(aF,s)},scrollToY:function(s,aF){J(s,aF)},scrollBy:function(aF,s,aG){N.scrollByX(aF,aG);N.scrollByY(s,aG)},scrollByX:function(s,aG){var aF=ay()+s,aH=aF/(Q-ah);T(aH*j,aG)},scrollByY:function(s,aG){var aF=aw()+s,aH=aF/(W-v);S(aH*i,aG)},animate:function(aF,aI,s,aH){var aG={};aG[aI]=s;aF.animate(aG,{duration:au.animateDuration,ease:au.animateEase,queue:false,step:aH})},getContentPositionX:function(){return ay()},getContentPositionY:function(){return aw()},getIsScrollableH:function(){return aB},getIsScrollableV:function(){return av},getContentPane:function(){return V},scrollToBottom:function(s){S(i,s)},hijackInternalLinks:function(){m()}})}f=b.extend({},b.fn.jScrollPane.defaults,f);var e;this.each(function(){var g=b(this),h=g.data("jsp");if(h){h.reinitialise(f)}else{h=new d(g,f);g.data("jsp",h)}e=e?e.add(g):g});return e};b.fn.jScrollPane.defaults={showArrows:false,maintainPosition:true,clickOnTrack:true,autoReinitialise:false,autoReinitialiseDelay:500,verticalDragMinHeight:0,verticalDragMaxHeight:99999,horizontalDragMinWidth:0,horizontalDragMaxWidth:99999,animateScroll:false,animateDuration:300,animateEase:"linear",hijackInternalLinks:false,verticalGutter:4,horizontalGutter:4,mouseWheelSpeed:10,arrowButtonSpeed:10,arrowRepeatFreq:100,arrowScrollOnHover:false,trackClickSpeed:30,trackClickRepeatFreq:100,verticalArrowPositions:"split",horizontalArrowPositions:"split",enableKeyboardNavigation:true,hideFocus:false}
})(jQuery,this);

var DEBUG = true;
$(document).ready(
    function()
    {

	$(".searchPageBox").keypress(function(event) {
		if (event.which == '13') {
			event.preventDefault();
		}
	});
	function playButtonPosition() {
		var videoImgW 		= null;
		var videoImgH 		= null;
		var videoBigImage	= $('img.videoBigImage');
			
		if ($('img.videoBigImage')[0]) {
			videoImgW = videoBigImage.width();
			videoImgH = videoBigImage.height();
			
			// If either video height or width is not set check innerWidth and outerWidth
			// innerWidth and outerWidth are different if they have padding, but in this case they are the same
			if (videoImgH == undefined || videoImgW == undefined) {
				videoImgW = videoBigImage.innerWidth();
				videoImgH = videoBigImage.innerHeight();
			}
			if (videoImgH == undefined || videoImgW == undefined) {
				videoImgW = videoBigImage.outerWidth();
				videoImgH = videoBigImage.outerHeight();
			} 
			$('.videoBigImageHelper').css({"left": videoImgW/2 - 30, "top": videoImgH/2 - 30});
			if (videoImgW != 0 && videoImgH !=0 ) {
				$('.videoBigImageHelper').css({"marginTop": 0, "marginLeft":0});
			}
		}
	}	
  try
        {
        
         $('table.docListing tr td, table.calendarList tr td, table.lovFilter tr td, table.telbogTable tr td').hover(
          function() {
             $(this).addClass('hover');
          }, function() {
             $(this).removeClass('hover');
          }
       );

			if ($("input[type=file]")[0]) {
				$("input[type=file]").filestyle({ 
					image: "../images/btnSog.gif",
					imageheight : 23,
					imagewidth : 23,
					width : 200
				});
			}
			
			$('.partiComp').hover(
	            function() {
		            $(this).css({"background-color":"#f2daba"});
	            },
	            function() {
		            $(this).removeAttr('style');
	            }
	        );
			
			/*$('.frontColumn ul.leftMenu2 li').hover(
			  function () {
				$('.frontColumn ul.leftMenu2 li ul').toggle();
			  }, 
			  function () {
				$('.frontColumn ul.leftMenu2 li ul').toggle();
			  }
			);*/
			
			$(".frontColumn ul.leftMenu2 li:has(ul)").hover(function(){
				var ul = $(this).children("ul");   
				
				if(ul.is(":animated")){
					ul.stop()
					   .css("height", "auto")
					   //.slideDown("normal")
					   ;
				}
				else{
					ul.css("display", "none");
					ul.css("display", "block");
					}},
			function(){
				var ul = $(this).children("ul"); 
				
				if(ul.is(":animated")){
				  ul.stop()
					.css("height", "auto")
					.css("display", "none");
				}
				else{
				 ul.css("display", "none");
				}
			   
			});
			
			if($('input')[0]){
				$('input').hint();
			}					
			

			if($('#videoTabs')[0]){
				$('#videoTabs').tabs();
			}
			
            $('.tabLov').bind('click', function(){
				var t=setTimeout("columnLeftFix();",200)

			});
						
			
			$('#expander').click(function(){
				var $r2 = $('#r2').parent();
				var $r1 = $('#r1').parent();
				
				if ($r1.is('.twoColumns')) {
					$r2.hide();
					$r1.removeClass('twoColumns').addClass('fourColumns');
					columnLeftFix ();
				} else {
					$r2.show();
					$r1.removeClass('fourColumns').addClass('twoColumns');
					columnLeftFix ();
				}
				
				
			});
			
			
			
					
			/* 5 Boxes equalheight */
			if ($('#page .rightBox')[0]){
				$('#page .campVertical .rightBox:eq(0), #page .campVertical .rightBox:eq(1), #page .campVertical .rightBox:eq(2), #page .campVertical .rightBox:eq(3)').equalHeight();
				$('#page .campVertical .rightBox:eq(4), #page .campVertical .rightBox:eq(5), #page .campVertical .rightBox:eq(6), #page .campVertical .rightBox:eq(7)').equalHeight();
				$('#page .campVertical .rightBox:eq(8), #page .campVertical .rightBox:eq(9), #page .campVertical .rightBox:eq(10), #page .campVertical .rightBox:eq(11)').equalHeight();
				$('#page .campVerticalFive .rightBox:eq(0), #page .campVerticalFive .rightBox:eq(1), #page .campVerticalFive .rightBox:eq(2), #page .campVerticalFive .rightBox:eq(3), #page .campVerticalFive .rightBox:eq(4)').equalHeight();
				$('#page .campVerticalFive .rightBox:eq(5), #page .campVerticalFive .rightBox:eq(6), #page .campVerticalFive .rightBox:eq(7), #page .campVerticalFive .rightBox:eq(8), #page .campVerticalFive .rightBox:eq(9)').equalHeight();
				$('#page .campVerticalFive .rightBox:eq(10), #page .campVerticalFive .rightBox:eq(11), #page .campVerticalFive .rightBox:eq(12), #page .campVerticalFive .rightBox:eq(13), #page .campVerticalFive .rightBox:eq(14)').equalHeight();	
			}
			
			var upPage = $('div#generel.subpage #page, #undervisningRightFlash').height();
			$('#undervisningRightFlash').css({"height": upPage + 125})
			
			//DAB remove dots in ULs in content editor
			
			if ($('.contentEditor ul li a')[0]){
				$('.contentEditor ul li a').parents('ul').css({ "padding-left":"0px","list-style-type":"none"});
			}
			
			// Teaser carousel
			$('.teaserDemokrati').addClass('teaser_1');
			$('.teaserNavigation a').click(function(){
				
				var nav_id = $(this).attr('class')
				var currentPos = $('.teaserNavigation span.position').html()
				var total = $('.teaserNavigation span.total').html()
				if(nav_id == 'prevTeaser') {
					var nextPos = parseInt(currentPos) - 1;	
				} else{
					var nextPos = parseInt(currentPos) + 1;
				}
				if(nextPos > total) nextPos = 1;
				if(nextPos < 1) nextPos = total;
				//Change holder ID to theme specific (Only FP)
				
				var newID = $('.teaser1').eq(nextPos - 1).attr("id").substring(2,5);
				var oldID = $('.teaser1').eq(currentPos - 1).attr("id").substring(2,5);

				document.getElementById(oldID).id = newID;
				//$('.topBannerCarousel').attr('id',newID); //fails on IE using DOM instead
				//document.getElementById("Akt").id = newID;
				
                //$('.topBannerCarousel').id = "Fol";
                $('.teaser1').eq(currentPos - 1).hide();
				$('.teaser1').eq(nextPos - 1).fadeIn('fast');
				
				$('.teaserNavigation span.position').html(nextPos);
			});
			
						
			//$('#master').css({'min-width': '84em', 'max-width': '105em'})
			$("div.miniNav ul.smallNav li a").hover(
	            function() {
		            var thelink = $(this);		        
		            $('.iconTipTop').html(thelink.html());
	            },
	            function() {
		            var thelink = $(this);
		            $('.iconTipTop').html('');
	            }
	        );
			
	        $("div.subpageFooter ul.smallNav li a").hover(
	            function() 
	                {
		            var thelink = $(this);		    
		            $('.iconTipBottom').html(thelink.html());
	                },
	            function() {
		            var thelink = $(this);
		            $('.iconTipBottom').html('');
	            }
	        );

			// submenu bgiframe for ie6
			if($('ul.leftMenu2 li ul')[0]){
				$('ul.leftMenu2 li ul').bgiframe();
			}
			
			// front page columns height
			if($('.column0, .column1, .column2, .column3, .column4')[0]){
				$('.column0, .column1, .column2, .column3, .column4').equalHeight();
			}
			
			//
			/*
			var sceneSTD = {
				src: '/flash/sceneSTD.swf',
				ratios: [8, 1.42, 11, 1.38, 17, 1.32, 21, 1.3, 22, 1.29, 30, 1.28, 35, 1.27, 51, 1.26, 75, 1.25, 76, 1.24, 77, 1.25, 78, 1.24, 80, 1.25, 82, 1.24, 83, 1.25, 86, 1.24, 87, 1.25, 1.24]
			};
	
			sIFR.activate(sceneSTD);

			sIFR.replace(sceneSTD, {
				selector: '#front .frontColumn .column1 h1',
				css: {
					'.sIFR-root' : { 'color' : '#005259', 'background-color' : '#e0edef', 'leading' : '-2', 'letter-spacing' : '1', 'font-size' : '19px' }
				}
			});
			sIFR.replace(sceneSTD, {
				selector: '#front .frontColumn .column2 h1',
				css: {
					'.sIFR-root' : { 'color' : '#5a5935', 'background-color' : '#f5f5e0', 'leading' : '-2', 'letter-spacing' : '1', 'font-size' : '19px' }
				}
			});
			sIFR.replace(sceneSTD, {
				selector: '#front .frontColumn .column3 h1',
				css: {
					'.sIFR-root' : { 'color' : '#5d6264', 'background-color' : '#f1f2f3', 'leading' : '-2', 'letter-spacing' : '1', 'font-size' : '19px' }
				}
			});
			sIFR.replace(sceneSTD, {
				selector: '#front .frontColumn .column4 h1',
				css: {
					'.sIFR-root' : { 'color' : '#874c00', 'background-color' : '#faf0e3', 'leading' : '-2', 'letter-spacing' : '1', 'font-size' : '19px' }
				},
				onReplacement : function() {
					// front page columns height - moved here by LAN beacause sifr loads last
				}
			});

*/

			
			
			
			
			
			// Forum
//			 $('td').children('.liner a').click(
//	            function() {
//					$(this).parent().children('ul.replyes').toggle();
//					$('.columnLeft').removeAttr('style');
//					columnLeftFix();
//				}
//			); 
			
			// page 25
			var firstheight = $('#firstCol').height();
			var secondheight = $('#secondCol').height();
			var firstsmall = firstheight - 83;
			var secondsmall = secondheight + 83;
			if (firstheight > secondsmall){
				$('#secondCol').css({'min-height':firstsmall})
			}
			if (firstheight < secondsmall){
				$('#firstCol').css({'min-height':secondsmall})
			}
        	//end 25
			
			// page 4
			var a1height = $('#a1').height();
			var a2height = $('#a2').height();
			var a3height = $('#a3').height();
			var a4height = $('#a4').height();
			var a5height = $('#a5').height();
			
			
			var a4h2height = $('#a4 h2').height();
			var a5h2height = $('#a5 h2').height();
			var a4contentheight = $('#a4 .boxContent').height();
			var a5contentheight = $('#a5 .boxContent').height();
			
			var acol = a1height + a2height + 14;
			if (a4height >= a5height) {
				var bcol = a3height + a4height + 14;
			}
			if (a4height < a5height) {
				var bcol = a3height + a5height + 14;
			}
			var acolnew = bcol - a1height - 14;
			var bcolnew = acol - a3height - 96;
			if (acol < bcol){
				$('#a2 .boxColumn').css({'height':acolnew - 38});
				if ($('#a4 img')[0] && $('#a5 img')[0]) {
					$('#a4 .boxContent, #a5 .boxContent').equalHeight();
				}
				
				else if (!$('#a4 img')[0] && !$('#a5 img')[0]) {
					$('#a4 .boxContent, #a5 .boxContent').equalHeight();
				}
				else if ($('#a4 img')[0] && !$('#a5 img')[0]) {
					$('#a5 .boxContent').css({'height': a4height - a5h2height - 20});
				}
				
				else if (!$('#a4 img')[0] && $('#a5 img')[0]) {
					$('#a4 .boxContent').css({'height': a5height - a4h2height - 20});
				}
				$('.boxColumn div.rss').css({"bottom": 0});
			}
			if (acol >= bcol){
				if ($('#a4 img')[0] && $('#a5 img')[0]) {
					$('#a4 .boxContent').css({'height':bcolnew - a4h2height - 22});
					$('#a5 .boxContent').css({'height':bcolnew - a5h2height - 22});
				}
				
				else if (!$('#a4 img')[0] && !$('#a5 img')[0]) {					
					$('#a4 .boxContent').css({'height':bcolnew - a4h2height + 62 });
					$('#a5 .boxContent').css({'height':bcolnew - a5h2height + 62 }); 
				}
				else if ($('#a4 img')[0] && !$('#a5 img')[0]) {
					$('#a4 .boxContent').css({'height':bcolnew - a4h2height - 22});
					$('#a5 .boxContent').css({'height':bcolnew - a5h2height + 62 });
				}
				
				else if (!$('#a4 img')[0] && $('#a5 img')[0]) {
					$('#a5 .boxContent').css({'height':bcolnew - a5h2height - 22});
					$('#a4 .boxContent').css({'height':bcolnew - a4h2height + 62 }); 
				}
				
				var withrssheight = $('.withrss').height();
				$('.boxColumn div.rss').css({"top": withrssheight});
			}
			
			if($('.videoPlayer, .videoPlayerTxt')[0]){
				$('.videoPlayer, .videoPlayerTxt').equalHeight();
			}
			// end page 4
			
        	/*
			if($('#undervisning .boxColumn')[0]){
				$('#undervisning .boxColumn').equalHeight();
			}
			$('#undervisning .frontColumn:first-child').css({ "margin-left": "2px" });
			*/
			//$( "#undervisning .frontColumn" ).each(
			//	$(this).equalHeight();
			//);
			//$('#eduBox1, #eduBox2, #eduBox3, #eduBox4').equalHeight();
			//$('#eduBox5, #eduBox6, #eduBox7, #eduBox8').equalHeight();
			
			if($('.eduBoxRow1')[0]){
				$('.eduBoxRow1').equalHeight();
			}
			if($('.eduBoxRow2')[0]){
				$('.eduBoxRow2').equalHeight();
			}
			if($('.eduBoxRow3')[0]){
				$('.eduBoxRow3').equalHeight();
			}
			if($('.eduBoxRow4')[0]){
				$('.eduBoxRow4').equalHeight();
			}
			if($('.eduBoxRow5')[0]){
				$('.eduBoxRow5').equalHeight();
			}
			
			if($('.toVideoBox')[0]){
				$('.toVideoBox').equalHeight();
			}					
			
			if($('#r1, #r2, #r3, #r4')[0]){
				$('.tvcol h2').equalHeight();
				$('.toVideoBox').equalHeight();
				$('#r1 .boxContent, #r2 .boxContent, #r3 .boxContent, #r4 .boxContent').equalHeight();
				$('#r1 .boxColumn, #r2 .boxColumn, #r3 .boxColumn, #r4 .boxColumn').equalHeight();
				$('#r1, #r2, #r3, #r4').equalHeight();
//				var scollHeight = $('.toVideoBox').height();
//				scollHeight = ((12+scollHeight) * 6) - $('#scrollProgram').height();
//				$('#scrollProgramDiv').css({'height': scollHeight});
				
			}
			if($('#r5, #r6, #r7, #r8')[0]){
				$('#r5, #r6, #r7, #r8').equalHeight();
				$('#r5 .boxContent, #r6 .boxContent, #r7 .boxContent, #r8 .boxContent').equalHeight();
			}
			if($('#r9, #r10, #r11, #r12')[0]){
		    	$('#r9, #r10, #r11, #r12').equalHeight();
				$('#r9 .boxContent, #r10 .boxContent, #r11 .boxContent, #r12 .boxContent').equalHeight();
			}
			if($('#r13, #r14, #r15, #r16')[0]){
				$('#r13, #r14, #r15, #r16').equalHeight();
				$('#r13 .boxContent, #r14 .boxContent, #r15 .boxContent, #r16 .boxContent').equalHeight();
			}
		
			
			// 26
			var r2height = $('#r2').height();
			var r6height = $('#r6').height();
			var c1height = $('#c1').height();
			var r10height = $('#r10').height();
			var kontaktheight = r2height + r6height + r10height + 236;
			$('#kontactLong').css({'min-height': kontaktheight});
			
			// end 26
			
			//
			
			var r2contheight = $('#r2').height();
			var r6contheight = $('#r6').height();
			if ($('#r10').height() > 0) {
			var r10contheight = $('#r10').height()+10;
			}
			$('#r111').css({'min-height': c1height-10});
			//
			if($('#r1 .boxColumn, #r2 .boxColumn, #r3 .boxColumn, #r4 .boxColumn')[0]){
				$('#r1 .boxColumn, #r2 .boxColumn, #r3 .boxColumn, #r4 .boxColumn').equalHeight();
			}
			if($('#r5 .boxColumn, #r6 .boxColumn, #r7 .boxColumn, #r8 .boxColumn')[0]){
				$('#r5 .boxColumn, #r6 .boxColumn, #r7 .boxColumn, #r8 .boxColumn').equalHeight();
			}
			if($('#r9 .boxColumn, #r10 .boxColumn, #r11 .boxColumn, #r12 .boxColumn')[0]){
				$('#r9 .boxColumn, #r10 .boxColumn, #r11 .boxColumn, #r12 .boxColumn').equalHeight();
			}
			
			
			// Documekter first page
			
			/*if ( $('.boxesLine > .frontColumn').children('.pic').size() >= 0) {
				if ( $('.boxesLine > .frontColumn').children('.pic').size() == 0) {
					$('.boxesLine > .frontColumn > .boxColumn').equalHeight();
				};
				
				if ( $('.boxesLine > .frontColumn').children('.pic').size() >= 0) {
					$('.boxesLine > .frontColumn > .boxColumn').equalHeight();
					
					$('.boxesLine > .frontColumn > .boxColumn').each(function(){
						var boxheight = $(this).height();
						var boxheightbig = boxheight + 84;
						if (!$(this).prev().hasClass('pic')){
							$(this).removeAttr('style').css({'height':boxheightbig});				
						}
					});
				};
				
			}*/
			
			$('.buttonSimple').hover(
      			function () {
        			$(this).children('span').css({"text-decoration":"underline"});
      			}, 
			  	function () {
					$(this).children('span').removeAttr('style');
			  	}
			);
			
			$('.button').hover(
      			function () {
        			$(this).children('span').css({"text-decoration":"underline"});
      			}, 
			  	function () {
					$(this).children('span').removeAttr('style');
			  	}
			);
			
			if ( $('#r1').children('.pic').size() >= 0 && $('#r2').children('.pic').size() >= 0 && $('#r3').children('.pic').size() >= 0 && $('#r4').children('.pic').size() >= 0 ) {
				if ( $('#r1').children('.pic').size() == 0 && $('#r2').children('.pic').size() == 0 && $('#r3').children('.pic').size() == 0 && $('#r4').children('.pic').size() == 0) ok=0;
				else ok=1;
				if (ok==1) {
					var nochild1 = $('#r1').children('.pic').size();
					var heightr1 = $('#r1 .boxColumn').height();
					var heightr1big = heightr1 + 84;
					if (nochild1 == 0) {
						$('#r1 .boxColumn').css({'height':heightr1big})
					}
					
					var nochild2 = $('#r2').children('.pic').size();
					var heightr2 = $('#r2 .boxColumn').height();
					var heightr2big = heightr2 + 84;
					if (nochild2 == 0) {
						$('#r2 .boxColumn').css({'height':heightr2big})
					}
					
					var nochild3 = $('#r3').children('.pic').size();
					var heightr3 = $('#r3 .boxColumn').height();
					var heightr3big = heightr3 + 84;
					if (nochild3 == 0) {
						$('#r3 .boxColumn').css({'height':heightr3big})
					}
					
					var nochild4 = $('#r4').children('.pic').size();
					var heightr4 = $('#r4 .boxColumn').height();
					var heightr4big = heightr4 + 84;
					if (nochild4 == 0) {
						$('#r4 .boxColumn').css({'height':heightr4big})
					}
				}
			}
			
			if ( $('#r5').children('.pic').size() >= 0 && $('#r6').children('.pic').size() >= 0 && $('#r7').children('.pic').size() >= 0 && $('#r8').children('.pic').size() >= 0 ) {
				if ( $('#r5').children('.pic').size() == 0 && $('#r6').children('.pic').size() == 0 && $('#r7').children('.pic').size() == 0 && $('#r8').children('.pic').size() == 0 ) ok=0;
				else ok=1;
				if (ok==1) {
					var nochild5 = $('#r5').children('.pic').size();
					var heightr5 = $('#r5 .boxColumn').height();
					var heightr5big = heightr5 + 84;
					if (nochild5 == 0) {
						$('#r5 .boxColumn').css({'height':heightr5big})
					}
					
					var nochild6 = $('#r6').children('.pic').size();
					var heightr6 = $('#r6 .boxColumn').height();
					var heightr6big = heightr6 + 84;
					if (nochild6 == 0) {
						$('#r6 .boxColumn').css({'height':heightr6big})
					}
					
					var nochild7 = $('#r7').children('.pic').size();
					var heightr7 = $('#r7 .boxColumn').height();
					var heightr7big = heightr7 + 84;
					if (nochild7 == 0) {
						$('#r7 .boxColumn').css({'height':heightr7big})
					}
					
					var nochild8 = $('#r8').children('.pic').size();
					var heightr8 = $('#r8 .boxColumn').height();
					var heightr8big = heightr8 + 84;
					if (nochild8 == 0) {
						$('#r8 .boxColumn').css({'height':heightr8big})
					}
				}
			}
			
			if ($('#undervisning')[0]) {
				var umasterHeight = $('#masterSub').height();
				var uheight1 = $('.breadcrumb').height();
				var uheight2 = $('.smallTeaser').height();
				$('#undervisning').css({"height": umasterHeight - 151 - uheight1 - uheight2});
			}
			
			if ($('#undervisningTheme')[0]) {
				var umasterHeight = $('#masterSub').height();
				var uheight1 = $('.breadcrumb').height();
				var uheight2 = $('.smallTeaser').height();
				$('#undervisningTheme').css({"height": umasterHeight - 151 - uheight1 - uheight2});
			}
			
			if ($('.leftUdvalg')[0]) {
				$('#u1, #u2').equalHeight();
				$('#u3, #u4').equalHeight();
				$('#u5, #u6').equalHeight();
				$('#u7, #u8').equalHeight();
				$('#u9, #u10').equalHeight();
				$('#c2, #c3').equalHeight();
		
				var leftudvalgheight = $('#c2').height();
                $('#u111').css({"height": leftudvalgheight - 30});
				
				
				var secondColCompensation= $('#u2').height() + $('#u4').height() + $('#u6').height() + 4 + 24;
				var COLcompensation = $('#u111').height() - secondColCompensation;
				if (COLcompensation > 0){
					//$('#u6').height( $('#u6').height() + COLcompensation)
					//$('#u5').height( $('#u5').height() + COLcompensation)
				}
				
			}
			
			/*
			if ( $('#r9').children('.pic').size() >= 0 && $('#r10').children('.pic').size() >= 0 && $('#r11').children('.pic').size() >= 0 && $('#r12').children('.pic').size() >= 0 ) {
				if ( $('#r9').children('.pic').size() == 0 && $('#r10').children('.pic').size() == 0 && $('#r11').children('.pic').size() == 0 && $('#r12').children('.pic').size() == 0) ok=0;						
				else ok=1;
				if (ok==1) {
					var nochild9 = $('#r9').children('.pic').size();
					var heightr9 = $('#r9 .boxColumn').height();
					var heightr9big = heightr9 + 84;
					if (nochild9 == 0) {
						$('#r9 .boxColumn').css({'min-height':heightr9big})
					}
					
					var nochild10 = $('#r10').children('.pic').size();
					var heightr10 = $('#r10 .boxColumn').height();
					var heightr10big = heightr10 + 84;
					if (nochild10 == 0) {
						$('#r10 .boxColumn').css({'min-height':heightr10big})
					}
					
					var nochild11 = $('#r11').children('.pic').size();
					var heightr11 = $('#r11 .boxColumn').height();
					var heightr11big = heightr11 + 84;
					if (nochild11 == 0) {
						$('#r11 .boxColumn').css({'min-height':heightr11big})
					}
					
					var nochild12 = $('#r12').children('.pic').size();
					var heightr12 = $('#r12 .boxColumn').height();
					var heightr12big = heightr12 + 84;
					if (nochild12 == 0) {
						$('#r12 .boxColumn').css({'min-height':heightr12big})
					}
				}
				
			}
			*/
			columnLeftFix();
			  $("#gemKomenterButton").click(function () { 
				columnLeftFix ();
				});
		
		
	        // Accesibilitysalut
			$("input#low1, input#low2, input#low3").attr("checked", "true");
			
			
			$("input[name='text']").bind('click', 
	            function() {
		            $("input[name='text']").removeAttr('checked');
					$(this).attr("checked", "true");
	            }
	        );
			
			$('#stylePreview').click (
				
	            function() {
					var inpText = $("input[@name=text]:checked").val();
		            var inpKontrast = $("input[@name=kontrast]:checked").val();
		            var inpLine = $("input[@name=line]:checked").val();
					
					if (inpText =='low1' & inpKontrast =='low2' & inpLine =='low3'){
						$('#rightBoxStyleTest').css({ "font-size": "100%", "color": "#464646", "background-color": "#F4F4F0", "border": "2px solid #E7E6E1", "line-height": "1.3em" });
						$('#rightBoxStyleTest a').css({ "color": "#464646" });
						$('#rightBoxStyleTest h2').css({ "border-bottom": "1px solid #fff" });
						$('#rightBoxStyleTest p').css({ "line-height": "1.3em" });
						}
					if (inpText =='low1' & inpKontrast =='normal2' & inpLine =='low3'){
						$('#rightBoxStyleTest').css({ "font-size": "100%", "color": "#000", "background-color": "#F4F4F0", "border": "2px solid #E7E6E1", "line-height": "1.3em" });
						$('#rightBoxStyleTest a').css({ "color": "#000" });
						$('#rightBoxStyleTest h2').css({ "border-bottom": "1px solid #fff" });
						$('#rightBoxStyleTest p').css({ "line-height": "1.3em" });
						}
					if (inpText =='low1' & inpKontrast =='high2' & inpLine =='low3'){
						$('#rightBoxStyleTest').css({ "font-size": "100%", "color": "#000" , "background-color": "#fff", "border": "2px solid #000", "line-height": "1.3em" });
						$('#rightBoxStyleTest a').css({ "color": "#000" });
						$('#rightBoxStyleTest h2').css({ "border-bottom": "1px solid #000" });
						$('#rightBoxStyleTest p').css({ "line-height": "1.3em" });
						}
					if (inpText =='normal1' & inpKontrast =='low2' & inpLine =='low3'){
						$('#rightBoxStyleTest').css({ "font-size": "110%", "color": "#464646", "background-color": "#F4F4F0", "border": "2px solid #E7E6E1", "line-height": "1.3em" });
						$('#rightBoxStyleTest a').css({ "color": "#464646" });
						$('#rightBoxStyleTest h2').css({ "border-bottom": "1px solid #fff" });
						$('#rightBoxStyleTest p').css({ "line-height": "1.3em" });
						}
					if (inpText =='high1' & inpKontrast =='low2' & inpLine =='low3'){
						$('#rightBoxStyleTest').css({ "font-size": "120%", "color": "#464646", "background-color": "#F4F4F0", "border": "2px solid #E7E6E1", "line-height": "1.3em" });
						$('#rightBoxStyleTest a').css({ "color": "#464646" });
						$('#rightBoxStyleTest h2').css({ "border-bottom": "1px solid #fff" });
						$('#rightBoxStyleTest p').css({ "line-height": "1.3em" });
						}
					if (inpText =='normal1' & inpKontrast =='high2' & inpLine =='low3'){
						$('#rightBoxStyleTest').css({ "font-size": "110%", "color": "#000" , "background-color": "#fff", "border": "2px solid #000", "line-height": "1.3em" });
						$('#rightBoxStyleTest a').css({ "color": "#000" });
						$('#rightBoxStyleTest h2').css({ "border-bottom": "1px solid #000" });
						$('#rightBoxStyleTest p').css({ "line-height": "1.3em" });
						}
					if (inpText =='high1' & inpKontrast =='high2' & inpLine =='low3'){
						$('#rightBoxStyleTest').css({ "font-size": "120%", "color": "#000" , "background-color": "#fff", "border": "2px solid #000", "line-height": "1.3em" });
						$('#rightBoxStyleTest a').css({ "color": "#000" });
						$('#rightBoxStyleTest h2').css({ "border-bottom": "1px solid #000" });
						$('#rightBoxStyleTest p').css({ "line-height": "1.3em" });
						}
					if (inpText =='normal1' & inpKontrast =='normal2' & inpLine =='low3'){
						$('#rightBoxStyleTest').css({ "font-size": "110%", "color": "#000", "background-color": "#F4F4F0", "border": "2px solid #E7E6E1", "line-height": "1.3em" });
						$('#rightBoxStyleTest a').css({ "color": "#000" });
						$('#rightBoxStyleTest h2').css({ "border-bottom": "1px solid #fff" });
						$('#rightBoxStyleTest p').css({ "line-height": "1.3em" });
						}
					if (inpText =='high1' & inpKontrast =='normal2' & inpLine =='low3'){
						$('#rightBoxStyleTest').css({ "font-size": "120%", "color": "#000", "background-color": "#F4F4F0", "border": "2px solid #E7E6E1", "line-height": "1.3em" });
						$('#rightBoxStyleTest a').css({ "color": "#000" });
						$('#rightBoxStyleTest h2').css({ "border-bottom": "1px solid #fff" });
						$('#rightBoxStyleTest p').css({ "line-height": "1.3em" });
						}
					if (inpText =='low1' & inpKontrast =='low2' & inpLine =='normal3'){
						$('#rightBoxStyleTest').css({ "font-size": "100%", "color": "#464646", "background-color": "#F4F4F0", "border": "2px solid #E7E6E1", "line-height": "1.4em" });
						$('#rightBoxStyleTest a').css({ "color": "#464646" });
						$('#rightBoxStyleTest h2').css({ "border-bottom": "1px solid #fff" });
						$('#rightBoxStyleTest p').css({ "line-height": "1.4em" });
						}
					if (inpText =='normal1' & inpKontrast =='low2' & inpLine =='normal3'){
						$('#rightBoxStyleTest').css({ "font-size": "110%", "color": "#464646", "background-color": "#F4F4F0", "border": "2px solid #E7E6E1", "line-height": "1.4em" });
						$('#rightBoxStyleTest a').css({ "color": "#464646" });
						$('#rightBoxStyleTest h2').css({ "border-bottom": "1px solid #fff" });
						$('#rightBoxStyleTest p').css({ "line-height": "1.4em" });
						}
					if (inpText =='high1' & inpKontrast =='low2' & inpLine =='normal3'){
						$('#rightBoxStyleTest').css({ "font-size": "120%", "color": "#464646", "background-color": "#F4F4F0", "border": "2px solid #E7E6E1", "line-height": "1.4em" });
						$('#rightBoxStyleTest a').css({ "color": "#464646" });
						$('#rightBoxStyleTest h2').css({ "border-bottom": "1px solid #fff" });
						$('#rightBoxStyleTest p').css({ "line-height": "1.4em" });
						}
					if (inpText =='low1' & inpKontrast =='normal2' & inpLine =='normal3'){
						$('#rightBoxStyleTest').css({ "font-size": "100%", "color": "#000", "background-color": "#F4F4F0", "border": "2px solid #E7E6E1", "line-height": "1.4em" });
						$('#rightBoxStyleTest a').css({ "color": "#000" });
						$('#rightBoxStyleTest h2').css({ "border-bottom": "1px solid #fff" });
						$('#rightBoxStyleTest p').css({ "line-height": "1.4em" });
						}
					if (inpText =='high1' & inpKontrast =='normal2' & inpLine =='normal3'){
						$('#rightBoxStyleTest').css({ "font-size": "120%", "color": "#000", "background-color": "#F4F4F0", "border": "2px solid #E7E6E1", "line-height": "1.4em" });
						$('#rightBoxStyleTest a').css({ "color": "#000" });
						$('#rightBoxStyleTest h2').css({ "border-bottom": "1px solid #fff" });
						$('#rightBoxStyleTest p').css({ "line-height": "1.4em" });
						}
					if (inpText =='low1' & inpKontrast =='high2' & inpLine =='normal3'){
						$('#rightBoxStyleTest').css({ "font-size": "100%", "color": "#000" , "background-color": "#fff", "border": "2px solid #000", "line-height": "1.4em" });
						$('#rightBoxStyleTest a').css({ "color": "#000" });
						$('#rightBoxStyleTest h2').css({ "border-bottom": "1px solid #000" });
						$('#rightBoxStyleTest p').css({ "line-height": "1.4em" });
						}
					if (inpText =='normal1' & inpKontrast =='high2' & inpLine =='normal3'){
						$('#rightBoxStyleTest').css({ "font-size": "110%", "color": "#000" , "background-color": "#fff", "border": "2px solid #000", "line-height": "1.4em" });
						$('#rightBoxStyleTest a').css({ "color": "#000" });
						$('#rightBoxStyleTest h2').css({ "border-bottom": "1px solid #000" });
						$('#rightBoxStyleTest p').css({ "line-height": "1.4em" });
						}
					if (inpText =='high1' & inpKontrast =='high2' & inpLine =='normal3'){
						$('#rightBoxStyleTest').css({ "font-size": "120%", "color": "#000" , "background-color": "#fff", "border": "2px solid #000", "line-height": "1.4em" });
						$('#rightBoxStyleTest a').css({ "color": "#000" });
						$('#rightBoxStyleTest h2').css({ "border-bottom": "1px solid #000" });
						$('#rightBoxStyleTest p').css({ "line-height": "1.4em" });
						}
					if (inpText =='normal1' & inpKontrast =='normal2' & inpLine =='normal3'){
						$('#rightBoxStyleTest').css({ "font-size": "110%", "color": "#000", "background-color": "#F4F4F0", "border": "2px solid #E7E6E1", "line-height": "1.4em" });
						$('#rightBoxStyleTest a').css({ "color": "#000" });
						$('#rightBoxStyleTest h2').css({ "border-bottom": "1px solid #fff" });
						$('#rightBoxStyleTest p').css({ "line-height": "1.4em" });
						}
					if (inpText =='low1' & inpKontrast =='low2' & inpLine =='high3'){
						$('#rightBoxStyleTest').css({ "font-size": "100%", "color": "#464646", "background-color": "#F4F4F0", "border": "2px solid #E7E6E1", "line-height": "2em" });
						$('#rightBoxStyleTest a').css({ "color": "#464646" });
						$('#rightBoxStyleTest h2').css({ "border-bottom": "1px solid #fff" });
						$('#rightBoxStyleTest p').css({ "line-height": "2em" });
						}
					if (inpText =='low1' & inpKontrast =='normal2' & inpLine =='high3'){
						$('#rightBoxStyleTest').css({ "font-size": "100%", "color": "#000", "background-color": "#F4F4F0", "border": "2px solid #E7E6E1", "line-height": "2em" });
						$('#rightBoxStyleTest a').css({ "color": "#000" });
						$('#rightBoxStyleTest h2').css({ "border-bottom": "1px solid #fff" });
						$('#rightBoxStyleTest p').css({ "line-height": "2em" });
						}
					if (inpText =='normal1' & inpKontrast =='low2' & inpLine =='high3'){
						$('#rightBoxStyleTest').css({ "font-size": "110%", "color": "#464646", "background-color": "#F4F4F0", "border": "2px solid #E7E6E1", "line-height": "2em" });
						$('#rightBoxStyleTest a').css({ "color": "#464646" });
						$('#rightBoxStyleTest h2').css({ "border-bottom": "1px solid #fff" });
						$('#rightBoxStyleTest p').css({ "line-height": "2em" });
						}
					if (inpText =='high1' & inpKontrast =='low2' & inpLine =='high3'){
						$('#rightBoxStyleTest').css({ "font-size": "120%", "color": "#464646", "background-color": "#F4F4F0", "border": "2px solid #E7E6E1", "line-height": "2em" });
						$('#rightBoxStyleTest a').css({ "color": "#464646" });
						$('#rightBoxStyleTest h2').css({ "border-bottom": "1px solid #fff" });
						$('#rightBoxStyleTest p').css({ "line-height": "2em" });
						}
					if (inpText =='normal1' & inpKontrast =='normal2' & inpLine =='high3'){
						$('#rightBoxStyleTest').css({ "font-size": "110%", "color": "#000", "background-color": "#F4F4F0", "border": "2px solid #E7E6E1", "line-height": "2em" });
						$('#rightBoxStyleTest a').css({ "color": "#000" });
						$('#rightBoxStyleTest h2').css({ "border-bottom": "1px solid #fff" });
						$('#rightBoxStyleTest p').css({ "line-height": "2em" });
						}
					if (inpText =='high1' & inpKontrast =='normal2' & inpLine =='high3'){
						$('#rightBoxStyleTest').css({ "font-size": "120%", "color": "#000", "background-color": "#F4F4F0", "border": "2px solid #E7E6E1", "line-height": "2em" });
						$('#rightBoxStyleTest a').css({ "color": "#000" });
						$('#rightBoxStyleTest h2').css({ "border-bottom": "1px solid #fff" });
						$('#rightBoxStyleTest p').css({ "line-height": "2em" });
						}
					if (inpText =='low1' & inpKontrast =='high2' & inpLine =='high3'){
						$('#rightBoxStyleTest').css({ "font-size": "100%", "color": "#000" , "background-color": "#fff", "border": "2px solid #000", "line-height": "2em" });
						$('#rightBoxStyleTest a').css({ "color": "#000" });
						$('#rightBoxStyleTest h2').css({ "border-bottom": "1px solid #000" });
						$('#rightBoxStyleTest p').css({ "line-height": "2em" });
						}
					if (inpText =='normal1' & inpKontrast =='high2' & inpLine =='high3'){
						$('#rightBoxStyleTest').css({ "font-size": "110%", "color": "#000" , "background-color": "#fff", "border": "2px solid #000", "line-height": "2em" });
						$('#rightBoxStyleTest a').css({ "color": "#000" });
						$('#rightBoxStyleTest h2').css({ "border-bottom": "1px solid #000" });
						$('#rightBoxStyleTest p').css({ "line-height": "2em" });
						}
					if (inpText =='high1' & inpKontrast =='high2' & inpLine =='high3'){
						$('#rightBoxStyleTest').css({ "font-size": "120%", "color": "#000" , "background-color": "#fff", "border": "2px solid #000", "line-height": "2em" });
						$('#rightBoxStyleTest a').css({ "color": "#000" });
						$('#rightBoxStyleTest h2').css({ "border-bottom": "1px solid #000" });
						$('#rightBoxStyleTest p').css({ "line-height": "2em" });
						}					
	            }
			);
			
			$('#styleSwitcher ul li a').click( 
	            function() {
					$('#styleSwitcher ul li a').removeAttr('style');
		            $(this).css({ "text-decoration": "underline", "color": "#c30" });
	            }
	        ); 
			 
	        /*$('#low1').bind('click', 
	            function() {
		            $('#rightBoxStyleTest').css({ "font-size": "100%" });
	            }
	        );    	
	        $('#normal1').bind('click', 
	            function() {
		            $('#rightBoxStyleTest').css({ "font-size": "110%" });
	            }
	        );
    	
	        $('#high1').bind('click', 
	            function() {
		            $('#rightBoxStyleTest').css({ "font-size": "120%" });
	            }
	        );
    	
	        $('#low2').bind('click', 
	            function() {
		            $('#rightBoxStyleTest').css({ "color": "#464646", "background-color": "#F4F4F0", "border": "2px solid #E7E6E1" });
	            }
	        );
    	
	        $('#normal2').bind('click', 
                function() {
	                $('#rightBoxStyleTest').css({ "color": "#000", "background-color": "#F4F4F0", "border": "2px solid #E7E6E1" });
	                $('#rightBoxStyleTest a').css({ "color": "#000" });
                }
	        );
    	
	        $('#high2').bind('click', function() {
		        $('#rightBoxStyleTest').css({ "background-color": "#fff", "border": "2px solid #000" });
		        $('#rightBoxStyleTest a').css({ "color": "#000" });
		        $('#rightBoxStyleTest h2').css({ "border-bottom": "1px solid #000" });
	        });
        	
	        $('#low3').bind('click', function() {
		        $('#rightBoxStyleTest').css({ "line-height": "1.3em" });
		        $('#rightBoxStyleTest p').css({ "line-height": "1.3em" });
	        });
        	
	        $('#normal3').bind('click', function() {
		        $('#rightBoxStyleTest').css({ "line-height": "1.7em" });
		        $('#rightBoxStyleTest p').css({ "line-height": "1.7em" });
	        });
        	
	        $('#high3').bind('click', function() {
		        $('#rightBoxStyleTest').css({ "line-height": "1.9em" });
		        $('#rightBoxStyleTest p').css({ "line-height": "1.9em" });
	        });*/
			
	       jQuery.fn.extend({
                check: function() {
                    return this.each(function() { this.checked = true; });
                },
                uncheck: function() {
                    return this.each(function() { this.checked = false; });
                   }
                });
                
            var inpText = readCookie('inpText');
            var inpKontrast = readCookie('inpKontrast');
            var inpLine = readCookie('inpLine');

            if (inpText != null && inpKontrast != null && inpLine != null){
            	$("#combineStyle input[@type=radio]").uncheck();
            	$("input[@id="+inpText+"]").check();
            	$("input[@id="+inpKontrast+"]").check();
            	$("input[@id="+inpLine+"]").check();
			}
            
	        $('#btnshowsample').click (
	            function() {
		            var inpText = $("input[@name=text]:checked").val();
		            var inpKontrast = $("input[@name=kontrast]:checked").val();
		            var inpLine = $("input[@name=line]:checked").val();
					
					if (inpText =='low1' & inpKontrast =='low2' & inpLine =='low3'){
						switchStylestyle('style1');
						}
					if (inpText =='low1' & inpKontrast =='normal2' & inpLine =='low3'){
						switchStylestyle('style2');
						}
					if (inpText =='low1' & inpKontrast =='high2' & inpLine =='low3'){
						switchStylestyle('style3');
						}
					if (inpText =='normal1' & inpKontrast =='low2' & inpLine =='low3'){
						switchStylestyle('style4');
						}
					if (inpText =='high1' & inpKontrast =='low2' & inpLine =='low3'){
						switchStylestyle('style5');
						}
					if (inpText =='normal1' & inpKontrast =='high2' & inpLine =='low3'){
						switchStylestyle('style6');
						}
					if (inpText =='high1' & inpKontrast =='high2' & inpLine =='low3'){
						switchStylestyle('style7');
						}
					if (inpText =='normal1' & inpKontrast =='normal2' & inpLine =='low3'){
						switchStylestyle('style8');
						}
					if (inpText =='high1' & inpKontrast =='normal2' & inpLine =='low3'){
						switchStylestyle('style9');
						}
					if (inpText =='low1' & inpKontrast =='low2' & inpLine =='normal3'){
						switchStylestyle('style10');
						}
					if (inpText =='normal1' & inpKontrast =='low2' & inpLine =='normal3'){
						switchStylestyle('style11');
						}
					if (inpText =='high1' & inpKontrast =='low2' & inpLine =='normal3'){
						switchStylestyle('style12');
						}
					if (inpText =='low1' & inpKontrast =='normal2' & inpLine =='normal3'){
						switchStylestyle('style13');
						}
					if (inpText =='high1' & inpKontrast =='normal2' & inpLine =='normal3'){
						switchStylestyle('style14');
						}
					if (inpText =='low1' & inpKontrast =='high2' & inpLine =='normal3'){
						switchStylestyle('style15');
						}
					if (inpText =='normal1' & inpKontrast =='high2' & inpLine =='normal3'){
						switchStylestyle('style16');
						}
					if (inpText =='high1' & inpKontrast =='high2' & inpLine =='normal3'){
						switchStylestyle('style17');
						}
					if (inpText =='normal1' & inpKontrast =='normal2' & inpLine =='normal3'){
						switchStylestyle('style18');
						}
					if (inpText =='low1' & inpKontrast =='low2' & inpLine =='high3'){
						switchStylestyle('style19');
						}
					if (inpText =='low1' & inpKontrast =='normal2' & inpLine =='high3'){
						switchStylestyle('style20');
						}
					if (inpText =='normal1' & inpKontrast =='low2' & inpLine =='high3'){
						switchStylestyle('style21');
						}
					if (inpText =='high1' & inpKontrast =='low2' & inpLine =='high3'){
						switchStylestyle('style22');
						}
					if (inpText =='normal1' & inpKontrast =='normal2' & inpLine =='high3'){
						switchStylestyle('style23');
						}
					if (inpText =='high1' & inpKontrast =='normal2' & inpLine =='high3'){
						switchStylestyle('style24');
						}
					if (inpText =='low1' & inpKontrast =='high2' & inpLine =='high3'){
						switchStylestyle('style25');
						}
					if (inpText =='normal1' & inpKontrast =='high2' & inpLine =='high3'){
						switchStylestyle('style26');
						}
					if (inpText =='high1' & inpKontrast =='high2' & inpLine =='high3'){
						switchStylestyle('style27');
						}
						
						
					/*
		            if (inpText == 'low1') {
			            if (inpKontrast =='low2')
			            	switchStylestyle('style1');
			            if (inpKontrast =='normal2')
			            	switchStylestyle('style2');
			            if (inpKontrast =='high2')
			            	switchStylestyle('style3');
		            }
            		
		            if (inpText == 'normal1') {
			            if (inpKontrast =='low2')
			            	switchStylestyle ('style4');
			            if (inpKontrast =='normal2')
			            	switchStylestyle ('style4');
			            if (inpKontrast =='high2')
			            	switchStylestyle ('style6');
		            }
            		
		            if (inpText == 'high1') {
			            if (inpKontrast =='low2')
			            	switchStylestyle ('style5');
			            if (inpKontrast =='normal2')
			            	switchStylestyle ('style5');
			            if (inpKontrast =='high2')
			            	switchStylestyle ('style6');
			            }
						*/
            	    createCookie('inpText', inpText, 365);
            		createCookie('inpKontrast', inpKontrast, 365);
            		createCookie('inpLine', inpLine, 365);				
	            }
	        );
			$('#btnDefault').click (
	            function() {
					$('#rightBoxStyleTest').removeAttr("style");
					$('#rightBoxStyleTest p').removeAttr("style");
					switchStylestyle('style1');	
					createCookie('inpText',"",-1);
					createCookie('inpKontrast',"",-1);
					createCookie('inpLine',"",-1);
					$("input#low1, input#low2, input#low3").removeAttr("checked");
					$("input#low1, input#low2, input#low3").attr("checked", "true");
				}
			);
			
			// User Box Search
			
			function populateSearchInfo () {
				  if ($('.searchBoxHeading .userBox').css('display') == 'none') {
				  	$('.searchBoxHeading .userBox').toggle();
				  }
				  var str = "";
				  
				  $('form#searchBoxParlamentariske .multi_selectSearch').each(function(){
					  var label2 = $('span.asLabel', $(this)).html();
					  str += "<strong>" + label2 + "</strong>";
				       $("input:checked + label", $(this)).each(function() {
					     str += "&bull; " + $(this).text() + "<br />";
                       }); 
					  $("div.userBoxRead").html(str);
					});
				  
				  
				  $('form#searchBoxParlamentariske select').each(function(){
					  var id = $(this).attr('id');
					  var label = $('label[for=' + id + ']').html();
					  str += "<strong>" + label + "</strong>";
					  $("option:selected", $(this)).each(function () {
							str += "&bull; " + $(this).text() + "<br />";
						  });
					  $("div.userBoxRead").html(str);
					});
				  
				  $('form#searchBoxParlamentariske .manualInput').each(function(){
					  if($("input", $(this)).val()!=''){
					   	var label1 = $(this).children('label').html();
					  	str += "<strong>" + label1 + "</strong>";
					     $("input", $(this)).each(function () {
							str += "&bull; " + $(this).val();
						  });
					  	$("div.userBoxRead").html(str);
					  }
					});
					
					$('form#searchBoxParlamentariske fieldset.searchCalendar').each(function(){
					 var legend = $(this).children('legend').html();
					  str += "<strong>" + legend + "</strong>";
				            $("input[type='text']",$(this)).each(function() {
					        str += "&bull; " + $(this).val() + "  ";
					  	});
					  $("div.userBoxRead").html(str);
				    });
				  $('form#searchBoxParlamentariske fieldset.radioOptions').each(function(){
					   var legend = $(this).children('legend').html();
					   str += "<strong>" + legend + "</strong>";
					        $("input:checked + label", $(this)).each(function() {
                            str += "&bull; " + $(this).text() + "<br />";
                       }); 
					   $("div.userBoxRead").html(str);
					});
				}


            function getQuery(){
                 var r = {};
                 var params = location.search.replace(/^\?/,'').split('&');
                 for( var i = params.length-1;  i >= 0;  i-- ) {
                        var p = params[i].split('='), key = p[0];
                        if( key ) r[key] = p[1];
                        }
                    return r; 
                 }
            $(document).ready(function(){
            //check the query string it the user click the button or not
              var str = getQuery()['btn'];
            // if the user click the button, populate the user selected box
              if(str == 1){
                populateSearchInfo();
              }
		    });
            
			$('form#searchBoxParlamentariske .multi_selectSearch input').click(function(){
			    populateSearchInfo();
			 
			});
			$('form#searchBoxParlamentariske select').change(function(){
			    populateSearchInfo();
			});
			$('form#searchBoxParlamentariske .manualInput input').keyup(function(){
			      populateSearchInfo();
			});
		
			$('form#searchBoxParlamentariske input#hidenCheckEnd').click(function(){
			    populateSearchInfo();
			});
			
			$('form#searchBoxParlamentariske input#hidenCheckStart').click(function(){
			    populateSearchInfo();
			});
			

			$('form#searchBoxParlamentariske .searchCalendar input').blur(function(){
			    populateSearchInfo();
			});
			$('form#searchBoxParlamentariske fieldset.radioOptions input').click(function(){
			    populateSearchInfo();
			});
				//.change();
		
	        $("#multiselect_1").focus(function(){
			    populateSearchInfo();
			});
			 $("#multiselect_2").focus(function(){
			    populateSearchInfo();
			});
			 $("#multiselect_3").focus(function(){
			    populateSearchInfo();
			});
			$("#multiselect_4").focus(function(){
			    populateSearchInfo();
			});
			$("#multiselect_5").focus(function(){
			    populateSearchInfo();
			});
			
			$("#multiselect_6").focus(function(){
			    populateSearchInfo();
			});
			
			$("#multiselect_7").focus(function(){
			    populateSearchInfo();
			});
			$('a.userBoxClose').click(function(){
				$('.userBox').toggle();
			});
			
		
			// Documenter fornt page boxes
			if($('#doku5')[0]){
			// dab removed all hardcoded styles	
				$('#doku5 .boxColumn:eq(0), #doku5 .boxColumn:eq(2)').equalHeight();
				$('#doku5 .boxColumn:eq(1), #doku5 .boxColumn:eq(3)').equalHeight();
				var dokuFirstBox = $('#doku5 .boxColumn:eq(0)').height();
				var dokuSecondBox = $('#doku5 .boxColumn:eq(2)').height();
				var dokuTwocolsBox = $('#doku5 .twoColumns .boxColumn').height();
				var dokuDoubleBox = dokuFirstBox + dokuSecondBox + 15; // dab this was giving us trbls in FF this one px diff
				var dokuDoubleDif = dokuTwocolsBox - dokuFirstBox - 15;
				
				if(dokuTwocolsBox < dokuDoubleBox){
					$('#doku5 .twoColumns .boxColumn').css({"height": dokuDoubleBox});
				} else {
					$('#doku5 .boxColumn:eq(1)').css({"height": dokuDoubleDif});
					$('#doku5 .boxColumn:eq(3)').css({"height": dokuDoubleDif});
				}
			}
			
			
			// Video Play Button
			setTimeout(playButtonPosition(),1000);

			
			
			
//	 ral blog calendar table       $('.calendarTable').find('a').parents('td').css({ "background-color": "#bbdde1" });	
	        
	        $('#btnDefault').click (
	            function() {
                    switchStylestyle('style1');			
	            }
	        );
			
			
			
			
	        }
			
			
			
        catch(e)
	    {
    	    //alert(e);
	    }
//------- dab campaign fixes ---------------------		 
	if(($.browser.msie && $.browser.version == 6) == false){
	    $(".campVertical .sp:eq(3)").after("<br/>");
	    $(".campVertical .sp:eq(4)").css("clear","left");
	    $(".campVerticalFive .sp:eq(4)").after("<br/>");
	    $(".campVerticalFive .sp:eq(5)").css("clear","left");
}
		 
		 
//------- ral adding accesskeys ---------------------
/*
$.shortaccesskey = {
  accesskeyArr: Array(),

  init: function () {
    var i = 0;
    $("a[@accesskey]").each (function() {
      $.shortaccesskey.accesskeyArr[i] = $(this).attr('accesskey');
      i++;
    });
  
    $(document).keypress($.shortaccesskey.handleKeyPress);
  
    $("input,textarea,select").focus(function() {
      $(document).unbind();
    });
  
    $("input,textarea,select").blur(function() {
      $(document).keypress($.shortaccesskey.handleKeyPress);
    });
  },

  handleKeyPress: function(e) {
    var e = e || window.event;
    //var k = e.charCode ? e.charCode : e.keyCode ? e.keyCode : e.which;
    //keyCode - IE , charCode - NS6+
    var k = e.charCode || e.keyCode || 0; 
    var keyPressed = String.fromCharCode(k);
    if ($.inArray(keyPressed, $.shortaccesskey.accesskeyArr) >= 0) {
      window.location = $("a[@accesskey="+keyPressed+"]").attr("href");
    }
  }
};

//function accesskey()
//{
//document.getElementById('search').accessKey="0";
//document.getElementById('aboutftdk').accessKey="1";
//document.getElementById('skip menu ? ').accessKey="2"; 
//document.getElementById('contact').accessKey="3";
//document.getElementById('sitemap').accessKey="4";
//document.getElementById('toHome').accessKey="5";
//}

//accesskey();

$.shortaccesskey.init();
*/
//
// start email protection 
$(".emailHolder").addClass("clearfix");
$(".emailHolder").hover(function () { 
      $(this).css({ cursor:"pointer;"});
},function () { 
     $("this").css({ cursor:"pointer;"});
});
$(".emailHolder").click(function () { 
	var em = $(this).children(".email1").html();
	var il = $(this).children(".email3").html();
	var email = em+"@"+il;
	javascript:location.href='mailto:'+email;

});
// end email protection 

 }
	
);


var cssFix = function(){

  var u = navigator.userAgent.toLowerCase(),

  is = function(t){return (u.indexOf(t)!=-1)};

  $("html").addClass([

    (!(/opera|webtv/i.test(u))&&/msie (\d)/.test(u))?('ie ie'+RegExp.$1)

      :is('firefox/2')?'gecko ff2'

      :is('firefox/3')?'gecko ff3'

      :is('iexplore/6')?'ie6'

      :is('iexplore/7')?'ie7'

      :is('chrome/')?'google'

      :is('gecko/')?'gecko'

      :is('opera/9')?'opera opera9':/opera (\d)/.test(u)?'opera opera'+RegExp.$1

      :is('konqueror')?'konqueror'

      :is('applewebkit/')?'webkit safari'

      :is('mozilla/')?'gecko':'',

    (is('x11')||is('linux'))?' linux'

      :is('mac')?' mac'

      :is('win')?' win':''

  ].join(''));

}();


function checkDropDown()
{
    var _committee = document.getElementById('committee').value;
    var _delegationOrCommission = document.getElementById('delegationOrCommission').value;
    var _member = document.getElementById('member').value;

    if (_committee != null && _delegationOrCommission != null && _member != null)
    {
        if (_member == 'all')
        {
            if (_committee != '' && _delegationOrCommission == ''){
                document.getElementById('committee').disabled = false;
                document.getElementById('delegationOrCommission').disabled = true;
            }
            else if (_committee == '' && _delegationOrCommission != ''){
                document.getElementById('committee').disabled = true;
                document.getElementById('delegationOrCommission').disabled = false;
            }
            else{
                document.getElementById('committee').disabled = false;
                document.getElementById('delegationOrCommission').disabled = false;
            }
        }
        else{
            document.getElementById('delegationOrCommission').disabled = false;
            document.getElementById('committee').disabled = false;
        }
    }
}

function isInteger(s)
{
    var i;
    s = s.toString();
    for (i = 0; i < s.length; i++)
    {
        var c = s.charAt(i);
        if (isNaN(c)) 
        {
	        //alert("Given value is not a number");
	        return false;
        }
    }
    return true;
}

function onEnterTxtBox(boxValue, e) {
    var isEnter = window.event == null ? e.keyCode == 13 : window.event.keyCode == 13;
    
    if(isEnter){
        // Define getElementsByClassName function
        if (document.getElementsByClassName == undefined) {
	        document.getElementsByClassName = function(className)
	        {
		        var hasClassName = new RegExp("(?:^|\\s)" + className + "(?:$|\\s)");
		        var allElements = document.getElementsByTagName("*");
		        var results = [];
		        var element;
		        
		        for (var i = 0; (element = allElements[i]) != null; i++) {
			        var elementClass = element.className;
			        if (elementClass && elementClass.indexOf(className) != -1 && hasClassName.test(elementClass))
				        results.push(element);
		        }
		        return results;
	        }
        }
        
        var searchBoxes = document.getElementsByClassName('searchPageBox');
        var notEmptyBoxes = new Array();
        var replacingValue = "";
        
        for (var i = 0; i < searchBoxes.length; i++){
            replacingValue = searchBoxes[i].value;
            
            if ((replacingValue != null) && (replacingValue != '') && isInteger(replacingValue))
            {
                notEmptyBoxes.push(replacingValue);
            }
            else if ((replacingValue != null) && (replacingValue != '') && !isInteger(replacingValue)){
                alert("Given value is not a number!");
            }
        }
        
        if (notEmptyBoxes.length == 1)
        {
            if ((notEmptyBoxes[0] != null) && (notEmptyBoxes[0] != '') && isInteger(notEmptyBoxes[0]))
            {
                var boxValueReplaced = boxValue.replace('...', notEmptyBoxes[0]);
                // Change action link on the form 
                document.forms[0].action = boxValueReplaced;
                // Submit the form
                document.forms[0].submit();
            }
        }
        else if (notEmptyBoxes.length > 1){
            alert('You must use only one box at a time!');
        }
        else {
        }
    }
}

/*
 * Trigger (Show / Hide elements)
 */
jQuery(function($){	
	
	$(document).bind('click', function(e){
		
		if ($(e.target).is('.trigger') || $(e.target).parent().is('.trigger')) {
		
			var $trigger = $(e.target).is('.trigger')?$(e.target):$(e.target).parent(),
			$content = $trigger.next();
					
			if ($trigger.is('.opened')) {				
				$content.slideUp('slow', function() {
					// Animation complete
					$trigger.removeClass('opened').addClass('closed');
					$('.columnLeft').removeAttr('style');
					columnLeftFix();
				});
				
			} else {
				$trigger.removeClass('closed').addClass('opened');
				$content.slideDown('slow', function() {
					// Animation complete					
					$('.columnLeft').removeAttr('style');
					columnLeftFix();
				});
			}
			return false;
		}
		
	});

});

/*
 * jScrollPane
 */
jQuery(function($)
{

/*

//Probably old code

if($('#scrollProgram')[0]){
	
	
	$('#scrollProgram').jScrollPane({
	    showArrows:true,
	    animateScroll: true,
	    autoReinitialise: true
	});
	
	var api = $('#scrollProgram').data('jsp');

	
	$('.jspArrowUp').bind(
        'click',
        function()
        {
            api.scrollBy(0,-250);
            return false;
        }
    );
    
	 $('.jspArrowDown').bind(
        'click',
        function()
        {
            api.scrollBy(0,250);
            return false;
        }
    );
	
	
}

if($('#videoScroll')[0]){

	$('#videoScroll').jScrollPane({
	    showArrows:true,
	    //animateScroll: true,
	    autoReinitialise: true
	});
	
	var api = $('#videoScroll').data('jsp');

	
	$('.jspArrowUp').bind(
        'click',
        function()
        {
            api.scrollBy(0,-10);
            return false;
        }
    );
    
	 $('.jspArrowDown').bind(
        'click',
        function()
        {
            api.scrollBy(0,10);
            return false;
        }
    );
}
*/			


if($('#scrollProgram')[0]){
	
	
	$('#scrollProgram').jScrollPane({
	    showArrows:true,
	    autoReinitialise: false
	}).wrap('<div class="videoScrollWrap" />');
	$('.videoScrollWrap').append('<div id="topArrowTrigger"></div><div id="bottomArrowTrigger"></div>');
	
	var api = $('#scrollProgram').data('jsp');
	
	$('#topArrowTrigger').bind(
        'click',
        function()
        {
            api.scrollBy(0,-250);
            return false;
        }
    );
    
	 $('#bottomArrowTrigger').bind(
        'click',
        function()
        {
            api.scrollBy(0,250);
            return false;
        }
    );
	
	
}

if($('#videoScroll')[0]){

	$('#videoScroll').jScrollPane({
	    showArrows:true,
		autoReinitialise: false
	}).wrap('<div class="videoScrollWrap" />');
	$('.videoScrollWrap').append('<div id="topArrowTrigger"></div><div id="bottomArrowTrigger"></div>');
	var api = $('#videoScroll').data('jsp');
	
	$('#topArrowTrigger').bind(
        'click',
        function()
        {
            api.scrollBy(0,-250);
            return false;
        }
    );
    
	 $('#bottomArrowTrigger').bind(
        'click',
        function()
        {
            api.scrollBy(0,250);
            return false;
        }
    );
}	

});

/*
 * General Scroll
 */ 
jQuery(function($){
	
	$('.scroll-container').each(function(){
		
		var $scroll = $(this),	
			$up = $(this).siblings('.scroll-up'),
			$down = $(this).siblings('.scroll-down'),
			api; 
		
		$scroll.jScrollPane({
		    showArrows: true,
			autoReinitialise: false
		});
		
		api = $scroll.data('jsp');
		
		$up.bind('click', function() {
            api.scrollBy(0,-250);
            return false;
        });
    
	 	$down.bind('click', function() {
            api.scrollBy(0,250);
            return false;
        });
		
	});
	
});


/*
 * Video Items Active
 */

/*
jQuery(function($){
	
	$('.video-item').click(function(){
		$(this).addClass('video-item-active').siblings('.video-item-active').removeClass('video-item-active');
	});
	
	$('.video-box').click(function(){
		$(this).addClass('video-box-active').siblings('.video-box-active').removeClass('video-box-active');
	});
	
	$('.video-item-referat').click(function(){
		$(this).addClass('video-referat-active').siblings('.video-referat-active').removeClass('video-referat-active');
	});	
	
});
*/

/*
 * Open Share Player
 * Modal Window
 */
/*
jQuery(function($){

	
	$('<div id="shareModal" class="jqmWindow"><iframe id="share-player" width="755" height="508" scrolling="no" src="share/share.html"></iframe></div>').appendTo('body');
	var $share = $('#shareModal');	
	
	$share.jqm({
		modal: true,
		trigger: '#socialTv',
		onShow:  function(hash){			
			var $trigger = $(hash.t);
			var $modal = $(hash.w);
			
			var myUrl = $trigger.attr('href');
			var myTitle= $trigger.attr('title');
			var $modalContent = $("iframe", $modal);
			
			//$modalContent.html('').attr('src', myUrl);
		
			//let's use the anchor "title" attribute as modal window title
			//$('#jqmTitleText').text(myTitle);
			
		 	$modal.jqmShow();
		 	$('.jqmOverlay').attr('id', 'jqmOverlay');
		 	$('#shareModal').show();		
		 	return false;
		}
	});
	
	
	$('#socialTv').click(function(){
		if (document.getElementById('jqmOverlay')) {
			$('#jqmOverlay').show();
			$('#shareModal').show();
		}
	});
	
});
*/
/*
 * Left Column Fix
 */
jQuery(function($){	
	columnLeftFix();	
});

/*
 * Latest Video Scroll
 * Custom code
 */ 
jQuery(function($){
	
	$('.go-right, .go-left').bind('click', function(event){		
		
		var left = $(event.target).is('.go-left')?true:false,
			$item = $('.latest-video-scroll-inner'),
			distance = left?'+=718':'-=718',
			maximum = 359*$('.latest-video', $item).length,
			leftDistance = parseFloat($item.css('left').replace('px',''));

		
		if ($item.is(':animated')) return false; //Do nothing if we're currently in another animation		
		if ((leftDistance >= 0) && left) return false; //Left Margin
		if ((-leftDistance+718 >= maximum) && !left) return false; //Right Margin
		
		$item.animate({
			left: distance
			}, 400, 'swing');
		
		return false;		
	});	
	
});

/*
 * jQuery plugin
 * Simple Tabs
 *
 * Author: Andrei Eftimie
 * Copyright ft.dk
 */
(function($){
	$.fn.simpleTabs = function() {	
		return this.each(function(){			
			var $this = $(this), $links = $('a', $this), ids = [];			
			$links
			.each(function(){
				if (this.href.indexOf('#') > 0) {
					var id = this.href.split('#')[1];
					$(this).attr('data-id',id)
					ids.push(id);
				}
			})
			.click(function(){ 
				var id = $(this).attr('data-id');					
				if (document.getElementById(id)) { //Checking to see if an element with the specified id exists																		
					$.each(ids, function(){ $('#'+this).hide(); });
					$('#'+id).show();
					$(this).parent().addClass('active');
					$links.not(this).parent().removeClass('active');
					columnLeftFix();
				}
				return false;
			})
			.eq(0).trigger('click');												
		});	
	};	
})(jQuery);

/*
 * Flexible Tabs
 */
jQuery(function($){	
	$('.flexible-tabs').simpleTabs();	
});
