var timerStatusBox = null;

$(document)
		.ready(
				function() {

					var itemImages = $("a.itemImages");
					if (itemImages && itemImages[0]) {
						itemImages.fancybox();
					}

					$("a.js_window").click(function(event){
					     event.preventDefault();
					     window.open( $(this).attr('href'),
					    		 $(this).attr('id'), "menubar=0,resizable=1,width=650,height=650"); 
					});

					$("div.trbox").noContext();
					$("div.trbox")
							.rightClick(
									function(event) {
										event.preventDefault();
										window
												.open(
														'/admin/base/pages/translate?key=' + $(
																this)
																.attr('id'),
														"translate_window",
														"menubar=0,resizable=1,width=650,height=650");
										$(this).css("border", "1px solid red");
									});

					$("div.trbox").hover(function() {
						$(this).css("border", "1px solid green");
					}, function() {
						$(this).css("border", "0");
					});

					//linkTooltip();

				});

function linkTooltip() {
	$('a, input').tooltip( {
		track : true,
		delay : 0,
		showURL : false,
		showBody : "::",
		fade : 0
	});
}

function infoBlockView(blockId) {
	var block = $("#" + blockId);
	if (block.length) {
		if (block.is(':hidden')) {
			block.fadeIn();
		} else {
			block.fadeOut();
		}
	}
}