/*
usage: 
	open_child_win('google');
	open_child_win('yahoo');
	local is a flag when login in the web by click the button on the login page 
*/
function open_child_win( type_or_openid )
{
	var url_http = ('https:' == document.location.protocol ? 'https://' : 'http://');//alex modified
	var openid_identifier = type_or_openid;
	var url_http = ('https:' == document.location.protocol ? 'https://' : 'http://');//alex modified
	if ( type_or_openid == "google" )
	{
		openid_identifier = "https://www.google.com/accounts/o8/id";
		var url = url_http+"p.txwy.com/thirdparty/openid2/auth.php?local=1&openid_identifier=" + escape(openid_identifier);
		var iLeft = (window.screen.availWidth-810)/2;
		window.open( url, "", "height=500,width=800,top=200,left=" + iLeft );
		return;
	}
	else if ( type_or_openid == "yahoo" )
	{
		openid_identifier = 'http://yahoo.com/';
		var url = url_http+"p.txwy.com/thirdparty/openid2/auth.php?local=1&openid_identifier=" + escape(openid_identifier);
		var iLeft = (window.screen.availWidth-512)/2;
		window.open( url, "", "height=500,width=502,top=200,left=" + iLeft);
		return;
	}
	else if ( type_or_openid == "facebook" )
	{
		var url = url_http+"p.txwy.com/thirdparty/facebook/auth.php?local=1";
		window.open( url, "", "height=500,width=800,top=200,left=300" );
		return;
	}
	else if ( type_or_openid == "twitter" )
	{
		var url = url_http+"p.txwy.com/thirdparty/twitter/auth.php?local=1";
		window.open( url, "", "height=500,width=800,top=200,left=300" );
		return;
	}
	else if ( type_or_openid == "qq" )
	{
		var url = url_http+"p.txwy.com/thirdparty/qq/auth.php?action=login&local=1";
		window.open( url, "", "height=500,width=800,top=200,left=300" );
		return;
	}
	else if ( type_or_openid == "kaixin" )
	{
		var url = url_http+"p.txwy.com/passport/kaixin?local=1";
		window.open( url, "", "height=500,width=800,top=200,left=300" );
		return;
	}
	else if ( type_or_openid == "sina" )
	{
		var url = url_http+"p.txwy.com/thirdparty/sina/index.php?local=1";
		window.open( url, "", "height=500,width=800,top=200,left=300" );
		return;
	}
	else if ( type_or_openid == "renren" )
	{
		var url = url_http+"p.txwy.com/thirdparty/renren/auth_local.php";
		window.open( url, "", "height=500,width=800,top=200,left=300" );
		return;
	}	
}

function close_child_reload_parant( url )
{
	this.close();
	window.opener.location.href = url;
}
