var status;
var tableInformation;
var isOpen = 0;
var isClosing = 0;
var isOpening = 1;
var page;
var bannerTween = null;

function grabDOM()
{
	//bannerTween = new Tween(document.getElementById('viewBanner').style,'left',Tween.strongEaseOut,-150,-5,1.55,'px');
}

function openProducts(x,y,page){
	
	if(isOpen!=1 && isClosing!=1){
		
		isOpen = 1;
		isOpening = 1;	
		t1 = new Tween(document.getElementById('products').style,'width',Tween.bounceEaseOut,0,300,1.0,'px');
		t1.start();
		var t=setTimeout("document.getElementById('tableInfo').style.visibility = 'visible'", 750);
		var o=setTimeout(setOpenStatus,575);
	}
	else{
		if(isClosing!=1 && isOpening!=1){
			closeWindow();
			var co = setTimeout('openWindow('+x+','+y+',\''+page+'\')',650);
		}
	}
}

function closeProducts(){
	isClosing = 1;
	var u=setTimeout("document.getElementById('tableInfo').style.visibility = 'hidden'", 200);
	t1 = new Tween(document.getElementById('products').style,'width',Tween.strongEaseIn,300,0,.55,'px');
	t1.start();
	setTimeout(setCloseStatus,650);
}

function slideBanner(){
	bannerTween.continueTo(-5,1.5);
}
function hideBanner(){
	bannerTween.continueTo(-150,1.5);
}

function hideProductImage()
{
	t1 = new Tween(document.getElementById('products').style,'width',Tween.strongEaseIn,1,0,.1,'px');
	t1.start();
}
function setCloseStatus(){
	isClosing = 0;
	isOpen = 0;
}

function setOpenStatus(){
	isOpening = 0;
	isOpen = 1;
}

function showCorner(){
	if(pageWidth()<=1024){
		document.getElementById('fortressCorner').style.display = "none";
		document.getElementById('viewBanner').style.display = "none";
	}
}

function pageWidth() {
	return window.innerWidth != null? window.innerWidth : document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null;
} 
function pageHeight() {
	return  window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ?  document.documentElement.clientHeight : document.body != null? document.body.clientHeight : 
	null;
} 