window.onload = function()
{
	initButtons();
	initOrderButton();
	focusSearchField();
}

function focusSearchField()
{
	var o = document.getElementById('SearchField');
	if(o == null)
		return;
	o.focus();
}

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 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":
			case "artlstaddtofavorites":
				loBtn.onmouseover = function(){this.className+='MO'};
				loBtn.onmouseout = function(){this.className=this.className.replace(/MO$/g,'')};
				break;
		}
	}
}

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 fChangeCustType(tcType)
{
	switch(tcType)
	{
		case "z": window.location.href = window.location.href.replace(/&docid=\d+/,''); break;
		case "p": window.location.href += '&docid=210'; break;
	}
}