window.onerror=null;

function openWin(wUrl,wWidth,wHeight,wSC,wRS){
scWidth=screen.availWidth;
scHeight=screen.availHeight;
scWidthCenter=scWidth / 2;
scHeightCenter=scHeight / 2;
if(wWidth == 0){
	wWidth = scWidth;
}
if(wHeight == 0){
	wHeight = scHeight;
}
wOption="scrollbars=" + wSC + ",resizable=" + wRS + ",width=" + wWidth + ",height=" + wHeight + ",left=" + (scWidthCenter - (wWidth / 2)) + ",top=" + (scHeightCenter - (wHeight / 2));
window.open(wUrl,'newwin',wOption);

parent.name="bo_main";
}

function chk(str) { return confirm(str); }

//function bodyRefresh(){document.body.style.height = "100%";}

//function scrollback() { scrollTo(0,0); }

function scrollback(){
  var posY = document.body.scrollTop || document.documentElement.scrollTop;
  var tgtY = 0;
  var cnt=0;
  var interval=10;
  var timer = setInterval(function(){
	if(posY <= 1){
		window.scrollTo(document.body.scrollLeft,tgtY);
		clearInterval(timer);
		return false;	
	}else{
		if(cnt>5) {
			posY += (tgtY-posY)/2;
		}else{
			posY += (tgtY-posY)/10*cnt;
		}
		window.scrollTo(0,posY);
		cnt++;
	}
  },interval);
}

function getInsideWindowHeight() {
	if(window.innerHeight) {
		return window.innerHeight;
	}else if(document.compatMode && document.compatMode.indexOf("CSS1")>=0) {
		return document.body.parentElement.clientHeight;
	}else if(document.body && document.body.clientHeight) {
		return document.body.clientHeight;
	}
	return 0;
}

function showHide(s){
	var nm=document.getElementById(s);
	if(nm.style.display=='block'){
		nm.style.display='none';
	}else{
		nm.style.display='block';
	}
}

function toggleExcerpt(o) {
  var bqNode = o.parentNode.nextSibling;
  while (bqNode.nodeName.toUpperCase() != "DIV") {
    bqNode = bqNode.nextSibling;
  }
  if (bqNode.style.display == "none") {
    bqNode.style.display = "block";
    o.alt = "Collapse excerpt";
    o.src = "../img/close.gif";
  } else {
    bqNode.style.display = "none";
    o.alt = "Expand excerpt"
    o.src = "../img/expand.gif";
  }
}
