	function printContent() {
		
		var contentObj = document.getElementById("content_cell");
		
		if( contentObj ) {
			var winId = window.open('','printwin','width=640,height=600,scrollbars=yes'); 
				winId.document.write('<html>\n<head>\n<title>BRL Electronics</title>\n<link href="/styles.css" rel="stylesheet" type="text/css">\n\n<style type="text/css">\nBODY{ background-color: #FFFFFF; margin: 40px;}\n</style>\n</head>\n<body><img src="/images/common/logoTop.gif" alt="BRL Electronics"><br><br>' + contentObj.innerHTML + '\n</body>\</html>'); 
				winId.document.close(); 
				winId.focus(); 
			if (window.print) winId.print();
		}
		else {
			alert('Your web browser does not support this function');
		}
	}

	function openWindow( url, w, h, resize ){
		window.open( url, "support", "width=" + w + ",height=" + h + ",resizable=" + resize + ";" );
	}
	
// ################# ÅSAS SCRIPT ################# //
	function round(number,X) {
		// rounds number to X decimal places, defaults to 2
		X = (!X ? 2 : X);
		return Math.round(number*Math.pow(10,X))/Math.pow(10,X);
	}
	
	function ladvolym() {
		var volym_lada = (eval(document.form_ladvolym.bredd_lada.value) * eval(document.form_ladvolym.hojd_lada.value) * eval(document.form_ladvolym.djup_lada.value)) / 1000000;
		document.form_ladvolym.ladvolymen.value = round(volym_lada,3); 
	}
	
	function laddjup() {
		var djup_lada = (eval(document.form_laddjup.volym_2_lada.value)*1000000) / (eval(document.form_laddjup.bredd_2_lada.value) * eval(document.form_laddjup.hojd_2_lada.value));
		document.form_laddjup.laddjupet.value = round(djup_lada,3); 
	}
	
	function init_ladvolym(){
		document.form_ladvolym.reset();
		document.form_ladvolym.bredd_lada.focus();
	}
	
	function init_laddjup(){
		document.form_laddjup.reset();
		document.form_laddjup.volym_2_lada.focus();
	}
	
	function trapetsvolym() {
		var area_trapets = ((eval(document.form_trapetsvolym.bredd_trapets.value) + eval(document.form_trapetsvolym.abredd_trapets.value)) * eval(document.form_trapetsvolym.hojd_trapets.value)) /2
		var volym_trapets = (eval(area_trapets) * eval(document.form_trapetsvolym.djup_trapets.value)) / 1000000;
		document.form_trapetsvolym.trapetsvolymen.value = round(volym_trapets,3); 
	}
	
	function init_trapvolym(){
		document.form_trapvolym.reset();
		document.form_trapvolym.hojd_trap.focus();
	}
	
	function cylindervolym() {
		var volym_cylinder = (eval(document.form_cylindervolym.radie_cylinder.value) * eval(document.form_cylindervolym.radie_cylinder.value) * Math.PI * eval(document.form_cylindervolym.hojd_cylinder.value) * eval(document.form_cylindervolym.antal_cylindrar.value)) / 1000000;
		document.form_cylindervolym.cylindervolymen.value = round(volym_cylinder,3); 
	}
	
	function init_cylindervolym(){
		document.form_cylindervolym.reset();
		document.form_cylindervolym.radie_cylinder.focus();
	}
	
	function resistans(form) {
		a = eval(form.I.value);
		b = eval(form.U.value);
		c = b/a;
		form.R.value = round(c,3);
	}
	
	function strom(form) {
		c = eval(form.R.value);
		b = eval(form.U.value);
		a = b/c;
		form.I.value = round(a,3);
	}
	
	function spanning(form) {
		c = eval(form.R.value);
		a = eval(form.I.value);
		b = c*a;
		form.U.value = round(b,3);
	}
	
	function init_ohmslag(){
		document.form_ohmslag.reset();
		document.form_ohmslag.I.focus();
	}
	
	function vaglangd() {
		var vaglangd_ljud = (eval(document.form_vaglangd.hastighet_ljud.value) / eval(document.form_vaglangd.frekvens_ljud.value));
		document.form_vaglangd.vaglangden_ljud.value = round(vaglangd_ljud,3); 
	}
	
	function init_vaglangd(){
		document.form_vaglangd.reset();
		document.form_vaglangd.hastighet_ljud.focus();
	}
	
	function motstand_parallell() {
		var parallell_inv = (eval(document.form_motstand.antal_basar.value) / eval(document.form_motstand.motstand_basar.value));
		var parallell = 1/(parallell_inv)
		document.form_motstand.parallell_motstand.value = round(parallell,3); 
	}
	
	function motstand_serie() {
		var serie = (eval(document.form_motstand.antal_basar.value) * eval(document.form_motstand.motstand_basar.value));
		document.form_motstand.serie_motstand.value = round(serie,3); 
	}
	
	function init_motstand(){
		document.form_motstand.reset();
		document.form_motstand.motstand_basar.focus();
	}
	
	function filter6dB_hogpass() {
		var hogpass6dB = 157000 / (eval(document.form_6dBhogpass.delning_hogpass6dB.value) * eval(document.form_6dBhogpass.resistans_hogpass6dB.value));
		document.form_6dBhogpass.kapacitans_hogpass6dB.value = round(hogpass6dB ,3); 
	}
	
	function filter6dB_lagpass() {
		var lagpass6dB = (eval(document.form_6dBlagpass.resistans_lagpass6dB.value) * 1000) / (6.28 * eval(document.form_6dBlagpass.delning_lagpass6dB.value));
		document.form_6dBlagpass.induktans_lagpass6dB.value = round(lagpass6dB,3); 
	}
	
	function init_6dBlagpass(){
		document.form_6dBlagpass.reset();
		document.form_6dBlagpass.delning_lagpass6dB.focus();
	}
	
	function init_6dBhogpass(){
		document.form_6dBhogpass.reset();
		document.form_6dBhogpass.delning_hogpass6dB.focus();
	}
	
	function filter12dB_induktans_1() {
		var filter1_12dB_induktans = (eval(document.form_12dB_1.resistans_12dB_1.value) * 225) / (eval(document.form_12dB_1.delning_12dB_1.value));
		document.form_12dB_1.induktans_12dB_1.value = round(filter1_12dB_induktans,3); 
	}
	
	function filter12dB_kapacitans_1() {
		var filter1_12dB_kapacitans = 112000/(eval(document.form_12dB_1.resistans_12dB_1.value) * eval(document.form_12dB_1.delning_12dB_1.value));
		document.form_12dB_1.kapacitans_12dB_1.value = round(filter1_12dB_kapacitans,3); 
	}
	
	function init_filter12dB_1(){
		document.form_12dB_1.reset();
		document.form_12dB_1.delning_12dB_1.focus();
	}

	function filter12dB_induktans_2() {
		var filter2_12dB_induktans = (eval(document.form_12dB_2.resistans_12dB_2.value) * 225) / (eval(document.form_12dB_2.delning_12dB_2.value));
		document.form_12dB_2.induktans_12dB_2.value = round(filter2_12dB_induktans,3); 
	}
	
	function filter12dB_kapacitans_2() {
		var filter2_12dB_kapacitans = 112000/(eval(document.form_12dB_2.resistans_12dB_2.value) * eval(document.form_12dB_2.delning_12dB_2.value));
		document.form_12dB_2.kapacitans_12dB_2.value = round(filter2_12dB_kapacitans,3); 
	}
	
	function init_filter12dB_2(){
		document.form_12dB_2.reset();
		document.form_12dB_2.delning_12dB_2.focus();
	}
	
	// ################# ÅSAS SCRIPT END ################# //
	
	function checkBrowser() {
		this.ver 	=	navigator.appVersion;
		this.agent 	=	navigator.userAgent;
		this.dom 	=	document.getElementById ? 1 : 0;
		this.opera5 =	this.agent.indexOf( "Opera 5" ) >- 1;
		this.ie5 	=	( this.ver.indexOf( "MSIE 5" ) >- 1 && this.dom && !this.opera5 ) ? 1 : 0; 
		this.ie6 	=	( this.ver.indexOf( "MSIE 6" ) >- 1 && this.dom && !this.opera5 ) ? 1 : 0;
		this.ie4 	=	( document.all && !this.dom && !this.opera5 ) ? 1 : 0;
		this.ie 	=	this.ie4 || this.ie5 || this.ie6;
		this.mac 	=	this.agent.indexOf( "Mac" ) >- 1;
		this.ns6 	=	( this.dom && parseInt( this.ver ) >= 5) ? 1 : 0; 
		this.ns4 	=	( document.layers && !this.dom ) ? 1 : 0;
		this.bw 	=	( this.ie6 || this.ie5 || this.ie4 || this.ns4|| this.ns6 || this.opera5 );
		return this;
	}
	
	var bw = new checkBrowser();
	var image_index = 0;
	var image_list = new Array();
	var xl_image_list = new Array();
	
	function setImages(){
		for( i = 0; i < setImages.arguments.length; i++ ){
			image_list[i] = new Image();
			image_list[i].src = setImages.arguments[i];
		}
	}
	
	function setXLImages(){
		for( i = 0; i < setXLImages.arguments.length; i++ ){
			xl_image_list[i] = setXLImages.arguments[i];
		}
	}
	
	function changeImage( dir, obj ){
		image_index += dir;
		if( image_index == image_list.length ){
			image_index = 0;
		} else if( image_index == -1 ){
			image_index = image_list.length-1;
		}
		
		if( bw.dom ){
			document.getElementById("p_image").src = image_list[image_index].src;
			document.getElementById("pic_num").innerHTML = image_index + 1;
		} else {
			document.images['p_image'].src = image_list[image_index].src;
		}
	}
	
	
	function showXL(){
		
		var src = "";
		if( bw.dom ){
			src = document.getElementById("p_image").src
		} else {
			src = document.images['p_image'].src
		}
		if( src == "" ) return;
		var path = src.split("/");
		var img = path[path.length-1];
		
		var exists = false;
		for( i = 0; i < xl_image_list.length; i++ ){
			if( xl_image_list[i] == img ){
				exists = true;
				break;
			}
		}
		if( exists ){
			window.open( "xlimage.aspx?img=" + img, "XLBild", "width=250,height=250,resizable=1,status=no;" );
		}
	}
