function change_image(el) {
	var thumbs = $$('#gallery .thumbs a');
	for (var i=0; i < thumbs.length; i++) {
		if (thumbs[i].hasClassName('hover')) {
			thumbs[i].removeClassName('hover');
		};
	};
    var new_image = el.getElementsByTagName('img')[0].src.replace('/small', '/big');
    var title = el.getElementsByTagName('img')[0].alt;
    el.addClassName('hover');
    $('big_img').src = new_image;
    $('big_img').alt = title;
    $('title').innerHTML = title;
}
function redirect_to_colour_page(selectbox) {
    url = window.location.toString();
    if(url.indexOf('colour=')!=-1) {
        new_url = url.replace(/\?.*/, '') + '?page=1&colour=' + selectbox.value;
    } else if(url.indexOf('page=')!=-1) {
        new_url = url + '&colour=' + selectbox.value;
    } else {
        new_url = url.replace(/\?.*/, '') + '?page=1&colour=' + selectbox.value;
    }
    window.location = new_url;
}

function change_gallery_image(el) {
	var thumbs = $$('#newgallery .thumbnails a');
	
	thumbs.invoke('removeClassName', 'hover')
    var new_image = el.getElementsByTagName('img')[0].src.replace('/small', '/big');
    var title = el.getElementsByTagName('img')[0].alt;
    el.addClassName('hover');
    $('big_img').src = new_image;
    
    $('big_img').removeAttribute('width');
    $('big_img').removeAttribute('height');
    
    $('big_img').onload = function () {
    	if ($j.browser.msie) {
    		// Evil IE(both 6 and 7) needs a poke in
    		// order to recalculate bottom css property
	    	$('footer').style.bottom = -1;
	    }
	    $('footer').style.bottom = 0;
    }
    $('big_img').alt = title;
    $('title').innerHTML = title;
}
$j(window).load(function () {
	$('footer').style.bottom = -1;
    $('footer').style.bottom = 0;
});