	// WEB SHOP //
	$(document).ready(function() {
                $('#webshop_campaign_expander .mizer').click(function(){
                        var was_visible = false;
                        if($('#webshop_campaign_container').hasClass('isvisible')){
                                was_visible = true;
                                 $('#webshop_campaign_container').slideUp('slow', function(){
                                 $('#webshop_campaign_container').removeClass('isvisible');
                                });

                        }
                        if(!was_visible){
                                $('#webshop_campaign_container').slideDown('slow', function(){
                                        $('#webshop_campaign_container').addClass('isvisible');
                                });
                        }

                });
                $('#jsmenu_menucontainer li').click(function(){
                        var thisitem = $(this).attr('class');
                        var was_visible = false;
                        if($('#'+thisitem).hasClass('isvisible')){
                                was_visible = true;
                        }
                        $('#jsmenu_contentcontainer .isvisible').slideUp('slow', function(){
                                 $('#jsmenu_contentcontainer .isvisible').removeClass('isvisible');
                        });
                                if(!was_visible){
                                        $('#'+thisitem).slideDown('slow', function(){
                                                $('#'+thisitem).addClass('isvisible');
                                        });
                                }
                });


                $('#oc_webshop .categories_field').mouseover(function(){
                        $(this).removeClass('categories_field').addClass('categories_field_mouseover');
                }).mouseout(function(){
                        $(this).removeClass('categories_field_mouseover').addClass('categories_field');
                });

		// 12/24 month buttons
		$('#oc_webshop .abbon_12').click(function() {

			// Reference $(this) to avoid DOM traversal
			var $this = $(this);

			// Change 12m price
			$this.parent().parent().children(".price_12").show();
			$this.parent().parent().children(".price_24").hide();
			$this.parent().parent().parent().children(".bottom_text").children(".totalprice_12").show();
                        $this.parent().parent().parent().children(".bottom_text").children(".totalprice_24").hide();

			// Change btn backgrounds
			$this.children("img").attr("src", "/img/webshop/abbon_12_highlighted.png");
			$this.parent().children(".abbon_24").children("img").attr("src", "/img/webshop/abbon_24.png");
			
			// Set hidden input
			$this.parents("form").find(".payment_selected").attr("value", "12");
		});

		$('#oc_webshop .abbon_24').click(function() {

			// Reference $(this) to avoid DOM traversal
			var $this = $(this);

			// Change 24m price
			$this.parent().parent().children(".price_12").hide();
			$this.parent().parent().children(".price_24").show();
			$this.parent().parent().parent().children(".bottom_text").children(".totalprice_12").hide();
                        $this.parent().parent().parent().children(".bottom_text").children(".totalprice_24").show();

			// Change btn backgrounds
			$this.parent().children(".abbon_12").children("img").attr("src", "/img/webshop/abbon_12.png");
			$this.children("img").attr("src", "/img/webshop/abbon_24_highlighted.png");
			
			// Set hidden input
			$this.parents("form").find(".payment_selected").attr("value", "24");
		});



	/* Set selected phone color */
	$('#oc_webshop .color').click(function() {

		// reset all color
		$('#oc_webshop .color_wrapper').removeClass('selected');
		$('#oc_webshop .color').css("opacity","0.4");
		$('#oc_webshop .color').css("filter","alpha(opacity=40)");

		// select current target
		$(this).css("opacity","1");
		$(this).css("filter","alpha(opacity=100)");
		$(this).parents(".color_wrapper").addClass('selected');


		// set hidden input
		$('#color_selected').attr("value", $(this).attr("name"));
	});

	/*
	 * Disabled functionality for picking phone color
	 *
	$('#oc_webshop .product_description .color').click(function(e) {
			var $this = $(this);

			console.log($(e.target).attr('class'));

			if ($(e.target).attr('class') == 'color white'){
				$this.parent().parent().parent().parent().children(".phone_field_inner").children("img").attr("src", "user_img/htc_hero_white.jpg");
			}
			else if ($(e.target).attr('class') == 'color red'){
				$this.parent().parent().parent().parent().children(".phone_field_inner").children("img").attr("src", "user_img/htc_hero_red.jpg");
			}
			else{
				$this.parent().parent().parent().parent().children(".phone_field_inner").children("img").attr("src", "user_img/htc_hero.jpg");
			}

		});
	*/
	});/*// WEB SHOP //
$(document).ready(function() {

	// 12/24 month buttons
	$('#oc_webshop .abbon_12').click(function() {

		// Reference $(this) to avoid DOM traversal
		var $this = $(this);

		// Change 12m price
		$this.parent().parent().children(".price_12").show();
		$this.parent().parent().children(".price_24").hide();

		// Change btn backgrounds
		$this.children("img").attr("src", "/img/webshop/abbon_12_highlighted.png");
		$this.parent().children(".abbon_24").children("img").attr("src", "/img/webshop/abbon_24.png");
	});

	$('#oc_webshop .abbon_24').click(function() {

		// Reference $(this) to avoid DOM traversal
		var $this = $(this);

		// Change 24m price
		$this.parent().parent().children(".price_12").hide();

		$this.parent().parent().children(".price_24").show();

		// Change btn backgrounds
		$this.parent().children(".abbon_12").children("img").attr("src", "/img/webshop/abbon_12.png");
		$this.children("img").attr("src", "/img/webshop/abbon_24_highlighted.png");

	});
});*/
