// JavaScript Document

function popup() {
	var dbw = document.body.clientWidth;
	var dbh = document.body.clientHeight;
	var flexwidth = (dbw - 470)/2;
	$('#light').css("left", flexwidth+"px");
	$('#light').css('display', 'block');
	$('#fade').css('display', 'block');
	if(!window.XMLHttpRequest) {
		d=document;
		if (typeof window.innerHeight!='undefined') {
			var dbh = window.innerHeight;
		}
		else { 
			if (d.documentElement && typeof d.documentElement.clientHeight!='undefined' && d.documentElement.clientHeight!=0) { 
				var dbh = d.documentElement.clientHeight + 15;
			} 
			else { 
				if (d.body && typeof d.body.clientHeight!='undefined') { 
					var dbh = d.body.clientHeight 
				} 
			} 
		}
		var mt1 = - $('#center').height();
		var mt = - $('#center').height(); - $('#light').height();
		document.getElementById('fade').style.height=document.getElementById('center').clientHeight;
		$('#fade').css('height', $('#center').height());
		$('#fade').css('margin-top', '-343px');
		$('#fade').css('position', 'relative');
		$('#light').css('position', 'relative');
		$('#light').css('margin-top', mt1+'px');		
	}
}

function popup1() {
	var dbw = document.body.clientWidth;
	var dbh = document.body.clientHeight;
	var flexwidth = (dbw - 470)/2;
	$('#light1').css("left", flexwidth+"px");
	$('#light1').css('display', 'block');
	$('#fade').css('display', 'block');
	
	//IE6
	
	if(!window.XMLHttpRequest) {
		d=document;
		if (typeof window.innerHeight!='undefined') {
			var dbh = window.innerHeight;
		}
		else { 
			if (d.documentElement && typeof d.documentElement.clientHeight!='undefined' && d.documentElement.clientHeight!=0) { 
				var dbh = d.documentElement.clientHeight + 15;
			} 
			else { 
				if (d.body && typeof d.body.clientHeight!='undefined') { 
					var dbh = d.body.clientHeight 
				} 
			} 
		}
		var mt1 = - $('#center').height();
		var mt2 = $('#center').height();
		var mt = - $('#center').height(); - $('#light').height();
		$('#fade').css('margin-top', '-181px');
		$('#fade').css('position', 'relative');
		$('#light1').css('position', 'relative');
		$('#light1').css('margin-top', mt1+'px');
		if(mt2>dbh) {
			$('#fade').css('height', mt2+'px');
		}	
		else {
			$('#fade').css('height', dbh+'px');
		}
	}
}
