var ShowLayer_Frame={};
ShowLayer_Frame.Width=200;//框架宽度
ShowLayer_Frame.Height=200;//高度
ShowLayer_Frame.Url="";
ShowLayer_Frame.Titel="";
ShowLayer_Frame.Scrolling=1;//滚动条，1表示不显示，2表示始终显示，3表示需要时显示
ShowLayer_Frame.Name="span_ShowLayer";
var ShowLayer_Frame_Init=function(Name,Width,Height,Titel,Scrolling,Url)
{
	ShowLayer_Frame.Name=Name;
	ShowLayer_Frame.Width=Width;
	ShowLayer_Frame.Height=Height;
	ShowLayer_Frame.Url=Url;
	ShowLayer_Frame.Titel=Titel;
	ShowLayer_Frame.Scrolling=Scrolling;	
	ShowLayer_Frame_InitWrite();
}
ShowLayer_Frame_InitWrite=function()
{
	document.write('<span id="'+ShowLayer_Frame.Name+'" style="DISPLAY: none;position:absolute;visibility:hidden; padding:1px;" class="layer1">');
	document.write('<TABLE WIDTH="" BORDER="0" CELLSPACING="0" CELLPADDING="0">');
	document.write('<TR>');
	document.write('<TD height="25" bgcolor="#edf2fb" valign="middle">');
	document.write('<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0" align="center">');
	document.write('<TR>');
	document.write('<TD width="8%" align="center" height="30"><IMG SRC="images/list/jd_Down.gif"></TD>');
	document.write('<TD width="84%"><b>'+ShowLayer_Frame.Titel+'</b></TD>');
	document.write('<TD width="8%" align="center"><IMG SRC="images/list/Close.gif" style="CURSOR: hand" onclick="ShowLayer_Frame_Close_ShowLayer(\''+ShowLayer_Frame.Name+'\');" Title="关闭/close"></TD>');
	document.write('</TR>');
	document.write('</TABLE>');
	document.write('</TD>');
	document.write('</TR>');
	document.write('<TR>');
	document.write('<TD style="border: 1px solid #edf2fb;"><IFRAME id="Iframe_'+ShowLayer_Frame.Name+'" name="Iframe_'+ShowLayer_Frame.Name+'" src="" frameBorder="0" width="'+ShowLayer_Frame.Width+'"');
	if(ShowLayer_Frame.Scrolling==1)
	{
		document.write(' scrolling="no"');
	}else if(ShowLayer_Frame.Scrolling==2)
	{
		document.write(' scrolling="no"');		
	}
	document.write(' height="'+ShowLayer_Frame.Height+'"></IFRAME></TD>');
	document.write('</TR>');
	document.write('</TABLE>');
	document.write('</span>');	
}
ShowLayer_Frame_ShowLayer=function(Name,Url)
{
	var ToFile=Url;	
	var span_obj=eval(Name);
	var w=document.documentElement.offsetWidth;
	var h=document.documentElement.offsetHeight;
	span_obj.style.display="block";
	span_obj.style.pixelLeft=w/2-(ShowLayer_Frame.Width/2);
	span_obj.style.pixelTop=h/2-(ShowLayer_Frame.Height/2);
	span_obj.style.visibility="visible";
	var iobj=eval("Iframe_"+Name);
	iobj.location.replace(ToFile);
}
ShowLayer_Frame_ShowLayer_Span=function(Name,Url)
{	
	var ToFile=Url;
	var span_obj=eval(Name);
	
	var popHeight=span_obj.clientHeight;
	var popWidth=span_obj.clientWidth;
	var w=event.clientX+document.documentElement.scrollLeft-200;
	var h=event.clientY+document.documentElement.scrollTop+10;
	var frameHeight=document.documentElement.offsetHeight;
	var frameWidth=document.documentElement.offsetWidth;
	
	if((w+popWidth)>frameWidth)
	{		
		w=event.clientX+document.documentElement.scrollLeft-popWidth;
	}else if(w<10){
		w=10;
	}
	if((h+popHeight)>frameHeight)
	{
		h=event.clientY+document.documentElement.scrollTop-popHeight;		
	}
	
	span_obj.style.display="block";
	span_obj.style.pixelLeft=w;
	span_obj.style.pixelTop=h;
	span_obj.style.visibility="visible";
	var iobj=eval("Iframe_"+Name);
	iobj.location.replace(ToFile);
}

ShowLayer_Frame_Close_ShowLayer=function(Name)
{
	var iobj=eval("Iframe_"+Name);
	var span_obj=eval(Name);	
	span_obj.style.display="none";	
	iobj.location.replace("about:blank");	
}
