function open_blog(blog_id){
	Effect.BlindUp('blog_'+blog_id);
	Effect.BlindDown('blog_open_'+blog_id ); 
}

function close_blog(blog_id){
	Effect.BlindDown('blog_'+blog_id);
	Effect.BlindUp('blog_open_'+blog_id); 
}

function new_page(cat_id, from, page){
	new Ajax.Updater(
		'content',
		'site/next_blog_page.php',
		{
			method: 'post',
			parameters: "cat_id="+ cat_id +"&from="+ from +"&page="+ page,
			requestHeaders: ['Expires', 'Thu, 16 May 2001 10:10:10 GMT', 'Cache-Control', 'no-cache, must-revalidate', 'Pragma', 'no-cache'],
			evalScripts: true
		});
}

function new_dj_page(mid, start, perpage){
	new Ajax.Updater(
		'persoonlijke_blog',
		'site/next_dj_page.php',
		{
			method: 'post',
			parameters: "mid="+ mid +"&start="+ start +"&perpage="+ perpage,
			requestHeaders: ['Expires', 'Thu, 16 May 2001 10:10:10 GMT', 'Cache-Control', 'no-cache, must-revalidate', 'Pragma', 'no-cache'],
			evalScripts: true
		});
}

function remove_basket(id, size) {
	new Ajax.Request(
		'products.html',
		{
			method: 'post',
			parameters: "basket_action=remove&product_id="+id+"&size="+size,
			evalScripts: true
		});
	$('total').update(($('total').innerHTML - $('basket'+id).readAttribute('price')).toFixed(2));
	$('basket'+id).remove();
}

function toggle_basket() {
	$('basket').toggle();
	return false;
}

function get_search() {
	//var search_var = Form.serialize('search_form');
	//alert(search_var);
	$('search_form').submit();
}

function send_contact() {
	if($('cf_contact_form').onsubmit())
		$('cf_contact_form').submit()
}

function get_kb() {
	$('kb_form').submit();
}

function gotoBrand() {
	window.location = "products.html?merk="+$F('selectbrand');
}

function gotoProducts() {
	window.location = "products.html?merk="+$F('selectbrand')+"&groep="+$F('selectgroup')+"&type="+$F('selecttype');
}

function recount(page) {
	if(!page) {
		page = 'checkout.html';
	}
	$('checkout').writeAttribute('action', page);
	$('save').remove();
	$('checkout').insert('<input type="hidden" name="basket_action" value="update" />');
}

function bookmarksite(title,url){
	if (window.sidebar) { // firefox
		window.sidebar.addPanel(title, url, "");
	} else if(window.opera && window.print) { // opera
		var elem = document.createElement('a');
		elem.setAttribute('href',url);
		elem.setAttribute('title',title);
		elem.setAttribute('rel','sidebar');
		elem.click();
	} else if(document.all) { // ie
		window.external.AddFavorite(url, title);
	}
}

function clearthis(el) {
	if($(el).readAttribute("clear") != "true") {
	$(el).clear();
	$(el).writeAttribute("clear", "true");
	}
}

function setimg(target, img, caption) {
	$(target).writeAttribute("src",img);
	$(target).writeAttribute("alt", caption);
	$(target).writeAttribute("title", caption);
}

function submitCode() {
	location.href = "checkout2.html?hash="+$F('code');
}

function hideMe(elm) {
	$$('.morepics').each(function(element) {
		element.show();
	});
	elm.hide();
}

function swap(elm, img) {
	elm.writeAttribute("src", img);
}