//-------------------------------------
window.onerror = javaError
function javaError(message,url,line)
{  
try{
if (arguments.caller+"" == "null")
	{
	c = "Global"
	}
	else
	{
	var a = arguments.caller.callee+""
	var b = a.split("{")
	var c = b[0]
	}
} // end try
catch(e){}
finally{} 
var emsg = "BW - JAVA SCRIPT ERROR - V1 "
emsg += "\n Last function= :-"+c 
emsg += "\n Script= :- "+location.pathname
emsg += "\n Error = "+message
emsg += "\n At line :- "+line
emsg += "\n URL:-"+url
//src   = document.documentElement.innerHTML 
//src   = document.documentElement.outerHTML
//alert(src)
/*
src       = src.replace(/\x0a/g,"")
lineArray = src.split(/\x0d/)
source    = ""	
lowLine  = line-3
hiLine   = line+3 
for (i=0;i<lineArray.length;i++)
{	
	c = i+1	
	if (c >= lowLine && c <= hiLine)
	{ 
	source += "\n"+c+"  "+lineArray[i]
	}
}
alert(emsg +"\n\n Source \n"+source) 
*/ 
alert(emsg)	
//sendLogMsg(escape(emsg),"red","html")
if (url.search(/localhost/i) == -1)
{ 
//sendLogMsg(emsg,"red","html")
} 
return true
} 
//--------------------------------------------------------------------------------  
function sendLogMsg(M,C) 
{ 
folder    = getHTMLFolder()
window.open(folder+"/serverScripts/sendLogMsg.asp?msg="+escape(M)+"&color="+C,"_blank","height=200,width=200")
}
//-------------------------------------- 
function getHTMLFolder()
{				
var l = location+""	
	if (l.search(/localhost/i) != -1)
	{	
	return "http://localhost/bishopswaltham/html"
	}
	else
	{	
	return "http://bishopswaltham.net"
	}	
}
//-------------------------------------------------------------------------------

