jQuery(function() {
    
    jQuery("#search_keyword").suggest("/ajax-search/?type=keyword");   
})


jQuery(function() {
jQuery("#suggest").suggest("/ajax-search/",{
onSelect: function() {alert("You selected: " + this.value)}});
});

$(document).ready(function() {
    $('.colour_element').change(function() {
        id = $(this).val();
        element_id = this.id.substring(7);
        
        if (id > 0) {
            $('#delivery_' + element_id).load('/ajax/delivery/'+id+'/')
            $('#price_' + element_id).load('/ajax/price/'+id+'/')
        } else {
            $('#delivery_' + element_id).text('')
            $('#price_' + element_id).text('')
        }
    });	
    
    /*$("#search-keyword").suggest("/ajax-search/?type=keyword");*/
    
    $('#btn_confirm').click(function() {
        if ($('#terms_agreed').is(":checked"))
        {  
            return true;
        } else {
            alert('Please confirm that you have read and agreed to terms and conditions before continuing.');
            return false;
        }
    });
    
    $('#btn_pay_on_account').click(function() {
        if ($('#terms_agreed').is(":checked"))
        {  
            return true;
        } else {
            alert('Please confirm that you have read and agreed to terms and conditions before continuing.');
            return false;
        }
    });
    
    $(".lightbox").lightbox({
        fileLoadingImage : MEDIA_URL + 'js/jquery-lightbox/images/loading.gif',
        fileBottomNavCloseImage : MEDIA_URL + 'js/jquery-lightbox/images/closelabel.gif'
    });
})

function checkout_reload()
{
	location.reload(true);
}