﻿var showingMore = false;

$(document).ready(function() {
	jQuery('li.hiddenFilter').css('display', 'none');
});

function ExpandFilterColumn(obj_id) {
	var obj = jQuery('#' + obj_id);

	if (obj) {
		if (obj.children('li.moreFiltersLink').children('a').text() == "Meer...") {
			if (obj.children('li.hiddenFilter').length > 0) {
				obj.children('li.hiddenFilter').css('display', 'block');
				obj.children('li.moreFiltersLink').children('a').text("Minder...");
			}
		}
		else {
			if (obj.children('li.hiddenFilter').length > 0) {
				obj.children('li.hiddenFilter').css('display', 'none');
				obj.children('li.moreFiltersLink').children('a').text("Meer...");
			}
		}
	}
}

function PrintProduct(obj_id) {

	jQuery(obj_id).openOverlay({ sColor: '#ffffff', iOpacity: 60 });

	var detailBlocks = jQuery('#productlist').children('div');

	for (var i = 0; i <= detailBlocks.length - 1; i++) {
		if (detailBlocks[i].id != obj_id) {
			jQuery(detailBlocks[i]).css('display', 'none');
		}
	}

	window.print();

	setTimeout(function() {
		for (var i = 0; i <= detailBlocks.length - 1; i++) {
			jQuery(detailBlocks[i]).css('display', 'block');
			jQuery(obj_id).openOverlay('close');
		} 
	}, 1500);
}


function ShowSearchDetails(obj_id) {
	var obj = jQuery('#' + obj_id);
	if (obj) {
		PageMethods.ToggleProductSearchContainer(obj_id, true, function(response) {
			obj.slideUp('fast', function() {
				obj.html(response);
				obj.slideDown('slow', function() {
					jQuery('div.producten_uitgeklapt_search').css('border', '1px solid #B62517');
				});
			});
		});
	}

	return false;
}

function HideSearchDetails(obj_id) {
	var obj = jQuery('#' + obj_id);
	if (obj) {
		PageMethods.CreateSearchControlASync(obj_id, function(response) {
			obj.slideUp('fast', function() {
				obj.html(response);
				obj.slideDown('slow', function() {
					jQuery('div.producten_uitgeklapt_search').css('border', '1px solid #B62517');
				});
			});
		});
	}

	return false;
}

$(document).ready(function() {
	jQuery('#shopbanners').children('a').mouseover(function() {
		jQuery(this).children('img').attr('src', jQuery(this).children('img').attr('src').replace('.jpg', '_over.jpg'));
	});

	jQuery('#shopbanners').children('a').mouseout(function() {
		jQuery(this).children('img').attr('src', jQuery(this).children('img').attr('src').replace('_over.jpg', '.jpg'));
	});
});