var G_Parent_config = null;
/*
*窗口唯一ID
*/
var Windows_ID_HisMailList="1001";//历史邮件窗口ID
var Windows_ID_EndueGoldMail="1002";//历史邮件窗口ID	
function getParentConfig(win)
{
	if (win.opener == null)
	{
		
		if (win.parent == win)
		{
			return win;
		}
		else
		{
			return getParentConfig(win.parent);
		}
	}
	else
	{
		return getParentConfig(win.opener);
	}
}
function client_external_config()
{
	return window.external.qlC;
}
function client_core_interface_config()
{
	if (G_Parent_config == null)

		G_Parent_config = getParentConfig(window);
    return G_Parent_config.client_external_config();
}

//客户端获取平台基地址
function G_TGPATH()
{
	var obj = client_core_interface_config() ;
	var data = obj.r( "G_SYS_CONFIG" , "BaseUrl_tgpt") ;
	
/*	if (data == "")
	{
		setTimeout(function() {window.location = window.location},500);
	}
*/
//var data = 'http://180.153.140.215:9021/investAnalysisPlate/';
//var data = 'http://192.168.3.188:9021/investAnalysisPlate/';
	return data;
}

//客户端获取附件基地址
function G_ATTACHPATH()
{
	var obj = client_core_interface_config() ;
	var data = obj.r( "G_SYS_CONFIG" , "BaseUrl_fj") ;
	return data;
	//return "http://192.168.3.188:9032/";
}


//--------------------------------------------------
//
function getBrokerPath()
{
	//return "http://localhost:8080/investAnalysisPlate/qs/initSrv.do?qsid="+ getQsId() +"&bid=zhouyb888";
	return G_TGPATH()+"qs/initSrv.do?qsid="+ getQsId() +"&bid="+ getSysUserId() ;
}
//----------------------------------------------------
	
//客户端获取文件上传服务URL
function G_FILESERVICE()
{
	return G_ATTACHPATH() + "/uploadv2/upload.jsp";
	//return G_FILESERVERPATH() + "upload.jsp";
}

//客户端获取文件下载服务基地址
function G_DOWNLOADSERVICE()
{
	return G_ATTACHPATH() + "/fileManager/";
	//return "http://210.5.158.10:9020/attachs/";
}


//上传文件大小
function G_FILESIZE()
{
	return "5242880";
}

function G_TOTALIMGSIZE()
{
	return 5242880;
}

function G_TOTALFILESIZE()
{
	return 10485760;
}

function G_IMGSIZE()
{
	return "2097152";
}


//客户端获取文件上传服务器地址
function G_FILESERVERPATH()
{
	var xmlhttp = null;
	if (window.XMLHttpRequest)
	{
		// code for all new browsers
		xmlhttp = new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{
		// code for IE5 and IE6
		xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
	}
	var req = xmlhttp;
	var callURL = G_TGPATH() + "attachurl.txt";
	xmlhttp.open('GET', callURL, false);
	xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	try
	{
		xmlhttp.send(null);
	}
	catch (e)
	{
		url = null;
		xmlhttp = null;
		return "";
	}
	if(xmlhttp.status!=200) 
	{ 
		xmlhttp.open("GET",callURL,false);
		xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		try
		{
			xmlhttp.send(null);
		}
		catch (e)
		{
			xmlhttp = null;
			return "";
		}        
	}	
	var data=xmlhttp.responseText;	
	callURL = null;
	xmlhttp = null;
	return data;
	//return "http://192.168.3.188:8299/webmail/";
}

function OLDATTACHSERVICE()
{
	return ["http://210.5.158.10:9020/attachs","http://59.46.84.67:9021/attachs","http://180.168.209.194:9021/attachs","http://210.5.158.25:9021/attachs","http://210.5.158.26:9021/attachs"];
}