
/* getcookie */
function GetCookie(sName)
{
  var aCookie = document.cookie.split("; ");
  for (var i=0; i < aCookie.length; i++)
  {
    var aCrumb = aCookie[i].split("=");
    if (sName == aCrumb[0]) 
      return unescape(aCrumb[1]);
  }
  return null;
}

/* save userinfo */
function SetCookie(StrName,StrValue)
{
	document.cookie = StrName +"="+ escape(StrValue);
}

var GetCacheUserID = GetCookie("userName")==null?1:GetCookie("userName");

/* bn.htm */
var GetCacheNav;
function ChangeNav(obj_nav,FrmFdr,Ltb,Rtm,MainFrm)
{
	
	if(GetCacheNav!=null){
		GetCacheNav.className = "nav_f";
	}
	else{
		document.all("FirNav").className = "nav_f";
	}
	
	obj_nav.className = "nav_s";
	GetCacheNav = obj_nav;
	
	var frmFdr = "samplecode";
	var frmLtb = "ltb.htm";
	var frmRtm = "mls.htm";
	
	if(FrmFdr!=""){	
		frmFdr = FrmFdr;
	}
	if(Ltb!=""){	
		frmLtb = Ltb;
	}
	if(Rtm!=""){	
		frmRtm = Rtm;
	}
	
	if(MainFrm==""){
		window.parent.document.all("mframe").src="../../modules/common/mainframe.htm?"+frmFdr+"&"+frmLtb+"&"+frmRtm;
	}
	else{
		window.parent.document.all("mframe").src="../../modules/"+frmFdr+"/"+MainFrm;
	}	
}

//


/* logon.htm */ 
function owPosition()
{
	window.moveTo(-9999,-9999);
	var returnValue = window.showModalDialog("themes/dfstyle/logonow.htm", "",  "dialogWidth:390px; dialogHeight:290px;status:No; ");
	
	if (returnValue == "close")
	{
		window.close();
	}
	else
	{
	    if(returnValue==1){
		window.location.replace ("modules/pageflow/homepage1.htm");}
		else{
		window.location.replace ("modules/pageflow/homepage2.htm");}
		window.moveTo(0,0);
	}
}

 

/* logonow.htm */
function checkValue()
{
	if (document.all("sltName").value == "0")
	{
		alert("请选择相应用户登录！");
	}
	else
	{
		window.returnValue = document.all("sltName").value;
		SetCookie("userName",window.returnValue);
		
		window.close();
	}
}

/*commom*/
function Confirm()
{
	var ReturnValue = confirm("你确定要删除该记录吗?");
	if (ReturnValue == true)
		{alert("记录已删除!")}
	else
		{return null}
}

function OpenWin( sURL , sFeatures )
{
	window.open( sURL , null , sFeatures , null)
	//window.open("Sample.htm",null,"height=200,width=400,status=yes,toolbar=no,menubar=no,location=no");
	//window.open( [sURL] [, sName] [, sFeatures] [, bReplace])
	//sName{_blank; _media; _parent; _search; _self; _top}
	//sFeatures{channelmode; directories; fullscreen; height; left; location; menubar; resizable; scrollbars; status; titlebar; toolbar; top; width} 
}

function ShowWin( sURL , sFeatures )
{
	window.showModalDialog( sURL , null , sFeatures)
	//window.showModalDialog("Sample.htm",null,"dialogHeight:591px;dialogWidth:650px;")
	//window.showModalDialog([sURL] [, vArguments] [, sFeatures])
	//sFeatures{dialogHeight; dialogLeft; dialogTop; dialogWidth; center; dialogHide; edge; help; resizable; scroll; status; unadorned}
}

/* idt */
function OnShow(id,imgid)
{	
	if(id.style.display!="none")
	{					
		id.style.display="none";	
		imgid.src="../../../themes/com/idt_tle_o.gif";
	}
	else
	{				
		id.style.display="block";
		imgid.src="../../../themes/com/idt_tle_c.gif";
		
	}
}

function OnShow2(id,imgid)
{	
	if(id.style.display!="none")
	{					
		id.style.display="none";	
		imgid.src="../../../themes/com/plus.gif";
	}
	else
	{				
		id.style.display="block";
		imgid.src="../../../themes/com/nofollow.gif";
		
	}
}

/* ltb */
function OnShow_Ltb(sender,img)
{
									
	if(sender.style.display!="none")
	{
		sender.style.display="none";
		img.src		= "../../../themes/com/ltb_tle_c.gif";
	}
	else
	{
		
		sender.style.display="block";
		img.src		= "../../../themes/com/ltb_tle_o.gif";
	}
}


function LtbClick(url,target)
{	
	var urlstr = window.parent.document.all("ltbfrm").src;
	var values;
	values=urlstr.split("/");
	
	if(target=="_blank"){
		window.open("../"+values[1]+"/"+url,null,"height=200,width=400,status=yes,toolbar=no,menubar=no,location=no");
	}
	
	else{
		if(url!=""){
		window.parent.document.all("rtmfrm").src="../"+values[1]+"/"+url;
		}
	}
}


/* other */
function autoResize(ifmobj)
{
	
	if(  document.all(ifmobj.id).readyState == "complete" )
	{
		try
		{
			var sHeight=window.frames[ifmobj.id].document.body.scrollHeight;
		
			if(sHeight<200)
			{
				sHeight="100%";
			}
			document.all(ifmobj.id).style.height = sHeight;					
		}
		catch(e)
		{}
	}
}


function chatlist(url)
{

	window.parent.document.all("bbb").src="safeproduct/"+url;

}






