window.onload = function()
{
	initOrderButton();
}

function initOrderButton()
{
	var loBtn = document.getElementById("cmd_OrderNow");
	if(loBtn != null)
	{
		loBtn.onclick = function()
		{
			if(this.value == 'Confirm your order')
				this.value= "Order is being processed...";
			else
				this.value= "Order wordt verwerkt...";
			this.onclick = function()
			{
				return false;
			}
		}
	}
}


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 poppage2(url, width, height)
{
	window.open(url,'','width='+width+', height='+height+', menubar=no, status=no, location=yes, 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 showWebgroups(cFilter, cCluster)
{
	var lcHref = window.location.href;
	lcHref = lcHref.toLowerCase();

	if(window.location.href.indexOf("default.asp?") > 1)
	{
		var cHref = window.location.href;
		cHref = cHref.replace(/webgroupfilter\=[0-9,-]+\&?/gi,"");
		cHref = cHref.replace(/alstart\=[^\&]+\&?/gi, "");
		cHref = cHref.replace(/artdetail\=[^\&]+\&?/gi, "");
		cHref = cHref.replace(/clusterfilter\=[^\&]+\&?/gi, "");
		cHref = cHref.replace("?", "?webgroupfilter=" + cFilter + "&");
		window.location.href = cHref;
	}
	else
	{
		window.location.href = "/default.asp?pageid=41&webgroupfilter=" + cFilter ;
	}
}

function showWinks()
{
	document.getElementById('Winkies').style.display=document.getElementById('Winkies').style.display=='none'?'block':'none';
}

function fVerzVerz(tcID)
{
	if(String(tcID) == "verzekerd") {
		var o = document.getElementById('chkOrderPaymentMethod');
		if(o != null) {
			o.value = 'tripledeal';
		}
	}


	try {
		document.getElementById('cmd_RecalcBasket').click();
	} catch(e) {
	}
}

function fShowLargeImage(tiID)
{
	var o;
	for(var i=1; i<=5; i++)
	{
		o = document.getElementById('bigimg'+i);
		if(o != null)
			o.style.display = (tiID==i?'block':'none');
	}
}
