(function ($) {

$.fn.vAlign = function() {

	return this.each(function(i){

		

			var h = $(this).height();		

			var oh = $(this).outerHeight();		

			var mt = (h + (oh - h)) / 2;		

			$(this).css("margin-top", "-" + mt + "px");		

			$(this).css("top", "50%");		

			$(this).css("position", "absolute");

	

		});

	

	};

})(jQuery);

$(document).ready(function(){

//	alert('valign');

//	$('.v_align').vAlign();

	/*

	 * $(".img_code").click(function() { });

	 */

	$("#resize_link").click(function(){

		if($("#resize_box").is(":hidden")){

			$("#resize_box").slideDown("slow");

			$("#resize_link").css("background-position","0 -24px");

		}else{

			$("#resize_box").slideUp("slow");

			$("#resize_link").css("background-position","0 0");

		}

		return false;

	});

});



function local(){

	if($("#image1").is(":hidden")){

		document.getElementById("local_remote").src = "img/local.gif";

		$("#remote_url").hide();

		$("#image1").show();

		$("#image1").effect("shake", { times:3 }, 300);

	}

}



function remote(){

	if($("#remote_url").is(":hidden")){

		document.getElementById("local_remote").src = "img/remote.gif";

		$("#image1").hide();

		$("#remote_url").show();

		$("#remote_url").effect("shake", { times:3 }, 300);

	}

}
