var stcHasOpenPopup = 0;
// this is for opening pop-up windows
function stc_openPopup( url, name, widgets, openerUrl ) {
	var host = location.hostname;
	if (window == top) { window.top.name = "opener"; }
	var popupWin = window.open( url, name, widgets );
	if(popupWin) {stcHasOpenPopup = 1;}
	if ( popupWin && popupWin.opener ) {
		if ( openerUrl ){
			popupWin.opener.location = openerUrl;
		}
	}
	if ( popupWin) {
		popupWin.focus();
	}
}

function getAd(w,h,n){
  var m = Math.floor(n*Math.random());
  var s = 'http://www.socineer.com/sys/ad' + w + 'x' + h + '-' + m + '.html';
  return s
}

function gh(d) {
  var dh = 0, sh, oh;
  if (d.height) dh = d.height;
  else if (d.body) {
    if (d.body.scrollHeight) dh = sh = d.body.scrollHeight;
    if (d.body.offsetHeight) dh = oh = d.body.offsetHeight;
    if (sh && oh) dh = Math.max(sh, oh);
  }
  return dh;
}

function setifrmh(fname) {
  var wframe = window.frames[fname];
  var eframe = document.getElementById(fname);
  var dh = gh(wframe.document);
  if (dh) eframe.style.height = dh + 30 + "px";
}

function isfr(){
   if (window.parent.document.body.id != 'mainpage') { 
   var lc = new String(window.location);
   var la = lc.split('/txt/');
   window.location=la[0] + '/' + la[1];}
}

function init() {
  setifrmh('frsoc');
}

