function showdark()
	{
		popupWidth	=	getWidth();
		document.getElementById('maskPop').style.display	=	'block';
		document.getElementById('maskPop').style.width		=	popupWidth + "px";
		document.getElementById('maskPop').style.height		=	document.body.clientHeight+1500+ "px";
		var str	=	document.getElementsByTagName("select");
		var l 	= 	str.length;
		for (x = 0; x < l; x++)	str[x].style.display	=	'none';
	}
	
function showWindow(myWindow)
	{
		document.getElementById(myWindow).style.display	=	'block';
		myPopupRelocate(myWindow);
	}
	
function myPopupRelocate(Mypop) 
	{
		// Determine how much the visitor had scrolled
		var scrolledX, scrolledY;
		if( self.pageYOffset ) {
		scrolledX = self.pageXOffset;
		scrolledY = self.pageYOffset;
		} else if( document.documentElement && document.documentElement.scrollTop ) {
		scrolledX = document.documentElement.scrollLeft;
		scrolledY = document.documentElement.scrollTop;
		} else if( document.body ) {
		scrolledX = document.body.scrollLeft;
		scrolledY = document.body.scrollTop;
		}
		
		// Determine the coordinates of the center of browser's window
		var centerX, centerY;
		if( self.innerHeight ) {
		centerX = self.innerWidth;
		centerY = self.innerHeight;
		} else if( document.documentElement && document.documentElement.clientHeight ) {
		centerX = document.documentElement.clientWidth;
		centerY = document.documentElement.clientHeight;
		} else if( document.body ) {
		centerX = document.body.clientWidth;
		centerY = document.body.clientHeight;
		}
		
		var wid = document.getElementById(Mypop).style.width;
		var hei = document.getElementById(Mypop).style.height;
		
		var leftOffset = scrolledX + (centerX - parseInt(wid)) / 2;
		var topOffset = scrolledY + (centerY - parseInt(hei)) / 2;
		
		document.getElementById(Mypop).style.top = topOffset + "px";
		document.getElementById(Mypop).style.left = leftOffset + "px";
		document.getElementById(Mypop).style.display = "block";
	}

function close_window(myWindow) 
	{
		document.getElementById(myWindow).style.display		=	"none";
		document.getElementById('maskPop').style.display	=	"none";
		var str	=	document.getElementsByTagName("select");
		var l 	= 	str.length;
		for (x = 0; x < l; x++)	str[x].style.display	=	'';
	}

function getWidth() {
  var myWidth = 0
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth - 16;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
  }
  return  myWidth;
}

function showLegal()
{
	showdark(); showWindow('window_legal');
	return false;
}

function showTerms()
{
	showdark(); showWindow('window_terms');
	return false;
}