// mejl-länkar
function getMejl(name, dom, country, subject, _body) {
	if(subject == undefined) subject = "";
	if(_body == undefined)_body = "";
	window.location.href="mai"+"lto"+":"+name+String.fromCharCode(64)+dom+String.fromCharCode(46)+country+"?Subject="+subject+"&Body="+_body;
}

// fixar till frame, status, huvudmenyn
function start(page,meny,status,noframe){
	var d = document;
	//om det finns fler querysrings
	if(page.indexOf("%")!=-1){
		p = page.split("%");
		if(parent.parent.nav==undefined)window.location = "http://www.webaid.se/?s=" + p[0] + "&q1=" + p[1] + "&q2=" + p[2];
	}else{
		if(parent.parent.nav==undefined)window.location = "http://www.webaid.se/?s=" + page;
	}
	parent.parent.nav.activeMeny(meny); 
	defaultStatus = 'webaid.se' + status;
	
	if(d.URL.indexOf("projekt.asp")!=-1){
		MM_showHideLayers('foot','','show')
		d.getElementById('foot').style.top = d.body.scrollHeight;
	}
	//sätt rätt Y på sidfoten. id=content är kontainern som innehåller huvudtexten. den finns inte på alla sidor, därav denna kontroll.
	if(d.getElementById('content') != null){
		MM_showHideLayers('foot','','show')//visa sidfoten
		var foot_y = (d.getElementById('content').offsetHeight+100);
		if (foot_y > 440){
			d.getElementById('foot').style.top = foot_y;
		}else{
			d.getElementById('foot').style.top = 440;
		}
		//rätt höjd på högra utfyllnadsfältet under meny
		var content_height = parseInt(d.getElementById('content').offsetHeight);
		var right_meny_height = parseInt(d.getElementById('right_meny').style.height);
		d.getElementById('right_fill').style.height = (parseInt(d.getElementById('foot').style.top)-right_meny_height-35);
		
	}
}

function personnummer(nr){
	this.valid=false;
	if(!nr.match(/^(\d{2})(\d{2})(\d{2})(\d{4})$/)){ return false; }
	this.now=new Date(); this.nowFullYear=this.now.getFullYear()+""; this.nowCentury=this.nowFullYear.substring(0,2); this.nowShortYear=this.nowFullYear.substring(2,4);
	this.year=RegExp.$1; this.month=RegExp.$2; this.day=RegExp.$3; this.controldigits=RegExp.$4;
	this.fullYear=(this.year*1<=this.nowShortYear*1)?(this.nowCentury+this.year)*1:((this.nowCentury*1-1)+this.year)*1;
	var months = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
	if(this.fullYear%400==0||this.fullYear%4==0&&this.fullYear%100!=0){ months[1]=29; }
	if(this.month*1<1||this.month*1>12||this.day*1<1||this.day*1>months[this.month*1-1]){ return false; }
	this.alldigits=this.year+this.month+this.day+this.controldigits;
	var nn="";
	for(var n=0;n<this.alldigits.length;n++){ nn+=((((n+1)%2)+1)*this.alldigits.substring(n,n+1)); }
	this.checksum=0;
	for(var n=0;n<nn.length;n++){ this.checksum+=nn.substring(n,n+1)*1; }
	this.valid=(this.checksum%10==0)?true:false;
	this.sex=parseInt(this.controldigits.substring(2,3))%2;
	/*
    * pn.valid - Giltigt personnummer eller inte (true/false).
    * pn.fullYear - Personens födelseår (yyyy).
    * pn.year - Samma som ovan (yy).
    * pn.month - Personens födelsemånad (mm).
    * pn.day - Personens födelseday (dd).
    * pn.controldigits - De sista 4 siffrorna i personnumret (nnnn).
    * pn.alldigits - Alla siffrorna i personnummret i en följd (yymmddnnnn).
    * pn.sex - Personens kön (0=kvinna, 1=man).
	*/
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}

//flash text ...................................................................................................................
var MM_contentVersion = 6;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	    for (var i = 0; i < words.length; ++i)
	    {
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i]; 
	    }
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</SCR' + 'IPT\> \n');
}
//om browserna klarar transparent window mode
if(((navigator.appVersion.indexOf("MSIE 6")!=-1)||(navigator.appVersion.indexOf("MSIE 7")!=-1)||(navigator.userAgent.indexOf("Firefox")!=-1))&&(navigator.userAgent.indexOf("Opera")==-1)){
	wtrans = true
}else{
	wtrans = false
}

