
// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this  header

function printWindow(){
   bV = parseInt(navigator.appVersion)
   if (bV >= 4) window.print()
}

function showPage(page)
{
	try
	{
		var screenWidth = document.body.offsetWidth || window.innerWidth || 0;
		var screenHeight = document.body.offsetHeight || window.innerHeight || 0;
		var x =  window.pageXOffset
	                || document.documentElement.scrollLeft
	                || document.body.scrollLeft
	                || 0;
	    var y =  window.pageYOffset
	                || document.documentElement.scrollTop
	                || document.body.scrollTop
	                || 0;
		$('docHolder').style.top = (parseInt(y) + 100) + 'px';
		$('docHolder').style.left = (parseInt(screenWidth/2) - 250) + 'px';
		$('docHolder').style.display = 'block';
		$('docFrame').src = '/' + page;
	}
	catch(e)
	{
		
		alert(e.description || e);
	}
}

function emailPage(_page)
{
	try
	{
		var screenWidth = document.body.offsetWidth || window.innerWidth || 0;
		var screenHeight = document.body.offsetHeight || window.innerHeight || 0;
		var x =  window.pageXOffset
	                || document.documentElement.scrollLeft
	                || document.body.scrollLeft
	                || 0;
	    var y =  window.pageYOffset
	                || document.documentElement.scrollTop
	                || document.body.scrollTop
	                || 0;
		$('emailHolder').style.top = (parseInt(y) + 100) + 'px';
		$('emailHolder').style.left = (parseInt(screenWidth/2) - 250) + 'px';
		$('emailHolder').style.display = 'block';
		$('emailFrame').src = '/sendemail.cfm?productid='+_page;
	}
	catch(e)
	{
		
		alert(e.description || e);
	}
}

function openWindow(winName,url,height,width,toolbar,menubar,status,resize,scroll,top,left)
{
	var newWin = open(url,winName,"toobar="+toolbar+",menubar="+menubar+",status="+status+",resizable="+resize+",scrollbars="+scroll+",width="+width+",height="+height+",top="+top+",left="+left);
	return newWin;
}

function closeWindow()
{
	$('docHolder').style.display = 'none';
}

function closeEmail()
{
	$('emailHolder').style.display = 'none';
}

function resize()
{
	// determine which is the tallest of the three elements
	var heights = [($('lcontainer')) ? Element.getHeight($('lcontainer')) : 0,($('ccontainer')) ? Element.getHeight($('ccontainer')) : 0,($('rcontainer')) ? Element.getHeight($('rcontainer')) : 0];
	var largest = heights.max();
	largest = (largest < 400) ? 400 : largest;
	$('main').style.height = largest + 'px';
	$('ccontainer').style.height = largest + 'px';
	
	
	
	if ($('rcontainer')) 
		$('rcontainer').style.height = largest + 'px';
	else
	{
		$('ccontainer').style.marginRight = 0 + 'px';
		$('ccontainer').style.width = 596 + 'px';
	}
	
	if ($('lcontainer')) 
		$('lcontainer').style.height = largest + 'px';
	else
	{
		$('ccontainer').style.marginLeft = 0 + 'px';
		$('ccontainer').style.width = 750 + 'px';
	}
}