
var popUpWin=0;
var spopUpWin=0;
function popUpWindow(URLStr, width, height, scrolls)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
 var iMyWidth;
 var iMyHeight;
 iMyWidth = (window.screen.width/2) - (width/2 + 10); 
 iMyHeight = (window.screen.height/2) - (height/2 + 50); 
  
  if (scrolls != "yes") { scolls = "no"; }
  
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+scrolls+',resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+iMyWidth+', top='+iMyHeight+',screenX='+iMyWidth+',screenY='+iMyHeight+'');
}
 
function close_popUp() {
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  } 
}

function spopUpWindow(URLStr, width, height, scrolls)
{
  if(spopUpWin)
  {
    if(!spopUpWin.closed) spopUpWin.close();
  }
 var iMyWidth;
 var iMyHeight;
 iMyWidth = (window.screen.width/2) - (width/2 + 10); 
 iMyHeight = (window.screen.height/2) - (height/2 + 50); 
  
  if (scrolls != "yes") { scolls = "no"; }
  
  spopUpWin = open(URLStr, 'spopUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+scrolls+',resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+iMyWidth+', top='+iMyHeight+',screenX='+iMyWidth+',screenY='+iMyHeight+'');
}
 
function sclose_popUp() {
  if(spopUpWin)
  {
    if(!spopUpWin.closed) spopUpWin.close();
  } 
}

function Verse_Submit(e) {
	if (e.value == 0) { return false; }
	else { document.forms["verse"].submit(); }
	return true;
	}

function GotoTopic(id) {
	window.top.location = 'topics.php?t_id='+id;
	return true;	
	}
	
function GotoChapter(url,urlStr) {
	window.top.location = url+'?'+urlStr;
	return true;	
	}	
	
function ChangeImg(size) {
	if (size == 1) {
	document.getElementById("gimage").style.cssText = "width: 500px; ";
	} else if (size == 2) {
	document.getElementById("gimage").style.cssText = "width: 760px; ";
	} else if (size == 3) {
	document.getElementById("gimage").style.cssText = "width: 100%; ";
	} 	
}	

function SearchEnter(cc,e) {
	if (cc==13) {
		e.submit();
 }
}