function OpenPopURL()
{
	var txt = document.getElementById("txtPopemail")
	var pgName = 'http://visitor.constantcontact.com/optin.jsp?m=1100615372667&ea=' + txt.value 
	var myPage = window.open(pgName, 'NewsLetter', 'Scrollbars=yes,Toolbar=no,resizable=yes,left=20,top=10,width=800,height=550');
}
function ReturnAdjustedCoordinateX ()
{
	return ( ( window.pageXOffset ) ? window.pageXOffset : document.body.scrollLeft ) + target_x;
}

function ReturnAdjustedCoordinateY ()
{
	return ( ( window.pageYOffset ) ? window.pageYOffset : document.body.scrollTop ) + target_y;
}

function KeepFloatingWindowPosition ()
{
	FloatingElement.style.top = ReturnAdjustedCoordinateY ( );
	FloatingElement.style.left = ReturnAdjustedCoordinateX ( );
	setTimeout ("KeepFloatingWindowPosition ();", 1000 );
}

function FloatingSlideIn ()
{
	if (target_x != 50 || target_y != 10)
		{
			if (target_x != 50)
				if ( Math.abs (target_x - 50) <= 4)
					target_x = 50;
				else if (target_x < 50)
					target_x += 4;
				else
					target_x -= 4;
				
				if (target_y != 10)
					if (Math.abs (target_y - 10 ) <= 4)
						target_y = 10;
					else if (target_y < 10)
						target_y += 4;
					else
						target_y -= 4;
						FloatingElement.style.top  = ReturnAdjustedCoordinateY ();
						FloatingElement.style.left = ReturnAdjustedCoordinateX ( );
						setTimeout ("FloatingSlideIn();", 20 );
}   
	else
			KeepFloatingWindowPosition ( );
}

function StartUp () 
{
	target_x = 50;
	target_y = 10;
	switch ( 1 )
		{
			case 3: target_x = -402;
			break;       
			case 4: target_x = ( ( window.innerWidth ) ? window.innerWidth : document.body.clientWidth );  
			break;       
			case 1: target_y = -400;  
			break;       
			case 2: target_y = ( ( window.innerHeight ) ? window.innerHeight : document.body.clientHeight);  
			break;
		}   
	FloatingElement.style.top  = ReturnAdjustedCoordinateY ( );
	FloatingElement.style.left = ReturnAdjustedCoordinateX ( );   
	FloatingElement.style.display = "";   
	FloatingSlideIn ( ); 
} 

function FloatingWindowDragMove ( e )
{   
	new_x = ( document.all ) ? event.clientX : e.clientX;
	new_y = ( document.all ) ? event.clientY : e.clientY;   
	target_x += new_x - old_x;
	target_y += new_y - old_y; 
	old_x = new_x;   
	old_y = new_y;   
	FloatingElement.style.top  = ReturnAdjustedCoordinateY ( );   
	FloatingElement.style.left = ReturnAdjustedCoordinateX ( ); 
} 

function DoNothing ( ) 
{
} 

function EndFloatingWindowDrag ( ) 
{   
	document.onmousemove = DoNothing;   
	document.onmouseup   = DoNothing; 
} 

function StartFloatingWindowDrag ( e ) 
{   
	old_x = ( document.all ) ? event.clientX : e.clientX;   
	old_y = ( document.all ) ? event.clientY : e.clientY;   
	document.onmousemove = FloatingWindowDragMove;   
	document.onmouseup   = EndFloatingWindowDrag; 
} 
