function showCheckout() {
	
	jQuery('.backtoshopping').hide();
	jQuery('.backtoreadymade').hide();
	jQuery('#thecheckout').show();
	jQuery('#thebasket').hide();
	jQuery('.basketbutton').show();
	jQuery('.checkoutbutton').hide();
}

function showBasket() {

	jQuery('.backtoshopping').show();
	jQuery('.backtoreadymade').show();
	jQuery('#thecheckout').hide();
	jQuery('#thebasket').show();
	jQuery('.basketbutton').hide();
	jQuery('.checkoutbutton').show();	
	
}

function showGoshopping() {
	 if (pathname.search("create-your-own") > -1)
    {
    	
    	jQuery('div.goshopping').show();
    }

}


jQuery(document).ready(function() {



var pathname = window.location.pathname;

	jQuery('#thecheckout').hide();
	jQuery('.basketbutton').hide();


	jQuery('.checkoutbutton a').click(function(e){

			showCheckout();
});

	jQuery('.basketbutton a').click(function(e){

			showBasket();
});




if (pathname.search("products-page/checkout") > -1) {

	var output=jQuery('p.validation-error').length;

	
	if (output>0) {
			showCheckout();
	}


}

});







jQuery(document).ready(function ()
{



    //gridview functions
    jQuery('div.product_detail').hide();
    //alert('jquery working');

    function showDetail()
    {
        var position = jQuery(this).closest('div.product_grid_item').position();
        //alert(position.top);
        jQuery('div.product_detail').hide();
        jQuery(this).closest('div.product_grid_item').next('div.product_detail').show().addClass('expanded');
        jQuery('div.expanded').css("left", position.left - 10);
        jQuery('div.expanded').css("top", position.top - 40);

    }

    function showMe()
    {
        jQuery(this).show();

    }


    function hideMe()
    {
        jQuery(this).removeClass('expanded').hide();

    }


    jQuery('img.product_image').mouseover(showDetail);

    jQuery('div.product_detail').hover(showMe, hideMe);


    var pathname = window.location.pathname;

    //hide the variations that are already assigned to baskets
    if (pathname.search("create-your-own") > -1)
    {
       //alert('this is the create your own section');
		
	    //jQuery('div.goshopping').hide();	
		
        jQuery('input.hampernumbers').each(function (i)
        {

            var v = $(this).attr('value');
            var v2 = 'option[value=' + v + ']';
            //alert(v2);
            jQuery(v2).remove();
            jQuery('div.goshopping').show();

        });


    }
    else if(pathname.search("goods") > -1)
    {
	jQuery('.bigbutton.goshopping').hide();


        jQuery('select.wpsc_select_variation option').addClass('panther');


		var hampercount=jQuery('input.hampernumbers').length;
		
		if (hampercount==0)
		{
		jQuery('input.wpsc_buy_button').hide();
		jQuery('div.wpsc_variation_forms').hide();
		jQuery('p.goodsinstruction').hide();
		jQuery('p.nobasket').show();
		

		
		} else{
		jQuery('div.wpsc_variation_forms').show();
		jQuery('p.nobasket').hide();
		}
		
		
		

        jQuery('input.hampernumbers').each(function (i)
        {

            
            var v = $(this).attr('value');
            //var v2='option[value='+v+']';
            //alert(v2);
            //jQuery(v2).show();
            
            jQuery('select.wpsc_select_variation option').each(function ()
            {


                var u = $(this).attr('value');

                //alert(u);
                if (u == v)
                {
                    $(this).addClass('realHamper');
                    //alert('success i think');
                }

            });

        });

        jQuery('select.wpsc_select_variation option:not(.realHamper)').remove();

    }




/*

if(){

jQuery('.product_image').css({width:80, height:80});
jQuery('input.wpsc_buy_button').remove();
jQuery('div.product_text').hide();


jQuery("div.product_grid_item").hover(
function(){

var $element= this;

jQuery($element).find('.product_image').css({width:100, height:100});



},
function(){
var $element= this;
jQuery($element).find('.product_image').css({width:80, height:80});



}
);
}

*/




});

