var pageSection = "home";
var menuSection = "home";
var retryBlog = 100;

function onResizeParentIframe(size){
	$("#iBlog").attr("height",size);
	if(ie6)
	{
		var obj = document.getElementById("bottom_bkg");
		if(obj) obj.style.backgroundPosition = "bottom";
	}
}

function updateBlogUrl(url)
{
	if($("#iBlog"))
	{
		$("#iBlog").attr("src",url);
	}
	else
	{
		setTimeout(function() { $("#iBlog").attr("src",url); }, retryBlog);
	}
}
function updateBlog(section,bAnchor)
{
	updateBlogUrl(getBlogUrl(section)+"?"+getTunnelIDParam());
	if(bAnchor)
	{
		goToAnchor("blog_div");
	}
}
function updateSection()
{
	updateBlog(pageSection);
	updateMenu(menuSection);
}

/* BLOG FUNCTIONS */
function getBlogUrl(section)
{
	if(section == "" || section == "null" || section == null || section == "home") section = "nindex.html";
	else if(section.indexOf(".html") < 0)
	{
		section = section.replace(/\s/g,"-");
		section = section.toLowerCase();
		section += "/";
	}
	
	return blogBase+section;
}

/* MENU HIGHLIGHT */
function updateMenu(section)
{
	var obj = document.getElementById("menu_"+section);
	if(obj)
	{
		obj.className = "menu_item_selected";
	}
}