function FixBoxModel(bForce){
	if(!window.external || document.compatMode=="CSS1Compat" || navigator.platform=="MacPPC")
		return;
	for(var i=0, S=document.styleSheets, il=S.length, C, R; i<il; i++){
		C = S[i]; if(!C) continue;
		FixBoxModelCollection( C, bForce );
	}
}

function FixBoxModelCollection( oStyleCol, bForce ){
	var I = oStyleCol.imports;
	for(var a=0, al=(I?I.length:0); a<al; a++){
		FixBoxModelCollection( I[a], bForce );
	}
	var R = oStyleCol.rules; if(!R) return;
	for(var j=0, jl=R.length, CR, CS; j<jl; j++){
		CR = R[j]; if(!CR) continue;
		CS = CR.style; if(!CS) continue;
		FixBoxModelStyle( CS, bForce );
	}
}
function FixBoxModelStyle(oStyle, bForce){
	if(!oStyle || (oStyle.FixBoxModelDone&&!bForce)) return;
	var p = FixBoxModel_parseInt;
	var re = /([.0-9]*)(.+)/;
	var r = oStyle.width.match(re);
	if(r && r[2].toLowerCase()!='auto') {
		var cWidth = p(r[1]), uWidth=r[2];
		var wBorder = p(oStyle.borderLeftWidth) + p(oStyle.borderRightWidth);
		var wPadding = p(oStyle.paddingLeft) + p(oStyle.paddingRight);
		if(wBorder>0||wPadding>0) oStyle.width = (cWidth + wBorder + wPadding) + uWidth;
	}
	r = oStyle.height.match(re);
	if(r && r[2].toLowerCase()!='auto') {
		var cHeight = p(r[1]), uHeight = r[2];
		var hBorder = p(oStyle.borderTopWidth) + p(oStyle.borderBottomWidth);
		var hPadding = p(oStyle.paddingTop) + p(oStyle.paddingBottom);
		if(hBorder>0||hPadding>0) oStyle.height = (cHeight + hBorder + hPadding) + uHeight;
	}
	oStyle.FixBoxModelDone = true;
}
function FixBoxModel_parseInt(s){
	return parseInt(s)||0;
}
FixBoxModel();

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_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function jumpPage(newLoc)
{
	newPage = newLoc.options[newLoc.selectedIndex].value;
	if (newPage != ""){
		window.location = newPage
	}
}

function openPopUp(theURL,winName,features) {
  window.open(theURL,winName,features);
}
function validate(item)
{
    trim(item.CiRestriction);
    var txt = item.CiRestriction.value;
    if(txt.length == 0)
    {
        alert("Behaga skriver in ett s\u00f6kande ben\u00E4mner för att utf\u00f6ra ett s\u00f6kande.");
        return false;
    }
    newArray = txt.match(/[a-zA-Z\u00c0-\u01ffa0-9 *]+/gi);
    if((newArray.length > 1) || (newArray[0].length != txt.length))
    {
        alert("Behaga alfabetiska tecken f\u00f6r bruk eller numrerar i s\u00f6kandet ben\u00E4mner.\nBehaga bruk a * att utf\u00f6ra s\u00f6kanden f\u00f6r wild kort.\n");
        return false;
    }
    return true;
} // end check

function trim(field)
{
    if(field.value != "")
    {
        // left trim
        while(field.value.charAt(0) == " ")
        {
            field.value = field.value.substring(1,field.value.length);
        }
        // right trim
        while(field.value.charAt(field.value.length-1) == " ")
        {
            field.value = field.value.substring(0,field.value.length-1);
        }
    } // end if
} // end trim

function resize() {
	if(document.getElementById('quote')) {
		document.getElementById('header').style.width = 360 + 'px';
		alert(document.getElementById('header').offsetHeight);
		if(document.getElementById('header').offsetHeight>41) {
		document.getElementById('quote').style.bottom=50+'px';
		}
		document.getElementById('quote').style.marginBottom = document.getElementById('body').offsetHeight - document.getElementById('quote').offsetHeight + 'px'; 
	}
}



function cd(el) {
  if (el.defaultValue==el.value) el.value = ""
  }