window.onload = function()
{
}


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 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');
	}
}


function fYouTube(tlShow,tcID)
{
	var o = document.getElementById('youtubemovie');
	if(tlShow)
	{
		o.style.display = 'block';
		o.innerHTML = 
			'<object width="480" height="385">'
			+'<param name="movie" value="http://www.youtube.com/v/'+tcID+'"></param>'
			+'<param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param>'
			+'<embed src="http://www.youtube.com/v/'+tcID+'" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed>'
			+'</object>'
			+'<div style="text-align:right;cursor:pointer;color:#fff;background-color:#c00;padding:6px;">[ close ]</div>'
			;
	}
	else
	{
		o.style.display = 'none';
		o.innerHTML = 'Loading video..';
	}
}


function ShowDetailTab(toCur, tiID)
{
	for(var i=0; i<10; i++)
	{
		var o = document.getElementById('detailtab'+String(i));
		if(o != null)
			o.style.display = 'none';
		var o = document.getElementById('tabitem'+String(i));
		if(o != null)
			o.className = 'tabitem';
	}

	var o = document.getElementById('detailtab'+String(tiID));
	if(o != null)
		o.style.display = 'block';

	toCur.className = 'tabitem active';
}


function fArtScore(tnID)
{
	var rating = document.getElementById('txt_UserArtReview_Rating');
	if(rating == null)
		return;
	rating.value = tnID;

	var o;
	for(var i=1; i<=5; i++) {
		o = document.getElementById('artscore_'+i);
		if(o == null)
			continue;
		if(i <= tnID)
			o.src = o.src.replace(/star-out.png/ig,'star.png');
		else
			o.src = o.src.replace(/star.png/ig,'star-out.png');
	}
}


function fArtSlideScore(tnID)
{
	var o;
	for(var i=1; i<=5; i++) {
		o = document.getElementById('artscore_'+i);
		if(o == null)
			continue;
		if(i <= tnID)
			o.src = o.src.replace(/star-out.png/ig,'star.png');
		else
			o.src = o.src.replace(/star.png/ig,'star-out.png');
	}
}


function fArtReslide()
{
	var rating = document.getElementById('txt_UserArtReview_Rating');
	if(rating == null)
		return;

	var o;
	for(var i=1; i<=5; i++) {
		o = document.getElementById('artscore_'+i);
		if(o == null)
			continue;
		if(i <= rating.value)
			o.src = o.src.replace(/star-out.png/ig,'star.png');
		else
			o.src = o.src.replace(/star.png/ig,'star-out.png');
	}
}


function closeAllGroupMenusBut(id, quick)
{
	window.clearTimeout( $("div#groupmenubar").data("timer") );
	if(quick)
		$("div.groupmenu:not(div#" + id + ")").hide();
	else
		$("div.groupmenu:not(div#" + id + ")").slideUp();
}




/**
 * Stuff for article property filters - horizontal
 */

/** obsoleted

aFilters = new Array();
aActiveFilters = new Array();


function fPopFilter(tcPG,tcVal)
{
	for(var i=0; i<aFilters.length; i++) {
		if(aFilters[i][0] == tcPG) {
			var re = new RegExp('\\|'+tcVal+'\\|','gi');
			aFilters[i][1] = aFilters[i][1].replace(re,'|');
			if(aFilters[i][1] == '|') {
				aFilters[i][1] = "";
			}
			break;
		}
	}
}


function fPushFilter(tcPG,tcVal)
{
	tcVal = tcVal.replace(/&/g,'&');

	var llHit = false;
	for(var i=0; i<aFilters.length; i++) {
		if(aFilters[i][0] == tcPG) {
			if(aFilters[i][1].substr(aFilters[i][1].length-1) != '|') {
				aFilters[i][1] += '|';
			}
			aFilters[i][1] += tcVal+'|';
			llHit = true;
			break;
		}
	}
	if(! llHit) {
		aFilters.push([tcPG,'|'+tcVal+'|']);
	}
}


function fAlterFilter(tlSel,tcPG,tcVal)
{
	if(tlSel) {
		fPushFilter(tcPG,tcVal);
	} else {
		fPopFilter(tcPG,tcVal);
	}
}


function fSetFilters()
{
	var lcURL = window.location.href;
	for(var i=0; i<aActiveFilters.length; i++) {
		var re = new RegExp('(&|\\?)'+aActiveFilters[i]+'=([^&]*)','gi');
		lcURL = lcURL.replace(re,'$1');
	}
	if(lcURL.indexOf('?') < 0) {
		lcURL += '?';
	}
	for(var i=0; i<aFilters.length; i++) {
		if(aFilters[i][1] != "") {
			lcURL += '&'+encodeURIComponent(aFilters[i][0])+'='+encodeURIComponent(aFilters[i][1].substr(1,aFilters[i][1].length-2));
		}
	}
	lcURL = lcURL.replace(/\?&+/g,'?');
	lcURL = lcURL.replace(/\&+/gi,'&');
	lcURL = lcURL.replace(/%7C/ig,'|');
	lcURL = lcURL.replace(/alstart=[^&]+&?/ig,'');
	window.location.href = lcURL;
}


function fEraseFilters()
{
	var lcURL = window.location.href;
	for(var i=0; i<aActiveFilters.length; i++) {
		var re = new RegExp('(&|\\?)'+aActiveFilters[i]+'=([^&]*)','gi');
		lcURL = lcURL.replace(re,'');
	}
	lcURL = lcURL.replace(/\?&+/g,'?');
	lcURL = lcURL.replace(/\?$/g,'');
	lcURL = lcURL.replace(/alstart=[^&]+&?/ig,'');
	window.location.href = lcURL;
}

end obsoleted **/

/**
 * END - Stuff for article property filters - horizontal
 */



/**
 * Stuff for article property filters - vertical
 */

var filterUrl = window.location.href;
var newFilters = new Array();
var newFilterKeys = new Array();

function setFilters()
{
	filterUrl = String(window.location.href);
	filterUrl = filterUrl.replace(/alstart=\d+&*/,'');

	var newFilters = new Array();
	var newFilterKeys = new Array();

	$('.filtercheckbox').each(

		function()
		{
			lcRE = this.name.replace(/[^a-z0-9]/ig,'(.+?)')+'=([^&]*)&?';
			var re = new RegExp(lcRE,'g'); 
			filterUrl = filterUrl.replace(re,'');
			
			if(this.checked)
			{
				if(typeof(newFilters[this.name]) == "string")
				{
					newFilters[this.name] += "|" + this.value;
				}
				else
				{
					newFilters[this.name] = this.value;
					newFilterKeys.push(this.name);
				}
			}
		}
	)	

	if(filterUrl.indexOf("?") == -1)
		filterUrl += "?";

	for(var n=0; n<newFilterKeys.length; n++)
	{
		filterUrl = filterUrl.replace("?","?" + encodeURIComponent(newFilterKeys[n]) + "=" + encodeURIComponent(newFilters[newFilterKeys[n]]) + "&");
	}

	window.location.href = filterUrl;
}


function clearFilter(name)
{
	$('.filtercheckbox[name="'+name+'"]').each(
		function(){ this.checked = false;}
	);
	setFilters();
}


/**
 * END - Stuff for article property filters - vertical
 */

