function submenu()
{
	var items = $$('#submenu .categorie');	
	items.each(function(el, i){
		var assortment = $(el).className.split(' ');
		el.observe('click', function(e){
			$(assortment[1]).style.display = 'block';	
			$('image_'+assortment[1]).src = "images/template/"+assortment[1]+"_small_active.jpg";
			items.each(function(other, j) {
				var active_assortment = $(other).className.split(' ');
				if(i != j) {
					$(active_assortment[1]).style.display = 'none';	
					$('image_'+active_assortment[1]).src = "images/template/"+active_assortment[1]+"_small.jpg";
				}
			});
		});
	});
}

var active_tab = 'information';
var active_zindex = '20';

function tab(id, zindex)
{
	if(active_tab != id)	
	{
		$(active_tab+'_tab').className = 'tab_detail';	
		$(active_tab).style.display = 'none';
		$(active_tab+'_tab').style.zIndex = active_zindex;	
		
		$(id+'_tab').className = 'tab_active';
		$(id).style.display = 'block';
		$(id+'_tab').style.zIndex = '25';
		
		active_zindex = zindex;		
		active_tab = id; 
	}	
}

function shoppingcart(pRequest, pArtikel, pData)
{
	if(pRequest == 'update' || pRequest == 'delete')
	{
		url='request.php';
		new Ajax.Request(url, { 
			method:'post', 
			postBody: 'request=shoppingcart&action='+pRequest+'&artikelID='+pArtikel+'&update=' + pData,
			onSuccess: 
			function(response) {
				document.getElementById('shoppingcart').innerHTML = response.responseText;
			}
			
		});	
	}
}

function setLanguage(pLanguage)
{
	if(pLanguage != '')
	{
		url='request.php';
		new Ajax.Request(url, { 
			method:'post', 
			postBody: 'request=language&language='+pLanguage,
			onSuccess: 
			function() {
				location.href='index.php';
			}		
		});
	}
}

function page(paginaID) {  
	var url = 'http://www.webkey3.nl/cms3/index.php?menuid=' + paginaID;
	try {
				var parent = window.top.topvenster;
	}
	catch(e) {
	}
	if(parent) {
				window.top.location.href = url;
	}
}
function taal(sitename){
	var url = "http://www.webkey3.nl/cms3/index.php?naamw=" + sitename;
	try{
		obj = window.top.topvenster;
	}
	catch(e){
	}
	if(obj){
		window.top.location.href=url;
	}
}
function form(formID) {  
	var url = 'http://www.webkey3.nl/cms3/form.php?action=wijzigen&formid=' + formID;
	try {
				var parent = window.top.topvenster;
	}
	catch(e) {
	}
	if(parent) {
				window.top.location.href = url;
	}
}
function product(artikelID) {  
	var url = 'http://www.webkey3.nl/cms3/yarrah.php?id=' + artikelID;
	try {
				var parent = window.top.topvenster;
	}
	catch(e) {
	}
	if(parent) {
				window.top.location.href = url;
	}
}
