			
function initPage(){
	var uaSniff = new RegExp("MSIE 6.0;");
	
	if(navigator.userAgent.toString().match(uaSniff)){
		JSPos.init();
	}
	
	eNummerCheck_cs.init();
}

var eNummerCheck_cs = {
	init : function(){
		
		if(document.getElementById("ctl00_FriSokning1_eSok")){
			he.addEvent("keyup",eNummerCheck_cs.check,false,"ctl00_FriSokning1_eSok");
		}
	},
	check : function(){
		var et = this;
		if(window.event && window.event.srcElement){
			et = window.event.srcElement
		}
		if(et.value.toString().match(/[^\d]/)){
			et.value = et.value.toString().replace(/[^\d]/g,"");
		}
		
	}
}

function submitForm(){
    document.aspnetForm.submit();
}

var JSPos = {
    cCols : ["midLeft","midMid","midRight"], // These columns will end up having the same height...
    cColsHeight : [],
    hc : null, // Highest Column 
    init : function(){
        this.cols();
        //this.setESearch();
        //this.addr();
    },
    cols : function(){
        // liquid (div) height. 2007-04-26 (YYYY-MM-DD)
        // This is not the best solution, but it works (as long as JavaScript is enabled...)
        for(i=0;i<this.cCols.length;i++){
            he.get(this.cCols[i]);
            // get the highest div
            if(!this.hc || he.ce.clientHeight > this.hc){
                this.hc = he.ce.clientHeight;
            }
        }
        for(i=0;i<this.cCols.length;i++){
            // set the selected divs (this.cCols) to the same height
            if(he.cbc == "className"){
                // IE
                he.get(this.cCols[i]);
                he.ce.style.height = this.hc + "px";
            }
            else{
                // Mozilla, Opera
                he.setAttr("style","height:" + this.hc + "px",this.cCols[i]);
            }
        }
        
    },
    setESearch : function(){
        // (inline) positioning with Javascript... hmmm :(
        
        he.getTarget("leftColMenu");
        he.getParent("eNummerSok");
        he.get("eNummerSok");
        
        he.ce.style.top = parseInt(30+(he.pn.offsetHeight-30)-parseInt(he.te.offsetHeight+he.ce.offsetHeight,10),10) + "px";
        
    },
    addr : function(){
        he.getTarget("content");
        he.getParent("segAddr");
        he.get("segAddr");
        
        he.ce.style.top = parseInt((he.pn.offsetHeight-30)-parseInt(he.te.offsetHeight+he.ce.offsetHeight,10),10) + "px";
        
    }
}
//For Validation of E-nummer
  function validateLength(oSrc, args){
  
	/* if(args.Value.toString().match(/^\d{7}$/)){args.IsValid = true;} else{args.IsValid = false;} */
  
  
 if((args.Value.length == 7) && (!isNaN(args.Value)))
        args.IsValid = true
  else
        args.IsValid = false;

}

he.addEvent("load",initPage,false,window);