// popUp windows functionality

function getViewportSize() {
	var size = [0,0];
	if (typeof window.innerWidth != 'undefined')
	{
		size = [window.innerWidth, window.innerHeight];	
	}
	else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0)
		{
		size = [document.documentElement.clientWidth,document.documentElement.clientHeight];
		}
	else
	{
		size = [document.getElementsByTagName('body')[0].clientWidth,document.getElementsByTagname('body')[0].clientHeight];
	}
	return size;
}



function getTargPos() {
	var aSize = getViewportSize();
	var targPos = [0,0];
	targPos[0] = (aSize[0]/2) - 370;
	targPos[1] = (aSize[1]/2) - 240;
	return targPos;
				 
}



$(document).ready(function(){
						   
	$('#tb01, #tb02, #tb03, #tb04, #tb05').click(function() {
	var Pos = getTargPos();
	window.open($(this).attr('href'), 'theWindow', 'width=680, height=540, scrollbars=yes, resizable=yes, status=yes, location=no, menubar=no, left=' + Pos[0] + ', top=' + Pos[1] +'');
	return false;
	}
);

});