// JavaScript Document
function showLightBox(planType,scKey) {
	var yScroll;
	var top;

	$s('lightbox').display='block';
	$s('fade').display='block';
	if ($e('lighbox-plan')) {
		$e('lightbox-plan').innerHTML = planType;
	}
	if (scKey) {
		$e('LB-scKey').value = scKey;
	}
	
	// detect if IE6 or earlier, if so we have to use javascript to replicate the CSS property - position:fixed;
	var IE6 = false /*@cc_on || @_jscript_version < 5.7 @*/;
	if (IE6) {
		
		// if ie, there are 2 ways to get scroll offset (depending on 'standards compliance mode').  check for first, if not found use the second
		if (document.documentElement.scrollTop) {
			yScroll = document.documentElement.scrollTop;
		} else {
			yScroll = document.body.scrollTop;
		}

		top = parseInt(yScroll) + 180;
		$s('lightbox').position = "absolute";
		$s('lightbox').top = top + "px";
		
	}	
	

	
	var x,y,x1,y1,x2,y2;
	
	// get body dimensions
	var test1 = document.body.scrollHeight;
	var test2 = document.body.offsetHeight
	if (test1 > test2) // all but Explorer Mac
	{
		x1 = document.body.scrollWidth;
		y1 = document.body.scrollHeight;
	}
	else // Explorer Mac;
	     //would also work in Explorer 6 Strict, Mozilla and Safari
	{
		x1 = document.body.offsetWidth;
		y1 = document.body.offsetHeight;
	}
	
	// get window dimensions
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		x2 = window.innerWidth;
		y2 = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		x2 = document.documentElement.clientWidth;
		y2 = document.documentElement.clientHeight;
	} 

	// whichever is larger (body or window dimensions), use that value to set width + height of black overlay
	x = (x1 > x2) ? x1 : x2;
	y = (y1 > y2) ? y1 : y2;
	
	w = x + "px";
	h = y + "px";
	
	$s('fade').width = w;
	$s('fade').height = h;
}

function hideLightBox() {
	$s('lightbox').display='none';
	$s('fade').display='none';
}

function $s(id) {
	return document.getElementById(id).style;
}

function $e(id) {
	return document.getElementById(id);
}
