/* Cycle */
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(3($){7 m=\'2.2i\';$.q.r=3(l){L 6.12(3(){l=l||{};4(l.1W==1S){2U(l){1L\'2K\':4(6.R)1G(6.R);6.R=0;L;1L\'1E\':6.11=1;L;1L\'2f\':6.11=0;L;2e:l={1a:l}}}7 b=$(6);7 c=l.1u?$(l.1u,6):b.2b();7 d=c.2R();4(d.C<2)L;7 e=$.2J({},$.q.r.22,l||{},$.20?b.20():$.2D?b.2B():{});4(e.1F)e.1Z=e.2t||d.C;e.u=e.u?[e.u]:[];e.V=e.V?[e.V]:[];e.V.2k(3(){e.1C=0});7 f=6.2h;7 w=1A((f.1z(/w:(\\d+)/)||[])[1])||e.D;7 h=1A((f.1z(/h:(\\d+)/)||[])[1])||e.E;e.H=1A((f.1z(/t:(\\d+)/)||[])[1])||e.H;4(b.B(\'1v\')==\'2d\')b.B(\'1v\',\'2c\');4(w)b.D(w);4(h&&h!=\'1s\')b.E(h);4(e.U>=d.C)e.U=0;7 g=e.U||0;c.B(\'1v\',\'2T\').1p().12(3(i){7 z=g?i>=g?d.C-(i-g):g-i:d.C-i;$(6).B(\'z-25\',z)});$(d[g]).I();4(e.1g&&w)c.D(w);4(e.1g&&h&&h!=\'1s\')c.E(h);4(e.1E)b.2I(3(){6.11=1},3(){6.11=0});7 j=$.q.r.F[e.1a];4($.21(j))j(b,c,e);c.12(3(){7 a=$(6);6.S=(e.1g&&h)?h:a.E();6.Q=(e.1g&&w)?w:a.D()});e.A=e.A||{};e.v=e.v||{};e.y=e.y||{};c.1r(\':1n(\'+g+\')\').B(e.A);4(e.N)$(c[g]).B(e.N);4(e.H){4(e.M.1W==1S)e.M={2s:2r,2q:2n}[e.M]||2m;4(!e.1m)e.M=e.M/2;1D((e.H-e.M)<2j)e.H+=e.M}4(e.1B)e.1l=e.1k=e.1B;4(!e.1d)e.1d=e.M;4(!e.1c)e.1c=e.M;e.2g=d.C;e.O=g;4(e.10){e.s=e.O;1D(e.s==e.O)e.s=1j.1Y(1j.10()*d.C)}1b e.s=e.U>=(d.C-1)?0:e.U+1;7 k=c[g];4(e.u.C)e.u[0].1h(k,[k,k,e,1X]);4(e.V.C>1)e.V[1].1h(k,[k,k,e,1X]);4(e.Z&&!e.K)e.K=e.Z;4(e.K)$(e.K).1y(\'Z\',3(){L 1x(d,e,e.19?-1:1)});4(e.1w)$(e.1w).1y(\'Z\',3(){L 1x(d,e,e.19?1:-1)});4(e.18)1V(d,e);4(e.H)6.R=1U(3(){17(d,e,0,!e.19)},e.H+(e.1T||0))})};3 17(a,b,c,d){4(b.1C)L;7 p=a[0].1t,Y=a[b.O],K=a[b.s];4(p.R===0&&!c)L;4(!c&&!p.11&&b.1F&&(--b.1Z<=0))L;4(c||!p.11){4(b.u.C)$.12(b.u,3(i,o){o.1h(K,[Y,K,b,d])});7 e=3(){$.12(b.V,3(i,o){o.1h(K,[Y,K,b,d])})};4(b.s!=b.O){b.1C=1;4(b.1o)b.1o(Y,K,b,e);1b 4($.21($.q.r[b.1a]))$.q.r[b.1a](Y,K,b,e);1b $.q.r.1R(Y,K,b,e)}4(b.10){b.O=b.s;1D(b.s==b.O)b.s=1j.1Y(1j.10()*a.C)}1b{7 f=(b.s+1)==a.C;b.s=f?0:b.s+1;b.O=f?a.C-1:b.s-1}4(b.18)$(b.18).1Q(\'a\').2a(\'1P\').28(\'a:1n(\'+b.O+\')\').27(\'1P\')}4(b.H)p.R=1U(3(){17(a,b,0,!b.19)},b.H)};3 1x(a,b,c){7 p=a[0].1t,H=p.R;4(H){1G(H);p.R=0}b.s=b.O+c;4(b.s<0)b.s=a.C-1;1b 4(b.s>=a.C)b.s=0;4(b.1q&&1N b.1q==\'3\')b.1q(c>0,b.s,a[b.s]);17(a,b,1,c>=0);L 26};3 1V(b,c){7 d=$(c.18);$.12(b,3(i,o){7 a=(1N c.1M==\'3\')?$(c.1M(i,o)):$(\'<a 2O="#">\'+(i+1)+\'</a>\');4(a.2N(\'2M\').C==0)a.2L(d);a.1y(\'Z\',3(){c.s=i;7 p=b[0].1t,H=p.R;4(H){1G(H);p.R=0}4(1N c.1K==\'3\')c.1K(c.s,b[c.s]);17(b,c,1,!c.19);L 26})});d.1Q(\'a\').28(\'a:1n(\'+c.U+\')\').27(\'1P\')};$.q.r.1R=3(a,b,c,d){7 e=$(a),$n=$(b);$n.B(c.A);7 f=3(){$n.1i(c.v,c.1d,c.1l,d)};e.1i(c.y,c.1c,c.1k,3(){4(c.J)e.B(c.J);4(!c.1m)f()});4(c.1m)f()};$.q.r.F={24:3(a,b,c){b.1r(\':1n(\'+c.U+\')\').B(\'1f\',0);c.u.G(3(){$(6).I()});c.v={1f:1};c.y={1f:0};c.J={T:\'P\'}}};$.q.r.2H=3(){L m};$.q.r.22={1a:\'24\',H:2G,M:2F,1d:x,1c:x,Z:x,K:x,1w:x,1q:x,18:x,1K:x,1M:x,u:x,V:x,1B:x,1l:x,1k:x,1e:x,v:x,y:x,A:x,J:x,1o:x,E:\'1s\',U:0,1m:1,10:0,1g:0,1E:0,1F:0,1T:0,1u:x}})(5);5.q.r.F.2E=3(d,e,f){d.B(\'X\',\'14\');f.u.G(3(a,b,c){5(6).I();c.A.8=b.16;c.y.8=0-a.16});f.N={8:0};f.v={8:0};f.J={T:\'P\'}};5.q.r.F.2C=3(d,e,f){d.B(\'X\',\'14\');f.u.G(3(a,b,c){5(6).I();c.A.8=0-b.16;c.y.8=a.16});f.N={8:0};f.v={8:0};f.J={T:\'P\'}};5.q.r.F.2A=3(d,e,f){d.B(\'X\',\'14\');f.u.G(3(a,b,c){5(6).I();c.A.9=b.13;c.y.9=0-a.13});f.N={9:0};f.v={9:0}};5.q.r.F.2z=3(d,e,f){d.B(\'X\',\'14\');f.u.G(3(a,b,c){5(6).I();c.A.9=0-b.13;c.y.9=a.13});f.N={9:0};f.v={9:0}};5.q.r.F.2y=3(f,g,h){f.B(\'X\',\'14\').D();h.u.G(3(a,b,c,d){5(6).I();7 e=a.13,1I=b.13;c.A=d?{9:1I}:{9:-1I};c.v.9=0;c.y.9=d?-e:e;g.1r(a).B(c.A)});h.N={9:0};h.J={T:\'P\'}};5.q.r.F.2x=3(f,g,h){f.B(\'X\',\'14\');h.u.G(3(a,b,c,d){5(6).I();7 e=a.16,1H=b.16;c.A=d?{8:-1H}:{8:1H};c.v.8=0;c.y.8=d?e:-e;g.1r(a).B(c.A)});h.N={8:0};h.J={T:\'P\'}};5.q.r.F.2w=3(a,b,c){c.v={D:\'I\'};c.y={D:\'1p\'}};5.q.r.F.2v=3(a,b,c){c.v={E:\'I\'};c.y={E:\'1p\'}};5.q.r.F.1e=3(f,g,h){7 w=f.B(\'X\',\'2u\').D();g.B({9:0,8:0});h.u.G(3(){5(6).I()});h.M=h.M/2;h.10=0;h.1e=h.1e||{9:-w,8:15};h.W=[];1J(7 i=0;i<g.C;i++)h.W.G(g[i]);1J(7 i=0;i<h.U;i++)h.W.G(h.W.23());h.1o=3(a,b,c,d){7 e=5(a);e.1i(c.1e,c.1d,c.1l,3(){c.W.G(c.W.23());1J(7 i=0,1O=c.W.C;i<1O;i++)5(c.W[i]).B(\'z-25\',1O-i);e.1i({9:0,8:0},c.1c,c.1k,3(){5(6).1p();4(d)d()})})}};5.q.r.F.2p=3(d,e,f){f.u.G(3(a,b,c){5(6).I();c.A.8=b.S;c.v.E=b.S});f.N={8:0};f.A={E:0};f.v={8:0};f.y={E:0};f.J={T:\'P\'}};5.q.r.F.2o=3(d,e,f){f.u.G(3(a,b,c){5(6).I();c.v.E=b.S;c.y.8=a.S});f.N={8:0};f.A={8:0,E:0};f.y={E:0};f.J={T:\'P\'}};5.q.r.F.2P=3(d,e,f){f.u.G(3(a,b,c){5(6).I();c.A.9=b.Q;c.v.D=b.Q});f.A={D:0};f.v={9:0};f.y={D:0};f.J={T:\'P\'}};5.q.r.F.2Q=3(d,e,f){f.u.G(3(a,b,c){5(6).I();c.v.D=b.Q;c.y.9=a.Q});f.A={9:0,D:0};f.v={9:0};f.y={D:0};f.J={T:\'P\'}};5.q.r.F.2l=3(d,e,f){f.N={8:0,9:0};f.J={T:\'P\'};f.u.G(3(a,b,c){5(6).I();c.A={D:0,E:0,8:b.S/2,9:b.Q/2};c.v={8:0,9:0,D:b.Q,E:b.S};c.y={D:0,E:0,8:a.S/2,9:a.Q/2}})};5.q.r.F.2S=3(d,e,f){f.u.G(3(a,b,c){c.A={D:0,E:0,1f:1,9:b.Q/2,8:b.S/2,29:1};c.v={8:0,9:0,D:b.Q,E:b.S}});f.y={1f:0};f.J={29:0}};',62,181,'|||function|if|jQuery|this|var|top|left|||||||||||||||||fn|cycle|nextSlide||before|animIn||null|animOut||cssBefore|css|length|width|height|transitions|push|timeout|show|cssAfter|next|return|speed|cssFirst|currSlide|none|cycleW|cycleTimeout|cycleH|display|startingSlide|after|els|overflow|curr|click|random|cyclePause|each|offsetWidth|hidden||offsetHeight|go|pager|rev|fx|else|speedOut|speedIn|shuffle|opacity|fit|apply|animate|Math|easeOut|easeIn|sync|eq|fxFn|hide|prevNextClick|not|auto|parentNode|slideExpr|position|prev|advance|bind|match|parseInt|easing|busy|while|pause|autostop|clearTimeout|nextH|nextW|for|pagerClick|case|pagerAnchorBuilder|typeof|len|activeSlide|find|custom|String|delay|setTimeout|buildPager|constructor|true|floor|countdown|metadata|isFunction|defaults|shift|fade|index|false|addClass|filter|zIndex|removeClass|children|relative|static|default|resume|slideCount|className|04|250|unshift|zoom|400|200|turnDown|turnUp|fast|600|slow|autostopCount|visible|slideY|slideX|scrollVert|scrollHorz|scrollRight|scrollLeft|data|scrollDown|meta|scrollUp|1000|4000|ver|hover|extend|stop|appendTo|body|parents|href|turnLeft|turnRight|get|fadeZoom|absolute|switch'.split('|'),0,{}))

