window.onload = function()
{
	initButtons();
	initOrderButton();
	initFlashCart();
}


function initOrderButton()
{
	var loBtn = document.getElementById("cmd_OrderNow");
	if(loBtn != null)
	{
		loBtn.onclick = function()
		{
			this.value= "Order wordt verwerkt...";
			this.onclick = function()
			{
				return false;
			}
		}
	}
}


function initButtons()
{
	var loBtns = null;
	try {
		loBtns = document.getElementsByTagName("input");
	} catch(e) {
	}

	if(loBtns == null)
		return;

	var loBtn;
	for(var i=0; i<loBtns.length; i++) {
		loBtn = loBtns.item(i);
		switch(loBtn.className) {
			case "inputbutton":
			case "customerbutton":
			case "artlstaddtobasket":
				loBtn.onmouseover = function(){this.className+='MO'};
				loBtn.onmouseout = function(){this.className=this.className.replace(/MO$/g,'')};
				break;
		}
	}
}


var _iTimer;
var _oSC;
var _iDir = 0;
var _iClrVal = 221;
var _iCount = 0;
function initFlashCart()
{
	if(window.location.href.indexOf('bac=1') < 0)
		return;
	var o = document.getElementById('tdShoppingcart');
	if(o == null)
		return;
	_oSC = o;
	_oSC.style.backgroundColor = '#ffdddd';
	_iTimer = window.setTimeout(flashCart,10);
//alert('jippie! - '+_oSC.style.backgroundColor);
}


function flashCart()
{
	_iClrVal = _iDir==0?_iClrVal-8:_iClrVal+8;
//alert(_iClrVal);

	if(_iClrVal <= 180)
	{
		_iDir = 1;
		_iClrVal = 180;
	}
	else if(_iClrVal >= 255)
	{
		_iDir = 0;
		_iClrVal = 255;
	}

	var lcNewVal = _iClrVal.toString(16);
	if(lcNewVal.length < 2)
		lcNewVal = '0'+lcNewVal;

//_iCount++;
//if(_iCount > 10) return;

	_oSC.style.backgroundColor = '#ff'+lcNewVal+lcNewVal;
//alert(_oSC.style.backgroundColor);
	_iTimer = window.setTimeout(flashCart,128);
}


function pop(url, width, height)
{
	window.open(url,'','width='+width+', height='+height+', menubar=no, status=no, location=no, toolbar=no, scrollbars=no, resizable=no', false);
}


function poppage(url, width, height)
{
	window.open(url,'','width='+width+', height='+height+', menubar=no, status=no, location=no, toolbar=no, scrollbars=yes, resizable=yes', false);
}


function fExpand(tcID)
{
	var o;

	o = document.getElementById('propgroup_'+tcID);
	if(o)
	{
		o.className = 'maximize';
	}

	o = document.getElementById('propgroup_more_'+tcID);
	if(o)
	{
		o.style.display = 'none';
	}
}


function fShrink(tcID)
{
	var o;

	o = document.getElementById('propgroup_'+tcID);
	if(o)
	{
		o.className = 'limit';
	}

	o = document.getElementById('propgroup_more_'+tcID);
	if(o)
	{
		o.style.display = 'block';
	}
}


function fPricebreak(tcID)
{
	var o;

	o = document.getElementById('pricebreak_'+tcID);
	if(o)
	{
		o.style.display = o.style.display=='block'?'none':'block';
	}
}