// topp-rubriker. korta
function txt(txt,c){
	if ( MM_FlashCanPlay && wtrans) {
		document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
		document.write('  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
		document.write(' ID="holder" WIDTH="255" HEIGHT="16" ALIGN="">');
		document.write(' <PARAM NAME=movie VALUE="http://www.webaid.se/sv/flash/text_futurabold.swf?txt='+enkode(txt)+'&c=0x'+c+'"> <param name=wmode value=transparent> <PARAM NAME=loop VALUE=false> <PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF>  '); 
		document.write(' <EMBED src="http://www.webaid.se/sv/flash/text_futurabold.swf?txt='+enkode(txt)+'&c=0x'+c+'" loop=false menu=false quality=high bgcolor=#FFFFFF');
		document.write(' swLiveConnect=FALSE WIDTH="255" HEIGHT="16" NAME="holder" wmode="transparent"');
		document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
		document.write(' </EMBED>');
		document.write(' </OBJECT>');
	} else{
		document.write("<span style='color:"+c+"; font-family:arial; font-size:15px; font-weight:bold'>"+txt+"</span>");
	}
}
//topp-rubriker. långa
function txt_long(txt,c){
	if ( MM_FlashCanPlay && wtrans) {
		document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
		document.write('  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
		document.write(' ID="holder" WIDTH="350" HEIGHT="19" ALIGN="">');
		document.write(' <PARAM NAME=movie VALUE="http://www.webaid.se/sv/flash/text_futurabold_long.swf?txt='+enkode(txt)+'&c=0x'+c+'"> <param name=wmode value=transparent> <PARAM NAME=loop VALUE=false> <PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF>  '); 
		document.write(' <EMBED src="http://www.webaid.se/sv/flash/text_futurabold_long.swf?txt='+enkode(txt)+'&c=0x'+c+'" loop=false menu=false quality=high bgcolor=#FFFFFF');
		document.write(' swLiveConnect=FALSE WIDTH="350" HEIGHT="19" NAME="holder" wmode="transparent"');
		document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
		document.write(' </EMBED>');
		document.write(' </OBJECT>');
	} else{
		document.write("<span style='color:"+c+"; font-family:arial; font-size:15px; font-weight:bold'>"+txt+"</span>");
	}
}
//brödtext-rubriker.
function txt_head(txt,c){
	txt = txt.toUpperCase();
	if ( MM_FlashCanPlay && wtrans) {
		document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
		document.write('  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
		document.write(' ID="holder" WIDTH="394" HEIGHT="17" ALIGN="">');
		document.write(' <PARAM NAME=movie VALUE="http://www.webaid.se/sv/flash/text_futura_long.swf?txt='+enkode(txt)+'&c=0x'+c+'"> <param name=wmode value=transparent> <PARAM NAME=loop VALUE=false> <PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF>  '); 
		document.write(' <EMBED src="http://www.webaid.se/sv/flash/text_futura_long.swf?txt='+enkode(txt)+'&c=0x'+c+'" loop=false menu=false quality=high bgcolor=#FFFFFF');
		document.write(' swLiveConnect=FALSE WIDTH="394" HEIGHT="17" NAME="holder" wmode="transparent"');
		document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
		document.write(' </EMBED>');
		document.write(' </OBJECT>');
	} else{
		document.write("<span style='color:"+c+"; font-family:arial; font-size:12px; font-weight:bold'>"+txt+"</span>");
	}
}
function enkode(t){
	var newT = ""
	for(i=0;i<t.length;i++){
		if(t.charAt(i)=='Å'){
			newT += '%C3%85'
		}else if(t.charAt(i)=='Ä'){
			newT += '%C3%84'
		}else if(t.charAt(i)=='Ö'){
			newT += '%C3%96'
		}else if(t.charAt(i)=='å'){
			newT += '%C3%A5'
		}else if(t.charAt(i)=='ä'){
			newT += '%C3%A4'
		}else if(t.charAt(i)=='ö'){
			newT += '%C3%B6'
		}else if(t.charAt(i)=='&'){
			newT += '%26'
		}else{
			newT += t.charAt(i)
		}
	}
	return newT
}


//belopp i anmälnings-formulär
var strBelopp = "";
var strBelopp_selected = '';
for(i=300;i>0;i=(i-30)){
	strBelopp+='<option value='+i;
	if(strBelopp_selected==i)strBelopp+=" selected";
	strBelopp+='>'+i+' kr</option>';
};



/** ====================================================================================================================================
 * FlashObject v1.3d: Flash detection and embed - http://blog.deconcept.com/flashobject/
 *
 * FlashObject is (c) 2006 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof com=="undefined"){var com=new Object();}
if(typeof com.deconcept=="undefined"){com.deconcept=new Object();}
if(typeof com.deconcept.util=="undefined"){com.deconcept.util=new Object();}
if(typeof com.deconcept.FlashObjectUtil=="undefined"){com.deconcept.FlashObjectUtil=new Object();}
com.deconcept.FlashObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){
if(!document.createElement||!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"detectflash";
this.skipDetect=com.deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
this.useExpressInstall=_7;
if(_1){this.setAttribute("swf",_1);}
if(id){this.setAttribute("id",id);}
if(w){this.setAttribute("width",w);}
if(h){this.setAttribute("height",h);}
if(_5){this.setAttribute("version",new com.deconcept.PlayerVersion(_5.toString().split(".")));}
this.installedVer=com.deconcept.FlashObjectUtil.getPlayerVersion(this.getAttribute("version"),_7);
if(c){this.addParam("bgcolor",c);}
var q=_8?_8:"high";
this.addParam("quality",q);
var _d=(_9)?_9:window.location;
this.setAttribute("xiRedirectUrl",_d);
this.setAttribute("redirectUrl","");
if(_a){this.setAttribute("redirectUrl",_a);}
};
com.deconcept.FlashObject.prototype={setAttribute:function(_e,_f){
this.attributes[_e]=_f;
},getAttribute:function(_10){
return this.attributes[_10];
},addParam:function(_11,_12){
this.params[_11]=_12;
},getParams:function(){
return this.params;
},addVariable:function(_13,_14){
this.variables[_13]=_14;
},getVariable:function(_15){
return this.variables[_15];
},getVariables:function(){
return this.variables;
},createParamTag:function(n,v){
var p=document.createElement("param");
p.setAttribute("name",n);
p.setAttribute("value",v);
return p;
},getVariablePairs:function(){
var _19=new Array();
var key;
var _1b=this.getVariables();
for(key in _1b){_19.push(key+"="+_1b[key]);}
return _19;
},getFlashHTML:function(){
var _1c="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){
this.addVariable("MMplayerType","PlugIn");
}
_1c="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
_1c+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _1d=this.getParams();
for(var key in _1d){_1c+=[key]+"=\""+_1d[key]+"\" ";}
var _1f=this.getVariablePairs().join("&");
if(_1f.length>0){_1c+="flashvars=\""+_1f+"\"";}
_1c+="/>";
}else{
if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
_1c="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
_1c+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
var _20=this.getParams();
for(var key in _20){_1c+="<param name=\""+key+"\" value=\""+_20[key]+"\" />";}
var _22=this.getVariablePairs().join("&");
if(_22.length>0){_1c+="<param name=\"flashvars\" value=\""+_22+"\" />";
}_1c+="</object>";}
return _1c;
},write:function(_23){
if(this.useExpressInstall){
var _24=new com.deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(_24)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
this.setAttribute("doExpressInstall",true);
this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
document.title=document.title.slice(0,47)+" - Flash Player Installation";
this.addVariable("MMdoctitle",document.title);}
}else{this.setAttribute("doExpressInstall",false);}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
var n=(typeof _23=="string")?document.getElementById(_23):_23;
n.innerHTML=this.getFlashHTML();
}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}}};
com.deconcept.FlashObjectUtil.getPlayerVersion=function(_26,_27){
var _28=new com.deconcept.PlayerVersion(0,0,0);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){_28=new com.deconcept.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
}else{
try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
for(var i=3;axo!=null;i++){
axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);
_28=new com.deconcept.PlayerVersion([i,0,0]);}}
catch(e){}
if(_26&&_28.major>_26.major){return _28;}
if(!_26||((_26.minor!=0||_26.rev!=0)&&_28.major==_26.major)||_28.major!=6||_27){
try{
_28=new com.deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
}catch(e){}}}
return _28;
};
com.deconcept.PlayerVersion=function(_2c){
this.major=parseInt(_2c[0])||0;
this.minor=parseInt(_2c[1])||0;
this.rev=parseInt(_2c[2])||0;
};
com.deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
if(this.major<fv.major){return false;}
if(this.major>fv.major){return true;}
if(this.minor<fv.minor){return false;}
if(this.minor>fv.minor){return true;}
if(this.rev<fv.rev){return false;}
return true;
};
com.deconcept.util={getRequestParameter:function(_2e){
var q=document.location.search||document.location.hash;
if(q){var _30=q.indexOf(_2e+"=");
var _31=(q.indexOf("&",_30)>-1)?q.indexOf("&",_30):q.length;
if(q.length>1&&_30>-1){
return q.substring(q.indexOf("=",_30)+1,_31);}}return "";
},removeChildren:function(n){
while(n.hasChildNodes()){
n.removeChild(n.firstChild);}}};
if(Array.prototype.push==null){
Array.prototype.push=function(_33){
this[this.length]=_33;
return this.length;};}
var getQueryParamValue=com.deconcept.util.getRequestParameter;
var FlashObject=com.deconcept.FlashObject;