/* Cycle Settings */
$.fn.cycle.defaults.speed   = 900;
$.fn.cycle.defaults.timeout = 5000;
$(function() {
    $('#slideshow').cycle({ 
    fx:    'fade', 
    delay: -1000 
	});
});





// t: current time, b: begInnIng value, c: change In value, d: duration
jQuery.easing['jswing'] = jQuery.easing['swing'];

jQuery.extend( jQuery.easing,
{
	def: 'easeOutQuad',
	swing: function (x, t, b, c, d) {
		//alert(jQuery.easing.default);
		return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
	},
	easeInQuad: function (x, t, b, c, d) {
		return c*(t/=d)*t + b;
	},
	easeOutQuad: function (x, t, b, c, d) {
		return -c *(t/=d)*(t-2) + b;
	},
	easeInOutQuad: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t + b;
		return -c/2 * ((--t)*(t-2) - 1) + b;
	},
	easeInCubic: function (x, t, b, c, d) {
		return c*(t/=d)*t*t + b;
	},
	easeOutCubic: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t + 1) + b;
	},
	easeInOutCubic: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t + b;
		return c/2*((t-=2)*t*t + 2) + b;
	},
	easeInQuart: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t + b;
	},
	easeOutQuart: function (x, t, b, c, d) {
		return -c * ((t=t/d-1)*t*t*t - 1) + b;
	},
	easeInOutQuart: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
		return -c/2 * ((t-=2)*t*t*t - 2) + b;
	},
	easeInQuint: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t*t + b;
	},
	easeOutQuint: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t*t*t + 1) + b;
	},
	easeInOutQuint: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
		return c/2*((t-=2)*t*t*t*t + 2) + b;
	},
	easeInSine: function (x, t, b, c, d) {
		return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
	},
	easeOutSine: function (x, t, b, c, d) {
		return c * Math.sin(t/d * (Math.PI/2)) + b;
	},
	easeInOutSine: function (x, t, b, c, d) {
		return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
	},
	easeInExpo: function (x, t, b, c, d) {
		return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
	},
	easeOutExpo: function (x, t, b, c, d) {
		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
	},
	easeInOutExpo: function (x, t, b, c, d) {
		if (t==0) return b;
		if (t==d) return b+c;
		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
	},
	easeInCirc: function (x, t, b, c, d) {
		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
	},
	easeOutCirc: function (x, t, b, c, d) {
		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
	},
	easeInOutCirc: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
		return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
	},
	easeInElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
	},
	easeOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
	},
	easeInOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
		return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
	},
	easeInBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*(t/=d)*t*((s+1)*t - s) + b;
	},
	easeOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
	},
	easeInOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158; 
		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
	},
	easeInBounce: function (x, t, b, c, d) {
		return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
	},
	easeOutBounce: function (x, t, b, c, d) {
		if ((t/=d) < (1/2.75)) {
			return c*(7.5625*t*t) + b;
		} else if (t < (2/2.75)) {
			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
		} else if (t < (2.5/2.75)) {
			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
		} else {
			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
		}
	},
	easeInOutBounce: function (x, t, b, c, d) {
		if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
		return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
	}
});




