﻿function goSetHeight() {
 //  if (parent == window) return;
  // no way to obtain id of iframe object doc loaded into? no parentNode or parentElement or ...
  // else 
  setIframeHeight('ifrm');
  setIframeHeight('ifrm_1');
}
function getDocHeight(doc) {
  var docHt = 0, sh, oh;
  if (doc.height) docHt = doc.height;
  else if (doc.body) {
    if (doc.body.scrollHeight) docHt = sh = doc.body.scrollHeight;
    if (doc.body.offsetHeight) docHt = oh = doc.body.offsetHeight;
    if (sh && oh) docHt = Math.max(sh, oh);
  }
  return docHt;
}

function setIframeHeight(iframeName) {
  var iframeWin = window.frames[iframeName];
  var iframeEl = document.getElementById? document.getElementById(iframeName): document.all? document.all[iframeName]: null;
  if ( iframeEl && iframeWin ) {
    iframeEl.style.height = "auto"; // helps resize (for some) if new doc shorter than previous  
    var docHt = getDocHeight(iframeWin.document);
    // need to add to height to be sure it will all show
    if (docHt) iframeEl.style.height = docHt + 30 + "px";
  }
}

function loadIframe(iframeName, url) {
  if ( window.frames[iframeName] ) {
    window.frames[iframeName].location = url;   
    return false;
  }
  else return true;
}

function printCopyright()
{
	document.writeln('<div class="copyright">');
	document.writeln('	<p><a target="_parent" href="/about/contact.html">');
	document.writeln('			联系我们</a> | <a target="_parent" href="/about/about.html">关于我们</a> | <a target="_parent" href="/agreement.html">');
	document.writeln('			用户协议</a> | <a target="_parent" href="/about/law.html">法律声明</a> | <a target="_parent" href="/about/hr.html">工作机会</a> |');
if (typeof(agent_url) != 'undefined') document.writeln('		<a target=\"_parent\" href=\"/agent.html\">渠道招商</a> | ');
	document.writeln('			 <a target="_parent" href="/about/map.html">网站地图</a></p>');
	document.writeln('	<p>北京远特通信有限公司公司版权所有 </p><p><A href="http://www.yuante.com" target="_blank">中华人民共和国电信与信息增值服务经营许可证 B2-20070174 京ICP证041570号</A></p>');
	document.writeln('</div>');
}
