	var flvmoviepath = "";
	var visualpath = "";
	var timer;
	var counter;
	var countindex;
	
	window.onload = function(){
		//QuicklinksTitles();
		//startList();
	}
	
	
	function setBrand(selectedvalue){
		if(selectedvalue=='CreditCard'){
			document.getElementById('brandselect').disabled = "";
		}
		else{
			document.getElementById('brandselect').disabled = "disabled";
		}
	}
	
	
	function loadMovie(moviepath,visual,timeout) {
		window.clearTimeout(timer);
		window.clearInterval(counter);
		if(visual==''){
			flvmoviepath = moviepath;
			loadFLV();
		}
		else{
			var newimg = document.createElement('img');
			newimg.src=visual;
			document.getElementById('flashcontent').innerHTML = '';
			document.getElementById('flashcontent').appendChild(newimg);
			var counterdiv = document.createElement('div');
			counterdiv.id = 'counter';
			document.getElementById('flashcontent').appendChild(counterdiv);
			counterdiv.innerHTML = timeout/1000;
			countindex = timeout/1000;
			counter = window.setInterval('start_clock()',1000)
			flvmoviepath = moviepath;
			timer = window.setTimeout('loadFLV()',timeout);
		}
	}	


	function start_clock() {
		countindex--;
		if(document.getElementById('counter')) document.getElementById('counter').innerHTML = countindex;
	}	


	function loadFLV() {
		if(document.getElementById('flashcontent')) document.getElementById('flashcontent').className = 'flash_bg';
		var so = new SWFObject("/_inc/streaming.swf", "beatbelly", "600", "250", "8", "#ffffff");
		so.addVariable("path", flvmoviepath);
		so.addParam("wmode", "transparent");
		so.write("flashcontent");
		window.clearTimeout(timer);
		window.clearInterval(counter);
	}	


	function QuicklinksTitles(){
		var quicklinks,img;
		quicklinks = document.getElementsByTagName('img');
		for (i=0; i<quicklinks.length; i++) {
			img = quicklinks[i];
			if(img.className=='title'){
				img.onmouseover=function() {
					thisSrc = this.src.substr(0,this.src.length-4);
					this.src = thisSrc + '_over.gif';
				}
				img.onmouseout=function() {
					thisSrc = this.src.substr(0,this.src.length-9);
					this.src = thisSrc + '.gif';
				}
			}
		}
	}


	function procesPrices(){
		var productCheckbox,productAmount,productPrice
		var totalproducts = 0;
		var totalprice = 0;
		for(var i=0;i<productsIDs.length;i++){
			//productCheckbox = document.getElementById('product_'+productsIDs[i]);
			//if(productCheckbox && productCheckbox.checked){
				productPrice = productsprices[i];
				productAmount = document.getElementById('amount_'+productsIDs[i]);
				totalproducts = parseInt(totalproducts) + parseInt(productAmount.options[productAmount.selectedIndex].value);
				totalprice = parseInt(totalprice) + (parseInt(productAmount.options[productAmount.selectedIndex].value) * parseInt(productPrice));
			//}
		}

		document.getElementById('showprice').value = ((totalprice)/100).toFixed(2);
		document.getElementById('amount').value = totalprice;
	}


	function setPrice(selectedvalue,productprice,productid){
		var amount,amountselect,pricevalue;
		checkboxid = 'product_'+productid;
		check = document.getElementById(checkboxid);
		output = 'showprice_'+productid;
		hiddenprice = 'price_'+productid;
		//if(check.checked){
			pricevalue = parseInt(productprice) * parseInt(selectedvalue);
			document.getElementById(output).value = (pricevalue/100).toFixed(2);
			document.getElementById(hiddenprice).value = pricevalue;
			updateTotalPrice(pricevalue);
		//}
	}


	function hoverImage(elmnt){
		//var img = document.createElement('img');
		//img.src = elmnt.src;
		//img.className = 'hover';
		//elmnt.parentNode.appendChild(img);
	}


	function hoverOut(elmnt){
		var imgs = elmnt.parentNode.getElementsByTagName('img');
		for(var i = 0;i<imgs.length;i++){
			if(imgs[i].className == 'hover'){
				//elmnt.parentNode.removeChild(imgs[i]);
			}
		}
	}


	function setProduct(check,productprice,productid){
		var amount,amountselect,pricevalue;
		amountid = 'amount_'+productid;
		amountselect = document.getElementById(amountid);
		output = 'showprice_'+productid;
		hiddenprice = 'price_'+productid;
		//if(check.checked){
			amount = amountselect.options[amountselect.selectedIndex].value;
			pricevalue = parseInt(productprice) * parseInt(amount);
			document.getElementById(output).value = (pricevalue/100).toFixed(2);
			document.getElementById(hiddenprice).value = pricevalue;
			updateTotalPrice(pricevalue);
		//}
	}


	function updateTotalPrice(addamount){
		var totalproducts = 0;
		var totalprice = 0;
		for(var i=0;i<productsIDs.length;i++){
			elmnt = 'price_'+productsIDs[i];
			totalprice = parseInt(totalprice) + parseInt(document.getElementById(elmnt).value);
			product = 'amount_'+productsIDs[i];
			totalproducts = parseInt(totalproducts) + parseInt(document.getElementById(product).value);
		}
		document.getElementById('showbeatbellyprice').value = (totalprice/100).toFixed(2);
		document.getElementById('beatbellyprice').value = totalprice;
		document.getElementById('totalproducts').innerHTML = totalproducts;
		document.getElementById('verzendkosten').value = totalproducts * verzendkosten;
		document.getElementById('showverzendkosten').value = (totalproducts * verzendkosten/100).toFixed(2);

		document.getElementById('showprice').value = (((totalproducts * verzendkosten) + totalprice)/100).toFixed(2);
		document.getElementById('amount').value = (totalproducts * verzendkosten) + totalprice;
	}
	
	
	function popwindow(strURL,windowname,popwidth,popheight,features){
		var strfeatures;
		strfeatures = 'width='+popwidth+',height='+popheight+','+features;
		if(window.screen){
			var WindowLeft = (screen.width-popwidth)/2;
			var WindowTop = (screen.height-popheight)/2;
			strfeatures = 'top='+WindowTop+',left='+WindowLeft+','+strfeatures;
		}
		var openen=window.open(strURL,windowname,strfeatures);
		openen.focus();
		return false;
	}
