/*
 * Name:        common.js
 * 
 * Description: Common Javascript functions. 
 *  
 * Created:     May 21, 2006
 * Developer:   shadfield - for Blue's Arthouse
 *              www.bluesarthouse.com
 */
/*------------------------------------------------------------
 * function showAlert() - Display an alert to inform the user
 * about something. Text filled by page. If alert_text is filled,
 * artb_head.php will execute on load to display.
 *------------------------------------------------------------
 */
function showAlert(text) 
{
	alert(text);
}

/*------------------------------------------------------------
 * function resetPage() - Resets the display_verses page.
 *------------------------------------------------------------
 */
function resetPage (f)
{
	f.book_id.value = 0;
	f.chapter_id.value = 0;
	f.verse_id.value = 0;
	f.action.value = 'getBooks';
	//alert('test='+f.book_id.value+'; action='+f.action.value);
	f.submit();
}

/*------------------------------------------------------------
 * function set_chkCredit() - NOT USED
 *------------------------------------------------------------
 */
function set_chkCredit(f)
{
   if (f.v_cchk.checked) {
      f.v_credit.value = "Y";
   }
   else {
      f.v_credit.value = "N";
   }

} /*--- end function: set_chkCredit() ---*/ 

/*------------------------------------------------------------
 * function checknumber() - NOT USED
 * By JavaScript Kit (www.javascriptkit.com)
 *------------------------------------------------------------
 */
function checknumber(f)
{
   var x=f.strongs.value
   var anum=/(^\d+$)|(^\d+\.\d+$)/
   if (anum.test(x))
      testresult=true
   else{
      alert("Please input a valid number!")
      testresult=false
   }
   return (testresult)

} /*--- end function: checknumber() ---*/ 

