	
	function update_page_location() {
		window.location = showcase_url[ImgIdx];
	}
	
	function clearinput(element, default_value, type, id) {
		if (type == "input") {
			if(element.value == default_value) {
				element.value = '';
			}
		} else if(type == "textarea") {
			if ($("#" + id).val() == default_value) {
				$("#" + id).val('');
			}
		}
	}
	
	function fillinput(element, default_value, type, id) {
		if (type == "input") {
			if (element.value == '') {
				element.value = default_value;
			}
		} else if(type == "textarea") {
			if ($("#" + id).val() == '') {
				$("#" + id).val(default_value);
			}
		}
	}

	enlarged = 1;
	function enlarge_textarea(id, newheight, transition) {
		if (enlarged != 2) {
			$('#' + id).animate({
				height: newheight
			}, transition);
			enlarged = 2;
		}
	}
	
	continue_auto_change = 1;
	function show_next_showcase_image(transition) {
		setTimeout("show_next_showcase_image(" + transition + ")", transition);
		if (continue_auto_change == 1) {
			$('#next_showcase_image').click();
		}			
	}
	
	function start_showcase() {
		continue_auto_change = 1;
		$('#stop_showcase_span').css('display', 'inline');
		$('#start_showcase_span').css('display', 'none');
	}
	
	function stop_showcase() {
		continue_auto_change = 2;
		$('#stop_showcase_span').css('display', 'none');
		$('#start_showcase_span').css('display', 'inline');
	}	
	
	function changeImg(imgId){
		$("#sb_profile_center > img").css('display', 'none');
		$('#sb_profile_center > #bigimage' + imgId).css('display', 'inline');
		$('#sb_profile_center > #bigimage' + imgId).show();
	}

	var carousel_index = 0;
	
	function image_carousel_initCallback(carousel) {
	    /* Disable autoscrolling if the user clicks the prev or next button.
	    carousel.buttonNext.bind('click', function() {
	        carousel.startAuto(0);
	    });
	
	    carousel.buttonPrev.bind('click', function() {
	        carousel.startAuto(0);
	    });*/
	
	    // Pause autoscrolling if the user moves with the cursor over the clip.
	    carousel.clip.hover(function() {
	        carousel.stopAuto();
	    }, function() {
	        carousel.startAuto();
	    });
	};
	
	function fetch_carousel_items() {
		if (carousel_index < carousel_count) {
			carousel_index++;
		} else {
			carousel_index = 1;
			//shuffle_carousel();
		}
	}
	
	function shuffle_carousel() {
		var arr = new Array();
		$('#image_carousel li').each(function() { 
			arr.push(this.innerHTML); 
		});
		shuffle(arr);
		var i = 0;
		$('#image_carousel li').each(function() { 
			this.innerHTML = arr[i];
			i++;
		});
	}
	
	shuffle = function(o){ //v1.0
		for(var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);
		return o;
	};