if (document.images) {
    name1on   = new Image(); name1on.src  = '/img/alg/th_ok_on.gif'; 
    name1off  = new Image(); name1off.src  = '/img/alg/th_ok_off.gif';
}

function swapOn(name) {
   if (document.images)
        document.images[name].src = '/img/alg/th_ok_on.gif';
}
function swapOff(name) {
   if (document.images)
        document.images[name].src = '/img/alg/th_ok_off.gif';
}

var s;

function imgout(id){
  if (document.images) { s = document.images[id].src.substring(0, (document.images[id].src.indexOf('_o.gif'))) + '.gif'; document.images[id].src=s; }
}
function imgover(id){
  if (document.images) { s = document.images[id].src.substring(0, (document.images[id].src.indexOf('.gif'))) + '_o.gif'; document.images[id].src=s; }
}

// open popup: OpenPopup('pagina.html',300,400,1)
function OpenPopup(pagina,name,breed,hoog,scrol) {
  window.open(pagina,''+name+'','width='+breed+',height='+hoog+',status=no,toolbar=no,menubar=no,scrollbars='+scrol+',resizable=no,top=40,left=50');
}

function gohome() {
	window.top.location.href = '/index.php';
}

function goSearch() {
	window.location.href = 'index.php?search='+document.getElementById('zoek').value;
}

function wstToggleExpandSearch() {
	
	if (document.getElementById('wst_row_expand').style.display == '') {

		document.getElementById('wst_row_year').style.display = '';
		document.getElementById('wst_row_country').style.display = '';
		document.getElementById('wst_row_province').style.display = '';
		document.getElementById('wst_row_category').style.display = '';
		document.getElementById('wst_row_grapetype').style.display = '';
		document.getElementById('wst_row_price').style.display = '';
		document.getElementById('wst_row_keywords').style.display = '';	
		document.getElementById('wst_row_expand').style.display = 'none';
		document.getElementById('wst_row_collapse').style.display = '';
		document.getElementById('wst_extended').value = 'yes';
		
	} else {
	
		document.getElementById('wst_row_year').style.display = 'none';
		document.getElementById('wst_row_country').style.display = 'none';
		document.getElementById('wst_row_province').style.display = 'none';
		document.getElementById('wst_row_category').style.display = 'none';
		document.getElementById('wst_row_grapetype').style.display = 'none';
		document.getElementById('wst_row_price').style.display = 'none';
		document.getElementById('wst_row_keywords').style.display = 'none';	
		document.getElementById('wst_row_expand').style.display = '';
		document.getElementById('wst_row_collapse').style.display = 'none';
		document.getElementById('wst_extended').value = '';
		
	}	

}

function showorderlines(orderid) {
	
	document.getElementById('orderlines_' + orderid).style.display = '';
	document.getElementById('expand_' + orderid).style.display = 'none';
	document.getElementById('collapse_' + orderid).style.display = '';
	
}

function hideorderlines(orderid) {
	
	document.getElementById('orderlines_' + orderid).style.display = 'none';
	document.getElementById('expand_' + orderid).style.display = '';
	document.getElementById('collapse_' + orderid).style.display = 'none';
	
}

function ratingInfo() {
	window.open('/rateinfo.php', '', 'width=250, height=300, scrollbars=no,resizable=no,statusbar=no,menubar=no');
}

function articleInfo(art_id) {
	
	if (!isNaN(art_id)) window.open('/artinfo.php?artid=' + art_id, '', 'width=250, height=250, scrollbars=no,resizable=no,statusbar=no,menubar=no');
	
}

function order(amt) {

	if (amt > 450) {
		alert('Let op! In verband met de beveiliging van de betalingstransacties neemt WijnPlaza bestellingen aan tot maximaal € 450,-. Wij verzoeken u uw bestelling aan te passen.');
	} else {
		window.location.href='order.php';
	}
	
}
