// JavaScript Document
var bodywidth;
var bodyheight;

function initLayout(){
	updateLayout();
}

function updateLayout(){
	bodywidth = $(window).width();
	bodyheight = $(window).height();
}

$(document).ready(function(){
	initLayout();
});

$(window).resize(function(){
	updateLayout();
});

function showTip(topicid,topictitle, bar){
	clearTipTimeout();
	$("#ControlAddBlogComment1_hdTopicID").val(topicid);
	$("#ControlAddBlogComment1_hdTopicTitle").val(topictitle);
	$("#commentdiv").toggle("slow");
	var top  = $(bar).offset().top + 20;
	var left = $(bar).offset().left ;
	var h = $("#commentdiv").outerHeight();
	var w = $("#commentdiv").outerWidth();
	$("#commentdiv").css({top:top, left:left}, 200);
}
var tip_timeout = 0;
function hideTip(quick){
	clearTipTimeout();
	if(typeof quick != "undefined") {
		if(quick) {
			$("#commentdiv").toggle("slow");;
			return;
		}
	}
	tip_timeout = window.setTimeout(function(){ $("#commentdiv").hide(); }, 1000)
}

function clearTipTimeout() {
	window.clearTimeout(tip_timeout)
}

