/** ******************** ******************* ************************ **

	Notice: The code written in this document is not for distrubtion. 
			This document is intellectual property of echoKinetics.

** ******************** ******************* ************************ **/

var updateIntervalActive = false;

function updateDimensions(frameId, onLoad){
	var frameElement = document.getElementById(frameId);
	
	var currHeight = frameElement.height;
	
	var updatedHeight = frameElement.contentWindow.document.body.scrollHeight;
	if(currHeight != updatedHeight) {
		frameElement.height = updatedHeight;
	}
	
	var currWidth = frameElement.width;
	
	if(onLoad) {
		frameElement.width =  '100%';
	} else {
		var updatedWidth = frameElement.contentWindow.document.body.scrollWidth;
		if(currWidth != updatedWidth) {
			frameElement.width = updatedWidth;
		}
	}
	
	if(!updateIntervalActive) {
		setInterval("updateDimensions('"+frameId+"', false)", 500);
		updateIntervalActive = true;
	}
}

// - Links - //

var forumPage = "forum/";

function goToForum(forumId) {
	window.location = forumPage+"viewforum.php?f="+forumId;
}

function goToTopic(topicId) {
	window.location = forumPage+"viewtopic.php?t="+topicId;
}

function goToPost(postId) {
	window.location = forumPage+"viewtopic.php?p="+postId+"#p"+postId;
}

function goToUser(userId) {
	window.location = forumPage+"memberlist.php?mode=viewprofile&u="+userId;
}