function add_Validator(verticalForm)
{
	if (verticalForm.destination.value == "0")
  {
    alert("Please enter a destination.");
    verticalForm.destination.focus();
    return (false);
  }

	if (verticalForm.education.value == "0")
  {
    alert("Please enter an education.");
    verticalForm.education.focus();
    return (false);
  }

	if (verticalForm.firstname.value == "")
  {
    alert("Please enter your first name.");
    verticalForm.firstname.focus();
    return (false);
  }

	if (verticalForm.lastname.value == "")
  {
    alert("Please enter your last name.");
    verticalForm.lastname.focus();
    return (false);
  }
 
	if (verticalForm.telephone.value == "")
  {
    alert("Please enter your telephone number.");
    verticalForm.telephone.focus();
    return (false);
  }
 
	if (verticalForm.email.value == "")
  {
    alert("Please enter your email address.");
    verticalForm.email.focus();
    return (false);
  }

  	if (verticalForm.email.value.indexOf('@') < 0)
  {
    alert("Please enter a valid email address.");
    verticalForm.email.focus();
    return (false);
  }
  
    if (verticalForm.email.value.lastIndexOf('.') < 0)
  {
    alert("Please enter a valid email address.");
    verticalForm.email.focus();
    return (false);
  }
  
  	if (verticalForm.email.value.indexOf(' ') != -1)
  {
    alert("Please enter a valid email address.");
    verticalForm.email.focus();
    return (false);
  }
  
	 return (true);
  }


