

function post_to_url(path, params, method) {
    method = method || "post"; // Set method to post by default, if not specified.

    // The rest of this code assumes you are not using a library.
    // It can be made less wordy if you use one.
    var form = document.createElement("form");
    form.setAttribute("method", method);
    form.setAttribute("action", path);

    for(var key in params) {
        var hiddenField = document.createElement("input");
        hiddenField.setAttribute("type", "hidden");
        hiddenField.setAttribute("name", key);
        hiddenField.setAttribute("value", params[key]);

        form.appendChild(hiddenField);
    }

    document.body.appendChild(form);    // Not entirely sure if this is necessary
    form.submit();
}


jQuery(document).ready(function(){

jQuery('#delivery').change(function(){

	delive = jQuery(this).val();
	
	post_to_url('/basket/', {'delivery':delive});
	
	//window.location = "?delivery="+delive+"";

})

jQuery('.product').change(function(){

	delive = jQuery(this).val();
	id = jQuery(this).attr('id');	
	post_to_url('/basket/', {'additionid':delive,'prodid':id});
	
	//window.location = "?delivery="+delive+"";

})


jQuery('#gallery_detail_text button').hover(function(){


	jQuery(this).css('background-position','top left');

},function(){


	jQuery(this).css('background-position','top right');

})


jQuery('button#next').hover(function(){

	jQuery(this).find('img').attr('src','/images/next_hover.gif');

},function(){
	jQuery(this).find('img').attr('src','/images/next_s.gif');


})


jQuery('img#continue_left').hover(function(){

	jQuery(this).attr('src','/images/continue_to_payment_hover.gif');

},function(){
	jQuery(this).attr('src','/images/continue_to_payment.gif');


})



jQuery('button#continue_lefts').hover(function(){



	jQuery(this).find('img').attr('src','/images/continue_to_payment_hover.gif');

},function(){
	jQuery(this).find('img').attr('src','/images/continue_to_payment.gif');


})

jQuery('img#next_left').hover(function(){

	jQuery(this).attr('src','/images/next_left_hover.gif');

},function(){
	jQuery(this).attr('src','/images/next_left.gif');


})

jQuery('button#next_lefts').hover(function(){

	jQuery(this).find('img').attr('src','/images/next_left_hover.gif');

},function(){
	jQuery(this).find('img').attr('src','/images/next_left.gif');


})

jQuery('td.options a').hover(function(){

	jQuery(this).find('img').attr('src','/images/remove_hover.gif')

},function(){

	jQuery(this).find('img').attr('src','/images/remove.gif')

})

jQuery('a').attr('title','');

jQuery('#gallery_section').click(function(){


	window.location = "/gallery/";

});

jQuery('#news_section').click(function(){


window.location = "/events/";

});

});



function content(id){

jQuery('#main_images li').hide();
jQuery('#pen'+id).fadeIn(200);

}


