/* konfigureringsscript (c) 2002-2006 Elin Tjerngren/Artopod */

var bgon=true; // för flash - behövs globals
var countFl=0;
var colOn="#ddefef"; // bg-färger till flash
var colOff="#fff";
var pricebox="pricetotal";
// obj
function totalPrice(pr) {
	// prop
	this.pr=pr;
	this.qty=0;
	//this.chPr=chPr;
	this.nicePrice=nicePrice;
}
function nicePrice() { // formatera pris
	return "US$ " + this.pr + " "; 
}
function flashBg() {
	var obj=getPrObj();

	if (bgon) {
		obj.style.backgroundColor=colOn;
	} else {
		obj.style.backgroundColor=colOff;
	}

	if (3<countFl && bgon) {
		countFl=0;
	} else {
		countFl++;
		bgon=!bgon;
		setTimeout("flashBg()",100);
	}
}
function getPrObj() {
	return document.getElementById(pricebox);
}
function padWidth(str) {
	for (j=str.length; j<selectWidth; j++) {
		str+=padCh;
	}
	return str;
}
function getSelectVal(obj) {
	return (-1<obj.selectedIndex) ? obj.options[obj.selectedIndex].value : -1;	
}
function getRadioVal(obj) {
	for (b=0; b<obj.length; b++) {
		if (obj[b].checked)
			return obj[b].value;
	}
	return -1;	
}