function add_ValidatorForanmalan(verticalForm)
{

	if ((verticalForm.kontaktat[0].checked == false )
    && (verticalForm.kontaktat[1].checked == false ))
  {
    alert("Har du varit i kontakt med GOstudy tidigare?");
    return (false);
  }

	if (verticalForm.info.value == "0")
  {
    alert("Hur fick du information om denna m\u00E4ssan?");
    verticalForm.info.focus();
    return (false);
  }
  
	if ((verticalForm.besoksort[0].checked == false )
    && (verticalForm.besoksort[1].checked == false )
	&& (verticalForm.besoksort[2].checked == false )
	&& (verticalForm.besoksort[3].checked == false ))
  {
    alert("Var kommer du bes\u00F6ka m\u00E4ssan?");
    return (false);
  }
  
	if (verticalForm.destination.value == "0")
  {
    alert("V\u00E4lj en destination.");
    verticalForm.destination.focus();
    return (false);
  }

	if (verticalForm.education.value == "0")
  {
    alert("V\u00E4lj en utbildningsinriktning.");
    verticalForm.education.focus();
    return (false);
  }

	if (verticalForm.firstname.value == "")
  {
    alert("Uppge ditt f\u00F6rnamn.");
    verticalForm.firstname.focus();
    return (false);
  }

	if (verticalForm.lastname.value == "")
  {
    alert("Uppge ditt efternamn.");
    verticalForm.lastname.focus();
    return (false);
  }
 
	if (verticalForm.telephone.value == "")
  {
    alert("Uppge ditt mobilnummer.");
    verticalForm.telephone.focus();
    return (false);
  }
 
	if (verticalForm.email.value == "")
  {
    alert("Uppge din email adress.");
    verticalForm.email.focus();
    return (false);
  }

  	if (verticalForm.email.value.indexOf('@') < 0)
  {
    alert("Uppge en korrekt email adress.");
    verticalForm.email.focus();
    return (false);
  }
  
    if (verticalForm.email.value.lastIndexOf('.') < 0)
  {
    alert("Uppge en korrekt email adress.");
    verticalForm.email.focus();
    return (false);
  }
  
  	if (verticalForm.email.value.indexOf(' ') != -1)
  {
    alert("Uppge en korrekt email adress.");
    verticalForm.email.focus();
    return (false);
  }
  
	 return (true);
  }
   
 
 
