window.onload = function()
{
	initOrderButton();
	fDescweb();
}


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 initOrderButton()
{
	var loBtn = document.getElementById("cmd_OrderNow");
	if(loBtn != null)
	{
		loBtn.onclick = function()
		{
			this.value= "Order wordt verwerkt...";
			this.onclick = function()
			{
				return false;
			}
		}
	}
}

function fDescweb()
{
	var o = document.getElementById('descweb');
	if(!o)
		return;

	var h = o.clientHeight > 0 ? o.clientHeight : o.offsetHeight;

	if(h > 700)
	{
		var oMore = document.getElementById('artdescmore');
		if(!oMore)
			return;

		o.className = "artdesclimit";
		oMore.style.display = 'block';
	}
}

function fDescwebShowHide(tiMode)
{
	var o = document.getElementById('descweb');
	var oMore = document.getElementById('artdescmore');
	var oLess = document.getElementById('artdescless');
	if(!o || !oMore || !oLess)
		return;

	if(tiMode)
	{
		o.className = "artdesclimit";
		oMore.style.display =  'block';
		oLess.style.display = 'none';
	}
	else
	{
		o.className = "artdesc";
		oMore.style.display = 'none';
		oLess.style.display =  'block';
	}
}

function showWebgroups(cFilter, cCluster)
{
	if(window.location.href.toLowerCase().indexOf("default.asp?") > 1)
	{
		var cHref = window.location.href;
		cHref = cHref.replace(/webgroupfilter\=[0-9,-]+\&?/gi,"");
		cHref = cHref.replace(/artdetail\=[^\&]+\&?/gi, "");
		cHref = cHref.replace(/clusterfilter\=[^\&]+\&?/gi, "");
		cHref = cHref.replace("?","?alstart=&webgroupfilter="+cFilter+"&");
		window.location.href = cHref;
	}
	else
	{
		window.location.href = "/default.asp?alstart=0&webgroupfilter="+cFilter;
	}
}



function filterpanel(id)
{
	var element = document.getElementById(id);
	if(element == null)
	{
		return;
	}

	element.fp_init = function()
	{
		var trs = element.getElementsByTagName("div");
		element.filterrow = trs[1];
	}

	element.pf_onmouseover= function(e)
	{
		if(this.timer != 0)
			window.clearTimeout(this.timer);

		this.fp_show();
	}

	element.pf_onmouseout = function(e)
	{
		if(this.timer != 0)
			window.clearTimeout(this.timer);

		this.timer = window.setTimeout("document.getElementById('"+element.id+"').fp_hide()", this.timeout);
	}

	element.fp_show = function()
	{
		if(document.all)
		{
			this.filterrow.style.overflow = "visible";
		}
		else
		{
			this.filterrow.style.overflow = "visible";
		}
	}	

	element.fp_hide = function()
	{
		this.filterrow.style.overflow = "hidden";
	}	

	element.onclick = function()
	{
		if (!e) var e = window.event;
		if(this.pf_onmouseover != null)
			this.pf_onmouseover(e);
	}
	element.onmouseover = function()
	{
		if (!e) var e = window.event;
		if(this.pf_onmouseover != null)
		{
			if(this.timer != 0)
				window.clearTimeout(this.timer);

		}
	}
	element.onmouseout = function()
	{
		if (!e) var e = window.event;
		if(this.pf_onmouseout != null)
			this.pf_onmouseout(e);
	}

	element.timeout = 500;
	element.timer = 0;
	element.filterrow = null;

	element.fp_init();	
}

function showArtdetailImg(newSrc)
{
	var img = document.getElementById("artdetailsimg").getElementsByTagName("img")[0];
	if( img && newSrc)
	{
		//if(newSrc.indexOf("/") > -1)
		//	newSrc = newSrc.substr(newSrc.lastIndexOf("/") + 1);
		var oldSrc = img.src.substr(0, img.src.lastIndexOf("/") + 1 );
document.title = newSrc;
		img.src = newSrc;
	}
}