function add_ValidatorNyhetsbrev(verticalForm)
{

	if (verticalForm.email.value == "")
  {
    alert("Please enter your email address.");
    verticalForm.email.focus();
    return (false);
  }

  	if (verticalForm.email.value.indexOf('@') < 0)
  {
    alert("Please enter a valid email address.");
    verticalForm.email.focus();
    return (false);
  }
  
    if (verticalForm.email.value.lastIndexOf('.') < 0)
  {
    alert("Please enter a valid email address.");
    verticalForm.email.focus();
    return (false);
  }
  
  	if (verticalForm.email.value.indexOf(' ') != -1)
  {
    alert("Please enter a valid email address.");
    verticalForm.email.focus();
    return (false);
  }
  
	 return (true);
  }
  
  

function add_ValidatorNewsletter(verticalForm)
{

	if (verticalForm.pf_SubscriberName.value == "")
  {
    alert("Fyll i ditt namn.");
    verticalForm.pf_SubscriberName.focus();
    return (false);
  }
 
	if (verticalForm.pf_Email.value == "")
  {
    alert("Fyll i din emailadress.");
    verticalForm.pf_Email.focus();
    return (false);
  }

  	if (verticalForm.pf_Email.value.indexOf('@') < 0)
  {
    alert("Fyll i din emailadress.");
    verticalForm.pf_Email.focus();
    return (false);
  }
  
    if (verticalForm.pf_Email.value.lastIndexOf('.') < 0)
  {
    alert("Fyll i din emailadress.");
    verticalForm.pf_Email.focus();
    return (false);
  }
  
  	if (verticalForm.pf_Email.value.indexOf(' ') != -1)
  {
    alert("Fyll i din emailadress.");
    verticalForm.pf_Email.focus();
    return (false);
  }

	if (verticalForm.pf_SubscriberPassword.value == "")
  {
    alert("Fyll i ditt losenord.");
    verticalForm.pf_SubscriberPassword.focus();
    return (false);
  }

	 return (true);
  }



(function($) {

$.widget("ui.selectmenu", {
	_init: function() {
		var self = this, o = this.options;
		
		//quick array of button and menu id's
		this.ids = [this.element.attr('id') + '-' + 'button', this.element.attr('id') + '-' + 'menu'];
		
		//define safe mouseup for future toggling
		this._safemouseup = true;
		
		//create menu button wrapper
		this.newelement = $('<a class="'+ this.widgetBaseClass +' ui-widget ui-state-default ui-corner-all" id="'+this.ids[0]+'" role="button" href="#" aria-haspopup="true" aria-owns="'+this.ids[1]+'"></a>')
			.insertAfter(this.element);
		
		//transfer tabindex
		var tabindex = this.element.attr('tabindex');
		if(tabindex){ this.newelement.attr('tabindex', tabindex); }
		
		//save reference to select in data for ease in calling methods
		this.newelement.data('selectelement', this.element);
		
		//menu icon
		this.selectmenuIcon = $('<span class="'+ this.widgetBaseClass +'-icon ui-icon"></span>')
			.prependTo(this.newelement)
			.addClass( (o.style == "popup")? 'ui-icon-triangle-2-n-s' : 'ui-icon-triangle-1-s' );	

			
		//make associated form label trigger focus
		$('label[for='+this.element.attr('id')+']')
			.attr('for', this.ids[0])
			.bind('click', function(){
				self.newelement[0].focus();
				return false;
			});	

		//click toggle for menu visibility
		this.newelement
			.bind('mousedown', function(event){
				self._toggle(event);
				//make sure a click won't open/close instantly
				if(o.style == "popup"){
					self._safemouseup = false;
					setTimeout(function(){self._safemouseup = true;}, 300);
				}	
				return false;
			})
			.bind('click',function(){
				return false;
			})
			.keydown(function(event){
				var ret = true;
				switch (event.keyCode) {
					case $.ui.keyCode.ENTER:
						ret = true;
						break;
					case $.ui.keyCode.SPACE:
						ret = false;
						self._toggle(event);	
						break;
					case $.ui.keyCode.UP:
					case $.ui.keyCode.LEFT:
						ret = false;
						self._moveSelection(-1);
						break;
					case $.ui.keyCode.DOWN:
					case $.ui.keyCode.RIGHT:
						ret = false;
						self._moveSelection(1);
						break;	
					case $.ui.keyCode.TAB:
						ret = true;
						break;	
					default:
						ret = false;
						self._typeAhead(event.keyCode, 'mouseup');
						break;	
				}
				return ret;
			})
			.bind('mouseover focus', function(){ 
				$(this).addClass(self.widgetBaseClass+'-focus ui-state-hover'); 
			})
			.bind('mouseout blur', function(){  
				$(this).removeClass(self.widgetBaseClass+'-focus ui-state-hover'); 
			});
		
		//document click closes menu
		$(document)
			.mousedown(function(event){
				self.close(event);
			});

		//change event on original selectmenu
		this.element
			.click(function(){ this._refreshValue(); })
			.focus(function(){ this.newelement[0].focus(); });
		
		//create menu portion, append to body
		var cornerClass = (o.style == "dropdown")? " ui-corner-bottom" : " ui-corner-all"
		this.list = $('<ul class="' + self.widgetBaseClass + '-menu ui-widget ui-widget-content'+cornerClass+'" aria-hidden="true" role="listbox" aria-labelledby="'+this.ids[0]+'" id="'+this.ids[1]+'"></ul>').appendTo('body');				
		
		//serialize selectmenu element options	
		var selectOptionData = [];
		this.element
			.find('option')
			.each(function(){
				selectOptionData.push({
					value: $(this).attr('value'),
					text: self._formatText(jQuery(this).text()),
					selected: $(this).attr('selected'),
					classes: $(this).attr('class'),
					parentOptGroup: $(this).parent('optgroup').attr('label')
				});
			});		
				
		//active state class is only used in popup style
		var activeClass = (self.options.style == "popup") ? " ui-state-active" : "";
		
		//write li's
		for(var i in selectOptionData){
			var thisLi = $('<li role="presentation"><a href="#" tabindex="-1" role="option" aria-selected="false">'+ selectOptionData[i].text +'</a></li>')
				.data('index',i)
				.addClass(selectOptionData[i].classes)
				.data('optionClasses', selectOptionData[i].classes|| '')
				.mouseup(function(event){
						if(self._safemouseup){
							var changed = $(this).data('index') != self._selectedIndex();
							self.value($(this).data('index'));
							self.select(event);
							if(changed){ self.change(event); }
							self.close(event,true);
						}
					return false;
				})
				.click(function(){
					return false;
				})
				.bind('mouseover focus', function(){ 
					self._selectedOptionLi().addClass(activeClass); 
					self._focusedOptionLi().removeClass(self.widgetBaseClass+'-item-focus ui-state-hover'); 
					$(this).removeClass('ui-state-active').addClass(self.widgetBaseClass + '-item-focus ui-state-hover'); 
				})
				.bind('mouseout blur', function(){ 
					if($(this).is( self._selectedOptionLi() )){ $(this).addClass(activeClass); }
					$(this).removeClass(self.widgetBaseClass + '-item-focus ui-state-hover'); 
				});
				
			//optgroup or not...
			if(selectOptionData[i].parentOptGroup){
				var optGroupName = self.widgetBaseClass + '-group-' + selectOptionData[i].parentOptGroup;
				if(this.list.find('li.' + optGroupName).size()){
					this.list.find('li.' + optGroupName + ':last ul').append(thisLi);
				}
				else{
					$('<li role="presentation" class="'+self.widgetBaseClass+'-group '+optGroupName+'"><span class="'+self.widgetBaseClass+'-group-label">'+selectOptionData[i].parentOptGroup+'</span><ul></ul></li>')
						.appendTo(this.list)
						.find('ul')
						.append(thisLi);
				}
			}
			else{
				thisLi.appendTo(this.list);
			}
			
			//this allows for using the scrollbar in an overflowed list
			this.list.bind('mousedown mouseup', function(){return false;});
			
			//append icon if option is specified
			if(o.icons){
				for(var j in o.icons){
					if(thisLi.is(o.icons[j].find)){
						thisLi
							.data('optionClasses', selectOptionData[i].classes + ' ' + self.widgetBaseClass + '-hasIcon')
							.addClass(self.widgetBaseClass + '-hasIcon');
						var iconClass = o.icons[j].icon || "";
						
						thisLi
							.find('a:eq(0)')
							.prepend('<span class="'+self.widgetBaseClass+'-item-icon ui-icon '+iconClass + '"></span>');
					}
				}
			}
		}	
		
		//add corners to top and bottom menu items
		this.list.find('li:last').addClass("ui-corner-bottom");
		if(o.style == 'popup'){ this.list.find('li:first').addClass("ui-corner-top"); }
		
		//transfer classes to selectmenu and list
		if(o.transferClasses){
			var transferClasses = this.element.attr('class') || ''; 
			this.newelement.add(this.list).addClass(transferClasses);
		}
		
		//original selectmenu width
		var selectWidth = this.element.width();
		
		//set menu button width
		this.newelement.width( (o.width) ? o.width : selectWidth);
		
		//set menu width to either menuWidth option value, width option value, or select width 
		if(o.style == 'dropdown'){ this.list.width( (o.menuWidth) ? o.menuWidth : ((o.width) ? o.width : selectWidth)); }
		else { this.list.width( (o.menuWidth) ? o.menuWidth : ((o.width) ? o.width - o.handleWidth : selectWidth - o.handleWidth)); }	
		
		//set max height from option 
		if(o.maxHeight && o.maxHeight < this.list.height()){ this.list.height(o.maxHeight); }	
		
		//save reference to actionable li's (not group label li's)
		this._optionLis = this.list.find('li:not(.'+ self.widgetBaseClass +'-group)');
				
		//transfer menu click to menu button
		this.list
			.keydown(function(event){
				var ret = true;
				switch (event.keyCode) {
					case $.ui.keyCode.UP:
					case $.ui.keyCode.LEFT:
						ret = false;
						self._moveFocus(-1);
						break;
					case $.ui.keyCode.DOWN:
					case $.ui.keyCode.RIGHT:
						ret = false;
						self._moveFocus(1);
						break;	
					case $.ui.keyCode.HOME:
						ret = false;
						self._moveFocus(':first');
						break;	
					case $.ui.keyCode.PAGE_UP:
						ret = false;
						self._scrollPage('up');
						break;	
					case $.ui.keyCode.PAGE_DOWN:
						ret = false;
						self._scrollPage('down');
						break;
					case $.ui.keyCode.END:
						ret = false;
						self._moveFocus(':last');
						break;			
					case $.ui.keyCode.ENTER:
					case $.ui.keyCode.SPACE:
						ret = false;
						self.close(event,true);
						$(event.target).parents('li:eq(0)').trigger('mouseup');
						break;		
					case $.ui.keyCode.TAB:
						ret = true;
						self.close(event,true);
						break;	
					case $.ui.keyCode.ESCAPE:
						ret = false;
						self.close(event,true);
						break;	
					default:
						ret = false;
						self._typeAhead(event.keyCode,'focus');
						break;		
				}
				return ret;
			});
			
		//selectmenu style
		if(o.style == 'dropdown'){
			this.newelement
				.addClass(self.widgetBaseClass+"-dropdown");
			this.list
				.addClass(self.widgetBaseClass+"-menu-dropdown");	
		}
		else {
			this.newelement
				.addClass(self.widgetBaseClass+"-popup");
			this.list
				.addClass(self.widgetBaseClass+"-menu-popup");	
		}
		
		//append status span to button
		this.newelement.prepend('<span class="'+self.widgetBaseClass+'-status">'+ selectOptionData[this._selectedIndex()].text +'</span>');
		
		//hide original selectmenu element
		this.element.hide();
		
		//transfer disabled state
		if(this.element.attr('disabled') == true){ this.disable(); }
		
		//update value
		this.value(this._selectedIndex());
	},
	destroy: function() {
		this.element.removeData(this.widgetName)
			.removeClass(this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled')
			.removeAttr('aria-disabled');
	
		//unbind click on label, reset its for attr
		$('label[for='+this.newelement.attr('id')+']')
			.attr('for',this.element.attr('id'))
			.unbind('click');
		this.newelement.remove();
		this.list.remove();
		this.element.show();	
	},
	_typeAhead: function(code, eventType){
		var self = this;
		//define self._prevChar if needed
		if(!self._prevChar){ self._prevChar = ['',0]; }
		var C = String.fromCharCode(code);
		c = C.toLowerCase();
		var focusFound = false;
		function focusOpt(elem, ind){
			focusFound = true;
			$(elem).trigger(eventType);
			self._prevChar[1] = ind;
		};
		this.list.find('li a').each(function(i){	
			if(!focusFound){
				var thisText = $(this).text();
				if( thisText.indexOf(C) == 0 || thisText.indexOf(c) == 0){
						if(self._prevChar[0] == C){
							if(self._prevChar[1] < i){ focusOpt(this,i); }	
						}
						else{ focusOpt(this,i); }	
				}
			}
		});
		this._prevChar[0] = C;
	},
	_uiHash: function(){
		return {
			value: this.value()
		};
	},
	open: function(event){
		var self = this;
		var disabledStatus = this.newelement.attr("aria-disabled");
		if(disabledStatus != 'true'){
			this._refreshPosition();
			this._closeOthers(event);
			this.newelement
				.addClass('ui-state-active');
			
			this.list
				.appendTo('body')
				.addClass(self.widgetBaseClass + '-open')
				.attr('aria-hidden', false)
				.find('li:not(.'+ self.widgetBaseClass +'-group):eq('+ this._selectedIndex() +') a')[0].focus();	
			if(this.options.style == "dropdown"){ this.newelement.removeClass('ui-corner-all').addClass('ui-corner-top'); }	
			this._refreshPosition();
			this._trigger("open", event, this._uiHash());
		}
	},
	close: function(event, retainFocus){
		if(this.newelement.is('.ui-state-active')){
			this.newelement
				.removeClass('ui-state-active');
			this.list
				.attr('aria-hidden', true)
				.removeClass(this.widgetBaseClass+'-open');
			if(this.options.style == "dropdown"){ this.newelement.removeClass('ui-corner-top').addClass('ui-corner-all'); }
			if(retainFocus){this.newelement[0].focus();}	
			this._trigger("close", event, this._uiHash());
		}
	},
	change: function(event) {
		this.element.trigger('change');
		this._trigger("change", event, this._uiHash());
	},
	select: function(event) {
		this._trigger("select", event, this._uiHash());
	},
	_closeOthers: function(event){
		$('.'+ this.widgetBaseClass +'.ui-state-active').not(this.newelement).each(function(){
			$(this).data('selectelement').selectmenu('close',event);
		});
		$('.'+ this.widgetBaseClass +'.ui-state-hover').trigger('mouseout');
	},
	_toggle: function(event,retainFocus){
		if(this.list.is('.'+ this.widgetBaseClass +'-open')){ this.close(event,retainFocus); }
		else { this.open(event); }
	},
	_formatText: function(text){
		return this.options.format ? this.options.format(text) : text;
	},
	_selectedIndex: function(){
		return this.element[0].selectedIndex;
	},
	_selectedOptionLi: function(){
		return this._optionLis.eq(this._selectedIndex());
	},
	_focusedOptionLi: function(){
		return this.list.find('.'+ this.widgetBaseClass +'-item-focus');
	},
	_moveSelection: function(amt){
		var currIndex = parseInt(this._selectedOptionLi().data('index'), 10);
		var newIndex = currIndex + amt;
		return this._optionLis.eq(newIndex).trigger('mouseup');
	},
	_moveFocus: function(amt){
		if(!isNaN(amt)){
			var currIndex = parseInt(this._focusedOptionLi().data('index'), 10);
			var newIndex = currIndex + amt;
		}
		else { var newIndex = parseInt(this._optionLis.filter(amt).data('index'), 10); }
		
		if(newIndex < 0){ newIndex = 0; }
		if(newIndex > this._optionLis.size()-1){
			newIndex =  this._optionLis.size()-1;
		}
		var activeID = this.widgetBaseClass + '-item-' + Math.round(Math.random() * 1000);
		
		this._focusedOptionLi().find('a:eq(0)').attr('id','');
		this._optionLis.eq(newIndex).find('a:eq(0)').attr('id',activeID)[0].focus();
		this.list.attr('aria-activedescendant', activeID);
	},
	_scrollPage: function(direction){
		var numPerPage = Math.floor(this.list.outerHeight() / this.list.find('li:first').outerHeight());
		numPerPage = (direction == 'up') ? -numPerPage : numPerPage;
		this._moveFocus(numPerPage);
	},
	_setData: function(key, value) {
		this.options[key] = value;
		if (key == 'disabled') {
			this.close();
			this.element
				.add(this.newelement)
				.add(this.list)
					[value ? 'addClass' : 'removeClass'](
						this.widgetBaseClass + '-disabled' + ' ' +
						this.namespace + '-state-disabled')
					.attr("aria-disabled", value);
		}
	},
	value: function(newValue) {
		if (arguments.length) {
			this.element[0].selectedIndex = newValue;
			this._refreshValue();
			this._refreshPosition();
		}
		return this.element[0].selectedIndex;
	},
	_refreshValue: function() {
		var activeClass = (this.options.style == "popup") ? " ui-state-active" : "";
		var activeID = this.widgetBaseClass + '-item-' + Math.round(Math.random() * 1000);
		//deselect previous
		this.list
			.find('.'+ this.widgetBaseClass +'-item-selected')
			.removeClass(this.widgetBaseClass + "-item-selected" + activeClass)
			.find('a')
			.attr('aria-selected', 'false')
			.attr('id', '');
		//select new
		this._selectedOptionLi()
			.addClass(this.widgetBaseClass + "-item-selected"+activeClass)
			.find('a')
			.attr('aria-selected', 'true')
			.attr('id', activeID);
			
		//toggle any class brought in from option
		var currentOptionClasses = this.newelement.data('optionClasses') ? this.newelement.data('optionClasses') : "";
		var newOptionClasses = this._selectedOptionLi().data('optionClasses') ? this._selectedOptionLi().data('optionClasses') : "";
		this.newelement
			.removeClass(currentOptionClasses)
			.data('optionClasses', newOptionClasses)
			.addClass( newOptionClasses )
			.find('.'+this.widgetBaseClass+'-status')
			.html( 
				this._selectedOptionLi()
					.find('a:eq(0)')
					.html() 
			);
			
		this.list.attr('aria-activedescendant', activeID)
	},
	_refreshPosition: function(){	
		//set left value
		this.list.css('left', this.newelement.offset().left);
		
		//set top value
		var menuTop = this.newelement.offset().top;
		var scrolledAmt = this.list[0].scrollTop;
		this.list.find('li:lt('+this._selectedIndex()+')').each(function(){
			scrolledAmt -= $(this).outerHeight();
		});
		
		if(this.newelement.is('.'+this.widgetBaseClass+'-popup')){
			menuTop+=scrolledAmt; 
			this.list.css('top', menuTop); 
		}	
		else { 
			menuTop += this.newelement.height();
			this.list.css('top', menuTop); 
		}
	}
});

$.extend($.ui.selectmenu, {
	getter: "value",
	version: "@VERSION",
	eventPrefix: "selectmenu",
	defaults: {
		transferClasses: true,
		style: 'popup', 
		width: null, 
		menuWidth: null, 
		handleWidth: 26, 
		maxHeight: null,
		icons: null, 
		format: null
	}
});

})(jQuery);

